summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ObsoleteFiles.inc114
-rw-r--r--UPDATING4
-rw-r--r--etc/Makefile3
-rw-r--r--etc/defaults/rc.conf13
-rw-r--r--etc/isdn/Makefile25
-rwxr-xr-xetc/isdn/answer97
-rw-r--r--etc/isdn/holidays.D51
-rw-r--r--etc/isdn/isdnd.rates.A39
-rw-r--r--etc/isdn/isdnd.rates.D50
-rw-r--r--etc/isdn/isdnd.rates.F152
-rw-r--r--etc/isdn/isdnd.rates.L45
-rw-r--r--etc/isdn/isdnd.rates.UK.BT61
-rw-r--r--etc/isdn/isdnd.rc.sample409
-rw-r--r--etc/isdn/isdntel.alias.sample21
-rwxr-xr-xetc/isdn/isdntel.sh98
-rwxr-xr-xetc/isdn/record99
-rwxr-xr-xetc/isdn/tell87
-rwxr-xr-xetc/isdn/tell-record89
-rwxr-xr-xetc/isdn/unknown_incoming79
-rw-r--r--etc/mtree/BSD.include.dist2
-rw-r--r--etc/mtree/BSD.root.dist2
-rw-r--r--etc/mtree/BSD.usr.dist10
-rwxr-xr-xetc/netstart1
-rwxr-xr-xetc/rc.d/Makefile2
-rw-r--r--etc/rc.d/NETWORKING2
-rw-r--r--etc/rc.d/isdnd56
-rw-r--r--etc/rc.d/ppp2
-rw-r--r--include/Makefile15
-rw-r--r--share/Makefile5
-rw-r--r--share/examples/Makefile32
-rw-r--r--share/examples/isdn/FAQ1079
-rw-r--r--share/examples/isdn/KERNEL82
-rw-r--r--share/examples/isdn/Overview307
-rw-r--r--share/examples/isdn/README342
-rw-r--r--share/examples/isdn/ROADMAP86
-rw-r--r--share/examples/isdn/ReleaseNotes196
-rw-r--r--share/examples/isdn/Resources82
-rw-r--r--share/examples/isdn/SupportedCards196
-rw-r--r--share/examples/isdn/ThankYou289
-rw-r--r--share/examples/isdn/contrib/README42
-rw-r--r--share/examples/isdn/contrib/anleitung.ppp142
-rw-r--r--share/examples/isdn/contrib/answer.c178
-rw-r--r--share/examples/isdn/contrib/answer.sh111
-rw-r--r--share/examples/isdn/contrib/convert.sh86
-rw-r--r--share/examples/isdn/contrib/hplay.c241
-rw-r--r--share/examples/isdn/contrib/i4b-ppp-newbie.txt237
-rw-r--r--share/examples/isdn/contrib/isdnctl111
-rw-r--r--share/examples/isdn/contrib/isdnd_acct137
-rw-r--r--share/examples/isdn/contrib/isdnd_acct.pl258
-rw-r--r--share/examples/isdn/contrib/isdntelmux.c197
-rw-r--r--share/examples/isdn/contrib/mrtg-isp0.sh53
-rw-r--r--share/examples/isdn/i4brunppp/Makefile19
-rw-r--r--share/examples/isdn/i4brunppp/README18
-rw-r--r--share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc65
-rw-r--r--share/examples/isdn/i4brunppp/i4brunppp.851
-rw-r--r--share/examples/isdn/i4brunppp/i4brunppp.c224
-rw-r--r--share/examples/isdn/v21/Makefile13
-rw-r--r--share/examples/isdn/v21/README50
-rw-r--r--share/examples/isdn/v21/v21modem.c394
-rw-r--r--share/examples/ppp/isdnd.rc69
-rw-r--r--share/examples/ppp/ppp.conf.isdn98
-rw-r--r--share/examples/ppp/ppp.conf.sample2
-rw-r--r--share/isdn/0.al.uu323
-rw-r--r--share/isdn/1.al.uu323
-rw-r--r--share/isdn/2.al.uu278
-rw-r--r--share/isdn/3.al.uu323
-rw-r--r--share/isdn/4.al.uu323
-rw-r--r--share/isdn/5.al.uu369
-rw-r--r--share/isdn/6.al.uu278
-rw-r--r--share/isdn/7.al.uu232
-rw-r--r--share/isdn/8.al.uu323
-rw-r--r--share/isdn/9.al.uu232
-rw-r--r--share/isdn/Makefile15
-rw-r--r--share/isdn/beep.al.uu107
-rw-r--r--share/isdn/msg.al.uu1506
-rw-r--r--share/man/man4/netgraph.415
-rw-r--r--share/man/man4/sppp.44
-rw-r--r--share/man/man5/rc.conf.573
-rw-r--r--share/man/man5/src.conf.55
-rw-r--r--share/man/man7/hier.78
-rw-r--r--share/mk/bsd.own.mk2
-rw-r--r--sys/Makefile2
-rw-r--r--sys/amd64/conf/NOTES114
-rw-r--r--sys/conf/files60
-rw-r--r--sys/conf/files.i38677
-rw-r--r--sys/conf/files.pc9877
-rw-r--r--sys/conf/options8
-rw-r--r--sys/conf/options.amd6413
-rw-r--r--sys/conf/options.i38636
-rw-r--r--sys/conf/options.pc9813
-rw-r--r--sys/i386/conf/NOTES230
-rw-r--r--sys/i4b/capi/README150
-rw-r--r--sys/i4b/capi/capi.h130
-rw-r--r--sys/i4b/capi/capi_l4if.c447
-rw-r--r--sys/i4b/capi/capi_llif.c163
-rw-r--r--sys/i4b/capi/capi_msgs.c950
-rw-r--r--sys/i4b/capi/capi_msgs.h381
-rw-r--r--sys/i4b/capi/iavc/iavc.h446
-rw-r--r--sys/i4b/capi/iavc/iavc_card.c285
-rw-r--r--sys/i4b/capi/iavc/iavc_isa.c289
-rw-r--r--sys/i4b/capi/iavc/iavc_lli.c986
-rw-r--r--sys/i4b/capi/iavc/iavc_pci.c272
-rw-r--r--sys/i4b/driver/i4b_ctl.c213
-rw-r--r--sys/i4b/driver/i4b_ing.c856
-rw-r--r--sys/i4b/driver/i4b_ipr.c1034
-rw-r--r--sys/i4b/driver/i4b_isppp.c677
-rw-r--r--sys/i4b/driver/i4b_rbch.c826
-rw-r--r--sys/i4b/driver/i4b_tel.c1664
-rw-r--r--sys/i4b/driver/i4b_trace.c430
-rw-r--r--sys/i4b/include/i4b_cause.h148
-rw-r--r--sys/i4b/include/i4b_debug.h302
-rw-r--r--sys/i4b/include/i4b_global.h130
-rw-r--r--sys/i4b/include/i4b_ioctl.h744
-rw-r--r--sys/i4b/include/i4b_isdnq931.h167
-rw-r--r--sys/i4b/include/i4b_l1l2.h90
-rw-r--r--sys/i4b/include/i4b_l2l3.h116
-rw-r--r--sys/i4b/include/i4b_l3l4.h274
-rw-r--r--sys/i4b/include/i4b_mbuf.h56
-rw-r--r--sys/i4b/include/i4b_rbch_ioctl.h54
-rw-r--r--sys/i4b/include/i4b_tel_ioctl.h94
-rw-r--r--sys/i4b/include/i4b_trace.h91
-rw-r--r--sys/i4b/layer1/i4b_hdlc.c135
-rw-r--r--sys/i4b/layer1/i4b_hdlc.h300
-rw-r--r--sys/i4b/layer1/i4b_l1.h87
-rw-r--r--sys/i4b/layer1/i4b_l1dmux.c421
-rw-r--r--sys/i4b/layer1/i4b_l1lib.c75
-rw-r--r--sys/i4b/layer1/ifpi/i4b_ifpi_ext.h62
-rw-r--r--sys/i4b/layer1/ifpi/i4b_ifpi_isac.c658
-rw-r--r--sys/i4b/layer1/ifpi/i4b_ifpi_l1.c236
-rw-r--r--sys/i4b/layer1/ifpi/i4b_ifpi_l1fsm.c509
-rw-r--r--sys/i4b/layer1/ifpi/i4b_ifpi_pci.c1494
-rw-r--r--sys/i4b/layer1/ifpi2/i4b_ifpi2_ext.h65
-rw-r--r--sys/i4b/layer1/ifpi2/i4b_ifpi2_isacsx.c593
-rw-r--r--sys/i4b/layer1/ifpi2/i4b_ifpi2_isacsx.h574
-rw-r--r--sys/i4b/layer1/ifpi2/i4b_ifpi2_l1.c236
-rw-r--r--sys/i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c508
-rw-r--r--sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c1449
-rw-r--r--sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c1397
-rw-r--r--sys/i4b/layer1/ifpnp/i4b_ifpnp_ext.h63
-rw-r--r--sys/i4b/layer1/ifpnp/i4b_ifpnp_isac.c659
-rw-r--r--sys/i4b/layer1/ifpnp/i4b_ifpnp_l1.c237
-rw-r--r--sys/i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c510
-rw-r--r--sys/i4b/layer1/ihfc/i4b_ihfc.h338
-rw-r--r--sys/i4b/layer1/ihfc/i4b_ihfc_drv.c1760
-rw-r--r--sys/i4b/layer1/ihfc/i4b_ihfc_drv.h231
-rw-r--r--sys/i4b/layer1/ihfc/i4b_ihfc_ext.h63
-rw-r--r--sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c510
-rw-r--r--sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c445
-rw-r--r--sys/i4b/layer1/isic/i4b_asuscom_ipac.c234
-rw-r--r--sys/i4b/layer1/isic/i4b_avm_a1.c413
-rw-r--r--sys/i4b/layer1/isic/i4b_bchan.c398
-rw-r--r--sys/i4b/layer1/isic/i4b_ctx_s0P.c316
-rw-r--r--sys/i4b/layer1/isic/i4b_diva.c398
-rw-r--r--sys/i4b/layer1/isic/i4b_drn_ngo.c260
-rw-r--r--sys/i4b/layer1/isic/i4b_dynalink.c233
-rw-r--r--sys/i4b/layer1/isic/i4b_elsa_pcc16.c391
-rw-r--r--sys/i4b/layer1/isic/i4b_elsa_qs1i.c237
-rw-r--r--sys/i4b/layer1/isic/i4b_elsa_qs1p.c353
-rw-r--r--sys/i4b/layer1/isic/i4b_hscx.c648
-rw-r--r--sys/i4b/layer1/isic/i4b_hscx.h298
-rw-r--r--sys/i4b/layer1/isic/i4b_ipac.h205
-rw-r--r--sys/i4b/layer1/isic/i4b_isac.c655
-rw-r--r--sys/i4b/layer1/isic/i4b_isac.h389
-rw-r--r--sys/i4b/layer1/isic/i4b_isic.c494
-rw-r--r--sys/i4b/layer1/isic/i4b_isic.h330
-rw-r--r--sys/i4b/layer1/isic/i4b_isic_ext.h49
-rw-r--r--sys/i4b/layer1/isic/i4b_isic_isa.c207
-rw-r--r--sys/i4b/layer1/isic/i4b_isic_pnp.c333
-rw-r--r--sys/i4b/layer1/isic/i4b_itk_ix1.c402
-rw-r--r--sys/i4b/layer1/isic/i4b_l1.c249
-rw-r--r--sys/i4b/layer1/isic/i4b_l1fsm.c506
-rw-r--r--sys/i4b/layer1/isic/i4b_siemens_isurf.c230
-rw-r--r--sys/i4b/layer1/isic/i4b_sws.c212
-rw-r--r--sys/i4b/layer1/isic/i4b_tel_s016.c372
-rw-r--r--sys/i4b/layer1/isic/i4b_tel_s0163.c375
-rw-r--r--sys/i4b/layer1/isic/i4b_tel_s08.c302
-rw-r--r--sys/i4b/layer1/isic/i4b_usr_sti.c498
-rw-r--r--sys/i4b/layer1/itjc/i4b_hdlc.h319
-rw-r--r--sys/i4b/layer1/itjc/i4b_itjc_ext.h60
-rw-r--r--sys/i4b/layer1/itjc/i4b_itjc_isac.c545
-rw-r--r--sys/i4b/layer1/itjc/i4b_itjc_l1.c236
-rw-r--r--sys/i4b/layer1/itjc/i4b_itjc_l1fsm.c513
-rw-r--r--sys/i4b/layer1/itjc/i4b_itjc_pci.c2142
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic.h223
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic_bchan.c767
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic_dchan.c467
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic_ext.h49
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic_fsm.c223
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic_l1if.c145
-rw-r--r--sys/i4b/layer1/iwic/i4b_iwic_pci.c310
-rw-r--r--sys/i4b/layer1/iwic/i4b_w6692.h263
-rw-r--r--sys/i4b/layer2/i4b_iframe.c270
-rw-r--r--sys/i4b/layer2/i4b_l2.c385
-rw-r--r--sys/i4b/layer2/i4b_l2.h351
-rw-r--r--sys/i4b/layer2/i4b_l2fsm.c1578
-rw-r--r--sys/i4b/layer2/i4b_l2fsm.h82
-rw-r--r--sys/i4b/layer2/i4b_l2timer.c232
-rw-r--r--sys/i4b/layer2/i4b_lme.c135
-rw-r--r--sys/i4b/layer2/i4b_mbuf.c217
-rw-r--r--sys/i4b/layer2/i4b_sframe.c207
-rw-r--r--sys/i4b/layer2/i4b_tei.c278
-rw-r--r--sys/i4b/layer2/i4b_uframe.c277
-rw-r--r--sys/i4b/layer2/i4b_util.c305
-rw-r--r--sys/i4b/layer3/i4b_l2if.c680
-rw-r--r--sys/i4b/layer3/i4b_l3.h83
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.c1037
-rw-r--r--sys/i4b/layer3/i4b_l3fsm.h106
-rw-r--r--sys/i4b/layer3/i4b_l3timer.c325
-rw-r--r--sys/i4b/layer3/i4b_l4if.c322
-rw-r--r--sys/i4b/layer3/i4b_q931.c714
-rw-r--r--sys/i4b/layer3/i4b_q931.h125
-rw-r--r--sys/i4b/layer3/i4b_q932fac.c541
-rw-r--r--sys/i4b/layer3/i4b_q932fac.h168
-rw-r--r--sys/i4b/layer4/i4b_i4bdrv.c865
-rw-r--r--sys/i4b/layer4/i4b_l4.c1097
-rw-r--r--sys/i4b/layer4/i4b_l4.h73
-rw-r--r--sys/i4b/layer4/i4b_l4mgmt.c436
-rw-r--r--sys/i4b/layer4/i4b_l4timer.c88
-rw-r--r--sys/pc98/conf/NOTES138
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc57
-rw-r--r--tools/build/options/WITHOUT_I4B2
-rw-r--r--tools/kerneldoc/subsys/Dependencies2
-rw-r--r--tools/kerneldoc/subsys/Doxyfile-i4b21
-rw-r--r--usr.sbin/Makefile4
-rw-r--r--usr.sbin/i4b/Makefile7
-rw-r--r--usr.sbin/i4b/Makefile.inc16
-rw-r--r--usr.sbin/i4b/dtmfdecode/Makefile19
-rw-r--r--usr.sbin/i4b/dtmfdecode/dtmfdecode.170
-rw-r--r--usr.sbin/i4b/dtmfdecode/dtmfdecode.c152
-rw-r--r--usr.sbin/i4b/dtmfdecode/dtmfsounds.al.uu2098
-rw-r--r--usr.sbin/i4b/g711conv/Makefile11
-rw-r--r--usr.sbin/i4b/g711conv/g711conv.193
-rw-r--r--usr.sbin/i4b/g711conv/g711conv.c307
-rw-r--r--usr.sbin/i4b/isdnd/Makefile37
-rw-r--r--usr.sbin/i4b/isdnd/alias.c193
-rw-r--r--usr.sbin/i4b/isdnd/config.h61
-rw-r--r--usr.sbin/i4b/isdnd/controller.c539
-rw-r--r--usr.sbin/i4b/isdnd/curses.c891
-rw-r--r--usr.sbin/i4b/isdnd/dial.c161
-rw-r--r--usr.sbin/i4b/isdnd/exec.c407
-rw-r--r--usr.sbin/i4b/isdnd/fsm.c446
-rw-r--r--usr.sbin/i4b/isdnd/holiday.c198
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.8428
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.acct.5108
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.h907
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.rates.5117
-rw-r--r--usr.sbin/i4b/isdnd/isdnd.rc.51115
-rw-r--r--usr.sbin/i4b/isdnd/log.c249
-rw-r--r--usr.sbin/i4b/isdnd/main.c840
-rw-r--r--usr.sbin/i4b/isdnd/monitor.c1284
-rw-r--r--usr.sbin/i4b/isdnd/msghdl.c1350
-rw-r--r--usr.sbin/i4b/isdnd/pathnames.h61
-rw-r--r--usr.sbin/i4b/isdnd/pcause.c230
-rw-r--r--usr.sbin/i4b/isdnd/process.c219
-rw-r--r--usr.sbin/i4b/isdnd/rates.c509
-rw-r--r--usr.sbin/i4b/isdnd/rc_config.c1865
-rw-r--r--usr.sbin/i4b/isdnd/rc_parse.y539
-rw-r--r--usr.sbin/i4b/isdnd/rc_scan.l209
-rw-r--r--usr.sbin/i4b/isdnd/support.c1169
-rw-r--r--usr.sbin/i4b/isdnd/timer.c447
-rw-r--r--usr.sbin/i4b/isdndebug/Makefile7
-rw-r--r--usr.sbin/i4b/isdndebug/isdndebug.8111
-rw-r--r--usr.sbin/i4b/isdndebug/main.c633
-rw-r--r--usr.sbin/i4b/isdndecode/Makefile8
-rw-r--r--usr.sbin/i4b/isdndecode/decode.h76
-rw-r--r--usr.sbin/i4b/isdndecode/facility.c1111
-rw-r--r--usr.sbin/i4b/isdndecode/facility.h180
-rw-r--r--usr.sbin/i4b/isdndecode/isdndecode.8176
-rw-r--r--usr.sbin/i4b/isdndecode/layer1.c82
-rw-r--r--usr.sbin/i4b/isdndecode/layer2.c300
-rw-r--r--usr.sbin/i4b/isdndecode/layer3.c516
-rw-r--r--usr.sbin/i4b/isdndecode/layer3_subr.c1122
-rw-r--r--usr.sbin/i4b/isdndecode/main.c794
-rw-r--r--usr.sbin/i4b/isdndecode/pcause.c330
-rw-r--r--usr.sbin/i4b/isdndecode/pcause.h111
-rw-r--r--usr.sbin/i4b/isdnmonitor/Makefile17
-rw-r--r--usr.sbin/i4b/isdnmonitor/curses.c624
-rw-r--r--usr.sbin/i4b/isdnmonitor/isdnmonitor.8178
-rw-r--r--usr.sbin/i4b/isdnmonitor/main.c1196
-rw-r--r--usr.sbin/i4b/isdnmonitor/monitor.h299
-rw-r--r--usr.sbin/i4b/isdnmonitor/monprivate.h210
-rw-r--r--usr.sbin/i4b/isdnphone/Makefile10
-rw-r--r--usr.sbin/i4b/isdnphone/audio.c159
-rw-r--r--usr.sbin/i4b/isdnphone/defs.h189
-rw-r--r--usr.sbin/i4b/isdnphone/display.c246
-rw-r--r--usr.sbin/i4b/isdnphone/isdn.c191
-rw-r--r--usr.sbin/i4b/isdnphone/isdnphone.888
-rw-r--r--usr.sbin/i4b/isdnphone/main.c533
-rw-r--r--usr.sbin/i4b/isdntel/Makefile10
-rw-r--r--usr.sbin/i4b/isdntel/alias.c141
-rw-r--r--usr.sbin/i4b/isdntel/alias.h51
-rw-r--r--usr.sbin/i4b/isdntel/defs.h157
-rw-r--r--usr.sbin/i4b/isdntel/display.c254
-rw-r--r--usr.sbin/i4b/isdntel/files.c308
-rw-r--r--usr.sbin/i4b/isdntel/isdntel.8103
-rw-r--r--usr.sbin/i4b/isdntel/main.c399
-rw-r--r--usr.sbin/i4b/isdntelctl/Makefile7
-rw-r--r--usr.sbin/i4b/isdntelctl/isdntelctl.899
-rw-r--r--usr.sbin/i4b/isdntelctl/main.c228
-rw-r--r--usr.sbin/i4b/isdntest/Makefile10
-rw-r--r--usr.sbin/i4b/isdntest/isdntest.8116
-rw-r--r--usr.sbin/i4b/isdntest/main.c745
-rw-r--r--usr.sbin/i4b/isdntrace/1tr6.c756
-rw-r--r--usr.sbin/i4b/isdntrace/Makefile9
-rw-r--r--usr.sbin/i4b/isdntrace/cable.txt62
-rw-r--r--usr.sbin/i4b/isdntrace/isdntrace.8228
-rw-r--r--usr.sbin/i4b/isdntrace/pcause_1tr6.c166
-rw-r--r--usr.sbin/i4b/isdntrace/pcause_1tr6.h70
-rw-r--r--usr.sbin/i4b/isdntrace/pcause_q850.c330
-rw-r--r--usr.sbin/i4b/isdntrace/pcause_q850.h111
-rw-r--r--usr.sbin/i4b/isdntrace/q921.c268
-rw-r--r--usr.sbin/i4b/isdntrace/q931.c800
-rw-r--r--usr.sbin/i4b/isdntrace/q931_util.c1047
-rw-r--r--usr.sbin/i4b/isdntrace/q932_fac.c1236
-rw-r--r--usr.sbin/i4b/isdntrace/q932_fac.h180
-rw-r--r--usr.sbin/i4b/isdntrace/trace.c848
-rw-r--r--usr.sbin/i4b/isdntrace/trace.h93
-rw-r--r--usr.sbin/i4b/isdntrace/unknownl3.c106
-rw-r--r--usr.sbin/i4b/man/Makefile9
-rw-r--r--usr.sbin/i4b/man/i4b.4110
-rw-r--r--usr.sbin/i4b/man/i4bcapi.459
-rw-r--r--usr.sbin/i4b/man/i4bctl.450
-rw-r--r--usr.sbin/i4b/man/i4bing.463
-rw-r--r--usr.sbin/i4b/man/i4bipr.496
-rw-r--r--usr.sbin/i4b/man/i4bisppp.4123
-rw-r--r--usr.sbin/i4b/man/i4bq921.448
-rw-r--r--usr.sbin/i4b/man/i4bq931.448
-rw-r--r--usr.sbin/i4b/man/i4brbch.449
-rw-r--r--usr.sbin/i4b/man/i4btel.4133
-rw-r--r--usr.sbin/i4b/man/i4btrc.454
-rw-r--r--usr.sbin/i4b/man/iavc.473
-rw-r--r--usr.sbin/i4b/man/ifpi.464
-rw-r--r--usr.sbin/i4b/man/ifpi2.460
-rw-r--r--usr.sbin/i4b/man/ifpnp.467
-rw-r--r--usr.sbin/i4b/man/ihfc.471
-rw-r--r--usr.sbin/i4b/man/isic.4359
-rw-r--r--usr.sbin/i4b/man/itjc.466
-rw-r--r--usr.sbin/i4b/man/iwic.468
-rwxr-xr-xusr.sbin/mergemaster/mergemaster.sh4
-rw-r--r--usr.sbin/ppp/Makefile10
-rw-r--r--usr.sbin/ppp/i4b.c446
-rw-r--r--usr.sbin/ppp/physical.c10
-rw-r--r--usr.sbin/ppp/ppp.8.m420
343 files changed, 136 insertions, 103830 deletions
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 295125f..b51f462 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -14,6 +14,120 @@
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
#
+# 20080525: I4B removed
+OLD_FILES+=etc/isdn/answer
+OLD_FILES+=etc/isdn/isdntel
+OLD_FILES+=etc/isdn/record
+OLD_FILES+=etc/isdn/tell
+OLD_FILES+=etc/isdn/tell-record
+OLD_FILES+=etc/isdn/unknown_incoming
+OLD_FILES+=etc/isdn/holidays.D
+OLD_FILES+=etc/isdn/isdnd.rates.A
+OLD_FILES+=etc/isdn/isdnd.rates.D
+OLD_FILES+=etc/isdn/isdnd.rates.F
+OLD_FILES+=etc/isdn/isdnd.rates.L
+OLD_FILES+=etc/isdn/isdnd.rates.UK.BT
+OLD_FILES+=etc/isdn/isdnd.rc.sample
+OLD_FILES+=etc/isdn/isdntel.alias.sample
+OLD_DIRS+=etc/isdn
+OLD_FILES+=etc/rc.d/isdnd
+OLD_FILES+=usr/include/i4b/i4b_cause.h
+OLD_FILES+=usr/include/i4b/i4b_debug.h
+OLD_FILES+=usr/include/i4b/i4b_ioctl.h
+OLD_FILES+=usr/include/i4b/i4b_rbch_ioctl.h
+OLD_FILES+=usr/include/i4b/i4b_tel_ioctl.h
+OLD_FILES+=usr/include/i4b/i4b_trace.h
+OLD_DIRS+=usr/include/i4b
+OLD_FILES+=usr/sbin/dtmfdecode
+OLD_FILES+=usr/sbin/g711conv
+OLD_FILES+=usr/sbin/isdnd
+OLD_FILES+=usr/sbin/isdndebug
+OLD_FILES+=usr/sbin/isdndecode
+OLD_FILES+=usr/sbin/isdnmonitor
+OLD_FILES+=usr/sbin/isdnphone
+OLD_FILES+=usr/sbin/isdntel
+OLD_FILES+=usr/sbin/isdntelctl
+OLD_FILES+=usr/sbin/isdntrace
+OLD_FILES+=usr/share/isdn/0.al
+OLD_FILES+=usr/share/isdn/1.al
+OLD_FILES+=usr/share/isdn/2.al
+OLD_FILES+=usr/share/isdn/3.al
+OLD_FILES+=usr/share/isdn/4.al
+OLD_FILES+=usr/share/isdn/5.al
+OLD_FILES+=usr/share/isdn/6.al
+OLD_FILES+=usr/share/isdn/7.al
+OLD_FILES+=usr/share/isdn/8.al
+OLD_FILES+=usr/share/isdn/9.al
+OLD_FILES+=usr/share/isdn/beep.al
+OLD_FILES+=usr/share/isdn/msg.al
+OLD_DIRS+=usr/share/isdn
+OLD_FILES+=usr/share/man/man1/dtmfdecode.1.gz
+OLD_FILES+=usr/share/man/man1/g711conv.1.gz
+OLD_FILES+=usr/share/man/man4/i4b.4.gz
+OLD_FILES+=usr/share/man/man4/i4bcapi.4.gz
+OLD_FILES+=usr/share/man/man4/i4bctl.4.gz
+OLD_FILES+=usr/share/man/man4/i4bing.4.gz
+OLD_FILES+=usr/share/man/man4/i4bipr.4.gz
+OLD_FILES+=usr/share/man/man4/i4bisppp.4.gz
+OLD_FILES+=usr/share/man/man4/i4bq921.4.gz
+OLD_FILES+=usr/share/man/man4/i4bq931.4.gz
+OLD_FILES+=usr/share/man/man4/i4brbch.4.gz
+OLD_FILES+=usr/share/man/man4/i4btel.4.gz
+OLD_FILES+=usr/share/man/man4/i4btrc.4.gz
+OLD_FILES+=usr/share/man/man4/iavc.4.gz
+OLD_FILES+=usr/share/man/man4/isic.4.gz
+OLD_FILES+=usr/share/man/man4/ifpi.4.gz
+OLD_FILES+=usr/share/man/man4/ifpi2.4.gz
+OLD_FILES+=usr/share/man/man4/ifpnp.4.gz
+OLD_FILES+=usr/share/man/man4/ihfc.4.gz
+OLD_FILES+=usr/share/man/man4/itjc.4.gz
+OLD_FILES+=usr/share/man/man4/iwic.4.gz
+OLD_FILES+=usr/share/man/man5/isdnd.rc.5.gz
+OLD_FILES+=usr/share/man/man5/isdnd.rates.5.gz
+OLD_FILES+=usr/share/man/man5/isdnd.acct.5.gz
+OLD_FILES+=usr/share/man/man8/isdnd.8.gz
+OLD_FILES+=usr/share/man/man8/isdndebug.8.gz
+OLD_FILES+=usr/share/man/man8/isdndecode.8.gz
+OLD_FILES+=usr/share/man/man8/isdnmonitor.8.gz
+OLD_FILES+=usr/share/man/man8/isdnphone.8.gz
+OLD_FILES+=usr/share/man/man8/isdntel.8.gz
+OLD_FILES+=usr/share/man/man8/isdntelctl.8.gz
+OLD_FILES+=usr/share/man/man8/isdntrace.8.gz
+OLD_FILES+=usr/share/examples/isdn/contrib/README
+OLD_FILES+=usr/share/examples/isdn/contrib/anleitung.ppp
+OLD_FILES+=usr/share/examples/isdn/contrib/answer.c
+OLD_FILES+=usr/share/examples/isdn/contrib/answer.sh
+OLD_FILES+=usr/share/examples/isdn/contrib/convert.sh
+OLD_FILES+=usr/share/examples/isdn/contrib/hplay.c
+OLD_FILES+=usr/share/examples/isdn/contrib/i4b-ppp-newbie.txt
+OLD_FILES+=usr/share/examples/isdn/contrib/isdnctl
+OLD_FILES+=usr/share/examples/isdn/contrib/isdnd_acct
+OLD_FILES+=usr/share/examples/isdn/contrib/isdnd_acct.pl
+OLD_FILES+=usr/share/examples/isdn/contrib/isdntelmux.c
+OLD_FILES+=usr/share/examples/isdn/contrib/mrtg-isp0.sh
+OLD_FILES+=usr/share/examples/isdn/i4brunppp/Makefile
+OLD_FILES+=usr/share/examples/isdn/i4brunppp/README
+OLD_FILES+=usr/share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc
+OLD_FILES+=usr/share/examples/isdn/i4brunppp/i4brunppp.8
+OLD_FILES+=usr/share/examples/isdn/i4brunppp/i4brunppp.c
+OLD_FILES+=usr/share/examples/isdn/v21/Makefile
+OLD_FILES+=usr/share/examples/isdn/v21/README
+OLD_FILES+=usr/share/examples/isdn/v21/v21modem.c
+OLD_FILES+=usr/share/examples/isdn/FAQ
+OLD_FILES+=usr/share/examples/isdn/KERNEL
+OLD_FILES+=usr/share/examples/isdn/Overview
+OLD_FILES+=usr/share/examples/isdn/README
+OLD_FILES+=usr/share/examples/isdn/ROADMAP
+OLD_FILES+=usr/share/examples/isdn/ReleaseNotes
+OLD_FILES+=usr/share/examples/isdn/Resources
+OLD_FILES+=usr/share/examples/isdn/SupportedCards
+OLD_FILES+=usr/share/examples/isdn/ThankYou
+OLD_DIRS+=usr/share/examples/isdn/contrib
+OLD_DIRS+=usr/share/examples/isdn/i4brunppp
+OLD_DIRS+=usr/share/examples/isdn/v21
+OLD_DIRS+=usr/share/examples/isdn
+OLD_FILES+=usr/share/examples/ppp/isdnd.rc
+OLD_FILES+=usr/share/examples/ppp/ppp.conf.isdn
# 20080420: Symbol card support dropped
OLD_FILES+=usr/include/dev/wi/spectrum24t_cf.h
# 20080420: awi removal
diff --git a/UPDATING b/UPDATING
index 43fee7d..2dd0767 100644
--- a/UPDATING
+++ b/UPDATING
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW:
to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
+20080525:
+ ISDN4BSD (I4B) was removed from the src tree. You may need to
+ update a your kernel configuration and remove relevant entries.
+
20080509:
I have checked in code to support multiple routing tables.
see the man pages setfib(1) and setfib(2).
diff --git a/etc/Makefile b/etc/Makefile
index 2483814..29e72aa 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -127,9 +127,6 @@ distribution:
${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
-.if ${MK_I4B} != "no"
- ${_+_}cd ${.CURDIR}/isdn; ${MAKE} install
-.endif
.if ${MK_BIND_MTREE} != "no"
@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
set -x; \
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 3d03b04..177f4d5 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -194,8 +194,8 @@ ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
# If you have any sppp(4) interfaces above, you might also want to set
# the following parameters. Refer to spppcontrol(8) for their meaning.
sppp_interfaces="" # List of sppp interfaces.
-#sppp_interfaces="isp0" # example: sppp over ISDN
-#spppconfig_isp0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'"
+#sppp_interfaces="...0" # example: sppp over ...
+#spppconfig_...0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'"
gif_interfaces="" # List of GIF tunnels.
#gif_interfaces="gif0 gif1" # Examples typically for a router.
# Choose correct tunnel addrs.
@@ -363,15 +363,6 @@ atm_enable="NO" # Configure ATM interfaces (or NO).
atm_pvcs="" # Set to PVC list (or leave empty).
atm_arps="" # Set to permanent ARP list (or leave empty).
-### ISDN interface options: (see also: /usr/share/examples/isdn) ###
-isdn_enable="NO" # Enable the ISDN subsystem (or NO).
-isdn_fsdev="NO" # Output device for fullscreen mode (or NO for daemon mode).
-isdn_flags="-dn -d0x1f9" # Flags for isdnd
-isdn_ttype="cons25" # terminal type for fullscreen mode
-isdn_screenflags="NO" # screenflags for ${isdn_fsdev}
-isdn_trace="NO" # Enable the ISDN trace subsystem (or NO).
-isdn_traceflags="-f /var/tmp/isdntrace0" # Flags for isdntrace
-
### Bluetooth ###
hcsecd_enable="NO" # Enable hcsecd(8) (or NO)
hcsecd_config="/etc/bluetooth/hcsecd.conf" # hcsecd(8) configuration file
diff --git a/etc/isdn/Makefile b/etc/isdn/Makefile
deleted file mode 100644
index 0f27b50..0000000
--- a/etc/isdn/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# $FreeBSD$
-
-NO_OBJ=
-
-SCRIPTS= answer \
- isdntel.sh \
- record \
- tell \
- tell-record \
- unknown_incoming
-
-FILES= holidays.D \
- isdnd.rates.A \
- isdnd.rates.D \
- isdnd.rates.F \
- isdnd.rates.L \
- isdnd.rates.UK.BT \
- isdnd.rc.sample \
- isdntel.alias.sample
-
-BINDIR= /etc/isdn
-BINMODE= 700
-FILESMODE= 600
-
-.include <bsd.prog.mk>
diff --git a/etc/isdn/answer b/etc/isdn/answer
deleted file mode 100755
index d39a983..0000000
--- a/etc/isdn/answer
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# answer script for i4b isdnd
-# ---------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Thu May 20 11:44:38 1999]
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-
-#FreeBSD < 3.1, NetBSD, OpenBSD, BSD/OS
-#LIBDIR=/usr/local/lib/isdn
-#FreeBSD 3.1 and up
-LIBDIR=/usr/share/isdn
-
-LOGFILE=/tmp/answer.log
-NCALLFILE=${VARDIR}/ncall
-DATE=`date +%d%H`
-DF=0
-dF=0
-sF=0
-
-if ! set -- `getopt D:d:s: $*`; then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-for i ; do
- case ${i} in
- -D)
- DEVICE=$2
- DF=1
- shift
- shift
- ;;
- -d)
- DEST=$2
- dF=1
- shift
- shift
- ;;
- -s)
- SRC=$2
- sF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-echo "" >>${LOGFILE}
-
-if [ "${DF}" -eq 0 -o "${dF}" -eq 0 -o "${sF}" -eq 0 ]; then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-echo "answer: device ${DEVICE} destination ${DEST} source ${SRC} " >>${LOGFILE}
-
-if [ -r "${NCALLFILE}" ]; then
- NCALL=`cat ${NCALLFILE}`
-else
- NCALL=0
-fi
-
-NCALL=`printf "%.4d" ${NCALL}`
-
-echo Date: `date` >> ${VARDIR}/I.${NCALL}.${DATE}
-
-if [ -n "${SRC}" ]; then
- echo "From: ${SRC}" >> ${VARDIR}/I.${NCALL}.${DATE}
-fi
-
-if [ -n "${DEST}" ]; then
- echo "To: ${DEST}" >> ${VARDIR}/I.${NCALL}.${DATE}
-fi
-
-if [ -r "${LIBDIR}/beep.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k # >/dev/null 2>&1
-fi
-
-if [ -r "${LIBDIR}/msg.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/msg.al bs=2k # >/dev/null 2>&1
- if [ -r "${LIBDIR}/beep.al" ]
- then
- dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k # >/dev/null 2>&1
- fi
-fi
-
-echo `expr ${NCALL} + 1` >${NCALLFILE}
diff --git a/etc/isdn/holidays.D b/etc/isdn/holidays.D
deleted file mode 100644
index 80b7259..0000000
--- a/etc/isdn/holidays.D
+++ /dev/null
@@ -1,51 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# german national holidays 2002/2003/2004
-# bundeseinheitliche Feiertage 2002/2003/2004
-# -------------------------------------------------------------
-#
-# last edit-date: [Sat Apr 13 14:22:43 2002]
-#
-# got from: http://www.ferienkalender.com/
-#
-# This file is only of value for installations which are
-# using the german Telekom "T-ISDN XXL" tariff where calls
-# on sundays and holidays are free of charge. Additional
-# configuration of /etc/isdnd.rc has to take place to enable
-# support for this tariff, see output of "man isdnd.rc" and
-# search for keyword "valid".
-#
-# $FreeBSD$
-#
-#---------------------------------------------------------------------------
-#
-# same day/month each year
-#
-1.1 Neujahr
-1.5 Tag der Arbeit
-3.10 Tag der deutschen Einheit
-25.12 1. Weihnachtsfeiertag
-26.12 2. Weihnachtsfeiertag
-#
-# 2002 - different day/month each year
-#
-29.3.2002 Karfreitag
-1.4.2002 Ostermontag
-9.5.2002 Christi Himmelfahrt
-20.5.2002 Pfingstmontag
-#
-# 2003 - different day/month each year
-#
-18.4.2003 Karfreitag
-21.4.2003 Ostermontag
-29.5.2003 Christi Himmelfahrt
-9.6.2003 Pfingstmontag
-#
-# 2004 - different day/month each year
-#
-9.4.2004 Karfreitag
-12.4.2004 Ostermontag
-20.5.2004 Christi Himmelfahrt
-31.5.2004 Pfingstmontag
-#
-# EOF
diff --git a/etc/isdn/isdnd.rates.A b/etc/isdn/isdnd.rates.A
deleted file mode 100644
index fa25b22..0000000
--- a/etc/isdn/isdnd.rates.A
+++ /dev/null
@@ -1,39 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# i4b - PTA Telekom charging rates config file
-# --------------------------------------------
-#
-# $Id: isdnd.rates.A,v 1.2 1999/12/13 21:25:24 hm Exp $
-#
-# $FreeBSD$
-#
-# last edit-date: [Mon Dec 13 21:42:02 1999]
-#
-# -mr updated to reflect last Telekom changes as of 1.9.99
-#
-#---------------------------------------------------------------------------
-#
-# reference: http://www.pta.at/
-#
-#---------------------------------------------------------------------------
-#
-# Syntax:
-# -------
-# rate-code: ra0 = Online Tarif
-# Day-No: 0-6, where 0 = Sunday, 1 = Monday, etc.
-# Rate: start_hour.minutes-end_hour.minutes:period in seconds
-#
-#------------------------------------------------------------------------------
-#
-#=================== Online ==================================
-#
-#rate-code Day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra0 0 00.00-24.00:360
-ra0 1 00.00-08.00:360 08.00-18.00:120 18.00-24.00:360
-ra0 2 00.00-08.00:360 08.00-18.00:120 18.00-24.00:360
-ra0 3 00.00-08.00:360 08.00-18.00:120 18.00-24.00:360
-ra0 4 00.00-08.00:360 08.00-18.00:120 18.00-24.00:360
-ra0 5 00.00-08.00:360 08.00-18.00:120 18.00-24.00:360
-ra0 6 00.00-24.00:360
-#================== EOF ======================================
diff --git a/etc/isdn/isdnd.rates.D b/etc/isdn/isdnd.rates.D
deleted file mode 100644
index 388770e..0000000
--- a/etc/isdn/isdnd.rates.D
+++ /dev/null
@@ -1,50 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# i4b - Deutsche Telekom charging rates config file
-# -------------------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Sun Jan 17 18:38:29 1999]
-#
-# -hm updated to reflect last Telekom changes as of 1.1.99
-#
-#---------------------------------------------------------------------------
-#
-# reference: http://www.telekom.de/untern/tarife/inland/index.htm
-#
-#---------------------------------------------------------------------------
-#
-# Syntax:
-# -------
-# rate-code: ra0 = City, ra1 = Deutschland
-# Day-No: 0-6, where 0 = Sunday, 1 = Monday, etc.
-# Rate: start_hour.minutes-end_hour.minutes:period in seconds
-#
-#------------------------------------------------------------------------------
-#
-#=================== T-ISDN City =============================================================
-#
-#rate-code Day rate1 rate2 rate3 rate4 rate5
-#--------- --- --------------- --------------- --------------- --------------- ---------------
-ra0 0 00.00-05.00:240 05.00-21.00:150 21.00-24.00:240
-ra0 1 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 2 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 3 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 4 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 5 00.00-05.00:240 05.00-09.00:150 09.00-18.00:90 18.00-21.00:150 21.00-24.00:240
-ra0 6 00.00-05.00:240 05.00-21.00:150 21.00-24.00:240
-#
-#=================== T-ISDN Deutschland ======================================================
-#
-#rate-code Day rate1 rate2 rate3 rate4 rate5
-#--------- --- --------------- --------------- --------------- --------------- ---------------
-ra1 0 00.00-24.00:60
-ra1 1 00.00-02.00:60 02.00-05.00:120 05.00-09.00:60 09.00-18.00:30 18.00-24.00:60
-ra1 2 00.00-02.00:60 02.00-05.00:120 05.00-09.00:60 09.00-18.00:30 18.00-24.00:60
-ra1 3 00.00-02.00:60 02.00-05.00:120 05.00-09.00:60 09.00-18.00:30 18.00-24.00:60
-ra1 4 00.00-02.00:60 02.00-05.00:120 05.00-09.00:60 09.00-18.00:30 18.00-24.00:60
-ra1 5 00.00-02.00:60 02.00-05.00:120 05.00-09.00:60 09.00-18.00:30 18.00-24.00:60
-ra1 6 00.00-24.00:60
-#
-#================== EOF ======================================================================
diff --git a/etc/isdn/isdnd.rates.F b/etc/isdn/isdnd.rates.F
deleted file mode 100644
index 6a73b75..0000000
--- a/etc/isdn/isdnd.rates.F
+++ /dev/null
@@ -1,152 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# i4b - Tarifs France Telecom
-# ---------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Thu Mar 19 20:05:18 1998]
-#
-# -hm got from Aurelien Bargy <dj@dial.oleane.com>
-#
-#---------------------------------------------------------------------------
-#
-# a jour au 1.10.97
-# Aurelien Bargy - 18.03.97
-#
-# I wrote a rates file for France. It is rather approximative
-# because some time ago France Telecom decided to abandon the charging
-# units system. The problem is, on ISDN lines charging units are still
-# used for the aocd system, even as it gives a completely false price
-# for a communication, so "abandoning" the msg_charging_unit system for
-# French users of i4b is not a good idea :))
-#
-#---------------------------------------------------------------------------
-#
-# Syntax:
-# -------
-# rate-code: ra0 = local ; ra1 = zone 1 ; ra2 = zone 2...
-# plus quelques tarifs internationaux
-# Day-No: 0-6, where 0 = Sunday, 1 = Monday, etc.
-# Rate: start_hour.minutes-end_hour.minutes:period in seconds
-#
-#------------------------------------------------------------------------
-#
-#========================== Communications locales ======================
-#rate-code Day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra0 0 00.00-24.00:317
-ra0 1 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 2 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 3 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 4 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 5 00.00-08.00:317 08.00-19.00:158 19.00-24.00:317
-ra0 6 00.00-08.00:317 08.00-12.00:158 12.00-24.00:317
-#
-#
-#
-#================== Zone 1 : < 25 km ==================================
-#
-#rate-code Day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra1 0 00.00-24.00:222
-ra1 1 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 2 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 3 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 4 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 5 00.00-08.00:222 08.00-19.00:111 19.00-24.00:222
-ra1 6 00.00-08.00:222 08.00-12.00:111 12.00-24.00:222
-#
-#
-#
-#================== Zone 2 : 25-30 km =================================
-#
-#rate-code Day rate1 rate2 rate3
-#--------- --- --------------- --------------- --------------
-ra2 0 00.00-24.00:148
-ra2 1 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 2 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 3 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 4 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 5 00.00-08.00:148 08.00-19.00:74 19.00-24.00:148
-ra2 6 00.00-08.00:148 08.00-12.00:74 12.00-24.00:148
-#
-#=================== Zone 3 : 30-52 km ================================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra3 0 00.00-24.00:94
-ra3 1 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 2 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 3 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 4 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 5 00.00-08.00:94 08.00-19.00:47 19.00-24.00:94
-ra3 6 00.00-08.00:94 08.00-12.00:47 12.00-24.00:94
-#
-#
-#=================== Zone 4 : > 52 km =================================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra4 0 00.00-24.00:78
-ra4 1 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 2 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 3 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 4 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 5 00.00-08.00:78 08.00-19.00:39 19.00-24.00:78
-ra4 6 00.00-08.00:78 08.00-12.00:39 12.00-24.00:78
-#
-#
-#=================== INTERNATIONAL : Allemagne ========================
-# (pour appeler Hellmuth)
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra5 0 00.00-24.00:27
-ra5 1 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 2 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 3 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 4 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 5 00.00-08.00:27 08.00-19.00:21 19.00-24.00:27
-ra5 6 00.00-08.00:27 08.00-12.00:21 12.00-24.00:27
-#
-#
-#=================== INTERNATIONAL : Pays-Bas ==========================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra6 0 00.00-24.00:25
-ra6 1 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 2 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 3 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 4 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 5 00.00-08.00:25 08.00-19.00:20 19.00-24.00:25
-ra6 6 00.00-08.00:25 08.00-12.00:20 12.00-24.00:25
-#
-#
-#=================== INTERNATIONAL : Portugal ===========================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra7 0 00.00-24.00:22
-ra7 1 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 2 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 3 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 4 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 5 00.00-08.00:22 08.00-19.00:18 19.00-24.00:22
-ra7 6 00.00-08.00:22 08.00-12.00:18 12.00-24.00:22
-#
-#
-#=================== INTERNATIONAL : USA/Canada ========================
-#
-#rate-code day rate1 rate2 rate3
-#--------- --- --------------- --------------- ---------------
-ra8 0 00.00-24.00:25
-ra8 1 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 2 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 3 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 4 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 5 00.00-13.00:25 13.00-19.00:20 19.00-24.00:25
-ra8 6 00.00-24.00:25
-#
-#================== EOF ==============================================
diff --git a/etc/isdn/isdnd.rates.L b/etc/isdn/isdnd.rates.L
deleted file mode 100644
index d3992b0..0000000
--- a/etc/isdn/isdnd.rates.L
+++ /dev/null
@@ -1,45 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# i4b - Luxembourg PT charging rates config file
-# -------------------------------------------------
-#
-# $Id: isdnd.rates.L,v 1.2 1999/12/13 21:25:24 hm Exp $
-#
-# $FreeBSD$
-#
-# last edit-date: [Mon Dec 13 21:42:33 1999]
-#
-# Sent in by Joakim Hernberg, Digital Design Luxembourg sarl, jbh@ddl.lu
-#
-#---------------------------------------------------------------------------
-#
-# reference: http://www.pt.lu
-#
-#---------------------------------------------------------------------------
-#
-# Syntax:
-# -------
-# rate-code: ra0 = Luxembourg normal isdn call
-# rate-code: ra1 = Luxembourg PT Internet access
-# Day-No: 0-6, where 0 = Sunday, 1 = Monday, etc.
-# Rate: start_hour.minutes-end_hour.minutes:period in seconds
-#
-#------------------------------------------------------------------------------
-#
-#rate-code Day rate1 rate2 rate3 rate4 rate5
-#--------- --- --------------- --------------- --------------- --------------- ----------------
-ra0 0 00.00-24.00:960
-ra0 1 00.00-06.00:960 06.00-08.00:480 08.00-19.00:240 19.00-23.00:480 23.00-24.00:960
-ra0 2 00.00-06.00:960 06.00-08.00:480 08.00-19.00:240 19.00-23.00:480 23.00-24.00:960
-ra0 3 00.00-06.00:960 06.00-08.00:480 08.00-19.00:240 19.00-23.00:480 23.00-24.00:960
-ra0 4 00.00-06.00:960 06.00-08.00:480 08.00-19.00:240 19.00-23.00:480 23.00-24.00:960
-ra0 5 00.00-06.00:960 06.00-08.00:480 08.00-19.00:240 19.00-23.00:480 23.00-24.00:960
-ra0 6 00.00-06.00:960 06.00-23.00:480 23.00-24.00:960
-
-ra1 0 00.00-24.00:60
-ra1 1 00.00-24.00:60
-ra1 2 00.00-24.00:60
-ra1 3 00.00-24.00:60
-ra1 4 00.00-24.00:60
-ra1 5 00.00-24.00:60
-ra1 6 00.00-24.00:60
diff --git a/etc/isdn/isdnd.rates.UK.BT b/etc/isdn/isdnd.rates.UK.BT
deleted file mode 100644
index c4d34ec..0000000
--- a/etc/isdn/isdnd.rates.UK.BT
+++ /dev/null
@@ -1,61 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# i4b - BT charges
-# -------------------------------------------------
-#
-# $FreeBSD$
-#
-# Barry A. Scott barry@scottb.demon.co.uk
-#
-#---------------------------------------------------------------------------
-#
-# reference: http://www.bt.com/Business/price_frm.htm
-# (I use the bussiness figures as the Ex VAT gives more
-# accurate rate data because BT round the Inc VAT figures)
-#
-#---------------------------------------------------------------------------
-#
-# Syntax:
-# -------
-# rate-code: ra0 = Local, ra1 = Regional, ra2 = National
-# Day-No: 0-6, where 0 = Sunday, 1 = Monday, etc.
-# Rate: start_hour.minutes-end_hour.minutes:period in seconds
-#
-#------------------------------------------------------------------------------
-#
-#=================== Local =========================================================================
-#
-#rate-code Day rate1 rate2 rate1
-#--------- --- --------------- --------------- ---------------
-ra0 0 00.00-24.00:296
-ra0 1 00.00-08.00:200 08.00-18.00:75 18.00-00.00:200
-ra0 2 00.00-08.00:200 08.00-18.00:75 18.00-00.00:200
-ra0 3 00.00-08.00:200 08.00-18.00:75 18.00-00.00:200
-ra0 4 00.00-08.00:200 08.00-18.00:75 18.00-00.00:200
-ra0 5 00.00-08.00:200 08.00-18.00:75 18.00-00.00:200
-ra0 6 00.00-24.00:296
-#
-#=================== Regional =========================================================================
-#
-#rate-code Day rate1 rate2 rate1
-#--------- --- --------------- --------------- ---------------
-ra1 0 00.00-24.00:100
-ra1 1 00.00-08.00:75 08.00-18.00:37 18.00-00.00:75
-ra1 2 00.00-08.00:75 08.00-18.00:37 18.00-00.00:75
-ra1 3 00.00-08.00:75 08.00-18.00:37 18.00-00.00:75
-ra1 4 00.00-08.00:75 08.00-18.00:37 18.00-00.00:75
-ra1 5 00.00-08.00:75 08.00-18.00:37 18.00-00.00:75
-ra1 6 00.00-24.00:100
-#
-#=================== National =========================================================================
-#
-#rate-code Day rate1 rate2 rate1
-#--------- --- --------------- --------------- ---------------
-ra2 0 00.00-24.00:100
-ra2 1 00.00-08.00:71 08.00-18.00:37 18.00-00.00:71
-ra2 2 00.00-08.00:71 08.00-18.00:37 18.00-00.00:71
-ra2 3 00.00-08.00:71 08.00-18.00:37 18.00-00.00:71
-ra2 4 00.00-08.00:71 08.00-18.00:37 18.00-00.00:71
-ra2 5 00.00-08.00:71 08.00-18.00:37 18.00-00.00:71
-ra2 6 00.00-24.00:100
-#================== EOF ============================================================================================================
diff --git a/etc/isdn/isdnd.rc.sample b/etc/isdn/isdnd.rc.sample
deleted file mode 100644
index 3878e7c..0000000
--- a/etc/isdn/isdnd.rc.sample
+++ /dev/null
@@ -1,409 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# example of a configuration file for the isdn daemon
-# ---------------------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Sun May 27 09:33:59 2001]
-#
-# NOTICE:
-# =======
-# This configuration file is an EXAMPLE only and MUST be edited
-# carefully to get the desired results!
-#
-# Please read the "isdnd.rc" manual page (execute "man isdnd.rc")
-# for reference !
-#
-#------------------------------------------------------------------------------
-
-#==============================================================================
-# SYSTEM section: isdnd global configuration parameters
-#==============================================================================
-system
-
-# accounting
-# ----------
-
-acctall = on # generate info for everything
-acctfile = /var/log/isdnd.acct # name & location of accounting file
-useacctfile = yes # generate accouting info to file
-
-# monitor
-# -------
-
-monitor-allowed = no # global switch: monitor on/off
-monitor-port = 451 # default monitor TCP port
-
-# Monitor rights are granted due to the most specific host/net spec, i.e. in
-# the example below host 192.168.1.2 will have the rights specified on that
-# line, even so it belongs to net 192.168.1.0/24 as well.
-#
-# A monitor specification may either be:
-#
-# - the name of a local (UNIX-domain) socket; this MUST start with a "/"
-monitor = "/var/run/isdn-monitor"
-monitor-access = fullcmd
-monitor-access = channelstate, logevents
-monitor-access = callin, callout
-#
-# - a dotted-quad host spec
-monitor = "192.168.1.2"
-monitor-access = restrictedcmd, channelstate, callin, callout
-#
-# - a dotted-quad net spec with "/len" (CIDR-style) netmask spec
-monitor = "192.168.1.0/24"
-monitor-access = restrictedcmd, channelstate, callin, callout
-#
-# - a resolveable host name
-monitor = "rumolt"
-monitor-access = restrictedcmd, channelstate, callin, callout
-#
-# - a resolveable net name with "/len" netmask (s.a.) appended
-monitor = "up-vision-net/24"
-monitor-access = restrictedcmd, channelstate, callin, callout
-
-# ratesfile
-# ---------
-
-ratesfile = /etc/isdn/isdnd.rates # name & location of rates file
-
-# regular expression pattern matching
-# -----------------------------------
-
-#regexpr = "connected.*XXX" # look for matches in log messages
-#regprog = connectXXX # execute program when match is found
-
-regexpr = "<unknown> incoming call from"
-regprog = unknown_incoming # execute program whan match is found
-
-# realtime priority section
-# -------------------------
-
-rtprio = 25 # modify isdnd's process priority
-
-#===========================================================================
-# controller section
-#===========================================================================
-controller
-
-firmware = /etc/isdn/b1.t4 # microcode for an AVM B1 controller
-
-#==============================================================================
-# entry section: IP over ISDN example - i call back the remote end
-#==============================================================================
-entry
-
-name = I4BIP # name for reference. This name will
- # be used in the logfile to identfy
- # this entry.
-
- # the network or telephone device
- # the data traffic should be routed to:
-usrdevicename = ipr # ipr, isp, tel, rbch
-usrdeviceunit = 0 # unit number
-
- # the ISDN controller number to be
- # used for this entry:
-isdncontroller = 0 # controller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # incoming only, outgoing only or both:
-direction = inout # in, out, inout
-
- # numbers used to verify a DIAL IN:
-local-phone-incoming = 321 # this is my number
-remote-phone-incoming = 0123456789 # this one can call in
-
- # numbers used at DIAL OUT time:
-local-phone-dialout = 321 # this is my number
-remote-phone-dialout = 00123456789 # i call this remote number
-
- # in case i have several remote
- # telephone numbers specified, this
- # is used to specify which one is
- # used next on dial fail or retry:
-remdial-handling = first # first, last or next
-
- # what happenes if someone dials in:
-dialin-reaction = callback # accept, reject, ignore, answer, callback
-
- # normal dialout or do i call back:
-dialout-type = normal # normal / calledback
-
-callbackwait = 1 # no of secs to wait before calling back
-
- # type of protocol on the B-channel:
- # hdlc must be specified for IP (the
- # ipr and isp drivers), raw must be
- # specified for telephone answering
-b1protocol = hdlc # hdlc, raw
-
- # shorthold mode and idle time
- # configuration:
-ratetype = 0 # ratesfile entry to use
-unitlength = 90 # unitlength to assume
-unitlengthsrc = rate # none, rate, cmdl, conf, aocd
-idletime-incoming = 120 # incoming call idle timeout
-idletime-outgoing = 60 # outgoing call idle timeout
-earlyhangup = 5 # time to hangup before an expected
- # next charging unit will occur
-
- # retry and recovery parameters
-dialretries = 3 # # of dial retries
-dialrandincr = off # random dial increment time
-recoverytime = 5 # time to wait between 2 dial tries
-usedown = off # set i/f down
-downtries = 5 # retry cycles before set down
-downtime = 30 # time to be in down before going up
-
-#connectprog = "ip-up" # run /etc/isdn/ip-up when an interface
- # has established its network connection.
- # example parameters are:
- # /etc/isdn/ip-up -d isp0 -f up -a 192.110.12.14
-#disconnectprog = "ip-down" # like connectprog, but run after the connection
- # is closed (ISDN layer down). The actual
- # interface address might not be known
- # any more. example parameters are:
- # /etc/isdn/ip-up -d isp0 -f down -a 0.0.0.0
-
-#==============================================================================
-# entry section: IP over ISDN example - i am called back by the remote end
-#==============================================================================
-entry
-
-name = I4BIP1 # name for reference
-
-usrdevicename = ipr # ipr, tel, rbch
-usrdeviceunit = 1 # unit number
-
-isdncontroller = 0 # controller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # numbers used to DIAL OUT
-remote-phone-dialout = 00401234567 # remote number to dial
-local-phone-dialout = 38 # our number to tell remote
-
- # numbers used to verify at DIAL IN
-local-phone-incoming = 38 # we take calls for this local number
-remote-phone-incoming = 00401234567 # we take calls from this remote machine
-
-b1protocol = hdlc # hdlc, raw
-
-ratetype = 0 # city
-unitlength = 90 # default unit length
-earlyhangup = 5 # safety zone
-unitlengthsrc = aocd # none, rate, cmdl, conf, aocd
-
-dialin-reaction = accept # accept, reject, ignore, anwer, callback
-
-dialout-type = calledback # normal or calledback
-
-dialretries = 3
-recoverytime = 3
-calledbackwait = 20
-dialrandincr = off
-
-usedown = off
-downtries = 2
-downtime = 30
-
-idletime-incoming = 300
-idletime-outgoing = 30
-
-#==============================================================================
-# entry section: answering machine example
-#==============================================================================
-entry
-
-name = I4BTEL # name for reference
-usrdevicename = tel # ipr, tel, rbch
-usrdeviceunit = 0 # unit number
-
-isdncontroller = 0 # controller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # numbers used to verify at DIAL IN
-local-phone-incoming = 456 # this is my number
-remote-phone-incoming = * # anyone can call in
-
-dialin-reaction = answer # accept, reject, ignore, answer
-
-answerprog = answer # program to run
-
-b1protocol = raw # hdlc, raw
-
-idletime-incoming = 5 # 5 seconds idle timeout
-
-#==============================================================================
-# kernel PPP (with budget handling) - Sunday & Holidays, we call back
-#==============================================================================
-entry
-
-valid = "0,7" # sundays & holidays
-
-name = KPPPs # name for reference
-
-usrdevicename = isp # ipr, tel, rbch
-usrdeviceunit = 0 # unit number
-
-isdncontroller = 1 # controller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # numbers used to verify at DIAL IN
-local-phone-incoming = 29 # this is my number
-remote-phone-incoming = 00401234567 # this one can call in
-
- # numbers used to DIAL OUT
-local-phone-dialout = 29 # this is my number
-remote-phone-dialout = 00401234567 # i call this number
-
-remdial-handling = first # first, last or next
-
-dialin-reaction = callback # accept, reject, ignore, answer, callback
-
-dialout-type = normal # normal / calledback
-
-b1protocol = hdlc # hdlc, raw
-
-idletime-incoming = 30 # incoming call idle timeout
-idletime-outgoing = 120 # outgoing call idle timeout
-
-unitlength = 360 # unitlength to assume
-unitlengthsrc = conf # none, rate, cmdl, conf, aocd
-
-dialretries = 5 # # of dial retries
-dialrandincr = on # random dial increment time
-recoverytime = 3 # time to wait between 2 dial tries
-
-callbackwait = 5 # time to wait to call back
-
-usedown = off # set i/f down
-downtries = 5 # retry cycles before set down
-downtime = 60 # time to be in down before going up
-
-budget-callbackperiod = 10800 # 3 hours
-budget-callbackncalls = 1000 # 2 callbacks in 3 hours
-budget-callbacksfile = /var/log/isdn/callbacks.isp0
-budget-callbacksfile-rotate = yes
-
-budget-calloutperiod = 3600 # 1 hour
-budget-calloutncalls = 1000 # 3 calls in 1 hour
-budget-calloutsfile = /var/log/isdn/callouts.isp0
-budget-calloutsfile-rotate = yes
-
-#==============================================================================
-# kernel PPP (with budget handling) - Monday-Saturday, 9:00-18:00: we call back
-#==============================================================================
-entry
-
-valid = "1,2,3,4,5,6,9:00-18:00" # Monday-Saturday, day
-
-name = KPPPd # name for reference
-
-usrdevicename = isp # ipr, tel, rbch
-usrdeviceunit = 0 # unit number
-
-isdncontroller = 1 # controller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # numbers used to verify at DIAL IN
-local-phone-incoming = 29 # this is my number
-remote-phone-incoming = 00401234567 # this one can call in
-
- # numbers used to DIAL OUT
-local-phone-dialout = 29 # this is my number
-remote-phone-dialout = 00401234567 # i call this number
-
-remdial-handling = first # first, last or next
-
-dialin-reaction = callback # accept, reject, ignore, answer, callback
-
-dialout-type = normal # normal / calledback
-
-b1protocol = hdlc # hdlc, raw
-
-idletime-incoming = 30 # incoming call idle timeout
-idletime-outgoing = 30 # outgoing call idle timeout
-
-unitlength = 60 # unitlength to assume
-unitlengthsrc = conf # none, rate, cmdl, conf, aocd
-
-dialretries = 5 # # of dial retries
-dialrandincr = on # random dial increment time
-recoverytime = 3 # time to wait between 2 dial tries
-
-callbackwait = 5 # time to wait to call back
-
-usedown = off # set i/f down
-downtries = 5 # retry cycles before set down
-downtime = 60 # time to be in down before going up
-
-budget-callbackperiod = 10800 # 3 hours
-budget-callbackncalls = 1 # 1 callbacks in 3 hours
-budget-callbacksfile = /var/log/isdn/callbacks.isp0
-budget-callbacksfile-rotate = yes
-
-budget-calloutperiod = 3600 # 1 hour
-budget-calloutncalls = 3 # 3 calls in 1 hour
-budget-calloutsfile = /var/log/isdn/callouts.isp0
-budget-calloutsfile-rotate = yes
-
-#==============================================================================
-# kernel PPP (with budget handling) - Monday-Saturday: we call back
-#==============================================================================
-entry
-
-valid = "1,2,3,4,5,6,18:00-9:00" # Monday-Saturday, night
-
-name = KPPPn # name for reference
-
-usrdevicename = isp # ipr, tel, rbch
-usrdeviceunit = 0 # unit number
-
-isdncontroller = 1 # controller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # numbers used to verify at DIAL IN
-local-phone-incoming = 29 # this is my number
-remote-phone-incoming = 00401234567 # this one can call in
-
- # numbers used to DIAL OUT
-local-phone-dialout = 29 # this is my number
-remote-phone-dialout = 00401234567 # i call this number
-
-remdial-handling = first # first, last or next
-
-dialin-reaction = callback # accept, reject, ignore, answer, callback
-
-dialout-type = normal # normal / calledback
-
-b1protocol = hdlc # hdlc, raw
-
-idletime-incoming = 30 # incoming call idle timeout
-idletime-outgoing = 30 # outgoing call idle timeout
-
-unitlength = 60 # unitlength to assume
-unitlengthsrc = conf # none, rate, cmdl, conf, aocd
-
-dialretries = 5 # # of dial retries
-dialrandincr = on # random dial increment time
-recoverytime = 3 # time to wait between 2 dial tries
-
-callbackwait = 5 # time to wait to call back
-
-usedown = off # set i/f down
-downtries = 5 # retry cycles before set down
-downtime = 60 # time to be in down before going up
-
-budget-callbackperiod = 7200 # 2 hours
-budget-callbackncalls = 2 # 2 callbacks in 2 hours
-budget-callbacksfile = /var/log/isdn/callbacks.isp0
-budget-callbacksfile-rotate = yes
-
-budget-calloutperiod = 3600 # 1 hour
-budget-calloutncalls = 3 # 3 calls in 1 hour
-budget-calloutsfile = /var/log/isdn/callouts.isp0
-budget-calloutsfile-rotate = yes
-
-# EOF #########################################################################
diff --git a/etc/isdn/isdntel.alias.sample b/etc/isdn/isdntel.alias.sample
deleted file mode 100644
index c06bc19..0000000
--- a/etc/isdn/isdntel.alias.sample
+++ /dev/null
@@ -1,21 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# alias file for the isdntel(1) application
-# -----------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Fri Dec 18 18:06:03 1998]
-#
-# -hm cleanup for release
-#
-#
-# the format is simple: the number beginning in column one followed
-# by one or more spaces or tabs. The rest of the line is taken as
-# and alias string for the number. Comment lines start with a "#".
-#
-#---------------------------------------------------------------------------
-123 alias for 123
-456 alias for 456
-789 alias for 789
-
diff --git a/etc/isdn/isdntel.sh b/etc/isdn/isdntel.sh
deleted file mode 100755
index 14f528a..0000000
--- a/etc/isdn/isdntel.sh
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# isdn telephone answering
-# -------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Thu May 20 11:45:04 1999]
-#
-#---------------------------------------------------------------------------
-#FreeBSD < 3.1, NetBSD, OpenBSD, BSD/OS
-#LIBDIR=/usr/local/lib/isdn
-#FreeBSD 3.1 and up
-LIBDIR=/usr/share/isdn
-
-VARDIR=/var/isdn
-DEVICE=/dev/i4btel0
-
-# sounds
-MESSAGE=${LIBDIR}/msg.al
-BEEP=${LIBDIR}/beep.al
-
-# dd options
-SKIP=25
-
-# max message size
-MAXMSIZ=100
-
-# src and dst telephone numbers
-src=
-dst=
-
-# current date
-DATE=`date`
-
-# check if directory exists
-if [ ! -d "${VARDIR}" ]
-then
- mkdir ${VARDIR}
-fi
-
-# get options
-if ! set -- `/usr/bin/getopt D:d:s: $*`; then
- echo "usage2: play -D device -d <dest-telno> -s <src-telno>"
- exit 1
-fi
-
-# process options
-for i ; do
- case $i in
- -D)
- DEVICE=$2; shift; shift;
- ;;
- -d)
- dst=$2; shift; shift;
- ;;
- -s)
- src=$2; shift; shift;
- ;;
- --)
- shift; break;
- ;;
- esac
-done
-
-# this is a __MUST__ in order to use the fullscreen inteface !!!
-
-FILEDATE=`date \+%y%m%d%H%M%S`
-
-# echo message to phone
-if [ -r "${MESSAGE}" ]; then
- /bin/dd of=${DEVICE} if=${MESSAGE} bs=2k >/dev/null 2>&1
-fi
-
-# echo beep to phone
-if [ -r "${BEEP}" ]; then
- /bin/dd of=${DEVICE} if=${BEEP} bs=2k >/dev/null 2>&1
-fi
-
-# start time
-START=`date \+%s`
-
-# get message from caller
-/bin/dd if=${DEVICE} of=${VARDIR}/${FILEDATE}-${dst}-${src} skip=${SKIP} bs=2k count=${MAXMSIZ} >/dev/null 2>&1
-
-# end time
-END=`date \+%s`
-
-# duration
-TIME=`expr ${END} - ${START}`
-
-# save recorded message
-if [ -r "${VARDIR}/${FILEDATE}-${dst}-${src}" ]; then
- mv ${VARDIR}/${FILEDATE}-${dst}-${src} ${VARDIR}/${FILEDATE}-${dst}-${src}-${TIME}
-fi
-
-exit 0
diff --git a/etc/isdn/record b/etc/isdn/record
deleted file mode 100755
index 61591fb..0000000
--- a/etc/isdn/record
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# answer and record message script for i4b isdnd
-# ----------------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Thu May 20 11:45:10 1999]
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-
-#FreeBSD < 3.1, NetBSD, OpenBSD, BSD/OS
-#LIBDIR=/usr/local/lib/isdn
-#FreeBSD 3.1 and up
-LIBDIR=/usr/share/isdn
-
-LOGFILE=/tmp/answer.log
-NCALLFILE=${VARDIR}/ncall
-DATE=`date +%d%H`
-DF=0
-dF=0
-sF=0
-
-if ! set -- `getopt D:d:s: $*`; then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-for i ; do
- case ${i} in
- -D)
- DEVICE=$2
- DF=1
- shift
- shift
- ;;
- -d)
- DEST=$2
- dF=1
- shift
- shift
- ;;
- -s)
- SRC=$2
- sF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-echo "" >>${LOGFILE}
-
-if [ "${DF}" -eq 0 -o "${dF}" -eq 0 -o "${sF}" -eq 0 ]; then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-echo "answer: device ${DEVICE} destination ${DEST} source ${SRC} " >>${LOGFILE}
-
-if [ -r "${NCALLFILE}" ]; then
- NCALL=`cat ${NCALLFILE}`
-else
- NCALL=0
-fi
-
-NCALL=`printf "%.4d" ${NCALL}`
-
-echo Date: `date` >> ${VARDIR}/I.${NCALL}.${DATE}
-
-if [ -n "${SRC}" ]; then
- echo "From: ${SRC}" >> ${VARDIR}/I.${NCALL}.${DATE}
-fi
-
-if [ -n "${DEST}" ]; then
- echo "To: ${DEST}" >> ${VARDIR}/I.${NCALL}.${DATE}
-fi
-
-if [ -r "${LIBDIR}/beep.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k >/dev/null 2>&1
-fi
-
-if [ -r "${LIBDIR}/msg.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/msg.al bs=2k >/dev/null 2>&1
-fi
-
-if [ -r "${LIBDIR}/beep.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k >/dev/null 2>&1
-fi
-
-dd if=${DEVICE} of=${VARDIR}/R.${NCALL}.${DATE} bs=2k >/dev/null 2>&1
-
-echo `expr $NCALL + 1` >$NCALLFILE
diff --git a/etc/isdn/tell b/etc/isdn/tell
deleted file mode 100755
index 047c834..0000000
--- a/etc/isdn/tell
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# tell called and calling numbers answer script for i4b isdnd
-# -----------------------------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Thu May 20 11:45:15 1999]
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-
-#FreeBSD < 3.1, NetBSD, OpenBSD, BSD/OS
-#LIBDIR=/usr/local/lib/isdn
-#FreeBSD 3.1 and up
-LIBDIR=/usr/share/isdn
-
-LOGFILE=/tmp/answer.log
-NCALLFILE=${VARDIR}/ncall
-DATE=`date +%d%H`
-DF=0
-dF=0
-sF=0
-
-if ! set -- `getopt D:d:s: $*`; then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-for i ; do
- case ${i} in
- -D)
- DEVICE=$2
- DF=1
- shift
- shift
- ;;
- -d)
- DEST=$2
- dF=1
- shift
- shift
- ;;
- -s)
- SRC=$2
- sF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-echo "" >>${LOGFILE}
-
-if [ "${DF}" -eq 0 -o "${dF}" -eq 0 -o "${sF}" -eq 0 ]; then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-echo "answer: device ${DEVICE} destination ${DEST} source ${SRC} " >>${LOGFILE}
-
-if [ -r "${LIBDIR}/beep.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k >/dev/null 2>&1
-fi
-
-# tell the caller the number he is calling from
-
-POS=1
-LENGTH=`expr ${SRC} : '.*'`
-
-while : ; do
- DIGIT=`echo ${SRC} | cut -c ${POS}`
- /bin/dd of=${DEVICE} if=${LIBDIR}/${DIGIT}.al bs=2k >/dev/null 2>&1
- POS=`expr ${POS} + 1`
- if [ "${POS}" -gt "${LENGTH}" ]; then
- break
- fi
-done
-
-if [ -r "${LIBDIR}/beep.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k >/dev/null 2>&1
-fi
diff --git a/etc/isdn/tell-record b/etc/isdn/tell-record
deleted file mode 100755
index ae4c8176..0000000
--- a/etc/isdn/tell-record
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# tell called and calling numbers answer script for i4b isdnd
-# -----------------------------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Tue Oct 31 10:59:49 2000]
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-
-#FreeBSD < 3.1, NetBSD, OpenBSD, BSD/OS
-#LIBDIR=/usr/local/lib/isdn
-#FreeBSD 3.1 and up
-LIBDIR=/usr/share/isdn
-
-LOGFILE=/tmp/answer.log
-NCALLFILE=${VARDIR}/ncall
-DATE=`date +%d%H`
-DF=0
-dF=0
-sF=0
-
-if ! set -- `getopt D:d:s: $*`; then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-for i ; do
- case ${i} in
- -D)
- DEVICE=$2
- DF=1
- shift
- shift
- ;;
- -d)
- DEST=$2
- dF=1
- shift
- shift
- ;;
- -s)
- SRC=$2
- sF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-echo "" >>${LOGFILE}
-
-if [ "${DF}" -eq 0 -o "${dF}" -eq 0 -o "${sF}" -eq 0 ]; then
- echo 'Usage: answer -D device -d destination -s source'
- exit 1
-fi
-
-echo "answer: device ${DEVICE} destination ${DEST} source ${SRC} " >>${LOGFILE}
-
-if [ -r "${LIBDIR}/beep.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k >/dev/null 2>&1
-fi
-
-# tell the caller the number he is calling from
-
-POS=1
-LENGTH=`expr ${SRC} : '.*'`
-
-while : ; do
- DIGIT=`echo ${SRC} | cut -c ${POS}`
- /bin/dd of=${DEVICE} if=${LIBDIR}/${DIGIT}.al bs=2k >/dev/null 2>&1
- POS=`expr ${POS} + 1`
- if [ "${POS}" -gt "${LENGTH}" ]; then
- break
- fi
-done
-
-if [ -r "${LIBDIR}/beep.al" ]; then
- dd of=${DEVICE} if=${LIBDIR}/beep.al bs=2k >/dev/null 2>&1
-fi
-
-dd if=${DEVICE} of=${VARDIR}/recorded.msg bs=2k >/dev/null 2>&1
diff --git a/etc/isdn/unknown_incoming b/etc/isdn/unknown_incoming
deleted file mode 100755
index 5debe21..0000000
--- a/etc/isdn/unknown_incoming
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# unknown_incoming - script for isdnd
-# -----------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Wed Jan 10 13:40:36 2001]
-#
-# This script may be configured to be called by isdnd when an
-# unknown incoming call is received. In case the destination
-# telephone number is available, it sends mail with the time,
-# source and destination numbers to a configurable address.
-#
-# For this to work, and entry like this:
-#
-# regexpr = "<unknown> incoming call from"
-# regprog = unknown_incoming
-#
-# is needed in the system section of /etc/isdn/isdnd.rc.
-#
-# This script has to be configured to the sites needs, look
-# for the comment lines start with "configure:"
-#
-#---------------------------------------------------------------------------
-#
-# configure: who shall receive the mail
-mailaddr=root
-#
-from=`echo $* | awk '{print $6}'`
-to=`echo $* | awk '{print $8}'`
-test=`echo $* | awk '{print $9}'`
-ctrl=`echo $* | awk '{print $10}'`
-date=`date "+%b %d"`
-time=`date "+%H:%M"`
-mach=`hostname`
-
-# configure: list of destination numbers to ignore
-case "$from" in
- "NotAvailable" ) exit 0 ;;
- "00401234567"* ) exit 0 ;;
- "00407654321" ) exit 0 ;;
-esac
-
-# configure: how to name the line on which this was received
-if [ $test = "ctrl" ]
-then
- case "$ctrl" in
- "1")
- line="PBX 1"
- ;;
- "2")
- line="PBX 2"
- ;;
- *)
- line="controller is $ctrl"
- ;;
- esac
-else
- line="test is $test, controller is $ctrl"
-fi
-
-cat << ENDOFDATA | mail -s "isdnd: unknown incoming telephone call" $mailaddr
-
-Unknown incoming telephone call recognized:
-
- Date: $date
- Time: $time
- Line: $line
- From: $from
- To: $to
-
- Sincerly yours,
- the isdnd on $mach
-
-ENDOFDATA
-
-exit 0
diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist
index bfc598b..dfc53b7 100644
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -189,8 +189,6 @@
..
gssapi
..
- i4b
- ..
isofs
cd9660
..
diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist
index 2fac377..2bbd28c 100644
--- a/etc/mtree/BSD.root.dist
+++ b/etc/mtree/BSD.root.dist
@@ -32,8 +32,6 @@
..
gss
..
- isdn mode=0700
- ..
mail
..
mtree
diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index f047d65..df3777b 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -221,14 +221,6 @@
..
iscsi
..
- isdn
- contrib
- ..
- i4brunppp
- ..
- v21
- ..
- ..
kld
cdev
module
@@ -344,8 +336,6 @@
..
info
..
- isdn
- ..
locale
UTF-8
..
diff --git a/etc/netstart b/etc/netstart
index 9dfd039..b964663 100755
--- a/etc/netstart
+++ b/etc/netstart
@@ -52,7 +52,6 @@ _start=quietstart
/etc/rc.d/netif ${_start}
/etc/rc.d/ipsec ${_start}
/etc/rc.d/dhclient ${_start}
-/etc/rc.d/isdnd ${_start}
/etc/rc.d/ppp ${_start}
/etc/rc.d/ipfw ${_start}
/etc/rc.d/ip6fw ${_start}
diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile
index bfb1bfc..7be483d 100755
--- a/etc/rc.d/Makefile
+++ b/etc/rc.d/Makefile
@@ -16,7 +16,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
hostapd hostid hostname \
idmapd inetd initrandom \
ip6addrctl ip6fw ipfilter ipfs ipfw ipmon \
- ipnat ipsec ipxrouted isdnd \
+ ipnat ipsec ipxrouted \
jail \
kadmind kerberos kernel keyserv kldxref kpasswdd \
ldconfig local localpkg lockd lpd \
diff --git a/etc/rc.d/NETWORKING b/etc/rc.d/NETWORKING
index 21b584b..f290d3b 100644
--- a/etc/rc.d/NETWORKING
+++ b/etc/rc.d/NETWORKING
@@ -4,7 +4,7 @@
#
# PROVIDE: NETWORKING NETWORK
-# REQUIRE: netif netoptions routing network_ipv6 isdnd ppp
+# REQUIRE: netif netoptions routing network_ipv6 ppp
# REQUIRE: routed mrouted route6d mroute6d resolv
# This is a dummy dependency, for services which require networking
diff --git a/etc/rc.d/isdnd b/etc/rc.d/isdnd
deleted file mode 100644
index ab38764..0000000
--- a/etc/rc.d/isdnd
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-# Mostly based on original script (/etc/rc.isdn) written by Hellmuth Michaelis
-#
-
-# PROVIDE: isdnd
-# REQUIRE: netif FILESYSTEMS cleanvar
-# KEYWORD: nojail
-
-. /etc/rc.subr
-
-name="isdnd"
-rcvar=`set_rcvar isdn`
-pidfile="/var/run/${name}.pid"
-command="/usr/sbin/isdnd"
-start_cmd="isdnd_start"
-
-isdnd_start()
-{
- echo -n 'ISDN subsystem setup:'
-
- # Start isdnd
- #
- echo -n ' isdnd'
- case ${isdn_fsdev} in
- [Nn][Oo] | '')
- /usr/sbin/isdnd ${isdn_flags}
- ;;
- *)
- # Change vidmode of ${isdn_fsdev}
- #
- case ${isdn_screenflags} in
- [Nn][Oo])
- ;;
- *)
- /usr/sbin/vidcontrol < ${isdn_fsdev} > ${isdn_fsdev} 2>&1 ${isdn_screenflags}
- ;;
- esac
-
- /usr/sbin/isdnd ${isdn_flags} -f -r ${isdn_fsdev} -t ${isdn_ttype}
- ;;
- esac
-
- # Start isdntrace
- #
- if checkyesno isdn_trace; then
- echo -n ' isdntrace'
- nohup /usr/sbin/isdntrace ${isdn_traceflags} >/dev/null 2>&1 &
- fi
- echo '.'
-}
-
-load_rc_config $name
-run_rc_command "$1"
diff --git a/etc/rc.d/ppp b/etc/rc.d/ppp
index 2ab1696..b3991fe 100644
--- a/etc/rc.d/ppp
+++ b/etc/rc.d/ppp
@@ -4,7 +4,7 @@
#
# PROVIDE: ppp
-# REQUIRE: netif isdnd
+# REQUIRE: netif
# KEYWORD: nojail
. /etc/rc.subr
diff --git a/include/Makefile b/include/Makefile
index 2f28ec8..46381db 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -26,9 +26,6 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \
wctype.h wordexp.h
-I4BHDRS=i4b_cause.h i4b_debug.h i4b_ioctl.h i4b_rbch_ioctl.h \
- i4b_tel_ioctl.h i4b_trace.h
-
MHDRS= float.h floatingpoint.h stdarg.h
PHDRS= sched.h semaphore.h _semaphore.h
@@ -181,13 +178,6 @@ copies:
cd ${.CURDIR}/../sys/crypto; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
${DESTDIR}${INCLUDEDIR}/crypto
-.if ${MACHINE_ARCH} == "i386"
-.if ${MK_I4B} != "no"
- cd ${.CURDIR}/../sys/i4b/include; \
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${I4BHDRS} \
- ${DESTDIR}${INCLUDEDIR}/i4b
-.endif
-.endif
cd ${.CURDIR}/../sys/opencrypto; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
${DESTDIR}${INCLUDEDIR}/crypto
@@ -269,11 +259,6 @@ symlinks:
ln -fs ../../../sys/crypto/$$h \
${DESTDIR}${INCLUDEDIR}/crypto; \
done
- cd ${.CURDIR}/../sys/i4b/include; \
- for h in ${I4BHDRS}; do \
- ln -fs ../../../sys/i4b/include/$$h \
- ${DESTDIR}${INCLUDEDIR}/i4b; \
- done
cd ${.CURDIR}/../sys/opencrypto; \
for h in *.h; do \
ln -fs ../../../sys/opencrypto/$$h \
diff --git a/share/Makefile b/share/Makefile
index bd3f439..5143ea8 100644
--- a/share/Makefile
+++ b/share/Makefile
@@ -9,7 +9,6 @@ SUBDIR= ${_colldef} \
${_dict} \
${_doc} \
${_examples} \
- ${_isdn} \
${_man} \
${_me} \
misc \
@@ -52,10 +51,6 @@ _me= me
_examples= examples
.endif
-.if ${MK_I4B} != "no"
-_isdn= isdn
-.endif
-
.if ${MK_DICT} != "no"
_dict= dict
.endif
diff --git a/share/examples/Makefile b/share/examples/Makefile
index 6e1fb70..b5e2ab3 100644
--- a/share/examples/Makefile
+++ b/share/examples/Makefile
@@ -15,7 +15,6 @@ LDIRS= BSD_daemon \
find_interface \
ibcs2 \
ipfw \
- isdn \
kld \
libvgl \
mdoc \
@@ -77,35 +76,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \
ibcs2/README \
ibcs2/hello.uu \
ipfw/change_rules.sh \
- isdn/FAQ \
- isdn/KERNEL \
- isdn/Overview \
- isdn/README \
- isdn/ROADMAP \
- isdn/ReleaseNotes \
- isdn/Resources \
- isdn/SupportedCards \
- isdn/ThankYou \
- isdn/contrib/README \
- isdn/contrib/anleitung.ppp \
- isdn/contrib/answer.c \
- isdn/contrib/answer.sh \
- isdn/contrib/convert.sh \
- isdn/contrib/hplay.c \
- isdn/contrib/i4b-ppp-newbie.txt \
- isdn/contrib/isdnctl \
- isdn/contrib/isdnd_acct \
- isdn/contrib/isdnd_acct.pl \
- isdn/contrib/isdntelmux.c \
- isdn/contrib/mrtg-isp0.sh \
- isdn/i4brunppp/Makefile \
- isdn/i4brunppp/README \
- isdn/i4brunppp/i4brunppp-isdnd.rc \
- isdn/i4brunppp/i4brunppp.8 \
- isdn/i4brunppp/i4brunppp.c \
- isdn/v21/Makefile \
- isdn/v21/README \
- isdn/v21/v21modem.c \
kld/Makefile \
kld/cdev/Makefile \
kld/cdev/README \
@@ -146,9 +116,7 @@ XFILES= BSD_daemon/FreeBSD.pfa \
ppi/Makefile \
ppi/ppilcd.c \
ppp/chap-auth \
- ppp/isdnd.rc \
ppp/login-auth \
- ppp/ppp.conf.isdn \
ppp/ppp.conf.sample \
ppp/ppp.conf.span-isp \
ppp/ppp.conf.span-isp.working \
diff --git a/share/examples/isdn/FAQ b/share/examples/isdn/FAQ
deleted file mode 100644
index f3a4fda..0000000
--- a/share/examples/isdn/FAQ
+++ /dev/null
@@ -1,1079 +0,0 @@
--------------------------------------------------------------------------------
-
- ISDN4BSD Frequently Asked Questions
- ===================================
-
- last edit-date: [Wed Nov 1 15:08:03 2000]
-
- $FreeBSD$
-
---------------------------------------------------------------------------------
-
-Contents:
-=========
-
- 1. How do I get started with synchronous PPP (sPPP) ?
- 2. does anyone know a software that can receive/send fax over ISDN ?
- 3. does i4b callback only work with setups where the remote end
- returns a busy ?
- 4. trouble with kernel options IPFIREWALL and IPDIVERT and natd
- 5. I want to use -r with isdnd but it does not work
- 6. How do I configure and run the answering machine ?
- 7. Teles S0/16.3 ... unknown ?
- 8. How do i integrate a new lowlevel driver into i4b ?
- 9. Why it always says "no Space in TX FIFO - State F4 awaiting" ?
- 10. Incoming alert - what does it mean ?
- 11. How do i change irq's on my teles 16.3 card ?
- 12. NL: i'm getting CAUSE 100 or CAUSE 101 when dialling out
- 14. I'm using sPPP. I can connect to my ISP but no TCP/IP services work. HELP!
- 15. i4b 0.80.00: problems with AVM Fritz PCI
- 16. How do i setup logfile rotation for isdnd ?
- 17. How do i setup dialin from Windows NT RAS to i4b ?
- 18. How can I convert my old .g711a files to the new format?
- 19. I have lots of old .g711a files to convert what can I do?
- 20. How can I convert the .al files to Sun/NeXT .au/.snd/.vox files?
- 21. Help, isdn4bsd 0.82 fails to probe my Elsa PCC-16!
- 22. How do i enable and configure userland PPP with i4b ?
- 23. What is the procedure to install a new i4b on FreeBSD 3.x ?
- 24. Why do i get "ifconfig: ioctl (SIOCAIFADDR): file exists" ?
- 25. How to properly operate isdnd's fullscreen output in a 132x60 vty
- 26. NetBSD: i see isic0 while booting but I cannot access my Fritz!Card
- 27. i4b_pci_attach: pci_map_port 1 failed! What does this mean ?
- 28. What is: i4b-L2 i4b_rxd_ack: ((N(R)-1)=35) != (UA=36) !!!
- 29. Why does isdnd take up 95% CPU time ?
-
-
-1. How do I get started with synchronous PPP (sPPP) ?
-================================================================================
-
- Of course you first have to have sPPP interfaces in your kernel. If
- you installed everything using FreeBSD/install.sh then the correct
- entries should have been automatically made in /sys/conf/files for you.
- For NetBSD it isn't quite as simple since NetBSD/install-netbsd.sh does
- not do it for you.
-
- Then all you need to do is put an entry like this:
-
- device "i4bisppp" 4
-
- into your kernel configuration file (if it's not already there) and
- generate and boot the new kernel. The above line will give you 4
- sPPP interfaces - isp0 to isp3.
-
- Then just modify /etc/isdn/isdnd.rc (see the example in etc-isdn/isdnd.rc)
- to suit your needs (telephone numbers, etc).
-
- The next step is to read the ispppcontrol man page and then to look at
- etc/rc.isdn-PPP. ispppcontrol is a very important component in getting
- sPPP working correctly and the ispppcontrol lines in your /etc/rc.isdn
- must be correct.
-
- In my experience there are two things which can cause problems:
-
- 1) the authproto line has to agree with what your ISP desires. In
- general I've found that it's best to have something like this -
-
- ispppcontrol <interface> myauthproto={pap,chap} myauthname=<AuthName>
- myauthsecret=<AuthSecret> hisauthproto=none callin
-
- The "hisauthproto=none" is usually needed because the ISP does not want
- to authorise himself to you; he expects you to authorize yourself to him !
- I once forgot to set hisauthproto and it took me quite a while to figure
- out why I couldn't connect.
-
- 2) the IP address at your ISP's end must be correct.
-
- How can I find out (1) whether my ISP wants pap or chap and (2) what his
- IP address is ? you might ask. Generally, your ISP should have provide
- this information to you. But, if he didn't, or you've mislayed the
- documentation (as I did), there's still hope.
-
- Fortunately, J"org Wunsch implemented the sPPP kernel code so that it
- provides all the information required if the interface is configured
- with the debug flag set (e.g. ``ifconfig isp0 debug''). It's just a
- little cryptic.
-
- By the way, I suggest turning the debug flag on until you have things
- working and then turning it off. The debug output is rather voluminous
- and could fill up your /var partition, otherwise.
-
- The debug output will appear on the console and also be logged to
- /var/log/messages (under FreeBSD) unless you changed /etc/syslog.conf.
-
- A. How to figure out the authproto
- ----------------------------------
-
- Here is an example where I configured isp0 with myauthproto=pap, my
- ISP wanted chap, but was willing to accept pap:
-
- /kernel: isp0: lcp up(starting)
- /kernel: isp0: lcp output <conf-req id=0x7 len=10 5-6-34-e4-30-5a>
- /kernel: isp0: lcp input(req-sent): <conf-req id=0x1 len=30 0-4-0-0-1-4-5-
- f4-3-5-c2-23-5-11-4-5-f4-13-9-3-0-c0-7b-6e-fe-b5>
- ^^^^^
- |___ c223 is chap, it's what the ISP wants to use
-
- /kernel: isp0: lcp parse opts: 0x0 [rej] mru auth-proto 0x11 [rej]
- x13 [rej] send conf-rej (I didn't agree)
- /kernel: isp0: lcp output <conf-rej id=0x1 len=21 0-4-0-0-11-4-5-f4-13-9-3-
- 0-c0-7b-6e-fe-b5>
- /kernel: isp0: lcp input(req-sent): <conf-ack id=0x7 len=10 5-6-34-e4-30-5a>
- /kernel: isp0: lcp input(ack-rcvd): <conf-req id=0x2 len=13 1-4-5-f4-3-5-
- c2-23-5>
- /kernel: isp0: lcp parse opts: mru auth-proto
- /kernel: isp0: lcp parse opt values: mru 1524 auth-proto [mine 0x0 !=
- his chap] send conf-nak (we want to use pap, not chap)
- /kernel: isp0: lcp output <conf-nak id=0x2 len=9 3-5-c0-23-5>
- ^^^^^
- |___ c023 is pap
-
- /kernel: isp0: lcp input(ack-rcvd): <conf-req id=0x3 len=12 1-4-5-f4-3-4-
- c0-23> (he agrees to use pap)
- /kernel: isp0: lcp parse opts: mru auth-proto
- /kernel: isp0: lcp parse opt values: mru 1524 auth-proto send conf-ack
- /kernel: isp0: lcp output <conf-ack id=0x3 len=12 1-4-5-f4-3-4-c0-23>
- he agrees to use pap ___|^^^^^
-
- so, if you have problems in the lcp phase, check which authentication method
- your ISP wants to use. Usually chap is prefered, but pap will be accepted.
-
- B. How to figure out the ISP's IP address
- -----------------------------------------
-
- ======================================================================
-
- UPDATE NOTE (February 8, 1999):
-
- Jan Riedinger writes:
- ---------------------
- >I further think Gary should mention
- >in the FAQ in the section "B. How to figure out the ISP's IP address
- >that it isn't normaly necessary to do it because of the auto
- >address negotiation.
-
- Gary answers:
- -------------
- I think you're right. I wrote that stuff before the support for
- negotiation of the IPS's address was added to if_spppsubr.c.
-
- ======================================================================
-
-
- I also intentionally configured the interface with the wrong address for
- my ISP, like this:
-
- ifconfig isp0 0.0.0.0 10.0.0.1 debug link1
-
- this means that I want the ISP to assign me an address (the 0.0.0.0) and
- that I expect him to use 10.0.0.1 (which is wrong). Here's the result:
- (note that these addresses have been changed by me)
-
- /kernel: isp0: phase network
- /kernel: isp0: ipcp open(initial)
- /kernel: isp0: ipcp up(starting)
- /kernel: isp0: ipcp output <conf-req id=0x9 len=10 3-6-0-0-0-0>
- /kernel: isp0: ipcp input(req-sent): <conf-req id=0x1 len=16 2-6-0-2d-f-1-
- 3-6-c-22-38-4e>
- /kernel: isp0: ipcp parse opts: compression [rej] address send conf-rej
- /kernel: isp0: ipcp output <conf-rej id=0x1 len=10 2-6-0-2d-f-1>
- /kernel: isp0: ipcp input(req-sent): <conf-nak id=0x9 len=10 3-6-c-22-38-4e>
- /kernel: isp0: ipcp nak opts: address [wantaddr 12.34.56.78] [agree]
- ^^^^^
- |___ he assigns me this
-
- /kernel: isp0: ipcp output <conf-req id=0xa len=10 3-6-c3-b4-eb-63>
- /kernel: isp0: ipcp input(req-sent): <conf-req id=0x2 len=10 3-6-62-4c-36-20>
- /kernel: isp0: ipcp parse opts: address
- /kernel: isp0: ipcp parse opt values: address 98.76.54.32 [not agreed]
- ^^^^^
- |_this is *his* address
- send conf-nak
- /kernel: isp0: ipcp output <conf-nak id=0x2 len=10 3-6-a-0-0-1>
- I expect a different address and (incorrectly) reject what he wants.
- I tell him that I expect 10.0.0.1. After this the connection fails.
-
- Anyway, I now know that his address is really 98.76.54.32 and can use
- it to correctly configure the interface.
-
- With the correct IP address I shoulkd now be able to connect with no
- problems. As stated above, the authorization protocol is normally not
- so important since most ISPs are willing to use pap, although chap is
- more secure. Generally, I'd try chap first and only switch to pap if
- the ISP doesn't accept it.
-
- (by Gary Jennejohn, Home - garyj@muc.de, Work - garyj@fkr.dec.com)
-
-
-
-2. does anyone know a software that can receive/send fax over ISDN ?
-================================================================================
-
- > Hi,
- >
- > does anyone know a software that can receive/send fax over ISDN? I am
- > using a Fritz!Card, which can handle group 3 (analogous) fax, but I
- > can't find any hint in the i4b software that this is supported in any
- > way.
-
-This is probably not implemented.
-
-Implementing G3 fax in ISDN would mean simulating an analog modem
-on the digital link. This means having to generate the right waveforms
-for the modulated data, and receive analog data from the other end
-which you had to run FFT analysis on and then interpret.
-
-In addition you have to do this in realtime, to be able to deal with
-the timing involved in the fax protocol, something neither
-FreeBSD or Linux is good at in their native form..
-
-A third point is that a software simulated faxmodem usually does not
-work well. I tested Teles software faxmodem in Win-95 towards an Ericsson V34
-HE modem, and was able to send faxes from the ISDN card at 4800 baud
-only, and receive faxes ad 9600 baud only(!) (And it is not the
-Ericsson modems fault, it works flawlessly towards other fax machines.)
-
-My point is that the best thing to do is to use an ordinary faxmodem
-to handle faxes with Hylafax of mgetty+sendfax or efax, or you may use
-a combined ISDN card with an analog part.
-
-Of course, if you are crazy enough, you may try to implement a
-software simulated modem in e.g. RT-linux, or a similar realtime
-extension for FreeBSD.
-
-Best regards,
-Nils Ulltveit-Moe (etonumo@eto.ericsson.se)
-
-
-
-3. does i4b callback only work with setups where the remote end returns a busy ?
-================================================================================
-
-> Is my assumption correct, does i4b callback only work with setups where
-> the remote end returns a busy on the dialin?
-
-Yes - otherwise you'll pay for the connection, at least here in Germany.
-
-Most routers support two kind of callbacks - the one that i4b supports
-means: the called system rejects (so no charge for this connection), waits
-a configurable time and the calls back. Information on who has called and
-who is to be called back relies on the ISDN calling party number information
-and stuff statically configured in the routers (or isnd's) configuration.
-
-The other type of callback (not supported by i4b right now) means: the
-called system accepts the connection and starts ppp negotiation. During this
-the ppp's aggree to do a callback. Information on who called in and who is
-going to be called back is subject to the authentication/negotiation already
-done by the two ppp's. Then ppp closes down, the connection is disconnected
-and the called system calls back.
-
-I've never seen someone actually use the second type due to its obvious
-disadvantages. It may be usefull if you travel, call in from an unknown
-number and want to be called back at that number.
-
-Martin Husemann <martin@rumolt.teuto.de>
-
-
-4. trouble with kernel options IPFIREWALL and IPDIVERT and natd
-================================================================================
-
- NOTICE: section obsolete since IP address changes are handled properly now!
- ===========================================================================
-
-This section
-> Trying to build a router/gateway between my privat Ethernet and
-> the Internet (via my ISP), I have problems with I4B or NAT (I think:).
->
-> The 2.2.5-R kernel with options IPFIREWALL and IPDIVERT works fine
-> with ISDN4BSD 0.50-alpha and firewall rule 'pass all from any to any'.
-> However, when I add 'divert natd all from any to any via isp0'
-> and start natd, name server lookups to the ISP's NS don't work.
->
-> Also, ping and nslookup fails from any other internal host.
-
-I had exactly the same problems. natd doesn't seem to get a message if
-the IP address of the interface changes (after successful dialout).
-I have to manually send a HUP signal to natd. I do this via the following
-(ugly?!) hack:
-
-I added the following two lines to the system section of isdnd.rc:
-regexpr = "call active" # look for matches in log messages
-regprog = hup_natd # execute program whan match is found
-
-The small script "hup_natd", located in /etc/isdn, looks like:
-#!/bin/sh
-pid=`cat /var/run/natd.pid`
-kill -HUP $pid
-sleep 3
-kill -HUP $pid
-sleep 5
-kill -HUP $pid
-
-It looks ugly, but at least for me it works. The two sleeps are necessary
-since I have to wait for ppp negotiation to complete (I don't get a message
-from isdnd for that). If I'm lucky I have my connection after 3 seconds,
-but 8 seconds should suffice for worst case (the first HUP without a sleep
-sometimes even succeeded on a slow 486/33 with 8MB RAM, more HUPs don't hurt).
-
-I'm really interested in some more elegant method.
-
-Daniel (rock@cs.uni-sb.de)
-
-
-Arve Ronning replied:
-=====================
-
-> I had exactly the same problems. natd doesn't seem to get a message if
-> the IP address of the interface changes (after successful dialout).
-
-Well, it (natd) _does_ pick up the dynamic address supplied for isp0.
-Try 'natd -verbose ...' and you'll see it. Otherwise I agree, there is
-certainly something missing in natd's functionality, or maybe sppp
-does'nt
-supply what it's supposed to ??
-
-> I have to manually send a HUP signal to natd. I do this via the following
-> (ugly?!) hack:
-
-YES...super; strange but correct. It works when I send natd a -HUP after
-sppp is up. Thanx for the tip. However, natd must be -HUPed _every_ time
-sppp has been down (idle timeout) and comes back up!
-
-> I'm really interested in some more elegant method.
-
-So am I, let's see what may come out of the discussion on the list.
-
-
-
-5. I want to use -r with isdnd but it does not work
-================================================================================
-
-> > Use isdnd in fullscreen mode.
->
-> I tried that already, but got an error when I start isdnd that way:
->
-> /usr/local/bin/isdnd -d 0xf9 -f -r /dev/ttyv1 -t cons25
->
-> root is logged in on device /dev/ttyv1, the message in /var/log/messages looks like:
->
-> "May 22 11:52:28 asterix isdnd[4160]: ERR ERROR, cannot setup tty as controlling terminal: Operation not permitted"
->
-> How can I give this device permission ?
-
-
-In case you want to use switch "-r" noone else _must_ use the tty you redirect
-to, you have to remove the getty from the virtual terminal in /etc/ttys and
-restart the init process.
-
-
-6. How do I configure and run the answering machine (under FreeBSD 2.2.x) ?
-================================================================================
-
-The answering machine will be activated, when isdnd executes the program
-that has been named in "/etc/isdn/isdnd.rc" in the section "telephone
-answering" at entry "answerprog = ". If the program is executed
-without a pathname, the answer program is expected in "/etc/isdn".
-Examples of such programs can be found in "/etc/isdn/samples". They
-are named:
-
- "answer" answers only, no recording
- "record" answers, and records messages
- "tell" the number of the calling person is told,
- no recording.
- "tell-record" calling number as answer, message is recorded
- "isdntel.sh" answers and records messages; by using the
- program "isdntel", one has the control over
- the recorded messages in the directory
- "/var/isdn". Look at "man isdntel" and
- "man isdntelctl".
-
-These programs have to be altered to suit your needs. Unfortunately there
-is no program with which you can record your answer message. This is not
-really bad, because you only have to alter the above mentioned program
-"record" a bit (comment out the "if ... fi" statements for the beep
-and msg messages). You have to create the directory "/var/isdn" first in
-order to record messages. They will be stored in this location then.
-
-Stefan Herrmann <stefan@asterix.webaffairs.net>
-
-
-7. Teles S0/16.3 ... unknown ?
-================================================================================
-Hi,
-
-I have just purchased a Teles S0/16.3 card.
-But it's not what i4b is looking for .... I mean, it's a different card.
-
-The docs (and sources)of i4b talks about a Telws S0/16.3 card with 3
-address: d80 etc.
-
-This one (is not PnP) has jumpers for 0x180 0x280 0x380.
-
-It has the SIemens Chips numbered PSB 21525 N (HSCX TE V2.1) and PSB
-2186N V1.1 (ISAC-S TE).
-
-I undestand that the 16.3c is not supported, but over this board is
-written "TELES.S0/16.3 Revision 1.3"
-
-Can anybody tell me what is this card ???
-
-answer:
--------
-
-It's not a different card. The jumpers are documented to select
-IO-address 0x180, 0x280 or 0x380 in some TELES manuals.
-But in fact they select the addresses 0xd80, 0xe80 or 0xf80.
-
-Wolfgang
-
-
-And an additional note from Poul-Henning Kamp:
-----------------------------------------------
-There is an intricate story behind this, in short some ISA cards
-only decode the first 10 address bits (0x3ff), which over the years
-has resulted in a mutation the "de-facto-spec" such that addressbits
-10-15 can be used by the card for selecting various stuff. This
-is extensively used on obscure cards with massive IO needs, sound,
-IEEE488 and ISDN cards often belong in this category.
-
-
-
-8. How do i integrate a new lowlevel driver into i4b ?
-================================================================================
-
-1) Request a flag value from me
-2) add an entry for the card into FreeBSD/CONFIG
-3) add driver filename to FreeBSD/files.i386.cat
-4) add entry for the card to FreeBSD/options.i386.cat
-5) add support to print type of card to diehl/diehlctl/main.c
-6) add support to print type of card to isdnd/support.c, name_of_controller()
-7) place your file as named in 3) into directory layer1
-8) add the flag value and function prototypes to layer1/i4b_l1.h
-9) add support for NetBSD to layer1/isa_isic.c
-10) add support for attach/probe to layer1/i4b_isic.c
-11) add card type to i4b/i4b_ioctl.h and update CARD_TYPEP_MAX
-12) add an entry to the man page man/isic.4
-
-Produce diffs (please use context diffs, flag "-c" for diff) and send them in.
-
-
-9. Why it always says "no Space in TX FIFO - State F4 awaiting" ?
-================================================================================
-
-as I wrote about two weeks ago I had massive problems concerning this
-"no space in TX FIFO"-thing,
-
-/kernel: i4b-L1-ph_data_req: No Space in TX FIFO, state = F4 Awaiting Signal
-
-Even though I used a correctly recognized Teles S0/16.3 nonpnp isdncard,
-nothing worked, errormsgs were flooding the console until I rebooted the box.
-
-I decided to play around in the BIOS-settings, I first just set them all
-to default, which didn't work, and then changed lots of things - unfortunately
-I can't remember them. After about hundreds of trial 'n errors I gave up.
-
-A few days ago I just made another attempt, booted the box and to my surprise
-it all worked without the smallest problem, great data rates :)
-
-I tried hard to found what the something special was I changed in the BIOS
-settings, but I just couldnt get isdnd back to its stupid behaviour it
-showed all the time before, but I would recommend everybody who has this
-kind of problem to look into his BIOS.
-
- (from Meike Aulbach, strange@stoned.rhein-main.de)
-
-
-i4b now works for me, I had a USB-device interfering on IRQ 9,
-which was supposed to be only for my Creatix Card.
-(NetBSD 1.3, Creatix)
-
-Strange enough, my DOS s0-test worked, are they just polling the card?
-
-Even when the testsoftware under DOS is working, don't be shure, that
-your hw-setup is correct for xxx(x)BSD. Triplecheck all your IRQ and
-enable and disable PNP to triple-verify. Even unconfigured devices can
-block your card. .....
-
-And that took me more than 2 months to discover :-((((
-
- (from Andreas Lohrum, andreas.lohrum@consol.de)
-
-
-when i changed the mainboard of a box that ran i4b alright, i forgot to
-set 'used by isa' in the pnp-bios-settings for the irq of my teles
-isdn-card. because of that some pci-card got the interrupt that the
-isdn-card should have gotten.
-i then also got this error: 'No space in TX FIFO'.
-
-The reason occurred to my rather quick, but i would think, that this would
-be a nice hint in a FAQ :)
-
- (from Heiko Schaefer, hschaefer@fto.de)
-
-
-after my huge amount of problems, Meike's hint (changing the
-ISA/PNP-settings in the BIOS) finally fixed things.
-I have only tried out this stuff with my Creatix-card, I'll check
-out the PNP-stuff with my Sedlbauer-card soon too though.
-
- (from Harold Gutch, logix@foobar.franken.de)
-
-
-10. Incoming alert - what does it mean ?
-================================================================================
-
-In the log on vty6 (isdnd full screen log) I'm seeing
-
-16.07.98 11:42:35 CHD 00001 rwth rate 90 sec/unit (rate)
-16.07.98 11:42:35 CHD 00001 rwth dialing from 4191236 to 441291234
-16.07.98 11:42:35 CHD 00001 rwth outgoing call proceeding (ctl 0, ch 0)
-16.07.98 11:42:35 CHD 00001 rwth incoming alert <<<<<<<<<<<<<<<
-16.07.98 11:42:35 CHD 00001 rwth outgoing call active (ctl 0, ch 0)
-
-What does this 'incoming alert' mean?
-
-
-It means that it is "ringing" at the remote end.
-
-
-11. How do i change irq's on my teles 16.3 card ?
-================================================================================
-
-Question:
-
-So how do you change irq's on your teles 16.3 card (under FBSD or DOS,
-I don't have and don't want to have Windows running on that computer) ?
-
-Answer:
-
-The irq is configured into the card each time the driver under whatever
-OS you currently boot initializes the card. Thus, change the irq for the
-isic driver in your kernel config file to one of the supported (!) irqs
-for this card (hint: read "man isic") which is currently unused in your
-machine and generate a new kernel.
-
-
-12. NL: i'm getting CAUSE 100 or CAUSE 101 when dialling out
-================================================================================
-
-This one seems to be specific for the Netherlands. (-hm)
-
-Question:
-
-I'm trying to get i4b running on my new FreeBSD 2.2.8 system. The kernel
-compiles smootly and everything is looking fine until it's time to dial.
-I get the following error:
-
-Feb 10 20:31:00 goofy isdnd[498]: CHD 00018 I4BPPP outgoing call disconnected (remote)
-Feb 10 20:31:00 goofy isdnd[498]: CHD 00018 I4BPPP cause 101: Message not compatible with call state (Q.850)
-Feb 10 20:31:00 goofy isdnd[498]: ERR set_channel_idle: controller [0], invalid channel [-1]!
-Feb 10 20:31:00 goofy isdnd[498]: ERR msg_disconnect_ind: set_channel_idle failed!
-
-The remote site is a Cisco 4000 type router. I used debug to take a view at
-the ISDN events on the router but according to that the call doesn't arrive
-over there.
-
-Same hardware has worked fine with FreeBSD 2.2.6/i4b 0.63.
-
-Who knows what's wrong?
-
-
-Answer:
-
-This sounds very much like your local phone number or remote phone number
-is configured wrongly... in the Netherlands you need to specify the number
-EXCLUDING the city code... so if you live in Utrecht and your number is
-0301234567 you specify 1234567.
-
-I have seen this in several locations in the Netherlands for years, not
-just with i4b, but also with differentt isdn equipment.. why? guess it
-simply depends on which operator defines your line or what exchange it
-is connected to... :P
-What I found is that what solved this with other isdn hardware/software,
-also solves it for i4b.. ie.. make sure the local phone number is
-specified, and is specified without the city code.
-The numbering plan should be 'unknown'
-
-Anyway, it would be nice if the Dutch ptt (they are called KPN btw)
-would tell us why this happens... they havent been able to tell me in the
-past so I guess I give up on that, but if everyone finds out whats exactly
-happening here I'd be interested to know... :)
-
-List of number configurations that I have found to almost always work in
-the Netherlands:
-
-1. Local phone number:
- usually your prefered msn without city code works here.
- (ie, 1234567 if you would like to use 0201234567 for outgoing calls)
- on some locations leaving it blank or defining it with the city code,
- but without the leading 0 works as well here.
-
-2. remote phone number:
- When this is a 'local' call, don't specify city code.
- For calling parties in other cities you of cource have to use the city
- code... in general you can say that KPN only accepts the shortest
- possible notation where it would still be clear who you want to call.
-
-3. numbers for incomming call recognition:
- KPN always specifies incoming caller ids with city code, but without
- leading 0. so 0201234567 will be displayed as 201234567
-
-
-Hope this helps.
-Bart
-
- (from Bart van Leeuwen bart@ixori.demon.nl)
-
-
-14. I'm using sPPP. I can connect to my ISP but no TCP/IP services work. HELP!
-==============================================================================
-
-This is probably because you have the RFC1323 - TCP Extensions for High
-Performance - support turned on and your ISP (or some router in the loop)
-is discarding the extensions.
-
-This can easily be checked by doing ``sysctl net.inet.tcp.rfc1323''. If the
-result is 1, then the RFC1323 support is turned on.
-
-Turn this off by doing ``sysctl net.inet.tcp.rfc1323=0'' (This is
-called "net.inet.tcp.do_rfc1323" under BSD/OS).
-
-For FreeBSD make sure that tcp_extension="NO" is in your /etc/rc.conf
-(/etc/defaults/rc.conf with more recent versions of FreeBSD) and
-/etc/rc.conf.local (in -STABLE and upcoming 3.2)
-
-This may be different for NetBSD, OpenBSD and BSD/OS.
-
-Martin Husemann writes:
------------------------
-This does apply for NetBSD too (and probably OpenBSD, since it's been
-in NetBSD for a long time). The sysctl name is even compatible ;-) We don't
-have a coresponding rc.conf entry, I do it in /etc/netstart.local.
-
-I would suggest to set this to 0 on all machines routed over ISDN (not only
-the router), as this "high speed options" in fact do slow down an ISDN link
-by making VJ "compression" impossible - as far as I understood it. So there
-should be a more general advice in the FAQ, not only "turn it off if it
-doesn't work for you".
-
-I've only seen the problems against old linux kernels (about two years ago),
-are there still machines out there that have such a broken TCP/IP stack? We
-should start to blame the vendors...
-
- (by Gary Jennejohn, garyj@muc.de, with additions from
- Harold Gutch <logix@foobar.franken.de> and
- Martin Husemann <martin@rumolt.teuto.de>).
-
-
-15. i4b 0.80.00: problems with AVM Fritz PCI
-==============================================================================
-
-Question:
-=========
-
-The system is FreeBSD 3.1-RELEASE with i4b-00.80.00-beta-070599 [...]
-
-I'm trying to compile a Kernel with support for my AVM Fritz!PCI card,
-however, when compiling, it fails with the following error
-
-sh ../../conf/newvers.sh GENERIC -DAVM_A1_PCI
-cc -c -O -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit -Wnested-
-externs
--Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -
-Wuninitializ
-ed -Wformat -Wunused -fformat-extensions -ansi -nostdinc -I- -I. -I../..
--I/us
-r/include -DAVM_A1_PCI -DKERNEL -DVM_STACK -include opt_global.h -elf
-vers.c
-loading kernel
-i4b_isic_pci.o: In function `i4b_pci_attach':
-i4b_isic_pci.o(.text+0x141): undefined reference to `avma1pp_map_int'
-i4b_isic_pci.o: In function `isic_pciattach':
-i4b_isic_pci.o(.text+0x196): undefined reference to `isic_attach_avma1pp'
-*** Error code 1
-
-
-Solution:
-=========
-
-> I have added
->
-> i4b/layer1/i4b_avm_fritz_pci.c optional isic device-driver
->
-> and am recomiling at the moment, but given that it's a 486, it could take
-> some time :-)
-
-The problem appears to be that overinstall.sh does not update files.i386
-and options.i386, and that AVM_A1_PCI was added after 3.1-RELEASE and
-hence is not defined.
-
-Manually editing these files (using install.sh as a guide) allows the
-kernel to compile cleanly.
-
-
-(from Rich Wood, rich@dynamite.org)
-
-
-16. How do i setup logfile rotation for isdnd ?
-==============================================================================
-
-For syslog-based logging:
--------------------------
-
-man newsyslog (on FreeBSD)
-
-You just add a line to /etc/newsyslog.conf:
-/var/log/isdnd.log 664 7 100 * Z
-and you are all done...
-
-(From: Andreas Haakh <ah@alvman.RoBIN.de>)
-
-
-For logfile-based logging:
---------------------------
-
-I suggest using newsyslog(8). Adding a line like:
-
-/var/log/isdn.log 664 100 * 168 Z /var/run/isdnd.pid
-
-to /etc/newsyslog.conf will do the job (here: once a week, for the next
-100 weeks) with compression of the old log.
-
-This is the standard method for other daemons (apache, etc.).
-
-(From: Udo Schweigert <ust@cert.siemens.de>)
-
-
-17. How do i setup dialin from Windows NT RAS to i4b ?
-==============================================================================
-
-> > I need to be able to dial in from a WNT box, equipped with TELES h/w and
-> > s/w, to a FreeBSD machine. I don't have a clue what RAS is using.
-> > I've tried
-> > ipr and isp. The latter seems to work but is hanging on authentication. Is
-> > there somebody who has done this before and is able to give me some hints?
->
-> RAS is using PPP, so you should be able to get the isp interface working. I
-> haven't done it so I can't give you concrete hints, but setting the isp
-> interface to debug mode and posting the log (with passwords cut out or with
-> test passwords) could help us to debug your setup.
-
-I have several customers using sPPP do dial in from their W95/W98/WNT.
-
-If You use FreeBSD_3.2-BETA with i4b-071 or older then you have to apply
-the attached patch to /sys/net/if_spppsubr.c (patch -p0 <patchfile).
-
-You need to configure isp0. See the manpages or the supplied templates in
-the i4b-distribution. I would suggest to supply an ip-number for the
-isp0-interface and force the clients to accept this value.
-Don't forget to supply the relevant parameters to sppconfig_isp0 in
-/etc/rc.conf...
-
-On WNT you have to install the CAPI-2.0-drivers and Dialin-network.
-
-Create a new entry and check the following box:
-* Connection to internet
-select the appropriate ISDN-device for dialout, insert a phone-number
-and that's it.
-You are asked for username & password. Supply the values You did define in
-spppconfig_isp0 and dial...
-
-Patch for i4b version 0.71 or older:
-------------------------------------
-
-*** /sys/net/if_spppsubr.c Sun Dec 27 22:30:44 1998
---- /sys/net/if_spppsubr.c.orig Sat May 8 10:54:14 1999
-***************
-*** 2056,2062 ****
- if (debug)
- addlog("[non-empty] ");
- /* suggest a zero one */
-! p[2] = p[3] = p[4] = p[5] = 0;
- break;
-
- case LCP_OPT_MRU:
---- 2056,2062 ----
- if (debug)
- addlog("[non-empty] ");
- /* suggest a zero one */
-! /* p[2] = p[3] = p[4] = p[5] = 0; */
- break;
-
- case LCP_OPT_MRU:
-***************
-*** 2668,2678 ****
- addlog("%s [not agreed] ",
- sppp_dotted_quad(desiredaddr));
-
-- p[2] = hisaddr >> 24;
-- p[3] = hisaddr >> 16;
-- p[4] = hisaddr >> 8;
-- p[5] = hisaddr;
- }
- break;
- }
- /* Add the option to nak'ed list. */
---- 2668,2678 ----
- addlog("%s [not agreed] ",
- sppp_dotted_quad(desiredaddr));
-
- }
-+ p[2] = hisaddr >> 24;
-+ p[3] = hisaddr >> 16;
-+ p[4] = hisaddr >> 8;
-+ p[5] = hisaddr;
- break;
- }
- /* Add the option to nak'ed list. */
-
-(From: Andreas Haakh <ah@alvman.RoBIN.de>)
-
-
-18. How can I convert my old .g711a files to the new format?
-================================================================================
-I got the best results with:
-cat /some/path/dwhello.g711a | alaw2ulaw | g711conv -u > /tmp/newhello.al
-
-(From: David Wetzel <dave@turbocat.de>)
-
-
-19. I have lots of old .g711a files to convert what can I do?
-================================================================================
-
-Create a shell script (/tmp/csnd.sh) with this contents:
-#!/bin/sh
-
-OLDFILES=`ls *.g711a`
-#echo $OLDFILES
-
-for THEFILE in $OLDFILES
-do
-(
- echo -n "converting $THEFILE..."
- BASENAME=`basename $THEFILE .g711a`
-
- /bin/cat $THEFILE | alaw2ulaw | g711conv -u > $BASENAME.al
- echo "done"
-)
-
-done
-###### END
-
-then type "chmod a+x /tmp/csnd.sh" in you shell.
-cd /usr/local/lib/isdn (or where your old sounds live)
-/tmp/csnd.sh
-Optional:
-rm *.g711a (you should know what you do here :-)
-
-(From: David Wetzel <dave@turbocat.de>)
-
-
-20. How can I convert the .al files to Sun/NeXT .au/.snd/.vox files?
-================================================================================
-
-/bin/cat /some/path/old.al | sox -t raw -A -b -r 8000 - -t .au /some/path/new.snd
-
-
-(From: David Wetzel <dave@turbocat.de>)
-
-
-21. Help, isdn4bsd 0.82 fails to probe my Elsa PCC-16!
-================================================================================
-
->Isdn4bsd 0.82 fails to probe my Elsa PCC-16. It just can't find isic0.
-
-flags have changed from 19 to 20.
-
-
-(From: "Frank J. Beckmann" <frank@vogon.agala.harz.de>)
-
-
-22. How do i enable and configure userland PPP with i4b ?
-================================================================================
-
-NOTE: this is the procedure used as of end of July 1999, it may change in
- the near future!
-
-Get the current ppp sources from
-
- http://www.freebsd.org/~brian
-
-unpack them and apply the patch
-
- ftp://ftp6.uk.freebsd.org/pub/PPPoISDN/pppcommit.patch
-
-to the ppp directory (where you just unpacked the above mentioned ppp source).
-Make and install the result.
-
-Have a look at the user-ppp directory and the end of etc-isdn/isdnd.rc.sample
-for ppp and i4b sample configurations to get things up and running.
-
-More information to ppp setup can be found at
-
- http://www.Awfulhak.org/ppp.html
- http://www.freebsd.org/doc/handbook/ppp-and-slip.html
- http://www.freebsd.org/doc/faq/ppp.html
-
-and in the directory "user-ppp" of the isdn4bsd distribution.
-
-
-23. What is the procedure to install a new i4b on FreeBSD 3.x ?
-================================================================================
-
-cd /usr/src
-mkdir i4b
-cd i4b
-tar xvzf i4b-00.82.00-beta-140799.tar.gz
-cd FreeBSD
-sh overuninstall.sh
-sh overinstall.sh
-cd ..
-make cleandir
-make depend
-make
-make install
-cd /sys/i386/conf
-config <YOURKERNEL>
-cd ../../compile/<YOURKERNEL>
-make clean
-make depend
-make
-make install
-shutdown -r now
-
-
-(From: Luke Roberts <luke@roberts.nl>)
-
-
-24. Why do i get "ifconfig: ioctl (SIOCAIFADDR): file exists" ?
-================================================================================
-
-Ich ?berlege gerade, aber ich glaube, ich bekomme sie auch. Das
-Problem existiert schon seit geraumer Zeit immer beim Konfigurieren
-eines point-to-point Interfaces (SLIP, PPP).
-
-Das `file exists' ist ein Misnomer, es r?hrt daher, da? der
-Routingcode die errno's in einer leicht ver?nderten Weise benutzt, so
-da? nicht neue errno's daf?r erfunden werden mu?ten. Lies es als
-`route exists'. (Und falls Du im Zusammenhang mit Routing mal ein `no
-such process' siehst, lies es als `no such route'.)
-
-Die Meldung ist harmlos. Sonst h?tte ich mir schon l?ngst mal die
-M?he gemacht, mich durch den ganzen Routing-Code zu hangeln und zu
-sehen, warum das passiert.
-
-(From Joerg Wunsch <j@uriah.heep.sax.de>)
-
-
-25. How to properly operate isdnd's fullscreen output in a 132x60 vty
-================================================================================
-
-Q: I'm using allscreens_flags="132x60" in /etc/rc.conf but the vty gets
- switched after isdnd is started, so isdnd didn't know about the new
- dimensions of the screen.
-
-A: This one's easy:
- In /etc/rc.isdn change
- isdn_ttype=cons25
- to
- isdn_ttype=cons60l1wide
- /usr/sbin/vidcontrol VESA_132x60 < ${isdn_fsdev}
-
- The new VESA modes don't have termcap entries yet, so you'll
- have to add one yourself to define 132x60:
-
- cons60l1wide|cons60-iso8859-1:\
- :co#132:tc=cons60l1:
-
-
-(From: "H. Eckert" <ripley@nostromo.in-berlin.de>)
-
-
-26. NetBSD: i see isic0 while booting but I cannot access my Fritz!Card
-================================================================================
-
-I got his:
-isic0 at pci0 dev 8 function 0: Fritz!Card
-isic0: ISAC 2085 Version A1/A2 or 2086/2186 Version 1.1 (IOM-2)
-isic0: interrupting at irq 11
-(...)
-i4b: ISDN call control device attached
-i4btrc: 2 ISDN trace device(s) attached
-i4bctl: ISDN system control port attached
-i4brbch: 4 raw B channel access device(s) attached
-i4btel: 2 ISDN telephony interface device(s) attached
-i4bipr: 2 IP over raw HDLC ISDN device(s) attached (VJ header compression)
-i4bisppp: 2 ISDN SyncPPP device(s) attached
-
-But I could not use the card, because I forgot
-"options __I4B_IS_INTEGRATED" in the kernal config file.
-[Jan Sparud helped me to find that]
-
-(From: David Wetzel <dave@turbocat.de>)
-
-
-27. i4b_pci_attach: pci_map_port 1 failed! What does this mean ?
-================================================================================
-
-Q: Hi,
-
- I am trying to set up an ELSA QuickStep 1000pro PCI ISDN adaptor in a FreeBSD
- 3.3 box. I configured the kernel according to the i4b.ps documentation. At
- boottime, these messages are displayed:
-
- isic0: <ELSA QuickStep 1000pro PCI ISDN adaptor> rev 0x01 int a irq 11 on
- pci0.1 7.0
- i4b_pci_attach: pci_map_port 1 failed!
-
- What does this mean ?, should I be worried ?, will the device function
- properly ?
-
-A: Problem is solved.
-
- In the BIOS, the PCI slot containing the ISDN card was set to IRQ 14 (having
- no IDE devices). The isic driver finds the card using irq 11 and then says
- "pci_port_map_port failed". The slot is set to IRQ 11 (which was free also)
- and everything works fine here ..
-
-From: Joost Mulders <dhcp@j-mulders.demon.nl>
-
-
-28. What is: i4b-L2 i4b_rxd_ack: ((N(R)-1)=35) != (UA=36) !!!
-================================================================================
-
-> Some time I get follow message at console:
->
-> i4b-L2 i4b_rxd_ack: ((N(R)-1)=35) != (UA=36) !!!
-
-A layer 2 error occured. These types of errors are automatically
-corrected by the layer 2 protocol.
-
-
-29. Why does isdnd take up 95% CPU time ?
-================================================================================
-
-Q: i just set up my isdn w/ user ppp, it works nice, but my isdn daemon takes
- up 95% of my CPU time.
-
- output of "top":
- --snip--
- Mem: 42M Active, 4616K Inact, 11M Wired, 2896K Cache, 14M Buf, 408K Free
- Swap: 132M Total, 5128K Used, 127M Free, 3% Inuse
-
- PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
- 63 root 58 0 1372K 752K RUN 38:05 93.75% 93.75% isdnd
- 207 gboehm 2 0 25196K 22044K select 1:15 2.20% 2.20% XF86_Mach64
- --/snip--
-
-A: i just found out what i did wrong ...
- i forgot to set these both lines in my /etc/rc.conf:
-
- isdn_fsdev="NO"
- isdn_flags=""
-
- had to do that if i want to run isdnd as a daemon service, 'cause the
- defaults in /etc/defaults/rc.conf are:
-
- isdn_fsdev="/dev/ttyv4" # Output device for fullscreen mode (or NO for daemon mode).
- isdn_flags="-dn -d0x1f9" # Flags for isdnd
-
-From: Guido Boehm <g.boehm@web.de>
diff --git a/share/examples/isdn/KERNEL b/share/examples/isdn/KERNEL
deleted file mode 100644
index a80dcce..0000000
--- a/share/examples/isdn/KERNEL
+++ /dev/null
@@ -1,82 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# example fragment of a kernel config file to include all
-# parts of isdn4bsd. This file should be appended to your
-# kernel config file and then edited (stripped down) to
-# match your hardware configuration.
-#
-# last edit-date: [Sun Oct 21 11:03:37 2001]
-#
-# $FreeBSD$
-#
-#---------------------------------------------------------------------------
-
-# Siemens/Infineon chipsets
-device isic 4
-
-# Winbond chipset
-device iwic 4
-
-# AVM Fritz PCI
-device ifpi 4
-
-# AVM Fritz PCI version 2
-device "ifpi2" 4
-
-# Teles 16.3c
-device ihfc 4
-
-# NETjet-S / Teles PCI-TJ
-device itjc 4
-
-# AVM Fritz PnP
-device ifpnp 4
-
-# AVM B1/T1
-device "i4bcapi"
-device iavc 4
-
-# enable some ISA cards within the "isic" driver
-options TEL_S0_8
-options TEL_S0_16
-options TEL_S0_16_3
-options AVM_A1
-options USR_STI
-options ELSA_PCC16
-
-# enable some ISA PnP cards within the "isic" driver
-options TEL_S0_16_3_P
-options CRTX_S0_P
-options DRN_NGO
-options SEDLBAUER
-options ELSA_QS1ISA
-options SIEMENS_ISURF2
-options ASUSCOM_IPAC
-options EICON_DIVA
-options COMPAQ_M610
-
-# enable ELSA Microlink PCI card within the "isic" driver
-options ELSA_QS1PCI
-
-# protocol stack
-device "i4bq921"
-device "i4bq931"
-device "i4b"
-
-# control devices
-device "i4btrc" 4
-device "i4bctl"
-device "i4brbch" 4
-device "i4btel" 2
-
-# IP over raw HDLC
-options IPR_VJ
-device "i4bipr" 4
-
-# kernel sppp/isppp
-device "i4bisppp" 4
-
-# Netgraph interface
-#options NETGRAPH
-#device "i4bing" 4
-
diff --git a/share/examples/isdn/Overview b/share/examples/isdn/Overview
deleted file mode 100644
index 7604395..0000000
--- a/share/examples/isdn/Overview
+++ /dev/null
@@ -1,307 +0,0 @@
-
- Short technical overview of isdn4bsd
- ====================================
-
- Copyright (c) 1998 Hellmuth Michaelis. All rights reserved.
-
- $FreeBSD$
-
- Last edit-date: [Tue Oct 27 11:26:03 1998]
-
- -hm starting an overview ...
-
-
-Contents:
----------
- Functional block diagram
- Layer 1
- Layer 2
- Layer 3
- Debugging control
- Layer 4
- ISDN protocol trace
-
-
-Functional block diagram
-========================
-
- isdndebug isdnd isdntrace
- +-------+ +----------------------------------------------------+ +--------+
- | | | | | |
- | | | | | |
- +-------+ +----------------------------------------------------+ +--------+
- | | |
- | | |
- | /dev/i4bctl Userland | /dev/i4b /dev/i4btrc<n> |
-===============================================================================
- | Kernel | |
- | | |
- +-------+ +----------------------------------------------------+ +--------+
- | | | | | |
- |i4bctl | | i4b | | i4btrc |
- | (6) | | (7) | | (8) |
- | debug | | Layer 4 - common call control interface | | ISDN |
- |control| | | | trace |
- +:-:-:--+ +----------------------------------------------------+ +--------+
- : : : ^ ^ ^
- : : : Call | various ptr arrays | Call %
- . . . Control | in i4b_l3l4.h | Control %
- V V %
- +----------------------+ +----------------------+ %
- | | | | %
- | i4bq931 | ISDN | active card | %
- | (5) | ##### | %
- | Layer 3 (Q.931) | # | driver | %
- | | # | | %
- +----------------------+ # +----------------------+ %
- ^ # B + %
- | i4b_l2l3_func function # | + +------------+ %
- | ptr array in i4b_l2l3.h # C +++++ isp |----> %
- V # h + +------------+ IP %
- +----------------------+ # a + Subsys %
- | | # n + +------------+ %
- | i4bq921 | # n +++++ ipr |----> %
- | (4) | # e + +------------+ IP %
- | Layer 2 (Q.921) | # l + Subsys %
- | | # + +------------+ %
- +----------------------+ # D +++++ tel/rbch |----> %
- ^ # a + +------------+ to %
- | i4b_l1l2_func function # t + /dev/i4btel<n> %
- | ptr array in i4b_l1l2.h # a + or /dev/i4brbch<n>%
- V # + %
- +----------------------+ # +---------------------+ %
- | | # | | %
- | isic (ISAC part) | D-ch trace # | isic (HSCX part) |B-ch%
- | (2) |%%%%%%%%%%%% # | (3) |%%%%%
- | Layer 1 (I.430) | % # | non-HDLC / HDLC |trc %
- | | % # | | %
- +----------------------+ % # +---------------------+ %
- ^ % # ^ %
- D-channel | % # B-channels | %
- +-----------------------------------------------+ %
- | function ptr in % # %
- | in isic_softc in %%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- V i4b_l1.h #
- +----------------------+ #
- | | #
- | isic | #
- | (1) | #
- | Card hardware driver | #
- | for Teles, AVM, USR | #
- | | #
- +----------#-----------+ #
- # #
- # #
- # #
- # #
- |=========#===============================#============================|
- ISDN S0 bus
-
-
-Layer 1
-=======
-
-(1) A driver for a special card hardware consists of a
- - probe routine
- - attach routine
- - FIFO read
- - FIFO write
- - register read
- - register write
- routines. These routines handle the card/manufacturer specific stuff
- required to talk to a particular card.
-
- The addresses of the read/write routines are put into an array found
- in struct isic_softc and they are later called by the macros:
-
- ISAC_READ(r), ISAC_WRITE(r,v), ISAC_RDFIFO(b,s), ISAC_WRFIFO(b,s),
- HSCX_READ(n,r), HSCX_WRITE(n,r,v), HSCX_RDFIFO(n,b,s), HSCX_WRFIFO(n,b,s)
-
- (see file layer1/i4b_l1.h)
-
- Files currently used for this purpose are
- - i4b_avm_a1.c AVM A1 and AVM Fritz!Card drivers
- - i4b_ctx_s0P.c Creatix S0 PnP (experimental!)
- - i4b_tel_s016.c Teles S0/16 and clones
- - i4b_tel_s0163.c Teles S0/16.3
- - i4b_tel_s08.c Teles S0/8 and clones
- - i4b_tel_s0P.c Teles S0/16 PnP (experimental!)
- - i4b_usr_sti.c 3Com USRobotics Sportster
-
-
-(2) The files i4b_isac.c and i4b_isac.h contain the code to control the
- ISAC chip by using the above mentioned macros.
-
- Files i4b_l1.c and i4b_l1.h handle stuff used to access layer 1
- functions from layer 2.
-
- Layer 1 and layer 2 access functionality of each other by using
- a well known function pointer array, which contains addresses of
- "primitives" functions which are defined in I.430 and Q.921. The
- function pointer array for layer 1/2 communication is defined in
- file include/i4b_l1l2.h and is initialized i4b_l1.c at the very
- beginning.
-
- File i4b_isic.c contains the main code for the "isic" device driver.
-
- i4b_l1fsm.c is the heart of layer 1 containing the state machine which
- implements the protocol described in I.430 and the ISAC data book.
-
-
-(3) All above code is used for handling of the D channel, the files
- i4b_bchan.c, i4b_hscx.c and i4b_hscx.h contain the code for handling
- the B-channel, the HSCX is used to interface the userland drivers
- isp, ipr, tel and rbch to one of the B-channels and i4b_hscx.c and
- i4b_hscx.h contain the code to handle it (also by using the above
- mentioned macros). i4b_bchan.c contains various maintenance code for
- interfacing to the upper layers.
-
-
-Layer 2
-=======
-
-(4) Layer 2 implements the LAPD protocol described in Q.920/Q.921. Layer 2
- interfaces to layer 1 by the above described function pointer array,
- where layer 1 calls layer 2 functions to provide input to layer 2 and
- layer 2 calls layer 1 functions to feed data to layer 1.
-
- The same mechanism is used for layer 2 / layer 3 communication, the
- pointer array interface is defined in include/i4b_l2l3.h ad the array
- is initialized at the very beginning of i4b_l2.c which also contains
- some layer 1 and some layer 3 interface routines. As with l1/l2, the
- l2/l3 array also contains addresses for "primitives" functions which
- are specified in Q.920/Q.921 and Q.931.
-
- i4b_l2.h contains the definition of l2_softc_t, which describes the
- complete state of a layer 2 link between the exchange and the local
- terminal equipment.
-
- i4b_l2.c contains the entrance of data from layer 1 into the system,
- which is split up in i4b_ph_data_ind() into the 3 classes of layer 2
- frames called S-frame, I-frame and U-frame. They are handled in files
- i4b_sframe.c, i4b_iframe.c and i4b_uframe.c together with the respective
- routines to send data with each ones frame type.
-
- i4b_l2timer.c implements the timers required by Q.921.
-
- i4b_tei.c contains the TEI handling routines.
-
- i4b_lme.c implements a rudimentary layer management entity.
-
- i4b_util.c implements the many utility functions specified
- in Q.921 together wit some misc routines required for overall
- functionality.
-
- i4b_mbuf.c handles all (!) requests for mbufs and frees all mbufs used
- by the whole isdn4bsd kernel part. It should probably be moved else-
- where.
-
- i4b_l2fsm.c and i4b_l2fsm.h contain the heart of layer 2, the state-
- machine implementing the protocol as specified in Q.921.
-
-Layer 3
-=======
-
-(5) i4b_l2if.c and i4b_l4if.c contain the interface routines to communicate
- to layer 2 and layer 4 respectively.
-
- i4b_l3timer.c implements the timers required by layer 3.
-
- i4b_q931.c and i4b_q931.h implement the message and information element
- decoding of the Q.931 protocol.
-
- i4b_q932fac.c and i4b_q932fac.h implement a partial decoding of facility
- messages and/or information elements; the only decoding done here is
- the decoding of AOCD and AOCE, advice of charge during and at end of
- call.
-
- As usual, i4b_l3fsm.c and i4b_l3fsm.h contain the state machine required
- to handle the protocol as specified in Q.931.
-
- Layer 3 uses a structure defined in include/i4b_l3l4.h to store and
- request information about one particular isdncontroller, it is called
- ctrl_desc_t (controller descriptor). It contains information on the
- state of a controller (controller ready/down and which B channels are
- used or idle) as well as a pointer array used for communication of
- layer 4 with layer 3: layer 3 "knows" the routines to call within
- layer 4 by name, but in case layer 4 has to call layer 3, several
- possibilities exist (i.e. active / passive cards) so it has to call
- the routines which the ISDN controller had put into the the function
- pointer array (N_CONNECT_REQUEST, N_CONNECT_RESPONSE etc) at init time.
-
- Layer 3 shares a structure called call_desc_t (call descriptor) with
- layer 4. This structure is used to describe the state of one call. The
- reference to layer 3 is the Q.931 call reference value, the reference to
- layer 4 (and the isdn daemon, isdnd) is the cdid, an unique integer
- value uniquely describing one call, the call descriptor id.
- This structure is used to build an array of this structures
- (call_desc[N_CALL_DESC]), which must be large enough to hold as many
- calls as there are B channels in the system PLUS a reserve to be able
- to handle incoming SETUP messages although all channels are in use.
-
- More, this structure contains the so called "link table pointers"
- (isdn_link_t *ilt and drvr_link_t *dlt) which contain function pointers
- to "link" a B-channel (better the addresses of functions each participant
- needs to access each others functionality) after a successful call setup
- to a userland driver (such as isp, ipr, rbch or tel) to exchange user
- data in the desired protocol and format.
-
-Debugging control
-=================
-
-(6) the device driver for /dev/i4bctl in conjunction with the userland
- program isdndebug(8) is used to set the debug level for each of the
- layers and several other parts of the system, information how to use
- this is contained in i4b/i4b_debug.h and all parts of the kernel
- sources. It is only usable for passive cards.
-
-
-Layer 4
-=======
-
-(7) Layer 4 is "just" an abstraction layer used to shield the differences
- of the various possible Layer 3 interfaces (passive cards based on
- Siemens chip-sets, passive cards based on other chip-sets, active cards
- from different manufacturers using manufacturer-specific interfaces)
- and to provide a uniform interface to the isdnd userland daemon, which
- is used to handle all the required actions to setup and close calls
- and to the necessary retry handling and management functionality.
-
- Layer 4 communicates with the userland by using a well defined protocol
- consisting of "messages" sent to userland and which are read(2) by the
- isdnd. The isdnd in turn sends "messages" to the kernel by using the
- ioctl(2) call. This protocol and the required messages for both
- directions are documented in the i4b/i4b_ioctl.h file and are
- implemented in files i4b_i4bdrv.c and i4b_l4.c, the latter also
- containing much of the Layer 4 interface to the lower layers.
-
- i4b_l4mgmt.c contains all the required routines to manage the above
- mentioned call descriptor id (cdid) in conjunction with the call
- descriptor (array) and the call reference seen from layer 3.
-
- i4b_l4timer.c implements a timeout timer for Layer 4.
-
-
-ISDN protocol trace
-===================
-
-(8) ISDN D-channel protocol trace for layers 2 and 3 is possible by using
- hooks in the ISAC handling routines.
-
- In case D-channel trace is enabled, every frame is prepended with a
- header containing further data such as a time stamp and sent via the
- i4btrc driver found in driver/i4b_trace.c to one of the /dev/i4btrc<n>
- devices, where <n> corresponds to a passive controller unit number.
-
- If desired, B-channel data can be made available using the same
- mechanism - hooks in the HSCX handler send data up to the i4btrc
- device.
-
- The raw data is then read by the isdntrace userland program which
- decodes the layer 2 and/or layer 3 protocol and formats it to be
- easily readable by the user.
-
- B-channel data is not interpreted but dumped as a hex-dump.
-
-
-/* EOF */
diff --git a/share/examples/isdn/README b/share/examples/isdn/README
deleted file mode 100644
index 0a817f1..0000000
--- a/share/examples/isdn/README
+++ /dev/null
@@ -1,342 +0,0 @@
-
-$FreeBSD$
-
---------------------------------------------------------------------------------
-
- isdn4bsd
- ========
-
- Version 1.04.00 / August 2002
-
- written by:
-
- Hellmuth Michaelis
- Hallstrasse 20
- D-25462 Rellingen
-
- voice: +49 4101 473574
- fax: +49 4101 473575
- email: hm@freebsd.org
-
- -----
-
- The isdn4bsd package is:
-
- Copyright (c) 1997, 2002 by Hellmuth Michaelis. All rights reserved.
-
- The standard FreeBSD license applies, for details see the file
- /usr/share/examples/etc/bsd-style-copyright
-
- -----
-
- isdn4bsd would not be what it is without
- the help and support of many people,
- see file ThankYou !
-
- -----
-
- Vote with your wallet: in case you want to buy new ISDN hardware,
- buy it from manufacturers who support the development of i4b,
- for a list of supporters have a look at file ThankYou!
-
- -----
-
- This package is postcard-ware:
- ==============================
-
- The (for laywer infected places: optional) license fee for using
- isdn4bsd is sending a picture postcard of your home town.
- My address can be found at the top of this file.
-
-
---------------------------------------------------------------------------------
-
-Contents:
----------
- 1. Disclaimer
- 2. What is isdn4bsd ?
- 3. Which BSD's are supported ?
- 4. Which ISDN cards are supported ?
- 5. Where do i find documentation for isdn4bsd ?
- 6. How do i install isdn4bsd ?
- 7. Where do i get support for isdn4bsd ?
- 8. Where do i get commercial support for isdn4bsd ?
- 9. How can i help and/or support isdn4bsd ?
- 10. How do i report bugs ?
- 11. Is there a mailing-list available for isdn4bsd ?
- 12. Where can i get isdn4bsd ?
- 13. What is the reward for reading everything in this file ?
-
-
-1. Disclaimer:
---------------
-
- It may be illegal in your country to connect an isdn4bsd based machine
- using a passive ISDN card to the ISDN at your site because the protocol
- stack of isdn4bsd, which is necessary to run passive cards, has not been
- approved by the telecommunication certification authority of your country.
- If in doubt, please contact your local ISDN provider !
-
-
- 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.
-
-
-2. What is isdn4bsd ?
----------------------
-
-Isdn4bsd (or in short i4b) is a package for interfacing a computer running
-FreeBSD, NetBSD, OpenBSD or BSD/OS to the ISDN.
-
-The only ISDN protocol currently supported by the drivers for passive cards
-is the BRI protocol specified in I.430, Q.921 and Q.931; better known as
-DSS1 or Euro-ISDN.
-
-Other ISDN Protocols may be / are supported by the microcode of the supported
-active ISDN cards.
-
-Isdn4bsd allows you to make IP network connections by using either IP packets
-sent in raw HDLC frames on the B channel or by using built-in synchronous PPP
-(or using userland ppp, this is experimental and only available for FreeBSD).
-
-For telephony, isdn4bsd can answer incoming phone calls like an answering
-machine and now has preliminary dialout capabilities for voice and data calls.
-
-
-3. Which BSD's are supported ?
-------------------------------
-
-FreeBSD:
---------
-
- FreeBSD-STABLE and FreeBSD-CURRENT is supported
- by this version of isdn4bsd.
-
- I4b was integrated into FreeBSD in January 1999, so it is part
- of the base FreeBSD system since FreeBSD 3.x.
-
- Please take the time to read the available documentation carefully.
-
-
-NetBSD/i386:
-------------
- The NetBSD specific support and the Diehl driver was written by
- Martin Husemann, (martin@netbsd.org). Isdn4bsd was integrated
- into the NetBSD tree in January 2001, please have a look at
- http://www.de.netbsd.org/Documentation/network/isdn/ for more
- information.
-
-NetBSD/Amiga:
--------------
- The NetBSD/Amiga specific support was done by Ignatios Souvatzis,
- (is@netbsd.org).
-
-NetBSD/Atari:
--------------
- The NetBSD/Atari specific support was done by Leo Weppelman,
- (leo@netbsd.org).
-
-NetBSD/Alpha:
--------------
- This port is still experimental!
-
- The NetBSD/Alpha specific support was done by Jan-Hinrich Fessel,
- (oskar@zippo.unna.ping.de)
-
-OpenBSD/i386:
--------------
- Nikolay Sturm (sturm@physik.rwth-aachen.de) sent in patches to
- support OpenBSD/i386 2.6, they are still experimental and since
- i don't run OpenBSD i have no idea on the state of affairs.
-
-BSD/OS:
--------
- The BSD/OS 4.0 specific support was done by Bert Driehuis. The
- support is not yet complete. Please contact Bert directly in case
- of questions regarding this at driehuis@playbeing.org.
-
-
-4. Which ISDN cards are supported ?
------------------------------------
-
- For a list of supported ISDN cards, please have a look at
- the file "SupportedCards".
-
- Please have a look at the ReleaseNotes file !
-
-
-5. Where do i find documentation for isdn4bsd ?
------------------------------------------------
-
-- in case you are upgrading from previous versions of isdn4bsd, have a
- look at the ReleaseNotes file in the top level directory for major
- changes and improvements.
-
-- For installation instructions have a look at the isdn4bsd handbook
- available online at http://people.freebsd.org/~hm/i4b-home/
-
-- isdn4bsd has a homepage at http://www.freebsd-support.de/i4b/ where i
- will try to maintain links to docs, updates and errata.
-
-- Every program and every driver has a man page.
- Hint: try "apropos isdn4bsd", it displays all available manual pages.
-
-- The file Overview contains a short technical overview of the inner
- workings of isdn4bsd.
-
-- The file Resources contains URL's and ISBN's to more interesting ISDN
- related stuff.
-
-
-6. How do i install isdn4bsd ?
-------------------------------
-
-Read the installation instructions in the isdn4bsd handbook which is
-available online at http://people.freebsd.org/~hm/i4b-home/
-
-In case they are incomplete, unclear, wrong or outdated, please send me an
-update for inclusion into a future distribution!
-
-
-7. Where do i get support for isdn4bsd ?
-----------------------------------------
-
-Please send all questions regarding the installation, configuration
-and setup of isdn4bsd to the isdn4bsd mailing list (see below).
-
-Please do not send me private mail asking for help with the installation,
-configuration and setup of isdn4bsd: due to the amount of mail of this
-type i'm no longer able to reply to those mails.
-
-Before sending mail asking for help, PLEASE (!) read the supplied
-documentation, the examples, the handbook, the manual pages and the FAQ !
-
-I will support and help with isdn4bsd as my time permits it. Please
-keep in mind that in this case support is given on a voluntary basis
-and your questions might not be answered immediately.
-
-Also, i strongly recommend subscribing to the mailing list mentioned below.
-
-Due to the experience gained supporting the predecessor of isdn4bsd, let
-me please clearly state that there is no guarantee that your bug will be
-fixed within some specific amount of time, in fact there is no guarantee
-that your bug will be fixed at all; i'll do my best but there might be
-more important things going on in my life than giving free support for
-isdn4bsd.
-
-Some bugs seem to occur only in certain environments and are not
-reproduceable here without access to the equipment you are connected
-to or other equipment like ISDN simulators (which i don't get access to
-for free): in this case you are the only person being able to trace down
-the bug and fix it.
-
-There is a web page for i4b at http://www.freebsd-support.de/i4b/ available
-where i will put bugfixes, updates and contributions. In particular it has
-an "errata" page, where you should look in case you have problems with i4b.
-
-
-8. Where do i get commercial support for isdn4bsd ?
-----------------------------------------------------
-
-In case you want to pay for support, maintenance, enhancements, extensions
-to isdn4bsd or whatever else you may need, it is possible to hire me for
-reasonable rates through my employer HCS GmbH; in this case please contact
-me for details at hm@hcs.de and/or look at http://www.freebsd-support.de
-
-
-9. How can i help and/or support isdn4bsd ?
--------------------------------------------
-
-Send a postcard! :-)
-
-I'm open for constructive suggestions, bugreports, fixes, patches,
-enhancements and comments to improve isdn4bsd.
-
-Please send all questions regarding the installation, configuration
-and setup of isdn4bsd to the isdn4bsd mailing list.
-
-Please send flames to /dev/null and/or start writing your own ISDN package.
-
-Isdn4bsd is a project on a voluntary basis and writing and supporting
-communication systems like isdn4bsd costs much money and much time.
-
-Any contribution in terms of equipment, cards, documentation, cash
-and/or daytime payed work on isdn4bsd will be highly appreciated!
-
-You can help by not only reporting bugs, but by sending in a patch for
-the problem together with a bugreport.
-
-In case you cannot fix something yourself, please describe your problem
-as detailed as possible, include information which version of an operating
-system you are running, which ISDN board you are using, to which kind
-of ISDN equipment (like the brand of PBX) you are connected etc. etc.
-
-In case you want to get a currently unsupported card supported, write a
-low level driver for it yourself and submit it. In case you can't write
-it yourself there is a good chance to get it supported if you can donate
-one of those cards and - if at all possible - docs for it.
-
-
-10. How do i report bugs ?
---------------------------
-
-Please submit patches ONLY as context diffs (diff -c)!
-
-I vastly prefer receiving bug fixes and enhancements that are clearly
-differentiated. I don't always know what to do with large patches that
-contain many bugs and enhances folded into the same context diffs.
-
-Please keep it to one fix or enhancement per patch!
-
-If your change modifies the external interface of an isdn4bsd program,
-i.e. more config options, command-line switches, new programs, etc.,
-then please also include patches for the manual pages and documentation.
-
-Thank you!
-
-
-11. Is there a mailing-list available for isdn4bsd ?
----------------------------------------------------
-
-There is a mailing list available at
-
- freebsd-isdn@freebsd.org
-
-The list is maintained by majordomo, so i.e. to subscribe,
-send a mail with the text
-
- subscribe freebsd-isdn
-
-in the message body sent to
-
- majordomo@freebsd.org
-
-This mailing list is NOT (!) FreeBSD specific, everyone is welcome there!
-
-
-12. Where can i get isdn4bsd ?
-------------------------------
-
-The isdn4bsd package is part of FreeBSD since FreeBSD 3.0-RELEASE so you
-get isdn4bsd where you can get FreeBSD: http://www.freebsd.org
-
-Isdn4bsd has its own homepage at
-
- http://www.freebsd-support.de/i4b/
-
-
-
-13. What is the reward for reading everything in this file ?
-------------------------------------------------------------
-
-Have fun!
-hellmuth
diff --git a/share/examples/isdn/ROADMAP b/share/examples/isdn/ROADMAP
deleted file mode 100644
index 33cc055..0000000
--- a/share/examples/isdn/ROADMAP
+++ /dev/null
@@ -1,86 +0,0 @@
-
- Roadmap of isdn4bsd as integrated into FreeBSD
- ==============================================
-
- $FreeBSD$
-
- last edit-date: [Mon Aug 12 09:42:53 2002]
-
-
-1. Documentation
----------------------
-
- The i4b handbook which describes the setup and configuration of
- isdn4bsd under FreeBSD in detail can be found at
- http://people.freebsd.org/~hm/i4b-home/
-
- The i4b homepage is http://www.freebsd-support.de/i4b/
-
- The command "apropos isdn" will list all manpages available for
- isdn4bsd. Two more manual pages of interest to syncronous PPP
- over ISDN users are the pages for sppp and ispppcontrol.
-
- Under directory /usr/share/examples/isdn, you will find:
-
- FAQ - isdn4bsd Frequently Asked Questions
- KERNEL - kernel config(8) file fragment to add ISDN support
- Overview - short technical overview (outdated)
- README - the original isdn4bsd README file
- ROADMAP - this file
- ReleaseNotes - list of major changes
- Resources - where to get more information about ISDN
- SupportedCards - list of supported ISDN cards
- ThankYou - contributors to isdn4bsd
-
- contrib - contributed examples and code
- v21 - V.21 (300Bd) soft modem emulator
-
-
-2. Configuration
----------------------
-
- Configuration of the isdn4bsd package consists of:
-
- - configuring a kernel suitable for running isdn4bsd. All
- kernel configuration statements for isdn4bsd can be found
- in the file /usr/src/sys/i386/conf/NOTES - another way to
- get started is taking the GENERIC configuration file and
- appending the KERNEL file mentioned above.
-
- - configuring the network interfaces iprX and/or ispX; the
- former are used for "IP over raw HDLC" and the latter are
- used for "sync PPP over ISDN". To configure the ipr-
- interfaces, read the output of "man i4bipr", to configure
- the isp-interfaces, read the output of "man i4bisppp",
- "man sppp" and "man ispppcontrol" carefully.
-
- - writing a configuration file /etc/isdn/isdnd.rc for the
- isdn daemon isdnd(8) which is responsible for the ISDN
- call control mechanisms such as: dial on demand, dial
- retry, dial recovery, timeout and short hold operation.
- A sample (!) file can be found in /etc/isdn. Please read
- the output of "man isdnd" and "man isdnd.rc" carefully.
-
-
-2. Userland programs
--------------------------
-
- The userland programs can be found in the sourcetree under
- /usr/src/usr.sbin/i4b and get installed under /usr/sbin.
-
- Isdntest will not be installed by default.
- Isdnphone is experimental and may not run with your soundcard.
-
-
-3. Kernel part
--------------------
-
- The kernel part of isdn4bsd can be found at /usr/src/sys/i4b.
-
-
-4. Answering machine messages
-----------------------------------
-
- Messages to be used by the answering machine can be found in
- /usr/share/isdn, you'll find the numbers 0 to 9, a beep and
- a short announcement message here.
diff --git a/share/examples/isdn/ReleaseNotes b/share/examples/isdn/ReleaseNotes
deleted file mode 100644
index cf93e65..0000000
--- a/share/examples/isdn/ReleaseNotes
+++ /dev/null
@@ -1,196 +0,0 @@
-$FreeBSD$
-
-ReleaseNotes for isdn4bsd last edit-date: [Mon Aug 12 09:47:59 2002]
-================================================================================
-
-release 1.04
---------------------------------------------------------------------------------
-
-- add support properly displaying and logging incoming telephone numbers (MSNs)
- by looking at the "type of number" field and providing configurable hooks
- to correct the numbers accordingly. See keywords add-prefix, prefix-national
- and prefix-international in isdnd.rc(5).
- This feature was implemented by Christian Ullrich <chris@chrullrich.de>
-
-release 1.03
---------------------------------------------------------------------------------
-
-- add support for Data over Voice (DoV) outgoing calls, see entry keywork
- bcap in isdnd.rc(5).
- based on patches received from Guy Ellis (guy@traverse.com.au),
- Chris Collins (xfire@xware.cx) and Phillip Musumeci (phillip@cs.jcu.edu.au).
-
-release 1.02
---------------------------------------------------------------------------------
-
-- add support for ISDN subaddressing written by Steve Looman
-
-- made ELSA PCC16 attach correctly (again ?)
-
-- fixed bug in CAPI support (patch from Juha-Matti Liukkonen <jml@cubical.fi>)
-
-- add support written by Steve Looman for the Compaq Microcom 610 ISDN card
- (also known as Compaq series PSB2222I).
-
-release 1.01
---------------------------------------------------------------------------------
-
- - add experimental support to send messages via the keypad facility to the
- PBX or exchange office. The messages - if supported - may be used to
- configure and maintain optional services offered by the PBX or exchange
- office such as call deflection mailbox services. Please consult the
- nice documentation for the exchange you are connected to.
-
- Currently keypad messages can be send by using the isdnphone utilities
- "-k" switch on the command line. Don't forget to properly quote the
- message in case it contains shell meta characters!
-
- - add keyword "maxconnecttime" to isdnd to prevent a potential telco bill
- desaster. Caution: use only in conjunction with budgets to limit the number
- of dials per timeunit otherwise you will get endless redials and reconnects!
-
-release 1.00
---------------------------------------------------------------------------------
-
- - CAPI interface driver and AVM B1/T1 driver added. Both were written and
- contributed by Juha-Matti Liukkonen <jml@cubical.fi> of Cubical Solutions
- Ltd, Finnland. To support this, two new keywords were added to isdnd.rc:
- "firmware" to be used in the controller section and "clone" to be used
- in the entry section.
-
-
-beta release 0.96
---------------------------------------------------------------------------------
-
- - it is now possible to mark an entry as valid for a specified day of week
- and a specific time range only to take advantage of some new tariff models.
- Please see the new keywords "valid" and "holidayfile" in isdnd.rc(5).
- This feature is considered experimental, use at your own risk!
-
- - keywords budget-callbacksfile and budget-calloutsfile added to isdnd's
- entry section to write statistics information to a file
-
- - a driver for the Dynalink IS64PH is now available for FreeBSD 4.x and up
-
-
-beta release 0.95
---------------------------------------------------------------------------------
-
- - ITK ix1 micro ISA non-PnP card should now work for FreeBSD >= 4.0
-
- - setting "dialretries = -1" in isdnd.rc gives an unlimited number
- of dial retries for that entry.
-
- - the ELSA PCFpro ISDN card should now work for FreeBSD >= 4.0
-
- - added new keywords (patch from Stefan Esser) to configure isppp
- from within isdnd.rc. Documented in isdnd.rc(5), grep for "ppp-"
-
- - isppp VJ compression negotiation now run-time configurable using
- keywords "enable-vj" / "disable-vj" with ispppcontrol
-
- - added new keywords to specify "budgets" for outbound calls in isdnd
- to limit the number of possible calls within a given time period.
- Runtime budget information and statistics are available in the isdnd
- fullscreen menu display.
-
- - added new "ifpnp" AVM Fritz!Card PnP driver for FreeBSD >= 4.0
- contributed by Udo Schweigert.
-
- - added experimental hardware driver from Hans Petter Selasky for the
- Teles 16.3c card based on the Cologne Chip Designs HFC-S 2BDS0 chip
- called "ihfc".
- notes for Teles 16.3c PnP and AcerISDN P10: For optimal performance:
- -> please connect the card to the S0-bus before booting the computer.
- -> do not change the cable you're using when first booted.
- Other notes if the card does not work at all:
- -> disconnect other isdn equipment on your S0-bus and
- reboot your computer.
- -> try changing the CLKDEL/stdel value for your card:
- ../i4b/layer1-nb/ihfc/i4b_ihfc_pnp.c or
- ../i4b/layer1/ihfc/i4b_ihfc_pnp.c
- around line 100. The value can be in the range 0x0-0xf.
-
- - the FreeBSD >= 4.0 AVM Fritz PCI driver was moved to a separate layer 1
- driver called "ifpi".
-
- - the sppp subsystem was integrated into the i4bisppp/isp driver. There
- is no need to include something like "option sppp" into your kernel
- config file anymore. The spppcontrol utility is no longer usable to
- configure the i4bisppp/isp driver, instead use the new ispppcontrol
- utility!
-
- - FreeBSD >= 4.0: "iwic" driver for Winbond PCI ISDN chipset (W6692)
- added, used i.e. in ASUSCOM P-IN100-ST-D and Dynalink IS64PPH.
-
- - added more protocol decoding to isdntrace
-
- - isntrace now adds a time/datestamp to the trace filename, signal USR1
- behaviour has changed, see manpage.
-
- - ispppcontrol now has a new option of setting the LCP timeout value
-
- - add directory mpd which contains docs and files on howto interface
- i4b by using the netgraph subsystem to the multilink ppp daemon, mpd.
-
- - add i4bing, a raw HDLC B-channel interface to the NetGraph subsystem
-
- - add a V.21 modem emulator written by Poul-Henning Kamp
-
- - a new system configuration keyword "extcallattr" was added to isdnd
- which allows to configure the display of the extended caller
- attributes "screening indicator" and "presentation indicator" in
- isdnd's log file.
-
-
-beta release 0.90
---------------------------------------------------------------------------------
-
- - the following cards are no longer supported for FreeBSD 4.0 and up:
-
- AVM Fritz!Card PnP
- AVM Fritz!Card PCMCIA
- Dynalink IS64PH
- ITK ix1 Micro
- USRobotics Sportster ISDN TA intern
-
- The AVM cards, the USR card and perhaps one of the ITK cards are likely
- to be resurrected in the future, we just ran out of time, docs and/or
- into programming problems for this release.
-
- - the rbch driver was enhanced to support the generation of accounting
- information in HDLC mode. The bytecount and bps fields in isdnd
- fullscreen mode now show meaningful information.
-
- - most of the layer1 drivers have been rewritten to support the new bus
- and driver architecture for FreeBSD 4.0.
-
- - the ipr interfaces now support logging of some of the first ip packets
- of a new connection and displaying them in the isdnd logs. To enable
- this, add a line like: "options IPR_LOG=32" to your kernel config
- file. The parameter to IPR_LOG specifies the number of packets to be
- logged.
-
- - support for FreeBSD 2.x and FreeBSD 3.0-RELEASE has been removed.
- The last beta release which supports this OS versions is i4b-0.83.
-
- - isdnd now recognizes two new keywords in the system section, mailto
- and mailer. mailer is used to configure a mail program and is typically
- set to /usr/bin/mail and mailto is set to the address of the isdnd
- administrator. If both are set and a fatal error inside isdnd
- happenes, mail is sent to the address in mailto with the error
- message before isdnd terminates.
-
- - isdnd.rc now has an optional new "controller" section. This will be
- used to specify different D-channel protocols in the future. It looks
- like this:
-
- controller
- protocol = dss1 # dss1 (default) or d64s (leased line)
-
- Please note that leased line support (d64s) is NOT yet functional!
-
- - isdnmonitor is now able to be used like isdnd in fullscreen mode from
- a remote machine.
-
-EOF
diff --git a/share/examples/isdn/Resources b/share/examples/isdn/Resources
deleted file mode 100644
index c26aec0..0000000
--- a/share/examples/isdn/Resources
+++ /dev/null
@@ -1,82 +0,0 @@
-$FreeBSD$
-
-
-Bugfixes, improvements and patches for i4b
-==========================================
-
- http://www.freebsd-support.de/i4b/ (in the "errata" section)
-
-
-Standards:
-==========
-
- ETSI
- ----
- http://www.etsi.org/
-
- ITU
- ---
- http://www.itu.ch/
-
- ftp://ftp.leo.org/pub/comp/doc/standards/itu/
-
- CAPI
- ----
- http://www.capi.org/
-
-
-ISDN Chips
-==========
-
- Infineon (formerly Siemens)
- ---------------------------
- http://www.infineon.com/
-
- Cologne Chip Design
- -------------------
- http://www.colognechip.de/
-
- Winbond
- -------
- http://www.winbond.com/
-
-
-SunShine Project - Implementation of the ISDN recommendations Q.921 & Q.931
-===========================================================================
-
- http://www.tcm.hut.fi/~bos/ISDN/sunshine/SunShine.html
-
-Books:
-======
-
- "ISDN: concepts, facilities and services",
- Gary C. Kessler, McGraw-Hill 1993,
- ISBN 0-07-034247-4
-
- "Integrated services digital networks: architectures, protocols, standards",
- Herman J. Helgert, Addison-Wesley 1991,
- ISBN 0-201-52501-1
-
- "ISDN and Broadband ISDN with Frame Relay and ATM",
- William Stallings, Prentice Hall 1995,
- ISBN 0-02-415513-6
-
- "Technik der Netze",
- Gerd Siegmund, R. v. Decker's Verlag 1996,
- ISBN 3-7685-2495-7
-
- "Euro-ISDN fuer Anwender und Techniker"
- Reinhard Heermeyer und Maria Spath, Festo DIDACTIC 1996,
- ISBN 3-8127-4334-5
-
- "ISDN implementors guide: standards, protocols & services",
- Charles K. Summers, McGraw-Hill 1995,
- ISBN 0-07-069416-8
-
- "PPP Design and Debugging",
- James Carlson, Addison-Wesley 1998,
- ISBN 0-0201-18539-3
-
- "ISDN - Die Technik",
- Andreas Kanbach, Andreas Koerber, Huethig Verlag 1999,
- ISBN 3-7785-2288-4
diff --git a/share/examples/isdn/SupportedCards b/share/examples/isdn/SupportedCards
deleted file mode 100644
index 1c47002..0000000
--- a/share/examples/isdn/SupportedCards
+++ /dev/null
@@ -1,196 +0,0 @@
---------------------------------------------------------------------------------
-
- ISDN cards supported by isdn4bsd in FreeBSD
- ===========================================
-
- last edit-date: [Sun Oct 21 11:09:24 2001]
-
- $FreeBSD$
-
---------------------------------------------------------------------------------
-
- YES - card is generally supported for this OS
- NO - card is NOT supported for this OS
- EXP - card is in an experimental status for this OS
- DEV - card driver is under development
- ??? - card status is unknown for this OS
-
-
-1. Passive non-PnP ISA bus ISDN cards
-=====================================
-
- Type FreeBSD Notes
- --------------------- ------- -----------------------
- AVM A1 YES
- AVM Fritz!CardClassic YES
- Creatix ISDN-S0/8 YES (= Teles S0/8 )
- Creatix ISDN-S0/16 YES ( = Teles S0/16 )
- Dr.Neuhaus Niccy 1008 YES ( = Teles S0/8 )
- Dr.Neuhaus Niccy 1016 YES ( = Teles S0/16 )
- ELSA PCC-16 YES
- ELSA PCFpro YES
- ITK ix1 micro YES (Note 13)
- Stollmann Tina-pp YES
- Teles S0/8 YES
- Teles S0/16 YES
- Teles S0/16.3 YES
- 3Com/USR SportsterInt YES ( = Stollmann Tina-pp )
- TELEINT ISDN SPEED EXP (Note 4)
-
-
-2. Passive PnP ISA bus ISDN cards
-=================================
-
- Type FreeBSD Notes
- --------------------- ------- -----------------------
- AVM Fritz!Card PnP YES (Note 1)
- Asuscom I-IN100-ST-DV ??? ( = Dynalink IS64PH )
- Asuscom ISDNlink 128K YES (Note 16)
- Creatix ISDN-S0 PnP YES (Note 2)
- Dr.Neuhaus Niccy GO@ YES (Note 2)
- Dynalink IS64PH YES (Note 11)
- ELSA 1000pro ISA YES (Note 3)
- ITK ix1 micro V.3 YES (Note 13)
- Sagem Cybermod YES (= Niccy GO@ )
- Sedlbauer Win Speed YES (Note 9)
- Siemens I-Surf 2.0 YES (Note 15)
- Teles S0 PnP YES (Note 5)
- Teles 16.3c EXP (Note 4)
- AcerISDN P10 EXP (Note 4)
- Compaq Microcom 610 YES ( = Compaq series PSB2222I ?)
-
-
-3. Passive PCI bus ISDN cards
-=============================
-
- Type FreeBSD Notes
- --------------------- ------- -----------------------
- ASUSCOM P-IN100-ST-D YES
- AVM Fritz!Card PCI YES (Note 14)
- AVM Fritz!Card PCI V2 YES (Note 14)
- Dynalink IS64PPH YES
- Dynalink IS64PPH+ YES
- ELSA 1000pro PCI YES ( = ELSA Microlink PCI )
- Teles PCI-TJ YES
- NETJet-S YES
- Winbond W6692-based YES
-
-
-4. Passive PCMCIA bus ISDN cards
-================================
-
- Type FreeBSD Notes
- --------------------- ------- -----------------------
- AVM Fritz!Card PCMCIA NO (Note 10)
- ELSA ISDN/MC NO
- ELSA MC/ALL NO
-
-
-5. Passive Zorro2 ISDN cards for the Amiga
-==========================================
-
- Type FreeBSD Notes
- --------------------- ------- -----------------------
- ISDN Blaster NO (Note 12, Amiga/NetBSD)
- ISDN Master NO (Note 12, Amiga/NetBSD)
- ISDN Master II NO (Note 12, Amiga/NetBSD)
-
-
-6. Active ISDN cards
-====================
-
- Type (active, ISA) FreeBSD Notes
- --------------------- ------- -----------------------
- AVM B1 YES (Note 17)
- AVM T1 YES (Note 18)
- DiehlS,SX,SCOM,QUATRO NO (Note 7)
- Miro P1 DEV ( = Tina-dd )
- Stollmann Tina-dd DEV (Note 8)
-
-
-7. Notes
-========
-
-
-Note 1: The driver for the Fritz!Card PnP was developed by Udo Schweigert
- (ust@cert.siemens.de) who develops under FreeBSD only.
- Please contact Udo in case of trouble.
-
-Note 2: The NetBSD version has not been verified to work yet.
-
-Note 3: Due to its design, this card produces 128 IRQs/sec. This can be
- reportedly stopped by disconnecting pin 12 of the 7474 and wiring
- it to pin 15 of the 74175. Be careful! This procedure has not been
- verified and doing this will immediately terminate your warranty !!
- The card will not function anymore with drivers for other OSes and
- you may not get any further support from the manufacturer! YMMV!
-
-Note 4: This driver was developed by Hans Petter Selasky, hselasky@c2i.net
- The code is still somewhat experimental.
-
-Note 5: The card has only been verified to work under FreeBSD 4.0 and up.
-
-Note 6: This driver is currently under development by Gary Jennejohn who
- develops under FreeBSD only.
-
-Note 7: This driver is currently under construction by Martin Husemann who
- develops under NetBSD only.
-
-Note 8: This driver is currently under development by Hellmuth Michaelis who
- develops under FreeBSD only.
-
-Note 9: This driver was developed by German Tischler, tanis@gaspode.franken.de.
- Please contact him in case of trouble. The "Teledat 100" sold by the
- german Telekom is identical with this card.
-
-Note 10: This driver is developed by Matthias Apitz, matthias.apitz@sisis.de.
- Please contact him in case of trouble. Please read the file
- misc/README.PCCARD in the i4b distribution for additional installation
- instructions.
-
-Note 11: This driver was developed by Martijn Plak (martijn@be3.com)
- This driver might also work for Asuscom cards. (Andrew Gordon
- wrote: Just to let you know that I've now tried the i4b "dynalink"
- driver with the ASUSCOM I-IN100-ST-DV card, and it appears to work
- fine.)
-
- Note: This driver is now unsupported as Martijn is no longer able
- to maintain this driver.
-
- The BSD/OS support for this card was written by Bert Driehuis.
-
- Ported to FreeBSD newbus by Kazunori Fujiwara <fujiwara@rcac.tdi.co.jp>
-
-Note 12: This driver was developed by Ignatios Souvatzis (is@netbsd.org)
- Please contact him in case of trouble.
- This driver is supposed to work on the ISDN Master versions and
- lookalikes, like the ISDN Blaster, and on the ISDN Master II.
- Note that the ISDN Master II does not AutoConfig(tm)ure in the
- DraCo Zorro bus and thus only works in real Amigas. This is no
- i4b problem, but general.
-
-Note 13: This driver was developed by Martin Husemann, please contact him
- in case of trouble. The FreeBSD PnP support for version 3 of the
- card was done by Philippe Guezou <Philippe.Guezou@wanadoo.fr>.
-
-Note 14: This driver was developed by Gary Jennejohn who develops under
- FreeBSD only. In case of problems with this driver, please contact
- him directly at garyj@jennejohn.org.
-
-Note 15: The driver for the Siemens I-Surf 2.0 was developed by Udo Schweigert
- (ust@cert.siemens.de) who develops under FreeBSD only.
- Please contact Udo in case of trouble.
-
-Note 16: The driver for the Asuscom ISDNlink 128K PnP was developed by
- Ari Suutari (ari@suutari.iki.fi). Please contact Ari directly
- in case of trouble with this driver.
-
-Note 17: The driver was written by Juha-Matti Liukkonen <jml@cubical.fi>,
- Cubical Solutions Ltd. I have tested it with an AVM B1 PCI card
- V.4.0 and an AVM B1 ISA card V.2.0.
-
-Note 18: The driver was written by Juha-Matti Liukkonen <jml@cubical.fi>,
- Cubical Solutions Ltd. I have no access to any PRI equipment at
- all so i have not tested the driver, feedback welcome!
-
-EOF
diff --git a/share/examples/isdn/ThankYou b/share/examples/isdn/ThankYou
deleted file mode 100644
index 3ad4cb0..0000000
--- a/share/examples/isdn/ThankYou
+++ /dev/null
@@ -1,289 +0,0 @@
-$FreeBSD$
-
-Thanks a lot for postcards from:
---------------------------------
-
- Aachen
- Arnhem
- Arolsen
- Bad Rothenfelde
- Berlin
- Birenbach
- Bochum
- Bohnsdorf
- Bonn
- Bornheim
- Braunschweig
- Darmstadt
- Delft
- Dresden
- Eggstaett am Hartsee
- Flekkefjord
- Freiburg
- Habichtswald
- Hamburg (2)
- Ihlow
- Jena
- Kassel
- Koengen
- Kymgbuk, Korea
- Landsberg
- Leiden
- Magdeburg
- Mauerbach
- Mersch
- Middelburg
- Mosi-Oa-Tunya
- Muenchen (4)
- Netherlands (Leo)
- Netherlands (Peter)
- Rio de Janeiro
- Saint-Gilles-Croix-de-Vie
- Scheessel
- Siena, Italy
- St. Jacob
- Stuttgart
- Travemuende
- Vedskoelle, Danmark
- Windach
- Wuerzburg
- Zuberec
-
-
-I would like to thank the following people and organisations:
--------------------------------------------------------------
-
-Gary Jennejohn for his constant kind support while writing isdn4bsd
- during that year. Gary always runs the latest and
- greatest FreeBSD-current and makes isdn4bsd run
- there, if his root fs is intact, of course! :-).
- In February 1999, Gary contributed the AVM Fritz!
- Card PCI driver to isdn4bsd.
-
-Martin Husemann is a major contributor to isdn4bsd. He wrote almost
- all of the NetBSD support for isdn4bsd, the monitor
- network code and the Diehl driver. He constantly
- tries put strange macros into i4b ... ;-)
-
-Serge Vakulenko for writing the sppp driver and making it freely
- available.
-
-Joerg Wunsch for adapting the synchronous PPP stuff to i4b.
- Gary finished this and integrated the PPP stuff into
- current isdn4bsd.
-
-Wolfgang Helbig for many patches, polishing isdn4bsd and layer 1
- debugging.
-
-Thomas Halenbeck and
-Stephan Forth of FORTH EDV in Mainz donated two AVM A1 card and
- one AVM B1 card to support the development and
- maintenance of drivers for this cards. Thomas donated
- three more AVM A1 cards in the meantime - Thank you!
-
-Arne Helme for the initial work on how to support IOM-2 based
- boards.
-
-Andrew Gordon for disassembling an old AVM A1 and documenting it.
- Andrew added VJ header compression to the ipr interface
- and is a constant source of various hints and
- suggestions :-)
- Andrew sent in a Teles S0/16 PnP for FreeBSD newbus
- conversion, thanks a lot!
-
-Juergen Krause and someone who does not want to be mentioned anymore
- for the work on the first ISDN package for FreeBSD.
-
-Michael Elbel for supporting the development with ftp/www/mail
- resources.
-
-Leo Weppelman for the port to the NetBSD/Atari platform.
-
-Bas Oude Nijeweme for the port to OpenBSD/i386 2.2.
-
-German Tischler for the driver for the Sedlbauer WinSpeed card,
- for the PnP support for FreeBSD and for constant
- testing and contributions. German did the initial
- mostly complete conversion of the layer1 code
- to the FreeBSD 4.0 new-bus driver architecture!
-
-Matthias Apitz for the driver for the AVM PCMCIA Fritz!Card.
-
-Martijn Plak for the Dynalink driver.
-
-Ignatios Souvatzis for the NetBSD/Amiga port and associated driver(s).
-
-Christoph Weber-Fahr donated an AVM B1 card to support development of a
- driver. Thanks a lot, Christoph!
-
-Eivind Eklund for the PnP support for FreeBSD, for __FreeBSD_version
- and more.
-
-Karsten Keil author of the hisax isdn4linux driver for some details
- about the one or the other piece of hardware.
-
-Bert Driehuis for the support of the BSDI BSD/OS 4.0 operating system
-
-Barry Scott for fixed charging units shorthold mode support (as
- used in the UK by British Telecom).
-
-Poul-Henning Kamp for the work on DTMF decoding and many hints, fixes
- and suggestions.
-
-Stefan Bethke for the work on the audio format conversion stuff in
- the telephony paths.
-
-Udo Schweigert for PCMCIA support and work on FreeBSD 2.2x
- compatibility. Udo contributed the AVM Fritz PnP
- and the Siemens I-Surf V2.0 driver.
-
-Ernst Winter donated a Fritz!Card PCI which was used to develop
- and test the driver.
-
-Harald Frank long-term loan of an ISDN Blaster board.
-
-Klaus Burkert for a loan of an ISDN Master II.
-
-Ari Suutari for a driver for the Asuscom ISDNlink ISA PnP card
-
-Brian Somers for working on making userland ppp work with i4b
-
-Rune Knapstad for good help with the port to OpenBSD/i386 2.5
-
-Uwe Laverenz for the donation of an ELSA PCC-16 card
-
-Luke Roberts for the long time loan a Dynalink ISDN intern PCI card
-
-Marc van Kempen for the donation of a Dynalink ISDN intern PCI card
-
-Christoph Kukulies for the donation of an ITK ix1 card
-
-Nikolay Sturm sent in patches to get OpenBSD 2.6 supported.
-
-Dave Boyce wrote a driver for the Winbond W6692 PCI ISDN
- chip which eventually lead to a layer 1 reorg.
-
-Hans Petter Selasky for his contribution of a driver for the
- Teles 16.3c card (and the complete ihfc driver).
-
-Sergio de Souza Prallon for the contribution of the itjc driver which
- supports the NETJet-S and the Teles PCI-TJ cards
-
-Steve Looman for the driver for a Compaq Microcom 610 ISDN card
- and for the subaddressing implementation
-
-Christian Ullrich for the "type of number" patchset
-
-
- ------------------------------------------
-
-
-Liebscher & Partner Martin Welk and Holm Tiffe sent in a motivating
- BSD daemon plushie :-)
-
-Abaid Andreas Mutschlechner of Abaid, Alte Strasse 2, in
- I-39017 Schenna (BZ) donated money to support i4b
- development, which was used to upgrade my main test
- machine for isdn4bsd from an 486 to a Pentium II.
- Thank you very, very much, Andreas !
-
-3Com USRobotics Christian Weissgerber of 3Com USRobotics in Munich
- donated a passive "Sportster ISDN TA intern" ISDN
- card and complete hardware documentation for the card.
-
- Florian Uhl of 3Com in Munich donated two MC68SC302
- "3Com U.S.Robotics ISDN Card PnP internal" cards and
- documentation to support writing a driver for this
- card.
-
-Dr. Neuhaus Klaus Muehle of Dr. Neuhaus Telekommunikation in
- Hamburg sent documentation for the NICCY GO@ and
- NICCY EASY@ ISDN cards to support development of
- a driver for this cards.
-
-Stollmann Many thanks to Christian Luehrs and Manfred Jung
- for giving out docs and sources to support the
- driver development for the tina-dd active card.
-
-ELSA Axel Riemer of ELSA AG in Aachen donated several
- ISA, PCI and PC-Card ISDN boards to three developers
- and provided support and documentation to help with
- adding support to i4b for this hardware. Werner Fehr
- of ELSA answered our technical questions and gave
- valuable hints. Thanks also to Andreas Klemm for
- making the contact ;-)
-
-Cologne Chip Design Harald Schaefer of Cologne Chip Design send in a
- HFC-S-PCI developer card, complete docs and
- layer 1 example code to support the development
- of a driver for that chipset! Thanks a lot!
-
-ASUSCOM Network Inc. Mr. Ben Chen of Asuscom sent a Winbond based PCI
- card and a Cologne Chip Design based PCI card to
- support the development of device drivers.
-
-Cubical Solutions Ltd. Juha-Matti Liukkonen <jml@cubical.fi> of Cubical
- contributed the CAPI layer and the AVM B1/T1 device
- driver to isdn4bsd.
-
-AVM GmbH Mr. A. Ziessnitz of AVM donated an AVM B1 PCI cards
- to support development and maintenance of a driver
- for this card.
-
-Intelligent Network Technology Ltd.
- David Hedley provided an AVM Fritz!Card PCI Version 2
- controller to support development of a driver.
-
-
-
-The following people contributed in one or the other way to isdn4bsd:
----------------------------------------------------------------------
-
- Alexander Langer
- Andreas Haakh
- Andreas Lohrum
- Arve Ronning
- Aurelien Bargy
- Bart van Leeuwen
- Caspar Schlegel
- Chris Collins
- Christian Wolf
- Christoph Kukulies
- Daniel Rock
- David Wetzel
- Dirk Meyer
- Doobee R. Tzeck
- Dominik Brettnacher
- Gabor Dolla
- Guy Ellis
- H. Eckert
- Hans Huebner
- Harald Hanche-Olsen
- Harold Gutch
- Heiko Schaefer
- Jan Sparud
- Joachim Kuebart
- Joakim Hernberg
- Juha-Matti Liukkonen
- Julian H. Stacey
- Kazunori Fujiwara
- Lars Koeller
- Malte Lance
- Marcel Moolenaar
- Martin Recktenwald
- Meike Aulbach
- Michael Hohmuth
- Michael Ranner
- Michael Reifenberg
- Nils Ulltveit-Moe
- Paul Herman
- Paul Sijben
- Phillip Musumeci
- Philippe Guezou
- Rob Pickering
- Stefan Esser
- Stefan Herrmann
- Steven Looman
- Wolfgang Solfrank
-
-(In case i forgot someone, please tell me!)
diff --git a/share/examples/isdn/contrib/README b/share/examples/isdn/contrib/README
deleted file mode 100644
index ae5969f..0000000
--- a/share/examples/isdn/contrib/README
+++ /dev/null
@@ -1,42 +0,0 @@
-$FreeBSD$
-
-This directory contains various unsupported contributions to isdn4bsd
----------------------------------------------------------------------
-
-anleitung.ppp Anleitung für syncPPP Internet-Zugang und
- Anrufbeantworter / FreeBSD 2.2.x / Teles.S0/16.3-Karte
- (stefan@asterix.webaffairs.net)
-
-answer.c answering machine in C by David Wetzel
- (dave@turbocat.de)
-
-answer.sh a much better replacement for answer, tell and record
- from Stefan Esser (se@freebsd.org)
-
-convert.sh convert recorded message to WAV format, optionally
- send it via mail. from Stefan Herrmann
- (stefan@asterix.webaffairs.net)
-
-hplay.c isdn4bsd telephony output driver for the "rsynth"
- package to play synthetic speech to a telephone
- connection
-
-i4b-ppp-newbie.txt setup PPP for isdn4bsd for newbies text from
- Dominik Brettnacher <domi@saargate.de> (german)
-
-isdnctl This script can control the state of your ISDN line.
- It counts how many scripts/users currently use the
- ISDN line and uses "ifconfig down" if noone uses it
- any more. Alexander Langer <alex@big.endian.de>
-
-isdnd_acct the barebones isdnd accounting script
-
-isdnd_acct.pl enhanced accounting from Joachim Kuebart
- (joki@kuebart.stuttgart.netsurf.de)
-
-isdntelmux.c a "record while play" program contributed by
- Michael Reifenberger (Michael@Reifenberger.com)
-
-mrtg-isp0.sh shell script and mrtg config entry to display
- callout and callback statistics with mrtg
- (www.mrtg.org) using the budget file statistics
diff --git a/share/examples/isdn/contrib/anleitung.ppp b/share/examples/isdn/contrib/anleitung.ppp
deleted file mode 100644
index 01466e2..0000000
--- a/share/examples/isdn/contrib/anleitung.ppp
+++ /dev/null
@@ -1,142 +0,0 @@
-$FreeBSD$
-
-i4b Anleitung für syncPPP Internet-Zugang und Anrufbeantworter
-unter FreeBSD 2.2.x mit Teles.S0/16.3-Karte
-===============================================================
-
-by Stefan Herrmann <stefan@asterix.webaffairs.net>
-
-
-Installation
-------------
-1) Neues Verzeichnis "/usr/src/i4b" anlegen.
-
-2) Ins Verzeichnis "/usr/src/i4b" wechseln und Sourcen entpacken.
-
-3) Ins Verzeichnis "FreeBSD" wechseln und den Befehl "sh install.sh ausführen:
- z.B. "root@asterix[0]/usr/src/i4b/FreeBSD # sh install.sh"
-
- Wenn auf eine neuere Version von i4b gewechselt wird, zuerst
- "sh uninstall.sh" ausführen, dann erst "sh install.sh"
-
-4) Dann ins Verzeichnis "/usr/src/i4b" (zurück-)wechseln und die Befehle
- "make depend", "make" und "make install" ausführen.
-
-5) Nun muß der kernel mit neuen Optionen versehen werden. Dazu wird an die
- Kernel-Konfigurationsdatei im Verzeichnis "/sys/i386/conf" folgendes ans
- Ende hinzugefügt:
-
-# i4b passive ISDN cards support (isic - I4b Siemens Isdn Chipset driver)
-# note that the ``options'' and ``device'' lines must BOTH be defined !
-
-# Teles S0/16.3
-options "TEL_S0_16_3"
-device isic0 at isa? port 0xd80 net irq 5 flags 0x04 vector isicintr
-
-# i4b passive cards D channel handling
-# Q.921
-pseudo-device "i4bq921"
-# Q.931
-pseudo-device "i4bq931"
-
-# common passive and active layer 4
-# layer 4
-pseudo-device "i4b"
-
-# userland driver to do ISDN tracing (for passive cards oly)
-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
-pseudo-device sppp 4
-
-6) Danach wird der kernel durch Eingabe der Befehle "make depend", "make" und
- "make install" im Verzeichniss "/usr/src/sys/compile/<CONFIG>" neu
- übersetzt und installiert.
-
-7) Nach dem Booten kann man dann mit dem Befehl "dmesg" überprüfen, ob die
- Karte korrekt erkannt wurde und alle erforderlichen Treiber installiert
- sind.
-
-
-Konfiguration
--------------
-8) Die Konfiguration von i4b wird hauptsächlich im Verzeichnis "/etc/isdn"
- druchgeführt, dort sucht der isdnd beim Start auch seine Konfigurations-
- datei "isdnd.rc". Da vorgenanntes Verzeichnis nach der Installation aber
- noch leer ist, kopiert man zuerst die Beispieldateien aus dem Verzeichnis
- "/etc/isdn/samples" nach "/etc/isdn".
-
-9) Die Datei "isdnd.rc" enthält schon recht aussagekräftige Kommentare zu den
- einzelnen Optionen, weitere Informationen erhält man mit "man isdnd.rc" und
- "man isdnd".
-
-10) Für syncPPP und Anrufbeantworter sind nur die Sektionen "SYSTEM",
- "telephone answering" und "example for sPPP" notwendig, die Sektion
- "IP over ISDN example" kann dafür also entfernt werden.
-
-11) Für den automatisierten Start des isp0 Interfaces und des isdnd erstellt
- man nun ein Start-Skript. Dazu kopiert man die Datei
- "/usr/src/i4b/etc/rc.isdn-PPP" nach "/etc/rc.isdn" und paßt sie
- entsprechend an. Man beachte hierbei auch die FAQ "/usr/src/i4b/FAQ", die
- Tips für die richtige Eintragung der IP-Adressen bereithält.
-
-12) Der Anrufbeantworter wird dadurch aktiviert, daß das entsprechende
- Programm, das in "/etc/isdn/isdnd.rc" hinter dem Eintrag "answerprog = "
- steht, aufgerufen wird. Wird dort kein Pfad angegeben, wird das Programm
- im Verzeichniss "/etc/isdn" erwartet. Beispiele solcher Programme findet
- man wiederum im Verzeichnis "/etc/isdn/samples". Sie nennen sich
-
- "answer" Nur Ansagetext abspielen, keine Aufzeichnungsmöglichkeit.
- "record" Ansage wird abgespielt, nach Piep-Ton kann gesprochen
- werden.
- "tell" Als Ansagetext wird die anrufende Nummer gesprochen, keine
- Aufzeichnung.
- "tell-record" Anrufende Nummer als Ansagetext, nach Piep-Ton kann ge-
- sprochen werden.
- "isdntel.sh" Ansagetext und Aufzeichnung; mittels dem Programm "isdntel"
- hat man die Kontrolle übe die Aufzeichnungen im Ver-
- zeichniss "/var/isdn". Siehe auch "man isdntel" und
- "man isdntelctl".
-
- Diese Programme müssen an die eigenen Wünsche angepaßt werden. Leider gibt es
- kein mitgeliefertes Programm, mit dem man so auch den Ansagetext aufsprechen
- kann. Das ist aber nicht allzuschlimm, da man nur das Programm "record" dafür
- etwas anpassen muß (Ansagetexte beep und msg auskommentieren). Damit die Anrufe
- aufgezeichnet werden können, muß zuerst noch das Verzeichnis "/var/isdn"
- angelegt werden. Dort werden dann alle Aufzeichnungen obiger Programme gespeichert.
-
-13) Man sollte sich auch noch die man-Pages der Programme "isdnd", "isdnctl",
- "isdnd_acct", "isdndebug" und "isdntrace" zu Gemüte führen.
-
-
-Betrieb
--------
-14) Der syncPPP Zugang zum Provider wird einfach mit dem Aufruf von
- "/etc/rc.isdn" initialisiert. Jegliche Aktivitäten ins Internet (also z.B.
- ein "ping 141.1.1.1") starten die Verbindung. Wenn in "/etc/isdn/isdnd.rc"
- beim Eintrag "unitlengthsrc = " "rate" angegeben wurde, wird die Verbindung
- kurz bevor die nächste Einheit begonnen wird, beendet. Informationen über
- die Einheiten werden aus der Datei "/etc/isdn/isdnd.rates" ausgelesen
- (Beispiele sind in "/etc/isdn/samples").
-
- Mit "/etc/rc.isdn [restart|stop]" kann i4b entweder neu gestartet (z.B. zum
- Einlesen der geänderten Konfiguration aus "isdnd.rc") oder beendet werden.
-
-15) Für den Anrufbeantworter muß nur der "isdnd" gestartet sein. Ein
- ankommender Anruf wird dann automatisch angenommen (je nach den Einträgen
- in "/etc/isdn/isdnd.rc").
-
-16) Informationen über die Verbindung erhält man sowohl in "/var/log/messages",
- also auch in "/var/log/isdnd.log" (so der isdnd mit der Option "-l"
- gestartet wird) bzw. auf dem aktuellen tty (wenn der isdnd mit der Option
- "-f" gestartet wird).
diff --git a/share/examples/isdn/contrib/answer.c b/share/examples/isdn/contrib/answer.c
deleted file mode 100644
index aac431f..0000000
--- a/share/examples/isdn/contrib/answer.c
+++ /dev/null
@@ -1,178 +0,0 @@
-// $FreeBSD$
-// changed ".g711a" to ".al" (-hm)
-// Tue Mar 3 02:42:14 MET 1998 dave@turbocat.de
-// started
-
-#define BLK_SIZE 2048
-#define SOX "/usr/local/bin/sox"
-#define ALAWULAW "/usr/local/bin/alaw2ulaw"
-
-#include <stdio.h>
-#include <time.h>
-
- FILE *device;
- FILE *logfile;
- char srcNum[30];
- char destNum[30];
- char argbuf[255];
- char tmpBuf[1024] = "";
-
-
-void writeToPhone (char *path)
-{
- char buf[BLK_SIZE];
- FILE *srcfile;
- int i = 0;
- int readcount = 0;
-
- srcfile = fopen(path,"r");
- if (srcfile) {
- for (i=0;i<BLK_SIZE;i++) {
- buf[i] = '\0';
- }
- readcount = BLK_SIZE;
- i = 0;
- do {
- readcount = fread(buf,1, BLK_SIZE, srcfile);
- fwrite(buf, 1, readcount, device);
- i = readcount + i;
-// fprintf(logfile,"%d read (%d)\n",i,readcount);
- } while (readcount == BLK_SIZE);
-
- fclose(srcfile);
- } else {
- fprintf(logfile,"Can't open file '%s'\n",path);
- }
-}
-
-void readFromPhone (char *path)
-{
- char buf[BLK_SIZE];
- FILE *destfile;
- int i = 0;
- int readcount = 0;
-
- destfile = fopen(path,"a");
- if (destfile) {
- for (i=0;i<BLK_SIZE;i++) {
- buf[i] = '\0';
- }
- readcount = BLK_SIZE;
- i = 0;
- do {
- readcount = fread(buf,1, BLK_SIZE, device);
- fwrite(buf, 1, readcount, destfile);
- i = readcount + i;
-// fprintf(logfile,"%d read (%d)\n",i,readcount);
- } while (readcount == BLK_SIZE);
-
- fclose(destfile);
- } else {
- fprintf(logfile,"Can't open file '%s'\n",path);
- }
-}
-
-void usage (void)
-{
- fprintf(stderr,"usage: answer -D device -d destination -s source\n");
- exit(1);
-}
-
-const char * argWithName (const char* aName)
-{
- // '-D /dev/null -d 82834 -s 3305682834'
- int i = 0;
- int optionSeen = 0;
- int startpos = 0;
-
- for (i = 0; i < sizeof(tmpBuf);i++) {
- tmpBuf[i] = '\0';
- }
-
- for (i = 0; i<strlen(argbuf);i++) {
- if (optionSeen) {
- for (;(i<strlen(argbuf) && (argbuf[i] != ' '));i++) {
- }
- i++;
- startpos = i;
-
- for (;(i<strlen(argbuf) && (argbuf[i] != ' '));i++) {
- }
- strncpy(tmpBuf,&argbuf[startpos], i-startpos);
-
- return tmpBuf;
- }
- if (0 == strncmp(aName,&argbuf[i], strlen(aName))) {
- optionSeen = 1;
- }
- }
-
- usage();
- return NULL;
-}
-
-int main (int argc, const char *argv[]) {
-
- int i,pos = 0;
- extern char *optarg;
- extern int optind;
- int bflag, ch;
- char timeStr[50];
- char outfileName[1024] = "";
- char cmdStr[2048] = "";
- time_t now;
-
- now=time(NULL);
-
- strftime(timeStr,40,I4B_TIME_FORMAT,localtime(&now));
-
- logfile = fopen("/var/log/answer.log","a");
-
- fprintf(logfile,"%s Started\n",timeStr);
-
- pos=0;
- for (i=1;i<argc;i++) {
- sprintf(&argbuf[strlen(argbuf)],"%s ",argv[i]);
- }
- if (strlen(argbuf) > 2) {
- argbuf[strlen(argbuf)-1] = '\0';
- }
-
-
- device = fopen(argWithName("-D"),"r+");
- strcpy(destNum, argWithName("-d"));
- strcpy(srcNum, argWithName("-s"));
-
- fprintf(logfile,"device '%s'\n", argWithName("-D"));
- fprintf(logfile,"srcNum '%s'\n", srcNum);
- fprintf(logfile,"destNum '%s'\n", destNum);
-
-
- if (device) {
-
- strftime(timeStr,40,I4B_TIME_FORMAT,localtime(&now));
-
- sprintf(outfileName,"/var/isdn/%s_%s_%s", timeStr, srcNum, destNum);
-
- writeToPhone ("/usr/local/lib/isdn/msg.al");
- readFromPhone (outfileName);
-
- sprintf(cmdStr,"/bin/cat %s | %s | %s -t raw -U -b -r 8000 - -t .au %s.snd", outfileName, ALAWULAW, SOX, outfileName);
- fprintf(logfile,"%s\n",cmdStr);
- system(cmdStr);
- unlink(outfileName);
-
- fclose(device);
- } else {
- fprintf(logfile,"Can't open file '%s'\n",argWithName("-D"));
- }
-
- now=time(NULL);
-
- strftime(timeStr,40,I4B_TIME_FORMAT,localtime(&now));
-
- fprintf(logfile,"%s Done\n",timeStr);
- fclose(logfile);
- exit(0); // insure the process exit status is 0
- return 0; // ...and make main fit the ANSI spec.
-}
diff --git a/share/examples/isdn/contrib/answer.sh b/share/examples/isdn/contrib/answer.sh
deleted file mode 100644
index 34073d3..0000000
--- a/share/examples/isdn/contrib/answer.sh
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# answer script for i4b isdnd
-# ---------------------------
-#
-# last edit-date: [Fri May 25 15:21:05 2001]
-#
-# $FreeBSD$
-#
-#---------------------------------------------------------------------------
-VARDIR=/var/isdn
-LIBDIR=/usr/local/lib/isdn
-LOGFILE=/tmp/answer.log
-
-NCALLFILE=$VARDIR/ncall
-DATE=`date +%d%H`
-
-progname=${0##*/}
-set -- $@ # have to split argument string !!!
-
-# ----------------------------------------------------------------------
-
-usage ()
-{
- echo "usage: $progname -D device -d dest -s src"
- exit 1
-}
-
-ncall ()
-{
- nfile=$1
- [ -f $nfile ] && read n < $nfile || n=0
- echo $(($n + 1)) > $nfile
- printf "%.4d" $n
-}
-
-# ----------------------------------------------------------------------
-
-while getopts "D:d:s:" opt
-do
- case $opt
- in
-D) DEVICE=$OPTARG ;;
-d) DEST=$OPTARG ;;
-s) SRC=$OPTARG ;;
- esac
-done
-
-[ -c "$DEVICE" -a -n "$DEST" -a -n "$SRC" ] || usage;
-
-shift $(($OPTIND - 1))
-
-# ----------------------------------------------------------------------
-
-NCALL=`ncall $NCALLFILE`
-
-echo "$progname: device $DEVICE destination $DEST source $SRC " >>$LOGFILE
-
-{
- echo "Date: "`date`
- echo "From: \"$SRC\""
- echo "To: \"$DEST\""
- echo
-} >> $VARDIR/I.$NCALL.$DATE
-
-# ----------------------------------------------------------------------
-
-tellnumber ()
-{
- number=$1
- digits=`echo $number | sed -e 's/\(.\)/\1 /g'`
-
- files=""
- for digit in $digits
- do
- files="$files $LIBDIR/$digit.al"
- done
- cat $files
-}
-
-# ----------------------------------------------------------------------
-
-do_answer ()
-{
- [ -f $LIBDIR/beep.al ] && cat $LIBDIR/beep.al
- [ -f $LIBDIR/msg.al ] && cat $LIBDIR/msg.al
- [ -f $LIBDIR/beep.al ] && cat $LIBDIR/beep.al
-} > $DEVICE
-
-do_record ()
-{
- cat $DEVICE > $VARDIR/R.$NCALL.$DATE
-}
-
-do_tell ()
-{
- [ -f $LIBDIR/beep.al ] && cat $LIBDIR/beep.al
- [ -f $LIBDIR/msg.al ] && cat $LIBDIR/msg.al
- tellnumber $SRC
- [ -f $LIBDIR/beep.al ] && cat $LIBDIR/beep.al
-} > $DEVICE
-
-# ----------------------------------------------------------------------
-
-case $progname
-in
-answer) do_answer ;;
-record) do_answer; do_record ;;
-tell) do_tell ;;
-esac
diff --git a/share/examples/isdn/contrib/convert.sh b/share/examples/isdn/contrib/convert.sh
deleted file mode 100644
index b4a6e7d..0000000
--- a/share/examples/isdn/contrib/convert.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/sh
-#
-# convert recorded message to WAV format, optionally send it via mail
-#
-# by: Stefan Herrmann <stefan@asterix.webaffairs.net>
-# Date: Fr 22 Mai 1998 14:18:40 CEST
-#
-# $FreeBSD$
-
-CAT=/bin/cat
-RM=/bin/rm
-SOX=/usr/local/bin/sox
-ALAW2ULAW=/usr/local/bin/alaw2ulaw
-MAIL=/usr/bin/mail
-GZIP=/usr/bin/gzip
-ZIP=/usr/local/bin/zip
-UUENCODE=/usr/bin/uuencode
-
-inputfile=""
-outfilename=""
-mailto=""
-iF=0
-oF=0
-mF=0
-
-set -- `getopt i:o:m: $*`
-
-if test $? != 0
-then
- echo 'Usage: r2w -i <input file> -o <outfile name>.wav -m <email address>'
- exit 1
-fi
-
-for i
-do
- case "$i"
- in
- -i)
- inputfile=$2
- iF=1
- shift
- shift
- ;;
- -o)
- outfilename=$2
- oF=1
- shift
- shift
- ;;
- -m)
- mailto=$2
- mF=1
- shift
- shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-if [ $iF -eq 0 -o $oF -eq 0 ]
-then
- echo 'Usage: r2w -i <input file> -o <outfile name>.wav -m <email address>'
- exit 1
-fi
-
-if [ $iF -eq 1 -a $oF -eq 1 ]
-then
- echo
- echo "converting $inputfile to $outfilename.wav ..."
-
- $CAT $inputfile | $ALAW2ULAW | $SOX -t raw -U -b -r 8000 - -t .wav $outfilename.wav
-fi
-
-if [ $iF -eq 1 -a $oF -eq 1 -a $mF -eq 1 ]
-then
- echo "... and sending it via email to $mailto ..."
- $UUENCODE $outfilename.wav message.wav | $MAIL -s"new message $outfilename" $mailto && $RM $outfilename.wav
- # only usefull when sending over the internet
- #$GZIP -c $outfilename.wav | $UUENCODE message.zip | $MAIL -s"Nachricht vom ISDN Anrufbeantworter" $mailto && $RM $outfilename.wav
-fi
-
-echo "done."
-echo
diff --git a/share/examples/isdn/contrib/hplay.c b/share/examples/isdn/contrib/hplay.c
deleted file mode 100644
index 763e5a8..0000000
--- a/share/examples/isdn/contrib/hplay.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/*---------------------------------------------------------------------------*
- *
- * rsynth driver to output to
- * - an open isdn4bsd telephone connection or
- * - an output file or
- * - the /dev/audio device
- * ----------------------------------------------------------------
- *
- * tested with rsynth-2.0
- *
- * written by Hellmuth Michaelis (hm@kts.org)
- *
- * last edit-date: [Fri May 25 15:21:33 2001]
- *
- * $FreeBSD$
- *
- *---------------------------------------------------------------------------*/
-
-#include <config.h>
-#include <useconfig.h>
-#include <stdio.h>
-#include <math.h>
-#include <errno.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <sys/signal.h>
-#include <sys/ioctl.h>
-
-#include <i4b/i4b_tel_ioctl.h>
-
-#include "proto.h"
-#include "getargs.h"
-#include "hplay.h"
-#include "l2u.h"
-
-#define SAMP_RATE 8000
-long samp_rate = SAMP_RATE;
-
-char *prog = "hplay";
-
-static int use_audio = 1;
-static int use_isdn = 0;
-static int unit_no = 0;
-
-static int audio_fd = -1;
-static int isdn_fd = -1;
-static int file_fd = -1;
-
-char *audio_dev = "/dev/dsp";
-char *isdn_dev = "/dev/i4btel";
-static char *ulaw_file = NULL;
-
-int
-audio_init(int argc, char *argv[])
-{
- char dev[64];
- int format = CVT_ALAW2ULAW;
-
- prog = argv[0];
-
- argc = getargs("FreeBSD audio/i4b/file output driver",argc, argv,
- "a", NULL, &use_audio, "use /dev/audio (default)",
- "i", NULL, &use_isdn, "use /dev/i4btel",
- "u", "%d", &unit_no, "/dev/i4btel unit number (def = 0)",
- "f", "", &ulaw_file, "u-law output to file",
- NULL);
-
- if(help_only)
- return argc;
-
- if(ulaw_file)
- {
- if(strcmp(ulaw_file, "-") == 0)
- {
- file_fd = 1; /* stdout */
- }
- else
- {
- file_fd = open(ulaw_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
- if(file_fd < 0)
- fprintf(stderr, "ERROR: cannot open %s, error = %s\n", ulaw_file, strerror(errno));
- }
- }
-
- if(use_isdn)
- {
- sprintf(dev, "%s%d", isdn_dev, unit_no);
-
- if((isdn_fd = open(dev, O_WRONLY)) < 0)
- {
- fprintf(stderr, "ERROR: cannot open %s, error = %s\n", dev, strerror(errno));
- }
-
- if((ioctl(isdn_fd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
- }
- }
-
- if(use_audio)
- {
- audio_fd = open(audio_dev, O_WRONLY | O_NDELAY);
- if(audio_fd < 0)
- {
- fprintf(stderr, "ERROR: cannot open %s, error = %s\n", audio_dev, strerror(errno));
- }
- }
-
- return argc;
-}
-
-void
-audio_term()
-{
- int format = CVT_NONE;
-
- if(isdn_fd >= 0)
- {
- if((ioctl(isdn_fd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
- }
- close(isdn_fd);
- isdn_fd = -1;
- }
-
- if(audio_fd >= 0)
- {
-#if 0
- ioctl(audio_fd, SNDCTL_DSP_SYNC, &dummy);
-#endif
- close(audio_fd);
- audio_fd = -1;
- }
-
- if(file_fd >= 0)
- {
- close(file_fd);
- file_fd = -1;
- }
-}
-
-void
-audio_play(int n, short *data)
-{
- int ret;
- unsigned char *p;
-
- if (n > 0)
- {
- unsigned char *converted = (unsigned char *) malloc(n);
- int i;
-
- if(converted == NULL)
- {
- fprintf(stderr, "Could not allocate memory for conversion\n");
- exit(3);
- }
-
- for (i = 0; i < n; i++)
- {
- converted[i] = short2ulaw(data[i]);
- }
-
- if (isdn_fd >= 0)
- {
- p = converted;
- errno = 0;
-
- while((ret = write(isdn_fd, p, n)) != n)
- {
- if(!errno)
- {
- p += ret;
- if(p > (converted + n))
- break;
- }
- else
- {
- fprintf(stderr, "write /dev/i4btel ERROR: ret (%d) != n (%d), error = %s\n", ret, n, strerror(errno));
- break;
- }
- }
- }
-
- for (i = 0; i < n; i++)
- converted[i] = (data[i] - 32768) / 256;
-
- if(audio_fd >= 0)
- {
- p = converted;
-
- errno = 0;
-
- while((ret = write(audio_fd, p, n)) != n)
- {
- if(!errno)
- {
- p += ret;
- if(p > (converted + n))
- break;
- }
- else
- {
- fprintf(stderr, "write /dev/dsp ERROR: ret (%d) != n (%d), error = %s\n", ret, n, strerror(errno));
- break;
- }
- }
- }
-
- if(file_fd >= 0)
- {
- int ret;
- p = converted;
-
- errno = 0;
-
- while((ret = write(file_fd, p, n)) != n)
- {
- if(!errno)
- {
- p += ret;
- if(p > (converted + n))
- break;
- }
- else
- {
- fprintf(stderr, "write file ERROR: ret (%d) != n (%d), error = %s\n", ret, n, strerror(errno));
- break;
- }
- }
- }
-
- free(converted);
- }
-}
-
-/* EOF */
diff --git a/share/examples/isdn/contrib/i4b-ppp-newbie.txt b/share/examples/isdn/contrib/i4b-ppp-newbie.txt
deleted file mode 100644
index 7d6c4b0..0000000
--- a/share/examples/isdn/contrib/i4b-ppp-newbie.txt
+++ /dev/null
@@ -1,237 +0,0 @@
-$FreeBSD$
-
- PPP mit isdn4bsd
- _________________________________________________________________
-
- Version 1.01
- Datum: 22.02.1999
- Autor: [1]Dominik Brettnacher <domi@saargate.de>
-
- - Anmerkungen und Verbesserungsvorschläge sind willkommen -
-
- 1. vorab
- Dieser Text soll Neulingen helfen, sich mittels isdn4bsd und BSD
- per PPP z.B. bei ihrem Provider einwählen zu können.
- isdn4bsd bringt einiges an Dokumentation und
- Konfigurationsbeispielen mit, jedoch ist es nicht immer leicht,
- die entsprechenden Hinweise gut miteinander zu kombinieren, so daß
- am Schluß das dabei herauskommt, was man haben möchte.
- 2. Wo bekomme ich isdn4bsd?
- hier solle es keine allzu großen Probleme geben: isdn4bsd ist auf
- dem FTP-Server [2]ftp.consol.de erhältlich. Man beachte dabei, daß
- man sich nicht, wie üblich, als anonymous, sondern als isdn4bsd
- einloggen muß. Benutzer von Browsern geben als Adresse
- [3]ftp://isdn4bsd@ftp.consol.de und als Passwort ihre
- eMail-Adresse an.
- Wertvolle Informationen findet man in der Datei README.
- 3. Welche ISDN-Karten werden unterstützt?
- Informationen darüber findet man in der README-Datei.
- 4. Ich benutze einen externen ISDN-Adapter - was nun?
- Externe Adapter benötigen keine direkte Unterstützung, weil sie
- über die serielle Schnittstelle angesteuert werden. Man kann also
- das normale PPP benutzen. man ppp hilft hier sicher weiter.
- 5. isdn4bsd installieren
- Wie man isdn4bsd installiert, steht in der Datei
- FreeBSD/INSTALLATION (für NetBSD und OpenBSD analog). Eine
- Beispielkonfiguration des Kernel sieht so aus:
-[...]
-#
-# 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:
-# --------------
-#
-# AVM A1 or AVM Fritz!Card
-options "AVM_A1"
-device isic0 at isa? port 0x300 net irq 15 flags 4 vector isicintr
-#
-# 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" 1
-pseudo-device sppp 1
-#
-#---------------------------------------------------------------------------
-[...]
- Nachdem ein neuer Kernel kompiliert und das System neugestartet
- wurde, kann es weiter gehen.
- 6. Konfiguration isdnd.rc
- Die für ISDN wichtigste Konfigurationsdatei ist
- /etc/isdn/isdnd.rc. Mit man isdnd.rc erhält man Informationen über
- die Einstellungen, die man dort vornehmen kann. Im Folgenden ein
- Beispiel:
-
-
-#==============================================================================
-# SYSTEM section: isdnd global configuration parameters
-#==============================================================================
-system
-
-# accounting
-# ----------
-
-acctall = on # generate info for everything
-acctfile = /var/log/isdnd.acct # name & location of accounting file
-useacctfile = yes # generate accouting info to file
-
-# monitor
-# -------
-
-monitor-allowed = no # global switch: monitor on/off
-monitor-port = 451 # default monitor TCP port
-
-# Monitor rights are granted due to the most specific host/net spec, i.e. in
-# the example below host 192.168.1.2 will have the rights specified on that
-# line, even so it belongs to net 192.168.1.0/24 as well.
-#
-# A monitor specification may either be:
-#
-# - the name of a local (UNIX-domain) socket; this MUST start with a "/"
-monitor = "/var/run/isdn-monitor"
-monitor-access = fullcmd
-monitor-access = channelstate, logevents
-monitor-access = callin, callout
-
-# ratesfile
-# ---------
-
-ratesfile = /etc/isdn/isdnd.rates # name & location of rates file
-
-# regular expression pattern matching
-# -----------------------------------
-
-#regexpr = "connected.*KTS" # look for matches in log messages
-#regprog = connectKTS # execute program when match is found
-
-# realtime priority section
-# -------------------------
-
-rtprio = 25 # modify isdnd's process priority
-
-###############################################################################
-entry
-name = lf
-usrdevicename = isp
-usrdeviceunit = 0
-isdncontroller = 0
-isdnchannel = -1
-local-phone-incoming = 012345678
-remote-phone-incoming = 876543210
-local-phone-dialout = 012345678
-remote-phone-dialout = 876543210
-remdial-handling = first
-dialin-reaction = accept
-dialout-type = normal
-b1protocol = hdlc
-idletime-incoming = 240
-idletime-outgoing = 30
-earlyhangup = 5
-ratetype = 0
-unitlength = 90
-unitlengthsrc = rate
-dialretries = 3
-dialrandincr = on
-recoverytime = 25
-
-connectprog = is-up
-disconnectprog = is-down
-
- Wichtig sind hier für den Neuling die vier *-phone-* Einträge, die
- jeweils die lokale Rufnummer und die der Gegenstelle für ein- und
- ausgehende Verbindungen angeben.
-
- 7. ISDN-Verbindungen aufbauen
- um ISDN-Verbindungen aufzubauen, bedarf es einiger Befehle, die
- beim Systemstart aufgerufen werden. Man kann sie zum Beispiel am
- Ende von /etc/rc.local unterbringen. Hier gibt es aber durchaus
- noch andere Lösungen:
- [...]
- # start ISDN
- echo -n 'ppp / ISDN...'
- echo -n 'isdnd...'
- /usr/local/bin/isdnd
- echo -n 'ifconfig...'
- ifconfig isp0 link1 0.0.0.0 1.1.1.1 netmask 0xffffff00
- ifconfig isp0 down
- echo -n 'sppp...'
- spppcontrol isp0 myauthproto=pap myauthname="xxx"
- myauthsecret="xxx" hisauthproto=none
- echo -n 'ifconfig...'
- ifconfig isp0 up
- echo -n 'setting routes...'
- route add default -interface isp0
- echo '.'
- Ändern muß man hier eventuell die Zieladresse des Providers (im
- Beispiel 1.1.1.1). Man bekommt diese entweder vom Provider, oder
- aber man muß einen Versuch daransetzen, sie selbst herauszufinden.
- Wie das funktioniert, steht in der Datei FAQ des isdn4bsd-Paketes.
- Auch am Aufruf von spppcontrol (Vorsicht: spppcontrol bis
- hisauthproto=none ist eine Zeile!) muß noch etwas umgestellt
- werden:
- + myauthproto steht für das Authentifizierungsprotokoll.
- Möglich sind pap oder chap.
- + myauthname ist der PPP-Benutzername.
- + myauthsecret ist das PPP-Kennwort.
- Wenn man nun die Befehle in /etc/rc.local ausführt, kann man mit
- einem ping auf eine beliebige Adresse außerhalb des lokalen Netzes
- eine Verbindung öffnen. Sie wird automatisch nach einiger
- Inaktivität (siehe isdnd.rc) wieder geschlossen.
-
- 8. Es funktioniert nicht - was kann ich tun?
- Es gibt einige Möglichkeiten zur Fehlerdiagnose:
- + dmesg gibt Aufschluß darüber, ob die Karte richtig erkannt
- wurde.
- + ifconfig (siehe rc.local) kann mit dem Parameter debug
- aufgerufen werden und gibt dann einiges an Informationen aus.
- + die Nachrichten in /var/log/messages können außerdem
- hilfreich sein
-
- 9. wer kann mir helfen?
- + die erste Adresse für ISDN-Probleme ist die Mailingliste
- [4]freebsd-isdn@freebsd.org - man bestellt sie, indem man
- eine Mail mit dem Text subscribe freebsd-isdn an
- [5]majordomo@freebsd.org schickt.
- + auch die deutschsprachige Mailingliste kann hilfreich sein.
- Mit einer Mail an [6]majordomo@de.freebsd.org, die im Text
- subscribe de-bsd-questions enthält bestellt man sie.
- _________________________________________________________________
-
-References
-
- 1. mailto:domi@saargate.de
- 2. ftp://isdn4bsd@ftp.consol.de/
- 3. ftp://isdn4bsd@ftp.consol.de/
- 4. mailto:freebsd-isdn@freebsd.org
- 5. mailto:majordomo@freebsd.org
- 6. mailto:majordomo@de.freebsd.org
diff --git a/share/examples/isdn/contrib/isdnctl b/share/examples/isdn/contrib/isdnctl
deleted file mode 100644
index 57fab45..0000000
--- a/share/examples/isdn/contrib/isdnctl
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/bin/sh
-
-# isdnctl
-# Control the ISDN line based on usage
-#
-# This script can control the state of your ISDN line. It counts
-# how many scripts/users currently use the ISDN line and uses
-# "ifconfig down" if noone uses it any more.
-# I use this script for cronjobs that fetch mail and news and run cvsup.
-# If I'm still using the line, the script won't close the connection,
-# but if not, it saves a lot of phone costs.
-#
-# ----------------------------------------------------------------------------
-# "THE BEER-WARE LICENSE" (Revision 42, (c) Poul-Henning Kamp):
-# Alexander Langer <alex@big.endian.de> 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.
-#
-# Alexander Langer
-# ----------------------------------------------------------------------------
-#
-# $FreeBSD$
-#
-
-
-usage () {
- echo "usage: $0 [-i interface] [-f /path/to/users.file] [up|down|show]"
-}
-
-# Defaults
-INTERFACE=isp0
-USERSFILE=
-
-# Getopt stuff
-args=`getopt i:f: $*`
-if [ $? != 0 ]; then
- usage
- exit 2
- fi
-set -- $args
-for i; do
- case "$i" in
- -i)
- INTERFACE="$2"
- shift; shift
- ;;
- -f)
- USERSFILE="$2"
- shift; shift
- ;;
- --)
- shift
- break
- ;;
- esac
-done
-
-if [ -z $USERSFILE ]; then
- USERSFILE=/var/run/isdn.users.$INTERFACE
-fi
-
-if [ -z $1 ]; then
- usage
- exit 2
-fi
-
-# Does Usersfile exist?
-if [ ! -f $USERSFILE ]; then
- # Try to create it
- if ! /sbin/ifconfig $INTERFACE | grep "^$INTERFACE.*<UP," > /dev/null; then
- echo "0" > $USERSFILE || exit 1
- else
- echo "1" > $USERSFILE || exit 1
- fi
-elif [ ! -w $USERSFILE ]; then
- echo "Error: $USERSFILE not writeable!"
- exit 1
-fi
-
-if ! /sbin/ifconfig $INTERFACE | grep "^$INTERFACE.*<UP," > /dev/null; then
- if ! cat $USERSFILE | grep '^0$' > /dev/null ; then
- echo "Interface down, removing number from file";
- echo "0" > $USERSFILE
- fi;
-fi;
-
-case "$1" in
- show)
- echo "`cat $USERSFILE` users online"
- ;;
- up)
- expr `cat $USERSFILE` + 1 > $USERSFILE
- /sbin/ifconfig $INTERFACE up
- echo "`cat $USERSFILE` users online"
- ;;
- down)
- if cat $USERSFILE | grep '^0$' > /dev/null ; then
- echo "Already down"
- exit 0
- fi
- expr `cat $USERSFILE` - 1 > $USERSFILE
- if cat $USERSFILE | grep '^0$' > /dev/null ; then
- echo "`cat $USERSFILE` users online, interface down"
- /sbin/ifconfig $INTERFACE down
- exit 0
- fi
- echo "`cat $USERSFILE` users online"
- ;;
-esac
-
-exit 0
diff --git a/share/examples/isdn/contrib/isdnd_acct b/share/examples/isdn/contrib/isdnd_acct
deleted file mode 100644
index 21223b7..0000000
--- a/share/examples/isdn/contrib/isdnd_acct
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/usr/bin/perl
-#---------------------------------------------------------------------------
-#
-# Copyright (c) 1996, 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.
-#
-#---------------------------------------------------------------------------
-#
-# accounting report script for the isdnd daemon accounting info
-# -------------------------------------------------------------
-#
-# last edit-date: [Fri May 25 15:28:20 2001]
-#
-# $FreeBSD$
-#
-#---------------------------------------------------------------------------
-
-# where the isdnd accounting file resides
-$ACCT_FILE = "/var/log/isdnd.acct";
-
-# the charge for a unit, currently 0,12 DM
-$UNIT_PRICE = 0.12;
-
-# open accounting file
-open(IN, $ACCT_FILE) ||
- die "ERROR, cannot open $ACCT_FILE !\n";
-
-# set first thru flag
-$first = 1;
-
-# process file line by line
-while (<IN>)
-{
- # remove ( and ) from length and bytecounts
- tr/()//d;
-
- # split line into pieces
- ($from_d, $from_h, $dash, $to_d, $to_h, $name, $units, $secs, $byte)
- = split(/ /, $_);
-
- # get starting date
- if($first)
- {
- $from = "$from_d $from_h";
- $first = 0;
- }
-
- # split bytecount
- ($inb, $outb) = split(/\//, $byte);
-
- # process fields
- $a_secs{$name} += $secs;
- $a_calls{$name}++;
- $a_units{$name} += $units;
- $a_charge{$name} += $units * $UNIT_PRICE;
- $a_inbytes{$name} += $inb;
- $a_outbytes{$name} += $outb;
- $a_bytes{$name} = $a_bytes{$name} + $inb + $outb;
-}
-
-# close accouting file
-close(IN);
-
-# write header
-print "\n";
-print " ISDN Accounting Report ($from -> $to_d $to_h)\n";
-print " =====================================================================\n";
-
-#write the sum for each interface/name
-foreach $name (sort(keys %a_secs))
-{
- $o_secs = $a_secs{$name};
- $gt_secs += $o_secs;
- $o_calls = $a_calls{$name};
- $gt_calls += $o_calls;
- $o_units = $a_units{$name};
- $gt_units += $o_units;
- $o_charge = $a_charge{$name};
- $gt_charge += $o_charge;
- $o_inbytes = $a_inbytes{$name};
- $gt_inbytes += $o_inbytes;
- $o_outbytes = $a_outbytes{$name};
- $gt_outbytes += $o_outbytes;
- $o_bytes = $a_bytes{$name};
- $gt_bytes += $o_bytes;
- write;
-}
-
-$o_secs = $gt_secs;
-$o_calls = $gt_calls;
-$o_units = $gt_units;
-$o_charge = $gt_charge;
-$o_inbytes = $gt_inbytes;
-$o_outbytes = $gt_outbytes;
-$o_bytes = $gt_bytes;
-$name = "Total";
-
-print "======= ====== ===== ===== ======== ============ ============ ============\n";
-write;
-
-print "\n\n";
-exit;
-
-# top of page header
-format top =
-
-Name charge units calls secs inbytes outbytes bytes
-------- ------ ----- ----- -------- ------------ ------------ ------------
-.
-
-# record template
-format STDOUT =
-@<<<<<< @##.## @#### @#### @####### @########### @########### @###########
-$name, $o_charge, $o_units, $o_calls, $o_secs, $o_inbytes, $o_outbytes, $o_bytes
-.
-
-# EOF
diff --git a/share/examples/isdn/contrib/isdnd_acct.pl b/share/examples/isdn/contrib/isdnd_acct.pl
deleted file mode 100644
index 0306216..0000000
--- a/share/examples/isdn/contrib/isdnd_acct.pl
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/perl
-#
-#ich habe zwei vielleicht n?tzliche Erweiterungen an isdn_pacct
-#gemacht:
-#
-# 1) Man kann den Namen der Accounting-Datei angeben. Ich
-# habe Accounting-Files nach Telekom-Rechnung aufgeteilt
-# und kann diese so sehr sch?n nachvollziehen.
-#
-# 2) Die Abrechnung wird nach Einheitenl?ngen aufgelistet.
-# Leider wird zur Zeit immer Nahzone verwendet (isdnd.rates
-# wird ausgelesen), und Feiertage stehen als erstes auf
-# der TODO-Liste. Wenn man dieses Feature durch einen
-# Switch anschaltet, kann man es sogar unauff?llig in die
-# Distribution aufnehmen.
-#
-# Mir hilft diese Abrechnung, an mir zu arbeite und mehr
-# Tests und Zug?nge nachts durchzuf?hren... Aber die meisten
-# Einheiten werden immer noch im 90s-Takt verbraucht :-(
-#
-# $FreeBSD$
-#
-#---------------------------------------------------------------------------
-#
-# Copyright (c) 1994, 1996 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. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Hellmuth Michaelis
-# 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 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.
-#
-#---------------------------------------------------------------------------
-#
-# accounting script for the isdn daemon accounting info
-# -----------------------------------------------------
-#
-# last edit-date: [Fri May 25 15:22:26 2001]
-#
-# -hm my first perl program :-)
-# -hm sorting the output
-# -hm adding grand total
-#
-#---------------------------------------------------------------------------
-
-sub wday {
- local ($y, $m, $d) = @_;
- local ($nday, @mon);
-
- @mon = (0, 31, 61, 92, 122, 153, 184, 214, 245, 275, 306, 337);
-# M A M J J A S O N D J F
-
- if ($m > 2) {
- $m -= 3;
- } else {
- $m += 9;
- $y--;
- }
- if ($y < 1600) {
- return -1;
- }
- $y -= 1600;
- $nday = $y * 365 + $mon[$m] + $d +
- int($y / 4) - int($y / 100) + int($y / 400);
- ($nday + 2) % 7;
-}
-
-# where the isdnd accounting file resides
-if ($#ARGV == 0) {
- $ACCT_FILE = $ARGV[0];
-} else {
- $ACCT_FILE = "/var/log/isdnd.acct";
-}
-
-# $PERIOD_FILE = "/usr/local/etc/isdnd.periods";
-# # read periods that need to be separately listed
-# if (open(IN, $PERIOD_FILE)) {
-# while (<IN>) {
-# chop;
-# ($start, $end) = split(/ /);
-# push(@p_start, $start);
-# push(@p_end, $end);
-# }
-# close(IN);
-# }
-
-$RATES_FILE = "/etc/isdn/isdnd.rates";
-if (open(IN, $RATES_FILE)) {
- while(<IN>) {
- chop;
- if (! /^ra0/) {
- next;
- }
- ($ra0, $day, $rest) = split(/[ \t]+/, $_, 3);
- @periods = split(/[ \t]+/, $rest);
- foreach $period (@periods) {
- ($h_start, $m_start, $h_end, $m_end, $secs) =
- $period =~ /(.+)\.(.+)-(.+)\.(.+):(.+)/;
- for ($h = int($h_start); $h < $h_end; $h++) {
- $secs{$day, $h} = $secs;
- }
- }
- }
- close(IN);
-}
-
-# the charge for a unit, currently 0,12 DM
-$UNIT_PRICE = 0.12;
-
-# open accounting file
-open(IN, $ACCT_FILE) ||
- die "ERROR, cannot open $ACCT_FILE !\n";
-
-# set first thru flag
-$first = 1;
-
-# process file line by line
-while (<IN>)
-{
- # remove ( and ) from length and bytecounts
- tr/()//d;
-
- # split line into pieces
- ($from_d, $from_h, $dash, $to_d, $to_h, $name, $units, $secs, $byte)
- = split(/ /, $_);
-
- # get starting date
- if($first)
- {
- $from = "$from_d $from_h";
- $first = 0;
- }
-
- # split bytecount
- ($inb, $outb) = split(/\//, $byte);
-
- # if user wants to account time periods, put this to the right
- # slot(s)
- ($hour, $minute, $second) = split(/:/, $from_h);
- ($day, $mon, $year) = split(/\./, $from_d);
- $day = &wday('19' . $year, $mon, $day);
- if ($secs{$day, int($hour)}) {
- $secs = $secs{$day, int($hour)};
- # process fields
- $p_secs{$name, $secs} += $secs;
- $p_calls{$name, $secs}++;
- $p_units{$name, $secs} += $units;
- $p_charge{$name, $secs} += $units * $UNIT_PRICE;
- $p_inbytes{$name, $secs} += $inb;
- $p_outbytes{$name, $secs} += $outb;
- $p_bytes{$name, $secs} = $p_bytes{$name, $secs} + $inb + $outb;
- }
-
- # process fields
- $a_secs{$name} += $secs;
- $a_calls{$name}++;
- $a_units{$name} += $units;
- $a_charge{$name} += $units * $UNIT_PRICE;
- $a_inbytes{$name} += $inb;
- $a_outbytes{$name} += $outb;
- $a_bytes{$name} = $a_bytes{$name} + $inb + $outb;
-}
-
-# close accouting file
-close(IN);
-
-# write header
-print "\n";
-print " ISDN Accounting Report ($from -> $to_d $to_h)\n";
-print " =================================================================\n";
-
-#write the sum for each interface/name
-foreach $n (sort(keys %a_secs))
-{
- $o_secs = $a_secs{$n};
- $gt_secs += $o_secs;
- $o_calls = $a_calls{$n};
- $gt_calls += $o_calls;
- $o_units = $a_units{$n};
- $gt_units += $o_units;
- $o_charge = $a_charge{$n};
- $gt_charge += $o_charge;
- $o_inbytes = $a_inbytes{$n};
- $gt_inbytes += $o_inbytes;
- $o_outbytes = $a_outbytes{$n};
- $gt_outbytes += $o_outbytes;
- $o_bytes = $a_bytes{$n};
- $gt_bytes = $o_bytes;
- $name = $n;
- write;
-
- foreach $i (keys %p_secs) {
- ($nam, $secs) = split(/$;/, $i);
- if ($nam ne $n) {
- next;
- }
- $o_secs = $p_secs{$i};
- $o_calls = $p_calls{$i};
- $o_units = $p_units{$i};
- $o_charge = $p_charge{$i};
- $o_inbytes = $p_inbytes{$i};
- $o_outbytes = $p_outbytes{$i};
- $o_bytes = $p_bytes{$i};
- $name = sprintf(' %5.1fs', $secs / 10);
- write;
- }
-}
-
-$o_secs = $gt_secs;
-$o_calls = $gt_calls;
-$o_units = $gt_units;
-$o_charge = $gt_charge;
-$o_inbytes = $gt_inbytes;
-$o_outbytes = $gt_outbytes;
-$o_bytes = $gt_bytes;
-$name = "Total";
-
-print "======= ====== ===== ===== ======== ============ ============ ============\n";
-write;
-
-print "\n\n";
-exit;
-
-# top of page header
-format top =
-
-Name charge units calls secs inbytes outbytes bytes
-------- ------ ----- ----- -------- ------------ ------------ ------------
-.
-
-# record template
-format STDOUT =
-@<<<<<< @##.## @#### @#### @####### @########### @########### @###########
-$name, $o_charge, $o_units, $o_calls, $o_secs, $o_inbytes, $o_outbytes, $o_bytes
-.
-
-# EOF
diff --git a/share/examples/isdn/contrib/isdntelmux.c b/share/examples/isdn/contrib/isdntelmux.c
deleted file mode 100644
index 1d517a7..0000000
--- a/share/examples/isdn/contrib/isdntelmux.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 1999 Michael Reifenberger (Michael@Reifenberger.com).
- * 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4btemux - record while playing
- * ===============================
- *
- * $FreeBSD$
- *
- *----------------------------------------------------------------------------*/
-
-#include<stdio.h>
-#include<stdarg.h>
-#include<signal.h>
-#include<errno.h>
-#include<string.h>
-#include<stdlib.h>
-#include<unistd.h>
-#include<fcntl.h>
-#include<ctype.h>
-#include<sys/stat.h>
-#include<sys/wait.h>
-#include<sys/ioctl.h>
-#include<sys/types.h>
-#include<sys/time.h>
-#include<sys/param.h>
-#include<i4b/i4b_tel_ioctl.h>
-
-// DECL DEFS
-#define BUFLEN 2048
-#define MAXBLOCKS_DEFAULT 23
-
-// DECL VARS
-int ibytes = 0;
-int obytes = 0;
-int maxbytes = (BUFLEN * MAXBLOCKS_DEFAULT);
-
-int xfd = -1, xact = 0;
-int ifd = -1, iact = 0;
-int ofd = -1;
-FILE *dfp = NULL;
-int opt_dbg = 0;
-int maxfd = 0;
-fd_set set;
-struct timeval timeout;
-char nambuf[PATH_MAX];
-int ch;
-
-// DECL FUNC
-void ifd_hdlr( void);
-void xfd_hdlr( void);
-void usage( void);
-void dbg( char *fmt, ... );
-
-// DEF FUNC
-int main (int argc, char **argv) {
- int dummy;
- int x = -1;
-
- dfp = stderr;
- while( ( ch = getopt( argc, argv, "x:i:o:b:D:")) != -1 ){
- switch(ch){
- case 'b':
- x = atoi(optarg);
- maxbytes = x * BUFLEN;
- break;
- case 'i':
- ifd = open( optarg, O_RDONLY );
- iact = 1;
- break;
- case 'o':
- ofd = open( optarg, O_WRONLY|O_TRUNC|O_CREAT );
- break;
- case 'x':
- xfd = open( optarg, O_RDWR );
- xact = 1;
- break;
- case 'D':
- opt_dbg = 1;
- if( (dfp = fopen( optarg, "w" )) < 0) {
- dfp = stderr;
- dbg("Err for opening %s\n", optarg);
- exit(1);
- }
- break;
- case '?':
- default:
- usage();
- break;
- }
- }
- if( ( xfd < 0 ) || ( ifd < 0 ) || ( ofd < 0 ) ) {
- dbg("Err opening one ore more Files.\n");
- dbg("xfd: %d, ifd: %d, ofd: %d\n", xfd, ifd, ofd );
- usage();
- }
-
- if((x = ioctl(xfd, I4B_TEL_EMPTYINPUTQUEUE, &dummy)) < 0){
- dbg("Err I4B_TEL_EMPTYINPUTQUEUE\n");
- }
-
- while( (iact == 1) || ( (obytes < maxbytes) && (xact == 1) ) ){
- FD_ZERO( &set);
- if( iact == 1){
- FD_SET( ifd, &set);
- if( ifd > maxfd)
- maxfd = ifd;
- dbg("FSET ifd\n");
- }
- if( xact == 1){
- FD_SET( xfd, &set);
- if( xfd > maxfd)
- maxfd = xfd;
- dbg("FSET xfd\n");
- }
- x=select( maxfd+1, &set, NULL, NULL, NULL);
- if( x > 0){
- if( (iact == 1) && FD_ISSET( ifd, &set) ){
- ifd_hdlr();
- }
- if( (xact == 1) && FD_ISSET( xfd, &set) ){
- xfd_hdlr();
- }
- }
- }
- dbg("exit0\n");
- return(0);
-}
-
-void ifd_hdlr( void) {
- int x;
- unsigned char buf[BUFLEN];
-
- x = read( ifd, buf, BUFLEN);
- dbg("ifd read %d bytes\n", x);
- if( x > 0 ){
- write( xfd, buf, x);
- ibytes += x;
- dbg("xfd %d bytes written to %d\n", x, ibytes);
- } else {
- iact = 0;
- }
-}
-
-void xfd_hdlr( void) {
- int x;
- unsigned char buf[BUFLEN];
-
- x = read( xfd, buf, BUFLEN);
- dbg("xfd read %d bytes\n", x);
- if( x > 0){
- write( ofd, buf, x);
- obytes += x;
- dbg("ofd %d bytes written to %d\n", x, obytes);
- } else {
- xact = 0;
- }
-}
-
-void usage( void) {
- fprintf(dfp, "isdntelmux V.1\n");
- fprintf(dfp, "usage: isdntelmux -x device -i ifile -o ofile [-b blocks]\n");
- exit(1);
-}
-
-void dbg( char *fmt, ... ) {
- va_list ap;
-
- if( opt_dbg == 0 )
- return;
- va_start( ap, fmt );
- vfprintf( dfp, fmt, ap);
- va_end(ap);
-}
diff --git a/share/examples/isdn/contrib/mrtg-isp0.sh b/share/examples/isdn/contrib/mrtg-isp0.sh
deleted file mode 100644
index bdc9671..0000000
--- a/share/examples/isdn/contrib/mrtg-isp0.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-#---------------------------------------------------------------------------
-#
-# collect callout and callback statistics for the isp0 i/f
-#
-# enable budget callout and callback restrictions and file
-# rotation in the isdnd.rc file.
-#
-# last edit-date: [Fri May 25 15:22:45 2001]
-#
-# $FreeBSD$
-#
-#---------------------------------------------------------------------------
-#
-#---------------------------------------------------------------------------
-# this is the entry for mrtg in mrtg.cfg
-#---------------------------------------------------------------------------
-# Target[ernie.cstat.isp0]: `/usr/local/etc/mrtg/util/mrtg-isp0.sh`
-# MaxBytes[ernie.cstat.isp0]: 10
-# AbsMax[ernie.cstat.isp0]: 200
-# Title[ernie.cstat.isp0]: isp0: callouts / callbacks
-# PageTop[ernie.cstat.isp0]: <H1> isp0: callouts /callbacks </H1>
-# Options[ernie.cstat.isp0]: gauge, nopercent, integer
-# YLegend[ernie.cstat.isp0]: co / cb
-# ShortLegend[ernie.cstat.isp0]: n
-# Legend1[ernie.cstat.isp0]: callouts
-# Legend2[ernie.cstat.isp0]: callbacks
-# LegendI[ernie.cstat.isp0]: callouts:
-# LegendO[ernie.cstat.isp0]: callbacks:
-# WithPeak[ernie.cstat.isp0]: ymwd
-#
-#---------------------------------------------------------------------------
-# this is the shell script run by mrtg
-#---------------------------------------------------------------------------
-if [ -r /var/log/isdn/callouts.isp0 ]
-then
- cat /var/log/isdn/callouts.isp0 | awk '{print $3}'
-else
- echo 0
-fi
-
-if [ -r /var/log/isdn/callbacks.isp0 ]
-then
- cat /var/log/isdn/callbacks.isp0 | awk '{print $3}'
-else
- echo 0
-fi
-
-uptime | cut -c 12-18
-uname -nsr
-
-exit 0
-
diff --git a/share/examples/isdn/i4brunppp/Makefile b/share/examples/isdn/i4brunppp/Makefile
deleted file mode 100644
index e1eecea..0000000
--- a/share/examples/isdn/i4brunppp/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# $FreeBSD$
-
-PROG = i4brunppp
-SRCS = i4brunppp.c
-MAN = i4brunppp.8
-
-RUNPPPDEST= /etc/isdn
-
-INSTALL ?= install
-
-install:
- @echo i4brunppp is not installed automatically. In case you want to run
- @echo user-ppp in dial-in server under i4b, please copy it into /etc/isdn.
-
-installetc: i4brunppp
- ${INSTALL} -m ${BINMODE} -o ${BINOWN} -g ${BINGRP} \
- ${.CURDIR}/i4brunppp ${RUNPPPDEST}
-
-.include <bsd.prog.mk>
diff --git a/share/examples/isdn/i4brunppp/README b/share/examples/isdn/i4brunppp/README
deleted file mode 100644
index 81ebe75..0000000
--- a/share/examples/isdn/i4brunppp/README
+++ /dev/null
@@ -1,18 +0,0 @@
-$FreeBSD$
-
-BEWARE: HIGHLY EXPERIMENTAL!
----------------------------
-
-This program is used in conjunction with an isdnd.rc entry similar to
-
- regexpr = "ULPPP.*call active" # look for matches in log messages
- regprog = i4brunppp # execute program when match is found
-
-this one (see also i4brunppp-isdnd.rc).
-
-i4brunppp _must_ be put into /etc/isdn!
-
-When an active call is detected, isdnd fires off i4brunppp, which attaches
-the rbch device used to stdin/stdout and then runs ppp which is given the
-"-direct" command and the string "inc_rbchX" (where X is the i4brbch unit
-number) as arguments.
diff --git a/share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc b/share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc
deleted file mode 100644
index 9620220..0000000
--- a/share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc
+++ /dev/null
@@ -1,65 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# sample isdnd.rc for taking incoming calls with userland ppp
-# -----------------------------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Sat Jul 21 13:40:50 2001]
-#
-#------------------------------------------------------------------------------
-#==============================================================================
-# SYSTEM section: global configuration parameters
-#==============================================================================
-system
-
-ratesfile = /etc/isdn/isdnd.rates # name & location of rates file
-
-useacctfile = yes # generate accouting info to file
-acctall = on # generate info for everything
-acctfile = /var/log/isdnd.acct # name & location of accounting file
-
-rtprio = 25 # modify isdnd's priority
-
-regexpr = "ULPPP.*call active" # look for matches in log messages
-regprog = i4brunppp # execute program when match is found
-
-#==============================================================================
-# ENTRY: Userland PPP over ISDN
-#==============================================================================
-entry
-
-name = ULPPP # name for reference
-
-usrdevicename = rbch # ipr, tel, rbch
-usrdeviceunit = 0 # unit number
-
-isdncontroller = 0 # contoller to use or -1 to use any
-isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
-
- # numbers used to verify at DIAL IN
-local-phone-incoming = 567 # this is my number
-remote-phone-incoming = 123 # this one can call in
-
- # numbers used to DIAL OUT
-local-phone-dialout = 567 # this is my number
-remote-phone-dialout = 123 # i call this number
-
-remdial-handling = first # first, last or next
-
-dialin-reaction = accept # accept, reject, ignore, answer
-
-dialout-type = normal # normal / calledback
-
-b1protocol = hdlc # hdlc, raw
-
-idletime-incoming = 30 # 3 seconds idle timeout
-idletime-outgoing = 30 # 3 seconds idle timeout
-
-ratetype = 0 # ratesfile entry to use
-unitlength = 60 # unitlength to assume
-
-dialretries = 2 # # of dial retries
-recoverytime = 5 # time to wait between 2 dial tries
-
-# EOF #########################################################################
diff --git a/share/examples/isdn/i4brunppp/i4brunppp.8 b/share/examples/isdn/i4brunppp/i4brunppp.8
deleted file mode 100644
index bc47990..0000000
--- a/share/examples/isdn/i4brunppp/i4brunppp.8
+++ /dev/null
@@ -1,51 +0,0 @@
-.\"
-.\" Copyright (c) 1999, 2001 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sat Jul 21 13:37:00 2001]
-.\"
-.Dd July 28, 1999
-.Dt I4BRUNPPP 8
-.Os
-.Sh NAME
-.Nm i4brunppp
-.Nd interface i4b to userland ppp in server mode
-.Sh DESCRIPTION
-The
-.Nm
-utility
-is part of the isdn4bsd package and is used to interface i4b to the so-called
-userland
-.Xr ppp 8
-when dialling into an i4b machine.
-.Sh FILES
-.Bl -tag -width ".Pa /dev/i4brbchX"
-.It Pa /dev/i4brbchX
-.El
-.Sh AUTHORS
-The
-.Nm
-utility and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/share/examples/isdn/i4brunppp/i4brunppp.c b/share/examples/isdn/i4brunppp/i4brunppp.c
deleted file mode 100644
index 3c8b6e7..0000000
--- a/share/examples/isdn/i4brunppp/i4brunppp.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (c) 1999, 2001 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4brunppp - run userland ppp for incoming call from rbch i/f
- * ------------------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Jul 21 13:38:10 2001]
- *
- *---------------------------------------------------------------------------
- *
- * BEWARE: HIGHLY EXPERIMENTAL!
- * ---------------------------
- *
- * This program is used in conjunction with an isdnd.rc entry similar to
- *
- * regexpr = "ULPPP.*call active" # look for matches in log messages
- * regprog = i4brunppp # execute program when match is found
- *
- * this one. It _must_ be put into /etc/isdn!
- * When an active call is detected, isdnd fires off i4brunppp, which attaches
- * the rbch device used to stdin/stdout and then runs ppp which is given the
- * "-direct" command and the string "inc_rbchX" (where X is the i4brbch unit
- * number) as arguments.
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <syslog.h>
-#include <errno.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_rbch_ioctl.h>
-
-#define I4BDEVICE "/dev/i4b"
-
-#define PPPPROG "/usr/sbin/ppp"
-#define PPPNAME "ppp"
-#define PPPARG1 "-direct"
-#define PPPLABEL "inc_"
-
-#define VERIFYSTRING "call active"
-#define DEVSTRING "rbch"
-
-#define PPPDEBUG
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- char buffer[256];
- int rbch_fd;
- char *p = "DeadPointer";
- int found;
- int i;
-
-#ifdef PPPDEBUG
- FILE *dfp;
- time_t tim;
- register struct tm *tp;
-#endif
-
- /* open syslog */
-
- (void)openlog("i4brunppp", LOG_PID|LOG_CONS|LOG_NDELAY, LOG_USER);
-
-#ifdef PPPDEBUG
-
- /* open debug log */
-
- if((dfp = fopen("/tmp/i4brunppp-debug.log", "a")) == NULL)
- {
- syslog(LOG_INFO, "cannot open logfile: %s", strerror(errno));
- exit(1);
- }
-
- tim = time(NULL);
- tp = localtime(&tim);
- strftime(buffer, 40, I4B_TIME_FORMAT, tp);
- fprintf(dfp, "\n=================== %s ===================\n", buffer);
-
- for(i=0; i < argc; i++)
- fprintf(dfp, "\t%s\n", argv[i]);
-#endif
-
- /* check if this is the right message */
-
- found = 0;
-
- for(i=0; i < argc; i++)
- {
- if((strstr(argv[i], VERIFYSTRING)) != NULL)
- {
- found = 1;
- break;
- }
- }
-
- if(found == 0)
- {
-#ifdef PPPDEBUG
- fprintf(dfp, "did not found [%s], exit\n", VERIFYSTRING);
-#endif
- exit(0);
- }
-
- found = 0;
-
- /* check if we got a good device name */
-
- for(; i < argc; i++)
- {
- if((p = strstr(argv[i], DEVSTRING)) != NULL)
- {
- found = 1;
- break;
- }
- }
-
- if(found == 0)
- {
-#ifdef PPPDEBUG
- fprintf(dfp, "did not found [%s], exit\n", DEVSTRING);
-#endif
- exit(0);
- }
-
- /* everything ok, now prepare for running ppp */
-
- /* close all file descriptors */
-
- i = getdtablesize();
-
- for(;i >= 0; i--)
- if (i != 2)
- close(i);
-
- /* fiddle a terminating zero after the rbch unit number */
-
- p += strlen(DEVSTRING);
-
- if(isdigit(*p) && isdigit(*(p+1)))
- *(p+2) = '\0';
- else
- *(p+1) = '\0';
-
- /* construct /dev/i4brbchX device name */
-
- sprintf(buffer, "%s%s%s", I4BDEVICE, DEVSTRING, p);
-
- /* open the rbch device as fd 0 = stdin */
-
- rbch_fd = open(buffer, O_RDWR);
-
- if(rbch_fd != 0)
- {
- if(rbch_fd < 0)
- syslog(LOG_INFO, "cannot open %s: %s", buffer, strerror(errno));
- else
- syslog(LOG_INFO, "cannot open %s as fd 0 (is %d): %s", buffer, rbch_fd, strerror(errno));
- exit(1);
- }
-
- /* dup rbch device fd as fd 1 = stdout */
-
- if((i = dup(rbch_fd)) != 1)
- {
- if(i < 0)
- syslog(LOG_INFO, "cannot dup rbch_fd: %s", strerror(errno));
- else
- syslog(LOG_INFO, "cannot dup rbch as fd 1 (is %d): %s", i, strerror(errno));
- exit(1);
- }
-
- /* construct the label for ppp's ppp.conf file */
-
- sprintf(buffer, "%s%s%s", PPPLABEL, DEVSTRING, p);
-
- syslog(LOG_INFO, "executing: %s %s %s %s", PPPPROG, PPPNAME, PPPARG1, buffer);
-
- /* execute ppp */
-
- if((execl(PPPPROG, PPPNAME, PPPARG1, buffer, NULL)) == -1)
- {
- syslog(LOG_INFO, "cannot exec: %s", strerror(errno));
- exit(1);
- }
- syslog(LOG_INFO, "finished: %s %s %s %s", PPPPROG, PPPNAME, PPPARG1, buffer);
- return(0);
-}
-
-/* EOF */
diff --git a/share/examples/isdn/v21/Makefile b/share/examples/isdn/v21/Makefile
deleted file mode 100644
index 261cec1..0000000
--- a/share/examples/isdn/v21/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# $FreeBSD$
-
-PROG= v21modem
-NO_MAN=
-DPADD= ${LIBUTIL} ${LIBM}
-LDADD= -lutil -lm
-CFLAGS+= -g -Wall
-
-.if !defined(BSDTYPE)
-BSDTYPE!=uname
-.endif
-
-.include <bsd.prog.mk>
diff --git a/share/examples/isdn/v21/README b/share/examples/isdn/v21/README
deleted file mode 100644
index 52f553c..0000000
--- a/share/examples/isdn/v21/README
+++ /dev/null
@@ -1,50 +0,0 @@
-
- V.21 Modem for ISDN4BSD.
-
-INTRODUCTION:
-
-The modem is implemented in software and is rather simple minded.
-
-It works with my Telebit TB2500 and Zyxel 2864I modems.
-
-There are plenty of knobs and handles which can be adjusted and I have
-no real idea what to set them to for best all-round performance.
-
-The carrier detect timer may be a bit short tempered, and this is
-probably why the dialing modem needs to be told to talk V.21 up
-front. If this code were mode tolerant of loss of carrier auto
-negotiation might work.
-
-When you get carrier ("CONNECT 300"), you must press a key before the
-login banner gets printed. See the comments in "input_byte" why this
-is.
-
-THE KERNEL PART:
-
-Implementes a crude "send these tones" facility, but it is enough to
-take most of the real-time worries out of doing FSK modulation in
-software. If suitably extended, the code could also be used to
-send DTMF tones and other similar signals.
-
-INSTALLATION:
-
-The program is started from /etc/isdn/isdnd.rc:
-
-entry
- name = I4BTEL
- usrdevicename = tel
- usrdeviceunit = 0
- isdncontroller = 0
- isdnchannel = -1
- local-phone-incoming = 2934812934
- remote-phone-incoming = *
- dialin-reaction = answer
- answerprog = v21modem
- b1protocol = raw
- idletime-incoming = 5
-
-
-Poul-Henning (phk@freebsd.org)
-19991212
-
-$FreeBSD$
diff --git a/share/examples/isdn/v21/v21modem.c b/share/examples/isdn/v21/v21modem.c
deleted file mode 100644
index 2707cdb..0000000
--- a/share/examples/isdn/v21/v21modem.c
+++ /dev/null
@@ -1,394 +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
- * ----------------------------------------------------------------------------
- *
- * This is a V.21 modem for ISDN4BSD.
- *
- * $FreeBSD$
- */
-
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <err.h>
-#include <sys/ioccom.h>
-#include <errno.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <termios.h>
-#include <libutil.h>
-
-#include <i4b/i4b_tel_ioctl.h>
-
-static void create_session(void);
-static void input_byte(int byte, int stopbit);
-static void sample(int vol, int* tones);
-static void tonedetect(unsigned char *ptr, int count);
-static void uart(int bit);
-
-static int dcd; /* Carrier on ? */
-static int ptyfd = -1; /* PTY filedescriptor */
-static int telfd = -1; /* I4BTEL filedescriptor */
-
-/*
- * Alaw to Linear [-32767..32767] conversion
- */
-
-static int a2l[256] = { -5504, -5248, -6016, -5760, -4480, -4224,
--4992, -4736, -7552, -7296, -8064, -7808, -6528, -6272, -7040,
--6784, -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368,
--3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392, -22016,
--20992, -24064, -23040, -17920, -16896, -19968, -18944, -30208,
--29184, -32256, -31232, -26112, -25088, -28160, -27136, -11008,
--10496, -12032, -11520, -8960, -8448, -9984, -9472, -15104, -14592,
--16128, -15616, -13056, -12544, -14080, -13568, -344, -328, -376,
--360, -280, -264, -312, -296, -472, -456, -504, -488, -408, -392,
--440, -424, -88, -72, -120, -104, -24, -8, -56, -40, -216, -200,
--248, -232, -152, -136, -184, -168, -1376, -1312, -1504, -1440,
--1120, -1056, -1248, -1184, -1888, -1824, -2016, -1952, -1632,
--1568, -1760, -1696, -688, -656, -752, -720, -560, -528, -624,
--592, -944, -912, -1008, -976, -816, -784, -880, -848, 5504, 5248,
-6016, 5760, 4480, 4224, 4992, 4736, 7552, 7296, 8064, 7808, 6528,
-6272, 7040, 6784, 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368,
-3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, 22016, 20992, 24064,
-23040, 17920, 16896, 19968, 18944, 30208, 29184, 32256, 31232,
-26112, 25088, 28160, 27136, 11008, 10496, 12032, 11520, 8960, 8448,
-9984, 9472, 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568,
-344, 328, 376, 360, 280, 264, 312, 296, 472, 456, 504, 488, 408,
-392, 440, 424, 88, 72, 120, 104, 24, 8, 56, 40, 216, 200, 248, 232,
-152, 136, 184, 168, 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184,
-1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, 688, 656, 752, 720,
-560, 528, 624, 592, 944, 912, 1008, 976, 816, 784, 880, 848 };
-
-/*
- * A High Q Tone detector
- */
-
-#define NTONES 2 /* Number of tones to detect */
-#define SCALE 4096 /* Scaling factor */
-#define EXPAVG 14 /* Exponential Average factor */
-#define POLERAD 3885 /* pole_radius ^ 2 * SCALE */
-
-/* Table of "-cos(2 * PI * frequency / sample_rate) * SCALE" */
-static int p[NTONES] = {
- -2941, /* 980 Hz */
- -2460 /* 1180 Hz */
-};
-
-static void
-tonedetect(unsigned char *ptr, int count)
-{
- int i, j;
- int y;
- int c, d, f, n;
- static int k[NTONES], h[NTONES];
- static int tones[NTONES];
- static int amplitude;
-
-
- for (i = 0; i < count; i++) {
- y = a2l[*ptr++];
- if (y > 0)
- amplitude += (y - amplitude) / EXPAVG;
- else
- amplitude += (-y - amplitude) / EXPAVG;
-
- for(j = 0; j < NTONES; j++) {
- c = (POLERAD * (y - k[j])) / SCALE;
- d = y + c;
- f = (p[j] * (d - h[j])) / SCALE;
- n = y - k[j] - c;
- if (n < 0)
- n = -n;
- k[j] = h[j] + f;
- h[j] = f + d;
- tones[j] += (n - tones[j]) / EXPAVG;
- }
- sample(amplitude, tones);
- }
-}
-
-/*
- * Taste each sample, detect (loss off) carrier, and feed uart
- */
-
-#define NCARRIER 1000 /* Samples of carrier for detection */
-
-static void
-sample(int vol, int* tones)
-{
- static int carrier;
-
- if ((tones[0] + tones[1]) > vol * 3/2) { /* XXX */
- if (carrier < NCARRIER)
- carrier ++;
- } else {
- if (carrier > 0)
- carrier --;
- }
-
- if (!dcd && carrier > NCARRIER / 2) {
- syslog(LOG_ERR, "CARRIER ON");
- dcd = 1;
- } else if (dcd && carrier < NCARRIER / 2) {
- syslog(LOG_ERR, "CARRIER OFF");
- dcd = 0;
- }
-
- if (!dcd)
- return;
-
- if (tones[0] > tones[1]) {
- uart(1);
- } else {
- uart(0);
- }
-}
-
-/*
- * A UART in software
- */
-
-#define BITCENTER 13 /* Middle of a bit: 8000/300/2 */
-static int bitsample[] = { /* table of sampling points */
- BITCENTER,
- BITCENTER + 27,
- BITCENTER + 54,
- BITCENTER + 80,
- BITCENTER + 107,
- BITCENTER + 134,
- BITCENTER + 160,
- BITCENTER + 187,
- BITCENTER + 214,
- BITCENTER + 240
-};
-
-static void
-uart(int bit)
-{
- static int n, v, j;
-
- if (n == 0 && bit == 1)
- return; /* Waiting for start bit */
- if (n == 0) {
- j = 0; /* Begin start bit */
- v = 0;
- n++;
- } else if (j == 0 && bit && n > bitsample[j]) {
- n = 0; /* Gone by middle of start bit */
- } else if (n > bitsample[j]) {
- j++; /* Sample point */
- if (j == 10) {
- n = 0;
- input_byte(v, bit);
- } else {
- v = v / 2 + 128 * bit;
- n++;
- }
- } else {
- n++;
- }
-}
-
-/*
- * Send a byte using kenrnel tone generation support
- */
-
-static void
-output_byte(int val)
-{
- struct i4b_tel_tones tt;
- int i;
-
- i = 0;
- tt.frequency[i] = 1850; tt.duration[i++] = 27;
-
- tt.frequency[i] = val & 1 ? 1650 : 1850; tt.duration[i++] = 27;
- tt.frequency[i] = val & 2 ? 1650 : 1850; tt.duration[i++] = 26;
- tt.frequency[i] = val & 4 ? 1650 : 1850; tt.duration[i++] = 27;
- tt.frequency[i] = val & 8 ? 1650 : 1850; tt.duration[i++] = 27;
- tt.frequency[i] = val & 16 ? 1650 : 1850; tt.duration[i++] = 26;
- tt.frequency[i] = val & 32 ? 1650 : 1850; tt.duration[i++] = 27;
- tt.frequency[i] = val & 64 ? 1650 : 1850; tt.duration[i++] = 27;
- tt.frequency[i] = val & 128 ? 1650 : 1850; tt.duration[i++] = 26;
-
- tt.frequency[i] = 1650; tt.duration[i++] = 27;
- tt.frequency[i] = 1650; tt.duration[i++] = 0;
-
- i = ioctl(telfd, I4B_TEL_TONES, &tt);
- if (i != 0 && errno != EAGAIN) {
- syslog(LOG_ERR, "%d: *** %d/%d ***", __LINE__, i, errno);
- exit(0);
- }
-}
-
-/*
- * Create Session
- */
-
-static void
-create_session(void)
-{
- int i;
- char buf[100];
-
- i = forkpty(&ptyfd, buf, 0, 0);
- if (i == 0) {
- execl("/usr/libexec/getty", "getty", "std.300", "-",
- (char *)NULL);
- syslog(LOG_ERR, "exec getty %d", errno);
- exit(2);
- } else if (i < 0) {
- syslog(LOG_ERR, "forkpty failed %d", errno);
- exit(2);
- }
- syslog(LOG_ERR, "pty %s", buf);
-}
-
-static void
-input_byte(int byte, int stopbit)
-{
- u_char c;
- int i;
- static int first;
- static u_char buf[80];
-
- if (!stopbit)
- return;
- c = byte;
- /*
- * I have no idea why, but my TB2500 modem sends a sequence of
- * 28 bytes after carrier is established at the link level, but
- * before it is acceptted at the logical level.
- *
- * [16100214010201060100000000ff0201020301080402400010034510]
- *
- * Unfortunately this contains a ^D which kills getty.
- * The following code swallows this sequence, assuming that it
- * is always the same length and always start with 0x16.
- *
- */
- if (first == 0 && c == 0x16) {
- sprintf(buf, "%02x", c);
- first = 27;
- return;
- } else if (first == 0) {
- first = -1;
- dcd = 2;
- return;
- }
- if (first > 0) {
- sprintf(buf + strlen(buf), "%02x", c);
- first--;
- if (!first) {
- syslog(LOG_NOTICE, "Got magic [%s]", buf);
- *buf = 0;
- }
- return;
- }
- if (ptyfd != -1 && dcd) {
- i = write(ptyfd, &c, 1);
- if (i != 1 && errno != EAGAIN) {
- syslog(LOG_ERR, "%d: *** %d/%d ***", __LINE__, i, errno);
- exit(0);
- }
- }
-}
-
-int
-main(int argc, char **argv)
-{
- char *device = "/dev/tel0";
- u_char ibuf[2048];
- int ii, io;
- int i, maxfd;
- struct i4b_tel_tones tt;
- fd_set rfd, wfd, efd;
-
- openlog("v21modem", LOG_PID, LOG_DAEMON);
- /* Find our device name */
- for (i = 0; i < argc; i++)
- if (!strcmp(argv[i], "-D"))
- device = argv[i + 1];
- telfd = open(device, O_RDWR, 0);
- if (telfd < 0) {
- syslog(LOG_ERR, "open %s: %m", device);
- exit (0);
- }
- syslog(LOG_NOTICE, "Running on %s", device);
-
- /* Output V.25 tone and carrier */
- i = 0;
- tt.frequency[i] = 0; tt.duration[i++] = 1000;
- tt.frequency[i] = 2100; tt.duration[i++] = 2*8000;
- tt.frequency[i] = 0; tt.duration[i++] = 400;
- tt.frequency[i] = 1650; tt.duration[i++] = 1;
- tt.frequency[i] = 1650; tt.duration[i++] = 0;
- tt.frequency[i] = 0; tt.duration[i++] = 0;
- i = ioctl(telfd, I4B_TEL_TONES, &tt);
- if (i < 0) {
- syslog(LOG_ERR, "hangup");
- exit(0);
- }
-
- create_session();
-
- /* Wait for carrier */
- do {
- ii = read(telfd, ibuf, sizeof ibuf);
- tonedetect(ibuf, ii);
- } while (ii > 0 && dcd != 2);
- if (ii < 0) {
- syslog(LOG_ERR, "hangup");
- exit(0);
- }
-
- maxfd = ptyfd;
- if (telfd > maxfd)
- maxfd = telfd;
- maxfd += 1;
- do {
- FD_ZERO(&rfd);
- FD_SET(telfd, &rfd);
- FD_SET(ptyfd, &rfd);
- FD_ZERO(&wfd);
- FD_ZERO(&efd);
- FD_SET(telfd, &efd);
- FD_SET(ptyfd, &efd);
- i = select(maxfd, &rfd, &wfd, &efd, NULL);
- if (FD_ISSET(telfd, &rfd)) {
- ii = read(telfd, ibuf, sizeof ibuf);
- if (ii > 0)
- tonedetect(ibuf, ii);
- else
- syslog(LOG_ERR, "hangup");
- }
- if (FD_ISSET(ptyfd, &rfd)) {
- io = read(ptyfd, ibuf, 1);
- if (io == 1)
- output_byte(*ibuf);
- else if (io == 0) {
- syslog(LOG_ERR, "Session EOF");
- exit(0);
- }
-
- }
- if (FD_ISSET(telfd, &efd)) {
- syslog(LOG_ERR, "Exception TELFD");
- exit (0);
- }
- if (FD_ISSET(ptyfd, &efd)) {
- syslog(LOG_ERR, "Exception PTYFD");
- exit (0);
- }
- } while (dcd);
- syslog(LOG_ERR, "Carrier Lost");
- exit(0);
-}
diff --git a/share/examples/ppp/isdnd.rc b/share/examples/ppp/isdnd.rc
deleted file mode 100644
index 0ceef6d..0000000
--- a/share/examples/ppp/isdnd.rc
+++ /dev/null
@@ -1,69 +0,0 @@
-# example of a configuration file for the isdn daemon & user-ppp
-#
-# $FreeBSD$
-
-
-# SYSTEM section: isdnd global configuration parameters
-
-system
-
-# accounting
-
-acctall = on # generate info for everything
-acctfile = /var/log/isdnd.acct # name & location of accounting file
-useacctfile = yes # generate accouting info to file
-isdntime = on
-monitor-allowed = no # global switch: monitor on/off
-
-
-# User-ppp example
-
-entry
-name = userppp0
-usrdevicename = rbch
-usrdeviceunit = 0
-isdncontroller = 0
-isdnchannel = -1
-local-phone-incoming = 1234567
-remote-phone-incoming = *
-local-phone-dialout = 1234567 # This *MUST* be your local number
-remote-phone-dialout = 1234567 # ppp(8) will override this
-remdial-handling = first
-dialin-reaction = ignore
-dialout-type = normal
-b1protocol = hdlc
-idletime-incoming = 900 # Should be larger than ppp's timeout
-idletime-outgoing = 900 # Should be larger than ppp's timeout
-unitlength = 0
-unitlengthsrc = conf
-dialretries = 1
-dialrandincr = on
-recoverytime = 1 # Should be smaller than ppp's redial
-usedown = off
-downtries = 2
-downtime = 30
-
-entry
-name = userppp1
-usrdevicename = rbch
-usrdeviceunit = 1
-isdncontroller = 0
-isdnchannel = -1
-local-phone-incoming = 1234567
-remote-phone-incoming = *
-local-phone-dialout = 1234567 # This *MUST* be your local number
-remote-phone-dialout = 1234567 # ppp(8) will override this
-remdial-handling = first
-dialin-reaction = accept
-dialout-type = normal
-b1protocol = hdlc
-idletime-incoming = 900 # Should be larger than ppp's timeout
-idletime-outgoing = 900 # Should be larger than ppp's timeout
-unitlength = 0
-unitlengthsrc = conf
-dialretries = 1
-dialrandincr = on
-recoverytime = 1 # Should be smaller than ppp's redial
-usedown = off
-downtries = 2
-downtime = 30
diff --git a/share/examples/ppp/ppp.conf.isdn b/share/examples/ppp/ppp.conf.isdn
deleted file mode 100644
index 8946b4b..0000000
--- a/share/examples/ppp/ppp.conf.isdn
+++ /dev/null
@@ -1,98 +0,0 @@
-#
-# Copyright (c) 1997 Brian Somers <brian@Awfulhak.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.
-#
-# $FreeBSD$
-
-# This is an example ppp profile for bringing up a multilink ppp connection
-# over ISDN. It needs at least version 0.83.0 of the i4b code. An example
-# isdnd configuration file is also supplied in this directory (isdnd.rc)
-#
-# NOTE: This is for use with i4b-supported ISDN cards. If you have an
-# external Terminal Adapter (TA) plugged into a serial port on your
-# machine, you should use the TA example in ppp.conf.sample.
-#
-isdn:
- set phone 12345678 # Replace this with your ISPs phone number
-
- set authname "somename" # Replace these with your login name & password.
- set authkey "somepasswd" # This profile assumes you're using PAP or CHAP.
-
- set enddisc mac # Assuming you have a LAN
-
- enable lqr echo
- set reconnect 3 5
- set redial 3 10
- set lqrperiod 45
- disable pred1 deflate mppe
- deny pred1 deflate mppe
-
- set timeout 60 300 # The minimum charge period is 5 minutes, so don't
- # hangup before then
-
- # We have no chat scripts in the ISDN world (yet)
- set dial
- set login
- set logout
- set hangup
-
- set device /dev/i4brbch0 /dev/i4brbch1 # Raw B-channel devices
- set speed sync # ISDN is synchronous
-
- enable dns # Ask the peer what to put in resolv.conf
-
- # Take a wild guess at an IP number and let the other side decide
- set ifaddr 172.16.0.1/0 212.0.0.0/0 0 0
- add! default hisaddr
-
- set mrru 1500 # Multilink mode please
- set mru 1504 # Room for the MP header
-
- clone 1,2 # Two new links
- link deflink rm # And get rid of the original one
-
- link * set mode auto # Automatically manage the second link
- set autoload 10 80 30 # Down @10% usage, up at 80%, 30s sample
-
- set server /var/run/ppp/ppp-isdn "" 0177 # The diagnostic port (-rw-------)
-
-#
-# When phone calls become free (say 0:00 Saturday morning), we may want
-# this in crontab (``crontab -l'', not /etc/crontab):
-#
-# 1 0 0 0 6 /usr/sbin/pppctl /var/run/ppp/ppp-isdn link \* set mode ddial
-#
-# and when we have to pay again (say 23:59 Sunday night), we may want
-# this:
-#
-# 54 23 0 0 0 /usr/sbin/pppctl /var/run/ppp/ppp-isdn link \* set mode auto
-#
-# And of course just in case of a weekend reboot, add
-# /usr/local/etc/rc.d/ppp.sh:
-#
-# #! /bin/sh
-# [ ."$1" != .start ] && exit 0
-# case `date +%w` in
-# 6|0) /usr/sbin/pppctl /var/run/ppp/ppp-isdn link \* set mode ddial;;
-# esac
diff --git a/share/examples/ppp/ppp.conf.sample b/share/examples/ppp/ppp.conf.sample
index f59d18d..7863eaa 100644
--- a/share/examples/ppp/ppp.conf.sample
+++ b/share/examples/ppp/ppp.conf.sample
@@ -672,8 +672,6 @@ callback-server-client-decides:
# It's worth increasing your MTU and MRU slightly in multi-link mode to
# prevent full packets from being fragmented.
#
-# See ppp.conf.isdn for an example of how to do multi-link isdn.
-#
# You can now ``dial'' specific links, or even dial all links at the
# same time. The `dial' command may also be prefixed with a specific
# link that should do the dialing.
diff --git a/share/isdn/0.al.uu b/share/isdn/0.al.uu
deleted file mode 100644
index 84ed15f..0000000
--- a/share/isdn/0.al.uu
+++ /dev/null
@@ -1,323 +0,0 @@
-# $FreeBSD$
-begin 644 0.al
-M5=75U=?7UM?4U=;3U-37U55555545%15U=7555175U965U15U=34U-?7U];6
-MT=?555175%555575U=75U=55U=37U]?7U]37U]34U5555=55555455145516
-M4U)75%77U];0T-#1T=#1UM155%=75U=55555U=37U]?7U5555U=65E=75E?5
-MU];1UM?6UM?4U5545E975U74U]?4U]?4U%555%15U=75U534T=75UU55U-35
-MU=74U555U=37U-?4U%575E965E=75-75U-34U=74U]?7U]34U5545=34U-75
-MU-75U=75U=74U5545U175575U-37UM;0T-5655915U175=34U-34U];7U]?4
-MU-3555575E%15E965%75U];1UM?7U-35U-74557555145%15U=75U575U-34
-MU=75U=34U555U5545%16U-=5U=55U=75U-75U-35U-37U]?6UM?7U]34U=54
-M5U9145965E=75U145575U-?7U-34U-37UM;6U]?4U-35U-?7U-5555175E96
-M5U965E164=35U-'0T-;6UM?7U575U-?6U];6U]545%965U14557555145=75
-MU555U=75U-34U=55U=35U=75U-?4U=555575557555755555U=35U=;0U-?7
-M55545U175U975U=55=74UM'6U-755=75U-;1T=;1UM?4U-75551745%15E15
-MU=37U]37U-5555545%75U-37U];7U]34555555574U-75U=45=76T='0T-'1
-MU]555%155575U=75555555545%145=34U]34U5555%145%15U-37UM;7U-55
-M5%74U]'0T]/0UM?55%1745!04%;7UM74U]36UM?4U5175%145575U-555515
-M5%=45U=75%145%74U-37UM'1T-#0T='1UM?455=645975%1455175%75U=75
-MU=36UM?7UM;6UU%05%=75514U=75U555U=555%145-74U-34U]'1T='1T='6
-MU-555U%04%!15E=4U=34U-34U-?7U]35U-37U]?4U=75U];1UM?455=645%6
-MU=175555U555U=74U5545U975U15U=37UM;7U];6U]3555555U=5U=55U=35
-MU=35U5755535U-?7U-75U-74U=55U=75U=35U-37U];7U]565]155=?4U=35
-MU=75U555U57555175%545U145U=45=75U-37T=#0T=;7U%545%145U15U=37
-MU]37U]155%=75U965U35U=37UM'1T=#7U]+0U=34U=75U5545U9145%65U=4
-M55=65U145=75U=;1T=;1T=#3TM/1U]545U965U=65E145U145%=45=37U]?1
-MT='1UM?4U-34U-555%=675-64%945=?3T]#0T]/1U]35555555555%15U=54
-M5U=75U975U=45%75U-?6UM;6U]555%35U-?6UM;4U-755%=75%155%55U515
-M55145-70T-?0T=?4U]?555175%555%755=74U-37U]?5U55555175U=55=74
-MU-?6U]?4U5175U1455555=74U-75U-34U-5555555=75U-?4U]?6UU=5UU55
-M551555545%555=55U=35U=75U5555-75U=?7U];7U]35U5145U=455175U14
-M5=34U]?4U-74U55555755=75U=37U]355%145%17U]565%14U-35U=75U=35
-MU=77UM;7U=74U]34U=74U]?7U=7555175E965U=4U=?7UM;6UM34U-355=75
-MU-34U-3555=45U9145975-7555=15=;4U]?7U-?7U]?7U]?7U]?4U5545514
-M5%145%965U35U=555=77U];6UM'6U]?4U-?7U-5555=645%65%545%145554
-M5=74T=#2TM/1T=+65%5645%04%965U=55575U]?7U]35U=77U];6UM;6UM;7
-MU51645!045%65U15U=555574UM;1T-#1T='6U];7U-555=555%=65U145516
-M4U955E155%75U-?6T='0T='6U]7555555575U]?4U=545E=75U145%145%15
-MU=36UM34U-34U-37U-34U]35U55555145%145U175U155-33UM74U-31UM?7
-MU-34U-34U-35U-34U5=65E965U15U=55U=74U-34U-34U-555555U=555=75
-MU=77U];6U]155%15U=34U575U-?6UM;3T574U%1555175E=45%965%34U-37
-MU-5555175E975-77T=/2T];4U=575U=5U-?7U=55U=7555545%175E74U-?6
-MUM;7U]34U]575E965U35T=15U%555555U=75U-34U]?6UM?4U-755575U=35
-MU-555%=65U=45%15U=37U]'7U-755%1555545%175U=45=77U]?4U=555=77
-MU]?7UM57U-?5U-75U=77U]?7U-?7U]355=545%555%965U145%74U-;7UM;7
-MU-34U-34UM;7U5165E%145975%155=75555555545%15U=36T=#6T-W1U];7
-MU-555%=45%1555=75%555%175U14U-?1T]+2T-'7U-?45%914%975%545555
-MU=75U-745%175U75U-?7UM;1T='6UM?555175E=14E=55U145%74U];1T=#1
-MU]34U-35U5545%755575U]35U51645!15U75U-;6U];7U]34U5555%75U=75
-MU-34U=555%155%54551455555]7155555U35U=34U];6T='7U]37U-755%=4
-M5U=5U535U-?5U=55U=36U-74UM14U%51U%115%=7U-;4U%=75%=5U=77U=75
-MU=?7UM#3T]/0U5%45U!04597UU?55576U-'5U=75U]34U-555E=15E=5U-?6
-MU]'1UM;5555555=55%!7TU'05%335-Y6T%%5U5;445565U17U5=5U=31U]'1
-MW=34U%575%=75U15U-34U-37U]?7U=35U-?6T=;7U5545E%145965U34U]34
-MU-34U%555U=45=77UM'0T-;7U-555%965U=75-75U-35U%=1U-34T=#1T=;6
-MU]555U145%=65E=75U35U5545555U=55U=74U];1T=#0T=?4U-35U=555517
-M5E965U175575U-?45=75U=34U];6T=;6TMS0T-955E904%!045975=75U=75
-M55555%55U=77T='1UM'6U]?5U5145U=75%1455145%15U=?6U]34U=75U=34
-MU];1T=;6U]?7U5575E9275%04515U-;1T='0T=?7U-555575U-755575U=75
-MU5575E=65U=45U=45=37T=#0T='6UM;7U]555%=65U=75U15U=345=75U=77
-MU]?7U-'05=755-74U-1555145U965U155=34U]?7UM355=74U-75U=74U-?6
-MU]?455545U=45515U=75U=555U145%75U=34U];1T='1UM;7U]?445-745%7
-M5%7555555=75U-35U=7555555%15U=37U]37U];6T-'6U]355%9645!04%!6
-M5-36T=;7U]155575U=?6UM'6UM?4U5145U145U34UE145%975555U=37UM'6
-MU];1T=?455965U=75U=5U=55U=75U555U=?7UM;6UM=55U=75U15U=34U]35
-MU=74U]35U575U-34U5575U=45%!0U575UM'0T-;6UM;4U=555=75U=37U-55
-M5U=65E965U=65U145=36T-/0T]#6UM545U145%155=74U=35U=5555145%75
-MU-74U=37U]75UM95U=5455175U=75U35U]'1T-#6U]35U=74U-34U5545U=6
-M5U965E945=74U];6UM;6UM?7UM;6U]?4U]?7U]5555145%175%175%545%10
-M4%55U=?4U]?7U]?7U]?7U]?4U-34U-34U=755=7555155%965%145%145574
-MU-;6UM;1UM?4U555U=555555U-34U5545U915E=4U=?7UM+3U]'7U-34U=55
-M5%=645%15E975%15U=34U]?7U]?4U-?1T=#0T-?4U=55U5545%=65E965U=4
-M5%74U-?6T=;7U]?7U-5555175U74U-;1U=76U5145U965U74U]?7U]?55517
-M5U=75E145=34UM;1T-'0UM?4U5145%55U5555%915U35U]?7UM35U=75U=37
-MU]?7UM;7U]34U-545E;455955%155%145%15U-?7U]?4U5555%75U=75U=55
-M5=75U=555575U=74U-37U-?7U];6U]15555455555=74U=37U-545E=75%75
-MU-37UE35UM35U575U=755575U=7555145%15U-?7U]155%175%555=55U=37
-MU-35U=77U]?5U-75U5575U155=34U5555%75U=74U-36UM'1UM;6W=!5U%57
-M5E9645975E155=75U5555=55U=74U]?4U-745=75U=37U-555U9645%65%74
-MU]'1T='1U]35U=75U=555=75U=35U5545%14U=575=145-55U-?7U]?4U]34
-MU-34U5555%175U15U=34U-55557555555%145=74U5155%155574U-?6U]34
-MU575U=36U]?4U-555U=75U=65='1U]'6U]34U=37U-555%145%=5U=755555
-M555555555555U=36T='1T=;4U55555545%145%145%145%555=75U5555=74
-MU-37U]'1T=;75]37U=7555545%175U74U-37U]?4U=75U=545U965U35U-?5
-MU=74U-34U-35U=75U-?6U]74U=75U=75U=5455545%15U=?6U]37U%545E36
-M55=55U=555555=75U-37U];6U]?6U]'1UM;4U5545%915U=4U=34U-345515
-MU-?4U-35U575U575U=74U5545U%045975U15U575U-37U537T=;3T]+2T]#6
-MU]1555=75E975%145%545U914%-045=5U-?6T=#0T-;7U5545%74UM'6T='7
-MU]34U575553555175E145%55U=3555?5UU5755175%75U]?4U=35U-34U]?4
-MU=74U-?6T=;1UM?6U]35U-755%=65E=75E!04%!65]77UM'1UM?7U-?55=74
-MUM;1T='1U]155%=65U!?4%=15%75UM'1T=;7U-?7U]?7U]?4U5545%155%14
-M5U914%!05E14U-;0T=;7UM?6U]?6U]?7U]?7UM'7U-145E%045145554U=75
-MU517U-'45=34U=145U=15E=65575U-?6U];4U-;4U-555=77U];6U];7U-75
-MU=3455575E904%%05E965E34U=;7U-75U=745=75U=;6T=#0UM'45-355=34
-MU=34U=35U=75U-35U-35U-35U=755%=65U=65E945U1555175%75U5555%74
-MU]?6T-#1T]'7UM'1T=#1T='6U]3555145%965E775%=55U145U145U165E14
-MU=555%145-74U-?1UM;6U]35U=?6U];6U]#3T='6U-;3T=;1U]7555=65E96
-M5E965E975U=14U)24U-75%745576T=;6T='1UM'4U-/1UM'1U-?7U]'1T-#1
-MUM?1UU5555575=34U=?6UM35U5=14UU=7%U275Q>7UQ24%;5U=74U576UM?2
-MW=W<W]_?W-S9WMS0T-?7U%34UM?4U5545%155%145%175U=75U%14%)275Q?
-M7UY?7UQ24U!65U54U='<W]C:Q<7:V]G;V-[9W]+2T-'6U-?455=745!145U>
-M5E17551645%075)=7%E86UM86%A97%!15E71T]S>WL7$QL''QL3$Q,3%V=_2
-MW=W155=14%Q?7U]<4E!65E95U-7455=14UQ>7EE:1$1:7U)97U-35U=4U];0
-MW=G:QL3&QL'&P<':V][<W]_2T=5545-34EU?65Y24%=5U-'2W=/0UE514EA$
-M1T=$15I;65A>7UQ34%=5U]/<WMK&P,'%V,3%Q<?%W-S2W=+3TM;4U5=17%A8
-M6%A87%-6U=;0TM_?W-W=T=507UI$1D9!0$!'15A<4U94U=30W=_>Q<3%Q\3%
-MQL?%V-[>V=[?W-/7U]'645)>6UI'1$1;4%34T=/=W-O8V=_=UE127EA;6D1'
-M1%I:6%A97EQ24%37T-+=WMG8V\?;VMK9WM_?W-G9V-G?W-W0UU514UQ?65E>
-M65Y<7%)5U]'<V=O8W]_=T%1=6$1'1$1$1%A>7UQ24E)05E95UM'1TMS>V=C;
-MVL7:V=G>WMC?W=S?W-/2T-'45U!04UE;6UM;65Q05-77T][;V][;V-%44%A%
-M1$%"34%:6%]<7U97U=?6T-/<WMG%Q<7$V][<W]W3T]/0T-#0T-;7U]35U-14
-M5%%04U)>6%Y?75)1U];7TMC:Q,39W]W15E];1$!"0T!%6%A?7%-4U574U]/<
-MW-_>V=G9WM_=W]_=W=[?W-+3T]#7U-=55U%24%-34%-<75)145)05=;4TMC;
-MQ<38W]+74%E$04%#0D!%6UE<45165=77UM+=W]_?V=O9W-_0TM+<W=[?TMW<
-MW-W0UM;455=65U%265E?7%]>7U155M'?WMC:V=_<UEU9149'1T=$6%A975]2
-M5U55U]W<V=C<V<?:W]O>W='7U=32T]/2W-G>W='1UM=55%%04%U?6%A94E)7
-MU]76W-[;Q-K?W]W54U]%1D9`0$186EA>7E]?4E!5T=#8V<3&P<?;WMW>T]#6
-MT-S<W=+=TM#7T-#1U55645936%E>7%U=4-'75=S9V\3%W-S?55Q91D-#3$Q"
-M6EE;6%M24535T-S?W]G%P,;:V-S<T-'45-#3T-32T]W?T=70U]7555=15E)3
-M4EU?4%35T-33Q=K&QMC=W-%?1$=-3TIU2$%$05E>4-305=7<T]/9V<;9Q-_8
-MQ]G>U=W6T]#2WM+<WMS0W=54T%5=7UQ=7T1<7%U3UMW3TMO!P\+$VMK<55]!
-M27=W<7!U24]"6%U4T-#2Q<#8Q=O$V=G;T=G2U]/>W]K%WMK8V=+!W\7%U=90
-M4%M>0D5:1D-:5=%55M['R\["P<3:4UI-2W9R?GQU2'5"75?3UM[8S<3;S<?,
-MPMO2Q-G<5-/>W-+<Q,7:QMK;W=)755!465E!6D9+2%C,P%#0]_?S\\'-\<1`
-M='!X>F9C9GU_?4E1U]K9S//SRL_S\??,QL7-V5]35=U3U572PM#?TL#8V=O2
-MQ-501%]&=')6_5=-\/'+Y?=2\?Q&>7%Z86!O:V-Y87A?VLKYY>;LX_KEY//`
-MTD1$6W9\0D)U6D17R\[7S_3+SL'1U--'25I-<5OLYTGF[?;HXEKWX4YC8&L7
-M%Q$=%V)N;731]>7F[):1ZI67Z./[P59?>F]B8FYL8V=)U=3QX>#GYN;EY<K6
-M4TQX8F7G[VG<D_+ME=/>E]`68&,1'1,9$&$4%$/PS.7LZI.=E>J2E?KSWD9V
-M81=L8!5J8']-WE7VZ^[C[^O@Y?%=4$!A:.&0%$V8R.613GKJ5A@7;A\;$AX<
-M<&%H].C@[IV3G)F5[Y?A=W%R:6\5$VID;F+7SO#@X.*5E>7DX_?537Y%EI-O
-MRH7G_.9(9O=M`!D0!`8;'19$<'.4G)&0FYN8G>+FXM=O:F\7%Q8694-Y</_B
-MY^#A[>ODV,3P5GID8&==GH=FD(GOD)-_9<43"P`$#@\!&AQ9\,6;@(>'@X&8
-MF.%?WV\9&AT9'A042.3_^)2=E>OHY_K9=GIS>FAM8F?KC9QVCXSJF_D59F8"
-M-P(""PP''&>5ZI>"CH.&@(21XGH6%Q\!!AT1:G'9[IV2EY"<ZO+6=7UA%11C
-M9V=E?D6?M(9SB8CIGT($$A0),PL#"`,>:_B&AIB/M8V%F97$<AX#!!D&!&I.
-M_Y26DX2$E>7@PV<5%A!K9VQEP?_\EHBUEY^)EN#E!@T%`S<Q#``&;G#RAXZ"
-M@8R/FNK*:Q$=``T$$!1@\)>;AYJ>F9#T9VD7$AP8'&)UW?/ZA+.QXX:UZ^AW
-M-0@!"3`R#@494_GIC+>(AH&"G%5M&`<:``P$;]?P[IB&@8>2E.K1%!X8'1(2
-M$V[W[/[OCKV*YH*#]N(=-@L#"38P#!1PXI&<C[>*AIV=ZVT:`0(!!00?<928
-MGIN!AIN7]'%B$1@'&VIA9DW[[).UO(W/@HSZ;0`U"P@(-#`/0^SLD(:+M8B!
-MD/KU80</#08%&!?8EIJ'AX2%FI?3;101'@49%V)SQO_A@+RPZ.*"AN8'-S4.
-M"@@T-P;MA)B6A+2VCYSW=G%K!@D)!VYG;]:<@(";G)^0X$$7'!,6$1`7?//E
-M_IVWLH/TZ)B>9C4V"0X.#@L-%Y2#@YZ;B+>,YQ$69A8!"0\91O+RYY&!C8>7
-MY?O^=Q(%&!=M;&QU\.J"L[&:_>Z%FA,Q,`D##S0U!WV7@8V&AXR*B980&Q<5
-M!0D)&DK[X>R0A(&'F.C5<']@$1L>:'YP3]^5C+&WA_K'D9YL-3`W#08/"P!O
-ME8:"@X"`@H*931P:'QP'`@84]Y21DIB%FIZ6_'X5%VH4$Q(5<<7EFK6VCY#-
-MXIOL!#<Q"@$#"0\:6Y*'@(V-@(:%EM<1!00%!048%=CJDYZ;F)Z0Z_M/:!$1
-M%147%63#DHZWB)ORSI"39@PV-PP'`0(!%N2;@8.-@X:8EN!%%@0&!QD3%V#=
-MZIZ;F)R0Z^?#<&\6$Q9K8F1,E8VWM8;[6^B3U`8W,0@!!@`!$\N=AX.,C(">
-M[_K,9AD``P478'U<Y).:A9F0[OQ2>6,5$!(1;W[3D(^TBH3\T9225`$V,0L!
-M!P``'?&8@8*,C("?XLI28AD#`@07>$'9X9.%A9B3[/1,9V\5$!T2%'_M@;6T
-MC)/)Y9'O%P@P-@X'!`8$:.N&C8R,@H:3^M5_%P0-`AIN0]/WZ)Z'A)Z4Y-EQ
-M8A41'1\2:U:=B;>U@>_QE)#%!S<S-`($!P$97)Z`C(^/@H7KQ7%L'`$,`!]A
-MU_'AD9J'A9WI\$-@%1$0$A(68]R=CK>T@^Q6X9?&!#<R-P(%!0<<V)N"CX^,
-M@H7L0V`5'P$,`Q]ZRN7ODX6'A9WI]7%O%Q$0$Q`78M62CK:W@NY'_NK9!#<R
-M-@T:&`4<W)J-CHZ,@H3H6F(7&0$,`AEG].?ODX6'A)SNSG!O%Q`3$Q$59='F
-MGHFVMX/A9%GX<P8V,C<"&!X>:N*&C(^,C8.8^V87$QL`#0`30.3OE)R$AYJ0
-MX5!A%Q,0$1$6:''S[YR,M[>,[VQGR74$-S(V`A\2'6[LAHR,@H*`F/MM$!T;
-M`0(!$5S@Z)><A(>8EN5%8!<3$!$6%&U(_N_IDX*TMX+]$!50?0<W,S0&$!84
-M=):&@X"#@X:13!83$Q@&``5C\.^5D)F%FI+NRW]K$1`7%!5N?L'CZ.SLF(BW
-MCI04'&=%$PXV-P(<%&]#[YF'AH"#AY=%:Q06'P<'&6+!X>N0GYB9D^C(9147
-M%!44%&U/]N;BXN'FD(VUCI85'F'`:`(T-`(<%VY;XI"9A8&#FN9]8V!I'P0:
-M%GO:Y.J3G9R=D>)18VAO;A06:''-\_'XX>'SVI6-BH#R$!;&_!8-"@D!'Q1R
-M]/CBG8:"A^A61D)F$1L8$VI\\NF4EY&<GY7$?V1A:187;7],T?#GY_',S][R
-MFXF/DW\41N1@!@\.`@<<9_'_^)&&C8:4T$=/9Q4<&!X1?^7I[I63GISHR49Z
-M:!<7%6UG2/3FX>?Z^/S:<'66C(R24V9#]F<;``P/`1!TPU3VG8:!FI?R1&5C
-M8A<>'VI2Y^/OEY"0ENGW<FEJ:6H4;GW'^>?BZ>+^Q4=R8Q5/A8Z&E?38^L45
-M&`,(#P5K<WU:E(6'A)CJP7Q[<VP='Q=_RN?MZ^CJEI7_=FQH:VIL?G5<_>Z4
-MZ>?]P75A;&]J%?R-M8"3YO3W?1`%"30(!6YU6>2<A8:`A.I/;FQA:!86%V/!
-MZ):4[^B5XLYR:!<7;7QP=-OGZI>5XO%/969C;FAJ;>V/M8*>YE%<9A(&"C<)
-M!6+2_96>A(&#FN%E%!5I%180%W_FD9.7[NWA_=9D%Q`78'16]^;OE93JX=I\
-M;!07:VUC8'B4B+>/A>)]9A4>`#4W"01@^Y2<FX6`@IOX;!(=$!5K%Q5.[YV<
-MEN_X]<E281<0%&%'\^/LZ)24[_E5>&L6%Q5N9G5:59>)MX^9^V(7$AD&"S0/
-M&7#ODIB;F(2'DO1I'QL=;W%^?L7OD)V1[=YS<G]@:&MB<\3BE)3JZ>WDSTYA
-M%1`0%&][7,KY_OZ=B+6`D4<2'Q\9!PD+`!#2EYR>G9*9F971:AX8$'O8V\SZ
-M[Y:0E/AP8F!@86=D?D;RZI:4Z>3.UT1];180%FE^5/;ZYN;\]Y"/B83I?Q(<
-M'1T%#`\&$D#KG9Z2D9R=E?]X$1\09\7TRO7WY._NY5AE9'AU5]5>7<_AZ>[F
-MPTYS<'1]86]O8'#6\?KDY.7Q45R4@(&3^V$=$A`1&0$!&Q3>EYR?D)>6E>WP
-M>Q$<%G_0QL[>TOSOE>+,6G%]0U=92'=?].7AY=M&0U]70WA@8F="SOKG^_3=
-M0WM!D(&%E_UM$11H:AX&!!YKR)23D)25E.CC]606$VM(Q??TUM/Y[^OASTUE
-M94I80'5W7LS[X^3`4UA4VMU'>&-G<5/$QM_7745T>EB3@(:>ZW$4%Q07&0<'
-M!1-!Z9V?DY&7[N/V>100%&=#PO'$P?[CZ._X4&=B9').6T5?Q?CL[^;SWEQ$
-M2W]@;FQG=M3+\_+WQE=T4Y&!A)+B9Q`0%Q43&@4;$$;HG)F2E^[D^O=U;A$6
-M8D#RYOW`QO;GX?[79&QA=MSWR\7<S^7AYOQ4<7]\=G1R>V5]4/'GX?_3<V-F
-M\)V%F9798A5O86P1&1H>:\65DI*6[N'DY<IT;A<485+R^O''Q??EX?O=?&!G
-M=-#"Q=5?U/3EY_[$07=Q=TMW?7YV4,G]\\1)?M"4F(6?XG$4$!<5%!`?&1-G
-M^Y">G)?A]LS&5GQO%!5EP^+JZ.?VP\W,UG=@:&ED6/?Z^//T]O[[\M]W9V-G
-M<5W>V=W$]_[E_=YW9'')XY65X,)T>7AE86@1$A!K<?'LE>CMYN7Z_<%$>V%D
-M<5+!S,+&QL_T]<W53'9P=5M4UM;1V\_W\/7:5T=`0DEU=4]<5U=41W?4ZIN%
-MF9;?:Q,2$!`2'1X<:-"5F869EN3#5$!Q9&D4%&;%XI>6Z^?QPM]==F9H%&EE
-M7_/GYN7__?WP]=5P86U@>4+2S<_+]O+]]]K&_.#N[N;"=F!N:&AH:A5J;'_=
-MY.B5Z^+XR-Q01W5S?W%'T/7^^/[SS-!?0DIV<')R=T34P_'\_//WS]Y7171\
-M?GUU1%?=TEU!\YV%FIN5=Q4<'AT=$Q,>$FA,[I^%A9WO]T)P<GAF:11K853M
-MD)V2E>?83'!Z8&X4%&AEU/CB[NWG_O;"T$!\86)@>DS;\/GX_/;/R_KOE97M
-M]W1C:Q45:VAJ%6EA0O#LE)?KYO3714).=7!_<D/=\.?@Y_S#5D-+2$IV<W]_
-M=U/._N3D_,S245Y:379\>'EP3EOUEYN;FYSF36X3'1X>'1\<$6]?XI"8F)V4
-MY=-/?'YE86-M877,XI>0EN[P7GYA8&-B8FUA?EKWX>[K[.3W54UT<GU_>7QV
-M1M+*^^+NZNKLY<-(9&\5%15J;F-Z2-+]X>SN[>;\P51&=W9Q<'9*0%':]?+]
-M\,C?4D9-34!$6UE3T<7.]_'WS=U20W5S>'#/[923D^O^1F,5%A87%Q87%6UV
-M].F1DI.4X<I20DIT=W)X97MW5/#@[NCNY\A<<V5G9V=G9V5^2-'WY>;FY?/-
-MTE!>7UQ=7UE;6UQ7W,GP_?+WP55&=7%R<GU]<W%U1U;8R?;Q]LK!W=567UA%
-M0TY*2T)9UL3.]?3W],G)S\';TE526$1!1D1:4M_U_^7D^_;<0G]F8F)C9F5\
-M=$95QO;YY.;G^?3874!)2DY"1EA=5=S'S_7W],[:UUQ&3$E.3TQ!6E]1T-O"
-MR,G/S,?8W-/445-5TL?)]/7`TEQ/<']X>'Y]<71)1U+2S?#_^/C\]LS9U%U8
-M1T-,3DQ!6U#7WL;-SL["Q=U5745!0T)`1UE1T=O#SLK*R,+%WM1<75%4TMC:
-MV==?3'=Q<'%W2TU&15E3U]C,]/'P\<K`WU5=6T5%6E]35];=V-K$QL38W=53
-M6T9!04=94E'4TM_9VL7%Q=K9T]116$=%7=?3Q,O)P=Q30W5W=G1/1%]05=?1
-MW-O'P\#$V=!67%A;7E)6U-#<W][?W]W0T=?5U=34U-36T]S<WM_<T5127U#6
-MV=O:Q=U16$AP<'!Q2D125]S9W=G:Q=K;V-[=T=575E=5U]#9Q<3%V=+1UM?5
-MU=345U%26%I>7UQ1U5515U!<75!05M?0T]S?TM+=TM+=TM#0T==555145-75
-MU=37U]154U-64U)04U!04U)24U!05E=5U=31T]W?V=O;V-G>W=/6U]1555=6
-M5%145U=64%-34%!05E77UM;7U]1445-<7UQ=4E)15-77T-+<V=C%VMK&VMW3
-MU5%34U)24U;4UM#3W=+3UE1375E:6EI;65]<75!65]31T-+2W=W3T]/2TM/3
-MTM+2T-'7U];6U]?7U]3555=64%!15E965E9145%65E-6U]37T=;7U-55U=35
-M5535U]'3TMW=W=+0T=?5U55455555%=5U]+05-166%Y>1UI645?3TM3=W-;1
-MW-/0W=/4U-115E=75]?4U];1T=/2W-/7U5914%U=4E-15U15U-34U5545=75
-MU-?7U];6U]35U=5445!045945=76T-/2TMW2TM/1UM?4U-7555145%965E=7
-M5E905E=75U=75%1345145%74U]'3W=S<W-+2T]#0T-'6U-55U5165E%04%%6
-M45%15E965U1555155%77U]?7U]'1UM?7UM?4U-75U-755=74U=5555=45U=6
-M5];4U='7U]355%155%755575U=34U=555554U=74U]34U]34U-?7U]?4U%54
-M5U965E=45%75U-75U-75U=74U-34U-34U-155%15U-?7U=355E355=74U-34
-MU-?7U];6UM?7U%555U=65E145%75U=74U-?6UM;7U]555%=65%75U=?7U]?4
-MU5545%=45%55U=37U]?4U-1555145U145-30U%74U=75U=75U-34U]?7U-15
-M55145-75U=74U=37UM;455545U=45=74U]?7U-74U5145%145%155%=75U54
-M5=76UM;6U]?4U-545%155%%5UM37UM;6U]?6UM155%=75U35U-?7U]155U=6
-M5E965U=5U-;6UM;6UM?4U5145=5555545%155555U=75U]?55535U=75U-?7
-MU];7U-77T]?4UU545U904U-65E145575U-?4U]31T-/0UM?7U]?4U]?4U-55
-M55164%!045%65U74U];1T-'6U]555%55U-;6T=;7UM37UU575E%045-<4U=7
-MU-;1T=;7T='1T=?7U]7555145U=45%55U=34U-74U%555555U=75U-34U-?4
-MU5555%75U-34U%555574U-75U-7455545U=45%14U-/7UM#6U-3555145554
-M5%15555555555575U-37U-355555U-34U-34U]?7U-3555145E=75=74U-75
-MU-37U-75U-35U-?7U=37U]35U=544%145U155%55U555U=74U-37U-34U-55
-MU=35U-35U=7455145%175575U575U-37U-74U=74U-37U]?7U5145U975%14
-M5575U-37UM?7U-'2U-7555555=75U=75U5155=755=555=74U]?7U-555%=7
-M5U94U5555=75U=34U=35U-75U=37U]?7U]34U5555%55U-?7U-35U%555=74
-M5%;4U]37UM?7U%545U=75%145%75U=74U5555%=75E175%75UM'0T]#3T=?5
-M5%=45%145=5555545=75U=75U5555%155%15U=55U-?6T=;3W-'6UU575E%1
-M45965U145=75U-34U]?6UM?7U-155575U-34U]37U]155%=645%15U155555
-M5555U=34U];7U]37U];6U-35U5145%75U%=1U=54U=34UM'0T-#6U-545U=6
-M5E965U35U-?7U-545%=75E=45=36UM'1T='1T=?7U]555%=45%=65U145=15
-M5%5555555575U=75U=75UM#4UM'6T='6U]3555175E975%=75%555=75U-35
-MU=75U-55U=74U]37T=#0UM?4U5575E%15E975U=5U=34U-755555U=37UM;7
-MU]?7U]164U=645145%74U-355=75U=75U-34U=75U-34U-37U];6U]155%=1
-M4%!65%74T=/0UM?455545U74U]?7U]?7U5=14%!65E155=75U=155]375%55
-M5U75U-;1T]#1UM?4U=545U=45%=5U=34U=34U=35U575U=34U-?4U-555514
-M5%=45=74UM'1UM#1T=?455=65E965E975E=45=775571U];0T-#0T-;6U%54
-M5U%04U-345945=34U-75U=75U-?6U];1T-#0T=?5551555=45%=45U=75U14
-M5575U-74U-35U-35U-?7UM;6U-36UE155%%34U!15E15U-;1UM'1UM?7U=74
-MU-34U-7555=75U145=55U5555=755515U=755=76T=;4U=77UM;4U=75U514
-MU=?7U%555%755%-055915-74U%755=77U-?7T='1U]34U%1445!15U35U=55
-M5%=65U77UM;6T-#1U]?7U-34U-34U-15U=7555575%555%=65U145U=45574
-MTM_3TM#7U%165E%65U74U5545-75U555U=37U]37UM;7U%555=74U]355554
-M5%=7555555555575U-;0T]#6U-34U575U]?4U-55U=34U5515E575]74U];7
-MU5555=74U-555%975%75U=75U=?4U]?4U-34U5555%=45%145%55U-?6UM?5
-MU-34U-35U5555=74U];7U-545%175%575]?75-35U=34U-34U=74U]?7U-55
-MU=74U=75U=75557555545U=4U=75U-75U555U=37U%145%145=74U-555%74
-MU]?4U-3555=75-75U=3545?7U=76UM155555U=37UM;7U-75U=34U=545%=6
-M5E975%75U=37U-35U%55U-;6UM?7U-34T=5045%25=!55]73W59'7M_3U=3=
-MVU!1WL#16D52U%-3T=O?65_<W=U67U-36E]75=/=Q\#=U='<VM)65M576$19
-M4U-65E555%=745)7T-O&Q=G?T55445=75U?1UU174%35W=-75U-34%M1UM54
-MT=_0UU=75%=5T-+65U?4U-71T]W<U%=75U%=4U3555!35%755%35T=S6T=?4
-MUM35U=;755935E?4T=?55E?7UU545E%45575U]37T]#<V=+1U-?4U5%=7UQ3
-M5U51U-?7U%36UM145=54U556U=77TM#6T]W2UM'6U59=4%%07%-34-77T-+1
-MT='4U%74U59555155%555%77T]=14535U]'55=3455965]74U=34U]?5U=54
-MU=555=36U-34U-;7UM?6T='755555U=555145%555%1455145%=5U-#3T-#2
-MT]?455545U=6U=;45E=45U145%545U34U-77U]34U-355E?5UM15U-355%=4
-M5U901G=)6E+7W-O'QL#`P<;$VMC>W-+1U]555U914%-34E)24E)34U-34%%1
-M5E=45%75U=34U-?7U]?7UM?7U]?7U]?4U-34U-75U=75U=75U=5555555=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-:____________________________________
-`
-end
diff --git a/share/isdn/1.al.uu b/share/isdn/1.al.uu
deleted file mode 100644
index 60e59ca..0000000
--- a/share/isdn/1.al.uu
+++ /dev/null
@@ -1,323 +0,0 @@
-# $FreeBSD$
-begin 644 1.al
-M55=75%755=545U1455145575U-37UM'6U];6UM155%175U975U74U-35U-77
-MU]75U=75U=565=;5U-'1U]345%=75U15U=75U]?7U]545E975%75U]?55555
-M55555=74U]355%74U-74U-37U-34U]'6U]355=34U=35U5555574U]355=55
-M5]?6U=555%=75U975-74U]?4U%575U=75%755575U=?6T='6UM;6U]555516
-M5E965U15U-?7UM;5U5555=7555555=55U=34U];6U]?45%745U355=75U=74
-MU-355=7555165U=4U=?6UM?55=75U-55U-?6T=?55%914594U=?6T='1UM?7
-MU5145U145=34U-?7U-74U=555E=4U=755E-65%74UM'1UM;4U=355=55U=55
-MU=35U-155U%65U155=55U-?7T=#1T=;7U-74UM?7U55645%05E=55515U555
-M55555=34U-?6UM?6U]31T=75U5145=555555U=34U-355=77UM?4551645%1
-M45=45=77T=W<W=/1UU545%=75U965U15U-?4U-545%=75-555555U-;6UM35
-M5%5555=6U-34U];1T=?55575U-?4U5545E%65U15U-34U-;7UM'6U]1555=6
-M5E=455555U145=75U-55U=75U=555=77UM;6UM3555175U145U%15=15U]'1
-MT]+3T-'6U-555%755%=75E=75=?4U-555=75U5175U=5U]#3TM+1U%555%91
-M4U)345=5U]?6UM;55555557555555=77UM;6UM175E5555545%55U-74UM'1
-MU];1T-#655=75%75U55645945=37U51145%7U=?7U-3455755=545=355=;5
-MT=;4UM36U%155-76UM;455165M745=355%145-77U];1T==75E=65U165U94
-MU=76T='1UM=45U=655145%35U]36UM'1T='6U]35U=34U-35U=755%964596
-M5U145555U=345U37U-?1U]74U-35U=545E=4U=37U]?4U=74U-36UU545U96
-M5555U555U-36T='1UM34U5175%74U]?555165E915E94U=74U-?6T-#0T='0
-MT=34U5145E!15U=455145=77U]?55%145=36UM?7U]35U=74U5545-75U554
-M5%1555575E=45-77T=#3T]#6U]155%=45%15U=555U=555!05E!05E34UM'1
-MUM?6T='0T]#0T=?7U%545%=65U54U=555%%145!15E=45=36T-/0T-'7UU54
-M5575U=755=755=34U-7555904-157U#7U-;3T-#=W='4U-36T==45U975U17
-M5E145%155%72U%'15%?45%15U-15UM;7T=;5U=5555=65E=4U=34U-37U]75
-MU55555555=37U];7U]=45=545%1455545%35U-?7U];7U]35U5545%17U575
-MU=7555555=555%35U]355%965E=5U-;1UM?55=75U]155%14U=34U]34U=74
-MU-?4U-'55U=75U=45574U=36UM;7U=555575U-37UM?7U]3455575U%04%%1
-M5E=45%75U-;0T-+=TM#1U]175E965U74U-555%145%1455555=755-76U-'6
-MT=#0UM155%965E=555555=74U-34U-555=5555=45%75U-?6UM;7U-?55%14
-M55165E35U-?7U]?7U]145U965E=45=37T=;6U];2T-?755145U145%145-75
-MU5545U=75U=45-74UM#3T-+?TE54UM;4UM534E965E9075!4U=75U-37T-#1
-MUM?4U];6U]555%75U-7555=64U]045'5UM'3T=;6U]?4U=3455545%74U]35
-MU55555145]77U]?4U555U=75U=74UM'1UM?4U5145%145U=75E=45%35U554
-M5%175U=55574T]'1T]#0T-#1U]555%=65E975=?7U-74U-755%175U15U-37
-MU]'1UM;7U-34U-7555575E=75U14U=34U]5555545%=65]75U-?6U]?6UM14
-MU];4U]35U5555=5555575U1555545U975=75U-37UM?6U]?7U-75U=34U=54
-M5%=75E965U145%34U];6T='6T=?4UM?7U-555575U-145=575U545%175U=7
-M5%75U=36UM?4U-35U-35U=75U-?7U]?45%964%-34%%65]76T-#0T]+3T-'7
-MU-555U94U=75U-35U-755%=65E%15E=65M?1U]'0T-#3TM/1U]145E975U=4
-M5%555%=75E965E=5U=74U-?1T=#0T-'1UM?55%=75U145%175=74UM155U=7
-M5U75U=37U-74U=37U-'0U]?7U]545E9645=45U=75=36T=;6U]37U-755555
-MU=75U]?7U]355%=75U145%15U=?7U];6U]545U=5U=?7U]?4U-75U-74UM;6
-MU%5445U34U-65%14U=37T=;1T=?7UM;6U]37UM?4U-75U-355%1745%14%-0
-M4%%7U=;0TM/0UM?55574U]34U-34U=55U=75U-3555=65E965E%5T=36T-#3
-MT=;55514U55555145=34U];455545U975%145=75U-?0T]/2T];455114597
-M5%75U=3455755%=645%04595U=;1T='1T=#0T-?4UM35U=75U-75U-34U516
-M5E975U145575U-545%=55-37U];1T='0T=;7U5=14%!34%%15E75U-36T=;6
-MU]37U-35U-75U=75U=74U554U=565U145U155=76T-#1T='6UM?7U%145U14
-M5%74U-3555545E-34U%75-36T-#0T-#0T=?4U-7555175U15U-;1UM?55U96
-M5U155%145%=15M74U]'0T='7U%55U=?6UM355575U-34U%545U965E%15E15
-MU-;0T]#1U]?45=75U555U=7555145E975%555=37U]'1T='1U]75U-?7U-;6
-M5%1645=45%=145975%35U]37U-55U=?1T='6U]1555145575U574U-75U=55
-MU=555575U=555%755=74U=35U555U=?7UM;6U]?4U]355E%74%!65U=15U15
-MU-?1T=;7U%555=36T=/0UM34U-?4U%575E%145975%545U75UM/3T]#1U]?7
-MUM145U=75U=75U75U-?4U%545U945U?4U-76T='1T=;4U5755=74U5545%=7
-M5U=75575U=745=75U-37U]'6T=;7U]34U%575E=4U=#=W-+74%E'0$=95]/8
-MQ,7?T55645?7TM[>W-5645U35M76T-/0U%9275)24%95U=355U=45=?1T]/0
-MUM?4U-37UM;1T=?45%=65E965U74U5575E975-77T=;4U=555%15U=?7U]?6
-MT=?4UM515E%15E74U]'3TM/0UM;7U-155U=65U=55%145575551745%15E96
-M5U35U-37UM?5U=34U-34U-?6T='3T]/0T-#0T='7U-34U575U-575E=65E90
-M4UU?7%Q<7U]?4U95U]'0T]/3T]+2TMW=W=/3T]+=W]G;Q<3$Q<3%V-W65E]&
-M27=P<W)P=TI#6%-4UM/=WMC:Q<?$V]C>W=W<V,;`P,+#PLW,SO3V\?;TP-5#
-M<V5@8F)C9GAP3UE5W=O`R?3V\?'WR\+;TE504E)1U-S$S<CU]<[`Q-K;V\7%
-MV-)61G1\>F1G9'I\=T%=U][:Q<'-PL_.R<G/P,39W-+3T-/<V,7'QL?:VMO;
-MVL3$VMS57DQQ?F5D9V5Y<TA:5]S'S,G*]<K*R<_"P<39TM?55=76W=G%Q,?&
-MQL?$Q\;'VMG24$%U<GME9&1Z?W%.6E;=Q,_U]/?W]_7)P\79T]?55%34T][%
-MQL##S<_,R?7*R<+85$9V>6=@8V-A9']W1E??P,CW\?/S\_#VRL+$W-;55EU1
-M5=?2V<7!P,;'QL;#S,_.PL766'5_9&!C8V!G>79&5=K.]_#R\O/S]O3(P]K=
-MU%%?65]35=/>V\?#PLW`Q]O=UU1075Y96UI'04),24M)0T)"1UI94E;5UM+9
-MV]K:V]G?W][9V=_?WM[9V=[>WMS<W-W3T]'7U5115E?4W=K`PL+&TE-#=GYE
-M9&1E>'-+6]3:S_3Q\/'WRLS`Q=_0UU104596U-/<V,7'P<#!Q-O=UU=375!7
-MUM_%P<':TE%&='QZ9V9G97YV0538SO?P\_#Q]_7)S,/`Q-O?T512645'0$!'
-M6UQ5TMC!S<_/S<;;W-!675Y%1%Y0UMO,RO7TR,371'9Y9&%@861Y<4)1WLSW
-M\_W___WS\?7.Q]S44UM#3TA)3$-:4=/:S?7W]_3,VU5:1%Y5Q?#DX.+BY_=2
-M?VP7$Q(2$!1M?EWUY>/O[N[LX^?[_//V]<O,Q-U61W1R>&1G9'I_=T95Q_?R
-M__[_\_3-V-1214!,3TQ-0$5;7U)04534UM/=W]C:Q<78W-/45E967%]34534
-MUM'3TM+0UM?55%904%%65E=45=555%%145!05E37T-+2W=W2T]#1UM;7UM35
-M55=75U965E=65U=645%045%75=74UM#3T]/3UM7755=45U975U15U]'0W=S=
-MTM/3T-/1U]755%=145-34%945%75U-?7U-34U]?6T-W?W]W1U5!>1$U*='%Q
-M<7=/15;>PO7P_?W]\O'*P]C=UUU:04](0E+?]?O@[._LX?+0<6,5$1(=$A$5
-M8W#4\>?MZ>CHZ>_MX^;D^?+UVU%)?F%O:A04%6]G=-+]X.F5E>OLYO/?0G]F
-M;6-D=-_EZ):3DY;N_T1C%A\8&A@<$6Y^5_'G[>_N[.+@X>#@X^WBX.3QUW%@
-M:Q80$Q$58W'9^^R5EY>4Z./[R-1"<'AD9V9G9V1E?W=;Q/_CZI:0D);KY]YY
-M:!`?&!@>$A=M<=CZ[)66D9:7E>[@_LQ2=F1B;FAK;F-Z3M_]X>[JE97H[>7*
-M479D;&L4%Q<58';&[)&?FYJ>D.+:9Q8?&@0%&!T484G:_N/NZI27EI&1EI3I
-MY\%W8A<2'Q\=$6]]VN?KEI"0D93OY_35=65B:!06%6!PPNF0GH6;G)3_=A0>
-M!08&!!@3;W#<_^#NZ.N5EY:0DI.0E^SP2FP0'AH:&!)J>]SDZ9>6EI>5Z>/E
-M]MU#?V!I%!81:'G0Z9^%AH&$G>%Q$00``@T`!!QH=\_G[.N5E9>1DYR9F9^3
-MZ/=\%!X$!P<:$FYWRN.5EY:6E.KNXN3]P5I_8VH6$!,3:$;XD(:#C8R&G/QN
-M&`,.#@X"!!UI2L+DXNB7D9V8A82$A9^4\WX6&P<!!@4<:W;*X^J7EI:7E.KI
-MXN7U4WEM%1$3$A`6:5SODH&.CHZ"F>9N!0T*-0L)`!D5=O3BE)&?FH6'@8>$
-MF)?Y?!<;!@`!!QX4?/?OEY.2DI"7ZN+X]5-P9&UK%104%6YA>GS%E)F&B8N.
-MC)GQ%@(+-S$U"``1>?Z4DYF8FH>'AX:%G.K'8QP$`0,&&!%^_>F0G9V3E^OA
-M]]M:?'IF8V!F>')+7UM&6DUP9$SKG82*BXR-E&8'-#<P,0X`$_'MD)R2GIR9
-MAH>'AY#X91P'`P`$'F#(X):2D)"5Z>'UP$E@;144;'I6_>#HXOC(<6!L:FYN
-M:5R3A8*WM8R!W1\),3$P-P88?^CJG)R8AH>#C8>>XFP8`PT#!A9T\):2DY*1
-ME^K@^4AO%Q\>%FW2[)"?DY3Z<6(4$!$6$Q7I@8*QLHN,_P8T/CPR,`1@VYN8
-MA(>%C8*!@IU+'0\U-0P7P9B,@H&8X]ID9'AH:18;'Q-CY9V&@(>?_&(0&Q@<
-M$!45:6@7[;2SOJ>]AV,])"`A/35@B8FUBH.-A("/D\T<-ST_,`?AM+Z\LH[X
-M'`P/#087%A9F9?J>@(Z"A>`1!`$&$V;$_%1=?F36S.6&L[.WLY``-R4[.S-2
-MY8.QC8V%Z)-P6&<,#`@*&-F-L+"RB>46"S0)`V/;E9F5D)3GZ<%U;!P6%W_B
-M[Y;H5'$5%6!DQ4!O0(^\L[FS%0LD(20Z3H^+N+>>[A-C$19'`P\-"16>M+^R
-MMIL$"#`W!'J9AX2;Y/G`<=UF%1$<8D+NGI;KV&EH%&Q[?T5G%6N8N+N^OG0S
-M)RTE/5:\MK*U?FD;:$P7>@,T#03ZB["RM(1;`P(#!V)_\>?MGIV;D'45!`<=
-M8^R1DI'$07!Y4G-@%AX0;D;IBJ6ELXD#.R8F,0:&LHN/EA47%?5D'!H+#Q[_
-M@K6TC9748'G0<6D8!AEXGXR)@_T;#`X;1).:D?MZ;WS8Y_));Q`3:'7$5Y>S
-MI+^QE#,E(3D"4K.W@IP0'1+=X140#`L$9X6)BHR1_T)<Y7<0!P,?R("UB(1G
-M`@L,%96'A.Q^$A-^YI/JTQ08'&C`[N-&\K&[L[=W,R4F-!*:LHV9$0$?%Y[H
-M>1,+`A_[@XV/G.#N\N9T'``,'OZ#M(F?:PT)`7&=A)S6%1-M_I21Y7@7$FEY
-MU_/68TNTI;FV<CTD)S54@+:%6@8'9N:`EFH#-`-MGH*!A>;CDY"58`8)#62;
-MM;6'=P$,!V66GI1U$1-DXY.0YG\4%FY]1-G-UTEM2+6EOK5K,CHZ`."$C<D6
-M`1#@G(/[&0\*&]R%A)*4QY6%A))F!PX!UX2(C946``<4_9"7\VX2%TWLE^C]
-M4G-G;6IJ85+FX\-WA+ZXL)8T/R4W<.J`YV@%&>*0@)<2`C4!9)"$DY#@EH>$
-MEFH!#1OMAH^']1(&$DWJD?I\$QUM])24XM-D86=P?'I[<,3]P7&1LKNRA@P]
-M.S!O^YOE%!D9XY"'D1$!"`%B[ISHE^B=@(&=;`8-!/R%@H7V%Q@5U^N4RF40
-M$&S=ZY?HRWQM;65^?F5QPOKS=_^UN+Z('#,X/!GEG>\7&!KWDH6?:`8.`VG@
-MG>[OE)^-@Y`6#0P:YX>#F\44$F/P[N)=86II?=OGX>3RV4]A:!5M4^3FTF)?
-MM;JYBP4].3)OEYS'!P$$ZH>`GQ(""`9^ZISYY)2:CX.5'PP#$9:'A.MG:VWQ
-ME>[%%1`18</AZ^/^Q5=&8140:%C^[NGL@;.SBW(U,3,$4.7Q$!T9P)*=D&@$
-M`P=N]9'L[9:<AH>78`4:%.:3D.=[87/[ZN+<:!$78=/[X/K]P-95=WYD9']T
-M1G%PFKV[LY8(,CT-5N;5&P8%U(6$GGL$`P$47>'Q]Y:$C(V=8@$&$>&9G>1@
-M:'O\E)7S8104;'=4S?+EY/K+?6\4:4ORY,^1M[^SA`8V,`]TPDD:``5\F(6?
-M0P4``!-SY>;XEIF&AY#":6AES^+XUV=F0/SOX/9W9F9@9F9^1?;CY_97=GI[
-M1]S2<V66L;B]F@TP,`+8VFP``AG*AH209`4'!!%@0U#QGX:"AY5(%VI_\.#V
-M4GEQV/SG_<1/?'IC;6)S]^B4YTYH%VQ9^^528DN-N;BT;C8S-&_[?`4.!&"9
-MAY#?'@4:$&EC=$25AX*`DO5L:']7^_1414;*_?CWT5I]<V=L;F95Y.KI\'%I
-M:V!;\_9/;)2SNKR>"3,Q!/]<'`X-$.N&G^85&1\=%A%O?.>$@X.9Y4Q]W\;`
-MU7%&7<;W]?;-SE-S9VEH;77VXN;<=WAS3]W(7V=J7XZXN[44-C8)9,\1``X9
-MT9Z8YT@1$182'1QLQYV`@(26^5YV3$A15][+V<73V/?P]$YE;!5I>,CC[OI<
-M?F1]4MY`8Q3'M;JXCALV-P-&3!L."1+EA)_S919J%1(8'F+^A8*!F.S]R?3!
-M=71S7,W9TU_8\N3^3F,4%V]P]>7G\59$1]771'1F:_6UN+^"&S0*!UES!`\,
-M$/J?D<!R;F)K'!L<9N::@(2=X/#EX^5;>V5UQ-A21]7RYN519V@4;'/0]/'W
-MPMU00'1*2V5L^;2XO($8-0@%<&,!#@(4XYR6S'5G9F@?!!EO^9N`AY#^5?*7
-MG>A::A5E5,'74,SDX/1]:!5C<5/3UD5-1UM86=?&4GI[G[.XL>X`"PT38!X"
-M#`1#ZI'@0WUD914?&QQFX)N&A9;D\>.7E_IP;FY_UL'2WO;EY,!_:15L>4%6
-M4%]5Q\'>W-9%='%)E[2]MI\1```9%AD#`@=J_NWL\]1W?6$0'!)IW9:8FYV7
-MZ>_OY_=>?V1Y25W<P?/_\\1.9VYO8'!355)86UG5P<G87G=WZXNRMYEB&@89
-M$!D``P<37/GBY,E80W5N%!<49/Z7DY*6EY>7Z>3,3GQE>WQT0E?/]/SU765B
-M8V5$5%],=4Y=WMK8QLG;]Y^)M8'L6&D1%AT$!P4%$V!RQ,+24\7<4M%(?$C<
-MS?WGX.B5Z.WCY/+(5$1%4%U=7US3U49Q?7U+6T)U<7]_=TY#5M_`R,GTZ9J8
-MY/GNY/;+2F!E8VIO;A5N:Q848&1TT516P_'W\?+\Y?O^Y?OX^_CQ\OO[_O/`
-M55])?'MY?7!]965^<79W3%A0T-W5])":[_Z7E^GB_'1W<6QN;A<7%Q,2:V-F
-M2$=!WOS]]_'V_.?GY.'@Y^?Z__[X^?[TU%A#<GM[>'Y\96=Y<W!W2DI8T-95
-MUM3TD9[FY)*0ZNWW=UA#8VYJ$1<4$!!K;V!(6US"\LO#S_7^YN?DY.?FYOO\
-MY>;E\L=54T9Q>7IZ>'ME>GYR<W%U1=?<V=C2T=S;Y9.1_.B0E>WGT79;?FUM
-M:A84$1,78F%]1413R/;-R_?PY>?EY>3EY.3Y_N7E_O?9UU5`<GY_?W)\965\
-M<'-S=$%>4E72T-/0W>"=E?V4D^KB^UE"5'EM;!44:!01:F-C<D1&5,C-TL7/
-M]N7E__CDY.?D_OGDY/KRQM'46'=\?GY_>&1D>GA^<$I#65!4T=W8QMK<S>B2
-MX?V6D>C@]D)0UWIB;Q05:Q<6;F-C?$Y"T?3'T\'U\N7Z_N7FYN?D^^7GY/[V
-MQ==707-^?GEY>&5E>']\<'1/6E;4U=#:S\S>UOB1EO?CD)?LY-Q.UT-F8F@4
-M:VH6%&QM9G9(1=K.WMO/]_OGY>7FX.'A^O[EY/ORP-/07'1P<WYZ961D>GIE
-M>')T0UE<4-/#R<_*]_;U]N*1[?+JEN_Z]$9`7'EB;VH5:Q01%6QM>TY;T,O,
-MP?7R^N;GY^'AY^3[_OG[_O+TV%=?2')^>'IZ961D>F5^=DE%5=#2Q<'-]_'*
-MS\[SZ93]_I24X/S925]"9FUO:VAH%Q1O8V9Q0EC?R<#,]_SDYN3EY^;GY?WP
-M__[P],;15UAU<G]Y?GAE97MX>7)W3UA6T-S9P_3W]_'WR_CJZ_7EZN[D\5=*
-M6W=F8V]H;&X4:F)@94M%4<;+S<[W_>3GY>3AX>?X\/;S\_3!T59<07=\?WY_
-M?WMX?'U\<4Q%4E37V<_.S<CUSL_UYI7F]NSKX__/1T1??V%B:6EL:Q5L86=Q
-M15W2SL+-]/'\Y?KY^N3D^OSP\_WQR,744EE/<G]Y>7E[>GE]<'9*1E/6T-+8
-MP<_+R<CT^^+@Y>;BX.7VTE-8='AF8FUM;VEL8&=_=497WMO%S_7P_OOEY?KZ
-MY/K]\?'WR\/245]'271S?GAY>WA^?'-T3D=3U-W;P<[UR\K^XNWZY^SMY//:
-M45-!?65A8V-B;VUA9WEW0US7WMG:P\KP\_/\^N7Y^?CY_OSVSL/=4%M,=W!]
-M?GA[>WYS<'9.1UY7UM[`S\OW\?#\^_KX_O[\\<G:UE!%27=]>'IE9&5[>7UW
-M2$!>4%70W]K#S,GT]O;Q\//P\?;TSL;>UE1=65M$04%!04!"0$9&1E/:R,3>
-M]O/TQMW5U=9?04U(2TIV<4I#0%E245345U;4T]G%V]O%QL'`P,'"S,W,P\'&
-MQL7>W==44%A'04-,3DE.3D]`0$=%6EE<4%36TMW>QL?$P\##PLW"P\#`QMO?
-MW]+655%27%A%1D-"0T)"0T=$65)05E37T]_8VL3'QL?8W]#75U%34E)24E!6
-M5-;3W=S>W]S2U]75U=75U%75T]!7U]S3T-/6U]9445-<6%M$041:1$5;65]2
-M5]71W-G;V]O8V-O9WM[?W=+2T-#2TMW?W-W=T%545%%=7UM%6UM:6%]<7UU3
-M4534UM#3T]/3T=#6U=755515U];1T]#0T];4U%55U-355%545=34UM'7U]?6
-MT=;4U=35U557459745965E%04%%145;5U]?7U]?1UM?1T-#0T-;6UM?4U]=5
-M5M77U-345=77UU575U145%555U965E%65U1555555=37U]?7U]?7U]75U=36
-MT=;7U]?7T-+3UM355%=65E965U15U5145E914%%15U545=71U]77U-?6U-34
-MU=75U]?1T-/2T-;7U5555%1555=65E=45=77U]'0T=?4551445!34E)35E=6
-M5=37T=;7U];6U]?4U-34U-34U=36T='1U594U5=75%15U=755=545U75U-?4
-MU=7555155%=55=74U-?6U]555575U-75U-34U-145%175%1555555U=4U-?6
-MUM;1T-#7U-555%=75E94UU54U5165U=75%=75-77U]?6T=#0UM;6U]755554
-M5%175U14555555175U=45=37T=;1T=;7U]?5U575U=?7U]34U=555%=45%91
-M45=5U-35U];7UM;7U%575E%15U75U=77UM?7U-555%1745975=75U=36UM;1
-MT-;6UM?7U%545%=75U=45575U-355U%65=35U-37UM;6UM'6U]?5U-=45%54
-M5%145%545U=75E=75U975]77UM'1T-'1T=;1UM34U-3455145U975E%65U54
-MU=37U-74U575U=36T-/3T=?5U5555%=75=545%104E=55=75U=74U-;6T='6
-MU-35U=74U]555%=75%145%5555555%155555U-?6T='1UM;7U-5555555%=4
-M55545=74U%545U=5555555145=;3UM'3UM?7U]?4U-75U-3555145E%75U%1
-M5U155%=7U=34U575U-?6U]?4U]?1T-'1UM?4U555U=75U5575E965E=75%55
-MU=?1T]+2T]'15%!45U945%1455=65U35U=34U=?7U-74U=34U-75U-?6U]75
-MU5145%55555555165%155575U-?6UM;7U%555%75U]34U]34U=75U=555515
-MU5=5U5=75U?5U-34U]37UM;6UM;7U=55U=34U-555%175E=65E965U35U-37
-MU]?6UM;6UM?4U5145U155=?7U5545E%04%%65%15U-;0TM'6T]#6UM?5U515
-M5575U=545%155574U5545U=75%155=75U=37U];1UM;1UM?4U5175E=75=54
-M5%14U=3555175E965U=5U-'0T-#3T]#1T]%455545%=65U=75U=75%145%35
-M5=74U=37UM;7U]37T=;6UM35U-355=34U=555%=75U965U35U-;7U5145554
-M5=75U-?7UM?7U-3555134E=65U14U-;6UM;4U=745575U]?7U]?4UM;4U=75
-M55=14%!15E=45=74UM;6UM;7U57555175%75U-?7UM'6U]555%145E%15E=7
-M5=77U-'0U]'6U%555%55U=55U=555%155%145%74U-36U]34U]35U]34U-34
-MU=575U15U=74U]34U55455575%145=75U=34U=75U=75U];6UM?45E%45E94
-M5%145=34UM'1U]155%1555=45-75U]?7U]'7U-55551755145=75U-?4U555
-M5U965U35U]'0T=;7U-34U-555%175U=45-555%37U%74U5=4U=74U-34U]34
-MU-37U%5455145=75U]34555555155%=65E=5U-?1T=;6U]34U=75U=75U-35
-MU-37U]?75%965E15U=555%15U5=5UU145515U-?4U-34U-?7U-34U-555514
-M5=555%545%55U=75551555755=75U-?7UM?7U]?4U-34U%175E=455555%17
-M5%74U]?6UM?6T];5U]155%175E975=55U=55U=37U];6U];4U-?6T=;7UU54
-M5U%145%65E904594U=?6T=;7U-34U-?6UM?7UM?4U]?4U=7555145U14U551
-M5E=05E75U-;6U]34U-34U-34U-?6UM?4U]35U55745=455145%=75U=5U=74
-MU-34U];6T=?455555575U-1555575E965E9645;5U];6T]S3T=#6U]355554
-M5U=45=55U=34U-545U=75E975%=5U=36UM;6U];7U]?7U-155%74U5545%55
-M5%=65U=45=77U];6UM=555555%155%544%355=74U]'1T-'1T='7U575U=75
-M5%=75E155=555%54U5555=7555545%75UM;1UM?4U=75U=35U=944E175=75
-M5=77U=155-555%555]71U-37U-?55-54U=37U-;1UM;7U-34U-355%145%17
-M5U1745%15E35U-36UM#2T-;7U]?7U]35U=545U145%=45%=75%75U=545=74
-MUM?6U%?5U]37U]75U555U=34U-?4U=35U-155%175E!65]76T='7U-35U=75
-MU=75U=35U=74U-?4U=7555145%965E965-77UM;55575U-?6UM?1T]1455=6
-M45!65E=75555U=75U=74U=34U-;6U]?6U];1T-'1UM;7U%164%-24U!65-74
-MU];7U-34U-?7U=34U]?7U-5455575E=75U94U-14U]?4U];6UM;7U-555%=7
-M5U15U=75U=5555545U=75575U=34U-?4U-?7U];6UM?7U]?7U%545%575U=6
-M5U5555555-75U=545%=45515T=+3T]+6U]?55%=75U=75%74UM;7U-755%=6
-M45975U=75%74T='1T='1T='1U]=55U155=75U-745%145%145%145575U-37
-MUM'6U]?55=1445555%555555U=37U]7555=75%55U=355=74U]3455145=74
-MU];7U%575E965U=45%74UM#0T-;7U5=75E?5U];1T=;4U=55555745%04577
-MU=?0UM;6U-555%1455755555U=74U-?7U-7555545E9645965E355%35U-'0
-MT='1UM?4U%55U=?7U];7U-545E=755555%%15U35U-?65%%55574U]?7U]?4
-M55555-74U-35U-34U5145%145%155555U=37T-'6U-55555455555%55U=37
-MU]?7U%545%145U=5U=75U-?7U]355571T-75U5175%145%=45=74U=755%=7
-M5%75UM#1UM;6U]37U5145E=4U=75U5145U945=37U]545U555=35U=75U=37
-MUM?7U]755-74555455%05%=7U=37UM;7U]?4U=37U]?45575U=75U-34U516
-M5E145575U-34U-75U-?7U%555555555555155%555%145%555=34U%55U=74
-MU577TMW1T=;5U55455=555555=75U-?4U5545U965U=75%145575U];1T]/3
-MTM/1U%545%145U9145975U75U-75U=555555U=37UM#0T='6T=9745934%%7
-M5U55U-;6UM?4U]34U-75U=35U-?7UM?5557555145%9145!15E155=34U]?6
-MT=;6T-#0T-'1UM?7U-7555175E965E=75%175]355]555%55U=75U-?7U]15
-M5=37T=;6UM;6T=3455145U965E=65E975=74U]34U-37U-34U]?7U-75U=?6
-MT-'1U]555%145U145%145-755E;55%=45=34U-?4U-37U]?7U-75U=755554
-M5555U=75U-74U]?4U-37U-35U%545%1455545%35U=5555555=55U-35U=75
-MU=?6U];7U=?0T=?7U5=645%75U=75%=75U145555U=74U];1T-/3T]#6U-55
-M5%=75U945=7555=45%75U]15U555U=74U-?7U]?7U-75U555U=75U5545%%4
-MU-77U]75U=75U];1T='6U-545E%15E975%145555U=5555545U=4U=;1T-#0
-MT-;6U]?7U-?4U=545%545U=65E965E=65E35U]'0T=;6T]'4U]75U=74U=75
-MU=3555175U155%145%555555U=15U=?7UM;1U]545E=75U15U=75U=74U575
-M55555U975-74U-?6UM'0T-'6UM?7U]515U115E=755145=77T=;4U%545=74
-MU=545555U=?7U-155=75U=75555555145%14U-?4U]34U-155%75U-?7U]?6
-MU]355%145U175554UM/0UM;4U5545U175%555515U=37U-?7U]755515U=75
-MU=555=545%155=37U]34U5555555U=355514U=?4UM;7UM?4U-755%=75U54
-M5-355-?6U]37U]545U=75=74U=35U-1555545U545U155=75U-;6T='7U-55
-M5515U=?4U55455145%15U=7555=75%=75%74U-34U-34U-34U=?3U-74U-75
-M5%575U915E97U=;1T='6T='7U-?4U];6T=;755=65E=75E%04594U=?6UM?7
-MU%55U=34U-?7U-37U]35U=74U5=75U915E=445)7U=36T=;6T='1U]34U-55
-M5555U=74U]3555545-555=5455145U35U]?4U-75U-?7U]34U%545%=5U-34
-MU%5555145%145%55U-?7UU74T=;6T=?5U5145U975U75U=?7U];1UM155%=7
-M5U%15E=45E95U-?1T-#0TM/1T-?4U%75U=77UM;7UU555%=45E!75%=14U;4
-MUM'6T=?5UE56U=?6T=;45-74UM'755=655965E914-?`VDU.U<K79&W>X,'/
-M_,C-_G-L2.*6\&L4T=GS57G:?47$^_Q"9&="V?OOX$9[0WAM6-CZY\WT\E=V
-MW_?WRU]T0TQQ?&5D6M#>P_/PSU52R<C;05+SS%S=W%7&\5UD9$]8<E]71.7W
-M6<'43U?&R<+&R<]%7<=(7T9^3,+*QT-E2$?*__#W5,9`6M59]<GP4W=30$%7
-M1DY9T-=4W=S&QL)57,+975)U=UG65-32W-_=Q51=WU78P%E"U]U644W8V]S:
-MT<!7U5A+3T163<3TV]M16UW&S-'6U5==6]5>4-K/U5I:7M955MG?U%-#T=#4
-MWM'"R%Q!7EE?W-?1VU-=0=;%W])'05_<V5%66UK4W-??T]+8W=C45]S55U1%
-M7M_>UUE5WU705T=&T-U04$595\':WMK2QUY.7E-74]'0W-%6Q]G%VUY>5MC4
-M4EU&4M#34=717EY5QMY645_7U=16W-A5U5E3W=I76-53W=E56D/=Q<740%I8
-MU][>TE765-_0T=+?V]9445%25U-2T]934%Q775Y3U=;9W=70TMM54E!?4]?;
-MT];2TM=45E]=4-=74=31U]144US4U-'77UU4TM#?U-+8WME14EE4UU-26%?5
-MTM36T==47-;<TUQ=5]'3U]+2W=/4T];74UA:65#0UM%44=;5U=744U!75-?2
-MW]!55=/4UM'5U%%17=117-?6WM54U];54U-1TMQ5TM1`<'1#65?0W]K'QL'&
-MQL3%V-G<W=#1U-545U%14U-24E)24E-24U-04%965U=45-75U-74U-?7U]?6
-MU]?7U]37U-?4U-34U=35U-75U=75U5755=55U5755=55U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M__________________________________________________\`````````
-M````````````````````````````````````````````````````````````
-:````````````````````````````````````
-`
-end
diff --git a/share/isdn/2.al.uu b/share/isdn/2.al.uu
deleted file mode 100644
index 2fdae7d..0000000
--- a/share/isdn/2.al.uu
+++ /dev/null
@@ -1,278 +0,0 @@
-# $FreeBSD$
-begin 644 2.al
-MU]?455175U14U=375U;55U145%175U75U]'0T]/0T=?4U5545%175E%15U15
-MU=?6UM564U-045=75E34UM#2W=W=TM#6U-555=5555=65U15U=55U=555U%1
-M5E;4UM?1T-'1T=?7U%75U=545U=45%145U145E915U75U-?7U-34U]34U]?7
-MU];1T=;6U%175E975U=65E35U-37T-+3T-;455175%175U?5U%35T='6T==5
-M5U965E975U=5U=37T=#3T];7U-545E=45%15U=37U]555%=75U965E975%75
-MU-55U=37T='1T='1T='1UU545%15U=35551755575%=65E915E;5UM'0T=#0
-MT-;4U-35U5575U=75%1555145=55U555U=75U=74U]'0T-'4U-155U965E96
-M5U14U=36U];6U-555515U=15U='6T=#6UM?4U%175E%15E175%55U=555=74
-MU];7U-34U575U575U-3555545U555=545U=45%145=37UM;7U]?7U=75U=75
-M5=75U=74U]+0U]'6U-345%145%175U=65E=4U=355=755=75U]?6T=;4U-75
-MU=75U-7555545U=45%74U-555%75U]575%55U=?7U]?7UM34U514551745%6
-M45145555U]?6TMW3T]#7U]=75-1455515511U5=7U5%55535U-=4U-56U-;7
-MU]'3UM'65514U5555U%1453555745U;5U-=55-;4U=77UU77T-#0UM'1UM17
-M45%65E%75U35U-'7U554U=545%7555755=36T=/0UM?4U5175E=45%555555
-MU555U=37UM;6U]?4U-34U-34U5155%%4U%145%=455545E=75-75U=31T-#6
-MU-;6U]5445?5U-?4U=?6UM;55%145%545%914515U=34U]?6UM?755145%14
-M5%15U=36UM?5U-74T-=5U5=65U=55%35U]'1UM34U-555%=45%15U=?6UM?4
-MU55745%65U=55=36UM#3T]#1UM;55%555%145U975-76UM?7U-555%165%15
-MU%57U=;1T-/0T-?5T=51UU!355-6U515UM54U%=655175514U];1T-=75=?0
-MW-_3UE565-7555=04U%65=36T=1175)6U=;6U]34UM+=TM#55=145=545U=6
-M5U7555145U14U-?7U-35U=75U-?7U5545U74U-545U155=75U-355555U=75
-MU=75U-?7UM;6U]34U=55U=35U-?6T-'6U]517UU<7%-15-?6T-+2T-#0UM;1
-MU-545U175%1455155%155%175U=65U15U-?1T-/0T-'6U]3555175%=75U97
-M5%74U-75U=74U55455545U375574U=37U]?6UM;7U5575U=45574U]?6U]?4
-MU-54551745%15U145%74U];7U]75U=74U-?1T=/0UM;6U-755U9645975U96
-M5-77UM#0U%?55%975U=55=755574U]'1T='6U]75U51555545U145%55U=34
-MU-34U55555145%=45%55U-35U-?7U];6U-155%=75555U=77U]?6U%1455%1
-M45%15%77T=#1T-'1UM?7U-?455=45-74U]7555175%=645965%75U-?6T=;6
-MUM?7U]37U-155%175%5555555%975-75U-5555545U=6U-34T-#3T]'6U-75
-MU5165E945=74U]?6U%545U975=35U-37UM?4U=77UM#3T-=55U%34E)34%=5
-MU=74U-?4U]55U575U-34U]?7U]?7T=/7U]145U915E945=74U-?7U-345517
-M5U=45=77U];6U]?4U-?455555575U5545%75U-37U-75U555U=37U-74U-34
-MU]35U=755514555745555U=45%545-75U]'1T-/3T-'1U]55U555U-35U517
-M5E9145%145%65U?5U]'0T]#6U]?1UM?45%145%75U]34U%755%145U=645%0
-M5M?3T='1UM;7U-55U5545%=75U55U5545U965U=4U=37T=;6UM'1UM?7U=75
-MU-?4U-35U5545%175U=45%74U];7U-?455145%74U-34U-?75U945%=75U96
-M5U?5U-34U-;6T=?4U5175%145=76T='1T-#0UM;4U5=65E975E9645=75E=7
-M5575U-?4U]34U]?6T-#3T-;55555U555559555!65E%65U15U=36T-/3T=?7
-MU-555%55U=7555555%=75U=75%555%75U=74U]?6UM;1UM34U-55U575U555
-M55145=555%145575U575U5=7U-37T='1UU?4T-505=-44=?75=76U5?5U%96
-M5U%25E175-?7U=?1UM37T=?7T=95U=3555575E=455=75%545%555=55U-37
-MUM'0T-;1T]/5U-155%175U965U%65U155%75U=75U]?7U]?7UM;6U]?7U-15
-MU=545U=75U!15E=75-74U];6UM;6U-75U=75U-;6T=#0UM155%165U=34516
-M5E145=74U-36UM'0UM=555175=36T=#0T=3555=04%%04%%65U75U=36UM'1
-MT-;7U]34U-34U=75U-34U%555%=65E=75U=75U=5U-+2T-+3T-+0T=;55%=6
-M45%65U=5U55555=65E=75U15U-'0T]/3T]#6U]75U575U5545U9645=65E=4
-MU5555=5555545%74U]?1T-#1U]?75U964%%65U35U-?7U];6U]34U5545U=5
-MU-?7U-35U=34U-35U=34U]34U5575E%75%75U-5555555555U555U=75U]?6
-MUM;6U-?555555U955%!45U15U=35U=?7U-37U=74U=75U-?6U]?45=555%=6
-M5U=75%155%75U-155=75U=35U=31UM?7T=#0T='7U-545E%04U!045=5U=74
-MU5=5U]36UM;0T-'6U-?4U=7555165%145%=65E=65E965-74U]?1T-#3TM#7
-MU=34U5575E=45=35U575U5545U9145=45=77T-#0T]'0UU55U%575515U=34
-MU5545U915E1555545%15U-;1T]/3T-#1U%545U=75%=45%145%=45=74U-?4
-MU-37UM;6U]355=36UM?7U=555%=645%75%924%965=37UM;1T='6U]?4U-15
-M5-37UM'7U]155=555U9645!65U=45574U]?7U]?5U-?4U=75U=75U=34U-34
-M55145U945555U575U]?4U]#7U-;4U-?4U]?4U5545%145U965U175U155575
-M5=55U=34U]?7U];6U];7U=7555175U=75%55U=?7UM;4U5555=74U-37U]?7
-MUM?4U-35459745=5U=37U-55U=5555175%145%15U=77UM;6UM;6U]155517
-M5%1645%75-74U-?6U]155%=45%555%75U-?6T='1UM?7U=355%755-7455=5
-M5%145%35U-34U-?55=75U=555=55U=37UM;1UM545U915E975-75U]?6T=;7
-MU55555145=74U-37U5175U175U155575U=74U-345537T='1UM155574U]34
-MU-75U%5455145U=14%%65%75U-?1T-#3T]'4U5165E94U=54U55555575U=1
-M5]74U];7U575U=77T='0TM/0UE75UU=645!15E=55=35U-?7U-75U=555%17
-M5%74U]?4U-55U=34U]35U=755%=75U74U]34U-34U-75U5545575U-;6U]?4
-MU-75U-35U-37U]57U5575%=15E=75%35U575U=75U-?7UM'6UM;1U]345%17
-M5E%65%15U-34U-37U]?4U=74555555555=35U-75U5555U145%175U=4U=37
-MT]_0T]#6U%545U=65E?7]>9`8,E]?\AQ4LA%U\[6VL'0QL15WME=W=)#Q%%9
-MW-'TV'KBVAW[6VOA<'7C<MCX6O'%4<#ER&;'U&'.2W?W6O#GQ7[41&/!<=_T
-M</'4P\I!RE3`4DW87M#F<&61;&?N%OK":.EEVN%OYE-4SW/WS$GIQ73!>MM_
-M;?!R?/=U\=#$]DGG_7[[PU?=6]9:0=]U2<A(1/1S\$I:^V?]5D7R7\5;S%;'
-MTOKT:>,5>/%N_5)Y[W?,YW#Z]]+;1%+=9,-T7U=<5%S%7U??W<U#T?%U\5-`
-M\D3`7M'6PD!<55C<><1'0?5]\-O?U=;*4U[4=]O>?_ET]<U\],!<VE5"Q<5Q
-MP=/=77[T54WU=\;.=]U2W45:75?8V=Y<R?1V]<-:7%W32M//>O__?/1!YV=Q
-MXA3/_67PQ\E?=^).9^IE<N9DTWS]T&KA1GW`\-52YD9VYU).]]A>=<7T;/?.
-M9>941_91QU5+Y7W1U4Y04UEPS%#%1]'<2_=81=/*2E'Q=/-=6E33U]YV\-UV
-MX'+"_TY;TU==</?%?>%?<?[14V?EQ6?+==M.7EA[Q?%VT?W66_O54?)TPV7!
-MP&CO3&7A=]GPV?Y'5,9^WM9_]%)VY';)]6WD=TY0?^%32?E6PL5VUO1)0-+0
-MTD%'V%U2TWOEQW;R7?!%>>5QPL)\]_%8VU;6Q'!22''P<'OPT5W0W]U?UL96
-MVO+57\S$WG/(4W'.6]]'5O=3TE-1RW1'WTW10T;]6MG:4-Y>5%%TTM-QS=1?
-MT-O*W\7R0=[-0U93V$YQ5==64M/;W-)2W<U2T57264Q104%5=U;:3-I5S\[2
-M]</VW%?$VE!-7D%30UA=7]-'V=G2UEC<W=?35E?<P596P-;55E34075'<797
-M2%U<UL5`PL=!5\G2W<WQ\U7YR/7XW??>T-9:T5-+0%!05]K+]<C\]='?7G)E
-M8VT5%&H4%6]A>4[!]O_O[NGHZ^OGX>7*SU79]L11R\[%W=95]Y"?S?2;D=)P
-M7]<7'A@'!0<#`1@0$!=6X>.4G(6&AX2:FYN5],!481(=%A(<$VIE=5S/XY3L
-MYNKKY\OT]UQ\9'MS2UOJF?KEA)[M\/WG;1`2!`4'`P$'$A,07^7LDYZ$A(2;
-MD)?I5F5@;A<2%FIO9'+8X^GHEY"0E>SLY=%R?,27G5U(A9W49W+_%04;!@4'
-M`P$%%&L60.^6DIR'@X:%G9V1TV-M;1<:&!=K:FIQY.+GX)&<Z^;NZ.=V3>F:
-MA=?.@IC%9'#B%@$&`@8""0T!$!8?<Y6=DIZ#C("'A9N3_W9M:!8%!!P7%A%D
-M]/CDZ)&0E^OL[>;;>4[GF(1U](^%]GO1EA$&!0,'`@@,`Q(1&GCJDI*=@X^`
-MAH6:G_!\;!46!`<<%A<08_+EYNZ4DI#JZNWG]D?#DX"18YJ"Z'X4YD``!@(#
-M`0X-`AIE%A7_G9J3A8^"@829G^Y:;Q84'`<%$VH6%DSXYN#MD).5[./H_W96
-MX)B`^E&"AN)G8I5I`P8-`0((#0T?8!-@YY^%DX>.C8&:F9_F<140%!D'!1-M
-M%Q=1XNCCZIZ2E>[AX=MR=5N6@^UBAHV0<VJ3U0$'`@8`"`,/!V`6%5R3AI*8
-MC(R`FI^>X%]M$A<=!00>8VT7<>24Z.V0DI&7Y/+XWG%G_(::8^.-FO,7S^L>
-M!P8#!@\"`PT68&IE^82%DH:"@X&8GY7R4A<2$!P9!1)@:6);^^CNE9?KE.O_
-MS\577N2&AD?MC8?A%U_K'P$``@`.#0,/'&9@>L^%@9N!C(V`FI_JW4@5&1@8
-M&04>;F%[5>>7EY:0EY;I_<;04'W2A8'"]8&!EV]^ZFL$`0(!#PT`#P1I97E-
-MDH&$AX.-@H29E/'181P8&1P;&A9C>T_,[)26D925ZNW]5G-RTYV&Y5.$@)]]
-M8I58&08"!@(,``\!%F9\9>.'AX6'@(*&F)'[PD@7'AH<$A@=:GA?U/[IEY"4
-MZ)7JX-!U1EC_FYO9XH>'E6E-X&@:```&#`,`#005=$M`EH:&AX:#@X2?[M-!
-M9Q$;!1T3'!-H2\+QX)66D93J[N/DP49R7I*&X%.=AYM%:\A]$`0"``(`!P(#
-M'WC'2O.8@8"!@8.!A9+T=7-L$@<%'1(2$6U0\>/IE9&0ENOGY/C'=&5`E(24
-MTY>:A>1L1'(5'P`#`@,%``,$:,W=Q):%@(.!@8>$F^-`9&-J&`49'!84:'M3
-MX97HZ)20EN+[\<+'1WW7DIKG_I>>G5A]=FL7&`<##`<;!P$;>?/WXI"%@(.!
-MA)F8DOMQ;V@7'!D8'!5M9'/:[Y24E>N4E>#_Q,S`=GGYFYW+X9:>ZG9)8A81
-M&`<,#`48!`<=3OSFE)V%@8.`FIR=E/-[%183'1\9'11F2E+S[967E)7K[>WG
-M]MY-<'/DF);UYY2>[DMU;!46&00-#048&@0<<?'BEY*;AH.#A9V0E?IU:18=
-M'1(<'!-L0-WSYNF6EI?JX^#@^L!*?'];E)+Z]>26DO9'>VII$1P'#088'A@8
-M%4/RE9.<FX>`@9B0Z.;*<FD2'AT3$Q,684?WX>/IEY"0E>WBX?G8=7]F>>.0
-MYL/RZI'YT'9K%181&``!!1\2$A5ZT^N=GIZ8AX::D^_RWDIG%QP?$A$7%6!T
-MSN/HE924EY25[_K,UUAU9V#5Z^WW]OGNX?/-9VH7%Q$%!@0;'1,58'/QEY^8
-MF9N%FIZ1X\E$<V$4$AP=$6IC94CUX^J4E)65E>OC_=!/<7UE8'GZZN#GY>WO
-M^OM38A06%QT%!`49$A=B94;GD9^9F9N;F9R4Y-1W>V\7$AP2%V]E=E7SX^J7
-MD9?KZ.GC\%UP9&9F8WC\Z>+AYN_OY/K79A41%AP%!`48'!9@?5?FEYV>FX6;
-MGI*4YL5*9VL6$!`1%FAD3<+ZX^F4D9:5Z>/\V$5S9V)M;6USX93I[^V5ZN+C
-MQF<4$18<!04$!1X68'E#\NN=F(6%F)Z<D>[W3V%J%!83$Q`584C"^>'NE)&1
-ME^CF\\+63&1B;6)C84W@ZNGI[I7NX.;49A01$!\;&@4;'Q1F<]3[ZY*9A868
-MGY*7[/!%9FH7%A$1%FIB?=GXX^[KE)>4ZN+XQUQ)?F9C8FUB84CAE)7J[NCN
-MXNWU?6L0$Q\8&P4%&Q!C=M[EZ9"9A(>%F)V7[/U29!40$A(1%&AB?-GDZ)>6
-MEY25ZN+R47-F8F]N;F]L8GKTEY.3D924Z>CMTF$1'QD%!04$!!L69E#Z[I:<
-MA8:&AYN3ZN7$=6T6'1X<$Q1O9G?%Y^J6D)"6E>SD]%-_;147%VMB9WAR6>"=
-MF)B?D)7CX_A!;AP%!P8$!`4%&19ER>F0GYN$AH:&A9+N]$EF:Q8='AD<%F)S
-MU_3D[Y>0DY"5Y,992WYC:!07%6-]7M[-^9>>F)J?D>++Q$%F%QD$`0$'&A\3
-M%V!"Y9:>A86%A9J;GY?G7V%J%Q81$!`6:F9$\>;OZ.J4E.KC_=)T9&UN:6AO
-M8F=R7O7EX)6=GIZ<EN[U7'%B%!T8!`<$&!T7;GI#].^6G)F8F)^<DY?L\$1G
-M:144%Q<4%6QD0</YX.WL[.SBY_+%0WAA8V-A9F5]1M[W^?KZ[)&3DI'H^U!(
-M?69O%QT;!1L?$6MC>'3=Y>N1G9^<DI.1E.[[TWUB:6MH:6EN;&9P5?'EYN;G
-MYN;D\L5>2G]D8&-F>W98T,#T__KD[)>1D9?NY=-#<V9L%!`?&!X<$!5B>4G<
-M^>R4D)*=DY"7Z^WZQT]E8VYI;FQC9GAT7\7QY>'AYN3Y]-)%=')Y9F)B9G-;
-MV_3\^N7DYNF7D9:5X,].?F9M:100'!D>'1=L>TE1SN7LE).<G).1ZN/_QUM]
-M9FQN;V!Z=D71VLGQ_?SS],522'UX>GM^?'%/7<3Q^N?GY_K\^NR5E.OC\$%E
-M8&QI:A00'1(0%6%UTLKR^.7A[.N5Z^SG\,;64%M:6D=$6UW0Q</`V]-114U)
-M2G=V<'U_?79,7-W`RO'\^?G^_/CCZ.ON[>7<='IB;FAK%!86%Q5C<E[%]OW]
-M^>3AX^/AY?/.V-95T-[?W=/0T-S8V-[=U%E-2W=Q<7!R?7)W0E+0Q\CT]O;Q
-M\?#^Y.'AYN3RQ5UU?V5G8&QO;F]B9WQ+7M#%PLKS^>7DY?[SR,38V]O8V]_6
-MU%55U-#1UU=>0$Y+2'5T2TM)0D92T\')]/7WY>[JZ^ON_U9(>F-C8&QH:&IJ
-M;65*T?3R],K)R_3W\??)Q]!5UL'S^.7Z_O++QL7<55A.?65D9&5]=4!:65M%
-M4M;8S/7+SLW$V\?-R<OU]/7UR\["Q=)61$IS?WYY>7E^?W)V25M7TMK#S,+"
-MPL+/R<G-Q-C=UM34T=_;VMO;WM/3W=S>WMW445]%1D9>V?3W]/3&7D).=W1(
-M2G!\?GA\=$34QLC)PL'&P\W-PL3=55-?4M'%PLG*R\_-S</#P\746T)U=W1U
-M2DY-24E#15W5T]S<W-#7U]#<V]K9WM_>V,;,R?7(Q]_1U5914E]:04)"1UE=
-M5E=075Y;6UE>7UQ=75!7U-/>VL7$Q=O9W=+0UE507%E97%'4W=O&QL;'Q,3'
-MQ-G=UU!96UE3U]+>V])6645'04196$=-2$M,0%E6UM'1UM?0W\3-R\K/QMG2
-MW=[9V=C9TM=45E15U=555E)?65M;6%E97E]?7%Q<4E?4T=/2TMS<W=+=W-S<
-MW-W2T]/0T-#3UE9375]25M36T=#65%!24U;5U5107UM;6%Y35-31T-;6T='3
-MW=S<TM'45=74T=/<WM_?W-'7U];755=14UU<7UU24U-15%=75=54U=75U%55
-MUM?4U-75U-'3T]/3T-#0T=?4U-355%%34E)1U=;1T-#6U55745975U=645%7
-M5%76T-+2T-'45U-=7%E87U)1U-W9VL?&QL?:V=_3UM1645-=4U-05E=75%=7
-M55905E%=7%Q=4E%75-31T-+2W=W<W-S?TM#1U]55U5575E%15E%15E94U=35
-MU=345515U=15U5575U975U35U-?7UM=55=;4U];6T='1T-;7U=755%555=37
-MU-7555=45U=65U915U75U-37U]37U]?7UM?555145%145%74UM'1UM545E97
-M5U=75%755574U]'1U-'15=34U=555U55U=74U-36T=345515551645%15E35
-MU-?6T-#7U]?4U-545E%645=5U=?7U]34U-55U=555%55U=77UM'1UM;6U]15
-M5E%075)75E?4U=76UM'7U-34U%545=77T-+2TM+3UM1445-=7%)04%%65%34
-MU];1T-'0T==55%555=55U-?7U-34U-555U9645%65E9645=45=?2W=/3T=?7
-MU]34U575U-34U=555-545U=45%=455755=75U=34U555U-?4U]?4U-34U=74
-MUM;7U]?555=65U96459745=45=34UM?4UM;1UE14U%7555545%75U-36UM35
-M55914U!65E=4U-;1T-#3TM/1UM35U5755=545%=45%15U=555%=65U965%14
-M5=36T=;1UM'0T=;4U5555514U]54U%5555545%545U=75U=55555U-37UM;1
-MT=#3T-'7U]?7U-35U5175E965E=75E975E=45=77T=#0T-'1U]545%=65U=5
-M5=74U-34U%565-555=34U-35U-34U]?7UM;7U=555%175E!05E965U74UM;6
-MUM?1T='6UM?7U]34U-34551445!15E965%145=75U=34U];7U];6UM'7U]+1
-MU-?4U5575E975U=45=555%175U555=74U-36UM34U]355=75U-?555545%55
-M5%=4U=755555U-37U-355%75U-?7UM;6UM?7U5155=555E355=545U54U555
-M55555=755%145%15U-;1T=#1U]545U%05E965U355515U=75U-34U=77U]?4
-MU=34U-;1UM35U5575E175E%15E%75-70T='3T-;6UM'6U5165E=75574U]?7
-MUM?4U=755%=65E=75%145U35U]35U-34U]?4U=55U=55U=35U=55U=35U-35
-M5=555%=75U155=365595U515U=76T=;7U]'1UM?7U-555%=145%65=74U-37
-MU]?7U=37U5175U=45-74U-35U5575%145E945%=5U=75U]'0T-'1T=;7U-55
-M5%94UE57U5165-555=36U555U=74U=34U%77U-?6U]?6UM3555145%175=54
-M5-75U=?45%155%745595U514U-;1UM37U]75U-5555=75=575=5655575U57
-M5=?4U-?1U-30T=;4U=355%75553555975U905%54U575U-37UM;5UM/1UM;6
-MU]145-?45%975%145]76U5555U%45%%75%37T]/45=?4U-74T-=55=55U-?5
-MU=5555164594U-?5U='0T=;1UM35551145945%55U=755=37U]#1U]355514
-M5U34U]545U35U=34U=74UM165E755555U5545E-7U535UM?4T='7U];6T-;5
-MU=545-145-75U=575E144E-45U155=?0U-?0UM?1U]?6U-?1UM3455145%94
-M5%965U155577U-?6U-355%=755165-37U=74T=;4UM=45E=45%1455575]?6
-MU-76T=;7U];6UM?6UU545-5175!45%97U=55U5=6U]W3T=;7U-75T=W0U%=7
-M459075?6U]36T=#65534UU5645!455%65=34U-75U-?7U%545=34U%915-'7
-MU=?1T]/1T='7U5165E9645975E?5T-'6UU514%=75U36T];7U-?2TM#1T-/7
-M5E)24E!04E-045;5U]/=TM#1T]+0U]?45U904U%55596U-#75U70TM+255%4
-M45Q<4U!75U!7T=+<WM_=W=/55=545%!3U-/3T=145%5745745U-=7%#5U]?7
-MU=7755?5T]/1UM15U5575-77UM;1T-/755934U;55%=5U=545E%5U]75U]?4
-M55965=37T='6U]?1TM+6T=167%U7U=355U%4U-31UM74UU9275)7U]15U-/<
-MV=[?W-W1U%%34%-24U-24U%75=36T-%45M76T-/0U]144U-75=?6U-?6UM#6
-MU]'75%115E77U517U5115E76T-/75%=65-37U]'45E)?7%/5U-71T-/2T]+<
-MW]+1U5%245-24U-65U15U=74U-;1T=?7T==75]75U5555=34U-;45-555U97
-M5U96U=?6U-?4U]?4UM#1U]1645175%55U]955-74UM#6U=355U%24U?55%55
-MU-'6UM;6UU555U1645955=36UM?4U]575U555%175555U555U=34UM'3T]#1
-MU]755%?5U%17U5575U175]55U5575E35U-'6UM#6U]3455175U175U155%34
-MU]34U5175=55U];6UM'0UM;1U]15555555155%1455545%=15U145%15U];7
-MU]'6U]?4U=?45=55U=3455555%155=37U];1U514U=55U]'6UM?7U=545U17
-M5U=65E%65E;4UM#0UM;7T=#1U-355U355=555%1745%645!75U=5U-37U-31
-MT]+3TM+0T-#6U]1545%14E)05E1455555=77U]3555545U15U=37UM;6T=?5
-MU=555=555=755=77U-555U=65U=75%15U-34U];7U]?5U=555=355-74U-?7
-MU-?4U55745%75E=65E=75=36UM'3T]/3T-?4U-?7U5=05-575E=75=35U-?6
-MT=;6U5175E965E=45%15U-35U=?455145=75U-?6T-+=W=+1U-555U965U15
-M5=75U-3555=645%34E)=4E945=?6T=_=T]S<T]/0T]'6U]?4U]?4U-555U%1
-M4U%6459755545U915E145=37UM;6T='0T-#1UM;6U-55U5545U=75E975E96
-M5U=5U=34U]?6T-#65=?75%545%15U=34U]?4U=755%145U915U74T=;6UM;1
-MT=#6UM145U964%!075U<4E-6U=?6UM;0TMS?WM_<TM'45%=14U)24E)=4%;5
-MU]#<TM#3UM?7U-35U5115E!34%%65574UM#3TM/3T-'7U-545U%14%%65U35
-MU-?7U]34U-34U=545%75U5755555U=55U=55U-35U-?7U-3455?5U-36U]75
-MU-75U-36T=#6UU545U965E=75U145U145=77U];7U-36UM?4UM'6UM155=55
-M5%175%555U175E=45U=4U=35U=555=74U]?1W=/0T];4U%545E945%75U-74
-MU%145U=75555U=75U]'6U]?7U=555U175E15U-?6UM;6U]155U1455555%17
-M5U=75=77UM;1UM?45=5555=05E=15=75U];1T='1U%545U75U-37U-34U-77
-MU]?4U5575U914%!15E=455555=37T=#3T]'1UM74U]34U-?6T=;455904E)=
-M4E-05E96U-/0T=/1UM;6UM'6UM;7U]?7U-3555145U914%!04%%45=37UM#1
-MT=;7UM?6T='6U]35U5545%5555145%=75%145%145575U-?6UM?4U]=55]55
-M5E145%145575U-34U%55U-75U-35U=75U-?7U-?4U=34U];1UM?55U975U14
-MU=74U5545E%65E975=34U];6UM;6U-?7U]34U-75U=?0U-755%145E%14597
-M5%175E=5U-?7UM'1UM;1T='6UM34U5904%!15E745%?5U]36T];45%375%35
-MU]?4UE55U]?7U-555%145U%75=755%31T=;6U-77U%75U=75U%55U=74U%54
-M5U=65E=64%975U74U]?7U]?6UM'6U]?7U]34U-?7U-555%165E9755145%14
-M5%15U=37UM?7U];3W]/2TM;7U%=14%!04U!65E965%175U74U];1T-#0T]+1
-MT=#6U-555U%15E=75E945%145U=75-74U]?7U];6UM;1T=;55-555%555535
-M55915%165%75U-?4U5545=34U];6U];7UM?7U%5555145%545U145%=65E97
-M5=74UM;4U-;6T='1UM;6U-75551455145U=75%=65E=75U=6U-/6T=#0T-#0
-MT=;7U575U575U5=75E=65U965-5555755=75U];6T=;6U]34U-1555175%=6
-M5E155=75U-3555545%155=75U-36UM'6T-94451745965-34U];6UM;7U]35
-MU-74U5545%=65E=75=74U%555555U=36U-34U=34U-?7U-355%15U5555517
-M5-75U-?7UM;7U]155=545]36U5555%5745=75575U-36UM;6UM'6T=#1UM;4
-MU5555%1445!045%65%75U=555575U-?7U];6UM'0T='7UM1555164%!64597
-M5%5555555E;55=77U];0T-#0T=;4U5545U75U-?4U-555%1645975%165U35
-MU-;1UM'6U]755=74U]74U-34U-75555555545U=75-74U-?6UM34U-77UM75
-MU-545E965U14U=7555175U75U-?6T=#1T-'1T=;7U=75U55455545U964%!1
-M5E=45=74U];7U]'0T-'6UM;6T-'7U5575E%15E7555%05%97U=77U];7U-55
-MU=75U5755575U=74U]34U-545U=45%145U35U-;6UM;7UM?7UM;45%175E15
-MU=75U=75U=75U=75U-34U5545%=4U]=5U]355%145%?55=77U];6U]?7U]35
-M5%965E=45=755515U-37UM?6UM?6UM;4U%575E=5U=545E=45U965E914%94
-MUM#0T-/=TM/3T-=45=15U=545=545%=75U975U=5U-?6U]34U-75U-3455=1
-M5E=45U%7U5575]30T-#=W=#3T]%55U945%!65]555=?555945%=445545=;0
-MW]_2U-=54U?:VW)U\\]A$5V5VE3L^];D711@_)V6:!YMEY=]%V/E_M9\RN1X
-M%FC@E);L8F%656%K>%/NE>;^4USP]W-S4E=`2D=90&!XW_7Q\OO;=GM:SMU3
-M=\#FX?S"]][<=F%I9-1>2$+`_^16=,A:Q?G+T'!4UM)97L7!WWQXP_+)UF=\
-M4]/\P\E51-A`QEA0]L+'25_2=%752UI,WM;?RL;]Q])64MA=07-P25#;75?>
-MP,'9V];5TM57<'#4\\W!4%'SP-Y.5=!"14Q-3U%=TO#V]L1<<$'26T1?T%?<
-M54[5]?;-UG15VE-#=L[8UE-&S=+'T-#.7ME>='=-S]?0V%+>U]/<U]9:5,';
-MW49?4EW!TM/51U/7VU5$75'1UE]/UL[!7U7%TMO624+5QL346T9=QMK4T5?'
-MUT)/25];5MS9S=C8QL;&UT%%TM]>4T5&V<;3U=U77UY0Q=9:05;3T]?5PL?:
-M5$'4TM5:0%C5R-I;0%',S-!=2UG15]W74-;4V-!5T]S`UUY94-5<65#7Q=%0
-M55!245?77-C<4M#2Q]Q44EM45%#65=?6TE117=74U-Y7T]'5T==66%_4T=C7
-M7%574%'1U-;0Q-)<6U+;UEU'7=_&P==45]904M%4U%Y64];24-;2W-;7W-11
-M7T%:4-G:W-+5T-_755986%U14-/<T][5U]/=U%U04%->4E935-W8V]'1WM1=
-M15M7T-W1U][<W='45U)=7%!=5M==5M#3U-?0W-C57E?7U5)0U=';T%'3W=10
-M4EU75%)<5-!55EU35=W:T]'3W=16T=#0U%U55-35U=1!<'5#6%;6W-C$Q\;'
-MQ\7:V-[<W=#1U]155%=645!04%-34U!34%!04%%65U=45%55U=74U-34U]?7
-MU]?7U]37U-34U-34U-34U-74U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75________________________________________________________
-#____
-`
-end
diff --git a/share/isdn/3.al.uu b/share/isdn/3.al.uu
deleted file mode 100644
index 5b8b56c..0000000
--- a/share/isdn/3.al.uu
+++ /dev/null
@@ -1,323 +0,0 @@
-# $FreeBSD$
-begin 644 3.al
-MU=755537UE1555=75E=75%145%75U-?1UM;1UM;7U-555%=75U=75575U=?7
-MU]?7U]355%545%155%15U-?7UM;1T=?4U-5555175E965E=45=?0T]?4UM55
-M5%=45%=5U=;0W=+3UM145E%15E!145=45%555%=75U74U-77T=#0T=;6UM?6
-MU]34U-545U145=77U-355%=645%75U15U=74U]?6T]#4U]545%74U];1T=?4
-MU5145U914%%75574U-34U]'1UM?4U51145945=74UM;6UM?455=645%15E=5
-MUM/2TM+3T=?6U]?7UU5445)24U%05]?4U-?4U555U=37U-35U574UM'3T]'1
-MU]35U5575U975%=755145U145%555=555=74U-34U-74U]34U-?6T='6U]15
-M55175E965-77UM#65%1745965E94U=37UM'3TM/1UU5555545U145%75U-?4
-MU=555U915U=4U=?6UM;6U]?4U5145%175E%65U=5U=74U-'0T-/1T=;5U=75
-M5U77U-35U5545E9145?5U=?7U]3555=14%%4U-;3W=W2T-=55%=75E145%14
-M5%77T=;4U5545%145U=65E975=?1T]/3T-?5551745=45-?3T-37U%545E%1
-M4515U=37UM;6U]355%145%545=74U5555%35U]?6U]?7U]3555545%15U=37
-MU-?7U]?7U55455175%=65E145%75U=34U%74U%145-75U];6T=#1T=?7U]15
-M555555575U=75U915E35U-?1UM?7U]?7U]?7U]?1UM?7U-34U55745!14594
-M5%1555545U15U-?1T-;1TM;5U5755=75U=545%145U975%=75%155535U-'3
-MW=S3T-'7U5545E!04U!65M74U]?555155515U=?6T-/3T]#1U];7U5175U93
-M4U!15U=6U=34U];4U=555%75U=555=34U-?4U-37U-75U%5455175E%65%75
-MU]?7UM;4U5545U74U-;1T='0T=?455155%=75U145%55U=555555U-'4U-?5
-MU=555%175U15U]?6T=155%=45=3555145-75U-?4U-34U575U=34U-34U-34
-MU-3555145%175U=45=74U-77UM#3T]'6U]34U-145E145U555=37U5174%)2
-M4U%15E15U-;1T]/3T-/0UM?5U=545575U=3555=55=77U]5445%05E=75-77
-MT=;4U-35U-?6U]?7U=75U=755=3655=55=75U=555-5555145=75U-?6UM?4
-MU5545U=75%15U=74U-75U=74U-755%175U15U=?7U]?7UM;6UM'6UM355517
-M5U=45%75U5755U9455155575U-'0T-#1UU545%145%145%145U=55%=65E35
-MU=36T=#1UM34U%55U=37U-37U-37U]=55U%145975E=5U-37UM;6UM;7U-76
-MT=35U]55555455555%55551555175%75U=34T=#3T-'455175E975-74U-75
-M5%75U5545%75U=75U=75U=75U-?6T-#1UM34U-555U9455%1555555145%54
-M5=37UM;7U]?7UM'0T-#6U-545E%145%65U975%35U-36U]?45%=75U355=37
-MU]'0T-#1T=?55%915U=65U155555U-?4U]=75-74U-34U-755554U=36T=;4
-MU55555545U=65E=4U=?7U]3455175=74UM;0T]'6U]545U75U5545%175%57
-M5U=45574U];6UM#0T-=75E545%545%35U-;6UM?45U9145%7U=34UM?7U-75
-M5%175U55U-37U-?4U]?6U-?6UM?55%%045%65U35U=37U-?7U]?4U-?7UU55
-MU-34U-'155555=5555=65U=75U=75%75U=?7U-35U]'1T=;1T-;7U5545U=6
-M5U=75U5555545U=75=77UM'1T-/0UM?4U5175U=455145%=145=45E?7U=37
-MU]?6U]37T='3TM/0UU575E915E975U=45%75U5545U975=71T]+3T=?4U=75
-M5=555575U-155E975E=45U145%75U-;1T]/2UM36UU1555175U965]77T=#0
-MUM545U%15U145U=5U=74T='3T-'6U%565]55U=75551555545%175%=75=74
-MU]'0T-/3T=?55%175-74UM'0T51455%15E975%155%145=55U=34UM'0T-#0
-MT=?555145E!14595U=34U=755=75U]?4U575U535U=?6UM'0T=?4U5175E%0
-M45%15E35U]?7T-'7U]?4U]?4U=75U-34U=74U]3555175E965E965%75U=55
-MU=37U=74U5145=37UM'6U-?7U]?7U]1555=45%155%975%=75%15U-74UM=4
-M5=34U]'6U]?4U]'1UM;45%904%!15E975=74U];1T='6UM;4U5545U15U=74
-MU-34U5555E%15U=75U14U-;1T]+2T]'6U-5745!04%%65='1U];7U]35U554
-M5%975%55U-;1T='1T='755165E=75%175U=75]74U-?7U-35U=35U=74U]?7
-MU]37U-555575U=555%=65%55U=75U-?55E745575U=?7U]?7UM;6UM?55514
-M5%=65U145%355%145%155=77U-?7U]?4U-77UM;6U]35U5545U=15E=55555
-M5%145%75UM'1T='1UM'0UU555U=75=75U=37U%175E975U145%145%34UM;1
-MT-#1U]3555=75U14U=75U5555%74U-?7U]=55%=75%75U-;6T=;6U]375=75
-M55145U%45%965U=455555%965U34U-;6T]+2T]+3T-'755=65E%65U155557
-M5%145%=75U=75=74UM#0T]+2T-;555=645975%965E965U155574T-=5U]?6
-MT='0UM?755145%75U-3555555%=65E=75E75U-?6UM;7UM?6U]155U975U=5
-MU=?1T]/0UM;7U-545E%05E975%77U]?6UM?5U51655175=37T]W<W=#54UQ<
-M75U=75)6U-+<W=/6U]?1T-?4U-77UM?55575U];7U5145%155%=65E=75U=4
-M5=37UM;6T='1UM155%=145%15-15U=?4U-74U=755%175E975=?1T=;1T-#0
-MT=;45%914%!15E145%74U]?7U]555575U=76T=#6U-74U-37U-7555=75=34
-MU=5555175-564%155%555=?6T='1T-;7U-?6U]?455545%175U145U975E-1
-M5E=75]75U];6T='1T-'0T=/0UM?4U-575E%04UU245=4U=31T-'1T='55=?0
-MU=74U=155575U-355%574%975U915U=5U-;2W=W3T==555175574U=545554
-M5%74U-545%7555=455555=77UM'1T='6U-35U-545%755E'5U=7455545%14
-M5555U-37U]?7U=37U-?7U5555%75555555545=75U=75U5545515U=75U=35
-M5554U=?1T=;455175E975-75U=?4U-30T]37U-74U5545%=45U=5U-75UM'1
-MT=?55%965U35U-;1T=?7U]155%=75E%145945=37T=;6T='55535U=745596
-M55175535U-?0UM;1UM55UU115%75U-37UM?45=555U914%%65U=5U-?7U]36
-MT='1U];455145-74U=36UM;755904%%65E75U=75U555555555555-35U=77
-MUM?7T-#4U];7UM155U=75U%14%-15=74U];6T=/3T]#1UU575U945%77U]34
-MU=5745%04%975=75U=34U-36T=#0UM3455555555U5575%145=575-;4U-34
-MU=55U=75U-34U];7U-5555175%545%145%1745975%55U=?1T='1T-#6U];4
-MU-74UM'6U]155%=04U-15E=75E?5U=;1T=;7U]'655555-75U-5555145U75
-MU=34U5165U=75=74U]?1T=#1U]355%9145145U15U-?6U]7555555%975-77
-MT=#3TM+2T]'45%9145965U144%%75E975-75U-37UM37U]?7UM;6UM'6U=35
-MU=555%74U-755%115E%45=76UM505]555=?1U%54U=77U='2T]=55%!34594
-M5574UM'4UU75U-)71E9<5E=7U-3<T]W1T]/2T-'7UU745E904U%75U155%15
-MU]9445=5U];7U-77T=?7UM#1U-?75%%145%75U545%75U%14U=76T-#1U]37
-MUM76UE96U-'3W/'[W$1A84)]6$+4V,W"QL?#R\??WL764%975%)<7U#74]!4
-MT%%155;4T=;05U14TU34U%%05U%4U%374%704592U=72T]#<W]-4T%54U%=4
-M4%?4W]94U5=55]=64%54TM165571W=114%51U-=4U=305%)4U%9%UMK3V]15
-M7U;77-W0U]%2TM;255M4T]I=45-:4EU2U-[<V=[?TU]25,745U%>V=?2W-O4
-MW5)25T=70U950<=;V%+3TM3=U][#W=9?TEA"4$/"3U117,K,P-)5TD/65%55
-MUM1!U5)34]G67=]77]/2U-_2W]=>7M57555'6-S9V%E?VU]6P=_U7U!35,;4
-M6GU%7\#:6O%9\?9>]73=7E'/</5Q2M%X\$I7P$+_P,#Q4,A!T%AX5']!4]#*
-M4-W<P</7SM5755#44M7=1=-3V]!&1EW$==)U4?3"S-#'UO906TEVP$E-ST'W
-MS'WR3M?U=_%;6_]4P-=U2EI;WE%/V4/2R4/1QE?]P%/:3D14>5K85<99W?W.
-M\-37S-K=W'5Y6'_=4W#&0-?_W-7(34+.=E3>>=G?6?#!T?/=T]78?-C2>,Y>
-M><O16>10W.;?1=5/<%-%8U3;3_#-0L;\2MKR2=_/0T'"VT_*QGSTUWO.WGC>
-M]'52\TQ5_71<]T!3PD92RDA=^T]+\-!TP%YWSDI=U5G&V]=$Q]M:P%=55]/=
-MV\%`U,Q+1MM0T])<TMQ3TEQ87%K?U%W<V<?>7]E=4590WW;5W%#6W5-=S591
-MQ]!;W\185U#54%G5V437QM135-%<UTS<]G76]EA%5]W?Q-+!5UQ7V5Y(64'$
-M4=?P4%U5T=!WUU+9P%I4U%M!W<%25%?>P%3'V-A765]1T]5&TEQ-5%M0T\?>
-MQMA$4E]74U7+UM7&W5A<U]%?4=[?0D7'5]=05,Q#?5W-QT36_=Q.W\K26U/=
-MU-5>6U980-/.4UY!P,I%7];"05GRWT5VP/!>TUIW6==,U?=55=K4P-I;6L7;
-M=$E%5]Y0P,W;U]?05E%0TL791'70Q-AV<L;*5TA0\<])2-/XSG/7S=531D1!
-M54%6S\?-55I=U%7=457?]<Q,05?=05S$QM)*U,=$0T-1WE/:V]#0W,]T=?W"
-M141>4=;125+!V=9'4E=2]OW$U%+=5==?=5I/UU+=R%9(0]C,4%K:SM_;V-S'
-M74U.1D%:0M777=W)\??26-?!W5]/1%E;55-51$/2]</<WM#3Q-O=7D-'U-S7
-M07=8T-12U='>UU7&P]=<U-?#W%I>U-Q%0=3%V5-?7-WUQ%);T--27EM85M34
-M5]3)P%-'6][$T-9?7=?17T]2V]50T=[%VM!45EA3T5W01$O7QM]<QLO9U%3:
-M5TA/UL31T=C`W%%?U]!?2W9;5U)75%73R_'-UU37U=555%!<7%-?4M?55537
-MW\?<4%M85M+?U5'44%39W%17U=76TM%04M3=T==5UE1:1%W7W]S54ES4W]+5
-M5E755=%57EM7W-S6U-/=TM14U-/;V=-37U31U41"4M/<U]?2T-%54=?255!0
-MU]-445116%Y7TMG3T593U=174U'1T-?5U-W2TM_<WM=35=/1U5934EU>04)9
-M5]?1T]O%WU==5]#<UU!05MS9W-/45%Q94='05%]=UMC%V]W3T-955-954UU2
-MU-S:WU507%U24%!=4E-7U-=74E36W=[9V=)44EQ<4%-?6$1:6%]27ES7Q<_*
-MS<?=U]54T=_=U%37VLG.Q]W6T-/155U865/6Q,KS_?+TPMK244)\9FUN:6AH
-M:6]@>4W<\.?B[.[I[^+G_,_<5U-45%32Q<39V=O:P<7?T59927!_<=CBEY3F
-MT71-U]1P;Q$='1,0%Q5L9G)1_^F6DY.0DYV=D.KEWG1D;6L4%A$6%6!Q5,K^
-MYNWO[.#E_<1&?7A_=T)"3TQ&7=/YEH6$GN_>7\+Q4VX>!`<$&AD?$Q=N?,SN
-MDIB;GI^>F9^1X--[;VH4%A`3$!=B=<WEX.SIE9>7Z^#T1WEG9V=G9F%D>';!
-ME(6&A9?RS^7@RF,>!P8'!`48'A(68]?OG9F9GIB$AH2=XL9,?F,5$!P>'Q,5
-M9478]?KOEI.3E^[D]-9-?61C;FMI;6=%[)B&A)/BY^F5Y'\2!`8&!P<$!1@<
-M%''GD)^<G)B'@(&:E/[21GUM%A\:!1D18G),7\S@EIV=D)7B^O3237IL%104
-M;GOSDH>$G>GLEI/H1!8:!`<'!@8'!`429OV4D)&3F8:#@X>=[//'5G)H'1H%
-M&1,5;V-D1_Z5DIV3E.COXOK??VQJ%6EB9D/LF(29E^R5D.K1:AX%!`8!`0<$
-M!1QLS.N6D9*;@8*#AYSH^\A5>10>!1H?$!<5;WO1YI20DY:5Z^CL^%QG;&QC
-M8&%DQ)"$A9/NZ9"0Y6$2&P0'`0`!!@8;%5_AZY23A8&"@X:8D.OGR7`4&048
-M'!(=$A1EV>?IE):1D9&7[/98<'AG;6AK;'#@FH:;E.B2FI+4$1@;!08"#`T"
-M!Q-ZW?;FD(>"@H"&A)J=Z/5X%Q\>'AX;&A\5?=;UY.N0G9R2E.+Y]==S;145
-M;F55ZIJ%D)62FIG[:Q,0'`<-#PP"`1L79D+YDX>#@(&`@H"8[LE-9A<?!0<$
-M&Q,5;V94X)>1D9"3D>KA]EU^86!B:&AZ_IZ!FY21A8>3<!`6%@4""`@,`P<>
-M$6W`DX>!AX&,B8*;E>?V=A<8!`0%&1\<$63WXNWND)F9D>_@Y,-V86]I:6Y@
-M6Y6'AY"0A(&>4Q1L;1L,"PX-`@(''&G>EYB%AX*(B8"9G9#D8!T9&`4'!QL2
-M:WW>_^^0GI^3EI;J_4]]>6-K%&]9E86>XY&`@)9[8,-\!PD/`0`.#@83;4'D
-MEIN!C8R`AH&$E%%E9A0:!@4>'Q\19-CYXY61G9^3E>+G\D9F8V9A9UOHFY+A
-MG(&8Y7A<SQ`"`@$!#`D`'A)K7.V=A8&#@X.#AY/B\$)J'A@>&P48$&EF3//M
-ME9:1D):4Z?O>5T1[8'C+EY^5^YB!D55T\-<:`@<%``D/!!T=%TOMDIB%@8V-
-MAIN>D^9S:140&P4;'QP3;DC:\>"7DI"4E)7M\55&379S5Y6;Z/>%ANG;WN=V
-M!`<%!@(.#008'Q%^[)"0FH.,@X6'AY;R4G%N'AL>'AD8'6US2<3@EY?JEI"4
-MX_;V\%IRUY6>[M&8@>#?\^=8&`49!`$/#`0;!1A@X>/CF8"`@8>!AIWL\L5\
-M$!X='QH%'&IH8U[[[.^5D)&4[^/L]E[5SN*7E/"7A^+$X_)0%AP=!`<"#0<$
-M!QAI5]GRDX2'AX&`@9N3E.%<;!46'@4;'AP=%'A$V?_NEY>7EY>5X?C]PO/B
-MEY7VD9CT^>=60Q<2'`4$`@,:!P0<;G75YY&9AX>$@8>9DY7C4&5C%A(?&!P<
-M$Q5C=5?Q[>B4E)>6ZN_LY>"7G.['F))-X=YU=!P>&1L'#`<;!AH28D79X9":
-MA)N'@9N?G93AU'-F:!$>'1`<$Q5@>W?.Y>#IZ)26[N/LX?_@DY+\[(3G]^UR
-MVV<9'1X%`P,;!P0>$WY3W.*=FIZ:@828GY"7YU9U>6@3$A`='!%J8F9VPOGG
-MXNJ6Z^N4[.^1G9WOEYKEY>5YU!0;'`4&`@`$`009%GQ-QI69FYF'@(2:F9*7
-M^E9#9!<2$Q(>'Q`5;V-*]?WE[)66ZNF4[^Z7GYSFDH7WZ?AX\189$@4'#0`'
-M`04:%G)]Q)2?GIN&@82%F9R7_]Y<9Q<0$!(?'!$5:VQ)VO7\X)>5[I>4Z)6=
-MFI3LAY?[EG_-7AH3&00`#08`!@0;8F5]^I&9F9J`@82:F)[J\,=-8!$2$Q\9
-M'Q`5%6%%V_#DZ93HE9?J[^B2F)?GFIS.E=56QQD2$@0!`@<&`00;;V=D\Y:<
-MG9J&AH2:FY[K^/949A07$1T>'!$7%&)T5\7YXNKKZ9>4[NJ1F9+GF)G.E]A-
-M\1\2$`0'`@8&`00%:F9GR.N2G)F&AH2:FYZ4YO/>>!47%AT>'1`6%VQS6-SR
-MXNOHZI>4ZNN0FY+EFYC"E]A"^1X2$`0'`@8&`00%:F)@R.F3G)Z&@86%A9F7
-MX.79?FL4%QP>'1,1$6E_2M7RX.CHZ):4Z.Z4GY[BZX?@_I5XY68:;AD'`0`$
-M`08$'6UK0N:5G)R%@82%A9N=Z^#_1&%J%!`9'QT2$!=C?T[$Y.#NE.B6E.^5
-MZ)V9YI6$^^659^=F&&,8!`8`!0$'!1UN%4WE[)*=FH:$A(2;G)3L_EEE:143
-M'QP<'1,78F1USN7BZ)64EY7HZ>R4G93\GI+7EME:Y1\5%`0%``<'`00;%!1B
-M].?JDIZ$AX6%A)Z0E^/Q0&9L%QT<'1\=$!5M9$GUY.;HEY64E.KOX.*6DO[G
-MA?+_ZF'C9!EZ'AL$!A@'!!H0:!1,_.:7DYB%A9N%FY.6Z.7>?&!K$!T='1T3
-M%&QG=\;^X>WJEY64E>WLY^*3E=Z0DEN5Q7?C'15M!1D&!1H'&AD5%6W&_NZ4
-MG9N;A9B%F9:6[_#4?&<5$!`2$AT0:VYF3</^Y^^4EY7HE>GE^^:5D=#EA5G]
-MZ6+N;QU`'A\:!1P$&AX7:!5%]>7OE)Z9GIB;F)"6ZN7-=7]C%A86$!,1:VQ@
-M<=#U_^'LZ^CME>[E^O[F[I70[IEYZ.%@ZA85=1H2&QL?!!D<%!1H7=/^[Y><
-MG)F8F)Z3D>OD]UI\8Q07$1,0%A5N8711SN7@[^KKZ.GNY?_]S^[K4.6<4/_I
-M9NYD$=`=$AT:$P4;'!85%'91PN;IG9*3FIF<G)&6XO/.0V1H%103$Q84:&QR
-M7='SY>+O[>CO[>;Y\MO1P^SG>9:7?I'1TI413'4=%!D2'04>'100:4I.S_GK
-MDI&=FYB<DI*4XOS&1&%I:!<0$!=J:V!V6]WWX>#@Z>+MX_[[RU56U>?B?>&?
-M?^GL?)!B8?,2%1,<$`4>'!$1%GUS4O_CD)"3FYJ<G)^6Z^?QWGMM;A00$Q84
-M%6YX3UK/Y>#CX^_MY^7^]E9:4'?PZ7/]F$WOD7R306SZ%A06&1,%&QD2$!!E
-M?EO\YI&2DIN%FY^>D^OB]M]];FX4$Q,0%Q1H975?S/CFX>/MX.3D\\;$6TI$
-M</B59.^:<)/K0YYC>/T3:AT>$@4;&1`2%G]RV?[LDI"?FYB:G)V0[.?-7GYN
-M:1<1$1$5%6Q_=%+`_>3DX>'FY?WQS%127$AVS93-1(7F\YYWEN46^FX0%AL3
-M&`49$Q839'5<_^>6DY"8F9Z>DI.5Y_S8=F%L:!<6%A05:&9P2]3+_?CEX>3Z
-M^O/WS=/3UTE8S.[D<9Z569_5X.\7]WH0%!X1&1L<$Q0084]T]/CKD9><F9F=
-MDY^5X.#`4WMB8Q01%Q<4%&UE>T/0]_S_X.'DY.7EP\_S5U=:=<WKP'.:YUJ9
-M=.[F$>5A$&H=%AD>$Q$4$7Q"=/[EZI:5G)^0D).7[>;^VW5D9VP4%6MH;V)]
-M3DS>]O'P___Q]<#)Q5??5%Y=6$+>Z^!$F9#7F?+GE17'?Q(7'A(8&QP=%Q%F
-M1DGXX)63D9R?GY.1D>/Y]D9W8&]L%!5K;F-G=%#1RO_E^/CX]<'71D%P=G=_
-M0D]SRI3LVYN9]9KI[99OP74<$1D>!009'A$38%EU_NV4DI"?GIR0D9?E_<Y-
-M<&)C;15L8F%[<E#?Q/'^__#Q]]-=1W9P?G])<G=75^"5]9>:Y9&3^Y5?=E`7
-M$!,<&1L<'184;%A'RNGME9*6D9.5E.CZ_?1>=W9D9F=@>'A^1T=7V]C,S,#'
-MTE)!3'%P<'9.35O6WO3A[..4ENN5[^/[T4!Y;Q<1$QP=$Q$5;F1.4<OEXNB5
-ME)>4ZNGB_O3<1$A\>7AE>7QV25K7W,'-PLS8T-5%3$MW=G!T3T[4^^+TZIWX
-MEY?XZ5984V@5%Q82$A<1:VQF7D?`Y.?L[^CJ[^WLYO/QR=)$0T%V<W9(2W59
-M5U35T<71U=)31$U)='=+3%I95<;`R_[GY>;BY.3X]LG40'=Y9F)B;VQC8&5^
-M=EA0W\S.\//S_?'V]<C,V\3;T=/0T=36TM70TM?>V=W:VM_>T%1=6%Q2U<A7
-MQ^13]_]9PD)T2&1D86=@8'YE<$U:Q,'W^?GZ^_KY\O#(P]G3TU1655555='0
-MT]S<W=%75%U$04EW<7-R<W%T3T5=T\7-]_'P\O/P\?7)P]K>T%5265E%1UM:
-M1UA?7E)14%165]565U==75Y96T1'1D587EQ15=;2WMK'Q,'`QL?$Q<78VL3$
-MQ<?'V-C<T-105E==4=5>7U%814%#3$E(=4IU2T%&6U'5T]O`S<W-SL[`P</>
-MW=S0T];4T-;6UM;75=;45%575E-24U]?65Y<7U%5U='3W-S=WM_2T=754%-2
-M7%)=4E%7U-;3T]/<W-+2T=?45E937%]91$-%6UM25]?2W-O:Q,;&QL;$V][<
-MT-'6U-545U975%755]775%554%!27U];1$=$1$1;6%A<4%?5T=[8VL3&QL3%
-MV][2TM#6T-'4U5=14U-7U=77UM;6T-#6T='7U5914%-=75!04U!15%55U]15
-MU-15U-564%U<65E<4E%65];1TMW<W-W?V=G9V]K:Q=G?W=;55U%27%]>7E)3
-M4577U=37UM?5UU514%Q?65A?65Y<4U94UM+<WM[>W]W2TM/3TM+3TM/2TM/1
-MU]3555=645=14U-375]?7%]<4U%7U=?0T]+2TM/3T]'6U]755575T=/7U]14
-M55575E904%!05E=5U=37U-555%15U-;6T-/3W=W3T]#1UM3555=65E904%%7
-M5U=45575U5555515U-34UM?4U=74U-36UM1455514%175E145%54U=37UM;1
-MT=#3T-'6T='1T=;7U-37555745%34E)34EU345=45=77UM?7U]?7U]?7U]75
-MUM;6T=#=W]_<T];45%904EU=4E36U]#3T-#6U-564%!04U)34%965U145=75
-MU]?6UM?45=74U]'2W-[>V=_=T=?4U55455545%175E%14%!05E%04%!24E)3
-M4595U-;6T-+<T]/?W=/0T=#1UM'1U]155U=45%75U-545E%34E)34U!65=36
-MT]/0T]'7U575555555545=55U=75U-35U-37U]?4U]?7U=34U55745%145#5
-MU%35U=77U]55U=75U=75U=74U];6UM?4U-35U-35U=?4U574U5175E975%17
-M5]77U];1UM?7U];6U]?4U5=75%975=74U];7U-545U=65E-35U95UM;0T-;7
-MU-74UM'1T=;7U555551455175%175U=75U175U15U=?6T=#0T-#6U%545U%1
-M5E=75U35U-;6UM?455=65E=4U=37UM?0W-+6U]545E965U=75U5555755U97
-M5-75U-?6UM'6UM?4U=155=75U=75U-34U-145U=75U155574U-37T-'6U%16
-M5E=75=37UM;6U]?4UM165E=04%%15]74U];1UM;7U]?4U-?7U]?7U]355575
-M55555%175E%65E975%74U-75U554U-?6UM37U-37U];6U-555U145U=75%55
-MU=15U]/3T=#1U]?55%15U5545%965E%15E?5U=37U]?4U5545%155574U-;1
-MT='7U];6UM1555145%=75U=455575]74U-74U-75U=37UM'1UM'75%155%17
-M5U=45=75U=7555555%75U=34U]?6UM?6U]35U=55U-355575U=75U-155%=6
-M45%65E=4U=?4U-35U=74U-?6U]?4U-35U=555-30UU555U=45555U-37U]15
-M5%145%155%75U=?1T]/3T-'7U5165E965E35U=75U555U51555145]74U]?6
-MU]34U-35U-?4U5755575U51645U15574UM;7U-;6T=;7U]37UM;7U-37U555
-M5%=145%15E=45%75U-34U]?6UM;6U]?4U-?4U51645%75%155%175U=4U-34
-MU];7U-?1UM;1TM?5U5115E=75U1555555%75U=75U554U=37U]34U-34U-34
-MU-75U5575U975%545%15U-34U=75U=?1T-/3T-955%=645%65U77U];7U%10
-M5U145%=4U=74U-37U]?6T='7U]545U9645975=75U=75U=75555555175=75
-MU-34U%145U145=36UM'1T='0T=?4551645!045965U75UM+6UM'45555U-37
-MU]37U]755%145E=75U=4U=35U=355575U=34U]?7UM;6UM;6U-555%=64597
-M5%75U=37U]345555U=34U-?7U-35U-?45=?7U-7555145U=75-5555=75U=5
-M55755574U=34U-?7T='1T='1UM;7U51745945U=455555%15U5545%=45575
-MU]?1T=;7U]?7U-34U=?65%3555555%175U=5U=74557555155=55U-?6U];6
-MUM?4U5575E975U14U=34U]?6T='0T=?45%145%55U=34U]?4U%545U%15U14
-M5=345%?4U-31T='1UM'1U]?7U-355575U=555E%04U975=;45=36U=76U%11
-M5M34U-;3T=;1U]7555=65E%04U975]77U-75U-?7T='6U]345%31TM'1UM15
-M55545U=65%=645975%74U-;1T='6U]355514U=37UM;4U5574%!045!15U75
-MU]'0T]/0T=?55575U=74U];6U-555%145U9755=7U-34U]37U%555%155=74
-MU]?4U-?4U-555%=65E15U=?6UM?4U-55551455545%75U575U-74U-34U-?6
-MU]34U=35U=75U-5455=65E!35%565-55U];6UM?6UM'6T='7U]34U-35U555
-M55=65E=75E=75-755554U=37UM#0T=;7U%575U145%=5U=74U-34U%75U=55
-M55155=74U-145-?55=74U-?6U-545U=75U55U=37U];1T='1UU545%14U555
-MU=555=5555145%545%74U-34U-77U]77U]155%155575U-35U5575%55U=;6
-M5%555U35U-?7U]?5U=35U=555=74T=;6UM;75555U-3555575U975%=45%=6
-M5U145=36T='7U]?7U-34U=74U-35U-;0UM=55%934%!34E#5U=77U-?7U];4
-MU=34U-545515U=355=74U]?6UM355=755=75U=75U5555=755=74U]34U%75
-MU5555%145%145575U-34U-34U5555%70T-?1UM35U55555=75U=75-55U=75
-MU5545U=4U=75U-?6T='6T]/0T-#6U-355%9645%65E975U=75%175%155=77
-MT=/2TM+0T]#6U%1745Q=4%%75=755=75U=55U515U=74U]?4U-?4U51645=4
-M5=75U-34U=74U%555U=75%74T=#0T-'7UM145U=75U145%75U-75U=75U-35
-MU%15UM?5U]35U-34U=74U=5555145%75U5555%965U35U-?1UM;0T=?555=1
-M5E=5U-36UM?7U-3555145=75U-?6UM?555145U=75%55U-;1T==75-54U=75
-MU-?7U-75U5=64%975=?0T-'1UM34U5545E975E945=74U]?7U-155U=75U74
-MU]?7U=34U=74U-355=75U=75U=555%175U55U-/1U]=55U9645!05E34UM#0
-MT-#1T=;7U-155%35U-?7U5145U=45%975U965U175]75U=34UM?4U]34U]?7
-MU]?7U-355%555%175U35U=544%95U=37UM'0T-#1T=;7U5=75%145U54U=34
-MU-75U5165U9045975=36T=/2TM+2T=?555=65E9145!15E75U-3555145=75
-MU=75U-;6U]#?T];6U]34U=7555145E9145%65U75U]?555555575U=34U-75
-MU=74U-37UM;6UM?4U-75555555755555U5175U54555555145%55U-'65594
-M5%=75%74U]?6T-'1UM;7U-55U=55U=555%145574U]34U5555E%65U=75=74
-MU];1T='1UM?4U=5555545%=75U965E945%175E35U-71TM#1T];6UM?5U-;7
-MU-?7U-755%=65E%14%%65=37U]35U-?7U];6UM?7U]?6UM?4U5575U915U=4
-M5515U-?7U]15U=545=34U-35U=75U5=15%555%75U555U515U=75U=37UM'6
-MU]3455=75U155=74U-34U]34U-3555555%=75%145%545U55U=37UM?4U];6
-MU]?6U]?4U=55U=55UM#555104E)34U!15E15U]'0T-#3T-'6U]545%15U=34
-MU];455145U9645%75-77UM;1T=?5U-34U=75U=35U5=7U5555595UM;7U=74
-MU5905M145]76TMW=T=;45U%34E%65]555U%65=31T]W2UU=4U-?6UM?6U%57
-M45!65577T=;7U-555%155E-35U575]?0T=#1T=564%!15]30T]W=T]+=UE17
-M5U=7TE!T6E%<P=],<M'DVT)>W?OD1VQ2Y?/?T'1G\/%)?F!4^>/`95/<=F1)
-M\>/^?61.UE?5W\'YX^[E0GIP44UY?T'.QEQP3452R=]7RO+,44AQ5]C4V?']
-M\<1,=T?5=WYP7O3*]%)0]??<<4%#4/7%5E+-W-+435=;24A:5_7TU45>Q,?"
-MUEE7UME0T%92P]]46UM435]?1M'4Q5'1R\CQUU]114%$14Q0Q,S/T575U]5%
-M15+45=/85U)5T]O4U5-2W=-545!25%114][>VL'9TT%)0-':UU9:5]S6TU?1
-MUM117D9=Q=W2WLW>V59>5%#%5%U?3=1%5E90R,W!74515--95%Y1P=C=4]95
-M45=7U=#0T=-55EE=TU164593T=A545+3V]916M'1U=5355O6V]+1T=)0U5Q<
-M5U-5U-[2W=-7TM154%/55=G2U5Q5Q=%26%#54-#7U-11U-'05=W05%-65$5<
-M4U'75MW'Q=-25=;2T%526U)6T-S45U;1T-)46%31W-5?4-'24=;1T]51UE%3
-M5-_65]#3TU=14%%14%!1TMS4U-W65==66U+0T-?6T=_?U5!55%?1UE=<4U75
-M5537UE75T51?7U)4T]!65]#3TM175E?0T][05=32W-;5U-1545)65E-<7E!0
-MT=G6U5'755%27]74T=?2V]G;W=W75==65EY25E%74]575='0U5/5UU175-;7
-MTM+0TU7455!<7%5645=5T=;6U]375%57U-56UM/1U=;1U-+3U571UE504U?4
-MU5U35-'745U3U-'7U5=5U]=5U=;1T-%45=#75=3655355U-15E36T=;3T=;4
-M5E30U%!45U77UUIP=$!95]#?VL3&QL;&Q,78V=S=T-'4U51745%04U)24E)2
-M4E-34U!145975U145=75U=34U]?7U]?7U]?7U]?4U-34U-34U-34U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-:____________________________________
-`
-end
diff --git a/share/isdn/4.al.uu b/share/isdn/4.al.uu
deleted file mode 100644
index c08e17e..0000000
--- a/share/isdn/4.al.uu
+++ /dev/null
@@ -1,323 +0,0 @@
-# $FreeBSD$
-begin 644 4.al
-M5-77UM'0T]/0U]31UE975U=45U=45%165E=75%155575U-?7U-34U=?6UM35
-MU=37U55555175E=75%75U-?4U-;1T-;1T=34U=555%545555U]?4U]?45514
-M5%!05U965U34UM;6UM;1UU545U=75-74U];1T=#0T=;55%%045%15E155=54
-MU=75U]?4U=35U-;6UM#4U-'545755%145E975U555=75U574T-/6T-#1T=;1
-MU]34555745%04%%65U145%=45%74U]?6U];6UM'1T=/0T]'4U5545E%04%%1
-M5E=15=34U=34U=?7U]34U%555515U-37UM=65E165U545575U]?7U]37U-55
-M5575U];7U]?7U%755U965U155575U-;6U]575E965U14U=34U];1UM?4U-?4
-MU5145U155=75U-355U9045555-37UM'0T-'1T='1U%175U145%545%555555
-MU=?7U]545E%15E97U=?1T-/3T-#0T=35U-545U%65U145U=45U=75-74U-37
-MUM;6UM;75U345=74U-355555555555545U?5U-;6U]?4U%55551455575%55
-MU-?7U]?6U]34U]37UM?5U555U=555U1555145%=755155=34U-?7U-31UU75
-MU%545E!04%945=75U];7UM?4U=?1T-#6U]?4U-555=74U]345515U=5445%1
-M5E=5U=37U]?4U=34U-75U-7555=45E=5U=34U=755%-15U94U=?7T-/2T]#0
-MT='6U%5745!04U-05M77T='6U]34U=755%=45-74U-?6UM35U5555=555%35
-M5555U5545%55U5145=74U-37U]34T-'4UM?5U=3455145%14557555555517
-M5U1555545574U-34U];6T='1T=?45514551645%15U35U];1T='0T]/0UM34
-MU=34U=7555175%=05E1645=75E975%15U=36T='6T=#1T=#1U]35U5145U=7
-M5U=75%555%75U%55U=555=75U=37UM;6UM34U-7555555575U=75U5555U91
-M5-;4U=?4U=75U-755574U]?7U-555U915E975=36T-'6U]3555545U145=34
-MU-?7U-37U]5555555%545=55U575U=77U]?45%=65%145=345-36U-;6UM'1
-MUM;7U]?455=14%!04%%15U15U=37UM?6UM;6UM?6T=?4U5755%1455545U91
-M5E%15U545=75U-?6T=#3T]/3T-#0UM155%7455945U%145!04%!15%75U-;6
-MT-/0UM?5U=74U];1T=;6U]555U%045!0459455145555U=34U]'0T=#6U]34
-MU57555155-74U-35U=755U-65%=45%75U-?6T-#1T=;6UM'7U5175U=75E=7
-M55575%755%=45U74U-?6T-#0T-'7U%5645975U145%965%155=55U=34U]37
-MUM'6UM;0W='4U]545%=75U9645!15U155-77U-77U];6T='1UM?7U555U555
-M5%15U=75U-?7U-3555165U=4U=35U-34U-75U575U5545%545=37UM=5U];5
-M551455=75%15U=545%74U];6T='7U-?6U]35U-5555555=345%%34%965U=7
-M5=36T='3T-#0T=;4U-75U%575E9145975U=45%915-?5U='6UM;1T-'0T='1
-MT=;455=145975U=75U145575555455145555U-;6T=#0T=;6UM35U=755515
-M55=75U=45=?7U-74U5575E=75U164%76UM#3T-/2T-=55U=75E965E=45%75
-M5574U-?6UM;6UM;7UM;7U=75U-5555175U=45U=65E975%555555U=34UM'0
-MT]#1U];7U]155-775U964%!145%15E15U=30T]W2T]/1U]545%555575U554
-M5U=45%15U5175U=4U=37T='6UM;7U-75U=35U5545U975%75U-37UM?7U]?4
-M5%!75%35U-37U-7555545%35U=755555U=74U51645975%55U-34U-34U=74
-MU]?7U]?6UM#0T=?5U55445!04U!15%755574U]?6UM#1U-76T];1T]'6UU57
-M5E%34U%65U=65E965U35U-36UM;6U]?6UM;6U]?5555555545575U-3555=6
-M5E975%55U=?7UM?6U]75U=75U=?4U-75U%5755545515U=74U575U=75U-?7
-MU]?4U%545%5555555-55U=75U=74U-?555145%=65U74UM'0T='6UM355%=6
-M5E=45%175E975%15U555UM#7U];7U]34U-?7U];6U-?7U]145E%04%%65U35
-MU-34U]?6U%5555545U14U=74U-?4U-34U=545=75U-74U=755=34U-?7UM15
-MU=555%104E975U55U-75U-?7U]?455155=34U-?7U5555-75U-?6UU545%14
-M5=77UM;55%=145=455=75U94U-37UM;6T='1U]3555155-75U5145-?1U-15
-M5E934U!15U76UM'1UM?7U-74U]35U]'1UM?55%=75E964597U=75U];6UU57
-M5U35U]'1UM;4U];1UU165E%65%14U=55U=74U]554%)145?4U]?7U]36U]?6
-MU];7U-35U-75U=775=?7U=15U5=55U174%915U35U='1UM;7U]?4U554U=;4
-MU=555]174517U=34U53555745-36T];7U%955]75U=5555755%155U165E34
-MUM'3T-#0U-?7U-?55%165%?5U=31U]?455=65U=755?4U-=555=4U534T=/0
-MT=;7T='4U5564%U>45!7U574U=;6U-?7UM34UM'3T=375%545='4UE175U95
-M5514U555U='6U5575U155%945-74T]#=W=/155915E934E-7U='1T]W=W='5
-MU=1045=34E!04='?T]955%=5UM145%57U]'455%05]76T=;45=;3T]%55E95
-MU]'4U5565-74U53755914%%4U5=15U=5T-_2UU55U='=W='7UM36UM-54E]>
-M5-?65UU?7%745E=4UM?7T='0W=/0UM77UE515E77UM'455155555U=1545!2
-M4E%45514UM;2WM/7U-=45-97U=945U145]#25=36T=565%134=55T-!45E36
-MUM355E37U]=15M37W==05]'<W=167U+7VMO44UA25%%45537U557U]+3W-=6
-M5MS:UEY:6E73T-14U-5765#<WM%65]'15];5U]/?WE!15=155U=>4-#65597
-MT5535E15U%545U-6TMS3UM11T-G2T=76U%?=T-'07%U>7EU3TU9<5%#1V=S1
-M4U+4W=C<W]==4]'64]''U5Q47%'0UU71TEA'U5745515U]#>V-?65%-0U]14
-M4E5<05%5VL??5EA24-/0U-14T=96TM?65%G7WMS75-164U!'4]/;TEU?7U_5
-MT-!45-?1WM+75-'>U5?6T-[6UM;?TE9=7=%77%Q97U/=V]1355%87=76UM%6
-M4];`QM%14]?6T-'5559<45'6W=?.VD1&3EA=V=!84-W>W]#6W-K%W55375A4
-MT=%14=;:5UI95MW0T-==T=%:7E??V-W=TU16T]37U%Q$4E5=U%76WMC=WU37
-MWUA055Y$6-;4TL=57M;0W<'64%I.0='`V='7UMW4U-/64$-9T\;875A7Q\_9
-M4%Y14T%)4][%P=1=75?%PMA=15A=V=9=4]W?UM#1UEY'1%E1Q,;9Q5=0U570
-MUME67E'6T-U01UA:5L?%75Y=T,?15U'4T]344=?<U-174=W'V%=?6$92V=S5
-M4%Q6TE1?U\?64U13T-O>5%M165_?P,1925%5T<;<U='775[8S-='3]'.WEU"
-M0ES;W-W8TUU&35S&Q,154-C7U%?5U5+7UE;3VE!/0EW&SME76%#1U]U615[5
-MUM'%U%]>V\-=05_2V==015O$RL9575-?U=C57E30WU-;6EW&TE717];75M/2
-MT5=?U-_$W4))7E5;5\OT]<)%2%C0T$-'6E#3]/%634Q-5MW;VM766=?7UL_)
-MQUA&7M+.Q4QV6-G/VEQ`0-/:UE=5U%U25,7%WU-0T5U55U+17UI"6MG,R,30
-M4]%57T9"4-/T\-E;4%U'5-)55L'3UU5045M97,'#V$QT7%E=1%7:P?/-T==;
-M1TE;QO7:T4595-C-Q%!S0\39Q-]>55U=TL;$54%$4]S8T5!(=D#8P,'674I2
-MP<;"U,'/TE-W=]_/Q-901EE%5]S=Q-/?7]764=]75EI#T,/24=145\3=7T=>
-M5<?.TE--U</<3D-7T-['QE9>0%Q0V\W4W=#UR4US>,3/3T%TU]O"]5'`P_?"
-M35U;0D57559#6<G90D3-PL')4'1V15?4VMQ4V=O.]-1=U=_9<4M/7=A;7%_!
-M\_3-T49`U=U:55E*4]_UR-G:6T)965=`U=W>Q-?345!<24U$T\?=TE??]?;#
-MQ5!V0T92QO7,TT-]=TOW^]!/='70\?)1=$!9^_Y?=G5&7U[=U,?&V-_(R\E>
-M2$!(W<333DI&7=C37L/<6]Q5P??P_T-:5$A:?'Q!6M13WO3VPM[8SU)$7=C)
-MQ])T=D1#4\+-UW1U7<3`_?#31U]?2=3T]E!3=7Q2PO%76'-)3=#_P5-Y=]?1
-MPL#QX?;'TU!96U#-T75%4DQ:S$90U7-524Q/7/A8T_'.P=C-1'=!4,#(]\!T
-M0\1`=EG;[>;%=VQY>$#P],+71=#W\L].3T7?T-/R]%]#<WQV0E9W2DW*YN3Q
-MV=I!WUME6]/%6D;UUM944DQ`X>+EVDA_>'=-U\G[Q5AW9'Y8S\+TU4M)=MK\
-M\_364%I?QL[V4$M91M_-SUYQ2LWPWW1'UTQ&2MKVWLY63W),P,G\]<37Q=-,
-M171^2]?/R_//7DM+1$GUQ=7>4M]61US2Q=O,^O#<=F5S?75?P?'.SM#&R,W0
-M7U-/145!7U'25-U6U?'35<564U+6W$%W1-=0V?'%QL+137]T=U/QS]-?157?
-MR<7`V$5-0T!34M3S\\+TQG)(1G%;UU3!\/C^TF5_7ES<=71'4\?Q^?+:7TYR
-M?W)34-+;]^3Y\D5T=7YW3U+2QO[]P/720T]`U-#2Q=Y9=7)A9$M7\.?F_/;+
-MP5=%1%A><WYT5</:SO3TRU]+3D=>1U#`R=]3TL38S-Y&1$%8UE%&3UU54%90
-MU,??7][*V%)>UU5%7,O_]<1?='9+2D_>R/3/QLO+SEQW?GE#4<7$45?$],)2
-M='13R?7(Q]!`<GYQ7<7%UM/"R_',U%122'9&U=[%]?;TR]I90T1:0$M"1G1.
-M05',\_S!4T=!T\G.W=;;TE%'15?3T-1%3%W2VL;&5$-/24%3T\7`PL/.S]Y5
-M6$-"0D53U-/?U$Q\?W5?V\KU]<1:2T]#7\;\^_O^_OSWPM-8=')S=U[(X961
-MDY'NS6$3!08'&A)I?%3#R,KU]/3W\_W\__SR\?;Q\?'\^/OEY^'AY//23F1@
-M]9B"B8F&YQH*,3,Q"@=H6__F[960FH:&A9'V8Q(>'15YTOGFX.SKE>O@]7-K
-M$1%J>MCD[.SA^\C64EA'=5R6C;6TM8;-`#8]/#`('E'OD9&7E):<FYZ7]6(<
-M!1D42.:4E^GE\/']^?/0?FD4%&U,_NB4E.[EP%Y.<GA4GHNWMK6;:#4\.3XP
-M#6"7FX>%GY"6DI/HPVD;`08>>.R9A)J6^%UP?'9+<6=L;V!T]>R4E.[ZV75[
-M9'K5GK6PL+>&9PH\.#@S#VN5FH>$F9*0DY#B1Q$'`@,>09*`C8"?^'H5%Q5B
-M9'AE>4C9Y>Z5Z>?#<6T4%Q5PG[>\OKV)QP@^)24_-1:6AH.`A)Z2DI#@<Q\"
-M"`D&9Y*,BHN`D5T5'1P3%VIO9T/V[I&2D>S->6H3'1!K_XRROKZPAQTP.B0E
-M,@/?A(V.@H2>DI#N41<&"0L,'?B&B+6/A>-Y%AT2$1=J;'M6Y960D.O]=&L3
-M'QT618&SOKB\C&,V.R0D/`]+A(^(C(>>D93C11<&"0H/'_*'B+6.A>9G$1T0
-M%&YC9W#5^^J1D>CP<6H3'Q\028:POKB]C6`V.R0D/0Q2AX^(C(><E^KD2!8&
-M"0H,'.6!BK2.A?AI'Q@<%V]D?4S&X9>3D.OV>1<?&!D2;9>UO+FYMI``/"4G
-M.C89EHV*BHV$DNKG6&@:#0L)!F2=C[6*@Y%U$!@9$VIA?W11\.^6D);BV6$1
-M'!X<%O2/L[ZYL(0>,SHD)3`'[(.+BHR$D._D46(<``X.`6F4@K6UC9S4$1H%
-M'Q1D353'\N/JE.KFW&45$!(=$&[LB;._OK&9!3(Z)#HQ&Y&/M;6-FY7\V'-N
-M'`$-#05ED8*+B8&7=!`8&1!O?4=6V_/BE9>5YM=A%AP>'!90@;&\OK*#;C<X
-M)"4R`_^"M;2.A);_UW]I$@0#`@=OZ8&+BXV=4!`$!!X5?=[Q_^7CZ.KN^U)A
-M%!`3$6IC]H"VO;RP@&XW."0E,@#GC+2WB(>5T7AN%AT$`0$;992`B(B#D$H<
-M!P<9:DOVYN#AX>+MX?9%9A41$Q`4896+L[^_MY8`/"4D.S04A+6VM(*=\7EL
-M%Q,;!@`&$?*$B+6(A_P0!@(!'7C\[^COX>'@YO[6>&L1$Q`48%F<M;*\O8OG
-M##\E)#X(>H&TM[6`EM5B%!(<&@8&&V+I@8NUCYE9'@`"!Q99[9>7Z>;E^?/%
-M3F$5$1`1:V3%A;>RO+*/4@L^)24\#<N,M[:UANAR%!(>&`0&!!UTDX*UM8*0
-M9@0-#005RY>2DY7F\LS>4G%C%186%&U\VIV*L[*RB^4-/#HE/@EW@[>VM("5
-M<18<&!@:!`40=9:`B(N"D'D%`@T$%<.4DI.5Y_'`W%=(9V@4%Q5M<E'@@;>S
-MLK:$%S<Y)3HQ&Y"*MK:(F<T4'AH:&1@9$&;DFHR+CH3[$`,/#1MD[9^8G>KY
-MW4-W<F1M:6MO9W33]>"$M;&PMX=C-3\Z.S`$ZXBVMHN9TQ,%!`4?$A%K?>6>
-M@XF/A^,7``\-&F?NF(6?ZO9#?GM[9&-L;&!Z3L3R^92#M+:VB)4%,3D[/PM@
-MAK2VM(#@%00&!!\7:&Q[TNB:@H^#DD\:#0\`$?6<A(63YT1D8V!G9&1E>'%'
-MT\C)PNJ#M+>VCN`&,S@[/`S1C;:QM853'`8&&Q=@869_T>^%C8Z#D60&"0X!
-M:>V%@821]'AO:6-D>GE_<$/6]?+WW/:9B;2WM9X6-S\X/C5LA[2VM(;)$P<'
-M&11Y<V1A<?R2@(Z,F]T8#PL-'?6>@8:?Y'QK%VIF<41<U-K,RLK;0GAZXXVT
-ML;&"70D\.SLP'I*UMK2#Y!<%!!UI=G5A:F]$E8:.B8'B$`T+#@5/DX>&F>-Q
-M:Q1I>D31W=W>VL;$T49]97[MC;>QMH-/"#\[.#$=G8JWBH'Y%!D>%V9+<F\6
-M%'65AHF(@.\6`@@.!'Z4A82<X4Q@8F1UU=_25%U1U]/475Y83560C[2WM9@4
-M-3PY/#5NF(NUCH7W:!(3%6-D8A06;<^=@XF)A/T<#`L/&G"4A829ZL9\8&-G
-M?G9/7=C(],C?6'5S<73WA+6WMX[@!S`^/C,`_X*UBH*1<!$<$!5L;!46%'?K
-MAXZ+C))F`0L+`A'ZFX&'G.9T;&MN9G!%TL_W]L[2175U35U2T9:,M;2+GA0U
-M/3\]"VV8B(J/F_5K'!T6:&-L:6A[Y9^#CHR%S1\-"`P96I"$AYGIU6=O;V!Y
-M0]'/\/+TWE!$0T%81'Q\ZXVUM+6;:C4\/ST)>H2*BHR<61$9$A1C>V%N:F7E
-MGH*)CX7%&`\+#QA6G8:!F^A?8A45;7]%WO;^^?'86G!^?4I`3W-4GHBTMXF4
-M&S8_/S`!_X.*B('I81P9$&ED>6!I;T;JA(R)@I-E!PX)`Q;^GH:'GNU98&MK
-M;65+UO?X^/;02F5G>4+0P-9"XX"*M+6'?PXR/STU:IZ(BHR?1Q,%&1=F1%AU
-M<%OGDX2`@9U='``-`1#`DX6$G.-'8&YL9W%:U]O"R<S$U%M)=W9Q=W%^9?.`
-MM+:W@T4)/#D_-&Z$M;2.GV4;`0019-_"5T)2Y9&%@8:=WQ`&`P<6PI"%A9SC
-M06T5%6U_6=G(\?;,T%M+<'!*1EE144EP[HRWMXJ>$S8^/C,`[8ZWM8'X'0$`
-M&F[7Y.7,7-#FD9B%G^YW$!H%$F'PEYR<D>!59VL4:F%+V?'__/397W1\?GUU
-M4\WP\=)T\82(BHZ88P@S,C$`^X*UB(?Q'P``&FWUZ.C[54W<YY>=G>K+91<3
-M%V!5YI67E>;>?VUK:6!QUO'[^_/!7'=^?G!)4,WR_<UT8,6$B[6.F6X*,S(W
-M!)6/M8^9=@0#`1U([9;HS'EF2/R7GI^4\7QI:FUY4LK[YN?E\=9Q8&EI9DWT
-MYN/GRD=E8V!Y0<;_Y/G,2V\7382UMXJ$8`LR,C8%EHZUC)UF!@(!$E/KD.G3
-M9FQXSY2>F9'E2&)O9G%2POWYY>3^ST=G:Q5L=?#LZ>;39&L4;G/`Y.+@^=YT
-M9FL57(>UMXN%9`DS,#0:E(V)@Y=O!@,'%/>7D.)+%19MWY2;A9_M2&YH9%W_
-MX.;_PM1914]Y8V]B?]W[X?O796EJ8T#^[^KL]DEG8V!G9=2;M;>*@<H`,3,V
-M#5.&CX*?7QL`!Q)"[I;N4V@6;E>5FX>:E=%B%&]W].'MX_G?0WUA;&]B>ES\
-MY^3*3F!H:6=7Y.[IX_-<>6%G<D9>4N*`M8N#EQ<(,3<($).#@IKY$08'''_M
-MD)?Q;1(09OF<AX>>YGH7%F]-^.B5Z?A$86L5:&=!]>?F\$5F:A5M=/#IE^KE
-M47MB8GY4\/C*5N:'CXR$XQ((-S4"9IZ`AI-8'`08%-#IE.!+%!-NW)>%AIJ4
-M4FH0%7C#X^OIY-]Y;&EN8''<\OK_V7%@;6!WS>;OX_)7<V5_6LGEY_)?9V'G
-MAXR#F/4;"`H.&O>8AY[D;QD9$7+AE)7]9!87>OV0FIN3YG5N:F-U].#MX/-:
-M9&YK;'M>]/KYP$)D8F!]T?GBXOO$1'%P1]OS^__8?6YMY8>,@YC+&`X+#QGS
-MF862\6L9'Q1$[)?J\&<7%'SXD)B8D^=R%1=N</3B[NW\0F-J%6UPQN7A^]AP
-M8&QF0?#@[.;(6'!_2]WP__/$0GIB;$^1@(*'E&<&#PT$9I6>G>9X$!T5<.7J
-MZ/MW:A9M5>R2GI+HV&`4:F32X)65X]EF%!9K?L/FXN3%<6!L9DC"Y>+A]UI_
-M>'78_^;F\E%X;&AL69&!@(7H9`4``1EE[9&5]&07%V->Y^_ASGYH:F7-Z)V?
-MD>=(;A1I</3LE>G\=6T5:F9>_^/@\EEE8F-]T/GAY/;5=W]W5,KXY/+==F%O
-M8,>0AX><Y6\:!P467^R5X%5@%6ADU^7AY=Q^;6-#^>J7Z^?7>&!E0<ODYOK)
-M7G)E9'],ULC]\\%9<7AY2]'T\_?%64]'5<__^?12?&%A3>.<FYSI0189'A!E
-M]N'EWW]M;7E3]_WU47)D>53Y[>[C_=5W?W)9].3F^O35=7][?W53QO7*P55)
-M?7QW7\7UR\774UY4VLKVRM!/<G!<^961E^+981<6%614\/#93F5G?D'<P-I2
-M=7)W4,KYY?GWV%%<5\7T]LK#VM)574-T2D34VL/;4TYV=4?5P\K-V=5%3474
-MP<KUP]-21D)=S^7CX/G==F=A9'=2W=!%<7Y^<$33VMO35EU1T=G#S\_-Q=+0
-MT=;1W]O9W=1=6%E=5=W9V=G?W=%0141=U=/<W]/6U570W]S75U]:6U#;]/+\
-M\\)32GU_=DU85E126D-/3T)!15+4W-O:V,7%V-C>T]'65533V=C%V-W74UM'
-M7-/&P=O2U5-<4E'1V\79TM'1UM177D%,1UU4TL?/R,W9UU915U%<6T5;7UU9
-M6D5`3TE(3%A4UM'1UM;1UM31TMS>V\#U\?;UR,S`Q=_3T-#3T];45U]'049&
-M1$=`04187U-15%54U=_!PLC,W%)$1%I>5]/=UU-81T!!0$U`6U+5T-+655=7
-MT<7U\/?)P=K9V\#/RLO!W-=75E37U%Q-='%Q=G5`7]71UU54U-;6UM/9Q,?:
-MV-+6U5=75]74559=6D9&1D-"1EA=5-?6T-S9VMK8VL;`PL/'V]O%Q\78V-G0
-M55%<7U!<1T5>7UQ>1T!:7EY<4U?45U-1U=/>WM#6T-W<T-#=T]'055%4U5=5
-MU5174EY96UE35='=WM[;V=S2T=?0W=#3W=_9WMW1T==45%%>7%)?6%A;6U-4
-M5E?55U;55E-4U=76T=31TMW=TM;4UM=5U=74U5=7U];6T='1T='55E=14U%6
-M4%=55=555E;7UM?1T='0UM;6U]575E975%175=;75%114%=545945U555]32
-MW=;6UM70T];6T]/0TM?7T-5755!3U-=5U5165E-?7UQ05U=7U=36T-?5U]#3
-MT-;4T=#6TM+0TM/45%575E905E965E-<75)15U74T=+<W-+0T-#6U%755=54
-M5E915-75U-15U-175E=75%75U];4U-;6U]35U-?455555=755%965U965%90
-M5=?5U-?4U]?4U=;6UM+0UM'45%=75U=65E=65]555-?0UM'7U=745U%65M?7
-MU-;4U-'2T=;1UM36UU55559645%75U545E95UU575=37UM115=;7U5515]14
-M5E555='75=;75=?65=155M70T-+<T=77U576U%7455554%!445!65%15U597
-MU575U-34UM34UM'0TM/1U]5455%65U755U%15%915554U514U=545%55U]'6
-MT=/1U-75U='0U]37U-;1U5355=355U745%914U975='5U-;75=755=;75=55
-M5%555%34U]?6UM?7UM15U%555U!15E%4U=34T=;0TM/1UM34UM1555545554
-M5E%75534U-77U%=555?4U%77T=;0T];6T-#755=65%114%!045%04%%75-?5
-MU=?6T-#7U];2T]#0W=/0T];4U=1445)=4U=75E%15=544%-5U=74U-?7UM54
-MU-36TM35UM;6U-?7T==55U%75U%24U95U535UM#7U-;7U-?75U?4U]37U]#3
-MT]!55%=74E)7U=76U]?1T-545%145U%05U155=77T]'5U%54U5=<4E=7U5=4
-MU]#1TM/0W-W1UM?4U-175U145%565]77U=754=775%934%!75E76UM'0T-#3
-MT=;4U-355=175U=145565-545]?5U-'5U])45-%55]114=54U]%75]175E17
-M5]745554U=#6UM?7T-W0U-77UM=55E37U5534U155U=35]?55E=4U]/0U-71
-MT-=75U74U]14U=#3U]345=154%555U174U!75-74U-36U]35U%75U-?7U%55
-MUM;6UU55U-555%=5U]?5U-14UU905U165E=4U-155-75U-37U]/2T]'3T-/6
-M5%965%11453755114U%15E=1U-'55-37T=W6U];0T-'55-75U5=05-145%96
-M5=145E=4U=;6U-'1UM;7U]'6U]34U%545U5555355%145%15U=555]715594
-M5=?1U5=4U-'3T='3W=#755=05E915U175]74U-755E345U%65E?4U]77UM?0
-MT-#7U]'75%14U-554%!5U=35U=;3T='45=?75]155U7455945=575%145=56
-M5E=55U915=;1T='6UM?5U577U]54U=355%57U]'6U='1U-145E=65U%05]75
-MUM'5U]#7U=175E545==4U]/6U=75U-145E34T-%45%55U=534%15U5145=?7
-MUM35U%145%14U]?7UM=7U=?7U=55U-355%%655545-74UM35UU55U5914515
-MU=75T=35U=74UM75T-+4U]74U%975U35UM15U-?4U5175U=65U=7U=355-76
-MT]#1T-'6UM=5U-?4U-145U115U%275)25-74U=35T=#7U]?7U]17U=?7T=#1
-MW=W54-555=5445=55%!24U;5U594U=;1T=?2TMW0T=30T]95U-77U-54U557
-M5E-05-545%975U965-755-'0T=;6U=55U5?45%545534U=71T-W055544%%4
-M5=75U=?6U]37U]'0T-77UM545U%75-565E%74%-15574U]75U-;7U]36T-'1
-MT-;7UU165%=5U557U5=14534UM?75-75U%345%76U%77UM95U554U==55575
-MU=75UE575]575574U]555U=455945=76T-;6UM#7UU54U=;5U5?4U]'555=5
-M55165E%65=545]77T=94U=75UM15U]#4U=;5U=9555165]=7U=515=;5U-54
-MU-'55-74UM#55E=5U5514]?4U]35U-/6U-945%114%=65=?7U]#1UM#0UM=7
-MU=9755965%=35%=1U==4U-34T=;7U]?6T=;4U=175E%45E1645555]74U]'3
-MU-;1U]345U75U%74U-;1T=?5U=31U=?5U=755E9045-345755=345517U==4
-MU-75U]=4U]30T-#4T='1U-=5U-=55%965=9455=5U-145E975%575%75U]15
-MU]/2T]#7T-/755575=565E74U=75UM;7U]37U]5445)<4E%05M74U=37UM;6
-MU-?0U-;4U=30UM#05=?45%%14%904E!7U='45='3U-34U-775E345537U=71
-MU];7U5775%=75E=74%!5U]775=;0UM/3T='3UU=7U5544%)35]755U77UM;6
-MU='0U];4U=30U=1555755]545E=645!74U)14%955U?7TM+=T]'3T];6UM;1
-MT575U-74U5%75E544EU15E?4U]77UM'6U%?5U=74U5%75574U594U-77U%=7
-MUU755535T=;1U%54U%14U-;4UM#55%16U==75E57U5134=?4U-56U-55U=94
-MU]'3UM35U]155E57U=545M35U-145-36T=;4UM'7U]15U5565]15U-164575
-M5]345=345%555]175U575U17U=;1T]W=TM/1U%515-74U-34UU915%!05517
-M5%165%575U74U]?5UM;3UM37T=#1UU55551045%75-74U-55U=77T=34U%35
-MU-75U-74UM945%1455=65];7UM74U]?45%97U%575%1555945%36UM77UU35
-MU-?55=37U577U-36U-36U-77U-77U-74UU3555=75=37U5945=7755?5U5%1
-M45!75U%4U=;3T-/2T-34U5=7U515UM;6T=5755575E!24%955U15UM/1U-;1
-MT='65U15U=?6U=31UM5745?55E575M375=755-375%775=?45-71U%565E76
-M5%955-745U34U-?55U;4UM;7U-;3T]?55=5555145=5445)05M55U577T-'7
-M5-74UM74U-37U-74U57555=75537U]=45%74U]75U-?1UM35U-?7U%574=34
-M5E!7U=545U?5UM75U=375596U=155%?5T=545=?7UM;7UM#1T=?6U]37U-36
-MU=555%164%)645=645=55-34U-30UM35U];6T='3W=+3U5155E!=4E%54%!1
-M5E1445%5U-77U-'3T-'0W=+7U-?7U]?45-?555=14%=64%!75%15U575U5=4
-M5]?6UM'0T=#1T='1T=;4U=175E155%%75U9755165%=5U=?4U-?6U]?5T='7
-MU%14U5555%=45U965E=55575UM#3T-'7T-#6U55755575]7455=75U755U%6
-M5E975]77UM?7UM'3W='6T]#1U]755%114E%65U965E%45E?5U]#6U]37U-37
-MU=375=?755155U555%37U]=5U-55U=57U=?55==5U=55U-37U=545=5445?4
-MT]945==45U975=;1T-34U-575E=65U=75%15U-77U]35UM?6UM;4U]545%15
-MU=?6U-755U%145!4U5175535U=;6T-W=T]#0U]545E175E!15]145]74U=54
-M5=745=36T-#3T]/3T]'6UM?45E975%%145975U945U165=74U55555555577
-MUM;7UM#3T-'7UM'1U=545U904%97U=34U-?55E=45-355575U=555=76UM=5
-M5%755575U];7UM?7U]?55=755575U]75U57555=5U-55U5545%55U=555516
-M5-75U555U=?1T=;6UM;7U-?6U=775%1555555%15U5165E%15U=45=75U=?6
-MT='0T-/1T='6U-3455545U155%545U145%14U-355=55U=37U]'1UM'7U-54
-M5E%24E-145-4U-74UM#1T=?4U-34U-34UM;6T=;6T=155U165E!045965%14
-M5555U-;6T]#0T]'4U-?55-755555553555145%=45%=45%975U=4U-;2W-;7
-MT=?7U-555=3555145-74U%545%155U145%155%75U-;3TM+3T-#6U5155575
-M55965U=65U=45%155-75U=555-74U]?1T=#1UE5555=15=34U]'0T=;45574
-M5U%04U)65U=65-77U577TM+2V=G=U5=65%135%115%54U=;6U]145U9075Q3
-M45?7T]#0T]S?V=+0W-!555%075Y35E7>S$U\5<588&SDZEU4^]K<Y5-K<>N<
-M=1)N]I7B>A][__-?T^!#;VY6Z.'DVV50_L1E8&3>[^#\V5[7Y<-]64QP4-):
-M<GME0%[1\_[?0EM6SO/!VE;(\?/UT]=;<7)R9DK+V4=7V/;W5TY50-'TWMY8
-MS<'?Q5'565QS3\#-S59\?%;/__7$=756U<-84<7"VDU=UM590DU(1,W#WMW$
-MS?3(6M7WTDUT=4!34U#6WU%3P\761=S015Y!T\W;T'54S,_&1M34U5Q=TUE7
-M6%?UQ]996UI2U5U;W<725U%?4\_WQ4!!V-/05DW/]=!.2=E75%Q8U%+275M;
-M5_7=T=16U]G:55926=G)VE%%4%%35--764U<R<S61%W=T==44=;;TUC6W-72
-M545$U][>T45%5MC?U]97T]5>1T511%3?T\?8Q,3:V5-'4]O06E997=;9V%U2
-M5U%<V=M74EW5W=Q75-O>T5]:TL311D%=W,+<7D55Q-]<1$!0T]#=U%56U-O6
-M4%/?VM%17E'0W%-7W-G=5U104%U<T%'<T%C1W-U17UY945#0UE39TM+4U=3>
-MTU3=U514UM/45D53W=W;5EY24UU2UM77U]_275]5WM596E?;WM/7T]?54%72
-M55Q=U%75UM#4V=-4T=/?45Q87=71TU764-7?UE9=7U%4U]3>WM+=4%-4UU98
-M7%=75M;45E71T=?4U]?44%74T][2T=?2T%565E-?7%975-=54-70T%5=4M'0
-MU%?=VME8<75`6%;1W-O%Q\?'Q,7:V=[=TM#6U-545U914%-34U)24E-34%!1
-M45965U=45575U-34U]?7U]?6U]?7U]?7U]34U-34U=75U=75U=75U5555555
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M__________________________________________________________\`
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-:````````````````````````````````````
-`
-end
diff --git a/share/isdn/5.al.uu b/share/isdn/5.al.uu
deleted file mode 100644
index b818efd..0000000
--- a/share/isdn/5.al.uu
+++ /dev/null
@@ -1,369 +0,0 @@
-# $FreeBSD$
-begin 644 5.al
-MU];7U-35U=75U=75U=?4U];6UM355%=555=5U5145%145=37UM?7U-34U=55
-M55175%15U]?6T='6UM35U5145U=64594U=55U-?6U]34U5545%755=75U-?6
-MT=;6U]545%145%7555%35E97U=?6UM'6T='6UM'6U]?7U5555%=75U=64591
-M5E=5U=74U]?7U]?1T=;6UM;4U=3555=75%15555555175%555555U=555=77
-MUM?7TMW6UM=55%=75U145%=7U=34U-35U5165E=45=75U-355=74U-?7U]75
-MU=74U-?7U%555=75U=34U=35U]?4U-34U=75U=34U-75U-1555565E575U15
-M5=7555155U15U-?4U]'1UM;1T=?55555U=37U-755%175E%04%-05E15U=36
-MT='1UM?6UM?7U];7U]?7U-34U5145U%145965-755U74U-;1T='7U]55U555
-M55145%55U=?4U-74U]34U=555%145515U-?6UM?55514U=75U5545%=45%75
-MU=36U]34U5555%15U=35U-375%77U=74U-?7U];4U5555%75U=75U=34U-35
-M555555545%15U=34U=74U-145U=455555=74U-55U=545=75U555U];7UM;6
-MU-74U=755577U%145%965U355=34U-75U=?7UM?4U-34U-75U=55U=74U-55
-M5%=45=7555175E975-74U]?6T='7U]=55%5555555=74UM?4U-555%=645-6
-MU534T='1T=?4U-34U=37U-155=545=7555175U=5555555545U=5U=37UM;6
-MUM?7UM3555555=555%=65U=75%=75-75U=37U];7U]37T]'7UM;7U]75U557
-M5E904%%65U=45575U=34U]?4U-?7U];1T=/0UM?4U51645!045%75U=45%74
-MU-?7U]?7U]37U-?5U555U=75U]35U%5145%05E=75=?7U];7U];7U]?6T='1
-MUM;7U5545U914594U=36U]?4U-75U5145575U=35U-355534U-7555=65U15
-MU=37U]?7U]575E975=;6U]#1UM;7U5545U=455545%1555165U145=74UM?7
-MU]35U=77UM;7U]?6T-#0UM?7U51145%14%!65%55U=34U]34U-37U]?7U]35
-MU=555E77U-34U-555%=75U=75U155=74UM;7UM'1UM;7U-545%75U-755%14
-M5U175575U=75U-37UM;7U-355=55U=75U=55U-?6U]37U-555=76U-755517
-M45%145965U15U-?7U]37U]?1UM'6UM;5U5555%=65E=65E975U=55=36U]?6
-MT=;1T]#1T=;6U]355%=65E%15E=75U=75U=55%94U534U];0T=#2TMW2T=14
-M5U965E=65E945%145%145%55U=55U=74U-31UM;6U]34U-34U%545=355%57
-M5U975%74U]74U]?4U-34U]37T-;6T==55U975E=45U965U965U35U]?7UM?4
-MU]34U=755=77UM'1UM?55%145%=75U=45%74U-75U=36T-#1T=;7U5155=55
-M5%=65U=5U%575=545=55U]37U]75U-36T=#1T=?5557555=645!34%%7U555
-M55555=75U]34U-?7U-?7U]?4U]?5U575555445975%145=37UM;6U]15U==5
-M5U55U=?6UM?7U]34U-35551455175%=65U=45U1455755575U-36T='6UM#3
-MTM#6U]545U=45U=75U9045-15%35U-74U-34U-34UM'7U=;6U-?7U=755554
-M5%=65E965U55U-?7UM'0T='1UM?55=545%145%175%145%=65U945U975-75
-MU-;1TM/2T]/0U]155%175U975%555%7755155%155%55U=35U=34U]34U-;6
-MUM;7U-545%145%15U-3455545%55U-5555545=75U];7U-?7U-35U5555%14
-MU=36U5#4U%_4TE-7UE#5T-74T=15UM95U]+1T]/455165E=45U755=74U%54
-MU5555=75U-37U-555=74U-575U=45%175%545%155575UM#3T]#1T=34U-75
-MU574T=34U-555%965E%145965E=45U15U-77T=#0T='1T=;6T=35U5545=55
-M5%74U5555U145%9645%65=37U];6U]?5U=74UM;4U-?4U-34U%115U175E%1
-M45%65U74UM#3T-#0T=#0UM?7U]545U975-5555175E915U=65%75U=76T='6
-MU]?7UM?4U]15U=555U=75E945515U-?7U-75UM#4U-;4U=3455175%75U=75
-M5U=75E145%555=75UM;1UM;6T=;7T=;5U=74U-?4U]155U%15E=455=75U54
-M5%14U-37U]55U=?6U]?7U]=55-?7U-;6U]?55%=65U145U=45%145%35U]?6
-MU]?4U-35U-?7U-75551455555%145%975U=55=74U];6T=;1TM/3T='7U=54
-M5E%75%555-3155175U=75U355=34U]34U];6UM;7U-155%175E975U=75U35
-MU-?7UM;7U%55U=37UM?6UM345=555U=75U=75%145%5555155=34U]?75=76
-MUM;1T=;1UM?7U]?7U]155E%04U!045965%15U=37U];6UM?55=75U-37U]?7
-MUM?6T=;1UM355U%34E-045975=37U]?7U];7U-35U=70T-;0T=?6UM345517
-M5U905E%65E965U=45-74U]?7U]?6UM;1T=;6UM?4U=545U975E%15E=75U=6
-M5=36UM'1UM?5U=75U=34U-35U575U%=15U975%35U-?6U]?7U-?7U];6U]?7
-MU]?4U5175%145U=75U145%175U=75U=75U74T=+=W=W3T]#0T=?55%915E%1
-M5E=45U904%!05E35T-#7T=#3TM+3T-'1UM;7U]355%%045%04E-15U=5U=36
-MUM?1T=;6T-#1U]3555165E=75%175=355%=75E=45-37U-31T=36T=;7U556
-M5U=24-555=?4U-?4UM?4U]755-745=37UM;7U];7U%=745915U155=37U-?6
-MUM;4U-555-75U-55U5165U!6U574U=;6T=#7UM55U5145U=45-?6U55445-0
-M4E-75E965=36W=W=W=+2T]/1UM;6U-35559645%15E=745-34%%45-37T=/1
-MT-'6T-#0T-;455175E%65E965U=75%75U-;75U36U];6U-?4U=35U-?6U-37
-MU-54U=555U%145%75-55U=;7UM;7U]?7U-37U-34U]?4U]35U-555U=75E96
-M5U145574U]'1UM'0T=?55=71U]74U55555145E!34UU24U%65-37UM#3T]W<
-MW-+3T-;7UM35551645975U175U=64%!15E155555U=;0T]/2W=W2T]#1U]14
-M5U%14U-145-6551455145%74UM?4U];6U-?6U]34UM;6U]15U55645!15-75
-M5=75U=55U=35U]35U=?4U576UM?5U=545%15U5145U=45575U];7U555UM15
-MU-34U-75U-15U];6U]34U-555U=74%!15E965%74U=37UM'1T=;6U]74U]'1
-MU=77U]555=75U5=645!15U=64574U]?5U-'0UM?7T=%45=145%175]76UM37
-MU-575E965E=5U-?4U];0T]'7U]355%94U=555U=5551145965E=55=?4U=34
-MU]37UM?6U]?7U]?7U-545-?05515U==74E!7U5175-77U]155=37UM'6T=/0
-MT-#655144U-34%%6U=145=36UM75U=?45574U]=45-?6U]37UM'455907%#5
-M5E;55E75U-'3T-W15-;7U=;4U==55%14U]95U517U-174%57459655=65=?0
-MT--75M#3T];6UM=4U]=15E?4U5975555W=)%7%9455+4U=?7U531T=;4U];1
-MT='0T=?55U355-95U%545%36UU=575!5UM505%?1U]33UM?2T]=15%75U%;7
-MU=745=74U%104=155U-05576W-S0T-;3TM?55E%275%1U5-4U%;4UU=755?6
-MU%945M#1U]/2W-W64%33UM;<T%%15=9=6%9=4E345]=5U]?7TM=4W=)44574
-M5]?05537U551W-E46=50UE%975305%=4T-#0T-57TM/4W%14T5U15]-77M;=
-MTU-5U-;8U5U05U;5T-'6U=W6U]525E?175915-)65%;4U]#=55325U!11U77
-M4]38T==4UM+2TE57UM?6T5=>5U#55=374-37UU375-)34EU04%I6UM_1UM_7
-MQ=U0UMC35E-5TE=96=3=TUU=W-Y77ES7T=%54M15U-W1U%)1W-_15E!0TM]=
-M65974%-5U]955E?>WU=17-31WM575=C$S]!/45E:4%75UM79W,/R765W2EM!
-M3U_%],?;R?':T]?9Q=!$3E[=PM[<5D)2U-U52$#4U%975-?6UE=6V]G>T5+6
-MV=%/3=70UE[4P-U45E/?UMU94%U8Q=745U=7Q-U575C24];94U774E_:QU?4
-M7=/0UU71UW76W=575]]55-#'WU%7153745E(VLK(UT501-34UMK*U4%%1-=>
-M44U=S,'$0UA=TL32QE]85M+T]--615W?TE%'6-;!UD9.1]W5VM-24]/?5D5'
-MT]#675/2V])3V=ST55'`T=165T-025C0W%)7]]!W6=%03$#1S_W$4U[)4-]4
-MU-E.6$O!S$5.2=[+T]?$T,U<35%&WE-0W5?5V\1#U=U2V%[UTEI>T-A`2U+$
-MT%E*Q>37=W+,\=]90=-5SEA65$347?U46U?;W=[-0]AV=5_3PEE#V-W>45)1
-MV=;8WM744-';1UG,3-Y-3<51QMY>U\KPUE%U6<9+1'%9]<E6=/3U4T;5U=73
-MU<_#TEI;PD).145%4<G?W\!85L!65E?<7=O6T$92TU?00$/!QM9-5/!=W-M=
-MP=Q#6UQ=75C=U-K`7DI6WD/,VE'W5==/<T79\=U?157']UI"7]_,4D547M%8
-M4?=>6]32WM;&WDC5UL[#=$]35_;"74C2\E172UC<7\G66E)144?25DQ>V?79
-M45I4T=G05U?7T]]0W<9>44C84$905MSU6%++5UY54]C"6=O(7$9S0_1!3=?\
-MV%G94M_5U]17P-5:<7U;V<?%V=K1RLI6U$5.TM)<6%K;WT--\-A%Q]Y53E?U
-M0']$V<+UUE!6T]C8U]G47]=91M!"0O7?7T!5Q%7,6UO<741!TD?5]L/U]]+4
-M1T9>5]Y$5\5"1ES$P%U7UEI0PLW;6M-44-%:0]?PVU%0<$155,#?1];45\Q<
-M7T3#]MU<=%+?<%+;4?3/V754P%%65M#?6-CR5UG04%I'149715/>S_;3T'Q5
-M75W%U<%3UEIUV/3;ULC!3-3:2G5Q6O?UQMQ'=5'TS\37UUQS<]796717XO!%
-M471\W_71Q,-:4\;8S---1$7#T4Q-3%G?TE#<1$]0VL')P5U%5,;WUD!<WL;9
-MUE3`05;>U<5;2W55W=W.W5I(<D_05UY4R_?!R-3<4D%>4]S4VM[<UM)$4U10
-MU-%8T-C1WEY`U<??6T'6P]IVW\1<4$%>WM[635M$R\1!4M!5WL_3WU5&5L[)
-MUT)=U==#6=+%WU+6]-K614;65=)5P_79=GIR=%74UL;+\<W-U$=,3%QW6E?;
-M],]06?WTVE1R1M/;5,S2U_'<7$E-27-P0]?15-G;S,/(R-/!Q,7"7TE+1%Q8
-M75Y05-;57%M4W=?1SO/T4DE,0%U6T]?7T%3=U%+0W\_Q\-YS?W=`7-_5W<[Q
-M]%5%4UA"5E)<4M3=T]901U'?V--=5-#7U]=<1EG6VLG#WM_6U--16D195==0
-MU-)>7-#=Q/7)WE1:2DY`7E/3Q]_6T-/7U]107T56V=K24$%/4]["P-/>VL?%
-M5%I#4U!95=+765_<VU5'04=94E'4W=S%R/?*Q%!%65U=7%-15=?1U5;5UU->
-M7%U24U7<V,3%V]S>WU9:1UA35]'?VMG?W5!`2TQ:5=C>UM;3V\'&VM%34UU<
-M5]?3V=G=4D1'045=5%564%%6U]W2TM#445E2UMC%W-#3W=C;TE9?7EY34%?4
-MT,3,R\#16T]"7-+>TU1>1T=$15/4W=K"S-I437%W6-S`S=I57%-17D5975;<
-MP]M47UM8U<#(P-C:Q\;,S=C35UE#0EO=]/#QR\;?TM/774=.=G][>GEV0$1&
-M1DQT=TA`7-/$PL[+S\3>U%U5S/W[^//U]/'V\/[\RM1/?V1_UI2'@)GV%P<#
-M!Q-B=$)[8V5`S/[]4GEE?G12Q,K]X>F5Z^5:9V-^Q./KZ>?;=WYP6MOT]=A?
-M35K?R=UV8&'DAXR`EV('#0$12?W/9!84?_SKZ<QF%!5G4<[T\?[G[^_Y0&!I
-M9?7KEI7E5W-]2%#8S,_%T]/?W=+2UD5]8&U2GH^.A=P8#0T;8<[]06L68,'O
-ME?IE$1!H=?;EY.'M[./_6F-K8]?OD);BWWQD<='*R]Y?6]7=WMK$Q]Y3=F9N
-M8>^"BX+J%``/!A15^=IM$6A8YNOC1FH1:TKPY/[S_^'NX-QF:FY(X9:1XM%Z
-M9W7!_/#1=79%P_/WW45$5M_12V9]EHR+@?L<#`X$8_S@W14=%43@E.-*%!-J
-M0/KAY/O_Y>+@V&=K;%CLD)?E0F-C=_7D_MMU?4[;\/#"UUY:1$E]9G>3CHJ`
-M_!D."05DY>/5%Q]J5^Z6[786'!=TY>+@Y^7GX^329&MH=>.1EN%>86-RV?[X
-MS4U_<=?V\O7<7D1?6W1Z8,R!M(J;9P`*#QU4[.%^'1UG^):7S6H<'6S%X^W@
-MYN#IZ_MW:!=OV962E?9]8V50\_[)1'EZ3\OE^=M"=TQ5W$5E8?^`M8B?:0(*
-M#1'/[N5G'!-_YY:5V!4<$V+<Y.'AXNZ5Z/9D%!1YY)&1XU]A8G+&^OC&2F5E
-M2<SZY<A!<'=;5-12=G_Z@;6)DA4#"`,5]N[^8!P29?J7E=T5'1!@V.?@X>'B
-MZ.[Q>A04>>26D>)086-WR>7YWW9Z?%[U__142'9-U<3;67MDX(*UCY00#0@!
-M8N?K_&(<$'+GE.Y%%QP08<?GX./@[>GO]WAJ:GSDEY;C561F==KP]M]-<718
-MVLO"54!)1-W#W4MG?I6,M8+G'PP)!'_CZ,MK'Q9TYY7@=A<2%'#VY.?FX>WH
-M[<-D%6AUX9:7Y$!A84[UY?['3']]1,;WR-Q1U-/474]\8&3OC8J-Z1`"#@1F
-M^^/%:!P1<.25[%!K$!1ZWO/XX>SIZN_U>FMI=N65Z_I2?GY;S/#*UTYQ=5S>
-MQME165Y4W-!<='MF59N+BX1(!`X-'5#BX487'6[1XNC_9181:7?`_>?MZ>KK
-MYT9L:F;$[Y3LRDM^=-?+]<=02'!W6-G!V='4UM)33G)E>>>`BXR1:P$/!FC)
-MX_)E$!9YR^/A4&\7:WI6PO3[XNJ4Z?5G%&IVYY24YM=]>$S;]<W114U'7-;8
-MW5-%6E;<T$1X8D:8BXJ'30<)#QQ4[NQ2%!-BW.'BPV`6%&9=SL[U^.V4EN]1
-M:19IT>F6Z?%(>W'5SLO:74Q`4M#9T%A:7U)4441R9TV?B+6!V@4.#AATX.+4
-M:1%CUOCGWF`7:GI3S,3!^>^7ENQ8:Q9IW>J1Z/%#?G%2T5==75'6W5986UI'
-M5,SUV45R863KC[6,Z!T,"09B\.#,9A=L5_+XW&<4:GI3PMG4R^"4D93R9Q<7
-M>_J7E^#$3W5%7%A#0%+=V]1;3$Y;U\;-V5]U>694A+6UA'`&"0P=3OG_2VYH
-M3_;QPWUI:V=;T5!,4.65D);F3F@48]_LE>WSWU354TM_?$'&]LO40'5,4-G,
-MS]Q'<&5G]X&UB9UH``X#%%+]S')B9MSTVEAD;69,T%)*=]SCEY"5]6$7%7S]
-MZ>_XR<_.Q5Y\9GW9_OG.679Q1M;'PL#<3V=C_HVTCI83#0D!:5_.6F5G3OC\
-M765H;GG2PT=_?<SJDY#IQ69K;73UY?GP_^?YTGQC9D;PY?+1=WU/T\#-V%),
-M=']FYXZWC^@?#`X'84%12'MRUN?)>6-I84['W7YF<_Z6DI;G761@>TC8\O_[
-MX>/P26%B>=S_\]="1-W/TDE\<U#(S$E@^XZVB>L9#PD'9DMW>F5%\N_*8&IJ
-M9=?*5&9C3N.2DNOP6'![97M(QOOB[N';?V%D3L3TQ5-?UL_VW75V7,7?6WMM
-M^XFQCN<%#`T;9&%K;'#SXNU>%!5D5,C5>&A@V^J3E.;VPM-W8&QYRNWJ[OM4
-M<'UW0E)17E'']\K01DA-5]_70WY@18&QM9`3`P`$%&L3:D/@Z>5"%Q1WV-IQ
-M8V)^\^B7Z^?GX/M':11AQN#@_,G#S]E`?GM(T\#'W-!75-#3T-7?WEMQ8$:!
-MMHKJ'08'&A$3&!?$E.O#9!1BW\M!8FY^UN7BX.#ME>["9&AB3,+TSO?FX/]9
-M96=QU]A77=+V]M9+<T;.\]QQ>V7#@[:,\!P9$Q\<&@5OX9;D?V-F1O588FIE
-MPO7"]/KOE)3@661G<T%#6-KZ[N+)2G]V0UA$2$?%\_3<5=36W-)?=F1@<9^T
-MM9%O$&@0!08!$?^7Y'AE7_7T2FEK</78<UKFE)?NYO'40GEF>T[3]>3CY<Y2
-M=GQU4E-8U\W*S]]04-[!77)_=GEF[XNTGGAO=FH'`P`2].[/84OAXLQF:FU/
-MP$%D1N*6Z.3EY/%0?F9D2M32R^'LY\1"24!#=W!8R_SWT%_<S=!T9'E$061R
-MA;>/^&-)71\"`@5GRM9D=.F4]&9O?UA)8&Q8[97@_N*5X]%_>GUP<W;6YNCA
-MR]G#VD%X9'/6]<%<5<K(5T5/<$Y(8&[MB[64=/Z58P(,!A=Z86]RZ9'^=DG!
-M4F=O8$;]^,K]E)#C5UK!TGYM9D7W_O'RY^3/14%#<7Q,T=C25=?;WT%_<D19
-M?V;@CHN75N*6;`("!1<4$6I;E)3.0\KE1VYM<41?TO;BE.C\S_OX1V!D7MY4
-M5,KEY??<W]A9?'Y8Q%-P2\?PVW5R4/178&_&AHZ=QNJ>]`<`&1`?!1)RX>+?
-MS.F5Q6-Z4D-E?]#^X./DY.+AVG!U4T!S2<7P],_)]O?4=G=7TTQQ6-Q61457
-MVM%U>'=`\X>#E.&3DF<'&1T?!1L4??;`T."7[41,RL9_84_$R<S/\N;@\-C#
-MSE1W2%304U[9]/7=7M3`V$),W=-'3%A?04-86UI&3E63@ICDE)WD'1L2'QL$
-M'VE`V5OZEY7RTOKP2WI_1$5?5]KGX?_*_/K-7%S2VE-"0-W"4$_5]O365M+9
-M6'U]2$!+1-5;15E;_YJ'[.*=D'<2%!$?&@43;'5Y3>^4X_;A[,Y,<'5-='9)
-MP_S*\>3G\,KQS=K51T%:1W9*5-W6T\SWQ534U%Q-3$%(24MQ<4K!GX?KZ9^<
-MPA5L%!T%!QX7;6MYXNKCYI67Y<[575M_97Q6TT7%^.?__>7^\-I21$ET<G="
-M3$71PLC.],K`5D9!2DMV<4M-2W#AA)SFD)F4<F9B$!T%!!P4%!=1X^?GZ)#J
-MX?[/P$5[97=,?G7!\/?QYN+A_\C)T71[<G5[94+!SL7U__'>U]1`2DE.=DI)
-M?77:D9GME9^3^7].;Q8<!!D2$!UKP,OTYY>0Z^[CYOE0=G)W96-\1=73\>#C
-MX^?[^<U8<'=S9V=^=$9<T_7^]\7Q\EYT551P>'9_<.F?X>R9G.'4SGL5%AL8
-M'1(9$G%-3?;KE^J7E>GN^<136W]C97E_=U'T\^7FYN;]RL763WY\<W)R=5Y7
-MU=W,R=+<S-A175U#?'_$EI7UZIV7R-'"<F$1'!`1'1@4>&=YQ>[N[Y64E^CG
-M_O3<?&5R?F5E1-+2S/#DY/_Q\/#53T)`<7MS=7=+0%?6U\KPR<W"V5]*<M>5
-M[\/ND)7&VO=Q9A<0$1$2&11F8F36XN#BE)>6ZN_F_O1U?')[8&%U2TS=]/G^
-MY>7Z^<'3UU-*>'-P<GUR25+15\3Y\LW)S]%:2%WL[\/EE97>1L!,9Q44%!07
-M$A1D961&Y.;G[Y67Z^SD^?)9>7EP>V%_1=7=S?SEY/[]^?#94%-$<7%W<'UW
-M6EE?W,W$VL#:UU]!=797Y^;TY^OI]]W`77UM:6L5%Q$58&5Y2//AYN/HE.[F
-MY?S`1G=S?'U^<5O>PLKYY^?Z__S*W%A/=7!R?')V=$A:5M?8P,3%Q=]075!!
-M=53GYLG_[>W)5MA1<6-L;&YH%&]X<G%#]N3XY>#OX?[PS]M!<'!.14]?VO3P
-M]_W^_/'*R<7414]/=W%P=DE-1UG3V]?1WMS775U34D5"7U7(^_SQ_^;ZTU#6
-M4GUF9V9A8V-E?4A#4L[R_?;_Y/GWP\S'5UU6U]30V=C.]<G)R,_=45!06T).
-M0%Y<1$!>551?6-3=U%]&5]521EC74EM8UL#W_/'S___WT-171W!X?'E[>WYV
-M2D9>U\/,PLW(]</;V]K$W-C&Q]C<V-+<Q=S1T-C35M'1U%U95E927EY275E"
-M6U5?0U[154995=/0U='3Q-G1W-O'V=[&S<W%WM-74EA$34A*=75+0D)#6UY6
-MU=/:P,/"PL+#S<S;V-/=T]O8T%56W=%64%U?65I95E91U5W7V5%2T51=4%#4
-M4%!<5M74U57<W=37T]C=T=S45-75UM-4U5%=UU5055145%=45M?14EY645]%
-M1=;3U532P-[4T-C2T=)6T]-<6M78W]'1V]Y74%75TU=?4M=6553455]87MW7
-M6%U675+6T]?>V-[?V=_1S=]34=_67EE05%-&0=51TU)5V=%5U-_=5E!57499
-M5%76557=T-#1U=[<75+0T-#0T-G<UM?5U=-65%!7V%Q945=37]=64-W16%3$
-M5413Q-I35L3355;0T5Y4UM96U-=<UM#47=+&64-;4E545M+;V]16T]33UU]7
-MU5]4T5U5V%Q3WM-3U\Y15MS=55]61%;24\?2UU-5V%)=6-E115=3T53<5]'U
-MP-O1V%5314]05MA30]75547>P='37='2TU]#5E_=75S=U]I4T]7?W5S0T-U1
-M4-)1WMW15E+40EI15M'&UEE54]?=W=C:WD%%5E357-G!Q-W0TD=>W5=7UE9>
-M5==?T=+3U=1>1UU`U<#>U=_)TU]5W-E>4%=044Y&4=+1UMC)Q]C.T45U3EI9
-M0%Y3TL7$UM?#V%Q7ULGWP]-;65E$2E%5WL/5U=[84D!91U15<$'#]_?!U578
-M0G5?R=Q,4U/64%7=W=_9Q]O4P=5W==Q62%+%QM7'W%M8T51`7,[,1%S9T%!7
-M4EU<T\701%/,5-W'T%91T%Q17%+`W]U0VUU`5UM=6\;96];;QU[1TU+7V<;=
-M441(6$)TP?#UT=Q`<5'/WEOVR]9&=TM?VU#9]<_,PE!&<'!U7M'3U\?;VMY6
-MWM3=6U_05-305=W%7M_>4M3;7D720UE2TEG5VU3<V--5U=U4UEQ>P=-5W%=>
-MW59:6U#3W%]5T5)7Q-1:U<3%443<UU32T%?$TM!<5-)87];74M!10U/7TU!1
-M55=?W<=$UL/04,W;4MW07%-45U1175??V%;5TT%:WU734EU9W=!175[3T-U4
-MWM!7V<S?4,!4459!6]C875304M937E!85,/<7MQ24-99V_7%5%51=$925U15
-M5MC#6]S0P\=-5=?:W$-:5=)&5-E*UL?U5%G$4]M675Y5Q-501]O4=<_93$'5
-MQES=U578WMA?V=-9W=;4UE-04=#475[<QUQ>TU%-U=I85,725L3<6]%15=!4
-M5EU<5E1$U<O"UD79QE!24DM?TE;=5]17TMW7WUW7T%9?5M'5T%]5UU3%V<?!
-MQ%U$5UM5T75T4=M65\'$U=/%5UM77]3375U44M/>5]'0TU?15MC9T-G7T=)3
-M4D],64=-6\7=U,+U45#UP];?UUU0Q<Q$=%W74EI43%G;V4=&S]_'TE?'T51>
-M45)37%39T<W=5,'27$5=U5=004-?4=;?5='4W,_8U<7&15_55TM?R\S45-!>
-MT=E43%Y24]];6-S64U7?4M-86==8U%?<V<;$T,W$U-Y6T59`1M?65MU;6M_%
-M5DS=Q=/27%!?U5/57%/:TM756%C8VE97TMK&V%'6W%U=05;775=75%!15-7=
-MUM/6T55=W]U555]4UMG=0%?04%G3V538U5!94E54R,1'5\'+4$]$05A7UE?<
-MUMS?T5%=Q<7%UE514E5-6M'5T5=5UU;0U%S6V,G<4U94UU541US9W5->7U[0
-MW-145M#24U)<6-'6WMS0V=K95]514%125E!2W\345=[77M=17EW45EM5WU%9
-MTMQ05<3>U]'<UU?74-#=UM%94U%24%?9U5565-U>75756%W67E;<W]+2W]3?
-MVM147]?<T=96W-=3TUU24D594-3>T%165U!7TU)>WL_17=S3U%'0TEY7U-12
-MUE10W='47E3>45E=U]O?U%#6W-W15=U45]72TUE?4=77U%->UM=5U]?76U#1
-M7E)05M+=UM/9VU70V]955U?2W-52U59%0%Q74=77W57<W-[$7U;=V-1?U-92
-M6592U-O0W=!64E/2UU-75EE1W%=1U514T-)1U-#45-33TMQ5V-_655Q4U]16
-M5%U;4T!<UE97U-I4TL7<VE]275'775)<V=G?T5=45-O57E57U]S24E+0U-/1
-MU597T-38T%%5W==96UM14E#6W]-7T-?274?7TM11T]G3WE9<1T!65==2U-+7
-MV-G%V]Q75,73U=_=55=44UA36%%45UY945U7U%76W-S1V</=U51445Y14U%6
-M5=[0U%;7W]W1UM787%C55%!:7%/3W]93T,'1T=[05D]/24Y94-CT_?W]]-A0
-M0'5^97AP05#3S??W]_?"TM964%=4V<7,S<;:TMU90$M+2W5V<GU]=UC$R,S/
-M_?O\SMA31$5?4-'-R_WVS]C04DIP<G-W=G=W3$5:75?=R_#Y_O'W]_;:UUA&
-M6$=!2UQ45-1=U]335%]:3T]$64=#653>VM[:R<O*R\#&S<W;T59<75Q&3W5,
-M05Y905/1V\;&V]+&Q-W05EQ=4U];7%)>7U]24%35U][9Q=G8WM/>V=G2U%14
-M5U-6U5)97%!44%-24557U5=15M79W]75U-+45]34U-/9T=31UU36TU73W553
-M4=575E%34U-=7UU75U!4U=;;Q-]6U-/7W=S>T=#25U=555]87EE<7%)34M74
-MTMS2WM_>W=W0U]574%!15E;5UM36T=115=;455)?5E345%U24U71W=C<T]/0
-MU%=64%945555U=?4UM;4U];4U5755%755E%745)=75U65=34T=/=W-'7UM=5
-MU=#1T]S<TM#3UU544EQ24U)=4%U>4U%5UM?7T=+0T=35U]'65%?4T-_8W];5
-MUM=55%!=7%)=4E=04%;4T=/2U%74UM;0T]?7W-S445-24%%14%74U=155M76
-MU%74UU75U5%3T-_3W=%5U=945]?5U=;=T]545=#055Q>4EU=4U;5UM/2W='7
-MUM=55%75U5114=30UM?6UU565E!1U=55U-;7U=?45]73T5575=33T-=55]?5
-M5U!05-515E=75]755=?2W]S15%955%-2U=/3W=W2UM=74E-05U175E=55%17
-M5]?3T=;55-70T]#0UM?75595U5%655=5U5%25E915-575M75U-#6U]#2T]W=
-MT-#655%04U?55E;4T-=55%=55E!4U-?6U]76TU16U=575=35UM'6T=#75E17
-M4%945U=75U37U]75U%105M35U=34U-#<T=31T='7557555574%U15%975U35
-MU=355%=15-?1T='3TM'7U514UM#7UM'1TM!74%114%164%955U-05U75U=?1
-MT]+1U]'0U%345571U%-7U5=4U%35U%%6UU57U575T=11U=975-36U]35U=57
-M5-74UM=45=?45%114%36U];3UM;1U%34U%1555915%145U%6U]/7U-#=T]'4
-MU-?55U)145%55%37UM;0U%34U5%755=7U5=1U=575=74T='4U-;5U]104-;7
-MU=#2U=?3UU145E?55U%5U-545U%455!25E175]31UM'3TM/1U-34TMW0T-#6
-M5%%75E%=75174=5445955E37U];6UM'1U%755515UM+6U]355%545]?44577
-M5E955%?7UM'1U534U5=75E?4T=37U]30T-?4T-/555==4U934=74U]?5U=54
-MU==5U=?4U]=55%9655515-?7T-;5U==5U-;5U-955U545U155-36U-375=74
-M5U!4U5=4U=55U-?7U];6U];5453455%5T=?6T=;6T]=5U]35UU565-165=%1
-M5-'55=564%754U=45M375=;3T-;7U5745=575U75U=36UE555%565-545]36
-M5=755U355576U];0U]37U=3455975%=75U?5U-55U-;1T%55T=/75=37U]95
-M5=74UM145-77U%164%?55U)35%175U%4U-'6UM;1T='6U];3T-'1T-/15U!4
-M5U%15U=145=05E905]34U=31T=#0T]S<T-/3UM17U=3455=65%==7%!=4E=7
-M5M77T=#1T-/3T-/3T-?1U5!75E-05E!0U-56U=15U-;7T=35U-15U=;5U='1
-MU-7455555-555-575%565-'75-74U-974=35U]'75=;65=555M755%144575
-M4%;55=;0U-33T-'7U=755%355%37UU54U-34U%555%37UM;75E775%945E;5
-M5%%755155%%6U]?6T-;5U]#7U]?4UM#1U]'1U=355E%15%97U%=7U=?7U=34
-MU-=45%175E=14%;5T-96U]/45-555U=75U15U-?7UM?0UM77T=?7UU54U]57
-M55=4T==5U=355%57U574T=75U534U575U];55U555%%14U=45E965-54U='1
-MU5534-=55-73W=+>W]#=W]/6UM7555%04UQ34U!05E74U=34U5574U-55577
-MT]/2W=/0T-#1UM95U==75]355%=04E-145!145'5T==4U-;6UM+3U];7UM;4
-MU]'6U%575U=15M755%34UM?4U5=6U517U=;455145595U]?4U]'0U]34U=77
-MU-555%164U#4UM70W=;5T5515%575=?1T-/65M7655745%355U'7U]74U535
-MUU575%%75-7455%7U]55UM?1T]=45]5455175%175U145M745-?7U]?1U]36
-MU];6UM;6U]145U%75E955=76UM3655?55%945514U]#1UM145-7455955%16
-M45%5U=76U]?6T];7UU55U-14U-%55=?4U%505M574U!05E155=?6UMW<T-'0
-MT-;55U=55U-7U-37U-76UE514%=04U%75U=4U-'7UM'6U-?7U-#1U-;1U-34
-MU];7U5=25]=445775%355U775E=45%5545?55-77U-+<T-'0UU94U5=5T=;7
-MUU565U!34%%45535U=;0TMS=W]S3T-?555164%=65=545=15U5=05E=145=1
-M5-?6U]?7UM'6U=34U-355U34U5=15=?5U];1T-'4U556U=145-31UU?4U%71
-MUE;5UM545U35U%165%96U=75UM'65536U574U515U5545E76U%77T=;0T%75
-M55=145%65=155U74U=575-70T=35U]+0U]?7UM;455155E345U!045%75%35
-MU]?5U=?75U34UM;0T-'=W=;4U-=55=545]545]575E=64U-15%915M77T-;4
-MU]?4U-57U-;4UM'7U=;6U=75UM?4U%555U!65=34U-?7U%545E955%975U35
-MU595T='2TM#6U];55E%75595U-?6U]55U-355%=5U%5555=4U-54U=75U-16
-M5]365535UM14U=77U]35U-76U]?5U]?455=45%965E%7U%17U=?7UU75U-75
-MUM'4U-'0U]37UM75U575U%175=545=35U555U%54U=155U=555?4U577UM/7
-MU==5U5555%155U975]355E76U]34U];6UM;55%165E15U=?5U=76T-'55-?5
-M5E%15E355-31U];4U5545=36U%77UU75U-37T-15U%1655165E14U=755%15
-MU=?6U-76T574T=77U%=5U-54U575UU57U%515E%05]75UM#1TMW3T=+75=57
-M5=155%555%5555=5U%97UU9<5E=05U11U-#6T]/3TMS=T=#0UE75U%574%!6
-M5=5555155517U575U=36U515U5555%;5UU575-'6U5745=545E745-74U=77
-MUM?7U=75UM94U=175514U=345=77UM35UM15U%165=355-75U=55U=?7U%15
-MU=77UE?5U%17U51755155E%75%76U]34T=;0U-375=375=?0U]34U=154U54
-M7U'15U945U;7U%77U-?7U]35UM'1UM;0T=355E!45%=455?5U5=4U=365%94
-MU535U]36U574U]31UM;6UU755U=65-77U57555975-?1U=?6U]145%165%=6
-M5]74UM;1T-;6T='45U7755%45]745-70U]74U5=745-645;5U%35U]'1U]31
-MUE165=55U-74U%7555=4U=?1T=;45E;65U36UM34U%=4U%5645!34U-055?4
-MT=;0T-;0T=;1T='1UM?7U]71T-175%575E!65U=15E=14%915=555]37UM#0
-MT]/1T=%45E555M70T=37UM'6U]75U=545%=55%545E3455145=37U]76UM35
-M5%94U5555=75U-54U=15U5555%34U=77U];1T=;6T=55U%575U%05E=65E77
-MU]54U%74U]34U=77UM55U=?1T=;7U]15551745%65U=6U='7U-;655145535
-MU=36UM#0T]#0T-=45U9045965E155E9455=75%75UM75UM55T='5T-15UM?4
-MUM;4UM145557U=545%=655565=?7UM'4T=#75=545U545E75U5545]75U=74
-MU-;6U=76UM37U]'0UM?75=755E945E%45%=74535U=74UU74U=71U]37U]#1
-MU];7U-55U534U5175U35U514U=7555145-?6U];1U];65535U=74U-355514
-M5%5445914%-24%%75-77T=W2UM+0T=;45-37U=34U]'1U]?7U5545E965E97
-M5=77U=74U-575U15U-75U534U%35U]54U%56U5545=37T='4U];7U-34U-74
-MU%74U]'0U-3655355%?5U5%65U965E94U5575%=4U-77UM?755'5T]'7UM'1
-MUM?6UM?4UU=045-14U)65U74UM?5U]15U-;0W=W=W]W7U%564%U34E/1UU%7
-MU=;65%965=#-4WM3RM%(:W.6YEO"ULCYSF-H5)F3%AQOYY+-$1'0Z^#1UTY[
-M<'+SY^7G2G-;6W=[?W'Y[>_G<&3`Y=/24G==1E],8&ET]<WP^?3%T4]6\L50
-M5<[(V\/75=%:=79E?='81]'7V_+$6,%01O/UT$96PL347EA;4DE+T_?(U71]
-M4\7S\<1;=U51W5Q8TMC`7%S66T5?5U=9V]S7T-C-QL!34<S26W1W34755%31
-M5U3%V-G7T\?$5DW7PMW42EC0W<]?4M;745]115-1U<_'V51?1E_9V41:W=O9
-M5%Q>U_7+1G;5W5'61E3&WE-:T5#8Q-7<55=14D=$QM[=W5!<5<724%A$T,W9
-M55I07U+?V5!44=?%Q\1?6-=45E=;6-/26E#=T=C?64!<WMI415E6W]O1T%_3
-MQM=96=1>U=)7TU?>Q-/25%]3VL'54%]=4-'07%U145'9Q%1=75+7W=%5T]S3
-M5%A6TM9<7-30VMA06E_9P]=:0UE5T=-14-=5Q=A17=+!T]=26=3=5U%4U=96
-M5EQ'7U/>5=?$5M/?VM-25-564='?5-'0T]=74E514]964E?1TU154%_0TMQ5
-M7%964U;7U='<Q-)075'=U%)27];:V-%47M?75=!55E_6UE745U30UM944514
-M4UA<U-_;T-W4U=+455)94E?75=30U]-15=75TE53U=914=537=;0T571TM+5
-M5%36TM+65-?7UU%75%U05U'5UE51U=;1UU1%=TM'7U30W]O%Q\?'Q,7;V=[=
-MTM#6U-545U914%!34U-34U!04%!145975U155=75U=34U-?7U]?7U]?7U]34
-MU-34U-34U-34U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M________________````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-$````````
-`
-end
diff --git a/share/isdn/6.al.uu b/share/isdn/6.al.uu
deleted file mode 100644
index fad3d5c..0000000
--- a/share/isdn/6.al.uu
+++ /dev/null
@@ -1,278 +0,0 @@
-# $FreeBSD$
-begin 644 6.al
-MU=74U-74U=755U965U=65U=45575U-?6T=;6U-34U-155=75U-1555545U=4
-M5%155555U=75U=37U%755=55U=56UM#2W=/0UM955=74U-36UM1555545U!3
-M4E)05E=45-?0T]#6U%54U];7U-15U=37UM145U77U%=0451455575U34UM?6
-MUM'1T=/3T]'4U]/45E!0459645=55=77UM=55E155%97U=;0TM#75=36T556
-M5=37551645=45555U=34U-355U15U=?6U]75U-3455=75U145=74U-34U=35
-M5-755=34U-?7U5145555U=?6T=;6U]?4U=545%965E975U15U=74U]?4U=55
-M5%145=75U-?7T-/1UM?5U%575%545E%145%15U175E34U];2T='3T=?7U-55
-MU=37U]5555=645=45%114%95U575UM'7U];6UM?6UM;6U]75U=74UM;455=1
-M4%!34%975=34U];6T=;4U5175U?4UM'6U5355%=5U5175U=75577U-?7U]?4
-MUM;6UM?6UM;7U-37U]575E%14%975555U-355%=5U=555=75U=?7UM'6U]34
-MU-?4551455175%555U=5U5=4U-34U535U%555=36T=#1UM?7U-7555175%=7
-M5U=55=7555175U35U%74U]?6T=;4U-?7U514U=34U=34U5575E975575U-?7
-MU-77T==4U-7555=75U75U-34U]?4U574U=555%=75U=5U=74U];7U-545%14
-M5U35U-34U-36T=#0T=;455555%%15E975%555%35U-15U=?7UM35UM#45=74
-MU-35U-7555165E1645%65U755=77U]37UM;7U];7U%55U=34U=555=755514
-MU=;7U-555=74U-31T]/1UM?55U965E914%%45=174%145%555=36U];1T]/3
-MT-;7U]?7U-34U-5745%145!045975U75U-34U-355=74U]?7UM'1T='1T-'0
-MU]5555165E!045%645=5U-34UM+<T-#1U%5645915E?5UM#1UM;7U%545E%1
-M4594U=?4UM'1T-'6U]555U9645!15U545%55U-34U=77U-555=74U]37T='1
-MUM?7U]=55%3545-65U355555U=75U=74U-34U]?7UM;7U]?4U-?455545%91
-M4%%75U=75=75U-36UM?4U]155%=75%75U-34U-74U-355575U=74U-34U=76
-MT575U-555%34U5555%145%=75=75U=37U];7U]355%=45U145=34U-?55517
-M5U35U-75U]?5U=74U]'7U-75551555145-37U-?7U]?4U597U]?7UM?4U=37
-MU-3555145%975U55U5545%14U=36T=?7U-;6UM?6T=;4U%575U=75%555%17
-M45%145=5U=74U-36T]/1UM?7U]555%75U-145-55U=545%975574U=745554
-M5=36T='6U];7U-?55=545%75555555555%175%145=74U]?7U=74UM;7UM;6
-MU%555%=65E=65E15U5565-15U-;6UM34U575U=?7U-34U]34U-555%1645%1
-M45=5U=74U-?7U]'3T];4U];4U-75U55445965U175%175U145=77U]?7U-37
-MU]?5U='1U-'1UM545E9145%65E155=35U=35U-?6U]545=31T]/0T=;455=7
-M5%555%=14594U=77U];7U];7U]?6T=?5U-?7U-?4U515U=75U5577%U04%35
-MU-;7U]34U-34U-7555145=37U]?4U=545514557555155535U-34U-34U-35
-MU=75U=34U-34U-75U=37U];6UU545%145%755576UU155%=45%145=75U=75
-MU=74U-34U-35U5164%%15E145575U];1T-'0T=;7U]155U=75=75U-75U575
-MU-34U-545U=65U74U]?6T=;6UU35UM74U-555-75U-?4U]3555145U965U17
-M5%=75U155=75U=?7UM;6T=;1T=;755914%!15E3555575U54U=37UM?7T=#0
-MT-'6UM'75517U5=05E%65%75U%75U555U5555=75U=?6UM'6UM;7U5914%%7
-M5U965U=45-77T=/2TM'4U-37U]34U=75U=755%=45%145%75U%555555U-57
-M5=35U-?555555555U=74U-37U]?7U-?7U]35U-555%=65E%65U=45575U-34
-MU]?7U-34U-34U%75U5755555U=555U915E=45-74UM;6T-S3T]/1T=;45514
-M55545=555%=645965E=75U=5U=?1T-#1T='6U]35U5575E%65%555=755%75
-MU=34U-35U-75U5555574U-34U]?6T='45U=75U145U=75%74U-?6UM?55555
-MU=34U-37UM;7U-555U=455545%175-55U=34U]?7U=74U]?7U%545%15U=74
-MU];7U%575U%145%14576U];1T='6U]35U=?6UM?4U=74U-75U=555%555=75
-M55145U=75U15U-?7UM'6UM;7U-75U-35U574U]?6UM?55U=65E!15U15U-37
-MUM?7U5?7U]37U]155U=65E=75=34U]?7U]34U5575E975-74U]?1T=;7U]35
-M55555=755=75U=55U=74U=755%35U574UM;1U]34U=34U-355595U%75U-74
-MU%545U=14%%65U155=74U];0T-'0UM?555165U=5U=37UM?55U=45U15U=;1
-MU]34U-575U175=74U]'1U]37U-75U%545%15UU11U-=45=555%=45%=5U-;6
-MUM'1T=#1U%15U5925M7655?4U-544U'55515UM;7T='0UM'6UM#1U594U516
-M5==74E%75=355535U5=4U=15U]/1T=;5U-?7U]155E!045-15=355=55U=?1
-MT-?6U-77T=55UU55U]?7U]175%=14U%45E;5U%555%37U]'2T=?5U]#75=#0
-MT]W=T=575U=34E934U975%165E75U%15U514UM95U=31U]'2U]'6T-%4U='7
-M55%75%!05-514%345536U]#0T==55=75U-34U-77U577UU745575UE504%?7
-M5U95U-74U];0UM77U5?555=4U]'7U=?5U535U]345]75U=1755575U375=?7
-MU]75UM%75=?55U745514U%34U5?5U%=55U91U=;4TU545M775=;0U]'3T]?5
-MU]575]37UM%04M37U-55U5=045)4UU14U-#3UM?4T-34U5%645!75U94U];6
-MU%76T=144594U%74T=?1T]'5T-'4U=75U=5745!745!44%'75=37U='7T=+7
-MU]#35%?1UM=4UM%05%=45U144U174%=45E545=30W-W7UM'445;6U]1455?3
-MW=73T-757%U35%9<5-125E=5TM#7TM/0U5315M?45=?655!4T=345U74U5=5
-MU%%4U=555-;1UM+0U-71U]77U=76T5535%9645U>5%)75=;95]+1T51=5]74
-MU]?0W=S4T=%4W=15UUU745=54E)=UU]1T5'6T%'0U-W4U=?1UM'9T-77W]=<
-M4%=64]765=-645-6557255)64=)44E32UM76T]525MS=U]/?UE=25U=55U77
-M5--65];1U5)35%=4UU=5TUS1U-?6UMG44U)6UMW44]W55E1<UM504U;2U%15
-MT-_4U]S44575W])27--54U19W]985E325%W05=)37<;14=3=U]754]=6T-Y3
-MUUY4TU'2UU%>UM-3U%11U=U7U=S16%35V-95T5#57U'=W]U6U][9UT?6W%1>
-M4-Y47%U=U%7555=4UE!04]G55M;6Q-%5T];=T%344]=%6%%6QE-4P]#04T?7
-MU%-76=?5T-+7U='75]_?U5/5UU_<6E[4T51?U-7<U5W0UM#8T])3W-)6T=)0
-M7%14U==1T='7TUA67UQ$7-/6WU?<Q]-75=;<55I>UM31UM73U%/<4U36V=-=
-M45537555T]/6U-5>4-=74]305=S5U,''W5U64%Q<4M-4T=95T55:5-/1W5Y!
-MW=->55355-K?5%)4WUY<PMQ<V][9TM'4W-U50U=92M=>1MA40-W37=C-U=[&
-MW5W"UT)655M?3UC25<?9P-A>UL=!6-5=7M;?7UM1457/R\#-W'11T4YUWLW/
-MR%M,7EA66D]3Q<S=TME94]C?4%!84E?04E'UWUW>V%3$U5C=TU180%9=1E#5
-M5U=1U-W:V5]?P\165]=54533UU]1T=W3T5+1VD1<Q]-;5M954U%9U-C5UM1=
-MTM145591U-_1T5-6UD%'TE75V\#9V]K8T4!/4MU'5]72W=!31E?57=?76EY=
-M5E'3U=)0WL7:T=W%QL''P_?&5%;4UUE$65%%1UE<6D1+6E!<15734$5$3$-+
-M<W%$6T?4]/CGX>+OZ>_L[NS@^O'62F5L%!81$Q`7%&AC9'YP=43>Q-#<QL?(
-M^.R6GYJ-BH.:AYO[8AT&`P(+-0,%&!?4[IR$A(2!A97/16\>!P8'&A\0>.?K
-ME9.>G)3@^NR!B)'F@X/@>F,1'1@+"@4>!@5;DY^6D9J:X69M=F@%!!(7$A\4
-MV^/TV^F$B+2UB[6U@.=M'08(-C$T#@(&:>F;A(&)BH'H]T40``\"!@<'$MSO
-MX>V<A9_IY^.'MH+<AK6<86H7'!L)-P,6!0-HD9&0A8>$F?QB>6$$`!D3&!@1
-M9_#XUN.<D>^%M+:,@HF-D&49!`8(-C0"!@8=])V:FH>,@I;6UGP>```%&1L>
-M8/_YP.*3D>+R_92#BX"$CHZ?PF44&`(U-0T!`P=_Z)26A8*-F^#@X&L&!AH'
-M``<1<U-0YIV?E.Z4EH2*B82#CH3T8Q8%`@LT"`$!!FGOD)"8@8V!D_KZ7!X!
-M!`4&!A]M7,'SE)^2ZNGI^>B"C9^$C(:5T681&@(*"0$``QW>XNB2A("`FNOH
-MYA0'!`0"`@009-?SEX6;DYV?[5STA(Z6^(."E69C>1`!"0\;&@T%VNKYYIJ#
-M@9/CZN46!P49!@,;;$/>Y9V%G):1Z5]R[YB;FYB!@Y+(1'<3`@\#`PT"&&??
-M\^B:@8::DI7X8QX;&@8`&VIZ4>"3F9Z=DY7P<&)4FH;EEHB"[L?MR1T&`@,&
-M#`X%>WUCX82&A9B8G^QD%A4<``$2%!9G_^B5E):0E_C8\I68AYN8@H'E5_=B
-M!P,!`@P"`1EB3]N5A8>$A)Z7Y$L5$AX%!!X1%7K%Y>^7D9&7Z.;ZY):&AY2>
-M@YU`=M,7!@8&``,!!1!A<-R4FYN?GYF7PG%D:AX;'1`0%7/&^>V4D9"6E>[@
-MY)6$F_J0A^IE?_05!!H>!0$$'A%I8'7AD9"7G9Z5^_;89!05%181:7EU4_#M
-MZ^N5E>OLX>"0F.CAG)?=<,9)$A(7$@4:$A(3%6=#PN'KE924ZN#^]U-_9F%M
-M;F%P0U;]XNSIE97NX^'PV5;8]-9,V_15<EG8<F%E?V)J;6=F8'Y:4%;8]O;/
-MS_?,W-K#V]_`R<CU]O'W]\G!Q]C74E-06D=:7EY25%75UM'74%U=6T%%649`
-M65U;6%954E/7TM#2V,7:V-_=W=W75=77U%575]154U#6T-30VL;:V=C?T=16
-M4UU?6T5>7D5:4E914=?2T-#=W]/4U];755;5T]96U=9775)145!4T-S<WMS<
-MW='4U5514%=74%'5UM55T=#755145U904%?5U-?1TMW=W-+6U5=075]>7U)6
-MU=36T]#55%574U%5U]?1TMS=W-_=W-W6U-155E)34%)=4E965U755=745%=4
-M5U%65=31TMS?W]_=T];55%%27%U05U15UM/1U]'1UM?455575E?5UU14U=?4
-M5U%14UQ=5]?45=/=T]'1T=9545%645-15%75U=?3W=W<WMG?T]/3T=565E=1
-M75]24U)<7%-375-7U=?0W-_>W]W=T];4U=555%=65U=5U-34U]'7U=7545%5
-M5E94U=55U=75U];555145E%14%%75%55U-74UM'0T='6UM'1U]77UM55U=15
-M5U145U175U34U51555=75U=75U74U]37U-?4U]355=30T];1UM;65%=75U=4
-M5U9755=65-75U-;6U%35U5545554U=34U]#3T]'6U]?45%=45%=65%545U14
-M5E975515U=37U]?7UM;7U]'0T-'0T%175%965E965E904%955-77UM;1UM;0
-MT]/1UM174%!14594U575U=755=5555555575U574U];0T]#6U]?55U145U=6
-M5U55U=77U]?5U555UM?5U5145555U=36T=#6U=555U145U35U]75U-555%17
-M5U155=75U=74U];6T=/1U]34U-545U945%=455545%175U175%555=36T=;0
-MT-=4U-'7UM'6UM3555145%904%-15U=4U=34U=3455155555U-37U]?6T=;4
-MU=75U57555145%15U=34U-34U=75U5555%35U-75U-35U=545=;45=155=34
-MU=75U=36UM;7U-75U5175E=75575U]?6U-7555145=35U=34U5155U155=76
-MT=34U-34U];3P?')67Q[<$=4U5=4T\3"QMG0UMW?UU=755565-/=T-77T-#1
-MUU545%9145!145-?653SXN1:8VQ]W=M`?'-3\?S,T]SU\O3;U]767D5&6UU9
-M45165]+9W=W1W]!645?655A?U-1865?4UU-045/2T-S2T\?$5U_<VEA:5M15
-M5%!755A=T-75U-7#T]'7WM/7WE/7UU5415G64UU55M!=4MO4UE_2Q]!?7\;<
-M5%/3Q]!<4-?8U$!6U%-=6U9<5==<UMS1TM/45-W1U5W2W]%5U-O95$;4VUQ8
-M5%+5T59?4M947E;3VMW5UM/5T]#65]+8UU%;4-567EQ5TE%04MW?7=#15-37
-MW%9>T=+14%'1T%]1TE36UM;0T554T5!;45'5U-'=U];54]/14=34UU365%;5
-M4M?44=!5TE=1U5W4U='15]+3U]954E?54M/45M%55U155]375%;5U]!55-70
-MU]'6U=73T5U0U%935%30T-/44==7T%=?U5-3UU?6U=;0U=?6W==75]=25M95
-MT=76WU374=;4U-11U]55UM=14%715=Y55M=5T%)355=075#655?5U]U=W=_3
-MW-55T]_44%745UY5W555U]'4U%9445547U91UM%6UE70U5104=#=T-31UE/6
-MTU145E305U3=UE105=_175G4UUY=4]70UMC>TMQ6T%!?5%%65=?05U35U=;5
-MTU]7T%354M?65=95TE%4U%%24=_0W-#4T]%47UW7UE-24-71TM16T=%44]/7
-MU%;7TM;7UM%4U===5M1?U%!4UU344-?0TE]0V-U45]S55%355-%44=#155/5
-M5-765U?5U]36U594U5=45E'0T%50UM%6UE71T=105=;=UU/1UUW2TE56UM35
-M5E!44%74U=#04]365=73U%/1UU%77=Y35%77W5934=W2U595U=315U#2UM%6
-M4U77T]/75=#74%;65%_55ES0UU=1TU?4W=55T-S55%?7WM514%'45-37T=71
-MUE!04=;655?6UU9=U]-6T=974%705U'44=;14595T-7655?0U]31U5135%-5
-MU--44E34U%%6T=;7UM;?U-55U-15U%75U5175-!?5=915=;44U/6UM31W=/5
-MUM985U124]/35=/65M;<W%91T];145]=4E144]37U5+65=3<T]+2U5+7UM;5
-MUU74U]?64M5545505575TEU?4=%4T=%55M74U554T='?UM?2W-54U535UM75
-MUU355%117=577UA6T]?6U='2U]%7U-;05=;65=#<4E+645=65E505%514-/1
-M5]75UE36U-#1TM%44%!75=555=!65E%545)5W]!35M;>5]?2T-/1T=135%#7
-MUU50T<;365[7T5]<4U;74%30U]56WM=4T=75T51?5=+1U%36W=+=5]945E92
-M4EQ3U-/4U=70U]'44]364=?75-;1UU915-/245+1U]=25M30TU/65E14U5!2
-MT=?35=31T]!4T-;35-?54-5455)65]-74-S1UE76U]?57=164E755%'7T-W3
-M5%?6U5-=4514UU77UM364=?4T-W755;5UU165=?4TM[=4]307E547UU0UE57
-M4='35-94W-/54-79T5=5U];54%/5UU10U='45-507U?0T-36T=;74E-6U%14
-M5U555%16TU30TM15T=[5U=?6T%3155;4U5)6U5]675!65M95U='1U]'?T=?3
-MUU12TU9=5E705=?6UM/15]31TE96U]574U-5U=535]/0T]?45-K245U445]2
-M5=?0T-W0UE!;65A91D525U15W-O&PL'&Q</&V-?455%54U]>5M5045I>7U)2
-M65Q?5E%6U531T=+9WMO;VMG>WM+6U5=14U!27%-65U=55U975E%14%-45537
-MT-/<W=+0TM/3T-#0T-=445904U!75E=5U%565U1755545575U-?1T=#1UU16
-M5-74U]'1UM555U=75]77U]'6U5175U355537UM35U]'0UE5555=14%!34597
-M5=75U=;6U]?1UE74UM?7UM#6U]175E175%545U145-77U5145U14U='0T=;6
-MU]?6U]37UM3555=45%=45=36T==45E914U-04U%4U=36T=/3T-#<W]W2T=54
-M5U%24U975U165U575E!05]355=355=;6U]/<W]G9W='0U%155E!655=65E%6
-M5%905]54U=575E15U=?4U]W<T];1T-;55%1445%64%95U5=45%%15-76T=;1
-MT]#6T=?5U=145-74U=755%=55%%65=555575U]37U%74T-#555175%175=;3
-MW-/5U-'545964534U=74U%=04U-15E35U]#3T-W=T=76UM345%!655915E%1
-M5U96U-;5U-?5U-;4U-'7U]#0U];45%554U!55%?7T=;0T-;45%)245!34%-1
-MU]'6T]+6T-W3T=/1UM=675-14%-4U-'0U=72UE=75E;55%965]76U535U5=5
-M5=74U]37U%14U-54U='1UM34T-/6U5514U!=4E355-'<W=S?T]#2T55555=5
-M4%Y24EY<5U15TMW6U]54U5905E=4U-?5UM+1T=+1UM/6U-355U144=745E34
-M5E=54U-65U;4T=?6TM;4T=;4UM#6UM'455=145!24U145%74U]?7UM'655=6
-M5-;4U='1UM34U-145-54U=?1UM545E!24E)25M75T=+6T=#4U=;7U]#0U-;5
-M5M7655155U?55%9555%55%975U;5U%37TM;4T-/6T=?5U-=74E?5U]#1U-'0
-MU%755U!745U15%37UU35UE57U=75U574U]75U]?4UM?5UM145%75UM;7U]?4
-MU%57555645-05%175-35UMS2UM'2T-15U=#3U%75UM%55U1445U=4%-15U16
-M5-?1U]?1T='1T-'1UM145E1555175U965%17U='7U-?45=?7U5145=75UM+2
-MT];1T-;555574%-15U175%35U=?7U-?7U]555%7555=75=35U-55U-?5U]'7
-MU];555755%555=355E%45%165]77U]34U-#0UM75U]37U]35U=37U577U%55
-M5E!645U0U555U]55T=%55U55U-15U-74T-#1UM;6UM?4U-;55=755U=44%;5
-M5%3455=45U=75577UU74T-35T=#55='1UM'6U-5745975%=45=7455!15517
-MU-355=355577T=;4UM;6UM'7T=955U=04E!75%14UM'4U-'65575U=75U-?4
-MU-35U577UM74UU5755915E915E15U535U-37T='6T]#7T=95U=74U]35U%17
-M5U%15%=7U=55U%575554U-;7U];4UM;4U-;455165E175U7555=65=155%34
-MU]77T]'6T='0UM37UU1345915E1645=4U-55UM95U=34U]?4U=75U-74UM/6
-MU]'0U5=64%U345=5U=74U-?55%545-5645145=345=?0T]S=T=+?T];6U]31
-M55%74%)045!65E345%?5U571UE=5U594U]34UM?6T=?7U-345555U-?5U5=0
-M5E965%55U-15U-;5U]'7U-=45]15U=;45-375=355=34U-=5U='6U-?7U-'1
-M5E!45U914E%64%-75]74U]'1UM;1T=;1T-;7U]155%1555165E975%=15E55
-M5U=7U-'1UM'3T-#7U574551455755575U-?7U=77U%545E'4UU;5T=37U%=4
-MU517U554U555U-15U517U-;6T=34UM;4UM75U%115U9045975-74U]74UM?5
-MU555U-;7U]+=TM/1U]?7U]155%904%!04%)15%75U]'6U-37T=+0U]#1U-?4
-M5%745U=45%=14U%15E?55=36U];1U]?7U%5145%74597U=77T-+0UM;7U]?7
-M55=65E945=;3T]/3UM;1TMW4U5564U-24E'55574U]'1UU515E=64%9455=4
-MT-'4U]#7U]'5U=;7U-37551455565-=5U5575%55U=15U=;4U=?4U=?45%75
-MU%=7U-565=95U-'6U-?4UM;5U]945=575E=75=35U=3555145%=645%65U77
-MUM+3T='6U]?4U]155%145%=45=36T=?4551645=75U55U-'65=555=;45=;1
-MU];7U-?7U=?755155%55U=75U=75U5755%555U155%=55%145%77U5545%75
-M5=?1UM/2T=?4U5555%75U%155=55U=?7U-74U]1445955E=45=;6U-?55535
-MU]'0U]?75%164594U5545U=45=37U]?6UM145U14U=75UM?5U-75U-37U%54
-M5-575U55U-74U]=55%145555U-?1U5355U945575U-?7U]35U=?7UM?4U-?5
-M5=77UM34U]34U55455175U965E945]76T='6U=3755355577U-76T-;6U554
-M5E!345965U31UE74T=;1T=;6T=#0UM;1UM355%145U%14U-3459145%65=35
-MU=?1T-#6U]?6T='6UM36UM?6U-37U5145U)15U%65%=4U514U=355554U=37
-MT]'7T-=45%545%545=74U-;55=?5U=555=755=74UM#1U-?555%045914597
-M5U75U]34U]?1T='6UM;4U]?7U-?4U-34U=35U575U51645)<5M54U-;4U];5
-MU=?4U];6U-?6U-?6U]?455565E%65U975U975U=4U-34U];6U]#0UM;0U]54
-M5U=75U1555145-5555555=74U-;7UM'7T=W0UM'55U%04U)045945=555=37
-MU-75U=34U]34U]?6U%75U]?6UU5455555%=455555=555555U-55U5155515
-MU554U=355=34U=?1T=#75=36U-155U545U=45%35U-545U94557555555=36
-MU]?6T='0T-'7U%555U155U545U=455555%1455145=74U-;1UM#3T=;6UM54
-M5%=65E34U=74U]15U=7555=455555=37U]?5U574U]34U-35U=545%555517
-M5U145%=4U-?7T=;7U-545U=75%=45575U-34U]'7U-555%=45%7555?4U-36
-MUM;0T-'6UM;6U]34U-34U=75U=555%=745!24%%65U74UM'1UM?7U-35U=35
-MU=35U=37U-?4U-355%1745965U15U-34U-?7U-36T]?7UU575U145=75U=?6
-MUM'6U]?4U51745!75U%04%?55%74UM#0T=W=T=77U5%04%35U='3UM;5U]=5
-M5U!14%537E'4T]W>TM%5U,_*<'[^TQ<3\9#:TO[I[-5L%DC@D95D!1.2F',2
-M>.';0$;T^VX4;>R9D.P5%7A<3Q053I6=D>=W=\+'7$!WW<EW9W5"9WQ;T?GB
-MYU1D9D7ZP$=;W^3]R5/&_\EW:6=YQLI)?];B^M!\W%;?_]5$=-?<]5!(],%,
-M9G_)XOU#>V55P/;)SM5W1E[>U5C#RMS7S\5!0=9,='%9Q,3$T_#V5-C'SU1'
-M?&5T35%3V\W=RL+&Q%'555)^<-;*V-?7U/7PP%C5T%-?2TQ`14'0__;PU79"
-M7,991U#7QUM56E[)VL#20-;=0'1'\,M47E?"T<7;UL]%T5]P2$'"U=?34MK2
-MW=)11$'0P-Y3459:7MG"S-9+4]/.W%Q17=-<6D/>S%!15MG8QM%,0E_>W]5?
-M1U['VL7:T\??64Q:6EE25MG$T,7$Q=A?0EA4U5=115[2V]C>VM9=75/>Q4=V
-M4]S=WU/;R]A?3%;35UE:1-7!QUM'U-GTWEY&7E95QM!?5%7$Q=?7V,#16$-2
-M55A-7-_`T5]75E74U5;4P=S1W=?:V%990EC44%36W-71TUY=4=73UEU?U]+<
-MT-9<5-G;WE924E9?4]#3UM''T%]%4-_=7DQ9W\//T%;6U-==U=1=65C45='2
-MV<31T]+>545'0D96Q<?:V=[9TM'45$="1EA3U]/<Q]#0WMW74U!?74504U+4
-MU]S0U='=UE]%7=#2W-S=V=_<U-%14E]85-33T%14T-S64E/4T%Q%5E145=55
-MTMQ45-_<5%935]/75M'%Q=)015]6T=%74-345U-4T]506E36U=94T-77W-+6
-MU5%<5]?75E?4U-74W]C54U)044%W2452U-W8Q,;!P<;'Q-K8WMW3T=;555=6
-M45!34U)24E)24U-34%!15E975U155=75U-37U]?7U];7U]?7U]?4U-34U-35
-MU=75U=75U=7555555575U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=7_________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M_____________P``````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-#````
-`
-end
diff --git a/share/isdn/7.al.uu b/share/isdn/7.al.uu
deleted file mode 100644
index 697ae29..0000000
--- a/share/isdn/7.al.uu
+++ /dev/null
@@ -1,232 +0,0 @@
-# $FreeBSD$
-begin 644 7.al
-MUU565E!05E=145=45=36T=;6U]3555755-74U];1T-/0UM155U9145%15E=4
-M5U14U=75U-74U-34U]?4U-34UM;555555U14U=?4U555U%565U55U-35U=37
-MU-37U]755515U=545%=75%=4U=36UM?4U]?7U]?4U555U=37UM?7U%575U96
-M5E=45U965%74U]?6U]34U=755555U=54U-+0T='45=555%155%545U=75U97
-M55545=75U=75U=74U-34UM'0TMW2T]#7U=75U51445!14%!15E945575U-55
-M5%74U-?6T=;6UM36T='75U544%%15E=45%155575U=77UM?6T=#6UM;7U555
-M5%145=75U5545U145%175%=75-75U=34U];6U]?5U-34U]34U=34U=?45517
-M5U155=?2T-?755145E965U15U=755574U574U];6U];7U]75U=555%=75E91
-M5U15U=?1UM;0T-#1UM;7U-575%=65E=5U=75U5555U%15E965U34U536W=W=
-MTM/1UM1555165E%65U=75-75U-5555545%75U=74U];7U-34U-34U]34U-34
-MU=75U=75U=75U5545%175U155=75U=355=75U=37T-;7T=?7U]?455155554
-M55545U=45-75U=75U=75U=74551555=75U=65U75U=74U-?6UM;6U]?7UM;7
-MU]155=75U-?4U-75551555=75U%25E14U=34U]?6UM'1UM?5U555U=555=75
-MU=7555145U=75%155575U5555575U-?7UM37U]?4U5555%545U15U=34U-?4
-MU=34U]=55=54U-'4U-;4U=555%=45=75U-?4U-?55574U5175U=455755=?6
-MT]+3T-;4U%7555145E=75E975U=75%965U145=37U-?6UM'0T=#0T=;6UM95
-M5U175E945%555U=75U=7U=34U]?1T='7U-?7U-155%=75%555%=755575E=6
-M5%155=37UM?6U-34U-35U=34U%5555545=75U575U-155-?1U=74U=74U-34
-MU55455=55%75U=35U=5555555%75U-155=755555U-355574U-36T-/1T=?4
-MU=155%=75%35U=3455175E965U9645?4U537UM;1T='3T]'7UM=55%=45U14
-M5=37U];455165U=65U94U-;0T-/0T='6U%=14U-15E=45%755555U555U-?6
-MU-37UM?6UM?45=355U94U%?5U5=455175E175-74T=;0T-'6T-35UU74U=34
-MU-?65=54U5575U=75U9655?5U=?5U5555E17U=15U-'7U-31T=#3T-'6U=75
-M5%975%!245!35E95U-55U];3TM/1UM?6U]35U-;6U-55U5544U9145!345?7
-MU%37T=;3T=;6TM#6UM31UM57U=564UU04=545U%5UM15U]375%;4UMC1U]/0
-MTE545-7745!34%915E965%?7UM?6UM=5U=;6T];7T-#1U575U=?545%555=6
-M5]=45U-6U-;6U=76U574U5545=75U-?0T-/1U]945U%65=74U5155=5645%7
-M5E145-55U];1UM74U=55U-;5U];4U%555=555]555U55U5=045775=74T=S3
-MUM?6UU35U-564E165%=4UM?4U-?15-?6U594U%75U-34UM37T=?4UU555E=6
-M45=05596U5145]75UM=4U%54U-'0T=31U-;55-?7U=37U-?6U5555U=45557
-M55145U=45-=445;4T=#2UM'=U%74U]?555755U555]964%11U=515=7445?7
-M5M;4T-S6WU35WU-25-+74]'545#4U5/44%-55M;0T%%5V-/5U-'0UE?0U%Y7
-MT-35UM525U5?4]5>U-;55%3<UM;55]31WM31U53>5E954=;0UU%3U%!<4-77
-M4%'4T510U5?5UE;0T=/=UM?7UUW5UE32T%575M;6U5!7U]554U%545165M'7
-MT%15W]#3U-33TM54UE915%?54=37U=?44%#04UU7UM%24=74UU;0TMG1U]=0
-MUE175U%45M72U%U2U-%=5M14W-[4UM#555;=V=+54M/05-11UUQ355!15M92
-M4]%24U34T=#2U-W1V=G1T=354='74E16T-%<5M;2U%-05=196U7<U]?7T-Q4
-M5-545-52U=Q55=14W=Q04=S1U%905M#55E915%115]314%#15-'05=_=5-=4
-MUM36U-5=4]=4U-;4W]C04U%?U]505=;75%Q?U-/<553<UM364%935M%5T-S3
-M4U+4U]U64%+475Y=45=4U]#1U]G9W5!3P=)3UE'24E-5U\51U%9?U%554E35
-M4E335U71UM72VM71W%30U%%07E7<UEQ=55)7W--74E74T=535=_47U/0W=%1
-M5=S64=7355?1UM+=4EA$5-)25-W14E?76E;%U-S05-=04-?67='>WMW44%I0
-MUM)05]/>V=%=7U/5U-W54=_>5E%15-125U?0U5S6UE;?U5==5=)7U5Y7TE]6
-MT--6T]-1VMC2T])46-35UU575E71T5S15U)6TE1%UM]61%5=55+5V%37P-##
-MTM%67]17W%325EA64-C25-%7V4E*55765M71T=%6U5965L78W]-9VU36W%Q>
-M7U-77-;'T]W64=927===5=177=+3UL#55-+27='3T%E>Q-1!0EC05%S15MK%
-MU\'`7U-24493W-+8TM/4TM+1WM'7TE;70UE76M5<4U;26$;2V%U7VE_>W5[7
-MQM5!55/?W%72W<[64=952U7=U554UE-0T]_85MK15]944%/44-?6557<65=2
-MW%)655%555%855=<5-U2Q-C;T5%3T]5>TE'2P\;6UM==U=%;UL)47]900%A3
-M7E#55U'6UE?<V%_5Q-Y>7];9TU53UMI57%?&WU%35M955%%55=9155=15EU;
-M65%74=;<T='9V=#3W]O3T5965=_15]G$W5!25E!?65I>5]5065-365A25%%0
-M4E-14%)4T-5=U<7&QLKQ]/?P],S#VM_3UE=4U-W6741"3G1]?GY]<'%W2D)!
-M3G=W3UM<4='8]?WR]O+Y^?CX_/;EG(*!ZOGE5!`'`@`%'1P0=^'KZNKI[^#"
-M?V9[9VEO?=#T\O+[X>?.1G9R?WYY?4?.^N;N@;&WF.CHT@4)-#4`'AX6_IF%
-MF)^7YO1\%AT3$11C0_#C[^+D\]Y)9&-@?DQ'1=GE[Y69M+V)E^WY$P@W-@D9
-M%Q3>FH:%G.C8>&D?&A)O9'3V[.KO^=!837MC87Q"U,#W\/WEX92-L[:?Y^9D
-M`C0W-05K;G:3@8><[M!A:QT$'&1'1LKNE>SU=GAP>6U@2M#$]?WR\OWX[(:P
-MLX3DX4P&-#8T!FQG=):!AIS@=&L1'`0;9OSGY^Z4Z/QX%&AD9V-PS^7F^<C&
-MR_#EG[>]CN+ZW1@U-C<":'='[H:`F>UW%QP>&AAL_>[KE)7C]'\4%&!D9W3-
-M_?O^R,##V<N2M;*UE^7*$`@V-P\72U/BA8";[7T7'1\>'F_#XNGI[^3T=V@5
-M8')U4,7*^O_16U;6[HF]MIWAX&(/-C$*'4)0YX6"AY1($1X>'AD4T.^4E>GF
-MR7(5$6IE=%[(Y^#EQ79QU^F-LK&:Z>]_`C<V-1M\5_J9@H:66!88&QD>%%7L
-ME.OOY\)]%1=O>$A9QOSD^-A/1?>5@K.PA^WG90,T-C4$?L+GG("&D%06&QH=
-M$!5VY97K[?G?=V!H;F5`UM57S/'&T]GEA;:]B^K_UA((-C8,:,3XE82`FN-B
-M&04>$!=@7^?H[N7:7'!A;V-S7UU&4,O^_??QE(ZRL(?]TV(!-#$T!4[PYY"'
-MAY/1$1L>%VH5;]3NZ.7'VL-0>FUG2DQ^>5+]Y^'GXH2VO8C@37H<"3<W#6/_
-MY>V>AYCC8AX>:F,4$63XXOG3U<OT2V]O?4!S>$_S[^_FX9NWO+641GD0##0V
-M"1?+Y>20A9N4<QT8%7D5'!3%[>38U/_@V&UK>DMR>$_R[^CMX9"*O;:?WG=J
-M`#4V-1IU\/+JGIN2\VD2%7]K&1Q[\?/!P?KNYW=N8W!\9'W:YNGNXI**O+:8
-MPW,5`0LV-`1ZR?;HGYB<X&41:&07&!]B5L_(R^3OY$9A9GY\<D+$Y>SIZY&/
-ML[:'YT-O!`\T-`(6=5+ZEYV>EO9E>W(6!1H184_&]."4ZO=V<'%^?'5>P^3C
-MXI6`L;&"ELU]'``+-`X%:'G1XI>?GY?\WE5M'P4;$FM^4_N5E^SQVUQU24!=
-MV_+DYN*=B;>.F^S+9A\!"`@"&!=L3/;ID)*6Z>#7:1T8'A(59U?AZNC@Y?GW
-MR</;QO3S]_'^ZX:,@9SL^4=H'P$#!AD1%&U_W.;IE>KL]7!M:A45:619\?GX
-M_OGX^?G^__OY\,S&PL/SE)B<E.#\TGU@%QT=$!05:6=S4,KY\-9!=79S<G=!
-MU,?-SO3Q\?/__/_\\_?+S,S)SL;3S^V4[_G'T5IU?&-H:&)D9&1E<D)'0DIU
-M0ES6W-S<Q<3;VL?,S<+-SO3TR\C*]/7-Q<7%W,SF[>?QQ=%<6D!R9&9F9V=G
-M9V5Y<G1"1US4W=S=WMG9V,7#P<?"R_/]\/;V\_'*P=O9T5?7\>7RP-#055Y"
-M<'AZ>W]Y>7E]=4]#3T]$7%)?4='9Q]O$PL+-]/7W]_?P]/3(PL3?TM5265?V
-M^_W/W=-64E]*?'YP=7=S>7E]<W-P=$);7570TMG%PLG*]??S_?/S]O7)R,/%
-MWM564%U:7,W]]L'3T]174D!*=G9W<WY[>7-W2TI.0$9:4M?<V,+(RO3T],KW
-M]O3UR,G#P\'9WM-67EK3\_GPS,38U5Y-<7Q_<W%R?WM_<71T2D]&6%-4T]O!
-MP\'-S,GU\?/V]O;VR\#!V]+3U%);T?W[\L+<T5->0'%_?G!V<GEZ?'%V=W1"
-M05]45=/0TL3/]<#)]/7TRO;T],K/R<_&WMC0V_[D_\_<TU!93WU[97Y\?WYE
-M>GM\<79)0%/6W-G3T]K&VL7`R__Y_/#R_?7(S,S&W]?3_^#G_<';U5M*>69C
-M9F5Z>GE\<G9T=4Y"6E-6T\3=W]K`QL;-Q_3\_?#S_?;US\?:V/#OZ./_RL)5
-M1G)@;FEL;6)A97!+34IU05E?75#5UMK;UM[>S<C)]O/R\?+X\?;W]<;`[9:5
-MX?+WW4%R8A44:FAK:6)E2]?8U%73T]!44EE6TM907=36WL7-]O#]^_SR\//V
-MQ^61G)?C^_'?=&`7$Q`6%!1K;7M0\N?_S]]77$YR?G%>5%!?4-C/]_#S\/S[
-M__;USLWVZYN;D>_A^E5Y%!X8'A(2$!1B2,OEYNF4[_1!?V=B8F-E0-G'Q/3P
-M\?;P\O?TRL[*]?7XG8:%D^GM_TUC'04$&QX>$Q1FW>?LX^R5E>=89V)L;VEL
-M>E3Q_/[DX>?^]</955Y"0US/D(.#FI"7[M-F'00'!!L;'11GW^/H[>#AY?_U
-M1V=M8V!A9')9RN?@X.'F^O717D]Q<W9,4<B7@(*$DY:5SF40!`8$&QH<%&32
-MX.GBX>;YS]U&?F=F9F=^=EO!^^#CXN;E_,U==W)R<W9(6M#AFH.'G9:1XE9M
-M'P0$&QH8$&YYP^;GY^'G\<566EI#<'QT6EU3T<GYY^3X^?+.T5A.3$9!2W1-
-M15SRD9Z0ZY:3[_9?8Q81%AT2%A5O>75W0-+$QLOW\_[_]L#07%A;7-#`RO;Q
-M]/7)S<32UE980$EU=G9U=$G%XN+YZIV7[^SX74!V;&ML:15K:Q5H8&1_1]+.
-M\?'W\/#*R_7,SO;UP,++R\KTR\CTRL7774=+=G-\>7I[3/OGR.^=D>_NYM-=
-M3F)I8F]J:6EJ;F9D?$/7S?#QRO?Q]_7U]??Q],[/RO7*]/'P\<C26$UT?7AX
-M>'Y\<G)\2?WO^>>2G>OLXL]=4'EL8&=L;FX5:F)F979>V/3TQ<#W]_?Q\/SY
-M\LK/S<W)RLKU],K&549+=GQ[>GY]?7QR=W5UW>_JY)6>D>/A_%Q83F-L86)I
-M;V@5;65\3E7:]_+-UM[`S?7P]O_E\,;#S,;!S</-SL103'1W=W=T2TQ!37%S
-M=TU-0-OOE?KLDI;FY/Q7749F8F%M:&YI:&!^<475T,WTW5S2QL')\?'R^/W)
-MP\W-R,C"Q-O<4$%(2$]"1EM;1$=`3TM-6UQ;7?CJY,KJD>/\\M!%7']M869B
-M8F-L8'YQ3%-4W,O"5U38V\3,R_;^_/;W]_3*S,;&Q]U57$1&1DQU3T%#04U)
-M0D=$05I17D;>X>/TX9:4X?KVUE="969D9F!C;&]A97Q)1%/'S-%0T-_9P/7S
-M_OO\\_/P\??U]?3.WE=80DAT<'!*2'5W<79*3TQ"65577MOB[O#AD)?CY//=
-MUT!D86=@8V!O;F!D?DM$7MG`5$56T]W%S_3YY_OR_OKY_?#W]O7;4$=,2G9\
-M?G-V=G!P=DY&1T=95=!45_WIYOWHENGD_-M45G%G9V%C8&)O8F1Y=5I:4-C<
-M7UG7V,//]/S[^_O[^^7E^/+VR,540'9P<'Q[>WY]<W-Q3EE1U=;0W\7%TU?9
-MY.[[_>F5X/_U55!??61D9F!@;6]@97]U15C4VM%?4=S"]??P^^;G_O_EY?GS
-MR\#'UD9W<G)R?WA^<W=*3D]`7%%05M?0TM/7TOSLY_SLE>_E\-Y54W9E9&%@
-M8&)L8&1X=T=;5]K85%3<P/7P]O/[Y?[Q]O/]\<[`Q-Q11DIW=W=P<W!T275U
-M0%A<4-75T=O8U-79\^'Z_>/HXOCTTE=2=WME9V9F8&UA>'UU15S4V=U45=S'
-MSO?Q\_[[_O/Q\//QR<?>UUQ`2W5T='9S=G5(2$Y-05E15U31V\;;WM[/^^?_
-M_^#BY//"T59$<'YX9&=G86%D>7)+1D12W=-4T,7-R/7T\?S_\O/R\O#WS\'%
-MTU-'3$AU=W%Q=W5+2$A-1EA25E72WMS>WMS:\.3X_^;BYOGUWM9<='QX9&=F
-M86!G97YW0%A4TM!5W<?-]/'T\/[\\/#Q\?'TS<'%T%!80$U,2W=T=71*2TM.
-M0$5;7E'4TM_8Q,'#]/_Y__[EY?_UV]==0G=P?'AE97IX?GUW345<5-?1TMO'
-MPLK)RO#P]_'Q]/7(S<'%TU9?1TU/24M+24Q#3$E,1UE?7U;=V][?V\?!S/#Y
-M\OWZY?W(V%1=0'9R?'AE961E>7-T0EE0U]W=W-['R??T]/#]\_'Q]/7UPMK9
-MTU!;0$Y)24IU2TA(3$U-1EM=5-'=VL'&P<'!P,'$Q\_W]\K*]<G&T%9<04AW
-M<7-R?7UR<W%U341>5]S:Q,')]/7T]_3*SL#$WM+<W=#7U5137%A%6UM:14='
-M6EY<75'7T-/<WMC:V]G?W=[9T];3V]O<W=G$V-975U!91TU(2TM*=4I+0D18
-M75;1V,'`Q,;,S<3>V=G;V=[;Q]K?W-+0U%924E!=6D9&15A86%Q0U=;1T=;2
-MW-S=UM+9WM/7U]36UU=5W-G>W-+2TM=64U-=7%Y:04=%6D1$6EE<7U]05%55
-MU]#=V=O%Q,7'PL;8Q,'%V-S0T-/44U-75E%07%E97UQ96EE=4E)05M71T=?1
-MT]W?W-/2W=+=W-#6T]+65EU?7%E$1T5;65A;6%Q=4E?4UM+?WMC%Q,7$P<'%
-MQ=G=W][2T=#755517%Y<7UE96UA96%A<4E)6U=?0W=W1T-W0U-76U]36T-'0
-MTM'7T]W0T=;1T==45E%24E-=75)=7U]>7U)34%?5UM+=TMS9VMK;VMO:V]S2
-MW=%45=507%U24E)=4E%04E)34EQ>7EU75%37W=[?W]C;Q=C2T]W355174%%6
-M4%-35E555U%6U=564%37UM145=;75=36UM+05%%455914536UM;1T-'0TM#7
-MT=;6T=5555=04%-=4E=45E34U]34U-77UM15U5175U34U-31T-#7U-54U555
-MU];6T=#65%145U%37E]65E%75=37U-37T='1UM;7U]'3T-34U];55%555514
-M5-555U=55%345%!045!15U75T-#7T-W3T-/3T-34U]145E=75E975%174534
-M5U'4UM555U77U]34UM/6U-77U]?4U57555=75U77UM175=555596U=164U%4
-MU=34U-'3T]'7U]37UM36T=;4U-37U%1145145U=75%555%145%975=77UM?1
-MT=?7U]545%75U574U515U]545U355%=55=74U];0T-?4U]145U=75U94U557
-M5E175=75U=37U575U]'6UMW<UM?1U5?5U575T==55%!045-15E%7U]?7T=;7
-MUM955%155%14U=155=?6U-37U-345%7755975=555%=4U-31T]#0T=?0T-57
-M551645!75517U=155=3555115]57U=37T='7U-'0UU34UM145]745%175=74
-M55155U945%975=55U=36T]#6T='1T='455117%U34%;55=77UM34U%565%17
-M4534UM;1TMG<TMS2T-;755555U%34U-34%%75534T=;455=65U55U=36T='7
-MU-34U];4U517U=175M355=36U];6U]#1U];155=45%=04U-15E965%755E?4
-MU=?55=?0T=;1T=?6T];7U-77T-95U];55=5445%34U=65E544%%45U95U=31
-MT=?6U]74U-?6UM;6T=?4U-37U%54U5575%145U=75M745U945E?5U=?1UM#3
-MT-'7557455355%355%76T-155%=645%75575U]?5U];1T-'7T]/7U]15U-16
-M5]545-?45-;1U5175]174U-15E375%#6T]36T=37T-=55=35U5915=555%=4
-MU=555=36T-/45=375%%455155%71T=34U]?6UM575E97U574UM;75%34T-'4
-MU];4U%515M555E94UM1555=745!34%975-74U];3TM#0T=#0UE155535U515
-MUM14U-37U%=7U%565E115E=4U=?5U-;7T=#7U]#1U%545U=75E;5U=37U%15
-MU%=34516U=75UM/2T=#0T-?5U5755=145%175%545-3455=65E=65U=75%%0
-M5-75U-?7T=#0T]/0T]/1U-?0U%555%975U%65E!34%!15M75UMW<T-'3TM?5
-MU514U5165%=75E965U75U-;1T-?4U5545554U];6UM?6T==45%=145!045=4
-M5U145=77U-?1W=+3TM+6UM'4U=175U165U9175%74%155]31U];6U-31T='0
-MT=#1UM;6UU5745%75U=65U145U=75]555=?0U%75U-31U]30T=?6UU14U5%=
-M4%!25]35UM#1T-/1UM'45=?1U5554%%45U?7UM37U]545U=45515U-?7U];7
-MU-?55U145U15U575U%145%=5U-?7U-545%975U755515U-?7UM;1T]'55=75
-M5%35U]'1U595U576U]36U]1545!045965%34U-35U-;0T=?4U5555U%65U=5
-MU5=4U]15U-;7UM95U=?55%965-;65534U51555=5U]35U=75U];7U=74T-57
-MU=75U]?4U%565E514U36U-745=71UM33TM;655965U155=77T-;5U%575E96
-M5U=5U=75U];6T=?7U]'6U-7555=65U145%95U554U5=6U575U]15U]?4UM#0
-MT]#1T=15U55645%15U=65-545-34U=?55=345%15U-;7U-;0UM'0T=?7U%55
-M5U%15E%15E175-755=545=35U=37UM#7UM/6U-36UE575%1455545=545U=7
-MU=37T=155575U555U-?7U]?5U=34U];55U915E914U%45=;1T-#0T-#1UM?6
-MT=;6U515U554U=564E!15E915]75U=545%755=31T=#0UM?6UM;7U55645%3
-M4U95U574UM'0T-'6U-34U%115-35U=?6UM?4U=755%=14%%15U15U=?6UM?5
-M5=?2U]775514U-15U=555%545%175-74U-?6U];6U=75U-35U]155%=65U17
-M5]55U575U=;7U-?7U%75U577UM?7U]?5U5=15U55U=37U]?75U!45574U];6
-MU];4557555%15E934U945-36T='6UM?5U=755%74U]34UM'1T==55%1145%0
-M4E945E%75=31UM;3T]#0T-'1T=?4UM145%94U%575U%65E175%545%555555
-MU=77T=#3T-'6UM545U975%175=37U=3455555U=45U945554U-;1U]77U]?4
-M5%77U]?6U]55U5175%75U%=1U=35U555U-?7U]#0T=#45%=45U=75U155U?5
-MU5145514U554U=?5U=555=37U-?7U-;1U-34U=555%155%145-36UM?45=34
-MU]?4U-35U-?5U=?55U945%=75%75U=7555=75%=75-74U]'1UM;1T=;7U-35
-M55=455=4U-?7U]=45%1645975E975]71U];0T-?5U-355574U-36T='55=?5
-M5=755%965E%145965%74U]36T-#1T='6T='7U575U=?5U=34U5175E%14U-2
-M4U%65U75U=;0T-#3TM+0T=;7U=545E=75U35U=745=765=345%1555=45-77
-MU]?6UM#0UU75U5175E%15%545-?6T=;7U-7555145]34U-'6UM?7UM=55554
-M5%=14%%65U14U=37U]55U%35U%555U?5U555U=75U=34U]'3T='1UM35U=54
-M5U545%745555U=155E945U945%75U577U]36UM?7U%165U54U=37T=#0T=?5
-M5=355%545%=45%77UU755%9745!75%15U-?7T='1T-'0T-;6U];6U]545U96
-M45%65%=65E175U545=74U=75U=77T=;6T=#0T]/0UM?555575E%15E37UM?6
-MT5565%=45%=45%5555745=77U]?6U]?7U5175%975=74U-35U5175E=75%74
-MU=?5U-?6T]/3T-'6U=74U5545U%05E975U34U-55U=74U575UM'4U-37U]37
-MU575U51455=65U%15E95U=75U-'3T]/2TM/6U%575E%65E=5U5545U155%75
-M55555U34UM?1U]?6UM?6UM?7U]35U-5455105E545=?45=55U=75U-75U-75
-M5575U=75U5175%=75-75U-?7UM;6UM?4U-75U-77U]35U=54U5575U545557
-M5%35U-?7U5164%%75-74UM/3U];6U]37U]545=77U]'0T]'4U5545E%14%!0
-M45=75%75U]?7U-545%155=74U-75U-?6UM'1UM;6U5175U975U=5U]'1T=#1
-MUM34U=345E!375)04%;5U]?4UM;1T=#3T]?55%=04E96U='0TM/1U-355E=7
-M4E]<4U;5U]?6T=+<U%955555U=?1W-%4U5545]365U)05]?0U57555?5UM?2
-MV<S1?4O2V==E8?_N45E41>;A=6)-[95D%';GE=9H%WWBY4%%SL1Q>TCW_N7=
-M9='T0WEZ?<OO_.7DW%?U54A?<'14W$)E9GY7V,?W_?#87T/2P5)#T/7R\\'5
-MU%I$7WYP7U10U-=$P<I'5]M?V,#"7EG*WLK93$]=1G-,T_7#77=7Q<3)W%5/
-M5=M=TE;=VLW91=_015I/14!:W573QL+)SM-$WMI`=71:5-555]+'UM+>T%->
-M55324EO?P,1=1MK'V]!=T-)07%Q%6==?TLG84U976%/85D92U=-64U%4P,W7
-M65W$V--21,?!T4!&W=]57U?;45Y=1%I0W]70U5?1TM]7U%%5Q\';4UU4U='1
-M4%-44-+'PU5:T5507UY95-Q?7]_2T-Q57%;2TM9;6E32V571T%3<T5!%5-5?
-MT='<V]#>TM324T!?W51;75;1WMY14E544E?<UE#44]'9U5'0V=W<5US1T%%&
-M7M;3T-596-_!TU!07-S34594T]55TM534]'?TM535-S04U%5T%%97%!17=76
-M5<32UMG3UE)=4%9>4=#7T]/4U-944516U])7T][<W-177537U-5=7%-7U597
-MT]#4U5!04E?65%=3T<78W]U5U]1155914E;>UM#65];3TU57U=537D535]'7
-MU]#5WM-04E)=5='5U=S2U515T=36U%!5UM%655505=?6U%=4U]575570WM/7
-MT=+7U5-65E-7U=;4T554UU905U%7U-964];3T5=4U-'25U?0W-115M32UU!0
-MU-904%)0U='=UM37T%75UM74U5155555U%575=3755%75=;55E'4UM?7U=#1
-MUU54UUIV2T=?5=/>VL3'QL?'Q=O9W]W3T=;5551645!34U)24E)24U-04%%1
-M5E975%155=74U-37U]?7U]?7U]?7U]?4U-34U-34U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-9U=75U=75U=75U=75U=75U=75U=75U=75U=75
-`
-end
diff --git a/share/isdn/8.al.uu b/share/isdn/8.al.uu
deleted file mode 100644
index d7c69ba..0000000
--- a/share/isdn/8.al.uu
+++ /dev/null
@@ -1,323 +0,0 @@
-# $FreeBSD$
-begin 644 8.al
-MT]945E=14%975%145%145%15U=75U=555=74U];7U]'1T=?4U-545%=65E97
-M5U=45%155-75U-?6UM34U]34U-?7U]?1UM?7U-355%=145%375!14574U];0
-MT-#1UM'1T=;7U-3555%25E175U?4U5755=555574U575U=36UM'6UM;7U-15
-M5%965E=755155577U]355=?455915-77U=745M76T='7U-77U%165-?4U-?4
-MUM?4U514U5=45U945E755%16U-#7UM;7U]7555=55U=45=35U-?1UM?1UU13
-M4517U574U-37U]?6UM'1U-77U%545U15U5165E145514U=3555175-37U-;1
-MUM;1T-35U5575E975U175E15U=35U-34U-555%74U];6U];4U=34T=;45577
-M55175%545%%6U515U-;6U%145=355=37UM575-71T-?45=5445=45=575%14
-M5U=5U-36U-77U]?4UM/1T=1555555%35U5555%175U=65U=75%55U]?6W=+6
-MT=?4U];7U]?555545-545%145%%05E145=74U]?7U-'2W=/7UM'75%35U554
-M5U155%145U=75E!15U75U=?1T='1T-#7U-34U51755504%=645!15]74U];3
-MTM#1UM;6U-35U=575%35UM;1UM?6U5355%145%175U=65E945%35U]?4U-34
-MU-75U-?7U-74U]?5U-36U]545%175M345=3555545%35U-35U=555=75U=?7
-MU-77UM;4U-34U515U5175E=45555U-?6T=;6UM'1U]35U-545%=75U175]55
-M5%145%=45%75U=345=31T=/2T=?455545%145575U-?4551555175U175E97
-MU=?7UM#3T-'6T='1U%5555175U75U5145%1745%65%55U=35U=37T=#0T-/3
-MT=;1UU355%914%!145=45%=45=74UM'1UM?5U=755=77UM;7U=37U]75U557
-M5E%65%15U-34U=77UM;6U];7U=75U=75U=77U534U]755%1445)05%=65%77
-MT='0T=#1U]345514U=34U-36T=?55%=75E%045=45=34U-34U-37U]37UM'6
-MU%75U-3555755=75555745975%75U=345515T-#6T]'7U]155%=65E%65U=5
-MU=74U=555%=75%55U=37U];0T]#1T=;4U=75U5575U174%945%15U-?4U=37
-MUM?4U-?6UM'3T]/6U5=75%%=4E%05E75U]34U5755555U5545E=5U=77UM;6
-MUM?4U-?6U]55U514U=7555545U=75U=555555=75U=74U=74U-?6U]?4U-75
-M5=55U=?5U=955M555%15U-74U];755175E1555555=555514U-W%W5-65=%0
-M7U!65U)0U='6U576T]#5U=?6U5=4U-?4U=;1UE575E964%!65U=75]?6U=31
-MT]/6U=?1UM;7UM;45534UM?4U]?45%965U914U!15E34T]+3T=;45U%15E55
-M5574U]?6T=#6U%545U965U35U-34U]'1U-31T-?55-775%%45%965U164595
-MU]?1T='6UM355=74U=755=55U=?6U]34U-74U%575U=14%94U=;0T='6T=;7
-MU-34U%1145=55=555=555=34UU545U!15%945=36T='0T=/0T-'7U-545%15
-M55145=74U5145%114%945%14U=75U-;3TM#0U]34U5175-555%=7U=?7U];4
-M55175E=45E975U95T-/3W-+1UM575E=45U=75%15U=?6UM'4U-555%34U514
-M5]75U-?6T='4U5545517U=755%=5U-34U-?7U%575E915E=45575U]'0T]/2
-MTM=65]545%55U=545%15555555145%55U=?7U]?4U=75U]'1T=1555545U97
-M45%15E14U=37UM37UM;0T-#0UM;6U];7U51745%04%!045945='6U-'6U]?7
-MU]?7U-?455165U975U=45=77UM'1T='6U%145%5555545%14U=76T-'6U]15
-M5%145%75U=75U]?6U]345%965E=55%75U-355-31UM;1U]745575U=555%16
-M5U75U5555U!04U!7U=?7U]?7UM#0T-/1UM75U-7555175U=75E965E%15-74
-MUM'6U]?6T='1UM;6U]?4U-?1U5=75E-34%975%35U-755=75U-34U-355575
-M5574U]?6UM355%=75-55U=34UM?7U]7555175E=75%74U-35U=34U=74U-74
-MU]?6UM?7U%94U5145=75U=74U-37UM;1U]155=75U5175%75U5545%145E!1
-M5E=75%75U=36T=;6UM;7U]?7U-74U=75U-34U-155U!045%65U35U-76TM/3
-MTM#1UM145U=15E965555U575U5145%555-74U-?7UM#6UM?4U]34U]355%17
-M5U145U=75U=4U=35U=?7U-75U5555=77UM'1T-#0T-9455575E%145%75U=7
-M5-77U]35U=?7U]?7UM?6UM;1UM1555755%=75E=75U=65U145%=45=74U-?7
-MUM;7U-37T=#0T=?55%175U=65E%15E545-15U=37UM?6UM?6UM?7U5555=55
-M55545%54555555145U75U=?7UM#0T-'1UM;6U-555U%04%!15E=45%555=74
-MU]?7U-555=74U-?45=?6U-;7U-5555145=37UM?4U-355%5555555%=75U15
-MU=34U]34U-37U-34U-?4U]?7U]155U=75%575E975U945%=45=75U-?7U];6
-MU]?0U534U5555U=65E975E15U=37UM?6UM?4U=77U]?6U];7U-7555545U91
-M4%-05E?5U];6UM'1UM;6UM;7U]34U-555%=75U145=5555755%975U%45=74
-MUM'0T-#75575U-37U5545U=45=5555=75%1555145U155=34U]'0T-#1T='0
-MT=;4U5914%945-7555175E975%175U155=31W]W=W=#1U]75U5165E%04%%1
-M5E145%14U=34U-?6U]34T=#3T-'6U]?4U5555%114%!045945555U=77UM;6
-MUM;7U-34U=34U]?7UM;7UU5045904%975%175U=4U=?6T-'6U-75U=755555
-M5=34U]35U-?555145=74U5145%=5U=37U]?7U-34U-74U=545E975=?6U]35
-M55=75U=75==55-555=34U]?7U=75U=75U=74UM;6UM35U5175E%65U155%14
-M5%75U-37UM;7U]'1UM?7U]3555175E=45=75U-545U=455755=75U-;45=;0
-MT-/0U]555%=75E%65%555%75U-355%=75E94U=34U]?7U]?6U]34U-?4U-54
-M55175U975U=5U-;7U]?555155=74U-34U];6UM'6U=745U%45%545U=45575
-MU]35U=7555545-34U-34U]?4U-?7U5145%555%145%=145975%74U];6T-/0
-MT-;4U-74U5555=755%175U965%155%!75535U-?1T=/2T]+0UM145U165E=5
-M5575U=74U=555%975U=75-77UM;6UM'1T=?5U=34U=5555=75%15U=74U554
-M5%=75%75U=36U]?6T]?4UM35U5545%545%545%145=75U=74U-?7U]34U-?4
-MU=34U-34U]?7U-755%=75E=45=5555145U75U5545%14U=?6UM;7U];6T=;1
-MT=145=545%=15E9045915E=45=77U];6UM;6UM?7UM;6T='6UM;7U-545U%6
-M45%145965U15U-;1T='6U]37U%555%145-55U=34U-7555165]555-75U-?7
-MUM'0T=;4U-35U5545U975E=45%555%175U155=77U]?4U]'0T]'6U]34U-55
-MU=555%=75U14U=55551555155%545%75U]'6U-;1U]34U=75U-34U5575E96
-M5U15U=75U-34U575U5555U=4U=37UM'0T=;4U-555%145U965U15U=74UM'1
-MUM74U-555%35U]?7U-355=3655755%=645%15E?5U=3455555=75U];6T=?4
-MU];6T=#0U%545E965E=45=55555555555=75U-34U]?6T=#6U]5455545=74
-MU575U5555E-145!75%75U=37UM?7U];6UM?4U]355=75U=555=5555175U=7
-M5U=4U=?0T]+2T]/6U]545%=45%145%145U=75U145-75U-355=37U]36T]?7
-MT-#0T=?6U]75U51145!34%%75U145%34U-?6UM;7U-35U=75U];1T=;45514
-M5U175U=645965U55U-;6UM34U-355555U=?1T]+2TM165%934U!65E9145?5
-MU=37U]?4U-75U-37UM?1T-'6U%5445%04U%645945555U-355575U-?0T-/3
-MT-'6UM;6UU575U9145%15E155=37UM#4U5575%965=36T-/0T='6U]155%=7
-M5U=65%1455555U=75E35U=77UM?5U=37U]?6T-?5U=75U5575U355%74U%54
-MU-;7U5%7U5915=?45M?1UM?4U]'45=31T=3555145E%5U]15U]!44%174595
-M5576U5?4UM?4T-#4U-155%165U14U574U%35U]14U554U]15U-'55-;1UM#0
-MT]W1U-?445-745U<4E945E74T=/3TM#0T-545%35U=34U]%45-?55U'45%E?
-M55=34=#15-73W=34T--55]30UU97U-904]'155345U=45E95UU%35]54U='2
-MW=W?TM'6T=105]'65U76U]15U=754%]25E987U1065'44%;3T]30T]S"P]%1
-MW=%#1U%74=_#RO?UQLW+U$=;74U/6EI!1T=:7U]$1%M`=75,0D74WM54S/#%
-M5\KQW-;;Q\G]R</EY^B?D=SU_V(='!86%F)(]?GW\N7X66EB?6QJ9<'T].3C
-MX?/<T]Q'2=/.\OCE[.+E^OM=VH:!9'>?UP4`'A,$&!3:E/[!ZY'Q:6U)>&AD
-MSOGY\_KC]TE*5T][=U3>QO;DY/GXYOM$U,1^<U;N@HS][(37!@T$!`T'%/.6
-M[96>G\T4;&(2'WJ5YMN1G.!W0U!@:F-4PEI4Y>S_T??Y]%I.4T5$24]3F[RT
-M!9NU&C<T&0(W!6*8A_N=@X47!F`7`0!KZ)F!FYJ`[100:A@$;M'E[^J3D>5.
-M=UMA:F]S1T'SX>?ME9F.B\1ZF6(."`4:`Q!T[I+O[)?K81QN:1,4]Y7LE9:4
-M^G1E969H9M[`7<[F^MY7VLE?=U911]3*_\C@BK+N9H[L#S0!!@H`'/.?[.F:
-MA,,38V\8!Q;EZ.:0AIGV5<UD$A%D?WI8^NGL_O_[QG-E>65_4<+PYYNSMVV2
-MCQ$T"QL."P1MEY?MG(&<;!5X$P<:=/C3XX6%[?SG4&X7;&1@9-?@XOCG[?[6
-MUT%\2'5S3>RUL^WXM>,-"P0"-`(8W>GED(&&\WI4;!H'%DQ-TI:%D/KHX605
-M87IK;$G!_O[^X^'PR]G37'-,6?"-LY)5M9,!#QL`-PT%8?#UE82'XESP>1(9
-M%'IG1.V0Z>'IYTQG<'!M9D34W,O]_/+W\O950U#1]8&PA=2(F@4,!0$T#@84
-M4%[IA(?K_^-)$QUJ;!5_^N[CX.KIWGE!4F)L6=5"Q//(\^7R]/+T5$#JM;3?
-MG(K8```>"30-!&)\4)&'F.?M[F40%&(4%$OR_OGBE>=1U<%^:7)2=$S)\\CR
-M^>+@4O?_XXNV_I>U_``&'PDT#08787+JA)COE95U:FAN$1=ET_7][93M]_/S
-M=6-R=V1V5E[6^?OG[>GHR)JQ@&>`@QP"&04U"0$?8F/&GX7KX)'R;&QG:!%K
-M<=[9R.R5^<GZRWAX3WU^2T77V\;D[/CBD(&VC>:,A!`!!0$W"@T'$&GSGX6=
-MDI_@6G,5'Q\3%V!$\^B7E93ORT=U9&EL9WY,Q.7OE):0C+&"ZXZ$$@8%`C<*
-M#P8<%\2=FYR9F^OSVF@?'!X?%V1&^.J7D9;L^\!V8V]B;&)!S.64DH.QM)B/
-MCW0:!0$W-PL,!AAZE9F?FH&>[NU:'1\?!!L68TGEZY&2ENCM\'!A9FX58'[5
-MX):`L;>&M8CV%!(!-S<T-0P!%_N3GH:"AYZ?\!81&``&&!QJS>"7GI^=DN_1
-M7WX6%6UK?OJ1CK&/C[&`PF<4##<T-S4+`A;.Z9^#@H&`A/)E8P4"`0<'$G[!
-M[I*>FYF7[>1U;FUJ%&3"A+2-@K&)D./'&`@+-#0T"@$0?."%@8&-CYKR\GD'
-M``<!`!]@1N66F86>DI+BU45G%6EFTH&.DHZVA967Q`0"#S4U-`@&'&CFF(6!
-MCHR8D>MF&`4&`P$;$6;-Z9.?GIB=Z.'_<V%S?.N.GI>W@^*7E6@&!`\)"@H#
-M!!AM[I>=@(R&GY_H81`=!`$'&1-O5N&4D)^8DI25Y$1215N$@/2!BNK@E_09
-M&`<,#`@,!@4?0.+BGH.`A9Z?YF%K$`0&&AD<;U_^[Y&?G)"1E>7UQUR6C93N
-MBIKQZ.]K!1\``@X/`00%%?7QZH2!A)F8D\%Z8A(%&AD8$V!)SN*6DIV=DY?C
-MY_?X@(1$@XW,Y.]$&AT'``(.`0<$'%[&^9Z'AX69F.ET<VX8&A\8&15D=\CO
-MEY&3D9"4YN'YD(WJ[8N2V^SF%QL=```/#08'!6O44.F%AX6;A9+]T7,1&1\9
-M&A)H9DW_Z921DYV2D>;]EX6:QX:`T.'B4QD0&`$`#0<&!!UX<LR0F9J%F9F0
-M]=%\$1P2&1D6:V!'\."5EI&0EY7HY)2-G?6.F\7NX&8<$0<'#0T&`08096']
-MD)Z%FYJ$E/G[<A`1$QL?%Q1M0??D[Y>0EI>6Z/KI@871@X95[^%V'18:!``-
-M!P8''6-MTI6=F)Z:A)?MXEH5:A89'Q`1%'M6R^"5EI&1D9?BE8&$R("&TNGF
-M=A,6!0<`#`8!!A]I:UWLEIF:F82>ZY7]8&UK'Q\3$A9B>='XXY61EI&6Z>#K
-MA)O9AH17Z.9U%A49&@8#!`8''VD52.?HG9F=A9B5E>-+9V86$A`1$15F2M7P
-MXNGJEI;I[Y:'A?^!A_+NY=L1%QP%`0,$`089%!=\\N^0F9R:A)&6ZLU_>Q40
-M$!(0%&Y[6]WE[>B4EY3KE9*&E.V`Z_;O\&%K:A@>!@<$!@00%A18\N&0F9*;
-MF)&7[L=.>&L7%A`6%&MZ2ES_X.^5EI65ZI.&ZNB`Z/OH^V1B:Q\<!@<%!@83
-M$A%SV_V6G9:%F9"2E_G-4&%L%187%Q1F97W.^>7IE>CJZ^Z?FN62A>3G[<MC
-M9103'P0%&@0%$!(7?-_WE)26F)R1D)3[_]A^9V(5:VAJ861SU?7SXN[LZY7L
-MZ)^1_9*1S?;^6FUD%1<2'A\=&1P4%&ESWL'C[.B6EI64E>?X\%%W<&=@86=\
-M=4W0]_/XY^?ZY_O^\_#^^-O!\]E'6E!S>'AE8&!C8F%A97YU3%+=Q<_W\?#R
-M]_7URL/`Q]C8W-/<T-73T570T]'1W-S<V]G9W-W=U5914EA%1$5%6EY7U-3?
-MV-W1W]'55UU=7D=!14%"0T9'15]15E?1T]+;Q\/#S\[/S,W"QL7>W=-54EU?
-M6D5$14584E-05=?7T]S2T]S2T=/1U%164EU<7UY97EY?75-0U='6T]#0TMW=
-MW-S<W]+0T==55%=34E975U77U%74T-'6T]_=T=+1U]?55%104E%=7%!04U%4
-M5E34UM#1T=#6U]?4U-31U]575E=34%%05U=34557U=#2T-/0U-?7UM?4U-=5
-M5-75U=;3T-/3T='1UM?4U5545%545%1455=15E=45%=745974%%4U%75UM;4
-MU='1UM375%145%%15]55U-W<T]W=W]S2T-#6U-1445914%965E555%145%97
-M5%155%=5U=34U]?4U-355%175E!65%55U-;6UM#2TM+2T-;1U]545E%145!6
-M5E945U1545955515U=77UM#3TM+2T]'6U5=14%!345=45-74U]35U-75U]35
-MU=555-555-555=55U=77U-355%355575U=37U]?7U]37U-34U]355U;55%%4
-M5%74U];0T];455=75U=75%=75U=75E95U]?7UM'6T=#7U]?7UM;6UM?7UM55
-M5U%14%-05U965-55U]?4U]?6U]37U]?7UM;7U55455%155=75U%65U15U=35
-MU=345=31T=/3T-;7U]?4U575U=74U-345=155%=65U175%915U1455755=?6
-MU]'1U]?55U=65U=65U35U=36T=;6T-'4UM;6T='6U]755%=455=45%=64596
-M5U145515U=37U-34U-74U]35U=35U-35U-75U=75U-37U]34U5545%175%74
-MU=?7U]?7UM?6UM175U165E175-75U%74U]555%904U%75=37T=#3T]/0T-#6
-MU%175E%15,7/=$'03,5&W=56TU;>5M;4T]#2UMW1TE77U5%65%%44E565M16
-MT=;9UM#=U]%75=345E%74U%345=555345=35U=#0U=17U%54U]365='4U%55
-M5-545%97U5!15537T=?8U=S5TM;6TE#14]!155'75%16UM1=W<'EVWYE?G=!
-M6L'#V<',\578T]_;WLQ=YL)F6W%!1TO&=-I)T,Q&Q]S$TMC5VE7`653#7\1+
-MU=9(Q4S065#56<9&WU[&7-M;\'?_<<E?QUU>R$W(</!+]7;R=<M%W5Q4VDK_
-MP.%Q=69^9W%:V?)*X<STRM'TV-Y35][4<-)85U!<5=])UT3;V$K>T=U0U%3"
-M4]E1Q=A'45=>V5C1U5[%7UO;6\=<S]_+Q%15>5IE24'>4?7"]?;%]=C<V433
-M7-=%6T'364#9=]E%TU#:T=!7S=;8S%[!5]%?T5AUVD#<2,5;4-Q;P%W47<W$
-M6]12T%#>V-#64T'<QM7?3L=<PUU1]TI;7%'/7U32W<-Q65#?64W`4<3?3<]1
-MSG;+]539=-Y%TDI3VU372\G>R5K0VMU>4$'25]),TLUUUDS9W%[26?-#6--7
-M]$-1V=S:=5'+T<Q#]MY06%_274Y$V%9)V%[V6U5<TL%%453;1-)!R%)2U-KV
-M7L!0R=;00D'$<$5`W]%&WT3:T5!2]=-/S5W"1])<W,_55%_P3MU$UU55U4_U
-M4LY!4-YTPTK>6\E1=_'8T47Q<M7"0T;$SW#<R$/?SE!!U5%P]-!90<I;2,O7
-MU=[]5L;.0]W76G#%TDS$5$/44GC`]U19]]%95GW2\?5)7_/>05A4Q-!$4L7&
-MVW79T=U,<\1`]$E65,=:3]+!\%+25\U1==K8V%I>W=?1U%7?2-)`7454R55,
-MV]M57$'84?%>T,;WUD/'QT)'5-C;07%9S55P6<_8V$;:TMM$?O'7V7+6WMK*
-M1L+.P]5>T%O5<W7<\U9'W,W;05=<\%Y7=5S"6%U;Q\%(0=WUT5Q#S%3?3%W/
-M4-Y>\%[>1TM57-!;W-S27=+4VM/905??7]'05L715D=3T%G'6]I6]%=9TT7%
-M=EUR7%-#S=7_7-S&S<%07];-14W;PMW455C9549?U]-/5]+&W-Q=5-9<14K>
-M4U%-P,M0UM7:5-]45-+3U%K-7E;67D!?W5E15=C2S%+;S-=;1M5%5-+2Q5=;
-M7]3!U=O>4-G6W$)96$305U11P-57Q\365U1!U=!.0]327=K;V,W%UE?'05]7
-MUM965W504%_0T]Y1WEG0Q-G46%1;TE115L?94%=5TE354]#45$=2T%964%/6
-MW];5T\36U5-75U35U<?8V-#>W-S56UY#14);7-?2U5?3P=W8TMS25%-<W=19
-M6E'5T]%6W]O=4U17U-U104Q27U%5UM+?TM#`S=E265U36D==V\/&TM#<5%Q;
-M4%974%-4U-35V<';U==74%!<5U315E=17U!25-?=W=W255%?4%!7T=[%Q=_2
-MU];6U5-24EU=6D1<U=#0W=_<W=;54E!55E=14%!35U?0T-[;VM_3TU977UY3
-M5U55T=[<U];2T%=375Y<75Q25=7655?4U=/0V=K9TM144UY!6UQ4UM/8WMO<
-MT-?55U)65U=7U=14U-37557555;5T-=7455455514EU55U;1W]S3TM'1T=51
-M5-=445'6T]S3UM;0T5-?65U?7%=4T=+0UU555%35TM#0U-#=UU924U?55%%5
-MTMQ54U/4T%507=7=TU55W-[15E!4T-#55-7755%=75Q=4UU65-75U]/<V]+4
-M5%577%]?5-W8W-S9WMS?T]74U59?7EQ25%1555=45E74UM?4U-154%'5U-?7
-MU-36T=;0W=9545!34E!25-?6T]/15%74UE==4U!45%74U]'0W-+0T='6U];4
-MU515U=755%%65%=04E-05]944E32W=;4UM?6U536T='55=175E=55=345=37
-MUM955E945E!14515U=15U=77UM?6U-37U-?7UM?6UU=4U5755=75U-175=51
-M45745%76U-31T-'6UM?55U!75E%7U5165%?5T='0T]W3W=S65E964U!04U?4
-MU-77UU75U574UM=45U114%%34E94U-#0T=+?W=#3T=/=T5165U%14%U=5U55
-M5='1T=15555745945%575E?4T=;1T-#=TM/<W=/0U5%24U-?75%4U=34U=?7
-MU=355%=5U-?455155515U-?0TM'6U]155=35U=545U904U!65E76T-#1T-'3
-MT]?4U=75U5145514U5545EU25U75U]'4U-955]345-74U=345=30T=/=T]#1
-MU%174%!04E)24E%4U=31T='1UM?4U-34U=37UM75U]?4U-755%175U=45517
-M55575U14UM'6T-'7U=755%755=?7U574U%14U-?4U]?5U-555U=75U75U=37
-MT='455545U%65U%75E=4U=?7U-?6UM?4U-;6UM?6U-755U15U=?4U-565%=6
-M5E965U=55=36U574U575U-75U555U-77T]+0T]/0T=;455145U165E104%14
-M5E%64%%65%155%36T-/3T]+=T];4U-36U]345515U-=55U164%%14%!15E=4
-MU-77T='6U]?7U=?6T='6T=#0T=?55E%65E%045945%555%755%155575UM;1
-MT-#0UM355%=75E=75U355575U-?45E37U=545U37UM?0TM'1UM54U5=75%91
-M5E965%545%145575U];1T-#1T-'6UM;6U=37U5575U9645!04%%645!75%74
-MU-?7UM;1T-/0UM#=T=37U]?7U%175%545U975%545=555U9145!15=37UM#3
-MT='6U-555%=65U55U=36UM36UM35U=55U=?6T-/1T=;555=145!145975]75
-M5U95U574U-77UM;4U-;1T=?5U=74U=75U-37U-575%555%35U-74U%55U]'5
-MU=555%155=74U-75U-37U=77U-35U-75U-545%=65E%65]77UM37T-;7U-37
-MUM'6U]75U%15U5555%9145%045!15U=4U=?1TMW<W-+3T-;6U5=45%%045=5
-M555455=14597U=37UM#6UM#1UM#1U]=55U%35E=65%5555555=35U=35U-?7
-MU-7555545-74U-34U]?4U=5555145%15U=755=77U%55U5545%175%555575
-MUM;6U]?1UM?7U]155554U=;7U-5455165E%05U15U575U]?4U=75U-;7T='4
-MU5575E%65%165U545-77U]?5U=37U];1T=#0T='6U%555U=65E=75%175=55
-M5-74U-155E77U-;6UM'6UM=55=355%34557555155=555U=55%=75%155=36
-MU]?7U-?7U555U-34U]15U554U-?6U-545=545U145=75U=?1T-;45=?3UM37
-MU=?7U%545-55U5545U!24%%75=74U-?6U]37UM#3TM/1UM175E914U-045?5
-M5575U-74U-75U=75U-37UM#0T-?7U=35U-545E=64U)75U955535U=77U575
-MU-74U];1T-'6UM;1UM575U1455545%145=555515U5175%35U%55U=?4U]?7
-MU]?555175E=5U55555155U355576TM'1T-;4U]34U-34U-74U]?6U]555556
-M45%045%15E=45=77T-+2T-#6U]?4U=545U965U=5U-?7U-3555555%965-75
-MU-?6T=;7U%75UU115%175=55U=34U-;6U]?4U5545%14U=77U-?7U-?7U-35
-M55145%9145%65E965U35U];6UM;4U-?7U-74U-34U]?7UM'6UM?4U%5145%1
-M5-?555545=7555555%=75%75U];6T-+2T]'1UM155U=75%=65E965U=45=74
-MU]35U-34U=37UM'6UM?4U]?555555575U-355U975%=14%904E=4U=;6T=#1
-MT=#0T=;6U-?4U5145555U=74UU575U15U=75U=34U-37U]?4U5555%155515
-MU=34U-555%155=75U=35U=74U-?7U]?7U=3655555U15U=75U=5555555535
-MU-755=755=55U=;4UM'55-?6U=30UU115]565E=45E355%77U]355%975=75
-MU=;1T='0T]/3T==55U=64E]04U-7U=77T=#1UU155=75U];6UM;7U5555=75
-M5%545E%15E=75%35U=77UM;6UM?5U=755%555=75U-34U5545U975U555-74
-MU-74U=;1TM;4UM3555555%555%175U145%75U-75U-37U]?7U-75U-34U]?5
-M55575%75U55555555%74U]'1T='1UM1455175E=65E=5U=36T=/0T557U=34
-MU]5555145=75U=155%=65E=45575U-34U]?6UM;7U]5555555%75U=755=55
-M55545=555%145U35U]?6UM?7UM;6U]75U-34U-54U==45=545=5555=75%97
-M5%15U];7U-755=74U];7U]?7U]34U-75U-34U-555%1555555%=65%145555
-M5=75U5545%555555U=?7U-?7U]=55E545U74UM'1UM'0T-'6U]35U5155U15
-M5%175U914%%7U=36UM?4U=37UM;0T-'755=75E=4U=35U-145U145%=65E14
-M5=74U-;0T=;6U]'3U-?6U-34U-555%555%155=555=555-555%145=77T=;6
-MU]355U915E=45=34U-35U=34U=74U=?55=555555U=74U];0T=?555175U75
-M5U%55535U]?7U-545U155%965U14U=?6T-+2T]#1UU5745%75U=65E%75U55
-M5=77T='1T='7U-37UM?7U]145%=75%=75E975%545%555%?4T=37UM?4U-35
-MU=74U-155%=45%3455545-74UM'0T-;75517U=37U%545E945=75U=?6UM?7
-MU-37U-5555545%=45%165-74U=?7U-35U5=155545515U=34U];6UM;1UM?4
-M55575E965%75U]'0T-/0T=;555164%!045=75=75U=?7U-555%545U975%74
-MUM'0T-/0T=?5U=75U=54U-955%=145%15U145%15U-37U]'6U]?4U]34U]34
-MU=55U=155=37U-37U-5555175%=45%145=75U-?7U]?7U-?75574U555U=34
-MU]35U];55=?455755%145%=75%=75%74UM'0T-?555%04U)05E74U]?1T-#1
-MT=;7U=75U-355%35U5545=75U-34U55555555%75U-?6UM?7U-355=365=74
-M55755%=65E=75U145U7555555=76UM#0UM?6U]?6UM?4U5575U%045975U15
-M5=74U];1T==55U=45=77T='0T=;6U]5555545%1745%55%35U]35U=355515
-M5%555555U=55U=74U];6U-755%5555=45U975%145-75U=36UM;6U]34U];6
-MU]?4U=75U5555%175U=75%914%'5T=;0TM#1UM?7U-37U-54557555555514
-M5U=65U975574U]37UM?7U]?7U]34U5145U15U=75U-35U=555=34U]?7U=75
-MU=75U=;6UM;7UU115U%15E955%=45%55U-37UM?6U%55U575U-34U]37U]37
-MU];7U]3555=75U=45U=75U74U5555=545%=45%74U]'1T-/3T]'455545%=1
-M5-575-35U=555575U=74U=74U-75U-555575U=34U5545%145%77UM'6U]'6
-MU-74U%75U=77U-?7U%75U-7555545%145575U555U=34U-;55-15U=75U555
-M5%=45U975-36T=#1T='7U%545U=65E=4U=35U]?6T=#0T=;6U]555U965E35
-MU=74U-34U5555U915E%15E15U-?7U]?6T=/2U]?1U-555554U=55U5=45%=4
-M5-75U=555-37UM'1T=;6UM34U=75551555545U15U=755=74U=545U=45%75
-MU];1T-'1UM35U5175E=445!45%74U];6UM;6U-745575U-75U=75U-355514
-M5U965E9645=4U-?7T='3TM#0T=35U5555555U%555515U5545U=75U155=55
-M55545U?6T-;1T-'1UM355%=75E=55=74U]555%145%75U-555%945%74U-;6
-MT='7UM;6UM?455175E=45%75U=7555545%15U=75U]?7U-?6U];7UU115%=6
-M5%34UM'1UM155=5555175U15U=?4U-155U975U=4U=3455555%145-37U]'1
-MT-/1T=;7U-755%=45U=555555=75U];6U-75559155565E155=74U];7U]75
-M55=65U=4U=37T='1T=;6UM?7U]=55%=745%14%975=36U]355575U-;6U]?4
-MU-34U-?1UM155U975U=45%5555565M34UM'6U]37UM'1T='7U%5645%15E96
-M5U5555555=75U-55U=37UM'6U]155-555%145%145=74UM?5U5545575U]35
-MU=75U-?6T-#6U]'65U96459645965577T=#3T-#6U-545%175U=75U=45=77
-MUM;6U%755%=75U=75575U=555555U=74U]'1T=#0T='6U5=65%15U-355U97
-M4U#5U-;0T-'6UM;6U]574%)=4EU05U965-35U=;0W=S0TMW=T-'755=65555
-MU-;1U-#6U5114%!24%Y:7%7`RTUURL1C$E#KPOSCX]_UQ&UA\)SJ%AIODI-,
-M'Q'R^N)`]<9M;F3LEY3A8&+2\607%GSCE)'G1%'R_5=Q<'?3S<!Q8F]F6=O\
-MY^#(>&-SS_721-CAX^3]S]C>3V`5;5U<<WC2YN[!0LY2_>7#?&9<P?'7TMO9
-M0V1^4OOW765@7LK@]-/=5OG9VDQ^S<K*7D-1<=77?4MWTMQ=R</]S,S"T<]2
-M6GYE2%/%7E[9P/7/P=585-#<<'-7R<[95%+*],U=35Q>UEES=DY%S__X^=Q.
-M=%_;1TA>TM=1T$Y?]/#+U4M6TT-/=<S$P-=.QMG]R5?>3<)9<G!*SU31T-?8
-M5,?77D5-4=C=4%744%3.P\376]S2W-!?7%I04UE(T<_>4U'%TMK73$)<Q=I0
-M6T!2S\O%TM'.QUE#3TQ:6-78QL/'V]W:U$)86%-?14]"Q<G$W][=7=79V-U&
-M3E#655=8W<W;W5I2W55?3$30P<='0E'&]]I425[6Q=E:05[2P-K5U=_;W%=8
-M4E)?7M';S-Q7U%]7UU-$0]_26%+4P]I045A2W=7=U-W2WM9<4%S6TE1?7==5
-MT5127E#9Q-K54=%64E%27%;?S-Q>65?%WU)-6=G!QM934U;04-%37$53U]31
-M4=;;V-O9W]906$A-7M/15571V=_<T-=?6%35U=#>V-E15=+3U%-065A'6%E?
-MT=[:W-30Q=#57T535=/4UMW%V-'74%9175!15-505M73UU77TMK55U!05E?3
-MUM'645+6TU574UU6T=76W-K;55A=5=+>5%#5T5135U974UE74534U=#6T]_>
-MW=_54%;45UQ=4EQ35-;65515U]'1T='0T]#7U]W?T%105D=Q=4%>5]'<V\7$
-MQ\3$VMO>W]W3T=;455175E%04%-34U-34U!04%%15E=75%15U=74U-34U]?7
-MU]?7U]?7U]?4U-34U-34U-75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U?______________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-:____________________________________
-`
-end
diff --git a/share/isdn/9.al.uu b/share/isdn/9.al.uu
deleted file mode 100644
index fd20614..0000000
--- a/share/isdn/9.al.uu
+++ /dev/null
@@ -1,232 +0,0 @@
-# $FreeBSD$
-begin 644 9.al
-M5U145-75U=75U574U-145E=5U-?1T-35UU55U5=5U-;6U5165E75U]355U%6
-M5U15U5555U;6W]1<4U545=31W=[?W=#4T=#1U]545U=04U-15U1455545U14
-M5=74U]=55%55U-;6T]+0T-'7U]35U5=14EU=4E!15U155-75U]'1T='1T='1
-MU];1UM;7U-555%145U965U=455555%74U];1T='6UM?4U-555U975U=75=74
-MUM=75M7555545%74U%555%74U-?6T=;6UM?4U5545E=75%=4555555555=35
-MU5175-75U=74U]37UM?7U];4U555U=75U]?6U-75U55555145='6U=?7U]?4
-MU555U5555%175U=75U=75%5555545%75U];7UM3555155=37U]'1UM?6U]75
-M5%145U=45U=75U=45=?0T-/3T]#6U]155%144U-75E35U=74U-3555=15E=4
-M5=37T=#1T-#6U-555%145%145%145514555555155-74U-?1T-'6UM'7U-55
-M55145%555U945%555555U=30T=37U5155U15U-35U-?6T=;1U-15U=355%15
-M55175E965-75U-3455145%=4U-;7U]?7UM'0T=;45%=75E=65%=55=75U=75
-MU=34U%75U5=5U]37T=;7UM?6UM?7U-555=545U=75U945575U-34U-?4U554
-M5-74U=34U-?7U-75U=555=75U555U5145U155%555=75U]34U]37U];6T-95
-M55145575U=34U5175%1455555=35U=55U=36UM?7UM;1UM?4U]3555145%=7
-M5U=145975%145=37T=#3T]/0T=?4U=75U=555U15U5124%9045915E34U]'0
-MT-#0T=;6U]75U=75U55555=65U=75555U-34U]?7U-34U=75U555U575U]34
-MU5545U=75U=75-37U]?6UM;1UM?55=1445145%5555145%355=74U-74U];7
-MU]37U]34U]34U-35U5175E965%75T=#0UM?4U5575U%15E=45%=4U=?6T-#6
-MU-355=75U=75U-?45]775=755=755=55557555545%15U=?6U]?7U-555%=4
-M5%555=74U=7555555=75U=75U=755=74U]?7U]34U-74U-?7U]37U]?6U-75
-M5%3455%65E965E965E=4U=;1T]/1U-75U-35U=74U-?6UM;455575U965E=5
-M5%75U-?6UM;6T=#3T-'7U-555%175U965E=75U14U554U=745%!4U=36UM'1
-MT]/3T-;755175E%045=75%555555U=74U]15U5175-75U-?1UM;6T=;7U=55
-M5%=14%%65%35U]?4U-34U=75U=75U]'1T];1TM#4U5145U965U145U=75=55
-MU=75U=75U-?7U-355515U=37U]?7UM?555155U=45%175%545=755=77U];6
-MUM;4U5145%155=75U=37UM=5U=145%175%14U555U=?7U];7U]?7U-75U515
-M5=74U]355555U=75U5175U145=34U=75U-34U=555=75555555545%555=75
-MU575U]15U]W0T='55575U=755514557555155%145=75U555U555U-755575
-M5=75U-;6U]?4U-35U=7555145U=45E?5U-?7UM;7U]355=75U=34U-?55U75
-M5%155%=455545U35U-55U-?7UM?6UM'1UM?455545%55551745!145?5U=34
-MU-155515U=37UM;7U]37U]37U-?4U-75U5545U965E?55%?55=77U]35U=74
-MU];1UM?6UM;55%=75U15U574U]?6U]?455545U965U=45=36T=#0T==55%17
-M5U=455155514U=34UM;7U-15U-37U5%555=4U=34U=555555U=75U-?7U575
-MU-?6UM?4U-35U=7555145U175%145%75U];6UM;6U-7555175U145%555515
-MU5555=74U-?6U]?1TM;7UU545U=75E%145%15U=4U-;0T]#1UM?4U5545=74
-MU];0T-'6UU5645975U35U=55U=34U-37U-555%1455555=75U555U=34U-55
-MU5=15=54U=34U-75U555U-37U-74U-155%=45%=755555=74U-?7U]555515
-M5575U=35U=36T=#3T]#7U5545E945%74U-3455175E9145%15=;7UM#0T]/6
-MU5145%145%545555U555U=75U=74U-355=55U=74U-34U-;7U]?4U-355%17
-M5E145%155575U=34UM;6U]37U]3555145=174%=75U155=77UM?7U%74U-37
-MU]?7U]5455175%1555555=35U=?4U=75U=74U=75U575U-?4U-34U%545%75
-MU=34U-75U=?4U-3555175E775%145%555U14U=74U]?4U=37U]36UM?55554
-M5%14U=34U-5555145%=75E14U=34UM'1UM34U=555%145%=45=75U-35U555
-M5555U=37U537U]?6UM'1UM3555=145%65E15U-74U]?7U-75U-;7U514U517
-M5%35U=75U555U=755575U-74U-75U=755=75U-?5U5545=77UM;1UM36T=74
-MU=7555175E975E%15U1455545=?1T-#1UM?4U-74U];1T='55%=14U-345%7
-M5U145=74U=34U-37UM;6T-'1T=;4U5555U145U15U5!245=5U=?6U];6UM?7
-MUM;0T]'6U-755%965E=75U15U=35U5545%165U555-55U-?7UM'1U]34U=75
-MU-75U5145%965U75U=?6T=?4U516U=14U=75U]?4U=755=545%175%=45%14
-M55555=37UM'0T-/0T=;6U]?7U]34U555U=555U=75E=65U=65E%65E755=37
-MU]?7UM?1T='6U]175]=55%155%=75554U=37T='1T]+3T=;4U554U=155U15
-M5%965E975U965E%145!15U15U];1T=;7U]?4U-34U]'1T=/3T-/0T-#3T]#6
-MT=+1U=555=555U175E914EU<7%]>6$5:6EI;6%]24%95U-?6TMS<WMG;Q<;!
-MP<#"P\/"P,78V=W0W=G<W-C9W]W64UA!27=S?'YY>'AY?W!U3D=0UM[&PL[+
-M]/;Q\/#Q]O?T]<K(S\G.P,?%W=#%R_?.PO7%4%MW96=D86-@8FU@9V1_25/:
-M]?'R_O[_^.7Z^N?E_O/TP]G0U=5775M!2'5U=W%T=71U=7=W=4]$4];;S<CW
-M\/#\Y>?DYN'E__/`445*?'ME86!@8V!G>'UW1%)4T=/0W=_9Q<;`P\[+]?;P
-M\OS]\O#V]<S!Q=Q4U_?_Q\?X]-?95GQY?&%B86UI;6!@9'UU4\7/]O_^_^7[
-M_?[\]<[)Q=_%V=#9V-35UE9=7T5#0TQ*2DI+0T5;4L7XX/CFZN+ZY?)47T5[
-M9V5C:6]O;V!E<UO2VLOVR<'`Q=K"QMO#S\'&Q]K!R\O)SLG/Q-=34EU04%E0
-M\^;"RNSDS_/.3DY#9F)G;6EM;6]F?'9?VL_Q_//Q]LS'S,/:Q,3:QL'<WL+,
-MS,W`QMO35UE!049`1D?>Y_K'X^C[_OO>0%=W8V9A:6EO:&YF>'57WLOR\/;R
-MRMK"R,#-S\7!R,+9VL?&P,'$V-!764%"049'7\/BX<WCZ^?[_EU_27QL;&D4
-M:V!F97!"Q/OX\?3`5UQ">'MU153,]/+GX^/@Y?#.QU9.<WAZ?4A;V^V9A)_B
-MX>?5>149!1P0$!1I9MS@[.?[^>;GWWMC87EV<WU$\./O[>#@X.7:=7MG9F1^
-M<4#7PO#ZY^>4AH*:Y7MD;Q<?!`029W%T3U+]Z>W`?F1T6']I:7'PX^?UPOGA
-MY<O6UL/#6'U[<%G9P,?._^7E_NV'CH'H8Q<5%AP'!AEF55--=]#@[O5F%6)6
-M]$MB>/*5E?]"3,_[\51'W/+Q4'UX2]S,V]#!]_WDDXR*@>46'!T='@<'$G3T
-MP5EVT^;CU6@0:EW\5'MUY9:7]GID4?CES5S0\?#2<65QTO#]SU74R.^'M8J9
-M91L;'AT9!!MKPN7)3WM2^OYP%A)B\^36<=7CE.Y3;&)'^.;_P\3.S]5Q?T#U
-M^O+`P<OH@K>*EA,`!A@6$QH8;/+M^DY@</+X=!838<C[S-#TX.[E2V]B0O_C
-MYO'245M!2$E4]?GX_O'YGK6V@E(&#`$=;Q88$F7E[_YY:V7<Q'@4%657R_SF
-MX^/[5WIA?M3Z[./S4G!S3=;.\/+]^?GKC;:UD!P,#01I9Q,>$4[CZ_YA:F=%
-M6V=I;7E2\.WK[?Y096%Y7_;GX^3+17Q]1<?^Y?+-SN"'M[:&;`P.`!9`8QT>
-M:\_JE=1H%6!U=V1@9GQ1Y>KJYMUZ8WI=]N3@Y/11<7)/W?+GYO[UYH:WMX<5
-M#@@#:\A)%AX60>B6]V(7%69T7D1[;6?UE);C6FYH?/3AXN3/5D1(2EK;_>'L
-MX>&8M;:,T`(*#AG3]&03'6_+E^E1;Q$7;4'?2FUK2.Z2D<II$VC?Z9&5\$QV
-M2$15V_7ZX./BF8NWC_`!"@@%0_%+%!-J5Y25\7@7$15_UEMF:W+CDY#\;QP6
-M0>R0E_A-<D_1]O#T_>7CD(VWBI\3#P@#:M9:;Q`4?N>5YUAB%15@1DUC%&SV
-MD9WH=!$28_"7D>W<?'Q9]/K^\__FDHZVBI8:"PL!>OY9%1P6=>J1YW=K%&E]
-M4'X5$6;@G)S@8Q\=9.21E_A(>G?8Y./FY?CMA;6VC,\#"@D:7O-S$1P5WI:6
-M^7P5%V):3V@=$%J1A9S/%A@15I2=ZU%C8DG_[^SZ_>&9BK&+X`$U"P1>YD81
-M&1;7D)SC?1<1;%-0:1X9>Y:$F_D6!1U-EYZ6V6)N</#OZ>?SY9ZUL(KO`34*
-M!%_F0A(%$U"2GNYV%A-I7M!M'QYEE(6;_A$$'$V4GY?&86QQ_.J5X?3XFK2Q
-MCMX--`@<_.9E&001]Y^<X'@6$6;<3!<8$MR<AYU%'P46S)&=[4QB9];CE.GE
-M\>^#MK>$$0D*`&;GQ1<%&6;IGY36:11C6444&AMAEX>%YQ0:''7ID.O:>7I2
-M^NCHYOGMA+2V@G,,-0T7^_)N!05J^IR0]F$58%U7:P4$%>Z$A.EI&QQ\[Y#J
-MQF5G6N7KE>#\Y9Z*L8GQ`C4/$_SE8QH$%_.2D/1A%6;1S&(%`1/FA(:78!@?
-M>^.7[MAY?U?X[>[CY^R:M;&.V`TU#!'^]Q4$!6_GDI5<;&]U]MT6`0$5E(:$
-MXFH9$$#BZ?K43ESUY>?FYN#KFHJVC-L#"`,6R=<1!!MGX)#I36-D4/!9$@,!
-M:)>'A>5J'6I3Y^'SW%79R/?]YNF7DX:TMX9L#`X&;<]Z'@<26>F7_7]Z7/+/
-M;00#&EF<A99=:VI\P_WWS<+"Q-=7]>^0DIR#M+6<$@\-&V53%04%:_'H[%!X
-M6__A11P#`!7LF9+^>&)_7U15V/[F\E9U7^67G9*;B+:,TP`.!FI49!D''5_B
-MXMIZ2?S@]14'`QG4D9/M5WQR2$M/T_OMY]QS</64G)V1AK2TGA(/`AQ]3A,$
-M&V?GX\]^??WOX64%`P5Z[)?LR-5417YA=O/O[,9^>M#IDIV0F(JV@G@"#!AC
-M=1<$&FS_Y%9Y??CJX'$9`01H]^#F^?WS5V1I9/+KZ,QX>-'BEY:4DX^PM><&
-M#!ML9!8'!6W\^7]B<^:1X'(3!1@19=W\XN_FUF=L9</B[?E<<4O"[Y:6EH6T
-ML89I`P87;Q<%!Q%6^T1L>?^6ZEIJ'!X=%WK=X>OL\'1F9$[TY.3T74)1_^B6
-MD9*-L;7F&@82:!$8!A]Q]%-N8_64E\!B%1,?'!1.^NCIY<1(?G]&].3EQEI?
-MQN?JE):;M;&!;`0>;18:!P5BP51B:E?KEN1E8&$1&QAI].SOY?+V47YD1OG@
-M\4IWWOKLZ>J6A[>WDQ,8:&8>!@8=2U9G%6?AE^S4?U]Z'@<>?/W__>3MY75C
-M?O?C^U)TV?OEY>.4DH&WM>T1%F1J!@`%%W-E:6U6[N[_U]?W9@4$$4[05OSK
-ME?9G8%/X_-%'W_WVVOZ5D).'M(KM%6A[%@$!&!1D8FEGQN+G]<?V]VH$&A5^
-M>T_CD97?9$[R_M%$V_+*7]3FE)>4A;6UEVYA014``Q@7;Q05?O;B^_?\Y_ML
-M!1L5;!5EXI/HW4K.Y<!)5?CXUG7<X^GMZ9N*M)%G7L@5`@,?%A$=%$GPY??X
-M[./_9Q\?$1809N.7X=C(X?E"=O7GR4E*QN;MX.^9B+2>3/_F:P(#'!(9&!1-
-MV\S.XY7FR5%N'!\3%F+/X^?[YN/_5U+VY<!(2M/R_OKBD(*T@??CE'\!`!P>
-M!`46<D)1R>V7XO7Q5A$;'!<59MSDX>#@YOS*]OGW6G52P\GUY.F>CHB0Y)/M
-M$``8'0<!&6QZ>%3EEY3X_>!/'QX4%Q!MS.7YY.WLY/#^Y<%/1=?6W<CDZX>+
-M@.Z2GM,8!1`%`P82:6MGQNZ6[?[MZ'@?%V\3'&'PS=_DZNG\\^'FVG56Q]5$
-MQ^"4AXF$E)J22QP=$`$#!!P6%F?WZY7DX97L9Q!O%1\29--.5>*4[_S@ZN/2
-M6<[?=73UY_V3CX"5F87^%!`5!`,&&A,3%4?AZ_OGE)?%%6%E$!]K0'MY^>CM
-M^NR7[O;2]MIU3%7-W^6&C):0@9!W:V82``8$&1P=8]_C^/'HE.E$84-O'!!E
-M>VM"YN;G[93KXOK]_-!(1-+67N"&@.F>@.A\94H<``0%&!D?;5OPW_"5Z.[X
-M7%ED%!=C8!5R_?SYXI7K[^/Z^=U.4EU)2MWIAX7IAX?D4E!R!0<8!!L%'6UW
-MU%#@[N;HXL]:?V\5;6AJ<]_*Y.GJZY7MY?O&0U]=<750S)*'E9^`E/7+V!`$
-M'@4:&P469D-VRN_Z[)3C45)):VAB:6),]?SB[NF5Z>?\]M-"14EV=774EH>4
-MDX*0_?_*%00<!04;!!!L<WG?[?CCE>K"5M%F;&)B8W_2S^3@[>KIX.7_SE]&
-M27%R=D#>EX27G(.6Y.7V%!H=!1H%!1-K9&'1Y/#FZY?QV?=T9F)F8&18P/KG
-MX^GIX^7X]]E23TMP?GY*1_N8G.J&FNWDYEH?$!P;&P09$V]O8<SW^>&4E?+P
-M\D5A87)D94'+__[F[.[BX>;\WEQ`=GIG>W-U5^Z8D9"$G>_XYW$0$1(?!1L<
-M$!5H>UWW\N7JZ/OV\]U]97-U<4+,^_KGXN[BY_KRR--=1TEW<TA>4U'#Y>'G
-M__+G^L+>5$IY<GAC;6)C;FEO8F=^2E;/]_+[_\K/]LG?VL;$V=S2Q<G/RO'S
-M\?'QP=/<U5M$04Q3\>7P_^WM^/#W54IV96QI:6H4%6MN87].4\;W\_+S]\CU
-M],_#R??W]/3V\O+P]_?US,335D!(27=S<'5*3]SZY_[CZ^+[^?==0TMZ8&)O
-M:Q5J:FYA?G50Q/7V]O?V\?3T]O#V]_?U]??V]O'P]_7"W5=>0G1V=G%P=G1U
-M1<GE_.7IZ^#DY<)%07!A8F)I%6MK:&-X=D3=S/'\\_3Q_?;U]_7+]<K/R_?T
-M]/3(P=O34%M#2G=V=G=*3D=?7M'^X?CGZ.GD^__91$%P9V%C;FAN:&EC97U)
-M4=[,]/?T]OW]\_#S\_'W]/;WRLC`QL735%U=64-/0DUU=4Y.3T986U3QY_KE
-M[NCAY.7T55U.>F9@:6IK:A5N9GY*7-W/]O;U]OS\\O#S\_'W]<OT]_3.PL'9
-MUE%?6UM914),0T9`0$%%7UQ25<#_Y?CA[^/Z^??50'1X9F!L:&AN;FQG<T-3
-MWLGT]/7V\/'P\/;TRL_!Q\#/R<O+SL/&VM-755536$1`0T-,3D!97EM97=+W
-M\/?ZX.;^_/?37$-R>'IA;&UM;&)D<$=4WLGQ],OT],KT],G/S,38Q<7&R/3U
-M]/?UPL?>T-=76DU/279S=DI)0D5?4EU<W/+^\N?LX?[RR]%30W)^>6=B8FUL
-M8V1]3U'9PL["P,/!P,CUSLS/PL##S<KS_/W]_?#+P][45U)`=71V<GUP<71,
-M0T5<4%!4T,S_^/_DX?KQ]<=01$ES?WAG8V)@9F5R3E/9QL'"S\W!QL#"S<#$
-MQL_U]/?R^?G\\/?)Q=-06$%,=')R=G!P2T=;4];1U]/>T%=7T,;#Q<WV]L[!
-MQ]G05EM#3G=\>7E^?WQV1EQ35-'?V-[9Q,W.SL_,SLO(SLKW]O;TR</:T5-?
-M7UQ91T181TU-3$Q!1D!%7EI:7%)25='0Q_7URO#R]\K*QM+74D-.2'%]<GUR
-M<'=U0T5:4]77T]_;Q<//R<KT]_;V\?'V]/7*S<''V-9164-*=W%P<79V=$Y,
-M0T=;4='1T-G:W]_8V<3/SLGW\/?)S\'9TU%;1TUW<W)\?GQS<75-1%Q05=/8
-MQ\++]/;P\_+\_/#W]\O!V-)17U]:04-,2DI(='9U3$Q,1%]>7UU0U=#3WL?`
-MS\G.R_3W]??WR</"VE1814]W<')]<GU\<W1*3UA05]S:Q<W(SL[U]<KU]<C(
-MR</$Q-K?TM%55%1?0$%$3W=T24M+0D!%4E=7T\7:VL'&Q<?'VMC9WMW0T=/=
-MT=77UE=24%U86UM:6%E:6EA:6E)44U365=7=W]S9VMC9V-[2TM[9W-/=TM;4
-MU-34U51455115E=75U%34%!34U%145%5UM515-=74U745E?1T];0W=/=V=W0
-MTMS0UM;455164UE?4%927%154U977UU47%A7UE=7T-'6TM+1W]C=T-S?TM+0
-MU]/=T='2T]'0U5%4U5!<4%9=6%A>4E-<4-?1U]?1TMW6U=?45U?555975=70
-MWM_>V=[?T];45EQ?75U>6%U<7U]?7U#6T='=W]W15%975E34UM;0T]'6T]W=
-MW][<TM#45=555%=745!27EQ145-7U-;1T=;0T-'2TM#3W-915=164%)25E17
-M4%?455555=76559455965574U];6TM+0T='1UM54U-=55-37U-7455%75%-2
-M45165E75U-77T='3W=S<W]S3UU575E915=505E545]545U174U;55%;55535
-M55?5UU77TM+0TM#7T=975U56455445755U%45E?5U-?1T]#1T=?7T=?5U-37
-MU%5455165-755U945U%04E965%175=?6T=#=W=+0T]'4U]14U=?45%1445!0
-M5E545U34U-77U-76U5%6U517U='1T='1T-;5U-'55=3755165U155=31U]37
-MU5915E745U=55514U-?4U]=55=545%75U=77U-55U];4U-7455=45-74U]75
-MU-75U5575%175U155=74U=755515U574T-#7UM#6UM;1T-'55%574E)64%;5
-MU=7555=4U-74U]?45555U]?4UM;555575U=65E=45-77UM?7U=155=77U]34
-MU=375%74U574U-74UM;7U];7U%54U=5455165E71UE77U%9045965U74U];6
-MU]?7U]?4U-?7U%575%145%=75=75U-;6U]37U]145%545U355]77U575U5=4
-MU=75U=35U575U=75U=34U]?4U%57U]55U-75U5575U145U55U=?4U=345575
-MU=77UM;1UM;1U%55U5165%=75%?4U]55U=14U-155555555555175%545=75
-M5=37U-36U%55T==5U=34U-37U%55U=7555555575UM?4UM?4U=555U175E!0
-M4%%75=31T=#1T-#1UM?6U-555%75U=37U]?6UM?5551645=65E=65U=75-54
-M5]?4U-?7UM#1T='6U=5555=75-75U5545U155%75U-75U5145-74U=?6UM?7
-MU];7U57555=45%1455145U965E%65=36T-'1T='6U-35U=#3U-34U5145U14
-M5=7555555%=745965U145%35U=36T=#0UM35U=75U]74U5555=55U-?4U517
-M5E965=55U=155-77U];6T=;5U-34U-5545!45E945%155=55U=74U-745=74
-MU]'1T-/1U]?45%75U%545%=75%=75-37U]34U%555%145575U-75U=355555
-M5555U5175U=75%34U-30UM77U-75U574U-?7U];6U]?4U5175U=645965E96
-M5U55U=?1T]#0T='7U]35U=74U-7555155=74U=755575U5555%175U75U-?7
-MU-?1U%%=45!6U];7U]?4U-175%?4T-#0U-14U]#5453455%>4%?7U-71U5;7
-MTM;6UM#3T=%5U=74U]=54E)<4E=75E-7U-;3TMW2T=15U5504U/4S]1^6,3:
-MQGINVNO'V-USY>I;%F?^D.UG%7'C^&040?G]T=7WTWUA3M/YY_Y285U^>41T
-MR^'OZ>_;8&1:U]!'>E_QVG]L8$'GX_#34-C;0G75S\O9WMY6U]M41E%<96-?
-MS,']\D35_%=TW49&R/)9?<+/V-M?0D=>2D7-],U52TA`U_3WVUO=V5)$7M;%
-M\]I"5D1#=D/45L/!W5U4R<G!6%_36UQ;=$[1WMC&P-9=U]167U%9U=]<5=_2
-M55#0Q\?>TU134]Q43U+55%+4P\?2U4E%W]Q>7M+9TU=&7$%6]\Y=15165-?>
-MQL[?7%127]+15UI%5E9`6U]5S,3345W3T=G27=?;Q5=!T]-<5MW44M76WM'6
-M55A265G645'7V==9U-+=W=537-#?U]16T]W=WU-=UM+57UM;1%S7W</%5=[$
-MTEE>U5'7UU105];6T5-1UM%07=C:55-?4E94U=/?U-;57EW15E_<W=3<T%Q?
-M5=S<W%5<U=74W='7T=55U%=25]/75E!?45905-_:T]765$50TE!2W=G7UMW3
-M5U]44UA4TM%7W=-65-5?6='=5U%7U-'1UE=1T-C>W5%<5=1445=5TM[<U5A0
-M5U?755%5T=S15]505E94T]115];3U%'5V]_4U-555E9?7EU0UM+45-33U-74
-M4594W-+1W=?1T%5=4%-?5M145];55M;0T=/45M'=5%)35U70T]76T-#7UE=2
-M75945]545%70UU355M30T%54U]?1UM+7U]?5U=775E=45]'75E34W=-66UU4
-MU]!65=95UM16U515U=345-76U=?4UU75UU%65=555E57U=34U]#0U='<UE?6
-MUU%25=S6UM#555?45U=5UU55U5-65$1V2D9?5-/>VL3&QL;'Q=K8V=S=T-'4
-MU5175E%04%-34E-34U-04%%15E975U155=75U=34U]?7U]?7U]?7U-?4U-34
-MU-34U-34U=35U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=7_
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-M____________________________________________________________
-9____________________________________
-`
-end
diff --git a/share/isdn/Makefile b/share/isdn/Makefile
deleted file mode 100644
index 0999d77..0000000
--- a/share/isdn/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# @(#)Makefile 8.1 (Berkeley) 6/8/93
-# $FreeBSD$
-
-FILES= 0.al 1.al 2.al 3.al 4.al 5.al 6.al 7.al 8.al 9.al beep.al msg.al
-
-CLEANFILES+= ${FILES}
-
-.SUFFIXES: .uu
-
-.uu:
- uudecode < ${.IMPSRC}
-
-FILESDIR= ${BINDIR}/isdn
-
-.include <bsd.prog.mk>
diff --git a/share/isdn/beep.al.uu b/share/isdn/beep.al.uu
deleted file mode 100644
index 5732400..0000000
--- a/share/isdn/beep.al.uu
+++ /dev/null
@@ -1,107 +0,0 @@
-# $FreeBSD$
-begin 644 beep.al
-MO)PU,P+EEA$*#)^YI;%F."<QX[>(XFZ5M+"!#"<F-H&[OHQK!%.:Z`\[.`>Q
-MI[N-`CPT>I_$`P[`LJ6]ZC(F/FFUMH5E48RQCATZ(3SCN;JTU@`3EY(9/3L+
-MCZ2EM!T\,AB=D!,,%;6ZOH8T)R4`CK..]V"9M(I=/"$[%KVELY$``=&<?C<Y
-M-IVZI+/<,CX/Z83=!QF!OKF(`"0G-(6RMY-L^(^UES<G)`VWI+Z`!0D1E^<-
-M/#-UOZ>_GS8[-DF!DA$%E+*XMVLZ)CWXLK*`?6>%BX4")2<V@Z6ZM14U`/>7
-M$C$R&+:GNXT..CP?AH#<&5*TOK#F/"$[$+&_M?@7XHV`$#XG/>Z[I+#V-0II
-MET,(,PV,I:6T&3L[#YZ.DA5O@[VRFC<F)`R+N;"<$62%@]$P)#@5O*>\F0DV
-M!^/L!#8+DKBDLT0_)#;DBX/4%).QLHT#)R8QA+F\@FP=[(&4""4E`[:GNXP&
-M,PA"D&`(-5BRI+R2,"<_:XBUD6[UB[**%CHA/_&_N+79!628G@4^)32"I*6W
-M%S,Q$Y#A!PH3M*6Y@PLG.@""MH!`98:QM/0](3H<LZ6PD009[)MF,#HSE+JG
-MLO\Q/0+OG&X,!("XN[4$)2<TF;"UZ6V5M;>=-"8G#K6EOX$>`WJ<^P@Y/&*\
-MI[Z:-#XT1(7G!`&4O;JQ>#@F/<FQL81E7(.TA@`D)C&'I;N*;0X8[Y<%,C\'
-MMJ>ZC@(X,A*%F&X&0+>XLI0R)CL<M[V)RVR=BXT7.28__+BEL?@.#'2183<\
-M"8*DI;<0/CD-G8#G&16,OKR&-28D#HZ_MI`5S8*/S3`G.AV]I+R8#34<ZOD"
-M,S27N*2R]CTE-_B,FFT3G[._B08D)C&9O[V!8VF?C)$+)"0/M*2XCP4V#<*4
-M$S<V>;*DOI@V)#UKC(SE$?ZTO+1L.R$^5+V^BM\<\8&%!#@D-H&DI;=L,31K
-MEE$/-QFTI+N/#R0[`8&UFV!^@K*VX#(A)1NQN[&6&6J<AV,S)#WFNZ>RXS<S
-M!^Z5&34`@;NEM!\Z)#2=MX_Q;YRVL9LU)B<+B+J\@1,%\X7X-3H^%KVGOH0(
-M/`O7GW8-#.J\I;/7/B<RUK>WG&/SB;&#`20F,)N[N(MG`!62E@8_.`.TI[J(
-M!C\P%IZ5&0USMKJ\G3`F.Q^UL()=>H2WB6@Y(3Y3OJ6QYP('_IT5,#DU@*6D
-MMFD\/P"0A7(!$(ZXOH,()R0.@KVTZV[IB(OY,R8E&K.DO)L!#FZ1PP@_,>RX
-MI[WC,SLT_X"4'!F8O+F*&B0F,)*]L(1@=(:+G0LD)`N*I+B/'C4$YN@%,S-N
-MLJ>YAS0E,FF`AW`9Y;:^MG,Y(3YVL[R)UQ27CX<$.R<PA:6EMV4T"7F6834S
-M![6DNH@#.CD&AX^5$7B.O+"4,R$E!+>YMI0308>`8#TG/]JYI++H-3<9Z^4`
-M-@^&NJ6V%S@E-9&*AG!KFK.RAPHF)S6/N+V'%Q&6@>4T)3L>LJ>^A@PS#,J6
-M%S4+[+^DLOL\)S)9M8CN:^.TLX\$)"$SDKFYB'D%1860`S@Z#K6GNHL%,C=N
-MDO4`"V&QI;^:-B<X'HFVA'Y+@K&U9CDA.7B\NK;A!A*7F1$R.C:$I:2Q93,R
-M!Y:0$`\>B;NXCPPD)`F!L(GZ8IVTM.TP)B4'L:6]FP0!79]4-#@S\KFGO94Q
-M/@O_A<8&!YN_N[0=)28PE[.VGF#WC[28""<G-8ZEN8\3#A.4[@`\/!"SI[B!
-M"S@P;(>=%@?ZL+BPVCXA/F2QLHU$89J*@`4Z)C*<NJ6W=P@#QY87,3P#M:2E
-MB@<X/P>:@<$;9XNYLIPQ)B4&M;^T[Q3FC(UG/"8Y<KZDLI0)"A27W0DR"X2E
-MI+%C/CH*E(^<%1>'O;R#"2<G-8.^LX5J9H6,X#<D)02PI[Z!`S8!Y.@;-C3Z
-MOJ2]Z#(D,T".@M@1ZK:\BQDE(3*4O[^/?1+B@)P".B0*B*2ZBA\Q"GN1>P@W
-M:K&DN88T)#D>C(J2:5V)LK=)/B$X;[*[M^8;9IB%$SPD,)FEI+%,,3$9E^,'
-M-02)I;N(`"0E#H>W@U!@A;&VES$A)`"WNK*8&1GBA5@V)3Q8N:>\D#0]#_N=
-M8@\#F+FEMA4[)S'HMK64;>RUMH<.)R8WC:6^C!<`9Y_N##D^&+"GN(,//S9F
-MF^$$`OVSNK+F/"8^8[>PAG))@+>-&#HF/92[NK1;#1OMD!PR.0^(I*6U&SX]
-M&IZ9;`!MM;N\A38F)0&+O8OE;)"*B7`\)CAOO*2SE@T,?Y!W-#\TFZ6DL'0\
-M.`GJ@>`8$H&_OH\-)R<TAKRQGV[<@XCI-R<E`+:DOH$'-1GIX``R,=J_I[R0
-M,"4Q0H*%8QZ7L+ZT$"4A/>V]O8)]:9R/F`TE)S2,I+J*$3<,5Y<7-S`3L:2X
-M@PLE/Q^`C.83U;6_L<\_(3L4L+FTY!+(@882/B<RD;JDL=PW-!:7Q`PQ`8ZE
-MI;4$.CH/FHJ%86.!LK"<-B8D#;6[LYX2%9V!7C$D/F:_I[R="C``YI4?-`Z>
-MN*6Q9#DD,>*TCOAKEK>S@`PG)C:!N[^-:QKTA.@).SL'L:>XC0,]-7.=0PT(
-MP;*EO90R)S]OM;>98=N.L(D=.B$\X[F[M-0&%).=&SPZ"H^DI;02/3,?DI09
-M#A2TNKZ&-"<E`8^PC-MGA;>U4#PA.A:]I;.6!@?PGV0V.#&2NJ2SV#,_#.F:
-M=P`;@+FXB`$D)S2%LK26;>.(M98W)B0-MZ2_@1H/:I'Z#S\R<;^GOY\W.#=$
-MAI0<!):RN+=I.R8]^+.SAGERAK6$`B0G-H.ENHIJ"P?ZE!XP/1NQI[N,#SL]
-M'8>'=1I6M[FPX#TA.Q"VOXOS%96/@Q`Y)CSONZ2Q]PH(899]-3(,C*6EM!XX
-M.`V>C)<1;XV\LH4W)B0,B[FQDA9UAXW5,"<X%+RGO)X.-P7OX08Q"I*XI+-<
-M/R4VYXB!=1><L+V,`R<F,82YO(-L$9>#E`LE)0.VI[B,!C`.49%K-31%O:2_
-MG3`D/&Z)B)45\K6RM1<Z(3_QO[BUTAI/A9D$.24T@J2EMQ0P-A:0\@`U$K2E
-MN((+)#H!@K>&<WF`L+?Q/2$Z'+.ZL)8%$I2%8C`E,Y6ZI[/^,3(`[I`6"0>`
-MN[NU!24D-)FQB^!MD;2VG30F)PZUI;^!'P%`F?\+.#QLO*>^FC4_-5:;R`8`
-ME[RZL7PX)CW*L;::9]B,MX$#)"8QA[J[BVT,'927!SP^!K:GNHX#.3,0FIT6
-M`$&VN[*7,B8[';2RC]A@F;6,%SDF/_.YI;'Y#P-5D&\V/PB"I*2W$3X^`Y*&
-MRP44C[Z\AC4F)`^/O+>7:_N,CLPS)CH<LJ2\F`(*$93Q##TWE[BDLO,].C3Z
-MC9\5'9FROXD&)"8QF;^RAF-@FH^1"B0D#[2DN(P%-P#SE1XV,66]I[Z;-B4]
-M:8V"SQ+EM[^T8CLA/U>]OHC6$^&#A00X)#:&I:6W;38U;99W"#88M*2[CP\E
-M.`:!BYQI?(R]L>(R(24;L;BQE!]@FX9M,B0]Y+NDLN,W,07H[`4T`X"ZI;<<
-M.B0UG;2"W&^9L;":-28G"XBZO880&>"'_S0E.1&]I[Z$"#T)Q9)A#@^5OZ6S
-MW#XG,MRTM9%MY8JP@@$D)C.8N[B(9P9@GY8`/CL"M*>ZB08\,16?X@0/?;&E
-MO)PP)C@<BK&`3W*!MHAH.2$^7+ZEL>0#&N.<%S,X-(&DI+9N/3P&D9EC`Q.)
-MN+Z"""<D#H*RM>ULEXJU^S,F)1JSI+V8!@UDD](*/C#MN*>]XC`X-?B&XAL;
-MFKRYM1LE)C&2LK":8%.#BIP+)R<+BJ2XC!\*&^SN!S(R:+*GN8<T.C-L@85@
-M&N>QN;9W.2$^=K.\CUQIDHF&!#HG,)JEI;=Z-0]/EFDW,@>UI+J(`SH^!X2-
-MXA)YB+^SES,A)02WOK?K$<6`@V,])S_<N:2RZ0HT'97Q`C`.AJ6EMA0X)0J1
-MB(1F:H2RLH8+)B<UC+BRA!<5G8/E-R0[&;*GOH<,,`+RE!(T"NR^I++D/"0S
-M48J.YQ7NM[*.!"0A,Y.YOHYX&\V'DP([)0ZUI[J+&C,T8Y-0#35@L*6^A38G
-M.1^.M)MG1XRPM60Y(3E[O+NVYP07DY@3/24VA*6DL7HS,P66E!\(&8FZN(X,
-M)"4.@;&/]&.9M[?L,"$E!K&EO9@%!\B96S<[,O:XI[V4-C\)^YM-`P::OKNW
-M$B4G,9>PMY)BY8FWFP@G)S6.I;F,$PP4D>\"/SP3LZ>X@0LY,6"$EQP!Y;.[
-ML,,^)CYEL;.#2'B'M8,%.B8RG;JEMW<)!O*1$S`_`K6DI8H'.3P%FX=,!&>U
-MN;V?,28E![6\M>!JZ8Z,9#PF.7^^I+*5#PAOEE@+/0J$I:2Q83\[")2-EA`6
-MAKR\@@XG)S6#OK"8:W.'C^`W)R4'L*>^A@`W!.#L!#`W^+ZDO>HS)3!8CX%-
-M$Y2QO(H>)2$RE+^\C'\1E8*<#24D"HFDNHL<,0AWEFTU-A6PI+F&-"0^'XV(
-MEQ75B[VW0#XA.&^RN+3D'G>$A!T_)#">I:2Q0S8V')?[`30$B:6ZBP`E)0^$
-MM(%U8(>PL98Q(20`M[JSF1X=E81`,24\0+ZGO)`T,@WDD!0(`INYI;9K.R<Q
-MZ[>*[F_JM+&'#B<F-X*ZOHT4!G28[P\X.1NPI[B###\W>YGP`0S]LJ6RX#PF
-M/V"TL81X7(VVC!@E(3V4N+JT10(<E9,9/3@.B*2EM1@_,AB?G1<";[2[OX4W
-M)B4&B+*)\V.<M8AQ/"8X;KRELY<#`T22>3<^-YBEI+!(/3D/ZH;V!!R`OKZ/
-M#2<G-(:]MI)O\(R+Z#8G)`"VI+Z!!PL2E><"/3#<OJ>\D#$Z-EN#GQ48EK.Y
-MM!$E)C+BO;*#?V.;B9L-)2<TC*2ZBA$T`\.4$S8S$K&GN(,+)3P=@8/V'-*T
-MO['T/R$X%+"^M?X1Y(*!$CXG,I&ZI+'<-#45EU\),`".I:6U!#H[#)N(GFEB
-M@[VSGS8F)`*UN+"<$&*8@$4P)#E@OZ>\G0LQ!N/I&C<)GKBEL'LY)#;MM8W"
-M%9.QLH,,)R8V@;B_@F@>YH;H"#H[!K&GN(T#,@M/DWH."\:]I+V7,B<\;8JT
-MDFW*B+.($CHA/."^N+51!VV?G`4_.@J/I*6T$S(Q$I/L!0@4M*6^@34G.@:,
-ML8-298>VM50\(3H1LJ6PEP<%YIE@,3LQDKJDL\4S/`+HF6$"&H.XN(L!)"<T
-MA;.UE6WHBK21-R8D#+2EOX$;#6"2_PD^/7*_I[^>-SDT4H3L&P>1O;NV;SLF
-M,ONPL(=E0X"UA`(D)S:`I;N+:@@%XY0:,CP:L:>[C`\X,A.$A68$5;>XL^(]
-M(3L0MKR)RFF0B8(3.28\[;NEL?<(#WR19S0]#XRDI;0?.#D"GX+L'&F,O[V%
-M-R8D#(B^MI`4UH",U3,G.!>\I+R>#S0>Z.4#,#62NZ2S5#PE-^:.A&01GK.\
-MC`,G)C:$OKV!;!62@I0*)24"MZ>XC0<Q#-J7$30W0;VDOYPP)#ULCH[C%_NT
-MO;44.B$_]KRYBM4>V(>8!SDD-X*DI;05,#<5D=D--!VTI;B"""0[!H.TA61\
-M@K.W\CTA.A^PNK&7&Q>3A&PS)3+JNZ2S^38S!NB7'`L&@[NZM04E)#69MH[Y
-M;9*WMI\T)B<.M:6\AAP$QYOS-3L_;KRGOIHU/PK2F5D#`I:\I;%P.28R];:W
-MGF'WCK:``R0F,8>ZN(MB`A:1E`8_.0:WI[J.`SXP%YN6'0-!L;J]EC,F.!*T
-MLXU79(6TCQ<X)C_VN:6Q_PP!]9-J,3X+@J2DMQ8_/P"2A$0'%XZYOX$U)B0/
-MC[RTZFGBCHC/,R8Z'+*DO)D#"166PPD\-I>[I++\,CLTY(.1$!R;O;Z(!R0F
-M,9F\LX1C?H>)D`HD)`ZTI+B,&C0&Y>L:,#!DO:>^FC<E,FV"@5L<YK:^MV,X
-M(3]7LK^)41;KC84'.R<QAJ6EMV(W"V269`HQ&K2DNX\,)3D'AHF1%'..O+'L
-M,B$E&[&XMI4=<H2&;STD/.6XI++C-#88ZN8&-P*`NJ6W'3LE-9*U@$-NFK"S
-MA34F)PN)N[V'$1+JAOTT)3D0O:>^A`DR#\J0:PL)E;^EL\<_)S/9M(J5;N.U
-2L(T&)"8PF;BYB6<'<YN6`SD[
-`
-end
diff --git a/share/isdn/msg.al.uu b/share/isdn/msg.al.uu
deleted file mode 100644
index 8375ab4..0000000
--- a/share/isdn/msg.al.uu
+++ /dev/null
@@ -1,1506 +0,0 @@
-# $FreeBSD$
-begin 644 msg.al
-MT]'0T-=7U==45=35551755555%1555545U145=37T-#3TM/0U]355=75U557
-M45%15U=75U=75-74U-75U-;3TM/0UM;7U-75U=34U%575E%15E905-'4U=35
-M55545-55U5545=?6UM;6U]?4U-37U]75U-34U=35U5545%575U145U=65U94
-M5=75U-34U];7U]?6T-;5U=37UM'6U]?55%975U164E955E77U];1T-=45U35
-MU=?55=75U-?6UM?55U!24U;5U]?4U=55U=37U]?7U-34UM?4U574U514U=55
-M5U=15E35U=34U5545%54U-'1U]'2U]3755145U=645=5U=545U=4U=37U-36
-MT];7U]34U];1U%545U=5U]?4U%55U=755%%65E915U74U]555=74U]?7U-?6
-MT='0T-;7U]345UU65595U5=75U145U14U=?7UM?4U-3455=45-37U];1T=;6
-MU];7U51745%75%145%755555U-34U5145-74UM'1U]?45%=75U=45%74U-76
-MTM;7UE75UM;455145%145%545U145%=45%145E=5U-?1T='3W=+0U]35U5=1
-M5E=555575E155515U-37U5545%575U145574U];1T='1T=14T-#5U-145%17
-M5U75U]34U=555%=45=34U]?7U]355%=64%%65%55U-;7U-35U-?4U-37T=;7
-MU];6UM3555175U?5U-35U=77UM155U%05%515]75U]?4U-?6UM'1UM?7U-34
-M55175%545U=455555515U-;0T=;7U]155U=45%7555165E97U=;0T-#0T-'6
-MU]7555545U965U175-544U355=?6U];6T-/2T]/6U51745!65U=75%=45%15
-MU-?4U=74UM35U=34UM;455=75=76T]/6U5555%=75%74U]34U=?755905E35
-MU=355='05=77U=755-555%15U-;0T-;4U-34U=5555545U=75=?6T=;6U]54
-M5U155555U=355%965%555%35U=75U=555575U-?4U-;0T]+3T=;1U%36UU=7
-M45!05E975U545U=75=36T-'6UM;6U]75U=34U5555=37U%55U=75U57555=7
-M5U35U5575U1555175=74U];1T=;7UM'6T='1U]33T%1555=145-34%!65U=4
-MU=34U-34UM'1UM?7U5145-75U-35U=34U=37U=75U-?4U]?4U=545U914597
-M5=75U=75U-37UM;6U]35U=34UE=25%=65%145%75U=74U-34U-?7U]34U-34
-MU=75U=75U]?7U51455=75U75U5175-74U575U5175-74U]?1T=;6UM?4U-;1
-MU]545U=75U91U]965%175=555%155=75U=37U];6U];1UU545%155574UM'6
-MUM3455575U90459455155574U]?6UM?4U-77UM;4U-545U%15E35U]?7U]97
-M4-155-37UM'1UM;7U%545=74U=74U575U=75U5575E%15U15U-?6UM?4U-34
-MU-35U=55U5555%=45-74UM;7U]75U=37U-?7U-755%=65-'65]755%145=34
-MU]?45575U=37U-555%9645%04%;5U];6UM?7U-74UM#3T]#1U]1555=75%15
-M5575U-75U-555%915E155%74U]?7U-755E'55534U]?6U]?6U]35U-?6U]?4
-MU=545E%65%145%55U-'0T=;7U5555%965U=75575U=37U];7U-34U];6UM?7
-MU]35U=75551645%65E?1T]?1T=?455=65E=75=74U-555%155=74U=37UM;7
-MUM;4U=77U]?6U]?7U5145=555%=75U=45%7555145U15U-;6UM?6U]?7U-15
-M5%555597T='7UM;6U]35U=555%145=555554U=37UM35U5545%15U5555U97
-M5=75U-?6UM?4U-37U];6U]3555175U=75-36UM'6U]35U5545%97UM=65555
-MU=34U5145U=75%555=74U-34U]?6T='1T]+3T=;455175U1555175U=64%%6
-M5E=45=37UM'6U]?4U5155%=75%75U];6T=#1UM945=#7U=155=75U=74U517
-M45%65U=45%155=75U=75U-34U]?7U]?4U=555=75U=?45575U-?7U-755555
-M5=75U-?6U]155%965E975U14U=#65=34U-?7U]?4U575U=74U5575E%65%75
-MU]34U-37U]?7U-75U-34U=74U];1UM;7U5175U915E=45U=45574U-34UM;1
-MT='6U]155=554U'4U=7555175%55U=37U-35U=75U=75U-;7U=755%145%75
-MU-3555=65U145%15U-34U-37UM;6UM?4U-;7U]?7U%5555545%145%=645?6
-MU%?5U=74U]?7U-75U=37U575U-;6U]355%1555555%=5U575U-74U-34U-34
-MU-7555555575U-?7U]37U-35U=74U5555%1455545U=45%%7U]74T=;7T='1
-MT=;6UM'1U%545=545U975E%65U=75%35U-34U]36U]?6T='6U%565U=45555
-M5%145-75U=77T=#3T=?4U55455545%=5UE105=34U-3555155=77T=;7U%55
-M5%=75U75U=75U-;6U]34U]?5U=555%35U-74U5555%555=74U]?6U%545%54
-M5%145-37U]?4U-34U-175='7UM'7U5555%145U=75%355575U-34U%545U97
-M5575U=74U-37U]?7U]?7U];6T='0UM575U=75E975U=45%145%145-74U];1
-MT]'7UM/45U545U145575U-75U55555=75=?6UM;7U5175U1555545575U=36
-MUM'75575U];6UU164%%65U75U=755%=65%15U=?0T]S=TM+2T]#745!74%!1
-M45965E=4555555555%145=37T-/3T-'7U=75U=5555145%74UM'0UM34U557
-M5U904E)045945%15U-34UM/3T]/3T-;4U5555=?355945U=55%145%55U=37
-MU]34U=37U]?455145-74U-75U=55U=355%75U-?4U=555%755=74U]34U-55
-MU=37T='6U%175E94U5175514U597UM;7U]34U=?65=74U%7555145%=4U=74
-MU-75UM;1U]74U]34U5575E=75U=75U155=36UM/1UM;1T='75-37U-555U94
-M5U965U=75%%4UM15UM34UM;6U]?5U=37U-1555175E35U=755%355515U575
-MU-77T='6UM545-555=545U755%155%74U-75U=74U=74U]?7U]7555=7U-17
-MU=?4UM'7U]35U=545U=5U=74U5575E=5U=77U-34U]?7UM?55%14U515U=35
-MU-35U=74U-555%14U=75U=555=35U-555=35U=75U-35UM/7U-'6U5=04%%7
-M5%7555=75U=55=76UM?4U-34UM#2T-'6U]5555=45%=75U75U=5555575U97
-M55555%=45=77U];6T='6U]?7U-155-1545745=36U]37U-?4U=555%145%=7
-M5%145%755575U=?4U575U-;7U-74U]?7U-755%355575U-355%965%555=77
-MU]'6U];6UM;7U]355-;055355U%145!15%145%75U-555=34UM;6T-#1U]35
-MU-35U=36UM?7U-?455=15E904%!15E=45%35U];7UM'1T=;6U]?6T-'7U=75
-MU5755U!4U5965U=5U=?6UM?55=74U]3455904%=4U=?7U-?6U]37U-555555
-M5575U=37U];7U]35U-34U-155%=5U=75551455555%=4U=77U]71T5=45%97
-M5575U]?7U];1T='1UM35U=555%145U=75E965%15U=34U=35U-;7UM?7U]?4
-MU5145=75U-35U574U]37U5=75U145%145%15U-55T-+1T=;6T==55U915E96
-M5E145%55U-74U]34UM'6U];6T-'7U5145=555%175U=75%145=34U-37U]?5
-M55145-77UM;6UM;6T=;55%96U-945%545=5555555=36U]355%74U-?4U=35
-MU=77U]355%175E94U=37U]34U=34U=75U=55U=37UM;455145U77U]35U555
-M5=75U574U-=55M36U-;7U-155515U-5555145%15U575U-34U-74U-?7U-54
-M55555575U-34U575U-75U=155%15U=75U=5555545575U=?55=35U-;6T=+2
-M55555U=75E155%14555555175575U-?7U-74U-34U-?4U-37U-34U-755=75
-MU=7555175%5555145=74U]?4U=55U=75U-355575U=77U531T=?6U]34U554
-M5U15U=545%15U555U=37UM?4U555U-?6U]145E97U=37UM;6UM?555145=55
-M5%155575U=35U-?7U]?4U-55U5545%71T5=75%15U=75U-?4U-35U555U=35
-MU=75U=755=75U555U=15U=37UM;7U]'6UM145U=15E%15E=5U5555=74U-?7
-MU]?7UM;1UM34U-37UU=055565%155%15U=345=77UM?4U=555%=45U145%=7
-MU=?6UM?45%=45=37UM;7U]?7U-34U5555%965E=45=?6UM?5U-?7U]545%15
-M5517U-515=15U=37U]?6UM?7U-?1UM155U1555145%145%355555U=?1T=;6
-MU]555U%15E=75U=4U=34U=75UM#3W=+0T=;7U=545%155%175U134E755=75
-M55175575U=74U];6U]34U-?4U514U575U-37U]?7U575U=555U915E15U-75
-MU-75U=755%74U-555%14U=34U=34U=37U-555=;75]37U5545U=75-74U=54
-M5=75U=?6T=#0T=;45555U=555-755%965U=45%15U=75U=34U=34U-?6UM?6
-MUM?455555%1555175U=4551445'7U]?0T='1UM?4U5575%555-74U=77U]?7
-MU-545E965U75U=75U=55U=75U-34U-?6UM35U=555=75U=545U965U75U=74
-MU=555=555=70T=76UU55U5145%555%545%75U-74U]?7U-37U]?4U=37U]34
-M551555555%75U-?4U-155E=4U=555%=7U=74U]?6U]?4U5=75%74U]?7U%96
-MU-55U-34U]75U-;0T-#6U]355%965U9645%65E15U-355514U=37T=#1UM'6
-MU]355=7555175U15U=545U=45%15U=37UM?7T=#0T-?4UU115E94U=555516
-M45%15U34U-?4U-37U];6UM?7UM;7U]355%15U=7555175E9145=5U-?7U];1
-MT=;4U=37U%555514U=77U];4U=545=514=545%5645=4U=34U=37UM'1T]+3
-MT-'6U]545U%65U=75%145%75U=755575U575U5=65U=5U-;1T-#0T=?55555
-M5=7555145=74U-55U='45E555%175%55U-?7U]35U-34U-35U5575%555575
-MU5175U77T=#0T-;4U55555155%975%75U]1555155515U]?6UM?4U%755555
-M5=554%?6U5755=75U-35U=75U];1U]155%=45-755%55U=37UM;7U%175E=6
-M5U5455575-76T-#6U-555555U=?1U]75U=37U-545E945=74U=30U%37U-37
-MU-74U5175%15U-3455=75U1455545%74U-37UM'1UM;7U=755%175=75U=74
-MU=34U-?45575U];755=75E%15E1555545U=5U]70W]+3T]#1T=;455545E94
-M5U914%!15E=5U-?7U-74UM?6UM35U-5555145=74U-35U=555%=75-77U]34
-MU-3555=75%=65E?4UM'0UM37T]=4U%75U-35U575U=35U555U=75U-?7U-34
-MU=75U=74U-?7U-355=75U-37U5755%904%975U=4U=?6UM;1T='6UM?6T-/0
-MU]564%%65%1345565E75U];6U-74U-74U]?4U-5555555=755%?5U-34U-15
-M55555555U=?755905U35U-?5U=;2TM%55E!6U=35U=75U-145E94U=35U-%5
-M5-;1UU565E71T]'4U55555545=77UM'45U!15]34U5934%95U-34U-?6T-;7
-MU-37U]355%15U-555%=75=?1T-'7U-?7U5165-?0T==475!45U555U=5U-?6
-MU%555-75U=?7U];6UM145U34T=#7U=74U-155U=75U155%94U-?6U%555=31
-MT-'455=75E%15E34UM;45%=4U=?7U=?2T=;0UU555575U]555%=75%=65E94
-MU=34U-74U];6UM?5U=74U5175U15U5575U74U]'1T='6UM#1U]35U-355E!2
-M4E%5U51745%4U=74U5;4T-#1UM37T-#1UM35U];1UU564%-145965]77U]34
-MU-36T]/75%%65%74U]35U];755%34U%4U=?7U]?6UM;7U=77UM'755=75%15
-M5U!4T]#0T]155U=555145-37UM1445%75=345515U-355%=4U]/=W-/6U]34
-MU]355%1455164%!7U=355U94U]'0UM545%7455=4U=?1T=155557UM%74%!7
-MU];5U=74UM#1U%545U555=55U=?7U5145=37T='45%=4U=?55555U=?455=7
-M5%555U975-36UM5645?5UM;1UM?1T-#1U%57U-/7U55145945%=645=55516
-M5E76T='1U-75U-;6U]555=7555165-37UM555=36T=;4U=74U%1645%6U-'3
-MT-?55%545U%05M76UM545-755M775%77UM;7U-37T=#0UM155%555%965E=5
-MU%575%75U-755574T='6U5555575U5175%7555175=?0TM/1U]37UM=55E97
-MU=145E%04=?3U574U-'0UM575E?5U]145E?5U]155%75U]'1UM;7U]?55U97
-M5=37U%545U35U-545U77UM1445%7U-;1U-74UM#6U515U]'3UM555-71U5%7
-M5U!7U=34U535U];7U%1455555%%04514U-75U-;1UM?4U574T=/655=75%17
-M45!7U-'0T=35U-;1UM355%74U-564597U=555%965U37T577T='1UE575-37
-MU-545U37T=;7U-77U]?55535UM#6U5=75U55559045=45%=65E37T-/6U-34
-MUM'1UM?4U]?45E-05M77U]34U]#3T5125U57U-155U915E=65E95U]/=T];4
-MU-34U-545-77U]34U-5555545U9455545E95U-'3T=145=37U%145U=5U=75
-MU=36T]#7U574UM=5551245175U915]71UM?4U];0W=+3T=;7U]355U975%17
-M5E%65-7555545-75U5545%77T='6U-34U-355%35T=+2T];555545E%34U%4
-MU-5075?7U]'6U];1T]#1U%145%=45%=65%75U5145%74U-75U-?6T-'7U=?1
-MT-'755=65U555%=65]36UM155=37T=;55%15U556459455555-?0U]'1U]15
-MU=31UM75U-34U=555U34U]155E94U-?45514U=?755=65]76UU575U34UM35
-MU=36T=955U%7U]?6U%54U=34U5575U74U]345E'7UU165E76W-_2U]75U=55
-M5U=15%5555175]74U%545-74U-5745?4T=/0UU555=545U=4U]+<TM'7U];1
-MUM545E955%=04E)05E155U;6T-36UM?1T-+=T=545%145U915]?0TM'75%14
-MU=75U575UM;55E!04%%65U=45-36UM?4U]'3TM+1U=74U=545%17U=355U%6
-M5U?5U=37UM?5UU105E95U-35U=77UM;7U%75U-?4U5545=37U%575U77U%57
-M5%35U]34U-75U-35U5545-74U%145=36U]545=?0TM/7U-37UM;55%!0U-97
-M5U915U5555145=36T=155%74U]?55%35U-755515U='1UM;5U=755%=75=;0
-MT]'45%155%555%15U=545U=65%555U=4U=?6T=?7T=+0T=+45E=55%=65E%4
-MU-545U94U=?7U%15U]'0T=?4U-;1T==44595U5164%!4U-?45575U];7U%55
-MU=;6U%165]31T]#6U-36UM=45E%15-#65E975E145U97U-#2T-=45U34U]15
-M5%15U5=14U!6U-'0T=?1TMS<T]35UM#3T-145E975%934E-65=155E=4U=57
-M5E97U]#0UM74U];65U;4U=30T=?4U=75UM#1U]?7U]=445-05]77U%545U15
-M55145%74U%555%75U];6U%555=545E95UM/=TM'7U-?0UM545%77UU1375)1
-M5E71U%?7T=?7U]55U-?1T=?55=7555=15E?5UM'45515U];7U-75U]?55%%6
-M5=?7U-?4U=345%915]77T-/0T='0T-%545-05E545E!34574U%=7UM'0T]95
-M5%15U=37U-37U];6U514U-;1U]15U=3555=75U35U-545U=75U=75E=5UM#1
-MU]34UM'1UU565U35U=545%77UM155%15U575T=14UM?55%975=?755175-?1
-MUM?4U=755%9145?5U]?55U15U];6U]75U];0UM?5U=37UU565E945%155-76
-MT-#755=7U=34U-55U-?455==75145=14U=;0TM#45574UM'6U5=65-75U575
-MU=?6UU5645=4U=174534U]545U35T=/2UM?6T-#7U5175-37559145?5U-55
-M5-76T=945-;4U='6U%55U-?7U5=65E74U%545=75U5=14%95U]?45=75U-35
-MU575UM'1U]75U];7U%175%75U51145?5T-/1U]34U-145U%75=37U5574E'4
-M5=74U=?1T-'4U=74U]?455145%555%=4U=?1UM35U=?6U%545575U55645%4
-MU=35U575U-?7U=75U-;1UU545=37UM145U35U-555E;7U%355515U=145U96
-M5-37UM?4U]'0T=?55=?1T='7559145%15E=75-37U555U=?7U]?7U-'0UM=5
-M5%76UM=445-15U545%74T=#3UM37U%95UE915U37UM;6U]?7U-355%=45=35
-M5U%75=755%975-37UM?4U]?6T='7U]?6UM?55%915-555%=5U=37U5=65-?6
-MUM545E975U=75U36W]/7U]75UM#0UM?6UM;7U5175]77U]575E=455555574
-MUM=45E975=755514U=?7U5=65]76UM;7UM'0T]'45535UM=55U14U=?6U]75
-MU]945=515M77UM;45%=65E%04%=5U]?4U575U-?6U%55U=;3T=565M71T-;7
-MU=?0T=;55=36T='755=65U=64UU24U9455175U77UM;7U]37T-+55-?6T]/1
-MU]34U]?7U%545=74U5=645=55%934U95U-?55=74UM;45=74T='655=15E=4
-MU-?4U-?6UM155=?1T]+6U575U-?55%15U=;44U)14U35U5555=77UU514U!7
-MU=;7U=77T=+3UM35U];1UM?4U=755%915E?5UM=55%75U-75U=74UM;55%%0
-M45155555U=?6U]34U]?7UM#2U-77U-545E975-37U5175=;7U575U-;1U%16
-M5E=75%155%35U]?55E%6U=;1T='1T='1U%555=77U-545%15U-545U34U]34
-M5%965U74U%%7U-74U%545%35U]?5U=37UM;55U15U]'655=75=37U-35U=34
-MU5175U34U]145U35U=5645=5U]#0T=?7UM;45%=65-7455=65%75U537T-37
-MT==55U94U=37U-74UM#0U%=65-77U%1645%65U145%77T=;555145=36T=;7
-MT=/3T=75U-'1UM54555555%24E)15=755555U]'6UM51U-'7U]74UM'0T]'4
-MU=36U]5745975=75U555555745!65-?1U]75U-?6UM?4U=?0T-955E!04596
-M5%=75%555U=5U-'2W=#6T=#2W=#4UM#5U=504EU24%)24515U-;6U5145-37
-MUM?7T=/2T];55%74UM;7U575U-145E%65-755U%04%975555U-'3T]#1U];1
-MUM?45515U-?4U=544=?65U%15E35U5175E34UM;4U=37UM;45514U-?7U=75
-MU]?6U%545575U5575U34U-55U=74U]145E=5U]'755=4U=?4U%75U=?7U-57
-M4=7155745%75U];55555U]#3UM35U5575E965-?1UM155%75U-555%55U554
-M5U=5U];7U555U-'0T=55U=?1UM?7U=75U5575E%65U175E=55%;4UU75T=W>
-MW=/6U-34U5175E=45%175E975=755%15U-;6U%145=;1UM?55%145%755=31
-MT]#6U-74U-?45%965U545E!04535U=75U-33TU=75=71T]'55U35U-?55514
-MU-?7U]37UM'0T]'45U175U!24E!6U=?55U=45=37UM;6T-#1U%175U74U555
-MU=37U%175-36T]+3U]34U%=245905-34U5=645=55575U-;2TM'45=76T='6
-MU575U=1555=75-34U5555=74U5145U74UM=44597U=37U575U];1UM?4U];6
-MUM=55515UM105E14551645%65-755555U]#0T=35U]'0U]555-77U-545%74
-MU]145U77T=;45U%15E75U5545-74U5175-77T=?5U=36UM355=74U]954=75
-M5=?7U-75U]'1U5=6459455165E=555545%35UM'0T-#0T-+3U]575U=65E!2
-M4U!75-755577UM#1U-74UM#0T=35U-;755904%?5U-'65E34U5545U34U]?5
-M5%915]74U-35U-?7U-75U-;3T]?55=74U]545U34T=;455=65%145%75U];6
-MU5=65]77T==5557555=14%%5UM#15%;6T=;6U]?7UM#3T=175E=5U-5745=5
-MU55645%5U-?45U%65E155%75U]#3T=35U-'3T=;6U];0T=1445%4U=355U96
-M5%555U975%77U-71T-37U5965E?5U-;7U-34U]?4U=37T=/0UM?5555555=1
-M45=75U914%;5T=#1U]74U]?55U=75=37U]74U-3455164534U]34U]?0T]/0
-MT5=6U%5645%4U=;1T=55U=3555=15E77UM575%55U=55U575U=34U575UM#0
-MT-;7U];1UM574%!145975%75U]35U-?7UM#1U%564%945U!=5=35UM?55=76
-MUM?6U]37UM'6U-74UM'1U5175%545%=14534U]?4U=77UM155U95U]=55U%7
-M5=74U%575=37U]145-37T='4U=77T='6UM%55='45E=75-37UM575E=45%90
-M4%%755565E?5UM#6UM'3W=_=UM75U-?7U5=75E1555165U=45%145U94U];7
-MU575U-;1UU75U-=55E%05]/2UM;45=77UM?55574UM955E%6U=?7U5=75=37
-MU%575-30T-#7U555U5545E!05%545E=5U-;6U]35U-'0T=?4U=34U5555=74
-MU-5745945%375%34U];6U-55U-;1UM575U155E-24E'5T=;4U=37T='6UM37
-MUM'0T=?5U=75U5175U=75U965U34U-145E%65U55U575UM'1UM155-?<T]?7
-MU];1UM564%94U=5445!15=755515U]'1UM?7U];6U]?5551555914595U];7
-MU=74U-155U975=?6UU55555555=45=30TM#4U=37T557U%15U]?55%=65U14
-M5%15U=36UM35U-?6T-/7U=74U]155%=65U175E965-74U-34U-;0T]'7U=37
-MU]?55E=5555745%75=3455=45577T]=75=36T=155U?5U]?4U=77T=#1UU57
-M5-74U5=15U=45E%045?5U]?55=36T-#0T=;0T]#45%=15E1555=7U=?75591
-M5U34T=;55=37U]=45-15U=35U=55U=34U-74U]155535U]?4551555555515
-M555555755=75U-?4U=75U5555U975-34U];7UM#3T-'6U%545%545%=75%16
-M5]1745555=75U-35U-?7U-?7UM'1UU175%555=36UM;6U]?455555%=75E=4
-M5U97U=555=37U]=5U=34UM=55=34U=77UM;7U=74UM?4U5555E;45535U];6
-MU%54U55455175%555%75U5145=77UM;7U-74U-'1U]74U]?4U]35U-75U515
-M5%915M74U5114%;5T=#7U-35U]'7U5=15M72UE155%74U-5445;4T=/05515
-MU-/<T]164%?4UM;55U=5U]?55534U]3555=14%95U%564%?4UM?55%15U=35
-MU-?4U-?7UM;7U]'3TM;6UU94UM37UM;1U-745%%15E9645!34%%645!34%%4
-MU-'2TM/2W=W3T]/0UM35U=?4U=55U=555U=555575E975%555555U5545U96
-M5U=75-71W-;5UM'6U]?5U=?4U575U=37U]?4U=75U=?7UM;7U]'0T='4U-?5
-M5%9645%14%%65U=745%75%74U=75U=74UM;1UM355575U-#2T]#0TM/5U-94
-MU-;6UM?555=75U=65U15551745!04%-15U155515U=36U]?7UM'6T=;1T='1
-MT]+=T]'7U=74U%545U145%1645914%!14%!34%!1U=%5U=;6T='4U%74U]'1
-MU%545-74UM'6UM;3T]/3T]#6U]?55%=45U=75E904U-04%-24U-05E35U-34
-MU]'3T]#1T='6U];1T]#1UM;1T-#745=55E965U75U]?5U5545%=65U555U97
-M5-34U-545%545%=75U=55574UM#3TM#0T-/2TM+0UM?45%=65U175U=5U=74
-MU-155U9145975]775E%75E%65E=5U=37UM?1T-/2TM/3T=;6UM37U]?4U-55
-M551455=75%145%=75%545%=65U904%94U=71T-#1U]?7U-75U=?1T-'6U]?7
-MU5;5UU75U-34U5165E=455575E145%175%35U];7U]?6UM;755755%=64597
-M5=55U=37UM'0T-#0T-#7U-545%15U-?7U5575U175%35U-31T%165%155U=4
-M5U914%975-74U-?6T='1T=#0T]/3T-;4U5175U145U=65E=4U=555=37T=;7
-MU55555145%14U=345535U57555145U=4U%56U=?4T='1T-/2W=/0T=;7U%57
-M4%)34%94U=555U=45=55U=37U]555%1555555575U-;7UM?5U=75U]?7U-?4
-MU]?7U];4U=555%175%165=1145555%=45=74UM#0UM?4U-7455175U965E=7
-M5-36U]'3T]#1UM;6U]34U-3455145%74U-35U%545E975U975U=455145554
-M5=35U-;55M?3UM#0T-#6U]35U-;6T=#455164%%65U%75514U-55U]54U-17
-MU=?5U]?555575%55U=37UM37UM'6U5=645=55%35U-?4U%74UM'0U]#=U]75
-MU5975%175%175E965E1555545%=45=37UM;6UM;7UM'1UM?7U];455965U=4
-M5%75U-?45=545-77U-?1UM755U-34%!15E?5UM;1UU37UU74U%155%75U=75
-MU-;6T=#1T-#1T='6U]?455=645%65E%045=75%175U35U-?7U-75U=755=74
-MU=37U=545-31T-#0T]W=T]#655?5UU9455=645!24E%75U=555145%74UM?7
-MUM#1T-'7U]35U=35U]?7U-34U]34U-35U555U5145%175E=65]74U]34U];6
-MU]?455145E915U!25-74T=#0T]#1U]?45575U=75U=74U]34U-34U=34U-?5
-M551645=55%145U=555145%7555545%74U];1T='0T=?7U]?6U]?7U-555U=7
-MU-=65%545%=65U?5555555=65U35U-37UM;7U-34U]34U=74U]?7U]?7U-55
-M5%=45%15U-37T='1UM;7U=7555145U964%!34U!15E15U-;55=#0UM#0T-#0
-MT=;5U=75U=545U=75E155=74U-?6T=?7UM?5551645965E=75E=75U14U=37
-MUM'0T-/1UM;7U]35U-755%=75-77U-155=;65]755E=75E915E975%145-37
-MU-?4U-;1T='1T=;6U]?7U5555=5555=645975=75U-36UM;6U514U=74U]35
-M55555%=75U=555175=36U531UM?6UU555%15U=34U-37U]?7UM?6UM?45517
-M5%5555175E=645975%74U];1T-/1UM?4U=34U-555%=65E14U=35U5165U=4
-M5=75U=33T]?1T=;6U]75U=35U5545%145%74U-7555545%155%145=37T=#0
-MT=;1UM?4U=555%145U155%555%=645975=37UM;6U]34U-74U]?7UE115%91
-M5U=5U]#3T=;7U]34U-155%=75E965%14U-34U-35U=34U=75U];6U]?4U%55
-M55145%175E975=37UM;4U=755%=65E35U-37U]75T-%5U]?7T=;7U]75U-35
-M551645!3459755545%15U=34U=37T=#3T-#3T-'6UM'1U]155%145E!15E=6
-M45975-3455175E=75-31T]/0T=955-#1U];6U-?4U5145%545U=75U=45%75
-MU]?7U-?4U]?4U575U5555514U=37U]35U=755%904%%75=37T-#1UM;1T-+2
-MT]#1UU5745!24E=14E945U=75=74U]?7UM;4U-34U-?7U];6T='7U5=65E=7
-M5U35U514U5555=74U-34U=34U-37U]?7U-355%145%15551555145%145%75
-M5U?45%15U=?6T-#1UM;7U-34U=74U]155%=75%55U=37U]?7U5545U=645%1
-M5U74U]?7U-?7U]?6U];6U]?7U];7U=74U-34U]3555145E?6U%3455914%%6
-M5U145%145535UM;1T-#0T-'6UM'1T='7U5175%545U=75U175%1555555555
-M551555545=74UM?4U-37U-75U=36T='0T555UM575%=755555=555=74U]?7
-MU-75U5114U!15-75U=75U=35U=75U-?6UM;7U]35U575U5175555U=55U=37
-MU]35U]155U=645975%95T==5U]?7UM;1T=;7U575U-?7U-545U915E965-75
-MU=755=75U];6UM;7U]?7U575U5145%75U=545E975=36U]34U-155515U=34
-MU=75U-175-=55=74UM#0T-'7U555U5145U%04%%6U=?7U-37UM?7U-35U=54
-M5575U-?7U-34U-5555145U145%77U];1T=?4U5165E145=74U-155='55]75
-MU=55U=34U-?6U]555555U=755-555-75U575U575U-?7U-545U145%35U=75
-MU-?5U=34U-?7U]74U-37UM?6UM?7U]3555145=554U!55U914%!145=5U-?1
-MT]/1T='0T-#0T='755145-75U]?4U5=645%04%%15E975%77U]?7U]?7U575
-MU=36T-#0T='6U-5455145E%65E71U534U555U-;7U]3555545U15U-355=55
-M5%15U=75U]?7UM?4U-34U555U=?6T='7U-545%=4557555164%!15E35U=36
-MUM;1UM;1U]?6UE=5T=?6UM?7U-75U55455175E%145!04594U=74U-?1T-;1
-MT=#0T-#0UM155U97551455174%-045=4U=37T=#6U-755=545-74UM;7UM37
-MT51655175%965E=5U-34UM?4U-?7U];755=75%74UM'7U-3455555=74U]?6
-MU]34U-755%=145%04%!15]77T-#1T=;6UM'75=74U]?7UM115]575U55U=37
-MU]545%75U-555%=45%75U-;6U]35U=77U];755145U145U965U15U-;1T-#0
-MT-#6U%55U-?4U55555175U%145!34%97UMW1UM/0T=;7U%575E975=755=75
-M5%74U]'0T]#0T];55U975=3555145U!04%!15E145555U=?1T-#0T=;6T='6
-MUM;7U=555E%65U145=1545345%755=74U-34U=35U=34U];4U=75U-37U-75
-MU-545U975%75U=74U=555=75U=74U]?7U-31T='6U]345575U-?7U%5645%6
-M5U1745?55E?55575U-;1T-/3T]#6U-755=7555=645%36E7>W-]4T=75U%37
-MU=155%75U]=555=75U35U=75U=75U=?7U5545E=5U574UM'0T-'6U%?6T];1
-MU-555%175U=45%175U965E%145%5U-?7T=;6UM'1U]34U-?7U]5455175U35
-MU-37U-5555145%545-34U-37UM?4U-?7U5545U97U%=4U57555=4U=34U]?4
-M5515U=?0T]/0UM;7UM;4U=555U145U=45U%145945%1555555=37T=;6T=;4
-MU-545U75U-?4U-34UM155=34U5135-14U];7UM?7U]1555915E%65E=4U=35
-MU];7U-34U=35U=755575U]36UM;4U574U%545%=75%=4U=?7U]35U=75U]?4
-MU5114%%65-54U-'5U-;4U-37U]34U]?7U]37U]555517U=37U-34U-345514
-M5%975U55U55455555575U-37UM;6T='7U];7U-155=75U5175U175U155=14
-M5M755-74U];6T=;6U]74U5545%175E94U=?4U5555=36UM?6T=;6U%555%91
-M45975%75U];1T='1U]755%=65E=5U-?455=5U-?6UM?55-;15=31U]545557
-M5E=75U155%74U]?7U]?7U-5555=45%Q>U]931UC;W]O:SLG`PMS;U%='349'
-M6DY84U344]75TU34T%7=W-C2T]+=T-?55E)45%%<5-335=/4U]-55%76U=34
-M5%?65M56U%?74556U5?5UM)5UMU15=347E33T5U1T556U-/55=+45M3>U%'3
-MWU-2T534U-574M?45571TU;5T='45-355U574U=75%!15%544]575U?4U=;1
-MT-S?TM+?W]'1TM?74==65%;545%145935E#44%91U]=2UM?05-36U]!4T-36
-MUM;65-!25];1UM?0U=;7U%)3U%507E;1U%17W]-54%;0U-90U-W1U%W6UU53
-MU-!74U_04%5:W=Q45%;8U=)3U=;64E_4U-)5T=S?T%71T]1$<5'$U5G<]L/0
-MT<7$U%M>U55$0U_4U5]=UM_15E32W%9<5-%57U#0T-16UM/=UU#7T]964573
-MU%'5T]+6U]?55%=05-174-745U;4T='4T='4U-175U545]?75E=5UE=1U-'7
-M5=34U=565=#1U%76T-94U-'55E;5U-114-1545-05=15U=31UE34T-!55-?7
-M5U36T=;7U-;75=5745%65%=45-775]155U55U-74T-#6U-;1UM5455545]77
-M5=37UU74T=35U-545U9455=45534U-155E175E75U-?6U]#7U]=45%=6U=74
-MU]34UM;1U]70U%?455555E955U965]74U-34UM#75=74U51755175%94UU55
-M55155%77U];6U];1T=?7U]355=155%94U%75U=555%=75%=645!45594U='<
-MTM?1UM34U=555=77UM?55=74U=75U5545-34U]15U5555%555%15U=35U=55
-MU%555%=45%74U]?4U-34U]?4U-?45%965U75U-?7U]74UU=05%155577UM'7
-MU=77UU565U=745=5U-74U-?4U=77T=;7U];6U57555165E=45=75U-555%?5
-MU555U-?7U-?7U]355=545U!15%15U=77TM/4U-54555555=75-75U-?6T=;6
-MU]155%75U55455545U=45=74U-34U%17U=37U]34U-34U-55U=75U-?4U554
-M55545U1555545U=75=175]?5U=?4U-37T='6UM?7U-?6UM;7U-34U%165E96
-M5U=455545U975%74UM;7U]?7U-37UM?55%=75U=75=37U-37U]?7UM#7U]55
-MU5145-#3U-;45U=14%%7U=36UM;6U-155%145=74U5545=7555145575U-75
-MU-?6T-#1UM?4U%555=75U-34U5114%!75=74U5555555U-37UM;65%;45534
-MU]?7U]?4U=75U=545E%75%555=75U=75U=35U=?1T-'6T=?7U-155%=14596
-M45%65U15U=36UM'6UM;6T=;7U%545%1555555%71UU34U%555%75U=755554
-M5%145U155=74U];7UM'1UM'1UM3555=14%!145=45%155%55U=?7T='7T=/3
-MTM;7U]375U!04U9145%15=74U%94UM74T='1T=;7U-355%=45=74U%575E=4
-M5%55U=34U];1UM?7U=545U=4U=34U]?7U]?7U]15555745!04%%65U145575
-MU-'0T-/3T-'0W-/5U]34U5165E945%175U35U-75U=34U]?555555%155515
-MU-37U]?7U-?7U5545575U575U-?4U51755755=74U575U=75U5555=36UM=6
-M5M35U-15U=545%35U=74U-55U554U=?6T-#1T=?4U575U5555U965U=75%55
-M5=77U]35U-7555555=155U34U]34U]36UM?45575U554U]+45U555=75U=35
-MU=555%15U=34U%555%175-77U-555574U]34U-?7U-?6UM?55-155U11U515
-M5%-75E555=;7UM?4U]34U-37U]?7U]?45E345=34U=355%=45U975U=45%14
-M5%35U=37U]?0T-#0T-'1UM;4U-75U51555145E965E=145=45%15U=37U-34
-MU]?6UM;4U-34U=555=70U%77U%545=355U=75%965%36T=?55]55U=37T-34
-M5=555=555%145=74U];1UM34U5555%14U=37U]355=7455145=34U%55U-34
-MU-36UU94UM34U5145%545E!15=;1UU14U=?4U-35U]=45E'5T=;4U-355%17
-MU=?4U537T];4U=36U5=65]34U=34U%=15U355514U-/155%35M?3TE55T]#5
-M5U76UE17U]W=UE%25M155U!7UM504U?6UM565M'<W=165U77U]74U-?7U%54
-M5575U-?45=?0T]/45%975%%27UQ1U]/05536W--27%=155=7T=W8W5=14536
-MW]_55U=45U/5UM'?U%?5U5535M144UY?4-S%T%U=UMK`VU925U145%U<U-W=
-MUE!645?545)1T]S1UU%3UMS8Q=]165U65-+9UE!>7%)3T=_2WMG67T50TL#>
-M74)`4-7<W-#>T]755-5?6%Q7VMK704?1Q,#065M<T=+6T5;5W]_:V=_665_4
-MW-1#2D;?P-M13UG0U-?=VM]76UE6T\''T59345E'U-S$VE-!0U/,PM[65517
-M5E965=W3U=?24UI:4-[>5U=44%%0U535TM#>V]%=15Y0T\;?4EU05-[=T=W>
-MTT9&75;8W=W0U-!'6%94Q5=07UW>4M/<U\[!WU!&7EO3P-G<U5!=7-;3T]=?
-M7%;46'5)4<##WU14W=_=5E;55]96U=O?T5)5T=_20T+3S<926T=3]??63$]>
-MU=901%7.]]Y&3414Q%=:0=;TQ-=%6,?;P]5T=5G$V-[$W-]73$-7V][<UE5=
-M1%A4Q,39Q%=%35O>V<U205#1R]C14EO<4%Y<6]7>V]5"6]39PU9&0M7V]=A6
-M4]!6UE5%T]S75%]665?<4E)255=7T=?>P-A83T7;]/791T!65===15S=S\!5
-M649:4]C.P=Q?=79)TO3WPEU"6]#%S-O46W1,6E+5T<#1U-G`R-M?=W9<Q</$
-MT5E<T,'94$1/7]#445'?W]3=QMI6UE1$6%/2U]+$45S?VM9&3$5?VMO64EK1
-MW,3=4-'4T=75UUA?U-35U]O'WL1565/1WE->6UK6V<=22W9W6M#/V%Y.0\?Q
-M_O?37433Q\GTWEYP2]/U_<9?2$!65E9-=DM6Q<3+S%)!0%-<75-*2T%34UI2
-M5<OR]]E"2479RO3TR<S)RLS15%?0P?3WQ-Y114Q6]O'!<VQI8'5'17-F869R
-M0M+&W=1<5=C.]O7T\>7A^O536\WF[^;EZ9R$FNIF&`4<;4A&9A06%&)E=DAU
-M='1T>VQK;4'@EI;@57]RP.#IXO[WPLS<VN^$M;&+[P8U-0=<E>UB'P89>O?M
-M5V$3%G91VF=O>^6>GY1(%A%LR^/JX\G;Q.7BX_K51-V1B;>+Z!H/#A+8[%$3
-M&P86V^J44V`?$V)X2&Q@>_64E>)$>G'?[>GN^,#_Z9V>D^S47\+_Y=I+;&EE
-M0\-2?A43%V#3UV46$FA#Y?E7>'W;Y>S@Y?#]Y^WI[.?+T]_SX^GHYL-.?WYF
-M;&H5:6!Z96%C8V1S0D!W?F5PW.3O[.'\^.^?@(Z/A=H>``823_SU<6H4:73^
-MZ^]W$@<''VY?VL/'P\;%RL#/R,OV^.B>C;2W@OX;#`(<=L5U:!$4=OOCX.#^
-M9QH-#P`6_Y*<ZMYL%7G]Z^GX5,N<B;:W@4@'`QAX]%D4&1YN_)?H]4!T<VD9
-M``(:<Y:;DL\7'6_YEI?DW.2;B+>(D1``!A3R[]06&!)S[Y'@<6EH9F04&@88
-M<I>;DL06'&CWDYF=ZI69@(V$\1(''F?S_W<7$F_$Z>O*8!$3$!86%A1GQ.#M
-M^5QE?][OG9B:A82$G.5@$Q)N6L]5>FAH>M?WR%=G%A\9'1=@=EW']_SVQM71
-MYY"$@(.'D\AB%Q5XT,E3>V)@<5??7TM[;Q$?&!\4>]'(S\':P,OX[I">A8>$
-MG^UU%19M0\[U7F5C>DA:0W9[9F\6'1P0;$[.]\!214S'[I^$AX>%DNS6815I
-M>D;66WQE?4]-=GAD8&-K$!P3:4CRY/_'7T-1YY&8A(2$GI?W9A<78T#!VDID
-M97%.=WMA8V-K$!P3:4OT_OSWP];7^Y>9A82$F9;\>Q448T_2U7!D>W5`<6=C
-M8&-I$!X>%WS*Y?GQS\S.Y92?FH6%A9SL1&L6:GS7W$QE>DI!<6%N;V!B%QP>
-M$&!5\?'Q\?[]\N>4GX6'AX61\&<7%VUV149P<$]+>6)N8WYR;!,9'!5VQ,W`
-M]_CG_,CRZY^$@8:$D?1@$1`594Y91UI50V5N:FQX=F`6'A\4?=C(\/[DYO/;
-MP^*2A8:&AIGB?Q$?$V]S0$-!T]9];!5K9TQ]:Q(=%V12W<3SX>SZT$+)Z9R$
-MAH&!FN%O&1H2;7!*=5?USGT5$11D075O$1`5>EK5W/COZ^%4>4+DEYR%@8V-
-MGD,9!QH68F9[4^7DT&@3%&=9U7L1$A5G=$15]^SKYU5R=,/LE>N5FXR(@/X0
-M&AP6%AT62.+NVF(7;W=T9V-M:FIH;GG+XNSBY<O;U$%<]N.5EI"$CH^3?Q`<
-M'!P8'F/X[/=*>GAP?6-E17P4'19Z]>?R\N#B\T)F>]SZY.3BE(6*M(99%AT>
-M!08&%N>7^DER6EYR9G%?9143$6-9V_'BZN#79FU(V,_/_^R7D9V,MX_E:A,9
-M!P`#'O.0[--3Q])E%&E8Q603$FES0ESYE93X?&UPWE9+U>&7ENB4@K&(_6II
-M%@<,#!GZD/Q!\>#<:1-JQ?-Z$Q)I9V%R^)"1Y%AE9V%G=_/JEY64EY"#MH[#
-M87P0`@X#'\;OVL#I[603%&!#6'!*<!43:D3SXNSCX?1F%&'2\_SGZ)&1[/J6
-MC[>:8W+>$@\/&FY4=F'YD?\7%G%/9&E[_/YP;W_#W4U=X)7Y>6125'MEQNN7
-MXOGB[/7<F;2,77;HU08/!AQI;11,Z^QG;L;?8&EP]LE>3_3O\65\__]S9DSU
-MQG-XV>'ESO+AY\Q4UME6?%B$MXU9X9I=#`\9&P4?:O"4XW?/E]X7:D%U:FEW
-M^N//R)6=XGET]UQH:$W<1T3P[^WPQ__GTWAUTE)*7\?9XX*UDD:3EQX)!!(!
-M!Q!Y\>'YS)7N9&E)UVD7?M+,VO[JEI;K[.39=&9O;F9"W/'[Y.3_S%=26'5*
-M1UI%7U70WL#=6D;5D(R<?Y>99@`2>0<&%GQD9<G+X.U15O[Y9&#.TG]#^^?W
-M^>3FY?3\^,5P<U!,?G;2R\?$VMA3=$/1T456Q--145]-6M'74M?<07/.E)"7
-MXI3H3&)L;!T?:FEH;$K3T/;SY>?]PMC/6'!7S,3?_>?\\?'QSL?<15I&<GYW
-M0'1)5--76%/5WMC7T<3$U]W03UC`T$7"_L35Q=5T=?V3G^+BG.YL%W@6!QL4
-M%!!@4]#*\__FX?W;]O=#2,7TW<'EY/__Y.3PT]7&1V=Z1G5E3L543EW>7D]?
-MW\31TLS)U4!4WU!%V/'-TM[84TYV?W;RD9?[ZI#]9'YS$!\7%18494G4]?7Y
-MX.'X_OO`U,'(TM3)R]C9P\%47=?:UEA65DUP=$YW=$115M#`Q\'`S,_`P-W4
-MT=#05-+9V=;4V]!:2DAT?GAU]^OM_Y26RW'31Q$1;FH6:GM]6MKVYN/@Y^+F
-MPMS`W$M/559<5\#/P=K'R<744EQ;2G%W2G-R15!;7,7,Q,#(R,;:QL+:UMG8
-MU5+6WM;7T]U41T-#=WA\7LSEX^?LZ?U6559B:&!L%6ID>F%?\\;A[_7M\?C9
-M\/=!_%E9371-T778\\+`S,76WM-#T'1^=')]==77PO?`PL;&QMS;P-Y0U5=;
-M65=4T]C5T-C67%]26D)(275T4O3E_O[CY\K=QE]D965A;69\?$I<VLKV\_S[
-M\_3UP-S5445"1D-%7U?3V\#`S,S%W=!10$]-3$E`4-+;P<KTR<W`V59>65A$
-M0%Y=4E36U]34U-=44%!45EE355-:6%]>5MS.\/?S_O+#T-)%<7!V<WYT0$%%
-M4-W?V-G?V--45]+35=/;VMG&P]S0TM==7%);6%-24M32T=W$Q=[:VM!45-13
-M75915M344E#0U5Y=T]!15-_85%)1441/3$%97U#6W-G<V<7'QL?/S,#$Q=M5
-M7%U<14):7EE<5E1=7%U>6D5:15A=4E;7W]G>V=S8V=O"P,3$QL?:VMO>T557
-M75A>75U?75-27UU375)65%905]574%!04%945536TM#3W]_2T=;45535U=36
-MUM'0T]'4U5=75U1555755534UE=4U%165U=75%75U-75U]145U=75%75U-34
-MU]'6U%575U?4T-#1T-+=T]'7U-155-77U]35U=3555=75U9645-=7U)145%7
-M5=77T='1T]/4UM/0T=?4UM?4U]'0UM;7U%114U-15%545=3555155%15U555
-MU554U-;7U-;1T]#655!?65E>7%!4U-'3TMW?W][?TM#6U515U-34U-54UM!7
-M45=65U=645%15U%34%%65=34U];1UM;1T='6U]34U-;755?5U]75U-?4U=55
-M5%75U575U-355%165U55U=75U-;1UM?7U5%34%!15U574=?1T=/1T=#6U]15
-M5%15U5545%=75%74T=/0U]34U5574U)05U545U35U]'6U]?7U]#0UE515E97
-M5%14U=74U-74U-34U-145U=4U5555=;=UM3555545=?755155%76T=34U]?4
-M559275U34535U=70T-#0T=?4UM/3T=;7U5145U9145!15U755575U=755596
-M5-77T]/1U-;1UM#25%U755;5U];45=555%555-77U]155514U=;7UM'75%75
-MU-155%9755145%=5U-?6T='1UM155U1455165E15U=/045?7U515U5155-71
-MT=;1UU?5T='65%94U=345%%65E35U-15U555T-_=T]'5U=37U5175E975%14
-M5U%05U15U-55U-'1T-#1U%55U];7U5935M?3T-575M74U]?4UU17UM565U75
-MU515U]5455965%=04%74U]#2UM?0TM#0U]35U-;45%=55U5545955U;55%34
-MUU175=?3T-175]31T=;7U5=45%1445%65%=5T]-5U=;6T-'6U]75UM?45514
-M5-74U]75U=5455555U%65%14U-35U=34UM?7U%=65U75U];4U-'1T]S=T-=5
-M5E%34E-65]77U-555=;0T=9675=45E155=?0T-;6U5145%545=755U155555
-M5U?4T-/=T]34UM#3T];55%155E%045!65-37U5905E?5U]155-76T-#65574
-MUM?7U5575=#15-155%75U-;6U-755U%045175U975=?1T=?6T='1T]#55U97
-M5%555%77U];6U%514E-755175%555=36UM;6UM?0TM+0UM;7U];1U%=64%#5
-M5%=74%%65=155U?5UM'0UM35U%7555=45%=75=36T=?5U=31T-'7U%555U74
-MU577U%755=555%=455164575UM/1UM;75%94U-=55=70UE!15E%65U%7U=37
-MU]34T=W=T]'6UM'0T=34U5545U575E9755545%1555545U=65E=75=155U=7
-MU-;0T=;1T]#1T=;6U]74T='7U%54U%55UU905E?4T5565E%7U5565E!15-36
-MT=?7U]?6U-555-755=74U-34U-34U=34U]=55=;0T-#755=7U]#655=5U-'7
-M5E)24%=5U%1375)7T]/55%=75=?6U]34U]/=TMW2UM34U-;75U;5UM'55%55
-M5U=45-755E)05=;1U%=65=3555=35E7555=75-74U=36T=?6T-'1UM74U];1
-MTM-54U74U-'45%155575U=555E=45%164%975%155-76T=?5U=54U554U=15
-MU=75T=;7T=/2T];7T-+3T-;45=74U5=14%96459645907%]<5M#65-76T=/6
-MU-?4U-;6U];75574UM'0TM955=77U]574577T-;5U=74U%555U%0459645%7
-M5%175E175U74U-55U-;0T=?6T]W=T-145=?65=775555U];6T-;7UM+3UE=2
-M4E%75U937UU24%934U%75-77U]?7UM'6T=#3T]/3T]#2T=75U];1U]?6U]34
-M55545U=645!35E555E)24E'4U5;5U5%05-76UU75T=/0U]75U]30W=#55=36
-MT]W2TM#0TMS=UU9=75-145-24E-15E=55517U-#1UM114E-15=;5U555U-34
-MUM#2T='3T]?7T-;1TM#0T-;4553555555%555%975E%27%U345965E=55U97
-M5=355%74T-+3T-'1T=;0T-;5U]#2W-+0U]??T-W2UE524EU14%)?65E255%2
-M45)15U945-76UM#3T]/1UM;1UM?5U-;1T=?7UM;0T-#1UM;7U]155%=4U5=0
-M4U-6U=3555%15E555U975%=65E%65=7555555=77T-!5U=+3W=G>W]_>W]W3
-MUM;1T-=44%-24E)?6%M97%)34U)<75;5T=;4UM/=W-+2TM#1UM'6UM;7U]'3
-MUM75U=55U=?455=4U];755904%-05-955]155E%045=75U555%=45-76UM?4
-MU]#3TM#6U-74UM'1UM?7U-;0T=35U-?7U%175E965E!04%%14%!14U!65E91
-M5E145-31T-#3W=_?T-+<T-/2T-'7U-?4U575U5904%=45=75U555U-1445!3
-M5E75U5=04E-65E%65E95UM'1U];1T]W>W]/7U];1T='45535U-145-77U=75
-M5U7155914U-04U)34U!65%545U?5U-'0T=;7UM'0T-/0UM'0T-#6U5=65-31
-MT=?55575U-155=545=755U%27U]=5E164%95U]/0U%55U]#2T%=4U]31T];4
-M5534T-/2T-?4U];6T=?55%75U5165E=65E-=4E)05U75U=75U-75U=37U];6
-MU%74U-?7U];6T=+2T-;45515U=?6U]?7U535T5=24U)15E%145975U=45516
-M5E?5UM'3T-#2T]#6U-?4U-;1T-'6U-74UM355%934%=75U14U=37U]34U517
-M5E975U=75E!15E35U]?7UM=4U-'5U-?1T]+3T='0W=W3U]575U155U975E96
-M5E=75U=65E95U=75U-34U]34U];7U-3555545%55U575U=74U=75U-37U];6
-MUM34U-15UM+6U-?755!14U%15E=14%!65E34U-35U-'0T-?4U=74U-?7UM?4
-MU]?6T-'1UM;75%1455175%?5U=545U%145914%-65]74U];6T=/0T-#75M70
-MU]'1U%5645-65%=75%355-'35-76UE55UE745=%45]90U-55U]715]76U-75
-MUE515U=745%74U!7U-16U];7T]W?T-#1T='4U-355-;?U%974%-=45=64%97
-M5U77UM?7T='7U=745%345=145%75U]?6UU55U]'7U];6UM?7U5145U=55%=7
-M5%15U-74U=?7U]55U-35T=155%154%U05U!65%74U]?6UM?6UM?4U]'0T-#2
-MUU7755=15]75U=5555=15%114%945=36UM?555545%=4U=37U]?5U=?6UM?5
-MU=755=74U-34U=?1T514U5=75%155=37U-545U15U-?4U55555545U=65U35
-MU=75U=?1T]?1T-?45-?7U];5U]34U515U%=55U155%17U=35U-555%175-77
-MU]56U-'4U]?4U]15U=75U=34U5145%75U5175U14U=36U-34U]?6UM;4U-?6
-MUM155E%145%14%94U=34U-34U]?7U-?6T-#3T]/1UM555%=65=115U165U17
-M5U=75E%15E=4U-37UM;6U];6T=/3T]#6U]3555=65%15U=5455555%175-74
-MU-155%14U=37U]?6T='1U%575E965E=45=544=745-75U-;4U-?6T=;1U]55
-MU55555145%55U=34U]34U-75U=34U-3555175E=645%15U75U-?6U]37U];6
-MU]37UM;6U]?4U=575U=45]30U-37U=34U]G:U%%44%IW?7%'Q_?VR=G?TM5;
-M3D92P_WPPM5'1EM15%#5V<W+R=9V>F1[=%#"]_+\\<-71TY,4M#%QMO245U>
-M7=?>P<;>44-"0DU%7=?9P,_#V-134\+E^]AR8F]F0MG#S-O>Q<W;4%A=T\GW
-MS]9?6E+3WM_3T-906-+YY/91<GIVW/786W5U6M;?7$%!7]'=4G!G9W+=_^7]
-MQ%->4-544U+9]_//77U_\IB`FN!@&!H6?$YS2ES'Y.#5;Q5N<OGJ[-%^9&59
-MRLO3ULW#UW1@;7+]Z.KCV7%VUO3#6')Y=U?O@8^:RA<'!A-T4GETW,/ZXUX4
-M%V)<XI'N3V]N85WX^L_9V%5)>V!G6?[@X_K/W\G_]%=*?WY*QI6`B(;S$P,,
-M!6?724;#P_'D1!83;E'NDI?5;A<5</CLX/O+0F5@8V1'_N^5Z.?,4%/4QL!7
-M<V1XUI*(M9ID!@@,'=;"?$W/].?D9AX2?..2G^)C$A)OVNB4X_9;9FAK8$+[
-MZI&6[=IQ3L3__O58?WY^<?R!MX[M'PDU`V/_6'+#]OWF61(8:?*1FY)('AL7
-MT9>3X4ED>TM<6$M2Y)21ZOU&==+\_\U9=')^696#B8'A$P`,`1X7;W7XZ.[Q
-M9Q1K0>^1ZTP3&AUD^>N5[^#\UWMM85;BE.KF\,C!W,[@[,UD%6AVE8*(AO`3
-M!P<?%!80;=SFY]5N$&W]D9'Y8Q\9%F70_./HZ^/996-Q\.F5[/O*U%U3R>?B
-MY/"5@K6!104`!1=L'0005^+\9Q$66>CK]'IO:6EI:V?VEY/IV&9B<]SP^.'H
-ME.O\6U'_XN3?RIJTM98=``06:!T!&EGJY6D=%%"5[5]E<$!M'QH1])"3X5Q8
-MV=)Q9TWAD9'BP]#YE93F[HVQCT\:!!P3'P8`8)7B91)N6/'V>G[,RF8:!193
-MX_O,\N#@6V]M4^#A__WFEY"5XI&(L(-[%V]I&@,#!$GG<6USY/!R9V7WY6<<
-M'A5@;61<X)7_0TY677=V5.7OZ>F4GHRQBN[$YD\'"0,%$&T48_F1YF5?^OQ`
-M:A,0%A,39?7S]O_D_%MD<L##2D3FEY"%M;&#E)#I%0("!P8:'Q=.^^W^XY.5
-MVF=K%AD%'A5]1]?YX^394\[,1DS`Y..=B;:,FH&89P8'!`P,!Q-G6O?DD9B7
-MQ/;S%@<;'QD=9]CWY?'VY/M51O?FY.R9B[2&A8.88P4=!0D.!QP2:MWIDI.1
-MG>)X%!(%!QX6:GS>]_[[\O[F^/#AE)*&BHV8@X'+$141#PD&!`42?O?LE)6<
-MGN5C:6\%`!\4%A52Y/WXX.CO_N25EIR"C9J'@9=\9V<%`P0:!1D7>]+G[Y.2
-MXL!R;1X$'A(2%F?54=O^X^SAZ9:0G(",A(2!G=Q]?QX`!P4%&A-F4?_CD)WL
-MYMYK$!\%!1(6%G[36?7LZ>#HD9&>@H^'AX.?SG)D'@`!!P<%'6)8]."3GI;B
-M0GAO&@42$!X74G=YRN;_\NN7EYF-B(.!@H7_9&8?#0T!!P<9;5+V[9R;D?O.
-M1!`$'Q,9'&!)?T;]Y_'SZ)3KDHV(@8&,A_Q_=1T-#0$&`1IK3,GBG9J2\LW`
-M%@<?$1@?9TID0__F_OCIEY23@HJ`A(R!\&%!%@P/!@8#!!5!_96>G._F]F(2
-M$AP9$A5O94E2].;AXY67EY^/M8:'CH1T;4$9"PP$`0,89,OCE).1[=%Z;Q`8
-M'A84%&-;6$7^Z.WAE)"0@;2/F(Z,^!58:0@)!P8-!V_2YNB7D)7?9F,4&P41
-M%11I3=]=]^B7[>Z3GX>UB(6"C^EK=V0,"P$&#0855^'L[I&43&MF:QL;:FD4
-M;D[06L/BE^GHDYB"M(^%CHWW%D85"`@&!P($8/GOX.J0X6!J;!`:'VYL;&!%
-MT5["X^OMZY":B+>!AHJ!?!33&0H)!@8#&W_KE?WHDLP1%&P2!1!F9&!FV/3>
-MS.SKX.V7A;6TA8"UA6MJTP0U#P<'!AY+E^KU[9!1$A%N$1@09$9E8]#YR]KF
-MZNSDXIJTMYB`M(=K$=0%"@@!!00:9)"3T^>=\!`2%10>'VO216Q-Y^3:^.GK
-MX/[C@;:.D8FUEQ]H>@,*#@88&A]5F9''X9?#%QX7:1(9:,M);77EYOSE[93O
-M\_N;M[60@+6$%QYC!`X(#1L=$F*6F^'#Y^%Q$AP5:!$0?E!`?$K\[./^XY7L
-M__^;M[2<AXF&;@<9!@T*"`<4;V'JA9'D^^?0:!X<%6T6:G;#TEG/YNKI^N7M
-M[_[]FK>UGIF'GVX$!@(!``P`%,;([)25Z.S88FH5$Q,4;F%VU-W`_>3@XN#C
-MX^'DY9:.M("0DY_P$P0-`AH;`09B_^N4Y\KFE<47'1(58FX48L#D_<3:Y)20
-MZ?KG[>_F_9:"CYC@Y^=`81$!`1\7'AL69O7L\')+_<!P86IO0<U-?EW%]/G]
-M_.;H[^#AY?S]]5?!D(2<X>?HX<Q1:1\2%Q,?$Q84>T9X9EK&5-[UQLG[_</+
-MR%-0TUU#5-_<Q<KT\OCX_N7CEY+K\N.5YO7V=VYG>A00%6L4;&,5:W!/?$/>
-MV?'YR537VE!'1T-%W\WW_N'AYN7Z__;!P?N4E>7OD)7ZX/)E9W@4'1$4'1,5
-M:VMA>'ETU=_"]_7+]_/V]O7)PL'<V=O,PLOT_?KG^OG__,_-YNK\V>V5__?E
-M1F%P>A<1:A$2%Q47:'Q]?=/X^/CY\O3\]M)=W,3;V,+"]?_E_OW__/WSR][?
-MW%QT==/AYL_EE>__^O1Q?7%B%Q45$!85%!5A>W]&Q,K]YN'EY>3^\?'VS,W/
-MQ=75U]32R?7)R?3.P<316UE92G9#Q.7[]>3J[N?D\%)97'MN;FX5%!06%FIO
-M;65$QO/ZX>+L[^SF^N7XR-_=U5?255M7V]_?PLW$PL[%W--475A,=W9'R_+=
-MQ^'M^__R5T%7=VUO;6@5:&H5;F=[?47;]OCAXNWMZ>GCX>#E]_7'64983'1!
-M6D!945A>5%A,0D]V<71W=G5,05#WX>?YXI7IX>'_TM+2<&!A9F]I;FL5;V%G
-M?D/1SOSEY.3@[>'XY>?^]<G:U='404E87T!"27%Q2TIV=$U85M514%=745U>
-MU_#CX^3ME)7LX^7!W=1R;6]O:A05%!1I8&=E<5G2P<KQ_/KGYN;@[>+G^/SW
-MQ-Q565Y64EM%1DAU2G9S<4I)3T!%6%)455=4QOOAY_GFZ.GBX?S=U%%\;VH5
-M%!5K:FMB?DM8W<[Q^.?D^/_EYN3RS,7&P-O54M##P][1T=#35TQS?7!R?WE^
-M<4975E+1QLS.\.V0DI?IZ.[DVWUO%6L4$AT0%6QF>W;=^.3\\_GE^_#85][+
-MSM[3S/+_\<_)\/+UT%Y86TQS>'AS2TMW=5K5T%10W\_#Q=O$P\/%VN27ENGC
-MX^;W4&<5%146'1(7:6=]=%_VX>'X_?GE^_#$WLGP]-[0PO?TQ]S;S,S11T]!
-M079X>W-.04!&4-G-P,3-]/?*S<7;Q-A76MSFZ._@YN;ZPW5M:A44$!T3%V]G
-M>'7%Y.WBX^+O[^#Y]O'(U5I!0%I75U/8]/7$V=_44D%Q?'%U<7-+6=3=VL#+
-M\_#/V,;+P]/7T-/14$!8]^?[\O+\]L5:9&-@8FL4:F]@>'-"W?'ZY>3FX>?Y
-M\,K#WE5<7]72W=W;S,KURL_'W59'2G9V=W=U24!2U]S:P<W!Q=_6T-S57%#1
-MT-;45U)34EQ=4]/9Q,'&Q]_355Y$0DYT<WU_<'1+1%#0Q<_U]/?Q]_7*R\S:
-MU5514U)?5M3=T]515=577U'4T]#7UE!65]33T]S0559<4%9=7%U6U=357U-9
-M6E%045?55UE<7%U5UMW>P<W;V\?'V=_%Q-+<TU=16UQ91$1&6T5?4E]45%72
-MW][2T]!27E=5W=#3T-31WMO9V=K3T=S15U164%-145M;751<7%/55%74U=#1
-MW-10U-?7U-S?T-%44U54U]'7T5975U965E11U=35U=745=?1UM55U]37UM33
-MW=!55]9545=6U=1445!44%!37U?0T]#1T-W0T-/1TM#7U-32T5!7U5=575)8
-M7%!25U!=5=/05573T-S3T]+2V='7T=3645!64%)25U35T-'75U!4UE1=75U0
-M75/75570W][:Q<;9U];?T5?755-3U5997%=;6E;645#0U5'7T=#055?6T=31
-MW-S2W-C;T-?6UU1975Y=4UM?1%E0UE9=U-_?T]S>V-G9WM=7T='44EQ75]70
-M5E%5U=345E9545)14=71TU155E':W%U65-;1U5)=5530W-[1U-W9U%#4UUU6
-MT-!74E-65E!55E-3U=?4T=W1UM'25-?3T=-5U-35U%155U%34=?5U%-3U=;3
-MUE77U-/55=-45U]1UE-25=W4T=_<UU;1UE=1U5545%==75#5T-30U]'75M;7
-M5=7?T%?6T-'45M56551155=75=55555775'4U=;4T]545-745-30T%!3U=3?
-MT]?3WMS47U'44U)65US55%135M%4T]W35%?25]%1U=/1UEW7U%945MS45M34
-MT]?9T]37U%515U1<75U65=765]775-'55]/75U?7UM375=937-Q75-'6T-=7
-MU]745-=04-#75%+2T]35UM945U;75U?6WM57TE?75U=5U=345U+555+55534
-MTM=4T-%1T=!55%?255744-965E53T]'1U=?15-165U545577V=15UE755]55
-M5E934%165-W0T-#7W=/1U%)=U=165U!0T-/55M745='2UE=6U='4U=?4UU14
-MT5914U375-?7U%77U]#7U5?7T=36T]=5U]=45E155%Q05E?745U05-37U]G4
-M5]7<]MA`1D)94-;57]S4W]C9V=C=UM%04-?41%A67=/<75)0T]93T=[1W=S3
-MT-/?4%+54E!4U41&4]=57=_=U]_3U-38WM)15--35=%3U%34T5/1UE->4M'6
-MT=9'7-_8U]=04M+=T%%3U=W!U%W35%955U10U5E8UM#04]345=[7T]G5T%+7
-MWM?7559:6-_`7$Q=T]91U-=61-7'T-;45=35V<G41%]?7]_845S4V]=7TM9?
-M6]33U-W1WM%?5U)<7]S065_:VE/?U450TM[0T]52U=!7V=Y765+24=/66U/<
-MUEW6UEU35=]64M%4W-)`7%94W='>T53?T]175M[:5%#0551165[7UU%65-32
-MTUM$T<566]/2T\/94E;465_:WE1;4]!0WM98T-!0U-75T=72WU?7U]?115Y7
-M7M345]=3T=W2T%-=4M#?T-_445-7T=+8TU?145M75=S16=11153?5%/6U,3#
-MUU_4T-76U==;6=)0T<!705O3W-;7U51<5-[645-9U=C<T-72W%15UM9=75]1
-MT];55-;7U]#5U=/65]3145!0U-=37%=5U]%4U-77W=W6U5!=4=#4UM/3U]17
-M4=/04=W8T=%44U-34U-07%)=4-+3T=71T]165=+?W-/64EA0UMS=T%5=75#6
-MTM74U5]?U-W55]165U=6U=?=TU%3U-[9UU?0W575U-55U-+=U%175E!345)1
-M4EU<4-;1TM-44U!74%!275;5U]?1V<;-S,+`Q,;/R\_'W]1=65I'0DIQ<G-Q
-M=W5-6%U05]?3TMO?55175M?>Q=K2T]K+\/_EY.3FX./@Y??30W)E86QK%!<4
-M:&!^=4=0TL_]Y>3X]L166%A80$I*3D;1\^#NZY>2F9F2E>#P4'AL%!(8!`0;
-M'!`4;7?)XY20D)>5Z>SDP'-B:Q05;V!D>W'1YY23GX6'AX6<ENS,>A0=&P<!
-M`0<$&!-B4.>4DI^?G)V0ZO]`86L6$Q(2$Q1GT.3ID9B`C8*'F)V7^W`7&P$`
-M``$``000>]O@D)B:A86;D^SP6F(1'QD;&QX68%C[E)Z&C8^"AH2:EL%O$AH&
-M`PT,`@8>%&-6ZIB%A86%F)/OQF5J$1P%!!D18G+2XI^!C8.&@(.$ZM1Y:1X!
-M#0P-`P$$'F_TZ9>=A(:%GY*6Y4QC%Q(<'QP1;7;%[9B&A(6`@X64X^5\$A@%
-M`0,#``89%6=UY).=D)V;G^OG_4=A;&AH;V-X6>&0E92%A)^5EY'Q86)I'1H%
-M!1H9$A9M0=+)X)24[N_KYM)>7$QW=TE6RNSKX):>D>CKE^1*<'(5$A,2'Q\3
-M%A5D?'3TY/CG[^W\R//&0E#905SPY.WB[Y"1E.OJZ_-90'QJ$1`3'1\=$6II
-M84S=Q?#FYN7ZY__(_/[/R/GEXN/FE97OXNSLS5)1=6]K:A<1$Q`6%!5O97!T
-M5??USOCF^?KCYOOA[^F5[>^6Z.?GX_)-7D5E:VEK%A86%Q05:V)[>7!3WU#%
-M_?#UY.#DX.[KE);HEY/NXNSLPD'7?&QJ:!<0$1$4%!5N9F1[3E)<4\OWS_'F
-MYN3C[.B4E.F6D>WNZ>/:W]EX8VEN%Q$6%A<6%6]C8WM#1UC<]LOU^^'DYNSO
-MZ)24[I>7X._BY=G5T65F;6P5%Q44%11H;&U@>W9T0U?8Q<[PY>7G[._HE):5
-ME9'IX^+F\%]7<&%M:VH6%Q45%6YF9F5R34]'5M30TL3U\_+[YN/LZI3HE9#J
-M[.[B_U?=26!L:&H1$107%&EA9F5T4E+7QL_'Q,/.],OT_/CEX>GIXI66[.WN
-MXO;7S$YA;6QK$!85%!=I9V%F3M985/3PP<K_]LCS__#V_^7FX^#@E>GFX^+D
-MW=_&<V%@9VL6:F\5%VUE8F!#44-$S/;0Q_S]]?/DY?+YY^;AX.;@[^'ZY.'R
-M4=S6<V!@9V@7:&)I:F-X9&=V6UA%T<'`P_7Q\OS^^?CZ^_OEX>;YY>#G_/'X
-M\-!36$)^9V9C;V]M;&UC869[<$A'4]G-]?']_OO[^/CY_/'TRL[)]?3+R_7T
-MRLG.Q])57$%T<'Q[961E>GY]<'=(0UA05=74T=+<WMO:Q<3$Q,?#PL++]/?Q
-M\_+R\/;V]_7(S,325UA-=79R>7IE965Z>'Y\<W%U0EE6U]S:P,[T]O'Q]O;W
-M]/7)S,+`QL;`S,_)SLC*]?7.Q-%=075Q?7EZ961[>7ER=DA`7E30WMK$QL'&
-MQ\3%V][>V=C8VL;`P,'!QL7:V]G8VL;'Q,'"S<S"P-C05U]%3'1Q<GU_?'U]
-M?'US=G1.1UY0UM[$P\_+]?7U],K+]_3*R,_-P,3;V-G?W=+3W=+2UM745515
-M5U->14-(='=V=G%P<79T=$I,15Q6T-[:P,_+]?7T]/3UR\_#P<78WMW2T]'7
-M55%04EQ>7%Q<5E935-37UM'2W-G9W-!545U>6$=#3TE+2G5*2$]"1%]05-'<
-MVL#.R\K*R\O(R<_#P<3;WMW0U%175E=14%)<7U]=4E)=7%)04U%64%-65=35
-MU-+0U];45%9375]97EE86UM86%]35]?2W]O'P\S.R<[,S<+!VM[055)?645&
-M049%6UE<75)24E)24U%7U=#2W=S?W]_9V\7'P<#!Q\38W=_14%U:0$)-3DM+
-M2$E/0T=:7EU35-?3W]G%QL'-SLG/S,+#QL3:V-[=T-155U!<6$5'04--0D9:
-M7E)245=5UM/=V,7%Q,3%Q=C8Q,[97=S+W'!TU<Y68V=3W'QB?5340%[T_/?"
-M\/KRS,_Q]MK7UM[004I!7UA/35E26$1945/4T]37V\!16MK"7T7&],37Q?+/
-M4=_QVTA7QT9X=5UY9G1.>G]:14I3Q,7"S/'^_//^Y?3"]L!0U,-1=%92<79%
-M37Q)67584EU44551P=)5PMG;Q<_<T,U7]./95.OY0?SBUF7Y56QX<V!J8F%N
-M86-Y0'E"]?39_^[Z^.GMY^'OX?_Y__==1U%R9F5[;VYD8&UE<W-(U\7#]O[[
-M^OKZY/[)]\O4W-U96E3R_'#DZ7+\Y/-"7/Q@?&9B9A%O;!5K;$EM<LE6R/'B
-M[.&5ZI3IZ9?@X>?R]41%261A;6$5:V-H;V!X?'/4T\#T_N?YX>#GY?[E]<;`
-MWU1&4$]"\/%R^^E^Y/K8Q$/*97!C86038VT7;VU^8G;45/WT[^[CEY24Z)65
-MX>WD]L#03WYE8FUN:FYI;FUA9WY/1]+(\/KDX.#CX.;D__/(V55?1TU`3'9V
-M05W`W]+FR<7ZSL!5WEM]?6=E;VQ@:&Q@>W]Q5-_U\^3CX._IZ>_L[.'G__3,
-M7TQU>F9A8FYL;6U@9W]T0=+.]__DY^;AYN3[__?'W-1>24U,=TM+=7=)0%C/
-MPM/_^LWR^/;-Q-M32W)]9VQ@8VQB9WAY=%W=PO/DY^'M[>+@X^/F^OCST-19
-M?'IF8VQL8F-@9WQW0M/#]_[DYN;FY_OR]LC8TU!#271T='5U0D%/7T5$P??(
-M]^3X]OC\]<;6575\>&1B;&)L;&!D?W%9V\K]Y./C[.[L[>/AYOGT]])!2WYE
-M8V!C8F-@965P1E+=POW\^^3E^OC\]/3"T]=<7$))2'5`24%'7U!=U5/5W\?V
-MS/;D\_SEP\S,1W5W9&)@;VAO;F-E?T+1P_/FX.+N[^[O[>#AY/3+T$9T>&5@
-M8V-C8&%X?W9!4=S'\?WY^_KZ\O'TS=95T4='045;1%Y2T-;2V=#6U%!=T-C'
-MP\OU]\O,R=9307=Y9&%B8F)C9GIQ0=?`\N7FX^WL[.W@Y^3\R,!73W1Y9&9A
-M8V%E>G-(1%#2QLCV\?#P\?'+P-K<5=374E'1UU32Q=;6T-107U]!3T]<V=C%
-M]/SP]?'TW%982GAF8&)O;V-F97%?V/7ZX.SOZ>GOX^;Z]LW60W5R>F=F9F%D
-M>W)U6M/:S<OW],O*R<?8V-W75%;4U%71Q=G1QLK;W\/=6%A#=G=9P<;&\N7_
-MR/'+5TEW?V!N:6]N:6-X<4;`_N3@[NOK[NSBY/;,V5U"3WUY<GME?W=V3U)1
-MU];3TMQ5U-)14]'05-+$VLW(SLKWPL;#W]564$5'0$MW2M?V\/#DX.7VRM]-
-M>&!M:!07%6EL9TK0]^7MZY65ZNOLY//#4$IR?G]Q=G)"5U-9T,75U=9164-T
-M=4UW=D114=?%]?+R\?[[]\GVQU974TQ)3$M,1TU.6%7WY^3EX>#RQ59T9&QJ
-M%144%6UE<T;!_^'OZ>OK[N#E\\561DA.2G5/6U]:4%=645%37UE`34U,3D):
-M4M;?QLG*]/;P],G,P=C155%?6D!&1D9%65Q?6UA2ULK\_?_X^?794DES9&!B
-M8V)C9WYU6-_VY>;FX>#A^_#+QM-=1UM:0DU!6UA?7E/75U]=5UY;6UA97E]<
-MU=S8P<[+]?3+P\7>TU=745]>4E)%15U17%E96$5!05'"]_3R^_GWPM]30'!E
-M9&5F861_=D)6Q/;Y^_ODY/C_\L[25UMU=W1V=$9:6%?0T-+:V]O'VM_?TE%9
-M7%!6U='2V,3$V-K>T=14745`3DU#04=<U-?4U]S9W-#1T])675U24EA94-'<
-MW]O&PL/"PL;<T==76D)(='9W2T!94M?9P</&Q=G%VM/4UU5675Y=4%?4W-+#
-MQMS:Q]K=W]38W=5175!'6T=:1U=17%=75EW15=W>5E?7UE=;7M=65UY<5-'1
-MW=O>W-#<W-/0T-S9TU!05UU?4U73U]W4U%-7U5545]/075Y17UA<5M745U;7
-MT=;4T-W1T%S3UE;9T-['TM+0T-?5U57?U=9>6%=?4U514-5>U%W75]?<5-Q1
-MTU)=45-44%77W-S1T-C<T-_3T=#45E954%=<7U1%1%S0U5#45=+0U-C%VM#=
-MVE334EU6UE-2T5%44E1=UU115E?47M97U-'4T=/05-31U5?1U-/7TU71TM;2
-MT==74U)47EQ05M514]755-#2UM54U]36U]75T-94UU105%%7U%73U=-5W]77
-MT]774-;65=775%115U9055+545705556U];6U%/4UE=7U=%45%?0U]70T]_0
-MU-;05E-4U-=45E;5UE;4U]14U-30UE345E1654525]545-/4T=;6T]?4U=?3
-M5U115]50U]'65='6U53455;4U-15U%14U=35T5?55-?1UM?7W5?0U%564E92
-M5E)05E?45%71TM+0T]#0UU=3U]105%745-76U-%6U-36U=?4UE514%=55-17
-M5U%45]31U]34U];45=37U%75U-345=35UM74U-77T='1U]355=545U?5U554
-M5=555%1755514-?5U=?5U=74U]?4U%55U-;1T=#6U]34U-55555555=65E96
-M5%155%74U-;6U]34U-34U]?4U=355%74U]35U=75U-555%55U=74U-355=;6
-M5-3755145%545%55U=?6T=;7U%575E975%74U=77UM'75=7555145574U=75
-MU];6U%54U=5555175E975U=4U=37U]37U]?6UM'6U%554%#5U-?1UM;1UM;7
-MU]5555=75-545E=75%545U%04%%65]71T]W?W-W0UM?4U5175U9045=75%15
-MU=75U-75U=75U-77U]?7U-37U]?7U-33UE=55%975E=45%75U-?7U]?5U=55
-M5=74U-5555145=7555145=?6UM;7U-35U-35U=5545%65-?1T='1T=;7U-34
-MU%555%175E=75%15U%90U-55U555U-?1T=?4U-?4U-35U5555%145U965%75
-MU=34U]?7U]?7UM;6U]555%145-75U=555%145=74U]355%=5U=37U=55U=55
-MU574W=/5U5545=34T=+05E%64514U5755%=55%975%?5T=+2W]+3U]35U551
-M5U155=?45%55U%33QM'4U5A915E85E!75576T=/1TMC=V-_>W=955M%75==5
-M4]105E)14E-64=31U-71T%35U%36U-'5U-75U5=4U515UM97U5=2U%575=%5
-M5='55-#4U]56U-91UMQ1T]M5T=Q?5=%=U]U<5]]35--25==35]9=5M=;4E1?
-M7%=:7]9?5=!0U-/6T]O3V-[3Q]+<W]_0UM-1T5=4UMW85<#!T\78QM#6T5U9
-M3D-T<W-R<'QP2DE!6='3V\[W]_'Y__#^\O?TPL'345M!27=T<W-Q=W1+05Y7
-MU-G'Q<W"Q\7%WL/]V-C@P?3DQN36Q,M-07M"8V-D;V5I9'QG=$O17-KP\^7\
-MX.'EX>;A^_CE]\S<UUMP=WYE9V=E9F5X?7!U4E'?QLOQ]_+]\_#Q]\W#Q=K,
-MR-G`\M_.\<3.5])62'9X?V-C9F)F8WM\?TU2V-OT^/[EY.'@Y^#FY?_\\L'?
-MU%)-?'!X9F9G9V9E?WUQ3E%7T\_T]_'__/+_\_?+S/SGQO&5S?7L]_%"WD!M
-M9Q1B%Q)B%6AO?%M[Q?;P^OCI[.'O[^SY^>;.TMO!4';7T'1V15M_<D9W>7U.
-M<7MT1DIT1=)64<+WR\C^^O/P^?_.Q\[]Y<3"[O]<P^7/;W+5;Q8591428WYF
-M8TKWTMC[X^+AXNGLX^7[Y?;;T]W71T=/3D=U=W5/2GQP=7!\<DI(=4=?5]W&
-MR/3R^?GX^/C]]\K`W-1=4M_+V%?%]<Q07%%V?WED8VQF9V!D?'1(7,?`POWE
-MY?KDY_KX^_SV]<K#V-O465M$375T='!Q=G9V=4Q(2D]`6EU5T-_`R,KT]O#P
-M\/'TR,S'W]%67U?'V5/2R\[=V-A&2DEV969[969E?WQ\3E)2U\[P\_WZY?G^
-M^/WW]/'TQ,?'TU907$%.3W5Q=G=V<7=U=TM!1EI0T=W:R?7U]O'V]_3UPL'&
-MWM#=QL?<V,+(P,7=4D!(=GYD9&1G9'IY?G-/6EW0P/3P_/G[^^7E_OW\\_?)
-MP=[44UI/2TMU=W=T='1+2'5+3$-!6U)1U-_'P,SU]O;Q\?;TRL_$W==06%?!
-MQU?<]O;9TM]&=W1S9&%E>V=D>7QS3%?4W<K]__SZY?[\_/#U]?3(QL7'W%%?
-M6$UT=71S<W=W<'9U2D]84U?2P,C(]/'V]_?TR<+`VMW4U,+SPM;*__30V=1T
-M=W%E8F-D9F!E>']V6-57V/;_^?[X^/S^__'T]_3.PL/>U]=714U"0DY/3G1T
-M2DAU=4E"1EM94M33V<?#SLKT]/7URLO.S<?1753-RE=7]//&UME>=4Q*>F9Z
-M?V5E?GY\25Q>4\?W\_+]__S]_/#T]/;TS,+`W%507D=-275W=W=Q<'%V=$]%
-M7%3=Q<W*]/;V]_7)R</%V=G.\LK=]?CSW-W3271T>V-C9&9C9F1E?4)?4]CW
-M\OW_^/C^^/GS]O/S],G"Q-+74UI!0TU(=4AU=W=W=W9T2TE`6%/4W,?.R,KT
-M]O;W]_7.PLC_^,+&__C-U=]:<'1R86Q@9V!A9&1[=UA96<;S_?GZY?KZY?CR
-M\_#TR,#;T59<1T))='=W=W=V=G%Q=W5/1%]7T-O"R/7W]O#P\??U]OCG_<O_
-MY?+;W5QS?7YA;FYB8FUA9V5R0E]=TO?\\O[Z^N7DY/O^^?[P],O`W%531$U,
-M2G9S<WU_?W]_<W1)34=?U=[`SLKW\_+R\_/S_N;A_O+EY/#;T4!_>&1B:6YM
-M;6UA9V5R0UQ6W/3]_.7AX>;FYN7Z^/#T],?74UM-=G!R>'EY>WAY?7!U041<
-MU]S`R?3V]OWS]/?W_^B0Z/[F[.1:>V$5:6@0'19@9F-]1]K_^O+/_.?QW];2
-MQ\W*Q<?ZY^7ZY.;[]L5'2G%E8VQC86%D>79%5-/>P_?W]?7U]<W#S<W,S_3B
-MDY3\Y.+Z6V9C%11K$!T49GEE2\7U^N3PR/'\S5)4WMK-S\+QX.SZ_N?YS51/
-M?7AX9FUF?WEY<4?4Q\/8Q/?WP\3&P,3&S,#!]?/CD97R^N#P3&!L%105$1,5
-M9GI\1\/R^^?Y]O_RQ];>R<!1W<KT\_#*]/+SP%-?7W5\?GA]=W=W0U73U]_`
-MS,C)P\39Q<33UM[8Q_OH[??_YO5#?69O;VX5%VEG9'M$V,G\Y?O^Y?[)Q,?'
-MV]W6W\?`QL?-RLG!VMS54$5T=TYU=TA`6UQ6T=#9P\;<V<S,V-C&V-#3WMOT
-M_O;`]<K50TA]961G8V-G>WYV6]7=PO;P\/WR]_3*Q=[8W-??QMK;PL/;V=W1
-M4U]464I'7TI`7%M55]3?T-]7T<#3U]C&W5/<QE93P-A$5L'715'46%M=14Y.
-M6D9*2$5>15G4UE%5PLU4T/7/T-W-RE7"_UY0^-MRR?%R=_Q79\7/=D[UP';7
-MR-35UUG2W$U<V%Q=5=9;4]_455]8T\!,3L#0=-'$0UK/U4?7WM[4Q-?3R]=7
-MVU!;RT!-QE-5TTW&]UE,RLE^6/!%9-GY2F?TY7!^_.5]6^7$>,7G0WC;YG1D
-M\/U.=,+R>G3CU&G0E6=IY_%S?OC*8,'G7&'RX'])\_YY=N]!;^'Y;%GB0&;'
-M_$AVS\!*3?;6=UO\TW/#SEO<W]E<UL!(S,9\SMY<543"6%#37<=QQ\)X]%9W
-MVU?)<E+_0EW9PE34V/5.5<=3547;V$O07-7%3E/%44W-WV;Q_W!]_/]S<O/X
-M9=WA=W#L6WE5_T!__=1/U=Y+6?97==?65]9)QU=1SU%TS_=#5L[*=MO^=4WX
-M5TY>_G=(W=5364!<V4125MC1U5_6Q-]!UMM`],1EYM71U5W&UT?5<<O]8UGC
-M<W_D6F/NP6OD]D9)]U!&YWIRXUU[\%9$]U-WT.-D1,Y40?E<:N_[%LWB84/N
-M873N9-CQ?O;Q9-K^?4?Z3F7C56?D5EQ45<Y\\$=WR]E&=\C\<G3G2-/84M?8
-MVEM)]%].V-E`R';WT'+L8U;C37OU_GIS^]QZ]M]CY<EGQ_]QP'#TQT_<0/]W
-MW\!UQ?E]5_W=47/WR6'^4W3\=TOZ2E[:?.5,1$WW]F'_P$OU15[6V-UU3>=)
-M>/C<2-#'<OW#8?/T=E[/Q7'-R'9]X?05X?5E]7;D2GGB=4#-R7W3]77V;>]/
-M>?M_\'WWSV?]_6#V]$G!2/_;9?3]>5?T0\U)7?=*UL1VU?!\0<S7S&;+Y&'+
-MWT+E<5/\3L]TSLA\R<%TVL)^4O-39MG@96>5>5?*T?%BZ-T7Z/-HP_E!3$KE
-M1&>78'CI56=\[E%H_N!@4N9*>^;:9E_B=F#C7$M8Y%IDX=U^_-A;3?O38^;6
-M?<3,3$;"P'94]'G`P7WU47S\WW17V\EVT>1Y1>1#0LC?=M#]3G/*R4I#^G=5
-M\'/V05?;55E2S'334<Q(2.!X1N1Q6,A=QG1`\D5-ST)7RG'_7ES]=/##9OC&
-M?_-`7L=%V5Y;]'+0SW#(577UTT+!6\9-W,-QV=;>7E;T35S%Q$-?]%]:V]==
-MQ-%`Q==/PE!$UU790M'V?]'_3W[P]W)0\M!]P_5*7-;*0$3&U5%<S%M1\738
-MVE!06_=U3<]165#5VEO>TM-?W\=%QU=?W]5#TL=)4,5"6<]50-M6W=A#W,-&
-M5\975]Q3V,%.4_=`3<-57E_;5T/6QUE%]U=.\-)/P-E.WM]#W5)'QU-:V-%?
-MU-Y<T]Q2WU?7V%+3U==15]-9U=50U=3<45+?4U74UE=>5]#775-555?3T]'6
-MV-+6U]_77-#3UE95TE;555154E914E-75596UM56UU575%97U]565=55U=/7
-M5M'8TM#=UM#6U-/5UM;1T%73UM'1U]#6UU145%Q<4EE96UA?7UU<4E)245%6
-M5U57U]#4T-;5TMW1W]G<W<3$V,+!Q,38V]K/P=K(S,3`Q]_77$!U<WAE9&=G
-M97A^<$E&7=#`R??S\O#Q\?7/S<;8W=S0UM;5UM'0T-#$_?S:X^+"X_KXR$'(
-M96%@%6D1%6@5;6%T3U'W_.?E[>SDX>7YP-W8371W=G9P6EM=W<?.P_?WR_C@
-MY?N4X/GIY?Y96$9J;Q06$1T5%&IA?U]$\^'EXNGIX^;@\=_71'![?WEE<T)9
-M4<;V]O#\_??Q^./@_)?H]>GD\E-P411J:A`6'6IJ%69^4D;"X?KA[.CCY.'Q
-MWEU%=V1]?7EP0U75PO#V\/+\]/7P_N+D^I?A_>_[]TM!=!1I%!80$VX5:61Q
-M7D;QY?C@[>GG^^?)UUI`<&5V<7!,5=C?]/+V\/W]R<CP_N?[X^GDY>/YTD5-
-M9&IK%!$1%VAH;7EW1M7P^?OCXN+F^_C$T%)(=GUT=G1>5M[!]/;U\_;US<'W
-M_^3GX^[AY.W^W5UW96MK%1$6%VMK;7YQ1-#Q__KCX^+G^_W:U$1U<'-T=$)<
-MU\3"]O'V\?7*P,+S^^3C[>W@Y^/(T$%[811K%A`7%VEH87)TU,'\_N?BX^/E
-M^_33T4)T<W9(=%E0UL?-]<KW],C.S/#EY^SL[^SG[/?56F=F%&H6$Q<6;FAA
-M<7?2Q?_EY./CX/SS]U-!075^=D9*0=#&Q?7]]_?S]L[WY>3C[^#HY^?G551E
-M96X6:Q,7%FIL;W9Q5-GWY/[FX>#R]/Q03T%(>WU9=$+$S,'W^?;T_/'P^N3B
-MZ>'H[O_GR]E^9F<6%187%A=B:65^1=+?Y>7GYN/[SO+93$E"?'A`3DO6S,#U
-M^?_P__OEY.*5XNV5Y/CQWG5B9147%Q85%F)B9').Q-S]^.7Z_N7/WM!9<'U*
-M?WQ)7U+8\/?SY?KZX>/CZ)7MZ^C\_\->9V-B%A06%!1K9F%P2M#!S/____/\
-MR-_0175R=G-Q2T94W\_U\/+YY>;B[>J4[^CH^/+`7&=M8Q<4%VL5:&1D=TO<
-MR<O^^/CU]L)<175P>GY]<G1-U=G)]O[X^^'B[.F7E.Z5[__+VT-M8FX7%Q=K
-M%&QG?W1.Q,+V\OK^]/'%5D]U<GM_?7=U1=3;P??^^N;MZ.N4E^KK[^7)UD!A
-M;VX5%Q9K:V]F?4A#W\[Q\/SR]<C9UEE`=W%W=DI,7%3?PO7S_N3GX^SNZ._B
-MYOG(5$1S9V-M;6YL8V%D?G1)6]';QLC*P\/&W5944UI'1D!-1%E=5]#;S?;_
-M^N;C[._MX^#E]L952'QZ9F)M;6QB86=E<T)<T\/-S?7*Q=W<55Y81$Q#145<
-MU]G"]O[DX.SHZ._OX_KTV$5R>V=B;VQL;&)A9WIW15;8S\_U],/?W==24E):
-M6UU?7=3=Q/7R^.;M[N[L[.#Z]-Q!?65F8FQL;6)@9'IR35+2P<G(R,W&V-94
-M4E]%04186%+4W<#W_?KA[>_L[>+F_\G00WUE86UL;&QM861Y=%C5V,W+RLO"
-MV]-77%A:6EE=4U33V\SV_?KFX^+CX>;E\,#40G-[9V)M8V-@9'M]3U[5WL;-
-MS,'?T]=07EA'1UE25-+!R_#^Y>;B[>/FY_KPQE1-<GMG8VUC8V%G>WQT1E+3
-MQ,W)SL?9W-=175A'65-3U=K+\/_EX.+M[>'GY?;94TE\96=C8F-@86=X?758
-M5=/>P<W'V-[155106%Y65%33QO3]^^3AXNWCYN3Y]=]<='ED86)M8F-A9'M]
-M=5A5T-K#Q\3:W=164E!05='=QLKQ_/KGX>#CX>3E_<%71W9Y9&9C8V!@9F5^
-M<$Y=T=_:P,#%V=+45U!24%77TL?(]OS[Y^'@X.;E^/'%5D9V?F5F86%F9V1E
-M?G1`7E37W-K8W-W755574571T]K)]_/XY.?GYN?[__#-T5U-<']X9&=D965X
-M?'!U1EU34-;2T='155=745'7T]K(]O+YY.;FY^?E_/#)T5A-<GIZ9V9G97A]
-M=G5"7E!5UM;6T]=65E-=4E!4T-O-]_+\^^?GY.3E\O?(W%Q!='QX>F1D>GE]
-M=G1)05]4U=33W-'1UU-=4U-1U]_"]_+YY>7DY/C_\<O'UE]-=W)\>7M[?GUS
-M=W5)34186%E>7EQ15]?8S/;R_OKEY.7X__SS],#24$5.<7U_>7EY?GUS<71*
-M24)`0$52U=#:R?;]^.7EY/KX^/SP]<#?5%Y&27=S?7Q^?G]]<G-Q=W5)34=>
-M5M#:SO;]^.7DY^3E^/SQ]<'?55]'375Q<W)]?7Q]<W!Q=W=T=4E#6U#3P_3S
-M^>7GX>;GY_K\\,[?44=+=G)_?G]\?7UR<'=U=4E"1EE=5-_#]?']^?KZ^OOY
-M_?;.VM%314)+=W%P<W)R<G)S=G5.1E/1WL'+\?+\___\\O#TPMO045M,2$IW
-M<7!P=W5(0UY5W=K`S\G.S,/&Q=G=T]9545-<65M:15I?4E?3VL'"S,W!Q=)5
-M4EE!3TE)2$M.0T=84E;0V<'U\//]_?#WR\#;T%!%0DUU=G9P<79V=TI`653>
-MP<[W\/#Q]_7+S,??UE=37D1#0T-#0T-&6%;0T-W%QL?'V-/1U5)96D1%1$1;
-M6UE05-32Q,_+]??V],O#V-!47$=/='1U=W=T2T):4]'$PL[T]_?USL39TE52
-M641`0D)`04=>5M;9P<+.]<O/QMC2U%):0TY+2DI)3$-:4='8P,+)]/3*R<'>
-MT%=<6$9#0DU-0D9<5M?9Q<?/RLO/P=G355U81DY/0DU`15I<T\3$VL;-S</:
-MUE1645U81T197%U35M#'SL_`Q,3$WE1;0$%'1DU"15Q15%35W,S+S<3:Q=K<
-M4$9&6D9&6EM2T-G>TM/9P\S%TM'6UU%%0T987UQ?4]72V-_1U-#8V-+45=;0
-MU5U:6EQ375U3U=/=T]'1T]#7U=31T-#0T='0T=175E=45E-1U]77T=75U517
-M5U=5U-155U%04E)34515U-36T]W=W=/7U577T=/<W-S2T]#6559275]965]<
-M4534UM155U!15M30TMW?W-S=TM;4U]?5U5=35]35U=545U%27%U05-?0TM+0
-MUM75UM;55U97U5545-?3T]+3UU905E%145965U75U-;6T=;1UM;6U]?7U554
-M5=74U];1UM355%964596U-!55-545E%34%%65U14U=;3TM_>W-W<W-+65557
-M5U%04%!645965E965%75U-34U-35U]'3T];1T='6U-37U-34555145)34%!1
-M45%75-755M?1U];7UM?5U]71T-'3UM/1U]?5U557U-57U%'545!74E165U17
-MU]?5UU77UM31U=5445965]55U-74UM74U-?0T]+0UM?5U-?4U-555=?65U?5
-M5U9645!34U!045=45=74U]?7U]?4U]'0T-/0T=;4U5555=755=355=74U]34
-MU-355%145%164%!145%45%=4U=37T='6UM'0T=;1U5945U%75=74U-34U-77
-MU];0T=?7UM35U5575U=645975=75U-55555555555555555555555%15U=?6
-MT='0T]'6UM;7U-755=55U=755%37T51455965%145U=75U=65E=5U=34U]'0
-MT-#3T-#0UM;7U-74U55555965%75U=555%165E=75=355=7455=45574U-77
-MU-?4UM/3T-'6U%%=5U=05U1455545=74U-?5U=37U]?7UM'6U]?7U=74U554
-M5%14459645955-74U-'7U]'0U-74U=36U-555U=45575U=74U-?4U]?6U%17
-MU=565%575U755%75U=36UM'6UU575E965%745=75U-35U=75U5575=54U=37
-MT='6UM155=34U=155%75U-755=34U-545U=15U755%15U==55M?45U74T]+3
-MUM3555145%35U]?7U]=5U57555145%155=55555555155U945%755=77U]?6
-MUM;1UM;0T=?6T='6UU555%=645!37%]<4E345-555E945=?1T]S>V=[<W=/1
-MU];1UM355EQ96D=;4M76UM34UM/65EY86D597%'7V\SU]_;V]<S#S=I76$%+
-M=4Y"34Q!65-4T-!55]7545-44U]0U]W>WMK,S-C2UEU?5M37U5)96UY15EQ9
-M7538SO7U]<KU\_K^P%--=G)P<7UZ97)!5MW;W-;<Q\/%UEU:1%S6TM=7U=W!
-MRO?+Q]S>V-S25D!U=$I/34]-6];"\?+S]O3U]<[`WE1>4-166DU*='1U3$%-
-M2$!>4%34UM=5U=+;V-S?V\;!Q=S745U24EQ;1D%$65Q5W\?/]??Q\?3.SL;9
-MQ?7_^<M50'1P?'AE9V!C9W)-4M;9P,OW\O_QP=!64=76U]#3UM#8P<W!TE%?
-M1$-`0$]+2T!1WL;.]/;V]O;W]<+:Q_'E^\I53'%\>7IE9V-M8'A(4]#$SLOU
-M\/SR],;=T]95U-W9TM31V-O04%]>6D=$7U)?6UY6T]G%PLC(S,+"S<S"R?/E
-MY_G/5DYS>&1F86)O;V-Z2E+?S/?V\_G[^?WUQMO<T=32V-C47D5%145:6%Y;
-M1D1>4=31W=C$QL/,SL#8T]+;P,OPY.+C^LE51G=X86)O:Q45:69P1]?,\?S[
-MY.;FY?/)Q=/4T=_255-?4E71WM[64%I-3T)"0D-'7]7<V\#.RO7,Q][2T=#1
-MU]'=P/OO[N?+675S96%F9FT5%!5C<$73R_#R_/_EX./G_O3$W=["]_7307=R
-M?WU+6E!>3$U>UMG:PL[&T534V</!W5=<6EM0W,''W=?9_>+KZ.#P57=D8&-C
-M;&H7%A1L>UK-_?OEY>3@XN+@Y?;<64-$4U355EQ;7E7;S\S$U41`0D9865A%
-M1D%:4=S$P,#%V=G-\__TU4MS<4Y'5,WP\<C9T-S9TU-`=GAF8V!G?G9.1E_1
-MP/#ZY^;GY?_QRL+;UUE-2TI(0%Y4T=#7U=73VMC0U5%24537W-S65%;7TM+3
-MT55<1$!#1EY5P?+Z^///WE5;279]>&=C;6!E=U[<S_']^?KEY?O_\<S9UE==
-M6$1`34!84=?2W-+4741;5E=15E)1UMW9V-C=W=C;WM907%U04EY;6EA1Q/SA
-MX^;\QU).<WAD9F)N:&Y@?5G&\?_[Y>?AX.;E\\/04%-4U%-!=79T0U]7T=!7
-M7EA<5-1=6T1'4]KU\/#TS,;;V=_14%M#24E,1EE<U_7F[N[A\==/?V=@8F]J
-M%!1I94;!_>3AX^+M[.+D\-M<34M)1%Q<6UM3TL38UE9?1DMW=4]#34-$U,+U
-M\/[Y\\C&VMG=545+=W9+15)17=;RZ9:7[<E/>&!L;VD5%A$48T'+^>3GX>/M
-M[.+ES%)"0EA04UU6UM_&S\S84DIQ=G1(24MT=4?7P_;QRL[,S<CUSL?17$1$
-M7E?54%A!0E[REYR3XU)[9&1M%183'1-J<<[R]O#E[>CHXOQ4=W54QME36=7(
-M^>?F_M)U<W=*<&5G97U)5\',Q<7)\O[S]</27D195E980%M5T=;5SY6:F.)U
-M86%G;!<1$QP09<;VR\[PY.;DYO],9GA5]O;$Q?;XYN_IY,1;3TAV>F%B;61%
-MVME55]''P\3<4DQ?P_3,V=S:PO7WP%-&7D9RTYR#A^),8103$!`9!!YG]?/\
-MY_[:]^#AV7AF97)4Y.#R\^R4ZNWG]4IE?')A;&1P3M/PREU/15A(=$!97]O]
-M_O?TS]'5P<C94%AT<>R"B9G=;1\%$A0>!QYE\>'NX49ZWN7#175F;73_X^3X
-MX>_JD9?E4$E\86%D9V1.S/WVV4YD9GYV=T7>]?_Z\MU;65'4V][4VL;=EXFU
-MF4$6!P82%1D$$5[Y[NO?;F/;\\77<&ABT^7GY^?AZ9"3[-9Q965Q0DI*4,/"
-MT$YG;&!P6%31WL#U],177=#$W-=11T11V9&*MH1U'0`!$FD=!!?!YNGC>Q!I
-MW.7\P7!J;U?\^>?F[923EOY"2T5%3W!_0\C]QDYZ9F=^<'%/5MG!P,?%Q=Y3
-M1UM05T5?G+:PFV@&#@=B218%:>7N[]\2&FWBE^%>;!9O4]K>_.R1GYWB2F!Y
-M05-44-KEX_%W8V-X05)'2D)?75Y%1U/6557407U_1Y.VO8$4``X'>U<4!!3O
-MD.E.&01AEI+G9180;%/52\R5F86=\V(584)7T<?]X^+986EF1O3VU7=T0UM9
-M65C5S,]7=V5F?)"QO8<6`P\;3400!&CID.9C&QC5GI+):!,5=MM'=OV0F)_B
-M?&IFUMM,2-/[[.%;8V12PL9<=W=>T5E,U,_.V4-Z9'A"F+"QE1D#`A#5>Q\;
-M0I&75188%>Z%ZGX6$VY/07?0ZYN$G\41'Q1WP]G2\>'A]'%E0?WF\D%E>TI>
-M5<7Q\L9Q8&)QA;.VYA@&!A9R$0<9R9#L>Q(=39*:YF-I87Y_;FI5G(&%Y6%K
-M8$U*8&'&Z>GW?6!:Y^#U14Y1U$AF9D7ZYLUW?_Z,L8-A&!X29VP'`!/\Z_!E
-M%&#AD>Y-8'I`?&QH=NN8G>#<6$1`>6]M0?CG]E%;P>?G]%U:5=Y9=GE]6\+%
-M1%>=BXGK;147;WT=`01O4-!U8VW,E93D6'E#U'=[?DO+XNWER]A75D5)3M?)
-M\/;,V,OP\?7+Q=S=7W5T2$Y,1\:5G^Y%P_G0V-5O$6YF:&]A;6!T65W:]?'S
-M]O#_\<GTS]/44TI.5=!?6%+4P\O=4]+/]O'.TM?6T%=;0T32X)7TTNJ7Y?S,
-M>V1=>A84:VMC9VYH87Q%Q,K]^N7AX/OW]LC>W]!91D9&15;>Q,CW\?3,S\C>
-M4E];2W90YN%:RI;K_^?U?T[<8!=I:&MC8&EM>79`5-?8]_KFY//V\<[&Q%=$
-M4E34QL_9WL_.S<G)PL/;5T=.2-WMX%_[D.W+_5)A=%]H%FYH:V-@;V=*6-?<
-MT<W[Y_CWV=W#Q554TMO(]\?6TM_']_;.S<C!V--<3%[_Z_E-X9;DP?=,9U-:
-M%!9O:&IL:15B=U+0U-CE[>?\],;(]ME;4M#=V-Q0U,/U]/;*P\S*P-[2T,/B
-MZ\?9E)7#Q=IX94%M$Q1B;V]M:6]]7U1>6\CGY?3"W,7\\5)9WL7:QM+4SO/Q
-M\?;+]<K'W]#2^NKZ5N^1^MC*2&9*>1$0;VX5:6AH95A=4];TYN?WP<W&Q=U*
-M<%#:U-?;P_[AY?;]^?/TQE!1\.GBW?^6Z<K(UF5X<&H3%6P5:F]H8$I`3EK8
-M_?OWQ<'.S]M;2U;"WE7<P?;Z^_'S__#*R<7.Y.[LQ.*>E?S4=7YY8AD;%&@4
-M%VQXUOG`1<;A_$!Q7D1S9&5Q7D5.V>?MYN?M[N'WP<C"QI6&F/OLD^AE:FD5
-M%!P;'!5L%&W3Y/76Y^S">WQ,2WEF>]+:2G#?],33]^;C^_#_Y?30V_#YZH:&
-MX^N<XFP78A8?!1L6%11K1_GQS/SK[T!F0DMN:F1W2W9(P/#5U?GAY?C[Y_O-
-MVO#\\>V'@.CIF95Z%&,5'@4;%A83%5CRU-#FZ^-8?M]?:VIV=69X4]I60L3G
-MY//EXN?\\?#\]_.3@Y[\GY[5:F1D'!H8$10?$W+UU57_Z>C%<,96%6I"=FQD
-M5-A'=-GE]L'DXOC]^OC__O[KA(3EEIKR;'IU$1H>$14=$F7>0''YZ>?UT_31
-M;V]#=FIGV%MS3L_UUL+FX?3]X>3Q\.:6A)GGGYE09E!Q'QD1%A`>%W!Q>]SG
-M^?OZS-]89F9T9V]P67UPT,?9POOFY?GFX?SRY.^=FNOKF.=Z0ED4'A$7%A,1
-M97=Z0?S]\^7QVM-Y9G=E;V5#<GY%UM/?]^7Z_>3B^O_@[9&%D.V>E79+4FX?
-M$1<6$!!C2W]U]OO\\,+U76!E269N?DU_=%73T,#XY_/]X.'\Y>/LDYF5E)S[
-M2M)T%AT7$1`0%V9^>%'Z]L+AYU)&47-D9&5Y>7U#45G0\?/P_/KE^/OZX.J<
-MG.Z3D]M2W&43$!03$!%I9&5US/OQ_N;/UTQY?V=M9W-Y?U76U,K\^?C[Y^;Z
-M^^#ID)V5EI/]7L1Q%A,4$!(1%6!G<]CR\?/A_U+70V5[>&9F?'-(757)_?SE
-MY^3DY^?F[I.3ZI&1]M+,<A<1%Q,2$!5B87/1]O?SX_E5VU)\>7AF87I^2EI?
-MSO[YY>'AYN'FX)63E^Z0ZU7%W6$6%!03$!9I8&=/P?7)Y/O;VE]T<']Z>WQZ
-M<$9-U_?P_^;FX.+AX^J0D.J4E_=2V7(5%VH6$Q9J;6!QT\#U__/)QTQW27QD
-M>7-X<D%;U<G\Y>?F[>WAX^N6D924E_A0WW,4$141$A85;F!Q5=K)^>;)V\-U
-M?71\9WEQ?$I%7\?V__KFX>;B[>Z7DY?JEN%4V4)N%Q46$Q$4;F-X1<#T]N3R
-MP-U-=7QE9WMX971&6MOP_^7@X^#B[>^4D):5ENG$Q=5C%Q47$A`7%6EF3E3;
-M]_OVQ\U8=$YP9'EQ>7-;6-3(_/ODX.SCXNF4D)&5D>C8P]EC%FH7'1`4%6AF
-M=U[<R_CRSL=66TYP>7Y^>'!.0=7*\_GGX./B[._KEI"5E93ST\)V:Q5H$!,7
-M%!5M?4_5P\KQ]=A14D-S<G!\?G9/35/']//EX^#M[^^5D)"5EI?TS\IY%6@5
-M'1`7%A1C<DM6S_SVS/=53%M.>WYV>GE,343$\_SEX^+M[^B7D):7D>[*_=MA
-M:F\7'187%A5G?''?\,+V_-9;UD%Z<W=E>$IU2M++]_GFX.WO[^N6D927E.3T
-M\4)B;&\1$107%VQZ?TG>]\/)\MM$5%)X>'1Z9W1,=E7W]OW@XN/NZ^J6EI24
-MZ?_VS7UC8VD6%&H4:V%D<D!5QL+-W]Q1075V<W)]<G1)6-_.]OOAX^SHE)>6
-MD93KX?[.261M;A07%!058F=Z3EO0V<+9U=911G5(<7-W2G5:W<;T^>?A[>[K
-ME9>7E.OC_/5<>&-O%1<5%6IM9'E+1=#%P=+6U%M#375P='5W25A1V?7R^^;B
-M[.B5E)>4Z^WE\51P9FUK%145:F]G97!84]3!V%+1TD).6G1R0T%V0-=5V?/_
-M^>#O[^N4EY25Z>?_Q$ME8VD5%145;F%G>4U94,'!7U3>1'5<1G--7'5/T-#6
-M]/SRY>WL[I67E)7HX?[)7']F;6@5%15K8F=[=D%1T=S5U=9014=&0DY!0411
-MW-C,]OWXY^'B[NJ5ZNGBYOS:0WYA;VAJ%6MO8V=_=450W]C3UM-76UI$3T)%
-M6EA4W-C"]O+XY^#B[^N5Z._CY/'72GM@;&YH:&YM9GM]2D54V-G0W=)01$1"
-M2TU!0T54W=G`]/+XY^'B[^OJZ.SCY_#=37YA;6YK:VYM865]=5I5T]#2TM11
-M7T5`0D)#1UE6TL3.\?_[Y.;A[.CH[^+@Y/'=0'QG8V]I:6]M8&1\=$-3T-'0
-MW--55U-%1T=#0%M3U=S'R_/YY>;@[>GH[^WCY_/;6'!E8&UN;F]M8&1^<$]3
-MU-3?V-=75EA`0D-,0UI95-G&RO+YY.'C[.CKZ>SBY_/81'UG8V]H:&YL8V=Y
-M<$U4W-/;P=_7U5]`1D!/0T585M_'ROWYY>'C[.GH[NWCY/;=0'UG8&QI:6]B
-M8V1\=$=4W]G8V-)775M"3DY)3T1=5=G/]_SEYN/OZ.OK[N+F_\9;=F5C;&YH
-M:6]M87MQ0U?8Q<;#V]%66$!"3$A/1EI0W,'U_.7FXN[HZ^CNX^?_Q%AW>F!M
-M;FMI;V)A97)`UMS%]<C&Q]U?14=(=4]"05W5T\/P^.'M[^B5ZN_BY_'307UF
-M8VUN;FQM8&=X<TU1W<3"S<;:W%%$0$)-04=85=G`]/GFX.SIZ^COXN?RVEMQ
-M96!B;VYO;6-F>GUU6=;;PLS#PL'34EQ91T9$6E/0V\G_Y.;C[^GN[>/D\L=?
-M=GIF8F]O;&)@9WAQ3UK5V,3"R,/&Q=%755-975!35=#2R?[X^N/O[>+@^O',
-M5W5]>V9A86-@9WI^<4E!4-S<W\7%V=C<U='=55%45E30W-C)_?CXY^#AY/K\
-MS]Q00W!Y96=G9V=D>7)T0%A7V<7;QL3>WMQ545=37%%75M3=P?;S\^7AY^7E
-M_<O#UD-U=WUY>V5E?GUP=4-:5]G?T]O>U]154E)455=75%71T-W8P/']\O[E
-M^O_]]\;<5$%U=W)_?WYY?'%T3EI=4]?<TMW<T]34U%74UM34U]34T-C-]/3Q
-M_OG]\_;#V-)?3TEU<'!P<G-T2TE!6%W5TM'1W]G35556U='55-'3W=[>V<3`
-MP<#"SL_"S,_&V]Q465I!3DY,3D]`0$U`1%I<4577T-'6UM;7UM;45=545U15
-MUMG-R,KW\?;TRL'2U%%9149#24M/2$E"0$1>4U945%77W-_6T-_1U-/14=36
-M5-73U]32W]S:P\/"R,[!Q-[745)80$--3$)"0D!%6UY24U31TMS9V]W1TM96
-M5=!55M'44U73U-3;VL7,S\W/S,?8TM507D1"3TE)3DY,0$194]76T]W<W-_9
-MWMS<W-/4U=575E555U74U=??V-K&S<W/S,;9TM53649/2W5U2TQ`6U)7UM#3
-MVMC<TM#0T=?545%45U?5U-71W=S8Q\;`S,+&P=K=UE5<6T5"3T)"0D9%15E3
-M5]70TMS?W-/6U]?7U]355514U=74UM?1W]K$P,+`Q-G=TM5>6UM$04%&1D=>
-M7%U7UM'3W-W3T=575E914594U-?7U-?1T=/=WMO$QL'&Q=S75U)81$9'145;
-M75;5U]'1T-/0UM=45E%04EU24%!6U-95U-W2W=G;Q<3$Q-K9W=164EE$1%A9
-M7U-14534U=?3T]#1UE5745U>7UU24%%7U-?6TM[9V,7'Q\3%V]S15%U>65E9
-M65]24%!15-76T=?4U]/44%=75E=75U15U=?0T-;7U]?6TMW<W]_<T]=445U9
-M6%E>7%!65=?7U];1T-/=W=+3UM1445)=4E-05E97U=?6T='0T=?1T-/3T-/1
-MUM;44%-445!145955574U]75U-155%=645%145=5U-;0TMW3T]/1UU545-74
-MU]?1T=?7U5175E%04U-05-?3V=G05EU96EQ5UM#=W=/0T=34UM;0T=355U%3
-M4U!65E15U=35U=755517U=37U];1T]/2W=W0T='755904E)24EU24%965E94
-MU=31W=S=W=W=T]/0T=?55U9145%65E?5U];6UE=15%%05E975%=45=34U]?5
-MU=37UM#3T]/3T-'755175E%645%4U=75U-'7U]7555555%=45%145U=75U35
-MU=35U-;0T]/3TM#1UM7555=655935E%65=;6UM;6UM'755=14%!65U%65U35
-MU-35U=75UM+2TM#6UM'0T=3555175U=15E35U-?4U-?45%9145%65E965E97
-M5%55U=37T]S1T][?W=S3T=?55U%375U=4E%45U34UM'3T]'6U]545U=14U!0
-M4U%14%95U=?0W=_>V=C9W-W3UU564%-65%915U=75%545-355=355%=14556
-M4U!04%%05U74T-+<V=K%Q,3:V=+7559375Q=4E%15E155%=75%175U965E96
-M5U145U=75U914%-65-31W]K'P<#!QL3:WM/7U59275Q91UI?6UM>7U)15]77
-MUM?6T=;7U]'1U-'=T]'1UU=655165E!<75-24-70T]S9VL;"PL/!Q-G2UE=?
-M6$1!0T-`04197%-4U-;7U]?7U-155-71U-?=W]G8WM_:V]_?W]975U%?7E]:
-M1%I$049%6U]7T=S:PLOW]O?U]<G`VM)16T9/=71U=75/045>45=4U]#2TMS<
-MT-'3T-'3TM#3V=O;VMG?W-#65%914E]>65A86UE<5M36T-+<V\3!P\W#QL7:
-MW]=44%A!1D-.24Q-0T187E#5UM34UM/0TMS<TMW<T-?7U]31T=55U];5UM+<
-MV-O%Q\3'Q]O8W]W>V-W4U55=6T1,='=U='=U3DQ`7E%5T]O$Q\;`P,?:V=_=
-MTM!545)=7%Q=4E!7U=#2TMS%P,W"PL#!Q\78WM[:Q]C2WM_44%A*<'%R?WY\
-M<W!U0D%%4M33V\_U]?3V],K+R</%V=%17%]814587EU75=70V<3'P<'&Q-K8
-MWMW6U]G$WM/<W]?55%A)=7=R?')R<G%+34-%4=/<QLC*]?3UR\K)PL3;TM14
-M4%Q?4U%15%55UMW<W-_?W-S<TM?4U5=075Q35]'>WMW>P<#%WM==14=)<'Q]
-M<G%T2TA-6%;7W-O&S,KT]?3US,G(P\3;W=955E-<75-15E=75E=5U-36UM;6
-MT='7U-1445!14%'4TM/7T<7&W]'545Q=14IT2TY)3TU`6UU24E?7T]S9V-K!
-MP\+-S,_"P<'&WM_>T]#1UU545U!045%15E164%!27%]96EI87EY=5-;=WMG>
-MV<3'Q,78W]+4741`0DY+2$],0T9:7%;5T][:Q\##PLS/S\+`Q]O>TM;75U)0
-M4EE?4U?7U-;8V%;7TU)$6U-?141=75E%7U!>7=GTRL[P^?/)]/7>7D5/<GAZ
-M>V5E>7!+35+>P\[Q__S\_/_QR\S;5UM$3$A(3DU&6%/=V]K`S\S"P,;8W-S7
-M5%136U)?3$581D!87E;(R]GP^,+#\,%;4%YS?GMD9V9D?GU]1M37Q_+]_>7G
-MY.3D^_SWP,510$-(<G-V<G-U3T)85=73Q<S(]?3U]<S,QMS45U-;14=!0$U$
-M5=C9VO3*Q\[/W-547DAP?'YE9'E^?W9/05S?P<KQ_OKZY>3E^/[PS\#17D=+
-M<')\>7]]<G=)1E_6QLKT\/+P\O;.S]K<T51=64=-0$);W-Y2]??1]<O'T]56
-M37=\<&5F>F1E>'=)6M'`]/;XY.3GX>'GY/ORR,?06DMP?V1G9V=G97QP2U_7
-MV,_W\?S^__G\\O#US<725U=>0$!"1E]74]?!V]W'Q--44EA*<7!_>GI^>7QQ
-M24!;T<7"]/WY^N3GY^3EY?_Q]][47$IT?WMD9F=G9'I]<4Y?5,#+]_W^^_KZ
-M_O_S],G$WU9<6DQ,2DA874+5Q%S$VMG>7-]>34QU<7ER?GQR=DU+7=;<QLGP
-M\/SY^OOX^/S_\?;"W-=$0'=Q?'A^97MY?'-Q24Q6T=C.]?/\^_G^^//Q]\['
-MW-=21TQ/=W5&6TQ=WE_1W-W;4<746U]`37%T=W!V=$-)6U35WMK)R/7S\OWR
-M_/+R\/7UQ-/76$%(=G)^>7M^?WUQ=4-;U-G#]?'R__G^__WP]</$W-52141.
-M0%A%1UC24E?9U-U2UE=-6$])=W1(=G5)0$!:5572V\W(RO#P\/#R\_;P],W.
-MQ]!57T5*=G-X?GEY>7QV=TU9T=K,\?/]_/G_\OWVR\W'W=126D%/6T9,45!2
-MU='355347$%'375W=W1V=TU#05Y7U-/:S<GT\/+R\O+P]_?WSMK!WEQ36TUW
-M<71^?GU^?')T=$]3U-_,\//\^_G___WQR<W&U%520%A>7D1?5T5245-06519
-M3$%(2G%V2G9(0T=%7]36W\;)]?7Q\_#P\/'U]?7+S=G?U%Y=1TMV<'!^>7Q^
-M?W!*3D77V\'+\O/S^?_R\/#*QL3?TU;7T5-0WU5=WE]56T=6<$EV?7)[<']]
-M=$Y:6]W>V\GU\_;R_OW\_?WQRLO'V=[2U%]81$AV=G!]?'UR?'!U2D)>5=/%
-MR/?V_?[S_?WV]\[/Q\7$Q]M6SM9<P4'1375<>W9^>WEG?7I]<'5%0=[:P_;Q
-M^?W^^O_^_/WVR\G:T5=04D5`14Y*3W5W='5U=$I/3D]$6%_5W]K-R??Q]/+V
-M]?3/S<OQS<WVS]K8Q5=91D)Q>GQE9F9G961_=$A'U<#-]_[[^N7DY?GY__?#
-MVM!31$Q+='=U2W5-7D5?5-77U-954%-<6D9$1D9?4E31W<;,RO?V]_?V_OGU
-M_/[!PL3<04A*?&5G96!B9F1E>4M;7M[W\O+ZY^3EY.7]]_3`5T5&2'-Q='%V
-M35M;4=[%VL++R<W,P\73TM%=7UI`2$A(=$I+3TU&4E'4W\?"S?7USL_/P]K:
-MQ=K%S<?9]=;>QEG43$-T?7%Y<']V3'5=4-;9P?7-RLK/PMG;W5=44%-?7U-=
-M4%37T-W%Q\'#P,3?W=!545)<6T5%1$9$6%Y=5U74U-'=W=_>W-/3T];55%11
-M4U555-/=U]S?U%116T19049"0EI95E/0Q-O(]_WY_?G^\<S!WT-T='EE97MX
-M?W5$4M#&]/7T\_;/VMY4149,=71,6EY6W\/.RO'Q],K(Q]-54D=/24Q,35I=
-M4U72WMS=WMC3U-=67UE8141;75-7TMC$Q,;'V]_2U%%=7%Y87U)65='<V=O8
-MV=S0UU104EU<7UU34594U-'0T]#3T=?45%!275U35E35U]#2W=+3T]#65E;5
-M5U35U-?4U-34U]35U5564EU275%55%35UM'1T=#0T]'6U]555=55U=74T-#0
-MUM155%=74UU34U%45534U=;2T]#1UE155%975U355=??TM?4U%545%975=14
-M5%175]75U-75U=7455=45%755=77U]'7UM'6T='1T-'1UM555U=75U=65E=7
-M5U965U75U5555%9455175575UM'3T]31T];7U]55U=77UM=55U=455545E97
-M5U965%35U-74U]?7U]555575U=74U-?4U-34U]?55=74U-5555175U555%74
-MUM;7U-545='15%)3T-=15U;5T5165-?0U5!65=755E71UM#5U]W3W==6W574
-M5%[04%747M-65-50UM37U%75U-17UU74U%'45]775-55U];6T=/2T]#4U]?4
-MU59=4E'545)15]'1U]54U]#64%=5U%515%37T-34U-#1U%175=5545%5U-?5
-M5575U]15U=?6U];7U555U=5555145U975%145%14U=75U=75U]/7U-;45514
-MU=37T='1U]?4U555U=55U575U-;4U5=1459145%75=74U=37T='0T=;1UM'7
-MU-155U%14%%65U35U=75U-;1T-'6U]34U-'75]7755555%=5U-?455164596
-M5%145=75U555U=37UM'0T='1U]34U-34U=555%145%35U=5555175E=45%75
-M5=75U];6U]34U=555-555-?2U-74U-755=55U-35U5145575U-?6U]?4U-15
-M5%545%77UM;4U-355%965U965E975=74U]'0T]/0T-+3T='555%65%975E=7
-M5E145=?7U514U=55U=75U=145%555%75UM?4U]?4U]?6U]?7U-34U-545U?5
-MV??.1'QX=E'/]=)3U][!V]5;6-_#Q]%%3D#5Q,78T-37T-921$=>U-G%WE17
-MU=354%U1UMC9UUU:6U/7TM!54U)04%!1U-W9V-W0U5%65=;3T]+1T='7U%=3
-M5]33W-;54UU24-55U=75U]755%!4U=;45U%<75'5UU91T=[>W=%75E77T='3
-MTM#755555-34U-37U%915-77T-!55E=45U975E=5U=555%=4U-545U914U'5
-MUM/1U515U]555=37T=S<T];55%95W=_1UM'4U]#45E!045964U]?4E95U-;4
-MU]'0T=555%=7U=;4U=755E-34E%5T=_8V-_0U]?6T-S2U%9045?5U=74T=+6
-M5%E&15+2WL7955-'1U]6T-C,P]]?3DM'T,+"TUA"0E[6VL+"P,;?U5!=757>
-MV-S65U!34U];7U7<W-537%Y2U=S>T5%=4E36UE134U;7V<S(QM1:34-2W\7=
-M5574U]#44E/4T]+0U597U]#0TM#755-;041>4E7?Q\;9W=W<V=U57D1;7E'5
-MU];45%A`1EA>7E]>7%!5U]/'R/7UR\#25%95W\_+VE!$15W55UA'0D-?W,W+
-MRO?*UD]\>7Q+4=;7U-77W<7:WM[%P<716W5T0U3%P]Y30W1Q2E_3P?7Q]\C`
-MWU=%0UK7S_3(VMS8Q\766T);U-)2=7-P=TY3S."6E_]_%1=O2<S$5%Q?4=#0
-M0'5<S_CG_U5R>WQ'V_7/Q=-76W5\?$;+Y.'ER%%!1EA?7%?:R,O:4D9=PO'-
-M5DQ#1%+5U\+&2V-J;$&4A9_Z81878-S-6W59PO7/36%DT>.5Z?-S;&YG2-GU
-M\/SPQ4MG8'G1^N+A\51)2EC0W]C)\/;$74A(5O3[^,5P86=+Q_;)U$UP?WUQ
-M2478[)V?ETT?!1!5X.36>7'?_,-\943FE.OV8Q84>\+[Y/GWS%U_;6-,^>GO
-M\EIR=5[9PLGR^O[6>V!\S>3ERU)/=75U25S$\?35=V5D?%O14EK"Z)*5W6!I
-M84?!77YQW_/(6'-VVN3D]%]S9V%D?DS'__GTTT-W0M3&S,OW\/?$U=#*^?_(
-MT5-05E)#0M3&W$1U=75*<4WMF)_F81X<;7-@%'#AZ^%,8F3&X/96Q?CGVF=H
-M9\'Z\]O0P=QP8V-"\N?D^_KYS4!WU?'VQ-O%V-G35]'9W%!87-3EE.-+8&5[
-M;A1H9DW36'-+V<=24\+^Y?-02=?"4DE7P\C`U$99T%5`7O7X_<[`\?W/Q-Q9
-M5<'425WWSU/5R>R2Z'9A3'47'!1@9WMR0-_)U$G0\,-<U,C/UT1/4MO<U\W_
-MREA$UM'5V_7S^?ORR,OTVU7>VL7;UMS/_>'IX%ER=6(3$FAO%6!!UM3=S<[W
-M]L?$P]1+<4)$3UK?]OWVS,/%5%'$P-S#\<OU^_OQ\_K^P_'BZ^C^7%=V%!(6
-M:Q,38'-^<-#S\??U]/;?2WUV=GEVT,/&]/G[\\KU\??'W\CVS<SR^/SXX^N4
-ME.O\S%%M$1`1'1\1;&%[7?'Y_OSQR])U?G)_9WA$4%+`__G]_N3YR\+Q]L_+
-M\?GFZY>=F>KA[M%I%Q0?!1D2$15@1_'V^^/GR51<?F%@861X<T'$]O;EXN;D
-MX^#E_OGDX^SHDISC[Y?;8&-B'1L<$A`6:7#:T/3BY,[%QTIG9F9F8&=Q4E#7
-M\N7_Y>#AYN/IEY24GISD[I56861C'1P0$!87;4C6U?C@Q,[,<&5Z8&YG9&=W
-M1%S;\/WEYN7DY.&5D9:8FNN0EMA]>6\9'!P>$A!O=L?8XI?S]>;6;6=E%15C
-M9F9_1][.]^;BY>;IZ)20DH2=[9SJ<F%V%`0<'1P<%F10V=N7E\+S[4!J>'H7
-M%V!A8GA?VL3PX^WGXY>0D)Z!G.F%E71A<1`''AL9&Q!M0L;:EY'A\>S);V!Z
-M:Q!L9&-A0L;9RN;IYN.4D)"=@87CFYU:8DEI!AL8&`4?;W;'69>2Y?;J\15F
-M?A43;6=M9T/.S//@Z./CEIR?GX2;DY/OP7IL'1L:!`49$!5,\?WKEN+\YE!M
-M;6(7%F]L8'Q=QO_A[>OKE)"?G(6$D)R1_7-D:P4;&@4%'&IDPLOKE^WYY-MO
-M8FP7$&AM8GU'S?SA[964E9">F9J$DY*6\GUG:`4%&P4%'6Y^PO65EN;\YE`5
-M;6\1$VAN;7Q:].3M[I:6EY*8F9J:D)+KWF9@%@0:&!@;%F19]^24[^7WPF1K
-M;A06%V]L>W17\^'LZ):6D9^:A82<DY#\<VQI&P0:&Q@<8DGUY>OOY_[4>&]I
-M%Q<5:&QZ2%[VY^SNE):1G9B%AYF3G>!V;VX>!P4:&!YJ=_?GZ>GMY]=S86\6
-M%VII;V5/4L[[[.F5E):0GIJ$F)"=[E%M:!T'!`08'Q1ZPN&5Z>'CR'AO8A00
-M%&QB9W51\>7BZ)>7EY"9A829DYSO1F]H'`<'!!@<%'K*X.GLX.?>>FQM%185
-M8F=X2=W_Y.+KEI27DYN$A)R2G>=^:!48!P<%'A-K2OCOZ^#D\D=L:VX4%FMF
-M?DY2]>#O[I66EY20F(2%EI"1_6!J%Q@$!QH=%&YUX97E].7T9!5H;Q47:WE`
-M3E?EZ>KJEY"0EI*%AYR5EN];%18<&P0'&15B;=?I[<O"]5U@%6MB:15B3E!1
-MS>.4EY67D)"0F(>:D9;HR&`6'!@%!P43:&-#YNS_]/73?VQI;6UH;GY$4=GX
-M[I24E):0D9R$A)*6E^5V:Q(8&P0$'A=N?<_\\/S+UT)^8&!@;6-E<4#?]N;N
-ME927EY>3A(><D9#HUF(6'QD%!QH1:V!(V_;]QU950'IG9&=E97Q!P<[^X^CK
-MZNJ5EIN&F)"3D?M^:Q`=&P<$'!=K;W/>]-5?WL1'?7]P=7QY2,S+\?ONZY7I
-MZ)2>AYN1D)#M0VP7$!X$!!X1%A=C0<'51-OVVTQT3EMU?G7.\_/_XNCK[N_H
-MD)J:D9>6ZLUY:!83&04;'1`1:F=&55K5]_#94T=24DUQ5/3\_^?MZI7J[.*4
-MGY+NXN[@V7AK%103'AP0%Q<58G=-3E/,\?7;U\'/V];-\/O^^N;LX^;DY>3O
-ME.GAX>#_TWU@;6@1$A`6%A=J8'-U1M_P_?;-]?[PV-KQ\_+V\OKD_OW[Y?CX
-MY^+CY?GSSUUP9VQH:A07%&ML865P0%/4TL+#]?/TSLSQ\_/S_/W_^/KZ__WR
-M]=O;T,'/PM]545A-<'YY>F9A8&%A86=Y<4]>U\?,R??V\_+\_?C_^?WR_/W(
-MS<_%TM=41$1`0%Q67%%35E%>34E(27%\?7YR=79*6576Q<W*R?7W]O'']/;#
-MR?7+TE1=45)97%_4UM56TMS7T%%25EQ%0D1!04U%T]564-7=75%=T=I5U]_"
-MVU=1UE715535TU32QE+:P5155M#475-'5-='65[$T-W9W\[5Q=S054=7T-!?
-M7%!>6$1:1U#76E32W-[5V-+8T]%07EM?5U+4V=K?VMO#Q-O2VU125M%045U&
-M1U]>4E)8TU=07%?0U]3=V-S?T]1=5E%17]S3VE16W]?2T]O=UE?5U]%74]U2
-M7E1#453475C4T]!3U]_555!145Y<U]?3T-K:U=+8Q-G=T]/5UU-74E?47UU=
-M4D5>4=5%4]-4TU75T=_7T=Q4W=C?T]?7U5;75ME5TU36W=117-974E=27%9<
-M6U!0U%+5U-;<U531T-?35<36T]34T=%3W-#7U=955UQ6W]'<T=%355-275Y<
-M5U1:5516T=#65M355]17UM95V-91W-/<WM76T-;05])6U==4U5=65-74UU-4
-M4U'55]==7UQ6UEU7UU76U=+75=/<T='95]'1U]?5T-9455;15]!75%5=U-75
-MU5355==4U]17U%955U915U104515U-?5T-_3TM?2U]37U-74UM=75-?65E15
-M5=175E=5U%75U]755%575E975]76T-'1T=;7U=555U9755145=?1T=;4U-75
-M5=75U=?5U=755575U=75U=75U=?6U]?55555U=755E;4553555555%15U=75
-MU-?7U-?6T-+3T=;1UM55555645!045965E=45U=4U=36T=#0T=?4U-37U-74
-MU-37U-3555145%=14%9455555-70UM76UM36U]36U]?5U5555%755=74U]34
-MU]34U%575U145=3555545=75U-34U];7U-74U]?7U5555=75U5175U=5U=75
-MU-55U=75U=74UM55T=35U]34U-7555545U=45%145=34U-55U=?4U=75U-?7
-MU5555=74U=?6U]35U=?455175U175E975U965-74U555U=36UM#3T-/0T=;6
-MT]9455175U=75E975E965]77UM?4U-75U-7555545U=75U=5U-34U-?6T='1
-MT=;7U-37U]34U5145U9755555514555555=75U965%55U-165-'1UM'6T=;7
-MU-37U]?7U-34U-575E=75%975U=65U155%75U-;6UM35U5545%75U-37UM'1
-MUM34U]3555755%545%15U5555U=45554U-W3U-;6T\+22%Q<75%4UEU4U]#6
-MU]+?T,7VV5C60$%!4E];4%77T-_:W-/=VMS6WM)4U=165%-44U-65U164U=1
-M4E'5U556W\G!UMI>1UE;1D5>4-?1WL'9U=C%TMW'UU95U=7745#54E-=5U96
-MU5'7U594U=34U]]54]975M/55-S75]95U5;1UE'15U70UU;6UU;6T554T554
-M5%944-305]365=35U-'5U-S45]945]564U%645=5U-375%?4U-?15M7=T='6
-MT-?=W=[?T]/1U=745-5775Q>7%Q87EU=4E915==555-25E-7U=#0T-/<W]K!
-MP<_,SL[/SLW`QL#>U%!804IV<W]_>7E_?7-T24%97-7?V,+UR??R\__ZY^7E
-MX>3Z^_GSP=A637UY9V)B;6UO8F%G>W='6=_.]_'XY^7ZY?CV],+34T5`='=T
-M=TI>6=SV]O#GYN7AY^']\_#767=P9F!B;6YN8VUA979T1-+#]_WDY>3FYN7X
-M_LK:U%]T<7)Y>'YW=$/1]_WS[>WF[NWNY.3DWU=(<6-M;F@4%6X5;F-Z>$C1
-MQO7YX>;C[>S@X.;_]L?=3W=P>F5E>WYQ0U/'__WAZ>#H[>SB\N794W=_86YI
-M%147:6MN8&1R==;%]_[AX^WO[N_BXN3]R,5?='UD86-A8&=]=%G6]>3CY^N4
-MXI3B[N7T^4U(96=J%!06%A%H%6]G<TA1]_GGXY7KZY25[NW@_,'417EG9FQI
-M;V)@9'),7\+\Y>V5Z960Z97OX.%1S7%F;FH6$A,=$1(5:6U^1<?VX.Z5E)&0
-MEI:4Z>;ZS5MR9&(5%144%6Q@975<V_?EX.^4D)>4G^[H[_C[?45@%1$1'1@2
-M'Q$3:61^4OS@XY>1D)"2DI25Z?K%5'%A;VL4%A1K:VQ[=D;!\_CDX^SNZY>3
-M[>J2\.'^TD%O>A<1'Q8?&!<0:FA(4,/XZY3HDY*1EY&5Y.7)1F5F8A04:FH5
-M8WA^0,3W]OOFY?CEY?_E[)3GXY+P_^30<6AD$1`>$1$>;&%]<?KFYNZ5E^#L
-M[?O?S-AZ?'%Z9GQ(=T+<]]W'_<!4TMQ)=41T=D]0U/7FE9*5EYK@Y.)49A9I
-M&1X:'Q$?8'?&V.N6Z)>4E?OSS%!\>')F>W]"753"\OW,_O574UAU?G!S<W='
-MTL7*Y>F0GI>0A?G9_7T1&18%&AL3;!1#_^[ZE)+LX>3X2']]?V5G7-/:\>?G
-M\O_VV4-(='ID>W%\=E7;VLC[^/OG[9">[N"8_F!'<!`$%AT?$A1:<US_E^?*
-MZN=0=-!U9WE(V-3+YNSFY^_STE=T9&!A8V5X=='=P?;^\//]\_SV^9&>^?B>
-M]6E_2!`$%Q86%FG>TU+:E.%6Y>36>$5<24A8^?CU\^#_6E%5<69X3W5S6\K/
-MV?3[]-/U\LW%]^:3G?_BDE058'P<!184:A1FS?#$Q>K@U=KV5V1Q341:7/[M
-MY?;@Y%MV1W=@9G1:0%_+_,K.^?G-Q/?+Q_V7G^/VEN5O%V9J&Q(48F)B1?+E
-MU_/M]EA`U71X<U/TS?/IZ?SW]E]^961E?7)"QL[;]N7_]_'P]\??R>F9EU;K
-ME603;GX?'A1F?V]RQ>;&0.7EV7]/4'5R3N3@R/SOYD5"4W9G87]'6D_=^?_+
-M\.3[R\#T\/3AGI_`\NA?$!-C$!P6;W1S=D;ZYUC5R<YP87Q+4T#&[NOZ_>#]
-M3WYV=WAE<=3>7M/\^<G.\O+UP\ODD864W.S@8QX6;1T=%WM%?'?<X_Y<W/3`
-M9&UE2T%1^>/CYOCWV=5W?'1,=752WMK!ROW]]<GV\<CTZ9B>\L_LT!$>:A43
-M$&A,6W=*\>+T5]?(U6=M>-/?T?/L[???V]],>7!;44]#W,O`V_?X_\/&]/7.
-MY)V%Z\WA_V$<$!46%A9F04A\3/G^WD95R4-F9]3W]_WXYN7%3T)12W]W4=W5
-MU<#]_O;W_/+#V\WPXY*?X=[\TVD=%VL5%6E\65IW6O/PWT!>U$M[<<_SRO?_
-M^_'62T-?2GUUU=S7ULG\_??W\OWW]/'GEIF7P\++>A,=%VIK%6)/U$%VT_SW
-M77596GQZ7_7U]??_^/930E750G1$U=;4ULG]\O;S__SQ]?WHG)WZ5<)9:A\3
-M%6AH:7M3T$-!R?_)149207))WL7"]?7)]=I'1M366416WL?8V,SQ]LG.]OWQ
-M\>R<F>S7V=9@$A(7:&YK8G324TW1\_W52T):3G1$P/_R]<OPR%%)3UU71D/4
-MR<[:VO3S]\+/]/;U]^"0GNG2U=-[$1T1:&UN;7_5TT5>S_S`1$A;U5M*6/;[
-M]MK"]\-?2T-04T!$V?3+V<;S_O;,]_S_\_N5DNC;1EQW:A`1:F)B;&%"V-=>
-MT/?TTD5$1$%95,?+\?;+PL?<5EE>6%A3UMW%PL_.]/+R\?;S\_+MD93V7E%?
-M8!<1%VYC;6]E7--65,'W]\/50'5:W]K1Q_?]]=K2W-O>4D12W=%7U=O/],K/
-MR_#R]\C][Y?MQUC57V=H%!5O9F)N9DS4W=+9R?_QUD)$T\336%_$]L/75-G/
-M]=K4W<W,Q-W>SO?(QL7!S</8T=[U_?501M5627!^9'MS>V9X=TY!1T-;U-/<
-MQ<'.]_3(S,?>WMS1U]515U514];?V,W)PLWU]<W!V]+?S_#(U\3SS]5?3GQ\
-M?6=B9WA[?G]_=%M1T-G!]_+P]O;)P,/>55755E?4U-'>V\'+R\C+RL[#V]W3
-MT\3WSE;9]L5?6$A\<'%D865^>7UR?'9:5=33P_;Q\//(P<G#T-?15%'4T-;=
-MQ,',RLK/S\[/SLG!TE34W\?33T#'V4UU=7!T0G)E<D].2$MT3U#1UM;=Q<_/
-MQ]+3V<79T]/2WL7&Q<7"S,W.R<+!S<S!WMW65-'?WU51T=-=1T-U=W5P>7]S
-M<W!T=$M:5-/>VL#,SL+&Q=O;WM+1T=/?V\3'P,S/S\W`P<''Q]C1U-74W<7=
-MU=G'UUE'=7!V<WMZ>7UV<7%U0U_5T]C#SL_)R,+:VMK<W=_=W=O$VL3&P<+)
-MSL+#P\;8T]575]':V=??Q]!37D]Q<7!X>GE^?'%W2D%2U='?VL'"S,S&V]O%
-MV-_9V=W:QMK&S<[+]?3*S\/'V-!67UM>5=-45-S<55-:2G9V<W]_?')V2TY"
-M6U'6WL7'Q,#/P=_=W]+<V-_=Q<;&P,/&P\G)PL+"PL#$W=35U]_8T]3=TE9>
-M379P<W]Z>WE\<71T2$9=5=+>VLWU]<S`QL3$Q\78VL;'P<W`QLS(S<;&VMC:
-MW%545%70TU55W=)47$%U=G9]>'E_<G9U2$)>5U11U]S8P<#!P<'#S</&QL+,
-MS\[.S\[/P\?%VMG>W-#55576TM'6T-=07D%U=G!]?GY\?7!W=TY;4E?7T]S;
-MP<#!P</"S<S"PLW/SLG)S,S/S\S'V]G2T]14U=545=1445=17UM&3$MU<7)]
-M?7)P=G1+0UI=5M30V<;,R<O(R\K*R,OU]/3TRL_"PL':V-[=T]%545-=7EY>
-M6EI86UI$1D-.=71V<7=T=4A.0D1>4-3<V\'-SLOU]/?W]_3URLC(S,;$Q]O?
-MTM?4U5127%Q;1$9'1$!-3$U`0$%875]-05M!6UU4U%77W=_1W-O<TMG:V<?-
-MVMK&VL?%W]O9V=+=T-#0T-94U5=37%]:7EE915E96U);7%)175)07U9145%7
-MU=77UM33T]+<W-S9V-K:V]K:VM[<T]'5U5175%%645%175E=4EU=7%U=75U2
-M4%=5U=76T=#7U-?6T='6U-?0TM#0T=?7U]?1TMS2T]/6U5145U)24EU34E!1
-M5]755-745=555%37T-#0T='1UM555%;4UU955597U=?4U];45=30T-;7T=W3
-MU]75U]5645)24%=15]?4T-;4U]345=755U34U5=75U15U594U-35U-'4U='4
-MU-76UE?0T=?0UM/7551<5E9355=6U]'7U]?7UM515U1145165U15U577U-'3
-MT-'7U-77UM'1UM?6U-565U114%!645975]75U=?7U=#1UM/7U-76T-14U=;5
-M5U90U=%75==5U5575-37U=145=14U=34U=345U?45-?0UM#75=71U-755]75
-MU=1445'55U74UM51U=145=36U-74T5145%?45U375=545-14UU124U545];6
-MU-'2T-#2T-W3U]355U75UU145U%45%905E505-165E=65U34UU71U]?7T=/6
-MT=56T=+05-33U];455=75595U55045555E=04=345E?5U-?4U]#1U]75UE75
-MU-#05U7545'55=?<T-'4U=#55E)4T5=75-=74]3445=64=72T=55T=%45-3=
-MUUU7T==17-74U575UU95U];45U3>T%77UMW5U5;75='05-105U915U945M70
-MU%35UM35UL#YQF1Y7=%<6=94U=C%V='5U-?2T-;>V=504%!5W=125='7UU75
-M5];245A0U=34UM506UU445?4UE77W]975M+;U]'55-75T5945U-75]?2U5?7
-MT-W05U/7WM=5W=/45=%76E)275504E'3TE=6U-#=U='24-;75]?35U)65U/4
-MV=S34E;2T--45=964%Y65U7=U%96U-;6U%-1U]+75-#7TM!14]?9U5Y875;>
-MW%!<4577W]/55-?>T%=24M7255)6UU16T='15M;=WU584U'%VE%45]944%57
-MTM%24%154E315-565,3;UEY2UM'>5%U15E!5W-)65-?1T];<5%?4W=#3WU5'
-M3U_1W%5<1%S8Q]13T-Q1W/10=TY?5=W17E[1QMO2UM+55];7T-/1T531TMG;
-MU%=17E1=1E+7W-%555-55%7;T]?5U5=;6M;;U4%`65??V=?3T=39WM#1W-#6
-MUMK,TE%&0T5;75K6S,#26%;4U]U?65A6TE=>4M/#P=]67=?15-S35E715%E=
-M5%'555Q<U=O9VMO0UE91T]==5%-<4M'?UM54U5!25E+0UE;54%)4T-W=U]C<
-MUE164%Y14EI1U]W57]';VMG=WM;4U%'75%944E-64U;75555T==4U53=5%%3
-M5M'=WU1=7%;<T-'?TM%65E-24%U1U=375%?4T-S8W]%75='17UA55=;$Q]_5
-MU=?55%)275Q27UQ15EQ97EW4V\S,Q=%36%E0UMO%VMC<U%=7U='1559365A1
-MU=;45E!15E1455=35-75U-74T]_;WM[<T-;55UQ0T-'445E:6E]34-33W-W6
-MU5=5U-35U-;6UM'6UM=55514U]+8Q=K9T]536%E?4%35U%914E)5TMC$Q=C0
-M45M!049>45=745]>1$%$7U=7TMW0V\?`P<?`QL3&QL#'Q-]77D!.3$-%6EW2
-M]^;HE)?H^4QN$QX>$VM\TO+[^?'#V=C`R_3US-A77E]6T=O'Q=+54%U05=54
-M45Q;6%;=S_'R\O#,T%E/=75)0D-%WN65DY^=E/5@'`<&!!UMT.;OXOO827-T
-M7,#P\O?%4T==P?KLZ>SEQ'=A;6-E3=GT\??'U%!<75955%%24E3<Q\+$W]=%
-M271P<%_ZEY^8GI?);!X&`0039?/HE>[Y6V1@94C!^?OPVT1T2U3QXY67E>+T
-M36=O:6)Z3=[+]_7%4TQW<7="4MS-]_?*P]Q475Y?5M/>5$=/UN&6GYB>E=<5
-M!0,#!!%TX)>7[O1];&YF0_#AX.7+679W4O'ME)&6Z?]'8147%&]^5/?X^O/8
-M0']D>G%?P/WY_/?:4D-"1=7#]_'TQE!U=<[HDYZ>ELYN&P`"!A)YY)>6Z/QU
-M;6AB=/?B[N+XWDYV3-[E[I64Z.3:=&!H:FEC?UW,_/CSW$]Y9F=]6L/YY^3_
-MS%='1US?]/S\\=I#96UDSI2?FIJ1QQ4$#0T'$$WNDI.5\GYK%6),_^[H[?]4
-M<'Q(Q.;KE)3O_E-[;!45;F9VT_/Z^_=1?6%M87/=^.WN[?G93G)Q6<+XYN3R
-MT7-A;FQ#[)R:A9WX;!L##0$2?."0D^K_=FD58DS^ZY3IY=)S97U3_.R5E>CG
-MT'AL%11H873$^.?D\%=]9F-F<-/^XN_C_]A#<718VO/E^/51<F%L9,>5GYJ8
-MEMT4!0`#!11;[)&7X\9[;F][U^?IZ>'U17UR1L_FZ>ONX_S1<69L:6]C>$3/
-M_OORVTME8&%_5/SC[NWEP$1Q<$]4R?S_]-=T97G<[Y.>F9;':QH``P012N*1
-MEN[Q<FQN9D+QX./D]U9/0-#RX^OK[^?-0'AA;6)F>W53V\KWS]=,?7IX<5C#
-M_^3D_LK16450V\KV]\)4=7%5YY:<G)'_81P&``8<8L'OE>[GV'%X<D#:\_/(
-MVU!;5<[XX^GH[^/XV4ID;FIK;V=-P__E^,E<<&5F>W55]?[Z^_[PRL+$V-W4
-M4EM`7?+HD9*2Z\5C$@0&!1P5<,W_^N7PS,_U]/?+TD1*=T_1\.'OZ^CLYOCT
-MT4YX8FL5:VQX7\[]_/3214MT3%'%RO;VRL_`QLS)R<G#WM73\>#HE>K@W&05
-M'1X<$!5A<DE8T-K(_N?@X>3VUT1(25S$\^7AX.'G^?387W=[9F!@9W]+7-/?
-MW==44EU35-/8Q<#,R_3V\?;USL??UU9=7U?9S,KUR-E22'AF8&%F9'ER<75`
-M7M7$R_?Q]O3+R_7T\/S__//TP]Q01$Q.3$!'6EA>65M'0TQ.3DQ"041>5-#:
-MS/3Q\/#W]<G"Q=S3U%114UU<7%E86$1!6D5$65Q05-37U-574%U?7EE?4E-7
-MU-'3W=[8VL7:V]C8V]O;VMO?T-1675Y:1$5%1$587UU6U-+9VL7:V=_2T-#6
-MUM'0T]/1UU564%)=5U1045!?65A;65U15=;3T]#6U%555=31T-#1T=;4U-34
-MU=74U]75U-555=55551645=5U=36T]W?W]S<W=/6U5=145?4U-15551745%0
-M4%904E164E-35M?3W=W3T==55U=7U=37UM;7U=31T-/3T]'55E!34%!145!1
-M5U35U-;6UM'6U]?7UM?4U555U=36T-W>V=_2T=155E%375]>7E-37U-14=76
-MT=/3UE545%145U=75E=4U=?1W=[9V=[<T-;45U%045%145%145975%75U=74
-MU]?7U=74U];1UM'6T='3T=35U]?4U=555%=17EA34UU05U74U];6UM35U555
-M5%15U];1T-/3T]'0T=35551555155%=64%%65U=5U=36UM;6T-'6UM'3TM+3
-MT]/0T=?4U5164%)?65E>7EU5U5=55%965U=45=37UM'1T]W<W]S<W-W0U]54
-M5U9645-15E965U75U=;6UM?7U-35U]'0T-#1UM?7U5555=755%1745!34E-3
-M4%?4UM;7UU=7U]34T=;6U-75U-?4U-3455145%175U=75E945=37UM'1T=#3
-MT]/1UM?7UM'1T=#3TM+0UM355%=14%!04%-05E904U)24E-05E=5U574T]'5
-MU-55U=34U];1T=;0T-/2T]'455175E=5U=75U]555%965U145575UM'0TMW3
-MT='1U]545U175%15U5164%!045!04594U=36T=/3T]!55-;5U=?55=74U=34
-MU-3555175E%15U145%=4U=?4U555U=;1T]+3T-/3TMW=W=+0T-;4U%575E91
-M4U)24E)34%!045975U145%75U-35U]W2UM;55U145%75U575U-;0T=;6UM;7
-MU-34U-75U-355%=75E965U35U-34U-37U]35U=75U-?1T-'7U]?455=14594
-M55545U34U-;6U]?75E%45U74U57555=455175U904594U-'0T-#1T-#1T=#0
-MT-;7U-7555175E=75%915U75U];6U]?7U];7U];455755%904U9645%04%!0
-M4531U]33T-/<W=W2T]'6U]3555175E965]74U-?7U-545E9645945%545%34
-MUM;1UM'1T=;6UM155%14U=37U]?7U-?6U]3455=65E!05E965EU15514U-74
-MUM;6T-/3T-#3T-;7U];6UM3555175%=75E%15E=5U=755575U-?7U=74U-?4
-MU5545U975U=75=36UM;6UM?555145%=65%34T]?5UM155=36UM;1T=?55514
-M5E!045915U=5U=34UM+2U=34U];4UM955]31V=E67EQ=55164EA3U]34T-O#
-MWU33V-C64E9?65E?7EI?4E)<4-37W=[>VL3%VMG<T]+=U%-0W=9:5]-35=75
-M7%]44E'=7%K55]124M#7U%;3WU55UM574]?>5%#2U=356]S37-39Q5/?PE56
-MT\744%=<T%!;TE995=105]!2TMQ3UU36U=?3T=W4W=97U%U56EI665M;4D5:
-M7UM=7E'4UM_7Q=G;]<7-]=_`P,/-T-_2UU57U%101%-?0UU81%974%715M?2
-MU]G2T--745E'04Y.=75*24U`7E-0T=#?V\#+RLKUR,_,S,/!Q=G&T]/95]?6
-M4]%65E;44UQ37<575L[4U\%5V%)<U4A*='-^>']X?G-+3$]4W<3+\?S]_OCY
-M__+]],#;U5]`2TAT24)`1%U44MW?VL/&RLS#P\3'S<G0QO93S=E4WG11=7YV
-M>GYG9'MD>']T=T/7W<CW_OCYY_KZ^?/RR,#>U5]&0'5T2$-$1557U]C=Q\#$
-MQ\7%P,O"W/3T5_?3W-QUWG-S=V5^9F5E9WA_=G9%5=/-ROS\^.?ZY?C__<G#
-MW%!;04]W=4M)0UK4T]['Q,/#S\OU]/+UP/O5S,]%RW)22&1T87IA8&5A97IP
-M<4+7TLK*_OC_YOKD^_S_S\W>4EM-3'1U3TY%6]?1TL#:SLOQ_?SE]/KRQ?O5
-MS%=V46=X9F)@;F-M8&9E<G-?5MKW\N3EX>'GYN7[\O3(W5590$AT='5(3%A3
-M5MO%S_;W^>7SY>'T^_3&S790?&9D;&UH:6QO;69Y?D)6WO3VYN;GXN#AY^7Y
-M]\S944=`2G=U2TU!6-35WL#!]//]YO_^[,KE\MOW<5]S86=O;Q5K:VAI;'IE
-M2]7;\/_@X./LXN+FYOCQR]Y71DYT<7%W=4E86E3;Q/'R^>#A^N_F_>;&]45Q
-M3V)B:6L4%Q04:FAF>'W6Q/'DX._NZ>CI[>/D\O727TUS<GAY?W]*3UG6V,OP
-MY>3AZ>;AZ?[E_=W??G)F:&H4%A,6%A1H;')V5_SEXNZ5E965Z^SGY?367W=]
-M969D9V1]=494P_3R^N/M[9?LXY?YY_]4T6=D:1<0$Q,>$!,6:&QT6\SF[I67
-MD)&6E)7L^_?>3'YE86QO8V9G<5W2S/[DYNSKZI20[^J4R_G=<61J%1(=&1\?
-M&1$1:&9.SN7IEY*2DIR0E>GGPEAR86X5%145;V1]0<#XY^WKE964D9:0EN>7
-M^T_%9&\0$1\:&`4<&!)H8G#%X^R1G)^9G)V0Z?G*3V)O%181%A1I8'W6SN7O
-ME927D9>5E964Z_OZX7)]>6@1'1`9'AD=%A!M=ES:XY7KD)V2D);KY<M*>FT4
-M%Q<4%6)E=]/TY._KE9:4ZNCLX>;NZ_#-Z-)E0'MH$Q<2'!X?%!`79E98S.J5
-ME9&=D)7KYLI-96-K%Q1K:&)\6MO\X>B5ZY27[N+CY>7OZ^7*XOQ]>WQN$A(2
-M'1@9$1448]SQ_>Z1D9:0D.KF_=Q_;6H5%Q=K8'Y(P/K@[^N4E>OOX^3QR/+N
-ME?WWE^9[2D=L'1,2'Q@:$6H4;,7[_^Z0DI:6ENO^7$UE:A84:Q5L?=+`_.WJ
-MZ^Z5ZN#Y__?05/N6E?#BD/I]=W45'A@>'@0%$&UO9?GKZI2=GI.5[^#=9FYI
-M%A(6;V9[U.7M[^N7E^[@X?C95%)$T^R=ZN62DO5P2&8=&@0%&@8%%&=GUNB0
-MDIV?GI/@\_5Z$1$6$A`595+)_^B1EY64E>/RQM!:?'Q>X9Z7\9F8Y4%1?!T9
-M`0<%!@83?F?<Z)V>F9R<G.;27&00$A,2%VIFW^;DZ9.3E.CNX/)>2D9V>';S
-MG)KMEH23VGMZ$1@``@<$!@5@6?7MDIJ$F9.=E,-Z;!<2'AX68V1-Y^N5E)"0
-ME./\_=IQ?'=V2\&0AY"4FI[D>6,0'@8,`P0$!!=T\>R6GH2$DI&7Y'-I%A$2
-M'A-C=$7RZ)>6EY>7Z?[#VT%[>')W7>V;G.J<F974>!43&P`#!P0$'&Q%^^B1
-MF86>DI;OR'!H%A$='1=F=]KE[Y21EI>4[^7QW4]W=W1TW^N?E>^0D>1.9A41
-M&08&&AH;$&-9_.*5G)F=EI3N_4]C;VX7%FEE3U?/Y.B5Z.N5Z^#\R<S0='QU
-M5^3HY/KHZ?%=<&!O%AD9'1\?$6YX7,?[E9:5ZI3HY\U'2'%A;V%^<4E=]./O
-M[.F5Z>#^]<C<0G9T35+Q^<OQ^OS867-E8&H6%A<6%&AC?UG8\N'BXNSBY_CU
-MT5%`<G-*0E;8P/[GY.?G^?_]R\3>U%A81$%!U\C*P\C(Q5=.?7AD8VQO;6)@
-M9GQ)7]7!]_/P\?/__<S:Q]O0W=?%]<[T\_SR]\CU]MO<V-!26$1&45E=W<30
-MU=!54D)W<'9]965X?GEX?4E%1T37WL7-PO'\\?3U]?;S]_3P]\',],_:T-?=
-MT-!7U5147UA>7EA87EY645)97$5!0T),3TIW=W=P=G9V24)<U<#+\??P_O[Q
-M__+V]\_(VL[:VM/055%34%104U!55E)!34U"3$-;7%'45E;5UM/75%Q'2$I*
-M=7%V2$=>5-/`R\OT]_/P\,OUR<['Q=O=T%36U-=6U%945U)27UE81DQ"041&
-M7EW5T=#2V]G2U5106$%`0T)`0%]=UM78V\'"Q,S:Q-[?Q-[=UMW<W=/>VMG?
-MT=?05%);65I!04=;6%)<U-3?V-[<U]W645A<65M%65)27U'4W]/3T=[9T];7
-MT%71T=+=TM'>WMG<WM#3UU=555996EE?4E96U555U-/3T=54459=6%Q>4%97
-M5=?1W=W$W][=W=W1UE745E=045905U33T=%5T]%5U55755-24E%5U-'1T=;3
-MUM96U5Q545-<4%;55=;1T]/0W]W<W]/6UM745E!345-65%545-'6T=1455)0
-M4U%34535T=#3W]+2UM;4U]%64U167%U35U?5U=;7UM;1T-#6U%575U755%34
-MUM?4T-/2TM#45U!145!34597U=75UM;6U-35U%564%!75E575-74UM#0T=?4
-MU-37U-544U72T=#0UM=55U%375)34595U=?1T-+2T]/3T]#7U%5745-24E!6
-M5U=65E95U-?6T=;6U];1UM?7U-355575555555545%915U15U575UMW9TM+<
-MT-?7U55645%075Q245965]74U]'0T=?55%965E35U-36T-W=W=W0UU545%17
-M5555551555=65=?6U-545%=65U75U=75U-37U]?6U%;4UM555%=75%555574
-MU]'1T='6U55555964%%7U=;2TM/0UM35U5=04U-15E=45-74U=745=76UM34
-MU-?6T=;1T-'6U]?455114%%145'5UE=65U94U=;1T=#1U]75U5555%=75%=4
-M55145%34UM#1T='6UM?4U];455545E%15]76T=#0T=575E%65U97U=?6T=/0
-MUM3555165E9755=35=;4UM34U]75U-74U=75U-1555155555U=75U-37UM55
-M5%145%545=545%75U-35557555155=37U]?7UM'1T=/3T=37U=3555175E%1
-M5U504U97557555145U=45%755595U-??W-O8W]_0U%36U%74U];3P,M$=%O6
-M07%*=UI9]_S2T-)17%'$TM36V<154=_<4%/=WU/65==55M705E+1TE90UM91
-M4%105%E2T==3U]W5U]#775945=]4UM_4U=/47%1>UM77U=/4UM/4U5?6U=#6
-MT=1<74=65EE15T13WUC1UL3.Q<3;]57=W]#04=5>7TY07UI'7U=;45+45E;!
-MV-;<W-;6T]S15-73U532W-/=VL3;V<7%TM#=UE=37UM-2$AW<'=V<G=*3D!9
-M4-/?V\S.R_?P]/3Q]<CTS</-V=W?5U]4Q/'2Q^?)Q_3(5T)&=GQC9F!I:&)C
-M;&=]24?2\/GGX^[I[^_OYOCSP5UW<GIF8&9F9GEU6=?*\_[GY>7E^?/UR_OZ
-M4_/F5-O(WT-P<7QC:&9O%&EL;VUD<DE(Q?WPY._IZ>KKZ>WFY_3474IE9V%B
-M8V!D?G-`UL3T_^7GY.3E_O+(P-+)\5[&_%%5V]5?2DQ*96%E8VEM;6UM9W)S
-M=-;#S_[FX^SIZN[M[^'\]MM>2G)^9V%D9&1\=$Y?TL#+]O_Y__SR]<W!T5%;
-M6L?0=/;,6O;;R]%7QT9P<W!C86!B8FU[97M+4%?$_/OGX>WMXN/AY/SRP]U>
-M0G1]?'E^?G-W3%Y1W=G,R,GURL_/Q]W?5U=07<_;0_+/5O+9\=S7S$)W<7Q@
-M9V%F86-^9'Y*0UG3R/'[Y./CX./GY>7_]<?75T1U='!P=DM,1EY25-73T]?7
-MU=?7T573WM?2T=?=S=#>^\W*\/3PT\S02'1Q>6%F8&!M861F?W5!6=[T\O_E
-MX.'BXN/@Y.7RR\?00$AQ>WYZ>'E]=4Q%5M+?P/7W]_;TR<O9UE=%1%I435GW
-MU]K/Q,E4P--&141U?WUX?'IX?'AQ=TE`5L7(\?CDY>#FY.7__<[!W%Q`04EW
-M=G!.3$986%]74E/2U=+;P<S:Q,/?TM]>7]967,_;Q?;"\-_`S%A90W5[>V5D
-M9F!E9GES=$56Q\CS^>;GY.#GYN3[_\K`TE]`3W1P<'%T=$Q'15Q0U]#3W]+>
-MTM/0V]W1WU?4W,/$T_;*VLK-S-'7T4%)=7-D961G9&5S<'59457?S,KP_N3E
-M^N3D^_SQPMU56T]W=W%Q2DU;15)45M?5T];5V-[8Q]G9QM-0U%-0VL#0P_S$
-MP_7%V%;564IR?7A@9&=A97ES<$Y0W,/W^?OEYN#AYN#D_OW*VU!%=WY[>GAE
-M>'UV3D=7W<3#R?7)R<#%SL'6W=G=U%35UL#`UO?STL#VP411TG9^?7A@;69A
-M8&9Y=4M>Q_?S^>#BX>/LXN7EY??9UU-T?'QY961[?7-V3%/<W=[`R</'R/7-
-MQMK;Q]A07M#35E_1P<':V<[*V-515UIT<WU\>7MX?W-W2D=2T=C#]?;S\O/S
-M\/;T]<C.S\#%W=944EE:1TU)2TI+2$E/05M>4E?6W=G%P,W,S,/!P<#9UM=5
-M5%5555%=7%]<75Q<7%Q>7UQ?75%75=36U]/3T-+3T]'4U-?1T-;0T-9445-2
-M4%!04U!15-37UM#3TMW=W=S?W]W0UM35U-74U-?445944%)04%9645%14%-1
-M5E914%975=37T='0T]#3T-#45%55U-37UM?4U];6T==445!34E)25M76T='3
-MT]+=TM+=W=#1UM545U1745%14%!44UQ275Q35]36T=/2T]/3T=?4U]35U];1
-MUM55U=34U=35U5555%=645914%!345945%75U];6UM'0T]/0UM?4U-?4U]35
-MU55645965%=65E-7UM75U-?6UM;6UM;6U]?6U]155%%145=45%75U];7U]?4
-MU%575%575U=45=74U]35U=36UM?5U-34U-34U];6U];7U%165E975E965%77
-MT];5UM?7U]34U%545%175U15551555545%75U5545%=645%65-77T=#3T]/2
-MTM+0T=;1UM155U=65E965U9645=55=74U];7U-545U965E935-;5U];6T-'0
-MTM/0T=;4U5545U%15E!24E!15%74U]37UM;6T=#0T-;7U-34U]?7U-755516
-M5E=4551755555U915E15U-?7T='1UM;7UM/55]545%175U975%=45=55U=?7
-MUM?7UM'1UM?7U=555=75U5545%975U15U5555=37U]?4U=74UM;6U]?7U]?7
-MU-75U5175U145U15U=544%%55E=5U-;1T-#3T-#1U-545%545E%15E=45=37
-MU]?45575U=555%175%77T-/0T-?7U-355575U=3555145%975U945=75U=75
-MU5145-305576T='0UM?7U]1555555%7555145%145%555%=4U=74U];6T='6
-MUM'6T=?4U555U=74U5545=755%904U!04%%75%75U];6U]?6T-+<T%34T=37
-MUM?55-74U5575U=64U)15%575E=75%155=75U-;1T='6T=+>Q,[`75M07%%2
-M75Q86D1:7U'5T-W0TMK']/3$Q,/>5%!;=71T=4U'15S6Q\W*R\_,VM=$1%M$
-M34E$65)>7E'=PLW+R<_*R\K&T%135%]+25[65%#6TMC46UY?5UA`6E+:V-#%
-MVMI17U-25%E>6%W35U)2U=)05E?2S,/$V\W"5%Y$7U]%6%+?Q\_`U-'174!#
-M1U[55US4W=?5W-K3T--=7E346UW&P][?VM!04%]?5512T\#>5E506%E$0UG2
-MW%??]<[17%754UY'7%55UM+;V=505--36%?0UE%4TMO%W-=5UM5:15964U79
-MWM;745-75U-6V=Q?7%365%7=V=G=5E-674U-4<3!V,3U]=--=TE"3D!5S_;T
-MP=+3W%=.0U107U;6T=S>75S=TEY<V-Y0U-[8W5%&1=;46U;$P-[57UA17$]$
-MW\#8VL/'TE)&15%66%#;P=_5T-_564)'75!1T,//V-524U5=0EO3TU'7Q<'%
-MW='55E]%759<4]/8W-?5T=[615C=Q===4%177%E2T]C>V\?95EI<5EQ;7-?6
-MT=/=W='=TM;545%04UQ945515]_&V=?45=765U_4V%9'4-_07539V=)47%;4
-M4D!'UM[57=;"VEU<V<55U=#0UE534M;74U7<W-504UQ07$9<T]W5U]_<UU!3
-M5]#05-7=TE14UM'1UM76UE!=4=;0U=':VU5?7UQ86UY=U]G=T=_8TU536E+2
-MUE'2P=K65EU=7%M8U\??5=W:W%1<7U?44%7>W]'1T-;7UUU95E514E=55U14
-MU5=:0T597E]7WMK?T]'7UU17T=_8VL+/Q-W4T-!>=4A25EM<W,_Y[N[^\_)0
-M9FYO:6YA?EO,\/'P_=I%04YQ<T]6PO_EX>#RWM)>>6=\<7=9T,'W\\C.\LA0
-MU=O51D=815)<=75?]9>%D\7^[WX;&Q$2$FEW_NOKX>+OQ6!B9&)J8%WY[>_H
-ME)3G5TYW9&UF2,;[Z9'J^_5/:1,2$!%M=,?FZ>[AY_A0=DE`=G?3S\W.P--%
-M<_^`@'):A>@%`&P4!Q]LW>#MY.&2XF-C0F4=$'#3RO[LD)V7^_#R2VYI9'M[
-M4?KLZ)26[M5@:!$9&1%B<MC@E93IY_W(7G)W1T].WOSSR/#'3GYVE8&4:92$
-M<08151@!%W9U<O?BZ)3TU_GT8!%D1V=^RNSO[.KH[?Q437=X8F9+7-GGEY3Z
-M\<M_%A(6$1!O2,/RX>CK[.3__,)!=D!21E_<Q<?<44A*_YZ<2?";YQT3QV@!
-M''QC$'K@^?SCZ.CF\E!&1&=@?49,6?KA^.?L[?#&V$=P?G)!S\M/W?E<9GQ4
-M9Q5_1GEXVOW=SN;A\_'G_=W?Q]):6%Y!14AP2G=PS9;O6^^<^V'1XV\>8'`3
-M&613;V?^[/'XEY7E^.'^1$Q'<65D<75+6-SQ\??\^OK__<75TTQY?G9Z8'),
-M<W)3Q%?6\_GUR/K\V=C+QEM?WU%$4]5=15=46EI044%;T=S$P<;-S\75555'
-M2$Q-=W9'7EA6W][6W<;85=33U5'5T=?0Q=[1V-K2T]G8W=#<TM=45%=14E)0
-M5E)05%=35M'57UE24EQ34%U25%=15-#0T=W8WMW9Q]K>V-O9TM#1U5!=7UE$
-M15E965-5U-?0TM+0U5==7%!34=75UM_8V]C9WM+1U5=65%15555745)35E!=
-M4U=75E76T=;0TM+0T-;7U5145%!34515U-/=W-G8V][15%);1T9'6EE?5]#2
-MW\7'WM_355-?7%!04%76T]#0T=#0T='55U?4UM#1U]=54%)34EQ=45!35M?1
-MU]#=W-W2T=54U51745%15M74T-+0W]S0U-?45U!34E-04597U=554%#5U=31
-MUM;7U]?6T=;55%74UM#1UM'6U%=645!375)04597U=74U]755=37T=+2TM+=
-MTM;45%%04UU<4E?7U]77T=;6UM'1U]37U5555U345%944%)24U;5UM/=W]_>
-MTM955E)275]<4%34T]S?W-W2T-=55U=75E=45U15U-'3T=?555175E975E%6
-M5U74U%545554U555U=34U=77U%=7T=;0W=/2T]#1T=;6UM?7U5=5551645-=
-M4U%15E?4T-/2T-'7U=77U59555145U915U965%155=76UM?3W=/0TM+75557
-M45175E!65U!1T=54U];45-77U-36U=76UU55U%=05=#4V_%><%9$=UW01=3"
-MWMC#VMW;V=;=W5555UY;4UU<5E97T=;7U==5U]!15=9575Q57%Y7TM75W=18
-M6TAUXY-\>>9S9/3L>7;#<TK0T4K>Q4'W_TMTQ7%YT%)PRN!06N713??2<51'
-M==17WU#WY,7VR-A+7%UZ2DQT<%M64MKWP?3QR<7<U4=;4T520EQ94M+6Q-32
-MQU3;5U=54==<5%A34%S0T=70T-W3UM+=V=33UE9<75125M965]?25U7655;1
-M5E354U145%[45%)5T]17T]C9U5W2T-;1U=3<U%'2W5#5WM50T=%?65Y$15E8
-M4U=2UM[#\-?5PE1$5]!U6=U:7]_64]/&T=S:V-[0U%!64U-74U)37=;1U];?
-MVM/4T='44U7575E0U-555U914%%25M=07]?24%#:VE55Q,35U]K%5US2W$5!
-M5M)71U38U417P]!'5\551E?04=/=5M3<U%??V]76W]%75%175U1?7%517%;4
-M4US655M6T59045'7W=74QMM0W,[>5L3,75O>W$)$Q]9/7=E13-7;4U;1U]35
-M447=P%3?]<G6TO7<1UY47TM,0$Q`05I5V-_7P<O8T=[96$A;45E;U-[2U5?0
-MWE5=W<[85<#TU$_=SEQ"V,A?1]K>4D10T%EW=5+44E3.__'/],O=4EY,=G%R
-M?W="0D7?SMK$R\G:TMO8UU%6U5!<5=/>W-[&P,3'Q]Q545Y$6UU:=75;14E!
-MW-]`6,3,T]?!R,[<7-[WTW77^=YR6\]8>TK`QMW*__K[R=;3TW%F?'=E9G%%
-M35K7Q/7*P,[VS]77V55&6];0W=C;S,W9WLS(T]?>T5]/=G!V<7UT04!'U=[8
-MR/#U]?+SVMW'TEQ<5UY;4U%;3T7!],SV_?'`UU-.='-[>'QQ<4A4UM/:PL_`
-MP\7;V-'6T=%54=S9W]O%Q]G0U514U=/<W]9455!83TAW<7=W0U)14U'`R\'-
-M]O'"P<;8V-Q74M573$M>QLGT_?+\]]-`=W!D9F1E?W!"4-OU]/;P\<C9T=1<
-M34Q84E30W\#/S,S/S,39UU%5W]_0TE5=1DAQ?7!S<'5'4U7?QLGQ\/;Q\,_<
-MW]!<1D9)2UO?]_#S__OSV5-#=GAG9F1Y?7%&T\3&RO?VR=G=T-5=6EW4T=#;
-MS,G,P<#"Q]S54U->1$98U]%55=/04EQ<7%I(='=*0DQ`6-?9P_?P_/SS]_7U
-MQE1?1$-U=4?6VMO'SO3/WU=>6G5]?WUQ<'!)7M72Q\_T]\C)S,'9T-165E-<
-M4-70UM36T]_?W=/0T-;55514U5145EY%049&1D%$7U;7TMG:Q\;$VL7$V=S2
-MT%=?7%E87U-4U]'1UM75W-G9Q<79T59<7EY>6%]<7UU7U-1445-?7UQ?75!4
-M5=70W-C%QLW,Q=G>W]W3TE175E)04EQ?4E!04U!75U74U];7U]355U=74%-=
-M7%U0U-;4T-W2T='6T=15U=77UM;7UM34U]#=W-W=W=+7U5755E%74%Q<4E-0
-M5U545%145U545E=64U%15%=5U=?6U-?0W][>W-W<TMW=W=W=W=%665]<65]?
-M75!6U-#2T];7U5164%!15%175U77U];1TM/1T-#0T=345%175%175%=75=34
-MU-'0UM=555965U74U-55U-;755145E%14%965]375E745=31T='3TMW<TM+2
-MT-=545!14U!65E95U=555=?6U-555E!05M34U-75U-75U]'1U]34U%555=36
-MU-35U=55553555155=55U=?1T=33W=#6U%555%1645155%%05E=5U=37U%55
-M5=;2TU!=757=T-Q45%!25E955=+=W-+0U]'7U5554%!15]37U]3555555U%6
-M45174%95U-;<W]'3T]'1U-35UM=55%-04%!65E555=7555545-76U]'6U=36
-MU-36U%75UM;75%?5U-545%74UM;5551645%5U]'0T=;655545-75U-575U%1
-MT-#3TM'4U5=5U-545E9145%75=74T=545%34UM'6U]555=36T-'7U]?5U=74
-MU=75U=34U51455564%%45%35U5175%75U-?4T=#0T-;1TM+4U]'4U]=175M8
-M65_7V59=W=16T=#&Q=#;VU7155_77%S765Q575U7U=;4T]30T-%74E16U%#<
-MW%O!5U#:7-+65%36UU#:1=C:1,!=7MU23<142O=/7LMUP-M/]T95]7#WQW+\
-M57[C>%;D8?S7?_QW7\]WQ-ES\%=S^G97_67^4W_@<4#[=E_P>_?$?/Q"4_9P
-M5OU^UO)QUMA3W4/U5'7WTW'V57/D<=3P?<;11\=$QEO4V$S>T43;U%O#T%O<
-MUT+U44KWTDK*44#=6,A#2N=EVLY\_DC3RD%7SUU)Q-U.UO9T6,M>6L'8=,C>
-M<//4</Y$=?Y+0LQ81<W60\Y4U]A!Q,5]R?=GR?9]WMW'=];V<-_=6=383,/'
-M<?+1=?!$Q4+-UDS&5E;10%?$3E?3QG!5^GY([F9:Y$5_^E)US5_T<,O.=-K8
-M0]A!QU!#S4!'\G%`_4A9R%A;]W56YF;.^V7^6D7Z8<[R9O=0T5K4P5A&]594
-MT5[:TD?(05S*<,=82,)41O5/7N5QU/9.WMI24]E=V$+.U'WD07#A9\+S9,'(
-M?%3T14O>]$!U],]^]D'(TGW^QV3RP'GP14'P1W'@?G?M>$/D=T'X=47V=U#^
-M9,?]9=[T2E_/5T;U7U_`2<I32/#1==?V6W+^7D3"3,Q?2\O%?]_D>D+@2W[\
-MQG#6T<I2=\+P3TKQ]6;<YWAQYUU\\US82=G!4TY<X&U9[F[;Y7W7R4G'\F'Y
-MWV7W\&10YT)(WL543EKZ='7R5W'"4T?V?<WX8<;D9%;\34?S<<_:=<'`3U7*
-M=][V?%WD9M3Z>5+X9O+U8?3[8]KZ9O#10<'9<_'0?>5.<N=$?>5&1/!/7OAD
-MT/IGQO!VT?EE7N%BS_]OY]9GY=U[]_]@Y<YC[$]E['=Z[7!]Y'1(Y7%UX7A4
-M]G7<UE?;65_(UWWYUGC\TG3UTW3&W4W1S4S"T4#-WTE5V4'7U5Y2Q%[=7%'$
-M4%S3]7'5^4)&PM=4U%%4ST-&^W1V_E9]]M9TRE5!\4=T^=EA_,QD_D]#]T%'
-MPU1,]DO7\7S"R73%S'?/Q$16R$O=]W+*QG_VWW+%PGG/W'CWUT[:VD;8V'?V
-M5GWE7W/E3T'\24/P74G[=E7V==#W1M'37-3?1W?X2'#P5$C(6G?Z07?_1E+V
-M=]+W35W4]$K6VTWT7W?W5G7R7'?ST'#+5$#5ST;;UEW;U=]USL5R_=A[^]1P
-MPM]UTE;55W3Q3T3V2%;]?MKZ9L'P=M_46<E.TLI05LQ66?-R5O1!=<W46E[6
-MTD_-54#U7TS]6'3X0''Y3T[(==#U>O[;>N59=N!Q5^1E]/)G_U)Q^G9%]'/=
-MTW;!0M;56=[16]W94,Y9W\U;S]9U^WU>^6;$W7SQ7G7*1U/:5U/$4]S6VM)'
-MRM18PD=0R4%3PUO?P%C96=#10=Y:0\M31MQ%55%?TTU<WUW;7U[STD[Y04GE
-M3US/2L3$1]+>U5?`5T94VU9#V]5,S=%/T5!`S%M&S-59UMI/T=I=5555QM9=
-MW]+1T<306-C95$52W5U0U5%2TE#344O;V5K:4%C/5-W91]W<5=127=+05U!0
-MU--2UU%5VE7=4E+;7-%21--3TE9=V%?$W%'=7=C?7U775-#3U%13U55?75'3
-M45345M715%?4U]?05%325=#15]S44=)35]=0T510T515T-'55]7755945=;3
-MT-'65=555M305U164U%=4U'5T-?4U574UMW3TM_3UU75U5?55%9445914E%5
-M45745=+=UM;5T=!75=55T=;55%!05U9145?4U]#1U-?45=145-54U='155=5
-MU5165%75T=#6TM+1T=;6U%964U)045-=4%-1U-37T=30T]?6UM?0T-'45%=7
-MU-;3T-'755904534U%55U%=65E%65U=45%77T=355U'7TM'1T==545;5U]+2
-MUM55551445!55=37U=71T]%44%965-37UM#0U%%24U34U-?7UM#6U577UM/2
-MUM144%-04=77U]=555=14%%75-;1T==15=?4UM'2T];55E945=;0UM345U%6
-M5U77UM145U965U7555175-35UM'1T-;45E?4UM/0U%114E%4U-/2TM%75E15
-MU=545E965E94U-1455505-/0T-/6U]54U-;6U%1145?5U]'6U%545U55U-17
-M45%15-36T-'7U-75U];0T]#4U555U-34UU545E!045=4U=545%=75-77U]?7
-MU]#75-;0U-?4U=36UM;45U%05E55U=?6U]555-74U=;6UM;7U]3555145E=4
-M5%=45%145=75U-?6UM?7UM?6UM?45=745=74U=35U=?6UU575]765U=55514
-M55=75%555555U554U=77U]?6UM?4U-555=77UM'1UM;6UM?4U-3555145%14
-M5%175U=65U175=37U]755555U=555-77U];0U%36UM74U-75U=34U=77U];7
-MU]?4U55745965U145%145%74U-;1UM?7U5545555U=34U=355575UM#1UM?4
-M55575E!04577U-?1T=;7U536T51555145%=75E74U=7555155U34UM'1U]?7
-MUU75U-34U%555%975=74U-?4U=?4U=74U5575U355575U=36U]75U-555%=7
-M5554U574UE1155565-75U-34UM?6T=;6T='6UM?4559145%65U=75%55U575
-MU]?7UM?4U]?7U5555%=75%175]31UM?6UM?7T=?7T=;555145%165E91U]=7
-M5=35U=555%74U]?6U-555%15U=?7U]?7U]35U=74U575U=5555175U144595
-MU=34U=36T='1UM34U-35U-?7U-755%=45U=45%55U==74-555=34U576UM;7
-MU];7U-34559645%65%175-77T=#3T=;6U]155-77U]7555=75%15U%545%35
-MU515U51555165U74U]?7U];1T=?55='65=;6U=755%15U=75U5175U=75-34
-MU]'7U%575U=145975=?7U]?6UM;7U];7U]?4U=545E945%15U-?4U]?6U]54
-M5%545E914534U-#3U]71U]75U-555%555%1555145=34UM555=36U]34U-75
-MU];7U=755%35U555U=555575U5555E975%75U=355=77U-74U=74U-34U-74
-MU-30UE955555U-37U]?4U-?4U=75U-355%975U1555155%145U155%1455=7
-M5=37U]34UM#0T]#1U]35U%5745=45%1455145=555%75UM'0T517U]575%=7
-M5E145=74U];1T-'6U];7U%145E!35E77UM35U515U=31T]/7U-155U=75=55
-M5U975%15U=37U%545%=7U=75U=74U]'0T=37T]17U5575%=645945%15U-?6
-MT=;7U=37UM;7U%575U=75%75U5545%55U=34U-?7U]?7U=75U-34U%545E%1
-M45%4U=34U=74U];4U];6T-!5U-'6U];45%175U915E%14594U=37U]35U-34
-MUM'6U]?7U5565E15U=?6U]?6U]?7U]37UM;45U%65E%15U=75U=4U=37UM'0
-MT-/0T='4U-#75U164%%645!045=5U=34U-75U=36UM;6T]+3T='1U]545U17
-M5E=75E945535U575U5545574UM;7U%55U-?7UM'6U-755%=75%175U144U;7
-MU]?1T=#3T-;4U%545U=65E=75=75U-155-74U=74U-74U]34U-35U-55U514
-M5%975%55U]?7T=#1UM?555555=555=70TM9114%;4]#>T597U=?1W=+3T-'4
-MUM#1UU165E975E=65E77T='3T='1T=145U1555965U75U-3555575E=75E96
-M5-36U]?7T=#3T-;45%34U-;6T=;455!7UU145514U=?5U-35U=34U%545%74
-MU%545U%145;5T='7U=75UM;0T-#1U5545U74U]?4U5175E965U165E?5UM'1
-MUM155514U]?7U5%5T];7T-#7U]5645945-755%=45=75U575U]34U-35U517
-M5E=4U=555575U];1T-/2T]/6U-?4U5564%%65U1555=645%4U=35U];7UM;0
-MTM+4U-945-3555164%-24E!755555%965]31W=_>W]+6U]37U-?7U-?7UM'6
-MU%164EU24U%14U-24E)05U=75U=5T=/?V-[?W=+2T-#1UM35U]%545545E96
-M45%75%=45U=5U=77U]75U5555=74U-155%35UM;6U]755%=75-77UU565U75
-MU-37U]?6T-/2TM#6U5=34E!65%=4U574U]'65-154U?5U]75U]'6U-34U];5
-M55165U74U-?55%555%34U-=55U915U75U-;0T=;6U]?6UM=555175%145U91
-M5E145=755-77U-?7U-355]73U];3UU555575U-?7U5545U15U-34U=75U=?6
-MT='755914%!145=75U=5U-77UM;6U];0T]+2TM/0UM355U!04E)=4%=55%=5
-MU=37UM'6UU34T=74U]34U-555-74U]?4U-555%=55%77U]34U]555U965U15
-MU=?7U-35U-35U=7555145-75U575U-5555145=74U-34UM?4U]75U534T=55
-MUU54U-75U-?7U]?4U%545=34U=755%=75U=45515U=74U-;0T-+=T]'7U-?4
-M55114%914%%75%35U=?7UM;7U5555%555U%05-74UU51U-/1T-/1T='1T=;6
-MU%5555145%=75U9745!65U155575U-34U]37UM;1UM35U=34U];7U-555%17
-M5%145U35U-37U]?4U=355514U=35T=#4U-?45%=75U=75%975%75U-?6UM?6
-MT=;7U]?4U=55U=545%75U5155=74U5545U=5U-74U-?1UM55U=55U=75U=55
-M55545U15U=?1T='45E144515U=35U555U-?1UM?7U]555-77UM;555545%15
-M55555%=75%1555545=?4U-35U=74U];1T=;7U%545=77U]155U155%175U15
-M5-?05%=55U155%74U]?7UM37U]'0T=?55%=5U-3555=45E!34U-15U35UM#=
-MW][>W]W1U]545U=455545%145U=645=45=74U55455=755755%%5U534UM;0
-MTMW=W-S3T-?4U=755E-=7%)=4E%75U145%15U-?6TM+=W=+3T=34U-545U=6
-M5E145%145%145U945=34U];0T=?7UU755=73TM34U%=75U175%175E=75U54
-M5%74U]?1UM;7U]'1T]#3T];7U5175E=645%65E965]74U=34U-?4U575U-37
-MU];6UM;4U5145U965U15U5925=37T]/2W=/1U]?4U5145%=645%455145%16
-M5U74U]?4U%545=77U]?4U-?455175=55U=74U]34U-55U-36T='6U]155%17
-M5%1645%6U-=4U=155=37T='7U%545577T=;555555=55U-155%=15M74U]35
-M5%15U]'1UM'6UM#1UM'6U]3755=75U=455=145%65%175%555=77UM=74-77
-MUM+<W=W3T=;7U-3555=14%945%165%145%175%=75U=5U-?4U]?7U-37T=/=
-MW='1U]74U-545U=65E945%904U-34E'5U];6U]37T=_9T]/1U%74U5165E97
-M5%=4U=7555545%155=77U-74U=?6U];755=7U=?6UM?4U-55U-74U-15U-'1
-MT-'455904%914%9645=7U=37U];3U%70T-'3T];55555U=3555575E=65E=7
-M5%145=30T]/1U]555=77U-1455575U%65=34U-55U-?7U]155%965U75U];7
-M55=45=?6U]755%33W=;0T=355%%65U1745975E94U-?45-74T-/2T]#65596
-M45=75%=4U=?6U-?7U=74U=75U=7555=4U=3455=45U=65E=75E94U]'<W][<
-MTM115=55U]355%9145=5U]155U%045?55%915]77T=#3T-?5U=77UM#3T=54
-M5U97U=?5555645=65%75U=74U]34U];7U-74U%145%96U=77T=;6T='4U]=4
-M45!75E%45U=5U-'6U]36T=#3T]/1U%145U965=545E%05U75U]?7UM355%55
-M5%5455545=77UM;1T]/6U]155-74U-74U]1745165E175E%5U-34U=75U575
-MU-74U-37U5=45U=5U-37T-'7U%575-7555=75%14U]'3T]'1T=;4U-35U516
-M5E975U575%145U945555U='7U='6T=?7U-75U=34U-?5U=?4U]37U=555=77
-MU-155U=14%9455=75=375=75U=34U574T='6T-#1U]?7U]=5U=555U%04U!0
-M5M76UM;65U?6U=77T=/=TM/1UM1745!34%-045%65-34U-37T-+1T='0U]35
-M55!24EU24535U-;0TM/3T]'6U-755%1555165E945-76UM355=74U];=T555
-M5E-15U15U=545515U=?0UM?4U=34UM;1UM355%555%74U%565U55U=75U-34
-MUM?7U]575E-05E=55=55U=35U-?6UM;7UM'3T-#0UU-=4U-05E?5U-755574
-MU5165%75U-;0T]'6U555U]?7UM;455=55%914%!05E95U]#0T='4U=36U-?7
-MU]74U-?1U%755%=75U35U%=14%!4T=35UM;7U-55U=37U]?55=37UM?4U556
-M4%!15E75U5755575U-37UM;6U]'3T]/0U%564U)045=5U=545=7555145%75
-MU-74U=545E34T=;5T-+7U];6T=;45%=75%75U=35U]35U5545E%04%=5U]15
-M5%145=76T=;6UM;6T=#1T='755555%155U=04U-05]77UM;7U-;6T=#6U%17
-M5=955]555%=04%%7U-?6T=#6U-37U]37U]155E%04535U-345=34U-34U-?1
-MT-'75=755=74U=7455=04U!65=31T-/0UM35U-34U=555U174U;55%76U]37
-MU]?6U5=75575U]'3T=;455115E=75%545%165U%5U]36UM'6U]?6T=#3T-'7
-M55=04U965E=75U155=745=55U=?7UM'7U]#=U%%15E34U=755%=75-77UM15
-M5U945%35U]#1T=;7U=75U=155535U]?75577UM155U=75E915U555=555575
-MU-34U=37UM/2TM+0U%164U]35%945575UM;6U]?4U=75U-?6U]555%904%!1
-M459555555=71T]W3T=#0T-'7UM;4U5915E!345!04%?5U]?6UM'1UM?4U];7
-MU%145%36T]15U5965E945%545U=4U=?6T='1UM155=77T=#1U-555=75U5=0
-M4E)045975%75U];6T-#3TM+2T=?55%=645%04%15U5545%74UM#0UM505-35
-MUM?7UM155%1455545U=75U34T=;45%35U-?6T=;7U-36U-545E155%=65E96
-M5M74U-?7T='1T-'6T='1UM?55%915E97U-3555175-=45=?4U-15U=?7U-34
-M5U975U34U=755575U]#1T=175U945%75U-=5U=?1TM#1U5155%75U]145U97
-M5%545=?5U-545=;55-565U=7U]%55-'=T]#=TM/7U5%=4%]15%=5U%97S\9\
-M3//7%AWND/K]<$;CE=AG$A/[F9=7Q>MU$Q<5Y7-X0NON<%C4ENST0U!F?WMC
-M96AZ5/_KE>GRWE;`_F%O;VQTVW3:^USW[.SB<&5;RO3"7G#U?T-'=%])R=U0
-M9VS%E9+HT6=E<]?4=&D68=3Q[.KGR\[9QU5"96YV4MO`X>%;S]I24%WPWTY+
-M>G'04$AS\>/G]EE]9V1-U=;YQ\;:]^7==F%Z4/38=DI0S__@QD=>1-%=T$!)
-M=%S"S??`UW=!]/#!>7'4V%1%7];;5</GWDQ*7-=\>65!S<GP_OCS7TQ$7D]W
-M4-I4R?+VQEI31==56-UW>''.X?7<3-Q5=55+6%70S]C=7E'?V59"0$):V?';
-M6]/;4=S"V]]<1W5UW?7+7D+%Q<[.6$Y<S=!/4%A&0D#!],G*R%A+24).6U=;
-MU<[R]-Q2T=E`=W!$4%'#S=E:W\[*]-5+1-?8V%)97MW!V-=>7M934=U61$78
-MV%M%5]'?U5)95=%35T=0Q,/=UMO;V]M<U]K?55]31TA+UL'9W]_4U=521U+.
-MS%M;5M+04%A8UE%6U\#$U5M<S,=75UW75EA"=$=6V=S'R-O#P-134-Q?4UU;
-M1$73U572P\;?W]/5U5501-?66U!64T1;U-G<T-1=45#6W=A74]'7P\?145W1
-MT=;57U-7U%5<4M!67-/34-/2T=?0VM104%]6UU=<T<3:TE];7T5%65'4W<#,
-MQ-715U]87M3<UE35W-[15UY97];;W=!55M_?WE-=6%/=4EI8U-94W=_14%#7
-MU576U=36U]#6U-7455-55531T]G7U5175E!=7-?>5US7T]S=W556U=;15E!3
-M4T9P=$!95-#>VL?&P<'&Q\7;V=_=T]'7U5175E%04%-34E)24U-34U!045%6
-M5U145575U=34U]?7U]?7UM?6U]?4U]34U-34U-74U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-GU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-`
-end
diff --git a/share/man/man4/netgraph.4 b/share/man/man4/netgraph.4
index 9f457d9..8c2d77b 100644
--- a/share/man/man4/netgraph.4
+++ b/share/man/man4/netgraph.4
@@ -36,7 +36,7 @@
.\" $Whistle: netgraph.4,v 1.7 1999/01/28 23:54:52 julian Exp $
.\" $FreeBSD$
.\"
-.Dd July 1, 2004
+.Dd May 25, 2008
.Dt NETGRAPH 4
.Os
.Sh NAME
@@ -689,19 +689,6 @@ The message may have travelled from
.Dq Li Frame1:
to B
as a synchronous reply, saving time and cycles.
-.Pp
-A similar graph might be used to represent multi-link PPP running
-over an ISDN line:
-.Bd -literal
-[ type BRI ](B1)<--->(link1)[ type MPP ]
-[ "ISDN1" ](B2)<--->(link2)[ (no name) ]
-[ ](D) <-+
- |
- +----------------+
- |
- +->(switch)[ type Q.921 ](term1)<---->(datalink)[ type Q.931 ]
- [ (no name) ] [ (no name) ]
-.Ed
.Ss Netgraph Structures
Structures are defined in
.In netgraph/netgraph.h
diff --git a/share/man/man4/sppp.4 b/share/man/man4/sppp.4
index 22b238a..519120f 100644
--- a/share/man/man4/sppp.4
+++ b/share/man/man4/sppp.4
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 30, 2001
+.Dd May 25, 2008
.Dt SPPP 4
.Os
.Sh NAME
@@ -91,7 +91,7 @@ will cause the interface to operate in
.Em dial-on-demand
mode.
This is also only useful if the lower layer supports the notion
-of a carrier (like with an ISDN line).
+of a carrier.
Upon configuring the
respective interface, it will delay the administrative
.Em Open
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 49f030e..09dfc08 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 9, 2008
+.Dd May 25, 2008
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -3530,75 +3530,6 @@ to be used within a jail.
If set to
.Dq Li YES ,
allow applications within a jail to use System V IPC.
-.\" ----- ISDN settings ---------------------------------
-.It Va isdn_enable
-.Pq Vt bool
-Set to
-.Dq Li NO
-by default.
-When set to
-.Dq Li YES ,
-starts the
-.Xr isdnd 8
-daemon
-at system boot time.
-.It Va isdn_flags
-.Pq Vt str
-Set to
-.Dq Fl d Ns Cm n Fl d Ns Li 0x1f9
-by default.
-Additional flags to pass to
-.Xr isdnd 8
-(but see
-.Va isdn_fsdev
-and
-.Va isdn_ttype
-for certain tunable parameters).
-.It Va isdn_ttype
-.Pq Vt str
-Set to
-.Dq Li cons25
-by default.
-The terminal type of the output device when
-.Xr isdnd 8
-operates in full-screen mode.
-.It Va isdn_screenflags
-.Pq Vt str
-Set to
-.Dq Li NO
-by default.
-The video mode for full-screen mode (only for
-.Xr syscons 4
-console driver, see
-.Xr vidcontrol 1
-for valid modes).
-.It Va isdn_fsdev
-.Pq Vt str
-Set to
-.Dq Li NO
-by default.
-The output device for
-.Xr isdnd 8
-in full-screen mode (or
-.Dq Li NO
-for daemon mode).
-.It Va isdn_trace
-.Pq Vt bool
-Set to
-.Dq Li NO
-by default.
-When set to
-.Dq Li YES ,
-enables the ISDN protocol trace utility
-.Xr isdntrace 8
-at system boot time.
-.It Va isdn_traceflags
-.Pq Vt str
-Set to
-.Dq Fl f Pa /var/tmp/isdntrace0
-by default.
-Flags for
-.Xr isdntrace 8 .
.\" -----------------------------------------------------
.It Va harvest_interrupt
.Pq Vt bool
@@ -4061,8 +3992,6 @@ Default
.Xr ipf 8 ,
.Xr ipfw 8 ,
.Xr ipnat 8 ,
-.Xr isdnd 8 ,
-.Xr isdntrace 8 ,
.Xr jail 8 ,
.Xr kldxref 8 ,
.Xr lpd 8 ,
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index b471ba4..4557116 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,7 +1,7 @@
.\" DO NOT EDIT-- this file is automatically generated.
.\" from FreeBSD: src/tools/build/options/makeman,v 1.8 2007/12/12 16:39:31 ru Exp
.\" $FreeBSD$
-.Dd March 29, 2008
+.Dd May 25, 2008
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -300,9 +300,6 @@ Set to build Hesiod support.
.It Va WITHOUT_HTML
.\" from FreeBSD: src/tools/build/options/WITHOUT_HTML,v 1.1 2006/03/21 07:50:49 ru Exp
Set to not build HTML docs.
-.It Va WITHOUT_I4B
-.\" from FreeBSD: src/tools/build/options/WITHOUT_I4B,v 1.1 2006/03/21 07:50:50 ru Exp
-Set to not build isdn4bsd package.
.It Va WITH_IDEA
.\" from FreeBSD: src/tools/build/options/WITH_IDEA,v 1.1 2006/03/21 07:50:50 ru Exp
Set to build the IDEA encryption code.
diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7
index bf9aba4..40c2d0c 100644
--- a/share/man/man7/hier.7
+++ b/share/man/man7/hier.7
@@ -32,7 +32,7 @@
.\" @(#)hier.7 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd June 28, 2007
+.Dd May 25, 2008
.Dt HIER 7
.Os
.Sh NAME
@@ -101,10 +101,6 @@ bluetooth configuration files
gnats configuration files;
see
.Xr send-pr 1
-.It Pa isdn/
-isdn4bsd configuration files;
-see
-.Xr isdnd 8
.It Pa localtime
local timezone information;
see
@@ -548,8 +544,6 @@ ASCII text files used by various games
device description file for device name
.It Pa info/
GNU Info hypertext system
-.It Pa isdn/
-ISDN
.It Pa locale/
localization files;
see
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index 0c944b1..04d59e5 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -229,7 +229,6 @@ WITHOUT_${var}=
GPIB \
GROFF \
HTML \
- I4B \
INET6 \
INFO \
IPFILTER \
@@ -316,7 +315,6 @@ WITH_IDEA=
GPIB \
GROFF \
HTML \
- I4B \
INET6 \
INFO \
INSTALLLIB \
diff --git a/sys/Makefile b/sys/Makefile
index baf5cac..0455756 100644
--- a/sys/Makefile
+++ b/sys/Makefile
@@ -9,7 +9,7 @@ SUBDIR= boot
# Directories to include in cscope name file and TAGS.
CSCOPEDIRS= boot bsm cam compat conf contrib crypto ddb dev fs gdb geom \
- gnu i4b isa kern libkern modules net net80211 netatalk \
+ gnu isa kern libkern modules net net80211 netatalk \
netgraph netinet netinet6 netipsec netipx netnatm netncp \
netsmb nfs nfs4client nfsclient nfsserver opencrypto pccard \
pci rpc security sys ufs vm ${ARCHDIR}
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index e675b73..3ace852 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -451,120 +451,6 @@ device ichwd
device coretemp
device k8temp
-#---------------------------------------------------------------------------
-# ISDN4BSD
-#
-# See /usr/share/examples/isdn/ROADMAP for an introduction to isdn4bsd.
-#
-# i4b passive ISDN cards support contains the following hardware drivers:
-#
-# isic - Siemens/Infineon ISDN ISAC/HSCX/IPAC chipset driver
-# iwic - Winbond W6692 PCI bus ISDN S/T interface controller
-# ifpi - AVM Fritz!Card PCI driver
-# ifpi2 - AVM Fritz!Card PCI version 2 driver
-# itjc - Siemens ISAC / TJNet Tiger300/320 chipset
-#
-# i4b active ISDN cards support contains the following hardware drivers:
-#
-# iavc - AVM B1 PCI, AVM B1 ISA, AVM T1
-#
-# Note that the ``options'' (if given) and ``device'' lines must BOTH
-# be uncommented to enable support for a given card !
-#
-# In addition to a hardware driver (and probably an option) the mandatory
-# ISDN protocol stack devices and the mandatory support device must be
-# enabled as well as one or more devices from the optional devices section.
-#
-#---------------------------------------------------------------------------
-# isic driver (Siemens/Infineon chipsets)
-#
-#XXX#device isic
-#
-# PCI bus Cards:
-# --------------
-#
-# ELSA MicroLink ISDN/PCI (same as ELSA QuickStep 1000pro PCI)
-options ELSA_QS1PCI
-#
-#---------------------------------------------------------------------------
-# ifpi2 driver for AVM Fritz!Card PCI version 2
-#
-# AVM Fritz!Card PCI version 2
-#XXX#device ifpi2
-#
-#---------------------------------------------------------------------------
-# iwic driver for Winbond W6692 chipset
-#
-# ASUSCOM P-IN100-ST-D (and other Winbond W6692 based cards)
-#XXX#device iwic
-#
-#---------------------------------------------------------------------------
-# itjc driver for Siemens ISAC / TJNet Tiger300/320 chipset
-#
-# Traverse Technologies NETjet-S
-# Teles PCI-TJ
-#XXX#device itjc
-#
-#---------------------------------------------------------------------------
-# iavc driver (AVM active cards, needs i4bcapi driver!)
-#
-#XXX#device iavc
-#
-#---------------------------------------------------------------------------
-# ISDN Protocol Stack - mandatory for all hardware drivers
-#
-# Q.921 / layer 2 - i4b passive cards D channel handling
-#XXX#device i4bq921
-#
-# Q.931 / layer 3 - i4b passive cards D channel handling
-#XXX#device i4bq931
-#
-# layer 4 - i4b common passive and active card handling
-#XXX#device i4b
-#
-#---------------------------------------------------------------------------
-# ISDN devices - mandatory for all hardware drivers
-#
-# userland driver to do ISDN tracing (for passive cards only)
-#XXX#device i4btrc
-#XXX#options NI4BTRC=4
-#
-# userland driver to control the whole thing
-#XXX#device i4bctl
-#
-#---------------------------------------------------------------------------
-# ISDN devices - optional
-#
-# userland driver for access to raw B channel
-#XXX#device i4brbch
-#XXX#options NI4BRBCH=4
-#
-# userland driver for telephony
-#XXX#device i4btel
-#XXX#options NI4BTEL=2
-#
-# network driver for IP over raw HDLC ISDN
-#XXX#device i4bipr
-#XXX#options NI4BIPR=4
-# enable VJ header compression detection for ipr i/f
-#XXX#options IPR_VJ
-# enable logging of the first n IP packets to isdnd (n=32 here)
-#XXX#options IPR_LOG=32
-#
-# network driver for sync PPP over ISDN; requires an equivalent
-# number of sppp device to be configured
-#XXX#device i4bisppp
-#XXX#options NI4BISPPP=4
-#
-# B-channel interface to the netgraph subsystem
-#XXX#device i4bing
-#XXX#options NI4BING=2
-#
-# CAPI driver needed for active ISDN cards (see iavc driver above)
-#XXX#device i4bcapi
-#
-#---------------------------------------------------------------------------
-
#
# System Management Bus (SMB)
#
diff --git a/sys/conf/files b/sys/conf/files
index 4b9afc7..4e1dbc5 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1511,62 +1511,6 @@ gnu/fs/reiserfs/reiserfs_stree.c optional reiserfs
gnu/fs/reiserfs/reiserfs_vfsops.c optional reiserfs
gnu/fs/reiserfs/reiserfs_vnops.c optional reiserfs
#
-# isdn4bsd device drivers
-#
-i4b/driver/i4b_trace.c optional i4btrc
-i4b/driver/i4b_rbch.c optional i4brbch
-i4b/driver/i4b_tel.c optional i4btel
-#XXXBZ#i4b/driver/i4b_ipr.c optional i4bipr
-net/slcompress.c optional i4bipr | i4bisppp
-i4b/driver/i4b_ctl.c optional i4bctl
-#XXXBZ#i4b/driver/i4b_ing.c optional i4bing
-#XXXBZ#i4b/driver/i4b_isppp.c optional i4bisppp
-#
-# isdn4bsd CAPI driver
-#
-i4b/capi/capi_l4if.c optional i4bcapi
-i4b/capi/capi_llif.c optional i4bcapi
-i4b/capi/capi_msgs.c optional i4bcapi
-#
-# isdn4bsd AVM B1/T1 CAPI driver
-#
-i4b/capi/iavc/iavc_pci.c optional iavc i4bcapi pci
-i4b/capi/iavc/iavc_isa.c optional iavc i4bcapi isa
-i4b/capi/iavc/iavc_lli.c optional iavc i4bcapi
-i4b/capi/iavc/iavc_card.c optional iavc i4bcapi
-#
-# isdn4bsd support
-#
-i4b/layer2/i4b_mbuf.c optional i4btrc
-#
-# isdn4bsd 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
-#
-# isdn4bsd 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
-#
-# isdn4bsd control device driver, interface to isdnd
-#
-i4b/layer4/i4b_i4bdrv.c optional i4b
-i4b/layer4/i4b_l4.c optional i4b
-i4b/layer4/i4b_l4mgmt.c optional i4b
-i4b/layer4/i4b_l4timer.c optional i4b
-#
isa/isa_if.m standard
isa/isa_common.c optional isa
isa/isahint.c optional isa
@@ -1814,8 +1758,8 @@ net/if_media.c standard
net/if_mib.c standard
net/if_ppp.c optional ppp
net/if_sl.c optional sl
-net/if_spppfr.c optional i4bisppp | sppp | netgraph_sppp
-net/if_spppsubr.c optional i4bisppp | sppp | netgraph_sppp
+net/if_spppfr.c optional sppp | netgraph_sppp
+net/if_spppsubr.c optional sppp | netgraph_sppp
net/if_stf.c optional stf
net/if_tun.c optional tun
net/if_tap.c optional tap
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index afc7a91..292d273 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -366,83 +366,6 @@ i386/svr4/svr4_locore.s optional compat_svr4 \
warning "COMPAT_SVR4 is broken and should be avoided"
i386/svr4/svr4_machdep.c optional compat_svr4
#
-# isdn4bsd, needed for isic | iwic | ifpi | ifpi2 | ihfc | ifpnp | itjc
-#
-i4b/layer1/i4b_hdlc.c optional ihfc | itjc
-i4b/layer1/i4b_l1dmux.c optional ifpi | ifpi2 | ifpnp | \
- ihfc | isic | itjc | iwic
-i4b/layer1/i4b_l1lib.c optional ifpi | ifpi2 | ifpnp | \
- ihfc | isic | itjc | iwic
-#
-# isdn4bsd, isic
-#
-i4b/layer1/isic/i4b_asuscom_ipac.c optional isic
-i4b/layer1/isic/i4b_avm_a1.c optional isic
-i4b/layer1/isic/i4b_bchan.c optional isic
-i4b/layer1/isic/i4b_ctx_s0P.c optional isic
-i4b/layer1/isic/i4b_drn_ngo.c optional isic
-i4b/layer1/isic/i4b_dynalink.c optional isic
-i4b/layer1/isic/i4b_elsa_qs1i.c optional isic
-i4b/layer1/isic/i4b_elsa_qs1p.c optional isic pci
-i4b/layer1/isic/i4b_elsa_pcc16.c optional isic
-i4b/layer1/isic/i4b_hscx.c optional isic
-i4b/layer1/isic/i4b_isac.c optional isic
-i4b/layer1/isic/i4b_isic.c optional isic
-i4b/layer1/isic/i4b_isic_isa.c optional isic
-i4b/layer1/isic/i4b_isic_pnp.c optional isic
-i4b/layer1/isic/i4b_itk_ix1.c optional isic
-i4b/layer1/isic/i4b_l1.c optional isic
-i4b/layer1/isic/i4b_l1fsm.c optional isic
-i4b/layer1/isic/i4b_siemens_isurf.c optional isic
-i4b/layer1/isic/i4b_sws.c optional isic
-i4b/layer1/isic/i4b_tel_s016.c optional isic
-i4b/layer1/isic/i4b_tel_s0163.c optional isic
-i4b/layer1/isic/i4b_tel_s08.c optional isic
-i4b/layer1/isic/i4b_usr_sti.c optional isic
-i4b/layer1/isic/i4b_diva.c optional isic
-#
-# isdn4bsd, iwic
-#
-i4b/layer1/iwic/i4b_iwic_pci.c optional iwic pci
-i4b/layer1/iwic/i4b_iwic_dchan.c optional iwic pci
-i4b/layer1/iwic/i4b_iwic_bchan.c optional iwic pci
-i4b/layer1/iwic/i4b_iwic_fsm.c optional iwic pci
-i4b/layer1/iwic/i4b_iwic_l1if.c optional iwic pci
-#
-# isdn4bsd, ifpi
-#
-i4b/layer1/ifpi/i4b_ifpi_pci.c optional ifpi pci
-i4b/layer1/ifpi/i4b_ifpi_isac.c optional ifpi pci
-i4b/layer1/ifpi/i4b_ifpi_l1.c optional ifpi pci
-i4b/layer1/ifpi/i4b_ifpi_l1fsm.c optional ifpi pci
-#
-# isdn4bsd, ifpi2
-#
-i4b/layer1/ifpi2/i4b_ifpi2_pci.c optional ifpi2 pci
-i4b/layer1/ifpi2/i4b_ifpi2_isacsx.c optional ifpi2 pci
-i4b/layer1/ifpi2/i4b_ifpi2_l1.c optional ifpi2 pci
-i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c optional ifpi2 pci
-#
-# isdn4bsd, ifpnp
-#
-i4b/layer1/ifpnp/i4b_ifpnp_avm.c optional ifpnp
-i4b/layer1/ifpnp/i4b_ifpnp_isac.c optional ifpnp
-i4b/layer1/ifpnp/i4b_ifpnp_l1.c optional ifpnp
-i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c optional ifpnp
-#
-# isdn4bsd, ihfc
-#
-i4b/layer1/ihfc/i4b_ihfc_l1if.c optional ihfc
-i4b/layer1/ihfc/i4b_ihfc_pnp.c optional ihfc
-i4b/layer1/ihfc/i4b_ihfc_drv.c optional ihfc
-#
-# isdn4bsd, itjc
-#
-i4b/layer1/itjc/i4b_itjc_pci.c optional itjc
-i4b/layer1/itjc/i4b_itjc_isac.c optional itjc
-i4b/layer1/itjc/i4b_itjc_l1.c optional itjc
-i4b/layer1/itjc/i4b_itjc_l1fsm.c optional itjc
-#
isa/atrtc.c standard
isa/syscons_isa.c optional sc
isa/vga_isa.c optional vga
diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98
index 97d85f6..68638c8 100644
--- a/sys/conf/files.pc98
+++ b/sys/conf/files.pc98
@@ -237,83 +237,6 @@ i386/svr4/svr4_locore.s optional compat_svr4 \
warning "COMPAT_SVR4 is broken and should be avoided"
i386/svr4/svr4_machdep.c optional compat_svr4
#
-# isdn4bsd, needed for isic | iwic | ifpi | ifpi2 | ihfc | ifpnp | itjc
-#
-i4b/layer1/i4b_hdlc.c optional ihfc | itjc
-i4b/layer1/i4b_l1dmux.c optional ifpi | ifpi2 | ifpnp | \
- ihfc | isic | itjc | iwic
-i4b/layer1/i4b_l1lib.c optional ifpi | ifpi2 | ifpnp | \
- ihfc | isic | itjc | iwic
-#
-# isdn4bsd, isic
-#
-i4b/layer1/isic/i4b_asuscom_ipac.c optional isic
-i4b/layer1/isic/i4b_avm_a1.c optional isic
-i4b/layer1/isic/i4b_bchan.c optional isic
-i4b/layer1/isic/i4b_ctx_s0P.c optional isic
-i4b/layer1/isic/i4b_drn_ngo.c optional isic
-i4b/layer1/isic/i4b_dynalink.c optional isic
-i4b/layer1/isic/i4b_elsa_qs1i.c optional isic
-i4b/layer1/isic/i4b_elsa_qs1p.c optional isic pci
-i4b/layer1/isic/i4b_elsa_pcc16.c optional isic
-i4b/layer1/isic/i4b_hscx.c optional isic
-i4b/layer1/isic/i4b_isac.c optional isic
-i4b/layer1/isic/i4b_isic.c optional isic
-i4b/layer1/isic/i4b_isic_isa.c optional isic
-i4b/layer1/isic/i4b_isic_pnp.c optional isic
-i4b/layer1/isic/i4b_itk_ix1.c optional isic
-i4b/layer1/isic/i4b_l1.c optional isic
-i4b/layer1/isic/i4b_l1fsm.c optional isic
-i4b/layer1/isic/i4b_siemens_isurf.c optional isic
-i4b/layer1/isic/i4b_sws.c optional isic
-i4b/layer1/isic/i4b_tel_s016.c optional isic
-i4b/layer1/isic/i4b_tel_s0163.c optional isic
-i4b/layer1/isic/i4b_tel_s08.c optional isic
-i4b/layer1/isic/i4b_usr_sti.c optional isic
-i4b/layer1/isic/i4b_diva.c optional isic
-#
-# isdn4bsd, iwic
-#
-i4b/layer1/iwic/i4b_iwic_pci.c optional iwic pci
-i4b/layer1/iwic/i4b_iwic_dchan.c optional iwic pci
-i4b/layer1/iwic/i4b_iwic_bchan.c optional iwic pci
-i4b/layer1/iwic/i4b_iwic_fsm.c optional iwic pci
-i4b/layer1/iwic/i4b_iwic_l1if.c optional iwic pci
-#
-# isdn4bsd, ifpi
-#
-i4b/layer1/ifpi/i4b_ifpi_pci.c optional ifpi pci
-i4b/layer1/ifpi/i4b_ifpi_isac.c optional ifpi pci
-i4b/layer1/ifpi/i4b_ifpi_l1.c optional ifpi pci
-i4b/layer1/ifpi/i4b_ifpi_l1fsm.c optional ifpi pci
-#
-# isdn4bsd, ifpi2
-#
-i4b/layer1/ifpi2/i4b_ifpi2_pci.c optional ifpi2 pci
-i4b/layer1/ifpi2/i4b_ifpi2_isacsx.c optional ifpi2 pci
-i4b/layer1/ifpi2/i4b_ifpi2_l1.c optional ifpi2 pci
-i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c optional ifpi2 pci
-#
-# isdn4bsd, ifpnp
-#
-i4b/layer1/ifpnp/i4b_ifpnp_avm.c optional ifpnp
-i4b/layer1/ifpnp/i4b_ifpnp_isac.c optional ifpnp
-i4b/layer1/ifpnp/i4b_ifpnp_l1.c optional ifpnp
-i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c optional ifpnp
-#
-# isdn4bsd, ihfc
-#
-i4b/layer1/ihfc/i4b_ihfc_l1if.c optional ihfc
-i4b/layer1/ihfc/i4b_ihfc_pnp.c optional ihfc
-i4b/layer1/ihfc/i4b_ihfc_drv.c optional ihfc
-#
-# isdn4bsd, itjc
-#
-i4b/layer1/itjc/i4b_itjc_pci.c optional itjc
-i4b/layer1/itjc/i4b_itjc_isac.c optional itjc
-i4b/layer1/itjc/i4b_itjc_l1.c optional itjc
-i4b/layer1/itjc/i4b_itjc_l1fsm.c optional itjc
-#
kern/imgact_aout.c optional compat_aout
kern/imgact_gzip.c optional gzip
libkern/divdi3.c standard
diff --git a/sys/conf/options b/sys/conf/options
index 8be2ed7..7e5c9c5 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -743,14 +743,6 @@ DCONS_POLL_HZ opt_dcons.h
DCONS_FORCE_CONSOLE opt_dcons.h
DCONS_FORCE_GDB opt_dcons.h
-# Static unit counts
-NI4BTRC opt_i4b.h
-NI4BRBCH opt_i4b.h
-NI4BTEL opt_i4b.h
-#XXXBZ#NI4BIPR opt_i4b.h
-#XXXBZ#NI4BING opt_i4b.h
-#XXXBZ#NI4BISPPP opt_i4b.h
-
# VFS options
LOOKUP_SHARED opt_vfs.h
diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64
index 00faf95..9a5e7dd 100644
--- a/sys/conf/options.amd64
+++ b/sys/conf/options.amd64
@@ -40,19 +40,6 @@ VGA_WIDTH90 opt_vga.h
ATKBD_DFLT_KEYMAP opt_atkbd.h
# -------------------------------
-# isdn4bsd: passive PCI cards
-# -------------------------------
-ELSA_QS1PCI 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
-#XXXBZ#IPR_VJ opt_i4b.h
-#XXXBZ#IPR_LOG opt_i4b.h
-
-# -------------------------------
# EOF
# -------------------------------
HAMMER opt_cpu.h
diff --git a/sys/conf/options.i386 b/sys/conf/options.i386
index 8cdaa5e..5d8e0b7 100644
--- a/sys/conf/options.i386
+++ b/sys/conf/options.i386
@@ -102,42 +102,6 @@ SPIGOT_UNSECURE opt_spigot.h
# Enables NETGRAPH support for Cronyx adapters
NETGRAPH_CRONYX opt_ng_cronyx.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
-ELSA_PCC16 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
-ASUSCOM_IPAC opt_i4b.h
-ELSA_QS1ISA opt_i4b.h
-SIEMENS_ISURF2 opt_i4b.h
-EICON_DIVA opt_i4b.h
-COMPAQ_M610 opt_i4b.h
-# -------------------------------
-# isdn4bsd: passive PCI cards
-# -------------------------------
-ELSA_QS1PCI 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
-#XXXBZ#IPR_VJ opt_i4b.h
-#XXXBZ#IPR_LOG opt_i4b.h
-
# Device options
DEV_APIC opt_apic.h
DEV_NPX opt_npx.h
diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98
index d910ff2..d0c8bbb 100644
--- a/sys/conf/options.pc98
+++ b/sys/conf/options.pc98
@@ -77,19 +77,6 @@ SPIGOT_UNSECURE opt_spigot.h
# Enables NETGRAPH support for Cronyx adapters
NETGRAPH_CRONYX opt_ng_cronyx.h
-# -------------------------------
-# isdn4bsd: passive PCI cards
-# -------------------------------
-ELSA_QS1PCI 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
-#XXXBZ#IPR_VJ opt_i4b.h
-#XXXBZ#IPR_LOG opt_i4b.h
-
# ct driver options
CT_BUS_WEIGHT opt_ct.h
CT_USE_RELOCATE_OFFSET opt_ct.h
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index 889f21f..2e877a6 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -856,235 +856,6 @@ device ichwd
#
device coretemp
-#---------------------------------------------------------------------------
-# ISDN4BSD
-#
-# See /usr/share/examples/isdn/ROADMAP for an introduction to isdn4bsd.
-#
-# i4b passive ISDN cards support contains the following hardware drivers:
-#
-# isic - Siemens/Infineon ISDN ISAC/HSCX/IPAC chipset driver
-# iwic - Winbond W6692 PCI bus ISDN S/T interface controller
-# ifpi - AVM Fritz!Card PCI driver
-# ifpi2 - AVM Fritz!Card PCI version 2 driver
-# ihfc - Cologne Chip HFC ISA/ISA-PnP chipset driver
-# ifpnp - AVM Fritz!Card PnP driver
-# itjc - Siemens ISAC / TJNet Tiger300/320 chipset
-#
-# i4b active ISDN cards support contains the following hardware drivers:
-#
-# iavc - AVM B1 PCI, AVM B1 ISA, AVM T1
-#
-# Note that the ``options'' (if given) and ``device'' lines must BOTH
-# be uncommented to enable support for a given card !
-#
-# In addition to a hardware driver (and probably an option) the mandatory
-# ISDN protocol stack devices and the mandatory support device must be
-# enabled as well as one or more devices from the optional devices section.
-#
-#---------------------------------------------------------------------------
-# isic driver (Siemens/Infineon chipsets)
-#
-device isic
-#
-# ISA bus non-PnP Cards:
-# ----------------------
-#
-# Teles S0/8 or Niccy 1008
-options TEL_S0_8
-hint.isic.0.at="isa"
-hint.isic.0.maddr="0xd0000"
-hint.isic.0.irq="5"
-hint.isic.0.flags="1"
-#
-# Teles S0/16 or Creatix ISDN-S0 or Niccy 1016
-options TEL_S0_16
-hint.isic.0.at="isa"
-hint.isic.0.port="0xd80"
-hint.isic.0.maddr="0xd0000"
-hint.isic.0.irq="5"
-hint.isic.0.flags="2"
-#
-# Teles S0/16.3
-options TEL_S0_16_3
-hint.isic.0.at="isa"
-hint.isic.0.port="0xd80"
-hint.isic.0.irq="5"
-hint.isic.0.flags="3"
-#
-# AVM A1 or AVM Fritz!Card
-options AVM_A1
-hint.isic.0.at="isa"
-hint.isic.0.port="0x340"
-hint.isic.0.irq="5"
-hint.isic.0.flags="4"
-#
-# USRobotics Sportster ISDN TA intern
-options USR_STI
-hint.isic.0.at="isa"
-hint.isic.0.port="0x268"
-hint.isic.0.irq="5"
-hint.isic.0.flags="7"
-#
-# ITK ix1 Micro ( < V.3, non-PnP version )
-options ITKIX1
-hint.isic.0.at="isa"
-hint.isic.0.port="0x398"
-hint.isic.0.irq="10"
-hint.isic.0.flags="18"
-#
-# ELSA PCC-16
-options ELSA_PCC16
-hint.isic.0.at="isa"
-hint.isic.0.port="0x360"
-hint.isic.0.irq="10"
-hint.isic.0.flags="20"
-#
-# ISA bus PnP Cards:
-# ------------------
-#
-# Teles S0/16.3 PnP
-options TEL_S0_16_3_P
-#
-# Creatix ISDN-S0 P&P
-options CRTX_S0_P
-#
-# Dr. Neuhaus Niccy Go@
-options DRN_NGO
-#
-# Sedlbauer Win Speed
-options SEDLBAUER
-#
-# Dynalink IS64PH
-options DYNALINK
-#
-# ELSA QuickStep 1000pro ISA
-options ELSA_QS1ISA
-#
-# Siemens I-Surf 2.0
-options SIEMENS_ISURF2
-#
-# Asuscom ISDNlink 128K ISA
-options ASUSCOM_IPAC
-#
-# Eicon Diehl DIVA 2.0 and 2.02
-options EICON_DIVA
-#
-# Compaq Microcom 610 ISDN card (Compaq series PSB2222I)
-options COMPAQ_M610
-#
-# PCI bus Cards:
-# --------------
-#
-# ELSA MicroLink ISDN/PCI (same as ELSA QuickStep 1000pro PCI)
-options ELSA_QS1PCI
-#
-#---------------------------------------------------------------------------
-# ifpnp driver for AVM Fritz!Card PnP
-#
-# AVM Fritz!Card PnP
-device ifpnp
-#
-#---------------------------------------------------------------------------
-# ihfc driver for Cologne Chip ISA chipsets (experimental!)
-#
-# Teles 16.3c ISA PnP
-# AcerISDN P10 ISA PnP
-# TELEINT ISDN SPEED No.1
-device ihfc
-#
-#---------------------------------------------------------------------------
-# ifpi driver for AVM Fritz!Card PCI
-#
-# AVM Fritz!Card PCI
-device ifpi
-#
-#---------------------------------------------------------------------------
-# ifpi2 driver for AVM Fritz!Card PCI version 2
-#
-# AVM Fritz!Card PCI version 2
-device ifpi2
-#
-#---------------------------------------------------------------------------
-# iwic driver for Winbond W6692 chipset
-#
-# ASUSCOM P-IN100-ST-D (and other Winbond W6692 based cards)
-device iwic
-#
-#---------------------------------------------------------------------------
-# itjc driver for Siemens ISAC / TJNet Tiger300/320 chipset
-#
-# Traverse Technologies NETjet-S
-# Teles PCI-TJ
-device itjc
-#
-#---------------------------------------------------------------------------
-# iavc driver (AVM active cards, needs i4bcapi driver!)
-#
-device iavc
-#
-# AVM B1 ISA bus (PnP mode not supported!)
-# ----------------------------------------
-hint.iavc.0.at="isa"
-hint.iavc.0.port="0x150"
-hint.iavc.0.irq="5"
-#
-#---------------------------------------------------------------------------
-# ISDN Protocol Stack - mandatory for all hardware drivers
-#
-# Q.921 / layer 2 - i4b passive cards D channel handling
-device i4bq921
-#
-# Q.931 / layer 3 - i4b passive cards D channel handling
-device i4bq931
-#
-# layer 4 - i4b common passive and active card handling
-device i4b
-#
-#---------------------------------------------------------------------------
-# ISDN devices - mandatory for all hardware drivers
-#
-# userland driver to do ISDN tracing (for passive cards only)
-device i4btrc
-options NI4BTRC=4
-#
-# userland driver to control the whole thing
-device i4bctl
-#
-#---------------------------------------------------------------------------
-# ISDN devices - optional
-#
-# userland driver for access to raw B channel
-device i4brbch
-options NI4BRBCH=4
-#
-# userland driver for telephony
-device i4btel
-options NI4BTEL=2
-#
-#XXXBZ# IPR and ISPPP are not usable until I4B is locked.
-# network driver for IP over raw HDLC ISDN
-#XXXBZ#device i4bipr
-#XXXBZ#options NI4BIPR=4
-# enable VJ header compression detection for ipr i/f
-#XXXBZ#options IPR_VJ
-# enable logging of the first n IP packets to isdnd (n=32 here)
-#XXXBZ#options IPR_LOG=32
-#
-# network driver for sync PPP over ISDN; requires an equivalent
-# number of sppp device to be configured
-#XXXBZ#device i4bisppp
-#XXXBZ#options NI4BISPPP=4
-#
-# B-channel interface to the netgraph subsystem
-#XXXBZ#device i4bing
-#XXXBZ#options NI4BING=2
-#
-# CAPI driver needed for active ISDN cards (see iavc driver above)
-device i4bcapi
-#
-#---------------------------------------------------------------------------
-
#
# System Management Bus (SMB)
#
@@ -1200,7 +971,6 @@ options FB_INSTALL_CDEV # install a CDEV entry in /dev
options PECOFF_SUPPORT
options PECOFF_DEBUG
-options I4B_SMP_WORKAROUND
options I586_PMC_GUPROF=0x70000
options KBDIO_DEBUG=2
options KBD_MAXRETRY=4
diff --git a/sys/i4b/capi/README b/sys/i4b/capi/README
deleted file mode 100644
index 9168525..0000000
--- a/sys/i4b/capi/README
+++ /dev/null
@@ -1,150 +0,0 @@
-$FreeBSD$
-
-Message-ID: <3AF56886.7D92609A@cubical.fi>
-Date: Sun, 06 May 2001 18:06:47 +0300
-From: Juha-Matti Liukkonen <jml@cubical.fi>
-Organization: Cubical Solutions Ltd
-
-Please find the attached diff and tarball for our support software for
-CAPI 2.0 and AVM's active T1 and T1-B (primary rate) and B1 (basic rate)
-ISDN adapters for isdn4bsd. The implementation has been made from
-scratch by us, based on reverse engineering of the Linux driver provided
-by AVM GmbH and available in ftp.avm.de. Cubical Solutions Ltd offers
-this implementation for the BSD community free of charge and assuming
-absolutely no liabilities whatsoever. Feel free to modify the
-implementation any way you see fit, but please retain our one-liner
-copyright statement somewhere in the comment headers in the capi and
-iavc driver modules.
-
-That said, the attached tarball is i4b-00.96.00-beta with our
-modifications integrated, and the diff contains all modifications we
-have made to the original (including the new capi files). Our mods add
-pseudo-device i4bcapi, which attaches to i4b layer 4, and device iavc0,
-which implements a link layer driver for AVM's active B1 and T1 adapters
-for i4bcapi. There are also a couple of related improvements to isdnd,
-and a number of modifications to isdnd and layer 4 to implement support
-for up to 30 channels per adapter (for primary rate use).
-
-We have developed the software explicitly for our telephony application,
-to be used with AVM's T1 adapters, and the implementation has been
-tested primarily with this functionality in mind. There may be
-interesting side effects with eg. the ipr and isppp drivers; we do not
-use them and therefore their testing has been cursory at best. The
-i4btel driver works well with the T1 (our primary use), and the i4brbch
-driver has been verified to work with T1, T1-B and B1 adapters (ftp'd
-some files over a dialup PPP connection with each adapter). Only the PCI
-versions of the adapters (equipped with the AMCC DMA controller) are
-supported, although the basics (PIO mode communication) for the older
-ISA model support is in place, so only the bus attachment modules should
-be required to support the older hardware.
-
-All of the AVM active adapters use downloadable firmware, which is not
-included in the attached package. The firmware files (t1.t4, t1b.t4,
-b1.t4) can be found from ftp.avm.de in adapter specific subdirectories,
-or from the CDs provided with the adapters (in directory
-'cardware/firmware').
-
-Our primary development platform is our own embedded build (we call it
-'ebsd') based on FreeBSD 4.2-RELEASE. The implementation has also been
-tested on standard FreeBSD 4.2-RELEASE system. The implementation should
-not contain any FreeBSD (or even FreeBSD release) specific issues, but
-it has not been tested or even compiled on any other platforms;
-specifically, only the FreeBSD overinstall.sh script is modified to
-install the capi/iavc support in the kernel source tree.
-
-This code is not under active development here since the functionality
-we use (i4btel, T1) has been working since the beginning of March. We
-are also not planning on any further development (no need seen at this
-point), but I am naturally interested on whatever bugs and development
-ideas pop up on the community and will keep a keen eye on the isdn
-mailing list. I personally may be available for consultation, debugging
-and possibly development projects, but with notable reservations on my
-time (the current IT industry recession seems to be pushing even more
-work for us, which tends to keep us pretty busy these days).
-
-Here are some specific technical notes:
-
-* isdnd supports new keyword 'firmware=</path/to/file>' in section
-'controller'. This keyword is supported for all controller types, and
-causes I4B_CTRL_DOWNLOAD ioctl to be invoked with the specified file as
-an argument. In systems equipped with both active and passive adapters,
-and the passive cards being detected first, dummy 'controller' entries
-are required for the passive cards to get the correct firmwares to
-correct adapters. (I hope you did not have other uses for this ioctl in
-mind?)
-
-* isdnd supports new keyword 'clone=<entry name>' in section 'entry'.
-This causes the entry to be copied from the existing named entry. At
-least entry specific 'name' and 'usrdeviceunit' values should be
-specified after a 'clone'. (Makes configuring 30 or 60 entries way much
-easier.)
-
-* a bug in i4btel driver read routine corrected. The conditions in the
-while() clause caused the receive queue to be referenced before checking
-if a channel is connected, leading to kernel panic (do a 'dd
-if=/dev/i4btel0 of=/dev/null' on an unconnected tel device, panic will
-follow). Correction was to reorder the while clause conditions to check
-for connectedness first.
-
-* isdnd and i4b layer 4 support up to CHANNELS_MAX (=30) channels per
-adapter. The msg_ctrl_info_req_t message reports the number of channels
-provided by the adapter, the number is stored in the nbchan field of the
-controller state structure. The fixed stateb1 and stateb2 entries in
-controller state stuctures are replaced with an array, and all fixed
-references there are replaced with loops up to nbchan. Passive stack
-layer 1 and 2 are not modified, layer 3 sets this field to fixed value 2
-for all adapters (but it could be delegated to the layer 1 driver's
-attach request).
-
-* the i4bcapi driver maps i4b channels to logical channels identified
-with PLCI/NCCI values in the CAPI protocol using the sc_bchan[] array.
-The PLCI/NCCI handling is merged in the channel mapping and is greatly
-simplified from the reference state machine model, because in practice
-there can be only one PLCI/NCCI per channel active at any given time.
-
-* the i4bcapi driver does not provide any kind of user level interface
-(such as the /dev/capi20 interface provided by the linux driver), but
-could relatively easily be extended to do so (and if done, interface
-compatibility with the linux implementation would probably be a good
-goal).
-
-* there are some gritty details in the iavc driver, inherited from the
-linux code. Despite us being a legitimate company in the telecom
-business, AVM failed to produce any programming reference material for
-us (at least in a reasonable time frame), so some guesswork remains due
-to classic reverse engineering process (particularly there are a few
-magic numbers in the card initialization sequence whose meaning I do not
-know).
-
-* pseudo-devices i4bq931, i4bq921 and some passive stack layer 1 driver
-(such as iwic) are required to compile, as the required ctrl_desc[]
-array is in layer 3, which requires layer 2, which requires layer 1.
-Some architectural cleanup would come in handy here, but we did not want
-to start making any major changes (and we use iwic in test setups
-anyway, so we simply always compile it in).
-
-To summarize: unpack, overinstall, add the following lines (with the
-usual passive stack configuration including at least one L1 driver) to
-your kernel configuration file:
-
-pseudo-device "i4bcapi"
-device iavc0
-
-...and the following to your isdnd.rc:
-
-controller
-firmware = /usr/lib/isdn/b1.t4
-
-...compile your new kernel, make sure the firmware file is in
-/usr/lib/isdn, and your B1 adapter should boot up and Just Work (tm). If
-you have multiple adapters, you need a 'controller' section for each to
-have them loaded and booted on isdnd startup.
-
-Have fun -- and let me know if there are any complications, or if I can
-be of further assistance,
-
- - Juha
---
-Juha-Matti Liukkonen, Cubical Solutions Ltd
-Phone: +358(0)405280142
-Email: jml@cubical.fi
diff --git a/sys/i4b/capi/capi.h b/sys/i4b/capi/capi.h
deleted file mode 100644
index c6dc9e8..0000000
--- a/sys/i4b/capi/capi.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/capi.h The CAPI device interface.
- *
- * $FreeBSD$
- */
-
-#ifndef _I4B_CAPI_H_
-#define _I4B_CAPI_H_
-
-/*
-// CAPI driver context: B channels and controller softcs.
-*/
-
-#define INVALID -1
-
-enum capi_b_state {
- B_FREE, /* channel free, ncci invalid */
- B_CONNECT_CONF, /* wait for CONNECT_CONF */
- B_CONNECT_IND, /* IND got, wait for appl RESP */
- B_CONNECT_ACTIVE_IND, /* wait for CONNECT_ACTIVE_IND */
- B_CONNECT_B3_CONF, /* wait for CONNECT_B3_CONF */
- B_CONNECT_B3_IND, /* wait for CONNECT_B3_IND */
- B_CONNECT_B3_ACTIVE_IND, /* wait for CONNECT_B3_ACTIVE_IND */
- B_CONNECTED, /* channel connected & in use */
- B_DISCONNECT_CONF, /* wait for DISCONNECT_CONF */
- B_DISCONNECT_B3_CONF, /* wait for DISCONNECT_B3_CONF */
- B_DISCONNECT_IND, /* wait for DISCONNECT_IND */
-};
-
-typedef struct capi_bchan
-{
- /* Channel state */
-
- int ncci;
-#define CAPI_CTRL_MASK 0x000000ff
-#define CAPI_PLCI_MASK 0x0000ffff
-#define CAPI_NCCI_MASK 0xffff0000
- u_int16_t msgid;
- int busy;
- enum capi_b_state state;
-
- struct ifqueue tx_queue;
- struct ifqueue rx_queue;
- int rxcount;
- int txcount;
-
- /* The rest is needed for i4b integration */
-
- int bprot;
- int cdid;
-
- struct mbuf *in_mbuf;
- isdn_link_t capi_isdn_linktab;
- drvr_link_t *capi_drvr_linktab;
-} capi_bchan_t;
-
-enum capi_c_state {
- C_DOWN, /* controller uninitialized */
- C_READY, /* controller initialized but not listening */
- C_UP, /* controller listening */
-};
-
-typedef struct capi_softc {
- int sc_unit; /* index in capi_sc[] */
- int ctrl_unit; /* index in isdn_ctrl_tab[] */
- int card_type; /* CARD_TYPEC_xxx, filled by ll driver */
- int sc_nbch; /* number of b channels on this controller */
- int sc_enabled; /* is daemon connected TRUE/FALSE */
- int sc_msgid; /* next CAPI message id */
- char sc_profile[64];/* CAPI profile data */
- enum capi_c_state sc_state;
-
- capi_bchan_t sc_bchan[MAX_BCHAN];
-
- /* Link layer driver context holder and methods */
-
- void *ctx;
-
- int (*load)(struct capi_softc *, int, u_int8_t *);
- int (*reg_appl)(struct capi_softc *, int, int);
- int (*rel_appl)(struct capi_softc *, int);
- int (*send)(struct capi_softc *, struct mbuf *);
-} capi_softc_t;
-
-extern capi_softc_t *capi_sc[];
-extern int ncapi;
-
-/*
-// CAPI upcalls for the link layer.
-*/
-
-#define I4BCAPI_APPLID 1
-
-extern int capi_ll_attach(capi_softc_t *);
-extern int capi_ll_control(capi_softc_t *, int op, int arg);
-
-#define CAPI_CTRL_READY 0 /* ctrl ready, value=TRUE/FALSE */
-#define CAPI_CTRL_PROFILE 1 /* set CAPI profile */
-#define CAPI_CTRL_NEW_NCCI 2 /* new ncci value, assign bchan */
-#define CAPI_CTRL_FREE_NCCI 3 /* free ncci value, clear bchan */
-
-extern int capi_ll_receive(capi_softc_t *, struct mbuf *);
-
-extern int capi_start_tx(capi_softc_t *, int bchan);
-
-#endif /* _I4B_CAPI_H_ */
diff --git a/sys/i4b/capi/capi_l4if.c b/sys/i4b/capi/capi_l4if.c
deleted file mode 100644
index ef65264..0000000
--- a/sys/i4b/capi/capi_l4if.c
+++ /dev/null
@@ -1,447 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/capi_l4if.c The CAPI i4b L4/device interface.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.h>
-
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#include <i4b/capi/capi.h>
-#include <i4b/capi/capi_msgs.h>
-
-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, void *parm);
-static int n_download(int unit, int, struct isdn_dr_prot *);
-
-capi_softc_t *capi_sc[MAX_CONTROLLERS] = { NULL, };
-int ncapi = 0;
-
-/*
-// i4b_capi_{ret,set}_linktab
-// i4b driver glue.
-//
-// i4b_capi_bch_config
-// Called by i4b driver to flush + {en,dis}able a channel.
-//
-// i4b_capi_bch_start_tx
-// Called by i4b driver to transmit a queued mbuf.
-//
-// i4b_capi_bch_stat
-// Called by i4b driver to obtain statistics information.
-*/
-
-static isdn_link_t *
-i4b_capi_ret_linktab(int unit, int channel)
-{
- capi_softc_t *sc = capi_sc[unit];
- return &sc->sc_bchan[channel].capi_isdn_linktab;
-}
-
-static void
-i4b_capi_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
- capi_softc_t *sc = capi_sc[unit];
- sc->sc_bchan[channel].capi_drvr_linktab = dlt;
-}
-
-static void
-i4b_capi_bch_config(int unit, int chan, int bprot, int activate)
-{
- capi_softc_t *sc = capi_sc[unit];
-
- i4b_Bcleanifq(&sc->sc_bchan[chan].tx_queue);
- sc->sc_bchan[chan].tx_queue.ifq_maxlen = IFQ_MAXLEN;
- sc->sc_bchan[chan].txcount = 0;
-
- /* The telephony drivers use rx_queue for receive. */
-
- i4b_Bcleanifq(&sc->sc_bchan[chan].rx_queue);
- sc->sc_bchan[chan].rx_queue.ifq_maxlen = IFQ_MAXLEN;
- sc->sc_bchan[chan].rxcount = 0;
-
- /* HDLC frames are put to in_mbuf */
-
- i4b_Bfreembuf(sc->sc_bchan[chan].in_mbuf);
- sc->sc_bchan[chan].in_mbuf = NULL;
-
- /* Because of the difference, we need to remember the protocol. */
-
- sc->sc_bchan[chan].bprot = bprot;
- sc->sc_bchan[chan].busy = 0;
-}
-
-static void
-i4b_capi_bch_start_tx(int unit, int chan)
-{
- capi_softc_t *sc = capi_sc[unit];
- int s;
-
- s = SPLI4B();
-
- if (sc->sc_bchan[chan].state != B_CONNECTED) {
- splx(s);
- printf("capi%d: start_tx on unconnected channel\n", sc->sc_unit);
- return;
- }
-
- if (sc->sc_bchan[chan].busy) {
- splx(s);
- return;
- }
-
- capi_start_tx(sc, chan);
-
- splx(s);
-}
-
-static void
-i4b_capi_bch_stat(int unit, int chan, bchan_statistics_t *bsp)
-{
- capi_softc_t *sc = capi_sc[unit];
- int s = SPLI4B();
-
- bsp->outbytes = sc->sc_bchan[chan].txcount;
- bsp->inbytes = sc->sc_bchan[chan].rxcount;
-
- sc->sc_bchan[chan].txcount = 0;
- sc->sc_bchan[chan].rxcount = 0;
-
- splx(s);
-}
-
-int capi_start_tx(capi_softc_t *sc, int chan)
-{
- struct mbuf *m_b3;
- int sent = 0;
-
- _IF_DEQUEUE(&sc->sc_bchan[chan].tx_queue, m_b3);
- while (m_b3) {
- struct mbuf *m = m_b3->m_next;
-
- sc->sc_bchan[chan].txcount += m_b3->m_len;
- capi_data_b3_req(sc, chan, m_b3);
- sent++;
-
- m_b3 = m;
- }
-
- if (sc->sc_bchan[chan].capi_drvr_linktab) {
- /* Notify i4b driver of activity, and if the queue is drained. */
-
- if (sent)
- (*sc->sc_bchan[chan].capi_drvr_linktab->bch_activity)(
- sc->sc_bchan[chan].capi_drvr_linktab->unit, ACT_TX);
-
- if (IF_QEMPTY(&sc->sc_bchan[chan].tx_queue))
- (*sc->sc_bchan[chan].capi_drvr_linktab->bch_tx_queue_empty)(
- sc->sc_bchan[chan].capi_drvr_linktab->unit);
- }
-
- return sent;
-}
-
-/*
-// capi_ll_attach
-// Called by a link layer driver at boot time.
-*/
-
-int
-capi_ll_attach(capi_softc_t *sc)
-{
- int i;
-
- if (ncapi == (sizeof(capi_sc) / sizeof(capi_sc[0]))) {
- printf("capi%d: too many units, increase MAX_CONTROLLERS\n", ncapi);
- return (ENXIO);
- }
-
- /* Unit type and subtype; sc is partly filled by ll driver */
-
- ctrl_desc[nctrl].unit = ncapi;
- ctrl_desc[nctrl].ctrl_type = CTRL_CAPI;
- ctrl_desc[nctrl].card_type = sc->card_type;
-
- /* L4 callbacks */
-
- ctrl_types[CTRL_CAPI].get_linktab = i4b_capi_ret_linktab;
- ctrl_types[CTRL_CAPI].set_linktab = i4b_capi_set_linktab;
-
- 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_DOWNLOAD = n_download;
- ctrl_desc[nctrl].N_DIAGNOSTICS = NULL; /* XXX todo */
- ctrl_desc[nctrl].N_MGMT_COMMAND = n_mgmt_command;
-
- /* Unit state */
-
- sc->sc_enabled = FALSE;
- sc->sc_state = C_DOWN;
- sc->sc_msgid = 0;
-
- ctrl_desc[nctrl].dl_est = DL_DOWN;
- ctrl_desc[nctrl].nbch = sc->sc_nbch;
-
- for (i = 0; i < sc->sc_nbch; i++) {
- ctrl_desc[nctrl].bch_state[i] = BCH_ST_FREE;
- sc->sc_bchan[i].ncci = INVALID;
- sc->sc_bchan[i].msgid = 0;
- sc->sc_bchan[i].busy = 0;
- sc->sc_bchan[i].state = B_FREE;
-
- memset(&sc->sc_bchan[i].tx_queue, 0, sizeof(struct ifqueue));
- memset(&sc->sc_bchan[i].rx_queue, 0, sizeof(struct ifqueue));
- sc->sc_bchan[i].tx_queue.ifq_maxlen = IFQ_MAXLEN;
- sc->sc_bchan[i].rx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- if(!mtx_initialized(&sc->sc_bchan[i].tx_queue.ifq_mtx))
- mtx_init(&sc->sc_bchan[i].tx_queue.ifq_mtx, "i4b_capi_tx", NULL, MTX_DEF);
- if(!mtx_initialized(&sc->sc_bchan[i].rx_queue.ifq_mtx))
- mtx_init(&sc->sc_bchan[i].rx_queue.ifq_mtx, "i4b_capi_rx", NULL, MTX_DEF);
-
- sc->sc_bchan[i].txcount = 0;
- sc->sc_bchan[i].rxcount = 0;
-
- sc->sc_bchan[i].cdid = CDID_UNUSED;
- sc->sc_bchan[i].bprot = BPROT_NONE;
- sc->sc_bchan[i].in_mbuf = NULL;
-
- sc->sc_bchan[i].capi_drvr_linktab = NULL;
-
- sc->sc_bchan[i].capi_isdn_linktab.unit = ncapi;
- sc->sc_bchan[i].capi_isdn_linktab.channel = i;
- sc->sc_bchan[i].capi_isdn_linktab.bch_config = i4b_capi_bch_config;
- sc->sc_bchan[i].capi_isdn_linktab.bch_tx_start = i4b_capi_bch_start_tx;
- sc->sc_bchan[i].capi_isdn_linktab.bch_stat = i4b_capi_bch_stat;
- sc->sc_bchan[i].capi_isdn_linktab.tx_queue = &sc->sc_bchan[i].tx_queue;
- sc->sc_bchan[i].capi_isdn_linktab.rx_queue = &sc->sc_bchan[i].rx_queue;
- sc->sc_bchan[i].capi_isdn_linktab.rx_mbuf = &sc->sc_bchan[i].in_mbuf;
- }
-
- ctrl_desc[nctrl].tei = -1;
-
- /* Up the controller index and store the softc */
-
- sc->sc_unit = ncapi;
- capi_sc[ncapi++] = sc;
- sc->ctrl_unit = nctrl++;
-
- printf("capi%d: card type %d attached\n", sc->sc_unit, sc->card_type);
-
- return(0);
-}
-
-/*
-// n_mgmt_command
-// i4b L4 management command.
-*/
-
-static void
-n_mgmt_command(int unit, int op, void *arg)
-{
- capi_softc_t *sc = capi_sc[unit];
-
- printf("capi%d: mgmt command %d\n", sc->sc_unit, op);
-
- switch(op) {
- case CMR_DOPEN:
- sc->sc_enabled = TRUE;
- break;
-
- case CMR_DCLOSE:
- sc->sc_enabled = FALSE;
- break;
-
- case CMR_SETTRACE:
- break;
-
- default:
- break;
- }
-}
-
-/*
-// n_connect_request
-// i4b L4 wants to connect. We assign a B channel to the call,
-// send a CAPI_CONNECT_REQ, and set the channel to B_CONNECT_CONF.
-*/
-
-static void
-n_connect_request(u_int cdid)
-{
- call_desc_t *cd = cd_by_cdid(cdid);
- capi_softc_t *sc;
- int bch, s;
-
- if (!cd) {
- printf("capi?: invalid cdid %d\n", cdid);
- return;
- }
-
- sc = capi_sc[ctrl_desc[cd->controller].unit];
- bch = cd->channelid;
-
- s = SPLI4B();
-
- if ((bch < 0) || (bch >= sc->sc_nbch))
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if (sc->sc_bchan[bch].state == B_FREE)
- break;
-
- if (bch == sc->sc_nbch) {
- splx(s);
- printf("capi%d: no free B channel\n", sc->sc_unit);
- return;
- }
-
- cd->channelid = bch;
-
- capi_connect_req(sc, cd);
- splx(s);
-}
-
-/*
-// n_connect_response
-// i4b L4 answers a call. We send a CONNECT_RESP with the proper
-// Reject code, and set the channel to B_CONNECT_B3_IND or B_FREE,
-// depending whether we answer or not.
-*/
-
-static void
-n_connect_response(u_int cdid, int response, int cause)
-{
- call_desc_t *cd = cd_by_cdid(cdid);
- capi_softc_t *sc;
- int bch, s;
-
- if (!cd) {
- printf("capi?: invalid cdid %d\n", cdid);
- return;
- }
-
- sc = capi_sc[ctrl_desc[cd->controller].unit];
- bch = cd->channelid;
-
- T400_stop(cd);
-
- cd->response = response;
- cd->cause_out = cause;
-
- s = SPLI4B();
- capi_connect_resp(sc, cd);
- splx(s);
-}
-
-/*
-// n_disconnect_request
-// i4b L4 wants to disconnect. We send a DISCONNECT_REQ and
-// set the channel to B_DISCONNECT_CONF.
-*/
-
-static void
-n_disconnect_request(u_int cdid, int cause)
-{
- call_desc_t *cd = cd_by_cdid(cdid);
- capi_softc_t *sc;
- int bch, s;
-
- if (!cd) {
- printf("capi?: invalid cdid %d\n", cdid);
- return;
- }
-
- sc = capi_sc[ctrl_desc[cd->controller].unit];
- bch = cd->channelid;
-
- cd->cause_out = cause;
-
- s = SPLI4B();
- capi_disconnect_req(sc, cd);
- splx(s);
-}
-
-/*
-// n_alert_request
-// i4b L4 wants to alert an incoming call. We send ALERT_REQ.
-*/
-
-static void
-n_alert_request(u_int cdid)
-{
- call_desc_t *cd = cd_by_cdid(cdid);
- capi_softc_t *sc;
- int s;
-
- if (!cd) {
- printf("capi?: invalid cdid %d\n", cdid);
- return;
- }
-
- sc = capi_sc[ctrl_desc[cd->controller].unit];
-
- s = SPLI4B();
- capi_alert_req(sc, cd);
- splx(s);
-}
-
-/*
-// n_download
-// L4 -> firmware download
-*/
-
-static int
-n_download(int unit, int numprotos, struct isdn_dr_prot *protocols)
-{
- capi_softc_t *sc = capi_sc[unit];
-
- if (sc->load) {
- (*capi_sc[unit]->load)(sc, protocols[0].bytecount,
- protocols[0].microcode);
- }
-
- return(0);
-}
diff --git a/sys/i4b/capi/capi_llif.c b/sys/i4b/capi/capi_llif.c
deleted file mode 100644
index 2eda986..0000000
--- a/sys/i4b/capi/capi_llif.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/capi_llif.c The i4b CAPI link layer interface.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.h>
-
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#include <i4b/capi/capi.h>
-#include <i4b/capi/capi_msgs.h>
-
-/*
-// capi_ll_control
-// CAPI link layer control routine. Called by a link layer
-// driver when its state changes.
-*/
-
-int
-capi_ll_control(capi_softc_t *sc, int op, int arg)
-{
- switch (op) {
- case CAPI_CTRL_READY:
- if (arg) {
- sc->sc_state = C_READY;
-
- /*
- * Register our CAPI ApplId and send CAPI_LISTEN_REQ
- * with CIP Mask value 1 (match all).
- */
-
- sc->reg_appl(sc, I4BCAPI_APPLID, sc->sc_nbch);
- capi_listen_req(sc, 0x10007);
-
- } else {
- sc->sc_state = C_DOWN;
- /* XXX go through cds and notify L4 of pdeact? XXX */
- }
- break;
-
- case CAPI_CTRL_PROFILE:
- bcopy((char*) arg, &sc->sc_profile, sizeof(sc->sc_profile));
- break;
-
- case CAPI_CTRL_NEW_NCCI:
- case CAPI_CTRL_FREE_NCCI:
- /* We ignore the controller's NCCI notifications. */
- break;
-
- default:
- printf("capi%d: unknown control %d\n", sc->sc_unit, op);
- }
-
- return 0;
-}
-
-/*
-// i4b_capi_handlers
-// Array of message-handler pairs used to dispatch CAPI
-// messages sent to I4BCAPI_APPLID.
-*/
-
-static struct capi_cmdtab {
- u_int16_t cmd;
- void (*handler)(capi_softc_t *, struct mbuf *);
-} i4b_capi_handlers[] = {
- { CAPI_LISTEN_CONF, capi_listen_conf },
- { CAPI_INFO_IND, capi_info_ind },
- { CAPI_ALERT_CONF, capi_alert_conf },
- { CAPI_CONNECT_CONF, capi_connect_conf },
- { CAPI_CONNECT_IND, capi_connect_ind },
- { CAPI_CONNECT_ACTIVE_IND, capi_connect_active_ind },
- { CAPI_CONNECT_B3_CONF, capi_connect_b3_conf },
- { CAPI_CONNECT_B3_IND, capi_connect_b3_ind },
- { CAPI_CONNECT_B3_ACTIVE_IND, capi_connect_b3_active_ind },
- { CAPI_DATA_B3_CONF, capi_data_b3_conf },
- { CAPI_DATA_B3_IND, capi_data_b3_ind },
- { CAPI_DISCONNECT_B3_IND, capi_disconnect_b3_ind },
- { CAPI_DISCONNECT_CONF, capi_disconnect_conf },
- { CAPI_DISCONNECT_IND, capi_disconnect_ind },
- { 0, 0 }
-};
-
-/*
-// capi_ll_receive
-// CAPI link layer receive upcall. Called by a link layer
-// driver to dispatch incoming CAPI messages.
-*/
-
-int
-capi_ll_receive(capi_softc_t *sc, struct mbuf *m)
-{
- u_int8_t *p = mtod(m, u_int8_t*);
- u_int16_t len, applid, msgid, cmd;
-
- capimsg_getu16(p + 0, &len);
- capimsg_getu16(p + 2, &applid);
- capimsg_getu16(p + 4, &cmd);
- capimsg_getu16(p + 6, &msgid);
-
-#if 0
- printf("capi%d: ll_receive hdr %04x %04x %04x %04x\n", sc->sc_unit,
- len, applid, cmd, msgid);
-#endif
-
- if (applid == I4BCAPI_APPLID) {
- struct capi_cmdtab *e;
- for (e = i4b_capi_handlers; e->cmd && e->cmd != cmd; e++);
- if (e->cmd) (*e->handler)(sc, m);
- else printf("capi%d: unknown message %04x\n", sc->sc_unit, cmd);
-
- } else {
- /* XXX we could handle arbitrary ApplIds here XXX */
- printf("capi%d: message %04x for unknown applid %d\n", sc->sc_unit,
- cmd, applid);
- }
-
- if (m->m_next) {
- i4b_Bfreembuf(m->m_next);
- m->m_next = NULL;
- }
- i4b_Dfreembuf(m);
- return(0);
-}
diff --git a/sys/i4b/capi/capi_msgs.c b/sys/i4b/capi/capi_msgs.c
deleted file mode 100644
index 78eae29..0000000
--- a/sys/i4b/capi/capi_msgs.c
+++ /dev/null
@@ -1,950 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/capi_msgs.c The CAPI i4b message handlers.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.h>
-
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#include <i4b/capi/capi.h>
-#include <i4b/capi/capi_msgs.h>
-
-/*
-// Administrative messages:
-// ------------------------
-*/
-
-void capi_listen_req(capi_softc_t *sc, u_int32_t CIP)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 18);
- u_int8_t *msg;
- u_int16_t msgid;
-
- if (!m) {
- printf("capi%d: can't get mbuf for listen_req\n", sc->sc_unit);
- return;
- }
-
- msgid = sc->sc_msgid++;
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_LISTEN_REQ);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, 1); /* Controller */
- msg = capimsg_setu32(msg, 0); /* Info mask */
- msg = capimsg_setu32(msg, CIP);
- msg = capimsg_setu32(msg, 0);
- msg = capimsg_setu8(msg, 0);
- msg = capimsg_setu8(msg, 0);
-
- sc->send(sc, m);
-}
-
-void capi_listen_conf(capi_softc_t *sc, struct mbuf *m_in)
-{
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- u_int16_t Info;
-
- capimsg_getu16(msg + 12, &Info);
-
- if (Info == 0) {
- /* We are now listening. */
-
- sc->sc_state = C_UP;
- ctrl_desc[sc->ctrl_unit].dl_est = DL_UP;
-
- i4b_l4_l12stat(sc->ctrl_unit, 1, 1);
- i4b_l4_l12stat(sc->ctrl_unit, 2, 1);
-
- } else {
- /* XXX sc->sc_state = C_DOWN ? XXX */
- printf("capi%d: can't listen, info=%04x\n", sc->sc_unit, Info);
- }
-}
-
-void capi_info_ind(capi_softc_t *sc, struct mbuf *m_in)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 4);
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- u_int16_t applid, msgid;
- u_int32_t PLCI;
-
- if (!m) {
- printf("capi%d: can't get mbuf for info_resp\n", sc->sc_unit);
- return;
- }
-
- msg = capimsg_getu16(msg + 2, &applid);
- msg = capimsg_getu16(msg + 2, &msgid);
- msg = capimsg_getu32(msg, &PLCI);
-
- /* i4b_l4_info_ind() */
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, applid);
- msg = capimsg_setu16(msg, CAPI_INFO_RESP);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, PLCI);
-
- sc->send(sc, m);
-}
-
-void capi_alert_req(capi_softc_t *sc, call_desc_t *cd)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 5);
- u_int8_t *msg;
- u_int16_t msgid;
- u_int32_t PLCI;
-
- if (!m) {
- printf("capi%d: can't get mbuf for alert_req\n", sc->sc_unit);
- return;
- }
-
- msgid = sc->sc_bchan[cd->channelid].msgid = sc->sc_msgid++;
- PLCI = (sc->sc_bchan[cd->channelid].ncci & CAPI_PLCI_MASK);
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_ALERT_REQ);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, PLCI);
- msg = capimsg_setu8(msg, 0);
-
- sc->send(sc, m);
-}
-
-void capi_alert_conf(capi_softc_t *sc, struct mbuf *m_in)
-{
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- u_int16_t Info;
-
- msg = capimsg_getu16(msg + 12, &Info);
-
- if (Info) {
- printf("capi%d: can't alert, info=%04x\n", sc->sc_unit, Info);
- }
-}
-
-/*
-// Outgoing call setup:
-// --------------------
-//
-// CAPI_CONNECT_REQ -->
-// <-- CAPI_CONNECT_CONF
-// (notify Layer 4)
-// <-- CAPI_CONNECT_ACTIVE_IND
-// CAPI_CONNECT_ACTIVE_RESP -->
-// CAPI_CONNECT_B3_REQ -->
-// <-- CAPI_CONNECT_B3_CONF
-// <-- CAPI_CONNECT_B3_ACTIVE_IND
-// CAPI_CONNECT_B3_ACTIVE_RESP -->
-// (notify Layer 4)
-*/
-
-void capi_connect_req(capi_softc_t *sc, call_desc_t *cd)
-{
- struct mbuf *m;
- u_int8_t *msg;
- u_int16_t msgid;
- int slen = strlen(cd->src_telno);
- int dlen = strlen(cd->dst_telno);
-
- m = i4b_Dgetmbuf(8 + 27 + slen + dlen);
- if (!m) {
- printf("capi%d: can't get mbuf for connect_req\n", sc->sc_unit);
- return;
- }
-
- cd->crflag = CRF_ORIG;
-
- sc->sc_bchan[cd->channelid].cdid = cd->cdid;
- sc->sc_bchan[cd->channelid].bprot = cd->bprot;
- sc->sc_bchan[cd->channelid].state = B_CONNECT_CONF;
- msgid = sc->sc_bchan[cd->channelid].msgid = sc->sc_msgid++;
- ctrl_desc[sc->ctrl_unit].bch_state[cd->channelid] = BCH_ST_RSVD;
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_CONNECT_REQ);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, 1); /* Controller */
-
- switch (cd->bprot) {
- case BPROT_NONE:
- msg = capimsg_setu16(msg, 0x0010); /* Telephony */
- break;
-
- case BPROT_RHDLC:
- msg = capimsg_setu16(msg, 0x0002); /* Unrestricted digital */
- break;
-
- default:
- msg = capimsg_setu16(msg, 0x0002); /* Unrestricted digital */
- }
-
- msg = capimsg_setu8(msg, 1 + dlen);
- msg = capimsg_setu8(msg, 0x80);
- strncpy(msg, cd->dst_telno, dlen);
-
- msg = capimsg_setu8(msg + dlen, 2 + slen);
- msg = capimsg_setu8(msg, 0x00);
- msg = capimsg_setu8(msg, 0x80); /* Presentation and screening indicator */
- strncpy(msg, cd->src_telno, slen);
-
- msg = capimsg_setu8(msg + slen, 0); /* Called & */
- msg = capimsg_setu8(msg, 0); /* Calling party subaddress */
-
- msg = capimsg_setu8(msg, 15); /* B protocol */
- if (cd->bprot == BPROT_NONE)
- msg = capimsg_setu16(msg, 1); /* B1 protocol = transparent */
- else
- msg = capimsg_setu16(msg, 0); /* B1 protocol = HDLC */
- msg = capimsg_setu16(msg, 1); /* B2 protocol = transparent */
- msg = capimsg_setu16(msg, 0); /* B3 protocol = transparent */
- msg = capimsg_setu8(msg, 0); /* B1 parameters */
- msg = capimsg_setu8(msg, 0); /* B2 parameters */
- msg = capimsg_setu8(msg, 0); /* B3 parameters */
-
- msg = capimsg_setu8(msg, 0); /* Bearer Capability */
- msg = capimsg_setu8(msg, 0); /* Low Layer Compatibility */
- msg = capimsg_setu8(msg, 0); /* High Layer Compatibility */
- msg = capimsg_setu8(msg, 0); /* Additional Info */
-
- sc->send(sc, m);
-}
-
-void capi_connect_conf(capi_softc_t *sc, struct mbuf *m_in)
-{
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- call_desc_t *cd;
- u_int16_t msgid;
- u_int32_t PLCI;
- u_int16_t Info;
- int bch;
-
- msg = capimsg_getu16(msg + 6, &msgid);
- msg = capimsg_getu32(msg, &PLCI);
- msg = capimsg_getu16(msg, &Info);
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if ((sc->sc_bchan[bch].state == B_CONNECT_CONF) &&
- (sc->sc_bchan[bch].msgid == msgid))
- break;
-
- if ((bch == sc->sc_nbch) ||
- (cd = cd_by_cdid(sc->sc_bchan[bch].cdid)) == NULL) {
- printf("capi%d: can't find channel for connect_conf PLCI %x\n",
- sc->sc_unit, PLCI);
- return;
- }
-
- if (Info == 0) {
- sc->sc_bchan[bch].state = B_CONNECT_ACTIVE_IND;
- sc->sc_bchan[bch].ncci = PLCI;
-
- i4b_l4_proceeding_ind(cd);
-
- } else {
- SET_CAUSE_TV(cd->cause_out, CAUSET_I4B, CAUSE_I4B_L1ERROR);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-
- sc->sc_bchan[bch].state = B_FREE;
- ctrl_desc[sc->ctrl_unit].bch_state[bch] = BCH_ST_FREE;
-
- printf("capi%d: can't connect out, info=%04x\n", sc->sc_unit, Info);
- }
-}
-
-void capi_connect_active_ind(capi_softc_t *sc, struct mbuf *m_in)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 4);
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- call_desc_t *cd;
- u_int16_t applid, msgid;
- u_int32_t PLCI;
- int bch;
-
- if (!m) {
- printf("capi%d: can't get mbuf for active_ind\n", sc->sc_unit);
- return;
- }
-
- msg = capimsg_getu16(msg + 2, &applid);
- msg = capimsg_getu16(msg + 2, &msgid);
- msg = capimsg_getu32(msg, &PLCI);
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if ((sc->sc_bchan[bch].state == B_CONNECT_ACTIVE_IND) &&
- (sc->sc_bchan[bch].ncci == PLCI))
- break;
-
- if ((bch == sc->sc_nbch) ||
- (cd = cd_by_cdid(sc->sc_bchan[bch].cdid)) == NULL) {
- printf("capi%d: can't find channel for active_resp, PLCI %x\n",
- sc->sc_unit, PLCI);
- return;
- }
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, applid);
- msg = capimsg_setu16(msg, CAPI_CONNECT_ACTIVE_RESP);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, PLCI);
-
- sc->send(sc, m);
-
- if (cd->crflag == CRF_ORIG) {
- capi_connect_b3_req(sc, cd);
-
- } else {
- sc->sc_bchan[bch].state = B_CONNECT_B3_IND;
- }
-}
-
-void capi_connect_b3_req(capi_softc_t *sc, call_desc_t *cd)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 5);
- u_int8_t *msg;
- u_int16_t msgid;
- u_int32_t PLCI;
-
- if (!m) {
- printf("capi%d: can't get mbuf for connect_b3_req\n", sc->sc_unit);
- return;
- }
-
- sc->sc_bchan[cd->channelid].state = B_CONNECT_B3_CONF;
- msgid = sc->sc_bchan[cd->channelid].msgid = sc->sc_msgid++;
- PLCI = (sc->sc_bchan[cd->channelid].ncci & CAPI_PLCI_MASK);
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_CONNECT_B3_REQ);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, PLCI);
- msg = capimsg_setu8(msg, 0); /* NCPI */
-
- sc->send(sc, m);
-}
-
-void capi_connect_b3_conf(capi_softc_t *sc, struct mbuf *m_in)
-{
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- call_desc_t *cd;
- u_int16_t msgid;
- u_int32_t NCCI;
- u_int16_t Info;
- int bch;
-
- msg = capimsg_getu16(msg + 6, &msgid);
- msg = capimsg_getu32(msg, &NCCI);
- msg = capimsg_getu16(msg, &Info);
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if ((sc->sc_bchan[bch].state == B_CONNECT_B3_CONF) &&
- (sc->sc_bchan[bch].ncci == (NCCI & CAPI_PLCI_MASK)))
- break;
-
- if ((bch == sc->sc_nbch) ||
- (cd = cd_by_cdid(sc->sc_bchan[bch].cdid)) == NULL) {
- printf("capi%d: can't find channel for connect_b3_conf NCCI %x\n",
- sc->sc_unit, NCCI);
- return;
- }
-
- if (Info == 0) {
- sc->sc_bchan[bch].ncci = NCCI;
- sc->sc_bchan[bch].state = B_CONNECT_B3_ACTIVE_IND;
-
- } else {
- SET_CAUSE_TV(cd->cause_in, CAUSET_I4B, CAUSE_I4B_OOO); /* XXX */
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-
- ctrl_desc[sc->ctrl_unit].bch_state[bch] = BCH_ST_RSVD;
-
- printf("capi%d: can't connect_b3 out, info=%04x\n", sc->sc_unit, Info);
-
- capi_disconnect_req(sc, cd);
- }
-}
-
-void capi_connect_b3_active_ind(capi_softc_t *sc, struct mbuf *m_in)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 4);
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- call_desc_t *cd;
- u_int16_t applid, msgid;
- u_int32_t NCCI;
- int bch;
-
- if (!m) {
- printf("capi%d: can't get mbuf for b3_active_ind\n", sc->sc_unit);
- return;
- }
-
- msg = capimsg_getu16(msg + 2, &applid);
- msg = capimsg_getu16(msg + 2, &msgid);
- msg = capimsg_getu32(msg, &NCCI);
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if ((sc->sc_bchan[bch].state == B_CONNECT_B3_ACTIVE_IND) &&
- (sc->sc_bchan[bch].ncci == NCCI))
- break;
-
- if ((bch == sc->sc_nbch) ||
- (cd = cd_by_cdid(sc->sc_bchan[bch].cdid)) == NULL) {
- printf("capi%d: can't find channel for b3_active_resp NCCI %x\n",
- sc->sc_unit, NCCI);
- return;
- }
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_CONNECT_B3_ACTIVE_RESP);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, NCCI);
-
- sc->send(sc, m);
-
- sc->sc_bchan[bch].state = B_CONNECTED;
- i4b_l4_connect_active_ind(cd);
-}
-
-/*
-// Incoming call setup:
-// --------------------
-//
-// <-- CAPI_CONNECT_IND
-// (consult Layer 4)
-// CAPI_CONNECT_RESP -->
-// <-- CAPI_CONNECT_ACTIVE_IND
-// CAPI_CONNECT_ACTIVE_RESP -->
-// <-- CAPI_CONNECT_B3_IND
-// CAPI_CONNECT_B3_RESP -->
-// <-- CAPI_CONNECT_B3_ACTIVE_IND
-// CAPI_CONNECT_B3_ACTIVE_RESP -->
-// (notify Layer 4)
-*/
-
-void capi_connect_ind(capi_softc_t *sc, struct mbuf *m_in)
-{
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- call_desc_t *cd;
- u_int16_t applid, msgid;
- u_int32_t PLCI;
- u_int16_t CIP;
- u_int8_t x, y, z;
- int bch;
-
- if ((cd = reserve_cd()) == NULL) {
- printf("capi%d: can't get cd for connect_ind\n", sc->sc_unit);
- return;
- }
-
- cd->controller = sc->ctrl_unit;
- cd->channelexcl = FALSE;
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if (sc->sc_bchan[bch].state == B_FREE) break;
- sc->sc_bchan[bch].state = B_CONNECT_IND;
- cd->channelid = bch; /* XXX CHAN_ANY XXX */
-
- cd->crflag = CRF_DEST;
- cd->cr = get_rand_cr(sc->sc_unit);
- cd->scr_ind = SCR_NONE;
- cd->prs_ind = PRS_NONE;
- cd->bprot = BPROT_NONE;
- cd->ilt = NULL;
- cd->dlt = NULL;
- cd->display[0] = '\0';
- cd->datetime[0] = '\0';
-
- msg = capimsg_getu16(msg + 2, &applid);
- msg = capimsg_getu16(msg + 2, &msgid);
- msg = capimsg_getu32(msg, &PLCI);
- msg = capimsg_getu16(msg, &CIP);
-
- cd->event = (int) msgid; /* XXX overload */
- cd->Q931state = (int) PLCI; /* XXX overload */
-
- switch (CIP) {
- case 0x0010:
- case 0x0001: cd->bprot = BPROT_NONE; break;
- case 0x0002: cd->bprot = BPROT_RHDLC; break;
- default:
- NDBGL4(L4_CAPIDBG, "capi%d: unknown CIP = %d", sc->sc_unit, CIP);
- cd->bprot = BPROT_NONE;
- }
-
- msg = capimsg_getu8(msg, &x); /* Called party struct len */
- if (x) {
- msg = capimsg_getu8(msg, &y); /* Numbering plan */
- z = x - 1;
- if (z >= TELNO_MAX) z = (TELNO_MAX-1);
- strncpy(cd->dst_telno, msg, z);
- msg += x;
- x = z;
- }
- cd->dst_telno[x] = '\0';
-
- msg = capimsg_getu8(msg, &x); /* Calling party struct len */
- if (x) {
- msg = capimsg_getu8(msg, &y); /* Numbering plan */
- msg = capimsg_getu8(msg, &y); /* Screening/Presentation */
- if ((y & 0x80) == 0) { /* screening used */
- cd->scr_ind = (y & 3) + SCR_USR_NOSC;
- cd->prs_ind = ((y >> 5) & 3) + PRS_ALLOWED;
- }
- z = x - 2;
- if (z >= TELNO_MAX) z = (TELNO_MAX-1);
- strncpy(cd->src_telno, msg, z);
- msg += x;
- x = z;
- }
- cd->src_telno[x] = '\0';
-
- i4b_l4_connect_ind(cd);
-}
-
-void capi_connect_resp(capi_softc_t *sc, call_desc_t *cd)
-{
- struct mbuf *m;
- u_int8_t *msg;
- u_int16_t msgid;
- u_int32_t PLCI;
- int dlen = strlen(cd->dst_telno);
-
- m = i4b_Dgetmbuf(8 + 21 + dlen);
- if (!m) {
- printf("capi%d: can't get mbuf for connect_resp\n", sc->sc_unit);
- return;
- }
-
- msgid = (u_int16_t) cd->event;
- PLCI = (u_int32_t) cd->Q931state;
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_CONNECT_RESP);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, PLCI);
-
- switch (cd->response) {
- case SETUP_RESP_ACCEPT:
- sc->sc_bchan[cd->channelid].cdid = cd->cdid;
- sc->sc_bchan[cd->channelid].ncci = PLCI;
- sc->sc_bchan[cd->channelid].state = B_CONNECT_ACTIVE_IND;
- ctrl_desc[sc->ctrl_unit].bch_state[cd->channelid] = BCH_ST_USED;
- msg = capimsg_setu16(msg, 0); /* Accept the call */
- break;
-
- case SETUP_RESP_REJECT:
- sc->sc_bchan[cd->channelid].state = B_FREE;
- ctrl_desc[sc->ctrl_unit].bch_state[cd->channelid] = BCH_ST_FREE;
- msg = capimsg_setu16(msg, 2); /* Reject, normal call clearing */
- break;
-
- case SETUP_RESP_DNTCRE:
- sc->sc_bchan[cd->channelid].state = B_FREE;
- ctrl_desc[sc->ctrl_unit].bch_state[cd->channelid] = BCH_ST_FREE;
- if (sc->sc_nbch == 30) {
- /* With PRI, we can't really ignore calls -- normal clearing */
- msg = capimsg_setu16(msg, (0x3480|CAUSE_Q850_NCCLR));
- } else {
- msg = capimsg_setu16(msg, 1); /* Ignore */
- }
- break;
-
- default:
- sc->sc_bchan[cd->channelid].state = B_FREE;
- ctrl_desc[sc->ctrl_unit].bch_state[cd->channelid] = BCH_ST_FREE;
- msg = capimsg_setu16(msg, (0x3480|CAUSE_Q850_CALLREJ));
- }
-
- msg = capimsg_setu8(msg, 15); /* B protocol */
- if (cd->bprot == BPROT_NONE)
- msg = capimsg_setu16(msg, 1); /* B1 protocol = transparent */
- else
- msg = capimsg_setu16(msg, 0); /* B1 protocol = HDLC */
- msg = capimsg_setu16(msg, 1); /* B2 protocol = transparent */
- msg = capimsg_setu16(msg, 0); /* B3 protocol = transparent */
- msg = capimsg_setu8(msg, 0); /* B1 parameters */
- msg = capimsg_setu8(msg, 0); /* B2 parameters */
- msg = capimsg_setu8(msg, 0); /* B3 parameters */
-
- msg = capimsg_setu8(msg, 1 + dlen);
- msg = capimsg_setu8(msg, 0x80); /* Numbering plan */
- strncpy(msg, cd->dst_telno, dlen);
- msg = capimsg_setu8(msg + dlen, 0); /* Connected subaddress */
- msg = capimsg_setu8(msg, 0); /* Low Layer Compatibility */
- msg = capimsg_setu8(msg, 0); /* Additional Info */
-
- sc->send(sc, m);
-}
-
-void capi_connect_b3_ind(capi_softc_t *sc, struct mbuf *m_in)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 7);
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- u_int16_t applid, msgid;
- u_int32_t NCCI;
- int bch;
-
- if (!m) {
- printf("capi%d: can't get mbuf for connect_b3_resp\n", sc->sc_unit);
- return;
- }
-
- msg = capimsg_getu16(msg + 2, &applid);
- msg = capimsg_getu16(msg + 2, &msgid);
- msg = capimsg_getu32(msg, &NCCI);
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if ((sc->sc_bchan[bch].state == B_CONNECT_B3_IND) &&
- (sc->sc_bchan[bch].ncci == (NCCI & CAPI_PLCI_MASK)))
- break;
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, applid);
- msg = capimsg_setu16(msg, CAPI_CONNECT_B3_RESP);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, NCCI);
-
- if (bch == sc->sc_nbch) {
- printf("capi%d: can't get cd for connect_b3_resp NCCI %x\n",
- sc->sc_unit, NCCI);
- msg = capimsg_setu16(msg, 8); /* Reject, destination OOO */
-
- } else {
- sc->sc_bchan[bch].ncci = NCCI;
- sc->sc_bchan[bch].state = B_CONNECT_B3_ACTIVE_IND;
- msg = capimsg_setu16(msg, 0); /* Accept */
- }
-
- msg = capimsg_setu8(msg, 0); /* NCPI */
-
- sc->send(sc, m);
-}
-
-/*
-// Data transfer:
-// --------------
-*/
-
-void capi_data_b3_req(capi_softc_t *sc, int chan, struct mbuf *m_b3)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 14);
- u_int8_t *msg;
- u_int16_t msgid;
-
- if (!m) {
- printf("capi%d: can't get mbuf for data_b3_req\n", sc->sc_unit);
- return;
- }
-
- msgid = sc->sc_bchan[chan].msgid = sc->sc_msgid++;
- sc->sc_bchan[chan].busy = 1;
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_DATA_B3_REQ);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, sc->sc_bchan[chan].ncci);
- msg = capimsg_setu32(msg, (u_int32_t) m_b3->m_data); /* Pointer */
- msg = capimsg_setu16(msg, m_b3->m_len);
- msg = capimsg_setu16(msg, chan);
- msg = capimsg_setu16(msg, 0); /* Flags */
-
- m->m_next = m_b3;
-
- sc->send(sc, m);
-}
-
-void capi_data_b3_conf(capi_softc_t *sc, struct mbuf *m_in)
-{
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- u_int32_t NCCI;
- u_int16_t handle;
- u_int16_t Info;
-
- msg = capimsg_getu32(msg + 8, &NCCI);
- msg = capimsg_getu16(msg, &handle);
- msg = capimsg_getu16(msg, &Info);
-
- if (Info == 0) {
- sc->sc_bchan[handle].busy = 0;
- capi_start_tx(sc, handle);
-
- } else {
- printf("capi%d: data_b3_conf NCCI %x handle %x info=%04x\n",
- sc->sc_unit, NCCI, handle, Info);
- }
-}
-
-void capi_data_b3_ind(capi_softc_t *sc, struct mbuf *m_in)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 6);
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- u_int16_t applid, msgid;
- u_int32_t NCCI;
- u_int16_t handle;
- int bch;
-
- if (!m) {
- printf("capi%d: can't get mbuf for data_b3_resp\n", sc->sc_unit);
- return;
- }
-
- msg = capimsg_getu16(msg + 2, &applid);
- msg = capimsg_getu16(msg + 2, &msgid);
- msg = capimsg_getu32(msg, &NCCI);
- msg = capimsg_getu16(msg + 6, &handle);
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if ((sc->sc_bchan[bch].state == B_CONNECTED) &&
- (sc->sc_bchan[bch].ncci == NCCI))
- break;
-
- if (bch == sc->sc_nbch) {
- printf("capi%d: can't find channel for data_b3_ind NCCI %x\n",
- sc->sc_unit, NCCI);
-
- } else {
- if (sc->sc_bchan[bch].bprot == BPROT_RHDLC) {
- /* HDLC drivers use rx_mbuf */
-
- sc->sc_bchan[bch].in_mbuf = m_in->m_next;
- sc->sc_bchan[bch].rxcount += m_in->m_next->m_len;
- m_in->m_next = NULL; /* driver frees */
-
- (*sc->sc_bchan[bch].capi_drvr_linktab->bch_rx_data_ready)(
- sc->sc_bchan[bch].capi_drvr_linktab->unit);
-
- } else {
- /* Telephony drivers use rx_queue */
-
- if (!_IF_QFULL(&sc->sc_bchan[bch].rx_queue)) {
- _IF_ENQUEUE(&sc->sc_bchan[bch].rx_queue, m_in->m_next);
- sc->sc_bchan[bch].rxcount += m_in->m_next->m_len;
- m_in->m_next = NULL; /* driver frees */
- }
-
- (*sc->sc_bchan[bch].capi_drvr_linktab->bch_rx_data_ready)(
- sc->sc_bchan[bch].capi_drvr_linktab->unit);
- }
- }
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_DATA_B3_RESP);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, NCCI);
- msg = capimsg_setu16(msg, handle);
-
- sc->send(sc, m);
-}
-
-/*
-// Connection teardown:
-// --------------------
-*/
-
-void capi_disconnect_req(capi_softc_t *sc, call_desc_t *cd)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 5);
- u_int8_t *msg;
- u_int16_t msgid;
- u_int32_t PLCI;
-
- if (!m) {
- printf("capi%d: can't get mbuf for disconnect_req\n", sc->sc_unit);
- return;
- }
-
- sc->sc_bchan[cd->channelid].state = B_DISCONNECT_CONF;
- ctrl_desc[sc->ctrl_unit].bch_state[cd->channelid] = BCH_ST_RSVD;
- msgid = sc->sc_bchan[cd->channelid].msgid = sc->sc_msgid++;
- PLCI = (sc->sc_bchan[cd->channelid].ncci & CAPI_PLCI_MASK);
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, I4BCAPI_APPLID);
- msg = capimsg_setu16(msg, CAPI_DISCONNECT_REQ);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, PLCI);
- msg = capimsg_setu8(msg, 0); /* Additional Info */
-
- sc->send(sc, m);
-}
-
-void capi_disconnect_conf(capi_softc_t *sc, struct mbuf *m_in)
-{
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- call_desc_t *cd;
- u_int32_t PLCI;
- int bch;
-
- msg = capimsg_getu32(msg + 8, &PLCI);
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if ((sc->sc_bchan[bch].state == B_DISCONNECT_CONF) &&
- ((sc->sc_bchan[bch].ncci & CAPI_PLCI_MASK) == PLCI))
- break;
-
- if (bch == sc->sc_nbch) {
- printf("capi%d: can't find channel for disconnect_conf PLCI %x\n",
- sc->sc_unit, PLCI);
- return;
- }
-
- cd = cd_by_cdid(sc->sc_bchan[bch].cdid);
- if (!cd) {
- printf("capi%d: can't find cd for disconnect_conf PLCI %x\n",
- sc->sc_unit, PLCI);
- } else {
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
- }
-
- sc->sc_bchan[bch].state = B_FREE;
- ctrl_desc[sc->ctrl_unit].bch_state[bch] = BCH_ST_FREE;
-}
-
-void capi_disconnect_b3_ind(capi_softc_t *sc, struct mbuf *m_in)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 4);
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- u_int16_t applid, msgid;
- u_int32_t NCCI;
-
- if (!m) {
- printf("capi%d: can't get mbuf for disconnect_b3_resp\n", sc->sc_unit);
- return;
- }
-
- msg = capimsg_getu16(msg + 2, &applid);
- msg = capimsg_getu16(msg + 2, &msgid);
- msg = capimsg_getu32(msg, &NCCI);
-
- /* XXX update bchan state? XXX */
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, applid);
- msg = capimsg_setu16(msg, CAPI_DISCONNECT_B3_RESP);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, NCCI);
-
- sc->send(sc, m);
-}
-
-void capi_disconnect_ind(capi_softc_t *sc, struct mbuf *m_in)
-{
- struct mbuf *m = i4b_Dgetmbuf(8 + 4);
- u_int8_t *msg = mtod(m_in, u_int8_t*);
- call_desc_t *cd;
- u_int16_t applid, msgid;
- u_int32_t PLCI;
- u_int16_t Reason;
- int bch;
-
- if (!m) {
- printf("capi%d: can't get mbuf for disconnect_resp\n", sc->sc_unit);
- return;
- }
-
- msg = capimsg_getu16(msg + 2, &applid);
- msg = capimsg_getu16(msg + 2, &msgid);
- msg = capimsg_getu32(msg, &PLCI);
- msg = capimsg_getu16(msg, &Reason);
-
- for (bch = 0; bch < sc->sc_nbch; bch++)
- if ((sc->sc_bchan[bch].state != B_FREE) &&
- ((sc->sc_bchan[bch].ncci & CAPI_PLCI_MASK) == PLCI))
- break;
-
- if (bch < sc->sc_nbch) {
- /* We may not have a bchan assigned if call was ignored. */
-
- cd = cd_by_cdid(sc->sc_bchan[bch].cdid);
- sc->sc_bchan[bch].state = B_DISCONNECT_IND;
- } else cd = NULL;
-
- if (cd) {
- if ((Reason & 0xff00) == 0x3400) {
- SET_CAUSE_TV(cd->cause_in, CAUSET_Q850, (Reason & 0x7f));
- } else {
- SET_CAUSE_TV(cd->cause_in, CAUSET_I4B, CAUSE_I4B_NORMAL);
- }
-
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-
- sc->sc_bchan[bch].state = B_FREE;
- ctrl_desc[sc->ctrl_unit].bch_state[bch] = BCH_ST_FREE;
- }
-
- msg = capimsg_setu16(mtod(m, u_int8_t*), m->m_len);
- msg = capimsg_setu16(msg, applid);
- msg = capimsg_setu16(msg, CAPI_DISCONNECT_RESP);
- msg = capimsg_setu16(msg, msgid);
-
- msg = capimsg_setu32(msg, PLCI);
-
- sc->send(sc, m);
-}
diff --git a/sys/i4b/capi/capi_msgs.h b/sys/i4b/capi/capi_msgs.h
deleted file mode 100644
index 5d8b3ab..0000000
--- a/sys/i4b/capi/capi_msgs.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/capi_msgs.h The CAPI i4b message and handler declarations.
- *
- * $FreeBSD$
- */
-
-#ifndef _I4B_CAPI_MSGS_H_
-#define _I4B_CAPI_MSGS_H_
-
-/* CAPI commands */
-
-#define CAPI_ALERT 0x01
-#define CAPI_CONNECT 0x02
-#define CAPI_CONNECT_ACTIVE 0x03
-#define CAPI_CONNECT_B3 0x82
-#define CAPI_CONNECT_B3_ACTIVE 0x83
-#define CAPI_CONNECT_B3_T90_ACTIVE 0x88
-#define CAPI_DATA_B3 0x86
-#define CAPI_DISCONNECT_B3 0x84
-#define CAPI_DISCONNECT 0x04
-#define CAPI_FACILITY 0x80
-#define CAPI_INFO 0x08
-#define CAPI_LISTEN 0x05
-#define CAPI_MANUFACTURER 0xff
-#define CAPI_RESET_B3 0x87
-#define CAPI_SELECT_B_PROTOCOL 0x41
-
-/* CAPI subcommands */
-
-#define CAPI_REQ 0x80
-#define CAPI_CONF 0x81
-#define CAPI_IND 0x82
-#define CAPI_RESP 0x83
-
-/* CAPI combined commands */
-
-#define CAPICMD(cmd,subcmd) (((subcmd)<<8)|(cmd))
-
-#define CAPI_DISCONNECT_REQ CAPICMD(CAPI_DISCONNECT,CAPI_REQ)
-#define CAPI_DISCONNECT_CONF CAPICMD(CAPI_DISCONNECT,CAPI_CONF)
-#define CAPI_DISCONNECT_IND CAPICMD(CAPI_DISCONNECT,CAPI_IND)
-#define CAPI_DISCONNECT_RESP CAPICMD(CAPI_DISCONNECT,CAPI_RESP)
-
-#define CAPI_ALERT_REQ CAPICMD(CAPI_ALERT,CAPI_REQ)
-#define CAPI_ALERT_CONF CAPICMD(CAPI_ALERT,CAPI_CONF)
-
-#define CAPI_CONNECT_REQ CAPICMD(CAPI_CONNECT,CAPI_REQ)
-#define CAPI_CONNECT_CONF CAPICMD(CAPI_CONNECT,CAPI_CONF)
-#define CAPI_CONNECT_IND CAPICMD(CAPI_CONNECT,CAPI_IND)
-#define CAPI_CONNECT_RESP CAPICMD(CAPI_CONNECT,CAPI_RESP)
-
-#define CAPI_CONNECT_ACTIVE_REQ CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_REQ)
-#define CAPI_CONNECT_ACTIVE_CONF CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_CONF)
-#define CAPI_CONNECT_ACTIVE_IND CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_IND)
-#define CAPI_CONNECT_ACTIVE_RESP CAPICMD(CAPI_CONNECT_ACTIVE,CAPI_RESP)
-
-#define CAPI_SELECT_B_PROTOCOL_REQ CAPICMD(CAPI_SELECT_B_PROTOCOL,CAPI_REQ)
-#define CAPI_SELECT_B_PROTOCOL_CONF CAPICMD(CAPI_SELECT_B_PROTOCOL,CAPI_CONF)
-
-#define CAPI_CONNECT_B3_REQ CAPICMD(CAPI_CONNECT_B3,CAPI_REQ)
-#define CAPI_CONNECT_B3_CONF CAPICMD(CAPI_CONNECT_B3,CAPI_CONF)
-#define CAPI_CONNECT_B3_IND CAPICMD(CAPI_CONNECT_B3,CAPI_IND)
-#define CAPI_CONNECT_B3_RESP CAPICMD(CAPI_CONNECT_B3,CAPI_RESP)
-
-#define CAPI_CONNECT_B3_ACTIVE_REQ CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_REQ)
-#define CAPI_CONNECT_B3_ACTIVE_CONF CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_CONF)
-#define CAPI_CONNECT_B3_ACTIVE_IND CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_IND)
-#define CAPI_CONNECT_B3_ACTIVE_RESP CAPICMD(CAPI_CONNECT_B3_ACTIVE,CAPI_RESP)
-
-#define CAPI_CONNECT_B3_T90_ACTIVE_IND CAPICMD(CAPI_CONNECT_B3_T90_ACTIVE,CAPI_IND)
-#define CAPI_CONNECT_B3_T90_ACTIVE_RESP CAPICMD(CAPI_CONNECT_B3_T90_ACTIVE,CAPI_RESP)
-
-#define CAPI_DATA_B3_REQ CAPICMD(CAPI_DATA_B3,CAPI_REQ)
-#define CAPI_DATA_B3_CONF CAPICMD(CAPI_DATA_B3,CAPI_CONF)
-#define CAPI_DATA_B3_IND CAPICMD(CAPI_DATA_B3,CAPI_IND)
-#define CAPI_DATA_B3_RESP CAPICMD(CAPI_DATA_B3,CAPI_RESP)
-
-#define CAPI_DISCONNECT_B3_REQ CAPICMD(CAPI_DISCONNECT_B3,CAPI_REQ)
-#define CAPI_DISCONNECT_B3_CONF CAPICMD(CAPI_DISCONNECT_B3,CAPI_CONF)
-#define CAPI_DISCONNECT_B3_IND CAPICMD(CAPI_DISCONNECT_B3,CAPI_IND)
-#define CAPI_DISCONNECT_B3_RESP CAPICMD(CAPI_DISCONNECT_B3,CAPI_RESP)
-
-#define CAPI_RESET_B3_REQ CAPICMD(CAPI_RESET_B3,CAPI_REQ)
-#define CAPI_RESET_B3_CONF CAPICMD(CAPI_RESET_B3,CAPI_CONF)
-#define CAPI_RESET_B3_IND CAPICMD(CAPI_RESET_B3,CAPI_IND)
-#define CAPI_RESET_B3_RESP CAPICMD(CAPI_RESET_B3,CAPI_RESP)
-
-#define CAPI_LISTEN_REQ CAPICMD(CAPI_LISTEN,CAPI_REQ)
-#define CAPI_LISTEN_CONF CAPICMD(CAPI_LISTEN,CAPI_CONF)
-
-#define CAPI_MANUFACTURER_REQ CAPICMD(CAPI_MANUFACTURER,CAPI_REQ)
-#define CAPI_MANUFACTURER_CONF CAPICMD(CAPI_MANUFACTURER,CAPI_CONF)
-#define CAPI_MANUFACTURER_IND CAPICMD(CAPI_MANUFACTURER,CAPI_IND)
-#define CAPI_MANUFACTURER_RESP CAPICMD(CAPI_MANUFACTURER,CAPI_RESP)
-
-#define CAPI_FACILITY_REQ CAPICMD(CAPI_FACILITY,CAPI_REQ)
-#define CAPI_FACILITY_CONF CAPICMD(CAPI_FACILITY,CAPI_CONF)
-#define CAPI_FACILITY_IND CAPICMD(CAPI_FACILITY,CAPI_IND)
-#define CAPI_FACILITY_RESP CAPICMD(CAPI_FACILITY,CAPI_RESP)
-
-#define CAPI_INFO_REQ CAPICMD(CAPI_INFO,CAPI_REQ)
-#define CAPI_INFO_CONF CAPICMD(CAPI_INFO,CAPI_CONF)
-#define CAPI_INFO_IND CAPICMD(CAPI_INFO,CAPI_IND)
-#define CAPI_INFO_RESP CAPICMD(CAPI_INFO,CAPI_RESP)
-
-/* CAPI message access helpers */
-
-/*
- * CAPI message header:
- * word Length
- * word ApplId
- * byte Command
- * byte Subcommand
- * word MsgId
- *
- * Note that in the following, Controller/PLCI/NCCI is coded as follows:
- * bits 0..6 = controller, bit 7 = ext/int, bits 8..15 = PLCI, and
- * bits 16..31 = NCCI value.
- *
- * ALERT_REQ, 01 80:
- * dword PLCI
- * struct Additional Info
- *
- * ALERT_CONF, 01 81:
- * dword PLCI
- * word Info (0 = OK, other = cause)
- *
- * CONNECT_REQ, 02 80:
- * dword controller
- * word CIP
- * struct Called party number
- * struct Calling party number
- * struct Called party subaddress
- * struct Calling party subaddress
- * struct Bearer Capability
- * struct Low Layer Compatibility
- * struct High Layer Compatibility
- * struct Additional Info
- *
- * CONNECT_CONF, 02 81:
- * dword PLCI
- * word Info (0 = OK, other = cause)
- *
- * CONNECT_IND, 02 82:
- * dword PLCI
- * word CIP
- * struct Called party number
- * struct Calling party number
- * struct Called party subaddress
- * struct Calling party subaddress
- * struct Bearer Capability
- * struct Low Layer Compatibility
- * struct High Layer Compatibility
- * struct Additional Info
- * struct Second Calling party number
- *
- * CONNECT_RESP, 02 83:
- * dword PLCI
- * word Reject (0 = accept, 1 = ignore, 2 = reject/normal clearing)
- * struct B protocol
- * struct Connected number
- * struct Connected subaddress
- * struct Low Layer Compatibility
- * struct Additional Info
- *
- * CONNECT_ACTIVE_IND, 03 82:
- * dword PLCI
- * struct Connected number
- * struct Connected subaddress
- * struct Low Layer Compatibility
- *
- * CONNECT_ACTIVE_RESP, 03 83:
- * dword PLCI
- *
- * CONNECT_B3_REQ, 82 80:
- * dword PLCI
- * struct NCPI
- *
- * CONNECT_B3_CONF, 82 81:
- * dword NCCI
- * word Info (0 = connected, other = cause)
- *
- * CONNECT_B3_IND, 82 82:
- * dword NCCI
- * struct NCPI
- *
- * CONNECT_B3_RESP, 82 83:
- * dword NCCI
- * word Reject (0 = accept, 2 = reject/normal clearing)
- * struct NCPI
- *
- * CONNECT_B3_ACTIVE_IND, 83 82:
- * dword NCCI
- * struct NCPI
- *
- * CONNECT_B3_ACTIVE_RESP, 83 83:
- * dword NCCI
- *
- * DATA_B3_REQ, 86 80:
- * dword NCCI
- * dword Data pointer
- * word Data length
- * word Data handle (packet id)
- * word Flags (02 = more)
- *
- * DATA_B3_CONF, 86 81:
- * dword NCCI
- * word Data handle (packet id)
- * word Info (0 = OK, other = cause)
- *
- * DATA_B3_IND, 86 82:
- * dword NCCI
- * dword Data pointer
- * word Data length
- * word Data handle (packet id)
- * word Flags (02 = more)
- *
- * DATA_B3_RESP, 86 83:
- * dword NCCI
- * word Data handle (packet id)
- *
- * DISCONNECT_B3_REQ, 84 80:
- * dword NCCI
- * struct NCPI
- *
- * DISCONNECT_B3_CONF, 84 81:
- * dword NCCI
- * word Info (0 = OK, other = cause)
- *
- * DISCONNECT_B3_IND, 84 82:
- * dword NCCI
- * word Reason
- * struct NCPI
- *
- * DISCONNECT_B3_RESP, 84 83:
- * dword NCCI
- *
- * DISCONNECT_REQ, 04 80:
- * dword PLCI
- * struct Additional Info
- *
- * DISCONNECT_CONF, 04 81:
- * dword PLCI
- * word Info (0 = OK, other = cause)
- *
- * DISCONNECT_IND, 04 82:
- * dword PLCI
- * word Reason
- *
- * DISCONNECT_RESP, 04 83:
- * dword PLCI
- *
- * LISTEN_REQ, 05 80:
- * dword Controller
- * dword Info mask (bits 0..9 used)
- * dword CIP Mask (bit 0 = any match)
- * dword CIP Mask 2 (bit 0 = any match)
- * struct Calling party number
- * struct Calling party subaddress
- *
- * LISTEN_CONF, 05 81:
- * dword Controller
- * word Info (0 = OK, other = cause)
- *
- * INFO_REQ, 08 80:
- * dword Controller/PLCI
- * struct Called party number
- * struct Additional Info
- *
- * INFO_CONF, 08 81:
- * dword Controller/PLCI
- * word Info (0 = OK, other = cause)
- *
- * INFO_IND, 08 82:
- * dword Controller/PLCI
- * word Info number
- * struct Info element
- *
- * INFO_RESP, 08 83:
- * dword Controller/PLCI
- */
-
-#define CAPIMSG_LEN(msg) (msg[0]|(msg[1]<<8))
-#define CAPIMSG_DATALEN(msg) (msg[16]|(msg[17]<<8))
-
-static __inline u_int8_t* capimsg_getu8(u_int8_t *msg, u_int8_t *val)
-{
- *val = *msg;
- return (msg + 1);
-}
-
-static __inline u_int8_t* capimsg_getu16(u_int8_t *msg, u_int16_t *val)
-{
- *val = (msg[0]|(msg[1]<<8));
- return (msg + 2);
-}
-
-static __inline u_int8_t* capimsg_getu32(u_int8_t *msg, u_int32_t *val)
-{
- *val = (msg[0]|(msg[1]<<8)|(msg[2]<<16)|(msg[3]<<24));
- return (msg + 4);
-}
-
-static __inline u_int8_t* capimsg_setu8(u_int8_t *msg, u_int8_t val)
-{
- msg[0] = val;
- return (msg + 1);
-}
-
-static __inline u_int8_t* capimsg_setu16(u_int8_t *msg, u_int16_t val)
-{
- msg[0] = (val & 0xff);
- msg[1] = (val >> 8) & 0xff;
- return (msg + 2);
-}
-
-static __inline u_int8_t* capimsg_setu32(u_int8_t *msg, u_int32_t val)
-{
- msg[0] = (val & 0xff);
- msg[1] = (val >> 8) & 0xff;
- msg[2] = (val >> 16) & 0xff;
- msg[3] = (val >> 24) & 0xff;
- return (msg + 4);
-}
-
-/*
-// CAPI message handlers called by higher layers
-*/
-
-extern void capi_listen_req(capi_softc_t *sc, u_int32_t CIP);
-extern void capi_alert_req(capi_softc_t *sc, call_desc_t *cd);
-extern void capi_connect_req(capi_softc_t *sc, call_desc_t *cd);
-extern void capi_connect_b3_req(capi_softc_t *sc, call_desc_t *cd);
-extern void capi_connect_resp(capi_softc_t *sc, call_desc_t *cd);
-extern void capi_data_b3_req(capi_softc_t *sc, int chan, struct mbuf *m);
-extern void capi_disconnect_req(capi_softc_t *sc, call_desc_t *cd);
-
-/*
-// CAPI message handlers called by the receive routine
-*/
-
-extern void capi_listen_conf(capi_softc_t *sc, struct mbuf *m);
-extern void capi_info_ind(capi_softc_t *sc, struct mbuf *m);
-extern void capi_alert_conf(capi_softc_t *sc, struct mbuf *m);
-extern void capi_connect_conf(capi_softc_t *sc, struct mbuf *m);
-extern void capi_connect_active_ind(capi_softc_t *sc, struct mbuf *m);
-extern void capi_connect_b3_conf(capi_softc_t *sc, struct mbuf *m);
-extern void capi_connect_b3_active_ind(capi_softc_t *sc, struct mbuf *m);
-extern void capi_connect_ind(capi_softc_t *sc, struct mbuf *m);
-extern void capi_connect_b3_ind(capi_softc_t *sc, struct mbuf *m);
-extern void capi_data_b3_conf(capi_softc_t *sc, struct mbuf *m);
-extern void capi_data_b3_ind(capi_softc_t *sc, struct mbuf *m);
-extern void capi_disconnect_conf(capi_softc_t *sc, struct mbuf *m);
-extern void capi_disconnect_b3_ind(capi_softc_t *sc, struct mbuf *m);
-extern void capi_disconnect_ind(capi_softc_t *sc, struct mbuf *m);
-
-#endif /* _I4B_CAPI_MSGS_H_ */
diff --git a/sys/i4b/capi/iavc/iavc.h b/sys/i4b/capi/iavc/iavc.h
deleted file mode 100644
index cfe60a9..0000000
--- a/sys/i4b/capi/iavc/iavc.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/iavc/iavc.h The AVM ISDN controllers' common declarations.
- *
- * $FreeBSD$
- */
-
-#ifndef _CAPI_IAVC_H_
-#define _CAPI_IAVC_H_
-
-/* max 4 units supported per machine */
-
-#define IAVC_MAXUNIT 4
-
-/*
-// iavc_softc_t
-// The software context of one AVM T1 controller.
-*/
-
-#define IAVC_IO_BASES 1
-
-typedef struct i4b_info {
- struct resource * io_base[IAVC_IO_BASES];
- int io_rid [IAVC_IO_BASES];
- struct resource * irq;
- int irq_rid;
- struct resource * mem;
- int mem_rid;
-} i4b_info_t;
-
-typedef struct iavc_softc {
- capi_softc_t sc_capi;
- int sc_unit;
- int sc_cardtyp;
-
- u_int32_t sc_membase;
- bus_space_handle_t sc_mem_bh;
- bus_space_tag_t sc_mem_bt;
- u_int32_t sc_iobase;
- bus_space_handle_t sc_io_bh;
- bus_space_tag_t sc_io_bt;
-
- int sc_state;
-#define IAVC_DOWN 0
-#define IAVC_POLL 1
-#define IAVC_INIT 2
-#define IAVC_UP 3
- int sc_blocked;
- int sc_dma;
- int sc_t1;
- int sc_intr;
-
- u_int32_t sc_csr;
-
- char sc_sendbuf[128+2048];
- char sc_recvbuf[128+2048];
- int sc_recvlen;
-
- struct ifqueue sc_txq;
-
- i4b_info_t sc_resources;
-} iavc_softc_t;
-
-extern iavc_softc_t iavc_sc[];
-
-#define iavc_find_sc(unit) (&iavc_sc[(unit)])
-
-/*
-// {b1,b1dma,t1}_{detect,reset}
-// Routines to detect and manage the specific type of card.
-*/
-
-extern int b1_detect(iavc_softc_t *sc);
-extern void b1_disable_irq(iavc_softc_t *sc);
-extern void b1_reset(iavc_softc_t *sc);
-
-extern int b1dma_detect(iavc_softc_t *sc);
-extern void b1dma_reset(iavc_softc_t *sc);
-
-extern int t1_detect(iavc_softc_t *sc);
-extern void t1_disable_irq(iavc_softc_t *sc);
-extern void t1_reset(iavc_softc_t *sc);
-
-/*
-// AMCC_{READ,WRITE}
-// Routines to access the memory mapped registers of the
-// S5933 DMA controller.
-*/
-
-static __inline u_int32_t AMCC_READ(iavc_softc_t *sc, int off)
-{
- return bus_space_read_4(sc->sc_mem_bt, sc->sc_mem_bh, off);
-}
-
-static __inline void AMCC_WRITE(iavc_softc_t *sc, int off, u_int32_t value)
-{
- bus_space_write_4(sc->sc_mem_bt, sc->sc_mem_bh, off, value);
-}
-
-/*
-// amcc_{put,get}_{byte,word}
-// Routines to access the DMA buffers byte- or wordwise.
-*/
-
-static __inline u_int8_t* amcc_put_byte(u_int8_t *buf, u_int8_t value)
-{
- *buf++ = value;
- return buf;
-}
-
-static __inline u_int8_t* amcc_get_byte(u_int8_t *buf, u_int8_t *value)
-{
- *value = *buf++;
- return buf;
-}
-
-static __inline u_int8_t* amcc_put_word(u_int8_t *buf, u_int32_t value)
-{
- *buf++ = (value & 0xff);
- *buf++ = (value >> 8) & 0xff;
- *buf++ = (value >> 16) & 0xff;
- *buf++ = (value >> 24) & 0xff;
- return buf;
-}
-
-static __inline u_int8_t* amcc_get_word(u_int8_t *buf, u_int32_t *value)
-{
- *value = *buf++;
- *value |= (*buf++ << 8);
- *value |= (*buf++ << 16);
- *value |= (*buf++ << 24);
- return buf;
-}
-
-/*
-// Controller LLI message numbers.
-*/
-
-#define SEND_POLL 0x72
-#define SEND_INIT 0x11
-#define SEND_REGISTER 0x12
-#define SEND_DATA_B3_REQ 0x13
-#define SEND_RELEASE 0x14
-#define SEND_MESSAGE 0x15
-#define SEND_CONFIG 0x71
-#define SEND_POLLACK 0x73
-
-#define RECEIVE_POLL 0x32
-#define RECEIVE_INIT 0x27
-#define RECEIVE_MESSAGE 0x21
-#define RECEIVE_DATA_B3_IND 0x22
-#define RECEIVE_START 0x23
-#define RECEIVE_STOP 0x24
-#define RECEIVE_NEW_NCCI 0x25
-#define RECEIVE_FREE_NCCI 0x26
-#define RECEIVE_RELEASE 0x26
-#define RECEIVE_TASK_READY 0x31
-#define RECEIVE_DEBUGMSG 0x71
-#define RECEIVE_POLLDWORD 0x75
-
-/* Operation constants */
-
-#define WRITE_REGISTER 0x00
-#define READ_REGISTER 0x01
-
-/* Port offsets in I/O space */
-
-#define B1_READ 0x00
-#define B1_WRITE 0x01
-#define B1_INSTAT 0x02
-#define B1_OUTSTAT 0x03
-#define B1_ANALYSE 0x04
-#define B1_REVISION 0x05
-#define B1_RESET 0x10
-
-#define T1_FASTLINK 0x00
-#define T1_SLOWLINK 0x08
-
-#define T1_READ B1_READ
-#define T1_WRITE B1_WRITE
-#define T1_INSTAT B1_INSTAT
-#define T1_OUTSTAT B1_OUTSTAT
-#define T1_IRQENABLE 0x05
-#define T1_FIFOSTAT 0x06
-#define T1_RESETLINK 0x10
-#define T1_ANALYSE 0x11
-#define T1_IRQMASTER 0x12
-#define T1_IDENT 0x17
-#define T1_RESETBOARD 0x1f
-
-#define T1F_IREADY 0x01
-#define T1F_IHALF 0x02
-#define T1F_IFULL 0x04
-#define T1F_IEMPTY 0x08
-#define T1F_IFLAGS 0xf0
-
-#define T1F_OREADY 0x10
-#define T1F_OHALF 0x20
-#define T1F_OEMPTY 0x40
-#define T1F_OFULL 0x80
-#define T1F_OFLAGS 0xf0
-
-#define FIFO_OUTBSIZE 256
-#define FIFO_INPBSIZE 512
-
-#define HEMA_VERSION_ID 0
-#define HEMA_PAL_ID 0
-
-/*
-// S5933 DMA controller register offsets in memory, and bitmasks.
-*/
-
-#define AMCC_RXPTR 0x24
-#define AMCC_RXLEN 0x28
-#define AMCC_TXPTR 0x2c
-#define AMCC_TXLEN 0x30
-
-#define AMCC_INTCSR 0x38
-#define EN_READ_TC_INT 0x00008000
-#define EN_WRITE_TC_INT 0x00004000
-#define EN_TX_TC_INT EN_READ_TC_INT
-#define EN_RX_TC_INT EN_WRITE_TC_INT
-#define AVM_FLAG 0x30000000
-
-#define ANY_S5933_INT 0x00800000
-#define READ_TC_INT 0x00080000
-#define WRITE_TC_INT 0x00040000
-#define TX_TC_INT READ_TC_INT
-#define RX_TC_INT WRITE_TC_INT
-#define MASTER_ABORT_INT 0x00100000
-#define TARGET_ABORT_INT 0x00200000
-#define BUS_MASTER_INT 0x00200000
-#define ALL_INT 0x000c0000
-
-#define AMCC_MCSR 0x3c
-#define A2P_HI_PRIORITY 0x00000100
-#define EN_A2P_TRANSFERS 0x00000400
-#define P2A_HI_PRIORITY 0x00001000
-#define EN_P2A_TRANSFERS 0x00004000
-#define RESET_A2P_FLAGS 0x04000000
-#define RESET_P2A_FLAGS 0x02000000
-
-/*
-// (B1IO_WAIT_MAX * B1IO_WAIT_DLY) is the max wait in us for the card
-// to become ready after an I/O operation. The default is 1 ms.
-*/
-
-#define B1IO_WAIT_MAX 1000
-#define B1IO_WAIT_DLY 1
-
-/*
-// b1io_outp
-// Diagnostic output routine, returns the written value via
-// the device's analysis register.
-//
-// b1io_rx_full
-// Returns nonzero if data is readable from the card via the
-// I/O ports.
-//
-// b1io_tx_empty
-// Returns nonzero if data can be written to the card via the
-// I/O ports.
-*/
-
-static __inline u_int8_t b1io_outp(iavc_softc_t *sc, int off, u_int8_t val)
-{
- bus_space_write_1(sc->sc_io_bt, sc->sc_io_bh, off, val);
- DELAY(1);
- return bus_space_read_1(sc->sc_io_bt, sc->sc_io_bh, B1_ANALYSE);
-}
-
-static __inline int b1io_rx_full(iavc_softc_t *sc)
-{
- u_int8_t val = bus_space_read_1(sc->sc_io_bt, sc->sc_io_bh, B1_INSTAT);
- return (val & 0x01);
-}
-
-static __inline int b1io_tx_empty(iavc_softc_t *sc)
-{
- u_int8_t val = bus_space_read_1(sc->sc_io_bt, sc->sc_io_bh, B1_OUTSTAT);
- return (val & 0x01);
-}
-
-/*
-// b1io_{get,put}_{byte,word}
-// Routines to read and write the device I/O registers byte- or
-// wordwise.
-//
-// b1io_{get,put}_slice
-// Routines to read and write sequential bytes to the device
-// I/O registers.
-*/
-
-u_int8_t b1io_get_byte(iavc_softc_t *sc);
-int b1io_put_byte(iavc_softc_t *sc, u_int8_t val);
-
-int b1io_save_put_byte(iavc_softc_t *sc, u_int8_t val);
-
-u_int32_t b1io_get_word(iavc_softc_t *sc);
-void b1io_put_word(iavc_softc_t *sc, u_int32_t val);
-
-int b1io_get_slice(iavc_softc_t *sc, u_int8_t *dp);
-void b1io_put_slice(iavc_softc_t *sc, u_int8_t *dp, int len);
-
-/*
-// b1io_{read,write}_reg
-// Routines to read and write the device registers via the I/O
-// ports.
-*/
-
-u_int32_t b1io_read_reg(iavc_softc_t *sc, int reg);
-u_int32_t b1io_write_reg(iavc_softc_t *sc, int reg, u_int32_t val);
-
-/*
-// t1io_outp
-// I/O port write operation for the T1, which does not seem
-// to have the analysis port.
-*/
-
-static __inline void t1io_outp(iavc_softc_t *sc, int off, u_int8_t val)
-{
- bus_space_write_1(sc->sc_io_bt, sc->sc_io_bh, off, val);
-}
-
-static __inline u_int8_t t1io_inp(iavc_softc_t *sc, int off)
-{
- return bus_space_read_1(sc->sc_io_bt, sc->sc_io_bh, off);
-}
-
-static __inline int t1io_isfastlink(iavc_softc_t *sc)
-{
- return ((bus_space_read_1(sc->sc_io_bt, sc->sc_io_bh, T1_IDENT) & ~0x82) == 1);
-}
-
-static __inline u_int8_t t1io_fifostatus(iavc_softc_t *sc)
-{
- return bus_space_read_1(sc->sc_io_bt, sc->sc_io_bh, T1_FIFOSTAT);
-}
-
-int t1io_get_slice(iavc_softc_t *sc, u_int8_t *dp);
-void t1io_put_slice(iavc_softc_t *sc, u_int8_t *dp, int len);
-
-/*
-// An attempt to bring it all together:
-// ------------------------------------
-//
-// iavc_{read,write}_reg
-// Routines to access the device registers via the I/O port.
-//
-// iavc_{read,write}_port
-// Routines to access the device I/O ports.
-//
-// iavc_tx_empty, iavc_rx_full
-// Routines to check when the device has drained the last written
-// byte, or produced a full byte to read.
-//
-// iavc_{get,put}_byte
-// Routines to read/write byte values to the device via the I/O port.
-//
-// iavc_{get,put}_word
-// Routines to read/write 32-bit words to the device via the I/O port.
-//
-// iavc_{get,put}_slice
-// Routines to read/write {length, data} pairs to the device via the
-// ubiquituous I/O port. Uses the HEMA FIFO on a T1.
-*/
-
-#define iavc_read_reg(sc, reg) b1io_read_reg(sc, reg)
-#define iavc_write_reg(sc, reg, val) b1io_write_reg(sc, reg, val)
-
-#define iavc_read_port(sc, port) \
- bus_space_read_1(sc->sc_io_bt, sc->sc_io_bh, (port))
-#define iavc_write_port(sc, port, val) \
- bus_space_write_1(sc->sc_io_bt, sc->sc_io_bh, (port), (val))
-
-#define iavc_tx_empty(sc) b1io_tx_empty(sc)
-#define iavc_rx_full(sc) b1io_rx_full(sc)
-
-#define iavc_get_byte(sc) b1io_get_byte(sc)
-#define iavc_put_byte(sc, val) b1io_put_byte(sc, val)
-#define iavc_get_word(sc) b1io_get_word(sc)
-#define iavc_put_word(sc, val) b1io_put_word(sc, val)
-
-static __inline u_int32_t iavc_get_slice(iavc_softc_t *sc, u_int8_t *dp)
-{
- if (sc->sc_t1) return t1io_get_slice(sc, dp);
- else return b1io_get_slice(sc, dp);
-}
-
-static __inline void iavc_put_slice(iavc_softc_t *sc, u_int8_t *dp, int len)
-{
- if (sc->sc_t1) t1io_put_slice(sc, dp, len);
- else b1io_put_slice(sc, dp, len);
-}
-
-/*
-// iavc_handle_intr
-// Interrupt handler, called by the bus specific interrupt routine
-// in iavc_<bustype>.c module.
-//
-// iavc_load
-// CAPI callback. Resets device and loads firmware.
-//
-// iavc_register
-// CAPI callback. Registers an application id.
-//
-// iavc_release
-// CAPI callback. Releases an application id.
-//
-// iavc_send
-// CAPI callback. Sends a CAPI message. A B3_DATA_REQ message has
-// m_next point to a data mbuf.
-*/
-
-extern void iavc_handle_intr(iavc_softc_t *);
-extern int iavc_load(capi_softc_t *, int, u_int8_t *);
-extern int iavc_register(capi_softc_t *, int, int);
-extern int iavc_release(capi_softc_t *, int);
-extern int iavc_send(capi_softc_t *, struct mbuf *);
-
-extern void b1isa_setup_irq(struct iavc_softc *sc);
-
-#endif /* _CAPI_IAVC_H_ */
diff --git a/sys/i4b/capi/iavc/iavc_card.c b/sys/i4b/capi/iavc/iavc_card.c
deleted file mode 100644
index c064950..0000000
--- a/sys/i4b/capi/iavc/iavc_card.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/iavc/iavc_card.c
- * The AVM ISDN controllers' card specific support routines.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/capi/capi.h>
-
-#include <i4b/capi/iavc/iavc.h>
-
-/*
-// AVM B1 (active BRI, PIO mode)
-*/
-
-int b1_detect(iavc_softc_t *sc)
-{
- if ((iavc_read_port(sc, B1_INSTAT) & 0xfc) ||
- (iavc_read_port(sc, B1_OUTSTAT) & 0xfc))
- return (1);
-
- b1io_outp(sc, B1_INSTAT, 0x02);
- b1io_outp(sc, B1_OUTSTAT, 0x02);
- if ((iavc_read_port(sc, B1_INSTAT) & 0xfe) != 2 ||
- (iavc_read_port(sc, B1_OUTSTAT) & 0xfe) != 2)
- return (2);
-
- b1io_outp(sc, B1_INSTAT, 0x00);
- b1io_outp(sc, B1_OUTSTAT, 0x00);
- if ((iavc_read_port(sc, B1_INSTAT) & 0xfe) ||
- (iavc_read_port(sc, B1_OUTSTAT) & 0xfe))
- return (3);
-
- return (0); /* found */
-}
-
-void b1_disable_irq(iavc_softc_t *sc)
-{
- b1io_outp(sc, B1_INSTAT, 0x00);
-}
-
-void b1_reset(iavc_softc_t *sc)
-{
- b1io_outp(sc, B1_RESET, 0);
- DELAY(55*2*1000);
-
- b1io_outp(sc, B1_RESET, 1);
- DELAY(55*2*1000);
-
- b1io_outp(sc, B1_RESET, 0);
- DELAY(55*2*1000);
-}
-
-/*
-// Newer PCI-based B1's, and T1's, supports DMA
-*/
-
-int b1dma_detect(iavc_softc_t *sc)
-{
- AMCC_WRITE(sc, AMCC_MCSR, 0);
- DELAY(10*1000);
- AMCC_WRITE(sc, AMCC_MCSR, 0x0f000000);
- DELAY(10*1000);
- AMCC_WRITE(sc, AMCC_MCSR, 0);
- DELAY(42*1000);
-
- AMCC_WRITE(sc, AMCC_RXLEN, 0);
- AMCC_WRITE(sc, AMCC_TXLEN, 0);
- sc->sc_csr = 0;
- AMCC_WRITE(sc, AMCC_INTCSR, sc->sc_csr);
-
- if (AMCC_READ(sc, AMCC_INTCSR) != 0)
- return 1;
-
- AMCC_WRITE(sc, AMCC_RXPTR, 0xffffffff);
- AMCC_WRITE(sc, AMCC_TXPTR, 0xffffffff);
- if ((AMCC_READ(sc, AMCC_RXPTR) != 0xfffffffc) ||
- (AMCC_READ(sc, AMCC_TXPTR) != 0xfffffffc))
- return 2;
-
- AMCC_WRITE(sc, AMCC_RXPTR, 0);
- AMCC_WRITE(sc, AMCC_TXPTR, 0);
- if ((AMCC_READ(sc, AMCC_RXPTR) != 0) ||
- (AMCC_READ(sc, AMCC_TXPTR) != 0))
- return 3;
-
- iavc_write_port(sc, 0x10, 0x00);
- iavc_write_port(sc, 0x07, 0x00);
-
- iavc_write_port(sc, 0x02, 0x02);
- iavc_write_port(sc, 0x03, 0x02);
-
- if (((iavc_read_port(sc, 0x02) & 0xfe) != 0x02) ||
- (iavc_read_port(sc, 0x03) != 0x03))
- return 4;
-
- iavc_write_port(sc, 0x02, 0x00);
- iavc_write_port(sc, 0x03, 0x00);
-
- if (((iavc_read_port(sc, 0x02) & 0xfe) != 0x00) ||
- (iavc_read_port(sc, 0x03) != 0x01))
- return 5;
-
- return (0); /* found */
-}
-
-void b1dma_reset(iavc_softc_t *sc)
-{
- int s = SPLI4B();
-
- sc->sc_csr = 0;
- AMCC_WRITE(sc, AMCC_INTCSR, sc->sc_csr);
- AMCC_WRITE(sc, AMCC_MCSR, 0);
- AMCC_WRITE(sc, AMCC_RXLEN, 0);
- AMCC_WRITE(sc, AMCC_TXLEN, 0);
-
- iavc_write_port(sc, 0x10, 0x00); /* XXX magic numbers from */
- iavc_write_port(sc, 0x07, 0x00); /* XXX the linux driver */
-
- splx(s);
-
- AMCC_WRITE(sc, AMCC_MCSR, 0);
- DELAY(10 * 1000);
- AMCC_WRITE(sc, AMCC_MCSR, 0x0f000000);
- DELAY(10 * 1000);
- AMCC_WRITE(sc, AMCC_MCSR, 0);
- DELAY(42 * 1000);
-}
-
-/*
-// AVM T1 (active PRI)
-*/
-
-/* XXX how do these differ from b1io_{read,write}_reg()? XXX */
-
-static int b1dma_tx_empty(int iobase)
-{ return inb(iobase + 3) & 1; }
-
-static int b1dma_rx_full(int iobase)
-{ return inb(iobase + 2) & 1; }
-
-static int b1dma_tolink(iavc_softc_t *sc, void *buf, int len)
-{
- volatile int spin;
- char *s = (char*) buf;
- while (len--) {
- spin = 0;
- while (!b1dma_tx_empty(sc->sc_iobase) && spin < 100000)
- spin++;
- if (!b1dma_tx_empty(sc->sc_iobase))
- return -1;
- t1io_outp(sc, 1, *s++);
- }
- return 0;
-}
-
-static int b1dma_fromlink(iavc_softc_t *sc, void *buf, int len)
-{
- volatile int spin;
- char *s = (char*) buf;
- while (len--) {
- spin = 0;
- while (!b1dma_rx_full(sc->sc_iobase) && spin < 100000)
- spin++;
- if (!b1dma_rx_full(sc->sc_iobase))
- return -1;
- *s++ = t1io_inp(sc, 0);
- }
- return 0;
-}
-
-static int WriteReg(iavc_softc_t *sc, u_int32_t reg, u_int8_t val)
-{
- u_int8_t cmd = 0;
- if (b1dma_tolink(sc, &cmd, 1) == 0 &&
- b1dma_tolink(sc, &reg, 4) == 0) {
- u_int32_t tmp = val;
- return b1dma_tolink(sc, &tmp, 4);
- }
- return -1;
-}
-
-static u_int8_t ReadReg(iavc_softc_t *sc, u_int32_t reg)
-{
- u_int8_t cmd = 1;
- if (b1dma_tolink(sc, &cmd, 1) == 0 &&
- b1dma_tolink(sc, &reg, 4) == 0) {
- u_int32_t tmp;
- if (b1dma_fromlink(sc, &tmp, 4) == 0)
- return (u_int8_t) tmp;
- }
- return 0xff;
-}
-
-int t1_detect(iavc_softc_t *sc)
-{
- int ret = b1dma_detect(sc);
- if (ret) return ret;
-
- if ((WriteReg(sc, 0x80001000, 0x11) != 0) ||
- (WriteReg(sc, 0x80101000, 0x22) != 0) ||
- (WriteReg(sc, 0x80201000, 0x33) != 0) ||
- (WriteReg(sc, 0x80301000, 0x44) != 0))
- return 6;
-
- if ((ReadReg(sc, 0x80001000) != 0x11) ||
- (ReadReg(sc, 0x80101000) != 0x22) ||
- (ReadReg(sc, 0x80201000) != 0x33) ||
- (ReadReg(sc, 0x80301000) != 0x44))
- return 7;
-
- if ((WriteReg(sc, 0x80001000, 0x55) != 0) ||
- (WriteReg(sc, 0x80101000, 0x66) != 0) ||
- (WriteReg(sc, 0x80201000, 0x77) != 0) ||
- (WriteReg(sc, 0x80301000, 0x88) != 0))
- return 8;
-
- if ((ReadReg(sc, 0x80001000) != 0x55) ||
- (ReadReg(sc, 0x80101000) != 0x66) ||
- (ReadReg(sc, 0x80201000) != 0x77) ||
- (ReadReg(sc, 0x80301000) != 0x88))
- return 9;
-
- return 0; /* found */
-}
-
-void t1_disable_irq(iavc_softc_t *sc)
-{
- iavc_write_port(sc, T1_IRQMASTER, 0x00);
-}
-
-void t1_reset(iavc_softc_t *sc)
-{
- b1_reset(sc);
- iavc_write_port(sc, B1_INSTAT, 0x00);
- iavc_write_port(sc, B1_OUTSTAT, 0x00);
- iavc_write_port(sc, T1_IRQMASTER, 0x00);
- iavc_write_port(sc, T1_RESETBOARD, 0x0f);
-}
diff --git a/sys/i4b/capi/iavc/iavc_isa.c b/sys/i4b/capi/iavc/iavc_isa.c
deleted file mode 100644
index e1f6142..0000000
--- a/sys/i4b/capi/iavc/iavc_isa.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/*-
- * Copyright (c) 2001, 2002 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <isa/isavar.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/capi/capi.h>
-
-#include <i4b/capi/iavc/iavc.h>
-
-/* ISA driver linkage */
-
-static void iavc_isa_intr(iavc_softc_t *sc);
-static int iavc_isa_probe(device_t dev);
-static int iavc_isa_attach(device_t dev);
-
-static device_method_t iavc_isa_methods[] =
-{
- DEVMETHOD(device_probe, iavc_isa_probe),
- DEVMETHOD(device_attach, iavc_isa_attach),
- { 0, 0 }
-};
-
-static driver_t iavc_isa_driver =
-{
- "iavc",
- iavc_isa_methods,
- 0
-};
-
-static devclass_t iavc_isa_devclass;
-
-DRIVER_MODULE(iavc, isa, iavc_isa_driver, iavc_isa_devclass, 0, 0);
-
-#define B1_IOLENGTH 0x20
-
-static int b1_irq_table[] =
-{0, 0, 0, 192, 32, 160, 96, 224, 0, 64, 80, 208, 48, 0, 0, 112};
-/* 3 4 5 6 7 9 10 11 12 15 */
-
-/*---------------------------------------------------------------------------*
- * device probe
- *---------------------------------------------------------------------------*/
-
-static int
-iavc_isa_probe(device_t dev)
-{
- struct iavc_softc *sc;
- int ret = ENXIO;
- int unit = device_get_unit(dev);
-
- if(isa_get_vendorid(dev)) /* no PnP probes here */
- return ENXIO;
-
- /* check max unit range */
-
- if (unit >= IAVC_MAXUNIT)
- {
- printf("iavc%d: too many units\n", unit);
- return(ENXIO);
- }
-
- sc = iavc_find_sc(unit); /* get softc */
-
- sc->sc_unit = unit;
-
- if (!(sc->sc_resources.io_base[0] =
- bus_alloc_resource(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- 0UL, ~0UL, B1_IOLENGTH, RF_ACTIVE)))
- {
- printf("iavc%d: can't allocate io region\n", unit);
- return(ENXIO);
- }
-
- sc->sc_iobase = rman_get_start(sc->sc_resources.io_base[0]);
-
- switch(sc->sc_iobase)
- {
- case 0x150:
- case 0x250:
- case 0x300:
- case 0x340:
- break;
- default:
- printf("iavc%d: ERROR, invalid i/o base addr 0x%x configured!\n", sc->sc_unit, sc->sc_iobase);
- bus_release_resource(dev, SYS_RES_IOPORT,
- sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
- return(ENXIO);
- }
-
- sc->sc_io_bt = rman_get_bustag(sc->sc_resources.io_base[0]);
- sc->sc_io_bh = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- /* setup characteristics */
-
- sc->sc_t1 = FALSE;
- sc->sc_dma = FALSE;
-
- sc->sc_capi.card_type = CARD_TYPEC_AVM_B1_ISA;
- sc->sc_capi.sc_nbch = 2;
-
- b1_reset(sc);
- DELAY(100);
-
- ret = b1_detect(sc);
-
- if(ret)
- {
- printf("iavc%d: no card ? b1_detect returns %0x02x\n",
- sc->sc_unit, ret);
- return(ENXIO);
- }
-
- DELAY(100);
-
- b1_reset(sc);
-
- DELAY(100);
-
- if(bootverbose)
- {
- printf("iavc%d: class = 0x%02x, rev = 0x%02x\n", sc->sc_unit,
- iavc_read_port(sc, B1_ANALYSE),
- iavc_read_port(sc, B1_REVISION));
- }
-
- device_set_desc(dev, "AVM B1 ISA");
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * attach
- *---------------------------------------------------------------------------*/
-static int
-iavc_isa_attach(device_t dev)
-{
- struct iavc_softc *sc;
- void *ih = 0;
- int unit = device_get_unit(dev);
- int irq;
-
- sc = iavc_find_sc(unit); /* get softc */
-
- sc->sc_resources.irq_rid = 0;
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid, RF_ACTIVE)))
- {
- printf("iavc%d: can't allocate irq\n",unit);
- bus_release_resource(dev, SYS_RES_IOPORT,
- sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
- return(ENXIO);
- }
-
- irq = rman_get_start(sc->sc_resources.irq);
-
- if(b1_irq_table[irq] == 0)
- {
- printf("iavc%d: ERROR, illegal irq %d configured!\n",unit, irq);
- bus_release_resource(dev, SYS_RES_IOPORT,
- sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
- bus_release_resource(dev, SYS_RES_IRQ,
- sc->sc_resources.irq_rid,
- sc->sc_resources.irq);
- return(ENXIO);
- }
-
- memset(&sc->sc_txq, 0, sizeof(struct ifqueue));
- sc->sc_txq.ifq_maxlen = sc->sc_capi.sc_nbch * 4;
-
- if(!mtx_initialized(&sc->sc_txq.ifq_mtx))
- mtx_init(&sc->sc_txq.ifq_mtx, "i4b_ivac_isa", NULL, MTX_DEF);
-
- sc->sc_intr = FALSE;
- sc->sc_state = IAVC_DOWN;
- sc->sc_blocked = FALSE;
-
- /* setup capi link */
-
- sc->sc_capi.load = iavc_load;
- sc->sc_capi.reg_appl = iavc_register;
- sc->sc_capi.rel_appl = iavc_release;
- sc->sc_capi.send = iavc_send;
- sc->sc_capi.ctx = (void*) sc;
-
- if (capi_ll_attach(&sc->sc_capi))
- {
- printf("iavc%d: capi attach failed\n", unit);
- return(ENXIO);
- }
-
- /* setup the interrupt */
-
- if(bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET,
- NULL, (void(*)(void*))iavc_isa_intr,
- sc, &ih))
- {
- printf("iavc%d: irq setup failed\n", unit);
- bus_release_resource(dev, SYS_RES_IOPORT,
- sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
- bus_release_resource(dev, SYS_RES_IRQ,
- sc->sc_resources.irq_rid,
- sc->sc_resources.irq);
- return(ENXIO);
- }
-
- /* the board is now ready to be loaded */
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * setup interrupt
- *---------------------------------------------------------------------------*/
-void
-b1isa_setup_irq(struct iavc_softc *sc)
-{
- int irq = rman_get_start(sc->sc_resources.irq);
-
- if(bootverbose)
- printf("iavc%d: using irq %d\n", sc->sc_unit, irq);
-
- /* enable the interrupt */
-
- b1io_outp(sc, B1_INSTAT, 0x00);
- b1io_outp(sc, B1_RESET, b1_irq_table[irq]);
- b1io_outp(sc, B1_INSTAT, 0x02);
-}
-
-/*---------------------------------------------------------------------------*
- * IRQ handler
- *---------------------------------------------------------------------------*/
-static void
-iavc_isa_intr(struct iavc_softc *sc)
-{
- iavc_handle_intr(sc);
-}
diff --git a/sys/i4b/capi/iavc/iavc_lli.c b/sys/i4b/capi/iavc/iavc_lli.c
deleted file mode 100644
index 7fff48b..0000000
--- a/sys/i4b/capi/iavc/iavc_lli.c
+++ /dev/null
@@ -1,986 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/iavc/iavc_lli.c
- * The AVM ISDN controllers' Low Level Interface.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/malloc.h>
-#include <net/if.h>
-
-
-#include <machine/bus.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/capi/capi.h>
-#include <i4b/capi/capi_msgs.h>
-
-#include <i4b/capi/iavc/iavc.h>
-
-/* Forward declarations of local subroutines... */
-
-static int iavc_send_init(iavc_softc_t *);
-
-static void iavc_handle_rx(iavc_softc_t *);
-static void iavc_start_tx(iavc_softc_t *);
-
-/*
-// Callbacks from the upper (capi) layer:
-// --------------------------------------
-//
-// iavc_load
-// Resets the board and loads the firmware, then initiates
-// board startup.
-//
-// iavc_register
-// Registers a CAPI application id.
-//
-// iavc_release
-// Releases a CAPI application id.
-//
-// iavc_send
-// Sends a capi message.
-*/
-
-int iavc_load(capi_softc_t *capi_sc, int len, u_int8_t *cp)
-{
- iavc_softc_t *sc = (iavc_softc_t*) capi_sc->ctx;
- u_int8_t val;
-
- if(bootverbose)
- printf("iavc%d: reset card ....\n", sc->sc_unit);
-
- if (sc->sc_dma)
- b1dma_reset(sc); /* PCI cards */
- else if (sc->sc_t1)
- t1_reset(sc); /* ISA attachment T1 */
- else
- b1_reset(sc); /* ISA attachment B1 */
-
- DELAY(1000);
-
- if(bootverbose)
- printf("iavc%d: start loading %d bytes firmware ....\n", sc->sc_unit, len);
-
- while (len && b1io_save_put_byte(sc, *cp++) == 0)
- len--;
-
- if (len) {
- printf("iavc%d: loading failed, can't write to card, len = %d\n",
- sc->sc_unit, len);
- return (EIO);
- }
-
- if(bootverbose)
- printf("iavc%d: firmware loaded, wait for ACK ....\n", sc->sc_unit);
-
- if(sc->sc_capi.card_type == CARD_TYPEC_AVM_B1_ISA)
- iavc_put_byte(sc, SEND_POLL);
- else
- iavc_put_byte(sc, SEND_POLLACK);
-
- for (len = 0; len < 1000 && !iavc_rx_full(sc); len++)
- DELAY(100);
-
- if (!iavc_rx_full(sc)) {
- printf("iavc%d: loading failed, no ack\n", sc->sc_unit);
- return (EIO);
- }
-
- val = iavc_get_byte(sc);
-
- if ((sc->sc_dma && val != RECEIVE_POLLDWORD) ||
- (!sc->sc_dma && val != RECEIVE_POLL)) {
- printf("iavc%d: loading failed, bad ack = %02x\n", sc->sc_unit, val);
- return (EIO);
- }
-
- if(bootverbose)
- printf("iavc%d: got ACK = 0x%02x\n", sc->sc_unit, val);
-
- if (sc->sc_dma) {
- /* Start the DMA engine */
-
- int s = SPLI4B();
-
- sc->sc_csr = AVM_FLAG;
- AMCC_WRITE(sc, AMCC_INTCSR, sc->sc_csr);
- AMCC_WRITE(sc, AMCC_MCSR, (EN_A2P_TRANSFERS|EN_P2A_TRANSFERS|
- A2P_HI_PRIORITY|P2A_HI_PRIORITY|
- RESET_A2P_FLAGS|RESET_P2A_FLAGS));
-
- iavc_write_port(sc, 0x07, 0x30); /* XXX magic numbers from */
- iavc_write_port(sc, 0x10, 0xf0); /* XXX the linux driver */
-
- sc->sc_recvlen = 0;
- AMCC_WRITE(sc, AMCC_RXPTR, vtophys(&sc->sc_recvbuf[0]));
- AMCC_WRITE(sc, AMCC_RXLEN, 4);
- sc->sc_csr |= EN_RX_TC_INT|EN_TX_TC_INT;
- AMCC_WRITE(sc, AMCC_INTCSR, sc->sc_csr);
-
- splx(s);
- }
-
- if(sc->sc_capi.card_type == CARD_TYPEC_AVM_B1_ISA)
- b1isa_setup_irq(sc);
-
- iavc_send_init(sc);
-
- return 0;
-}
-
-int iavc_register(capi_softc_t *capi_sc, int applid, int nchan)
-{
- iavc_softc_t *sc = (iavc_softc_t*) capi_sc->ctx;
- struct mbuf *m = i4b_Dgetmbuf(23);
- u_int8_t *p;
-
- if (!m) {
- printf("iavc%d: can't get memory\n", sc->sc_unit);
- return (ENOMEM);
- }
-
- /*
- * byte 0x12 = SEND_REGISTER
- * dword ApplId
- * dword NumMessages
- * dword NumB3Connections 0..nbch
- * dword NumB3Blocks
- * dword B3Size
- */
-
- p = amcc_put_byte(mtod(m, u_int8_t*), 0);
- p = amcc_put_byte(p, 0);
- p = amcc_put_byte(p, SEND_REGISTER);
- p = amcc_put_word(p, applid);
-#if 0
- p = amcc_put_word(p, 1024 + (nchan + 1));
-#else
- p = amcc_put_word(p, 1024 * (nchan + 1));
-#endif
- p = amcc_put_word(p, nchan);
- p = amcc_put_word(p, 8);
- p = amcc_put_word(p, 2048);
-
- _IF_ENQUEUE(&sc->sc_txq, m);
-
- iavc_start_tx(sc);
-
- return 0;
-}
-
-int iavc_release(capi_softc_t *capi_sc, int applid)
-{
- iavc_softc_t *sc = (iavc_softc_t*) capi_sc->ctx;
- struct mbuf *m = i4b_Dgetmbuf(7);
- u_int8_t *p;
-
- if (!m) {
- printf("iavc%d: can't get memory\n", sc->sc_unit);
- return (ENOMEM);
- }
-
- /*
- * byte 0x14 = SEND_RELEASE
- * dword ApplId
- */
-
- p = amcc_put_byte(mtod(m, u_int8_t*), 0);
- p = amcc_put_byte(p, 0);
- p = amcc_put_byte(p, SEND_RELEASE);
- p = amcc_put_word(p, applid);
-
- _IF_ENQUEUE(&sc->sc_txq, m);
-
- iavc_start_tx(sc);
- return 0;
-}
-
-int iavc_send(capi_softc_t *capi_sc, struct mbuf *m)
-{
- iavc_softc_t *sc = (iavc_softc_t*) capi_sc->ctx;
-
- if (sc->sc_state != IAVC_UP) {
- printf("iavc%d: attempt to send before device up\n", sc->sc_unit);
-
- if (m->m_next) i4b_Bfreembuf(m->m_next);
- i4b_Dfreembuf(m);
-
- return (ENXIO);
- }
-
- if (_IF_QFULL(&sc->sc_txq)) {
-
- _IF_DROP(&sc->sc_txq);
-
- printf("iavc%d: tx overflow, message dropped\n", sc->sc_unit);
-
- if (m->m_next) i4b_Bfreembuf(m->m_next);
- i4b_Dfreembuf(m);
-
- } else {
- _IF_ENQUEUE(&sc->sc_txq, m);
-
- iavc_start_tx(sc);
- }
-
- return 0;
-}
-
-/*
-// Functions called by ourself during the initialization sequence:
-// ---------------------------------------------------------------
-//
-// iavc_send_init
-// Sends the system initialization message to a newly loaded
-// board, and sets state to INIT.
-*/
-
-static int iavc_send_init(iavc_softc_t *sc)
-{
- struct mbuf *m = i4b_Dgetmbuf(15);
- u_int8_t *p;
- int s;
-
- if (!m) {
- printf("iavc%d: can't get memory\n", sc->sc_unit);
- return (ENOMEM);
- }
-
- /*
- * byte 0x11 = SEND_INIT
- * dword NumApplications
- * dword NumNCCIs
- * dword BoardNumber
- */
-
- p = amcc_put_byte(mtod(m, u_int8_t*), 0);
- p = amcc_put_byte(p, 0);
- p = amcc_put_byte(p, SEND_INIT);
- p = amcc_put_word(p, 1); /* XXX MaxAppl XXX */
- p = amcc_put_word(p, sc->sc_capi.sc_nbch);
- p = amcc_put_word(p, sc->sc_unit);
-
- s = SPLI4B();
- _IF_ENQUEUE(&sc->sc_txq, m);
-
- iavc_start_tx(sc);
-
- sc->sc_state = IAVC_INIT;
- splx(s);
- return 0;
-}
-
-/*
-// Functions called during normal operation:
-// -----------------------------------------
-//
-// iavc_receive_init
-// Reads the initialization reply and calls capi_ll_control().
-//
-// iavc_receive_new_ncci
-// Reads a new NCCI notification and calls capi_ll_control().
-//
-// iavc_receive_free_ncci
-// Reads a freed NCCI notification and calls capi_ll_control().
-//
-// iavc_receive_task_ready
-// Reads a task ready message -- which should not occur XXX.
-//
-// iavc_receive_debugmsg
-// Reads a debug message -- which should not occur XXX.
-//
-// iavc_receive_start
-// Reads a START TRANSMIT message and unblocks device.
-//
-// iavc_receive_stop
-// Reads a STOP TRANSMIT message and blocks device.
-//
-// iavc_receive
-// Reads an incoming message and calls capi_ll_receive().
-*/
-
-static int iavc_receive_init(iavc_softc_t *sc, u_int8_t *dmabuf)
-{
- u_int32_t Length;
- u_int8_t *p;
- u_int8_t *cardtype, *serial, *profile, *version, *caps, *prot;
-
- if (sc->sc_dma) {
- p = amcc_get_word(dmabuf, &Length);
- } else {
- Length = iavc_get_slice(sc, sc->sc_recvbuf);
- p = sc->sc_recvbuf;
- }
-
-#if 0
- {
- int len = 0;
- printf("iavc%d: rx_init: ", sc->sc_unit);
- while (len < Length) {
- printf(" %02x", p[len]);
- if (len && (len % 16) == 0) printf("\n");
- len++;
- }
- if (len % 16) printf("\n");
- }
-#endif
-
- version = (p + 1);
- p += (*p + 1); /* driver version */
- cardtype = (p + 1);
- p += (*p + 1); /* card type */
- p += (*p + 1); /* hardware ID */
- serial = (p + 1);
- p += (*p + 1); /* serial number */
- caps = (p + 1);
- p += (*p + 1); /* supported options */
- prot = (p + 1);
- p += (*p + 1); /* supported protocols */
- profile = (p + 1);
-
- if (cardtype && serial && profile) {
- int nbch = ((profile[3]<<8) | profile[2]);
-
- printf("iavc%d: AVM %s, s/n %s, %d chans, f/w rev %s, prot %s\n",
- sc->sc_unit, cardtype, serial, nbch, version, prot);
-
- if(bootverbose)
- printf("iavc%d: %s\n", sc->sc_unit, caps);
-
- capi_ll_control(&sc->sc_capi, CAPI_CTRL_PROFILE, (int) profile);
-
- } else {
- printf("iavc%d: no profile data in info response?\n", sc->sc_unit);
- }
-
- sc->sc_blocked = TRUE; /* controller will send START when ready */
- return 0;
-}
-
-static int iavc_receive_start(iavc_softc_t *sc, u_int8_t *dmabuf)
-{
- struct mbuf *m = i4b_Dgetmbuf(3);
- u_int8_t *p;
-
- if (sc->sc_blocked && sc->sc_state == IAVC_UP)
- printf("iavc%d: receive_start\n", sc->sc_unit);
-
- if (!m) {
- printf("iavc%d: can't get memory\n", sc->sc_unit);
- return (ENOMEM);
- }
-
- /*
- * byte 0x73 = SEND_POLLACK
- */
-
- p = amcc_put_byte(mtod(m, u_int8_t*), 0);
- p = amcc_put_byte(p, 0);
- p = amcc_put_byte(p, SEND_POLLACK);
-
- _IF_PREPEND(&sc->sc_txq, m);
-
- NDBGL4(L4_IAVCDBG, "iavc%d: blocked = %d, state = %d",
- sc->sc_unit, sc->sc_blocked, sc->sc_state);
-
- sc->sc_blocked = FALSE;
- iavc_start_tx(sc);
-
- /* If this was our first START, register our readiness */
-
- if (sc->sc_state != IAVC_UP) {
- sc->sc_state = IAVC_UP;
- capi_ll_control(&sc->sc_capi, CAPI_CTRL_READY, TRUE);
- }
-
- return 0;
-}
-
-static int iavc_receive_stop(iavc_softc_t *sc, u_int8_t *dmabuf)
-{
- printf("iavc%d: receive_stop\n", sc->sc_unit);
- sc->sc_blocked = TRUE;
- return 0;
-}
-
-static int iavc_receive_new_ncci(iavc_softc_t *sc, u_int8_t *dmabuf)
-{
- u_int32_t ApplId, NCCI, WindowSize;
-
- if (sc->sc_dma) {
- dmabuf = amcc_get_word(dmabuf, &ApplId);
- dmabuf = amcc_get_word(dmabuf, &NCCI);
- dmabuf = amcc_get_word(dmabuf, &WindowSize);
- } else {
- ApplId = iavc_get_word(sc);
- NCCI = iavc_get_word(sc);
- WindowSize = iavc_get_word(sc);
- }
-
- capi_ll_control(&sc->sc_capi, CAPI_CTRL_NEW_NCCI, NCCI);
- return 0;
-}
-
-static int iavc_receive_free_ncci(iavc_softc_t *sc, u_int8_t *dmabuf)
-{
- u_int32_t ApplId, NCCI;
-
- if (sc->sc_dma) {
- dmabuf = amcc_get_word(dmabuf, &ApplId);
- dmabuf = amcc_get_word(dmabuf, &NCCI);
- } else {
- ApplId = iavc_get_word(sc);
- NCCI = iavc_get_word(sc);
- }
-
- capi_ll_control(&sc->sc_capi, CAPI_CTRL_FREE_NCCI, NCCI);
- return 0;
-}
-
-static int iavc_receive_task_ready(iavc_softc_t *sc, u_int8_t *dmabuf)
-{
- u_int32_t TaskId, Length;
- u_int8_t *p;
- printf("iavc%d: receive_task_ready\n", sc->sc_unit);
-
- if (sc->sc_dma) {
- p = amcc_get_word(dmabuf, &TaskId);
- p = amcc_get_word(p, &Length);
- } else {
- TaskId = iavc_get_word(sc);
- Length = iavc_get_slice(sc, sc->sc_recvbuf);
- p = sc->sc_recvbuf;
- }
-
- /* XXX could show the message if trace enabled? XXX */
- return 0;
-}
-
-static int iavc_receive_debugmsg(iavc_softc_t *sc, u_int8_t *dmabuf)
-{
- u_int32_t Length;
- u_int8_t *p;
- printf("iavc%d: receive_debugmsg\n", sc->sc_unit);
-
- if (sc->sc_dma) {
- p = amcc_get_word(dmabuf, &Length);
- } else {
- Length = iavc_get_slice(sc, sc->sc_recvbuf);
- p = sc->sc_recvbuf;
- }
-
- /* XXX could show the message if trace enabled? XXX */
- return 0;
-}
-
-static int iavc_receive(iavc_softc_t *sc, u_int8_t *dmabuf, int b3data)
-{
- struct mbuf *m;
- u_int32_t ApplId, Length;
-
- /*
- * byte 0x21 = RECEIVE_MESSAGE
- * dword ApplId
- * dword length
- * ... CAPI msg
- *
- * --or--
- *
- * byte 0x22 = RECEIVE_DATA_B3_IND
- * dword ApplId
- * dword length
- * ... CAPI msg
- * dword datalen
- * ... B3 data
- */
-
- if (sc->sc_dma) {
- dmabuf = amcc_get_word(dmabuf, &ApplId);
- dmabuf = amcc_get_word(dmabuf, &Length);
- } else {
- ApplId = iavc_get_word(sc);
- Length = iavc_get_slice(sc, sc->sc_recvbuf);
- dmabuf = sc->sc_recvbuf;
- }
-
- m = i4b_Dgetmbuf(Length);
- if (!m) {
- printf("iavc%d: can't get memory for receive\n", sc->sc_unit);
- return (ENOMEM);
- }
-
- bcopy(dmabuf, mtod(m, u_int8_t*), Length);
-
-#if 0
- {
- u_int8_t *p = mtod(m, u_int8_t*);
- int len = 0;
- printf("iavc%d: applid=%d, len=%d\n", sc->sc_unit, ApplId, Length);
- while (len < m->m_len) {
- printf(" %02x", p[len]);
- if (len && (len % 16) == 0) printf("\n");
- len++;
- }
- if (len % 16) printf("\n");
- }
-#endif
-
- if (b3data) {
- if (sc->sc_dma) {
- dmabuf = amcc_get_word(dmabuf + Length, &Length);
- } else {
- Length = iavc_get_slice(sc, sc->sc_recvbuf);
- dmabuf = sc->sc_recvbuf;
- }
-
- m->m_next = i4b_Bgetmbuf(Length);
- if (!m->m_next) {
- printf("iavc%d: can't get memory for receive\n", sc->sc_unit);
- i4b_Dfreembuf(m);
- return (ENOMEM);
- }
-
- bcopy(dmabuf, mtod(m->m_next, u_int8_t*), Length);
- }
-
- capi_ll_receive(&sc->sc_capi, m);
- return 0;
-}
-
-/*
-// iavc_handle_intr
-// Checks device interrupt status and calls iavc_handle_{rx,tx}()
-// as necessary.
-//
-// iavc_handle_rx
-// Reads in the command byte and calls the subroutines above.
-//
-// iavc_start_tx
-// Initiates DMA on the next queued message if possible.
-*/
-
-void iavc_handle_intr(iavc_softc_t *sc)
-{
- u_int32_t status;
- u_int32_t newcsr;
-
- if (!sc->sc_dma) {
- while (iavc_rx_full(sc))
- iavc_handle_rx(sc);
- return;
- }
-
- status = AMCC_READ(sc, AMCC_INTCSR);
- if ((status & ANY_S5933_INT) == 0)
- return;
-
- newcsr = sc->sc_csr | (status & ALL_INT);
- if (status & TX_TC_INT) newcsr &= ~EN_TX_TC_INT;
- if (status & RX_TC_INT) newcsr &= ~EN_RX_TC_INT;
- AMCC_WRITE(sc, AMCC_INTCSR, newcsr);
- sc->sc_intr = TRUE;
-
- if (status & RX_TC_INT) {
- u_int32_t rxlen;
-
- if (sc->sc_recvlen == 0) {
- sc->sc_recvlen = *((u_int32_t*)(&sc->sc_recvbuf[0]));
- rxlen = (sc->sc_recvlen + 3) & ~3;
- AMCC_WRITE(sc, AMCC_RXPTR, vtophys(&sc->sc_recvbuf[4]));
- AMCC_WRITE(sc, AMCC_RXLEN, rxlen);
- } else {
- iavc_handle_rx(sc);
- sc->sc_recvlen = 0;
- AMCC_WRITE(sc, AMCC_RXPTR, vtophys(&sc->sc_recvbuf[0]));
- AMCC_WRITE(sc, AMCC_RXLEN, 4);
- }
- }
-
- if (status & TX_TC_INT) {
- sc->sc_csr &= ~EN_TX_TC_INT;
- iavc_start_tx(sc);
- }
-
- AMCC_WRITE(sc, AMCC_INTCSR, sc->sc_csr);
- sc->sc_intr = FALSE;
-}
-
-static void iavc_handle_rx(iavc_softc_t *sc)
-{
- u_int8_t *dmabuf = 0, cmd;
-
- if (sc->sc_dma) {
- dmabuf = amcc_get_byte(&sc->sc_recvbuf[4], &cmd);
- } else {
- cmd = iavc_get_byte(sc);
- }
-
- NDBGL4(L4_IAVCDBG, "iavc%d: command = 0x%02x", sc->sc_unit, cmd);
-
- switch (cmd) {
- case RECEIVE_DATA_B3_IND:
- iavc_receive(sc, dmabuf, TRUE);
- break;
-
- case RECEIVE_MESSAGE:
- iavc_receive(sc, dmabuf, FALSE);
- break;
-
- case RECEIVE_NEW_NCCI:
- iavc_receive_new_ncci(sc, dmabuf);
- break;
-
- case RECEIVE_FREE_NCCI:
- iavc_receive_free_ncci(sc, dmabuf);
- break;
-
- case RECEIVE_START:
- iavc_receive_start(sc, dmabuf);
- break;
-
- case RECEIVE_STOP:
- iavc_receive_stop(sc, dmabuf);
- break;
-
- case RECEIVE_INIT:
- iavc_receive_init(sc, dmabuf);
- break;
-
- case RECEIVE_TASK_READY:
- iavc_receive_task_ready(sc, dmabuf);
- break;
-
- case RECEIVE_DEBUGMSG:
- iavc_receive_debugmsg(sc, dmabuf);
- break;
-
- default:
- printf("iavc%d: unknown msg %02x\n", sc->sc_unit, cmd);
- }
-}
-
-static void iavc_start_tx(iavc_softc_t *sc)
-{
- struct mbuf *m;
- u_int8_t *dmabuf;
- u_int32_t txlen = 0;
-
- /* If device has put us on hold, punt. */
-
- if (sc->sc_blocked) {
- return;
- }
-
- /* If using DMA and transmitter busy, punt. */
-
- if (sc->sc_dma && (sc->sc_csr & EN_TX_TC_INT)) {
- return;
- }
-
- /* Else, see if we have messages to send. */
-
- _IF_DEQUEUE(&sc->sc_txq, m);
- if (!m) {
- return;
- }
-
- /* Have message, will send. */
-
- if (CAPIMSG_LEN(m->m_data)) {
- /* A proper CAPI message, possibly with B3 data */
-
- if (sc->sc_dma) {
- /* Copy message to DMA buffer. */
-
- if (m->m_next) {
- dmabuf = amcc_put_byte(&sc->sc_sendbuf[0], SEND_DATA_B3_REQ);
- } else {
- dmabuf = amcc_put_byte(&sc->sc_sendbuf[0], SEND_MESSAGE);
- }
-
- dmabuf = amcc_put_word(dmabuf, m->m_len);
- bcopy(m->m_data, dmabuf, m->m_len);
- dmabuf += m->m_len;
- txlen = 5 + m->m_len;
-
- if (m->m_next) {
- dmabuf = amcc_put_word(dmabuf, m->m_next->m_len);
- bcopy(m->m_next->m_data, dmabuf, m->m_next->m_len);
- txlen += 4 + m->m_next->m_len;
- }
-
- } else {
- /* Use PIO. */
-
- if (m->m_next) {
- iavc_put_byte(sc, SEND_DATA_B3_REQ);
- NDBGL4(L4_IAVCDBG, "iavc%d: tx SDB3R msg, len = %d", sc->sc_unit, m->m_len);
- } else {
- iavc_put_byte(sc, SEND_MESSAGE);
- NDBGL4(L4_IAVCDBG, "iavc%d: tx SM msg, len = %d", sc->sc_unit, m->m_len);
- }
-#if 0
- {
- u_int8_t *p = mtod(m, u_int8_t*);
- int len;
- for (len = 0; len < m->m_len; len++) {
- printf(" %02x", *p++);
- if (len && (len % 16) == 0) printf("\n");
- }
- if (len % 16) printf("\n");
- }
-#endif
-
- iavc_put_slice(sc, m->m_data, m->m_len);
-
- if (m->m_next) {
- iavc_put_slice(sc, m->m_next->m_data, m->m_next->m_len);
- }
- }
-
- } else {
- /* A board control message to be sent as is */
-
- if (sc->sc_dma) {
- bcopy(m->m_data + 2, &sc->sc_sendbuf[0], m->m_len - 2);
- txlen = m->m_len - 2;
-
- } else {
-#if 0
- {
- u_int8_t *p = mtod(m, u_int8_t*) + 2;
- int len;
- printf("iavc%d: tx BDC msg, len = %d, msg =", sc->sc_unit, m->m_len-2);
- for (len = 0; len < m->m_len-2; len++) {
- printf(" %02x", *p++);
- if (len && (len % 16) == 0) printf("\n");
- }
- if (len % 16) printf("\n");
- }
-#endif
-
- txlen = m->m_len - 2;
- dmabuf = mtod(m, char*) + 2;
- while(txlen--)
- b1io_put_byte(sc, *dmabuf++);
- }
- }
-
- if (m->m_next) {
- i4b_Bfreembuf(m->m_next);
- m->m_next = NULL;
- }
- i4b_Dfreembuf(m);
-
- if (sc->sc_dma) {
- /* Start transmitter */
-
- txlen = (txlen + 3) & ~3;
- AMCC_WRITE(sc, AMCC_TXPTR, vtophys(&sc->sc_sendbuf[0]));
- AMCC_WRITE(sc, AMCC_TXLEN, txlen);
- sc->sc_csr |= EN_TX_TC_INT;
-
- if (!sc->sc_intr)
- AMCC_WRITE(sc, AMCC_INTCSR, sc->sc_csr);
- }
-}
-
-int t1io_get_slice(iavc_softc_t *sc, u_int8_t *dp)
-{
- int len, i;
- len = i = b1io_get_word(sc);
- if (t1io_isfastlink(sc)) {
- int status;
- while (i) {
- status = t1io_fifostatus(sc) & (T1F_IREADY|T1F_IHALF);
- if (i >= FIFO_INPBSIZE) status |= T1F_IFULL;
-
- switch (status) {
- case T1F_IREADY|T1F_IHALF|T1F_IFULL:
- bus_space_read_multi_1(sc->sc_io_bt, sc->sc_io_bh,
- T1_READ, dp, FIFO_INPBSIZE);
- dp += FIFO_INPBSIZE;
- i -= FIFO_INPBSIZE;
- break;
-
- case T1F_IREADY|T1F_IHALF:
- bus_space_read_multi_1(sc->sc_io_bt, sc->sc_io_bh,
- T1_READ, dp, i);
- dp += i;
- i = 0;
- break;
-
- default:
- *dp++ = b1io_get_byte(sc);
- i--;
- }
- }
- } else { /* not fastlink */
- if (i--) *dp++ = b1io_get_byte(sc);
- }
- return len;
-}
-
-void t1io_put_slice(iavc_softc_t *sc, u_int8_t *dp, int len)
-{
- int i = len;
- b1io_put_word(sc, i);
- if (t1io_isfastlink(sc)) {
- int status;
- while (i) {
- status = t1io_fifostatus(sc) & (T1F_OREADY|T1F_OHALF);
- if (i >= FIFO_OUTBSIZE) status |= T1F_OFULL;
-
- switch (status) {
- case T1F_OREADY|T1F_OHALF|T1F_OFULL:
- bus_space_write_multi_1(sc->sc_io_bt, sc->sc_io_bh,
- T1_WRITE, dp, FIFO_OUTBSIZE);
- dp += FIFO_OUTBSIZE;
- i -= FIFO_OUTBSIZE;
- break;
-
- case T1F_OREADY|T1F_OHALF:
- bus_space_write_multi_1(sc->sc_io_bt, sc->sc_io_bh,
- T1_WRITE, dp, i);
- dp += i;
- i = 0;
- break;
-
- default:
- b1io_put_byte(sc, *dp++);
- i--;
- }
- }
- } else {
- while (i--) b1io_put_byte(sc, *dp++);
- }
-}
-
-u_int32_t b1io_get_word(iavc_softc_t *sc)
-{
- u_int32_t val = 0;
- val |= b1io_get_byte(sc);
- val |= (b1io_get_byte(sc) << 8);
- val |= (b1io_get_byte(sc) << 16);
- val |= (b1io_get_byte(sc) << 24);
- return val;
-}
-
-void b1io_put_word(iavc_softc_t *sc, u_int32_t val)
-{
- b1io_put_byte(sc, (val & 0xff));
- b1io_put_byte(sc, (val >> 8) & 0xff);
- b1io_put_byte(sc, (val >> 16) & 0xff);
- b1io_put_byte(sc, (val >> 24) & 0xff);
-}
-
-int b1io_get_slice(iavc_softc_t *sc, u_int8_t *dp)
-{
- int len, i;
- len = i = b1io_get_word(sc);
- while (i--) *dp++ = b1io_get_byte(sc);
- return len;
-}
-
-void b1io_put_slice(iavc_softc_t *sc, u_int8_t *dp, int len)
-{
- b1io_put_word(sc, len);
- while (len--) b1io_put_byte(sc, *dp++);
-}
-
-u_int32_t b1io_read_reg(iavc_softc_t *sc, int reg)
-{
- b1io_put_byte(sc, READ_REGISTER);
- b1io_put_word(sc, reg);
- return b1io_get_word(sc);
-}
-
-u_int32_t b1io_write_reg(iavc_softc_t *sc, int reg, u_int32_t val)
-{
- b1io_put_byte(sc, WRITE_REGISTER);
- b1io_put_word(sc, reg);
- b1io_put_word(sc, val);
- return b1io_get_word(sc);
-}
-
-u_int8_t b1io_get_byte(iavc_softc_t *sc)
-{
- int spin = 0;
- while (!b1io_rx_full(sc) && spin < B1IO_WAIT_MAX) {
- spin++; DELAY(B1IO_WAIT_DLY);
- }
- if (b1io_rx_full(sc))
- return bus_space_read_1(sc->sc_io_bt, sc->sc_io_bh, B1_READ);
- printf("iavc%d: rx not completed\n", sc->sc_unit);
- return 0xff;
-}
-
-int b1io_put_byte(iavc_softc_t *sc, u_int8_t val)
-{
- int spin = 0;
- while (!b1io_tx_empty(sc) && spin < B1IO_WAIT_MAX) {
- spin++; DELAY(B1IO_WAIT_DLY);
- }
- if (b1io_tx_empty(sc)) {
- bus_space_write_1(sc->sc_io_bt, sc->sc_io_bh, B1_WRITE, val);
- return 0;
- }
- printf("iavc%d: tx not emptied\n", sc->sc_unit);
- return -1;
-}
-
-int b1io_save_put_byte(iavc_softc_t *sc, u_int8_t val)
-{
- int spin = 0;
- while (!b1io_tx_empty(sc) && spin < B1IO_WAIT_MAX) {
- spin++; DELAY(B1IO_WAIT_DLY);
- }
- if (b1io_tx_empty(sc)) {
- b1io_outp(sc, B1_WRITE, val);
- return 0;
- }
- printf("iavc%d: tx not emptied\n", sc->sc_unit);
- return -1;
-}
diff --git a/sys/i4b/capi/iavc/iavc_pci.c b/sys/i4b/capi/iavc/iavc_pci.c
deleted file mode 100644
index 8f10535..0000000
--- a/sys/i4b/capi/iavc/iavc_pci.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*-
- * Copyright (c) 2001 Cubical Solutions Ltd. 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.
- */
-
-/* capi/iavc/iavc_pci.c
- * The AVM ISDN controllers' PCI bus attachment handling.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/capi/capi.h>
-
-#include <i4b/capi/iavc/iavc.h>
-
-/* PCI device ids */
-
-#define PCI_AVM_VID 0x1244
-#define PCI_AVMT1_DID 0x1200
-#define PCI_AVMB1_DID 0x0700
-
-/* PCI driver linkage */
-
-static void iavc_pci_intr(iavc_softc_t *sc);
-static int iavc_pci_probe(device_t dev);
-static int iavc_pci_attach(device_t dev);
-
-static device_method_t iavc_pci_methods[] =
-{
- DEVMETHOD(device_probe, iavc_pci_probe),
- DEVMETHOD(device_attach, iavc_pci_attach),
- { 0, 0 }
-};
-
-static driver_t iavc_pci_driver =
-{
- "iavc",
- iavc_pci_methods,
- 0
-};
-
-static devclass_t iavc_pci_devclass;
-
-DRIVER_MODULE(iavc, pci, iavc_pci_driver, iavc_pci_devclass, 0, 0);
-
-/* Driver soft contexts */
-
-iavc_softc_t iavc_sc[IAVC_MAXUNIT];
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-
-static int
-iavc_pci_probe(device_t dev)
-{
- u_int16_t did = pci_get_device(dev);
- u_int16_t vid = pci_get_vendor(dev);
-
- if ((vid == PCI_AVM_VID) && (did == PCI_AVMT1_DID)) {
- device_set_desc(dev, "AVM T1 PCI");
- } else if ((vid == PCI_AVM_VID) && (did == PCI_AVMB1_DID)) {
- device_set_desc(dev, "AVM B1 PCI");
- } else {
- return(ENXIO);
- }
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-
-static int
-iavc_pci_attach(device_t dev)
-{
- struct iavc_softc *sc;
- void *ih = 0;
- u_int16_t did = pci_get_device(dev);
- int unit = device_get_unit(dev), ret;
-
- /* check max unit range */
-
- if (unit >= IAVC_MAXUNIT) {
- printf("iavc%d: too many units\n", unit);
- return(ENXIO);
- }
-
- sc = iavc_find_sc(unit); /* get softc */
-
- sc->sc_unit = unit;
-
- /* use the i/o mapped base address */
-
- sc->sc_resources.io_rid[0] = 0x14;
-
- if (!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0], RF_ACTIVE))) {
- printf("iavc%d: can't allocate io region\n", unit);
- return(ENXIO);
- }
-
- sc->sc_iobase = rman_get_start(sc->sc_resources.io_base[0]);
- sc->sc_io_bt = rman_get_bustag(sc->sc_resources.io_base[0]);
- sc->sc_io_bh = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- /* use the memory mapped DMA controller */
-
- sc->sc_resources.mem_rid = 0x10;
-
- if (!(sc->sc_resources.mem =
- bus_alloc_resource_any(dev, SYS_RES_MEMORY,
- &sc->sc_resources.mem_rid, RF_ACTIVE))) {
- printf("iavc%d: can't allocate memory region\n", unit);
- return(ENXIO);
- }
-
- sc->sc_membase = rman_get_start(sc->sc_resources.mem);
- sc->sc_mem_bt = rman_get_bustag(sc->sc_resources.mem);
- sc->sc_mem_bh = rman_get_bushandle(sc->sc_resources.mem);
-
- /* do some detection */
-
- sc->sc_t1 = FALSE;
- sc->sc_dma = FALSE;
- b1dma_reset(sc);
-
- if (did == PCI_AVMT1_DID) {
- sc->sc_capi.card_type = CARD_TYPEC_AVM_T1_PCI;
- sc->sc_capi.sc_nbch = 30;
- ret = t1_detect(sc);
- if (ret) {
- if (ret < 6) {
- printf("iavc%d: no card detected?\n", sc->sc_unit);
- } else {
- printf("iavc%d: black box not on\n", sc->sc_unit);
- }
- return(ENXIO);
- } else {
- sc->sc_dma = TRUE;
- sc->sc_t1 = TRUE;
- }
-
- } else if (did == PCI_AVMB1_DID) {
- sc->sc_capi.card_type = CARD_TYPEC_AVM_B1_PCI;
- sc->sc_capi.sc_nbch = 2;
- ret = b1dma_detect(sc);
- if (ret) {
- ret = b1_detect(sc);
- if (ret) {
- printf("iavc%d: no card detected?\n", sc->sc_unit);
- return(ENXIO);
- }
- } else {
- sc->sc_dma = TRUE;
- }
- }
-
- if (sc->sc_dma) b1dma_reset(sc);
-#if 0
- if (sc->sc_t1) t1_reset(sc);
- else b1_reset(sc);
-#endif
-
- /* of course we need an interrupt */
-
- sc->sc_resources.irq_rid = 0x00;
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_resources.irq_rid,
- RF_SHAREABLE|RF_ACTIVE))) {
- printf("iavc%d: can't allocate irq\n",unit);
- return(ENXIO);
- }
-
- /* finalize our own context */
-
- memset(&sc->sc_txq, 0, sizeof(struct ifqueue));
- sc->sc_txq.ifq_maxlen = sc->sc_capi.sc_nbch * 4;
-
- if(!mtx_initialized(&sc->sc_txq.ifq_mtx))
- mtx_init(&sc->sc_txq.ifq_mtx, "i4b_ivac_pci", NULL, MTX_DEF);
-
- sc->sc_intr = FALSE;
- sc->sc_state = IAVC_DOWN;
- sc->sc_blocked = FALSE;
-
- /* setup capi link */
-
- sc->sc_capi.load = iavc_load;
- sc->sc_capi.reg_appl = iavc_register;
- sc->sc_capi.rel_appl = iavc_release;
- sc->sc_capi.send = iavc_send;
- sc->sc_capi.ctx = (void*) sc;
-
- if (capi_ll_attach(&sc->sc_capi)) {
- printf("iavc%d: capi attach failed\n", unit);
- return(ENXIO);
- }
-
- /* setup the interrupt */
-
- if(bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET,
- NULL, (void(*)(void*))iavc_pci_intr,
- sc, &ih)) {
- printf("iavc%d: irq setup failed\n", unit);
- return(ENXIO);
- }
-
- /* the board is now ready to be loaded */
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * IRQ handler
- *---------------------------------------------------------------------------*/
-
-static void
-iavc_pci_intr(struct iavc_softc *sc)
-{
- iavc_handle_intr(sc);
-}
diff --git a/sys/i4b/driver/i4b_ctl.c b/sys/i4b/driver/i4b_ctl.c
deleted file mode 100644
index 4b39170..0000000
--- a/sys/i4b/driver/i4b_ctl.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ------------------------------------------
- * last edit-date: [Sun Mar 17 09:49:24 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/ioccom.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer2/i4b_l2.h>
-
-static int openflag = 0;
-
-static d_open_t i4bctlopen;
-static d_close_t i4bctlclose;
-static d_ioctl_t i4bctlioctl;
-static d_poll_t i4bctlpoll;
-
-
-static struct cdevsw i4bctl_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
- .d_open = i4bctlopen,
- .d_close = i4bctlclose,
- .d_ioctl = i4bctlioctl,
- .d_poll = i4bctlpoll,
- .d_name = "i4bctl",
-};
-
-static void i4bctlattach(void *);
-PSEUDO_SET(i4bctlattach, i4b_i4bctldrv);
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4bctlattach(void *dummy)
-{
- printf("i4bctl: ISDN system control port attached\n");
- make_dev(&i4bctl_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4bctl");
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlopen - device driver open routine
- *---------------------------------------------------------------------------*/
-static int
-i4bctlopen(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- if(minor(dev))
- return (ENXIO);
-
- if(openflag)
- return (EBUSY);
-
- openflag = 1;
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlclose - device driver close routine
- *---------------------------------------------------------------------------*/
-static int
-i4bctlclose(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- openflag = 0;
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-static int
-i4bctlioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
-{
-#if DO_I4B_DEBUG
- ctl_debug_t *cdbg;
- int error = 0;
-#endif
-
-#if !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_CHIPSTAT:
- {
- struct chipstat *cst;
- cst = (struct chipstat *)data;
- (*ctrl_desc[cst->driver_unit].N_MGMT_COMMAND)(cst->driver_unit, CMR_GCST, cst);
- break;
- }
-
- case I4B_CTL_CLR_CHIPSTAT:
- {
- struct chipstat *cst;
- cst = (struct chipstat *)data;
- (*ctrl_desc[cst->driver_unit].N_MGMT_COMMAND)(cst->driver_unit, CMR_CCST, cst);
- break;
- }
-
- case I4B_CTL_GET_LAPDSTAT:
- {
- l2stat_t *l2s;
- l2_softc_t *sc;
- l2s = (l2stat_t *)data;
-
- if( l2s->unit < 0 || l2s->unit > MAXL1UNITS)
- {
- error = EINVAL;
- break;
- }
-
- sc = &l2_softc[l2s->unit];
-
- bcopy(&sc->stat, &l2s->lapdstat, sizeof(lapdstat_t));
- break;
- }
-
- case I4B_CTL_CLR_LAPDSTAT:
- {
- int *up;
- l2_softc_t *sc;
- up = (int *)data;
-
- if( *up < 0 || *up > MAXL1UNITS)
- {
- error = EINVAL;
- break;
- }
-
- sc = &l2_softc[*up];
-
- bzero(&sc->stat, sizeof(lapdstat_t));
- break;
- }
-
- default:
- error = ENOTTY;
- break;
- }
- return(error);
-#endif /* DO_I4B_DEBUG */
-}
-
-/*---------------------------------------------------------------------------*
- * i4bctlpoll - device driver poll routine
- *---------------------------------------------------------------------------*/
-static int
-i4bctlpoll (struct cdev *dev, int events, struct thread *td)
-{
- return (ENODEV);
-}
diff --git a/sys/i4b/driver/i4b_ing.c b/sys/i4b/driver/i4b_ing.c
deleted file mode 100644
index 4c3aa6a..0000000
--- a/sys/i4b/driver/i4b_ing.c
+++ /dev/null
@@ -1,856 +0,0 @@
-/*-
- * Copyright (c) 1999, 2002 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_ing.c - isdn4bsd B-channel to netgraph driver
- * -------------------------------------------------
- * last edit-date: [Sat Mar 9 14:09:53 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/malloc.h>
-
-#include <net/if.h>
-
-#include <netgraph/ng_message.h>
-#include <netgraph/ng_parse.h>
-#include <netgraph/netgraph.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#error "Cannot be used until I4B is locked."
-
-#define I4BINGACCT 1 /* enable accounting messages */
-#define I4BINGACCTINTVL 2 /* accounting msg interval in secs */
-
-#define I4BINGMAXQLEN 50 /* max queue length */
-
-/* initialized by L4 */
-
-static drvr_link_t ing_drvr_linktab[NI4BING];
-static isdn_link_t *isdn_linktab[NI4BING];
-
-struct ing_softc {
- int sc_unit; /* unit number */
- int sc_state; /* state of the interface */
- 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 I4BINGACCT
- struct callout_handle sc_callout;
- 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
-
- int sc_inpkt; /* incoming packets */
- int sc_outpkt; /* outgoing packets */
-
- struct ifqueue xmitq_hipri; /* hi-priority transmit queue */
- struct ifqueue xmitq; /* transmit queue */
-
- node_p node; /* back pointer to node */
- char nodename[NG_NODESIZ]; /* store our node name */
- hook_p debughook;
- hook_p hook;
-
- u_int packets_in; /* packets in from downstream */
- u_int packets_out; /* packets out towards downstream */
- u_int32_t flags;
-
-} ing_softc[NI4BING];
-
-enum ing_states {
- ST_IDLE, /* initialized, ready, idle */
- ST_DIALING, /* dialling out to remote */
- ST_CONNECTED /* connected to remote */
-};
-
-static void i4bingattach(void *);
-
-PSEUDO_SET(i4bingattach, i4b_ing);
-
-static void ing_init_linktab(int unit);
-static void ing_tx_queue_empty(int unit);
-
-/* ========= NETGRAPH ============= */
-
-#define NG_ING_NODE_TYPE "i4bing" /* node type name */
-#define NGM_ING_COOKIE 947513046 /* node type cookie */
-
-/* Hook names */
-#define NG_ING_HOOK_DEBUG "debug"
-#define NG_ING_HOOK_RAW "rawdata"
-
-/* Netgraph commands understood by this node type */
-enum {
- NGM_ING_SET_FLAG = 1,
- NGM_ING_GET_STATUS,
-};
-
-/* This structure is returned by the NGM_ING_GET_STATUS command */
-struct ngingstat {
- u_int packets_in; /* packets in from downstream */
- u_int packets_out; /* packets out towards downstream */
-};
-
-/*
- * This is used to define the 'parse type' for a struct ngingstat, which
- * is bascially a description of how to convert a binary struct ngingstat
- * to an ASCII string and back. See ng_parse.h for more info.
- *
- * This needs to be kept in sync with the above structure definition
- */
-#define NG_ING_STATS_TYPE_INFO { \
- { "packets_in", &ng_parse_int32_type }, \
- { "packets_out", &ng_parse_int32_type }, \
- { NULL }, \
-}
-
-/*
- * This section contains the netgraph method declarations for the
- * sample node. These methods define the netgraph 'type'.
- */
-
-static ng_constructor_t ng_ing_constructor;
-static ng_rcvmsg_t ng_ing_rcvmsg;
-static ng_shutdown_t ng_ing_shutdown;
-static ng_newhook_t ng_ing_newhook;
-static ng_connect_t ng_ing_connect;
-static ng_rcvdata_t ng_ing_rcvdata;
-static ng_disconnect_t ng_ing_disconnect;
-
-/* Parse type for struct ngingstat */
-static const struct
- ng_parse_struct_field ng_ing_stat_type_fields[] =
- NG_ING_STATS_TYPE_INFO;
-
-static const struct ng_parse_type ng_ing_stat_type = {
- &ng_parse_struct_type,
- &ng_ing_stat_type_fields
-};
-
-/* List of commands and how to convert arguments to/from ASCII */
-
-static const struct ng_cmdlist ng_ing_cmdlist[] = {
- {
- NGM_ING_COOKIE,
- NGM_ING_GET_STATUS,
- "getstatus",
- NULL,
- &ng_ing_stat_type,
- },
- {
- NGM_ING_COOKIE,
- NGM_ING_SET_FLAG,
- "setflag",
- &ng_parse_int32_type,
- NULL
- },
- { 0 }
-};
-
-/* Netgraph node type descriptor */
-static struct ng_type typestruct = {
- .version = NG_ABI_VERSION,
- .name = NG_ING_NODE_TYPE,
- .constructor = ng_ing_constructor,
- .rcvmsg = ng_ing_rcvmsg,
- .shutdown = ng_ing_shutdown,
- .newhook = ng_ing_newhook,
- .connect = ng_ing_connect,
- .rcvdata = ng_ing_rcvdata,
- .disconnect = ng_ing_disconnect,
- .cmdlist = ng_ing_cmdlist,
-};
-
-NETGRAPH_INIT_ORDERED(ing, &typestruct, SI_SUB_DRIVERS, SI_ORDER_ANY);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * interface attach routine at kernel boot time
- *---------------------------------------------------------------------------*/
-static void
-i4bingattach(void *dummy)
-{
- struct ing_softc *sc = ing_softc;
- int i;
- int ret;
-
- printf("i4bing: %d i4b NetGraph ISDN B-channel device(s) attached\n", NI4BING);
-
- for(i=0; i < NI4BING; sc++, i++)
- {
- sc->sc_unit = i;
-
- ing_init_linktab(i);
-
- NDBGL4(L4_DIALST, "setting dial state to ST_IDLE");
-
- sc->sc_state = ST_IDLE;
-
- sc->sc_fastq.ifq_maxlen = I4BINGMAXQLEN;
- if(!mtx_initialized(&sc->sc_fastq.ifq_mtx))
- mtx_init(&sc->sc_fastq.ifq_mtx, "i4b_ing_fastq", NULL, MTX_DEF);
-
-#if I4BINGACCT
- callout_handle_init(&sc->sc_callout);
- 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_inpkt = 0;
- sc->sc_outpkt = 0;
-
- sc->sc_updown = SOFT_ENA; /* soft enabled */
-
- sc->sc_dialresp = DSTAT_NONE; /* no response */
- sc->sc_lastdialresp = DSTAT_NONE;
-
- /* setup a netgraph node */
-
- if ((ret = ng_make_node_common(&typestruct, &sc->node)))
- {
- printf("ing: ng_make_node_common, ret = %d\n!", ret);
- }
-
- /* name the netgraph node */
-
- sprintf(sc->nodename, "%s%d", NG_ING_NODE_TYPE, sc->sc_unit);
- if((ret = ng_name_node(sc->node, sc->nodename)))
- {
- printf("ing: ng_name node, ret = %d\n!", ret);
- NG_NODE_UNREF(sc->node);
- break;
- }
-
- NG_NODE_SET_PRIVATE(sc->node, sc);
-
- sc->xmitq.ifq_maxlen = IFQ_MAXLEN;
- sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN;
- if(!mtx_initialized(&sc->xmitq.ifq_mtx))
- mtx_init(&sc->xmitq.ifq_mtx, "i4b_ing_xmitq", NULL, MTX_DEF);
- if(!mtx_initialized(&sc->xmitq_hipri.ifq_mtx))
- mtx_init(&sc->xmitq_hipri.ifq_mtx, "i4b_ing_hipri", NULL, MTX_DEF);
- }
-}
-
-#ifdef I4BINGACCT
-/*---------------------------------------------------------------------------*
- * accounting timeout routine
- *---------------------------------------------------------------------------*/
-static void
-ing_timeout(struct ing_softc *sc)
-{
- bchan_statistics_t bs;
- int unit = sc->sc_unit;
-
- /* 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)/I4BINGACCTINTVL;
- int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BINGACCTINTVL;
-
- 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_ING, unit, ACCT_DURING,
- sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_ioutb, sc->sc_iinb);
- }
-
- sc->sc_callout = timeout((TIMEOUT_FUNC_T)ing_timeout,
- (void *)sc, I4BINGACCTINTVL*hz);
-}
-#endif /* I4BINGACCT */
-
-#if 0
-/*---------------------------------------------------------------------------*
- * clear the interface's send queues
- *---------------------------------------------------------------------------*/
-static void
-ingclearqueue(struct ifqueue *iq)
-{
- int x;
-
- x = splimp();
- IF_DRAIN(iq);
- splx(x);
-}
-#endif
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at connect time
- *---------------------------------------------------------------------------*/
-static void
-ing_connect(int unit, void *cdp)
-{
- struct ing_softc *sc = &ing_softc[unit];
- int s;
-
- sc->sc_cdp = (call_desc_t *)cdp;
-
- s = SPLI4B();
-
- NDBGL4(L4_DIALST, "ing%d: setting dial state to ST_CONNECTED", unit);
-
- sc->sc_dialresp = DSTAT_NONE;
- sc->sc_lastdialresp = DSTAT_NONE;
-
-#if I4BINGACCT
- 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_callout = timeout((TIMEOUT_FUNC_T)ing_timeout,
- (void *)sc, I4BINGACCTINTVL*hz);
-#endif
-
- sc->sc_state = ST_CONNECTED;
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is called from L4 handler at disconnect time
- *---------------------------------------------------------------------------*/
-static void
-ing_disconnect(int unit, void *cdp)
-{
- call_desc_t *cd = (call_desc_t *)cdp;
- struct ing_softc *sc = &ing_softc[unit];
-
- /* new stuff to check that the active channel is being closed */
-
- if (cd != sc->sc_cdp)
- {
- NDBGL4(L4_INGDBG, "ing%d: channel %d not active",
- cd->driver_unit, cd->channelid);
- return;
- }
-
-#if I4BINGACCT
- untimeout((TIMEOUT_FUNC_T)ing_timeout,
- (void *)sc, sc->sc_callout);
-#endif
-
- i4b_l4_accounting(BDRV_ING, 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;
-
- NDBGL4(L4_DIALST, "setting dial state to ST_IDLE");
-
- sc->sc_dialresp = DSTAT_NONE;
- sc->sc_lastdialresp = DSTAT_NONE;
-
- sc->sc_state = ST_IDLE;
-}
-
-/*---------------------------------------------------------------------------*
- * this routine is used to give a feedback from userland daemon
- * in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-ing_dialresponse(int unit, int status, cause_t cause)
-{
- struct ing_softc *sc = &ing_softc[unit];
- sc->sc_dialresp = status;
-
- NDBGL4(L4_INGDBG, "ing%d: last=%d, this=%d",
- unit, sc->sc_lastdialresp, sc->sc_dialresp);
-
- if(status != DSTAT_NONE)
- {
- NDBGL4(L4_INGDBG, "ing%d: clearing queues", unit);
-/* ingclearqueues(sc); */
- }
-}
-
-/*---------------------------------------------------------------------------*
- * interface soft up/down
- *---------------------------------------------------------------------------*/
-static void
-ing_updown(int unit, int updown)
-{
- struct ing_softc *sc = &ing_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
-ing_rx_data_rdy(int unit)
-{
- register struct ing_softc *sc = &ing_softc[unit];
- register struct mbuf *m;
- int error;
-
- if((m = *isdn_linktab[unit]->rx_mbuf) == NULL)
- return;
-
-#if I4BINGACCT
- sc->sc_inb += m->m_pkthdr.len;
-#endif
-
- m->m_pkthdr.rcvif = NULL;
-
- sc->sc_inpkt++;
-
- NG_SEND_DATA_ONLY(error, sc->hook, m);
-}
-
-/*---------------------------------------------------------------------------*
- * 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
-ing_tx_queue_empty(int unit)
-{
- register struct ing_softc *sc = &ing_softc[unit];
- register struct mbuf *m;
- int x = 0;
-
- if(sc->sc_state != ST_CONNECTED)
- return;
-
- for(;;)
- {
- IF_DEQUEUE(&sc->xmitq_hipri, m);
-
- if(m == NULL)
- {
- IF_DEQUEUE(&sc->xmitq, m);
- if(m == NULL)
- break;
- }
-
-#if I4BINGACCT
- sc->sc_outb += m->m_pkthdr.len;
-#endif
-
- x = 1;
-
- if(! IF_HANDOFF(isdn_linktab[unit]->tx_queue, m, NULL))
- {
- NDBGL4(L4_INGDBG, "ing%d: tx queue full!", unit);
- }
- }
-
- 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
-ing_activity(int unit, int rxtx)
-{
- ing_softc[unit].sc_cdp->last_active_time = SECOND;
-}
-
-/*---------------------------------------------------------------------------*
- * return this drivers linktab address
- *---------------------------------------------------------------------------*/
-drvr_link_t *
-ing_ret_linktab(int unit)
-{
- return(&ing_drvr_linktab[unit]);
-}
-
-/*---------------------------------------------------------------------------*
- * setup the isdn_linktab for this driver
- *---------------------------------------------------------------------------*/
-void
-ing_set_linktab(int unit, isdn_link_t *ilt)
-{
- isdn_linktab[unit] = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-ing_init_linktab(int unit)
-{
- ing_drvr_linktab[unit].unit = unit;
- ing_drvr_linktab[unit].bch_rx_data_ready = ing_rx_data_rdy;
- ing_drvr_linktab[unit].bch_tx_queue_empty = ing_tx_queue_empty;
- ing_drvr_linktab[unit].bch_activity = ing_activity;
- ing_drvr_linktab[unit].line_connected = ing_connect;
- ing_drvr_linktab[unit].line_disconnected = ing_disconnect;
- ing_drvr_linktab[unit].dial_response = ing_dialresponse;
- ing_drvr_linktab[unit].updown_ind = ing_updown;
-}
-
-/*===========================================================================*
- * NETGRAPH INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * It is not possible or allowable to create a node of this type.
- * If the hardware exists, it will already have created it.
- *---------------------------------------------------------------------------*/
-static int
-ng_ing_constructor(node_p node)
-{
- return(EINVAL);
-}
-
-/*---------------------------------------------------------------------------*
- * Give our ok for a hook to be added...
- * Add the hook's private info to the hook structure.
- *---------------------------------------------------------------------------*/
-static int
-ng_ing_newhook(node_p node, hook_p hook, const char *name)
-{
- struct ing_softc *sc = NG_NODE_PRIVATE(node);
-
- /*
- * check if it's our friend the debug hook
- */
- if(strcmp(name, NG_ING_HOOK_DEBUG) == 0)
- {
- NG_HOOK_SET_PRIVATE(hook, NULL); /* paranoid */
- sc->debughook = hook;
- return (0);
- }
- /*
- * Check for raw mode hook.
- */
- if(strcmp(name, NG_ING_HOOK_RAW) == 0)
- {
- NG_HOOK_SET_PRIVATE(hook, sc);
- sc->hook = hook;
- return (0);
- }
-
- return (EINVAL);
-}
-
-/*---------------------------------------------------------------------------*
- * Get a netgraph control message.
- * Check it is one we understand. If needed, send a response.
- * We could save the address for an async action later, but don't here.
- * Always free the message.
- * The response should be in a malloc'd region that the caller can 'free'.
- * A response is not required.
- *---------------------------------------------------------------------------*/
-static int
-ng_ing_rcvmsg(node_p node, item_p item, hook_p lasthook)
-{
- struct ing_softc *sc = NG_NODE_PRIVATE(node);
-
- struct ng_mesg *resp = NULL;
- int error = 0;
- struct ng_mesg *msg;
-
- NGI_GET_MSG(item, msg);
-
- if(msg->header.typecookie == NGM_GENERIC_COOKIE)
- {
- switch(msg->header.cmd)
- {
- case NGM_TEXT_STATUS:
- {
- char *arg;
- char *p;
- int pos = 0;
-
- NG_MKRESPONSE(resp, msg, sizeof(struct ng_mesg) + NG_TEXTRESPONSE, M_NOWAIT);
-
- if (resp == NULL)
- {
- error = ENOMEM;
- break;
- }
- arg = (char *) resp->data;
-
- switch(sc->sc_state)
- {
- case ST_IDLE:
- p = "idle";
- break;
- case ST_DIALING:
- p = "dialing";
- break;
- case ST_CONNECTED:
- p = "connected";
- break;
- default:
- p = "???";
- break;
- }
-
- pos = sprintf(arg, "state = %s (%d)\n", p, sc->sc_state);
-#if I4BINGACCT
- pos += sprintf(arg + pos, "%d bytes in, %d bytes out\n", sc->sc_inb, sc->sc_outb);
-#endif
- pos += sprintf(arg + pos, "%d pkts in, %d pkts out\n", sc->sc_inpkt, sc->sc_outpkt);
-
- resp->header.arglen = pos + 1;
- break;
- }
-
- default:
- error = EINVAL;
- break;
- }
- }
- else if(msg->header.typecookie == NGM_ING_COOKIE)
- {
- switch (msg->header.cmd)
- {
- case NGM_ING_GET_STATUS:
- {
- struct ngingstat *stats;
-
- NG_MKRESPONSE(resp, msg, sizeof(*stats), M_NOWAIT);
-
- if (!resp)
- {
- error = ENOMEM;
- break;
- }
-
- stats = (struct ngingstat *) resp->data;
- stats->packets_in = sc->packets_in;
- stats->packets_out = sc->packets_out;
- break;
- }
-
- case NGM_ING_SET_FLAG:
- if (msg->header.arglen != sizeof(u_int32_t))
- {
- error = EINVAL;
- break;
- }
- sc->flags = *((u_int32_t *) msg->data);
- break;
-
- default:
- error = EINVAL; /* unknown command */
- break;
- }
- }
- else
- {
- error = EINVAL; /* unknown cookie type */
- }
-
- /* Take care of synchronous response, if any */
- NG_RESPOND_MSG(error, node, item, resp);
- /* Free the message and return */
- NG_FREE_MSG(msg);
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * get data from another node and transmit it out on a B-channel
- *---------------------------------------------------------------------------*/
-static int
-ng_ing_rcvdata(hook_p hook, item_p item)
-{
- struct ing_softc *sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
- struct ifqueue *xmitq_p;
- int s;
- struct mbuf *m;
- struct ng_tag_prio *ptag;
-
- NGI_GET_M(item, m);
- NG_FREE_ITEM(item);
-
- if(NG_HOOK_PRIVATE(hook) == NULL)
- {
- NG_FREE_M(m);
- return(ENETDOWN);
- }
-
- if(sc->sc_state == ST_IDLE || sc->sc_state == ST_DIALING)
- {
- i4b_l4_dialout(BDRV_ING, sc->sc_unit);
- sc->sc_state = ST_DIALING;
- }
-
- sc->sc_outpkt++;
-
- /*
- * Now queue the data for when it can be sent
- */
- if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE,
- NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) )
- xmitq_p = (&sc->xmitq_hipri);
- else
- xmitq_p = (&sc->xmitq);
-
- s = splimp();
-
- IF_LOCK(xmitq_p);
- if (_IF_QFULL(xmitq_p))
- {
- _IF_DROP(xmitq_p);
- IF_UNLOCK(xmitq_p);
- splx(s);
- NG_FREE_M(m);
- return(ENOBUFS);
- }
-
- _IF_ENQUEUE(xmitq_p, m);
- IF_UNLOCK(xmitq_p);
-
- ing_tx_queue_empty(sc->sc_unit);
-
- splx(s);
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * Do local shutdown processing..
- * If we are a persistant device, we might refuse to go away, and
- * we'd only remove our links and reset ourself.
- *---------------------------------------------------------------------------*/
-static int
-ng_ing_shutdown(node_p node)
-{
- struct ing_softc *sc = NG_NODE_PRIVATE(node);
- int ret;
-
- NG_NODE_UNREF(node);
-
- sc->packets_in = 0; /* reset stats */
- sc->packets_out = 0;
-
- if ((ret = ng_make_node_common(&typestruct, &sc->node)))
- {
- printf("ing: ng_make_node_common, ret = %d\n!", ret);
- }
-
- /* name the netgraph node */
- sprintf(sc->nodename, "%s%d", NG_ING_NODE_TYPE, sc->sc_unit);
- if((ret = ng_name_node(sc->node, sc->nodename)))
- {
- printf("ing: ng_name node, ret = %d\n!", ret);
- NG_NODE_UNREF(sc->node);
- return (0);
- }
-
- NG_NODE_SET_PRIVATE(sc->node, sc);
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * This is called once we've already connected a new hook to the other node.
- *---------------------------------------------------------------------------*/
-static int
-ng_ing_connect(hook_p hook)
-{
- /* probably not at splnet, force outward queueing */
- NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook));
- return (0);
-}
-
-/*
- * Dook disconnection
- *
- * For this type, removal of the last link destroys the node
- */
-static int
-ng_ing_disconnect(hook_p hook)
-{
- struct ing_softc *sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
- int s;
-
- if(NG_HOOK_PRIVATE(hook))
- {
- s = splimp();
- splx(s);
- }
- else
- {
- sc->debughook = NULL;
- }
- return (0);
-}
-
-/*===========================================================================*/
diff --git a/sys/i4b/driver/i4b_ipr.c b/sys/i4b/driver/i4b_ipr.c
deleted file mode 100644
index b42380f..0000000
--- a/sys/i4b/driver/i4b_ipr.c
+++ /dev/null
@@ -1,1034 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ---------------------------------------------------------
- * last edit-date: [Sun Mar 17 09:32:58 2002]
- *
- *---------------------------------------------------------------------------*
- *
- * statistics counter usage (interface lifetime):
- * ----------------------------------------------
- * sc->sc_ifp->if_ipackets # of received packets
- * sc->sc_ifp->if_ierrors # of error packets not going to upper layers
- * sc->sc_ifp->if_opackets # of transmitted packets
- * sc->sc_ifp->if_oerrors # of error packets not being transmitted
- * sc->sc_ifp->if_collisions # of invalid ip packets after VJ decompression
- * sc->sc_ifp->if_ibytes # of bytes coming in from the line (before VJ)
- * sc->sc_ifp->if_obytes # of bytes going out to the line (after VJ)
- * sc->sc_ifp->if_imcasts (currently unused)
- * sc->sc_ifp->if_omcasts # of frames sent out of the fastqueue
- * sc->sc_ifp->if_iqdrops # of frames dropped on input because queue full
- * sc->sc_ifp->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 <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#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 <net/if.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-
-#ifdef IPR_VJ
-#include <sys/malloc.h>
-#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 <sys/time.h>
-#include <net/bpf.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#error "Cannot be used until I4B is locked."
-
-#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_ifp; /* network-visible interface */
- int sc_state; /* state of the interface */
- 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 */
- struct callout_handle sc_callout;
-
-#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
-
-#if IPR_LOG
- int sc_log_first; /* log first n packets */
-#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 */
-};
-
-static void i4biprattach(void *);
-PSEUDO_SET(i4biprattach, i4b_ipr);
-static int i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
-
-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
- *---------------------------------------------------------------------------*/
-static void
-i4biprattach(void *dummy)
-{
- struct ipr_softc *sc = ipr_softc;
- int i;
-
-#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
-
- for(i=0; i < NI4BIPR; sc++, i++)
- {
- ipr_init_linktab(i);
-
- NDBGL4(L4_DIALST, "setting dial state to ST_IDLE");
-
- sc->sc_ifp = if_alloc(IFT_ISDNBASIC);
- if (sc->sc_ifp == NULL)
- panic("i4b_ipr.c, i4biprattach: cannot if_alloc()");
-
- sc->sc_ifp->if_softc = sc;
- sc->sc_state = ST_IDLE;
- if_initname(sc->sc_ifp, "ipr", i);
-
-
-#ifdef IPR_VJ
- sc->sc_ifp->if_flags = IFF_POINTOPOINT | IFF_SIMPLEX | IPR_AUTOCOMP;
-#else
- sc->sc_ifp->if_flags = IFF_POINTOPOINT | IFF_SIMPLEX;
-#endif
-
- sc->sc_ifp->if_mtu = I4BIPRMTU;
- sc->sc_ifp->if_ioctl = i4biprioctl;
- sc->sc_ifp->if_output = i4biproutput;
-
- sc->sc_ifp->if_snd.ifq_maxlen = I4BIPRMAXQLEN;
- sc->sc_fastq.ifq_maxlen = I4BIPRMAXQLEN;
-
- if(!mtx_initialized(&sc->sc_fastq.ifq_mtx))
- mtx_init(&sc->sc_fastq.ifq_mtx, "i4b_ipr_fastq", NULL, MTX_DEF);
-
- sc->sc_ifp->if_ipackets = 0;
- sc->sc_ifp->if_ierrors = 0;
- sc->sc_ifp->if_opackets = 0;
- sc->sc_ifp->if_oerrors = 0;
- sc->sc_ifp->if_collisions = 0;
- sc->sc_ifp->if_ibytes = 0;
- sc->sc_ifp->if_obytes = 0;
- sc->sc_ifp->if_imcasts = 0;
- sc->sc_ifp->if_omcasts = 0;
- sc->sc_ifp->if_iqdrops = 0;
- sc->sc_ifp->if_noproto = 0;
-
-#if I4BIPRACCT
- sc->sc_ifp->if_timer = 0;
- sc->sc_ifp->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
-
-#if IPR_LOG
- sc->sc_log_first = IPR_LOG;
-#endif
-
-#ifdef IPR_VJ
- sl_compress_init(&sc->sc_compr, -1);
-
-#ifdef IPR_VJ_USEBUFFER
- if(!((sc->sc_cbuf =
- (u_char *)malloc(I4BIPRMAXMTU+128, M_DEVBUF, M_WAITOK))))
- {
- panic("i4b_ipr.c, i4biprattach: 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_ifp);
-
- bpfattach(sc->sc_ifp, DLT_NULL, sizeof(u_int32_t));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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;
- u_int32_t af;
-
- s = SPLI4B();
-
- sc = ifp->if_softc;
- unit = ifp->if_dunit;
-
- /* BPF writes need to be handled specially. */
- if(dst->sa_family == AF_UNSPEC)
- {
- bcopy(dst->sa_data, &af, sizeof(af));
- dst->sa_family = af;
- }
-
- /* check for IP */
-
- if(dst->sa_family != AF_INET)
- {
- if_printf(ifp, "af%d not supported\n", dst->sa_family);
- m_freem(m);
- splx(s);
- sc->sc_ifp->if_noproto++;
- sc->sc_ifp->if_oerrors++;
- return(EAFNOSUPPORT);
- }
-
- /* check interface state = UP */
-
- if(!(ifp->if_flags & IFF_UP))
- {
- NDBGL4(L4_IPRDBG, "ipr%d: interface is DOWN!", unit);
- m_freem(m);
- splx(s);
- sc->sc_ifp->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 */
- NDBGL4(L4_IPRDBG, "ipr%d: transient dial failure!", unit);
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_ifp->if_oerrors++;
- return(ENETUNREACH);
- break;
-
- case DSTAT_PFAIL: /* permanent failure */
- NDBGL4(L4_IPRDBG, "ipr%d: permanent dial failure!", unit);
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_ifp->if_oerrors++;
- return(EHOSTUNREACH);
- break;
-
- case DSTAT_INONLY: /* no dialout allowed*/
- NDBGL4(L4_IPRDBG, "ipr%d: dialout not allowed failure!", unit);
- m_freem(m);
- iprclearqueues(sc);
- sc->sc_dialresp = DSTAT_NONE;
- splx(s);
- sc->sc_ifp->if_oerrors++;
- return(EHOSTUNREACH);
- break;
- }
-#endif
-
- NDBGL4(L4_IPRDBG, "ipr%d: send dial request message!", unit);
- NDBGL4(L4_DIALST, "ipr%d: setting dial state to ST_DIALING", unit);
- i4b_l4_dialout(BDRV_IPR, unit);
- sc->sc_state = ST_DIALING;
- }
-
-#if IPR_LOG
- if(sc->sc_log_first > 0)
- {
- --(sc->sc_log_first);
- i4b_l4_packet_ind(BDRV_IPR, unit, 1, m );
- }
-#endif
-
- /* update access time */
-
- microtime(&sc->sc_ifp->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 = (struct ifqueue *)&sc->sc_ifp->if_snd;
-
- /* check for space in choosen send queue */
-
- if(! IF_HANDOFF(ifq, m, NULL))
- {
- NDBGL4(L4_IPRDBG, "ipr%d: send queue full!", unit);
- splx(s);
- sc->sc_ifp->if_oerrors++;
- return(ENOBUFS);
- }
-
- NDBGL4(L4_IPRDBG, "ipr%d: add packet to send queue!", unit);
-
- ipr_tx_queue_empty(unit);
-
- splx(s);
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * process ioctl
- *---------------------------------------------------------------------------*/
-static int
-i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
-{
- struct ipr_softc *sc = ifp->if_softc;
- 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_ifp->if_flags |= IFF_UP;
- microtime(&sc->sc_ifp->if_lastchange);
- break;
-
- case SIOCSIFFLAGS: /* set interface flags */
- if(!(ifr->ifr_flags & IFF_UP))
- {
- if(sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
- {
- /* disconnect ISDN line */
- i4b_l4_drvrdisc(BDRV_IPR,
- ifp->if_dunit);
- sc->sc_ifp->if_drv_flags &=
- ~IFF_DRV_RUNNING;
- }
-
- sc->sc_state = ST_IDLE;
-
- /* empty queues */
-
- iprclearqueues(sc);
- }
-
- if(ifr->ifr_flags & IFF_DEBUG)
- {
- /* enable debug messages */
- }
-
- microtime(&sc->sc_ifp->if_lastchange);
- break;
-
- 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_ifp->if_lastchange);
- }
- break;
-#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 thread *td = curthread; /* XXX */
-
- if((error = priv_check(td, PRIV_DRIVER)))
- return (error);
- sl_compress_setup(sc->sc_compr, *(int *)data);
- }
- break;
-#endif
-#endif /* #if 0 */
-
- default:
- error = EINVAL;
- break;
- }
- splx(s);
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * clear the interface's send queues
- *---------------------------------------------------------------------------*/
-static void
-iprclearqueues(struct ipr_softc *sc)
-{
- int x;
-
- x = splimp();
- IF_DRAIN(&sc->sc_fastq);
- IF_DRAIN(&sc->sc_ifp->if_snd);
- splx(x);
-}
-
-#if I4BIPRACCT
-/*---------------------------------------------------------------------------*
- * watchdog routine
- *---------------------------------------------------------------------------*/
-static void
-iprwatchdog(struct ifnet *ifp)
-{
- int unit = ifp->if_dunit;
- struct ipr_softc *sc = ifp->if_softc;
- 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_ifp->if_timer = I4BIPRACCTINTVL;
-}
-#endif /* I4BIPRACCT */
-
-/*===========================================================================*
- * ISDN INTERFACE ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * start transmitting after connect
- *---------------------------------------------------------------------------*/
-static void
-i4bipr_connect_startio(struct ipr_softc *sc)
-{
- int s = SPLI4B();
-
- if(sc->sc_state == ST_CONNECTED_W)
- {
- sc->sc_state = ST_CONNECTED_A;
- ipr_tx_queue_empty(sc->sc_ifp->if_dunit);
- }
-
- 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();
-
- NDBGL4(L4_DIALST, "ipr%d: setting dial state to ST_CONNECTED", unit);
-
- sc->sc_ifp->if_drv_flags |= IFF_DRV_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_ifp->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)
- {
- int delay;
-
- if (hz == 100) {
- delay = sc->sc_cdp->isdntxdelay; /* avoid any rounding */
- } else {
- delay = sc->sc_cdp->isdntxdelay*hz;
- delay /= 100;
- }
-
- START_TIMER(sc->sc_callout, (TIMEOUT_FUNC_T)i4bipr_connect_startio, (void *)sc, delay);
- }
- 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)
- {
- NDBGL4(L4_IPRDBG, "ipr%d: channel %d not active",
- cd->driver_unit, cd->channelid);
- return;
- }
-
-#if I4BIPRACCT
- sc->sc_ifp->if_timer = 0;
-#endif
-
-#if IPR_LOG
- /* show next IPR_LOG packets again */
- sc->sc_log_first = IPR_LOG;
-#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;
-
- NDBGL4(L4_DIALST, "setting dial state to ST_IDLE");
-
- sc->sc_dialresp = DSTAT_NONE;
- sc->sc_lastdialresp = DSTAT_NONE;
-
- sc->sc_ifp->if_drv_flags &= ~IFF_DRV_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, cause_t cause)
-{
- struct ipr_softc *sc = &ipr_softc[unit];
- sc->sc_dialresp = status;
-
- NDBGL4(L4_IPRDBG, "ipr%d: last=%d, this=%d",
- unit, sc->sc_lastdialresp, sc->sc_dialresp);
-
- if(status != DSTAT_NONE)
- {
- NDBGL4(L4_IPRDBG, "ipr%d: clearing queues", unit);
- iprclearqueues(sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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_ifp;
-
- m->m_pkthdr.len = m->m_len;
-
- microtime(&sc->sc_ifp->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_ifp->if_ipackets++;
- sc->sc_ifp->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_ifp->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_ifp->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_ifp->if_flags |= IPR_COMPRESS;
- }
- else
- {
-#ifdef DEBUG_IPR_VJ
- printf("i4b_ipr, ipr_input: invalid ip packet!\n");
-#endif
-
-error:
- sc->sc_ifp->if_ierrors++;
- sc->sc_ifp->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 IPR_LOG
- if(sc->sc_log_first > 0)
- {
- --(sc->sc_log_first);
- i4b_l4_packet_ind(BDRV_IPR, unit, 0, m );
- }
-#endif
-
- if(bpf_peers_present(sc->sc_ifp->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;
- bpf_mtap(sc->sc_ifp->if_bpf, &mm);
- }
-
- if(netisr_queue(NETISR_IP, m)) /* (0) on success. */
- {
- NDBGL4(L4_IPRDBG, "ipr%d: ipintrq full!", unit);
- sc->sc_ifp->if_ierrors++;
- sc->sc_ifp->if_iqdrops++;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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_ifp->if_omcasts++;
- }
- else
- {
- IF_DEQUEUE(&sc->sc_ifp->if_snd, m);
- if(m == NULL)
- break;
- }
-
- microtime(&sc->sc_ifp->if_lastchange);
-
- if(bpf_peers_present(sc->sc_ifp->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;
- bpf_mtap(sc->sc_ifp->if_bpf, &mm);
- }
-
-#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_ifp->if_flags & IPR_COMPRESS)
- {
- *mtod(m, u_char *) |= sl_compress_tcp(m, ip,
- &sc->sc_compr, 1);
- }
- }
-#endif
- x = 1;
-
- IF_LOCK(isdn_linktab[unit]->tx_queue);
- if(_IF_QFULL(isdn_linktab[unit]->tx_queue))
- {
- NDBGL4(L4_IPRDBG, "ipr%d: tx queue full!", unit);
- m_freem(m);
- }
- else
- {
- sc->sc_ifp->if_obytes += m->m_pkthdr.len;
-
- sc->sc_ifp->if_opackets++;
-
- _IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
-
- }
- IF_UNLOCK(isdn_linktab[unit]->tx_queue);
- }
-
- 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;
-}
-
-/*===========================================================================*/
diff --git a/sys/i4b/driver/i4b_isppp.c b/sys/i4b/driver/i4b_isppp.c
deleted file mode 100644
index e971f33..0000000
--- a/sys/i4b/driver/i4b_isppp.c
+++ /dev/null
@@ -1,677 +0,0 @@
-/*-
- * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
- *
- * Copyright (c) 1997, 2002 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.
- *
- * last edit-date: [Sat Mar 9 14:09:27 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#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 <net/if.h>
-#include <net/if_types.h>
-#include <net/if_sppp.h>
-
-#include <sys/time.h>
-#include <net/bpf.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#error "Cannot be used until I4B is locked."
-
-#define ISPPP_FMT "isp%d: "
-#define ISPPP_ARG(sc) (sc->sc_ifp->if_dunit)
-#define PDEVSTATIC static
-#define IFP2UNIT(ifp) (ifp)->if_dunit
-
-# 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
-
-PDEVSTATIC void i4bispppattach(void *);
-PSEUDO_SET(i4bispppattach, i4b_isppp);
-
-#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 ifnet *sc_ifp;
-
- int sc_state; /* state of the interface */
- 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
-
- struct callout_handle sc_ch;
-} 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);
-time_t i4bisppp_idletime(int unit);
-
-/* 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
-i4bispppattach(void *dummy)
-{
- struct i4bisppp_softc *sc = i4bisppp_softc;
- struct ifnet *ifp;
- int i;
-
-#ifdef SPPP_VJ
- printf("i4bisppp: %d ISDN SyncPPP device(s) attached (VJ header compression)\n", NI4BISPPP);
-#else
- printf("i4bisppp: %d ISDN SyncPPP device(s) attached\n", NI4BISPPP);
-#endif
-
- for(i = 0; i < NI4BISPPP; sc++, i++) {
- i4bisppp_init_linktab(i);
- ifp = sc->sc_ifp = if_alloc(IFT_PPP);
- if (ifp == NULL) {
- panic("isp%d: cannot if_alloc()", i);
- }
-
- ifp->if_softc = sc;
- if_initname(sc->sc_ifp, "isp", i);
- ifp->if_mtu = PP_MTU;
- ifp->if_flags = IFF_SIMPLEX | IFF_POINTOPOINT;
- /*
- * XXX: If there were a detach function this would
- * require that it use if_free_type(). Not sure if this
- * type makes sense.
- */
- ifp->if_type = IFT_ISDNBASIC;
- sc->sc_state = ST_IDLE;
-
- ifp->if_ioctl = i4bisppp_ioctl;
-
- /* actually initialized by sppp_attach() */
- /* ifp->if_output = sppp_output; */
-
- ifp->if_start = i4bisppp_start;
-
- ifp->if_hdrlen = 0;
- ifp->if_addrlen = 0;
- ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
-
- ifp->if_ipackets = 0;
- ifp->if_ierrors = 0;
- ifp->if_opackets = 0;
- ifp->if_oerrors = 0;
- ifp->if_collisions = 0;
- ifp->if_ibytes = 0;
- ifp->if_obytes = 0;
- ifp->if_imcasts = 0;
- ifp->if_omcasts = 0;
- ifp->if_iqdrops = 0;
- ifp->if_noproto = 0;
-
-#if I4BISPPPACCT
- ifp->if_timer = 0;
- ifp->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
-
- IFP2SP(sc->sc_ifp)->pp_tls = i4bisppp_tls;
- IFP2SP(sc->sc_ifp)->pp_tlf = i4bisppp_tlf;
- IFP2SP(sc->sc_ifp)->pp_con = i4bisppp_negotiation_complete;
- IFP2SP(sc->sc_ifp)->pp_chg = i4bisppp_state_changed;
-
- sppp_attach(sc->sc_ifp);
-
- if_attach(sc->sc_ifp);
-
- CALLOUT_INIT(&sc->sc_ch);
-
- bpfattach(sc->sc_ifp, DLT_PPP, PPP_HDRLEN);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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 = IFP2SP(sc->sc_ifp);
- struct ifaddr *ifa = (struct ifaddr *) data;
- struct ifreq *ifr = (struct ifreq *) data;
-#endif
-
- int error;
-
- error = sppp_ioctl(sc->sc_ifp, 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_drv_flags |= IFF_DRV_OACTIVE; // - need to clear this somewhere
- * splx(s);
- */
-
- while ((m = sppp_dequeue(sc->sc_ifp)) != NULL)
- {
-
- BPF_MTAP(ifp, m);
-
- microtime(&ifp->if_lastchange);
-
- IF_LOCK(isdn_linktab[unit]->tx_queue);
- if(_IF_QFULL(isdn_linktab[unit]->tx_queue))
- {
- NDBGL4(L4_ISPDBG, "isp%d, tx queue full!", unit);
- m_freem(m);
- }
- else
- {
-#if 0
- sc->sc_ifp->if_obytes += m->m_pkthdr.len;
-#endif
- sc->sc_outb += m->m_pkthdr.len;
- sc->sc_ifp->if_opackets++;
-
- _IF_ENQUEUE(isdn_linktab[unit]->tx_queue, m);
- }
- IF_UNLOCK(isdn_linktab[unit]->tx_queue);
- }
- 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_ifp->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 ifnet *ifp = SP2IFP(sp);
- struct i4bisppp_softc *sc = ifp->if_softc;
-
- 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 ifnet *ifp = SP2IFP(sp);
- struct i4bisppp_softc *sc = ifp->if_softc;
-/* call_desc_t *cd = sc->sc_cdp; */
-
- 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 = SP2IFP(sp)->if_softc;
-
- 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 = SP2IFP(sp)->if_softc;
-
- 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 = IFP2SP(sc->sc_ifp);
- 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_ifp->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 */
-
- sp->pp_last_sent = sp->pp_last_recv = SECOND;
-
- 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 = IFP2SP(sc->sc_ifp);
-
- int s = splimp();
-
- /* new stuff to check that the active channel is being closed */
- if (cd != sc->sc_cdp)
- {
- NDBGL4(L4_ISPDBG, "isp%d, channel%d not active!", unit, cd->channelid);
- splx(s);
- return;
- }
-
-#if I4BISPPPACCT
- sc->sc_ifp->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 this 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, cause_t cause)
-{
- struct i4bisppp_softc *sc = &i4bisppp_softc[unit];
- struct sppp *sp = IFP2SP(sc->sc_ifp);
-
- NDBGL4(L4_ISPDBG, "isp%d: status=%d, cause=%d", unit, status, cause);
-
- if(status != DSTAT_NONE)
- {
- struct mbuf *m;
-
- NDBGL4(L4_ISPDBG, "isp%d: clearing queues", unit);
-
- if(!(sppp_isempty(sc->sc_ifp)))
- {
- while((m = sppp_dequeue(sc->sc_ifp)) != NULL)
- m_freem(m);
- }
-
- sc->sc_cdp = (call_desc_t *)0;
- /* do this here because pp_down calls i4bisppp_tlf */
- sc->sc_state = ST_IDLE;
-
- /*
- * Ahh, sppp doesn't like to get a down event when
- * dialing fails. So first tell it that we are up
- * (doesn't hurt us since sc_state != ST_CONNECTED)
- * and then go down.
- */
- sp->pp_up(sp);
- sp->pp_down(sp);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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_ifp;
- m->m_pkthdr.len = m->m_len;
-
- microtime(&sc->sc_ifp->if_lastchange);
-
- sc->sc_ifp->if_ipackets++;
-#if 0
- sc->sc_ifp->if_ibytes += m->m_pkthdr.len;
-#endif
-
-#if I4BISPPPACCT
- sc->sc_inb += m->m_pkthdr.len;
-#endif
-
-#ifdef I4BISPPPDEBUG
- printf("i4bisppp_rx_data_ready: received packet!\n");
-#endif
-
- BPF_MTAP(sc->sc_ifp, m);
-
- s = splimp();
-
- sppp_input(sc->sc_ifp, 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_ifp);
-}
-
-/*---------------------------------------------------------------------------*
- * THIS should be used instead of last_active_time to implement
- * an activity timeout mechanism.
- *
- * Sending back the time difference unneccessarily complicates the
- * idletime checks in i4b_l4.c. Return the largest time instead.
- * That way the code in i4b_l4.c needs only minimal changes.
- *---------------------------------------------------------------------------*/
-time_t
-i4bisppp_idletime(int unit)
-{
- struct sppp *sp = IFP2SP((&i4bisppp_softc[unit])->sc_ifp);
-
- return((sp->pp_last_recv < sp->pp_last_sent) ?
- sp->pp_last_sent : sp->pp_last_recv);
-}
-
-/*---------------------------------------------------------------------------*
- * 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 7ccca77..0000000
--- a/sys/i4b/driver/i4b_rbch.c
+++ /dev/null
@@ -1,826 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ---------------------------------------------------
- * last edit-date: [Sun Mar 17 09:51:03 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/filio.h>
-#include <sys/tty.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_rbch_ioctl.h>
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#include <sys/ioccom.h>
-#include <sys/poll.h>
-
-static drvr_link_t rbch_drvr_linktab[NI4BRBCH];
-static isdn_link_t *isdn_linktab[NI4BRBCH];
-
-#define I4BRBCHACCT 1 /* enable accounting messages */
-#define I4BRBCHACCTINTVL 2 /* accounting msg interval in secs */
-
-static struct rbch_softc {
- int sc_unit; /* unit number */
-
- 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 *sc_cd; /* Call Descriptor */
- struct termios it_in;
-
- struct ifqueue sc_hdlcq; /* hdlc read queue */
-#define I4BRBCHMAXQLEN 10
-
- struct selinfo selp; /* select / poll */
-
-#if I4BRBCHACCT
- struct callout_handle sc_callout;
- int sc_iinb; /* isdn driver # of inbytes */
- int sc_ioutb; /* isdn driver # of outbytes */
- int sc_linb; /* last # of bytes rx'd */
- int sc_loutb; /* last # of bytes tx'd */
- int sc_fn; /* flag, first null acct */
-#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);
-
-static d_open_t i4brbchopen;
-static d_close_t i4brbchclose;
-static d_read_t i4brbchread;
-static d_read_t i4brbchwrite;
-static d_ioctl_t i4brbchioctl;
-static d_poll_t i4brbchpoll;
-
-
-static struct cdevsw i4brbch_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
- .d_open = i4brbchopen,
- .d_close = i4brbchclose,
- .d_read = i4brbchread,
- .d_write = i4brbchwrite,
- .d_ioctl = i4brbchioctl,
- .d_poll = i4brbchpoll,
- .d_name = "i4brbch",
-};
-
-static void i4brbchattach(void *);
-PSEUDO_SET(i4brbchattach, i4b_rbch);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4brbchattach(void *dummy)
-{
- int i;
-
- printf("i4brbch: %d raw B channel access device(s) attached\n", NI4BRBCH);
-
- for(i=0; i < NI4BRBCH; i++)
- {
- make_dev(&i4brbch_cdevsw, i,
- UID_ROOT, GID_WHEEL, 0600, "i4brbch%d", i);
-
-#if I4BRBCHACCT
- callout_handle_init(&rbch_softc[i].sc_callout);
- rbch_softc[i].sc_fn = 1;
-#endif
- rbch_softc[i].sc_unit = i;
- rbch_softc[i].sc_devstate = ST_IDLE;
- rbch_softc[i].sc_hdlcq.ifq_maxlen = I4BRBCHMAXQLEN;
-
- if(!mtx_initialized(&rbch_softc[i].sc_hdlcq.ifq_mtx))
- mtx_init(&rbch_softc[i].sc_hdlcq.ifq_mtx, "i4b_rbch", NULL, MTX_DEF);
-
- 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
- *---------------------------------------------------------------------------*/
-static int
-i4brbchopen(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- int unit = minor(dev);
-
- if(unit >= NI4BRBCH)
- return(ENXIO);
-
- if(rbch_softc[unit].sc_devstate & ST_ISOPEN)
- return(EBUSY);
-
-#if 0
- rbch_clrq(unit);
-#endif
-
- rbch_softc[unit].sc_devstate |= ST_ISOPEN;
-
- NDBGL4(L4_RBCHDBG, "unit %d, open", unit);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * close rbch device
- *---------------------------------------------------------------------------*/
-static int
-i4brbchclose(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- int unit = minor(dev);
- struct rbch_softc *sc = &rbch_softc[unit];
-
- if(sc->sc_devstate & ST_CONNECTED)
- i4b_l4_drvrdisc(BDRV_RBCH, unit);
-
- sc->sc_devstate &= ~ST_ISOPEN;
-
- rbch_clrq(unit);
-
- NDBGL4(L4_RBCHDBG, "unit %d, closed", unit);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * read from rbch device
- *---------------------------------------------------------------------------*/
-static int
-i4brbchread(struct cdev *dev, struct uio *uio, int ioflag)
-{
- struct mbuf *m;
- int error = 0;
- int unit = minor(dev);
- struct ifqueue *iqp;
- struct rbch_softc *sc = &rbch_softc[unit];
-
- CRIT_VAR;
-
- NDBGL4(L4_RBCHDBG, "unit %d, enter read", unit);
-
- CRIT_BEG;
- if(!(sc->sc_devstate & ST_ISOPEN))
- {
- CRIT_END;
- NDBGL4(L4_RBCHDBG, "unit %d, read while not open", unit);
- return(EIO);
- }
-
- if((sc->sc_devstate & ST_NOBLOCK))
- {
- if(!(sc->sc_devstate & ST_CONNECTED)) {
- CRIT_END;
- return(EWOULDBLOCK);
- }
-
- if(sc->sc_bprot == BPROT_RHDLC)
- iqp = &sc->sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- if(IF_QEMPTY(iqp) && (sc->sc_devstate & ST_ISOPEN)) {
- CRIT_END;
- return(EWOULDBLOCK);
- }
- }
- else
- {
- while(!(sc->sc_devstate & ST_CONNECTED))
- {
- NDBGL4(L4_RBCHDBG, "unit %d, wait read init", unit);
-
- if((error = tsleep( &rbch_softc[unit],
- I4BPRI | PCATCH,
- "rrrbch", 0 )) != 0)
- {
- CRIT_END;
- NDBGL4(L4_RBCHDBG, "unit %d, error %d tsleep", unit, error);
- return(error);
- }
- }
-
- if(sc->sc_bprot == BPROT_RHDLC)
- iqp = &sc->sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- while(IF_QEMPTY(iqp) && (sc->sc_devstate & ST_ISOPEN))
- {
- sc->sc_devstate |= ST_RDWAITDATA;
-
- NDBGL4(L4_RBCHDBG, "unit %d, wait read data", unit);
-
- if((error = tsleep( &isdn_linktab[unit]->rx_queue,
- I4BPRI | PCATCH,
- "rrbch", 0 )) != 0)
- {
- CRIT_END;
- NDBGL4(L4_RBCHDBG, "unit %d, error %d tsleep read", unit, error);
- sc->sc_devstate &= ~ST_RDWAITDATA;
- return(error);
- }
- }
- }
-
- IF_DEQUEUE(iqp, m);
-
- NDBGL4(L4_RBCHDBG, "unit %d, read %d bytes", unit, m->m_len);
-
- if(m && m->m_len)
- {
- error = uiomove(m->m_data, m->m_len, uio);
- }
- else
- {
- NDBGL4(L4_RBCHDBG, "unit %d, error %d uiomove", unit, error);
- error = EIO;
- }
-
- if(m)
- i4b_Bfreembuf(m);
-
- CRIT_END;
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * write to rbch device
- *---------------------------------------------------------------------------*/
-static int
-i4brbchwrite(struct cdev *dev, struct uio * uio, int ioflag)
-{
- struct mbuf *m;
- int error = 0;
- int unit = minor(dev);
- struct rbch_softc *sc = &rbch_softc[unit];
-
- CRIT_VAR;
-
- NDBGL4(L4_RBCHDBG, "unit %d, write", unit);
-
- CRIT_BEG;
- if(!(sc->sc_devstate & ST_ISOPEN))
- {
- NDBGL4(L4_RBCHDBG, "unit %d, write while not open", unit);
- CRIT_END;
- return(EIO);
- }
-
- if((sc->sc_devstate & ST_NOBLOCK))
- {
- if(!(sc->sc_devstate & ST_CONNECTED)) {
- CRIT_END;
- return(EWOULDBLOCK);
- }
- if(_IF_QFULL(isdn_linktab[unit]->tx_queue) && (sc->sc_devstate & ST_ISOPEN)) {
- CRIT_END;
- return(EWOULDBLOCK);
- }
- }
- else
- {
- while(!(sc->sc_devstate & ST_CONNECTED))
- {
- NDBGL4(L4_RBCHDBG, "unit %d, write wait init", unit);
-
- error = tsleep( &rbch_softc[unit],
- I4BPRI | PCATCH,
- "wrrbch", 0 );
- if(error == ERESTART) {
- CRIT_END;
- return (ERESTART);
- }
- else if(error == EINTR)
- {
- CRIT_END;
- NDBGL4(L4_RBCHDBG, "unit %d, EINTR during wait init", unit);
- return(EINTR);
- }
- else if(error)
- {
- CRIT_END;
- NDBGL4(L4_RBCHDBG, "unit %d, error %d tsleep init", unit, error);
- return(error);
- }
- tsleep( &rbch_softc[unit], I4BPRI | PCATCH, "xrbch", (hz*1));
- }
-
- while(_IF_QFULL(isdn_linktab[unit]->tx_queue) && (sc->sc_devstate & ST_ISOPEN))
- {
- sc->sc_devstate |= ST_WRWAITEMPTY;
-
- NDBGL4(L4_RBCHDBG, "unit %d, write queue full", unit);
-
- if ((error = tsleep( &isdn_linktab[unit]->tx_queue,
- I4BPRI | PCATCH,
- "wrbch", 0)) != 0) {
- sc->sc_devstate &= ~ST_WRWAITEMPTY;
- if(error == ERESTART)
- {
- CRIT_END;
- return(ERESTART);
- }
- else if(error == EINTR)
- {
- CRIT_END;
- NDBGL4(L4_RBCHDBG, "unit %d, EINTR during wait write", unit);
- return(error);
- }
- else if(error)
- {
- CRIT_END;
- NDBGL4(L4_RBCHDBG, "unit %d, error %d tsleep write", unit, error);
- return(error);
- }
- }
- }
- }
-
- if(!(sc->sc_devstate & ST_ISOPEN))
- {
- NDBGL4(L4_RBCHDBG, "unit %d, not open anymore", unit);
- CRIT_END;
- return(EIO);
- }
-
- if((m = i4b_Bgetmbuf(BCH_MAX_DATALEN)) != NULL)
- {
- m->m_len = min(BCH_MAX_DATALEN, uio->uio_resid);
-
- NDBGL4(L4_RBCHDBG, "unit %d, write %d bytes", unit, m->m_len);
-
- error = uiomove(m->m_data, m->m_len, uio);
-
- (void) IF_HANDOFF(isdn_linktab[unit]->tx_queue, m, NULL);
-
- (*isdn_linktab[unit]->bch_tx_start)(isdn_linktab[unit]->unit, isdn_linktab[unit]->channel);
- }
-
- CRIT_END;
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * rbch device ioctl handlibg
- *---------------------------------------------------------------------------*/
-static int
-i4brbchioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
-{
- int error = 0;
- int unit = minor(dev);
- struct rbch_softc *sc = &rbch_softc[unit];
-
- switch(cmd)
- {
- case FIOASYNC: /* Set async mode */
- if (*(int *)data)
- {
- NDBGL4(L4_RBCHDBG, "unit %d, setting async mode", unit);
- }
- else
- {
- NDBGL4(L4_RBCHDBG, "unit %d, clearing async mode", unit);
- }
- break;
-
- case FIONBIO:
- if (*(int *)data)
- {
- NDBGL4(L4_RBCHDBG, "unit %d, setting non-blocking mode", unit);
- sc->sc_devstate |= ST_NOBLOCK;
- }
- else
- {
- NDBGL4(L4_RBCHDBG, "unit %d, clearing non-blocking mode", unit);
- sc->sc_devstate &= ~ST_NOBLOCK;
- }
- break;
-
- case TIOCCDTR: /* Clear DTR */
- if(sc->sc_devstate & ST_CONNECTED)
- {
- NDBGL4(L4_RBCHDBG, "unit %d, disconnecting for DTR down", unit);
- i4b_l4_drvrdisc(BDRV_RBCH, unit);
- }
- break;
-
- case I4B_RBCH_DIALOUT:
- {
- size_t l;
-
- for (l = 0; l < TELNO_MAX && ((char *)data)[l]; l++)
- ;
- if (l)
- {
- NDBGL4(L4_RBCHDBG, "unit %d, attempting dialout to %s", unit, (char *)data);
- i4b_l4_dialoutnumber(BDRV_RBCH, unit, l, (char *)data);
- break;
- }
- /* FALLTHROUGH to SDTR */
- }
-
- case TIOCSDTR: /* Set DTR */
- NDBGL4(L4_RBCHDBG, "unit %d, attempting dialout (DTR)", unit);
- i4b_l4_dialout(BDRV_RBCH, unit);
- break;
-
- case TIOCSETA: /* Set termios struct */
- break;
-
- case TIOCGETA: /* Get termios struct */
- *(struct termios *)data = sc->it_in;
- break;
-
- case TIOCMGET:
- *(int *)data = TIOCM_LE|TIOCM_DTR|TIOCM_RTS|TIOCM_CTS|TIOCM_DSR;
- if (sc->sc_devstate & ST_CONNECTED)
- *(int *)data |= TIOCM_CD;
- break;
-
- case I4B_RBCH_VR_REQ:
- {
- msg_vr_req_t *mvr;
-
- mvr = (msg_vr_req_t *)data;
-
- mvr->version = VERSION;
- mvr->release = REL;
- mvr->step = STEP;
- break;
- }
-
- default: /* Unknown stuff */
- NDBGL4(L4_RBCHDBG, "unit %d, ioctl, unknown cmd %lx", unit, (u_long)cmd);
- error = EINVAL;
- break;
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * device driver poll
- *---------------------------------------------------------------------------*/
-static int
-i4brbchpoll(struct cdev *dev, int events, struct thread *td)
-{
- int revents = 0; /* Events we found */
- int s;
- int unit = minor(dev);
- struct rbch_softc *sc = &rbch_softc[unit];
-
- /* We can't check for anything but IN or OUT */
-
- s = splhigh();
-
- if(!(sc->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|POLLWRNORM)) &&
- (sc->sc_devstate & ST_CONNECTED) &&
- !_IF_QFULL(isdn_linktab[unit]->tx_queue))
- {
- revents |= (events & (POLLOUT|POLLWRNORM));
- }
-
- /* ... while reads are OK if we have any data */
-
- if((events & (POLLIN|POLLRDNORM)) &&
- (sc->sc_devstate & ST_CONNECTED))
- {
- struct ifqueue *iqp;
-
- if(sc->sc_bprot == BPROT_RHDLC)
- iqp = &sc->sc_hdlcq;
- else
- iqp = isdn_linktab[unit]->rx_queue;
-
- if(!IF_QEMPTY(iqp))
- revents |= (events & (POLLIN|POLLRDNORM));
- }
-
- if(revents == 0)
- selrecord(td, &sc->selp);
-
- splx(s);
- return(revents);
-}
-
-#if I4BRBCHACCT
-/*---------------------------------------------------------------------------*
- * watchdog routine
- *---------------------------------------------------------------------------*/
-static void
-rbch_timeout(struct rbch_softc *sc)
-{
- bchan_statistics_t bs;
- int unit = sc->sc_unit;
-
- /* 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)/I4BRBCHACCTINTVL;
- int ro = (sc->sc_ioutb - sc->sc_loutb)/I4BRBCHACCTINTVL;
-
- 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_RBCH, unit, ACCT_DURING,
- sc->sc_ioutb, sc->sc_iinb, ro, ri, sc->sc_ioutb, sc->sc_iinb);
- }
- START_TIMER(sc->sc_callout, rbch_timeout, sc, I4BRBCHACCTINTVL*hz);
-}
-#endif /* I4BRBCHACCT */
-
-/*===========================================================================*
- * 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;
- struct rbch_softc *sc = &rbch_softc[unit];
-
- sc->sc_bprot = cd->bprot;
-
-#if I4BRBCHACCT
- if(sc->sc_bprot == BPROT_RHDLC)
- {
- sc->sc_iinb = 0;
- sc->sc_ioutb = 0;
- sc->sc_linb = 0;
- sc->sc_loutb = 0;
-
- START_TIMER(sc->sc_callout, rbch_timeout, sc, I4BRBCHACCTINTVL*hz);
- }
-#endif
- if(!(sc->sc_devstate & ST_CONNECTED))
- {
- NDBGL4(L4_RBCHDBG, "unit %d, wakeup", unit);
- sc->sc_devstate |= ST_CONNECTED;
- sc->sc_cd = cdp;
- wakeup(sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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;
- struct rbch_softc *sc = &rbch_softc[unit];
-
- CRIT_VAR;
-
- if(cd != sc->sc_cd)
- {
- NDBGL4(L4_RBCHDBG, "rbch%d: channel %d not active",
- cd->driver_unit, cd->channelid);
- return;
- }
-
- CRIT_BEG;
-
- NDBGL4(L4_RBCHDBG, "unit %d, disconnect", unit);
-
- sc->sc_devstate &= ~ST_CONNECTED;
-
- sc->sc_cd = NULL;
-
-#if I4BRBCHACCT
- i4b_l4_accounting(BDRV_RBCH, unit, ACCT_FINAL,
- sc->sc_ioutb, sc->sc_iinb, 0, 0, sc->sc_ioutb, sc->sc_iinb);
-
- STOP_TIMER(sc->sc_callout, rbch_timeout, sc);
-#endif
- CRIT_END;
-}
-
-/*---------------------------------------------------------------------------*
- * feedback from daemon in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-rbch_dialresponse(int unit, int status, cause_t cause)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * 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_HANDOFF(&(rbch_softc[unit].sc_hdlcq), m, NULL))
- {
- NDBGL4(L4_RBCHDBG, "unit %d: hdlc rx queue full!", unit);
- }
- }
-
- if(rbch_softc[unit].sc_devstate & ST_RDWAITDATA)
- {
- NDBGL4(L4_RBCHDBG, "unit %d, wakeup", unit);
- rbch_softc[unit].sc_devstate &= ~ST_RDWAITDATA;
- wakeup( &isdn_linktab[unit]->rx_queue);
- }
- else
- {
- NDBGL4(L4_RBCHDBG, "unit %d, NO wakeup", unit);
- }
- selwakeuppri(&rbch_softc[unit].selp, I4BPRI);
-}
-
-/*---------------------------------------------------------------------------*
- * 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)
- {
- NDBGL4(L4_RBCHDBG, "unit %d, wakeup", unit);
- rbch_softc[unit].sc_devstate &= ~ST_WRWAITEMPTY;
- wakeup( &isdn_linktab[unit]->tx_queue);
- }
- else
- {
- NDBGL4(L4_RBCHDBG, "unit %d, NO wakeup", unit);
- }
- selwakeuppri(&rbch_softc[unit].selp, TTOPRI);
-}
-
-/*---------------------------------------------------------------------------*
- * 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].sc_cd)
- rbch_softc[unit].sc_cd->last_active_time = SECOND;
- selwakeuppri(&rbch_softc[unit].selp, I4BPRI);
-}
-
-/*---------------------------------------------------------------------------*
- * clear an hdlc rx queue for a rbch unit
- *---------------------------------------------------------------------------*/
-static void
-rbch_clrq(int unit)
-{
- CRIT_VAR;
-
- CRIT_BEG;
- IF_DRAIN(&rbch_softc[unit].sc_hdlcq);
- CRIT_END;
-}
-
-/*---------------------------------------------------------------------------*
- * 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;
-}
-
-/*===========================================================================*/
diff --git a/sys/i4b/driver/i4b_tel.c b/sys/i4b/driver/i4b_tel.c
deleted file mode 100644
index 6692fe3..0000000
--- a/sys/i4b/driver/i4b_tel.c
+++ /dev/null
@@ -1,1664 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------------
- * last edit-date: [Tue Aug 27 13:54:08 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#undef I4BTELDEBUG
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/ioccom.h>
-#include <sys/poll.h>
-#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/tty.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_tel_ioctl.h>
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-/* minor number: lower 6 bits = unit number */
-#define UNITBITS 6
-#define UNITMASK 0x3f
-#define UNIT(n) (minor(n) & UNITMASK)
-
-/* minor number: upper 2 bits = function number */
-
-#define FUNCMASK 0x03
-#define FUNC(n) (((minor(n)) >> UNITBITS) & FUNCMASK)
-
-#define FUNCTEL 0 /* 0 = normal i4btel device */
-#define FUNCDIAL 1 /* 1 = i4bteld dialout device */
-
-#define NOFUNCS 2 /* number of device classes */
-
-typedef struct {
-
- /* used only in func = FUNCTEL */
-
- drvr_link_t drvr_linktab; /* driver linktab */
- isdn_link_t *isdn_linktab; /* isdn linktab */
- int audiofmt; /* audio format conversion */
- u_char *rcvttab; /* conversion table on read */
- u_char *wcvttab; /* conversion table on write */
- call_desc_t *cdp; /* call descriptor pointer */
-
- /* used only in func = FUNCDIAL */
-
- char result; /* result code for dial dev */
-
- /* used in func = FUNCDIAL and func = FUNCTEL*/
-
- 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 */
-#define ST_TONE 0x10 /* tone generator */
-
- struct selinfo selp; /* select / poll */
-
- struct i4b_tel_tones tones;
- int toneidx;
- int toneomega;
- int tonefreq;
-
-} tel_sc_t;
-
-static tel_sc_t tel_sc[NI4BTEL][NOFUNCS];
-
-/* 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 void tel_tone(tel_sc_t *sc);
-
-/* audio format conversion tables */
-static unsigned char a2u_tab[];
-static unsigned char u2a_tab[];
-static unsigned char bitreverse[];
-static u_char sinetab[];
-
-static d_open_t i4btelopen;
-static d_close_t i4btelclose;
-static d_read_t i4btelread;
-static d_read_t i4btelwrite;
-static d_ioctl_t i4btelioctl;
-static d_poll_t i4btelpoll;
-
-
-static struct cdevsw i4btel_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
- .d_open = i4btelopen,
- .d_close = i4btelclose,
- .d_read = i4btelread,
- .d_write = i4btelwrite,
- .d_ioctl = i4btelioctl,
- .d_poll = i4btelpoll,
- .d_name = "i4btel",
-};
-
-static void i4btelattach(void *);
-
-PSEUDO_SET(i4btelattach, i4b_tel);
-
-/*===========================================================================*
- * DEVICE DRIVER ROUTINES
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4btelattach(void *dummy)
-{
- int i, j;
-
- printf("i4btel: %d ISDN telephony interface device(s) attached\n", NI4BTEL);
-
- for(i=0; i < NI4BTEL; i++)
- {
- for(j=0; j < NOFUNCS; j++)
- {
- tel_sc[i][j].devstate = ST_IDLE;
- tel_sc[i][j].audiofmt = CVT_NONE;
- tel_sc[i][j].rcvttab = 0;
- tel_sc[i][j].wcvttab = 0;
- tel_sc[i][j].result = 0;
-
- switch(j)
- {
- case FUNCTEL: /* normal i4btel device */
- make_dev(&i4btel_cdevsw, i,
- UID_ROOT, GID_WHEEL,
- 0600, "i4btel%d", i);
- break;
-
- case FUNCDIAL: /* i4bteld dialout device */
- make_dev(&i4btel_cdevsw, i+(1<<UNITBITS),
- UID_ROOT, GID_WHEEL,
- 0600, "i4bteld%d", i);
- break;
- }
- }
- tel_init_linktab(i);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * open tel device
- *---------------------------------------------------------------------------*/
-static int
-i4btelopen(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- int unit = UNIT(dev);
- int func = FUNC(dev);
-
- tel_sc_t *sc;
-
- if(unit >= NI4BTEL)
- return(ENXIO);
-
- sc = &tel_sc[unit][func];
-
- if(sc->devstate & ST_ISOPEN)
- return(EBUSY);
-
- sc->devstate |= ST_ISOPEN;
-
- if(func == FUNCDIAL)
- {
- sc->result = 0;
- }
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * close tel device
- *---------------------------------------------------------------------------*/
-static int
-i4btelclose(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- int unit = UNIT(dev);
- int func = FUNC(dev);
- tel_sc_t *sc;
- int error = 0;
- int x;
-
- if(unit > NI4BTEL)
- return(ENXIO);
-
- sc = &tel_sc[unit][func];
-
- x = splimp();
- sc->devstate &= ~ST_TONE;
-
- if((func == FUNCTEL) &&
- (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( &sc->isdn_linktab->tx_queue,
- I4BPRI | PCATCH, "wtcl", 0)) != 0)
- {
- break;
- }
- }
- sc->devstate &= ~ST_WRWAITEMPTY;
- }
-
- sc->devstate &= ~ST_ISOPEN;
- splx(x);
- wakeup( &sc->tones);
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * i4btelioctl - device driver ioctl routine
- *---------------------------------------------------------------------------*/
-static int
-i4btelioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
-{
- int unit = UNIT(dev);
- int func = FUNC(dev);
- int error = 0;
- struct mbuf *m;
- int s;
-
- tel_sc_t *sc = &tel_sc[unit][func];
-
- if(func == FUNCTEL)
- {
- switch(cmd)
- {
- case I4B_TEL_GETAUDIOFMT:
- *(int *)data = sc->audiofmt;
- break;
-
- case I4B_TEL_SETAUDIOFMT:
- switch (*(int *)data)
- {
- case CVT_NONE:
- sc->rcvttab = 0;
- sc->wcvttab = 0;
- break;
- case CVT_ALAW2ULAW:
- /* ISDN: a-law */
- /* user: u-law */
- sc->rcvttab = a2u_tab;
- sc->wcvttab = u2a_tab;
- break;
- case CVT_ULAW2ALAW:
- /* ISDN: u-law */
- /* user: a-law */
- sc->rcvttab = u2a_tab;
- sc->wcvttab = a2u_tab;
- break;
- default:
- error = ENODEV;
- break;
- }
- if(error == 0)
- 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;
-
- case I4B_TEL_VR_REQ:
- {
- msg_vr_req_t *mvr;
-
- mvr = (msg_vr_req_t *)data;
-
- mvr->version = VERSION;
- mvr->release = REL;
- mvr->step = STEP;
- break;
- }
- case I4B_TEL_TONES:
- {
- struct i4b_tel_tones *tt;
-
- tt = (struct i4b_tel_tones *)data;
- s = splimp();
- while ((sc->devstate & ST_TONE) &&
- sc->tones.duration[sc->toneidx] != 0) {
- if((error = tsleep( &sc->tones,
- I4BPRI | PCATCH, "rtone", 0 )) != 0) {
- splx(s);
- return(error);
- }
- }
- if(!(sc->devstate & ST_ISOPEN)) {
- splx(s);
- return (EIO);
- }
- if(!(sc->devstate & ST_CONNECTED)) {
- splx(s);
- return (EIO);
- }
-
- sc->tones = *tt;
- sc->toneidx = 0;
- sc->tonefreq = tt->frequency[0];
- sc->devstate |= ST_TONE;
- splx(s);
- tel_tone(sc);
- break;
- }
-
- default:
- error = ENOTTY;
- break;
- }
- }
- else if(func == FUNCDIAL)
- {
- switch(cmd)
- {
- default:
- error = ENOTTY;
- break;
- }
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * read from tel device
- *---------------------------------------------------------------------------*/
-static int
-i4btelread(struct cdev *dev, struct uio *uio, int ioflag)
-{
- int unit = UNIT(dev);
- int func = FUNC(dev);
-
- struct mbuf *m;
- int s;
- int error = 0;
-
- tel_sc_t *sc = &tel_sc[unit][func];
-
- if(!(sc->devstate & ST_ISOPEN))
- return(EIO);
-
- if(func == FUNCTEL)
- {
- s = splimp();
- IF_LOCK(sc->isdn_linktab->rx_queue);
-
- while((sc->devstate & ST_ISOPEN) &&
- (sc->devstate & ST_CONNECTED) &&
- IF_QEMPTY(sc->isdn_linktab->rx_queue))
- {
- sc->devstate |= ST_RDWAITDATA;
-
- NDBGL4(L4_TELDBG, "i4btel%d, queue empty!", unit);
-
- if((error = msleep( &sc->isdn_linktab->rx_queue,
- &sc->isdn_linktab->rx_queue->ifq_mtx,
- I4BPRI | PCATCH,
- "rtel", 0 )) != 0)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- IF_UNLOCK(sc->isdn_linktab->rx_queue);
- splx(s);
- return(error);
- }
- }
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- IF_UNLOCK(sc->isdn_linktab->rx_queue);
- splx(s);
- return(EIO);
- }
-
- if(!(sc->devstate & ST_CONNECTED))
- {
- IF_UNLOCK(sc->isdn_linktab->rx_queue);
- splx(s);
- return(EIO);
- }
-
-
- _IF_DEQUEUE(sc->isdn_linktab->rx_queue, m);
- IF_UNLOCK(sc->isdn_linktab->rx_queue);
-
- if(m && m->m_len > 0)
- {
- register int i;
-
- for(i = 0; i < m->m_len; i++)
- {
- /* always reverse bit order from line */
- mtod(m,u_char *)[i] = bitreverse[mtod(m,u_char *)[i]];
-
- /* convert if necessary */
- if(sc->rcvttab)
- mtod(m,u_char *)[i] = sc->rcvttab[mtod(m,u_char *)[i]];
- }
- error = uiomove(m->m_data, m->m_len, uio);
-
- NDBGL4(L4_TELDBG, "i4btel%d, mbuf (%d bytes), uiomove %d!", unit, m->m_len, error);
- }
- else
- {
- NDBGL4(L4_TELDBG, "i4btel%d, empty mbuf from queue!", unit);
- error = EIO;
- }
-
- if(m)
- i4b_Bfreembuf(m);
-
- splx(s);
- }
- else if(func == FUNCDIAL)
- {
- s = splimp();
- while((sc->result == 0) && (sc->devstate & ST_ISOPEN))
- {
- sc->devstate |= ST_RDWAITDATA;
-
- NDBGL4(L4_TELDBG, "i4btel%d, wait for result!", unit);
-
- if((error = tsleep( &sc->result,
- I4BPRI | PCATCH,
- "rtel1", 0 )) != 0)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- splx(s);
- NDBGL4(L4_TELDBG, "i4btel%d, wait for result: sleep error!", unit);
- return(error);
- }
- }
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- splx(s);
- NDBGL4(L4_TELDBG, "i4btel%d, wait for result: device closed!", unit);
- return(EIO);
- }
-
- if(sc->result != 0)
- {
- NDBGL4(L4_TELDBG, "i4btel%d, wait for result: 0x%02x!", unit, sc->result);
- error = uiomove(&sc->result, 1, uio);
- sc->result = 0;
- }
- else
- {
- NDBGL4(L4_TELDBG, "i4btel%d, wait for result: result=0!", unit);
- error = EIO;
- }
-
- splx(s);
- }
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- * write to tel device
- *---------------------------------------------------------------------------*/
-static int
-i4btelwrite(struct cdev *dev, struct uio * uio, int ioflag)
-{
- int unit = UNIT(dev);
- int func = FUNC(dev);
- struct mbuf *m;
- int s;
- int error = 0;
- tel_sc_t *sc = &tel_sc[unit][func];
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- return(EIO);
- }
-
- if(func == FUNCTEL)
- {
- s = splimp();
-
- if(!(sc->devstate & ST_CONNECTED)) {
- splx(s);
- return(EIO);
- }
-
- sc->devstate &= ~ST_TONE;
- IF_LOCK(sc->isdn_linktab->tx_queue);
- while((_IF_QFULL(sc->isdn_linktab->tx_queue)) &&
- (sc->devstate & ST_ISOPEN))
- {
- sc->devstate |= ST_WRWAITEMPTY;
-
- if((error = msleep( &sc->isdn_linktab->tx_queue,
- &sc->isdn_linktab->tx_queue->ifq_mtx,
- I4BPRI | PCATCH, "wtel", 0)) != 0)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- IF_UNLOCK(sc->isdn_linktab->tx_queue);
- splx(s);
- return(error);
- }
- }
- IF_UNLOCK(sc->isdn_linktab->tx_queue);
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- splx(s);
- return(EIO);
- }
-
- if(!(sc->devstate & ST_CONNECTED))
- {
- splx(s);
- return(EIO);
- }
-
- if((m = i4b_Bgetmbuf(BCH_MAX_DATALEN)) != NULL)
- {
- register int i;
-
- m->m_len = min(BCH_MAX_DATALEN, uio->uio_resid);
-
- error = uiomove(m->m_data, m->m_len, uio);
-
- for(i = 0; i < m->m_len; i++)
- {
- /* convert if necessary */
- if(sc->wcvttab)
- mtod(m,u_char *)[i] = sc->wcvttab[mtod(m,u_char *)[i]];
-
- /* always reverse bitorder to line */
- mtod(m,u_char *)[i] = bitreverse[mtod(m,u_char *)[i]];
- }
- (void) IF_HANDOFF(sc->isdn_linktab->tx_queue, m, NULL);
- (*sc->isdn_linktab->bch_tx_start)(sc->isdn_linktab->unit, sc->isdn_linktab->channel);
- }
-
- splx(s);
- }
- else if(func == FUNCDIAL)
- {
-#define CMDBUFSIZ 80
- char cmdbuf[CMDBUFSIZ];
- int len = min(CMDBUFSIZ-1, uio->uio_resid);
-
- error = uiomove(cmdbuf, len, uio);
-
- if(cmdbuf[0] == CMD_DIAL)
- {
- i4b_l4_dialoutnumber(BDRV_TEL, unit, len-1, &cmdbuf[1]);
- }
- else if(cmdbuf[0] == CMD_HUP)
- {
- i4b_l4_drvrdisc(BDRV_TEL, unit);
- }
- else if(cmdbuf[0] == CMD_KEYP)
- {
- i4b_l4_keypad(BDRV_TEL, unit, len-1, &cmdbuf[1]);
- }
- }
- else
- {
- error = EIO;
- }
-
- return(error);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-#define NTONESAMP 32
-static void
-tel_tone(tel_sc_t *sc)
-{
- struct mbuf *m;
- u_char *p;
- int i;
-
- if((m = i4b_Bgetmbuf(NTONESAMP)) == NULL) {
- printf("no mbuf in tel_tone\n");
- return;
- }
- p = m->m_data;
- m->m_len = 0;
- for (i = 0; i < NTONESAMP && (sc->devstate & ST_TONE); i++) {
-
- if (sc->tones.duration[sc->toneidx] > 0) {
- if (--sc->tones.duration[sc->toneidx] == 0) {
- sc->toneidx++;
- if (sc->toneidx == I4B_TEL_MAXTONES) {
- sc->devstate &= ~ST_TONE;
- sc->toneomega = 0;
- sc->tonefreq = 0;
- } else if (sc->tones.frequency[sc->toneidx] == 0 &&
- sc->tones.duration[sc->toneidx] == 0) {
- sc->devstate &= ~ST_TONE;
- sc->toneomega = 0;
- sc->tonefreq = 0;
- } else {
- sc->tonefreq = sc->tones.frequency[sc->toneidx];
- }
- if (sc->tones.duration[sc->toneidx] == 0) {
- wakeup( &sc->tones);
- }
- }
- }
-
- sc->toneomega += sc->tonefreq;
- if (sc->toneomega >= 8000)
- sc->toneomega -= 8000;
- *p++ = bitreverse[sinetab[sc->toneomega]];
- m->m_len++;
- }
- IF_ENQUEUE(sc->isdn_linktab->tx_queue, m);
- (*sc->isdn_linktab->bch_tx_start)(sc->isdn_linktab->unit, sc->isdn_linktab->channel);
-}
-
-/*---------------------------------------------------------------------------*
- * device driver poll
- *---------------------------------------------------------------------------*/
-static int
-i4btelpoll(struct cdev *dev, int events, struct thread *td)
-{
- int revents = 0; /* Events we found */
- int s;
- int unit = UNIT(dev);
- int func = FUNC(dev);
-
- tel_sc_t *sc = &tel_sc[unit][func];
-
- s = splhigh();
-
- if(!(sc->devstate & ST_ISOPEN))
- {
- NDBGL4(L4_TELDBG, "i4btel%d, !ST_ISOPEN", unit);
- splx(s);
- return(0);
- }
-
- if(func == FUNCTEL)
- {
- /*
- * Writes are OK if we are connected and the
- * transmit queue can take them
- */
-
- if((events & (POLLOUT|POLLWRNORM)) &&
- (sc->devstate & ST_CONNECTED) &&
- (sc->isdn_linktab != NULL) &&
- (!_IF_QFULL(sc->isdn_linktab->tx_queue)))
- {
- NDBGL4(L4_TELDBG, "i4btel%d, POLLOUT", unit);
- revents |= (events & (POLLOUT|POLLWRNORM));
- }
-
- /* ... while reads are OK if we have any data */
-
- if((events & (POLLIN|POLLRDNORM)) &&
- (sc->devstate & ST_CONNECTED) &&
- (sc->isdn_linktab != NULL) &&
- (!IF_QEMPTY(sc->isdn_linktab->rx_queue)))
- {
- NDBGL4(L4_TELDBG, "i4btel%d, POLLIN", unit);
- revents |= (events & (POLLIN|POLLRDNORM));
- }
-
- if(revents == 0)
- {
- NDBGL4(L4_TELDBG, "i4btel%d, selrecord", unit);
- selrecord(td, &sc->selp);
- }
- }
- else if(func == FUNCDIAL)
- {
- if(events & (POLLOUT|POLLWRNORM))
- {
- NDBGL4(L4_TELDBG, "i4bteld%d, POLLOUT", unit);
- revents |= (events & (POLLOUT|POLLWRNORM));
- }
-
- if(events & (POLLIN|POLLRDNORM))
- {
- NDBGL4(L4_TELDBG, "i4bteld%d, POLLIN, result = %d", unit, sc->result);
- if(sc->result != 0)
- revents |= (events & (POLLIN|POLLRDNORM));
- }
-
- if(revents == 0)
- {
- NDBGL4(L4_TELDBG, "i4bteld%d, selrecord", unit);
- selrecord(td, &sc->selp);
- }
- }
- splx(s);
- return(revents);
-}
-
-/*===========================================================================*
- * 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][FUNCTEL];
-
- /* audio device */
-
- sc->cdp = (call_desc_t *)cdp;
-
- sc->devstate |= ST_CONNECTED;
-
- /* dialer device */
-
- sc = &tel_sc[unit][FUNCDIAL];
-
- if(sc->devstate & ST_ISOPEN)
- {
- NDBGL4(L4_TELDBG, "i4btel%d, tel_connect!", unit);
- sc->result = RSP_CONN;
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup( &sc->result);
- }
- selwakeuppri(&sc->selp, I4BPRI);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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][FUNCTEL];
-
- /* audio device */
-
- sc->devstate &= ~ST_CONNECTED;
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup( &sc->isdn_linktab->rx_queue);
- }
-
- if(sc->devstate & ST_WRWAITEMPTY)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- wakeup( &sc->isdn_linktab->tx_queue);
- }
-
- /* dialer device */
-
- sc = &tel_sc[unit][FUNCDIAL];
-
- if(sc->devstate & ST_ISOPEN)
- {
- NDBGL4(L4_TELDBG, "i4btel%d, tel_disconnect!", unit);
- sc->result = RSP_HUP;
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup( &sc->result);
- }
- selwakeuppri(&sc->selp, I4BPRI);
-
- if (sc->devstate & ST_TONE) {
- sc->devstate &= ~ST_TONE;
- wakeup( &sc->tones);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * feedback from daemon in case of dial problems
- *---------------------------------------------------------------------------*/
-static void
-tel_dialresponse(int unit, int status, cause_t cause)
-{
- tel_sc_t *sc = &tel_sc[unit][FUNCDIAL];
-
- NDBGL4(L4_TELDBG, "i4btel%d, status=%d, cause=0x%4x", unit, status, cause);
-
- if((sc->devstate == ST_ISOPEN) && status)
- {
- NDBGL4(L4_TELDBG, "i4btel%d, tel_dialresponse!", unit);
- sc->result = RSP_NOA;
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup( &sc->result);
- }
- selwakeuppri(&sc->selp, I4BPRI);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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][FUNCTEL];
-
- if(sc->devstate & ST_RDWAITDATA)
- {
- sc->devstate &= ~ST_RDWAITDATA;
- wakeup( &sc->isdn_linktab->rx_queue);
- }
- selwakeuppri(&sc->selp, TTOPRI);
-}
-
-/*---------------------------------------------------------------------------*
- * 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][FUNCTEL];
-
- if(sc->devstate & ST_WRWAITEMPTY)
- {
- sc->devstate &= ~ST_WRWAITEMPTY;
- wakeup( &sc->isdn_linktab->tx_queue);
- }
- if(sc->devstate & ST_TONE) {
- tel_tone(sc);
- } else {
- selwakeuppri(&sc->selp, I4BPRI);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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)
-{
- if(tel_sc[unit][FUNCTEL].cdp)
- tel_sc[unit][FUNCTEL].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][FUNCTEL];
-
- 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][FUNCTEL];
- sc->isdn_linktab = ilt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize this drivers linktab
- *---------------------------------------------------------------------------*/
-static void
-tel_init_linktab(int unit)
-{
- tel_sc_t *sc = &tel_sc[unit][FUNCTEL];
-
- 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 (produced by running g711conv)
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * A-law to u-law conversion
- *---------------------------------------------------------------------------*/
-static unsigned char a2u_tab[256] = {
-/* 00 */ 0x2a, 0x2b, 0x28, 0x29, 0x2e, 0x2f, 0x2c, 0x2d,
-/* 08 */ 0x22, 0x23, 0x20, 0x21, 0x26, 0x27, 0x24, 0x25,
-/* 10 */ 0x39, 0x3a, 0x37, 0x38, 0x3d, 0x3e, 0x3b, 0x3c,
-/* 18 */ 0x31, 0x32, 0x30, 0x30, 0x35, 0x36, 0x33, 0x34,
-/* 20 */ 0x0a, 0x0b, 0x08, 0x09, 0x0e, 0x0f, 0x0c, 0x0d,
-/* 28 */ 0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
-/* 30 */ 0x1a, 0x1b, 0x18, 0x19, 0x1e, 0x1f, 0x1c, 0x1d,
-/* 38 */ 0x12, 0x13, 0x10, 0x11, 0x16, 0x17, 0x14, 0x15,
-/* 40 */ 0x62, 0x63, 0x60, 0x61, 0x66, 0x67, 0x64, 0x65,
-/* 48 */ 0x5d, 0x5d, 0x5c, 0x5c, 0x5f, 0x5f, 0x5e, 0x5e,
-/* 50 */ 0x74, 0x76, 0x70, 0x72, 0x7c, 0x7e, 0x78, 0x7a,
-/* 58 */ 0x6a, 0x6b, 0x68, 0x69, 0x6e, 0x6f, 0x6c, 0x6d,
-/* 60 */ 0x48, 0x49, 0x46, 0x47, 0x4c, 0x4d, 0x4a, 0x4b,
-/* 68 */ 0x40, 0x41, 0x3f, 0x3f, 0x44, 0x45, 0x42, 0x43,
-/* 70 */ 0x56, 0x57, 0x54, 0x55, 0x5a, 0x5b, 0x58, 0x59,
-/* 78 */ 0x4f, 0x4f, 0x4e, 0x4e, 0x52, 0x53, 0x50, 0x51,
-/* 80 */ 0xaa, 0xab, 0xa8, 0xa9, 0xae, 0xaf, 0xac, 0xad,
-/* 88 */ 0xa2, 0xa3, 0xa0, 0xa1, 0xa6, 0xa7, 0xa4, 0xa5,
-/* 90 */ 0xb9, 0xba, 0xb7, 0xb8, 0xbd, 0xbe, 0xbb, 0xbc,
-/* 98 */ 0xb1, 0xb2, 0xb0, 0xb0, 0xb5, 0xb6, 0xb3, 0xb4,
-/* a0 */ 0x8a, 0x8b, 0x88, 0x89, 0x8e, 0x8f, 0x8c, 0x8d,
-/* a8 */ 0x82, 0x83, 0x80, 0x81, 0x86, 0x87, 0x84, 0x85,
-/* b0 */ 0x9a, 0x9b, 0x98, 0x99, 0x9e, 0x9f, 0x9c, 0x9d,
-/* b8 */ 0x92, 0x93, 0x90, 0x91, 0x96, 0x97, 0x94, 0x95,
-/* c0 */ 0xe2, 0xe3, 0xe0, 0xe1, 0xe6, 0xe7, 0xe4, 0xe5,
-/* c8 */ 0xdd, 0xdd, 0xdc, 0xdc, 0xdf, 0xdf, 0xde, 0xde,
-/* d0 */ 0xf4, 0xf6, 0xf0, 0xf2, 0xfc, 0xfe, 0xf8, 0xfa,
-/* d8 */ 0xea, 0xeb, 0xe8, 0xe9, 0xee, 0xef, 0xec, 0xed,
-/* e0 */ 0xc8, 0xc9, 0xc6, 0xc7, 0xcc, 0xcd, 0xca, 0xcb,
-/* e8 */ 0xc0, 0xc1, 0xbf, 0xbf, 0xc4, 0xc5, 0xc2, 0xc3,
-/* f0 */ 0xd6, 0xd7, 0xd4, 0xd5, 0xda, 0xdb, 0xd8, 0xd9,
-/* f8 */ 0xcf, 0xcf, 0xce, 0xce, 0xd2, 0xd3, 0xd0, 0xd1
-};
-
-/*---------------------------------------------------------------------------*
- * u-law to A-law conversion
- *---------------------------------------------------------------------------*/
-static unsigned char u2a_tab[256] = {
-/* 00 */ 0x2a, 0x2b, 0x28, 0x29, 0x2e, 0x2f, 0x2c, 0x2d,
-/* 08 */ 0x22, 0x23, 0x20, 0x21, 0x26, 0x27, 0x24, 0x25,
-/* 10 */ 0x3a, 0x3b, 0x38, 0x39, 0x3e, 0x3f, 0x3c, 0x3d,
-/* 18 */ 0x32, 0x33, 0x30, 0x31, 0x36, 0x37, 0x34, 0x35,
-/* 20 */ 0x0a, 0x0b, 0x08, 0x09, 0x0e, 0x0f, 0x0c, 0x0d,
-/* 28 */ 0x02, 0x03, 0x00, 0x01, 0x06, 0x07, 0x04, 0x05,
-/* 30 */ 0x1b, 0x18, 0x19, 0x1e, 0x1f, 0x1c, 0x1d, 0x12,
-/* 38 */ 0x13, 0x10, 0x11, 0x16, 0x17, 0x14, 0x15, 0x6a,
-/* 40 */ 0x68, 0x69, 0x6e, 0x6f, 0x6c, 0x6d, 0x62, 0x63,
-/* 48 */ 0x60, 0x61, 0x66, 0x67, 0x64, 0x65, 0x7a, 0x78,
-/* 50 */ 0x7e, 0x7f, 0x7c, 0x7d, 0x72, 0x73, 0x70, 0x71,
-/* 58 */ 0x76, 0x77, 0x74, 0x75, 0x4b, 0x49, 0x4f, 0x4d,
-/* 60 */ 0x42, 0x43, 0x40, 0x41, 0x46, 0x47, 0x44, 0x45,
-/* 68 */ 0x5a, 0x5b, 0x58, 0x59, 0x5e, 0x5f, 0x5c, 0x5d,
-/* 70 */ 0x52, 0x52, 0x53, 0x53, 0x50, 0x50, 0x51, 0x51,
-/* 78 */ 0x56, 0x56, 0x57, 0x57, 0x54, 0x54, 0x55, 0x55,
-/* 80 */ 0xaa, 0xab, 0xa8, 0xa9, 0xae, 0xaf, 0xac, 0xad,
-/* 88 */ 0xa2, 0xa3, 0xa0, 0xa1, 0xa6, 0xa7, 0xa4, 0xa5,
-/* 90 */ 0xba, 0xbb, 0xb8, 0xb9, 0xbe, 0xbf, 0xbc, 0xbd,
-/* 98 */ 0xb2, 0xb3, 0xb0, 0xb1, 0xb6, 0xb7, 0xb4, 0xb5,
-/* a0 */ 0x8a, 0x8b, 0x88, 0x89, 0x8e, 0x8f, 0x8c, 0x8d,
-/* a8 */ 0x82, 0x83, 0x80, 0x81, 0x86, 0x87, 0x84, 0x85,
-/* b0 */ 0x9b, 0x98, 0x99, 0x9e, 0x9f, 0x9c, 0x9d, 0x92,
-/* b8 */ 0x93, 0x90, 0x91, 0x96, 0x97, 0x94, 0x95, 0xea,
-/* c0 */ 0xe8, 0xe9, 0xee, 0xef, 0xec, 0xed, 0xe2, 0xe3,
-/* c8 */ 0xe0, 0xe1, 0xe6, 0xe7, 0xe4, 0xe5, 0xfa, 0xf8,
-/* d0 */ 0xfe, 0xff, 0xfc, 0xfd, 0xf2, 0xf3, 0xf0, 0xf1,
-/* d8 */ 0xf6, 0xf7, 0xf4, 0xf5, 0xcb, 0xc9, 0xcf, 0xcd,
-/* e0 */ 0xc2, 0xc3, 0xc0, 0xc1, 0xc6, 0xc7, 0xc4, 0xc5,
-/* e8 */ 0xda, 0xdb, 0xd8, 0xd9, 0xde, 0xdf, 0xdc, 0xdd,
-/* f0 */ 0xd2, 0xd2, 0xd3, 0xd3, 0xd0, 0xd0, 0xd1, 0xd1,
-/* f8 */ 0xd6, 0xd6, 0xd7, 0xd7, 0xd4, 0xd4, 0xd5, 0xd5
-};
-
-/*---------------------------------------------------------------------------*
- * reverse bits in a byte
- *---------------------------------------------------------------------------*/
-static unsigned char bitreverse[256] = {
-/* 00 */ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
-/* 08 */ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
-/* 10 */ 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
-/* 18 */ 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
-/* 20 */ 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
-/* 28 */ 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
-/* 30 */ 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
-/* 38 */ 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
-/* 40 */ 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
-/* 48 */ 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
-/* 50 */ 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
-/* 58 */ 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
-/* 60 */ 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
-/* 68 */ 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
-/* 70 */ 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
-/* 78 */ 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
-/* 80 */ 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
-/* 88 */ 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
-/* 90 */ 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
-/* 98 */ 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
-/* a0 */ 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
-/* a8 */ 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
-/* b0 */ 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
-/* b8 */ 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
-/* c0 */ 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
-/* c8 */ 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
-/* d0 */ 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
-/* d8 */ 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
-/* e0 */ 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
-/* e8 */ 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
-/* f0 */ 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
-/* f8 */ 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-static u_char sinetab[8000] = { 213, 213, 213, 213, 213, 213, 213, 212,
-212, 212, 212, 212, 212, 215, 215, 215, 215, 215, 215, 214, 214,
-214, 214, 214, 214, 209, 209, 209, 209, 209, 209, 209, 208, 208,
-208, 208, 208, 208, 211, 211, 211, 211, 211, 211, 210, 210, 210,
-210, 210, 210, 221, 221, 221, 221, 221, 221, 220, 220, 220, 220,
-220, 220, 220, 223, 223, 223, 223, 223, 223, 222, 222, 222, 222,
-222, 222, 217, 217, 217, 217, 217, 217, 216, 216, 216, 216, 216,
-216, 216, 219, 219, 219, 219, 219, 219, 218, 218, 218, 218, 218,
-218, 197, 197, 197, 197, 197, 197, 196, 196, 196, 196, 196, 196,
-196, 199, 199, 199, 199, 199, 199, 198, 198, 198, 198, 198, 198,
-193, 193, 193, 193, 193, 193, 192, 192, 192, 192, 192, 192, 192,
-195, 195, 195, 195, 195, 195, 194, 194, 194, 194, 194, 194, 205,
-205, 205, 205, 205, 205, 204, 204, 204, 204, 204, 204, 204, 207,
-207, 207, 207, 207, 207, 206, 206, 206, 206, 206, 206, 201, 201,
-201, 201, 201, 201, 200, 200, 200, 200, 200, 200, 200, 203, 203,
-203, 203, 203, 203, 202, 202, 202, 202, 202, 202, 245, 245, 245,
-245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 244, 244, 244,
-244, 244, 244, 244, 244, 244, 244, 244, 244, 247, 247, 247, 247,
-247, 247, 247, 247, 247, 247, 247, 247, 247, 246, 246, 246, 246,
-246, 246, 246, 246, 246, 246, 246, 246, 246, 241, 241, 241, 241,
-241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 240, 240, 240,
-240, 240, 240, 240, 240, 240, 240, 240, 243, 243, 243, 243, 243,
-243, 243, 243, 243, 243, 243, 243, 243, 242, 242, 242, 242, 242,
-242, 242, 242, 242, 242, 242, 242, 242, 253, 253, 253, 253, 253,
-253, 253, 253, 253, 253, 253, 253, 253, 252, 252, 252, 252, 252,
-252, 252, 252, 252, 252, 252, 252, 255, 255, 255, 255, 255, 255,
-255, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254, 254, 254,
-254, 254, 254, 254, 254, 254, 254, 249, 249, 249, 249, 249, 249,
-249, 249, 249, 249, 249, 249, 249, 248, 248, 248, 248, 248, 248,
-248, 248, 248, 248, 248, 248, 248, 251, 251, 251, 251, 251, 251,
-251, 251, 251, 251, 251, 251, 251, 250, 250, 250, 250, 250, 250,
-250, 250, 250, 250, 250, 250, 250, 229, 229, 229, 229, 229, 229,
-229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
-229, 229, 229, 229, 229, 229, 229, 228, 228, 228, 228, 228, 228,
-228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
-228, 228, 228, 228, 228, 228, 228, 228, 231, 231, 231, 231, 231,
-231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
-231, 231, 231, 231, 231, 231, 231, 231, 231, 230, 230, 230, 230,
-230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
-230, 230, 230, 230, 230, 230, 230, 230, 230, 225, 225, 225, 225,
-225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
-225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 224, 224,
-224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
-224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 227,
-227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
-227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
-227, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
-226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
-226, 226, 226, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
-237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
-237, 237, 237, 237, 237, 236, 236, 236, 236, 236, 236, 236, 236,
-236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
-236, 236, 236, 236, 236, 236, 236, 236, 239, 239, 239, 239, 239,
-239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
-239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 238, 238,
-238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
-238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
-238, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
-233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
-233, 233, 233, 233, 233, 232, 232, 232, 232, 232, 232, 232, 232,
-232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
-232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 235, 235, 235,
-235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
-235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
-235, 235, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
-234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
-234, 234, 234, 234, 234, 234, 234, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-156, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-157, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
-146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
-147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
-144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
-145, 145, 145, 145, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
-150, 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
-151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,
-234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
-234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
-234, 234, 234, 234, 234, 235, 235, 235, 235, 235, 235, 235, 235,
-235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
-235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 232, 232, 232,
-232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
-232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
-232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
-233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
-233, 233, 233, 233, 233, 233, 238, 238, 238, 238, 238, 238, 238,
-238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
-238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239, 239, 239,
-239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
-239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 236,
-236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
-236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
-236, 236, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
-237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
-237, 237, 237, 237, 226, 226, 226, 226, 226, 226, 226, 226, 226,
-226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
-226, 226, 226, 226, 226, 226, 227, 227, 227, 227, 227, 227, 227,
-227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
-227, 227, 227, 227, 227, 227, 227, 227, 224, 224, 224, 224, 224,
-224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
-224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225,
-225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
-225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 230, 230,
-230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
-230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 231,
-231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
-231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 228,
-228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
-228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
-229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
-229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
-250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
-251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
-248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
-249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
-254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
-255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 253,
-253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 242,
-242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 243,
-243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 240,
-240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241,
-241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 246, 246,
-246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 247,
-247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 244, 244,
-244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 245, 245, 245,
-245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 202, 202, 202,
-202, 202, 202, 203, 203, 203, 203, 203, 203, 200, 200, 200, 200,
-200, 200, 200, 201, 201, 201, 201, 201, 201, 206, 206, 206, 206,
-206, 206, 207, 207, 207, 207, 207, 207, 204, 204, 204, 204, 204,
-204, 204, 205, 205, 205, 205, 205, 205, 194, 194, 194, 194, 194,
-194, 195, 195, 195, 195, 195, 195, 192, 192, 192, 192, 192, 192,
-192, 193, 193, 193, 193, 193, 193, 198, 198, 198, 198, 198, 198,
-199, 199, 199, 199, 199, 199, 196, 196, 196, 196, 196, 196, 196,
-197, 197, 197, 197, 197, 197, 218, 218, 218, 218, 218, 218, 219,
-219, 219, 219, 219, 219, 216, 216, 216, 216, 216, 216, 216, 217,
-217, 217, 217, 217, 217, 222, 222, 222, 222, 222, 222, 223, 223,
-223, 223, 223, 223, 220, 220, 220, 220, 220, 220, 220, 221, 221,
-221, 221, 221, 221, 210, 210, 210, 210, 210, 210, 211, 211, 211,
-211, 211, 211, 208, 208, 208, 208, 208, 208, 209, 209, 209, 209,
-209, 209, 209, 214, 214, 214, 214, 214, 214, 215, 215, 215, 215,
-215, 215, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213,
-213, 213, 90, 90, 90, 85, 85, 85, 85, 85, 85, 84, 84, 84, 84, 84,
-84, 87, 87, 87, 87, 87, 87, 86, 86, 86, 86, 86, 86, 81, 81, 81,
-81, 81, 81, 81, 80, 80, 80, 80, 80, 80, 83, 83, 83, 83, 83, 83,
-82, 82, 82, 82, 82, 82, 93, 93, 93, 93, 93, 93, 93, 92, 92, 92,
-92, 92, 92, 95, 95, 95, 95, 95, 95, 94, 94, 94, 94, 94, 94, 89,
-89, 89, 89, 89, 89, 88, 88, 88, 88, 88, 88, 88, 91, 91, 91, 91,
-91, 91, 90, 90, 90, 90, 90, 90, 69, 69, 69, 69, 69, 69, 68, 68,
-68, 68, 68, 68, 68, 71, 71, 71, 71, 71, 71, 70, 70, 70, 70, 70,
-70, 65, 65, 65, 65, 65, 65, 64, 64, 64, 64, 64, 64, 64, 67, 67,
-67, 67, 67, 67, 66, 66, 66, 66, 66, 66, 77, 77, 77, 77, 77, 77,
-76, 76, 76, 76, 76, 76, 76, 79, 79, 79, 79, 79, 79, 78, 78, 78,
-78, 78, 78, 73, 73, 73, 73, 73, 73, 73, 72, 72, 72, 72, 72, 72,
-75, 75, 75, 75, 75, 75, 74, 74, 74, 74, 74, 74, 117, 117, 117, 117,
-117, 117, 117, 117, 117, 117, 117, 117, 117, 116, 116, 116, 116,
-116, 116, 116, 116, 116, 116, 116, 116, 116, 119, 119, 119, 119,
-119, 119, 119, 119, 119, 119, 119, 119, 118, 118, 118, 118, 118,
-118, 118, 118, 118, 118, 118, 118, 118, 113, 113, 113, 113, 113,
-113, 113, 113, 113, 113, 113, 113, 113, 112, 112, 112, 112, 112,
-112, 112, 112, 112, 112, 112, 112, 115, 115, 115, 115, 115, 115,
-115, 115, 115, 115, 115, 115, 115, 114, 114, 114, 114, 114, 114,
-114, 114, 114, 114, 114, 114, 114, 125, 125, 125, 125, 125, 125,
-125, 125, 125, 125, 125, 125, 125, 124, 124, 124, 124, 124, 124,
-124, 124, 124, 124, 124, 124, 124, 127, 127, 127, 127, 127, 127,
-127, 127, 127, 127, 127, 127, 126, 126, 126, 126, 126, 126, 126,
-126, 126, 126, 126, 126, 126, 121, 121, 121, 121, 121, 121, 121,
-121, 121, 121, 121, 121, 121, 120, 120, 120, 120, 120, 120, 120,
-120, 120, 120, 120, 120, 120, 123, 123, 123, 123, 123, 123, 123,
-123, 123, 123, 123, 123, 123, 122, 122, 122, 122, 122, 122, 122,
-122, 122, 122, 122, 122, 122, 101, 101, 101, 101, 101, 101, 101,
-101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
-101, 101, 101, 101, 101, 101, 101, 100, 100, 100, 100, 100, 100,
-100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
-100, 100, 100, 100, 100, 100, 100, 103, 103, 103, 103, 103, 103,
-103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
-103, 103, 103, 103, 103, 103, 103, 103, 102, 102, 102, 102, 102,
-102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
-102, 102, 102, 102, 102, 102, 102, 102, 102, 97, 97, 97, 97, 97,
-97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
-97, 97, 97, 97, 97, 97, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
-96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
-96, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
-99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 98, 98, 98,
-98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
-98, 98, 98, 98, 98, 98, 98, 98, 98, 109, 109, 109, 109, 109, 109,
-109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
-109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 108, 108, 108,
-108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
-108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 111,
-111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
-111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
-111, 111, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
-110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
-110, 110, 110, 110, 110, 110, 105, 105, 105, 105, 105, 105, 105,
-105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
-105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 104, 104, 104,
-104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
-104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
-104, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
-107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
-107, 107, 107, 107, 107, 107, 106, 106, 106, 106, 106, 106, 106,
-106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 21,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
-20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-20, 20, 20, 20, 20, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
-18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
-19, 19, 19, 19, 19, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
-16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
-17, 17, 17, 17, 17, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
-22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 20, 20, 20, 20, 20, 20,
-20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
-106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107,
-107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
-107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 104, 104,
-104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
-104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
-104, 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
-105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
-105, 105, 105, 105, 105, 105, 110, 110, 110, 110, 110, 110, 110,
-110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
-110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 111, 111, 111,
-111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
-111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
-108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
-108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
-108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
-109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
-109, 109, 109, 109, 109, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
-98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
-98, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
-99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 96, 96,
-96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
-96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97,
-97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
-97, 97, 97, 97, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
-102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
-102, 102, 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, 103,
-103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
-103, 103, 103, 103, 103, 100, 100, 100, 100, 100, 100, 100, 100,
-100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
-100, 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, 101,
-101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
-101, 101, 101, 101, 101, 101, 122, 122, 122, 122, 122, 122, 122,
-122, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123,
-123, 123, 123, 123, 123, 123, 120, 120, 120, 120, 120, 120, 120,
-120, 120, 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 121,
-121, 121, 121, 121, 121, 121, 126, 126, 126, 126, 126, 126, 126,
-126, 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, 127,
-127, 127, 127, 127, 127, 124, 124, 124, 124, 124, 124, 124, 124,
-124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 125,
-125, 125, 125, 125, 125, 114, 114, 114, 114, 114, 114, 114, 114,
-114, 114, 114, 114, 114, 115, 115, 115, 115, 115, 115, 115, 115,
-115, 115, 115, 115, 115, 112, 112, 112, 112, 112, 112, 112, 112,
-112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 113, 113, 113,
-113, 113, 113, 113, 118, 118, 118, 118, 118, 118, 118, 118, 118,
-118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119,
-119, 119, 119, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
-116, 116, 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
-117, 117, 117, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 72,
-72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 78, 78, 78, 78,
-78, 78, 79, 79, 79, 79, 79, 79, 76, 76, 76, 76, 76, 76, 76, 77,
-77, 77, 77, 77, 77, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67,
-67, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 70, 70,
-70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 68, 68, 68, 68, 68, 68,
-68, 69, 69, 69, 69, 69, 69, 90, 90, 90, 90, 90, 90, 91, 91, 91,
-91, 91, 91, 88, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 89,
-94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 92, 92, 92, 92,
-92, 92, 93, 93, 93, 93, 93, 93, 93, 82, 82, 82, 82, 82, 82, 83,
-83, 83, 83, 83, 83, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81,
-81, 81, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 84, 84,
-84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 90, 90, 90 };
-
-/*===========================================================================*/
diff --git a/sys/i4b/driver/i4b_trace.c b/sys/i4b/driver/i4b_trace.c
deleted file mode 100644
index 80f9b6e..0000000
--- a/sys/i4b/driver/i4b_trace.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ---------------------------------------------------
- * last edit-date: [Sun Mar 17 09:52:51 2002]
- *
- * NOTE: the code assumes that SPLI4B >= splimp !
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/ioccom.h>
-#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/tty.h>
-
-#include <i4b/include/i4b_trace.h>
-#include <i4b/include/i4b_ioctl.h>
-
-#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
-
-static int analyzemode = 0;
-static int rxunit = -1;
-static int txunit = -1;
-static int outunit = -1;
-
-static d_open_t i4btrcopen;
-static d_close_t i4btrcclose;
-static d_read_t i4btrcread;
-static d_ioctl_t i4btrcioctl;
-static d_poll_t i4btrcpoll;
-
-
-static struct cdevsw i4btrc_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
- .d_open = i4btrcopen,
- .d_close = i4btrcclose,
- .d_read = i4btrcread,
- .d_ioctl = i4btrcioctl,
- .d_poll = i4btrcpoll,
- .d_name = "i4btrc",
-};
-
-static void i4btrcattach(void *);
-PSEUDO_SET(i4btrcattach, i4b_trace);
-
-int get_trace_data_from_l1(i4b_trace_hdr_t *hdr, int len, char *buf);
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4btrcattach(void *dummy)
-{
- int i;
-
- printf("i4btrc: %d ISDN trace device(s) attached\n", NI4BTRC);
-
- for(i=0; i < NI4BTRC; i++)
- {
- make_dev(&i4btrc_cdevsw, i,
- UID_ROOT, GID_WHEEL, 0600, "i4btrc%d", i);
- trace_queue[i].ifq_maxlen = IFQ_MAXLEN;
-
- if(!mtx_initialized(&trace_queue[i].ifq_mtx))
- mtx_init(&trace_queue[i].ifq_mtx, "i4b_trace", NULL, MTX_DEF);
-
- 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_LOCK(&trace_queue[unit]);
-
- 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_UNLOCK(&trace_queue[unit]);
-
- if(device_state[unit] & ST_WAITDATA)
- {
- device_state[unit] &= ~ST_WAITDATA;
- wakeup( &trace_queue[unit]);
- }
-
- splx(x);
-
- return(1);
-}
-
-/*---------------------------------------------------------------------------*
- * open trace device
- *---------------------------------------------------------------------------*/
-static int
-i4btrcopen(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- 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
- *---------------------------------------------------------------------------*/
-static int
-i4btrcclose(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- int unit = minor(dev);
- int i, x;
- int cno = -1;
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- cno = i;
- break;
- }
- }
-
- if(analyzemode && (unit == outunit))
- {
- analyzemode = 0;
- outunit = -1;
-
- if(cno >= 0)
- {
- (*ctrl_desc[cno].N_MGMT_COMMAND)(rxunit, CMR_SETTRACE, TRACE_OFF);
- (*ctrl_desc[cno].N_MGMT_COMMAND)(txunit, CMR_SETTRACE, TRACE_OFF);
- }
- rxunit = -1;
- txunit = -1;
- }
-
- if(cno >= 0)
- {
- (*ctrl_desc[cno].N_MGMT_COMMAND)(ctrl_desc[cno].unit, CMR_SETTRACE, TRACE_OFF);
- }
-
- x = SPLI4B();
- device_state[unit] = ST_IDLE;
- splx(x);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * read from trace device
- *---------------------------------------------------------------------------*/
-static int
-i4btrcread(struct cdev *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();
-
- IF_LOCK(&trace_queue[unit]);
-
- while(IF_QEMPTY(&trace_queue[unit]) && (device_state[unit] & ST_ISOPEN))
- {
- device_state[unit] |= ST_WAITDATA;
-
- if((error = msleep( &trace_queue[unit],
- &trace_queue[unit].ifq_mtx,
- I4BPRI | PCATCH,
- "bitrc", 0 )) != 0)
- {
- device_state[unit] &= ~ST_WAITDATA;
- IF_UNLOCK(&trace_queue[unit]);
- splx(x);
- return(error);
- }
- }
-
- _IF_DEQUEUE(&trace_queue[unit], m);
- IF_UNLOCK(&trace_queue[unit]);
-
- 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
- *---------------------------------------------------------------------------*/
-static int
-i4btrcpoll(struct cdev *dev, int events, struct thread *td)
-{
- return(ENODEV);
-}
-
-/*---------------------------------------------------------------------------*
- * device driver ioctl routine
- *---------------------------------------------------------------------------*/
-static int
-i4btrcioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
-{
- int error = 0;
- int unit = minor(dev);
- i4b_trace_setupa_t *tsa;
- int i;
- int cno = -1;
-
- /* find the first passive controller matching our unit no */
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- cno = i;
- break;
- }
- }
-
- switch(cmd)
- {
- case I4B_TRC_SET:
- if(cno < 0)
- return ENOTTY;
- (*ctrl_desc[cno].N_MGMT_COMMAND)(ctrl_desc[cno].unit, CMR_SETTRACE, (void *)*(unsigned 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_MGMT_COMMAND)(rxunit, CMR_SETTRACE, (int *)(tsa->rxflags & (TRACE_I | TRACE_D_RX | TRACE_B_RX)));
- (*ctrl_desc[cno].N_MGMT_COMMAND)(txunit, CMR_SETTRACE, (int *)(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);
-}
diff --git a/sys/i4b/include/i4b_cause.h b/sys/i4b/include/i4b_cause.h
deleted file mode 100644
index 0e94483..0000000
--- a/sys/i4b/include/i4b_cause.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -----------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Mar 17 10:08:21 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#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_LLDIAL 8 /* no dialout on leased line */
-#define CAUSE_I4B_MAX 9
- /* NOTE: update isdnd/pcause.c when adding causes !!!!! */
- /* NOTE: update layer3/i4b_q931.c when adding causes !!!!! */
-
-/* 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/i4b/include/i4b_debug.h b/sys/i4b/include/i4b_debug.h
deleted file mode 100644
index 38ae5ad..0000000
--- a/sys/i4b/include/i4b_debug.h
+++ /dev/null
@@ -1,302 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -----------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Mar 17 10:08:41 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#if !defined DO_I4B_DEBUG
-# define DO_I4B_DEBUG 1 /* default = include debugging code */
-#elif DO_I4B_DEBUG != 0
-# undef DO_I4B_DEBUG
-# define DO_I4B_DEBUG 1
-#endif
-
-#undef DO_I4B_MAXDEBUG /* default = disable ALL debug messages */
-
-#if 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 NDBGL1(bits, fmt, args...) \
- if(bits & i4b_l1_debug) \
- { printf("i4b-L1 %s: " fmt "\n", __func__ , ##args ); }
-
-#define NDBGL2(bits, fmt, args...) \
- if(bits & i4b_l2_debug) \
- { printf("i4b-L2 %s: " fmt "\n", __func__ , ##args ); }
-
-#define NDBGL3(bits, fmt, args...) \
- if(bits & i4b_l3_debug) \
- { printf("i4b-L3 %s: " fmt "\n", __func__ , ##args ); }
-
-#define NDBGL4(bits, fmt, args...) \
- if(bits & i4b_l4_debug) \
- { printf("i4b-L4 %s: " fmt "\n", __func__ , ##args ); }
-
-#else /* !DO_I4B_DEBUG */
-
-#define NDBGL1(bits, fmt, args...);
-#define NDBGL2(bits, fmt, args...);
-#define NDBGL3(bits, fmt, args...);
-#define NDBGL4(bits, fmt, args...);
-
-#endif /* DO_I4B_DEBUG */
-
-/* Layer 1 */
-
-#define L1_ERROR 0x000001 /* general error message*/
-#define L1_PRIM 0x000002 /* interlayer primitives*/
-#define L1_BCHAN 0x000004 /* B channel action */
-#define L1_H_ERR 0x000008 /* HSCX errors */
-#define L1_H_IRQ 0x000010 /* HSCX IRQ messages */
-#define L1_I_ERR 0x000020 /* ISAC errors */
-#define L1_I_MSG 0x000040 /* ISAC messages */
-#define L1_I_SETUP 0x000080 /* ISAC setup messages */
-#define L1_F_MSG 0x000100 /* FSM messages */
-#define L1_F_ERR 0x000200 /* FSM error messages */
-#define L1_T_MSG 0x000400 /* Timer messages */
-#define L1_T_ERR 0x000800 /* Timer error messages */
-#define L1_H_XFRERR 0x001000 /* HSCX data xfer error */
-#define L1_I_CICO 0x002000 /* ISAC command in/out */
-#define L1_S_MSG 0x004000 /* silent messages (soft-HDLC) */
-#define L1_S_ERR 0x008000 /* error messages (soft-HDLC) */
-#define L1_HFC_DBG 0x010000 /* HFC-S PCI messages */
-#define L1_DEBUG_MAX 0x01ffef /* all messages on except IRQ! */
-#define L1_DEBUG_ERR (L1_S_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_ISPDBG 0x0040 /* isp driver debug messages */
-#define L4_TELDBG 0x0080 /* tel driver debug messages */
-#define L4_INGDBG 0x0100 /* ing driver debug messages */
-#define L4_IAVCDBG 0x0200 /* AVM B1 driver debug messages */
-#define L4_CAPIDBG 0x0400 /* CAPI driver debug messages */
-
-#define L4_DEBUG_MAX 0x0fff /* 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)
-
-/*---------------------------------------------------------------------------*
- * generic get chipset statistics
- *---------------------------------------------------------------------------*/
-
-/* for the ihfc-driver: structure for HFC-1/S/SP statistics */
-
-typedef struct {
- int txframes;
- int rxframes;
- int xdu;
- int rdo;
- int crc;
- int rab;
-} hfcstat_t;
-
-
-/* for the isic-driver: structure for 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;
-
-/* generic statistics structure */
-
-struct chipstat {
- int driver_type; /* type, L1DRVR_XXXX */
- int driver_unit; /* the unit number */
- int driver_bchannel; /* the B-channel */
- union stats { /* union for all drivers */
- hfcstat_t hfcstat; /* for ihfc driver, L1DRVR_IHFC */
- hscxstat_t hscxstat; /* for isic driver, L1DRVR_ISIC */
- } stats;
-};
-
-/* get statistics */
-
-#define I4B_CTL_GET_CHIPSTAT _IOWR('C', 2, struct chipstat)
-
-/* clear statistics */
-
-#define I4B_CTL_CLR_CHIPSTAT _IOW('C', 3, struct chipstat)
-
-/*---------------------------------------------------------------------------*
- * get LAPD/Q.921 statistics
- *---------------------------------------------------------------------------*/
-typedef struct {
-
- /* transmit */
-
- u_long tx_i; /* I */
- u_long tx_rr; /* RR */
- u_long tx_rnr; /* RNR */
- u_long tx_rej; /* REJ */
- u_long tx_sabme; /* SABME*/
- u_long tx_dm; /* DM */
- u_long tx_disc; /* DISC */
- u_long tx_ua; /* UA */
- u_long tx_frmr; /* FRMR */
- u_long tx_tei; /* TEI */
-
- /* receive */
-
- u_long rx_i; /* I */
- u_long rx_rr; /* RR */
- u_long rx_rnr; /* RNR */
- u_long rx_rej; /* REJ */
- u_long rx_sabme; /* SABME*/
- u_long rx_tei; /* TEI */
- u_long rx_ui; /* UI */
- u_long rx_disc; /* DISC */
- u_long rx_xid; /* XID */
- u_long rx_dm; /* DM */
- u_long rx_ua; /* UA */
- u_long rx_frmr; /* FRMR */
-
- /* errors */
-
- u_long err_rx_len; /* incorrect length */
- u_long err_rx_badf; /* bad frame type */
- u_long err_rx_bads; /* bad s frame */
- u_long err_rx_badu; /* bad u frame */
- u_long err_rx_badui; /* bad ui frame */
-} lapdstat_t;
-
-typedef struct {
- int unit;
- lapdstat_t lapdstat;
-} l2stat_t;
-
-#define I4B_CTL_GET_LAPDSTAT _IOWR('C', 4, l2stat_t)
-
-#define I4B_CTL_CLR_LAPDSTAT _IOW('C', 5, int)
-
-/* EOF */
diff --git a/sys/i4b/include/i4b_global.h b/sys/i4b/include/i4b_global.h
deleted file mode 100644
index c7bcf31..0000000
--- a/sys/i4b/include/i4b_global.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Mar 17 09:55:26 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_GLOBAL_H_
-#define _I4B_GLOBAL_H_
-
-/*---------------------------------------------------------------------------*
- * hiding OS differences in the kernel
- *---------------------------------------------------------------------------*/
-
-#if defined(__FreeBSD__) && __FreeBSD__ >= 5
-/*
- * Deprecated LKM interface.
- */
-#include <sys/module.h>
-#define PSEUDO_SET(sym, name) \
- static int name ## _modevent(module_t mod, int type, void *data) \
- { \
- void (*initfunc)(void *) = (void (*)(void *))data; \
- switch (type) { \
- case MOD_LOAD: \
- /* printf(#name " module load\n"); */ \
- initfunc(NULL); \
- break; \
- case MOD_UNLOAD: \
- printf(#name " module unload - not possible for this module type\n"); \
- return EINVAL; \
- default: \
- return EOPNOTSUPP; \
- } \
- return 0; \
- } \
- static moduledata_t name ## _mod = { \
- #name, \
- name ## _modevent, \
- (void *)sym \
- }; \
- DECLARE_MODULE(name, name ## _mod, SI_SUB_PSEUDO, SI_ORDER_ANY)
-#endif
-
-/*---------------*/
-/* time handling */
-/*---------------*/
-
-#include <sys/param.h>
-
-#define TIMEOUT_FUNC_T timeout_t *
-#define SECOND time_second
-#define MICROTIME(x) getmicrotime(&(x))
-
-/*----------------*/
-/* timer handling */
-/*----------------*/
-
-#define START_TIMER(XHANDLE, XF, XSC, XTIME) XHANDLE = timeout((TIMEOUT_FUNC_T)XF, (void*)XSC, XTIME)
-#define STOP_TIMER(XHANDLE, XF, XSC) untimeout((TIMEOUT_FUNC_T)XF, (void*)XSC, XHANDLE)
-
-/*---------------------------------------------------------------------------*
- * misc globally used things in the kernel
- *---------------------------------------------------------------------------*/
-
-/* timer states */
-
-#define TIMER_IDLE 1 /* a timer is running */
-#define TIMER_ACTIVE 2 /* a timer is idle */
-
-/* priority */
-#define I4BPRI (PSOCK + 1)
-
-/* i4b's spl */
-
-#define SPLI4B() splimp() /* spl for i4b */
-
-/* critial code region handling macros */
-
-#define CRIT_VAR int _svd_spl_ /* declare variable */
-#define CRIT_BEG _svd_spl_ = SPLI4B() /* save spl */
-#define CRIT_END splx(_svd_spl_) /* restore spl */
-
-/* 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 */
-#define CMR_SETTRACE 2 /* set D-channel and B-channel trace */
-#define CMR_GCST 3 /* get chipset statistics */
-#define CMR_CCST 4 /* clear chipset statistics */
-
-#endif /* _I4B_GLOBAL_H_ */
diff --git a/sys/i4b/include/i4b_ioctl.h b/sys/i4b/include/i4b_ioctl.h
deleted file mode 100644
index 5c8e4fe..0000000
--- a/sys/i4b/include/i4b_ioctl.h
+++ /dev/null
@@ -1,744 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Aug 11 19:19:08 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IOCTL_H_
-#define _I4B_IOCTL_H_
-
-/*---------------------------------------------------------------------------*
- * version and release number for isdn4bsd package
- *---------------------------------------------------------------------------*/
-#define VERSION 1 /* version number */
-#define REL 4 /* release number */
-#define STEP 1 /* 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 */
-
-/*---------------------------------------------------------------------------*
- * ISDN D-channel protocols
- *---------------------------------------------------------------------------*/
-#define PROTOCOL_DSS1 0 /* default, Euro-ISDN/DSS1 */
-#define PROTOCOL_D64S 1 /* 64k leased line, no protocol */
-
-/*---------------------------------------------------------------------------*
- * 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_TINADD 3 /* Stollmann Tina-dd active card*/
-#define CTRL_AVMB1 4 /* AVM B1 active card */
-#define CTRL_CAPI 5 /* cards seen via the CAPI layer*/
-#define CTRL_CAPIMGR 6 /* boards accessed through the CAPI manager */
-#define CTRL_NUMTYPES 7 /* number of controller types */
-
-/*---------------------------------------------------------------------------*
- * CTRL_PASSIVE: driver types
- *---------------------------------------------------------------------------*/
-#define MAXL1UNITS 8 /* max number of units */
-
-#define L1DRVR_ISIC 0 /* isic - driver */
-#define L1DRVR_IWIC 1 /* iwic - driver */
-#define L1DRVR_IFPI 2 /* ifpi - driver */
-#define L1DRVR_IHFC 3 /* ihfc - driver */
-#define L1DRVR_IFPNP 4 /* ifpnp - driver */
-#define L1DRVR_ICCHP 5 /* icchp - driver */
-#define L1DRVR_ITJC 6 /* itjc - driver */
-#define L1DRVR_IFPI2 7 /* ifpi2 - driver */
-
-/* MAXL1DRVR MUST be updated when more passive drivers are added !!! */
-#define MAXL1DRVR (L1DRVR_IFPI2 + 1)
-
-/*---------------------------------------------------------------------------*
- * 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 */
-#define CARD_TYPEP_AVMA1PCI 19 /* AVM FRITZ!CARD PCI */
-#define CARD_TYPEP_PCC16 20 /* ELSA PCC-16 */
-#define CARD_TYPEP_AVM_PNP 21 /* AVM FRITZ!CARD PnP */
-#define CARD_TYPEP_SIE_ISURF2 22 /* Siemens I-Surf 2 PnP */
-#define CARD_TYPEP_ASUSCOMIPAC 23 /* Asuscom ISDNlink 128 K PnP */
-#define CARD_TYPEP_WINB6692 24 /* Winbond W6692 based */
-#define CARD_TYPEP_16_3C 25 /* Teles S0/16.3c PnP (HFC-S/SP */
-#define CARD_TYPEP_ACERP10 26 /* Acer ISDN P10 (HFC-S) */
-#define CARD_TYPEP_TELEINT_NO_1 27 /* TELEINT ISDN SPEED No. 1 (HFC-1) */
-#define CARD_TYPEP_CCD_HFCS_PCI 28 /* Cologne Chip HFC-S PCI based */
-#define CARD_TYPEP_NETJET_S 29 /* Traverse NetJet-S (Tiger300) */
-#define CARD_TYPEP_DIVA_ISA 30 /* Eicon DIVA ISA PnP 2.0 or 2.02 */
-#define CARD_TYPEP_COMPAQ_M610 31 /* Compaq Microcom 610 */
-#define CARD_TYPEP_AVMA1PCI_V2 32 /* AVM FRITZ!CARD PCI Ver. 2 */
-/*
- * in case you add support for more cards, please update:
- *
- * isdnd: controller.c, name_of_controller()
- *
- * and adjust CARD_TYPEP_MAX below.
- */
-
-#define CARD_TYPEP_MAX 32 /* 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
-
-/*---------------------------------------------------------------------------*
- * card types for CTRL_CAPI
- *---------------------------------------------------------------------------*/
-#define CARD_TYPEC_CAPI_UNK 0
-#define CARD_TYPEC_AVM_T1_PCI 1
-#define CARD_TYPEC_AVM_B1_PCI 2
-#define CARD_TYPEC_AVM_B1_ISA 3
-
-/*---------------------------------------------------------------------------*
- * max length of some strings
- *---------------------------------------------------------------------------*/
-#define TELNO_MAX 41 /* max length of a telephone number (+ '\0') */
-#define SUBADDR_MAX 21 /* max length of a subaddress (+ '\0') */
-#define DISPLAY_MAX 91 /* max length of display information (+ '\0') */
-#define DATETIME_MAX 21 /* max length of datetime information (+ '\0')*/
-#define KEYPAD_MAX 35 /* max length of a keypad string (+ '\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 */
-#define BDRV_IBC 4 /* BSD/OS point to point driver */
-#define BDRV_ING 5 /* NetGraph ing driver */
-
-/*---------------------------------------------------------------------------*
- * B channel protocol
- *---------------------------------------------------------------------------*/
-#define BPROT_NONE 0 /* no protocol at all, raw data */
-#define BPROT_RHDLC 1 /* raw HDLC: flag, data, crc, flag */
-
-/*---------------------------------------------------------------------------*
- * special bearer capability settings (i.e. Data over Voice)
- *---------------------------------------------------------------------------*/
-#define BCAP_NONE 0 /* no special bearer capability */
-#define BCAP_DOV 1 /* Data over Voice */
-
-/*---------------------------------------------------------------------------*
- * 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 */
-
-/*---------------------------------------------------------------------------*
- * The shorthold algorithm to use
- *---------------------------------------------------------------------------*/
-#define SHA_FIXU 0 /* timeout algorithm for fix unit charging */
-#define SHA_VARU 1 /* timeout algorithm for variable unit charging */
-
-/*---------------------------------------------------------------------------*
- * The shorthold data struct
- *---------------------------------------------------------------------------*/
-typedef struct {
- int shorthold_algorithm; /* shorthold algorithm to use */
- 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_shorthold_t;
-
-
-/****************************************************************************
-
- 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'
-#define MSG_DIALOUTNUMBER_IND 'p'
-#define MSG_PACKET_IND 'q'
-#define MSG_KEYPAD_IND 'r'
- 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 */
- int bcap; /* special bearer capability, see BCAP_XXX */
- char dst_telno[TELNO_MAX]; /* destination telno */
- char dst_subaddr[SUBADDR_MAX]; /* dest subaddr */
- char src_telno[TELNO_MAX]; /* source telno */
- char src_subaddr[SUBADDR_MAX]; /* src subaddr */
- int dst_ton; /* dest. type of number */
- int src_ton; /* src. type of number */
-#define TON_OTHER 0 /* other type of number */
-#define TON_INTERNAT 1 /* international number */
-#define TON_NATIONAL 2 /* national number */
- 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 */
- int prs_ind;/* presentation indicator */
-#define PRS_NONE 0 /* no presentation indicator transmitted*/
-#define PRS_ALLOWED 1 /* presentation allowed */
-#define PRS_RESTRICT 2 /* presentation restricted */
-#define PRS_NNINTERW 3 /* number not available due to interworking */
-#define PRS_RESERVED 4 /* reserved */
- 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;
-
-/*---------------------------------------------------------------------------*
- * dial a number
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
- int cmdlen; /* length of string */
- int subaddrlen; /* length of subaddr */
- char cmd[TELNO_MAX]; /* the number to dial */
- char subaddr[SUBADDR_MAX]; /* dest subaddr */
-} msg_dialoutnumber_ind_t;
-
-/*---------------------------------------------------------------------------*
- * send keypad string
- *---------------------------------------------------------------------------*/
-typedef struct {
- msg_hdr_t header; /* common header */
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
- int cmdlen; /* length of string */
- char cmd[KEYPAD_MAX];/* keypad string */
-} msg_keypad_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;
-
-/*---------------------------------------------------------------------------*
- * connect packet logging
- *---------------------------------------------------------------------------*/
-
-typedef struct {
- msg_hdr_t header; /* common header */
- int driver; /* driver type */
- int driver_unit; /* driver unit number */
- int direction; /* 0=in 1=out */
-#define DIRECTION_IN 0 /* sending packet to remote */
-#define DIRECTION_OUT 1 /* received packet from remote */
-#define MAX_PACKET_LOG 40 /* space for IP and TCP header */
- u_int8_t pktdata[MAX_PACKET_LOG];
-} msg_packet_ind_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 bcap; /* special bearer capability */
- int driver; /* driver to route b channel data to */
- int driver_unit; /* unit number for above driver */
- msg_shorthold_t shorthold_data; /* the shorthold data */
- 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 dst_subaddr[SUBADDR_MAX]; /* dest subaddr */
- char src_telno[TELNO_MAX]; /* source telephone number */
- char src_subaddr[SUBADDR_MAX]; /* source subaddr */
- char keypad[KEYPAD_MAX]; /* keypad string */
-} 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 bcap; /* special bearer capability */
- 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 */
- int nbch; /* number of b channels provided */
-} 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 */
- cause_t cause; /* exact i4b cause */
-} 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 */
- msg_shorthold_t shorthold_data;
-} 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
- * (msg_vr_req_t is also used by tel & rbch drivers)
- *---------------------------------------------------------------------------*/
-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)
-
-/*---------------------------------------------------------------------------*
- * set ISDN protocol used by a controller
- *---------------------------------------------------------------------------*/
-typedef struct {
- int controller; /* controller number */
- int protocol; /* ISDN D-channel protocol type */
-} msg_prot_ind_t;
-
-#define I4B_PROT_IND _IOW('4', 10, msg_prot_ind_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 */
-#define I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN 65536
- 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/i4b/include/i4b_isdnq931.h b/sys/i4b/include/i4b_isdnq931.h
deleted file mode 100644
index e5a8a2d..0000000
--- a/sys/i4b/include/i4b_isdnq931.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Mar 9 15:53:49 2002]
- *
- *---------------------------------------------------------------------------*/
-
-/* 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_ESCAPE 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 b804ea7..0000000
--- a/sys/i4b/include/i4b_l1l2.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ---------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Mar 9 15:54:49 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L1L2_H_
-#define _I4B_L1L2_H_
-
-#include <i4b/include/i4b_trace.h>
-
-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);
- 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, void *);
-
-#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 e866073..0000000
--- a/sys/i4b/include/i4b_l2l3.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -----------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Mar 9 15:55:16 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#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, void *); /* 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 08a7c5d..0000000
--- a/sys/i4b/include/i4b_l3l4.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Aug 11 12:52:41 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#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 MAX_BCHAN 30
-#define N_CALL_DESC (MAX_CONTROLLERS*MAX_BCHAN) /* 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, cause_t cause);
- 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);
-
-/* global linktab functions for ING network driver */
-
-drvr_link_t *ing_ret_linktab(int unit);
-void ing_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 bcap; /* special bearer capabilities BCAP_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 dst_subaddr[SUBADDR_MAX]; /* destination subaddr */
- u_char src_telno[TELNO_MAX]; /* source number */
- u_char src_subaddr[SUBADDR_MAX]; /* source subaddr */
-
- int dst_ton; /* destination type of number */
- int src_ton; /* source type of number */
-
- int scr_ind; /* screening ind for incoming call */
- int prs_ind; /* presentation 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 */
-
- int callouts_inited; /* must init before use */
- 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 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: */
- msg_shorthold_t shorthold_data; /* shorthold data to use */
-
- 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*/
- u_char keypad[KEYPAD_MAX]; /* keypad facility */
-} 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 protocol; /* D-channel protocol type */
-
- int dl_est; /* layer 2 established */
-#define DL_DOWN 0
-#define DL_UP 1
-
- int nbch; /* number of b channels */
- int bch_state[MAX_BCHAN]; /* 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);
- 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, void *);
-} ctrl_desc_t;
-
-extern ctrl_desc_t ctrl_desc[MAX_CONTROLLERS];
-
-#endif /* _I4B_Q931_H_ */
diff --git a/sys/i4b/include/i4b_mbuf.h b/sys/i4b/include/i4b_mbuf.h
deleted file mode 100644
index dbca590..0000000
--- a/sys/i4b/include/i4b_mbuf.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Mar 9 15:58:11 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_MBUF_H_
-#define _I4B_MBUF_H_
-
-/* layer 1 / layer 2 comunication: 3rd ph_data_req parameter */
-#define MBUF_DONTFREE 0
-#define MBUF_FREE 1
-
-#define IF_QEMPTY(ifq) ((ifq)->ifq_len == 0)
-
-struct mbuf *i4b_Dgetmbuf( int );
-void i4b_Dfreembuf( struct mbuf *m );
-void i4b_Dcleanifq( struct ifqueue * );
-
-struct mbuf *i4b_Bgetmbuf( int );
-void i4b_Bfreembuf( struct mbuf *m );
-void i4b_Bcleanifq( struct ifqueue * );
-
-#endif /* _I4B_MBUF_H_ */
-
-/* EOF */
diff --git a/sys/i4b/include/i4b_rbch_ioctl.h b/sys/i4b/include/i4b_rbch_ioctl.h
deleted file mode 100644
index 334aa9dc..0000000
--- a/sys/i4b/include/i4b_rbch_ioctl.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * Copyright (c) 1999, 2002 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_ioctl.h raw B-channel driver interface ioctls
- * ------------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Mar 17 10:10:25 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_RBCH_IOCTL_H_
-#define _I4B_RBCH_IOCTL_H_
-
-/*---------------------------------------------------------------------------*
- * instruct the rbch device to dial the given number
- *---------------------------------------------------------------------------*/
-
-typedef char telno_t[TELNO_MAX];
-
-#define I4B_RBCH_DIALOUT _IOW('R', 1, telno_t)
-
-/*---------------------------------------------------------------------------*
- * request version and release info from kernel part
- *---------------------------------------------------------------------------*/
-
-#define I4B_RBCH_VR_REQ _IOR('R', 2, msg_vr_req_t)
-
-#endif /* _I4B_RBCH_IOCTL_H_ */
diff --git a/sys/i4b/include/i4b_tel_ioctl.h b/sys/i4b/include/i4b_tel_ioctl.h
deleted file mode 100644
index 47ffc70..0000000
--- a/sys/i4b/include/i4b_tel_ioctl.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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_ioctl.h telephony interface ioctls
- * ------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Mar 17 10:10:39 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_TEL_IOCTL_H_
-#define _I4B_TEL_IOCTL_H_
-
-/*===========================================================================*
- * /dev/i4btel<n> devices (audio data)
- *===========================================================================*/
-
-/* supported audio format conversions */
-
-#define CVT_NONE 0 /* no A-law/u-law conversion */
-#define CVT_ALAW2ULAW 1 /* ISDN line: A-law, user: u-law */
-#define CVT_ULAW2ALAW 2 /* ISDN line: u-law, user: A-law */
-
-/*---------------------------------------------------------------------------*
- * get / set audio format
- *---------------------------------------------------------------------------*/
-
-#define I4B_TEL_GETAUDIOFMT _IOR('A', 0, int)
-#define I4B_TEL_SETAUDIOFMT _IOW('A', 1, int)
-#define I4B_TEL_EMPTYINPUTQUEUE _IOW('A', 2, int)
-
-/*---------------------------------------------------------------------------*
- * request version and release info from kernel part
- *---------------------------------------------------------------------------*/
-
-#define I4B_TEL_VR_REQ _IOR('A', 3, msg_vr_req_t)
-
-/*---------------------------------------------------------------------------*
- * send tones out of the tel interface
- *---------------------------------------------------------------------------*/
-
-#define I4B_TEL_MAXTONES 32
-
-struct i4b_tel_tones {
- int frequency[I4B_TEL_MAXTONES];
- int duration[I4B_TEL_MAXTONES];
-};
-
-#define I4B_TEL_TONES _IOR('A', 4, struct i4b_tel_tones)
-
-/*===========================================================================*
- * /dev/i4bteld<n> devices (dialer interface)
- *===========================================================================*/
-
-/* dialer commands */
-
-#define CMD_DIAL 'D' /* dial the following number string */
-#define CMD_HUP 'H' /* hangup */
-#define CMD_KEYP 'K' /* send keypad string */
-
-/* dialer responses */
-
-#define RSP_CONN '0' /* connect */
-#define RSP_BUSY '1' /* busy */
-#define RSP_HUP '2' /* hangup */
-#define RSP_NOA '3' /* no answer */
-
-#endif /* _I4B_TEL_IOCTL_H_ */
diff --git a/sys/i4b/include/i4b_trace.h b/sys/i4b/include/i4b_trace.h
deleted file mode 100644
index fbd40af..0000000
--- a/sys/i4b/include/i4b_trace.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ----------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Mar 17 10:10:52 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#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_SET _IOW('T', 0, 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', 1, i4b_trace_setupa_t) /* set analyze mode */
-#define I4B_TRC_RESETA _IOW('T', 2, int) /* reset analyze mode */
-
-#endif /* _I4B_TRACE_H_ */
diff --git a/sys/i4b/layer1/i4b_hdlc.c b/sys/i4b/layer1/i4b_hdlc.c
deleted file mode 100644
index 15c22b2..0000000
--- a/sys/i4b/layer1/i4b_hdlc.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_hdlc.c - software-HDLC constant tables
- * ------------------------------------------
- * $Id: i4b_hdlc.h,v 1.5 2000/08/28 07:41:19 hm Exp $
- * last edit-date: [Wed Jul 19 09:41:13 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-
-/*---------------------------------------------------------------------------*
- * HDLC CRC table
- *
- * Usage:
- * crc = (HDLC_FCS_TAB[(u_char)(crc ^ byte of data)] ^ (u_char)(crc >> 8));
- *
- * For more information see RFC 1662 (p. 10)
- *---------------------------------------------------------------------------*/
-const uint16_t HDLC_FCS_TAB[256] = { 0x0000,
- 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48,
- 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081,
- 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9,
- 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102,
- 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a,
- 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183,
- 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb,
- 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204,
- 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c,
- 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285,
- 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd,
- 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306,
- 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e,
- 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387,
- 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf,
- 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408,
- 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840,
- 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489,
- 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1,
- 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a,
- 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942,
- 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b,
- 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3,
- 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c,
- 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44,
- 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d,
- 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5,
- 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e,
- 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46,
- 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f,
- 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7,
- 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
-};
-
-/*---------------------------------------------------------------------------*
- * HDLC bit table
- * ==============
- *
- * bits[0..3]: A value which tells how many set bits there are at the
- * beginning of the byte.
- *
- * bits[4..7]: Special bytes like 0x7e, 0x7d, 0xfd ... are flagged here
- * NOTE: Special bytes also means 'abort' bytes (7 or more
- * continuous set bits)
- *
- * bits[8..11]: A copy of bits[0..3] but only incremented by one.
- * NOTE: 0x7e has value '8' instead of '0'. Internal reasons.
- *
- * bits[12..15]: A value which tells how many set bits there are at the
- * end of the byte.
- * NOTE: 0xff has both '8' incoming and '8' outgoing bits.
- *
- *---------------------------------------------------------------------------*/
-const uint16_t HDLC_BIT_TAB[256] = { 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0403, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0504, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0403, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0605, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0403, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0504, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0403, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0160, 0x0706, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0403, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0504, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0403, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0605, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0403, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0504, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x0100, 0x0201, 0x0100, 0x0403, 0x0100,
- 0x0201, 0x0100, 0x0302, 0x01a0, 0x02a1, 0x0860, 0x0807, 0x1100,
- 0x1201, 0x1100, 0x1302, 0x1100, 0x1201, 0x1100, 0x1403, 0x1100,
- 0x1201, 0x1100, 0x1302, 0x1100, 0x1201, 0x1100, 0x1504, 0x1100,
- 0x1201, 0x1100, 0x1302, 0x1100, 0x1201, 0x1100, 0x1403, 0x1100,
- 0x1201, 0x1100, 0x1302, 0x1100, 0x1201, 0x1100, 0x1605, 0x1100,
- 0x1201, 0x1100, 0x1302, 0x1100, 0x1201, 0x1100, 0x1403, 0x1100,
- 0x1201, 0x1100, 0x1302, 0x1100, 0x1201, 0x1100, 0x1504, 0x1100,
- 0x1201, 0x1100, 0x1302, 0x1100, 0x1201, 0x1100, 0x1403, 0x1100,
- 0x1201, 0x1100, 0x1302, 0x1100, 0x1201, 0x1160, 0x1706, 0x2100,
- 0x2201, 0x2100, 0x2302, 0x2100, 0x2201, 0x2100, 0x2403, 0x2100,
- 0x2201, 0x2100, 0x2302, 0x2100, 0x2201, 0x2100, 0x2504, 0x2100,
- 0x2201, 0x2100, 0x2302, 0x2100, 0x2201, 0x2100, 0x2403, 0x2100,
- 0x2201, 0x2100, 0x2302, 0x2100, 0x2201, 0x2100, 0x2605, 0x3100,
- 0x3201, 0x3100, 0x3302, 0x3100, 0x3201, 0x3100, 0x3403, 0x3100,
- 0x3201, 0x3100, 0x3302, 0x3100, 0x3201, 0x3100, 0x3504, 0x4100,
- 0x4201, 0x4100, 0x4302, 0x4100, 0x4201, 0x4100, 0x4403, 0x5100,
- 0x5201, 0x5100, 0x5302, 0x6180, 0x6281, 0x7150, 0x8908
-};
diff --git a/sys/i4b/layer1/i4b_hdlc.h b/sys/i4b/layer1/i4b_hdlc.h
deleted file mode 100644
index 83aaf35..0000000
--- a/sys/i4b/layer1/i4b_hdlc.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_hdlc.h - software-HDLC header file
- * --------------------------------------
- *
- * $Id: i4b_hdlc.h,v 1.5 2000/08/28 07:41:19 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Wed Jul 19 09:41:13 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_HDLC_H_
-#define _I4B_HDLC_H_
-
-extern const u_short HDLC_FCS_TAB[256];
-extern const u_short HDLC_BIT_TAB[256];
-
-/*---------------------------------------------------------------------------*
- * HDLC_DECODE
- * ===========
- *
- * u_char: flag, blevel
- * u_short: crc, ib, tmp, tmp2, len
- *
- * next: 'continue' or 'goto xxx'
- *
- * cfr: complete frame
- * nfr: new frame
- * NOTE: must setup 'len' and 'dst', so that 'dst' may be written
- * at most 'len' times.
- *
- * rab: abort
- * rdd: read data (read byte is stored in 'tmp2')
- * rdo: overflow
- *
- * d: dummy
- *
- * NOTE: setting flag to '0' and len to '0' => recover from rdu
- * NOTE: bits[8 .. ] of tmp2 may be used to store custom data/flags
- * NOTE: these variables have to be 'suspended' / 'resumed' somehow:
- * flag, blevel, crc, ib, tmp, len
- * NOTE: zero is default value for all variables.
- * NOTE: each time 'dst' is written, 'len' is decreased by one.
- *---------------------------------------------------------------------------*/
-
-#define HDLC_DECODE(dst, len, tmp, tmp2, blevel, ib, crc, flag, rddcmd, nfrcmd, \
- cfrcmd, rabcmd, rdocmd, nextcmd, d) \
- \
- rddcmd; \
- \
- ib += HDLC_BIT_TAB[(u_char)tmp2]; \
- \
- if ((u_char)ib >= 5) \
- { \
- if (ib & 0x20) /* de-stuff (msb) */ \
- { \
- if ((u_char)tmp2 == 0x7e) goto j0##d; \
- tmp2 += tmp2 & 0x7f; \
- blevel--; \
- \
- if ((ib += 0x100) & 0xc) tmp2 |= 1; /* */ \
- } \
- \
- ib &= ~0xe0; \
- \
- if ((u_char)ib == 6) /* flag seq (lsb) */ \
- { \
- j0##d: if (flag >= 2) \
- { \
- len += (4 - flag) & 3; /* remove CRC bytes */ \
- crc ^= 0xf0b8; \
- cfrcmd; \
- len = 0; \
- } \
- \
- flag = 1; \
- \
- blevel = (ib >> 8) & 0xf; \
- tmp = ((u_char)tmp2) >> blevel; \
- blevel = 8 - blevel; \
- \
- ib >>= 12; \
- \
- nextcmd; \
- } \
- if ((u_char)ib >= 7) /* abort (msb & lsb) */ \
- { \
- if (flag >= 2) \
- { \
- rabcmd; \
- len = 0; \
- } \
- \
- flag = 0; \
- \
- ib >>= 12; \
- \
- nextcmd; \
- } \
- if ((u_char)ib == 5) /* de-stuff (lsb) */ \
- { \
- tmp2 = (tmp2 | (tmp2 + 1)) & ~0x1; \
- blevel--; \
- } \
- if (blevel > 7) /* EO - bits */ \
- { \
- tmp |= (u_char)tmp2 >> (8 - (blevel &= 7)); \
- \
- ib >>= 12; \
- \
- nextcmd; \
- } \
- } \
- \
- tmp |= (u_char)tmp2 << blevel; \
- \
- if (!len--) \
- { \
- len++; \
- \
- if (!flag++) { flag--; goto j5##d;} /* hunt mode */ \
- \
- switch (flag) \
- { case 2: /* new frame */ \
- nfrcmd; \
- crc = -1; \
- if (!len--) { len++; flag++; goto j4##d; } \
- goto j3##d; \
- case 3: /* CRC (lsb's) */ \
- case 4: /* CRC (msb's) */ \
- goto j4##d; \
- case 5: /* RDO */ \
- rdocmd; \
- flag = 0; \
- break; \
- } \
- } \
- else \
- { \
- j3##d: dst = (u_char)tmp; \
- j4##d: crc = (HDLC_FCS_TAB[(u_char)(tmp ^ crc)] ^ (u_char)(crc >> 8)); \
- } \
- \
- j5##d: ib >>= 12; \
- tmp >>= 8; \
-
-/*------ end of HDLC_DECODE -------------------------------------------------*/
-
-
-/*---------------------------------------------------------------------------*
- * HDLC_ENCODE
- * ===========
- *
- * u_char: flag, src
- * u_short: tmp2, blevel, ib, crc, len
- * u_int: tmp
- *
- * gfr: This is the place where you free the last [mbuf] chain, and get
- * the next one. If a mbuf is available the code should setup 'len'
- * and 'src' so that 'src' may be read 'len' times. If no mbuf is
- * available leave 'len' and 'src' untouched.
- *
- * wrd: write data (output = (u_char)tmp)
- *
- * d: dummy
- *
- * NOTE: setting flag to '-2' and len to '0' => abort bytes will be sent
- * NOTE: these variables have to be 'suspended' / 'resumed' somehow:
- * flag, blevel, crc, ib, tmp, len
- * NOTE: zero is default value for all variables.
- * NOTE: each time 'src' is read, 'len' is decreased by one.
- * NOTE: neither cmd's should exit through 'goto' or 'break' statements.
- *---------------------------------------------------------------------------*/
-
-#define HDLC_ENCODE(src, len, tmp, tmp2, blevel, ib, crc, flag, gfrcmd, wrdcmd, d) \
- \
- if (blevel >= 0x800) { blevel -= 0x800; goto j4##d; } \
- \
- if (!len--) \
- { \
- len++; \
- \
- switch(++flag) \
- { default: /* abort */ \
- tmp = blevel = 0; /* zero is default */ \
- tmp2 = 0xff; \
- goto j3##d; \
- case 1: /* 1st time FS */ \
- case 2: /* 2nd time FS */ \
- tmp2 = 0x7e; \
- goto j3##d; \
- case 3: \
- gfrcmd; /* get new frame */ \
- if (!len--) \
- { \
- len++; \
- flag--; /* don't proceed */ \
- tmp2 = 0x7e; \
- goto j3##d; /* final FS */ \
- } \
- else \
- { \
- crc = -1; \
- ib = 0; \
- goto j1##d; /* first byte */ \
- } \
- case 4: \
- crc ^= -1; \
- tmp2 = (u_char)crc; \
- goto j2##d; /* CRC (lsb's) */ \
- case 5: \
- tmp2 = (u_char)(crc >> 8); \
- flag = 1; \
- goto j2##d; /* CRC (msb's) */ \
- } \
- } \
- else \
- { j1##d : \
- tmp2 = (u_char)src; \
- crc =(HDLC_FCS_TAB[(u_char)(crc ^ tmp2)] ^ (u_char)(crc >> 8)); \
- j2##d: \
- \
- ib >>= 12; \
- ib += HDLC_BIT_TAB[(u_char)tmp2]; \
- \
- if ((u_char)ib >= 5) /* stuffing */ \
- { \
- blevel &= ~0xff; \
- \
- if (ib & 0xc0) /* bit stuff (msb) */ \
- { \
- tmp2 += tmp2 & (0xff * (ib & 0xc0)); \
- ib %= 0x5000; \
- blevel++; \
- } \
- \
- ib &= ~0xf0; \
- \
- if ((u_char)ib >= 5) /* bit stuff (lsb) */ \
- { \
- tmp2 += tmp2 & ~0x1f >> ((ib - (ib >> 8) + 1) \
- & 7); \
- blevel++; \
- \
- if ((u_char)ib >= 10) /* bit stuff (msb) */ \
- { \
- tmp2 += tmp2 & ~0x7ff >> ((ib - \
- (ib >> 8) + 1) & 7); \
- blevel++; \
- } \
- if (ib & 0x8000) /* bit walk */ \
- { \
- ib = ((u_char)ib % 5) << 12; \
- } \
- } \
- \
- tmp |= tmp2 << (u_char)(blevel >> 8); \
- blevel += (u_char)blevel << 8; \
- } \
- else /* no stuffing */ \
- { \
- j3##d:tmp |= tmp2 << (u_char)(blevel >> 8); \
- } \
- } \
- \
- j4##d: wrdcmd; \
- tmp >>= 8; \
-
-/*------ end of HDLC_ENCODE -------------------------------------------------*/
-
-
-#endif /* _I4B_HDLC_H_ */
-
diff --git a/sys/i4b/layer1/i4b_l1.h b/sys/i4b/layer1/i4b_l1.h
deleted file mode 100644
index ac6a671..0000000
--- a/sys/i4b/layer1/i4b_l1.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 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
- * ---------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Tue Jan 23 17:04:57 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_L1_H_
-#define _I4B_L1_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-#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))
-
-/* L1DRVR_XXXX moved to i4b_ioctl.h */
-
-#define L0DRVR(du) (((du) >> 8) & 0xff)
-#define L0UNIT(du) ((du) & 0xff)
-
-#define L0DRVRUNIT(d, u) ( (((d) << 8) & 0xff00) | ((u) & 0xff))
-
-#define L0ISICUNIT(u) ( (((L1DRVR_ISIC) << 8) & 0xff00) | ((u) & 0xff))
-#define L0IWICUNIT(u) ( (((L1DRVR_IWIC) << 8) & 0xff00) | ((u) & 0xff))
-#define L0IFPIUNIT(u) ( (((L1DRVR_IFPI) << 8) & 0xff00) | ((u) & 0xff))
-#define L0IHFCUNIT(u) ( (((L1DRVR_IHFC) << 8) & 0xff00) | ((u) & 0xff))
-#define L0IFPNPUNIT(u) ( (((L1DRVR_IFPNP) << 8) & 0xff00) | ((u) & 0xff))
-#define L0ICCHPUNIT(u) ( (((L1DRVR_ICCHP) << 8) & 0xff00) | ((u) & 0xff))
-#define L0ITJCUNIT(u) ( (((L1DRVR_ITJC) << 8) & 0xff00) | ((u) & 0xff))
-#define L0IFPI2UNIT(u) ( (((L1DRVR_IFPI2) << 8) & 0xff00) | ((u) & 0xff))
-
-/* jump table for the multiplex functions */
-struct i4b_l1mux_func {
- isdn_link_t * (*ret_linktab)(int, int);
- void (*set_linktab)(int, int, drvr_link_t *);
- int (*mph_command_req)(int, int, void *);
- int (*ph_data_req)(int, struct mbuf *, int);
- int (*ph_activate_req)(int);
-};
-
-int i4b_l1_ph_data_ind(int unit, struct mbuf *m);
-int i4b_l1_ph_activate_ind(int unit);
-int i4b_l1_ph_deactivate_ind(int unit);
-int i4b_l1_mph_status_ind(int, int, int, struct i4b_l1mux_func *);
-
-isdn_link_t *i4b_l1_ret_linktab(int unit, int channel);
-void i4b_l1_set_linktab(int unit, int channel, drvr_link_t *dlt);
-
-int i4b_l1_trace_ind(i4b_trace_hdr_t *, int, u_char *);
-
-/* i4b_l1lib.c */
-
-int i4b_l1_bchan_tel_silence(unsigned char *data, int len);
-
-#endif /* _I4B_L1_H_ */
diff --git a/sys/i4b/layer1/i4b_l1dmux.c b/sys/i4b/layer1/i4b_l1dmux.c
deleted file mode 100644
index 15f3783..0000000
--- a/sys/i4b/layer1/i4b_l1dmux.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 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_l1dmux.c - isdn4bsd layer 1 driver multiplexer
- * --------------------------------------------------
- * last edit-date: [Wed Jan 10 16:43:24 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_global.h>
-
-/*
- * this code is nothing but a big dynamic switch to multiplex and demultiplex
- * layer 1 hardware isdn drivers to a common layer 2.
- *
- * when a card is successfully attached at system boot time, the driver for
- * this card calls the routine i4b_l1_mph_status_ind() with status = STI_ATTACH.
- *
- * This command is used to setup the tables for converting a "driver unit" and
- * "driver type" pair (encoded in the calls from the hardware driver to the
- * routines in this source file) to a "unit number" used in layer 2 and the
- * layers above (up to and including the isdnd daemon) and for converting
- * layer 2 units back to calling the appropriate driver and driver unit
- * number.
- *
- * Example: in my setup, a Winbond (iwic) card is probed first and gets
- * driver unit number 0, driver type 1 in layer 1. This becomes unit
- * number 0 in layer 2 and up. The second card probed is a Teles card
- * (isic) and gets driver unit number 0, driver type 0 in layer 1. This
- * becomes unit number 1 in layer 1 and up.
- *
- * To add support for a new driver, add a new driver number to i4b_l1.h:
- * currently we have L1DRVR_ISIC and L1DRVR_IWIC, so you would add
- * L1DRVR_FOO. More you would want to add a L0FOOUNIT to encode unit
- * numbers in your driver. You then have to add a l1foounittab[] and
- * add an entry to the getl1tab() routine for your driver. The only
- * thing left now is to write your driver with the support functions
- * for this multiplexer ;-)
- */
-
-unsigned int i4b_l1_debug = L1_DEBUG_DEFAULT;
-
-static int l1isicunittab[MAXL1UNITS];
-
-static int l1iwicunittab[MAXL1UNITS];
-
-static int l1ifpiunittab[MAXL1UNITS];
-
-static int l1ifpi2unittab[MAXL1UNITS];
-
-static int l1ihfcunittab[MAXL1UNITS];
-
-static int l1ifpnpunittab[MAXL1UNITS];
-
-static int l1itjcunittab[MAXL1UNITS];
-
-static int numl1units = 0;
-
-static int l1drvunittab[MAXL1UNITS];
-static struct i4b_l1mux_func *l1mux_func[MAXL1DRVR];
-
-static int i4b_l1_ph_data_req(int, struct mbuf *, int);
-static int i4b_l1_ph_activate_req(int);
-
-/* from i4btrc driver i4b_trace.c */
-int get_trace_data_from_l1(int unit, int what, int len, char *buf);
-
-/* from layer 2 */
-int i4b_ph_data_ind(int unit, struct mbuf *m);
-int i4b_ph_activate_ind(int unit);
-int i4b_ph_deactivate_ind(int unit);
-int i4b_mph_status_ind(int, int, int);
-
-/* layer 1 lme */
-int i4b_l1_mph_command_req(int, int, void *);
-
-/*---------------------------------------------------------------------------*
- * jump table: interface function pointers L1/L2 interface
- *---------------------------------------------------------------------------*/
-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)) i4b_l1_ph_data_req,
-
- (int (*)(int)) i4b_l1_ph_activate_req,
-
- /* Layer 1 --> trace interface driver, 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, void *)) i4b_l1_mph_command_req,
-};
-
-/*---------------------------------------------------------------------------*
- * return a pointer to a layer 0 drivers unit tab
- *---------------------------------------------------------------------------*/
-static __inline int *
-getl1tab(int drv)
-{
- switch(drv)
- {
- case L1DRVR_ISIC:
- return(l1isicunittab);
- break;
- case L1DRVR_IWIC:
- return(l1iwicunittab);
- break;
- case L1DRVR_IFPI:
- return(l1ifpiunittab);
- break;
- case L1DRVR_IFPI2:
- return(l1ifpi2unittab);
- break;
- case L1DRVR_IHFC:
- return(l1ihfcunittab);
- break;
- case L1DRVR_IFPNP:
- return(l1ifpnpunittab);
- break;
- case L1DRVR_ITJC:
- return(l1itjcunittab);
- break;
- default:
- return(NULL);
- break;
- }
-}
-
-/*===========================================================================*
- * B - Channel (data transfer)
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * return the address of ISDN drivers linktab
- *---------------------------------------------------------------------------*/
-isdn_link_t *
-i4b_l1_ret_linktab(int unit, int channel)
-{
- int drv_unit, ch_unit;
-
- drv_unit = L0DRVR(l1drvunittab[unit]);
- ch_unit = L0UNIT(l1drvunittab[unit]);
-
- NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit);
-
- if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL
- || l1mux_func[drv_unit]->ret_linktab == NULL)
- panic("i4b_l1_ret_linktab: unknown driver type %d\n", drv_unit);
-
- return(l1mux_func[drv_unit]->ret_linktab(ch_unit, channel));
-}
-
-/*---------------------------------------------------------------------------*
- * set the ISDN driver linktab
- *---------------------------------------------------------------------------*/
-void
-i4b_l1_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
- int drv_unit, ch_unit;
-
- drv_unit = L0DRVR(l1drvunittab[unit]);
- ch_unit = L0UNIT(l1drvunittab[unit]);
-
- NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit);
-
- if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL
- || l1mux_func[drv_unit]->set_linktab == NULL)
- panic("i4b_l1_set_linktab: unknown driver type %d\n", drv_unit);
-
- l1mux_func[drv_unit]->set_linktab(ch_unit, channel, dlt);
-}
-
-/*===========================================================================*
- * trace D- and B-Channel support
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * L0 -> L1 trace information to trace driver
- *---------------------------------------------------------------------------*/
-int
-i4b_l1_trace_ind(i4b_trace_hdr_t *hdr, int len, u_char *data)
-{
- register int *tab;
-
- if((tab = getl1tab(L0DRVR(hdr->unit))) == NULL)
- panic("i4b_l1_trace_ind: unknown driver type %d\n", L0DRVR(hdr->unit));
-
- NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d", L0DRVR(hdr->unit), L0UNIT(hdr->unit), tab[L0UNIT(hdr->unit)]);
-
- hdr->unit = tab[L0UNIT(hdr->unit)];
-
- return(MPH_Trace_Ind(hdr, len, data));
-}
-
-/*===========================================================================*
- * D - Channel (signalling)
- *===========================================================================*/
-
-/*---------------------------------------------------------------------------*
- * L0 -> L1 status indication from hardware
- *---------------------------------------------------------------------------*/
-int
-i4b_l1_mph_status_ind(int drv_unit, int status, int parm, struct i4b_l1mux_func *l1mux_func_p)
-{
- register int *tab;
-
- /*
- * in case the status STI_ATTACH is sent from the hardware, the
- * driver has just attached itself and we need to initialize
- * the tables and assorted variables.
- */
-
- if(status == STI_ATTACH)
- {
- if (l1mux_func_p == (struct i4b_l1mux_func *)0)
- panic("i4b_l1_mph_status_ind: i4b_l1mux_func pointer is NULL\n");
-
- if(numl1units < MAXL1UNITS)
- {
- if((tab = getl1tab(L0DRVR(drv_unit))) == NULL)
- panic("i4b_l1_mph_status_ind: unknown driver type %d\n", L0DRVR(drv_unit));
-
- tab[L0UNIT(drv_unit)] = numl1units;
-
- l1drvunittab[numl1units] = drv_unit;
-
- l1mux_func[L0DRVR(drv_unit)] = l1mux_func_p;
-
- switch(L0DRVR(drv_unit))
- {
- case L1DRVR_ISIC:
- printf("isic%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units);
- break;
- case L1DRVR_IWIC:
- printf("iwic%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units);
- break;
- case L1DRVR_IFPI:
- printf("ifpi%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units);
- break;
- case L1DRVR_IFPI2:
- printf("ifpi2-%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units);
- break;
- case L1DRVR_IFPNP:
- printf("ifpnp%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units);
- break;
- case L1DRVR_IHFC:
- printf("ihfc%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units);
- break;
- case L1DRVR_ITJC:
- printf("itjc%d: passive stack unit %d\n", L0UNIT(drv_unit), numl1units);
- break;
- }
-
- NDBGL1(L1_PRIM, "ATTACH drv %d, drvunit %d -> unit %d", L0DRVR(drv_unit), L0UNIT(drv_unit), numl1units);
-
- numl1units++;
- }
- }
-
- if((tab = getl1tab(L0DRVR(drv_unit))) == NULL)
- panic("i4b_l1_mph_status_ind: unknown driver type %d\n", L0DRVR(drv_unit));
-
- NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d\n", L0DRVR(drv_unit), L0UNIT(drv_unit), tab[L0UNIT(drv_unit)]);
-
- return(MPH_Status_Ind(tab[L0UNIT(drv_unit)], status, parm));
-}
-
-/*---------------------------------------------------------------------------*
- * L0 -> L1 data from hardware
- *---------------------------------------------------------------------------*/
-int
-i4b_l1_ph_data_ind(int drv_unit, struct mbuf *data)
-{
- register int *tab;
-
- if((tab = getl1tab(L0DRVR(drv_unit))) == NULL)
- panic("i4b_l1_ph_data_ind: unknown driver type %d\n", L0DRVR(drv_unit));
-
-#if 0
- NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d", L0DRVR(drv_unit), L0UNIT(drv_unit), tab[L0UNIT(drv_unit)]);
-#endif
-
- return(PH_Data_Ind(tab[L0UNIT(drv_unit)], data));
-}
-
-/*---------------------------------------------------------------------------*
- * L0 -> L1 activate indication from hardware
- *---------------------------------------------------------------------------*/
-int
-i4b_l1_ph_activate_ind(int drv_unit)
-{
- register int *tab;
-
- if((tab = getl1tab(L0DRVR(drv_unit))) == NULL)
- panic("i4b_l1_ph_activate_ind: unknown driver type %d\n", L0DRVR(drv_unit));
-
- NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d", L0DRVR(drv_unit), L0UNIT(drv_unit), tab[L0UNIT(drv_unit)]);
-
- return(PH_Act_Ind(tab[L0UNIT(drv_unit)]));
-}
-
-/*---------------------------------------------------------------------------*
- * L0 -> L1 deactivate indication from hardware
- *---------------------------------------------------------------------------*/
-int
-i4b_l1_ph_deactivate_ind(int drv_unit)
-{
- register int *tab;
-
- if((tab = getl1tab(L0DRVR(drv_unit))) == NULL)
- panic("i4b_l1_ph_deactivate_ind: unknown driver type %d\n", L0DRVR(drv_unit));
-
- NDBGL1(L1_PRIM, "(drv %d / drvunit %d) -> unit %d", L0DRVR(drv_unit), L0UNIT(drv_unit), tab[L0UNIT(drv_unit)]);
-
- return(PH_Deact_Ind(tab[L0UNIT(drv_unit)]));
-}
-
-/*---------------------------------------------------------------------------*
- * L2 -> L1 command to hardware
- *---------------------------------------------------------------------------*/
-int
-i4b_l1_mph_command_req(int unit, int command, void * parm)
-{
- register int drv_unit = L0DRVR(l1drvunittab[unit]);
- register int ch_unit = L0UNIT(l1drvunittab[unit]);
-
- NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit);
-
- if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL
- || l1mux_func[drv_unit]->mph_command_req == NULL)
- panic("i4b_l1_mph_command_req: unknown driver type %d\n", drv_unit);
-
- return(l1mux_func[drv_unit]->mph_command_req(ch_unit, command, parm));
-}
-
-/*---------------------------------------------------------------------------*
- * L2 -> L1 data to be transmitted to hardware
- *---------------------------------------------------------------------------*/
-static int
-i4b_l1_ph_data_req(int unit, struct mbuf *data, int flag)
-{
- register int drv_unit = L0DRVR(l1drvunittab[unit]);
- register int ch_unit = L0UNIT(l1drvunittab[unit]);
-
-#if 0
- NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit);
-#endif
-
- if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL
- || l1mux_func[drv_unit]->ph_data_req == NULL)
- panic("i4b_l1_ph_data_req: unknown driver type %d\n", drv_unit);
-
- return(l1mux_func[drv_unit]->ph_data_req(ch_unit, data, flag));
-}
-
-/*---------------------------------------------------------------------------*
- * L2 -> L1 activate request to hardware
- *---------------------------------------------------------------------------*/
-static int
-i4b_l1_ph_activate_req(int unit)
-{
- register int drv_unit = L0DRVR(l1drvunittab[unit]);
- register int ch_unit = L0UNIT(l1drvunittab[unit]);
-
- NDBGL1(L1_PRIM, "unit %d -> drv %d / drvunit %d", unit, drv_unit, ch_unit);
-
- if (drv_unit >= MAXL1DRVR || l1mux_func[drv_unit] == NULL
- || l1mux_func[drv_unit]->ph_activate_req == NULL)
- panic("i4b_l1_ph_activate_req: unknown driver type %d\n", drv_unit);
-
- return(l1mux_func[drv_unit]->ph_activate_req(ch_unit));
-}
-
-/* EOF */
diff --git a/sys/i4b/layer1/i4b_l1lib.c b/sys/i4b/layer1/i4b_l1lib.c
deleted file mode 100644
index abce3bd..0000000
--- a/sys/i4b/layer1/i4b_l1lib.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * Copyright (c) 2000 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_l1lib.c - general useful L1 procedures
- * ------------------------------------------
- * $Id: i4b_l1lib.c,v 1.3 2000/05/29 15:41:41 hm Exp $
- * last edit-date: [Mon May 29 15:24:21 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#define TEL_IDLE_MIN (BCH_MAX_DATALEN/2)
-
-/*---------------------------------------------------------------------------*
- * telephony silence detection
- *---------------------------------------------------------------------------*/
-int
-i4b_l1_bchan_tel_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("i4b_l1_bchan_tel_silence: got %d silence bytes in frame\n", j);
-#endif
-
- if(j < (TEL_IDLE_MIN))
- return(0);
- else
- return(1);
-
-}
diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_ext.h b/sys/i4b/layer1/ifpi/i4b_ifpi_ext.h
deleted file mode 100644
index 127f1e3..0000000
--- a/sys/i4b/layer1/ifpi/i4b_ifpi_ext.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 2000 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.
- *
- * 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_ifpi - Fritz!Card PCI for split layers
- * ------------------------------------------
- *
- * $Id: i4b_ifpi_ext.h,v 1.2 2000/06/02 16:14:36 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Fri Jun 2 14:53:31 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IFPI_EXT_H_
-#define _I4B_IFPI_EXT_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-void ifpi_set_linktab(int unit, int channel, drvr_link_t * dlt);
-isdn_link_t *ifpi_ret_linktab(int unit, int channel);
-
-int ifpi_ph_data_req(int unit, struct mbuf *m, int freeflag);
-int ifpi_ph_activate_req(int unit);
-int ifpi_mph_command_req(int unit, int command, void *parm);
-
-void ifpi_isac_irq(struct l1_softc *sc, int ista);
-void ifpi_isac_l1_cmd(struct l1_softc *sc, int command);
-int ifpi_isac_init(struct l1_softc *sc);
-
-void ifpi_recover(struct l1_softc *sc);
-char * ifpi_printstate(struct l1_softc *sc);
-void ifpi_next_state(struct l1_softc *sc, int event);
-
-#define IFPI_MAXUNIT 4
-extern struct l1_softc *ifpi_scp[IFPI_MAXUNIT];
-
-#endif /* _I4B_IFPI_EXT_H_ */
diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_isac.c b/sys/i4b/layer1/ifpi/i4b_ifpi_isac.c
deleted file mode 100644
index e97b2df..0000000
--- a/sys/i4b/layer1/ifpi/i4b_ifpi_isac.c
+++ /dev/null
@@ -1,658 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 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_ifpi_isac.c - i4b Fritz PCI ISAC handler
- * --------------------------------------------
- * $Id: i4b_ifpi_isac.c,v 1.3 2000/05/29 15:41:41 hm Exp $
- * last edit-date: [Mon May 29 15:22:52 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/layer1/ifpi/i4b_ifpi_ext.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char ifpi_isac_exir_hdlr(register struct l1_softc *sc, u_char exir);
-static void ifpi_isac_ind_hdlr(register struct l1_softc *sc, int ind);
-
-/*---------------------------------------------------------------------------*
- * ISAC interrupt service routine
- *---------------------------------------------------------------------------*/
-void
-ifpi_isac_irq(struct l1_softc *sc, int ista)
-{
- register u_char c = 0;
- NDBGL1(L1_F_MSG, "unit %d: ista = 0x%02x", sc->sc_unit, ista);
-
- if(ista & ISAC_ISTA_EXI) /* extended interrupt */
- {
- c |= ifpi_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++;
- NDBGL1(L1_I_ERR, "unit %d: CRC error", sc->sc_unit);
- }
-
- if(rsta & ISAC_RSTA_RDO) /* ReceiveDataOverflow */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Data Overrun error", sc->sc_unit);
- }
-
- if(rsta & ISAC_RSTA_RAB) /* ReceiveABorted */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Receive Aborted error", sc->sc_unit);
- }
-
- if(error == 0)
- NDBGL1(L1_I_ERR, "unit %d: RME unknown error, RSTA = 0x%02x!", 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("ifpi_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 = L0IFPIUNIT(sc->sc_unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, sc->sc_ibuf->m_len, sc->sc_ibuf->m_data);
- }
-
- c |= ISAC_CMDR_RMC;
-
- if(sc->sc_enabled &&
- (ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S))
- {
- i4b_l1_ph_data_ind(L0IFPIUNIT(sc->sc_unit), sc->sc_ibuf);
- }
- else
- {
- i4b_Dfreembuf(sc->sc_ibuf);
- }
- }
- else
- {
- NDBGL1(L1_I_ERR, "RME, input buffer overflow!");
- 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("ifpi_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
- {
- NDBGL1(L1_I_ERR, "RPF, input buffer overflow!");
- 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)
- ifpi_isac_ind_hdlr(sc, (ci >> 2) & 0xf);
- }
-
- if(c)
- {
- ISAC_WRITE(I_CMDR, c);
- ISACCMDRWRDELAY();
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Extended IRQ handler
- *---------------------------------------------------------------------------*/
-static u_char
-ifpi_isac_exir_hdlr(register struct l1_softc *sc, u_char exir)
-{
- u_char c = 0;
-
- if(exir & ISAC_EXIR_XMR)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Message Repeat");
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_XDU)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Data Underrun");
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_PCE)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Protocol Error");
- }
-
- if(exir & ISAC_EXIR_RFO)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Rx Frame Overflow");
-
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
-
- if(exir & ISAC_EXIR_SOV)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Sync Xfer Overflow");
- }
-
- if(exir & ISAC_EXIR_MOS)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Monitor Status");
- }
-
- if(exir & ISAC_EXIR_SAW)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Subscriber Awake");
- }
-
- if(exir & ISAC_EXIR_WOV)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Watchdog Timer Overflow");
- }
-
- return(c);
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Indication handler
- *---------------------------------------------------------------------------*/
-static void
-ifpi_isac_ind_hdlr(register struct l1_softc *sc, int ind)
-{
- register int event;
-
- switch(ind)
- {
- case ISAC_CIRR_IAI8:
- NDBGL1(L1_I_CICO, "rx AI8 in state %s", ifpi_printstate(sc));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- ifpi_isac_l1_cmd(sc, CMD_AR8);
- event = EV_INFO48;
- i4b_l1_mph_status_ind(L0IFPIUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISAC_CIRR_IAI10:
- NDBGL1(L1_I_CICO, "rx AI10 in state %s", ifpi_printstate(sc));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- ifpi_isac_l1_cmd(sc, CMD_AR10);
- event = EV_INFO410;
- i4b_l1_mph_status_ind(L0IFPIUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISAC_CIRR_IRSY:
- NDBGL1(L1_I_CICO, "rx RSY in state %s", ifpi_printstate(sc));
- event = EV_RSY;
- break;
-
- case ISAC_CIRR_IPU:
- NDBGL1(L1_I_CICO, "rx PU in state %s", ifpi_printstate(sc));
- event = EV_PU;
- break;
-
- case ISAC_CIRR_IDR:
- NDBGL1(L1_I_CICO, "rx DR in state %s", ifpi_printstate(sc));
- ifpi_isac_l1_cmd(sc, CMD_DIU);
- event = EV_DR;
- break;
-
- case ISAC_CIRR_IDID:
- NDBGL1(L1_I_CICO, "rx DID in state %s", ifpi_printstate(sc));
- event = EV_INFO0;
- i4b_l1_mph_status_ind(L0IFPIUNIT(sc->sc_unit), STI_L1STAT, LAYER_IDLE, NULL);
- break;
-
- case ISAC_CIRR_IDIS:
- NDBGL1(L1_I_CICO, "rx DIS in state %s", ifpi_printstate(sc));
- event = EV_DIS;
- break;
-
- case ISAC_CIRR_IEI:
- NDBGL1(L1_I_CICO, "rx EI in state %s", ifpi_printstate(sc));
- ifpi_isac_l1_cmd(sc, CMD_DIU);
- event = EV_EI;
- break;
-
- case ISAC_CIRR_IARD:
- NDBGL1(L1_I_CICO, "rx ARD in state %s", ifpi_printstate(sc));
- event = EV_INFO2;
- break;
-
- case ISAC_CIRR_ITI:
- NDBGL1(L1_I_CICO, "rx TI in state %s", ifpi_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_IATI:
- NDBGL1(L1_I_CICO, "rx ATI in state %s", ifpi_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_ISD:
- NDBGL1(L1_I_CICO, "rx SD in state %s", ifpi_printstate(sc));
- event = EV_INFO0;
- break;
-
- default:
- NDBGL1(L1_I_ERR, "UNKNOWN Indication 0x%x in state %s", ind, ifpi_printstate(sc));
- event = EV_INFO0;
- break;
- }
- ifpi_next_state(sc, event);
-}
-
-/*---------------------------------------------------------------------------*
- * execute a layer 1 command
- *---------------------------------------------------------------------------*/
-void
-ifpi_isac_l1_cmd(struct l1_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)
- {
- NDBGL1(L1_I_ERR, "illegal cmd 0x%x in state %s", command, ifpi_printstate(sc));
- return;
- }
-
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- cmd = ISAC_CIX0_LOW;
- else
- cmd = 0;
-
- switch(command)
- {
- case CMD_TIM:
- NDBGL1(L1_I_CICO, "tx TIM in state %s", ifpi_printstate(sc));
- cmd |= (ISAC_CIXR_CTIM << 2);
- break;
-
- case CMD_RS:
- NDBGL1(L1_I_CICO, "tx RS in state %s", ifpi_printstate(sc));
- cmd |= (ISAC_CIXR_CRS << 2);
- break;
-
- case CMD_AR8:
- NDBGL1(L1_I_CICO, "tx AR8 in state %s", ifpi_printstate(sc));
- cmd |= (ISAC_CIXR_CAR8 << 2);
- break;
-
- case CMD_AR10:
- NDBGL1(L1_I_CICO, "tx AR10 in state %s", ifpi_printstate(sc));
- cmd |= (ISAC_CIXR_CAR10 << 2);
- break;
-
- case CMD_DIU:
- NDBGL1(L1_I_CICO, "tx DIU in state %s", ifpi_printstate(sc));
- cmd |= (ISAC_CIXR_CDIU << 2);
- break;
- }
- ISAC_WRITE(I_CIXR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * L1 ISAC initialization
- *---------------------------------------------------------------------------*/
-int
-ifpi_isac_init(struct l1_softc *sc)
-{
- ISAC_IMASK = 0xff; /* disable all irqs */
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- if(sc->sc_bustyp != BUS_TYPE_IOM2)
- {
- NDBGL1(L1_I_SETUP, "configuring for IOM-1 mode");
-
- /* 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
- {
- NDBGL1(L1_I_SETUP, "configuring for IOM-2 mode");
-
- /* 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);
-}
diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_l1.c b/sys/i4b/layer1/ifpi/i4b_ifpi_l1.c
deleted file mode 100644
index da63967..0000000
--- a/sys/i4b/layer1/ifpi/i4b_ifpi_l1.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 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_ifpi_l1.c - AVM Fritz PCI layer 1 handler
- * ---------------------------------------------
- * $Id: i4b_ifpi_l1.c,v 1.4 2000/06/02 16:14:36 hm Exp $
- * last edit-date: [Fri Jun 2 14:54:30 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-
-#include <i4b/layer1/ifpi/i4b_ifpi_ext.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-/*---------------------------------------------------------------------------*
- *
- * 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
- *
- *---------------------------------------------------------------------------*/
-int
-ifpi_ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- u_char cmd;
- int s;
- struct l1_softc *sc = ifpi_scp[unit];
-
-#ifdef NOTDEF
- NDBGL1(L1_PRIM, "PH-DATA-REQ, unit %d, freeflag=%d", unit, freeflag);
-#endif
-
- if(m == NULL) /* failsafe */
- return (0);
-
- s = SPLI4B();
-
- if(sc->sc_I430state == ST_F3) /* layer 1 not running ? */
- {
- NDBGL1(L1_I_ERR, "still in state F3!");
- ifpi_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 */
-
- NDBGL1(L1_I_MSG, "using 2nd ISAC TX buffer, state = %s", ifpi_printstate(sc));
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = L0IFPIUNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
- splx(s);
- return(1);
- }
-
- NDBGL1(L1_I_ERR, "No Space in TX FIFO, state = %s", ifpi_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 = L0IFPIUNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
-
- sc->sc_state |= ISAC_TX_ACTIVE; /* set transmitter busy flag */
-
- NDBGL1(L1_I_MSG, "ISAC_TX_ACTIVE set");
-
- 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
- *
- *---------------------------------------------------------------------------*/
-int
-ifpi_ph_activate_req(int unit)
-{
- struct l1_softc *sc = ifpi_scp[unit];
- NDBGL1(L1_PRIM, "PH-ACTIVATE-REQ, unit %d", unit);
- ifpi_next_state(sc, EV_PHAR);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * command from the upper layers
- *---------------------------------------------------------------------------*/
-int
-ifpi_mph_command_req(int unit, int command, void *parm)
-{
- struct l1_softc *sc = ifpi_scp[unit];
-
- switch(command)
- {
- case CMR_DOPEN: /* daemon running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DOPEN", unit);
- sc->sc_enabled = 1;
- break;
-
- case CMR_DCLOSE: /* daemon not running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DCLOSE", unit);
- sc->sc_enabled = 0;
- break;
-
- case CMR_SETTRACE:
- NDBGL1(L1_PRIM, "unit %d, command = CMR_SETTRACE, parm = %d", unit, (unsigned int)parm);
- sc->sc_trace = (unsigned int)parm;
- break;
-
- default:
- NDBGL1(L1_ERROR, "ERROR, unknown command = %d, unit = %d, parm = %d", command, unit, (unsigned int)parm);
- break;
- }
-
- return(0);
-}
diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_l1fsm.c b/sys/i4b/layer1/ifpi/i4b_ifpi_l1fsm.c
deleted file mode 100644
index b053206..0000000
--- a/sys/i4b/layer1/ifpi/i4b_ifpi_l1fsm.c
+++ /dev/null
@@ -1,509 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 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_ifpi_l1fsm.c - AVM Fritz PCI layer 1 I.430 state machine
- * ------------------------------------------------------------
- * $Id: i4b_ifpi_l1fsm.c,v 1.4 2000/05/29 15:41:41 hm Exp $
- * last edit-date: [Mon May 29 15:23:15 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/ifpi/i4b_ifpi_ext.h>
-
-#if DO_I4B_DEBUG
-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"
-};
-#endif
-
-/* Function prototypes */
-
-static void timer3_expired (struct l1_softc *sc);
-static void T3_start (struct l1_softc *sc);
-static void T3_stop (struct l1_softc *sc);
-static void F_T3ex (struct l1_softc *sc);
-static void timer4_expired (struct l1_softc *sc);
-static void T4_start (struct l1_softc *sc);
-static void T4_stop (struct l1_softc *sc);
-static void F_AI8 (struct l1_softc *sc);
-static void F_AI10 (struct l1_softc *sc);
-static void F_I01 (struct l1_softc *sc);
-static void F_I02 (struct l1_softc *sc);
-static void F_I03 (struct l1_softc *sc);
-static void F_I2 (struct l1_softc *sc);
-static void F_ill (struct l1_softc *sc);
-static void F_NULL (struct l1_softc *sc);
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer3_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T3)
- {
- NDBGL1(L1_T_ERR, "state = %s", ifpi_printstate(sc));
- sc->sc_I430T3 = 0;
-
- /* XXX try some recovery here XXX */
-
- ifpi_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);
-
- i4b_l1_mph_status_ind(L0IFPIUNIT(sc->sc_unit), STI_NOL1ACC, 0, NULL);
- }
-
- ifpi_next_state(sc, EV_T3);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 start
- *---------------------------------------------------------------------------*/
-static void
-T3_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpi_printstate(sc));
- sc->sc_I430T3 = 1;
- sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 stop
- *---------------------------------------------------------------------------*/
-static void
-T3_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpi_printstate(sc));
-
- sc->sc_init_tries = 0; /* init connect retry count */
-
- if(sc->sc_I430T3)
- {
- sc->sc_I430T3 = 0;
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_T3ex(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_T3ex executing");
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPIUNIT(sc->sc_unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer4_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T4)
- {
- NDBGL1(L1_T_MSG, "state = %s", ifpi_printstate(sc));
- sc->sc_I430T4 = 0;
- i4b_l1_mph_status_ind(L0IFPIUNIT(sc->sc_unit), STI_PDEACT, 0, NULL);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 start
- *---------------------------------------------------------------------------*/
-static void
-T4_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpi_printstate(sc));
- sc->sc_I430T4 = 1;
- sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 stop
- *---------------------------------------------------------------------------*/
-static void
-T4_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpi_printstate(sc));
-
- if(sc->sc_I430T4)
- {
- sc->sc_I430T4 = 0;
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI8
- *---------------------------------------------------------------------------*/
-static void
-F_AI8(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI8 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0IFPIUNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_8;
-
- hdr.unit = L0IFPIUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI10
- *---------------------------------------------------------------------------*/
-static void
-F_AI10(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI10 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0IFPIUNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_10;
-
- hdr.unit = L0IFPIUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in states F3 .. F5
- *---------------------------------------------------------------------------*/
-static void
-F_I01(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I01 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPIUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F6
- *---------------------------------------------------------------------------*/
-static void
-F_I02(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I02 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPIUNIT(sc->sc_unit));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPIUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F7 or F8
- *---------------------------------------------------------------------------*/
-static void
-F_I03(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I03 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPIUNIT(sc->sc_unit));
-
- T4_start(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPIUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: activate request
- *---------------------------------------------------------------------------*/
-static void
-F_AR(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AR executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO1_8;
-
- hdr.unit = L0IFPIUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_TE;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
- ifpi_isac_l1_cmd(sc, CMD_AR8);
-
- T3_start(sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO2
- *---------------------------------------------------------------------------*/
-static void
-F_I2(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I2 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO2;
-
- hdr.unit = L0IFPIUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
-}
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(struct l1_softc *sc)
-{
- NDBGL1(L1_F_ERR, "FSM function F_ill executing");
-}
-
-/*---------------------------------------------------------------------------*
- * No action
- *---------------------------------------------------------------------------*/
-static void
-F_NULL(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_NULL executing");
-}
-
-
-/*---------------------------------------------------------------------------*
- * layer 1 state transition table
- *---------------------------------------------------------------------------*/
-struct ifpi_state_tab {
- void (*func) (struct l1_softc *sc); /* function to execute */
- int newstate; /* next state */
-} ifpi_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
-ifpi_next_state(struct l1_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 = ifpi_state_tab[event][currstate].newstate;
-
- if(newstate >= N_STATES)
- panic("i4b_l1fsm.c: newstate >= N_STATES\n");
-
- NDBGL1(L1_F_MSG, "FSM event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[newstate]);
-
- (*ifpi_state_tab[event][currstate].func)(sc);
-
- if(newstate == ST_ILL)
- {
- newstate = ST_F3;
- NDBGL1(L1_F_ERR, "FSM Illegal State ERROR, oldstate = %s, newstate = %s, event = %s!",
- state_text[currstate],
- state_text[newstate],
- event_text[event]);
- }
-
- sc->sc_I430state = newstate;
-}
-
-#if DO_I4B_DEBUG
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-ifpi_printstate(struct l1_softc *sc)
-{
- return((char *) state_text[sc->sc_I430state]);
-}
-#endif
diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
deleted file mode 100644
index 2b67432..0000000
--- a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c
+++ /dev/null
@@ -1,1494 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 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.
- */
-
-/*---------------------------------------------------------------------------
- *
- * i4b_ifpi_pci.c: AVM Fritz!Card PCI hardware driver
- * --------------------------------------------------
- * $Id: i4b_ifpi_pci.c,v 1.4 2000/06/02 11:58:56 hm Exp $
- * last edit-date: [Fri Jan 12 17:01:26 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <machine/bus.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/layer1/ifpi/i4b_ifpi_ext.h>
-
-#define PCI_AVMA1_VID 0x1244
-#define PCI_AVMA1_DID 0x0a00
-
-/* prototypes */
-
-static void avma1pp_disable(device_t);
-static void avma1pp_intr(void *);
-static void hscx_write_reg(int, u_int, u_int, struct l1_softc *);
-static u_char hscx_read_reg(int, u_int, struct l1_softc *);
-static u_int hscx_read_reg_int(int, u_int, struct l1_softc *);
-static void hscx_read_fifo(int, void *, size_t, struct l1_softc *);
-static void hscx_write_fifo(int, void *, size_t, struct l1_softc *);
-static void avma1pp_hscx_int_handler(struct l1_softc *);
-static void avma1pp_hscx_intr(int, u_int, struct l1_softc *);
-static void avma1pp_init_linktab(struct l1_softc *);
-static void avma1pp_bchannel_setup(int, int, int, int);
-static void avma1pp_bchannel_start(int, int);
-static void avma1pp_hscx_init(struct l1_softc *, int, int);
-static void avma1pp_bchannel_stat(int, int, bchan_statistics_t *);
-static void avma1pp_set_linktab(int, int, drvr_link_t *);
-static isdn_link_t * avma1pp_ret_linktab(int, int);
-static int avma1pp_pci_probe(device_t);
-static int avma1pp_hscx_fifo(l1_bchan_state_t *, struct l1_softc *);
-int avma1pp_attach_avma1pp(device_t);
-static void ifpi_isac_intr(struct l1_softc *sc);
-
-static device_method_t avma1pp_pci_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, avma1pp_pci_probe),
- DEVMETHOD(device_attach, avma1pp_attach_avma1pp),
- DEVMETHOD(device_shutdown, avma1pp_disable),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, bus_generic_print_child),
- DEVMETHOD(bus_driver_added, bus_generic_driver_added),
-
- { 0, 0 }
-};
-
-#if 0 /* use what's in l1_softc */
-/* a minimal softc for the Fritz!Card PCI */
-struct avma1pp_softc
-{
- bus_space_handle_t avma1pp_bhandle;
- bus_space_tag_t avma1pp_btag;
- void *avma1pp_intrhand;
- struct resource *avma1pp_irq;
- struct resource *avma1pp_res;
- /* pointer to ifpi_sc */
- struct l1_softc *avma1pp_isc;
-};
-#endif
-
-static driver_t avma1pp_pci_driver = {
- "ifpi",
- avma1pp_pci_methods,
- sizeof(struct l1_softc)
-};
-
-static devclass_t avma1pp_pci_devclass;
-
-DRIVER_MODULE(avma1pp, pci, avma1pp_pci_driver, avma1pp_pci_devclass, 0, 0);
-
-/* jump table for multiplex routines */
-
-struct i4b_l1mux_func avma1pp_l1mux_func = {
- avma1pp_ret_linktab,
- avma1pp_set_linktab,
- ifpi_mph_command_req,
- ifpi_ph_data_req,
- ifpi_ph_activate_req,
-};
-
-struct l1_softc *ifpi_scp[IFPI_MAXUNIT];
-
-/*---------------------------------------------------------------------------*
- * AVM PCI Fritz!Card special registers
- *---------------------------------------------------------------------------*/
-
-/*
- * register offsets from i/o base
- */
-#define STAT0_OFFSET 0x02
-#define STAT1_OFFSET 0x03
-#define ADDR_REG_OFFSET 0x04
-/*#define MODREG_OFFSET 0x06
-#define VERREG_OFFSET 0x07*/
-
-/* these 2 are used to select an ISAC register set */
-#define ISAC_LO_REG_OFFSET 0x04
-#define ISAC_HI_REG_OFFSET 0x06
-
-/* offset higher than this goes to the HI register set */
-#define MAX_LO_REG_OFFSET 0x2f
-
-/* mask for the offset */
-#define ISAC_REGSET_MASK 0x0f
-
-/* the offset from the base to the ISAC registers */
-#define ISAC_REG_OFFSET 0x10
-
-/* the offset from the base to the ISAC FIFO */
-#define ISAC_FIFO 0x02
-
-/* not really the HSCX, but sort of */
-#define HSCX_FIFO 0x00
-#define HSCX_STAT 0x04
-
-/*
- * AVM PCI Status Latch 0 read only bits
- */
-#define ASL_IRQ_ISAC 0x01 /* ISAC interrupt, active low */
-#define ASL_IRQ_HSCX 0x02 /* HSX interrupt, active low */
-#define ASL_IRQ_TIMER 0x04 /* Timer interrupt, active low */
-#define ASL_IRQ_BCHAN ASL_IRQ_HSCX
-/* actually active LOW */
-#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 */
-#define ASL_TESTBIT 0x10 /* active high */
-
-/*
- * AVM Status Latch 1 write only bits
- */
-#define ASL1_INTSEL 0x0f /* active high */
-#define ASL1_ENABLE_IOM 0x80 /* active high */
-
-/*
- * "HSCX" mode bits
- */
-#define HSCX_MODE_ITF_FLG 0x01
-#define HSCX_MODE_TRANS 0x02
-#define HSCX_MODE_CCR_7 0x04
-#define HSCX_MODE_CCR_16 0x08
-#define HSCX_MODE_TESTLOOP 0x80
-
-/*
- * "HSCX" status bits
- */
-#define HSCX_STAT_RME 0x01
-#define HSCX_STAT_RDO 0x10
-#define HSCX_STAT_CRCVFRRAB 0x0E
-#define HSCX_STAT_CRCVFR 0x06
-#define HSCX_STAT_RML_MASK 0x3f00
-
-/*
- * "HSCX" interrupt bits
- */
-#define HSCX_INT_XPR 0x80
-#define HSCX_INT_XDU 0x40
-#define HSCX_INT_RPR 0x20
-#define HSCX_INT_MASK 0xE0
-
-/*
- * "HSCX" command bits
- */
-#define HSCX_CMD_XRS 0x80
-#define HSCX_CMD_XME 0x01
-#define HSCX_CMD_RRS 0x20
-#define HSCX_CMD_XML_MASK 0x3f00
-
-/*
- * Commands and parameters are sent to the "HSCX" as a long, but the
- * fields are handled as bytes.
- *
- * The long contains:
- * (prot << 16)|(txl << 8)|cmd
- *
- * where:
- * prot = protocol to use
- * txl = transmit length
- * cmd = the command to be executed
- *
- * The fields are defined as u_char in struct l1_softc.
- *
- * Macro to coalesce the byte fields into a u_int
- */
-#define AVMA1PPSETCMDLONG(f) (f) = ((sc->avma1pp_cmd) | (sc->avma1pp_txl << 8) \
- | (sc->avma1pp_prot << 16))
-
-/*
- * to prevent deactivating the "HSCX" when both channels are active we
- * define an HSCX_ACTIVE flag which is or'd into the channel's state
- * flag in avma1pp_bchannel_setup upon active and cleared upon deactivation.
- * It is set high to allow room for new flags.
- */
-#define HSCX_AVMA1PP_ACTIVE 0x1000
-
-/*---------------------------------------------------------------------------*
- * AVM read fifo routines
- *---------------------------------------------------------------------------*/
-
-static void
-avma1pp_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, ISAC_FIFO);
- bus_space_read_multi_1(btag, bhandle, ISAC_REG_OFFSET, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_read_fifo(0, buf, size, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_read_fifo(1, buf, size, sc);
- break;
- }
-}
-
-static void
-hscx_read_fifo(int chan, void *buf, size_t len, struct l1_softc *sc)
-{
- u_int32_t *ip;
- size_t cnt;
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- bus_space_write_4(btag, bhandle, ADDR_REG_OFFSET, chan);
- ip = (u_int32_t *)buf;
- cnt = 0;
- /* what if len isn't a multiple of sizeof(int) and buf is */
- /* too small ???? */
- while (cnt < len)
- {
- *ip++ = bus_space_read_4(btag, bhandle, ISAC_REG_OFFSET);
- cnt += 4;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * AVM write fifo routines
- *---------------------------------------------------------------------------*/
-static void
-avma1pp_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, ISAC_FIFO);
- bus_space_write_multi_1(btag, bhandle, ISAC_REG_OFFSET, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_write_fifo(0, buf, size, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_write_fifo(1, buf, size, sc);
- break;
- }
-}
-
-static void
-hscx_write_fifo(int chan, void *buf, size_t len, struct l1_softc *sc)
-{
- u_int32_t *ip;
- size_t cnt;
- l1_bchan_state_t *Bchan = &sc->sc_chan[chan];
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
-
- sc->avma1pp_cmd &= ~HSCX_CMD_XME;
- sc->avma1pp_txl = 0;
- if (Bchan->out_mbuf_cur == NULL)
- {
- if (Bchan->bprot != BPROT_NONE)
- sc->avma1pp_cmd |= HSCX_CMD_XME;
- }
- if (len != sc->sc_bfifolen)
- sc->avma1pp_txl = len;
-
- cnt = 0; /* borrow cnt */
- AVMA1PPSETCMDLONG(cnt);
- hscx_write_reg(chan, HSCX_STAT, cnt, sc);
-
- ip = (u_int32_t *)buf;
- cnt = 0;
- while (cnt < len)
- {
- bus_space_write_4(btag, bhandle, ISAC_REG_OFFSET, *ip);
- ip++;
- cnt += 4;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * AVM write register routines
- *---------------------------------------------------------------------------*/
-
-static void
-avma1pp_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- u_char reg_bank;
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- reg_bank = (offs > MAX_LO_REG_OFFSET) ? ISAC_HI_REG_OFFSET:ISAC_LO_REG_OFFSET;
-#ifdef AVMA1PCI_DEBUG
- printf("write_reg bank %d off %ld.. ", (int)reg_bank, (long)offs);
-#endif
- /* set the register bank */
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, reg_bank);
- bus_space_write_1(btag, bhandle, ISAC_REG_OFFSET + (offs & ISAC_REGSET_MASK), data);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_write_reg(0, offs, data, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_write_reg(1, offs, data, sc);
- break;
- }
-}
-
-static void
-hscx_write_reg(int chan, u_int off, u_int val, struct l1_softc *sc)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* point at the correct channel */
- bus_space_write_4(btag, bhandle, ADDR_REG_OFFSET, chan);
- bus_space_write_4(btag, bhandle, ISAC_REG_OFFSET + off, val);
-}
-
-/*---------------------------------------------------------------------------*
- * AVM read register routines
- *---------------------------------------------------------------------------*/
-static u_int8_t
-avma1pp_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- u_char reg_bank;
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- reg_bank = (offs > MAX_LO_REG_OFFSET) ? ISAC_HI_REG_OFFSET:ISAC_LO_REG_OFFSET;
-#ifdef AVMA1PCI_DEBUG
- printf("read_reg bank %d off %ld.. ", (int)reg_bank, (long)offs);
-#endif
- /* set the register bank */
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, reg_bank);
- return(bus_space_read_1(btag, bhandle, ISAC_REG_OFFSET +
- (offs & ISAC_REGSET_MASK)));
- case ISIC_WHAT_HSCXA:
- return hscx_read_reg(0, offs, sc);
- case ISIC_WHAT_HSCXB:
- return hscx_read_reg(1, offs, sc);
- }
- return 0;
-}
-
-static u_char
-hscx_read_reg(int chan, u_int off, struct l1_softc *sc)
-{
- return(hscx_read_reg_int(chan, off, sc) & 0xff);
-}
-
-/*
- * need to be able to return an int because the RBCH is in the 2nd
- * byte.
- */
-static u_int
-hscx_read_reg_int(int chan, u_int off, struct l1_softc *sc)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* point at the correct channel */
- bus_space_write_4(btag, bhandle, ADDR_REG_OFFSET, chan);
- return(bus_space_read_4(btag, bhandle, ISAC_REG_OFFSET + off));
-}
-
-/*---------------------------------------------------------------------------*
- * avma1pp_probe - probe for a card
- *---------------------------------------------------------------------------*/
-static int
-avma1pp_pci_probe(dev)
- device_t dev;
-{
- u_int16_t did, vid;
-
- vid = pci_get_vendor(dev);
- did = pci_get_device(dev);
-
- if ((vid == PCI_AVMA1_VID) && (did == PCI_AVMA1_DID)) {
- device_set_desc(dev, "AVM Fritz!Card PCI");
- return(0);
- }
-
- return(ENXIO);
-}
-
-/*---------------------------------------------------------------------------*
- * avma1pp_attach_avma1pp - attach Fritz!Card PCI
- *---------------------------------------------------------------------------*/
-int
-avma1pp_attach_avma1pp(device_t dev)
-{
- struct l1_softc *sc;
- u_int v;
- int unit, error = 0;
- int s;
- u_int16_t did, vid;
- void *ih = 0;
- bus_space_handle_t bhandle;
- bus_space_tag_t btag;
- l1_bchan_state_t *chan;
-
- s = splimp();
-
- vid = pci_get_vendor(dev);
- did = pci_get_device(dev);
- sc = device_get_softc(dev);
- unit = device_get_unit(dev);
- bzero(sc, sizeof(struct l1_softc));
-
- /* probably not really required */
- if(unit >= IFPI_MAXUNIT) {
- printf("avma1pp%d: Error, unit >= IFPI_MAXUNIT!\n", unit);
- splx(s);
- return(ENXIO);
- }
-
- if ((vid != PCI_AVMA1_VID) && (did != PCI_AVMA1_DID)) {
- printf("avma1pp%d: unknown device!?\n", unit);
- goto fail;
- }
-
- ifpi_scp[unit] = sc;
-
- sc->sc_resources.io_rid[0] = PCIR_BAR(1);
- sc->sc_resources.io_base[0] = bus_alloc_resource_any(dev,
- SYS_RES_IOPORT, &sc->sc_resources.io_rid[0], RF_ACTIVE);
-
- if (sc->sc_resources.io_base[0] == NULL) {
- printf("avma1pp%d: couldn't map IO port\n", unit);
- error = ENXIO;
- goto fail;
- }
-
- bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* Allocate interrupt */
- sc->sc_resources.irq_rid = 0;
- sc->sc_resources.irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid, RF_SHAREABLE | RF_ACTIVE);
-
- if (sc->sc_resources.irq == NULL) {
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]);
- printf("avma1pp%d: couldn't map interrupt\n", unit);
- error = ENXIO;
- goto fail;
- }
-
- error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, NULL, avma1pp_intr, sc, &ih);
-
- if (error) {
- bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_resources.irq);
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]);
- printf("avma1pp%d: couldn't set up irq\n", unit);
- goto fail;
- }
-
- sc->sc_unit = unit;
-
- /* end of new-bus stuff */
-
- ISAC_BASE = (caddr_t)ISIC_WHAT_ISAC;
-
- HSCX_A_BASE = (caddr_t)ISIC_WHAT_HSCXA;
- HSCX_B_BASE = (caddr_t)ISIC_WHAT_HSCXB;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = avma1pp_read_reg;
- sc->writereg = avma1pp_write_reg;
-
- sc->readfifo = avma1pp_read_fifo;
- sc->writefifo = avma1pp_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_AVMA1PCI;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* set up some other miscellaneous things */
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* reset the card */
- /* the Linux driver does this to clear any pending ISAC interrupts */
- v = 0;
- v = ISAC_READ(I_STAR);
-#ifdef AVMA1PCI_DEBUG
- printf("avma1pp_attach: I_STAR %x...", v);
-#endif
- v = ISAC_READ(I_MODE);
-#ifdef AVMA1PCI_DEBUG
- printf("avma1pp_attach: I_MODE %x...", v);
-#endif
- v = ISAC_READ(I_ADF2);
-#ifdef AVMA1PCI_DEBUG
- printf("avma1pp_attach: I_ADF2 %x...", v);
-#endif
- v = ISAC_READ(I_ISTA);
-#ifdef AVMA1PCI_DEBUG
- printf("avma1pp_attach: I_ISTA %x...", v);
-#endif
- if (v & ISAC_ISTA_EXI)
- {
- v = ISAC_READ(I_EXIR);
-#ifdef AVMA1PCI_DEBUG
- printf("avma1pp_attach: I_EXIR %x...", v);
-#endif
- }
- v = ISAC_READ(I_CIRR);
-#ifdef AVMA1PCI_DEBUG
- printf("avma1pp_attach: I_CIRR %x...", v);
-#endif
- ISAC_WRITE(I_MASK, 0xff);
- /* the Linux driver does this to clear any pending HSCX interrupts */
- v = hscx_read_reg_int(0, HSCX_STAT, sc);
-#ifdef AVMA1PCI_DEBUG
- printf("avma1pp_attach: 0 HSCX_STAT %x...", v);
-#endif
- v = hscx_read_reg_int(1, HSCX_STAT, sc);
-#ifdef AVMA1PCI_DEBUG
- printf("avma1pp_attach: 1 HSCX_STAT %x\n", v);
-#endif
-
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, ASL_RESET_ALL|ASL_TIMERDISABLE);
- DELAY(SEC_DELAY/100); /* 10 ms */
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, ASL_TIMERRESET|ASL_ENABLE_INT|ASL_TIMERDISABLE);
- DELAY(SEC_DELAY/100); /* 10 ms */
-#ifdef AVMA1PCI_DEBUG
- bus_space_write_1(btag, bhandle, STAT1_OFFSET, ASL1_ENABLE_IOM|sc->sc_irq);
- DELAY(SEC_DELAY/100); /* 10 ms */
- v = bus_space_read_1(btag, bhandle, STAT1_OFFSET);
- printf("after reset: S1 %#x\n", v);
-
- v = bus_space_read_4(btag, bhandle, 0);
- printf("avma1pp_attach_avma1pp: v %#x\n", v);
-#endif
-
- /* from here to the end would normally be done in isic_pciattach */
-
- printf("ifpi%d: ISAC %s (IOM-%c)\n", unit,
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
-
- /* init the ISAC */
- ifpi_isac_init(sc);
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- /* Init the channel mutexes */
- chan = &sc->sc_chan[HSCX_CH_A];
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", NULL, MTX_DEF);
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", NULL, MTX_DEF);
- chan = &sc->sc_chan[HSCX_CH_B];
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", NULL, MTX_DEF);
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", NULL, MTX_DEF);
-#endif
-
- /* init the "HSCX" */
- avma1pp_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- avma1pp_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* can't use the normal B-Channel stuff */
- avma1pp_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 */
-
- i4b_l1_mph_status_ind(L0IFPIUNIT(sc->sc_unit), STI_ATTACH, sc->sc_cardtyp, &avma1pp_l1mux_func);
-
- fail:
- splx(s);
- return(error);
-}
-
-/*
- * this is the real interrupt routine
- */
-static void
-avma1pp_hscx_intr(int h_chan, u_int stat, struct l1_softc *sc)
-{
- register l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- int activity = -1;
- u_int param = 0;
-
- NDBGL1(L1_H_IRQ, "%#x", stat);
-
- if((stat & HSCX_INT_XDU) && (chan->bprot != BPROT_NONE))/* xmit data underrun */
- {
- chan->stat_XDU++;
- NDBGL1(L1_H_XFRERR, "xmit data underrun");
- /* abort the transmission */
- sc->avma1pp_txl = 0;
- sc->avma1pp_cmd |= HSCX_CMD_XRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
- sc->avma1pp_cmd &= ~HSCX_CMD_XRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
-
- 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;
- }
- }
-
- /*
- * The following is based on examination of the Linux driver.
- *
- * The logic here is different than with a "real" HSCX; all kinds
- * of information (interrupt/status bits) are in stat.
- * HSCX_INT_RPR indicates a receive interrupt
- * HSCX_STAT_RDO indicates an overrun condition, abort -
- * otherwise read the bytes ((stat & HSCX_STZT_RML_MASK) >> 8)
- * HSCX_STAT_RME indicates end-of-frame and apparently any
- * CRC/framing errors are only reported in this state.
- * if ((stat & HSCX_STAT_CRCVFRRAB) != HSCX_STAT_CRCVFR)
- * CRC/framing error
- */
-
- if(stat & HSCX_INT_RPR)
- {
- register int fifo_data_len;
- int error = 0;
- /* always have to read the FIFO, so use a scratch buffer */
- u_char scrbuf[HSCX_FIFO_LEN];
-
- if(stat & HSCX_STAT_RDO)
- {
- chan->stat_RDO++;
- NDBGL1(L1_H_XFRERR, "receive data overflow");
- error++;
- }
-
- /*
- * check whether we're receiving data for an inactive B-channel
- * and discard it. This appears to happen for telephony when
- * both B-channels are active and one is deactivated. Since
- * it is not really possible to deactivate the channel in that
- * case (the ASIC seems to deactivate _both_ channels), the
- * "deactivated" channel keeps receiving data which can lead
- * to exhaustion of mbufs and a kernel panic.
- *
- * This is a hack, but it's the only solution I can think of
- * without having the documentation for the ASIC.
- * GJ - 28 Nov 1999
- */
- if (chan->state == HSCX_IDLE)
- {
- NDBGL1(L1_H_XFRERR, "toss data from %d", h_chan);
- error++;
- }
-
- fifo_data_len = ((stat & HSCX_STAT_RML_MASK) >> 8);
-
- if(fifo_data_len == 0)
- fifo_data_len = sc->sc_bfifolen;
-
- /* ALWAYS read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, scrbuf, fifo_data_len);
- chan->rxcount += fifo_data_len;
-
- /* 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 avma1pp_hscx_intr: RME, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- if((chan->in_len + fifo_data_len) <= BCH_MAX_DATALEN)
- {
- /* OK to copy the data */
- bcopy(scrbuf, chan->in_cbptr, fifo_data_len);
- chan->in_cbptr += fifo_data_len;
- chan->in_len += 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 = L0IFPIUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- if (stat & HSCX_STAT_RME)
- {
- if((stat & HSCX_STAT_CRCVFRRAB) == HSCX_STAT_CRCVFR)
- {
- (*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
- activity = ACT_RX;
-
- /* mark buffer ptr as unused */
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- else
- {
- chan->stat_CRC++;
- NDBGL1(L1_H_XFRERR, "CRC/RAB");
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- }
- }
- } /* END enough space in mbuf */
- 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 = L0IFPIUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- if(!(i4b_l1_bchan_tel_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
- activity = ACT_RX;
-
- /* move rx'd data to rx queue */
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- (void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-#else
- if(!(IF_QFULL(&chan->rx_queue)))
- {
- IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
- }
- else
- {
- i4b_Bfreembuf(chan->in_mbuf);
- }
-#endif
- /* signal upper layer that data are available */
- (*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
-
- /* alloc new buffer */
-
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 avma1pp_hscx_intr: RPF, cannot allocate new mbuf!\n");
-
- /* setup new data ptr */
-
- chan->in_cbptr = chan->in_mbuf->m_data;
-
- /* OK to copy the data */
- bcopy(scrbuf, chan->in_cbptr, fifo_data_len);
-
- chan->in_cbptr += fifo_data_len;
- chan->in_len = fifo_data_len;
-
- chan->rxcount += fifo_data_len;
- }
- else
- {
- NDBGL1(L1_H_XFRERR, "RAWHDLC rx buffer overflow in RPF, in_len=%d", chan->in_len);
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
- }
- } /* if(error == 0) */
- else
- {
- /* land here for RDO */
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- sc->avma1pp_txl = 0;
- sc->avma1pp_cmd |= HSCX_CMD_RRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
- sc->avma1pp_cmd &= ~HSCX_CMD_RRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
- }
- }
-
-
- /* transmit fifo empty, new data can be written to fifo */
-
- if(stat & HSCX_INT_XPR)
- {
- /*
- * for a description what is going on here, please have
- * a look at isic_bchannel_start() in i4b_bchan.c !
- */
-
- NDBGL1(L1_H_IRQ, "unit %d, chan %d - XPR, Tx Fifo Empty!", 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->isic_drvr_linktab->bch_tx_queue_empty)(chan->isic_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 = L0IFPIUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(i4b_l1_bchan_tel_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
- activity = ACT_TX;
- }
- else
- {
- activity = ACT_TX;
- }
- }
- }
-
- avma1pp_hscx_fifo(chan, sc);
- }
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->isic_drvr_linktab->bch_activity)(chan->isic_drvr_linktab->unit, activity);
-}
-
-/*
- * this is the main routine which checks each channel and then calls
- * the real interrupt routine as appropriate
- */
-static void
-avma1pp_hscx_int_handler(struct l1_softc *sc)
-{
- u_int stat;
-
- /* has to be a u_int because the byte count is in the 2nd byte */
- stat = hscx_read_reg_int(0, HSCX_STAT, sc);
- if (stat & HSCX_INT_MASK)
- avma1pp_hscx_intr(0, stat, sc);
- stat = hscx_read_reg_int(1, HSCX_STAT, sc);
- if (stat & HSCX_INT_MASK)
- avma1pp_hscx_intr(1, stat, sc);
-}
-
-static void
-avma1pp_disable(device_t dev)
-{
- struct l1_softc *sc = device_get_softc(dev);
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, ASL_RESET_ALL|ASL_TIMERDISABLE);
-}
-
-static void
-avma1pp_intr(void *xsc)
-{
- u_char stat;
- struct l1_softc *sc;
- bus_space_handle_t bhandle;
- bus_space_tag_t btag;
-
- sc = xsc;
- bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- stat = bus_space_read_1(btag, bhandle, STAT0_OFFSET);
- NDBGL1(L1_H_IRQ, "stat %x", stat);
- /* was there an interrupt from this card ? */
- if ((stat & ASL_IRQ_Pending) == ASL_IRQ_Pending)
- return; /* no */
- /* interrupts are low active */
- if (!(stat & ASL_IRQ_TIMER))
- NDBGL1(L1_H_IRQ, "timer interrupt ???");
- if (!(stat & ASL_IRQ_HSCX))
- {
- NDBGL1(L1_H_IRQ, "HSCX");
- avma1pp_hscx_int_handler(sc);
- }
- if (!(stat & ASL_IRQ_ISAC))
- {
- NDBGL1(L1_H_IRQ, "ISAC");
- ifpi_isac_intr(sc);
- }
-}
-
-static void
-avma1pp_hscx_init(struct l1_softc *sc, int h_chan, int activate)
-{
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- u_int param = 0;
-
- NDBGL1(L1_BCHAN, "unit=%d, channel=%d, %s",
- sc->sc_unit, h_chan, activate ? "activate" : "deactivate");
-
- if (activate == 0)
- {
- /* only deactivate if both channels are idle */
- if (sc->sc_chan[HSCX_CH_A].state != HSCX_IDLE ||
- sc->sc_chan[HSCX_CH_B].state != HSCX_IDLE)
- {
- return;
- }
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_TRANS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
- return;
- }
- if(chan->bprot == BPROT_RHDLC)
- {
- NDBGL1(L1_BCHAN, "BPROT_RHDLC");
-
- /* HDLC Frames, transparent mode 0 */
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_ITF_FLG;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
- sc->avma1pp_cmd = HSCX_CMD_XRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
- sc->avma1pp_cmd = 0;
- }
- else
- {
- NDBGL1(L1_BCHAN, "BPROT_NONE??");
-
- /* Raw Telephony, extended transparent mode 1 */
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_TRANS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
- sc->avma1pp_cmd = HSCX_CMD_XRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, HSCX_STAT, param, sc);
- sc->avma1pp_cmd = 0;
- }
-}
-
-static void
-avma1pp_bchannel_setup(int unit, int h_chan, int bprot, int activate)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
-
- int s = SPLI4B();
-
- if(activate == 0)
- {
- /* deactivation */
- chan->state = HSCX_IDLE;
- avma1pp_hscx_init(sc, h_chan, activate);
- }
-
- NDBGL1(L1_BCHAN, "unit=%d, channel=%d, %s",
- 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 */
-
- chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
-
- 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 */
-
- chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
-
- 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 */
- avma1pp_hscx_init(sc, h_chan, activate);
- chan->state |= HSCX_AVMA1PP_ACTIVE;
- }
-
- splx(s);
-}
-
-static void
-avma1pp_bchannel_start(int unit, int h_chan)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- register l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- int s;
- int activity = -1;
-
- 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(!(i4b_l1_bchan_tel_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 = L0IFPIUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- avma1pp_hscx_fifo(chan, sc);
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->isic_drvr_linktab->bch_activity)(chan->isic_drvr_linktab->unit, activity);
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * return the address of isic drivers linktab
- *---------------------------------------------------------------------------*/
-static isdn_link_t *
-avma1pp_ret_linktab(int unit, int channel)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- return(&chan->isic_isdn_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * set the driver linktab in the b channel softc
- *---------------------------------------------------------------------------*/
-static void
-avma1pp_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- chan->isic_drvr_linktab = dlt;
-}
-
-
-/*---------------------------------------------------------------------------*
- * initialize our local linktab
- *---------------------------------------------------------------------------*/
-static void
-avma1pp_init_linktab(struct l1_softc *sc)
-{
- l1_bchan_state_t *chan = &sc->sc_chan[HSCX_CH_A];
- isdn_link_t *lt = &chan->isic_isdn_linktab;
-
- /* make sure the hardware driver is known to layer 4 */
- /* avoid overwriting if already set */
- if (ctrl_types[CTRL_PASSIVE].set_linktab == NULL)
- {
- ctrl_types[CTRL_PASSIVE].set_linktab = i4b_l1_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = i4b_l1_ret_linktab;
- }
-
- /* local setup */
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_A;
- lt->bch_config = avma1pp_bchannel_setup;
- lt->bch_tx_start = avma1pp_bchannel_start;
- lt->bch_stat = avma1pp_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->isic_isdn_linktab;
-
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_B;
- lt->bch_config = avma1pp_bchannel_setup;
- lt->bch_tx_start = avma1pp_bchannel_start;
- lt->bch_stat = avma1pp_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;
-}
-
-/*
- * use this instead of isic_bchannel_stat in i4b_bchan.c because it's static
- */
-static void
-avma1pp_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_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);
-}
-
-/*---------------------------------------------------------------------------*
- * fill HSCX fifo with data from the current mbuf
- * Put this here until it can go into i4b_hscx.c
- *---------------------------------------------------------------------------*/
-static int
-avma1pp_hscx_fifo(l1_bchan_state_t *chan, struct l1_softc *sc)
-{
- int len;
- int nextlen;
- int i;
- int cmd = 0;
- /* using a scratch buffer simplifies writing to the FIFO */
- u_char scrbuf[HSCX_FIFO_LEN];
-
- len = 0;
-
- /*
- * 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(chan->out_mbuf_cur && len != sc->sc_bfifolen)
- {
- nextlen = min(chan->out_mbuf_cur_len, sc->sc_bfifolen - len);
-
-#ifdef NOTDEF
- printf("i:mh=%p, mc=%p, mcp=%p, 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,
- nextlen);
-#endif
-
- cmd |= HSCX_CMDR_XTF;
- /* collect the data in the scratch buffer */
- for (i = 0; i < nextlen; i++)
- scrbuf[i + len] = chan->out_mbuf_cur_ptr[i];
-
- 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 = L0IFPIUNIT(sc->sc_unit);
- hdr.type = (chan->channel == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_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;
- }
- }
- }
- /* write what we have from the scratch buf to the HSCX fifo */
- if (len != 0)
- HSCX_WRFIFO(chan->channel, scrbuf, len);
- return(cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * ifpi - ISAC interrupt routine
- *---------------------------------------------------------------------------*/
-static void
-ifpi_isac_intr(struct l1_softc *sc)
-{
- register u_char isac_irq_stat;
-
- for(;;)
- {
- /* get isac irq status */
- isac_irq_stat = ISAC_READ(I_ISTA);
-
- if(isac_irq_stat)
- ifpi_isac_irq(sc, isac_irq_stat); /* isac handler */
- else
- break;
- }
-
- ISAC_WRITE(I_MASK, 0xff);
-
- DELAY(100);
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
-
-/*---------------------------------------------------------------------------*
- * ifpi_recover - try to recover from irq lockup
- *---------------------------------------------------------------------------*/
-void
-ifpi_recover(struct l1_softc *sc)
-{
- u_char byte;
-
- /* get isac irq status */
-
- byte = ISAC_READ(I_ISTA);
-
- NDBGL1(L1_ERROR, " ISAC: ISTA = 0x%x", byte);
-
- if(byte & ISAC_ISTA_EXI)
- NDBGL1(L1_ERROR, " ISAC: EXIR = 0x%x", (u_char)ISAC_READ(I_EXIR));
-
- if(byte & ISAC_ISTA_CISQ)
- {
- byte = ISAC_READ(I_CIRR);
-
- NDBGL1(L1_ERROR, " ISAC: CISQ = 0x%x", byte);
-
- if(byte & ISAC_CIRR_SQC)
- NDBGL1(L1_ERROR, " ISAC: SQRR = 0x%x", (u_char)ISAC_READ(I_SQRR));
- }
-
- NDBGL1(L1_ERROR, " ISAC: IMASK = 0x%x", ISAC_IMASK);
-
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
diff --git a/sys/i4b/layer1/ifpi2/i4b_ifpi2_ext.h b/sys/i4b/layer1/ifpi2/i4b_ifpi2_ext.h
deleted file mode 100644
index 84f44de..0000000
--- a/sys/i4b/layer1/ifpi2/i4b_ifpi2_ext.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * Copyright (c) 2001 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.
- *
- * 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_ifpi2 - Fritz!Card PCI Version 2 for split layers
- * ------------------------------------------
- *
- * $Id$
- *
- * $FreeBSD$
- *
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IFPI2_EXT_H_
-#define _I4B_IFPI2_EXT_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-void ifpi2_set_linktab(int , int , drvr_link_t * );
-isdn_link_t *ifpi2_ret_linktab(int , int );
-
-int ifpi2_ph_data_req(int , struct mbuf *, int );
-int ifpi2_ph_activate_req(int );
-int ifpi2_mph_command_req(int , int , void *);
-
-void ifpi2_isacsx_irq(struct l1_softc *, int );
-void ifpi2_isacsx_l1_cmd(struct l1_softc *, int );
-int ifpi2_isacsx_init(struct l1_softc *);
-
-void ifpi2_recover(struct l1_softc *);
-char * ifpi2_printstate(struct l1_softc *);
-void ifpi2_next_state(struct l1_softc *, int );
-
-#define IFPI2_MAXUNIT 4
-extern struct l1_softc *ifpi2_scp[IFPI2_MAXUNIT];
-
-/* the ISACSX has 2 mask registers of interest - cannot use ISAC_IMASK */
-extern unsigned char isacsx_imaskd;
-extern unsigned char isacsx_imask;
-
-#endif /* _I4B_IFPI2_EXT_H_ */
diff --git a/sys/i4b/layer1/ifpi2/i4b_ifpi2_isacsx.c b/sys/i4b/layer1/ifpi2/i4b_ifpi2_isacsx.c
deleted file mode 100644
index f0a3182..0000000
--- a/sys/i4b/layer1/ifpi2/i4b_ifpi2_isacsx.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
- * Copyright (c) 2001 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.
- *
- * 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_ifpi2_isac.c - i4b Fritz PCI Version 2 ISACSX handler
- * --------------------------------------------
- * $Id$
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/layer1/ifpi2/i4b_ifpi2_ext.h>
-#include <i4b/layer1/ifpi2/i4b_ifpi2_isacsx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char ifpi2_isacsx_exir_hdlr(register struct l1_softc *sc, u_char exir);
-static void ifpi2_isacsx_ind_hdlr(register struct l1_softc *sc, int ind);
-
-/* the ISACSX has 2 mask registers of interest - cannot use ISAC_IMASK */
-unsigned char isacsx_imaskd;
-unsigned char isacsx_imask;
-
-/*---------------------------------------------------------------------------*
- * ISACSX interrupt service routine
- *---------------------------------------------------------------------------*/
-void
-ifpi2_isacsx_irq(struct l1_softc *sc, int ista)
-{
- register u_char c = 0;
- register u_char istad = 0;
-
- NDBGL1(L1_F_MSG, "unit %d: ista = 0x%02x", sc->sc_unit, ista);
-
- /* was it an HDLC interrupt ? */
- if (ista & ISACSX_ISTA_ICD)
- {
- istad = ISAC_READ(I_ISTAD);
- NDBGL1(L1_F_MSG, "unit %d: istad = 0x%02x", sc->sc_unit, istad);
-
- if(istad & (ISACSX_ISTAD_RFO|ISACSX_ISTAD_XMR|ISACSX_ISTAD_XDU))
- {
- /* not really EXIR, but very similar */
- c |= ifpi2_isacsx_exir_hdlr(sc, istad);
- }
- }
-
- if(istad & ISACSX_ISTAD_RME) /* receive message end */
- {
- register int rest;
- u_char rsta;
-
- /* get rx status register */
-
- rsta = ISAC_READ(I_RSTAD);
-
- /* Check for Frame and CRC valid */
- if((rsta & ISACSX_RSTAD_MASK) != (ISACSX_RSTAD_VFR|ISACSX_RSTAD_CRC))
- {
- int error = 0;
-
- if(!(rsta & ISACSX_RSTAD_VFR)) /* VFR error */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Frame not valid error", sc->sc_unit);
- }
-
- if(!(rsta & ISACSX_RSTAD_CRC)) /* CRC error */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: CRC error", sc->sc_unit);
- }
-
- if(rsta & ISACSX_RSTAD_RDO) /* ReceiveDataOverflow */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Data Overrun error", sc->sc_unit);
- }
-
- if(rsta & ISACSX_RSTAD_RAB) /* ReceiveABorted */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Receive Aborted error", sc->sc_unit);
- }
-
- if(error == 0)
- NDBGL1(L1_I_ERR, "unit %d: RME unknown error, RSTAD = 0x%02x!", sc->sc_unit, rsta);
-
- i4b_Dfreembuf(sc->sc_ibuf);
-
- c |= ISACSX_CMDRD_RMC|ISACSX_CMDRD_RRES;
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- ISAC_WRITE(I_CMDRD, ISACSX_CMDRD_RMC|ISACSX_CMDRD_RRES);
-
- return;
- }
-
- rest = (ISAC_READ(I_RBCLD) & (ISACSX_FIFO_LEN-1));
-
- if(rest == 0)
- rest = ISACSX_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("ifpi2_isacsx_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);
- /* the last byte contains status, strip it */
- sc->sc_ilen += rest - 1;
-
- 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 = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, sc->sc_ibuf->m_len, sc->sc_ibuf->m_data);
- }
-
- c |= ISACSX_CMDRD_RMC;
-
- if(sc->sc_enabled &&
- (ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S))
- {
- i4b_l1_ph_data_ind(L0IFPI2UNIT(sc->sc_unit), sc->sc_ibuf);
- }
- else
- {
- i4b_Dfreembuf(sc->sc_ibuf);
- }
- }
- else
- {
- NDBGL1(L1_I_ERR, "RME, input buffer overflow!");
- i4b_Dfreembuf(sc->sc_ibuf);
- c |= ISACSX_CMDRD_RMC|ISACSX_CMDRD_RRES;
- }
-
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
- }
-
- if(istad & ISACSX_ISTAD_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("ifpi2_isacsx_irq: RPF, i4b_Dgetmbuf returns NULL!\n");
- sc->sc_ilen = 0;
- }
-
- if(sc->sc_ilen <= (MAX_DFRAME_LEN - ISACSX_FIFO_LEN))
- {
- ISAC_RDFIFO(sc->sc_ib, ISACSX_FIFO_LEN);
- sc->sc_ilen += ISACSX_FIFO_LEN;
- sc->sc_ib += ISACSX_FIFO_LEN;
- c |= ISACSX_CMDRD_RMC;
- }
- else
- {
- NDBGL1(L1_I_ERR, "RPF, input buffer overflow!");
- i4b_Dfreembuf(sc->sc_ibuf);
- sc->sc_ibuf = NULL;
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
- c |= ISACSX_CMDRD_RMC|ISACSX_CMDRD_RRES;
- }
- }
-
- if(istad & ISACSX_ISTAD_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, ISACSX_FIFO_LEN));
-
- if(sc->sc_ol > ISACSX_FIFO_LEN) /* length > 32 ? */
- {
- sc->sc_op += ISACSX_FIFO_LEN; /* bufferptr+32 */
- sc->sc_ol -= ISACSX_FIFO_LEN; /* length - 32 */
- c |= ISACSX_CMDRD_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 |= ISACSX_CMDRD_XTF | ISACSX_CMDRD_XME;
- }
- }
- else
- {
- sc->sc_state &= ~ISAC_TX_ACTIVE;
- }
- }
-
- if(ista & ISACSX_ISTA_CIC) /* channel status change CISQ */
- {
- register u_char ci;
-
- /* get command/indication rx register*/
-
- ci = ISAC_READ(I_CIR0);
-
- /* C/I code change IRQ (flag already cleared by CIR0 read) */
-
- if(ci & ISACSX_CIR0_CIC0)
- ifpi2_isacsx_ind_hdlr(sc, (ci >> 4) & 0xf);
- }
-
- if(c)
- {
- ISAC_WRITE(I_CMDRD, c);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ISACSX L1 Extended IRQ handler
- *---------------------------------------------------------------------------*/
-static u_char
-ifpi2_isacsx_exir_hdlr(register struct l1_softc *sc, u_char exir)
-{
- u_char c = 0;
-
- if(exir & ISACSX_ISTAD_XMR)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Message Repeat");
-
- c |= ISACSX_CMDRD_XRES;
- }
-
- if(exir & ISACSX_ISTAD_XDU)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Data Underrun");
-
- c |= ISACSX_CMDRD_XRES;
- }
-
- if(exir & ISACSX_ISTAD_RFO)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Rx Frame Overflow");
-
- c |= ISACSX_CMDRD_RMC;
- }
-
-#if 0 /* all blocked per default */
- if(exir & ISACSX_EXIR_SOV)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Sync Xfer Overflow");
- }
-
- if(exir & ISACSX_EXIR_MOS)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Monitor Status");
- }
-
- if(exir & ISACSX_EXIR_SAW)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Subscriber Awake");
- }
-
- if(exir & ISACSX_EXIR_WOV)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Watchdog Timer Overflow");
- }
-#endif
-
- return(c);
-}
-
-/*---------------------------------------------------------------------------*
- * ISACSX L1 Indication handler
- *---------------------------------------------------------------------------*/
-static void
-ifpi2_isacsx_ind_hdlr(register struct l1_softc *sc, int ind)
-{
- register int event;
-
- switch(ind)
- {
- case ISACSX_CIR0_IAI8:
- NDBGL1(L1_I_CICO, "rx AI8 in state %s", ifpi2_printstate(sc));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- ifpi2_isacsx_l1_cmd(sc, CMD_AR8);
- event = EV_INFO48;
- i4b_l1_mph_status_ind(L0IFPI2UNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISACSX_CIR0_IAI10:
- NDBGL1(L1_I_CICO, "rx AI10 in state %s", ifpi2_printstate(sc));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- ifpi2_isacsx_l1_cmd(sc, CMD_AR10);
- event = EV_INFO410;
- i4b_l1_mph_status_ind(L0IFPI2UNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISACSX_CIR0_IRSY:
- NDBGL1(L1_I_CICO, "rx RSY in state %s", ifpi2_printstate(sc));
- event = EV_RSY;
- break;
-
- case ISACSX_CIR0_IPU:
- NDBGL1(L1_I_CICO, "rx PU in state %s", ifpi2_printstate(sc));
- event = EV_PU;
- break;
-
- case ISACSX_CIR0_IDR:
- NDBGL1(L1_I_CICO, "rx DR in state %s", ifpi2_printstate(sc));
- ifpi2_isacsx_l1_cmd(sc, CMD_DIU);
- event = EV_DR;
- break;
-
- case ISACSX_CIR0_IDID:
- NDBGL1(L1_I_CICO, "rx DID in state %s", ifpi2_printstate(sc));
- event = EV_INFO0;
- i4b_l1_mph_status_ind(L0IFPI2UNIT(sc->sc_unit), STI_L1STAT, LAYER_IDLE, NULL);
- break;
-
- case ISACSX_CIR0_IDIS:
- NDBGL1(L1_I_CICO, "rx DIS in state %s", ifpi2_printstate(sc));
- event = EV_DIS;
- break;
-
- case ISACSX_CIR0_IEI:
- NDBGL1(L1_I_CICO, "rx EI in state %s", ifpi2_printstate(sc));
- ifpi2_isacsx_l1_cmd(sc, CMD_DIU);
- event = EV_EI;
- break;
-
- case ISACSX_CIR0_IARD:
- NDBGL1(L1_I_CICO, "rx ARD in state %s", ifpi2_printstate(sc));
- event = EV_INFO2;
- break;
-
- case ISACSX_CIR0_ITI:
- NDBGL1(L1_I_CICO, "rx TI in state %s", ifpi2_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISACSX_CIR0_IATI:
- NDBGL1(L1_I_CICO, "rx ATI in state %s", ifpi2_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISACSX_CIR0_ISD:
- NDBGL1(L1_I_CICO, "rx SD in state %s", ifpi2_printstate(sc));
- event = EV_INFO0;
- break;
-
- default:
- NDBGL1(L1_I_ERR, "UNKNOWN Indication 0x%x in state %s", ind, ifpi2_printstate(sc));
- event = EV_INFO0;
- break;
- }
- ifpi2_next_state(sc, event);
-}
-
-/*---------------------------------------------------------------------------*
- * execute a layer 1 command
- *---------------------------------------------------------------------------*/
-void
-ifpi2_isacsx_l1_cmd(struct l1_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_MASKD, 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_MASKD, isacsx_imaskd);
- ISAC_WRITE(I_MASK, isacsx_imask);
-
- /* XXXXXXXXXXXXXXXXXXX */
-
-#endif /* I4B_SMP_WORKAROUND */
-
- if(command < 0 || command > CMD_ILL)
- {
- NDBGL1(L1_I_ERR, "illegal cmd 0x%x in state %s", command, ifpi2_printstate(sc));
- return;
- }
-
- cmd = ISACSX_CIX0_LOW;
-
- switch(command)
- {
- case CMD_TIM:
- NDBGL1(L1_I_CICO, "tx TIM in state %s", ifpi2_printstate(sc));
- cmd |= (ISACSX_CIX0_CTIM << 4);
- break;
-
- case CMD_RS:
- NDBGL1(L1_I_CICO, "tx RS in state %s", ifpi2_printstate(sc));
- cmd |= (ISACSX_CIX0_CRS << 4);
- break;
-
- case CMD_AR8:
- NDBGL1(L1_I_CICO, "tx AR8 in state %s", ifpi2_printstate(sc));
- cmd |= (ISACSX_CIX0_CAR8 << 4);
- break;
-
- case CMD_AR10:
- NDBGL1(L1_I_CICO, "tx AR10 in state %s", ifpi2_printstate(sc));
- cmd |= (ISACSX_CIX0_CAR10 << 4);
- break;
-
- case CMD_DIU:
- NDBGL1(L1_I_CICO, "tx DIU in state %s", ifpi2_printstate(sc));
- cmd |= (ISACSX_CIX0_CDIU << 4);
- break;
- }
- ISAC_WRITE(I_CIX0, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * L1 ISACSX initialization
- *---------------------------------------------------------------------------*/
-int
-ifpi2_isacsx_init(struct l1_softc *sc)
-{
- isacsx_imaskd = 0xff; /* disable all irqs */
- isacsx_imask = 0xff; /* disable all irqs */
-
- ISAC_WRITE(I_MASKD, isacsx_imaskd);
- ISAC_WRITE(I_MASK, isacsx_imask);
-
- /* the ISACSX only runs in IOM-2 mode */
- NDBGL1(L1_I_SETUP, "configuring for IOM-2 mode");
-
- /* TR_CONF0: Transceiver Configuration Register 0:
- * DIS_TR - transceiver enabled
- * EN_ICV - normal operation
- * EXLP - no external loop
- * LDD - automatic clock generation
- */
- ISAC_WRITE(I_WTR_CONF0, 0);
-
- /* TR_CONF2: Transceiver Configuration Register 1:
- * DIS_TX - transmitter enabled
- * PDS - phase deviation 2 S-bits
- * RLP - remote line loop open
- */
- ISAC_WRITE(I_WTR_CONF2, 0);
-
- /* MODED: Mode Register:
- * MDSx - transparent mode 0
- * TMD - timer mode = external
- * RAC - Receiver enabled
- * DIMx - digital i/f mode
- */
- ISAC_WRITE(I_WMODED, ISACSX_MODED_MDS2|ISACSX_MODED_MDS1|ISACSX_MODED_RAC|ISACSX_MODED_DIM0);
-
- /* enabled interrupts:
- * ===================
- * RME - receive message end
- * RPF - receive pool full
- * RPO - receive pool overflow
- * XPR - transmit pool ready
- * XMR - transmit message repeat
- * XDU - transmit data underrun
- */
-
- isacsx_imaskd = ISACSX_MASKD_LOW;
- ISAC_WRITE(I_MASKD, isacsx_imaskd);
-
- /* enabled interrupts:
- * ===================
- * ICD - HDLC interrupt from D-channel
- * CIC - C/I channel change
- */
-
- isacsx_imask = ~(ISACSX_MASK_ICD | ISACSX_MASK_CIC);
-
- ISAC_WRITE(I_MASK, isacsx_imask);
-
- return(0);
-}
diff --git a/sys/i4b/layer1/ifpi2/i4b_ifpi2_isacsx.h b/sys/i4b/layer1/ifpi2/i4b_ifpi2_isacsx.h
deleted file mode 100644
index 4d66905..0000000
--- a/sys/i4b/layer1/ifpi2/i4b_ifpi2_isacsx.h
+++ /dev/null
@@ -1,574 +0,0 @@
-/*-
- * Copyright (c) 2001 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.
- */
-
-/*---------------------------------------------------------------------------
- *
- * $FreeBSD$
- *
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef I4B_ISACSX_H_
-#define I4B_ISACSX_H_
-
-#define ISACSX_FIFO_LEN 32 /* 32 bytes FIFO on chip */
-
-#define ISACSX_V13 0x01
-
-/*
- * definitions of registers and bits for the ISAC-SX ISDN chip.
- */
-
-typedef struct isacsx_reg {
-
- /* 32 byte deep FIFO always first */
-
- unsigned char isacsx_fifo [ISACSX_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 isacsx_istad;
- unsigned char isacsx_stard;
- unsigned char isacsx_moded;
- unsigned char isacsx_exmd1;
- unsigned char isacsx_timr1;
- unsigned char dummy_25;
- unsigned char isacsx_rbcld;
- unsigned char isacsx_rbchd;
- unsigned char isacsx_rstad;
- unsigned char isacsx_tmd;
- unsigned char dummy_2a;
- unsigned char dummy_2b;
- unsigned char dummy_2c;
- unsigned char dummy_2d;
- unsigned char isacsx_cir0;
- unsigned char isacsx_codr1;
- unsigned char isacsx_tr_conf0;
- unsigned char isacsx_tr_conf1;
- unsigned char isacsx_tr_conf2;
- unsigned char isacsx_tr_sta;
- unsigned char dummy_34;
- unsigned char isacsx_sqrr1;
- unsigned char isacsx_sqrr2;
- unsigned char isacsx_sqrr3;
- unsigned char isacsx_istatr;
- unsigned char isacsx_masktr;
- unsigned char dummy_3a;
- unsigned char dummy_3b;
- unsigned char isacsx_acgf2;
- unsigned char dummy_3d;
- unsigned char dummy_3e;
- unsigned char dummy_3f;
- unsigned char isacsx_cda10;
- unsigned char isacsx_cda11;
- unsigned char isacsx_cda20;
- unsigned char isacsx_cda21;
- unsigned char isacsx_cda_tsdp10;
- unsigned char isacsx_cda_tsdp11;
- unsigned char isacsx_cda_tsdp20;
- unsigned char isacsx_cda_tsdp21;
- unsigned char dummy_48;
- unsigned char dummy_49;
- unsigned char dummy_4a;
- unsigned char dummy_4b;
- unsigned char isacsx_tr_tsdp_bc1;
- unsigned char isacsx_tr_tsdp_bc2;
- unsigned char isacsx_cda1_cr;
- unsigned char isacsx_cda2_cr;
- unsigned char isacsx_tr_cr;
- unsigned char dummy_51;
- unsigned char dummy_52;
- unsigned char isacsx_dci_cr;
- unsigned char isacsx_mon_cr;
- unsigned char isacsx_sds_cr;
- unsigned char dummy_56;
- unsigned char isacsx_iom_cr;
- unsigned char isacsx_sti;
- unsigned char isacsx_msti;
- unsigned char isacsx_sds_conf;
- unsigned char isacsx_mcda;
- unsigned char isacsx_mor;
- unsigned char isacsx_mosr;
- unsigned char isacsx_mocr;
- unsigned char isacsx_msta;
- unsigned char isacsx_ista;
- unsigned char isacsx_auxi;
- unsigned char isacsx_mode1;
- unsigned char isacsx_mode2;
- unsigned char isacsx_id;
- unsigned char isacsx_timr2;
- unsigned char dummy_66;
- unsigned char dummy_67;
- unsigned char dummy_68;
- unsigned char dummy_69;
- unsigned char dummy_6a;
- unsigned char dummy_6b;
- unsigned char dummy_6c;
- unsigned char dummy_6d;
- unsigned char dummy_6e;
- unsigned char dummy_6f;
- } isacsx_r;
- struct {
- unsigned char isacsx_maskd;
- unsigned char isacsx_cmdrd;
- unsigned char isacsx_moded;
- unsigned char isacsx_exmd1;
- unsigned char isacsx_timr1;
- unsigned char isacsx_sap1;
- unsigned char isacsx_sap2;
- unsigned char isacsx_tei1;
- unsigned char isacsx_tei2;
- unsigned char isacsx_tmd;
- unsigned char dummy_2a;
- unsigned char dummy_2b;
- unsigned char dummy_2c;
- unsigned char dummy_2d;
- unsigned char isacsx_cix0;
- unsigned char isacsx_codx1;
- unsigned char isacsx_tr_conf0;
- unsigned char isacsx_tr_conf1;
- unsigned char isacsx_tr_conf2;
- unsigned char dummy_33;
- unsigned char dummy_34;
- unsigned char isacsx_sqrx1;
- unsigned char dummy_36;
- unsigned char dummy_37;
- unsigned char dummy_38;
- unsigned char isacsx_masktr;
- unsigned char dummy_3a;
- unsigned char dummy_3b;
- unsigned char isacsx_acgf2;
- unsigned char dummy_3d;
- unsigned char dummy_3e;
- unsigned char dummy_3f;
- unsigned char isacsx_cda10;
- unsigned char isacsx_cda11;
- unsigned char isacsx_cda20;
- unsigned char isacsx_cda21;
- unsigned char isacsx_cda_tsdp10;
- unsigned char isacsx_cda_tsdp11;
- unsigned char isacsx_cda_tsdp20;
- unsigned char isacsx_cda_tsdp21;
- unsigned char dummy_48;
- unsigned char dummy_49;
- unsigned char dummy_4a;
- unsigned char dummy_4b;
- unsigned char isacsx_tr_tsdp_bc1;
- unsigned char isacsx_tr_tsdp_bc2;
- unsigned char isacsx_cda1_cr;
- unsigned char isacsx_cda2_cr;
- unsigned char isacsx_tr_cr;
- unsigned char dummy_51;
- unsigned char dummy_52;
- unsigned char isacsx_dci_cr;
- unsigned char isacsx_mon_cr;
- unsigned char isacsx_sds_cr;
- unsigned char dummy_56;
- unsigned char isacsx_iom_cr;
- unsigned char isacsx_asti;
- unsigned char isacsx_msti;
- unsigned char isacsx_sds_conf;
- unsigned char dummy_5b;
- unsigned char isacsx_mox;
- unsigned char dummy_5d;
- unsigned char isacsx_mocr;
- unsigned char isacsx_mconf;
- unsigned char isacsx_mask;
- unsigned char isacsx_auxm;
- unsigned char isacsx_mode1;
- unsigned char isacsx_mode2;
- unsigned char isacsx_sres;
- unsigned char isacsx_timr2;
- unsigned char dummy_66;
- unsigned char dummy_67;
- unsigned char dummy_68;
- unsigned char dummy_69;
- unsigned char dummy_6a;
- unsigned char dummy_6b;
- unsigned char dummy_6c;
- unsigned char dummy_6d;
- unsigned char dummy_6e;
- unsigned char dummy_6f;
- } isacsx_w;
- } isacsx_rw;
-} isacsx_reg_t;
-
-#define REG_OFFSET(type, field) (int)(&(((type *)0)->field))
-
-/* ISACSX read registers */
-
-#define i_istad isacsx_rw.isacsx_r.isacsx_istad
-#define I_ISTAD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_istad)
-#define i_stard isacsx_rw.isacsx_r.isacsx_stard
-#define I_STARD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_stard)
-#define i_rmoded isacsx_rw.isacsx_r.isacsx_moded
-#define I_RMODED REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_moded)
-#define i_rexmd1 isacsx_rw.isacsx_r.isacsx_exmd1
-#define I_REXMD1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_exmd1)
-#define i_rtimr1 isacsx_rw.isacsx_r.isacsx_timr1
-#define I_RTIMR1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_timr1)
-#define i_rbcld isacsx_rw.isacsx_r.isacsx_rbcld
-#define I_RBCLD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_rbcld)
-#define i_rbchd isacsx_rw.isacsx_r.isacsx_rbchd
-#define I_RBCHD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_rbchd)
-#define i_rstad isacsx_rw.isacsx_r.isacsx_rstad
-#define I_RSTAD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_rstad)
-#define i_rtmd isacsx_rw.isacsx_r.isacsx_tmd
-#define I_RTMD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tmd)
-#define i_cir0 isacsx_rw.isacsx_r.isacsx_cir0
-#define I_CIR0 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cir0)
-#define i_codr1 isacsx_rw.isacsx_r.isacsx_codr1
-#define I_CODR1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_codr1)
-#define i_rtr_conf0 isacsx_rw.isacsx_r.isacsx_tr_conf0
-#define I_RTR_CONF0 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_conf0)
-#define i_rtr_conf1 isacsx_rw.isacsx_r.isacsx_tr_conf1
-#define I_RTR_CONF1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_conf1)
-#define i_rtr_conf2 isacsx_rw.isacsx_r.isacsx_tr_conf2
-#define I_RTR_CONF2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_conf2)
-#define i_sta isacsx_rw.isacsx_r.isacsx_sta
-#define I_STA REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sta)
-#define i_sqrr1 isacsx_rw.isacsx_r.isacsx_sqrr1
-#define I_SQRR1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sqrr1)
-#define i_sqrr2 isacsx_rw.isacsx_r.isacsx_sqrr2
-#define I_SQRR2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sqrr2)
-#define i_sqrr3 isacsx_rw.isacsx_r.isacsx_sqrr3
-#define I_SQRR3 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sqrr3)
-#define i_istatr isacsx_rw.isacsx_r.isacsx_istatr
-#define I_ISTATR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_istatr)
-#define i_rmasktr isacsx_rw.isacsx_r.isacsx_masktr
-#define I_RMASKTR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_masktr)
-#define i_racgf2 isacsx_rw.isacsx_r.isacsx_acgf2
-#define I_RACGF2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_acgf2)
-#define i_rcda10 isacsx_rw.isacsx_r.isacsx_cda10
-#define I_RCDA10 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda10)
-#define i_rcda11 isacsx_rw.isacsx_r.isacsx_cda11
-#define I_RCDA11 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda11)
-#define i_rcda20 isacsx_rw.isacsx_r.isacsx_cda20
-#define I_RCDA20 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda20)
-#define i_rcda21 isacsx_rw.isacsx_r.isacsx_cda21
-#define I_RCDA21 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda21)
-#define i_cda_tsdp10 isacsx_rw.isacsx_r.isacsx_cda_tsdp10
-#define I_CDA_TSDP10 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda_tsdp10)
-#define i_cda_tsdp11 isacsx_rw.isacsx_r.isacsx_cda_tsdp11
-#define I_CDA_TSDP11 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda_tsdp11)
-#define i_cda_tsdp20 isacsx_rw.isacsx_r.isacsx_cda_tsdp20
-#define I_CDA_TSDP20 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda_tsdp20)
-#define i_cda_tsdp21 isacsx_rw.isacsx_r.isacsx_cda_tsdp21
-#define I_CDA_TSDP21 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda_tsdp21)
-#define i_tr_tsdp_bc1 isacsx_rw.isacsx_r.isacsx_tr_tsdp_bc1
-#define I_TR_TSDP_BC1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_tsdp_bc1)
-#define i_tr_tsdp_bc2 isacsx_rw.isacsx_r.isacsx_tr_tsdp_bc2
-#define I_TR_TSDP_BC2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_tsdp_bc2)
-#define i_cda1_cr isacsx_rw.isacsx_r.isacsx_cda1_cr
-#define I_CDA1_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda1_cr)
-#define i_cda2_cr isacsx_rw.isacsx_r.isacsx_cda2_cr
-#define I_CDA2_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda2_cr)
-#define i_tr_cr isacsx_rw.isacsx_r.isacsx_tr_cr
-#define I_TR_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_cr)
-#define i_dci_cr isacsx_rw.isacsx_r.isacsx_dci_cr
-#define I_DCI_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_dci_cr)
-#define i_mon_cr isacsx_rw.isacsx_r.isacsx_mon_cr
-#define I_MON_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_mon_cr)
-#define i_sds_cr isacsx_rw.isacsx_r.isacsx_sds_cr
-#define I_SDS_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sds_cr)
-#define i_iom_cr isacsx_rw.isacsx_r.isacsx_iom_cr
-#define I_IOM_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_iom_cr)
-#define i_sti isacsx_rw.isacsx_r.isacsx_sti
-#define I_STI REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sti)
-#define i_msti isacsx_rw.isacsx_r.isacsx_msti
-#define I_MSTI REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_msti)
-#define i_sds_conf isacsx_rw.isacsx_r.isacsx_sds_conf
-#define I_SDS_CONF REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sds_conf)
-#define i_mcda isacsx_rw.isacsx_r.isacsx_mcda
-#define I_MCDA REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_mcda)
-#define i_mor isacsx_rw.isacsx_r.isacsx_mor
-#define I_MOR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_mor)
-#define i_mosr isacsx_rw.isacsx_r.isacsx_mosr
-#define I_MOSR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_mosr)
-#define i_rmocr isacsx_rw.isacsx_r.isacsx_mocr
-#define I_RMOCR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_mocr)
-#define i_msta isacsx_rw.isacsx_r.isacsx_msta
-#define I_MSTA REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_msta)
-#define i_ista isacsx_rw.isacsx_r.isacsx_ista
-#define I_ISTA REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_ista)
-#define i_auxi isacsx_rw.isacsx_r.isacsx_auxi
-#define I_AUXI REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_auxi)
-#define i_rmode1 isacsx_rw.isacsx_r.isacsx_mode1
-#define I_RMODE1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_mode1)
-#define i_rmode2 isacsx_rw.isacsx_r.isacsx_mode2
-#define I_RMODE2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_mode2)
-#define i_id isacsx_rw.isacsx_r.isacsx_id
-#define I_ID REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_id)
-#define i_rtimr2 isacsx_rw.isacsx_r.isacsx_timr2
-#define I_RTIMR2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_timr2)
-
-/* ISAC write registers - isacsx_mode, isacsx_timr, isacsx_star2, isacsx_spcr, */
-/* isacsx_c1r, isacsx_c2r, isacsx_adf2 see read registers */
-
-#define i_maskd isacsx_rw.isacsx_w.isacsx_maskd
-#define I_MASKD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_maskd)
-#define i_cmdrd isacsx_rw.isacsx_w.isacsx_cmdrd
-#define I_CMDRD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_cmdrd)
-#define i_wmoded isacsx_rw.isacsx_w.isacsx_moded
-#define I_WMODED REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_moded)
-#define i_wexmd1 isacsx_rw.isacsx_w.isacsx_exmd1
-#define I_WEXMD1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_exmd1)
-#define i_wtimr1 isacsx_rw.isacsx_w.isacsx_timr1
-#define I_WTIMR1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_timr1)
-#define i_sap1 isacsx_rw.isacsx_w.isacsx_sap1
-#define I_SAP1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_sap1)
-#define i_sap2 isacsx_rw.isacsx_w.isacsx_sap2
-#define I_SAP2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_sap2)
-#define i_tei1 isacsx_rw.isacsx_w.isacsx_tei1
-#define i_tei2 isacsx_rw.isacsx_w.isacsx_tei2
-#define i_wtmd isacsx_rw.isacsx_w.isacsx_tmd
-#define I_WTMD REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_tmd)
-#define i_cix0 isacsx_rw.isacsx_w.isacsx_cix0
-#define I_CIX0 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_cix0)
-#define i_codx1 isacsx_rw.isacsx_w.isacsx_codx1
-#define I_CODX1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_codx1)
-#define i_wtr_conf0 isacsx_rw.isacsx_w.isacsx_tr_conf0
-#define I_WTR_CONF0 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_tr_conf0)
-#define i_wtr_conf1 isacsx_rw.isacsx_w.isacsx_tr_conf1
-#define I_WTR_CONF1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_tr_conf1)
-#define i_wtr_conf2 isacsx_rw.isacsx_w.isacsx_tr_conf2
-#define I_WTR_CONF2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_tr_conf2)
-#define i_sqrx1 isacsx_rw.isacsx_w.isacsx_sqrx1
-#define I_SQRX1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_sqrx1)
-#define i_wmasktr isacsx_rw.isacsx_w.isacsx_masktr
-#define I_WMASKTR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_masktr)
-#define i_wacgf2 isacsx_rw.isacsx_w.isacsx_acgf2
-#define I_WACGF2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_acgf2)
-#define i_wcda10 isacsx_rw.isacsx_w.isacsx_cda10
-#define I_WCDA10 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_cda10)
-#define i_wcda11 isacsx_rw.isacsx_r.isacsx_cda11
-#define I_WCDA11 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda11)
-#define i_wcda20 isacsx_rw.isacsx_r.isacsx_cda20
-#define I_WCDA20 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda20)
-#define i_wcda21 isacsx_rw.isacsx_r.isacsx_cda21
-#define I_WCDA21 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda21)
-#define i_cda_tsdp10 isacsx_rw.isacsx_r.isacsx_cda_tsdp10
-#define I_CDA_TSDP10 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda_tsdp10)
-#define i_cda_tsdp11 isacsx_rw.isacsx_r.isacsx_cda_tsdp11
-#define I_CDA_TSDP11 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda_tsdp11)
-#define i_cda_tsdp20 isacsx_rw.isacsx_r.isacsx_cda_tsdp20
-#define I_CDA_TSDP20 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda_tsdp20)
-#define i_cda_tsdp21 isacsx_rw.isacsx_r.isacsx_cda_tsdp21
-#define I_CDA_TSDP21 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda_tsdp21)
-#define i_tr_tsdp_bc1 isacsx_rw.isacsx_r.isacsx_tr_tsdp_bc1
-#define I_TR_TSDP_BC1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_tsdp_bc1)
-#define i_tr_tsdp_bc2 isacsx_rw.isacsx_r.isacsx_tr_tsdp_bc2
-#define I_TR_TSDP_BC2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_tsdp_bc2)
-#define i_cda1_cr isacsx_rw.isacsx_r.isacsx_cda1_cr
-#define I_CDA1_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda1_cr)
-#define i_cda2_cr isacsx_rw.isacsx_r.isacsx_cda2_cr
-#define I_CDA2_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_cda2_cr)
-#define i_tr_cr isacsx_rw.isacsx_r.isacsx_tr_cr
-#define I_TR_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_tr_cr)
-#define i_dci_cr isacsx_rw.isacsx_r.isacsx_dci_cr
-#define I_DCI_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_dci_cr)
-#define i_mon_cr isacsx_rw.isacsx_r.isacsx_mon_cr
-#define I_MON_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_mon_cr)
-#define i_sds_cr isacsx_rw.isacsx_r.isacsx_sds_cr
-#define I_SDS_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sds_cr)
-#define i_iom_cr isacsx_rw.isacsx_r.isacsx_iom_cr
-#define I_IOM_CR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_iom_cr)
-#define i_asti isacsx_rw.isacsx_r.isacsx_asti
-#define I_ASTI REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_asti)
-#define i_msti isacsx_rw.isacsx_r.isacsx_msti
-#define I_MSTI REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_msti)
-#define i_sds_conf isacsx_rw.isacsx_r.isacsx_sds_conf
-#define I_SDS_CONF REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_r.isacsx_sds_conf)
-#define i_mox isacsx_rw.isacsx_w.isacsx_mox
-#define I_MOX REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_mox)
-#define i_wmocr isacsx_rw.isacsx_w.isacsx_mocr
-#define I_WMOCR REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_mocr)
-#define i_mconf isacsx_rw.isacsx_w.isacsx_mconf
-#define I_MCONF REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_mconf)
-#define i_mask isacsx_rw.isacsx_w.isacsx_mask
-#define I_MASK REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_mask)
-#define i_auxm isacsx_rw.isacsx_w.isacsx_auxm
-#define I_AUXM REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_auxm)
-#define i_wmode1 isacsx_rw.isacsx_w.isacsx_mode1
-#define I_WMODE1 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_mode1)
-#define i_wmode2 isacsx_rw.isacsx_w.isacsx_mode2
-#define I_WMODE2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_mode2)
-#define i_sres isacsx_rw.isacsx_w.isacsx_sres
-#define I_SRES REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_sres)
-#define i_wtimr2 isacsx_rw.isacsx_w.isacsx_timr2
-#define I_WTIMR2 REG_OFFSET(isacsx_reg_t, isacsx_rw.isacsx_w.isacsx_timr2)
-
-#define ISACSX_ISTAD_RME 0x80
-#define ISACSX_ISTAD_RPF 0x40
-#define ISACSX_ISTAD_RFO 0x20
-#define ISACSX_ISTAD_XPR 0x10
-#define ISACSX_ISTAD_XMR 0x08
-#define ISACSX_ISTAD_XDU 0x04
-
-#define ISACSX_MASKD_RME 0x80
-#define ISACSX_MASKD_RPF 0x40
-#define ISACSX_MASKD_RFO 0x20
-#define ISACSX_MASKD_XPR 0x10
-#define ISACSX_MASKD_XMR 0x08
-#define ISACSX_MASKD_XDU 0x04
-/* these must always be set */
-#define ISACSX_MASKD_LOW 0x03
-#define ISACSX_MASKD_ALL 0xff
-
-#define ISACSX_STARD_XDOV 0x80
-#define ISACSX_STARD_XFW 0x40
-#define ISACSX_STARD_RAC1 0x08
-#define ISACSX_STARD_XAC1 0x02
-
-#define ISACSX_CMDRD_RMC 0x80
-#define ISACSX_CMDRD_RRES 0x40
-#define ISACSX_CMDRD_STI 0x10
-#define ISACSX_CMDRD_XTF 0x08
-#define ISACSX_CMDRD_XME 0x02
-#define ISACSX_CMDRD_XRES 0x01
-
-#define ISACSX_MODED_MDS2 0x80
-#define ISACSX_MODED_MDS1 0x40
-#define ISACSX_MODED_MDS0 0x20
-#define ISACSX_MODED_RAC 0x08
-#define ISACSX_MODED_DIM2 0x04
-#define ISACSX_MODED_DIM1 0x02
-#define ISACSX_MODED_DIM0 0x01
-
-/* default */
-#define ISACSX_EXMD1_XFBS_32 0x00 /* XFIFO is 32 bytes */
-#define ISACSX_EXMD1_XFBS_16 0x80 /* XFIFO is 16 bytes */
-/* default */
-#define ISACSX_EXMD1_RFBS_32 0x00 /* XFIFO is 32 bytes */
-#define ISACSX_EXMD1_RFBS_16 0x20 /* XFIFO is 16 bytes */
-#define ISACSX_EXMD1_RFBS_08 0x40 /* XFIFO is 8 bytes */
-#define ISACSX_EXMD1_RFBS_04 0x60 /* XFIFO is 4 bytes */
-#define ISACSX_EXMD1_SRA 0x10
-#define ISACSX_EXMD1_XCRC 0x08
-#define ISACSX_EXMD1_RCRC 0x04
-#define ISACSX_EXMD1_ITF 0x01
-
-#define ISACSX_RSTAD_VFR 0x80
-#define ISACSX_RSTAD_RDO 0x40
-#define ISACSX_RSTAD_CRC 0x20
-#define ISACSX_RSTAD_RAB 0x10
-#define ISACSX_RSTAD_SA1 0x08
-#define ISACSX_RSTAD_SA0 0x04
-#define ISACSX_RSTAD_CR 0x02
-#define ISACSX_RSTAD_TA 0x01
-
-#define ISACSX_RSTAD_MASK 0xf0 /* the interesting bits */
-
-#define ISACSX_RBCHD_OV 0x10
-/* the other 4 bits are the high bits of the receive byte count */
-
-#define ISACSX_CIR0_CIC0 0x08
-/* CODR0 >> 4 */
-#define ISACSX_CIR0_IPU 0x07
-#define ISACSX_CIR0_IDR 0x00
-#define ISACSX_CIR0_ISD 0x02
-#define ISACSX_CIR0_IDIS 0x03
-#define ISACSX_CIR0_IEI 0x06
-#define ISACSX_CIR0_IRSY 0x04
-#define ISACSX_CIR0_IARD 0x08
-#define ISACSX_CIR0_ITI 0x0a
-#define ISACSX_CIR0_IATI 0x0b
-#define ISACSX_CIR0_IAI8 0x0c
-#define ISACSX_CIR0_IAI10 0x0d
-#define ISACSX_CIR0_IDID 0x0f
-
-#define ISACSX_IOM_CR_SPU 0x80
-#define ISACSX_IOM_CR_CI_CS 0x20
-#define ISACSX_IOM_CR_TIC_DIS 0x10
-#define ISACSX_IOM_CR_EN_BCL 0x08
-#define ISACSX_IOM_CR_CLKM 0x04
-#define ISACSX_IOM_CR_DIS_OD 0x02
-#define ISACSX_IOM_CR_DIS_IOM 0x01
-
-#define ISACSX_CI_MASK 0x0f
-
-#define ISACSX_CIX0_BAC 0x01
-/* in IOM-2 mode the low bits are always 1 */
-#define ISACSX_CIX0_LOW 0x0e
-/* C/I codes from bits 7-4 (>> 4 & 0xf) */
-/* the commands */
-#define ISACSX_CIX0_CTIM 0
-#define ISACSX_CIX0_CRS 0x01
-/* test mode only */
-#define ISACSX_CIX0_CSSSP 0x02
-/* test mode only */
-#define ISACSX_CIX0_CSSCP 0x03
-#define ISACSX_CIX0_CAR8 0x08
-#define ISACSX_CIX0_CAR10 0x09
-#define ISACSX_CIX0_CARL 0x0a
-#define ISACSX_CIX0_CDIU 0x0f
-
-/* Interrupt, General Configuration Registers */
-
-#define ISACSX_ISTA_ST 0x20
-#define ISACSX_ISTA_CIC 0x10
-#define ISACSX_ISTA_AUX 0x08
-#define ISACSX_ISTA_TRAN 0x04
-#define ISACSX_ISTA_MOS 0x02
-#define ISACSX_ISTA_ICD 0x01
-
-#define ISACSX_MASK_ST 0x20
-#define ISACSX_MASK_CIC 0x10
-#define ISACSX_MASK_AUX 0x08
-#define ISACSX_MASK_TRAN 0x04
-#define ISACSX_MASK_MOS 0x02
-#define ISACSX_MASK_ICD 0x01
-
-#define ISACSX_AUXI_EAW 0x20
-#define ISACSX_AUXI_WOV 0x10
-#define ISACSX_AUXI_TIN2 0x08
-#define ISACSX_AUXI_TIN1 0x04
-
-#define ISACSX_AUXM_EAW 0x20
-#define ISACSX_AUXM_WOV 0x10
-#define ISACSX_AUXM_TIN2 0x08
-#define ISACSX_AUXM_TIN1 0x04
-
-#define ISACSX_MODE1_WTC1 0x10
-#define ISACSX_MODE1_WTC2 0x08
-#define ISACSX_MODE1_CFS 0x04
-#define ISACSX_MODE1_RSS2 0x02
-#define ISACSX_MODE1_RSS1 0x01
-
-#define ISACSX_MODE2_INT_POL 0x08
-#define ISACSX_MODE2_PPSDX 0x01
-
-#define ISACSX_ID_MASK 0x2F /* 0x01 = Version 1.3 */
-
-#endif /* I4B_ISACSX_H_ */
diff --git a/sys/i4b/layer1/ifpi2/i4b_ifpi2_l1.c b/sys/i4b/layer1/ifpi2/i4b_ifpi2_l1.c
deleted file mode 100644
index 33defe3..0000000
--- a/sys/i4b/layer1/ifpi2/i4b_ifpi2_l1.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
- * Copyright (c) 2001 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.
- *
- * 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_ifpi2_l1.c - AVM Fritz PCI Version 2 layer 1 handler
- * ---------------------------------------------
- * $Id$
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-
-#include <i4b/layer1/ifpi2/i4b_ifpi2_ext.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-/*---------------------------------------------------------------------------*
- *
- * 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
- *
- *---------------------------------------------------------------------------*/
-int
-ifpi2_ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- u_char cmd;
- int s;
- struct l1_softc *sc = ifpi2_scp[unit];
-
-#ifdef NOTDEF
- NDBGL1(L1_PRIM, "PH-DATA-REQ, unit %d, freeflag=%d", unit, freeflag);
-#endif
-
- if(m == NULL) /* failsafe */
- return (0);
-
- s = SPLI4B();
-
- if(sc->sc_I430state == ST_F3) /* layer 1 not running ? */
- {
- NDBGL1(L1_I_ERR, "still in state F3!");
- ifpi2_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 */
-
- NDBGL1(L1_I_MSG, "using 2nd ISAC TX buffer, state = %s", ifpi2_printstate(sc));
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = L0IFPI2UNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
- splx(s);
- return(1);
- }
-
- NDBGL1(L1_I_ERR, "No Space in TX FIFO, state = %s", ifpi2_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 = L0IFPI2UNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
-
- sc->sc_state |= ISAC_TX_ACTIVE; /* set transmitter busy flag */
-
- NDBGL1(L1_I_MSG, "ISAC_TX_ACTIVE set");
-
- 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
- *
- *---------------------------------------------------------------------------*/
-int
-ifpi2_ph_activate_req(int unit)
-{
- struct l1_softc *sc = ifpi2_scp[unit];
- NDBGL1(L1_PRIM, "PH-ACTIVATE-REQ, unit %d", unit);
- ifpi2_next_state(sc, EV_PHAR);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * command from the upper layers
- *---------------------------------------------------------------------------*/
-int
-ifpi2_mph_command_req(int unit, int command, void *parm)
-{
- struct l1_softc *sc = ifpi2_scp[unit];
-
- switch(command)
- {
- case CMR_DOPEN: /* daemon running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DOPEN", unit);
- sc->sc_enabled = 1;
- break;
-
- case CMR_DCLOSE: /* daemon not running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DCLOSE", unit);
- sc->sc_enabled = 0;
- break;
-
- case CMR_SETTRACE:
- NDBGL1(L1_PRIM, "unit %d, command = CMR_SETTRACE, parm = %d", unit, (unsigned int)parm);
- sc->sc_trace = (unsigned int)parm;
- break;
-
- default:
- NDBGL1(L1_ERROR, "ERROR, unknown command = %d, unit = %d, parm = %d", command, unit, (unsigned int)parm);
- break;
- }
-
- return(0);
-}
diff --git a/sys/i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c b/sys/i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c
deleted file mode 100644
index 58b87e7..0000000
--- a/sys/i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 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_ifpi2_l1fsm.c - AVM Fritz PCI layer 1 I.430 state machine
- * ------------------------------------------------------------
- * $Id$
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/ifpi2/i4b_ifpi2_ext.h>
-
-#if DO_I4B_DEBUG
-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"
-};
-#endif
-
-/* Function prototypes */
-
-static void timer3_expired (struct l1_softc *sc);
-static void T3_start (struct l1_softc *sc);
-static void T3_stop (struct l1_softc *sc);
-static void F_T3ex (struct l1_softc *sc);
-static void timer4_expired (struct l1_softc *sc);
-static void T4_start (struct l1_softc *sc);
-static void T4_stop (struct l1_softc *sc);
-static void F_AI8 (struct l1_softc *sc);
-static void F_AI10 (struct l1_softc *sc);
-static void F_I01 (struct l1_softc *sc);
-static void F_I02 (struct l1_softc *sc);
-static void F_I03 (struct l1_softc *sc);
-static void F_I2 (struct l1_softc *sc);
-static void F_ill (struct l1_softc *sc);
-static void F_NULL (struct l1_softc *sc);
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer3_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T3)
- {
- NDBGL1(L1_T_ERR, "state = %s", ifpi2_printstate(sc));
- sc->sc_I430T3 = 0;
-
- /* XXX try some recovery here XXX */
-
- ifpi2_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);
-
- i4b_l1_mph_status_ind(L0IFPI2UNIT(sc->sc_unit), STI_NOL1ACC, 0, NULL);
- }
-
- ifpi2_next_state(sc, EV_T3);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 start
- *---------------------------------------------------------------------------*/
-static void
-T3_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpi2_printstate(sc));
- sc->sc_I430T3 = 1;
- sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 stop
- *---------------------------------------------------------------------------*/
-static void
-T3_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpi2_printstate(sc));
-
- sc->sc_init_tries = 0; /* init connect retry count */
-
- if(sc->sc_I430T3)
- {
- sc->sc_I430T3 = 0;
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_T3ex(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_T3ex executing");
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPI2UNIT(sc->sc_unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer4_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T4)
- {
- NDBGL1(L1_T_MSG, "state = %s", ifpi2_printstate(sc));
- sc->sc_I430T4 = 0;
- i4b_l1_mph_status_ind(L0IFPI2UNIT(sc->sc_unit), STI_PDEACT, 0, NULL);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 start
- *---------------------------------------------------------------------------*/
-static void
-T4_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpi2_printstate(sc));
- sc->sc_I430T4 = 1;
- sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 stop
- *---------------------------------------------------------------------------*/
-static void
-T4_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpi2_printstate(sc));
-
- if(sc->sc_I430T4)
- {
- sc->sc_I430T4 = 0;
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI8
- *---------------------------------------------------------------------------*/
-static void
-F_AI8(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI8 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0IFPI2UNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_8;
-
- hdr.unit = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI10
- *---------------------------------------------------------------------------*/
-static void
-F_AI10(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI10 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0IFPI2UNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_10;
-
- hdr.unit = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in states F3 .. F5
- *---------------------------------------------------------------------------*/
-static void
-F_I01(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I01 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F6
- *---------------------------------------------------------------------------*/
-static void
-F_I02(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I02 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPI2UNIT(sc->sc_unit));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F7 or F8
- *---------------------------------------------------------------------------*/
-static void
-F_I03(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I03 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPI2UNIT(sc->sc_unit));
-
- T4_start(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: activate request
- *---------------------------------------------------------------------------*/
-static void
-F_AR(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AR executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO1_8;
-
- hdr.unit = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_TE;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
- ifpi2_isacsx_l1_cmd(sc, CMD_AR8);
-
- T3_start(sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO2
- *---------------------------------------------------------------------------*/
-static void
-F_I2(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I2 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO2;
-
- hdr.unit = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
-}
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(struct l1_softc *sc)
-{
- NDBGL1(L1_F_ERR, "FSM function F_ill executing");
-}
-
-/*---------------------------------------------------------------------------*
- * No action
- *---------------------------------------------------------------------------*/
-static void
-F_NULL(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_NULL executing");
-}
-
-
-/*---------------------------------------------------------------------------*
- * layer 1 state transition table
- *---------------------------------------------------------------------------*/
-struct ifpi2_state_tab {
- void (*func) (struct l1_softc *sc); /* function to execute */
- int newstate; /* next state */
-} ifpi2_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
-ifpi2_next_state(struct l1_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 = ifpi2_state_tab[event][currstate].newstate;
-
- if(newstate >= N_STATES)
- panic("i4b_l1fsm.c: newstate >= N_STATES\n");
-
- NDBGL1(L1_F_MSG, "FSM event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[newstate]);
-
- (*ifpi2_state_tab[event][currstate].func)(sc);
-
- if(newstate == ST_ILL)
- {
- newstate = ST_F3;
- NDBGL1(L1_F_ERR, "FSM Illegal State ERROR, oldstate = %s, newstate = %s, event = %s!",
- state_text[currstate],
- state_text[newstate],
- event_text[event]);
- }
-
- sc->sc_I430state = newstate;
-}
-
-#if DO_I4B_DEBUG
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-ifpi2_printstate(struct l1_softc *sc)
-{
- return((char *) state_text[sc->sc_I430state]);
-}
-#endif
diff --git a/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c b/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c
deleted file mode 100644
index e8dbbde..0000000
--- a/sys/i4b/layer1/ifpi2/i4b_ifpi2_pci.c
+++ /dev/null
@@ -1,1449 +0,0 @@
-/*-
- * Copyright (c) 2001 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.
- */
-
-/*---------------------------------------------------------------------------
- *
- * i4b_ifpi2_pci.c: AVM Fritz!Card PCI hardware driver
- * --------------------------------------------------
- * $Id$
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <machine/bus.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-/*#include <i4b/layer1/isic/i4b_isac.h>*/
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/layer1/ifpi2/i4b_ifpi2_ext.h>
-#include <i4b/layer1/ifpi2/i4b_ifpi2_isacsx.h>
-
-#define PCI_AVMA1_VID 0x1244
-#define PCI_AVMA1_V2_DID 0x0e00
-
-/* prototypes */
-static void avma1pp2_disable(device_t);
-static void avma1pp2_intr(void *);
-static void hscx_write_reg(int, u_int, struct l1_softc *);
-static u_char hscx_read_reg(int, struct l1_softc *);
-static u_int hscx_read_reg_int(int, struct l1_softc *);
-static void hscx_read_fifo(int, void *, size_t, struct l1_softc *);
-static void hscx_write_fifo(int, void *, size_t, struct l1_softc *);
-static void avma1pp2_hscx_int_handler(struct l1_softc *);
-static void avma1pp2_hscx_intr(int, u_int, struct l1_softc *);
-static void avma1pp2_init_linktab(struct l1_softc *);
-static void avma1pp2_bchannel_setup(int, int, int, int);
-static void avma1pp2_bchannel_start(int, int);
-static void avma1pp2_hscx_init(struct l1_softc *, int, int);
-static void avma1pp2_bchannel_stat(int, int, bchan_statistics_t *);
-static void avma1pp2_set_linktab(int, int, drvr_link_t *);
-static isdn_link_t * avma1pp2_ret_linktab(int, int);
-static int avma1pp2_pci_probe(device_t);
-static int avma1pp2_hscx_fifo(l1_bchan_state_t *, struct l1_softc *);
-int avma1pp2_attach_avma1pp(device_t);
-static void ifpi2_isacsx_intr(struct l1_softc *sc);
-
-static device_method_t avma1pp2_pci_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, avma1pp2_pci_probe),
- DEVMETHOD(device_attach, avma1pp2_attach_avma1pp),
- DEVMETHOD(device_shutdown, avma1pp2_disable),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, bus_generic_print_child),
- DEVMETHOD(bus_driver_added, bus_generic_driver_added),
-
- { 0, 0 }
-};
-
-static driver_t avma1pp2_pci_driver = {
- "ifpi2-",
- avma1pp2_pci_methods,
- sizeof(struct l1_softc)
-};
-
-static devclass_t avma1pp2_pci_devclass;
-
-DRIVER_MODULE(avma1pp2, pci, avma1pp2_pci_driver, avma1pp2_pci_devclass, 0, 0);
-
-/* jump table for multiplex routines */
-
-struct i4b_l1mux_func avma1pp2_l1mux_func = {
- avma1pp2_ret_linktab,
- avma1pp2_set_linktab,
- ifpi2_mph_command_req,
- ifpi2_ph_data_req,
- ifpi2_ph_activate_req,
-};
-
-struct l1_softc *ifpi2_scp[IFPI2_MAXUNIT];
-
-/*---------------------------------------------------------------------------*
- * AVM PCI Fritz!Card V. 2 special registers
- *---------------------------------------------------------------------------*/
-
-/*
- * AVM PCI Status Latch 0 read only bits
- */
-#define ASL_IRQ_ISAC 0x01 /* ISAC interrupt, active high */
-#define ASL_IRQ_HSCX 0x02 /* HSX interrupt, active high */
-#define ASL_IRQ_TIMER 0x04 /* Timer interrupt, active high */
-#define ASL_IRQ_BCHAN ASL_IRQ_HSCX
-/* actually active high */
-#define ASL_IRQ_Pending (ASL_IRQ_ISAC | ASL_IRQ_HSCX | ASL_IRQ_TIMER)
-
-/*
- * AVM PCI Status Latch 0 read only bits
- */
-#define ASL_RESET 0x01
-#define ASL_TIMERRESET 0x04
-#define ASL_ENABLE_INT 0x08
-
-/*
- * "HSCX" status bits
- */
-#define HSCX_STAT_RME 0x01
-#define HSCX_STAT_RDO 0x10
-#define HSCX_STAT_CRCVFRRAB 0x0E
-#define HSCX_STAT_CRCVFR 0x06
-#define HSCX_STAT_RML_MASK 0x3f00
-
-/*
- * "HSCX" interrupt bits
- */
-#define HSCX_INT_XPR 0x80
-#define HSCX_INT_XDU 0x40
-#define HSCX_INT_RPR 0x20
-#define HSCX_INT_MASK 0xE0
-
-/*
- * "HSCX" command bits
- */
-#define HSCX_CMD_XRS 0x80
-#define HSCX_CMD_XME 0x01
-#define HSCX_CMD_RRS 0x20
-#define HSCX_CMD_XML_MASK 0x3f00
-
-/* "HSCX" mode bits */
-#define HSCX_MODE_ITF_FLG 0x01
-#define HSCX_MODE_TRANS 0x02
-
-/* offsets to various registers in the ASIC, evidently */
-#define STAT0_OFFSET 0x02
-
-#define HSCX_FIFO1 0x10
-#define HSCX_FIFO2 0x18
-
-#define HSCX_STAT1 0x14
-#define HSCX_STAT2 0x1c
-
-#define ISACSX_INDEX 0x04
-#define ISACSX_DATA 0x08
-
-/*
- * Commands and parameters are sent to the "HSCX" as a long, but the
- * fields are handled as bytes.
- *
- * The long contains:
- * (prot << 16)|(txl << 8)|cmd
- *
- * where:
- * prot = protocol to use
- * txl = transmit length
- * cmd = the command to be executed
- *
- * The fields are defined as u_char in struct l1_softc.
- *
- * Macro to coalesce the byte fields into a u_int
- */
-#define AVMA1PPSETCMDLONG(f) (f) = ((sc->avma1pp_cmd) | (sc->avma1pp_txl << 8) \
- | (sc->avma1pp_prot << 16))
-
-/*
- * to prevent deactivating the "HSCX" when both channels are active we
- * define an HSCX_ACTIVE flag which is or'd into the channel's state
- * flag in avma1pp2_bchannel_setup upon active and cleared upon deactivation.
- * It is set high to allow room for new flags.
- */
-#define HSCX_AVMA1PP_ACTIVE 0x1000
-
-/*---------------------------------------------------------------------------*
- * AVM read fifo routines
- *---------------------------------------------------------------------------*/
-
-static void
-avma1pp2_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
- int i;
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_4(btag, bhandle, ISACSX_INDEX, 0);
- /* evidently each byte must be read as a long */
- for (i = 0; i < size; i++)
- ((u_int8_t *)buf)[i] = (u_int8_t)bus_space_read_4(btag, bhandle, ISACSX_DATA);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_read_fifo(0, buf, size, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_read_fifo(1, buf, size, sc);
- break;
- }
-}
-
-static void
-hscx_read_fifo(int chan, void *buf, size_t len, struct l1_softc *sc)
-{
- u_int32_t *ip;
- size_t cnt;
- int dataoff;
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- dataoff = chan ? HSCX_FIFO2 : HSCX_FIFO1;
-
- ip = (u_int32_t *)buf;
- cnt = 0;
- /* what if len isn't a multiple of sizeof(int) and buf is */
- /* too small ???? */
- while (cnt < len)
- {
- *ip++ = bus_space_read_4(btag, bhandle, dataoff);
- cnt += 4;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * AVM write fifo routines
- *---------------------------------------------------------------------------*/
-static void
-avma1pp2_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
- int i;
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_4(btag, bhandle, ISACSX_INDEX, 0);
- /* evidently each byte must written as a long */
- for (i = 0; i < size; i++)
- bus_space_write_4(btag, bhandle, ISACSX_DATA, ((unsigned char *)buf)[i]);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_write_fifo(0, buf, size, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_write_fifo(1, buf, size, sc);
- break;
- }
-}
-
-static void
-hscx_write_fifo(int chan, void *buf, size_t len, struct l1_softc *sc)
-{
- u_int32_t *ip;
- size_t cnt;
- int dataoff;
- l1_bchan_state_t *Bchan = &sc->sc_chan[chan];
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- dataoff = chan ? HSCX_FIFO2 : HSCX_FIFO1;
-
- sc->avma1pp_cmd &= ~HSCX_CMD_XME;
- sc->avma1pp_txl = 0;
- if (Bchan->out_mbuf_cur == NULL)
- {
- if (Bchan->bprot != BPROT_NONE)
- sc->avma1pp_cmd |= HSCX_CMD_XME;
- }
- if (len != sc->sc_bfifolen)
- sc->avma1pp_txl = len;
-
- cnt = 0; /* borrow cnt */
- AVMA1PPSETCMDLONG(cnt);
- hscx_write_reg(chan, cnt, sc);
-
- ip = (u_int32_t *)buf;
- cnt = 0;
- while (cnt < len)
- {
- bus_space_write_4(btag, bhandle, dataoff, *ip);
- ip++;
- cnt += 4;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * AVM write register routines
- *---------------------------------------------------------------------------*/
-
-static void
-avma1pp2_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_4(btag, bhandle, ISACSX_INDEX, offs);
- bus_space_write_4(btag, bhandle, ISACSX_DATA, data);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_write_reg(0, data, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_write_reg(1, data, sc);
- break;
- }
-}
-
-static void
-hscx_write_reg(int chan, u_int val, struct l1_softc *sc)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
- u_int off;
-
- off = (chan == 0 ? HSCX_STAT1 : HSCX_STAT2);
-
- bus_space_write_4(btag, bhandle, off, val);
-}
-
-/*---------------------------------------------------------------------------*
- * AVM read register routines
- *---------------------------------------------------------------------------*/
-static u_int8_t
-avma1pp2_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
- u_int8_t val;
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_4(btag, bhandle, ISACSX_INDEX, offs);
- val = (u_int8_t)bus_space_read_4(btag, bhandle, ISACSX_DATA);
- return(val);
- case ISIC_WHAT_HSCXA:
- return hscx_read_reg(0, sc);
- case ISIC_WHAT_HSCXB:
- return hscx_read_reg(1, sc);
- }
- return 0;
-}
-
-static u_char
-hscx_read_reg(int chan, struct l1_softc *sc)
-{
- return(hscx_read_reg_int(chan, sc) & 0xff);
-}
-
-/*
- * need to be able to return an int because the RBCH is in the 2nd
- * byte.
- */
-static u_int
-hscx_read_reg_int(int chan, struct l1_softc *sc)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
- u_int off;
-
- off = (chan == 0 ? HSCX_STAT1 : HSCX_STAT2);
- return(bus_space_read_4(btag, bhandle, off));
-}
-
-/*---------------------------------------------------------------------------*
- * avma1pp2_probe - probe for a card
- *---------------------------------------------------------------------------*/
-static int
-avma1pp2_pci_probe(dev)
- device_t dev;
-{
- u_int16_t did, vid;
-
- vid = pci_get_vendor(dev);
- did = pci_get_device(dev);
-
- if ((vid == PCI_AVMA1_VID) && (did == PCI_AVMA1_V2_DID)) {
- device_set_desc(dev, "AVM Fritz!Card PCI Version 2");
- return(0);
- }
-
- return(ENXIO);
-}
-
-/*---------------------------------------------------------------------------*
- * avma1pp2_attach_avma1pp - attach Fritz!Card PCI
- *---------------------------------------------------------------------------*/
-int
-avma1pp2_attach_avma1pp(device_t dev)
-{
- struct l1_softc *sc;
- u_int v;
- int unit, error = 0;
- int s;
- u_int16_t did, vid;
- void *ih = 0;
- bus_space_handle_t bhandle;
- bus_space_tag_t btag;
- l1_bchan_state_t *chan;
-
- s = splimp();
-
- vid = pci_get_vendor(dev);
- did = pci_get_device(dev);
- sc = device_get_softc(dev);
- unit = device_get_unit(dev);
- bzero(sc, sizeof(struct l1_softc));
-
- /* probably not really required */
- if(unit >= IFPI2_MAXUNIT) {
- printf("ifpi2-%d: Error, unit >= IFPI_MAXUNIT!\n", unit);
- splx(s);
- return(ENXIO);
- }
-
- if ((vid != PCI_AVMA1_VID) && (did != PCI_AVMA1_V2_DID)) {
- printf("ifpi2-%d: unknown device!?\n", unit);
- goto fail;
- }
-
- ifpi2_scp[unit] = sc;
-
- sc->sc_resources.io_rid[0] = PCIR_BAR(1);
- sc->sc_resources.io_base[0] = bus_alloc_resource_any(dev,
- SYS_RES_IOPORT, &sc->sc_resources.io_rid[0], RF_ACTIVE);
-
- if (sc->sc_resources.io_base[0] == NULL) {
- printf("ifpi2-%d: couldn't map IO port\n", unit);
- error = ENXIO;
- goto fail;
- }
-
- bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* Allocate interrupt */
- sc->sc_resources.irq_rid = 0;
- sc->sc_resources.irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid, RF_SHAREABLE | RF_ACTIVE);
-
- if (sc->sc_resources.irq == NULL) {
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]);
- printf("ifpi2-%d: couldn't map interrupt\n", unit);
- error = ENXIO;
- goto fail;
- }
-
- error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, NULL, avma1pp2_intr, sc, &ih);
-
- if (error) {
- bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_resources.irq);
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sc_resources.io_base[0]);
- printf("ifpi2-%d: couldn't set up irq\n", unit);
- goto fail;
- }
-
- sc->sc_unit = unit;
-
- /* end of new-bus stuff */
-
- ISAC_BASE = (caddr_t)ISIC_WHAT_ISAC;
-
- HSCX_A_BASE = (caddr_t)ISIC_WHAT_HSCXA;
- HSCX_B_BASE = (caddr_t)ISIC_WHAT_HSCXB;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = avma1pp2_read_reg;
- sc->writereg = avma1pp2_write_reg;
-
- sc->readfifo = avma1pp2_read_fifo;
- sc->writefifo = avma1pp2_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_AVMA1PCI_V2;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* set up some other miscellaneous things */
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* reset the card */
- /* the Linux driver does this to clear any pending ISAC interrupts */
- v = 0;
- v = ISAC_READ(I_RMODED);
-#ifdef AVMA1PCI_V2_DEBUG
- printf("avma1pp2_attach: I_MODED %x...", v);
-#endif
- v = ISAC_READ(I_ISTAD);
-#ifdef AVMA1PCI_V2_DEBUG
- printf("avma1pp2_attach: I_ISTAD %x...", v);
-#endif
- v = ISAC_READ(I_ISTA);
-#ifdef AVMA1PCI_V2_DEBUG
- printf("avma1pp2_attach: I_ISTA %x...", v);
-#endif
- ISAC_WRITE(I_MASKD, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
- /* the Linux driver does this to clear any pending HSCX interrupts */
- v = hscx_read_reg_int(0, sc);
-#ifdef AVMA1PCI_V2_DEBUG
- printf("avma1pp2_attach: 0 HSCX_STAT %x...", v);
-#endif
- v = hscx_read_reg_int(1, sc);
-#ifdef AVMA1PCI_V2_DEBUG
- printf("avma1pp2_attach: 1 HSCX_STAT %x\n", v);
-#endif
-
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, 0);
- DELAY(SEC_DELAY/100); /* 10 ms */
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, ASL_RESET);
- DELAY(SEC_DELAY/100); /* 10 ms */
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, 0);
- DELAY(SEC_DELAY/100); /* 10 ms */
-
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, ASL_TIMERRESET);
- DELAY(SEC_DELAY/100); /* 10 ms */
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, ASL_ENABLE_INT);
- DELAY(SEC_DELAY/100); /* 10 ms */
-
- /* from here to the end would normally be done in isic_pciattach */
-
- printf("ifpi2-%d: ISACSX %s\n", unit, "PSB3186");
-
- /* init the ISAC */
- ifpi2_isacsx_init(sc);
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- /* Init the channel mutexes */
- chan = &sc->sc_chan[HSCX_CH_A];
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp2_rx", NULL, MTX_DEF);
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp2_tx", NULL, MTX_DEF);
- chan = &sc->sc_chan[HSCX_CH_B];
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp2_rx", NULL, MTX_DEF);
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp2_tx", NULL, MTX_DEF);
-#endif
-
- /* init the "HSCX" */
- avma1pp2_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- avma1pp2_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* can't use the normal B-Channel stuff */
- avma1pp2_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 */
-
- i4b_l1_mph_status_ind(L0IFPI2UNIT(sc->sc_unit), STI_ATTACH, sc->sc_cardtyp, &avma1pp2_l1mux_func);
-
- fail:
- splx(s);
- return(error);
-}
-
-/*
- * this is the real interrupt routine
- */
-static void
-avma1pp2_hscx_intr(int h_chan, u_int stat, struct l1_softc *sc)
-{
- register l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- int activity = -1;
- u_int param = 0;
-
- NDBGL1(L1_H_IRQ, "%#x", stat);
-
- if((stat & HSCX_INT_XDU) && (chan->bprot != BPROT_NONE))/* xmit data underrun */
- {
- chan->stat_XDU++;
- NDBGL1(L1_H_XFRERR, "xmit data underrun");
- /* abort the transmission */
- sc->avma1pp_txl = 0;
- sc->avma1pp_cmd |= HSCX_CMD_XRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
- sc->avma1pp_cmd &= ~HSCX_CMD_XRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
-
- 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;
- }
- }
-
- /*
- * The following is based on examination of the Linux driver.
- *
- * The logic here is different than with a "real" HSCX; all kinds
- * of information (interrupt/status bits) are in stat.
- * HSCX_INT_RPR indicates a receive interrupt
- * HSCX_STAT_RDO indicates an overrun condition, abort -
- * otherwise read the bytes ((stat & HSCX_STZT_RML_MASK) >> 8)
- * HSCX_STAT_RME indicates end-of-frame and apparently any
- * CRC/framing errors are only reported in this state.
- * if ((stat & HSCX_STAT_CRCVFRRAB) != HSCX_STAT_CRCVFR)
- * CRC/framing error
- */
-
- if(stat & HSCX_INT_RPR)
- {
- register int fifo_data_len;
- int error = 0;
- /* always have to read the FIFO, so use a scratch buffer */
- u_char scrbuf[HSCX_FIFO_LEN];
-
- if(stat & HSCX_STAT_RDO)
- {
- chan->stat_RDO++;
- NDBGL1(L1_H_XFRERR, "receive data overflow");
- error++;
- }
-
- /*
- * check whether we're receiving data for an inactive B-channel
- * and discard it. This appears to happen for telephony when
- * both B-channels are active and one is deactivated. Since
- * it is not really possible to deactivate the channel in that
- * case (the ASIC seems to deactivate _both_ channels), the
- * "deactivated" channel keeps receiving data which can lead
- * to exhaustion of mbufs and a kernel panic.
- *
- * This is a hack, but it's the only solution I can think of
- * without having the documentation for the ASIC.
- * GJ - 28 Nov 1999
- */
- if (chan->state == HSCX_IDLE)
- {
- NDBGL1(L1_H_XFRERR, "toss data from %d", h_chan);
- error++;
- }
-
- fifo_data_len = ((stat & HSCX_STAT_RML_MASK) >> 8);
-
- if(fifo_data_len == 0)
- fifo_data_len = sc->sc_bfifolen;
-
- /* ALWAYS read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, scrbuf, fifo_data_len);
- chan->rxcount += fifo_data_len;
-
- /* 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 avma1pp2_hscx_intr: RME, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- if((chan->in_len + fifo_data_len) <= BCH_MAX_DATALEN)
- {
- /* OK to copy the data */
- bcopy(scrbuf, chan->in_cbptr, fifo_data_len);
- chan->in_cbptr += fifo_data_len;
- chan->in_len += 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 = L0IFPI2UNIT(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);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- if (stat & HSCX_STAT_RME)
- {
- if((stat & HSCX_STAT_CRCVFRRAB) == HSCX_STAT_CRCVFR)
- {
- (*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
- activity = ACT_RX;
-
- /* mark buffer ptr as unused */
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- else
- {
- chan->stat_CRC++;
- NDBGL1(L1_H_XFRERR, "CRC/RAB");
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- }
- }
- } /* END enough space in mbuf */
- 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 = L0IFPI2UNIT(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);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- if(!(i4b_l1_bchan_tel_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
- activity = ACT_RX;
-
- /* move rx'd data to rx queue */
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- (void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-#else
- if(!(IF_QFULL(&chan->rx_queue)))
- {
- IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
- }
- else
- {
- i4b_Bfreembuf(chan->in_mbuf);
- }
-#endif
- /* signal upper layer that data are available */
- (*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
-
- /* alloc new buffer */
-
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 avma1pp2_hscx_intr: RPF, cannot allocate new mbuf!\n");
-
- /* setup new data ptr */
-
- chan->in_cbptr = chan->in_mbuf->m_data;
-
- /* OK to copy the data */
- bcopy(scrbuf, chan->in_cbptr, fifo_data_len);
-
- chan->in_cbptr += fifo_data_len;
- chan->in_len = fifo_data_len;
-
- chan->rxcount += fifo_data_len;
- }
- else
- {
- NDBGL1(L1_H_XFRERR, "RAWHDLC rx buffer overflow in RPF, in_len=%d", chan->in_len);
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
- }
- } /* if(error == 0) */
- else
- {
- /* land here for RDO */
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- sc->avma1pp_txl = 0;
- sc->avma1pp_cmd |= HSCX_CMD_RRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
- sc->avma1pp_cmd &= ~HSCX_CMD_RRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
- }
- }
-
-
- /* transmit fifo empty, new data can be written to fifo */
-
- if(stat & HSCX_INT_XPR)
- {
- /*
- * for a description what is going on here, please have
- * a look at isic_bchannel_start() in i4b_bchan.c !
- */
-
- NDBGL1(L1_H_IRQ, "unit %d, chan %d - XPR, Tx Fifo Empty!", 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->isic_drvr_linktab->bch_tx_queue_empty)(chan->isic_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 = L0IFPI2UNIT(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);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(i4b_l1_bchan_tel_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
- activity = ACT_TX;
- }
- else
- {
- activity = ACT_TX;
- }
- }
- }
-
- avma1pp2_hscx_fifo(chan, sc);
- }
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->isic_drvr_linktab->bch_activity)(chan->isic_drvr_linktab->unit, activity);
-}
-
-/*
- * this is the main routine which checks each channel and then calls
- * the real interrupt routine as appropriate
- */
-static void
-avma1pp2_hscx_int_handler(struct l1_softc *sc)
-{
- u_int stat;
-
- /* has to be a u_int because the byte count is in the 2nd byte */
- stat = hscx_read_reg_int(0, sc);
- if (stat & HSCX_INT_MASK)
- avma1pp2_hscx_intr(0, stat, sc);
- stat = hscx_read_reg_int(1, sc);
- if (stat & HSCX_INT_MASK)
- avma1pp2_hscx_intr(1, stat, sc);
-}
-
-static void
-avma1pp2_disable(device_t dev)
-{
- struct l1_softc *sc = device_get_softc(dev);
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* could be still be wrong, but seems to prevent hangs */
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, 0x00);
-}
-
-static void
-avma1pp2_intr(void *xsc)
-{
- u_char stat;
- struct l1_softc *sc;
- bus_space_handle_t bhandle;
- bus_space_tag_t btag;
-
- sc = xsc;
- bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- stat = bus_space_read_1(btag, bhandle, STAT0_OFFSET);
- NDBGL1(L1_H_IRQ, "stat %x", stat);
- /* was there an interrupt from this card ? */
- if ((stat & ASL_IRQ_Pending) == 0)
- return; /* no */
- /* For slow machines loop as long as an interrupt is active */
- for (; ((stat & ASL_IRQ_Pending) != 0) ;)
- {
- /* interrupts are high active */
- if (stat & ASL_IRQ_TIMER)
- NDBGL1(L1_H_IRQ, "timer interrupt ???");
- if (stat & ASL_IRQ_HSCX)
- {
- NDBGL1(L1_H_IRQ, "HSCX");
- avma1pp2_hscx_int_handler(sc);
- }
- if (stat & ASL_IRQ_ISAC)
- {
- NDBGL1(L1_H_IRQ, "ISAC");
- ifpi2_isacsx_intr(sc);
- }
- stat = bus_space_read_1(btag, bhandle, STAT0_OFFSET);
- NDBGL1(L1_H_IRQ, "stat %x", stat);
-
- }
-}
-
-static void
-avma1pp2_hscx_init(struct l1_softc *sc, int h_chan, int activate)
-{
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- u_int param = 0;
-
- NDBGL1(L1_BCHAN, "unit=%d, channel=%d, %s",
- sc->sc_unit, h_chan, activate ? "activate" : "deactivate");
-
- sc->avma1pp_cmd = sc->avma1pp_prot = sc->avma1pp_txl = 0;
-
- if (activate == 0)
- {
- /* only deactivate if both channels are idle */
- if (sc->sc_chan[HSCX_CH_A].state != HSCX_IDLE ||
- sc->sc_chan[HSCX_CH_B].state != HSCX_IDLE)
- {
- return;
- }
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_TRANS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
- return;
- }
- if(chan->bprot == BPROT_RHDLC)
- {
- NDBGL1(L1_BCHAN, "BPROT_RHDLC");
-
- /* HDLC Frames, transparent mode 0 */
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_ITF_FLG;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
- sc->avma1pp_cmd = HSCX_CMD_XRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
- sc->avma1pp_cmd = 0;
- }
- else
- {
- NDBGL1(L1_BCHAN, "BPROT_NONE??");
-
- /* Raw Telephony, extended transparent mode 1 */
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_TRANS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
- sc->avma1pp_cmd = HSCX_CMD_XRS;
- AVMA1PPSETCMDLONG(param);
- hscx_write_reg(h_chan, param, sc);
- sc->avma1pp_cmd = 0;
- }
-}
-
-static void
-avma1pp2_bchannel_setup(int unit, int h_chan, int bprot, int activate)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi2_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
-
- int s = SPLI4B();
-
- if(activate == 0)
- {
- /* deactivation */
- chan->state = HSCX_IDLE;
- avma1pp2_hscx_init(sc, h_chan, activate);
- }
-
- NDBGL1(L1_BCHAN, "unit=%d, channel=%d, %s",
- 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 */
-
- chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
-
- 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 */
-
- chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
-
- 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 */
- avma1pp2_hscx_init(sc, h_chan, activate);
- chan->state |= HSCX_AVMA1PP_ACTIVE;
- }
-
- splx(s);
-}
-
-static void
-avma1pp2_bchannel_start(int unit, int h_chan)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi2_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- register l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- int s;
- int activity = -1;
-
- 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(!(i4b_l1_bchan_tel_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 = L0IFPI2UNIT(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);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- avma1pp2_hscx_fifo(chan, sc);
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->isic_drvr_linktab->bch_activity)(chan->isic_drvr_linktab->unit, activity);
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * return the address of isic drivers linktab
- *---------------------------------------------------------------------------*/
-static isdn_link_t *
-avma1pp2_ret_linktab(int unit, int channel)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi2_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- return(&chan->isic_isdn_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * set the driver linktab in the b channel softc
- *---------------------------------------------------------------------------*/
-static void
-avma1pp2_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi2_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- chan->isic_drvr_linktab = dlt;
-}
-
-
-/*---------------------------------------------------------------------------*
- * initialize our local linktab
- *---------------------------------------------------------------------------*/
-static void
-avma1pp2_init_linktab(struct l1_softc *sc)
-{
- l1_bchan_state_t *chan = &sc->sc_chan[HSCX_CH_A];
- isdn_link_t *lt = &chan->isic_isdn_linktab;
-
- /* make sure the hardware driver is known to layer 4 */
- /* avoid overwriting if already set */
- if (ctrl_types[CTRL_PASSIVE].set_linktab == NULL)
- {
- ctrl_types[CTRL_PASSIVE].set_linktab = i4b_l1_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = i4b_l1_ret_linktab;
- }
-
- /* local setup */
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_A;
- lt->bch_config = avma1pp2_bchannel_setup;
- lt->bch_tx_start = avma1pp2_bchannel_start;
- lt->bch_stat = avma1pp2_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->isic_isdn_linktab;
-
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_B;
- lt->bch_config = avma1pp2_bchannel_setup;
- lt->bch_tx_start = avma1pp2_bchannel_start;
- lt->bch_stat = avma1pp2_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;
-}
-
-/*
- * use this instead of isic_bchannel_stat in i4b_bchan.c because it's static
- */
-static void
-avma1pp2_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = ifpi2_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_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);
-}
-
-/*---------------------------------------------------------------------------*
- * fill HSCX fifo with data from the current mbuf
- * Put this here until it can go into i4b_hscx.c
- *---------------------------------------------------------------------------*/
-static int
-avma1pp2_hscx_fifo(l1_bchan_state_t *chan, struct l1_softc *sc)
-{
- int len;
- int nextlen;
- int i;
- int cmd = 0;
- /* using a scratch buffer simplifies writing to the FIFO */
- u_char scrbuf[HSCX_FIFO_LEN];
-
- len = 0;
-
- /*
- * 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(chan->out_mbuf_cur && len != sc->sc_bfifolen)
- {
- nextlen = min(chan->out_mbuf_cur_len, sc->sc_bfifolen - len);
-
-#ifdef NOTDEF
- printf("i:mh=%p, mc=%p, mcp=%p, 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,
- nextlen);
-#endif
-
- cmd |= HSCX_CMDR_XTF;
- /* collect the data in the scratch buffer */
- for (i = 0; i < nextlen; i++)
- scrbuf[i + len] = chan->out_mbuf_cur_ptr[i];
-
- 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 = L0IFPI2UNIT(sc->sc_unit);
- hdr.type = (chan->channel == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_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;
- }
- }
- }
- /* write what we have from the scratch buf to the HSCX fifo */
- if (len != 0)
- HSCX_WRFIFO(chan->channel, scrbuf, len);
- return(cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * ifpi2 - ISAC interrupt routine
- *---------------------------------------------------------------------------*/
-static void
-ifpi2_isacsx_intr(struct l1_softc *sc)
-{
- register u_char isacsx_irq_stat;
-
- for(;;)
- {
- /* get isac irq status */
- /* ISTA tells us whether it was a C/I or HDLC int. */
- isacsx_irq_stat = ISAC_READ(I_ISTA);
-
- if(isacsx_irq_stat)
- ifpi2_isacsx_irq(sc, isacsx_irq_stat); /* isac handler */
- else
- break;
- }
-
- ISAC_WRITE(I_MASKD, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
-
- DELAY(100);
-
- ISAC_WRITE(I_MASKD, isacsx_imaskd);
- ISAC_WRITE(I_MASK, isacsx_imask);
-}
-
-/*---------------------------------------------------------------------------*
- * ifpi2_recover - try to recover from irq lockup
- *---------------------------------------------------------------------------*/
-void
-ifpi2_recover(struct l1_softc *sc)
-{
- printf("ifpi2_recover %d\n", sc->sc_unit);
-#if 0 /* fix me later */
- u_char byte;
-
- /* get isac irq status */
-
- byte = ISAC_READ(I_ISTA);
-
- NDBGL1(L1_ERROR, " ISAC: ISTA = 0x%x", byte);
-
- if(byte & ISACSX_ISTA_EXI)
- NDBGL1(L1_ERROR, " ISAC: EXIR = 0x%x", (u_char)ISAC_READ(I_EXIR));
-
- if(byte & ISACSX_ISTA_CISQ)
- {
- byte = ISAC_READ(I_CIRR);
-
- NDBGL1(L1_ERROR, " ISAC: CISQ = 0x%x", byte);
-
- if(byte & ISACSX_CIRR_SQC)
- NDBGL1(L1_ERROR, " ISAC: SQRR = 0x%x", (u_char)ISAC_READ(I_SQRR));
- }
-
- NDBGL1(L1_ERROR, " ISAC: IMASK = 0x%x", ISACSX_IMASK);
-
- ISAC_WRITE(I_MASKD, 0xff);
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- ISAC_WRITE(I_MASKD, isacsx_imaskd);
- ISAC_WRITE(I_MASK, isacsx_imask);
-#endif
-}
diff --git a/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c b/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c
deleted file mode 100644
index fc06acf..0000000
--- a/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c
+++ /dev/null
@@ -1,1397 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Udo Schweigert. 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_ifpnp_avm.c: AVM Fritz!Card PnP hardware driver
- * ---------------------------------------------------
- * last edit-date: [Fri Jan 12 17:05:28 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <machine/bus.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <isa/isavar.h>
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/layer1/ifpnp/i4b_ifpnp_ext.h>
-
-/* prototypes */
-static void avm_pnp_intr(void *);
-static void hscx_write_reg(int, u_int, struct l1_softc *, u_int);
-static void hscx_write_reg_val(int, u_int, u_int8_t, struct l1_softc *);
-static u_int hscx_read_reg(int, u_int, struct l1_softc *);
-static void hscx_read_fifo(int, void *, size_t, struct l1_softc *);
-static void hscx_write_fifo(int, void *, size_t, struct l1_softc *);
-static void avm_pnp_hscx_int_handler(struct l1_softc *);
-static void avm_pnp_hscx_intr(int, u_int, u_int, struct l1_softc *);
-static void avm_pnp_init_linktab(struct l1_softc *);
-static void avm_pnp_bchannel_setup(int, int, int, int);
-static void avm_pnp_bchannel_start(int, int);
-static void avm_pnp_hscx_init(struct l1_softc *, int, int);
-static void avm_pnp_bchannel_stat(int, int, bchan_statistics_t *);
-static void avm_pnp_set_linktab(int, int, drvr_link_t *);
-static isdn_link_t * avm_pnp_ret_linktab(int, int);
-static int avm_pnp_probe(device_t);
-static int avm_pnp_hscx_fifo(l1_bchan_state_t *, struct l1_softc *);
-int avm_pnp_attach(device_t);
-static void ifpnp_isac_intr(struct l1_softc *sc);
-
-static device_method_t avm_pnp_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, avm_pnp_probe),
- DEVMETHOD(device_attach, avm_pnp_attach),
- { 0, 0 }
-};
-
-static driver_t avm_pnp_driver = {
- "ifpnp",
- avm_pnp_methods,
- sizeof(struct l1_softc)
-};
-
-static devclass_t avm_pnp_devclass;
-
-DRIVER_MODULE(avm_pnp, isa, avm_pnp_driver, avm_pnp_devclass, 0, 0);
-
-/* jump table for multiplex routines */
-
-struct i4b_l1mux_func avm_pnp_l1mux_func = {
- avm_pnp_ret_linktab,
- avm_pnp_set_linktab,
- ifpnp_mph_command_req,
- ifpnp_ph_data_req,
- ifpnp_ph_activate_req,
-};
-
-struct l1_softc *ifpnp_scp[IFPNP_MAXUNIT];
-
-/*---------------------------------------------------------------------------*
- * AVM PnP Fritz!Card special registers
- *---------------------------------------------------------------------------*/
-
-/*
- * register offsets from i/o base
- */
-#define CLASS_OFFSET 0x00
-#define REVISION_OFFSET 0x01
-#define STAT0_OFFSET 0x02
-#define STAT1_OFFSET 0x03
-#define ADDR_REG_OFFSET 0x04
-/*#define MODREG_OFFSET 0x06
-#define VERREG_OFFSET 0x07*/
-
-/* these 2 are used to select an ISAC register set */
-#define ISAC_LO_REG_OFFSET 0x04
-#define ISAC_HI_REG_OFFSET 0x06
-
-/* offset higher than this goes to the HI register set */
-#define MAX_LO_REG_OFFSET 0x2f
-
-/* mask for the offset */
-#define ISAC_REGSET_MASK 0x0f
-
-/* the offset from the base to the ISAC registers */
-#define ISAC_REG_OFFSET 0x10
-
-/* the offset from the base to the ISAC FIFO */
-#define ISAC_FIFO 0x02
-
-/* not really the HSCX, but sort of */
-#define HSCX_FIFO 0x00
-#define HSCX_STAT 0x04
-
-/*
- * AVM PnP Status Latch 0 read only bits
- */
-#define ASL_IRQ_ISAC 0x01 /* ISAC interrupt, active low */
-#define ASL_IRQ_HSCX 0x02 /* HSX interrupt, active low */
-#define ASL_IRQ_TIMER 0x04 /* Timer interrupt, active low */
-#define ASL_IRQ_BCHAN ASL_IRQ_HSCX
-/* actually active LOW */
-#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 */
-#define ASL_TESTBIT 0x10 /* active high */
-
-/*
- * AVM Status Latch 1 write only bits
- */
-#define ASL1_INTSEL 0x0f /* active high */
-#define ASL1_ENABLE_IOM 0x80 /* active high */
-
-/*
- * "HSCX" mode bits
- */
-#define HSCX_MODE_ITF_FLG 0x01
-#define HSCX_MODE_TRANS 0x02
-#define HSCX_MODE_CCR_7 0x04
-#define HSCX_MODE_CCR_16 0x08
-#define HSCX_MODE_TESTLOOP 0x80
-
-/*
- * "HSCX" status bits
- */
-#define HSCX_STAT_RME 0x01
-#define HSCX_STAT_RDO 0x10
-#define HSCX_STAT_CRCVFRRAB 0x0E
-#define HSCX_STAT_CRCVFR 0x06
-#define HSCX_STAT_RML_MASK 0x3f00
-
-/*
- * "HSCX" interrupt bits
- */
-#define HSCX_INT_XPR 0x80
-#define HSCX_INT_XDU 0x40
-#define HSCX_INT_RPR 0x20
-#define HSCX_INT_MASK 0xE0
-
-/*
- * "HSCX" command bits
- */
-#define HSCX_CMD_XRS 0x80
-#define HSCX_CMD_XME 0x01
-#define HSCX_CMD_RRS 0x20
-#define HSCX_CMD_XML_MASK 0x3f00
-
-/*
- * to prevent deactivating the "HSCX" when both channels are active we
- * define an HSCX_ACTIVE flag which is or'd into the channel's state
- * flag in avm_pnp_bchannel_setup upon active and cleared upon deactivation.
- * It is set high to allow room for new flags.
- */
-#define HSCX_AVMA1PP_ACTIVE 0x1000
-
-/*---------------------------------------------------------------------------*
- * AVM read fifo routines
- *---------------------------------------------------------------------------*/
-
-static void
-avm_pnp_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, ISAC_FIFO);
- bus_space_read_multi_1(btag, bhandle, ISAC_REG_OFFSET, buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_read_fifo(0, buf, size, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_read_fifo(1, buf, size, sc);
- break;
- }
-}
-
-static void
-hscx_read_fifo(int chan, void *buf, size_t len, struct l1_softc *sc)
-{
- u_int8_t *ip;
- size_t cnt;
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, chan);
- ip = (u_int8_t *)buf;
- cnt = 0;
- while (cnt++ < len)
- {
- *ip++ = bus_space_read_1(btag, bhandle, ISAC_REG_OFFSET);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * AVM write fifo routines
- *---------------------------------------------------------------------------*/
-static void
-avm_pnp_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, ISAC_FIFO);
- bus_space_write_multi_1(btag, bhandle, ISAC_REG_OFFSET, (u_int8_t*)buf, size);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_write_fifo(0, buf, size, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_write_fifo(1, buf, size, sc);
- break;
- }
-}
-
-static void
-hscx_write_fifo(int chan, void *buf, size_t len, struct l1_softc *sc)
-{
- u_int8_t *ip;
- size_t cnt;
- l1_bchan_state_t *Bchan = &sc->sc_chan[chan];
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- sc->avma1pp_cmd &= ~HSCX_CMD_XME;
- sc->avma1pp_txl = 0;
-
- if (Bchan->out_mbuf_cur == NULL)
- {
- if (Bchan->bprot != BPROT_NONE)
- sc->avma1pp_cmd |= HSCX_CMD_XME;
- }
- if (len != sc->sc_bfifolen)
- sc->avma1pp_txl = len;
-
- hscx_write_reg(chan, HSCX_STAT, sc, 3);
-
- ip = (u_int8_t *)buf;
- cnt = 0;
- while (cnt++ < len)
- {
- bus_space_write_1(btag, bhandle, ISAC_REG_OFFSET, *ip++);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * AVM write register routines
- *---------------------------------------------------------------------------*/
-
-static void
-avm_pnp_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- u_char reg_bank;
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- reg_bank = (offs > MAX_LO_REG_OFFSET) ? ISAC_HI_REG_OFFSET:ISAC_LO_REG_OFFSET;
- /* set the register bank */
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, reg_bank);
- bus_space_write_1(btag, bhandle, ISAC_REG_OFFSET + (offs & ISAC_REGSET_MASK), data);
- break;
- case ISIC_WHAT_HSCXA:
- hscx_write_reg_val(0, offs, data, sc);
- break;
- case ISIC_WHAT_HSCXB:
- hscx_write_reg_val(1, offs, data, sc);
- break;
- }
-}
-
-static void
-hscx_write_reg(int chan, u_int off, struct l1_softc *sc, u_int which)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* point at the correct channel */
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, chan);
- if (which & 4)
- bus_space_write_1(btag, bhandle, ISAC_REG_OFFSET + off + 2, sc->avma1pp_prot);
- if (which & 2)
- bus_space_write_1(btag, bhandle, ISAC_REG_OFFSET + off + 1, sc->avma1pp_txl);
- if (which & 1)
- bus_space_write_1(btag, bhandle, ISAC_REG_OFFSET + off, sc->avma1pp_cmd);
-}
-
-static void
-hscx_write_reg_val(int chan, u_int off, u_int8_t val, struct l1_softc *sc)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* point at the correct channel */
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, chan);
- bus_space_write_1(btag, bhandle, ISAC_REG_OFFSET + off, val);
-}
-
-/*---------------------------------------------------------------------------*
- * AVM read register routines
- *---------------------------------------------------------------------------*/
-static u_int8_t
-avm_pnp_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- u_char reg_bank;
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- reg_bank = (offs > MAX_LO_REG_OFFSET) ? ISAC_HI_REG_OFFSET:ISAC_LO_REG_OFFSET;
- /* set the register bank */
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, reg_bank);
- return(bus_space_read_1(btag, bhandle, ISAC_REG_OFFSET +
- (offs & ISAC_REGSET_MASK)));
- case ISIC_WHAT_HSCXA:
- return hscx_read_reg(0, offs, sc);
- case ISIC_WHAT_HSCXB:
- return hscx_read_reg(1, offs, sc);
- }
- return 0;
-}
-
-static u_int
-hscx_read_reg(int chan, u_int off, struct l1_softc *sc)
-{
- bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* point at the correct channel */
- bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, chan);
- return(bus_space_read_1(btag, bhandle, ISAC_REG_OFFSET + off));
-}
-
-
-static struct ifpnp_ids {
- u_long vend_id;
- char *id_str;
-} ifpnp_ids[] = {
- { 0x0009cd06, "AVM Fritz!Card PnP" },
- { 0, 0 }
-};
-
-/*---------------------------------------------------------------------------*
- * avm_pnp_probe - probe for a card
- *---------------------------------------------------------------------------*/
-static int
-avm_pnp_probe(dev)
- device_t dev;
-{
- struct ifpnp_ids *ids; /* pnp id's */
- char *string = NULL; /* the name */
- u_int32_t vend_id = isa_get_vendorid(dev); /* vendor id */
-
- /* search table of knowd id's */
-
- for(ids = ifpnp_ids; ids->vend_id != 0; ids++)
- {
- if(vend_id == ids->vend_id)
- {
- string = ids->id_str;
- break;
- }
- }
-
- if(string) /* set name if we have one */
- {
- device_set_desc(dev, string); /* set description */
- return 0;
- }
- else
- {
- return ENXIO;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * avm_pnp_attach - attach Fritz!Card PnP
- *---------------------------------------------------------------------------*/
-int
-avm_pnp_attach(device_t dev)
-{
- struct l1_softc *sc;
- u_int v;
- int unit, error = 0;
- int s;
- u_int16_t vid;
- void *ih = 0;
- bus_space_handle_t bhandle;
- bus_space_tag_t btag;
-
- s = splimp();
-
- vid = isa_get_vendorid(dev);
- sc = device_get_softc(dev);
- unit = device_get_unit(dev);
- bzero(sc, sizeof(struct l1_softc));
-
- /* probably not really required */
- if(unit >= IFPNP_MAXUNIT) {
- printf("avm_pnp%d: Error, unit >= IFPNP_MAXUNIT!\n", unit);
- splx(s);
- return(ENXIO);
- }
-
- ifpnp_scp[unit] = sc;
-
-
- /* get io_base */
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE ) ))
- {
- printf("avm_pnp_attach: Couldn't get my io_base.\n");
- return ENXIO;
- }
- if (sc->sc_resources.io_base[0] == NULL) {
- printf("avm_pnp%d: couldn't map IO port\n", unit);
- error = ENXIO;
- goto fail;
- }
-
- bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- /* will not be used for pnp devices */
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
-
- /* get irq, release io_base if we don't get it */
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE)))
- {
- printf("avm_pnp%d: Could not get irq.\n",unit);
- error = ENXIO;
- goto fail;
- }
-
- /* not needed */
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
- error = bus_setup_intr(dev,sc->sc_resources.irq,INTR_TYPE_NET,
- NULL, (void(*)(void*))avm_pnp_intr, sc,&ih);
- if (error != 0)
- {
- printf("avm_pnp%d: Could not setup irq.\n",unit);
- error = ENXIO;
- goto fail;
- }
- sc->sc_unit = unit;
-
- /* end of new-bus stuff */
-
- ISAC_BASE = (caddr_t)ISIC_WHAT_ISAC;
-
- HSCX_A_BASE = (caddr_t)ISIC_WHAT_HSCXA;
- HSCX_B_BASE = (caddr_t)ISIC_WHAT_HSCXB;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = avm_pnp_read_reg;
- sc->writereg = avm_pnp_write_reg;
-
- sc->readfifo = avm_pnp_read_fifo;
- sc->writefifo = avm_pnp_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_AVM_PNP;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* set up some other miscellaneous things */
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* reset the card */
- /* the Linux driver does this to clear any pending ISAC interrupts */
- v = 0;
- v = ISAC_READ(I_STAR);
- v = ISAC_READ(I_MODE);
- v = ISAC_READ(I_ADF2);
- v = ISAC_READ(I_ISTA);
- if (v & ISAC_ISTA_EXI)
- {
- v = ISAC_READ(I_EXIR);
- }
- v = ISAC_READ(I_CIRR);
- ISAC_WRITE(I_MASK, 0xff);
- /* the Linux driver does this to clear any pending HSCX interrupts */
- v = hscx_read_reg(0, HSCX_STAT, sc);
- v = hscx_read_reg(1, HSCX_STAT, sc);
-
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, ASL_RESET_ALL|ASL_TIMERDISABLE);
- DELAY(SEC_DELAY/100); /* 10 ms */
- bus_space_write_1(btag, bhandle, STAT1_OFFSET, ASL1_ENABLE_IOM|sc->sc_irq);
- DELAY(SEC_DELAY/100); /* 10 ms */
- bus_space_write_1(btag, bhandle, STAT0_OFFSET, ASL_TIMERRESET|ASL_ENABLE_INT|ASL_TIMERDISABLE);
- DELAY(SEC_DELAY/100); /* 10 ms */
-
- printf("ifpnp%d: AVM Fritz!Card PnP Class %#x Revision %d \n", unit,
- bus_space_read_1(btag, bhandle, CLASS_OFFSET),
- bus_space_read_1(btag, bhandle, REVISION_OFFSET));
-
- printf("ifpnp%d: ISAC %s (IOM-%c)\n", unit,
- "2085 Version A1/A2 or 2086/2186 Version 1.1",
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
-
-
- /* init the ISAC */
- ifpnp_isac_init(sc);
-
- /* init the "HSCX" */
- avm_pnp_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- avm_pnp_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* can't use the normal B-Channel stuff */
- avm_pnp_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;
-
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-
- /* init higher protocol layers */
-
- i4b_l1_mph_status_ind(L0IFPNPUNIT(sc->sc_unit), STI_ATTACH, sc->sc_cardtyp, &avm_pnp_l1mux_func);
-
- fail:
- splx(s);
- return(error);
-}
-
-/*
- * this is the real interrupt routine
- */
-static void
-avm_pnp_hscx_intr(int h_chan, u_int stat, u_int cnt, struct l1_softc *sc)
-{
- register l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- int activity = -1;
-
- NDBGL1(L1_H_IRQ, "%#x", stat);
-
- if((stat & HSCX_INT_XDU) && (chan->bprot != BPROT_NONE))/* xmit data underrun */
- {
- chan->stat_XDU++;
- NDBGL1(L1_H_XFRERR, "xmit data underrun");
- /* abort the transmission */
- sc->avma1pp_txl = 0;
- sc->avma1pp_cmd |= HSCX_CMD_XRS;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 1);
- sc->avma1pp_cmd &= ~HSCX_CMD_XRS;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 1);
-
- 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;
- }
- }
-
- /*
- * The following is based on examination of the Linux driver.
- *
- * The logic here is different than with a "real" HSCX; all kinds
- * of information (interrupt/status bits) are in stat.
- * HSCX_INT_RPR indicates a receive interrupt
- * HSCX_STAT_RDO indicates an overrun condition, abort -
- * otherwise read the bytes ((stat & HSCX_STZT_RML_MASK) >> 8)
- * HSCX_STAT_RME indicates end-of-frame and apparently any
- * CRC/framing errors are only reported in this state.
- * if ((stat & HSCX_STAT_CRCVFRRAB) != HSCX_STAT_CRCVFR)
- * CRC/framing error
- */
-
- if(stat & HSCX_INT_RPR)
- {
- register int fifo_data_len;
- int error = 0;
- /* always have to read the FIFO, so use a scratch buffer */
- u_char scrbuf[HSCX_FIFO_LEN];
-
- if(stat & HSCX_STAT_RDO)
- {
- chan->stat_RDO++;
- NDBGL1(L1_H_XFRERR, "receive data overflow");
- error++;
- }
-
- /*
- * check whether we're receiving data for an inactive B-channel
- * and discard it. This appears to happen for telephony when
- * both B-channels are active and one is deactivated. Since
- * it is not really possible to deactivate the channel in that
- * case (the ASIC seems to deactivate _both_ channels), the
- * "deactivated" channel keeps receiving data which can lead
- * to exhaustion of mbufs and a kernel panic.
- *
- * This is a hack, but it's the only solution I can think of
- * without having the documentation for the ASIC.
- * GJ - 28 Nov 1999
- */
- if (chan->state == HSCX_IDLE)
- {
- NDBGL1(L1_H_XFRERR, "toss data from %d", h_chan);
- error++;
- }
-
- fifo_data_len = cnt;
-
- if(fifo_data_len == 0)
- fifo_data_len = sc->sc_bfifolen;
-
- /* ALWAYS read data from HSCX fifo */
-
- HSCX_RDFIFO(h_chan, scrbuf, fifo_data_len);
- chan->rxcount += fifo_data_len;
-
- /* 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 avm_pnp_hscx_intr: RME, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- if((chan->in_len + fifo_data_len) <= BCH_MAX_DATALEN)
- {
- /* OK to copy the data */
- bcopy(scrbuf, chan->in_cbptr, fifo_data_len);
- chan->in_cbptr += fifo_data_len;
- chan->in_len += 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 = L0IFPNPUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- if (stat & HSCX_STAT_RME)
- {
- if((stat & HSCX_STAT_CRCVFRRAB) == HSCX_STAT_CRCVFR)
- {
- (*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
- activity = ACT_RX;
-
- /* mark buffer ptr as unused */
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- else
- {
- chan->stat_CRC++;
- NDBGL1(L1_H_XFRERR, "CRC/RAB");
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- }
- }
- } /* END enough space in mbuf */
- 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 = L0IFPNPUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- if(!(i4b_l1_bchan_tel_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
- activity = ACT_RX;
-
- /* move rx'd data to rx queue */
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- (void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-#else
- if(!(IF_QFULL(&chan->rx_queue)))
- {
- IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
- }
- else
- {
- i4b_Bfreembuf(chan->in_mbuf);
- }
-#endif
- /* signal upper layer that data are available */
- (*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
-
- /* alloc new buffer */
-
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 avm_pnp_hscx_intr: RPF, cannot allocate new mbuf!\n");
-
- /* setup new data ptr */
-
- chan->in_cbptr = chan->in_mbuf->m_data;
-
- /* OK to copy the data */
- bcopy(scrbuf, chan->in_cbptr, fifo_data_len);
-
- chan->in_cbptr += fifo_data_len;
- chan->in_len = fifo_data_len;
-
- chan->rxcount += fifo_data_len;
- }
- else
- {
- NDBGL1(L1_H_XFRERR, "RAWHDLC rx buffer overflow in RPF, in_len=%d", chan->in_len);
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
- }
- } /* if(error == 0) */
- else
- {
- /* land here for RDO */
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- sc->avma1pp_txl = 0;
- sc->avma1pp_cmd |= HSCX_CMD_RRS;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 1);
- sc->avma1pp_cmd &= ~HSCX_CMD_RRS;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 1);
- }
- }
-
-
- /* transmit fifo empty, new data can be written to fifo */
-
- if(stat & HSCX_INT_XPR)
- {
- /*
- * for a description what is going on here, please have
- * a look at isic_bchannel_start() in i4b_bchan.c !
- */
-
- NDBGL1(L1_H_IRQ, "unit %d, chan %d - XPR, Tx Fifo Empty!", 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->isic_drvr_linktab->bch_tx_queue_empty)(chan->isic_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 = L0IFPNPUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(i4b_l1_bchan_tel_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
- activity = ACT_TX;
- }
- else
- {
- activity = ACT_TX;
- }
- }
- }
-
- avm_pnp_hscx_fifo(chan, sc);
- }
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->isic_drvr_linktab->bch_activity)(chan->isic_drvr_linktab->unit, activity);
-}
-
-/*
- * this is the main routine which checks each channel and then calls
- * the real interrupt routine as appropriate
- */
-static void
-avm_pnp_hscx_int_handler(struct l1_softc *sc)
-{
- u_char stat = 0;
- u_char cnt = 0;
-
- stat = hscx_read_reg(0, HSCX_STAT, sc);
- if (stat & HSCX_INT_RPR)
- cnt = hscx_read_reg(0, HSCX_STAT+1, sc);
- if (stat & HSCX_INT_MASK)
- avm_pnp_hscx_intr(0, stat, cnt, sc);
-
- cnt = 0;
- stat = hscx_read_reg(1, HSCX_STAT, sc);
- if (stat & HSCX_INT_RPR)
- cnt = hscx_read_reg(1, HSCX_STAT+1, sc);
- if (stat & HSCX_INT_MASK)
- avm_pnp_hscx_intr(1, stat, cnt, sc);
-}
-
-static void
-avm_pnp_intr(void *xsc)
-{
- u_char stat;
- struct l1_softc *sc;
- bus_space_handle_t bhandle;
- bus_space_tag_t btag;
-
- sc = xsc;
- bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]);
- btag = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- stat = bus_space_read_1(btag, bhandle, STAT0_OFFSET);
- NDBGL1(L1_H_IRQ, "stat %x", stat);
- /* was there an interrupt from this card ? */
- if ((stat & ASL_IRQ_Pending) == ASL_IRQ_Pending)
- return; /* no */
- /* interrupts are low active */
- if (!(stat & ASL_IRQ_TIMER))
- NDBGL1(L1_H_IRQ, "timer interrupt ???");
- if (!(stat & ASL_IRQ_HSCX))
- {
- NDBGL1(L1_H_IRQ, "HSCX");
- avm_pnp_hscx_int_handler(sc);
- }
- if (!(stat & ASL_IRQ_ISAC))
- {
- NDBGL1(L1_H_IRQ, "ISAC");
- ifpnp_isac_intr(sc);
- }
-}
-
-static void
-avm_pnp_hscx_init(struct l1_softc *sc, int h_chan, int activate)
-{
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
-
- NDBGL1(L1_BCHAN, "unit=%d, channel=%d, %s",
- sc->sc_unit, h_chan, activate ? "activate" : "deactivate");
-
- if (activate == 0)
- {
- /* only deactivate if both channels are idle */
- if (sc->sc_chan[HSCX_CH_A].state != HSCX_IDLE ||
- sc->sc_chan[HSCX_CH_B].state != HSCX_IDLE)
- {
- return;
- }
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_TRANS;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 5);
- return;
- }
- if(chan->bprot == BPROT_RHDLC)
- {
- NDBGL1(L1_BCHAN, "BPROT_RHDLC");
-
- /* HDLC Frames, transparent mode 0 */
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_ITF_FLG;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 5);
- sc->avma1pp_cmd = HSCX_CMD_XRS;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 1);
- sc->avma1pp_cmd = 0;
- }
- else
- {
- NDBGL1(L1_BCHAN, "BPROT_NONE??");
-
- /* Raw Telephony, extended transparent mode 1 */
- sc->avma1pp_cmd = HSCX_CMD_XRS|HSCX_CMD_RRS;
- sc->avma1pp_prot = HSCX_MODE_TRANS;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 5);
- sc->avma1pp_cmd = HSCX_CMD_XRS;
- hscx_write_reg(h_chan, HSCX_STAT, sc, 1);
- sc->avma1pp_cmd = 0;
- }
-}
-
-static void
-avm_pnp_bchannel_setup(int unit, int h_chan, int bprot, int activate)
-{
- struct l1_softc *sc = ifpnp_scp[unit];
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
-
- int s = SPLI4B();
-
- if(activate == 0)
- {
- /* deactivation */
- chan->state = HSCX_IDLE;
- avm_pnp_hscx_init(sc, h_chan, activate);
- }
-
- NDBGL1(L1_BCHAN, "unit=%d, channel=%d, %s",
- 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 */
-
- chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avm_pnp_rx", NULL, MTX_DEF);
-#endif
-
- i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
-
- 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 */
-
- chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avm_pnp_tx", NULL, MTX_DEF);
-#endif
- i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
-
- 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 */
- avm_pnp_hscx_init(sc, h_chan, activate);
- chan->state |= HSCX_AVMA1PP_ACTIVE;
- }
-
- splx(s);
-}
-
-static void
-avm_pnp_bchannel_start(int unit, int h_chan)
-{
- struct l1_softc *sc = ifpnp_scp[unit];
- register l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- int s;
- int activity = -1;
-
- 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(!(i4b_l1_bchan_tel_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 = L0IFPNPUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- avm_pnp_hscx_fifo(chan, sc);
-
- /* call timeout handling routine */
-
- if(activity == ACT_RX || activity == ACT_TX)
- (*chan->isic_drvr_linktab->bch_activity)(chan->isic_drvr_linktab->unit, activity);
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * return the address of isic drivers linktab
- *---------------------------------------------------------------------------*/
-static isdn_link_t *
-avm_pnp_ret_linktab(int unit, int channel)
-{
- struct l1_softc *sc = ifpnp_scp[unit];
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- return(&chan->isic_isdn_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * set the driver linktab in the b channel softc
- *---------------------------------------------------------------------------*/
-static void
-avm_pnp_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
- struct l1_softc *sc = ifpnp_scp[unit];
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- chan->isic_drvr_linktab = dlt;
-}
-
-
-/*---------------------------------------------------------------------------*
- * initialize our local linktab
- *---------------------------------------------------------------------------*/
-static void
-avm_pnp_init_linktab(struct l1_softc *sc)
-{
- l1_bchan_state_t *chan = &sc->sc_chan[HSCX_CH_A];
- isdn_link_t *lt = &chan->isic_isdn_linktab;
-
- /* make sure the hardware driver is known to layer 4 */
- /* avoid overwriting if already set */
- if (ctrl_types[CTRL_PASSIVE].set_linktab == NULL)
- {
- ctrl_types[CTRL_PASSIVE].set_linktab = avm_pnp_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = avm_pnp_ret_linktab;
- }
-
- /* local setup */
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_A;
- lt->bch_config = avm_pnp_bchannel_setup;
- lt->bch_tx_start = avm_pnp_bchannel_start;
- lt->bch_stat = avm_pnp_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->isic_isdn_linktab;
-
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_B;
- lt->bch_config = avm_pnp_bchannel_setup;
- lt->bch_tx_start = avm_pnp_bchannel_start;
- lt->bch_stat = avm_pnp_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;
-}
-
-/*
- * use this instead of isic_bchannel_stat in i4b_bchan.c because it's static
- */
-static void
-avm_pnp_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp)
-{
- struct l1_softc *sc = ifpnp_scp[unit];
- l1_bchan_state_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);
-}
-
-/*---------------------------------------------------------------------------*
- * fill HSCX fifo with data from the current mbuf
- * Put this here until it can go into i4b_hscx.c
- *---------------------------------------------------------------------------*/
-static int
-avm_pnp_hscx_fifo(l1_bchan_state_t *chan, struct l1_softc *sc)
-{
- int len;
- int nextlen;
- int i;
- int cmd = 0;
- /* using a scratch buffer simplifies writing to the FIFO */
- u_char scrbuf[HSCX_FIFO_LEN];
-
- len = 0;
-
- /*
- * 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(chan->out_mbuf_cur && len != sc->sc_bfifolen)
- {
- nextlen = min(chan->out_mbuf_cur_len, sc->sc_bfifolen - len);
-
-#ifdef NOTDEF
- printf("i:mh=%p, mc=%p, mcp=%p, 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,
- nextlen);
-#endif
-
- cmd |= HSCX_CMDR_XTF;
- /* collect the data in the scratch buffer */
- for (i = 0; i < nextlen; i++)
- scrbuf[i + len] = chan->out_mbuf_cur_ptr[i];
-
- 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 = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = (chan->channel == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_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;
- }
- }
- }
- /* write what we have from the scratch buf to the HSCX fifo */
- if (len != 0)
- HSCX_WRFIFO(chan->channel, scrbuf, len);
- return(cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * ifpnp - ISAC interrupt routine
- *---------------------------------------------------------------------------*/
-static void
-ifpnp_isac_intr(struct l1_softc *sc)
-{
- register u_char isac_irq_stat;
-
- for(;;)
- {
- /* get isac irq status */
- isac_irq_stat = ISAC_READ(I_ISTA);
-
- if(isac_irq_stat)
- ifpnp_isac_irq(sc, isac_irq_stat); /* isac handler */
- else
- break;
- }
-
- ISAC_WRITE(I_MASK, 0xff);
-
- DELAY(100);
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
-
-/*---------------------------------------------------------------------------*
- * ifpnp_recover - try to recover from irq lockup
- *---------------------------------------------------------------------------*/
-void
-ifpnp_recover(struct l1_softc *sc)
-{
- u_char byte;
-
- /* get isac irq status */
-
- byte = ISAC_READ(I_ISTA);
-
- NDBGL1(L1_ERROR, " ISAC: ISTA = 0x%x", byte);
-
- if(byte & ISAC_ISTA_EXI)
- NDBGL1(L1_ERROR, " ISAC: EXIR = 0x%x", (u_char)ISAC_READ(I_EXIR));
-
- if(byte & ISAC_ISTA_CISQ)
- {
- byte = ISAC_READ(I_CIRR);
-
- NDBGL1(L1_ERROR, " ISAC: CISQ = 0x%x", byte);
-
- if(byte & ISAC_CIRR_SQC)
- NDBGL1(L1_ERROR, " ISAC: SQRR = 0x%x", (u_char)ISAC_READ(I_SQRR));
- }
-
- NDBGL1(L1_ERROR, " ISAC: IMASK = 0x%x", ISAC_IMASK);
-
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
diff --git a/sys/i4b/layer1/ifpnp/i4b_ifpnp_ext.h b/sys/i4b/layer1/ifpnp/i4b_ifpnp_ext.h
deleted file mode 100644
index e89dacf..0000000
--- a/sys/i4b/layer1/ifpnp/i4b_ifpnp_ext.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * Copyright (c) 2000 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.
- *
- * 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_ifpnp - Fritz!Card PnP for split layers
- * -------------------------------------------
- *
- * $Id: i4b_ifpnp_ext.h,v 1.2 2000/06/02 16:14:36 hm Exp $
- * $Ust: src/i4b/layer1-nb/ifpnp/i4b_ifpnp_ext.h,v 1.4 2000/04/18 08:03:05 ust Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Fri Jun 2 14:54:57 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IFPNP_EXT_H_
-#define _I4B_IFPNP_EXT_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-void ifpnp_set_linktab(int unit, int channel, drvr_link_t * dlt);
-isdn_link_t *ifpnp_ret_linktab(int unit, int channel);
-
-int ifpnp_ph_data_req(int unit, struct mbuf *m, int freeflag);
-int ifpnp_ph_activate_req(int unit);
-int ifpnp_mph_command_req(int unit, int command, void *parm);
-
-void ifpnp_isac_irq(struct l1_softc *sc, int ista);
-void ifpnp_isac_l1_cmd(struct l1_softc *sc, int command);
-int ifpnp_isac_init(struct l1_softc *sc);
-
-void ifpnp_recover(struct l1_softc *sc);
-char * ifpnp_printstate(struct l1_softc *sc);
-void ifpnp_next_state(struct l1_softc *sc, int event);
-
-#define IFPNP_MAXUNIT 4
-extern struct l1_softc *ifpnp_scp[IFPNP_MAXUNIT];
-
-#endif /* _I4B_IFPNP_EXT_H_ */
diff --git a/sys/i4b/layer1/ifpnp/i4b_ifpnp_isac.c b/sys/i4b/layer1/ifpnp/i4b_ifpnp_isac.c
deleted file mode 100644
index 4a94940..0000000
--- a/sys/i4b/layer1/ifpnp/i4b_ifpnp_isac.c
+++ /dev/null
@@ -1,659 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 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_ifpnp_isac.c - i4b Fritz PnP ISAC handler
- * ---------------------------------------------
- * $Id: i4b_ifpnp_isac.c,v 1.3 2000/05/29 15:41:41 hm Exp $
- * $Ust: src/i4b/layer1-nb/ifpnp/i4b_ifpnp_isac.c,v 1.4 2000/04/18 08:03:05 ust Exp $
- * last edit-date: [Mon May 29 15:24:49 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/layer1/ifpnp/i4b_ifpnp_ext.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char ifpnp_isac_exir_hdlr(register struct l1_softc *sc, u_char exir);
-static void ifpnp_isac_ind_hdlr(register struct l1_softc *sc, int ind);
-
-/*---------------------------------------------------------------------------*
- * ISAC interrupt service routine
- *---------------------------------------------------------------------------*/
-void
-ifpnp_isac_irq(struct l1_softc *sc, int ista)
-{
- register u_char c = 0;
- NDBGL1(L1_F_MSG, "unit %d: ista = 0x%02x", sc->sc_unit, ista);
-
- if(ista & ISAC_ISTA_EXI) /* extended interrupt */
- {
- c |= ifpnp_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++;
- NDBGL1(L1_I_ERR, "unit %d: CRC error", sc->sc_unit);
- }
-
- if(rsta & ISAC_RSTA_RDO) /* ReceiveDataOverflow */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Data Overrun error", sc->sc_unit);
- }
-
- if(rsta & ISAC_RSTA_RAB) /* ReceiveABorted */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Receive Aborted error", sc->sc_unit);
- }
-
- if(error == 0)
- NDBGL1(L1_I_ERR, "unit %d: RME unknown error, RSTA = 0x%02x!", 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("ifpnp_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 = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, sc->sc_ibuf->m_len, sc->sc_ibuf->m_data);
- }
-
- c |= ISAC_CMDR_RMC;
-
- if(sc->sc_enabled &&
- (ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S))
- {
- i4b_l1_ph_data_ind(L0IFPNPUNIT(sc->sc_unit), sc->sc_ibuf);
- }
- else
- {
- i4b_Dfreembuf(sc->sc_ibuf);
- }
- }
- else
- {
- NDBGL1(L1_I_ERR, "RME, input buffer overflow!");
- 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("ifpnp_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
- {
- NDBGL1(L1_I_ERR, "RPF, input buffer overflow!");
- 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)
- ifpnp_isac_ind_hdlr(sc, (ci >> 2) & 0xf);
- }
-
- if(c)
- {
- ISAC_WRITE(I_CMDR, c);
- ISACCMDRWRDELAY();
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Extended IRQ handler
- *---------------------------------------------------------------------------*/
-static u_char
-ifpnp_isac_exir_hdlr(register struct l1_softc *sc, u_char exir)
-{
- u_char c = 0;
-
- if(exir & ISAC_EXIR_XMR)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Message Repeat");
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_XDU)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Data Underrun");
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_PCE)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Protocol Error");
- }
-
- if(exir & ISAC_EXIR_RFO)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Rx Frame Overflow");
-
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
-
- if(exir & ISAC_EXIR_SOV)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Sync Xfer Overflow");
- }
-
- if(exir & ISAC_EXIR_MOS)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Monitor Status");
- }
-
- if(exir & ISAC_EXIR_SAW)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Subscriber Awake");
- }
-
- if(exir & ISAC_EXIR_WOV)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Watchdog Timer Overflow");
- }
-
- return(c);
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Indication handler
- *---------------------------------------------------------------------------*/
-static void
-ifpnp_isac_ind_hdlr(register struct l1_softc *sc, int ind)
-{
- register int event;
-
- switch(ind)
- {
- case ISAC_CIRR_IAI8:
- NDBGL1(L1_I_CICO, "rx AI8 in state %s", ifpnp_printstate(sc));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- ifpnp_isac_l1_cmd(sc, CMD_AR8);
- event = EV_INFO48;
- i4b_l1_mph_status_ind(L0IFPNPUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISAC_CIRR_IAI10:
- NDBGL1(L1_I_CICO, "rx AI10 in state %s", ifpnp_printstate(sc));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- ifpnp_isac_l1_cmd(sc, CMD_AR10);
- event = EV_INFO410;
- i4b_l1_mph_status_ind(L0IFPNPUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISAC_CIRR_IRSY:
- NDBGL1(L1_I_CICO, "rx RSY in state %s", ifpnp_printstate(sc));
- event = EV_RSY;
- break;
-
- case ISAC_CIRR_IPU:
- NDBGL1(L1_I_CICO, "rx PU in state %s", ifpnp_printstate(sc));
- event = EV_PU;
- break;
-
- case ISAC_CIRR_IDR:
- NDBGL1(L1_I_CICO, "rx DR in state %s", ifpnp_printstate(sc));
- ifpnp_isac_l1_cmd(sc, CMD_DIU);
- event = EV_DR;
- break;
-
- case ISAC_CIRR_IDID:
- NDBGL1(L1_I_CICO, "rx DID in state %s", ifpnp_printstate(sc));
- event = EV_INFO0;
- i4b_l1_mph_status_ind(L0IFPNPUNIT(sc->sc_unit), STI_L1STAT, LAYER_IDLE, NULL);
- break;
-
- case ISAC_CIRR_IDIS:
- NDBGL1(L1_I_CICO, "rx DIS in state %s", ifpnp_printstate(sc));
- event = EV_DIS;
- break;
-
- case ISAC_CIRR_IEI:
- NDBGL1(L1_I_CICO, "rx EI in state %s", ifpnp_printstate(sc));
- ifpnp_isac_l1_cmd(sc, CMD_DIU);
- event = EV_EI;
- break;
-
- case ISAC_CIRR_IARD:
- NDBGL1(L1_I_CICO, "rx ARD in state %s", ifpnp_printstate(sc));
- event = EV_INFO2;
- break;
-
- case ISAC_CIRR_ITI:
- NDBGL1(L1_I_CICO, "rx TI in state %s", ifpnp_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_IATI:
- NDBGL1(L1_I_CICO, "rx ATI in state %s", ifpnp_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_ISD:
- NDBGL1(L1_I_CICO, "rx SD in state %s", ifpnp_printstate(sc));
- event = EV_INFO0;
- break;
-
- default:
- NDBGL1(L1_I_ERR, "UNKNOWN Indication 0x%x in state %s", ind, ifpnp_printstate(sc));
- event = EV_INFO0;
- break;
- }
- ifpnp_next_state(sc, event);
-}
-
-/*---------------------------------------------------------------------------*
- * execute a layer 1 command
- *---------------------------------------------------------------------------*/
-void
-ifpnp_isac_l1_cmd(struct l1_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)
- {
- NDBGL1(L1_I_ERR, "illegal cmd 0x%x in state %s", command, ifpnp_printstate(sc));
- return;
- }
-
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- cmd = ISAC_CIX0_LOW;
- else
- cmd = 0;
-
- switch(command)
- {
- case CMD_TIM:
- NDBGL1(L1_I_CICO, "tx TIM in state %s", ifpnp_printstate(sc));
- cmd |= (ISAC_CIXR_CTIM << 2);
- break;
-
- case CMD_RS:
- NDBGL1(L1_I_CICO, "tx RS in state %s", ifpnp_printstate(sc));
- cmd |= (ISAC_CIXR_CRS << 2);
- break;
-
- case CMD_AR8:
- NDBGL1(L1_I_CICO, "tx AR8 in state %s", ifpnp_printstate(sc));
- cmd |= (ISAC_CIXR_CAR8 << 2);
- break;
-
- case CMD_AR10:
- NDBGL1(L1_I_CICO, "tx AR10 in state %s", ifpnp_printstate(sc));
- cmd |= (ISAC_CIXR_CAR10 << 2);
- break;
-
- case CMD_DIU:
- NDBGL1(L1_I_CICO, "tx DIU in state %s", ifpnp_printstate(sc));
- cmd |= (ISAC_CIXR_CDIU << 2);
- break;
- }
- ISAC_WRITE(I_CIXR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * L1 ISAC initialization
- *---------------------------------------------------------------------------*/
-int
-ifpnp_isac_init(struct l1_softc *sc)
-{
- ISAC_IMASK = 0xff; /* disable all irqs */
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- if(sc->sc_bustyp != BUS_TYPE_IOM2)
- {
- NDBGL1(L1_I_SETUP, "configuring for IOM-1 mode");
-
- /* 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
- {
- NDBGL1(L1_I_SETUP, "configuring for IOM-2 mode");
-
- /* 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);
-}
diff --git a/sys/i4b/layer1/ifpnp/i4b_ifpnp_l1.c b/sys/i4b/layer1/ifpnp/i4b_ifpnp_l1.c
deleted file mode 100644
index e0cfc50..0000000
--- a/sys/i4b/layer1/ifpnp/i4b_ifpnp_l1.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 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_ifpnp_l1.c - AVM Fritz PnP layer 1 handler
- * ----------------------------------------------
- * $Id: i4b_ifpnp_l1.c,v 1.4 2000/06/02 16:14:36 hm Exp $
- * $Ust: src/i4b/layer1-nb/ifpnp/i4b_ifpnp_l1.c,v 1.4 2000/04/18 08:03:05 ust Exp $
- * last edit-date: [Fri Jun 2 14:55:49 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-
-#include <i4b/layer1/ifpnp/i4b_ifpnp_ext.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-/*---------------------------------------------------------------------------*
- *
- * 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
- *
- *---------------------------------------------------------------------------*/
-int
-ifpnp_ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- u_char cmd;
- int s;
- struct l1_softc *sc = ifpnp_scp[unit];
-
-#ifdef NOTDEF
- NDBGL1(L1_PRIM, "PH-DATA-REQ, unit %d, freeflag=%d", unit, freeflag);
-#endif
-
- if(m == NULL) /* failsafe */
- return (0);
-
- s = SPLI4B();
-
- if(sc->sc_I430state == ST_F3) /* layer 1 not running ? */
- {
- NDBGL1(L1_I_ERR, "still in state F3!");
- ifpnp_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 */
-
- NDBGL1(L1_I_MSG, "using 2nd ISAC TX buffer, state = %s", ifpnp_printstate(sc));
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = L0IFPNPUNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
- splx(s);
- return(1);
- }
-
- NDBGL1(L1_I_ERR, "No Space in TX FIFO, state = %s", ifpnp_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 = L0IFPNPUNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
-
- sc->sc_state |= ISAC_TX_ACTIVE; /* set transmitter busy flag */
-
- NDBGL1(L1_I_MSG, "ISAC_TX_ACTIVE set");
-
- 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
- *
- *---------------------------------------------------------------------------*/
-int
-ifpnp_ph_activate_req(int unit)
-{
- struct l1_softc *sc = ifpnp_scp[unit];
- NDBGL1(L1_PRIM, "PH-ACTIVATE-REQ, unit %d\n", unit);
- ifpnp_next_state(sc, EV_PHAR);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * command from the upper layers
- *---------------------------------------------------------------------------*/
-int
-ifpnp_mph_command_req(int unit, int command, void *parm)
-{
- struct l1_softc *sc = ifpnp_scp[unit];
-
- switch(command)
- {
- case CMR_DOPEN: /* daemon running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DOPEN", unit);
- sc->sc_enabled = 1;
- break;
-
- case CMR_DCLOSE: /* daemon not running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DCLOSE", unit);
- sc->sc_enabled = 0;
- break;
-
- case CMR_SETTRACE:
- NDBGL1(L1_PRIM, "unit %d, command = CMR_SETTRACE, parm = %d", unit, (unsigned int)parm);
- sc->sc_trace = (unsigned int)parm;
- break;
-
- default:
- NDBGL1(L1_ERROR, "ERROR, unknown command = %d, unit = %d, parm = %d", command, unit, (unsigned int)parm);
- break;
- }
-
- return(0);
-}
diff --git a/sys/i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c b/sys/i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c
deleted file mode 100644
index 6a26c0e..0000000
--- a/sys/i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c
+++ /dev/null
@@ -1,510 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 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_ifpnp_l1fsm.c - AVM Fritz PnP layer 1 I.430 state machine
- * -------------------------------------------------------------
- * $Id: i4b_ifpnp_l1fsm.c,v 1.4 2000/05/29 15:41:41 hm Exp $
- * $Ust: src/i4b/layer1-nb/ifpnp/i4b_ifpnp_l1fsm.c,v 1.4 2000/04/18 08:03:05 ust Exp $
- * last edit-date: [Mon May 29 15:25:04 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/ifpnp/i4b_ifpnp_ext.h>
-
-#if DO_I4B_DEBUG
-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"
-};
-#endif
-
-/* Function prototypes */
-
-static void timer3_expired (struct l1_softc *sc);
-static void T3_start (struct l1_softc *sc);
-static void T3_stop (struct l1_softc *sc);
-static void F_T3ex (struct l1_softc *sc);
-static void timer4_expired (struct l1_softc *sc);
-static void T4_start (struct l1_softc *sc);
-static void T4_stop (struct l1_softc *sc);
-static void F_AI8 (struct l1_softc *sc);
-static void F_AI10 (struct l1_softc *sc);
-static void F_I01 (struct l1_softc *sc);
-static void F_I02 (struct l1_softc *sc);
-static void F_I03 (struct l1_softc *sc);
-static void F_I2 (struct l1_softc *sc);
-static void F_ill (struct l1_softc *sc);
-static void F_NULL (struct l1_softc *sc);
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer3_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T3)
- {
- NDBGL1(L1_T_ERR, "state = %s", ifpnp_printstate(sc));
- sc->sc_I430T3 = 0;
-
- /* XXX try some recovery here XXX */
-
- ifpnp_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);
-
- i4b_l1_mph_status_ind(L0IFPNPUNIT(sc->sc_unit), STI_NOL1ACC, 0, NULL);
- }
-
- ifpnp_next_state(sc, EV_T3);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 start
- *---------------------------------------------------------------------------*/
-static void
-T3_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpnp_printstate(sc));
- sc->sc_I430T3 = 1;
- sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 stop
- *---------------------------------------------------------------------------*/
-static void
-T3_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpnp_printstate(sc));
-
- sc->sc_init_tries = 0; /* init connect retry count */
-
- if(sc->sc_I430T3)
- {
- sc->sc_I430T3 = 0;
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_T3ex(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_T3ex executing");
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPNPUNIT(sc->sc_unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer4_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T4)
- {
- NDBGL1(L1_T_MSG, "state = %s", ifpnp_printstate(sc));
- sc->sc_I430T4 = 0;
- i4b_l1_mph_status_ind(L0IFPNPUNIT(sc->sc_unit), STI_PDEACT, 0, NULL);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 start
- *---------------------------------------------------------------------------*/
-static void
-T4_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpnp_printstate(sc));
- sc->sc_I430T4 = 1;
- sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 stop
- *---------------------------------------------------------------------------*/
-static void
-T4_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", ifpnp_printstate(sc));
-
- if(sc->sc_I430T4)
- {
- sc->sc_I430T4 = 0;
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI8
- *---------------------------------------------------------------------------*/
-static void
-F_AI8(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI8 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0IFPNPUNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_8;
-
- hdr.unit = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI10
- *---------------------------------------------------------------------------*/
-static void
-F_AI10(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI10 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0IFPNPUNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_10;
-
- hdr.unit = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in states F3 .. F5
- *---------------------------------------------------------------------------*/
-static void
-F_I01(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I01 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F6
- *---------------------------------------------------------------------------*/
-static void
-F_I02(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I02 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPNPUNIT(sc->sc_unit));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F7 or F8
- *---------------------------------------------------------------------------*/
-static void
-F_I03(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I03 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0IFPNPUNIT(sc->sc_unit));
-
- T4_start(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: activate request
- *---------------------------------------------------------------------------*/
-static void
-F_AR(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AR executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO1_8;
-
- hdr.unit = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_TE;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
- ifpnp_isac_l1_cmd(sc, CMD_AR8);
-
- T3_start(sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO2
- *---------------------------------------------------------------------------*/
-static void
-F_I2(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I2 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO2;
-
- hdr.unit = L0IFPNPUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
-}
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(struct l1_softc *sc)
-{
- NDBGL1(L1_F_ERR, "FSM function F_ill executing");
-}
-
-/*---------------------------------------------------------------------------*
- * No action
- *---------------------------------------------------------------------------*/
-static void
-F_NULL(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_NULL executing");
-}
-
-
-/*---------------------------------------------------------------------------*
- * layer 1 state transition table
- *---------------------------------------------------------------------------*/
-struct ifpnp_state_tab {
- void (*func) (struct l1_softc *sc); /* function to execute */
- int newstate; /* next state */
-} ifpnp_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
-ifpnp_next_state(struct l1_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 = ifpnp_state_tab[event][currstate].newstate;
-
- if(newstate >= N_STATES)
- panic("i4b_l1fsm.c: newstate >= N_STATES\n");
-
- NDBGL1(L1_F_MSG, "FSM event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[newstate]);
-
- (*ifpnp_state_tab[event][currstate].func)(sc);
-
- if(newstate == ST_ILL)
- {
- newstate = ST_F3;
- NDBGL1(L1_F_ERR, "FSM Illegal State ERROR, oldstate = %s, newstate = %s, event = %s!",
- state_text[currstate],
- state_text[newstate],
- event_text[event]);
- }
-
- sc->sc_I430state = newstate;
-}
-
-#if DO_I4B_DEBUG
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-ifpnp_printstate(struct l1_softc *sc)
-{
- return((char *) state_text[sc->sc_I430state]);
-}
-#endif
diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc.h b/sys/i4b/layer1/ihfc/i4b_ihfc.h
deleted file mode 100644
index f4d7241..0000000
--- a/sys/i4b/layer1/ihfc/i4b_ihfc.h
+++ /dev/null
@@ -1,338 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_ihfc.h - ihfc common header file
- * ------------------------------------
- *
- * last edit-date: [Wed Jul 19 09:40:45 2000]
- *
- * $Id: i4b_ihfc.h,v 1.9 2000/09/19 13:50:36 hm Exp $
- *
- * $FreeBSD$
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IHFC_H_
-#define _I4B_IHFC_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-/*---------------------------------------------------------------------------*
- * global stuff (HFC-1/S/SP)
- *---------------------------------------------------------------------------*/
-#define DCH_MAX_LEN 264 /* max length of a D frame */
-
-#define IHFC_ACTIVATION_TIMEOUT 3*hz /* S0-bus must activate before this time */
-
-#define IHFC_IO_BASES 1
-
-#define IHFC_DISBUSYTO 500 /* do at least 500 inb's before giving up */
-#define IHFC_NONBUSYTO 8000 /* do at least 8000 inb's before giving up */
-
-#define IHFC_NTMODE 0 /* use TE-mode as default */
-#define IHFC_DLP 0 /* use (8/9) priority as default */
-
-#define IHFC_MAXUNIT 4
-
-/* #define IHFC_DEBUG internal debugging enabled *
- * #undef IHFC_DEBUG internal debugging disabled */
-
-/* chan: *
- * 0 - D1 (tx) *
- * 1 - D1 (rx) *
- * 2 - B1 (tx) *
- * 3 - B1 (rx) *
- * 4 - B2 (tx) *
- * 5 - B2 (rx) */
-
-#define HFC_1 0x01 /* HFC 2B */
-#define HFC_S 0x02 /* HFC - S 2BDS0 */
-#define HFC_SP 0x04 /* HFC - SP 2BDS0 */
-#define HFC_SPCI 0x08 /* HFC - SPCI 2BDS0 X */
-#define HFC_S2M 0x10 /* HFC - S2M 2BDS0 X */
-#define HFC_USB 0x20 /* HFC - USB 2BDS0 X */
-
-/*---------------------------------------------------------------------------*
- * "Help Fix Corruption" macros (HFC-1/S/SP)
- *
- * NOTE: If the code does not run at splhigh, we will sporadically
- * lose bytes. On fast PC's (200 Mhz), this is very little noticable.
- *---------------------------------------------------------------------------*/
-#define HFC_VAR int _s_ /* declare variable */
-#define HFC_BEG _s_ = splhigh() /* save spl */
-#define HFC_END splx(_s_) /* restore spl */
-
-/*---------------------------------------------------------------------------*
- * macros related to i4b linking (HFC-1/S/SP)
- *---------------------------------------------------------------------------*/
-#define S_BLINK sc->sc_blinktab[(chan > 3) ? 1 : 0]
-#define S_BDRVLINK sc->sc_bdrvlinktab[(chan > 3) ? 1 : 0]
-
-/*---------------------------------------------------------------------------*
- * macros related to ihfc_sc (HFC-1/S/SP)
- *---------------------------------------------------------------------------*/
-
-/* statemachine */
-
-#define S_IOM2 (sc->sc_config.i_adf2 & 0x80)
- /* 0x80: IOM2 mode selected */
-
-#define S_DLP (sc->sc_config.dlp)
-#define S_NTMODE (sc->sc_config.ntmode)
-#define S_STDEL (sc->sc_config.stdel)
-
-#define S_PHSTATE sc->sc_statemachine.state
-#define S_STM_T3 sc->sc_statemachine.T3
-#define S_STM_T3CALLOUT sc->sc_statemachine.T3callout
-
-/* unitnumbers */
-
-#define S_UNIT sc->sc_unit
-#define S_FLAG sc->sc_flag
-#define S_I4BUNIT sc->sc_i4bunit
-#define S_I4BFLAG sc->sc_i4bflag
-
-/* ISA bus setup */
-
-#define S_IOBASE sc->sc_resources.io_base
-#define S_IORID sc->sc_resources.io_rid
-#define S_IRQ sc->sc_resources.irq
-#define S_IRQRID sc->sc_resources.irq_rid
-
-/* hardware setup */
-
-#define S_HFC sc->sc_config.chiptype
-#define S_IIO sc->sc_config.iio
-#define S_IIRQ sc->sc_config.iirq
-
-/* registers of the HFC-S/SP (write only) */
-
-#define S_HFC_CONFIG sc->sc_config.cirm
-
-#define S_CIRM sc->sc_config.cirm
-#define S_CTMT sc->sc_config.ctmt
-#define S_TEST sc->sc_config.test
-#define S_SCTRL sc->sc_config.sctrl
-#define S_CLKDEL sc->sc_config.clkdel
-#define S_INT_M1 sc->sc_config.int_m1
-#define S_INT_M2 sc->sc_config.int_m2
-#define S_CONNECT sc->sc_config.connect
-#define S_SCTRL_R sc->sc_config.sctrl_r
-#define S_MST_MODE sc->sc_config.mst_mode
-
-/* registers of the HFC-S/SP (read only) */
-
-#define S_INT_S1 sc->sc_config.int_s1
-
-/* registers of the ISAC (write only) */
-
-#define S_ISAC_CONFIG sc->sc_config.i_adf2
-
-#define S_ADF1 sc->sc_config.i_adf1
-#define S_ADF2 sc->sc_config.i_adf2
-#define S_MASK sc->sc_config.i_mask
-#define S_MODE sc->sc_config.i_mode
-#define S_SPCR sc->sc_config.i_spcr
-#define S_SQXR sc->sc_config.i_sqxr
-#define S_STCR sc->sc_config.i_stcr
-#define S_STAR2 sc->sc_config.i_star2
-
-/* registers of the ISAC (read only) */
-
-#define S_ISTA sc->sc_config.i_ista
-
-/* state of the softc */
-
-#define S_ENABLED sc->sc_enabled
-#define S_INTR_ACTIVE sc->sc_intr_active
-
-/* SOFT-HDLC */
-
-#define S_HDLC_IB sc->sc_fifo.chan[chan].hdlc.ib /* u_short */
-#define S_HDLC_CRC sc->sc_fifo.chan[chan].hdlc.crc /* u_short */
-#define S_HDLC_TMP sc->sc_fifo.chan[chan].hdlc.tmp /* u_int */
-#define S_HDLC_FLAG sc->sc_fifo.chan[chan].hdlc.flag /* u_char */
-#define S_HDLC_BLEVEL sc->sc_fifo.chan[chan].hdlc.blevel /* u_short */
-
-/* stats */
-
-#define S_BYTES sc->sc_fifo.chan[chan].bytes
-
-/* "Z"-values */
-
-#define S_HDLC_DZ_TAB sc->sc_fifo.dztable
-
-/* filters */
-
-#define S_PROT sc->sc_fifo.chan[chan].prot
-#define S_FILTER sc->sc_fifo.chan[chan].filter
-#define S_ACTIVITY sc->sc_fifo.chan[chan].activity
-#define S_LAST_CHAN sc->sc_fifo.last_chan
-
-/* soft reset */
-
-#define RESET_SOFT_CHAN(sc, chan) bzero(&sc->sc_fifo.chan[chan], sizeof(sc->sc_fifo.chan[0]))
-
-/* trace */
-
-#define S_TRACE sc->sc_trace
-#define S_DTRACECOUNT sc->sc_Dtracecount
-#define S_BTRACECOUNT sc->sc_Btracecount
-
-/* mbuf */
-
-#define S_MBUF sc->sc_fifo.chan[chan].buffer.mbuf
-#define S_MBUFDUMMY sc->sc_fifo.chan[chan].buffer.mbufdummy
-#define S_MBUFLEN sc->sc_fifo.chan[chan].buffer.mbuf->m_len
-#define S_MBUFPKTHDR sc->sc_fifo.chan[chan].buffer.mbuf->m_pkthdr
-#define S_MBUFDATA sc->sc_fifo.chan[chan].buffer.mbuf->m_data
-#define S_MBUFDAT sc->sc_fifo.chan[chan].buffer.mbuf->m_dat
-
-#define S_IFQUEUE sc->sc_fifo.chan[chan].buffer.ifqueue
-
-/* hfc control */
-
-#define HFC_INIT ihfc_init
-#define HFC_INTR ((S_HFC & HFC_1) ? ihfc_intr1 : ihfc_intr2)
-#define HFC_FSM ihfc_fsm
-#define HFC_CONTROL ihfc_control
-
-/* softc parts */
-
-struct ihfc_sc;
-
-struct sc_resources {
- struct resource * io_base[IHFC_IO_BASES];
- int io_rid [IHFC_IO_BASES];
- struct resource * irq;
- int irq_rid;
-};
-
-struct hdlc {
- u_char flag;
- u_short blevel;
- u_short crc;
- u_short ib;
- u_int tmp;
-};
-
-struct buffer {
- struct ifqueue ifqueue; /* data queue */
- struct mbuf *mbuf; /* current mbuf */
- struct mbuf *mbufdummy; /* temporary */
-};
-
-struct chan {
- struct hdlc hdlc;
- u_int bytes;
- u_int prot;
- struct buffer buffer;
- void (*filter)(struct ihfc_sc *sc, u_char chan);
-};
-
-struct sc_fifo {
- struct chan chan[6];
- u_short dztable[16];
- u_char last_chan;
-};
-
-struct sc_config {
- /* software only: */
-
- u_short chiptype; /* chiptype (eg. HFC_1) */
- u_char dlp; /* D-priority */
- u_short iio; /* internal IO */
- u_char iirq; /* internal IRQ */
- u_char ntmode; /* mode */
- u_char stdel; /* S/T delay */
-
- /* write only: */
- u_char cirm;
- u_char ctmt;
- u_char int_m1;
- u_char int_m2;
- u_char mst_mode;
- u_char clkdel;
- u_char sctrl;
- u_char connect;
- u_char test;
- u_char sctrl_r;
-
- /* isac write only - hfc-1: */
- u_char i_adf2;
- u_char i_spcr;
- u_char i_sqxr;
- u_char i_adf1;
- u_char i_stcr;
- u_char i_mode;
- u_char i_mask;
- u_char i_star2;
-
- /* read only: */
- u_char int_s1;
-
- /* isac read only - hfc-1: */
- u_char i_ista;
-};
-
-struct sc_statemachine {
- u_char state; /* see i4b_ihfc_drv.h */
- u_char usync;
- u_char T3; /* T3 running */
- struct callout_handle T3callout;
-};
-
-/*---------------------------------------------------------------------------*
- * HFC softc
- *---------------------------------------------------------------------------*/
-typedef struct ihfc_sc
-{ int sc_unit;
- int sc_flag;
-
- int sc_i4bunit; /* L0IHFCUNIT(sc_unit) */
- int sc_i4bflag; /* FLAG_TEL_S0_16_3C .. */
-
- u_char sc_enabled; /* daemon running if set */
- u_char sc_intr_active; /* interrupt is active */
-
- int sc_trace;
- u_int sc_Btracecount;
- u_int sc_Dtracecount;
-
- struct sc_config sc_config;
- struct sc_resources sc_resources;
- struct sc_statemachine sc_statemachine;
-
- isdn_link_t sc_blinktab[2];
- drvr_link_t *sc_bdrvlinktab[2];
-
- struct sc_fifo sc_fifo;
-} ihfc_sc_t;
-
-extern ihfc_sc_t ihfc_softc[];
-
-#endif /* _I4B_IHFC_H_ */
diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c b/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c
deleted file mode 100644
index 630aa67..0000000
--- a/sys/i4b/layer1/ihfc/i4b_ihfc_drv.c
+++ /dev/null
@@ -1,1760 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_ihfc_drv.c - ihfc ISA PnP-bus interface
- * -------------------------------------------
- * Everything which has got anything to do with the
- * HFC-1/S/SP chips has been put here.
- *
- * last edit-date: [Fri Jan 12 17:06:52 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/i4b_hdlc.h>
-#include <i4b/layer1/ihfc/i4b_ihfc.h>
-#include <i4b/layer1/ihfc/i4b_ihfc_ext.h>
-#include <i4b/layer1/ihfc/i4b_ihfc_drv.h>
-
-#include <machine/bus.h>
-#include <sys/rman.h>
-
-
-/*---------------------------------------------------------------------------*
- * Local prototypes
- *---------------------------------------------------------------------------*/
- void ihfc_loadconfig (ihfc_sc_t *sc);
-
-static void ihfc_trans_Bread (ihfc_sc_t *sc, u_char chan);
-static void ihfc_trans_Bwrite (ihfc_sc_t *sc, u_char chan);
-static void ihfc_hdlc_Bread (ihfc_sc_t *sc, u_char chan);
-static void ihfc_hdlc_Bwrite (ihfc_sc_t *sc, u_char chan);
-static void ihfc_hdlc_Dread (ihfc_sc_t *sc, u_char chan);
-static void ihfc_hdlc_Dwrite (ihfc_sc_t *sc, u_char chan);
-
-static void ihfc_isac_Dread (ihfc_sc_t *sc, u_char chan);
-static void ihfc_isac_Dwrite (ihfc_sc_t *sc, u_char chan);
-
- void ihfc_cmdr_hdlr (ihfc_sc_t *sc, u_char cmdr);
- void ihfc_exir_hdlr (ihfc_sc_t *sc, u_char exir);
-
- void ihfc_sq (ihfc_sc_t *sc);
-
-static void ihfc_test_Bread (ihfc_sc_t *sc, u_char chan);
-static void ihfc_test_Bwrite (ihfc_sc_t *sc, u_char chan);
-
-u_short ihfc_Bsel_fifo (ihfc_sc_t *sc, u_char chan, u_char flag);
-u_int32_t ihfc_Dsel_fifo (ihfc_sc_t *sc, u_char chan, u_char flag);
-
-
-/*---------------------------------------------------------------------------*
- * Commonly used ISA bus commands
- *---------------------------------------------------------------------------*/
-#define IHFC_DATA_OFFSET 0
-#define IHFC_REG_OFFSET 1
-
-#define BUS_VAR bus_space_handle_t h = rman_get_bushandle(S_IOBASE[0]); \
- bus_space_tag_t t = rman_get_bustag (S_IOBASE[0])
-
-#define SET_REG(reg) bus_space_write_1(t,h, IHFC_REG_OFFSET, reg)
-#define GET_STAT bus_space_read_1 (t,h, IHFC_REG_OFFSET)
-
-#define READ_DATA_1 bus_space_read_1 (t,h, IHFC_DATA_OFFSET)
-#define READ_BOTH_2 bus_space_read_2 (t,h, IHFC_DATA_OFFSET)
-
-#define WRITE_DATA_1(data) bus_space_write_1(t,h, IHFC_DATA_OFFSET, data)
-#define WRITE_BOTH_2(data) bus_space_write_2(t,h, IHFC_DATA_OFFSET, data)
-
-#define DISBUSY(okcmd, tocmd) \
-{ \
- if (GET_STAT & 1) \
- { \
- register u_char a; \
- register u_int to = IHFC_DISBUSYTO; \
- \
- while(((a = GET_STAT) & 1) && --to); \
- \
- if (!to) \
- { \
- NDBGL1(L1_ERROR, "DISBUSY-TIMEOUT! (a=%04x, " \
- "unit=%d)", a, S_UNIT); \
- tocmd; \
- } \
- else \
- { \
- okcmd; \
- } \
- } \
- else \
- { \
- okcmd; \
- } \
-}
-
-#define WAITBUSY_2(okcmd, tocmd) \
- { \
- register u_short a; \
- register u_int to = IHFC_NONBUSYTO; \
- \
- while((~(a = READ_BOTH_2) & 0x100) && --to); \
- \
- if (!to) \
- { \
- NDBGL1(L1_ERROR, "NONBUSY-TIMEOUT! (a=%04x, " \
- "unit=%d)", a, S_UNIT); \
- tocmd; \
- } \
- else \
- { \
- okcmd; \
- } \
- }
-
-/*---------------------------------------------------------------------------*
- * Control function (HFC-1/S/SP)
- *
- * Flag:
- * 1: reset and unlock chip (at boot only)
- * 2: prepare for shutdown (at shutdown only)
- * 3: reset and resume
- * 4: select TE-mode (boot default)
- * 5: select NT-mode (only HFC-S/SP/PCI)
- *
- * Returns != 0 on errornous chip
- *---------------------------------------------------------------------------*/
-int
-ihfc_control(ihfc_sc_t *sc, int flag)
-{
- BUS_VAR;
-
- if (flag == 3) goto reset0;
- if (flag == 4)
- {
- S_NTMODE = 0;
- goto mode0;
- }
- if (flag == 5)
- {
- S_NTMODE = 1;
- goto mode0;
- }
- if (flag == 1)
- {
- WRITE_BOTH_2(0x5400 | S_IIO); /* enable IO (HFC-1/S) */
-
- S_LAST_CHAN = -1;
-
- /* HFC-S/SP configuration */
-
- S_CIRM = S_IIRQ|0x10; /* IRQ, 8K fifo mode */
- S_CLKDEL = 0x00; /* 12.288mhz */
- S_CTMT = 0x03; /* transperant mode */
- S_CONNECT = 0x00; /* B channel data flow */
- S_INT_M1 = 0x40; /* interrupt mask */
- S_INT_M2 = 0x08; /* enable interrupt output */
- S_MST_MODE = 0x01; /* master mode */
- S_SCTRL = 0x50; /* S/Q on, non cap. line mode */
- S_SCTRL_R = 0x00; /* B channel receive disable */
- S_TEST = 0x00; /* no need for awake enable */
-
- if (S_HFC & (HFC_1 | HFC_S)) /* configure timer (50ms) */
- {
- S_CTMT |= 0x08;
- }
- else
- {
- S_CTMT |= 0x14;
- }
-
- /* HFC-1 ISAC configuration (IOM-2 mode) */
-
- S_ADF1 = 0x00; /* */
- S_ADF2 = 0x80; /* select mode IOM-2 */
- S_SPCR = 0x00; /* B channel send disable (0x10 for test loop) */
- S_MASK = 0xfb; /* enable CISQ */
- S_MODE = 0xc9; /* receiver enabled */
- S_SQXR = 0x0f; /* master, clock always active */
- S_STCR = 0x70; /* TIC bus address = 7 */
- S_STAR2 = 0x04; /* enable S/Q */
-
- mode0:
- if (S_NTMODE) /* configure NT- or TE-mode */
- {
- S_SCTRL |= 0x04; /* NT mode */
- S_CLKDEL &= ~0x7f; /* clear delay */
- S_CLKDEL |= 0x6c; /* set delay */
- }
- else
- {
- S_SCTRL &= ~0x04; /* TE mode */
- S_STDEL &= 0x7f; /* use mask! */
- S_CLKDEL &= ~0x7f; /* clear delay */
- S_CLKDEL |= S_STDEL; /* set delay */
- }
- if (S_DLP) /* configure D-priority */
- {
- S_SCTRL |= 0x08; /* (10/11) */
- }
- else
- {
- S_SCTRL &= ~0x08; /* (8/9) */
- }
-
- reset0:
- /* chip reset (HFC-1/S/SP) */
-
- if (S_HFC & HFC_1)
- {
- SET_REG((S_CIRM | 0xc8) & 0xdf);
-
- DELAY(10); /* HFC-2B manual recommends a 4 *
- * clock cycle delay after CIRM *
- * write with reset=1. A 1us *
- * delay, should do for 7.68mhz,*
- * but just in case I make that *
- * 10us. */
-
- SET_REG((S_CIRM | 0xc0) & 0xdf);
-
- DELAY(250); /* ISAC manual says reset pulse *
- * length is 125us. Accessing *
- * ISAC before those 125us, we *
- * may risk chip corruption and *
- * irq failure. The HFC-2B also *
- * needs some delay to recover, *
- * so we add some us. */
- }
- else
- {
- SET_REG(0x18);
-
- WRITE_DATA_1(S_CIRM | 8);
-
- DELAY(10); /* HFC-2BDS0 manual recommends *
- * a 4 clock cycle delay after *
- * CIRM write with reset=1. *
- * A 1us delay, should do for *
- * 12.288mhz, but just in case *
- * I make that 10us. */
-
- WRITE_DATA_1(S_CIRM);
-
- DELAY(25); /* HFC-2BDS0 needs some time to *
- * recover after CIRM write *
- * with reset=0. Experiments *
- * show this delay should be *
- * 8-9us. Just in case we make *
- * that 25us. */
- }
-
- {
- /* HFC-1/S/SP chip test *
- * *
- * NOTE: after reset the HFC-1/S/SP should be *
- * in a mode where it is always non-busy/non- *
- * processing, and bit[0] of STATUS/DISBUSY *
- * register, should always return binary '0' *
- * until we configure the chips for normal *
- * operation. */
-#ifdef IHFC_DEBUG
- printf("ihfc: GET_STAT value is: 0x%x\n", GET_STAT);
-#endif
- SET_REG(0x30);
-
- if ((GET_STAT & 1) || (READ_DATA_1 & 0xf)) goto f0;
- }
-
- ihfc_loadconfig(sc);
-
- if (S_HFC & HFC_1) ihfc_cmdr_hdlr(sc, 0x41); /* rres, xres */
-
- S_PHSTATE = 0;
- HFC_FSM(sc, 0);
- }
-
- if (flag == 2)
- {
- if (S_HFC & HFC_1) S_CIRM &= ~0x03; /* disable interrupt */
-
- S_SQXR |= 0x40; /* power down */
-
- S_INT_M2 &= ~0x01;
- S_MASK |= 0x02;
-
- S_SPCR &= ~0x0f; /* send 1's only */
- S_SCTRL &= ~0x83; /* send 1's only + enable oscillator */
-
- ihfc_loadconfig(sc);
- }
-
- return(0); /* success */
-
- f0:
- return(1); /* failure */
-}
-
-/*---------------------------------------------------------------------------*
- * Softc initializer and hardware setup (HFC-1/S/SP)
- *
- * Returns: 0 on success
- * 1 on failure
- *---------------------------------------------------------------------------*/
-int
-ihfc_init (ihfc_sc_t *sc, u_char chan, int prot, int activate)
-{
- if (chan > 5) goto f0;
-
- chan &= ~1;
-
- do
- { if (chan < 2) /* D-Channel */
- {
- i4b_Dfreembuf(S_MBUF);
- if (!IF_QEMPTY(&S_IFQUEUE)) i4b_Dcleanifq(&S_IFQUEUE);
-
- RESET_SOFT_CHAN(sc, chan);
-
- S_IFQUEUE.ifq_maxlen = IFQ_MAXLEN;
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- if(!mtx_initialized(&S_IFQUEUE.ifq_mtx))
- mtx_init(&S_IFQUEUE.ifq_mtx, "i4b_ihfc", NULL, MTX_DEF);
-#endif
- if (!activate) continue;
-
- if (S_HFC & HFC_1)
- {
- S_FILTER = (chan & 1) ? ihfc_isac_Dread :
- ihfc_isac_Dwrite;
- }
- else
- {
- S_FILTER = (chan & 1) ? ihfc_hdlc_Dread :
- ihfc_hdlc_Dwrite;
- }
- }
- else /* B-Channel */
- {
- i4b_Bfreembuf(S_MBUF);
- if (!IF_QEMPTY(&S_IFQUEUE)) i4b_Bcleanifq(&S_IFQUEUE);
-
- RESET_SOFT_CHAN(sc, chan);
-
- S_IFQUEUE.ifq_maxlen = IFQ_MAXLEN;
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- if(!mtx_initialized(&S_IFQUEUE.ifq_mtx))
- mtx_init(&S_IFQUEUE.ifq_mtx, "i4b_ihfc", NULL, MTX_DEF);
-#endif
- S_PROT = prot;
-
- if (!activate) continue;
-
- switch(prot)
- { case(BPROT_NONE):
- S_FILTER = (chan & 1) ?
- ihfc_trans_Bread :
- ihfc_trans_Bwrite;
- break;
- case(BPROT_RHDLC):
- S_FILTER = (chan & 1) ?
- ihfc_hdlc_Bread :
- ihfc_hdlc_Bwrite;
- break;
- case(5):
- S_FILTER = (chan & 1) ?
- ihfc_test_Bread :
- ihfc_test_Bwrite;
- break;
- }
- }
- } while (++chan & 1);
-
- S_MASK |= 0xfb; /* disable all, but CISQ interrupt (ISAC) */
- S_INT_M1 &= 0x40; /* disable all, but TE/NT state machine (HFC) */
- S_SCTRL &= ~0x03; /* B1/B2 send disable (HFC) */
- S_SPCR &= ~0x0f; /* B1/B2 send disable (ISAC) */
- S_SCTRL_R &= ~0x03; /* B1/B2 receive disable (HFC) */
-
- chan = 0;
- if (S_FILTER) /* D-Channel active */
- {
- S_MASK &= 0x2e; /* enable RME, RPF, XPR, EXI */
- S_INT_M1 |= 0x24; /* enable D-receive, D-transmit */
- }
-
- chan = 2;
- if (S_FILTER) /* B1-Channel active */
- {
- S_SCTRL |= 1; /* send enable (HFC) */
- S_SPCR |= 8; /* send enable (ISAC) */
- S_SCTRL_R |= 1; /* receive enable (HFC) */
- S_INT_M1 |= 0x80; /* timer enable (HFC) */
- S_INT_M1 &= ~0x04; /* let D-channel use timer too */
- }
-
- chan = 4;
- if (S_FILTER) /* B2-Channel active */
- {
- S_SCTRL |= 2; /* send enable (HFC) */
- S_SPCR |= 2; /* send enable (ISAC) */
- S_SCTRL_R |= 2; /* receive enable (HFC) */
- S_INT_M1 |= 0x80; /* timer enable (HFC) */
- S_INT_M1 &= ~0x04; /* let D-channel use timer too */
- }
-
- ihfc_loadconfig(sc);
-
- /* XXX reset timer? */
-
- return 0; /* success */
- f0:
- return 1; /* failure */
-}
-
-/*---------------------------------------------------------------------------*
- * Load configuration data (HFC-1/S/SP)
- *---------------------------------------------------------------------------*/
-void
-ihfc_loadconfig(ihfc_sc_t *sc)
-{
- BUS_VAR;
-
- if (S_HFC & HFC_1)
- {
- /* HFC-1 chips w/ISAC: */
-
- const u_char *src = (void *)&S_ISAC_CONFIG;
- const u_char *dst = (void *)&isac_configtable;
-
- SET_REG((S_CIRM | 0xc0) & 0xdf);
-
- S_CTMT = (S_CTMT & ~0x14) | ((S_INT_M1 >> 5) & 0x4);
-
- SET_REG((S_CTMT | 0xe0) & 0xff);
-
- while(*dst)
- {
- SET_REG(*dst++); /* set register */
-
- /* write configuration */
- DISBUSY(WRITE_DATA_1(*src++), break);
- }
- }
- else
- {
- /* HFC-S/SP chips: */
-
- const u_char *src = (void *)&S_HFC_CONFIG;
- const u_char *dst = (void *)&ihfc_configtable;
-
- while(*dst)
- {
- SET_REG(*dst++); /* set register */
- WRITE_DATA_1(*src++); /* write configuration */
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Function State Machine handler (PH layer) (HFC-1/S/SP)
- *
- * Flag: 0 = Refresh softc S_PHSTATE + take hints
- * 1 = Activate
- * 2 = Deactivate
- *
- * NOTE: HFC-1 only supports TE mode.
- *---------------------------------------------------------------------------*/
-void
-ihfc_fsm(ihfc_sc_t *sc, int flag)
-{
- const struct ihfc_FSMtable *fsmtab;
- u_char ihfc_cmd = 0;
- u_char isac_cmd = 0;
- u_char tmp;
- BUS_VAR;
-
- /* get current state (rx/downstream) */
-
- if (S_HFC & HFC_1)
- {
- SET_REG(0x31); DISBUSY(tmp = (READ_DATA_1 >> 2) & 0xf, return);
-
- fsmtab = (S_NTMODE) ? &ihfc_TEtable2[tmp]:
- &ihfc_TEtable2[tmp];
- }
- else
- {
- SET_REG(0x30); tmp = READ_DATA_1 & 0xf;
-
- fsmtab = (S_NTMODE) ? &ihfc_NTtable[tmp]:
- &ihfc_TEtable[tmp];
- }
-
- if (fsmtab->string)
- {
- NDBGL1(L1_I_CICO, "%s (ind=0x%x, flag=%d, unit=%d).",
- fsmtab->string, tmp, flag, S_UNIT);
- }
- else
- {
- NDBGL1(L1_I_ERR, "Illegal indicatation (ind=0x%x, "
- "flag=%d, unit=%d).", tmp, flag, S_UNIT);
- }
-
- /* indication machine / state change *
- * *
- * Whenever the state of the S0-line changes, we check to see in which *
- * direction the change went. Generally upwards means activate, and *
- * downwards means deactivate. *
- * The test signal is used to ensure proper syncronization. */
-
- if (fsmtab->state == 0) /* deactivated indication */
- {
- if (S_PHSTATE != 0)
- {
- isac_cmd = 0x3c; /* deactivate DUI */
-
- i4b_l1_ph_deactivate_ind(S_I4BUNIT);
- }
- }
- if (fsmtab->state == 2) /* syncronized indication */
- {
- if (S_PHSTATE != 2)
- {
- if (S_NTMODE) ihfc_cmd = 0x80;
- }
- }
- if (fsmtab->state == 3) /* activated indication */
- {
- if (S_PHSTATE != 3)
- {
- isac_cmd = (S_DLP) ? 0x24 /* activate AR10 */
- : 0x20; /* activate AR8 */
-
- i4b_l1_ph_activate_ind(S_I4BUNIT);
- }
- }
- if (fsmtab->state == 4) /* error indication */
- {
- if (S_PHSTATE < 4)
- {
- isac_cmd = 0x3c; /* deactivate DUI */
- }
- }
-
- S_PHSTATE = fsmtab->state;
-
- if ((flag == 1) && (fsmtab->state != 3))
- {
- isac_cmd = (S_DLP) ? 0x24 : 0x20;
- ihfc_cmd = 0x60;
- }
- if ((flag == 2) && (fsmtab->state != 0))
- {
- isac_cmd = 0x3c;
- ihfc_cmd = 0x40;
- }
-
- /* set new state (tx / upstream) *
- * *
- * NOTE: HFC-S/SP and ISAC transmitters are always active when *
- * activated state is reached. The bytes sent to the S0-bus are all *
- * high impedance, so they do not disturb. *
- * The HFC-1 has a separate SIEMENS S0-device. */
-
- if (S_HFC & HFC_1)
- {
- if (isac_cmd)
- {
- if (S_IOM2) isac_cmd |= 3;
-
- SET_REG(0x31); DISBUSY(WRITE_DATA_1(isac_cmd), );
-
- NDBGL1(L1_I_CICO, "(isac_cmd=0x%x, unit=%d).",
- isac_cmd, S_UNIT);
- }
- }
- else
- {
- if (ihfc_cmd || (fsmtab->state == 5))
- {
- SET_REG(0x30); WRITE_DATA_1(ihfc_cmd);
-
- NDBGL1(L1_I_CICO, "(ihfc_cmd=0x%x, unit=%d).",
- ihfc_cmd, S_UNIT);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * S/Q - channel handler (read) (HFC-S/SP)
- *---------------------------------------------------------------------------*/
-void
-ihfc_sq (ihfc_sc_t *sc)
-{
- const struct ihfc_SQtable *SQtab;
- register u_char a = 0;
- BUS_VAR;
-
- if (S_HFC & HFC_1)
- {
- SET_REG(0x31);
- DISBUSY(a = READ_DATA_1, a = 0);
-
- if (a & 0x80)
- {
- SET_REG(0x3b);
- DISBUSY(a = READ_DATA_1, a = 0);
- }
- }
- else
- {
- SET_REG(0x34);
- a = READ_DATA_1;
- }
-
- SQtab = (S_NTMODE) ? &ihfc_Qtable[a & 7]:
- &ihfc_Stable[a & 7];
-
- if (a & 0x10)
- {
- if (SQtab->string)
- {
- NDBGL1(L1_I_CICO, "%s (unit=%d, int=%x)",
- SQtab->string, S_UNIT, S_INT_S1);
- }
- else
- {
- NDBGL1(L1_ERROR, "Unknown indication = %x (unit=%d)",
- a & 7, S_UNIT);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Interrupt handler (HFC-1)
- *---------------------------------------------------------------------------*/
-void
-ihfc_intr1 (ihfc_sc_t *sc)
-{
- u_char chan;
- u_char tmp;
- BUS_VAR;
- HFC_VAR;
-
- HFC_BEG;
-
- SET_REG(0x20); tmp = GET_STAT; DISBUSY(S_ISTA |= READ_DATA_1, );
-
- if (S_ISTA & 0x04) /* CIRQ */
- {
- HFC_FSM(sc, 0);
-
- ihfc_sq(sc);
- }
-
- S_INTR_ACTIVE = 1;
-
- if (S_ISTA & 0xc0) /* RPF or RME */
- {
- chan = 1;
- if (S_FILTER) S_FILTER(sc, chan);
- }
- if (S_ISTA & 0x10) /* XPR */
- {
- chan = 0;
- if (S_FILTER) S_FILTER(sc, chan);
- }
- if (tmp & 0x04) /* Timer elapsed (50ms) */
- {
- SET_REG((S_CTMT | 0xf0) & 0xff);
-
- chan = 6;
- while(chan--)
- {
- if (chan == 1) break;
- if (S_FILTER) S_FILTER(sc, chan);
-
- HFC_END;
- DELAY(10);
- HFC_BEG;
- }
- }
-
- S_INTR_ACTIVE = 0;
-
- if (S_ISTA & 0x01) /* EXIR */
- {
- SET_REG(0x24); DISBUSY(ihfc_exir_hdlr(sc, READ_DATA_1), );
- }
-
- S_ISTA &= ~(0x1 | 0x4);
-
- HFC_END;
-}
-
-/*---------------------------------------------------------------------------*
- * Interrupt handler (HFC-S/SP)
- *---------------------------------------------------------------------------*/
-void
-ihfc_intr2 (ihfc_sc_t *sc)
-{
- u_char chan;
- BUS_VAR;
- HFC_VAR;
-
- HFC_BEG;
-
- SET_REG(0x1e); S_INT_S1 = READ_DATA_1; /* this will enable new interrupts! */
-
- if (S_INT_S1 & 0x40)
- {
- HFC_FSM(sc, 0); /* statemachine changed */
-
- ihfc_sq(sc);
- }
-
- S_INTR_ACTIVE = 1;
-
- if (S_INT_S1 & 0x20) /* D-Channel frame (rx) */
- {
- chan = 1;
- if (S_FILTER) S_FILTER(sc, chan);
- }
- if (S_INT_S1 & 0x04) /* D-Channel frame (tx) */
- {
- chan = 0;
- if (S_FILTER && (~S_INT_S1 & 0x80)) S_FILTER(sc, chan);
- }
- if (S_INT_S1 & 0x80) /* Timer elapsed (50ms) */
- {
- chan = 6;
- while(chan--)
- {
- if (chan == 1) continue;
- if (S_FILTER) S_FILTER(sc, chan);
-
- HFC_END;
- DELAY(10);
- HFC_BEG;
- }
- }
-
- S_INTR_ACTIVE = 0;
-
- HFC_END;
-}
-
-/*---------------------------------------------------------------------------*
- * Select a Bfifo (HFC-1/S/SP)
- * and return bytes in FIFO
- *
- * (this code is optimized)
- *---------------------------------------------------------------------------*/
-u_short
-ihfc_Bsel_fifo(ihfc_sc_t *sc, u_char chan, u_char flag)
-{
- register u_char reg = 0x7e + chan;
- register u_short tmp = 0x100;
- register u_short z1;
- register u_short z2;
-
- BUS_VAR;
-
- if (S_HFC & (HFC_1 | HFC_S))
- {
- if (S_LAST_CHAN != chan)
- {
- SET_REG(reg);
- DISBUSY(WAITBUSY_2( , return 0), return 0);
-
- S_LAST_CHAN = chan;
- }
- }
- else
- {
- SET_REG(0x10);
- WRITE_DATA_1(chan - 2);
- DISBUSY( , return 0);
- }
-
-#define FAST_READ (u_char)(tmp = READ_BOTH_2)
-#define FAST_STAT if (tmp & 0x100) DISBUSY( , return 0);
-
- SET_REG(reg ); FAST_STAT; z1 = FAST_READ;
- SET_REG(reg += 4); FAST_STAT; z1 |= FAST_READ << 8;
- SET_REG(reg += 4); FAST_STAT; z2 = FAST_READ;
- SET_REG(reg += 4); FAST_STAT; z2 |= READ_DATA_1 << 8;
-
-#undef FAST_READ
-#undef FAST_STAT
-
- z1 &= 0x1fff;
- z2 &= 0x1fff;
-
- z1 = 0x5ff - (z2 = z1 - z2 + ((z2 <= z1) ? 0 : 0x600));
-
- if (chan & 1)
- return(z2); /* receive channel */
- else
- return(z1); /* transmit channel */
-}
-
-/*---------------------------------------------------------------------------*
- * Select a Dfifo (HFC-S/SP)
- * and return bytes, and frames in FIFO
- *
- * Flag values:
- * 0x00: select new fifo + update counters
- * 0x10: increment f1 + update counters
- * 0x20: increment f2 + update counters
- *
- * NOTE: The upper 16bits holds the number of frames in the FIFO.
- * NOTE: FIFO has to be selected before you can use flags 0x10/0x20.
- *---------------------------------------------------------------------------*/
-u_int32_t
-ihfc_Dsel_fifo(ihfc_sc_t *sc, u_char chan, u_char flag)
-{
- register u_char reg = 0x90 + chan;
- register u_short tmp = 0x100;
- register u_char f1;
- register u_char f2;
- register u_short z1;
- register u_short z2;
-
- BUS_VAR;
-
- if (S_HFC & (HFC_1 | HFC_S))
- {
- switch(flag)
- {
- case(0x10):
- case(0x20):
- SET_REG(reg);
- if (~GET_STAT & 1)
- WAITBUSY_2( , return 0);
-
- SET_REG(0xa2 - (flag & 0x10) + chan);
- DISBUSY(READ_DATA_1, return 0);
-
- SET_REG(reg);
- if (~GET_STAT & 1)
- WAITBUSY_2( , return 0);
- break;
-
- default:
- if (S_LAST_CHAN != chan)
- {
- SET_REG(reg);
- DISBUSY(WAITBUSY_2( , return 0), return 0);
-
- S_LAST_CHAN = chan;
- }
- break;
- }
- }
- else
- {
- switch(flag)
- {
- case(0x10):
- case(0x20):
- SET_REG(0xb8 - (flag & 0x10) + chan);
- READ_DATA_1;
-
- DISBUSY( , return 0);
-
- if (chan & 1)
- {
- /* Before reading a FIFO a change *
- * FIFO operation must be done. *
- * (see HFC-SP manual p.38) */
-
- SET_REG(0x10);
- WRITE_DATA_1(chan | 4);
-
- DISBUSY( , return 0);
- }
- break;
-
- default:
- SET_REG(0x10);
- WRITE_DATA_1(chan | 4);
-
- DISBUSY( , return 0);
- break;
- }
- }
-
-#define FAST_READ (u_char)(tmp = READ_BOTH_2)
-#define FAST_STAT if (tmp & 0x100) DISBUSY( , return 0);
-
- if (S_HFC & HFC_SP) reg = 0x80 + chan;
-
- SET_REG(reg ); FAST_STAT; z1 = FAST_READ;
- SET_REG(reg += 4); FAST_STAT; z1 |= FAST_READ << 8;
- SET_REG(reg += 4); FAST_STAT; z2 = FAST_READ;
- SET_REG(reg += 4); FAST_STAT; z2 |= FAST_READ << 8;
-
- if (S_HFC & HFC_SP) reg += 0x26;
-
- SET_REG(reg -= 2); FAST_STAT; f1 = FAST_READ;
- SET_REG(reg += 4); FAST_STAT; f2 = READ_DATA_1;
-
-#undef FAST_READ
-#undef FAST_STAT
-
- if (~chan & 1)
- { /* XXX was Z1 */
- S_HDLC_DZ_TAB[f1 & 0xf] = z2; /* We keep track of the 'Z' *
- * values for D-channel (tx),*
- * so we may calculate the # *
- * of FIFO bytes free when *
- * f1 != f2. */
- z2 = S_HDLC_DZ_TAB[f2 & 0xf];
- }
-
- z1 = 0x1ff - (z2 = (z1 - z2) & 0x1ff);
- f1 = 0xf - (f2 = (f1 - f2) & 0xf);
-
- if (chan & 1)
- return(z2 | (f2 << 16)); /* receive channel */
- else
- return(z1 | (f1 << 16)); /* transmit channel */
-}
-
-
-/*---------------------------------------------------------------------------*
- * Data handler for D channel(write) - chan 0 (HFC-S/SP)
- *---------------------------------------------------------------------------*/
-static void
-ihfc_hdlc_Dwrite (ihfc_sc_t *sc, u_char chan)
-{
- register u_int32_t sendlen;
- register u_short len;
- register u_char * src;
-
- BUS_VAR;
-
- if (!S_MBUF && IF_QEMPTY(&S_IFQUEUE)) return;
-
- sendlen = ihfc_Dsel_fifo(sc, chan, 0); /* select new fifo *
- * NOTE: the 16 higher bits *
- * contain the # of frame- *
- * etries free in the FIFO */
- while (sendlen & ~0xffff)
- {
- if (!S_MBUF)
- {
- if (!(S_MBUF = ihfc_getmbuf(sc, chan))) goto j1;
- }
-
- src = S_MBUFDATA;
- len = S_MBUFLEN;
-
- if (len >= 0x1ff) goto j0; /* frame is too big: skip! */
-
- sendlen &= 0xffff; /* only keep # of *
- * bytes free */
-
- SET_REG((S_HFC & HFC_SP) ? 0xac : 0x96);
-
- while (sendlen--)
- {
- if (!len--) break;
-
- DISBUSY(WRITE_DATA_1(*src++), sendlen = -1; len++; break);
- }
-
- if (!++sendlen) /* out of fifo: suspend */
- {
- S_MBUFDATA = src;
- S_MBUFLEN = len;
- break;
- }
-
- sendlen = ihfc_Dsel_fifo(sc, chan, 0x10); /* inc F1 */
- j0:
- i4b_Dfreembuf(S_MBUF);
- S_MBUF = NULL;
- }
- j1:
- return;
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for D channel(read) - chan 1 (HFC-S/SP)
- *
- * NOTE: Max framelength is (511 - 3) = 508 bytes, when only one frame
- * is received at a time.
- *---------------------------------------------------------------------------*/
-static void
-ihfc_hdlc_Dread (ihfc_sc_t *sc, u_char chan)
-{
- register u_char tmp = -1;
- register u_char to = 15;
- register u_int32_t reclen;
- register u_short crc;
- register u_short len;
- register u_char * dst;
-
- BUS_VAR;
-
- reclen = ihfc_Dsel_fifo(sc, chan, 0); /* select new fifo *
- * NOTE: the higher 16 bits *
- * contain the # of frames *
- * to receive. */
- while ((reclen & ~0xffff) && to--)
- {
- reclen &= 0xffff; /* only keep # of *
- * bytes to receive */
-
- if (!(S_MBUF = i4b_Dgetmbuf(DCH_MAX_LEN)))
- panic("ihfc_hdlc_Dread: No mbufs(unit=%d)!\n", S_UNIT);
-
- SET_REG((S_HFC & HFC_SP) ? 0xbd : 0xa7);
-
- if ((reclen > 2) && (reclen <= (DCH_MAX_LEN+2)))
- {
- dst = S_MBUFDATA;
- len = S_MBUFLEN = (reclen += 1) - 3;
- }
- else
- {
- len = 0;
- dst = NULL;
- }
-
- crc = -1; /* NOTE: after a "F1" or "Z1" hardware overflow *
- * it appears not to be necessary to reset the *
- * HFC-1/S or SP chips to continue proper *
- * operation, only and only, if we always read *
- * "Z1-Z2+1" bytes when F1!=F2 followed by a *
- * F2-counter increment. The bi-effect of doing *
- * this is the "STAT" field may say frame is ok *
- * when the frame is actually bad. *
- * The simple solution is to re-CRC the frame *
- * including "STAT" field to see if we get *
- * CRC == 0x3933. Then we're 99% sure all *
- * frames received are good. */
-
- while(reclen--)
- {
- DISBUSY(tmp = READ_DATA_1, break);
- if (len) { len--; *dst++ = tmp; }
-
- crc = (HDLC_FCS_TAB[(u_char)(tmp ^ crc)] ^ (u_char)(crc >> 8));
- }
-
- crc ^= 0x3933;
-
- if (!tmp && !crc)
- {
- ihfc_putmbuf(sc, chan, S_MBUF);
- S_MBUF = NULL;
- }
- else
- {
- NDBGL1(L1_ERROR, "Frame error (len=%d, stat=0x%x, "
- "crc=0x%x, unit=%d)", S_MBUFLEN, (u_char)tmp, crc,
- S_UNIT);
-
- i4b_Dfreembuf(S_MBUF);
- S_MBUF = NULL;
- }
-
- reclen = ihfc_Dsel_fifo(sc, chan, 0x20);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * EXIR error handler - ISAC (D - channel) (HFC-1)
- *---------------------------------------------------------------------------*/
-void
-ihfc_exir_hdlr (ihfc_sc_t *sc, u_char exir)
-{
- register u_char a;
- register u_char cmd;
-
- for (a = 0, cmd = 0; exir; a++, exir >>= 1)
- {
- if (exir & 1)
- {
- NDBGL1(L1_I_ERR, "%s. (unit=%d)",
- ihfc_EXIRtable[a].string, S_UNIT);
- cmd |= ihfc_EXIRtable[a].cmd;
- }
- }
-
- if (cmd) ihfc_cmdr_hdlr(sc, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * CMDR handler - ISAC (D - channel) (HFC-1)
- *---------------------------------------------------------------------------*/
-void
-ihfc_cmdr_hdlr (ihfc_sc_t *sc, u_char cmdr)
-{
- BUS_VAR;
-
- SET_REG(0x21); DISBUSY(WRITE_DATA_1(cmdr); DELAY(30), );
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for D channel(write) - chan 0 (HFC-1)
- *---------------------------------------------------------------------------*/
-static void
-ihfc_isac_Dwrite (ihfc_sc_t *sc, u_char chan)
-{
- register u_char sendlen = 32;
- register u_char cmd = 0;
- register u_short len;
- register u_char * src;
-
- BUS_VAR;
-
- if (~S_ISTA & 0x10) goto j0;
-
- if (!S_MBUF)
- if (!(S_MBUF = ihfc_getmbuf(sc, chan))) goto j0;
-
- len = S_MBUFLEN;
- src = S_MBUFDATA;
-
- SET_REG(0x00);
-
- while(sendlen--) /* write data */
- {
- if (!len--) break;
- DISBUSY(WRITE_DATA_1(*src++), goto a0);
- }
-
- cmd |= 0x08;
-
- if (!++sendlen) /* suspend */
- {
- S_MBUFLEN = len;
- S_MBUFDATA = src;
- }
- else
- {
- a0:
- i4b_Dfreembuf(S_MBUF);
- S_MBUF = NULL;
-
- cmd |= 0x02;
- }
-
- if (cmd) ihfc_cmdr_hdlr(sc, cmd);
-
- S_ISTA &= ~0x10;
- j0:
- return;
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for D channel(read) - chan 1 (HFC-1)
- *---------------------------------------------------------------------------*/
-static void
-ihfc_isac_Dread (ihfc_sc_t *sc, u_char chan)
-{
- register u_char cmd = 0;
- register u_char reclen;
- register u_short tmp;
- register u_short len;
- register u_char * dst;
-
- BUS_VAR;
-
- if (!(S_ISTA & 0xc0)) goto j1; /* only receive data *
- * on interrupt */
-
- if (!S_MBUF)
- {
- if (!(S_MBUF = i4b_Dgetmbuf(DCH_MAX_LEN)))
- panic("ihfc%d: (D) Out of mbufs!\n", S_UNIT);
- }
-
- len = S_MBUFLEN;
- dst = S_MBUFDATA + (DCH_MAX_LEN - len);
-
- if (S_ISTA & 0x80) /* RME */
- {
- SET_REG(0x27); DISBUSY(tmp = (READ_DATA_1 ^ 0x20), goto j0);
-
- if (tmp & 0x70) goto j0; /* error */
-
- SET_REG(0x25); DISBUSY(tmp = (READ_DATA_1 & 0x1f), goto j0);
-
- reclen = (tmp) ? tmp : 32;
- }
- else /* RPF */
- {
- reclen = 32;
- }
-
- if ((len -= reclen) <= DCH_MAX_LEN) /* get data */
- {
- SET_REG(0x00);
-
- while(reclen--)
- {
- DISBUSY(*dst++ = READ_DATA_1, goto j0);
- }
- }
- else /* soft rdo or error */
- {
- j0: i4b_Dfreembuf(S_MBUF);
- S_MBUF = NULL;
-
- cmd |= 0x40;
-
- NDBGL1(L1_I_ERR, "Frame error (unit=%d)", S_UNIT);
- }
-
- if (S_ISTA & 0x80) /* frame complete */
- {
- if (S_MBUF)
- {
- S_MBUFLEN = (DCH_MAX_LEN - len);
- ihfc_putmbuf(sc, chan, S_MBUF);
- S_MBUF = NULL;
- }
- }
-
- if (S_MBUF) /* suspend */
- {
- S_MBUFLEN = len;
- }
-
- ihfc_cmdr_hdlr(sc, cmd | 0x80);
-
- S_ISTA &= ~0xc0;
- j1:
- return;
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for B channel(write) - chan 2 and 4 (HFC-1/S/SP)
- *
- * NOTE: No XDU checking!
- *---------------------------------------------------------------------------*/
-static void
-ihfc_trans_Bwrite (ihfc_sc_t *sc, u_char chan)
-{
- register u_short sendlen;
- register u_short len;
- register u_char * src;
-
- BUS_VAR;
-
- if (!S_MBUF && IF_QEMPTY(&S_IFQUEUE)) return;
-
- sendlen = (u_short)ihfc_Bsel_fifo(sc, chan, 0);
-
- SET_REG(0xaa + chan);
-
- while (1)
- {
- if (!S_MBUF)
- {
- S_MBUF = ihfc_getmbuf(sc, chan);
- if (!S_MBUF) break;
- }
-
- src = S_MBUFDATA;
- len = S_MBUFLEN;
-
- while (sendlen--)
- {
- if (!len--) break;
-
- DISBUSY(WRITE_DATA_1(*src++), sendlen = -1; len++; break);
- }
-
- if (!++sendlen) /* out of fifo: Suspend */
- {
- S_MBUFDATA = src;
- S_MBUFLEN = len;
- break;
- }
-
- i4b_Dfreembuf(S_MBUF);
- S_MBUF = NULL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for B channel(read) - chan 3 and 5 (HFC-1/S/SP)
- * (this code is optimized)
- *---------------------------------------------------------------------------*/
-static void
-ihfc_trans_Bread (ihfc_sc_t *sc, u_char chan)
-{
- register u_short reclen;
- register u_short tmp;
- register u_short len;
- register u_char * dst;
-
- BUS_VAR;
-
- reclen = (u_short)ihfc_Bsel_fifo(sc, chan, 0);
-
- while (1)
- {
- SET_REG(0xba + chan);
-
- tmp = 0x100;
-
- if (!S_MBUF)
- if (!(S_MBUF = i4b_Bgetmbuf(BCH_MAX_DATALEN)))
- panic("ihfc%d: (B) Out of mbufs!\n", S_UNIT);
-
- len = S_MBUFLEN;
- dst = S_MBUFDATA + (BCH_MAX_DATALEN - len);
-
- while (reclen--)
- {
- if (!len--) break;
-
- if (tmp & 0x100) DISBUSY( , reclen = -1; len++; break);
- *dst++ = (u_char)(tmp = READ_BOTH_2);
- }
-
- if (~tmp & 0x100)
- {
- SET_REG(0x30);
- READ_DATA_1; /* a read to the data port *
- * will disable the internal *
- * disbusy signal for HFC-1/S *
- * chips. This is neccessary *
- * to avvoid data loss. */
- }
-
- if (!++reclen) /* out of fifo: suspend */
- {
- S_MBUFLEN = len;
- break;
- }
-
- S_MBUFLEN = (BCH_MAX_DATALEN - ++len);
-
- ihfc_putmbuf(sc, chan, S_MBUF);
-
- S_MBUF = NULL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for B channel(write) - chan 2 and 4 (HFC-1/S/SP)
- *
- * NOTE: Software HDLC encoding!
- *---------------------------------------------------------------------------*/
-static void
-ihfc_hdlc_Bwrite (ihfc_sc_t *sc, u_char chan)
-{
- register u_short blevel = S_HDLC_BLEVEL;
- register u_char flag = S_HDLC_FLAG;
- register u_int tmp = S_HDLC_TMP;
- register u_short crc = S_HDLC_CRC;
- register u_short ib = S_HDLC_IB;
- register u_char * src = NULL;
- register u_short len = 0;
- register u_short sendlen;
- register u_short tmp2;
-
- BUS_VAR;
-
- if (!S_MBUF && IF_QEMPTY(&S_IFQUEUE) && (flag == 2)) return;
-
- sendlen = (u_short)ihfc_Bsel_fifo(sc, chan, 0);
-
- SET_REG(0xaa + chan);
-
- if (S_MBUF)
- {
- /* resume */
-
- src = S_MBUFDATA;
- len = S_MBUFLEN;
-
- if (sendlen == 0x5ff)
- {
- /* XDU */
-
- flag = -2;
- len = 0;
-
- NDBGL1(L1_S_ERR, "XDU (unit=%d)", S_UNIT);
- }
- }
-
- while (sendlen--)
- {
- HDLC_ENCODE(*src++, len, tmp, tmp2, blevel, ib, crc, flag,
- {/* gfr */
- i4b_Bfreembuf(S_MBUF);
- S_MBUF = ihfc_getmbuf(sc, chan);
-
- if (S_MBUF)
- {
- src = S_MBUFDATA;
- len = S_MBUFLEN;
- }
- else
- {
- sendlen = 0; /* Exit after final FS, *
- * else the buffer will *
- * only be filled with *
- * "0x7e"-bytes! */
- }
- },
- {/* wrd */
-
- DISBUSY(WRITE_DATA_1((u_char)tmp), sendlen = 0);
- },
- d );
- }
-
- if (S_MBUF) /* suspend */
- {
- S_MBUFDATA = src;
- S_MBUFLEN = len;
- }
-
- S_HDLC_IB = ib;
- S_HDLC_BLEVEL = blevel;
- S_HDLC_TMP = tmp;
- S_HDLC_FLAG = flag;
- S_HDLC_CRC = crc;
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for B channel(read) - chan 3 and 5 (HFC-1/S/SP)
- *
- * NOTE: Software HDLC decoding!
- *---------------------------------------------------------------------------*/
-static void
-ihfc_hdlc_Bread (ihfc_sc_t *sc, u_char chan)
-{
- register u_char blevel = S_HDLC_BLEVEL;
- u_char flag = S_HDLC_FLAG;
- register u_short crc = S_HDLC_CRC;
- register u_int tmp = S_HDLC_TMP;
- register u_short ib = S_HDLC_IB;
- register u_char * dst = NULL;
- register u_short tmp2 = 0x100;
- register u_short len = 0;
- register u_short reclen;
-
- BUS_VAR;
-
- if (S_MBUF)
- {
- /* resume */
-
- len = S_MBUFLEN;
- dst = S_MBUFDATA + (BCH_MAX_DATALEN - len);
- }
-
- reclen = (u_short)ihfc_Bsel_fifo(sc, chan, 0);
-
- SET_REG(0xba + chan);
-
- while (reclen--)
- {
- HDLC_DECODE(*dst++, len, tmp, tmp2, blevel, ib, crc, flag,
- {/* rdd */
- /* if (tmp2 & 0x100) while (GET_STAT & 1);
- * tmp2 = READ_BOTH_2;
- */
-
- DISBUSY(tmp2 = READ_DATA_1, reclen = 0; tmp2 = 0);
- },
- {/* nfr */
- if (!(S_MBUF = i4b_Bgetmbuf(BCH_MAX_DATALEN)))
- panic("ihfc:(B) Out of mbufs!\n");
-
- dst = S_MBUFDATA;
- len = BCH_MAX_DATALEN;
- },
- {/* cfr */
- len = (BCH_MAX_DATALEN - len);
-
- if ((!len) || (len > BCH_MAX_DATALEN))
- {
- /* NOTE: frames without any data, *
- * only crc field, should be silently discared. */
-
- i4b_Bfreembuf(S_MBUF);
- NDBGL1(L1_S_MSG, "Bad frame (len=%d, unit=%d)", len, S_UNIT);
- goto s0;
- }
-
- if (crc)
- { i4b_Bfreembuf(S_MBUF);
- NDBGL1(L1_S_ERR, "CRC (crc=0x%04x, len=%d, unit=%d)", crc, len, S_UNIT);
- goto s0;
- }
-
- S_MBUFLEN = len;
-
- ihfc_putmbuf(sc, chan, S_MBUF);
- s0:
- S_MBUF = NULL;
- },
- {/* rab */
- i4b_Bfreembuf(S_MBUF);
- S_MBUF = NULL;
-
- NDBGL1(L1_S_MSG, "Read Abort (unit=%d)", S_UNIT);
- },
- {/* rdo */
- i4b_Bfreembuf(S_MBUF);
- S_MBUF = NULL;
-
- NDBGL1(L1_S_ERR, "RDO (unit=%d)", S_UNIT);
- },
- continue,
- d);
- }
-
- /* SET_REG(0x30);
- * if (~tmp2 & 0x100) READ_DATA_1; kill disbusy signal
- */
-
- if (S_MBUF) S_MBUFLEN = len; /* suspend */
-
- S_HDLC_IB = ib;
- S_HDLC_CRC = crc;
- S_HDLC_TMP = tmp;
- S_HDLC_FLAG = flag;
- S_HDLC_BLEVEL = blevel;
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for B channel(write) - chan 2 and 4 (HFC-1/S/SP)
- *
- * This filter generates a pattern which is recognized
- * and examinated and verified by ihfc_test_Bread.
- *
- * NOTE: This filter is only for testing purpose.
- *---------------------------------------------------------------------------*/
-static void
-ihfc_test_Bwrite (ihfc_sc_t *sc, u_char chan)
-{
- struct mbuf *m;
-
- register u_char fb;
- register u_short sendlen, tlen;
- register u_short xlen = S_HDLC_IB;
- BUS_VAR;
-
- goto j0;
-
- while((m = ihfc_getmbuf(sc, chan))) /* internal loop */
- {
- if (chan == 2)
- ihfc_putmbuf(sc, 5, m);
- else
- ihfc_putmbuf(sc, 3, m);
- }
-
- j0:
-
- sendlen = /* (u_short)ihfc_Bsel_fifo(sc, chan, 0); */ 0;
-
- if (sendlen == 0x5ff) printf("(send empty)");
-
- SET_REG(0xaa + chan);
-
- S_BYTES += sendlen;
-
- tlen = S_HDLC_CRC;
-
- if (sendlen > 0x400) printf("(slow: %d)", sendlen);
-
- fb = 0x80;
-
- while (sendlen--)
- {
- if (!tlen--) fb |= 0x20;
-
- if (!xlen--)
- {
- while(GET_STAT & 1);
- WRITE_DATA_1(0x3e);
- xlen = 200;
- }
- else
- {
- while(GET_STAT & 1);
- WRITE_DATA_1((xlen + 1) & 0xef);
- }
-
- fb = 0;
- }
-
- S_HDLC_IB = xlen;
-}
-
-/*---------------------------------------------------------------------------*
- * Data handler for B channel(read) - chan 3 and 5 (HFC-1/S/SP)
- *
- * This filter examins and verifies the pattern
- * generated by ihfc_test_Bwrite.
- *
- * NOTE: This filter is only for testing purpose.
- *---------------------------------------------------------------------------*/
-static void
-ihfc_test_Bread (ihfc_sc_t *sc, u_char chan)
-{
- static u_short toterrors = 0;
-
- register u_short reclen, len, tlen;
- register u_char fb, tmp;
-
- register u_short xlen = S_HDLC_IB;
- register u_char *dst = NULL;
- register u_char error = S_HDLC_TMP;
- register u_char ecount = S_HDLC_FLAG;
-
- BUS_VAR;
-
- if (S_UNIT != 0) return;
-
- reclen = /* (u_short)ihfc_Bsel_fifo(sc, chan, 0); */ 0;
-
- S_BYTES += reclen;
-
- tlen = S_HDLC_CRC;
-
- fb = 0x40;
-
- if (S_MBUF)
- {
- len = S_MBUFLEN;
- dst = S_MBUFDATA + (BCH_MAX_DATALEN - len);
- }
- else
- {
- len = 0;
- }
-
- SET_REG(0xba + chan);
-
- while (reclen--)
- {
-/* if (tmp2 & 0x100) while(GET_STAT & 1);
- * tmp = (u_char)(tmp2 = READ_BOTH_2);
- */
- if (GET_STAT & 1)
- {
- /* if (!(++busy % 4)) reclen++; */
- while(GET_STAT & 1);
- }
-
- tmp = READ_DATA_1;
-
- if ((tmp & 0x3f) == 0x3e)
- {
- if ((BCH_MAX_DATALEN - len) != 201) error |= 4;
-
- if ((S_MBUF) && (error))
- {
- if (len) { len--; *dst++ = error; }
- if (len) { len--; *dst++ = xlen+1; }
- if (len) { len--; *dst++ = ecount; }
-
- S_MBUFLEN = BCH_MAX_DATALEN - len;
-
- if (S_TRACE & TRACE_B_RX)
- ihfc_putmbuf(sc, chan, S_MBUF);
- else
- i4b_Bfreembuf(S_MBUF);
-
- S_MBUF = NULL;
- printf("(error%d, %d, %d)", S_UNIT, ecount, toterrors++);
- }
-
- i4b_Bfreembuf(S_MBUF);
- S_MBUF = i4b_Bgetmbuf(BCH_MAX_DATALEN);
-
- dst = S_MBUFDATA;
- len = BCH_MAX_DATALEN;
-
- xlen = 200;
- error = 0;
- ecount = 0;
-
- /* SET_REG(0xba + chan); */
- }
- else
- {
- if (!xlen) error |= 2;
- if ((tmp ^ xlen--) & 0xef) { error |= 1; ecount++; }
- }
- if (!tlen--) fb |= 0x20;
-
- if (len--)
- {
- *dst++ = (tmp | fb);
- }
- else
- {
- len++;
- }
-
- fb = 0;
- }
-
- if (S_MBUF)
- {
- S_MBUFLEN = len;
- }
-
- S_HDLC_IB = xlen;
- S_HDLC_TMP = error;
- S_HDLC_FLAG = ecount;
-}
diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc_drv.h b/sys/i4b/layer1/ihfc/i4b_ihfc_drv.h
deleted file mode 100644
index 9ea6720..0000000
--- a/sys/i4b/layer1/ihfc/i4b_ihfc_drv.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_ihfc_drv.h - include file for the HFC-1/S/SP driver
- * -------------------------------------------------------
- *
- * last edit-date: [Wed Jul 19 09:40:55 2000]
- *
- * $Id: i4b_ihfc_drv.h,v 1.7 2000/09/19 13:50:36 hm Exp $
- *
- * $FreeBSD$
- *
- *---------------------------------------------------------------------------*/
-#ifndef I4B_IHFC_DRV_H_
-#define I4B_IHFC_DRV_H_
-
-/*---------------------------------------------------------------------------*
- * Ramptables related fifo (HFC-1/S/SP)
- *
- * The HFC-SP chip only uses ihfc_xxx[2] values for D-channel!
- * NOTE: These tables are not used anymore.
- *---------------------------------------------------------------------------*
- *
- * w - write, r - read: D1_w D1_r B1_w B1_r B2_w B2_r
- * const u_char ihfc_readtable[6] = {0xa6, 0xa7, 0xbc, 0xbd, 0xbe, 0xbf};
- * const u_char ihfc_writetable[6] = {0x96, 0x97, 0xac, 0xad, 0xae, 0xaf};
- * const u_char ihfc_f1inctable[6] = {0x92, 0x93, 0xa8, 0xa9, 0xaa, 0xab};
- * const u_char ihfc_f2inctable[6] = {0xa2, 0xa3, 0xb8, 0xb9, 0xba, 0xbb};
- *
- * const struct { u_char z1L, z1H, z2L, z2H, f1, f2, dummy; }
- * ihfc_countertable[6] = {
- * {0x90, 0x94, 0x98, 0x9c, 0x9a, 0x9e, 0x00}, D1_w
- * {0x91, 0x95, 0x99, 0x9d, 0x9b, 0x9f, 0x00}, D1_r
- * {0x80, 0x84, 0x88, 0x8c, 0xb0, 0xb4, 0x00}, B1_w
- * {0x81, 0x85, 0x89, 0x8d, 0xb1, 0xb5, 0x00}, B1_r
- * {0x82, 0x86, 0x8a, 0x8e, 0xb2, 0xb6, 0x00}, B2_w
- * {0x83, 0x87, 0x8b, 0x8f, 0xb3, 0xb7, 0x00} B2_r
- * };
- *---------------------------------------------------------------------------*/
-
-/*---------------------------------------------------------------------------*
- * Ramptables related to configuration (HFC-1/S/SP)
- *
- * NOTE: Write registers only
- *---------------------------------------------------------------------------*/
-const u_char ihfc_configtable[11] =
-{
- 0x18, 0x19, 0x1a, /* cirm, ctmt, int_m1 */
- 0x1b, 0x2e, 0x37, /* int_m2, mst_mode, clkdel */
- 0x31, 0x2f, 0x32, /* sctrl, connect, test/sctrl_e */
- 0x33, 0x00 /* sctrl_r */
-};
-const u_char isac_configtable[9] =
-{
- 0x39, 0x30, 0x3b, /* adf2, spcr, sqxr */
- 0x38, 0x37, 0x22, /* adf1, stcr, mode */
- 0x20, 0x2b, 0x00 /* mask, star2 */
-};
-
-/*---------------------------------------------------------------------------*
- * Ramptables related to statemachine (HFC-1/S/SP)
- *
- * state:
- * 0 = deactivated
- * 1 = pending
- * 2 = syncronized
- * 3 = activated
- * 4 = error
- * 5 = reset
- * -1 = illegal
- *---------------------------------------------------------------------------*/
-
-const struct ihfc_FSMtable { u_char state, *string; }
-
- ihfc_TEtable[16] = /* HFC-S/SP - TE */
-{
- { 0x05 ,"Reset" },
- { 0xff , 0 },
- { 0x01 ,"Sensing" },
- { 0x00 ,"Deactivated" },
- { 0x01 ,"Awaiting signal" },
- { 0x01 ,"Identifying input" },
- { 0x02 ,"Syncronized" },
- { 0x03 ,"Activated" },
- { 0x04 ,"Lost framing" },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 }
-},
- ihfc_NTtable[16] = /* HFC-S/SP - NT */
-{
- { 0x05 ,"Reset" },
- { 0x00 ,"Deactive" },
- { 0x02 ,"Pending activation" },
- { 0x03 ,"Active" },
- { 0x01 ,"Pending deactivation" },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 }
-},
- ihfc_TEtable2[16] = /* HFC-1/ISAC - TE */
-{
- { 0x00 ,"Deactivate request" },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0xff , 0 },
- { 0x01 ,"Level detected" },
- { 0xff , 0 },
- { 0x04 ,"Error indication" },
- { 0x00 ,"Power-up" },
- { 0x02 ,"Activate request downstream" },
- { 0xff , 0 },
- { 0x00 ,"Test indication" },
- { 0x00 ,"Awake test indication" },
- { 0x03 ,"Activate ind. with priority class 8" },
- { 0x03 ,"Activate ind. with priority class 10" },
- { 0xff , 0 },
- { 0x00 ,"Deactivate indication downstream" }
-};
-
-/*---------------------------------------------------------------------------*
- * Ramptable related to ISAC EXIR (HFC-1)
- *
- * cmd: command to execute, if any.
- *
- *---------------------------------------------------------------------------*/
-const struct ihfc_EXIRtable { u_char cmd, *string; }
-
- ihfc_EXIRtable[8] =
-{
- { 0x00 ,"Watchdog Timer Overflow" },
- { 0x00 ,"Subscriber Awake" },
- { 0x00 ,"Monitor Status" },
- { 0x00 ,"Rx Sync Xfer Overflow" },
- { 0xc0 ,"Rx Frame Overflow" }, /* RMC + RRES */
- { 0x00 ,"Protocol Error" },
- { 0x01 ,"Tx Data Underrun" }, /* XRES */
- { 0x01 ,"Tx Message Repeat" }, /* XRES */
-};
-
-/*---------------------------------------------------------------------------*
- * Ramptables related to S/Q - channel (HFC-1/S/SP)
- *
- * From TE's viewpoint:
- * Q: commands to NT
- * S: indications from NT
- *
- * From NT's viewpoint:
- * Q: indications from TE
- * S: commands to TE
- *
- * cmd: not used
- *---------------------------------------------------------------------------*/
-const struct ihfc_SQtable { u_char cmd, *string; }
-
- ihfc_Qtable[16] =
-{
- { 0x00, "Loss of Power indication" },
- { 0x00, "ST request" },
- { 0x00, 0 },
- { 0x00, "LoopBack request (B1/B2)" },
- { 0x00, 0 },
- { 0x00, 0 },
- { 0x00, 0 },
- { 0x00, "LoopBack request (B1)" },
- { 0x00, 0 },
- { 0x00, 0 },
- { 0x00, 0 },
- { 0x00, "LoopBack request (B2)" },
- { 0x00, "V-DCE slave mode" },
- { 0x00, "V-DTE slave mode" },
- { 0x00, 0 },
- { 0x00, "Idle" }
-},
- ihfc_Stable[16] =
-{
- { 0x00, "Idle" },
- { 0x00, "ST Fail" },
- { 0x00, "ST Pass" },
- { 0x00, "Disruptive Operation Indication" },
- { 0x00, "DTSE-OUT" },
- { 0x00, "V-DCE master mode" },
- { 0x00, "ST Indication" },
- { 0x00, "DTSE-IN" },
- { 0x00, "LoopBack indication (B1/B2)" },
- { 0x00, "Loss of Received Signal indication" },
- { 0x00, "LoopBack indication (B2)" },
- { 0x00, "DTSE-IN and OUT" },
- { 0x00, "LoopBack indication (B1)" },
- { 0x00, "Loss of power indication" }
-};
-
-
-#endif /* I4B_IHFC_DRV_H_ */
-
diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc_ext.h b/sys/i4b/layer1/ihfc/i4b_ihfc_ext.h
deleted file mode 100644
index fde0c87..0000000
--- a/sys/i4b/layer1/ihfc/i4b_ihfc_ext.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_ihfc_ext.h - ihfc common prototypes
- * ---------------------------------------
- *
- * last edit-date: [Wed Jul 19 09:40:59 2000]
- *
- * $Id: i4b_ihfc_ext.h,v 1.6 2000/08/20 07:14:08 hm Exp $
- *
- * $FreeBSD$
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef I4B_IHFC_EXT_H_
-#define I4B_IHFC_EXT_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-
-/* prototypes from i4b_ihfc_l1if.c */
-
-extern struct i4b_l1mux_func ihfc_l1mux_func;
-
-void ihfc_B_linkinit (ihfc_sc_t *sc);
-struct mbuf * ihfc_getmbuf (ihfc_sc_t *sc, u_char chan);
-void ihfc_putmbuf (ihfc_sc_t *sc, u_char chan, struct mbuf *m);
-
-
-/* prototypes from i4b_ihfc_drv.c */
-
-void ihfc_intr1 (ihfc_sc_t *sc);
-void ihfc_intr2 (ihfc_sc_t *sc);
-
-int ihfc_control (ihfc_sc_t *sc, int flag);
-void ihfc_fsm (ihfc_sc_t *sc, int flag);
-int ihfc_init (ihfc_sc_t *sc, u_char chan, int prot, int activate);
-
-#endif /* I4B_IHFC_EXT_H_ */
diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c b/sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c
deleted file mode 100644
index 2ed4c46..0000000
--- a/sys/i4b/layer1/ihfc/i4b_ihfc_l1if.c
+++ /dev/null
@@ -1,510 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_ihfc_l1.c - hfc layer 1 handler
- * -----------------------------------
- * The idea of this file is to separate hfcs/sp/pci data/signal
- * handling and the I4B data/signal handling.
- *
- * Everything which has got anything to do with I4B has been put here!
- *
- * last edit-date: [Wed Jul 19 09:41:03 2000]
- * $Id: i4b_ihfc_l1if.c,v 1.10 2000/09/19 13:50:36 hm Exp $
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/ihfc/i4b_ihfc.h>
-#include <i4b/layer1/ihfc/i4b_ihfc_ext.h>
-
-/*---------------------------------------------------------------------------*
- * Local prototypes
- *
- * NOTE: The prototypes for get/putmbuf and B_linkinit
- * have been put in i4b_hfc_ext.h for global hfc use.
- *
- * NOTE: channel != chan
- *---------------------------------------------------------------------------*/
-static
-isdn_link_t * ihfc_B_ret_linktab (int unit, int channel);
-static void ihfc_B_set_linktab (int unit, int channel, drvr_link_t *B_linktab);
-
-static void ihfc_B_start (int unit, int chan);
-static void ihfc_B_stat (int unit, int chan, bchan_statistics_t *bsp);
- void ihfc_B_setup (int unit, int chan, int bprot, int activate);
-
-static int ihfc_mph_command_req (int unit, int command, void *parm);
-
-static int ihfc_ph_activate_req (int unit);
-static int ihfc_ph_data_req (int unit, struct mbuf *m, int freeflag);
-
-static void ihfc_T3_expired (ihfc_sc_t *sc);
-
-/*---------------------------------------------------------------------------*
- * Our I4B L1 mulitplexer link
- *---------------------------------------------------------------------------*/
-struct i4b_l1mux_func ihfc_l1mux_func = {
- ihfc_B_ret_linktab,
- ihfc_B_set_linktab,
- ihfc_mph_command_req,
- ihfc_ph_data_req,
- ihfc_ph_activate_req,
-};
-
-/*---------------------------------------------------------------------------*
- * L2 -> L1: PH-DATA-REQUEST (D-Channel)
- *
- * NOTE: We may get called here from ihfc_hdlc_Dread or isac_hdlc_Dread
- * via the upper layers.
- *---------------------------------------------------------------------------*/
-static int
-ihfc_ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- ihfc_sc_t *sc = &ihfc_softc[unit];
- u_char chan = 0;
- HFC_VAR;
-
- if (!m) return 0;
-
- HFC_BEG;
-
- if(S_PHSTATE != 3)
- {
- NDBGL1(L1_PRIM, "L1 was not running: "
- "ihfc_ph_activate_req(unit = %d)!", unit);
-
- ihfc_ph_activate_req(unit);
- }
-
- /* "Allow" I-frames (-hp) */
-
- if (freeflag == MBUF_DONTFREE) m = m_copypacket(m, M_DONTWAIT);
-
- if (!_IF_QFULL(&S_IFQUEUE) && m)
- {
- IF_ENQUEUE(&S_IFQUEUE, m);
-
- ihfc_B_start(unit, chan); /* (recycling) */
- }
- else
- {
- NDBGL1(L1_ERROR, "No frame out (unit = %d)", unit);
- if (m) i4b_Dfreembuf(m);
-
- HFC_END;
- return 0;
- }
-
- if (S_INTR_ACTIVE) S_INT_S1 |= 0x04;
-
- HFC_END;
-
- return 1;
-}
-
-/*---------------------------------------------------------------------------*
- * L2 -> L1: PH-ACTIVATE-REQUEST (B-channel and D-channel)
- *---------------------------------------------------------------------------*/
-static int
-ihfc_ph_activate_req(int unit)
-{
- ihfc_sc_t *sc = &ihfc_softc[unit];
- HFC_VAR;
-
- HFC_BEG;
-
- if ((!S_STM_T3) && (S_PHSTATE != 3))
- {
- HFC_FSM(sc, 1);
-
- S_STM_T3 = 1;
- S_STM_T3CALLOUT = timeout((TIMEOUT_FUNC_T)
- ihfc_T3_expired, (ihfc_sc_t *)sc,
- IHFC_ACTIVATION_TIMEOUT);
- }
-
- HFC_END;
- return 0;
-}
-/*---------------------------------------------------------------------------*
- * T3 timeout - persistant deactivation
- *---------------------------------------------------------------------------*/
-static void
-ihfc_T3_expired(ihfc_sc_t *sc)
-{
- u_char chan = 0;
- HFC_VAR;
-
- HFC_BEG;
-
- S_STM_T3 = 0;
-
- if (S_PHSTATE != 3) /* line was not activated */
- {
- i4b_Dcleanifq(&S_IFQUEUE);
- i4b_l1_ph_deactivate_ind(S_I4BUNIT);
-
- i4b_l1_mph_status_ind(S_I4BUNIT, STI_PDEACT, 0, 0);
-
- HFC_FSM(sc, 2); /* L1 deactivate */
- }
-
- HFC_END;
-}
-
-/*---------------------------------------------------------------------------*
- * Command from the upper layers (B-channel and D-channel)
- *---------------------------------------------------------------------------*/
-static int
-ihfc_mph_command_req(int unit, int command, void *parm)
-{
- ihfc_sc_t *sc = &ihfc_softc[unit];
-
- switch(command)
- {
- case CMR_DOPEN: /* daemon running */
- NDBGL1(L1_PRIM,
- "unit %d, command = CMR_DOPEN", unit);
- S_ENABLED = 1;
- break;
-
- case CMR_DCLOSE: /* daemon not running */
- NDBGL1(L1_PRIM,
- "unit %d, command = CMR_DCLOSE", unit);
- S_ENABLED = 0;
- break;
-
- case CMR_SETTRACE: /* set new trace mask */
- NDBGL1(L1_PRIM,
- "unit %d, command = CMR_SETTRACE, parm = %d",
- unit, (unsigned int)parm);
- S_TRACE = (unsigned int)parm;
- break;
-
- case CMR_GCST: /* get chip statistic */
- NDBGL1(L1_PRIM,
- "unit %d, command = CMR_GCST, parm = %d",
- unit, (unsigned int)parm);
-
- #define CST ((struct chipstat *)parm)
-
- CST->driver_type = L1DRVR_IHFC;
-
- /* XXX CST->xxxx_stat = xxx; */
-
- #undef CST
- break;
-
- default:
- NDBGL1(L1_ERROR,
- "ERROR, unknown command = %d, unit = %d, parm = %d",
- command, unit, (unsigned int)parm);
- break;
- }
-
- return 0;
-}
-
-/*---------------------------------------------------------------------------*
- * Data source switch for Read channels - 1, 3 and 5 (B and D-Channel)
- *---------------------------------------------------------------------------*/
-void
-ihfc_putmbuf (ihfc_sc_t *sc, u_char chan, struct mbuf *m)
-{
- i4b_trace_hdr_t hdr;
-
- if (chan < 2)
- {
- if(S_TRACE & TRACE_D_RX)
- {
- hdr.count = ++S_DTRACECOUNT;
- hdr.dir = FROM_NT;
- hdr.type = TRC_CH_D;
- hdr.unit = S_I4BUNIT;
-
- MICROTIME(hdr.time);
-
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
-
- if (!S_ENABLED) { i4b_Dfreembuf(m); return; }
-
- m->m_pkthdr.len = m->m_len;
-
- i4b_l1_ph_data_ind(S_I4BUNIT, m);
- }
- else
- {
- if(S_TRACE & TRACE_B_RX)
- {
- hdr.count = ++S_BTRACECOUNT;
- hdr.dir = FROM_NT;
- hdr.type = (chan < 4) ? TRC_CH_B1 : TRC_CH_B2;
- hdr.unit = S_I4BUNIT;
-
- MICROTIME(hdr.time);
-
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
-
- if (!S_ENABLED) { i4b_Bfreembuf(m); return; }
-
- if (S_PROT == BPROT_NONE)
- {
- if(!i4b_l1_bchan_tel_silence(m->m_data, m->m_len))
- {
- S_BDRVLINK->bch_activity(S_BDRVLINK->unit, ACT_RX);
- }
-
- if (!_IF_QFULL(&S_IFQUEUE))
- {
- S_BYTES += m->m_len;
- IF_ENQUEUE(&S_IFQUEUE, m);
- S_BDRVLINK->bch_rx_data_ready(S_BDRVLINK->unit);
- }
-
- return;
- }
-
- if (S_PROT == BPROT_RHDLC)
- {
- S_MBUFDUMMY = m;
- S_BYTES += m->m_pkthdr.len = m->m_len;
- S_BDRVLINK->bch_rx_data_ready(S_BDRVLINK->unit);
- S_MBUFDUMMY = NULL;
-
- return;
- }
-
- NDBGL1(L1_ERROR, "Unknown protocol: %d", S_PROT);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Data destinator switch for write channels - 0, 2 and 4
- *---------------------------------------------------------------------------*/
-struct mbuf *
-ihfc_getmbuf (ihfc_sc_t *sc, u_char chan)
-{
- register struct mbuf *m;
- i4b_trace_hdr_t hdr;
-
- if (chan < 2)
- {
- IF_DEQUEUE(&S_IFQUEUE, m);
-
- if((S_TRACE & TRACE_D_TX) && m)
- {
- hdr.count = ++S_DTRACECOUNT;
- hdr.dir = FROM_TE;
- hdr.type = TRC_CH_D;
- hdr.unit = S_I4BUNIT;
-
- MICROTIME(hdr.time);
-
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
- }
- else
- {
- IF_DEQUEUE(&S_IFQUEUE, m);
-
- if (!m)
- {
- S_BDRVLINK->bch_tx_queue_empty(S_BDRVLINK->unit);
-
- IF_DEQUEUE(&S_IFQUEUE, m);
- }
- if (m)
- {
- if(!i4b_l1_bchan_tel_silence(m->m_data, m->m_len))
- {
- S_BDRVLINK->bch_activity(S_BDRVLINK->unit, ACT_TX);
- }
-
- S_BYTES += m->m_len;
-
- if(S_TRACE & TRACE_B_TX)
- {
- hdr.count = ++S_BTRACECOUNT;
- hdr.dir = FROM_TE;
- hdr.type = (chan < 4) ? TRC_CH_B1 : TRC_CH_B2;
- hdr.unit = S_I4BUNIT;
-
- MICROTIME(hdr.time);
-
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
- }
- }
-
- return(m);
-}
-
-/*---------------------------------------------------------------------------*
- * Initialize rx/tx data structures (B-channel)
- *---------------------------------------------------------------------------*/
-void
-ihfc_B_setup(int unit, int chan, int bprot, int activate)
-{
- ihfc_sc_t *sc = &ihfc_softc[unit];
- HFC_VAR;
-
- if (((u_int)chan > 5) || ((u_int)chan < 2)) return;
-
- HFC_BEG;
-
- HFC_INIT(sc, chan, bprot, activate);
-
- HFC_END;
-}
-
-/*---------------------------------------------------------------------------*
- * Start transmission (B-channel or D-channel tx)
- * NOTE: if "chan" variable is corrupted, it will not cause any harm,
- * but data may be lost and there may be software sync. errors.
- *---------------------------------------------------------------------------*/
-static void
-ihfc_B_start(int unit, int chan)
-{
- ihfc_sc_t *sc = &ihfc_softc[unit];
- HFC_VAR;
-
- if ((u_int)chan > 5) return;
-
- HFC_BEG;
-
- if (S_FILTER && !S_MBUF && !S_INTR_ACTIVE)
- {
- S_INTR_ACTIVE |= 2; /* never know what *
- * they put in the *
- * L2 code */
-
- S_FILTER(sc, chan); /* quick tx */
-
- S_INTR_ACTIVE &= ~2;
- }
-
- HFC_END;
-}
-
-/*---------------------------------------------------------------------------*
- * Fill statistics struct (B-channel)
- *---------------------------------------------------------------------------*/
-static void
-ihfc_B_stat(int unit, int chan, bchan_statistics_t *bsp)
-{
- ihfc_sc_t *sc = &ihfc_softc[unit];
- HFC_VAR;
-
- if ((u_int)chan > 5) return;
-
- chan &= ~1;
-
- HFC_BEG;
-
- bsp->inbytes = S_BYTES; S_BYTES = 0;
-
- chan++;
-
- bsp->outbytes = S_BYTES; S_BYTES = 0;
-
- HFC_END;
-}
-
-/*---------------------------------------------------------------------------*
- * Return the address of IHFC linktab to I4B (B-channel)
- *---------------------------------------------------------------------------*/
-static isdn_link_t *
-ihfc_B_ret_linktab(int unit, int channel)
-{
- ihfc_sc_t *sc = &ihfc_softc[unit];
-
- if (channel < 2)
- return(&sc->sc_blinktab[channel]);
- else
- return 0;
-}
-
-/*---------------------------------------------------------------------------*
- * Set the I4B driver linktab for IHFC use (B-channel)
- *---------------------------------------------------------------------------*/
-static void
-ihfc_B_set_linktab(int unit, int channel, drvr_link_t *B_linktab)
-{
- ihfc_sc_t *sc = &ihfc_softc[unit];
-
- if (channel < 2)
- sc->sc_bdrvlinktab[channel] = B_linktab;
-}
-
-/*---------------------------------------------------------------------------*
- * Initialize linktab for I4B use (B-channel)
- *---------------------------------------------------------------------------*/
-void
-ihfc_B_linkinit(ihfc_sc_t *sc)
-{
- u_char chan;
-
- /* make sure the hardware driver is known to layer 4 */
- ctrl_types[CTRL_PASSIVE].set_linktab = i4b_l1_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = i4b_l1_ret_linktab;
-
- for (chan = 2; chan < 6; chan++)
- {
- S_BLINK.unit = S_UNIT;
- S_BLINK.channel = chan; /* point to tx-chan */
- S_BLINK.bch_config = ihfc_B_setup;
- S_BLINK.bch_tx_start = ihfc_B_start;
- S_BLINK.bch_stat = ihfc_B_stat;
-
- /* This is a transmit channel (even) */
- S_BLINK.tx_queue = &S_IFQUEUE;
- chan++;
- /* This is a receive channel (odd) */
- S_BLINK.rx_queue = &S_IFQUEUE;
- S_BLINK.rx_mbuf = &S_MBUFDUMMY;
- }
-}
diff --git a/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c b/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c
deleted file mode 100644
index b305f90..0000000
--- a/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c
+++ /dev/null
@@ -1,445 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_ihfc_pnp.c - common hfc ISA PnP-bus interface
- * -------------------------------------------------
- * - Everything which has got anything to to with "PnP" bus setup has
- * been put here, except the chip spesific "PnP" setup.
- *
- * last edit-date: [Tue Jan 23 16:03:33 2001]
- * $Id: i4b_ihfc_pnp.c,v 1.9 2000/09/19 13:50:36 hm Exp $
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/ihfc/i4b_ihfc.h>
-#include <i4b/layer1/ihfc/i4b_ihfc_ext.h>
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <isa/isavar.h>
-
-/*---------------------------------------------------------------------------*
- * Softc
- *---------------------------------------------------------------------------*/
-ihfc_sc_t ihfc_softc[IHFC_MAXUNIT];
-
-/*---------------------------------------------------------------------------*
- * Prototypes
- *---------------------------------------------------------------------------*/
-static int ihfc_isa_probe (device_t dev);
-static int ihfc_pnp_probe (device_t dev);
-static int ihfc_pnp_attach (device_t dev);
-static int ihfc_pnp_detach (device_t dev, u_int flag);
-static int ihfc_pnp_shutdown (device_t dev);
-
-const struct ihfc_pnp_ids
-{
- u_long vid; /* vendor id */
- int flag; /* */
- u_char hfc; /* chip type */
- u_char iirq; /* internal irq */
- u_short iio; /* internal io-address */
- u_char stdel; /* S/T delay compensation */
-}
- ihfc_pnp_ids[] =
-{
- { 0x10262750, CARD_TYPEP_16_3C, HFC_S, 2, 0x200, 0x2d},
- { 0x20262750, CARD_TYPEP_16_3C, HFC_SP, 0, 0x000, 0x0f},
- { 0x1411d805, CARD_TYPEP_ACERP10, HFC_S, 1, 0x300, 0x0e},
- { 0 }
-};
-
-typedef const struct ihfc_pnp_ids ihfc_id_t;
-
-/*---------------------------------------------------------------------------*
- * PCB layout
- *
- * IIRQx: Internal IRQ cross reference for a card
- * IRQx : Supported IRQ's for a card
- * IOx : Supported IO-bases for a card
- *
- * IO0, IRQ0, IIRQ0: TELEINT ISDN SPEED No. 1
- * IIRQ3: Teles 16.3c PnP (B version)
- *---------------------------------------------------------------------------*/
- /* IRQ -> 0 1 2 3 4 5 6 7 8 9 a b c d e f */
-#define IIRQ0 ((const u_char []){ 0, 0, 0, 1, 2, 3, 0, 4, 0, 0, 5, 6, 0, 0, 0, 0 })
-#define IRQ0 ((const u_char []){ 3, 4, 5, 7, 0xa, 0xb, 0 })
-
-#define IO0 ((const u_long []){ 0x300, 0x330, 0x278, 0x2e8, 0 })
-
-#define IIRQ3 ((const u_char []){ 0, 0, 0, 7, 0, 1, 0, 0, 0, 2, 3, 4, 5, 0, 0, 6 })
-
-/*---------------------------------------------------------------------------*
- * ISA PnP setup
- *---------------------------------------------------------------------------*/
-static device_method_t ihfc_pnp_methods[] =
-{
- DEVMETHOD(device_probe, ihfc_pnp_probe),
- DEVMETHOD(device_attach, ihfc_pnp_attach),
- DEVMETHOD(device_shutdown, ihfc_pnp_shutdown),
- { 0, 0 }
-};
-
-static driver_t ihfc_pnp_driver =
-{
- "ihfc",
- ihfc_pnp_methods,
- 0,
-};
-
-static devclass_t ihfc_devclass;
-
-DRIVER_MODULE(ihfcpnp, isa, ihfc_pnp_driver, ihfc_devclass, 0, 0);
-
-/*---------------------------------------------------------------------------*
- * probe for ISA "PnP" card
- *---------------------------------------------------------------------------*/
-static int
-ihfc_pnp_probe(device_t dev)
-{
- u_int unit = device_get_unit(dev); /* get unit */
- u_int32_t vid = isa_get_vendorid(dev); /* vendor id */
- ihfc_id_t *ids = &ihfc_pnp_ids[0]; /* ids ptr */
- ihfc_sc_t *sc = &ihfc_softc[unit]; /* softc */
- u_char flag = 0; /* flag */
- void *dummy = 0; /* a dummy */
-
- HFC_VAR;
-
- if (unit >= IHFC_MAXUNIT)
- {
- printf("ihfc%d: Error, unit %d >= IHFC_MAXUNIT", unit, unit);
- return ENXIO;
- }
-
- if (!vid) return ihfc_isa_probe(dev);
-
- HFC_BEG;
-
- for ( ;(ids->vid); ids++)
- {
- if (ids->vid == vid)
- {
- flag = 0;
-
- bzero(sc, sizeof(ihfc_sc_t)); /* reset data structure.*
- * Zero is default for *
- * most, so calling the *
- * int. handler now will*
- * not be a problem. */
-
- S_IOBASE[0] = bus_alloc_resource(
- dev, SYS_RES_IOPORT, &S_IORID[0],
- 0UL, ~0UL, 2, RF_ACTIVE
- );
-
- S_IRQ = bus_alloc_resource_any(
- dev, SYS_RES_IRQ, &S_IRQRID,
- RF_ACTIVE
- );
-
- S_DLP = IHFC_DLP; /* set D-priority */
- S_HFC = ids->hfc; /* set chip type */
- S_I4BFLAG = ids->flag; /* set flag */
- S_NTMODE = IHFC_NTMODE; /* set mode */
- S_STDEL = ids->stdel; /* set delay */
-
- S_I4BUNIT = L0IHFCUNIT(unit); /* set "i4b" unit */
- S_TRACE = TRACE_OFF; /* set trace mask */
- S_UNIT = unit; /* set up unit numbers */
-
- if (S_IOBASE[0] && S_IRQ)
- {
- if (ids->iio)
- {
- S_IIO = ids->iio;
- S_IIRQ = ids->iirq;
- }
- else
- {
- S_IIO = rman_get_start(S_IOBASE[0]) & 0x3ff;
- S_IIRQ = IIRQ3[rman_get_start(S_IRQ) & 0xf];
- }
-
- /* setup interrupt routine now to avvoid stray *
- * interrupts. */
-
- if (bus_setup_intr(dev, S_IRQ, INTR_TYPE_NET,
- NULL, (void(*)(void*)) HFC_INTR, sc,
- &dummy) != 0)
- {
- printf("ihfc%d: failed to setup irq.\n",
- unit);
- HFC_END;
- return ENXIO;
- }
-
- flag = 1;
-
- if (!HFC_CONTROL(sc, 1))
- {
- HFC_END;
- return 0; /* success */
- }
- else
- {
- printf("ihfc%d: Chip seems corrupted. "
- "Please hard reboot your computer!\n",
- unit);
- }
- }
-
- ihfc_pnp_detach(dev, flag);
- }
- }
-
- HFC_END;
- return ENXIO; /* failure */
-}
-
-/*---------------------------------------------------------------------------*
- * probe for "ISA" cards
- *---------------------------------------------------------------------------*/
-static int
-ihfc_isa_probe(device_t dev)
-{
- u_int unit = device_get_unit(dev); /* get unit */
- ihfc_sc_t *sc = &ihfc_softc[unit]; /* softc */
- const u_char *irq = &IRQ0[0]; /* irq's to try */
- const u_long *iobase = &IO0[0]; /* iobases to try */
- u_char flag = 0; /* flag */
- void *dummy = 0; /* a dummy */
-
- HFC_VAR;
-
- bzero(sc, sizeof(ihfc_sc_t)); /* reset data structure *
- * We must reset the *
- * datastructure here, *
- * else we risk zero-out *
- * our gotten resources. */
- HFC_BEG;
-
- j0: while(*irq) /* get supported IRQ */
- {
- if ((S_IRQ = bus_alloc_resource(
- dev, SYS_RES_IRQ, &S_IRQRID,
- *irq, *irq, 1, RF_ACTIVE
- )
- ))
- break;
- else
- irq++;
- }
-
- while(*iobase) /* get supported IO-PORT */
- {
- if ((S_IOBASE[0] = bus_alloc_resource(
- dev, SYS_RES_IOPORT, &S_IORID[0],
- *iobase, *iobase, 2, RF_ACTIVE
- )
- ))
- break;
- else
- iobase++;
- }
-
- flag = 0;
-
- if (*irq && *iobase) /* we got our resources, now test chip */
- {
- S_DLP = IHFC_DLP; /* set D-priority */
- S_HFC = HFC_1; /* set chip type */
- S_I4BFLAG = CARD_TYPEP_TELEINT_NO_1; /* set flag */
- S_NTMODE = IHFC_NTMODE; /* set mode */
- S_STDEL = 0x00; /* set delay (not used) */
-
- S_I4BUNIT = L0IHFCUNIT(unit); /* set "i4b" unit */
- S_TRACE = TRACE_OFF; /* set trace mask */
- S_UNIT = unit; /* set up unit numbers */
-
- S_IIRQ = IIRQ0[*irq]; /* set internal irq */
- S_IIO = *iobase; /* set internal iobase */
-
- /* setup interrupt routine now to avvoid stray *
- * interrupts. */
-
- if (bus_setup_intr(dev, S_IRQ, INTR_TYPE_NET, NULL,
- (void(*)(void*)) HFC_INTR, sc, &dummy) != 0)
- {
- printf("ihfc%d: failed to setup irq.\n", unit);
- HFC_END;
- return ENXIO;
- }
-
- flag = 1;
-
- if (!HFC_CONTROL(sc, 1))
- {
- device_set_desc(dev, "TELEINT ISDN SPEED No. 1");
-
- HFC_END;
- return 0; /* success */
- }
- }
-
- ihfc_pnp_detach(dev, flag);
-
- if (*irq && *++iobase) goto j0; /* try again */
-
- HFC_END;
-
- printf("ihfc%d: Chip not found. "
- "A hard reboot may help!\n", unit);
-
- return ENXIO; /* failure */
-}
-
-/*---------------------------------------------------------------------------*
- * attach ISA "PnP" card
- *---------------------------------------------------------------------------*/
-static int
-ihfc_pnp_attach(device_t dev)
-{
- u_int unit = device_get_unit(dev); /* get unit */
- ihfc_sc_t *sc = &ihfc_softc[unit]; /* softc */
- HFC_VAR;
-
- HFC_BEG;
-
- ihfc_B_linkinit(sc); /* Setup B-Channel linktabs */
-
- i4b_l1_mph_status_ind(S_I4BUNIT, STI_ATTACH, S_I4BFLAG, &ihfc_l1mux_func);
-
- HFC_INIT(sc, 0, 0, 1); /* Setup D - Channel */
-
- HFC_INIT(sc, 2, 0, 0); /* Init B1 - Channel */
- HFC_INIT(sc, 4, 0, 0); /* Init B2 - Channel */
-
- HFC_END;
- return 0; /* success */
-
- HFC_END;
- return ENXIO; /* failure */
-}
-
-/*---------------------------------------------------------------------------*
- * shutdown for our ISA PnP card
- *---------------------------------------------------------------------------*/
-static int
-ihfc_pnp_shutdown(device_t dev)
-{
- u_int unit = device_get_unit(dev); /* get unit */
- ihfc_sc_t *sc = &ihfc_softc[unit]; /* softc */
- HFC_VAR;
-
- HFC_BEG;
-
- if (unit >= IHFC_MAXUNIT)
- {
- printf("ihfc%d: Error, unit %d >= IHFC_MAXUNIT", unit, unit);
- goto f0;
- }
-
- HFC_CONTROL(sc, 2); /* shutdown chip */
-
- HFC_END;
- return 0;
- f0:
- HFC_END;
- return ENXIO;
-
-}
-
-/*---------------------------------------------------------------------------*
- * detach for our ISA PnP card
- *
- * flag: bit[0] set: teardown interrupt handler too
- *---------------------------------------------------------------------------*/
-static int
-ihfc_pnp_detach (device_t dev, u_int flag)
-{
- u_int unit = device_get_unit(dev); /* get unit */
- ihfc_sc_t *sc = &ihfc_softc[unit]; /* softc */
- u_char i;
-
- if (unit >= IHFC_MAXUNIT)
- {
- printf("ihfc%d: Error, unit %d >= IHFC_MAXUNIT", unit, unit);
- return 0;
- }
-
- /* free interrupt resources */
-
- if(S_IRQ)
- {
- if (flag & 1)
- {
- /* tear down interrupt handler */
- bus_teardown_intr(dev, S_IRQ, (void(*)(void *))HFC_INTR);
- }
-
- /* free irq */
- bus_release_resource(dev, SYS_RES_IRQ, S_IRQRID, S_IRQ);
-
- S_IRQRID = 0;
- S_IRQ = 0;
- }
-
-
- /* free iobases */
-
- for (i = IHFC_IO_BASES; i--;)
- {
- if(S_IOBASE[i])
- {
- bus_release_resource(dev, SYS_RES_IOPORT,
- S_IORID[i], S_IOBASE[i]);
- S_IORID[i] = 0;
- S_IOBASE[i] = 0;
- }
- }
-
- return 0;
-}
diff --git a/sys/i4b/layer1/isic/i4b_asuscom_ipac.c b/sys/i4b/layer1/isic/i4b_asuscom_ipac.c
deleted file mode 100644
index 16cf383..0000000
--- a/sys/i4b/layer1/isic/i4b_asuscom_ipac.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*-
- * Copyright (c) 1999 Ari Suutari. All rights reserved.
- *
- * Copyright (c) 1997, 2001 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 Asuscom ISDNlink 128K PnP
- * =====================================================================
- *
- * This driver works with Asuscom ISDNlink 128K PnP ISA adapter,
- * which is based on Siemens IPAC chip (my card probes as ASU1690).
- * Older Asuscom ISA cards are based on different chipset
- * (containing two chips) - for those cards, one might want
- * to try the Dynalink driver.
- *
- * This driver is heavily based on ELSA Quickstep 1000pro PCI
- * driver written by Hellmuth Michaelis. Card initialization
- * code is modeled after Linux i4l driver written by Karsten
- * Keil.
- *
- * last edit-date: [Wed Jan 24 09:06:30 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined (ASUSCOM_IPAC)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_ipac.h>
-
-/* masks for register encoded in base addr */
-
-#define ASI_BASE_MASK 0x0ffff
-#define ASI_OFF_MASK 0xf0000
-
-/* register id's to be encoded in base addr */
-
-#define ASI_IDISAC 0x00000
-#define ASI_IDHSCXA 0x10000
-#define ASI_IDHSCXB 0x20000
-#define ASI_IDIPAC 0x40000
-
-/* offsets from base address */
-
-#define ASI_OFF_ALE 0x00
-#define ASI_OFF_RW 0x01
-
-/*---------------------------------------------------------------------------*
- * Asuscom ISDNlink 128K ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-static void
-asi_read_fifo(struct l1_softc *sc,int what,void *buf,size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,ASI_OFF_ALE,IPAC_ISAC_OFF);
- bus_space_read_multi_1(t,h,ASI_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,ASI_OFF_ALE,IPAC_HSCXA_OFF);
- bus_space_read_multi_1(t,h,ASI_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,ASI_OFF_ALE,IPAC_HSCXB_OFF);
- bus_space_read_multi_1(t,h,ASI_OFF_RW,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Asuscom ISDNlink 128K ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-static void
-asi_write_fifo(struct l1_softc *sc,int what,void *buf,size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,ASI_OFF_ALE,IPAC_ISAC_OFF);
- bus_space_write_multi_1(t,h,ASI_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,ASI_OFF_ALE,IPAC_HSCXA_OFF);
- bus_space_write_multi_1(t,h,ASI_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,ASI_OFF_ALE,IPAC_HSCXB_OFF);
- bus_space_write_multi_1(t,h,ASI_OFF_RW,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Asuscom ISDNlink 128K ISAC put register routine
- *---------------------------------------------------------------------------*/
-static void
-asi_write_reg(struct l1_softc *sc,int what,bus_size_t reg,u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,ASI_OFF_ALE,reg+IPAC_ISAC_OFF);
- bus_space_write_1(t,h,ASI_OFF_RW,data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,ASI_OFF_ALE,reg+IPAC_HSCXA_OFF);
- bus_space_write_1(t,h,ASI_OFF_RW,data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,ASI_OFF_ALE,reg+IPAC_HSCXB_OFF);
- bus_space_write_1(t,h,ASI_OFF_RW,data);
- break;
- case ISIC_WHAT_IPAC:
- bus_space_write_1(t,h,ASI_OFF_ALE,reg+IPAC_IPAC_OFF);
- bus_space_write_1(t,h,ASI_OFF_RW,data);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Asuscom ISDNlink 128K ISAC get register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-asi_read_reg(struct l1_softc *sc,int what,bus_size_t reg)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,ASI_OFF_ALE,reg+IPAC_ISAC_OFF);
- return bus_space_read_1(t,h,ASI_OFF_RW);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,ASI_OFF_ALE,reg+IPAC_HSCXA_OFF);
- return bus_space_read_1(t,h,ASI_OFF_RW);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,ASI_OFF_ALE,reg+IPAC_HSCXB_OFF);
- return bus_space_read_1(t,h,ASI_OFF_RW);
- case ISIC_WHAT_IPAC:
- bus_space_write_1(t,h,ASI_OFF_ALE,reg+IPAC_IPAC_OFF);
- return bus_space_read_1(t,h,ASI_OFF_RW);
- default:
- return 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_siemens_isurf - attach for Asuscom ISDNlink 128K
- *---------------------------------------------------------------------------*/
-int
-isic_attach_asi(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = asi_read_reg;
- sc->writereg = asi_write_reg;
-
- sc->readfifo = asi_read_fifo;
- sc->writefifo = asi_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_ASUSCOMIPAC;
-
- /* 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 */
-/*
- * This has been taken from Linux driver.
- * (Removed initialization that was not applicaple to
- * this board or was already register default setting.)
- */
- IPAC_WRITE (IPAC_ACFG, 0xff); /* Setup AUX pin modes */
- IPAC_WRITE (IPAC_AOE, 0x0); /* Setup AUX pin modes */
- IPAC_WRITE (IPAC_MASK, (IPAC_MASK_INT1 | IPAC_MASK_INT0));
-
- return(0);
-}
-#endif /* defined (ASUSCOM_IPAC) */
diff --git a/sys/i4b/layer1/isic/i4b_avm_a1.c b/sys/i4b/layer1/isic/i4b_avm_a1.c
deleted file mode 100644
index e9b0416..0000000
--- a/sys/i4b/layer1/isic/i4b_avm_a1.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/*-
- * Copyright (c) 1996 Andrew Gordon. All rights reserved.
- *
- * Copyright (c) 1997, 2001 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
- * ------------------------------------------------------------
- * last edit-date: [Wed Jan 24 09:25:23 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(AVM_A1)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-/*---------------------------------------------------------------------------*
- * 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 */
-
-#define AVM_ISAC_R_OFFS (0x1400-0x20)
-#define AVM_HSCXA_R_OFFS (0x400-0x20)
-#define AVM_HSCXB_R_OFFS (0xc00-0x20)
-#define AVM_ISAC_F_OFFS (0x1400-0x20-0x3e0)
-#define AVM_HSCXA_F_OFFS (0x400-0x20-0x3e0)
-#define AVM_HSCXB_F_OFFS (0xc00-0x20-0x3e0)
-
-/*---------------------------------------------------------------------------*
- * AVM read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-avma1_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+4]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+4]);
- bus_space_read_multi_1(t, h, 0, buf, size);
-}
-
-/*---------------------------------------------------------------------------*
- * AVM write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-avma1_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+4]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+4]);
- bus_space_write_multi_1(t, h, 0, (u_int8_t*)buf, size);
-}
-
-/*---------------------------------------------------------------------------*
- * AVM write register routine
- *---------------------------------------------------------------------------*/
-static void
-avma1_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- bus_space_write_1(t, h, offs, data);
-}
-
-/*---------------------------------------------------------------------------*
- * AVM read register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-avma1_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- return bus_space_read_1(t, h, offs);
-}
-
-/*---------------------------------------------------------------------------*
- * allocate an io port
- *---------------------------------------------------------------------------*/
-static int
-isic_alloc_port(device_t dev, int rid, u_int base, u_int len)
-{
- size_t unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
-
- sc->sc_resources.io_rid[rid] = rid;
-
- bus_set_resource(dev, SYS_RES_IOPORT, rid, base, len);
-
- if(!(sc->sc_resources.io_base[rid] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[rid],
- RF_ACTIVE)))
- {
- printf("isic%d: Error, failed to reserve io #%d!\n", unit, rid);
- isic_detach_common(dev);
- return(ENXIO);
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_avma1 - probe for AVM A1 and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_probe_avma1(device_t dev)
-{
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = 0; /* pointer to softc */
- void *ih = 0; /* dummy */
- bus_space_tag_t t; /* bus things */
- bus_space_handle_t h;
- u_char savebyte;
- u_char byte;
-
- /* check max unit range */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for AVM A1/Fritz!\n",
- unit, unit);
- return(ENXIO);
- }
-
- sc = &l1_sc[unit]; /* get pointer to softc */
- sc->sc_unit = unit; /* set unit */
-
- /* see if an io base was supplied */
-
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get iobase for AVM A1/Fritz!\n",
- unit);
- return(ENXIO);
- }
-
- /* set io base */
-
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
-
- /* release io base */
-
- bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
-
- switch(sc->sc_port)
- {
- case 0x200:
- case 0x240:
- case 0x300:
- case 0x340:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for AVM A1/Fritz!\n",
- unit, sc->sc_port);
- return(ENXIO);
- break;
- }
-
- if(isic_alloc_port(dev, 0, sc->sc_port+AVM_CONF_REG, 0x20))
- return(ENXIO);
-
- if(isic_alloc_port(dev, 1, sc->sc_port+AVM_ISAC_R_OFFS, 0x20))
- return(ENXIO);
-
- if(isic_alloc_port(dev, 2, sc->sc_port+AVM_HSCXA_R_OFFS, 0x20))
- return(ENXIO);
-
- if(isic_alloc_port(dev, 3, sc->sc_port+AVM_HSCXB_R_OFFS, 0x20))
- return(ENXIO);
-
- if(isic_alloc_port(dev, 4, sc->sc_port+AVM_ISAC_F_OFFS, 0x20))
- return(ENXIO);
-
- if(isic_alloc_port(dev, 5, sc->sc_port+AVM_HSCXA_F_OFFS, 0x20))
- return(ENXIO);
-
- if(isic_alloc_port(dev, 6, sc->sc_port+AVM_HSCXB_F_OFFS, 0x20))
- return(ENXIO);
-
- /* get our irq */
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid, RF_ACTIVE)))
- {
- printf("isic%d: Could not get an irq for AVM A1/Fritz!\n",unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* get the irq number */
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
- /* register interrupt routine */
- if (bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, NULL,
- (void(*)(void *))(isicintr), sc, &ih) != 0)
- {
- printf("isic%d: Could not setup the irq for AVM A1/Fritz!\n",unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* check IRQ validity */
-
- switch(sc->sc_irq)
- {
- 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",
- unit, sc->sc_irq);
- isic_detach_common(dev);
- return(ENXIO);
- break;
- }
-
- 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;
-
- /*
- * 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",
- unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- unit, HSCX_READ(1, H_VSTR));
- return(ENXIO);
- }
-
- /* 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 .....
- */
-
- t = rman_get_bustag(sc->sc_resources.io_base[0]);
- h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- savebyte = bus_space_read_1(t, h, 0);
-
- /* write low to test bit */
-
- bus_space_write_1(t, h, 0, 0x00);
-
- /* test bit and next higher and lower bit must be 0 */
-
- if((byte = bus_space_read_1(t, h, 0) & 0x38) != 0x00)
- {
- printf("isic%d: Error, probe-1 failed, 0x%02x should be 0x00 for AVM A1/Fritz!\n",
- unit, byte);
- bus_space_write_1(t, h, 0, savebyte);
- return(ENXIO);
- }
-
- /* write high to test bit */
-
- bus_space_write_1(t, h, 0, 0x10);
-
- /* test bit must be high, next higher and lower bit must be 0 */
-
- if((byte = bus_space_read_1(t, h, 0) & 0x38) != 0x10)
- {
- printf("isic%d: Error, probe-2 failed, 0x%02x should be 0x10 for AVM A1/Fritz!\n",
- unit, byte);
- bus_space_write_1(t, h, 0, savebyte);
- return(ENXIO);
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_avma1 - attach AVM A1 and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_attach_avma1(device_t dev)
-{
- size_t unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- /* reset ISAC/HSCX */
-
- 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(0);
-}
-
-#endif /* defined(AVM_A1) */
diff --git a/sys/i4b/layer1/isic/i4b_bchan.c b/sys/i4b/layer1/isic/i4b_bchan.c
deleted file mode 100644
index 5dbffca..0000000
--- a/sys/i4b/layer1/isic/i4b_bchan.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ----------------------------------------------
- * last edit-date: [Sat Mar 9 16:00:56 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-static void isic_bchannel_start(int unit, int h_chan);
-static void isic_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp);
-
-/*---------------------------------------------------------------------------*
- * 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)
-{
- struct l1_softc *sc = &l1_sc[unit];
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
-
- int s = SPLI4B();
-
- if(activate == 0)
- {
- /* deactivation */
- isic_hscx_init(sc, h_chan, activate);
- }
-
- NDBGL1(L1_BCHAN, "unit=%d, channel=%d, %s",
- 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 */
-
- chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_isic_rx", NULL, MTX_DEF);
-
- i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
-
- 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 */
-
- chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
-
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_isic_tx", NULL, MTX_DEF);
-
- i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
-
- 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)
-{
- struct l1_softc *sc = &l1_sc[unit];
- register l1_bchan_state_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(!(i4b_l1_bchan_tel_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 = L0ISICUNIT(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);
- i4b_l1_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 = L0ISICUNIT(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);
- i4b_l1_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->isic_drvr_linktab->bch_activity)(chan->isic_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)
-{
- struct l1_softc *sc = &l1_sc[unit];
- l1_bchan_state_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
- *---------------------------------------------------------------------------*/
-isdn_link_t *
-isic_ret_linktab(int unit, int channel)
-{
- struct l1_softc *sc = &l1_sc[unit];
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- return(&chan->isic_isdn_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * set the driver linktab in the b channel softc
- *---------------------------------------------------------------------------*/
-void
-isic_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
- struct l1_softc *sc = &l1_sc[unit];
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- chan->isic_drvr_linktab = dlt;
-}
-
-/*---------------------------------------------------------------------------*
- * initialize our local linktab
- *---------------------------------------------------------------------------*/
-void
-isic_init_linktab(struct l1_softc *sc)
-{
- l1_bchan_state_t *chan = &sc->sc_chan[HSCX_CH_A];
- isdn_link_t *lt = &chan->isic_isdn_linktab;
-
- /* make sure the hardware driver is known to layer 4 */
- ctrl_types[CTRL_PASSIVE].set_linktab = i4b_l1_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = i4b_l1_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->isic_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;
-}
diff --git a/sys/i4b/layer1/isic/i4b_ctx_s0P.c b/sys/i4b/layer1/isic/i4b_ctx_s0P.c
deleted file mode 100644
index afa665d..0000000
--- a/sys/i4b/layer1/isic/i4b_ctx_s0P.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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/Teles PnP
- * ============================================================
- * last edit-date: [Wed Jan 24 09:07:22 2001]
- *
- * Note: this driver works for the Creatix ISDN S0-16 P+P and
- * for the Teles S0/16.3 PnP card. Although they are not
- * the same hardware and don't share the same PnP config
- * information, once the base addresses are set, the
- * offsets are same and therefore they can use the same
- * driver.
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if (defined(CRTX_S0_P) || defined(TEL_S0_16_3_P) || defined(COMPAQ_M610))
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-/*---------------------------------------------------------------------------*
- * Creatix / Teles PnP ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-static void
-ctxs0P_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+2]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+2]);
- bus_space_read_multi_1(t,h,0x3e,buf,size);
-}
-
-/*---------------------------------------------------------------------------*
- * Creatix / Teles PnP ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-static void
-ctxs0P_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+2]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+2]);
- bus_space_write_multi_1(t,h,0x3e,buf,size);
-}
-
-/*---------------------------------------------------------------------------*
- * Creatix / Teles PnP ISAC put register routine
- *---------------------------------------------------------------------------*/
-static void
-ctxs0P_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+2]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+2]);
- bus_space_write_1(t,h,offs,data);
-}
-
-/*---------------------------------------------------------------------------*
- * Creatix / Teles PnP ISAC get register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-ctxs0P_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+2]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+2]);
- return bus_space_read_1(t,h,offs);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_Cs0P - attach Creatix / Teles PnP
- *---------------------------------------------------------------------------*/
-int
-isic_attach_Cs0P(device_t dev)
-{
- u_int32_t iobase1;
- u_int32_t iobase2;
- u_int32_t iocfg = 0; /* quiet bogus gcc warning */
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
- bus_space_tag_t t;
- bus_space_handle_t h;
-
- /*
- * this card needs a second io_base,
- * free resources if we don't get it
- */
-
- sc->sc_resources.io_rid[1] = 1;
-
- if(!(sc->sc_resources.io_base[1] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[1],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get io area 1 for Creatix / Teles PnP!\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /*
- * Compaq M610 has a cfg io area,
- * we need it
- */
-
- if (sc->sc_cardtyp == CARD_TYPEP_COMPAQ_M610)
- {
- sc->sc_resources.io_rid[2] = 2;
-
- if(!(sc->sc_resources.io_base[2] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[2],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get cfg io area for Compaq Microcom 610\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- iocfg = rman_get_start(sc->sc_resources.io_base[2]);
-
- bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[2],
- sc->sc_resources.io_base[2]);
- }
-
- /* remember the io base addresses */
-
- if (sc->sc_cardtyp != CARD_TYPEP_COMPAQ_M610)
- {
- iobase1 = rman_get_start(sc->sc_resources.io_base[0]);
- iobase2 = rman_get_start(sc->sc_resources.io_base[1]);
- }
- else
- {
- iobase1 = rman_get_start(sc->sc_resources.io_base[1]);
- iobase2 = rman_get_start(sc->sc_resources.io_base[0]);
- }
-
- /*
- * because overlapping resources are invalid,
- * release the first and second io port resource
- */
-
- bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
-
- bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[1],
- sc->sc_resources.io_base[1]);
-
- /* set and allocate a base io address for the ISAC chip */
-
- sc->sc_resources.io_rid[2] = 2;
-
- bus_set_resource(dev, SYS_RES_IOPORT, 2, iobase1-0x20, 0x40);
-
- if(!(sc->sc_resources.io_base[2] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[2],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get io area 2 for Creatix / Teles PnP!\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
-
- /* set and allocate a resource for the HSCX channel A */
-
- sc->sc_resources.io_rid[3] = 3;
-
-/*XXX*/ /* FIXME !!!!
- * the width of the resource is too small, there are accesses
- * to it with an offset of 0x3e into the next resource. anyway,
- * it seems to work and i have no idea how to do 2 resources
- * overlapping each other.
- */
-
-#if 0
- bus_set_resource(dev, SYS_RES_IOPORT, 3, iobase2-0x20, 0x20);
-#else
- bus_set_resource(dev, SYS_RES_IOPORT, 3, iobase2-0x20, 0x10);
-#endif
-
- if(!(sc->sc_resources.io_base[3] =
- bus_alloc_resource_any(dev,SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[3],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get io area 3 for Creatix / Teles PnP!\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* set and allocate a resources for the HSCX channel B */
-
- sc->sc_resources.io_rid[4] = 4;
-
- bus_set_resource(dev, SYS_RES_IOPORT, 4, iobase2, 0x40);
-
- if(!(sc->sc_resources.io_base[4] =
- bus_alloc_resource_any(dev,SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[4],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get io area 4 for Creatix / Teles PnP!\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /*
- * set and allocate a resource for the cfg io
- * for compaq m610
- */
-
- if (sc->sc_cardtyp == CARD_TYPEP_COMPAQ_M610)
- {
- sc->sc_resources.io_rid[5] = 5;
-
- bus_set_resource(dev, SYS_RES_IOPORT, 5, iocfg, 0x01);
-
- if(!(sc->sc_resources.io_base[5] =
- bus_alloc_resource_any(dev,SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[5],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get cfg io area for Compaq Microcom 610!\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
- }
-
- /* 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 */
-
- if (sc->sc_cardtyp != CARD_TYPEP_COMPAQ_M610)
- 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;
-
- /* enable the card */
-
- if (sc->sc_cardtyp != CARD_TYPEP_COMPAQ_M610)
- {
- t = rman_get_bustag(sc->sc_resources.io_base[2]);
- h = rman_get_bushandle(sc->sc_resources.io_base[2]);
-
- bus_space_write_1(t, h, 0x3c, 0);
- DELAY(SEC_DELAY / 10);
-
- bus_space_write_1(t, h, 0x3c, 1);
- DELAY(SEC_DELAY / 10);
- }
- else
- {
- t = rman_get_bustag(sc->sc_resources.io_base[5]);
- h = rman_get_bushandle(sc->sc_resources.io_base[5]);
-
- bus_space_write_1(t, h, 0xff, 0);
- DELAY(SEC_DELAY / 10);
-
- bus_space_write_1(t, h, 0x00, 1);
- DELAY(SEC_DELAY / 10);
- }
-
- return 0;
-}
-
-#endif /* (defined(CRTX_S0_P) || defined(TEL_S0_16_3_P) || defined(COMPAQ_M610)) */
-
diff --git a/sys/i4b/layer1/isic/i4b_diva.c b/sys/i4b/layer1/isic/i4b_diva.c
deleted file mode 100644
index c189f1c..0000000
--- a/sys/i4b/layer1/isic/i4b_diva.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*-
- * Copyright (c) 2001 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.
- */
-
-/*---------------------------------------------------------------------------
- *
- * Eicon Diehl DIVA 2.0 or 2.02 (ISA PnP) support for isic driver
- * --------------------------------------------------------------
- * last edit-date: [Fri Jan 26 13:57:10 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined EICON_DIVA
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_ipac.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-/* offsets from base address */
-
-#define DIVA_IPAC_OFF_ALE 0x00
-#define DIVA_IPAC_OFF_RW 0x01
-
-#define DIVA_ISAC_OFF_RW 0x02
-#define DIVA_ISAC_OFF_ALE 0x06
-
-#define DIVA_HSCX_OFF_RW 0x00
-#define DIVA_HSCX_OFF_ALE 0x04
-
-#define DIVA_CTRL_OFF 0x07
-#define DIVA_CTRL_RDIST 0x01
-#define DIVA_CTRL_WRRST 0x08
-#define DIVA_CTRL_WRLDA 0x20
-#define DIVA_CTRL_WRLDB 0x40
-#define DIVA_CTRL_WRICL 0x80
-
-/* HSCX channel base offsets */
-
-#define DIVA_HSCXA 0x00
-#define DIVA_HSCXB 0x40
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.02
- *---------------------------------------------------------------------------*/
-static void
-diva_ipac_read_fifo(struct l1_softc *sc,int what,void *buf,size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,IPAC_ISAC_OFF);
- bus_space_read_multi_1(t,h,DIVA_IPAC_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,IPAC_HSCXA_OFF);
- bus_space_read_multi_1(t,h,DIVA_IPAC_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,IPAC_HSCXB_OFF);
- bus_space_read_multi_1(t,h,DIVA_IPAC_OFF_RW,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.02
- *---------------------------------------------------------------------------*/
-static void
-diva_ipac_write_fifo(struct l1_softc *sc,int what,void *buf,size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,IPAC_ISAC_OFF);
- bus_space_write_multi_1(t,h,DIVA_IPAC_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,IPAC_HSCXA_OFF);
- bus_space_write_multi_1(t,h,DIVA_IPAC_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,IPAC_HSCXB_OFF);
- bus_space_write_multi_1(t,h,DIVA_IPAC_OFF_RW,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.02
- *---------------------------------------------------------------------------*/
-static void
-diva_ipac_write_reg(struct l1_softc *sc,int what,bus_size_t reg,u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,reg+IPAC_ISAC_OFF);
- bus_space_write_1(t,h,DIVA_IPAC_OFF_RW,data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,reg+IPAC_HSCXA_OFF);
- bus_space_write_1(t,h,DIVA_IPAC_OFF_RW,data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,reg+IPAC_HSCXB_OFF);
- bus_space_write_1(t,h,DIVA_IPAC_OFF_RW,data);
- break;
- case ISIC_WHAT_IPAC:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,reg+IPAC_IPAC_OFF);
- bus_space_write_1(t,h,DIVA_IPAC_OFF_RW,data);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.02
- *---------------------------------------------------------------------------*/
-static u_int8_t
-diva_ipac_read_reg(struct l1_softc *sc,int what,bus_size_t reg)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,reg+IPAC_ISAC_OFF);
- return bus_space_read_1(t,h,DIVA_IPAC_OFF_RW);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,reg+IPAC_HSCXA_OFF);
- return bus_space_read_1(t,h,DIVA_IPAC_OFF_RW);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,reg+IPAC_HSCXB_OFF);
- return bus_space_read_1(t,h,DIVA_IPAC_OFF_RW);
- case ISIC_WHAT_IPAC:
- bus_space_write_1(t,h,DIVA_IPAC_OFF_ALE,reg+IPAC_IPAC_OFF);
- return bus_space_read_1(t,h,DIVA_IPAC_OFF_RW);
- default:
- return 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.02
- *---------------------------------------------------------------------------*/
-int
-isic_attach_diva_ipac(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = diva_ipac_read_reg;
- sc->writereg = diva_ipac_write_reg;
-
- sc->readfifo = diva_ipac_read_fifo;
- sc->writefifo = diva_ipac_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_DIVA_ISA;
-
- /* 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 */
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.0
- *---------------------------------------------------------------------------*/
-static void
-diva_read_fifo(struct l1_softc *sc,int what,void *buf,size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch(what)
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,DIVA_ISAC_OFF_ALE,0);
- bus_space_read_multi_1(t,h,DIVA_ISAC_OFF_RW,buf,size);
- break;
-
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,DIVA_HSCX_OFF_ALE,DIVA_HSCXA);
- bus_space_read_multi_1(t,h,DIVA_HSCX_OFF_RW,buf,size);
- break;
-
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,DIVA_HSCX_OFF_ALE,DIVA_HSCXB);
- bus_space_read_multi_1(t,h,DIVA_HSCX_OFF_RW,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.0
- *---------------------------------------------------------------------------*/
-static void
-diva_write_fifo(struct l1_softc *sc,int what,void *buf,size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch(what)
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,DIVA_ISAC_OFF_ALE,0);
- bus_space_write_multi_1(t,h,DIVA_ISAC_OFF_RW,buf,size);
- break;
-
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,DIVA_HSCX_OFF_ALE,DIVA_HSCXA);
- bus_space_write_multi_1(t,h,DIVA_HSCX_OFF_RW,buf,size);
- break;
-
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,DIVA_HSCX_OFF_ALE,DIVA_HSCXB);
- bus_space_write_multi_1(t,h,DIVA_HSCX_OFF_RW,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.0
- *---------------------------------------------------------------------------*/
-static void
-diva_write_reg(struct l1_softc *sc,int what,bus_size_t reg,u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch(what)
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,DIVA_ISAC_OFF_ALE,reg);
- bus_space_write_1(t,h,DIVA_ISAC_OFF_RW,data);
- break;
-
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,DIVA_HSCX_OFF_ALE,reg+DIVA_HSCXA);
- bus_space_write_1(t,h,DIVA_HSCX_OFF_RW,data);
- break;
-
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,DIVA_HSCX_OFF_ALE,reg+DIVA_HSCXB);
- bus_space_write_1(t,h,DIVA_HSCX_OFF_RW,data);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.0
- *---------------------------------------------------------------------------*/
-static u_int8_t
-diva_read_reg(struct l1_softc *sc,int what,bus_size_t reg)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch(what)
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,DIVA_ISAC_OFF_ALE,reg);
- return bus_space_read_1(t,h,DIVA_ISAC_OFF_RW);
-
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,DIVA_HSCX_OFF_ALE,reg+DIVA_HSCXA);
- return bus_space_read_1(t,h,DIVA_HSCX_OFF_RW);
-
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,DIVA_HSCX_OFF_ALE,reg+DIVA_HSCXB);
- return bus_space_read_1(t,h,DIVA_HSCX_OFF_RW);
-
- default:
- return 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Eicon Diehl DIVA 2.0
- *---------------------------------------------------------------------------*/
-int
-isic_attach_diva(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = diva_read_reg;
- sc->writereg = diva_write_reg;
-
- sc->readfifo = diva_read_fifo;
- sc->writefifo = diva_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_DIVA_ISA;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* setup chip type = ISAC/HSCX */
-
- 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("isic%d: HSCX VSTR test failed for Eicon DIVA 2.0\n",
- sc->sc_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- sc->sc_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- sc->sc_unit, HSCX_READ(1, H_VSTR));
- return ENXIO;
- }
- /* reset on */
- bus_space_write_1(t,h,DIVA_CTRL_OFF,0);
- DELAY(100);
- /* reset off */
- bus_space_write_1(t,h,DIVA_CTRL_OFF,DIVA_CTRL_WRRST);
- return(0);
-}
-
-#endif /* defined EICON_DIVA */
diff --git a/sys/i4b/layer1/isic/i4b_drn_ngo.c b/sys/i4b/layer1/isic/i4b_drn_ngo.c
deleted file mode 100644
index 8a1764c..0000000
--- a/sys/i4b/layer1/isic/i4b_drn_ngo.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * --------------------------------------------------------
- * last edit-date: [Wed Jan 24 09:07:44 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(DRN_NGO)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/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 */
-
-#define ISAC_DATA 0
-#define HSCX_DATA 1
-
-#define ISAC_ADDR 0
-#define HSCX_ADDR 1
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t tdata, tadr;
- bus_space_handle_t hdata, hadr;
-
- tdata = rman_get_bustag(sc->sc_resources.io_base[0]);
- hdata = rman_get_bushandle(sc->sc_resources.io_base[0]);
- tadr = rman_get_bustag(sc->sc_resources.io_base[1]);
- hadr = rman_get_bushandle(sc->sc_resources.io_base[1]);
-
- switch(what)
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1 (tadr ,hadr, ISAC_ADDR,0x0);
- bus_space_read_multi_1(tdata,hdata,ISAC_DATA,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1 (tadr ,hadr ,HSCX_ADDR,0x0);
- bus_space_read_multi_1(tdata,hdata,HSCX_DATA,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1 (tadr ,hadr ,HSCX_ADDR,HSCX_BOFF);
- bus_space_read_multi_1(tdata,hdata,HSCX_DATA,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t tdata, tadr;
- bus_space_handle_t hdata, hadr;
-
- tdata = rman_get_bustag(sc->sc_resources.io_base[0]);
- hdata = rman_get_bushandle(sc->sc_resources.io_base[0]);
- tadr = rman_get_bustag(sc->sc_resources.io_base[1]);
- hadr = rman_get_bushandle(sc->sc_resources.io_base[1]);
-
- switch(what)
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1 (tadr ,hadr, ISAC_ADDR,0x0);
- bus_space_write_multi_1(tdata,hdata,ISAC_DATA,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1 (tadr ,hadr ,HSCX_ADDR,0x0);
- bus_space_write_multi_1(tdata,hdata,HSCX_DATA,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1 (tadr ,hadr ,HSCX_ADDR,HSCX_BOFF);
- bus_space_write_multi_1(tdata,hdata,HSCX_DATA,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ write register routine
- *---------------------------------------------------------------------------*/
-static void
-drnngo_write_reg(struct l1_softc *sc, int what, bus_size_t reg, u_int8_t data)
-{
- bus_space_tag_t tdata, tadr;
- bus_space_handle_t hdata, hadr;
-
- tdata = rman_get_bustag(sc->sc_resources.io_base[0]);
- hdata = rman_get_bushandle(sc->sc_resources.io_base[0]);
- tadr = rman_get_bustag(sc->sc_resources.io_base[1]);
- hadr = rman_get_bushandle(sc->sc_resources.io_base[1]);
-
- switch(what)
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(tadr ,hadr, ISAC_ADDR,reg);
- bus_space_write_1(tdata,hdata,ISAC_DATA,data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(tadr ,hadr ,HSCX_ADDR,reg);
- bus_space_write_1(tdata,hdata,HSCX_DATA,data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(tadr ,hadr ,HSCX_ADDR,reg+HSCX_BOFF);
- bus_space_write_1(tdata,hdata,HSCX_DATA,data);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Dr. Neuhaus Niccy GO@ read register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-drnngo_read_reg(struct l1_softc *sc, int what, bus_size_t reg)
-{
- bus_space_tag_t tdata, tadr;
- bus_space_handle_t hdata, hadr;
-
- tdata = rman_get_bustag(sc->sc_resources.io_base[0]);
- hdata = rman_get_bushandle(sc->sc_resources.io_base[0]);
- tadr = rman_get_bustag(sc->sc_resources.io_base[1]);
- hadr = rman_get_bushandle(sc->sc_resources.io_base[1]);
-
- switch(what)
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(tadr ,hadr, ISAC_ADDR,reg);
- return bus_space_read_1(tdata,hdata,ISAC_DATA);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(tadr ,hadr ,HSCX_ADDR,reg);
- return bus_space_read_1(tdata,hdata,HSCX_DATA);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(tadr ,hadr ,HSCX_ADDR,reg+HSCX_BOFF);
- return bus_space_read_1(tdata,hdata,HSCX_DATA);
- default:
- return 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * probe for ISA PnP cards
- *---------------------------------------------------------------------------*/
-int
-isic_attach_drnngo(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
-
- sc->sc_resources.io_rid[1] = 1;
-
- /*
- * this card needs a second io_base,
- * free resources if we don't get it
- */
-
- if(!(sc->sc_resources.io_base[1] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[1],
- RF_ACTIVE)))
- {
- printf("isic%d: Failed to get second io base.\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* 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;
-
- return (0);
-}
-
-#endif /* defined(DRN_NGO) */
diff --git a/sys/i4b/layer1/isic/i4b_dynalink.c b/sys/i4b/layer1/isic/i4b_dynalink.c
deleted file mode 100644
index 798e875..0000000
--- a/sys/i4b/layer1/isic/i4b_dynalink.c
+++ /dev/null
@@ -1,233 +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
- * ==================================================
- * last edit-date: [Wed Jan 24 09:08:03 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/* 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.
-*/
-
-#include "opt_i4b.h"
-
-#if defined(DYNALINK)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-/* 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
-
-/* LOW-LEVEL DEVICE ACCESS
-*/
-
-static void
-dynalink_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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;
- }
-}
-
-static void
-dynalink_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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;
- }
-}
-
-static void
-dynalink_write_reg(struct l1_softc *sc, int what, bus_size_t reg, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, reg);
- bus_space_write_1(t, h, ISAC, data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA+reg);
- bus_space_write_1(t, h, HSCX, data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB+reg);
- bus_space_write_1(t, h, HSCX, data);
- break;
- }
-}
-
-static u_int8_t
-dynalink_read_reg(struct l1_softc *sc, int what, bus_size_t reg)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch (what) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t, h, ADDR, reg);
- return bus_space_read_1(t, h, ISAC);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t, h, ADDR, HSCXA+reg);
- return bus_space_read_1(t, h, HSCX);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t, h, ADDR, HSCXB+reg);
- return bus_space_read_1(t, h, HSCX);
- }
- return 0;
-}
-
-/* attach callback routine */
-int
-isic_attach_Dyn(device_t dev)
-{
- int unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = &l1_sc[unit]; /* pointer to softc */
-
- struct i4b_info * info = &(sc->sc_resources);
- bus_space_tag_t t = rman_get_bustag(info->io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(info->io_base[0]);
-
- /* fill in l1_softc structure */
- sc->readreg = dynalink_read_reg;
- sc->writereg = dynalink_write_reg;
- sc->readfifo = dynalink_read_fifo;
- sc->writefifo = dynalink_write_fifo;
- sc->clearirq = NULL;
- sc->sc_cardtyp = CARD_TYPEP_DYNALINK;
- 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("isic%d: HSCX VSTR test failed for Dynalink\n",
- sc->sc_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- sc->sc_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- sc->sc_unit, HSCX_READ(1, H_VSTR));
- return ENXIO;
- }
-
- /* reset card */
- bus_space_write_1(t,h,ADDR,RESET);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t,h,ADDR,0);
- DELAY(SEC_DELAY / 10);
-
- return 0;
-}
-
-#endif /* defined(DYNALINK) */
diff --git a/sys/i4b/layer1/isic/i4b_elsa_pcc16.c b/sys/i4b/layer1/isic/i4b_elsa_pcc16.c
deleted file mode 100644
index 359d239..0000000
--- a/sys/i4b/layer1/isic/i4b_elsa_pcc16.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/*-
- * Copyright (c) 1999, 2001 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 driver for ELSA MicroLink ISDN/PCC-16 and ELSA PCFpro
- * ================================================================
- * last edit-date: [Sun Oct 21 09:42:17 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(ELSA_PCC16)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-static void i4b_epcc16_clrirq(struct l1_softc *sc);
-
-/* 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 MicroLink ISDN/PCC-16 clear IRQ routine
- *---------------------------------------------------------------------------*/
-static void
-i4b_epcc16_clrirq(struct l1_softc *sc)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_write_1(t, h, ELSA_OFF_IRQ, 0);
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA MicroLink ISDN/PCC-16 ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-static void
-epcc16_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA MicroLink ISDN/PCC-16 ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-static void
-epcc16_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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, 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, 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, buf, size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA MicroLink ISDN/PCC-16 ISAC put register routine
- *---------------------------------------------------------------------------*/
-static void
-epcc16_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA MicroLink ISDN/PCC-16 ISAC get register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-epcc16_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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;
-}
-
-/*---------------------------------------------------------------------------*
- * isic_detach_Epcc16 - detach for ELSA MicroLink ISDN/PCC-16
- *---------------------------------------------------------------------------*/
-static void
-isic_detach_Epcc16(device_t dev)
-{
- struct l1_softc *sc = &l1_sc[device_get_unit(dev)];
-
- if ( sc->sc_resources.irq )
- {
- bus_teardown_intr(dev,sc->sc_resources.irq,
- (void(*)(void *))isicintr);
- bus_release_resource(dev,SYS_RES_IRQ,
- sc->sc_resources.irq_rid,
- sc->sc_resources.irq);
- sc->sc_resources.irq = 0;
- }
-
- if ( sc->sc_resources.io_base[0] ) {
- bus_release_resource(dev,SYS_RES_IOPORT,
- sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
- sc->sc_resources.io_base[0] = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_Epcc16 - probe for ELSA MicroLink ISDN/PCC-16
- *---------------------------------------------------------------------------*/
-int
-isic_probe_Epcc16(device_t dev)
-{
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = 0; /* pointer to softc */
- void *ih = 0; /* dummy */
-
- /* check max unit range */
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for ELSA PCC-16!\n",
- unit, unit);
- return(ENXIO);
- }
-
- sc = &l1_sc[unit]; /* get pointer to softc */
- sc->sc_unit = unit; /* set unit */
-
- /* see if an io base was supplied */
-
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get iobase for ELSA PCC-16.\n",
- unit);
- return(ENXIO);
- }
-
- /* check if we got an iobase */
-
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
-
- switch(sc->sc_port)
- {
- case 0x160:
- case 0x170:
- case 0x260:
- case 0x360:
- break;
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for ELSA MicroLink ISDN/PCC-16!\n",
- unit, sc->sc_port);
- isic_detach_Epcc16(dev);
- return(ENXIO);
- break;
- }
-
- /* setup access routines */
-
- sc->clearirq = i4b_epcc16_clrirq;
- sc->readreg = epcc16_read_reg;
- sc->writereg = epcc16_write_reg;
-
- sc->readfifo = epcc16_read_fifo;
- sc->writefifo = epcc16_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_PCC16;
-
- /* 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 ELSA PCC-16
- * 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) )
- {
- /* patch from "Doobee R . Tzeck" <drt@ailis.de>:
- * I own an ELSA PCFpro. To my knowledge, the ELSA PCC16 is
- * a stripped down Version on the PCFpro. By patching the
- * card detection routine for the PPC16 I was able to use
- * the PPC16 driver for the PCFpro.
- */
- if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x85) ||
- ((HSCX_READ(1, H_VSTR) & 0xf) != 0x85) )
- {
- printf("isic%d: HSCX VSTR test failed for ELSA MicroLink ISDN/PCC-16\n",
- unit);
- isic_detach_Epcc16(dev);
- printf("isic%d: HSC0: VSTR: %#x\n",
- unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- unit, HSCX_READ(1, H_VSTR));
- return (ENXIO);
- }
- else
- {
- printf("isic%d: ELSA MicroLink ISDN/PCFpro found, going to tread it as PCC-16\n",
- unit);
- }
- }
-
- /* get our irq */
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get an irq.\n",unit);
- isic_detach_Epcc16(dev);
- return ENXIO;
- }
-
- /* get the irq number */
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
- /* check IRQ validity */
- switch(sc->sc_irq)
- {
- case 2:
- case 9:
- case 3:
- case 5:
- case 10:
- case 11:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for ELSA MicroLink ISDN/PCC-16!\n",
- unit, sc->sc_irq);
- isic_detach_Epcc16(dev);
- return(ENXIO);
- break;
- }
-
- /* register interrupt routine */
- bus_setup_intr(dev,sc->sc_resources.irq,INTR_TYPE_NET,
- NULL, (void(*)(void *))(isicintr),
- sc,&ih);
-
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_Epcc16 - attach for ELSA MicroLink ISDN/PCC-16
- *---------------------------------------------------------------------------*/
-int
-isic_attach_Epcc16(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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);
-
- return 0;
-}
-
-#endif /* defined(ELSA_PCC16) */
diff --git a/sys/i4b/layer1/isic/i4b_elsa_qs1i.c b/sys/i4b/layer1/isic/i4b_elsa_qs1i.c
deleted file mode 100644
index d17cdfd..0000000
--- a/sys/i4b/layer1/isic/i4b_elsa_qs1i.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * =====================================================================
- * last edit-date: [Wed Jan 24 09:09:03 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(ELSA_QS1ISA)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-static void i4b_eq1i_clrirq(struct l1_softc *sc);
-
-/* 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
- *---------------------------------------------------------------------------*/
-static void
-i4b_eq1i_clrirq(struct l1_softc *sc)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
- bus_space_write_1(t, h, ELSA_OFF_IRQ, 0);
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-static void
-eqs1pi_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-static void
-eqs1pi_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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, 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, 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, buf, size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC put register routine
- *---------------------------------------------------------------------------*/
-static void
-eqs1pi_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA QuickStep 1000pro/ISA ISAC get register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-eqs1pi_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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;
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_Eqs1pi - attach for ELSA QuickStep 1000pro/ISA
- *---------------------------------------------------------------------------*/
-int
-isic_attach_Eqs1pi(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- u_char byte = ELSA_CTRL_SECRET;
-
- /* 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;
-
- /* enable the card */
-
- 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);
-
- return 0;
-}
-#endif /* defined(ELSA_QS1ISA) */
diff --git a/sys/i4b/layer1/isic/i4b_elsa_qs1p.c b/sys/i4b/layer1/isic/i4b_elsa_qs1p.c
deleted file mode 100644
index 6a92922..0000000
--- a/sys/i4b/layer1/isic/i4b_elsa_qs1p.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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 MicroLink ISDN/PCI
- * ==================================================================
- * last edit-date: [Wed Jan 24 09:09:28 2001]
- *
- * Note: ELSA Quickstep 1000pro PCI = ELSA MicroLink ISDN/PCI
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(ELSA_QS1PCI)
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <machine/bus.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_ipac.h>
-
-#define MEM0_BAR 0
-#define PORT0_BAR 1
-#define PORT1_BAR 3
-
-#define ELSA_PORT0_MAPOFF PCIR_BAR(PORT0_BAR)
-#define ELSA_PORT1_MAPOFF PCIR_BAR(PORT1_BAR)
-
-#define PCI_QS1000_DID 0x1000
-#define PCI_QS1000_VID 0x1048
-
-/* 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
-
-
-static int eqs1p_pci_probe(device_t dev);
-static int eqs1p_pci_attach(device_t dev);
-
-static device_method_t eqs1p_pci_methods[] = {
- /* Device interface */
- DEVMETHOD(device_probe, eqs1p_pci_probe),
- DEVMETHOD(device_attach, eqs1p_pci_attach),
- { 0, 0 }
-};
-
-static driver_t eqs1p_pci_driver = {
- "isic",
- eqs1p_pci_methods,
- 0
-};
-
-static devclass_t eqs1p_pci_devclass;
-
-DRIVER_MODULE(eqs1p, pci, eqs1p_pci_driver, eqs1p_pci_devclass, 0, 0);
-
-/*---------------------------------------------------------------------------*
- * ELSA MicroLink ISDN/PCI fifo read routine
- *---------------------------------------------------------------------------*/
-static void
-eqs1pp_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[1]);
-
- 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;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA MicroLink ISDN/PCI fifo write routine
- *---------------------------------------------------------------------------*/
-static void
-eqs1pp_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[1]);
-
- 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;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA MicroLink ISDN/PCI register write routine
- *---------------------------------------------------------------------------*/
-static void
-eqs1pp_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[1]);
-
- 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;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ELSA MicroLink ISDN/PCI register read routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-eqs1pp_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[1]);
-
- 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;
-}
-
-/*---------------------------------------------------------------------------*
- * avma1pp_probe - probe for a card
- *---------------------------------------------------------------------------*/
-static int
-eqs1p_pci_probe(device_t dev)
-{
- if((pci_get_vendor(dev) == PCI_QS1000_VID) &&
- (pci_get_device(dev) == PCI_QS1000_DID))
- {
- device_set_desc(dev, "ELSA MicroLink ISDN/PCI");
- return(0);
- }
- return(ENXIO);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_Eqs1pp - attach for ELSA MicroLink ISDN/PCI
- *---------------------------------------------------------------------------*/
-static int
-eqs1p_pci_attach(device_t dev)
-{
- bus_space_tag_t t;
- bus_space_handle_t h;
- struct l1_softc *sc;
- void *ih = 0;
- int unit = device_get_unit(dev);
-
- /* check max unit range */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for ELSA MicroLink ISDN/PCI!\n",
- unit, unit);
- return(ENXIO);
- }
-
- sc = &l1_sc[unit]; /* get softc */
-
- sc->sc_unit = unit;
-
- /* get io_base */
-
- sc->sc_resources.io_rid[0] = ELSA_PORT0_MAPOFF;
-
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- printf("isic%d: Couldn't get first iobase for ELSA MicroLink ISDN/PCI!\n", unit);
- return(ENXIO);
- }
-
- sc->sc_resources.io_rid[1] = ELSA_PORT1_MAPOFF;
-
- if(!(sc->sc_resources.io_base[1] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[1],
- RF_ACTIVE)))
- {
- printf("isic%d: Couldn't get second iobase for ELSA MicroLink ISDN/PCI!\n", unit);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[1]);
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE | RF_SHAREABLE)))
- {
- printf("isic%d: Could not get irq for ELSA MicroLink ISDN/PCI!\n",unit);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
- /* 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;
-
- if(isic_attach_common(dev))
- {
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- if(bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET,
- NULL, (void(*)(void*))isicintr,
- sc, &ih))
- {
- printf("isic%d: Couldn't set up irq for ELSA MicroLink ISDN/PCI!\n", unit);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- /* 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 */
-
- t = rman_get_bustag(sc->sc_resources.io_base[0]);
- h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- bus_space_write_1(t, h, 0x4c, 0x41); /* enable card interrupt */
-
- return(0);
-}
-
-#endif /* defined(ELSA_QS1PCI) */
diff --git a/sys/i4b/layer1/isic/i4b_hscx.c b/sys/i4b/layer1/isic/i4b_hscx.c
deleted file mode 100644
index c947a7a..0000000
--- a/sys/i4b/layer1/isic/i4b_hscx.c
+++ /dev/null
@@ -1,648 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------------
- * last edit-date: [Sat Mar 9 16:01:49 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-/*---------------------------------------------------------------------------*
- * HSCX IRQ Handler
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_irq(register struct l1_softc *sc, u_char ista, int h_chan, u_char ex_irq)
-{
- register l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- u_char exir = 0;
- int activity = -1;
- u_char cmd = 0;
-
- NDBGL1(L1_H_IRQ, "%#x", ista);
-
- if(ex_irq)
- {
- /* get channel extended irq reg */
-
- exir = HSCX_READ(h_chan, H_EXIR);
-
- if(exir & HSCX_EXIR_RFO)
- {
- chan->stat_RFO++;
- NDBGL1(L1_H_XFRERR, "ex_irq: receive data overflow");
- }
-
- if((exir & HSCX_EXIR_XDU) && (chan->bprot != BPROT_NONE))/* xmit data underrun */
- {
- chan->stat_XDU++;
- NDBGL1(L1_H_XFRERR, "ex_irq: xmit data underrun");
- 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);
- NDBGL1(L1_H_XFRERR, "received invalid Frame");
- error++;
- }
-
- if(rsta & HSCX_RSTA_RDO)
- {
- chan->stat_RDO++;
- NDBGL1(L1_H_XFRERR, "receive data overflow");
- error++;
- }
-
- if((rsta & HSCX_RSTA_CRC) == 0)
- {
- chan->stat_CRC++;
- cmd |= (HSCX_CMDR_RHR);
- NDBGL1(L1_H_XFRERR, "CRC check failed");
- error++;
- }
-
- if(rsta & HSCX_RSTA_RAB)
- {
- chan->stat_RAB++;
- NDBGL1(L1_H_XFRERR, "Receive message aborted");
- 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 = L0ISICUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- (*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
-
- activity = ACT_RX;
-
- /* mark buffer ptr as unused */
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- else
- {
- NDBGL1(L1_H_XFRERR, "RAWHDLC rx buffer overflow in RME, in_len=%d, fifolen=%d", 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 = L0ISICUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- /* silence detection */
-
- if(!(i4b_l1_bchan_tel_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
- activity = ACT_RX;
-
- (void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-
- /* signal upper driver that data is available */
-
- (*chan->isic_drvr_linktab->bch_rx_data_ready)(chan->isic_drvr_linktab->unit);
-
- /* 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
- {
- NDBGL1(L1_H_XFRERR, "RAWHDLC rx buffer overflow in RPF, in_len=%d", 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;
-
- NDBGL1(L1_H_IRQ, "unit %d, chan %d - XPR, Tx Fifo Empty!", 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->isic_drvr_linktab->bch_tx_queue_empty)(chan->isic_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 = L0ISICUNIT(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);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(i4b_l1_bchan_tel_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 = L0ISICUNIT(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);
- i4b_l1_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->isic_drvr_linktab->bch_activity)(chan->isic_drvr_linktab->unit, activity);
-}
-
-/*---------------------------------------------------------------------------*
- * HSCX initialization
- *
- * for telephony: extended transparent mode 1
- * for raw hdlc: transparent mode 0
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_init(struct l1_softc *sc, int h_chan, int activate)
-{
- l1_bchan_state_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);
- }
-#if 0
- isic_hscx_cmd(sc, h_chan, HSCX_CMDR_RHR|HSCX_CMDR_XRES);
-#else
- isic_hscx_cmd(sc, h_chan, HSCX_CMDR_RHR);
-#endif
- }
- 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 l1_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)
- {
- NDBGL1(L1_H_ERR, "HSCX wait for CEC timeout!");
- }
-
- HSCX_WRITE(h_chan, H_CMDR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * wait for HSCX transmit FIFO write enable
- *---------------------------------------------------------------------------*/
-void
-isic_hscx_waitxfw(struct l1_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)
- {
- NDBGL1(L1_H_ERR, "HSCX wait for XFW timeout!");
- }
- else if (timeout != WAITTO)
- {
- NDBGL1(L1_H_XFRERR, "HSCX wait for XFW time: %d uS", (WAITTO-timeout)*50);
- }
-}
diff --git a/sys/i4b/layer1/isic/i4b_hscx.h b/sys/i4b/layer1/isic/i4b_hscx.h
deleted file mode 100644
index 890d6b7..0000000
--- a/sys/i4b/layer1/isic/i4b_hscx.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/*-
- * Copyright (c) 1996, 2000 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.
- */
-
-/*---------------------------------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Wed Jan 24 09:09:51 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#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/isic/i4b_ipac.h b/sys/i4b/layer1/isic/i4b_ipac.h
deleted file mode 100644
index 6361b35..0000000
--- a/sys/i4b/layer1/isic/i4b_ipac.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * ==========================================================
- *
- * $FreeBSD$
- *
- * last edit-date: [Wed Jan 24 09:10:09 2001]
- *
- *---------------------------------------------------------------------------
- */
-
-#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
-
-/* chip version */
-
-#define IPAC_V11 0x01 /* IPAC Version 1.1 */
-#define IPAC_V12 0x02 /* IPAC Version 1.2 */
-
-/*
- * 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/isic/i4b_isac.c b/sys/i4b/layer1/isic/i4b_isac.c
deleted file mode 100644
index 8a50efc..0000000
--- a/sys/i4b/layer1/isic/i4b_isac.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * ---------------------------------------------------------
- * last edit-date: [Wed Jan 24 09:10:36 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char isic_isac_exir_hdlr(register struct l1_softc *sc, u_char exir);
-static void isic_isac_ind_hdlr(register struct l1_softc *sc, int ind);
-
-/*---------------------------------------------------------------------------*
- * ISAC interrupt service routine
- *---------------------------------------------------------------------------*/
-void
-isic_isac_irq(struct l1_softc *sc, int ista)
-{
- register u_char c = 0;
- NDBGL1(L1_F_MSG, "unit %d: ista = 0x%02x", 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++;
- NDBGL1(L1_I_ERR, "unit %d: CRC error", sc->sc_unit);
- }
-
- if(rsta & ISAC_RSTA_RDO) /* ReceiveDataOverflow */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Data Overrun error", sc->sc_unit);
- }
-
- if(rsta & ISAC_RSTA_RAB) /* ReceiveABorted */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Receive Aborted error", sc->sc_unit);
- }
-
- if(error == 0)
- NDBGL1(L1_I_ERR, "unit %d: RME unknown error, RSTA = 0x%02x!", 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 = L0ISICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, sc->sc_ibuf->m_len, sc->sc_ibuf->m_data);
- }
-
- c |= ISAC_CMDR_RMC;
-
- if(sc->sc_enabled &&
- (ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S))
- {
- i4b_l1_ph_data_ind(L0ISICUNIT(sc->sc_unit), sc->sc_ibuf);
- }
- else
- {
- i4b_Dfreembuf(sc->sc_ibuf);
- }
- }
- else
- {
- NDBGL1(L1_I_ERR, "RME, input buffer overflow!");
- 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
- {
- NDBGL1(L1_I_ERR, "RPF, input buffer overflow!");
- 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 l1_softc *sc, u_char exir)
-{
- u_char c = 0;
-
- if(exir & ISAC_EXIR_XMR)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Message Repeat");
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_XDU)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Data Underrun");
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_PCE)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Protocol Error");
- }
-
- if(exir & ISAC_EXIR_RFO)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Rx Frame Overflow");
-
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
-
- if(exir & ISAC_EXIR_SOV)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Sync Xfer Overflow");
- }
-
- if(exir & ISAC_EXIR_MOS)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Monitor Status");
- }
-
- if(exir & ISAC_EXIR_SAW)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Subscriber Awake");
- }
-
- if(exir & ISAC_EXIR_WOV)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Watchdog Timer Overflow");
- }
-
- return(c);
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Indication handler
- *---------------------------------------------------------------------------*/
-static void
-isic_isac_ind_hdlr(register struct l1_softc *sc, int ind)
-{
- register int event;
-
- switch(ind)
- {
- case ISAC_CIRR_IAI8:
- NDBGL1(L1_I_CICO, "rx AI8 in state %s", isic_printstate(sc));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- isic_isac_l1_cmd(sc, CMD_AR8);
- event = EV_INFO48;
- i4b_l1_mph_status_ind(L0ISICUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISAC_CIRR_IAI10:
- NDBGL1(L1_I_CICO, "rx AI10 in state %s", isic_printstate(sc));
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- isic_isac_l1_cmd(sc, CMD_AR10);
- event = EV_INFO410;
- i4b_l1_mph_status_ind(L0ISICUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISAC_CIRR_IRSY:
- NDBGL1(L1_I_CICO, "rx RSY in state %s", isic_printstate(sc));
- event = EV_RSY;
- break;
-
- case ISAC_CIRR_IPU:
- NDBGL1(L1_I_CICO, "rx PU in state %s", isic_printstate(sc));
- event = EV_PU;
- break;
-
- case ISAC_CIRR_IDR:
- NDBGL1(L1_I_CICO, "rx DR in state %s", isic_printstate(sc));
- isic_isac_l1_cmd(sc, CMD_DIU);
- event = EV_DR;
- break;
-
- case ISAC_CIRR_IDID:
- NDBGL1(L1_I_CICO, "rx DID in state %s", isic_printstate(sc));
- event = EV_INFO0;
- i4b_l1_mph_status_ind(L0ISICUNIT(sc->sc_unit), STI_L1STAT, LAYER_IDLE, NULL);
- break;
-
- case ISAC_CIRR_IDIS:
- NDBGL1(L1_I_CICO, "rx DIS in state %s", isic_printstate(sc));
- event = EV_DIS;
- break;
-
- case ISAC_CIRR_IEI:
- NDBGL1(L1_I_CICO, "rx EI in state %s", isic_printstate(sc));
- isic_isac_l1_cmd(sc, CMD_DIU);
- event = EV_EI;
- break;
-
- case ISAC_CIRR_IARD:
- NDBGL1(L1_I_CICO, "rx ARD in state %s", isic_printstate(sc));
- event = EV_INFO2;
- break;
-
- case ISAC_CIRR_ITI:
- NDBGL1(L1_I_CICO, "rx TI in state %s", isic_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_IATI:
- NDBGL1(L1_I_CICO, "rx ATI in state %s", isic_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_ISD:
- NDBGL1(L1_I_CICO, "rx SD in state %s", isic_printstate(sc));
- event = EV_INFO0;
- break;
-
- default:
- NDBGL1(L1_I_ERR, "UNKNOWN Indication 0x%x in state %s", ind, isic_printstate(sc));
- event = EV_INFO0;
- break;
- }
- isic_next_state(sc, event);
-}
-
-/*---------------------------------------------------------------------------*
- * execute a layer 1 command
- *---------------------------------------------------------------------------*/
-void
-isic_isac_l1_cmd(struct l1_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)
- {
- NDBGL1(L1_I_ERR, "illegal cmd 0x%x in state %s", command, isic_printstate(sc));
- return;
- }
-
- if(sc->sc_bustyp == BUS_TYPE_IOM2)
- cmd = ISAC_CIX0_LOW;
- else
- cmd = 0;
-
- switch(command)
- {
- case CMD_TIM:
- NDBGL1(L1_I_CICO, "tx TIM in state %s", isic_printstate(sc));
- cmd |= (ISAC_CIXR_CTIM << 2);
- break;
-
- case CMD_RS:
- NDBGL1(L1_I_CICO, "tx RS in state %s", isic_printstate(sc));
- cmd |= (ISAC_CIXR_CRS << 2);
- break;
-
- case CMD_AR8:
- NDBGL1(L1_I_CICO, "tx AR8 in state %s", isic_printstate(sc));
- cmd |= (ISAC_CIXR_CAR8 << 2);
- break;
-
- case CMD_AR10:
- NDBGL1(L1_I_CICO, "tx AR10 in state %s", isic_printstate(sc));
- cmd |= (ISAC_CIXR_CAR10 << 2);
- break;
-
- case CMD_DIU:
- NDBGL1(L1_I_CICO, "tx DIU in state %s", isic_printstate(sc));
- cmd |= (ISAC_CIXR_CDIU << 2);
- break;
- }
- ISAC_WRITE(I_CIXR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * L1 ISAC initialization
- *---------------------------------------------------------------------------*/
-int
-isic_isac_init(struct l1_softc *sc)
-{
- ISAC_IMASK = 0xff; /* disable all irqs */
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- if(sc->sc_bustyp != BUS_TYPE_IOM2)
- {
- NDBGL1(L1_I_SETUP, "configuring for IOM-1 mode");
-
- /* 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
- {
- NDBGL1(L1_I_SETUP, "configuring for IOM-2 mode");
-
- /* 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);
-}
diff --git a/sys/i4b/layer1/isic/i4b_isac.h b/sys/i4b/layer1/isic/i4b_isac.h
deleted file mode 100644
index 7435104..0000000
--- a/sys/i4b/layer1/isic/i4b_isac.h
+++ /dev/null
@@ -1,389 +0,0 @@
-/*-
- * Copyright (c) 1996, 2000 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.
- */
-
-/*---------------------------------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Wed Jan 24 09:10:42 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#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/isic/i4b_isic.c b/sys/i4b/layer1/isic/i4b_isic.c
deleted file mode 100644
index 4b9af74..0000000
--- a/sys/i4b/layer1/isic/i4b_isic.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * ==============================
- * last edit-date: [Wed Jan 24 09:29:42 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isic_ext.h>
-#include <i4b/layer1/isic/i4b_ipac.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/include/i4b_global.h>
-
-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"
-};
-
-/* jump table for multiplex routines */
-struct i4b_l1mux_func isic_l1mux_func = {
- isic_ret_linktab,
- isic_set_linktab,
- isic_mph_command_req,
- isic_ph_data_req,
- isic_ph_activate_req,
-};
-
-/*---------------------------------------------------------------------------*
- * isic - device driver interrupt routine
- *---------------------------------------------------------------------------*/
-void
-isicintr(struct l1_softc *sc)
-{
- if(sc->sc_ipac == 0) /* HSCX/ISAC interrupt 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;
- }
- }
-
- 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) && (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);
- }
- 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)
- {
- /* ISAC interrupt */
- isic_isac_irq(sc, ISAC_READ(I_ISTA));
- was_ipac_irq = 1;
- }
- if(ipac_irq_stat & IPAC_ISTA_EXD)
- {
- /* force ISAC interrupt handling */
- isic_isac_irq(sc, ISAC_ISTA_EXI);
- was_ipac_irq = 1;
- }
-
- /* do as long as there are pending irqs in the chip */
- if(!ipac_irq_stat)
- break;
- }
-
- IPAC_WRITE(IPAC_MASK, 0xff);
- DELAY(50);
- IPAC_WRITE(IPAC_MASK, 0xc0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * isic_recover - try to recover from irq lockup
- *---------------------------------------------------------------------------*/
-void
-isic_recover(struct l1_softc *sc)
-{
- u_char byte;
-
- /* get hscx irq status from hscx b ista */
-
- byte = HSCX_READ(HSCX_CH_B, H_ISTA);
-
- NDBGL1(L1_ERROR, "HSCX B: ISTA = 0x%x", byte);
-
- if(byte & HSCX_ISTA_ICA)
- NDBGL1(L1_ERROR, "HSCX A: ISTA = 0x%x", (u_char)HSCX_READ(HSCX_CH_A, H_ISTA));
-
- if(byte & HSCX_ISTA_EXB)
- NDBGL1(L1_ERROR, "HSCX B: EXIR = 0x%x", (u_char)HSCX_READ(HSCX_CH_B, H_EXIR));
-
- if(byte & HSCX_ISTA_EXA)
- NDBGL1(L1_ERROR, "HSCX A: EXIR = 0x%x", (u_char)HSCX_READ(HSCX_CH_A, H_EXIR));
-
- /* get isac irq status */
-
- byte = ISAC_READ(I_ISTA);
-
- NDBGL1(L1_ERROR, " ISAC: ISTA = 0x%x", byte);
-
- if(byte & ISAC_ISTA_EXI)
- NDBGL1(L1_ERROR, " ISAC: EXIR = 0x%x", (u_char)ISAC_READ(I_EXIR));
-
- if(byte & ISAC_ISTA_CISQ)
- {
- byte = ISAC_READ(I_CIRR);
-
- NDBGL1(L1_ERROR, " ISAC: CISQ = 0x%x", byte);
-
- if(byte & ISAC_CIRR_SQC)
- NDBGL1(L1_ERROR, " ISAC: SQRR = 0x%x", (u_char)ISAC_READ(I_SQRR));
- }
-
- NDBGL1(L1_ERROR, "HSCX B: IMASK = 0x%x", HSCX_B_IMASK);
- NDBGL1(L1_ERROR, "HSCX A: IMASK = 0x%x", 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);
-
- NDBGL1(L1_ERROR, " ISAC: IMASK = 0x%x", ISAC_IMASK);
-
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_common - common attach routine for all busses
- *---------------------------------------------------------------------------*/
-int
-isic_attach_common(device_t dev)
-{
- char *drvid = NULL;
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
-
- sc->sc_unit = unit;
-
- sc->sc_isac_version = 0;
- sc->sc_hscx_version = 0;
-
- if(sc->sc_ipac)
- {
- sc->sc_ipac_version = IPAC_READ(IPAC_ID);
-
- switch(sc->sc_ipac_version)
- {
- case IPAC_V11:
- case IPAC_V12:
- break;
-
- default:
- printf("isic%d: Error, IPAC version %d unknown!\n",
- unit, sc->sc_ipac_version);
- 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:
- break;
-
- default:
- printf("isic%d: Error, ISAC version %d unknown!\n",
- unit, sc->sc_isac_version);
- return ENXIO;
- 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%d: Error, HSCX version %d unknown!\n",
- unit, sc->sc_hscx_version);
- return ENXIO;
- break;
- }
- }
-
- isic_isac_init(sc); /* ISAC setup */
-
- /* 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);
-
- isic_init_linktab(sc); /* setup linktab */
-
- sc->sc_trace = TRACE_OFF; /* set trace level */
-
- sc->sc_state = ISAC_IDLE; /* set state */
-
- sc->sc_ibuf = NULL; /* input buffering */
- sc->sc_ib = NULL;
- sc->sc_ilen = 0;
-
- sc->sc_obuf = NULL; /* output buffering */
- sc->sc_op = NULL;
- sc->sc_ol = 0;
- sc->sc_freeflag = 0;
-
- sc->sc_obuf2 = NULL; /* second output buffer */
- sc->sc_freeflag2 = 0;
-
- /* timer setup */
-
- callout_handle_init(&sc->sc_T3_callout);
- callout_handle_init(&sc->sc_T4_callout);
-
- /* init higher protocol layers */
-
- i4b_l1_mph_status_ind(L0ISICUNIT(sc->sc_unit), STI_ATTACH, sc->sc_cardtyp, &isic_l1mux_func);
-
- /* announce manufacturer and card type for ISA cards */
-
- switch(sc->sc_cardtyp)
- {
- case CARD_TYPEP_8:
- drvid = "Teles S0/8 (or compatible)";
- break;
-
- case CARD_TYPEP_16:
- drvid = "Teles S0/16 (or compatible)";
- break;
-
- case CARD_TYPEP_16_3:
- drvid = "Teles S0/16.3";
- break;
-
- case CARD_TYPEP_AVMA1:
- drvid = "AVM A1 or Fritz!Card Classic";
- break;
-
- case CARD_TYPEP_PCFRITZ:
- drvid = "AVM Fritz!Card PCMCIA";
- break;
-
- case CARD_TYPEP_USRTA:
- drvid = "USRobotics Sportster ISDN TA intern";
- break;
-
- case CARD_TYPEP_ITKIX1:
- drvid = "ITK ix1 micro";
- break;
-
- case CARD_TYPEP_PCC16:
- drvid = "ELSA MicroLink ISDN/PCC-16";
- break;
-
- default:
- drvid = NULL; /* pnp/pci cards announce themselves */
- break;
- }
-
- if(drvid)
- printf("isic%d: %s\n", unit, drvid);
-
- if(bootverbose)
- {
- /* announce chip versions */
-
- if(sc->sc_ipac)
- {
- if(sc->sc_ipac_version == IPAC_V11)
- printf("isic%d: IPAC PSB2115 Version 1.1\n", unit);
- else
- printf("isic%d: IPAC PSB2115 Version 1.2\n", unit);
- }
- else
- {
- printf("isic%d: ISAC %s (IOM-%c)\n",
- unit,
- ISACversion[sc->sc_isac_version],
- sc->sc_bustyp == BUS_TYPE_IOM1 ? '1' : '2');
-
- printf("isic%d: HSCX %s\n",
- unit,
- HSCXversion[sc->sc_hscx_version]);
- }
- }
- return 0;
-}
-
-/*---------------------------------------------------------------------------*
- * isic_detach_common - common detach routine for all busses
- *---------------------------------------------------------------------------*/
-void
-isic_detach_common(device_t dev)
-{
- struct l1_softc *sc = &l1_sc[device_get_unit(dev)];
- int i;
-
- sc->sc_cardtyp = CARD_TYPEP_UNK;
-
- /* free interrupt resources */
-
- if(sc->sc_resources.irq)
- {
- /* tear down interrupt handler */
- bus_teardown_intr(dev, sc->sc_resources.irq,
- (void(*)(void *))isicintr);
-
- /* free irq */
- bus_release_resource(dev, SYS_RES_IRQ,
- sc->sc_resources.irq_rid,
- sc->sc_resources.irq);
- sc->sc_resources.irq_rid = 0;
- sc->sc_resources.irq = 0;
- }
-
- /* free memory resource */
-
- if(sc->sc_resources.mem)
- {
- bus_release_resource(dev,SYS_RES_MEMORY,
- sc->sc_resources.mem_rid,
- sc->sc_resources.mem);
- sc->sc_resources.mem_rid = 0;
- sc->sc_resources.mem = 0;
- }
-
- /* free iobases */
-
- for(i=0; i < INFO_IO_BASES ; i++)
- {
- if(sc->sc_resources.io_base[i])
- {
- bus_release_resource(dev, SYS_RES_IOPORT,
- sc->sc_resources.io_rid[i],
- sc->sc_resources.io_base[i]);
- sc->sc_resources.io_rid[i] = 0;
- sc->sc_resources.io_base[i] = 0;
- }
- }
-}
diff --git a/sys/i4b/layer1/isic/i4b_isic.h b/sys/i4b/layer1/isic/i4b_isic.h
deleted file mode 100644
index d4c3bce..0000000
--- a/sys/i4b/layer1/isic/i4b_isic.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * ---------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Fri Jan 26 13:55:12 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_ISIC_H_
-#define _I4B_ISIC_H_
-
-#include <sys/resource.h>
-#include <sys/bus.h>
-#include <machine/bus.h>
-#include <sys/rman.h>
-#include <machine/resource.h>
-
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer1/isic/i4b_isic_ext.h>
-
-/*---------------------------------------------------------------------------
- * isic driver: max no of 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.
- *---------------------------------------------------------------------------*/
-#define ISIC_MAXUNIT 3 /* max no of supported units 0..3 */
-
-#define INFO_IO_BASES 50 /* 49 needed for USR */
-
-struct i4b_info {
- struct resource * io_base[INFO_IO_BASES];
- int io_rid [INFO_IO_BASES];
- struct resource * irq;
- int irq_rid;
- struct resource * mem;
- int mem_rid;
-};
-
-/*---------------------------------------------------------------------------*
- * l1_bchan_state: the state of one B channel
- *---------------------------------------------------------------------------*/
-typedef struct
-{
- int unit; /* cards unit number */
- int channel; /* which channel is this*/
- caddr_t hscx; /* HSCX address */
- 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 isic_isdn_linktab; /* b channel addresses */
- drvr_link_t *isic_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 */
-
-} l1_bchan_state_t;
-
-/*---------------------------------------------------------------------------*
- * l1_softc: the state of the layer 1 of the D channel
- *---------------------------------------------------------------------------*/
-struct l1_softc
-{
- int sc_unit; /* unit number */
- int sc_irq; /* interrupt vector */
- struct i4b_info sc_resources;
-
- int sc_port; /* port base address */
-
- 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 */
-
- 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)
-
- u_char sc_isac_mask; /* ISAC IRQ mask */
-#define ISAC_IMASK (sc->sc_isac_mask)
-
- l1_bchan_state_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_ipac_version; /* version number of IPAC */
-
- int sc_I430state; /* I.430 state F3 .... F8 */
-
- int sc_I430T3; /* I.430 Timer T3 running */
-
- struct callout_handle sc_T3_callout;
-
- int sc_I430T4; /* Timer T4 running */
-
- struct callout_handle sc_T4_callout;
-
- /*
- * byte fields for the AVM Fritz!Card PCI. These are packed into
- * a u_int in the driver.
- */
- u_char avma1pp_cmd;
- u_char avma1pp_txl;
- u_char avma1pp_prot;
-
- int sc_enabled; /* daemon is running */
-
- int sc_ipac; /* flag, running on ipac */
- int sc_bfifolen; /* length of b channel fifos */
-
-#define ISIC_WHAT_ISAC 0
-#define ISIC_WHAT_HSCXA 1
-#define ISIC_WHAT_HSCXB 2
-#define ISIC_WHAT_IPAC 3
-
- u_int8_t (*readreg) (struct l1_softc *sc, int what, bus_size_t offs);
- void (*writereg) (struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data);
- void (*readfifo) (struct l1_softc *sc, int what, void *buf, size_t size);
- void (*writefifo) (struct l1_softc *sc, int what, void *data, size_t size);
- void (*clearirq) (struct l1_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))
-};
-
-/*---------------------------------------------------------------------------*
- * 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
-
-extern struct l1_softc l1_sc[];
-
-extern void isicintr(struct l1_softc *sc);
-extern int isic_attach_common(device_t dev);
-extern void isic_detach_common(device_t dev);
-extern void isic_recover(struct l1_softc *sc);
-
-extern void isic_bchannel_setup (int unit, int hscx_channel, int bprot, int activate );
-
-extern void isic_init_linktab ( struct l1_softc *sc );
-extern int isic_isac_init ( struct l1_softc *sc );
-extern void isic_isac_irq ( struct l1_softc *sc, int r );
-extern void isic_isac_l1_cmd ( struct l1_softc *sc, int command );
-extern void isic_next_state ( struct l1_softc *sc, int event );
-extern char *isic_printstate ( struct l1_softc *sc );
-
-extern int isic_hscx_fifo(l1_bchan_state_t *, struct l1_softc *);
-extern void isic_hscx_init ( struct l1_softc *sc, int hscx_channel, int activate );
-extern void isic_hscx_irq ( struct l1_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 l1_softc *sc, int h_chan, unsigned char cmd );
-extern void isic_hscx_waitxfw( struct l1_softc *sc, int h_chan );
-
-extern int isic_probe_s016 (device_t dev);
-extern int isic_attach_s016 (device_t dev);
-
-extern int isic_probe_s08 (device_t dev);
-extern int isic_attach_s08 (device_t dev);
-
-extern int isic_probe_Epcc16 (device_t dev);
-extern int isic_attach_Epcc16 (device_t dev);
-
-extern int isic_probe_s0163 (device_t dev);
-extern int isic_attach_s0163 (device_t dev);
-
-extern int isic_probe_avma1 (device_t dev);
-extern int isic_attach_avma1 (device_t dev);
-
-extern int isic_probe_usrtai (device_t dev);
-extern int isic_attach_usrtai (device_t dev);
-
-extern int isic_probe_itkix1 (device_t dev);
-extern int isic_attach_itkix1 (device_t dev);
-
-extern int isic_attach_drnngo (device_t dev);
-extern int isic_attach_Cs0P (device_t dev);
-extern int isic_attach_Eqs1pi(device_t dev);
-extern int isic_attach_sws(device_t dev);
-extern int isic_attach_siemens_isurf(device_t dev);
-extern int isic_attach_asi(device_t dev);
-extern int isic_attach_Dyn(device_t dev);
-extern int isic_attach_diva(device_t dev);
-extern int isic_attach_diva_ipac(device_t dev);
-
-#endif /* _I4B_ISIC_H_ */
diff --git a/sys/i4b/layer1/isic/i4b_isic_ext.h b/sys/i4b/layer1/isic/i4b_isic_ext.h
deleted file mode 100644
index ad99114..0000000
--- a/sys/i4b/layer1/isic/i4b_isic_ext.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * ---------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Wed Jan 24 09:11:12 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_ISIC_EXT_H_
-#define _I4B_ISIC_EXT_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-int isic_ph_data_req(int unit, struct mbuf *m, int freeflag);
-int isic_ph_activate_req(int unit);
-int isic_mph_command_req(int unit, int command, void *parm);
-
-void isic_set_linktab(int unit, int channel, drvr_link_t *dlt);
-isdn_link_t *isic_ret_linktab(int unit, int channel);
-
-#endif /* _I4B_ISIC_H_ */
diff --git a/sys/i4b/layer1/isic/i4b_isic_isa.c b/sys/i4b/layer1/isic/i4b_isic_isa.c
deleted file mode 100644
index 6d88caa..0000000
--- a/sys/i4b/layer1/isic/i4b_isic_isa.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * ==================================
- * last edit-date: [Wed Jan 24 09:30:19 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-
-#include <sys/bus.h>
-#include <isa/isavar.h>
-
-struct l1_softc l1_sc[ISIC_MAXUNIT];
-
-static int isic_isa_probe(device_t dev);
-static int isic_isa_attach(device_t dev);
-
-static device_method_t isic_methods[] = {
- DEVMETHOD(device_probe, isic_isa_probe),
- DEVMETHOD(device_attach, isic_isa_attach),
- { 0, 0 }
-};
-
-static driver_t isic_driver = {
- "isic",
- isic_methods,
- 0
-};
-
-static devclass_t isic_devclass;
-
-DRIVER_MODULE(isic, isa, isic_driver, isic_devclass, 0, 0);
-
-/*---------------------------------------------------------------------------*
- * probe for ISA non-PnP cards
- *---------------------------------------------------------------------------*/
-static int
-isic_isa_probe(device_t dev)
-{
- int ret = ENXIO;
-
- if(isa_get_vendorid(dev)) /* no PnP probes here */
- return ENXIO;
-
- switch(device_get_flags(dev))
- {
-#ifdef TEL_S0_16
- case CARD_TYPEP_16:
- ret = isic_probe_s016(dev);
- break;
-#endif
-
-#ifdef TEL_S0_8
- case CARD_TYPEP_8:
- ret = isic_probe_s08(dev);
- break;
-#endif
-
-#ifdef ELSA_PCC16
- case CARD_TYPEP_PCC16:
- ret = isic_probe_Epcc16(dev);
- break;
-#endif
-
-#ifdef TEL_S0_16_3
- case CARD_TYPEP_16_3:
- ret = isic_probe_s0163(dev);
- break;
-#endif
-
-#ifdef AVM_A1
- case CARD_TYPEP_AVMA1:
- ret = isic_probe_avma1(dev);
- break;
-#endif
-
-#ifdef USR_STI
- case CARD_TYPEP_USRTA:
- ret = isic_probe_usrtai(dev);
- break;
-#endif
-
-#ifdef ITKIX1
- case CARD_TYPEP_ITKIX1:
- ret = isic_probe_itkix1(dev);
- break;
-#endif
-
- default:
- printf("isic%d: probe, unknown flag: %d\n",
- device_get_unit(dev), device_get_flags(dev));
- break;
- }
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * attach for ISA non-PnP cards
- *---------------------------------------------------------------------------*/
-static int
-isic_isa_attach(device_t dev)
-{
- int ret = ENXIO;
-
- struct l1_softc *sc = &l1_sc[device_get_unit(dev)];
-
- sc->sc_unit = device_get_unit(dev);
-
- /* card dependent setup */
-
- switch(sc->sc_cardtyp)
- {
-#ifdef TEL_S0_16
- case CARD_TYPEP_16:
- ret = isic_attach_s016(dev);
- break;
-#endif
-
-#ifdef TEL_S0_8
- case CARD_TYPEP_8:
- ret = isic_attach_s08(dev);
- break;
-#endif
-
-#ifdef ELSA_PCC16
- case CARD_TYPEP_PCC16:
- ret = isic_attach_Epcc16(dev);
- break;
-#endif
-
-#ifdef TEL_S0_16_3
- case CARD_TYPEP_16_3:
- ret = isic_attach_s0163(dev);
- break;
-#endif
-
-#ifdef AVM_A1
- case CARD_TYPEP_AVMA1:
- ret = isic_attach_avma1(dev);
- break;
-#endif
-
-#ifdef USR_STI
- case CARD_TYPEP_USRTA:
- ret = isic_attach_usrtai(dev);
- break;
-#endif
-
-#ifdef ITKIX1
- case CARD_TYPEP_ITKIX1:
- ret = isic_attach_itkix1(dev);
- break;
-#endif
-
- default:
- printf("isic%d: attach, unknown flag: %d\n",
- device_get_unit(dev), device_get_flags(dev));
- break;
- }
-
- if(ret)
- return(ret);
-
- ret = isic_attach_common(dev);
-
- return(ret);
-}
diff --git a/sys/i4b/layer1/isic/i4b_isic_pnp.c b/sys/i4b/layer1/isic/i4b_isic_pnp.c
deleted file mode 100644
index 2a45427..0000000
--- a/sys/i4b/layer1/isic/i4b_isic_pnp.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/*-
- * Copyright (c) 1998 Eivind Eklund. All rights reserved.
- *
- * Copyright (c) 1998, 1999 German Tischler. All rights reserved.
- *
- * Copyright (c) 1998, 2001 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
- * --------------------------------
- * last edit-date: [Fri Jan 26 14:01:04 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-
-#include <isa/isavar.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*/
-#define VID_ITK0025 0x25008b26 /* ITK Ix1 Micro V3 */
-#define VID_AVMPNP 0x0009cd06 /* AVM Fritz! PnP */
-#define VID_SIESURF2 0x2000254d /* Siemens I-Surf 2.0 PnP*/
-#define VID_ASUSCOM_IPAC 0x90167506 /* Asuscom (with IPAC) */
-#define VID_EICON_DIVA_20 0x7100891c /* Eicon DIVA 2.0 ISAC/HSCX */
-#define VID_EICON_DIVA_202 0xa100891c /* Eicon DIVA 2.02 IPAC */
-#define VID_COMPAQ_M610 0x0210110e /* Compaq Microcom 610 */
-
-static struct isic_pnp_ids {
- u_long vend_id;
- char *id_str;
-} isic_pnp_ids[] = {
-#if defined(TEL_S0_16_3_P) || defined(CRTX_S0_P) || defined(COMPAQ_M610)
- { VID_TEL163PNP, "Teles S0/16.3 PnP" },
- { VID_CREATIXPP, "Creatix S0/16 PnP" },
- { VID_COMPAQ_M610, "Compaq Microcom 610" },
-#endif
-#ifdef DYNALINK
- { VID_DYNALINK, "Dynalink IS64PH" },
-#endif
-#ifdef SEDLBAUER
- { VID_SEDLBAUER, "Sedlbauer WinSpeed" },
-#endif
-#ifdef DRN_NGO
- { VID_NICCYGO, "Dr.Neuhaus Niccy Go@" },
-#endif
-#ifdef ELSA_QS1ISA
- { VID_ELSAQS1P, "ELSA QuickStep 1000pro" },
-#endif
-#ifdef ITKIX1
- { VID_ITK0025, "ITK ix1 Micro V3.0" },
-#endif
-#ifdef AVM_PNP
- { VID_AVMPNP, "AVM Fritz!Card PnP" },
-#endif
-#ifdef SIEMENS_ISURF2
- { VID_SIESURF2, "Siemens I-Surf 2.0 PnP" },
-#endif
-#ifdef ASUSCOM_IPAC
- { VID_ASUSCOM_IPAC, "Asuscom ISDNLink 128 PnP" },
-#endif
-#ifdef EICON_DIVA
- { VID_EICON_DIVA_20, "Eicon.Diehl DIVA 2.0 ISA PnP" },
- { VID_EICON_DIVA_202, "Eicon.Diehl DIVA 2.02 ISA PnP" },
-#endif
- { 0, 0 }
-};
-
-static int isic_pnp_probe(device_t dev);
-static int isic_pnp_attach(device_t dev);
-
-static device_method_t isic_pnp_methods[] = {
- DEVMETHOD(device_probe, isic_pnp_probe),
- DEVMETHOD(device_attach, isic_pnp_attach),
- { 0, 0 }
-};
-
-static driver_t isic_pnp_driver = {
- "isic",
- isic_pnp_methods,
- 0,
-};
-
-static devclass_t isic_devclass;
-
-DRIVER_MODULE(isicpnp, isa, isic_pnp_driver, isic_devclass, 0, 0);
-
-/*---------------------------------------------------------------------------*
- * probe for ISA PnP cards
- *---------------------------------------------------------------------------*/
-static int
-isic_pnp_probe(device_t dev)
-{
- struct isic_pnp_ids *ids; /* pnp id's */
- char *string = NULL; /* the name */
- u_int32_t vend_id = isa_get_vendorid(dev); /* vendor id */
-
- /* search table of knowd id's */
-
- for(ids = isic_pnp_ids; ids->vend_id != 0; ids++)
- {
- if(vend_id == ids->vend_id)
- {
- string = ids->id_str;
- break;
- }
- }
-
- if(string) /* set name if we have one */
- {
- device_set_desc(dev, string); /* set description */
- return 0;
- }
- else
- {
- return ENXIO;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * attach for ISA PnP cards
- *---------------------------------------------------------------------------*/
-static int
-isic_pnp_attach(device_t dev)
-{
- u_int32_t vend_id = isa_get_vendorid(dev); /* vendor id */
- unsigned int unit = device_get_unit(dev); /* get unit */
- const char *name = device_get_desc(dev); /* get description */
- struct l1_softc *sc = 0; /* softc */
- void *ih = 0; /* a dummy */
- int ret;
-
- /* see if we are out of bounds */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for %s\n", unit, unit, name);
- return ENXIO;
- }
-
- /* get information structure for this unit */
-
- sc = &l1_sc[unit];
-
- /* get io_base */
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE ) ))
- {
- printf("isic_pnp_attach: Couldn't get my io_base.\n");
- return ENXIO;
- }
-
- /* will not be used for pnp devices */
-
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
-
- /* get irq, release io_base if we don't get it */
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get irq.\n",unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* not needed */
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
-
- /* set flag so we know what this card is */
-
- ret = ENXIO;
-
- switch(vend_id)
- {
-#if defined(TEL_S0_16_3_P) || defined(CRTX_S0_P) || defined(COMPAQ_M610)
- case VID_TEL163PNP:
- sc->sc_cardtyp = CARD_TYPEP_163P;
- ret = isic_attach_Cs0P(dev);
- break;
-
- case VID_CREATIXPP:
- sc->sc_cardtyp = CARD_TYPEP_CS0P;
- ret = isic_attach_Cs0P(dev);
- break;
-
- case VID_COMPAQ_M610:
- sc->sc_cardtyp = CARD_TYPEP_COMPAQ_M610;
- ret = isic_attach_Cs0P(dev);
- break;
-#endif
-#ifdef DYNALINK
- case VID_DYNALINK:
- sc->sc_cardtyp = CARD_TYPEP_DYNALINK;
- ret = isic_attach_Dyn(dev);
- break;
-#endif
-#ifdef SEDLBAUER
- case VID_SEDLBAUER:
- sc->sc_cardtyp = CARD_TYPEP_SWS;
- ret = isic_attach_sws(dev);
- break;
-#endif
-#ifdef DRN_NGO
- case VID_NICCYGO:
- sc->sc_cardtyp = CARD_TYPEP_DRNNGO;
- ret = isic_attach_drnngo(dev);
- break;
-#endif
-#ifdef ELSA_QS1ISA
- case VID_ELSAQS1P:
- sc->sc_cardtyp = CARD_TYPEP_ELSAQS1ISA;
- ret = isic_attach_Eqs1pi(dev);
- break;
-#endif
-#ifdef ITKIX1
- case VID_ITK0025:
- sc->sc_cardtyp = CARD_TYPEP_ITKIX1;
- ret = isic_attach_itkix1(dev);
- break;
-#endif
-#ifdef SIEMENS_ISURF2
- case VID_SIESURF2:
- sc->sc_cardtyp = CARD_TYPEP_SIE_ISURF2;
- ret = isic_attach_siemens_isurf(dev);
- break;
-#endif
-#ifdef ASUSCOM_IPAC
- case VID_ASUSCOM_IPAC:
- sc->sc_cardtyp = CARD_TYPEP_ASUSCOMIPAC;
- ret = isic_attach_asi(dev);
- break;
-#endif
-#ifdef EICON_DIVA
- case VID_EICON_DIVA_20:
- sc->sc_cardtyp = CARD_TYPEP_DIVA_ISA;
- ret = isic_attach_diva(dev);
- break;
-
- case VID_EICON_DIVA_202:
- sc->sc_cardtyp = CARD_TYPEP_DIVA_ISA;
- ret = isic_attach_diva_ipac(dev);
- break;
-#endif
- default:
- printf("isic%d: Error, no driver for %s\n", unit, name);
- ret = ENXIO;
- break;
- }
-
- if(ret)
- {
- isic_detach_common(dev);
- return ENXIO;
- }
-
- if(isic_attach_common(dev))
- {
- /* unset flag */
- sc->sc_cardtyp = CARD_TYPEP_UNK;
-
- /* free irq here, it hasn't been attached yet */
- bus_release_resource(dev,SYS_RES_IRQ,sc->sc_resources.irq_rid,
- sc->sc_resources.irq);
- sc->sc_resources.irq = 0;
- isic_detach_common(dev);
- return ENXIO;
- }
- else
- {
- /* setup intr routine */
- if (bus_setup_intr(dev,sc->sc_resources.irq,INTR_TYPE_NET,
- NULL, (void(*)(void*))isicintr, sc,&ih) != 0)
- {
- printf("isic%d: Could not setup irq.\n",unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- return 0;
- }
-}
diff --git a/sys/i4b/layer1/isic/i4b_itk_ix1.c b/sys/i4b/layer1/isic/i4b_itk_ix1.c
deleted file mode 100644
index 7009bdb..0000000
--- a/sys/i4b/layer1/isic/i4b_itk_ix1.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/*-
- * Copyright (c) 1998, 1999 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 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.
- */
-
-/*---------------------------------------------------------------------------
- *
- * i4b_itk_ix1.c - ITK ix1 micro passive card driver for isdn4bsd
- * --------------------------------------------------------------
- * last edit-date: [Wed Jan 24 09:27:06 2001]
- *
- *---------------------------------------------------------------------------
- *
- * 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).
- *
- * The probe routine was derived by trial and error from a representative
- * sample of two cards ;-) The standard way (checking HSCX versions)
- * was extended by reading a zero from a non existant HSCX register (register
- * 0xff). Reading the config register gives varying results, so this doesn't
- * seem to be used as an id register (like the Teles S0/16.3).
- *
- * If the probe fails for your card use "options ITK_PROBE_DEBUG" to get
- * additional debug output.
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(ITKIX1)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-/* Register offsets */
-#define ITK_ISAC_DATA 0
-#define ITK_HSCX_DATA 1
-#define ITK_ALE 2
-#define ITK_CONFIG 3
-
-/* Size of IO range to allocate for this card */
-#define ITK_IO_SIZE 4
-
-/* Register offsets for the two HSCX channels */
-#define HSCXA 0
-#define HSCXB 0x40
-
-static void
-itkix1_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
- 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;
- }
-}
-
-static void
-itkix1_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
- 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;
- }
-}
-
-static void
-itkix1_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
- 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;
- }
-}
-
-static u_int8_t
-itkix1_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
- 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;
-}
-
-/*
- * Probe for card
- */
-int
-isic_probe_itkix1(device_t dev)
-{
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = 0; /* softc */
- void *ih = 0; /* dummy */
- bus_space_tag_t t; /* bus things */
- bus_space_handle_t h;
- u_int8_t hd, hv1, hv2, saveale;
- int ret;
-
- #if defined(ITK_PROBE_DEBUG)
- printf("Checking unit %u\n", unit);
- #endif
-
- /* check max unit range */
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for ITK IX1!\n",
- unit, unit);
- return ENXIO;
- }
-
- sc = &l1_sc[unit]; /* get pointer to softc */
- sc->sc_unit = unit; /* set unit */
-
- #if defined(ITK_PROBE_DEBUG)
- printf("Allocating io base...");
- #endif
-
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not allocate i/o port for ITK IX1.\n", unit);
- return ENXIO;
- }
-
- #if defined(ITK_PROBE_DEBUG)
- printf("done.\n");
- #endif
-
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
- t = rman_get_bustag(sc->sc_resources.io_base[0]);
- h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- #if defined(ITK_PROBE_DEBUG)
- printf("Allocating irq...");
- #endif
-
- /* get our irq */
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE)))
- {
- printf("isic%d: Could not allocate irq for ITK IX1.\n", unit);
- bus_release_resource(dev,SYS_RES_IOPORT,
- sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
- return ENXIO;
- }
-
- #if defined(ITK_PROBE_DEBUG)
- printf("done.\n");
- #endif
-
- /* get the irq number */
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
- #if defined(ITK_PROBE_DEBUG)
- printf("Setting up access routines...");
- #endif
-
- /* 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;
-
- #if defined(ITK_PROBE_DEBUG)
- printf("done.\n");
- #endif
-
- /* register interrupt routine */
-
- #if defined(ITK_PROBE_DEBUG)
- printf("Setting up access interrupt...");
- #endif
-
- if (bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, NULL,
- (void(*)(void *))(isicintr), sc, &ih) != 0)
- {
- printf("isic%d: Could not setup irq for ITK IX1.\n", unit);
- bus_release_resource(dev,SYS_RES_IOPORT,
- sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
- return ENXIO;
- }
-
- #if defined(ITK_PROBE_DEBUG)
- printf("done.\n");
-
- printf("Doing probe stuff...");
- #endif
-
- /* save old value of this port, we're stomping over it */
- saveale = bus_space_read_1(t, h, ITK_ALE);
-
- /* select invalid register */
- bus_space_write_1(t, h, ITK_ALE, 0xff);
- /* get HSCX data for this non existent register */
- hd = bus_space_read_1(t, h, ITK_HSCX_DATA);
- /* get HSCX version info */
- bus_space_write_1(t, h, ITK_ALE, HSCXA + H_VSTR);
- hv1 = bus_space_read_1(t, h, ITK_HSCX_DATA);
- bus_space_write_1(t, h, ITK_ALE, HSCXB + H_VSTR);
- hv2 = bus_space_read_1(t, h, ITK_HSCX_DATA);
-
- ret = (hd == 0) && ((hv1 & 0x0f) == 0x05) && ((hv2 & 0x0f) == 0x05);
- /* succeed if version bits are OK and we got a zero from the
- * non existent register. we found verison 0x05 and 0x04
- * out there... */
- ret = (hd == 0)
- && (((hv1 & 0x0f) == 0x05) || ((hv1 & 0x0f) == 0x04))
- && (((hv2 & 0x0f) == 0x05) || ((hv2 & 0x0f) == 0x04));
-
- /* retstore save value if we fail (if we succeed the old value
- * has no meaning) */
- if (!ret)
- bus_space_write_1(t, h, ITK_ALE, saveale);
-
- #if defined(ITK_PROBE_DEBUG)
- printf("done.\n");
-
- printf("Doing second probe stuff...");
- #endif
-
- hv1 = HSCX_READ(0, H_VSTR) & 0xf;
- hv2 = HSCX_READ(1, H_VSTR) & 0xf;
- /* Read HSCX A/B VSTR. Expected value is 0x05 (V2.1) or 0x04 (V2.0). */
- if((hv1 != 0x05 && hv1 != 0x04) || (hv2 != 0x05 && hv2 != 0x04))
- {
- printf("isic%d: HSCX VSTR test failed for ITK ix1 micro\n",
- unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- unit, HSCX_READ(1, H_VSTR));
- isic_detach_common(dev);
- return ENXIO;
- }
-
- #if defined(ITK_PROBE_DEBUG)
- printf("done.\n");
- #endif
-
-#if defined(ITK_PROBE_DEBUG)
- printf("\nITK ix1 micro probe: hscx = 0x%02x, v1 = 0x%02x, v2 = 0x%02x, would have %s\n",
- hd, hv1, hv2, ret ? "succeeded" : "failed");
- isic_detach_common(dev);
- return ENXIO;
-#else
- if ( ret )
- {
- return 0;
- }
- else
- {
- isic_detach_common(dev);
- return ENXIO;
- }
-#endif
-}
-
-/*
- * Attach card
- */
-int
-isic_attach_itkix1(device_t dev)
-{
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = &l1_sc[unit];
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- /* 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;
-
- bus_space_write_1(t, h, ITK_CONFIG, 1);
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, ITK_CONFIG, 0);
- DELAY(SEC_DELAY / 10);
-
- return 0;
-}
-
-#endif /* defined(ITKIX1) */
diff --git a/sys/i4b/layer1/isic/i4b_l1.c b/sys/i4b/layer1/isic/i4b_l1.c
deleted file mode 100644
index 5af7eda..0000000
--- a/sys/i4b/layer1/isic/i4b_l1.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * -----------------------------------
- * last edit-date: [Wed Jan 24 09:12:03 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-/*---------------------------------------------------------------------------*
- *
- * 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
- *
- *---------------------------------------------------------------------------*/
-int
-isic_ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- u_char cmd;
- int s;
- struct l1_softc *sc = &l1_sc[unit];
-
-#ifdef NOTDEF
- NDBGL1(L1_PRIM, "unit %d, freeflag=%d", unit, freeflag);
-#endif
-
- if(m == NULL) /* failsafe */
- return (0);
-
- s = SPLI4B();
-
- if(sc->sc_I430state == ST_F3) /* layer 1 not running ? */
- {
- NDBGL1(L1_I_ERR, "still in state F3!");
- isic_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 */
-
- NDBGL1(L1_I_MSG, "using 2nd ISAC TX buffer, state = %s", isic_printstate(sc));
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = L0ISICUNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
- splx(s);
- return(1);
- }
-
- NDBGL1(L1_I_ERR, "No Space in TX FIFO, state = %s", 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 = L0ISICUNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
-
- sc->sc_state |= ISAC_TX_ACTIVE; /* set transmitter busy flag */
-
- NDBGL1(L1_I_MSG, "ISAC_TX_ACTIVE set");
-
- 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
- *
- *---------------------------------------------------------------------------*/
-int
-isic_ph_activate_req(int unit)
-{
- struct l1_softc *sc = &l1_sc[unit];
- NDBGL1(L1_PRIM, "unit %d", unit);
- isic_next_state(sc, EV_PHAR);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * command from the upper layers
- *---------------------------------------------------------------------------*/
-int
-isic_mph_command_req(int unit, int command, void *parm)
-{
- struct l1_softc *sc = &l1_sc[unit];
-
- switch(command)
- {
- case CMR_DOPEN: /* daemon running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DOPEN", unit);
- sc->sc_enabled = 1;
- break;
-
- case CMR_DCLOSE: /* daemon not running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DCLOSE", unit);
- sc->sc_enabled = 0;
- break;
-
- case CMR_SETTRACE:
- NDBGL1(L1_PRIM, "unit %d, command = CMR_SETTRACE, parm = %d", unit, (unsigned int)parm);
- sc->sc_trace = (unsigned int)parm;
- break;
-
- case CMR_GCST:
- {
- struct chipstat *cst;
- NDBGL1(L1_PRIM, "unit %d, command = CMR_GCST, parm = %d", unit, (unsigned int)parm);
- cst = (struct chipstat *)parm;
- cst->driver_type = L1DRVR_ISIC;
- cst->stats.hscxstat.unit = sc->sc_unit;
- cst->stats.hscxstat.chan = cst->driver_bchannel;
- cst->stats.hscxstat.vfr = sc->sc_chan[cst->driver_bchannel].stat_VFR;
- cst->stats.hscxstat.rdo = sc->sc_chan[cst->driver_bchannel].stat_RDO;
- cst->stats.hscxstat.crc = sc->sc_chan[cst->driver_bchannel].stat_CRC;
- cst->stats.hscxstat.rab = sc->sc_chan[cst->driver_bchannel].stat_RAB;
- cst->stats.hscxstat.xdu = sc->sc_chan[cst->driver_bchannel].stat_XDU;
- cst->stats.hscxstat.rfo = sc->sc_chan[cst->driver_bchannel].stat_RFO;
- break;
- }
- default:
- NDBGL1(L1_ERROR, "ERROR, unknown command = %d, unit = %d, parm = %d", command, unit, (unsigned int)parm);
- break;
- }
-
- return(0);
-}
diff --git a/sys/i4b/layer1/isic/i4b_l1fsm.c b/sys/i4b/layer1/isic/i4b_l1fsm.c
deleted file mode 100644
index d996c9b..0000000
--- a/sys/i4b/layer1/isic/i4b_l1fsm.c
+++ /dev/null
@@ -1,506 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * --------------------------------------------------
- * last edit-date: [Wed Jan 24 09:12:18 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/include/i4b_mbuf.h>
-
-#if DO_I4B_DEBUG
-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"
-};
-#endif
-
-/* Function prototypes */
-
-static void timer3_expired (struct l1_softc *sc);
-static void T3_start (struct l1_softc *sc);
-static void T3_stop (struct l1_softc *sc);
-static void F_T3ex (struct l1_softc *sc);
-static void timer4_expired (struct l1_softc *sc);
-static void T4_start (struct l1_softc *sc);
-static void T4_stop (struct l1_softc *sc);
-static void F_AI8 (struct l1_softc *sc);
-static void F_AI10 (struct l1_softc *sc);
-static void F_I01 (struct l1_softc *sc);
-static void F_I02 (struct l1_softc *sc);
-static void F_I03 (struct l1_softc *sc);
-static void F_I2 (struct l1_softc *sc);
-static void F_ill (struct l1_softc *sc);
-static void F_NULL (struct l1_softc *sc);
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer3_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T3)
- {
- NDBGL1(L1_T_ERR, "state = %s", 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);
-
- i4b_l1_mph_status_ind(L0ISICUNIT(sc->sc_unit), STI_NOL1ACC, 0, NULL);
- }
-
- isic_next_state(sc, EV_T3);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 start
- *---------------------------------------------------------------------------*/
-static void
-T3_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", isic_printstate(sc));
- sc->sc_I430T3 = 1;
- sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 stop
- *---------------------------------------------------------------------------*/
-static void
-T3_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", isic_printstate(sc));
-
- sc->sc_init_tries = 0; /* init connect retry count */
-
- if(sc->sc_I430T3)
- {
- sc->sc_I430T3 = 0;
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_T3ex(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_T3ex executing");
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0ISICUNIT(sc->sc_unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer4_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T4)
- {
- NDBGL1(L1_T_MSG, "state = %s", isic_printstate(sc));
- sc->sc_I430T4 = 0;
- i4b_l1_mph_status_ind(L0ISICUNIT(sc->sc_unit), STI_PDEACT, 0, NULL);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 start
- *---------------------------------------------------------------------------*/
-static void
-T4_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", isic_printstate(sc));
- sc->sc_I430T4 = 1;
- sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 stop
- *---------------------------------------------------------------------------*/
-static void
-T4_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", isic_printstate(sc));
-
- if(sc->sc_I430T4)
- {
- sc->sc_I430T4 = 0;
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI8
- *---------------------------------------------------------------------------*/
-static void
-F_AI8(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI8 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0ISICUNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_8;
-
- hdr.unit = L0ISICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI10
- *---------------------------------------------------------------------------*/
-static void
-F_AI10(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI10 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0ISICUNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_10;
-
- hdr.unit = L0ISICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in states F3 .. F5
- *---------------------------------------------------------------------------*/
-static void
-F_I01(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I01 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0ISICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F6
- *---------------------------------------------------------------------------*/
-static void
-F_I02(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I02 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0ISICUNIT(sc->sc_unit));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0ISICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F7 or F8
- *---------------------------------------------------------------------------*/
-static void
-F_I03(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I03 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0ISICUNIT(sc->sc_unit));
-
- T4_start(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0ISICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: activate request
- *---------------------------------------------------------------------------*/
-static void
-F_AR(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AR executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO1_8;
-
- hdr.unit = L0ISICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_TE;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
- isic_isac_l1_cmd(sc, CMD_AR8);
-
- T3_start(sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO2
- *---------------------------------------------------------------------------*/
-static void
-F_I2(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I2 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO2;
-
- hdr.unit = L0ISICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
-}
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(struct l1_softc *sc)
-{
- NDBGL1(L1_F_ERR, "FSM function F_ill executing");
-}
-
-/*---------------------------------------------------------------------------*
- * No action
- *---------------------------------------------------------------------------*/
-static void
-F_NULL(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_NULL executing");
-}
-
-
-/*---------------------------------------------------------------------------*
- * layer 1 state transition table
- *---------------------------------------------------------------------------*/
-struct isic_state_tab {
- void (*func) (struct l1_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 l1_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");
-
- NDBGL1(L1_F_MSG, "FSM event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[newstate]);
-
- (*isic_state_tab[event][currstate].func)(sc);
-
- if(newstate == ST_ILL)
- {
- newstate = ST_F3;
- NDBGL1(L1_F_ERR, "FSM Illegal State ERROR, oldstate = %s, newstate = %s, event = %s!",
- state_text[currstate],
- state_text[newstate],
- event_text[event]);
- }
-
- sc->sc_I430state = newstate;
-}
-
-#if DO_I4B_DEBUG
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-isic_printstate(struct l1_softc *sc)
-{
- return((char *) state_text[sc->sc_I430state]);
-}
-#endif
diff --git a/sys/i4b/layer1/isic/i4b_siemens_isurf.c b/sys/i4b/layer1/isic/i4b_siemens_isurf.c
deleted file mode 100644
index 1a84566..0000000
--- a/sys/i4b/layer1/isic/i4b_siemens_isurf.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Udo Schweigert. 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.
- */
-
-/*---------------------------------------------------------------------------
- *
- * Siemens I-Surf 2.0 PnP specific routines for isic driver
- * --------------------------------------------------------
- * Based on ELSA Quickstep 1000pro PCI driver (i4b_elsa_qs1p.c)
- * In case of trouble please contact Udo Schweigert <ust@cert.siemens.de>
- *
- * last edit-date: [Wed Jan 24 09:13:25 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(SIEMENS_ISURF2)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_ipac.h>
-
-/* masks for register encoded in base addr */
-
-#define SIE_ISURF_BASE_MASK 0x0ffff
-#define SIE_ISURF_OFF_MASK 0xf0000
-
-/* register id's to be encoded in base addr */
-
-#define SIE_ISURF_IDISAC 0x00000
-#define SIE_ISURF_IDHSCXA 0x10000
-#define SIE_ISURF_IDHSCXB 0x20000
-#define SIE_ISURF_IDIPAC 0x40000
-
-/* offsets from base address */
-
-#define SIE_ISURF_OFF_ALE 0x00
-#define SIE_ISURF_OFF_RW 0x01
-
-/*---------------------------------------------------------------------------*
- * Siemens I-Surf 2.0 PnP ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-static void
-siemens_isurf_read_fifo(struct l1_softc *sc,int what,void *buf,size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,IPAC_ISAC_OFF);
- bus_space_read_multi_1(t,h,SIE_ISURF_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,IPAC_HSCXA_OFF);
- bus_space_read_multi_1(t,h,SIE_ISURF_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,IPAC_HSCXB_OFF);
- bus_space_read_multi_1(t,h,SIE_ISURF_OFF_RW,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Siemens I-Surf 2.0 PnP ISAC put fifo routine
- *---------------------------------------------------------------------------*/
-static void
-siemens_isurf_write_fifo(struct l1_softc *sc,int what,void *buf,size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,IPAC_ISAC_OFF);
- bus_space_write_multi_1(t,h,SIE_ISURF_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,IPAC_HSCXA_OFF);
- bus_space_write_multi_1(t,h,SIE_ISURF_OFF_RW,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,IPAC_HSCXB_OFF);
- bus_space_write_multi_1(t,h,SIE_ISURF_OFF_RW,buf,size);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Siemens I-Surf 2.0 PnP ISAC put register routine
- *---------------------------------------------------------------------------*/
-static void
-siemens_isurf_write_reg(struct l1_softc *sc,int what,bus_size_t reg,u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,reg+IPAC_ISAC_OFF);
- bus_space_write_1(t,h,SIE_ISURF_OFF_RW,data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,reg+IPAC_HSCXA_OFF);
- bus_space_write_1(t,h,SIE_ISURF_OFF_RW,data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,reg+IPAC_HSCXB_OFF);
- bus_space_write_1(t,h,SIE_ISURF_OFF_RW,data);
- break;
- case ISIC_WHAT_IPAC:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,reg+IPAC_IPAC_OFF);
- bus_space_write_1(t,h,SIE_ISURF_OFF_RW,data);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Siemens I-Surf 2.0 PnP ISAC get register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-siemens_isurf_read_reg(struct l1_softc *sc,int what,bus_size_t reg)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what )
- {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,reg+IPAC_ISAC_OFF);
- return bus_space_read_1(t,h,SIE_ISURF_OFF_RW);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,reg+IPAC_HSCXA_OFF);
- return bus_space_read_1(t,h,SIE_ISURF_OFF_RW);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,reg+IPAC_HSCXB_OFF);
- return bus_space_read_1(t,h,SIE_ISURF_OFF_RW);
- case ISIC_WHAT_IPAC:
- bus_space_write_1(t,h,SIE_ISURF_OFF_ALE,reg+IPAC_IPAC_OFF);
- return bus_space_read_1(t,h,SIE_ISURF_OFF_RW);
- default:
- return 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_siemens_isurf - attach for Siemens I-Surf 2.0 PnP
- *---------------------------------------------------------------------------*/
-int
-isic_attach_siemens_isurf(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = siemens_isurf_read_reg;
- sc->writereg = siemens_isurf_write_reg;
-
- sc->readfifo = siemens_isurf_read_fifo;
- sc->writefifo = siemens_isurf_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_SIE_ISURF2;
-
- /* 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 */
-
- return(0);
-}
-#endif /* defined(SIEMENS_ISURF2) */
diff --git a/sys/i4b/layer1/isic/i4b_sws.c b/sys/i4b/layer1/isic/i4b_sws.c
deleted file mode 100644
index 6f73f90..0000000
--- a/sys/i4b/layer1/isic/i4b_sws.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*-
- * Copyright (c) 1998, 2000 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
- * ====================================================
- * last edit-date: [Wed Jan 24 08:58:57 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined (SEDLBAUER)
-
-#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 */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-/*---------------------------------------------------------------------------*
- * SWS P&P ISAC get fifo routine
- *---------------------------------------------------------------------------*/
-static void
-sws_read_fifo(struct l1_softc *sc,int what,void *buf,size_t size) {
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what ) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,SWS_RW,0x0);
- bus_space_read_multi_1(t,h,SWS_ISAC,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,SWS_RW,0x0);
- bus_space_read_multi_1(t,h,SWS_HSCX0,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,SWS_RW,0x0+0x40);
- bus_space_read_multi_1(t,h,SWS_HSCX0,buf,size);
- break;
- }
-}
-
-static void
-sws_write_fifo(struct l1_softc *sc,int what,void *buf,size_t size) {
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what ) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,SWS_RW,0x0);
- bus_space_write_multi_1(t,h,SWS_ISAC,buf,size);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,SWS_RW,0x0);
- bus_space_write_multi_1(t,h,SWS_HSCX0,buf,size);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,SWS_RW,0x0+0x40);
- bus_space_write_multi_1(t,h,SWS_HSCX0,buf,size);
- break;
- }
-}
-
-static void
-sws_write_reg(struct l1_softc *sc,int what,bus_size_t reg,u_int8_t data) {
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what ) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,SWS_RW,reg);
- bus_space_write_1(t,h,SWS_ISAC,data);
- break;
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,SWS_RW,reg);
- bus_space_write_1(t,h,SWS_HSCX0,data);
- break;
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,SWS_RW,reg+0x40);
- bus_space_write_1(t,h,SWS_HSCX0,data);
- break;
- }
-}
-
-static u_char
-sws_read_reg (struct l1_softc *sc,int what,bus_size_t reg) {
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- switch ( what ) {
- case ISIC_WHAT_ISAC:
- bus_space_write_1(t,h,SWS_RW,reg);
- return bus_space_read_1(t,h,SWS_ISAC);
- case ISIC_WHAT_HSCXA:
- bus_space_write_1(t,h,SWS_RW,reg);
- return bus_space_read_1(t,h,SWS_HSCX0);
- case ISIC_WHAT_HSCXB:
- bus_space_write_1(t,h,SWS_RW,reg+0x40);
- return bus_space_read_1(t,h,SWS_HSCX0);
- default:
- return 0;
- }
-}
-
-/* attach callback routine */
-int
-isic_attach_sws(device_t dev)
-{
- int unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
-
- struct i4b_info * info = &(sc->sc_resources);
- bus_space_tag_t t = rman_get_bustag(info->io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(info->io_base[0]);
-
- /* fill in l1_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_cardtyp = CARD_TYPEP_SWS;
- 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("isic%d: HSCX VSTR test failed for SWS PnP\n",
- sc->sc_unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- sc->sc_unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- sc->sc_unit, HSCX_READ(1, H_VSTR));
- return (ENXIO);
- }
-
- /* reset card */
- bus_space_write_1(t,h,SWS_RESON,0x3);
- DELAY(SEC_DELAY / 5);
- bus_space_write_1(t,h,SWS_RESOFF,0x0);
- DELAY(SEC_DELAY / 5);
-
- return(0);
-}
-#endif /* defined(SEDLBAUER) */
diff --git a/sys/i4b/layer1/isic/i4b_tel_s016.c b/sys/i4b/layer1/isic/i4b_tel_s016.c
deleted file mode 100644
index 6ffa732..0000000
--- a/sys/i4b/layer1/isic/i4b_tel_s016.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/*-
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- * Copyright (c) 1997, 2001 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
- * =================================================================
- * last edit-date: [Wed Jan 24 09:27:24 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(TEL_S0_16)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <machine/md_var.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#define TELES_S016_MEMSIZE 0x1000
-
-static u_char intr_no[] = { 1, 1, 0, 2, 4, 6, 1, 1, 1, 0, 8, 10, 12, 1, 1, 14 };
-static const bus_size_t offset[] = { 0x100, 0x180, 0x1c0 };
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 write register routine
- *---------------------------------------------------------------------------*/
-static void
-tels016_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
-
- offs += offset[what];
-
- if (offs & 0x01)
- offs |= 0x200;
-
- bus_space_write_1(t, h, offs, data);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 read register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-tels016_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
-
- offs += offset[what];
-
- if(offs & 0x01)
- offs |= 0x200;
-
- return bus_space_read_1(t, h, offs);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 fifo write routine
- *---------------------------------------------------------------------------*/
-static void
-tels016_write_fifo(struct l1_softc *sc, int what, void *data, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
- bus_space_write_region_1(t, h, offset[what], data, size);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16 fifo read routine
- *---------------------------------------------------------------------------*/
-static void
-tels016_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
- bus_space_read_region_1(t, h, offset[what], buf, size);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s016 - probe for Teles S0/16 and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_probe_s016(device_t dev)
-{
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = 0; /* softc */
- void *ih = 0; /* dummy */
- u_int8_t b0,b1,b2; /* for signature */
- bus_space_tag_t t; /* bus things */
- bus_space_handle_t h;
-
- /* check max unit range */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/16!\n",
- unit, unit);
- return(ENXIO);
- }
-
- sc = &l1_sc[unit]; /* get pointer to softc */
- sc->sc_unit = unit; /* set unit */
-
- /* see if an io base was supplied */
-
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not allocate i/o port for Teles S0/16.\n", unit);
- return(ENXIO);
- }
-
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
-
- /*
- * check if the provided io port is valid
- */
-
- switch(sc->sc_port)
- {
- case 0xd80:
- case 0xe80:
- case 0xf80:
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Teles S0/16!\n",
- unit, sc->sc_port);
- isic_detach_common(dev);
- return(ENXIO);
- break;
- }
-
- /* allocate memory resource */
-
- if(!(sc->sc_resources.mem =
- bus_alloc_resource(dev, SYS_RES_MEMORY,
- &sc->sc_resources.mem_rid,
- 0ul, ~0ul, TELES_S016_MEMSIZE,
- RF_ACTIVE)))
- {
- printf("isic%d: Could not allocate memory for Teles S0/16.\n", unit);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- /*
- * get virtual addr.
- */
- sc->sc_vmem_addr = rman_get_virtual(sc->sc_resources.mem);
-
- /*
- * check for valid adresses
- */
- switch(kvtop(sc->sc_vmem_addr))
- {
- 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 memory address 0x%x for Teles S0/16!\n",
- unit, kvtop(sc->sc_vmem_addr));
- isic_detach_common(dev);
- return(ENXIO);
- break;
- }
-
- /* setup ISAC 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;
-
- /* setup ISAC base addr, though we don't really need it */
-
- ISAC_BASE = (caddr_t)((sc->sc_vmem_addr) + 0x100);
-
- /* setup HSCX base addr */
-
- HSCX_A_BASE = (caddr_t)((sc->sc_vmem_addr) + 0x180);
- HSCX_B_BASE = (caddr_t)((sc->sc_vmem_addr) + 0x1c0);
-
- t = rman_get_bustag(sc->sc_resources.io_base[0]);
- h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- /* get signature bytes */
- b0 = bus_space_read_1(t, h, 0);
- b1 = bus_space_read_1(t, h, 1);
- b2 = bus_space_read_1(t, h, 2);
-
- /* check signature bytes */
- if(b0 != 0x51)
- {
- printf("isic%d: Error, signature 1 0x%x != 0x51 for Teles S0/16!\n",
- unit, b0);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- if(b1 != 0x93)
- {
- printf("isic%d: Error, signature 2 0x%x != 0x93 for Teles S0/16!\n",
- unit, b1);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- if((b2 != 0x1e) && (b2 != 0x1f))
- {
- printf("isic%d: Error, signature 3 0x%x != 0x1e or 0x1f for Teles S0/16!\n",
- unit, b2);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- /* get our irq */
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE)))
- {
- printf("isic%d: Could not allocate irq for Teles S0/16.\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* register interrupt routine */
-
- if (bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, NULL,
- (void(*)(void *))(isicintr), sc, &ih) != 0)
- {
- printf("isic%d: Could not setup irq for Teles S0/16.\n", unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* get the irq number */
-
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
- /* check IRQ validity */
-
- if((intr_no[sc->sc_irq]) == 1)
- {
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16!\n",
- unit, sc->sc_irq);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s016 - attach Teles S0/16 and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_attach_s016(device_t dev)
-{
- struct l1_softc *sc = &l1_sc[device_get_unit(dev)];
- u_long irq;
-
- bus_space_tag_t ta = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t ha = rman_get_bushandle(sc->sc_resources.mem);
- bus_space_tag_t tb = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t hb = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- /* is this right for FreeBSD or off by one ? */
- irq = intr_no[sc->sc_irq];
-
- /* configure IRQ */
-
- irq |= ((u_long) sc->sc_vmem_addr) >> 9;
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(tb, hb, 4, irq);
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(tb, hb, 4, irq | 0x01);
-
- DELAY(SEC_DELAY / 5);
-
- /* set card bit off */
-
- bus_space_write_1(ta, ha, 0x80, 0);
- DELAY(SEC_DELAY / 5);
-
- /* set card bit on */
-
- bus_space_write_1(ta, ha, 0x80, 1);
- DELAY(SEC_DELAY / 5);
-
- return 0;
-}
-
-#endif /* defined(TEL_S0_16) */
diff --git a/sys/i4b/layer1/isic/i4b_tel_s0163.c b/sys/i4b/layer1/isic/i4b_tel_s0163.c
deleted file mode 100644
index 01d274b..0000000
--- a/sys/i4b/layer1/isic/i4b_tel_s0163.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/*-
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- * Copyright (c) 1997, 2001 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
- * ========================================================
- * last edit-date: [Wed Jan 24 09:27:40 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(TEL_S0_16_3)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-static u_char intr_no[] = { 1, 1, 0, 2, 4, 6, 1, 1, 1, 0, 8, 10, 12, 1, 1, 14 };
-
-#define ISAC_OFFS 0x400
-#define HSCXA_OFFS 0xc00
-#define HSCXB_OFFS 0x800
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-tels0163_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- bus_space_read_multi_1(t,h,0x1e,buf,size);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-tels0163_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- bus_space_write_multi_1(t,h,0x1e,buf,size);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 ISAC put register routine
- *---------------------------------------------------------------------------*/
-static void
-tels0163_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- bus_space_write_1(t,h,offs - 0x20,data);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/16.3 ISAC get register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-tels0163_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- return bus_space_read_1(t,h,offs - 0x20);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s0163 - probe routine for Teles S0/16.3
- *---------------------------------------------------------------------------*/
-int
-isic_probe_s0163(device_t dev)
-{
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = 0; /* pointer to softc */
- void *ih = 0; /* dummy */
- bus_space_tag_t t; /* bus things */
- bus_space_handle_t h;
- u_int8_t b0,b1,b2; /* signature */
-
- /* check max unit range */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles 16.3!\n",
- unit, unit);
- return(ENXIO);
- }
-
- sc = &l1_sc[unit]; /* get pointer to softc */
- sc->sc_unit = unit; /* set unit */
-
- /* see if an io base was supplied */
-
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get iobase for Teles S0/16.3.\n",
- unit);
- return(ENXIO);
- }
-
- /* set io base */
-
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
- /* Release the resource - re-allocate later with correct size */
- bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
-
- switch(sc->sc_port)
- {
- case 0xd80:
- case 0xe80:
- case 0xf80:
- break;
-
- case 0x180:
- case 0x280:
- case 0x380:
- printf("isic%d: Error, instead of using iobase 0x%x for your Teles S0/16.3,\n",
- unit, sc->sc_port);
- printf("isic%d: please use 0x%x in the kernel configuration file!\n",
- unit, sc->sc_port+0xc00);
- isic_detach_common(dev);
- return(ENXIO);
- break;
-
- default:
- printf("isic%d: Error, invalid iobase 0x%x specified for Teles S0/16.3!\n",
- unit, sc->sc_port);
- isic_detach_common(dev);
- return(ENXIO);
- break;
- }
-
- /* set io port resources */
-
- sc->sc_resources.io_rid[0] = 0;
- bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port, 0x20);
- sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE);
- if(!sc->sc_resources.io_base[0])
- {
- printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n",
- unit, sc->sc_port);
- isic_detach_common(dev);
- return ENXIO;
- }
- sc->sc_resources.io_rid[1] = 1;
- bus_set_resource(dev, SYS_RES_IOPORT, 1,
- sc->sc_port-ISAC_OFFS, 0x20);
- sc->sc_resources.io_base[1] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[1],
- RF_ACTIVE);
- if(!sc->sc_resources.io_base[1])
- {
- printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n",
- unit, sc->sc_port-ISAC_OFFS);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- sc->sc_resources.io_rid[2] = 2;
- bus_set_resource(dev, SYS_RES_IOPORT, 2,
- sc->sc_port-HSCXA_OFFS, 0x20);
- sc->sc_resources.io_base[2] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[2],
- RF_ACTIVE);
- if(!sc->sc_resources.io_base[2])
- {
- printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n",
- unit, sc->sc_port-HSCXA_OFFS);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- sc->sc_resources.io_rid[3] = 3;
- bus_set_resource(dev, SYS_RES_IOPORT, 3,
- sc->sc_port-HSCXB_OFFS, 0x20);
- sc->sc_resources.io_base[3] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[3],
- RF_ACTIVE);
- if(!sc->sc_resources.io_base[3])
- {
- printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n",
- unit, sc->sc_port-HSCXB_OFFS);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* 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;
-
- t = rman_get_bustag(sc->sc_resources.io_base[0]);
- h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- 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 && b0 != 0x10 ) {
- printf("isic%d: Error, signature 1 0x%x != 0x51 or 0x10 for Teles S0/16.3!\n",
- unit, b0);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- if ( b1 != 0x93 ) {
- printf("isic%d: Error, signature 2 0x%x != 0x93 for Teles S0/16.3!\n",
- unit, b1);
- isic_detach_common(dev);
- return ENXIO;
- }
- if (( b2 != 0x1c ) && ( b2 != 0x1f )) {
- printf("isic%d: Error, signature 3 0x%x != (0x1c || 0x1f) for Teles S0/16.3!\n",
- unit, b2);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /*
- * 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",
- unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- unit, HSCX_READ(1, H_VSTR));
- isic_detach_common(dev);
- return (ENXIO);
- }
-
- /* get our irq */
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get IRQ for Teles S0/16.3.\n",unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* get the irq number */
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
- switch(sc->sc_irq)
- {
- case 2:
- case 9:
- case 5:
- case 10:
- case 12:
- case 15:
- break;
-
- default:
- printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16.3!\n",
- unit, sc->sc_irq);
- isic_detach_common(dev);
- return(ENXIO);
- break;
- }
-
- /* register interrupt routine */
- if (bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET, NULL,
- (void(*)(void *))(isicintr), sc, &ih) != 0)
- {
- printf("isic%d: Could not setup IRQ for Teles S0/16.3.\n",unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s0163 - attach Teles S0/16.3 and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_attach_s0163(device_t dev)
-{
- unsigned int unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = &l1_sc[unit];
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[0]);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[0]);
-
- /* configure IRQ */
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 4, intr_no[sc->sc_irq]);
-
- DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 4, intr_no[sc->sc_irq] | 0x01);
-
- return (0);
-}
-
-#endif /* defined(TEL_S0_16_3) */
diff --git a/sys/i4b/layer1/isic/i4b_tel_s08.c b/sys/i4b/layer1/isic/i4b_tel_s08.c
deleted file mode 100644
index 3ca0f2c..0000000
--- a/sys/i4b/layer1/isic/i4b_tel_s08.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*-
- * Copyright (c) 1996 Arne Helme. All rights reserved.
- * Copyright (c) 1996 Gary Jennejohn. All rights reserved.
- * Copyright (c) 1997, 2001 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
- * ================================================================
- * last edit-date: [Wed Jan 24 09:27:58 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(TEL_S0_8)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <machine/md_var.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#define TELES_S08_MEMSIZE 0x1000
-
-static const bus_size_t offset[] = { 0x100, 0x180, 0x1c0 };
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 write register routine
- *---------------------------------------------------------------------------*/
-static void
-tels08_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
-
- offs += offset[what];
-
- if (offs & 0x01)
- offs |= 0x200;
-
- bus_space_write_1(t, h, offs, data);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 read register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-tels08_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
-
- offs += offset[what];
-
- if (offs & 0x01)
- offs |= 0x200;
-
- return bus_space_read_1(t, h, offs);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 fifo write access
- *---------------------------------------------------------------------------*/
-static void
-tels08_write_fifo(struct l1_softc *sc, int what, void *data, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
- bus_space_write_region_1(t, h, offset[what], data, size);
-}
-
-/*---------------------------------------------------------------------------*
- * Teles S0/8 fifo read access
- *---------------------------------------------------------------------------*/
-static void
-tels08_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
- bus_space_read_region_1(t, h, offset[what], buf, size);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_s08 - probe for Teles S0/8 and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_probe_s08(device_t dev)
-{
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = 0; /* pointer to softc */
- void *ih = 0; /* dummy */
-
- /* check max unit range */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/8!\n",
- unit, unit);
- return(ENXIO);
- }
-
- sc = &l1_sc[unit]; /* get pointer to softc */
- sc->sc_unit = unit; /* set unit */
-
- /* see if an io base was supplied */
-
- if((sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- /* the S0/8 is completely memory mapped ! */
-
- bus_release_resource(dev,SYS_RES_IOPORT,
- sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
- printf("isic%d: Error, iobase specified for Teles S0/8!\n", unit);
- return(ENXIO);
- }
-
- /* allocate memory */
-
- if(!(sc->sc_resources.mem =
- bus_alloc_resource(dev, SYS_RES_MEMORY,
- &sc->sc_resources.mem_rid,
- 0ul, ~0ul, TELES_S08_MEMSIZE, RF_ACTIVE)))
- {
- printf("isic%d: Could not allocate memory for Teles S0/8!\n", unit);
- return(ENXIO);
- }
-
- /*
- * get virtual addr. it's just needed to see if it is in
- * the valid range
- */
-
- sc->sc_vmem_addr = rman_get_virtual(sc->sc_resources.mem);
-
- /* check if inside memory range of 0xA0000 .. 0xDF000 */
-
- if((kvtop(sc->sc_vmem_addr) < 0xa0000) ||
- (kvtop(sc->sc_vmem_addr) > 0xdf000))
- {
- printf("isic%d: Error, mem addr 0x%x outside 0xA0000-0xDF000 for Teles S0/8!\n",
- unit, kvtop(sc->sc_vmem_addr));
- bus_release_resource(dev,SYS_RES_MEMORY,
- sc->sc_resources.mem_rid,
- sc->sc_resources.mem);
- sc->sc_resources.mem = 0;
- return(ENXIO);
- }
-
- /* 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;
-
- sc->sc_cardtyp = CARD_TYPEP_8; /* setup card type */
-
- sc->sc_bustyp = BUS_TYPE_IOM1; /* setup IOM bus type */
-
- sc->sc_ipac = 0;
- sc->sc_bfifolen = HSCX_FIFO_LEN;
-
- /* setup ISAC base addr, though we don't really need it */
-
- ISAC_BASE = (caddr_t)((sc->sc_vmem_addr) + 0x100);
-
- /* setup HSCX base addr */
-
- HSCX_A_BASE = (caddr_t)((sc->sc_vmem_addr) + 0x180);
- HSCX_B_BASE = (caddr_t)((sc->sc_vmem_addr) + 0x1c0);
-
- /* allocate our irq */
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE)))
- {
- printf("isic%d: Could not allocate irq for Teles S0/8!\n",unit);
-
- bus_release_resource(dev,SYS_RES_MEMORY,
- sc->sc_resources.mem_rid,
- sc->sc_resources.mem);
-
- sc->sc_resources.mem = 0;
- return ENXIO;
- }
-
- /* get the irq number */
-
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
- /* check IRQ validity */
-
- switch(sc->sc_irq)
- {
- 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",
- unit, sc->sc_irq);
- bus_release_resource(dev,SYS_RES_IRQ,
- sc->sc_resources.irq_rid,
- sc->sc_resources.irq);
- sc->sc_resources.irq = 0;
- bus_release_resource(dev,SYS_RES_MEMORY,
- sc->sc_resources.mem_rid,
- sc->sc_resources.mem);
- sc->sc_resources.mem = 0;
- return(ENXIO);
- break;
- }
-
- /* register interrupt routine */
-
- bus_setup_intr(dev, sc->sc_resources.irq,
- INTR_TYPE_NET,
- NULL, (void(*)(void *))(isicintr),
- sc, &ih);
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_s08 - attach Teles S0/8 and compatibles
- *---------------------------------------------------------------------------*/
-int
-isic_attach_s08(device_t dev)
-{
- struct l1_softc *sc = &l1_sc[device_get_unit(dev)];
- bus_space_tag_t t = rman_get_bustag(sc->sc_resources.mem);
- bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.mem);
-
- /* set card off */
-
- bus_space_write_1(t, h, 0x80, 0);
-
- DELAY(SEC_DELAY / 5);
-
- /* set card on */
-
- bus_space_write_1(t, h, 0x80, 1);
-
- DELAY(SEC_DELAY / 5);
-
- return 0;
-}
-
-#endif /* defined(TEL_S0_8) */
diff --git a/sys/i4b/layer1/isic/i4b_usr_sti.c b/sys/i4b/layer1/isic/i4b_usr_sti.c
deleted file mode 100644
index cbdfbc9..0000000
--- a/sys/i4b/layer1/isic/i4b_usr_sti.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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)
- * -------------------------------------------------------------
- * last edit-date: [Wed Jan 24 09:28:12 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#if defined(USR_STI)
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/bus.h>
-#include <machine/bus.h>
-#include <sys/rman.h>
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_hscx.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 };
-
-#define ADDR(reg) \
- (((reg/4) * 1024) + ((reg%4) * 2))
-
-#ifdef USRTA_DEBUG_PORTACCESS
-int debugcntr;
-#define USRTA_DEBUG(fmt) \
- if (++debugcntr < 1000) printf fmt;
-#else
-#define USRTA_DEBUG(fmt)
-#endif
-
-/*---------------------------------------------------------------------------*
- * USRobotics read fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- register int offset = 0;
- register unsigned int base = 0;
-
-USRTA_DEBUG(("usrtai_read_fifo: what %d size %d\n", what, size))
- switch (what)
- {
- case ISIC_WHAT_ISAC:
- base = (unsigned int)ISAC_BASE;
- break;
- case ISIC_WHAT_HSCXA:
- base = (unsigned int)HSCX_A_BASE;
- break;
- case ISIC_WHAT_HSCXB:
- base = (unsigned int)HSCX_B_BASE;
- break;
- default:
- printf("usrtai_read_fifo: invalid what %d\n", what);
- return;
- }
-
- for(;size > 0; size--, offset++)
- {
- *((u_char *)buf + offset) = inb(base + ADDR(offset));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write fifo routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_fifo(struct l1_softc *sc, int what, void *data, size_t size)
-{
- register int offset = 0;
- register unsigned int base = 0;
-
-USRTA_DEBUG(("usrtai_write_fifo: what %d size %d\n", what, size))
- switch (what)
- {
- case ISIC_WHAT_ISAC:
- base = (unsigned int)ISAC_BASE;
- break;
- case ISIC_WHAT_HSCXA:
- base = (unsigned int)HSCX_A_BASE;
- break;
- case ISIC_WHAT_HSCXB:
- base = (unsigned int)HSCX_B_BASE;
- break;
- default:
- printf("usrtai_write_fifo: invalid what %d\n", what);
- return;
- }
-
-
- for(;size > 0; size--, offset++)
- {
- outb(base + ADDR(offset), *((u_char *)data + offset));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics write register routine
- *---------------------------------------------------------------------------*/
-static void
-usrtai_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- register unsigned int base = 0;
-
-USRTA_DEBUG(("usrtai_write_reg: what %d ADDR(%d) %d data %#x\n", what, offs, ADDR(offs), data))
- switch (what)
- {
- case ISIC_WHAT_ISAC:
- base = (unsigned int)ISAC_BASE;
- break;
- case ISIC_WHAT_HSCXA:
- base = (unsigned int)HSCX_A_BASE;
- break;
- case ISIC_WHAT_HSCXB:
- base = (unsigned int)HSCX_B_BASE;
- break;
- default:
- printf("usrtai_write_reg invalid what %d\n", what);
- return;
- }
-
- outb(base + ADDR(offs), (u_char)data);
-}
-
-/*---------------------------------------------------------------------------*
- * USRobotics read register routine
- *---------------------------------------------------------------------------*/
-static u_int8_t
-usrtai_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- register unsigned int base = 0;
- u_int8_t byte;
-
-USRTA_DEBUG(("usrtai_read_reg: what %d ADDR(%d) %d..", what, offs, ADDR(offs)))
- switch (what)
- {
- case ISIC_WHAT_ISAC:
- base = (unsigned int)ISAC_BASE;
- break;
- case ISIC_WHAT_HSCXA:
- base = (unsigned int)HSCX_A_BASE;
- break;
- case ISIC_WHAT_HSCXB:
- base = (unsigned int)HSCX_B_BASE;
- break;
- default:
- printf("usrtai_read_reg: invalid what %d\n", what);
- return(0);
- }
-
- byte = inb(base + ADDR(offs));
-USRTA_DEBUG(("usrtai_read_reg: got %#x\n", byte))
- return(byte);
-}
-
-/*---------------------------------------------------------------------------*
- * allocate an io port - based on code in isa_isic.c
- *---------------------------------------------------------------------------*/
-static int
-usrtai_alloc_port(device_t dev)
-{
- size_t unit = device_get_unit(dev);
- struct l1_softc *sc = &l1_sc[unit];
- int i, num = 0;
- bus_size_t base;
-
- /* 49 io mappings: 1 config and 48x8 registers */
-
- /* config at offset 0x8000 */
- base = sc->sc_port + 0x8000;
- if (base < 0 || base > 0x0ffff)
- return 1;
- sc->sc_resources.io_rid[num] = num;
-
- bus_set_resource(dev, SYS_RES_IOPORT, num, base, 1);
-
- if(!(sc->sc_resources.io_base[num] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[num],
- RF_ACTIVE)))
- {
- printf("isic%d: Error, failed to reserve io #%dport %#x!\n", unit, num, base);
- isic_detach_common(dev);
- return(ENXIO);
- }
- num++;
-
- /* HSCX A at offset 0 */
- base = sc->sc_port;
- for (i = 0; i < 16; i++) {
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- sc->sc_resources.io_rid[num] = num;
-
- bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8);
-
- if(!(sc->sc_resources.io_base[num] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[num],
- RF_ACTIVE)))
- {
- printf("isic%d: Error, failed to reserve io #%d port %#x!\n", unit, num, base+i*1024);
- isic_detach_common(dev);
- return(ENXIO);
- }
- ++num;
- }
-
- /* HSCX B at offset 0x4000 */
- base = sc->sc_port + 0x4000;
- for (i = 0; i < 16; i++) {
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- sc->sc_resources.io_rid[num] = num;
-
- bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8);
-
- if(!(sc->sc_resources.io_base[num] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[num],
- RF_ACTIVE)))
- {
- printf("isic%d: Error, failed to reserve io #%d port %#x!\n", unit, num, base+i*1024);
- isic_detach_common(dev);
- return(ENXIO);
- }
- ++num;
- }
-
- /* ISAC at offset 0xc000 */
- base = sc->sc_port + 0xc000;
- for (i = 0; i < 16; i++) {
- if (base+i*1024 < 0 || base+i*1024+8 > 0x0ffff)
- return 1;
- sc->sc_resources.io_rid[num] = num;
-
- bus_set_resource(dev, SYS_RES_IOPORT, num, base+i*1024, 8);
-
- if(!(sc->sc_resources.io_base[num] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[num],
- RF_ACTIVE)))
- {
- printf("isic%d: Error, failed to reserve io #%d port %#x!\n", unit, num, base+i*1024);
- isic_detach_common(dev);
- return(ENXIO);
- }
- ++num;
- }
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_probe_usrtai - probe for USR
- *---------------------------------------------------------------------------*/
-int
-isic_probe_usrtai(device_t dev)
-{
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = 0; /* pointer to softc */
- void *ih = 0; /* dummy */
-
- /* check max unit range */
-
- if(unit >= ISIC_MAXUNIT)
- {
- printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for USR Sportster TA!\n",
- unit, unit);
- return(ENXIO);
- }
-
- sc = &l1_sc[unit]; /* get pointer to softc */
- sc->sc_unit = unit; /* set unit */
-
- /* see if an io base was supplied */
-
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get iobase for USR Sportster TA!\n",
- unit);
- return(ENXIO);
- }
-
- /* set io base */
-
- sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
-
- /* release io base */
-
- bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[0],
- sc->sc_resources.io_base[0]);
-
-
- /* check if we got an iobase */
-
- switch(sc->sc_port)
- {
- 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",
- unit, sc->sc_port);
- return(0);
- break;
- }
-
- /* allocate all the ports needed */
-
- if(usrtai_alloc_port(dev))
- {
- printf("isic%d: Could not get the ports for USR Sportster TA!\n", unit);
- isic_detach_common(dev);
- return(ENXIO);
- }
-
- /* get our irq */
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_ACTIVE)))
- {
- printf("isic%d: Could not get an irq for USR Sportster TA!\n",unit);
- isic_detach_common(dev);
- return ENXIO;
- }
-
- /* get the irq number */
- sc->sc_irq = rman_get_start(sc->sc_resources.irq);
-
- /* register interrupt routine */
- bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET,
- NULL, (void(*)(void *))(isicintr),
- sc, &ih);
-
- /* check IRQ validity */
-
- if(intr_no[sc->sc_irq] == 0)
- {
- printf("isic%d: Error, invalid IRQ [%d] specified for USR Sportster TA!\n",
- unit, sc->sc_irq);
- return(1);
- }
-
- /* 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)sc->sc_port + USR_ISAC_OFF;
- HSCX_A_BASE = (caddr_t)sc->sc_port + USR_HSCXA_OFF;
- HSCX_B_BASE = (caddr_t)sc->sc_port + 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",
- unit);
- printf("isic%d: HSC0: VSTR: %#x\n",
- unit, HSCX_READ(0, H_VSTR));
- printf("isic%d: HSC1: VSTR: %#x\n",
- unit, HSCX_READ(1, H_VSTR));
- return (1);
- }
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * isic_attach_usrtai - attach USR
- *---------------------------------------------------------------------------*/
-int
-isic_attach_usrtai(device_t dev)
-{
- u_char irq = 0;
- size_t unit = device_get_unit(dev); /* get unit */
- struct l1_softc *sc = 0; /* pointer to softc */
-
- sc = &l1_sc[unit]; /* get pointer to softc */
-
- /* reset the HSCX and ISAC chips */
-
- outb(sc->sc_port + USR_INTL_OFF, USR_RES_BIT);
- DELAY(SEC_DELAY / 10);
-
- outb(sc->sc_port + USR_INTL_OFF, 0x00);
- DELAY(SEC_DELAY / 10);
-
- /* setup IRQ */
-
- if((irq = intr_no[sc->sc_irq]) == 0)
- {
- printf("isic%d: Attach error, invalid IRQ [%d] specified for USR Sportster TA!\n",
- unit, sc->sc_irq);
- return(1);
- }
-
- /* configure and enable irq */
-
- outb(sc->sc_port + USR_INTL_OFF, irq | USR_INTE_BIT);
- DELAY(SEC_DELAY / 10);
-
- return (0);
-}
-
-#endif /* defined(USR_STI) */
diff --git a/sys/i4b/layer1/itjc/i4b_hdlc.h b/sys/i4b/layer1/itjc/i4b_hdlc.h
deleted file mode 100644
index 09c8ddd..0000000
--- a/sys/i4b/layer1/itjc/i4b_hdlc.h
+++ /dev/null
@@ -1,319 +0,0 @@
-/*-
- * Copyright (c) 2000 Hans Petter Selasky. 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_hdlc.h - software-HDLC header file
- * --------------------------------------
- *
- * $Id: i4b_hdlc.h,v 1.5 2000/08/28 07:41:19 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Thu Jan 11 11:31:01 2001]
- *
- * Please conform "ihfc/i4b_ihfc_drv.c" (ihfc_hdlc_Bxxxx)
- * for correct usage! (-hp)
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_HDLC_H_
-#define _I4B_HDLC_H_
-
-extern const u_short HDLC_FCS_TAB[256];
-extern const u_short HDLC_BIT_TAB[256];
-
-/*---------------------------------------------------------------------------*
- * HDLC_DECODE
- * ===========
- *
- * u_char: flag, blevel
- * u_short: crc, ib, tmp, tmp2, len
- *
- * next: 'continue' or 'goto xxx'
- *
- * cfr: complete frame
- * nfr: new frame
- * NOTE: must setup 'len' and 'dst', so that 'dst' may be written
- * at most 'len' times.
- *
- * rab: abort
- * rdd: read data (read byte is stored in 'tmp2')
- * rdo: overflow
- *
- * d: dummy
- *
- * NOTE: setting flag to '0' and len to '0' => recover from rdu
- * NOTE: bits[8 .. ] of tmp2 may be used to store custom data/flags
- * NOTE: these variables have to be 'suspended' / 'resumed' somehow:
- * flag, blevel, crc, ib, tmp, len
- * NOTE: zero is default value for all variables.
- * NOTE: each time 'dst' is written, 'len' is decreased by one.
- *---------------------------------------------------------------------------*/
-
-#define HDLC_DECODE(dst, len, tmp, tmp2, blevel, ib, crc, flag, rddcmd, nfrcmd, \
- cfrcmd, rabcmd, rdocmd, nextcmd, d) \
- \
- rddcmd; \
- \
- ib += HDLC_BIT_TAB[(u_char)tmp2]; \
- \
- if ((u_char)ib >= 5) \
- { \
- if (ib & 0x20) /* de-stuff (msb) */ \
- { \
- if ((u_char)tmp2 == 0x7e) goto j0##d; \
- tmp2 += tmp2 & 0x7f; \
- blevel--; \
- \
- if ((ib += 0x100) & 0xc) tmp2 |= 1; /* */ \
- } \
- \
- ib &= ~0xe0; \
- \
- if ((u_char)ib == 6) /* flag seq (lsb) */ \
- { \
- j0##d: if (flag >= 2) \
- { \
- len += (4 - flag) & 3; /* remove CRC bytes */ \
- crc ^= 0xf0b8; \
- cfrcmd; \
- len = 0; \
- } \
- \
- flag = 1; \
- \
- blevel = (ib >> 8) & 0xf; \
- tmp = ((u_char)tmp2) >> blevel; \
- blevel = 8 - blevel; \
- \
- ib >>= 12; \
- \
- nextcmd; \
- } \
- if ((u_char)ib >= 7) /* abort (msb & lsb) */ \
- { \
- if (flag >= 2) \
- { \
- rabcmd; \
- len = 0; \
- } \
- \
- flag = 0; \
- \
- ib >>= 12; \
- \
- nextcmd; \
- } \
- if ((u_char)ib == 5) /* de-stuff (lsb) */ \
- { \
- tmp2 = (tmp2 | (tmp2 + 1)) & ~0x1; \
- blevel--; \
- } \
- if (blevel > 7) /* EO - bits */ \
- { \
- tmp |= (u_char)tmp2 >> (8 - (blevel &= 7)); \
- \
- ib >>= 12; \
- \
- nextcmd; \
- } \
- } \
- \
- tmp |= (u_char)tmp2 << blevel; \
- \
- if (!len--) \
- { \
- len++; \
- \
- if (!flag++) { flag--; goto j5##d;} /* hunt mode */ \
- \
- switch (flag) \
- { case 2: /* new frame */ \
- nfrcmd; \
- crc = -1; \
- if (!len--) { len++; flag++; goto j4##d; } \
- goto j3##d; \
- case 3: /* CRC (lsb's) */ \
- case 4: /* CRC (msb's) */ \
- goto j4##d; \
- case 5: /* RDO */ \
- rdocmd; \
- flag = 0; \
- break; \
- } \
- } \
- else \
- { \
- j3##d: dst = (u_char)tmp; \
- j4##d: crc = (HDLC_FCS_TAB[(u_char)(tmp ^ crc)] ^ (u_char)(crc >> 8)); \
- } \
- \
- j5##d: ib >>= 12; \
- tmp >>= 8; \
-
-/*------ end of HDLC_DECODE -------------------------------------------------*/
-
-
-/*---------------------------------------------------------------------------*
- * HDLC_ENCODE
- * ===========
- *
- * u_char: flag, src
- * u_short: tmp2, blevel, ib, crc, len
- * u_int: tmp
- *
- * gfr: This is the place where you free the last [mbuf] chain, and get
- * the next one. If a mbuf is available the code should setup 'len'
- * and 'src' so that 'src' may be read 'len' times. If no mbuf is
- * available leave 'len' and 'src' untouched.
- *
- * nmb: If your implementation accept/use chained mbufs, this is the
- * place where you update 'len' and 'src' to the next mbuf of
- * the chain that makes up a frame. If no further mbuf is
- * available leave 'len' and 'src' untouched. This is not the
- * place where you free the mbuf. Leave the block empty if your
- * implementation does not accept/use chained mbufs.
- *
- * wrd: write data (output = (u_char)tmp)
- *
- * d: dummy
- *
- * NOTE: setting flag to '-2' and len to '0' => abort bytes will be sent
- * NOTE: these variables have to be 'suspended' / 'resumed' somehow:
- * flag, blevel, crc, ib, tmp, len
- * NOTE: zero is default value for all variables.
- * NOTE: each time 'src' is read, 'len' is decreased by one.
- * NOTE: neither cmd's should exit through 'goto' or 'break' statements.
- *---------------------------------------------------------------------------*/
-
-#define HDLC_ENCODE(src, len, tmp, tmp2, blevel, ib, crc, flag, gfrcmd, nmbcmd, wrdcmd, d) \
- \
- if (blevel >= 0x800) { blevel -= 0x800; goto j4##d; } \
- \
- if (!len--) \
- { \
- len++; \
- \
- switch(++flag) \
- { default: /* abort */ \
- tmp = blevel = 0; /* zero is default */ \
- tmp2 = 0xff; \
- goto j3##d; \
- case 1: /* 1st time FS */ \
- case 2: /* 2nd time FS */ \
- tmp2 = 0x7e; \
- goto j3##d; \
- case 3: \
- gfrcmd; /* get new frame */ \
- if (!len--) \
- { \
- len++; \
- flag--; /* don't proceed */ \
- tmp2 = 0x7e; \
- goto j3##d; /* final FS */ \
- } \
- else \
- { \
- crc = -1; \
- ib = 0; \
- goto j1##d; /* first byte */ \
- } \
- case 4: \
- nmbcmd; /* get next mbuf in chain */ \
- if (!len--) \
- { \
- len++; \
- crc ^= -1; \
- tmp2 = (u_char)crc; \
- goto j2##d; /* CRC (lsb's) */ \
- } \
- else \
- { \
- flag--; \
- goto j1##d; /* proceed with the frame */ \
- } \
- case 5: \
- tmp2 = (u_char)(crc >> 8); \
- flag = 1; \
- goto j2##d; /* CRC (msb's) */ \
- } \
- } \
- else \
- { j1##d : \
- tmp2 = (u_char)src; \
- crc =(HDLC_FCS_TAB[(u_char)(crc ^ tmp2)] ^ (u_char)(crc >> 8)); \
- j2##d: \
- \
- ib >>= 12; \
- ib += HDLC_BIT_TAB[(u_char)tmp2]; \
- \
- if ((u_char)ib >= 5) /* stuffing */ \
- { \
- blevel &= ~0xff; \
- \
- if (ib & 0xc0) /* bit stuff (msb) */ \
- { \
- tmp2 += tmp2 & (0xff * (ib & 0xc0)); \
- ib %= 0x5000; \
- blevel++; \
- } \
- \
- ib &= ~0xf0; \
- \
- if ((u_char)ib >= 5) /* bit stuff (lsb) */ \
- { \
- tmp2 += tmp2 & ~0x1f >> ((ib - (ib >> 8) + 1) \
- & 7); \
- blevel++; \
- \
- if ((u_char)ib >= 10) /* bit stuff (msb) */ \
- { \
- tmp2 += tmp2 & ~0x7ff >> ((ib - \
- (ib >> 8) + 1) & 7); \
- blevel++; \
- } \
- if (ib & 0x8000) /* bit walk */ \
- { \
- ib = ((u_char)ib % 5) << 12; \
- } \
- } \
- \
- tmp |= tmp2 << (u_char)(blevel >> 8); \
- blevel += (u_char)blevel << 8; \
- } \
- else /* no stuffing */ \
- { \
- j3##d:tmp |= tmp2 << (u_char)(blevel >> 8); \
- } \
- } \
- \
- j4##d: wrdcmd; \
- tmp >>= 8; \
-
-/*------ end of HDLC_ENCODE -------------------------------------------------*/
-
-
-#endif /* _I4B_HDLC_H_ */
diff --git a/sys/i4b/layer1/itjc/i4b_itjc_ext.h b/sys/i4b/layer1/itjc/i4b_itjc_ext.h
deleted file mode 100644
index 4009dde..0000000
--- a/sys/i4b/layer1/itjc/i4b_itjc_ext.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 Sergio Prallon. 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_itjc - NetJet PCI for split layers
- * ------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Wed Jan 10 17:15:31 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_ITJC_EXT_H_
-#define _I4B_ITJC_EXT_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-void itjc_set_linktab(int unit, int channel, drvr_link_t * dlt);
-isdn_link_t *itjc_ret_linktab(int unit, int channel);
-
-int itjc_ph_data_req(int unit, struct mbuf *m, int freeflag);
-int itjc_ph_activate_req(int unit);
-int itjc_mph_command_req(int unit, int command, void *parm);
-
-void itjc_isac_irq(struct l1_softc *sc, int ista);
-void itjc_isac_l1_cmd(struct l1_softc *sc, int command);
-int itjc_isac_init(struct l1_softc *sc);
-
-void itjc_recover(struct l1_softc *sc);
-char * itjc_printstate(struct l1_softc *sc);
-void itjc_next_state(struct l1_softc *sc, int event);
-
-#define ITJC_MAXUNIT 4
-extern struct l1_softc *itjc_scp[ITJC_MAXUNIT];
-
-#endif /* _I4B_ITJC_EXT_H_ */
diff --git a/sys/i4b/layer1/itjc/i4b_itjc_isac.c b/sys/i4b/layer1/itjc/i4b_itjc_isac.c
deleted file mode 100644
index ab267b7..0000000
--- a/sys/i4b/layer1/itjc/i4b_itjc_isac.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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_itjc_isac.c - i4b NetJet-S ISAC handler
- * --------------------------------------------
- * last edit-date: [Wed Jan 10 17:15:54 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <machine/stdarg.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-
-#include <i4b/layer1/itjc/i4b_itjc_ext.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static u_char itjc_isac_exir_hdlr(register struct l1_softc *sc, u_char exir);
-static void itjc_isac_ind_hdlr(register struct l1_softc *sc, int ind);
-
-/*---------------------------------------------------------------------------*
- * ISAC interrupt service routine
- *---------------------------------------------------------------------------*/
-void
-itjc_isac_irq(struct l1_softc *sc, int ista)
-{
- register u_char c = 0;
- NDBGL1(L1_F_MSG, "unit %d: ista = 0x%02x", sc->sc_unit, ista);
-
- if(ista & ISAC_ISTA_EXI) /* extended interrupt */
- {
- c |= itjc_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++;
- NDBGL1(L1_I_ERR, "unit %d: CRC error", sc->sc_unit);
- }
-
- if(rsta & ISAC_RSTA_RDO) /* ReceiveDataOverflow */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Data Overrun error", sc->sc_unit);
- }
-
- if(rsta & ISAC_RSTA_RAB) /* ReceiveABorted */
- {
- error++;
- NDBGL1(L1_I_ERR, "unit %d: Receive Aborted error", sc->sc_unit);
- }
-
- if(error == 0)
- NDBGL1(L1_I_ERR, "unit %d: RME unknown error, RSTA = 0x%02x!", 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("itjc_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 = L0ITJCUNIT(sc->sc_unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, sc->sc_ibuf->m_len, sc->sc_ibuf->m_data);
- }
-
- c |= ISAC_CMDR_RMC;
-
- if(sc->sc_enabled &&
- (ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S))
- {
- i4b_l1_ph_data_ind(L0ITJCUNIT(sc->sc_unit), sc->sc_ibuf);
- }
- else
- {
- i4b_Dfreembuf(sc->sc_ibuf);
- }
- }
- else
- {
- NDBGL1(L1_I_ERR, "RME, input buffer overflow!");
- 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("itjc_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
- {
- NDBGL1(L1_I_ERR, "RPF, input buffer overflow!");
- 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;
- }
-
- 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)
- itjc_isac_ind_hdlr(sc, (ci >> 2) & 0xf);
- }
-
- if(c)
- {
- ISAC_WRITE(I_CMDR, c);
- ISACCMDRWRDELAY();
- }
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Extended IRQ handler
- *---------------------------------------------------------------------------*/
-static u_char
-itjc_isac_exir_hdlr(register struct l1_softc *sc, u_char exir)
-{
- u_char c = 0;
-
- if(exir & ISAC_EXIR_XMR)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Message Repeat");
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_XDU)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Tx Data Underrun");
-
- c |= ISAC_CMDR_XRES;
- }
-
- if(exir & ISAC_EXIR_PCE)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Protocol Error");
- }
-
- if(exir & ISAC_EXIR_RFO)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Rx Frame Overflow");
-
- c |= ISAC_CMDR_RMC|ISAC_CMDR_RRES;
- }
-
- if(exir & ISAC_EXIR_SOV)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Sync Xfer Overflow");
- }
-
- if(exir & ISAC_EXIR_MOS)
- {
- NDBGL1(L1_I_ERR, "EXIRQ Monitor Status");
- }
-
- if(exir & ISAC_EXIR_SAW)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Subscriber Awake");
- }
-
- if(exir & ISAC_EXIR_WOV)
- {
- /* cannot happen, STCR:TSF is set to 0 */
-
- NDBGL1(L1_I_ERR, "EXIRQ Watchdog Timer Overflow");
- }
-
- return(c);
-}
-
-/*---------------------------------------------------------------------------*
- * ISAC L1 Indication handler
- *---------------------------------------------------------------------------*/
-static void
-itjc_isac_ind_hdlr(register struct l1_softc *sc, int ind)
-{
- register int event;
-
- switch(ind)
- {
- case ISAC_CIRR_IAI8:
- NDBGL1(L1_I_CICO, "rx AI8 in state %s", itjc_printstate(sc));
- itjc_isac_l1_cmd(sc, CMD_AR8);
- event = EV_INFO48;
- i4b_l1_mph_status_ind(L0ITJCUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISAC_CIRR_IAI10:
- NDBGL1(L1_I_CICO, "rx AI10 in state %s", itjc_printstate(sc));
- itjc_isac_l1_cmd(sc, CMD_AR10);
- event = EV_INFO410;
- i4b_l1_mph_status_ind(L0ITJCUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- break;
-
- case ISAC_CIRR_IRSY:
- NDBGL1(L1_I_CICO, "rx RSY in state %s", itjc_printstate(sc));
- event = EV_RSY;
- break;
-
- case ISAC_CIRR_IPU:
- NDBGL1(L1_I_CICO, "rx PU in state %s", itjc_printstate(sc));
- event = EV_PU;
- break;
-
- case ISAC_CIRR_IDR:
- NDBGL1(L1_I_CICO, "rx DR in state %s", itjc_printstate(sc));
- itjc_isac_l1_cmd(sc, CMD_DIU);
- event = EV_DR;
- break;
-
- case ISAC_CIRR_IDID:
- NDBGL1(L1_I_CICO, "rx DID in state %s", itjc_printstate(sc));
- event = EV_INFO0;
- i4b_l1_mph_status_ind(L0ITJCUNIT(sc->sc_unit), STI_L1STAT, LAYER_IDLE, NULL);
- break;
-
- case ISAC_CIRR_IDIS:
- NDBGL1(L1_I_CICO, "rx DIS in state %s", itjc_printstate(sc));
- event = EV_DIS;
- break;
-
- case ISAC_CIRR_IEI:
- NDBGL1(L1_I_CICO, "rx EI in state %s", itjc_printstate(sc));
- itjc_isac_l1_cmd(sc, CMD_DIU);
- event = EV_EI;
- break;
-
- case ISAC_CIRR_IARD:
- NDBGL1(L1_I_CICO, "rx ARD in state %s", itjc_printstate(sc));
- event = EV_INFO2;
- break;
-
- case ISAC_CIRR_ITI:
- NDBGL1(L1_I_CICO, "rx TI in state %s", itjc_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_IATI:
- NDBGL1(L1_I_CICO, "rx ATI in state %s", itjc_printstate(sc));
- event = EV_INFO0;
- break;
-
- case ISAC_CIRR_ISD:
- NDBGL1(L1_I_CICO, "rx SD in state %s", itjc_printstate(sc));
- event = EV_INFO0;
- break;
-
- default:
- NDBGL1(L1_I_ERR, "UNKNOWN Indication 0x%x in state %s", ind, itjc_printstate(sc));
- event = EV_INFO0;
- break;
- }
- itjc_next_state(sc, event);
-}
-
-/*---------------------------------------------------------------------------*
- * execute a layer 1 command
- *---------------------------------------------------------------------------*/
-void
-itjc_isac_l1_cmd(struct l1_softc *sc, int command)
-{
- u_char cmd;
-
- if(command < 0 || command > CMD_ILL)
- {
- NDBGL1(L1_I_ERR, "illegal cmd 0x%x in state %s", command, itjc_printstate(sc));
- return;
- }
-
- cmd = ISAC_CIX0_LOW;
-
- switch(command)
- {
- case CMD_TIM:
- NDBGL1(L1_I_CICO, "tx TIM in state %s", itjc_printstate(sc));
- cmd |= (ISAC_CIXR_CTIM << 2);
- break;
-
- case CMD_RS:
- NDBGL1(L1_I_CICO, "tx RS in state %s", itjc_printstate(sc));
- cmd |= (ISAC_CIXR_CRS << 2);
- break;
-
- case CMD_AR8:
- NDBGL1(L1_I_CICO, "tx AR8 in state %s", itjc_printstate(sc));
- cmd |= (ISAC_CIXR_CAR8 << 2);
- break;
-
- case CMD_AR10:
- NDBGL1(L1_I_CICO, "tx AR10 in state %s", itjc_printstate(sc));
- cmd |= (ISAC_CIXR_CAR10 << 2);
- break;
-
- case CMD_DIU:
- NDBGL1(L1_I_CICO, "tx DIU in state %s", itjc_printstate(sc));
- cmd |= (ISAC_CIXR_CDIU << 2);
- break;
- }
- ISAC_WRITE(I_CIXR, cmd);
-}
-
-/*---------------------------------------------------------------------------*
- * L1 ISAC initialization
- *---------------------------------------------------------------------------*/
-int
-itjc_isac_init(struct l1_softc *sc)
-{
- ISAC_IMASK = 0xff; /* disable all irqs */
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-
- NDBGL1(L1_I_SETUP, "configuring for IOM-2 mode");
-
- /* 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);
-
- /* 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);
-}
diff --git a/sys/i4b/layer1/itjc/i4b_itjc_l1.c b/sys/i4b/layer1/itjc/i4b_itjc_l1.c
deleted file mode 100644
index 9df9bcc..0000000
--- a/sys/i4b/layer1/itjc/i4b_itjc_l1.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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_itjc_l1.c - NetJet-S layer 1 handler
- * ---------------------------------------------
- * last edit-date: [Wed Jan 10 17:16:19 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <machine/stdarg.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-
-#include <i4b/layer1/itjc/i4b_itjc_ext.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-/*---------------------------------------------------------------------------*
- *
- * 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
- *
- *---------------------------------------------------------------------------*/
-int
-itjc_ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- u_char cmd;
- int s;
- struct l1_softc *sc = itjc_scp[unit];
-
- NDBGL1(L1_PRIM, "PH-DATA-REQ, unit %d, freeflag=%d", unit, freeflag);
-
- if(m == NULL) /* failsafe */
- return (0);
-
- s = SPLI4B();
-
- if(sc->sc_I430state == ST_F3) /* layer 1 not running ? */
- {
- NDBGL1(L1_I_ERR, "still in state F3!");
- itjc_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 */
-
- NDBGL1(L1_I_MSG, "using 2nd ISAC TX buffer, state = %s", itjc_printstate(sc));
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = L0ITJCUNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
- splx(s);
- return(1);
- }
-
- NDBGL1(L1_I_ERR, "No Space in TX FIFO, state = %s", itjc_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 = L0ITJCUNIT(unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_dcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, m->m_len, m->m_data);
- }
-
- sc->sc_state |= ISAC_TX_ACTIVE; /* set transmitter busy flag */
-
- NDBGL1(L1_I_MSG, "ISAC_TX_ACTIVE set");
-
- 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
- *
- *---------------------------------------------------------------------------*/
-int
-itjc_ph_activate_req(int unit)
-{
- struct l1_softc *sc = itjc_scp[unit];
- NDBGL1(L1_PRIM, "PH-ACTIVATE-REQ, unit %d", unit);
- itjc_next_state(sc, EV_PHAR);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * command from the upper layers
- *---------------------------------------------------------------------------*/
-int
-itjc_mph_command_req(int unit, int command, void *parm)
-{
- struct l1_softc *sc = itjc_scp[unit];
-
- switch(command)
- {
- case CMR_DOPEN: /* daemon running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DOPEN", unit);
- sc->sc_enabled = 1;
- break;
-
- case CMR_DCLOSE: /* daemon not running */
- NDBGL1(L1_PRIM, "unit %d, command = CMR_DCLOSE", unit);
- sc->sc_enabled = 0;
- break;
-
- case CMR_SETTRACE:
- NDBGL1(L1_PRIM, "unit %d, command = CMR_SETTRACE, parm = %d", unit, (unsigned int)parm);
- sc->sc_trace = (unsigned int)parm;
- break;
-
- default:
- NDBGL1(L1_ERROR, "ERROR, unknown command = %d, unit = %d, parm = %d", command, unit, (unsigned int)parm);
- break;
- }
-
- return(0);
-}
diff --git a/sys/i4b/layer1/itjc/i4b_itjc_l1fsm.c b/sys/i4b/layer1/itjc/i4b_itjc_l1fsm.c
deleted file mode 100644
index 4a43e4b..0000000
--- a/sys/i4b/layer1/itjc/i4b_itjc_l1fsm.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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_itjc_l1fsm.c - NetJet-S layer 1 I.430 state machine
- * ------------------------------------------------------------
- * last edit-date: [Wed Jan 10 17:16:33 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <machine/stdarg.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-#include <i4b/layer1/isic/i4b_hscx.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/itjc/i4b_itjc_ext.h>
-
-#if DO_I4B_DEBUG
-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"
-};
-#endif
-
-/* Function prototypes */
-
-static void timer3_expired (struct l1_softc *sc);
-static void T3_start (struct l1_softc *sc);
-static void T3_stop (struct l1_softc *sc);
-static void F_T3ex (struct l1_softc *sc);
-static void timer4_expired (struct l1_softc *sc);
-static void T4_start (struct l1_softc *sc);
-static void T4_stop (struct l1_softc *sc);
-static void F_AI8 (struct l1_softc *sc);
-static void F_AI10 (struct l1_softc *sc);
-static void F_I01 (struct l1_softc *sc);
-static void F_I02 (struct l1_softc *sc);
-static void F_I03 (struct l1_softc *sc);
-static void F_I2 (struct l1_softc *sc);
-static void F_ill (struct l1_softc *sc);
-static void F_NULL (struct l1_softc *sc);
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer3_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T3)
- {
- NDBGL1(L1_T_ERR, "state = %s", itjc_printstate(sc));
- sc->sc_I430T3 = 0;
-
- /* XXX try some recovery here XXX */
-
- itjc_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);
-
- i4b_l1_mph_status_ind(L0ITJCUNIT(sc->sc_unit), STI_NOL1ACC, 0, NULL);
- }
-
- itjc_next_state(sc, EV_T3);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 start
- *---------------------------------------------------------------------------*/
-static void
-T3_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", itjc_printstate(sc));
- sc->sc_I430T3 = 1;
- sc->sc_T3_callout = timeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, 2*hz);
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 stop
- *---------------------------------------------------------------------------*/
-static void
-T3_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", itjc_printstate(sc));
-
- sc->sc_init_tries = 0; /* init connect retry count */
-
- if(sc->sc_I430T3)
- {
- sc->sc_I430T3 = 0;
- untimeout((TIMEOUT_FUNC_T)timer3_expired,(struct l1_softc *)sc, sc->sc_T3_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * I.430 Timer T3 expiry
- *---------------------------------------------------------------------------*/
-static void
-F_T3ex(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_T3ex executing");
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0ITJCUNIT(sc->sc_unit));
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 expire function
- *---------------------------------------------------------------------------*/
-static void
-timer4_expired(struct l1_softc *sc)
-{
- if(sc->sc_I430T4)
- {
- NDBGL1(L1_T_MSG, "state = %s", itjc_printstate(sc));
- sc->sc_I430T4 = 0;
- i4b_l1_mph_status_ind(L0ITJCUNIT(sc->sc_unit), STI_PDEACT, 0, NULL);
- }
- else
- {
- NDBGL1(L1_T_ERR, "expired without starting it ....");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 start
- *---------------------------------------------------------------------------*/
-static void
-T4_start(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", itjc_printstate(sc));
- sc->sc_I430T4 = 1;
- sc->sc_T4_callout = timeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, hz);
-}
-
-/*---------------------------------------------------------------------------*
- * Timer T4 stop
- *---------------------------------------------------------------------------*/
-static void
-T4_stop(struct l1_softc *sc)
-{
- NDBGL1(L1_T_MSG, "state = %s", itjc_printstate(sc));
-
- if(sc->sc_I430T4)
- {
- sc->sc_I430T4 = 0;
- untimeout((TIMEOUT_FUNC_T)timer4_expired,(struct l1_softc *)sc, sc->sc_T4_callout);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI8
- *---------------------------------------------------------------------------*/
-static void
-F_AI8(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI8 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0ITJCUNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_8;
-
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received AI10
- *---------------------------------------------------------------------------*/
-static void
-F_AI10(struct l1_softc *sc)
-{
- T4_stop(sc);
-
- NDBGL1(L1_F_MSG, "FSM function F_AI10 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_activate_ind(L0ITJCUNIT(sc->sc_unit));
-
- T3_stop(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO4_10;
-
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in states F3 .. F5
- *---------------------------------------------------------------------------*/
-static void
-F_I01(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I01 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F6
- *---------------------------------------------------------------------------*/
-static void
-F_I02(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I02 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0ITJCUNIT(sc->sc_unit));
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO 0 in state F7 or F8
- *---------------------------------------------------------------------------*/
-static void
-F_I03(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I03 executing");
-
- if(ctrl_desc[sc->sc_unit].protocol != PROTOCOL_D64S)
- i4b_l1_ph_deactivate_ind(L0ITJCUNIT(sc->sc_unit));
-
- T4_start(sc);
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO0;
-
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: activate request
- *---------------------------------------------------------------------------*/
-static void
-F_AR(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AR executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO1_8;
-
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_TE;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
- itjc_isac_l1_cmd(sc, CMD_AR8);
-
- T3_start(sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM function: received INFO2
- *---------------------------------------------------------------------------*/
-static void
-F_I2(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_I2 executing");
-
- if(sc->sc_trace & TRACE_I)
- {
- i4b_trace_hdr_t hdr;
- char info = INFO2;
-
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = TRC_CH_I;
- hdr.dir = FROM_NT;
- hdr.count = 0;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, 1, &info);
- }
-
-}
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(struct l1_softc *sc)
-{
- NDBGL1(L1_F_ERR, "FSM function F_ill executing");
-}
-
-/*---------------------------------------------------------------------------*
- * No action
- *---------------------------------------------------------------------------*/
-static void
-F_NULL(struct l1_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_NULL executing");
-}
-
-
-/*---------------------------------------------------------------------------*
- * layer 1 state transition table
- *---------------------------------------------------------------------------*/
-struct itjc_state_tab {
- void (*func) (struct l1_softc *sc); /* function to execute */
- int newstate; /* next state */
-} itjc_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
-itjc_next_state(struct l1_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 = itjc_state_tab[event][currstate].newstate;
-
- if(newstate >= N_STATES)
- panic("i4b_l1fsm.c: newstate >= N_STATES\n");
-
- NDBGL1(L1_F_MSG, "FSM event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[newstate]);
-
- (*itjc_state_tab[event][currstate].func)(sc);
-
- if(newstate == ST_ILL)
- {
- newstate = ST_F3;
- NDBGL1(L1_F_ERR, "FSM Illegal State ERROR, oldstate = %s, newstate = %s, event = %s!",
- state_text[currstate],
- state_text[newstate],
- event_text[event]);
- }
-
- sc->sc_I430state = newstate;
-}
-
-#if DO_I4B_DEBUG
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-itjc_printstate(struct l1_softc *sc)
-{
- return((char *) state_text[sc->sc_I430state]);
-}
-#endif
diff --git a/sys/i4b/layer1/itjc/i4b_itjc_pci.c b/sys/i4b/layer1/itjc/i4b_itjc_pci.c
deleted file mode 100644
index 6d255af..0000000
--- a/sys/i4b/layer1/itjc/i4b_itjc_pci.c
+++ /dev/null
@@ -1,2142 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 Sergio Prallon. 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_itjc_pci.c: NetJet-S hardware driver
- * ----------------------------------------
- * last edit-date: [Sat May 13 15:25:47 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/itjc/i4b_hdlc.h> /* XXXXXXXXXXXXXXXXXXXXXXXX */
-
-#include <i4b/layer1/isic/i4b_isic.h>
-#include <i4b/layer1/isic/i4b_isac.h>
-
-#include <i4b/layer1/itjc/i4b_itjc_ext.h>
-
-#define PCI_TJNET_VID (0xe159)
-#define PCI_TJ300_DID (0x0001)
-
-
-/*
- * Function prototypes
- */
-
-static int itjc_probe(device_t dev);
-static int itjc_attach(device_t dev);
-static void itjc_shutdown(device_t dev);
-static void itjc_intr(void *xsc);
-static int itjc_dma_start(struct l1_softc *sc);
-static void itjc_dma_stop(struct l1_softc *sc);
-static void itjc_isac_intr(struct l1_softc *sc);
-static void itjc_init_linktab(struct l1_softc *sc);
-static void itjc_bchannel_setup(int unit, int h_chan, int bprot,
- int activate);
-static void itjc_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp);
-
-
-/*
- * Shorter names to bus resource manager routines.
- */
-
-#define itjc_bus_setup(sc) \
- bus_space_handle_t h = \
- rman_get_bushandle((sc)->sc_resources.io_base[0]); \
- bus_space_tag_t t = \
- rman_get_bustag((sc)->sc_resources.io_base[0]);
-
-#define itjc_read_1(port) (bus_space_read_1(t, h, (port)))
-#define itjc_read_4(port) (bus_space_read_4(t, h, (port)))
-#define itjc_write_1(port, data) (bus_space_write_1(t, h, (port), (data)))
-#define itjc_write_4(port, data) (bus_space_write_4(t, h, (port), (data)))
-#define itjc_read_multi_1(port, buf, size) \
- (bus_space_read_multi_1(t, h, (port), (buf), (size)))
-#define itjc_write_multi_1(port, buf, size) \
- (bus_space_write_multi_1(t, h, (port), (buf), (size)))
-
-
-/*---------------------------------------------------------------------------*
- * Glue data to register ourselves as a PCI device driver.
- *---------------------------------------------------------------------------*/
-
-static device_method_t itjc_pci_methods[] =
-{
- /* Device interface */
- DEVMETHOD(device_probe, itjc_probe),
- DEVMETHOD(device_attach, itjc_attach),
- DEVMETHOD(device_shutdown, itjc_shutdown),
-
- /* bus interface */
- DEVMETHOD(bus_print_child, bus_generic_print_child),
- DEVMETHOD(bus_driver_added, bus_generic_driver_added),
-
- { 0, 0 }
-};
-
-static driver_t itjc_pci_driver =
-{
- "itjc",
- itjc_pci_methods,
- sizeof(struct l1_softc)
-};
-
-static devclass_t itjc_pci_devclass;
-
-DRIVER_MODULE(netjet, pci, itjc_pci_driver, itjc_pci_devclass, 0, 0);
-
-/*
- * Jump table for multiplex routines.
- */
-
-struct i4b_l1mux_func itjc_l1mux_func =
-{
- itjc_ret_linktab,
- itjc_set_linktab,
- itjc_mph_command_req,
- itjc_ph_data_req,
- itjc_ph_activate_req,
-};
-
-struct l1_softc *itjc_scp[ITJC_MAXUNIT];
-
-
-/*---------------------------------------------------------------------------*
- * Tiger300/320 PCI ASIC registers.
- *---------------------------------------------------------------------------*/
-
-/*
- * Register offsets from i/o base.
- */
-enum tiger_regs
-{
- TIGER_RESET_PIB_CL_TIME = 0x00,
- TIGER_DMA_OPER = 0x01,
- TIGER_AUX_PORT_CNTL = 0x02,
- TIGER_AUX_PORT_DATA = 0x03,
- TIGER_INT0_MASK = 0x04,
- TIGER_INT1_MASK = 0x05,
- TIGER_INT0_STATUS = 0x06,
- TIGER_INT1_STATUS = 0x07,
- TIGER_DMA_WR_START_ADDR = 0x08,
- TIGER_DMA_WR_INT_ADDR = 0x0C,
- TIGER_DMA_WR_END_ADDR = 0x10,
- TIGER_DMA_WR_CURR_ADDR = 0x14,
- TIGER_DMA_RD_START_ADDR = 0x18,
- TIGER_DMA_RD_INT_ADDR = 0x1C,
- TIGER_DMA_RD_END_ADDR = 0x20,
- TIGER_DMA_RD_CURR_ADDR = 0x24,
- TIGER_PULSE_COUNTER = 0x28,
-};
-
-/*
- * Bits on the above registers.
- */
-
-enum tiger_reg_bits
-{
-/* Reset and PIB Cycle Timing */
-
- TIGER_DMA_OP_MODE_MASK = 0x80,
- TIGER_SELF_ADDR_DMA = 0x00, /* Wrap around ending addr */
- TIGER_NORMAL_DMA = 0x80, /* Stop at ending addr */
-
- TIGER_DMA_INT_MODE_MASK = 0x40,
- TIGER_DONT_LATCH_DMA_INT= 0x00, /* Bits on int0 status will be
- set only while curr addr
- equals int or end addr */
- TIGER_LATCH_DMA_INT = 0x40, /* Bits on int0 status remain
- set until cleared by CPU */
-
- TIGER_PIB_CYCLE_TIMING_MASK = 0x30,
- TIGER_PIB_3_CYCLES = 0x00,
- TIGER_PIB_5_CYCLES = 0x10,
- TIGER_PIB_12_CYCLES = 0x20,
-
- TIGER_RESET_MASK = 0x0F,
- TIGER_RESET_PULSE_COUNT = 0x08,
- TIGER_RESET_SERIAL_PORT = 0x04,
- TIGER_RESET_DMA_LOGIC = 0x02,
- TIGER_RESET_EXTERNAL = 0x01,
- TIGER_RESET_ALL = 0x0F,
-
-/* DMA Operation */
- TIGER_DMA_RESTART_MASK = 0x02,
- TIGER_HOLD_DMA = 0x00,
- TIGER_RESTART_DMA = 0x02,
-
- TIGER_DMA_ENABLE_MASK = 0x01,
- TIGER_ENABLE_DMA = 0x01,
- TIGER_DISABLE_DMA = 0x00,
-
-/* AUX Port Control & Data plus Interrupt 1 Mask & Status */
- TIGER_AUX_7_MASK = 0x80,
- TIGER_AUX_6_MASK = 0x40,
- TIGER_AUX_5_MASK = 0x20,
- TIGER_AUX_4_MASK = 0x10,
- TIGER_ISAC_INT_MASK = 0x10,
- TIGER_AUX_3_MASK = 0x08,
- TIGER_AUX_2_MASK = 0x04,
- TIGER_AUX_1_MASK = 0x02,
- TIGER_AUX_0_MASK = 0x01,
-
-/* AUX Port Control */
- TIGER_AUX_7_IS_INPUT = 0x00,
- TIGER_AUX_7_IS_OUTPUT = 0x80,
- TIGER_AUX_6_IS_INPUT = 0x00,
- TIGER_AUX_6_IS_OUTPUT = 0x40,
- TIGER_AUX_5_IS_INPUT = 0x00,
- TIGER_AUX_5_IS_OUTPUT = 0x20,
- TIGER_AUX_4_IS_INPUT = 0x00,
- TIGER_AUX_4_IS_OUTPUT = 0x10,
- TIGER_AUX_3_IS_INPUT = 0x00,
- TIGER_AUX_3_IS_OUTPUT = 0x08,
- TIGER_AUX_2_IS_INPUT = 0x00,
- TIGER_AUX_2_IS_OUTPUT = 0x04,
- TIGER_AUX_1_IS_INPUT = 0x00,
- TIGER_AUX_1_IS_OUTPUT = 0x02,
- TIGER_AUX_0_IS_INPUT = 0x00,
- TIGER_AUX_0_IS_OUTPUT = 0x01,
- TIGER_AUX_NJ_DEFAULT = 0xEF, /* All but ISAC int is output */
-
-/* Interrupt 0 Mask & Status */
- TIGER_PCI_TARGET_ABORT_INT_MASK = 0x20,
- TIGER_NO_TGT_ABORT_INT = 0x00,
- TIGER_TARGET_ABORT_INT = 0x20,
- TIGER_PCI_MASTER_ABORT_INT_MASK = 0x10,
- TIGER_NO_MST_ABORT_INT = 0x00,
- TIGER_MASTER_ABORT_INT = 0x10,
- TIGER_DMA_RD_END_INT_MASK = 0x08,
- TIGER_NO_RD_END_INT = 0x00,
- TIGER_RD_END_INT = 0x08,
- TIGER_DMA_RD_INT_INT_MASK = 0x04,
- TIGER_NO_RD_INT_INT = 0x00,
- TIGER_RD_INT_INT = 0x04,
- TIGER_DMA_WR_END_INT_MASK = 0x02,
- TIGER_NO_WR_END_INT = 0x00,
- TIGER_WR_END_INT = 0x02,
- TIGER_DMA_WR_INT_INT_MASK = 0x01,
- TIGER_NO_WR_INT_INT = 0x00,
- TIGER_WR_INT_INT = 0x01,
-
-/* Interrupt 1 Mask & Status */
- TIGER_NO_AUX_7_INT = 0x00,
- TIGER_AUX_7_INT = 0x80,
- TIGER_NO_AUX_6_INT = 0x00,
- TIGER_AUX_6_INT = 0x40,
- TIGER_NO_AUX_5_INT = 0x00,
- TIGER_AUX_5_INT = 0x20,
- TIGER_NO_AUX_4_INT = 0x00,
- TIGER_AUX_4_INT = 0x10,
- TIGER_NO_ISAC_INT = 0x00,
- TIGER_ISAC_INT = 0x10,
- TIGER_NO_AUX_3_INT = 0x00,
- TIGER_AUX_3_INT = 0x08,
- TIGER_NO_AUX_2_INT = 0x00,
- TIGER_AUX_2_INT = 0x04,
- TIGER_NO_AUX_1_INT = 0x00,
- TIGER_AUX_1_INT = 0x02,
- TIGER_NO_AUX_0_INT = 0x00,
- TIGER_AUX_0_INT = 0x01
-};
-
-/*
- * Peripheral Interface Bus definitions. This is an ISA like bus
- * created by the Tiger ASIC to keep ISA chips like the ISAC happy
- * on a PCI environment.
- *
- * Since the PIB only supplies 4 addressing lines, the 2 higher bits
- * (A4 & A5) of the ISAC register addresses are wired on the 2 lower
- * AUX lines. Another restriction is that all I/O to the PIB (8bit
- * wide) is mapped on the PCI side as 32bit data. So the PCI address
- * of a given ISAC register has to be multiplied by 4 before being
- * added to the PIB base offset.
- */
-enum tiger_pib_regs_defs
-{
- /* Offset from the I/O base to the ISAC registers. */
- PIB_OFFSET = 0xC0,
- PIB_LO_ADDR_MASK = 0x0F,
- PIB_HI_ADDR_MASK = 0x30,
- PIB_LO_ADDR_SHIFT = 2, /* Align on dword boundary */
- PIB_HI_ADDR_SHIFT = 4 /* Right shift to AUX_1 & AUX_0 */
-};
-
-
-#define itjc_set_pib_addr_msb(a) \
-( \
- itjc_write_1(TIGER_AUX_PORT_DATA, \
- ((a) & PIB_HI_ADDR_MASK) >> PIB_HI_ADDR_SHIFT) \
-)
-
-#define itjc_pib_2_pci(a) \
-( \
- (((a) & PIB_LO_ADDR_MASK) << PIB_LO_ADDR_SHIFT) + PIB_OFFSET \
-)
-
-#define itjc_get_dma_offset(ctx,reg) \
-( \
- (u_int16_t)((bus_addr_t)itjc_read_4((reg)) - (ctx)->bus_addr) \
-)
-
-
-/*
- * IOM-2 serial channel 0 DMA data ring buffers.
- *
- * The Tiger300/320 ASIC do not nothing more than transfer via DMA the
- * first 32 bits of every IOM-2 frame on the serial interface to the
- * ISAC. So we have no framing/deframing facilities like we would have
- * with an HSCX, having to do the job with CPU cycles. On the plus side
- * we are able to specify large rings which can limit the occurrence of
- * over/underruns.
- */
-
-enum
-{
- ITJC_RING_SLOT_WORDS = 64,
- ITJC_RING_WORDS = 3 * ITJC_RING_SLOT_WORDS,
- ITJC_RING_SLOT_BYTES = 4 * ITJC_RING_SLOT_WORDS,
- ITJC_RING_BYTES = 4 * ITJC_RING_WORDS,
- ITJC_DMA_POOL_WORDS = 2 * ITJC_RING_WORDS,
- ITJC_DMA_POOL_BYTES = 4 * ITJC_DMA_POOL_WORDS
-};
-
-#define itjc_ring_add(x, d) (((x) + 4 * (d)) % ITJC_RING_BYTES)
-#define itjc_ring_sub(x, d) (((x) + ITJC_RING_BYTES - 4 * (d)) \
- % ITJC_RING_BYTES)
-
-
-enum
-{
- TIGER_CH_A = 0,
- TIGER_CH_B = 1,
-
- HSCX_CH_A = 0, /* For compatibility reasons. */
- HSCX_CH_B = 1,
-};
-
-enum
-{
- ITJC_TEL_SILENCE_BYTE = 0x00,
- ITJC_HDLC_FLAG_BYTE = 0x7E,
- ITJC_HDLC_ABORT_BYTE = 0xFF
-};
-
-/*
- * Hardware DMA control block (one per card).
- */
-typedef enum
-{
- ITJC_DS_LOAD_FAILED = -1,
- ITJC_DS_FREE = 0,
- ITJC_DS_LOADING,
- ITJC_DS_STOPPED,
- ITJC_DS_RUNNING
-}
- dma_state_t;
-
-typedef struct
-{
- dma_state_t state;
- u_int8_t *pool;
- bus_addr_t bus_addr;
- bus_dma_tag_t tag;
- bus_dmamap_t map;
- int error;
-}
- dma_context_t;
-
-dma_context_t
- dma_context [ ITJC_MAXUNIT ];
-
-/*
- * B-channel DMA control blocks (4 per card -- 1 RX & 1 TX per channel).
- */
-typedef enum
-{
- ITJC_RS_IDLE = 0,
- ITJC_RS_ACTIVE
-}
- dma_rx_state_t;
-
-typedef enum
-{
- ITJC_TS_IDLE = 0,
- ITJC_TS_ACTIVE,
- ITJC_TS_AFTER_XDU
-}
- dma_tx_state_t;
-
-typedef struct
-{
- u_int8_t *ring;
- bus_addr_t bus_addr;
- u_int16_t next_read;
- u_int16_t hdlc_len;
- u_int16_t hdlc_tmp;
- u_int16_t hdlc_crc;
- u_int16_t hdlc_ib;
- u_int8_t hdlc_blevel;
- u_int8_t hdlc_flag;
- dma_rx_state_t state;
-}
- dma_rx_context_t;
-
-typedef struct
-{
- u_int8_t *ring;
- bus_addr_t bus_addr;
- u_int16_t next_write;
- u_int32_t hdlc_tmp;
- u_int16_t hdlc_blevel;
- u_int16_t hdlc_crc;
- u_int16_t hdlc_ib;
- u_int16_t next_frame;
- u_int16_t filled;
- u_int8_t hdlc_flag;
- dma_tx_state_t state;
-}
- dma_tx_context_t;
-
-dma_rx_context_t
- dma_rx_context [ ITJC_MAXUNIT ] [ 2 ];
-
-dma_tx_context_t
- dma_tx_context [ ITJC_MAXUNIT ] [ 2 ];
-
-/*
- * Used by the mbuf handling functions.
- */
-typedef enum
-{
- ITJC_MB_CURR = 0,
- ITJC_MB_NEXT = 1,
- ITJC_MB_NEW = 2
-}
- which_mb_t;
-
-
-/*---------------------------------------------------------------------------*
- * itjc_map_callback - get DMA bus address from resource mgr.
- *---------------------------------------------------------------------------*/
-static void
-itjc_map_callback(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
- dma_context_t *ctx = (dma_context_t *)arg;
-
- if (error)
- {
- ctx->error = error;
- ctx->state = ITJC_DS_LOAD_FAILED;
- return;
- }
-
- ctx->bus_addr = segs->ds_addr;
- ctx->state = ITJC_DS_STOPPED;
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_dma_start - Complete DMA setup & start the Tiger DMA engine.
- *---------------------------------------------------------------------------*/
-static int
-itjc_dma_start(struct l1_softc *sc)
-{
- int unit = sc->sc_unit;
- dma_context_t *ctx = &dma_context[unit];
- dma_rx_context_t *rxc = &dma_rx_context[unit][0];
- dma_tx_context_t *txc = &dma_tx_context[unit][0];
- bus_addr_t ba;
- u_int8_t i;
- u_int32_t *pool_end,
- *ip;
-
- itjc_bus_setup(sc);
-
- /* See if it is already running. */
-
- if (ctx->state == ITJC_DS_RUNNING)
- return 0;
-
- if (ctx->state == ITJC_DS_LOAD_FAILED)
- {
- NDBGL1(L1_ERROR, "itjc%d: dma_start: DMA map loading "
- "failed (error=%d).\n", unit, ctx->error);
- return 1;
- }
-
- if (ctx->state != ITJC_DS_STOPPED)
- {
- NDBGL1(L1_ERROR, "itjc%d: dma_start: Unexpected DMA "
- "state (%d).\n", unit, ctx->state);
- return 1;
- }
-
- /*
- * Initialize the DMA control structures (hardware & B-channel).
- */
- ba = ctx->bus_addr;
-
- txc->ring = ctx->pool + TIGER_CH_A;
- rxc->ring = ctx->pool + TIGER_CH_A + ITJC_RING_BYTES;
-
- txc->bus_addr = ba;
- rxc->bus_addr = ba + ITJC_RING_BYTES;
-
- ++rxc; ++txc;
-
- txc->ring = ctx->pool + TIGER_CH_B;
- rxc->ring = ctx->pool + TIGER_CH_B + ITJC_RING_BYTES;
-
- txc->bus_addr = ba;
- rxc->bus_addr = ba + ITJC_RING_BYTES;
-
- /*
- * Fill the DMA ring buffers with IOM-2 channel 0 frames made of
- * idle/abort sequences for the B & D channels and NOP for IOM-2
- * cmd/ind, monitor handshake & data.
- */
- pool_end = (u_int32_t *)ctx->pool + ITJC_DMA_POOL_WORDS;
- for (ip = (u_int32_t *)ctx->pool; ip < pool_end; ++ip)
- *ip = 0xFFFFFFFF;
-
- /*
- * Program the Tiger DMA gears.
- */
-
- itjc_write_4(TIGER_DMA_WR_START_ADDR, ba);
- itjc_write_4(TIGER_DMA_WR_INT_ADDR, ba + ITJC_RING_SLOT_BYTES - 4);
- itjc_write_4(TIGER_DMA_WR_END_ADDR, ba + ITJC_RING_BYTES - 4);
-
- ba += ITJC_RING_BYTES;
-
- itjc_write_4(TIGER_DMA_RD_START_ADDR, ba);
- itjc_write_4(TIGER_DMA_RD_INT_ADDR, ba + ITJC_RING_SLOT_BYTES * 2 - 4);
- itjc_write_4(TIGER_DMA_RD_END_ADDR, ba + ITJC_RING_BYTES - 4);
-
- itjc_write_1(TIGER_INT0_MASK,
- TIGER_WR_END_INT | TIGER_WR_INT_INT | TIGER_RD_INT_INT);
-
- itjc_write_1(TIGER_DMA_OPER, TIGER_ENABLE_DMA);
-
- /*
- * See if it really started.
- */
- ba = itjc_read_4(TIGER_DMA_RD_CURR_ADDR);
- for (i = 0; i < 10; ++i)
- {
- DELAY(SEC_DELAY/1000);
- if (ba != itjc_read_4(TIGER_DMA_RD_CURR_ADDR))
- {
- ctx->state = ITJC_DS_RUNNING;
- return 0;
- }
- }
-
- NDBGL1(L1_ERROR, "itjc%d: dma_start: DMA start failed.\n ", unit);
- return 1;
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_dma_stop - Stop the Tiger DMA engine.
- *---------------------------------------------------------------------------*/
-static void
-itjc_dma_stop(struct l1_softc *sc)
-{
- dma_context_t *ctx = &dma_context[sc->sc_unit];
-
- itjc_bus_setup(sc);
-
- /* Only stop the DMA if it is running. */
-
- if (ctx->state != ITJC_DS_RUNNING)
- return;
-
- itjc_write_1(TIGER_DMA_OPER, TIGER_DISABLE_DMA);
- DELAY(SEC_DELAY/1000);
-
- ctx->state = ITJC_DS_STOPPED;
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_bchannel_dma_setup - The DMA side of itjc_bchannel_setup.
- *---------------------------------------------------------------------------*/
-static void
-itjc_bchannel_dma_setup(struct l1_softc *sc, int h_chan, int activate)
-{
- dma_rx_context_t *rxc = &dma_rx_context[sc->sc_unit][h_chan];
- dma_tx_context_t *txc = &dma_tx_context[sc->sc_unit][h_chan];
-
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
-
- u_int8_t fill_byte,
- *ring_end,
- *cp;
-
- int s = SPLI4B();
-
- itjc_bus_setup(sc);
-
- if (activate)
- {
- /*
- * Get the DMA engine going if it's not running already.
- */
- itjc_dma_start(sc);
-
- rxc->hdlc_len = rxc->hdlc_tmp = rxc->hdlc_crc = 0;
- rxc->hdlc_ib = rxc->hdlc_blevel = rxc->hdlc_flag = 0;
-
- txc->hdlc_tmp = txc->hdlc_blevel = txc->hdlc_crc = 0;
- txc->hdlc_ib = 0;
- txc->hdlc_flag = 2;
- txc->filled = 0;
-
- if (chan->bprot == BPROT_NONE)
- fill_byte = ITJC_TEL_SILENCE_BYTE;
- else
- fill_byte = ITJC_HDLC_ABORT_BYTE;
-
- ring_end = rxc->ring + ITJC_RING_BYTES;
- for (cp = rxc->ring; cp < ring_end; cp += 4)
- *cp = fill_byte;
-
- ring_end = txc->ring + ITJC_RING_BYTES;
- for (cp = txc->ring; cp < ring_end; cp += 4)
- *cp = fill_byte;
-
- rxc->next_read =
- itjc_get_dma_offset(rxc, TIGER_DMA_RD_CURR_ADDR);
-
- txc->next_frame = txc->next_write =
- itjc_get_dma_offset(txc, TIGER_DMA_WR_CURR_ADDR);
-
- rxc->state = ITJC_RS_ACTIVE;
- txc->state = ITJC_TS_AFTER_XDU;
- }
- else
- {
- dma_rx_context_t *rxc2;
-
- txc->state = ITJC_TS_IDLE;
- rxc->state = ITJC_RS_IDLE;
-
- rxc2 = &dma_rx_context[sc->sc_unit][0];
-
- if (rxc2->state == ITJC_RS_IDLE
- && rxc2[1].state == ITJC_RS_IDLE)
- itjc_dma_stop(sc);
- }
-
- splx(s);
-}
-
-
-/*---------------------------------------------------------------------------*
- * Mbuf & if_queues management routines.
- *---------------------------------------------------------------------------*/
-
-static u_int8_t *
-itjc_get_rx_mbuf(l1_bchan_state_t *chan, u_int8_t **dst_end_p,
-which_mb_t which)
-{
- struct mbuf *mbuf = chan->in_mbuf;
-
- if (mbuf == NULL && which == ITJC_MB_NEW)
- {
- if ((mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("itjc_get_rx_mbuf: cannot allocate mbuf!");
-
- chan->in_mbuf = mbuf;
- chan->in_cbptr = (u_int8_t *)mbuf->m_data;
- chan->in_len = 0;
- }
-
- if (dst_end_p != NULL)
- {
- if (mbuf != NULL)
- *dst_end_p = (u_int8_t *)(mbuf->m_data)
- + BCH_MAX_DATALEN;
- else
- *dst_end_p = NULL;
- }
-
- return chan->in_cbptr;
-}
-
-
-static void
-itjc_save_rx_mbuf(l1_bchan_state_t *chan, u_int8_t * dst)
-{
- struct mbuf *mbuf = chan->in_mbuf;
-
- if (dst != NULL && mbuf != NULL)
- {
- chan->in_cbptr = dst;
- chan->in_len = dst - (u_int8_t *)mbuf->m_data;
- }
- else if (dst == NULL && mbuf == NULL)
- {
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- else
- panic("itjc_save_rx_mbuf: stale pointer dst=%p mbuf=%p "
- "in_cbptr=%p in_len=%d", dst, mbuf,
- chan->in_cbptr, chan->in_len);
-}
-
-
-static void
-itjc_free_rx_mbuf(l1_bchan_state_t *chan)
-{
- struct mbuf *mbuf = chan->in_mbuf;
-
- if (mbuf != NULL)
- i4b_Bfreembuf(mbuf);
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
-}
-
-
-static void
-itjc_put_rx_mbuf(struct l1_softc *sc, l1_bchan_state_t *chan, u_int16_t len)
-{
- i4b_trace_hdr_t hdr;
- struct mbuf *mbuf = chan->in_mbuf;
- u_int8_t *data = mbuf->m_data;
- int activity = 1;
-
- mbuf->m_pkthdr.len = mbuf->m_len = len;
-
- if (sc->sc_trace & TRACE_B_RX)
- {
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = (chan->channel == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, len, data);
- }
-
- if (chan->bprot == BPROT_NONE)
- {
- activity = ! i4b_l1_bchan_tel_silence(data, len);
-
- /* move rx'd data to rx queue */
-
- if (! _IF_QFULL(&chan->rx_queue))
- {
- IF_ENQUEUE(&chan->rx_queue, mbuf);
- }
- else
- {
- i4b_Bfreembuf(mbuf);
- len = 0;
- }
- }
-
- if (len != 0)
- {
- chan->rxcount += len;
-
- (*chan->isic_drvr_linktab->bch_rx_data_ready)
- (chan->isic_drvr_linktab->unit);
- }
-
- if (activity)
- (*chan->isic_drvr_linktab->bch_activity)
- (chan->isic_drvr_linktab->unit, ACT_RX);
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
-}
-
-
-#define itjc_free_tx_mbufs(chan) \
-{ \
- i4b_Bfreembuf((chan)->out_mbuf_head); \
- (chan)->out_mbuf_cur = (chan)->out_mbuf_head = NULL; \
- (chan)->out_mbuf_cur_ptr = NULL; \
- (chan)->out_mbuf_cur_len = 0; \
-}
-
-
-static u_int16_t
-itjc_get_tx_mbuf(struct l1_softc *sc, l1_bchan_state_t *chan,
- u_int8_t **src_p, which_mb_t which)
-{
- i4b_trace_hdr_t hdr;
- struct mbuf *mbuf = chan->out_mbuf_cur;
- u_int8_t activity = 1;
- u_int16_t len;
- void *data;
-
- switch (which)
- {
- case ITJC_MB_CURR:
- if (mbuf != NULL)
- {
- *src_p = chan->out_mbuf_cur_ptr;
- return chan->out_mbuf_cur_len;
- }
-
- break;
-
- case ITJC_MB_NEXT:
- if (mbuf != NULL)
- {
- chan->txcount += mbuf->m_len;
-
- mbuf = mbuf->m_next;
-
- if (mbuf != NULL)
- goto new_mbuf;
- }
-
- chan->out_mbuf_cur_ptr = *src_p = NULL;
- chan->out_mbuf_cur_len = 0;
-
- if (chan->out_mbuf_head != NULL)
- {
- i4b_Bfreembuf(chan->out_mbuf_head);
- chan->out_mbuf_head = NULL;
- }
-
- return 0;
-
- case ITJC_MB_NEW:
- if (mbuf != NULL)
- chan->txcount += mbuf->m_len;
- }
-
- if (chan->out_mbuf_head != NULL)
- i4b_Bfreembuf(chan->out_mbuf_head);
-
- IF_DEQUEUE(&chan->tx_queue, mbuf);
-
- if (mbuf == NULL)
- {
- chan->out_mbuf_cur = chan->out_mbuf_head = NULL;
- chan->out_mbuf_cur_ptr = *src_p = NULL;
- chan->out_mbuf_cur_len = 0;
-
- chan->state &= ~(HSCX_TX_ACTIVE);
-
- (*chan->isic_drvr_linktab->bch_tx_queue_empty)
- (chan->isic_drvr_linktab->unit);
-
- return 0;
- }
-
- chan->out_mbuf_head = mbuf;
-
-new_mbuf:
- chan->out_mbuf_cur = mbuf;
- chan->out_mbuf_cur_ptr = data = mbuf->m_data;
- chan->out_mbuf_cur_len = len = mbuf->m_len;
-
- chan->state |= HSCX_TX_ACTIVE;
-
- if (sc->sc_trace & TRACE_B_TX)
- {
- hdr.unit = L0ITJCUNIT(sc->sc_unit);
- hdr.type = (chan->channel == HSCX_CH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, len, data);
- }
-
- if (chan->bprot == BPROT_NONE)
- activity = ! i4b_l1_bchan_tel_silence(data, len);
-
- if (activity)
- (*chan->isic_drvr_linktab->bch_activity)
- (chan->isic_drvr_linktab->unit, ACT_TX);
-
- *src_p = data;
- return len;
-}
-
-
-#define itjc_save_tx_mbuf(chan, src, dst) \
-( \
- (chan)->out_mbuf_cur != NULL ? \
- ( \
- (chan)->out_mbuf_cur_ptr = (src), \
- (chan)->out_mbuf_cur_len = (len) \
- ) \
- : \
- 0 \
-)
-
-
-/*---------------------------------------------------------------------------*
- * B-channel interrupt service routines.
- *---------------------------------------------------------------------------*/
-
-/*
- * Since the Tiger ASIC doesn't produce a XMIT underflow indication,
- * we need to deduce it ourselves. This is somewhat tricky because we
- * are dealing with modulo m arithmetic. The idea here is to have a
- * "XDU zone" ahead of the writing pointer sized 1/3 of total ring
- * length (a ring slot). If the hardware DMA pointer is found there we
- * consider that a XDU has occurred. To complete the scheme, we never
- * let the ring have more than 2 slots of (unsent) data and adjust the
- * interrupt registers to cause an interrupt at every slot.
- */
-static u_int8_t
-itjc_xdu(struct l1_softc *sc, l1_bchan_state_t *chan, dma_tx_context_t *ctx,
-u_int16_t *dst_p, u_int16_t *dst_end_p, u_int8_t tx_restart)
-{
- u_int8_t xdu;
-
- u_int16_t dst_end,
- dst,
- dma,
- dma_l,
- dma_h,
- xdu_l,
- xdu_h;
-
- itjc_bus_setup(sc);
-
- /*
- * Since the hardware is running, be conservative and assume
- * the pointer location has a `fuzy' error factor.
- */
- dma = itjc_get_dma_offset(ctx, TIGER_DMA_WR_CURR_ADDR);
- dma_l = dma;
- dma_h = itjc_ring_add(dma, 1);
-
- dst_end = itjc_ring_sub(dma_l, ITJC_RING_SLOT_WORDS);
-
- if (ctx->state != ITJC_TS_ACTIVE)
- {
- xdu = (ctx->state == ITJC_TS_AFTER_XDU);
- dst = itjc_ring_add(dma_h, 4);
- goto done;
- }
-
- /*
- * Check for xmit underruns.
- */
- xdu_l = dst = ctx->next_write;
- xdu_h = itjc_ring_add(dst, ITJC_RING_SLOT_WORDS);
-
- if (xdu_l < xdu_h)
- xdu = (xdu_l <= dma_l && dma_l < xdu_h)
- || (xdu_l <= dma_h && dma_h < xdu_h);
- else
- xdu = (xdu_l <= dma_l || dma_l < xdu_h)
- || (xdu_l <= dma_h || dma_h < xdu_h);
-
- if (xdu)
- {
- ctx->state = ITJC_TS_AFTER_XDU;
-
- dst = itjc_ring_add(dma_h, 4);
- }
- else if (tx_restart)
- {
- /*
- * See if we still can restart from immediately
- * after the last frame sent. It's a XDU test but
- * using the real data end on the comparsions. We
- * don't consider XDU an error here because we were
- * just trying to avoid send a filling gap between
- * frames. If it's already sent no harm is done.
- */
- xdu_l = dst = ctx->next_frame;
- xdu_h = itjc_ring_add(dst, ITJC_RING_SLOT_WORDS);
-
- if (xdu_l < xdu_h)
- xdu = (xdu_l <= dma_l && dma_l < xdu_h)
- || (xdu_l <= dma_h && dma_h < xdu_h);
- else
- xdu = (xdu_l <= dma_l || dma_l < xdu_h)
- || (xdu_l <= dma_h || dma_h < xdu_h);
-
- if (xdu)
- dst = itjc_ring_add(dma_h, 4);
-
- xdu = 0;
- }
-
-done:
- if (dst_p != NULL)
- *dst_p = dst;
-
- if (dst_end_p != NULL)
- *dst_end_p = dst_end;
-
- ctx->next_write = dst_end;
-
- return xdu;
-}
-
-
-#define itjc_rotate_hdlc_flag(blevel) \
- ((u_int8_t)(0x7E7E >> (8 - (u_int8_t)((blevel) >> 8))))
-
-
-static void
-itjc_dma_rx_intr(struct l1_softc *sc, l1_bchan_state_t *chan,
-dma_rx_context_t *ctx)
-{
- u_int8_t *ring,
- *dst,
- *dst_end,
- flag,
- blevel;
-
- u_int16_t dma,
- src,
- tmp2,
- tmp,
- len,
- crc,
- ib;
-
- itjc_bus_setup(sc);
-
-
- if (ctx->state == ITJC_RS_IDLE)
- return;
-
- ring = ctx->ring;
- dma = itjc_get_dma_offset(ctx, TIGER_DMA_RD_CURR_ADDR);
- dma = itjc_ring_sub(dma, 1);
- src = ctx->next_read;
-
- if (chan->bprot == BPROT_NONE)
- {
- dst = itjc_get_rx_mbuf(chan, &dst_end, ITJC_MB_CURR);
-
- while (src != dma)
- {
- if (dst == NULL)
- dst = itjc_get_rx_mbuf(chan, &dst_end,
- ITJC_MB_NEW);
-
- *dst++ = ring[src];
- src = itjc_ring_add(src, 1);
-
- if (dst >= dst_end)
- {
- itjc_put_rx_mbuf(sc, chan, BCH_MAX_DATALEN);
- dst = dst_end = NULL;
- }
- }
- ctx->next_read = src;
- itjc_save_rx_mbuf(chan, dst);
- return;
- }
-
- blevel = ctx->hdlc_blevel;
- flag = ctx->hdlc_flag;
- len = ctx->hdlc_len;
- tmp = ctx->hdlc_tmp;
- crc = ctx->hdlc_crc;
- ib = ctx->hdlc_ib;
-
- dst = itjc_get_rx_mbuf(chan, NULL, ITJC_MB_CURR);
-
- while (src != dma)
- {
- HDLC_DECODE(*dst++, len, tmp, tmp2, blevel, ib, crc, flag,
- {/* rdd */
- tmp2 = ring[src];
- src = itjc_ring_add(src, 1);
- },
- {/* nfr */
- if (dst != NULL)
- panic("itjc_dma_rx_intr: nfrcmd with "
- "valid current frame");
-
- dst = itjc_get_rx_mbuf(chan, &dst_end, ITJC_MB_NEW);
- len = dst_end - dst;
- },
- {/* cfr */
- len = BCH_MAX_DATALEN - len;
-
- if ((!len) || (len > BCH_MAX_DATALEN))
- {
- /*
- * NOTE: frames without any data, only crc
- * field, should be silently discared.
- */
- NDBGL1(L1_S_MSG, "itjc_dma_rx_intr: "
- "bad frame (len=%d, unit=%d)",
- len, sc->sc_unit);
-
- itjc_free_rx_mbuf(chan);
-
- goto s0;
- }
-
- if (crc)
- {
- NDBGL1(L1_S_ERR,
- "CRC (crc=0x%04x, len=%d, unit=%d)",
- crc, len, sc->sc_unit);
-
- itjc_free_rx_mbuf(chan);
-
- goto s0;
- }
-
- itjc_put_rx_mbuf(sc, chan, len);
-
- s0:
- dst = NULL;
- len = 0;
- },
- {/* rab */
- NDBGL1(L1_S_ERR, "Read Abort (unit=%d)", sc->sc_unit);
-
- itjc_free_rx_mbuf(chan);
- dst = NULL;
- len = 0;
- },
- {/* rdo */
- NDBGL1(L1_S_ERR, "RDO (unit=%d) dma=%d src=%d",
- sc->sc_unit, dma, src);
-
- itjc_free_rx_mbuf(chan);
- dst = NULL;
- len = 0;
- },
- continue,
- d);
- }
-
- itjc_save_rx_mbuf(chan, dst);
-
- ctx->next_read = src;
- ctx->hdlc_blevel= blevel;
- ctx->hdlc_flag = flag;
- ctx->hdlc_len = len;
- ctx->hdlc_tmp = tmp;
- ctx->hdlc_crc = crc;
- ctx->hdlc_ib = ib;
-}
-
-
-/*
- * The HDLC side of itjc_dma_tx_intr. We made a separate function
- * to improve readability and (perhaps) help the compiler with
- * register allocation.
- */
-static void
-itjc_hdlc_encode(struct l1_softc *sc, l1_bchan_state_t *chan,
-dma_tx_context_t * ctx)
-{
- u_int8_t *ring,
- *src,
- xdu,
- flag,
- flag_byte,
- tx_restart;
-
- u_int16_t saved_len,
- dst_end,
- dst_end1,
- dst,
- filled,
- blevel,
- tmp2,
- len,
- crc,
- ib;
-
- u_int32_t tmp;
-
-
- saved_len = len = itjc_get_tx_mbuf(sc, chan, &src, ITJC_MB_CURR);
-
- filled = ctx->filled;
- flag = ctx->hdlc_flag;
-
- if (src == NULL && flag == 2 && filled >= ITJC_RING_WORDS)
- return;
-
- tx_restart = (flag == 2 && src != NULL);
- xdu = itjc_xdu(sc, chan, ctx, &dst, &dst_end, tx_restart);
-
- ring = ctx->ring;
-
- ib = ctx->hdlc_ib;
- crc = ctx->hdlc_crc;
- tmp = ctx->hdlc_tmp;
- blevel = ctx->hdlc_blevel;
-
- if (xdu)
- {
- if (flag != 2)
- {
- NDBGL1(L1_H_XFRERR, "XDU");
- ++chan->stat_XDU;
-
- /*
- * Abort the current frame and
- * prepare for a full restart.
- */
- itjc_free_tx_mbufs(chan);
- saved_len = len = filled = 0;
- flag = (u_int8_t)-2;
- }
- else if (filled < ITJC_RING_SLOT_WORDS)
- {
- /*
- * A little garbage may have been retransmitted.
- * Send an abort before any new data.
- */
- filled = 0;
- flag = (u_int8_t)-2;
- }
- }
-
- if (flag != 3)
- len = 0;
-
- while (dst != dst_end)
- {
- HDLC_ENCODE(
- *src++, len, tmp, tmp2, blevel, ib, crc, flag,
- {/* gfr */
- if ((len = saved_len) == 0)
- len = itjc_get_tx_mbuf(sc, chan, &src,
- ITJC_MB_NEW);
-
- if (len == 0)
- {
- ctx->next_frame = dst;
-
- flag_byte = itjc_rotate_hdlc_flag(blevel);
-
- for (dst_end1 = itjc_ring_sub(dst_end, 1);
- dst != dst_end1;
- dst = itjc_ring_add(dst, 1))
- {
- ring[dst] = flag_byte;
- ++filled;
- }
- }
- else
- filled = 0;
-
- ctx->state = ITJC_TS_ACTIVE;
- },
- {/* nmb */
- saved_len = 0;
- len = itjc_get_tx_mbuf(sc, chan, &src, ITJC_MB_NEXT);
- },
- {/* wrd */
- ring[dst] = (u_int8_t)tmp;
- dst = itjc_ring_add(dst, 1);
- },
- d1);
- }
-
- ctx->hdlc_blevel = blevel;
- ctx->hdlc_flag = flag;
- ctx->hdlc_tmp = tmp;
- ctx->hdlc_crc = crc;
- ctx->hdlc_ib = ib;
-
- ctx->filled = filled;
- ctx->next_write = dst;
-
- itjc_save_tx_mbuf(chan, src, len);
-}
-
-
-static void
-itjc_dma_tx_intr(struct l1_softc *sc, l1_bchan_state_t *chan,
-dma_tx_context_t * ctx)
-{
- u_int8_t *data_end,
- *ring,
- *src,
- xdu;
-
- u_int16_t dst,
- dst_end,
- filled,
- len;
-
-
- if (ctx->state == ITJC_TS_IDLE)
- goto done;
-
- if (chan->bprot != BPROT_NONE)
- {
- itjc_hdlc_encode(sc, chan, ctx);
- goto done;
- }
-
- ring = ctx->ring;
- filled = ctx->filled;
-
- len = itjc_get_tx_mbuf(sc, chan, &src, ITJC_MB_CURR);
-
- if (len == 0 && filled >= ITJC_RING_WORDS)
- goto done;
-
- xdu = itjc_xdu(sc, chan, ctx, &dst, &dst_end, len != 0);
-
- if (xdu && filled < ITJC_RING_WORDS)
- {
- NDBGL1(L1_H_XFRERR, "XDU");
- ++chan->stat_XDU;
- filled = 0;
- }
-
- if (len == 0)
- goto fill_ring;
-
- ctx->state = ITJC_TS_ACTIVE;
-
- data_end = src + len;
- while (dst != dst_end)
- {
- ring[dst] = *src++; --len;
-
- dst = itjc_ring_add(dst, 1);
-
- if (src >= data_end)
- {
- len = itjc_get_tx_mbuf(sc, chan, &src, ITJC_MB_NEXT);
- if (len == 0)
- len = itjc_get_tx_mbuf(sc, chan,
- &src, ITJC_MB_NEW);
-
- if (len == 0)
- {
- data_end = NULL;
- break;
- }
- data_end = src + len;
- }
- }
-
- itjc_save_tx_mbuf(chan, src, len);
-
- filled = 0;
-
-fill_ring:
- ctx->next_frame = dst;
-
- for (; dst != dst_end; dst = itjc_ring_add(dst, 1))
- {
- ring[dst] = ITJC_TEL_SILENCE_BYTE;
- ++filled;
- }
-
- ctx->next_write = dst;
- ctx->filled = filled;
-
-done:
- return;
-}
-
-
-/*---------------------------------------------------------------------------*
- * NetJet fifo read/write routines.
- *---------------------------------------------------------------------------*/
-
-static void
-itjc_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- itjc_bus_setup(sc);
-
- if (what != ISIC_WHAT_ISAC)
- panic("itjc_write_fifo: Trying to read from HSCX fifo.\n");
-
- itjc_set_pib_addr_msb(0);
- itjc_read_multi_1(PIB_OFFSET, buf, size);
-}
-
-
-static void
-itjc_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
-{
- itjc_bus_setup(sc);
-
- if (what != ISIC_WHAT_ISAC)
- panic("itjc_write_fifo: Trying to write to HSCX fifo.\n");
-
- itjc_set_pib_addr_msb(0);
- itjc_write_multi_1(PIB_OFFSET, buf, size);
-}
-
-
-/*---------------------------------------------------------------------------*
- * Read an ISAC register.
- *---------------------------------------------------------------------------*/
-static u_int8_t
-itjc_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
-{
- itjc_bus_setup(sc);
-
- if (what != ISIC_WHAT_ISAC)
- {
- panic("itjc_read_reg: what(%d) != ISIC_WHAT_ISAC\n",
- what);
- return 0;
- }
-
- itjc_set_pib_addr_msb(offs);
- return itjc_read_1(itjc_pib_2_pci(offs));
-}
-
-
-/*---------------------------------------------------------------------------*
- * Write an ISAC register.
- *---------------------------------------------------------------------------*/
-static void
-itjc_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data)
-{
- itjc_bus_setup(sc);
-
- if (what != ISIC_WHAT_ISAC)
- {
- panic("itjc_write_reg: what(%d) != ISIC_WHAT_ISAC\n",
- what);
- return;
- }
-
- itjc_set_pib_addr_msb(offs);
- itjc_write_1(itjc_pib_2_pci(offs), data);
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_probe - probe for a card.
- *---------------------------------------------------------------------------*/
-static int itjc_probe(device_t dev)
-{
- u_int16_t vid = pci_get_vendor(dev),
- did = pci_get_device(dev);
-
- if ((vid == PCI_TJNET_VID) && (did == PCI_TJ300_DID))
- {
- device_set_desc(dev, "NetJet-S");
- return 0;
- }
-
- return ENXIO;
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_attach - attach a (previously probed) card.
- *---------------------------------------------------------------------------*/
-static int
-itjc_attach(device_t dev)
-{
- bus_space_handle_t h;
- bus_space_tag_t t;
-
- struct l1_softc *sc = device_get_softc(dev);
-
- u_int16_t vid = pci_get_vendor(dev),
- did = pci_get_device(dev);
-
- int unit = device_get_unit(dev),
- s = splimp(),
- res_init_level = 0,
- error = 0;
-
- void *ih = 0;
-
- dma_context_t *ctx = &dma_context[unit];
- l1_bchan_state_t *chan;
-
- bzero(sc, sizeof(struct l1_softc));
-
- /* Probably not really required. */
- if (unit >= ITJC_MAXUNIT)
- {
- printf("itjc%d: Error, unit >= ITJC_MAXUNIT!\n", unit);
- splx(s);
- return ENXIO;
- }
-
- if (!(vid == PCI_TJNET_VID && did == PCI_TJ300_DID))
- {
- printf("itjc%d: unknown device (%04X,%04X)!\n", unit, vid, did);
- goto fail;
- }
-
- itjc_scp[unit] = sc;
-
- sc->sc_resources.io_rid[0] = PCIR_BAR(0);
- sc->sc_resources.io_base[0] = bus_alloc_resource_any(dev,
- SYS_RES_IOPORT, &sc->sc_resources.io_rid[0], RF_ACTIVE);
-
- if (sc->sc_resources.io_base[0] == NULL)
- {
- printf("itjc%d: couldn't map IO port\n", unit);
- error = ENXIO;
- goto fail;
- }
-
- h = rman_get_bushandle(sc->sc_resources.io_base[0]);
- t = rman_get_bustag(sc->sc_resources.io_base[0]);
-
- ++res_init_level;
-
- /* Allocate interrupt. */
- sc->sc_resources.irq_rid = 0;
- sc->sc_resources.irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid, RF_SHAREABLE | RF_ACTIVE);
-
- if (sc->sc_resources.irq == NULL)
- {
- printf("itjc%d: couldn't map interrupt\n", unit);
- error = ENXIO;
- goto fail;
- }
-
- ++res_init_level;
-
- error = bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET,
- NULL, itjc_intr, sc, &ih);
-
- if (error)
- {
- printf("itjc%d: couldn't set up irq handler\n", unit);
- error = ENXIO;
- goto fail;
- }
-
- /*
- * Reset the ASIC & the ISAC.
- */
- itjc_write_1(TIGER_RESET_PIB_CL_TIME, TIGER_RESET_ALL);
-
- DELAY(SEC_DELAY/100); /* Give it 10 ms to reset ...*/
-
- itjc_write_1(TIGER_RESET_PIB_CL_TIME,
- TIGER_SELF_ADDR_DMA | TIGER_PIB_3_CYCLES);
-
- DELAY(SEC_DELAY/100); /* ... and more 10 to recover. */
-
- /*
- * First part of DMA initialization. Create & map the memory
- * pool that will be used to bear the rx & tx ring buffers.
- */
- ctx->state = ITJC_DS_LOADING;
-
- error = bus_dma_tag_create(
- NULL, /* parent */
- 4, /* alignment*/
- 0, /* boundary*/
- BUS_SPACE_MAXADDR_32BIT, /* lowaddr*/
- BUS_SPACE_MAXADDR, /* highaddr*/
- NULL, /* filter*/
- NULL, /* filterarg*/
- ITJC_DMA_POOL_BYTES, /* maxsize*/
- 1, /* nsegments*/
- ITJC_DMA_POOL_BYTES, /* maxsegsz*/
- BUS_DMA_ALLOCNOW | BUS_DMA_COHERENT, /* flags*/
- NULL, NULL, /* lockfuunc, lockarg */
- &ctx->tag);
-
- if (error)
- {
- printf("itjc%d: couldn't create bus DMA tag.\n", unit);
- goto fail;
- }
-
- ++res_init_level;
-
- error = bus_dmamem_alloc(
- ctx->tag, /* DMA tag */
- (void **)&ctx->pool, /* KV addr of the allocated memory */
- BUS_DMA_NOWAIT | BUS_DMA_COHERENT, /* flags */
- &ctx->map); /* KV <-> PCI map */
-
- if (error)
- goto fail;
-
- /*
- * Load the KV <-> PCI map so the device sees the same
- * memory segment as pointed by pool. Note: since the
- * load may happen assyncronously (completion indicated by
- * the execution of the callback function) we have to
- * delay the initialization of the DMA engine to a moment we
- * actually have the proper bus addresses to feed the Tiger
- * and our DMA control blocks. This will be done in
- * itjc_bchannel_setup via a call to itjc_dma_start.
- */
- bus_dmamap_load(
- ctx->tag, /* DMA tag */
- ctx->map, /* DMA map */
- ctx->pool, /* KV addr of buffer */
- ITJC_DMA_POOL_BYTES, /* buffer size */
- itjc_map_callback, /* this receive the bus addr/error */
- ctx, /* callback aux arg */
- 0); /* flags */
-
- ++res_init_level;
-
- /*
- * Setup the AUX port so we can talk to the ISAC.
- */
- itjc_write_1(TIGER_AUX_PORT_CNTL, TIGER_AUX_NJ_DEFAULT);
- itjc_write_1(TIGER_INT1_MASK, TIGER_ISAC_INT);
-
- /*
- * From now on, almost like a `normal' ISIC driver.
- */
-
- sc->sc_unit = unit;
-
- ISAC_BASE = (caddr_t)ISIC_WHAT_ISAC;
-
- HSCX_A_BASE = (caddr_t)ISIC_WHAT_HSCXA;
- HSCX_B_BASE = (caddr_t)ISIC_WHAT_HSCXB;
-
- /* setup access routines */
-
- sc->clearirq = NULL;
- sc->readreg = itjc_read_reg;
- sc->writereg = itjc_write_reg;
-
- sc->readfifo = itjc_read_fifo;
- sc->writefifo = itjc_write_fifo;
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_NETJET_S;
-
- /* setup IOM bus type */
-
- sc->sc_bustyp = BUS_TYPE_IOM2;
-
- /* set up some other miscellaneous things */
- sc->sc_ipac = 0;
- sc->sc_bfifolen = 2 * ITJC_RING_SLOT_WORDS;
-
- printf("itjc%d: ISAC 2186 Version 1.1 (IOM-2)\n", unit);
-
- /* init the ISAC */
- itjc_isac_init(sc);
-
- chan = &sc->sc_chan[HSCX_CH_A];
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", NULL, MTX_DEF);
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", NULL, MTX_DEF);
- chan = &sc->sc_chan[HSCX_CH_B];
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", NULL, MTX_DEF);
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", NULL, MTX_DEF);
-
- /* init the "HSCX" */
- itjc_bchannel_setup(sc->sc_unit, HSCX_CH_A, BPROT_NONE, 0);
-
- itjc_bchannel_setup(sc->sc_unit, HSCX_CH_B, BPROT_NONE, 0);
-
- /* can't use the normal B-Channel stuff */
- itjc_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 */
-
- i4b_l1_mph_status_ind(L0ITJCUNIT(sc->sc_unit), STI_ATTACH,
- sc->sc_cardtyp, &itjc_l1mux_func);
-
- splx(s);
- return 0;
-
- fail:
- switch (res_init_level)
- {
- case 5:
- bus_dmamap_unload(ctx->tag, ctx->map);
- /* FALL TRHU */
-
- case 4:
- bus_dmamem_free(ctx->tag, ctx->pool, ctx->map);
- bus_dmamap_destroy(ctx->tag, ctx->map);
- /* FALL TRHU */
-
- case 3:
- bus_dma_tag_destroy(ctx->tag);
- /* FALL TRHU */
-
- case 2:
- bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_resources.irq);
- /* FALL TRHU */
-
- case 1:
- bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(0),
- sc->sc_resources.io_base[0]);
- /* FALL TRHU */
-
- case 0:
- break;
- }
-
- itjc_scp[unit] = NULL;
-
- splx(s);
- return error;
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_intr - main interrupt service routine.
- *---------------------------------------------------------------------------*/
-static void
-itjc_intr(void *xsc)
-{
- struct l1_softc *sc = xsc;
- l1_bchan_state_t *chan = &sc->sc_chan[0];
- dma_context_t *dma = &dma_context[sc->sc_unit];
- dma_rx_context_t *rxc = &dma_rx_context[sc->sc_unit][0];
- dma_tx_context_t *txc = &dma_tx_context[sc->sc_unit][0];
-
- itjc_bus_setup(sc);
-
- /* Honor interrupts from successfully configured cards only. */
- if (dma->state < ITJC_DS_STOPPED)
- return;
-
- /* First, we check the ISAC... */
- if (! (itjc_read_1(TIGER_AUX_PORT_DATA) & TIGER_ISAC_INT_MASK))
- {
- itjc_write_1(TIGER_INT1_STATUS, TIGER_ISAC_INT);
- NDBGL1(L1_H_IRQ, "ISAC");
- itjc_isac_intr(sc);
- }
-
- /* ... after what we always have a look at the DMA rings. */
-
- NDBGL1(L1_H_IRQ, "Tiger");
-
- itjc_read_1(TIGER_INT0_STATUS);
- itjc_write_1(TIGER_INT0_STATUS, TIGER_TARGET_ABORT_INT
- | TIGER_MASTER_ABORT_INT | TIGER_RD_END_INT
- | TIGER_RD_INT_INT | TIGER_WR_END_INT | TIGER_WR_INT_INT);
-
- itjc_dma_rx_intr(sc, chan, rxc);
- itjc_dma_tx_intr(sc, chan, txc);
-
- ++chan; ++rxc; ++txc;
-
- itjc_dma_rx_intr(sc, chan, rxc);
- itjc_dma_tx_intr(sc, chan, txc);
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_bchannel_setup - (Re)initialize and start/stop a Bchannel.
- *---------------------------------------------------------------------------*/
-static void
-itjc_bchannel_setup(int unit, int h_chan, int bprot, int activate)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = itjc_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
- int s = SPLI4B();
-
- NDBGL1(L1_BCHAN, "unit=%d, channel=%d, %s",
- unit, h_chan, activate ? "activate" : "deactivate");
-
- /*
- * If we are deactivating the channel, we have to stop
- * the DMA before we reset the channel control structures.
- */
- if (! activate)
- itjc_bchannel_dma_setup(sc, h_chan, activate);
-
- /* general part */
-
- chan->state = HSCX_IDLE;
-
- chan->unit = sc->sc_unit; /* unit number */
- chan->channel = h_chan; /* B channel */
- chan->bprot = bprot; /* B channel protocol */
-
- /* 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 */
-
- /*
- * Only setup & start the DMA after all other channel
- * control structures are in place.
- */
- if (activate)
- itjc_bchannel_dma_setup(sc, h_chan, activate);
-
- splx(s);
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_bchannel_start - Signal us we have more data to send.
- *---------------------------------------------------------------------------*/
-static void
-itjc_bchannel_start(int unit, int h_chan)
-{
-#if 0 /* Buggy code */
- /*
- * I disabled this routine because it was causing crashes when
- * this driver was used with the ISP (kernel SPPP) protocol driver.
- * The scenario is reproductible:
- * Use the -link1 (dial on demand) ifconfig option.
- * Start an interactive TCP connection to somewhere.
- * Wait until the PPP connection times out and is dropped.
- * Try to send something on the TCP connection.
- * The machine will print some garbage and halt or reboot
- * (no panic messages).
- *
- * I've nailed down the problem to the fact that this routine
- * was being called before the B channel had been setup again.
- *
- * For now, I don't have a good solution other than this one.
- * But, don't despair. The impact of it is unnoticeable.
- */
-
-#ifdef __FreeBSD__
- struct l1_softc *sc = itjc_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[h_chan];
-
- int s = SPLI4B();
-
- dma_tx_context_t *txc = &dma_tx_context[unit][h_chan];
-
- if (chan->state & HSCX_TX_ACTIVE)
- {
- splx(s);
- return;
- }
-
- itjc_dma_tx_intr(sc, chan, txc);
-
- splx(s);
-#endif
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_shutdown - Stop the driver and reset the card.
- *---------------------------------------------------------------------------*/
-static void
-itjc_shutdown(device_t dev)
-{
- struct l1_softc *sc = device_get_softc(dev);
-
- itjc_bus_setup(sc);
-
- /*
- * Stop the DMA the nice and easy way.
- */
- itjc_bchannel_setup(sc->sc_unit, 0, BPROT_NONE, 0);
- itjc_bchannel_setup(sc->sc_unit, 1, BPROT_NONE, 0);
-
- /*
- * Reset the card.
- */
- itjc_write_1(TIGER_RESET_PIB_CL_TIME, TIGER_RESET_ALL);
-
- DELAY(SEC_DELAY/100); /* Give it 10 ms to reset ...*/
-
- itjc_write_1(TIGER_RESET_PIB_CL_TIME,
- TIGER_SELF_ADDR_DMA | TIGER_LATCH_DMA_INT | TIGER_PIB_3_CYCLES);
-
- DELAY(SEC_DELAY/100); /* ... and more 10 to recover */
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_ret_linktab - Return the address of itjc drivers linktab.
- *---------------------------------------------------------------------------*/
-isdn_link_t *
-itjc_ret_linktab(int unit, int channel)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = itjc_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- return(&chan->isic_isdn_linktab);
-}
-
-/*---------------------------------------------------------------------------*
- * itjc_set_linktab - Set the driver linktab in the b channel softc.
- *---------------------------------------------------------------------------*/
-void
-itjc_set_linktab(int unit, int channel, drvr_link_t *dlt)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = itjc_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_t *chan = &sc->sc_chan[channel];
-
- chan->isic_drvr_linktab = dlt;
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_init_linktab - Initialize our local linktab.
- *---------------------------------------------------------------------------*/
-static void
-itjc_init_linktab(struct l1_softc *sc)
-{
- l1_bchan_state_t *chan = &sc->sc_chan[HSCX_CH_A];
- isdn_link_t *lt = &chan->isic_isdn_linktab;
-
- /* make sure the hardware driver is known to layer 4 */
- /* avoid overwriting if already set */
- if (ctrl_types[CTRL_PASSIVE].set_linktab == NULL)
- {
- ctrl_types[CTRL_PASSIVE].set_linktab = itjc_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = itjc_ret_linktab;
- }
-
- /* local setup */
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_A;
- lt->bch_config = itjc_bchannel_setup;
- lt->bch_tx_start = itjc_bchannel_start;
- lt->bch_stat = itjc_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->isic_isdn_linktab;
-
- lt->unit = sc->sc_unit;
- lt->channel = HSCX_CH_B;
- lt->bch_config = itjc_bchannel_setup;
- lt->bch_tx_start = itjc_bchannel_start;
- lt->bch_stat = itjc_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;
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_bchannel_stat - Collect link statistics for a given B channel.
- *---------------------------------------------------------------------------*/
-static void
-itjc_bchannel_stat(int unit, int h_chan, bchan_statistics_t *bsp)
-{
-#ifdef __FreeBSD__
- struct l1_softc *sc = itjc_scp[unit];
-#else
- struct l1_softc *sc = isic_find_sc(unit);
-#endif
- l1_bchan_state_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);
-}
-
-
-/*---------------------------------------------------------------------------*
- * Netjet - ISAC interrupt routine.
- *---------------------------------------------------------------------------*/
-static void
-itjc_isac_intr(struct l1_softc *sc)
-{
- register u_char irq_stat;
-
- do
- {
- /* get isac irq status */
- irq_stat = ISAC_READ(I_ISTA);
-
- if(irq_stat)
- itjc_isac_irq(sc, irq_stat); /* isac handler */
- }
- while(irq_stat);
-
- ISAC_WRITE(I_MASK, 0xff);
-
- DELAY(100);
-
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
-
-
-/*---------------------------------------------------------------------------*
- * itjc_recover - Try to recover from ISAC irq lockup.
- *---------------------------------------------------------------------------*/
-void
-itjc_recover(struct l1_softc *sc)
-{
- u_char byte;
-
- /* get isac irq status */
-
- byte = ISAC_READ(I_ISTA);
-
- NDBGL1(L1_ERROR, " ISAC: ISTA = 0x%x", byte);
-
- if(byte & ISAC_ISTA_EXI)
- NDBGL1(L1_ERROR, " ISAC: EXIR = 0x%x", (u_char)ISAC_READ(I_EXIR));
-
- if(byte & ISAC_ISTA_CISQ)
- {
- byte = ISAC_READ(I_CIRR);
-
- NDBGL1(L1_ERROR, " ISAC: CISQ = 0x%x", byte);
-
- if(byte & ISAC_CIRR_SQC)
- NDBGL1(L1_ERROR, " ISAC: SQRR = 0x%x", (u_char)ISAC_READ(I_SQRR));
- }
-
- NDBGL1(L1_ERROR, " ISAC: IMASK = 0x%x", ISAC_IMASK);
-
- ISAC_WRITE(I_MASK, 0xff);
- DELAY(100);
- ISAC_WRITE(I_MASK, ISAC_IMASK);
-}
diff --git a/sys/i4b/layer1/iwic/i4b_iwic.h b/sys/i4b/layer1/iwic/i4b_iwic.h
deleted file mode 100644
index f48811f..0000000
--- a/sys/i4b/layer1/iwic/i4b_iwic.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Dave Boyce. 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_iwic - isdn4bsd Winbond W6692 driver
- * ----------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Jan 21 11:08:44 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IWIC_H_
-#define _I4B_IWIC_H_
-
-#include <i4b/layer1/iwic/i4b_iwic_ext.h>
-
-/*---------------------------------------------------------------------------*
- * PCI resources used
- *---------------------------------------------------------------------------*/
-
-#define INFO_IO_BASES 2
-
-struct i4b_info {
- struct resource * io_base[INFO_IO_BASES];
- int io_rid [INFO_IO_BASES];
- struct resource * irq;
- int irq_rid;
- struct resource * mem;
- int mem_rid;
-};
-
-/*---------------------------------------------------------------------------*
- * state of a B channel
- *---------------------------------------------------------------------------*/
-struct iwic_bchan
-{
- int unit; /* unit number */
- int channel; /* channel number */
- int offset; /* offset from iobase */
- int bprot; /* b channel protocol used */
- int state; /* transceiver state: */
-#define ST_IDLE 0x00 /* channel idle */
-#define ST_TX_ACTIVE 0x01 /* tx running */
-
- int sc_trace_bcount;
-
- /* 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 */
-
- /* linktab */
-
- isdn_link_t iwic_isdn_linktab;
- drvr_link_t *iwic_drvr_linktab;
-};
-
-/*---------------------------------------------------------------------------*
- * state of a D channel
- *---------------------------------------------------------------------------*/
-struct iwic_dchan
-{
- int enabled;
- int trace_count;
- struct mbuf *ibuf;
- u_char *ibuf_ptr; /* Input buffer pointer */
- int ibuf_len; /* Current length of input buffer */
- int ibuf_max_len; /* Max length in input buffer */
- int rx_count;
-
- int tx_ready; /* Can send next 64 bytes of data. */
- int tx_count;
-
- struct mbuf *obuf;
- int free_obuf;
- u_char *obuf_ptr;
- int obuf_len;
-
- struct mbuf *obuf2;
- int free_obuf2;
-};
-
-/*---------------------------------------------------------------------------*
- * state of one iwic unit
- *---------------------------------------------------------------------------*/
-struct iwic_softc
-{
- int sc_unit;
- u_int32_t sc_iobase;
- int sc_trace;
- int sc_cardtyp;
-
- int sc_I430state;
- int sc_I430T3;
-
- int enabled;
-
- struct iwic_dchan sc_dchan;
- struct iwic_bchan sc_bchan[2];
-
- struct i4b_info sc_resources;
-};
-
-/*---------------------------------------------------------------------------*
- * rd/wr register/fifo macros
- *---------------------------------------------------------------------------*/
-#define IWIC_READ(sc,reg) (inb ((sc)->sc_iobase + (u_int32_t)(reg)))
-#define IWIC_WRITE(sc,reg,val) (outb ((sc)->sc_iobase + (u_int32_t)(reg), (val)))
-#define IWIC_WRDFIFO(sc,p,l) (outsb ((sc)->sc_iobase + D_XFIFO, (p), (l)))
-#define IWIC_RDDFIFO(sc,p,l) (insb ((sc)->sc_iobase + D_RFIFO, (p), (l)))
-#define IWIC_WRBFIFO(sc,b,p,l) (outsb (((sc)->sc_iobase + (b)->offset + B_XFIFO), (p), (l)))
-#define IWIC_RDBFIFO(sc,b,p,l) (insb (((sc)->sc_iobase + (b)->offset + B_RFIFO), (p), (l)))
-
-/*---------------------------------------------------------------------------*
- * possible I.430 states
- *---------------------------------------------------------------------------*/
-enum I430states
-{
- ST_F3N, /* F3 Deactivated, no clock */
- 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 events
- *---------------------------------------------------------------------------*/
-enum I430events
-{
- EV_PHAR, /* PH ACTIVATE REQUEST */
- EV_CE, /* Clock enabled */
- 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
-};
-
-/*---------------------------------------------------------------------------*
- * available commands
- *---------------------------------------------------------------------------*/
-enum I430commands
-{
- CMD_ECK, /* Enable clock */
- CMD_TIM, /* Timing */
- CMD_RT, /* Reset */
- CMD_AR8, /* Activation request pri 8 */
- CMD_AR10, /* Activation request pri 10 */
- CMD_DIU, /* Deactivate Indication Upstream */
- CMD_ILL /* Illegal command */
-};
-
-
-extern struct iwic_softc iwic_sc[];
-
-#define iwic_find_sc(unit) (&iwic_sc[(unit)])
-
-extern void iwic_init(struct iwic_softc *);
-extern void iwic_next_state(struct iwic_softc *, int);
-
-extern void iwic_dchan_init(struct iwic_softc *);
-extern void iwic_dchan_xirq(struct iwic_softc *);
-extern void iwic_dchan_xfer_irq(struct iwic_softc *, int);
-extern void iwic_dchan_disable(struct iwic_softc *sc);
-extern int iwic_dchan_data_req(struct iwic_softc *sc, struct mbuf *m, int freeflag);
-extern void iwic_dchan_transmit(struct iwic_softc *sc);
-
-char *iwic_printstate(struct iwic_softc *sc);
-
-void iwic_init_linktab(struct iwic_softc *sc);
-void iwic_bchan_xirq(struct iwic_softc *, int);
-void iwic_bchannel_setup(int unit, int h_chan, int bprot, int activate);
-
-#endif /* _I4B_IWIC_H_ */
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_bchan.c b/sys/i4b/layer1/iwic/i4b_iwic_bchan.c
deleted file mode 100644
index 66b1b53..0000000
--- a/sys/i4b/layer1/iwic/i4b_iwic_bchan.c
+++ /dev/null
@@ -1,767 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Dave Boyce. All rights reserved.
- * Copyright (c) 2000, 2001 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_iwic - isdn4bsd Winbond W6692 driver
- * ----------------------------------------
- * last edit-date: [Tue Jan 16 13:21:24 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/iwic/i4b_iwic.h>
-#include <i4b/layer1/iwic/i4b_w6692.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_mbuf.h>
-
-static void iwic_bchan_init(struct iwic_softc *sc, int chan_no, int activate);
-
-/*---------------------------------------------------------------------------*
- * B-channel interrupt handler
- *---------------------------------------------------------------------------*/
-void
-iwic_bchan_xirq(struct iwic_softc *sc, int chan_no)
-{
- int irq_stat;
- struct iwic_bchan *chan;
- int cmd = 0;
- int activity = 0;
-
- chan = &sc->sc_bchan[chan_no];
-
- irq_stat = IWIC_READ(sc, chan->offset + B_EXIR);
-
- NDBGL1(L1_H_IRQ, "irq_stat = 0x%x", irq_stat);
-
- if((irq_stat & (B_EXIR_RMR | B_EXIR_RME | B_EXIR_RDOV | B_EXIR_XFR | B_EXIR_XDUN)) == 0)
- {
- NDBGL1(L1_H_XFRERR, "spurious IRQ!");
- return;
- }
-
- if (irq_stat & B_EXIR_RDOV)
- {
- NDBGL1(L1_H_XFRERR, "iwic%d: EXIR B-channel Receive Data Overflow", sc->sc_unit);
- }
-
- if (irq_stat & B_EXIR_XDUN)
- {
- NDBGL1(L1_H_XFRERR, "iwic%d: EXIR B-channel Transmit Data Underrun", sc->sc_unit);
- cmd |= (B_CMDR_XRST); /*XXX must retransmit frame ! */
- }
-
-/* RX message end interrupt */
-
- if(irq_stat & B_EXIR_RME)
- {
- int error;
-
- NDBGL1(L1_H_IRQ, "B_EXIR_RME");
-
- error = (IWIC_READ(sc,chan->offset+B_STAR) &
- (B_STAR_RDOV | B_STAR_CRCE | B_STAR_RMB));
-
- if(error)
- {
- if(error & B_STAR_RDOV)
- NDBGL1(L1_H_XFRERR, "iwic%d: B-channel Receive Data Overflow", sc->sc_unit);
- if(error & B_STAR_CRCE)
- NDBGL1(L1_H_XFRERR, "iwic%d: B-channel CRC Error", sc->sc_unit);
- if(error & B_STAR_RMB)
- NDBGL1(L1_H_XFRERR, "iwic%d: B-channel Receive Message Aborted", sc->sc_unit);
- }
-
- /* all error conditions checked, now decide and take action */
-
- if(error == 0)
- {
- register int fifo_data_len;
- fifo_data_len = ((IWIC_READ(sc,chan->offset+B_RBCL)) &
- ((IWIC_BCHAN_FIFO_LEN)-1));
-
- if(fifo_data_len == 0)
- fifo_data_len = IWIC_BCHAN_FIFO_LEN;
-
-
- if(chan->in_mbuf == NULL)
- {
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 iwic_bchan_irq: RME, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- if((chan->in_len + fifo_data_len) <= BCH_MAX_DATALEN)
- {
- /* read data from fifo */
-
- NDBGL1(L1_H_IRQ, "B_EXIR_RME, rd fifo, len = %d", fifo_data_len);
-
- IWIC_RDBFIFO(sc, chan, chan->in_cbptr, fifo_data_len);
-
- cmd |= (B_CMDR_RACK | B_CMDR_RACT);
- IWIC_WRITE(sc, chan->offset + B_CMDR, 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 = L0IWICUNIT(sc->sc_unit);
- hdr.type = (chan_no == IWIC_BCH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_bchan[chan_no].sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- (*chan->iwic_drvr_linktab->bch_rx_data_ready)(chan->iwic_drvr_linktab->unit);
-
- activity = ACT_RX;
-
- /* mark buffer ptr as unused */
-
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- else
- {
- NDBGL1(L1_H_XFRERR, "RAWHDLC rx buffer overflow in RME, in_len=%d, fifolen=%d", chan->in_len, fifo_data_len);
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- cmd |= (B_CMDR_RRST | B_CMDR_RACK);
- }
- }
- else
- {
- if (chan->in_mbuf != NULL)
- {
- i4b_Bfreembuf(chan->in_mbuf);
- chan->in_mbuf = NULL;
- chan->in_cbptr = NULL;
- chan->in_len = 0;
- }
- cmd |= (B_CMDR_RRST | B_CMDR_RACK);
- }
- }
-
-/* RX fifo full interrupt */
-
- if(irq_stat & B_EXIR_RMR)
- {
- NDBGL1(L1_H_IRQ, "B_EXIR_RMR");
-
- if(chan->in_mbuf == NULL)
- {
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 iwic_bchan_irq: RMR, cannot allocate mbuf!\n");
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- }
-
- chan->rxcount += IWIC_BCHAN_FIFO_LEN;
-
- if((chan->in_len + IWIC_BCHAN_FIFO_LEN) <= BCH_MAX_DATALEN)
- {
- /* read data from fifo */
-
- NDBGL1(L1_H_IRQ, "B_EXIR_RMR, rd fifo, len = max (64)");
-
- IWIC_RDBFIFO(sc, chan, chan->in_cbptr, IWIC_BCHAN_FIFO_LEN);
-
- chan->in_cbptr += IWIC_BCHAN_FIFO_LEN;
- chan->in_len += IWIC_BCHAN_FIFO_LEN;
- }
- 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 = L0IWICUNIT(sc->sc_unit);
- hdr.type = (chan_no == IWIC_BCH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_bchan[chan_no].sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, chan->in_mbuf->m_len, chan->in_mbuf->m_data);
- }
-
- /* silence detection */
-
- if(!(i4b_l1_bchan_tel_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
- activity = ACT_RX;
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- (void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
-#else
- if(!(IF_QFULL(&chan->rx_queue)))
- {
- IF_ENQUEUE(&chan->rx_queue, chan->in_mbuf);
- }
- else
- {
- i4b_Bfreembuf(chan->in_mbuf);
- }
-#endif
- /* signal upper driver that data is available */
-
- (*chan->iwic_drvr_linktab->bch_rx_data_ready)(chan->iwic_drvr_linktab->unit);
-
- /* alloc new buffer */
-
- if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL)
- panic("L1 iwic_bchan_irq: RMR, cannot allocate new mbuf!\n");
-
- /* setup new data ptr */
-
- chan->in_cbptr = chan->in_mbuf->m_data;
-
- /* read data from fifo */
-
- NDBGL1(L1_H_IRQ, "B_EXIR_RMR, rd fifo1, len = max (64)");
-
- IWIC_RDBFIFO(sc, chan, chan->in_cbptr, IWIC_BCHAN_FIFO_LEN);
-
- chan->in_cbptr += IWIC_BCHAN_FIFO_LEN;
- chan->in_len = IWIC_BCHAN_FIFO_LEN;
-
- chan->rxcount += IWIC_BCHAN_FIFO_LEN;
- }
- else
- {
- NDBGL1(L1_H_XFRERR, "RAWHDLC rx buffer overflow in RPF, in_len=%d", chan->in_len);
- chan->in_cbptr = chan->in_mbuf->m_data;
- chan->in_len = 0;
- cmd |= (B_CMDR_RRST | B_CMDR_RACK);
- }
- }
-
- /* command to release fifo space */
-
- cmd |= B_CMDR_RACK;
- }
-
-/* TX interrupt */
-
- if (irq_stat & B_EXIR_XFR)
- {
- /* transmit fifo empty, new data can be written to fifo */
-
- int activity = -1;
- int len;
- int nextlen;
-
- NDBGL1(L1_H_IRQ, "B_EXIR_XFR");
-
- 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 &= ~ST_TX_ACTIVE;
- (*chan->iwic_drvr_linktab->bch_tx_queue_empty)(chan->iwic_drvr_linktab->unit);
- }
- else
- {
- chan->state |= ST_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 = L0IWICUNIT(sc->sc_unit);
- hdr.type = (chan_no == IWIC_BCH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_bchan[chan_no].sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- if(chan->bprot == BPROT_NONE)
- {
- if(!(i4b_l1_bchan_tel_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 != IWIC_BCHAN_FIFO_LEN)
- {
- nextlen = min(chan->out_mbuf_cur_len, IWIC_BCHAN_FIFO_LEN - len);
-
- NDBGL1(L1_H_IRQ, "B_EXIR_XFR, wr fifo, len = %d", nextlen);
-
- IWIC_WRBFIFO(sc, chan, chan->out_mbuf_cur_ptr, nextlen);
-
- cmd |= B_CMDR_XMS;
-
- 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 = L0IWICUNIT(sc->sc_unit);
- hdr.type = (chan_no == IWIC_BCH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_bchan[chan_no].sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
- }
- else
- {
- if (chan->bprot != BPROT_NONE)
- cmd |= B_CMDR_XME;
- i4b_Bfreembuf(chan->out_mbuf_head);
- chan->out_mbuf_head = NULL;
- }
- }
- }
- }
- if(cmd)
- {
- cmd |= B_CMDR_RACT;
- IWIC_WRITE(sc, chan->offset + B_CMDR, cmd);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * initialize one B channels rx/tx data structures
- *---------------------------------------------------------------------------*/
-void
-iwic_bchannel_setup(int unit, int chan_no, int bprot, int activate)
-{
- struct iwic_softc *sc = &iwic_sc[unit];
- struct iwic_bchan *chan = &sc->sc_bchan[chan_no];
-
- int s = SPLI4B();
-
- NDBGL1(L1_BCHAN, "unit %d, chan %d, bprot %d, activate %d", unit, chan_no, bprot, activate);
-
- /* general part */
-
- chan->bprot = bprot; /* B channel protocol */
- chan->state = ST_IDLE; /* B channel state */
-
- if(activate == 0)
- {
- /* deactivation */
- iwic_bchan_init(sc, chan_no, activate);
- }
-
- /* receiver part */
-
- chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_iwic_rx", NULL, MTX_DEF);
-#endif
-
- i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
-
- 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 */
-
- chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
-
-#if defined (__FreeBSD__) && __FreeBSD__ > 4
- if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_iwic_tx", NULL, MTX_DEF);
-#endif
-
- i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
-
- 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 */
- iwic_bchan_init(sc, chan_no, activate);
- }
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * initalize / deinitialize B-channel hardware
- *---------------------------------------------------------------------------*/
-static void
-iwic_bchan_init(struct iwic_softc *sc, int chan_no, int activate)
-{
- struct iwic_bchan *bchan = &sc->sc_bchan[chan_no];
-
- NDBGL1(L1_BCHAN, "chan %d, activate %d", chan_no, activate);
-
- if(activate)
- {
- if(bchan->bprot == BPROT_NONE)
- {
- /* Extended transparent mode */
- IWIC_WRITE(sc, bchan->offset + B_MODE, B_MODE_MMS);
- }
- else
- {
- /* Transparent mode */
- IWIC_WRITE(sc, bchan->offset + B_MODE, 0);
- /* disable address comparation */
- IWIC_WRITE (sc, bchan->offset+B_ADM1, 0xff);
- IWIC_WRITE (sc, bchan->offset+B_ADM2, 0xff);
- }
-
- /* reset & start receiver */
- IWIC_WRITE(sc, bchan->offset + B_CMDR, B_CMDR_RRST|B_CMDR_RACT);
-
- /* clear irq mask */
- IWIC_WRITE(sc, bchan->offset + B_EXIM, 0);
- }
- else
- {
- /* mask all irqs */
- IWIC_WRITE(sc, bchan->offset + B_EXIM, 0xff);
-
- /* reset mode */
- IWIC_WRITE(sc, bchan->offset + B_MODE, 0);
-
- /* Bring interface down */
- IWIC_WRITE(sc, bchan->offset + B_CMDR, B_CMDR_RRST | B_CMDR_XRST);
-
- /* Flush pending interrupts */
- IWIC_READ(sc, bchan->offset + B_EXIR);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * start transmission on a b channel
- *---------------------------------------------------------------------------*/
-static void
-iwic_bchannel_start(int unit, int chan_no)
-{
- struct iwic_softc *sc = &iwic_sc[unit];
- register struct iwic_bchan *chan = &sc->sc_bchan[chan_no];
- register int next_len;
- register int len;
-
- int s;
- int activity = -1;
- int cmd = 0;
-
- s = SPLI4B(); /* enter critical section */
-
- NDBGL1(L1_BCHAN, "unit %d, channel %d", unit, chan_no);
-
- if(chan->state & ST_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(!(i4b_l1_bchan_tel_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
- activity = ACT_TX;
- }
- else
- {
- activity = ACT_TX;
- }
-
- chan->state |= ST_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 = L0IWICUNIT(unit);
- hdr.type = (chan_no == IWIC_BCH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_bchan[chan_no].sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, chan->out_mbuf_cur->m_len, chan->out_mbuf_cur->m_data);
- }
-
- len = 0; /* # of chars put into tx fifo this time */
-
- /*
- * fill the tx fifo with data from the current mbuf. if
- * current mbuf holds less data than 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 chip that it has to send
- * CRC and closing flag
- */
-
- while((len < IWIC_BCHAN_FIFO_LEN) && chan->out_mbuf_cur)
- {
- /*
- * put as much data into the fifo as is
- * available from the current mbuf
- */
-
- if((len + chan->out_mbuf_cur_len) >= IWIC_BCHAN_FIFO_LEN)
- next_len = IWIC_BCHAN_FIFO_LEN - len;
- else
- next_len = chan->out_mbuf_cur_len;
-
- /* write what we have from current mbuf to fifo */
-
- IWIC_WRBFIFO(sc, 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 = L0IWICUNIT(unit);
- hdr.type = (chan_no == IWIC_BCH_A ? TRC_CH_B1 : TRC_CH_B2);
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_bchan[chan_no].sc_trace_bcount;
- MICROTIME(hdr.time);
- i4b_l1_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 the chip. if there 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 tx fifo is done in the
- * interrupt routine.
- */
-
- cmd |= B_CMDR_XMS;
- }
- else
- {
- /* end of mbuf chain */
-
- if(chan->bprot == BPROT_NONE)
- cmd |= B_CMDR_XMS;
- else
- cmd |= (B_CMDR_XMS | B_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->iwic_drvr_linktab->bch_activity)(chan->iwic_drvr_linktab->unit, activity);
-
- if(cmd)
- {
- cmd |= B_CMDR_RACT;
- IWIC_WRITE(sc, chan->offset + B_CMDR, cmd);
- }
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * return B-channel statistics
- *---------------------------------------------------------------------------*/
-static void
-iwic_bchannel_stat(int unit, int chan_no, bchan_statistics_t *bsp)
-{
- struct iwic_softc *sc = iwic_find_sc(unit);
- struct iwic_bchan *bchan = &sc->sc_bchan[chan_no];
-
- int s = SPLI4B();
-
- bsp->outbytes = bchan->txcount;
- bsp->inbytes = bchan->rxcount;
-
- bchan->txcount = 0;
- bchan->rxcount = 0;
-
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * initialize our local linktab
- *---------------------------------------------------------------------------*/
-void
-iwic_init_linktab(struct iwic_softc *sc)
-{
- struct iwic_bchan *chan;
- isdn_link_t *lt;
-
- /* make sure the hardware driver is known to layer 4 */
- ctrl_types[CTRL_PASSIVE].set_linktab = i4b_l1_set_linktab;
- ctrl_types[CTRL_PASSIVE].get_linktab = i4b_l1_ret_linktab;
-
- /* channel A */
-
- chan = &sc->sc_bchan[IWIC_BCH_A];
- lt = &chan->iwic_isdn_linktab;
-
- lt->unit = sc->sc_unit;
- lt->channel = IWIC_BCH_A;
- lt->bch_config = iwic_bchannel_setup;
- lt->bch_tx_start = iwic_bchannel_start;
- lt->bch_stat = iwic_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;
-
- /* channel B */
-
- chan = &sc->sc_bchan[IWIC_BCH_B];
- lt = &chan->iwic_isdn_linktab;
-
- lt->unit = sc->sc_unit;
- lt->channel = IWIC_BCH_B;
- lt->bch_config = iwic_bchannel_setup;
- lt->bch_tx_start = iwic_bchannel_start;
- lt->bch_stat = iwic_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;
-}
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_dchan.c b/sys/i4b/layer1/iwic/i4b_iwic_dchan.c
deleted file mode 100644
index d6ffa66..0000000
--- a/sys/i4b/layer1/iwic/i4b_iwic_dchan.c
+++ /dev/null
@@ -1,467 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Dave Boyce. 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_iwic - isdn4bsd Winbond W6692 driver
- * ----------------------------------------
- * last edit-date: [Tue Jan 16 13:20:14 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer1/iwic/i4b_iwic.h>
-#include <i4b/layer1/iwic/i4b_w6692.h>
-
-#define MAX_DFRAME_LEN 264
-
-static void dchan_receive(struct iwic_softc *sc, int ista);
-
-/*---------------------------------------------------------------------------*
- * initialize D-channel variables and registers
- *---------------------------------------------------------------------------*/
-void
-iwic_dchan_init(struct iwic_softc *sc)
-{
- sc->sc_dchan.ibuf = NULL;
- sc->sc_dchan.rx_count = 0;
-
- sc->sc_dchan.obuf = NULL;
- sc->sc_dchan.obuf2 = NULL;
- sc->sc_dchan.tx_count = 0;
- sc->sc_dchan.tx_ready = 0;
-
- IWIC_WRITE(sc, D_CTL, D_CTL_SRST);
-
- DELAY(5000);
-
- IWIC_WRITE(sc, D_CTL, 0);
-
- IWIC_WRITE(sc, SQX, SQX_SCIE);
-
- IWIC_WRITE(sc, PCTL, 0x00);
- IWIC_WRITE(sc, MOCR, 0x00);
- IWIC_WRITE(sc, GCR, 0x00);
-
- IWIC_WRITE(sc, D_CMDR, D_CMDR_RRST | D_CMDR_XRST);
- IWIC_WRITE(sc, D_MODE, D_MODE_RACT);
-
- IWIC_WRITE(sc, D_SAM, 0xff);
- IWIC_WRITE(sc, D_TAM, 0xff);
-
- IWIC_WRITE(sc, D_EXIM, 0x00);
-}
-
-/*---------------------------------------------------------------------------*
- * Extended IRQ handler for the D-channel
- *---------------------------------------------------------------------------*/
-void
-iwic_dchan_xirq(struct iwic_softc *sc)
-{
- int irq_stat;
- int stat;
-
- irq_stat = IWIC_READ(sc, D_EXIR);
-
- if (irq_stat & D_EXIR_RDOV)
- {
- NDBGL1(L1_I_ERR, "RDOV in state %s", iwic_printstate(sc));
- IWIC_WRITE(sc, D_CMDR, D_CMDR_RRST);
- }
- if (irq_stat & D_EXIR_XDUN)
- {
- NDBGL1(L1_I_ERR, "XDUN in state %s", iwic_printstate(sc));
- sc->sc_dchan.tx_ready = 0;
- }
- if (irq_stat & D_EXIR_XCOL)
- {
- NDBGL1(L1_I_ERR, "XCOL in state %s", iwic_printstate(sc));
- IWIC_WRITE(sc, D_CMDR, D_CMDR_XRST);
- sc->sc_dchan.tx_ready = 0;
- }
- if (irq_stat & D_EXIR_TIN2)
- {
- NDBGL1(L1_I_ERR, "TIN2 in state %s", iwic_printstate(sc));
- }
- if (irq_stat & D_EXIR_MOC)
- {
- stat = IWIC_READ(sc, MOR);
- NDBGL1(L1_I_ERR, "MOC in state %s, byte = 0x%x", iwic_printstate(sc), stat);
- }
-
- if (irq_stat & D_EXIR_ISC)
- {
- stat = (IWIC_READ(sc, CIR)) & 0x0f;
-
- switch (stat)
- {
- case CIR_CE:
- NDBGL1(L1_I_CICO, "rx CE in state %s", iwic_printstate(sc));
- iwic_next_state(sc, EV_CE);
- break;
- case CIR_DRD:
- NDBGL1(L1_I_CICO, "rx DRD in state %s", iwic_printstate(sc));
- iwic_next_state(sc, EV_INFO0);
- i4b_l1_mph_status_ind(L0IWICUNIT(sc->sc_unit), STI_L1STAT, LAYER_IDLE, NULL);
- break;
- case CIR_LD:
- NDBGL1(L1_I_CICO, "rx LD in state %s", iwic_printstate(sc));
- iwic_next_state(sc, EV_RSY);
- break;
- case CIR_ARD:
- NDBGL1(L1_I_CICO, "rx ARD in state %s", iwic_printstate(sc));
- iwic_next_state(sc, EV_INFO2);
- break;
- case CIR_TI:
- NDBGL1(L1_I_CICO, "rx TI in state %s", iwic_printstate(sc));
- iwic_next_state(sc, EV_INFO0);
- break;
- case CIR_ATI:
- NDBGL1(L1_I_CICO, "rx ATI in state %s", iwic_printstate(sc));
- iwic_next_state(sc, EV_INFO0);
- break;
- case CIR_AI8:
- NDBGL1(L1_I_CICO, "rx AI8 in state %s", iwic_printstate(sc));
- i4b_l1_mph_status_ind(L0IWICUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- iwic_next_state(sc, EV_INFO48);
- break;
- case CIR_AI10:
- NDBGL1(L1_I_CICO, "rx AI10 in state %s", iwic_printstate(sc));
- i4b_l1_mph_status_ind(L0IWICUNIT(sc->sc_unit), STI_L1STAT, LAYER_ACTIVE, NULL);
- iwic_next_state(sc, EV_INFO410);
- break;
- case CIR_CD:
- NDBGL1(L1_I_CICO, "rx DIS in state %s", iwic_printstate(sc));
- iwic_next_state(sc, EV_DIS);
- break;
- default:
- NDBGL1(L1_I_ERR, "ERROR, unknown indication 0x%x in state %s", stat, iwic_printstate(sc));
- iwic_next_state(sc, EV_INFO0);
- break;
- }
- }
-
- if (irq_stat & D_EXIR_TEXP)
- {
- NDBGL1(L1_I_ERR, "TEXP in state %s", iwic_printstate(sc));
- }
-
- if (irq_stat & D_EXIR_WEXP)
- {
- NDBGL1(L1_I_ERR, "WEXP in state %s", iwic_printstate(sc));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * All receiving and transmitting takes place here.
- *---------------------------------------------------------------------------*/
-void
-iwic_dchan_xfer_irq(struct iwic_softc *sc, int ista)
-{
- NDBGL1(L1_I_MSG, "ISTA = 0x%x", ista);
-
- if (ista & (ISTA_D_RMR | ISTA_D_RME))
- {
- /* Receive message ready */
- dchan_receive(sc, ista);
- }
- if (ista & ISTA_D_XFR)
- {
- /* Transmitter ready */
- sc->sc_dchan.tx_ready = 1;
-
- iwic_dchan_transmit(sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * disable D-channel
- *---------------------------------------------------------------------------*/
-void
-iwic_dchan_disable(struct iwic_softc *sc)
-{
- int s;
-
- s = SPLI4B();
-
- if (sc->sc_dchan.obuf)
- {
- if (sc->sc_dchan.free_obuf)
- i4b_Dfreembuf(sc->sc_dchan.obuf);
- sc->sc_dchan.obuf = NULL;
- }
-
- if (sc->sc_dchan.obuf2)
- {
- if (sc->sc_dchan.free_obuf2)
- i4b_Dfreembuf(sc->sc_dchan.obuf2);
- sc->sc_dchan.obuf2 = NULL;
- }
-
- splx(s);
-
- IWIC_WRITE(sc, CIX, CIX_DRC);
-}
-
-/*---------------------------------------------------------------------------*
- * queue D-channel message for transmission
- *---------------------------------------------------------------------------*/
-int
-iwic_dchan_data_req(struct iwic_softc *sc, struct mbuf *m, int freeflag)
-{
- int s;
-
- if (!m)
- return 0;
-
- s = SPLI4B();
-
- /* Queue message */
-
- if (sc->sc_dchan.obuf)
- {
- if (sc->sc_dchan.obuf2)
- {
- NDBGL1(L1_I_ERR, "no buffer space!");
- }
- else
- {
- sc->sc_dchan.obuf2 = m;
- sc->sc_dchan.free_obuf2 = freeflag;
- }
- }
- else
- {
- sc->sc_dchan.obuf = m;
- sc->sc_dchan.obuf_ptr = m->m_data;
- sc->sc_dchan.obuf_len = m->m_len;
- sc->sc_dchan.free_obuf = freeflag;
- }
-
- iwic_dchan_transmit(sc);
-
- splx(s);
-
- return (0);
-}
-
-/*---------------------------------------------------------------------------*
- * allocate an mbuf
- *---------------------------------------------------------------------------*/
-static void
-dchan_get_mbuf(struct iwic_softc *sc, int len)
-{
- sc->sc_dchan.ibuf = i4b_Dgetmbuf(len);
-
- if (!sc->sc_dchan.ibuf)
- panic("dchan_get_mbuf: unable to allocate %d bytes for mbuf!\n", len);
-
- sc->sc_dchan.ibuf_ptr = sc->sc_dchan.ibuf->m_data;
- sc->sc_dchan.ibuf_max_len = sc->sc_dchan.ibuf->m_len;
- sc->sc_dchan.ibuf_len = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * D-channel receive data interrupt
- *---------------------------------------------------------------------------*/
-static void
-dchan_receive(struct iwic_softc *sc, int ista)
-{
- int command = D_CMDR_RACK;
-
- if (ista & ISTA_D_RMR)
- {
- /* Got 64 bytes in FIFO */
-
- if (!sc->sc_dchan.ibuf)
- {
- dchan_get_mbuf(sc, MAX_DFRAME_LEN);
-
- }
- else if ((sc->sc_dchan.ibuf_len + MAX_DFRAME_LEN) >
- sc->sc_dchan.ibuf_max_len)
- {
- panic("dchan_receive: not enough space in buffer!\n");
- }
-
- IWIC_RDDFIFO(sc, sc->sc_dchan.ibuf_ptr, 64);
-
- sc->sc_dchan.ibuf_ptr += 64;
- sc->sc_dchan.ibuf_len += 64;
- sc->sc_dchan.rx_count += 64;
- }
- if (ista & ISTA_D_RME)
- {
- /* Got end of frame */
- int status;
-
- status = IWIC_READ(sc, D_RSTA);
-
- if (status & (D_RSTA_RDOV | D_RSTA_CRCE | D_RSTA_RMB))
- {
- if (status & D_RSTA_RDOV)
- NDBGL1(L1_I_ERR, "iwic%d: D-channel Receive Data Overflow", sc->sc_unit);
- if (status & D_RSTA_CRCE)
- NDBGL1(L1_I_ERR, "iwic%d: D-channel CRC Error", sc->sc_unit);
- if (status & D_RSTA_RMB)
- NDBGL1(L1_I_ERR, "iwic%d: D-channel Receive Message Aborted", sc->sc_unit);
- command |= D_CMDR_RRST;
- }
- else
- {
- int hi, lo;
- int total_frame_len;
-
- lo = IWIC_READ(sc, D_RBCL);
- hi = IWIC_READ(sc, D_RBCH);
- total_frame_len = D_RBC(hi, lo);
- lo = lo & 0x3f;
-
- if (lo == 0)
- lo = IWIC_DCHAN_FIFO_LEN;
-
- if (!sc->sc_dchan.ibuf)
- {
- dchan_get_mbuf(sc, lo);
- }
- else if ((sc->sc_dchan.ibuf_len + lo) >
- sc->sc_dchan.ibuf_max_len)
- {
- panic("dchan_receive: buffer not long enough");
- }
-
- IWIC_RDDFIFO(sc, sc->sc_dchan.ibuf_ptr, lo);
- sc->sc_dchan.ibuf_len += lo;
- sc->sc_dchan.rx_count += lo;
-
- sc->sc_dchan.ibuf->m_len = sc->sc_dchan.ibuf_len;
-
- if(sc->sc_trace & TRACE_D_RX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = L0IWICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_NT;
- hdr.count = ++sc->sc_dchan.trace_count;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, sc->sc_dchan.ibuf->m_len, sc->sc_dchan.ibuf->m_data);
- }
- i4b_l1_ph_data_ind(L0IWICUNIT(sc->sc_unit), sc->sc_dchan.ibuf);
-
- sc->sc_dchan.ibuf = NULL;
- }
- }
- IWIC_WRITE(sc, D_CMDR, command);
-}
-
-/*---------------------------------------------------------------------------*
- * transmit D-channel frame
- *---------------------------------------------------------------------------*/
-void
-iwic_dchan_transmit(struct iwic_softc *sc)
-{
- int cmd;
- u_char *ptr;
- int len;
-
- if (!sc->sc_dchan.tx_ready)
- return;
-
- if (!sc->sc_dchan.obuf)
- return;
-
- if (sc->sc_I430state != ST_F7)
- return;
-
- ptr = sc->sc_dchan.obuf_ptr;
- len = min(sc->sc_dchan.obuf_len, IWIC_DCHAN_FIFO_LEN);
-
- if(sc->sc_trace & TRACE_D_TX)
- {
- i4b_trace_hdr_t hdr;
- hdr.unit = L0IWICUNIT(sc->sc_unit);
- hdr.type = TRC_CH_D;
- hdr.dir = FROM_TE;
- hdr.count = ++sc->sc_dchan.trace_count;
- MICROTIME(hdr.time);
- i4b_l1_trace_ind(&hdr, len, ptr);
- }
-
- IWIC_WRDFIFO(sc, ptr, len);
-
- sc->sc_dchan.tx_count += len;
-
- if (len < sc->sc_dchan.obuf_len)
- {
- sc->sc_dchan.obuf_ptr += len;
- sc->sc_dchan.obuf_len -= len;
-
- cmd = D_CMDR_XMS;
-
- }
- else
- {
- if (sc->sc_dchan.free_obuf)
- i4b_Dfreembuf(sc->sc_dchan.obuf);
-
- sc->sc_dchan.obuf = NULL;
- sc->sc_dchan.obuf_ptr = NULL;
- sc->sc_dchan.obuf_len = 0;
-
- if (sc->sc_dchan.obuf2)
- {
- sc->sc_dchan.obuf = sc->sc_dchan.obuf2;
- sc->sc_dchan.obuf_ptr = sc->sc_dchan.obuf->m_data;
- sc->sc_dchan.obuf_len = sc->sc_dchan.obuf->m_len;
- sc->sc_dchan.free_obuf = sc->sc_dchan.free_obuf2;
-
- sc->sc_dchan.obuf2 = NULL;
- }
- cmd = D_CMDR_XMS | D_CMDR_XME;
- }
- sc->sc_dchan.tx_ready = 0;
- IWIC_WRITE(sc, D_CMDR, cmd);
-}
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_ext.h b/sys/i4b/layer1/iwic/i4b_iwic_ext.h
deleted file mode 100644
index 0b4389b..0000000
--- a/sys/i4b/layer1/iwic/i4b_iwic_ext.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * Copyright (c) 2000, 2001 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_iwic - isdn4bsd Winbond W6692 driver
- * ----------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Jan 21 11:09:14 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_IWIC_EXT_H_
-#define _I4B_IWIC_EXT_H_
-
-#include <i4b/include/i4b_l3l4.h>
-
-void iwic_set_linktab(int unit, int channel, drvr_link_t * dlt);
-isdn_link_t *iwic_ret_linktab(int unit, int channel);
-
-int iwic_ph_data_req(int unit, struct mbuf *m, int freeflag);
-int iwic_ph_activate_req(int unit);
-int iwic_mph_command_req(int unit, int command, void *parm);
-
-#endif /* _I4B_IWIC_EXT_H_ */
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_fsm.c b/sys/i4b/layer1/iwic/i4b_iwic_fsm.c
deleted file mode 100644
index 9835354..0000000
--- a/sys/i4b/layer1/iwic/i4b_iwic_fsm.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Dave Boyce. 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_iwic - isdn4bsd Winbond W6692 driver
- * ----------------------------------------
- * last edit-date: [Sun Jan 21 11:09:24 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer1/iwic/i4b_iwic.h>
-#include <i4b/layer1/iwic/i4b_w6692.h>
-
-#if DO_I4B_DEBUG
-static char *state_names[] = {
- "F3N",
- "F3",
- "F4",
- "F5",
- "F6",
- "F7",
- "F8",
- "ILLEGAL",
-};
-
-static char *event_names[] = {
- "PHAR",
- "CE",
- "T3",
- "INFO0",
- "RSY",
- "INFO2",
- "INFO48",
- "INFO410",
- "DR",
- "PU",
- "DIS",
- "EI",
- "ILLEGAL"
-};
-#endif
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_NULL(struct iwic_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_NULL executing");
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_AR(struct iwic_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AR executing");
- IWIC_WRITE(sc, CIX, CIX_ECK);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_AR3(struct iwic_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AR3 executing");
- IWIC_WRITE(sc, CIX, CIX_AR8);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_I0I(struct iwic_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_IOI executing");
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_I0A(struct iwic_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_IOA executing");
- iwic_dchan_disable(sc);
- i4b_l1_ph_deactivate_ind(L0IWICUNIT(sc->sc_unit));
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_AI8(struct iwic_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AI8 executing");
- iwic_dchan_transmit(sc);
- i4b_l1_ph_activate_ind(L0IWICUNIT(sc->sc_unit));
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_AI10(struct iwic_softc *sc)
-{
- NDBGL1(L1_F_MSG, "FSM function F_AI10 executing");
- iwic_dchan_transmit(sc);
- i4b_l1_ph_activate_ind(L0IWICUNIT(sc->sc_unit));
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-struct iwic_state_tab {
- void (*func) (struct iwic_softc *sc); /* function to execute */
- int newstate; /* next state */
-} iwic_state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: F3N F3 F4 F5 F6 F7 F8 ILLEGAL STATE */
-/* ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ */
-/* EV_PHAR */ {{F_AR, ST_F3 }, {F_AR3, ST_F4 }, {F_NULL, ST_F4 }, {F_NULL, ST_F5 }, {F_NULL, ST_F6 }, {F_NULL, ST_F7 }, {F_NULL, ST_F8 }, {F_NULL, ST_ILL }},
-/* EV_CE */ {{F_NULL, ST_F3 }, {F_AR3, ST_F4 }, {F_NULL, ST_F4 }, {F_NULL, ST_F4 }, {F_NULL, ST_F4 }, {F_NULL, ST_F4 }, {F_NULL, ST_F4 }, {F_NULL, ST_ILL }},
-/* EV_T3 */ {{F_NULL, ST_F3N }, {F_NULL, ST_F3 }, {F_NULL, ST_F3 }, {F_NULL, ST_F3 }, {F_NULL, ST_F3 }, {F_NULL, ST_F7 }, {F_NULL, ST_F8 }, {F_NULL, ST_ILL }},
-/* EV_INFO0 */ {{F_I0I, ST_F3 }, {F_I0I, ST_F3 }, {F_I0I, ST_F3 }, {F_I0I, ST_F3 }, {F_I0A, ST_F3 }, {F_I0A, ST_F3 }, {F_I0A, ST_F3 }, {F_NULL, ST_ILL }},
-/* EV_RSY */ {{F_NULL, ST_F3 }, {F_NULL, ST_F5 }, {F_NULL, ST_F5 }, {F_NULL, ST_F5 }, {F_NULL, ST_F8 }, {F_NULL, ST_F8 }, {F_NULL, ST_F8 }, {F_NULL, ST_ILL }},
-/* EV_INFO2 */ {{F_NULL, ST_F6 }, {F_NULL, ST_F6 }, {F_NULL, ST_F6 }, {F_NULL, ST_F6 }, {F_NULL, ST_F6 }, {F_NULL, ST_F6 }, {F_NULL, ST_F6 }, {F_NULL, ST_ILL }},
-/* EV_INFO48 */ {{F_AI8 , ST_F7 }, {F_AI8, ST_F7 }, {F_AI8, ST_F7 }, {F_AI8, ST_F7 }, {F_AI8, ST_F7 }, {F_AI8, ST_F7 }, {F_AI8, ST_F7 }, {F_NULL, ST_ILL }},
-/* EV_INFO410*/ {{F_AI10, ST_F7 }, {F_AI10, ST_F7 }, {F_AI10, ST_F7 }, {F_AI10, ST_F7 }, {F_AI10, ST_F7 }, {F_AI10, ST_F7 }, {F_AI10, ST_F7 }, {F_NULL, ST_ILL }},
-/* EV_DR */ {{F_NULL, ST_F3 }, {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_NULL, ST_ILL }},
-/* EV_PU */ {{F_NULL, ST_F3 }, {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_NULL, ST_ILL }},
-/* EV_DIS */ {{F_NULL, ST_F3N }, {F_NULL, ST_F3N }, {F_NULL, ST_F3N }, {F_NULL, ST_F3N }, {F_NULL, ST_F3N }, {F_I0A, ST_F3N }, {F_I0A, ST_F3N }, {F_NULL, 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_NULL, ST_F3 }, {F_NULL, ST_ILL }},
-/* EV_ILL */ {{F_NULL, ST_ILL }, {F_NULL, ST_ILL }, {F_NULL, ST_ILL }, {F_NULL, ST_ILL }, {F_NULL, ST_ILL }, {F_NULL, ST_ILL }, {F_NULL, ST_ILL }, {F_NULL, ST_ILL }},
-};
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-void
-iwic_next_state(struct iwic_softc *sc, int event)
-{
- int currstate, newstate;
-
- NDBGL1(L1_F_MSG, "event %s", event_names[event]);
-
- if (event >= N_EVENTS)
- {
- printf("iwic_next_state: event >= N_EVENTS\n");
- return;
- }
-
- currstate = sc->sc_I430state;
-
- newstate = iwic_state_tab[event][currstate].newstate;
- if (newstate >= N_STATES)
- {
- printf("iwic_next_state: newstate >= N_STATES\n");
- return;
- }
-
- NDBGL1(L1_F_MSG, "state %s -> %s",
- state_names[currstate], state_names[newstate]);
-
- sc->sc_I430state = newstate;
-
- (*iwic_state_tab[event][currstate].func) (sc);
-}
-
-#if DO_I4B_DEBUG
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-iwic_printstate(struct iwic_softc *sc)
-{
- return((char *)state_names[sc->sc_I430state]);
-}
-#endif
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_l1if.c b/sys/i4b/layer1/iwic/i4b_iwic_l1if.c
deleted file mode 100644
index fbea743..0000000
--- a/sys/i4b/layer1/iwic/i4b_iwic_l1if.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Dave Boyce. 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_iwic - isdn4bsd Winbond W6692 driver
- * ----------------------------------------
- * last edit-date: [Sun Jan 21 11:09:33 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/iwic/i4b_iwic.h>
-#include <i4b/layer1/iwic/i4b_iwic_ext.h>
-
-/* jump table for multiplex routines */
-
-struct i4b_l1mux_func iwic_l1mux_func = {
- iwic_ret_linktab,
- iwic_set_linktab,
- iwic_mph_command_req,
- iwic_ph_data_req,
- iwic_ph_activate_req,
-};
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-iwic_ph_data_req(int unit, struct mbuf *m, int freeflag)
-{
- struct iwic_softc *sc = iwic_find_sc(unit);
-
- return iwic_dchan_data_req(sc, m, freeflag);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-iwic_ph_activate_req(int unit)
-{
- struct iwic_softc *sc = iwic_find_sc(unit);
-
- iwic_next_state(sc, EV_PHAR);
-
- return 0;
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-iwic_mph_command_req(int unit, int command, void *parm)
-{
- struct iwic_softc *sc = iwic_find_sc(unit);
-
- switch (command)
- {
- case CMR_DOPEN: /* Daemon running */
- NDBGL1(L1_PRIM, "CMR_DOPEN");
- sc->enabled = TRUE;
- break;
-
- case CMR_DCLOSE: /* Daemon not running */
- NDBGL1(L1_PRIM, "CMR_DCLOSE");
- sc->enabled = FALSE;
- break;
-
- case CMR_SETTRACE:
- NDBGL1(L1_PRIM, "CMR_SETTRACE, parm = %d", (unsigned int)parm);
- sc->sc_trace = (unsigned int)parm;
- break;
-
- default:
- NDBGL1(L1_PRIM, "unknown command = %d", command);
- break;
- }
-
- return 0;
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-isdn_link_t *
-iwic_ret_linktab(int unit, int channel)
-{
- struct iwic_softc *sc = iwic_find_sc(unit);
- struct iwic_bchan *bchan = &sc->sc_bchan[channel];
-
- return &bchan->iwic_isdn_linktab;
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-void
-iwic_set_linktab (int unit, int channel, drvr_link_t *dlt)
-{
- struct iwic_softc *sc = iwic_find_sc(unit);
- struct iwic_bchan *bchan = &sc->sc_bchan[channel];
-
- bchan->iwic_drvr_linktab = dlt;
-}
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_pci.c b/sys/i4b/layer1/iwic/i4b_iwic_pci.c
deleted file mode 100644
index e1e2076..0000000
--- a/sys/i4b/layer1/iwic/i4b_iwic_pci.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Dave Boyce. 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_iwic - isdn4bsd Winbond W6692 driver
- * ----------------------------------------
- * last edit-date: [Tue Jan 16 10:53:03 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer1/i4b_l1.h>
-
-#include <i4b/layer1/iwic/i4b_iwic.h>
-#include <i4b/layer1/iwic/i4b_w6692.h>
-
-extern struct i4b_l1mux_func iwic_l1mux_func;
-
-/* Winbond PCI Configuration Space */
-
-#define BADDR0 PCIR_BAR(0)
-#define BADDR1 PCIR_BAR(1)
-
-
-static void iwic_pci_intr(struct iwic_softc *sc);
-static int iwic_pci_probe(device_t dev);
-static int iwic_pci_attach(device_t dev);
-
-static device_method_t iwic_pci_methods[] =
-{
- DEVMETHOD(device_probe, iwic_pci_probe),
- DEVMETHOD(device_attach, iwic_pci_attach),
- { 0, 0 }
-};
-
-static driver_t iwic_pci_driver =
-{
- "iwic",
- iwic_pci_methods,
- 0
-};
-
-static devclass_t iwic_pci_devclass;
-
-DRIVER_MODULE(iwic, pci, iwic_pci_driver, iwic_pci_devclass, 0, 0);
-
-#define IWIC_MAXUNIT 4
-
-struct iwic_softc iwic_sc[IWIC_MAXUNIT];
-
-/*---------------------------------------------------------------------------*
- * PCI ID list for ASUSCOM card got from Asuscom in March 2000:
- *
- * Vendor ID: 0675 Device ID: 1702
- * Vendor ID: 0675 Device ID: 1703
- * Vendor ID: 0675 Device ID: 1707
- * Vendor ID: 10CF Device ID: 105E
- * Vendor ID: 1043 Device ID: 0675 SubVendor: 144F SubDevice ID: 2000
- * Vendor ID: 1043 Device ID: 0675 SubVendor: 144F SubDevice ID: 1702
- * Vendor ID: 1043 Device ID: 0675 SubVendor: 144F SubDevice ID: 1707
- * Vendor ID: 1043 Device ID: 0675 SubVendor: 1043 SubDevice ID: 1702
- * Vendor ID: 1043 Device ID: 0675 SubVendor: 1043 SubDevice ID: 1707
- * Vendor ID: 1050 Device ID: 6692 SubVendor: 0675 SubDevice ID: 1702
- * Vendor ID: 1043 Device ID: 0675 SubVendor: 0675 SubDevice ID: 1704
- *---------------------------------------------------------------------------*/
-
-static struct winids {
- u_int32_t type;
- int sv;
- int sd;
- const char *desc;
-} win_ids[] = {
- { 0x66921050, -1, -1, "Generic Winbond W6692 ISDN PCI (0x66921050)" },
- { 0x06751043, 0x0675, 0x1704, "Planet PCI ISDN Adapter (IA128P-STD) ASUS-HCF675" },
- { 0x66921050, 0x144F, 0x1707, "Planet PCI ISDN Adapter (Model IA128P-STDV)" },
- { 0x17020675, -1, -1, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x17020675)" },
- { 0x17030675, -1, -1, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x17030675)" },
- { 0x17070675, -1, -1, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x17070675)" },
- { 0x105e10cf, -1, -1, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x105e10cf)" },
- { 0x06751043, 0x144F, 0x2000, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x06751043)" },
- { 0x06751043, 0x144F, 0x1702, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x06751043)" },
- { 0x06751043, 0x144F, 0x1707, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x06751043)" },
- { 0x06751043, 0x1443, 0x1702, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x06751043)" },
- { 0x06751043, 0x1443, 0x1707, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x06751043)" },
- { 0x06751043, 0x144F, 0x2000, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x06751043)" },
- { 0x06751043, 0x144F, 0x2000, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x06751043)" },
- { 0x06751043, 0x144F, 0x2000, "ASUSCOM P-IN100-ST-D (Winbond W6692, 0x06751043)" },
- { 0x00000000, 0, 0, NULL }
-};
-
-/*---------------------------------------------------------------------------*
- * iwic PCI probe
- *---------------------------------------------------------------------------*/
-static int
-iwic_pci_probe(device_t dev)
-{
- u_int32_t type = pci_get_devid(dev);
- u_int32_t sv = pci_get_subvendor(dev);
- u_int32_t sd = pci_get_subdevice(dev);
-
- struct winids *wip = win_ids;
-
- while(wip->type)
- {
- if(wip->type == type)
- {
- if(((wip->sv == -1) && (wip->sd == -1)) ||
- ((wip->sv == sv) && (wip->sd == sd)))
- break;
- }
- ++wip;
- }
-
- if(wip->desc)
- {
- if(bootverbose)
- {
- printf("iwic_pci_probe: vendor = 0x%x, device = 0x%x\n", pci_get_vendor(dev), pci_get_device(dev));
- printf("iwic_pci_probe: subvendor = 0x%x, subdevice = 0x%x\n", sv, sd);
- }
- device_set_desc(dev, wip->desc);
- return(0);
- }
- else
- {
- return(ENXIO);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * PCI attach
- *---------------------------------------------------------------------------*/
-static int
-iwic_pci_attach(device_t dev)
-{
- unsigned short iobase;
- struct iwic_softc *sc;
- void *ih = 0;
- int unit = device_get_unit(dev);
- struct iwic_bchan *bchan;
-
- /* check max unit range */
-
- if(unit >= IWIC_MAXUNIT)
- {
- printf("iwic%d: Error, unit %d >= IWIC_MAXUNIT!\n", unit, unit);
- return(ENXIO);
- }
-
- sc = iwic_find_sc(unit); /* get softc */
-
- sc->sc_unit = unit;
-
- /* use the i/o mapped base address */
-
- sc->sc_resources.io_rid[0] = BADDR1;
-
- if(!(sc->sc_resources.io_base[0] =
- bus_alloc_resource_any(dev, SYS_RES_IOPORT,
- &sc->sc_resources.io_rid[0],
- RF_ACTIVE)))
- {
- printf("iwic%d: Couldn't alloc io port!\n", unit);
- return(ENXIO);
- }
-
- iobase = rman_get_start(sc->sc_resources.io_base[0]);
-
- if(!(sc->sc_resources.irq =
- bus_alloc_resource_any(dev, SYS_RES_IRQ,
- &sc->sc_resources.irq_rid,
- RF_SHAREABLE|RF_ACTIVE)))
- {
- printf("iwic%d: Couldn't alloc irq!\n",unit);
- return(ENXIO);
- }
-
- /* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_WINB6692;
- sc->sc_iobase = (u_int32_t) iobase;
- sc->sc_trace = TRACE_OFF;
- sc->sc_I430state = ST_F3N; /* Deactivated */
- sc->enabled = FALSE;
-
- if(bus_setup_intr(dev, sc->sc_resources.irq, INTR_TYPE_NET,
- NULL, (void(*)(void*))iwic_pci_intr,
- sc, &ih))
- {
- printf("iwic%d: Couldn't set up irq!\n", unit);
- return(ENXIO);
- }
-
- /* disable interrupts */
- IWIC_WRITE(sc, IMASK, 0xff);
-
- iwic_dchan_init(sc);
-
- bchan = &sc->sc_bchan[IWIC_BCH_A];
- bchan->unit = unit;
- bchan->offset = B1_CHAN_OFFSET;
- bchan->channel = IWIC_BCH_A;
- bchan->state = ST_IDLE;
-
- iwic_bchannel_setup(unit, IWIC_BCH_A, BPROT_NONE, 0);
-
- bchan = &sc->sc_bchan[IWIC_BCH_B];
- bchan->unit = unit;
- bchan->offset = B2_CHAN_OFFSET;
- bchan->channel = IWIC_BCH_B;
- bchan->state = ST_IDLE;
-
- iwic_bchannel_setup(unit, IWIC_BCH_B, BPROT_NONE, 0);
-
- iwic_init_linktab(sc);
-
- if(bootverbose)
- {
- int ver = IWIC_READ(sc, D_RBCH);
- printf("iwic%d: W6692 chip version = %d\n", unit, D_RBCH_VN(ver));
- }
-
- i4b_l1_mph_status_ind(L0IWICUNIT(sc->sc_unit), STI_ATTACH, sc->sc_cardtyp, &iwic_l1mux_func);
-
- IWIC_READ(sc, ISTA);
-
- /* Enable interrupts */
- IWIC_WRITE(sc, IMASK, IMASK_XINT0 | IMASK_XINT1);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * IRQ handler
- *---------------------------------------------------------------------------*/
-static void
-iwic_pci_intr(struct iwic_softc *sc)
-{
- while (1)
- {
- int irq_stat = IWIC_READ(sc, ISTA);
-
- if (irq_stat == 0)
- break;
-
- if (irq_stat & (ISTA_D_RME | ISTA_D_RMR | ISTA_D_XFR))
- {
- iwic_dchan_xfer_irq(sc, irq_stat);
- }
- if (irq_stat & ISTA_D_EXI)
- {
- iwic_dchan_xirq(sc);
- }
- if (irq_stat & ISTA_B1_EXI)
- {
- iwic_bchan_xirq(sc, 0);
- }
- if (irq_stat & ISTA_B2_EXI)
- {
- iwic_bchan_xirq(sc, 1);
- }
- }
-}
diff --git a/sys/i4b/layer1/iwic/i4b_w6692.h b/sys/i4b/layer1/iwic/i4b_w6692.h
deleted file mode 100644
index 46e2163..0000000
--- a/sys/i4b/layer1/iwic/i4b_w6692.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Dave Boyce. 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_iwic - isdn4bsd Winbond W6692 driver
- * ----------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Jan 21 11:09:46 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _I4B_W6692_H_
-#define _I4B_W6692_H_
-
-#define IWIC_BCH_A 0 /* channel A */
-#define IWIC_BCH_B 1 /* channel B */
-
-/*---------------------------------------------------------------------------*
- * FIFO depths
- *---------------------------------------------------------------------------*/
-#define IWIC_DCHAN_FIFO_LEN 64
-#define IWIC_BCHAN_FIFO_LEN 64
-
-/*---------------------------------------------------------------------------*
- * D-Channel register offsets
- *---------------------------------------------------------------------------*/
-#define D_RFIFO 0x00 /* D channel receive FIFO */
-#define D_XFIFO 0x04 /* D channel transmit FIFO */
-#define D_CMDR 0x08 /* D channel command register */
-#define D_MODE 0x0c /* D channel mode control */
-#define D_TIMR 0x10 /* D channel timer control */
-#define D_EXIR 0x1c /* D channel extended interrupt */
-#define D_EXIM 0x20 /* D channel extended interrupt mask */
-#define D_STAR 0x24 /* D channel status register */
-#define D_RSTA 0x28 /* D channel receive status */
-#define D_SAM 0x2c /* D channel address mask 1 */
-#define D_SAP1 0x30 /* D channel individual SAPI 1 */
-#define D_SAP2 0x34 /* D channel individual SAPI 2 */
-#define D_TAM 0x38 /* D channel address mask 2 */
-#define D_TEI1 0x3c /* D channel individual TEI 1 */
-#define D_TEI2 0x40 /* D channel individual TEI 2 */
-#define D_RBCH 0x44 /* D channel receive frame byte count high */
-#define D_RBCL 0x48 /* D channel receive frame byte count low */
-#define D_CTL 0x54 /* D channel control register */
-
-/*---------------------------------------------------------------------------*
- * B-channel base offsets
- *---------------------------------------------------------------------------*/
-#define B1_CHAN_OFFSET 0x80 /* B1 channel offset */
-#define B2_CHAN_OFFSET 0xc0 /* B2 channel offset */
-
-/*---------------------------------------------------------------------------*
- * B-channel register offsets, from base
- *---------------------------------------------------------------------------*/
-#define B_RFIFO 0x00 /* B channel receive FIFO */
-#define B_XFIFO 0x04 /* B channel transmit FIFO */
-#define B_CMDR 0x08 /* B channel command register */
-#define B_MODE 0x0c /* B channel mode control */
-#define B_EXIR 0x10 /* B channel extended interrupt */
-#define B_EXIM 0x14 /* B channel extended interrupt mask */
-#define B_STAR 0x18 /* B channel status register */
-#define B_ADM1 0x1c /* B channel address mask 1 */
-#define B_ADM2 0x20 /* B channel address mask 2 */
-#define B_ADR1 0x24 /* B channel address 1 */
-#define B_ADR2 0x28 /* B channel address 2 */
-#define B_RBCL 0x2c /* B channel receive frame byte count high */
-#define B_RBCH 0x30 /* B channel receive frame byte count low */
-
-/*---------------------------------------------------------------------------*
- * Remaining control register offsets.
- *---------------------------------------------------------------------------*/
-#define ISTA 0x14 /* Interrupt status register */
-#define IMASK 0x18 /* Interrupt mask register */
-#define TIMR2 0x4c /* Timer 2 */
-#define L1_RC 0x50 /* GCI layer 1 ready code */
-#define CIR 0x58 /* Command/Indication receive */
-#define CIX 0x5c /* Command/Indication transmit */
-#define SQR 0x60 /* S/Q channel receive register */
-#define SQX 0x64 /* S/Q channel transmit register */
-#define PCTL 0x68 /* Peripheral control register */
-#define MOR 0x6c /* Monitor receive channel */
-#define MOX 0x70 /* Monitor transmit channel */
-#define MOSR 0x74 /* Monitor channel status register */
-#define MOCR 0x78 /* Monitor channel control register */
-#define GCR 0x7c /* GCI mode control register */
-#define XADDR 0xf4 /* Peripheral address register */
-#define XDATA 0xf8 /* Peripheral data register */
-#define EPCTL 0xfc /* Serial EEPROM control */
-
-/*---------------------------------------------------------------------------*
- * register bits
- *---------------------------------------------------------------------------*/
-#define D_CMDR_RACK 0x80
-#define D_CMDR_RRST 0x40
-#define D_CMDR_STT 0x10
-#define D_CMDR_XMS 0x08
-#define D_CMDR_XME 0x02
-#define D_CMDR_XRST 0x01
-
-#define D_MODE_MMS 0x80
-#define D_MODE_RACT 0x40
-#define D_MODE_TMS 0x10
-#define D_MODE_TEE 0x08
-#define D_MODE_MFD 0x04
-#define D_MODE_DLP 0x02
-#define D_MODE_RLP 0x01
-
-#define D_TIMR_CNT(i) (((i) >> 5) & 0x07)
-#define D_TIMR_VAL(i) ((i) & 0x1f)
-
-#define ISTA_D_RMR 0x80
-#define ISTA_D_RME 0x40
-#define ISTA_D_XFR 0x20
-#define ISTA_XINT1 0x10
-#define ISTA_XINT0 0x08
-#define ISTA_D_EXI 0x04
-#define ISTA_B1_EXI 0x02
-#define ISTA_B2_EXI 0x01
-
-#define IMASK_D_RMR 0x80
-#define IMASK_D_RME 0x40
-#define IMASK_D_XFR 0x20
-#define IMASK_XINT1 0x10
-#define IMASK_XINT0 0x08
-#define IMASK_D_EXI 0x04
-#define IMASK_B1_EXI 0x02
-#define IMASK_B2_EXI 0x01
-
-#define D_EXIR_RDOV 0x80
-#define D_EXIR_XDUN 0x40
-#define D_EXIR_XCOL 0x20
-#define D_EXIR_TIN2 0x10
-#define D_EXIR_MOC 0x08
-#define D_EXIR_ISC 0x04
-#define D_EXIR_TEXP 0x02
-#define D_EXIR_WEXP 0x01
-
-#define D_EXIM_RDOV 0x80
-#define D_EXIM_XDUN 0x40
-#define D_EXIM_XCOL 0x20
-#define D_EXIM_TIM2 0x10
-#define D_EXIM_MOC 0x08
-#define D_EXIM_ISC 0x04
-#define D_EXIM_TEXP 0x02
-#define D_EXIM_WEXP 0x01
-
-#define D_STAR_XDOW 0x80
-#define D_STAR_XBZ 0x20
-#define D_STAR_DRDY 0x10
-
-#define D_RSTA_RDOV 0x40
-#define D_RSTA_CRCE 0x20
-#define D_RSTA_RMB 0x10
-
-#define D_RBCH_VN(i) (((i) >> 6) & 0x03)
-#define D_RBCH_LOV 0x20
-#define D_RBC(h,l) (((((h) & 0x1f)) << 8) + (l))
-
-#define D_TIMR2_TMD 0x80
-#define D_TIMR2_TBCN(i) ((i) & 0x3f)
-
-#define L1_RC_RC(i) ((i) & 0x0f)
-
-#define D_CTL_WTT(i) (((i) > 6) & 0x03)
-#define D_CTL_SRST 0x20
-#define D_CTL_TPS 0x04
-#define D_CTL_OPS(i) ((i) & 0x03)
-
-#define CIR_SCC 0x80
-#define CIR_ICC 0x40
-#define CIR_CODR(i) ((i) & 0x0f)
-
-#define CIX_ECK 0x00
-#define CIX_RST 0x01
-#define CIX_SCP 0x04
-#define CIX_SSP 0x02
-#define CIX_AR8 0x08
-#define CIX_AR10 0x09
-#define CIX_EAL 0x0a
-#define CIX_DRC 0x0f
-
-#define CIR_CE 0x07
-#define CIR_DRD 0x00
-#define CIR_LD 0x04
-#define CIR_ARD 0x08
-#define CIR_TI 0x0a
-#define CIR_ATI 0x0b
-#define CIR_AI8 0x0c
-#define CIR_AI10 0x0d
-#define CIR_CD 0x0f
-
-#define SQR_XIND1 0x80
-#define SQR_XIND0 0x40
-#define SQR_MSYN 0x20
-#define SQR_SCIE 0x10
-#define SQR_S(i) ((i) & 0x0f)
-
-#define SQX_SCIE 0x10
-#define SQX_Q(i) ((i) & 0x0f)
-
-
-#define B_CMDR_RACK 0x80
-#define B_CMDR_RRST 0x40
-#define B_CMDR_RACT 0x20
-#define B_CMDR_XMS 0x04
-#define B_CMDR_XME 0x02
-#define B_CMDR_XRST 0x01
-
-#define B_MODE_MMS 0x80
-#define B_MODE_ITF 0x40
-#define B_MODE_EPCM 0x20
-#define B_MODE_BSW1 0x10
-#define B_MODE_BSW0 0x08
-#define B_MODE_SW56 0x04
-#define B_MODE_FTS1 0x02
-#define B_MODE_FTS0 0x01
-
-#define B_EXIR_RMR 0x40
-#define B_EXIR_RME 0x20
-#define B_EXIR_RDOV 0x10
-#define B_EXIR_XFR 0x02
-#define B_EXIR_XDUN 0x01
-
-#define B_EXIM_RMR 0x40
-#define B_EXIM_RME 0x20
-#define B_EXIM_RDOV 0x10
-#define B_EXIM_XFR 0x02
-#define B_EXIM_XDUN 0x01
-
-#define B_STAR_RDOV 0x40
-#define B_STAR_CRCE 0x20
-#define B_STAR_RMB 0x10
-#define B_STAR_XDOW 0x04
-#define B_STAR_XBZ 0x01
-
-#define B_RBC(h,l) (((((h) & 0x1f)) << 8) + (l))
-
-#endif /* _I4B_W6692_H_ */
diff --git a/sys/i4b/layer2/i4b_iframe.c b/sys/i4b/layer2/i4b_iframe.c
deleted file mode 100644
index a670582..0000000
--- a/sys/i4b/layer2/i4b_iframe.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ------------------------------------------
- * last edit-date: [Sat Mar 9 16:07:21 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_trace.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.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 68 and 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;
- CRIT_VAR;
-
- 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);
- NDBGL2(L2_I_ERR, "ERROR, state != (MF || TR)!");
- return;
- }
-
- CRIT_BEG;
-
- l2sc->stat.rx_i++; /* update frame count */
-
- 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;
-
- CRIT_END;
-
- 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;
- }
-
- CRIT_END;
-}
-
-/*---------------------------------------------------------------------------*
- * internal I FRAME QUEUED UP routine (Q.921 03/93 p 61)
- *---------------------------------------------------------------------------*/
-void
-i4b_i_frame_queued_up(l2_softc_t *l2sc)
-{
- struct mbuf *m;
- u_char *ptr;
- CRIT_VAR;
-
- CRIT_BEG;
-
- if((l2sc->peer_busy) || (l2sc->vs == ((l2sc->va + MAX_K_VALUE) & 127)))
- {
- if(l2sc->peer_busy)
- {
- NDBGL2(L2_I_MSG, "regen IFQUP, cause: peer busy!");
- }
-
- if(l2sc->vs == ((l2sc->va + MAX_K_VALUE) & 127))
- {
- NDBGL2(L2_I_MSG, "regen IFQUP, cause: vs=va+k!");
- }
-
- /*
- * XXX see: Q.921, page 36, 5.6.1 ".. may retransmit an I
- * frame ...", shall we retransmit the last i frame ?
- */
-
- if(!(IF_QEMPTY(&l2sc->i_queue)))
- {
- NDBGL2(L2_I_MSG, "re-scheduling IFQU call!");
- START_TIMER(l2sc->IFQU_callout, i4b_i_frame_queued_up, l2sc, IFQU_DLY);
- }
- CRIT_END;
- return;
- }
-
- IF_DEQUEUE(&l2sc->i_queue, m); /* fetch next frame to tx */
-
- if(!m)
- {
- NDBGL2(L2_I_ERR, "ERROR, mbuf NULL after IF_DEQUEUE");
- CRIT_END;
- 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 */
-
- l2sc->stat.tx_i++; /* update frame counter */
-
- 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 */
- {
- NDBGL2(L2_I_ERR, "ERROR, l2sc->ua_num: %d != UA_EMPTY", 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;
-
- CRIT_END;
-
- if(l2sc->T200 == TIMER_IDLE)
- {
- i4b_T203_stop(l2sc);
- i4b_T200_start(l2sc);
- }
-}
diff --git a/sys/i4b/layer2/i4b_l2.c b/sys/i4b/layer2/i4b_l2.c
deleted file mode 100644
index f752ba6..0000000
--- a/sys/i4b/layer2/i4b_l2.c
+++ /dev/null
@@ -1,385 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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)
- * -------------------------------
- * last edit-date: [Sat Mar 9 16:11:14 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.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, void *);
-
-/* from layer 2 */
-
-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, void *)) i4b_mdl_command_req
-};
-
-/*---------------------------------------------------------------------------*
- * DL_ESTABLISH_REQ from layer 3
- *---------------------------------------------------------------------------*/
-int i4b_dl_establish_req(int unit)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-
- NDBGL2(L2_PRIM, "unit %d",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];
-
- NDBGL2(L2_PRIM, "unit %d",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
- NDBGL2(L2_PRIM, "unit %d",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];
-
-#ifdef NOTDEF
- NDBGL2(L2_PRIM, "unit %d",unit);
-#endif
- switch(l2sc->Q921_state)
- {
- case ST_AW_EST:
- case ST_MULTIFR:
- case ST_TIMREC:
-
- if(_IF_QFULL(&l2sc->i_queue))
- {
- NDBGL2(L2_ERROR, "i_queue full!!");
- i4b_Dfreembuf(m);
- }
- else
- {
- CRIT_VAR;
-
- CRIT_BEG;
- IF_ENQUEUE(&l2sc->i_queue, m);
- CRIT_END;
-
- i4b_i_frame_queued_up(l2sc);
- }
- break;
-
- default:
- NDBGL2(L2_ERROR, "unit %d ERROR in state [%s], freeing mbuf", 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];
-
- NDBGL1(L1_PRIM, "unit %d",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];
-
- NDBGL1(L1_PRIM, "unit %d",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];
- CRIT_VAR;
-
- CRIT_BEG;
- 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);
-
- CRIT_END;
-}
-
-/*---------------------------------------------------------------------------*
- * 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];
- CRIT_VAR;
- int sendup = 1;
-
- CRIT_BEG;
-
- NDBGL1(L1_PRIM, "unit %d, status=%d, parm=%d", unit, status, parm);
-
- switch(status)
- {
- case STI_ATTACH:
- l2sc->unit = unit;
- l2sc->i_queue.ifq_maxlen = IQUEUE_MAXLEN;
-
- if(!mtx_initialized(&l2sc->i_queue.ifq_mtx))
- mtx_init(&l2sc->i_queue.ifq_mtx, "i4b_l2sc", NULL, MTX_DEF);
-
- l2sc->ua_frame = NULL;
- bzero(&l2sc->stat, sizeof(lapdstat_t));
- i4b_l2_unit_init(unit);
-
- /* 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);
- callout_handle_init(&l2sc->IFQU_callout);
- break;
-
- case STI_L1STAT: /* state of layer 1 */
- break;
-
- case STI_PDEACT: /* Timer 4 expired */
-/*XXX*/ if((l2sc->Q921_state >= ST_AW_EST) &&
- (l2sc->Q921_state <= ST_TIMREC))
- {
- NDBGL2(L2_ERROR, "unit %d, persistent deactivation!", unit);
- i4b_l2_unit_init(unit);
- }
- else
- {
- sendup = 0;
- }
- break;
-
- case STI_NOL1ACC:
- i4b_l2_unit_init(unit);
- NDBGL2(L2_ERROR, "unit %d, cannot access S0 bus!", unit);
- break;
-
- default:
- NDBGL2(L2_ERROR, "ERROR, unit %d, unknown status message!", unit);
- break;
- }
-
- if(sendup)
- MDL_Status_Ind(unit, status, parm); /* send up to layer 3 */
-
- CRIT_END;
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * MDL_COMMAND_REQ from layer 3
- *---------------------------------------------------------------------------*/
-static int
-i4b_mdl_command_req(int unit, int command, void * parm)
-{
- NDBGL2(L2_PRIM, "unit %d, command=%d, parm=%d", unit, command, (unsigned int)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)
-{
- l2_softc_t *l2sc = &l2_softc[unit];
-#ifdef NOTDEF
- NDBGL1(L1_PRIM, "unit %d", unit);
-#endif
- u_char *ptr = m->m_data;
-
- if ( (*(ptr + OFF_CNTL) & 0x01) == 0 )
- {
- if(m->m_len < 4) /* 6 oct - 2 chksum oct */
- {
- l2sc->stat.err_rx_len++;
- NDBGL2(L2_ERROR, "ERROR, I-frame < 6 octetts!");
- 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 */
- {
- l2sc->stat.err_rx_len++;
- NDBGL2(L2_ERROR, "ERROR, S-frame < 6 octetts!");
- 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 */
- {
- l2sc->stat.err_rx_len++;
- NDBGL2(L2_ERROR, "ERROR, U-frame < 5 octetts!");
- i4b_Dfreembuf(m);
- return(0);
- }
- i4b_rxd_u_frame(unit, m);
- }
- else
- {
- l2sc->stat.err_rx_badf++;
- NDBGL2(L2_ERROR, "ERROR, bad frame rx'd - ");
- i4b_print_frame(m->m_len, m->m_data);
- i4b_Dfreembuf(m);
- }
- return(0);
-}
diff --git a/sys/i4b/layer2/i4b_l2.h b/sys/i4b/layer2/i4b_l2.h
deleted file mode 100644
index cb44c93..0000000
--- a/sys/i4b/layer2/i4b_l2.h
+++ /dev/null
@@ -1,351 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ---------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Mar 9 16:12:20 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#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 */
-
- struct callout_handle T200_callout;
- struct callout_handle T202_callout;
- struct callout_handle T203_callout;
- struct callout_handle IFQU_callout;
-
-/*
- * i4b_iframe.c, i4b_i_frame_queued_up(): value of IFQU_DLY
- * some experimentation Gary did showed a minimal value of (hz/20) was
- * possible to let this work, Gary suggested using (hz/10) but i settled
- * down to using (hz/5) for now (-hm).
- */
-#define IFQU_DLY (hz/5) /* reschedule I-FRAME-QUEUED-UP 0.2 sec */
-
- 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 */
-
- /* statistics */
-
- lapdstat_t stat; /* lapd protocol statistics */
-
-} 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_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 8e2721b..0000000
--- a/sys/i4b/layer2/i4b_l2fsm.c
+++ /dev/null
@@ -1,1578 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------
- * last edit-date: [Sat Mar 9 16:14:07 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.h>
-#include <i4b/layer2/i4b_l2fsm.h>
-
-l2_softc_t l2_softc[MAXL1UNITS];
-
-#if DO_I4B_DEBUG
-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"
-};
-#endif
-
-static void F_TU01(l2_softc_t *);
-static void F_TU03(l2_softc_t *);
-
-static void F_TA03(l2_softc_t *);
-static void F_TA04(l2_softc_t *);
-static void F_TA05(l2_softc_t *);
-
-static void F_TE03(l2_softc_t *);
-static void F_TE04(l2_softc_t *);
-static void F_TE05(l2_softc_t *);
-
-static void F_T01(l2_softc_t *);
-static void F_T05(l2_softc_t *);
-static void F_T06(l2_softc_t *);
-static void F_T07(l2_softc_t *);
-static void F_T08(l2_softc_t *);
-static void F_T09(l2_softc_t *);
-static void F_T10(l2_softc_t *);
-static void F_T13(l2_softc_t *);
-
-static void F_AE01(l2_softc_t *);
-static void F_AE05(l2_softc_t *);
-static void F_AE06(l2_softc_t *);
-static void F_AE07(l2_softc_t *);
-static void F_AE08(l2_softc_t *);
-static void F_AE09(l2_softc_t *);
-static void F_AE10(l2_softc_t *);
-static void F_AE11(l2_softc_t *);
-static void F_AE12(l2_softc_t *);
-
-static void F_AR05(l2_softc_t *);
-static void F_AR06(l2_softc_t *);
-static void F_AR07(l2_softc_t *);
-static void F_AR08(l2_softc_t *);
-static void F_AR09(l2_softc_t *);
-static void F_AR10(l2_softc_t *);
-static void F_AR11(l2_softc_t *);
-
-static void F_MF01(l2_softc_t *);
-static void F_MF05(l2_softc_t *);
-static void F_MF06(l2_softc_t *);
-static void F_MF07(l2_softc_t *);
-static void F_MF08(l2_softc_t *);
-static void F_MF09(l2_softc_t *);
-static void F_MF10(l2_softc_t *);
-static void F_MF11(l2_softc_t *);
-static void F_MF12(l2_softc_t *);
-static void F_MF13(l2_softc_t *);
-static void F_MF14(l2_softc_t *);
-static void F_MF15(l2_softc_t *);
-static void F_MF16(l2_softc_t *);
-static void F_MF17(l2_softc_t *);
-static void F_MF18(l2_softc_t *);
-static void F_MF19(l2_softc_t *);
-static void F_MF20(l2_softc_t *);
-
-static void F_TR01(l2_softc_t *);
-static void F_TR05(l2_softc_t *);
-static void F_TR06(l2_softc_t *);
-static void F_TR07(l2_softc_t *);
-static void F_TR08(l2_softc_t *);
-static void F_TR09(l2_softc_t *);
-static void F_TR10(l2_softc_t *);
-static void F_TR11(l2_softc_t *);
-static void F_TR12(l2_softc_t *);
-static void F_TR13(l2_softc_t *);
-static void F_TR15(l2_softc_t *);
-static void F_TR16(l2_softc_t *);
-static void F_TR17(l2_softc_t *);
-static void F_TR18(l2_softc_t *);
-static void F_TR19(l2_softc_t *);
-static void F_TR20(l2_softc_t *);
-static void F_ILL(l2_softc_t *);
-static void F_NCNA(l2_softc_t *);
-
-/*---------------------------------------------------------------------------*
- * FSM illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ILL(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_ERR, "FSM function F_ILL executing");
-}
-
-/*---------------------------------------------------------------------------*
- * FSM No change, No action
- *---------------------------------------------------------------------------*/
-static void
-F_NCNA(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_NCNA executing");
-}
-
-/*---------------------------------------------------------------------------*
- * layer 2 state transition table
- *---------------------------------------------------------------------------*/
-struct l2state_tab {
- void (*func)(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;
- int (*savpostfsmfunc)(int) = NULL;
-
- /* 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 */
- NDBGL2(L2_F_MSG, "FSM event [%s]: [%s/%d => %s/%d]",
- 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 */
- NDBGL2(L2_F_MSG, "FSM S-event [%s]: [%s => %s]", l2event_text[event],
- l2state_text[currstate],
- l2state_text[l2sc->Q921_state]);
- }
-
- /* check for illegal new state */
-
- if(newstate == ST_ILL)
- {
- newstate = currstate;
- NDBGL2(L2_F_ERR, "FSM illegal state, state = %s, event = %s!",
- 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)
- {
- NDBGL2(L2_F_MSG, "FSM executing postfsmfunc!");
- /* try to avoid an endless loop */
- savpostfsmfunc = l2sc->postfsmfunc;
- l2sc->postfsmfunc = NULL;
- (*savpostfsmfunc)(l2sc->postfsmarg);
- }
-}
-
-#if DO_I4B_DEBUG
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *i4b_print_l2state(l2_softc_t *l2sc)
-{
- return((char *) l2state_text[l2sc->Q921_state]);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_UNAS event dl establish request
- *---------------------------------------------------------------------------*/
-static void
-F_TU01(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TU01 executing");
- i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_UNAS event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TU03(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TU03 executing");
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TA03(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TA03 executing");
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event mdl error response
- *---------------------------------------------------------------------------*/
-static void
-F_TA04(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TA04 executing");
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_ASG_AW_TEI event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_TA05(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TA05 executing");
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_EST_AW_TEI event mdl assign request
- *---------------------------------------------------------------------------*/
-static void
-F_TE03(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TE03 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TE04 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TE05 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_T01 executing");
- i4b_establish_data_link(l2sc);
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_T05(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_T05 executing");
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event mdl remove request
- *---------------------------------------------------------------------------*/
-static void
-F_T06(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_T06 executing");
-/*XXX*/ i4b_mdl_assign_ind(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TEI_ASGD event rx'd SABME
- *---------------------------------------------------------------------------*/
-static void
-F_T07(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_T07 executing");
-
-/* 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_T08 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_T09 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_T10 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_T13 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE01 executing");
-
- i4b_Dcleanifq(&l2sc->i_queue);
-
- l2sc->l3initiated = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event persistent deactivation
- *---------------------------------------------------------------------------*/
-static void
-F_AE05(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE05 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE06 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE07 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE08 executing");
- i4b_tx_dm(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_EST event rx'd UA
- *---------------------------------------------------------------------------*/
-static void
-F_AE09(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE09 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE10 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE11 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AE12 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AR05 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AR06 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AR07 executing");
- i4b_tx_dm(l2sc, l2sc->rxd_PF);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_AW_REL event rx'd DISC
- *---------------------------------------------------------------------------*/
-static void
-F_AR08(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AR08 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AR09 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AR10 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_AR11 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF01 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF05 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF06 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF07 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF08 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF09 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF10 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF11 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF12 executing");
-
- i4b_i_frame_queued_up(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event dl release request
- *---------------------------------------------------------------------------*/
-static void
-F_MF13(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF13 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF14 executing");
-
- i4b_transmit_enquire(l2sc);
-
- l2sc->RC = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_MULTIFR event set own rx busy
- *---------------------------------------------------------------------------*/
-static void
-F_MF15(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF15 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF16 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF17 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF18 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF19 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_MF20 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR01 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR05 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR06 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR07 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR08 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR09 executing");
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR10 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR11 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR12 executing");
-
- i4b_i_frame_queued_up(l2sc);
-}
-
-/*---------------------------------------------------------------------------*
- * FSM state ST_TIMREC event dl release request
- *---------------------------------------------------------------------------*/
-static void
-F_TR13(l2_softc_t *l2sc)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR13 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR15 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR16 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR17 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR18 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR19 executing");
-
- 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)
-{
- NDBGL2(L2_F_MSG, "FSM function F_TR20 executing");
-
- i4b_mdl_error_ind(l2sc, "F_TR20", MDL_ERR_K);
-
- i4b_establish_data_link(l2sc);
-
- l2sc->l3initiated = 0;
-}
diff --git a/sys/i4b/layer2/i4b_l2fsm.h b/sys/i4b/layer2/i4b_l2fsm.h
deleted file mode 100644
index fe47089..0000000
--- a/sys/i4b/layer2/i4b_l2fsm.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Mar 9 17:47:53 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#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 b129619..0000000
--- a/sys/i4b/layer2/i4b_l2timer.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------
- * last edit-date: [Sat Mar 9 17:48:58 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_global.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)
-{
- NDBGL2(L2_T_ERR, "unit %d, RC = %d", l2sc->unit, l2sc->RC);
- i4b_next_l2state(l2sc, EV_T200EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_start(l2_softc_t *l2sc)
-{
- if(l2sc->T200 == TIMER_ACTIVE)
- return;
-
- NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
- l2sc->T200 = TIMER_ACTIVE;
-
- START_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc, T200DEF);
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_stop(l2_softc_t *l2sc)
-{
- CRIT_VAR;
- CRIT_BEG;
- if(l2sc->T200 != TIMER_IDLE)
- {
- STOP_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc);
- l2sc->T200 = TIMER_IDLE;
- }
- CRIT_END;
- NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T200 restart
- *---------------------------------------------------------------------------*/
-void
-i4b_T200_restart(l2_softc_t *l2sc)
-{
- CRIT_VAR;
- CRIT_BEG;
- if(l2sc->T200 != TIMER_IDLE)
- {
- STOP_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc);
- }
- else
- {
- l2sc->T200 = TIMER_ACTIVE;
- }
-
- START_TIMER(l2sc->T200_callout, i4b_T200_timeout, l2sc, T200DEF);
- CRIT_END;
- NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 timeout function
- *---------------------------------------------------------------------------*/
-static void
-i4b_T202_timeout(l2_softc_t *l2sc)
-{
- NDBGL2(L2_T_ERR, "unit %d, N202 = %d", l2sc->unit, l2sc->N202);
-
- if(--(l2sc->N202))
- {
- (*l2sc->T202func)(l2sc);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T202_start(l2_softc_t *l2sc)
-{
- if (l2sc->N202 == TIMER_ACTIVE)
- return;
-
- NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
- l2sc->N202 = N202DEF;
- l2sc->T202 = TIMER_ACTIVE;
-
- START_TIMER(l2sc->T202_callout, i4b_T202_timeout, l2sc, T202DEF);
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T202 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T202_stop(l2_softc_t *l2sc)
-{
- CRIT_VAR;
- CRIT_BEG;
- if(l2sc->T202 != TIMER_IDLE)
- {
- STOP_TIMER(l2sc->T202_callout, i4b_T202_timeout, l2sc);
- l2sc->T202 = TIMER_IDLE;
- }
- CRIT_END;
- NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 timeout function
- *---------------------------------------------------------------------------*/
-#if defined(I4B_T203_ACTIVE) && I4B_T203_ACTIVE
-static void
-i4b_T203_timeout(l2_softc_t *l2sc)
-{
- NDBGL2(L2_T_ERR, "unit %d", l2sc->unit);
- i4b_next_l2state(l2sc, EV_T203EXP);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 start
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_start(l2_softc_t *l2sc)
-{
-#if defined(I4B_T203_ACTIVE) && I4B_T203_ACTIVE
- if (l2sc->T203 == TIMER_ACTIVE)
- return;
-
- NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
- l2sc->T203 = TIMER_ACTIVE;
-
- START_TIMER(l2sc->T203_callout, i4b_T203_timeout, l2sc, T203DEF);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 stop
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_stop(l2_softc_t *l2sc)
-{
-#if defined(I4B_T203_ACTIVE) && I4B_T203_ACTIVE
- CRIT_VAR;
- CRIT_BEG;
- if(l2sc->T203 != TIMER_IDLE)
- {
- STOP_TIMER(l2sc->T203_callout, i4b_T203_timeout, l2sc);
- l2sc->T203 = TIMER_IDLE;
- }
- CRIT_END;
- NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * Q.921 timer T203 restart
- *---------------------------------------------------------------------------*/
-void
-i4b_T203_restart(l2_softc_t *l2sc)
-{
-#if defined(I4B_T203_ACTIVE) && I4B_T203_ACTIVE
- CRIT_VAR;
- CRIT_BEG;
-
- if(l2sc->T203 != TIMER_IDLE)
- {
- STOP_TIMER(l2sc->T203_callout, i4b_T203_timerout, l2sc);
- }
- else
- {
- l2sc->T203 = TIMER_ACTIVE;
- }
-
- START_TIMER(l2sc->T203_callout, i4b_T203_timerout, l2sc, T203DEF);
- CRIT_END;
- NDBGL2(L2_T_MSG, "unit %d", l2sc->unit);
-#endif
-}
diff --git a/sys/i4b/layer2/i4b_lme.c b/sys/i4b/layer2/i4b_lme.c
deleted file mode 100644
index 19d45ea..0000000
--- a/sys/i4b/layer2/i4b_lme.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------------------
- * last edit-date: [Sat Mar 9 17:49:42 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/layer2/i4b_l2.h>
-
-/*---------------------------------------------------------------------------*
- * mdl assign indication handler
- *---------------------------------------------------------------------------*/
-void
-i4b_mdl_assign_ind(l2_softc_t *l2sc)
-{
- NDBGL2(L2_PRIM, "unit %d", 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)
-{
-#if DO_I4B_DEBUG
- 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!!!"
- };
-#endif
-
- if(errorcode > MDL_ERR_MAX)
- errorcode = MDL_ERR_MAX;
-
- NDBGL2(L2_ERROR, "unit = %d, location = %s", l2sc->unit, where);
- NDBGL2(L2_ERROR, "error = %s", 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;
- }
-}
diff --git a/sys/i4b/layer2/i4b_mbuf.c b/sys/i4b/layer2/i4b_mbuf.c
deleted file mode 100644
index 9bc0b68..0000000
--- a/sys/i4b/layer2/i4b_mbuf.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ------------------------------------
- * last edit-date: [Sat Mar 9 17:51:22 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_mbuf.h>
-
-#define I4B_MBUF_DEBUG
-#undef I4B_MBUF_TYPE_DEBUG
-
-#ifdef I4B_MBUF_TYPE_DEBUG
-
-#define MT_DCHAN 42
-#define MT_BCHAN 43
-
-#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)
-{
- int x = splimp();
-
- IF_DRAIN(ifq);
-
- 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)
-{
- int x = splimp();
-
- IF_DRAIN(ifq);
-
- splx(x);
-}
-
-/* EOF */
diff --git a/sys/i4b/layer2/i4b_sframe.c b/sys/i4b/layer2/i4b_sframe.c
deleted file mode 100644
index afe59eb..0000000
--- a/sys/i4b/layer2/i4b_sframe.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ----------------------------------------
- * last edit-date: [Sat Mar 9 17:52:06 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_l1l2.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:
- l2sc->stat.rx_rr++; /* update statistics */
- NDBGL2(L2_S_MSG, "rx'd RR, N(R) = %d", l2sc->rxd_NR);
- i4b_next_l2state(l2sc, EV_RXRR);
- break;
-
- case RNR:
- l2sc->stat.rx_rnr++; /* update statistics */
- NDBGL2(L2_S_MSG, "rx'd RNR, N(R) = %d", l2sc->rxd_NR);
- i4b_next_l2state(l2sc, EV_RXRNR);
- break;
-
- case REJ:
- l2sc->stat.rx_rej++; /* update statistics */
- NDBGL2(L2_S_MSG, "rx'd REJ, N(R) = %d", l2sc->rxd_NR);
- i4b_next_l2state(l2sc, EV_RXREJ);
- break;
-
- default:
- l2sc->stat.err_rx_bads++; /* update statistics */
- NDBGL2(L2_S_ERR, "ERROR, unknown code, frame = ");
- 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;
-
- NDBGL2(L2_S_MSG, "tx RR, unit = %d", l2sc->unit);
-
- m = i4b_build_s_frame(l2sc, CR_CMD_TO_NT, pbit, RR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-
- l2sc->stat.tx_rr++; /* update statistics */
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RR response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rr_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- NDBGL2(L2_S_MSG, "tx RR, unit = %d", l2sc->unit);
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, RR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-
- l2sc->stat.tx_rr++; /* update statistics */
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RNR command
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rnr_command(l2_softc_t *l2sc, pbit_t pbit)
-{
- struct mbuf *m;
-
- NDBGL2(L2_S_MSG, "tx RNR, unit = %d", l2sc->unit);
-
- m = i4b_build_s_frame(l2sc, CR_CMD_TO_NT, pbit, RNR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-
- l2sc->stat.tx_rnr++; /* update statistics */
-}
-
-/*---------------------------------------------------------------------------*
- * transmit RNR response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rnr_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- NDBGL2(L2_S_MSG, "tx RNR, unit = %d", l2sc->unit);
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, RNR);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-
- l2sc->stat.tx_rnr++; /* update statistics */
-}
-
-/*---------------------------------------------------------------------------*
- * transmit REJ response
- *---------------------------------------------------------------------------*/
-void
-i4b_tx_rej_response(l2_softc_t *l2sc, fbit_t fbit)
-{
- struct mbuf *m;
-
- NDBGL2(L2_S_MSG, "tx REJ, unit = %d", l2sc->unit);
-
- m = i4b_build_s_frame(l2sc, CR_RSP_TO_NT, fbit, REJ);
-
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-
- l2sc->stat.tx_rej++; /* update statistics */
-}
-
-/*---------------------------------------------------------------------------*
- * 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);
-}
diff --git a/sys/i4b/layer2/i4b_tei.c b/sys/i4b/layer2/i4b_tei.c
deleted file mode 100644
index 0e55bc2..0000000
--- a/sys/i4b/layer2/i4b_tei.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -----------------------------------
- * last edit-date: [Sat Mar 9 17:53:27 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/syslog.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.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);
-
- NDBGL2(L2_TEI_MSG, "TEI ID Assign - TEI = %d", 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);
- NDBGL2(L2_TEI_ERR, "TEI ID Denied, No TEI values available from exchange!");
- }
- else
- {
- log(LOG_WARNING, "i4b: unit %d, denied TEI = %d = 0x%02x\n", l2sc->unit, l2sc->tei, l2sc->tei);
- NDBGL2(L2_TEI_ERR, "TEI ID Denied - TEI = %d", 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)
- {
- NDBGL2(L2_TEI_MSG, "TEI ID Check Req - TEI = %d", 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);
- NDBGL2(L2_TEI_MSG, "TEI ID Remove - TEI = %d", l2sc->tei);
- MDL_Status_Ind(l2sc->unit, STI_TEIASG, -1);
- i4b_next_l2state(l2sc, EV_MDREMRQ);
- }
- break;
-
- default:
- NDBGL2(L2_TEI_ERR, "UNKNOWN TEI MGMT Frame, type = 0x%x", *(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;
- }
- l2sc->stat.tx_tei++;
- 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;
-
- NDBGL2(L2_TEI_MSG, "tx TEI ID_Request");
-
- 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;
-
- NDBGL2(L2_TEI_MSG, "tx TEI ID_Verify");
-
- 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;
- NDBGL2(L2_TEI_MSG, "tx TEI ID_Check_Response");
- }
-
- 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)
-{
- u_short val;
-
-#ifdef RANDOMDEV
- read_random((char *)&val, sizeof(val));
-#else
- val = (u_short)random();
-#endif /* RANDOMDEV */
-
- l2sc->last_rih = (val >> 8) & 0x00ff;
- l2sc->last_ril = val & 0x00ff;
-}
diff --git a/sys/i4b/layer2/i4b_uframe.c b/sys/i4b/layer2/i4b_uframe.c
deleted file mode 100644
index 55331a0..0000000
--- a/sys/i4b/layer2/i4b_uframe.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -----------------------------------------------
- * last edit-date: [Sat Mar 9 17:54:08 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_l2l3.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))))
- {
- l2sc->stat.rx_sabme++;
- NDBGL2(L2_U_MSG, "SABME, sapi = %d, tei = %d", 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) */
- l2sc->stat.rx_tei++;
- i4b_tei_rxframe(unit, m);
- }
- else if(sapi == SAPI_CCP && tei == GROUP_TEI)
- {
- /* call control (SAPI = 0) */
- l2sc->stat.rx_ui++;
- /* strip ui header */
- m_adj(m, UI_HDR_LEN);
- /* to upper layer */
- DL_Unit_Data_Ind(unit, m);
- }
- else
- {
- l2sc->stat.err_rx_badui++;
- NDBGL2(L2_U_ERR, "unknown UI frame!");
- i4b_Dfreembuf(m);
- }
- break;
-
- case DISC:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- l2sc->stat.rx_disc++;
- NDBGL2(L2_U_MSG, "DISC, sapi = %d, tei = %d", 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))))
- {
- l2sc->stat.rx_xid++;
- NDBGL2(L2_U_MSG, "XID, sapi = %d, tei = %d", sapi, tei);
- }
- i4b_Dfreembuf(m);
- break;
-
- /* responses */
-
- case DM:
- if((l2sc->tei_valid == TEI_VALID) &&
- (l2sc->tei == GETTEI(*(ptr+OFF_TEI))))
- {
- l2sc->stat.rx_dm++;
- NDBGL2(L2_U_MSG, "DM, sapi = %d, tei = %d", 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))))
- {
- l2sc->stat.rx_ua++;
- NDBGL2(L2_U_MSG, "UA, sapi = %d, tei = %d", 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))))
- {
- l2sc->stat.rx_frmr++;
- NDBGL2(L2_U_MSG, "FRMR, sapi = %d, tei = %d", 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))))
- {
- NDBGL2(L2_U_ERR, "UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei);
- i4b_print_frame(m->m_len, m->m_data);
- }
- else
- {
- NDBGL2(L2_U_ERR, "not mine - UNKNOWN TYPE ERROR, sapi = %d, tei = %d, frame = ", sapi, tei);
- i4b_print_frame(m->m_len, m->m_data);
- }
- l2sc->stat.err_rx_badui++;
- 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;
-
- l2sc->stat.tx_sabme++;
- NDBGL2(L2_U_MSG, "tx SABME, tei = %d", 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;
-
- l2sc->stat.tx_dm++;
- NDBGL2(L2_U_MSG, "tx DM, tei = %d", 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;
-
- l2sc->stat.tx_disc++;
- NDBGL2(L2_U_MSG, "tx DISC, tei = %d", 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;
-
- l2sc->stat.tx_ua++;
- NDBGL2(L2_U_MSG, "tx UA, tei = %d", 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;
-
- l2sc->stat.tx_frmr++;
- NDBGL2(L2_U_MSG, "tx FRMR, tei = %d", l2sc->tei);
- m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, FRMR);
- PH_Data_Req(l2sc->unit, m, MBUF_FREE);
-}
diff --git a/sys/i4b/layer2/i4b_util.c b/sys/i4b/layer2/i4b_util.c
deleted file mode 100644
index 9121648..0000000
--- a/sys/i4b/layer2/i4b_util.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------------------
- * last edit-date: [Sat Mar 9 17:55:03 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l1l2.h>
-#include <i4b/include/i4b_mbuf.h>
-
-#include <i4b/layer2/i4b_l2.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)
-{
- CRIT_VAR;
-
- CRIT_BEG;
-
-/*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;
-
- CRIT_END;
-}
-
-/*---------------------------------------------------------------------------*
- * 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)
-{
- CRIT_VAR;
-
- CRIT_BEG;
-
- NDBGL2(L2_ERROR, "nr = %d", nr );
-
- while(l2sc->vs != nr)
- {
- NDBGL2(L2_ERROR, "nr(%d) != vs(%d)", nr, l2sc->vs);
-
- M128DEC(l2sc->vs);
-
-/* XXXXXXXXXXXXXXXXX */
-
- if((l2sc->ua_num != UA_EMPTY) && (l2sc->vs == l2sc->ua_num))
- {
- if(_IF_QFULL(&l2sc->i_queue))
- {
- NDBGL2(L2_ERROR, "ERROR, I-queue full!");
- }
- else
- {
- IF_ENQUEUE(&l2sc->i_queue, l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
- }
- }
- else
- {
- NDBGL2(L2_ERROR, "ERROR, l2sc->vs = %d, l2sc->ua_num = %d ",l2sc->vs, l2sc->ua_num);
- }
-
-/* XXXXXXXXXXXXXXXXX */
-
- i4b_i_frame_queued_up(l2sc);
- }
-
- CRIT_END;
-}
-
-/*---------------------------------------------------------------------------*
- * 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)
-{
-#if 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)
-{
- NDBGL2(L2_ERROR, "unit%d V(R)=%d, V(S)=%d, V(A)=%d,ACKP=%d,PBSY=%d,OBSY=%d",
- 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
- NDBGL2(L2_ERROR, "N(R)=%d, UA=%d, V(R)=%d, V(S)=%d, V(A)=%d",
- nr,
- l2sc->ua_num,
- l2sc->vr,
- l2sc->vs,
- l2sc->va);
-#endif
-
- if(l2sc->ua_num != UA_EMPTY)
- {
- CRIT_VAR;
-
- CRIT_BEG;
-
- M128DEC(nr);
-
- if(l2sc->ua_num != nr)
- NDBGL2(L2_ERROR, "((N(R)-1)=%d) != (UA=%d) !!!", nr, l2sc->ua_num);
-
- i4b_Dfreembuf(l2sc->ua_frame);
- l2sc->ua_num = UA_EMPTY;
-
- CRIT_END;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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)))
- {
- NDBGL2(L2_ERROR, "ERROR, va = %d, nr = %d, vs = %d [1]", va, nr, vs);
- return 0; /* fail */
- }
-
- if((nr > vs) && ((vs != 0) || (nr != 127)))
- {
- NDBGL2(L2_ERROR, "ERROR, va = %d, nr = %d, vs = %d [2]", va, nr, vs);
- return 0; /* fail */
- }
- return 1; /* good */
-}
diff --git a/sys/i4b/layer3/i4b_l2if.c b/sys/i4b/layer3/i4b_l2if.c
deleted file mode 100644
index 4c23dbd..0000000
--- a/sys/i4b/layer3/i4b_l2if.c
+++ /dev/null
@@ -1,680 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------------------------
- * last edit-date: [Sun Aug 11 12:48:41 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.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>
-
-
-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;
-
- NDBGL2(L2_PRIM, "DL-ESTABLISH-IND unit %d",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))
- {
- NDBGL3(L3_MSG, "unit=%d DL established!",unit);
- ctrl_desc[i].dl_est = DL_UP;
- found = 1;
- }
- }
-
- if(found == 0)
- {
- NDBGL3(L3_ERR, "ERROR, controller not found for unit=%d!",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))
- {
- NDBGL3(L3_MSG, "unit=%d, index=%d cdid=%u cr=%d",
- unit, i, call_desc[i].cdid, call_desc[i].cr);
- next_l3state(&call_desc[i], EV_DLESTIN);
- found++;
- }
- }
-
- if(found == 0)
- {
- NDBGL3(L3_ERR, "ERROR, no cdid for unit %d found!", unit);
- return(-1);
- }
- else
- {
- return(0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * DL ESTABLISH CONFIRM from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_establish_cnf(int unit)
-{
- int i;
- int found = 0;
-
- NDBGL2(L2_PRIM, "DL-ESTABLISH-CONF unit %d",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;
-
- NDBGL3(L3_MSG, "unit=%d, index=%d cdid=%u cr=%d",
- unit, i, call_desc[i].cdid, call_desc[i].cr);
-
- next_l3state(&call_desc[i], EV_DLESTCF);
- found++;
- }
- }
-
- if(found == 0)
- {
- NDBGL3(L3_ERR, "ERROR, no cdid for unit %d found!", unit);
- return(-1);
- }
- else
- {
- return(0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * DL RELEASE INDICATION from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_release_ind(int unit)
-{
- int i;
- int found = 0;
-
- NDBGL2(L2_PRIM, "DL-RELEASE-IND unit %d",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))
- {
- NDBGL3(L3_MSG, "unit=%d DL released!",unit);
- ctrl_desc[i].dl_est = DL_DOWN;
- found = 1;
- }
- }
-
- if(found == 0)
- {
- NDBGL3(L3_ERR, "ERROR, controller not found for unit=%d!",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))
- {
- NDBGL3(L3_MSG, "unit=%d, index=%d cdid=%u cr=%d",
- 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 */
- NDBGL3(L3_MSG, "no cdid for unit %d found", unit);
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * DL RELEASE CONFIRM from Layer 2
- *---------------------------------------------------------------------------*/
-int
-i4b_dl_release_cnf(int unit)
-{
- int i;
-
- NDBGL2(L2_PRIM, "DL-RELEASE-CONF unit %d",unit);
-
- for(i=0; i < nctrl; i++)
- {
- if((ctrl_desc[i].ctrl_type == CTRL_PASSIVE) &&
- (ctrl_desc[i].unit == unit))
- {
- NDBGL3(L3_MSG, "unit=%d DL released!",unit);
- ctrl_desc[i].dl_est = DL_DOWN;
- return(0);
- }
- }
- NDBGL3(L3_ERR, "ERROR, controller not found for unit=%d!",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
- NDBGL2(L2_PRIM, "DL-DATA-IND unit %d",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
- NDBGL2(L2_PRIM, "DL-UNIT-DATA-IND unit %d",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;
-
- NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", 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;
-
- if(send_cause_flag == 0)
- {
- len -= 4;
- NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x",
- ctrl_desc[cd->controller].unit, cd->cr);
- }
- else
- {
- NDBGL3(L3_PRIM, "unit=%d, cr=0x%02x, cause=0x%x",
- ctrl_desc[cd->controller].unit, cd->cr, cd->cause_out);
- }
-
- 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;
-
- NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", 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 len;
- int slen = strlen(cd->src_telno);
- int sslen = strlen(cd->src_subaddr);
- int dlen = strlen(cd->dst_telno);
- int dslen = strlen(cd->dst_subaddr);
- int klen = strlen(cd->keypad);
-
- /*
- * 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)
- */
-
- NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", ctrl_desc[cd->controller].unit, cd->cr);
-
- len = I_FRAME_HDRLEN +
- MSG_SETUP_LEN +
- (slen ? (3+slen) : 0) +
- (sslen ? (3+sslen) : 0) +
- (dlen ? (3+dlen) : 0) +
- (dslen ? (3+dslen) : 0) +
- (klen ? (2+klen) : 0) +
- (cd->bprot == BPROT_NONE ? 1 : 0);
-
- if((m = i4b_Dgetmbuf(len)) == 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 */
- if (cd->bcap == BCAP_DOV) /* Data over Voice */
- {
- *ptr++ = IEI_BEARERCAP_LEN+1;
- *ptr++ = IT_CAP_SPEECH;
- *ptr++ = IT_RATE_64K;
- *ptr++ = IT_UL1_G711A;
- }
- else
- {
- *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;
- }
-
- if(klen)
- {
- *ptr++ = IEI_KEYPAD; /* keypad facility */
- *ptr++ = klen; /* keypad facility length */
- strncpy(ptr, cd->keypad, klen);
- ptr += klen;
- }
-
- if(slen)
- {
- *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;
- }
-
- if(sslen)
- {
- *ptr++ = IEI_CALLINGPS; /* calling subaddr */
- *ptr++ = IEI_CALLINGPS_LEN+sslen; /* calling subaddr len */
- *ptr++ = SUBADDR_TYPE_NSAP; /* type = NSAP */
- strncpy(ptr, cd->src_subaddr, sslen);
- ptr += sslen;
- }
-
- if(dlen)
- {
- *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;
- }
-
- if(dslen)
- {
- *ptr++ = IEI_CALLEDPS; /* calling party subaddr */
- *ptr++ = IEI_CALLEDPS_LEN+dslen;/* calling party subaddr len */
- *ptr++ = SUBADDR_TYPE_NSAP; /* type = NSAP */
- strncpy(ptr, cd->dst_subaddr, dslen);
- ptr += dslen;
- }
-
- 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;
-
- NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", 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;
-
- NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", 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 | EXT_LAST;
-
- *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;
-
- NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", 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");
-
- NDBGL3(L3_PRIM, "unit %d, cr = 0x%02x", 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);
-}
diff --git a/sys/i4b/layer3/i4b_l3.h b/sys/i4b/layer3/i4b_l3.h
deleted file mode 100644
index 2202993..0000000
--- a/sys/i4b/layer3/i4b_l3.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*-
- * Copyright (c) 1997, 2000 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.11 2000/04/27 09:25:21 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Thu Apr 27 11:07:01 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#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 1ec0678..0000000
--- a/sys/i4b/layer3/i4b_l3fsm.c
+++ /dev/null
@@ -1,1037 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------
- * last edit-date: [Sat Mar 9 19:34:39 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.h>
-
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.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 void F_308TO(call_desc_t *cd);
-
-#if DO_I4B_DEBUG
-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 */
-};
-#endif
-
-/*---------------------------------------------------------------------------*
- * 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_308TO,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_DLRIA, ST_OW}, {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");
-
- NDBGL3(L3_F_MSG, "L3 FSM event [%s]: [%s => %s]",
- l3event_text[event],
- l3state_text[currstate],
- l3state_text[newstate]);
-
- /* execute function */
-
- (*l3state_tab[event][currstate].func)(cd);
-
- if(newstate == ST_ILL)
- {
- newstate = currstate;
- NDBGL3(L3_F_ERR, "FSM illegal state, state = %s, event = %s!",
- l3state_text[newstate],
- l3event_text[event]);
- }
-
- if(newstate != ST_SUSE)
- cd->Q931state = newstate;
-}
-
-#if DO_I4B_DEBUG
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *print_l3state(call_desc_t *cd)
-{
- return((char *) l3state_text[cd->Q931state]);
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event L4 setup req
- *---------------------------------------------------------------------------*/
-static void F_00A(call_desc_t *cd)
-{
- int s;
- NDBGL3(L3_F_MSG, "FSM function F_00A executing");
-
- cd->T303_first_to = 1;
- T303_start(cd);
-
- s = SPLI4B();
- if(i4b_get_dl_stat(cd) == DL_DOWN)
- {
- splx(s);
- DL_Est_Req(ctrl_desc[cd->controller].unit);
- cd->Q931state = ST_OW;
- }
- else
- {
- cd->Q931state = ST_U1;
- splx(s);
- i4b_l3_tx_setup(cd);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U0 event SETUP from L2
- *---------------------------------------------------------------------------*/
-static void F_00H(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_00H executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_00I executing");
-
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_00J executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_01B executing");
- /* 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_01K executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_01L executing");
- 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
- * preceding 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_01M executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_01N executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_01O executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_01U executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_03C executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_03N executing");
- T310_stop(cd);
- i4b_l4_alert_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U3 event CONNECT from L2
- *---------------------------------------------------------------------------*/
-static void F_03O(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_03O executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_03P executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_03Y executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_04O executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_06D executing");
-
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_06E executing");
-
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_06F executing");
-
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_06G executing");
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U6 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_06J(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_06J executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_06Q executing");
- i4b_l4_disconnect_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U7 event setup response accept from L4
- *---------------------------------------------------------------------------*/
-static void F_07E(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_07E executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_07F executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_07G executing");
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U8 event CONNECT ACK from L2
- *---------------------------------------------------------------------------*/
-static void F_08R(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_08R executing");
- T313_stop(cd);
- i4b_l4_connect_active_ind(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U8 event T313 timeout
- *---------------------------------------------------------------------------*/
-static void F_08Z(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_08Z executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_09D executing");
- i4b_l3_tx_alert(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U9 event setup response accept from L4
- *---------------------------------------------------------------------------*/
-static void F_09E(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_09E executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_09F executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_09G executing");
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state U11 event RELEASE from L2
- *---------------------------------------------------------------------------*/
-static void F_11J(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_11J executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_11Q executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_11V executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_12C executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_12J executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_19I executing");
-
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_19J executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_19K executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_19W executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_STENQ executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_STAT executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_INFO executing");
- i4b_l4_info_ind(cd);
- /* remain in current state */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM T308 timeout while expecting RELEASE COMPLETE
- *---------------------------------------------------------------------------*/
-static void F_308TO(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_308TO executing");
- i4b_l3_stop_all_timers(cd);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM some states event RELEASE COMPLETE from L2
- *---------------------------------------------------------------------------*/
-static void F_RELCP(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_RELCP executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_REL executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DISC executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DCRQ executing");
-
- /* stop T310 in case this is the result of an incoming call for a */
- /* calledback connection */
-
- if(cd->T310 == TIMER_ACTIVE)
- T310_stop(cd);
-
- /* 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)
-{
- NDBGL3(L3_F_ERR, "FSM function F_UEM executing, state = %s", 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)
-{
- NDBGL3(L3_F_ERR, "FSM function F_SIGN executing");
-
-/* XXX */ /* freecd_by_cd(cd); ?????????? XXX */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM relevant states event DL ESTABLISH IND from L2
- *---------------------------------------------------------------------------*/
-static void F_DLEI(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DLEI executing");
-
-/* XXX */
-
- /* remain in current state */
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event illegal event occured
- *---------------------------------------------------------------------------*/
-static void F_ILL(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_ILL executing");
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event T309 timeout
- *---------------------------------------------------------------------------*/
-static void F_309TO(call_desc_t *cd)
-{
- NDBGL3(L3_F_ERR, "FSM function F_309TO executing");
-
-/* 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_FCTY executing");
- /* 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DECF1 executing");
- i4b_l3_tx_setup(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_IWA event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF2(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DECF2 executing");
- i4b_l3_tx_connect(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * L3 FSM state ST_IWR event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF3(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DECF3 executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DECF4 executing");
- i4b_l3_tx_alert(cd);
-}
-
-
-/*---------------------------------------------------------------------------*
- * L3 FSM any state event DL ESTABLISH CONF from L2
- *---------------------------------------------------------------------------*/
-static void F_DECF(call_desc_t *cd)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DECF executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DLRI executing");
- 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)
-{
- NDBGL3(L3_F_MSG, "FSM function F_DLRIA executing");
-
- if(cd->T309 == TIMER_IDLE)
- T309_start(cd);
-
- DL_Est_Req(ctrl_desc[cd->controller].unit);
-}
diff --git a/sys/i4b/layer3/i4b_l3fsm.h b/sys/i4b/layer3/i4b_l3fsm.h
deleted file mode 100644
index b2a5102..0000000
--- a/sys/i4b/layer3/i4b_l3fsm.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Mar 9 19:34:51 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#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 33abab4..0000000
--- a/sys/i4b/layer3/i4b_l3timer.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * ------------------------------------------------------
- * last edit-date: [Sat Mar 9 19:35:31 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.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)
-{
- NDBGL3(L3_T_ERR, "SETUP not answered, cr = %d", cd->cr);
- next_l3state(cd, EV_T303EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T303 start
- *---------------------------------------------------------------------------*/
-void
-T303_start(call_desc_t *cd)
-{
- if (cd->T303 == TIMER_ACTIVE)
- return;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
- cd->T303 = TIMER_ACTIVE;
-
- START_TIMER(cd->T303_callout, T303_timeout, cd, T303VAL);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T303 stop
- *---------------------------------------------------------------------------*/
-void
-T303_stop(call_desc_t *cd)
-{
- CRIT_VAR;
- CRIT_BEG;
-
- if(cd->T303 != TIMER_IDLE)
- {
- STOP_TIMER(cd->T303_callout, T303_timeout, cd);
- cd->T303 = TIMER_IDLE;
- }
- CRIT_END;
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T305_timeout(call_desc_t *cd)
-{
- NDBGL3(L3_T_ERR, "DISC not answered, cr = %d", cd->cr);
- next_l3state(cd, EV_T305EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 start
- *---------------------------------------------------------------------------*/
-void
-T305_start(call_desc_t *cd)
-{
- if (cd->T305 == TIMER_ACTIVE)
- return;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
- cd->T305 = TIMER_ACTIVE;
-
- START_TIMER(cd->T305_callout, T305_timeout, cd, T305VAL);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T305 stop
- *---------------------------------------------------------------------------*/
-void
-T305_stop(call_desc_t *cd)
-{
- CRIT_VAR;
- CRIT_BEG;
-
- if(cd->T305 != TIMER_IDLE)
- {
- STOP_TIMER(cd->T305_callout, T305_timeout, cd);
- cd->T305 = TIMER_IDLE;
- }
- CRIT_END;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T308_timeout(call_desc_t *cd)
-{
- NDBGL3(L3_T_ERR, "REL not answered, cr = %d", cd->cr);
- next_l3state(cd, EV_T308EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 start
- *---------------------------------------------------------------------------*/
-void
-T308_start(call_desc_t *cd)
-{
- if(cd->T308 == TIMER_ACTIVE)
- return;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
- cd->T308 = TIMER_ACTIVE;
-
- START_TIMER(cd->T308_callout, T308_timeout, cd, T308VAL);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T308 stop
- *---------------------------------------------------------------------------*/
-void
-T308_stop(call_desc_t *cd)
-{
- CRIT_VAR;
- CRIT_BEG;
-
- if(cd->T308 != TIMER_IDLE)
- {
- STOP_TIMER(cd->T308_callout, T308_timeout, cd);
- cd->T308 = TIMER_IDLE;
- }
- CRIT_END;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T309_timeout(call_desc_t *cd)
-{
- NDBGL3(L3_T_ERR, "datalink not reconnected, cr = %d", cd->cr);
- next_l3state(cd, EV_T309EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 start
- *---------------------------------------------------------------------------*/
-void
-T309_start(call_desc_t *cd)
-{
- if (cd->T309 == TIMER_ACTIVE)
- return;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
- cd->T309 = TIMER_ACTIVE;
-
- START_TIMER(cd->T309_callout, T309_timeout, cd, T309VAL);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T309 stop
- *---------------------------------------------------------------------------*/
-void
-T309_stop(call_desc_t *cd)
-{
- CRIT_VAR;
- CRIT_BEG;
-
- if(cd->T309 != TIMER_IDLE)
- {
- STOP_TIMER(cd->T309_callout, T309_timeout, cd);
- cd->T309 = TIMER_IDLE;
- }
- CRIT_END;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T310_timeout(call_desc_t *cd)
-{
- NDBGL3(L3_T_ERR, "CALL PROC timeout, cr = %d", cd->cr);
- next_l3state(cd, EV_T310EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 start
- *---------------------------------------------------------------------------*/
-void
-T310_start(call_desc_t *cd)
-{
- if (cd->T310 == TIMER_ACTIVE)
- return;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
- cd->T310 = TIMER_ACTIVE;
-
- START_TIMER(cd->T310_callout, T310_timeout, cd, T310VAL);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T310 stop
- *---------------------------------------------------------------------------*/
-void
-T310_stop(call_desc_t *cd)
-{
- CRIT_VAR;
- CRIT_BEG;
-
- if(cd->T310 != TIMER_IDLE)
- {
- STOP_TIMER(cd->T310_callout, T310_timeout, cd);
- cd->T310 = TIMER_IDLE;
- }
- CRIT_END;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T313_timeout(call_desc_t *cd)
-{
- NDBGL3(L3_T_ERR, "CONN ACK not received, cr = %d", cd->cr);
- next_l3state(cd, EV_T313EXP);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 start
- *---------------------------------------------------------------------------*/
-void
-T313_start(call_desc_t *cd)
-{
- if (cd->T313 == TIMER_ACTIVE)
- return;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
- cd->T313 = TIMER_ACTIVE;
-
- START_TIMER(cd->T313_callout, T313_timeout, cd, T313VAL);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T313 stop
- *---------------------------------------------------------------------------*/
-void
-T313_stop(call_desc_t *cd)
-{
- CRIT_VAR;
- CRIT_BEG;
-
- if(cd->T313 != TIMER_IDLE)
- {
- cd->T313 = TIMER_IDLE;
- STOP_TIMER(cd->T313_callout, T313_timeout, cd);
- }
- CRIT_END;
-
- NDBGL3(L3_T_MSG, "cr = %d", cd->cr);
-}
diff --git a/sys/i4b/layer3/i4b_l4if.c b/sys/i4b/layer3/i4b_l4if.c
deleted file mode 100644
index e2acee3..0000000
--- a/sys/i4b/layer3/i4b_l4if.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -------------------------------------------
- * last edit-date: [Sat Mar 9 19:36:08 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.h>
-
-#include <i4b/include/i4b_l2l3.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_l3fsm.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, void *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;
-
- NDBGL3(L3_MSG, "unit = %d, status = %d, parm = %d", unit, status, parm);
-
- switch(status)
- {
- case STI_ATTACH:
- NDBGL3(L3_MSG, "STI_ATTACH: attaching unit %d to controller %d", 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_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].nbch = 2; /* XXX extra param? */
- for (i = 0; i < ctrl_desc[nctrl].nbch; i++)
- ctrl_desc[nctrl].bch_state[i] = 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);
- NDBGL3(L3_MSG, "STI_L1STAT: unit %d layer 1 = %s", unit, status ? "up" : "down");
- break;
-
- case STI_L2STAT:
- i4b_l4_l12stat(unit, 2, parm);
- NDBGL3(L3_MSG, "STI_L2STAT: unit %d layer 2 = %s", unit, status ? "up" : "down");
- break;
-
- case STI_TEIASG:
- ctrl_desc[unit].tei = parm;
- i4b_l4_teiasg(unit, parm);
- NDBGL3(L3_MSG, "STI_TEIASG: unit %d TEI = %d = 0x%02x", unit, parm, parm);
- break;
-
- case STI_PDEACT: /* L1 T4 timeout */
- NDBGL3(L3_ERR, "STI_PDEACT: unit %d TEI = %d = 0x%02x", 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))
- {
- i4b_l3_stop_all_timers(&(call_desc[i]));
- if(call_desc[i].cdid != CDID_UNUSED)
- sendup++;
- }
- }
-
- ctrl_desc[utoc_tab[unit]].dl_est = DL_DOWN;
- for (i = 0; i < ctrl_desc[utoc_tab[unit]].nbch; i++)
- ctrl_desc[utoc_tab[unit]].bch_state[i] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
-
- if(sendup)
- {
- i4b_l4_pdeact(unit, sendup);
- call_desc[i].cdid = CDID_UNUSED;
- }
- break;
-
- case STI_NOL1ACC: /* no outgoing access to S0 */
- NDBGL3(L3_ERR, "STI_NOL1ACC: unit %d no outgoing access to S0", 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;
- for (i = 0; i < ctrl_desc[utoc_tab[unit]].nbch; i++)
- ctrl_desc[utoc_tab[unit]].bch_state[i] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
- break;
-
- default:
- NDBGL3(L3_ERR, "ERROR, unit %d, unknown status value %d!", unit, status);
- break;
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * send command to the lower layers
- *---------------------------------------------------------------------------*/
-static void
-n_mgmt_command(int unit, int cmd, void *parm)
-{
- int i;
-
- switch(cmd)
- {
- case CMR_DOPEN:
- NDBGL3(L3_MSG, "CMR_DOPEN for unit %d", 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;
- for (i = 0; i < ctrl_desc[utoc_tab[unit]].nbch; i++)
- ctrl_desc[utoc_tab[unit]].bch_state[i] = BCH_ST_FREE;
- ctrl_desc[utoc_tab[unit]].tei = -1;
- break;
-
- case CMR_DCLOSE:
- NDBGL3(L3_MSG, "CMR_DCLOSE for unit %d", unit);
- break;
-
- case CMR_SETTRACE:
- NDBGL3(L3_MSG, "CMR_SETTRACE for unit %d", unit);
- break;
-
- default:
- NDBGL3(L3_MSG, "unknown cmd %d for unit %d", cmd, unit);
- 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;
- NDBGL3(L3_ERR, "unknown response, doing SETUP_RESP_DNTCRE");
- break;
- }
-
- if((cd->channelid >= 0) && (cd->channelid < ctrl_desc[cd->controller].nbch))
- {
- ctrl_desc[cd->controller].bch_state[cd->channelid] = chstate;
- }
- else
- {
- NDBGL3(L3_MSG, "Warning, invalid channelid %d, response = %d\n", cd->channelid, response);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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);
-}
diff --git a/sys/i4b/layer3/i4b_q931.c b/sys/i4b/layer3/i4b_q931.c
deleted file mode 100644
index 3f1eb2b..0000000
--- a/sys/i4b/layer3/i4b_q931.c
+++ /dev/null
@@ -1,714 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------------
- * last edit-date: [Sun Aug 11 19:18:08 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.h>
-
-#include <i4b/include/i4b_isdnq931.h>
-#include <i4b/include/i4b_l3l4.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>
-
-unsigned int i4b_l3_debug = L3_DEBUG_DEFAULT;
-
-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 */
- CAUSE_Q850_USRBSY, /* CAUSE_I4B_L1ERROR -> L1 error / persistent deact XXX */
- CAUSE_Q850_USRBSY, /* CAUSE_I4B_LLDIAL -> no dialout on leased line XXX */
-};
-
-/*---------------------------------------------------------------------------*
- * 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)
- {
- static int protoflag = -1; /* print only once .. */
-
- if(*msg_ptr != protoflag)
- {
- NDBGL3(L3_P_ERR, "unknown protocol discriminator 0x%x!", *msg_ptr);
- protoflag = *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;
- }
-
- NDBGL3(L3_P_MSG, "Call Ref, len %d, val %d, flag %d", 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 */
- {
- NDBGL3(L3_P_ERR, "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))
- {
- NDBGL3(L3_P_ERR, "Q.931 lockingshift proc violation, shift %d -> %d", 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:
- NDBGL3(L3_P_ERR, "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)
- {
-
-/*********/
-/* Q.931 */
-/*********/
- /* single byte IE's */
-
- case IEI_SENDCOMPL:
- NDBGL3(L3_P_MSG, "IEI_SENDCOMPL");
- return(1);
- break;
-
- /* multi byte IE's */
-
- case IEI_SEGMMSG: /* segmented message */
- NDBGL3(L3_P_MSG, "IEI_SEGMENTED_MESSAGE");
- break;
-
- 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;
- NDBGL3(L3_P_MSG, "IEI_BEARERCAP - Telephony");
- break;
-
- case 0x88: /* unrestricted digital info */
-/* XXX */ cd->bprot = BPROT_RHDLC;
- NDBGL3(L3_P_MSG, "IEI_BEARERCAP - Raw HDLC");
- break;
-
- default:
-/* XXX */ cd->bprot = BPROT_NONE;
- NDBGL3(L3_P_ERR, "IEI_BEARERCAP - Unsupported B-Protocol 0x%x", msg_ptr[2]);
- break;
- }
- break;
-
- case IEI_CAUSE: /* cause */
- if(msg_ptr[2] & 0x80)
- {
- cd->cause_in = msg_ptr[3] & 0x7f;
- NDBGL3(L3_P_MSG, "IEI_CAUSE = %d", msg_ptr[3] & 0x7f);
- }
- else
- {
- cd->cause_in = msg_ptr[4] & 0x7f;
- NDBGL3(L3_P_MSG, "IEI_CAUSE = %d", msg_ptr[4] & 0x7f);
- }
- break;
-
- case IEI_CALLID: /* call identity */
- NDBGL3(L3_P_MSG, "IEI_CALL_IDENTITY");
- break;
-
- case IEI_CALLSTATE: /* call state */
- cd->call_state = msg_ptr[2] & 0x3f;
- NDBGL3(L3_P_MSG, "IEI_CALLSTATE = %d", cd->call_state);
- break;
-
- case IEI_CHANNELID: /* channel id */
- if((msg_ptr[2] & 0xf4) != 0x80)
- {
- cd->channelid = CHAN_NO;
- NDBGL3(L3_P_ERR, "IEI_CHANNELID, unsupported value 0x%x", 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;
-
- NDBGL3(L3_P_MSG, "IEI_CHANNELID - channel %d, exclusive = %d", 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
- NDBGL3(L3_P_ERR, "IE ChannelID, Channel NOT free!!");
- }
- else if(cd->channelid == CHAN_NO)
- {
- NDBGL3(L3_P_MSG, "IE ChannelID, SETUP with channel = No channel (CW)");
- }
- else /* cd->channelid == CHAN_ANY */
- {
- NDBGL3(L3_P_ERR, "ERROR: IE ChannelID, SETUP with channel = Any channel!");
- }
- }
- }
- break;
-
- case IEI_PROGRESSI: /* progress indicator */
- NDBGL3(L3_P_MSG, "IEI_PROGRESSINDICATOR");
- break;
-
- case IEI_NETSPCFAC: /* network specific fac */
- NDBGL3(L3_P_MSG, "IEI_NETSPCFAC");
- break;
-
- case IEI_NOTIFIND: /* notification indicator */
- NDBGL3(L3_P_MSG, "IEI_NOTIFICATION_INDICATOR");
- break;
-
- case IEI_DISPLAY: /* display */
- memcpy(cd->display, &msg_ptr[2], min(DISPLAY_MAX, msg_ptr[1]));
- cd->display[min(DISPLAY_MAX, msg_ptr[1])] = '\0';
- NDBGL3(L3_P_MSG, "IEI_DISPLAY = %s", 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]);
-
- NDBGL3(L3_P_MSG, "IEI_DATETIME = %s", cd->datetime);
- break;
-
- case IEI_KEYPAD: /* keypad facility */
- NDBGL3(L3_P_MSG, "IEI_KEYPAD_FACILITY");
- break;
-
- case IEI_SIGNAL: /* signal type */
- NDBGL3(L3_P_MSG, "IEI_SIGNAL = %d", msg_ptr[2]);
- break;
-
- case IEI_INFRATE: /* information rate */
- NDBGL3(L3_P_MSG, "IEI_INFORMATION_RATE");
- break;
-
- case IEI_ETETDEL: /* end to end transit delay */
- NDBGL3(L3_P_MSG, "IEI_END_TO_END_TRANSIT_DELAY");
- break;
-
- case IEI_CUG: /* closed user group */
- NDBGL3(L3_P_MSG, "IEI_CLOSED_USER_GROUP");
- 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;
- cd->prs_ind = PRS_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;
- cd->prs_ind = ((msg_ptr[3] >> 5) & 0x03) + PRS_ALLOWED;
- }
-
- /* type of number (source) */
- switch ((msg_ptr[2] & 0x70) >> 4)
- {
- case 1:
- cd->src_ton = TON_INTERNAT;
- break;
- case 2:
- cd->src_ton = TON_NATIONAL;
- break;
- default:
- cd->src_ton = TON_OTHER;
- break;
- }
- NDBGL3(L3_P_MSG, "IEI_CALLINGPN = %s", cd->src_telno);
- break;
-
- case IEI_CALLINGPS: /* calling party subaddress */
- memcpy(cd->src_subaddr, &msg_ptr[3], min(SUBADDR_MAX, msg_ptr[1]-1));
- cd->src_subaddr[min(SUBADDR_MAX, msg_ptr[1] - 1)] = '\0';
- NDBGL3(L3_P_MSG, "IEI_CALLINGPS = %s", cd->src_subaddr);
- 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';
-
- /* type of number (destination) */
- switch ((msg_ptr[2] & 0x70) >> 4)
- {
- case 1:
- cd->dst_ton = TON_INTERNAT;
- break;
- case 2:
- cd->dst_ton = TON_NATIONAL;
- break;
- default:
- cd->dst_ton = TON_OTHER;
- break;
- }
-
- NDBGL3(L3_P_MSG, "IEI_CALLED = %s", cd->dst_telno);
- break;
-
- case IEI_CALLEDPS: /* called party subaddress */
- memcpy(cd->dst_subaddr, &msg_ptr[3], min(SUBADDR_MAX, msg_ptr[1]-1));
- cd->dst_subaddr[min(SUBADDR_MAX, msg_ptr[1] - 1)] = '\0';
- NDBGL3(L3_P_MSG, "IEI_CALLEDPS = %s", cd->dst_subaddr);
- break;
-
- case IEI_REDIRNO: /* redirecting number */
- NDBGL3(L3_P_MSG, "IEI_REDIRECTING_NUMBER");
- break;
-
- case IEI_TRNSEL: /* transit network selection */
- NDBGL3(L3_P_MSG, "IEI_TRANSIT_NETWORK_SELECTION");
- break;
-
- case IEI_RESTARTI: /* restart indicator */
- NDBGL3(L3_P_MSG, "IEI_RESTART_INDICATOR");
- break;
-
- case IEI_LLCOMPAT: /* low layer compat */
- NDBGL3(L3_P_MSG, "IEI_LLCOMPAT");
- break;
-
- case IEI_HLCOMPAT: /* high layer compat */
- NDBGL3(L3_P_MSG, "IEI_HLCOMPAT");
- break;
-
- case IEI_USERUSER: /* user-user */
- NDBGL3(L3_P_MSG, "IEI_USER_USER");
- break;
-
- case IEI_ESCAPE: /* escape for extension */
- NDBGL3(L3_P_MSG, "IEI_ESCAPE");
- break;
-
-/*********/
-/* Q.932 */
-/*********/
- case IEI_FACILITY: /* facility */
- NDBGL3(L3_P_MSG, "IEI_FACILITY");
- if(i4b_aoc(msg_ptr, cd) > -1)
- i4b_l4_charging_ind(cd);
- break;
-
-/*********/
-/* Q.95x */
-/*********/
- case IEI_CONCTDNO: /* connected number */
- NDBGL3(L3_P_MSG, "IEI_CONCTDNO");
- break;
-
-
- default:
- NDBGL3(L3_P_ERR, "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)
-{
- char *m = NULL;
-
- cd->event = EV_ILL;
-
- switch(message_type)
- {
- /* call establishment */
-
- case ALERT:
- cd->event = EV_ALERT;
- m = "ALERT";
- break;
-
- case CALL_PROCEEDING:
- cd->event = EV_CALLPRC;
- m = "CALL_PROCEEDING";
- break;
-
- case PROGRESS:
- cd->event = EV_PROGIND;
- m = "PROGRESS";
- break;
-
- case SETUP:
- m = "SETUP";
- 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:
- m = "CONNECT";
- cd->datetime[0] = '\0';
- cd->event = EV_CONNECT;
- break;
-
- case SETUP_ACKNOWLEDGE:
- m = "SETUP_ACKNOWLEDGE";
- cd->event = EV_SETUPAK;
- break;
-
- case CONNECT_ACKNOWLEDGE:
- m = "CONNECT_ACKNOWLEDGE";
- cd->event = EV_CONACK;
- break;
-
- /* call information */
-
- case USER_INFORMATION:
- m = "USER_INFORMATION";
- break;
-
- case SUSPEND_REJECT:
- m = "SUSPEND_REJECT";
- break;
-
- case RESUME_REJECT:
- m = "RESUME_REJECT";
- break;
-
- case HOLD:
- m = "HOLD";
- break;
-
- case SUSPEND:
- m = "SUSPEND";
- break;
-
- case RESUME:
- m = "RESUME";
- break;
-
- case HOLD_ACKNOWLEDGE:
- m = "HOLD_ACKNOWLEDGE";
- break;
-
- case SUSPEND_ACKNOWLEDGE:
- m = "SUSPEND_ACKNOWLEDGE";
- break;
-
- case RESUME_ACKNOWLEDGE:
- m = "RESUME_ACKNOWLEDGE";
- break;
-
- case HOLD_REJECT:
- m = "HOLD_REJECT";
- break;
-
- case RETRIEVE:
- m = "RETRIEVE";
- break;
-
- case RETRIEVE_ACKNOWLEDGE:
- m = "RETRIEVE_ACKNOWLEDGE";
- break;
-
- case RETRIEVE_REJECT:
- m = "RETRIEVE_REJECT";
- break;
-
- /* call clearing */
-
- case DISCONNECT:
- m = "DISCONNECT";
- cd->event = EV_DISCONN;
- break;
-
- case RESTART:
- m = "RESTART";
- break;
-
- case RELEASE:
- m = "RELEASE";
- cd->event = EV_RELEASE;
- break;
-
- case RESTART_ACKNOWLEDGE:
- m = "RESTART_ACKNOWLEDGE";
- break;
-
- case RELEASE_COMPLETE:
- m = "RELEASE_COMPLETE";
- cd->event = EV_RELCOMP;
- break;
-
- /* misc messages */
-
- case SEGMENT:
- m = "SEGMENT";
- break;
-
- case FACILITY:
- m = "FACILITY";
- cd->event = EV_FACILITY;
- break;
-
- case REGISTER:
- m = "REGISTER";
- break;
-
- case NOTIFY:
- m = "NOTIFY";
- break;
-
- case STATUS_ENQUIRY:
- m = "STATUS_ENQUIRY";
- cd->event = EV_STATENQ;
- break;
-
- case CONGESTION_CONTROL:
- m = "CONGESTION_CONTROL";
- break;
-
- case INFORMATION:
- m = "INFORMATION";
- cd->event = EV_INFO;
- break;
-
- case STATUS:
- m = "STATUS";
- cd->event = EV_STATUS;
- break;
-
- default:
- NDBGL3(L3_P_ERR, "unit %d, cr = 0x%02x, msg = 0x%02x", unit, cd->cr, message_type);
- break;
- }
- if(m)
- {
- NDBGL3(L3_PRIM, "%s: unit %d, cr = 0x%02x\n", m, unit, cd->cr);
- }
-}
diff --git a/sys/i4b/layer3/i4b_q931.h b/sys/i4b/layer3/i4b_q931.h
deleted file mode 100644
index 99dc6ef..0000000
--- a/sys/i4b/layer3/i4b_q931.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Tue Mar 26 15:04:33 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#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 12 /* without called party, */
- /* calling party and */
- /* keypad facility ! */
-
-#define IEI_BEARERCAP_LEN 2 /* 2 octetts length */
-
-#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 ! */
-
-#define IEI_CALLINGPS_LEN 1
-#define IEI_CALLEDPS_LEN 1
-
-#define SUBADDR_TYPE_NSAP 0x80 /* subaddr: type=NSAP */
-
-/* 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 an alert message */
-
-#endif /* _I4B_Q931_H_ */
-
-/* EOF */
diff --git a/sys/i4b/layer3/i4b_q932fac.c b/sys/i4b/layer3/i4b_q932fac.c
deleted file mode 100644
index 22a2f9f..0000000
--- a/sys/i4b/layer3/i4b_q932fac.c
+++ /dev/null
@@ -1,541 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------
- * last edit-date: [Sat Mar 9 19:37:29 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer3/i4b_l3.h>
-#include <i4b/layer3/i4b_q932fac.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:
- NDBGL3(L3_A_MSG, "CMIP Protocol (Q.941), UNSUPPORTED");
- return(-1);
- break;
-
- case FAC_PROTO_ACSE:
- NDBGL3(L3_A_MSG, "ACSE Protocol (X.217/X.227), UNSUPPORTED!");
- return(-1);
- break;
-
- default:
- NDBGL3(L3_A_ERR, "Unknown Protocol, UNSUPPORTED!");
- return(-1);
- break;
- }
-
- NDBGL3(L3_A_MSG, "Remote Operations Protocol");
-
- /* 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)
- {
- NDBGL3(L3_A_MSG, "Invoke ID = %d", val);
- state = ST_EXP_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * operation value
- *---------------------------------------------------------------------------*/
-static void
-F_3(int val)
-{
- if(val != -1)
- {
- NDBGL3(L3_A_MSG, "Operation Value = %d", 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)
- {
- NDBGL3(L3_A_MSG, "Free of Charge");
- /* units = 0; XXXX */
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * charge not available
- *---------------------------------------------------------------------------*/
-static void
-F_4_2(int val)
-{
- if(val == -1)
- {
- NDBGL3(L3_A_MSG, "Charge not available");
- /* 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)
- {
- NDBGL3(L3_A_MSG, "Number of Units = %d", val);
- units = val;
- state = ST_EXP_TOCI;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * subtotal/total
- *---------------------------------------------------------------------------*/
-static void
-F_8(int val)
-{
- if(val != -1)
- {
- NDBGL3(L3_A_MSG, "Subtotal/Total = %d", val);
- /* type_of_charge = val; */
- state = ST_EXP_DBID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * billing_id
- *---------------------------------------------------------------------------*/
-static void
-F_9(int val)
-{
- if(val != -1)
- {
- NDBGL3(L3_A_MSG, "Billing ID = %d", 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;
- }
- }
-}
diff --git a/sys/i4b/layer3/i4b_q932fac.h b/sys/i4b/layer3/i4b_q932fac.h
deleted file mode 100644
index ae79155..0000000
--- a/sys/i4b/layer3/i4b_q932fac.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat Mar 9 19:37:46 2002]
- *
- *---------------------------------------------------------------------------
- *
- * - 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 ef73ce1..0000000
--- a/sys/i4b/layer4/i4b_i4bdrv.c
+++ /dev/null
@@ -1,865 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------------
- * last edit-date: [Sun Aug 11 12:42:46 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/ioccom.h>
-#include <sys/malloc.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/selinfo.h>
-#include <net/if.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.h>
-
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.h>
-#include <i4b/include/i4b_global.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-#include <sys/poll.h>
-
-struct selinfo select_rd_info;
-
-static struct ifqueue i4b_rdqueue;
-static int openflag = 0;
-static int selflag = 0;
-static int readflag = 0;
-
-static d_open_t i4bopen;
-static d_close_t i4bclose;
-static d_read_t i4bread;
-static d_ioctl_t i4bioctl;
-static d_poll_t i4bpoll;
-
-
-static struct cdevsw i4b_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
- .d_open = i4bopen,
- .d_close = i4bclose,
- .d_read = i4bread,
- .d_ioctl = i4bioctl,
- .d_poll = i4bpoll,
- .d_name = "i4b",
-};
-
-static void i4battach(void *);
-PSEUDO_SET(i4battach, i4b_i4bdrv);
-
-/*---------------------------------------------------------------------------*
- * interface attach routine
- *---------------------------------------------------------------------------*/
-static void
-i4battach(void *dummy)
-{
- printf("i4b: ISDN call control device attached\n");
-
- i4b_rdqueue.ifq_maxlen = IFQ_MAXLEN;
-
- if(!mtx_initialized(&i4b_rdqueue.ifq_mtx))
- mtx_init(&i4b_rdqueue.ifq_mtx, "i4b_rdqueue", NULL, MTX_DEF);
-
- make_dev(&i4b_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "i4b");
-}
-
-/*---------------------------------------------------------------------------*
- * i4bopen - device driver open routine
- *---------------------------------------------------------------------------*/
-static int
-i4bopen(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- 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
- *---------------------------------------------------------------------------*/
-static int
-i4bclose(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
- int x = splimp();
- openflag = 0;
- i4b_l4_daemon_detached();
- i4b_Dcleanifq(&i4b_rdqueue);
- splx(x);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bread - device driver read routine
- *---------------------------------------------------------------------------*/
-static int
-i4bread(struct cdev *dev, struct uio *uio, int ioflag)
-{
- struct mbuf *m;
- int x;
- int error = 0;
-
- if(minor(dev))
- return(ENODEV);
-
- x = splimp();
- IF_LOCK(&i4b_rdqueue);
- while(IF_QEMPTY(&i4b_rdqueue))
- {
- readflag = 1;
-
- error = msleep( &i4b_rdqueue, &i4b_rdqueue.ifq_mtx,
- (PZERO + 1) | PCATCH, "bird", 0);
-
- if (error != 0) {
- IF_UNLOCK(&i4b_rdqueue);
- splx(x);
- return error;
- }
- }
-
- _IF_DEQUEUE(&i4b_rdqueue, m);
- IF_UNLOCK(&i4b_rdqueue);
-
- 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
- *---------------------------------------------------------------------------*/
-static int
-i4bioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
-{
- 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 */
- {
- NDBGL4(L4_ERR, "I4B_CONNECT_REQ ioctl, cdid not found!");
- error = EINVAL;
- break;
- }
-
- /* prevent dialling on leased lines */
- if(ctrl_desc[mcr->controller].protocol == PROTOCOL_D64S)
- {
- SET_CAUSE_TYPE(cd->cause_in, CAUSET_I4B);
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_LLDIAL);
- i4b_l4_disconnect_ind(cd);
- freecd_by_cd(cd);
- break;
- }
-
- cd->controller = mcr->controller; /* fill cd */
- cd->bprot = mcr->bprot;
- cd->bcap = mcr->bcap;
- cd->driver = mcr->driver;
- cd->driver_unit = mcr->driver_unit;
- cd->cr = get_rand_cr(ctrl_desc[cd->controller].unit);
-
- cd->shorthold_data.shorthold_algorithm = mcr->shorthold_data.shorthold_algorithm;
- cd->shorthold_data.unitlen_time = mcr->shorthold_data.unitlen_time;
- cd->shorthold_data.idle_time = mcr->shorthold_data.idle_time;
- cd->shorthold_data.earlyhup_time = mcr->shorthold_data.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;
-
- NDBGL4(L4_TIMO, "I4B_CONNECT_REQ times, algorithm=%ld unitlen=%ld idle=%ld earlyhup=%ld",
- (long)cd->shorthold_data.shorthold_algorithm, (long)cd->shorthold_data.unitlen_time,
- (long)cd->shorthold_data.idle_time, (long)cd->shorthold_data.earlyhup_time);
-
- strcpy(cd->dst_telno, mcr->dst_telno);
- strcpy(cd->src_telno, mcr->src_telno);
-
- strcpy(cd->dst_subaddr, mcr->dst_subaddr);
- strcpy(cd->src_subaddr, mcr->src_subaddr);
-
- if(mcr->keypad[0] != '\0')
- strcpy(cd->keypad, mcr->keypad);
- else
- cd->keypad[0] = '\0';
-
- 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:
- {
- int i;
- for (i = 0;
- i < ctrl_desc[mcr->controller].nbch &&
- ctrl_desc[mcr->controller].bch_state[i] != BCH_ST_FREE;
- i++);
- if (i == ctrl_desc[mcr->controller].nbch)
- SET_CAUSE_VAL(cd->cause_in, CAUSE_I4B_NOCHAN);
- /* else mcr->channel = i; XXX */
- }
- 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 */
- {
- NDBGL4(L4_ERR, "I4B_CONNECT_RESP ioctl, cdid not found!");
- 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->shorthold_data.shorthold_algorithm = SHA_FIXU;
- cd->shorthold_data.unitlen_time = 0; /* this is incoming */
- cd->shorthold_data.idle_time = 0;
- cd->shorthold_data.earlyhup_time = 0;
-
- cd->isdntxdelay = mcrsp->txdelay;
-
- NDBGL4(L4_TIMO, "I4B_CONNECT_RESP max_idle_time set to %ld seconds", (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 */
- {
- NDBGL4(L4_ERR, "I4B_DISCONNECT_REQ ioctl, cdid not found!");
- 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;
- mcir->nbch =
- ctrl_desc[mcir->controller].nbch;
-
- 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:
- {
- drvr_link_t *dlt = NULL;
- msg_dialout_resp_t *mdrsp;
-
- mdrsp = (msg_dialout_resp_t *)data;
-
- switch(mdrsp->driver)
- {
-#if defined(NI4BIPR) && (NI4BIPR > 0)
- case BDRV_IPR:
- dlt = ipr_ret_linktab(mdrsp->driver_unit);
- break;
-#endif
-
-#if defined(NI4BISPPP) && (NI4BISPPP > 0)
- case BDRV_ISPPP:
- dlt = i4bisppp_ret_linktab(mdrsp->driver_unit);
- break;
-#endif
-
-#if defined(NI4BTEL) && (NI4BTEL > 0)
- case BDRV_TEL:
- dlt = tel_ret_linktab(mdrsp->driver_unit);
- break;
-#endif
-
-#if defined(NIBC) && NIBC > 0
- case BDRV_IBC:
- dlt = ibc_ret_linktab(mdrsp->driver_unit);
- break;
-#endif
-
-#if defined(NI4BING) && (NI4BING > 0)
- case BDRV_ING:
- dlt = ing_ret_linktab(mdrsp->driver_unit);
- break;
-#endif
- }
-
- if(dlt != NULL)
- (*dlt->dial_response)(mdrsp->driver_unit, mdrsp->stat, mdrsp->cause);
- break;
- }
-
- /* update timeout value */
-
- case I4B_TIMEOUT_UPD:
- {
- msg_timeout_upd_t *mtu;
- int x;
-
- mtu = (msg_timeout_upd_t *)data;
-
- NDBGL4(L4_TIMO, "I4B_TIMEOUT_UPD ioctl, alg %d, unit %d, idle %d, early %d!",
- mtu->shorthold_data.shorthold_algorithm, mtu->shorthold_data.unitlen_time,
- mtu->shorthold_data.idle_time, mtu->shorthold_data.earlyhup_time);
-
- if((cd = cd_by_cdid(mtu->cdid)) == NULL)/* get cd */
- {
- NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, cdid not found!");
- error = EINVAL;
- break;
- }
-
- switch( mtu->shorthold_data.shorthold_algorithm )
- {
- case SHA_FIXU:
- /*
- * For this algorithm unitlen_time,
- * idle_time and earlyhup_time are used.
- */
-
- if(!(mtu->shorthold_data.unitlen_time >= 0 &&
- mtu->shorthold_data.idle_time >= 0 &&
- mtu->shorthold_data.earlyhup_time >= 0))
- {
- NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for fix unit algorithm!");
- error = EINVAL;
- }
- break;
-
- case SHA_VARU:
- /*
- * For this algorithm unitlen_time and
- * idle_time are used. both must be
- * positive integers. earlyhup_time is
- * not used and must be 0.
- */
-
- if(!(mtu->shorthold_data.unitlen_time > 0 &&
- mtu->shorthold_data.idle_time >= 0 &&
- mtu->shorthold_data.earlyhup_time == 0))
- {
- NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid args for var unit algorithm!");
- error = EINVAL;
- }
- break;
-
- default:
- NDBGL4(L4_ERR, "I4B_TIMEOUT_UPD ioctl, invalid algorithm!");
- error = EINVAL;
- break;
- }
-
- /*
- * any error set above requires us to break
- * out of the outer switch
- */
- if(error != 0)
- break;
-
- x = SPLI4B();
- cd->shorthold_data.shorthold_algorithm = mtu->shorthold_data.shorthold_algorithm;
- cd->shorthold_data.unitlen_time = mtu->shorthold_data.unitlen_time;
- cd->shorthold_data.idle_time = mtu->shorthold_data.idle_time;
- cd->shorthold_data.earlyhup_time = mtu->shorthold_data.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 defined(NI4BIPR) && (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)
- {
- NDBGL4(L4_ERR, "I4B_ALERT_REQ ioctl, cdid not found!");
- 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;
- }
-
- /* set D-channel protocol for a controller */
-
- case I4B_PROT_IND:
- {
- msg_prot_ind_t *mpi;
-
- mpi = (msg_prot_ind_t *)data;
-
- ctrl_desc[mpi->controller].protocol = mpi->protocol;
-
- 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 (r->controller < 0 || r->controller >= nctrl)
- {
- error = ENODEV;
- goto download_done;
- }
-
- 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 (r->controller < 0 || r->controller >= nctrl)
- {
- error = ENODEV;
- goto diag_done;
- }
-
- if(!ctrl_desc[r->controller].N_DIAGNOSTICS)
- {
- error = ENODEV;
- goto diag_done;
- }
-
- memcpy(&req, r, sizeof(req));
-
- if(req.in_param_len)
- {
- /* XXX arbitrary limit */
- if (req.in_param_len >
- I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN) {
- error = EINVAL;
- goto diag_done;
- }
-
- req.in_param = malloc(r->in_param_len, M_DEVBUF, M_WAITOK);
-
- if(!req.in_param)
- {
- error = ENOMEM;
- goto diag_done;
- }
- error = copyin(r->in_param, req.in_param, req.in_param_len);
- if (error)
- goto diag_done;
- }
-
- 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)
- error = 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);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bpoll - device driver poll routine
- *---------------------------------------------------------------------------*/
-static int
-i4bpoll(struct cdev *dev, int events, struct thread *td)
-{
- int x;
-
- if(minor(dev))
- return(ENODEV);
-
- if((events & POLLIN) || (events & POLLRDNORM))
- {
- if(!IF_QEMPTY(&i4b_rdqueue))
- return(1);
-
- x = splimp();
- selrecord(td, &select_rd_info);
- selflag = 1;
- splx(x);
- return(0);
- }
- else if((events & POLLOUT) || (events & POLLWRNORM))
- {
- return(1);
- }
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bputqueue - put message into queue to userland
- *---------------------------------------------------------------------------*/
-void
-i4bputqueue(struct mbuf *m)
-{
- int x;
-
- if(!openflag)
- {
- i4b_Dfreembuf(m);
- return;
- }
-
- x = splimp();
-
- IF_LOCK(&i4b_rdqueue);
- if(_IF_QFULL(&i4b_rdqueue))
- {
- struct mbuf *m1;
- _IF_DEQUEUE(&i4b_rdqueue, m1);
- i4b_Dfreembuf(m1);
- NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
- }
-
- _IF_ENQUEUE(&i4b_rdqueue, m);
- IF_UNLOCK(&i4b_rdqueue);
-
- splx(x);
-
- if(readflag)
- {
- readflag = 0;
- wakeup( &i4b_rdqueue);
- }
-
- if(selflag)
- {
- selflag = 0;
- selwakeuppri(&select_rd_info, I4BPRI);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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_LOCK(&i4b_rdqueue);
- if(_IF_QFULL(&i4b_rdqueue))
- {
- struct mbuf *m1;
- _IF_DEQUEUE(&i4b_rdqueue, m1);
- i4b_Dfreembuf(m1);
- NDBGL4(L4_ERR, "ERROR, queue full, removing entry!");
- }
-
- _IF_PREPEND(&i4b_rdqueue, m);
- IF_UNLOCK(&i4b_rdqueue);
-
- splx(x);
-
- if(readflag)
- {
- readflag = 0;
- wakeup( &i4b_rdqueue);
- }
-
- if(selflag)
- {
- selflag = 0;
- selwakeuppri(&select_rd_info, I4BPRI);
- }
-}
diff --git a/sys/i4b/layer4/i4b_l4.c b/sys/i4b/layer4/i4b_l4.c
deleted file mode 100644
index 9ca64e2..0000000
--- a/sys/i4b/layer4/i4b_l4.c
+++ /dev/null
@@ -1,1097 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -----------------------------------------
- * last edit-date: [Sun Aug 11 12:43:14 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "opt_i4b.h"
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-#include <i4b/include/i4b_cause.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-#include <i4b/include/i4b_mbuf.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);
-static void i4b_idle_check_fix_unit(call_desc_t *cd);
-static void i4b_idle_check_var_unit(call_desc_t *cd);
-static void i4b_l4_setup_timeout_fix_unit(call_desc_t *cd);
-static void i4b_l4_setup_timeout_var_unit(call_desc_t *cd);
-static time_t i4b_get_idletime(call_desc_t *cd);
-
-#if defined(NI4BISPPP) && (NI4BISPPP > 0)
-extern time_t i4bisppp_idletime(int);
-#endif
-
-/*---------------------------------------------------------------------------*
- * 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)
- {
- STOP_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd);
- }
-
- if(cd->dlt != NULL)
- {
- (*cd->dlt->line_disconnected)(cd->driver_unit, (void *)cd);
- i4b_unlink_bchandrvr(cd);
- }
-
- if((cd->channelid >= 0) & (cd->channelid < ctrl_desc[cd->controller].nbch))
- {
- 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_DIALOUTNUMBER_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_dialoutnumber(int driver, int driver_unit, int cmdlen, char *cmd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_dialoutnumber_ind_t))) != NULL)
- {
- msg_dialoutnumber_ind_t *md = (msg_dialoutnumber_ind_t *)m->m_data;
- int i;
-
- md->header.type = MSG_DIALOUTNUMBER_IND;
- md->header.cdid = -1;
-
- md->driver = driver;
- md->driver_unit = driver_unit;
-
- for (i = 0; i < cmdlen; i++)
- if (cmd[i] == '*')
- break;
-
- /* XXX: TELNO_MAX is _with_ tailing '\0', so max is actually TELNO_MAX - 1 */
- md->cmdlen = (i < TELNO_MAX - 1 ? i : TELNO_MAX - 1);
- /* skip the (first) '*' */
- md->subaddrlen = (cmdlen - i - 1 < SUBADDR_MAX - 1 ? cmdlen - i - 1 : SUBADDR_MAX - 1);
-
- bcopy(cmd, md->cmd, md->cmdlen);
- if (md->subaddrlen != -1)
- bcopy(cmd+i+1, md->subaddr, md->subaddrlen);
-
- NDBGL4(L4_TIMO, "cmd[%d]=%s, subaddr[%d]=%s", md->cmdlen, md->cmd, md->subaddrlen, md->subaddr);
- i4bputqueue(m);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_KEYPAD_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_keypad(int driver, int driver_unit, int cmdlen, char *cmd)
-{
- struct mbuf *m;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_keypad_ind_t))) != NULL)
- {
- msg_keypad_ind_t *md = (msg_keypad_ind_t *)m->m_data;
-
- md->header.type = MSG_KEYPAD_IND;
- md->header.cdid = -1;
-
- md->driver = driver;
- md->driver_unit = driver_unit;
-
- if(cmdlen > KEYPAD_MAX)
- cmdlen = KEYPAD_MAX;
-
- md->cmdlen = cmdlen;
- bcopy(cmd, md->cmd, cmdlen);
- 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;
- mp->bcap = cd->bcap;
-
- 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->dst_subaddr) > 0)
- strcpy(mp->dst_subaddr, cd->dst_subaddr);
- else
- strcpy(mp->dst_subaddr, TELNO_EMPTY);
-
- if(strlen(cd->src_telno) > 0)
- strcpy(mp->src_telno, cd->src_telno);
- else
- strcpy(mp->src_telno, TELNO_EMPTY);
-
- if(strlen(cd->src_subaddr) > 0)
- strcpy(mp->src_subaddr, cd->src_subaddr);
- else
- strcpy(mp->src_subaddr, TELNO_EMPTY);
-
- mp->src_ton = cd->src_ton;
- mp->dst_ton = cd->dst_ton;
-
- strcpy(mp->display, cd->display);
-
- mp->scr_ind = cd->scr_ind;
- mp->prs_ind = cd->prs_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;
-
- NDBGL4(L4_TIMO, "last_active/connect_time=%ld", (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)
- STOP_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd);
-
- if(cd->dlt != NULL)
- {
- (*cd->dlt->line_disconnected)(cd->driver_unit, (void *)cd);
- i4b_unlink_bchandrvr(cd);
- }
-
- if((cd->channelid >= 0) && (cd->channelid < ctrl_desc[cd->controller].nbch))
- {
- ctrl_desc[cd->controller].bch_state[cd->channelid] = BCH_ST_FREE;
- }
- else
- {
- /* no error, might be hunting call for callback */
- NDBGL4(L4_MSG, "channel free not valid but %d!", 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);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * send MSG_PACKET_IND message to userland
- *---------------------------------------------------------------------------*/
-void
-i4b_l4_packet_ind(int driver, int driver_unit, int dir, struct mbuf *pkt)
-{
- struct mbuf *m;
- int len = pkt->m_pkthdr.len;
- unsigned char *ip = pkt->m_data;
-
- if((m = i4b_Dgetmbuf(sizeof(msg_packet_ind_t))) != NULL)
- {
- msg_packet_ind_t *mp = (msg_packet_ind_t *)m->m_data;
-
- mp->header.type = MSG_PACKET_IND;
- mp->header.cdid = -1;
- mp->driver = driver;
- mp->driver_unit = driver_unit;
- mp->direction = dir;
- memcpy(mp->pktdata, ip,
- len <MAX_PACKET_LOG ? len : MAX_PACKET_LOG);
- 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 defined(NI4BRBCH) && (NI4BRBCH > 0)
- case BDRV_RBCH:
- cd->dlt = rbch_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if defined(NI4BTEL) && (NI4BTEL > 0)
- case BDRV_TEL:
- cd->dlt = tel_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if defined(NI4BIPR) && (NI4BIPR > 0)
- case BDRV_IPR:
- cd->dlt = ipr_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if defined(NI4BISPPP) && (NI4BISPPP > 0)
- case BDRV_ISPPP:
- cd->dlt = i4bisppp_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if defined(NIBC) && NIBC > 0
- case BDRV_IBC:
- cd->dlt = ibc_ret_linktab(cd->driver_unit);
- break;
-#endif
-
-#if defined(NI4BING) && (NI4BING > 0)
- case BDRV_ING:
- cd->dlt = ing_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 defined(NI4BRBCH) && (NI4BRBCH > 0)
- case BDRV_RBCH:
- rbch_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if defined(NI4BTEL) && (NI4BTEL > 0)
- case BDRV_TEL:
- tel_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if defined(NI4BIPR) && (NI4BIPR > 0)
- case BDRV_IPR:
- ipr_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if defined(NI4BISPPP) && (NI4BISPPP > 0)
- case BDRV_ISPPP:
- i4bisppp_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if defined(NIBC) && NIBC > 0
- case BDRV_IBC:
- ibc_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
-#if defined(NI4BING) && (NI4BING > 0)
- case BDRV_ING:
- ing_set_linktab(cd->driver_unit, cd->ilt);
- break;
-#endif
-
- default:
- return(0);
- break;
- }
-
- /* activate B channel */
-
- (*cd->ilt->bch_config)(cd->ilt->unit, cd->ilt->channel, 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)(cd->ilt->unit, cd->ilt->channel, 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.
-
----------------------------------------------------------------------------*/
-
-static time_t
-i4b_get_idletime(call_desc_t *cd)
-{
- switch (cd->driver) {
-#if defined(NI4BISPPP) && (NI4BISPPP > 0)
- case BDRV_ISPPP:
- return i4bisppp_idletime(cd->driver_unit);
- break;
-#endif
- default:
- return cd->last_active_time;
- break;
- }
-}
-/*---------------------------------------------------------------------------*
- * B channel idle check timeout setup
- *---------------------------------------------------------------------------*/
-static void
-i4b_l4_setup_timeout(call_desc_t *cd)
-{
- NDBGL4(L4_TIMO, "%ld: direction %d, shorthold algorithm %d",
- (long)SECOND, cd->dir, cd->shorthold_data.shorthold_algorithm);
-
- 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 */
-
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz/2);
- cd->timeout_active = 1;
- NDBGL4(L4_TIMO, "%ld: incoming-call, setup max_idle_time to %ld", (long)SECOND, (long)cd->max_idle_time);
- }
- else if((cd->dir == DIR_OUTGOING) && (cd->shorthold_data.idle_time > 0))
- {
- switch( cd->shorthold_data.shorthold_algorithm )
- {
- default: /* fall into the old fix algorithm */
- case SHA_FIXU:
- i4b_l4_setup_timeout_fix_unit( cd );
- break;
-
- case SHA_VARU:
- i4b_l4_setup_timeout_var_unit( cd );
- break;
- }
- }
- else
- {
- NDBGL4(L4_TIMO, "no idle_timeout configured");
- }
-}
-
-/*---------------------------------------------------------------------------*
- * fixed unit algorithm B channel idle check timeout setup
- *---------------------------------------------------------------------------*/
-static void
-i4b_l4_setup_timeout_fix_unit(call_desc_t *cd)
-{
- /* outgoing call */
-
- if((cd->shorthold_data.idle_time > 0) && (cd->shorthold_data.unitlen_time == 0))
- {
- /* outgoing call: simple max idletime check */
-
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz/2);
- cd->timeout_active = 1;
- NDBGL4(L4_TIMO, "%ld: outgoing-call, setup idle_time to %ld",
- (long)SECOND, (long)cd->shorthold_data.idle_time);
- }
- else if((cd->shorthold_data.unitlen_time > 0) && (cd->shorthold_data.unitlen_time > (cd->shorthold_data.idle_time + cd->shorthold_data.earlyhup_time)))
- {
- /* outgoing call: full shorthold mode check */
-
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz*(cd->shorthold_data.unitlen_time - (cd->shorthold_data.idle_time + cd->shorthold_data.earlyhup_time)));
- cd->timeout_active = 1;
- cd->idletime_state = IST_NONCHK;
- NDBGL4(L4_TIMO, "%ld: outgoing-call, start %ld sec nocheck window",
- (long)SECOND, (long)(cd->shorthold_data.unitlen_time - (cd->shorthold_data.idle_time + cd->shorthold_data.earlyhup_time)));
-
- if(cd->aocd_flag == 0)
- {
- cd->units_type = CHARGE_CALC;
- cd->cunits++;
- i4b_l4_charging_ind(cd);
- }
- }
- else
- {
- /* parms somehow got wrong .. */
-
- NDBGL4(L4_ERR, "%ld: ERROR: idletime[%ld]+earlyhup[%ld] > unitlength[%ld]!",
- (long)SECOND, (long)cd->shorthold_data.idle_time, (long)cd->shorthold_data.earlyhup_time, (long)cd->shorthold_data.unitlen_time);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * variable unit algorithm B channel idle check timeout setup
- *---------------------------------------------------------------------------*/
-static void
-i4b_l4_setup_timeout_var_unit(call_desc_t *cd)
-{
- /* outgoing call: variable unit idletime check */
-
- /*
- * start checking for an idle connect one second before the end of the unit.
- * The one second takes into account of rounding due to the driver only
- * using the seconds and not the uSeconds of the current time
- */
- cd->idletime_state = IST_CHECK; /* move directly to the checking state */
-
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz * (cd->shorthold_data.unitlen_time - 1) );
- cd->timeout_active = 1;
- NDBGL4(L4_TIMO, "%ld: outgoing-call, var idle time - setup to %ld",
- (long)SECOND, (long)cd->shorthold_data.unitlen_time);
-}
-
-
-/*---------------------------------------------------------------------------*
- * 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)
- {
- NDBGL4(L4_ERR, "ERROR: timeout_active == 0 !!!");
- }
- else
- {
- cd->timeout_active = 0;
- }
-
- /* incoming connections, simple idletime check */
-
- if(cd->dir == DIR_INCOMING)
- {
- if((i4b_get_idletime(cd) + cd->max_idle_time) <= SECOND)
- {
- NDBGL4(L4_TIMO, "%ld: incoming-call, line idle timeout, disconnecting!", (long)SECOND);
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(cd->cdid,
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- i4b_l4_idle_timeout_ind(cd);
- }
- else
- {
- NDBGL4(L4_TIMO, "%ld: incoming-call, activity, last_active=%ld, max_idle=%ld", (long)SECOND, (long)i4b_get_idletime(cd), (long)cd->max_idle_time);
-
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz/2);
- cd->timeout_active = 1;
- }
- }
-
- /* outgoing connections */
-
- else if(cd->dir == DIR_OUTGOING)
- {
- switch( cd->shorthold_data.shorthold_algorithm )
- {
- case SHA_FIXU:
- i4b_idle_check_fix_unit( cd );
- break;
- case SHA_VARU:
- i4b_idle_check_var_unit( cd );
- break;
- default:
- NDBGL4(L4_TIMO, "%ld: bad value for shorthold_algorithm of %d",
- (long)SECOND, cd->shorthold_data.shorthold_algorithm);
- i4b_idle_check_fix_unit( cd );
- break;
- }
- }
- splx(s);
-}
-
-/*---------------------------------------------------------------------------*
- * fixed unit algorithm B channel idle check timeout function
- *---------------------------------------------------------------------------*/
-static void
-i4b_idle_check_fix_unit(call_desc_t *cd)
-{
-
- /* simple idletime calculation */
-
- if((cd->shorthold_data.idle_time > 0) && (cd->shorthold_data.unitlen_time == 0))
- {
- if((i4b_get_idletime(cd) + cd->shorthold_data.idle_time) <= SECOND)
- {
- NDBGL4(L4_TIMO, "%ld: outgoing-call-st, idle timeout, disconnecting!", (long)SECOND);
- (*ctrl_desc[cd->controller].N_DISCONNECT_REQUEST)(cd->cdid, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- i4b_l4_idle_timeout_ind(cd);
- }
- else
- {
- NDBGL4(L4_TIMO, "%ld: outgoing-call-st, activity, last_active=%ld, max_idle=%ld",
- (long)SECOND, (long)i4b_get_idletime(cd), (long)cd->shorthold_data.idle_time);
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz/2);
- cd->timeout_active = 1;
- }
- }
-
- /* full shorthold mode calculation */
-
- else if((cd->shorthold_data.unitlen_time > 0)
- && (cd->shorthold_data.unitlen_time > (cd->shorthold_data.idle_time + cd->shorthold_data.earlyhup_time)))
- {
- switch(cd->idletime_state)
- {
-
- case IST_NONCHK: /* end of non-check time */
-
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz*(cd->shorthold_data.idle_time));
- cd->idletimechk_start = SECOND;
- cd->idletime_state = IST_CHECK;
- cd->timeout_active = 1;
- NDBGL4(L4_TIMO, "%ld: outgoing-call, idletime check window reached!", (long)SECOND);
- break;
-
- case IST_CHECK: /* end of idletime chk */
- if((i4b_get_idletime(cd) > cd->idletimechk_start) &&
- (i4b_get_idletime(cd) <= SECOND))
- { /* activity detected */
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz*(cd->shorthold_data.earlyhup_time));
- cd->timeout_active = 1;
- cd->idletime_state = IST_SAFE;
- NDBGL4(L4_TIMO, "%ld: outgoing-call, activity at %ld, wait earlyhup-end", (long)SECOND, (long)i4b_get_idletime(cd));
- }
- else
- { /* no activity, hangup */
- NDBGL4(L4_TIMO, "%ld: outgoing-call, idle timeout, last activity at %ld", (long)SECOND, (long)i4b_get_idletime(cd));
- (*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 */
-
- START_TIMER(cd->idle_timeout_handle, i4b_idle_check, cd, hz*(cd->shorthold_data.unitlen_time - (cd->shorthold_data.idle_time+cd->shorthold_data.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);
- }
-
- NDBGL4(L4_TIMO, "%ld: outgoing-call, earlyhup end, wait for idletime start", (long)SECOND);
- break;
-
- default:
- NDBGL4(L4_ERR, "outgoing-call: invalid idletime_state value!");
- cd->idletime_state = IST_IDLE;
- break;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * variable unit algorithm B channel idle check timeout function
- *---------------------------------------------------------------------------*/
-static void
-i4b_idle_check_var_unit(call_desc_t *cd)
-{
- switch(cd->idletime_state)
- {
-
- /* see if there has been any activity within the last idle_time seconds */
- case IST_CHECK:
- if( i4b_get_idletime(cd) > (SECOND - cd->shorthold_data.idle_time))
- { /* activity detected */
- /* check again in one second */
- cd->idle_timeout_handle =
- START_TIMER (cd->idle_timeout_handle, i4b_idle_check, cd, hz);
- cd->timeout_active = 1;
- cd->idletime_state = IST_CHECK;
- NDBGL4(L4_TIMO, "%ld: outgoing-call, var idle timeout - activity at %ld, continuing", (long)SECOND, (long)i4b_get_idletime(cd));
- }
- else
- { /* no activity, hangup */
- NDBGL4(L4_TIMO, "%ld: outgoing-call, var idle timeout - last activity at %ld", (long)SECOND, (long)i4b_get_idletime(cd));
- (*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;
-
- default:
- NDBGL4(L4_ERR, "outgoing-call: var idle timeout invalid idletime_state value!");
- cd->idletime_state = IST_IDLE;
- break;
- }
-}
diff --git a/sys/i4b/layer4/i4b_l4.h b/sys/i4b/layer4/i4b_l4.h
deleted file mode 100644
index b02d9ac..0000000
--- a/sys/i4b/layer4/i4b_l4.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * Copyright (c) 1997, 2001 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
- * ---------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Thu Oct 18 10:11:51 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#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_dialoutnumber(int driver, int driver_unit, int cmdlen, char *cmd);
-extern void i4b_l4_keypad(int driver, int driver_unit, int cmdlen, char *cmd);
-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_packet_ind(int, int, int, struct mbuf *pkt);
-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 1f3e9e3..0000000
--- a/sys/i4b/layer4/i4b_l4mgmt.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * -----------------------------------------------------------
- * last edit-date: [Sun Aug 11 12:42:01 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/include/i4b_l3l4.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 */
-
-void i4b_init_callout(call_desc_t *);
-
-/*---------------------------------------------------------------------------*
- * 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 */
- NDBGL4(L4_MSG, "found free cd - index=%d cdid=%u",
- i, call_desc[i].cdid);
- break;
- }
- }
-
- splx(x);
-
- if(cd == NULL)
- panic("reserve_cd: no free call descriptor available!");
-
- i4b_init_callout(cd);
-
- return(cd);
-}
-
-/*---------------------------------------------------------------------------*
- * free a calldescriptor
- * ---------------------
- * free an 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) )
- {
- NDBGL4(L4_MSG, "releasing cd - index=%d cdid=%u cr=%d",
- 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)
- {
- NDBGL4(L4_MSG, "found cdid - index=%d cdid=%u cr=%d",
- i, call_desc[i].cdid, call_desc[i].cr);
-
- i4b_init_callout(&call_desc[i]);
-
- 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) )
- {
- NDBGL4(L4_MSG, "found cd, index=%d cdid=%u cr=%d",
- i, call_desc[i].cdid, call_desc[i].cr);
-
- i4b_init_callout(&call_desc[i]);
-
- 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;
-
-#ifdef RANDOMDEV
- read_random((char *)&val, sizeof(val));
-#else
- val = (u_char)random();
-#endif /* RANDOMDEV */
-
- 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
- *---------------------------------------------------------------------------*/
-void
-i4b_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;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * 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].N_MGMT_COMMAND &&
- (ctrl_desc[i].ctrl_type == CTRL_PASSIVE ||
- ctrl_desc[i].ctrl_type == CTRL_CAPIMGR))
- {
- NDBGL4(L4_MSG, "CMR_DOPEN sent to unit %d", 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].N_MGMT_COMMAND &&
- (ctrl_desc[i].ctrl_type == CTRL_PASSIVE ||
- ctrl_desc[i].ctrl_type == CTRL_CAPIMGR))
- {
- NDBGL4(L4_MSG, "CMR_DCLOSE sent to unit %d", 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(" bcap = %d\n", cdp->bcap);
- 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 */
diff --git a/sys/i4b/layer4/i4b_l4timer.c b/sys/i4b/layer4/i4b_l4timer.c
deleted file mode 100644
index 90d564d..0000000
--- a/sys/i4b/layer4/i4b_l4timer.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * Copyright (c) 1997, 2002 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
- * --------------------------------------------------------
- * last edit-date: [Sat Mar 9 19:49:13 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-
-#include <i4b/include/i4b_debug.h>
-#include <i4b/include/i4b_ioctl.h>
-
-#include <i4b/include/i4b_global.h>
-#include <i4b/include/i4b_l3l4.h>
-
-#include <i4b/layer4/i4b_l4.h>
-
-/*---------------------------------------------------------------------------*
- * timer T400 timeout function
- *---------------------------------------------------------------------------*/
-static void
-T400_timeout(call_desc_t *cd)
-{
- NDBGL4(L4_ERR, "cr = %d", cd->cr);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T400 start
- *---------------------------------------------------------------------------*/
-void
-T400_start(call_desc_t *cd)
-{
- if (cd->T400 == TIMER_ACTIVE)
- return;
-
- NDBGL4(L4_MSG, "cr = %d", cd->cr);
- cd->T400 = TIMER_ACTIVE;
-
- START_TIMER(cd->T400_callout, T400_timeout, cd, T400DEF);
-}
-
-/*---------------------------------------------------------------------------*
- * timer T400 stop
- *---------------------------------------------------------------------------*/
-void
-T400_stop(call_desc_t *cd)
-{
- CRIT_VAR;
- CRIT_BEG;
-
- if(cd->T400 == TIMER_ACTIVE)
- {
- STOP_TIMER(cd->T400_callout, T400_timeout, cd);
- cd->T400 = TIMER_IDLE;
- }
- CRIT_END;
- NDBGL4(L4_MSG, "cr = %d", cd->cr);
-}
diff --git a/sys/pc98/conf/NOTES b/sys/pc98/conf/NOTES
index 6f50f50..cc7a4c7 100644
--- a/sys/pc98/conf/NOTES
+++ b/sys/pc98/conf/NOTES
@@ -500,143 +500,6 @@ device pmtimer # Adjust system timer at wakeup time
options POWERFAIL_NMI # make it beep instead of panicing
-#---------------------------------------------------------------------------
-# ISDN4BSD
-#
-# See /usr/share/examples/isdn/ROADMAP for an introduction to isdn4bsd.
-#
-# i4b passive ISDN cards support contains the following hardware drivers:
-#
-# isic - Siemens/Infineon ISDN ISAC/HSCX/IPAC chipset driver
-# iwic - Winbond W6692 PCI bus ISDN S/T interface controller
-# ifpi - AVM Fritz!Card PCI driver
-# ifpi2 - AVM Fritz!Card PCI version 2 driver
-# ihfc - Cologne Chip HFC ISA/ISA-PnP chipset driver
-# ifpnp - AVM Fritz!Card PnP driver
-# itjc - Siemens ISAC / TJNet Tiger300/320 chipset
-#
-# i4b active ISDN cards support contains the following hardware drivers:
-#
-# iavc - AVM B1 PCI, AVM B1 ISA, AVM T1
-#
-# Note that the ``options'' (if given) and ``device'' lines must BOTH
-# be uncommented to enable support for a given card !
-#
-# In addition to a hardware driver (and probably an option) the mandatory
-# ISDN protocol stack devices and the mandatory support device must be
-# enabled as well as one or more devices from the optional devices section.
-#
-#---------------------------------------------------------------------------
-# isic driver (Siemens/Infineon chipsets)
-#
-device isic
-#
-# PCI bus Cards:
-# --------------
-#
-# ELSA MicroLink ISDN/PCI (same as ELSA QuickStep 1000pro PCI)
-options ELSA_QS1PCI
-#
-#---------------------------------------------------------------------------
-# ifpnp driver for AVM Fritz!Card PnP
-#
-# AVM Fritz!Card PnP
-device ifpnp
-#
-#---------------------------------------------------------------------------
-# ihfc driver for Cologne Chip ISA chipsets (experimental!)
-#
-# Teles 16.3c ISA PnP
-# AcerISDN P10 ISA PnP
-# TELEINT ISDN SPEED No.1
-device ihfc
-#
-#---------------------------------------------------------------------------
-# ifpi driver for AVM Fritz!Card PCI
-#
-# AVM Fritz!Card PCI
-device ifpi
-#
-#---------------------------------------------------------------------------
-# ifpi2 driver for AVM Fritz!Card PCI version 2
-#
-# AVM Fritz!Card PCI version 2
-device ifpi2
-#
-#---------------------------------------------------------------------------
-# iwic driver for Winbond W6692 chipset
-#
-# ASUSCOM P-IN100-ST-D (and other Winbond W6692 based cards)
-device iwic
-#
-#---------------------------------------------------------------------------
-# itjc driver for Siemens ISAC / TJNet Tiger300/320 chipset
-#
-# Traverse Technologies NETjet-S
-# Teles PCI-TJ
-device itjc
-#
-#---------------------------------------------------------------------------
-# iavc driver (AVM active cards, needs i4bcapi driver!)
-#
-device iavc
-#
-#---------------------------------------------------------------------------
-# ISDN Protocol Stack - mandatory for all hardware drivers
-#
-# Q.921 / layer 2 - i4b passive cards D channel handling
-device i4bq921
-#
-# Q.931 / layer 3 - i4b passive cards D channel handling
-device i4bq931
-#
-# layer 4 - i4b common passive and active card handling
-device i4b
-#
-#---------------------------------------------------------------------------
-# ISDN devices - mandatory for all hardware drivers
-#
-# userland driver to do ISDN tracing (for passive cards only)
-device i4btrc
-options NI4BTRC=4
-#
-# userland driver to control the whole thing
-device i4bctl
-#
-#---------------------------------------------------------------------------
-# ISDN devices - optional
-#
-# userland driver for access to raw B channel
-device i4brbch
-options NI4BRBCH=4
-#
-# userland driver for telephony
-device i4btel
-options NI4BTEL=2
-#
-#XXXBZ# IPR and ISPPP are not usable until I4B is locked.
-# network driver for IP over raw HDLC ISDN
-#XXXBZ#device i4bipr
-#XXXBZ#options NI4BIPR=4
-# enable VJ header compression detection for ipr i/f
-#XXXBZ#options IPR_VJ
-# enable logging of the first n IP packets to isdnd (n=32 here)
-#XXXBZ#options IPR_LOG=32
-#
-# network driver for sync PPP over ISDN; requires an equivalent
-# number of sppp device to be configured
-#XXXBZ#device i4bisppp
-#XXXBZ#options NI4BISPPP=4
-#
-# B-channel interface to the netgraph subsystem
-#XXXBZ#device i4bing
-#XXXBZ#options NI4BING=2
-#
-# CAPI driver needed for active ISDN cards (see iavc driver above)
-device i4bcapi
-#
-#---------------------------------------------------------------------------
-
#
# Set the number of PV entries per process. Increasing this can
# stop panics related to heavy use of shared memory. However, that can
@@ -739,7 +602,6 @@ options FB_INSTALL_CDEV # install a CDEV entry in /dev
options PECOFF_SUPPORT
options PECOFF_DEBUG
-options I4B_SMP_WORKAROUND
options I586_PMC_GUPROF=0x70000
options KBDIO_DEBUG=2
options KBD_MAXRETRY=4
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index 3c42819..023f7f3 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -410,63 +410,6 @@ OLD_FILES+=usr/share/man/man1/gcov.1.gz
# to be filled in
#.endif
-.if ${MK_I4B} == no
-OLD_FILES+=usr/sbin/dtmfdecode
-OLD_FILES+=usr/sbin/g711conv
-OLD_FILES+=usr/sbin/isdnd
-OLD_FILES+=usr/sbin/isdndebug
-OLD_FILES+=usr/sbin/isdndecode
-OLD_FILES+=usr/sbin/isdnmonitor
-OLD_FILES+=usr/sbin/isdnphone
-OLD_FILES+=usr/sbin/isdntel
-OLD_FILES+=usr/sbin/isdntelctl
-OLD_FILES+=usr/sbin/isdntrace
-OLD_FILES+=usr/share/isdn/0.al
-OLD_FILES+=usr/share/isdn/1.al
-OLD_FILES+=usr/share/isdn/2.al
-OLD_FILES+=usr/share/isdn/3.al
-OLD_FILES+=usr/share/isdn/4.al
-OLD_FILES+=usr/share/isdn/5.al
-OLD_FILES+=usr/share/isdn/6.al
-OLD_FILES+=usr/share/isdn/7.al
-OLD_FILES+=usr/share/isdn/8.al
-OLD_FILES+=usr/share/isdn/9.al
-OLD_FILES+=usr/share/isdn/beep.al
-OLD_FILES+=usr/share/isdn/msg.al
-OLD_FILES+=usr/share/man/man1/dtmfdecode.1.gz
-OLD_FILES+=usr/share/man/man1/g711conv.1.gz
-OLD_FILES+=usr/share/man/man4/i4b.4.gz
-OLD_FILES+=usr/share/man/man4/i4bcapi.4.gz
-OLD_FILES+=usr/share/man/man4/i4bctl.4.gz
-OLD_FILES+=usr/share/man/man4/i4bing.4.gz
-OLD_FILES+=usr/share/man/man4/i4bipr.4.gz
-OLD_FILES+=usr/share/man/man4/i4bisppp.4.gz
-OLD_FILES+=usr/share/man/man4/i4bq921.4.gz
-OLD_FILES+=usr/share/man/man4/i4bq931.4.gz
-OLD_FILES+=usr/share/man/man4/i4brbch.4.gz
-OLD_FILES+=usr/share/man/man4/i4btel.4.gz
-OLD_FILES+=usr/share/man/man4/i4btrc.4.gz
-OLD_FILES+=usr/share/man/man4/iavc.4.gz
-OLD_FILES+=usr/share/man/man4/isic.4.gz
-OLD_FILES+=usr/share/man/man4/ifpi.4.gz
-OLD_FILES+=usr/share/man/man4/ifpi2.4.gz
-OLD_FILES+=usr/share/man/man4/ifpnp.4.gz
-OLD_FILES+=usr/share/man/man4/ihfc.4.gz
-OLD_FILES+=usr/share/man/man4/itjc.4.gz
-OLD_FILES+=usr/share/man/man4/iwic.4.gz
-OLD_FILES+=usr/share/man/man5/isdnd.rc.5.gz
-OLD_FILES+=usr/share/man/man5/isdnd.rates.5.gz
-OLD_FILES+=usr/share/man/man5/isdnd.acct.5.gz
-OLD_FILES+=usr/share/man/man8/isdnd.8.gz
-OLD_FILES+=usr/share/man/man8/isdndebug.8.gz
-OLD_FILES+=usr/share/man/man8/isdndecode.8.gz
-OLD_FILES+=usr/share/man/man8/isdnmonitor.8.gz
-OLD_FILES+=usr/share/man/man8/isdnphone.8.gz
-OLD_FILES+=usr/share/man/man8/isdntel.8.gz
-OLD_FILES+=usr/share/man/man8/isdntelctl.8.gz
-OLD_FILES+=usr/share/man/man8/isdntrace.8.gz
-.endif
-
.if ${MK_INET6} == no
OLD_FILES+=rescue/ping6
OLD_FILES+=sbin/ping6
diff --git a/tools/build/options/WITHOUT_I4B b/tools/build/options/WITHOUT_I4B
deleted file mode 100644
index 51da618..0000000
--- a/tools/build/options/WITHOUT_I4B
+++ /dev/null
@@ -1,2 +0,0 @@
-.\" $FreeBSD$
-Set to not build isdn4bsd package.
diff --git a/tools/kerneldoc/subsys/Dependencies b/tools/kerneldoc/subsys/Dependencies
index 2eda312..6307b48 100644
--- a/tools/kerneldoc/subsys/Dependencies
+++ b/tools/kerneldoc/subsys/Dependencies
@@ -18,5 +18,3 @@ $(.OBJDIR)/dev_pci/dev_pci.tag: $(.OBJDIR)/pci_if.h \
$(.OBJDIR)/pcib_if.h \
$(.OBJDIR)/bus_if.h
-$(.OBJDIR)/i4b/i4b.tag: $(.OBJDIR)/dev_pci/dev_pci.tag
-
diff --git a/tools/kerneldoc/subsys/Doxyfile-i4b b/tools/kerneldoc/subsys/Doxyfile-i4b
deleted file mode 100644
index 5573e84..0000000
--- a/tools/kerneldoc/subsys/Doxyfile-i4b
+++ /dev/null
@@ -1,21 +0,0 @@
-# Doxyfile 1.4.1
-
-# $FreeBSD$
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "FreeBSD kernel ISDN code"
-OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/i4b/
-EXTRACT_ALL = YES # for undocumented src, no warnings enabled
-#--------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = $(DOXYGEN_SRC_PATH)/i4b/ $(NOTREVIEWED)
-
-GENERATE_TAGFILE = i4b/i4b.tag
-TAGFILES = dev_pci/dev_pci.tag=../../dev_pci/html
-
-@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH)
-@INCLUDE = common-Doxyfile
-
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 1467b74..d6a7fee 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -62,7 +62,6 @@ SUBDIR= ac \
getfmac \
getpmac \
gstat \
- ${_i4b} \
ifmcstat \
inetd \
iostat \
@@ -301,9 +300,6 @@ _apm= apm
_apmd= apmd
_asf= asf
_btxld= btxld
-.if ${MK_I4B} != "no"
-_i4b= i4b
-.endif
_kgmon= kgmon
_kgzip= kgzip
_lptcontrol= lptcontrol
diff --git a/usr.sbin/i4b/Makefile b/usr.sbin/i4b/Makefile
deleted file mode 100644
index 01f7642..0000000
--- a/usr.sbin/i4b/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# $FreeBSD$
-
-SUBDIR= dtmfdecode g711conv isdnd isdndebug isdndecode isdnmonitor isdnphone \
- isdntel isdntelctl isdntest isdntrace man
-
-.include <bsd.subdir.mk>
-
diff --git a/usr.sbin/i4b/Makefile.inc b/usr.sbin/i4b/Makefile.inc
deleted file mode 100644
index 1195419..0000000
--- a/usr.sbin/i4b/Makefile.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-# if you don't like curses stuff in the daemon (i.e. don't intend
-# to ever run it in the foreground but are using the monitoring
-# utilities instead) define this to compile it without.
-#I4B_WITHOUT_CURSES = 1
-
-# if you would like monitoring support, define this
-I4B_EXTERNAL_MONITOR = 1
-
-# for the security conscious type: restrict monitoring to the
-# local machine by not compiling any tcp/ip support for monitoring
-# at all
-#I4B_NOTCPIP_MONITOR = 1
-
-.include "${.CURDIR}/../../Makefile.inc"
diff --git a/usr.sbin/i4b/dtmfdecode/Makefile b/usr.sbin/i4b/dtmfdecode/Makefile
deleted file mode 100644
index 74a9df7..0000000
--- a/usr.sbin/i4b/dtmfdecode/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Tue Dec 14 21:17:46 1999]
-#
-#---------------------------------------------------------------------------
-
-PROG= dtmfdecode
-
-CFLAGS+= -DDEBUG
-
-# libm is only necessary if USE_COS is defined in the source
-#LDADD= -lm
-
-test: ${PROG}
- uudecode -p < dtmfsounds.al.uu | ./${PROG}
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/dtmfdecode/dtmfdecode.1 b/usr.sbin/i4b/dtmfdecode/dtmfdecode.1
deleted file mode 100644
index 53f673a..0000000
--- a/usr.sbin/i4b/dtmfdecode/dtmfdecode.1
+++ /dev/null
@@ -1,70 +0,0 @@
-.\"
-.\" Copyright (c) 1999 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.
-.\"
-.\" $Id: dtmfdecode.1,v 1.6 1999/12/13 22:11:55 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Mon Dec 13 22:53:13 1999]
-.\"
-.\"
-.Dd February 15, 1999
-.Dt DTMFDECODE 1
-.Os
-.Sh NAME
-.Nm dtmfdecode
-.Nd decodes DTMF tones from A-law audio data
-.Sh SYNOPSIS
-.Nm
-.Sh DESCRIPTION
-The
-.Nm
-utility
-is part of the isdn4bsd package and is used to detect DTMF tones in the
-audio stream.
-.Pp
-It reads audio G.711 A-Law coded data from stdin and outputs the detected
-numbers values as ASCII characters to stdout.
-.Pp
-The detector is implemented as 8 narrow band-pass filters realized with
-an integer double-cross recursive algorithm.
-Various ad-hoc methods are
-employed to provide hysteresis and anti-bounce for the detected signals.
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-dtmfdecode < beep.al
-.Ed
-.Pp
-will print a "1" to stdout.
-.Sh STANDARDS
-ITU Recommendations G.711
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-utility was written by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org .
-This man page was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/dtmfdecode/dtmfdecode.c b/usr.sbin/i4b/dtmfdecode/dtmfdecode.c
deleted file mode 100644
index 16c68e6..0000000
--- a/usr.sbin/i4b/dtmfdecode/dtmfdecode.c
+++ /dev/null
@@ -1,152 +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: dtmfdecode.c,v 1.6 1999/12/13 21:25:24 hm Exp $
- *
- * $FreeBSD$
- *
- * Extract DTMF signalling from ISDN4BSD A-law coded audio data
- *
- * A-Law to linear conversion from the sox package.
- *
- */
-
-#include <stdio.h>
-#include <math.h>
-
-/* Integer math scaling factor */
-#define FSC (1<<12)
-
-/* Alaw parameters */
-#define SIGN_BIT (0x80) /* Sign bit for an A-law byte. */
-#define QUANT_MASK (0xf) /* Quantization field mask. */
-#define SEG_SHIFT (4) /* Left shift for segment number. */
-#define SEG_MASK (0x70) /* Segment field mask. */
-
-static int
-alaw2linear(a_val)
- unsigned char a_val;
-{
- int t;
- int seg;
-
- a_val ^= 0x55;
-
- t = (a_val & QUANT_MASK) << 4;
- seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
- switch (seg) {
- case 0:
- t += 8;
- break;
- case 1:
- t += 0x108;
- break;
- default:
- t += 0x108;
- t <<= seg - 1;
- }
- return ((a_val & SIGN_BIT) ? t : -t);
-}
-
-#ifdef USE_COS
-/* The frequencies we're trying to detect */
-static int dtmf[8] = {697, 770, 852, 941, 1209, 1336, 1477, 1633};
-#else
-/* precalculated: p1[kk] = (-cos(2 * 3.141592 * dtmf[kk] / 8000.0) * FSC) */
-static int p1[8] = {-3497, -3369, -3212, -3027, -2384, -2040, -1635, -1164};
-#endif
-
-/* This is the Q of the filter (pole radius) */
-#define POLRAD .99
-
-#define P2 ((int)(POLRAD*POLRAD*FSC))
-
-int
-main(int argc, char **argv)
-{
- int i, kk, t, nn, s, so, ia;
- int x, c, d, f, h[8], k[8], n, y[8];
-#ifdef USE_COS
- int p1[8];
-#endif
- int alaw[256];
- char key[256];
-
- for (kk = 0; kk < 8; kk++) {
- y[kk] = h[kk] = k[kk] = 0;
-#ifdef USE_COS
- p1[kk] = (-cos(2 * 3.141592 * dtmf[kk] / 8000.0) * FSC);
-#endif
- }
-
- for (i = 0; i < 256; i++) {
- key[i] = '?';
- alaw[i] = alaw2linear(i) / (32768/FSC);
- }
-
- /* We encode the tones in 8 bits, translate those to symbol */
- key[0x00] = '\0';
-
- key[0x11] = '1'; key[0x12] = '4'; key[0x14] = '7'; key[0x18] = '*';
- key[0x21] = '2'; key[0x22] = '5'; key[0x24] = '8'; key[0x28] = '0';
- key[0x41] = '3'; key[0x42] = '6'; key[0x44] = '9'; key[0x48] = '#';
- key[0x81] = 'A'; key[0x82] = 'B'; key[0x84] = 'C'; key[0x88] = 'D';
-
- nn = 0;
- ia = 0;
- so = 0;
- t = 0;
- while ((i = getchar()) != EOF)
- {
- t++;
-
- /* Convert to our format */
- x = alaw[i];
-
- /* Input amplitude */
- if (x > 0)
- ia += (x - ia) / 128;
- else
- ia += (-x - ia) / 128;
-
- /* For each tone */
- s = 0;
- for(kk = 0; kk < 8; kk++) {
-
- /* Turn the crank */
- c = (P2 * (x - k[kk])) / FSC;
- d = x + c;
- f = (p1[kk] * (d - h[kk])) / FSC;
- n = x - k[kk] - c;
- k[kk] = h[kk] + f;
- h[kk] = f + d;
-
- /* Detect and Average */
- if (n > 0)
- y[kk] += (n - y[kk]) / 64;
- else
- y[kk] += (-n - y[kk]) / 64;
-
- /* Threshold */
- if (y[kk] > FSC/10 && y[kk] > ia)
- s |= 1 << kk;
- }
-
- /* Hysteresis and noise supressor */
- if (s != so) {
-/* printf("x %d %x -> %x\n",t,so, s); */
- nn = 0;
- so = s;
- } else if (nn++ == 520 && key[s]) {
- putchar(key[s]);
-/* printf(" %d %x\n",t,s); */
- }
- }
- putchar('\n');
- return (0);
-}
diff --git a/usr.sbin/i4b/dtmfdecode/dtmfsounds.al.uu b/usr.sbin/i4b/dtmfdecode/dtmfsounds.al.uu
deleted file mode 100644
index f4e0c07..0000000
--- a/usr.sbin/i4b/dtmfdecode/dtmfsounds.al.uu
+++ /dev/null
@@ -1,2098 +0,0 @@
-$FreeBSD$
-begin 666 dtmfsounds.al
-M5555U=74U-564-34UU%5U-?1UM'7UM37U=5555145%545%155%555%555=75
-M5575U=75U-15U5555575U575U=75U=75U=34U-35U-35U=75U=55U=5555%0
-MU-374535U-;7T=?6U]?4U-75U555551555555555555555555%5555145=75
-MU-34U-34U-35U=75U=75U=55U=75U=55555555755=5545/4U-=15-37T=;1
-MU];7U]34U=5555555%145%145%555555U555U=55U=34U=75U=75U-75U=35
-MU-74U=74U-75U=75U=75U=55U=75U=564-34UU!4U-36U]'6UM?7U-35U555
-M55555555555455155555555555545%55U-74U-34U-34U=74U-35U=35U=75
-MU=75U=75U=75U=75U590U-374534U-'6T=;6U]?5U-555%145%155%545555
-M5555U555U=75U=74U-5555755=75U=74U=75U=75U=35U=34U=74U-35U=75
-M555545/4U-=15-34T=;1U];7U]34U=55555555555%555%545%555=555575
-M5535U=34U-34U-34U-34U-75U=555555555555555555U=75U=514]34UU%4
-MU-?1UM'6UM?6U-15U51555155514551455555=75U=75U=75U=35U=75U=75
-MU=75U-34U-34U-75U=75U=75U=74U=75U=5555%0U-374535U-'6T=;1UM;4
-MU-75555555145%555555555555555575U5555=75U-34U-34U-74U=75U-74
-MU=75U=5555555=55U=75U=755E#4U-=15-34T=;1UM;7U]34U=5555555514
-M5%555%5555155575U=74U=74U55555555=75U-35U-34U-75U=75U-75U=75
-M5555555555104]74UU%5U-;0UM#6UM?7U=35U-755554551455155%155575
-MU=75U=155U755=75U-34U-34U-34U-75U575U555U=55U5555575U=75U5%3
-MU-375E74U]'6T=?6U]?4U-755=5555145%5555555555U=55U555U575U-55
-MU=75U=75U=34U=35U=75U=75U-75U=74U-75U=75U=7545/4U-=15-74UM36
-MU];7U]34U=75U5555%5455555555555555555%5555=4U=74U-34U]34U-35
-MU=75U=75U555555555555555U555U5564]34UU94U-?1U]'7UM37U-35U=75
-M555555145%5455155575U=75U=75U=?4U=75U=75U=75U=75U=75U-35U-75
-MU=75U=35U=75U=7555%3U-?74534U-;7UM?6U]?7U-35U555555555545%14
-M55555575U=75U5545%55U=74U]?7U-34U-35U=75U=75U=75U=75U=75U=75
-MU=5545/5U-965=?7T=;1U];4U]75U5555555555555155%5555555=75U=35
-MU=74U-75U=75U-74U=75U=75U=35U=35U-74U=75U=75555555514]37UE95
-MU-31UM'7UM?7U-35U-5555555%545%145%155575U575U=345%75U=34U-34
-MU-34U=75U=75U=75U=75555555555=55U575U5%3U-374534U]'6T=;1U]?4
-MU-755554551555555555555555555=75U575U-35U=75U=35U-75U-75U-34
-MU=75U=75U=75U=75U=75U55545/5U-=15-74UM;6U];4U]34U=5555555555
-M55555%1555555=55U=75U5145575U=77U-?7U]34U-35U=75U=75U=55U=55
-MU=75U=75U=564]34UU%4U=36U];7U]37U=35U=75555555555%555%555%55
-M5=75U=75U=34U=55U=75U=75U-75U=74U=74U-35U=75U-34U-75U57555%3
-MU=774534U-'6T=;6U];4U-74U555551555545514555555555=75U=155-75
-MU-34U-34U-35U=75U=75U=755=5555555=75U=755=5545#5U-=15=37T=;1
-MU];7U]74U=5555155%555%155%145575U=75U=75U=74U-35U=75U=35U=75
-MU=74U=75U=75U=74U=75U=55U555U5514]75UU%4U=31U]'7UM?7U-35U555
-M5%1455155%55555555555=75U=355515U=75U-34U-37U-35U=75U=35U-75
-M555555555575U=75U590U-375E77U]'6T=;1U]?4U-755555555555555514
-M555455155555U=55U-35U=75U-74U-74U-74U=75U=75U=35U=75U=75U=55
-MU55545+5U=115-37T=;0UM;7UM37U-15U5555%5455555%555%555=75U575
-MU%54U=75U-75U-34U-35U=75U=74U=74U=75U575U=75U=75U=514-34UU%4
-MU-?1UM'6UM?7U-35U5755555551555145515555555755=75U=34U=75U575
-MU555U=55U=75U=75U=75U=34U-75U=75U=75U590U-?65E37U-'6T=?6U];4
-MU]3555545%145U145%1455555575U=55U=555-75U-34U-37U-34U-34U=35
-MU=75U=75U555555555555=755E#4U]965=37T-;1UM;4U]745=55U5555514
-M5%1455155=755=75U=75U=74U]75U=75U=75U=75U=75U=75U=74U-35U-35
-MU=75U555U5514]75UU%4U-31UM'7UM?7U-?4U-7555555%145%=455555575
-MU=755=755%15U=74U-34U-34U-34U-75U=75U=55U=55U=55U=75U=75U590
-MU]365E77U];6T=?7U=35U5755555555555555%5555555=55U555U=75U-?5
-MU=75U-75U-35U-34U=75U=75U=75U=75U=555=55U=7545/5U-=65=37T=;1
-MU]'7UM34U=7555555%1455555%555555U=755=75U5545=75U-34U-34U-75
-MU=75U=75U=755=75U=55U=75U=75U=564-37UE95U-31UM'6UM?7U-35U=75
-M55555%155%14551555555555U=75U=37U]35U=35U=755=75U=74U-35U-75
-MU=75U=75U=75U=75U5%3U=374534U-;7UM?6U-?4U]345=5555545%545555
-M55555555U555U=555%55U=74U-34U]34U-35U=75U=75U=75U=75U=75U=75
-MU=7545/5U-=15-37T='0UM'7U]34U=35U5555%145%14555455555555U=74
-MU-74U]35U5755555U575U=74U-34U-75U=75U=74U=74U=74U-164]34UU%4
-MU-31U]'6T=?7U-35U=755=75555555545%15551555555575U515U-34U-34
-MU-35U-34U-34U-75U55555555555U=75U=75U590U-364534U-;6T=;1U];7
-MU-7555555555555555555%5555755555U555U=34U=75U-74U-35U=35U-74
-MU-74U-35U=75U=75U=75U=755E#4U-=15-34UM?1U]'7UM?7U-3555555%55
-M55555%155%1555555575U=545=34U-?7U-34U-35U=755=75U=75U=35U=75
-MU=75U=74U=564-37UE94U-31UM'7UM37U-35U%5555545%145%555%555575
-MU=75U=75U=74U]75U=75U-74U=74U=75U=75U=75U=75U=35U=75U=75U5%3
-MU=374534U-'6T=?6U-?4U-7555555%145%145%145%55U575U-75U=355%75
-MU=75U=35U=34U-35U-35U=75U-75U=75U=75U=75U=755E/4U-965=37T=;1
-MUM;7U]74U=75555555545%=45%145%155575U=75U=75U-?5U=75U=34U=75
-MU-?5U-15U]=5U=55U-?4U=355=555%534-54UM57U]'4UM#4U]37U577UE+4
-MU432V5?%4U]40-!5U]I4U%-0U=77UE;3UU/64-'24M'45]W55]'1UU574%'5
-MUM34TU14UU!75E'7UM%5U=!77E=4T=+3W];65%]15U70T=S15%105U16UE!6
-MT]7655Q55%?1U-957UU7V<?;TE]#6=39S=A564-15MS:5]944-95U-=65E%4
-MT=#3UU)45U97U];1UM34U=;0T-564577T-;75%%04577U]?555=75U35U-34
-M55175%555]375=?6T]/755155=75U]15U-37U]545%145=74U=174]75U5%4
-MU-?6U-?4UM#0UM?5U5545=545%975555U=545%75U=755575U=36UM75U555
-M5=7455555=74U]?4U-75U]74U-74U-75U57555%0U=774%15U=;7UM;6U];4
-MU-355=35U=5555175%54557555145=755=355U75U=34U=34U-35U-75U-34
-MU]35U=75U=7555755=75U=555E/5U-=15-37T]'3T=;7U-74U=75U5545%54
-M5555U=755%=45%555%55U575U-?555555=75U=74U-74U-?7U=755=755=55
-MU=75U-34U5514]37UE%4U-?1UM#7UM?7U]?5U=7555555%14555555555%55
-M5=75U=75U515U=74U-37U]34U=755=75U=35U=35U=75U=75U=75U=74U%90
-MU=374577U]'1T-;1UM?4U-755=75U5545%545=55555555555%555=55U=34
-MU=555=75U-35U=75U-74U=74U=35U=74U=74U=75U=755E/5U-=15-34T='1
-MUM'7UM37U=75U555555555145U=45%555=7555555=545-75U-37U]34U-34
-MU-74U=75U-355575U=555=75U=35U=114-34UE%5U]31U]'7T=;4U-15U-55
-MU55555=75555U51555555=75U=35U=74U]355=555=755575U=34U-34U-75
-MU-75U=75U=75U=55U5%3U-375E34U]'6T=?1U]?4U]34U555U5555%145%15
-M55555555U=75U=755535U=37U-34U-35U-35U-75U=55U=75U=75U=75U=34
-MU-755E#4U-=15-37T=;1UM;7U]34U=555555555455155555555455555=75
-MU=75U-;7U-545=36U%35U];65U345U355=35T-?4UE-4U5#0T=154]35U5!7
-MU]71UM37UM745%545=37UM9555=75U35U=34U%575U975577U]355575U=?7
-MUM;7U]34U%555574U=555-75U=35U=74U575U%=1U-774577UM/1T-;7U=55
-MU5755575U5555U145%555=555=55U=75U-35U=74U-75U=75U-74U=74U-74
-MU=74U=75U=34U-?4U=55555545/4U-=15-37T=;1UM;4UM34U=35U5545%14
-M5%15555555555=55U=75U=755%75U=34U-37U-?4U-34U=755=7555555=55
-M5=55U=75U5514M74UU95U-?1UM#6UM?7U=75U-7555545%15555555555555
-MU=75U=74U575U-75U=755=75U=75U=75U=75U=34U-74U=34U=35U=7555!3
-M5=774%?5U]#0T=?6U-?7U]745=7555155554U554U5155555U=75U=3455=5
-MU=34U=34U-34U-74U575U=75U=75U575U=555=75U=5545/5U-915=37T-;0
-MUM'4U]74U554U555555555145%1455555575U555U=74U]?55-?6U=;75=17
-M5];4UM94T=14UU!4U%'7U%?3U%31U==17=57U%=5UM31T-76T]70U=745M75
-M5M945]=75=17U%17U595UU37U%7555545-37U-37U]?4U=34U-34U]545%35
-MU575UM1555155=75U%=3U=?65E35U-?7UM31U];7U-755=555%15U5145514
-M5%35U=75U5555-74U=37U]155=75U=77U]34U-75U=75U=75U=345575U-35
-MU]?55E/5U-105-74UM?1UM'7UM?7U-35U5555%175%555%555555U=75U=75
-MU=355=75U=35U-34U-34U-35U-75U5555=55U5755575U=75U5514M74UE95
-MU-31UM'7T=?7U-35U575555555555%545%145=75U=35U=74U=75U-35U575
-M5575U=74U-34U-35U=75U575U=75U=75U=7555%0U=374574U]'6T-?1U-?4
-MU=755=555555555555555%55555555555=75U515U=74U-34U-34U=34U-35
-MU-75U=75U55555155=75U=755E/4U-965-?4T=;1UM'7UM34U=5555155%14
-M555555555=5555555555U=75U=?7U-35U-75U-35U=35U-75U=35U=75U=75
-MU=75557555514E74UU%4U-?1UM'6T=?6U]?4U=7555155%15555555555554
-M5575U=75U=545-75U=34U-?4U-34U-34U=75U=75U=75U=75U=75U=7555%2
-MU=774537U]'6T-;1U]?4U-755=5555555%545%145%555575U=75U=75U=74
-MU]35U=35U-75U=75U=75U=75U=74U-74U=34U=75U55545/5U]965=34UM;1
-MU];4U]34U=75U5555554555555555555U575U=75U=755%35U=34U]?7U-34
-MU=75U=75U=75U=75U=555=75U=35U=514]34UE95U]?1UM'6T=?7U-?4U-75
-M555555145%145%155555U=75U=74U575U-?4U=75U=75U=55U=75U=75U=34
-MU-74U=34U-35U=75U5%3U=?65E74U]'6T=?7U-?5U-75U555U55555555555
-M555555755=75U=75U5545=75U-34U]?7U]34U=75U=75U=755=555=75U=75
-MU=7545/4U]975=?4T=;1U];4U]34U=75U555555555155555555555555=75
-MU=35U=37U-75U=75U=75U=75U=74U=34U-75U=34U-35U=35U5504E74UU%4
-MU-31UM'6T=?7U=34U=75555555555%54555555555575U=75U=155=75U=35
-MU-34U-34U-35U-75U=75U=75U=75U=75U=75U5%3U=365U77U]'6T=;6U-?4
-MU=75555555555%555%555555U=75U=75U=34U=74U]355=755=75U=75U=75
-MU=75U=75U=74U-34U-35U=7545+5U-965=37T=?1U]?7U]745=75U5555554
-M5%14551455155=75U-34U-34U575U=74U-34U-34U-34U=75U=7555555=55
-MU=75U=55U5104E74UU95U]?1UM#1UM?4U=35U5555555555555145%155575
-MU=75U=35U-55U-35U=75U=75U=75U-75U=75U=75U=34U-34U-34U=7555%2
-MU=375E74U]'6T=?6U-?5U-75U=55U5555554555455555575U=75U=74U554
-M5=75U-34U-34U-34U-75U=75U=75U=75U=75U575U=5545+5U-975=?7T=;1
-MUM;4U]74U=75U5555%1455145555555555555555U=75U=37U-75U=75U=75
-MU=34U=34U-35U-75U=75U=74U=5555504E75UE95U-31UM'6T=?7U-34U-75
-M555555155555555555555555U555U=555%75U=34U-37U-34U=74U-75U=75
-MU=55U=75U=75U=75U593U=?65E74U]'6T=?6U-?4U-755555551555145555
-M5555U=75U=75U=75U575U]35U=75U=75U=75U=75U-34U=75U=75U=74U-35
-MU=355E/5U-965=?7T=;1UM;7U]74U=5555545%145%1455155%555575U=75
-MU=35U555U-34U-34U-34U-74U=35U=75U=75U=75U=75U=75U5514E74UE95
-MU-?1UM'6T=?6U-35U555555555155%5455145%155=75U=75U=75U=?4U=75
-MU=75U=75U=75U=34U=75U=34U-75U-34U=75U%93U-?15U77U]#1T-;6U]?4
-MU-35U55555555%145%155%145%555575U=75U5545=74U-34U]?4U]34U]34
-MU-34U=75U=75U575U575U57545+5U-965=37T=;1U];4U]34U55555545%55
-M55555555U55555755=74U=35U=77U]75U=75U=74U=74U=74U=75U=75U=75
-MU-34U-34U=564]77UE95U-?1UM'7UM37U-35U=755=555%55555555555575
-M55555=55U5755574U-?7U]34U-34U=75U=75U=75U=7555555%155=75U5%3
-MU=365E77U]#6T=;6U]?4U-55555555145%1455555555U5755=755=755575
-MU-34U-74U=34U-35U-35U-75U=75U=35U=74U-75U=755E/5U-965=37T=;1
-MUM;7U-34U555U555551455145%145%545555U=75U=74U%75U-74U-34U=34
-MU=35U-74U=75U=75U=74U=74U=74U-564]37UE95U-?1UM'7UM;7U-35U555
-M5%145%155%55551555555=75U=34U-35U=?7U-35U-75U=75U=75U-74U=75
-MU=75U=74U-35U=74U593U=?15U77U]'7T=?6U-35U-755555555555545%54
-M555555555=75U=75U=555=75U-34U]?7U]?7U]34U=755=55U575U=55U555
-MU57545+5U-965=?7T-;0UM;4U]755555551555555=5555155555U=75U=75
-MU-755574U]75U=75U=75U=74U-74U=75U=75U=74U-34U-35U=564]74UU95
-MU-36UM'7T=?7U-35U575U=5455155%145%155%555=55U=75U=755574U-34
-MU=34U-34U-34U=35U=75U=55U575U575U=755514U=745=75U=35U=34U-34
-MU-75U=75U=74U-75U5755=55U=75U=75U=755555U=35U=755=5555555575
-MU=75U-75U-34U-34U-35U=755%15U-15U=74U-34U-75U=755555U=555=75
-MU5755=75U=75U=74U=35U-75U5545575U=75U=55U=75U=75U-74U=75U575
-MU=74U-74U-555-74U%75U=34U-34U-34U-7555555555U=75U=55U=75U=75
-MU=555=75U=75U=37U=555555U5555=75U-74U-34U-74U=74U=74U=75U554
-MU=355575U=34U-34U-34U-35U=5555555=75U555U=75U=75U=55U5555554
-M5-75U=34U-34U=35U-34U-74U=55U=55U555555555755%35U-15U=75U-74
-MU-34U-35U-75U=7555555=555555U=75U=55U=75U5555574U]35U=555=55
-M5575U=75U=75U575U=755=75555555545-75U%75U-74U=35U=34U=75U-34
-MU-35U=35U=75U=75U5555575U=7555755515U=74U=75U-74U=75U=75U=75
-MU=75U=35U=75U=75U555U=745=74U-35U-74U=75U=55U5555575U=75U=75
-MU=75U=75U=74U=35U555U=34U=75U-35U-75U=75U=75U=75U=74U-74U-35
-MU=755535U=15U=75U-34U=75U=74U=34U=34U=75U=755575U575U=75U=34
-MU55555175555U=75U-35U-34U-35U-75U=75U=74U=75U=75U=555-74U%75
-MU-34U]35U=75U=55U5555555U=75U5555555U=75U=34U-75U=75U=37U]75
-MU=75U=755=75U=75U=75U=74U-34U-34U=5555175=745=74U-34U-34U=75
-MU=555=555575U555U575U=75U=74U-34U-34U5555%35U=37U-?4U]?4U-35
-MU=5555145%155575U=74U-34U574U-15U=74U]37U-35U5555575U=75U=75
-MU-75U55555145575U=75U-75U=74U]?5U-755=55U=75U=75U-34U-34U-15
-MU=75U=75U=355=35U%15U=74U=34U]34U-34U-75U=75U575U=75U=74U=34
-MU=555%145%145%=4U=34U]34U]35U-55U575U=74U=35U=55U555U=75U%55
-MU-375=75U=35U-74U-?4U-35U=75555555555575U=75U=75U=35U-35U=35
-MU=34U=75U=75U=75U=75U=75U=74U=75U=75U-34U5755534U-35U=35U-34
-MU=75U=75U=35U-75U=75U5755=5555555=55U=74U=75U5545=55U-34U-35
-MU-35U=75U555U=75U=75U=74U-35U=545]75U%75U-34U-34U-35U=75U575
-MU=75U=5555555575U=75U=74U-75U575U=74U-555575U=75U575U=75U-34
-MU-35U=74U=74U=75U5545=745=74U-?4U]34U-75U=755=55U=75U5555=75
-MU=75U=75U555U=5555555%35U=34U=74U-74U-75U-75U=75U=75U=755=75
-MU=355%35U=15U=74U-74U-34U-35U=75U5555=75U=75U=75U=75U=55U575
-M5575U=75U-?5U=75U=75U-35U-74U=75U=75U=75U=34U=75U=545-75U%75
-MU=74U=34U-75U=75U=75U=75U=75U=75U-75U=75U=755=55551555=5U=74
-MU-34U-35U=35U=75U=75U=35U=75U=755555U514U-345=74U-34U=34U=75
-MU=75U=5555555575U=75U=75U-75U=75U=75U=35U-?7U-75U=755=755=75
-MU=35U=75U=75U555U=74U-755574U-=55=75U-74U=35U-34U=75U5555555
-M5575U575U=75U5555-74U=55U=555=74U-75U-35U=35U=34U-75U=755575
-MU=755575U=555=75U%75U-74U-?4U]34U=75U=75555555555555U575U=75
-MU=75U=75U=75U=74U]5555555=75U=75U=35U-75U-35U=75U=74U-75U555
-MU=755%55U=75U-35U-35U-34U-74U-74U=75U=75U=75U=75U=75U=755=75
-M5535U=75U=75U=75U=75U=74U-34U=755575U=75U=755575U=155=75U=74
-MU-35U]34U-75U-74U574U=74U=34U=35U=75U=75U=55U575U=?5U=755555
-M5555U5555=75U-75U=34U-34U-74U=555-75U515U=74U=75U-75U=75U=75
-MU5555=555575U=75U=555=755=75U=75U%55U=75U-75U-74U=74U=75U=75
-MU=75U-55U555U575U5545=745-74U-37U]?7U-35U=75U=75U=555555U555
-M5575U=74U=74U-35U=755=77U=75U=34U-75U=75U575U=75U=35U-75U=75
-MU=755574U-?5U=34U-34U=75U=75U=75U=75U=55U5555575U=75U575U=74
-MU-75U=155-75U=34U-34U-74U=75U=5555555=55U=555=55U=555-75U515
-MU=74U-37U-75U=75U=75U=75U=75U=55U=75U=75U=75U=75U=75U574U]75
-M55555%555=75U=74U=35U=75U=75U=74U-75U=54U=345575U=34U-34U=75
-MU-75U575U55555555555U=75U=75U=75U=755=755535U=34U-34U-74U=75
-MU=555555U=75U=75U575U=74U574U-155=74U=34U-35U=34U-75U=75U=75
-M55755=75U=75U=75U=75U=75U=55U=35U55555555555U=75U-74U-35U-75
-MU=75U-34U=355=74U515U=74U=34U-35U=75U=75U-75U=555575U=75U=55
-M55555=75U=75U=545=75U-35U-35U-35U=74U=74U=755=5555555=55U555
-MU-345575U=35U-34U=34U-75U=75U=75U=75U=74U=75U=55U55555555=55
-M5=77U-75U555557555755=75U=75U=75U=75U=35U=755574U-55U=75U-74
-MU=35U=75U=75U-75U-35U=75U57555555=75U=75U55555555U75U=35U-35
-MU-74U=35U=35U=74U=74U-75U-75U%555=74U%74U-?4U-34U=755=75U=55
-M5=55U575U57555555575U=34U-35U=75U=75U]?5U=35U=75U555U=75U=75
-MU=35U=34U=74U=75U555U-345574U=34U-74U=35U=75U=75U=75U=75U=75
-MU=755=555575U=755=7555=45=74U-74U-75U=75U575U=75U=75U=55U575
-MU=755575U=545=74U-34U-?4U-75U=55U55555555=75U-34U-34U-34U=75
-MU=555575U=34U555551555555575U=75U=34U=34U-34U-74U=555=35U575
-MU=34U-34U-34U=35U=75U=755=7555555=55U57555555=755555U=545=75
-MU=75U-34U-35U=3555555=555=75U=75U574U555U=755%75U=35U-34U-35
-MU=75U=35U=75U=75U=75U=55U=55U555U-555555U574U%55555555755=75
-M5555U575U=74U-74U=34U=74U577U-15U=75U-34U-?4U-75U=75U=74U=75
-MU=75U=75U=75U=555575U5555=755%15U=74U-34U-35U-75U=755=75U=35
-MU=75U=75U=555=3555=5U=74U-36U-34U-75U5755=75U=7555555575U=75
-MU=35U=755=75U=55U-?555555=75U-74U-75U5555=75U=34U-34U-74U575
-MU-355%55U=74U-74U=35U=74U=74U-75U=75U=755=75U=75U=75U=755575
-M55145=75U=35U=35U=755=75U575U=74U-75U=5555555%75U555U=74U]34
-MU=34U-35U=75U=55U5755=75U555U=75U=55U575U-755=555=3755555555
-M5=755555U555U=34U]34U-34U-75U=555=55U514U=34U-34U%75U=75U=74
-MU-35U=55557555755=55U=55U=34U=75U=545=75U-?4U-34U-35U=75U=75
-MU555U=75U=75U=75U555U=755%75U=34U-35U-34U=75U=555555U575U=75
-MU=75U575U=75U=555555U=74U]355=55U=55U=74U-34U=75U=75U=75U=34
-MU=355=77U-545=75U=35U=35U-35U-75U575U=75U=75U555U5755575U-75
-MU555U=74U535U=74U-34U=74U=74U-34U=75U=755=75U=75U=555=35U515
-MU=74U-34U]75U=75U=755=75U575U=34U=75U575U555U=75U=75U=75U-35
-MU555555555555=75U=74U-74U-74U-34U-35U=55U-355=55U=55U=755=74
-MU=34U-34U-75U575U=75U=55U555U5555=755575U515U-34U-34U=75U-75
-MU=75U=34U=35U=75U=75U5555574U-54U555U-75U-34U-34U-34U-75U=75
-MU5555%555575U=74U-34U=75U=55U=36U]34U575U5755555U=75U=34U-74
-MU-34U-35U=555=34U%35U=75U=75U=35U-35U-35U=75U575U5555575U575
-MU%75U=755=55U=55U=35U-34U-74U=74U-74U-75U-55U575U5755515U575
-MU-345=55U=34U-37U-35U-55U=75U=75U=7555555=75U=75U=7555555575
-MU=75U]1555755575U575U=75U575U=74U=74U=75U=155=75U=545575U-34
-MU-35U-35U=75U=35U=355=55555555555=55U=75U535U=75U575U=74U-34
-MU-74U-74U=75U=755=55U=35U-55U-555=35U555U=74U=34U-34U-75U=55
-M5=555=555=55U=55U555U555U=75U=75U=75U-35U=755%755=55U=155555
-M5=75U=755=55U=755575U-755%155=75U-37U-?4U=74U=75U=5555555=75
-MU=75U=75U=75U-74U-75U-545=35U=35U=75U=75U-75U=75U=75U=555554
-M5=355574U%545575U-74U-34U-34U-?4U-34U=55557555555575U=74U=75
-MU=75U=355=77U-55U555U575U-75U575U-77U=745575U=555=155-35U515
-MU-75U]34U-75U=75U=75U=74U=75U=55U=35U555U=55U=75U=55U=145=75
-MU-75U-34U-35U%75U-74U=74U=74U=75U=35U=55U=545%35U=34U-34U=34
-MU=155575U=55U=55U=355=755=75U=75U=?5U=35U=55U]?5U575U=74U=74
-M5=345=75U=75U-75U-74U-34U574U-545%75U-75U-75U=74U=74U-35U=35
-MU=75U=75U=75U575U=75U=355=745554U=35U-74U]35U-75U=75U=755=74
-MU=755555U=155=35U575U=74U]34U-35U=75U=75U=55U-75U=7555555555
-MU=55U=75U=75U=75U=34U55555555=75U=55U=75U=75U]34U-75U-34U575
-MU-555%75U-35U-34U-75U=34U=75U555U515U=55U5555=755=75U-74U574
-M5=555=55U-75U-35U-55U5755=755=555=555=15U=55U535U-575575U=77
-MU-74U-35U=755=745575U=55U=75U=555=555=75U=7555555=37U]?5U555
-MU515U=755=74U575U-75U=35U=15U=55U=34U%75U-74U=34U-35U-35U=75
-M5575U5155=75U=35U-5555155574U=77U-?45=75U=75U=75U=34U-37U-74
-MU=75U=5555555575U555U-345-755=74U=75U-35U=745=74U-745=75U=75
-MU=75U=74U=755=755=755575U]?5U=5555555575U-55U=755-775-76U=74
-M5=155=34U==55%755=77U=75U-355=75U=74U-34U=75U555U=74U5755=74
-MU-35U=75U5545=75U-355=?5U=35U-75U575U=75U=34U=755=555=75U535
-MU-34U-34U=75U=355=75U555U-35U-75U=55U555U555U=35U-55U-75U-37
-MU5555555U555U=75U-75U-35U=755555U=755=555=75U=55U-34U]74U575
-MU=75U-75U5555=555=155=55U=55U-55U-155=?6U=54U==5U-15U=75UM?4
-MU537U5755=545-=7U-94U-55U=555=145%74U-35U=?4U-745=555=74U-74
-MU=34U-545517U575U%74U]37U=34U=74U%555%75U=35U=555=34U=15U-35
-MU]75U%75U%755=755535U-76U-34U=355575U555U515U577U=745-745=74
-M5%755=35U=355=755%34U-35U=35U-74U=74U=75U-74U-35U=75U555U514
-MU=755=75U=35U-34U-35U-75U=75U55555555575U=75U=55U=75U5755%15
-M5=75U-?4U=35U=7555555575U5555575U575U575U=755%75U=545=75U-75
-MU-75U-35U-34U-35U=755=55U575U=75U=75U=755=755%1555=45575U=75
-MU-34U-34U=34U=34U-3555755575U=755=75U5755=755=75U=75U=755=75
-M5=75U=555=55U=355=35U=35U-34U%55U=75U=37U-35U=5555555=55U575
-MU575U=74U=34U=15U554U=74U=75U=?4U-355=155=75U=74U-755555U555
-M5575U=555=75U-75U555U=555%75U-74U-34U=75557555755=75U=75U=75
-MU-35U=75U=15U=34U-75U=35U575U57555755=75U=75U=34U=55U=75U=75
-MU=55U=75U=74UM35U=555=75U=75U-75U=75U=74U-35U=75U=555=74U-75
-MU=34U-?4U=155=155-555=75U=75U=55U=55U=75U=75U57555555575U515
-M5=34U-?4U-?4U=555=755=35U=75U=55U=7555755-765-77U=74U577U534
-MU%34U%75U%74U57555555575U=55U=75U=355=555=55U-?5U-75U555U=55
-MU=75U=75U=35U=75U=74U=355555U=15U=34U-?4U=35U=74U=74U=745575
-MU5545=55U=75U=75U=74U-555%75U=55U-35U=75U=35U-35U-75U-55U-74
-MU-75U5555%555-75U575U575U=35U-75U=35U=75U=7555755555U=35U=75
-MU575U=75U5545555U=74U]55U=55U5555=75U=75U=75U=35U=75U-75U%55
-MU=345=74U=75U-75U=75U-74U-75U-75U=555=555=75U=75U555U=555515
-M5=555=74U-?7U]34U-34U-75U=75U=755=5555555=555515U=75U=74U-34
-MU=34U=75U=74U=75U=55U5555=75U=75U=75U=74U=555%15U=75U]34U575
-M55755575U=74U-35U-35U-55U=55U=555=75U-75U-34U=35U=75U=74U=34
-MU=75U=555555U=555575U=75U=34U%545=75U535U-37U-34U=35U=75U=74
-MU=75U575U=555555U555U-74U=74U-34U-34U-35U=75U=74U=75U=74U=75
-M5=75U=755555U-355575U=75U=345=755=75U=75U=75U=55U=75U=75U=35
-MU=345%75U=155=75U=34U-35U-75U=75U=755555U555U=75U=75U=55U=74
-MU-555U15U=555=75U-35U-34U-35U=74U=74U=75U=75U=75U=555=75U-74
-MU-37U]?4U-35U=75U=555555555555355555U=75U=75U=?7U=545=75U=77
-MU]74U=75U575U=755=75U=75U=75U=75U=35U5555=74U=75U-34U-355575
-MU-755=75U-75U555U=555=555=755=75U-?45%355=555=74U-?7U-34U=75
-MU=75U=75U55455555=75U=755535U=555=74U]?7U-34U]34U-75U555U=75
-MU%75555555555=75U=34U]755%15U=75U]?4U=35U=75U=75U=75U=35U-75
-MU=75U=75U-555-74U-75U=75U=34U-74U-75U575U=75U=75U575U575U=55
-M5=75U=37U5175%75U555U-34U-37U-34U-755=555=35U=75U575U555U554
-MU5755=75U=75U=75U=74U=75U=755555U5755=75U=75U=75U=75U-?45U=5
-M5=755=?4U=55U555U=75U=75U-75U=35U=75U=75U-355574U-155=74U-77
-MU-35U=35U=75U=34U=75U=75U=75U=755=555=74U]545U555=155=35U=35
-MU-35U-75U-34U-74U=75U=75U=75U5555%75U575U-74U-34U-34U-74U555
-M555555755575U575U=75U=75U=?7U5575575U=74U-75U=75U=75U=75U=55
-MU=75U=75U=74U-75U=55U=74U574U=34U-34U=35U=75U=35U=74U=75U=75
-MU-75U=55U575U-355%145=555575U=34U-34U-74U-74U-35U=75U-74U-34
-MU=755535U=35U=34U]?7U-35U=5555555555U=555=75U=75U=75U=75U=74
-MU]545U15U=75U];4U-75U=755=75U=75U=35U=75U=75U=75U=555%75U%55
-MU=37U-34U-?55=75U=75U=5555555555U=75U=75U=74U-?7U5175%15U555
-MU-34U]?4U-35U=75U=75U=75U=75U575U=75U555U=755=74U=35U=75U=34
-MU-75U-74U=75U=7555155575U=75U=74U]?45%=455555=77U-75U=75U=75
-MU=75U-75U=35U=75U=75U=755575U-35U=34U]34U=75U=755575U=555=75
-M55555=75U=75U=55U=77U]575U15U=755-77U]355=37U-145-75U-75U=37
-MU-355%!6T]'4UE95T]75U5%4U]?5U5=5U]155515U-155%15U=555=74U-35
-M5=74U-;6U%145%755=77UM?4U=35U=555=74U=35U=34U-75U=75U-35U=55
-MU=74U=74U-55U=74U-75U-74U=74U=755-74U=555=34U=555=75U-145%17
-M5%55U-75U]34U]74U]75U-34U-75U=55U=755575U=555%?5U-155=37UM34
-MU=75U-75U=77U-755575U=755=75U=755%75U=34U-545U545=75U]?4U]?4
-MU%75U-355555U-55U=75U-55U-75U]55U=75UU75U-75U-74U%74U=74U=74
-MU-34U=75U=555515U575U575U-?7U5165%55U557U=74U-34U]34U-355555
-M5=555575U5555515U514U=74U=74U=75U-34U=35U-75U-75U=75U555U=75
-M5575U=75U=75U]?55%=45=75U=?7U-155=55U=155=75U%55U=75U=75U=75
-MU=755555U=35U=34U-75U-355=74U=755-74U5555=75U=555=75U=755=77
-MU]575U145=555=75U]35U-75U-35U-75U-75U=74U-75U=55U=555-75U-75
-MU-34U=35U-35U-34U=7555555%555=75U=55U-55U555U-?7U%175%55U=74
-MUM?4U-75U=75U515U=75U%54U=75U=55U=7555175=345575U-?5U=34U=15
-M5=55U-35U-75U-74U574U57555555=74U]?55%=75%75U575U-77U=34U=75
-MU-35U-55U-55U554U%55U575U535U-35U=75U-74U-34U-75U=74U-75U=74
-MU%54U575U515U-74U%77UM545E=55575U=34U=75U575U555U555U=55U=74
-MU-75U-74U-555575U]74U=76U-77U-775=755%755%755=755=755=155=15
-MU=54U=?7UU565%15U5565-35U-15U-?4U]15U-?5U-14U=55U=54U=75U554
-M5=74U=34U-35U-74U-74U-74U57455755=755%55U=555=15U-35U];455=6
-M5%555=34U]34U=35U=355=75U=75U=34U=355=75U-355515U-75U=74U]?4
-MU=55U-35U=75U-34U=75U575U575U5555=555-77U]545U1455755%77U-?7
-MU=74U-75U=55U=75U575U=75U=75U5555%74U-75U=34U-35U=75U-35U-75
-MU-55U=755555U=755=755=75U=3455175%55U=74UM;4U-745=74U=75U=35
-MU=34U=55U=75U=34U%54U=745575U=74U=34U-35U-35U=75U=75U=75U=75
-MU=755=75U=35U-?55%=45-75U514U=75U]34U-34U-74U575U57555755=75
-M5=755515U=555=75U-34U-35U-75U=55U5755555U=75U=75U5755=75U=74
-MU]545E145555U=34U-75U575U-75U%75U-74U%75U=74U574U=745=74U-74
-MU=74U=34U-75U=75U=755575U=74U=35U=35U=35U=35U-?7U5165%=55=55
-M5=75U-?4U-?4U-34U-75U=75U-75U575U55555145=745=74U-34U-34U=34
-MU-35U=75U=75U=75U=75U=55U=555=75U-?55%=55-75U=74U]75U=55U555
-M5575U=75U-74U-34U-35U=745575U=35U-35U-34U=35U=75U=755555U=75
-MU=5555555575U=75U=74U]545U55U=355574U=34U-34U-34U=75U=75U=55
-MU555555555555575U%75U=74U=35U=75U=35U=75U=75U=555=75U=755=75
-MU=75U-?7U5175%35U=75U-?4U=75U=75U-75U=35U-74U-35U=75U=75U=55
-MU=345=75U=35U=75U=75U=75U-34U=74U-75U=75U=75U=75U=75U-?55U=4
-M5%75U555U=74U-34U-75U-75U=35U=34U=75U=75U=755575U=15U=75U-34
-MU=35U-75U=75U=75U-555=755=555=75U=75U=77U]545E145=555=37U=75
-MU=55U=555=75U=75U=75U=75U=75U=555-75U575U-34U-34U-75U=75U=74
-MU=75U=75U=75U=55U=75U=75U=?7U5175%55U=555-75U-34U-34U-34U-34
-MU=75U-75U=74U-34U=75U=355575U=75U-34U-75U=34U=75U=755=555555
-M55755575U=75U-?55%=45-75U=74U]35U=55U=75U575U=75U=75U555U=75
-MU-34U574U-15U-34U-74U=75U=75U=75U=75U=75U=35U-34U=75U5555=77
-MU]545E145575U575U-34U-34U-34U-35U=75U575U=55U5555=555-75U575
-MU-34U=34U-34U=35U-75U55555555575U=75U=55U555U=?7U5175%155575
-MU=34U=75U=75U=75U=75U-75U=75U=75U=74U-55U-755575U=34U-34U-75
-MU=75U=75U=75U=75U=75U=35U=755=75U-?55%=45%75U554U=34U-35U-34
-MU-34U=74U=75U=55U55555555%35U=555=75U-34U=35U=75U=35U=75U=55
-M5555U555U=75U=75U=74U]545U145=75U=77U]75U=75U=34U=34U=75U=35
-MU=35U=75U=555=75U-75U-34U-35U-35U-35U-7555755=755=75U=555=75
-MU=75U=?7U%175555U=555-75U=34U-34U-34U-74U-75U=75U=75U=34U555
-MU=34U=75U=35U=75U=75U=75U-75U=55U575U=75U=755=75U=75U-?55%=4
-M5%74U=74U]34U=555=75U=75U=75U575U5755=75U=74U575U=55U=74U-34
-MU-35U-75U=75U=75U=75U575U=75U=75U=75U=74U]575U145=74U575U-37
-MU-34U-75U-75U=55U5555555U=7555555-75U5555=74U=35U-34U=75U=35
-MU=75U=55U5555=7555555=75U=34U5175575U=75U=?4U=755=75U=555=75
-MU=75U=75U=75U=75U-55U=345=75U=35U-34U-34U-75U=75U-74U-75U-34
-MU-75U=75U575U-?55%=45-75U=545=75U-35U-35U-35U-75U-75U-74U-75
-MU=755575U=35U=75U-35U-35U=75U555U=75U=75U=74U=75U=755575U=77
-MU]545U145=75U=77U-34U-75U=74U=74U=34U=75U=75U-75U=555%55U555
-MU=74U=35U=75U=75U=74U=34U=75U=75U=75U=75U=75U=?7U5175515U=75
-M5=74U-34U-34U=75U=75U=75U=75U=755=755555U=755=75U=35U-75U=75
-MU=74U=75U5555=755555U5555=75U=75U-355%=45%755=75U-?5U=75U=75
-MU=75U=75U=75U=75U=55U=755575U=55U=74U-34U-34U-34U=35U=75U=55
-MU=5555555=55U=75U=77U]545U55U=74U555U=74U-37U-34U=34U=75U=75
-MU=55U575U5555-75U515U=74U=35U-34U=35U=755575U=35U=7555555554
-M5575U=37U%145575U=75U=37U=75U=75U=75U=75U=75U-35U-74U=75U=55
-MU=755=75U=34U-34U=75U=75U=34U-35U-35U-75U575U575U=74U]?55%=4
-M5%75U=155=35U-35U=75U=75U=75U555U=75U=55U=755575U=555=75U-34
-MU-34U-35U=75U=75U=55U5555=55U=75U=75U=74U]545U145=75U=37U]75
-MU=35U=75U=75U=35U=75U=75U=75U=75U=75U-75U-34U-34U-75U=74U-75
-MU574U=75U=75U=75U-75U=75U=?7U5575555U=7555755=74U=34U-74U=75
-MU=75U-75U=35U=74U555U=34U=34U=35U-35U=35U=55U555U555U=75U=75
-M5555U=55U=75U-?455=45555U=75U]?4U-34U=75U=75U=75U=75U=55U=74
-MU=74U=75U=55U=74U]74U-35U=34U=75U=35U=35U=75U=35U-75U=35U-37
-MUM155%555575U514U=75U-35U-34U-74U=35U=555=75U=75U=555=75U515
-MU=75U=75U=34U=75U=75U=75U=75U=75U575557555555=34U5175%555=75
-MU=37U=75U555U555U=75U=75U=75U-75U=34U-55U=755-75U=35U=74U=55
-MU=75U-35U-74U-35U-75U=75U=75U=75U]?55%=45555U=545-75U-34U-34
-MU-35U=75U=55U=75U=75U5755535U=555=74U-34U-34U=75U=75U=75U=75
-MU575U=75U555U=75U=77U]155%55U=74U=74U]34U-755=755575U=35U=75
-MU=74U=35U-755=75U575U=75U=34U-34U-75U=7555555575U5755575U=55
-MU=75U=34U5=75U155=34U-74U]37U-34U-75U=75U=75U=75U57555555514
-M55755%75U=34U-34U=75U=75U=75U=75U5555=75U=75U=555575U-355%94
-M5575U-75U];4U=755=75U=75U=755=55555555555=75U535U=55U=34U-74
-MU=75U=75U=55U5555=555555U=75U=75U-75U=74U]575D!F9'!Q1EK4T-IC
-M)"`_,0T4^)B-L[.UBK>VNJ6]CXFTM)(6$H6RLUP^)C]FB)D/.SLW!`$*"Q&2
-MZ@PX.P6VN[4&/#;DM[:%4N:'AW0`&X"XNX0W.0F/N++D#@]ME_X1%)RTCQX\
-M/QVQNXH#/C!XCXSD$7V1Z!HT#I*\OY`P.C6!O['.#@UFE=,=:H6VB!T\/Q"S
-MNK4&/#9TC(+_%<69E`0V")*_OI$P.C6'O+;9#`-Y[WX:%(>QBAP_/A.PNK4&
-M/3=*@H;`;N:$E@8Q"YV^OI,P.C6'LK?=`@=/X&X&%H&SM1P_/A*PNK4',C1)
-M@85<8I6`D0`S-9V^N9,P.S6%L[37`1O?Y!$#$8.RM!P^/AVPN[4$,S5-AYQQ
-M9Y.-DP(R-)VYN9(Q.PJ:L(I1!Q+S^1\,$X*]MQP^.1RQNXH%,0M$FI1F>)B.
-MG0T]-)VYN9TQ.`N8L8E>!6KA\`4)'8R_MQPY.1RVN(L:-@Y2GN!I<(2+GP\\
-M-YVYN9PV.0B>MXQ`'F7KRP8*'(^^MATY.1^VN8@8-PW5D\P72H"TF0X_-I*Y
-MN9PV/@F<M(-+$U*1Q@,U'HZYMATY.1^WOHD9-0#9EW421H*WFPD^-I*YN9PW
-M/PZ2BH9Q%_^<WPPW&(FYL1(Y.1ZWOX\?"P?"[F(>7(^VA0@Y,9.YN9\W/`^0
-MB85_;^F;UPXV!8BXL!,Y/AZTO(P=#AKWYQ<%5XBPA`LX,9"YN9\T/0V1C)]E
-M9)"$5@LQ!8N[L!,^/AZUO8(2#1S_]AP'T+6SAPHX,9&^N9\U,@*7@)%F=)B!
-M7C4P!(J[L!`^/AZ*LX`0`!?DTP4!W+2RA@H[,):^OI\U,`"4A^]B58>"7C0R
-M!XJZLQ$^/QZ(L(81!V+@308"V+>\@34[,)2_OIP+,0;JFO)I]8.,63<]!HJZ
-MLQ8_/!Z.MH06&W?O?@(,V[:_@34[,)6_OYT)-@3HG5!J^HR)6#8\`8JZLQ<\
-M/!^/MYH4'<&58`\.V+&^@#4Z,.J\O)T.-!KNEG@7XHF+63$_`(JZLQ0\/1R-
-MM9\5%.:7:0@+WK"^@S4Z,.F]O9,,"A_L[&D1Z[6U7C`_`XJZLVH],AV#B)!K
-M8Y20%#4UW;"Y@C4Z,.RRLI`""1#M_Q`2E[2T73`^`HJZLV@R,Q*!CY5H<9V=
-M$30TT+.XC0H[,.*SLY$`#!7BT1D<D+:W5C,Y#8NZLVDS,!.&@N)NW9J9$C<W
-MU;*XC0H[,."PL)8&`&/C<`09DK&VU3,X#8NZL&\P,1&$AO]L^8::'#$V4+*[
-MC`L[,.>QL94'!WW@8P$:G["QTC(X#(B[L&TQ-A>:FMQM[X*$&3`Q1;*[C`@X
-M,>6VM^@%&%'@%0T$F;*PV#(X#(FXL6,V-!6>G71BEX^'&S,P0+VZCP@X,?ZW
-MM.P8$_#@$PX'F[VSPS([#XFXL6$W-6F=E&9BG8B!!3(P3KVZCPDY-OVTBN$<
-M:N/@'@L!A;RRR#T[#XZYMF8T"&*0X6IBF+6#!3TS=KVZCPX^-_&*B?L3993C
-M!34`A;^]]ST[#XR^MV<*#V>7PA!MA+>-!#PR<KVZCP\_-_>(C?867)+B!S<"
-MA+^]\CT[#XV_MV4(`GSK2AYMAK:,!#\]>+VZCPP\-/6/@-IJ_9OM`38-A+Z\
-M_C([#X*\M&4/`4[M8`5M@[".!SX]9;*[CPT]-<B"A%]L[X?O`C$/A[F\Y3(X
-M#X.]M7H-!=?G%`9OC;.)!SX\9K*[CP(R"LB`F7=FD8#I#3,.A[F_Y#(X#X"X
-MKJ&YMX;G:P0,"C<R/#X^.3\\,S$U"0$8:4[AEIJ&@H^)BXJ*M8J+B(Z,@H&'
-MFI^1ZN'SW4)^86]J%!80$!,3$Q,0$187%&II;&-G>GQV2$!?U=_$P\[*]/?W
-M]_?W]/3UR,[-P,?:V=S3T=155U%04U)=7%Q?7U]?7%Q=4E-345%65U=45575
-MU-37UM;6UM;6UM;6UM;6UM;6UM?7U]355U34UM;7UM?7U-35U=75U=75U=75
-MU=75U=75U=74U=34U-34U-34U-74U-34U-34U-34U=34U-35U-34U-34U-35
-MU-34U-34U-34U-34U5565-76UM?7U]?4U-75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U-34U=35U=75U=75U=75U-75U-75U=75U=75U-34U=75
-MU=755594U=;6U]?4U-35U=75U=75U=75U=75U=75U=75U=74U=75U=75U=75
-MU=74U-75U=75U575U=55U=75U=75U5555=75U=75U=75U=75U=545E?5UM?7
-MU]34U=75U=755=75U5755=5555555575U=75U=75U=75U=75U=34U-35U-75
-MU=75U=75U=75U=755575U=75U=75U=75U=55U5165]76U]?7U-35U=75U=75
-MU=75U575555555555=75U=75U=755=75U=75U=75U=75U555U=75U=75U=75
-MU=75U575U=75U=755=755=555%%75=;7U]?4U-75U=75U=75U=75U5755=55
-MU=75U=75U=75U575U=75U=74U=35U=55U575U=75U=75U=75U=755=75U=75
-MU=75U=555=545E?5UM?7U]34U=35U=75U=55U555555555555=3ED.GF^<71
-M271^>65E9V1D97A_<G9*3$1>5]?2WMK&P\W.R<C(R\C)SL_"P\;'VMC>W-/6
-MU]555E914%-34U)24E)24U)34U!045%65E=75%555=75U-74U-37UM?4U535
-MU=35U-34U575U=74U=75U5555555555555555%145%155%15U=155=75U-74
-MU=75U=755=75U=74U-55U55555545555U=75U=37U]545E155=75U=75U-?7
-MU-75U=7555545555U=75U=75U=75U=555=75U575U-34U-34U]35U=555555
-M5=75U-34U-74U=7555555=55U=37U5575%755=75U=545=75U=75U=74U=75
-MU=75U575U=75U=75U554U=745=75U=34U-34U-34U-75U=75U555U5555555
-MU575U=75U=75U]?55%=55=75U-34U-36U]755555U5755=75U=75U=755=75
-M55755535U-35U=55U=75U-35U=755555U=75U=75U=7555555555U=75U=37
-MU]155%155=75U=755=34U-?4U-35U5555555U=74U-34U=755=555%75U575
-M5=75U=75U=755555U575U=75U=75U=75U=55U5555555U=36U%54U=555=55
-M5555U-34U=34U=755555U=75U=75U=75U=75U515U=745=74U=75U=755=75
-MU=74U=75U5555555U=75U=35U-555555U=555%?5U=34U-37U%35U-74U-34
-MU-34U-755=75U=34U=75U5555U945=55U=74U]34U-34U=75U=74U-34U=34
-MU5555%555575U-34U]37U]545E155=34U-35U-?4U=55U=75U=74U=555%15
-M5=75U-34U-355=75U515U=74U-?7U]?7U-75U555U=55U=34U-5555555515
-M5=74U=37U%145%15U=75U-15U=35U=55U=34U=34U]?4U-75U5545%55U555
-MU-3455555=55U=75U=34U-34U=75U=75U=75U=75U=7555555=75U]?55515
-M55555=75U=77U]34U=7555155-75U=34U-34U=5555555%35U=35U=34U]34
-MU=55U=74U=75U=75555555755=75U=75U5555%75U-545%55U=55U=555%15
-MU=74U]?7U]34U55555555=75U=75U=555=75U5755=74U=34U=34U=75U555
-MU5555=5555555575U=555575U=75551755155=74U-75U-?5U=555555U=75
-MU-75U-75U=75U=75U555U-745575U=75U=74U=75U=755=755=755=755=75
-MU555U555U555U-?4U5155=75U=75U555U=75U-34U-75U57555555575U=55
-M55555%=45=555=75U=74U-35U=755=755=75U55555155%555575U=755574
-MU]155U555=75U=75U=?4U555U55555555=7555555%555574U-755=75U555
-M5=75U=55U=75U=555=75U=75U=74U-55U555U=75U=75U=37U%545%155=55
-MU=555-75U=75U=74U=75U=34U=35U=555575U554U=755=74U-75U-34U-74
-MU-34U=75U555U=75U=755=75U=75U=75U]?555145555U=75U=74UM34U-75
-MU=555=755555U=75U=75U5555575U=15U=35U-34U-34U-74U-75U=75U=75
-MU=75U=5555555=555=74U]155%55U=5555755%35U-37U]34U-75U=34U=75
-MU=34U-7555555%55U575U=74U-34U-75U=35U=75U=35U=55555555555=75
-MU=75U-?7U%545=75U-34U]35U-34U=7555755=75U=75U=75U=555=75U=55
-MU-345575U-34U-34U-75U-75U-75U=75U=75U=34U=75U=74U=75U]?45514
-M5=75U=75U-55U-74U-35U-55U=35U575U=75U55555555515U=55U=75U-34
-MU-34U=34U=74U=75U5555575U5555=75U=75U=74U-545U55U555U=34U=37
-MU-74U=55U=75U=75U=75U=34U-34U=755=74U-75U=74U-75U=75U-35U=75
-MU=555=75U=7555555575U=75U=34U5175575U=75U=155%75U-34U=75U=34
-MU-75U=75U=75U575U554U=345=75U-?4U-74U=75U-75U-75U=75U555U=75
-MU=34U=35U=75U-355%=55575U=75U=75U]35U-75U=75U5755=555555U=75
-MU=755574U-155=75U-35U=74U=75U=75U=75U=74U=75U=75U-75U=75U=37
-MU]155%555=75U=74U555U=74U-34U-34U-34U-74U=74U=75U=555-75U555
-MU=74U-34U-75U=75U-75U=55U=75U575U=755=75U=75U=34U554U575U=74
-MU-35U-?4U=5555755555U=75U=75U=75U-35U555U-355575U=34U-34U=75
-MU=75U=75U=75U=75U=75U=75U-75U=75U-355%=45575U=74U%55U=34U]35
-MU-34U-34U=755=755=755=555%1555545=74U-34U-?4U-35U-75U=755=55
-M5-555=75U575U=74U=77U]545%55U574U-77U=76U=755=15U%75U535U574
-M5%745%75U==4U=17UU55U-75U-?5U-75UU75UU75U-755=74U=355=555=35
-M5=755=3455175515U575U-34U=77U=34U=75U-75UU75U575U%755=755514
-MU=755555U=34U-35U=35U-35U=75U=74U=75U575U=75U5555=75U-755515
-M5=75U=74U-34U]?5U=75U=55U575U=75U-34U=75U=755574U-35U=75U-34
-MU-75U%75U=55U555U555U575U=75U5755=755=74U-545U555=75U=75U515
-MU-74U=75U-75U=755=75U=75U575U5555575U53555755=74U-34U=34U=35
-MU575U=75U=55U5555=555555U=34U5545%75U=75U-35U-?7U=75U575U=74
-MU575U=35U=75U=755=75U-35=V!^<W5$7]?2Q`4C)S(T&F>5A8V+MKNGOH^!
-M@[>SM)Z5AKRDO/8R)#D-_U8$-0D4XFDP)B,Y;(NUE`8,$N'E!#8Q;K&DI8T%
-M-0'AAI!B%)RSI;+T,#DTYHJ*DF??AK6%`#X["(:\O809`A/D]@<Q-F^WNKR4
-M-3T*99+Z$AGIMKZT$#\[-.NTM9U@1X2)G0(^/@&)N+R%!0P<^?,%-S74L*6R
-M\38\-768Z143E+>]C@0Y.@J?MK>=;GJ?@ND//SP?M+N\G0`+&O7S&S4/XK.Z
-ML60S/PK#AY-F%):TLX$".#L/AK.VDA=NEH?]"3PS;[&ZO>@.-`3`^1P.`)"R
-MN[<3/#X(XX.;=6Z6M;&9"#LY`8^]L9$2$>.95`@]-M*SI;/.-38&S>$1`@68
-MO;B(!SX^#Y&.AM5BEXNTE34[/QZUO['J&QG(D'<),S7IO:6Q9#8Q`?/H;@82
-MA+V^@@PX/@.:M8/#8NN.B_$W.SUOMKFQY`8'295Y#C$/G[^EM!`P,`'AD7\:
-M%8:RO84*.S\$@+>,]6_@@HUT-C@PT;.XMM0-`V;M>@\W`8>^NX@$/3,&E9[=
-M'6&!LK.6-SH\'8ZQCLP4\8:&;#$^-^B]N[1G"`QHX7X"-1N"N;B"#3\R!)*$
-MY1=R@+"V\C$Z/6RULXG1$UB:FQ8Q/PJ9OKN*%C0(%.%U`0D6CKF^A`LY,AF%
-M@.IN2(&QM7XS.C#5MKV)2AEDDY,2-CT-@;B[CAHV-1;M500-88NYO)`W.#,1
-M@8^08$R'MXX7/3LV[K._CF$$%>N5'S8S!X^[N(,`,#06ZO`>!D2UOK/^,#LP
-M8(^+GV1TA;6`&3TX-9Z\OXP4`!+DXAXW-AV*NKF%#C(T%9'B%AKUM;^V>#(Z
-M,=6*M)MG>)Z.A0<\.0Z!OKZ#'P\:R><?-31BM[J_D30\-VR>EVT=Y+6]M1$\
-M.C?BM[::8V*1@Y,`/#\!C[B^AP<+!]7E$@L(4+:ZLOXQ/C1^A)]P%N*ULH\%
-M/CLUG;"QFFL4[X?N`CTR'K6ZOYX"-`!%YQ8/#>>PN[!^,CDTTH"$T&OLB[&!
-M`SDX#H>RL)L1'?*9^`TR,&ZVI;V4"#8"1>UI`P:4L[BW$3PY"N&/@/!OXHZW
-MF0\X.0&,O[.<'AI%D,<-,S=0LZ6R\S0P#52590<8G;.YBP0^.0F1BHWD;>>-
-MBI0+.#\9M;FSE@0&9^I3#3$*XKVEL7XQ,PW(DUP8$YBSOX(".#D-A;>)X6GD
-MI:*DLHF23QP`"34P,C\^.3\_,C`W"@T$$&3(Z)R$@(V.B(JUM;6*BXF/C8.&
-MA)F2E^_ESE)V9&)H%1<1$!,3$Q,3$!$6%Q5K;F)A9'ES=$)84=;>Q,+.RO3T
-M]_?W]_3URLG/PL'$V][=T];45U)24U%04E)=75Q<7%Q<75U34U!15E=75%55
-MU=74U]?6UM;6T='1UM;6UM;6UM;6U]?7U-34U=75U=74U-75U=55U555U=75
-MU=74U=34U-155U34T=;6UM?7U-?4U-74U=74U-34U=35U=75U=74U=34U-34
-MU-35U=75U-74U-34U-34U=74U-34U-34U-34U-75U-75U=34U-35U-74U556
-M5]76UM?6U]?4U-75U=755=75U=75U=755575U=75U=35U-74U=75U=75U-34
-MU-35U=75U=75U=75U=75U=5555555575U=75U=75U=755597U=;6U]?4U-35
-MU=75U575U=75U=755555U=75U=75U=75U=75U=75U=75U=75U=75U575U=75
-MU=75U=75U=555575U575U=75U=75U55445?5UM;6UM?7U-35U-75U=75U=75
-MU=5555555555U=75U57555555575U=75U=75U=55U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U5115U76UM?7U-35U575U555U=55U555555555555=75
-MU=75U=75U=75U=75U=35U=75U575U=55U=75U=75U=555575U=75U=75U=75
-MU=755%97U='6U]?4U]34U=75U=75U=555555555555555=75U=75U<B7E^'F
-MS]M!=7UY961D9&5E>'ES<4I)1D535M'=V\3#S<G)R,O+R,C.S\W#QL?$VM_<
-MTM#1U]155U%14U)27%U<7%U=4E)34U!045%65U145=75U-?7U-55U=74U-34
-MU-34U%75U-34U-75U=75U57555755555555555145=555U555=75U=75U=75
-MU=75U=74U=75U=755=755=55U5555=75U-355%145575U575U=75U=34U=55
-M55555=55U=75U5755575U=755535U=155=75U=34U=75U-75U=75U=555=55
-MU=75U=75U=75U=75U=74U-545U14U=75U=75U5545=75U=75U=75U=75U-35
-MU=75U=75U=555%555515U=74U=34U-35U=75U=75U-74U=755=7555755=55
-M5575U=34U5145575U=75U-35U=74U]7555555=7555755=755=755=75U554
-MU=355%75U=34U]?7U-3555145%145%75U=74U-34U-35U=75U=55U-355%14
-M5=75U=75U=755%75U=34U=74U=75U=75U=755555U5755575U=55U=75U=34
-MU-34U-74U-35U=75U555555555555=555=75U=74U-555%15U=75U-34U-34
-MU]?4U=755575U=55U575U=555555U5545-74U555U=74U=75U-75U=75U555
-M55555=75U=75U-75U=75U=75U=34U5145%755=75U=74U515U=74U-34U-74
-MU-74U=34U=34U=75U554U=755-75U=35U-34U=75U=75U=35U=75U=755555
-MU=75U=75U=75U-3555145=75U=75U=75U=?7U=75U555U555U555U5555=55
-MU=755575U-15U=74U-34U=35U=74U=75U=75U=75U=75U-74U-35U=75U=75
-MU-555%55U=75U-75U=155=34U-34U-34U-34U55555555555U=555-75U515
-MU=74U=34U-34U-75U=75U=55U5555555U=75U=75U=75U=34U5175%75U=35
-MU-34U=74U]75U=75U=75U575U=75U=74U=75U-55U=345%75U=35U-75U-75
-MU=75U=55U55555555575U=755=75U=75U-?455155=55U=75U=355535U=74
-MU-34U-74U=75U=75555555555%155=545555U=75U=75U-75U=75U=75U=35
-M5=75U=75U=75U=75U=74U-155%55U=75U=74U]35U-?4U555555555555575
-M5=555555U5555=75U555U=75U=75U=74U=75U575U=755=74U=75U=75U=75
-MU=55U=34U5175555U=75U=75U%55U=75U=74U-35U=75U=75555555555514
-M55555U55U=75U-74U=75U=75U=75U=755555U=555%5555555555U-355%=4
-M5=75U=75U=75U=37U=755=7555555=75U=75U-35U=755575U=545=75U-74
-MU=35U=75555555555555U=75U=75U=75U=75U=74U-555%555575U=75U=55
-M5=75U=35U=75U=35U=34U575557555555%75U514U=74U-35U-75U=34U-34
-MU-35U=755=55U=75U=555555U=37U5545555U=75U=75U=74U-35U=755=75
-MU=75U5555=75U=75U=55U=345=75U=75U=75U=75U-75U=75U=75U=75U=75
-MU=74U-34U=35U-?555155=75U-34U-34U575U-37U-34U-35U=755=75U575
-MU=755574U-145=75U-34U-35U=74U=75U=75U-755575U575U=755=75U=74
-MU]145%55U=75U575U575U=?4U575U555U=75U=75U=55U=75U=555-74U%55
-MU=74U-34U-74U-34U-34U=75U=74U=35U-75U=755=75U=?7U%545575U-74
-MU-35U-54U=74U=34U-34U-34U-35U-75U=75U=55U-355=74U-?4U-34U=35
-MU-74U-75U-75555555555575U=555=75U-355%155-75U=34U=35U=77U%75
-M5555U=75U=75U=75U=75U=35U574U-15U=74U-34U-34U=75U=75U=555=55
-MU575U=75U575U555U=74U-545%155=74U-34U-345=74U-?4U-35U=75U555
-MU555U=55U=545=75U515U=75U=34U-34U-75U-75U=75U=75U=75U5555555
-M5575U=34U5545574U-74U-34U-74U]?5U-555=7555755575U5555575U555
-MU-345=75U-34U-35U=75U=75U=75U=75U575U575U=75U=75U=75U-355515
-M5555U=75U=74U555U=74U-75U-34U-75U=75U=74U=755574U=555=74U-34
-MU-35U=75U=75U=75U=555=75U=755=75U=55U=74U]555555U-34U-75U-35
-MU-?4U=75557555755=75U=75U=55U=555=75U575U=74U-34U-35U-75U=75
-MU=75U=75U=75U=75U=55U=55U=34U5545%55U=75U=75U5545575U-34U-34
-MU=75U=75U=75U=35U=55U-755=75U=34U-34U=35U=75U=75U=75U=555555
-M5=75U=75U=55U-3555155=75U=555=755=74U-755=75U575U=75U=55U575
-MU=75U574U=555=74U-34U-34U-74U=7555555=555=555=55U555U555U=74
-MU]155%75U575U-75U=755575U=34U-34U-34U=75U=75U=75U=755=75U515
-M5555U=35U-34U-34U-35U=75U=74U5755555U=75U=75U=?4U5545=75U-34
-MU-34U-74U]?5U=75U=75U-75U=75U=75U=74U555U-345=75U=34U-35U=75
-MU=75U=755575U=75U=75U=75U575U=74U-3455155555U=555=75U554U=74
-MU-34U-34U-75U=34U-35U=75U575U-55U=34U]34U-34U-75U-74U=75U=75
-MU5555=55U=75U=75U575U-545U15U=75U=34U-34U-37U=75U=75U=75U=35
-MU=34U=35U=35U=34U%55U=74U-35U-75U=55U=75U=75U=74U=755=755=55
-M5=75U=74U5175555U=75U-34U-155=75U-34U-34U-34U-74U=5555755555
-MU=7555755=75U=75U=34U=35U=74U=75U=555555U=55U=75U=75U-355%=5
-M5=75U=75U=74U=37U]35U=75U=75U=75U=74U=35U=75U574U-15U=75U-74
-MU-34U-75U=755=755=75U=75U=75U=55U=55U=75U-545%555=75U=74U=74
-M5574U=74U-34U-34U-35U-75U=7555555-755515U=37U]?4U-34U=75U=75
-MU=75U575U555555555555575U=37U5145575U=34U-34U-75U-?5U=75U=75
-M5555U575U=75U57555145=755575U=35U-34U-35U-34U=34U=75U-34U-75
-MU-35U=75U=74U-355%=45%75U=75U574U%55U=74U-34U-35U-74U=35U=55
-M55555535U=545=75U-34U-34U-75U=75U=75U=75U=75U=75U575U575U574
-MU-545%55U=75U=35U-75U=74U555555555555=75U=75U=75U=555=75U%75
-MU-74U-35U-75U-34U-75U555555555555555U=75U=75U=37U5145%55U=75
-MU-35U-355=75U-34U-75U=75U=75U55555555514U=555%75U=34U-34U=75
-MU=555=55U575U=75U=755=75U=75U=55U-3555155555U=75U=34U-37U]35
-MU=555=55U=75U=55U=75U%75U575U=555=75U=75U=55U575U=74U-754WEA
-M<G-,1%#6W]8W(B0R"1/1F(:+B[:POK.*B[6YHZ:W]7^2FQ<S/@J8L8,!/SXT
-M#38Z)36$L8T&/#(!=A8)"?*RI;-E-PI\A)UN%(>YI+8=,S=AAIAE%)BROH`(
-M.#(4AH1W%I&VL)0Q)3)RCH_E:96UM-\S)3'HMK>6;.:/CV(R.S6$O;"0$7:%
-MA!(R.0V.N;.5!1/HD1DS/1NTN[/R#0%>XAXV,6&PI;%E-0EMYQ$U"_B]I;0<
-M,#07[&0"`)"\NXD#/#$4D/T;&9B]OH8*.3!CA))N%(6RLI0Q.C'<CX#68YBV
-MME\R.C:5M(CG8Y&*B1<\.@J$L[?O%/F#AAL\.0*.O['A&6>>D@<]/!^WN+';
-M`![A[`<S,'ZSNK9C"P-`Y1HW->.\NK4>-@AAX1$(`I^_NX\",C1BE'D!&X>_
-MOH0U/C=XF.8=%(&\O>@Q.#?-@YYA88:SMG8].C27BH/6986WBQ,_.PF'L8CS
-M;):)@0<^.0&.O+3V$_6&G0,_/!*WN;=:!V^0[`(],$ZSN[1N#QK^_``P->N_
-MNHL8-`)!_04T#9JYNX(",PA][18/&H"YN9LU/#5/DW4$%(V^O>,P.37QA^X6
-M9(V\L6<].`N6CIIZ<8"PBAX^.`^'MX)<>X6T@`$Y.0>.LHE4:I2,G`PY/!:W
-MOXIQ&=":X@X_,%2RN(MJ`Q25RP\R-):_NXX;"@7VV@,V#(>XN(`",0)1_`4+
-M!8V[OI\U,@[7ZA0#%(FXO?LP/PCYF%89?XB^L6T\.0Z6@Y1J7XZRBAH^.0*$
-MM85Y6X.V@`(X/@6/L8-W99J+G`@X/&JWO8]Z$>B!X0HY,,ZROH\5!$^=W0H\
-M-)._N((;#Q'M0@DP#(&XN8<"-`3W5P,T!8Z[OI,U,`/(^QL/%;6[O?4Q/0WD
-MD6D'=;2YL6H]/P*6A,\3PK6\B@0Y/@&$CI%L](FP@`P[/AF,MX5E4(.TG34[
-M/&VTLX%F8)F,Y#0X,/RSO(,4'>"%03<^-)^_OH$8`7F7934R#(.XOIH#"!/G
-M>`DV!8NZOY0*-@3\5@`+:+2ZLM8Q,P'FX1X`7[:[L18]/0&7G6$9^+:^B@8^
-M/P2:@/\4X+2R@`D[/!*-BY!C^XFVDC0Z/62TMIIC4H"(_#8[,.:PLH05;IV&
-M?S$Y-)B_O(4>&/^=;S8\#(*XOYP``F'N:#0P&K6ZO.P(-1/D9@DU;[:ELTPV
-M-AOFU`$-VK"ZMA`R,P64[A(%[;"YBP$^/1F8FWT0E+&\@0L[/1:#C>=NE;2P
-MD#<Z,G"*M9%BYXZUR3`Z,>VQL9]J0X:"83,X-9J\LI\=%Y:8%C`_#8RXO98&
-M!,:4$S8S&+2ZLN0.#V+A%S4W8[&EL'PW-!#F9@\.\+.ZMQTS,1SKQP<&E+*X
-MB`,_,Q*<EQ<=DK._A@HX,VN!AT)JG;&SEC8Z,$2(CN9BEK2TT#,Z-NBVM)1N
-MY(R,:#([-86]L9<0<X6%'#(^`H^YL^@%$^N1&#,R'K2[L_0-`5#B&38V9+"E
-ML68U"6+G$34+Y+VEM!\P-!3L9P(`D[R[C@,\-A20\!L>F[V^AS4Y,6.$DVD5
-MA;*RE3$[,=V/@5%CF+&W1S(Z-Y6TB>5BD;6)%CP["X2SM.(4^8.'&SPY`(Z_
-MMN<99YZ3!ST]'+>DKJ&XMH'@:00,"C<R/#X^.3\\,S$T"``::G?DE)B'@HR)
-MBXJUM8J*B(Z,@H"'FI^0E>/\V$9\9FQJ%!80$Q,3$Q,0$!$7%!5I;&-F97]Q
-M24=<5=+;P<S(]?3W]_;W]_3UR\[-P\;%V-_=T-16459745!375U<7%Q<7%Q<
-M75U24U!15E=45575U=34U]?6UM;1T='1T='6UM;6UM?7U]?7U]34U-75U=75
-MU=75U=75U=75U=75U=75U-345594U=;6U];7U]?7U]?4U-35U=75U=75U-35
-MU=75U=75U=75U-34U-34U-35U=74U-34U-34U-34U=75U=34U=34U=34U=75
-MU=75U=74U=555E?5UM;7U]34U-?4U-35U=75U=75U=75U=75U=75U=75U=74
-MU-34U-75U=75U=75U=35U=75U=75U=75U=75U=75U=55U575U575U=75U511
-M5E77U]37U-34U-75U=75U55555555=75U57555555=75U=74U=75U=75U=75
-MU=75U=75U=75U575U=75U=75U=75U5555=75U=75U=755%%75=;6U]?4U]34
-MU-34U=55U5555=75U575555555555555U=755555555555755=75U=75U=55
-MU=75U=75U=75U=75U=55U=75U=75U=544595U]?4U]37U-35U=7555555555
-MU57555755555U555U=75U=75U=75U=75U=75U=75U=75555555555=75U=55
-MU5555=555=75U=75U5115U76U]?7U-?4U-35U=75U5555575555555555555
-M5555U=75U^20Z>'YQ==)='YY9&5G965Z>7QR=DM"1UE1U=#>VL;#S,[)R,C(
-MR,G.S,+#P<?8V-[<W=#6U-545E%04U)24EU=75U24E)34%!145965U155=74
-MU-155-74U-?7U]?7U-34U-545=75U=75U5555=555555U5545%175U5555=4
-M5575U=34U-75U=75U5555=555=5555555%555555U575U=37U5545%75U=34
-MU=34U=755=74U%55555555555555U555U575U555U-355=75U=34U-75U=74
-MU=75U=75U=55U=75U=75U=555=555=75U-?55%=45575U=74U-34U-355%75
-MU=75U=75U=34U=75U=555=555575U=545=75U-34U=75U-75U=35U=75U=75
-MU=5555555575U=75U-34U]155U145=55U=75U=75U-74U]35U=755=755555
-MU555U555U=555=75U575U=74U-34U-34U=35U=555=555=75U-75U=75U=75
-MU574U-?7U%145555U=75U=755=75U555U=74U=34U-35U=35U=75U=755514
-MU5555U15U=34U-34U-34U-75U575U575U=75U=75U=555=75U=75U]?55%14
-M5575U=34U-74U-34U-?7U-75U575555555555=75U=755575U5545=75U-74
-MU=75U=75U=75U=755=75U=75U=75U=75U=75U=74U-545U145=75U=75U=74
-MU-55U=34U-34U-34U-34U-74U-35U=555=75U5145=75U=34U=74U-34U-34
-MU-35U-75U=75U=5555555555U=34U5545=75U-75U-75U-35U=77U-755555
-M5=755=55U=75U=75U=75U-355=75U-34U-74U=75U=74U=35U=75U=75U=75
-MU=74U-34U-74U-?555155=75U=35U-75U=755575U=34U-34U-34U-75U=75
-MU=555575U5545=74U-34U-35U-74U=55U=5555555=555=75U=75U=75U=74
-MU%555U155575U=75U=34U=75U-35U5555=75U575U=75U575U5555=35U535
-MU=34U=35U=74U=35U=755=5555555555U=75U=5555555=3455175%75U=75
-MU=75U=75U555U=75U-34U-34U=75U=555575U575U=755%75U=35U-75U-35
-MU-75U=5555555575555555555=755=75U]?55%155=75U=75U=75U=75U=34
-MU=7555555=755575U=75U=755=74U=545=75U-34U=75U=755=75U=755=55
-MU555U55555555575U=74U-545U155575U=75U-75U-555=75U-75U=75U=75
-M5=75555555145-7555145=75U=75U=74U=35U=35U5755555555555145555
-MU555U=35U5175%755=75U=75U=34U=77U]7555555%5555555=5555555555
-MU=755%75U=75U=75U=75U=75U=55555555555=75U=75U=75U=75U-355%=4
-M5%555=75U=35U=755575U-34U-34U-75555555555=755575U=545575U-34
-MU-35U-34U=74U=75U=75U=55U5555575U575U=37U]555U145=75U=75U=75
-MU=75U-?5U=75U=55U5555=75U=75U=555=75U535U-34U-34U-35U=755=75
-M5=755=755=55U=75U=75U=55U=34U5545%55U=75U=74U=34U-55U=34U-34
-MU-35U=75U555U=55U555U-555%555=75U=75U=74U=75U=75U=75U=755=75
-M5=75U=755=75U];455145=75U=34U-35U=75U=37U-75U-75U=74U-34U=34
-MU=75U=74U-55U=75U-75U=35U=75U=75U=75U=55U555U=755=75U=75U=77
-MU-555U75U=75U-34U=75U=755-75U=34U=34U-35U-35U=75U=55U=35U555
-MU=37U-34U-74U=75U=75U=75U=75U=55U555U5755=75U=37U-545575U=74
-MU-34U-34U=74U]155%55555555755=75U575U555U-755=75U=35U-74U=35
-MU=75U=74U=75U=55U=55U=75U=74U=34U]?455155=75U=74U=35U=755515
-MU=74U-34U-75U-75U=75U=755574U=545=74U-34U-34U-34U-35U=75U=75
-MU575U=75U=75U=75U-77U%545U15U=74U-34U-34U=35U-?4U=75U=75U=75
-MU=75U575U=55U=34U515U=74U=75U=74U=35U=75U=35U=75U=75U=34U-75
-MU=75U=37U5175%55U=75U=74U=74U-54U=75U-35U-34U=35U=35U=75U=55
-MU-755%75U=34U-34U-34U-34U=75U=7555555=75U57555555575U-3555=5
-M5=55U=75U=75U-34U-37U-75U=75U=75U=34U=75U=755=74U=155=34U-35
-MU=75U=75U=75U=75U=75U=75U=55U=75U=755=74U-545U55U=74U=34U=75
-MU=355=75U=34U-35U=755575U=75U5555=75U5145=75U=35U-34U=34U-74
-MU=35U-74U=75U=75U=555=55U=34U5145575U=34U-34U-74U-75U]35U=75
-MU=75U=75U=75U=75U=55U-355=74U-74U-75U=75U-75U=75U=75U=74U=75
-MU=74U=75U=34U-?455155=74U=75U=75U=75U535U-34U-74U-75U=75U=75
-MU=755575U5545%55U=74U-34U-34U-75U=75U=75U-75U575555555555=74
-MU]155%55U=75U=74U=75U-75U=?4U=75U=75U=55U=75U575U=75U575U=75
-MU-74U=75U=75U=75U=75U=75U=75U=75U=35U=75U=75U=?7U%545575U=74
-MU-34U-35U=545=75U-34U-35U-55U=75U=75U=75U=75U=755575U=75U=75
-MU=55U=75U=75U=55U=75U=555=755555U=55U=74U=34U=35U-75U=55U=74
-MU-75U=755575U=75U=75U=75U=75U=75U=75U=74U=75U=75U=75U=75U=75
-MU=75U-75U-34U-75U=74U575U=75U=7555555=55U=755%355=75U=74U-74
-MU=74U=74U=75U=75U=755=755=55U5555=55U=75U=75U57555555=75U=74
-MU-34U-35U=75U555U=75U5555575U575U]?4U=755=755=75U=75U=75U=75
-MU=75U=34U-35U=75U=75U=55U=75U575U=75U=74U=75U=75U=74U-75U=75
-MU=34U=35U-34U=75U554U=74U-74U=35U=75U=75U=75U=75U=755555U555
-MU=75U=75U=75U=75U575U=75U=75U555U555U574U575U=75U=75U=35U=35
-MU=75U=?7U=75U575U=555=55U=75U=75U=75U=75U-34U-75U=74U=75U=75
-MU=75U=75U=75U=74U-35U-35U=355=75U=74U-75U=75U=75U=155=75U-34
-MU-34U=75U=75U=75U=75U=55U5545575U=75U=75U575U=75U=74U=75U575
-M55755=75U=75U-75U=74U-34U=35U=35U=34U=74U]75U555U=55U=75U=75
-MU=75U=75U=75U=74U=5555555575U=75U=35U=75U=75U=34U=75U=75U=74
-MU575U=75U-75U=75U-75U=755575U=34U-74U-74U-75U-75U=75U=755=75
-MU=55U=75U=75U=75U555U=755575U=75U=75U=555=55U=3555555555U=75
-MU-74U-74U-75U-3555555575U=75U=74U=75U=75U=75U=34U-35U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=74U]75U-34U=74U-55U=74U=74U-55
-MU-74U-34U-34U-75U=555=755575U55555555575U=75U=75U=75U=755=75
-MU=35U=5555555555U=74U575U=74U=74U-74U-34U-75U=37U-5555555=75
-MU=75U=75U575U=75U=74U=35U-75U=75U=55U=74U=75U=75U=75U=75U=75
-MU-74U-35U=75U57555555%75U555U=555=75U=75U-35U-35U-74U=755=75
-M557555555555U=35U=75U=75U=75U=75U-34U-75U=7555755575U5555555
-M5=75U=75U=75U-75U=74U]355575U=75U5555=55U=75U=74U=75U=74U-75
-M5555U=55U=55U=75U555U=75U=75U=55=&!Y<W1$7M?3Q!HC)C(T!6;KA8VT
-MO;*UL+ZEMY^2B;NGM.F5B(<,)"0*EI$'-03C93TC(37AY04&E+2##SH\;X*%
-M2OZVNK`1,S7AC99H[;.DL!TP",V3%P)/L*6T!#`.048/-VRPNHL$-`3V:#<P
-M;[.[B!X-9903,S)ML[F/$1V7F!L\/&RPO($538"&!CD_:;>QG&R4M8(#.S]N
-MBHCE9X>PC@([/&V-A&1]B;R+`C@S9H3F'W6TN8H#/S9_D6H#3K&ZM0$R"%CR
-M!@MUL[J*!S8&]GH*-W"RNH@%"13L$3$P>;*XC!\$_)`:/3UEL[^!$&^;F@8^
-M/&>QLYAJYXZ!`C@_9[2TZ&&;MH(,.SQDB8-;<HRRC@PX,GB`D1=!M;Z(##DQ
-M<YYQ!%&QNXL"/#5'[1L,U+.ZB``P`L-`#S54O;J)!C4?YQ4W-ER]NXP%`TN5
-M&#(S1K*^@!\2D9P&/SU+L[V%%E6#A0(X/'>VMI9LD[6!#SL]=K6.]7Z`L((.
-M.S)WC)IB1(J\CPXX,4B$\![?MKF.#S\T6)<6`,FSNXX-,@_8SP`(]+VZCP`V
-M!/]B-33*O+N-!PYO[!PP,<*\N(`:!>&6!SPSV[*\A!)FA9X".3+1L+"3%>Z)
-MA`X[/52WM>=GA+:!"#LR4(B!<$.)LH(+.S!3@)41Q[>^C0@Y-U>?9P3RL+B,
-M#CP(V^8%#/J]NXP,,`'Q?`D*Y+R[@@,U$.80-C?EO[B`!P#5ZP0R,?F\OH09
-M%I*0`CXS\K*RG!'*@ID..#+WL;?N;9ZUA`L[,\BTC-1TC;"&-3LPP(R?:<2T
-MO(`U.#;$A-P9^;"Y@PL_-<V4$@#@O;N""3(-]]4"#NR\NX,,-QCZ%30U[[^[
-M@0`/9^(:,S;MO[F$!!OOE`,\,..\O9\<?823#CDSYK.QE164B9D*.S/EMHOQ
-M>8&VA34Z,/Z+AV73B[*'-#LV\(#M$/BVOX$U.37VG&\$[;*X@0H\#_#X!P+J
-MO+N!"3$'_F$+")2^NX8-"A3G'S$TE+ZYA0$!R.\!/3:5O[^>&A6<E`\^,>N]
-MLY80Y8*3"CLP[K"TY&.%M)XT.C#BM()-7HZPFC<[-N:/DVO^M[R$-S@T^H5`
-M&>^SOH<T/PG^ZQX!E+RXAPHS`/Y,#`^1OKB$#C<<Y1$W"I.YN(4"#''@!S,T
-MD+Z_G@<?E>X,/S:1O+*1'T2'E`HX,9>RMN-JDXB0-#LQE;:)W':#MIPW.C;I
-MBX5A]K6RF#8[-..`^A#LL+^:-SX+YY(4!9:]N84T/0+E]`$#DKZXF@HQ&N5I
-M"@Z<N;B8#PMOY!HQ-9^YOIP`!_[@`CTWG+Z]D05LGNX+.3:=O+#O$>V-E30[
-M-I"PM?1GA[21-CHVEK2`<]J(L)(Q.S3JC)<5XK:]G#8X"NR%?QZ6LKZ>-S\,
-MX>P;!IR_N9XT,P?D?P\-F;FYGPLT$>4<-PB;N+Z2#`);Y``R-9NYO)8&$I?A
-M"3\TF+^S[A_;ANPT.#>>LK?_:9^(ZS8[-YVVC$5$C+:4,3LTD8N98N2TLY$Q
-M.#65@?40E[.\DS$^#N^0$1J<O+Z2-ST!X-P#`9JYN9,U-A_D%S4,A+B^D0D)
-M9OH',`B$N+^4`@3F^@\\-82YLNX%9YCG-3DTA;RV^Q&5C>`V.S28LXO1>8&U
-M[#`[-)^TAGKSBK'H,#LUD(SI%96QO94P.0F4FV$?G+V_ES$]B*^FOK2$_A4$
-M#`LQ,S\_/C\\,C`W"@P''6#3[).%@8*/B8N*BHJ+B(F/C8.&A)B=E^[D]%1U
-M>F-N%1<6$!`3$Q,3$!$6%Q5K;FUA9'AR=$Q;4]?<Q<#/R_7T]_?W]_3URLC/
-MPL''VMG<T]'455=64%-275U<7%]?7U]<75U24U!15E=45%555=34U-?6UM;1
-MT='1UM;6UM;6UM;7U]?7U-35U-34U-74U-74U=75U=75U=74U=34U-34U-74
-MU-34U-34U-34U-34U-35U=34U-34U-35U=75U=75U-34U-34U-35U=75U=74
-MU-34U-74U=74U=74U-34U-34U=75U=75U=74U-34U-74U=75U=75U=34U-75
-MU=75U=75U=75U-75U=75U=75U=75U-35U-75U=75U=75U=74U=75U=75U=55
-MU=75U-75U=75U=75U=75U=75U=75U555U555U=75U=75U=5555755575U=75
-MU=75U=75U=75U=75U-74U=35U=75U=74U-74U=75U575U5755=75U=75U555
-M5555U=75U=75U=75U575U=75U=34U=34U=75U=75U=74U-75U=75U=75U=75
-MU=75U=75U5555=75U=75U=755=5555755=75U=75U=755=75U=75U=35U=75
-MU=75U=75U=75U=75U=55555555555=75U57555555=75U=75U=75U=75U=75
-MU=75U=75U=75555555755=75U=55U5555=75U=75U=75U=75U=75U=75U=75
-MU=75U5555555U=75U=75U=755=75U=75U=75U=75U=75U=75U=74U=75U=75
-MU=75U=75U-34U-35U=75U=75U=34U=75U=75U=7:ZY'@X?7;64AP>7MD9&=E
-M9'AX?7-T2T%%4U?1TMO$P,+/SLC(RLO(R<[,PL''Q=C>W]+0UM?555=14%!2
-M4E)=4E%27UU24U!04%%65E=75%555=35U=?6U]?4U-35U-35U=34U-75U=75
-MU555555555555%155%5555555555555555755=755=75U=75U=74UM175575
-MU=75U=75U575U575U=555%75U=75U=55U=75U=75U575U555555555555575
-MU=75U=75U=75U=75U=75U=75U=555575U5555=76U5155=75U=35U=75U=35
-MU=75U=75U-75U55555555%755=75U=755=75U=75U=74U=75U=755=755=75
-MU=74U=75U=75U=75U=55U=75U=?55U14U575U=75U=75U-75U=75U5155575
-MU=75U=75U=355=75U=75U575U=355=75U=75U=75U=75U=55U=75U=755=75
-MU575U575U=74UM57U5155=75U=74U-34U-75U-75U=?4U57555555=755=75
-M5=755=75U=55U=35U=74U-75U=75U=75U=75U=75U=75U5555=555=55U=36
-MU5=55%55U575U=74U-75U]34U=545=74U-34U-35U=34U=34U=5555555=75
-MU=555=755=555=75U=75U=75U=75U=75U=75U575U=75U-;55U145575U=75
-M5=35U-75U-35U=77U-75U=55U=75U=55U=75U=75U=75U=75U=34U-35U=75
-MU555U575U=75U=555=755=75U575U=75U-75U=34U=75U=755=75U=55U=75
-M5%75U=35U=75U=35U=75U=75U=555555U5555=75U=75U=755575U575U=75
-MU575U555U=75U=75U=36U5=55=75U=35U-35U=75U=74U-75U]?5U=55U=75
-MU=75U=74U-34U-34U=74U=75U55555555=75U=75U-75U=75U=74U=75U-35
-MU-34U-;45-55U=75U=35U=555555555555=4U=75U-74U-75U=55U575U=75
-MU=75U=55U5555555U575U=74U=75U=55U=75U=35U=35U=35U=74UM145535
-MU=75U-75U-74U=755555U=345555551555555575U=75U=74U=75U=35U-75
-MU=555575U=555555557555555555U=75U=355=77U5=55=75U=34U=75U=75
-MU=75U=545=75U-34U-35U=5555555555U5555555555555755=55U=755=75
-MU-35U=75U=75U=74U=75U=55U=?55U55U=75U=74U=75U=74U=35U=74U-75
-M55555=555=55U5555575U575U=74U=34U=75U=755=75U=75U=75U5555555
-M55555=75U=74UM5755755=75U=74U=75U=55U=755%75U=75U-75U=75U=75
-MU575U575U=755=555555U=75U=75U=75U=75U=34U=75U=755555U=555=77
-MU5=55=75U=75U=75U=75U=74U=75U-35U555555555555=75U555U5555555
-M5=75U=75U=75U=55U=75U=75U=75U=75U=75U=75U=55U=?55%545555U575
-MU=75U-74U=75U555U=74U-34U-35U=74U=75U=74U=75U=55U=55U=35U-75
-MU=755=75U575U=75U=75U=555=75U-75UM575535U=74U=75U=75U=35U-75
-MU=77U=75U=75U=75U=75U=74U=35U=75U=75U=75U-75U-75U=75U-34U-34
-MU-34U=75U=75U-34U=36U%355=75U=75U=75U=34U=75U=155=75U=34U-34
-MU-34U=75U=75U=555=75U=55U=75U=75U-34U-34U-34U-75U=55U=55U575
-MU=75U=?55U15U=74U=74U=75U-35U=75U=74U-35U=755=55U=55U=75U-75
-MU=75U-75U-74U=75U=75U=75U-75U=75U=75U=74U-75U-75U-74UM175575
-M5=75U=35U-34U-75U=34U575U-34U-34U-35U=55U=75U=75U-75U-74U-75
-MU=75U575U=75U=75U-75U=755575U=74U=755=7755=55-75U=75U=35U=75
-MU=75U=75U-15U=555575U555U=75U=75U575U=74U-34U-35U=75U=74U=74
-MU=34U=75U=75U=75U-35U=75U-;55U175=74U=74U-35U=74U-75U-545=75
-MU-35U-34U-75U=75U=75U575U=7555555555U=75U-75U-355=75U5555=75
-M5575U=75U=74UM5655155=75U-35U=35U=75U=75U=37U]35U=75U575U=74
-MU-75U-75U=75U=75U=75U=75U=75U=75U=75U-35U555U-75U=75U-75U=76
-MU5=55-75U=75U=75U=35U-75U=355=75U-?5U=74U=34U=74U=75U=34U=75
-MU-75U=35U=75U=55U=755=75U-35U=74U-75U-35U=75U=35U=75U=75U=75
-M5575U=755=75U575U-35U=75U=35U=75U=555=755555U=75U=74U=75U=75
-MU=75U-35U=34U-75U-34U=75U-75U=74U575U=75U=75U-15U-34U-75U-35
-M5535U-75U=34U555U-355575U5555=7555555=555=75U=755=75U=75U575
-MU-75U5555555U575U=75U5555=75U575U=34U=75U-75U=75U-34U-75U575
-MU=555=75U=34U=35U=755575U-34U=75U5555=75U=75U=75U=75U=75U=75
-MU=75U=34U=75U=755=75U=55U=75U555U=54555"9F5P=D=;U-#%:B<A/#$#
-M:^::@HNUMK:_IJ"]@Y&!B+6=8&F$L[R$-28F/6V:X@$V-P,;#CPE/7JVO(("
-M/C\`F8^'_OV!MK?C"S(.@;JDL74)#&6<EFT>Q8N\L4@R)3#ZL;*"%``=\_P8
-M-#1BM+NRVC,[-MZ)B9%B39N-E`T\,A6QI;WB-3,/VY[F%!2=M["9"SL^'K2Y
-ML.`##13F4P<(&H:_OH$(.S\:C;:/QQ98F9X7-S(-@+B[C0(\,!V9A.1H78&W
-MC1\\.PJ'OKF"!34->>U^!@;EM[ZT$C\Z-9RPL)L1'EZ0]``Q-?FRI;%I/3X(
-M[H^&R6SCC8[V-#DS5[*ZL7PT-@3GE6<;;X&SL.\V.CUDMK^U3P$%5NQN#C40
-MB;B_DC<[,VZ/M85[8I6`G00S/02+NKZ8"#(U89Z19!;CB[&!`#DX`X^YO9X&
-M"1OU_AT/!I*RN8D!.3D-A[&U[A!LE)E\"S,(G;^ZM1H],@&0@)!G99FUB6<P
-M.#:4O+N*$30+%^W+'@9UB+RQ2#(Z,>6QLH)N!&GIX!@T-&>WNK+V,#DWT(^,
-MZVS5A(^4#S\R%K:EO>,U,`W?D\,2%Y^VLY@+.SX9M;ZQX0$`;>-/``H%@;ZY
-M@`@X/!N#MX+6%,J$FQ$V/0V`N+N-`STQ$IR;P!30@K:/'#PX"H2^OH,:"@!T
-MXV(``.2VN;<0/SLUD[&VGA83]YS*`C`U_;*EL6\R/P[M@H57;>N.B/(T.3-:
-ML[JQ<C0T&N3L:P1N@+*SZ#8Z/6&WO(I)!Q_W[A4(-!*(N+^=-S@P:(V+F61D
-MDXV?!S(]!XBZOI@),PIGG>AI$.^ULX,`.3D"C;ZRGP<,'?_W&`D!DK*XB`8Y
-M.0V$MHOB%GN2FGDU,@N2O[JU&#(S!I&&ZVUXA;2+9#`X-NJ\N(L6-0YJXE,%
-M`'2*O[%$,CHQ_+:S@&\8>I?C!3<W8+:ZO?PQ/C17C8/@;,N!B)<./ST0M[JR
-MX@HQ`]J70AD1F;&RF@L[/QB*O[;F!@=^[W("-`2!OKF`"3@\&H"T@%QHYX:%
-M$#$\#(&XNXT`,C83DIU"$<6,L8X</#L*A;^_@!@)!UGF%0T#Y;&YMQ$_.S61
-MMK><%!3@F,H,,S3WLJ6Q8S,\#^.`GG5MEHB*^30X,TJSN[9W-349Y.00!FB"
-MO;*5-CH]8K2]B$X$$>;K%C4W'(B[OI\T.3!K@XZ29G.9CY@'/3P&B+N^FPXP
-M"&60Y!82Z+2R@@`Y.`*"O[.<!`(6Y\,%"@"2O;B+!SX^#9JWCN<409B$>#4]
-M-9"_NK4>,C,'EX7G:G^'MXI[,SLV[[VYBQ<+#&WC<08"<;6^L%8R.C'TM["&
-M;1Q%DNT$-C9LMJ6]Y3$^-%V#AOQO^8**D0X^/1*WNK+M"#<!P>MD!1.;L+V$
-M"SL_&XB\M^<$&ECK90PW!X&^N(,..3T:AHJ'36WH@X<0,#P.AKBXC0$S-Q&0
-MEF02S8ZSB!T\.S68O+R`'@\%V>00#@WZL;BV%SPX-9>WM),5;Y6%]`\R-\.R
-MI;!F,#T,YH:096V3M;3D-S@S?;"[MDD+"QWD]A\#%8*\LI8V.C)NM;*.3AMI
-MZ)43-#8>B+N^GC4^,6N`C9=@0X6(F@8]/P&)N[Z;##$.>9?.'!^5M[V-`3DX
-M#8.\LYT%`6GBW@8U`I*]NXH$/CX-F+6,_FK&A(9X-#PUEK^ZM1PS,`25F<X6
-M?8&QM7TS.S'CLKF(%0D#9.!D``Q\M;FSVS,[,<>TMH=B$/69[P8Q'ZBBI;./
-MDW4<``DT,#T^/SD\/S,P-`L`!!5E^NJ9A(.-B8B*BK6*BXB.C(*`AH6>D)7B
-M^<1;<V=M:!06$1`3$Q,3$!$1%Q05:6QC9F5_<$I!7U33V,;-R?7T]_?W]_?T
-M]<O)S,/!Q-C>TM#6U51645!24EU<7%]?7U]<75U24U!145975U15U=74U]?6
-MUM;6UM;6UM;6UM;6UM?7U]?4U-34U-34U-34U-35U=75U=75U=34U=75U-75
-MU=34U-34U-34U-34U=34U-34U-34U-34U=74U-75U-34U-34U-75U-75U=75
-MU-34U-74U=75U=34U-34U-74U=75U=75U=74U-34U-75U=75U=75U-34U-34
-MU-75U-34U-34U-34U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=35U-75U=75U=75U=75
-MU=75U=755=75U=75U=75U=555=75U=75U=35U=75U=75U=75U=75U=75U=55
-M5575U=75U=75U=75U=75U=75U=34U-75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=55U=75U=75U=75U=755=75U575U=75U=7555555=75U=75U=75
-MU=75U=75U=75U=75U=5555555555U=75U=75U=55U=75U=75U=75U=75U=75
-M5=75U=75U=75555555555=75U=75U=555=75U=75U-35U-75U=75U=75U=75
-MU=75U55555755=75U=75U=755555U=75U=75U=75U=55U=/BD.WA\\1727=Y
-M>&1E9V5D>WA\<G=U0T1<4=;2V=K!P\S.R,C(R,G)SLS"P,;$VMG?TM/1U]15
-M5%915E!275U<7%Q=75)24U!045%65E=75%75U=34U-?4U-37U]34U-34U-75
-MU575U=75555555555=7555555%55U55555555555555555555515U=75U=75
-MU=74U=75U=75U555555555555575U=75U=555=75U=75U575U=75U-75U-75
-MU=75U=5555555555U=755=55U5755575U555U=34U=55U555555555755=75
-MU=75U=74U=755575U55555555555U=75U=755=75U=75U=75U-74U-75U=75
-MU=75U-75U=75U=55U=75U=555-75U=75U=75U=75U=75U=75U=75U5555=75
-MU=75U=74U555U=55U=75U=75U=75U=75U5555=77U5=55=55U=75U=74U=74
-MU=74U-34U-37U-755=755=555-555=5555755555U=75U=34U-75U575U=75
-MU=75U=75U=75U=75U=75U=75U-;55%55U575U=74U=75U=75U=755=755%35
-M5=75U=75U=75U=75U=755=555=55U=75U=75U=75U=75U-74U-34U-74U-75
-MU%755=75U=74UM5455355=755=75U=75U=75U=75U=75U-35U=7555555555
-M5575U=74U-34U-34U-34U-35U=7555755555U=75U=75U=75U=75U=75U=36
-MU5155=75U=75U=755=75U=75U=75U515U=75U-34U-34U-34U=35U=75U575
-MU5755555U=75U-75U=75U=75U=74U=74U=75U=75U=35U-;55U55U555U=75
-MU=75U-34U-35U-35U=34U5555575U=75U=75U-75U=75U-74U=34U=35U=75
-MU=75U=75U=75U=75U575U=75U=75U=74U]5755155=75U=75U-74U-74U-75
-MU-555=55U=75U=74U=75U=75U575U575U=75U5755=75U=55U=75U=35U=75
-MU=75U=35U=75U=75U=36U%155=55U-75U=75U-35U-75U=74U=74U]755555
-M5555U575U=55U=75U=75U=75U=34U-75U=75U=55U=75U=75U=555=75U=75
-MU=75U-;55U54U=75U=75U=75U=75U-75U=755%755=75U=74U-74U=75U575
-MU=755=75U=555=555=555555U=75U=75U=75U=75U=75U=75U=74UM545535
-MU=75U=75U=74U=35U=75U575U-35U5555555U5555575U=75U=75U=75U=35
-MU-75U=75U=75U=75U=75U=75U=555=75U=75U=76U5945%55U575U=75U=75
-MU=75U55555145575U-34U-35U-75U=555555U55555555555555555555=75
-MU=75U575U555U57555555555U=?55U555=75U=74U=75U=75U=75U-35U=34
-MU=555514555555555=755575U=75U=75U=75U=55U=55U555U5755575U=75
-MU=75U=75U=74UM5755155=75U=75U=75U=75U575U=555-75U=35U=75U=55
-MU=75U=75U=75U=75U5755575U=75U=74U=35U=75U=75U=75U=75U=755=36
-MU5=55-75U=75U=75U=75U-75U=35U=74U]3555555=75U=75U=75U=75U=75
-MU-75U=34U=75U=75U=55U=55U=75U=75U=75U-34U-34U-'55%55U=74U=35
-MU=34U=34U-35U=745535U=74U-35U-75U=75U=75U=75U=75U5755555U=75
-MU=75U=35U=75U=35U-35U=75U575U575UU575535U=74U-74U=34U=34U=35
-MU=75U-?4U575U=75U=75U=75U=75U=75U=35U=75U=75U575U=75U=74U-74
-MU-75U=75U=75U-35U-36U5155=75U-75U-34U-35U-75U555U5575%55U=34
-MU=34U-35U-75U=75U575U=55U555U5755555U=75U=75U=75U=55U5755575
-M5=75U=35U=55U=55U=75U=75U=75U=75U=75U=74U575U555U555U=75U=34
-MU=75U=74U=74U=34U=75U=75U=55U5555=75U=75U=74U=75U=75U=55U575
-MU=75U=75U=75U=55U=75U=155%75U=34U=74U-34U=35U-75U=75U=755=75
-M5555U=75U=75U=34U=74U=75U=34U=75U=75U=75U5555=55U=75U=75U-74
-MU=34U=74U=75U]5555555=75U5755=75U=75U=75U=34U-34U-5555755=75
-MU=75U=755=755=555=75U=75U-35U=75U=75U-75U=75U=75U=75U=74U575
-MU=74U-75U=75U=75U=74U=75U=34U=35U=75U=74U=35U=35U=75U=75U=55
-MU=75U=75U=34U]35U=75U5555575U575U=34U=75U=55U=35557555755=75
-MU=75U=75U=75U=55U=75U=75U=55U=75U=75U=75U=55U=75U=75U-34U-34
-MU%75U=75U=755=74U=75U=74U=75U=555=75U-34U-34U=35U=75U=75U=75
-MU=55U=55U=55U555U555U=75555555555575U=75U=75U=755555U=75U=75
-MU=75U=35U=755=75U=74U-75U=75U=55U555U555U575U=755=75U=35U=75
-MU=55U5755=74U=75U=75U=75U=75U-74U-35U=755=755=7555755555U=75
-MU=555U15U=35U-34U-75U=75U=75U575U=75U575U555U=75U=75U=75U=34
-MU-35U-34U=755575557555555=55U=75U=75U=35U=34U=75U575U]34U=75
-MU555U=75U=75U=75U=75U=75U=74U=75U=75U=75U=75U=75U=74U=75U=75
-MU=5!9F1P<49:U=':8B0@/C$"%/J9@XJUMK&ZH:2"Z96"O;F+D9:(CG(\)SD6
-MB8(=,STU`S0X)32%L(@'/S\"^NP5$I:PN8D#/S'GL+*-Y):(M>$U/`V.NKZ:
-M!P-A[V((-6>QNK8</#T$EI!M'>^WLYTW)3+4M[:>:G^;AVDP/P*(N[SK#PD4
-MX&<,#O>SNK0$/S(<A816%9>WL>\Q)3#KL+"?$&F1GA`P/02TNK+&-340X'(#
-M`^^RN(X,.3(4@(#\;)>UM-4S.C>8O;.3&1/MD1TQ,Q:QI;!A-C<3[M4$!)"R
-MOH$U.S-[CH_C;>N(B6(R.PN#OK.5!QOWZ1PV-G"SI;82,S80E_X>'Y^RO)PV
-M.C#+M8ON;^",@Q`].0*(N+/E`@9$X!TT-?B]NK4'/3$7G.@7%INSL^`P.C:5
-MMK7I%?>!A!@]/P6TN[!>"0)YYQ,*#Y>\NXP,/S%MA))C:9JQMDP].C2;L[?L
-M$$":G`0R,A2QNK9L-0YAYA0/`9F_N88U.39W@)IV8)NVM14\.PF`O;?D&6"3
-ME`8S,4.RNK0<-@MC[&T#&X>_OY(V.#?PCH%49IFTCQX_.`")O[?-!Q;HXP8P
-M-."\NH@&,S5FE'$'$(&\LN0S.S25M8W!8)*(@0<_/ABTN;=V`Q[[^`8V")*^
-MNX(,/35\G<$>:8.]L7T].PN9MX[,;I2,F0,_/6NPN+1H#@3&\@0T`H2YN(0U
-M/S53A>`69(*RM!$_.`R`L(C8%^&!EPP\,U>RNXH<-0!0_1L+!(.YOI$V/C7_
-M@99O<X.PB04Y.0:.LHM$'=N;X`\]-^F_NX\'-P);Y!T,$H^YO?(S.0N5C)YD
-M=8&V@P,Y/A^TO(MZ!7^3]P\R"IFYN(`-,`Q1[Q0`:8F^L&<\.0^>BX1S=H>U
-MF@\Y/&VQOHEK`6CKTPPP#(&XN9L*,@_!EF8%?HN_MQ(^.0.&M(%Q>YN)E@LY
-M,\>RN8\=#!/F4PTW!XR[OY4W/0_EGEL<7(N]BP<Y.02,L8-_;9*#YC4^-I6_
-MN8,$"!C\40`U'(N[O<,P/`SJA/P7P8BS@@PX/Q.ULX-A%^B'WC4_-9JYN8<"
-M-`3QQ0<.:;6[L&(]/P.=@^ENRHZQA0L[/6>VO8-J'/V>=S4]#X.[OIP(-@;R
-M_!L#=+>XMQ\_/P:$CI!CR8RTD30[,_>SO(`3!$26934P!HFZO^PT,`;G[1,'
-MSK>^B@$Y/QB"M9]ATH"(Y3<X-I:\OX<:`&'I80LV'+6ZO5<Q,P;IEFX9Y[>\
-MC0X[/!>(MYMC3H2-6S8Y-86^OY@!#!7A9@XU;[:ZL&DR,@20GG(0[[>RA#4[
-M,G^TL9IH9YZ&83$_#X*XO)8/"Q#D>`T)1;&[MQD\/1N;A]H5Z+2QD38Z,/ZQ
-ML)L6%9>9%3$]!HNZO>0*-!SF30$"^K"XBP`^/1*&@^1OZ8JT_C$[-I&RLYX?
-M'>:0%C8S'[>ELT\W-Q_LP`4'ZK.^@@DX,FB,CNYMXHF(<3,X-82_LI`$!=KK
-M$#<V;;&EL14P,1R4YAP9D+.\A30[,TJ*BI5O^(*-:S(Y#XVYLNX#`7;C$#4U
-MU[.ZM!L],1.=E!40G+"REC$Z,>6WM)<5WX:'$C(_!HJ[L_<.#&'F%PL.XKV[
-MB`,_,!2%G&=JGK&Q]C,Z-Y"PMY40<YB>&#,]'+:ZL'TU"6[A:0\#D+RX@@@Y
-M,6&!A$%MG[>T93T["H2]MNX>;I&6!3,P8["EMA<V-6CL9``$F+R^A30X,5^/
-M@,%@DK6)$3PX#(V_L>4$$^WO!#$WP+VZM1LP-&F46@0<A+R]E#$[-^>*C/-B
-MEHB#&SP^!XJYMM`#&_#G!38*ZKRZC@,]-&.2\Q\4AKVPP#([-)"WB?]I[HV%
-M!CP\$K:[MV4&I:"ZL8*59Q@""#0R,CX_.3P\,S$U"`$::G#DE)B'@XR)B(J*
-MM8J+B(Z,@H"'FI^0E>/\VD1]9FQK%!81$!,3$Q,0$187%&IH;&-F97]Q2$9<
-M5-/8QLW)]?3W]_?W]_3UR\[-P\;%V-_=T-;55%904U)=7%]?7UQ?7%Q=75)3
-M4%!15E=45=75U-34U]?6U];6T='1T=;6UM?7U]?7U]?7U-34U-35U=74U=74
-MU=75U=75U=75U-35U-34U-34U-75U-34U-34U-34U-34U-34U-34U-34U-34
-MU=75U=75U-34U-34U-74U=75U-34U-34U-34U-34U=35U-34U-35U=75U=75
-MU=75U-75U=75U=75U=75U=75U=75U=75U=75U=74U-35U=75U=75U=75U=35
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U575U=75U=75U=75U575
-MU=75U=75U=75U=75U=75U=75U=75U=75U=555=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=555=55U=75U=75U=75U=75U=75U=34U-35
-MU-75U=75U-75U-75U=75U=55U=75U=75U=75U=75U=75U=75U=75U=755=55
-MU=75U=75U=75U=75U=75U=35U-75U=75U=75U=75U=755=55555555555=75
-MU575U5555=75U=74U=75U=75U=75U=75U=75U=75555555555=75U=55U555
-M5555U=75U=75U=755=75U=75U=74U=75U=55U=75U=75U=75U=755=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U-75U=75U=75U=75U=35U=75
-MU=7WEI3FY\#90TM\>65E9&=D97AY<G!U24=;4%30W-K&PLW.R<C(R<G)SL_-
-MPL#&Q=O>W]+0UM355%914%-275U=75U=4E)34U!145%145975%555=75U=34
-MU-74U];45-55U-74U-34U-35U5755=555%755515U-1555155%1455555=55
-MU=75U=555=555=755=75U5755575U575U=75U-75U-75U=75U=74U]575%35
-M5575U=75U=75U=55U=75U=55U5145=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U-75U=75U=75U575U5555=76U5=55%555=75U=755=75
-MU=34U=75U-75U=34U=555555U=55U=755=75U=75U=75U=74U=75U=75U=75
-MU=55U555U=75U5555=755575U=?55U145575U=35U=75U-35U-75U-35U=55
-M5U75U=75U=74U-35U=75U=5555555555U=55U=74U-35U=74U-34U=74U-35
-MU=75U=75U=75UM1755755=75U=75U=75U=75U=75U=75U=74U-75U5555575
-MU=755=7555555=75U575U575U-755575U=75U=755=75U=755=75U=75U=36
-MU%155=55U=75U-74U-35U=755=75U5755%15U=75U=75U-35U575U=555575
-MU=75U=75U575U=745=75U=755=75U-75U=75U=555555U==55U145=75U=74
-MU-74U-74U-34U-34U-35U-?5U=7555755575U=75U=75U555U555U575U=75
-MU=75U=755=5555555=75U=75U=75U575UM565575U=35U=75U=75U=75U=74
-MU=74U-55U=35U=74U-34U-75U-75U=75U=75555555755=75U=75U=75U=55
-MU=55U=75U=75U575U=76U5355575U=75U=75U=75U=74U=35U=75U=37U-75
-MU=55U575U=75U=75U=75U=75U=35U=35U-75U=75U=74U-34U=75U=75U=75
-MU=75U=;55U545575U=75U=75U-34U-75U555U=545-75U=35U=75U=75U=75
-M5=55U=75U=55U=555=75U-75U-75U-74U=75U=74U=74U=74U=74UM575515
-M5=75U=34U=75U=75U=75U=75U=74U]35U555555555555=55U575U=75U=55
-M5=75U=75U=55U=75U575U575U555U=75U=75U=34U574U=75U=75U=75U=75
-MU=75U=55U=34U555U=55U=75U=75U=75U555U55555555555555555555555
-M55755=75U=75U=5555555555U=955U545=55U=75U=75U=75U=75U=74U-75
-MU-?55554555455545575U=75U=75U=75U=74U=75U575U=75U555U=755=75
-MU=74U=34U=74UM5755355=555=55U=75U=75U=755555U=555=75U-74U-35
-MU=75U=55U5555555U=55U=55U=75U=75U=755=55U=75U555U555U5555=77
-M55=45-75U=75U=35U=75U=55U=55U=75U=37U%55555455555=55U=74U=75
-MU=75U=75U=74U=555=75U=755=755=75U=75U=75U=55U=?55U55U=75U-35
-MU=75U=75U=75U=75U=355=74U-34U-34U-75U-34U=34U-34U=75U=755575
-MU=75U=75U-74U-35U-35U=755=75U=75U]575575U=75U-75U=75U=75U=75
-MU=35U=75U]34U=75U=75U575U=75U=75U=75U=75U-34U=34U-35U=34U=35
-MU=75U575U=75U-75U-36U%155=74U-34U=34U-34U=74U=755=74U515U=74
-MU-35U-74U=35U-75U=75U=75U=74U=75U=74U-75U=75U=35U=35U=755=75
-M5=75U=?55U545575U-75U-35U=75U=75U575U=75U=?7U=75U575U=75U=75
-MU=55U=55U=75U=75U=35U=75U=35U=75U=75U=75U=75U=34U-34UM145575
-MU=75U=75U=75U=75U=75U=75U-15U=34U-34U-35U=5555555575U=75U=75
-M555555555=75U=35U=35U=75555555555575U=76U5=55555U=75U=75U=75
-MU575U=75U=75U=74U-7555555=555=75U=34U-34U-34U=74U=75U=35U=74
-MU-75U=75U=75U=75U=75U=75U-;45U55U=74U=34U-35U-75U=75U5555=75
-M5%75U=75U=75U=74U=75U=75U=34U-34U-75U=55U=555=75U575U=75U=74
-MU-75U=75U=74UM5755155=75U=75U=74U=35U=34U-34U-74U]?5U=75U=55
-M5=75U=755=75U=75U=74U-34U-75U=75U575U=75U=555=755=75U=75U=36
-MU5355=75U=35U-34U-34U-34U=35U=75U555U=74U-34U-35U=75U=75U=75
-MU=75U=75U5555=75U5755575U=75U=75U=7555755=75U=;55E1455755=75
-MU=75U=75U=75U=75U=35U=?4U=555575U=75U=75U=75U=75U575U=75U=75
-MU-755=75U=75U=34U=75U=75U=75U=74UM14U575U=55U=75U=75U=75U-74
-MU-35U=355575U=75U-34U-35U-74U-75U=75U=74U=74U=74U=75U=74U-34
-MU-34U-75U=755=55557755?55=75U-75U=75U=75U-34U-35U=35U=74U%55
-M5575U=75U=75U=75U575U=75U=34U=35U=35U=75U=355=555575U=75U=55
-MU=55U=35U=75U-75U=74U=74U=74U-34U-34U=755535U=74U=34U=75U=74
-MU=75U=34U=74U-75U=75U-35U=74U-35U=35U=75U=75U=75U=74UM545575
-MU=75U=75U=75U=75U=755=75U=74U]?4U=7555555555U=75U=75U-35U=35
-MU=74U-35U=75U=75U-75U575U=55U=75U=75U=31U5355-75U=34U-34U-75
-MU=555=75U=75U-545=55U=75U=75U=75U=75U=75U=75U=75U-75U-75U-75
-MU=75U-34U=75U=75U=75U=75U=?55U145=75U=34U=75U=75U=75U-75U=75
-MU=?7U=55555555555=55U=75U=75U=75U=75U=75555>969S<T)$5M;913TC
-M)3,/$\N%@(N+MK:SMK>PIZRGA1]FFI@<#G:VL_H\)S\#`S`R!8.-!B4G,6!A
-M``:>LK80/SUIC(#YX+>XMA@]-)&VB>SJM+V&-3@UA;:"0,2/M4D].@^,L(9I
-M<H:!&CDY$[:RA!!DA9P"/C/IO+V2&FF2X`@\"X*[L\H"$NY8"C,%M[JW$`H;
-M^V<*-T.]NHP"-@7^80D/G;FYDS0P&^)_`AJ-N+)D,C`0D%0$;;6XM`$^,7R$
-M^QW"M[^&-#LWZ8WJ:N^VL/HR.P^'BY!BE[2U$CDY'HJWD&V7BH$-.SW`L+:5
-M%.Z-E#0X-X2_MO<?_(1`,3X#M;BT;0=$D!0P,FZRNX\%#6;L'S$TE[ZYF0X(
-M;N48-P*"N[S=-S5LY!X+$[2ZMADR-7+I$P/0L+N,"#\*_9)I&Y:ROY<P.0R3
-MA7(7A;*Q:3\^&H"#TF&&LXD#.SU_BH_.>8&WF#0Z,9"QB-9EAXC#,SL.C+V)
-M96Z9@1$]/ARVOX(1$)>2!SPS^[R_FP<:Y^`",@J&N+WE#@;-Q@PQ!+6EL10T
-M`]]1#35^L[J(`S`"]]X`#9>_N)@T,@'L^00;AKZ]33(]&)SH$FF/OK<$.3)M
-M@9)K1XN]@#4[,>&)FF?WBK'L,SL+A[>$9/^)BQ4_.02*L(5N]8V&`3D]2;"S
-MG!-:AY8(.3:9O[/@!&&=VC0\#8B[MF<-%^AF-#`7L+J+&@L=YVHT-.*_NX<.
-M-QSD%0L#AKB_^38V$.]L#1*+N[$2/3%MDWP'2[>XC@XY-\&%V1WBL;R=,3@(
-MDX+G:I"QL7L_.0:#B.YCG+:)!S@_;+6U[F*<M9H*.S"5L[3X%9&-^38X"X*_
-MM'0=[85L,S\;MKF)$03.D1XS,-B\N88&`TK@!#`*A;B_Z`@.>_T'-P>+NK-O
-M-@M]_@0(8[&ZM0$R"-'B'@#BLKB$-#\/[9$6'IB\O<PR/P:9F&!H@;VW&#D\
-M%H*&='^"LX((.S/RM8)%3(*WE#$Z-86QC7%T@(YF/3@!BKV";V:%AQH_/&:S
-MO(0<%).6`C\VD[Z\EP$?[_,),@R/N[-U"03_0P@Q$[&EM!@W!O9S#@KRO+N#
-M#C`&^DX"`)NYONDQ,P65V@<=C+FP%SPS%IGF'WN*OHL-.3%%@)04]+2]F#8[
-M-)&)G6+CM+9>/3@"@[2>8.R*CALY/A:TL9UKX8R%#S@SX[*PZA++AN`T.36`
-MOK'3!'2<?38\!+>[M!<";>L4-C%TO;N-`0@4YA,W"YRYN9,*-!?D$PH'C+N]
-M>3`W:>\7#&BWN[0'/#1WD&T'\+"Y@#4^"N&%=1*1L[WF,CD-F(#,:)BPMQ,^
-M/A^,COMFA;:"##LRU[>*_F&:M9`W.S>8L[76:)^-3C,Y`HB_B&,3E)H3,CUJ
-ML+Z"'AKEE`<R-I6^OI\#`=+Z`#`/@KN]VPH-0<\#-Q^WI;8<,0]2RP$(U;*Z
-MC`\R#//D!0&3O+Z0,3P`E)42$H:_LV(\/!F%G&A@C+R*`#@R>HR$946.LX0T
-M.S:5M8%]WHZW]S([#H.Q@6?7@HP3/SX?M+*'%7>'F@`^,O>RO9T9;9_O"3\U
-MA[FR^0`1ZE<U,@:UNK9K"1GG934V9K.ZB08T!?EC"PB7OKB;-3$;X60,!X"X
-MO%8P,!*42084B[BV!3\Q8YCU&5&WOH(*.#?Y@.(7X[:RE3,X"9B)EVR7M[=K
-M/SD$C[218I:UC0`X/'RVMI5KE8^2-3@VG;VV^!+FAL0V/@^.N;1Z!=V<:#`]
-M$[&XB1\#?N@<,3;GO[B$`@YMY!@V#X:[O^0T-6SE&#49M;JP$3`U>N(=#'&Q
-MNX@,/`K%EA0$Z+*^GC8^#Y289Q"8O;-V/#X'A(%;;8:SM0<X/&F)C<5X@;:'
-M"CLP[;>.W7F&M>8P.PJ!LHEP8YJ":3T^!;2_C147DYD%/#):O:"LI[R*F=$3
-M`0XU,#(_/CX^/STP-@H,!QUAW.^2A8&-CXB+BK6UBHN)CXV#AH28G9;NY/54
-M=7IC:147$1`3$Q,3$Q`1%A<5:VYM861X<G1-6U#7W\7#S\OU]_?W]_?T]<K(
-MS\+!Q]K9W-+1U%5745!34EU=7%Q?7U]<7%U24U-045975%155=75U-?7U];6
-MUM;6UM;6UM;6UM?7U]?7U]34U=34U=74U-34U=75U=75U=74U=34U-34U-34
-MU-34U-34U-34U-34U-34U-34U-34U-34U-35U=75U=35U-74U-34U=75U=75
-MU-34U-34U-75U=74U-74U-74U=75U=75U=75U=75U=75U=75U=75U=34U-74
-MU=75U=75U=75U=74U=75U=75U=75U=74U-75U=75U=75U=74U-34U=75U=75
-MU=75U=75U=75U=55U=75U=75U=75U55555555=75U=75U=75U555U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=74U=75U=75U=75U=75U=75U=55
-M55555575U=75U=75U=75U=75U=74U-74U=35U=75U=75U-34U=75U=75U=75
-MU=74U=75U=5555755=55U=75U=755=555=55U=75U=75U=75U=75U=75U=75
-MU=75U555U575U=75U575555555555=75U=75U=755=75U=75U=35U=75U=75
-MU=75U=75U=75U55555555575U=75U57555555=75U=35U=75U=75U=75U=75
-MU-75U=755=75U=75U=75U=75U555U=75U=75U=75U=7'E9'AX<K:6DMS>7ID
-M9&=E9'AX?7-T2D%%4E;1W=O$P\S.SLO(R\C(R<[-PL'&Q=O9W]+0UM155U91
-M4%)=4EU=4E)24U)34%!04%%15E975U=55575U=35U-34U-?4U-34U-34U=35
-MU=75U=555555555455145%55555555755555U=75U575U5755574U5155554
-M55555=75U=555=75U=75U575U=555=5555555=75U=75U5755575U=75U-36
-MU%155=75U=75U-7555555555U=75U-75U=555%75U=75U=74U=75U=755=75
-M55555=755=55U=75U=55U=75U=75U-75U=75U555U555U=75U=75U=75U=75
-MU=75U=75U=75U=75U575U=74U]35U=755=755=755=75U=75U=75U=75U=75
-MU-75U-35U=75U=75U=75U=75U=75U=75U-75U=75U=74U=75U=75U=75U=75
-MU=755=755%=55=74U=34U=35U=55U=15U=35U=75U5555575U=75U=75U=75
-MU-75U=75U=34U=74U-7555555%555575U=74U-34U=74U=75U=75U=55U=?5
-MU=55555555755555U=55U555U=75U=55U=75U=75U=74U=755=75U=75U555
-M5575U=755=75U575U=75U=75U=34U-35U=75555555175555U=75U=35U-35
-MU=75U=75U575U575U575U575U=75U=75U=34U=34U=75U=755575U=555575
-MU5755575U=35U=34U-?4U-35U=755=74U-5555555=755555U575U=75U-74
-MU-74U=74U=75U=75U=75U=34U=75U=75U=75U=34U-75U=35U=75U=75U=34
-MU=75U=75U-75U=345=75U=34U-74U-74U=74U=74U=75U55555555=75U=55
-MU=75U=75U=75U=75U=75U=35U=555555U=75U=34U-34U=75U=55U=75U=74
-MU=74U]35U5755=75U-74U-35U-75U=75U=35U=74U=34U=75U=755=555=75
-MU=75U-74U-35U-55U575U=75U=74U=75U575U=75U=35U=74U555U=74U=34
-MU=75U=755=5555555555555555555=5555555=75U=75U555U55555755575
-MU575U=75U=75U=75U=75U=75U=75U575U-75U=34U=75U575U=75U=75U=34
-MU=75U=75U=75U=75U555555555555575U=75U=755=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=545-75U-34U=75U=75U=75U=75U=75U=75U575
-MU=75U575U=75U=55555555555=555555U554555555555555555555755=75
-MU=75U=75U=74U%5555555575U=75U=5555555555U=75U=74U=75U=75U=75
-M5=75U=75U=75U=75U575U575U=75U=75U=75U=75U=75U=75U=75U=755%75
-MU=75U-75U=75U=75U=75U5755555555555555=75U=75U=75U=55U=75U=75
-MU=555=755=75U575U575U=75U575U555U=75U=75U=75U-15U55555555555
-MU=74U=75U-75U=75U=75U=755=75U=75U=75U=35U=75U=75U=75U-55U555
-M5=75U=74U=75U=75U=75U=755575U515U=74U-34U-34U=75U=35U=34U-75
-MU=75U=75U=75U-34U-75U=75U-35U-74U-75U=74U575U=35U=75U=75U=75
-MU=75U=75U=75U=75U=?7U-75U=75U=75U=75U=75U=75U=75U=35U=75U=55
-MU575U-74U-34U-35U=75U=75U-35U=75U=35U-75U=75U=74U-34U-34U=75
-MU=545=75U=75U=75U=75U5555575U=75U-75U=75U575U=75U=75U=74U-34
-MU=74U=75U=75U]575%155=55U=35U=75U=35U=75U=75U=34U=74U-75U=55
-MU=75U575U555U=75U=75U=74U-34U=34U=75U=75U=75U=75U=755=75U=36
-MU%355=55U=34U-34U=75U=75U=35U-35U-35U575U-34U-34U-74U-75U%75
-M555555555=755=75U=35U=74U=75U=34U=35U=55U=75U-?55U1455555=75
-MU-34U-35U-75U=75U=75U575U]?5U=74U=75U575U=75U=34U-34U=35U=75
-MU=75U=75555555555=55U5755=75U=74UM14U575U=75U=75U=75U=75U-34
-MU-34U=75U554U=74U-75U=74U-74U-75U=75U=75U=55U=55U=75U-35U-35
-MU=75U575U575U-75U=76U5=55%55U=75U=75U=75U=75U=75U575U=555=37
-MU5755575U575U=755=75U=55U5555=55U=35U=75U=55U=755=755=75U=75
-MU-75U=;45U55U=74U-34U-35U-74U=75U=74U=755=555-55U=35U-35U-34
-MU-35U=75U=55U=75U=55U575U5555555U=75U=75U=75U=75U=74UM145575
-M5=75U=75U=74U=35U-75U=35U=75U=74U]55U=55557555545=55U=55U=75
-MU=75U=75U=75U=75U=75U575U57555555=55U=71U%=55-55U=75U=74U-34
-MU-35U=75U575U=755575U=35U=75U-35U=75U=75U=75U555555555155575
-MU-34U-34U=34U=74U=35U=34U-;55U545575U=35U=75U=75U=75U-34U=75
-MU=55U-?5U5555515U555U5755=55U5555=75U=74U=75U=75U=75U=75U=55
-M5555U=75U=74T=175%155=75U=75U=75U=75U=75U=755W-@?W-*1%S6W=H"
-M+2<S"A]WD(2/BK.[O(N.B+2DHJ2`&@UKGX#F'01\[7`T)"$_9;6)$#@A)0.0
-MA/`:!7"7\@0T#)&\I;!K,CT?M+B]A1$?5)V5:P5YC[RSYC$Z,.F\N8X%,300
-ME)5D$]:`M9@"/SP?M[J]RS$_"^*.@N%I7YZ%=0@P#82^N(,(.SP1BK.)=P<<
-MQN)N`@Q$M;^W$3\Z"H:^O)H`-`-=E\43%Y.TM^HU.#/2O:6W$3,S!Y*"G')A
-ME(.:'3$R!(B[OY<V.S''M;>%%1]PE?,%-0V7L[F.`CLY!XN_L?H-#A+GY1<$
-M88"PM'TS.S>>OKB-`3,T:IF:]VG%AHF3`CTS8K&ELV4R/@F1M8GB%F/KDGH.
-M-P:!OKZ:-#H]8+>]B6`"!W3C>@<&]+6]BQH^.`R/N+R2#C8-T)SM;VF6BXKR
-M-#XV[K^ZM04\,@6%B81+:>6%DQ\W,1"UN[WP,SLV[+:QA1,':N;S'@X'G;.\
-M@0D[/ARWN;%7"S49X.IE''V!MHAJ,CD+AKBX@0\]-VV'@>QM1YB#[@TS-M>S
-MNK80/SD,FK:*XAP0]Y1[#34>@KZ]ES$Z,].POXX7"0-G[U8>&^6ULX(!/CX&
-MM;N][C4S#_>$DW!MZXR,1S0\-9R^NHX#/C(9@+2!=!%;DY4<-31AM[NP>ST[
-M-)VSLYH;`ASP^Q8`'IFPLI@U.SQLL;NV9C0W&^B=Q!1TA[2"$C(_#8R[N9@U
-M/S=\C8^6;&26A/@",37CLKJU!#DY`X"SM.<%&G;L<0$.%(R\L_,S.C'OO;Z,
-M&30.8Y3E%!/AB+:$`CX\'+>ZLLPV/0_@@X70;.2&AF4T,@^$N;B`"#@R$8ZV
-M@WX9;>SM$P@)7+>YMQ$_.PN'O+*?!@@%S>)C!1&8L;&5-#@SU+*ZM!$Q,1J0
-MA.UM<9B)AQ@S/02+NK^4-CDWWXB*DFL5Y)S.`#</D;VXB0(X/@2.O;?V``!L
-MX%$:`&&/O;9\,CLWG[^Y@P8V"V*2EWL4YXRUG0\_,FRPI;!E,SP,EXZ`]VK3
-MF9MB-3`!@[FYFC0[,F"ULXUC!Q+VX1<,`ORWOXH:/C@,C;ZRD0TT!LR77!)H
-MF;>T_38Y,>R\NHH:,C`8F8.09&60@Y\%,#`2M+J]\S,X-."TM)P1'$>4VP8U
-M`9Z]OH`).S\<M;^W7@\/%^#R$`5WC+.U%3TX"X:YN8<,,S5GFIG?:?V`B>L.
-M/#%6LJ6V$3P_#9ZUC/T19)23;P@W&(RYO)8Q.C!4MKV-%`(%7.!C`0?BM[V,
-M`3DY!HNXLNP+-@#PG.=K8IR*B$TV/C2=OKN.`SPS'(:)F'EOXH27!38W8K>Z
-MLWX].#60L;:<'P1MX\$:#AJ%LKR:-3L\;K&YM&8*"Q+O[F,<68*VCQP]/@R,
-MN[Z9"STT<8&&Y&_2A8/X#C(TX+VZM`4^/P"&MHCP'A?XE6T/"A:)OK+_,SHQ
-MXK.\@AP(`''O21@9Z+2SA@PY/Q^WNK/,-S`"YH26>V"6CX)A-CP)A+FX@PD^
-M,Q:-M81E%M^2[QHT-5^QN[86/S@(A;*PDP0"$/CS$@,2A+.SES<[,ERSN+46
-M-S0<EY-2%U"!M($%/3P'B[J_ES<_--R,C>AI?9.$V@\P")&\NXD#.#\$C+.*
-MP`086.QD``]@B+^Q<#(Z-Y*\OX`$-`Q^E_,6$.N*MIX)/CUHL:6P>#$R`I6#
-MF$9M[8"':S<R`X.XN84T.#-CB[:&8QEGZ.8>"P_YL;FU&CDX#(*_L)<#"1CS
-MX6D$%82QMO@V.S'CO+N+&#`V'9V%YV]'A8F;!S(R'+2EO?\P/C7GBHB7%&GC
-MG%T--P*8O+F#"3L_'(J]M40#`6?C2`0`=8B]M!4\.PJ'OKZ'`C8)?)WJ817N
-MCK65"S\P1+*EMA8R/0.=B8;3:\N;GA0T,06/N+^1-CLP6;>P@14'$?GE$P\`
-M[K&_C@`Y.0:(N;/B#C4$_Y1U'6*%M[5#,3DWDKZ[CP$],1.%@)1A<IV"D`8P
-M,6ZVNK-S,CD*EK>TEA,=T)1:`#4'A+R_A34[/6BWO[5G#@QH[<\=!=:)LX@?
-M/#D/C;B_F0DS"TB%GUENYH*.Y0L\-^:]NK0:/SP!A+6"V!%REI$7"C<3B+B]
-MY#,Z,>>PLH$2`AO9YF@!!9>VO8`,.#\9M+NPSC4V!N><_!5GF+6.8S$^"X2X
-MN(,//S$4@(Z<9F+HA.@&,31#L;JQ%#\X"9NPMY&+HJ2RB9U!'0`)-3`R/SX^
-M/SPR,3<(#043>\+JG82`C8Z(BXJ*BHN(B8^-@X:%F9*4[/K.779D8F@5%Q$0
-M$Q,3$Q,0$184%6AO8F%D>7-U0EA1T=[$PL[*]?3W]_?W]/7*R<_"P<3;WMW3
-MUM155U%04U)=7%]?7U]<7UQ=4E-04%%65E145=75U-?7U];6UM;6UM;6UM;6
-MUM;7U]?7U]34U-34U-34U-34U=75U=75U=75U-34U-34U=74U-34U-37U-34
-MU-34U-34U-34U-34U-34U-35U-35U-34U-75U=75U=74U=34U-34U-35U=35
-MU-34U-34U-35U=75U=74U-34U-34U-75U=75U=74U-34U=75U=75U=75U=75
-MU=75U=75U=75U=74U-35U=75U=75U=75U-35U-75U=75U=75U=75U-75U=75
-M5=75U=75U=75U=755=55U=75U=75U=75U55555555575U=75U=755=75U=75
-MU=75U=35U=75U=75U=34U-34U=75U=75U=75U=75U=755=555555U=75U=75
-MU5755=55U=75U=75U=75U=75U=75U=35U-75U=75U=75U=75U=75U=75U=75
-M5=55U=75U=75U555U=75U=75U=75U=555=75U=75U-75U=75U=75U=75U=75
-MU=75U55555755=75U=75U575U5755=75U=75U=75U=55U575U=75U=75U=55
-M55555=75U=75U=75U575U=75U=75U=75U=75U=75U=75U=35U=75U5555=55
-MU=75U=75U=75U=75U=75U=75U=755=75U=75U=75U=75U=55U=75U=74U=75
-MU=75U=75U=75U=35U=35U=55U=75U=GID./A]\5<2W%Y>V1D9V5D>'A]<W1+
-M0$525M;2V,7`PL_.R,C+R,C)SLS"P,;%VMG?W=#1U]555U914U-275U=7%)=
-M4E-24U-04%%145=45%55U=34U-?4U]?4U]34U-35U-75555555555=755555
-M5555555555555555557555145%555=555=755555U5555575U=75U=74U-74
-MU]15U5555555555555755575U=75U=75U=75U=755=55U=75557555555555
-M5%155=755=75U=75U=35U=35U=35U=35U-35U-75U-75U%55U=74U-35U575
-MU5755555557555555%55U575U=74U-34U=35U-35U-75U=55U=75U=55U=75
-MU=75U=35U-75U-35U=55U555U575U=75U-?4U575557555555575U=75U=34
-MU-35U=75U=75U=75U=755=555=755=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U57555755575U-555=75U-34U=75U=75U=75U=75U=75U=75U=75U-35
-MU-75U=755=55U=75U=75U=75U=35U=75U-74U-75U=75U575U=75U575U=75
-MU=755=74U=75U=5555555=75U=75U-35U-75U-75U=75U=75U=5555555555
-M55555575U=75U-55U=75U=74U-74U575U=75U=755575U=75U=755535U=35
-MU-34U=555=75U=75U-75U55555555575U=74U=75U=74U=75U=75U=75U=74
-MU5555=75U555U=75U=75U=755=75U=75U=755575U]35U=75555555555=75
-MU=35U-34U-34U-34U-75U=755555U575U=75U=75U=75U=755=75U=74U=75
-MU=74U-34U=35U=35U=35U=75U514U575U-74U-34U-74U=75U=74U-35U=75
-MU-35U=75U=75U=75U=74U-75U=75U575UM5755155=74U=74U=74U-34U-75
-MU=75U5555=55U=34555555155575U=75U=74U-34U=74U=75U=75U=75U=75
-MU=75U=75U=755=75U=31U5=55%55U=75U-35U=75U=75U=75U=75U=75U-55
-M5=75U-34U-35U-75U=75U=55555555555=75U=75U5555575U=75U=75U=75
-MU=75U=;55U145575U=35U=75U-75U=75U=75U=75U=75U=74U%7555555=75
-M55555555U5555=75U=75U=75U=75U5755575U=75U=755=75U=74UM145575
-MU=75U=75U=75U=55U=75U=75U=755=755%155575U=75U=34U=35U=75U-75
-MU5755=75U575U=75U575U=75U575U=75U=75U=36U5=45-75U=75U=75U=75
-MU=75U=75U5755575U=74U]35U57555155555557555555555U5555555U=55
-M5575U=75555555755=755=75U=;55U5455755=75U=75U=35U=75U=75U=55
-M55555517U=75U-75U=75U=75U=75U=75U5555=75U=75U=75U=75U=75U=75
-MU=55U=75U=74UM5755155555U=75U-75U=55U=75U=75U=75U=755=34U=55
-M555555755=75U=755=75U=755=75U-35U=75U=7555755=75U=75U=55U=36
-MU%?5U=35U=55U5555=75U=75U=75U=74U-74U-355=34U-34U-34U=75U=75
-MU=75U=75U=75U=75U=35U-35U=35U-34U-75U-75U-75U-;45%55U=74U-75
-MU575U-36U]355%75U-?4U5545%35U]7555145%75U=75U=75U=5555555575
-MU575U=555555U=75U=75U-35U=75U-34UM575574U-34U=74U-74U=75U=75
-M5=74U-7555755U355=35U=15U=75U-?4U575U=34U-35U=75U-7555145=75
-MU-75U=74U-35U=75U-36U%=45-75U=75U=5?969S<T-%5]'91STC)3,/$\J8
-M@+"TBK2WL*6ELXJVO+#B#0SMO;B&-20["6X;"C0:^60P)B$WAK""!C`T%N1E
-M!6B-O[W@,3\'M+N]G11SG)]H#`6#N+B%-SDTE[2.\!?VA94"/3'QO;N-#C\W
-M?H218&":M(,'/C\0L+NT$30/<>IZ!!6#O;%L/SL-C[RT7082Y?X$-`"&OK^5
-M,#LUD+2,P17GAY4",C>5OKN#"3PUTX>087Z'M(``/CQNL[NU'S0,2.EB!VB-
-MO;<0/CL`B+RU?0$0Y_<&-`:#N;SD,S@+GK2-56KMA^\//32=N;B&"CP*]H:7
-M8G:&M(<-.3USLKB)!30"7>]I!V..O+09.3@$M;R+8`$6X<$!-`6,N+W2/3@.
-MA;2#0FOHA^<)/36:N+B;-3P)Y(:5;$&`M(4..3+'O;B,!S<#V>T5!WB(O(H'
-M.#D>M+R.:0$5X]0#-!F)N+)^/#D"A[2!<VF4A_`+/0B&N+F3-ST/[(;N;E2"
-MM)X+.#/AO+F#`#0!R.,6!TZ*O(D`.#X1M[R,%P9I[48"-1**N[!H/SX!@;2&
-M>FR6A]TU/0^"N[[K-CT-E8?C:<:,M)`U.#&4O[F'`C0'\N80!].TO(\,.SQL
-MMKV#$`9B['$,-1>TN[$3/SX$@[2$9F.0ATPT/0*/NKS[,3T`EH?D:/"/M.HW
-M.#:<OKZ;##0$^^42!/&WO(,).SUPL;V&'`9G[WH/-6RWN[8;/C\8C;2;8F:=
-MA'LW,@&(NKU5,#(&DX?]:.6.M.$V.#2%N;^=#C0;Y_X<!.>VO88U.C+;L+*$
-M&0=Y[V`."GZQN[0'.3P3C[2>;WN?A&TV,@2UNK)X,S(%G(3(:..(M?4Q.#6!
-MN+R4"34>X/8>!>FQO84T.C/GL[*8&P1W[VD("E*PNXH#.3T5B;62:7.9A14Q
-M,AFWI;!H,S,9GH7?:>F+M44P.0B"N+W@"S42XL(8&I>QO9PV.C'JLK.=!01&
-M[!0+"/&SN(D/.#)AB+61:DF;FA`Q,Q"VI;$0,C`2FYI2;I2*BV4S.0^.N[+T
-M"C41[-,:&)*PLI<Q.C:2LK"7!`57[1$*">.RN(T(.#!TBHJ5%5^:F1\P,&BP
-MI;<9/3$6A9M";Y"UB&@R.0.+N[!;-0H4[EX%'IFSL^,S.C28O;'N!QO;XQ(*
-M#I2]N(`U.#'9M8OO%=V%GQHS,'JSNK0$/39HA9EV;9VUCA$]/@:UN[%E-0AI
-M[D@$'86RL\LR.S6'O;;G!AG(X1XU#)*\N80T.#;XM8CF%,Z$D@0S,5.]NHL!
-M/3=FA)]_8)FTC!X\/QJWN[9N-`E@Z7T$$X>RL$X].PB`O+?U!A_PY!LU`IB_
-MOIXV.#?LM([_%/*$D0$R-OR\NHX-/#1PAYUE9YJTC04_/QVVN[06-`YEZ64'
-M%H"]L6`\.`R-O+16!AWY^04U`(2^OY8Q.#67M(_)%>6'E`,R-^^_NX(./#5?
-MAY!F>X2T@`8^/!6PN[4<-`QQ[F`':H*]MA<_.`..O+5V`1/D\`<U!H"YO.TS
-M.`N2M(W3%>"'Z`TR-)&^NX$(/`K"AY9C<X:TA@,^/6>SNX@;-`U![V\';(^\
-MM!P^.0>+O(MD`1'FS@$T!(VYO?0R.0Z9M()::N^'X`XR-9ZYN(4U/`C^AI1M
-M28&TA`PY,EBRN(\$-P/4[&H'9XF\M04Y/ANUO(EO`13@W``T&XZXLDP].0R%
-MM(!T:.J'^0@]"X2XN9PT/0[@ANAO7H.TF`DY,_*\N((!-P#'XA<'<(N\BP8X
-M/A*TO(\5`6KB70(U'(NXLV,\/@.&M(9^;Y>'S`H]#H&[OI<W/0SIA^UNW8VT
-MG0HY,.^_N8$#-`;WX!$'7K6\C@(X/Q6WO8(1!F_M2`TU$;6[L!<_/@:`M(=D
-M;9&'4C4R#(V[O^,V/0.4A^9IR(RTES0X-I&^OH4--`?_YQ,$P+2\C0\[/6:V
-MO8`2!F#L?`PU:[2[MA\^/P6"M(5@8)*'<30R`XZZO/4Q,@&1A_AH_XZT[S<X
-M-YF^OYX/-`7E^QT$_K>\@`L[,D"QLH<?!F7O9PXU8;:[MP4^/!^,M)AM9)R$
-M9C<R!HJZO4\P,@>2A/%HYXFU^#8X-(2YOY`.-!CF\A\%X[:]AS4[,_2PLH48
-M!WWO;0D*=+&[M0$Y/1&.M9QN?IZ%:38R!;2ZLV$S,QJ?A,-H[(BUV3`Y"H"X
-MO.@(-1_C]1D%ZK&]F#<Z,..SLYX:!$KL:P@+W["[BP(Y,FF)M9-H<9B%%S$S
-M'+>EL!0R,!^9A=%IZHJ*=S,Y"8VXLN4+-1/MQ1L;D;"RDS8Z,9>RLY,%!5CM
-M%PL(^;*XCPXX,V6+M9=J0YN;$C$S%K&EMATR,!.;FEYOE[6+8#(Y#8F[L\0U
-M"A;OU1H9G;.RZC`Z-YRRL+.BI+*.DW4?``DU,#T_/CX^/#(Q-P@-!1-YS96=
-MA(",CHB+M8JUBXN)CXV#AH69DI3L^LY==F1B:!47$1`3$Q,3$Q`1%A05:&]B
-M861Y<W5#6%'6WL3"SLKT]_?W]_?T]<K)S\+!Q]K>W-/6U%1645-375U<7%]?
-M7UQ?7%U=4E-045975%555=74U-?7UM;6T=;1T=;6UM;6UM?7U]?4U-34U=74
-MU=75U-35U=75U=75U=75U=34U-74U-34U=34U-34U-34U-34U=75U=35U-34
-MU-34U=35U=75U=74U-34U-35U=75U=75U=34U-75U=75U=75U=74U=74U=75
-MU=75U=35U-34U=74U=75U=75U=74U=35U-35U=75U=75U=75U=75U=75U=75
-MU=35U=75U=75U=75U=74U-35U-75U575U575U=75U=755555U575U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=555=55U=75U=75U=555555
-MU=75U=75U=75U=755=75U=75U=75U=755555U=55U=75U=75U=75U=75U=74
-MU-34U-35U=75U-75U-35U-75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-M5555U555U=75U=75U555U=75U=75U-75U=755=55U=75U=75U57555555555
-MU=75U=75U=75U=75U=75U-35U=75U=75U=75U=75U=75U55555555575U=75
-MU5755575U=75U=75U=75U=75U=75U=75U=75U=755=55U=75U=75U=75U575
-MU=75U=75U=75U=7:ZY'@X?3$7DAP>7MD9&=E9'AX?7-T2T%%4E;1TMO%P\+.
-MR<C(R,G(SL_-PL#&Q-O9W]W0T=#545%045-24E)24E)=4E)24U-04%%64597
-M5%155=755=74U-?7U]?7U]?7U-?4U-34U=755555U555555555555%145514
-M5515U=75U=74UM165%15U=75U=75U=75U=75U=55557555555=755575U-75
-M55755=555555U=75U=75U=75U=75U=74U-75U=5555555555555555755=76
-MU5945%75U=75U=75U=35U=75U=75U575U=555=55U514U575U=75U=75U=75
-MU=75U57555555=755575U=74U-34U=74U-75U=75U=75U-'45U1455755=75
-MU=75U=75U=35U=35U=55U575U=75U-34U=555555U575U=75U=75U=75U=75
-MU=35U-75U575U=74U=75555555555=75UM1655155=75U=75U-74U-75U-75
-MU=75U=75U=75U=545=75U-75U=75U=75U=75U=75U=75U=755=555575U=75
-MU=74U=34U-75U=74U=36U5945%555=75U=75U=75U=755=75U=75U575U555
-M5574U%75555555555=75U=75U=75U=755=75U=35U=75U=555=75U=55U=55
-M55555==55E55U=74U-34U-35U-74U=75U=75U=75U575U=555U355=75U=75
-MU=755=75U=75U=35U=75U=75U=75U=75U=75U=75U=75U=555575U-555=75
-MU=74U-75U=75U=75U=74U=34U-35U=75U=74U]35U=75U=75U=75U=75U=75
-MU-75U=75U-75U-35U=75U=75U=75U=75U=75U=34U%75U=75U-34U-35U=75
-MU=75U575U=755=755575U554U=75U-35U-35U=75U=75U=75U=75U=75U=75
-MU=75U575U=75U=74U-74U-34U-34555555555=75U=75U=75U=75U=75U=75
-MU=75U=75U=?4U=75U=75U=75U=75U=75U=75U-75U=75U555555555755555
-M557555555555U=55U=75U=35U=35U=75U=35U=75U=75U=75U=75U-555=74
-MU-34U-35U=75U=75555555555575U555557555555575U=75U=75U=35U=34
-MU5755=55U=75U=55U=75U-75U-35U575U=75U=755=74U%75555555155555
-M5575U575U=75U=74U=35U=74U-75U=75555555555=555=555%55U=75U=75
-MU575U=75U=75U=75U=75U-75U=755%74U=75U=74U=35U=75U=75U5555555
-M55555%555=75U=75U=755=75U=75U=75U-55U5555575U=75U=755=75U=75
-MU=75U5555575U575U-35U=75U=75U5555555U=75U=74U=755575U=555555
-M5575U=75U=355555U=74U575U=75U=75U=75U=75U5755=75U=75U=35U=75
-M55145575U=75U-75U=75U=75U=55U=75U=75U=75U=75U=75U575U575U=75
-MU=75U=355%5555555555U=75U=75U=75U575U=75U=75U=75U=37U=555515
-M5575U=75U=35U=75U575U575U=75U=75U=35U5555575U=75U=74U-55U=74
-M5=75U=75U=75U=34U-34U-35U=75U=75U=555-75U=75U-34U-34U-35U-55
-MU55555755=755575U=74U=75U=75U=75U=75U-37U%755=75U=35U=75U=75
-MU=75U=75U-74U-35U=75U=74U]34U=75U=755555U=75U-74U-34U-35U=34
-MU=555=75U=755=74U=755=75U=35U=75U-75U-75U-35U-75U=75U=755555
-MU=75U=75U575U-34U-34U-35U=35U=75U=75U=75U=75U=75U575U=75U=75
-MU=75U=75U=55U-5555555=55U=75U-74U-35U=75U=75U=74U=75U575U-?4
-MU=755575U=75U=34U=75U=74U5555=74U=34U-35U=75U=55U=75U575U=74
-MU5555=75U5755555U=75U=74U=74U=74U=75U=75U554U=35U-34U-34U-35
-M55555555U=55U=755555U575U575U=755575U=74U=75U=555555U=74U-34
-MU-75U=75U575U=75U=35U-75U=75U-37U-75U=75U=75U=75U=75U=75U5-Y
-M87)S3$10UM_6-R(D,@D3T)^&L;>*M+:SO+:TN:"F@`P(T+2TRQMO[QXY(#IL
-MCI$U/C$##ST_!;2RE#$^#Y292GB"O[!I/3#NO;*'QIN(GP\R![>EL&`(&^10
-M`@_NO+Z6,#X"DII_%)NVC`TZ//2PMN`?U)C6-#T$MKJT&S<!_,`&`9R_O_HR
-M/@2&@O%AFK>!"3LPD[RQ_P5DD78T,Q&PNH@#,`/X^!H%FKRS9S\^'HR.YF"?
-MBI\U.S>&OK%=`!3O>34V<+VZ@@@R`^SK$!*'O;8=.3]JM;7B;Y&,Z#0Y"X^X
-MMF,/'^5Y"#7ZO+B%-SP`D9UL%8:RM08[/$:VM.(7XH'Q-S\#M+NW$S4%\G$,
-M#Y:_OI4P/P:8A'1BA[&,##LR[;.VY!S#F$`W/1BQNK4$-P;]4`$!F;^\TCT_
-M!8&#QV:$MX<*.S&>O+;#!7Z1>S0P:+.ZCPTP`.?S!1N$O[-K/C\3CX_^89B*
-MDS0X-("^MG$`%>YF-3=7O;N!"C(`Z>X2$(:]MQLY/&"UBN=ODXSC-SD.B;BW
-M:P\=YV8+"NR_N)\V/0:0DFYH@;*+`SL]QK:TY!?N@=XV/P:WN[0?-1K^?@\,
-MG;Z^XS,\!)J%<F&!L(().S"5L[?Q'/>8<C8R';"ZB`8W!_A'``:%OKUW/#\>
-M@(#69(>WA34[-H6\MU`%<9%A-S!GLKJ-#S`&X?0%&8:_L!$^/!2.C_=GFHJ7
-M-S@U@KZW9`!IZ6TT-_:\NX0U,P;J[1T6@+RT!#@]?+6+_VV=C/@V.0V*N+07
-M#Q/G8@L+E+ZYD3$]!Y*0:V^#LHD-.S+YL;7S%.J!138_!+:[BALU&/MG#PV9
-MOK_S,CP:A9IX9("P@`L[,9"RM,0=_)AG-C(6L[J.`#<%Y74#!X>^LF$\/!*`
-M@5YXAK>9-#LWA[RW2P5/D6\W,7>]NX`),0?CP`0?@+^Q'SD];HZ,P&6%BN@V
-M.`B/N;1M`&WI:S0TYK^XF#0S!)3@'!2"O+4!.#);M(CT8I^,R#$^`[6XM1,/
-M$>9I"@B3OK[J,3(%G9$58X*RCPX[,^*QM<P4E(9S,3P8L;N(!0H?Y6`.`X6Y
-MO-0R/1Z$F&1X@["&-3LVG[*T41WEF&TQ,FBRNXT"-QKG<@,$@;FS:C\]%H.&
-M0WV!MYTW.S6!O+1_!5Z1%38QU[R[AP@Q!>W=!!V"OK8:.3UFB8W2>(2*XS$X
-M#HFYM6L`8.D4-#3IOKB=-S,%E^<?:HR\B@,X,\>TB<1@F8S5,#X&M+B*'`\7
-MYA4U#I^YON$P,AB<EQ1FC+*-"#LPZK&+TA66AF0P/!VPNXX'"AWE;`D`A[F]
-M<3T]$H2987*-L(0T.S>;LK5,$N:9:S$S9K*[@PTW&.9[`@6#N;`1/SUJ@H=T
-M=H.WD38["H._M6<%U)$7-C;QO[B%"C$;[U$'$XR^MP<Y,G.(@E!\AXKY,#@-
-MB[F*%`!DZ1$W-9>YN98W,!B6^AYNC[R(##LS_[2/UV:;C$@P/@2WN(@9#Q7A
-M%S4/FKF_\3,R'YZ4%WJ/LH,*.S&1L8A<:I"&;3`]$;"[C`8*$^1K"0&!N+)A
-M/3(1AY]C=(RPFS<[-(2RBG`2XYD7,#-VO;N!#S<?X6<"&(VYL1P^,FV"AW!/
-M@K>5,3L(C;^*8AK;D1`Q-N:_N)DU,1GN1P<6CKZT`3@S6(B#1'&!B\XP.0.U
-MN8@1`7GN$S<*DKF^Z#8P'Y;\&6*)O(X..S#@MXQ>9)J->#,_&[:XCAL,:.81
-M-0R$N+S4,S,2GNL6<HFR@34[-IVQB4]HDX=J,SUKL[B"``L1Y!4(!H.XLFL\
-M,Q6'G&U`C["?-CLUAK*(>Q/OGA`P,%6\N(0.-!WA8PT>C[BQ&SXS9(V$?T6-
-MM^TP.`Z/OXAI&LZ6'3$WZ;ZYDC4V'.E*!A2)OK4#.##%BX!)2H&+43,Y`;2^
-MB1(!<.\<-@N9N+[A,3`=D?<99HB\C`@[,>FWC4UZA8U@,C\<L;B,!0QOYA(U
-M#8:XO'<R,Q&9Z1%*B+*'-#LWF;".<6Z=AQ8R,F"RN(`#"Q?G%P@'C;BS$3PS
-M;H:2;%.)L9`Q.PJ`LHEF$.B?'3,P][^XF@DT$^!O#1R)N+8$/C!QC85[5HRW
-MY3,X#(F_CA4;\9<>,326N;F6-#83Z',&:XN^B@PX,/.+@79&@(AU,CD'M[Z/
-M'`%*[!XV"(6XO_`Q,1"0S1AXBKR""CLVE[>"=WZ$@F@R/Q"PN8($#&/F'#0"
-M@[N]9S(P%)CM$5J+LH4W.S2:L(Q^;)R'$S(R?;VXAP((%><0";6IH+NQ@^YC
-M&@(+,3,_/SD^/STS-C4.`1EI0>&1FX:"C(F(BHJ*BHN)CHR"@8>;G)'KX?#2
-M3'YA;VH4%A$0$Q,3$Q`1%A<5:VYM8&=[?79.1%+5W=K!S,C*]/?W]_?T]/7(
-MSLW`Q]K8W-+1U]545E%34EU<7%]?7UQ<75U24E-04%%65U15U=34U-?7UM;6
-MUM;6T='1T=;6UM;7U]?7U]37U-34U-34U=75U=75U=75U=75U=75U=75U=74
-MU-34U-35U-74U-34U-34U-34U-75U=34U-34U-74U-35U=75U=35U-34U-35
-MU-74U-34U-34U-34U-35U=75U=34U-34U-35U=75U=75U=74U=75U=75U=75
-MU=74U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=755=75U=75U=75
-MU=75U=755=75U=75U=75U=555=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=5555555575U=75U=75U575U=75U=74U=74U=75U=75U=75
-MU=74U=75U=75U=75U=34U=75U=75U=75U=75U=75U=75555555755=75U555
-MU55555555575U=75U=7555755575U=75U=75U=75U=75U=74U=75U=75U=75
-MU=75U=75U=75555555755=75U=75U=55U575U=75U=75U=755=755=55U=75
-MU=75U5555555U575U=75U=755=75U=75U=75U=75U=75U=75U=74U-75U=75
-MU=75U=75U=75U=7555555555U=75U=75U=55U=75U=7#E);AYLG:6DAS>7ID
-M9&=E97YY?'-T2T9:4U?0W=O$P\+.SLO(R\C+R<[,PL#&Q=O9W-/3T-=55%91
-M4%-24EU=75U=4E)34U!045%65E=45%155=75U=34U-?4U-?4U-?7T-=4U575
-MU=75U=75555555155514551455155=555=755%=5U=75U=75U=75U=75U=75
-MU575555555555555U=75U=75U=75U=55U575U=36U5945%555=75U=74U=34
-MU=75U=75U=75U55555555555U=?5555555755=555=75U=75U=75U=75U=55
-MU=55551555555555U555U=75U=;55U54U575U-74U=75U=74U=75U=75U=35
-MU-34U=75U554U575U-34U-35U=75U=75U=75U=75U=75U5555555U575U=74
-MU-75U-75U575U=55U=75U=74U=755=75U=75U555U575U-75U-75U=755=74
-MU-755=5555555555U575U575U=75U-75U-35U-75U=75U=75U=75U=755=74
-MU5755=75U=755=75U=75U=35U=75U=75U555U555U5555535U=75U=75U=75
-MU=75U=5555555555U555U574U=74U=74U=75U=75U=34U=?45=55U=75U=75
-MU=75U=75U=75U575U=75U=75U=75U575U]75U57555555555U=55U5555=75
-M5=75U=34U=35U=75U=75U=55U5555=75U-55U555U=75U=75U=75U=75U=75
-MU=74U=75U-75U=755515U=75U=75U=75U-34U-34U-34U=75U=75U-75U=35
-MU=755=75U=55U=75U=74U5555=55U=75U=75U=75U-75U=75U=75U=75U=74
-MU=35U-?4U=75U555U=55U=75U-75U=75U=75U=35U-34U-74U-35U=75U=75
-MU=75U=355=75U-74U-74U-75U=74U=75U=74U=75U=35U-7555545=55U=75
-MU-34U=75U=35U-75U-35U-75U=75U=75U-74U=75U=75U555U=75U-75U=75
-MU=75U=75U=75U=75U-34U=74U=35U=75U=755574U-5555555=555=555555
-MU575U=75U-74U=75U=75U=75U-35U=75U=755=74U5755=74U-34U=75U=55
-MU=755=75U=35U=55U55555555%55U=75U=34U-75U=75U=75U=75U=75U=75
-M5=75U=74U=75U=75U=75U=75U=35U=55U=755=7555555=75U=74U-75U=75
-MU=55U=75U575U]35U575555555155575U=75U=75U575U=75U-75U=75U=35
-MU=755=755=75U-75U=75U=75U-75U=75U55555555555557555555575U514
-M5575U=74U-74U-35U=34U=755=75U=755=75U=75U=75U=75U=75U-35U=34
-MU5555%55555555755555U555U=75U=75U-75U=75U=75U=?4U5555%155555
-M5575U=75U=34U-75U=555=555%555555555555555575U=755555U555U=75
-MU=75U=75U=75U=74U=75U575555555545-75U=34U-35U=35U=35U=755=75
-MU=75U=75U=75U=75U=75U=55U555U575U-55U=75U=75U=75U=75U=75U=75
-MU=755=75U=555=755=74U-75U=55U=555=55U=75U=75U=75U=75U=34U=75
-MU=75U=75U=75U575U=75U5755=75U=75U=35U=75U=74U=75U=75U=75U-74
-MU=355=75U-34U-34U-34U=75U-35U=75U55555555575U=74U=75U-34U-34
-MU=75U-34U=34U-35U=75U=75U=75U=34U=75U=75U=75U=74U=74U]?5U=75
-MU=75U=75U=75U=34U-34U-74U=75U575U555U=75U5755=555=75UM575%35
-MU=35U=75U-75U=75U-75U=35U-75U=35U=75U555U=74U-34U-75U=74U=75
-MU=75U=75U=7555555=75U=75U=74U=755575U=75U555U555U=55U=75U=35
-MU=75U=75U=74U-35U-75U-75U=34U=5555555=75U=74U=34U=34U-34U=75
-MU=35U=555555U=55U=555=55U=555%55U=75U-75U=75U575U=75U=755=75
-MU=755=75U=545=74U=34U-35U=75U=75U=75U=75U=75U=75U=75U=74U=75
-MU=75U=55U575U555U=75U575U=75U=75U=35U=75U=75U=74U=75U=555=75
-MU-7555755=75U=555575U=75U=75U=75U=35U555U575U=75U=75U555U=74
-MU575U=74U=35U=7555555=75U=35U=34U-34U-35U=7555=4U=74U=34U-74
-MU-35U-35U=75U=75U=75U555U5555575U=75U=75U=75U=355=755=75U=75
-MU=75U=75U=555=75U=75U=75U-35U=75U-?4U=75555555555=55U=55U555
-M5575U=75U=75U=75U=34U=75U=755575U-555=75U=35U=35U=75U=75U=35
-MU=75U=75U-75U575U554U=34U-34U-34U=34U=35U=75U575555555555=75
-MU=75U=75U=75U=74U-74U5755=75U=55U=55U=75U-74U=75U=75U=74U=75
-MU=755=37U=75U575U=75U=75U-755=75U-35U=75U=75U=74U=75U5755=55
-MU=75U=35U=55U-75U=75U=75U575U-75U=75U=75U=75U=74U-355=34U=75
-MU=75U=155555U55555555=75U575U=75U=35U=75U=74U-35U575U-35U=75
-M5555U=75U5555=75U=75U=75U=75U=34U=345=75U]75U=75U=75U=75U=35
-M6F=G<'!!1531V'P[(#@P#!;SGH"TM;>WL+*]M[>]IZ>W&S4;B;NQ'3@E-VAX
-M`#0*&@4V)24(@;:=,2<Y8[>QGQH$3)WM:FV&O;^:-3T&MZ2Y[C4T:8"-E7SF
-M@8<6-C%CL+N)"3H]0;>VE@<!8^5B``>6L;#G,SL+C[NR6#8V$YN$]V/B@H80
-M,3!FL[J+##@SW+>VD!L;1.-I`@:3L[/@,SH*C+BS1C<W$)R<0V_JCX`=,S-B
-ML[J*##@ST;2TEQX2].T6#@"=LK+B,SH*C;FS6C0U%Y.79&^0B(,<,C)LL[J*
-M#3DP5+6UZQT5X.P="P.<O;WL,SH*@KFP6S4+:I'B:&Z?M8T?/3UNL[J*`CXQ
-M4XN(XA!FE>X8-0V?O+SN,SH*@[ZQ6@L.;93W$6F:MX\9/#QKL[J*`S\V78F,
-MY1=&DN@%-P^>O[_K,SH*@+^V6@X-9.A''FN$MHD9/SP5L[J*`#PW7(R#]VKT
-MF^H'-@Z9O[^5,SL+@;RW10P`<>UG!16&L(L8/S\4L[J+`#TT7(*'TF_BAY0!
-M,0B9OKZ4,SL+AK*T1P($7^%J!A2`LXH8/C\7L[N+`3(U4X&;0F"7@)<#,PN9
-MN;Z4,SL+A[.U0P$9P/H3`Q>"LK48/CX6L+N(!C`*5H>2?F6<C9$-,C68N;Z7
-M,#@(A+"(3`<0^?(9#!:,O+08.3X1L+B(!S$)U)KJ8'*:B9`//369N;F6,#D)
-MA;:.=1INX\H$"1".O[08.3X0L;B)!#8/W9_E:TJ&BI(./#29N;F1,3X.F+>-
-M=A]]E<0!"A*)OK<8.3X0L;F.!30"VI#2%D2#M)P(/S>9N+F0,3X/GK6`<Q#?
-MD=`"-1V(N;89.3X3MKZ/&S4!PI1\$E&,MYX+/C>>N+F0-C\,G(N'?Q7DG%`/
-M-Q^+N+89.3X2M[^-&0L$].UN&=*)L9@*.3:?N;F0-SP-DHZ;>FV5FUL)-AF*
-MN+$>.3X2M+V"'@\8\OH1!<2+L)LU.#:<N;Z3-S("DXV=9WB2A$,*,1NUN[$?
-M.3\2M+*`'`(3^,D>!\VULX4U.#&=N;Z0-#,`D8"48$.:@4@U,`6UNK$</C\2
-MM;.!$@$5YU,$`<NTLH0U.S&2OK^0-3`&EX?@;=B&@W4W,@2UNK`=/CP2B[&'
-M$`1GXW8!`O2VO8<U.S&3OK^0"C$'E)CU:?V#C'<V/0>UNK`2/SP2B;:%$1E!
-M[F0-#/>QO(8T.S&1O[R0"#<%ZI)!%>&/CG8Q/`>UNK`3/ST2C[29%Q/TZFP.
-M#O:QOX8T.C"6O+V1#C09Z)1G%^Z(BW8Q/`:UNK`1/#(3C+6=%!7BEQ4+"/:P
-MOH$T.C"4O+V6#`H=[N,5$92UM78P/P&UNK`6/3,0@HB6:F:7D!8U"O>SN8`U
-M.C&5O;.7#0X6[/<2$Y&WM'0S/@"UNK`7,C,1@(SH:$^?G1,W-?6RN(,U.S'K
-MLK"4`PUHXE\8')*VMW4R.0.UNK`4,S$6AH/F;L*%GAPV-,ZRN(,U.S'NL['J
-M`0!FX'@''I^QMDXR.0.UNK$5,#84A(?W;.>!FQDQ-\"]NX(U.S'ML;;I!P1T
-MX6\`&YBSL4`].`**N[%K,3<5FIM18NN"A1LP-MN]NX(*.#;CMK?M!1G<X1<-
-M!9JRL%H].`V+N+%I-C1IF9-R8Y&.AP4R,=*]NXT+.#;FM[7A&!#^YAT.!X6]
-MLUT].`V(N+9O-PIMG>IC8)^+A@0],%6]NXT+.3?DM(OZ'&[LYA@+!H2\LE0]
-M.PV)N;=L-`EFD.458)JU@`<\,UR]NHT(/C?ZBH[S$WR7X00U`(>_LM(].PV.
-MOK=B"@QXE-P38(>W@@<_,T2]NHT)/S3XB(+"%]*=X08W`X:^O=H].`R/O[1C
-M"`-WZ'(>8(&QC08_,DZ]NXT./#7_CX'7:^6:X`,V`H:YO,(].`R,O+5A#P9>
-MXFP%8X*PCP$^/7>]NXT,/0K]@H5`8NN'X@TP#(:YO/4].`V"O8MF`AK8Y!8&
-M8HRSC@$Y/7*]NXT-,@CS@)]R9).`[`\S#X&XO/$R.`V#LXEF`!WQ\A\#;(Z]
-MB0$Y/'ZRN(T",P[PAY9G<IB-[PDR"8:XO_TR.0V`L(]G!Q3DS`4,;XB\BP$X
-M/&6RN((#,0SPFNUM38>.Z`@]"(:XO_DR/@*&MHUG&F#LT`8.:8J_B@$X/&>S
-MN8(`-@+SG_%J5H"+Z@H\"X:[O^4S/@*'MX!G'TR56`,+:K6^M0$X//VNK*>\
-MBIO%$`8.-3`R/C\Y/S\R,S<U`@<08,KOG(6`C8Z(BHJUBHJ(B8^-@(:%F9*7
-M[^7)4'=E8FD5%Q$0$Q,3$Q,0$184%6AO8F%D>7-T0EA1UM[$PL[*]/3W]_?W
-M]/7*R<_"P<?;V=S3T=155U%04U)=7%]?7U]<7%U=4E-04%%65U=45=75U-?7
-MU];6UM;6UM;6UM'6UM;6U]?7U]34U-34U-34U-35U=75U=75U=74U=35U=75
-MU=75U=34U-34U-34U-34U-34U-34U-34U-35U=35U-74U-34U=75U=75U=75
-MU-34U-34U-75U=75U=74U-74U=34U=74U=75U-34U-34U-75U=75U=34U-34
-MU-75U=75U=75U=35U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=555=55U=55U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U575U=75U=35U=35U=75U=75U=75U=75U=75
-M5=55U=75U=75U=75U=75U=75U=74U=75U=75U=75U=75U=75U=75U=55U=75
-MU=74U=75U=755=75U=75U=75U=755=755=75U=75U=75U=75U=75U=75U-75
-MU=75U5555575U=75U=75U55555555=75U=75U=75U575U=75U=75U=75U=55
-MU=75U=75U=75U55555555575U=75U=75U575U=75U=75U=75U=75U=75U=75
-MU=75U=755555U575U=75U=75U575U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U/*1E>;EQM]-2WQY
-M965D9&5E>'YS=W5*05I35-/?VL?"S,G)R\O*R,C.S\W#P<?%V][?TM#6U%57
-M5E934E)=75Q=75U24U)34%!145%75U=55574U=34U-34U-34U-34U-34U=36
-MU%=55=75U=74U55555545%1555545=5555555555555555545-55U=75U-35
-MU-75U=75555555555=75555555555=75U=75U-75U=55U-;55E54U555U=75
-MU=75U=555555U55555555=75U=55U=555=37U=75U=755=755=75U=74U=35
-MU-34U-35U=55U=55555455555555U=75UM565515U=74U-35U=35U=75U=74
-MU=35U=75U=75U=75U=755=75U=34U-34U=75U=75U=755=75U=75U=75U575
-MU=75U=55U=75U=55U=71U%945%55U=74U=74U=34U=74U-75U=75U=75U=75
-MU=755575U-75U=755=7555555555U=55U=75U=75U-74U=75U575U575U=75
-MU=75U-;45U145575U=75U=75U=755=75U=75U=34U=74U-75U=755515U=75
-MU=75U=35U=55555555555575U575U575U=74U-74U-34U=74U=74T=145535
-M5=75U=75U=75U=55U=75U=75U=75U=75U575U=35U=?4U=75U555U5555515
-MU=75U=75U=755=75U=75U=755575U=75U=75U=36U%=45=35U=75U=355=75
-MU=34U=55U=75U=55U=755575U-55U=75U-34U=34U-34U-74U-75U5555=75
-MU=555=755=75U=75U=75U=55U=;55U54U575U=75U=35U=75U-75U=74U=35
-MU=75U=75U=35U=77U]74U=55U=5555555=75U=75U=34U=34U=34U-75U=75
-MU-75U=75U-75U-35U574U=74U-34U-75U=75U=75U=75U=75U=75U=75U=34
-M5575U=34U=75U=75U=75U=75U=75U=75U=555%75U=75U=75U-75U=75U=71
-MU%=55555U555U=75U=75U=74U=75U=75U=75U=75U=75U=75U]1555555=55
-M5=755=75U=5555555555U=75U-35U-75U=35U-75U=75U=;45U55U5755=75
-MU=75U=75U=5555555=75U=75U=35U=34U%75U=75U=75U=75U=75U-75U=35
-MU=75U=75U=74U-75U-75U575U575U574UM565%355=75U=75U=755=74U=75
-MU=75U=75U=75U=55U=55U=34U=55U=75U=755575U=74U=75U=75U=75U-75
-MU=75U=755=75U=75U=31U%=55-55U=35U-35U=75U=75U=75U=75U=55U555
-MU555U5545=75U-74U-755555U=75U=75U55555555%155%55U=75U575U=75
-MU=75U-;55E145555U=55U=75U575U=75U=75U=35U=55U55555755574U%55
-M5%555%555%755=55U=75U=75U=75U=35U=35U=755=755=75U=75UM165555
-MU=75U=55U575U=75U=74U575U=75U575U=555=755515U=75U=75U=34U=35
-MU=755=75U=75U=55U575U575U=75U=75U=75U=76U5=45%555=75U=75U=35
-MU-75U=75U=74U=75U=755=75U=74U]?5U55555555=75U=75U=75U=75U=75
-MU=75U=35U=75U=75U=75U=75U-;45U55U575U=74U=35U-34U=74U-74U=74
-MU=75U=34U=34U-54U=74U-34U-35U-35U=75U=75U=75U555U5555575U=55
-M5575U=75U574UM175535U=75U=74U-34U-35U-75U=75U=75U=75U-74U-35
-MU=34U=75U=75U-75U=35U-34U-34U=75U=75U=75U5555575U=75U=75U=36
-MU5=55-75U=75U=75U=74U-34U-35U=34U=35U=35U=75U=545-75U-34U-34
-MU-75U-75U=75U=75U=74U=55U=75U=75U=74U=75U=75U=;55E145575U=75
-MU=35U-34U-35U-75U=75U575U=55U575U=74U]35U=55555555555575U=74
-MU-77U-34U=34U=74U=75U=75U=75U=75UM5655355=75U-35U-74U-35U=75
-MU-35U=74U=35U-75U=755%35U=74U=74U-75U=75U=75U=75U=75U=75U=75
-MU=34U=75U=75U=75U=36U%=55=555=555555U=75U575U=75U575U=75U=75
-MU=75U575U-355575557555755=75U=35U-35U-35U=35U-35U=75U=75U-34
-MU-74U-'45U55U575U-34U-35U-75U=75U=75U=34U=75U=74U=74U-54U=75
-MU-34U-35U-35U=75U=75U5555=555555U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=55U=55U575U=75U=75U=75U=75U=755=37U=5555555=75U=55
-MU=75U-75U-74U-74U=75U=755575U575U=75U=75U5755575U=75U=35U=75
-MU=75U=74U=74U=75U=75U=75U=555-75U=34U-35U=75U=75U=75U=75U575
-MU575U555U=75U=75U=75U=75U=;55E54U=75U=74U=35U-34U=75U=34U=75
-MU=75U=35U=75U=74U]75U=75U575U5555555U=75U=75U=74U=74U=74U=75
-MU=75U=75U=75UM5755355=75U=75U575U=74U-34U-74U-75U=75U=75U=75
-M5535U=74U-34U-34U-74U5755=755=5555555555U=755=75U=75U=755=76
-MU5=45=75U-75U-75U=75U=75U=75U=75U=75U-74U=75U-75U-?4U%555555
-M5555U=555=755=75U=755=555555U=75U4!F9'!Q1EK4T=IL)"`_,0(5Y9F#
-MBK6QL;RRMHNWOJ&FMQ@T#9Z_OY<S)B0(E)\7,3X]"P8""@@?[)$3-C\*F+^Y
-MAPHY-I^XI+<4-0SAM;>`]$;KFY47`1.$L+#J-S@VD;ZX@`H[/6VTLX,?"@UF
-ME.-A%?Z!@LH.,`^;O[Z%-#HR_[R[B`8R-FF"BYMM'7GL^Q,#&9VVMNLT.3:6
-MOKN-"#L]8+>]CQ,*#V"3D5EIPX6`_0TQ#)^]OX4T.CW`O;N+!CTP%X*UA&T;
-M:OCG:P8>EK2WE34^-I6_NX\..SQNMK^($#0+:)V9\VQ$G(?Z`#<,D[*_A#4Z
-M/56]NHH'/#,3C;>`8P02QN-E&ASKBK27"#PV[KR[C@\[/Q6VOHH6-S46GX3L
-M8WB4A><'-`V6L[R'"SL]0KVZM00_,AR,MHUF`1I#[%D=$N..M98./3?@O;N)
-M##L_%K:YM!<V-Q*9@)9F;>>?X!L+`I6QO8<).#UPLKJT!3\\&(RPCGH#!F7I
-M\!40_H**D0TR-^6RNXD-.SX3MKBW%3$V&9B-GG@5WI'C'0X`[+:RA@\Y/7JR
-MI;<:/C\%C[.+<@T";NOB9A;"@8F0`S`T\+.XB`,[/ARVN[9H,3`%FXZ$<1!_
-MZ>T7`@'FM+.&#3XR8;.EMQ@^/P>/LK5(#P\6ZI=;%5V%C)`&,33-L+B+`#@^
-M&;>[L6TP,P>;BX%''&CE[6T!!O^*L($#/S)LL*6V'SX^`8^\MUT)"QV5G?)O
-M=IR#D`4W-="QN8L&.#X;M[JP9C,]`9NUC=`8$][M?`4$R8FQ@0$\,FBQNK8=
-M/CD`C[^VV0LU&Y6;[F9EE(>0&30*6;:^B@<Y.06WNK-[,SP"F[>.RP4;<>)1
-M'!K0C+>!!S(S%;:ZL1`^.`*,O['W"C<$ZH>0?6+FFY$3"@M)M+^*!3XY!+2Z
-MLW<S/PR;MHKY!P=BX_`7'EJ`M(8%,S,7MKJQ%SXX#(R^L_LU,0'K@)A$:-J2
-MEA0."7.UO(H8/SX'M;JR13,^#IBQM.`&`Q?AX&`2=(>*AADP,!:TN[!J/SL/
-MC;FRX#4P`NF"A]H4<Y67;`T/>(B]BA\\/@:UNKW3,CD(F;"WZ`$,'.>50Q9^
-MF(F''38Q$+6XL&P_.PZ"N;WI-#,/[X^#_1%OYY5[`0UGC[.*$ST^`8NZO,@S
-M.`J>L[&7``@:^Y#Q:623C806-S83BKBP83P["(.XO)0T/0GBB8S@$Q'9Z4,%
-M`&&"L(L6,C\`B+J\_S,X-9RRLY,#-0;SG.QG8.N!A6HU-Q*(N;!X/3L+@+B_
-MD30\"N&+B.H='G+MVQ\&8H&VB&HS/`".N[SF,SLTG;VRGP(T`\N;D75MY82;
-M8@@T'8Z_L'0].PJ!N+Z=-#\UY;6UD1P$;N?]%P5LA+>);#$\`XR[O^TS.S>3
-MO;V;`C8,WH29WF[9GYEZ#S4<C;RP6#([-8:XOIXT/C?]M+><'@$0_^%C&6^8
-MM8YG-CT#C;B_ZS`Z-I&\O(0",0E<AH?Y:'&7G70""QR#O;'2,S@UA[BYFS0Y
-M-LNWMIL>`AG)Z4X3;I*(CWTT,@.#N;^4,#HQE+R^A@(P"DJ`@.QK8N&04`8)
-M'(:SL<DP.#6%N+B$-#DQWK>PA!D/!-64]!5IE(R-3C4S`H&^OY$Q.C'KO+F`
-M`C(T?H.,EFH7QI3!&@P<A+"V_38Y-)NYN(<U.#!<MK*!&0@`3I'B9FGC@(-0
-M"#`#A[^_DS8Z,.^\N8("/3=FC8B<:AUR[_,=`QR8MK;E-SXTGKFX@34[,TJV
-MO8(9-0QXDI9,;O.$@=H/-@.%O+R<-SHPX;RXC`(\,6^,M9IK&V[DY10&'9VW
-MM^$T/S2=OKB`"CLR?[&\C!XT"6.?G\YO5)Z']0(W`YB]O)XT.S/[O+N.`SPP
-M%8^WAV@'$/7@8042EK6T[34\-)&_N(,+.SUGL;^)'S<U:YF$X6USEIK\`34`
-MG+.]F#0[,_&\NX@`/S,1CK:`;@$84^Q.'!/HB;7I"#TTE+RXC0@[/6VQOHL=
-M-C06FX&48&/CG_H%"P"0L+V:-3@SQ+VZB@$^,A*.L(UM`@=RZ<D7$>&,B^H/
-M,C7HO;B,#CL\:[&YM1(Q-A*%C9UG%<R0YQX.`92VLH4(.3-6O;JU!CX]'XFS
-MB6`,`V#JX&`7\X".E0TS->VRN(\/.S\4L;BT$#`Q'H6.FG@0=NO@$0T&Z;>S
-MA0X^,TVRNK0'/CP;B;*+9`X/%9643A7=A(R4`#$UY[.YC@TX/Q&QN[<6,S,%
-MA(N&<1QOY^-H`0?@M;"$##\SXZZLI[^UF\81!@XU,#(^/CD_/S(S-S4-!Q!C
-MR>R<A8"-CHF*BK6*BHB)CXV#AH28DI?OY<A1=V5C:147$1`3$Q,3$Q`1%A05
-M:&]B861Y<W1"6%'1WL3"SLOU]/?W]_?T]<K)S\+!Q-O>W-/1U]5745!375Q<
-M7U]?7%Q=75U24U!045975U15U=34U-?7U]?6UM;6UM;1T=;6UM;7U]?7U]?4
-MU-34U-35U=75U=75U=75U=75U=75U=75U=34U-34U-34U-74U-34U-34U-34
-MU-75U-74U-34U-35U-75U=75U=34U-34U-75U=75U=75U-34U-34U=75U=75
-MU=74U-75U=75U=75U=75U=35U-75U=75U=75U=34U-34U-35U=75U=75U-75
-MU=75U=75U=75U=75U=75U=75U=75U=75U-75U=75U=75U=75U=75U=75U555
-M5555U=75U=75U=755=55U575U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU-75U=75U=75U=75U=75U=75U=555=75U=75U=75U=75U=75U=75U=75U=75
-MU=55U=75U=75U=75U=5555555555U=75U=55555555555=75U575U=555555
-MU=75U=75U=75U=75U=75U=75U=35U=75U=75U=75U=75U=7555755575U=75
-MU=75U555U=75U=75U=75U=75U=75U=75U=75U=75U55555555=55U=555=55
-M5555U=75U=75U=75U=75U=75U-74U=35U=75U=75U=75U=75U=755555U575
-MU=75U=75U=75U=75U=?ZD.CA^\333G5^>61E9V1E>GA_<G9U3$1>4=33WL7&
-MPLS.R,O(R\O+R<S"P\;$VMG?W=/1U]555U914%)34EU24EU24E)34U!14596
-M5E=45-755=75U=75U-34U-34U-34U=35U=75U=75U=55557555555%545U14
-M55555=75U=75U-75U=755=755555555555755=75557555755=75U=555555
-M5=755=755=555=755=75U=75U=75U=74U=75U=75U=74U]35557555555555
-M555555555=755=75U=75U=55U=75U=75U=75557555155-55U=75U=75U=75
-MU=75U=75U=75U=75U=75U=55U=74U575U=34U-34U-35U-35U=75U=755555
-M5555U575U=75U=75U=35U=35U-?55=75U=75U=75U=75U=75U=75U=74U-75
-MU575U575U=555555U=35U575U=75U=75U=75U=75U=75U=74U-75U=34U=75
-MU=5555555=75U-55U575U=75U=35U=75U=755=755=75U=75U=74U=74U=75
-MU=545=75U=75U=35U=75U=75U=75U55555755555U=75U-75U-75U=75U=74
-MU5755=74U-755=755=555=755=75U=75U=55U=35U=75U=755=74U5555555
-M55755=55557555555=75U575U=74U=75U=75U575U=75U=3555555575U=75
-MU=755=75U=75U=755=75U=75U=75U=75U=755575U=34U-34U-74U-74U-74
-MU=75U=7555555555U=55U=75U=74U=75U-555=75U=75U=75U=75U=555=55
-MU=75U=75U57555555575U575U-75U5555=55U=75U=75U=75U=75U=34U=74
-MU=75U=75U=75U=75U=74U-75U=74U=34U-34U-35U=75U=75U575U5555575
-M5=7555755515U=74U=74U-34U=75U=555555U=55U=75U=75U575U=75U=75
-MU-75U=34U=75U-35U=75U=75U-74U=75U=74U-75U=75U575U=75U=75U=34
-MU=75U=755=75U=555=5555555575U=55U=75U=55U55555555=74U-75U=74
-MU-75U=75U=75U575U=75U=75U=35U=755=755=755=545=75U=75U=75U-34
-MU-75U=75U=755=55U=75U=75U=75U=75U=75U-74U535U=75U=35U=755=75
-MU-75U=75U=75U=75U=75U=55U=55U=74U]75U555U575U=75U=75U-75U=75
-MU=75U=7555555555555555755=755%155575U=75U=75U=75U=75U=35U=75
-MU=74U=75U-75U=755515U=74U-74U-75U=75U=75U5555555555555155555
-M5555U=755=75U=54555555555555U=7555555555555555555=55U=75U=75
-MU=75U]35U=755555U555557555755=75U=75U=75U=75U=75U575U=75U=74
-MU5555555U555U=75U-35U=75U=555555U555U=75U=75U=75U5145=75U=74
-MU=74U=75U=7555555575U=75U=75U=75U=75U=75U=75U-'45U545575U=75
-MU=75U=75U=55U=75U=75U=75U=755575U=75U=34U=555555U=75U=75U=35
-MU=75U=75U=75U=35U=75U=75U=75U=75UM5655155=75U=75U-74U-34U-74
-MU=75U575U=75U=555=7555545-75U-34U-35U=55U=75U=75U=75U=55U=55
-MU=75U=75U=74U=75U=76U5945%55U=75U=75U=75U5755=75U=74U=75U=75
-MU=75U=75U=74U]755=55U555U575U=75U=75U-35U-75U-74U-75U-74U-74
-MU=34U-;45U55U=74U-34U-75U-75U=75U=75U=75U=55U=55U=35U=755515
-MU=75U=75U-75U=75U-55U57555555555U5555=75U=75U=75U=75UM565535
-MU=75U=75U=75U=755=755=75U=75U=35U-75U=75U=75U]?4U=75U=75U=75
-MU=74U=74U=75U=75U=75U-74U=75U=75U=75U=36U%=45-75U=75U=34U-35
-MU-74U-35U=555=555=55U=755575U514U=74U-74U-75U=75U=75U=75U=75
-MU575U=75U=75U=75U=75U=75U-;45E54U=75U=75U=75U=55U=75U=75U=75
-MU555U575U=74U=75U=37U555555555555555U555U=75U=755=75U=34U=35
-MU=75U=755575UM565%=5U=75U-75U-34U-35U-75U-35U-755=74U=75U=75
-MU-155=75U-34U-34U-35U=755=75U=75U=75U=555555U=75U-34U-34U-31
-MU%=55=55U=755575U=75U575U555U=75U=75U-34U=35U=75U=74U-75U=75
-MU=75U555U5555=55U=75U=75U=74U=755=75U=75U=75U-;45U54U=75U=75
-MU=34U=34U-35U=755575U=75U=75U=555=75U555U-34U-34U-74U=75U=75
-MU=75557555555555U=7555555=755575UM575%355=555555U=75U=75U=34
-MU-15U=75U=75U=75U=75U575U=?5U575U5555=75U575U=75U=74U=75U=75
-MU=74U=75U=55U=75U=36U%=45%55U=75U-75U=755=75U=75U-35U-75U-75
-MU=35U-75U-54U=35U-34U-74U=75U=75U=75U=75U=75U=75U=74U-75U=74
-MU=74U-'45U55U=75U-75U=75U5555=55U575U=75U=75U-75U=74U-34U=37
-MU-75U=5555555575U=75U=74U=35U=35U=35U-34U-35U=75U=74T=175535
-MU=74U=75U=75U=75U=75U-75U-74U-35U=75U=55U=355=74U-34U-34U-34
-MU=75U=75U=555=755=555555U=75U=75U=75U=76U5955%55U=75U=75U=75
-MU=75U=74U-74U=74U=75U=75U=755=74U-355=75U=755=75U=75U=75U=55
-MU=75U-75U=75U=75U=75U=75U=355-55U=75U=74U-34U-74U=34U=34U-35
-MU=745=75U=75U=74U%55U-34U-35U=75U=75U=55U=755=7555555575U=75
-MU=75U575U575UM565%15U=75U=74U-75U=75U=74U=75U=755=75U=55U=75
-MU=55U-?5U=55U555U=75U=75U=75U=35U-35U=35U-5555755=75U=75U=31
-MU%=55-75U=34U-75U=75U=75U=35U-74U-75U-34U=34U=75U=54U=35U-75
-MU-75U-35U=75U=75U=75U=75U-75U=75U=75U=74U-34U-'75]55U=75U=35
-MU5555=75U=75U=35U=55U=75U=75U=75U=75U=77U-74U=75U=7555555=75
-MU=355555U=34U-35U=75U=35U=75U=34T=175535U=75U=75U=75U=74U-34
-MU=75U575U575U=75U=75U=755%74U-34U-34U=75U=75U=75U57555555555
-M5=55U=75U=555=555=76U5=55-75U=74U-75U=75U-75U=75U=7555555575
-M5=75U=755=74U]35U575U55555754']@?7-.1%/1W-PU(B0R"!)<G(>)B["]
-ML+6WL*:MO<P1E(^!<'2!M<8_(3[!BN`V.S(-#S`V;8Z&"R<Z:[:VX0<7E>(:
-M`)>^I8(U/1^TO8S6_H:9!3<$M:6P!3\V^X^89DZ'AAD\,O"_ON\Q,!R=ZQ5R
-M@K?I,3@"M+N*!#0%X_`8$(&]M0`[,I2\L/0#'_E0`P_BLK_A/3@$B[&>$F^7
-MY0TQ&K2ZM0\Y-)>+FF=;AX4%/3:<N+_',#%JA)!B7(VUQC,Y&K"[C`(W&N_\
-M'Q6#LHP).C&%O[9_#QCR60`#D+VR<C\Y$+>PDQD5Z,H--Q>QNXPU.`J8M9IB
-M3X6<!C(UAKN];STQ>H&=9M&"B&<R/VJ]N(<(-AF4YQ-AC;"'-#LT@KFW%`@:
-M_%P&!)N\L1`Y/WBQL.L$%N/6##5RL[B$-C@/@;>;:W.9EP,S#X^ZL!D\-MR"
-MGV??@XT1/3+1O[F=-#$=D^P7<(RQDC8[#HJXM1DU&N75!!F&O;0'.#W[LK'X
-M`1+D10T(_;*^EC,X`8^VGA9EDN(-,`:UNK<`/C?CCIEFWX"!&#TPE;F^YC$Q
-M%YGJ:UB/M^8P.0:WN(X!-!O@VAH1@[V(##LPD[RQ6P(<^TX"#)2]O,\\.1FU
-ML9(=8I;R##$<MKJ("#DUD(N98-2&F@<]-YJ[O'8S,6*$EFS<C+5",CX=L[B`
-M##<9Z?<>;HVR@PH[-X>^MV(/'OY(`P"?O+-L/CYKM[&4&&CJW@\W;["[@#0Y
-M"86UF6]>A)(#,@N#NK,6/39+@9-@PXV):#T\9;VXF@HV')?[$GJ/L)HW.PJ/
-MN;03"!G[3`$%A+RV&3@\7["QX`07[5H/-5&RN9DP.0*#M)\52ICJ#3,"B+JV
-M!#\W\(*=8<F"@AP],_F^N90W-A&2X!9,CK&4,3@-M;B(!348YUH''("\M0`[
-M,NZRML(!$.9T#`GCO;_L,CD$CK>2$7^=YP\P!+2ZM0T^-.B.G&'/@(8$/3:3
-MN+_),39KF.EJT(ZW]#,Y!;&XC0`T&>+5!1>-O8\).S&9O+9R`A+E<PT-D+R]
-M3#\^$K6VEAUFD<@.-A&QNX\*.0N<BY]BQ(:8`3TTA[N]8#,V9824;\^/BF4R
-M/Q>RN(8.-QSKPQECC[*!-#LT@+ZT:@\<^G,#!IJ\L!8Y/V:VMNX;;Y52#C=E
-ML[B'-CD,A[6<;M>$D0(R#HRZL!P]-U6!EF+VC(X6/3U&O+F<-3<3EO(2<XZP
-MGS8["8FYBAP('^5Q`!J&O+<$.#WTL+;^!!7L=0XU]+VYDS,Y`8*TDA5%F^\/
-M,P"*NK<!/S3DC9-@\XV#&#PP[[Z^[3<V%)WD%E.)MNTP.`"TN(X'"A_F2P<2
-M@KR*#3LPE[VV4P$6X7P/#NJ\O_\]/AN(MY$1=IS_#C`8M[J+#CXUEXZ28_&#
-MA`8\-IFXO%HP-F*8[17"B;11,CX>L+B#`C0<[5D%:HR]C0L[-H6_MV8"$.1[
-M#`*?O[)G/S\4M+:5'&61W`DV%;"[@C0Y"9F+DFWU@9\#/0J`N[(5,C=VA.MN
-M\(Z*;#T\;;*YA0DT$NK=&62.LH0W.S6-OK46#Q+E>P('A+^Q'3D\=[:VX1MC
-ME4P)-$^RN(4Q.0*&M9-HQ827##(,B;JQ&CPTS(&4;?Z/CQ(\,LR_OI$U-Q:1
-M]1U,B+"0,3@,BKF(&`@=Y'X`&("_M`8X,N>SML@':.]\"0KDO;Z5,CD'C+21
-M%%&;X`XS!K2ZM`,_->V-D6/XC(`%/#&7N;_^-C=HG?@1WHBV^C,Y![>YC`8*
-M'>%P!A&,O(@/.S&2O;=T`13@90X/D;^\TSP^'(NWE!!,G/0(,!RVNHD(/@N0
-MCI!B^8*%`#PWA;N]>#`W9)O@%?&(M'`]/A.SN88--1+O3P5OCKV#-3LTAK^T
-M;P(6YV<,`YN_LV@^/V^TM^P<?Y!="#9BL[N`-SX/FHB0;/*!G0T]"X*ZLQ`R
-M-UB'[FG[B8L4/#Q^O;F9"S01E5$8?XBRFS8["(^^BA,/$.1F#02&O[$;.#W7
-ML;?X&V:4<`@TW;VXGS`^`("UD6C+A^H.,@*+NK8$/#3]@95LY(Z,&3PSY+Z^
-MZS0W%9'&'5*+L)4P.`*UN8X%"!/G9`,?@K^U`SLSZ;.WT0=L[F4("^^\ON,R
-M/@6/M)<7WYKE"#,$M[JU#3\*ZX*78N>,@0<\,9*XO-LV-V*<\Q'(B[;,,CD:
-MMKF#``H3X'D&%X^\C@@[-IF]M'@!:N-A"0R=O[UW/S\0BK3H$%B?V@LQ$;&Z
-MC`H^"9V/EF+D@IH#/#2&N[)M,#1RF^04^8NU9CT_%;.YA`\U$>]V!&.(O8$T
-M.S6`O[45`A?F8P\`A+ZS$3D\9+>WX1]VD$\+-GBRNX<V/@V$B)9O^("0#ST)
-MC[JP'S(TW(?B:.:(B!`\/5F\OI(*-!>51!ATB[.?,3L.B;Z('`\6YV,-!8"^
-MM@0X,O:QM_0:EJVAN;>&X6D$#0LW,CT^/SD\/#`Q-0X&&&Q,XY::AH*,B8B*
-MBK6*BXF.C(*!AYN<D>OA\--,>6%O:A06$1`3$Q,3$!$6%Q1J:6U@9WI\=DE$
-M7=7=VL#,R/7T]_?W]_3URLC.S<#&Q=C?TM'7U51645!24EU<7U]?7UQ<75)3
-M4U!15E975%55U=34U];6UM;6UM;6UM;6UM;6UM;7U]?4U-34U-34U-34U-75
-MU=75U=75U=35U=35U-75U=34U-34U-34U-34U-34U-34U-34U-34U-35U-74
-MU=34U-34U-74U=75U=74U-34U-74U=75U-35U=34U-74U=75U=75U=75U-75
-MU=75U=75U=75U=34U-75U=75U=75U=74U=75U=75U=75U=75U=74U=75U=75
-MU=75U-74U-75U=75U=75U=75U=75U=75U555U=75U=75U=75U=55U=75U=75
-MU=75U=755=75U=75U=35U=75U=75U=75U=74U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=555=755=75U=75U=75U=75U=75U=34U-35U-75U=75
-MU=74U-75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=555555U=55U=75
-MU=7555755=75U=75U=75U=75U=75U=75U=75U=75555555555=755=55U555
-MU575U=75U=75U=75U=75U=75U=75U=75U5555555U=75U=75U=55U=75U=75
-MU=75U=75U=75U=75U=34U=35U=55U=75U=75U=75U=755575U=75U=75U=75
-MU=75U=;FD^[A_L77271Y>&1D9V1D>GA\<W=U341?4=33WL7&PLS)R,C+R\C(
-MSLS"P\;'VMG?W=#6U]545U914%!24E)=75)=4E)34U!045965E=45%555575
-MU-34U-?6U]34U=75U=74U=755575U57555555%54555555555=55U5555555
-M55555=55U575U=555=75U=75U=75555555555=75U=75U=75U5755%155=75
-MU=75U-74U=75U555555555555=755555U5555555U=55U=555555U=555=75
-M5=75U=75U=75U=55U555U575U=75U=755575U575U-5555555=555555U=75
-MU=75U=75U=35U=35U=75U5755=55U=74U-75U-75U=75U=75U-74U=34U=75
-MU=555575U=75U=74U=35U=34U5155=75U=74U-75U=75U=75U=75U=75U=55
-MU5555555U=75U=75U=75U=755=555=75U=75U=75U=75U=75U=74U=34U-34
-MU-35U=55U=55U=?4U=75U5555=555575U=75U-35U-35U=75U=75U=75U-75
-MU=75U-34U-7555755=555=75U=755=7555555=75U=55U=55555555555554
-M5=74U-34U]34U=35U=75U-75U=75U575U5555575U=35U=75U=75U=755=75
-MU=75U=75U=75U=75U=35U=75U=75U=755555U575U=75U=77U]75U=555555
-MU=75U=75U=75U=75U=74U=34U=75U=75U-35U=755=555=555575U=55U=75
-MU=75U-75U-75U=755575U=75U=75U=755535U=75U=75U5755=75U=75U555
-MU=755=755=75U=75U=755=75U5555555U=75U=75U=555=55U=75U=75U=75
-MU=35U-75U-75U-74U-34U]?4U=55555555755=555=75U=75U-35U-75U-75
-MU=75U-75U=34U=75U=75U=75U=74U-35U=55U555U=75U=755=75U=555555
-M5=755515U=75U-34U-34U-74U=755=75U=75U=55555555555555U=75U-75
-MU=555=55U=55U=55U5755575U575U=75U-74U-34U-75U555U=75U=?7U=55
-MU=555=75U=74U-75U-75U-75U555U5555=75U=75U=75U-355555U=75U=74
-MU=75U=74U=75U=75U=75U=34U=75U=755555U5545%55U=75U5555=555575
-MU=75U=75U=75U5755575U575U=75U=755=5555755=75U=34U=7555555555
-M55755=75U=34U-35U=75U=75U=74U]7555555=5555555555U=75U=75U=75
-MU=75U=75U=75U=75U=75U5755=555555U=35U-35U-355555U=75U-75U=75
-MU=75U=5555555%155=74U=34U=75U=75U=55555555755=5555155=555=75
-MU=75U=74U-34U=75U-75U5555554555555155=55U=75U=75U55555555555
-MU-35U=7555755=555=555555555555755=555555U=75U=75U=55U=555=75
-MU=55U=75U=34U-75U=75U575U-75U=75U=75U=755555U5545=35U=35U-34
-MU-34U-75U=55U=75U575U=555=75U=75U=35U=75U=75U=75U=75U=75U=75
-MU=75U=755=75U575U=75U=75U=75U=75U=37U=75U=555=555=75U=75U=75
-MU-75U=75U=35U=75U=75U555U575U=75U=75U-74U-34U-34U=75U=75U=75
-MU-75U=75U=75U=75U=155-75U=75U-75U=75U-75U-75U=555555U=75U=34
-MU-34U-75U=75U=75U-75U=75U=5555555=75U=74U=34U=34U-75U=75U=75
-MU=35U=74U]75U=755=755555U=75U=75U=75U=75U-74U-35U575U=75U575
-M5=755=75U-74U=35U-34U-75U=35U=35U=75U=75U=75U=75U=755575U-37
-MU-34U-34U-35U-75U=755=55555555555=75U=74U-34U-75U=75U=75U=34
-MU=35U=75U=75U=35U=75U=75U=75U-34U=75U=75U]?4U=75U=75U=75U=74
-MU=75U=75U=75U=34U=35U=75U=34U=75U=75U=75U=74U-34U-75U=75U=75
-MU-34U-35U=55U=75U-75U=75U5575%55U-74U-34U-34U=34U=75U555U575
-M5575U=35U=75U=35U-75U=75U=35U=75U555U575U=75U=75U=75U=75U=55
-M5555U=75U=75U=77U=755575U=5555555=75U=35U=75U=75U-34U575U555
-MU5555=75U=35U-75U=75U=75U575U=75U=74U=75U=75U=75U=75U-75U=15
-M5-75U=34U=74U=34U=34U=75U5555555U5555=55U=75U=75U=75U=75U=75
-MU=75U-75U575U=75U=75U=75U=555=75U=75U=34U=75U=74U]35U5555555
-MU=755=75U=75U-75U=74U=75U575U=75U=75U=75U=75U=75U=75U=35U=34
-MU=74U=75U=75U=75U555U=75U-35U=75U535U=74U-34U-34U-35U=75U=55
-MU=55U5755575U=75U=75U=75U575U575U=75U=75U=75U=75U=75U=75U=75
-M5=555575U=75U=55U555U=35555555555555U=75U=75U=75U=75U=74U=34
-MU=75U=75U=75U=755=75U=75U=75U=75U-75U=75U=35U-34U-35U=75U=55
-MU575U=55U=75U-34U-34U-34U-35U=75U=35U=35U=75U=75U=75U=74U-34
-MU-75U=75U=35U=75U=75U=74U-75U=75U=75U=75U=75U-75U-75U=34U575
-M55755=75U=75U=7555555575U=74U-?4U-755=755=75U=355=75U=75U=75
-MU=75U=75U=34U=755=55U=75U=75U=35U-35U=755575U=35U-34U-34U=75
-MU=7555555575U=755555U575U575U=75U=555=75U=75U=75U5555=75U=75
-MU575U=75U=75U=74U=345=755575U-75U=75U5755575U=35U=75U=555=35
-MU=35U=75U=75U575U=75U=75U=55U575U=74U-34U=34U-35U=75U=75U=75
-MU=35U=75U=75U555U=74U-34U-34U-75U=555575U=75U=75U5555=555=35
-MU=35U=55U=55U=75U-74U-75U575U=34U=35U=75U=75U=74U=75U5555555
-MU=?4U=75U575U=55U575U=755=75U=75U=75U=75U575U575U=75U-755=75
-MU=75U=75U=75U=34U=74U=75U=35U=35U=75U=75U=75U=54U=34U-34U=34
-MU-74U=75U=75U=75U=75U=75U=75U=755=75U=75U5755=55U=75U=75U-75
-MU=75U=75U=75U=7555555=75U=75U-74U=77U]74U=755=55555555555=75
-MU=75U=75U=75U-75U=75U=34U-34U=75U=75U=75U=74U=35U=75U555U=75
-MU=74U=75U5755=755=755%34U-77U-34U-75U=75U=75U=755=555=555=75
-MU=75U=34U=34U]35U-75U-75U-35U=75U=75U-74U=75U=75U=75U-74U-34
-MU-75U575U-35555555755=755=75U=75U-34U-35U-75U-75U=75U=75U=75
-MU575U=75U=74U=75U=75U-74U-75U=74U=75U=75U=75U=35U=74U555U-75
-MU-35U=35U=75U=75U=555=75U=75U=75U=75U=75U-75U=7555555=55U=75
-MU=75U5555=755=75U=75U=35U=75U=755=75U=75U=?7U=75U5555555U575
-MU=75U-35U=75U=75U=755575U=75U=75U-75U=75U=75U=75U=75U=75U=75
-MU=34U-34U-34U=75U=75U=75U=545=75U=35U=75U=75U=755=55U=75U575
-MU555U575U=75U=75U=75U5555=75U=75U=75U=75U=75U=75U=75U=555=55
-MU=35U=75U=34U=37U]7555755575U555U=755=555=55U=75U=34U-75U=75
-MU=75U=35U=75U=75U=55U5555=75U=75U-35U-35U-75U=75U=75U-35U=75
-M5535U=75U=34U-34U-74U575U575555555555=555=75U=35U=34U-35U=75
-MU-35U=75U=555=75U=75U=55U555U=55U=74U=74U=74U=74U]35U-75U=75
-MU=75U=75U=75U=74U=35U-34U]34U=7555755575U=75U=75U=34U=34U-74
-MU=74U=74U=75U=75U-34U=75U=755=75U555U=74U-34U-74U-34U=75U=75
-MU=75U=555=55U=75U=75U=75U=355555U5555575U=75U=75U=55U=75U=75
-MU=75U=74U=75U=75U=55U=34U=555=755=55U=55U=75U-75U-35U=75U-75
-MU=5555555575U=555=75U=75U=75U=75U=75U=75U-75U=75U=35U-34U-75
-MU=74U=555%75U=34U-34U-34U=75U=755=75U=75U=75U=74U-34U-75U=74
-MU-55U=75U=75U=755=75U=75U=34U=75U=75U=55U=75U=75U=75U=77U]34
-MU=7555755=75U=75U575U575U=55U=75U=75U=74U=75U=355555U=75U=75
-MU=75U=75U=75U=74U-34U-35U=75U=75U=75U=755574U-34U-34U-35U=75
-MU=555=7555555555U555U575U=75U=75U-55U=75U=75U=555=75U=75U-75
-MU=75U-75U=75U-34U-75U=74U=75U-?4U=74U=74U-74U575U5755=75U=35
-MU-34U=75U=555555U575U%75U=75U=75U=75U=74U-34U-34U-75U=75U=75
-MU=74U=74U=75U554U=75U-34U-35U-35U=75U=75U=75U=34U-75U=75U=35
-MU=34U=35U=75U=35U-34U=75U=75U=75U575U=55U=75U=75U=75U=75U=35
-MU=37U=75555555555=75U=75U=75U=75U=75U=35U=75U5555555U=55U=75
-MU=75U=75U=75U-74U-34U=74U=7555755=75U=75U-75U=555%55U=75U=75
-MU=74U=75U555U555U555U=55U=75U=55U=75U=74U575U=75U575U5555575
-MU=75U-34U=74U-35U=35U=35U=75U=34U=74U-75U=555=755=55U=75U575
-MU=75U575U=74U-35U=75U=75U=34U=75U=75U=755=755=75U=35U=75U=75
-MU=75U=75U-35U-75U=345535U=74U-34U-74U-34U-74U-75U=75U=75U=75
-MU=34U=75U=75U-555=74U=75U=75U=75U=75U=35U=35U=74U=75U=555555
-MU575U=75U-?4U5755575U=74U=755=75U=75U=75U-74U-35U=75U=75U=75
-MU575U=55U=75U=75U=75U=34U-34U]34U-75U=755=55U=75U575U5545=75
-MU-74U-34U-35U=75U5755=755=7555555575U=755=75U=75U=75U=755=55
-MU=75U=755575U=75U=75U=75U=74U-74U-75U=755=37U=75U=555=755=75
-MU=75U=755=75U=75U=75U=75U=75U=75U-75U575U=75U=75U-75U-75U=75
-MU=75U=75U=74U=74U=74U=75U=355-74U-34U-34U-75U=75U=75U=34U=75
-MU575U=75U-74U-74U-74U=755=75U=755%74U-?5U-=55=555-555=75U-55
-MU-34U=75U-35U=74UM75U5555555U575U=75U=75U=75U-34U-74U-74U535
-MU-755=7455555=75U=75U555U555U=75U=77U-35U=34U=75U=75U=55U=55
-M5515U=74U-?4U-35U-75U55555755=74U=75U555U=75U=75U=74U-34U-34
-MU=75U555U555U=75U=75U=75U=75U=75U=75U575U-74U-55U=34U555U=55
-M5555U=75U=75U=75U=75U=74U=75557555555=555555U=55U=75U=35U=34
-MU-35U-35U=75U=55U=75U-35U=55U57555545=75U]34U-34U=75U=75U=75
-MU=55U=7555555555U=74U=75U=34U=555=55U=75U=55U=75U=75U=75U=75
-MU=34U-34U-75U-55U=55U=77U-75U=55557555755575U=75U=74U-74U-35
-MU=75U=75U=75U=75U=755575U=75U=75U-34U=75U-75U=75U=75U=74U-34
-MU=35U=755%35U=34U-34U-34U=75U5555555U=75U=55U5755=75U=75U=75
-M5575U=75U=75U=75U=75U=755=75U5755575U575U=75U=75U=75U=74U]35
-MU=75U=75U=555=75U=55U=75U=55U=75U=75U=75U=75U=75U575U575U=75
-MU=75U=75U=75U=75U=75U=75U575U=75U=74U=34U%15U=75U=34U-34U-75
-MU=75U=75U=555575U=75U-34U-75U-75U-75U=75U=75U=755=755=75U=75
-MU=75U-75U=75U5555=75U=75U=35U-?4U=75U575U=75U=75U=755=555555
-MU=75U=75U=75U=75U=75U=755=75U=555555U=75U-34U-34U=75U=75U=75
-MU=75U=75U=55U=545-55U=35U-35U=34U-34U=75U=75U575U=75U=75U-34
-MU-75U=35U=755=75U=75U=75U=75U=75U=75U=35U=75U=75U=74U-75U=75
-MU=37U-75U=5555555555U=75U=75U=75U=75U=35U=755=75U=75U=75U=55
-MU=75U=75U-75U=75U=75U-75U575U=75U575U=75U-35U-345=75U=34U-34
-MU-74U=75U=75U=755555U=555555555555555575U=75U=75U-75U=75U=55
-M5575U-35U=75U-75U=75U=74U=34U-34U-75U]?4U555555555545=75U=75
-MU=75U=75U=74U=74U=75U=555555U=55U=55U=75U=75U=34U=75U=75U=75
-MU=75U=74U-75U=35U=75U575U-34U-35U-35U-34U-35U-34U=75U=75U=75
-MU-75U-74U-75U-75U=555575U=75U=34U-74U=355=755575U=74U-75U=75
-MU=55U=55U=?4U=75U57555555=555575U=35U=75U-75U=75U575U=74U-34
-MU=75U=75U575U=75U=75U-75U-75U=75U=75U=35U-35U=34U=75U=555=75
-MU=34U]34U=75U=755=75U=34U575U=75U=75U=75U=74U-74U=35U=35U=75
-M5=755=555555U=75U=75U=75U=75U=55U=75U=75U=77U]34U55555755555
-M5=55U=75U=75U575U=74U=75U=75U-75U575U=75U=75U575U=34U-35U-35
-MU=35U=34U-34U=74U=75U=75U-755574U-34U=34U-75U=75U=74U=74U=75
-MU=75U=75U=75U=75U=34U=75U=35U=75U=34U=75U5755=75U555U5555575
-MU-35U=75U=34U575U-?4U55555555555U=75U=75U=75U=35U=755=75U=75
-M5=75U=555=55U=55U=55U=74U-75U=75U-75U=75U=75U=75U-75U=75U=75
-MU515U=34U-35U=35U=75U-74U-35U=75U-75U=75U=75U=755=75U=75U=74
-MU=74U-75U575U=75U=75U=75U=755575U=75U=75U=75U=55U=34U=75U=55
-M5=55U=75U=75U=75U=755=55U=75U-55U=75U=55U575U=75U=75U-35U=74
-MU=75U575U=75U=75U=75U=75U-75U=34U=755-745=35U=35U=75U=75U-15
-MU=55U=7555555555U575U=755575U=75U555U=555=55U=75U=75U=75U=75
-MU=34U-75U=75U=755=74U-34U]35U-155555U555U575U=75U=75U=555=75
-MU=75U=74U=75U=555=74U=755=74U=75U=34U-75U=35U=55U=74U=75U=35
-MU=555=755515U=74U-75U=75U=75U=75U=75U575U=5555555575U=75U-35
-M5=75U=75U=75U=35U=75U=75U=555575U=75U=75U-35U-34U=75U555U=35
-M55755=5555555575U=75U=75U=75U=75U=34U=35U=55U=75U=755=555555
-MU=75U-75U=75U=75U=74U-35U=74U=75U-34U%75U554U=74U-34U=35U=75
-MU=75U=75U=555575U555U=75U-34U-75U-75U=75U=75U-75U=75U=75U=55
-MU555U=75U=75U=75U=75U=75U=35U=37U55555555555U=75U-74U=35U=75
-MU-35U=74U-34U=75U=75U=75U=75U=75U=75U=75U=74U-35U=74U-75U=75
-MU=75U=75U=35U=355=75U=34U-34U=75U=5555555575U=55U=34U-75U=75
-MU=5555555=75U=75U5755555U=74U-34U=75U=35U=75U=75U=74U-75U555
-M5574U%555=755=75U=555=55U=75U=75U=34U=34U-75U575U=75U=75U=75
-MU=75U=75U=75U=34U=75U=75U=75U-35U=75U=75U=75U=355575U=34U-34
-MU=34U575U=75U-75U=75U=5455545=75U=74U=34U-34U=75U=75U=75U=75
-M5=555=555575U=75U=74U-34U-34U=75U=75U=355=75U=75U=55U=755=75
-MU=75U=75U=75U=755=75U=75U=55U=75U=55U=755=74U-34U-35U-75U=55
-MU=34U-75U=755575U-74U-55U=75U-34U=34U-75U=35U=75U=55U=75U515
-M5=755=77U=74U=75U-35U-15U=75U555U=75U=34U%75U575U-75U-34U=75
-MU=555=555=77U-75U=75U=75555555555=75U=34U-75U-34U=55U=55U=75
-MU=75U=35U=75U555U=75U-75U-34U=755=75U=75U=34U-34U-55U=755%15
-MU=34U=34U=34U=75U=75U=75U=55U=75U=74U-75U=75U575U5755555U=55
-MU=75U=75U-74U-37U-75U=75U=75U=75U=75U=75U=74U]35U=75U=755575
-M5=75U=74U=75U=55U=75U-35U=75U5555=75U575U=75U-75U=34U=55U=75
-MU=74U=34U=75U=75U=35U=15U=75U515U=34U-35U-75U=34U-35U=555=75
-M5=55U5555575U=75U=75U=555=555=75U-35U=755555U=75U=35U=755575
-MU=555=74U-75U-35U=34U=5555155=555=75U-75U-34U-74U=34U=75U=75
-MU=75U=755=7555555=75U-34U-35U5555=75U=74U=34U-75U=75U=75U=75
-MU5545=75U-75U=35U-34U-74U=5555555575U=35U=75U=75U555U=74U-74
-MU=75U=75U-34U=555=75U=75U=75U=75U=75U=75U=55U=75U=77U]75U554
-M55155=75U=34U-35U-755575U=34U-34U=75U=74U-34U-34U=75U=75U=75
-MU=74U-75U-75U=75U=75U=34U=35U-3555755%35U=37U-34U-35U=755=75
-MU=75U=75555555555=55U=75U=75U=75U-55U-34U-75U=555575U=755555
-MU=34U-75U=74U=75U=75U575U-35U5755575U575U=74U=75U=75U=75U=75
-MU=75U=75U=75U-35U-75U=75U=75U=75U575U=75U=75U=75U-35U=75U=75
-MU=74U=35U554U=34U-34U-35U=35U=75U=75U=75U=75U=75U=34U-75U=34
-MU=55U=55U575U=74U-75U=75U=75U=74U575U=75U=75U=75U=75U555U=?4
-MU=75U55555545575U=74U=35U=75U-35U-34U-75U-75U=75U=75U=755575
-MU575U=74U-75U=75U=75U=34U-35U=35U=75U575U-545=35U-75U=35U-35
-MU=34U-35U-75U-75U=75U575U=74U=75U=75U5755=74U=74U-34U=55U555
-MU575U=75U=35U=34U=75U=55U=75U=74U%75U5545575U=75U=75U-74U=34
-MU-75U=75U=74U-34U=75U5555575U=75U=755=55557555555575U=75U=75
-MU=55U575U555U5755-74U-34U-34U=75U=75U=35U-35U=75U=55U575U=75
-MU=75U=74U=75U=75U=75U=75U=75U=75U=75U=75U=755575U=75U=74U575
-MU=75U-15U5555575U=75U=75U=75U=74U-75U=75U=55U=75U-75U=75U555
-M5555U=75U=75U=34U-75U=74U=34U-75U575U=75U=35U=35U515U=74U-34
-MU=74U=75U=34U=35U-755575U=75U=74U-35U=35U=75U-74U=75U-34U=75
-MU=555=75U5755=75U=35U=75U=75U=75U=55U=?7U=55555555555=75U=75
-MU=555575U=75U-74U=75U=55U=75U=755=75U=34U=35U=35U-75U=75U=75
-MU-35U=75U=555575U=75U=555=75U-35U-34U-75U=75U=75U=75U5555575
-MU575U=74U575U-34U-75U=755=75U=75U=75U=755=75U=75U=55U=75U=55
-MU=55U=75U=77U]75U=75557555555555U=75U=75U=75U-37U-75U=75U=75
-MU57555555555U=75U-74U-75U=75U=75U=35U-75U=75U=75U=75U=755574
-MU=34U=74U=75U=75U=74U=34U=75U=34U=75U-75U=75U-755=75U=74U-34
-MU=75U5755=555555U=75U=75U-35U-74U-75U=75U=75U-35U5555%15U=75
-MU=74U=34U-75U=75U=74U-35U=74U=75U=15U=74U-75U-75U=75U=34U-55
-MU575U=75U=75U575U=74U=755=555514U=74U-75U=75U=75U=75U=75U=74
-MU=34U=75U=75U-74U-34U-75U=75U-75U-75U555U555555555755=75U=34
-MU=34U=35U=75U=75U=34U=555555U5755555U=35U=75U-35U=75U=75U555
-MU555U575U=75U=75U=75U-34U-34U=75U=75U=755575U=74U-74U-34U=75
-MU=755-75U-34U-34U-34U=35U=55U=55U=55U%55U=75U575U575U=75U575
-M5=755=75U=75U=35U=75U=35U-34U-34U=75U=34U=35U=75U=74U]75U=55
-MU5555555U=75U=75U=75U575U=74U=755575U=75U-75U=75U=35U-75U-75
-MU-74U=35U=75U=75U=75U-35U=75U-75U=755535U=34U=34U=75U=75U=75
-MU=75U=75U575U=755=75U=75U-3555555555U=75U=35U=35U=75U-75U=75
-MU=75U-35U-34U-74U=75U-75U-34U=75U575U55555755575U=34U-74U-75
-MU-75U=34U-34U-35U=75U=75U=75U-35U-35U=75U=755=75U=75U=75U=75
-MU5755=75U555U=74U-74U-35U-34U-35U-35U555U5555555U5755=75U=34
-MU=75U=35U=35U-34U-35U=75U575U=75U=75U=75U-75U=75U=75U=74U=36
-MU-75555455555=75U=75U=75U-75U-74U-75U575U=555=755555U=75U555
-MU=75U=75U=35U=75U=75U=75U=75U=35U=75U-75U=745%75U=34U-34U=34
-MU=34U-75U=55555555555575U=75U=75U-75U=75U-75U-74U-75U=75U=75
-MU=75U=75U=75U=75U=755=755=75U=74U]35U=5555755575U=75U=75U=75
-MU=75U=75U=75U=75U=74U55555555=55U=75U-34U=75U=75U=75U=75U=75
-MU=75U=35U=75U=75U515U-74U=75U-34U=75U=34U=75U555U5555555U=75
-MU=75U=7555555=75U=74U=74U=755555U=75U=75U=75U=75U=75U=75U575
-MU=75U-?4U=75U555U=75U575U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U-34U-35U-75U-74U-74U=75U=545-75U=34
-MU-35U=75U=75U=75U=75U=75U=75U=75U=75U=75U5555555U575U=555555
-M55555=75U=75U=75U=75U=75U=75U=75U=75U=37U-5555555=555=75U-35
-MU-34U-35U=35U-34U-34U=75U=35U=35U-75U-74U-755=75U=75U=75U=75
-MU5555=755=75U=755=75U=355=74U=35U=75U-34U-75U=75U=75U=75U=75
-MU-75U=75U=75U-35U=75U=75U-75U=755555U=75U=75U=75U=75U=75U=75
-MU=35U-35U=75U-35U5555555U575U=75U=75U575U=75U=75U=75U=75U=74
-MU575U=755=75U=74U=34U=34U=75U=75U=75U=75U=75U=75U-35U=74U515
-MU=74U-34U-74U=75U=75U=75U=75U=7555555575U=75U=355=75U=75U=75
-MU-34U-74U=35U=75U=75U=55U=75U555U=75U575U=75U-?4U=75U575U=55
-MU=75U=75U5755=75U=74U=75U=75U=75U=5555555555U=75U=75U=35U-34
-MU-75U-75U=75U=75U=75U=75U575U=545-75U=34U-34U=35U=75U=75U=75
-MU=75555555555=75U=74U=5555755=555=55U=75U575U575U=75U555U555
-MU=75U=74U=75U=75U=77U-7555755=55U=755=55U=75U=34U-34U-35U=55
-M5=55U=35U=75U=75U=75U=75U=75U-75U-75U=75U=75U=75U-35U=74U-75
-MU=555%75U=34U-34U-34U=75U=55U=75U=55U=55U=75U=55U=75U-75U=75
-MU=75U=55U=755555U5755=755=75U=34U-34U-34U-34U-34U-74U]?4U-75
-M5555U=75U=35U-75U=75U=55U=74U-34U-75U=75U575U=75U=75U=74U=34
-MU-74U=755=755=75U-34U-35U=55U=75U=75U575U-34U-34U-75U=35U=75
-MU=75U=75U=7555545555U=74U-?4U=75U=75U=74U=34U=34U-35U=75U=75
-MU=35U=34U-75U=75U575U=55U=34U=55U55555555555U=75U575U=75U=74
-MU=75U=75U=75U=555575U=75U=755=555=75U=75U=35U-75U=75U=75U=75
-MU=75U-35U=55U=34U-35U-75U=75U=75U575U=75U=75U=75U=75U=34U-34
-MU=75U=75U=75U=75U=75U=55U=55U=75U=75U=35U=555=75U=75U=75U=37
-MU]75U=555=75557555755=75U=75U=74U-34U=555=75U=755=55U=75U=75
-M5=75U=74U-35U-75U-75U=75U-75U-75U=75U=74U=755%74U=34U-74U=75
-MU=75U=755=75U=75U=75U=5555555=75U=55U=75U=75U=555555U=75U=55
-MU=555575U57555755=75U57555755=75U-35U=55557555555555U575U=75
-MU=35U=75U=75U=755=75U=75U55555555=75U=74U-34U-35U=75U=75U=75
-MU=75U=755=755575U555U=34U-35U-35U=755=755=75U=75555555555=75
-MU=75U-34U=75U=74U=75U-34U-74U=74U-75U=34U=35U=75U=75U=75U=55
-MU=55U=?4U=55U5555555U=55U575U=75U=75U=75U=75U=75U=75U=75U=75
-M5=555=755=75U=75U=74U=75U=75U=75U=75U=35U=75U=75U-145=75U-34
-MU-74U-35U=755575U=75U=74U=75U=75U=34U=74U=74U=75U=75U=75U=75
-MU=75U=75U=55U555U=55U=75U=74U=35U-34U=77U]7555555555U=755=75
-MU=75U=74U=34U=34U=75U=75U=355=75U=75U=75U=75U575U=75U=34U-75
-MU=75U=75U=75U=75U-75U=345574U=34U=34U-34U=34U-75U=75U=75U=75
-MU=75U=34U-35U-355=75U=75U-35U-35U-75U=55U=75U575U575U575U=75
-MU=74U=74U=74U-?5U=55551555555=75U=75U=75U=75U-74U-75U=75U=75
-M55155555U=74U-74U=34U-35U=75U=755=75U=75U=55U=75U=75U=75U557
-M5=75U=74U-75U=75U575U=75U=75U5555555U=75U-74U-34U=75U=74U-75
-MU=75U=74U=35U=35U=75U=74U-74U-35U=75U=75U5555=34U=555=555=55
-MU=75U=74U=34U-74U-75U=75U=75U-74U-35U=75U=75U=75U=75U=75U=75
-MU=35U=75U=755=75U=35U-34U-35U=555-75U-34U-34U-35U=75U=555575
-MU5755=755555U5555=75U575U=75U=75U=7555555=55U=75U=75U=55U=55
-MU=75U575U=55U=75U=74U]75U=75U=74U=75U=75U5755575U=75U-34U=75
-M5555U=755=75U=755575U=75U=75U=55U=75U=75U=75U=75U=75U=75U=75
-MU-355575U=34U-34U-75U=34U-74U=75U=75U=75U=75U=75U=74U-35U=75
-MU=75U=75U=75U-74U-75U=755575U=75U=34U-35U=75U=75U=75U-?4U=75
-MU5755%555555U=75U-34U-35U=75U=75U=75U=75U=75U=75U=75U575U=74
-MU=34U-34U-75U=75U=74U=75U-75U=755555U=545=75U-34U-34U=75U=55
-MU=55U=75U=75U=555555U=75U=74U=75U=75U575U=74U=75U=75U=755=75
-M5=755=75U=34U-75U=75U=755=37U=75555555555555U=74U-34U-34U-75
-MU-34U-75U=75U=55U575U=75U=75U=74U=34U-75U=75U=75U=75U=75U=55
-M5=75U=35U-355=75U-35U-35U-35U-75U=75U=75U575U=75U=74U=75U575
-MU5755=74U=34U=75U=75U=75U=75U=34U-75U=75U5555=75U=74U=74U-74
-MU]355=75U=75U=75U=75U=75U=75U575U=74U-75U=75U=555=55U=35U=75
-MU=75U=75U-74U=75U=75U=34U=75U=75U=75U=74U-34U535U=74U=74U-34
-MU=75U=75U=75U=75U=7555555=755575U=75U5755575U=75U=75U=35U=75
-MU=55U555U575U=75U=75U-75U=75U-35U-?4U=755575U=755=755=55U=75
-MU=75U=35U-35U=75U=35U=75U=75U=555575U=75U=75U=75U=75U=35U=75
-MU=75U=34U=74U-75U5545-75U-34U-34U-34U-75U=7555555=755555U=75
-MU=75U=75U=75U=75U-74U-74U=75U5555=75U=75U-74U=34U=75U=75U=75
-MU=35U=37U=5555555=555=55U=75U=75U=75U=75U-74U-75U=75U5555555
-M5=75U575U=74U=34U-34U-75U=35U=35U=755=75U=75U=75U=755-75U-35
-MU-34U-75U=75U=75U=75U=75U-75U=75U-34U-75U=75U=75U=75U=75U=75
-MU=755=75U=75U=75U-35U=75U=75U=75U=75U=74U]35U5555575U555U=75
-MU=75U=75U=75U=75U575U=75U=75U=75U=75U=55U=75U=75U-35U=55U=75
-MU=75U=755575U=75U=75U=75U535U-74U-75U-74U=75U55555755=55U=75
-MU=755=75U555U=755575U=75U=75U=75U=55U=75U=75U=75U=75U575U=75
-MU-35U=74U-35U-?4U=55U5755555U=755=75U=75U=74U-34U-34U-35U575
-MU=75U=75U=75U=75U=75U=75U575U=75U=75U=75U=74U-35U=75U=75U=15
-M5=75U=34U-74U-35U=75U=75U=75U575U=55U575U=755=75U=75U=75U=75
-MU=75U=75U5555=555=75U=75U=75U=75U=75U=75U=555=74U-5555545555
-MU=75U=75U=74U=75U=75U=75U=75U=75U555U=75U=75U=75U=75U=75U=75
-MU=75U=74U=34U=75U=75U=34U=75U=555%75U=34U-74U-75U=75U=755=75
-M5555U=555575U=75U=75U-74U-34U-34U=74U575U=75U=75U=75U=75U=75
-MU=75U=35U=75U=75U575U-155=555=75U=75U=75U=75U-75U-35U=34U-35
-MU=7555755=75U=75U=755=75U=75U=75U=74U-34U-34U-75U=75U=35U-34
-MU=75U515U-75U-74U-74U-74U=75U=755575U=755=755=75U=75U=75U=75
-MU=75U=55U=75U=55U575U=75U=75U=75U575U=75U=75U=75U=75U-?7U=75
-MU575U5755575U=75U=75U=755=75U=75U=75U=75U=55U=75U=75U=75U=75
-MU=75U=75U-75U=75U=75U=75U=75U=75U=75U=555=75U-75U-34U-34U=75
-MU=75U=75U55555555555U=75U-34U-35U=75U=35U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=74U-7555555=75U=75U=75U=75U=75U=75
-MU=34U=555=75U=55U575U=75U=75U=74U=75U=35U-74U-75U=75U=755575
-M5=75U=75U=345535U=34U=34U-74U-34U=34U=75U=35U=75U=75U=75U=75
-MU=75U=74U=75U-74U=35U=75U575U575U=75U=75U=74U=75U=75U=74U=75
-MU-35U55555555=75U=75U=75U-35U=75U=75U-75U575U=75U=75U=75U=75
-MU575U=74U=75U=75U=75U=75U=75U=75U=75U=75U=75U555U-74U-34U-35
-MU=75U=55U555U=75U=75U575U=755575U=75U=75U=75U575U=755=755=75
-MU=75U=75U=75U=75U=75U=35U=75U=755=34U=75U575U=75U=7555755=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=34U-35U=55U555
-MU=75U=75U=34U=75U=155=75U=34U-34U=75U=75U=75U=75U=74U=35U=35
-MU=35U=75U=75U=35U-35U-34U=755=555=75U=75U=75U=75U=55U=75U=34
-MU-34U-37U]55555555555=75U=74U=75U=75U=75U-34U-75U=75U=55U=75
-MU=75U=75U=75U=75U=74U=75U=75U=74U-34U=755=75U=75U=74U535U=74
-MU=74U-34U-75U=75U=7555555555U555U=75U=75U5555=75U=75U-74U=75
-MU5755575U=7444%64TQ37-34TM_>V-C8V=G?W]+2T]S>45C81%#&6]907515
-M1E344=9`T-13UE-7WUE6TE_?T%/25]#04]?65MW75=95UM965-15U]76T]54
-MUU96TE35UU'6U5=45=745%#7U%165M?5U=?5U-!6T]57TU/7UU+25%?15M'6
-M4M?7U=96U]74U=54UM75U5;45]?7U==7U57545365-=6U=17U5775=;45=55
-MU%=5U5365%755M95U-16UE755%575==1UN2AHZ4J*BXA.30%6Y*#B[>QL+.S
-ML["VM[6(C(&%G97DW'-B%!`<&!H%!`0$!`0%&A@>'1,6%&EB9W]T1%39S/?R
-M_OOEY.?GY^3DY?KY__+P]\H)(*NFL)P=-3T[)"8F(28F)R4[/S(V"P,;%4+G
-MD9N&@H^(B[6UM;6*BXB.C(*!AYJ>DY3LY/?307-E86UN:VH5%106$1`0$184
-M%6EM87IR2%O4V\_W\O[[Y>3DY^?DY.7[^?SR\?3(PL39T]=74U];149`0TU-
-M34Q-34)#0$%'1%I;6%Y?75-045975%75U=34U-34U-35U=5555555%145U=7
-M5E965E965E9645965E9645965E975E975U=75U=75%145%145%145%145%14
-M5%145%145%145%145%145%=45%175%145%155%1455155%55555555555555
-M5%555555555455555%555555555555555555555555555555555555555555
-M55555%5555555555555555555555555555755=55U=75U=75U=75U=755=75
-M55755=555=5555555=75U=75U=75U=55U=75U=75U=75U=75U=75U=75U575
-MU=75U=75U=75U=75U=75U=75U=55U55555755575U555U=75U=75U=55U575
-MU=75U575U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=74U-75U-35U-34U-75U-75U=75U=75U5755=555=555555
-M5555555555555575U555U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=55U=75U=75U=75U=75U=75U=75U=75U=75U=75U=55U=75U575U=755=75
-MU=755=75U5755=75U=755=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U-75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U-75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=31T=?45=755%165E=45%15
-M5=75U=74U-74U-34U-34U=34U-75U=55U=74U-745%74U%;5E[2U@(25Y'9@
-M%A(9&P4%!1H8&1P2%A5O87YU4M[U_>7FX^WO[NGIZ>[O[.WCX>?E^?WVRL+:
-MW==67%M'0TU.24A+2TA(3D],0D!&1%M97UU345=5U=36UM'0T]/3T]/3T-#0
-MT=;6U]?7U-7555545%145U=75E=75E=75U=75U=75U175%145%1555555555
-M55555555555555555555555555555555555555555555555555555555U555
-M5=555=55555555555555U5555555557555755555557555555555U575U=75
-M5=75U=75U=75U=75U=75U=75U=55U=75U575U555U5755=55U555U575U=55
-MU=75U575U=75U=755555U555U575U=75U=75U=55U5755=555=755=55U=75
-MU=55U=75U575U575U=755=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U555U555U555U575U=55U575U=75U575U=75U=755=75
-M5=55U=55U575U=75U=75U=75U=75U=75U=35U-75U-75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=74U=35U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=35U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U575U=75U=755=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=755=755=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=55U=75U5755=55U=55U=75U=75U575
-MU=75U=55U=55U575U=75U=55U=75U=55U=75U=75U=75U=75U=75U=75U=75
-M5=75U=75U=75U=75U575U5755=75U=75U=75U=75U=75U=75U575U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=35U=75U=75U=55U=55U=755=75U=75U=75U=75U=55U=75U=75U=75U=75
-MU=75U=75U=75U=55U575U57555755=55U555U5755=55U555U555U575U575
-M557555755=555=555=555=55U57555755555U5755=555=5555555=555575
-M5555U555555555555=555=55U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=755=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=755=755=75U575U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=55U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U575U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75U=75
-MU=75U=75U=75U=75U575U=75U575U=75U=755=75U=75U575U=75U575U=75
-MU=75U=75U=75U=75U=75U=75U=75U=7_____________________________
-M__________________________________________________________]5
-M555555555555555555555555555555555555555555555555555555555555
-M55555555555555555555555553HX,@L1DHJ]N+JXO8J2$0LR.#HX/34<E(BR
-MN+J[O+29:PDS.3H[/#0:[8ZSN;J[O+>%9@PP.3H[/S<'_HVPN;J[O[:&=`(Q
-M/CH[/C8!V8.QOKJZOK&#W`$V/CLZ/C$"2H:VO[NZN;"-_P<W/SLZ.3`,9X2W
-MO+NZN;./[1HT/#LZ.3,):)FTO+NZN+*(E!\U/3@Z.#(+$9*UO;BZN+V*DQ$+
-M,C@Z.#TU')>(LKBZN[RTF6L),SDZ.SPT&^R.L[FZN[RWA6$/,SDZ.S\W!/B-
-ML+FZN[^VAG<",#XZ.S\V`=J#L;ZZNKZQ@-,`,3X[.CXQ`DF&MK^[NKZPC?T'
-M-S\[.CDP#&2$M[^[NKFSC^(:-#P[.CDS"6F8M+R[NKBRB)0?-3TX.C@R"Q:2
-MM;VXNKB]BI,0"C(X.C@]-1R7B+*XNKN\M9YJ"3(X.CL\-!OOCK.YNKN\MX5A
-M#S,Y.CL_-P3ZC+"YNKN_MH9Q`C`^.CL_-@''@[&^NKJ^L8#6`#$^.CH^,0-,
-MAK:_N[J^L(WR!S8_.SHY,`QDA+>_N[JYLX_C!30\.SHY,PYNF+2\N[JXLHB5
-M'S4].#HX,@L6G;6]N+JXO8J0$`H].#HX/34=EXNRN+J[O;6>%0DR.#H[/#08
-M[HZSN;J[O+>%8`\S.3H[/S<$Y8RPN;J[O[:'<`(P/CH[/S8!P(.QOKJZOK&`
-MU0`Q/CHZ/C$#0(&VO[NZOK""\`<V/SLZ.3`,982WO[NZN;./X`4W/#LZ.3,.
-M;IBTO+NZN+*)E1XU/3LZ.#(+%YVUO;BZN+V*D!`*/3@Z.#TU'9:+LKBZN+VU
-MGQ4(,C@Z.SPT&.Z.L[FZN[RTA6,/,SDZ.S\W!.2,L+FZN[^VAW(-,#XZ.S\V
-M!LR#L;ZZNKZQ@%8`,3XZ.CXQ`T>!MK^[NKZP@O$&-C\[.CDP#'J$M[^[NKFS
-MC^$%-SP[.CDS#F^;M+R[NKBRB>H>-3P[.C@R"!><M;VXNKBRBI`3"CTX.C@]
-M-1*6B[*XNKB]M9\4"#(X.CL\-!CIB;.YNKN\M)IB#S,Y.CL_-P3DC+"YNKN_
-MMX=]#3`^.CL_-@;)@K&^NKN^L8!3`#$^.CH^,0-:@;:_N[J^L(+W!C8_.SHY
-M,`UXA+>_N[JYLX_A!3<\.SHY,PYLF[2\N[JYLXGK&30\.SHX,@@7G+6]N+JX
-MLHN1$PH].#HX/342D8NRN+JXO;6?%`@R.#H[/#09Z(FSN;J[O+2:;0\S.3H[
-M/#<$YXRPN;J[O[>'?PTP.3H[/S8&RH*QOKJ[OK:!7`,Q/CHZ/C$#68&VOKNZ
-MOK&"]`8V/SLZ.3`-?H>WO[NZN;",Y@4W/#LZ.3,.;9JTO+NZN;.)ZQDT/#LZ
-M.#((%)RUO;BZN+*+D1(*/3@Z.#T*$I&+LKBZN+VUG!0(,C@Z.SPT&>N)L[FZ
-MN[RTFFT.,SDZ.SPW!>:,L+FZN[^WAWX-,#DZ.S\V!O2"L;ZZN[ZV@5D#,3XZ
-M.CXQ`UR!MKZ[NKZQ@LH&-C\[.CDP#7^'M[^[NKFPC.<$-SP[.CDS#VV:M+R[
-MNKFSB>@9-#P[.C@R"!2?M;VXNKBRBY$2-3TX.C@]"A.1B[*XNKB]M9P7"#(X
-M.CL\-!GKB;.YNKN\M)ML#C,Y.CL\-P7AC[.YNKN_MX1X#3`Y.CL_-@;W@K"^
-MNKN_MH%:`S$^.CH^,0!3@+&^N[J^L8+)!C8_.SH^,`U]A[>_N[JYL(SD!#<_
-M.SHY,P]BFK2\N[JYLXGI&#0\.SHX,@@4G[6]N+JXLHN6$C4].#HX/0H3D(JR
-MN+JXO;6<%P@R.#H[/#4>ZHFRN+J[O+2;;PXS.3H[/#<%X8^SN;J[O[>$>@PP
-M.3H[/S8&\8*POKJ[NU555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-M555555555555555555555555555555555555555555555555555555555555
-755555555555555555555555555555555
-`
-end
diff --git a/usr.sbin/i4b/g711conv/Makefile b/usr.sbin/i4b/g711conv/Makefile
deleted file mode 100644
index f24d6e8..0000000
--- a/usr.sbin/i4b/g711conv/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-#---------------------------------------------------------------------------
-#
-# $FreeBSD$
-#
-# last edit-date: [Thu May 20 11:58:43 1999]
-#
-#---------------------------------------------------------------------------
-
-PROG= g711conv
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/g711conv/g711conv.1 b/usr.sbin/i4b/g711conv/g711conv.1
deleted file mode 100644
index 1a7b328..0000000
--- a/usr.sbin/i4b/g711conv/g711conv.1
+++ /dev/null
@@ -1,93 +0,0 @@
-.\"
-.\" Copyright (c) 1999 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.
-.\"
-.\" $Id: g711conv.1,v 1.3 1999/12/13 22:11:55 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Mon Dec 13 22:54:33 1999]
-.\"
-.Dd March 15, 1999
-.Dt G711CONV 1
-.Os
-.Sh NAME
-.Nm g711conv
-.Nd conversions according to G.711
-.Sh SYNOPSIS
-.Nm
-.Op Fl a
-.Op Fl u
-.Op Fl P
-.Op Fl A
-.Op Fl R
-.Sh DESCRIPTION
-The
-.Nm
-utility
-is part of the isdn4bsd package and is used to convert between the A-Law and
-u-law formats as specified in ITU G.711.
-It is based on a freely available
-and freely usable reference implementation done by Sun Microsystems, Inc.
-.Pp
-The following options are available:
-.Bl -tag -width Ds
-.It Fl a
-Convert A-law to u-law
-.It Fl u
-Convert u-law to A-law
-.It Fl r
-Reverse bits before conversion
-.It Fl R
-Reverse bits after conversion
-.It Fl P
-Print the resulting conversion tables (as C-source) to stdout instead of
-doing the actual conversion.
-.El
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-g711conv -P -a
-.Ed
-.Pp
-prints out the A-law to u-law conversion table as C-source to stdout.
-.Pp
-The command:
-.Bd -literal -offset indent
-cat max_headroom.ul | g711conv -u -R > /dev/i4btel0
-.Ed
-.Pp
-converts the u-law coded voice of Max Headroom to A-law, reverses the
-bits of the result and moves that to an active isdn4bsd telephone connection.
-.Sh STANDARDS
-A-Law and u-Law conversions are specified in ITU Recommendation G.711.
-.Pp
-The reference implementation done by Sun Microsystems, Inc.\& is available
-from http://www.itu.int/itudoc/itu-t/rec/g/g700-799/refimpl.txt
-.Sh AUTHORS
-The
-.Nm
-utility and this manpage were written by
-.An Hellmuth Michaelis Aq hm@kts.org
-based on the G.711 conversion reference code written by Sun Microsystems,
-Inc.\& and code contributed to isdn4bsd by Stefan Bethke.
diff --git a/usr.sbin/i4b/g711conv/g711conv.c b/usr.sbin/i4b/g711conv/g711conv.c
deleted file mode 100644
index f158a9d..0000000
--- a/usr.sbin/i4b/g711conv/g711conv.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Copyright (c) 1999 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.
- *
- * ---
- *
- * The A-law to u-law and u-law to A-law conversion routines and tables
- * were taken from the G.711 reference implementation from Sun and freely
- * available as http://www.itu.int/itudoc/itu-t/rec/g/g700-799/refimpl.txt.
- *
- * Therefore for that part of the code, the following restrictions apply:
- *
- *
- * This source code is a product of Sun Microsystems, Inc. and is provided
- * for unrestricted use. Users may copy or modify this source code without
- * charge.
- *
- * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING
- * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun source code is provided with no support and without any obligation on
- * the part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- *
- * ---
- *
- * The bitreverse table was contributed by Stefan Bethke.
- *
- *---------------------------------------------------------------------------
- *
- * A-law / u-law conversions as specified in G.711
- * -----------------------------------------------
- *
- * last edit-date: [Mon Dec 13 21:44:01 1999]
- *
- * $Id: g711conv.c,v 1.5 1999/12/13 21:25:24 hm Exp $
- *
- * $FreeBSD$
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <i4b/i4b_ioctl.h>
-
-/* copy from CCITT G.711 specifications */
-
-/* u- to A-law conversions */
-
-unsigned char _u2a[128] = {
- 1, 1, 2, 2, 3, 3, 4, 4,
- 5, 5, 6, 6, 7, 7, 8, 8,
- 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 27, 29, 31, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44,
- 46, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62,
- 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79,
- 81, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, 91, 92, 93, 94, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 127, 128
-};
-
-/* A- to u-law conversions */
-
-unsigned char _a2u[128] = {
- 1, 3, 5, 7, 9, 11, 13, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 32, 33, 33, 34, 34, 35, 35,
- 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 48, 49, 49,
- 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 64,
- 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 79,
- 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 127
-};
-
-/* reverse bits (7->0, 6->1, 5->2 etc) for tx to / rx from ISDN */
-
-unsigned char bitreverse[256] = {
- 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
- 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
- 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
- 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
- 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
- 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
- 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
- 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
- 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
- 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
- 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
- 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
- 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
- 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
- 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
- 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
-};
-
-/* A-law to u-law conversion */
-
-unsigned char alaw2ulaw(unsigned char aval)
-{
- aval &= 0xff;
- return ((aval & 0x80) ? (0xFF ^ _a2u[aval ^ 0xD5]) :
- (0x7F ^ _a2u[aval ^ 0x55]));
-}
-
-/* u-law to A-law conversion */
-
-unsigned char ulaw2alaw(unsigned char uval)
-{
- uval &= 0xff;
- return ((uval & 0x80) ? (0xD5 ^ (_u2a[0xFF ^ uval] - 1)) :
- (0x55 ^ (_u2a[0x7F ^ uval] - 1)));
-}
-
-void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "g711conv - do conversions according to ITU G.711, (version %d.%d.%d)\n",VERSION, REL, STEP);
- fprintf(stderr, "usage: g711conv -a -r -R -u -P\n");
- fprintf(stderr, " -a A-law to u-law conversion\n");
- fprintf(stderr, " -r reverse bits before conversion\n");
- fprintf(stderr, " -R reverse bits after conversion\n");
- fprintf(stderr, " -u u-law to A-law conversion\n");
- fprintf(stderr, " -P print conversion table as C source\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-int
-main(int argc, char **argv)
-{
- int i;
- int c;
- int opt_a = 0;
- int opt_u = 0;
- int opt_r = 0;
- int opt_P = 0;
- int opt_R = 0;
- unsigned char uc;
-
- while ((c = getopt(argc, argv, "aurPR")) != -1)
- {
- switch(c)
- {
- case 'a':
- opt_a = 1;
- break;
-
- case 'u':
- opt_u = 1;
- break;
-
- case 'r':
- opt_r = 1;
- break;
-
- case 'R':
- opt_R = 1;
- break;
-
- case 'P':
- opt_P = 1;
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if((opt_a + opt_u) > 1)
- usage();
-
- if(opt_P)
- {
- printf("\n/* ");
-
- if((opt_a + opt_u) == 0)
- printf("No Conversion");
-
- if(opt_a)
- printf("A-law to u-law conversion");
-
- if(opt_u)
- printf("u-law to A-law conversion");
-
- if(opt_r)
- printf(", reverse bits BEFORE conversion");
-
- if(opt_R)
- printf(", reverse bits AFTER conversion");
-
- if(opt_a)
- {
- printf(" */\n\nunsigned char a2u_tab[256] = {");
- }
- else if(opt_u)
- {
- printf(" */\n\nunsigned char u2a_tab[256] = {");
- }
- else
- {
- printf(" */\n\nunsigned char table[256] = {");
- }
-
- for(i=0; i < 256; i++)
- {
- uc = i;
-
- if(!(i % 8))
- printf("\n/* %02x */\t", i);
-
- if(opt_r)
- uc = bitreverse[uc];
-
- if(opt_u)
- uc = ulaw2alaw(uc);
-
- if(opt_a)
- uc = alaw2ulaw(uc);
-
- if(opt_R)
- uc = bitreverse[uc];
-
- if(i == 255)
- printf("0x%02x", uc);
- else
- printf("0x%02x, ", uc);
- }
- printf("\n};\n");
- }
- else
- {
- unsigned char ib[1];
-
- while(fread(ib, 1, 1, stdin) == 1)
- {
- if(opt_r)
- ib[0] = bitreverse[ib[0]];
-
- if(opt_u)
- ib[0] = ulaw2alaw(ib[0]);
-
- if(opt_a)
- ib[0] = alaw2ulaw(ib[0]);
-
- if(opt_R)
- ib[0] = bitreverse[ib[0]];
-
- fwrite(ib, 1, 1, stdout);
- }
- }
- return(0);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/Makefile b/usr.sbin/i4b/isdnd/Makefile
deleted file mode 100644
index ce6c51c..0000000
--- a/usr.sbin/i4b/isdnd/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-# $FreeBSD$
-
-PROG= isdnd
-MAN= isdnd.rc.5 isdnd.rates.5 isdnd.acct.5 isdnd.8
-SRCS= rc_parse.y rc_scan.l main.c rc_config.c log.c curses.c \
- process.c rates.c msghdl.c fsm.c support.c timer.c \
- exec.c dial.c monitor.c pcause.c controller.c alias.c \
- y.tab.h holiday.c
-
-# compile debug support
-CFLAGS+= -DDEBUG
-
-# avoid wacky merging of string constants from
-# source code with compile-time timestamp
-CFLAGS+= -fno-merge-constants
-
-# enable rtprio usage
-CFLAGS+= -DUSE_RTPRIO
-
-CFLAGS+= -I. -I${.CURDIR}/../isdnmonitor -I${.CURDIR}/../isdntel -I${.CURDIR}
-
-.include "${.CURDIR}/../Makefile.inc"
-
-.if !defined(I4B_WITHOUT_CURSES)
-CFLAGS+= -DUSE_CURSES
-DPADD= ${LIBCURSES}
-LDADD= -lcurses
-.endif
-
-.if defined(I4B_EXTERNAL_MONITOR)
-CFLAGS+= -DI4B_EXTERNAL_MONITOR
-.if defined(I4B_NOTCPIP_MONITOR)
-CFLAGS+= -DI4B_NOTCPIP_MONITOR
-.endif
-.endif
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdnd/alias.c b/usr.sbin/i4b/isdnd/alias.c
deleted file mode 100644
index f91a0a1..0000000
--- a/usr.sbin/i4b/isdnd/alias.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdnd - common aliasfile handling
- * =================================
- *
- * NOTE: this has to stay in sync with isdntel/alias.c to be able
- * to share a common aliasfile!
- *
- * $Id: alias.c,v 1.8 1999/12/13 21:25:24 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:04:40 2006]
- *
- *----------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-static struct alias *firsta = NULL;
-
-#define MAXBUFSZ 256
-
-static void free_alias(struct alias *ptr);
-
-/*---------------------------------------------------------------------------*
- * read in and init aliases
- *---------------------------------------------------------------------------*/
-void
-init_alias(char *filename)
-{
- FILE *fp;
- unsigned char buffer[MAXBUFSZ + 1];
- unsigned char number[MAXBUFSZ + 1];
- unsigned char name[MAXBUFSZ + 1];
- unsigned char *s, *d;
- struct alias *newa = NULL;
- struct alias *lasta = NULL;
-
- firsta = NULL;
-
- if((fp = fopen(filename, "r")) == NULL)
- {
- llog(LL_ERR, "init_alias: error opening aliasfile %s: %s!", filename, strerror(errno));
- exit(1);
- }
-
- while((fgets(buffer, MAXBUFSZ, fp)) != NULL)
- {
- if(buffer[0] == '#' || buffer[0] == ' ' ||
- buffer[0] == '\t' || buffer[0] == '\n')
- {
- continue;
- }
-
- s = buffer;
- d = number;
-
- while(*s && (isdigit(*s)))
- *d++ = *s++;
-
- *d = '\0';
-
- while(*s && (isspace(*s)))
- s++;
-
- d = name;
-
- while(*s && (isprint(*s)))
- *d++ = *s++;
-
- *d = '\0';
-
- if((strlen(number) > 1) && (strlen(name) > 1))
- {
- if((newa = (struct alias *) malloc(sizeof(struct alias))) == NULL)
- {
- llog(LL_ERR, "init_alias: malloc failed for struct alias!\n");
- exit(1);
- }
-
- if((newa->number = (char *) malloc(strlen(number)+1)) == NULL)
- {
- llog(LL_ERR, "init_alias: malloc failed for number alias!\n");
- exit(1);
- }
-
- if((newa->name = (char *) malloc(strlen(name)+1)) == NULL)
- {
- llog(LL_ERR, "init_alias: malloc failed for name alias!\n");
- exit(1);
- }
-
- strcpy(newa->name, name);
- strcpy(newa->number, number);
- newa->next = NULL;
-
- if(firsta == NULL)
- {
- firsta = newa;
- }
- else
- {
- lasta->next = newa;
- }
- lasta = newa;
- }
- }
- fclose(fp);
-}
-
-/*---------------------------------------------------------------------------*
- * free all aliases
- *---------------------------------------------------------------------------*/
-void
-free_aliases(void)
-{
- free_alias(firsta);
-}
-
-/*---------------------------------------------------------------------------*
- * free aliases
- *---------------------------------------------------------------------------*/
-static void
-free_alias(struct alias *ptr)
-{
-
- if(ptr == NULL)
- return;
-
- if(ptr->next != NULL)
- free_alias(ptr->next);
-
- if(ptr->number != NULL)
- free(ptr->number);
-
- if(ptr->name != NULL)
- free(ptr->name);
-
- free(ptr);
-}
-
-/*---------------------------------------------------------------------------*
- * try to find alias for number. if no alias found, return number.
- *---------------------------------------------------------------------------*/
-char *
-get_alias(char *number)
-{
- struct alias *ca = NULL;
-
- if(firsta == NULL)
- return(number);
-
- ca = firsta;
-
- for(;;)
- {
- if(strlen(number) == strlen(ca->number))
- {
- if(!(strcmp(number, ca->number)))
- return(ca->name);
- }
- if(ca->next == NULL)
- break;
- ca = ca->next;
- }
- return(number);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/config.h b/usr.sbin/i4b/isdnd/config.h
deleted file mode 100644
index a4b05f1..0000000
--- a/usr.sbin/i4b/isdnd/config.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1997, 2001 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 daemon - compile time configuration header file
- * ---------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon May 21 11:21:15 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-
-/* general values */
-
-#define UMASK 022 /* file creation perm mask */
-#define CFG_ENTRY_MAX 60 /* max no of config entries */
-#define ISDN_CTRL_MAX 4 /* max no of controllers */
-#define MAX_RE 8 /* max regular expression entries */
-
-/* monitor max values */
-
-#define MAX_MHOSTS 8 /* max allowed monitor hosts */
-
-/* timouts */
-
-#define TIMEOUT_CONNECT_ACTIVE 30 /* seconds to wait for MSG_CONN_ACT */
-
-/* utility programs forked */
-
-#define REGPROG_DEF "program" /* default program to use for regexpr */
-#define ANSWERPROG_DEF "answer" /* default telephone answer program */
-
-#endif /* _CONFIG_H_ */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/controller.c b/usr.sbin/i4b/isdnd/controller.c
deleted file mode 100644
index bdaa3c4..0000000
--- a/usr.sbin/i4b/isdnd/controller.c
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * Copyright (c) 1997, 2001 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 daemon - controller state support routines
- * ----------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:24:05 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/mman.h>
-
-#include "isdnd.h"
-
-static int
-init_controller_state(int controller, int ctrl_type, int card_type, int tei, int nbch);
-
-/*---------------------------------------------------------------------------*
- * get name of a controller
- *---------------------------------------------------------------------------*/
-const char *
-name_of_controller(int ctrl_type, int card_type)
-{
- static char *passive_card[] = {
- "Teles S0/8",
- "Teles S0/16",
- "Teles S0/16.3",
- "AVM A1 or Fritz!Card",
- "Teles S0/16.3 PnP",
- "Creatix S0 PnP",
- "USRobotics Sportster ISDN TA",
- "Dr. Neuhaus NICCY Go@",
- "Sedlbauer win speed",
- "Dynalink IS64PH",
- "ISDN Master, MasterII or Blaster",
- "AVM PCMCIA Fritz!Card",
- "ELSA QuickStep 1000pro/ISA",
- "ELSA QuickStep 1000pro/PCI",
- "Siemens I-Talk",
- "ELSA MicroLink ISDN/MC",
- "ELSA MicroLink MCall",
- "ITK ix1 micro",
- "AVM Fritz!Card PCI",
- "ELSA PCC-16",
- "AVM Fritz!Card PnP",
- "Siemens I-Surf 2.0 PnP",
- "Asuscom ISDNlink 128K PnP",
- "ASUSCOM P-IN100-ST-D (Winbond W6692)",
- "Teles S0/16.3c PnP",
- "AcerISDN P10 PnP",
- "TELEINT ISDN SPEED No. 1",
- "Cologne Chip HFC-S PCI based",
- "Traverse Tech NETjet-S / Teles PCI-TJ",
- "Eicon.Diehl DIVA 2.0 / 2.02 ISA PnP",
- "Compaq Microcom 610",
- "AVM Fritz!Card PCI Version 2",
- };
-
- static char *daic_card[] = {
- "EICON.Diehl S",
- "EICON.Diehl SX/SXn",
- "EICON.Diehl SCOM",
- "EICON.Diehl QUADRO",
- };
-
- static char *capi_card[] = {
- "AVM T1 PCI",
- "AVM B1 PCI",
- "AVM B1 ISA",
- };
-
- static char *capimgr_card[] = {
- "CAPI manager driven board"
- };
-
- if(ctrl_type == CTRL_PASSIVE)
- {
- int index = card_type - CARD_TYPEP_8;
- if (index >= 0 && index < (sizeof passive_card / sizeof passive_card[0]))
- return passive_card[index];
- }
- else if(ctrl_type == CTRL_DAIC)
- {
- int index = card_type - CARD_TYPEA_DAIC_S;
- if (index >= 0 && index < (sizeof daic_card / sizeof daic_card[0] ))
- return daic_card[index];
- }
- else if(ctrl_type == CTRL_TINADD)
- {
- return "Stollmann tina-dd";
- }
- else if(ctrl_type == CTRL_CAPI)
- {
- int index = card_type - CARD_TYPEC_AVM_T1_PCI;
- if (index >= 0 && index < (sizeof capi_card / sizeof capi_card[0] ))
- return capi_card[index];
- }
- else if(ctrl_type == CTRL_CAPIMGR)
- {
- return capimgr_card[0];
- }
-
- return "unknown card type";
-}
-
-/*---------------------------------------------------------------------------*
- * init controller state array
- *---------------------------------------------------------------------------*/
-void
-init_controller(void)
-{
- int i;
- int max = 1;
- msg_ctrl_info_req_t mcir;
-
- for(i=0; i < max; i++)
- {
- mcir.controller = i;
-
- if((ioctl(isdnfd, I4B_CTRL_INFO_REQ, &mcir)) < 0)
- {
- llog(LL_ERR, "init_controller: ioctl I4B_CTRL_INFO_REQ failed: %s", strerror(errno));
- do_exit(1);
- }
-
- if((ncontroller = max = mcir.ncontroller) == 0)
- {
- llog(LL_ERR, "init_controller: no ISDN controller found!");
- do_exit(1);
- }
-
- if(mcir.ctrl_type == -1 || mcir.card_type == -1)
- {
- llog(LL_ERR, "init_controller: ctrl/card is invalid!");
- do_exit(1);
- }
-
- /* init controller tab */
-
- if((init_controller_state(i, mcir.ctrl_type, mcir.card_type, mcir.tei, mcir.nbch)) == ERROR)
- {
- llog(LL_ERR, "init_controller: init_controller_state for controller %d failed", i);
- do_exit(1);
- }
- }
- DBGL(DL_RCCF, (llog(LL_DBG, "init_controller: found %d ISDN controller(s)", max)));
-}
-
-/*--------------------------------------------------------------------------*
- * init controller state table entry
- *--------------------------------------------------------------------------*/
-static int
-init_controller_state(int controller, int ctrl_type, int card_type, int tei,
- int nbch)
-{
- int i;
-
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "init_controller_state: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- /* init controller tab */
-
- switch (ctrl_type) {
- case CTRL_PASSIVE:
- if((card_type > CARD_TYPEP_UNK) &&
- (card_type <= CARD_TYPEP_MAX))
- {
- isdn_ctrl_tab[controller].ctrl_type = ctrl_type;
- isdn_ctrl_tab[controller].card_type = card_type;
- isdn_ctrl_tab[controller].state = CTRL_UP;
- }
- else
- {
- llog(LL_ERR, "init_controller_state: unknown card type %d", card_type);
- return(ERROR);
- }
- break;
-
- case CTRL_DAIC:
- isdn_ctrl_tab[controller].ctrl_type = ctrl_type;
- isdn_ctrl_tab[controller].card_type = card_type;
- isdn_ctrl_tab[controller].state = CTRL_DOWN;
- break;
-
- case CTRL_TINADD:
- isdn_ctrl_tab[controller].ctrl_type = ctrl_type;
- isdn_ctrl_tab[controller].card_type = 0;
- isdn_ctrl_tab[controller].state = CTRL_DOWN;
- break;
-
- case CTRL_CAPI:
- isdn_ctrl_tab[controller].ctrl_type = ctrl_type;
- isdn_ctrl_tab[controller].card_type = card_type;
- isdn_ctrl_tab[controller].state = CTRL_UP;
- break;
-
- case CTRL_CAPIMGR:
- isdn_ctrl_tab[controller].ctrl_type = ctrl_type;
- isdn_ctrl_tab[controller].card_type = card_type;
- isdn_ctrl_tab[controller].state = CTRL_UP;
- break;
-
- default:
- llog(LL_ERR, "init_controller_state: unknown controller type %d", ctrl_type);
- return(ERROR);
- }
-
- isdn_ctrl_tab[controller].nbch = nbch;
- isdn_ctrl_tab[controller].freechans = nbch;
- for (i = 0; i < nbch; i++)
- isdn_ctrl_tab[controller].stateb[i] = CHAN_IDLE;
- isdn_ctrl_tab[controller].tei = tei;
- isdn_ctrl_tab[controller].l1stat = LAYER_IDLE;
- isdn_ctrl_tab[controller].l2stat = LAYER_IDLE;
-
- llog(LL_DMN, "init_controller_state: controller %d is %s",
- controller,
- name_of_controller(isdn_ctrl_tab[controller].ctrl_type,
- isdn_ctrl_tab[controller].card_type));
-
- return(GOOD);
-}
-
-/*--------------------------------------------------------------------------*
- * init active or capi controller
- *--------------------------------------------------------------------------*/
-void
-init_active_controller(void)
-{
- int ret;
- int unit = 0;
- int controller;
- char cmdbuf[MAXPATHLEN+128];
-
- for(controller = 0; controller < ncontroller; controller++)
- {
- if(isdn_ctrl_tab[controller].ctrl_type == CTRL_TINADD)
- {
- DBGL(DL_RCCF, (llog(LL_DBG, "init_active_controller, tina-dd %d: executing [%s %d]", unit, tinainitprog, unit)));
-
- snprintf(cmdbuf, sizeof(cmdbuf), "%s %d", tinainitprog, unit);
-
- if((ret = system(cmdbuf)) != 0)
- {
- llog(LL_ERR, "init_active_controller, tina-dd %d: %s returned %d!", unit, tinainitprog, ret);
- do_exit(1);
- }
- }
-
- /*
- * Generic microcode loading. If a controller has
- * defined a microcode file, load it using the
- * I4B_CTRL_DOWNLOAD ioctl.
- */
-
- if(isdn_ctrl_tab[controller].firmware != NULL)
- {
- int fd, ret;
- struct isdn_dr_prot idp;
- struct isdn_download_request idr;
-
- fd = open(isdn_ctrl_tab[controller].firmware, O_RDONLY);
- if (fd < 0) {
- llog(LL_ERR, "init_active_controller %d: open %s: %s!",
- controller, isdn_ctrl_tab[controller].firmware,
- strerror(errno));
- do_exit(1);
- }
-
- idp.bytecount = lseek(fd, 0, SEEK_END);
- idp.microcode = mmap(0, idp.bytecount, PROT_READ,
- MAP_SHARED, fd, 0);
- if (idp.microcode == MAP_FAILED) {
- llog(LL_ERR, "init_active_controller %d: mmap %s: %s!",
- controller, isdn_ctrl_tab[controller].firmware,
- strerror(errno));
- do_exit(1);
- }
-
- DBGL(DL_RCCF, (llog(LL_DBG, "init_active_controller %d: loading firmware from [%s]", controller, isdn_ctrl_tab[controller].firmware)));
-
- idr.controller = controller;
- idr.numprotos = 1;
- idr.protocols = &idp;
-
- ret = ioctl(isdnfd, I4B_CTRL_DOWNLOAD, &idr, sizeof(idr));
- if (ret) {
- llog(LL_ERR, "init_active_controller %d: load %s: %s!",
- controller, isdn_ctrl_tab[controller].firmware,
- strerror(errno));
- do_exit(1);
- }
-
- munmap(idp.microcode, idp.bytecount);
- close(fd);
- }
- }
-}
-
-/*--------------------------------------------------------------------------*
- * init controller D-channel ISDN protocol
- *--------------------------------------------------------------------------*/
-void
-init_controller_protocol(void)
-{
- int controller;
- msg_prot_ind_t mpi;
-
- for(controller = 0; controller < ncontroller; controller++)
- {
- mpi.controller = controller;
- mpi.protocol = isdn_ctrl_tab[controller].protocol;
-
- if((ioctl(isdnfd, I4B_PROT_IND, &mpi)) < 0)
- {
- llog(LL_ERR, "init_controller_protocol: ioctl I4B_PROT_IND failed: %s", strerror(errno));
- do_exit(1);
- }
- }
-}
-
-/*--------------------------------------------------------------------------*
- * set controller state to UP/DOWN
- *--------------------------------------------------------------------------*/
-int
-set_controller_state(int controller, int state)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "set_controller_state: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- if(state == CTRL_UP)
- {
- isdn_ctrl_tab[controller].state = CTRL_UP;
- DBGL(DL_CNST, (llog(LL_DBG, "set_controller_state: controller [%d] set UP!", controller)));
- }
- else if (state == CTRL_DOWN)
- {
- isdn_ctrl_tab[controller].state = CTRL_DOWN;
- DBGL(DL_CNST, (llog(LL_DBG, "set_controller_state: controller [%d] set DOWN!", controller)));
- }
- else
- {
- llog(LL_ERR, "set_controller_state: invalid controller state [%d]!", state);
- return(ERROR);
- }
- return(GOOD);
-}
-
-/*--------------------------------------------------------------------------*
- * get controller state
- *--------------------------------------------------------------------------*/
-int
-get_controller_state(int controller)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "set_controller_state: invalid controller number [%d]!", controller);
- return(ERROR);
- }
- return(isdn_ctrl_tab[controller].state);
-}
-
-/*--------------------------------------------------------------------------*
- * decrement number of free channels for controller
- *--------------------------------------------------------------------------*/
-int
-decr_free_channels(int controller)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "decr_free_channels: invalid controller number [%d]!", controller);
- return(ERROR);
- }
- if(isdn_ctrl_tab[controller].freechans > 0)
- {
- (isdn_ctrl_tab[controller].freechans)--;
- DBGL(DL_CNST, (llog(LL_DBG, "decr_free_channels: ctrl %d, now %d chan free", controller, isdn_ctrl_tab[controller].freechans)));
- return(GOOD);
- }
- else
- {
- llog(LL_ERR, "decr_free_channels: controller [%d] already 0 free chans!", controller);
- return(ERROR);
- }
-}
-
-/*--------------------------------------------------------------------------*
- * increment number of free channels for controller
- *--------------------------------------------------------------------------*/
-int
-incr_free_channels(int controller)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "incr_free_channels: invalid controller number [%d]!", controller);
- return(ERROR);
- }
- if(isdn_ctrl_tab[controller].freechans < isdn_ctrl_tab[controller].nbch)
- {
- (isdn_ctrl_tab[controller].freechans)++;
- DBGL(DL_CNST, (llog(LL_DBG, "incr_free_channels: ctrl %d, now %d chan free", controller, isdn_ctrl_tab[controller].freechans)));
- return(GOOD);
- }
- else
- {
- llog(LL_ERR, "incr_free_channels: controller [%d] already %d free chans!", controller, isdn_ctrl_tab[controller].nbch);
- return(ERROR);
- }
-}
-
-/*--------------------------------------------------------------------------*
- * get number of free channels for controller
- *--------------------------------------------------------------------------*/
-int
-get_free_channels(int controller)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "get_free_channels: invalid controller number [%d]!", controller);
- return(ERROR);
- }
- DBGL(DL_CNST, (llog(LL_DBG, "get_free_channels: ctrl %d, %d chan free", controller, isdn_ctrl_tab[controller].freechans)));
- return(isdn_ctrl_tab[controller].freechans);
-}
-
-/*--------------------------------------------------------------------------*
- * set channel state to busy
- *--------------------------------------------------------------------------*/
-int
-set_channel_busy(int controller, int channel)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "set_channel_busy: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- if ((channel < 0) || (channel >= isdn_ctrl_tab[controller].nbch))
- {
- llog(LL_ERR, "set_channel_busy: controller [%d] invalid channel [%d]!", controller, channel);
- return(ERROR);
- }
-
- if(isdn_ctrl_tab[controller].stateb[channel] == CHAN_RUN)
- {
- DBGL(DL_CNST, (llog(LL_DBG, "set_channel_busy: controller [%d] channel B%d already busy!", controller, channel+1)));
- }
- else
- {
- isdn_ctrl_tab[controller].stateb[channel] = CHAN_RUN;
- DBGL(DL_CNST, (llog(LL_DBG, "set_channel_busy: controller [%d] channel B%d set to BUSY!", controller, channel+1)));
- }
- return(GOOD);
-}
-
-/*--------------------------------------------------------------------------*
- * set channel state to idle
- *--------------------------------------------------------------------------*/
-int
-set_channel_idle(int controller, int channel)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "set_channel_idle: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- if ((channel < 0) || (channel >= isdn_ctrl_tab[controller].nbch))
- {
- llog(LL_ERR, "set_channel_busy: controller [%d] invalid channel [%d]!", controller, channel);
- return(ERROR);
- }
-
- if (isdn_ctrl_tab[controller].stateb[channel] == CHAN_IDLE)
- {
- DBGL(DL_CNST, (llog(LL_DBG, "set_channel_idle: controller [%d] channel B%d already idle!", controller, channel+1)));
- }
- else
- {
- isdn_ctrl_tab[controller].stateb[channel] = CHAN_IDLE;
- DBGL(DL_CNST, (llog(LL_DBG, "set_channel_idle: controller [%d] channel B%d set to IDLE!", controller, channel+1)));
- }
- return(GOOD);
-}
-
-/*--------------------------------------------------------------------------*
- * return channel state
- *--------------------------------------------------------------------------*/
-int
-ret_channel_state(int controller, int channel)
-{
- if((controller < 0) || (controller >= ncontroller))
- {
- llog(LL_ERR, "ret_channel_state: invalid controller number [%d]!", controller);
- return(ERROR);
- }
-
- if ((channel < 0) || (channel >= isdn_ctrl_tab[controller].nbch))
- {
- llog(LL_ERR, "set_channel_busy: controller [%d] invalid channel [%d]!", controller, channel);
- return(ERROR);
- }
-
- return(isdn_ctrl_tab[controller].stateb[channel]);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/curses.c b/usr.sbin/i4b/isdnd/curses.c
deleted file mode 100644
index a086b23..0000000
--- a/usr.sbin/i4b/isdnd/curses.c
+++ /dev/null
@@ -1,891 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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 daemon - curses fullscreen output
- * -------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:05:36 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef USE_CURSES
-
-#include "isdnd.h"
-
-#define CHPOS(cfgp) (((cfgp)->isdncontrollerused*2) + (cfgp)->isdnchannelused)
-
-static void display_budget(void);
-static void display_cards(void);
-static void menuexit(WINDOW *menu_w);
-
-/*---------------------------------------------------------------------------*
- * init curses fullscreen display
- *---------------------------------------------------------------------------*/
-void
-init_screen(void)
-{
- char buffer[512];
- int uheight, lheight;
- int i, j;
- cfg_entry_t *p;
-
- initscr(); /* curses init */
-
- if((COLS < 80) || (LINES < 24))
- {
- llog(LL_ERR, "ERROR, minimal screensize must be 80x24, is %dx%d, terminating!",COLS, LINES);
- do_exit(1);
- }
-
- noecho();
- raw();
-
- uheight = ncontroller * 2; /* cards * b-channels */
- lheight = LINES - uheight - 6 + 1; /* rest of display */
-
- if((upper_w = newwin(uheight, COLS, UPPER_B, 0)) == NULL)
- {
- llog(LL_ERR, "ERROR, curses init upper window, terminating!");
- exit(1);
- }
-
- if((mid_w = newwin(1, COLS, UPPER_B+uheight+1, 0)) == NULL)
- {
- llog(LL_ERR, "ERROR, curses init mid window, terminating!");
- exit(1);
- }
-
- if((lower_w = newwin(lheight, COLS, UPPER_B+uheight+3, 0)) == NULL)
- {
- llog(LL_ERR, "ERROR, curses init lower window, LINES = %d, lheight = %d, uheight = %d, terminating!", LINES, lheight, uheight);
- exit(1);
- }
-
- scrollok(lower_w, 1);
-
- snprintf(buffer, sizeof(buffer), "----- isdn controller channel state ------------- isdnd %02d.%02d.%d [pid %d] -", VERSION, REL, STEP, (int)getpid());
-
- while(strlen(buffer) < COLS && strlen(buffer) < sizeof(buffer) - 1)
- strcat(buffer, "-");
-
- move(0, 0);
- standout();
- addstr(buffer);
- standend();
-
- move(1, 0);
- /* 01234567890123456789012345678901234567890123456789012345678901234567890123456789 */
- addstr("c tei b remote iface dir outbytes obps inbytes ibps units");
-
- snprintf(buffer, sizeof(buffer), "----- isdn userland interface state ------------------------------------------");
- while(strlen(buffer) < COLS && strlen(buffer) < sizeof(buffer) - 1)
- strcat(buffer, "-");
-
- move(uheight+2, 0);
- standout();
- addstr(buffer);
- standend();
-
- snprintf(buffer, sizeof(buffer), "----- isdnd logfile display --------------------------------------------------");
- while(strlen(buffer) < COLS && strlen(buffer) < sizeof(buffer) - 1)
- strcat(buffer, "-");
-
- move(uheight+4, 0);
- standout();
- addstr(buffer);
- standend();
-
- refresh();
-
- for(i=0, j=0; i <= ncontroller; i++, j+=2)
- {
- if(isdn_ctrl_tab[i].tei == -1)
- mvwprintw(upper_w, j, H_CNTL, "%d --- 1 ", i);
- else
- mvwprintw(upper_w, j, H_CNTL, "%d %3d 1 ", i, isdn_ctrl_tab[i].tei);
- mvwprintw(upper_w, j+1, H_CNTL, " L12 2 ");
- }
- wrefresh(upper_w);
-
- for(i=0, j=0; i < nentries; i++) /* walk thru all entries */
- {
- p = &cfg_entry_tab[i]; /* get ptr to enry */
-
- mvwprintw(mid_w, 0, j, "%s%d ", bdrivername(p->usrdevicename), p->usrdeviceunit);
-
- p->fs_position = j;
-
- j += ((strlen(bdrivername(p->usrdevicename)) + (p->usrdeviceunit > 9 ? 2 : 1) + 1));
- }
- wrefresh(mid_w);
-
- wmove(lower_w, 0, 0);
- wrefresh(lower_w);
-
- curses_ready = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * curses menu for fullscreen command mode
- *---------------------------------------------------------------------------*/
-void
-do_menu(void)
-{
- static char *menu[WMITEMS] =
- {
- "1 - (D)isplay refresh",
- "2 - (H)angup (choose a channel)",
- "3 - (R)eread config file",
- "4 - (S)how card types",
- "5 - (B)udget information",
- "6 - (Q)uit the program",
- };
-
- WINDOW *menu_w;
- int c;
- int mpos;
- fd_set set;
- struct timeval timeout;
-
- /* create a new window in the lower screen area */
-
- if((menu_w = newwin(WMENU_HGT, WMENU_LEN, WMENU_POSLN, WMENU_POSCO )) == NULL)
- {
- llog(LL_WRN, "ERROR, curses init menu window!");
- return;
- }
-
- /* create a border around the window */
-
- box(menu_w, '|', '-');
-
- /* add a title */
-
- wstandout(menu_w);
- mvwaddstr(menu_w, 0, (WMENU_LEN / 2) - (strlen(WMENU_TITLE) / 2), WMENU_TITLE);
- wstandend(menu_w);
-
- /* fill the window with the menu options */
-
- for(mpos=0; mpos <= (WMITEMS-1); mpos++)
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
-
- /* highlight the first menu option */
-
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
-
- /* input loop */
-
- for(;;)
- {
- wrefresh(menu_w);
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = WMTIMEOUT;
- timeout.tv_usec = 0;
-
- /* if no char is available within timeout, exit menu*/
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- goto mexit;
-
- c = wgetch(menu_w);
-
- switch(c)
- {
- case ' ':
- case '\t': /* hilite next option */
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- mpos++;
- if(mpos >= WMITEMS)
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case ('0'+WBUDGET+1): /* display budget info */
- case 'B':
- case 'b':
- display_budget();
- goto mexit;
-
- case ('0'+WREFRESH+1): /* display refresh */
- case 'D':
- case 'd':
- wrefresh(curscr);
- goto mexit;
-
- case ('0'+WQUIT+1): /* quit program */
- case 'Q':
- case 'q':
- menuexit(menu_w);
- do_exit(0);
- goto mexit;
-
- case ('0'+WHANGUP+1): /* hangup connection */
- case 'H':
- case 'h':
- display_chans();
- goto mexit;
-
- case ('0'+WREREAD+1): /* reread config file */
- case 'R':
- case 'r':
- rereadconfig(42);
- goto mexit;
-
- case ('0'+WSHOW+1): /* reread config file */
- case 'S':
- case 's':
- display_cards();
- goto mexit;
-
- case '\n':
- case '\r': /* exec highlighted option */
- switch(mpos)
- {
- case WREFRESH:
- wrefresh(curscr);
- break;
-
- case WQUIT:
- menuexit(menu_w);
- do_exit(0);
- break;
-
- case WHANGUP:
- display_chans();
- break;
-
- case WREREAD:
- rereadconfig(42);
- break;
-
- case WBUDGET:
- display_budget();
- break;
-
- case WSHOW:
- display_cards();
- break;
- }
- goto mexit;
- break;
-
- default:
- goto mexit;
- break;
- }
- }
-
-mexit:
- menuexit(menu_w);
-}
-
-static void
-menuexit(WINDOW *menu_w)
-{
- int uheight = ncontroller * 2; /* cards * b-channels */
- char buffer[512];
-
- /* delete the menu window */
-
- delwin(menu_w);
-
- /* re-display the original lower window contents */
-
- touchwin(mid_w);
- wrefresh(mid_w);
-
- touchwin(lower_w);
- wrefresh(lower_w);
-
- touchwin(upper_w);
- wrefresh(upper_w);
-
- move(1, 0);
- /* 01234567890123456789012345678901234567890123456789012345678901234567890123456789 */
- addstr("c tei b remote iface dir outbytes obps inbytes ibps units");
-
- sprintf(buffer, "----- isdn userland interface state ------------------------------------------");
- while(strlen(buffer) < COLS)
- strcat(buffer, "-");
-
- move(uheight+2, 0);
- standout();
- addstr(buffer);
- standend();
-
- sprintf(buffer, "----- isdnd logfile display --------------------------------------------------");
- while(strlen(buffer) < COLS)
- strcat(buffer, "-");
-
- move(uheight+4, 0);
- standout();
- addstr(buffer);
- standend();
-
- refresh();
-}
-
-/*---------------------------------------------------------------------------*
- * display the charge in units
- *---------------------------------------------------------------------------*/
-void
-display_charge(cfg_entry_t *cep)
-{
- mvwprintw(upper_w, CHPOS(cep), H_UNITS, "%d", cep->charge);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display the calculated charge in units
- *---------------------------------------------------------------------------*/
-void
-display_ccharge(cfg_entry_t *cep, int units)
-{
- mvwprintw(upper_w, CHPOS(cep), H_UNITS, "(%d)", units);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display accounting information
- *---------------------------------------------------------------------------*/
-void
-display_acct(cfg_entry_t *cep)
-{
- mvwprintw(upper_w, CHPOS(cep), H_OUT, "%-10d", cep->outbytes);
- mvwprintw(upper_w, CHPOS(cep), H_OUTBPS, "%-4d", cep->outbps);
- mvwprintw(upper_w, CHPOS(cep), H_IN, "%-10d", cep->inbytes);
- mvwprintw(upper_w, CHPOS(cep), H_INBPS, "%-4d", cep->inbps);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display connect information
- *---------------------------------------------------------------------------*/
-void
-display_connect(cfg_entry_t *cep)
-{
- char buffer[256];
-
- /* remote telephone number */
-
- if(aliasing)
- {
- if(cep->direction == DIR_IN)
- snprintf(buffer, sizeof(buffer), "%s", get_alias(cep->real_phone_incoming.number));
- else
- snprintf(buffer, sizeof(buffer), "%s", get_alias(cep->remote_phone_dialout.number));
- }
- else
- {
- if(cep->direction == DIR_IN)
- snprintf(buffer, sizeof(buffer), "%s/%s", cep->name, cep->real_phone_incoming.number);
- else
- snprintf(buffer, sizeof(buffer), "%s/%s", cep->name, cep->remote_phone_dialout.number);
- }
-
- buffer[H_IFN - H_TELN - 1] = '\0';
-
- mvwprintw(upper_w, CHPOS(cep), H_TELN, "%s", buffer);
-
- /* interface */
-
- mvwprintw(upper_w, CHPOS(cep), H_IFN, "%s%d ",
- bdrivername(cep->usrdevicename), cep->usrdeviceunit);
-
- mvwprintw(upper_w, CHPOS(cep), H_IO,
- cep->direction == DIR_OUT ? "out" : "in");
-
- mvwprintw(upper_w, CHPOS(cep), H_OUT, "-");
- mvwprintw(upper_w, CHPOS(cep), H_OUTBPS, "-");
- mvwprintw(upper_w, CHPOS(cep), H_IN, "-");
- mvwprintw(upper_w, CHPOS(cep), H_INBPS, "-");
-
- if(do_bell)
- display_bell();
-
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * erase line at disconnect time
- *---------------------------------------------------------------------------*/
-void
-display_disconnect(cfg_entry_t *cep)
-{
- wmove(upper_w, CHPOS(cep),
- H_TELN);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-
- if(do_bell)
- display_bell();
-
-}
-
-/*---------------------------------------------------------------------------*
- * display interface up/down information
- *---------------------------------------------------------------------------*/
-void
-display_updown(cfg_entry_t *cep, int updown)
-{
- if(updown)
- wstandend(mid_w);
- else
- wstandout(mid_w);
-
- mvwprintw(mid_w, 0, cep->fs_position, "%s%d ",
- bdrivername(cep->usrdevicename), cep->usrdeviceunit);
-
- wstandend(mid_w);
- wrefresh(mid_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display interface up/down information
- *---------------------------------------------------------------------------*/
-void
-display_l12stat(int controller, int layer, int state)
-{
- if(controller > ncontroller)
- return;
- if(!(layer == 1 || layer == 2))
- return;
-
- if(state)
- wstandout(upper_w);
- else
- wstandend(upper_w);
-
- if(layer == 1)
- {
- mvwprintw(upper_w, (controller*2)+1, H_TEI+1, "1");
- if(!state)
- mvwprintw(upper_w, (controller*2)+1, H_TEI+2, "2");
- }
- else if(layer == 2)
- {
- mvwprintw(upper_w, (controller*2)+1, H_TEI+2, "2");
- if(state)
- mvwprintw(upper_w, (controller*2)+1, H_TEI+1, "1");
- }
-
- wstandend(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display TEI
- *---------------------------------------------------------------------------*/
-void
-display_tei(int controller, int tei)
-{
- if(controller > ncontroller)
- return;
-
- if(tei == -1)
- mvwprintw(upper_w, controller*2, H_TEI, "---");
- else
- mvwprintw(upper_w, controller*2, H_TEI, "%3d", tei);
-
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display bell :-)
- *---------------------------------------------------------------------------*/
-void
-display_bell(void)
-{
- static char bell[1] = { 0x07 };
- write(STDOUT_FILENO, &bell[0], 1);
-}
-
-/*---------------------------------------------------------------------------*
- * display channel information for shutdown
- *---------------------------------------------------------------------------*/
-void
-display_chans(void)
-{
- char buffer[80];
- int i;
- int cnt = 0;
- WINDOW *chan_w;
- int nlines, ncols, pos_x, pos_y;
- fd_set set;
- struct timeval timeout;
- cfg_entry_t *cep = NULL;
-
- /* need this later to close the connection */
- struct ctlr_chan {
- int cntl;
- int chn;
- } *cc = NULL;
-
- for (i = 0; i < ncontroller; i++)
- {
- if((get_controller_state(i)) != CTRL_UP)
- continue;
- if((ret_channel_state(i, CHAN_B1)) == CHAN_RUN)
- cnt++;
- if((ret_channel_state(i, CHAN_B2)) == CHAN_RUN)
- cnt++;
- }
-
- if(cnt > 0)
- {
- if ((cc = (struct ctlr_chan *)malloc (cnt *
- sizeof (struct ctlr_chan))) == NULL)
- {
- return;
- }
- nlines = cnt + 4;
- ncols = 60;
- }
- else
- {
- nlines = 5;
- ncols = 22;
- }
-
- pos_y = WMENU_POSLN + 4;
- pos_x = WMENU_POSCO + 10;
-
- /* create a new window in the lower screen area */
-
- if((chan_w = newwin(nlines, ncols, pos_y, pos_x )) == NULL)
- {
- llog(LL_WRN, "ERROR, curses init channel window!");
- if (cnt > 0)
- free(cc);
- return;
- }
-
- /* create a border around the window */
-
- box(chan_w, '|', '-');
-
- /* add a title */
-
- wstandout(chan_w);
- mvwaddstr(chan_w, 0, (ncols / 2) - (strlen("Channels") / 2), "Channels");
- wstandend(chan_w);
-
- /* no active channels */
- if (cnt == 0)
- {
- mvwaddstr(chan_w, 2, 2, "No active channels");
- wrefresh(chan_w);
- sleep(1);
-
- /* delete the channels window */
-
- delwin(chan_w);
- return;
- }
-
- nlines = 2;
- ncols = 1;
-
- for (i = 0; i < ncontroller; i++)
- {
- if((get_controller_state(i)) != CTRL_UP)
- continue;
-
- if((ret_channel_state(i, CHAN_B1)) == CHAN_RUN)
- {
- snprintf(buffer, sizeof(buffer), "%d - Controller %d channel %s", ncols, i, "B1");
- mvwaddstr(chan_w, nlines, 2, buffer);
- cc[ncols - 1].cntl = i;
- cc[ncols - 1].chn = CHAN_B1;
- nlines++;
- ncols++;
- }
- if((ret_channel_state(i, CHAN_B2)) == CHAN_RUN)
- {
- snprintf(buffer, sizeof(buffer), "%d - Controller %d channel %s", ncols, i, "B2");
- mvwaddstr(chan_w, nlines, 2, buffer);
- cc[ncols - 1].cntl = i;
- cc[ncols - 1].chn = CHAN_B2;
- nlines++;
- ncols++;
- }
- }
-
- for(;;)
- {
- wrefresh(chan_w);
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = WMTIMEOUT;
- timeout.tv_usec = 0;
-
- /* if no char is available within timeout, exit menu*/
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- break;
-
- ncols = wgetch(chan_w);
-
- if (!(isdigit(ncols)))
- {
- display_bell();
- continue;
- }
-
- nlines = ncols - '0';
-
- if ((nlines == 0) || (nlines > cnt))
- {
- display_bell();
- continue;
- }
-
- if((cep = get_cep_by_cc(cc[nlines-1].cntl, cc[nlines-1].chn))
- != NULL)
- {
- llog(LL_CHD, "%05d %s manual disconnect (fullscreen menu)", cep->cdid, cep->name);
- cep->hangup = 1;
- break;
- }
- }
-
- free(cc);
-
- /* delete the channels window */
-
- delwin(chan_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display card type information
- *---------------------------------------------------------------------------*/
-static void
-display_cards(void)
-{
- WINDOW *chan_w;
- int nlines, ncols, pos_x, pos_y;
- fd_set set;
- struct timeval timeout;
- int i;
-
- nlines = 6+ncontroller;
- ncols = 60;
- pos_y = WMENU_POSLN;
- pos_x = WMENU_POSCO;
-
- /* create a new window in the lower screen area */
-
- if((chan_w = newwin(nlines, ncols, pos_y, pos_x )) == NULL)
- {
- llog(LL_WRN, "ERROR, curses init channel window!");
- return;
- }
-
- /* create a border around the window */
-
- box(chan_w, '|', '-');
-
- /* add a title */
-
- wstandout(chan_w);
- mvwaddstr(chan_w, 0, (ncols / 2) - (strlen("Cards") / 2), "Cards");
- wstandend(chan_w);
-
- mvwprintw(chan_w, 2, 2, "ctrl description");
- mvwprintw(chan_w, 3, 2, "---- ----------------------------------------------");
- for (i = 0; i < ncontroller; i++)
- {
- mvwprintw(chan_w, 4+i, 2, " #%d %s", i,
- name_of_controller(isdn_ctrl_tab[i].ctrl_type,
- isdn_ctrl_tab[i].card_type));
- }
-
- wrefresh(chan_w);
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = WMTIMEOUT*2;
- timeout.tv_usec = 0;
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- {
- delwin(chan_w);
- return;
- }
-
- wgetch(chan_w);
- delwin(chan_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display budget info
- *---------------------------------------------------------------------------*/
-static void
-display_budget(void)
-{
- WINDOW *bud_w;
- int nlines, ncols, pos_x, pos_y;
- fd_set set;
- struct timeval timeout;
- int i, j;
- cfg_entry_t *cep;
- time_t now;
- double uptime;
- int minutes;
- int hours;
- int days;
-
- nlines = 0;
- ncols = 73;
- pos_y = WMENU_POSLN;
- pos_x = WMENU_POSCO-3;
-
- for(i=0, j=0; i < nentries; i++) /* walk thru all entries */
- {
- cep = &cfg_entry_tab[i]; /* get ptr to entry */
-
- if(cep->budget_callbackperiod && cep->budget_callbackncalls)
- nlines++;
- if(cep->budget_calloutperiod && cep->budget_calloutncalls)
- nlines++;
- }
-
- if(nlines == 0)
- return;
-
- nlines += 6;
-
- /* create a new window in the lower screen area */
-
- if((bud_w = newwin(nlines, ncols, pos_y, pos_x )) == NULL)
- {
- llog(LL_WRN, "ERROR, curses init budget window!");
- return;
- }
-
- now = time(NULL);
- uptime = difftime(now, starttime);
-
- minutes = (time_t) (uptime / 60) % 60;
- hours = (time_t) (uptime / (60*60)) % (60*60);
- days = (time_t) (uptime / (60*60*24)) % (60*60*24);
-
- uptime = uptime / (60*60);
-
- /* create a border around the window */
-
- box(bud_w, '|', '-');
-
- /* add a title */
-
- wstandout(bud_w);
- mvwaddstr(bud_w, 0, (ncols / 2) - (strlen("Budget") / 2), "Budget");
- wstandend(bud_w);
-
- mvwprintw(bud_w, 1, 2, "isdnd uptime: %d %s - %d %s - %d %s",
- days,
- days == 1 ? "day" : "days",
- hours,
- hours == 1 ? "hour" : "hours",
- minutes,
- minutes == 1 ? "minute" : "minutes");
-
- mvwprintw(bud_w, 2, 2, "name t period rest ncall rest rqsts /hr rdone /hr rrjct /hr ");
- mvwprintw(bud_w, 3, 2, "-------- - ------ ------ ----- ----- ----- ---- ----- ---- ----- ----");
-
- for(i=0, j=4; i < nentries; i++) /* walk thru all entries */
- {
- cep = &cfg_entry_tab[i]; /* get ptr to enry */
-
- if(cep->budget_calloutperiod && cep->budget_calloutncalls)
- {
- mvwprintw(bud_w, j, 2, "%-8s %c %-6d %-6ld %-5d %-5d %-5d %-4.1f %-5d %-4.1f %-5d %-4.1f",
- cep->name,
- 'o',
- cep->budget_calloutperiod,
- (long)(cep->budget_calloutperiod_time - now),
- cep->budget_calloutncalls,
- cep->budget_calloutncalls_cnt,
- cep->budget_callout_req,
- (double)cep->budget_callout_req / uptime,
- cep->budget_callout_done,
- (double)cep->budget_callout_done / uptime,
- cep->budget_callout_rej,
- (double)cep->budget_callout_rej / uptime);
- j++;
- }
- if(cep->budget_callbackperiod && cep->budget_callbackncalls)
- {
- mvwprintw(bud_w, j, 2, "%-8s %c %-6d %-6ld %-5d %-5d %-5d %-4.1f %-5d %-4.1f %-5d %-4.1f",
- (cep->budget_calloutperiod && cep->budget_calloutncalls) ? "" : cep->name,
- 'b',
- cep->budget_callbackperiod,
- (long)(cep->budget_callbackperiod_time - now),
- cep->budget_callbackncalls,
- cep->budget_callbackncalls_cnt,
- cep->budget_callback_req,
- (double)cep->budget_callback_req / uptime,
- cep->budget_callback_done,
- (double)cep->budget_callback_done / uptime,
- cep->budget_callback_rej,
- (double)cep->budget_callback_rej / uptime);
- j++;
- }
- }
-
- wrefresh(bud_w);
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = WMTIMEOUT*3;
- timeout.tv_usec = 0;
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- {
- delwin(bud_w);
- return;
- }
-
- wgetch(bud_w);
- delwin(bud_w);
-}
-
-#endif
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/dial.c b/usr.sbin/i4b/isdnd/dial.c
deleted file mode 100644
index 158e1c0..0000000
--- a/usr.sbin/i4b/isdnd/dial.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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 daemon - dial handling routines
- * -----------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:05:52 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-/*---------------------------------------------------------------------------*
- * select the first remote number to dial according to the
- * dial strategy
- *---------------------------------------------------------------------------*/
-void
-select_first_dialno(cfg_entry_t *cep)
-{
- int i, j;
-
- if(cep->keypad[0] != '\0')
- return;
-
- if(cep->remote_numbers_count < 1)
- {
- llog(LL_ERR, "select_first_dialno: remote_numbers_count < 1!");
- return;
- }
-
- if(cep->remote_numbers_count == 1)
- {
- strcpy(cep->remote_phone_dialout.number, cep->remote_numbers[0].number);
- strcpy(cep->remote_phone_dialout.subaddr, cep->remote_numbers[0].subaddr);
- DBGL(DL_DIAL, (llog(LL_DBG, "select_first_dialno: only one no, no = %s", cep->remote_phone_dialout.number)));
- cep->last_remote_number = 0;
- return;
- }
-
- if(cep->remote_numbers_handling == RNH_FIRST)
- {
- strcpy(cep->remote_phone_dialout.number, cep->remote_numbers[0].number);
- strcpy(cep->remote_phone_dialout.subaddr, cep->remote_numbers[0].subaddr);
- DBGL(DL_DIAL, (llog(LL_DBG, "select_first_dialno: use first, no = %s", cep->remote_phone_dialout.number)));
- cep->last_remote_number = 0;
- return;
- }
-
- i = cep->last_remote_number;
-
- for(j = cep->remote_numbers_count; j > 0; j--)
- {
- if(cep->remote_numbers[i].flag == RNF_SUCC)
- {
- if(cep->remote_numbers_handling == RNH_LAST)
- {
- strcpy(cep->remote_phone_dialout.number, cep->remote_numbers[i].number);
- strcpy(cep->remote_phone_dialout.subaddr, cep->remote_numbers[i].subaddr);
- DBGL(DL_DIAL, (llog(LL_DBG, "select_first_dialno: use last, no = %s", cep->remote_phone_dialout.number)));
- cep->last_remote_number = i;
- return;
- }
- else
- {
- if(++i >= cep->remote_numbers_count)
- i = 0;
-
- strcpy(cep->remote_phone_dialout.number, cep->remote_numbers[i].number);
- strcpy(cep->remote_phone_dialout.subaddr, cep->remote_numbers[i].subaddr);
- DBGL(DL_DIAL, (llog(LL_DBG, "select_first_dialno: use next, no = %s", cep->remote_phone_dialout.number)));
- cep->last_remote_number = i;
- return;
- }
- }
-
- if(++i >= cep->remote_numbers_count)
- i = 0;
- }
- strcpy(cep->remote_phone_dialout.number, cep->remote_numbers[0].number);
- DBGL(DL_DIAL, (llog(LL_DBG, "select_first_dialno: no last found (use 0), no = %s", cep->remote_phone_dialout.number)));
- cep->last_remote_number = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * select next remote number to dial (last was unsuccesfull)
- *---------------------------------------------------------------------------*/
-void
-select_next_dialno(cfg_entry_t *cep)
-{
- if(cep->remote_numbers_count < 1)
- {
- llog(LL_ERR, "select_next_dialno: remote_numbers_count < 1!");
- return;
- }
-
- if(cep->remote_numbers_count == 1)
- {
- strcpy(cep->remote_phone_dialout.number, cep->remote_numbers[0].number);
- strcpy(cep->remote_phone_dialout.subaddr, cep->remote_numbers[0].subaddr);
- DBGL(DL_DIAL, (llog(LL_DBG, "select_next_dialno: only one no, no = %s", cep->remote_phone_dialout.number)));
- cep->last_remote_number = 0;
- return;
- }
-
- /* mark last try as bad */
-
- cep->remote_numbers[cep->last_remote_number].flag = RNF_IDLE;
-
- /* next one to try */
-
- cep->last_remote_number++;
-
- if(cep->last_remote_number >= cep->remote_numbers_count)
- cep->last_remote_number = 0;
-
- strcpy(cep->remote_phone_dialout.number, cep->remote_numbers[cep->last_remote_number].number);
-
- DBGL(DL_DIAL, (llog(LL_DBG, "select_next_dialno: index=%d, no=%s",
- cep->last_remote_number,
- cep->remote_numbers[cep->last_remote_number].number)));
-}
-
-/*---------------------------------------------------------------------------*
- * dial succeded, store this number as the last successful
- *---------------------------------------------------------------------------*/
-void
-select_this_dialno(cfg_entry_t *cep)
-{
- cep->remote_numbers[cep->last_remote_number].flag = RNF_SUCC;
-
- DBGL(DL_DIAL, (llog(LL_DBG, "select_this_dialno: index = %d, no = %s",
- cep->last_remote_number,
- cep->remote_numbers[cep->last_remote_number].number)));
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/exec.c b/usr.sbin/i4b/isdnd/exec.c
deleted file mode 100644
index 2f24384..0000000
--- a/usr.sbin/i4b/isdnd/exec.c
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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.
- *
- *---------------------------------------------------------------------------
- *
- * exec.h - supplemental program/script execution
- * ----------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 16:55:23 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <paths.h>
-
-#define MAX_PIDS 32
-
-static struct pid_tab {
- pid_t pid;
- cfg_entry_t *cep;
-} pid_tab[MAX_PIDS];
-
-/*---------------------------------------------------------------------------*
- * SIGCHLD signal handler
- *---------------------------------------------------------------------------*/
-void
-sigchild_handler(int sig)
-{
- int retstat;
- register int i;
- pid_t pid;
-
- if((pid = waitpid(-1, &retstat, WNOHANG)) <= 0)
- {
- llog(LL_ERR, "ERROR, sigchild_handler, waitpid: %s", strerror(errno));
- error_exit(1, "ERROR, sigchild_handler, waitpid: %s", strerror(errno));
- }
- else
- {
- if(WIFEXITED(retstat))
- {
- DBGL(DL_PROC, (llog(LL_DBG, "normal child (pid=%d) termination, exitstat = %d",
- pid, WEXITSTATUS(retstat))));
- }
- else if(WIFSIGNALED(retstat))
- {
- if(WCOREDUMP(retstat))
- llog(LL_WRN, "child (pid=%d) termination due to signal %d (coredump)",
- pid, WTERMSIG(retstat));
- else
- llog(LL_WRN, "child (pid=%d) termination due to signal %d",
- pid, WTERMSIG(retstat));
- }
- }
-
- /* check if hangup required */
-
- for(i=0; i < MAX_PIDS; i++)
- {
- if(pid_tab[i].pid == pid)
- {
- if(pid_tab[i].cep->cdid != CDID_UNUSED)
- {
- DBGL(DL_PROC, (llog(LL_DBG, "sigchild_handler: scheduling hangup for cdid %d, pid %d",
- pid_tab[i].cep->cdid, pid_tab[i].pid)));
- pid_tab[i].cep->hangup = 1;
- }
- pid_tab[i].pid = 0;
- break;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * execute prog as a subprocess and pass an argumentlist
- *---------------------------------------------------------------------------*/
-pid_t
-exec_prog(char *prog, char **arglist)
-{
- char tmp[MAXPATHLEN];
- char path[MAXPATHLEN];
- pid_t pid;
- int a;
-
- snprintf(path, sizeof(path), "%s/%s", ETCPATH, prog);
-
- arglist[0] = path;
-
- tmp[0] = '\0';
-
- for(a=1; arglist[a] != NULL; ++a )
- {
- strcat(tmp, " " );
- strcat(tmp, arglist[a]);
- }
-
- DBGL(DL_PROC, (llog(LL_DBG, "exec_prog: %s, args:%s", path, tmp)));
-
- switch(pid = fork())
- {
- case -1: /* error */
- llog(LL_ERR, "ERROR, exec_prog/fork: %s", strerror(errno));
- error_exit(1, "ERROR, exec_prog/fork: %s", strerror(errno));
- case 0: /* child */
- break;
- default: /* parent */
- return(pid);
- }
-
- /* this is the child now */
-
- /*
- * close files used only by isdnd, e.g.
- * 1. /dev/i4b
- * 2. /var/log/isdnd.acct (or similar, when used)
- * 3. /var/log/isdnd.log (or similar, when used)
- */
- close(isdnfd);
-
- if(useacctfile && acctfp)
- fclose(acctfp);
-
- if(uselogfile && logfp)
- fclose(logfp);
-
- if(execvp(path,arglist) < 0 )
- _exit(127);
-
- return(-1);
-}
-
-/*---------------------------------------------------------------------------*
- * run interface up/down script
- *---------------------------------------------------------------------------*/
-int
-exec_connect_prog(cfg_entry_t *cep, const char *prog, int link_down)
-{
- char *argv[32], **av = argv;
- char devicename[MAXPATHLEN], addr[100];
- char *device;
- int s;
- struct ifreq ifr;
-
- /* the obvious things */
- device = bdrivername(cep->usrdevicename);
- snprintf(devicename, sizeof(devicename), "%s%d", device, cep->usrdeviceunit);
- *av++ = (char*)prog;
- *av++ = "-d";
- *av++ = devicename;
- *av++ = "-f";
- *av++ = link_down ? "down" : "up";
-
- /* try to figure AF_INET address of interface */
- addr[0] = '\0';
- memset(&ifr, 0, sizeof ifr);
- ifr.ifr_addr.sa_family = AF_INET;
- strncpy(ifr.ifr_name, devicename, sizeof(ifr.ifr_name));
- s = socket(AF_INET, SOCK_DGRAM, 0);
- if (s >= 0) {
- if (ioctl(s, SIOCGIFADDR, (caddr_t)&ifr) >= 0) {
- struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr;
- strcpy(addr, inet_ntoa(sin->sin_addr));
- *av++ = "-a";
- *av++ = addr;
- }
- close(s);
- }
-
- /* terminate argv */
- *av++ = NULL;
-
- return exec_prog((char*)prog, argv);
-}
-
-/*---------------------------------------------------------------------------*
- * run answeringmachine application
- *---------------------------------------------------------------------------*/
-int
-exec_answer(cfg_entry_t *cep)
-{
- char *argv[32];
- u_char devicename[MAXPATHLEN];
- int pid;
- char *device;
-
- device = bdrivername(cep->usrdevicename);
-
- snprintf(devicename, sizeof(devicename), "%si4b%s%d", _PATH_DEV, device,
- cep->usrdeviceunit);
-
- argv[0] = cep->answerprog;
- argv[1] = "-D";
- argv[2] = devicename;
- argv[3] = "-d";
- argv[4] = "unknown";
- argv[5] = "-s";
- argv[6] = "unknown";
- argv[7] = NULL;
-
- /* if destination telephone number avail, add it as argument */
-
- if(*cep->local_phone_incoming.number)
- argv[4] = cep->local_phone_incoming.number;
-
- /* if source telephone number avail, add it as argument */
-
- if(*cep->real_phone_incoming.number)
- argv[6] = cep->real_phone_incoming.number;
-
- if(*cep->display)
- {
- argv[7] = "-t";
- argv[8] = cep->display;
- argv[9] = NULL;
- }
-
- /* exec program */
-
- DBGL(DL_PROC, (llog(LL_DBG, "exec_answer: prog=[%s]", cep->answerprog)));
-
- pid = exec_prog(cep->answerprog, argv);
-
- /* enter pid and conf ptr entry addr into table */
-
- if(pid != -1)
- {
- int i;
-
- for(i=0; i < MAX_PIDS; i++)
- {
- if(pid_tab[i].pid == 0)
- {
- pid_tab[i].pid = pid;
- pid_tab[i].cep = cep;
- break;
- }
- }
- return(GOOD);
- }
- return(ERROR);
-}
-
-/*---------------------------------------------------------------------------*
- * check if a connection has an outstanding process, if yes, kill it
- *---------------------------------------------------------------------------*/
-void
-check_and_kill(cfg_entry_t *cep)
-{
- int i;
-
- for(i=0; i < MAX_PIDS; i++)
- {
- if(pid_tab[i].cep == cep)
- {
- pid_t kp;
-
- DBGL(DL_PROC, (llog(LL_DBG, "check_and_kill: killing pid %d", pid_tab[i].pid)));
-
- kp = pid_tab[i].pid;
- pid_tab[i].pid = 0;
- kill(kp, SIGHUP);
- break;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * update budget callout/callback statistics counter file
- *---------------------------------------------------------------------------*/
-void
-upd_callstat_file(char *filename, int rotateflag)
-{
- FILE *fp;
- time_t s, l, now;
- int n;
- int ret;
-
- now = time(NULL);
-
- fp = fopen(filename, "r+");
-
- if(fp == NULL)
- {
- /* file not there, create it and exit */
-
- llog(LL_WRN, "upd_callstat_file: creating %s", filename);
-
- fp = fopen(filename, "w");
- if(fp == NULL)
- {
- llog(LL_ERR, "ERROR, upd_callstat_file: cannot create %s, %s", filename, strerror(errno));
- return;
- }
-
- ret = fprintf(fp, "%d %d 1", now, now);
- if(ret <= 0)
- llog(LL_ERR, "ERROR, upd_callstat_file: fprintf failed: %s", strerror(errno));
-
- fclose(fp);
- return;
- }
-
- /* get contents */
-
- ret = fscanf(fp, "%d %d %d", &s, &l, &n);
-
- /* reset fp */
-
- rewind(fp);
-
- if(ret != 3)
- {
- /* file corrupt ? anyway, initialize */
-
- llog(LL_WRN, "upd_callstat_file: initializing %s", filename);
-
- s = l = now;
- n = 0;
- }
-
- if(rotateflag)
- {
- struct tm *stmp;
- int dom;
-
- /* get day of month for last timestamp */
- stmp = localtime(&l);
- dom = stmp->tm_mday;
-
- /* get day of month for just now */
- stmp = localtime(&now);
-
- if(dom != stmp->tm_mday)
- {
- FILE *nfp;
- char buf[MAXPATHLEN];
-
- /* new day, write last days stats */
-
- sprintf(buf, "%s-%02d", filename, stmp->tm_mday);
-
- nfp = fopen(buf, "w");
- if(nfp == NULL)
- {
- llog(LL_ERR, "ERROR, upd_callstat_file: cannot open for write %s, %s", buf, strerror(errno));
- return;
- }
-
- ret = fprintf(nfp, "%d %d %d", s, l, n);
- if(ret <= 0)
- llog(LL_ERR, "ERROR, upd_callstat_file: fprintf failed: %s", strerror(errno));
-
- fclose(nfp);
-
- /* init new days stats */
- n = 0;
- s = now;
-
- llog(LL_WRN, "upd_callstat_file: rotate %s, new s=%ld l=%ld n=%d", filename, s, l, n);
- }
- }
-
- n++; /* increment call count */
-
- /*
- * the "%-3d" is necessary to overwrite any
- * leftovers from previous contents!
- */
-
- ret = fprintf(fp, "%d %d %-3d", s, now, n);
-
- if(ret <= 0)
- llog(LL_ERR, "ERROR, upd_callstat_file: fprintf failed: %s", strerror(errno));
-
- fclose(fp);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/fsm.c b/usr.sbin/i4b/isdnd/fsm.c
deleted file mode 100644
index b87b17e..0000000
--- a/usr.sbin/i4b/isdnd/fsm.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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.
- *
- *---------------------------------------------------------------------------
- *
- * FSM for isdnd
- * -------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:06:40 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-/* table of state descriptions */
-
-static char *state_text[N_STATES] = {
- "idle",
- "dialing",
- "waitdialretry",
- "dialretry",
-
- "pcb-dialing",
- "pcb-dialfail",
- "pcb-waitcall",
-
- "acb-waitdisc",
- "acb-waitdial",
- "acb-dialing",
- "acb-dialfail",
-
- "accepted",
- "connected",
- "waitdisconnect",
- "down",
- "alert",
-
- "Illegal State"
-};
-
-/* table of event descriptions */
-
-static char *event_text[N_EVENTS] = {
-
- /* incoming messages */
-
- "msg-con-ind",
- "msg-con-act-ind",
- "msg-disc-ind",
- "msg-dialout",
-
- /* local events */
-
- "timeout",
- "disconnect-req",
- "callback-req",
- "alert-req",
-
- /* illegal */
-
- "Illegal Event"
-};
-
-/*---------------------------------------------------------------------------*
- * illegal state default action
- *---------------------------------------------------------------------------*/
-static void
-F_ill(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_ill: Illegal State reached !!!")));
-}
-
-/*---------------------------------------------------------------------------*
- * No change, No action
- *---------------------------------------------------------------------------*/
-static void
-F_NcNa(cfg_entry_t *cep)
-{
-}
-
-/*---------------------------------------------------------------------------*
- * incoming CONNECT, accepting call
- *---------------------------------------------------------------------------*/
-static void
-F_MCI(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_MCI: tx SETUP_RESP_ACCEPT")));
- sendm_connect_resp(cep, cep->cdid, SETUP_RESP_ACCEPT, 0);
- start_timer(cep, TIMEOUT_CONNECT_ACTIVE);
-}
-
-/*---------------------------------------------------------------------------*
- * incoming connect active, call is now active
- *---------------------------------------------------------------------------*/
-static void
-F_MCAI(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_MCAI: Connection active!")));
-
- stop_timer(cep);
-
- if((cep->dialin_reaction == REACT_ANSWER) &&
- (cep->b1protocol == BPROT_NONE))
- {
- exec_answer(cep);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * timeout
- *---------------------------------------------------------------------------*/
-static void
-F_TIMO(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_TIMO: Timout occured!")));
- sendm_disconnect_req(cep, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- cep->cdid = CDID_UNUSED;
-}
-
-/*---------------------------------------------------------------------------*
- * incoming disconnect indication
- *---------------------------------------------------------------------------*/
-static void
-F_IDIS(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_IDIS: disconnect indication")));
- cep->cdid = CDID_UNUSED;
-}
-
-/*---------------------------------------------------------------------------*
- * local disconnect request
- *---------------------------------------------------------------------------*/
-static void
-F_DRQ(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_DRQ: local disconnect request")));
- sendm_disconnect_req(cep, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
-}
-
-/*---------------------------------------------------------------------------*
- * disconnect indication after local disconnect req
- *---------------------------------------------------------------------------*/
-static void
-F_MDI(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_MDI: disconnect indication, local disconnected")));
- cep->cdid = CDID_UNUSED;
-}
-
-/*---------------------------------------------------------------------------*
- * local requested outgoing dial
- *---------------------------------------------------------------------------*/
-static void
-F_DIAL(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_DIAL: local dial out request")));
-
- if(cep->dialrandincr)
- cep->randomtime = (random() & RANDOM_MASK) + cep->recoverytime;
-
- cep->dial_count = 0;
-
- select_first_dialno(cep);
-
- sendm_connect_req(cep);
-}
-
-/*---------------------------------------------------------------------------*
- * outgoing dial successfull
- *---------------------------------------------------------------------------*/
-static void
-F_DOK(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_DOK: dial out ok")));
- select_this_dialno(cep);
-}
-
-/*---------------------------------------------------------------------------*
- * outgoing dial fail (ST_SUSE !!!)
- *---------------------------------------------------------------------------*/
-static void
-F_DFL(cfg_entry_t *cep)
-{
- cep->last_release_time = time(NULL);
-
- if(cep->dialouttype == DIALOUT_NORMAL)
- {
- cep->dial_count++;
-
- if(cep->dial_count < cep->dialretries || cep->dialretries == -1)
- {
- /* inside normal retry cycle */
-
- DBGL(DL_STATE, (llog(LL_DBG, "F_DFL: dial fail, dial retry")));
- select_next_dialno(cep);
- cep->cdid = CDID_RESERVED;
- cep->state = ST_DIALRTMRCHD;
- return;
- }
-
- /* retries exhausted */
-
- if(!cep->usedown)
- {
- DBGL(DL_STATE, (llog(LL_DBG, "F_DFL: dial retry fail, dial retries exhausted")));
- dialresponse(cep, DSTAT_TFAIL);
- cep->cdid = CDID_UNUSED;
- cep->dial_count = 0;
- cep->state = ST_IDLE;
- return;
- }
-
- /* interface up/down active */
-
- cep->down_retry_count++;
-
- if(cep->down_retry_count > cep->downtries)
- {
- /* set interface down */
- DBGL(DL_STATE, (llog(LL_DBG, "F_DFL: dial retry cycle fail, setting interface down!")));
- dialresponse(cep, DSTAT_PFAIL);
- if_down(cep);
- cep->state = ST_DOWN;
- }
- else
- {
- /* enter new dial retry cycle */
- DBGL(DL_STATE, (llog(LL_DBG, "F_DFL: dial retry cycle fail, enter new retry cycle!")));
- select_next_dialno(cep);
- cep->state = ST_DIALRTMRCHD;
- }
-
- cep->dial_count = 0;
- cep->cdid = CDID_RESERVED;
- }
- else /* cdp->dialouttype == DIALOUT_CALLEDBACK */
- {
- DBGL(DL_STATE, (llog(LL_DBG, "F_DFL: calledback dial done, wait for incoming call")));
- cep->cdid = CDID_RESERVED;
- cep->state = ST_PCB_WAITCALL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * local requested outgoing dial
- *---------------------------------------------------------------------------*/
-static void
-F_ACBW(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_ACBW: local callback, wait callback recovery time")));
-
- if(cep->dialrandincr)
- cep->randomtime = (random() & RANDOM_MASK) + cep->recoverytime;
-
- cep->dial_count = 0;
-
- cep->cdid = CDID_RESERVED;
-}
-
-/*---------------------------------------------------------------------------*
- * active callback dialout retry (ST_SUSE !!!)
- *---------------------------------------------------------------------------*/
-static void
-F_ACBR(cfg_entry_t *cep)
-{
- cep->dial_count++;
-
- if(cep->dial_count < cep->dialretries || cep->dialretries == -1)
- {
- /* inside normal retry cycle */
-
- DBGL(DL_STATE, (llog(LL_DBG, "F_ACBR: dial fail, dial retry")));
- select_next_dialno(cep);
- cep->cdid = CDID_RESERVED;
- cep->state = ST_ACB_DIALFAIL;
- return;
- }
-
- /* retries exhausted */
-
- if(!cep->usedown)
- {
- DBGL(DL_STATE, (llog(LL_DBG, "F_ACBR: dial retry fail, dial retries exhausted")));
- dialresponse(cep, DSTAT_TFAIL);
- cep->cdid = CDID_UNUSED;
- cep->dial_count = 0;
- cep->state = ST_IDLE;
- return;
- }
-
- /* interface up/down active */
-
- cep->down_retry_count++;
-
- if(cep->down_retry_count > cep->downtries)
- {
- /* set interface down */
- DBGL(DL_STATE, (llog(LL_DBG, "F_ACBR: dial retry cycle fail, setting interface down!")));
- dialresponse(cep, DSTAT_PFAIL);
- if_down(cep);
- cep->state = ST_DOWN;
- }
- else
- {
- /* enter new dial retry cycle */
- DBGL(DL_STATE, (llog(LL_DBG, "F_ACBR: dial retry cycle fail, enter new retry cycle!")));
- select_next_dialno(cep);
- cep->state = ST_ACB_DIALFAIL;
- }
-
- cep->dial_count = 0;
- cep->cdid = CDID_RESERVED;
-}
-
-/*---------------------------------------------------------------------------*
- * local requested to send ALERT message
- *---------------------------------------------------------------------------*/
-static void
-F_ALRT(cfg_entry_t *cep)
-{
- DBGL(DL_STATE, (llog(LL_DBG, "F_ALRT: local send alert request")));
-
- cep->alert_time = cep->alert;
-
- sendm_alert_req(cep);
-}
-
-/*---------------------------------------------------------------------------*
- * isdn daemon state transition table
- *---------------------------------------------------------------------------*/
-struct state_tab {
- void(*func)(cfg_entry_t *cep); /* function to execute */
- int newstate; /* next state */
-} state_tab[N_EVENTS][N_STATES] = {
-
-/* STATE: ST_IDLE ST_DIAL ST_DIALRTMRCHD ST_DIALRETRY ST_PCB_DIAL ST_PCB_DIALFAIL ST_PCB_WAITCALL ST_ACB_WAITDISC ST_ACB_WAITDIAL ST_ACB_DIAL ST_ACB_DIALFAIL ST_ACCEPTED ST_CONNECTED ST_WAITDISCI ST_DOWN ST_ALERT ST_ILLEGAL */
-/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-/* messages */
-/* EV_MCI */{{F_MCI, ST_ACCEPTED}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_MCI, ST_ACCEPTED}, {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_MCI, ST_ACCEPTED}, {F_ill, ST_ILL}},
-/* EV_MCAI */{{F_ill, ST_ILL}, {F_DOK, ST_CONNECTED}, {F_ill, ST_ILL}, {F_DOK, ST_CONNECTED}, {F_DOK, ST_CONNECTED}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_DOK, ST_CONNECTED}, {F_ill, ST_ILL}, {F_MCAI,ST_CONNECTED}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_MDI */{{F_ill, ST_ILL}, {F_DFL, ST_SUSE}, {F_ill, ST_ILL}, {F_DFL, ST_SUSE}, {F_DFL, ST_SUSE}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ACBW,ST_ACB_WAITDIAL},{F_ill, ST_ILL}, {F_ACBR, ST_SUSE}, {F_ACBR,ST_SUSE}, {F_IDIS,ST_IDLE}, {F_IDIS,ST_IDLE}, {F_MDI, ST_IDLE}, {F_ill, ST_ILL}, {F_MDI, ST_IDLE}, {F_ill, ST_ILL}},
-/* EV_MDO */{{F_DIAL,ST_DIAL}, {F_NcNa,ST_DIAL}, {F_NcNa,ST_DIALRTMRCHD},{F_NcNa,ST_DIALRETRY}, {F_NcNa,ST_PCB_DIAL}, {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}},
-
-/* local requests */
-/* EV_TIMO */{{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_TIMO,ST_IDLE}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_DRQ */{{F_NcNa, ST_IDLE}, {F_DRQ, ST_WAITDISCI}, {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_DRQ, ST_WAITDISCI}, {F_NcNa,ST_WAITDISCI}, {F_NcNa, ST_DOWN}, {F_ill, ST_ILL}, {F_ill, ST_ILL}},
-/* EV_CBRQ */{{F_NcNa,ST_ACB_WAITDIAL},{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_NcNa,ST_ACB_WAITDIAL},{F_NcNa, ST_ACB_DIAL}, {F_NcNa,ST_ACB_DIALFAIL},{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_ALRT */{{F_ALRT,ST_ALERT}, {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}},
-
-/* illegal */
-
-/* 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}}
-};
-
-/*---------------------------------------------------------------------------*
- * event handler
- *---------------------------------------------------------------------------*/
-void
-next_state(cfg_entry_t *cep, int event)
-{
- int currstate, newstate;
-
- if(event > N_EVENTS)
- {
- llog(LL_ERR, "next_state: event > N_EVENTS");
- error_exit(1, "next_state: event > N_EVENTS");
- }
-
- currstate = cep->state;
-
- if(currstate > N_STATES)
- {
- llog(LL_ERR, "next_state: currstate > N_STATES");
- error_exit(1, "next_state: currstate > N_STATES");
- }
-
- newstate = state_tab[event][currstate].newstate;
-
- if(newstate > N_STATES)
- {
- llog(LL_ERR, "next_state: newstate > N_STATES");
- error_exit(1, "next_state: newstate > N_STATES");
- }
-
- if(newstate != ST_SUSE)
- {
- DBGL(DL_STATE, (llog(LL_DBG, "FSM event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[newstate])));
- }
-
- (*state_tab[event][currstate].func)(cep);
-
- if(newstate == ST_ILL)
- {
- llog(LL_ERR, "FSM ILLEGAL STATE, event=%s: oldstate=%s => newstate=%s]",
- event_text[event],
- state_text[currstate],
- state_text[newstate]);
- }
-
- if(newstate == ST_SUSE)
- {
- DBGL(DL_STATE, (llog(LL_DBG, "FSM (SUSE) event [%s]: [%s => %s]", event_text[event],
- state_text[currstate],
- state_text[cep->state])));
- }
- else
- {
- cep->state = newstate;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return pointer to current state description
- *---------------------------------------------------------------------------*/
-char *
-printstate(cfg_entry_t *cep)
-{
- return((char *) state_text[cep->state]);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/holiday.c b/usr.sbin/i4b/isdnd/holiday.c
deleted file mode 100644
index 714bd06..0000000
--- a/usr.sbin/i4b/isdnd/holiday.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 2000, 2001 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdnd - holiday file handling
- * =============================
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:06:56 2006]
- *
- * Format:
- *
- * day.month.year optional comment (different day every year) or
- * day.month optional comment (same day every year)
- *
- * i.e.:
- *
- * 23.4.2000 Ostersonntag
- * 3.10 Tag der deutschen Einheit
- *
- *----------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-struct holiday {
- int day;
- int month;
- int year;
- struct holiday *next;
-};
-
-static struct holiday *firsth = NULL;
-
-#define MAXBUFSZ 256
-
-static void free_holiday(struct holiday *ptr);
-
-/*---------------------------------------------------------------------------*
- * read in and init holidayes
- *---------------------------------------------------------------------------*/
-void
-init_holidays(char *filename)
-{
- FILE *fp;
- unsigned char buffer[MAXBUFSZ + 1];
- struct holiday *newh = NULL;
- struct holiday *lasth = NULL;
- int ret;
- int day, month, year;
-
- firsth = NULL;
-
- if((fp = fopen(filename, "r")) == NULL)
- {
- DBGL(DL_VALID, (llog(LL_DBG, "init_holiday: error opening holidayfile %s: %s!", filename, strerror(errno))));
- return;
- }
-
- while((fgets(buffer, MAXBUFSZ, fp)) != NULL)
- {
- if(buffer[0] == '#' || buffer[0] == ' ' ||
- buffer[0] == '\t' || buffer[0] == '\n')
- {
- continue;
- }
-
- ret = sscanf(buffer, "%d.%d.%d", &day, &month, &year);
-
- if(ret != 3)
- {
- ret = sscanf(buffer, "%d.%d", &day, &month);
- if(ret != 2)
- {
- llog(LL_ERR, "init_holiday: parse error for string [%s]!", buffer);
- exit(1);
- }
- year = 0;
- }
-
- if((newh = (struct holiday *) malloc(sizeof(struct holiday))) == NULL)
- {
- llog(LL_ERR, "init_holiday: malloc failed for struct holiday!\n");
- exit(1);
- }
-
- if(year)
- {
- DBGL(DL_VALID, (llog(LL_DBG, "init_holidays: add %d.%d.%d", day, month, year)));
- }
- else
- {
- DBGL(DL_VALID, (llog(LL_DBG, "init_holidays: add %d.%d", day, month)));
- }
-
- newh->day = day;
- newh->month = month;
- newh->year = year;
- newh->next = NULL;
-
- if(firsth == NULL)
- {
- firsth = newh;
- }
- else
- {
- lasth->next = newh;
- }
- lasth = newh;
- }
- fclose(fp);
-}
-
-/*---------------------------------------------------------------------------*
- * free all holidays
- *---------------------------------------------------------------------------*/
-void
-free_holidays(void)
-{
- free_holiday(firsth);
-}
-
-/*---------------------------------------------------------------------------*
- * free holidayes
- *---------------------------------------------------------------------------*/
-static void
-free_holiday(struct holiday *ptr)
-{
-
- if(ptr == NULL)
- return;
-
- if(ptr->next != NULL)
- free_holiday(ptr->next);
-
- free(ptr);
-}
-
-/*---------------------------------------------------------------------------*
- * check if date/month/year is a holiday
- *---------------------------------------------------------------------------*/
-int
-isholiday(int d, int m, int y)
-{
- struct holiday *ch = NULL;
-
- if(firsth == NULL)
- return(0);
-
- ch = firsth;
-
- for(;;)
- {
- if(ch->day == d && ch->month == m)
- {
- if(ch->year == 0)
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isholiday: %d.%d is a holiday!", d, m)));
- return(1);
- }
- else if(ch->year == y)
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isholiday: %d.%d.%d is a holiday!", d, m, y)));
- return(1);
- }
- }
-
- if(ch->next == NULL)
- break;
-
- ch = ch->next;
- }
- return(0);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/isdnd.8 b/usr.sbin/i4b/isdnd/isdnd.8
deleted file mode 100644
index b3c749a..0000000
--- a/usr.sbin/i4b/isdnd/isdnd.8
+++ /dev/null
@@ -1,428 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2001 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.
-.\"
-.\" $Id: isdnd.8,v 1.29 2000/05/02 11:50:28 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Wed May 2 10:48:30 2001]
-.\"
-.Dd July 5, 2007
-.Dt ISDND 8
-.Os
-.Sh NAME
-.Nm isdnd
-.Nd isdn4bsd ISDN connection management daemon
-.Sh SYNOPSIS
-.Nm
-.Op Fl c Ar configfile
-.Op Fl d Ar debuglevel
-.Op Fl f
-.Op Fl F
-.Op Fl l
-.Op Fl L Ar logfile
-.Op Fl P
-.Op Fl r Ar device
-.Op Fl s Ar facility
-.Op Fl t Ar terminaltype
-.Op Fl u Ar charging unit length
-.Op Fl m
-.Sh DESCRIPTION
-The
-.Nm
-utility
-is the isdn4bsd package daemon which manages all ISDN related connection
-and disconnection of ISDN devices supported by the package.
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl c
-Use
-.Ar configfile
-as the name of the runtime configuration filename for
-.Nm
-instead of the default file
-.Li /etc/isdn/isdnd.rc .
-.It Fl d
-If debugging support is compiled into
-.Nm
-this option is used to specify the debugging level, or better which kind
-of debugging messages are displayed.
-The debugging level is the sum of the
-following values:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar 0x001
-general debugging.
-.It Ar 0x002
-rates calculation.
-.It Ar 0x004
-timing calculations.
-.It Ar 0x008
-state transitions.
-.It Ar 0x010
-retry handling.
-.It Ar 0x020
-dialing.
-.It Ar 0x040
-process handling.
-.It Ar 0x080
-isdn4bsd kernel i/o calls.
-.It Ar 0x100
-controller and channel busy/free messages.
-.It Ar 0x200
-isdnd.rc configuration file processing.
-.It Ar 0x400
-outgoing call budget handling.
-.It Ar 0x800
-valid keyword and holiday file processing.
-.El
-.Pp
-The value can be specified in any number base supported by the
-.Xr sscanf 3
-library routine.
-.Pp
-In addition, this option accepts also the character 'n' as an argument to
-disable displaying debug messages on the full-screen display.
-.Pp
-.It Fl f
-Specifying this option causes
-.Nm
-to enter the full-screen mode of operation.
-When operating in this mode,
-entering the control character
-.Em Control-L
-causes the display to be refreshed and entering
-.Em Carriage-Return
-or
-.Em Enter
-will pop-up a command window.
-Because the
-.Nm
-utility will not listen to messages while the command window is active,
-this command window will disappear automatically after 5 seconds without
-any command key press.
-.Pp
-While the command window is active,
-.Em Tab
-or
-.Em Space
-advances to the next menu item.
-To execute a command, press
-.Em Return
-or
-.Em Enter
-for the highlighted menu item, or enter the number corresponding to the
-item to be executed or enter the capitalized character in the menu item
-description.
-.It Fl l
-If this option is set, logging is not done via the
-.Xr syslogd 8
-facility but instead is appended to a file.
-.It Fl L
-Specifies the name of the logfile which is used when the option
-.Em -l
-is set.
-See also the keyword
-.Em rotatesuffix
-in the system section of
-.Xr isdnd.rc 5 .
-.It Fl P
-This option prints out the parsed and verified isdnd configuration in the same
-format as the isdnd.rc file.
-This output can be used as an isdnd.rc file.
-This
-feature is especially useful when debugging an isdnd.rc file to see, what the
-default settings of options are when they are not set in the isdnd.rc input
-file.
-.Pp
-The
-.Nm
-exits after the printout is done.
-.It Fl F
-This option prevents
-.Nm
-to detach from the controlling tty and become a daemon.
-.It Fl r
-In conjunction with the
-.Fl t
-option,
-.Ar device
-specifies a terminal device which becomes the controlling tty for
-.Nm
-and on which the full-screen mode output is displayed.
-.It Fl s
-This option may be used to specify the logging facility in case
-.Xr syslog 3
-logging is configured and another facility than the default LOCAL0
-facility shall be used.
-The facility is to be specified as an integer in
-the range 0-11 or 16-23 (see the file /usr/include/syslog.h).
-.It Fl t
-In conjunction with the
-.Fl f
-and
-.Fl r
-options,
-.Ar terminaltype
-specifies a terminal type or termcap entry name (such as vt220) for the device
-used for
-.Nm
-full-screen output.
-This is useful if an unused (no getty running) tty line is
-used for full-screen output for which no
-.Li TERM
-environment variable exists.
-.It Fl u
-Specifies the length of a charging unit in case the config file entry
-keyword
-.Em unitlenghtsrc
-is set to
-.Em cmdl .
-.It Fl m
-If the isdn daemon is compiled with local or remote monitoring support,
-this option disables all monitoring access.
-It overrides the config
-file option
-.Em monitor-allowed .
-.El
-.Sh INTERACTION WITH THE KERNEL
-The
-.Nm
-utility
-communicates with the kernel part of isdn4bsd by receiving status and
-event messages
-.Xr ( read 2
-from device
-.Pa /dev/i4b )
-and by transmitting commands and responses
-.Xr ( ioctl 2
-from device
-.Pa /dev/i4b ) .
-.Pp
-The messages and message parameters are documented in the include
-file
-.Em /usr/include/i4b/i4b_ioctl.h .
-.Pp
-Supported command and response messages (ioctls) to the kernel are:
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I4B_CDID_REQ
-Request a unique Call Description IDentifier (cdid) which identifies
-uniquely a single interaction of the local D channel with the exchange.
-.It Ar I4B_CONNECT_REQ
-Actively request a call setup to a remote ISDN subscriber.
-.It Ar I4B_CONNECT_RESP
-Respond to an incoming call, either accept, reject or ignore it.
-.It Ar I4B_DISCONNECT_REQ
-Actively terminate a connection.
-.It Ar I4B_CTRL_INFO_REQ
-Request information about an installed ISDN controller card.
-.It Ar I4B_DIALOUT_RESP
-Give information about call setup to driver who requested dialing out.
-.It Ar I4B_TIMEOUT_UPD
-Update the kernels timeout value(s) in case of dynamically calculated
-shorthold mode timing changes.
-.It Ar I4B_UPDOWN_IND
-Inform the kernel userland drivers about interface soft up/down status
-changes.
-.It Ar I4B_CTRL_DOWNLOAD
-Download firmware to active card(s).
-.It Ar I4B_ACTIVE_DIAGNOSTIC
-Return diagnostic information from active cards.
-.El
-.Pp
-.Pp
-Supported status and event messages from the kernel are:
-.Bl -tag -width Ds -compact -offset indent
-.It Ar MSG_CONNECT_IND
-An incoming call from a remote ISDN user is indicated.
-.It Ar MSG_CONNECT_ACTIVE_IND
-After an incoming call has been accepted locally or an outgoing call has
-been accepted by a remote, the exchange signaled an active connection
-and the corresponding B-channel is switched through.
-.It Ar MSG_DISCONNECT_IND
-A call was terminated.
-.It Ar MSG_DIALOUT_IND
-A userland interface driver requests the daemon to dial out (typically a
-network interface when a packet arrives in its send queue).
-.It Ar MSG_IDLE_TIMEOUT_IND
-A call was terminated by the isdn4bsd kernel driver because a B-channel
-idle timeout occurred.
-.It Ar MSG_ACCT_IND
-Accounting information from a network driver.
-.It Ar MSG_CHARGING_IND
-Charging information from the kernel.
-.El
-.Pp
-.Ss OUTGOING CALLS
-Currently the only possibility to trigger an outgoing call is that an
-isdn4bsd network driver
-.Em (ipr<n>)
-sends a
-.Em MSG_DIALOUT_IND
-to the
-.Nm
-utility.
-.Pp
-The daemon requests a new CDID from the kernel by using the
-.Em I4B_CDID_REQ
-ioctl message, this CDID is now used in all interactions with the kernel
-to identify this single call until a disconnect occurs.
-.Pp
-After getting the CDID, the daemon looks up several additional information
-in its entry section of the configuration corresponding to that connection
-and issues a
-.Em I4B_CONNECT_REQ
-ioctl message to the kernel.
-The kernel now dials the remote side and
-if the remote side accepts the call, the kernel sends a
-.Em MSG_CONNECT_ACTIVE_IND
-to the daemon.
-.Pp
-The call is terminated by either the local side timing out or the remote
-side hanging up the connection or the local side actively sending a
-.Em I4B_DISCONNECT_REQ
-ioctl message, both events are signaled to the
-.Nm
-by the kernel sending the
-.Em I4B_DISCONNECT_IND
-message and the CDID corresponding to the call is no longer valid.
-.Pp
-.Ss INCOMING CALLS
-Incoming calls are signaled to the
-.Nm
-by the kernel transmitting the
-.Em MSG_CONNECT_IND
-message to the daemon.
-.Pp
-With the information contained in this message, the
-.Nm
-searches the entry section of its configuration database and if a match is
-found, it accepts or rejects the call or, if no match is found, it ignores the
-call - all by issuing a
-.Em I4B_CONNECT_RESP
-ioctl message with the appropriate parameters to the kernel.
-.Pp
-In case the daemon decided to accept the call, the kernel signals this
-by sending a
-.Em MSG_CONNECT_ACTIVE_IND
-message to the daemon.
-.Pp
-The call is terminated by either the local side timing out or the remote
-side hanging up the connection or the local side actively sending a
-.Em I4B_DISCONNECT_REQ
-ioctl message, both events are signaled to the
-.Nm
-by the kernel sending the
-.Em I4B_DISCONNECT_IND
-message and the CDID corresponding to the call is no longer valid.
-.Sh SIGNALS
-Sending a HUP signal to
-.Nm
-causes all open connections to be terminated and the configuration file is
-reread.
-In case aliasfile handling was enabled, the aliasfile is also
-reread.
-.Pp
-Sending a USR1 signal to
-.Nm
-causes the accounting file and the logfile (if logging to a file is used
-instead of logging via the
-.Xr syslog 3
-facility) to be closed and reopened to make logfile rotation possible.
-.Sh ENVIRONMENT
-The following environment variables affect the execution of
-.Nm :
-.Bl -tag -width Ds
-.It Ev TERM
-The terminal type when running in full-screen display mode.
-See
-.Xr environ 7
-for more information.
-.El
-.Sh FILES
-.Bl -tag -width /etc/isdn/isdnd.rates
-.It Pa /dev/i4b
-The device-file used to communicate with the kernel ISDN driver subsystem.
-.It Pa /var/log/messages
-A record of the actions in case of syslogd logging support.
-.It Pa /var/log/isdnd.acct
-The default accounting information filename (if accounting is configured).
-.It Pa /var/log/isdnd.log
-The default logging filename (if logging to a file is configured).
-.It Pa /var/run/isdnd.pid
-The process id of the isdn daemon (also known as "lockfile" to isdnd, preventing multiple invocations of it).
-.It Pa /usr/local/lib/isdn
-.It Pa /etc/isdn
-The directory where isdnd expects some supplementary data files and programs
-for telephone answering support.
-.It Pa /etc/isdn/isdnd.rc
-The default runtime configuration file.
-.It Pa /etc/isdn/isdnd.rates
-The default unit charging rates specification file.
-.It Pa /etc/isdn/isdntel.alias
-The default table (if aliasing is enabled) to convert phone number to caller's name.
-.El
-.Sh EXIT STATUS
-Exit status is 0 on success, 1 on error.
-.Sh EXAMPLES
-For a first try, the following command should be used to start
-.Nm
-in foreground mode for better debugging the configuration setup:
-.Bd -literal -offset indent
-isdnd -d0xf9 -F
-.Ed
-.Pp
-This will start isdnd with reasonable debugging settings and produce
-output on the current terminal.
-The
-.Nm
-utility can then be terminated by entering Control-C.
-.Pp
-Another example, the command:
-.Bd -literal -offset indent
-isdnd -d0xf9 -f -r /dev/ttyv3 -t vt100
-.Ed
-.Pp
-will start
-.Nm
-with reasonable debugging messages enabled, full-screen mode of operation,
-full-screen display redirected to /dev/ttyv3 and using a termcap entry
-for vt100 on this display.
-.Sh SEE ALSO
-.Xr i4bing 4 ,
-.Xr i4bipr 4 ,
-.Xr i4bisppp 4 ,
-.Xr isdnd.rates 5 ,
-.Xr isdnd.rc 5 ,
-.Xr isdntel 8 ,
-.Xr isdntrace 8 ,
-.Xr syslogd 8
-.Sh AUTHORS
-The
-.Nm
-utility and this manual page were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
-.Sh BUGS
-Still one or more left.
diff --git a/usr.sbin/i4b/isdnd/isdnd.acct.5 b/usr.sbin/i4b/isdnd/isdnd.acct.5
deleted file mode 100644
index b2db667..0000000
--- a/usr.sbin/i4b/isdnd/isdnd.acct.5
+++ /dev/null
@@ -1,108 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1999 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.
-.\"
-.\" $Id: isdnd.acct.5,v 1.11 1999/12/13 22:11:55 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Mon Dec 13 22:58:12 1999]
-.\"
-.Dd September 11, 1998
-.Dt ISDND.ACCT 5
-.Os
-.Sh NAME
-.Nm isdnd.acct
-.Nd isdn4bsd ISDN management daemon accounting file format
-.Sh DESCRIPTION
-The file
-.Pa isdnd.acct
-contains accounting information which is written if the variable
-.Em useacctfile
-in the
-.Xr isdnd 8
-configuration file
-.Xr isdnd.rc 5
-is set to
-.Em on
-and charging information transmission has been subscribed for the
-ISDN connection (AOCD or AOCE).
-.Pp
-If the variable
-.Em acctall
-is set to
-.Em on ,
-accounting information is written even if the local site was not charged
-or no charging information is available or is not subscribed.
-.Pp
-The general format of an accounting line is as follows:
-.Pp
-.Dl FROM - UNTIL NAME UNITS (SECONDS) (INBYTES/OUTBYTES)
-.Pp
-.Em FROM
-is the time the connection was established in the format
-.Dl Day.Month.Year Hour:Minutes:seconds
-.Pp
-.Em UNTIL
-is the time the connection was closed.
-The format is the same as
-described for
-.Em FROM
-above.
-.Pp
-.Em NAME
-is the symbolic name got from the
-.Em name
-entry of the
-.Xr isdnd.rc 5
-config file for this connection.
-.Pp
-.Em UNITS
-is the amount of charging units billed for the connection.
-.Pp
-.Em SECONDS
-is the number of seconds the connection lasted.
-.Pp
-.Em INBYTES
-and
-.Em OUTBYTES
-is the (optional) number of bytes that were transferred.
-.Sh FILES
-.Bl -tag -width /var/log/isdnd.acct -compact
-.It Pa /var/log/isdnd.acct
-The default accounting information file for the
-.Nm isdnd
-ISDN daemon.
-.El
-.Sh EXAMPLES
-This is a typical accounting line:
-.Pp
-.Dl 12.06.97 10:41:37 - 12.06.97 10:45:18 GROGGY 2 (65) (4711/1147)
-.Sh SEE ALSO
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8
-.Sh AUTHORS
-The
-.Xr isdnd 8
-daemon and this manual page were written by
-.An Hellmuth Michaelis Aq hm@kts.org .
diff --git a/usr.sbin/i4b/isdnd/isdnd.h b/usr.sbin/i4b/isdnd/isdnd.h
deleted file mode 100644
index 4e65bfe..0000000
--- a/usr.sbin/i4b/isdnd/isdnd.h
+++ /dev/null
@@ -1,907 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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 daemon - main header file
- * -----------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:18:48 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _ISDND_H_
-#define _ISDND_H_
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <strings.h>
-#include <string.h>
-#include <ctype.h>
-#include <syslog.h>
-#include <regex.h>
-#include <time.h>
-
-#ifdef USE_CURSES
-#include <curses.h>
-#endif
-
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-
-#include <sys/queue.h> /* TAILQ_ macros */
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#ifdef USE_RTPRIO
-#include <sys/rtprio.h>
-#endif
-
-#include <net/if_sppp.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-
-#include "config.h" /* compile time configuration */
-#include "pathnames.h" /* location of files */
-#include "alias.h" /* alias file processing */
-
-/*---------------------------------------------------------------------------*
- * some general definitions
- *---------------------------------------------------------------------------*/
-#define GOOD 0 /* general "good" or "ok" return*/
-#define ERROR (-1) /* general error return */
-#define WARNING (-2) /* warning return */
-#define INVALID (-1) /* an invalid integer */
-
-/*---------------------------------------------------------------------------*
- * misc
- *---------------------------------------------------------------------------*/
-#define RTPRIO_NOTUSED (-1) /* rtprio is not used for isdnd */
-
-/*---------------------------------------------------------------------------*
- * debug flag bits
- *---------------------------------------------------------------------------*/
-#define DL_MSG 0x0001 /* general debug messages */
-#define DL_RATES 0x0002 /* messages related to rates */
-#define DL_TIME 0x0004 /* messages related to timing */
-#define DL_STATE 0x0008 /* messages related to states changes */
-#define DL_RCVRY 0x0010 /* messages related to dial recovery */
-#define DL_DIAL 0x0020 /* messages related to dial recovery */
-#define DL_PROC 0x0040 /* messages related to process handling */
-#define DL_DRVR 0x0080 /* messages related to kernel i4b msg i/o*/
-#define DL_CNST 0x0100 /* messages related to controller state */
-#define DL_RCCF 0x0200 /* messages related to isdnd.rc at boot */
-#define DL_BDGT 0x0400 /* messages related to budgets */
-#define DL_VALID 0x0800 /* messages related to valid keyword */
-
-#ifdef DEBUG
-#define DBGL(cond, dolog) if(cond & debug_flags) dolog
-#else
-#define DBGL(cond, dolog)
-#endif
-
-/*---------------------------------------------------------------------------*
- * curses fullscreen display definitions
- *---------------------------------------------------------------------------*/
-
-/* window dimensions */
-#define UPPER_B 2 /* upper window start */
-
-/* horizontal positions for upper window */
-#define H_CNTL 0 /* controller */
-#define H_TEI 2 /* TEI */
-#define H_CHAN (H_TEI+4) /* channel */
-#define H_TELN (H_CHAN+2) /* telephone number */
-#define H_IFN (H_TELN+23) /* interfacename */
-#define H_IO (H_IFN+7) /* incoming or outgoing */
-#define H_OUT (H_IO+4) /* # of bytes out */
-#define H_OUTBPS (H_OUT+11) /* bytes per second out */
-#define H_IN (H_OUTBPS+5) /* # of bytes in */
-#define H_INBPS (H_IN+11) /* bytes per second in */
-#define H_UNITS (H_INBPS+6) /* # of charging units */
-
-/* fullscreen mode menu window */
-#define WMENU_LEN 35 /* width of menu window */
-#define WMENU_TITLE "Command" /* title string */
-#define WMENU_POSLN 10 /* menu position, line */
-#define WMENU_POSCO 5 /* menu position, col */
-#define WMITEMS 6 /* no of menu items */
-#define WMENU_HGT (WMITEMS + 4) /* menu window height */
-
-#define WREFRESH 0
-#define WHANGUP 1
-#define WREREAD 2
-#define WSHOW 3
-#define WBUDGET 4
-#define WQUIT 5
-
-#define WMTIMEOUT 5 /* timeout in seconds */
-
-/*---------------------------------------------------------------------------*
- * charging rates
- *---------------------------------------------------------------------------*/
-#define NDAYS 7 /* number of days in a week */
-#define NRATES 4 /* number of rate structures supported */
-
-/* struct for rates - each day has one or more */
-struct rates
-{
- int start_time; /* hour and min at which this rate starts, e.g. 12:20 12*60+20*/
- int end_time; /* hour and min at which this rate ends, e.g. 19:10 19*60+10*/
- int rate; /* how long can I telephone at this price, seconds */
- struct rates *next;
-};
-
-/*---------------------------------------------------------------------------*
- * the internal identifiers for isdnd log levels. CAUTION: this has to stay
- * in sync with the loglevel to text and sysloglevel table in log.c !!
- *---------------------------------------------------------------------------*/
-enum logids
-{
- LL_ERR, /* error conditions - everything which caused an error */
- LL_WRN, /* warning conditions - nonfatal abnormal conditions */
- LL_DMN, /* normal but significant condition - status of daemon */
- LL_CHD, /* informational - everything regarding call handling */
- LL_DBG, /* debug messages - everything which helps debugging */
- LL_MER, /* monitor error messages - not sent to remote */
- LL_PKT /* packet logging - log the first few packets */
-};
-
-/*---------------------------------------------------------------------------*
- * state machine events
- *---------------------------------------------------------------------------*/
-enum events
-{
- /* incoming messages */
-
- EV_MCI, /* MSG_CONNECT_IND */
- EV_MCAI, /* MSG_CONNECT_ACTIVE_IND */
- EV_MDI, /* MSG_DISCONNECT_IND */
- EV_MDO, /* MSG_DIALOUT */
-
- /* local requests */
-
- EV_TIMO, /* timer expired */
- EV_DRQ, /* disconnect request */
- EV_CBRQ, /* callback request */
- EV_ALRT, /* alerting request */
-
- /* illegal */
-
- EV_ILL /* illegal event */
-};
-
-#define N_EVENTS (EV_ILL+1) /* no of possible events */
-
-/*---------------------------------------------------------------------------*
- * this struct describes the numbers to try to dial out
- *---------------------------------------------------------------------------*/
-typedef struct {
- char number[TELNO_MAX]; /* number */
- char subaddr[SUBADDR_MAX]; /* subaddr */
-} number_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes the numbers to try to dial out
- *---------------------------------------------------------------------------*/
-typedef struct {
- char number[TELNO_MAX]; /* remote number to dial */
- char subaddr[SUBADDR_MAX]; /* remote subaddr */
- int flag; /* usage flag */
-#define RNF_IDLE 0
-#define RNF_SUCC 1 /* last dial was ok */
-} remote_number_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes numbers allowed to dial in
- *---------------------------------------------------------------------------*/
-typedef struct {
- char number[TELNO_MAX]; /* calling party number */
- char subaddr[SUBADDR_MAX];/* calling party subaddr */
-} incoming_number_t;
-
-/*---------------------------------------------------------------------------*
- * this structure describes a prematurely aborted called-back dialout
- *---------------------------------------------------------------------------*/
-typedef struct {
- int cdid; /* call handle */
- int controller; /* the controller used to dial out */
- int channel; /* the channel assigned to the outgoing call */
- /* XXX - timeout handling and error recovery? */
-} phantom_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes one complete configuration entry
- *---------------------------------------------------------------------------*/
-typedef struct cfg_entry {
-
- /* ====== filled in at startup configuration, then static ===========*/
-
- char name[32]; /* id for this entry */
-
- int isdncontroller; /* controller to use 0 ... n */
- int isdnchannel; /* channel to use */
-
- int isdntxdelin; /* tx delay, incoming connections */
- int isdntxdelout; /* tx delay, outgoing connections */
-
- int usrdevicename; /* userland device to use */
- int usrdeviceunit; /* userland unit to use */
-
- int remote_numbers_count; /* number of remote numbers */
- int remote_subaddr_count; /* number of remote subaddr */
-#define MAXRNUMBERS 8 /* max remote numbers */
-
- remote_number_t remote_numbers[MAXRNUMBERS]; /* remote numbers to dial */
-
-
- int remote_numbers_handling; /* how to handle the remote dialing */
-#define RNH_NEXT 0 /* use next number after last successfull */
-#define RNH_LAST 1 /* use last successfull for next call */
-#define RNH_FIRST 2 /* always use first number for next call */
-
- number_t local_phone_dialout; /* our number to tell remote*/
- number_t local_phone_incoming; /* answer calls for this local number */
-
-#define MAX_INCOMING 8
- int incoming_numbers_count; /* number of incoming allowed numbers */
- int incoming_subaddr_count; /* number of incoming allowed subaddr */
- incoming_number_t remote_phone_incoming[MAX_INCOMING]; /* answer calls from this remote machine */
-
- int dialin_reaction; /* what to do with incoming calls */
-#define REACT_ACCEPT 0
-#define REACT_REJECT 1
-#define REACT_IGNORE 2
-#define REACT_ANSWER 3
-#define REACT_CALLBACK 4
-
- int b1protocol; /* hdlc / raw */
-
- int bcap; /* special bearer capability (DoV) */
-
- int idle_time_in; /* max idle time incoming calls */
- int idle_time_out; /* max idle time outgoing calls */
-
- int shorthold_algorithm; /* shorthold algorithm */
-
- int unitlength; /* length of a charging unit */
-#define UNITLENGTH_DEFAULT 60 /* last resort unit length */
-
- int earlyhangup; /* time in seconds to hangup */
- /* before the next expected */
- /* charging unit */
-#define EARLYHANGUP_DEFAULT 5
-
- int ratetype; /* type of rate */
-#define NO_RATE (NRATES+1)
-#define INVALID_RATE (-1)
-
- int unitlengthsrc; /* where we get the unit length from */
-#define ULSRC_NONE 0 /* nowhere specified */
-#define ULSRC_CMDL 1 /* specified on commandline */
-#define ULSRC_CMDLMIN 5 /* minimum value from cmdl */
-#define ULSRC_CMDLMAX 3600 /* minimum value from cmdl */
-#define ULSRC_CONF 2 /* get it from config file */
-#define ULSRC_RATE 3 /* get it dynamic from ratesfile*/
-#define ULSRC_DYN 4 /* dynamic calculated from AOCD */
-
- char *answerprog; /* program to use for answering */
- char *connectprog; /* program run after negotiation finished */
- char *disconnectprog; /* program run after shutdown is complete */
-
- int callbackwait; /* time to wait before calling back */
-#define CALLBACKWAIT_MIN 1
-
- int calledbackwait; /* time to wait for remote callback */
-#define CALLEDBACKWAIT_MIN 2
-
- int dialretries; /* no. of dial tries */
-#define DIALRETRIES_DEF 1
-
- int recoverytime; /* time between 2 dial tries */
-#define RECOVERYTIME_MIN 1
-
- int dialrandincr; /* use random dial time incr */
-
- int usedown; /* set interface down yes/no */
- int downtries; /* retries before i/f is set down */
-#define DOWN_TRIES_MIN 2
-#define DOWN_TRIES_MAX 20
- int downtime; /* time i/f is down */
-#define DOWN_TIME_MIN 10 /* 10 seconds */
-#define DOWN_TIME_MAX 3600 /* 1 hour */
-
- int dialouttype; /* type of outgoing connection */
-#define DIALOUT_NORMAL 0 /* normal dialout behaviour */
-#define DIALOUT_CALLEDBACK 1 /* remote is expected to callback */
-
- int alert; /* alert time in sec if nonzero */
-#define MINALERT 5 /* 5 secs min */
-#define MAXALERT (3*60) /* 3 minutes max */
-
- int inout; /* in/out, in-only or out-only */
-#define DIR_INOUT 0
-#define DIR_INONLY 1
-#define DIR_OUTONLY 2
-
- int usesubaddr; /* use subaddresses */
-
- int budget_callbackperiod; /* length of a budget period (s)*/
- int budget_callbackncalls; /* call budget for a period */
- char *budget_callbacks_file; /* filename to store callback stats */
- char budget_callbacksfile_rotate;
-
- int budget_calloutperiod; /* length of a budget period (s)*/
- int budget_calloutncalls; /* call budget for a period */
- char *budget_callouts_file; /* filename to store callout stats */
- char budget_calloutsfile_rotate;
-
- int ppp_expect_auth;
- int ppp_send_auth;
-#define AUTH_UNDEF 0
-#define AUTH_NONE 1
-#define AUTH_PAP 2
-#define AUTH_CHAP 3
-
- int ppp_auth_flags;
-#define AUTH_RECHALLENGE 0x01
-#define AUTH_REQUIRED 0x02
-
- char ppp_expect_name[AUTHNAMELEN]; /* PPP PAP/CHAP login name */
- char ppp_send_name[AUTHNAMELEN];
-
- char ppp_expect_password[AUTHKEYLEN];
- char ppp_send_password[AUTHKEYLEN];
-
- int day; /* days valid */
-#define SU 0x01
-#define MO 0x02
-#define TU 0x04
-#define WE 0x08
-#define TH 0x10
-#define FR 0x20
-#define SA 0x40
-#define HD 0x80 /* holiday */
- int fromhr; /* time valid */
- int frommin;
- int tohr;
- int tomin;
-
- time_t maxconnecttime; /* maximum connection time */
-
-/*===========================================================================*/
-/*============ filled in after start, then dynamic ==========================*/
-/*===========================================================================*/
-
- int cdid; /* cdid for call */
-#define CDID_RESERVED (-1)
-
- int isdncontrollerused; /* the one we are using */
- int isdnchannelused; /* the one we are using */
-
- int fs_position; /* fullscreen position */
-
- int state; /* state of connection */
-#define ST_IDLE 0 /* connection is idle / disconnected */
-
- /* normal dial out to remote */
-#define ST_DIAL 1 /* dialing */
-#define ST_DIALRTMRCHD 2 /* wait for dial retry time reached */
-#define ST_DIALRETRY 3 /* last/first dialing failed, retry */
-
- /* PCB: passive callback, i'm being called back */
-#define ST_PCB_DIAL 4 /* dialing, trigger a callback */
-#define ST_PCB_DIALFAIL 5 /* dialing failed triggering a callbk */
-#define ST_PCB_WAITCALL 6 /* waiting for callback from remote */
-
- /* ACB: active callback, i'm calling back */
-#define ST_ACB_WAITDISC 7 /* got call, wait for disconnect */
-#define ST_ACB_WAITDIAL 8 /* wait until allowed to callback */
-#define ST_ACB_DIAL 9 /* callback to remote */
-#define ST_ACB_DIALFAIL 10 /* callback to remote failed */
-
- /* normal non-dialling states */
-#define ST_ACCEPTED 11 /* remote accepted */
-#define ST_CONNECTED 12 /* connected with remote */
-#define ST_WAITDISCI 13 /* tx disc req, wait for disc ind */
-#define ST_DOWN 14 /* interface is down */
-#define ST_ALERT 15 /* interface is waiting for alert time*/
-
- /* illegal and pseudo states */
-#define ST_ILL 16 /* illegal state */
-#define ST_SUSE 17 /* subroutine sets new state */
-
-#define N_STATES (ST_ILL+1) /* max number of states */
-
- cause_t disc_cause; /* cause from disconnect */
-
- int local_disconnect; /* flag, who disconnected */
-#define DISCON_LOC 0
-#define DISCON_REM 1
-
- int timerval; /* value for timer, 0 if inactive */
- int timerremain; /* remaining time */
-
- int hangup; /* flag, hangup connection asap */
-
- number_t real_phone_incoming; /* real remote telno in case of wildcard */
-
- int last_remote_number; /* index of last used dialout number*/
-
- number_t remote_phone_dialout; /* used remote number to dial */
-
- int direction; /* incoming or outgoing */
-#define DIR_IN 0
-#define DIR_OUT 1
-
- int charge; /* charge in units */
- int last_charge; /* last charge in units */
-
- int inbytes; /* # of bytes from remote */
- int iinbytes; /* # of bytes from remote on the line */
- int inbps; /* bytes/sec from remote */
- int outbytes; /* # of bytes to remote */
- int ioutbytes; /* # of bytes to remote on the line */
- int outbps; /* bytes/sec to remote */
-
- time_t connect_time; /* time connection was established */
-
- time_t aoc_last; /* last AOCD timestamp */
- time_t aoc_now; /* current AOCD timestamp */
- time_t aoc_diff; /* current unit length */
- time_t aoc_lastdiff; /* last charge unit length */
- int aoc_valid; /* flag: time diff is valid */
-#define AOC_INVALID 0 /* aoc_diff is NOT valid */
-#define AOC_VALID 1 /* aoc_diff is valid */
-
- time_t last_dial_time; /* time of last dialing */
- time_t last_release_time; /* time of last hangup */
-
- int dial_count; /* number of dialout tries */
- int randomtime; /* random() part of recoverytime*/
-#define RANDOM_MASK 0x04 /* bits used from randomtime */
-
- int down_retry_count; /* retry cycle count for usedown*/
- time_t went_down_time; /* time i/f went down */
- phantom_t saved_call; /* outgoing call state if called
- back too early */
-
- int alert_time; /* count down of alert time */
- char display[DISPLAY_MAX];
-
- time_t budget_callbackperiod_time; /* end of current period */
- int budget_callbackncalls_cnt; /* amount of calls left */
-
- int budget_callback_req; /* requests */
- int budget_callback_done; /* call done */
- int budget_callback_rej; /* call refused */
-
- time_t budget_calloutperiod_time; /* end of current period */
- int budget_calloutncalls_cnt; /* amount of calls left */
-
- int budget_callout_req; /* requests */
- int budget_callout_done; /* call done */
- int budget_callout_rej; /* call refused */
-
- int budget_calltype; /* type of call */
-#define BUDGET_TYPE_CBACK 1
-#define BUDGET_TYPE_COUT 2
-
- char keypad[KEYPAD_MAX]; /* keypad string */
-} cfg_entry_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes state of controller with MAX_BCHAN b channels
- *---------------------------------------------------------------------------*/
-typedef struct isdn_ctrl_state {
- int ctrl_type; /* type: active/passive */
- int card_type; /* manufacturer (CARD_XXXX) */
- int protocol; /* ISDN D-channel protocol */
- char* firmware; /* loadable fimrware file name */
-
- int state; /* controller state */
-#define CTRL_DOWN 0 /* controller inoparable */
-#define CTRL_UP 1 /* controller may be used */
-#define MAX_BCHAN 30
- int stateb[MAX_BCHAN]; /* b channel state */
-#define CHAN_IDLE 0 /* channel is free for usage */
-#define CHAN_RUN 1 /* channel is occupied */
- int nbch; /* number of b channels */
- int freechans; /* number of unused channels */
- int tei; /* tei or -1 if invalid */
- int l1stat; /* layer 1 state */
- int l2stat; /* layer 2 state */
-} isdn_ctrl_state_t;
-
-/*---------------------------------------------------------------------------*
- * this struct describes a logging regular expression
- *---------------------------------------------------------------------------*/
-struct rarr {
- int re_flg; /* valid entry flag */
- char *re_expr; /* plain text expression */
- regex_t re; /* compiled expression */
- char *re_prog; /* the program to be executed */
-};
-
-#ifdef I4B_EXTERNAL_MONITOR
-/* for each rights entry we keep one of this structures around: */
-struct monitor_rights {
- TAILQ_ENTRY(monitor_rights) list; /* a list of this structures */
- char name[FILENAME_MAX]; /* net/host spec or filename */
- int rights; /* bitmask of allowed acces rights */
- u_int32_t net; /* net/host address (host byte order!) */
- u_int32_t mask; /* bitmask 1 = network, 0 = host (host byte order!) */
- int local; /* zero if remote access via tcp/ip */
-};
-#endif
-
-/*---------------------------------------------------------------------------*
- * global variables, storage allocation
- *---------------------------------------------------------------------------*/
-#ifdef MAIN
-
-int isdnfd; /* file handle, /dev/i4b */
-
-char mailto[MAXPATHLEN] = ""; /* panic mail address */
-char mailer[MAXPATHLEN] = ""; /* panic mail address */
-
-char *configfile = CONFIG_FILE_DEF; /* configuration filename */
-int config_error_flag = 0; /* error counter */
-
-#ifdef DEBUG
-int do_debug = 0; /* debug mode flag */
-int debug_flags = 0; /* debug options */
-int debug_noscreen = 0; /* not on fullscreen */
-#endif
-
-int do_bell = 0; /* bell on connect/disconnect */
-
-int do_fork = 1; /* run as daemon/foreground */
-
-int do_ttytype = 0; /* got new terminal type */
-char *ttype = ""; /* termcap entry name string */
-
-int do_rdev = 0; /* redirect output */
-char *rdev = ""; /* new device string */
-
-int do_print = 0; /* config file printout */
-
-int got_unitlen = 0; /* flag, got length of a unit */
-time_t unit_length; /* length of a unit */
-
-cfg_entry_t cfg_entry_tab[CFG_ENTRY_MAX]; /* configuration table */
-isdn_ctrl_state_t isdn_ctrl_tab[ISDN_CTRL_MAX]; /* controller states table */
-
-int ncontroller = 0; /* # of controllers available */
-int nentries = 0; /* # of entries in config tab */
-
-int uselogfile = 0; /* flag, use a logfile */
-char logfile[MAXPATHLEN] = LOG_FILE_DEF; /* log filename */
-FILE *logfp = NULL; /* log file pointer */
-int logfacility = LOG_LOCAL0; /* the syslog facility used */
-int nregex = 0; /* number of reg expr */
-struct rarr rarr[MAX_RE]; /* regexpr & progs table */
-
-char ratesfile[MAXPATHLEN] = RATES_FILE_DEF; /* rates filename */
-char *rate_error = NULL; /* errorcase: error string */
-int got_rate = 0; /* flag, ratesfile found */
-struct rates *rates[NRATES][NDAYS]; /* the rates structure */
-
-int useacctfile = 0; /* flag, write accounting */
-char acctfile[MAXPATHLEN] = ACCT_FILE_DEF; /* accounting filename */
-FILE *acctfp = NULL; /* accounting file pointer */
-int acct_all = 1; /* account all connections */
-
-int aliasing = 0; /* enable alias processing */
-char aliasfile[MAXPATHLEN] = ALIASFILE; /* alias file location */
-
-int do_fullscreen = 0; /* fullscreen log */
-int curses_ready = 0; /* curses initialized */
-
-#ifdef USE_CURSES
-WINDOW *upper_w; /* curses upper window pointer */
-WINDOW *mid_w; /* curses mid window pointer */
-WINDOW *lower_w; /* curses lower window pointer */
-#endif
-
-int rt_prio = RTPRIO_NOTUSED; /* realtime priority */
-
-/* monitor via network */
-
-int do_monitor = 0;
-int inhibit_monitor = 0;
-#ifdef I4B_EXTERNAL_MONITOR
-int monitorport = DEF_MONPORT;
-#else
-int monitorport = -1;
-#endif
-int accepted = 0;
-
-int isdntime = 0; /* flag, log time from exchange */
-int extcallattr = 0; /* flag, display extended caller attributes */
-
-char tinainitprog[MAXPATHLEN] = TINA_FILE_DEF;
-
-char rotatesuffix[MAXPATHLEN] = "";
-
-time_t starttime = 0;
-
-char holidayfile[MAXPATHLEN] = HOLIDAY_FILE_DEF; /* holiday filename */
-
-int addprefix = 0;
-char prefixnational[TELNO_MAX] = "";
-char prefixinternational[TELNO_MAX] = "";
-
-#else /* !MAIN */
-
-int isdnfd;
-
-char mailto[MAXPATHLEN];
-char mailer[MAXPATHLEN];
-
-char *configfile;
-int config_error_flag;
-
-#ifdef DEBUG
-int do_debug;
-int debug_flags;
-int debug_noscreen;
-#endif
-
-int do_bell;
-
-int do_fork;
-
-int do_ttytype;
-char *ttype;
-
-int do_rdev;
-char *rdev;
-
-int do_print;
-
-int got_unitlen;
-time_t unit_length;
-
-cfg_entry_t cfg_entry_tab[CFG_ENTRY_MAX]; /* configuration table */
-isdn_ctrl_state_t isdn_ctrl_tab[ISDN_CTRL_MAX]; /* controller states table */
-
-int ncontroller;
-int nentries;
-
-int uselogfile;
-char logfile[MAXPATHLEN];
-FILE *logfp;
-int logfacility;
-int nregex;
-struct rarr rarr[MAX_RE];
-
-char ratesfile[MAXPATHLEN];
-char *rate_error;
-int got_rate;
-struct rates *rates[NRATES][NDAYS];
-
-int useacctfile;
-char acctfile[MAXPATHLEN];
-FILE *acctfp;
-int acct_all;
-
-int aliasing;
-char aliasfile[MAXPATHLEN];
-
-int do_fullscreen;
-int curses_ready;
-
-#ifdef USE_CURSES
-WINDOW *upper_w;
-WINDOW *mid_w;
-WINDOW *lower_w;
-#endif
-
-int rt_prio;
-
-int do_monitor;
-int inhibit_monitor;
-int monitorport;
-int accepted;
-
-int isdntime;
-int extcallattr;
-
-char tinainitprog[MAXPATHLEN];
-
-char rotatesuffix[MAXPATHLEN];
-
-time_t starttime;
-
-char holidayfile[MAXPATHLEN];
-
-int addprefix;
-char prefixnational[TELNO_MAX];
-char prefixinternational[TELNO_MAX];
-
-#endif /* MAIN */
-
-int add_number_prefix( char *number, int type_of_number );
-char * bdrivername ( int drivertype );
-void cfg_setval ( int keyword );
-void check_and_kill ( cfg_entry_t *cep );
-void check_pid ( void );
-void close_allactive ( void );
-void configure ( char *filename, int reread );
-void daemonize ( void );
-void dialresponse(cfg_entry_t *cep, int dstat);
-void display_acct ( cfg_entry_t *cep );
-void display_bell ( void );
-void display_ccharge ( cfg_entry_t *cep, int units );
-void display_chans ( void );
-void display_charge ( cfg_entry_t *cep );
-void display_connect ( cfg_entry_t *cep );
-void display_disconnect ( cfg_entry_t *cep );
-void display_l12stat(int controller, int layer, int state);
-void display_tei(int controller, int tei);
-void display_updown ( cfg_entry_t *cep, int updown );
-void do_exit ( int exitval );
-void do_menu ( void );
-int exec_answer ( cfg_entry_t *cep );
-int exec_connect_prog ( cfg_entry_t *cep, const char *prog, int link_down );
-pid_t exec_prog ( char *prog, char **arglist );
-cfg_entry_t * find_by_device_for_dialout ( int drivertype, int driverunit );
-cfg_entry_t *find_by_device_for_dialoutnumber(msg_dialoutnumber_ind_t *mp);
-cfg_entry_t *find_by_device_for_keypad(int drivertype, int driverunit, int cmdlen, char *cmd);
-cfg_entry_t * find_matching_entry_incoming ( msg_connect_ind_t *mp );
-cfg_entry_t * find_active_entry_by_driver ( int drivertype, int driverunit );
-void finish_log ( void );
-char * getlogdatetime ( void );
-int get_cdid ( void );
-cfg_entry_t * get_cep_by_cc ( int ctrlr, int chan );
-cfg_entry_t * get_cep_by_driver ( int drivertype, int driverunit );
-cfg_entry_t * get_cep_by_cdid ( int cdid );
-int get_current_rate ( cfg_entry_t *cep, int logit );
-void handle_charge ( cfg_entry_t *cep );
-void handle_recovery ( void );
-void handle_scrprs(int cdid, int scr, int prs, char *caller);
-void if_up(cfg_entry_t *cep);
-void if_down(cfg_entry_t *cep);
-void init_controller ( void );
-void init_controller_protocol ( void );
-void init_log ( void );
-void init_screen ( void );
-void llog ( int what, const char *fmt, ... );
-int main ( int argc, char **argv );
-void msg_accounting ( msg_accounting_ind_t *mp );
-void msg_alert_ind ( msg_alert_ind_t *mp );
-void msg_charging_ind ( msg_charging_ind_t *mp );
-void msg_connect_active_ind ( msg_connect_active_ind_t *mp );
-void msg_connect_ind ( msg_connect_ind_t *mp );
-void msg_pdeact_ind(msg_pdeact_ind_t *md);
-void msg_negcomplete_ind(msg_negcomplete_ind_t *ind);
-void msg_ifstatechg_ind(msg_ifstatechg_ind_t *ind);
-void msg_drvrdisc_req(msg_drvrdisc_req_t *mp);
-void msg_dialout ( msg_dialout_ind_t *mp );
-void msg_dialoutnumber(msg_dialoutnumber_ind_t *mp);
-void msg_disconnect_ind ( msg_disconnect_ind_t *mp );
-void msg_idle_timeout_ind ( msg_idle_timeout_ind_t *mp );
-void msg_l12stat_ind(msg_l12stat_ind_t *ml);
-void msg_teiasg_ind(msg_teiasg_ind_t *mt);
-void msg_proceeding_ind ( msg_proceeding_ind_t *mp );
-void msg_packet_ind( msg_packet_ind_t *mp );
-void msg_keypad(msg_keypad_ind_t *mp);
-const char * name_of_controller(int ctrl_type, int card_type);
-void next_state ( cfg_entry_t *cep, int event );
-char * print_i4b_cause( cause_t code );
-char * printstate ( cfg_entry_t *cep );
-int readrates ( char *filename );
-int ret_channel_state(int controller, int channel);
-void reopenfiles ( int dummy );
-void rereadconfig ( int dummy );
-void select_first_dialno ( cfg_entry_t *cep );
-void select_next_dialno ( cfg_entry_t *cep );
-void select_this_dialno ( cfg_entry_t *cep );
-int sendm_alert_req ( cfg_entry_t *cep );
-int sendm_connect_req ( cfg_entry_t *cep );
-int sendm_connect_resp ( cfg_entry_t *cep, int cdid, int response, cause_t cause );
-int sendm_disconnect_req ( cfg_entry_t *cep, cause_t cause );
-int set_channel_busy(int controller, int channel);
-int set_channel_idle(int controller, int channel);
-int setup_dialout(cfg_entry_t *cep);
-void sigchild_handler ( int sig );
-void start_timer ( cfg_entry_t *cep, int seconds );
-void stop_timer ( cfg_entry_t *cep );
-void unitlen_chkupd( cfg_entry_t *cep );
-void write_pid ( void );
-void yyerror ( const char *msg );
-
-void error_exit(int exitval, const char *fmt, ...);
-
-/* montior server module */
-void monitor_init();
-void monitor_exit();
-void monitor_clear_rights();
-void monitor_fixup_rights();
-int monitor_start_rights(const char *clientspec);
-void monitor_add_rights(int rights);
-
-/* possible return codes from monitor_start_rights: */
-#define I4BMAR_OK 0 /* rights added successfully */
-#define I4BMAR_LENGTH 1 /* local socket name to long */
-#define I4BMAR_DUP 2 /* entry already exists */
-#define I4BMAR_CIDR 3 /* cidr netmask is invalid */
-#define I4BMAR_NOIP 4 /* host/net could not be resolved */
-
-int monitor_create_local_socket();
-
-#ifndef I4B_NOTCPIP_MONITOR
-int monitor_create_remote_socket(int portno);
-#endif
-
-void monitor_prepselect(fd_set *selset, int *max_fd);
-void monitor_handle_input(fd_set *selset);
-void monitor_handle_connect(int sockfd, int is_local);
-void monitor_evnt_charge(cfg_entry_t *cep, int units, int estimated);
-void monitor_evnt_connect(cfg_entry_t *cep);
-void monitor_evnt_disconnect(cfg_entry_t *cep);
-void monitor_evnt_updown(cfg_entry_t *cep, int up);
-void monitor_evnt_log(int prio, const char * what, const char * msg);
-
-void monitor_evnt_l12stat(int controller, int layer, int state);
-void monitor_evnt_tei(int controller, int tei);
-void monitor_evnt_acct(cfg_entry_t *cep);
-
-/* controller.c */
-
-void init_active_controller(void);
-int set_controller_state(int controller, int state);
-int get_controller_state(int controller);
-int decr_free_channels(int controller);
-int incr_free_channels(int controller);
-int get_free_channels(int controller);
-int set_channel_busy(int controller, int channel);
-int set_channel_idle(int controller, int channel);
-int ret_channel_state(int controller, int channel);
-
-/* alias.c */
-
-void init_alias(char *filename);
-void free_aliases(void);
-char *get_alias(char *number);
-
-void upd_callstat_file(char *filename, int rotateflag);
-
-/* holiday.c */
-
-void init_holidays(char *filename);
-void free_holidays(void);
-int isholiday(int d, int m, int y);
-
-#endif /* _ISDND_H_ */
diff --git a/usr.sbin/i4b/isdnd/isdnd.rates.5 b/usr.sbin/i4b/isdnd/isdnd.rates.5
deleted file mode 100644
index b4542e0..0000000
--- a/usr.sbin/i4b/isdnd/isdnd.rates.5
+++ /dev/null
@@ -1,117 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1999 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.
-.\"
-.\" $Id: isdnd.rates.5,v 1.10 1999/12/13 22:11:55 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Mon Dec 13 22:59:31 1999]
-.\"
-.Dd September 11, 1998
-.Dt ISDND.RATES 5
-.Os
-.Sh NAME
-.Nm isdnd.rates
-.Nd isdn4bsd ISDN management daemon rates description file
-.Sh DESCRIPTION
-The file
-.Pa isdnd.rates
-contains descriptions how long charging units last at a given time of day,
-day of week and the distance to the destination.
-If this file is available,
-this information may be used by the
-.Xr isdnd 8
-ISDN connection management daemon to calculate the short hold time for a
-connection.
-.Pp
-The format of a rate entry line is as follows:
-.Pp
-The first field, the
-.Pq Fa rate-code
-defines a collection of rates (for each day of the week) which can be
-referenced in the
-.Xr isdnd 8
-configuration file
-.Xr isdnd.rc 5 .
-This field must start with the identifier
-.Dq ra
-followed by a digit in the range of zero to four.
-.Pp
-The second field, the
-.Pq Fa day-number
-selects the day of week for which this entry defines the rates, where 0 stands
-for Sunday, 1 for Monday and so on until the digit 6 which stands for Saturday.
-.Pp
-The rest of the line consists of one or more space separated fields which have
-the following syntax:
-.Bd -ragged -offset indent
-start_hour.start_minutes-end_hour.end_minutes:charge_unit_length
-.Ed
-.Pp
-Start_hour and start_minutes define the begin of a time section and end_hour
-and end_minutes define the end.
-Charge_unit_length define the length of a
-charging unit in the previously defined time section.
-No spaces or tabs are
-allowed inside this field.
-The hour and minutes specifications MUST have
-exactly 2 digits, in case just one digit is needed, a leading 0 must be used.
-.Pp
-For example,
-.Bd -ragged -offset indent
-14.00-18.00:90
-.Ed
-.Pp
-defines, that between 2:00 PM and 6:00 PM the length of one charging unit
-lasts 90 seconds.
-.Sh FILES
-.Bl -tag -width /etc/isdn/isdnd.rates -compact
-.It Pa /etc/isdn/isdnd.rates
-The default rates specification file for the
-.Nm isdnd
-ISDN daemon.
-.El
-.Sh EXAMPLES
-The line:
-.Bd -literal
-ra0 0 00.00-05.00:240 05.00-21.00:150 21.00-24.00:240
-.Ed
-.Pp
-defines the unit lengths for a Sunday.
-.Sh SEE ALSO
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8
-.Sh AUTHORS
-.An -nosplit
-The rates subsystem for the
-.Xr isdnd 8
-daemon to which
-.Nm
-belongs was designed and written by
-.An Gary Jennejohn .
-.Pp
-The
-.Xr isdnd 8
-daemon and this manual page were written by
-.An Hellmuth Michaelis Aq hm@kts.org .
diff --git a/usr.sbin/i4b/isdnd/isdnd.rc.5 b/usr.sbin/i4b/isdnd/isdnd.rc.5
deleted file mode 100644
index d3d2ed8..0000000
--- a/usr.sbin/i4b/isdnd/isdnd.rc.5
+++ /dev/null
@@ -1,1115 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Aug 11 20:07:38 2002]
-.\"
-.Dd August 11, 2002
-.Dt ISDND.RC 5
-.Os
-.Sh NAME
-.Nm isdnd.rc
-.Nd isdn4bsd ISDN connection management daemon config file format
-.Sh DESCRIPTION
-The file
-.Pa /etc/isdn/isdnd.rc
-contains (if not otherwise specified on the command line) the runtime
-configuration for the
-.Xr isdnd 8
-ISDN connection management daemon which is part of the isdn4bsd package.
-.Pp
-The configuration file consists of keywords which start in column 1 followed by
-one or more spaces or tabs, an equal sign, one or more spaces or tabs
-and a keyword dependent parameter value.
-.Pp
-A line beginning with '#' is treated as a comment line.
-.Pp
-For keywords requiring the specification of a boolean value, the truth
-value can be either
-.Em yes
-or
-.Em on
-while the false value can be either
-.Em no
-or
-.Em off .
-.Pp
-The configuration file consists of one
-.Em system
-section, one or more optional
-.Em controller
-sections and one or more
-.Em entry
-sections.
-In the
-.Em system
-section parameters regarding the daemon operation or parameters
-not associated with a single remote connection can be set.
-In the
-.Em controller
-section parameters regarding a particular controller can be set.
-In the
-.Em entry
-section(s) parameters directly associated with a single remote
-connection can be set.
-.Pp
-The following keywords are recognized by
-.Nm isdnd :
-.Pp
-.Bl -tag -width system
-.It Li system
-This keyword starts the system configuration section.
-It must not
-have a parameter and may be used only once.
-The keyword is mandatory.
-The following keywords are valid in the system configuration section:
-.Bl -tag -width useacctfile
-.It Li acctall
-If this parameter is set to
-.Em on ,
-accounting information is written even if the local site was not charged
-or no charging information is available or is not subscribed.
-(optional)
-.It Li acctfile
-Specifies the name of the accounting file which is used when the keyword
-.Em useacctfile
-(see below) is set to
-.Em on .
-See also system keyword
-.Em rotatesuffix .
-If this keyword is omitted the system default is used.
-(optional)
-.It Li add-prefix
-If set to
-.Em on ,
-for incoming numbers, have a look at the "type of number" indicator and
-adjust the number as specified by the
-.Em prefix-national
-and
-.Em prefix-international
-keywords described later.
-If this keyword is omitted, the system default (off) is used.
-(optional)
-.It Li aliasing
-If this parameter is set to
-.Em on ,
-alias processing of telephone-number to name is enabled (see also the
-.Em aliasfile
-keyword below).
-The default is off.
-(optional)
-.It Li aliasfile
-Specifies the name of the telephone number-to-name alias database file shared
-with the
-.Xr isdntel 8
-utility when alias processing is enabled via the
-.Em aliasing
-keyword.
-(optional)
-.It Li beepconnect
-In full-screen mode, if this parameter is set to
-.Em on ,
-ring the bell when connecting or disconnecting a call.
-.It Li extcallattr
-If this parameter is set to
-.Em on ,
-the extended caller attributes "screening indicator" and "presentation
-indicator" are written to the log-file.
-The default is off.
-(optional)
-.It Li holidayfile
-Specifies the name of the holiday file containing the dates of holidays.
-This file is used in conjunction with the
-.Em valid
-keyword to lookup the dates of holidays.
-(optional)
-.It Li isdntime
-If this parameter is set to
-.Em on ,
-date/time information from the exchange (if provided) is written to the
-log-file.
-The default is off.
-(optional)
-.It Li mailer
-This keyword is used to specify the path/name of a mail program
-which is able to use the "-s" flag to specify a subject on its
-command line.
-In case of a fatal error exit of
-.Nm
-this program is used to send mail to an administrator specified by
-the keyword
-.Em mailto .
-(optional)
-.It Li mailto
-This keyword is used to specify the email address of someone to notify
-in case of a fatal error exit of
-.Nm .
-(See also keyword
-.Em mailer ) .
-(optional)
-.It Li monitor-allowed
-If this parameter is set to
-.Em on
-or
-.Em yes ,
-monitoring via a local or remote machine is enabled.
-This parameter is optional and is set to
-.Em off
-by default.
-.It Li monitor-port
-sets the TCP port number for remote monitoring.
-This integer parameter is optional and is set to port 451 by default.
-.It Li monitor
-This keyword specifies a local socket name or a host or network for remote
-monitoring.
-The
-.Em monitor
-specification may either be:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar the name of a local (UNIX-domain) socket
-this MUST start with a "/", example: /var/run/isdn-monitor
-.It Ar a dotted-quad host specification
-example: 192.168.1.2
-.It Ar a dotted-quad network address with netmask
-example: 192.168.1.0/24
-.It Ar a resolvable host name
-example: localhost
-.It Ar a resolvable network name with netmask
-example: up-vision-net/24
-.El
-.It Li monitor-access
-This keyword specifies the access rights for a previously used
-.Em monitor
-keyword.
-The supported access rights are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar fullcmd
-.It Ar restrictedcmd
-.It Ar channelstate
-.It Ar logevents
-.It Ar callin
-.It Ar callout
-.El
-.It Li prefix-international
-In conjunction with the
-.Em add-prefix
-switch (see above), specify the prefix number string for incoming numbers
-with the international number tag.
-If aliases are used, they have to be adjusted accordingly.
-(optional)
-.It Li prefix-national
-In conjunction with the
-.Em add-prefix
-switch (see above), specify the prefix number string for incoming numbers
-with the national number tag.
-If aliases are used, they have to be adjusted accordingly.
-(optional)
-.It Li ratesfile
-Specifies the name of the ratesfile.
-If this keyword is omitted the system
-default is used.
-(optional)
-.It Li regexpr
-This keyword is used to specify regular expressions.
-It can be specified
-more than once up to a compile time dependent value (currently set to 5 by
-the MAX_RE definition in the source).
-.Pp
-All specified regular expressions are compared to the log strings at runtime
-and if a match is found, a program is run with the log text as a parameter
-(see also the keyword
-.Em regprog
-below).
-.Pp
-For an explanation how regular expressions are specified, please have a
-look at
-.Xr re_format 7
-and
-.Xr regex 3 .
-The
-.Em extended
-regular expression syntax is supported here.
-.Pp
-Hint: it might be necessary to properly quote the expression to avoid
-improper interpretation by the configuration file parser.
-(optional)
-.It Li regprog
-This keyword is used to specify the name of a program which is run in
-case a corresponding regular expression is matched by a logging string.
-.Nm Isdnd
-expects to find the program below the path
-.Pa /etc/isdn
-which is prepended to the string specified as a parameter to this keyword.
-(optional)
-.It Li rotatesuffix
-Specifies a suffix for renaming the log- and the accounting-filename.
-In case
-rotatesuffix is used and a USR1 signal is sent to isdnd, the log-file and the
-accounting file is not only closed and reopened but the old log-file is also
-renamed to the former filename with the rotatesuffix string appended.
-If this keyword is omitted, the log-files are just closed and reopened; this
-is also the default behavior.
-(optional)
-.It Li rtprio
-Specifies the real-time priority
-.Nm isdnd
-runs at as an integer value in the range 0...31 with 0 being the highest
-priority.
-This keyword is optional; if not specified the process priority of
-.Nm isdnd
-is not touched in any way.
-( See also
-.Xr rtprio 1 ) .
-This keyword is only available if
-.Nm
-was compiled with -DUSE_RTPRIO.
-.It Li useacctfile
-If this parameter is set to
-.Em on
-charging (if available) and accounting information is written to the
-accounting file.
-(optional)
-.El
-.It Li controller
-This keyword starts the controller configuration section.
-It must not
-have a parameter and may be used once for every controller.
-The keyword
-is optional.
-The following keywords are valid in a controller
-configuration section:
-.Bl -tag -width useacctfile
-.It Li protocol
-This keyword is used to set the D-channel protocol for the S0-bus a
-controller is connected to.
-The following parameters are currently
-supported:
-.Pp
-.Bl -tag -width calledback -compact
-.It Ar dss1
-The DSS1 or so-called "Euro-ISDN" D-channel protocol according to
-ITU Recommendations Q.921 and Q.931.
-.It Ar d64s
-An ISDN leased line with a single B-channel (called D64S in Germany).
-.El
-.It Li firmware
-This keyword is used like
-.Li firmware Ns = Ns Ar /path/to/file
-to download the
-firmware to active controllers supported by the
-.Em iavc
-driver (AVM B1, T1).
-This keyword is supported for all controller types,
-and causes
-.Dv I4B_CTRL_DOWNLOAD
-ioctl to be invoked with the specified file
-as an argument.
-In systems equipped with both active and passive adapters,
-and the passive cards being detected first, dummy
-.Ql controller
-entries
-are required for the passive cards to get the correct firmwares to
-correct adapters.
-.El
-.It Li entry
-This keyword starts one configuration entry.
-It must not have a parameter.
-This keyword must be used at least once.
-The following keywords are valid in an entry section:
-.Bl -tag -width unitlengthsrc
-.It Li answerprog
-This keyword is used to specify the name of a program which is run in
-case an incoming telephone connection specified
-.Em answer
-in its configuration entry.
-The default name is
-.Em answer .
-.Nm Isdnd
-expects to find this program beneath the path
-.Pa /etc/isdn
-which is prepended to the string specified as a parameter to this keyword.
-(optional)
-.It Li alert
-is used to specify a time in seconds to wait before accepting a call.
-This
-keyword is only usable for incoming telephone calls (dialin-reaction = answer).
-It is used to have a chance to accept an incoming call on the phone before
-the answering machine starts to run.
-The minimum value for the alert parameter
-is 5 seconds and the maximum parameter allowed is 180 seconds.
-(optional)
-.It Li b1protocol
-The B channel layer 1 protocol used for this connection.
-The keyword is mandatory.
-The currently configurable values are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar hdlc
-HDLC framing.
-.It Ar raw
-No framing at all (used for telephony).
-.El
-.It Li bcap
-Use a special bearer capability for this connection.
-The keyword is optional.
-.Pp
-Any other value than
-.Em dov
-sets the bearer capability as configured by the
-.Em b1protocol
-keyword (see above).
-The currently configurable values are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar dov
-This connection is a
-.Em Dov (Data over Voice)
-connection.
-The b1protocol keyword must be set to
-.Em hdlc .
-This feature is experimental and does work on outgoing calls only.
-.El
-.It Li budget-calloutperiod
-is used to specify a time period in seconds.
-Within this period, the number of calls
-specified by
-.Em budget-calloutncalls
-are allowed to succeed, any further attempt to call out will be blocked for the rest
-of the time left in the time period.
-(optional)
-.It Li budget-calloutncalls
-The number of outgoing calls allowed within the time period specified by
-.Em budget-calloutperiod .
-(optional)
-.It Li budget-calloutsfile
-A path/filename to which the number of successful callouts are written.
-The contents of the file is preserved when it exists during startup of isdnd.
-The format of this file is: start time, last update time, number of calls.
-(optional)
-.It Li budget-calloutsfile-rotate
-If set to
-.Em on
-rotate budget-calloutsfile every night when an attempt is made to update
-the file on a new day.
-The statistics for the previous day are written to
-a file with the filename specified by budget-calloutsfile to which a hyphen
-and the new day's (!) day of month number is appended.
-(optional)
-.It Li budget-callbackperiod
-.It Li budget-callbackncalls
-.It Li budget-callbacksfile
-.It Li budget-calloutsfile-rotate
-See
-.Em budget-calloutperiod ,
-.Em budget-calloutncalls ,
-.Em budget-calloutsfile ,
-and
-.Em budget-calloutsfile-rotate
-above.
-These are used to specify the budgets for calling back a remote site.
-.It Li callbackwait
-The time in seconds to wait between hanging up the call from a remote site
-and calling back the remote site.
-(optional)
-.It Li calledbackwait
-The time in seconds to wait for a remote site calling back the local site
-after a call from the local site to the remote site has been made.
-(optional)
-.It Li clone
-This causes the contents of the specified entry to be copied from the
-existing named entry to the current one.
-When using this feature at least a new entry specific
-.Ql name
-and
-.Ql usrdeviceunit
-value should be specified for the current entry.
-.It Li connectprog
-specifies a program run every time after a connection is established and
-address negotiation is complete (i.e.: the connection is usable).
-.Nm Isdnd
-expects to find the program below the path
-.Pa /etc/isdn
-which is prepended to the string specified as a parameter to this keyword.
-The programs specified by connect and disconnect will get the following
-command line arguments: -d (device) -f (flag) [ -a (addr) ] where
-.Em device
-is the name of device, e.g.\& "isp0",
-.Em flag
-will be "up" if connection just got up, or "down" if interface changed to down
-state and
-.Em addr
-the address that got assigned to the interface as a dotted-quad ip address
-(optional, only if it can be figured out by isdnd).
-(optional)
-.It Li dialin-reaction
-Used to specify what to do when an incoming connection request is received.
-The keyword is mandatory.
-The currently supported parameters are:
-.Pp
-.Bl -tag -width calledback -compact
-.It Ar accept
-Accept an incoming call.
-.It Ar reject
-Reject an incoming call.
-.It Ar ignore
-Ignore an incoming call.
-.It Ar answer
-Start telephone answering for an incoming voice call.
-.It Ar callback
-When a remote site calls, hang up and call back the remote site.
-.El
-.It Li dialout-type
-This keyword is used to configure what type of dialout mode is used.
-The keyword is mandatory.
-The currently supported parameters are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar normal
-Normal behavior, call the remote site which is supposed to accept the call.
-.It Ar calledback
-Callback behavior, call the remote side which rejects the call and calls
-us back.
-.El
-.It Li dialrandincr
-When dialing or re-dialing and this parameter is set to
-.Em on ,
-the dial retry time is added with a random value (currently 0...3 seconds)
-to minimize the chance of two sites dialing synchronously so each gets a busy
-each time it dials because the other side is also dialing.
-.It Li dialretries
-The number of dialing retries before giving up.
-Setting this to
-.Em -1
-gives an unlimited number of retries!
-(optional)
-.It Li direction
-This keyword is used to configure if incoming and outgoing, incoming-only or
-outgoing only connections are possible.
-The keyword is optional, the default is
-.Em inout .
-.Pp
-The currently supported parameters are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar inout
-Normal behavior, connection establishment is possible from remote and local.
-.It Ar in
-Only incoming connections are possible.
-.It Ar out
-Only outgoing connections are possible.
-.El
-.It Li disconnectprog
-specifies a program run every time after a connection was shut down.
-.Nm Isdnd
-expects to find the program below the path
-.Pa /etc/isdn
-which is prepended to the string specified as a parameter to this keyword.
-(optional)
-.It Li downtries
-is used to configure the number of unsuccessful tries (= retry cycles!) before
-the interface is disabled (for
-.Em downtime
-seconds).
-(see also the keyword
-.Em usedown
-further up).
-This keyword is optional.
-.It Li downtime
-is used to configure the time in seconds an interface is disabled
-after the configured number of
-.Em downtries .
-(see also the keyword
-.Em usedown
-further up).
-This keyword is optional and is set to 60 seconds by default.
-.It Li earlyhangup
-A (safety) time in seconds which specifies the time to hang up before an
-expected next charging unit will occur.
-(optional)
-.It Li idle-algorithm-outgoing
-The algorithm used to determine when to hang up an outgoing call when the
-line becomes idle.
-The current algorithms are:
-.Pp
-.Bl -tag -width calledback -compact
-.It Ar fix-unit-size
-idle algorithm which assumes fixed sized charging units during the whole call.
-.It Ar var-unit-size
-idle algorithm which assumes that the charging is time based after the first
-units time has expired.
-.El
-.It Li idletime-outgoing
-The time in seconds an outgoing connection must be idle before hanging up.
-An idle timeout of zero disables this functionality.
-(optional)
-.It Li idletime-incoming
-The time in seconds an incoming connection must be idle before hanging up.
-An idle timeout of zero disables this functionality.
-(optional)
-.It Li isdncontroller
-The ISDN controller number to be used for connections for this entry.
-(mandatory)
-.It Li isdnchannel
-The ISDN controller channel number to be used for connections for this entry.
-In case a channel is explicitly selected here, the SETUP message will request
-this channel but mark the request as
-.Em preferred
-(the indicated channel is preferred) instead of exclusive (only the indicated
-channel is acceptable).
-Thus the exchange is still free to select another
-than the requested channel!
-(mandatory)
-.It Li isdntxdel-incoming
-A delay value suitable for the
-.Xr timeout 9
-kernel subroutine to delay the transmission of the first packet after a
-successful connection is made by this value for
-.Em incoming
-ISDN connections.
-The specification unit is 1/100 second.
-A zero (0) disables
-this feature and is the default value.
-This feature is implemented (and makes
-sense only) for the
-.Xr i4bipr 4
-IP over raw HDLC ISDN driver.
-(optional)
-.It Li isdntxdel-outgoing
-A delay value suitable for the
-.Xr timeout 9
-kernel subroutine to delay the transmission of the first packet after a
-successful connection is made by this value for
-.Em outgoing
-ISDN connections.
-The specification unit is 1/100 second.
-A zero (0) disables
-this feature and is the default value.
-This feature is implemented (and makes
-sense only) for the
-.Xr i4bipr 4
-IP over raw HDLC ISDN driver.
-(optional)
-.It Li local-phone-dialout
-The local telephone number used when the local site dials out.
-When dialing
-out to a remote site, the number specified here is put into the
-.Em "Calling Party Number Information Element" .
-.Pp
-This keyword is mandatory for the
-.Em ipr
-user-land interfaces.
-.It Li local-subaddr-dialout
-The local subaddress used when the local site dials out.
-When dialing
-out to a remote site, the subaddress specified here is put into the
-.Em "Calling Party Subaddress Information Element" .
-.Pp
-This keyword is mandatory for the
-.Em ipr
-user-land interfaces.
-.It Li local-phone-incoming
-The local telephone number used for verifying the destination of incoming
-calls.
-When a remote site dials in, this number is used to verify that it
-is the local site which the remote site wants to connect to.
-It is compared
-with the
-.Em "Called Party Number Information Element"
-got from the telephone exchange.
-.Pp
-This keyword is mandatory for the
-.Em ipr
-interfaces.
-.It Li local-subaddr-incoming
-The local subaddress used for verifying the destination of incoming
-calls.
-When a remote site dials in, this subaddress is used to verify that it
-is the local site which the remote site wants to connect to.
-It is compared
-with the
-.Em "Called Party Subaddress Information Element"
-got from the telephone exchange.
-.Pp
-This keyword is mandatory for the
-.Em ipr
-interfaces.
-.It Li name
-Defines a symbolic name for this configuration entry.
-Its purpose is to
-use this name in the full-screen display for easy identification of a link
-to a remote site and for accounting purposes.
-(mandatory)
-.It Li maxconnecttime
-Specify a maximum connection time in seconds.
-Use this to define an absolute
-upper limit for a connection on the B-channel to last.
-.Em CAUTION:
-This feature is used to limit the connection time, _not_ number of attempts
-to establish a connection: when using this please take care to also enable
-the use of budgets to limit the connection establish attempts (otherwise
-the line will cycle thru an endless loop of connections and reconnections
-which will have an undesired effect on your telco bill)!
-.It Li ppp-auth-paranoid
-If set to
-.Em no ,
-the remote site is not required to prove its authentity for connections
-that are initiated by the local site.
-The default is
-.Em yes
-and requires the remote site to always authenticate.
-.Pp
-This keyword is only used if
-.Em ppp-send-auth
-has been set to pap or chap for an
-.Em isp
-PPP interface.
-(optional)
-.It Li ppp-auth-rechallenge
-Set to
-.Em no ,
-if the other side does not support re-challenging for chap.
-The default is
-.Em yes ,
-which causes verification of the remote site's authentity once in a while.
-.Pp
-This keyword is only used if
-.Em ppp-expect-auth
-has been set to chap for an
-.Em isp
-PPP interface.
-(optional)
-.It Li ppp-expect-auth
-The local site expects the authentity of the remote site to be proved by
-the specified method.
-The supported methods are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar none
-Do not require the other side to authenticate.
-Typical uses are dial-out to an ISP
-(many ISPs do not authenticate themselves to clients)
-or offering anonymous dial-in at the local site.
-.It Ar chap
-The preferred authentication method, which does not require a password to be sent
-in the clear.
-.It Ar pap
-The unprotected authentication method, which allows anybody watching the wire
-to grab name and password.
-.El
-.Pp
-If
-.Em ppp-auth-paranoid
-is set to
-.Em no
-(the default is
-.Em yes )
-outgoing connections will not require the remote site to authenticate itself.
-.Pp
-This keyword is only used for the
-.Em isp
-PPP interfaces.
-(optional)
-.It Li ppp-expect-name
-The name that has to be provided by the remote site to prove its authentity.
-.Pp
-This keyword is only used if
-.Em ppp-expect-auth
-has been set to pap or chap for an
-.Em isp
-PPP interface.
-(optional)
-.It Li ppp-expect-password
-The secret that has to be provided by the remote site to prove its authentity.
-.Pp
-This keyword is only used if
-.Em ppp-expect-auth
-has been set to pap or chap for an
-.Em isp
-PPP interface.
-(optional)
-.It Li ppp-send-auth
-The authentication method required by the remote site.
-The currently supported parameters are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar none
-The remote site does not expect or support authentication.
-.It Ar chap
-The preferred authentication method, which does not require a password to be sent
-in the clear.
-.It Ar pap
-The unprotected authentication method, which allows anybody watching the wire
-to grab name and password.
-.El
-.Pp
-This keyword is only used for the
-.Em isp
-PPP interfaces.
-(optional)
-.It Li ppp-send-name
-The authentication name sent to the remote site.
-.Pp
-This keyword is only used if
-.Em ppp-send-auth
-has been set to pap or chap for an
-.Em isp
-PPP interface.
-(optional)
-.It Li ppp-send-password
-The secret used to prove the local site's authentity to the remote site.
-.Pp
-This keyword is only used if
-.Em ppp-send-auth
-has been set to pap or chap for an
-.Em isp
-PPP interface.
-(optional)
-.It Li ratetype
-The rate entry used from the rates file.
-(optional)
-.Pp
-For example, ratetype=0 selects lines beginning "ra0" in /etc/isdn/isdnd.rates;
-(typically ra0 lines are a set of tables for local call rates on different
-days of the week & times per day).
-.It Li recoverytime
-The time in seconds to wait between dial retries.
-(optional)
-.It Li remdial-handling
-is used to specify the dialout behavior in case more than one outgoing
-number is specified.
-The currently supported parameters are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar first
-For every new (non-retry) call setup, start with the first number.
-.It Ar last
-For every new (non-retry) call setup, start with the last number with
-which a successful connection was made.
-.It Ar next
-For every new (non-retry) call setup, start with the next number which
-follows the last one used.
-.El
-.It Li remote-phone-dialout
-The remote telephone number used when the local site dials out.
-When dialing
-out to a remote site, the number specified here is put into the
-.Em "Called Party Number Information Element" .
-.Pp
-This keyword is mandatory for the
-.Em ipr
-interfaces.
-It may be specified more than once to try to dial to several
-numbers until one succeeds.
-.It Li remote-subaddr-dialout
-The remote subaddress used when the local site dials out.
-When dialing
-out to a remote site, the subaddress specified here is put into the
-.Em "Called Party Subaddress Information Element" .
-.Pp
-This keyword is mandatory for the
-.Em ipr
-interfaces.
-It may be specified more than once to linked it to the
-remote-phone-dialout numbers until one succeeds.
-.It Li remote-phone-incoming
-The remote telephone number used to verify an incoming call.
-When a remote site
-dials in, this number is used to verify that it is the correct remote site
-which is herewith authorized to connect into the local system.
-This parameter
-is compared against the
-.Em "Calling Party Number Information Element"
-got from the telephone exchange.
-.Pp
-This keyword is mandatory for the ipr interfaces.
-.Pp
-This keyword may have a wildcard parameter '*' to permit anyone dialing in.
-.It Li remote-subaddr-incoming
-The remote subaddress used to verify an incoming call.
-When a remote site
-dials in, this subaddress is used to verify that it is the correct remote site
-which is herewith authorized to connect into the local system.
-This parameter
-is compared against the
-.Em "Calling Party Subaddress Information Element"
-got from the telephone exchange.
-.Pp
-This keyword is mandatory for the ipr interfaces.
-.Pp
-This keyword may have a wildcard parameter '*' to permit anyone dialing in.
-.It Li unitlength
-The length of a charging unit in seconds.
-This is used in conjunction with
-the idletime to decide when to hang up a connection.
-(optional)
-.It Li unitlengthsrc
-This keyword is used to specify from which source
-.Xr isdnd 8
-takes the unitlength for short-hold mode.
-The currently configurable values are:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar none
-Then unitlength is not specified anywhere.
-.It Ar cmdl
-Use the unitlength specified on the command line.
-.It Ar conf
-Use the unitlength specified in the configuration file with the keyword
-.Em unitlength .
-.It Ar rate
-Use the unitlength from the ratesfile specified in the configuration
-file with the keyword
-.Em ratetype .
-.It Ar aocd
-Use a dynamically calculated unitlength in case AOCD is subscribed on
-the ISDN line.
-(AOCD is an acronym for ``Advice Of Charge During the call''
-which is a service provided by the telecommunications (ie phone) provider,
-to indicate billable units).
-.El
-.It Li usrdevicename
-Specifies the user-land interface which is used for interfacing ISDN B channel
-data to the user-land.
-The keyword is mandatory.
-This keyword accepts the following parameters:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar ipr
-This parameter configures a raw HDLC IP over ISDN interface.
-.It Ar isp
-This parameter configures a synchronous PPP over ISDN interface.
-.It Ar rbch
-This specifies a Raw B CHannel access interface.
-.It Ar tel
-ISDN telephony.
-.It Ar ing
-configures an ISDN B-channel to NetGraph interface.
-.El
-.It Li usrdeviceunit
-Specifies the unit number for the device which is specified with
-usrdevicename.
-.It Li usedown
-is used to enable the use of the keywords
-.Em downtries
-and
-.Em downtime
-in the entries section(s).
-It is used in the
-.Nm isdnd
-daemon to dynamically enable and disable the IP interfaces to avoid excessive
-dialing activities in case of transient failures (such as busy lines).
-This parameter is optional and is set to
-.Em off
-by default.
-.It Li usesubaddr
-is used to enable the use of subaddresses.
-This parameter is optional and is set to
-.Em off
-by default.
-.It Li valid
-.Em Note :
-this feature is considered experimental!
-The parameter to this keyword is a string specifying a time range within
-which this entry is valid.
-The time specification consists of a list of weekdays and/or a holiday
-indicator ( see also the
-.Em holidayfile
-keyword in the system section ) separated by commas followed by an optional
-daytime range specification in the form hh:mm-hh:mm.
-The weekdays are specified as numbers from 0 to 6 and the number 7 for
-holidays:
-.Pp
-.Bl -tag -width Ds -compact
-.It Ar 0
-Sunday
-.It Ar 1
-Monday
-.It Ar 2
-Tuesday
-.It Ar 3
-Wednesday
-.It Ar 4
-Thursday
-.It Ar 5
-Friday
-.It Ar 6
-Saturday
-.It Ar 7
-a Holiday
-.El
-.Pp
-The following examples describe the "T-ISDN xxl" tariff of the german Telekom:
-.Bl -tag -width Ds -compact
-.It Ar 1,2,3,4,5,6,09:00-18:00
-Monday through Saturday, daytime 9:00 to 18:00
-.It Ar 1,2,3,4,5,6,18:00-9:00
-Monday through Saturday, nighttime 18:00 to 9:00
-.It Ar 0,7
-Sunday and on holidays, all 24 hours
-.El
-.Pp
-The use of this keyword is optional.
-.El
-.El
-.Sh IDLETIME CALCULATION AND SHORT-HOLD MODE
-.Bl -tag -width "incoming calls
-.It Li incoming calls
-It is assumed that the calling side knows most about charging structures and
-such and as a consequence only the keyword
-.Em idletime-incoming
-has a function for incoming calls.
-.Pp
-For incoming calls the line is constantly monitored, and in case there was
-not traffic taking place for the time in seconds specified by
-.Em idletime-incoming
-the call is closed.
-.Pp
-Typically,
-.Em idletime-incoming
-is used as a last resort and is therefore set much higher than a charging
-unit time: typical values are one to five minutes.
-.It Li outgoing calls
-Outgoing call disconnect time can be setup in one of three ways:
-.Bl -tag -width "shorthold mode
-.It Li simple mode
-For simple mode, the
-.Em idle-algorithm-outgoing
-must be
-.Em fix-unit-size
-and the selected
-.Em unitlength
-must be 0 (zero) and
-.Em idletime-outgoing
-greater zero.
-.Pp
-The outgoing traffic is constantly monitored, and in case there was
-not traffic taking place for the time in seconds specified by
-.Em idletime-outgoing
-the call is closed.
-.Pp
-Typical values in simple mode are 10 to 30 seconds.
-.It Li shorthold mode for fixed unit charging
-For shorthold mode, the
-.Em idle-algorithm-outgoing
-must be
-.Em fix-unit-size
-and the selected
-.Em unitlength
-and
-.Em idletime-outgoing
-must be greater than 0 (zero);
-.Em earlyhangup
-must be >= 0 (zero).
-.Bd -literal
-|<unchecked-window>|<checkwindow>|<safetywindow>|
-| | | |
-+------------------+-------------+--------------+
-| | | |
-| |<-idle-time->|<earlyhangup->|
-|<--------------unitlength--------------------->|
-.Ed
-.Pp
-During the unchecked window which is (unitlength - (idle-time+earlyhangup))
-in length, no idle check is done.
-After the unchecked window has ended,
-the line is checked for idle-time length if no traffic takes place.
-In case
-there was traffic detected in the check-window, the same procedure is restarted
-at the beginning of the next unit.
-In case no traffic was detected during
-the check-window, the line is closed at the end of the check window.
-.Pp
-Notice:
-.Em unitlength
-must (!) be greater than the sum of
-.Em idletime-outgoing
-and
-.Em earlyhangup !
-.It Li shorthold mode for variable unit charging
-For shorthold mode, the
-.Em idle-algorithm-outgoing
-must be
-.Em var-unit-size
-and the selected
-.Em unitlength
-and
-.Em idletime-outgoing
-must be greater than 0 (zero);
-.Pp
-This shorthold mode is suitable when your calls are billed on
-the elapse time of the call plus a fixed connection charge.
-For example British Telecom bill this way.
-.Pp
-Each call is divided into two periods, the first is the
-.Em unchecked
-period and the second is the
-.Em checked .
-The
-.Em checked
-period starts 1 second before the first units time expires.
-.Pp
-During the
-.Em checked
-period if there is no traffic for
-.Em idle-time
-seconds the call is disconnected.
-.Pp
-.Bd -literal
-|<---unchecked------------------>|<------checked------>
-+------------------+-------------+
-| |<-idle-time->|
-|<--------------unitlength------->|
-.Ed
-.Pp
-Experience shows that useful values for idle-time are from 15 to 30 seconds.
-.Pp
-If idle-time is too short an application that is not yet finished with the
-network will cause a new call to be placed.
-.Pp
-.El
-.El
-.Sh FILES
-.Bl -tag -width /etc/isdn/isdnd.rc -compact
-.It Pa /etc/isdn/isdnd.rc
-The default configuration file for the
-.Nm isdnd
-ISDN daemon.
-.El
-.Sh SEE ALSO
-.Xr regex 3 ,
-.Xr re_format 7 ,
-.Xr isdnd 8 ,
-.Xr isdnmonitor 8
-.Sh AUTHORS
-.An -nosplit
-The
-.Xr isdnd 8
-daemon and this manual page were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
-.Pp
-Additions to this manual page by
-.An Barry Scott Aq barry@scottb.demon.co.uk .
diff --git a/usr.sbin/i4b/isdnd/log.c b/usr.sbin/i4b/isdnd/log.c
deleted file mode 100644
index 4117909..0000000
--- a/usr.sbin/i4b/isdnd/log.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright (c) 1997, 2001 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 daemon - logging routines
- * -----------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:07:18 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#ifdef __FreeBSD__
-#include <osreldate.h>
-#endif
-
-#include "isdnd.h"
-
-#define LOGBUFLEN 256
-
-extern int do_monitor;
-extern int accepted;
-extern FILE *logfp;
-
-static void check_reg(char *logstring);
-
-struct logtab {
- char *text;
- int pri;
-};
-
-/*---------------------------------------------------------------------------*
- * table for converting internal log levels into syslog levels
- *---------------------------------------------------------------------------*/
-static struct logtab logtab[] = {
- {"ERR", LOG_ERR}, /* error conditions */
- {"WRN", LOG_WARNING}, /* warning conditions, nonfatal */
- {"DMN", LOG_NOTICE}, /* significant conditions of the daemon */
- {"CHD", LOG_INFO}, /* informational, call handling */
- {"DBG", LOG_DEBUG}, /* debug messages */
- {"MER", LOG_ERR}, /* monitor error conditions */
- {"PKT", LOG_INFO} /* packet logging */
-};
-
-/*---------------------------------------------------------------------------*
- * initialize logging
- *---------------------------------------------------------------------------*/
-void
-init_log(void)
-{
- int i;
-
- if(uselogfile)
- {
- if((logfp = fopen(logfile, "a")) == NULL)
- {
- fprintf(stderr, "ERROR, cannot open logfile %s: %s\n",
- logfile, strerror(errno));
- exit(1);
- }
-
- /* set unbuffered operation */
-
- setvbuf(logfp, (char *)NULL, _IONBF, 0);
- }
- else
- {
-#if DEBUG
- if(do_debug && do_fork == 0 && do_fullscreen == 0)
- (void)openlog("isdnd",
- LOG_PID|LOG_CONS|LOG_NDELAY|LOG_PERROR,
- logfacility);
- else
-#endif
- (void)openlog("isdnd", LOG_PID|LOG_CONS|LOG_NDELAY,
- logfacility);
- }
-
- /* initialize the regexp array */
-
- for(i = 0; i < MAX_RE; i++)
- {
- char *p;
- char buf[64];
-
- snprintf(buf, sizeof(buf), "%s%d", REGPROG_DEF, i);
-
- rarr[i].re_flg = 0;
-
- if((p = malloc(strlen(buf) + 1)) == NULL)
- {
- llog(LL_DBG, "init_log: malloc failed: %s", strerror(errno));
- do_exit(1);
- }
-
- strcpy(p, buf);
-
- rarr[i].re_prog = p;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * finish logging
- *---------------------------------------------------------------------------*/
-void
-finish_log(void)
-{
- if(uselogfile && logfp)
- {
- fflush(logfp);
- fclose(logfp);
- }
- else
- {
- (void)closelog();
- }
-}
-
-/*---------------------------------------------------------------------------*
- * place entry into logfile
- *---------------------------------------------------------------------------*/
-void
-llog(int what, const char *fmt, ...)
-{
- char buffer[LOGBUFLEN];
- register char *dp;
- va_list ap;
-
- va_start(ap, fmt);
- vsnprintf(buffer, LOGBUFLEN-1, fmt, ap);
- va_end(ap);
-
- dp = getlogdatetime(); /* get time string ptr */
-
-#ifdef USE_CURSES
-
- /* put log on screen ? */
-
- if((do_fullscreen && curses_ready) &&
- ((!debug_noscreen) || (debug_noscreen && (what != LL_DBG))))
- {
- wprintw(lower_w, "%s %s %-.*s\n", dp, logtab[what].text,
-
-/*
- * FreeBSD-current integrated ncurses. Since then it is no longer possible
- * to write to the last column in the logfilewindow without causing an
- * automatic newline to occur resulting in a blank line in that window.
- */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 400009
-#warning "FreeBSD ncurses is buggy: write to last column = auto newline!"
- COLS-((strlen(dp))+(strlen(logtab[what].text))+3), buffer);
-#else
- (int)(COLS-((strlen(dp))+(strlen(logtab[what].text))+2)), buffer);
-#endif
- wrefresh(lower_w);
- }
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(what != LL_MER) /* don't send monitor errs, endless loop !!! */
- monitor_evnt_log(logtab[what].pri, logtab[what].text, buffer);
-#endif
-
- if(uselogfile)
- {
- fprintf(logfp, "%s %s %s\n", dp, logtab[what].text, buffer);
- }
- else
- {
- register char *s = buffer;
-
- /* strip leading spaces from syslog output */
-
- while(*s && (*s == ' '))
- s++;
-
- syslog(logtab[what].pri, "%s %s", logtab[what].text, s);
- }
-
-
-#if DEBUG
- if(what != LL_DBG) /* don't check debug logs, endless loop !!! */
-#endif
- check_reg(buffer);
-}
-
-/*---------------------------------------------------------------------------*
- * return ptr to static area containing date/time
- *---------------------------------------------------------------------------*/
-char *
-getlogdatetime()
-{
- static char logdatetime[41];
- time_t tim;
- register struct tm *tp;
-
- tim = time(NULL);
- tp = localtime(&tim);
- strftime(logdatetime,40,I4B_TIME_FORMAT,tp);
- return(logdatetime);
-}
-
-/*---------------------------------------------------------------------------*
- * check for a match in the regexp array
- *---------------------------------------------------------------------------*/
-static void
-check_reg(char *logstring)
-{
- register int i;
-
- for(i = 0; i < MAX_RE; i++)
- {
- if(rarr[i].re_flg && (!regexec(&(rarr[i].re), logstring, (size_t) 0, NULL, 0)))
- {
- char* argv[3];
- argv[0] = rarr[i].re_prog;
- argv[1] = logstring;
- argv[2] = NULL;
-
- exec_prog(rarr[i].re_prog, argv);
- break;
- }
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/main.c b/usr.sbin/i4b/isdnd/main.c
deleted file mode 100644
index df531b7..0000000
--- a/usr.sbin/i4b/isdnd/main.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Copyright (c) 1997, 2001 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 daemon - main program entry
- * -------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:03:56 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include <locale.h>
-#include <paths.h>
-
-#ifdef I4B_EXTERNAL_MONITOR
-#include "monitor.h"
-#endif
-
-#define MAIN
-#include "isdnd.h"
-#undef MAIN
-
-#ifdef I4B_EXTERNAL_MONITOR
-
-#ifdef I4B_NOTCPIP_MONITOR
-/* monitor via local socket */
-static void mloop(int sockfd);
-#else /* I4B_NOTCPIP_MONITOR */
-/* monitor via local and tcp/ip socket */
-static void mloop(int localsock, int remotesock);
-#endif /* I4B_NOTCPIP_MONITOR */
-
-#else /* I4B_EXTERNAL_MONITOR */
-/* no monitoring at all */
-static void mloop();
-#endif /* I4B_EXTERNAL_MONITOR */
-
-#ifdef USE_CURSES
-static void kbdrdhdl(void);
-#endif
-
-static void isdnrdhdl(void);
-static void usage(void);
-
-#define MSG_BUF_SIZ 1024 /* message buffer size */
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdnd - i4b ISDN manager daemon, version %02d.%02d.%d\n", VERSION, REL, STEP);
-#ifdef DEBUG
- fprintf(stderr, " usage: isdnd [-c file] [-d level] [-F] [-f [-r dev] [-t termtype]]\n");
-#else
- fprintf(stderr, " usage: isdnd [-c file] [-F] [-f [-r dev] [-t termtype]]\n");
-#endif
- fprintf(stderr, " [-l] [-L file] [-m] [-s facility] [-u time]\n");
- fprintf(stderr, " -c <filename> configuration file name (def: %s)\n", CONFIG_FILE_DEF);
-#ifdef DEBUG
- fprintf(stderr, " -d <level> set debug flag bits:\n");
- fprintf(stderr, " general = 0x%04x, rates = 0x%04x, timing = 0x%04x\n", DL_MSG, DL_RATES, DL_TIME);
- fprintf(stderr, " state = 0x%04x, retry = 0x%04x, dial = 0x%04x\n", DL_STATE, DL_RCVRY, DL_DIAL);
- fprintf(stderr, " process = 0x%04x, kernio = 0x%04x, ctrlstat = 0x%04x\n", DL_PROC, DL_DRVR, DL_CNST);
- fprintf(stderr, " rc-file = 0x%04x, budget = 0x%04x, valid = 0x%04x\n", DL_RCCF, DL_BDGT, DL_VALID);
- fprintf(stderr, " -dn no debug output on fullscreen display\n");
-#endif
- fprintf(stderr, " -f fullscreen status display\n");
- fprintf(stderr, " -F do not become a daemon process\n");
- fprintf(stderr, " -l use a logfile instead of syslog\n");
- fprintf(stderr, " -L <file> use file instead of %s for logging\n", LOG_FILE_DEF);
- fprintf(stderr, " -P pretty print real config to stdout and exit\n");
- fprintf(stderr, " -r <device> redirect output to other device (for -f)\n");
- fprintf(stderr, " -s <facility> use facility instead of %d for syslog logging\n", LOG_LOCAL0 >> 3);
- fprintf(stderr, " -t <termtype> terminal type of redirected screen (for -f)\n");
- fprintf(stderr, " -u <time> length of a charging unit in seconds\n");
-#ifdef I4B_EXTERNAL_MONITOR
- fprintf(stderr, " -m inhibit network/local monitoring (protocol %02d.%02d)\n", MPROT_VERSION, MPROT_REL);
-#endif
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int i;
- msg_vr_req_t mvr;
-
-#ifdef I4B_EXTERNAL_MONITOR
- int sockfd = -1; /* local monitor socket */
-#ifndef I4B_NOTCPIP_MONITOR
- int remotesockfd = -1; /* tcp/ip monitor socket */
-#endif
-#endif
-
- setlocale (LC_ALL, "");
-
- while ((i = getopt(argc, argv, "mc:d:fFlL:Pr:s:t:u:")) != -1)
- {
- switch (i)
- {
-#ifdef I4B_EXTERNAL_MONITOR
- case 'm':
- inhibit_monitor = 1;
- break;
-#endif
-
- case 'c':
- configfile = optarg;
- break;
-
-#ifdef DEBUG
- case 'd':
- if(*optarg == 'n')
- debug_noscreen = 1;
- else if((sscanf(optarg, "%i", &debug_flags)) == 1)
- do_debug = 1;
- else
- usage();
- break;
-#endif
-
- case 'f':
- do_fullscreen = 1;
- do_fork = 0;
-#ifndef USE_CURSES
- fprintf(stderr, "Sorry, no fullscreen mode available - daemon compiled without USE_CURSES\n");
- exit(1);
-#endif
- break;
-
- case 'F':
- do_fork = 0;
- break;
-
- case 'l':
- uselogfile = 1;
- break;
-
- case 'L':
- strlcpy(logfile, optarg, sizeof(logfile));
- break;
-
- case 'P':
- do_print = 1;
- break;
-
- case 'r':
- rdev = optarg;
- do_rdev = 1;
- break;
-
- case 's':
- if(isdigit(*optarg))
- {
- int facility;
- logfacility = strtoul(optarg, NULL, 10);
- facility = logfacility << 3;
-
- if((facility < LOG_KERN) ||
- (facility > LOG_FTP && facility < LOG_LOCAL0) ||
- (facility > LOG_LOCAL7))
- {
- fprintf(stderr, "Error, option -s has invalid logging facility %d", logfacility);
- usage();
- }
- logfacility = facility;
- }
- else
- {
- fprintf(stderr, "Error: option -s requires a numeric argument!\n");
- usage();
- }
- break;
-
- case 't':
- ttype = optarg;
- do_ttytype = 1;
- break;
-
- case 'u':
- if(isdigit(*optarg))
- {
- unit_length = strtoul(optarg, NULL, 10);
- if(unit_length < ULSRC_CMDLMIN)
- unit_length = ULSRC_CMDLMIN;
- else if(unit_length > ULSRC_CMDLMAX)
- unit_length = ULSRC_CMDLMAX;
- got_unitlen = 1;
- }
- else
- {
- fprintf(stderr, "Error: option -T requires a numeric argument!\n");
- usage();
- }
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-#ifdef DEBUG
- if(!do_debug)
- debug_noscreen = 0;
-#endif
-
- if(!do_print)
- {
- umask(UMASK); /* set our umask ... */
-
- init_log(); /* initialize the logging subsystem */
- }
-
- check_pid(); /* check if we are already running */
-
- if(!do_print)
- {
- if(do_fork || (do_fullscreen && do_rdev)) /* daemon mode ? */
- daemonize();
-
- write_pid(); /* write our pid to file */
-
- /* set signal handler(s) */
-
- signal(SIGCHLD, sigchild_handler); /* process handling */
- signal(SIGHUP, rereadconfig); /* reread configuration */
- signal(SIGUSR1, reopenfiles); /* reopen acct/log files*/
- signal(SIGPIPE, SIG_IGN); /* handled manually */
- signal(SIGINT, do_exit); /* clean up on SIGINT */
- signal(SIGTERM, do_exit); /* clean up on SIGTERM */
- signal(SIGQUIT, do_exit); /* clean up on SIGQUIT */
- }
-
- /* open isdn device */
-
- if((isdnfd = open(I4BDEVICE, O_RDWR)) < 0)
- {
- llog(LL_ERR, "main: cannot open %s: %s", I4BDEVICE, strerror(errno));
- exit(1);
- }
-
- /* check kernel and userland have same version/release numbers */
-
- if((ioctl(isdnfd, I4B_VR_REQ, &mvr)) < 0)
- {
- llog(LL_ERR, "main: ioctl I4B_VR_REQ failed: %s", strerror(errno));
- do_exit(1);
- }
-
- if(mvr.version != VERSION)
- {
- llog(LL_ERR, "main: version mismatch, kernel %d, daemon %d", mvr.version, VERSION);
- do_exit(1);
- }
-
- if(mvr.release != REL)
- {
- llog(LL_ERR, "main: release mismatch, kernel %d, daemon %d", mvr.release, REL);
- do_exit(1);
- }
-
- if(mvr.step != STEP)
- {
- llog(LL_ERR, "main: step mismatch, kernel %d, daemon %d", mvr.step, STEP);
- do_exit(1);
- }
-
- /* init controller state array */
-
- init_controller();
-
- /* read runtime configuration file and configure ourselves */
-
- configure(configfile, 0);
-
- if(config_error_flag)
- {
- llog(LL_ERR, "there were %d error(s) in the configuration file, terminating!", config_error_flag);
- exit(1);
- }
-
- /* set controller ISDN protocol */
-
- init_controller_protocol();
-
- /* init active controllers, if any */
-
- signal(SIGCHLD, SIG_IGN); /*XXX*/
-
- init_active_controller();
-
- signal(SIGCHLD, sigchild_handler); /*XXX*/
-
- /* handle the rates stuff */
-
- if((i = readrates(ratesfile)) == ERROR)
- {
- if(rate_error != NULL)
- llog(LL_ERR, "%s", rate_error);
- exit(1);
- }
-
- if(i == GOOD)
- {
- got_rate = 1; /* flag, ratesfile read and ok */
- DBGL(DL_RCCF, (llog(LL_DBG, "ratesfile %s read successfully", ratesfile)));
- }
- else
- {
- if(rate_error != NULL)
- llog(LL_WRN, "%s", rate_error);
- }
-
- /* if writing accounting info, open file, set unbuffered */
-
- if(useacctfile)
- {
- if((acctfp = fopen(acctfile, "a")) == NULL)
- {
- llog(LL_ERR, "ERROR, can't open acctfile %s for writing, terminating!", acctfile);
- exit(1);
- }
- setvbuf(acctfp, (char *)NULL, _IONBF, 0);
- }
-
- /* initialize alias processing */
-
- if(aliasing)
- init_alias(aliasfile);
-
- /* init holidays */
-
- init_holidays(holidayfile);
-
- /* init remote monitoring */
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor)
- {
- monitor_init();
- sockfd = monitor_create_local_socket();
-#ifndef I4B_NOTCPIP_MONITOR
- remotesockfd = monitor_create_remote_socket(monitorport);
-#endif
- }
-#endif
-
- /* in case fullscreendisplay, initialize */
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- {
- init_screen();
- }
-#endif
-
- /* init realtime priority */
-
-#ifdef USE_RTPRIO
- if(rt_prio != RTPRIO_NOTUSED)
- {
- struct rtprio rtp;
-
- rtp.type = RTP_PRIO_REALTIME;
- rtp.prio = rt_prio;
-
- if((rtprio(RTP_SET, getpid(), &rtp)) == -1)
- {
- llog(LL_ERR, "rtprio failed: %s", strerror(errno));
- do_exit(1);
- }
- }
-#endif
-
- starttime = time(NULL); /* get starttime */
-
- srandom(580403); /* init random number gen */
-
- mloop( /* enter loop of no return .. */
-#ifdef I4B_EXTERNAL_MONITOR
- sockfd
-#ifndef I4B_NOTCPIP_MONITOR
- , remotesockfd
-#endif
-#endif
- );
- do_exit(0);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * program exit
- *---------------------------------------------------------------------------*/
-void
-do_exit(int exitval)
-{
- close_allactive();
-
- unlink(PIDFILE);
-
- llog(LL_DMN, "daemon terminating, exitval = %d", exitval);
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- endwin();
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_exit();
-#endif
-
- exit(exitval);
-}
-
-/*---------------------------------------------------------------------------*
- * program exit
- *---------------------------------------------------------------------------*/
-void
-error_exit(int exitval, const char *fmt, ...)
-{
- close_allactive();
-
- unlink(PIDFILE);
-
- llog(LL_DMN, "fatal error, daemon terminating, exitval = %d", exitval);
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- endwin();
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_exit();
-#endif
-
- if(mailto[0] && mailer[0])
- {
-
-#define EXITBL 2048
-
- char ebuffer[EXITBL];
- char sbuffer[EXITBL];
- va_list ap;
-
- va_start(ap, fmt);
- vsnprintf(ebuffer, EXITBL-1, fmt, ap);
- va_end(ap);
-
- signal(SIGCHLD, SIG_IGN); /* remove handler */
-
- snprintf(sbuffer, sizeof(sbuffer), "%s%s%s%s%s%s%s%s",
- "cat << ENDOFDATA | ",
- mailer,
- " -s \"i4b isdnd: fatal error, terminating\" ",
- mailto,
- "\nThe isdnd terminated because of a fatal error:\n\n",
- ebuffer,
- "\n\nYours sincerely,\n the isdnd\n",
- "\nENDOFDATA\n");
- system(sbuffer);
- }
-
- exit(exitval);
-}
-
-/*---------------------------------------------------------------------------*
- * main loop
- *---------------------------------------------------------------------------*/
-static void
-mloop(
-#ifdef I4B_EXTERNAL_MONITOR
- int localmonitor
-#ifndef I4B_NOTCPIP_MONITOR
- , int remotemonitor
-#endif
-#endif
-)
-{
- fd_set set;
- struct timeval timeout;
- int ret;
- int high_selfd;
-
- /* go into loop */
-
- llog(LL_DMN, "i4b isdn daemon started (pid = %d)", getpid());
-
- for(;;)
- {
- FD_ZERO(&set);
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- FD_SET(fileno(stdin), &set);
-#endif
-
- FD_SET(isdnfd, &set);
-
- high_selfd = isdnfd;
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor)
- {
- if (localmonitor != -1) {
- /* always watch for new connections */
- FD_SET(localmonitor, &set);
- if(localmonitor > high_selfd)
- high_selfd = localmonitor;
- }
-#ifndef I4B_NOTCPIP_MONITOR
- if (remotemonitor != -1) {
- FD_SET(remotemonitor, &set);
- if(remotemonitor > high_selfd)
- high_selfd = remotemonitor;
- }
-#endif
-
- /* if there are client connections, let monitor module
- * enter them into the fdset */
- if(accepted)
- {
- monitor_prepselect(&set, &high_selfd);
- }
- }
-#endif
-
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-
- ret = select(high_selfd + 1, &set, NULL, NULL, &timeout);
-
- if(ret > 0)
- {
- if(FD_ISSET(isdnfd, &set))
- isdnrdhdl();
-
-#ifdef USE_CURSES
- if(FD_ISSET(fileno(stdin), &set))
- kbdrdhdl();
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor)
- {
- if(localmonitor != -1 && FD_ISSET(localmonitor, &set))
- monitor_handle_connect(localmonitor, 1);
-
-#ifndef I4B_NOTCPIP_MONITOR
- if(remotemonitor != -1 && FD_ISSET(remotemonitor, &set))
- monitor_handle_connect(remotemonitor, 0);
-#endif
- if(accepted)
- monitor_handle_input(&set);
- }
-#endif
- }
- else if(ret == -1)
- {
- if(errno != EINTR)
- {
- llog(LL_ERR, "mloop: ERROR, select error on isdn device, errno = %d!", errno);
- error_exit(1, "mloop: ERROR, select error on isdn device, errno = %d!", errno);
- }
- }
-
- /* handle timeout and recovery */
-
- handle_recovery();
- }
-}
-
-#ifdef USE_CURSES
-/*---------------------------------------------------------------------------*
- * data from keyboard available, read and process it
- *---------------------------------------------------------------------------*/
-static void
-kbdrdhdl(void)
-{
- int ch = getch();
-
- if(ch == ERR)
- {
- llog(LL_ERR, "kbdrdhdl: ERROR, read error on controlling tty, errno = %d!", errno);
- error_exit(1, "kbdrdhdl: ERROR, read error on controlling tty, errno = %d!", errno);
- }
-
- switch(ch)
- {
- case 0x0c: /* control L */
- wrefresh(curscr);
- break;
-
- case '\n':
- case '\r':
- do_menu();
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * data from /dev/isdn available, read and process them
- *---------------------------------------------------------------------------*/
-static void
-isdnrdhdl(void)
-{
- static unsigned char msg_rd_buf[MSG_BUF_SIZ];
- msg_hdr_t *hp = (msg_hdr_t *)&msg_rd_buf[0];
-
- register int len;
-
- if((len = read(isdnfd, msg_rd_buf, MSG_BUF_SIZ)) > 0)
- {
- switch(hp->type)
- {
- case MSG_CONNECT_IND:
- msg_connect_ind((msg_connect_ind_t *)msg_rd_buf);
- break;
-
- case MSG_CONNECT_ACTIVE_IND:
- msg_connect_active_ind((msg_connect_active_ind_t *)msg_rd_buf);
- break;
-
- case MSG_DISCONNECT_IND:
- msg_disconnect_ind((msg_disconnect_ind_t *)msg_rd_buf);
- break;
-
- case MSG_DIALOUT_IND:
- msg_dialout((msg_dialout_ind_t *)msg_rd_buf);
- break;
-
- case MSG_ACCT_IND:
- msg_accounting((msg_accounting_ind_t *)msg_rd_buf);
- break;
-
- case MSG_IDLE_TIMEOUT_IND:
- msg_idle_timeout_ind((msg_idle_timeout_ind_t *)msg_rd_buf);
- break;
-
- case MSG_CHARGING_IND:
- msg_charging_ind((msg_charging_ind_t *)msg_rd_buf);
- break;
-
- case MSG_PROCEEDING_IND:
- msg_proceeding_ind((msg_proceeding_ind_t *)msg_rd_buf);
- break;
-
- case MSG_ALERT_IND:
- msg_alert_ind((msg_alert_ind_t *)msg_rd_buf);
- break;
-
- case MSG_DRVRDISC_REQ:
- msg_drvrdisc_req((msg_drvrdisc_req_t *)msg_rd_buf);
- break;
-
- case MSG_L12STAT_IND:
- msg_l12stat_ind((msg_l12stat_ind_t *)msg_rd_buf);
- break;
-
- case MSG_TEIASG_IND:
- msg_teiasg_ind((msg_teiasg_ind_t *)msg_rd_buf);
- break;
-
- case MSG_PDEACT_IND:
- msg_pdeact_ind((msg_pdeact_ind_t *)msg_rd_buf);
- break;
-
- case MSG_NEGCOMP_IND:
- msg_negcomplete_ind((msg_negcomplete_ind_t *)msg_rd_buf);
- break;
-
- case MSG_IFSTATE_CHANGED_IND:
- msg_ifstatechg_ind((msg_ifstatechg_ind_t *)msg_rd_buf);
- break;
-
- case MSG_DIALOUTNUMBER_IND:
- msg_dialoutnumber((msg_dialoutnumber_ind_t *)msg_rd_buf);
- break;
-
- case MSG_PACKET_IND:
- msg_packet_ind((msg_packet_ind_t *)msg_rd_buf);
- break;
-
- case MSG_KEYPAD_IND:
- msg_keypad((msg_keypad_ind_t *)msg_rd_buf);
- break;
-
- default:
- llog(LL_WRN, "ERROR, unknown message received from %sisdn (0x%x)", _PATH_DEV, msg_rd_buf[0]);
- break;
- }
- }
- else
- {
- llog(LL_WRN, "ERROR, read error on isdn device, errno = %d, length = %d", errno, len);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * re-read the config file on SIGHUP or menu command
- *---------------------------------------------------------------------------*/
-void
-rereadconfig(int dummy)
-{
- extern int entrycount;
-
- llog(LL_DMN, "re-reading configuration file");
-
- close_allactive();
-
-#if I4B_EXTERNAL_MONITOR
- monitor_clear_rights();
-#endif
-
- entrycount = -1;
- nentries = 0;
-
- /* read runtime configuration file and configure ourselves */
-
- configure(configfile, 1);
-
- if(config_error_flag)
- {
- llog(LL_ERR, "rereadconfig: there were %d error(s) in the configuration file, terminating!", config_error_flag);
- error_exit(1, "rereadconfig: there were %d error(s) in the configuration file, terminating!", config_error_flag);
- }
-
- if(aliasing)
- {
- /* reread alias database */
- free_aliases();
- init_alias(aliasfile);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * re-open the log/acct files on SIGUSR1
- *---------------------------------------------------------------------------*/
-void
-reopenfiles(int dummy)
-{
- if(useacctfile)
- {
- /* close file */
-
- if(acctfp)
- {
- fflush(acctfp);
- fclose(acctfp);
- }
-
- /* if user specified a suffix, rename the old file */
-
- if(rotatesuffix[0] != '\0')
- {
- char filename[MAXPATHLEN];
-
- snprintf(filename, sizeof(filename), "%s%s", acctfile, rotatesuffix);
-
- if((rename(acctfile, filename)) != 0)
- {
- llog(LL_ERR, "reopenfiles: acct rename failed, cause = %s", strerror(errno));
- error_exit(1, "reopenfiles: acct rename failed, cause = %s", strerror(errno));
- }
- }
-
- if((acctfp = fopen(acctfile, "a")) == NULL)
- {
- llog(LL_ERR, "ERROR, can't open acctfile %s for writing, terminating!", acctfile);
- error_exit(1, "ERROR, can't open acctfile %s for writing, terminating!", acctfile);
- }
- setvbuf(acctfp, (char *)NULL, _IONBF, 0);
- }
-
- if(uselogfile)
- {
- finish_log();
-
- /* if user specified a suffix, rename the old file */
-
- if(rotatesuffix[0] != '\0')
- {
- char filename[MAXPATHLEN];
-
- snprintf(filename, sizeof(filename), "%s%s", logfile, rotatesuffix);
-
- if((rename(logfile, filename)) != 0)
- {
- llog(LL_ERR, "reopenfiles: log rename failed, cause = %s", strerror(errno));
- error_exit(1, "reopenfiles: log rename failed, cause = %s", strerror(errno));
- }
- }
-
- if((logfp = fopen(logfile, "a")) == NULL)
- {
- fprintf(stderr, "ERROR, cannot open logfile %s: %s\n",
- logfile, strerror(errno));
- error_exit(1, "reopenfiles: ERROR, cannot open logfile %s: %s\n",
- logfile, strerror(errno));
- }
-
- /* set unbuffered operation */
-
- setvbuf(logfp, (char *)NULL, _IONBF, 0);
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/monitor.c b/usr.sbin/i4b/isdnd/monitor.c
deleted file mode 100644
index 36739d1..0000000
--- a/usr.sbin/i4b/isdnd/monitor.c
+++ /dev/null
@@ -1,1284 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - network monitor server module
- * ------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:08:15 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-#ifndef I4B_EXTERNAL_MONITOR
-
-/*
- * dummy version of routines needed by config file parser
- * (config files should be valid with and without external montioring
- * support compiled into the daemon)
- */
-
-void monitor_clear_rights()
-{ }
-
-int monitor_start_rights(const char *clientspec)
-{ return I4BMAR_OK; }
-
-void monitor_add_rights(int rights_mask)
-{ }
-
-void monitor_fixup_rights()
-{ }
-
-#else
-
-#include "monitor.h"
-#include <sys/socket.h>
-#include <sys/un.h>
-#ifndef I4B_NOTCPIP_MONITOR
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
-
-
-static TAILQ_HEAD(rights_q, monitor_rights) rights = TAILQ_HEAD_INITIALIZER(rights);
-
-static struct monitor_rights * local_rights = NULL; /* entry for local socket */
-
-/* for each active monitor connection we have one of this: */
-
-struct monitor_connection {
- TAILQ_ENTRY(monitor_connection) connections;
- int sock; /* socket for this connection */
- int rights; /* active rights for this connection */
- int events; /* bitmask of events client is interested in */
- char source[FILENAME_MAX];
-};
-
-static TAILQ_HEAD(connections_tq, monitor_connection) connections = TAILQ_HEAD_INITIALIZER(connections);
-
-/* local prototypes */
-static int cmp_rights(const struct monitor_rights *pa, const struct monitor_rights *pb);
-static int monitor_command(struct monitor_connection *con, int fd, int rights);
-static void cmd_dump_rights(int fd, int rights, u_int8_t *cmd, const char * source);
-static void cmd_dump_mcons(int fd, int rights, u_int8_t *cmd, const char * source);
-static void cmd_reread_cfg(int fd, int rights, u_int8_t *cmd, const char * source);
-static void cmd_hangup(int fd, int rights, u_int8_t *cmd, const char * source);
-static void monitor_broadcast(int mask, u_int8_t *pkt, size_t bytes);
-static int anybody(int mask);
-static void hangup_channel(int controller, int channel, const char *source);
-static ssize_t sock_read(int fd, void *buf, size_t nbytes);
-static ssize_t sock_write(int fd, void *buf, size_t nbytes);
-
-/*
- * Due to the way we structure config files, the rights for an external
- * monitor might be stated in multiple steps. First a call to
- * monitor_start_rights opens an entry. Further (optional) calls to
- * montior_add_rights assemble additional rights for this "current"
- * entry. When closing the sys-file section of the config file, the
- * "current" entry becomes invalid.
- */
-static struct monitor_rights * cur_add_entry = NULL;
-
-/*---------------------------------------------------------------------------
- * Initialize the monitor server module. This affects only active
- * connections, the access rights are not modified here!
- *---------------------------------------------------------------------------*/
-void
-monitor_init(void)
-{
- struct monitor_connection * con;
- accepted = 0;
- while ((con = TAILQ_FIRST(&connections)) != NULL)
- {
- TAILQ_REMOVE(&connections, con, connections);
- free(con);
- }
-}
-
-/*---------------------------------------------------------------------------
- * Prepare for exit
- *---------------------------------------------------------------------------*/
-void
-monitor_exit(void)
-{
- struct monitor_connection *c;
-
- /* Close all open connections. */
- while((c = TAILQ_FIRST(&connections)) != NULL) {
- close(c->sock);
- TAILQ_REMOVE(&connections, c, connections);
- free(c);
- }
-}
-
-/*---------------------------------------------------------------------------
- * Initialize access rights. No active connections are affected!
- *---------------------------------------------------------------------------*/
-void
-monitor_clear_rights(void)
-{
- struct monitor_rights *r;
- while ((r = TAILQ_FIRST(&rights)) != NULL) {
- TAILQ_REMOVE(&rights, r, list);
- free(r);
- }
- cur_add_entry = NULL;
- local_rights = NULL;
-}
-
-/*---------------------------------------------------------------------------
- * Add an entry to the access lists. The clientspec either is
- * the name of the local socket or a host- or networkname or
- * numeric ip/host-bit-len spec.
- *---------------------------------------------------------------------------*/
-int
-monitor_start_rights(const char *clientspec)
-{
- struct monitor_rights r;
-
- /* initialize the new rights entry */
-
- memset(&r, 0, sizeof r);
-
- /* check clientspec */
-
- if (*clientspec == '/')
- {
- struct sockaddr_un sa;
-
- /* this is a local socket spec, check if we already have one */
-
- if (local_rights != NULL)
- return I4BMAR_DUP;
-
- /* does it fit in a local socket address? */
-
- if (strlen(clientspec) > sizeof sa.sun_path)
- return I4BMAR_LENGTH;
-
- r.local = 1;
- strcpy(r.name, clientspec);
-
-#ifndef I4B_NOTCPIP_MONITOR
-
- }
- else
- {
- /* remote entry, parse host/net and cidr */
-
- struct monitor_rights * rp;
- char hostname[FILENAME_MAX];
- char *p;
-
- p = strchr(clientspec, '/');
-
- if (!p)
- {
- struct hostent *host;
- u_int32_t hn;
-
- /* must be a host spec */
-
- r.mask = ~0;
- host = gethostbyname(clientspec);
-
- if (!host)
- return I4BMAR_NOIP;
-
- memcpy(&hn, host->h_addr_list[0], sizeof hn);
- r.net = (u_int32_t)ntohl(hn);
- }
- else if(p[1])
- {
- /* must be net/cidr spec */
-
- int l;
- struct netent *net;
- u_int32_t s = ~0U;
- int num = strtol(p+1, NULL, 10);
-
- if (num < 0 || num > 32)
- return I4BMAR_CIDR;
-
- s >>= num;
- s ^= ~0U;
- l = p - clientspec;
-
- if (l >= sizeof hostname)
- return I4BMAR_LENGTH;
-
- strncpy(hostname, clientspec, l);
-
- hostname[l] = '\0';
-
- net = getnetbyname(hostname);
-
- if (net == NULL)
- r.net = (u_int32_t)inet_network(hostname);
- else
- r.net = (u_int32_t)net->n_net;
-
- r.mask = s;
- r.net &= s;
- }
- else
- {
- return I4BMAR_CIDR;
- }
-
- /* check for duplicate entry */
-
- for (rp = TAILQ_FIRST(&rights); rp != NULL; rp = TAILQ_NEXT(rp, list))
- {
- if (rp->mask == r.mask &&
- rp->net == r.net &&
- rp->local == r.local)
- {
- return I4BMAR_DUP;
- }
- }
-#endif
- }
-
- r.rights = 0;
-
- /* entry ok, add it to the collection */
-
- cur_add_entry = malloc(sizeof(r));
- memcpy(cur_add_entry, &r, sizeof(r));
- TAILQ_INSERT_TAIL(&rights, cur_add_entry, list);
-
- if(r.local)
- local_rights = cur_add_entry;
-
- DBGL(DL_RCCF, (llog(LL_DBG, "system: monitor = %s", clientspec)));
-
- return I4BMAR_OK;
-}
-
-/*---------------------------------------------------------------------------
- * Add rights to the currently constructed entry - if any.
- *---------------------------------------------------------------------------*/
-void
-monitor_add_rights(int rights_mask)
-{
- if(cur_add_entry == NULL)
- return; /* noone under construction */
-
- cur_add_entry->rights |= rights_mask;
-
- DBGL(DL_RCCF, (llog(LL_DBG, "system: monitor-access = 0x%x", rights_mask)));
-}
-
-/*---------------------------------------------------------------------------
- * All rights have been added now. Sort the to get most specific
- * host/net masks first, so we can travel the list and use the first
- * match for actual rights.
- *---------------------------------------------------------------------------*/
-void
-monitor_fixup_rights(void)
-{
- struct monitor_rights * cur, * test, * next;
-
- /* no more rights may be added to the current entry */
-
- cur_add_entry = NULL;
-
- /* sort the rights */
- for (next = NULL, cur = TAILQ_FIRST(&rights); cur != NULL; cur = next)
- {
- next = TAILQ_NEXT(cur, list);
- for (test = TAILQ_FIRST(&rights); test != NULL && test != cur; test = TAILQ_NEXT(test, list))
- {
- if (cmp_rights(cur, test) > 0) {
- /* move cur up the list and insert before test */
- TAILQ_REMOVE(&rights, cur, list);
- if (test == TAILQ_FIRST(&rights))
- TAILQ_INSERT_HEAD(&rights, cur, list);
- else
- TAILQ_INSERT_BEFORE(test, cur, list);
- break;
- }
- }
- }
-}
-
-/*---------------------------------------------------------------------------
- * comparator for rights
- *---------------------------------------------------------------------------*/
-static int
-cmp_rights(const struct monitor_rights *pa, const struct monitor_rights *pb)
-{
- u_int32_t mask;
-
- /* local sorts first */
-
- if (pa->local)
- return -1;
-
- /* which is the less specific netmask? */
-
- mask = pa->mask;
-
- if ((pb->mask & mask) == 0)
- mask = pb->mask;
-
- /* are the entries disjunct? */
-
- if ((pa->net & mask) != (pb->net & mask))
- {
- /* simply compare net part of address */
- return ((pa->net & mask) < (pb->net & mask)) ? -1 : 1;
- }
-
- /* One entry is part of the others net. We already now "mask" is
- * the netmask of the less specific (i.e. greater) one */
-
- return (pa->mask == mask) ? 1 : -1;
-}
-
-#ifndef I4B_NOTCPIP_MONITOR
-/*---------------------------------------------------------------------------
- * Check if access rights for a remote socket are specified and
- * create this socket. Return -1 otherwise.
- *---------------------------------------------------------------------------*/
-int
-monitor_create_remote_socket(int portno)
-{
- struct sockaddr_in sa;
- int val;
- int remotesockfd;
-
- remotesockfd = socket(AF_INET, SOCK_STREAM, 0);
-
- if(remotesockfd == -1)
- {
- llog(LL_MER, "could not create remote monitor socket: %s", strerror(errno));
- return(-1);
- }
-
- val = 1;
-
- if(setsockopt(remotesockfd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof val))
- {
- llog(LL_MER, "could not setsockopt: %s", strerror(errno));
- return(-1);
- }
-
- memset(&sa, 0, sizeof sa);
- sa.sin_len = sizeof sa;
- sa.sin_family = AF_INET;
- sa.sin_port = htons(portno);
- sa.sin_addr.s_addr = htonl(INADDR_ANY);
-
- if(bind(remotesockfd, (struct sockaddr *)&sa, sizeof sa) == -1)
- {
- llog(LL_MER, "could not bind remote monitor socket to port %d: %s", portno, strerror(errno));
- return(-1);
- }
-
- if(listen(remotesockfd, 0))
- {
- llog(LL_MER, "could not listen on monitor socket: %s", strerror(errno));
- return(-1);
- }
-
- return(remotesockfd);
-}
-#endif
-
-/*---------------------------------------------------------------------------
- * Check if access rights for a local socket are specified and
- * create this socket. Return -1 otherwise.
- *---------------------------------------------------------------------------*/
-int
-monitor_create_local_socket(void)
-{
- int s;
- struct sockaddr_un sa;
-
- /* check for a local entry */
-
- if (local_rights == NULL)
- return(-1);
-
- /* create and setup socket */
-
- s = socket(AF_LOCAL, SOCK_STREAM, 0);
-
- if (s == -1)
- {
- llog(LL_MER, "could not create local monitor socket, errno = %d", errno);
- return(-1);
- }
-
- unlink(local_rights->name);
-
- memset(&sa, 0, sizeof sa);
- sa.sun_len = sizeof sa;
- sa.sun_family = AF_LOCAL;
- strcpy(sa.sun_path, local_rights->name);
-
- if (bind(s, (struct sockaddr *)&sa, SUN_LEN(&sa)))
- {
- llog(LL_MER, "could not bind local monitor socket [%s], errno = %d", local_rights->name, errno);
- return(-1);
- }
-
- chmod(local_rights->name, 0500);
-
- if (listen(s, 0))
- {
- llog(LL_MER, "could not listen on local monitor socket, errno = %d", errno);
- return(-1);
- }
-
- return(s);
-}
-
-/*---------------------------------------------------------------------------
- * Prepare a fd_set for a select call. Add all our local
- * filedescriptors to the set, increment max_fd if appropriate.
- *---------------------------------------------------------------------------*/
-void
-monitor_prepselect(fd_set *selset, int *max_fd)
-{
- struct monitor_connection * con;
-
- for (con = TAILQ_FIRST(&connections); con != NULL; con = TAILQ_NEXT(con, connections))
- {
- int fd = con->sock;
-
- if (fd > *max_fd)
- *max_fd = fd;
-
- FD_SET(fd, selset);
- }
-}
-
-/*---------------------------------------------------------------------------
- * Check if the result from a select call indicates something
- * to do for us.
- *---------------------------------------------------------------------------*/
-void
-monitor_handle_input(fd_set *selset)
-{
- struct monitor_connection * con, * next;
-
- for (next = NULL, con = TAILQ_FIRST(&connections); con != NULL; con = next)
- {
- int fd = con->sock;
- next = TAILQ_NEXT(con, connections);
-
- if (FD_ISSET(fd, selset))
- {
- /* handle command from this client */
-
- if (monitor_command(con, fd, con->rights) != 0)
- {
- /* broken or closed connection */
-
- char source[FILENAME_MAX];
-
- strcpy(source, con->source);
- TAILQ_REMOVE(&connections, con, connections);
- free(con);
- llog(LL_DMN, "monitor closed from %s", source );
- }
- }
- }
-
- /* all connections gone? */
-
- if (TAILQ_FIRST(&connections) == NULL)
- accepted = 0;
-}
-
-/*---------------------------------------------------------------------------
- * Try new incoming connection on the given socket.
- * Setup client descriptor and send initial data.
- *---------------------------------------------------------------------------*/
-void
-monitor_handle_connect(int sockfd, int is_local)
-{
- struct monitor_connection *con;
- struct monitor_rights *rp;
-
-#ifndef I4B_NOTCPIP_MONITOR
- struct sockaddr_in ia;
- u_int32_t ha = 0;
-#endif
-
- struct sockaddr_un ua;
- u_int8_t idata[I4B_MON_IDATA_SIZE];
- int fd = -1, s, i, r_mask, t_events;
- char source[FILENAME_MAX];
-
- /* accept the connection */
-
- if(is_local)
- {
- s = sizeof ua;
- fd = accept(sockfd, (struct sockaddr *)&ua, &s);
- strcpy(source, "local");
-
-#ifndef I4B_NOTCPIP_MONITOR
- }
- else
- {
- struct hostent *hp;
-
- s = sizeof ia;
- fd = accept(sockfd, (struct sockaddr *)&ia, &s);
-
- hp = gethostbyaddr((char *)&ia.sin_addr, 4, AF_INET);
-
- if(hp == NULL)
- snprintf(source, sizeof source, "%s (%s)", inet_ntoa(ia.sin_addr), inet_ntoa(ia.sin_addr));
- else
- snprintf(source, sizeof source, "%s (%s)", hp->h_name, inet_ntoa(ia.sin_addr));
-
- memcpy(&ha, &ia.sin_addr.s_addr, sizeof ha);
-
- ha = ntohl(ha);
-#endif
- }
-
- /* check the access rights of this connection */
-
- r_mask = 0;
-
- for (rp = TAILQ_FIRST(&rights); rp != NULL; rp = TAILQ_NEXT(rp, list))
- {
- if(rp->local)
- {
- if(is_local)
- {
- r_mask = rp->rights;
- break;
- }
-
-#ifndef I4B_NOTCPIP_MONITOR
- }
- else
- {
- if((ha & rp->mask) == rp->net)
- {
- r_mask = rp->rights;
- break;
- }
-#endif
- }
- }
-
- if(r_mask == 0)
- {
- /* no rights - go away */
- llog(LL_MER, "monitor access denied from %s", source);
- close(fd);
- return;
- }
-
- accepted = 1;
-
- con = malloc(sizeof(struct monitor_connection));
- memset(con, 0, sizeof *con);
- TAILQ_INSERT_TAIL(&connections, con, connections);
- con->sock = fd;
- con->rights = r_mask;
- strcpy(con->source, source);
-
- llog(LL_DMN, "monitor opened from %s rights 0x%x", source, r_mask);
-
- /* send initial data */
- I4B_PREP_CMD(idata, I4B_MON_IDATA_CODE);
- I4B_PUT_2B(idata, I4B_MON_IDATA_VERSMAJOR, MPROT_VERSION);
- I4B_PUT_2B(idata, I4B_MON_IDATA_VERSMINOR, MPROT_REL);
- I4B_PUT_2B(idata, I4B_MON_IDATA_NUMCTRL, ncontroller);
- I4B_PUT_2B(idata, I4B_MON_IDATA_NUMENTR, nentries);
- I4B_PUT_4B(idata, I4B_MON_IDATA_CLACCESS, r_mask);
-
- if((sock_write(fd, idata, sizeof idata)) == -1)
- {
- llog(LL_MER, "monitor_handle_connect: sock_write 1 error - %s", strerror(errno));
- }
-
- for (i = 0; i < ncontroller; i++)
- {
- u_int8_t ictrl[I4B_MON_ICTRL_SIZE];
-
- I4B_PREP_CMD(ictrl, I4B_MON_ICTRL_CODE);
- I4B_PUT_STR(ictrl, I4B_MON_ICTRL_NAME, name_of_controller(isdn_ctrl_tab[i].ctrl_type, isdn_ctrl_tab[i].card_type));
- I4B_PUT_2B(ictrl, I4B_MON_ICTRL_BUSID, 0);
- I4B_PUT_4B(ictrl, I4B_MON_ICTRL_FLAGS, 0);
- I4B_PUT_4B(ictrl, I4B_MON_ICTRL_NCHAN, 2);
-
- if((sock_write(fd, ictrl, sizeof ictrl)) == -1)
- {
- llog(LL_MER, "monitor_handle_connect: sock_write 2 error - %s", strerror(errno));
- }
-
- }
-
- /* send device names from entries */
-
- for(i=0; i < nentries; i++) /* walk thru all entries */
- {
- u_int8_t ictrl[I4B_MON_IDEV_SIZE];
- cfg_entry_t *p;
- char nbuf[64];
- p = &cfg_entry_tab[i]; /* get ptr to enry */
-
- snprintf(nbuf, sizeof(nbuf), "%s%d ", bdrivername(p->usrdevicename), p->usrdeviceunit);
-
- I4B_PREP_CMD(ictrl, I4B_MON_IDEV_CODE);
-/*XXX*/ I4B_PUT_2B(ictrl, I4B_MON_IDEV_STATE, 1);
- I4B_PUT_STR(ictrl, I4B_MON_IDEV_NAME, nbuf);
-
- if((sock_write(fd, ictrl, sizeof ictrl)) == -1)
- {
- llog(LL_MER, "monitor_handle_connect: sock_write 3 error - %s", strerror(errno));
- }
- }
-
-/*XXX*/ t_events = con->events;
-/*XXX*/ con->events = -1;
-
- /* current state of controller(s) */
-
- for(i=0; i < ncontroller; i++)
- {
- monitor_evnt_tei(i, isdn_ctrl_tab[i].tei);
- monitor_evnt_l12stat(i, LAYER_ONE, isdn_ctrl_tab[i].l1stat);
- monitor_evnt_l12stat(i, LAYER_TWO, isdn_ctrl_tab[i].l2stat);
- }
-
- /* current state of entries */
-
- for(i=0; i < nentries; i++)
- {
- cfg_entry_t *cep = &cfg_entry_tab[i];
-
- if(cep->state == ST_CONNECTED)
- {
- monitor_evnt_connect(cep);
- monitor_evnt_acct(cep);
- monitor_evnt_charge(cep, cep->charge, 1);
- }
- }
-
-/*XXX*/ con->events = t_events;
-
-}
-
-/*---------------------------------------------------------------------------
- * dump all monitor rights
- *---------------------------------------------------------------------------*/
-static void
-cmd_dump_rights(int fd, int r_mask, u_int8_t *cmd, const char *source)
-{
- struct monitor_rights * r;
- int num_rights;
- u_int8_t drini[I4B_MON_DRINI_SIZE];
- u_int8_t dr[I4B_MON_DR_SIZE];
-
- for (num_rights = 0, r = TAILQ_FIRST(&rights); r != NULL; r = TAILQ_NEXT(r, list))
- num_rights++;
-
- I4B_PREP_EVNT(drini, I4B_MON_DRINI_CODE);
- I4B_PUT_2B(drini, I4B_MON_DRINI_COUNT, num_rights);
-
- if((sock_write(fd, drini, sizeof drini)) == -1)
- {
- llog(LL_MER, "cmd_dump_rights: sock_write 1 error - %s", strerror(errno));
- }
-
- for (r = TAILQ_FIRST(&rights); r != NULL; r = TAILQ_NEXT(r, list))
- {
- I4B_PREP_EVNT(dr, I4B_MON_DR_CODE);
- I4B_PUT_4B(dr, I4B_MON_DR_RIGHTS, r->rights);
- I4B_PUT_4B(dr, I4B_MON_DR_NET, r->net);
- I4B_PUT_4B(dr, I4B_MON_DR_MASK, r->mask);
- I4B_PUT_1B(dr, I4B_MON_DR_LOCAL, r->local);
- if((sock_write(fd, dr, sizeof dr)) == -1)
- {
- llog(LL_MER, "cmd_dump_rights: sock_write 2 error - %s", strerror(errno));
- }
- }
-}
-
-/*---------------------------------------------------------------------------
- * rescan config file
- *---------------------------------------------------------------------------*/
-static void
-cmd_reread_cfg(int fd, int rights, u_int8_t *cmd, const char * source)
-{
- rereadconfig(42);
-}
-
-/*---------------------------------------------------------------------------
- * drop one connection
- *---------------------------------------------------------------------------*/
-static void
-cmd_hangup(int fd, int rights, u_int8_t *cmd, const char * source)
-{
- int channel = I4B_GET_4B(cmd, I4B_MON_HANGUP_CHANNEL);
- int ctrl = I4B_GET_4B(cmd, I4B_MON_HANGUP_CTRL);
-
- hangup_channel(ctrl, channel, source);
-}
-
-/*---------------------------------------------------------------------------
- * dump all active monitor connections
- *---------------------------------------------------------------------------*/
-static void
-cmd_dump_mcons(int fd, int rights, u_int8_t *cmd, const char * source)
-{
- int num_connections;
- struct monitor_connection *con;
- u_int8_t dcini[I4B_MON_DCINI_SIZE];
-
- for (num_connections = 0, con = TAILQ_FIRST(&connections); con != NULL; con = TAILQ_NEXT(con, connections))
- num_connections++;
-
- I4B_PREP_EVNT(dcini, I4B_MON_DCINI_CODE);
- I4B_PUT_2B(dcini, I4B_MON_DCINI_COUNT, num_connections);
-
- if((sock_write(fd, dcini, sizeof dcini)) == -1)
- {
- llog(LL_MER, "cmd_dump_mcons: sock_write 1 error - %s", strerror(errno));
- }
-
- for (con = TAILQ_FIRST(&connections); con != NULL; con = TAILQ_NEXT(con, connections))
- {
-#ifndef I4B_NOTCPIP_MONITOR
- int namelen;
- struct sockaddr_in name;
-#endif
- u_int8_t dc[I4B_MON_DC_SIZE];
-
- I4B_PREP_EVNT(dc, I4B_MON_DC_CODE);
- I4B_PUT_4B(dc, I4B_MON_DC_RIGHTS, con->rights);
-
-#ifndef I4B_NOTCPIP_MONITOR
- namelen = sizeof name;
-
- if (getpeername(con->sock, (struct sockaddr*)&name, &namelen) == 0)
- memcpy(dc+I4B_MON_DC_WHO, &name.sin_addr, sizeof name.sin_addr);
-#endif
- if((sock_write(fd, dc, sizeof dc)) == -1)
- {
- llog(LL_MER, "cmd_dump_mcons: sock_write 2 error - %s", strerror(errno));
- }
- }
-}
-
-/*---------------------------------------------------------------------------
- * Handle a command from the given socket. The client
- * has rights as specified in the rights parameter.
- * Return non-zero if connection is closed.
- *---------------------------------------------------------------------------*/
-static int
-monitor_command(struct monitor_connection * con, int fd, int rights)
-{
- char cmd[I4B_MAX_MON_CLIENT_CMD];
- u_int code;
-
- /* command dispatch table */
- typedef void (*cmd_func_t)(int fd, int rights, u_int8_t *cmd, const char *source);
-
- static struct {
- cmd_func_t call; /* function to execute */
- u_int rights; /* necessary rights */
- } cmd_tab[] =
- {
- /* 0 */ { NULL, 0 },
- /* 1 */ { cmd_dump_rights, I4B_CA_COMMAND_FULL },
- /* 2 */ { cmd_dump_mcons, I4B_CA_COMMAND_FULL },
- /* 3 */ { cmd_reread_cfg, I4B_CA_COMMAND_FULL },
- /* 4 */ { cmd_hangup, I4B_CA_COMMAND_FULL },
- };
-#define NUMCMD (sizeof cmd_tab / sizeof cmd_tab[0])
-
- u_long u;
- int bytes;
-
- /* Network transfer may deliver two or more packets concatenated.
- * Peek at the header and read only one event at a time... */
-
- ioctl(fd, FIONREAD, &u);
-
- if (u < I4B_MON_CMD_HDR)
- {
- if (u == 0)
- {
- /* llog(LL_MER, "monitor read 0 bytes"); */
- /* socket closed by peer */
- close(fd);
- return 1;
- }
- return 0; /* not enough data there yet */
- }
-
- bytes = recv(fd, cmd, I4B_MON_CMD_HDR, MSG_PEEK);
-
- if (bytes < I4B_MON_CMD_HDR)
- {
- llog(LL_MER, "monitor read only %d bytes", bytes);
- return 0; /* errh? something must be wrong... */
- }
-
- bytes = I4B_GET_2B(cmd, I4B_MON_CMD_LEN);
-
- if (bytes >= sizeof cmd)
- {
- close(fd);
- llog(LL_MER, "monitor: garbage on connection");
- return 1;
- }
-
- /* now we know the size, it fits, so lets read it! */
-
- if(sock_read(fd, cmd, bytes) <= 0)
- {
- llog(LL_MER, "monitor: sock_read <= 0");
- close(fd);
- return 1;
- }
-
- /* decode command */
- code = I4B_GET_2B(cmd, I4B_MON_CMD);
-
- /* special case: may modify our connection descriptor, is
- * beyound all rights checks */
-
- if (code == I4B_MON_CCMD_SETMASK)
- {
-/*XXX*/
- /*
- u_int major = I4B_GET_2B(cmd, I4B_MON_ICLIENT_VERMAJOR);
- u_int minor = I4B_GET_2B(cmd, I4B_MON_ICLIENT_VERMINOR);
- */
-
- int events = I4B_GET_4B(cmd, I4B_MON_ICLIENT_EVENTS);
- con->events = events & rights;
- return 0;
- }
-
- if (code < 0 || code >= NUMCMD)
- {
- llog(LL_MER, "illegal command from client, code = %d\n",
- code);
- return 0;
- }
-
- if (cmd_tab[code].call == NULL)
- return 0;
-
- if ((cmd_tab[code].rights & rights) == cmd_tab[code].rights)
- cmd_tab[code].call(fd, rights, cmd, con->source);
-
- return 0;
-}
-
-/*---------------------------------------------------------------------------
- * Check if somebody would receive an event with this mask.
- * We are lazy and try to avoid assembling unneccesary packets.
- * Return 0 if no one interested, nonzero otherwise.
- *---------------------------------------------------------------------------*/
-static int
-anybody(int mask)
-{
- struct monitor_connection * con;
-
- for (con = TAILQ_FIRST(&connections); con != NULL; con = TAILQ_NEXT(con, connections))
- {
- if ((con->events & mask) == mask)
- return 1;
- }
- return 0;
-}
-
-/*---------------------------------------------------------------------------
- * exec hangup command
- *---------------------------------------------------------------------------*/
-static void
-hangup_channel(int controller, int channel, const char *source)
-{
- cfg_entry_t * cep = NULL;
- int i;
-
- if(controller < ncontroller)
- {
- if(isdn_ctrl_tab[controller].state != CTRL_UP)
- return;
- for (i = 0; i < isdn_ctrl_tab[controller].nbch; i++)
- {
- if(isdn_ctrl_tab[controller].stateb[i] != CHAN_IDLE)
- {
- cep = get_cep_by_cc(controller, i);
- if (cep != NULL && cep->isdnchannelused == channel &&
- cep->isdncontrollerused == controller)
- goto found;
- }
- }
- }
- /* not found */
- return;
-
-found:
- llog(LL_CHD, "%05d %s manual disconnect (remote from %s)", cep->cdid, cep->name, source);
- cep->hangup = 1;
- return;
-}
-
-/*---------------------------------------------------------------------------
- * Send an event to every connection interested in this kind of
- * event
- *---------------------------------------------------------------------------*/
-static void
-monitor_broadcast(int mask, u_int8_t *pkt, size_t bytes)
-{
- struct monitor_connection *con;
-
- for (con = TAILQ_FIRST(&connections); con != NULL; con = TAILQ_NEXT(con, connections))
- {
- if ((con->events & mask) == mask)
- {
- int fd = con->sock;
-
- if((sock_write(fd, pkt, bytes)) == -1)
- {
- llog(LL_MER, "monitor_broadcast: sock_write error - %s", strerror(errno));
- }
- }
- }
-}
-
-/*---------------------------------------------------------------------------
- * Post a logfile event
- *---------------------------------------------------------------------------*/
-void
-monitor_evnt_log(int prio, const char * what, const char * msg)
-{
- u_int8_t evnt[I4B_MON_LOGEVNT_SIZE];
- time_t now;
-
- if (!anybody(I4B_CA_EVNT_I4B))
- return;
-
- time(&now);
-
- I4B_PREP_EVNT(evnt, I4B_MON_LOGEVNT_CODE);
- I4B_PUT_4B(evnt, I4B_MON_LOGEVNT_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_LOGEVNT_PRIO, prio);
- I4B_PUT_STR(evnt, I4B_MON_LOGEVNT_WHAT, what);
- I4B_PUT_STR(evnt, I4B_MON_LOGEVNT_MSG, msg);
-
- monitor_broadcast(I4B_CA_EVNT_I4B, evnt, sizeof evnt);
-}
-
-/*---------------------------------------------------------------------------
- * Post a charging event on the connection described
- * by the given config entry.
- *---------------------------------------------------------------------------*/
-void
-monitor_evnt_charge(cfg_entry_t *cep, int units, int estimate)
-{
- int mask;
- time_t now;
- u_int8_t evnt[I4B_MON_CHRG_SIZE];
-
- mask = (cep->direction == DIR_IN) ? I4B_CA_EVNT_CALLIN : I4B_CA_EVNT_CALLOUT;
-
- if(!anybody(mask))
- return;
-
- time(&now);
-
- I4B_PREP_EVNT(evnt, I4B_MON_CHRG_CODE);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_CTRL, cep->isdncontrollerused);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_CHANNEL, cep->isdnchannelused);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_UNITS, units);
- I4B_PUT_4B(evnt, I4B_MON_CHRG_ESTIMATED, estimate ? 1 : 0);
-
- monitor_broadcast(mask, evnt, sizeof evnt);
-}
-
-/*---------------------------------------------------------------------------
- * Post a connection event
- *---------------------------------------------------------------------------*/
-void
-monitor_evnt_connect(cfg_entry_t *cep)
-{
- u_int8_t evnt[I4B_MON_CONNECT_SIZE];
- char devname[I4B_MAX_MON_STRING];
- int mask;
- time_t now;
-
- mask = (cep->direction == DIR_IN) ? I4B_CA_EVNT_CALLIN : I4B_CA_EVNT_CALLOUT;
-
- if (!anybody(mask))
- return;
-
- time(&now);
-
- snprintf(devname, sizeof devname, "%s%d", bdrivername(cep->usrdevicename), cep->usrdeviceunit);
-
- I4B_PREP_EVNT(evnt, I4B_MON_CONNECT_CODE);
- I4B_PUT_4B(evnt, I4B_MON_CONNECT_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_CONNECT_DIR, cep->direction == DIR_OUT ? 1 : 0);
- I4B_PUT_4B(evnt, I4B_MON_CONNECT_CTRL, cep->isdncontrollerused);
- I4B_PUT_4B(evnt, I4B_MON_CONNECT_CHANNEL, cep->isdnchannelused);
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_CFGNAME, cep->name);
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_DEVNAME, devname);
-
- if(cep->direction == DIR_OUT)
- {
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_REMPHONE, cep->remote_phone_dialout.number);
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_LOCPHONE, cep->local_phone_dialout.number);
- }
- else
- {
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_REMPHONE, cep->real_phone_incoming.number);
- I4B_PUT_STR(evnt, I4B_MON_CONNECT_LOCPHONE, cep->local_phone_incoming.number);
- }
- monitor_broadcast(mask, evnt, sizeof evnt);
-}
-
-/*---------------------------------------------------------------------------
- * Post a disconnect event
- *---------------------------------------------------------------------------*/
-void
-monitor_evnt_disconnect(cfg_entry_t *cep)
-{
- u_int8_t evnt[I4B_MON_DISCONNECT_SIZE];
- int mask;
- time_t now;
-
- mask = (cep->direction == DIR_IN) ? I4B_CA_EVNT_CALLIN : I4B_CA_EVNT_CALLOUT;
-
- if (!anybody(mask))
- return;
-
- time(&now);
-
- I4B_PREP_EVNT(evnt, I4B_MON_DISCONNECT_CODE);
- I4B_PUT_4B(evnt, I4B_MON_DISCONNECT_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_DISCONNECT_CTRL, cep->isdncontrollerused);
- I4B_PUT_4B(evnt, I4B_MON_DISCONNECT_CHANNEL, cep->isdnchannelused);
-
- monitor_broadcast(mask, evnt, sizeof evnt);
-}
-
-/*---------------------------------------------------------------------------
- * Post an up/down event
- *---------------------------------------------------------------------------*/
-void
-monitor_evnt_updown(cfg_entry_t *cep, int up)
-{
- u_int8_t evnt[I4B_MON_UPDOWN_SIZE];
- int mask;
- time_t now;
-
- mask = (cep->direction == DIR_IN) ? I4B_CA_EVNT_CALLIN : I4B_CA_EVNT_CALLOUT;
-
- if (!anybody(mask))
- return;
-
- time(&now);
-
- I4B_PREP_EVNT(evnt, I4B_MON_UPDOWN_CODE);
- I4B_PUT_4B(evnt, I4B_MON_UPDOWN_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_UPDOWN_CTRL, cep->isdncontrollerused);
- I4B_PUT_4B(evnt, I4B_MON_UPDOWN_CHANNEL, cep->isdnchannelused);
- I4B_PUT_4B(evnt, I4B_MON_UPDOWN_ISUP, up);
-
- monitor_broadcast(mask, evnt, sizeof evnt);
-}
-
-/*---------------------------------------------------------------------------
- * Post a Layer1/2 status change event
- *---------------------------------------------------------------------------*/
-void
-monitor_evnt_l12stat(int controller, int layer, int state)
-{
- u_int8_t evnt[I4B_MON_L12STAT_SIZE];
- time_t now;
-
- if(!anybody(I4B_CA_EVNT_I4B))
- return;
-
- time(&now);
-
- I4B_PREP_EVNT(evnt, I4B_MON_L12STAT_CODE);
- I4B_PUT_4B(evnt, I4B_MON_L12STAT_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_L12STAT_CTRL, controller);
- I4B_PUT_4B(evnt, I4B_MON_L12STAT_LAYER, layer);
- I4B_PUT_4B(evnt, I4B_MON_L12STAT_STATE, state);
-
- monitor_broadcast(I4B_CA_EVNT_I4B, evnt, sizeof evnt);
-}
-
-/*---------------------------------------------------------------------------
- * Post a TEI change event
- *---------------------------------------------------------------------------*/
-void
-monitor_evnt_tei(int controller, int tei)
-{
- u_int8_t evnt[I4B_MON_TEI_SIZE];
- time_t now;
-
- if(!anybody(I4B_CA_EVNT_I4B))
- return;
-
- time(&now);
-
- I4B_PREP_EVNT(evnt, I4B_MON_TEI_CODE);
- I4B_PUT_4B(evnt, I4B_MON_TEI_TSTAMP, (long)now);
- I4B_PUT_4B(evnt, I4B_MON_TEI_CTRL, controller);
- I4B_PUT_4B(evnt, I4B_MON_TEI_TEI, tei);
-
- monitor_broadcast(I4B_CA_EVNT_I4B, evnt, sizeof evnt);
-}
-
-/*---------------------------------------------------------------------------
- * Post an accounting event
- *---------------------------------------------------------------------------*/
-void
-monitor_evnt_acct(cfg_entry_t *cep)
-{
- u_int8_t evnt[I4B_MON_ACCT_SIZE];
- time_t now;
-
- if(!anybody(I4B_CA_EVNT_I4B))
- return;
-
- time(&now);
-
- I4B_PREP_EVNT(evnt, I4B_MON_ACCT_CODE);
- I4B_PUT_4B(evnt, I4B_MON_ACCT_TSTAMP, (long)now);
-
- I4B_PUT_4B(evnt, I4B_MON_ACCT_CTRL, cep->isdncontrollerused);
- I4B_PUT_4B(evnt, I4B_MON_ACCT_CHAN, cep->isdnchannelused);
- I4B_PUT_4B(evnt, I4B_MON_ACCT_OBYTES, cep->outbytes);
- I4B_PUT_4B(evnt, I4B_MON_ACCT_OBPS, cep->outbps);
- I4B_PUT_4B(evnt, I4B_MON_ACCT_IBYTES, cep->inbytes);
- I4B_PUT_4B(evnt, I4B_MON_ACCT_IBPS, cep->inbps);
-
- monitor_broadcast(I4B_CA_EVNT_I4B, evnt, sizeof evnt);
-}
-
-/*---------------------------------------------------------------------------
- * read from a socket
- *---------------------------------------------------------------------------*/
-static ssize_t
-sock_read(int fd, void *buf, size_t nbytes)
-{
- size_t nleft;
- ssize_t nread;
- unsigned char *ptr;
-
- ptr = buf;
- nleft = nbytes;
-
- while(nleft > 0)
- {
- if((nread = read(fd, ptr, nleft)) < 0)
- {
- if(errno == EINTR)
- {
- nread = 0;
- }
- else
- {
- return(-1);
- }
- }
- else if(nread == 0)
- {
- break; /* EOF */
- }
-
- nleft -= nread;
- ptr += nread;
- }
- return(nbytes - nleft);
-}
-
-/*---------------------------------------------------------------------------
- * write to a socket
- *---------------------------------------------------------------------------*/
-static ssize_t
-sock_write(int fd, void *buf, size_t nbytes)
-{
- size_t nleft;
- ssize_t nwritten;
- unsigned char *ptr;
-
- ptr = buf;
- nleft = nbytes;
-
- while(nleft > 0)
- {
- if((nwritten = write(fd, ptr, nleft)) <= 0)
- {
- if(errno == EINTR)
- {
- nwritten = 0;
- }
- else
- {
- return(-1);
- }
- }
-
- nleft -= nwritten;
- ptr += nwritten;
- }
- return(nbytes);
-}
-
-struct monitor_rights * monitor_next_rights(const struct monitor_rights *r)
-{
- if (r == NULL)
- return TAILQ_FIRST(&rights);
- else
- return TAILQ_NEXT(r, list);
-}
-
-#endif /* I4B_EXTERNAL_MONITOR */
diff --git a/usr.sbin/i4b/isdnd/msghdl.c b/usr.sbin/i4b/isdnd/msghdl.c
deleted file mode 100644
index 4787a95..0000000
--- a/usr.sbin/i4b/isdnd/msghdl.c
+++ /dev/null
@@ -1,1350 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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 daemon - message from kernel handling routines
- * --------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:09:33 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-#include <sys/socket.h>
-#include <net/if.h>
-#include <net/if_types.h>
-
-#if defined(__FreeBSD__)
-#include <net/if_var.h>
-#endif
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/tcp.h>
-#include <netinet/udp.h>
-#include <netinet/ip_icmp.h>
-
-/*---------------------------------------------------------------------------*
- * handle incoming CONNECT_IND (=SETUP) message
- *---------------------------------------------------------------------------*/
-void
-msg_connect_ind(msg_connect_ind_t *mp)
-{
- cfg_entry_t *cep;
- char *src_tela = "ERROR-src_tela";
- char *dst_tela = "ERROR-dst_tela";
-
-#define SRC (aliasing == 0 ? mp->src_telno : src_tela)
-#define DST (aliasing == 0 ? mp->dst_telno : dst_tela)
-
- /* Add prefixes. All preexisting alias files are useless
- if this is on. */
- if(addprefix)
- {
- add_number_prefix(mp->src_telno, mp->src_ton);
- add_number_prefix(mp->dst_telno, mp->dst_ton);
- }
-
- if(aliasing)
- {
- src_tela = get_alias(mp->src_telno);
- dst_tela = get_alias(mp->dst_telno);
- }
-
- if((cep = find_matching_entry_incoming(mp)) == NULL)
- {
- /* log message generated in find_matching_entry_incoming() */
- sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
- handle_scrprs(mp->header.cdid, mp->scr_ind, mp->prs_ind, SRC);
- return;
- }
-
- if(cep->cdid != CDID_UNUSED && cep->cdid != CDID_RESERVED)
- {
- /*
- * This is an incoming call on a number we just dialed out.
- * Stop our dial-out and accept the incoming call.
- */
- if(cep->saved_call.cdid != CDID_UNUSED &&
- cep->saved_call.cdid != CDID_RESERVED)
- {
- int cdid;
-
- /* disconnect old, not new */
-
- cdid = cep->cdid;
- cep->cdid = cep->saved_call.cdid;
- sendm_disconnect_req(cep, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- cep->cdid = cdid;
-
- /*
- * Shortcut the state machine and mark this
- * entry as free
- */
-/* XXX */ cep->state = ST_IDLE; /* this is an invalid */
- /* transition, */
- /* so no next_state() */
- /* we have to wait here for an incoming */
- /* disconnect message !!! (-hm) */
- }
- }
-
- if(cep->inout == DIR_OUTONLY)
- {
- llog(LL_CHD, "%05d %s incoming call from %s to %s not allowed by configuration!",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
- handle_scrprs(mp->header.cdid, mp->scr_ind, mp->prs_ind, SRC);
- return;
- }
-
- cep->charge = 0;
- cep->last_charge = 0;
-
- switch(cep->dialin_reaction)
- {
- case REACT_ACCEPT:
- llog(LL_CHD, "%05d %s accepting: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- decr_free_channels(mp->controller);
- next_state(cep, EV_MCI);
- break;
-
- case REACT_REJECT:
- llog(LL_CHD, "%05d %s rejecting: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(cep, mp->header.cdid, SETUP_RESP_REJECT,
- (CAUSET_I4B << 8) | CAUSE_I4B_REJECT);
- cep->cdid = CDID_UNUSED;
- break;
-
- case REACT_IGNORE:
- llog(LL_CHD, "%05d %s ignoring: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
- cep->cdid = CDID_UNUSED;
- break;
-
- case REACT_ANSWER:
- decr_free_channels(mp->controller);
- if(cep->alert)
- {
- if(mp->display)
- {
- llog(LL_CHD, "%05d %s alerting: incoming call from %s to %s (%s)",
- mp->header.cdid, cep->name, SRC, DST, mp->display);
- }
- else
- {
- llog(LL_CHD, "%05d %s alerting: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- }
- next_state(cep, EV_ALRT);
- }
- else
- {
- if(mp->display)
- {
- llog(LL_CHD, "%05d %s answering: incoming call from %s to %s (%s)",
- mp->header.cdid, cep->name, SRC, DST, mp->display);
- }
- else
- {
- llog(LL_CHD, "%05d %s answering: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- }
- next_state(cep, EV_MCI);
- }
- break;
-
- case REACT_CALLBACK:
-
-#ifdef NOTDEF
-/*XXX reserve channel ??? */ decr_free_channels(mp->controller);
-#endif
- if(cep->cdid == CDID_RESERVED)
- {
- llog(LL_CHD, "%05d %s reserved: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- sendm_connect_resp(cep, mp->header.cdid, SETUP_RESP_REJECT,
-#if 0
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
-#else
- (CAUSET_I4B << 8) | CAUSE_I4B_REJECT);
-#endif
- /* no state change */
- }
- else
- {
- sendm_connect_resp(cep, mp->header.cdid, SETUP_RESP_REJECT,
-#if 0
- (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
-#else
- (CAUSET_I4B << 8) | CAUSE_I4B_REJECT);
-#endif
- if(cep->budget_callbackperiod && cep->budget_callbackncalls)
- {
- cep->budget_callback_req++;
- cep->budget_calltype = 0;
- if(cep->budget_callbackncalls_cnt == 0)
- {
- llog(LL_CHD, "%05d %s no budget: call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
- cep->cdid = CDID_UNUSED;
- cep->budget_callback_rej++;
- break;
- }
- else
- {
- cep->budget_calltype = BUDGET_TYPE_CBACK;
- }
- }
-
- llog(LL_CHD, "%05d %s callback: incoming call from %s to %s",
- mp->header.cdid, cep->name, SRC, DST);
-
- cep->last_release_time = time(NULL);
- cep->cdid = CDID_RESERVED;
- next_state(cep, EV_CBRQ);
- }
- break;
-
- default:
- llog(LL_WRN, "msg_connect_ind: unknown response type, tx SETUP_RESP_DNTCRE");
- sendm_connect_resp(NULL, mp->header.cdid, SETUP_RESP_DNTCRE, 0);
- break;
- }
- handle_scrprs(mp->header.cdid, mp->scr_ind, mp->prs_ind, SRC);
-#undef SRC
-#undef DST
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming CONNECT_ACTIVE_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_connect_active_ind(msg_connect_active_ind_t *mp)
-{
- cfg_entry_t *cep;
- char *device;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- llog(LL_WRN, "msg_connect_active_ind: cdid not found!");
- return;
- }
-
- cep->isdncontrollerused = mp->controller;
- cep->isdnchannelused = mp->channel;
-
- cep->aoc_now = cep->connect_time = time(NULL);
- cep->aoc_last = 0;
- cep->aoc_diff = 0;
- cep->aoc_valid = AOC_INVALID;
-
- cep->local_disconnect = DISCON_REM;
-
- cep->inbytes = INVALID;
- cep->outbytes = INVALID;
- cep->hangup = 0;
-
- device = bdrivername(cep->usrdevicename);
-
- /* set the B-channel to active */
-
- if((set_channel_busy(cep->isdncontrollerused, cep->isdnchannelused)) == ERROR)
- llog(LL_ERR, "msg_connect_active_ind: set_channel_busy failed!");
-
- if(cep->direction == DIR_OUT)
- {
- llog(LL_CHD, "%05d %s outgoing call active (ctl %d, ch %d, %s%d)",
- cep->cdid, cep->name,
- cep->isdncontrollerused, cep->isdnchannelused,
- bdrivername(cep->usrdevicename), cep->usrdeviceunit);
-
- if(cep->budget_calltype)
- {
- if(cep->budget_calltype == BUDGET_TYPE_CBACK)
- {
- cep->budget_callback_done++;
- cep->budget_callbackncalls_cnt--;
- DBGL(DL_BDGT, (llog(LL_DBG, "%s: new cback-budget = %d",
- cep->name, cep->budget_callbackncalls_cnt)));
- if(cep->budget_callbacks_file != NULL)
- upd_callstat_file(cep->budget_callbacks_file, cep->budget_callbacksfile_rotate);
- }
- else if(cep->budget_calltype == BUDGET_TYPE_COUT)
- {
- cep->budget_callout_done++;
- cep->budget_calloutncalls_cnt--;
- DBGL(DL_BDGT, (llog(LL_DBG, "%s: new cout-budget = %d",
- cep->name, cep->budget_calloutncalls_cnt)));
- if(cep->budget_callouts_file != NULL)
- upd_callstat_file(cep->budget_callouts_file, cep->budget_calloutsfile_rotate);
- }
- cep->budget_calltype = 0;
- }
- }
- else
- {
- llog(LL_CHD, "%05d %s incoming call active (ctl %d, ch %d, %s%d)",
- cep->cdid, cep->name,
- cep->isdncontrollerused, cep->isdnchannelused,
- bdrivername(cep->usrdevicename), cep->usrdeviceunit);
- }
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_connect(cep);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_connect(cep);
-#endif
-
- if(isdntime && (mp->datetime[0] != '\0'))
- {
- llog(LL_DMN, "date/time from exchange = %s", mp->datetime);
- }
-
- next_state(cep, EV_MCAI);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming PROCEEDING_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_proceeding_ind(msg_proceeding_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- llog(LL_WRN, "msg_proceeding_ind: cdid not found!");
- return;
- }
-
- cep->isdncontrollerused = mp->controller;
- cep->isdnchannelused = mp->channel;
-
- /* set the B-channels active */
-
- if((set_channel_busy(cep->isdncontrollerused, cep->isdnchannelused)) == ERROR)
- llog(LL_ERR, "msg_proceeding_ind: set_channel_busy failed!");
-
- llog(LL_CHD, "%05d %s outgoing call proceeding (ctl %d, ch %d)",
- cep->cdid, cep->name,
- cep->isdncontrollerused, cep->isdnchannelused);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming ALERT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_alert_ind(msg_alert_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- llog(LL_WRN, "msg_alert_ind: cdid not found!");
- return;
- }
-#ifdef NOTDEF
- llog(LL_CHD, "%05d %s incoming alert", cep->cdid, cep->name);
-#endif
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming L12STAT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_l12stat_ind(msg_l12stat_ind_t *ml)
-{
- if((ml->controller < 0) || (ml->controller >= ncontroller))
- {
- llog(LL_ERR, "msg_l12stat_ind: invalid controller number [%d]!", ml->controller);
- return;
- }
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_l12stat(ml->controller, ml->layer, ml->state);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_l12stat(ml->controller, ml->layer, ml->state);
-#endif
-
- DBGL(DL_CNST, (llog(LL_DBG, "msg_l12stat_ind: unit %d, layer %d, state %d",
- ml->controller, ml->layer, ml->state)));
-
- if(ml->layer == LAYER_ONE)
- {
- if(ml->state == LAYER_IDLE)
- isdn_ctrl_tab[ml->controller].l2stat = ml->state;
- isdn_ctrl_tab[ml->controller].l1stat = ml->state;
- }
- else if(ml->layer == LAYER_TWO)
- {
- if(ml->state == LAYER_ACTIVE)
- isdn_ctrl_tab[ml->controller].l1stat = ml->state;
- isdn_ctrl_tab[ml->controller].l2stat = ml->state;
- }
- else
- {
- llog(LL_ERR, "msg_l12stat_ind: invalid layer number [%d]!", ml->layer);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming TEIASG_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_teiasg_ind(msg_teiasg_ind_t *mt)
-{
- if((mt->controller < 0) || (mt->controller >= ncontroller))
- {
- llog(LL_ERR, "msg_teiasg_ind: invalid controller number [%d]!", mt->controller);
- return;
- }
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_tei(mt->controller, mt->tei);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_tei(mt->controller, mt->tei);
-#endif
-
- DBGL(DL_CNST, (llog(LL_DBG, "msg_teiasg_ind: unit %d, tei = %d",
- mt->controller, mt->tei)));
-
- isdn_ctrl_tab[mt->controller].tei = mt->tei;
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming PDEACT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_pdeact_ind(msg_pdeact_ind_t *md)
-{
- int i;
- int ctrl = md->controller;
- cfg_entry_t *cep;
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- {
- display_l12stat(ctrl, LAYER_ONE, LAYER_IDLE);
- display_l12stat(ctrl, LAYER_TWO, LAYER_IDLE);
- display_tei(ctrl, -1);
- }
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- {
- monitor_evnt_l12stat(ctrl, LAYER_ONE, LAYER_IDLE);
- monitor_evnt_l12stat(ctrl, LAYER_TWO, LAYER_IDLE);
- monitor_evnt_tei(ctrl, -1);
- }
-#endif
-
- DBGL(DL_CNST, (llog(LL_DBG, "msg_pdeact_ind: unit %d, persistent deactivation", ctrl)));
-
- isdn_ctrl_tab[ctrl].l1stat = LAYER_IDLE;
- isdn_ctrl_tab[ctrl].l2stat = LAYER_IDLE;
- isdn_ctrl_tab[ctrl].tei = -1;
-
- for(i=0; i < nentries; i++)
- {
- if((cfg_entry_tab[i].cdid != CDID_UNUSED) &&
- (cfg_entry_tab[i].isdncontrollerused == ctrl))
- {
- cep = &cfg_entry_tab[i];
-
- if(cep->cdid == CDID_RESERVED)
- {
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- continue;
- }
-
- cep->cdid = CDID_UNUSED;
-
- cep->last_release_time = time(NULL);
-
- SET_CAUSE_TYPE(cep->disc_cause, CAUSET_I4B);
- SET_CAUSE_VAL(cep->disc_cause, CAUSE_I4B_L1ERROR);
-
- if(cep->direction == DIR_OUT)
- {
- llog(LL_CHD, "%05d %s outgoing call disconnected (local)",
- cep->cdid, cep->name);
- }
- else
- {
- llog(LL_CHD, "%05d %s incoming call disconnected (local)",
- cep->cdid, cep->name);
- }
-
- llog(LL_CHD, "%05d %s cause %s",
- cep->cdid, cep->name, print_i4b_cause(cep->disc_cause));
-
-#ifdef USE_CURSES
- if(do_fullscreen && (cep->connect_time > 0))
- display_disconnect(cep);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_disconnect(cep);
-#endif
-
- if(cep->disconnectprog)
- exec_connect_prog(cep, cep->disconnectprog, 1);
-
- if(cep->connect_time > 0)
- {
- if(cep->direction == DIR_OUT)
- {
- llog(LL_CHD, "%05d %s charging: %d units, %d seconds",
- cep->cdid, cep->name, cep->charge,
- (int)difftime(time(NULL), cep->connect_time));
- }
- else
- {
- llog(LL_CHD, "%05d %s connected %d seconds",
- cep->cdid, cep->name,
- (int)difftime(time(NULL), cep->connect_time));
- }
-
- if((cep->inbytes != INVALID) && (cep->outbytes != INVALID))
- {
- if((cep->ioutbytes != cep->outbytes) ||
- (cep->iinbytes != cep->inbytes))
- {
- llog(LL_CHD, "%05d %s accounting: in %d, out %d (in %d, out %d)",
- cep->cdid, cep->name,
- cep->inbytes, cep->outbytes,
- cep->iinbytes, cep->ioutbytes);
- }
- else
- {
- llog(LL_CHD, "%05d %s accounting: in %d, out %d",
- cep->cdid, cep->name,
- cep->inbytes, cep->outbytes);
- }
- }
- }
-
- if(useacctfile && (cep->connect_time > 0))
- {
- int con_secs;
- char logdatetime[41];
- struct tm *tp;
-
- con_secs = difftime(time(NULL), cep->connect_time);
-
- tp = localtime(&cep->connect_time);
-
- strftime(logdatetime,40,I4B_TIME_FORMAT,tp);
-
- if(cep->inbytes != INVALID && cep->outbytes != INVALID)
- {
- fprintf(acctfp, "%s - %s %s %d (%d) (%d/%d)\n",
- logdatetime, getlogdatetime(),
- cep->name, cep->charge, con_secs,
- cep->inbytes, cep->outbytes);
- }
- else
- {
- fprintf(acctfp, "%s - %s %s %d (%d)\n",
- logdatetime, getlogdatetime(),
- cep->name, cep->charge, con_secs);
- }
- }
-
- /* set the B-channel inactive */
-
- if((set_channel_idle(cep->isdncontrollerused, cep->isdnchannelused)) == ERROR)
- llog(LL_ERR, "msg_pdeact_ind: set_channel_idle failed!");
-
- incr_free_channels(cep->isdncontrollerused);
-
- cep->connect_time = 0;
-
- cep->state = ST_IDLE;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming NEGCOMP_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_negcomplete_ind(msg_negcomplete_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- llog(LL_WRN, "msg_negcomp_ind: cdid not found");
- return;
- }
-
- if(cep->connectprog)
- exec_connect_prog(cep, cep->connectprog, 0);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming IFSTATE_CHANGED indication
- *---------------------------------------------------------------------------*/
-void
-msg_ifstatechg_ind(msg_ifstatechg_ind_t *mp)
-{
- cfg_entry_t *cep;
- char *device;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- llog(LL_WRN, "msg_negcomp_ind: cdid not found");
- return;
- }
-
- device = bdrivername(cep->usrdevicename);
- llog(LL_DBG, "%s%d: switched to state %d", device, cep->usrdeviceunit, mp->state);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming DISCONNECT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_disconnect_ind(msg_disconnect_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- llog(LL_WRN, "msg_disconnect_ind: cdid not found");
- return;
- }
-
- /* is this an aborted out-call prematurely called back? */
- if (cep->saved_call.cdid == mp->header.cdid)
- {
- DBGL(DL_CNST, (llog(LL_DBG, "aborted outcall %05d disconnected",
- mp->header.cdid)));
- cep->saved_call.cdid = CDID_UNUSED;
-
- set_channel_idle(cep->saved_call.controller, cep->saved_call.channel);
-
- incr_free_channels(cep->saved_call.controller);
- return;
- }
-
- cep->last_release_time = time(NULL);
- cep->disc_cause = mp->cause;
-
- if(cep->direction == DIR_OUT)
- {
- llog(LL_CHD, "%05d %s outgoing call disconnected %s",
- cep->cdid, cep->name,
- cep->local_disconnect == DISCON_LOC ?
- "(local)" : "(remote)");
- }
- else
- {
- llog(LL_CHD, "%05d %s incoming call disconnected %s",
- cep->cdid, cep->name,
- cep->local_disconnect == DISCON_LOC ?
- "(local)" : "(remote)");
- }
-
- llog(LL_CHD, "%05d %s cause %s",
- cep->cdid, cep->name, print_i4b_cause(mp->cause));
-
-#ifdef USE_CURSES
- if(do_fullscreen && (cep->connect_time > 0))
- display_disconnect(cep);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_disconnect(cep);
-#endif
-
- if(cep->disconnectprog)
- exec_connect_prog(cep, cep->disconnectprog, 1);
-
- if(cep->connect_time > 0)
- {
- if(cep->direction == DIR_OUT)
- {
- llog(LL_CHD, "%05d %s charging: %d units, %d seconds",
- cep->cdid, cep->name, cep->charge,
- (int)difftime(time(NULL), cep->connect_time));
- }
- else
- {
- llog(LL_CHD, "%05d %s connected %d seconds",
- cep->cdid, cep->name,
- (int)difftime(time(NULL), cep->connect_time));
- }
-
- if((cep->inbytes != INVALID) && (cep->outbytes != INVALID))
- {
- if((cep->ioutbytes != cep->outbytes) ||
- (cep->iinbytes != cep->inbytes))
- {
- llog(LL_CHD, "%05d %s accounting: in %d, out %d (in %d, out %d)",
- cep->cdid, cep->name,
- cep->inbytes, cep->outbytes,
- cep->iinbytes, cep->ioutbytes);
- }
- else
- {
- llog(LL_CHD, "%05d %s accounting: in %d, out %d",
- cep->cdid, cep->name,
- cep->inbytes, cep->outbytes);
- }
- }
- }
-
- if(useacctfile && (cep->connect_time > 0))
- {
- int con_secs;
- char logdatetime[41];
- struct tm *tp;
-
- con_secs = difftime(time(NULL), cep->connect_time);
-
- tp = localtime(&cep->connect_time);
-
- strftime(logdatetime,40,I4B_TIME_FORMAT,tp);
-
- if(cep->inbytes != INVALID && cep->outbytes != INVALID)
- {
- fprintf(acctfp, "%s - %s %s %d (%d) (%d/%d)\n",
- logdatetime, getlogdatetime(),
- cep->name, cep->charge, con_secs,
- cep->inbytes, cep->outbytes);
- }
- else
- {
- fprintf(acctfp, "%s - %s %s %d (%d)\n",
- logdatetime, getlogdatetime(),
- cep->name, cep->charge, con_secs);
- }
- }
-
- /* set the B-channel inactive */
-
- set_channel_idle(cep->isdncontrollerused, cep->isdnchannelused);
-
- incr_free_channels(cep->isdncontrollerused);
-
- cep->connect_time = 0;
- cep->cdid = CDID_UNUSED;
-
- next_state(cep, EV_MDI);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming DIALOUT message
- *---------------------------------------------------------------------------*/
-void
-msg_dialout(msg_dialout_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_dialout: dial req from %s, unit %d", bdrivername(mp->driver), mp->driver_unit)));
-
- if((cep = find_by_device_for_dialout(mp->driver, mp->driver_unit)) == NULL)
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_dialout: config entry reserved or no match")));
- return;
- }
-
- if(cep->inout == DIR_INONLY)
- {
- dialresponse(cep, DSTAT_INONLY);
- return;
- }
-
- if(cep->budget_calloutperiod && cep->budget_calloutncalls)
- {
- cep->budget_calltype = 0;
- cep->budget_callout_req++;
-
- if(cep->budget_calloutncalls_cnt == 0)
- {
- llog(LL_CHD, "%05d %s no budget for calling out", 0, cep->name);
- cep->budget_callout_rej++;
- dialresponse(cep, DSTAT_TFAIL);
- return;
- }
- else
- {
- cep->budget_calltype = BUDGET_TYPE_COUT;
- }
- }
-
- if((cep->cdid = get_cdid()) == 0)
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_dialout: get_cdid() returned 0!")));
- return;
- }
-
- cep->charge = 0;
- cep->last_charge = 0;
- cep->hangup = 0;
-
- next_state(cep, EV_MDO);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming DIALOUTNUMBER message
- *---------------------------------------------------------------------------*/
-void
-msg_dialoutnumber(msg_dialoutnumber_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_dialoutnumber: dial req from %s, unit %d", bdrivername(mp->driver), mp->driver_unit)));
-
- if((cep = find_by_device_for_dialoutnumber(mp)) == NULL)
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_dialoutnumber: config entry reserved or no match")));
- return;
- }
-
- if(cep->inout == DIR_INONLY)
- {
- dialresponse(cep, DSTAT_INONLY);
- return;
- }
-
- if(cep->budget_calloutperiod && cep->budget_calloutncalls)
- {
- cep->budget_calltype = 0;
- cep->budget_callout_req++;
-
- if(cep->budget_calloutncalls_cnt == 0)
- {
- llog(LL_CHD, "%05d %s no budget for calling out", 0, cep->name);
- cep->budget_callout_rej++;
- dialresponse(cep, DSTAT_TFAIL);
- return;
- }
- else
- {
- cep->budget_calltype = BUDGET_TYPE_COUT;
- }
- }
-
- if((cep->cdid = get_cdid()) == 0)
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_dialoutnumber: get_cdid() returned 0!")));
- return;
- }
-
- cep->keypad[0] = '\0';
- cep->charge = 0;
- cep->last_charge = 0;
- cep->hangup = 0;
-
- next_state(cep, EV_MDO);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming KEYPAD message
- *---------------------------------------------------------------------------*/
-void
-msg_keypad(msg_keypad_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_keypad: dial req from %s, unit %d", bdrivername(mp->driver), mp->driver_unit)));
-
- if((cep = find_by_device_for_keypad(mp->driver, mp->driver_unit, mp->cmdlen, mp->cmd)) == NULL)
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_keypad: config entry reserved or no match")));
- return;
- }
-
- if(cep->inout == DIR_INONLY)
- {
- dialresponse(cep, DSTAT_INONLY);
- return;
- }
-
- if(cep->budget_calloutperiod && cep->budget_calloutncalls)
- {
- cep->budget_calltype = 0;
- cep->budget_callout_req++;
-
- if(cep->budget_calloutncalls_cnt == 0)
- {
- llog(LL_CHD, "%05d %s no budget for calling out", 0, cep->name);
- cep->budget_callout_rej++;
- dialresponse(cep, DSTAT_TFAIL);
- return;
- }
- else
- {
- cep->budget_calltype = BUDGET_TYPE_COUT;
- }
- }
-
- if((cep->cdid = get_cdid()) == 0)
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_keypad: get_cdid() returned 0!")));
- return;
- }
-
- cep->charge = 0;
- cep->last_charge = 0;
- cep->hangup = 0;
-
- next_state(cep, EV_MDO);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming DRVRDISC_REQ message
- *---------------------------------------------------------------------------*/
-void
-msg_drvrdisc_req(msg_drvrdisc_req_t *mp)
-{
- cfg_entry_t *cep;
-
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_drvrdisc_req: req from %s, unit %d", bdrivername(mp->driver), mp->driver_unit)));
-
- if((cep = get_cep_by_driver(mp->driver, mp->driver_unit)) == NULL)
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_drvrdisc_req: config entry not found")));
- return;
- }
- next_state(cep, EV_DRQ);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming ACCOUNTING message
- *---------------------------------------------------------------------------*/
-void
-msg_accounting(msg_accounting_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = find_active_entry_by_driver(mp->driver, mp->driver_unit)) == NULL)
- {
- llog(LL_WRN, "msg_accounting: no config entry found!");
- return;
- }
-
- cep->inbytes = mp->inbytes;
- cep->iinbytes = mp->iinbytes;
- cep->outbytes = mp->outbytes;
- cep->ioutbytes = mp->ioutbytes;
- cep->inbps = mp->inbps;
- cep->outbps = mp->outbps;
-
- if(mp->accttype == ACCT_DURING)
- {
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_acct(cep);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_acct(cep);
-#endif
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming CHARGING message
- *---------------------------------------------------------------------------*/
-void
-msg_charging_ind(msg_charging_ind_t *mp)
-{
- static char *cttab[] = {
- "invalid",
- "AOCD",
- "AOCE",
- "estimated" };
-
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- llog(LL_WRN, "msg_charging_ind: cdid not found");
- return;
- }
-
- if(mp->units_type < CHARGE_INVALID || mp->units_type > CHARGE_CALC)
- {
- llog(LL_ERR, "msg_charging: units_type %d out of range!", mp->units_type);
- error_exit(1, "msg_charging: units_type %d out of range!", mp->units_type);
- }
-
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_charging: %d unit(s) (%s)",
- mp->units, cttab[mp->units_type])));
-
- cep->charge = mp->units;
-
- switch(mp->units_type)
- {
- case CHARGE_AOCD:
- if((cep->unitlengthsrc == ULSRC_DYN) &&
- (cep->charge != cep->last_charge))
- {
- cep->last_charge = cep->charge;
- handle_charge(cep);
- }
- break;
-
- case CHARGE_CALC:
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_ccharge(cep, mp->units);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_charge(cep, mp->units, 1);
-#endif
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming IDLE_TIMEOUT_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_idle_timeout_ind(msg_idle_timeout_ind_t *mp)
-{
- cfg_entry_t *cep;
-
- if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL)
- {
- llog(LL_WRN, "msg_idle_timeout_ind: cdid not found!");
- return;
- }
-
- cep->local_disconnect = DISCON_LOC;
-
- DBGL(DL_DRVR, (llog(LL_DBG, "msg_idle_timeout_ind: idletimeout, kernel sent disconnect!")));
-
- check_and_kill(cep);
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming MSG_PACKET_IND message
- *---------------------------------------------------------------------------*/
-static char *
-strapp(char *buf, const char *txt)
-{
- while(*txt)
- *buf++ = *txt++;
- *buf = '\0';
- return buf;
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming MSG_PACKET_IND message
- *---------------------------------------------------------------------------*/
-static char *
-ipapp(char *buf, unsigned long a )
-{
- unsigned long ma = ntohl( a );
-
- buf += sprintf(buf, "%lu.%lu.%lu.%lu",
- (ma>>24)&0xFF,
- (ma>>16)&0xFF,
- (ma>>8)&0xFF,
- (ma)&0xFF);
- return buf;
-}
-
-/*---------------------------------------------------------------------------*
- * handle incoming MSG_PACKET_IND message
- *---------------------------------------------------------------------------*/
-void
-msg_packet_ind(msg_packet_ind_t *mp)
-{
- cfg_entry_t *cep;
- struct ip *ip;
- u_char *proto_hdr;
- char tmp[80];
- char *cptr = tmp;
- char *name = "???";
- int i;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- if(cep->usrdevicename == mp->driver &&
- cep->usrdeviceunit == mp->driver_unit)
- {
- name = cep->name;
- break;
- }
- }
-
- ip = (struct ip*)mp->pktdata;
- proto_hdr = mp->pktdata + ((ip->ip_hl)<<2);
-
- if( ip->ip_p == IPPROTO_TCP )
- {
- struct tcphdr* tcp = (struct tcphdr*)proto_hdr;
-
- cptr = strapp( cptr, "TCP " );
- cptr = ipapp( cptr, ip->ip_src.s_addr );
- cptr += sprintf( cptr, ":%u -> ", ntohs( tcp->th_sport ) );
- cptr = ipapp( cptr, ip->ip_dst.s_addr );
- cptr += sprintf( cptr, ":%u", ntohs( tcp->th_dport ) );
-
- if(tcp->th_flags & TH_FIN) cptr = strapp( cptr, " FIN" );
- if(tcp->th_flags & TH_SYN) cptr = strapp( cptr, " SYN" );
- if(tcp->th_flags & TH_RST) cptr = strapp( cptr, " RST" );
- if(tcp->th_flags & TH_PUSH) cptr = strapp( cptr, " PUSH" );
- if(tcp->th_flags & TH_ACK) cptr = strapp( cptr, " ACK" );
- if(tcp->th_flags & TH_URG) cptr = strapp( cptr, " URG" );
- }
- else if( ip->ip_p == IPPROTO_UDP )
- {
- struct udphdr* udp = (struct udphdr*)proto_hdr;
-
- cptr = strapp( cptr, "UDP " );
- cptr = ipapp( cptr, ip->ip_src.s_addr );
- cptr += sprintf( cptr, ":%u -> ", ntohs( udp->uh_sport ) );
- cptr = ipapp( cptr, ip->ip_dst.s_addr );
- cptr += sprintf( cptr, ":%u", ntohs( udp->uh_dport ) );
- }
- else if( ip->ip_p == IPPROTO_ICMP )
- {
- struct icmp* icmp = (struct icmp*)proto_hdr;
-
- cptr += sprintf( cptr, "ICMP:%u.%u", icmp->icmp_type, icmp->icmp_code);
- cptr = ipapp( cptr, ip->ip_src.s_addr );
- cptr = strapp( cptr, " -> " );
- cptr = ipapp( cptr, ip->ip_dst.s_addr );
- }
- else
- {
- cptr += sprintf( cptr, "PROTO=%u ", ip->ip_p);
- cptr = ipapp( cptr, ip->ip_src.s_addr);
- cptr = strapp( cptr, " -> " );
- cptr = ipapp( cptr, ip->ip_dst.s_addr);
- }
-
- llog(LL_PKT, "%s %s %u %s",
- name, mp->direction ? "send" : "recv",
- ntohs( ip->ip_len ), tmp );
-}
-
-/*---------------------------------------------------------------------------*
- * get a cdid from kernel
- *---------------------------------------------------------------------------*/
-int
-get_cdid(void)
-{
- msg_cdid_req_t mcr;
-
- mcr.cdid = 0;
-
- if((ioctl(isdnfd, I4B_CDID_REQ, &mcr)) < 0)
- {
- llog(LL_ERR, "get_cdid: ioctl I4B_CDID_REQ failed: %s", strerror(errno));
- error_exit(1, "get_cdid: ioctl I4B_CDID_REQ failed: %s", strerror(errno));
- }
-
- return(mcr.cdid);
-}
-
-/*---------------------------------------------------------------------------*
- * send message "connect request" to kernel
- *---------------------------------------------------------------------------*/
-int
-sendm_connect_req(cfg_entry_t *cep)
-{
- msg_connect_req_t mcr;
- int ret;
-
- cep->local_disconnect = DISCON_REM;
-
- cep->unitlength = get_current_rate(cep, 1);
-
- mcr.cdid = cep->cdid;
-
- mcr.controller = cep->isdncontrollerused;
- mcr.channel = cep->isdnchannelused;
- mcr.txdelay = cep->isdntxdelout;
-
- mcr.bprot = cep->b1protocol;
- mcr.bcap = cep->bcap;
-
- mcr.driver = cep->usrdevicename;
- mcr.driver_unit = cep->usrdeviceunit;
-
- /* setup the shorthold data */
- mcr.shorthold_data.shorthold_algorithm = cep->shorthold_algorithm;
- mcr.shorthold_data.unitlen_time = cep->unitlength;
- mcr.shorthold_data.idle_time = cep->idle_time_out;
- mcr.shorthold_data.earlyhup_time = cep->earlyhangup;
-
- if(cep->unitlengthsrc == ULSRC_DYN)
- mcr.unitlen_method = ULEN_METHOD_DYNAMIC;
- else
- mcr.unitlen_method = ULEN_METHOD_STATIC;
-
- strcpy(mcr.dst_telno, cep->remote_phone_dialout.number);
- if(cep->usesubaddr)
- strcpy(mcr.dst_subaddr, cep->remote_phone_dialout.subaddr);
- strcpy(mcr.src_telno, cep->local_phone_dialout.number);
- if(cep->usesubaddr)
- strcpy(mcr.src_subaddr, cep->local_phone_dialout.subaddr);
- strcpy(mcr.keypad, cep->keypad);
-
- cep->last_dial_time = time(NULL);
- cep->direction = DIR_OUT;
-
- DBGL(DL_CNST, (llog(LL_DBG, "sendm_connect_req: ctrl = %d, chan = %d", cep->isdncontrollerused, cep->isdnchannelused)));
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_REQ, &mcr)) < 0)
- {
- llog(LL_ERR, "sendm_connect_req: ioctl I4B_CONNECT_REQ failed: %s", strerror(errno));
- error_exit(1, "sendm_connect_req: ioctl I4B_CONNECT_REQ failed: %s", strerror(errno));
- }
-
- decr_free_channels(cep->isdncontrollerused);
-
- llog(LL_CHD, "%05d %s dialing out from %s to %s",
- cep->cdid,
- cep->name,
- aliasing ? get_alias(cep->local_phone_dialout.number) : cep->local_phone_dialout.number,
- aliasing ? get_alias(cep->remote_phone_dialout.number) : cep->remote_phone_dialout.number);
-
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * send message "connect response" to kernel
- *---------------------------------------------------------------------------*/
-int
-sendm_connect_resp(cfg_entry_t *cep, int cdid, int response, cause_t cause)
-{
- msg_connect_resp_t mcr;
- int ret;
-
- mcr.cdid = cdid;
-
- mcr.response = response;
-
- if(response == SETUP_RESP_REJECT)
- {
- mcr.cause = cause;
- DBGL(DL_DRVR, (llog(LL_DBG, "sendm_connect_resp: reject, cause=0x%x", cause)));
- }
- else if(response == SETUP_RESP_ACCEPT)
- {
- cep->direction = DIR_IN;
-
- mcr.txdelay = cep->isdntxdelin;
-
- mcr.bprot = cep->b1protocol;
- mcr.bcap = cep->bcap;
-
- mcr.driver = cep->usrdevicename;
- mcr.driver_unit = cep->usrdeviceunit;
-
- mcr.max_idle_time = cep->idle_time_in;
-
- DBGL(DL_DRVR, (llog(LL_DBG, "sendm_connect_resp: accept")));
- }
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_RESP, &mcr)) < 0)
- {
- llog(LL_ERR, "sendm_connect_resp: ioctl I4B_CONNECT_RESP failed: %s", strerror(errno));
- error_exit(1, "sendm_connect_resp: ioctl I4B_CONNECT_RESP failed: %s", strerror(errno));
- }
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * send message "disconnect request" to kernel
- *---------------------------------------------------------------------------*/
-int
-sendm_disconnect_req(cfg_entry_t *cep, cause_t cause)
-{
- msg_discon_req_t mcr;
- int ret = 0;
-
- mcr.cdid = cep->cdid;
-
- mcr.cause = cause;
-
- cep->local_disconnect = DISCON_LOC;
-
- if((ret = ioctl(isdnfd, I4B_DISCONNECT_REQ, &mcr)) < 0)
- {
- llog(LL_ERR, "sendm_disconnect_req: ioctl I4B_DISCONNECT_REQ failed: %s", strerror(errno));
- }
- else
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "sendm_disconnect_req: sent DISCONNECT_REQ")));
- }
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * send message "alert request" to kernel
- *---------------------------------------------------------------------------*/
-int
-sendm_alert_req(cfg_entry_t *cep)
-{
- msg_alert_req_t mar;
- int ret;
-
- mar.cdid = cep->cdid;
-
- if((ret = ioctl(isdnfd, I4B_ALERT_REQ, &mar)) < 0)
- {
- llog(LL_ERR, "sendm_alert_req: ioctl I4B_ALERT_REQ failed: %s", strerror(errno));
- error_exit(1, "sendm_alert_req: ioctl I4B_ALERT_REQ failed: %s", strerror(errno));
- }
- else
- {
- DBGL(DL_DRVR, (llog(LL_DBG, "sendm_alert_req: sent ALERT_REQ")));
- }
- return(ret);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/pathnames.h b/usr.sbin/i4b/isdnd/pathnames.h
deleted file mode 100644
index 44f9c6d..0000000
--- a/usr.sbin/i4b/isdnd/pathnames.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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 daemon - location of files
- * ------------------------------
- *
- * $Id: pathnames.h,v 1.11 2000/10/09 11:17:07 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Oct 2 22:55:28 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _PATHNAMES_H_
-#define _PATHNAMES_H_
-
-#define I4BDEVICE "/dev/i4b"
-
-#define ETCPATH "/etc/isdn"
-
-#define CONFIG_FILE_DEF "/etc/isdn/isdnd.rc"
-
-#define RATES_FILE_DEF "/etc/isdn/isdnd.rates"
-
-#define HOLIDAY_FILE_DEF "/etc/isdn/holidays"
-
-#define TINA_FILE_DEF "/etc/isdn/tinainitprog"
-
-#define LOG_FILE_DEF "/var/log/isdnd.log"
-
-#define ACCT_FILE_DEF "/var/log/isdnd.acct"
-
-#define PIDFILE "/var/run/isdnd.pid"
-
-#endif /* _PATHNAMES_H_ */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/pcause.c b/usr.sbin/i4b/isdnd/pcause.c
deleted file mode 100644
index 99aa089..0000000
--- a/usr.sbin/i4b/isdnd/pcause.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * printing cause values
- * ---------------------
- *
- * $Id: pcause.c,v 1.13 2000/10/09 12:53:29 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:48:07 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-static char *cause_i4b_tab[CAUSE_I4B_MAX+1];
-static char *cause_q850_tab[CAUSE_Q850_MAX];
-
-char *
-print_i4b_cause(cause_t code)
-{
- static char error_message[128];
-
- snprintf(error_message, sizeof(error_message), "%d: ", GET_CAUSE_VAL(code));
-
- switch(GET_CAUSE_TYPE(code))
- {
- case CAUSET_Q850:
- strcat(error_message, cause_q850_tab[GET_CAUSE_VAL(code)]);
- strcat(error_message, " (Q.850)");
- break;
-
- case CAUSET_I4B:
- if((GET_CAUSE_VAL(code) < CAUSE_I4B_NORMAL) ||
- (GET_CAUSE_VAL(code) >= CAUSE_I4B_MAX))
- {
- SET_CAUSE_VAL(code, CAUSE_I4B_MAX);
- }
- strcat(error_message, cause_i4b_tab[GET_CAUSE_VAL(code)]);
- strcat(error_message, " (I4B)");
- break;
-
- default:
- strcat(error_message, "ERROR: unknown cause type!");
- break;
- }
- return(error_message);
-}
-
-static char *cause_i4b_tab[CAUSE_I4B_MAX+1] = {
- "normal call clearing",
- "user busy",
- "channel not available",
- "incompatible source or destination",
- "call rejected",
- "destination out of order",
- "temporary failure",
- "layer 1 error / persistent deactivation",
- "dialing impossible on leased line",
- "ERROR, invalid I4B cause value!"
-};
-
-static char *cause_q850_tab[CAUSE_Q850_MAX] = {
- "Normal D-channel shutdown",
- "Unallocated (unassigned) number",
- "No route to specified transit network (national use)",
- "No route to destination",
- "Send special information tone",
- "Misdialled trunk prefix (national use)",
- "Channel unacceptable",
- "Call awarded and being delivered in an established channel",
- "Preemption",
- "Preemption - circuit reserved for reuse",
-
-/*10*/ "cause code 10: error, unassigned in Q.850 (03/93)",
- "cause code 11: error, unassigned in Q.850 (03/93)",
- "cause code 12: error, unassigned in Q.850 (03/93)",
- "cause code 13: error, unassigned in Q.850 (03/93)",
- "cause code 14: error, unassigned in Q.850 (03/93)",
- "cause code 15: error, unassigned in Q.850 (03/93)",
- "Normal call clearing",
- "User busy",
- "No user responding",
- "No answer from user (user alerted)",
-
-/*20*/ "Subscriber absent",
- "Call rejected",
- "Number changed",
- "cause code 23: error, unassigned in Q.850 (03/93)",
- "cause code 24: error, unassigned in Q.850 (03/93)",
- "cause code 25: error, unassigned in Q.850 (03/93)",
- "Non-selected user clearing",
- "Destination out of order",
- "Invalid number format",
- "Facility rejected",
-
-/*30*/ "Response to STATUS ENQUIRY",
- "Normal, unspecified",
- "cause code 32: error, unassigned in Q.850 (03/93)",
- "cause code 33: error, unassigned in Q.850 (03/93)",
- "No circuit / channel available",
- "cause code 35: error, unassigned in Q.850 (03/93)",
- "cause code 36: error, unassigned in Q.850 (03/93)",
- "cause code 37: error, unassigned in Q.850 (03/93)",
- "Network out of order",
- "Permanent frame mode connection out of service",
-
-/*40*/ "Permanent frame mode connection operational",
- "Temporary failure",
- "Switching equipment congestion",
- "Access information discarded",
- "Requested circuit/channel not available",
- "cause code 45: error, unassigned in Q.850 (03/93)",
- "Precedence call blocked",
- "Resources unavailable, unspecified",
- "cause code 48: error, unassigned in Q.850 (03/93)",
- "Quality of service unavailable",
-
-/*50*/ "Requested facility not subscribed",
- "cause code 51: error, unassigned in Q.850 (03/93)",
- "cause code 52: error, unassigned in Q.850 (03/93)",
- "Outgoing calls barred within CUG",
- "cause code 54: error, unassigned in Q.850 (03/93)",
- "Incoming calls barred within CUG",
- "cause code 56: error, unassigned in Q.850 (03/93)",
- "Bearer capability not authorized",
- "Bearer capability not presently available",
- "cause code 59: error, unassigned in Q.850 (03/93)",
-
-/*60*/ "cause code 60: error, unassigned in Q.850 (03/93)",
- "cause code 61: error, unassigned in Q.850 (03/93)",
- "Inconsistenciy in designated outg. access info and subscriber class",
- "Service or option not available, unspecified",
- "cause code 64: error, unassigned in Q.850 (03/93)",
- "Bearer capability not implemented",
- "Channel type not implemented",
- "cause code 67: error, unassigned in Q.850 (03/93)",
- "cause code 68: error, unassigned in Q.850 (03/93)",
- "Requested facility not implemented",
-
-/*70*/ "Only restricted digital information bearer capability is available",
- "cause code 71: error, unassigned in Q.850 (03/93)",
- "cause code 72: error, unassigned in Q.850 (03/93)",
- "cause code 73: error, unassigned in Q.850 (03/93)",
- "cause code 74: error, unassigned in Q.850 (03/93)",
- "cause code 75: error, unassigned in Q.850 (03/93)",
- "cause code 76: error, unassigned in Q.850 (03/93)",
- "cause code 77: error, unassigned in Q.850 (03/93)",
- "cause code 78: error, unassigned in Q.850 (03/93)",
- "Service or option not implemented, unspecified",
-
-/*80*/ "cause code 80: error, unassigned in Q.850 (03/93)",
- "Invalid call reference value",
- "Identified channel does not exist",
- "A suspended call exists, but this call identity does not",
- "Call identity in use",
- "No call suspended",
- "Call having the requested call identity has been cleared",
- "User not member of CUG",
- "Incompatible destination",
- "cause code 89: error, unassigned in Q.850 (03/93)",
-
-/*90*/ "Non-existent CUG",
- "Invalid transit network selection",
- "cause code 92: error, unassigned in Q.850 (03/93)",
- "cause code 93: error, unassigned in Q.850 (03/93)",
- "cause code 94: error, unassigned in Q.850 (03/93)",
- "Invalid message, unspecified",
- "Mandatory information element is missing",
- "Message type non-existent or not implemented",
- "Message not compatible with call state or message type non-existent or not implemented",
- "Information element/parameter non-existent or not implemented",
-
-/*100*/ "Invalid information element contents",
- "Message not compatible with call state",
- "Recovery on timer expiry",
- "Parameter non-existent or not implemented, passed on",
- "cause code 104: error, unassigned in Q.850 (03/93)",
- "cause code 105: error, unassigned in Q.850 (03/93)",
- "cause code 106: error, unassigned in Q.850 (03/93)",
- "cause code 107: error, unassigned in Q.850 (03/93)",
- "cause code 108: error, unassigned in Q.850 (03/93)",
- "cause code 109: error, unassigned in Q.850 (03/93)",
-
-/*110*/ "Message with unrecognized parameter, discarded",
- "Protocol error, unspecified",
- "cause code 112: error, unassigned in Q.850 (03/93)",
- "cause code 113: error, unassigned in Q.850 (03/93)",
- "cause code 114: error, unassigned in Q.850 (03/93)",
- "cause code 115: error, unassigned in Q.850 (03/93)",
- "cause code 116: error, unassigned in Q.850 (03/93)",
- "cause code 117: error, unassigned in Q.850 (03/93)",
- "cause code 118: error, unassigned in Q.850 (03/93)",
- "cause code 119: error, unassigned in Q.850 (03/93)",
-
-/*120*/ "cause code 120: error, unassigned in Q.850 (03/93)",
- "cause code 121: error, unassigned in Q.850 (03/93)",
- "cause code 122: error, unassigned in Q.850 (03/93)",
- "cause code 123: error, unassigned in Q.850 (03/93)",
- "cause code 124: error, unassigned in Q.850 (03/93)",
- "cause code 125: error, unassigned in Q.850 (03/93)",
- "cause code 126: error, unassigned in Q.850 (03/93)",
- "Interworking, unspecified"
-};
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/process.c b/usr.sbin/i4b/isdnd/process.c
deleted file mode 100644
index a71048f..0000000
--- a/usr.sbin/i4b/isdnd/process.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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 daemon - process handling routines
- * --------------------------------------
- *
- * $Id: process.c,v 1.8 1999/12/13 21:25:25 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:09:55 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-/*---------------------------------------------------------------------------*
- * check if another instance of us is already running
- *---------------------------------------------------------------------------*/
-void
-check_pid(void)
-{
- FILE *fp;
-
- /* check if another lock-file already exists */
-
- if((fp = fopen(PIDFILE, "r")) != NULL)
- {
- /* lockfile found, check */
-
- int oldpid;
-
- /* read pid from file */
-
- if((fscanf(fp, "%d", &oldpid)) != 1)
- {
- llog(LL_ERR, "ERROR, reading pid from lockfile failed, terminating!");
- exit(1);
- }
-
- /* check if process got from file is still alive */
-
- if((kill(oldpid, 0)) != 0)
- {
- /* process does not exist */
-
- /* close file */
-
- fclose(fp);
-
- DBGL(DL_PROC, (llog(LL_DBG, "removing old lock-file %s", PIDFILE)));
-
- /* remove file */
-
- unlink(PIDFILE);
- }
- else
- {
- /* process is still alive */
-
- llog(LL_ERR, "ERROR, another daemon is already running, pid = %d, terminating!", oldpid);
- exit(1);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * establish and init process lock file
- *---------------------------------------------------------------------------*/
-void
-write_pid(void)
-{
- FILE *fp;
-
- /* write my pid into lock-file */
-
- if((fp = fopen(PIDFILE, "w")) == NULL)
- {
- llog(LL_ERR, "ERROR, can't open lockfile for writing, terminating");
- do_exit(1);
- }
-
- if((fprintf(fp, "%d", (int)getpid())) == EOF)
- {
- llog(LL_ERR, "ERROR, can't write pid to lockfile, terminating");
- do_exit(1);
- }
-
- fsync(fileno(fp));
-
- fclose(fp);
-}
-
-/*---------------------------------------------------------------------------*
- * become a daemon
- *---------------------------------------------------------------------------*/
-void
-daemonize(void)
-{
- int fd;
-
- switch (fork())
- {
- case -1: /* error */
- llog(LL_ERR, "ERROR, daemonize/fork: %s", strerror(errno));
- exit(1);
- case 0: /* child */
- break;
- default: /* parent */
- exit(0);
- }
-
- /* new session / no control tty */
-
- if(setsid() == -1)
- {
- llog(LL_ERR, "ERROR, setsid returns: %s", strerror(errno));
- exit(1);
- }
-
- /* go away from mounted dir */
-
- chdir("/");
-
- /* move i/o to another device ? */
-
- if(do_fullscreen && do_rdev)
- {
- char *tp;
-
- if((fd = open(rdev, O_RDWR, 0)) != -1)
- {
- if(!isatty(fd))
- {
- llog(LL_ERR, "ERROR, device %s is not a tty!", rdev);
- exit(1);
- }
- if((dup2(fd, STDIN_FILENO)) == -1)
- {
- llog(LL_ERR, "ERROR, dup2 stdin: %s", strerror(errno));
- exit(1);
- }
- if((dup2(fd, STDOUT_FILENO)) == -1)
- {
- llog(LL_ERR, "ERROR, dup2 stdout: %s", strerror(errno));
- exit(1);
- }
- if((dup2(fd, STDERR_FILENO)) == -1)
- {
- llog(LL_ERR, "ERROR, dup2 stderr: %s", strerror(errno));
- exit(1);
- }
- }
- else
- {
- llog(LL_ERR, "ERROR, cannot open redirected device: %s", strerror(errno));
- exit(1);
- }
-
- if(fd > 2)
- {
- if((close(fd)) == -1)
- {
- llog(LL_ERR, "ERROR, close in daemonize: %s", strerror(errno));
- exit(1);
- }
- }
-
- /* curses output && fork NEEDS controlling tty */
-
- if((ioctl(STDIN_FILENO, TIOCSCTTY, (char *)NULL)) < 0)
- {
- llog(LL_ERR, "ERROR, cannot setup tty as controlling terminal: %s", strerror(errno));
- exit(1);
- }
-
- /* in case there is no environment ... */
-
- if(((tp = getenv("TERM")) == NULL) || (*tp == '\0'))
- {
- if(do_ttytype == 0)
- {
- llog(LL_ERR, "ERROR, no environment variable TERM found and -t not specified!");
- exit(1);
- }
-
- if((setenv("TERM", ttype, 1)) != 0)
- {
- llog(LL_ERR, "ERROR, setenv TERM=%s failed: %s", ttype, strerror(errno));
- exit(1);
- }
- }
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/rates.c b/usr.sbin/i4b/isdnd/rates.c
deleted file mode 100644
index 5843f2c..0000000
--- a/usr.sbin/i4b/isdnd/rates.c
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- * Copyright (c) 1997 Gary Jennejohn. All rights reserved.
- *
- * Copyright (c) 1997, 1999 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 daemon - charging rates description file handling
- * -----------------------------------------------------
- *
- * $Id: rates.c,v 1.11 2000/10/09 12:53:29 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:10:09 2006]
- *
- *---------------------------------------------------------------------------*/
-
-static char error[256];
-
-static int getrate(int rate_type);
-
-#ifdef PARSE_DEBUG_MAIN
-
-#include <stdio.h>
-
-#define MAIN
-
-#define ERROR (-1)
-
-extern int got_rate;
-
-int main( int argc, char **argv )
-{
- int ret;
- ret = readrates("/etc/isdn/isdnd.rates");
- if(ret == ERROR)
- fprintf(stderr, "readrates returns [%d], [%s]\n", ret, error);
- else
- {
- int type = 0;
-
- got_rate = 1;
-
- fprintf(stderr, "readrates returns [%d]\n", ret);
-
- for( type=0; type<4; type++ )
- {
- int unit = getrate( type );
- fprintf(stderr, "getrate(%d) => %d\n", type, unit );
- }
- }
-
- return(ret);
-}
-
-#endif
-
-#include "isdnd.h"
-
-/*---------------------------------------------------------------------------*
- * parse rates file
- *---------------------------------------------------------------------------*/
-int
-readrates(char *filename)
-{
- char buffer[MAXPATHLEN];
- register char *bp;
- struct rates *rt, *ort;
- int rateindx;
- int indx;
- int line = 0;
- FILE *fp;
- int first;
-#if DEBUG
- int i, j;
-#endif
-
- indx = 0;
- rt = ort = NULL;
-
- if((fp = fopen(filename, "r")) == NULL)
- {
- snprintf(error, sizeof(error), "error open %s: %s", filename, sys_errlist[errno]);
- rate_error = error;
- return(WARNING);
- }
-
- while((fgets(buffer, MAXPATHLEN, fp)) != NULL)
- {
- line++;
-
-/* comments */
- if(buffer[0] == '#' || buffer[0] == ' ' ||
- buffer[0] == '\t' || buffer[0] == '\n')
- {
- continue;
- }
-
- bp = &buffer[0];
-
- /* rate type */
-
- if (*bp == 'r' && *(bp+1) == 'a' && isdigit(*(bp+2)))
- {
- rateindx = *(bp+2) - '0';
- bp += 3;
-
- /* eat space delimiter */
-
- while(isspace(*bp))
- bp++;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: invalid rate type %c%c%c in line %d", *bp, *(bp+1), *(bp+2), line);
- goto rate_error;
- }
- if (rateindx >= NRATES)
- {
- snprintf(error, sizeof(error), "rates: invalid rate index %d in line %d", rateindx, line);
- goto rate_error;
- }
-
- /* day */
-
- if(isdigit(*bp) && *bp >= '0' && *bp <= '6')
- {
- indx = *bp - '0';
-
- DBGL(DL_RATES, (llog(LL_DBG, "rates: index = %d", indx)));
- }
- else
- {
- snprintf(error, sizeof(error), "rates: invalid day digit %c in line %d", *bp, line);
- goto rate_error;
- }
-
- if(rates[rateindx][indx] == NULL)
- {
- rt = (struct rates *)malloc(sizeof (struct rates));
- if (rt == NULL)
- {
- snprintf(error, sizeof(error), "rates: cannot malloc space for rate structure");
- goto rate_error;
- }
- rt->next = NULL;
- rates[rateindx][indx] = rt;
- }
-
- bp++;
-
- /* eat space delimiter */
-
- while(isspace(*bp))
- bp++;
-
- /* now loop to get the rates entries */
-
- first = 1;
-
- while(*bp && isdigit(*bp))
- {
- int hour = 0;
- int min = 0;
-
- if(first)
- {
- first = 0;
- }
- else
- {
- ort = rt;
-
- rt = (struct rates *)malloc(sizeof (struct rates));
- if (rt == NULL)
- {
- snprintf(error, sizeof(error), "rates: cannot malloc space2 for rate structure");
- goto rate_error;
- }
- ort->next = rt;
- rt->next = NULL;
- }
-
- /* start hour */
-
- if(isdigit(*bp) && isdigit(*(bp+1)))
- {
- hour = atoi(bp);
- bp += 2;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: start_hr error in line %d", line);
- goto rate_error;
- }
-
- /* point */
-
- if(*bp == '.')
- {
- bp++;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: no '.' after start_hr in line %d", line);
- goto rate_error;
- }
-
- /* start minute */
-
- if(isdigit(*bp) && isdigit(*(bp+1)))
- {
- min = atoi(bp);
- bp += 2;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: start_min error in line %d", line);
- goto rate_error;
- }
-
- rt->start_time = hour*60 + min;
-
- /* minus */
-
- if(*bp == '-')
- {
- bp++;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: no '-' after start_min in line %d", line);
- goto rate_error;
- }
-
- /* end hour */
-
- if(isdigit(*bp) && isdigit(*(bp+1)))
- {
- hour = atoi(bp);
- bp += 2;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: end_hr error in line %d", line);
- goto rate_error;
- }
-
- /* point */
-
- if(*bp == '.')
- {
- bp++;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: no '.' after end_hr in line %d", line);
- goto rate_error;
- }
-
- /* end minute */
-
- if(isdigit(*bp) && isdigit(*(bp+1)))
- {
- min = atoi(bp);
- bp += 2;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: end_min error in line %d", line);
- goto rate_error;
- }
-
- /* if hour is 0 assume it means midnight */
- if( hour == 0 )
- hour = 24;
- rt->end_time = hour * 60 + min;
-
- if( rt->end_time <= rt->start_time )
- {
- snprintf(error, sizeof(error), "rates: end_time must be greater then start_time %d", line);
- goto rate_error;
- }
-
- /* colon */
-
- if(*bp == ':')
- {
- bp++;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: no ':' after end_min in line %d", line);
- goto rate_error;
- }
-
- /* time */
-
- if(isdigit(*bp))
- {
- rt->rate = atoi(bp);
- while(!isspace(*bp))
- bp++;
- }
- else
- {
- snprintf(error, sizeof(error), "rates: first rate digit error in line %d", line);
- goto rate_error;
- }
-
- /* eat space delimiter */
-
- while(isspace(*bp))
- bp++;
- }
- }
-
-#if DEBUG
- if(debug_flags & DL_RATES)
- {
- for (j = 0; j < NRATES; j++)
- {
- for (i = 0; i < NDAYS; i++)
- {
- if (rates [j][i] != NULL)
- {
- rt = rates [j][i];
- for (; rt; rt = rt->next)
- {
- llog(LL_DBG, "rates: index %d day %d = %d.%2.2d-%d.%2.2d:%d",
- j, i, rt->start_time/60, rt->start_time%60,
- rt->end_time/60,rt->end_time%60,rt->rate);
- }
- }
- else
- {
- llog(LL_DBG, "rates: NO entry for day %d !!\n", i);
- }
- }
- }
- }
-#endif
- fclose(fp);
- return(GOOD);
-
-rate_error:
- fclose(fp);
- rate_error = error;
- return(ERROR);
-}
-
-#ifndef PARSE_DEBUG_MAIN
-
-/*---------------------------------------------------------------------------*
- * get unit length time from configured source
- *---------------------------------------------------------------------------*/
-int
-get_current_rate(cfg_entry_t *cep, int logit)
-{
- int rt;
-
- switch(cep->unitlengthsrc)
- {
- case ULSRC_CMDL: /* specified on commandline */
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (cmdl)",
- cep->cdid, cep->name, unit_length);
- return(unit_length);
- break;
-
- case ULSRC_CONF: /* get it from config file */
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (conf)",
- cep->cdid, cep->name, cep->unitlength);
- return(cep->unitlength);
-
- case ULSRC_RATE: /* get it dynamic from ratesfile*/
- if(!got_rate) /* got valid rates struct ?? */
- {
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (no ratefile)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
- return(UNITLENGTH_DEFAULT);
- }
- if((cep->ratetype >= NRATES) ||
- (cep->ratetype == INVALID_RATE))
- {
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (rate out of range)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
- return(UNITLENGTH_DEFAULT);
- }
-
- if((rt = getrate(cep->ratetype)) != -1)
- {
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (rate)",
- cep->cdid, cep->name, rt);
- return(rt);
- }
-
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (ratescan fail)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
-
- return(UNITLENGTH_DEFAULT);
- break;
-
- case ULSRC_DYN: /* dynamically calculated from AOC */
- if((rt = getrate(cep->ratetype)) != -1)
- {
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (aocd, rate)",
- cep->cdid, cep->name, rt);
- return(rt);
- }
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (aocd, default)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
-
- return(UNITLENGTH_DEFAULT);
- break;
-
- default:
- if(logit)
- llog(LL_CHD, "%05d %s rate %d sec/unit (unitlen unknown)",
- cep->cdid, cep->name, UNITLENGTH_DEFAULT);
-
- return(UNITLENGTH_DEFAULT);
- break;
- }
-}
-#endif /* PARSE_DEBUG_MAIN */
-
-
-/*---------------------------------------------------------------------------*
- * get the currently active rate
- *---------------------------------------------------------------------------*/
-static int
-getrate(int rate_type )
-{
- struct tm *ptr;
- time_t now;
- register struct rates *hd;
- int time_now;
-
- if((!got_rate) ||
- (rate_type >= NRATES) ||
- (rate_type == INVALID_RATE))
- {
- return -1;
- }
-
- time(&now); /* get current time */
-
- ptr = localtime(&now);
-
- time_now = ptr->tm_hour*60 + ptr->tm_min;
-
- /* walk thru the rates for weekday until rate for current time found */
-
- for (hd = rates[rate_type][ptr->tm_wday]; hd; hd = hd->next)
- {
- /* current time within window ? */
- if((time_now >= hd->start_time ) &&
- (time_now < hd->end_time ))
- {
- DBGL(DL_RATES, (llog(LL_DBG, "rate=%d sec/unit (day=%d, beg=%d:%2.2d, end=%d:2.2d, current=%d:%2.2d)",
- hd->rate,
- ptr->tm_wday,
- hd->start_time/60, hd->start_time%60,
- hd->end_time/60, hd->end_time%60,
- time_now/60, time_now%60)));
-
- return hd->rate;
- }
- }
- return -1;
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/rc_config.c b/usr.sbin/i4b/isdnd/rc_config.c
deleted file mode 100644
index 6f84e21..0000000
--- a/usr.sbin/i4b/isdnd/rc_config.c
+++ /dev/null
@@ -1,1865 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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 daemon - config file processing
- * -----------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:11:48 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <sys/ioctl.h>
-
-#include <net/if.h>
-
-#include "isdnd.h"
-#include "y.tab.h"
-
-#include "monitor.h"
-
-extern int entrycount;
-extern int controllercount;
-extern int lineno;
-extern char *yytext;
-
-extern FILE *yyin;
-extern int yyparse();
-
-static void set_config_defaults(void);
-static void check_config(void);
-static void print_config(void);
-static void parse_valid(int entrycount, char *dt);
-
-static int nregexpr = 0;
-static int nregprog = 0;
-
-/*---------------------------------------------------------------------------*
- * called from main to read and process config file
- *---------------------------------------------------------------------------*/
-void
-configure(char *filename, int reread)
-{
- extern void reset_scanner(FILE *inputfile);
-
- set_config_defaults();
-
- yyin = fopen(filename, "r");
-
- if(yyin == NULL)
- {
- llog(LL_ERR, "cannot fopen file [%s]", filename);
- exit(1);
- }
-
- if(reread)
- {
- reset_scanner(yyin);
- }
-
- yyparse();
-
- monitor_fixup_rights();
-
- check_config(); /* validation and consistency check */
-
- fclose(yyin);
-
- if(do_print)
- {
- if(config_error_flag)
- {
- llog(LL_ERR, "there were %d error(s) in the configuration file, terminating!", config_error_flag);
- exit(1);
- }
- print_config();
- do_exit(0);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * yacc error routine
- *---------------------------------------------------------------------------*/
-void
-yyerror(const char *msg)
-{
- llog(LL_ERR, "configuration error: %s at line %d, token \"%s\"", msg, lineno+1, yytext);
- config_error_flag++;
-}
-
-/*---------------------------------------------------------------------------*
- * fill all config entries with default values
- *---------------------------------------------------------------------------*/
-static void
-set_config_defaults(void)
-{
- cfg_entry_t *cep = &cfg_entry_tab[0]; /* ptr to config entry */
- int i;
-
- /* system section cleanup */
-
- nregprog = nregexpr = 0;
-
- rt_prio = RTPRIO_NOTUSED;
-
- mailer[0] = '\0';
- mailto[0] = '\0';
-
- /* clean regular expression table */
-
- for(i=0; i < MAX_RE; i++)
- {
- if(rarr[i].re_expr)
- free(rarr[i].re_expr);
- rarr[i].re_expr = NULL;
-
- if(rarr[i].re_prog)
- free(rarr[i].re_prog);
- rarr[i].re_prog = NULL;
-
- rarr[i].re_flg = 0;
- }
-
- strcpy(rotatesuffix, "");
-
- /*
- * controller table cleanup, beware: has already
- * been setup in main, init_controller() !
- */
-
- for(i=0; i < ncontroller; i++)
- {
- isdn_ctrl_tab[i].protocol = PROTOCOL_DSS1;
- isdn_ctrl_tab[i].firmware = NULL;
- }
-
- /* entry section cleanup */
-
- for(i=0; i < CFG_ENTRY_MAX; i++, cep++)
- {
- bzero(cep, sizeof(cfg_entry_t));
-
- /* ====== filled in at startup configuration, then static */
-
- sprintf(cep->name, "ENTRY%d", i);
-
- cep->isdncontroller = INVALID;
- cep->isdnchannel = CHAN_ANY;
-
- cep->usrdevicename = INVALID;
- cep->usrdeviceunit = INVALID;
-
- cep->remote_numbers_handling = RNH_LAST;
-
- cep->dialin_reaction = REACT_IGNORE;
-
- cep->b1protocol = BPROT_NONE;
-
- cep->unitlength = UNITLENGTH_DEFAULT;
-
- cep->earlyhangup = EARLYHANGUP_DEFAULT;
-
- cep->ratetype = INVALID_RATE;
-
- cep->unitlengthsrc = ULSRC_NONE;
-
- cep->answerprog = ANSWERPROG_DEF;
-
- cep->callbackwait = CALLBACKWAIT_MIN;
-
- cep->calledbackwait = CALLEDBACKWAIT_MIN;
-
- cep->dialretries = DIALRETRIES_DEF;
-
- cep->recoverytime = RECOVERYTIME_MIN;
-
- cep->dialouttype = DIALOUT_NORMAL;
-
- cep->inout = DIR_INOUT;
-
- cep->ppp_expect_auth = AUTH_UNDEF;
-
- cep->ppp_send_auth = AUTH_UNDEF;
-
- cep->ppp_auth_flags = AUTH_RECHALLENGE | AUTH_REQUIRED;
-
- /* ======== filled in after start, then dynamic */
-
- cep->cdid = CDID_UNUSED;
-
- cep->state = ST_IDLE;
-
- cep->aoc_valid = AOC_INVALID;
-
- cep->usesubaddr = 0;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * internaly set values for ommitted controler sectin
- *---------------------------------------------------------------------------*/
-void
-cfg_set_controller_default()
-{
- controllercount = 0;
- DBGL(DL_RCCF, (llog(LL_DBG, "[defaults, no controller section] controller %d: protocol = dss1", controllercount)));
- isdn_ctrl_tab[controllercount].protocol = PROTOCOL_DSS1;
-}
-
-#define PPP_PAP 0xc023
-#define PPP_CHAP 0xc223
-
-static void
-set_isppp_auth(int entry)
-{
- cfg_entry_t *cep = &cfg_entry_tab[entry]; /* ptr to config entry */
-
- struct ifreq ifr;
- struct spppreq spr;
- int s;
- int doioctl = 0;
-
- if(cep->usrdevicename != BDRV_ISPPP)
- return;
-
- if(cep->ppp_expect_auth == AUTH_UNDEF
- && cep->ppp_send_auth == AUTH_UNDEF)
- return;
-
- if(cep->ppp_expect_auth == AUTH_NONE
- || cep->ppp_send_auth == AUTH_NONE)
- doioctl = 1;
-
- if ((cep->ppp_expect_auth == AUTH_CHAP
- || cep->ppp_expect_auth == AUTH_PAP)
- && cep->ppp_expect_name[0] != 0
- && cep->ppp_expect_password[0] != 0)
- doioctl = 1;
-
- if ((cep->ppp_send_auth == AUTH_CHAP || cep->ppp_send_auth == AUTH_PAP)
- && cep->ppp_send_name[0] != 0
- && cep->ppp_send_password[0] != 0)
- doioctl = 1;
-
- if(!doioctl)
- return;
-
- snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "isp%d", cep->usrdeviceunit);
-
- /* use a random AF to create the socket */
- if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- llog(LL_ERR, "ERROR opening control socket at line %d!", lineno);
- config_error_flag++;
- return;
- }
- spr.cmd = (int)SPPPIOGDEFS;
- ifr.ifr_data = (caddr_t)&spr;
-
- if (ioctl(s, SIOCGIFGENERIC, &ifr) == -1) {
- llog(LL_ERR, "ERROR fetching active PPP authentication info for %s at line %d!", ifr.ifr_name, lineno);
- close(s);
- config_error_flag++;
- return;
- }
- if (cep->ppp_expect_auth != AUTH_UNDEF)
- {
- if(cep->ppp_expect_auth == AUTH_NONE)
- {
- spr.defs.hisauth.proto = 0;
- }
- else if ((cep->ppp_expect_auth == AUTH_CHAP
- || cep->ppp_expect_auth == AUTH_PAP)
- && cep->ppp_expect_name[0] != 0
- && cep->ppp_expect_password[0] != 0)
- {
- spr.defs.hisauth.proto = cep->ppp_expect_auth == AUTH_PAP ? PPP_PAP : PPP_CHAP;
- strncpy(spr.defs.hisauth.name, cep->ppp_expect_name, AUTHNAMELEN);
- strncpy(spr.defs.hisauth.secret, cep->ppp_expect_password, AUTHKEYLEN);
- }
- }
- if (cep->ppp_send_auth != AUTH_UNDEF)
- {
- if(cep->ppp_send_auth == AUTH_NONE)
- {
- spr.defs.myauth.proto = 0;
- }
- else if ((cep->ppp_send_auth == AUTH_CHAP
- || cep->ppp_send_auth == AUTH_PAP)
- && cep->ppp_send_name[0] != 0
- && cep->ppp_send_password[0] != 0)
- {
- spr.defs.myauth.proto = cep->ppp_send_auth == AUTH_PAP ? PPP_PAP : PPP_CHAP;
- strncpy(spr.defs.myauth.name, cep->ppp_send_name, AUTHNAMELEN);
- strncpy(spr.defs.myauth.secret, cep->ppp_send_password, AUTHKEYLEN);
-
- if(cep->ppp_auth_flags & AUTH_REQUIRED)
- spr.defs.hisauth.flags &= ~AUTHFLAG_NOCALLOUT;
- else
- spr.defs.hisauth.flags |= AUTHFLAG_NOCALLOUT;
-
- if(cep->ppp_auth_flags & AUTH_RECHALLENGE)
- spr.defs.hisauth.flags &= ~AUTHFLAG_NORECHALLENGE;
- else
- spr.defs.hisauth.flags |= AUTHFLAG_NORECHALLENGE;
- }
- }
-
- spr.cmd = (int)SPPPIOSDEFS;
-
- if (ioctl(s, SIOCSIFGENERIC, &ifr) == -1) {
- llog(LL_ERR, "ERROR setting new PPP authentication parameters for %s at line %d!", ifr.ifr_name, lineno);
- config_error_flag++;
- }
- close(s);
-}
-
-/*---------------------------------------------------------------------------*
- * extract values from config and fill table
- *---------------------------------------------------------------------------*/
-void
-cfg_setval(int keyword)
-{
- int i;
-
- switch(keyword)
- {
- case ACCTALL:
- acct_all = yylval.booln;
- DBGL(DL_RCCF, (llog(LL_DBG, "system: acctall = %d", yylval.booln)));
- break;
-
- case ACCTFILE:
- strcpy(acctfile, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: acctfile = %s", yylval.str)));
- break;
-
- case ADDPREFIX:
- addprefix = yylval.booln;
- DBGL(DL_RCCF, (llog(LL_DBG, "system: add-prefix = %d", yylval.booln)));
- break;
-
- case ALERT:
- if(yylval.num < MINALERT)
- {
- yylval.num = MINALERT;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: alert < %d, min = %d", entrycount, MINALERT, yylval.num)));
- }
- else if(yylval.num > MAXALERT)
- {
- yylval.num = MAXALERT;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: alert > %d, min = %d", entrycount, MAXALERT, yylval.num)));
- }
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: alert = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].alert = yylval.num;
- break;
-
- case ALIASING:
- DBGL(DL_RCCF, (llog(LL_DBG, "system: aliasing = %d", yylval.booln)));
- aliasing = yylval.booln;
- break;
-
- case ALIASFNAME:
- strcpy(aliasfile, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: aliasfile = %s", yylval.str)));
- break;
-
- case ANSWERPROG:
- if((cfg_entry_tab[entrycount].answerprog = malloc(strlen(yylval.str)+1)) == NULL)
- {
- llog(LL_ERR, "entry %d: answerstring, malloc failed!", entrycount);
- do_exit(1);
- }
- strcpy(cfg_entry_tab[entrycount].answerprog, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: answerprog = %s", entrycount, yylval.str)));
- break;
-
- case B1PROTOCOL:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: b1protocol = %s", entrycount, yylval.str)));
- if(!(strcmp(yylval.str, "raw")))
- cfg_entry_tab[entrycount].b1protocol = BPROT_NONE;
- else if(!(strcmp(yylval.str, "hdlc")))
- cfg_entry_tab[entrycount].b1protocol = BPROT_RHDLC;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"b1protocol\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case BCAP:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: bcap = %s", entrycount, yylval.str)));
- cfg_entry_tab[entrycount].bcap = BCAP_NONE;
- if(!(strcmp(yylval.str, "dov")))
- cfg_entry_tab[entrycount].bcap = BCAP_DOV;
- break;
-
- case BEEPCONNECT:
- do_bell = yylval.booln;
- DBGL(DL_RCCF, (llog(LL_DBG, "system: beepconnect = %d", yylval.booln)));
- break;
-
- case BUDGETCALLBACKPERIOD:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: budget-callbackperiod = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].budget_callbackperiod = yylval.num;
- break;
-
- case BUDGETCALLBACKNCALLS:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: budget-callbackncalls = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].budget_callbackncalls = yylval.num;
- break;
-
- case BUDGETCALLOUTPERIOD:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: budget-calloutperiod = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].budget_calloutperiod = yylval.num;
- break;
-
- case BUDGETCALLOUTNCALLS:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: budget-calloutncalls = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].budget_calloutncalls = yylval.num;
- break;
-
- case BUDGETCALLBACKSFILEROTATE:
- cfg_entry_tab[entrycount].budget_callbacksfile_rotate = yylval.booln;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: budget-callbacksfile-rotate = %d", entrycount, yylval.booln)));
- break;
-
- case BUDGETCALLBACKSFILE:
- {
- FILE *fp;
- int s, l;
- int n;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: budget-callbacksfile = %s", entrycount, yylval.str)));
- fp = fopen(yylval.str, "r");
- if(fp != NULL)
- {
- if((fscanf(fp, "%d %d %d", (int *)&s, (int *)&l, &n)) != 3)
- {
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: initializing budget-callbacksfile %s", entrycount, yylval.str)));
- fclose(fp);
- fp = fopen(yylval.str, "w");
- if(fp != NULL)
- {
- fprintf(fp, "%d %d %d", (int)time(NULL), (int)time(NULL), 0);
- fclose(fp);
- }
- }
- }
- else
- {
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: creating budget-callbacksfile %s", entrycount, yylval.str)));
- fp = fopen(yylval.str, "w");
- if(fp != NULL)
- {
- fprintf(fp, "%d %d %d", (int)time(NULL), (int)time(NULL), 0);
- fclose(fp);
- }
- }
-
- fp = fopen(yylval.str, "r");
- if(fp != NULL)
- {
- if((fscanf(fp, "%d %d %d", (int *)&s, (int *)&l, &n)) == 3)
- {
- if((cfg_entry_tab[entrycount].budget_callbacks_file = malloc(strlen(yylval.str)+1)) == NULL)
- {
- llog(LL_ERR, "entry %d: budget-callbacksfile, malloc failed!", entrycount);
- do_exit(1);
- }
- strcpy(cfg_entry_tab[entrycount].budget_callbacks_file, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: using callbacksfile %s", entrycount, yylval.str)));
- }
- fclose(fp);
- }
- }
- break;
-
- case BUDGETCALLOUTSFILEROTATE:
- cfg_entry_tab[entrycount].budget_calloutsfile_rotate = yylval.booln;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: budget-calloutsfile-rotate = %d", entrycount, yylval.booln)));
- break;
-
- case BUDGETCALLOUTSFILE:
- {
- FILE *fp;
- int s, l;
- int n;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: budget-calloutsfile = %s", entrycount, yylval.str)));
- fp = fopen(yylval.str, "r");
- if(fp != NULL)
- {
- if((fscanf(fp, "%d %d %d", (int *)&s, (int *)&l, &n)) != 3)
- {
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: initializing budget-calloutsfile %s", entrycount, yylval.str)));
- fclose(fp);
- fp = fopen(yylval.str, "w");
- if(fp != NULL)
- {
- fprintf(fp, "%d %d %d", (int)time(NULL), (int)time(NULL), 0);
- fclose(fp);
- }
- }
- }
- else
- {
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: creating budget-calloutsfile %s", entrycount, yylval.str)));
- fp = fopen(yylval.str, "w");
- if(fp != NULL)
- {
- fprintf(fp, "%d %d %d", (int)time(NULL), (int)time(NULL), 0);
- fclose(fp);
- }
- }
-
- fp = fopen(yylval.str, "r");
- if(fp != NULL)
- {
- if((fscanf(fp, "%d %d %d", (int *)&s, (int *)&l, &n)) == 3)
- {
- if((cfg_entry_tab[entrycount].budget_callouts_file = malloc(strlen(yylval.str)+1)) == NULL)
- {
- llog(LL_ERR, "entry %d: budget-calloutsfile, malloc failed!", entrycount);
- do_exit(1);
- }
- strcpy(cfg_entry_tab[entrycount].budget_callouts_file, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: using calloutsfile %s", entrycount, yylval.str)));
- }
- fclose(fp);
- }
- }
- break;
-
- case CALLBACKWAIT:
- if(yylval.num < CALLBACKWAIT_MIN)
- {
- yylval.num = CALLBACKWAIT_MIN;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: callbackwait < %d, min = %d", entrycount, CALLBACKWAIT_MIN, yylval.num)));
- }
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: callbackwait = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].callbackwait = yylval.num;
- break;
-
- case CALLEDBACKWAIT:
- if(yylval.num < CALLEDBACKWAIT_MIN)
- {
- yylval.num = CALLEDBACKWAIT_MIN;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: calledbackwait < %d, min = %d", entrycount, CALLEDBACKWAIT_MIN, yylval.num)));
- }
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: calledbackwait = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].calledbackwait = yylval.num;
- break;
-
- case CLONE:
- /*
- * clone = <entryname>
- * Loads the entry from the named, existing one.
- * Fields such as name and usrdeviceunit should
- * always be specified after clone as they must be
- * unique.
- *
- * NOTE: all malloc()'d fields must be dup()'d here,
- * we can't have multiple references to same storage.
- */
- for (i = 0; i < entrycount; i++)
- if (!strcmp(cfg_entry_tab[i].name, yylval.str))
- break;
- if (i == entrycount) {
- llog(LL_ERR, "entry %d: clone, unknown entry %s!", entrycount, yylval.str);
- do_exit(1);
- }
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: clone = %s", entrycount, yylval.str)));
-
- memcpy(&cfg_entry_tab[entrycount], &cfg_entry_tab[i],
- sizeof(cfg_entry_tab[0]));
-
- if (cfg_entry_tab[entrycount].answerprog)
- cfg_entry_tab[entrycount].answerprog = strdup(cfg_entry_tab[entrycount].answerprog);
- if (cfg_entry_tab[entrycount].budget_callbacks_file)
- cfg_entry_tab[entrycount].budget_callbacks_file = strdup(cfg_entry_tab[entrycount].budget_callbacks_file);
- if (cfg_entry_tab[entrycount].budget_callouts_file)
- cfg_entry_tab[entrycount].budget_callouts_file = strdup(cfg_entry_tab[entrycount].budget_callouts_file);
- if (cfg_entry_tab[entrycount].connectprog)
- cfg_entry_tab[entrycount].connectprog = strdup(cfg_entry_tab[entrycount].connectprog);
- if (cfg_entry_tab[entrycount].disconnectprog)
- cfg_entry_tab[entrycount].disconnectprog = strdup(cfg_entry_tab[entrycount].disconnectprog);
- break;
-
- case CONNECTPROG:
- if((cfg_entry_tab[entrycount].connectprog = malloc(strlen(yylval.str)+1)) == NULL)
- {
- llog(LL_ERR, "entry %d: connectprog, malloc failed!", entrycount);
- do_exit(1);
- }
- strcpy(cfg_entry_tab[entrycount].connectprog, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: connectprog = %s", entrycount, yylval.str)));
- break;
-
- case DIALOUTTYPE:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: dialouttype = %s", entrycount, yylval.str)));
- if(!(strcmp(yylval.str, "normal")))
- cfg_entry_tab[entrycount].dialouttype = DIALOUT_NORMAL;
- else if(!(strcmp(yylval.str, "calledback")))
- cfg_entry_tab[entrycount].dialouttype = DIALOUT_CALLEDBACK;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"dialout-type\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case DIALRETRIES:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: dialretries = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].dialretries = yylval.num;
- break;
-
- case DIALRANDINCR:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: dialrandincr = %d", entrycount, yylval.booln)));
- cfg_entry_tab[entrycount].dialrandincr = yylval.booln;
- break;
-
- case DIRECTION:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: direction = %s", entrycount, yylval.str)));
-
- if(!(strcmp(yylval.str, "inout")))
- cfg_entry_tab[entrycount].inout = DIR_INOUT;
- else if(!(strcmp(yylval.str, "in")))
- cfg_entry_tab[entrycount].inout = DIR_INONLY;
- else if(!(strcmp(yylval.str, "out")))
- cfg_entry_tab[entrycount].inout = DIR_OUTONLY;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"direction\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case DISCONNECTPROG:
- if((cfg_entry_tab[entrycount].disconnectprog = malloc(strlen(yylval.str)+1)) == NULL)
- {
- llog(LL_ERR, "entry %d: disconnectprog, malloc failed!", entrycount);
- do_exit(1);
- }
- strcpy(cfg_entry_tab[entrycount].disconnectprog, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: disconnectprog = %s", entrycount, yylval.str)));
- break;
-
- case DOWNTRIES:
- if(yylval.num > DOWN_TRIES_MAX)
- yylval.num = DOWN_TRIES_MAX;
- else if(yylval.num < DOWN_TRIES_MIN)
- yylval.num = DOWN_TRIES_MIN;
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: downtries = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].downtries = yylval.num;
- break;
-
- case DOWNTIME:
- if(yylval.num > DOWN_TIME_MAX)
- yylval.num = DOWN_TIME_MAX;
- else if(yylval.num < DOWN_TIME_MIN)
- yylval.num = DOWN_TIME_MIN;
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: downtime = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].downtime = yylval.num;
- break;
-
- case EARLYHANGUP:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: earlyhangup = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].earlyhangup = yylval.num;
- break;
-
- case EXTCALLATTR:
- DBGL(DL_RCCF, (llog(LL_DBG, "system: extcallattr = %d", yylval.booln)));
- extcallattr = yylval.booln;
- break;
-
- case FIRMWARE:
- DBGL(DL_RCCF, (llog(LL_DBG, "controller %d: firmware = %s", controllercount, yylval.str)));
- isdn_ctrl_tab[controllercount].firmware = strdup(yylval.str);
- break;
-
- case HOLIDAYFILE:
- strcpy(holidayfile, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: holidayfile = %s", yylval.str)));
- break;
-
- case IDLE_ALG_OUT:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: idle-algorithm-outgoing = %s", entrycount, yylval.str)));
-
- if(!(strcmp(yylval.str, "fix-unit-size")))
- {
- cfg_entry_tab[entrycount].shorthold_algorithm = SHA_FIXU;
- }
- else if(!(strcmp(yylval.str, "var-unit-size")))
- {
- cfg_entry_tab[entrycount].shorthold_algorithm = SHA_VARU;
- }
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"idle-algorithm-outgoing\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case IDLETIME_IN:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: idle_time_in = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].idle_time_in = yylval.num;
- break;
-
- case IDLETIME_OUT:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: idle_time_out = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].idle_time_out = yylval.num;
- break;
-
- case ISDNCONTROLLER:
- cfg_entry_tab[entrycount].isdncontroller = yylval.num;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: isdncontroller = %d", entrycount, yylval.num)));
- break;
-
- case ISDNCHANNEL:
- if (yylval.num == 0 || yylval.num == -1)
- {
- cfg_entry_tab[entrycount].isdnchannel = CHAN_ANY;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: isdnchannel = any", entrycount)));
- }
- else if (yylval.num > MAX_BCHAN)
- {
- llog(LL_DBG, "entry %d: isdnchannel value out of range", entrycount);
- config_error_flag++;
- }
- else
- {
- cfg_entry_tab[entrycount].isdnchannel = yylval.num-1;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: isdnchannel = B%d", entrycount, yylval.num)));
- }
- break;
-
- case ISDNTIME:
- DBGL(DL_RCCF, (llog(LL_DBG, "system: isdntime = %d", yylval.booln)));
- isdntime = yylval.booln;
- break;
-
- case ISDNTXDELIN:
- cfg_entry_tab[entrycount].isdntxdelin = yylval.num;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: isdntxdel-incoming = %d", entrycount, yylval.num)));
- break;
-
- case ISDNTXDELOUT:
- cfg_entry_tab[entrycount].isdntxdelout = yylval.num;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: isdntxdel-outgoing = %d", entrycount, yylval.num)));
- break;
-
- case LOCAL_PHONE_DIALOUT:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: local_phone_dialout = %s", entrycount, yylval.str)));
- strcpy(cfg_entry_tab[entrycount].local_phone_dialout.number, yylval.str);
- break;
-
- case LOCAL_SUBADDR_DIALOUT:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: local_subaddr_dialout = %s", entrycount, yylval.str)));
- strcpy(cfg_entry_tab[entrycount].local_phone_dialout.subaddr, yylval.str);
- break;
-
- case LOCAL_PHONE_INCOMING:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: local_phone_incoming = %s", entrycount, yylval.str)));
- strcpy(cfg_entry_tab[entrycount].local_phone_incoming.number, yylval.str);
- break;
-
- case LOCAL_SUBADDR_INCOMING:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: local_subaddr_incoming = %s", entrycount, yylval.str)));
- strcpy(cfg_entry_tab[entrycount].local_phone_incoming.subaddr, yylval.str);
- break;
-
- case MAILER:
- strcpy(mailer, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: mailer = %s", yylval.str)));
- break;
-
- case MAILTO:
- strcpy(mailto, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: mailto = %s", yylval.str)));
- break;
-
- case MAXCONNECTTIME:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: maxconnecttime = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].maxconnecttime = yylval.num;
- break;
-
- case MONITORPORT:
- monitorport = yylval.num;
- DBGL(DL_RCCF, (llog(LL_DBG, "system: monitorport = %d", yylval.num)));
- break;
-
- case MONITORSW:
- if (yylval.booln && inhibit_monitor)
- {
- do_monitor = 0;
- DBGL(DL_RCCF, (llog(LL_DBG, "system: monitor-enable overriden by command line flag")));
- }
- else
- {
- do_monitor = yylval.booln;
- DBGL(DL_RCCF, (llog(LL_DBG, "system: monitor-enable = %d", yylval.booln)));
- }
- break;
-
- case NAME:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: name = %s", entrycount, yylval.str)));
- strcpy(cfg_entry_tab[entrycount].name, yylval.str);
- break;
-
- case PPP_AUTH_RECHALLENGE:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ppp-auth-rechallenge = %d", entrycount, yylval.booln)));
- if(yylval.booln)
- cfg_entry_tab[entrycount].ppp_auth_flags |= AUTH_RECHALLENGE;
- else
- cfg_entry_tab[entrycount].ppp_auth_flags &= ~AUTH_RECHALLENGE;
- set_isppp_auth(entrycount);
- break;
-
- case PPP_AUTH_PARANOID:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ppp-auth-paranoid = %d", entrycount, yylval.booln)));
- if(yylval.booln)
- cfg_entry_tab[entrycount].ppp_auth_flags |= AUTH_REQUIRED;
- else
- cfg_entry_tab[entrycount].ppp_auth_flags &= ~AUTH_REQUIRED;
- set_isppp_auth(entrycount);
- break;
-
- case PPP_EXPECT_AUTH:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ppp-expect-auth = %s", entrycount, yylval.str)));
- if(!(strcmp(yylval.str, "none")))
- cfg_entry_tab[entrycount].ppp_expect_auth = AUTH_NONE;
- else if(!(strcmp(yylval.str, "pap")))
- cfg_entry_tab[entrycount].ppp_expect_auth = AUTH_PAP;
- else if(!(strcmp(yylval.str, "chap")))
- cfg_entry_tab[entrycount].ppp_expect_auth = AUTH_CHAP;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"ppp-expect-auth\" at line %d!", lineno);
- config_error_flag++;
- break;
- }
- set_isppp_auth(entrycount);
- break;
-
- case PPP_EXPECT_NAME:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ppp-expect-name = %s", entrycount, yylval.str)));
- strncpy(cfg_entry_tab[entrycount].ppp_expect_name, yylval.str, sizeof(cfg_entry_tab[entrycount].ppp_expect_name) -1);
- set_isppp_auth(entrycount);
- break;
-
- case PPP_EXPECT_PASSWORD:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ppp-expect-password = %s", entrycount, yylval.str)));
- strncpy(cfg_entry_tab[entrycount].ppp_expect_password, yylval.str, sizeof(cfg_entry_tab[entrycount].ppp_expect_password) -1);
- set_isppp_auth(entrycount);
- break;
-
- case PPP_SEND_AUTH:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ppp-send-auth = %s", entrycount, yylval.str)));
- if(!(strcmp(yylval.str, "none")))
- cfg_entry_tab[entrycount].ppp_send_auth = AUTH_NONE;
- else if(!(strcmp(yylval.str, "pap")))
- cfg_entry_tab[entrycount].ppp_send_auth = AUTH_PAP;
- else if(!(strcmp(yylval.str, "chap")))
- cfg_entry_tab[entrycount].ppp_send_auth = AUTH_CHAP;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"ppp-send-auth\" at line %d!", lineno);
- config_error_flag++;
- break;
- }
- set_isppp_auth(entrycount);
- break;
-
- case PPP_SEND_NAME:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ppp-send-name = %s", entrycount, yylval.str)));
- strncpy(cfg_entry_tab[entrycount].ppp_send_name, yylval.str, sizeof(cfg_entry_tab[entrycount].ppp_send_name) -1);
- set_isppp_auth(entrycount);
- break;
-
- case PPP_SEND_PASSWORD:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ppp-send-password = %s", entrycount, yylval.str)));
- strncpy(cfg_entry_tab[entrycount].ppp_send_password, yylval.str, sizeof(cfg_entry_tab[entrycount].ppp_send_password) -1);
- set_isppp_auth(entrycount);
- break;
-
- case PREFIXINTERNATIONAL:
- strncpy(prefixinternational, yylval.str, sizeof(prefixinternational)-1);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: prefix-international = %s", prefixinternational)));
- break;
-
- case PREFIXNATIONAL:
- strncpy(prefixnational, yylval.str, sizeof(prefixnational)-1);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: prefix-national = %s", prefixnational)));
- break;
-
- case PROTOCOL:
- DBGL(DL_RCCF, (llog(LL_DBG, "controller %d: protocol = %s", controllercount, yylval.str)));
- if(!(strcmp(yylval.str, "dss1")))
- isdn_ctrl_tab[controllercount].protocol = PROTOCOL_DSS1;
- else if(!(strcmp(yylval.str, "d64s")))
- isdn_ctrl_tab[controllercount].protocol = PROTOCOL_D64S;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"protocol\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case REACTION:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: dialin_reaction = %s", entrycount, yylval.str)));
- if(!(strcmp(yylval.str, "accept")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_ACCEPT;
- else if(!(strcmp(yylval.str, "reject")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_REJECT;
- else if(!(strcmp(yylval.str, "ignore")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_IGNORE;
- else if(!(strcmp(yylval.str, "answer")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_ANSWER;
- else if(!(strcmp(yylval.str, "callback")))
- cfg_entry_tab[entrycount].dialin_reaction = REACT_CALLBACK;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"dialin_reaction\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case REMOTE_PHONE_DIALOUT:
- if(cfg_entry_tab[entrycount].remote_numbers_count >= MAXRNUMBERS)
- {
- llog(LL_ERR, "ERROR parsing config file: too many remote numbers at line %d!", lineno);
- config_error_flag++;
- break;
- }
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: remote_phone_dialout #%d = %s",
- entrycount, cfg_entry_tab[entrycount].remote_numbers_count, yylval.str)));
-
- strcpy(cfg_entry_tab[entrycount].remote_numbers[cfg_entry_tab[entrycount].remote_numbers_count].number, yylval.str);
- cfg_entry_tab[entrycount].remote_numbers[cfg_entry_tab[entrycount].remote_numbers_count].flag = 0;
-
- cfg_entry_tab[entrycount].remote_numbers_count++;
-
- break;
-
- case REMOTE_SUBADDR_DIALOUT:
- if(cfg_entry_tab[entrycount].remote_subaddr_count >= MAXRNUMBERS)
- {
- llog(LL_ERR, "ERROR parsing config file: too many remote subaddresses at line %d!", lineno);
- config_error_flag++;
- break;
- }
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: remote_subaddr_dialout #%d = %s",
- entrycount, cfg_entry_tab[entrycount].remote_numbers_count, yylval.str)));
-
- strcpy(cfg_entry_tab[entrycount].remote_numbers[cfg_entry_tab[entrycount].remote_numbers_count].subaddr, yylval.str);
-
- break;
-
- case REMOTE_NUMBERS_HANDLING:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: remdial_handling = %s", entrycount, yylval.str)));
- if(!(strcmp(yylval.str, "next")))
- cfg_entry_tab[entrycount].remote_numbers_handling = RNH_NEXT;
- else if(!(strcmp(yylval.str, "last")))
- cfg_entry_tab[entrycount].remote_numbers_handling = RNH_LAST;
- else if(!(strcmp(yylval.str, "first")))
- cfg_entry_tab[entrycount].remote_numbers_handling = RNH_FIRST;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"remdial_handling\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case REMOTE_PHONE_INCOMING:
- {
- int n;
- n = cfg_entry_tab[entrycount].incoming_numbers_count;
- if (n >= MAX_INCOMING)
- {
- llog(LL_ERR, "ERROR parsing config file: too many \"remote_phone_incoming\" entries at line %d!", lineno);
- config_error_flag++;
- break;
- }
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: remote_phone_incoming #%d = %s", entrycount, n, yylval.str)));
- strcpy(cfg_entry_tab[entrycount].remote_phone_incoming[n].number, yylval.str);
- cfg_entry_tab[entrycount].incoming_numbers_count++;
- }
- break;
-
- case REMOTE_SUBADDR_INCOMING:
- {
- int n;
- n = cfg_entry_tab[entrycount].incoming_numbers_count;
- if (n >= MAX_INCOMING)
- {
- llog(LL_ERR, "ERROR parsing config file: too many \"remote_subaddr_incoming\" entries at line %d!", lineno);
- config_error_flag++;
- break;
- }
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: remote_subaddr_incoming #%d = %s", entrycount, n, yylval.str)));
- strcpy(cfg_entry_tab[entrycount].remote_phone_incoming[n].subaddr, yylval.str);
- }
- break;
-
- case RATESFILE:
- strcpy(ratesfile, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: ratesfile = %s", yylval.str)));
- break;
-
- case RATETYPE:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: ratetype = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].ratetype = yylval.num;
- break;
-
- case RECOVERYTIME:
- if(yylval.num < RECOVERYTIME_MIN)
- {
- yylval.num = RECOVERYTIME_MIN;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: recoverytime < %d, min = %d", entrycount, RECOVERYTIME_MIN, yylval.num)));
- }
-
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: recoverytime = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].recoverytime = yylval.num;
- break;
-
- case REGEXPR:
- if(nregexpr >= MAX_RE)
- {
- llog(LL_ERR, "system: regexpr #%d >= MAX_RE", nregexpr);
- config_error_flag++;
- break;
- }
-
- if((i = regcomp(&(rarr[nregexpr].re), yylval.str, REG_EXTENDED|REG_NOSUB)) != 0)
- {
- char buf[256];
- regerror(i, &(rarr[nregexpr].re), buf, sizeof(buf));
- llog(LL_ERR, "system: regcomp error for %s: [%s]", yylval.str, buf);
- config_error_flag++;
- break;
- }
- else
- {
- if((rarr[nregexpr].re_expr = malloc(strlen(yylval.str)+1)) == NULL)
- {
- llog(LL_ERR, "system: regexpr malloc error error for %s", yylval.str);
- config_error_flag++;
- break;
- }
- strcpy(rarr[nregexpr].re_expr, yylval.str);
-
- DBGL(DL_RCCF, (llog(LL_DBG, "system: regexpr %s stored into slot %d", yylval.str, nregexpr)));
-
- if(rarr[nregexpr].re_prog != NULL)
- rarr[nregexpr].re_flg = 1;
-
- nregexpr++;
-
- }
- break;
-
- case REGPROG:
- if(nregprog >= MAX_RE)
- {
- llog(LL_ERR, "system: regprog #%d >= MAX_RE", nregprog);
- config_error_flag++;
- break;
- }
- if((rarr[nregprog].re_prog = malloc(strlen(yylval.str)+1)) == NULL)
- {
- llog(LL_ERR, "system: regprog malloc error error for %s", yylval.str);
- config_error_flag++;
- break;
- }
- strcpy(rarr[nregprog].re_prog, yylval.str);
-
- DBGL(DL_RCCF, (llog(LL_DBG, "system: regprog %s stored into slot %d", yylval.str, nregprog)));
-
- if(rarr[nregprog].re_expr != NULL)
- rarr[nregprog].re_flg = 1;
-
- nregprog++;
- break;
-
- case ROTATESUFFIX:
- strcpy(rotatesuffix, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: rotatesuffix = %s", yylval.str)));
- break;
-
- case RTPRIO:
-#ifdef USE_RTPRIO
- rt_prio = yylval.num;
- if(rt_prio < RTP_PRIO_MIN || rt_prio > RTP_PRIO_MAX)
- {
- config_error_flag++;
- llog(LL_ERR, "system: error, rtprio (%d) out of range!", yylval.num);
- }
- else
- {
- DBGL(DL_RCCF, (llog(LL_DBG, "system: rtprio = %d", yylval.num)));
- }
-#else
- rt_prio = RTPRIO_NOTUSED;
-#endif
- break;
-
- case TINAINITPROG:
- strcpy(tinainitprog, yylval.str);
- DBGL(DL_RCCF, (llog(LL_DBG, "system: tinainitprog = %s", yylval.str)));
- break;
-
- case UNITLENGTH:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: unitlength = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].unitlength = yylval.num;
- break;
-
- case UNITLENGTHSRC:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: unitlengthsrc = %s", entrycount, yylval.str)));
- if(!(strcmp(yylval.str, "none")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_NONE;
- else if(!(strcmp(yylval.str, "cmdl")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_CMDL;
- else if(!(strcmp(yylval.str, "conf")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_CONF;
- else if(!(strcmp(yylval.str, "rate")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_RATE;
- else if(!(strcmp(yylval.str, "aocd")))
- cfg_entry_tab[entrycount].unitlengthsrc = ULSRC_DYN;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"unitlengthsrc\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case USRDEVICENAME:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: usrdevicename = %s", entrycount, yylval.str)));
- if(!strcmp(yylval.str, "rbch"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_RBCH;
- else if(!strcmp(yylval.str, "tel"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_TEL;
- else if(!strcmp(yylval.str, "ipr"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_IPR;
- else if(!strcmp(yylval.str, "isp"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_ISPPP;
-#ifdef __bsdi__
- else if(!strcmp(yylval.str, "ibc"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_IBC;
-#endif
- else if(!strcmp(yylval.str, "ing"))
- cfg_entry_tab[entrycount].usrdevicename = BDRV_ING;
- else
- {
- llog(LL_ERR, "ERROR parsing config file: unknown parameter for keyword \"usrdevicename\" at line %d!", lineno);
- config_error_flag++;
- }
- break;
-
- case USRDEVICEUNIT:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: usrdeviceunit = %d", entrycount, yylval.num)));
- cfg_entry_tab[entrycount].usrdeviceunit = yylval.num;
- break;
-
- case USEACCTFILE:
- useacctfile = yylval.booln;
- DBGL(DL_RCCF, (llog(LL_DBG, "system: useacctfile = %d", yylval.booln)));
- break;
-
- case USESUBADDR:
- cfg_entry_tab[entrycount].usesubaddr = yylval.booln;
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: usesubaddr = %d", entrycount, yylval.booln)));
- break;
-
- case USEDOWN:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: usedown = %d", entrycount, yylval.booln)));
- cfg_entry_tab[entrycount].usedown = yylval.booln;
- break;
-
- case VALID:
- DBGL(DL_RCCF, (llog(LL_DBG, "entry %d: valid = %s", entrycount, yylval.str)));
- parse_valid(entrycount, yylval.str);
- break;
-
- default:
- llog(LL_ERR, "ERROR parsing config file: unknown keyword at line %d!", lineno);
- config_error_flag++;
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * parse a date/time range
- *---------------------------------------------------------------------------*/
-static void
-parse_valid(int entrycount, char *dt)
-{
- /* a valid string consists of some days of week separated by
- * commas, where 0=sunday, 1=monday .. 6=saturday and a special
- * value of 7 which is a holiday from the holiday file.
- * after the days comes an optional (!) time range in the form
- * aa:bb-cc:dd, this format is fixed to be parsable by sscanf.
- * Valid specifications looks like this:
- * 1,2,3,4,5,09:00-18:00 Monday-Friday 9-18h
- * 1,2,3,4,5,18:00-09:00 Monday-Friday 18-9h
- * 6 Saturday (whole day)
- * 0,7 Sunday and Holidays
- */
-
- int day = 0;
- int fromhr = 0;
- int frommin = 0;
- int tohr = 0;
- int tomin = 0;
- int ret;
-
- for(;;)
- {
- if( ( ((*dt >= '0') && (*dt <= '9')) && (*(dt+1) == ':') ) ||
- ( ((*dt >= '0') && (*dt <= '2')) && ((*(dt+1) >= '0') && (*(dt+1) <= '9')) && (*(dt+2) == ':') ) )
- {
- /* dt points to time spec */
- ret = sscanf(dt, "%d:%d-%d:%d", &fromhr, &frommin, &tohr, &tomin);
- if(ret !=4)
- {
- llog(LL_ERR, "ERROR parsing config file: timespec [%s] error at line %d!", *dt, lineno);
- config_error_flag++;
- return;
- }
-
- if(fromhr < 0 || fromhr > 24 || tohr < 0 || tohr > 24 ||
- frommin < 0 || frommin > 59 || tomin < 0 || tomin > 59)
- {
- llog(LL_ERR, "ERROR parsing config file: invalid time [%s] at line %d!", *dt, lineno);
- config_error_flag++;
- return;
- }
- break;
- }
- else if ((*dt >= '0') && (*dt <= '7'))
- {
- /* dt points to day spec */
- day |= 1 << (*dt - '0');
- dt++;
- continue;
- }
- else if (*dt == ',')
- {
- /* dt points to delimiter */
- dt++;
- continue;
- }
- else if (*dt == '\0')
- {
- /* dt points to end of string */
- break;
- }
- else
- {
- /* dt points to illegal character */
- llog(LL_ERR, "ERROR parsing config file: illegal character [%c=0x%x] in date/time spec at line %d!", *dt, *dt, lineno);
- config_error_flag++;
- return;
- }
- }
- cfg_entry_tab[entrycount].day = day;
- cfg_entry_tab[entrycount].fromhr = fromhr;
- cfg_entry_tab[entrycount].frommin = frommin;
- cfg_entry_tab[entrycount].tohr = tohr;
- cfg_entry_tab[entrycount].tomin = tomin;
-}
-
-/*---------------------------------------------------------------------------*
- * configuration validation and consistency check
- *---------------------------------------------------------------------------*/
-static void
-check_config(void)
-{
- cfg_entry_t *cep = &cfg_entry_tab[0]; /* ptr to config entry */
- int i;
- int error = 0;
-
- /* regular expression table */
-
- for(i=0; i < MAX_RE; i++)
- {
- if((rarr[i].re_expr != NULL) && (rarr[i].re_prog == NULL))
- {
- llog(LL_ERR, "check_config: regular expression %d without program!", i);
- error++;
- }
- if((rarr[i].re_prog != NULL) && (rarr[i].re_expr == NULL))
- {
- llog(LL_ERR, "check_config: regular expression program %d without expression!", i);
- error++;
- }
- }
-
- /* entry sections */
-
- for(i=0; i <= entrycount; i++, cep++)
- {
- /* isdn controller number */
-
- if((cep->isdncontroller < -1) || (cep->isdncontroller > (ncontroller-1)))
- {
- llog(LL_ERR, "check_config: WARNING, isdncontroller out of range in entry %d!", i);
- }
-
- /* numbers used for dialout */
-
- if((cep->inout != DIR_INONLY) && (cep->dialin_reaction != REACT_ANSWER))
- {
- if(cep->remote_numbers_count == 0)
- {
- llog(LL_ERR, "check_config: remote-phone-dialout not set in entry %d!", i);
- error++;
- }
- if(strlen(cep->local_phone_dialout.number) == 0)
- {
- llog(LL_ERR, "check_config: local-phone-dialout not set in entry %d!", i);
- error++;
- }
- }
-
- /* numbers used for incoming calls */
-
- if(cep->inout != DIR_OUTONLY)
- {
- if(strlen(cep->local_phone_incoming.number) == 0)
- {
- llog(LL_ERR, "check_config: local-phone-incoming not set in entry %d!", i);
- error++;
- }
- if(cep->incoming_numbers_count == 0)
- {
- llog(LL_ERR, "check_config: remote-phone-incoming not set in entry %d!", i);
- error++;
- }
- }
-
- if((cep->dialin_reaction == REACT_ANSWER) && (cep->b1protocol != BPROT_NONE))
- {
- llog(LL_ERR, "check_config: b1protocol not raw for telephony in entry %d!", i);
- error++;
- }
-
- if((cep->ppp_send_auth == AUTH_PAP) || (cep->ppp_send_auth == AUTH_CHAP))
- {
- if(cep->ppp_send_name[0] == 0)
- {
- llog(LL_ERR, "check_config: no remote authentification name in entry %d!", i);
- error++;
- }
- if(cep->ppp_send_password[0] == 0)
- {
- llog(LL_ERR, "check_config: no remote authentification password in entry %d!", i);
- error++;
- }
- }
- if((cep->ppp_expect_auth == AUTH_PAP) || (cep->ppp_expect_auth == AUTH_CHAP))
- {
- if(cep->ppp_expect_name[0] == 0)
- {
- llog(LL_ERR, "check_config: no local authentification name in entry %d!", i);
- error++;
- }
- if(cep->ppp_expect_password[0] == 0)
- {
- llog(LL_ERR, "check_config: no local authentification secret in entry %d!", i);
- error++;
- }
- }
- }
- if(error)
- {
- llog(LL_ERR, "check_config: %d error(s) in configuration file, exit!", error);
- do_exit(1);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * print the configuration
- *---------------------------------------------------------------------------*/
-static void
-print_config(void)
-{
-#define PFILE stdout
-
-#ifdef I4B_EXTERNAL_MONITOR
- extern struct monitor_rights * monitor_next_rights(const struct monitor_rights *r);
- struct monitor_rights *m_rights;
-#endif
- cfg_entry_t *cep = &cfg_entry_tab[0]; /* ptr to config entry */
- int i, j;
- time_t clock;
- char mytime[64];
-
- time(&clock);
- strcpy(mytime, ctime(&clock));
- mytime[strlen(mytime)-1] = '\0';
-
- fprintf(PFILE, "#---------------------------------------------------------------------------\n");
- fprintf(PFILE, "# system section (generated %s)\n", mytime);
- fprintf(PFILE, "#---------------------------------------------------------------------------\n");
- fprintf(PFILE, "system\n");
- fprintf(PFILE, "useacctfile = %s\n", useacctfile ? "on\t\t\t\t# update accounting information file" : "off\t\t\t\t# don't update accounting information file");
- fprintf(PFILE, "acctall = %s\n", acct_all ? "on\t\t\t\t# put all events into accounting file" : "off\t\t\t\t# put only charged events into accounting file");
- fprintf(PFILE, "acctfile = %s\t\t# accounting information file\n", acctfile);
- fprintf(PFILE, "ratesfile = %s\t\t# charging rates database file\n", ratesfile);
-
-#ifdef USE_RTPRIO
- if(rt_prio == RTPRIO_NOTUSED)
- fprintf(PFILE, "# rtprio is unused\n");
- else
- fprintf(PFILE, "rtprio = %d\t\t\t\t# isdnd runs at realtime priority\n", rt_prio);
-#endif
-
- /* regular expression table */
-
- for(i=0; i < MAX_RE; i++)
- {
- if(rarr[i].re_expr != NULL)
- {
- fprintf(PFILE, "regexpr = \"%s\"\t\t# scan logfile for this expression\n", rarr[i].re_expr);
- }
- if(rarr[i].re_prog != NULL)
- {
- fprintf(PFILE, "regprog = %s\t\t# program to run when expression is matched\n", rarr[i].re_prog);
- }
- }
-
-#ifdef I4B_EXTERNAL_MONITOR
-
- fprintf(PFILE, "monitor-allowed = %s\n", do_monitor ? "on\t\t\t\t# remote isdnd monitoring allowed" : "off\t\t\t\t# remote isdnd monitoring disabled");
- fprintf(PFILE, "monitor-port = %d\t\t\t\t# TCP/IP port number used for remote monitoring\n", monitorport);
-
- m_rights = monitor_next_rights(NULL);
- if(m_rights != NULL)
- {
- char *s = "error\n";
- char b[512];
-
- for ( ; m_rights != NULL; m_rights = monitor_next_rights(m_rights))
- {
- if(m_rights->local)
- {
- fprintf(PFILE, "monitor = \"%s\"\t\t# local socket name for monitoring\n", m_rights->name);
- }
- else
- {
- struct in_addr ia;
- ia.s_addr = ntohl(m_rights->net);
-
- switch(m_rights->mask)
- {
- case 0xffffffff:
- s = "32";
- break;
- case 0xfffffffe:
- s = "31";
- break;
- case 0xfffffffc:
- s = "30";
- break;
- case 0xfffffff8:
- s = "29";
- break;
- case 0xfffffff0:
- s = "28";
- break;
- case 0xffffffe0:
- s = "27";
- break;
- case 0xffffffc0:
- s = "26";
- break;
- case 0xffffff80:
- s = "25";
- break;
- case 0xffffff00:
- s = "24";
- break;
- case 0xfffffe00:
- s = "23";
- break;
- case 0xfffffc00:
- s = "22";
- break;
- case 0xfffff800:
- s = "21";
- break;
- case 0xfffff000:
- s = "20";
- break;
- case 0xffffe000:
- s = "19";
- break;
- case 0xffffc000:
- s = "18";
- break;
- case 0xffff8000:
- s = "17";
- break;
- case 0xffff0000:
- s = "16";
- break;
- case 0xfffe0000:
- s = "15";
- break;
- case 0xfffc0000:
- s = "14";
- break;
- case 0xfff80000:
- s = "13";
- break;
- case 0xfff00000:
- s = "12";
- break;
- case 0xffe00000:
- s = "11";
- break;
- case 0xffc00000:
- s = "10";
- break;
- case 0xff800000:
- s = "9";
- break;
- case 0xff000000:
- s = "8";
- break;
- case 0xfe000000:
- s = "7";
- break;
- case 0xfc000000:
- s = "6";
- break;
- case 0xf8000000:
- s = "5";
- break;
- case 0xf0000000:
- s = "4";
- break;
- case 0xe0000000:
- s = "3";
- break;
- case 0xc0000000:
- s = "2";
- break;
- case 0x80000000:
- s = "1";
- break;
- case 0x00000000:
- s = "0";
- break;
- }
- fprintf(PFILE, "monitor = \"%s/%s\"\t\t# host (net/mask) allowed to connect for monitoring\n", inet_ntoa(ia), s);
- }
- b[0] = '\0';
-
- if((m_rights->rights) & I4B_CA_COMMAND_FULL)
- strcat(b, "fullcmd,");
- if((m_rights->rights) & I4B_CA_COMMAND_RESTRICTED)
- strcat(b, "restrictedcmd,");
- if((m_rights->rights) & I4B_CA_EVNT_CHANSTATE)
- strcat(b, "channelstate,");
- if((m_rights->rights) & I4B_CA_EVNT_CALLIN)
- strcat(b, "callin,");
- if((m_rights->rights) & I4B_CA_EVNT_CALLOUT)
- strcat(b, "callout,");
- if((m_rights->rights) & I4B_CA_EVNT_I4B)
- strcat(b, "logevents,");
-
- if(b[strlen(b)-1] == ',')
- b[strlen(b)-1] = '\0';
-
- fprintf(PFILE, "monitor-access = %s\t\t# monitor access rights\n", b);
- }
- }
-
-#endif
- /* entry sections */
-
- for(i=0; i <= entrycount; i++, cep++)
- {
- fprintf(PFILE, "\n");
- fprintf(PFILE, "#---------------------------------------------------------------------------\n");
- fprintf(PFILE, "# entry section %d\n", i);
- fprintf(PFILE, "#---------------------------------------------------------------------------\n");
- fprintf(PFILE, "entry\n");
-
- fprintf(PFILE, "name = %s\t\t# name for this entry section\n", cep->name);
-
- fprintf(PFILE, "isdncontroller = %d\t\t# ISDN card number used for this entry\n", cep->isdncontroller);
- fprintf(PFILE, "isdnchannel = ");
- switch(cep->isdnchannel)
- {
- case CHAN_ANY:
- fprintf(PFILE, "-1\t\t# any ISDN B-channel may be used\n");
- break;
- default:
- fprintf(PFILE, "%d\t\t# only ISDN B-channel %d may be used\n", cep->isdnchannel+1, cep->isdnchannel+1);
- break;
- }
-
- fprintf(PFILE, "usrdevicename = %s\t\t# name of userland ISDN B-channel device\n", bdrivername(cep->usrdevicename));
- fprintf(PFILE, "usrdeviceunit = %d\t\t# unit number of userland ISDN B-channel device\n", cep->usrdeviceunit);
-
- fprintf(PFILE, "b1protocol = %s\n", cep->b1protocol ? "hdlc\t\t# B-channel layer 1 protocol is HDLC" : "raw\t\t# No B-channel layer 1 protocol used");
-
- if(!(cep->usrdevicename == BDRV_TEL))
- {
- fprintf(PFILE, "direction = ");
- switch(cep->inout)
- {
- case DIR_INONLY:
- fprintf(PFILE, "in\t\t# only incoming connections allowed\n");
- break;
- case DIR_OUTONLY:
- fprintf(PFILE, "out\t\t# only outgoing connections allowed\n");
- break;
- case DIR_INOUT:
- fprintf(PFILE, "inout\t\t# incoming and outgoing connections allowed\n");
- break;
- }
- }
-
- if(!((cep->usrdevicename == BDRV_TEL) || (cep->inout == DIR_INONLY)))
- {
- if(cep->remote_numbers_count > 1)
- {
- for(j=0; j<cep->remote_numbers_count; j++)
- fprintf(PFILE, "remote-phone-dialout = %s\t\t# telephone number %d for dialing out to remote\n", cep->remote_numbers[j].number, j+1);
-
- fprintf(PFILE, "remdial-handling = ");
-
- switch(cep->remote_numbers_handling)
- {
- case RNH_NEXT:
- fprintf(PFILE, "next\t\t# use next number after last successfull for new dial\n");
- break;
- case RNH_LAST:
- fprintf(PFILE, "last\t\t# use last successfull number for new dial\n");
- break;
- case RNH_FIRST:
- fprintf(PFILE, "first\t\t# always start with first number for new dial\n");
- break;
- }
- }
- else
- {
- fprintf(PFILE, "remote-phone-dialout = %s\t\t# telephone number for dialing out to remote\n", cep->remote_numbers[0].number);
- }
-
- fprintf(PFILE, "local-phone-dialout = %s\t\t# show this number to remote when dialling out\n", cep->local_phone_dialout.number);
- fprintf(PFILE, "dialout-type = %s\n", cep->dialouttype ? "calledback\t\t# i am called back by remote" : "normal\t\t# i am not called back by remote");
- }
-
- if(!(cep->inout == DIR_OUTONLY))
- {
- int n;
-
- fprintf(PFILE, "local-phone-incoming = %s\t\t# incoming calls must match this (mine) telephone number\n", cep->local_phone_incoming.number);
- for (n = 0; n < cep->incoming_numbers_count; n++)
- fprintf(PFILE, "remote-phone-incoming = %s\t\t# this is a valid remote number to call me\n",
- cep->remote_phone_incoming[n].number);
-
- fprintf(PFILE, "dialin-reaction = ");
- switch(cep->dialin_reaction)
- {
- case REACT_ACCEPT:
- fprintf(PFILE, "accept\t\t# i accept a call from remote and connect\n");
- break;
- case REACT_REJECT:
- fprintf(PFILE, "reject\t\t# i reject the call from remote\n");
- break;
- case REACT_IGNORE:
- fprintf(PFILE, "ignore\t\t# i ignore the call from remote\n");
- break;
- case REACT_ANSWER:
- fprintf(PFILE, "answer\t\t# i will start telephone answering when remote calls in\n");
- break;
- case REACT_CALLBACK:
- fprintf(PFILE, "callback\t\t# when remote calls in, i will hangup and call back\n");
- break;
- }
- }
-
- if(cep->usrdevicename == BDRV_ISPPP)
- {
- char *s;
- switch(cep->ppp_expect_auth)
- {
- case AUTH_NONE:
- s = "none";
- break;
- case AUTH_PAP:
- s = "pap";
- break;
- case AUTH_CHAP:
- s = "chap";
- break;
- default:
- s = NULL;
- break;
- }
- if(s != NULL)
- {
- fprintf(PFILE, "ppp-expect-auth = %s\t\t# the auth protocol we expect to receive on dial-in (none,pap,chap)\n", s);
- if(cep->ppp_expect_auth != AUTH_NONE)
- {
- fprintf(PFILE, "ppp-expect-name = %s\t\t# the user name allowed in\n", cep->ppp_expect_name);
- fprintf(PFILE, "ppp-expect-password = %s\t\t# the key expected from the other side\n", cep->ppp_expect_password);
- fprintf(PFILE, "ppp-auth-paranoid = %s\t\t# do we require remote to authenticate even if we dial out\n", cep->ppp_auth_flags & AUTH_REQUIRED ? "yes" : "no");
- }
- }
- switch(cep->ppp_send_auth)
- {
- case AUTH_NONE:
- s = "none";
- break;
- case AUTH_PAP:
- s = "pap";
- break;
- case AUTH_CHAP:
- s = "chap";
- break;
- default:
- s = NULL;
- break;
- }
- if(s != NULL)
- {
- fprintf(PFILE, "ppp-send-auth = %s\t\t# the auth protocol we use when dialing out (none,pap,chap)\n", s);
- if(cep->ppp_send_auth != AUTH_NONE)
- {
- fprintf(PFILE, "ppp-send-name = %s\t\t# our PPP account used for dial-out\n", cep->ppp_send_name);
- fprintf(PFILE, "ppp-send-password = %s\t\t# the key sent to the other side\n", cep->ppp_send_password);
- }
- }
- if(cep->ppp_send_auth == AUTH_CHAP ||
- cep->ppp_expect_auth == AUTH_CHAP) {
- fprintf(PFILE, "ppp-auth-rechallenge = %s\t\t# rechallenge CHAP connections once in a while\n", cep->ppp_auth_flags & AUTH_RECHALLENGE ? "yes" : "no");
- }
- }
-
- if(!((cep->inout == DIR_INONLY) || (cep->usrdevicename == BDRV_TEL)))
- {
- char *s;
- fprintf(PFILE, "idletime-outgoing = %d\t\t# outgoing call idle timeout\n", cep->idle_time_out);
-
- switch( cep->shorthold_algorithm )
- {
- case SHA_FIXU:
- s = "fix-unit-size";
- break;
- case SHA_VARU:
- s = "var-unit-size";
- break;
- default:
- s = "error!!!";
- break;
- }
-
- fprintf(PFILE, "idle-algorithm-outgoing = %s\t\t# outgoing call idle algorithm\n", s);
- }
-
- if(!(cep->inout == DIR_OUTONLY))
- fprintf(PFILE, "idletime-incoming = %d\t\t# incoming call idle timeout\n", cep->idle_time_in);
-
- if(!(cep->usrdevicename == BDRV_TEL))
- {
- fprintf(PFILE, "unitlengthsrc = ");
- switch(cep->unitlengthsrc)
- {
- case ULSRC_NONE:
- fprintf(PFILE, "none\t\t# no unit length specified, using default\n");
- break;
- case ULSRC_CMDL:
- fprintf(PFILE, "cmdl\t\t# using unit length specified on commandline\n");
- break;
- case ULSRC_CONF:
- fprintf(PFILE, "conf\t\t# using unitlength specified by unitlength-keyword\n");
- fprintf(PFILE, "unitlength = %d\t\t# fixed unitlength\n", cep->unitlength);
- break;
- case ULSRC_RATE:
- fprintf(PFILE, "rate\t\t# using unitlength specified in rate database\n");
- fprintf(PFILE, "ratetype = %d\t\t# type of rate from rate database\n", cep->ratetype);
- break;
- case ULSRC_DYN:
- fprintf(PFILE, "aocd\t\t# using dynamically calculated unitlength based on AOCD subscription\n");
- fprintf(PFILE, "ratetype = %d\t\t# type of rate from rate database\n", cep->ratetype);
- break;
- }
-
- fprintf(PFILE, "earlyhangup = %d\t\t# early hangup safety time\n", cep->earlyhangup);
-
- }
-
- if(cep->usrdevicename == BDRV_TEL)
- {
- fprintf(PFILE, "answerprog = %s\t\t# program used to answer incoming telephone calls\n", cep->answerprog);
- fprintf(PFILE, "alert = %d\t\t# number of seconds to wait before accepting a call\n", cep->alert);
- }
-
- if(!(cep->usrdevicename == BDRV_TEL))
- {
- if(cep->dialin_reaction == REACT_CALLBACK)
- fprintf(PFILE, "callbackwait = %d\t\t# i am waiting this time before calling back remote\n", cep->callbackwait);
-
- if(cep->dialouttype == DIALOUT_CALLEDBACK)
- fprintf(PFILE, "calledbackwait = %d\t\t# i am waiting this time for a call back from remote\n", cep->calledbackwait);
-
- if(!(cep->inout == DIR_INONLY))
- {
- fprintf(PFILE, "dialretries = %d\t\t# number of dialing retries\n", cep->dialretries);
- fprintf(PFILE, "recoverytime = %d\t\t# time to wait between dialling retries\n", cep->recoverytime);
- fprintf(PFILE, "dialrandincr = %s\t\t# use random dialing time addon\n", cep->dialrandincr ? "on" : "off");
-
- fprintf(PFILE, "usedown = %s\n", cep->usedown ? "on\t\t# ISDN device switched off on excessive dial failures" : "off\t\t# no device switchoff on excessive dial failures");
- if(cep->usedown)
- {
- fprintf(PFILE, "downtries = %d\t\t# number of dialretries failures before switching off\n", cep->downtries);
- fprintf(PFILE, "downtime = %d\t\t# time device is switched off\n", cep->downtime);
- }
- }
- }
- }
- fprintf(PFILE, "\n");
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/rc_parse.y b/usr.sbin/i4b/isdnd/rc_parse.y
deleted file mode 100644
index 6427500..0000000
--- a/usr.sbin/i4b/isdnd/rc_parse.y
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
- *
- * Copyright (c) 1997, 2002 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 daemon - runtime configuration parser
- * -----------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Aug 11 12:27:28 2002]
- *
- *---------------------------------------------------------------------------*/
-
-%{
-
-/* #define YYDEBUG 1 */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "monitor.h" /* monitor access rights bit definitions */
-#include "isdnd.h"
-
-#ifndef FALSE
-# define FALSE 0
-#endif
-
-#ifndef TRUE
-# define TRUE 1
-#endif
-
-extern void cfg_setval(int keyword);
-extern void cfg_set_controller_default();
-extern void reset_scanner(FILE *infile);
-extern void yyerror(const char *msg);
-extern int yylex();
-
-extern int lineno;
-extern char *yytext;
-extern int nentries;
-
-int saw_system = 0;
-int entrycount = -1;
-int controllercount = -1;
-
-%}
-
-%token ACCTALL
-%token ACCTFILE
-%token ADDPREFIX
-%token ALERT
-%token ALIASFNAME
-%token ALIASING
-%token ANSWERPROG
-%token B1PROTOCOL
-%token BEEPCONNECT
-%token BCAP
-%token BUDGETCALLOUTPERIOD
-%token BUDGETCALLOUTNCALLS
-%token BUDGETCALLOUTSFILE
-%token BUDGETCALLOUTSFILEROTATE
-%token BUDGETCALLBACKPERIOD
-%token BUDGETCALLBACKNCALLS
-%token BUDGETCALLBACKSFILE
-%token BUDGETCALLBACKSFILEROTATE
-%token CALLBACKWAIT
-%token CALLEDBACKWAIT
-%token CALLIN
-%token CALLOUT
-%token CHANNELSTATE
-%token CLONE
-%token CONNECTPROG
-%token CONTROLLER
-%token DIALOUTTYPE
-%token DIALRANDINCR
-%token DIALRETRIES
-%token DIRECTION
-%token DISCONNECTPROG
-%token DOWNTIME
-%token DOWNTRIES
-%token EARLYHANGUP
-%token ENTRY
-%token EXTCALLATTR
-%token FIRMWARE
-%token FULLCMD
-%token HOLIDAYFILE
-%token IDLETIME_IN
-%token IDLETIME_OUT
-%token IDLE_ALG_OUT
-%token ISDNCHANNEL
-%token ISDNCONTROLLER
-%token ISDNTIME
-%token ISDNTXDELIN
-%token ISDNTXDELOUT
-%token LOCAL_PHONE_DIALOUT
-%token LOCAL_SUBADDR_DIALOUT
-%token LOCAL_PHONE_INCOMING
-%token LOCAL_SUBADDR_INCOMING
-%token LOGEVENTS
-%token MAILER
-%token MAILTO
-%token MAXCONNECTTIME
-%token MONITOR
-%token MONITORACCESS
-%token MONITORPORT
-%token MONITORSW
-%token NAME
-%token NO
-%token OFF
-%token ON
-%token PPP_AUTH_RECHALLENGE
-%token PPP_AUTH_PARANOID
-%token PPP_EXPECT_AUTH
-%token PPP_EXPECT_NAME
-%token PPP_EXPECT_PASSWORD
-%token PPP_SEND_AUTH
-%token PPP_SEND_NAME
-%token PPP_SEND_PASSWORD
-%token PREFIXNATIONAL
-%token PREFIXINTERNATIONAL
-%token PROTOCOL
-%token RATESFILE
-%token RATETYPE
-%token REACTION
-%token RECOVERYTIME
-%token REGEXPR
-%token REGPROG
-%token REMOTE_NUMBERS_HANDLING
-%token REMOTE_PHONE_DIALOUT
-%token REMOTE_SUBADDR_DIALOUT
-%token REMOTE_PHONE_INCOMING
-%token REMOTE_SUBADDR_INCOMING
-%token RESTRICTEDCMD
-%token ROTATESUFFIX
-%token RTPRIO
-%token SYSTEM
-%token TINAINITPROG
-%token UNITLENGTH
-%token UNITLENGTHSRC
-%token USEACCTFILE
-%token USESUBADDR
-%token USEDOWN
-%token USRDEVICENAME
-%token USRDEVICEUNIT
-%token VALID
-%token YES
-
-
-%token <str> NUMBERSTR
-
-%token <str> STRING
-
-%type <booln> boolean
-
-%type <num> sysfilekeyword sysnumkeyword sysstrkeyword sysboolkeyword
-%type <num> filekeyword numkeyword strkeyword boolkeyword monrights monright
-%type <num> cstrkeyword cfilekeyword
-%type <str> filename
-
-%union {
- int booln;
- int num;
- char *str;
-}
-
-%%
-
-config: sections
- ;
-
-sections: possible_nullentries
- syssect
- optcontrollersects
- entrysects
- ;
-
-possible_nullentries:
- /* lambda */
- | possible_nullentries error '\n'
- | possible_nullentries nullentry
- ;
-
-nullentry: '\n'
- ;
-
-entrysects: entrysect
- | entrysects entrysect
- ;
-
-optcontrollersects:
- controllersects
- |
- {
- cfg_set_controller_default();
- }
- ;
-
-controllersects: controllersect
- | controllersects controllersect
- ;
-
-/* ============== */
-/* system section */
-/* ============== */
-
-syssect: SYSTEM sysentries
- ;
-
-sysentries: sysentry
- {
- saw_system = 1;
- monitor_clear_rights();
- }
- | sysentries sysentry
- ;
-
-sysentry: sysfileentry
- | sysboolentry
- | sysnumentry
- | sysstrentry
- | sysmonitorstart
- | sysmonitorrights
- | nullentry
- | error '\n'
- ;
-
-
-sysmonitorstart:
- MONITOR '=' STRING '\n'
- {
- char *err = NULL;
- switch (monitor_start_rights($3)) {
- case I4BMAR_OK:
- break;
- case I4BMAR_LENGTH:
- err = "local socket name too long: %s";
- break;
- case I4BMAR_DUP:
- err = "duplicate entry: %s";
- break;
- case I4BMAR_CIDR:
- err = "invalid CIDR specification: %s";
- break;
- case I4BMAR_NOIP:
- err = "could not resolve host or net specification: %s";
- break;
- }
- if (err) {
- char msg[1024];
- snprintf(msg, sizeof msg, err, $3);
- yyerror(msg);
- }
- }
- ;
-
-sysmonitorrights:
- MONITORACCESS '=' monrights '\n'
- { monitor_add_rights($3); }
- ;
-
-monrights: monrights ',' monright { $$ = $1 | $3; }
- | monright { $$ = $1; }
- ;
-
-monright: FULLCMD { $$ = I4B_CA_COMMAND_FULL; }
- | RESTRICTEDCMD { $$ = I4B_CA_COMMAND_RESTRICTED; }
- | CHANNELSTATE { $$ = I4B_CA_EVNT_CHANSTATE; }
- | CALLIN { $$ = I4B_CA_EVNT_CALLIN; }
- | CALLOUT { $$ = I4B_CA_EVNT_CALLOUT; }
- | LOGEVENTS { $$ = I4B_CA_EVNT_I4B; }
- ;
-
-sysfileentry: sysfilekeyword '=' filename '\n'
- {
- cfg_setval($1);
- }
- ;
-
-sysboolentry: sysboolkeyword '=' boolean '\n'
- {
- yylval.booln = $3;
- cfg_setval($1);
- }
- ;
-
-sysnumentry: sysnumkeyword '=' NUMBERSTR '\n'
- {
- yylval.num = atoi($3);
- cfg_setval($1);
- }
- ;
-
-sysstrentry: sysstrkeyword '=' STRING '\n'
- {
- cfg_setval($1);
- }
- | sysstrkeyword '=' NUMBERSTR '\n'
- {
- cfg_setval($1);
- }
- ;
-
-filename: STRING {
- if ($1[0] != '/')
- {
- yyerror("filename doesn't start with a slash");
- YYERROR;
- }
- $$ = $1;
- }
- ;
-
-boolean: NO { $$ = FALSE; }
- | OFF { $$ = FALSE; }
- | ON { $$ = TRUE; }
- | YES { $$ = TRUE; }
- ;
-
-sysfilekeyword: RATESFILE { $$ = RATESFILE; }
- | ACCTFILE { $$ = ACCTFILE; }
- | ALIASFNAME { $$ = ALIASFNAME; }
- | HOLIDAYFILE { $$ = HOLIDAYFILE; }
- | TINAINITPROG { $$ = TINAINITPROG; }
- ;
-
-sysboolkeyword: USEACCTFILE { $$ = USEACCTFILE; }
- | ALIASING { $$ = ALIASING; }
- | ACCTALL { $$ = ACCTALL; }
- | ADDPREFIX { $$ = ADDPREFIX; }
- | BEEPCONNECT { $$ = BEEPCONNECT; }
- | EXTCALLATTR { $$ = EXTCALLATTR; }
- | ISDNTIME { $$ = ISDNTIME; }
- | MONITORSW { $$ = MONITORSW; }
- ;
-
-sysnumkeyword: MONITORPORT { $$ = MONITORPORT; }
- | RTPRIO { $$ = RTPRIO; }
- ;
-
-sysstrkeyword: MAILER { $$ = MAILER; }
- | MAILTO { $$ = MAILTO; }
- | PREFIXNATIONAL { $$ = PREFIXNATIONAL; }
- | PREFIXINTERNATIONAL { $$ = PREFIXINTERNATIONAL; }
- | ROTATESUFFIX { $$ = ROTATESUFFIX; }
- | REGEXPR { $$ = REGEXPR; }
- | REGPROG { $$ = REGPROG; }
- ;
-
-/* ============= */
-/* entry section */
-/* ============= */
-
-entrysect: ENTRY
- {
- entrycount++;
- nentries++;
- }
- entries
- ;
-
-entries: entry
- | entries entry
- ;
-
-entry: fileentry
- | strentry
- | numentry
- | boolentry
- | nullentry
- | error '\n'
- ;
-
-fileentry: filekeyword '=' filename '\n'
- {
- cfg_setval($1);
- }
- ;
-
-
-strentry: strkeyword '=' STRING '\n'
- {
- cfg_setval($1);
- }
- | strkeyword '=' NUMBERSTR '\n'
- {
- cfg_setval($1);
- }
- ;
-
-boolentry: boolkeyword '=' boolean '\n'
- {
- yylval.booln = $3;
- cfg_setval($1);
- }
- ;
-
-numentry: numkeyword '=' NUMBERSTR '\n'
- {
- yylval.num = atoi($3);
- cfg_setval($1);
- }
- ;
-
-filekeyword: BUDGETCALLBACKSFILE { $$ = BUDGETCALLBACKSFILE; }
- | BUDGETCALLOUTSFILE { $$ = BUDGETCALLOUTSFILE; }
- ;
-
-strkeyword: ANSWERPROG { $$ = ANSWERPROG; }
- | B1PROTOCOL { $$ = B1PROTOCOL; }
- | BCAP { $$ = BCAP; }
- | CONNECTPROG { $$ = CONNECTPROG; }
- | DIALOUTTYPE { $$ = DIALOUTTYPE; }
- | DIRECTION { $$ = DIRECTION; }
- | DISCONNECTPROG { $$ = DISCONNECTPROG; }
- | IDLE_ALG_OUT { $$ = IDLE_ALG_OUT; }
- | LOCAL_PHONE_INCOMING { $$ = LOCAL_PHONE_INCOMING; }
- | LOCAL_SUBADDR_INCOMING { $$ = LOCAL_SUBADDR_INCOMING; }
- | LOCAL_PHONE_DIALOUT { $$ = LOCAL_PHONE_DIALOUT; }
- | LOCAL_SUBADDR_DIALOUT { $$ = LOCAL_SUBADDR_DIALOUT; }
- | NAME { $$ = NAME; }
- | PPP_EXPECT_AUTH { $$ = PPP_EXPECT_AUTH; }
- | PPP_EXPECT_NAME { $$ = PPP_EXPECT_NAME; }
- | PPP_EXPECT_PASSWORD { $$ = PPP_EXPECT_PASSWORD; }
- | PPP_SEND_AUTH { $$ = PPP_SEND_AUTH; }
- | PPP_SEND_NAME { $$ = PPP_SEND_NAME; }
- | PPP_SEND_PASSWORD { $$ = PPP_SEND_PASSWORD; }
- | REACTION { $$ = REACTION; }
- | REMOTE_NUMBERS_HANDLING { $$ = REMOTE_NUMBERS_HANDLING; }
- | REMOTE_PHONE_INCOMING { $$ = REMOTE_PHONE_INCOMING; }
- | REMOTE_SUBADDR_INCOMING { $$ = REMOTE_SUBADDR_INCOMING; }
- | REMOTE_PHONE_DIALOUT { $$ = REMOTE_PHONE_DIALOUT; }
- | REMOTE_SUBADDR_DIALOUT { $$ = REMOTE_SUBADDR_DIALOUT; }
- | UNITLENGTHSRC { $$ = UNITLENGTHSRC; }
- | USRDEVICENAME { $$ = USRDEVICENAME; }
- | VALID { $$ = VALID; }
- | CLONE { $$ = CLONE; }
- ;
-
-numkeyword: ALERT { $$ = ALERT; }
- | BUDGETCALLBACKPERIOD { $$ = BUDGETCALLBACKPERIOD; }
- | BUDGETCALLBACKNCALLS { $$ = BUDGETCALLBACKNCALLS; }
- | BUDGETCALLOUTPERIOD { $$ = BUDGETCALLOUTPERIOD; }
- | BUDGETCALLOUTNCALLS { $$ = BUDGETCALLOUTNCALLS; }
- | CALLBACKWAIT { $$ = CALLBACKWAIT; }
- | CALLEDBACKWAIT { $$ = CALLEDBACKWAIT; }
- | DIALRETRIES { $$ = DIALRETRIES; }
- | EARLYHANGUP { $$ = EARLYHANGUP; }
- | IDLETIME_IN { $$ = IDLETIME_IN; }
- | IDLETIME_OUT { $$ = IDLETIME_OUT; }
- | ISDNCONTROLLER { $$ = ISDNCONTROLLER; }
- | ISDNCHANNEL { $$ = ISDNCHANNEL; }
- | ISDNTXDELIN { $$ = ISDNTXDELIN; }
- | ISDNTXDELOUT { $$ = ISDNTXDELOUT; }
- | RATETYPE { $$ = RATETYPE; }
- | RECOVERYTIME { $$ = RECOVERYTIME; }
- | UNITLENGTH { $$ = UNITLENGTH; }
- | USRDEVICEUNIT { $$ = USRDEVICEUNIT; }
- | DOWNTIME { $$ = DOWNTIME; }
- | DOWNTRIES { $$ = DOWNTRIES; }
- | MAXCONNECTTIME { $$ = MAXCONNECTTIME; }
- ;
-
-boolkeyword: BUDGETCALLBACKSFILEROTATE { $$ = BUDGETCALLBACKSFILEROTATE; }
- | BUDGETCALLOUTSFILEROTATE { $$ = BUDGETCALLOUTSFILEROTATE; }
- | DIALRANDINCR { $$ = DIALRANDINCR; }
- | PPP_AUTH_RECHALLENGE { $$ = PPP_AUTH_RECHALLENGE; }
- | PPP_AUTH_PARANOID { $$ = PPP_AUTH_PARANOID; }
- | USEDOWN { $$ = USEDOWN; }
- | USESUBADDR { $$ = USESUBADDR; }
- ;
-
-/* ================== */
-/* controller section */
-/* ================== */
-
-controllersect: CONTROLLER
- {
- controllercount++;
- }
- controllers
- ;
-
-controllers: controller
- | controllers controller
- ;
-
-controller: strcontroller
- | nullentry
- | error '\n'
- ;
-
-strcontroller: cstrkeyword '=' STRING '\n'
- {
- cfg_setval($1);
- }
- | cstrkeyword '=' NUMBERSTR '\n'
- {
- cfg_setval($1);
- }
- | cfilekeyword '=' filename '\n'
- {
- cfg_setval($1);
- }
- ;
-
-cstrkeyword: PROTOCOL { $$ = PROTOCOL; }
- ;
-
-cfilekeyword: FIRMWARE { $$ = FIRMWARE; }
- ;
-
-
-%%
diff --git a/usr.sbin/i4b/isdnd/rc_scan.l b/usr.sbin/i4b/isdnd/rc_scan.l
deleted file mode 100644
index 988a4fb..0000000
--- a/usr.sbin/i4b/isdnd/rc_scan.l
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
- *
- * Copyright (c) 1997, 2002 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 daemon - runtime configuration lexical analyzer
- * ---------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Aug 11 12:27:50 2002]
- *
- *---------------------------------------------------------------------------*/
-
-%{
-
-#include <err.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sysexits.h>
-
-#include "y.tab.h"
-
-int lineno;
-
-%}
-
-%option noyywrap
-%option nounput
-
-%%
-
-#.*$ { /*
- * Drop comment. NB: this prevents a hash
- * sign from appearing inside a quoted string.
- */
- }
-
-["][^"]*["] {
- char *str;
- if ((str = malloc(yyleng - 1)) == 0)
- errx(EX_OSERR, "Out of virtual memory");
- memcpy(str, yytext + 1, yyleng - 2);
- str[yyleng - 2] = 0;
- yylval.str = str;
- return STRING;
- }
-
-(-*[0-9]+)|\* {
- char *str;
- char *p = yytext;
- int i = 0;
- if ((str = malloc(128)) == 0)
- errx(EX_OSERR, "Out of virtual memory");
- while(*p == '-' || isdigit(*p) || *p == '*')
- str[i++] = *p++;
- str[i] = '\0';
- yylval.str = str;
- return NUMBERSTR;
- }
-
-acctall { return ACCTALL; }
-acctfile { return ACCTFILE; }
-add-prefix { return ADDPREFIX; }
-alert { return ALERT; }
-aliasing { return ALIASING; }
-aliasfile { return ALIASFNAME; }
-answerprog { return ANSWERPROG; }
-b1protocol { return B1PROTOCOL; }
-bcap { return BCAP; }
-beepconnect { return BEEPCONNECT; }
-budget-callbackperiod { return BUDGETCALLBACKPERIOD; }
-budget-callbackncalls { return BUDGETCALLBACKNCALLS; }
-budget-callbacksfile { return BUDGETCALLBACKSFILE; }
-budget-callbacksfile-rotate { return BUDGETCALLBACKSFILEROTATE; }
-budget-calloutperiod { return BUDGETCALLOUTPERIOD; }
-budget-calloutncalls { return BUDGETCALLOUTNCALLS; }
-budget-calloutsfile { return BUDGETCALLOUTSFILE; }
-budget-calloutsfile-rotate { return BUDGETCALLOUTSFILEROTATE; }
-callbackwait { return CALLBACKWAIT; }
-calledbackwait { return CALLEDBACKWAIT; }
-clone { return CLONE; }
-connectprog { return CONNECTPROG; }
-controller { return CONTROLLER; }
-dialin-reaction { return REACTION; }
-dialout-type { return DIALOUTTYPE; }
-dialrandincr { return DIALRANDINCR; }
-dialretries { return DIALRETRIES; }
-direction { return DIRECTION; }
-disconnectprog { return DISCONNECTPROG; }
-downtries { return DOWNTRIES; }
-downtime { return DOWNTIME; }
-earlyhangup { return EARLYHANGUP; }
-entry { return ENTRY; }
-extcallattr { return EXTCALLATTR; }
-firmware { return FIRMWARE; }
-holidayfile { return HOLIDAYFILE; }
-idletime-incoming { return IDLETIME_IN; }
-idletime-outgoing { return IDLETIME_OUT; }
-idle-algorithm-outgoing { return IDLE_ALG_OUT; }
-isdncontroller { return ISDNCONTROLLER; }
-isdnchannel { return ISDNCHANNEL; }
-isdntime { return ISDNTIME; }
-isdntxdel-incoming { return ISDNTXDELIN; }
-isdntxdel-outgoing { return ISDNTXDELOUT; }
-local-phone-dialout { return LOCAL_PHONE_DIALOUT; }
-local-subaddr-dialout { return LOCAL_SUBADDR_DIALOUT; }
-local-phone-incoming { return LOCAL_PHONE_INCOMING; }
-local-subaddr-incoming { return LOCAL_SUBADDR_INCOMING; }
-mailer { return MAILER; }
-mailto { return MAILTO; }
-maxconnecttime { return MAXCONNECTTIME; }
-monitor-allowed { return MONITORSW; }
-monitor-port { return MONITORPORT; }
-monitor { return MONITOR; }
-monitor-access { return MONITORACCESS; }
-fullcmd { return FULLCMD; }
-restrictedcmd { return RESTRICTEDCMD; }
-channelstate { return CHANNELSTATE; }
-callin { return CALLIN; }
-callout { return CALLOUT; }
-logevents { return LOGEVENTS; }
-name { return NAME; }
-no { return NO; }
-off { return OFF; }
-on { return ON; }
-ppp-auth-rechallenge { return PPP_AUTH_RECHALLENGE; }
-ppp-auth-paranoid { return PPP_AUTH_PARANOID; }
-ppp-expect-auth { return PPP_EXPECT_AUTH; }
-ppp-expect-name { return PPP_EXPECT_NAME; }
-ppp-expect-password { return PPP_EXPECT_PASSWORD; }
-ppp-send-auth { return PPP_SEND_AUTH; }
-ppp-send-name { return PPP_SEND_NAME; }
-ppp-send-password { return PPP_SEND_PASSWORD; }
-prefix-international { return PREFIXINTERNATIONAL; }
-prefix-national { return PREFIXNATIONAL; }
-protocol { return PROTOCOL; }
-ratesfile { return RATESFILE; }
-ratetype { return RATETYPE; }
-recoverytime { return RECOVERYTIME; }
-regexpr { return REGEXPR; }
-regprog { return REGPROG; }
-remdial-handling { return REMOTE_NUMBERS_HANDLING; }
-remote-phone-dialout { return REMOTE_PHONE_DIALOUT; }
-remote-subaddr-dialout { return REMOTE_SUBADDR_DIALOUT; }
-remote-phone-incoming { return REMOTE_PHONE_INCOMING; }
-remote-subaddr-incoming { return REMOTE_SUBADDR_INCOMING; }
-rotatesuffix { return ROTATESUFFIX; }
-rtprio { return RTPRIO; }
-system { return SYSTEM; }
-tinainitprog { return TINAINITPROG; }
-unitlength { return UNITLENGTH; }
-unitlengthsrc { return UNITLENGTHSRC; }
-useacctfile { return USEACCTFILE; }
-usesubaddr { return USESUBADDR; }
-usrdevicename { return USRDEVICENAME; }
-usrdeviceunit { return USRDEVICEUNIT; }
-usedown { return USEDOWN; }
-valid { return VALID; }
-yes { return YES; }
-
-\n { lineno++; return '\n'; }
-
-[A-Za-z/.][-A-Za-z0-9_/.]* {
- char *str;
- if ((str = strdup(yytext)) == 0)
- err(EX_OSERR, "Out of virtual memory");
- yylval.str = str;
- return STRING;
- }
-
-[ \t] { /* drop white space */ }
-
-. { return yytext[0]; }
-
-%%
-
-void
-reset_scanner(FILE *infile)
-{
- yyrestart(infile);
- lineno = 1;
-}
diff --git a/usr.sbin/i4b/isdnd/support.c b/usr.sbin/i4b/isdnd/support.c
deleted file mode 100644
index 156ed29..0000000
--- a/usr.sbin/i4b/isdnd/support.c
+++ /dev/null
@@ -1,1169 +0,0 @@
-/*
- * Copyright (c) 1997, 2003 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 daemon - misc support routines
- * ----------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:19:23 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-static int isvalidtime(cfg_entry_t *cep);
-
-/*---------------------------------------------------------------------------*
- * find an active entry by driver type and driver unit
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-find_active_entry_by_driver(int drivertype, int driverunit)
-{
- cfg_entry_t *cep = NULL;
- int i;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- if(!((cep->usrdevicename == drivertype) &&
- (cep->usrdeviceunit == driverunit)))
- {
- continue;
- }
-
- /* check time interval */
-
- if(isvalidtime(cep) == 0)
- {
- DBGL(DL_VALID, (llog(LL_DBG, "find_active_entry_by_driver: entry %d, time not valid!", i)));
- continue;
- }
-
- /* found */
-
- if(cep->cdid == CDID_UNUSED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_active_entry_by_driver: entry %d [%s%d], cdid=CDID_UNUSED !",
- i, bdrivername(drivertype), driverunit)));
- return(NULL);
- }
- else if(cep->cdid == CDID_RESERVED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_active_entry_by_driver: entry %d [%s%d], cdid=CDID_RESERVED!",
- i, bdrivername(drivertype), driverunit)));
- return(NULL);
- }
- return(cep);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * find entry by drivertype and driverunit and setup for dialing out
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-find_by_device_for_dialout(int drivertype, int driverunit)
-{
- cfg_entry_t *cep = NULL;
- int i;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- /* compare driver type and unit */
-
- if(!((cep->usrdevicename == drivertype) &&
- (cep->usrdeviceunit == driverunit)))
- {
- continue;
- }
-
- /* check time interval */
-
- if(isvalidtime(cep) == 0)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialout: entry %d, time not valid!", i)));
- continue;
- }
-
- /* found, check if already reserved */
-
- if(cep->cdid == CDID_RESERVED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialout: entry %d, cdid reserved!", i)));
- return(NULL);
- }
-
- /* check if this entry is already in use ? */
-
- if(cep->cdid != CDID_UNUSED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialout: entry %d, cdid in use", i)));
- return(NULL);
- }
-
- if((setup_dialout(cep)) == GOOD)
- {
- /* found an entry to be used for calling out */
-
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialout: found entry %d!", i)));
- return(cep);
- }
- else
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialout: entry %d, setup_dialout() failed!", i)));
- return(NULL);
- }
- }
-
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialout: no entry found!")));
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * find entry by drivertype and driverunit and setup for dialing out
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-find_by_device_for_dialoutnumber(msg_dialoutnumber_ind_t *mp)
-{
- cfg_entry_t *cep = NULL;
- int i, j;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- /* compare driver type and unit */
-
- if(!((cep->usrdevicename == mp->driver) &&
- (cep->usrdeviceunit == mp->driver_unit)))
- {
- continue;
- }
-
- /* check time interval */
-
- if(isvalidtime(cep) == 0)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialoutnumber: entry %d, time not valid!", i)));
- continue;
- }
-
- /* found, check if already reserved */
-
- if(cep->cdid == CDID_RESERVED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialoutnumber: entry %d, cdid reserved!", i)));
- return(NULL);
- }
-
- /* check if this entry is already in use ? */
-
- if(cep->cdid != CDID_UNUSED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialoutnumber: entry %d, cdid in use", i)));
- return(NULL);
- }
-
- cep->keypad[0] = '\0';
-
- /* check number and copy to cep->remote_numbers[] */
-
- for(j = 0; j < mp->cmdlen; j++)
- {
- if(!(isdigit(*(mp->cmd+j))))
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialoutnumber: entry %d, dial string contains non-digit at pos %d", i, j)));
- return(NULL);
- }
- /* fill in number to dial */
- cep->remote_numbers[0].number[j] = *(mp->cmd+j);
- }
- cep->remote_numbers[0].number[j] = '\0';
-
-/* XXX subaddr does not have to be a digit! isgraph() would be a better idea */
- for(j = 0; j < mp->subaddrlen; j++)
- {
- if(!(isdigit(*(mp->subaddr+j))))
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialoutnumber: entry %d, subaddr string contains non-digit at pos %d", i, j)));
- return(NULL);
- }
- /* fill in number to dial */
- cep->remote_numbers[0].subaddr[j] = *(mp->subaddr+j);
- }
- cep->remote_numbers[0].subaddr[j] = '\0';
-
- cep->remote_numbers_count = 1;
-
- if((setup_dialout(cep)) == GOOD)
- {
- /* found an entry to be used for calling out */
-
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialoutnumber: found entry %d!", i)));
- return(cep);
- }
- else
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialoutnumber: entry %d, setup_dialout() failed!", i)));
- return(NULL);
- }
- }
-
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_dialoutnumber: no entry found!")));
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * find entry by drivertype and driverunit and setup for send keypad
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-find_by_device_for_keypad(int drivertype, int driverunit, int cmdlen, char *cmd)
-{
- cfg_entry_t *cep = NULL;
- int i;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- /* compare driver type and unit */
-
- if(!((cep->usrdevicename == drivertype) &&
- (cep->usrdeviceunit == driverunit)))
- {
- continue;
- }
-
- /* check time interval */
-
- if(isvalidtime(cep) == 0)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_keypad: entry %d, time not valid!", i)));
- continue;
- }
-
- /* found, check if already reserved */
-
- if(cep->cdid == CDID_RESERVED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_keypad: entry %d, cdid reserved!", i)));
- return(NULL);
- }
-
- /* check if this entry is already in use ? */
-
- if(cep->cdid != CDID_UNUSED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_keypad: entry %d, cdid in use", i)));
- return(NULL);
- }
-
- cep->remote_numbers[0].number[0] = '\0';
- cep->remote_numbers_count = 0;
- cep->remote_phone_dialout.number[0] = '\0';
-
- bzero(cep->keypad, KEYPAD_MAX);
- strncpy(cep->keypad, cmd, cmdlen);
-
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_keypad: entry %d, keypad string is %s", i, cep->keypad)));
-
- if((setup_dialout(cep)) == GOOD)
- {
- /* found an entry to be used for calling out */
-
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_keypad: found entry %d!", i)));
- return(cep);
- }
- else
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_keypad: entry %d, setup_dialout() failed!", i)));
- return(NULL);
- }
- }
-
- DBGL(DL_MSG, (llog(LL_DBG, "find_by_device_for_keypad: no entry found!")));
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * find entry by drivertype and driverunit and setup for dialing out
- *---------------------------------------------------------------------------*/
-int
-setup_dialout(cfg_entry_t *cep)
-{
- int i;
-
- /* check controller operational */
-
- if((get_controller_state(cep->isdncontroller)) != CTRL_UP)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "setup_dialout: entry %s, controller is down", cep->name)));
- return(ERROR);
- }
-
- cep->isdncontrollerused = cep->isdncontroller;
-
- /* check channel available */
-
- switch(cep->isdnchannel)
- {
- case CHAN_ANY:
- for (i = 0; i < isdn_ctrl_tab[cep->isdncontroller].nbch; i++)
- {
- if(ret_channel_state(cep->isdncontroller, i) == CHAN_IDLE)
- break;
- }
-
- if (i == isdn_ctrl_tab[cep->isdncontroller].nbch)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "setup_dialout: entry %s, no channel free", cep->name)));
- return(ERROR);
- }
- cep->isdnchannelused = CHAN_ANY;
- break;
-
- default:
- if((ret_channel_state(cep->isdncontroller, cep->isdnchannel)) != CHAN_IDLE)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "setup_dialout: entry %s, channel not free", cep->name)));
- return(ERROR);
- }
- cep->isdnchannelused = cep->isdnchannel;
- break;
- }
-
- DBGL(DL_MSG, (llog(LL_DBG, "setup_dialout: entry %s ok!", cep->name)));
-
- /* preset disconnect cause */
-
- SET_CAUSE_TYPE(cep->disc_cause, CAUSET_I4B);
- SET_CAUSE_VAL(cep->disc_cause, CAUSE_I4B_NORMAL);
-
- return(GOOD);
-}
-
-/*---------------------------------------------------------------------------*
- * find entry by drivertype and driverunit
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-get_cep_by_driver(int drivertype, int driverunit)
-{
- cfg_entry_t *cep = NULL;
- int i;
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- if(!((cep->usrdevicename == drivertype) &&
- (cep->usrdeviceunit == driverunit)))
- {
- continue;
- }
-
- /* check time interval */
-
- if(isvalidtime(cep) == 0)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "get_cep_by_driver: entry %d, time not valid!", i)));
- continue;
- }
-
- DBGL(DL_MSG, (llog(LL_DBG, "get_cep_by_driver: found entry %d!", i)));
- return(cep);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * find a matching entry for an incoming call
- *
- * - not found/no match: log output with LL_CHD and return NULL
- * - found/match: make entry in free cep, return address
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-find_matching_entry_incoming(msg_connect_ind_t *mp)
-{
- cfg_entry_t *cep = NULL;
- int i;
-
- /* check for CW (call waiting) early */
-
- if(mp->channel == CHAN_NO)
- {
- if(aliasing)
- {
- char *src_tela = "ERROR-src_tela";
- char *dst_tela = "ERROR-dst_tela";
-
- src_tela = get_alias(mp->src_telno);
- dst_tela = get_alias(mp->dst_telno);
-
- llog(LL_CHD, "%05d <unknown> CW from %s to %s (no channel free)",
- mp->header.cdid, src_tela, dst_tela);
- }
- else
- {
- llog(LL_CHD, "%05d <unknown> call waiting from %s to %s (no channel free)",
- mp->header.cdid, mp->src_telno, mp->dst_telno);
- }
- return(NULL);
- }
-
- for(i=0; i < nentries; i++)
- {
- int n;
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- /* check my number */
-
- if(strncmp(cep->local_phone_incoming.number, mp->dst_telno, strlen(cep->local_phone_incoming.number)))
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, myno %s != incomingno %s", i,
- cep->local_phone_incoming.number, mp->dst_telno)));
- continue;
- }
-
- if (cep->usesubaddr && strncmp(cep->local_phone_incoming.subaddr, mp->dst_subaddr, strlen(cep->local_phone_incoming.subaddr)))
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, mysubno %s != incomingsubno %s", i,
- cep->local_phone_incoming.subaddr, mp->dst_subaddr)));
- continue;
- }
-
- /* check all allowed remote numbers for this entry */
-
- for (n = 0; n < cep->incoming_numbers_count; n++)
- {
- incoming_number_t *in = &cep->remote_phone_incoming[n];
-
- /*
- * An incoming number matches whenever the main
- * phone number either matches or is a wildcard AND
- * subaddresses are either not in use or match as
- * well (or the required subaddress is a wildcard).
- * This means that if subaddresses are in use and
- * the main phone number is a wildcard, the
- * subaddress is still required to match.
- *
- * At first glance, this does not seem logical,
- * but since subaddress usage can be configured per
- * entry, disregarding the subaddress if the main
- * number matches would needlessly limit the user's
- * flexibility.
- */
-
- if ((in->number[0] == '*') || (!strncmp(in->number, mp->src_telno, strlen(in->number))))
- {
- if ((!cep->usesubaddr) || (in->subaddr[0] == '*') || (!strncmp(in->subaddr, mp->src_subaddr, strlen(in->subaddr))))
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, match: remno %s = incomingfromno %s", i,
- in->number, mp->src_telno)));
- break;
- }
- }
- else
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, remno %s != incomingfromno %s", i,
- in->number, mp->src_telno)));
- }
- }
-
- /* If all configured remote numbers have been tested without success, proceed to the next entry. */
- if (n >= cep->incoming_numbers_count)
- continue;
-
- /* check b protocol */
-
- if(cep->b1protocol != mp->bprot)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, bprot %d != incomingprot %d", i,
- cep->b1protocol, mp->bprot)));
- continue;
- }
-
- /* is this entry currently in use ? */
-
- if(cep->cdid != CDID_UNUSED)
- {
- if(cep->cdid == CDID_RESERVED)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, cdid is reserved", i)));
- }
- else if (cep->dialin_reaction == REACT_ACCEPT
- && cep->dialouttype == DIALOUT_CALLEDBACK)
- {
- /*
- * We might consider doing this even if this is
- * not a calledback config entry - BUT: there are
- * severe race conditions and timinig problems
- * ex. if both sides run I4B with no callback
- * delay - both may shutdown the outgoing call
- * and never be able to establish a connection.
- * In the called-back case this should not happen.
- */
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, incoming call for callback in progress (cdid %05d)", i, cep->cdid)));
-
- /* save the current call state, we're going to overwrite it with the
- * new incoming state below... */
- cep->saved_call.cdid = cep->cdid;
- cep->saved_call.controller = cep->isdncontrollerused;
- cep->saved_call.channel = cep->isdnchannelused;
- }
- else
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, cdid in use", i)));
- continue; /* yes, next */
- }
- }
-
- /* check controller value ok */
-
- if(mp->controller > ncontroller)
- {
- llog(LL_CHD, "%05d %s incoming call with invalid controller %d",
- mp->header.cdid, cep->name, mp->controller);
- return(NULL);
- }
-
- /* check controller marked up */
-
- if((get_controller_state(mp->controller)) != CTRL_UP)
- {
- llog(LL_CHD, "%05d %s incoming call, controller %d DOWN!",
- mp->header.cdid, cep->name, mp->controller);
- return(NULL);
- }
-
- /*
- * check controller he wants, check for any
- * controller or specific controller
- */
-
- if( (mp->controller != -1) &&
- (mp->controller != cep->isdncontroller) )
- {
- llog(LL_CHD, "%05d %s incoming call, controller %d != incoming %d",
- mp->header.cdid, cep->name,
- cep->isdncontroller, mp->controller);
- continue;
- }
-
- /* check channel he wants */
-
- switch(mp->channel)
- {
- case CHAN_ANY:
- for (i = 0; i < isdn_ctrl_tab[mp->controller].nbch; i++)
- {
- if(ret_channel_state(mp->controller, i) == CHAN_IDLE)
- break;
- }
-
- if (i == isdn_ctrl_tab[mp->controller].nbch)
- {
- llog(LL_CHD, "%05d %s incoming call, no channel free!",
- mp->header.cdid, cep->name);
- return(NULL);
- }
- break;
-
- case CHAN_NO:
- llog(LL_CHD, "%05d %s incoming call, call waiting (no channel available)!",
- mp->header.cdid, cep->name);
- return(NULL);
- break;
-
- default:
- if((ret_channel_state(mp->controller, mp->channel)) != CHAN_IDLE)
- {
- llog(LL_CHD, "%05d %s incoming call, channel B%d not free!",
- mp->header.cdid, cep->name, mp->channel+1);
- return(NULL);
- }
- break;
- }
-
- /* check time interval */
-
- if(isvalidtime(cep) == 0)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, time not valid!", i)));
- continue;
- }
-
- /* found a matching entry */
-
- cep->cdid = mp->header.cdid;
- cep->isdncontrollerused = mp->controller;
- cep->isdnchannelused = mp->channel;
-/*XXX*/ cep->disc_cause = 0;
-
- /* cp number to real one used */
-
- strcpy(cep->real_phone_incoming.number, mp->src_telno);
-
- /* copy display string */
-
- strcpy(cep->display, mp->display);
-
- /* entry currently down ? */
-
- if(cep->state == ST_DOWN)
- {
- msg_updown_ind_t mui;
-
- /* set interface up */
-
- DBGL(DL_MSG, (llog(LL_DBG, "find_matching_entry_incoming: entry %d, ", i)));
-
- mui.driver = cep->usrdevicename;
- mui.driver_unit = cep->usrdeviceunit;
- mui.updown = SOFT_ENA;
-
- if((ioctl(isdnfd, I4B_UPDOWN_IND, &mui)) < 0)
- {
- llog(LL_ERR, "find_matching_entry_incoming: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- error_exit(1, "find_matching_entry_incoming: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- }
-
- cep->down_retry_count = 0;
- cep->state = ST_IDLE;
- }
- return(cep);
- }
-
- if(aliasing)
- {
- char *src_tela = "ERROR-src_tela";
- char *dst_tela = "ERROR-dst_tela";
-
- src_tela = get_alias(mp->src_telno);
- dst_tela = get_alias(mp->dst_telno);
-
- llog(LL_CHD, "%05d Call from %s to %s",
- mp->header.cdid, src_tela, dst_tela);
- }
- else
- {
- llog(LL_CHD, "%05d <unknown> incoming call from %s to %s ctrl %d",
- mp->header.cdid, mp->src_telno, mp->dst_telno, mp->controller);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * return address of ACTIVE config entry by controller and channel
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-get_cep_by_cc(int ctrlr, int chan)
-{
- int i;
-
- if((chan < 0) || (chan >= isdn_ctrl_tab[ctrlr].nbch))
- return(NULL);
-
- for(i=0; i < nentries; i++)
- {
- if((cfg_entry_tab[i].cdid != CDID_UNUSED) &&
- (cfg_entry_tab[i].cdid != CDID_RESERVED) &&
- (cfg_entry_tab[i].isdnchannelused == chan) &&
- (cfg_entry_tab[i].isdncontrollerused == ctrlr) &&
- ((ret_channel_state(ctrlr, chan)) == CHAN_RUN))
- {
- return(&cfg_entry_tab[i]);
- }
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * return address of config entry identified by cdid
- *---------------------------------------------------------------------------*/
-cfg_entry_t *
-get_cep_by_cdid(int cdid)
-{
- int i;
-
- for(i=0; i < nentries; i++)
- {
- if(cfg_entry_tab[i].cdid == cdid
- || cfg_entry_tab[i].saved_call.cdid == cdid)
- return(&cfg_entry_tab[i]);
- }
- return(NULL);
-}
-
-/*---------------------------------------------------------------------------*
- * return b channel driver type name string
- *---------------------------------------------------------------------------*/
-char *
-bdrivername(int drivertype)
-{
- static char *bdtab[] = {
- "rbch",
- "tel",
- "ipr",
- "isp",
- "ibc",
- "ing"
- };
-
- if(drivertype >= BDRV_RBCH && drivertype <= BDRV_ING)
- return(bdtab[drivertype]);
- else
- return("unknown");
-}
-
-/*---------------------------------------------------------------------------*
- * process AOCD charging messages
- *---------------------------------------------------------------------------*/
-void
-handle_charge(cfg_entry_t *cep)
-{
- time_t now = time(NULL);
-
- if(cep->aoc_last == 0) /* no last timestamp yet ? */
- {
- cep->aoc_last = now; /* add time stamp */
- }
- else if(cep->aoc_now == 0) /* no current timestamp yet ? */
- {
- cep->aoc_now = now; /* current timestamp */
- }
- else
- {
- cep->aoc_last = cep->aoc_now;
- cep->aoc_now = now;
- cep->aoc_diff = cep->aoc_now - cep->aoc_last;
- cep->aoc_valid = AOC_VALID;
- }
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_charge(cep);
-#endif
-
-#ifdef I4B_EXTERNAL_MONITOR
- if(do_monitor && accepted)
- monitor_evnt_charge(cep, cep->charge, 0);
-#endif
-
- if(cep->aoc_valid == AOC_VALID)
- {
- if(cep->aoc_diff != cep->unitlength)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "handle_charge: AOCD unit length updated %d -> %d secs", cep->unitlength, cep->aoc_diff)));
-
- cep->unitlength = cep->aoc_diff;
-
- unitlen_chkupd(cep);
- }
- else
- {
-#ifdef NOTDEF
- DBGL(DL_MSG, (llog(LL_DBG, "handle_charge: AOCD unit length still %d secs", cep->unitlength)));
-#endif
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * update kernel idle_time, earlyhup_time and unitlen_time
- *---------------------------------------------------------------------------*/
-void
-unitlen_chkupd(cfg_entry_t *cep)
-{
- msg_timeout_upd_t tupd;
-
- tupd.cdid = cep->cdid;
-
- /* init the short hold data based on the shorthold algorithm type */
-
- switch(cep->shorthold_algorithm)
- {
- case SHA_FIXU:
- tupd.shorthold_data.shorthold_algorithm = SHA_FIXU;
- tupd.shorthold_data.unitlen_time = cep->unitlength;
- tupd.shorthold_data.idle_time = cep->idle_time_out;
- tupd.shorthold_data.earlyhup_time = cep->earlyhangup;
- break;
-
- case SHA_VARU:
- tupd.shorthold_data.shorthold_algorithm = SHA_VARU;
- tupd.shorthold_data.unitlen_time = cep->unitlength;
- tupd.shorthold_data.idle_time = cep->idle_time_out;
- tupd.shorthold_data.earlyhup_time = 0;
- break;
- default:
- llog(LL_ERR, "unitlen_chkupd bad shorthold_algorithm %d", cep->shorthold_algorithm );
- return;
- break;
- }
-
- if((ioctl(isdnfd, I4B_TIMEOUT_UPD, &tupd)) < 0)
- {
- llog(LL_ERR, "ioctl I4B_TIMEOUT_UPD failed: %s", strerror(errno));
- error_exit(1, "ioctl I4B_TIMEOUT_UPD failed: %s", strerror(errno));
- }
-}
-
-/*--------------------------------------------------------------------------*
- * this is intended to be called by do_exit and closes down all
- * active connections before the daemon exits or is reconfigured.
- *--------------------------------------------------------------------------*/
-void
-close_allactive(void)
-{
- int i, j, k;
- cfg_entry_t *cep = NULL;
-
- j = 0;
-
- for (i = 0; i < ncontroller; i++)
- {
- if((get_controller_state(i)) != CTRL_UP)
- continue;
-
- for (k = 0; k < isdn_ctrl_tab[i].nbch; k++)
- {
- if((ret_channel_state(i, k)) == CHAN_RUN)
- {
- if((cep = get_cep_by_cc(i, k)) != NULL)
- {
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_disconnect(cep);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_evnt_disconnect(cep);
-#endif
- next_state(cep, EV_DRQ);
- j++;
- }
- }
- }
- }
-
- if(j)
- {
- llog(LL_DMN, "close_allactive: waiting for all connections terminated");
- sleep(5);
- }
-}
-
-/*--------------------------------------------------------------------------*
- * set an interface up
- *--------------------------------------------------------------------------*/
-void
-if_up(cfg_entry_t *cep)
-{
- msg_updown_ind_t mui;
-
- /* set interface up */
-
- DBGL(DL_MSG, (llog(LL_DBG, "if_up: taking %s%d up", bdrivername(cep->usrdevicename), cep->usrdeviceunit)));
-
- mui.driver = cep->usrdevicename;
- mui.driver_unit = cep->usrdeviceunit;
- mui.updown = SOFT_ENA;
-
- if((ioctl(isdnfd, I4B_UPDOWN_IND, &mui)) < 0)
- {
- llog(LL_ERR, "if_up: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- error_exit(1, "if_up: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- }
- cep->down_retry_count = 0;
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_updown(cep, 1);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_evnt_updown(cep, 1);
-#endif
-
-}
-
-/*--------------------------------------------------------------------------*
- * set an interface down
- *--------------------------------------------------------------------------*/
-void
-if_down(cfg_entry_t *cep)
-{
- msg_updown_ind_t mui;
-
- /* set interface up */
-
- DBGL(DL_MSG, (llog(LL_DBG, "if_down: taking %s%d down", bdrivername(cep->usrdevicename), cep->usrdeviceunit)));
-
- mui.driver = cep->usrdevicename;
- mui.driver_unit = cep->usrdeviceunit;
- mui.updown = SOFT_DIS;
-
- if((ioctl(isdnfd, I4B_UPDOWN_IND, &mui)) < 0)
- {
- llog(LL_ERR, "if_down: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- error_exit(1, "if_down: ioctl I4B_UPDOWN_IND failed: %s", strerror(errno));
- }
- cep->went_down_time = time(NULL);
- cep->down_retry_count = 0;
-
-#ifdef USE_CURSES
- if(do_fullscreen)
- display_updown(cep, 0);
-#endif
-#ifdef I4B_EXTERNAL_MONITOR
- monitor_evnt_updown(cep, 0);
-#endif
-
-}
-
-/*--------------------------------------------------------------------------*
- * send a dial response to (an interface in) the kernel
- *--------------------------------------------------------------------------*/
-void
-dialresponse(cfg_entry_t *cep, int dstat)
-{
- msg_dialout_resp_t mdr;
-
- static char *stattab[] = {
- "normal condition",
- "temporary failure",
- "permanent failure",
- "dialout not allowed"
- };
-
- if(dstat < DSTAT_NONE || dstat > DSTAT_INONLY)
- {
- llog(LL_ERR, "dialresponse: dstat out of range %d!", dstat);
- return;
- }
-
- mdr.driver = cep->usrdevicename;
- mdr.driver_unit = cep->usrdeviceunit;
- mdr.stat = dstat;
- mdr.cause = cep->disc_cause;
-
- if((ioctl(isdnfd, I4B_DIALOUT_RESP, &mdr)) < 0)
- {
- llog(LL_ERR, "dialresponse: ioctl I4B_DIALOUT_RESP failed: %s", strerror(errno));
- error_exit(1, "dialresponse: ioctl I4B_DIALOUT_RESP failed: %s", strerror(errno));
- }
-
- DBGL(DL_DRVR, (llog(LL_DBG, "dialresponse: sent [%s]", stattab[dstat])));
-}
-
-/*--------------------------------------------------------------------------*
- * screening/presentation indicator
- *--------------------------------------------------------------------------*/
-void
-handle_scrprs(int cdid, int scr, int prs, char *caller)
-{
- /* screening indicator */
-
- if(scr < SCR_NONE || scr > SCR_NET)
- {
- llog(LL_ERR, "msg_connect_ind: invalid screening indicator value %d!", scr);
- }
- else
- {
- static char *scrtab[] = {
- "no screening indicator",
- "sreening user provided, not screened",
- "screening user provided, verified & passed",
- "screening user provided, verified & failed",
- "screening network provided", };
-
- if(extcallattr)
- {
- llog(LL_CHD, "%05d %s %s", cdid, caller, scrtab[scr]);
- }
- else
- {
- DBGL(DL_MSG, (llog(LL_DBG, "%s - %s", caller, scrtab[scr])));
- }
- }
-
- /* presentation indicator */
-
- if(prs < PRS_NONE || prs > PRS_RESERVED)
- {
- llog(LL_ERR, "msg_connect_ind: invalid presentation indicator value %d!", prs);
- }
- else
- {
- static char *prstab[] = {
- "no presentation indicator",
- "presentation allowed",
- "presentation restricted",
- "number not available due to interworking",
- "reserved presentation value" };
-
- if(extcallattr)
- {
- llog(LL_CHD, "%05d %s %s", cdid, caller, prstab[prs]);
- }
- else
- {
- DBGL(DL_MSG, (llog(LL_DBG, "%s - %s", caller, prstab[prs])));
- }
- }
-}
-
-/*--------------------------------------------------------------------------*
- * check if the time is valid for an entry
- *--------------------------------------------------------------------------*/
-static int
-isvalidtime(cfg_entry_t *cep)
-{
- time_t t;
- struct tm *tp;
-
- if(cep->day == 0)
- return(1);
-
- t = time(NULL);
- tp = localtime(&t);
-
- if(cep->day & HD)
- {
- if(isholiday(tp->tm_mday, (tp->tm_mon)+1, (tp->tm_year)+1900))
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isvalidtime: holiday %d.%d.%d", tp->tm_mday, (tp->tm_mon)+1, (tp->tm_year)+1900)));
- goto dayok;
- }
- }
-
- if(cep->day & (1 << tp->tm_wday))
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isvalidtime: day match")));
- goto dayok;
- }
-
- return(0);
-
-dayok:
- if(cep->fromhr==0 && cep->frommin==0 && cep->tohr==0 && cep->tomin==0)
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isvalidtime: no time specified, match!")));
- return(1);
- }
-
- if(cep->tohr < cep->fromhr)
- {
- /* before 00:00 */
-
- if( (tp->tm_hour > cep->fromhr) ||
- (tp->tm_hour == cep->fromhr && tp->tm_min > cep->frommin) )
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isvalidtime: t<f-1, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
- cep->fromhr, cep->frommin,
- cep->tohr, cep->tomin,
- tp->tm_hour, tp->tm_min)));
-
- return(1);
- }
-
- /* after 00:00 */
-
- if( (tp->tm_hour < cep->tohr) ||
- (tp->tm_hour == cep->tohr && tp->tm_min < cep->tomin) )
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isvalidtime: t<f-2, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
- cep->fromhr, cep->frommin,
- cep->tohr, cep->tomin,
- tp->tm_hour, tp->tm_min)));
-
- return(1);
- }
- }
- else if(cep->fromhr == cep->tohr)
- {
- if(tp->tm_min >= cep->frommin && tp->tm_min < cep->tomin)
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isvalidtime: f=t, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
- cep->fromhr, cep->frommin,
- cep->tohr, cep->tomin,
- tp->tm_hour, tp->tm_min)));
-
- return(1);
- }
- }
- else
- {
- if((tp->tm_hour > cep->fromhr && tp->tm_hour < cep->tohr) ||
- (tp->tm_hour == cep->fromhr && tp->tm_min >= cep->frommin) ||
- (tp->tm_hour == cep->tohr && tp->tm_min < cep->tomin) )
- {
- DBGL(DL_VALID, (llog(LL_DBG, "isvalidtime: t>f, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
- cep->fromhr, cep->frommin,
- cep->tohr, cep->tomin,
- tp->tm_hour, tp->tm_min)));
- return(1);
- }
- }
- DBGL(DL_VALID, (llog(LL_DBG, "isvalidtime: spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, no match!",
- cep->fromhr, cep->frommin,
- cep->tohr, cep->tomin,
- tp->tm_hour, tp->tm_min)));
-
- return(0);
-}
-
-/*--------------------------------------------------------------------------*
- * prepend national or international prefix to a number
- *--------------------------------------------------------------------------*/
-int add_number_prefix(char *number, int type_of_number)
-{
- char tmp[TELNO_MAX];
- char *prefix;
- int result = 0;
-
- if (type_of_number == TON_NATIONAL || type_of_number == TON_INTERNAT)
- {
- if (type_of_number == TON_NATIONAL)
- prefix = prefixnational;
- else
- prefix = prefixinternational;
-
- /* Add prefix only if not already there */
- if (strncmp(number, prefix, strlen(prefix)) != 0)
- {
- snprintf(tmp, sizeof(tmp)-1, "%s%s", prefix, number);
- strncpy(number, tmp, TELNO_MAX-1);
- result = 1;
- }
- }
-
- return result;
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnd/timer.c b/usr.sbin/i4b/isdnd/timer.c
deleted file mode 100644
index 90bee19..0000000
--- a/usr.sbin/i4b/isdnd/timer.c
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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 daemon - timer/timing support routines
- * ------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 13:13:13 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include "isdnd.h"
-
-static int hr_callgate(void);
-static void handle_reserved(cfg_entry_t *cep, time_t now);
-static void handle_active(cfg_entry_t *cep, time_t now);
-static void recover_illegal(cfg_entry_t *cep);
-
-/*---------------------------------------------------------------------------*
- * recover from illegal state
- *---------------------------------------------------------------------------*/
-static void
-recover_illegal(cfg_entry_t *cep)
-{
- llog(LL_ERR, "recover_illegal: ERROR, entry %s attempting disconnect!", cep->name);
- sendm_disconnect_req(cep, (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL);
- llog(LL_ERR, "recover_illegal: ERROR, entry %s - reset state/cdid!", cep->name);
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
-}
-
-/*---------------------------------------------------------------------------*
- * start the timer
- *---------------------------------------------------------------------------*/
-void
-start_timer(cfg_entry_t *cep, int seconds)
-{
- cep->timerval = cep->timerremain = seconds;
-}
-
-/*---------------------------------------------------------------------------*
- * stop the timer
- *---------------------------------------------------------------------------*/
-void
-stop_timer(cfg_entry_t *cep)
-{
- cep->timerval = cep->timerremain = 0;
-}
-
-/*---------------------------------------------------------------------------*
- * callgate for handle_recovery()
- *---------------------------------------------------------------------------*/
-static int
-hr_callgate(void)
-{
- static int tv_first = 1;
- static struct timeval tv_last;
- struct timeval tv_now;
-
- /* there must be 1 sec minimum between calls to this section */
-
- if(tv_first)
- {
- gettimeofday(&tv_last, NULL);
- tv_first = 0;
- }
-
- gettimeofday(&tv_now, NULL);
-
- if((tv_now.tv_sec - tv_last.tv_sec) < 1)
- {
-
- DBGL(DL_TIME, (llog(LL_DBG, "time < 1 - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
- return(1);
- }
- else if((tv_now.tv_sec - tv_last.tv_sec) == 1)
- {
- if(((1000000 - tv_last.tv_usec) + tv_now.tv_usec) < 900000)
- {
- DBGL(DL_TIME, (llog(LL_DBG, "time < 900000us - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
- return(1);
- }
- }
-
- DBGL(DL_TIME, (llog(LL_DBG, "time OK! - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
-
- gettimeofday(&tv_last, NULL);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * timeout, recovery and retry handling
- *---------------------------------------------------------------------------*/
-void
-handle_recovery(void)
-{
- cfg_entry_t *cep = NULL;
- int i;
- time_t now;
-
- if(hr_callgate()) /* last call to handle_recovery < 1 sec ? */
- return; /* yes, exit */
-
- now = time(NULL); /* get current time */
-
- /* walk thru all entries, look for work to do */
-
- for(i=0; i < nentries; i++)
- {
- cep = &cfg_entry_tab[i]; /* ptr to config entry */
-
- if(cep->budget_callbackperiod && cep->budget_callbackncalls)
- {
- if(cep->budget_callbackperiod_time <= now)
- {
- DBGL(DL_BDGT, (llog(LL_DBG, "%s: new cback-budget-period (%d s, %d left)",
- cep->name, cep->budget_callbackperiod, cep->budget_callbackncalls_cnt)));
- cep->budget_callbackperiod_time = now + cep->budget_callbackperiod;
- cep->budget_callbackncalls_cnt = cep->budget_callbackncalls;
- }
- }
-
- if(cep->budget_calloutperiod && cep->budget_calloutncalls)
- {
- if(cep->budget_calloutperiod_time <= now)
- {
- DBGL(DL_BDGT, (llog(LL_DBG, "%s: new cout-budget-period (%d s, %d left)",
- cep->name, cep->budget_calloutperiod, cep->budget_calloutncalls_cnt)));
- cep->budget_calloutperiod_time = now + cep->budget_calloutperiod;
- cep->budget_calloutncalls_cnt = cep->budget_calloutncalls;
- }
- }
-
- switch(cep->cdid)
- {
- case CDID_UNUSED: /* entry unused */
- continue;
- break;
-
- case CDID_RESERVED: /* entry reserved */
- handle_reserved(cep, now);
- break;
-
- default: /* entry in use */
- handle_active(cep, now);
- break;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * timeout, recovery and retry handling for active entry
- *---------------------------------------------------------------------------*/
-static void
-handle_active(cfg_entry_t *cep, time_t now)
-{
- switch(cep->state)
- {
- case ST_ACCEPTED:
- if(cep->timerval && (--(cep->timerremain)) <= 0)
- {
- DBGL(DL_RCVRY, (llog(LL_DBG, "handle_active: entry %s, TIMEOUT !!!", cep->name)));
- cep->timerval = cep->timerremain = 0;
- next_state(cep, EV_TIMO);
- }
- break;
-
- case ST_ALERT:
- if(cep->alert_time > 0)
- {
- cep->alert_time--;
- }
- else
- {
- llog(LL_CHD, "%05d %s answering: incoming call from %s to %s",
- cep->cdid, cep->name,
- cep->real_phone_incoming.number,
- cep->local_phone_incoming.number);
- next_state(cep, EV_MCI);
- }
- break;
-
- case ST_ILL:
- recover_illegal(cep);
- break;
-
- default:
- /* check hangup flag: if active, close connection */
-
- if(cep->hangup)
- {
- DBGL(DL_RCVRY, (llog(LL_DBG, "handle_active: entry %s, hangup request!", cep->name)));
- cep->hangup = 0;
- next_state(cep, EV_DRQ);
- }
-
- /* check maximum connect time reached */
-
- if(cep->maxconnecttime > 0 && cep->connect_time > 0)
- {
- int connecttime = (int)difftime(now, cep->connect_time);
- if(connecttime > cep->maxconnecttime)
- {
- DBGL(DL_RCVRY, (llog(LL_DBG,
- "handle_active: entry %s, maxconnecttime %d reached!",
- cep->name, cep->maxconnecttime)));
- next_state(cep, EV_DRQ);
- }
- }
-
- /*
- * if shorthold mode is rates based, check if
- * we entered a time with a new unit length
- */
-
- if(cep->unitlengthsrc == ULSRC_RATE)
- {
- int connecttime = (int)difftime(now, cep->connect_time);
-
- if((connecttime > 1) &&
- (connecttime % 60))
- {
- int newrate = get_current_rate(cep, 0);
-
- if(newrate != cep->unitlength)
- {
- DBGL(DL_MSG, (llog(LL_DBG, "handle_active: rates unit length updated %d -> %d", cep->unitlength, newrate)));
-
- cep->unitlength = newrate;
-
- unitlen_chkupd(cep);
- }
- }
- }
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * timeout, recovery and retry handling for reserved entry
- *---------------------------------------------------------------------------*/
-static void
-handle_reserved(cfg_entry_t *cep, time_t now)
-{
- time_t waittime;
-
- switch(cep->state)
- {
- case ST_DIALRTMRCHD: /* wait for dial retry time reached */
-
- if(cep->dialrandincr)
- waittime = cep->randomtime;
- else
- waittime = cep->recoverytime;
-
-
- if(now > (cep->last_dial_time + waittime))
- {
- DBGL(DL_RCVRY, (llog(LL_DBG, "handle_reserved: entry %s, dial retry request!", cep->name)));
- cep->state = ST_DIALRETRY;
-
- if((cep->cdid = get_cdid()) == 0)
- {
- llog(LL_ERR, "handle_reserved: dialretry get_cdid() returned 0!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
-
- if((setup_dialout(cep)) == GOOD)
- {
- sendm_connect_req(cep);
- }
- else
- {
- llog(LL_ERR, "handle_reserved: dialretry setup_dialout returned ERROR!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- }
- break;
-
-
- case ST_ACB_WAITDIAL: /* active callback wait for time between disconnect and dial */
-
- if(now > (cep->last_release_time + cep->callbackwait))
- {
- DBGL(DL_RCVRY, (llog(LL_DBG, "handle_reserved: entry %s, callback dial!", cep->name)));
- cep->state = ST_ACB_DIAL;
-
- if((cep->cdid = get_cdid()) == 0)
- {
- llog(LL_ERR, "handle_reserved: callback get_cdid() returned 0!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
-
- select_first_dialno(cep);
-
- if((setup_dialout(cep)) == GOOD)
- {
- sendm_connect_req(cep);
- }
- else
- {
- llog(LL_ERR, "handle_reserved: callback setup_dialout returned ERROR!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- }
- break;
-
- case ST_ACB_DIALFAIL: /* callback to remote failed */
-
- if(cep->dialrandincr)
- waittime = cep->randomtime + cep->recoverytime;
- else
- waittime = cep->recoverytime;
-
- if(now > (cep->last_release_time + waittime))
- {
- DBGL(DL_RCVRY, (llog(LL_DBG, "handle_reserved: entry %s, callback dial retry request!", cep->name)));
- cep->state = ST_ACB_DIAL;
-
- if((cep->cdid = get_cdid()) == 0)
- {
- llog(LL_ERR, "handle_reserved: callback dialretry get_cdid() returned 0!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
-
- if((setup_dialout(cep)) == GOOD)
- {
- sendm_connect_req(cep);
- }
- else
- {
- llog(LL_ERR, "handle_reserved: callback dialretry setup_dialout returned ERROR!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- }
- break;
-
- case ST_PCB_WAITCALL: /* wait for remote calling back */
-
- if(now > (cep->last_release_time + cep->calledbackwait))
- {
- cep->dial_count++;
-
- if(cep->dial_count < cep->dialretries)
- {
- /* inside normal retry cycle */
-
- DBGL(DL_RCVRY, (llog(LL_DBG, "handle_reserved: entry %s, retry calledback dial #%d!",
- cep->name, cep->dial_count)));
- cep->state = ST_PCB_DIAL;
-
- if((cep->cdid = get_cdid()) == 0)
- {
- llog(LL_ERR, "handle_reserved: calledback get_cdid() returned 0!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- select_next_dialno(cep);
-
- if((setup_dialout(cep)) == GOOD)
- {
- sendm_connect_req(cep);
- }
- else
- {
- llog(LL_ERR, "handle_reserved: calledback setup_dialout returned ERROR!");
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- return;
- }
- }
- else
- {
- /* retries exhausted */
-
- DBGL(DL_RCVRY, (llog(LL_DBG, "handle_reserved: calledback dial retries exhausted")));
- dialresponse(cep, DSTAT_TFAIL);
- cep->cdid = CDID_UNUSED;
- cep->dial_count = 0;
- cep->state = ST_IDLE;
- }
- }
- break;
-
- case ST_DOWN: /* interface was taken down */
-
- if(now > (cep->went_down_time + cep->downtime))
- {
- DBGL(DL_RCVRY, (llog(LL_DBG, "handle_reserved: taking %s%d up", bdrivername(cep->usrdevicename), cep->usrdeviceunit)));
- if_up(cep);
- cep->state = ST_IDLE;
- cep->cdid = CDID_UNUSED;
- }
- break;
-
- case ST_ILL: /* illegal state reached, recover ! */
-
- recover_illegal(cep);
- break;
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndebug/Makefile b/usr.sbin/i4b/isdndebug/Makefile
deleted file mode 100644
index 5a31de9..0000000
--- a/usr.sbin/i4b/isdndebug/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# $FreeBSD$
-
-PROG= isdndebug
-MAN= isdndebug.8
-SRCS= main.c
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdndebug/isdndebug.8 b/usr.sbin/i4b/isdndebug/isdndebug.8
deleted file mode 100644
index 0a9f24c..0000000
--- a/usr.sbin/i4b/isdndebug/isdndebug.8
+++ /dev/null
@@ -1,111 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2000 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.
-.\"
-.\" $Id: isdndebug.8,v 1.11 2000/05/31 08:15:29 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Wed May 31 10:15:07 2000]
-.\"
-.Dd May 31, 2000
-.Dt ISDNDEBUG 8
-.Os
-.Sh NAME
-.Nm isdndebug
-.Nd display and control isdn4bsd kernel variables and statistics
-.Sh SYNOPSIS
-.Nm
-.Op Fl c
-.Op Fl e
-.Op Fl g
-.Op Fl l Ar layer
-.Op Fl m
-.Op Fl q
-.Op Fl r
-.Op Fl s Ar value
-.Op Fl u Ar unit
-.Op Fl z
-.Op Fl C
-.Op Fl Q
-.Sh DESCRIPTION
-The
-.Nm
-utility is part of the isdn4bsd package and is used to control the level of
-debugging output of the isdn4bsd kernel part.
-Every layer of the isdn4bsd kernel uses a debugging mask which can be
-manipulated using this utility.
-.Pp
-A second usage of
-.Nm
-is to display and reset chipset specific statistics and/or error counters
-and to display and reset the D-channel layer 2
-(Q.921 LAPD protocol) statistics and error counters.
-.Pp
-The following options are available:
-.Bl -tag -width Ds
-.It Fl c
-Display chipset specific statistics and/or error counters.
-.It Fl e
-Set debugging mask for the selected layer(s) to display errors only.
-.It Fl g
-Get the debugging mask for the selected layer(s).
-.It Fl l
-Specify the layer for which a command applies.
-Default is all layers.
-.It Fl m
-Set debugging mask for the selected layer(s) to display all possible
-debugging messages (maximum output).
-.It Fl q
-Display the Q.921 (D-channel layer 2) frame receive/transmit statistics.
-.It Fl r
-Set debugging mask for the selected layer(s) to the compiled in default
-(reset).
-.It Fl s
-Set debugging mask for the selected layer(s) to value.
-Value can be
-specified in any number base supported by
-.Xr sscanf 3 .
-.It Fl u
-Set the unit numbers for the -c, -q, -C and -Q flags.
-.It Fl z
-Set debugging mask for the selected layer(s) to no output at all (zero).
-.It Fl H
-Reset the chipset specific statistics and/or error counters to zero.
-.It Fl Q
-Reset the Q.921 (D-channel layer 2) frame receive/transmit statistics to zero.
-.El
-.Sh FILES
-/dev/i4bctl
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-isdndebug -g
-.Ed
-.Pp
-displays the current debugging level for all ISDN layers
-.Sh AUTHORS
-The
-.Nm
-utility and this manpage were written by
-.An Hellmuth Michaelis Aq hm@kts.org .
diff --git a/usr.sbin/i4b/isdndebug/main.c b/usr.sbin/i4b/isdndebug/main.c
deleted file mode 100644
index 3586173..0000000
--- a/usr.sbin/i4b/isdndebug/main.c
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
- * Copyright (c) 1997, 2001 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.
- *
- *---------------------------------------------------------------------------
- *
- * main.c - i4b set debug options
- * ------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon May 21 10:09:23 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#include <i4b/i4b_debug.h>
-#include <i4b/i4b_ioctl.h>
-
-char *bin_str(unsigned long val, int length);
-
-static void usage ( void );
-void printl1(unsigned long val);
-void printl2(unsigned long val);
-void printl3(unsigned long val);
-void printl4(unsigned long val);
-
-static int isdnfd;
-
-#define I4BCTLDEVICE "/dev/i4bctl"
-
-int opt_get = 0;
-int opt_layer = -1;
-int opt_set = 0;
-int opt_setval;
-int opt_reset = 0;
-int opt_max = 0;
-int opt_err = 0;
-int opt_zero = 0;
-int opt_unit = 0;
-int opt_lapd = 0;
-int opt_rlapd = 0;
-int opt_chipstat = 0;
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdndebug - i4b set debug level, version %d.%d.%d\n", VERSION, REL, STEP);
- fprintf(stderr, "usage: isdndebug -c -e -g -l <layer> -m -q -r -s <value> -u <unit> -z -C -Q\n");
- fprintf(stderr, " -c get chipset statistics\n");
- fprintf(stderr, " -e set error only debugging output\n");
- fprintf(stderr, " -g get current debugging values\n");
- fprintf(stderr, " -l layer specify layer (1...4)\n");
- fprintf(stderr, " -m set maximum debugging output\n");
- fprintf(stderr, " -q get Q.921 statistics\n");
- fprintf(stderr, " -r reset values(s) to compiled in default\n");
- fprintf(stderr, " -s value set new debugging value for layer\n");
- fprintf(stderr, " -u unit unit number for -c, -q, -C and -Q commands\n");
- fprintf(stderr, " -z set zero (=no) debugging output\n");
- fprintf(stderr, " -C reset chipset statistics\n");
- fprintf(stderr, " -Q reset Q.921 statistics\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int c;
- ctl_debug_t cdbg;
- int ret;
-
- while ((c = getopt(argc, argv, "ceghl:mqrs:u:zCHQ")) != -1)
- {
- switch(c)
- {
- case 'c':
- opt_chipstat = 1;
- break;
-
- case 'e':
- opt_err = 1;
- break;
-
- case 'g':
- opt_get = 1;
- break;
-
- case 'q':
- opt_lapd = 1;
- break;
-
- case 'r':
- opt_reset = 1;
- break;
-
- case 'm':
- opt_max = 1;
- break;
-
- case 'l':
- opt_layer = atoi(optarg);
- if(opt_layer < 1 || opt_layer > 4)
- usage();
- break;
-
- case 's':
- if((sscanf(optarg, "%i", &opt_setval)) != 1)
- usage();
- opt_set = 1;
- break;
-
- case 'u':
- opt_unit = atoi(optarg);
- if(opt_unit < 0 || opt_unit > 9)
- usage();
- break;
-
- case 'z':
- opt_zero = 1;
- break;
-
- case 'Q':
- opt_rlapd = 1;
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(opt_get == 0 && opt_set == 0 && opt_reset == 0 && opt_max == 0 &&
- opt_err == 0 && opt_zero == 0 && opt_lapd == 0 && opt_rlapd == 0 &&
- opt_chipstat == 0)
- {
- usage();
- }
-
- if((opt_get + opt_set + opt_reset + opt_max + opt_err + opt_zero +
- opt_lapd + opt_rlapd + opt_chipstat) > 1)
- {
- usage();
- }
-
- if((isdnfd = open(I4BCTLDEVICE, O_RDWR)) < 0)
- {
- fprintf(stderr, "i4bctl: cannot open %s: %s\n", I4BCTLDEVICE, strerror(errno));
- exit(1);
- }
-
- if(opt_chipstat)
- {
- struct chipstat cst;
- u_char *name;
-
- cst.driver_unit = opt_unit;
- cst.driver_bchannel = 0;
-
- if((ret = ioctl(isdnfd, I4B_CTL_GET_CHIPSTAT, &cst)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_GET_CHIPSTAT failed: %s", strerror(errno));
- exit(1);
- }
-
- switch(cst.driver_type)
- {
- case L1DRVR_ISIC:
- name = "isic";
- printf("\nisic-driver\nHSCX events: VFR RDO CRC RAB XDU RFO\n");
-
- printf("unit %d chan %d: %6d %6d %6d %6d %6d %6d\n",
- cst.stats.hscxstat.unit,
- cst.stats.hscxstat.chan,
- cst.stats.hscxstat.vfr,
- cst.stats.hscxstat.rdo,
- cst.stats.hscxstat.crc,
- cst.stats.hscxstat.rab,
- cst.stats.hscxstat.xdu,
- cst.stats.hscxstat.rfo);
-
- cst.driver_unit = opt_unit;
- cst.driver_bchannel = 1;
-
- if((ret = ioctl(isdnfd, I4B_CTL_GET_CHIPSTAT, &cst)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_GET_CHIPSTAT failed: %s", strerror(errno));
- exit(1);
- }
-
- printf("HSCX events: VFR RDO CRC RAB XDU RFO\n");
-
- printf("unit %d chan %d: %6d %6d %6d %6d %6d %6d\n",
- cst.stats.hscxstat.unit,
- cst.stats.hscxstat.chan,
- cst.stats.hscxstat.vfr,
- cst.stats.hscxstat.rdo,
- cst.stats.hscxstat.crc,
- cst.stats.hscxstat.rab,
- cst.stats.hscxstat.xdu,
- cst.stats.hscxstat.rfo);
-
- break;
-
- case L1DRVR_IWIC:
- name = "iwic";
- break;
-
- case L1DRVR_IFPI:
- name = "ifpi";
- break;
-
- case L1DRVR_IHFC:
- name = "ihfc";
- break;
-
- case L1DRVR_IFPNP:
- name = "ifpnp";
- break;
-
- default:
- fprintf(stderr, "ioctl I4B_CTL_GET_CHIPSTAT, unknown driver %d\n",cst.driver_type);
- exit(1);
- break;
- }
- exit(0);
- }
-
- if(opt_lapd)
- {
- l2stat_t l2s;
-
- l2s.unit = opt_unit;
-
- if((ret = ioctl(isdnfd, I4B_CTL_GET_LAPDSTAT, &l2s)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_GET_LAPDSTAT failed: %s", strerror(errno));
- exit(1);
- }
-
- printf("unit %d Q.921 statistics: receive transmit\n", opt_unit);
- printf("---------------------------------------------\n");
- printf("# of I-frames %12lu %12lu\n", l2s.lapdstat.rx_i, l2s.lapdstat.tx_i);
- printf("# of RR-frames %12lu %12lu\n", l2s.lapdstat.rx_rr, l2s.lapdstat.tx_rr);
- printf("# of RNR-frames %12lu %12lu\n", l2s.lapdstat.rx_rnr, l2s.lapdstat.tx_rnr);
- printf("# of REJ-frames %12lu %12lu\n", l2s.lapdstat.rx_rej, l2s.lapdstat.tx_rej);
- printf("# of SABME-frames %12lu %12lu\n", l2s.lapdstat.rx_sabme, l2s.lapdstat.tx_sabme);
- printf("# of DM-frames %12lu %12lu\n", l2s.lapdstat.rx_dm, l2s.lapdstat.tx_dm);
- printf("# of DISC-frames %12lu %12lu\n", l2s.lapdstat.rx_disc, l2s.lapdstat.tx_disc);
- printf("# of UA-frames %12lu %12lu\n", l2s.lapdstat.rx_ua, l2s.lapdstat.tx_ua);
- printf("# of FRMR-frames %12lu %12lu\n", l2s.lapdstat.rx_frmr, l2s.lapdstat.tx_frmr);
- printf("# of TEI-frames %12lu %12lu\n", l2s.lapdstat.rx_tei, l2s.lapdstat.tx_tei);
- printf("# of UI-frames %12lu \n", l2s.lapdstat.rx_ui);
- printf("# of XID-frames %12lu \n", l2s.lapdstat.rx_xid);
- printf(" errors\n");
- printf("---------------------------------------------\n");
- printf("# of frames with incorrect length%12lu\n", l2s.lapdstat.err_rx_len);
- printf("# of frames with bad frame type %12lu\n", l2s.lapdstat.err_rx_badf);
- printf("# of bad S frames %12lu\n", l2s.lapdstat.err_rx_bads);
- printf("# of bad U frames %12lu\n", l2s.lapdstat.err_rx_badu);
- printf("# of bad UI frames %12lu\n", l2s.lapdstat.err_rx_badui);
-
- exit(0);
- }
-
- if(opt_rlapd)
- {
- int unit;
-
- unit = opt_unit;
-
- if((ret = ioctl(isdnfd, I4B_CTL_CLR_LAPDSTAT, &unit)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_CLR_LAPDSTAT failed: %s", strerror(errno));
- exit(1);
- }
-
- printf("Q.921 statistics counters unit %d reset to zero!\n", unit);
- exit(0);
- }
-
- if((ret = ioctl(isdnfd, I4B_CTL_GET_DEBUG, &cdbg)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_GET_DEBUG failed: %s", strerror(errno));
- exit(1);
- }
-
- if(opt_get)
- {
- switch(opt_layer)
- {
- case -1:
- printl1(cdbg.l1);
- printl2(cdbg.l2);
- printl3(cdbg.l3);
- printl4(cdbg.l4);
- break;
-
- case 1:
- printl1(cdbg.l1);
- break;
-
- case 2:
- printl2(cdbg.l2);
- break;
-
- case 3:
- printl3(cdbg.l3);
- break;
-
- case 4:
- printl4(cdbg.l4);
- break;
- }
- printf("\n");
- return(0);
- }
- else if(opt_set)
- {
- switch(opt_layer)
- {
- case -1:
- usage();
- break;
-
- case 1:
- cdbg.l1 = opt_setval;
- break;
-
- case 2:
- cdbg.l2 = opt_setval;
- break;
-
- case 3:
- cdbg.l3 = opt_setval;
- break;
-
- case 4:
- cdbg.l4 = opt_setval;
- break;
- }
- }
- else if(opt_reset)
- {
- switch(opt_layer)
- {
- case -1:
- cdbg.l1 = L1_DEBUG_DEFAULT;
- cdbg.l2 = L2_DEBUG_DEFAULT;
- cdbg.l3 = L3_DEBUG_DEFAULT;
- cdbg.l4 = L4_DEBUG_DEFAULT;
- break;
-
- case 1:
- cdbg.l1 = L1_DEBUG_DEFAULT;
- break;
-
- case 2:
- cdbg.l2 = L2_DEBUG_DEFAULT;
- break;
-
- case 3:
- cdbg.l3 = L3_DEBUG_DEFAULT;
- break;
-
- case 4:
- cdbg.l4 = L4_DEBUG_DEFAULT;
- break;
- }
- }
- else if(opt_max)
- {
- switch(opt_layer)
- {
- case -1:
- cdbg.l1 = L1_DEBUG_MAX;
- cdbg.l2 = L2_DEBUG_MAX;
- cdbg.l3 = L3_DEBUG_MAX;
- cdbg.l4 = L4_DEBUG_MAX;
- break;
-
- case 1:
- cdbg.l1 = L1_DEBUG_MAX;
- break;
-
- case 2:
- cdbg.l2 = L2_DEBUG_MAX;
- break;
-
- case 3:
- cdbg.l3 = L3_DEBUG_MAX;
- break;
-
- case 4:
- cdbg.l4 = L4_DEBUG_MAX;
- break;
- }
- }
- else if(opt_err)
- {
- switch(opt_layer)
- {
- case -1:
- cdbg.l1 = L1_DEBUG_ERR;
- cdbg.l2 = L2_DEBUG_ERR;
- cdbg.l3 = L3_DEBUG_ERR;
- cdbg.l4 = L4_DEBUG_ERR;
- break;
-
- case 1:
- cdbg.l1 = L1_DEBUG_ERR;
- break;
-
- case 2:
- cdbg.l2 = L2_DEBUG_ERR;
- break;
-
- case 3:
- cdbg.l3 = L3_DEBUG_ERR;
- break;
-
- case 4:
- cdbg.l4 = L4_DEBUG_ERR;
- break;
- }
- }
- else if(opt_zero)
- {
- switch(opt_layer)
- {
- case -1:
- cdbg.l1 = 0;
- cdbg.l2 = 0;
- cdbg.l3 = 0;
- cdbg.l4 = 0;
- break;
-
- case 1:
- cdbg.l1 = 0;
- break;
-
- case 2:
- cdbg.l2 = 0;
- break;
-
- case 3:
- cdbg.l3 = 0;
- break;
-
- case 4:
- cdbg.l4 = 0;
- break;
- }
- }
- else
- {
- exit(1);
- }
-
- if((ret = ioctl(isdnfd, I4B_CTL_SET_DEBUG, &cdbg)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CTL_SET_DEBUG failed: %s", strerror(errno));
- exit(1);
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * return ptr to string of 1's and 0's for value
- *---------------------------------------------------------------------------*/
-char *
-bin_str(unsigned long val, int length)
-{
- static char buffer[80];
- int i = 0;
-
- if (length > 32)
- length = 32;
-
- val = val << (32 - length);
-
- while (length--)
- {
- if (val & 0x80000000)
- buffer[i++] = '1';
- else
- buffer[i++] = '0';
- if ((length % 4) == 0 && length)
- buffer[i++] = '.';
- val = val << 1;
- }
- return (buffer);
-}
-
-/*---------------------------------------------------------------------------*
- * print l1 info
- *---------------------------------------------------------------------------*/
-void
-printl1(unsigned long val)
-{
- printf("\nLayer 1: %s = 0x%lX\n", bin_str(val, 32), val);
- printf(" | |||| |||| |||| ||||\n"),
- printf(" | |||| |||| |||| |||+- general error messages\n");
- printf(" | |||| |||| |||| ||+-- PH primitives exchanged\n");
- printf(" | |||| |||| |||| |+--- B channel actions\n");
- printf(" | |||| |||| |||| +---- HSCX error messages\n");
- printf(" | |||| |||| |||+------ HSCX IRQ messages\n");
- printf(" | |||| |||| ||+------- ISAC error messages\n");
- printf(" | |||| |||| |+-------- ISAC messages\n");
- printf(" | |||| |||| +--------- ISAC setup messages\n");
- printf(" | |||| |||+----------- FSM general messages\n");
- printf(" | |||| ||+------------ FSM error messages\n");
- printf(" | |||| |+------------- timer general messages\n");
- printf(" | |||| +-------------- timer error messages\n");
- printf(" | |||+---------------- HSCX data xfer errors msgs\n");
- printf(" | ||+----------------- ISAC CICO messages\n");
- printf(" | |+------------------ silent messages (soft-HDLC)\n");
- printf(" | +------------------- error messages (soft-HDLC)\n");
- printf(" +--------------------- HFC-S PCI debug messages\n");
- printf(" ++++-++++-++++-+++---------------------- unassigned\n");
-}
-
-/*---------------------------------------------------------------------------*
- * print l2 info
- *---------------------------------------------------------------------------*/
-void
-printl2(unsigned long val)
-{
- printf("\nLayer 2: %s = 0x%lX\n", bin_str(val, 32), val);
- printf(" || |||| |||| ||||\n"),
- printf(" || |||| |||| |||+- general error messages\n");
- printf(" || |||| |||| ||+-- DL primitives exchanged\n");
- printf(" || |||| |||| |+--- U frame messages\n");
- printf(" || |||| |||| +---- U frame error messages\n");
- printf(" || |||| |||+------ S frame messages\n");
- printf(" || |||| ||+------- S frame error messages\n");
- printf(" || |||| |+-------- I frame messages\n");
- printf(" || |||| +--------- I frame error messages\n");
- printf(" || |||+----------- FSM general messages\n");
- printf(" || ||+------------ FSM error messages\n");
- printf(" || |+------------- timer general messages\n");
- printf(" || +-------------- timer error messages\n");
- printf(" |+---------------- TEI general messages\n");
- printf(" +----------------- TEI error messages\n");
- printf(" ++++-++++-++++-++++-++------------------ unassigned\n");
-}
-
-/*---------------------------------------------------------------------------*
- * print l3 info
- *---------------------------------------------------------------------------*/
-void
-printl3(unsigned long val)
-{
- printf("\nLayer 3: %s = 0x%lX\n", bin_str(val, 32), val);
- printf(" ||| |||| ||||\n"),
- printf(" ||| |||| |||+- general error messages\n");
- printf(" ||| |||| ||+-- general messages\n");
- printf(" ||| |||| |+--- FSM messages\n");
- printf(" ||| |||| +---- FSM error messages\n");
- printf(" ||| |||+------ timer messages\n");
- printf(" ||| ||+------- timer error messages\n");
- printf(" ||| |+-------- protocol messages\n");
- printf(" ||| +--------- protocol error messages\n");
- printf(" ||+----------- facility messages\n");
- printf(" |+------------ facility error messages\n");
- printf(" +------------- Q.931 messages exchanged\n");
- printf(" ++++-++++-++++-++++-++++-+-------------- unassigned\n");
-}
-
-/*---------------------------------------------------------------------------*
- * print l4 info
- *---------------------------------------------------------------------------*/
-void
-printl4(unsigned long val)
-{
- printf("\nLayer 4: %s = 0x%lX\n", bin_str(val, 32), val);
- printf(" ||| |||| ||||\n"),
- printf(" ||| |||| |||+- general error messages\n");
- printf(" ||| |||| ||+-- general messages\n");
- printf(" ||| |||| |+--- B-ch timeout messages\n");
- printf(" ||| |||| +---- network driver dial state\n");
- printf(" ||| |||+------ ipr driver debug messages\n");
- printf(" ||| ||+------- rbch driver debug messages\n");
- printf(" ||| |+-------- isp driver debug messages\n");
- printf(" ||| +--------- tel driver debug messages\n");
- printf(" ||+----------- ing driver debug messages\n");
- printf(" |+------------ iavc driver debug messages\n");
- printf(" +------------- capi driver debug messages\n");
- printf(" ++++-++++-++++-++++-++++---------------- unassigned\n");
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/Makefile b/usr.sbin/i4b/isdndecode/Makefile
deleted file mode 100644
index 9dbd971..0000000
--- a/usr.sbin/i4b/isdndecode/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# $FreeBSD$
-
-PROG= isdndecode
-MAN= isdndecode.8
-SRCS= main.c layer1.c layer2.c layer3.c layer3_subr.c facility.c pcause.c
-
-.include <bsd.prog.mk>
-
diff --git a/usr.sbin/i4b/isdndecode/decode.h b/usr.sbin/i4b/isdndecode/decode.h
deleted file mode 100644
index 7eb544b..0000000
--- a/usr.sbin/i4b/isdndecode/decode.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * decode.h - isdndecode header file
- * ---------------------------------
- *
- * $Id: decode.h,v 1.6 1999/12/13 21:25:25 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:49:50 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <sys/uio.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/file.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-
-#include "pcause.h"
-
-#define I4BTRC_DEVICE "/dev/i4btrc" /* trace device file */
-#define DECODE_FILE_NAME "isdndecode" /* default output filename */
-#define DECODE_FILE_NAME_BAK ".last" /* backup filename trailer */
-#define BIN_FILE_NAME "isdntracebin" /* default binary filename */
-
-#define BSIZE 4096 /* read buffer size */
-#define NCOLS 80 /* screen width */
-
-#define RxUDEF 0 /* analyze mode, default unit for receiver side */
-#define TxUDEF 1 /* analyze mode, default unit for transmitter side */
-
-void layer1(char *pbuf, unsigned char *buf);
-int layer2(char *pbuf, unsigned char *buf, int is_te, int printit);
-void layer3(char *pbuf, int n, int off, unsigned char *buf);
-int q932_facility(char *pbuf, unsigned char *buf);
-void sprintline(int, char *, int, int, int, const char *, ...);
-void extension(int, char *, int, unsigned char, unsigned char);
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/facility.c b/usr.sbin/i4b/isdndecode/facility.c
deleted file mode 100644
index c4502a8..0000000
--- a/usr.sbin/i4b/isdndecode/facility.c
+++ /dev/null
@@ -1,1111 +0,0 @@
-/*
- * Copyright (c) 1997, 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * facility.c - decode Q.932 facilities
- * ------------------------------------
- *
- * $Id: facility.c,v 1.5 2000/02/21 15:17:17 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Feb 21 16:15:43 2000]
- *
- *---------------------------------------------------------------------------
- *
- * - 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 !)
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-#include "facility.h"
-
-static int do_component(int length, char *pbuf);
-static char *uni_str(int code);
-static char *opval_str(int val);
-static char *bid_str(int val);
-static void next_state(char *pbuf, int class, int form, int code, int val);
-
-static int byte_len;
-static unsigned char *byte_buf;
-static int state;
-
-/*---------------------------------------------------------------------------*
- * decode Q.931/Q.932 facility info element
- *---------------------------------------------------------------------------*/
-int
-q932_facility(char *pbuf, unsigned char *buf)
-{
- int len;
-
- sprintf((pbuf+strlen(pbuf)), "[facility (Q.932): ");
-
- buf++; /* length */
-
- len = *buf;
-
- buf++; /* protocol profile */
-
- sprintf((pbuf+strlen(pbuf)), "Protocol=");
-
- switch(*buf & 0x1f)
- {
- case FAC_PROTO_ROP:
- sprintf((pbuf+strlen(pbuf)), "Remote Operations Protocol\n");
- break;
-
- case FAC_PROTO_CMIP:
- sprintf((pbuf+strlen(pbuf)), "CMIP Protocol (Q.941), UNSUPPORTED!\n");
- return(len+2);
- break;
-
- case FAC_PROTO_ACSE:
- sprintf((pbuf+strlen(pbuf)), "ACSE Protocol (X.217/X.227), UNSUPPORTED!\n");
- return(len+2);
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "Unknown Protocol (val = 0x%x), UNSUPPORTED!\n", *buf & 0x1f);
- return(len+2);
- break;
- }
-
- /* 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, pbuf);
-
- sprintf((pbuf+(strlen(pbuf)-1)), "]"); /* XXX replace last newline */
-
- return(len+3);
-}
-
-/*---------------------------------------------------------------------------*
- * handle a component recursively
- *---------------------------------------------------------------------------*/
-static int
-do_component(int length, char *pbuf)
-{
- 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 */
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "ENTER - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
-
-again:
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "AGAIN - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
-
- /*----------------------------------------*/
- /* first component element: component tag */
- /*----------------------------------------*/
-
- /* tag class bits */
-
- sprintf((pbuf+strlen(pbuf)), "\t0x%02x Tag: ", *byte_buf);
-
- comp_tag_class = (*byte_buf & 0xc0) >> 6;
-
- switch(comp_tag_class)
- {
- case FAC_TAGCLASS_UNI:
- sprintf((pbuf+strlen(pbuf)), "Universal");
- break;
- case FAC_TAGCLASS_APW:
- sprintf((pbuf+strlen(pbuf)), "Applic-wide");
- break;
- case FAC_TAGCLASS_COS:
- sprintf((pbuf+strlen(pbuf)), "Context-spec");
- break;
- case FAC_TAGCLASS_PRU:
- sprintf((pbuf+strlen(pbuf)), "Private");
- break;
- }
-
- /* tag form bit */
-
- comp_tag_form = (*byte_buf & 0x20) > 5;
-
- sprintf((pbuf+strlen(pbuf)), ", ");
-
- if(comp_tag_form == FAC_TAGFORM_CON)
- {
- sprintf((pbuf+strlen(pbuf)), "Constructor");
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "Primitive");
- }
-
- /* tag code bits */
-
- comp_tag_code = *byte_buf & 0x1f;
-
- sprintf((pbuf+strlen(pbuf)), ", ");
-
- 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);
- sprintf((pbuf+strlen(pbuf)), "%d (ext)\n", comp_tag_code);
- }
- else
- {
- comp_tag_code = (*byte_buf & 0x1f);
-
- if(comp_tag_class == FAC_TAGCLASS_UNI)
- {
- sprintf((pbuf+strlen(pbuf)), "%s (%d)\n", uni_str(comp_tag_code), comp_tag_code);
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "code = %d\n", comp_tag_code);
- }
- }
-
- byte_buf++;
- byte_len++;
-
- /*--------------------------------------------*/
- /* second component element: component length */
- /*--------------------------------------------*/
-
- sprintf((pbuf+strlen(pbuf)), "\t0x%02x Len: ", *byte_buf);
-
- 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));
- }
- sprintf((pbuf+strlen(pbuf)), "%d (long form)\n", comp_length);
- }
- else
- {
- comp_length = *byte_buf & 0x7f;
- sprintf((pbuf+strlen(pbuf)), "%d (short form)\n", comp_length);
- }
-
- next_state(pbuf, comp_tag_class, comp_tag_form, comp_tag_code, -1);
-
- byte_len++;
- byte_buf++;
-
- if(comp_length)
- {
-
- /*---------------------------------------------*/
- /* third component element: component contents */
- /*---------------------------------------------*/
-
- if(comp_tag_form) /* == constructor */
- {
- do_component(comp_length, pbuf);
- }
- 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;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x ", *byte_buf);
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- sprintf((pbuf+strlen(pbuf)), "Val: %d\n", val);
- }
- break;
- default:
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x = %d", *byte_buf, *byte_buf);
- if(isprint(*byte_buf))
- sprintf((pbuf+strlen(pbuf)), " = '%c'", *byte_buf);
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- }
- break;
- }
- }
-
- else /* comp_tag_class != FAC_TAGCLASS_UNI */
- {
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x", *byte_buf);
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- sprintf((pbuf+strlen(pbuf)), "\n");
- }
- }
- next_state(pbuf, comp_tag_class, comp_tag_form, comp_tag_code, val);
- }
- }
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "PREGOTO - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
- if(byte_len < length)
- goto again;
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "RETURN - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
- return(byte_len);
-}
-
-/*---------------------------------------------------------------------------*
- * print universal id type
- *---------------------------------------------------------------------------*/
-static char *uni_str(int code)
-{
- static char *tbl[] = {
- "BOOLEAN",
- "INTEGER",
- "BIT STRING",
- "OCTET STRING",
- "NULL",
- "OBJECT IDENTIFIER",
- "OBJECT DESCRIPTOR",
- "EXTERNAL",
- "REAL",
- "ENUMERATED",
- "RESERVED11",
- "RESERVED12",
- "RESERVED13",
- "RESERVED14",
- "RESERVED15",
- "SEQUENCE",
- "SET",
- "NUMERIC STRING",
- "PRINTABLE STRING",
- "TELETEX STRING",
- "ISO646 STRING",
- "IA5 STRING",
- "GRAPHIC STRING",
- "GENERAL STRING"
- };
-
- if(code >= 1 && code <= FAC_CODEUNI_GNSTR)
- return(tbl[code-1]);
- else
- return("ERROR, Value out of Range!");
-}
-
-/*---------------------------------------------------------------------------*
- * print operation value
- *---------------------------------------------------------------------------*/
-static char *opval_str(int val)
-{
- static char buffer[80];
- char *r;
-
- switch(val)
- {
- case FAC_OPVAL_UUS:
- r = "uUs";
- break;
- case FAC_OPVAL_CUG:
- r = "cUGCall";
- break;
- case FAC_OPVAL_MCID:
- r = "mCIDRequest";
- break;
- case FAC_OPVAL_BTPY:
- r = "beginTPY";
- break;
- case FAC_OPVAL_ETPY:
- r = "endTPY";
- break;
- case FAC_OPVAL_ECT:
- r = "eCTRequest";
- break;
- case FAC_OPVAL_DIV_ACT:
- r = "activationDiversion";
- break;
- case FAC_OPVAL_DIV_DEACT:
- r = "deactivationDiversion";
- break;
- case FAC_OPVAL_DIV_ACTSN:
- r = "activationStatusNotificationDiv";
- break;
- case FAC_OPVAL_DIV_DEACTSN:
- r = "deactivationStatusNotificationDiv";
- break;
- case FAC_OPVAL_DIV_INTER:
- r = "interrogationDiversion";
- break;
- case FAC_OPVAL_DIV_INFO:
- r = "diversionInformation";
- break;
- case FAC_OPVAL_DIV_CALLDEF:
- r = "callDeflection";
- break;
- case FAC_OPVAL_DIV_CALLRER:
- r = "callRerouting";
- break;
- case FAC_OPVAL_DIV_LINF2:
- r = "divertingLegInformation2";
- break;
- case FAC_OPVAL_DIV_INVS:
- r = "invokeStatus";
- break;
- case FAC_OPVAL_DIV_INTER1:
- r = "interrogationDiversion1";
- break;
- case FAC_OPVAL_DIV_LINF1:
- r = "divertingLegInformation1";
- break;
- case FAC_OPVAL_DIV_LINF3:
- r = "divertingLegInformation3";
- break;
- case FAC_OPVAL_ER_CRCO:
- r = "explicitReservationCreationControl";
- break;
- case FAC_OPVAL_ER_MGMT:
- r = "explicitReservationManagement";
- break;
- case FAC_OPVAL_ER_CANC:
- r = "explicitReservationCancel";
- break;
- case FAC_OPVAL_MLPP_QUERY:
- r = "mLPP lfb Query";
- break;
- case FAC_OPVAL_MLPP_CALLR:
- r = "mLPP Call Request";
- break;
- case FAC_OPVAL_MLPP_CALLP:
- r = "mLPP Call Preemption";
- break;
- case FAC_OPVAL_AOC_REQ:
- r = "chargingRequest";
- break;
- case FAC_OPVAL_AOC_S_CUR:
- r = "aOCSCurrency";
- break;
- case FAC_OPVAL_AOC_S_SPC:
- r = "aOCSSpecialArrangement";
- break;
- case FAC_OPVAL_AOC_D_CUR:
- r = "aOCDCurrency";
- break;
- case FAC_OPVAL_AOC_D_UNIT:
- r = "aOCDChargingUnit";
- break;
- case FAC_OPVAL_AOC_E_CUR:
- r = "aOCECurrency";
- break;
- case FAC_OPVAL_AOC_E_UNIT:
- r = "aOCEChargingUnit";
- break;
- case FAC_OPVAL_AOC_IDOFCRG:
- r = "identificationOfCharge";
- break;
- case FAC_OPVAL_CONF_BEG:
- r = "beginConf";
- break;
- case FAC_OPVAL_CONF_ADD:
- r = "addConf";
- break;
- case FAC_OPVAL_CONF_SPLIT:
- r = "splitConf";
- break;
- case FAC_OPVAL_CONF_DROP:
- r = "dropConf";
- break;
- case FAC_OPVAL_CONF_ISOLATE:
- r = "isolateConf";
- break;
- case FAC_OPVAL_CONF_REATT:
- r = "reattachConf";
- break;
- case FAC_OPVAL_CONF_PDISC:
- r = "partyDISC";
- break;
- case FAC_OPVAL_CONF_FCONF:
- r = "floatConf";
- break;
- case FAC_OPVAL_CONF_END:
- r = "endConf";
- break;
- case FAC_OPVAL_CONF_IDCFE:
- r = "indentifyConferee";
- break;
- case FAC_OPVAL_REVC_REQ:
- r = "requestREV";
- break;
- default:
- sprintf(buffer, "unknown operation value %d!", val);
- r = buffer;
- }
- return(r);
-}
-
-/*---------------------------------------------------------------------------*
- * billing id string
- *---------------------------------------------------------------------------*/
-static char *bid_str(int val)
-{
- static char buffer[80];
- char *r;
-
- switch(val)
- {
- case 0:
- r = "normalCharging";
- break;
- case 1:
- r = "reverseCharging";
- break;
- case 2:
- r = "creditCardCharging";
- break;
- case 3:
- r = "callForwardingUnconditional";
- break;
- case 4:
- r = "callForwardingBusy";
- break;
- case 5:
- r = "callForwardingNoReply";
- break;
- case 6:
- r = "callDeflection";
- break;
- case 7:
- r = "callTransfer";
- break;
- default:
- sprintf(buffer, "unknown billing-id value %d!", val);
- r = buffer;
- }
- return(r);
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component
- *---------------------------------------------------------------------------*/
-static void
-F_1_1(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_1, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t invokeComponent\n");
- state = ST_EXP_INV_ID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result
- *---------------------------------------------------------------------------*/
-static void
-F_1_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_2, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t returnResult\n");
- state = ST_EXP_RR_INV_ID;
- }
-}
-/*---------------------------------------------------------------------------*
- * return error
- *---------------------------------------------------------------------------*/
-static void
-F_1_3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_3, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t returnError\n");
- state = ST_EXP_NIX;
- }
-}
-/*---------------------------------------------------------------------------*
- * reject
- *---------------------------------------------------------------------------*/
-static void
-F_1_4(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_4, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t reject\n");
- state = ST_EXP_REJ_INV_ID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_RJ2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_REJ_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * reject, general problem
- *---------------------------------------------------------------------------*/
-static void
-F_RJ30(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ30, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t General problem\n");
- }
- else
- {
- switch(val)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized component\n");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "\t problem = mistyped component\n");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "\t problem = badly structured component\n");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unknown problem code 0x%x\n", val);
- break;
- }
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * reject, invoke problem
- *---------------------------------------------------------------------------*/
-static void
-F_RJ31(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ31, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Invoke problem\n");
- }
- else
- {
- switch(val)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "\t problem = duplicate invocation\n");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized operation\n");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "\t problem = mistyped argument\n");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "\t problem = resource limitation\n");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "\t problem = initiator releasing\n");
- break;
- case 5:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized linked identifier\n");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), "\t problem = linked resonse unexpected\n");
- break;
- case 7:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unexpected child operation\n");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unknown problem code 0x%x\n", val);
- break;
- }
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * reject, return result problem
- *---------------------------------------------------------------------------*/
-static void
-F_RJ32(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ32, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Return result problem\n");
- }
- else
- {
- switch(val)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized invocation\n");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "\t problem = return response unexpected\n");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "\t problem = mistyped result\n");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unknown problem code 0x%x\n", val);
- break;
- }
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * reject, return error problem
- *---------------------------------------------------------------------------*/
-static void
-F_RJ33(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ33, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Return error problem\n");
- }
- else
- {
- switch(val)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized invocation\n");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "\t problem = error response unexpected\n");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized error\n");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unexpected error\n");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "\t problem = mistyped parameter\n");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unknown problem code 0x%x\n", val);
- break;
- }
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_RR2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RR2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_RR_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component: operation value
- *---------------------------------------------------------------------------*/
-static void
-F_3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_3, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Operation Value = %s (%d)\n", opval_str(val), val);
- state = ST_EXP_INFO;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: operation value
- *---------------------------------------------------------------------------*/
-static void
-F_RR3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RR3, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Operation Value = %s (%d)\n", opval_str(val), val);
- state = ST_EXP_RR_RESULT;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: RESULT
- *---------------------------------------------------------------------------*/
-static void
-F_RRR(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RRR, val = %d\n", val);
-#endif
- state = ST_EXP_NIX;
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t specificChargingUnits\n");
- state = ST_EXP_RUL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4_1(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4_1, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t freeOfCharge\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4_2, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t chargeNotAvailable\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_5(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_5, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t recordedUnitsList [1]\n");
- state = ST_EXP_RU;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_6(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_6, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t RecordedUnits\n");
- state = ST_EXP_RNOU;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_7(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_7, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t NumberOfUnits = %d\n", val);
- state = ST_EXP_TOCI;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_8(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_8, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t typeOfChargingInfo = %s\n", val == 0 ? "subTotal" : "total");
- state = ST_EXP_DBID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_9(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_9, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t AOCDBillingId = %s (%d)\n", bid_str(val), val);
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * state table
- *---------------------------------------------------------------------------*/
-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)(char *,int); /* output: func to exec */
-} statetab[] = {
-
-/* current state tag form tag class tag code function */
-/* --------------------- ---------------------- ---------------------- ---------------------- ----------------*/
-
-/* invoke */
-
- {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 },
-
-/* return result */
-
- {ST_EXP_RR_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RR2 },
- {ST_EXP_RR_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RR3 },
- {ST_EXP_RR_RESULT, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SET, F_RRR },
-
-/* current state tag form tag class tag code function */
-/* --------------------- ---------------------- ---------------------- ---------------------- ----------------*/
-/* reject */
-
- {ST_EXP_REJ_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RJ2 },
- {ST_EXP_REJ_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 0, F_RJ30 },
- {ST_EXP_REJ_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 1, F_RJ31 },
- {ST_EXP_REJ_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 2, F_RJ32 },
- {ST_EXP_REJ_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 3, F_RJ33 },
-
-/* end */
-
- {-1, -1, -1, -1, NULL }
-};
-
-/*---------------------------------------------------------------------------*
- * state decode for do_component
- *---------------------------------------------------------------------------*/
-static void
-next_state(char *pbuf, int class, int form, int code, int val)
-{
- int i;
-
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: class=%d, form=%d, code=%d, val=%d\n", class, form, code, val);
-#endif
-
- 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)(pbuf, val);
- break;
- }
- }
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdndecode/facility.h b/usr.sbin/i4b/isdndecode/facility.h
deleted file mode 100644
index f4cfe10..0000000
--- a/usr.sbin/i4b/isdndecode/facility.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 1997, 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * facility.h - facility header file
- * ---------------------------------
- *
- * $Id: facility.h,v 1.5 2000/02/21 15:17:17 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Feb 21 16:16:04 2000]
- *
- *---------------------------------------------------------------------------
- *
- * - 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 !)
- *
- *---------------------------------------------------------------------------*/
-
-/* #define FAC_DEBUG */
-/* #define ST_DEBUG */
-
-/* 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_RR_INV_ID,
- ST_EXP_RR_OP_VAL,
- ST_EXP_RR_RESULT,
-
- ST_EXP_REJ_INV_ID,
- ST_EXP_REJ_OP_VAL,
- ST_EXP_REJ_RESULT,
-
- ST_EXP_NIX
-};
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdndecode/isdndecode.8 b/usr.sbin/i4b/isdndecode/isdndecode.8
deleted file mode 100644
index 628bcbe..0000000
--- a/usr.sbin/i4b/isdndecode/isdndecode.8
+++ /dev/null
@@ -1,176 +0,0 @@
-.\"
-.\" Copyright (c) 1998, 2000 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.
-.\"
-.\" $Id: isdndecode.8,v 1.9 2000/02/21 15:17:17 hm Exp $
-.\"
-.\" last edit-date: [Mon Feb 21 16:15:09 2000]
-.\"
-.\" $FreeBSD$
-.\"
-.Dd February 21, 2000
-.Dt ISDNDECODE 8
-.Os
-.Sh NAME
-.Nm isdndecode
-.Nd isdn4bsd ISDN protocol decode utility
-.Sh SYNOPSIS
-.Nm
-.Op Fl a
-.Op Fl b
-.Op Fl d
-.Op Fl f Ar filename
-.Op Fl h
-.Op Fl i
-.Op Fl l
-.Op Fl o
-.Op Fl p Ar filename
-.Op Fl u Ar number
-.Op Fl x
-.Op Fl B
-.Op Fl P
-.Op Fl R Ar unit
-.Op Fl T Ar unit
-.Sh DESCRIPTION
-The
-.Nm
-utility is part of the isdn4bsd package and is used to provide the user with a
-detailed mnemonic display of the layers 1, 2 and 3 protocol activities on
-the D channel and hex dump of the B channel(s) activities.
-.Pp
-Together with two passive supported cards and an easy to build cable it can
-also be used to monitor the complete traffic on a S0 bus providing S0 bus
-analyzer features.
-.Pp
-The
-.Nm
-utility is only available for passive supported cards.
-.Pp
-The following options can be used:
-.Bl -tag -width Ds
-.It Fl a
-Run
-.Nm
-in analyzer mode by using two passive cards and a custom cable which can
-be build as described in the file
-.Em cable.txt
-in the isdn4bsd source distribution.
-One card acts as a receiver for the
-transmitting direction on the S0 bus while the other card acts as a receiver
-for the receiving direction on the S0 bus.
-Complete traffic monitoring is
-possible using this setup.
-.It Fl b
-switch B channel tracing on (default off).
-.It Fl d
-switch D channel tracing off (default on).
-.It Fl f
-Use
-.Ar filename
-as the name of a file into which to write tracing output (default filename is
-isdndecode<n> where n is the number of the unit to decode).
-.It Fl h
-switch display of header off (default on).
-.It Fl i
-print layer 1 (I.430) INFO signals to monitor layer 1 activity (default off).
-.It Fl l
-switch displaying of Layer 2 (Q.921) frames off (default on).
-.It Fl o
-switch off writing decode output to a file (default on).
-.It Fl p
-Use
-.Ar filename
-as the name of a file used for the -B and -P options (default filename
-is isdntracebin<n> where n is the number of the unit to decode).
-.It Fl u
-Use
-.Ar number
-as the unit number of the controller card to decode (default 0).
-.It Fl x
-Decode Layer 3 packets with an unknown protocol discriminator.
-.It Fl B
-Write undecoded binary decode data to a file for later or remote
-analyzing (default off).
-.It Fl P
-Read undecoded binary decode data from file instead from device (default off).
-.It Fl R
-Use
-.Ar unit
-as the receiving interface unit number in analyze mode.
-.It Fl T
-Use
-.Ar unit
-as the transmitting interface unit number in analyze mode.
-.El
-.Pp
-When the USR1 signal is sent to a
-.Nm
-process, the currently used logfiles are reopened, so that logfile
-rotation becomes possible.
-.Pp
-The decode output should be obvious.
-It is very handy to have the following
-standard texts available when tracing ISDN protocols:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I.430
-ISDN BRI layer 1 protocol description.
-.It Ar Q.921
-ISDN D-channel layer 2 protocol description.
-.It Ar Q.931
-ISDN D-channel layer 3 protocol description.
-.El
-.Sh FILES
-.Bl -tag -width daddeldi -compact
-.It Pa /dev/i4btrc<n>
-The devicefile(s) used to get the decode messages for ISDN card unit <n>
-out of the kernel.
-.El
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-isdndecode -f /var/tmp/isdn.decode
-.Ed
-.Pp
-will start D channel tracing on passive controller 0 with all except B
-channel tracing enabled and logs everything into the output file
-/var/tmp/isdn.decode.
-.Sh SEE ALSO
-.Xr isdnd 8
-.Sh STANDARDS
-ITU Recommendations I.430, Q.920, Q.921, Q.930, Q.931
-.Pp
-ITU Recommendation Q.932 (03/93), Q.950 (03/93)
-.Pp
-ETSI Recommendation ETS 300 179 (10/92), ETS 300 180 (10/92)
-.Pp
-ETSI Recommendation ETS 300 181 (04/93), ETS 300 182 (04/93)
-.Pp
-ITU Recommendation X.208, X.209
-.Sh AUTHORS
-The
-.Nm
-utility and this manual page were written by
-.An Hellmuth Michaelis Aq hm@kts.org .
-.Sh BUGS
-Still one left.
diff --git a/usr.sbin/i4b/isdndecode/layer1.c b/usr.sbin/i4b/isdndecode/layer1.c
deleted file mode 100644
index c08b628..0000000
--- a/usr.sbin/i4b/isdndecode/layer1.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * layer1.c - isdndecode, decode and print layer 1 information
- * -----------------------------------------------------------
- *
- * $Id: layer1.c,v 1.4 1999/12/13 21:25:25 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:50:34 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-/*---------------------------------------------------------------------------*
- * decode layer 1 information
- *---------------------------------------------------------------------------*/
-void
-layer1(char *buffer, unsigned char *buf)
-{
- switch(*buf)
- {
- case INFO0:
- strcpy(buffer,"L1 INFO0 (No Signal)\n");
- break;
-
- case INFO1_8:
- strcpy(buffer,"L1 INFO1 (Activation Request, Priority = 8)\n");
- break;
-
- case INFO1_10:
- strcpy(buffer,"L1 INFO1 (Activation Request, Priority = 10)\n");
- break;
-
- case INFO2:
- strcpy(buffer,"L1 INFO2 (Pending Activation)\n");
- break;
-
- case INFO3:
- strcpy(buffer,"L1 INFO3 (Synchronized)\n");
- break;
-
- case INFO4_8:
- strcpy(buffer,"L1 INFO4 (Activated, Priority = 8/9)\n");
- break;
-
- case INFO4_10:
- strcpy(buffer,"L1 INFO4 (Activated, Priority = 10/11)\n");
- break;
-
- default:
- sprintf(buffer,"L1 ERROR, invalid INFO value 0x%x!\n", *buf);
- break;
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/layer2.c b/usr.sbin/i4b/isdndecode/layer2.c
deleted file mode 100644
index 1e53986..0000000
--- a/usr.sbin/i4b/isdndecode/layer2.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * layer2.c - decode and print layer 2 (Q.921) information
- * -------------------------------------------------------
- *
- * $Id: layer2.c,v 1.5 1999/12/13 21:25:25 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:50:41 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-/*---------------------------------------------------------------------------*
- * decode poll bit
- *---------------------------------------------------------------------------*/
-static void
-poll(int layer, char *buffer, int cnt, unsigned char value, unsigned char mask)
-{
- sprintline(layer, buffer, cnt, value, mask, "P/F, Poll = %s", (value & mask) ? "Immediate Response Required" : "No Immediate Response Required");
-}
-
-/*---------------------------------------------------------------------------*
- * decode final bit
- *---------------------------------------------------------------------------*/
-static void
-final(int layer, char *buffer, int cnt, unsigned char value, unsigned char mask)
-{
- sprintline(layer, buffer, cnt, value, mask, "P/F, Final = %s", (value & mask) ? "Result of Poll" : "No Result of Poll");
-}
-
-/*---------------------------------------------------------------------------*
- * decode protocol specified in Q.921
- *---------------------------------------------------------------------------*/
-int
-layer2(char *pbuf, unsigned char *buf, int dir, int printit)
-{
- int sap, tei, cmd;
- int cnt = 0;
- char locbuf[32000];
- char *lbufp = &locbuf[0];
- char buffer[80];
-
- *lbufp = '\0';
- *pbuf = '\0';
-
- /* address high */
-
- sap = (buf[0] >> 2) & 0x3f;
-
- if(sap == 0)
- strcpy(buffer, "Call Control");
- else if((sap >= 1) && (sap <= 15))
- strcpy(buffer, "Reserved");
- else if(sap == 16)
- strcpy(buffer, "X.25");
- else if((sap >= 17) && (sap <= 31))
- strcpy(buffer, "Reserved");
- else if(sap == 63)
- strcpy(buffer, "Layer 2 Management");
- else
- strcpy(buffer, "Not available for Q.921");
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[0], 0xfc, "SAPI = %d (%s)", sap, buffer);
-
- if(dir == FROM_TE)
- cmd = !(buf[0] & 0x02);
- else
- cmd = buf[0] & 0x02;
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[0], 0x02, "C/R = %s", cmd ? "Command" : "Response");
- extension(2, lbufp+strlen(lbufp), cnt, buf[0], 0x01);
- cnt++;
-
- /* address low */
-
- tei = buf[1] >> 1;
-
- if((tei >= 0) && (tei <= 63))
- strcpy(buffer, "Non-automatic TEI");
- else if((tei >= 64) && (tei <= 126))
- strcpy(buffer, "Automatic TEI");
- if(tei == 127)
- strcpy(buffer, "Group TEI");
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[1], 0xfe, "TEI = %d (%s)", tei, buffer);
- extension(2, lbufp+strlen(lbufp), cnt, buf[1], 0x01);
- cnt++;
-
- /* control 1 */
-
- if((buf[2] & 0x03) == 0x03)
- {
- /* U-frame */
-
- if((buf[2] & 0xef) == 0x6f)
- {
- /* SABME */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: SABME (Set Asynchonous Balanced Mode)");
- poll(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x0f)
- {
- /* DM */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: DM (Disconnected Mode)");
- final(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x03)
- {
- /* UI */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: UI (Unnumbered Information)");
- poll(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
-
- if(sap == 63 && (buf[3] == 0x0f)) /* TEI management */
- {
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[3], 0xff, "MEI (Management Entity Identifier)");
- cnt++;
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[4], 0xff, "Ri = 0x%04x (Reference number high)", (buf[4] << 8) | buf[5]);
- cnt++;
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[5], 0xff, "Ri (Reference Number low)");
- cnt++;
-
- switch(buf[6])
- {
- case 0x01:
- strcpy(buffer, "Identity Request");
- break;
- case 0x02:
- strcpy(buffer, "Identity Assigned");
- break;
- case 0x03:
- strcpy(buffer, "Identity denied");
- break;
- case 0x04:
- strcpy(buffer, "Identity Check Request");
- break;
- case 0x05:
- strcpy(buffer, "Identity Check Response");
- break;
- case 0x06:
- strcpy(buffer, "Identity Remove");
- break;
- case 0x07:
- strcpy(buffer, "Identity Verify");
- break;
- default:
- strcpy(buffer, "undefined");
- break;
- }
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[6], 0xff, "TEI %s (Message Type %d)", buffer, buf[6]);
- cnt++;
-
- switch(buf[6])
- {
- case 0x01:
- strcpy(buffer, "Any TEI value acceptable");
- break;
- case 0x02:
- strcpy(buffer, "");
- break;
- case 0x03:
- strcpy(buffer, "No TEI Value available");
- break;
- case 0x04:
- strcpy(buffer, "Check all TEI values");
- break;
- case 0x05:
- strcpy(buffer, "");
- break;
- case 0x06:
- strcpy(buffer, "Request for removal of all TEI values");
- break;
- case 0x07:
- strcpy(buffer, "");
- break;
- default:
- strcpy(buffer, "");
- break;
- }
- if(((buf[7] >> 1) & 0x7f) == 127)
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[7], 0xfe, "Ai = %d (Action Indicator = %s)", (buf[7] >> 1) & 0x7f, buffer);
- else
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[7], 0xfe, "Ai = %d (Action Indicator)", (buf[7] >> 1) & 0x7f);
- extension(2, lbufp+strlen(lbufp), cnt, buf[7], 0x01);
- cnt++;
- }
- }
- else if((buf[2] & 0xef) == 0x43)
- {
- /* DISC */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: DISC (Disconnect)");
- poll(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x63)
- {
- /* UA */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: UA (Unnumbered Acknowledge)");
- final(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x87)
- {
- /* FRMR */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: FRMR (Frame Reject)");
- final(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
- else if((buf[2] & 0xef) == 0x9f)
- {
- /* XID */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xef, "U-Frame: XID (Exchange Identification)");
- if(cmd)
- poll(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- else
- final(2, lbufp+strlen(lbufp), cnt, buf[2], 0x10);
- cnt++;
- }
-
- }
- else if((buf[2] & 0x03) == 0x01)
- {
- /* S-frame */
-
- if(buf[2] == 0x01)
- strcpy(buffer, "RR (Receiver Ready)");
- else if(buf[2] == 0x05)
- strcpy(buffer, "RNR (Receiver Not Ready)");
- else if(buf[2] == 0x09)
- strcpy(buffer, "REJ (Reject)");
- else
- strcpy(buffer, "Unknown");
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xff, "S-Frame: %s", buffer);
- cnt++;
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[3], 0xfe, "N(R) = %d (receive sequence number)", (buf[3] >> 1) & 0x7f);
- if(cmd)
- poll(2, lbufp+strlen(lbufp), cnt, buf[3], 0x01);
- else
- final(2, lbufp+strlen(lbufp), cnt, buf[3], 0x01);
- cnt++;
-
- }
- else if((buf[2] & 0x01) == 0x00)
- {
- /* I-frame */
-
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0xfe, "N(S) = %d (send sequence number)", (buf[2] >> 1) & 0x7f);
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[2], 0x01, "I-Frame: Information transfer");
- cnt++;
-
- sprintf(buffer, "N(R) = %d", (buf[3] >> 1) & 0x7f);
- sprintline(2, lbufp+strlen(lbufp), cnt, buf[3], 0xfe, "N(R) = %d (receive sequence number)", (buf[3] >> 1) & 0x7f);
- poll(2, lbufp+strlen(lbufp), cnt, buf[3], 0x01);
- cnt++;
-
- }
-
- sprintf((pbuf+strlen(pbuf)),"%s", &locbuf[0]);
- return (cnt);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/layer3.c b/usr.sbin/i4b/isdndecode/layer3.c
deleted file mode 100644
index 12a7633..0000000
--- a/usr.sbin/i4b/isdndecode/layer3.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * Copyright (c) 1997, 2002 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.
- *
- *---------------------------------------------------------------------------
- *
- * layer3.c - decode and print layer 3 (Q.931) information
- * -------------------------------------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Tue Mar 26 14:39:02 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-char *mttab[] = {
-
-/* 0x00 */ /* call establishment group */
-
- "ESCAPE",
- "ALERTING",
- "CALL PROCEEDING",
- "PROGRESS",
- "undefined (0x04)",
- "SETUP",
- "undefined (0x06)",
- "CONNECT",
- "undefined (0x08)",
- "undefined (0x09)",
- "undefined (0x0a)",
- "undefined (0x0b)",
- "undefined (0x0c)",
- "SETUP ACKNOWLEDGE",
- "undefined (0x0e)",
- "CONNECT ACKNOWLEDGE",
-
-/* 0x10 */
- "undefined (0x10)",
- "undefined (0x11)",
- "undefined (0x12)",
- "undefined (0x13)",
- "undefined (0x14)",
- "undefined (0x15)",
- "undefined (0x16)",
- "undefined (0x17)",
- "undefined (0x18)",
- "undefined (0x19)",
- "undefined (0x1a)",
- "undefined (0x1b)",
- "undefined (0x1c)",
- "undefined (0x1d)",
- "undefined (0x1e)",
- "undefined (0x1f)",
-
-/* 0x20 */
-
- "USER INFORMATION", /* call information phase */
- "SUSPEND REJECT",
- "RESUME REJECT",
- "undefined (0x23)",
- "HOLD",
- "SUSPEND",
- "RESUME",
- "undefined (0x27)",
- "HOLD ACKNOWLEDGE",
- "undefined (0x29)",
- "undefined (0x2a)",
- "undefined (0x2b)",
- "undefined (0x2c)",
- "SUSPEND ACKNOWLEDGE",
- "RESUME ACKNOWLEDGE",
- "undefined (0x2f)",
-
-/* 0x30 */
-
- "HOLD REJECT",
- "RETRIEVE",
- "undefined (0x32)",
- "RETRIEVE ACKNOWLEDGE",
- "undefined (0x34)",
- "undefined (0x35)",
- "undefined (0x36)",
- "RETRIEVE REJECT",
- "undefined (0x38)",
- "undefined (0x39)",
- "undefined (0x3a)",
- "undefined (0x3b)",
- "undefined (0x3c)",
- "undefined (0x3d)",
- "undefined (0x3e)",
- "undefined (0x3f)",
-
-/* 0x40 */
-
- "DETACH", /* call clearing */
- "undefined (0x41)",
- "undefined (0x42)",
- "undefined (0x43)",
- "undefined (0x44)",
- "DISCONNECT",
- "RESTART",
- "undefined (0x47)",
- "DETACH ACKNOWLEDGE",
- "undefined (0x49)",
- "undefined (0x4a)",
- "undefined (0x4b)",
- "undefined (0x4c)",
- "RELEASE",
- "RESTART ACKNOWLEDGE",
- "undefined (0x4f)",
-
-/* 0x50 */
-
- "undefined (0x50)",
- "undefined (0x51)",
- "undefined (0x52)",
- "undefined (0x53)",
- "undefined (0x54)",
- "undefined (0x55)",
- "undefined (0x56)",
- "undefined (0x57)",
- "undefined (0x58)",
- "undefined (0x59)",
- "RELEASE COMPLETE",
- "undefined (0x5b)",
- "undefined (0x5c)",
- "undefined (0x5d)",
- "undefined (0x5e)",
- "undefined (0x5f)",
-
-/* 0x60 */
-
- "SEGMENT", /* misc messages */
- "undefined (0x61)",
- "FACILITY",
- "undefined (0x63)",
- "REGISTER",
- "undefined (0x65)",
- "undefined (0x66)",
- "undefined (0x67)",
- "CANCEL ACKNOWLEDGE",
- "undefined (0x69)",
- "FACILITY ACKNOWLEDGE",
- "undefined (0x6b)",
- "REGISTER ACKNOWLEDGE",
- "undefined (0x6d)",
- "NOTIFY",
- "undefined (0x6f)",
-
-/* 0x70 */
-
- "CANCEL REJECT",
- "undefined (0x71)",
- "FACILITY REJECT",
- "undefined (0x73)",
- "REGISTER REJECT",
- "STATUS ENQIRY",
- "undefined (0x76)",
- "undefined (0x77)",
- "undefined (0x78)",
- "CONGESTION CONTROL",
- "undefined (0x7a)",
- "INFORMATION",
- "undefined (0x7c)",
- "STATUS",
- "undefined (0x7e)",
- "undefined (0x7f)",
-};
-
-#define MTTAB_MAX 0x7f
-
-extern int f_null(char *pbuf, unsigned char *buf, int off);
-extern int f_bc(char *pbuf, unsigned char *buf, int off);
-extern int f_cause(char *pbuf, unsigned char *buf, int off);
-extern int f_cstat(char *pbuf, unsigned char *buf, int off);
-extern int f_chid(char *pbuf, unsigned char *buf, int off);
-extern int f_fac(char *pbuf, unsigned char *buf, int off);
-extern int f_progi(char *pbuf, unsigned char *buf, int off);
-extern int f_displ(char *pbuf, unsigned char *buf, int off);
-extern int f_date(char *pbuf, unsigned char *buf, int off);
-extern int f_cnu(char *pbuf, unsigned char *buf, int off);
-extern int f_cgpn(char *pbuf, unsigned char *buf, int off);
-extern int f_cdpn(char *pbuf, unsigned char *buf, int off);
-extern int f_hlc(char *pbuf, unsigned char *buf, int off);
-extern int f_uu(char *pbuf, unsigned char *buf, int off);
-
-struct ie {
- unsigned char code; /* information element identifier code */
- char *name; /* ie name */
- int (*func) (char *pbuf, unsigned char *buf, int off); /* decode function */
-} ietab[] = {
- { 0x00, "segmented message", f_null },
- { 0x04, "bearer capability", f_bc },
- { 0x08, "cause", f_cause },
- { 0x0c, "connected address", f_null },
- { 0x0d, "extended facility", f_null },
- { 0x10, "call identity", f_null },
- { 0x14, "call state", f_cstat },
- { 0x18, "channel id", f_chid },
- { 0x19, "data link connection id", f_null },
- { 0x1c, "facility", f_fac },
- { 0x1e, "progress indicator", f_progi },
- { 0x20, "network specific facilities", f_null },
- { 0x24, "terminal capabilities", f_null },
- { 0x27, "notification indicator", f_null },
- { 0x28, "display", f_displ },
- { 0x29, "date/time", f_date },
- { 0x2c, "keypad", f_null },
- { 0x30, "keypad echo", f_null },
- { 0x32, "information request", f_null },
- { 0x34, "signal", f_null },
- { 0x36, "switchhook", f_null },
- { 0x38, "feature activation", f_null },
- { 0x39, "feature indication", f_null },
- { 0x3a, "service profile id", f_null },
- { 0x3b, "endpoint identifier", f_null },
- { 0x40, "information rate", f_null },
- { 0x41, "precedence level", f_null },
- { 0x42, "end-to-end transit delay", f_null },
- { 0x43, "transit delay detection", f_null },
- { 0x44, "packet layer binary parms", f_null },
- { 0x45, "packet layer window size", f_null },
- { 0x46, "packet size", f_null },
- { 0x47, "closed user group", f_null },
- { 0x48, "link layer core parameters", f_null },
- { 0x49, "link layer protocol parms", f_null },
- { 0x4a, "reverse charging information", f_null },
- { 0x4c, "connected number", f_cnu },
- { 0x4d, "connected subaddress", f_null },
- { 0x50, "X.213 priority", f_null },
- { 0x51, "report type", f_null },
- { 0x53, "link integrity verification", f_null },
- { 0x57, "PVC status", f_null },
- { 0x6c, "calling party number", f_cnu },
- { 0x6d, "calling party subaddress", f_null },
- { 0x70, "called party number", f_cnu },
- { 0x71, "called party subaddress", f_null },
- { 0x74, "redirecting number", f_null },
- { 0x78, "transit network selection", f_null },
- { 0x79, "restart indicator", f_null },
- { 0x7c, "low layer compatibility", f_null },
- { 0x7d, "high layer compatibility", f_hlc },
- { 0x7e, "user-user", f_uu },
- { 0x7f, "escape for extension", f_null },
- { 0xff, "unknown information element", f_null }
-};
-
-/*---------------------------------------------------------------------------*
- * decode Q.931 protocol
- *---------------------------------------------------------------------------*/
-void
-layer3(char *pbuf, int n, int off, unsigned char *buf)
-{
- char buffer[256];
- int codeset = 0;
- int codelock = 0;
- int oldcodeset = 0;
-
- int pd;
- int len;
- int j;
- int i;
-
- if(n <= 0)
- return;
-
- *pbuf = '\0';
-
- i = 0;
-
- /* protocol discriminator */
-
- pd = buf[i];
-
- if(pd >= 0x00 && pd <= 0x07)
- sprintf(buffer, "User-User IE (0x%02x)",pd);
- else if(pd == 0x08)
- sprintf(buffer, "Q.931/I.451");
- else if(pd >= 0x10 && pd <= 0x3f)
- sprintf(buffer, "Other Layer 3 or X.25 (0x%02x)",pd);
- else if(pd >= 0x40 && pd <= 0x4f)
- sprintf(buffer, "National Use (0x%02x)",pd);
- else if(pd >= 0x50 && pd <= 0xfe)
- sprintf(buffer, "Other Layer 3 or X.25 (0x%02x)",pd);
- else
- sprintf(buffer, "Reserved (0x%02x)",pd);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, pd, 0xff, "Protocol discriminator = %s", buffer);
- i++;
-
- if(pd != 0x08)
- {
- for (; i < n;i++)
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "-");
- return;
- }
-
- /* call reference */
-
- len = buf[i] & 0x0f;
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xf0, "Call Reference");
-
- switch(len)
- {
- case 0:
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Length of Call Reference = 0 (Dummy CR)");
- break;
- case 1:
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Length of Call Reference = 1");
- i++;
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x80, "Call Reference sent %s origination side", (buf[i] & 0x80) ? "to" : "from");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Call Reference = %d = 0x%02x", (buf[i] & 0x7f), (buf[i] & 0x7f));
- break;
- case 2:
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Length of Call Reference = 2");
- i++;
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x80, "Call Reference sent %s origination side", (buf[i] & 0x80) ? "to" : "from");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Call reference = %d = %02x", (buf[i] & 0x7f), (buf[i] & 0x7f));
- i++;
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Call reference = %d = %02x", (buf[i]), (buf[i]));
- break;
- }
- i++;
-
- /* message type */
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x80, "Message type extension = %d", buf[i] & 0x80 ? 1 : 0);
-
- if(buf[i] <= MTTAB_MAX)
- strcpy(buffer, mttab[buf[i]]);
- else
- sprintf(buffer, "unknown (0x%02x)", buf[i]);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Message type = %s", buffer);
- i++;
-
- /* information elements */
-
- for (; i < n;)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x80, "%s Information element", buf[i] & 0x80 ? "Single octet" : "Variable length");
-
- if(buf[i] & 0x80)
- {
- /* single octett info element type 1 */
-
- if((buf[i] & 0x70) == 0x00)
- {
- strcpy(buffer, "Reserved");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x70, "Reserved");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Reserved, content of IE");
- }
- else if((buf[i] & 0x70) == 0x10)
- {
- strcpy(buffer, "Shift");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x70, "Shift");
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x08, "%s shift", buf[i] & 0x08 ? "Non-locking" : "Locking");
-
- switch(buf[i] & 0x07)
- {
- case 0:
- strcpy(buffer, "Not applicable");
- break;
- case 1:
- case 2:
- case 3:
- sprintf(buffer, "Reserved (%d)", buf[i] & 0x07);
- break;
- case 4:
- strcpy(buffer, "Codeset 4 (ISO/IEC)");
- break;
- case 5:
- strcpy(buffer, "Codeset 5 (National use)");
- break;
- case 6:
- strcpy(buffer, "Codeset 6 (Local network specific)");
- break;
- case 7:
- strcpy(buffer, "Codeset 7 (User specific)");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x07, "%s", buffer);
- break;
- }
- else if((buf[i] & 0x70) == 0x30)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x70, "Congestion Level");
- switch(buf[i] & 0x0f)
- {
- case 0x00:
- strcpy(buffer, "receiver ready");
- break;
- case 0x0f:
- strcpy(buffer, "receiver not ready");
- break;
- default:
- sprintf(buffer, "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Congestion Level = ", buffer);
- break;
- }
- else if((buf[i] & 0x70) == 0x50)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x70, "Repeat Indicator");
- switch(buf[i] & 0x0f)
- {
- case 0x02:
- strcpy(buffer, "Prioritized list for selecting one possibility");
- break;
- default:
- sprintf(buffer, "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Repeat indication = ", buffer);
- break;
- }
-
- /* single octett info element type 2 */
-
- else if((buf[i] & 0x7f) == 0x20)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "More data");
- }
- else if((buf[i] & 0x7f) == 0x21)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Sending complete");
- }
- else
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "UNKNOWN single octet IE = 0x%02x", buf[i]);
- }
- i++; /* next */
- }
- else
- {
- if(codeset == 0)
- {
- struct ie *iep = &ietab[0];
-
- for(;;)
- {
- if((iep->code == buf[i]) ||
- (iep->code == 0xff))
- break;
- iep++;
- }
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "IE = %s", iep->name);
- sprintline(3, pbuf+strlen(pbuf), off+i+1, buf[i+1], 0xff, "IE Length = %d", buf[i+1]);
-
- if(iep->func == f_null)
- {
- }
- else
- {
- i += (iep->func)(pbuf, &buf[i], off+i);
- goto next;
- }
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "UNKNOWN CODESET=%d, IE=0x%02x", codeset, buf[i]);
- }
-
- i++; /* index -> length */
-
- len = buf[i];
-
- sprintf((pbuf+strlen(pbuf)), "LEN=0x%02x, DATA=", len);
-
- i++; /* index -> 1st param */
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"0x%02x ", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),"]\n");
-
- i += len;
-
-next:
-
- if(!codelock && (codeset != oldcodeset))
- codeset = oldcodeset;
- }
- }
-/* sprintf((pbuf+strlen(pbuf)),"\n"); */
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdndecode/layer3_subr.c b/usr.sbin/i4b/isdndecode/layer3_subr.c
deleted file mode 100644
index 6fcedd2..0000000
--- a/usr.sbin/i4b/isdndecode/layer3_subr.c
+++ /dev/null
@@ -1,1122 +0,0 @@
-/*
- * Copyright (c) 1997, 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * layer3_subr.c - subroutines for IE decoding
- * -------------------------------------------
- *
- * $Id: layer3_subr.c,v 1.8 2000/02/21 15:17:17 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Feb 21 15:45:16 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-
-/*---------------------------------------------------------------------------*
- * dummy function
- *---------------------------------------------------------------------------*/
-int
-f_null(char *pbuf, unsigned char *buf, int off)
-{
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_cstat(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int len = 0;
- char buffer[256];
-
- i++;
- len = buf[i];
- i++;
- sprintf((pbuf+strlen(pbuf)), "Std=");
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "CCITT");
- break;
- case 1:
- strcpy(buffer, "ISO/IEC");
- break;
- case 2:
- strcpy(buffer, "National");
- break;
- case 3:
- strcpy(buffer, "Special");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), ", State=");
-
- switch((buf[i] & 0x3f))
- {
- case 0:
- strcpy(buffer, "Null");
- break;
- case 1:
- strcpy(buffer, "Call initiated");
- break;
- case 2:
- strcpy(buffer, "Overlap sending");
- break;
- case 3:
- strcpy(buffer, "Outgoing call proceeding");
- break;
- case 4:
- strcpy(buffer, "Call delivered");
- break;
- case 6:
- strcpy(buffer, "Call present");
- break;
- case 7:
- strcpy(buffer, "Call received");
- break;
- case 8:
- strcpy(buffer, "Connect request");
- break;
- case 9:
- strcpy(buffer, "Incoming call proceeding");
- break;
- case 10:
- strcpy(buffer, "Active");
- break;
- case 11:
- strcpy(buffer, "Disconnect request");
- break;
- case 12:
- strcpy(buffer, "Disconnect indication");
- break;
- case 15:
- strcpy(buffer, "Suspend request");
- break;
- case 17:
- strcpy(buffer, "Resume request");
- break;
- case 19:
- strcpy(buffer, "Release request");
- break;
- case 22:
- strcpy(buffer, "Call abort");
- break;
- case 25:
- strcpy(buffer, "Overlap receiving");
- break;
- case 0x3d:
- strcpy(buffer, "Restart request");
- break;
- case 0x3e:
- strcpy(buffer, "Restart");
- break;
- default:
- strcpy(buffer, "ERROR: undefined/reserved");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), "]");
- i++;
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_chid(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int len = 0;
- char buffer[256];
-
- i++;
- len = buf[i];
- i++;
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x40, "Interface Id present = %s", buf[i] & 0x40 ? "Yes" : "No");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x20, "Interface Type = %s", buf[i] & 0x20 ? "Other (PRI)" : "BRI");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x10, "Spare");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x08, "Channel = %s", buf[i] & 0x08 ? "exclusive" : "preferred");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x04, "Channel is%s the D-Channel", buf[i] & 0x04 ? "" : " not");
-
- switch(buf[i] & 0x03)
- {
- case 0:
- strcpy(buffer, "no channel");
- break;
- case 1:
- strcpy(buffer, "B-1");
- break;
- case 2:
- strcpy(buffer, "B-2");
- break;
- case 3:
- strcpy(buffer, "any channel");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x03, "Channel = %s", buffer);
-
- i++;
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_fac(char *pbuf, unsigned char *buf, int off)
-{
- return(q932_facility(pbuf, buf));
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_progi(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int len = 0;
- char buffer[256];
-
- i++;
- len = buf[i];
- i++;
- sprintf((pbuf+strlen(pbuf)), "Std=");
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "CCITT");
- break;
- case 1:
- strcpy(buffer, "ISO/IEC");
- break;
- case 2:
- strcpy(buffer, "National");
- break;
- case 3:
- strcpy(buffer, "Local");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), ", Loc=");
-
- switch((buf[i] & 0x0f))
- {
- case 0:
- strcpy(buffer, "User");
- break;
- case 1:
- strcpy(buffer, "Private network serving local user");
- break;
- case 2:
- strcpy(buffer, "Public network serving local user");
- break;
- case 3:
- strcpy(buffer, "Transit network");
- break;
- case 4:
- strcpy(buffer, "Public network serving remote user");
- break;
- case 5:
- strcpy(buffer, "Private network serving remote user");
- break;
- case 6:
- strcpy(buffer, "Network beyond interworking point");
- break;
- default:
- strcpy(buffer, "ERROR: undefined/reserved");
- break;
- }
-
- i++;
-
- sprintf((pbuf+strlen(pbuf)), "\n Description");
-
- switch((buf[i] & 0x7f))
- {
- case 1:
- strcpy(buffer, "Call is not end-to-end ISDN");
- break;
- case 2:
- strcpy(buffer, "Destination address is non-ISDN");
- break;
- case 3:
- strcpy(buffer, "Origination address is non-ISDN");
- break;
- case 4:
- strcpy(buffer, "Call has returned to the ISDN");
- break;
- case 5:
- strcpy(buffer, "Interworking occured, Service change");
- break;
- case 8:
- strcpy(buffer, "In-band info or appropriate pattern now available");
- break;
- default:
- strcpy(buffer, "ERROR: undefined/reserved");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), "]");
- i++;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_displ(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int j = 0;
- int len = 0;
-
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-f_date(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int j = 0;
- int len = 0;
-
- i++;
- len = buf[i];
- i++;
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Year = %02d", buf[i]);
- i++;
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Month = %02d", buf[i]);
- i++;
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Day = %02d", buf[i]);
- i++;
-
- j=3;
- if(j < len)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Hour = %02d", buf[i]);
- i++;
- j++;
- }
- if(j < len)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Minute = %02d", buf[i]);
- i++;
- j++;
- }
- if(j < len)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "Second = %02d", buf[i]);
- i++;
- j++;
- }
- i += len;
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the cause
- *---------------------------------------------------------------------------*/
-int
-f_cause(char *pbuf, unsigned char *buf, int off)
-{
- int j;
- int len;
- int i = 0;
- int ls;
- char buffer[256];
-
- i++; /* index -> length */
-
- len = buf[i];
-
- i++; /* coding/location */
- len--;
-
- ls = buf[i];
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((ls & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "CCITT");
- break;
- case 1:
- strcpy(buffer, "ISO/IEC");
- break;
- case 2:
- strcpy(buffer, "National");
- break;
- case 3:
- strcpy(buffer, "Local");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Coding Standard = %s", buffer);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x10, "Spare");
-
- switch(ls & 0x0f)
- {
- case 0x00:
- strcpy(buffer, "user");
- break;
- case 0x01:
- strcpy(buffer, "private network serving local user");
- break;
- case 0x02:
- strcpy(buffer, "public network serving local user");
- break;
- case 0x03:
- strcpy(buffer, "transit network");
- break;
- case 0x04:
- strcpy(buffer, "public network serving remote user");
- break;
- case 0x05:
- strcpy(buffer, "private network serving remote user");
- break;
- case 0x07:
- strcpy(buffer, "international network");
- break;
- case 0x0a:
- strcpy(buffer, "network beyond interworking point");
- break;
- default:
- sprintf(buffer, "reserved (0x%02x)", ls & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Location = %s", buffer);
-
- i++;
- len--;
-
- if(!(ls & 0x80))
- {
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch(buf[i] & 0x7f)
- {
- case 0:
- strcpy(buffer, "Q.931");
- break;
- case 3:
- strcpy(buffer, "X.21");
- break;
- case 4:
- strcpy(buffer, "X.25");
- break;
- case 5:
- strcpy(buffer, "Q.1031/Q.1051");
- break;
- default:
- strcpy(buffer, "Reserved");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Recommendation = %s", buffer);
- i++;
- len--;
- }
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Cause = %s", print_cause_q850(buf[i] & 0x7f));
-
- i++;
- len--;
-
- for(j = 0; j < len; j++)
- sprintline(3, (pbuf+strlen(pbuf)), off+i+j, buf[i+j], 0xff, "Diagnostics = %02d %s", buf[i+j], buf[i+j]);
-
- i += (len+1);
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the bearer capability
- *---------------------------------------------------------------------------*/
-int
-f_bc(char *pbuf, unsigned char *buf, int off)
-{
- int len;
- int i = 0;
- int mr = 0;
- char buffer[256];
-
- i++; /* index -> length */
-
- len = buf[i];
- i++;
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "CCITT");
- break;
- case 1:
- strcpy(buffer, "ISO/IEC");
- break;
- case 2:
- strcpy(buffer, "National");
- break;
- case 3:
- strcpy(buffer, "NSI Std");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Coding standard = %s", buffer);
-
- switch(buf[i] & 0x1f)
- {
- case 0x00:
- strcpy(buffer, "speech");
- break;
- case 0x08:
- strcpy(buffer, "unrestricted digital information");
- break;
- case 0x09:
- strcpy(buffer, "restricted digital information");
- break;
- case 0x10:
- strcpy(buffer, "3.1 kHz audio");
- break;
- case 0x11:
- strcpy(buffer, "unrestricted digital information with tones");
- break;
- case 0x18:
- strcpy(buffer, "video");
- break;
- default:
- sprintf(buffer, "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1f, "Capability = %s", buffer);
-
- i++;
- len--;
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "circuit");
- break;
- case 2:
- strcpy(buffer, "packet");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", ((buf[i] & 0x60) >> 5));
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Mode = %s", buffer);
-
- switch(buf[i] & 0x1f)
- {
- case 0x00:
- strcpy(buffer, "packet mode");
- break;
- case 0x10:
- strcpy(buffer, "64 kbit/s");
- break;
- case 0x11:
- strcpy(buffer, "2 x 64 kbit/s");
- break;
- case 0x13:
- strcpy(buffer, "384 kbit/s");
- break;
- case 0x15:
- strcpy(buffer, "1536 kbit/s");
- break;
- case 0x17:
- strcpy(buffer, "1920 kbit/s");
- break;
- case 0x18:
- strcpy(buffer, "Multirate");
- mr = 1;
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1f, "Rate = %s", buffer);
-
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- if(mr)
- {
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Rate multiplier = %d", buf[i] & 0x7f);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x1f)
- {
- case 0x01:
- strcpy(buffer, "V.110/X.30");
- break;
- case 0x02:
- strcpy(buffer, "G.711 u-Law");
- break;
- case 0x03:
- strcpy(buffer, "G.711 a-Law");
- break;
- case 0x04:
- strcpy(buffer, "G.721 ADPCM/I.460");
- break;
- case 0x05:
- strcpy(buffer, "H.221/H.242");
- break;
- case 0x07:
- strcpy(buffer, "non-CCITT rate adaption");
- break;
- case 0x08:
- strcpy(buffer, "V.120");
- break;
- case 0x09:
- strcpy(buffer, "X.31");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x1f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1f, "Layer 1 Protocol = %s", buffer);
-
- i++;
- len--;
-
- if(!len)
- goto exit;
-
-/* work to do ahead !!! */
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n user rate=0x%02x ", buf[i] & 0x1f);
-
- if(buf[i] & 0x40)
- sprintf((pbuf+strlen(pbuf)), "(async,");
- else
- sprintf((pbuf+strlen(pbuf)), "(sync,");
-
- if(buf[i] & 0x20)
- sprintf((pbuf+strlen(pbuf)), "in-band neg. possible)");
- else
- sprintf((pbuf+strlen(pbuf)), "in-band neg not possible)");
-
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n clk/flow=0x%02x", buf[i] & 0x1f);
-
- sprintf((pbuf+strlen(pbuf)), "\n intermediate rate=");
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "not used");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "8 kbit/s");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "16 kbit/s");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "32 kbit/s");
- break;
- }
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n hdr/mfrm/etc.=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n stop/data/parity=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n modemtype=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x7f)
- {
- case 0x42:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=Q.921/I.441");
- break;
- case 0x46:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=X.25 link");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=0x%02x",(buf[i] & 0x7f));
- break;
- }
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x7f)
- {
- case 0x62:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=Q.921/I.441");
- break;
- case 0x66:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=X.25 packet");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=0x%02x",(buf[i] & 0x7f));
- break;
- }
- i++;
- len--;
-
-exit:
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the ISDN (telephone) number
- *---------------------------------------------------------------------------*/
-int
-f_cnu(char *pbuf, unsigned char *buf, int off)
-{
- int j;
- int len;
- int i = 0;
- int tp;
- int ind = 0;
- char buffer[256];
-
- i++; /* index -> length */
- len = buf[i];
-
- i++; /* index -> type/plan */
- tp = buf[i];
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((tp & 0x70) >> 4)
- {
- case 0:
- strcpy(buffer, "Unknown");
- break;
- case 1:
- strcpy(buffer, "International number");
- break;
- case 2:
- strcpy(buffer, "National number");
- break;
- case 3:
- strcpy(buffer, "Network specific number");
- break;
- case 4:
- strcpy(buffer, "Subscriber number");
- break;
- case 6:
- strcpy(buffer, "Abbreviated number");
- break;
- default:
- sprintf(buffer, "Reserved (%d), ", ((tp & 0x70) >> 4));
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Type = %s", buffer);
-
- switch(tp & 0x0f)
- {
- case 0:
- strcpy(buffer, "Unknown");
- break;
- case 1:
- strcpy(buffer, "ISDN (E.164)");
- break;
- case 3:
- strcpy(buffer, "Data (X.121)");
- break;
- case 4:
- strcpy(buffer, "Telex (F.69)");
- break;
- case 8:
- strcpy(buffer, "National");
- break;
- case 9:
- strcpy(buffer, "Private");
- break;
- default:
- sprintf(buffer, "Reserved (%d)", (tp & 0x0f));
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x0f, "Plan = %s", buffer);
-
- i++;
- len--;
-
- if(!(tp & 0x80))
- {
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- strcpy(buffer, "allowed");
- break;
- case 1:
- strcpy(buffer, "restricted");
- break;
- case 2:
- strcpy(buffer, "number not available");
- break;
- case 3:
- strcpy(buffer, "reserved");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Presentation = %s", buffer);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1c, "Spare");
-
- switch(ind & 0x03)
- {
- case 0:
- strcpy(buffer, "user provided, not screened");
- break;
- case 1:
- strcpy(buffer, "user provided, verified & passed");
- break;
- case 2:
- strcpy(buffer, "user provided, verified & failed");
- break;
- case 3:
- strcpy(buffer, "network provided");
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x03, "Screening = %s", buffer);
- i++;
- len--;
- }
-
- for(j = 0; j < len; j++)
- {
- sprintline(3, (pbuf+strlen(pbuf)), off+i+j, buf[i+j], 0xff, "Number digit = %c", buf[i+j]);
- }
-
- i += j;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print HL comatibility
- *---------------------------------------------------------------------------*/
-int
-f_hlc(char *pbuf, unsigned char *buf, int off)
-{
- int i = 0;
- int len = 0;
- char buffer[256];
-
- i++;
- len = buf[i];
-
- i++;
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch((buf[i] >> 5) & 0x03)
- {
- case 0: strcpy(buffer, "CCITT");
- break;
- case 1: strcpy(buffer, "ISO/IEC");
- break;
- case 2: strcpy(buffer, "National");
- break;
- case 3: strcpy(buffer, "Network");
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x60, "Coding standard = %s", buffer);
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x1c, "Interpretation = %s", ((buf[i] >> 2) & 0x07) == 0x04 ? "first" : "reserved");
-
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x03, "Presentation = %s", ((buf[i]) & 0x03) == 0x01 ? "High layer protocol profile" : "reserved");
-
- i++;
- len--;
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch(buf[i] & 0x7f)
- {
- case 0x01:
- strcpy(buffer, "Telephony");
- break;
- case 0x04:
- strcpy(buffer, "Fax Group 2/3 (F.182)");
- break;
- case 0x21:
- strcpy(buffer, "Fax Group 4 I (F.184)");
- break;
- case 0x24:
- strcpy(buffer, "Teletex (F.230) or Fax Group 4 II/III (F.184)");
- break;
- case 0x28:
- strcpy(buffer, "Teletex (F.220)");
- break;
- case 0x31:
- strcpy(buffer, "Teletex (F.200)");
- break;
- case 0x32:
- strcpy(buffer, "Videotex (F.300/T.102)");
- break;
- case 0x33:
- strcpy(buffer, "Videotex (F.300/T.101)");
- break;
- case 0x35:
- strcpy(buffer, "Telex (F.60)");
- break;
- case 0x38:
- strcpy(buffer, "MHS (X.400)");
- break;
- case 0x41:
- strcpy(buffer, "OSI (X.200)");
- break;
- case 0x5e:
- strcpy(buffer, "Maintenance");
- break;
- case 0x5f:
- strcpy(buffer, "Management");
- break;
- case 0x60:
- strcpy(buffer, "Audio visual (F.721)");
- break;
- default:
- sprintf(buffer, "Reserved (0x%02x)", buf[i] & 0x7f);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Characteristics = %s", buffer);
- i++;
- len--;
-
- if(buf[i-1] & 0x80)
- {
- return(i);
- }
-
- extension(3, pbuf+strlen(pbuf), off+i, buf[i], 0x80);
-
- switch(buf[i] & 0x7f)
- {
- case 0x01:
- strcpy(buffer, "Telephony");
- break;
- case 0x04:
- strcpy(buffer, "Fax Group 2/3 (F.182)");
- break;
- case 0x21:
- strcpy(buffer, "Fax Group 4 I (F.184)");
- break;
- case 0x24:
- strcpy(buffer, "Teletex (F.230) or Fax Group 4 II/III (F.184)");
- break;
- case 0x28:
- strcpy(buffer, "Teletex (F.220)");
- break;
- case 0x31:
- strcpy(buffer, "Teletex (F.200)");
- break;
- case 0x32:
- strcpy(buffer, "Videotex (F.300/T.102)");
- break;
- case 0x33:
- strcpy(buffer, "Videotex (F.300/T.101)");
- break;
- case 0x35:
- strcpy(buffer, "Telex (F.60)");
- break;
- case 0x38:
- strcpy(buffer, "MHS (X.400)");
- break;
- case 0x41:
- strcpy(buffer, "OSI (X.200)");
- break;
- case 0x5e:
- strcpy(buffer, "Maintenance");
- break;
- case 0x5f:
- strcpy(buffer, "Management");
- break;
- case 0x60:
- strcpy(buffer, "Audio visual (F.721)");
- break;
- default:
- sprintf(buffer, "Reserved (0x%02x)", buf[i] & 0x7f);
- break;
-
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0x7f, "Ext. characteristics = %s", buffer);
- i++;
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * user-user
- *---------------------------------------------------------------------------*/
-int
-f_uu(char *pbuf, unsigned char *buf, int off)
-{
- int j;
- int len;
- int i = 0;
- int pd;
- char buffer[256];
-
- i++; /* index -> length */
- len = buf[i];
-
- i++; /* index -> PD */
- pd = buf[i];
-
- switch(pd)
- {
- case 0:
- strcpy(buffer, "user-specific");
- break;
- case 1:
- strcpy(buffer, "OSI high layer");
- break;
- case 2:
- strcpy(buffer, "X.244");
- break;
- case 3:
- strcpy(buffer, "reserved for sys mgmt");
- break;
- case 4:
- strcpy(buffer, "IA5 characters");
- break;
- case 5:
- strcpy(buffer, "X.208/X.209");
- break;
- case 7:
- strcpy(buffer, "V.120");
- break;
- case 8:
- strcpy(buffer, "Q.931/I.451");
- break;
- default:
- if(pd >= 0x10 && pd <= 0x3f)
- sprintf(buffer, "reserved incl X.31 (0x%2x)", pd);
- else if (pd >= 0x40 && pd <= 0x4f)
- sprintf(buffer, "national use (0x%2x)", pd);
- else if (pd >= 0x50 && pd <= 0xfe)
- sprintf(buffer, "reserved incl X.31 (0x%2x)", pd);
- else
- sprintf(buffer, "reserved (0x%2x)", pd);
- break;
- }
- sprintline(3, (pbuf+strlen(pbuf)), off+i, buf[i], 0xff, "protocol = %s", buffer);
-
- i++;
- len--;
-
- for(j = 0; j < len; j++)
- {
- if(isprint(buf[i+j]))
- sprintline(3, (pbuf+strlen(pbuf)), off+i+j, buf[i+j], 0xff, "user information = %c", buf[i+j]);
- else
- sprintline(3, (pbuf+strlen(pbuf)), off+i+j, buf[i+j], 0xff, "user information = 0x%2x", buf[i+j]);
- }
-
- i += j;
-
- return(i);
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdndecode/main.c b/usr.sbin/i4b/isdndecode/main.c
deleted file mode 100644
index 76afab1..0000000
--- a/usr.sbin/i4b/isdndecode/main.c
+++ /dev/null
@@ -1,794 +0,0 @@
-/*
- * Copyright (c) 1997, 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * main.c - isdndecode main program file
- * -------------------------------------
- *
- * $Id: main.c,v 1.13 2000/02/21 15:17:17 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Feb 21 16:19:30 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-#include <unistd.h>
-
-unsigned char buf[BSIZE];
-FILE *Fout = NULL;
-FILE *BP = NULL;
-int outflag = 1;
-int header = 1;
-int print_q921 = 1;
-int unit = 0;
-int dchan = 0;
-int bchan = 0;
-int traceon = 0;
-int analyze = 0;
-int Rx = RxUDEF;
-int Tx = TxUDEF;
-int f;
-int Bopt = 0;
-int Popt = 0;
-int bpopt = 0;
-int info = 0;
-int xflag = 0;
-
-int enable_trace = TRACE_D_RX | TRACE_D_TX;
-
-static char outfilename[1024];
-static char BPfilename[1024];
-
-static void dumpbuf( int n, unsigned char *buf, i4b_trace_hdr_t *hdr);
-static int switch_driver( int value, int rx, int tx );
-static void usage( void );
-static void exit_hdl( void );
-static void reopenfiles( int );
-
-
-/*---------------------------------------------------------------------------*
- * usage intructions
- *---------------------------------------------------------------------------*/
-void
-usage(void)
-{
- fprintf(stderr,"\n");
- fprintf(stderr,"isdndecode - isdn4bsd package ISDN decoder for passive cards (%d.%d.%d)\n", VERSION, REL, STEP);
- fprintf(stderr,"usage: isdntrace -a -b -d -f <file> -h -i -l -n <val> -o -p <file> -r -u <unit>\n");
- fprintf(stderr," -x -B -P -R <unit> -T <unit>\n");
- fprintf(stderr," -a analyzer mode ................................... (default off)\n");
- fprintf(stderr," -b switch B channel trace on ....................... (default off)\n");
- fprintf(stderr," -d switch D channel trace off ....................... (default on)\n");
- fprintf(stderr," -f <file> write output to file filename ........... (default %s0)\n", DECODE_FILE_NAME);
- fprintf(stderr," -h don't print header for each message ............. (default off)\n");
- fprintf(stderr," -i print I.430 (layer 1) INFO signals .............. (default off)\n");
- fprintf(stderr," -l don't decode low layer Q.921 messages ........... (default off)\n");
- fprintf(stderr," -o don't write output to a file .................... (default off)\n");
- fprintf(stderr," -p <file> specify filename for -B and -P ........ (default %s0)\n", BIN_FILE_NAME);
- fprintf(stderr," -u <unit> specify controller unit number ............... (default unit 0)\n");
- fprintf(stderr," -x print packets with unknown protocoldiscriminator (default off)\n");
- fprintf(stderr," -B write binary trace data to file filename ........ (default off)\n");
- fprintf(stderr," -P playback from binary trace data file ............ (default off)\n");
- fprintf(stderr," -R <unit> analyze Rx controller unit number (for -a) ... (default unit %d)\n", RxUDEF);
- fprintf(stderr," -T <unit> analyze Tx controller unit number (for -a) ... (default unit %d)\n", TxUDEF);
- fprintf(stderr,"\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * main
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char *argv[])
-{
- char devicename[80];
- char headerbuf[256];
-
- int n;
- int c;
- char *b;
-
- char *outfile = DECODE_FILE_NAME;
- char *binfile = BIN_FILE_NAME;
- int outfileset = 0;
- time_t tm;
-
- i4b_trace_hdr_t *ithp = NULL;
- int l;
-
- b = &buf[sizeof(i4b_trace_hdr_t)];
-
- while( (c = getopt(argc, argv, "abdf:hiln:op:u:xBPR:T:")) != -1)
- {
- switch(c)
- {
- case 'a':
- analyze = 1;
- break;
-
- case 'b':
- enable_trace |= (TRACE_B_RX | TRACE_B_TX);
- break;
-
- case 'd':
- enable_trace &= (~(TRACE_D_TX | TRACE_D_RX));
- break;
-
- case 'o':
- outflag = 0;
- break;
-
- case 'f':
- outfile = optarg;
- outfileset = 1;
- break;
-
- case 'h':
- header = 0;
- break;
-
- case 'i':
- enable_trace |= TRACE_I;
- info = 1;
- break;
-
- case 'l':
- print_q921 = 0;
- break;
-
- case 'p':
- binfile = optarg;
- bpopt = 1;
- break;
-
- case 'u':
- unit = atoi(optarg);
- if(unit < 0 || unit >= MAX_CONTROLLERS)
- usage();
- break;
-
- case 'x':
- xflag = 1;
- break;
-
- case 'B':
- Bopt = 1;
- break;
-
- case 'P':
- Popt = 1;
- break;
-
- case 'R':
- Rx = atoi(optarg);
- if(Rx < 0 || Rx >= MAX_CONTROLLERS)
- usage();
- break;
-
- case 'T':
- Tx = atoi(optarg);
- if(Tx < 0 || Tx >= MAX_CONTROLLERS)
- usage();
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(enable_trace == 0)
- usage();
-
- if(Bopt && Popt)
- usage();
-
- atexit(exit_hdl);
-
- if(Bopt)
- {
- if(bpopt)
- sprintf(BPfilename, "%s", binfile);
- else
- sprintf(BPfilename, "%s%d", BIN_FILE_NAME, unit);
-
- if((BP = fopen(BPfilename, "r")) != NULL)
- {
- char buffer[1024];
- fclose(BP);
- sprintf(buffer, "%s%s", BPfilename, DECODE_FILE_NAME_BAK);
- rename(BPfilename, buffer);
- }
- if((BP = fopen(BPfilename, "w")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting file [%s] to unbuffered", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(Popt)
- {
- if(bpopt)
- sprintf(BPfilename, "%s", binfile);
- else
- sprintf(BPfilename, "%s%d", BIN_FILE_NAME, unit);
-
- if((BP = fopen(BPfilename, "r")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
- else
- {
- sprintf(devicename, "%s%d", I4BTRC_DEVICE, unit);
-
- if((f = open(devicename, O_RDWR)) < 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening trace device [%s]", devicename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(outflag)
- {
- if(outfileset == 0)
- sprintf(outfilename, "%s%d", DECODE_FILE_NAME, unit);
- else
- strcpy(outfilename, outfile);
-
-
- if((Fout = fopen(outfilename, "r")) != NULL)
- {
- char buffer[1024];
- fclose(Fout);
- sprintf(buffer, "%s%s", outfilename, DECODE_FILE_NAME_BAK);
- rename(outfilename, buffer);
- }
-
- if((Fout = fopen(outfilename, "w")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", outfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting file [%s] to unbuffered", outfile);
- perror(buffer);
- exit(1);
- }
- }
-
- if((setvbuf(stdout, (char *)NULL, _IOLBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting stdout to line-buffered");
- perror(buffer);
- exit(1);
- }
-
- if(!Popt)
- {
- if((switch_driver(enable_trace, Rx, Tx)) == -1)
- exit(1);
- else
- traceon = 1;
- }
-
- signal(SIGHUP, SIG_IGN); /* ignore hangup signal */
- signal(SIGUSR1, reopenfiles); /* rotate logfile(s) */
-
- time(&tm);
-
- if(analyze)
- {
- sprintf(headerbuf, "\n==== isdnanalyze controller rx #%d - tx #%d ==== started %s",
- Rx, Tx, ctime(&tm));
- }
- else
- {
- sprintf(headerbuf, "\n=========== isdntrace controller #%d =========== started %s",
- unit, ctime(&tm));
- }
-
- printf("%s", headerbuf);
-
- if(outflag)
- fprintf(Fout, "%s", headerbuf);
-
- for (;;)
- {
- if(Popt == 0)
- {
- n = read(f, buf, BSIZE);
-
- if(Bopt)
- {
- if((fwrite(buf, 1, n, BP)) != n)
- {
- char buffer[80];
- sprintf(buffer, "Error writing file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- n -= sizeof(i4b_trace_hdr_t);
- }
- else
- {
- if((fread(buf, 1, sizeof(i4b_trace_hdr_t), BP)) != sizeof(i4b_trace_hdr_t))
- {
- if(feof(BP))
- {
- printf("\nEnd of playback input file reached.\n");
- exit(0);
- }
- else
- {
- char buffer[80];
- sprintf(buffer, "Error reading hdr from file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- ithp = (i4b_trace_hdr_t *)buf;
- l = ithp->length - sizeof(i4b_trace_hdr_t);
-
- if((n = fread(buf+sizeof(i4b_trace_hdr_t), 1, l , BP)) != l)
- {
- char buffer[80];
- sprintf(buffer, "Error reading data from file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- }
-
- if(n > 0)
- {
- dumpbuf(n, b, (i4b_trace_hdr_t *)buf);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * format header into static buffer, return buffer address
- *---------------------------------------------------------------------------*/
-char *
-fmt_hdr(i4b_trace_hdr_t *hdr, int frm_len)
-{
- struct tm *s;
- static char hbuf[256];
- int i = 0;
-
- s = localtime((time_t *)&(hdr->time.tv_sec));
-
- if(hdr->type == TRC_CH_I) /* Layer 1 INFO's */
- {
- sprintf(hbuf,"\n-- %s - unit:%d ---------------- time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec);
- }
- else
- {
- if(hdr->trunc > 0)
- {
- sprintf(hbuf,"\n-- %s - unit:%d - frame:%6.6u - time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u - length:%d (%d) ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- hdr->count,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec,
- frm_len,
- hdr->trunc);
- }
- else
- {
- sprintf(hbuf,"\n-- %s - unit:%d - frame:%6.6u - time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u - length:%d ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- hdr->count,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec,
- frm_len);
- }
- }
-
- for(i=strlen(hbuf); i <= NCOLS;)
- hbuf[i++] = '-';
-
- hbuf[i++] = '\n';
- hbuf[i] = '\0';
-
- return(hbuf);
-}
-
-/*---------------------------------------------------------------------------*
- * decode protocol and output to file(s)
- *---------------------------------------------------------------------------*/
-static void
-dumpbuf(int n, unsigned char *buf, i4b_trace_hdr_t *hdr)
-{
- static char l1buf[128];
- static unsigned char l2buf[32000];
- static unsigned char l3buf[32000];
- int cnt;
- int nsave = n;
- char *pbuf;
- int i, j;
-
- l1buf[0] = '\0';
- l2buf[0] = '\0';
- l3buf[0] = '\0';
-
- switch(hdr->type)
- {
- case TRC_CH_I: /* Layer 1 INFO's */
- if(enable_trace & TRACE_I)
- layer1(l1buf, buf);
- break;
-
- case TRC_CH_D: /* D-channel data */
- cnt = layer2(l2buf, buf, hdr->dir, print_q921);
-
- if(print_q921 == 0)
- l2buf[0] = '\0';
-
- n -= cnt;
- buf += cnt;
-
- if(n)
- {
- if((*buf != 0x08) && (xflag == 0))
- {
- l2buf[0] = '\0';
- l3buf[0] = '\0';
- break;
- }
- layer3(l3buf, n, cnt, buf);
- }
- break;
-
- default: /* B-channel data */
-
- pbuf = &l2buf[0];
-
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"B%d:%.3x ", hdr->type, i);
-
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
-
- sprintf((pbuf+strlen(pbuf))," ");
-
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
-
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- break;
- }
-
- if(header && ((l1buf[0] != '\0' || l2buf[0] != '\0') || (l3buf[0] != 0)))
- {
- char *p;
- p = fmt_hdr(hdr, nsave);
- printf("%s", p);
- if(outflag)
- fprintf(Fout, "%s", p);
- }
-
- if(l1buf[0] != '\0')
- {
- printf("%s", l1buf);
- if(outflag)
- fprintf(Fout, "%s", l1buf);
- }
-
- if(l2buf[0] != '\0')
- {
- printf("%s", l2buf);
- if(outflag)
- fprintf(Fout, "%s", l2buf);
- }
-
- if(l3buf[0] != '\0')
- {
- printf("%s", l3buf);
- if(outflag)
- fprintf(Fout, "%s", l3buf);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * exit handler function to be called at program exit
- *---------------------------------------------------------------------------*/
-void
-exit_hdl()
-{
- if(traceon)
- switch_driver(TRACE_OFF, Rx, Tx);
-}
-
-/*---------------------------------------------------------------------------*
- * switch driver debugging output on/off
- *---------------------------------------------------------------------------*/
-static int
-switch_driver(int value, int rx, int tx)
-{
- char buffer[80];
- int v = value;
-
- if(analyze == 0)
- {
- if(ioctl(f, I4B_TRC_SET, &v) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_SET, val = %d", v);
- perror(buffer);
- return(-1);
- }
- }
- else
- {
- if(value == TRACE_OFF)
- {
- if(ioctl(f, I4B_TRC_RESETA, &v) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_RESETA - ");
- perror(buffer);
- return(-1);
- }
- }
- else
- {
- i4b_trace_setupa_t tsa;
-
- tsa.rxunit = rx;
- tsa.rxflags = value;
- tsa.txunit = tx;
- tsa.txflags = value;
-
- if(ioctl(f, I4B_TRC_SETA, &tsa) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_SETA, val = %d", v);
- perror(buffer);
- return(-1);
- }
- }
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * reopen files to support rotating logfile(s) on SIGUSR1
- *
- * based on an idea from Ripley (ripley@nostromo.in-berlin.de)
- *
- * close file and reopen it for append. this will be a nop
- * if the previously opened file hasn't moved but will open
- * a new one otherwise, thus enabling a rotation...
- *
- *---------------------------------------------------------------------------*/
-static void
-reopenfiles(int dummy)
-{
- if(outflag)
- {
- fclose(Fout);
-
- if((Fout = fopen(outfilename, "a")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-opening file [%s]", outfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-setting file [%s] to unbuffered", outfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(Bopt)
- {
-
- fclose(BP);
-
- if((BP = fopen(BPfilename, "a")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-setting file [%s] to unbuffered", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * decode extension bit
- *---------------------------------------------------------------------------*/
-void
-extension(int layer, char *buffer, int cnt, unsigned char value, unsigned char mask)
-{
- sprintline(layer, buffer, cnt, value, mask, "Extension Bit = %c (%s)",
- (value & mask) ? '1' : '0',
- (value & mask) ? "no extension, final octet" : "with extension, octet follows");
-}
-
-/*---------------------------------------------------------------------------*
- * print bits as 0/1 available for mask
- *---------------------------------------------------------------------------*/
-static char *
-print_bits(unsigned char val, unsigned char mask)
-{
- static char buffer[10];
- int i = 0;
- int length = 8;
-
- while(length--)
- {
- if(mask & 0x80)
- {
- if(val & 0x80)
- buffer[i++] = '1';
- else
- buffer[i++] = '0';
- }
- else
- {
- buffer[i++] = '-';
- }
- val = val << 1;
- mask = mask << 1;
- }
- buffer[i] = '\0';
- return(buffer);
-}
-
-/*---------------------------------------------------------------------------*
- * print one decoded output line
- *---------------------------------------------------------------------------*/
-void
-sprintline(int layer, char *buffer, int oct_count, int oct_val,
- int oct_mask, const char *fmt, ...)
-{
- char lbuffer[256];
- static int lastcount = -1;
- char *ptr;
- va_list ap;
-
- va_start(ap, fmt);
-
- if(oct_count != lastcount)
- {
- lastcount = oct_count;
-
- sprintf(lbuffer, "L%d %2d %02X %s ",
- layer,
- oct_count,
- oct_val,
- print_bits(oct_val, oct_mask));
- }
- else
- {
- sprintf(lbuffer, " %s ",
- print_bits(oct_val, oct_mask));
- }
-
- vsprintf(lbuffer+strlen(lbuffer), fmt, ap);
-
- va_end(ap);
-
- sprintf(lbuffer+strlen(lbuffer), "\n");
-
- if((ptr = rindex(lbuffer, '(')) != NULL)
- {
- char *s = lbuffer;
- char *b = buffer;
- int len = strlen(lbuffer);
- int i;
-
- for(s = lbuffer; s < ptr; *b++ = *s++)
- ;
- for(i = 0;(i+len) <= NCOLS; *b++ = ' ', i++)
- ;
- for(; *s; *b++ = *s++)
- ;
- *b = '\0';
- }
- else
- {
- strcpy(buffer, lbuffer);
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/pcause.c b/usr.sbin/i4b/isdndecode/pcause.c
deleted file mode 100644
index 610a960..0000000
--- a/usr.sbin/i4b/isdndecode/pcause.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcause.c - printing cause values
- * --------------------------------
- *
- * $Id: pcause.c,v 1.5 1999/12/13 21:25:25 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:51:20 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "decode.h"
-#include "pcause.h"
-
-char *
-print_cause_q850(unsigned char code)
-{
- static char error_message[120];
- char *e;
-
- switch(code)
- {
- case CAUSE_Q850_SHUTDN:
- e = "normal D-channel shutdown";
- break;
-
- case CAUSE_Q850_NUNALLC:
- e = "Unallocated (unassigned) number";
- break;
-
- case CAUSE_Q850_NRTTN:
- e = "No route to specified transit network";
- break;
-
- case CAUSE_Q850_NRTDST:
- e = "No route to destination";
- break;
-
- case CAUSE_Q850_SSINFTN:
- e = "Send special information tone";
- break;
-
- case CAUSE_Q850_MDIALTP:
- e = "Misdialled trunk prefix";
- break;
-
- case CAUSE_Q850_CHUNACC:
- e = "Channel unacceptable";
- break;
-
- case CAUSE_Q850_CALLAWD:
- e = "Call awarded and being delivered in an established channel";
- break;
-
- case CAUSE_Q850_PREEMPT:
- e = "Preemption";
- break;
-
- case CAUSE_Q850_PREECRR:
- e = "Preemption - circuit reserved for reuse";
- break;
-
- case CAUSE_Q850_NCCLR:
- e = "Normal call clearing";
- break;
-
- case CAUSE_Q850_USRBSY:
- e = "User busy";
- break;
-
- case CAUSE_Q850_NOUSRRSP:
- e = "No user responding";
- break;
-
- case CAUSE_Q850_NOANSWR:
- e = "No answer from user (user alerted)";
- break;
-
- case CAUSE_Q850_SUBSABS:
- e = "Subscriber absent";
- break;
-
- case CAUSE_Q850_CALLREJ:
- e = "Call rejected";
- break;
-
- case CAUSE_Q850_NUCHNG:
- e = "Number changed";
- break;
-
- case CAUSE_Q850_NONSELUC:
- e = "Non-selected user clearing";
- break;
-
- case CAUSE_Q850_DSTOOORDR:
- e = "Destination out of order";
- break;
-
- case CAUSE_Q850_INVNUFMT:
- e = "Invalid number format";
- break;
-
- case CAUSE_Q850_FACREJ:
- e = "Facility rejected";
- break;
-
- case CAUSE_Q850_STENQRSP:
- e = "Response to STATUS ENQUIRY";
- break;
-
- case CAUSE_Q850_NORMUNSP:
- e = "Normal, unspecified";
- break;
-
- case CAUSE_Q850_NOCAVAIL:
- e = "No circuit / channel available";
- break;
-
- case CAUSE_Q850_NETOOORDR:
- e = "Network out of order";
- break;
-
- case CAUSE_Q850_PFMCDOOSERV:
- e = "Permanent frame mode connection out of service";
- break;
-
- case CAUSE_Q850_PFMCOPER:
- e = "Permanent frame mode connection operational";
- break;
-
- case CAUSE_Q850_TMPFAIL:
- e = "Temporary failure";
- break;
-
- case CAUSE_Q850_SWEQCONG:
- e = "Switching equipment congestion";
- break;
-
- case CAUSE_Q850_ACCINFDIS:
- e = "Access information discarded";
- break;
-
- case CAUSE_Q850_REQCNOTAV:
- e = "Requested circuit/channel not available";
- break;
-
- case CAUSE_Q850_PRECALBLK:
- e = "Precedence call blocked";
- break;
-
- case CAUSE_Q850_RESUNAVAIL:
- e = "Resources unavailable, unspecified";
- break;
-
- case CAUSE_Q850_QOSUNAVAIL:
- e = "Quality of service unavailable";
- break;
-
- case CAUSE_Q850_REQSERVNS:
- e = "Requested facility not subscribed";
- break;
-
- case CAUSE_Q850_OCBARRCUG:
- e = "Outgoing calls barred within CUG";
- break;
-
- case CAUSE_Q850_ICBARRCUG:
- e = "Incoming calls barred within CUG";
- break;
-
- case CAUSE_Q850_BCAPNAUTH:
- e = "Bearer capability not authorized";
- break;
-
- case CAUSE_Q850_BCAPNAVAIL:
- e = "Bearer capability not presently available";
- break;
-
- case CAUSE_Q850_INCSTOACISC:
- e = "Inconsistenciy in designated outg. access info and subscriber class";
- break;
-
- case CAUSE_Q850_SOONOTAVAIL:
- e = "Service or option not available, unspecified";
- break;
-
- case CAUSE_Q850_BCAPNOTIMPL:
- e = "Bearer capability not implemented";
- break;
-
- case CAUSE_Q850_CHTYPNIMPL:
- e = "Channel type not implemented";
- break;
-
- case CAUSE_Q850_REQFACNIMPL:
- e = "Requested facility not implemented";
- break;
-
- case CAUSE_Q850_ORDINBCAVL:
- e = "Only restricted digital information bearer capability is available";
- break;
-
- case CAUSE_Q850_SOONOTIMPL:
- e = "Service or option not implemented, unspecified";
- break;
-
- case CAUSE_Q850_INVCLRFVAL:
- e = "Invalid call reference value";
- break;
-
- case CAUSE_Q850_IDCHDNOEX:
- e = "Identified channel does not exist";
- break;
-
- case CAUSE_Q850_SUSCAEXIN:
- e = "A suspended call exists, but this call identity does not";
- break;
-
- case CAUSE_Q850_CLIDINUSE:
- e = "Call identity in use";
- break;
-
- case CAUSE_Q850_NOCLSUSP:
- e = "No call suspended";
- break;
-
- case CAUSE_Q850_CLIDCLRD:
- e = "Call having the requested call identity has been cleared";
- break;
-
- case CAUSE_Q850_UNOTMEMCUG:
- e = "User not member of CUG";
- break;
-
- case CAUSE_Q850_INCDEST:
- e = "Incompatible destination";
- break;
-
- case CAUSE_Q850_NONEXCUG:
- e = "Non-existent CUG";
- break;
-
- case CAUSE_Q850_INVNTWSEL:
- e = "Invalid transit network selection";
- break;
-
- case CAUSE_Q850_INVMSG:
- e = "Invalid message, unspecified";
- break;
-
- case CAUSE_Q850_MIEMISS:
- e = "Mandatory information element is missing";
- break;
-
- case CAUSE_Q850_MSGTNI:
- e = "Message type non-existent or not implemented";
- break;
-
- case CAUSE_Q850_MSGNCMPT:
- e = "Msg incompatible with call state/message type non-existent/not implemented";
- break;
-
- case CAUSE_Q850_IENENI:
- e = "Information element/parameter non-existent or not implemented";
- break;
-
- case CAUSE_Q850_INVIEC:
- e = "Invalid information element contents";
- break;
-
- case CAUSE_Q850_MSGNCWCS:
- e = "Message not compatible with call state";
- break;
-
- case CAUSE_Q850_RECOTIMEXP:
- e = "Recovery on timer expiry";
- break;
-
- case CAUSE_Q850_PARMNENIPO:
- e = "Parameter non-existent or not implemented, passed on";
- break;
-
- case CAUSE_Q850_MSGUNRDPRM:
- e = "Message with unrecognized parameter, discarded";
- break;
-
- case CAUSE_Q850_PROTERR:
- e = "Protocol error, unspecified";
- break;
-
- case CAUSE_Q850_INTWRKU:
- e = "Interworking, unspecified";
- break;
-
- default:
- e = "ERROR, unknown cause value!";
- break;
- }
-
- sprintf(error_message, "%d: %s (Q.850)", code, e);
- return(error_message);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdndecode/pcause.h b/usr.sbin/i4b/isdndecode/pcause.h
deleted file mode 100644
index 2c1c7f4..0000000
--- a/usr.sbin/i4b/isdndecode/pcause.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcause.h - Q.850 causes definitions
- * -----------------------------------
- *
- * $Id: pcause.h,v 1.4 1999/12/13 21:25:25 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:51:32 1999]
- *
- *---------------------------------------------------------------------------*/
-
-char *print_cause_q850(unsigned char code);
-
-/* Q.850 causes */
-
-#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 */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnmonitor/Makefile b/usr.sbin/i4b/isdnmonitor/Makefile
deleted file mode 100644
index ed241c1..0000000
--- a/usr.sbin/i4b/isdnmonitor/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD$
-
-PROG= isdnmonitor
-MAN= isdnmonitor.8
-SRCS= main.c curses.c
-
-# compile debug support
-CFLAGS+= -DDEBUG
-
-# avoid wacky merging of string constants from
-# source code with compile-time timestamp
-CFLAGS+= -fno-merge-constants
-
-DPADD= ${LIBCURSES}
-LDADD= -lcurses
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdnmonitor/curses.c b/usr.sbin/i4b/isdnmonitor/curses.c
deleted file mode 100644
index 1e7eec1..0000000
--- a/usr.sbin/i4b/isdnmonitor/curses.c
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- * Copyright (c) 1999 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 daemon - curses fullscreen output
- * -------------------------------------
- *
- * $Id: curses.c,v 1.10 1999/12/13 21:25:25 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:51:47 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "monprivate.h"
-
-#ifndef WIN32
-
-static void display_bell(void);
-static void display_chans(void);
-
-/*---------------------------------------------------------------------------*
- * program exit
- *---------------------------------------------------------------------------*/
-void
-do_exit(int exitval)
-{
- if(curses_ready)
- endwin();
- exit(exitval);
-}
-
-/*---------------------------------------------------------------------------*
- * init curses fullscreen display
- *---------------------------------------------------------------------------*/
-void
-init_screen(void)
-{
- char buffer[512];
- int uheight, lheight;
- int i, j;
-
- initscr(); /* curses init */
-
- if((COLS < 80) || (LINES < 24))
- {
- endwin();
- fprintf(stderr, "ERROR, minimal screensize must be 80x24, is %dx%d, terminating!",COLS, LINES);
- exit(1);
- }
-
- noecho();
- raw();
-
- uheight = nctrl * 2; /* cards * b-channels */
- lheight = LINES - uheight - 6 + 1; /* rest of display */
-
- if((upper_w = newwin(uheight, COLS, UPPER_B, 0)) == NULL)
- {
- endwin();
- fprintf(stderr, "ERROR, curses init upper window, terminating!");
- exit(1);
- }
-
- if((mid_w = newwin(1, COLS, UPPER_B+uheight+1, 0)) == NULL)
- {
- endwin();
- fprintf(stderr, "ERROR, curses init mid window, terminating!");
- exit(1);
- }
-
- if((lower_w = newwin(lheight, COLS, UPPER_B+uheight+3, 0)) == NULL)
- {
- endwin();
- fprintf(stderr, "ERROR, curses init lower window, LINES = %d, lheight = %d, uheight = %d, terminating!", LINES, lheight, uheight);
- exit(1);
- }
-
- scrollok(lower_w, 1);
-
- sprintf(buffer, "----- isdn controller channel state ------------- isdnmonitor %02d.%02d.%d -", VERSION, REL, STEP);
-
- while(strlen(buffer) < COLS)
- strcat(buffer, "-");
-
- move(0, 0);
- standout();
- addstr(buffer);
- standend();
-
- move(1, 0);
- /* 01234567890123456789012345678901234567890123456789012345678901234567890123456789 */
- addstr("c tei b remote iface dir outbytes obps inbytes ibps units");
-
- if(hostname)
- sprintf(buffer, "----- isdn userland interface state ------------- %s:%d -", hostname, portno);
- else
- sprintf(buffer, "----- isdn userland interface state ------------- %s -", sockpath);
-
- while(strlen(buffer) < COLS)
- strcat(buffer, "-");
-
- move(uheight+2, 0);
- standout();
- addstr(buffer);
- standend();
-
- sprintf(buffer, "----- isdnd logfile display --------------------------------------------------");
- while(strlen(buffer) < COLS)
- strcat(buffer, "-");
-
- move(uheight+4, 0);
- standout();
- addstr(buffer);
- standend();
-
- refresh();
-
- for(i=0, j=0; i <= nctrl; i++, j+=2)
- {
- mvwprintw(upper_w, j, H_CNTL, "%d --- 1 ", i); /*TEI*/
- mvwprintw(upper_w, j+1, H_CNTL, " L12 2 ");
- }
- wrefresh(upper_w);
-
-#ifdef NOTDEF
- for(i=0, j=0; i < nentries; i++) /* walk thru all entries */
- {
- p = &cfg_entry_tab[i]; /* get ptr to enry */
-
- mvwprintw(mid_w, 0, j, "%s%d ", bdrivername(p->usrdevicename), p->usrdeviceunit);
-
- p->fs_position = j;
-
- j += ((strlen(bdrivername(p->usrdevicename)) + (p->usrdeviceunit > 9 ? 2 : 1) + 1));
- }
-#else
- mvwprintw(mid_w, 0, 0, "%s", devbuf);
-#endif
- wrefresh(mid_w);
-
- wmove(lower_w, 0, 0);
- wrefresh(lower_w);
-
- curses_ready = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * display the charge in units
- *---------------------------------------------------------------------------*/
-void
-display_charge(int pos, int charge)
-{
- mvwprintw(upper_w, pos, H_UNITS, "%d", charge);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display the calculated charge in units
- *---------------------------------------------------------------------------*/
-void
-display_ccharge(int pos, int units)
-{
- mvwprintw(upper_w, pos, H_UNITS, "(%d)", units);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display accounting information
- *---------------------------------------------------------------------------*/
-void
-display_acct(int pos, int obyte, int obps, int ibyte, int ibps)
-{
- mvwprintw(upper_w, pos, H_OUT, "%-10d", obyte);
- mvwprintw(upper_w, pos, H_OUTBPS, "%-4d", obps);
- mvwprintw(upper_w, pos, H_IN, "%-10d", ibyte);
- mvwprintw(upper_w, pos, H_INBPS, "%-4d", ibps);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * erase line at disconnect time
- *---------------------------------------------------------------------------*/
-void
-display_disconnect(int pos)
-{
- wmove(upper_w, pos, H_TELN);
- wclrtoeol(upper_w);
- wrefresh(upper_w);
-
- if(do_bell)
- display_bell();
-}
-
-/*---------------------------------------------------------------------------*
- * display interface up/down information
- *---------------------------------------------------------------------------*/
-void
-display_updown(int pos, int updown, char *device)
-{
- if(updown)
- wstandend(mid_w);
- else
- wstandout(mid_w);
-
- mvwprintw(mid_w, 0, pos, "%s ", device);
-
- wstandend(mid_w);
- wrefresh(mid_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display interface up/down information
- *---------------------------------------------------------------------------*/
-void
-display_l12stat(int controller, int layer, int state)
-{
- if(controller > nctrl)
- return;
-
- if(!(layer == 1 || layer == 2))
- return;
-
- if(state)
- wstandout(upper_w);
- else
- wstandend(upper_w);
-
- if(layer == 1)
- {
- mvwprintw(upper_w, (controller*2)+1, H_TEI+1, "1");
-
- if(!state)
- mvwprintw(upper_w, (controller*2)+1, H_TEI+2, "2");
- }
- else if(layer == 2)
- {
- mvwprintw(upper_w, (controller*2)+1, H_TEI+2, "2");
- if(state)
- mvwprintw(upper_w, (controller*2)+1, H_TEI+1, "1");
- }
-
- wstandend(upper_w);
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display TEI
- *---------------------------------------------------------------------------*/
-void
-display_tei(int controller, int tei)
-{
- if(controller > nctrl)
- return;
-
- if(tei == -1)
- mvwprintw(upper_w, controller*2, H_TEI, "---");
- else
- mvwprintw(upper_w, controller*2, H_TEI, "%3d", tei);
-
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display bell :-)
- *---------------------------------------------------------------------------*/
-static void
-display_bell(void)
-{
- static char bell[1] = { 0x07 };
- write(STDOUT_FILENO, &bell[0], 1);
-}
-
-/*---------------------------------------------------------------------------*
- * curses menu for fullscreen command mode
- *---------------------------------------------------------------------------*/
-void
-do_menu(void)
-{
- static char *menu[WMITEMS] =
- {
- "1 - (D)isplay refresh",
- "2 - (H)angup (choose a channel)",
- "3 - (R)eread config file",
- "4 - (Q)uit the program",
- };
-
- WINDOW *menu_w;
- int c;
- int mpos;
- fd_set set;
- struct timeval timeout;
-
- /* create a new window in the lower screen area */
-
- if((menu_w = newwin(WMENU_HGT, WMENU_LEN, WMENU_POSLN, WMENU_POSCO )) == NULL)
- {
- return;
- }
-
- /* create a border around the window */
-
- box(menu_w, '|', '-');
-
- /* add a title */
-
- wstandout(menu_w);
- mvwaddstr(menu_w, 0, (WMENU_LEN / 2) - (strlen(WMENU_TITLE) / 2), WMENU_TITLE);
- wstandend(menu_w);
-
- /* fill the window with the menu options */
-
- for(mpos=0; mpos <= (WMITEMS-1); mpos++)
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
-
- /* highlight the first menu option */
-
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
-
- /* input loop */
-
- for(;;)
- {
- wrefresh(menu_w);
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = WMTIMEOUT;
- timeout.tv_usec = 0;
-
- /* if no char is available within timeout, exit menu*/
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- goto mexit;
-
- c = wgetch(menu_w);
-
- switch(c)
- {
- case ' ':
- case '\t': /* hilite next option */
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- mpos++;
- if(mpos >= WMITEMS)
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case ('0'+WREFRESH+1): /* display refresh */
- case 'D':
- case 'd':
- wrefresh(curscr);
- goto mexit;
-
- case ('0'+WQUIT+1): /* quit program */
- case 'Q':
- case 'q':
- do_exit(0);
- goto mexit;
-
-
- case ('0'+WHANGUP+1): /* hangup connection */
- case 'H':
- case 'h':
- display_chans();
- goto mexit;
-
- case ('0'+WREREAD+1): /* reread config file */
- case 'R':
- case 'r':
- reread();
- goto mexit;
-
- case '\n':
- case '\r': /* exec highlighted option */
- switch(mpos)
- {
- case WREFRESH:
- wrefresh(curscr);
- break;
-
- case WQUIT:
- do_exit(0);
- break;
-
- case WHANGUP:
- display_chans();
- break;
-
- case WREREAD:
- reread();
- break;
- }
- goto mexit;
- break;
-
- default:
- goto mexit;
- break;
- }
- }
-
-mexit:
- /* delete the menu window */
-
- delwin(menu_w);
-
- /* re-display the original lower window contents */
-
- touchwin(lower_w);
- wrefresh(lower_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display connect information
- *---------------------------------------------------------------------------*/
-void
-display_connect(int pos, int dir, char *name, char *remtel, char *dev)
-{
- char buffer[256];
-
- /* remote telephone number */
-
- sprintf(buffer, "%s/%s", name, remtel);
-
- buffer[H_IFN - H_TELN - 1] = '\0';
-
- mvwprintw(upper_w, pos, H_TELN, "%s", buffer);
-
- /* interface */
-
- mvwprintw(upper_w, pos, H_IFN, "%s ", dev);
-
- mvwprintw(upper_w, pos, H_IO, dir ? "out" : "in");
-
- mvwprintw(upper_w, pos, H_OUT, "-");
- mvwprintw(upper_w, pos, H_OUTBPS, "-");
- mvwprintw(upper_w, pos, H_IN, "-");
- mvwprintw(upper_w, pos, H_INBPS, "-");
-
- if(do_bell)
- display_bell();
-
- wrefresh(upper_w);
-}
-
-/*---------------------------------------------------------------------------*
- * display channel information for shutdown
- *---------------------------------------------------------------------------*/
-static void
-display_chans(void)
-{
- char buffer[80];
- int i;
- int cnt = 0;
- WINDOW *chan_w;
- int nlines, ncols, pos_x, pos_y;
- fd_set set;
- struct timeval timeout;
-
- /* need this later to close the connection */
- struct ctlr_chan {
- int cntl;
- int chn;
- } *cc = NULL;
-
- for(i = 0; i < nctrl; i++)
- {
- if(remstate[i].ch1state)
- cnt++;
- if(remstate[i].ch2state)
- cnt++;
- }
-
- if(cnt > 0)
- {
- if ((cc = (struct ctlr_chan *)malloc (cnt *
- sizeof (struct ctlr_chan))) == NULL)
- {
- return;
- }
- nlines = cnt + 4;
- ncols = 60;
- }
- else
- {
- nlines = 5;
- ncols = 22;
- }
-
- pos_y = WMENU_POSLN + 4;
- pos_x = WMENU_POSCO + 10;
-
- /* create a new window in the lower screen area */
-
- if((chan_w = newwin(nlines, ncols, pos_y, pos_x )) == NULL)
- {
- if (cnt > 0)
- free(cc);
- return;
- }
-
- /* create a border around the window */
-
- box(chan_w, '|', '-');
-
- /* add a title */
-
- wstandout(chan_w);
- mvwaddstr(chan_w, 0, (ncols / 2) - (strlen("Channels") / 2), "Channels");
- wstandend(chan_w);
-
- /* no active channels */
- if (cnt == 0)
- {
- mvwaddstr(chan_w, 2, 2, "No active channels");
- wrefresh(chan_w);
- sleep(1);
-
- /* delete the channels window */
-
- delwin(chan_w);
- return;
- }
-
- nlines = 2;
- ncols = 1;
-
- for (i = 0; i < nctrl; i++)
- {
- if(remstate[i].ch1state)
- {
- sprintf(buffer, "%d - Controller %d channel %s", ncols, i, "B1");
- mvwaddstr(chan_w, nlines, 2, buffer);
- cc[ncols - 1].cntl = i;
- cc[ncols - 1].chn = CHAN_B1;
- nlines++;
- ncols++;
- }
- if(remstate[i].ch2state)
- {
- sprintf(buffer, "%d - Controller %d channel %s", ncols, i, "B2");
- mvwaddstr(chan_w, nlines, 2, buffer);
- cc[ncols - 1].cntl = i;
- cc[ncols - 1].chn = CHAN_B2;
- nlines++;
- ncols++;
- }
- }
-
- for(;;)
- {
- wrefresh(chan_w);
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = WMTIMEOUT;
- timeout.tv_usec = 0;
-
- /* if no char is available within timeout, exit menu*/
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- break;
-
- ncols = wgetch(chan_w);
-
- if (!(isdigit(ncols)))
- {
- display_bell();
- continue;
- }
-
- nlines = ncols - '0';
-
- if ((nlines == 0) || (nlines > cnt))
- {
- display_bell();
- continue;
- }
-
- hangup(cc[nlines-1].cntl, cc[nlines-1].chn);
- break;
- }
-
- free(cc);
-
- /* delete the channels window */
-
- delwin(chan_w);
-}
-
-#endif /* !WIN32*/
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnmonitor/isdnmonitor.8 b/usr.sbin/i4b/isdnmonitor/isdnmonitor.8
deleted file mode 100644
index 46e1a37..0000000
--- a/usr.sbin/i4b/isdnmonitor/isdnmonitor.8
+++ /dev/null
@@ -1,178 +0,0 @@
-.\"
-.\" Copyright (c) 1999 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.
-.\"
-.\" $Id: isdnmonitor.8,v 1.8 1999/12/13 22:11:55 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Mon Dec 13 23:04:25 1999]
-.\"
-.Dd September 25, 1999
-.Dt ISDNMONITOR 8
-.Os
-.Sh NAME
-.Nm isdnmonitor
-.Nd isdn4bsd / isdnd remote monitoring tool
-.Sh SYNOPSIS
-.Nm
-.Op Fl c
-.Op Fl d Ar debuglevel
-.Op Fl f Ar filename
-.Op Fl h Ar hostspec
-.Op Fl l Ar pathname
-.Op Fl p Ar portspec
-.Sh DESCRIPTION
-The
-.Nm
-utility is used to remotely monitor the operation of the isdn daemon,
-.Xr isdnd 8 ,
-which manages all ISDN related connection and disconnection of ISDN
-devices supported by the isdn4bsd package.
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl c
-Switch to (curses-) fullscreen mode of operation.
-In this mode,
-.Nm
-behaves nearly exactly as
-.Xr isdnd 8
-in fullscreen mode.
-In fullscreen mode, entering the control character
-.Em Control-L
-causes the display to be refreshed and entering
-.Em Carriage-Return
-or
-.Em Enter
-will pop-up a command window.
-Because
-.Nm
-will not listen to messages while the command window is active,
-this command window will disappear automatically after 5 seconds without
-any command key press.
-.Pp
-While the command window is active,
-.Em Tab
-or
-.Em Space
-advances to the next menu item.
-To execute a command, press
-.Em Return
-or
-.Em Enter
-for the highlighted menu item, or enter the number corresponding to the
-item to be executed or enter the capitalized character in the menu item
-description.
-.It Fl d
-If debugging support is compiled into
-.Nm
-this option is used to specify the debugging level.
-.\" The debugging level is the sum of the
-.\" following values:
-.\" .Pp
-.\" .Bl -tag -width Ds -compact -offset indent
-.\" .It Ar 0x001
-.\" general debugging.
-.\" .It Ar 0x002
-.\" rates calculation.
-.\" .It Ar 0x004
-.\" timing calculations.
-.\" .It Ar 0x008
-.\" state transitions.
-.\" .It Ar 0x010
-.\" retry handling.
-.\" .It Ar 0x020
-.\" dialing.
-.\" .It Ar 0x040
-.\" process handling.
-.\" .It Ar 0x080
-.\" isdn4bsd kernel i/o calls.
-.\" .It Ar 0x100
-.\" controller and channel busy/free messages.
-.\" .It Ar 0x200
-.\" isdnmonitor.rc configuration file processing.
-.\" .El
-.\" .Pp
-.\" The value can be specified in any number base supported by the
-.\" .Xr sscanf 3
-.\" library routine.
-.Pp
-In addition, this option accepts also the character 'n' as an argument to
-disable displaying debug messages on the full-screen display.
-.Pp
-.It Fl f
-Specifying this option causes
-.Nm
-to write its normal output and - if enabled - debugging output to a file
-which name is specified as the argument.
-.It Fl l
-is used to specify a Unix local domain socket name to be used for communication
-between
-.Xr isdnd 8
-and
-.Nm .
-.It Fl h
-is used to specify a hostname or a dotted-quad IP address of a machine
-where an
-.Xr isdnd 8
-is running which should be monitored.
-.It Fl p
-This option may be used to specify a remote port number in conjunction
-with the
-.Fl h
-option.
-.El
-.Sh ENVIRONMENT
-The following environment variables affect the execution of
-.Nm :
-.Bl -tag -width Ds
-.It Ev TERM
-The terminal type when running in full-screen display mode.
-See
-.Xr environ 7
-for more information.
-.El
-.Sh EXIT STATUS
-Exit status is 0 on success, 1 on error.
-.Sh EXAMPLES
-For a first try, the following command should be used to start
-.Nm
-to monitor a locally running isdnd:
-.Bd -literal -offset indent
-isdnmonitor -h localhost
-.Ed
-.Sh SEE ALSO
-.Xr isdnd 8
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-utility was written by
-.An Martin Husemann
-and
-.An Hellmuth Michaelis Aq hm@kts.org .
-This manual page was written by
-.An Hellmuth Michaelis .
-.Sh BUGS
-Still one (or) more left.
diff --git a/usr.sbin/i4b/isdnmonitor/main.c b/usr.sbin/i4b/isdnmonitor/main.c
deleted file mode 100644
index 65ddb5b..0000000
--- a/usr.sbin/i4b/isdnmonitor/main.c
+++ /dev/null
@@ -1,1196 +0,0 @@
-/*
- * Copyright (c) 1998,1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - network monitor client
- * -----------------------------------
- *
- * $Id: main.c,v 1.35 2000/08/24 11:48:57 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:52:11 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <signal.h>
-#include <time.h>
-#include <errno.h>
-#ifndef WIN32
-#include <unistd.h>
-#include <netdb.h>
-#endif
-#include <sys/types.h>
-#ifndef WIN32
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/un.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#else
-#include <stdarg.h>
-#include <windows.h>
-extern char *optarg;
-int getopt(int nargc, char * const nargv[], const char *ostr);
-#define close(f) closesocket(f)
-#define sleep(s) Sleep(s*1000)
-#define vsnprintf _vsnprintf
-#define ssize_t long
-#endif
-#ifdef ERROR
-#undef ERROR
-#endif
-#ifdef __FreeBSD__
-#include <osreldate.h>
-#endif
-
-#define MAIN
-#include "monprivate.h"
-#undef MAIN
-
-#ifndef AF_LOCAL
-#define AF_LOCAL AF_UNIX
-#endif
-
-#ifdef DEBUG
-#include <ctype.h>
-#endif
-
-#include "monitor.h"
-
-/*
- * Local function prototypes
- */
-static int connect_local(char *sockpath);
-static int connect_remote(char *host, int portno);
-static void usage();
-static void mloop();
-static void handle_input();
-static void print_menu();
-static void print_logevent(time_t tstamp, int prio, char * what, char * msg);
-static void print_charge(time_t tstamp, int controller, int channel, int units, int estimated);
-static void print_connect(time_t tstamp, int dir, int controller, int channel, char * cfgname, char * devname, char * remphone, char * locphone);
-static void print_disconnect(time_t tstamp, int controller, int channel);
-static void print_updown(time_t tstamp, int contoller, int channel, int isup);
-static void handle_event(u_int8_t *msg, int len);
-#ifdef DEBUG
-static void dump_event(u_int8_t *msg, int len, int readflag);
-#endif
-
-static ssize_t sock_read(int fd, void *buf, size_t nbytes);
-static ssize_t sock_write(int fd, void *buf, size_t nbytes);
-
-static void mprintf(char *fmt, ...);
-
-/*
- * Global variables
- */
-static int debug = 0;
-#define DBG_DUMPALL 0x01
-#define DBG_PSEND 0x02
-
-static int monsock = -1;
-static int state = ST_INIT;
-static int sub_state = 0;
-static int sub_state_count = 0;
-
-static int isdn_major = 0;
-static int isdn_minor = 0;
-static u_int32_t rights = 0;
-
-static char *logfilename = NULL;
-static FILE *lfp = NULL;
-
-/*---------------------------------------------------------------------------
- * Display usage and exit
- *---------------------------------------------------------------------------*/
-static void
-usage()
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdnmonitor - version %02d.%02d.%d, (protocol %02d.%02d)\n", VERSION, REL, STEP, MPROT_VERSION, MPROT_REL);
-#ifdef FOREIGN
- fprintf(stderr, " usage: isdnmonitor [-c] [-d val] [-f name] [-h host] [-p port]\n");
-#else
- fprintf(stderr, " usage: isdnmonitor [-c] [-d val] [-f name] [-h host] [-l path] [-p port]\n");
-#endif
- fprintf(stderr, " -c switch to curses fullscreen output\n");
- fprintf(stderr, " -d <val> debug flags (see source ...)\n");
- fprintf(stderr, " -dn no debug output on fullscreen display\n");
- fprintf(stderr, " -f <name> filename to log output to\n");
- fprintf(stderr, " -h <host> hostname/address to connect to\n");
-#ifndef FOREIGN
- fprintf(stderr, " -l <path> pathname to local domain socket to connect to\n");
-#endif
- fprintf(stderr, " -p <port> portnumber to use to connect to remote host\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------
- * Parse command line, startup monitor client
- *---------------------------------------------------------------------------*/
-int main(int argc, char **argv)
-{
- int i;
-
-#ifdef WIN32
- WSADATA wsCaps;
- WSAStartup(MAKEWORD(2, 0), &wsCaps);
-#endif
-
- portno = DEF_MONPORT;
- devbuf[0] = '\0';
-
-#ifndef FOREIGN
- while((i = getopt(argc, argv, "cd:f:h:p:l:")) != -1)
-#else
- while((i = getopt(argc, argv, "cd:f:h:p:")) != -1)
-#endif
- {
- switch(i)
- {
- case 'c':
- fullscreen = 1;
- break;
- case 'd':
- if(*optarg == 'n')
- {
- debug_noscreen = 1;
- }
- else
- {
- if((sscanf(optarg, "%i", &debug)) != 1)
- usage();
- }
- break;
- case 'f':
- logfilename = optarg;
- break;
- case 'h':
- hostname = optarg;
- break;
-#ifndef FOREIGN
- case 'l':
- sockpath = optarg;
- break;
-#endif
- case 'p':
- if((sscanf(optarg, "%i", &portno)) != 1)
- usage();
- break;
- default:
- usage();
- break;
- }
- }
-
-#ifndef FOREIGN
- if(hostname && sockpath)
- {
- fprintf(stderr, "Error: can not use local socket path on remote machine\n"
- "conflicting options -h and -l!\n");
- return 1;
- }
-
- if(sockpath)
- {
- monsock = connect_local(sockpath);
- }
- else if(hostname)
-#else
- if(hostname)
-#endif
-
- {
- monsock = connect_remote(hostname, portno);
- }
- else
- {
- usage();
- }
-
- if(monsock == -1)
- {
- fprintf(stderr, "Could not connect to i4b isdn daemon.\n");
- return 1;
- }
-
- if(logfilename != NULL)
- {
- if((lfp = fopen(logfilename, "w")) == NULL)
- {
- fprintf(stderr, "could not open logfile [%s], %s\n", logfilename, strerror(errno));
- exit(1);
- }
- }
-
-#ifndef WIN32
- signal(SIGPIPE, SIG_IGN);
-#endif
-
- mloop();
-
- close(monsock);
-
- return 0;
-}
-
-/*---------------------------------------------------------------------------
- * Connect via tcp/ip.
- * Return socket if successfull, -1 on error.
- ---------------------------------------------------------------------------*/
-static int
-connect_remote(char *host, int portno)
-{
- struct sockaddr_in sa;
- struct hostent *h;
- int remotesockfd;
-
- h = gethostbyname(host);
-
- if(!h)
- {
- fprintf(stderr, "could not resolve hostname '%s'\n", host);
- exit(1);
- }
-
- remotesockfd = socket(AF_INET, SOCK_STREAM, 0);
-
- if(remotesockfd == -1)
- {
- fprintf(stderr, "could not create remote monitor socket: %s\n", strerror(errno));
- exit(1);
- }
-
- memset(&sa, 0, sizeof(sa));
-
-#ifdef BSD4_4
- sa.sin_len = sizeof(sa);
-#endif
- sa.sin_family = AF_INET;
- sa.sin_port = htons(portno);
-
- memcpy(&sa.sin_addr.s_addr, h->h_addr_list[0], sizeof(sa.sin_addr.s_addr));
-
- if(connect(remotesockfd, (struct sockaddr *)&sa, sizeof(sa)) == -1)
- {
- fprintf(stderr, "could not connect remote monitor: %s\n", strerror(errno));
- exit(1);
- }
-
- return remotesockfd;
-}
-
-#ifndef FOREIGN
-/*---------------------------------------------------------------------------
- * Connect local.
- * Return socket on success, -1 on failure.
- *---------------------------------------------------------------------------*/
-static int
-connect_local(char *sockpath)
-{
- int s;
- struct sockaddr_un sa;
-
- /* check path length */
- if(strlen(sockpath) >= sizeof(sa.sun_path))
- {
- fprintf(stderr, "pathname to long for local socket: %s\n",
- sockpath);
- exit(1);
- }
-
- /* create and setup socket */
- s = socket(AF_LOCAL, SOCK_STREAM, 0);
-
- if(s == -1)
- {
- fprintf(stderr, "could not create local monitor socket:%s\n", strerror(errno));
- exit(1);
- }
-
- memset(&sa, 0, sizeof(sa));
-
- sa.sun_len = sizeof(sa);
- sa.sun_family = AF_LOCAL;
- strcpy(sa.sun_path, sockpath);
-
- if(connect(s, (struct sockaddr *)&sa, sizeof(sa)))
- {
- fprintf(stderr, "could not connect local monitor socket [%s]: %s\n", sockpath, strerror(errno));
- }
-
- return s;
-}
-#endif
-
-/*---------------------------------------------------------------------------*
- * data from keyboard available, read and process it
- *---------------------------------------------------------------------------*/
-#ifndef WIN32
-static void
-kbdrdhdl(void)
-{
- int ch = getch();
-
- switch(ch)
- {
- case 0x0c: /* control L */
- wrefresh(curscr);
- break;
-
- case '\n':
- case '\r':
- do_menu();
- break;
- }
-}
-#endif
-
-/*---------------------------------------------------------------------------
- * main event loop
- *---------------------------------------------------------------------------*/
-static void
-mloop()
-{
- for(;;)
- {
- fd_set rd, wr, ex;
-
- FD_ZERO(&rd);
- FD_ZERO(&wr);
- FD_ZERO(&ex);
- FD_SET(fileno(stdin), &rd);
- FD_SET(monsock, &rd);
-
- select(monsock+1, &rd, &wr, &ex, NULL);
-
- if(FD_ISSET(fileno(stdin), &rd))
- {
-#ifndef WIN32
- if(fullscreen && curses_ready)
- kbdrdhdl();
- else
-#endif
- if(!fullscreen)
- handle_input();
- else
- getchar();
- }
-
- if(FD_ISSET(monsock, &rd))
- {
- u_int8_t buf[8192];
- int bytes, ret;
-
- /* Network transfer may deliver two or more packets concatenated.
- * Peek at the header and read only one event at a time... */
-
- bytes = recv(monsock, buf, I4B_MON_EVNT_HDR, MSG_PEEK);
-
- if(bytes == 0)
- {
- close(monsock);
-
-#ifndef WIN32
- if(curses_ready)
- {
- endwin();
- curses_ready = 0;
- }
-#endif
-
- mprintf("remote isdnd has closed our connection\n");
- exit(0);
- }
- else if(bytes < 0)
- {
- fprintf(stderr, "recv error: %s\n", strerror(errno));
- close(monsock);
- exit(1);
- }
-
- if (bytes < I4B_MON_EVNT_HDR)
- continue; /* errh? something must be wrong... */
-
- bytes = I4B_GET_2B(buf, I4B_MON_EVNT_LEN);
-
- if(bytes >= sizeof(buf))
- {
- fprintf(stderr, "mloop: socket recv buffer overflow %d!\n", bytes);
- break;
- }
-
- /* now we know the size, it fits, so lets read it! */
-
- ret = sock_read(monsock, buf, bytes);
-
- if(ret == 0)
- {
- close(monsock);
-#ifndef WIN32
- if(curses_ready)
- endwin();
-#endif
- mprintf("remote isdnd has closed our connection\n");
- exit(0);
- }
- else if(ret < 0)
- {
- mprintf("error reading from isdnd: %s", strerror(errno));
- break;
- }
-#ifdef DEBUG
- if(debug & DBG_DUMPALL)
- dump_event(buf, ret, 1);
-#endif
- handle_event(buf, ret);
- }
- }
-}
-
-#ifdef DEBUG
-/*
- * Dump a complete event packet.
- */
-static void dump_event(u_int8_t *msg, int len, int read)
-{
- int i;
-
- if(read)
- mprintf("read from socket:");
- else
- mprintf("write to socket:");
-
- for(i = 0; i < len; i++)
- {
- if(i % 8 == 0)
- mprintf("\n%02d: ", i);
- mprintf("0x%02x %c ", msg[i], isprint(msg[i]) ? msg[i] : '.');
- }
- mprintf("\n");
-}
-#endif
-
-static void
-print_logevent(time_t tstamp, int prio, char * what, char * msg)
-{
- char buf[256];
- strftime(buf, sizeof(buf), I4B_TIME_FORMAT, localtime(&tstamp));
- mprintf("log: %s prio %d what=%s msg=%s\n", buf, prio, what, msg);
-
-#ifndef WIN32
- if(fullscreen)
- {
- if((!debug_noscreen) || (debug_noscreen && (((strcmp(what, "DBG"))) != 0)))
- {
-/*
- * FreeBSD-current integrated ncurses. Since then it is no longer possible
- * to write to the last column in the logfilewindow without causing an
- * automatic newline to occur resulting in a blank line in that window.
- */
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 400009
-#warning "FreeBSD ncurses is buggy: write to last column = auto newline!"
- wprintw(lower_w, "%s %s %-.*s\n", buf, what,
- COLS-((strlen(buf))+(strlen(what))+3), msg);
-#else
- wprintw(lower_w, "%s %s %-.*s\n", buf, what,
- (int)(COLS-((strlen(buf))+(strlen(what))+2)), msg);
-#endif
- wrefresh(lower_w);
- }
- }
-#endif
-}
-
-static void
-print_charge(time_t tstamp, int controller, int channel, int units, int estimated)
-{
- char buf[256];
- strftime(buf, sizeof(buf), I4B_TIME_FORMAT, localtime(&tstamp));
- mprintf("%s: controller %d, channel %d, charge = %d%s\n",
- buf, controller, channel, units, estimated ? " (estimated)" : "");
-#ifndef WIN32
- if(fullscreen)
- {
- if(estimated)
- display_ccharge(CHPOS(controller, channel), units);
- else
- display_charge(CHPOS(controller, channel), units);
- }
-#endif
-}
-
-/*
- * Print a connect event.
- * A real monitor would allocate state info for "channel" on this
- * event.
- */
-static void print_connect(
- time_t tstamp, /* server time of event */
- int outgoing, /* 0 = incoming, 1 = outgoing */
- int controller, /* controller number */
- int channel, /* channel no, used to identify this connection until disconnect */
- char * cfgname, /* name of config entry/connection */
- char * devname, /* device used (e.g. isp0) */
- char * remphone, /* phone no of remote side */
- char * locphone) /* local phone no */
-{
- char buf[256];
-
- if(channel == 0)
- remstate[controller].ch1state = 1;
- else
- remstate[controller].ch2state = 1;
-
- strftime(buf, sizeof(buf), I4B_TIME_FORMAT, localtime(&tstamp));
-
- if(outgoing)
- mprintf("%s: calling out to '%s' [from msn: '%s']",
- buf, remphone, locphone);
- else
- mprintf("%s: incoming call from '%s' [to msn: '%s']",
- buf, remphone, locphone);
- mprintf(", controller %d, channel %d, config '%s' on device '%s'\n",
- controller, channel, cfgname, devname);
-
-#ifndef WIN32
- if(fullscreen)
- display_connect(CHPOS(controller, channel), outgoing, cfgname, remphone, devname);
-#endif
-}
-
-/*
- * Print a disconnect event.
- * A real monitor could free the "per connection" state
- * for this channel now
- */
-static void
-print_disconnect(time_t tstamp, int controller, int channel)
-{
- char buf[256];
-
- if(channel == 0)
- remstate[controller].ch1state = 0;
- else
- remstate[controller].ch2state = 0;
-
- strftime(buf, sizeof(buf), I4B_TIME_FORMAT, localtime(&tstamp));
-
- mprintf("%s: controller %d, channel %d disconnected\n",
- buf, controller, channel);
-
-#ifndef WIN32
- if(fullscreen)
- display_disconnect(CHPOS(controller, channel));
-#endif
-}
-
-/*
- * Print an up- or down event
- */
-static void
-print_updown(time_t tstamp, int controller, int channel, int isup)
-{
- char buf[256];
- strftime(buf, sizeof(buf), I4B_TIME_FORMAT, localtime(&tstamp));
- mprintf("%s: channel %d is %s\n",
- buf, channel, isup ? "up" : "down");
-}
-
-/*
- * Print l1 / l2 status
- */
-static void
-print_l12stat(time_t tstamp, int controller, int layer, int state)
-{
- char buf[256];
- strftime(buf, sizeof(buf), I4B_TIME_FORMAT, localtime(&tstamp));
-
- mprintf("%s: layer %d change on controller %d: %s\n",
- buf, layer, controller, state ? "up" : "down");
-#ifndef WIN32
- if(fullscreen)
- display_l12stat(controller, layer, state);
-#endif
-}
-
-/*
- * Print TEI
- */
-static void
-print_tei(time_t tstamp, int controller, int tei)
-{
- char buf[256];
- strftime(buf, sizeof(buf), I4B_TIME_FORMAT, localtime(&tstamp));
-
- mprintf("%s: controller %d, TEI is %d\n",
- buf, controller, tei);
-
-#ifndef WIN32
- if(fullscreen)
- display_tei(controller, tei);
-#endif
-}
-
-/*
- * Print accounting information
- */
-static void
-print_acct(time_t tstamp, int controller, int channel, int obytes, int obps,
- int ibytes, int ibps)
-{
- char buf[256];
- strftime(buf, sizeof(buf), I4B_TIME_FORMAT, localtime(&tstamp));
-
- mprintf("%s: controller %d, channel %d: %d obytes, %d obps, %d ibytes, %d ibps\n",
- buf, controller, channel, obytes, obps, ibytes, ibps);
-#ifndef WIN32
- if(fullscreen)
- display_acct(CHPOS(controller, channel), obytes, obps, ibytes, ibps);
-#endif
-}
-
-static void
-print_initialization(void)
-{
-#ifndef WIN32
- if(fullscreen)
- {
- if(curses_ready == 0)
- init_screen();
- }
- else
-#endif
- {
- print_menu();
- }
-}
-
-/*
- * Dispatch one message received from the daemon.
- */
-static void
-handle_event(u_int8_t *msg, int len)
-{
- u_int8_t cmd[I4B_MON_ICLIENT_SIZE];
- int local;
- u_int32_t net;
- u_int32_t mask;
- u_int32_t who;
- static int first = 1;
-
- switch(state)
- {
- case ST_INIT: /* initial data */
-
- isdn_major = I4B_GET_2B(msg, I4B_MON_IDATA_VERSMAJOR);
- isdn_minor = I4B_GET_2B(msg, I4B_MON_IDATA_VERSMINOR);
- nctrl = I4B_GET_2B(msg, I4B_MON_IDATA_NUMCTRL);
- nentries = I4B_GET_2B(msg, I4B_MON_IDATA_NUMENTR);
- rights = I4B_GET_4B(msg, I4B_MON_IDATA_CLACCESS);
-
- mprintf("remote protocol version is %02d.%02d\n", isdn_major, isdn_minor);
-
- if(isdn_major != MPROT_VERSION || isdn_minor != MPROT_REL)
- {
- fprintf(stderr, "ERROR, remote protocol version mismatch:\n");
- fprintf(stderr, "\tremote major version is %02d, local major version is %02d\n", isdn_major, MPROT_VERSION);
- fprintf(stderr, "\tremote minor version is %02d, local minor version is %02d\n", isdn_minor, MPROT_REL);
- exit(1);
- }
-
- mprintf("our rights = 0x%x\n", rights);
-
- sub_state = 0;
- first = 1;
-
- if(nctrl > 0)
- {
- state = ST_ICTRL;
- }
- else if(nentries > 0)
- {
- state = ST_IDEV;
- }
- else
- {
- state = ST_ANYEV;
- sleep(2);
- print_initialization();
- }
-
- /* set maximum event mask */
- I4B_PREP_CMD(cmd, I4B_MON_CCMD_SETMASK);
- I4B_PUT_2B(cmd, I4B_MON_ICLIENT_VERMAJOR, MPROT_VERSION);
- I4B_PUT_2B(cmd, I4B_MON_ICLIENT_VERMINOR, MPROT_REL);
- I4B_PUT_4B(cmd, I4B_MON_ICLIENT_EVENTS, ~0U);
-
-#ifdef DEBUG
- if(debug & DBG_DUMPALL)
- dump_event(cmd, sizeof(cmd), 0);
-#endif
-
- if((sock_write(monsock, cmd, sizeof(cmd))) == -1)
- {
- fprintf(stderr, "sock_write failed: %s\n", strerror(errno));
- exit(1);
- }
- break;
-
- case ST_ICTRL: /* initial controller list */
- if(first)
- {
- first = 0;
- mprintf("%d controller(s) found:\n", nctrl);
- }
- mprintf("\tcontroller %d: %s\n", sub_state++, msg+I4B_MON_ICTRL_NAME);
-
- if(sub_state >= nctrl)
- {
- sub_state = 0;
- first = 1;
- if(nentries > 0)
- {
- state = ST_IDEV; /* end of list reached */
- }
- else
- {
- state = ST_ANYEV;
- sleep(2);
- print_initialization();
- }
- }
- break;
-
- case ST_IDEV: /* initial entry devicename list */
- if(first)
- {
- first = 0;
- mprintf("%d entries found:\n", nentries);
- }
-
- mprintf("\tentry %d: device %s\n", sub_state++, msg+I4B_MON_IDEV_NAME);
-
- strcat(devbuf, msg+I4B_MON_IDEV_NAME);
- /* strcat(devbuf, " "); */
-
- if(sub_state >= nentries)
- {
- first = 1;
- state = ST_ANYEV; /* end of list reached */
- sub_state = 0;
- sleep(2);
- print_initialization();
- }
- break;
-
- case ST_ANYEV: /* any event */
- switch(I4B_GET_2B(msg, I4B_MON_EVNT))
- {
- case I4B_MON_DRINI_CODE:
- state = ST_RIGHT; /* list of rights entries will follow */
- sub_state = 0;
- sub_state_count = I4B_GET_2B(msg, I4B_MON_DRINI_COUNT);
- mprintf("monitor rights:\n");
- break;
-
- case I4B_MON_DCINI_CODE:
- state = ST_CONNS;
- sub_state = 0;
- sub_state_count = I4B_GET_2B(msg, I4B_MON_DCINI_COUNT);
- mprintf("monitor connections:\n");
- break;
-
- case I4B_MON_LOGEVNT_CODE:
- print_logevent(I4B_GET_4B(msg, I4B_MON_LOGEVNT_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_LOGEVNT_PRIO),
- msg+I4B_MON_LOGEVNT_WHAT,
- msg+I4B_MON_LOGEVNT_MSG);
- break;
-
- case I4B_MON_CHRG_CODE:
- print_charge(I4B_GET_4B(msg, I4B_MON_CHRG_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_CHRG_CTRL),
- I4B_GET_4B(msg, I4B_MON_CHRG_CHANNEL),
- I4B_GET_4B(msg, I4B_MON_CHRG_UNITS),
- I4B_GET_4B(msg, I4B_MON_CHRG_ESTIMATED));
- break;
-
- case I4B_MON_CONNECT_CODE:
- print_connect(
- I4B_GET_4B(msg, I4B_MON_CONNECT_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_CONNECT_DIR),
- I4B_GET_4B(msg, I4B_MON_CONNECT_CTRL),
- I4B_GET_4B(msg, I4B_MON_CONNECT_CHANNEL),
- msg+I4B_MON_CONNECT_CFGNAME,
- msg+I4B_MON_CONNECT_DEVNAME,
- msg+I4B_MON_CONNECT_REMPHONE,
- msg+I4B_MON_CONNECT_LOCPHONE);
- break;
-
- case I4B_MON_DISCONNECT_CODE:
- print_disconnect(
- I4B_GET_4B(msg, I4B_MON_DISCONNECT_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_DISCONNECT_CTRL),
- I4B_GET_4B(msg, I4B_MON_DISCONNECT_CHANNEL));
- break;
-
- case I4B_MON_UPDOWN_CODE:
- print_updown(
- I4B_GET_4B(msg, I4B_MON_UPDOWN_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_UPDOWN_CTRL),
- I4B_GET_4B(msg, I4B_MON_UPDOWN_CHANNEL),
- I4B_GET_4B(msg, I4B_MON_UPDOWN_ISUP));
- break;
- case I4B_MON_L12STAT_CODE:
- print_l12stat(
- I4B_GET_4B(msg, I4B_MON_L12STAT_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_L12STAT_CTRL),
- I4B_GET_4B(msg, I4B_MON_L12STAT_LAYER),
- I4B_GET_4B(msg, I4B_MON_L12STAT_STATE));
- break;
- case I4B_MON_TEI_CODE:
- print_tei(
- I4B_GET_4B(msg, I4B_MON_TEI_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_TEI_CTRL),
- I4B_GET_4B(msg, I4B_MON_TEI_TEI));
- break;
- case I4B_MON_ACCT_CODE:
- print_acct(
- I4B_GET_4B(msg, I4B_MON_ACCT_TSTAMP),
- I4B_GET_4B(msg, I4B_MON_ACCT_CTRL),
- I4B_GET_4B(msg, I4B_MON_ACCT_CHAN),
- I4B_GET_4B(msg, I4B_MON_ACCT_OBYTES),
- I4B_GET_4B(msg, I4B_MON_ACCT_OBPS),
- I4B_GET_4B(msg, I4B_MON_ACCT_IBYTES),
- I4B_GET_4B(msg, I4B_MON_ACCT_IBPS));
- break;
- default:
- mprintf("unknown event code: %d\n", I4B_GET_2B(msg, I4B_MON_EVNT));
- }
- break;
-
- case ST_RIGHT: /* one record in a list of monitor rights */
- rights = I4B_GET_4B(msg, I4B_MON_DR_RIGHTS);
- net = I4B_GET_4B(msg, I4B_MON_DR_NET);
- mask = I4B_GET_4B(msg, I4B_MON_DR_MASK);
- local = I4B_GET_1B(msg, I4B_MON_DR_LOCAL);
-
- if(local)
- {
- mprintf("\tlocal: rights = %x\n", rights);
- }
- else
- {
- mprintf("\tfrom: %d.%d.%d.%d, mask %d.%d.%d.%d, rights = %x\n",
- (net >> 24) & 0x00ff, (net >> 16) & 0x00ff, (net >> 8) & 0x00ff, net & 0x00ff,
- (mask >> 24) & 0x00ff, (mask >> 16) & 0x00ff, (mask >> 8) & 0x00ff, mask & 0x00ff,
- rights);
- }
-
- sub_state++;
-
- if(sub_state >= sub_state_count)
- {
- state = ST_ANYEV;
- print_initialization();
- }
- break;
-
- case ST_CONNS:
- who = I4B_GET_4B(msg, I4B_MON_DC_WHO);
- rights = I4B_GET_4B(msg, I4B_MON_DC_RIGHTS);
-
- mprintf("\tfrom: %d.%d.%d.%d, rights = %x\n",
- (who >> 24) & 0x00ff, (who >> 16) & 0x00ff, (who >> 8) & 0x00ff, who & 0x00ff,
- rights);
-
- sub_state++;
-
- if(sub_state >= sub_state_count)
- {
- state = ST_ANYEV;
- print_initialization();
- }
- break;
-
- default:
- mprintf("unknown event from remote: local state = %d, evnt = %x, len = %d\n",
- state, I4B_GET_2B(msg, I4B_MON_EVNT), len);
- }
-}
-
-/*
- * Process input from user
- */
-static void
-handle_input()
-{
- char buf[1024];
- int channel, controller;
-
- fgets(buf, sizeof(buf), stdin);
-
- switch(atoi(buf))
- {
- case 1:
- {
- u_int8_t cmd[I4B_MON_DUMPRIGHTS_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_DUMPRIGHTS_CODE);
-#ifdef DEBUG
- if(debug & DBG_DUMPALL)
- dump_event(cmd, I4B_MON_DUMPRIGHTS_SIZE, 0);
-#endif
-
- if((sock_write(monsock, cmd, I4B_MON_DUMPRIGHTS_SIZE)) == -1)
- {
- fprintf(stderr, "sock_write failed: %s\n", strerror(errno));
- exit(1);
- }
- }
- break;
-
- case 2:
- {
- u_int8_t cmd[I4B_MON_DUMPMCONS_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_DUMPMCONS_CODE);
-#ifdef DEBUG
- if(debug & DBG_DUMPALL)
- dump_event(cmd, I4B_MON_DUMPMCONS_CODE, 0);
-#endif
-
- if((sock_write(monsock, cmd, I4B_MON_DUMPMCONS_SIZE)) == -1)
- {
- fprintf(stderr, "sock_write failed: %s\n", strerror(errno));
- exit(1);
- }
- }
- break;
-
- case 3:
- {
- u_int8_t cmd[I4B_MON_CFGREREAD_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_CFGREREAD_CODE);
-#ifdef DEBUG
- if(debug & DBG_DUMPALL)
- dump_event(cmd, I4B_MON_CFGREREAD_CODE, 0);
-#endif
-
- if((sock_write(monsock, cmd, I4B_MON_CFGREREAD_SIZE)) == -1)
- {
- fprintf(stderr, "sock_write failed: %s\n", strerror(errno));
- exit(1);
- }
- }
- break;
-
- case 4:
- {
- u_int8_t cmd[I4B_MON_HANGUP_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_HANGUP_CODE);
-
- printf("Which controller you wish to hangup? ");
- fgets(buf, sizeof(buf), stdin);
- controller = atoi(buf);
- I4B_PUT_4B(cmd, I4B_MON_HANGUP_CTRL, controller);
-
- printf("Which channel do you wish to hangup? ");
- fgets(buf, sizeof(buf), stdin);
- channel = atoi(buf);
- I4B_PUT_4B(cmd, I4B_MON_HANGUP_CHANNEL, channel);
-
-#ifdef DEBUG
- if(debug & DBG_DUMPALL)
- dump_event(cmd, I4B_MON_HANGUP_CHANNEL, 0);
-#endif
-
- if((sock_write(monsock, cmd, I4B_MON_HANGUP_SIZE)) == -1)
- {
- fprintf(stderr, "sock_write failed: %s\n", strerror(errno));
- exit(1);
- }
- }
- break;
-
- case 9:
- close(monsock);
- exit(0);
- break;
-
- default:
- print_menu();
- break;
- }
-}
-
-void
-reread(void)
-{
- u_int8_t cmd[I4B_MON_CFGREREAD_SIZE];
- I4B_PREP_CMD(cmd, I4B_MON_CFGREREAD_CODE);
-#ifdef DEBUG
- if(debug & DBG_DUMPALL)
- dump_event(cmd, I4B_MON_CFGREREAD_CODE, 0);
-#endif
- if((sock_write(monsock, cmd, I4B_MON_CFGREREAD_SIZE)) == -1)
- {
- fprintf(stderr, "sock_write failed: %s\n", strerror(errno));
- exit(1);
- }
-}
-
-void
-hangup(int ctrl, int chan)
-{
- u_int8_t cmd[I4B_MON_HANGUP_SIZE];
-
- I4B_PREP_CMD(cmd, I4B_MON_HANGUP_CODE);
- I4B_PUT_4B(cmd, I4B_MON_HANGUP_CTRL, ctrl);
- I4B_PUT_4B(cmd, I4B_MON_HANGUP_CHANNEL, chan);
-
-#ifdef DEBUG
- if(debug & DBG_DUMPALL)
- dump_event(cmd, I4B_MON_HANGUP_CHANNEL, 0);
-#endif
-
- if((sock_write(monsock, cmd, I4B_MON_HANGUP_SIZE)) == -1)
- {
- fprintf(stderr, "sock_write failed: %s\n", strerror(errno));
- exit(1);
- }
-}
-
-/*
- * Display menu
- */
-static void
-print_menu()
-{
- if(!fullscreen)
- {
- printf("Menu: <1> display rights, <2> display monitor connections,\n");
- printf(" <3> reread config file, <4> hangup \n");
- printf(" <9> quit isdnmonitor\n");
- fflush(stdout);
- }
-}
-
-static ssize_t
-sock_read(int fd, void *buf, size_t nbytes)
-{
- size_t nleft;
- ssize_t nread;
- unsigned char *ptr;
-
- ptr = buf;
- nleft = nbytes;
-
- while(nleft > 0)
- {
- if((nread = read(fd, ptr, nleft)) < 0)
- {
- if(errno == EINTR)
- {
- nread = 0;
- }
- else
- {
- return(-1);
- }
- }
- else if(nread == 0)
- {
- break; /* EOF */
- }
-
- nleft -= nread;
- ptr += nread;
- }
- return(nbytes - nleft);
-}
-
-static ssize_t
-sock_write(int fd, void *buf, size_t nbytes)
-{
- size_t nleft;
- ssize_t nwritten;
- unsigned char *ptr;
-
- ptr = buf;
- nleft = nbytes;
-
- while(nleft > 0)
- {
- if((nwritten = write(fd, ptr, nleft)) <= 0)
- {
- if(errno == EINTR)
- {
- nwritten = 0;
- }
- else
- {
- return(-1);
- }
- }
-
- nleft -= nwritten;
- ptr += nwritten;
- }
- return(nbytes);
-}
-
-static void
-mprintf(char *fmt, ...)
-{
-#define PRBUFLEN 1024
- char buffer[PRBUFLEN];
- va_list ap;
-
- va_start(ap, fmt);
- vsnprintf(buffer, PRBUFLEN-1, fmt, ap);
- va_end(ap);
-
- if(!fullscreen || (fullscreen && (!curses_ready)))
- printf("%s", buffer);
-
- if(logfilename != NULL)
- {
- fprintf(lfp, "%s", buffer);
- fflush(lfp);
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnmonitor/monitor.h b/usr.sbin/i4b/isdnmonitor/monitor.h
deleted file mode 100644
index 4862c48..0000000
--- a/usr.sbin/i4b/isdnmonitor/monitor.h
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (c) 1998,1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * i4b daemon - network monitor protocol definition
- * ------------------------------------------------
- *
- * $Id: monitor.h,v 1.16 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:52:18 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#ifndef _MONITOR_H_
-#define _MONITOR_H_
-
-#define DEF_MONPORT 451 /* default monitor TCP port */
-
-#ifdef __hpux
-#define u_int8_t ubit8
-#define u_int32_t ubit32
-#endif
-#ifdef WIN32
-#define u_int8_t BYTE
-#define u_int32_t DWORD
-#endif
-
-/*
- * The monitor client connects to the isdnd daemon process via a tcp/ip
- * connection from a remote machine or via a local (unix domain) socket.
- * The daemon accepts multiple connections and verifies access rights.
- * On connection establishment the daemon sends initial data telling
- * the client the current configuration: number and type of available
- * controllers, current connections, channel and interface states
- * and the clients access privileges. The client sends an event mask
- * telling the daemon which events it is interested in. If the client
- * has appropriate rights he may send commands to the daemon.
- *
- * All multi-byte values are in network byte order!
- */
-
-/* All data packets transfered are declared as arrays of u_int8_t */
-
-/* max stringlength used in this protocol */
-#define I4B_MAX_MON_STRING 256
-
-/* max command size from client to server */
-#define I4B_MAX_MON_CLIENT_CMD 16
-
-/* Version of the monitor protocol described here */
-#define MPROT_VERSION 0 /* major version no */
-#define MPROT_REL 5 /* release no */
-
-/*
- * Client access rights
- */
-#define I4B_CA_COMMAND_FULL 1 /* may send any command */
-#define I4B_CA_COMMAND_RESTRICTED 2 /* may send 'harmless' commands */
-#define I4B_CA_EVNT_CHANSTATE 16 /* may watch b-channel states */
-#define I4B_CA_EVNT_CALLIN 32 /* may watch incoming calls */
-#define I4B_CA_EVNT_CALLOUT 64 /* may watch outgoing calls */
-#define I4B_CA_EVNT_I4B 128 /* may watch isdnd actions */
-
-/*
- * General layout of a command packet. All commands have this common
- * prefix. It is prepared by the macro I4B_PREP_CMD (s.b.)
- */
-#define I4B_MON_CMD 0 /* 2 byte: command code */
-#define I4B_MON_CMD_LEN 2 /* 2 byte: packet length */
-#define I4B_MON_CMD_HDR 4 /* size of header */
-
-/*
- * Currently events look the same as commands. We do not make
- * any guarantee this will remain the same, so a different set
- * of macros is used when describing events. Events are prepared
- * by I4B_PREP_EVNT (s.b.)
- */
-#define I4B_MON_EVNT 0 /* 2 byte: event code */
-#define I4B_MON_EVNT_LEN 2 /* 2 byte: packet length */
-#define I4B_MON_EVNT_HDR 4 /* size of header */
-
-/* Initial data send by daemon after connection is established */
-#define I4B_MON_IDATA_SIZE I4B_MON_EVNT_HDR+12
-#define I4B_MON_IDATA_CODE 0 /* event code */
-#define I4B_MON_IDATA_VERSMAJOR I4B_MON_EVNT_HDR+0 /* 2 byte: isdnd major version */
-#define I4B_MON_IDATA_VERSMINOR I4B_MON_EVNT_HDR+2 /* 2 byte: isdnd minor version */
-#define I4B_MON_IDATA_NUMCTRL I4B_MON_EVNT_HDR+4 /* 2 byte: number of controllers */
-#define I4B_MON_IDATA_NUMENTR I4B_MON_EVNT_HDR+6 /* 2 byte: number of controllers */
-#define I4B_MON_IDATA_CLACCESS I4B_MON_EVNT_HDR+8 /* 4 byte: client rights */
-
-/* followed by this for every controller */
-#define I4B_MON_ICTRL_SIZE I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+8
-#define I4B_MON_ICTRL_CODE 1 /* event code */
-#define I4B_MON_ICTRL_NAME I4B_MON_EVNT_HDR+0 /* string: name of controller */
-#define I4B_MON_ICTRL_BUSID I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+0 /* 2 byte: isdn bus id (reservered) */
-#define I4B_MON_ICTRL_FLAGS I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+2 /* 4 byte: controller flags (not yet defined) */
-#define I4B_MON_ICTRL_NCHAN I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+6 /* 2 byte: number of b channels on this controller */
-
-/* followed by this for every entry */
-#define I4B_MON_IDEV_SIZE I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+2
-#define I4B_MON_IDEV_CODE 2 /* event code */
-#define I4B_MON_IDEV_NAME I4B_MON_EVNT_HDR+0 /* string: name of device */
-#define I4B_MON_IDEV_STATE I4B_MON_EVNT_HDR+I4B_MAX_MON_STRING+0 /* 2 byte: state of device */
-
-/*
- * The client sets it's protocol version and event mask (usually once after
- * connection establishement)
- */
-#define I4B_MON_CCMD_SETMASK 0x7e /* command code */
-#define I4B_MON_ICLIENT_SIZE I4B_MON_CMD_HDR+8
-#define I4B_MON_ICLIENT_VERMAJOR I4B_MON_CMD_HDR+0 /* 2 byte: protocol major version (always 0 for now) */
-#define I4B_MON_ICLIENT_VERMINOR I4B_MON_CMD_HDR+2 /* 2 byte: protocol minor version (always 0 for now) */
-#define I4B_MON_ICLIENT_EVENTS I4B_MON_CMD_HDR+4 /* 4 byte: client event mask */
-
-/* The client requests a list of monitor rights */
-#define I4B_MON_DUMPRIGHTS_CODE 1
-#define I4B_MON_DUMPRIGHTS_SIZE I4B_MON_CMD_HDR /* no parameters */
-
-/*
- * In response to an I4B_MON_DUMPRIGHTS_CODE command, the daemon sends
- * this event:
- */
-#define I4B_MON_DRINI_CODE 2 /* event code */
-#define I4B_MON_DRINI_SIZE I4B_MON_EVNT_HDR+2 /* size of packet */
-#define I4B_MON_DRINI_COUNT I4B_MON_EVNT_HDR+0 /* 2 byte: number of records */
-
-/* followed by this for each record anounced above */
-#define I4B_MON_DR_CODE 3
-#define I4B_MON_DR_SIZE I4B_MON_EVNT_HDR+13
-#define I4B_MON_DR_RIGHTS I4B_MON_EVNT_HDR+0 /* 4 byte: rights mask */
-#define I4B_MON_DR_NET I4B_MON_EVNT_HDR+4 /* 4 byte: network address */
-#define I4B_MON_DR_MASK I4B_MON_EVNT_HDR+8 /* 4 byte: network mask */
-#define I4B_MON_DR_LOCAL I4B_MON_EVNT_HDR+12 /* 1 byte: non-zero if local socket */
-
-/* The client requests a list of monitor connections */
-#define I4B_MON_DUMPMCONS_CODE 2
-#define I4B_MON_DUMPMCONS_SIZE I4B_MON_CMD_HDR /* no parameters */
-
-/*
- * In response to an I4B_MON_DUMPMCONS_CODE command, the daemon sends
- * this event:
- */
-#define I4B_MON_DCINI_CODE 4 /* event code */
-#define I4B_MON_DCINI_SIZE I4B_MON_EVNT_HDR+2 /* size of packet */
-#define I4B_MON_DCINI_COUNT I4B_MON_EVNT_HDR+0 /* 2 byte: number of records */
-
-/* followed by this for each record anounced above */
-#define I4B_MON_DC_CODE 5
-#define I4B_MON_DC_SIZE I4B_MON_EVNT_HDR+8
-#define I4B_MON_DC_RIGHTS I4B_MON_EVNT_HDR+0 /* 4 byte: rights mask */
-#define I4B_MON_DC_WHO I4B_MON_EVNT_HDR+4 /* 4 byte: network address */
-
-/* The client requests a config file rescan */
-#define I4B_MON_CFGREREAD_CODE 3
-#define I4B_MON_CFGREREAD_SIZE I4B_MON_CMD_HDR /* no parameters */
-
-/* The client requests to hangup a connection */
-#define I4B_MON_HANGUP_CODE 4
-#define I4B_MON_HANGUP_SIZE I4B_MON_CMD_HDR+8
-#define I4B_MON_HANGUP_CTRL I4B_MON_CMD_HDR+0 /* controller */
-#define I4B_MON_HANGUP_CHANNEL I4B_MON_CMD_HDR+4 /* channel */
-
-/* The daemon sends a logfile event */
-#define I4B_MON_LOGEVNT_CODE 6
-#define I4B_MON_LOGEVNT_SIZE I4B_MON_EVNT_HDR+8+2*I4B_MAX_MON_STRING
-#define I4B_MON_LOGEVNT_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: timestamp */
-#define I4B_MON_LOGEVNT_PRIO I4B_MON_EVNT_HDR+4 /* 4 byte: syslog priority */
-#define I4B_MON_LOGEVNT_WHAT I4B_MON_EVNT_HDR+8 /* followed by 2 strings: 'what' and 'message' */
-#define I4B_MON_LOGEVNT_MSG I4B_MON_EVNT_HDR+8+I4B_MAX_MON_STRING
-
-/* The daemon sends a charge event */
-#define I4B_MON_CHRG_CODE 7
-#define I4B_MON_CHRG_SIZE I4B_MON_EVNT_HDR+20
-#define I4B_MON_CHRG_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: timestamp */
-#define I4B_MON_CHRG_CTRL I4B_MON_EVNT_HDR+4 /* 4 byte: channel charged */
-#define I4B_MON_CHRG_CHANNEL I4B_MON_EVNT_HDR+8 /* 4 byte: channel charged */
-#define I4B_MON_CHRG_UNITS I4B_MON_EVNT_HDR+12 /* 4 byte: new charge value */
-#define I4B_MON_CHRG_ESTIMATED I4B_MON_EVNT_HDR+16 /* 4 byte: 0 = charge by network, 1 = calculated estimate */
-
-/* The daemon sends a connect event */
-#define I4B_MON_CONNECT_CODE 8
-#define I4B_MON_CONNECT_SIZE I4B_MON_EVNT_HDR+16+4*I4B_MAX_MON_STRING
-#define I4B_MON_CONNECT_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_CONNECT_DIR I4B_MON_EVNT_HDR+4 /* 4 byte: direction (0 = incoming, 1 = outgoing) */
-#define I4B_MON_CONNECT_CTRL I4B_MON_EVNT_HDR+8 /* 4 byte: channel connected */
-#define I4B_MON_CONNECT_CHANNEL I4B_MON_EVNT_HDR+12 /* 4 byte: channel connected */
-#define I4B_MON_CONNECT_CFGNAME I4B_MON_EVNT_HDR+16 /* name of config entry */
-#define I4B_MON_CONNECT_DEVNAME I4B_MON_EVNT_HDR+16+I4B_MAX_MON_STRING /* name of device used for connection */
-#define I4B_MON_CONNECT_REMPHONE I4B_MON_EVNT_HDR+16+2*I4B_MAX_MON_STRING /* remote phone no. */
-#define I4B_MON_CONNECT_LOCPHONE I4B_MON_EVNT_HDR+16+3*I4B_MAX_MON_STRING /* local phone no. */
-
-/* The daemon sends a disconnect event */
-#define I4B_MON_DISCONNECT_CODE 9
-#define I4B_MON_DISCONNECT_SIZE I4B_MON_EVNT_HDR+12
-#define I4B_MON_DISCONNECT_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_DISCONNECT_CTRL I4B_MON_EVNT_HDR+4 /* 4 byte: channel disconnected */
-#define I4B_MON_DISCONNECT_CHANNEL I4B_MON_EVNT_HDR+8 /* 4 byte: channel disconnected */
-
-/* The daemon sends an up/down event */
-#define I4B_MON_UPDOWN_CODE 10
-#define I4B_MON_UPDOWN_SIZE I4B_MON_EVNT_HDR+16
-#define I4B_MON_UPDOWN_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_UPDOWN_CTRL I4B_MON_EVNT_HDR+4 /* 4 byte: channel disconnected */
-#define I4B_MON_UPDOWN_CHANNEL I4B_MON_EVNT_HDR+8 /* 4 byte: channel disconnected */
-#define I4B_MON_UPDOWN_ISUP I4B_MON_EVNT_HDR+12 /* 4 byte: interface is up */
-
-/* The daemon sends a L1/L2 status change event */
-#define I4B_MON_L12STAT_CODE 11
-#define I4B_MON_L12STAT_SIZE I4B_MON_EVNT_HDR+16
-#define I4B_MON_L12STAT_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_L12STAT_CTRL I4B_MON_EVNT_HDR+4 /* 4 byte: controller */
-#define I4B_MON_L12STAT_LAYER I4B_MON_EVNT_HDR+8 /* 4 byte: layer */
-#define I4B_MON_L12STAT_STATE I4B_MON_EVNT_HDR+12 /* 4 byte: state */
-
-/* The daemon sends a TEI change event */
-#define I4B_MON_TEI_CODE 12
-#define I4B_MON_TEI_SIZE I4B_MON_EVNT_HDR+12
-#define I4B_MON_TEI_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_TEI_CTRL I4B_MON_EVNT_HDR+4 /* 4 byte: controller */
-#define I4B_MON_TEI_TEI I4B_MON_EVNT_HDR+8 /* 4 byte: tei */
-
-/* The daemon sends an accounting message event */
-#define I4B_MON_ACCT_CODE 13
-#define I4B_MON_ACCT_SIZE I4B_MON_EVNT_HDR+28
-#define I4B_MON_ACCT_TSTAMP I4B_MON_EVNT_HDR+0 /* 4 byte: time stamp */
-#define I4B_MON_ACCT_CTRL I4B_MON_EVNT_HDR+4 /* 4 byte: controller */
-#define I4B_MON_ACCT_CHAN I4B_MON_EVNT_HDR+8 /* 4 byte: channel */
-#define I4B_MON_ACCT_OBYTES I4B_MON_EVNT_HDR+12 /* 4 byte: outbytes */
-#define I4B_MON_ACCT_OBPS I4B_MON_EVNT_HDR+16 /* 4 byte: outbps */
-#define I4B_MON_ACCT_IBYTES I4B_MON_EVNT_HDR+20 /* 4 byte: inbytes */
-#define I4B_MON_ACCT_IBPS I4B_MON_EVNT_HDR+24 /* 4 byte: inbps */
-
-/* macros for setup/decoding of protocol packets */
-
-/* clear a record */
-#define I4B_CLEAR(r) memset(&(r), 0, sizeof(r));
-
-/* prepare a record as event or command */
-#define I4B_PREP_EVNT(r, e) { \
- I4B_CLEAR(r); \
- I4B_PUT_2B(r, I4B_MON_EVNT, e); \
- I4B_PUT_2B(r, I4B_MON_EVNT_LEN, sizeof(r)); \
-}
-#define I4B_PREP_CMD(r, c) { \
- I4B_CLEAR(r); \
- I4B_PUT_2B(r, I4B_MON_CMD, c); \
- I4B_PUT_2B(r, I4B_MON_CMD_LEN, sizeof(r)); \
-}
-
-/* put 1, 2 or 4 bytes in network byte order into a record at offset off */
-#define I4B_PUT_1B(r, off, val) { ((u_int8_t*)(r))[off] = (val) & 0x00ff; }
-#define I4B_PUT_2B(r, off, val) { I4B_PUT_1B(r, off, val >> 8); I4B_PUT_1B(r, off+1, val); }
-#define I4B_PUT_4B(r, off, val) { I4B_PUT_1B(r, off, val >> 24); I4B_PUT_1B(r, off+1, val >> 16); I4B_PUT_1B(r, off+2, val >> 8); I4B_PUT_1B(r, off+3, val); }
-
-/* get 1, 2 or 4 bytes in network byte order from a record at offset off */
-#define I4B_GET_1B(r, off) (((u_int8_t*)(r))[off])
-#define I4B_GET_2B(r, off) ((((u_int8_t*)(r))[off]) << 8) | (((u_int8_t*)(r))[off+1])
-#define I4B_GET_4B(r, off) ((((u_int8_t*)(r))[off]) << 24) | ((((u_int8_t*)(r))[off+1]) << 16) | ((((u_int8_t*)(r))[off+2]) << 8) | (((u_int8_t*)(r))[off+3])
-
-/*
- * put a string into record r at offset off, make sure it's not to long
- * and proper terminate it
- */
-#define I4B_PUT_STR(r, off, str) { \
- strncpy((r)+(off), (str), I4B_MAX_MON_STRING); \
- (r)[(off)+I4B_MAX_MON_STRING-1] = (u_int8_t)0; }
-
-#endif /* _MONITOR_H_ */
-
diff --git a/usr.sbin/i4b/isdnmonitor/monprivate.h b/usr.sbin/i4b/isdnmonitor/monprivate.h
deleted file mode 100644
index d676344..0000000
--- a/usr.sbin/i4b/isdnmonitor/monprivate.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (c) 1999 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 remote monitor - private header
- * -----------------------------------
- *
- * $Id: monprivate.h,v 1.10 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:52:25 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <signal.h>
-
-#ifndef WIN32
-#include <unistd.h>
-#include <syslog.h>
-#include <regex.h>
-#include <curses.h>
-#include <fcntl.h>
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#endif
-
-/*---------------------------------------------------------------------------*
- * definitions in i4b_ioctl.h, do something for other systems
- *---------------------------------------------------------------------------*/
-#if defined (__FreeBSD__) || defined(__NetBSD__) || \
- defined (__OpenBSD__) || defined(__bsdi__)
-
-#include <i4b/i4b_ioctl.h>
-
-#else
-
-#define FOREIGN 1 /* we are running on a "foreign" OS */
-
-#define I4B_TIME_FORMAT "%d.%m.%Y %H:%M:%S"
-#define VERSION 0
-#define REL 0
-#define STEP 0
-
-#endif
-
-/*---------------------------------------------------------------------------*
- * some general definitions
- *---------------------------------------------------------------------------*/
-#define GOOD 0 /* general "good" or "ok" return*/
-#define ERROR (-1) /* general error return */
-#define WARNING (-2) /* warning return */
-#define INVALID (-1) /* an invalid integer */
-
-/*---------------------------------------------------------------------------*
- * state definitions
- *---------------------------------------------------------------------------*/
-#define ST_INIT 0 /* initial data */
-#define ST_ICTRL 1 /* initial controller list */
-#define ST_IDEV 2 /* initial entry devicename list */
-#define ST_ANYEV 3 /* any event */
-#define ST_RIGHT 4 /* one record in a list of monitor rights */
-#define ST_CONNS 5 /* monitor connections */
-
-/*---------------------------------------------------------------------------*
- * curses fullscreen display definitions
- *---------------------------------------------------------------------------*/
-/* window dimensions */
-#define UPPER_B 2 /* upper window start */
-
-/* horizontal positions for upper window */
-#define H_CNTL 0 /* controller */
-#define H_TEI 2 /* TEI */
-#define H_CHAN (H_TEI+4) /* channel */
-#define H_TELN (H_CHAN+2) /* telephone number */
-#define H_IFN (H_TELN+23) /* interfacename */
-#define H_IO (H_IFN+7) /* incoming or outgoing */
-#define H_OUT (H_IO+4) /* # of bytes out */
-#define H_OUTBPS (H_OUT+11) /* bytes per second out */
-#define H_IN (H_OUTBPS+5) /* # of bytes in */
-#define H_INBPS (H_IN+11) /* bytes per second in */
-#define H_UNITS (H_INBPS+6) /* # of charging units */
-
-/* fullscreen mode menu window */
-#define WMENU_LEN 35 /* width of menu window */
-#define WMENU_TITLE "Command" /* title string */
-#define WMENU_POSLN 10 /* menu position, line */
-#define WMENU_POSCO 5 /* menu position, col */
-#define WMITEMS 4 /* no of menu items */
-#define WMENU_HGT (WMITEMS + 4) /* menu window height */
-
-#define WREFRESH 0
-#define WHANGUP 1
-#define WREREAD 2
-#define WQUIT 3
-
-#define WMTIMEOUT 5 /* timeout in seconds */
-
-/*---------------------------------------------------------------------------*
- * misc
- *---------------------------------------------------------------------------*/
-#define CHPOS(uctlr, uchan) (((uctlr)*2) + (uchan))
-
-/*---------------------------------------------------------------------------*
- * remote state
- *---------------------------------------------------------------------------*/
-
-#define MAX_CTRL 4
-
-typedef struct remstate {
- int ch1state;
- int ch2state;
-} remstate_t;
-
-/*---------------------------------------------------------------------------*
- * global variables
- *---------------------------------------------------------------------------*/
-#ifdef MAIN
-
-remstate_t remstate[MAX_CTRL];
-
-int nctrl = 0; /* # of controllers available */
-int curses_ready = 0; /* curses initialized */
-int do_bell = 0;
-int nentries = 0;
-int fullscreen = 0;
-int debug_noscreen = 0;
-
-#ifndef WIN32
-WINDOW *upper_w; /* curses upper window pointer */
-WINDOW *mid_w; /* curses mid window pointer */
-WINDOW *lower_w; /* curses lower window pointer */
-#endif
-
-char devbuf[256];
-
-char *sockpath = NULL;
-char *hostname = NULL;
-int portno;
-
-#else /* !MAIN */
-
-remstate_t remstate[MAX_CTRL];
-
-int nctrl;
-int curses_ready;
-int do_bell;
-int nentries;
-int fullscreen;
-int debug_noscreen;
-
-WINDOW *upper_w;
-WINDOW *mid_w;
-WINDOW *lower_w;
-
-char devbuf[256];
-
-char *sockpath;
-char *hostname;
-int portno;
-
-#endif
-
-extern void do_exit ( int exitval );
-extern void do_menu ( void );
-extern void init_screen ( void );
-extern void display_charge ( int pos, int charge );
-extern void display_ccharge ( int pos, int units );
-extern void display_connect(int pos, int dir, char *name, char *remtel, char *dev);
-extern void display_acct ( int pos, int obyte, int obps, int ibyte, int ibps );
-extern void display_disconnect ( int pos );
-extern void display_updown ( int pos, int updown, char *device );
-extern void display_l12stat ( int controller, int layer, int state );
-extern void display_tei ( int controller, int tei );
-
-extern void reread(void);
-extern void hangup(int ctrl, int chan);
-
-
diff --git a/usr.sbin/i4b/isdnphone/Makefile b/usr.sbin/i4b/isdnphone/Makefile
deleted file mode 100644
index 3527e8c..0000000
--- a/usr.sbin/i4b/isdnphone/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-PROG= isdnphone
-MAN= isdnphone.8
-SRCS= main.c display.c audio.c isdn.c
-
-DPADD= ${LIBCURSES}
-LDADD= -lcurses
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdnphone/audio.c b/usr.sbin/i4b/isdnphone/audio.c
deleted file mode 100644
index 2dc88d6..0000000
--- a/usr.sbin/i4b/isdnphone/audio.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdnphone - audio operations
- * ============================
- *
- * $Id: audio.c,v 1.5 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:52:39 1999]
- *
- *----------------------------------------------------------------------------*/
-
-#include "defs.h"
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-int
-init_audio(char *audiodevice)
-{
- int ret;
- int fd;
- u_long fmt = 0;
-
- snd_chan_param pa;
- struct snd_size sz;
- snd_capabilities soundcaps;
-
- if((fd = open(audiodevice, O_RDWR)) < 0)
- {
- fprintf(stderr, "unable to open %s: %s\n", audiodevice, strerror(errno));
- return(-1);
- }
-
- ret = ioctl(fd, AIOGCAP, &soundcaps);
-
- if(ret == -1)
- {
- fprintf(stderr, "ERROR: ioctl AIOGCAP %s: %s\n", audiodevice, strerror(errno));
- return(-1);
- }
-
- fmt = soundcaps.formats;
-
- if((fmt & AFMT_FULLDUPLEX) && (!(fmt & AFMT_WEIRD)))
- {
-#ifdef NOTDEF
- if(fmt & AFMT_A_LAW)
- {
- play_fmt = rec_fmt = AFMT_A_LAW;
- }
- else
-#endif
- if(fmt & AFMT_MU_LAW)
- {
- play_fmt = rec_fmt = AFMT_MU_LAW;
- }
- else
- {
- printf("sorry, A-law or u-law not supported!\n");
- close(fd);
- return(-1);
- }
- }
- else
- {
- printf("no full-duplex available!\n");
- close (fd);
- return(-1);
- }
-
- pa.play_format = play_fmt;
- pa.rec_format = rec_fmt;
- pa.play_rate = pa.rec_rate = AUDIORATE;
-
- ret = ioctl(fd, AIOSFMT, &pa);
-
- if(ret == -1)
- {
- fprintf(stderr, "ERROR: ioctl AIOSFMT %s: %s\n", audiodevice, strerror(errno));
- return(-1);
- }
-
- sz.play_size = BCH_MAX_DATALEN;
- sz.rec_size = BCH_MAX_DATALEN;
-
- ret = ioctl(fd, AIOSSIZE, &sz);
-
- if(ret == -1)
- {
- fprintf(stderr, "ERROR: ioctl AIOSSIZE %s: %s\n", audiodevice, strerror(errno));
- return(-1);
- }
-
- return(fd);
-}
-
-/*---------------------------------------------------------------------------*
- * audio device has speech data from microphone
- *---------------------------------------------------------------------------*/
-void
-audio_hdlr(void)
-{
- unsigned char buffer[BCH_MAX_DATALEN];
- int ret;
-
- ret = read(audiofd, buffer, BCH_MAX_DATALEN);
-
- if(ret < 0)
- {
- fatal("read audio failed: %s", strerror(errno));
- }
-
- debug("audio_hdlr: read %d bytes\n", ret);
-
- if(ret > 0)
- {
- telwrite(ret, buffer);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * write audio data to loudspeaker
- *---------------------------------------------------------------------------*/
-void
-audiowrite(int len, unsigned char *buf)
-{
- if((write(audiofd, buf, len)) < 0)
- {
- fatal("write audio failed: %s", strerror(errno));
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnphone/defs.h b/usr.sbin/i4b/isdnphone/defs.h
deleted file mode 100644
index fade94b..0000000
--- a/usr.sbin/i4b/isdnphone/defs.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdnphone - header file
- * =======================
- *
- * $Id: defs.h,v 1.6 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:52:46 1999]
- *
- *----------------------------------------------------------------------------*/
-
-#include <ncurses.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/soundcard.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/param.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_tel_ioctl.h>
-
-/* device file prefixes */
-
-#define I4BTELDEVICE "/dev/i4btel"
-#define I4BTELDDEVICE "/dev/i4bteld"
-#define AUDIODEVICE "/dev/audio"
-
-#define GOOD 0
-#define ERROR (-1)
-#define WARNING (-2)
-
-/* main window dimensions */
-
-#define MW_ROW 5
-#define MW_COL 8
-
-#define MW_WIDTH 60
-#define MW_HEIGHT 8
-
-#define DB_ROW 15
-#define DB_COL 1
-#define DB_WID 79
-#define DB_HGT 9
-
-#define MW_STATEY 2
-#define MW_STATEX 1
-#define MW_STX 10
-
-#define MW_NUMY 4
-#define MW_NUMX 1
-#define MW_NUX 10
-
-#define MW_MSGY 6
-#define MW_MSGX 1
-#define MW_MSX 10
-
-/* fullscreen mode menu window */
-
-#define WMITEMS 4 /* no of items */
-#define WMENU_LEN 18 /* window width */
-#define WMENU_HGT (WMITEMS+4) /* window height */
-#define WMENU_TITLE "Command"
-#define WMENU_POSLN 8 /* window position: lines */
-#define WMENU_POSCO 20 /* window position: columns */
-
-#define CR 0x0d
-#define LF 0x0a
-#define TAB 0x09
-#define CNTRL_D 0x04
-#define CNTRL_L 0x0c
-
-#define ST_IDLE 0
-#define ST_DIALING 1
-#define ST_ACTIVE 2
-#define ST_MAX 2
-
-#define AUDIORATE 8000
-
-#ifdef MAIN
-
-WINDOW *main_w; /* curses main window pointer */
-WINDOW *dbg_w;
-
-int curses_ready = 0; /* flag, curses display is initialized */
-int state = ST_IDLE;
-
-char *states[] = {
- "IDLE",
- "DIALING",
- "ACTIVE"
-};
-
-int dialerfd = -1;
-int audiofd = -1;
-int telfd = -1;
-int curx;
-char numberbuffer[TELNO_MAX];
-
-int play_fmt = AFMT_MU_LAW;
-int rec_fmt = AFMT_MU_LAW;
-
-int opt_unit = 0;
-int opt_d = 0;
-#else
-
-extern WINDOW *main_w;
-extern WINDOW *dbg_w;
-
-extern int curses_ready;
-extern int state;
-
-extern char *states[];
-
-extern int dialerfd;
-extern int audiofd;
-extern int telfd;
-extern int curx;
-extern char numberbuffer[];
-
-extern int play_fmt;
-extern int rec_fmt;
-
-int opt_unit;
-int opt_d;
-
-#endif
-
-extern void audio_hdlr ( void );
-extern void tel_hdlr ( void );
-extern void init_mainw ( void );
-extern int init_audio ( char * );
-extern void do_menu ( void );
-extern int main ( int argc, char **argv );
-extern void do_quit ( int exitval );
-extern void fatal ( char *fmt, ... );
-extern void message ( char *fmt, ... );
-extern void do_dial ( char *number );
-extern void do_hangup ( void );
-
-extern void audiowrite ( int, unsigned char * );
-extern void telwrite ( int, unsigned char * );
-
-extern void newstate ( int newstate );
-
-int init_dial(char *device);
-void dial_hdlr(void);
-int init_tel(char *device);
-
-extern void debug ( char *fmt, ... );
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnphone/display.c b/usr.sbin/i4b/isdnphone/display.c
deleted file mode 100644
index 1dff9a1..0000000
--- a/usr.sbin/i4b/isdnphone/display.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (c) 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdnphone - some display operations
- * ===================================
- *
- * $Id: display.c,v 1.4 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:52:55 1999]
- *
- *----------------------------------------------------------------------------*/
-
-#include "defs.h"
-
-/*---------------------------------------------------------------------------*
- * init curses fullscreen display
- *---------------------------------------------------------------------------*/
-void
-init_mainw(void)
-{
- char buffer[512];
-
- initscr(); /* curses init */
-
- if((COLS < 80) || (LINES < 24))
- fatal(0, "ERROR, minimal screensize must be 80x24, is %dx%d, terminating!", COLS, LINES);
-
-
- if((main_w = newwin(MW_HEIGHT, MW_WIDTH, MW_ROW, MW_COL)) == NULL)
- fatal("ERROR, curses init main window, terminating!");
-
- if(opt_d)
- {
- if((dbg_w = newwin(DB_HGT, DB_WID, DB_ROW, DB_COL)) == NULL)
- fatal("ERROR, curses init debug window, terminating!");
- scrollok(dbg_w, TRUE);
- }
-
- raw(); /* raw input */
- noecho(); /* do not echo input */
- keypad(stdscr, TRUE); /* use special keys */
- keypad(main_w, TRUE); /* use special keys */
-
- box(main_w, 0, 0);
-
- sprintf(buffer, "isdnphone %d.%d ", VERSION, REL);
-
- wstandout(main_w);
- mvwaddstr(main_w, 0, (MW_WIDTH / 2) - (strlen(buffer) / 2), buffer);
- wstandend(main_w);
-
- mvwaddstr(main_w, MW_STATEY, MW_STATEX, " state: ");
- mvwprintw(main_w, MW_STATEY, MW_STX, "%s", states[state]);
- wmove(main_w, MW_STATEY+1, 1);
- whline(main_w, 0, MW_WIDTH-2);
-
- mvwaddstr(main_w, MW_NUMY, MW_NUMX, " number: ");
- wmove(main_w, MW_NUMY+1, 1);
- whline(main_w, 0, MW_WIDTH-2);
-
- mvwaddstr(main_w, MW_MSGY, MW_MSGX, "message: ");
-
- wrefresh(main_w);
-
- curses_ready = 1;
-}
-
-/*---------------------------------------------------------------------------*
- * curses menu for fullscreen command mode
- *---------------------------------------------------------------------------*/
-void
-do_menu(void)
-{
- static char *menu[WMITEMS] =
- {
- "Hangup",
-#define HANGUP 0
- "Dial",
-#define DIAL 1
- "Refresh",
-#define REFRESH 2
- "Exit",
-#define EXIT 3
- };
-
- WINDOW *menu_w;
- int c;
- int mpos;
-
- /* create a new window in the lower screen area */
-
- if((menu_w = newwin(WMENU_HGT, WMENU_LEN, WMENU_POSLN, WMENU_POSCO )) == NULL)
- return;
-
- keypad(menu_w, TRUE); /* use special keys */
-
- /* draw border around the window */
-
- box(menu_w, 0, 0);
-
- /* add a title */
-
- wstandout(menu_w);
- mvwaddstr(menu_w, 0, (WMENU_LEN / 2) - (strlen(WMENU_TITLE) / 2), WMENU_TITLE);
- wstandend(menu_w);
-
- /* fill the window with the menu options */
-
- for(mpos=0; mpos <= (WMITEMS-1); mpos++)
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
-
- /* highlight the first menu option */
-
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
-
- /* input loop */
-
- for(;;)
- {
- wrefresh(menu_w);
-
- c = wgetch(menu_w);
-
- switch(c)
- {
- case TAB:
- case KEY_DOWN: /* down-move cursor */
- case ' ':
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- mpos++;
- if(mpos >= WMITEMS)
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case KEY_UP: /* up-move cursor */
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- if(mpos)
- mpos--;
- else
- mpos = WMITEMS-1;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case 'R':
- case 'r':
- wrefresh(curscr);
- goto mexit;
-
- case 'E':
- case 'e':
- case 'Q':
- case 'q':
- case 'X':
- case 'x':
- do_quit(0);
- goto mexit;
- break;
-
- case 'H':
- case 'h':
- do_hangup();
- goto mexit;
- break;
-
- case 'D':
- case 'd':
- goto mexit;
- break;
-
- case CR:
- case LF: /* exec highlighted option */
-#ifdef KEY_ENTER
- case KEY_ENTER:
-#endif
- switch(mpos)
- {
- case DIAL:
- goto mexit;
- break;
- case HANGUP:
- do_hangup();
- goto mexit;
- break;
- case REFRESH:
- wrefresh(curscr);
- break;
- case EXIT:
- do_quit(0);
- break;
- }
- goto mexit;
- break;
-
- default:
- goto mexit;
- break;
- }
- }
-
-mexit:
- /* delete the menu window */
-
- wclear(menu_w);
- wrefresh(menu_w);
- delwin(menu_w);
-
- /* re-display the original lower window contents */
-
- touchwin(main_w);
- wrefresh(main_w);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnphone/isdn.c b/usr.sbin/i4b/isdnphone/isdn.c
deleted file mode 100644
index 34719c7..0000000
--- a/usr.sbin/i4b/isdnphone/isdn.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdnphone - isdn (i4b) handling
- * ===============================
- *
- * $Id: isdn.c,v 1.4 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:53:05 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "defs.h"
-
-/*---------------------------------------------------------------------------*
- * dialer init
- *---------------------------------------------------------------------------*/
-int
-init_dial(char *device)
-{
- int ret;
-
- if((ret = open(device, O_RDWR)) < 0)
- {
- fprintf(stderr, "unable to open %s: %s\n", device, strerror(errno));
- return(-1);
- }
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * i4bteld data available handler
- *---------------------------------------------------------------------------*/
-void
-dial_hdlr(void)
-{
- char result;
-
- if((read (dialerfd, &result, 1) < 0))
- {
- fatal("read failed: %s", strerror(errno));
- }
-
- switch(result)
- {
- case RSP_CONN:
- newstate(ST_ACTIVE);
- message("connected to remote!");
- break;
-
- case RSP_BUSY:
- message("remote is busy!");
- break;
-
- case RSP_HUP:
- newstate(ST_IDLE);
- message("disconnected from remote!");
- break;
-
- case RSP_NOA:
- message("no answer from remote!");
- break;
-
- default:
- message("unknown response = 0x%2x!", result);
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * telephone init
- *---------------------------------------------------------------------------*/
-int
-init_tel(char *device)
-{
- int ret;
- int format;
-
- if(play_fmt == AFMT_MU_LAW)
- format = CVT_ALAW2ULAW;
- else
- format = CVT_NONE;
-
- if((ret = open(device, O_RDWR)) < 0)
- fatal("unable to open %s: %s\n", device, strerror(errno));
-
- if((ioctl(ret, I4B_TEL_SETAUDIOFMT, &format)) < 0)
- fatal("ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
-
- return(ret);
-}
-
-/*---------------------------------------------------------------------------*
- * dial number
- *---------------------------------------------------------------------------*/
-void
-do_dial(char *number)
-{
- char commandbuffer[80];
- sprintf(commandbuffer, "D%s", number);
-
- if((write(dialerfd, commandbuffer, strlen(commandbuffer))) < 0)
- {
- fatal("write commandbuffer failed: %s", strerror(errno));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * hangup
- *---------------------------------------------------------------------------*/
-void
-do_hangup(void)
-{
- char commandbuffer[80];
-
- if(state == ST_IDLE)
- {
- message("tried hangup while ST_IDLE");
- return;
- }
-
- sprintf(commandbuffer, "H");
-
- if((write(dialerfd, commandbuffer, strlen(commandbuffer))) < 0)
- {
- fatal("write commandbuffer failed: %s", strerror(errno));
- }
-}
-
-/*---------------------------------------------------------------------------*
- * i4btel speech data available handler
- *---------------------------------------------------------------------------*/
-void
-tel_hdlr(void)
-{
- unsigned char buffer[BCH_MAX_DATALEN];
- int ret;
-
- ret = read(telfd, buffer, BCH_MAX_DATALEN);
-
- if(ret < 0)
- {
- fatal("read telfd failed: %s", strerror(errno));
- }
-
- debug("tel_hdlr: read %d bytes\n", ret);
-
- if(ret > 0)
- {
- audiowrite(ret, buffer);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * write audio data to ISDN
- *---------------------------------------------------------------------------*/
-void
-telwrite(int len, unsigned char *buf)
-{
- if((write(telfd, buf, len)) < 0)
- {
- fatal("write tel failed: %s", strerror(errno));
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdnphone/isdnphone.8 b/usr.sbin/i4b/isdnphone/isdnphone.8
deleted file mode 100644
index 5ba4782..0000000
--- a/usr.sbin/i4b/isdnphone/isdnphone.8
+++ /dev/null
@@ -1,88 +0,0 @@
-.\"
-.\" Copyright (c) 1999, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Tue Aug 27 16:42:12 2002]
-.\"
-.\"
-.Dd August 27, 2002
-.Dt ISDNPHONE 8
-.Os
-.Sh NAME
-.Nm isdnphone
-.Nd telephone dialing and more for isdn4bsd
-.Sh SYNOPSIS
-.Nm
-.Op Fl d
-.Op Fl h
-.Op Fl k Ar string
-.Op Fl n Ar number
-.Op Fl u Ar unit
-.Op Fl v
-.Op Fl w
-.Sh DESCRIPTION
-The
-.Nm
-utility
-is part of the isdn4bsd package and is used to handle dialing and hangup
-for the telephone control interfaces
-.Pa /dev/i4bteld Ns Aq Ar n .
-.Pp
-Options are provided to dial out or hang up using command line parameters
-(for use in scripts) or, if none of those options are specified, bring up
-a curses-based full-screen interface.
-.Pp
-The following options are available:
-.Bl -tag -width indent
-.It Fl d
-Enable debugging message display.
-.It Fl h
-Hang up a possibly open telephone connection on the selected interface.
-.It Fl k
-Send the specified string using the keypad facility information element.
-.It Fl n
-Dial the specified number on the selected interface.
-.It Fl u
-Set the unit number to specify the interface used.
-.It Fl v
-Enable verbose result messages for dialling (-n and -w)
-.It Fl w
-After dialling (using the -n option), wait for the first result message.
-.El
-.Sh FILES
-.Bl -tag -width indent -compact
-.It Pa /dev/i4bteld Ns Aq Ar n
-.El
-.Sh EXAMPLES
-The command:
-.Dl "isdnphone -n 1234"
-.Pp
-dials calls the number 1234 to establish a call on
-.Pa /dev/i4btel0
-.Sh AUTHORS
-The
-.Nm
-utility and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/isdnphone/main.c b/usr.sbin/i4b/isdnphone/main.c
deleted file mode 100644
index 8a9b92a..0000000
--- a/usr.sbin/i4b/isdnphone/main.c
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * Copyright (c) 1999, 2002 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdnphone - main module
- * =======================
- *
- * $FreeBSD$
- *
- * last edit-date: [Tue Aug 27 16:38:55 2002]
- *
- *---------------------------------------------------------------------------*/
-
-#define MAIN
-#include "defs.h"
-
-static void kbd_hdlr(void);
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdnphone - i4b phone program, version %d.%d.%d\n",VERSION, REL, STEP);
- fprintf(stderr, "usage: isdnphone -d -h -k <string> -n <number> -u <unit> -v -w\n");
- fprintf(stderr, " -d debug\n");
- fprintf(stderr, " -h hangup\n");
- fprintf(stderr, " -k string keypad string\n");
- fprintf(stderr, " -n number dial number\n");
- fprintf(stderr, " -u unit set unit number\n");
- fprintf(stderr, " -v be verbose\n");
- fprintf(stderr, " -w wait for response (with -n)\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int c;
- char namebuffer[128];
- int bschar;
- int ret;
- int opt_n = 0;
- int opt_s = 0;
- int opt_h = 0;
- int opt_k = 0;
- int opt_v = 0;
- int opt_w = 0;
- char *number = "";
- char *subaddr = "";
-
- numberbuffer[0] = '\0';
-
- while ((c = getopt(argc, argv, "dhk:n:s:u:w")) != -1)
- {
- switch(c)
- {
- case 'd':
- opt_d = 1;
- break;
-
- case 'h':
- opt_h = 1;
- break;
-
- case 'k':
- number = optarg;
- opt_k = 1;
- break;
-
- case 'n':
- number = optarg;
- opt_n = 1;
- break;
-
- case 's':
- subaddr = optarg;
- opt_s = 1;
- break;
-
- case 'u':
- opt_unit = atoi(optarg);
- if(opt_unit < 0 || opt_unit > 9)
- usage();
- break;
-
- case 'v':
- opt_v = 1;
- break;
-
- case 'w':
- opt_w = 1;
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- sprintf(namebuffer,"%s%d", I4BTELDDEVICE, opt_unit);
-
- if((dialerfd = init_dial(namebuffer)) == -1)
- exit(1);
-
- if(opt_n || opt_h || opt_k)
- {
- char commandbuffer[80];
- int exitval = 0;
-
- /* commandline operation goes here */
-
- if(opt_n)
- {
- if(opt_s)
- sprintf(commandbuffer, "D%s*%s", number, subaddr);
- else
- sprintf(commandbuffer, "D%s", number);
-
- }
- else if(opt_k)
- {
- sprintf(commandbuffer, "K%s", number);
-
- }
- else if(opt_h)
- {
- sprintf(commandbuffer, "H");
- }
-
- if((ret = write(dialerfd, commandbuffer, strlen(commandbuffer))) < 0)
- {
- fprintf(stderr, "write commandbuffer failed: %s", strerror(errno));
- exit(1);
- }
-
- if(opt_n && opt_w)
- {
- char result;
-
- if((read (dialerfd, &result, 1) < 0))
- {
- exitval = 99;
- if(opt_v)
- printf("error\n");
- fprintf(stderr, "error, read failed: %s\n", strerror(errno));
- }
- else
- {
- switch(result)
- {
- case RSP_CONN:
- exitval = 0;
- if(opt_v)
- printf("connected\n");
- break;
-
- case RSP_BUSY:
- exitval = 1;
- if(opt_v)
- printf("busy\n");
- break;
-
- case RSP_HUP:
- exitval = 2;
- if(opt_v)
- printf("disconnected\n");
- break;
-
- case RSP_NOA:
- exitval = 3;
- if(opt_v)
- printf("noanswer\n");
- break;
-
- default:
- exitval = 99;
- if(opt_v)
- printf("error\n");
- fprintf(stderr, "unknown response = 0x%2x!", result);
- break;
- }
- }
- }
-
- close(dialerfd);
-
- exit(exitval);
- }
-
- if((audiofd = init_audio(AUDIODEVICE)) == -1)
- exit(1);
-
- /* fullscreen operation here */
-
- init_mainw();
-
- bschar = erasechar();
- curx = 0;
-
- wmove(main_w, MW_NUMY, MW_NUX + curx);
-
- /* go into loop */
-
- for (;;)
- {
- int maxfd = 0;
- fd_set set;
- struct timeval timeout;
-
- FD_ZERO(&set);
-
- FD_SET(STDIN_FILENO, &set);
- if(STDIN_FILENO > maxfd)
- maxfd = STDIN_FILENO;
-
- FD_SET(dialerfd, &set);
- if(dialerfd > maxfd)
- maxfd = dialerfd;
-
- if(state == ST_ACTIVE)
- {
- if(audiofd != -1)
- {
- FD_SET(audiofd, &set);
- if(audiofd > maxfd)
- maxfd = audiofd;
- }
-
- if(telfd != -1)
- {
- FD_SET(telfd, &set);
- if(telfd > maxfd)
- maxfd = telfd;
- }
- }
-
- timeout.tv_sec = 2;
- timeout.tv_usec = 0;
-
- wrefresh(main_w);
-
- /* if no char is available within timeout, do something */
-
-#ifdef NOTDEF
- ret = select(maxfd+1, &set, NULL, NULL, &timeout);
-#else
- ret = select(maxfd+1, &set, NULL, NULL, NULL);
-#endif
-
- if(ret > 0)
- {
- if((telfd != -1) && (FD_ISSET(telfd, &set)))
- {
- message("select from ISDN");
- tel_hdlr();
- }
- if((audiofd != -1) && (FD_ISSET(audiofd, &set)))
- {
- message("select from audio");
- audio_hdlr();
- }
- if(FD_ISSET(dialerfd, &set))
- {
- message("select from tel");
- dial_hdlr();
- }
- if(FD_ISSET(STDIN_FILENO, &set))
- {
- message("select from kbd");
- kbd_hdlr();
- }
- }
- }
- do_quit(0);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * keyboard character available handler
- *---------------------------------------------------------------------------*/
-static void
-kbd_hdlr(void)
-{
- int kchar;
-
- kchar = wgetch(main_w); /* get char */
-
- switch (kchar)
- {
- case CR:
- case LF:
-#ifdef KEY_ENTER
- case KEY_ENTER:
-#endif
- if((state == ST_IDLE) &&
- (numberbuffer[0] != '\0'))
- {
- message("dialing .....");
- do_dial(&numberbuffer[0]);
- }
- else
- {
- do_menu();
- }
- break;
-
- case CNTRL_D:
- if(state == ST_IDLE)
- {
- do_quit(0);
- }
- else
- {
- message("cannot exit while not idle!");
- beep();
- }
-
- break;
-
- case CNTRL_L: /* refresh */
- touchwin(curscr);
- wrefresh(curscr);
- break;
-
- case KEY_BACKSPACE:
- case KEY_DC:
- if (curx == 0)
- break;
-
- curx--;
- mvwaddch(main_w, MW_NUMY, MW_NUX + curx, ' ');
- numberbuffer[curx] = '\0';
- wmove(main_w, MW_NUMY, MW_NUX + curx);
-
- if(curx == 0)
- message(" ");
-
- break;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if(curx > (TELNO_MAX-1))
- break;
-
- mvwaddch(main_w, MW_NUMY, MW_NUX + curx, kchar);
-
- numberbuffer[curx] = kchar;
-
- curx++;
-
- numberbuffer[curx] = '\0';
-
- message("press ENTER to dial number .....");
- break;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * exit program
- *---------------------------------------------------------------------------*/
-void
-do_quit(int exitval)
-{
- close(dialerfd);
- move(LINES-1, 0);
- clrtoeol();
- refresh();
- endwin();
- exit(exitval);
-}
-
-/*---------------------------------------------------------------------------*
- * fatal error exit
- *---------------------------------------------------------------------------*/
-void
-fatal(char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
-
- do_hangup(); /* failsafe */
-
- if(curses_ready)
- {
- close(dialerfd);
- move(LINES-1, 0);
- clrtoeol();
- refresh();
- endwin();
- }
-
- fprintf(stderr, "\nFatal error: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n\n");
-
- va_end(ap);
-
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * message printing
- *---------------------------------------------------------------------------*/
-void
-message(char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
-
- if(curses_ready)
- {
- int i;
- char sbuf[MW_WIDTH];
-
- wmove(main_w, MW_MSGY, MW_MSX);
- vsnprintf(sbuf, MW_WIDTH-MW_MSX-1, fmt, ap);
- waddstr(main_w, sbuf);
- for(i=strlen(sbuf);i < MW_WIDTH-MW_MSX-2; i++)
- waddch(main_w, ' ');
- wmove(main_w, MW_NUMY, MW_NUX + curx);
- wrefresh(main_w);
- }
- else
- {
- fprintf(stderr, "ERROR: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
- }
-
- va_end(ap);
-}
-
-/*---------------------------------------------------------------------------*
- * message printing
- *---------------------------------------------------------------------------*/
-void
-debug(char *fmt, ...)
-{
- va_list ap;
-
- if(opt_d == 0)
- return;
-
- va_start(ap, fmt);
-
- vwprintw(dbg_w, fmt, ap);
- wrefresh(dbg_w);
-
- va_end(ap);
-}
-
-/*---------------------------------------------------------------------------*
- * go to new state
- *---------------------------------------------------------------------------*/
-void
-newstate(int newstate)
-{
- int i;
-
- if(newstate < 0 || newstate > ST_MAX)
- {
- message("newstate %d undefined!", newstate);
- return;
- }
-
- state = newstate;
-
- if(newstate == ST_ACTIVE)
- {
- char namebuffer[128];
-
- sprintf(namebuffer,"%s%d", I4BTELDEVICE, opt_unit);
- telfd = init_tel(namebuffer);
- }
-
- if(newstate == ST_IDLE)
- {
- close(telfd);
- telfd = -1;
- }
-
- wmove(main_w, MW_STATEY, MW_STX);
- waddstr(main_w, states[newstate]);
-
- for(i=strlen(states[newstate]);i < MW_WIDTH-MW_STX-2; i++)
- waddch(main_w, ' ');
-
- wmove(main_w, MW_NUMY, MW_NUX + curx);
- wrefresh(main_w);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/Makefile b/usr.sbin/i4b/isdntel/Makefile
deleted file mode 100644
index e3aff09..0000000
--- a/usr.sbin/i4b/isdntel/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-PROG= isdntel
-MAN= isdntel.8
-SRCS= main.c display.c files.c alias.c
-
-DPADD= ${LIBNCURSES}
-LDADD= -lncurses
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdntel/alias.c b/usr.sbin/i4b/isdntel/alias.c
deleted file mode 100644
index 0f4dae7..0000000
--- a/usr.sbin/i4b/isdntel/alias.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering machine support
- * ======================================================
- *
- * $Id: alias.c,v 1.9 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:53:37 1999]
- *
- *----------------------------------------------------------------------------*/
-
-#include "defs.h"
-#include "alias.h"
-
-static struct alias *firsta = NULL;
-
-#define MAXBUFSZ 256
-
-/*---------------------------------------------------------------------------*
- * read in and init aliases
- *---------------------------------------------------------------------------*/
-void
-init_alias(char *filename)
-{
- FILE *fp;
- unsigned char buffer[MAXBUFSZ + 1];
- unsigned char number[MAXBUFSZ + 1];
- unsigned char name[MAXBUFSZ + 1];
- unsigned char *s, *d;
- struct alias *newa = NULL;
- struct alias *lasta = NULL;
-
- if((fp = fopen(filename, "r")) == NULL)
- return;
-
- while((fgets(buffer, MAXBUFSZ, fp)) != NULL)
- {
- if(buffer[0] == '#' || buffer[0] == ' ' ||
- buffer[0] == '\t' || buffer[0] == '\n')
- {
- continue;
- }
-
- s = buffer;
- d = number;
-
- while(*s && (isdigit(*s)))
- *d++ = *s++;
-
- *d = '\0';
-
- while(*s && (isspace(*s)))
- s++;
-
- d = name;
-
- while(*s && (isprint(*s)))
- *d++ = *s++;
-
- *d = '\0';
-
- if((strlen(number) > 1) && (strlen(name) > 1))
- {
- if((newa = (struct alias *) malloc(sizeof(struct alias))) == NULL)
- fatal("malloc failed for struct alias");
- if((newa->number = (char *) malloc(strlen(number)+1)) == NULL)
- fatal("malloc failed for number alias");
- if((newa->name = (char *) malloc(strlen(name)+1)) == NULL)
- fatal("malloc failed for name alias");
- strcpy(newa->name, name);
- strcpy(newa->number, number);
- newa->next = NULL;
-
- if(firsta == NULL)
- {
- firsta = newa;
- }
- else
- {
- lasta->next = newa;
- }
- lasta = newa;
- }
- }
- fclose(fp);
-}
-
-/*---------------------------------------------------------------------------*
- * read in and init aliases
- *---------------------------------------------------------------------------*/
-char *
-get_alias(char *number)
-{
- struct alias *ca = NULL;
-
- if(firsta == NULL)
- return(NULL);
-
- ca = firsta;
-
- for(;;)
- {
- if(strlen(number) == strlen(ca->number))
- {
- if(!(strcmp(number, ca->number)))
- return(ca->name);
- }
- if(ca->next == NULL)
- break;
- ca = ca->next;
- }
- return(NULL);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/alias.h b/usr.sbin/i4b/isdntel/alias.h
deleted file mode 100644
index 813d5bd..0000000
--- a/usr.sbin/i4b/isdntel/alias.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdn4bsd common alias file handling header
- * ==========================================
- *
- * $Id: alias.h,v 1.5 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:53:44 1999]
- *
- *----------------------------------------------------------------------------*/
-
-#ifndef _ALIAS_H_
-#define _ALIAS_H_
-
-#define ALIASFILE "/etc/isdn/isdntel.alias"
-
-struct alias {
- char *number; /* telephone number string */
- char *name; /* name string */
- struct alias *next; /* ptr to next alias */
-};
-
-#endif /* _ALIAS_H_ */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/defs.h b/usr.sbin/i4b/isdntel/defs.h
deleted file mode 100644
index 0d8d386..0000000
--- a/usr.sbin/i4b/isdntel/defs.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering support
- * ==============================================
- *
- * $Id: defs.h,v 1.10 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:53:50 1999]
- *
- *----------------------------------------------------------------------------*/
-
-#include <ncurses.h>
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <sys/time.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <dirent.h>
-#else
-#include <sys/dir.h>
-#endif
-#include <sys/param.h>
-
-#include <i4b/i4b_ioctl.h>
-
-#define GOOD 0
-#define ERROR (-1)
-#define WARNING (-2)
-
-#define SPOOLDIR "/var/isdn"
-#define PLAYCMD "cat %s | g711conv -a >/dev/audio"
-
-/* reread timeout in seconds */
-
-#define REREADTIMEOUT 60
-
-/* window dimensions */
-
-#define START_O 3 /* main window start */
-
-#define DAT_POS 0
-#define TIM_POS (DAT_POS+10)
-#define DST_POS (TIM_POS+8)
-#define SRC_POS (DST_POS+17)
-#define ALI_POS (SRC_POS+17)
-#define SEC_POS (ALI_POS+21)
-#define LAST_POS (SEC_POS+5)
-
-/* fullscreen mode menu window */
-
-#define WMITEMS 5 /* no of items */
-#define WMENU_LEN 18 /* window width */
-#define WMENU_HGT (WMITEMS+4) /* window height */
-#define WMENU_TITLE "Command"
-#define WMENU_POSLN 8 /* window position: lines */
-#define WMENU_POSCO 20 /* window position: columns */
-
-#define CR 0x0d
-#define LF 0x0a
-#define TAB 0x09
-#define CNTRL_D 0x04
-#define CNTRL_L 0x0c
-
-struct onefile {
- char *fname; /* filename */
- char *date;
- char *time;
- char *srcnumber;
- char *dstnumber;
- char *seconds;
- char *alias;
- int len;
- struct onefile *next; /* ptr to next entry */
- struct onefile *prev; /* prt to previous entry */
-};
-
-#ifdef MAIN
-
-int curses_ready = 0; /* flag, curses display is initialized */
-
-struct onefile *cur_file = NULL;/* the CURRENT filename */
-struct onefile *first = NULL; /* init dir-list head-ptr */
-struct onefile *last = NULL; /* init dir-list tail-ptr */
-
-WINDOW *main_w; /* curses main window pointer */
-
-int nofiles = 0;
-int cur_pos = 0;
-
-char *spooldir = SPOOLDIR;
-char *playstring = PLAYCMD;
-
-#else
-
-extern int curses_ready;
-
-extern struct onefile *cur_file;
-extern struct onefile *first;
-extern struct onefile *last;
-
-extern WINDOW *main_w;
-
-extern int nofiles;
-extern int cur_pos;
-
-extern char *spooldir;
-extern char *playstring;
-
-#endif
-
-extern void init_alias( char *filename );
-extern void init_files( int inipos );
-extern void init_screen ( void );
-extern void do_menu ( void );
-extern int fill_list( void );
-extern char *get_alias( char *number );
-extern int main ( int argc, char **argv );
-extern void do_quit ( int exitval );
-extern void fatal ( char *fmt, ... );
-extern void error ( char *fmt, ... );
-extern void play ( struct onefile * );
-extern void delete ( struct onefile * );
-extern void reread( void );
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/display.c b/usr.sbin/i4b/isdntel/display.c
deleted file mode 100644
index 53e6637..0000000
--- a/usr.sbin/i4b/isdntel/display.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (c) 1997, 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering machine support
- * ======================================================
- *
- * $Id: display.c,v 1.9 2000/07/19 08:56:24 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Wed Jul 19 10:08:06 2000]
- *
- *----------------------------------------------------------------------------*/
-
-#include "defs.h"
-
-static char *helpstr = "Enter Control-D to exit program or RETURN for command window";
-
-/*---------------------------------------------------------------------------*
- * init curses fullscreen display
- *---------------------------------------------------------------------------*/
-void
-init_screen(void)
-{
- char buffer[512];
-
- initscr(); /* curses init */
-
- curses_ready = 1;
-
- if((COLS < 80) || (LINES < 24))
- fatal("ERROR, minimal screensize must be 80x24, is %dx%d, terminating!", COLS, LINES);
-
-
- if((main_w = newwin(LINES-START_O-2, COLS, START_O, 0)) == NULL)
- fatal("ERROR, curses init main window, terminating!");
-
- raw(); /* raw input */
- noecho(); /* do not echo input */
- keypad(stdscr, TRUE); /* use special keys */
- keypad(main_w, TRUE); /* use special keys */
- scrollok(main_w, TRUE);
-
- sprintf(buffer, " isdntel %d.%d.%d ", VERSION, REL, STEP);
-
- move(0, 0);
- standout();
- hline(ACS_HLINE, 5);
- move(0, 5);
- addstr(buffer);
- move(0, 5 + strlen(buffer));
- hline(ACS_HLINE, 256);
- standend();
-
- move(1, 0);
- addstr("Date Time Called Party Calling Party Alias Length");
- /* 31.12.96 16:45:12 1234567890123456 1234567890123456 12345678901234567890 123456 */
-
- move(2, 0);
- hline(ACS_HLINE, 256);
-
- move(LINES-2, 0);
- hline(ACS_HLINE, 256);
-
- mvaddstr(LINES-1, (COLS / 2) - (strlen(helpstr) / 2), helpstr);
-
- refresh();
-
- wrefresh(main_w);
-}
-
-/*---------------------------------------------------------------------------*
- * curses menu for fullscreen command mode
- *---------------------------------------------------------------------------*/
-void
-do_menu(void)
-{
- static char *menu[WMITEMS] =
- {
- "Play File",
-#define PLAY 0
- "Delete File",
-#define DELETE 1
- "Re-Read Spool",
-#define REREAD 2
- "Refresh Screen",
-#define REFRESH 3
- "Exit Program",
-#define EXIT 4
- };
-
- WINDOW *menu_w;
- int c;
- int mpos;
-
- /* create a new window in the lower screen area */
-
- if((menu_w = newwin(WMENU_HGT, WMENU_LEN, WMENU_POSLN, WMENU_POSCO )) == NULL)
- return;
-
- keypad(menu_w, TRUE); /* use special keys */
-
- /* draw border around the window */
-
- box(menu_w, 0, 0);
-
- /* add a title */
-
- wstandout(menu_w);
- mvwaddstr(menu_w, 0, (WMENU_LEN / 2) - (strlen(WMENU_TITLE) / 2), WMENU_TITLE);
- wstandend(menu_w);
-
- /* fill the window with the menu options */
-
- for(mpos=0; mpos <= (WMITEMS-1); mpos++)
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
-
- /* highlight the first menu option */
-
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
-
- /* input loop */
-
- for(;;)
- {
- wrefresh(menu_w);
-
- c = wgetch(menu_w);
-
- switch(c)
- {
- case TAB:
- case KEY_DOWN: /* down-move cursor */
- case ' ':
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- mpos++;
- if(mpos >= WMITEMS)
- mpos = 0;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case KEY_UP: /* up-move cursor */
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- if(mpos)
- mpos--;
- else
- mpos = WMITEMS-1;
- wstandout(menu_w);
- mvwaddstr(menu_w, mpos + 2, 2, menu[mpos]);
- wstandend(menu_w);
- break;
-
- case 'R':
- case 'r':
- wrefresh(curscr);
- goto mexit;
-
- case 'E':
- case 'e':
- case 'Q':
- case 'q':
- case 'X':
- case 'x':
- do_quit(0);
- goto mexit;
- break;
-
- case 'P':
- case 'p':
- play(cur_file);
- goto mexit;
- break;
-
- case 'D':
- case 'd':
- delete(cur_file);
- goto mexit;
- break;
-
- case CR:
- case LF: /* exec highlighted option */
-#ifdef KEY_ENTER
- case KEY_ENTER:
-#endif
- switch(mpos)
- {
- case PLAY:
- play(cur_file);
- goto mexit;
- break;
- case DELETE:
- delete(cur_file);
- goto mexit;
- break;
- case REREAD:
- reread();
- goto mexit;
- break;
- case REFRESH:
- wrefresh(curscr);
- break;
- case EXIT:
- do_quit(0);
- break;
- }
- goto mexit;
- break;
-
- default:
- goto mexit;
- break;
- }
- }
-
-mexit:
- /* delete the menu window */
-
- delwin(menu_w);
-
- /* re-display the original lower window contents */
-
- touchwin(main_w);
- wrefresh(main_w);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntel/files.c b/usr.sbin/i4b/isdntel/files.c
deleted file mode 100644
index bf05b42..0000000
--- a/usr.sbin/i4b/isdntel/files.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering machine support
- * ======================================================
- *
- * $Id: files.c,v 1.8 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:54:06 1999]
- *
- *----------------------------------------------------------------------------*/
-
-#include "defs.h"
-
-/*---------------------------------------------------------------------------*
- * create a doubly linked list in sorted order, return pointer to new
- * first element of list
- *---------------------------------------------------------------------------*/
-struct onefile *store
- (register struct onefile *new, /* new entry to store into list */
- register struct onefile *top) /* current first entry in list */
-{
- register struct onefile *old, *p;
-
- if (last == NULL) /* enter very first element ? */
- {
- new->next = NULL;
- new->prev = NULL;
- last = new; /* init last */
- return (new); /* return new first */
- }
- p = top; /* p = old first element */
- old = NULL;
- while (p)
- {
- if ((strcmp(p->fname, new->fname)) < 0) /* current less new ? */
- {
- old = p;
- p = p->next;
- }
- else
- { /* current >= new */
-
- if (p->prev)
- {
- p->prev->next = new;
- new->next = p;
- new->prev = p->prev;
- p->prev = new;
- return (top);
- }
- new->next = p;
- new->prev = NULL;
- p->prev = new;
- return (new);
- }
- }
- old->next = new;
- new->next = NULL;
- new->prev = old;
- last = new;
- return (first);
-}
-
-/*---------------------------------------------------------------------------*
- * read current directory and build up a doubly linked sorted list
- *---------------------------------------------------------------------------*/
-int
-fill_list(void)
-{
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
- register struct dirent *dp;
-#else
- register struct direct *dp;
-#endif
- register struct onefile *new_entry;
- register DIR *dirp;
- int flcnt = 0;
- char tmp[80];
- char *s, *d;
-
- if ((dirp = opendir(spooldir)) == NULL)
- fatal("cannot open spooldirectory %s!\n", spooldir);
-
- for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
- {
- if(!isdigit(*(dp->d_name)))
- continue;
-
- if ((new_entry = (struct onefile *) malloc(sizeof(struct onefile))) == NULL)
- {
- fatal("files.c, fill_list(): structure onefile malloc failed");
- }
-
- /* alloc filename memory and copy name into it */
-
- if ((new_entry->fname = (char *) malloc(strlen(dp->d_name) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc filename string memory failed");
- }
-
- strcpy(new_entry->fname, dp->d_name);
-
- /* fill in remaining fields from filename */
-
- tmp[0] = dp->d_name[4]; /* day msb */
- tmp[1] = dp->d_name[5]; /* day lsb */
- tmp[2] = '.';
- tmp[3] = dp->d_name[2]; /* month msb */
- tmp[4] = dp->d_name[3]; /* month lsb */
- tmp[5] = '.';
- tmp[6] = dp->d_name[0]; /* year msb */
- tmp[7] = dp->d_name[1]; /* year lsb */
- tmp[8] = '\0';
-
- if((new_entry->date = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc date string memory failed");
- }
-
- strcpy(new_entry->date, tmp);
-
- tmp[0] = dp->d_name[6]; /* hour msb */
- tmp[1] = dp->d_name[7]; /* hour lsb */
- tmp[2] = ':';
- tmp[3] = dp->d_name[8]; /* minute msb */
- tmp[4] = dp->d_name[9]; /* minute lsb */
- tmp[5] = ':';
- tmp[6] = dp->d_name[10]; /* second msb */
- tmp[7] = dp->d_name[11]; /* second lsb */
- tmp[8] = '\0';
-
- if((new_entry->time = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc time string memory failed");
- }
-
- strcpy(new_entry->time, tmp);
-
- /* destination number */
-
- s = &dp->d_name[13];
- d = &tmp[0];
-
- while(*s && (*s != '-'))
- *d++ = *s++;
-
- *d = '\0';
-
- if((new_entry->dstnumber = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc dstnumber string memory failed");
- }
-
- strcpy(new_entry->dstnumber, tmp);
-
- /* source number */
-
- s++;
- d = &tmp[0];
-
- while(*s && (*s != '-'))
- *d++ = *s++;
-
- *d = '\0';
-
- if((new_entry->srcnumber = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc srcnumber string memory failed");
- }
-
- strcpy(new_entry->srcnumber, tmp);
-
- /* length in seconds */
-
- s++;
- d = &tmp[0];
-
- while(*s && (*s != '-'))
- *d++ = *s++;
-
- *d = '\0';
-
- if((new_entry->seconds = (char *) malloc(strlen(tmp) + 1)) == NULL)
- {
- fatal("files.c, fill_list(): malloc seconds string memory failed");
- }
-
- strcpy(new_entry->seconds, tmp);
-
- /* search for alias and add if found */
-
- new_entry->alias = get_alias(new_entry->srcnumber);
-
- /* sort entry into linked list */
-
- first = store(new_entry, first);
-
- flcnt++; /* increment file count */
- }
- closedir(dirp); /* close current dir */
- return(flcnt); /* ok return */
-}
-
-/*---------------------------------------------------------------------------*
- * free the current malloc'ed list
- *---------------------------------------------------------------------------*/
-void
-free_list(void)
-{
- register struct onefile *dir;
- register struct onefile *tmp;
-
- dir = first; /* start of linked list */
-
- while (dir) /* free all */
- {
- tmp = dir->next; /* save ptr to next entry */
- free(dir->fname); /* free filename space */
- free(dir->date);
- free(dir->time);
- free(dir->srcnumber);
- free(dir->dstnumber);
- free(dir->seconds);
- free(dir); /* free struct space */
- dir = tmp; /* ptr = ptr to next entry */
- }
- first = NULL; /* first ptr = NULL */
- last = NULL; /* last ptr = NULL */
-}
-
-/*---------------------------------------------------------------------------*
- * delete a file
- *---------------------------------------------------------------------------*/
-void
-delete(struct onefile *this)
-{
- char buffer[MAXPATHLEN];
-
- if(this == NULL)
- return;
-
- strlcpy(buffer, this->fname, sizeof(buffer));
-
- unlink(buffer);
-
- free_list();
-
- wclear(main_w);
-
- init_files(cur_pos);
-}
-
-/*---------------------------------------------------------------------------*
- * reread the spool directory
- *---------------------------------------------------------------------------*/
-void
-reread(void)
-{
- free_list();
-
- wclear(main_w);
-
- init_files(cur_pos);
-}
-
-/*---------------------------------------------------------------------------*
- * play a file
- *---------------------------------------------------------------------------*/
-void
-play(struct onefile *this)
-{
- char buffer[MAXPATHLEN];
-
- if(this == NULL)
- return;
-
- snprintf(buffer, sizeof(buffer), playstring, this->fname);
-
- system(buffer);
-}
-
-/*---------------------------------- EOF -------------------------------------*/
diff --git a/usr.sbin/i4b/isdntel/isdntel.8 b/usr.sbin/i4b/isdntel/isdntel.8
deleted file mode 100644
index 430c9f2..0000000
--- a/usr.sbin/i4b/isdntel/isdntel.8
+++ /dev/null
@@ -1,103 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1999 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.
-.\"
-.\" last edit-date: [Mon Dec 13 23:05:59 1999]
-.\"
-.\" $FreeBSD$
-.\"
-.\" $Id: isdntel.8,v 1.9 1999/12/13 22:11:55 hm Exp $
-.\"
-.Dd July 11, 1998
-.Dt ISDNTEL 8
-.Os
-.Sh NAME
-.Nm isdntel
-.Nd isdn4bsd telephone answering management utility
-.Sh SYNOPSIS
-.Nm
-.Op Fl a Ar aliasfile
-.Op Fl d Ar spooldir
-.Op Fl p Ar playcommand
-.Op Fl t Ar timeout
-.Sh DESCRIPTION
-The
-.Nm
-utility is used to provide an "answering machine" functionality for incoming
-telephone voice messages.
-.Pp
-The following options are supported:
-.Bl -tag -width Ds
-.It Fl a
-Use
-.Ar aliasfile
-as the pathname for an aliasfile containing aliases for phone numbers.
-The
-default path is
-.Em /etc/isdn/isdntel.alias .
-The format of an alias entry is the number string followed by one or more
-spaces or tabs.
-The rest of the line is taken as the alias string.
-Comments
-are introduced by a leading blank, tab or "#" character.
-.It Fl d
-Use
-.Ar spooldir
-as the directory where the incoming voice messages are stored by the
-"answ" script called by
-.Xr isdnd 8 .
-This defaults to the directory
-.Em /var/isdn .
-The format of a voice message filename is:
-.Pp
-.Dl YYMMDDhhmmss-dest_number-source_number-length_in_secs
-.It Fl p
-Use
-.Ar playcommand
-as the command string to execute for playing a voice message to some audio
-output facility.
-The characters
-.Em %s
-are replaced by the currently selected filename.
-The default string is
-.Dq Li cat %s \&| alaw2ulaw >/dev/audio .
-.It Fl t
-The value for
-.Ar timeout
-specifies the time in seconds the program rereads the spool directory
-when there is no keyboard activity.
-.El
-.Pp
-The screen output should be obvious.
-If in doubt, consult the source.
-.Sh SEE ALSO
-.Xr i4btel 4 ,
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8
-.Sh AUTHORS
-The
-.Nm
-utility and this manual page were written by
-.An Hellmuth Michaelis Aq hm@kts.org .
-.Sh BUGS
-Still two or more left.
diff --git a/usr.sbin/i4b/isdntel/main.c b/usr.sbin/i4b/isdntel/main.c
deleted file mode 100644
index 6bea966..0000000
--- a/usr.sbin/i4b/isdntel/main.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntel - isdn4bsd telephone answering machine support
- * ======================================================
- *
- * $Id: main.c,v 1.12 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:54:26 1999]
- *
- *----------------------------------------------------------------------------*/
-
-#define MAIN
-#include <locale.h>
-#include <unistd.h>
-#include "defs.h"
-#include "alias.h"
-
-static void usage( void );
-
-static int top_dis = 0;
-static int bot_dis = 0;
-static int cur_pos_scr = 0;
-
-static void makecurrent(int cur_pos, struct onefile *cur_file, int cold);
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int i;
- int kchar;
-
- char *spooldir = SPOOLDIR;
- char *playstring = PLAYCMD;
- char *aliasfile = ALIASFILE;
- int rrtimeout = REREADTIMEOUT;
-
- setlocale( LC_ALL, "");
-
- while ((i = getopt(argc, argv, "a:d:p:t:")) != -1)
- {
- switch (i)
- {
- case 'a':
- aliasfile = optarg;
- break;
-
- case 'd':
- spooldir = optarg;
- break;
-
- case 'p':
- playstring = optarg;
- break;
-
- case 't':
- if(isdigit(*optarg))
- {
- rrtimeout = strtoul(optarg, NULL, 10);
- }
- else
- {
- usage();
- }
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(rrtimeout < 10)
- rrtimeout = 10;
-
- if((chdir(spooldir)) != 0)
- fatal("cannot change directory to spooldir %s!", spooldir);
-
- init_alias(aliasfile);
-
- init_screen();
-
- init_files(0);
-
- /* go into loop */
-
- for (;;)
- {
- fd_set set;
- struct timeval timeout;
-
- FD_ZERO(&set);
- FD_SET(STDIN_FILENO, &set);
- timeout.tv_sec = rrtimeout;
- timeout.tv_usec = 0;
-
- /* if no char is available within timeout, reread spool */
-
- if((select(STDIN_FILENO + 1, &set, NULL, NULL, &timeout)) <= 0)
- {
- reread();
- continue;
- }
-
- kchar = wgetch(main_w); /* get char */
-
- switch (kchar)
- {
- case CR:
- case LF:
-#ifdef KEY_ENTER
- case KEY_ENTER:
-#endif
- do_menu();
- break;
-
- case KEY_UP: /* up-move cursor */
- if(cur_file && cur_file->prev)
- {
- cur_file = cur_file->prev;
- cur_pos--;
- }
- break;
-
-
- case TAB:
- case KEY_DOWN: /* down-move cursor */
- if(cur_file && cur_file->next)
- {
- cur_file = cur_file->next;
- cur_pos++;
- }
- break;
-
- case KEY_HOME: /* move cursor to first dir */
- break;
-
- case KEY_LL: /* move cursor to last file */
- break;
-
- case CNTRL_D:
- do_quit(0);
- break;
-
- case CNTRL_L: /* refresh */
- touchwin(curscr);
- wrefresh(curscr);
- break;
-
- }
- makecurrent(cur_pos, cur_file, 0);
- }
-
- do_quit(0);
-
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * handle horizontal selection bar movement
- *---------------------------------------------------------------------------*/
-static void
-makecurrent(int cur_pos, struct onefile *cur_file, int cold)
-{
- static int lastpos;
- static struct onefile *lastfile;
- char buffer[256];
-
- /* un-higlight current horizontal bar */
-
- if(!cold && lastfile && cur_file)
- {
- sprintf(buffer, "%s %s %-16s %-16s %-20s %-6s%*s",
- lastfile->date, lastfile->time,
- lastfile->dstnumber, lastfile->srcnumber,
- lastfile->alias == NULL ? "-/-" : lastfile->alias,
- lastfile->seconds,
- COLS - LAST_POS - 2, "");
-
- wattroff(main_w, A_REVERSE);
- mvwprintw(main_w, lastpos, 0, "%s", buffer);
- wattroff(main_w, A_REVERSE);
- }
-
- if(cur_file == NULL)
- {
- lastpos = cur_pos_scr;
- lastfile = cur_file;
- return;
- }
-
- /* have to scroll up or down ? */
-
- if(cur_pos >= bot_dis)
- {
- /* scroll up */
-
- wscrl(main_w, 1);
-
- bot_dis++;
- top_dis++;
- cur_pos_scr = LINES-START_O-3;
- }
- else if(cur_pos < top_dis)
- {
- /* scroll down */
-
- wscrl(main_w, -1);
-
- bot_dis--;
- top_dis--;
- cur_pos_scr = 0;
- }
- else
- {
- cur_pos_scr = cur_pos - top_dis;
- }
-
- sprintf(buffer, "%s %s %-16s %-16s %-20s %-6s%*s",
- cur_file->date, cur_file->time,
- cur_file->dstnumber, cur_file->srcnumber,
- cur_file->alias == NULL ? "-/-" : cur_file->alias,
- cur_file->seconds,
- COLS - LAST_POS - 2, "");
-
- wattron(main_w, A_REVERSE);
- mvwprintw(main_w, cur_pos_scr, 0, "%s", buffer);
- wattroff(main_w, A_REVERSE);
-
- lastpos = cur_pos_scr;
- lastfile = cur_file;
-
- wrefresh(main_w);
-}
-
-/*---------------------------------------------------------------------------*
- * exit program
- *---------------------------------------------------------------------------*/
-void
-do_quit(int exitval)
-{
- move(LINES-1, 0);
- clrtoeol();
- refresh();
- endwin();
- exit(exitval);
-}
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdntel - isdn telephone answering management support utility (version %d.%d.%d)\n", VERSION, REL, STEP);
- fprintf(stderr, " usage: isdntel -a <filename> -d <directory> -p <command> -t <timeout>\n");
- fprintf(stderr, " -a <filename> use filename as alias file\n");
- fprintf(stderr, " -d <directory> use directory as spool directory\n");
- fprintf(stderr, " -p <command> specify commandline for play command\n");
- fprintf(stderr, " -t <timeout> spool directory reread timeout in seconds\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * fatal error exit
- *---------------------------------------------------------------------------*/
-void
-fatal(char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
-
- if(curses_ready)
- {
- move(LINES-1, 0);
- clrtoeol();
- refresh();
- endwin();
- }
-
- fprintf(stderr, "\nFatal error: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n\n");
-
- va_end(ap);
-
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * error printing
- *---------------------------------------------------------------------------*/
-void
-error(char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
-
- if(curses_ready)
- {
- wprintw(main_w, "ERROR: ");
- vwprintw(main_w, fmt, ap);
- wprintw(main_w, "\n");
- wrefresh(main_w);
- }
- else
- {
- fprintf(stderr, "ERROR: ");
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
- }
-
- va_end(ap);
-}
-
-/*---------------------------------------------------------------------------*
- * read files and fill display
- *---------------------------------------------------------------------------*/
-void
-init_files(int inipos)
-{
- int i;
-
- nofiles = fill_list();
-
- top_dis = 0;
- bot_dis = 0;
-
- cur_file = first;
-
- cur_pos = 0;
- cur_pos_scr = 0;
-
- if(nofiles == 0)
- return;
-
- for(i=0; (i < nofiles) && (i < (LINES-START_O-2)); i++)
- {
- mvwprintw(main_w, i, 0, "%s %s", cur_file->date, cur_file->time);
- mvwprintw(main_w, i, DST_POS, "%s", cur_file->dstnumber);
- mvwprintw(main_w, i, SRC_POS, "%s", cur_file->srcnumber);
- mvwprintw(main_w, i, ALI_POS,"%s", cur_file->alias == NULL ? "-/-" : cur_file->alias);
- mvwprintw(main_w, i, SEC_POS,"%s", cur_file->seconds);
-
- bot_dis++;
-
- if((cur_file = cur_file->next) == NULL)
- break;
- }
-
- cur_file = first;
-
- if(inipos)
- {
- for(i=0; i < inipos; i++)
- {
- if(cur_file->next != NULL)
- cur_file = cur_file->next;
- else
- break;
- }
- }
- makecurrent(cur_pos, cur_file, 1);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntelctl/Makefile b/usr.sbin/i4b/isdntelctl/Makefile
deleted file mode 100644
index 41b771e..0000000
--- a/usr.sbin/i4b/isdntelctl/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# $FreeBSD$
-
-PROG= isdntelctl
-MAN= isdntelctl.8
-SRCS= main.c
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdntelctl/isdntelctl.8 b/usr.sbin/i4b/isdntelctl/isdntelctl.8
deleted file mode 100644
index 4afaf00..0000000
--- a/usr.sbin/i4b/isdntelctl/isdntelctl.8
+++ /dev/null
@@ -1,99 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1999 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.
-.\"
-.\" $Id: isdntelctl.8,v 1.9 1999/12/13 22:11:55 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Mon Dec 13 23:06:45 1999]
-.\"
-.Dd April 21, 1999
-.Dt ISDNTELCTL 8
-.Os
-.Sh NAME
-.Nm isdntelctl
-.Nd control isdn4bsd telephone sound format conversion
-.Sh SYNOPSIS
-.Nm
-.Op Fl c
-.Op Fl g
-.Op Fl u Ar unit
-.Op Fl A
-.Op Fl U
-.Op Fl N
-.Sh DESCRIPTION
-The
-.Nm
-utility
-is part of the isdn4bsd package and is used to configure the sound format
-conversion facilities of the /dev/i4btel interfaces.
-.Pp
-The following options are available:
-.Bl -tag -width Ds
-.It Fl c
-Clear the telephone input queue.
-.It Fl g
-Get the sound format currently in use.
-.It Fl u
-Set the /dev/i4btel unit number.
-The default value is zero to access
-device /dev/i4btel0.
-.It Fl A
-Do A-law (ISDN line) -> u-law (userland) conversion.
-.It Fl U
-Do u-law (ISDN line) -> A-law (userland) conversion.
-.It Fl N
-Set sound conversion to do no format conversion.
-.El
-.Pp
-The telephony data stream comes out of the line in a bit-reversed format,
-so the
-.Xr i4btel 4
-driver does the bit-reversion process in any case.
-.Pp
-Additionally, the user can specify to do A-law to u-law, u-law to A-law
-or no conversion at all in the i4btel driver by using the
-.Nm
-utility.
-.Sh FILES
-/dev/i4btel<n>
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-isdntelctl -g
-.Ed
-.Pp
-displays the currently used sound format for device /dev/i4btel0.
-.Sh SEE ALSO
-.Xr g711conv 1 ,
-.Xr i4btel 4 ,
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8
-.Sh STANDARDS
-A-Law and u-Law are specified in ITU Recommendation G.711.
-.Sh AUTHORS
-The
-.Nm
-utility and this manpage were written by
-.An Hellmuth Michaelis Aq hm@kts.org .
diff --git a/usr.sbin/i4b/isdntelctl/main.c b/usr.sbin/i4b/isdntelctl/main.c
deleted file mode 100644
index 0e9c8ff..0000000
--- a/usr.sbin/i4b/isdntelctl/main.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * isdntelctl - i4b set telephone interface options
- * ------------------------------------------------
- *
- * $Id: main.c,v 1.12 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:54:50 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <paths.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_tel_ioctl.h>
-
-static void usage ( void );
-
-#define I4BTELDEVICE "/dev/i4btel"
-
-int opt_get = 0;
-int opt_unit = 0;
-int opt_U = 0;
-int opt_A = 0;
-int opt_C = 0;
-int opt_N = 0;
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int c;
- int ret;
- int telfd;
- char namebuffer[128];
-
- while ((c = getopt(argc, argv, "cgu:AUN")) != -1)
- {
- switch(c)
- {
- case 'c':
- opt_C = 1;
- break;
-
- case 'g':
- opt_get = 1;
- break;
-
- case 'u':
- opt_unit = atoi(optarg);
- if(opt_unit < 0 || opt_unit > 9)
- usage();
- break;
-
- case 'A':
- opt_A = 1;
- break;
-
- case 'U':
- opt_U = 1;
- break;
-
- case 'N':
- opt_N = 1;
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(opt_get == 0 && opt_N == 0 && opt_U == 0 && opt_A == 0 && opt_C == 0)
- {
- opt_get = 1;
- }
-
- if((opt_get + opt_N + opt_U + opt_A + opt_C) > 1)
- {
- usage();
- }
-
- sprintf(namebuffer,"%s%d", I4BTELDEVICE, opt_unit);
-
- if((telfd = open(namebuffer, O_RDWR)) < 0)
- {
- fprintf(stderr, "isdntelctl: cannot open %s: %s\n", namebuffer, strerror(errno));
- exit(1);
- }
-
- if(opt_get)
- {
- int format;
-
- if((ret = ioctl(telfd, I4B_TEL_GETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_GETAUDIOFMT failed: %s", strerror(errno));
- exit(1);
- }
-
- if(format == CVT_NONE)
- {
- printf("device %s does not do A-law/u-law format conversion\n", namebuffer);
- }
- else if(format == CVT_ALAW2ULAW)
- {
- printf("device %s does ISDN: A-law -> user: u-law format conversion\n", namebuffer);
- }
- else if(format == CVT_ULAW2ALAW)
- {
- printf("device %s does ISDN: u-law -> user: A-law format conversion\n", namebuffer);
- }
- else
- {
- printf("ERROR, device %s uses unknown format %d!\n", namebuffer, format);
- }
- exit(0);
- }
-
- if(opt_A)
- {
- int format = CVT_ALAW2ULAW;
-
- if((ret = ioctl(telfd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
- exit(1);
- }
- exit(0);
- }
-
- if(opt_U)
- {
- int format = CVT_ULAW2ALAW;
-
- if((ret = ioctl(telfd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
- exit(1);
- }
- exit(0);
- }
- if(opt_N)
- {
- int format = CVT_NONE;
-
- if((ret = ioctl(telfd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
- exit(1);
- }
- exit(0);
- }
- if(opt_C)
- {
- int dummy;
- if((ret = ioctl(telfd, I4B_TEL_EMPTYINPUTQUEUE, &dummy)) < 0)
- {
- fprintf(stderr, "ioctl I4B_TEL_EMPTYINPUTQUEUE failed: %s", strerror(errno));
- exit(1);
- }
- exit(0);
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdntelctl - %si4btel control, version %d.%d.%d\n", _PATH_DEV, VERSION, REL, STEP);
- fprintf(stderr, "usage: isdntelctl -c -g -u <unit> -A -N -U\n");
- fprintf(stderr, " -c clear input queue\n");
- fprintf(stderr, " -g get current settings\n");
- fprintf(stderr, " -u unit specify unit number\n");
- fprintf(stderr, " -A set conversion ISDN: A-law -> user: u-law\n");
- fprintf(stderr, " -U set conversion ISDN: u-law -> user: A-law\n");
- fprintf(stderr, " -N set conversion to no A-law/u-law conversion\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntest/Makefile b/usr.sbin/i4b/isdntest/Makefile
deleted file mode 100644
index 88b491a..0000000
--- a/usr.sbin/i4b/isdntest/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-PROG= isdntest
-MAN= isdntest.8
-SRCS= main.c
-
-install:
- @${ECHO} "isdntest is not installed automatically"
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/isdntest/isdntest.8 b/usr.sbin/i4b/isdntest/isdntest.8
deleted file mode 100644
index 243d70b..0000000
--- a/usr.sbin/i4b/isdntest/isdntest.8
+++ /dev/null
@@ -1,116 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 1999 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.
-.\"
-.\" $Id: isdntest.8,v 1.10 1999/12/13 22:11:55 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Mon Dec 13 23:07:23 1999]
-.\"
-.Dd December 10, 1999
-.Dt ISDNTEST 8
-.Os
-.Sh NAME
-.Nm isdntest
-.Nd isdn4bsd debugging and verification tool
-.Sh SYNOPSIS
-.Nm
-.Op Fl c Ar unit
-.Op Fl d Ar level
-.Op Fl i Ar number
-.Op Fl h
-.Op Fl o Ar number
-.Op Fl t Ar num
-.Op Fl w
-.Sh DESCRIPTION
-The
-.Nm
-utility is part of the isdn4bsd package and may be used as a stimulation tool
-for debugging the isdn4bsd kernel functionality.
-.Pp
-NOTE:
-The
-.Nm
-utility must be run
-.Em instead
-of the
-.Xr isdnd 8
-daemon and cannot be used while the daemon runs.
-.Pp
-The following options are available:
-.Bl -tag -width Ds
-.It Fl c
-Use controller unit number for test.
-.It Fl d
-Set the debugging level
-.It Fl h
-Use HDLC as the B channel layer 1 protocol instead of no protocol.
-.It Fl i
-Use number to verify the incoming number.
-.It Fl o
-Use number as the outgoing number to dial.
-.It Fl t
-Set number of times the test pattern on the B-channel is exchanged
-.It Fl w
-Wait for keyboard input for terminating the call.
-.El
-.Pp
-The
-.Nm
-utility is currently of not much use for end users, it is primarily a debugging
-tool for development and is part of the release in the hope, that someone
-enhances it as a real self test and setup-verification tool!
-.Pp
-The
-.Nm
-utility does almost no error checking and error recovery, so unexpected
-hangs or crashes may occur.
-.Sh FILES
-.Bl -tag -width indent
-.It Pa /dev/i4b
-.El
-.Sh EXAMPLES
-For the following example, it is assumed that a machine with isdn4bsd
-installed is connected to an S0 bus and that one of the valid MSN's (MSN = Multiple Subscriber Number
-= telephone number) on this bus is
-.Em 42 .
-The
-.Xr isdnd 8
-.Em must
-not currently running on that machine!
-Executing:
-.Bd -literal -offset indent
-isdntest -i 42 -o 42
-.Ed
-.Pp
-will setup an outgoing call from that machine to itself, connect to itself
-and disconnect after 5 seconds.
-The
-.Nm
-utility has to be finished by the user by entering Control-C.
-.Sh AUTHORS
-The
-.Nm
-utility and this manpage were written by
-.An Hellmuth Michaelis Aq hm@kts.org .
diff --git a/usr.sbin/i4b/isdntest/main.c b/usr.sbin/i4b/isdntest/main.c
deleted file mode 100644
index 08c7b89..0000000
--- a/usr.sbin/i4b/isdntest/main.c
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * main.c - i4b selftest utility
- * -----------------------------
- *
- * $Id: main.c,v 1.16 2000/03/13 16:18:38 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Sat May 13 16:50:38 2006]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_cause.h>
-
-static void kbdrdhdl ( void );
-static void isdnrdhdl (int isdnfd );
-
-void handle_connect_ind(unsigned char *ptr);
-void handle_disconnect(unsigned char *ptr);
-void handle_connect_active_ind(unsigned char *ptr);
-
-int connect_response(int isdnfd, unsigned int cdid, int response);
-int disconnect_request(int isdnfd, unsigned int cdid);
-unsigned int get_cdid(int isdnfd);
-int connect_request(int isdnfd, unsigned int cdid);
-int do_test(void);
-static void cleanup(void);
-static void usage(void);
-void setup_wrfix(int len, unsigned char *buf);
-int check_rd(int len, unsigned char *wbuf, unsigned char *rdbuf);
-
-static int isdnfd;
-char outgoingnumber[32];
-char incomingnumber[32];
-int debug_level = 0;
-
-#define I4BDEVICE "/dev/i4b"
-#define DATADEV0 "/dev/i4brbch0"
-#define DATAUNIT0 0
-#define DATADEV1 "/dev/i4brbch1"
-#define DATAUNIT1 1
-
-unsigned int out_cdid = CDID_UNUSED;
-unsigned int in_cdid = CDID_UNUSED;
-
-int waitchar = 0;
-int usehdlc = 0;
-int controller = 0;
-int dotest = 0;
-
-/*---------------------------------------------------------------------------*
- * usage display and exit
- *---------------------------------------------------------------------------*/
-static void
-usage(void)
-{
- fprintf(stderr, "\n");
- fprintf(stderr, "isdntest - i4b selftest, version %d.%d.%d\n",VERSION, REL, STEP);
- fprintf(stderr, "usage: isdntest [-c ctrl] [-d level] [-h] [-i telno] [-o telno] [-t num] [-w]\n");
- fprintf(stderr, " -c <ctrl> specify controller to use\n");
- fprintf(stderr, " -d <level> set debug level\n");
- fprintf(stderr, " -h use HDLC as Bchannel protocol\n");
- fprintf(stderr, " -i <telno> incoming telephone number\n");
- fprintf(stderr, " -o <telno> outgoing telephone number\n");
- fprintf(stderr, " -t <num> send test pattern num times\n");
- fprintf(stderr, " -w wait for keyboard entry to disconnect\n");
- fprintf(stderr, "\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * program entry
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char **argv)
-{
- int i;
- int c;
- fd_set set;
- int ret;
- char *ptr;
-
- incomingnumber[0] = '\0';
- outgoingnumber[0] = '\0';
-
- while ((c = getopt(argc, argv, "c:d:hi:o:t:w")) != -1)
- {
- switch(c)
- {
- case 'c':
- if(isdigit(*optarg))
- {
- controller = strtoul(optarg, NULL, 10);
- }
- else
- {
- fprintf(stderr, "Error: option -c requires a numeric argument!\n");
- usage();
- }
- break;
-
- case 'd':
- if(isdigit(*optarg))
- {
- debug_level = strtoul(optarg, NULL, 10);
- }
- else
- {
- fprintf(stderr, "Error: option -d requires a numeric argument!\n");
- usage();
- }
- break;
-
- case 'o':
- i = 0;
- ptr = optarg;
-
- while(*ptr)
- {
- if(isdigit(*ptr))
- {
- outgoingnumber[i++] = *ptr++;
- }
- else
- {
- fprintf(stderr, "Error: option -o requires a numeric argument!\n");
- usage();
- }
- }
- outgoingnumber[i] = '\0';
- break;
-
- case 'i':
- i = 0;
- ptr = optarg;
-
- while(*ptr)
- {
- if(isdigit(*ptr))
- {
- incomingnumber[i++] = *ptr++;
- }
- else
- {
- fprintf(stderr, "Error: option -i requires a numeric argument!\n");
- usage();
- }
- }
- incomingnumber[i] = '\0';
- break;
-
- case 'w':
- waitchar = 1;
- break;
-
- case 'h':
- usehdlc = 1;
- break;
-
- case 't':
- if(isdigit(*optarg))
- {
- dotest = strtoul(optarg, NULL, 10);
- }
- else
- {
- fprintf(stderr, "Error: option -t requires a numeric argument!\n");
- usage();
- }
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if((strlen(incomingnumber) == 0) || (strlen(outgoingnumber) == 0))
- usage();
-
- fprintf(stderr, "isdntest: accepting calls from telephone number [%s] \n", incomingnumber);
- fprintf(stderr, "isdntest: calling out telephone number [%s] \n", outgoingnumber);
-
- if((atexit(cleanup)) != 0)
- {
- fprintf(stderr, "isdntest: atexit error: %s\n", strerror(errno));
- exit(1);
- }
-
- /* open isdn device */
-
- if((isdnfd = open(I4BDEVICE, O_RDWR)) < 0)
- {
- fprintf(stderr, "\nisdntest: cannot open %s: %s\n", I4BDEVICE, strerror(errno));
- fprintf(stderr, " isdnd is probably running, to use isdntest,\n");
- fprintf(stderr, " terminate isdnd and then run isdntest again!\n");
- exit(1);
- }
-
- if((out_cdid = get_cdid(isdnfd)) == 0)
- {
- fprintf(stderr, "isdntest: error getting cdid: %s\n", strerror(errno));
- exit(1);
- }
-
- if((connect_request(isdnfd, out_cdid)) == -1)
- {
- fprintf(stderr, "isdntest: error, outgoing call failed!\n");
- exit(1);
- }
-
- for(;;)
- {
- FD_ZERO(&set);
-
- FD_SET(0, &set);
-
- FD_SET(isdnfd, &set);
-
- ret = select(isdnfd + 1, &set, NULL, NULL, NULL);
-
- if(ret > 0)
- {
- if(FD_ISSET(isdnfd, &set))
- isdnrdhdl(isdnfd);
-
- if(FD_ISSET(0, &set))
- kbdrdhdl();
- }
- else
- {
- fprintf(stderr, "isdntest: select error: %s\n", strerror(errno));
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * data from keyboard available
- *---------------------------------------------------------------------------*/
-static void
-kbdrdhdl(void)
-{
- cleanup();
- exit(2);
-}
-
-/*---------------------------------------------------------------------------*
- * data from /dev/isdn available, read and process them
- *---------------------------------------------------------------------------*/
-static void
-isdnrdhdl(int isdnfd)
-{
- static unsigned char buf[1024];
- int len;
-
- if((len = read(isdnfd, buf, 1024 - 1)) > 0)
- {
- switch (buf[0])
- {
- case MSG_CONNECT_IND:
- handle_connect_ind(&buf[0]);
- break;
-
- case MSG_CONNECT_ACTIVE_IND:
- handle_connect_active_ind(&buf[0]);
- break;
-
- case MSG_DISCONNECT_IND:
- handle_disconnect(&buf[0]);
- break;
-
- default:
- if(debug_level)
- fprintf(stderr, "isdntest: unknown message 0x%x = %c\n", buf[0], buf[0]);
- break;
- }
- }
- else
- {
- fprintf(stderr, "isdntest: read error, errno = %d, length = %d", errno, len);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * initiate an outgoing connection
- *---------------------------------------------------------------------------*/
-int
-connect_request(int isdnfd, unsigned int cdid)
-{
- msg_connect_req_t mcr;
- int ret;
-
- bzero(&mcr, sizeof(msg_connect_req_t));
-
- mcr.controller = controller;
- mcr.channel = CHAN_ANY; /* any channel */
- mcr.cdid = cdid; /* cdid from get_cdid() */
-
- if(usehdlc)
- mcr.bprot = BPROT_RHDLC;/* b channel protocol */
- else
- mcr.bprot = BPROT_NONE; /* b channel protocol */
-
- mcr.driver = BDRV_RBCH; /* raw b channel driver */
- mcr.driver_unit = DATAUNIT0; /* raw b channel driver unit */
-
- strcpy(mcr.dst_telno, outgoingnumber);
- strcpy(mcr.src_telno, incomingnumber);
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_REQ, &mcr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CONNECT_REQ failed: %s", strerror(errno));
- return(-1);
- }
- fprintf(stderr, "isdntest: calling out to telephone number [%s] \n", outgoingnumber);
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * handle setup indicator
- *---------------------------------------------------------------------------*/
-void
-handle_connect_ind(unsigned char *ptr)
-{
- msg_connect_ind_t *msi = (msg_connect_ind_t *)ptr;
-
- fprintf(stderr, "isdntest: incoming SETUP: from %s to %s\n",
- msi->src_telno,
- msi->dst_telno);
-
- fprintf(stderr, " channel %d, controller %d, bprot %d, cdid %d\n",
- msi->channel,
- msi->controller,
- msi->bprot,
- msi->header.cdid);
-
- in_cdid = msi->header.cdid;
-
- if(strcmp(msi->dst_telno, outgoingnumber))
- {
- msg_connect_resp_t msr;
- int ret;
-
- fprintf(stderr, "isdntest: ignoring incoming SETUP: my number [%s] != outgoing [%s]\n",
- msi->dst_telno, outgoingnumber);
-
- msr.cdid = in_cdid;
- msr.response = SETUP_RESP_DNTCRE;
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_RESP, &msr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CONNECT_RESP ignore failed: %s", strerror(errno));
- exit(1);
- }
-
- }
- else
- {
- msg_connect_resp_t msr;
- int ret;
-
- fprintf(stderr, "isdntest: accepting call, sending CONNECT_RESPONSE .....\n");
-
- msr.cdid = in_cdid;
- msr.response = SETUP_RESP_ACCEPT;
-
- if(usehdlc)
- msr.bprot = BPROT_RHDLC;
- else
- msr.bprot = BPROT_NONE;
-
- msr.driver = BDRV_RBCH;
- msr.driver_unit = DATAUNIT1;
-
- if((ret = ioctl(isdnfd, I4B_CONNECT_RESP, &msr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CONNECT_RESP accept failed: %s", strerror(errno));
- exit(1);
- }
- }
-}
-
-#define SLEEPTIME 5
-
-/*---------------------------------------------------------------------------*
- * handle connection active
- *---------------------------------------------------------------------------*/
-void
-handle_connect_active_ind(unsigned char *ptr)
-{
- msg_connect_active_ind_t *msi = (msg_connect_active_ind_t *)ptr;
- int i;
-
- fprintf(stderr, "isdntest: connection active, cdid %d\n", msi->header.cdid);
-
- if(out_cdid == msi->header.cdid)
- {
- if(waitchar)
- {
- fprintf(stderr, "isdntest: press any key to disconnect ...%c%c%c\n", 0x07, 0x07, 0x07);
- getchar();
- }
- else
- {
- if(dotest)
- {
- do_test();
- }
- else
- {
- fprintf(stderr, "isdntest: %d secs delay until disconnect:", SLEEPTIME);
-
- for(i=0; i < SLEEPTIME;i++)
- {
- fprintf(stderr, " .");
- sleep(1);
- }
- fprintf(stderr, "\n");
- }
- cleanup();
- exit(0);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * handle disconnect indication
- *---------------------------------------------------------------------------*/
-void
-handle_disconnect(unsigned char *ptr)
-{
- msg_disconnect_ind_t *mdi = (msg_disconnect_ind_t *)ptr;
-
- if(mdi->header.cdid == out_cdid)
- {
- fprintf(stderr, "isdntest: incoming disconnect indication, cdid %d (out_cdid), cause %d\n",
- mdi->header.cdid, mdi->cause);
-
- out_cdid = CDID_UNUSED;
- }
- else if(mdi->header.cdid == in_cdid)
- {
- fprintf(stderr, "isdntest: incoming disconnect indication, cdid %d (in_cdid), cause %d\n",
- mdi->header.cdid, mdi->cause);
- in_cdid = CDID_UNUSED;
- }
- else
- {
- fprintf(stderr, "isdntest: incoming disconnect indication, cdid %d (\?\?\?), cause %d\n",
- mdi->header.cdid, mdi->cause);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * hang up
- *---------------------------------------------------------------------------*/
-int
-disconnect_request(int isdnfd, unsigned int cdid)
-{
- msg_discon_req_t mdr;
- int ret;
-
- mdr.cdid = cdid;
- mdr.cause = (CAUSET_I4B << 8) | CAUSE_I4B_NORMAL;
-
- if((ret = ioctl(isdnfd, I4B_DISCONNECT_REQ, &mdr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_DISCONNECT_REQ failed: %s", strerror(errno));
- return(-1);
- }
- fprintf(stderr, "isdntest: sending disconnect request\n");
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * get cdid from kernel
- *---------------------------------------------------------------------------*/
-unsigned int
-get_cdid(int isdnfd)
-{
- msg_cdid_req_t mcr;
- int ret;
-
- mcr.cdid = 0;
-
- if((ret = ioctl(isdnfd, I4B_CDID_REQ, &mcr)) < 0)
- {
- fprintf(stderr, "ioctl I4B_CDID_REQ failed: %s", strerror(errno));
- return(0);
- }
- fprintf(stderr, "isdntest: got cdid %d from kernel\n", mcr.cdid);
- return(mcr.cdid);
-}
-
-/*---------------------------------------------------------------------------*
- * make shure all cdid's are inactive before leaving
- *---------------------------------------------------------------------------*/
-void cleanup(void)
-{
- int len;
- char buf[1024];
-
- if(out_cdid != CDID_UNUSED)
- {
- fprintf(stderr, "isdntest: cleanup, send disconnect req for out_cdid %d, in_cdid %d\n", out_cdid, in_cdid);
- disconnect_request(isdnfd, out_cdid);
- }
-
- while((out_cdid != CDID_UNUSED) || (in_cdid != CDID_UNUSED))
- {
- if(debug_level)
- fprintf(stderr, "isdntest: cleanup, out_cdid %d, in_cdid %d\n", out_cdid, in_cdid);
-
- if((len = read(isdnfd, buf, 1024 - 1)) > 0)
- {
- switch (buf[0])
- {
- case MSG_CONNECT_IND:
- handle_connect_ind(&buf[0]);
- break;
-
- case MSG_CONNECT_ACTIVE_IND:
- handle_connect_active_ind(&buf[0]);
- break;
-
- case MSG_DISCONNECT_IND:
- handle_disconnect(&buf[0]);
- break;
-
- default:
- if(debug_level)
- fprintf(stderr, "isdntest: unknown message 0x%x = %c\n", buf[0], buf[0]);
- break;
- }
- }
- else
- {
- fprintf(stderr, "isdntest: read error, errno = %d, length = %d", errno, len);
- }
- }
- if(debug_level)
- fprintf(stderr, "isdntest: exit cleanup, out_cdid %d, in_cdid %d\n", out_cdid, in_cdid);
-}
-
-/*---------------------------------------------------------------------------*
- * test the b-channels
- *---------------------------------------------------------------------------*/
-int do_test(void)
-{
-
-#define FPH 0x3c
-#define FPL 0x66
-
- int fd0, fd1;
- unsigned char wrbuf[2048];
- unsigned char rdbuf[2048];
- int sz;
- fd_set set;
- struct timeval timeout;
- int ret;
- int frame;
- int errcnt;
- int frm_len;
- int bytecnt = 0;
- time_t start_time;
- time_t cur_time;
- time_t run_time;
-
- if((fd0 = open(DATADEV0, O_RDWR)) == -1)
- {
- fprintf(stderr, "open of %s failed: %s", DATADEV0, strerror(errno));
- return(-1);
- }
-
- if((fd1 = open(DATADEV1, O_RDWR)) == -1)
- {
- fprintf(stderr, "open of %s failed: %s", DATADEV1, strerror(errno));
- return(-1);
- }
-
- printf("\n");
- frame = 0;
- errcnt = 0;
-
- frm_len = 2;
-
- start_time = time(NULL);
-
- printf(" frame size errors totalbytes bps elapsedtime\n");
-
- for(;dotest > 0; dotest--)
- {
- setup_wrfix(frm_len, &wrbuf[0]);
-
- frame++;
-
- bytecnt += frm_len;
-
- printf("%6d %4d", frame, frm_len);
- fflush(stdout);
-
- if((sz = write(fd0, wrbuf, frm_len)) != frm_len)
- {
- fprintf(stderr, "write (%d of %d bytes) to %s failed: %s\n", sz, frm_len, DATADEV0, strerror(errno));
- }
-
- timeout.tv_sec = 2;
- timeout.tv_usec = 0;
-
- FD_ZERO(&set);
-
- FD_SET(0, &set);
- FD_SET(fd1, &set);
-
- ret = select(fd1+1, &set, NULL, NULL, &timeout);
-
- if(ret > 0)
- {
- if(FD_ISSET(fd1, &set))
- {
- if((sz = read(fd1, rdbuf, 2048)) != frm_len)
- {
- fprintf(stderr, "read (%d bytes) from %s failed: %s\n", sz, DATADEV1, strerror(errno));
- }
-
- cur_time = time(NULL);
- run_time = difftime(cur_time, start_time);
-
- if(run_time == 0)
- run_time = 1;
-
- printf(" %6d %10d %4d %2.2d:%2.2d:%2.2d \r",
- errcnt, bytecnt,
- (int)((int)bytecnt/(int)run_time),
- (int)run_time/3600, (int)run_time/60, (int)run_time%60);
- fflush(stdout);
-
- errcnt += check_rd(frm_len, &wrbuf[0], &rdbuf[0]);
-
-#ifdef NOTDEF
- for(i=0; i<sz; i++)
- {
- printf("0x%02x ", (unsigned char)rdbuf[i]);
- }
- printf("\n");
-#endif
- }
-
- if(FD_ISSET(0, &set))
- {
- return(0);
- printf("\n\n");
- }
- }
- else
- {
- fprintf(stderr, "isdntest, do_test: select error: %s\n", strerror(errno));
- }
-
- frm_len = frm_len*2;
- if(frm_len > 2048)
- frm_len = 2;
-
- }
- printf("\n\n");
- return(0);
-}
-
-void
-setup_wrfix(int len, unsigned char *buf)
-{
- register int i;
-
- for(i=0; i<len;)
- {
- *buf = FPH;
- buf++;
- *buf = FPL;
- buf++;
- i+=2;
- }
-}
-
-int
-check_rd(int len, unsigned char *wbuf, unsigned char *rbuf)
-{
- register int i;
- int ret = 0;
-
- for(i=0; i<len; i++)
- {
- if(*wbuf != *rbuf)
- {
- fprintf(stderr, "\nERROR, byte %d, written 0x%02x, read 0x%02x\n", i, *wbuf, *rbuf);
- ret++;
- }
- wbuf++;
- rbuf++;
- }
- return(ret);
-}
-
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/1tr6.c b/usr.sbin/i4b/isdntrace/1tr6.c
deleted file mode 100644
index db2bc71..0000000
--- a/usr.sbin/i4b/isdntrace/1tr6.c
+++ /dev/null
@@ -1,756 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * 1tr6.c - print 1TR6 protocol traces
- * -----------------------------------
- *
- * $Id: 1tr6.c,v 1.6 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:55:31 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-static int p_1tr6address(char *pbuf, unsigned char buf[]);
-static int p_1tr6cause(char *pbuf, unsigned char buf[]);
-
-/*---------------------------------------------------------------------------*
- * decode the (german) national specific 1TR6 protocol
- *---------------------------------------------------------------------------*/
-void
-decode_1tr6(char *pbuf, int n, int off, unsigned char *buf, int raw)
-{
- int codeset = 0;
- int oldcodeset = 0;
- int codelock = 0;
-
- int pd;
- int len;
- int j;
- int i;
-
- if(n <= 0)
- return;
-
- *pbuf = '\0';
-
- if(raw)
- {
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"Dump:%.3d ", i+off);
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
- sprintf((pbuf+strlen(pbuf))," ");
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- }
-
- sprintf((pbuf+strlen(pbuf)), "1TR6: ");
-
- /* protocol discriminator */
-
- i = 0;
-
- pd = buf[i];
-
- switch(pd)
- {
- case 0x40:
- sprintf((pbuf+strlen(pbuf)), "pd=N0, ");
- break;
- case 0x41:
- sprintf((pbuf+strlen(pbuf)), "pd=N1, ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "pd=UNDEF (0x%02x), ",pd);
- break;
- }
-
- /* call reference */
-
- i++;
-
- len = buf[i] & 0x0f;
-
- switch(len)
- {
- case 1:
- sprintf((pbuf+strlen(pbuf)), "cr=0x%02x %s, ", (buf[i+1] & 0x7f), (buf[i+1] & 0x80) ? "(from destination)" : "(from origination)");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "cr: LEN=%d %s 0x%02x 0x%02x, ", len, (buf[i+1] & 0x80) ? "org" : "dst", (buf[i+1] & 0x7f), (buf[i+2] & 0x7f));
- break;
- }
-
- i += (len+1);
-
- /* message type */
-
- sprintf((pbuf+strlen(pbuf)), "message=");
-
- if(pd == 0x40) /* protocol discriminator N0 */
- {
- switch(buf[i])
- {
- case 0x61:
- sprintf((pbuf+strlen(pbuf)), "REGISTER INDICATION: ");
- break;
- case 0x62:
- sprintf((pbuf+strlen(pbuf)), "CANCEL INDICATION: ");
- break;
- case 0x63:
- sprintf((pbuf+strlen(pbuf)), "FACILITY STATUS: ");
- break;
- case 0x64:
- sprintf((pbuf+strlen(pbuf)), "STATUS ACKNOWLEDGE: ");
- break;
- case 0x65:
- sprintf((pbuf+strlen(pbuf)), "STATUS REJECT: ");
- break;
- case 0x66:
- sprintf((pbuf+strlen(pbuf)), "FACILITY INFORMATION: ");
- break;
- case 0x67:
- sprintf((pbuf+strlen(pbuf)), "INFORMATION ACKNOWLEDGE: ");
- break;
- case 0x68:
- sprintf((pbuf+strlen(pbuf)), "INFORMATION REJECT: ");
- break;
- case 0x75:
- sprintf((pbuf+strlen(pbuf)), "CLOSE: ");
- break;
- case 0x77:
- sprintf((pbuf+strlen(pbuf)), "CLOSE ACKNOWLEDGE: ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x40 MSG=0x%02x, ", buf[i]);
- break;
- }
- }
- else if(pd == 0x41)
- {
- switch(buf[i])
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "ESCAPE: ");
- break;
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "ALERT: ");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "CALL SENT: ");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "CONNECT: ");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "CONNECT ACKNOWLEDGE: ");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "SETUP: ");
- break;
- case 0x0d:
- sprintf((pbuf+strlen(pbuf)), "SETUP ACKNOWLEDGE: ");
- break;
-
- case 0x26:
- sprintf((pbuf+strlen(pbuf)), "RESUME: ");
- break;
- case 0x2e:
- sprintf((pbuf+strlen(pbuf)), "RESUME ACKNOWLEDGE: ");
- break;
- case 0x22:
- sprintf((pbuf+strlen(pbuf)), "RESUME REJECT: ");
- break;
- case 0x25:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND: ");
- break;
- case 0x2d:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND ACKNOWLEDGE: ");
- break;
- case 0x21:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND REJECT: ");
- break;
- case 0x20:
- sprintf((pbuf+strlen(pbuf)), "USER INFORMATION: ");
- break;
-
- case 0x40:
- sprintf((pbuf+strlen(pbuf)), "DETACH");
- break;
- case 0x45:
- sprintf((pbuf+strlen(pbuf)), "DISCONNECT: ");
- break;
- case 0x4d:
- sprintf((pbuf+strlen(pbuf)), "RELEASE: ");
- break;
- case 0x5a:
- sprintf((pbuf+strlen(pbuf)), "RELEASE ACKNOWLEDGE");
- break;
-
- case 0x6e:
- sprintf((pbuf+strlen(pbuf)), "CANCEL ACKNOWLEDGE: ");
- break;
- case 0x67:
- sprintf((pbuf+strlen(pbuf)), "CANCEL REJECT: ");
- break;
- case 0x69:
- sprintf((pbuf+strlen(pbuf)), "CONGESTION CONTROL: ");
- break;
- case 0x60:
- sprintf((pbuf+strlen(pbuf)), "FACILITY: ");
- break;
- case 0x68:
- sprintf((pbuf+strlen(pbuf)), "FACILITY ACKNOWLEDGE: ");
- break;
- case 0x66:
- sprintf((pbuf+strlen(pbuf)), "FACILITY CANCEL: ");
- break;
- case 0x64:
- sprintf((pbuf+strlen(pbuf)), "FACILITY REGISTER: ");
- break;
- case 0x65:
- sprintf((pbuf+strlen(pbuf)), "FACILITY REJECT: ");
- break;
- case 0x6d:
- sprintf((pbuf+strlen(pbuf)), "INFORMATION: ");
- break;
- case 0x6c:
- sprintf((pbuf+strlen(pbuf)), "REGISTER ACKNOWLEDGE: ");
- break;
- case 0x6f:
- sprintf((pbuf+strlen(pbuf)), "REGISTER REJECT: ");
- break;
- case 0x63:
- sprintf((pbuf+strlen(pbuf)), "STATUS: ");
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x41 MSG=0x%02x, ", buf[i]);
- break;
- }
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x%02x MSG=0x%02x, ", pd, buf[i]);
- }
-
- /* other information elements */
-
- i++;
-
- for (; i < n;)
- {
- sprintf((pbuf+strlen(pbuf)), "\n ");
-
- if(buf[i] & 0x80)
- {
- /* single octett info element */
-
- switch(buf[i] & 0x70)
- {
- case 0x00: /* reserved */
- sprintf((pbuf+strlen(pbuf)), "[reserved single octett info]");
- break;
-
- case 0x10: /* shift */
- oldcodeset = codeset;
- codeset = buf[i] & 0x07;
- if(buf[i] & 0x08)
- codelock = 0;
- else
- codelock = 1;
- sprintf((pbuf+strlen(pbuf)), "[shift: codeset=%d lock=%d]", codeset, codelock);
- break;
-
- case 0x20: /* more data */
- sprintf((pbuf+strlen(pbuf)), "[more data]");
- break;
-
- case 0x30: /* congestion level */
- sprintf((pbuf+strlen(pbuf)), "[congestion level = %d]", buf[i] & 0x0f);
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNDEF SINGLE OCTET ELEMENT 0x%02x]", buf[i]);
- break;
- }
-
- i++; /* next */
-
- }
- else
- {
- /* variable length info element */
-
- if(codeset == 0)
- {
- switch(buf[i])
- {
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "[cause: ");
- i += p_1tr6cause(pbuf, &buf[i]);
- goto next;
- break;
-
- case 0x0c:
- sprintf((pbuf+strlen(pbuf)), "[connected address: ");
- i += p_1tr6address(pbuf, &buf[i]);
- goto next;
- break;
-
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "[call identity: ");
- break;
- case 0x18:
- sprintf((pbuf+strlen(pbuf)), "[channel id: channel=");
- i += 2;
- switch(buf[i] & 0x03)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "no channel");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "B-1");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "B-2");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "any channel");
- break;
- }
- if(buf[i] & 0x08)
- sprintf((pbuf+strlen(pbuf)), " (exclusive)]");
- else
- sprintf((pbuf+strlen(pbuf)), " (preferred)]");
- i++;
- goto next;
- break;
- case 0x20:
- sprintf((pbuf+strlen(pbuf)), "[network specific facilities: ");
- i++;
- len = buf[i];
- i+=2;
- switch(buf[i])
- {
- case 1:
- sprintf((pbuf+strlen(pbuf)), "Sperre");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "AWS 1");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "AWS 2");
- break;
- case 0xe:
- sprintf((pbuf+strlen(pbuf)), "Konferenz");
- break;
- case 0xf:
- sprintf((pbuf+strlen(pbuf)), "B-Kan uebern.");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "aktvrg. ghlt. Vbdg.");
- break;
- case 0x11:
- sprintf((pbuf+strlen(pbuf)), "3er Konf");
- break;
- case 0x12:
- sprintf((pbuf+strlen(pbuf)), "1seitg D/G Wechsel");
- break;
- case 0x13:
- sprintf((pbuf+strlen(pbuf)), "2seitig D/G Wechsel");
- break;
- case 0x14:
- sprintf((pbuf+strlen(pbuf)), "Rufnr. identifiz.");
- break;
- case 0x15:
- sprintf((pbuf+strlen(pbuf)), "GBG");
- break;
- case 0x17:
- sprintf((pbuf+strlen(pbuf)), "ueberg. Ruf");
- break;
- case 0x1a:
- sprintf((pbuf+strlen(pbuf)), "um/weitergel. Ruf");
- break;
- case 0x1b:
- sprintf((pbuf+strlen(pbuf)), "unterdr. A-Rufnr.");
- break;
- case 0x1e:
- sprintf((pbuf+strlen(pbuf)), "Verbdg. deaktivieren");
- break;
- case 0x1d:
- sprintf((pbuf+strlen(pbuf)), "Verbdg. aktivieren");
- break;
- case 0x1f:
- sprintf((pbuf+strlen(pbuf)), "SPV");
- break;
- case 0x23:
- sprintf((pbuf+strlen(pbuf)), "Rueckw. 2seitg. DW");
- break;
- case 0x24:
- sprintf((pbuf+strlen(pbuf)), "Anrufumltg. priv. Netz");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "undefined");
- break;
- }
- i++;
- sprintf((pbuf+strlen(pbuf)), ", serv=%d", buf[i]);
- i++;
- sprintf((pbuf+strlen(pbuf)), ", ainfo=%d", buf[i]);
- i++;
- len-=4;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
- goto next;
- break;
- case 0x28:
- sprintf((pbuf+strlen(pbuf)), "[display: ");
- break;
- case 0x2c:
- sprintf((pbuf+strlen(pbuf)), "[keypad: ");
- break;
- case 0x6c:
- sprintf((pbuf+strlen(pbuf)), "[origination address: ");
- i += p_1tr6address(pbuf, &buf[i]);
- goto next;
- break;
- case 0x70:
- sprintf((pbuf+strlen(pbuf)), "[destination address: ");
- i += p_1tr6address(pbuf, &buf[i]);
- goto next;
- break;
- case 0x7e:
- sprintf((pbuf+strlen(pbuf)), "[user-user information: ");
- break;
- case 0x7f:
- sprintf((pbuf+strlen(pbuf)), "[reserved: ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN INFO-ELEMENT-ID");
- break;
- }
- }
- else if(codeset == 6)
- {
- switch(buf[i])
- {
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "[service ind: serv=");
- i+= 2;
- switch(buf[i])
- {
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "phone");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "a/b");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "X.21");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "fax g4");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "btx");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "64k data");
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "X.25");
- break;
- case 0x09:
- sprintf((pbuf+strlen(pbuf)), "teletex");
- break;
- case 0x0a:
- sprintf((pbuf+strlen(pbuf)), "mixed");
- break;
- case 0x0d:
- sprintf((pbuf+strlen(pbuf)), "temex");
- break;
- case 0x0e:
- sprintf((pbuf+strlen(pbuf)), "picturephone");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "btx (new)");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "videophone");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "undefined");
- break;
- }
- i++;
- sprintf((pbuf+strlen(pbuf)), ", ainfo=0x%02x]", buf[i]);
- i++;
- goto next;
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "[charging information: ");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "[date: ");
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
- goto next;
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "[facility select: ");
- break;
- case 0x06:
- sprintf((pbuf+strlen(pbuf)), "[status of facilities: ");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "[status of called party: ");
- i+=2;
- switch(buf[i])
- {
- case 1:
- sprintf((pbuf+strlen(pbuf)), "no information]");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "is being called]");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "undefined (0x%02x)]", buf[i]);
- break;
- }
- i++;
- goto next;
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "[additional tx attributes: ");
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- switch(buf[j+i] &0x70)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "no satellite link");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "one satellite link");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "two satellite links");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "three satellite links");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "undefined value");
- break;
- }
- if(buf[j+i] & 0x80)
- sprintf((pbuf+strlen(pbuf)),"(flag=req)]");
- else
- sprintf((pbuf+strlen(pbuf)),"(flag=ind)]");
- }
- i += j;
- goto next;
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN INFO-ELEMENT-ID");
- break;
- }
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "[ILLEGAL CODESET = 0x%02x", codeset);
- }
-
- i++; /* index -> length */
-
- len = buf[i];
-
- i++; /* index -> 1st param */
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += len;
-
-next:
-
- if(!codelock && (codeset != oldcodeset))
- codeset = oldcodeset;
- }
- }
- sprintf((pbuf+strlen(pbuf)),"\n");
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the cause
- *---------------------------------------------------------------------------*/
-static int
-p_1tr6cause(char *pbuf, unsigned char buf[])
-{
- int j;
- int len;
- int i = 0;
-
- i++; /* index -> length */
-
- len = buf[i];
-
- switch(len)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "%s", print_cause_1tr6(0));
- break;
- case 1:
- i++;
- sprintf((pbuf+strlen(pbuf)), "%s", print_cause_1tr6(buf[i] & 0x7f));
- break;
- case 2:
- i++;
- sprintf((pbuf+strlen(pbuf)), "%s, location: ", print_cause_1tr6(buf[i] & 0x7f));
- i++;
- switch(buf[i] & 0x0f)
- {
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "public network");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "private network");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "no information");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- break;
- default:
- i++; /* index -> length */
- len = buf[i];
- i++; /* index -> 1st param */
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
- }
- break;
- }
- i++;
- sprintf((pbuf+strlen(pbuf)),"]");
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the ISDN (telephone) number
- *---------------------------------------------------------------------------*/
-static int
-p_1tr6address(char *pbuf, unsigned char buf[])
-{
- int j;
- int len;
- int i = 0;
- int tp;
-
- i++; /* index -> length */
- len = buf[i];
- i++; /* index -> 1st param */
- tp = buf[i];
-
- i++;
- len--;
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
-
- switch((tp & 0x70) >> 4)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), " (type=unknown, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), " (type=international, ");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), " (type=national, ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), " (type=%d, ", ((tp & 0x70) >> 4));
- break;
- }
-
- switch(tp & 0x0f)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "plan=unknown)");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "plan=ISDN)");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "plan=%d)", (tp & 0x0f));
- break;
- }
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += j;
-
- return(i);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/Makefile b/usr.sbin/i4b/isdntrace/Makefile
deleted file mode 100644
index eae0919..0000000
--- a/usr.sbin/i4b/isdntrace/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-
-PROG= isdntrace
-MAN= isdntrace.8
-SRCS= q921.c q931.c q931_util.c q932_fac.c 1tr6.c trace.c \
- pcause_1tr6.c pcause_q850.c unknownl3.c
-
-.include <bsd.prog.mk>
-
diff --git a/usr.sbin/i4b/isdntrace/cable.txt b/usr.sbin/i4b/isdntrace/cable.txt
deleted file mode 100644
index 21a1cdb..0000000
--- a/usr.sbin/i4b/isdntrace/cable.txt
+++ /dev/null
@@ -1,62 +0,0 @@
- *---------------------------------------------------------------------------
- *
- * Custom cable to trace an ISDN S0 bus with two passive (!) ISDN boards
- * ---------------------------------------------------------------------
- *
- * $Id: cable.txt,v 1.4 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:55:42 1999]
- *
- * -hm documentation of analyze mode
- *
- *---------------------------------------------------------------------------*/
-
-The cable consists of a RJ-45 plug with both tx and rx connected and
-two jacks; the tx cables from the plug are wired to one jack and the
-rx cables from the plug are wired to the other jack.
-
-The computer must be equipped with two (!) supported passive cards and
-the cable from one card is plugged into one of the jacks while the cable
-to from the other card is plugged into the other jack.
-
-Now one card monitors the tx part of the S0 bus and the other card
-monitors the rx part.
-
-Which card functions as the rx side and which as the tx side can be
-specified as options to the isdntrace utility (-R and -T) which has
-to be run in analyzer mode (-a) to support this configuration.
-
-
- 1
- 2
- 3
- +--------------4 receiving-side board
- S0-bus +--|--------------5 in computer (jack for
- to analyze | | 6 cable to passive controller)
- 8 | | 7
- 7 | | 8
- transmit - 6------------|--|--+
- receive - 5------------+ | |
- receive + 4---------------+ |
- transmit + 3------------+ |
- 2 | | 1
- 1 | | 2
- plug into | | 3
- S0 bus +-----|-----------4 transmitting-side board
- +-----------5 in computer (jack for
- 6 cable to passive controller)
- 7
- 8
-
-
-
- RJ-45 plug RJ-45 jack
- view from the front view from the front
- cable goes out to the rear
-
- /--------- / ----------
- | 87654321 | | 12345678 |
- |__ __|/ |/_ /_|
- |____|/ |/___|
diff --git a/usr.sbin/i4b/isdntrace/isdntrace.8 b/usr.sbin/i4b/isdntrace/isdntrace.8
deleted file mode 100644
index 166f420..0000000
--- a/usr.sbin/i4b/isdntrace/isdntrace.8
+++ /dev/null
@@ -1,228 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2000 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.
-.\"
-.\" $Id: isdntrace.8,v 1.14 2000/02/13 15:26:52 hm Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Wed Nov 1 15:52:28 2000]
-.\"
-.Dd November 1, 2000
-.Dt ISDNTRACE 8
-.Os
-.Sh NAME
-.Nm isdntrace
-.Nd isdn4bsd ISDN protocol trace utility
-.Sh SYNOPSIS
-.Nm
-.Op Fl a
-.Op Fl b
-.Op Fl d
-.Op Fl f Ar filename
-.Op Fl h
-.Op Fl i
-.Op Fl l
-.Op Fl n Ar number
-.Op Fl o
-.Op Fl p Ar filename
-.Op Fl r
-.Op Fl u Ar number
-.Op Fl x
-.Op Fl B
-.Op Fl F
-.Op Fl P
-.Op Fl R Ar unit
-.Op Fl T Ar unit
-.Sh DESCRIPTION
-The
-.Nm
-utility is part of the isdn4bsd package and is used to provide the user with a
-mnemonic display of the layers 1, 2 and 3 protocol activities on
-the D channel and hex dump of the B channel(s) activities.
-.Pp
-Together with two passive supported cards and an easy to build cable it can
-also be used to monitor the complete traffic on a S0 bus providing S0 bus
-analyzer features.
-.Pp
-The
-.Nm
-utility is only available for passive supported cards.
-.Pp
-.Em Note
-.Pp
-All filenames, user specified or default, get a date and time stamp string
-added in the form -yyyymmdd-hhmmss: a hyphen, four digits year, two digits
-month and day, a hyphen and two digits hour, minutes and seconds.
-Tracefiles no longer get overwritten.
-In case a new filename is needed within a second, the filename-generating
-mechanism sleeps one second.
-.Pp
-In case the program is sent a USR1 signal, a new user specified or default
-filename with a new date and timestamp is generated and opened.
-.Pp
-The following options can be used:
-.Bl -tag -width Ds
-.It Fl a
-Run
-.Nm
-in analyzer mode by using two passive cards and a custom cable which can
-be build as described in the file
-.Em cable.txt
-in the isdn4bsd source distribution.
-One card acts as a receiver for the
-transmitting direction on the S0 bus while the other card acts as a receiver
-for the receiving direction on the S0 bus.
-Complete traffic monitoring is
-possible using this setup.
-.It Fl b
-switch B channel tracing on (default off).
-.It Fl d
-switch D channel tracing off (default on).
-.It Fl f
-Use
-.Ar filename
-as the name of a file into which to write tracing output (default filename is
-isdntrace<n> where n is the number of the unit to trace).
-.It Fl h
-switch display of header off (default on).
-.It Fl i
-print layer 1 (I.430) INFO signals to monitor layer 1 activity (default off).
-.It Fl l
-switch displaying of Layer 2 (Q.921) frames off (default on).
-.It Fl n
-This option takes a numeric argument specifying the minimum
-frame size in octets a frame must have to be displayed.
-(default 0)
-.It Fl o
-switch off writing trace output to a file (default on).
-.It Fl p
-Use
-.Ar filename
-as the name of a file used for the -B and -P options (default filename
-is isdntracebin<n> where n is the number of the unit to trace).
-.It Fl r
-Switch off printing a raw hexadecimal dump of the packets preceding
-the decoded protocol information (default on).
-.It Fl u
-Use
-.Ar number
-as the unit number of the controller card to trace (default 0).
-.It Fl x
-Switch on printing of packets with a non-Q.931 protocol discriminator.
-(default off).
-.It Fl B
-Write undecoded binary trace data to a file for later or remote
-analyzing (default off).
-.It Fl F
-This option can only be used when option -P (playback from binary data file)
-is used.
-The -F option causes playback not to stop at end of file but rather
-to wait for additional data to be available from the input file.
-.Pp
-This option is useful when trace data is accumulated in binary format (to
-save disk space) but a monitoring functionality is desired.
-(default off).
-.It Fl P
-Read undecoded binary trace data from file instead from device (default off).
-.It Fl R
-Use
-.Ar unit
-as the receiving interface unit number in analyze mode.
-.It Fl T
-Use
-.Ar unit
-as the transmitting interface unit number in analyze mode.
-.El
-.Pp
-When the USR1 signal is sent to a
-.Nm
-process, the currently used logfiles are reopened, so that logfile
-rotation becomes possible.
-.Pp
-The trace output should be obvious.
-It is very handy to have the following
-standard texts available when tracing ISDN protocols:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I.430
-ISDN BRI layer 1 protocol description.
-.It Ar Q.921
-ISDN D-channel layer 2 protocol description.
-.It Ar Q.931
-ISDN D-channel layer 3 protocol description.
-.It Ar 1TR6
-German-specific ISDN layer 3 protocol description.
-(NOTICE: decoding
-of the 1TR6 protocol is included but not supported since i dont have
-any longer access to a 1TR6 based ISDN installation.)
-.El
-.Pp
-The
-.Nm
-utility
-automatically detects the layer 3 protocol being used by looking at the
-Protocol Discriminator (see: Q.931/1993 pp.\& 53).
-.Sh FILES
-.Bl -tag -width daddeldi -compact
-.It Pa /dev/i4btrc<n>
-The devicefile(s) used to get the trace messages for ISDN card unit <n>
-out of the kernel.
-.El
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-isdntrace -f /var/tmp/isdn.trace
-.Ed
-.Pp
-will start D channel tracing on passive controller 0 with all except B
-channel tracing enabled and logs everything into the output file
-/var/tmp/isdn.trace-yyyymmdd-hhmmss (where yyyymmdd and hhmmss are replaced
-by the current date and time values).
-.Sh SEE ALSO
-.Xr isdnd 8
-.Sh STANDARDS
-ITU Recommendations I.430, Q.920, Q.921, Q.930, Q.931
-.Pp
-FTZ Richtlinie 1TR3, Band III
-.Pp
-ITU Recommendation Q.932 (03/93), Q.950 (03/93)
-.Pp
-ETSI Recommendation ETS 300 179 (10/92), ETS 300 180 (10/92)
-.Pp
-ETSI Recommendation ETS 300 181 (04/93), ETS 300 182 (04/93)
-.Pp
-ITU Recommendation X.208, X.209
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-utility was written by
-.An Gary Jennejohn Aq gj@FreeBSD.org
-and
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
-.Pp
-This manual page was written by
-.An Hellmuth Michaelis .
-.Sh BUGS
-Still some or more left.
diff --git a/usr.sbin/i4b/isdntrace/pcause_1tr6.c b/usr.sbin/i4b/isdntrace/pcause_1tr6.c
deleted file mode 100644
index b319d74..0000000
--- a/usr.sbin/i4b/isdntrace/pcause_1tr6.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * printing cause values
- * ---------------------
- *
- * $Id: pcause_1tr6.c,v 1.6 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:56:03 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-#include "pcause_1tr6.h"
-
-char *
-print_cause_1tr6(unsigned char code)
-{
- static char error_message[120];
- char *e;
-
- switch(code)
- {
- case CAUSE_1TR6_SHUTDN:
- e = "normal D-channel shutdown";
- break;
-
- case CAUSE_1TR6_ICRV:
- e = "invalid call reference value";
- break;
-
- case CAUSE_1TR6_BSNI:
- e = "bearer service not implemented";
- break;
-
- case CAUSE_1TR6_CIDNE:
- e = "call identity does not exist";
- break;
-
- case CAUSE_1TR6_CIIU:
- e = "call identity in use";
- break;
-
- case CAUSE_1TR6_NCA:
- e = "no channel available";
- break;
-
- case CAUSE_1TR6_RFNI:
- e = "requested facility not implemented";
- break;
-
- case CAUSE_1TR6_RFNS:
- e = "requested facility not subscribed";
- break;
-
- case CAUSE_1TR6_OCB:
- e = "outgoing calls barred";
- break;
-
- case CAUSE_1TR6_UAB:
- e = "user access busy";
- break;
-
- case CAUSE_1TR6_NECUG:
- e = "non existent CUG";
- break;
-
- case CAUSE_1TR6_NECUG1:
- e = "non existent CUG";
- break;
-
- case CAUSE_1TR6_SPV:
- e = "kommunikationsbeziehung als SPV nicht erlaubt";
- break;
-
- case CAUSE_1TR6_DNO:
- e = "destination not obtainable";
- break;
-
- case CAUSE_1TR6_NC:
- e = "number changed";
- break;
-
- case CAUSE_1TR6_OOO:
- e = "out of order";
- break;
-
- case CAUSE_1TR6_NUR:
- e = "no user responding";
- break;
-
- case CAUSE_1TR6_UB:
- e = "user busy";
- break;
-
- case CAUSE_1TR6_ICB:
- e = "incoming calls barred";
- break;
-
- case CAUSE_1TR6_CR:
- e = "call rejected";
- break;
-
- case CAUSE_1TR6_NCO:
- e = "network congestion";
- break;
-
- case CAUSE_1TR6_RUI:
- e = "remote user initiated";
- break;
-
- case CAUSE_1TR6_LPE:
- e = "local procedure error";
- break;
-
- case CAUSE_1TR6_RPE:
- e = "remote procedure error";
- break;
-
- case CAUSE_1TR6_RUS:
- e = "remote user suspended";
- break;
-
- case CAUSE_1TR6_RUR:
- e = "remote user resumed";
- break;
-
- case CAUSE_1TR6_UIDL:
- e = "user info discharded locally";
- break;
-
- default:
- e = "UNKNOWN error occured";
- break;
- }
-
- sprintf(error_message, "0x%02x: %s", code & 0x7f, e);
- return(error_message);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/pcause_1tr6.h b/usr.sbin/i4b/isdntrace/pcause_1tr6.h
deleted file mode 100644
index 67f50de..0000000
--- a/usr.sbin/i4b/isdntrace/pcause_1tr6.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcause1tr6.h - 1TR6 causes definitions
- * --------------------------------------
- *
- * $Id: pcause_1tr6.h,v 1.5 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:56:10 1999]
- *
- *---------------------------------------------------------------------------*/
-
-char *print_cause_1tr6(unsigned char code);
-
-/* 1TR6 protocol causes */
-
-#define CAUSE_1TR6_SHUTDN 0x00 /* normal D-channel shutdown */
-#define CAUSE_1TR6_ICRV 0x01 /* invalid call reference value */
-#define CAUSE_1TR6_BSNI 0x03 /* bearer service not implemented */
-#define CAUSE_1TR6_CIDNE 0x07 /* call identity does not exist */
-#define CAUSE_1TR6_CIIU 0x08 /* call identity in use */
-#define CAUSE_1TR6_NCA 0x0A /* no channel available */
-#define CAUSE_1TR6_RFNI 0x10 /* requested facility not implemented */
-#define CAUSE_1TR6_RFNS 0x11 /* requested facility not subscribed */
-#define CAUSE_1TR6_OCB 0x20 /* outgoing calls barred */
-#define CAUSE_1TR6_UAB 0x21 /* user access busy */
-#define CAUSE_1TR6_NECUG 0x22 /* non existent CUG */
-#define CAUSE_1TR6_NECUG1 0x23 /* non existent CUG */
-#define CAUSE_1TR6_SPV 0x25 /* kommunikationsbeziehung als SPV nicht erlaubt */
-#define CAUSE_1TR6_DNO 0x35 /* destination not obtainable */
-#define CAUSE_1TR6_NC 0x38 /* number changed */
-#define CAUSE_1TR6_OOO 0x39 /* out of order */
-#define CAUSE_1TR6_NUR 0x3A /* no user responding */
-#define CAUSE_1TR6_UB 0x3B /* user busy */
-#define CAUSE_1TR6_ICB 0x3D /* incoming calls barred */
-#define CAUSE_1TR6_CR 0x3E /* call rejected */
-#define CAUSE_1TR6_NCO 0x59 /* network congestion */
-#define CAUSE_1TR6_RUI 0x5A /* remote user initiated */
-#define CAUSE_1TR6_LPE 0x70 /* local procedure error */
-#define CAUSE_1TR6_RPE 0x71 /* remote procedure error */
-#define CAUSE_1TR6_RUS 0x72 /* remote user suspended */
-#define CAUSE_1TR6_RUR 0x73 /* remote user resumed */
-#define CAUSE_1TR6_UIDL 0x7F /* user info discharded locally */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/pcause_q850.c b/usr.sbin/i4b/isdntrace/pcause_q850.c
deleted file mode 100644
index 57eaf32..0000000
--- a/usr.sbin/i4b/isdntrace/pcause_q850.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * printing cause values
- * ---------------------
- *
- * $Id: pcause_q850.c,v 1.6 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:56:18 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-#include "pcause_q850.h"
-
-char *
-print_cause_q850(unsigned char code)
-{
- static char error_message[120];
- char *e;
-
- switch(code)
- {
- case CAUSE_Q850_SHUTDN:
- e = "normal D-channel shutdown";
- break;
-
- case CAUSE_Q850_NUNALLC:
- e = "Unallocated (unassigned) number";
- break;
-
- case CAUSE_Q850_NRTTN:
- e = "No route to specified transit network";
- break;
-
- case CAUSE_Q850_NRTDST:
- e = "No route to destination";
- break;
-
- case CAUSE_Q850_SSINFTN:
- e = "Send special information tone";
- break;
-
- case CAUSE_Q850_MDIALTP:
- e = "Misdialled trunk prefix";
- break;
-
- case CAUSE_Q850_CHUNACC:
- e = "Channel unacceptable";
- break;
-
- case CAUSE_Q850_CALLAWD:
- e = "Call awarded and being delivered in an established channel";
- break;
-
- case CAUSE_Q850_PREEMPT:
- e = "Preemption";
- break;
-
- case CAUSE_Q850_PREECRR:
- e = "Preemption - circuit reserved for reuse";
- break;
-
- case CAUSE_Q850_NCCLR:
- e = "Normal call clearing";
- break;
-
- case CAUSE_Q850_USRBSY:
- e = "User busy";
- break;
-
- case CAUSE_Q850_NOUSRRSP:
- e = "No user responding";
- break;
-
- case CAUSE_Q850_NOANSWR:
- e = "No answer from user (user alerted)";
- break;
-
- case CAUSE_Q850_SUBSABS:
- e = "Subscriber absent";
- break;
-
- case CAUSE_Q850_CALLREJ:
- e = "Call rejected";
- break;
-
- case CAUSE_Q850_NUCHNG:
- e = "Number changed";
- break;
-
- case CAUSE_Q850_NONSELUC:
- e = "Non-selected user clearing";
- break;
-
- case CAUSE_Q850_DSTOOORDR:
- e = "Destination out of order";
- break;
-
- case CAUSE_Q850_INVNUFMT:
- e = "Invalid number format";
- break;
-
- case CAUSE_Q850_FACREJ:
- e = "Facility rejected";
- break;
-
- case CAUSE_Q850_STENQRSP:
- e = "Response to STATUS ENQUIRY";
- break;
-
- case CAUSE_Q850_NORMUNSP:
- e = "Normal, unspecified";
- break;
-
- case CAUSE_Q850_NOCAVAIL:
- e = "No circuit / channel available";
- break;
-
- case CAUSE_Q850_NETOOORDR:
- e = "Network out of order";
- break;
-
- case CAUSE_Q850_PFMCDOOSERV:
- e = "Permanent frame mode connection out of service";
- break;
-
- case CAUSE_Q850_PFMCOPER:
- e = "Permanent frame mode connection operational";
- break;
-
- case CAUSE_Q850_TMPFAIL:
- e = "Temporary failure";
- break;
-
- case CAUSE_Q850_SWEQCONG:
- e = "Switching equipment congestion";
- break;
-
- case CAUSE_Q850_ACCINFDIS:
- e = "Access information discarded";
- break;
-
- case CAUSE_Q850_REQCNOTAV:
- e = "Requested circuit/channel not available";
- break;
-
- case CAUSE_Q850_PRECALBLK:
- e = "Precedence call blocked";
- break;
-
- case CAUSE_Q850_RESUNAVAIL:
- e = "Resources unavailable, unspecified";
- break;
-
- case CAUSE_Q850_QOSUNAVAIL:
- e = "Quality of service unavailable";
- break;
-
- case CAUSE_Q850_REQSERVNS:
- e = "Requested facility not subscribed";
- break;
-
- case CAUSE_Q850_OCBARRCUG:
- e = "Outgoing calls barred within CUG";
- break;
-
- case CAUSE_Q850_ICBARRCUG:
- e = "Incoming calls barred within CUG";
- break;
-
- case CAUSE_Q850_BCAPNAUTH:
- e = "Bearer capability not authorized";
- break;
-
- case CAUSE_Q850_BCAPNAVAIL:
- e = "Bearer capability not presently available";
- break;
-
- case CAUSE_Q850_INCSTOACISC:
- e = "Inconsistenciy in designated outg. access info and subscriber class";
- break;
-
- case CAUSE_Q850_SOONOTAVAIL:
- e = "Service or option not available, unspecified";
- break;
-
- case CAUSE_Q850_BCAPNOTIMPL:
- e = "Bearer capability not implemented";
- break;
-
- case CAUSE_Q850_CHTYPNIMPL:
- e = "Channel type not implemented";
- break;
-
- case CAUSE_Q850_REQFACNIMPL:
- e = "Requested facility not implemented";
- break;
-
- case CAUSE_Q850_ORDINBCAVL:
- e = "Only restricted digital information bearer capability is available";
- break;
-
- case CAUSE_Q850_SOONOTIMPL:
- e = "Service or option not implemented, unspecified";
- break;
-
- case CAUSE_Q850_INVCLRFVAL:
- e = "Invalid call reference value";
- break;
-
- case CAUSE_Q850_IDCHDNOEX:
- e = "Identified channel does not exist";
- break;
-
- case CAUSE_Q850_SUSCAEXIN:
- e = "A suspended call exists, but this call identity does not";
- break;
-
- case CAUSE_Q850_CLIDINUSE:
- e = "Call identity in use";
- break;
-
- case CAUSE_Q850_NOCLSUSP:
- e = "No call suspended";
- break;
-
- case CAUSE_Q850_CLIDCLRD:
- e = "Call having the requested call identity has been cleared";
- break;
-
- case CAUSE_Q850_UNOTMEMCUG:
- e = "User not member of CUG";
- break;
-
- case CAUSE_Q850_INCDEST:
- e = "Incompatible destination";
- break;
-
- case CAUSE_Q850_NONEXCUG:
- e = "Non-existent CUG";
- break;
-
- case CAUSE_Q850_INVNTWSEL:
- e = "Invalid transit network selection";
- break;
-
- case CAUSE_Q850_INVMSG:
- e = "Invalid message, unspecified";
- break;
-
- case CAUSE_Q850_MIEMISS:
- e = "Mandatory information element is missing";
- break;
-
- case CAUSE_Q850_MSGTNI:
- e = "Message type non-existent or not implemented";
- break;
-
- case CAUSE_Q850_MSGNCMPT:
- e = "Msg incompatible with call state/message type non-existent/not implemented";
- break;
-
- case CAUSE_Q850_IENENI:
- e = "Information element/parameter non-existent or not implemented";
- break;
-
- case CAUSE_Q850_INVIEC:
- e = "Invalid information element contents";
- break;
-
- case CAUSE_Q850_MSGNCWCS:
- e = "Message not compatible with call state";
- break;
-
- case CAUSE_Q850_RECOTIMEXP:
- e = "Recovery on timer expiry";
- break;
-
- case CAUSE_Q850_PARMNENIPO:
- e = "Parameter non-existent or not implemented, passed on";
- break;
-
- case CAUSE_Q850_MSGUNRDPRM:
- e = "Message with unrecognized parameter, discarded";
- break;
-
- case CAUSE_Q850_PROTERR:
- e = "Protocol error, unspecified";
- break;
-
- case CAUSE_Q850_INTWRKU:
- e = "Interworking, unspecified";
- break;
-
- default:
- e = "ERROR, unknown cause value!";
- break;
- }
-
- sprintf(error_message, "%d: %s (Q.850)", code, e);
- return(error_message);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/pcause_q850.h b/usr.sbin/i4b/isdntrace/pcause_q850.h
deleted file mode 100644
index ea21770..0000000
--- a/usr.sbin/i4b/isdntrace/pcause_q850.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1997, 1999 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.
- *
- *---------------------------------------------------------------------------
- *
- * pcauseq850.h - Q.850 causes definitions
- * ---------------------------------------
- *
- * $Id: pcause_q850.h,v 1.5 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:56:25 1999]
- *
- *---------------------------------------------------------------------------*/
-
-char *print_cause_q850(unsigned char code);
-
-/* Q.850 causes */
-
-#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 */
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/q921.c b/usr.sbin/i4b/isdntrace/q921.c
deleted file mode 100644
index e8c14dc..0000000
--- a/usr.sbin/i4b/isdntrace/q921.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright (c) 1996 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.
- *
- * 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.
- *
- *---------------------------------------------------------------------------*
- *
- * q.921.c - print Q.921 traces
- * ----------------------------
- *
- * $Id: q921.c,v 1.4 1999/12/13 21:25:26 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Dec 13 21:56:46 1999]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-/*---------------------------------------------------------------------------*
- * decode LAPD (Q.921) protocol
- *---------------------------------------------------------------------------*/
-int
-decode_lapd(char *pbuf, int n, unsigned char *buf, int dir, int raw, int printit)
-{
- int sap, tei, cmd, p_f;
- int cnt = 0;
- int i;
- char locbuf[32000];
- char *lbufp = &locbuf[0];
-
- *lbufp = '\0';
- *pbuf = '\0';
-
- sap = (buf[0] >> 2) & 0x3f;
- cnt++;
-
- tei = buf[1] >> 1;
- cnt++;
-
- if(dir == FROM_TE)
- cmd = !(buf[0] & 2);
- else
- cmd = buf[0] & 2;
-
- switch (sap)
- {
- /* SAPI control procedures */
- case 0:
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: SAP=%d (Call Control), %c, TEI=%d, ", sap, cmd?'C':'R', tei);
-
- if((buf[2] & 0x01) == 0)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "I-Frame: ");
-
- p_f = buf [3] & 1;
-
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "N(S) %d N(R) %d P %d ", buf [2] >> 1, buf [3] >> 1, p_f);
-
- cnt += 2;
- }
- else if((buf[2] & 0x03) == 0x01)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "S-Frame: ");
-
- p_f = buf [3] & 1;
- cmd = buf [2] & 0x0c;
-
- if(printit)
- {
- if (cmd == 0)
- sprintf((lbufp+strlen(lbufp)), "RR N(R) %d PF %d ", buf [3] >> 1, p_f);
- if (cmd == 4)
- sprintf((lbufp+strlen(lbufp)), "RNR N(R) %d PF %d ", buf [3] >> 1, p_f);
- if (cmd == 8)
- sprintf((lbufp+strlen(lbufp)), "REJ N(R) %d PF %d ", buf [3] >> 1, p_f);
- }
- cnt += 2;
- }
- else if((buf[2] & 0x03) == 0x03)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "U-Frame: ");
-
- p_f = (buf [2] & 0x10) >> 4;
- cmd = buf [2] & 0xec;
-
- if(printit)
- {
- if (cmd == 0x6c)
- sprintf((lbufp+strlen(lbufp)), "SABME PF %d ", p_f);
- if (cmd == 0x0c)
- sprintf((lbufp+strlen(lbufp)), "DM PF %d ", p_f);
- if (cmd == 0)
- sprintf((lbufp+strlen(lbufp)), "UI PF %d ", p_f);
- if (cmd == 0x40)
- sprintf((lbufp+strlen(lbufp)), "DISC PF %d ", p_f);
- if (cmd == 0x60)
- sprintf((lbufp+strlen(lbufp)), "UA PF %d ", p_f);
- if (cmd == 0x84)
- sprintf((lbufp+strlen(lbufp)), "FRMR PF %d ", p_f);
- if (cmd == 0xac)
- sprintf((lbufp+strlen(lbufp)), "XID PF %d ", p_f);
- /* information field ??? */
- }
- cnt++;
- }
- break;
- }
-
- /* D channel X.25 */
-
- case 16:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: SAP=%d (X.25), %c, TEI=%d, ", sap, cmd?'C':'R', tei);
- cnt = n;
- goto dump;
-
- /* Loopback test */
-
- case 32:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: SAP=%d (Loopbacktest), %c, TEI=%d, ", sap, cmd?'C':'R', tei);
- cnt = n;
- goto dump;
-
- /* SAPI layer 2 management functions */
-
- case 63:
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: SAP=%d (TEI-Management), %c, TEI=%d, ", sap, cmd?'C':'R', tei);
-
- if (tei != 127)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "ILLEGAL TEI\n");
- cnt = n;
- goto dump;
- }
-
- if (buf [2] != 3 && buf [3] != 0xf)
- {
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "invalid format!\n");
- cnt = n;
- goto dump;
- }
- cnt+= 2; /* UI + MEI */
-
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Ri=0x%04hx, ", *(short *)&buf[4]);
- cnt += 2; /* Ri */
-
- switch (buf[6])
- {
- case 1:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdRequest, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 2:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdAssign, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 3:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdDenied, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 4:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdCheckReq, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 5:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdCheckResp, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 6:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdRemove, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- case 7:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "IdVerify, Ai=%d", (buf [7] >> 1));
- cnt += 2;
- break;
- default:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Unknown Msg Type\n");
- cnt = n;
- goto dump;
- }
- break;
- }
-
- /* Illegal SAPI */
-
- default:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "Q921: ERROR, SAP=%d (Illegal SAPI), %c, TEI=%d\n", sap, cmd?'C':'R', tei);
- cnt = n;
- goto dump;
- }
-
-dump:
- if(printit)
- sprintf((lbufp+strlen(lbufp)), "\n");
-
- if(raw && printit)
- {
- int j;
- for (i = 0; i < cnt; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"Dump:%.3d ", i);
- for (j = 0; j < 16; j++)
- if (i + j < cnt)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
- sprintf((pbuf+strlen(pbuf))," ");
- for (j = 0; j < 16 && i + j < cnt; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- }
-
- sprintf((pbuf+strlen(pbuf)),"%s", &locbuf[0]);
-
- return (cnt);
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/q931.c b/usr.sbin/i4b/isdntrace/q931.c
deleted file mode 100644
index d69453e..0000000
--- a/usr.sbin/i4b/isdntrace/q931.c
+++ /dev/null
@@ -1,800 +0,0 @@
-/*
- * Copyright (c) 1997, 2001 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.
- *
- *---------------------------------------------------------------------------
- *
- * q931.c - print Q.931 traces
- * ---------------------------
- *
- * $FreeBSD$
- *
- * last edit-date: [Wed Oct 17 14:49:16 2001]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-/*---------------------------------------------------------------------------*
- * decode Q.931 protocol
- *---------------------------------------------------------------------------*/
-void
-decode_q931(char *pbuf, int n, int off, unsigned char *buf, int raw)
-{
- int codeset = 0;
- int codelock = 0;
- int oldcodeset = 0;
-
- int pd;
- int len;
- int j;
- int i;
-
- if(n <= 0)
- return;
-
- *pbuf = '\0';
-
- if(raw)
- {
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"Dump:%.3d ", i+off);
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
- sprintf((pbuf+strlen(pbuf))," ");
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- }
-
- i = 0;
-
- sprintf((pbuf+strlen(pbuf)), "Q931: ");
-
- /* protocol discriminator */
-
- pd = buf[i];
-
- if(pd >= 0x00 && pd <= 0x07)
- sprintf((pbuf+strlen(pbuf)), "pd=User-User (0x%02x)\n",pd);
- else if(pd == 0x08)
- sprintf((pbuf+strlen(pbuf)), "pd=Q.931/I.451, ");
- else if(pd >= 0x10 && pd <= 0x3f)
- sprintf((pbuf+strlen(pbuf)), "pd=Other Layer 3 or X.25 (0x%02x)\n",pd);
- else if(pd >= 0x40 && pd <= 0x4f)
- sprintf((pbuf+strlen(pbuf)), "pd=National Use (0x%02x)\n",pd);
- else if(pd >= 0x50 && pd <= 0xfe)
- sprintf((pbuf+strlen(pbuf)), "pd=Other Layer 3 or X.25 (0x%02x)\n",pd);
- else
- sprintf((pbuf+strlen(pbuf)), "pd=Reserved (0x%02x)\n",pd);
-
- /* call reference */
-
- i++;
-
- len = buf[i] & 0x0f;
-
- switch(len)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "cr=Dummy, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "cr=0x%02x %s, ", (buf[i+1] & 0x7f), (buf[i+1] & 0x80) ? "(from destination)" : "(from origination)");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "cr=0x%02x 0x%02x %s, ", (buf[i+1] & 0x7f), (buf[i+2] & 0x7f), (buf[i+1] & 0x80) ? "(org)" : "(dst)");
- break;
- }
-
- i += (len+1);
-
- /* message type */
-
- sprintf((pbuf+strlen(pbuf)), "message=");
-
- switch(buf[i])
- {
- /* escape to nationally specific message type */
-
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "ESCAPE: ");
- break;
-
- /* call establishment */
-
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "ALERTING: ");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "CALL PROCEEDING: ");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "PROGRESS: ");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "SETUP: ");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "CONNECT: ");
- break;
- case 0x0d:
- sprintf((pbuf+strlen(pbuf)), "SETUP ACKNOWLEDGE: ");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "CONNECT ACKNOWLEDGE: ");
- break;
-
- /* call information phase */
-
- case 0x20:
- sprintf((pbuf+strlen(pbuf)), "USER INFORMATION: ");
- break;
- case 0x21:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND REJECT: ");
- break;
- case 0x22:
- sprintf((pbuf+strlen(pbuf)), "RESUME REJECT: ");
- break;
- case 0x24:
- sprintf((pbuf+strlen(pbuf)), "HOLD: ");
- break;
- case 0x25:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND: ");
- break;
- case 0x26:
- sprintf((pbuf+strlen(pbuf)), "RESUME: ");
- break;
- case 0x28:
- sprintf((pbuf+strlen(pbuf)), "HOLD ACKNOWLEDGE: ");
- break;
- case 0x2d:
- sprintf((pbuf+strlen(pbuf)), "SUSPEND ACKNOWLEDGE: ");
- break;
- case 0x2e:
- sprintf((pbuf+strlen(pbuf)), "RESUME ACKNOWLEDGE: ");
- break;
- case 0x30:
- sprintf((pbuf+strlen(pbuf)), "HOLD REJECT (Q.932): ");
- break;
- case 0x31:
- sprintf((pbuf+strlen(pbuf)), "RETRIEVE (Q.932): ");
- break;
- case 0x32:
- sprintf((pbuf+strlen(pbuf)), "RETRIEVE ACKNOWLEDGE (Q.932): ");
- break;
- case 0x37:
- sprintf((pbuf+strlen(pbuf)), "RETRIEVE REJECT (Q.932): ");
- break;
-
- /* call clearing */
-
- case 0x40:
- sprintf((pbuf+strlen(pbuf)), "DETACH: ");
- break;
- case 0x45:
- sprintf((pbuf+strlen(pbuf)), "DISCONNECT: ");
- break;
- case 0x46:
- sprintf((pbuf+strlen(pbuf)), "RESTART: ");
- break;
- case 0x48:
- sprintf((pbuf+strlen(pbuf)), "DETACH ACKNOWLEDGE: ");
- break;
- case 0x4d:
- sprintf((pbuf+strlen(pbuf)), "RELEASE: ");
- break;
- case 0x4e:
- sprintf((pbuf+strlen(pbuf)), "RESTART ACKNOWLEDGE: ");
- break;
- case 0x5a:
- sprintf((pbuf+strlen(pbuf)), "RELEASE COMPLETE: ");
- break;
-
- /* misc messages */
-
- case 0x60:
- sprintf((pbuf+strlen(pbuf)), "SEGMENT: ");
- break;
- case 0x62:
- sprintf((pbuf+strlen(pbuf)), "FACILITY (Q.932): ");
- break;
- case 0x64:
- sprintf((pbuf+strlen(pbuf)), "REGISTER (Q.932): ");
- break;
- case 0x68:
- sprintf((pbuf+strlen(pbuf)), "CANCEL ACKNOWLEDGE: ");
- break;
- case 0x6a:
- sprintf((pbuf+strlen(pbuf)), "FACILITY ACKNOWLEDGE: ");
- break;
- case 0x6c:
- sprintf((pbuf+strlen(pbuf)), "REGISTER ACKNOWLEDGE: ");
- break;
- case 0x6e:
- sprintf((pbuf+strlen(pbuf)), "NOTIFY: ");
- break;
- case 0x70:
- sprintf((pbuf+strlen(pbuf)), "CANCEL REJECT: ");
- break;
- case 0x72:
- sprintf((pbuf+strlen(pbuf)), "FACILITY REJECT: ");
- break;
- case 0x74:
- sprintf((pbuf+strlen(pbuf)), "REGISTER REJECT: ");
- break;
- case 0x75:
- sprintf((pbuf+strlen(pbuf)), "STATUS ENQIRY: ");
- break;
- case 0x79:
- sprintf((pbuf+strlen(pbuf)), "CONGESTION CONTROL: ");
- break;
- case 0x7b:
- sprintf((pbuf+strlen(pbuf)), "INFORMATION: ");
- break;
- case 0x7d:
- sprintf((pbuf+strlen(pbuf)), "STATUS: ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "UNDEFINED, TYPE=0x%02x, ", buf[i]);
- break;
- }
-
- /* other information elements */
-
- i++;
-
- for (; i < n;)
- {
- sprintf((pbuf+strlen(pbuf)), "\n ");
-
- if(buf[i] & 0x80)
- {
- /* single octett info element */
-
- switch(buf[i] & 0x70)
- {
- case 0x00: /* reserved */
- sprintf((pbuf+strlen(pbuf)), "[reserved single octett info]");
- break;
-
- case 0x10: /* shift */
- oldcodeset = codeset;
- codeset = buf[i] & 0x07;
- if(buf[i] & 0x08)
- codelock = 0;
- else
- codelock = 1;
- sprintf((pbuf+strlen(pbuf)), "[shift: codeset=%d lock=%d]", codeset, codelock);
- break;
-
- case 0x20: /* more data */
- if(buf[i] & 0x01)
- sprintf((pbuf+strlen(pbuf)), "[sending complete]");
- else
- sprintf((pbuf+strlen(pbuf)), "[more data]");
- break;
-
- case 0x30: /* congestion level */
- sprintf((pbuf+strlen(pbuf)), "[congestion level=");
- switch(buf[i] & 0x0f)
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "rx-ready]");
- break;
- case 0x0f:
- sprintf((pbuf+strlen(pbuf)), "rx-not-ready]");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)]", buf[i] & 0x0f);
- break;
- }
- break;
-
- case 0x50: /* repeat ind */
- sprintf((pbuf+strlen(pbuf)), "[repeat indicator]");
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN SINGLE OCTET ELEMENT 0x%02x]", buf[i]);
- break;
- }
-
- i++; /* next */
-
- }
- else
- {
- /* variable length info element */
-
- if(codeset == 0)
- {
- switch(buf[i])
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "[segmented message: ");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "[bearer capability: ");
- i += p_q931bc(pbuf, &buf[i]);
- goto next;
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "[cause: ");
- i += p_q931cause(pbuf, &buf[i]);
- goto next;
- break;
- case 0x0c:
- sprintf((pbuf+strlen(pbuf)), "[connected address (old): ");
- break;
- case 0x0d:
- sprintf((pbuf+strlen(pbuf)), "[extended facility (Q.932: )");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "[call identity: ");
- break;
- case 0x14:
- sprintf((pbuf+strlen(pbuf)), "[call state: ");
- i++;
- len = buf[i];
- i++;
- sprintf((pbuf+strlen(pbuf)), "Std=");
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "CCITT");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "ISO/IEC");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "National");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Special");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), ", State=");
-
- switch((buf[i] & 0x3f))
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "Null");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "Call initiated");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "Overlap sending");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Outgoing call proceeding");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "Call delivered");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), "Call present");
- break;
- case 7:
- sprintf((pbuf+strlen(pbuf)), "Call received");
- break;
- case 8:
- sprintf((pbuf+strlen(pbuf)), "Connect request");
- break;
- case 9:
- sprintf((pbuf+strlen(pbuf)), "Incoming call proceeding");
- break;
- case 10:
- sprintf((pbuf+strlen(pbuf)), "Active");
- break;
- case 11:
- sprintf((pbuf+strlen(pbuf)), "Disconnect request");
- break;
- case 12:
- sprintf((pbuf+strlen(pbuf)), "Disconnect indication");
- break;
- case 15:
- sprintf((pbuf+strlen(pbuf)), "Suspend request");
- break;
- case 17:
- sprintf((pbuf+strlen(pbuf)), "Resume request");
- break;
- case 19:
- sprintf((pbuf+strlen(pbuf)), "Release request");
- break;
- case 22:
- sprintf((pbuf+strlen(pbuf)), "Call abort");
- break;
- case 25:
- sprintf((pbuf+strlen(pbuf)), "Overlap receiving");
- break;
- case 0x3d:
- sprintf((pbuf+strlen(pbuf)), "Restart request");
- break;
- case 0x3e:
- sprintf((pbuf+strlen(pbuf)), "Restart");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: undefined/reserved");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), "]");
- i++;
- goto next;
- break;
- case 0x18:
- sprintf((pbuf+strlen(pbuf)), "[channel id: channel=");
- i++;
- len = buf[i];
- i++;
- switch(buf[i] & 0x03)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "no channel");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "B-1");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "B-2");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "any channel");
- break;
- }
- if(buf[i] & 0x08)
- sprintf((pbuf+strlen(pbuf)), " (exclusive)]");
- else
- sprintf((pbuf+strlen(pbuf)), " (preferred)]");
- i++;
- goto next;
- break;
- case 0x19:
- sprintf((pbuf+strlen(pbuf)), "[data link connection id (Q.933): ");
- break;
- case 0x1c:
- i += q932_facility(pbuf, &buf[i]);
- goto next;
- break;
- case 0x1e:
- sprintf((pbuf+strlen(pbuf)), "[progress ind: ");
- i++;
- len = buf[i];
- i++;
- sprintf((pbuf+strlen(pbuf)), "Std=");
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "CCITT");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "ISO/IEC");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "National");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Local");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), ", Loc=");
-
- switch((buf[i] & 0x0f))
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "User");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "Private network serving local user");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "Public network serving local user");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Transit network");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "Public network serving remote user");
- break;
- case 5:
- sprintf((pbuf+strlen(pbuf)), "Private network serving remote user");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), "Network beyond interworking point");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: undefined/reserved");
- break;
- }
-
- i++;
-
- sprintf((pbuf+strlen(pbuf)), "\n Description: ");
-
- switch((buf[i] & 0x7f))
- {
- case 1:
- sprintf((pbuf+strlen(pbuf)), "Call is not end-to-end ISDN");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "Destination address is non-ISDN");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Origination address is non-ISDN");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "Call has returned to the ISDN");
- break;
- case 5:
- sprintf((pbuf+strlen(pbuf)), "Interworking occured, Service change");
- break;
- case 8:
- sprintf((pbuf+strlen(pbuf)), "In-band info or appropriate pattern now available");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "ERROR: undefined/reserved");
- break;
- }
- sprintf((pbuf+strlen(pbuf)), "]");
- i++;
- goto next;
- break;
- case 0x20:
- sprintf((pbuf+strlen(pbuf)), "[network specific facilities: ");
- break;
- case 0x24:
- sprintf((pbuf+strlen(pbuf)), "[terminal capabilities: ");
- break;
- case 0x27:
- sprintf((pbuf+strlen(pbuf)), "[notification indicator: ");
- i += p_q931notification(pbuf, &buf[i]);
- goto next;
- break;
- case 0x28:
- sprintf((pbuf+strlen(pbuf)), "[display: ");
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
- goto next;
- break;
- case 0x29:
- sprintf((pbuf+strlen(pbuf)), "[date/time: ");
- i++;
- len = buf[i];
- i++;
- j = 0;
- sprintf((pbuf+strlen(pbuf)),"%.2d.%.2d.%.2d",
- buf[i+2], buf[i+1], buf[i]);
- j+=3;
- if(j < len)
- {
- sprintf((pbuf+strlen(pbuf))," %.2d", buf[i+3]);
- j++;
- }
- if(j < len)
- {
- sprintf((pbuf+strlen(pbuf)),":%.2d", buf[i+4]);
- j++;
- }
- if(j < len)
- {
- sprintf((pbuf+strlen(pbuf)),":%.2d", buf[i+5]);
- j++;
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += len;
- goto next;
- break;
- case 0x2c:
- sprintf((pbuf+strlen(pbuf)), "[keypad: ");
- i++;
- len = buf[i];
- i++;
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
- goto next;
- break;
- case 0x30:
- sprintf((pbuf+strlen(pbuf)), "[keypad echo: ");
- break;
- case 0x32:
- sprintf((pbuf+strlen(pbuf)), "[information req (Q.932): ");
- break;
- case 0x34:
- sprintf((pbuf+strlen(pbuf)), "[signal: ");
- break;
- case 0x36:
- sprintf((pbuf+strlen(pbuf)), "[switchhook: ");
- break;
- case 0x38:
- sprintf((pbuf+strlen(pbuf)), "[feature activation (Q.932): ");
- break;
- case 0x39:
- sprintf((pbuf+strlen(pbuf)), "[feature ind (Q.932): ");
- break;
- case 0x3a:
- sprintf((pbuf+strlen(pbuf)), "[service profile id (Q.932): ");
- break;
- case 0x3b:
- sprintf((pbuf+strlen(pbuf)), "[endpoint id (Q.932): ");
- break;
- case 0x40:
- sprintf((pbuf+strlen(pbuf)), "[information rate: ");
- break;
- case 0x41:
- sprintf((pbuf+strlen(pbuf)), "[precedence level (Q.955): ");
- break;
- case 0x42:
- sprintf((pbuf+strlen(pbuf)), "[end-to-end transit delay: ");
- break;
- case 0x43:
- sprintf((pbuf+strlen(pbuf)), "[transit delay detection and indication: ");
- break;
- case 0x44:
- sprintf((pbuf+strlen(pbuf)), "[packet layer binary parameters: ");
- break;
- case 0x45:
- sprintf((pbuf+strlen(pbuf)), "[packet layer window size: ");
- break;
- case 0x46:
- sprintf((pbuf+strlen(pbuf)), "[packet size: ");
- break;
- case 0x47:
- sprintf((pbuf+strlen(pbuf)), "[closed user group: ");
- break;
- case 0x48:
- sprintf((pbuf+strlen(pbuf)), "[link layer core parameters (Q.933): ");
- break;
- case 0x49:
- sprintf((pbuf+strlen(pbuf)), "[link layer protocol parameters (Q.933): ");
- break;
- case 0x4a:
- sprintf((pbuf+strlen(pbuf)), "[reverse charging information: ");
- break;
- case 0x4c:
- sprintf((pbuf+strlen(pbuf)), "[connected number (Q.951): ");
- i += p_q931address(pbuf, &buf[i]);
- goto next;
- break;
-
- break;
- case 0x4d:
- sprintf((pbuf+strlen(pbuf)), "[connected subaddress (Q.951): ");
- break;
- case 0x50:
- sprintf((pbuf+strlen(pbuf)), "[X.213 priority (Q.933): ");
- break;
- case 0x51:
- sprintf((pbuf+strlen(pbuf)), "[report type (Q.933): ");
- break;
- case 0x53:
- sprintf((pbuf+strlen(pbuf)), "[link integrity verification (Q.933): ");
- break;
- case 0x57:
- sprintf((pbuf+strlen(pbuf)), "[PVC status (Q.933): ");
- break;
- case 0x6c:
- sprintf((pbuf+strlen(pbuf)), "[calling party number: ");
- i += p_q931address(pbuf, &buf[i]);
- goto next;
- break;
- case 0x6d:
- sprintf((pbuf+strlen(pbuf)), "[calling party subaddress: ");
- break;
- case 0x70:
- sprintf((pbuf+strlen(pbuf)), "[called party number: ");
- i += p_q931address(pbuf, &buf[i]);
- goto next;
- break;
- case 0x71:
- sprintf((pbuf+strlen(pbuf)), "[called party subaddress: ");
- break;
- case 0x74:
- sprintf((pbuf+strlen(pbuf)), "[redirecting number: ");
- i += p_q931redir(pbuf, &buf[i]);
- goto next;
- break;
- case 0x76:
- sprintf((pbuf+strlen(pbuf)), "[redirection number: ");
- i += p_q931redir(pbuf, &buf[i]);
- goto next;
- break;
- case 0x78:
- sprintf((pbuf+strlen(pbuf)), "[transit network selection: ");
- break;
- case 0x79:
- sprintf((pbuf+strlen(pbuf)), "[restart indicator: ");
- break;
- case 0x7c:
- sprintf((pbuf+strlen(pbuf)), "[low layer compatibility: ");
- break;
- case 0x7d:
- sprintf((pbuf+strlen(pbuf)), "[high layer compatibility:");
- i += p_q931high_compat(pbuf, &buf[i]);
- goto next;
- break;
- case 0x7e:
- sprintf((pbuf+strlen(pbuf)), "[user-user: ");
- i += p_q931user_user(pbuf, &buf[i]);
- goto next;
- break;
- case 0x7f:
- sprintf((pbuf+strlen(pbuf)), "[escape for extension: ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN INFO-ELEMENT-ID=0x%02x: ", buf[i]);
- break;
- }
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "[UNKNOWN CODESET=%d, IE=0x%02x: ", codeset, buf[i]);
- }
-
- i++; /* index -> length */
-
- len = buf[i];
-
- sprintf((pbuf+strlen(pbuf)), "LEN=0x%02x, DATA=", len);
-
- i++; /* index -> 1st param */
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"0x%02x ", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += len;
-
-next:
-
- if(!codelock && (codeset != oldcodeset))
- codeset = oldcodeset;
- }
- }
- sprintf((pbuf+strlen(pbuf)),"\n");
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdntrace/q931_util.c b/usr.sbin/i4b/isdntrace/q931_util.c
deleted file mode 100644
index 9f82283..0000000
--- a/usr.sbin/i4b/isdntrace/q931_util.c
+++ /dev/null
@@ -1,1047 +0,0 @@
-/*
- * Copyright (c) 1997, 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * q931_util.c - utility functions to print Q.931 traces
- * -----------------------------------------------------
- *
- * $Id: q931_util.c,v 1.11 2000/02/15 12:48:14 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Tue Feb 15 13:52:09 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-/*---------------------------------------------------------------------------*
- * decode and print the cause
- *---------------------------------------------------------------------------*/
-int
-p_q931cause(char *pbuf, unsigned char *buf)
-{
- int j;
- int len;
- int i = 0;
- int ls;
- int r = 0;
- int rflag = 0;
-
- i++; /* index -> length */
-
- len = buf[i];
-
- i++; /* coding/location */
- len--;
-
- ls = buf[i];
-
- i++;
- len--;
-
- if(!(buf[i-1] & 0x80))
- {
- r = buf[i];
- rflag = 1;
- i++;
- len--;
- }
-
- sprintf((pbuf+strlen(pbuf)), "%s ", print_cause_q850(buf[i] & 0x7f));
-
- sprintf((pbuf+strlen(pbuf)), "\n (location=");
-
- switch(ls & 0x0f)
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "user");
- break;
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "private network serving local user");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "public network serving local user");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "transit network");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "public network serving remote user");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "private network serving remote user");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "international network");
- break;
- case 0x0a:
- sprintf((pbuf+strlen(pbuf)), "network beyond interworking point");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", ls & 0x0f);
- break;
- }
-
- sprintf((pbuf+strlen(pbuf)), ", std=");
-
- switch((ls & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "CCITT");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "ISO/IEC");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "National");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "Local");
- break;
- }
-
- if(rflag)
- {
- sprintf((pbuf+strlen(pbuf)), ", rec=");
-
- switch(r & 0x7f)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "Q.931");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "X.21");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "X.25");
- break;
- case 5:
- sprintf((pbuf+strlen(pbuf)), "Q.1031/Q.1051");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "Reserved");
- break;
- }
- }
-
- sprintf((pbuf+strlen(pbuf)),")");
-
- i++;
- len--;
-
- for(j = 0; j < len; j++)
- sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
-
- sprintf((pbuf+strlen(pbuf)),"]");
-
- i += (len+1);
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the bearer capability
- *---------------------------------------------------------------------------*/
-int
-p_q931bc(char *pbuf, unsigned char *buf)
-{
- int len;
- int i = 0;
- int mr = 0;
-
- i++; /* index -> length */
-
- len = buf[i];
-
- i++;
-
- sprintf((pbuf+strlen(pbuf)), "\n cap=");
-
- switch(buf[i] & 0x1f)
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "speech");
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "unrestricted digital information");
- break;
- case 0x09:
- sprintf((pbuf+strlen(pbuf)), "restricted digital information");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "3.1 kHz audio");
- break;
- case 0x11:
- sprintf((pbuf+strlen(pbuf)), "unrestricted digital information with tones");
- break;
- case 0x18:
- sprintf((pbuf+strlen(pbuf)), "video");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
-
- sprintf((pbuf+strlen(pbuf)), "\n std=");
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "CCITT");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "ISO/IEC");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "National");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "NSI Std");
- break;
- }
-
- i++;
- len--;
-
- sprintf((pbuf+strlen(pbuf)), "\n rate=");
-
- switch(buf[i] & 0x1f)
- {
- case 0x00:
- sprintf((pbuf+strlen(pbuf)), "packet mode");
- break;
- case 0x10:
- sprintf((pbuf+strlen(pbuf)), "64 kbit/s");
- break;
- case 0x11:
- sprintf((pbuf+strlen(pbuf)), "2 x 64 kbit/s");
- break;
- case 0x13:
- sprintf((pbuf+strlen(pbuf)), "384 kbit/s");
- break;
- case 0x15:
- sprintf((pbuf+strlen(pbuf)), "1536 kbit/s");
- break;
- case 0x17:
- sprintf((pbuf+strlen(pbuf)), "1920 kbit/s");
- break;
- case 0x18:
- sprintf((pbuf+strlen(pbuf)), "Multirate");
- mr = 1;
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
-
- sprintf((pbuf+strlen(pbuf)), "\n mode=");
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "circuit");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "packet");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", ((buf[i] & 0x60) >> 5));
- break;
- }
-
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- if(mr)
- {
- sprintf((pbuf+strlen(pbuf)), "\n rate multiplier=%d", buf[i] & 0x7f);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- sprintf((pbuf+strlen(pbuf)), "\n layer1=");
-
- switch(buf[i] & 0x1f)
- {
- case 0x01:
- sprintf((pbuf+strlen(pbuf)), "V.110");
- break;
- case 0x02:
- sprintf((pbuf+strlen(pbuf)), "G.711 u-law");
- break;
- case 0x03:
- sprintf((pbuf+strlen(pbuf)), "G.711 A-law");
- break;
- case 0x04:
- sprintf((pbuf+strlen(pbuf)), "G.721");
- break;
- case 0x05:
- sprintf((pbuf+strlen(pbuf)), "H.221/H.242");
- break;
- case 0x07:
- sprintf((pbuf+strlen(pbuf)), "Non-Std");
- break;
- case 0x08:
- sprintf((pbuf+strlen(pbuf)), "V.120");
- break;
- case 0x09:
- sprintf((pbuf+strlen(pbuf)), "X.31");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
- break;
- }
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n user rate=0x%02x ", buf[i] & 0x1f);
-
- if(buf[i] & 0x40)
- sprintf((pbuf+strlen(pbuf)), "(async,");
- else
- sprintf((pbuf+strlen(pbuf)), "(sync,");
-
- if(buf[i] & 0x20)
- sprintf((pbuf+strlen(pbuf)), "in-band neg. possible)");
- else
- sprintf((pbuf+strlen(pbuf)), "in-band neg not possible)");
-
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n clk/flow=0x%02x", buf[i] & 0x1f);
-
- sprintf((pbuf+strlen(pbuf)), "\n intermediate rate=");
-
- switch((buf[i] & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "not used");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "8 kbit/s");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "16 kbit/s");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "32 kbit/s");
- break;
- }
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n hdr/mfrm/etc.=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n stop/data/parity=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- if(!(buf[i-1] & 0x80))
- {
- sprintf((pbuf+strlen(pbuf)), "\n modemtype=0x%02x", buf[i]);
- i++;
- len--;
- }
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x7f)
- {
- case 0x42:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=Q.921/I.441");
- break;
- case 0x46:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=X.25 link");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\n layer2=0x%02x",(buf[i] & 0x7f));
- break;
- }
- i++;
- len--;
-
- if(!len)
- goto exit;
-
- switch(buf[i] & 0x7f)
- {
- case 0x62:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=Q.921/I.441");
- break;
- case 0x66:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=X.25 packet");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\n layer3=0x%02x",(buf[i] & 0x7f));
- break;
- }
- i++;
- len--;
-
-exit:
- sprintf((pbuf+strlen(pbuf)), "]");
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print the ISDN (telephone) number
- *---------------------------------------------------------------------------*/
-int
-p_q931address(char *pbuf, unsigned char *buf)
-{
- int j;
- int len;
- int i = 0;
- int tp;
- int ind = 0;
- int indflag = 0;
-
- i++; /* index -> length */
- len = buf[i];
-
- i++; /* index -> type/plan */
- tp = buf[i];
-
- i++;
- len--;
-
- if(!(tp & 0x80))
- {
- ind = buf[i];
- indflag = 1;
- i++;
- len--;
- }
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
-
- switch((tp & 0x70) >> 4)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), " (type=unknown, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), " (type=international, ");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), " (type=national, ");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), " (type=network specific, ");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), " (type=subscriber, ");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), " (type=abbreviated, ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), " (type=reserved (%d), ", ((tp & 0x70) >> 4));
- break;
- }
-
- switch(tp & 0x0f)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "plan=unknown");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "plan=ISDN");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "plan=Data");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "plan=Telex");
- break;
- case 8:
- sprintf((pbuf+strlen(pbuf)), "plan=National");
- break;
- case 9:
- sprintf((pbuf+strlen(pbuf)), "plan=private");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "plan=reserved (%d)", (tp & 0x0f));
- break;
- }
-
- if(indflag)
- {
- sprintf((pbuf+strlen(pbuf)), ",\n ");
- switch((ind & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "presentation allowed, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "presentation restricted, ");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "number not available, ");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "reserved, ");
- break;
- }
-
- switch(ind & 0x03)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "screening user provided: not screened");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "screening user provided: verified & passed");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "screening user provided: verified & failed");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "screening network provided");
- break;
- }
- }
-
- sprintf((pbuf+strlen(pbuf)),")]");
-
- i += j;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print HL comatibility
- *---------------------------------------------------------------------------*/
-int
-p_q931high_compat(char *pbuf, unsigned char *buf)
-{
- int len = buf[1];
-
- sprintf(pbuf+strlen(pbuf), " standard=");
-
- switch ((buf[2] >> 5) & 0x03)
- {
- case 0: sprintf(pbuf+strlen(pbuf), "CCITT");
- break;
- case 1: sprintf(pbuf+strlen(pbuf), "unknown international standard");
- break;
- case 2: sprintf(pbuf+strlen(pbuf), "unknown national standard");
- break;
- case 3: sprintf(pbuf+strlen(pbuf), "local network standard");
- }
-
- len--;
-
- sprintf(pbuf+strlen(pbuf), ", characteristics=");
-
- switch (buf[3] & 0x7f)
- {
- case 0x01:
- sprintf(pbuf+strlen(pbuf), "Telephony");
- break;
- case 0x04:
- sprintf(pbuf+strlen(pbuf), "Fax Group 2/3");
- break;
- case 0x21:
- sprintf(pbuf+strlen(pbuf), "Fax Group 4 Class I (F.184)");
- break;
- case 0x24:
- sprintf(pbuf+strlen(pbuf), "Teletex basic/mixed (F.230) or Fax Group 4 Class II/III (F.184)");
- break;
- case 0x28:
- sprintf(pbuf+strlen(pbuf), "Teletex basic/processable (F.220)");
- break;
- case 0x31:
- sprintf(pbuf+strlen(pbuf), "Teletex basic mode (F.200)");
- break;
- case 0x32:
- sprintf(pbuf+strlen(pbuf), "Videotex (F.300 and T.101)");
- break;
- case 0x35:
- sprintf(pbuf+strlen(pbuf), "Telex (F.60)");
- break;
- case 0x38:
- sprintf(pbuf+strlen(pbuf), "MHS (X.400 series)");
- break;
- case 0x41:
- sprintf(pbuf+strlen(pbuf), "OSI application (X.200 series)");
- break;
- case 0x5e:
- sprintf(pbuf+strlen(pbuf), "Maintenance");
- break;
- case 0x5f:
- sprintf(pbuf+strlen(pbuf), "Management");
- break;
- case 0x7f:
- sprintf(pbuf+strlen(pbuf), "reserved");
- break;
- default:
- sprintf(pbuf+strlen(pbuf), "UNKNOWN (0x%02x)", buf[3]);
- break;
- }
-
- len--;
-
- if (!len)
- {
- sprintf(pbuf+strlen(pbuf), "]");
- return 4;
- }
-
- sprintf(pbuf+strlen(pbuf), " of ");
-
- switch (buf[4] & 0x7f)
- {
- case 0x01:
- sprintf(pbuf+strlen(pbuf), "Telephony");
- break;
- case 0x04:
- sprintf(pbuf+strlen(pbuf), "Fax Group 2/3");
- break;
- case 0x21:
- sprintf(pbuf+strlen(pbuf), "Fax Group 4 Class I (F.184)");
- break;
- case 0x24:
- sprintf(pbuf+strlen(pbuf), "Teletex basic/mixed (F.230) or Fax Group 4 Class II/III (F.184)");
- break;
- case 0x28:
- sprintf(pbuf+strlen(pbuf), "Teletex basic/processable (F.220)");
- break;
- case 0x31:
- sprintf(pbuf+strlen(pbuf), "Teletex basic mode (F.200)");
- break;
- case 0x32:
- sprintf(pbuf+strlen(pbuf), "Videotex (F.300 and T.101)");
- break;
- case 0x35:
- sprintf(pbuf+strlen(pbuf), "Telex (F.60)");
- break;
- case 0x38:
- sprintf(pbuf+strlen(pbuf), "MHS (X.400 series)");
- break;
- case 0x41:
- sprintf(pbuf+strlen(pbuf), "OSI application (X.200 series)");
- break;
- case 0x7f:
- sprintf(pbuf+strlen(pbuf), "reserved");
- break;
- default:
- sprintf(pbuf+strlen(pbuf), "UNKNOWN (0x%02x)", buf[3]);
- break;
- }
- sprintf(pbuf+strlen(pbuf), "]");
- return 5;
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print user-user IE
- *---------------------------------------------------------------------------*/
-int
-p_q931user_user(char *pbuf, unsigned char *buf)
-{
- int j;
- int len;
- int i = 0;
- int pd;
-
- i++; /* index -> length */
- len = buf[i];
-
- i++; /* index -> protocoldiscriminator */
- pd = buf[i];
-
- switch(pd)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "(pd=user-specific");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "(pd=OSI high-layer protocols");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "(pd=X.244");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "(pd=reserved for system management");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "(pd=IA5 characters");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), "(pd=X.208/X.209 coded user info");
- break;
- case 7:
- sprintf((pbuf+strlen(pbuf)), "(pd=V.120 rate adaption");
- break;
- case 8:
- sprintf((pbuf+strlen(pbuf)), "(pd=Q.931/I.451 user network call control messages");
- break;
- default:
- if(pd >= 0x10 && pd <= 0x3f)
- sprintf((pbuf+strlen(pbuf)), "(pd=0x%x=reserved for other L3 protocols incl. X.25", pd);
- else if(pd >= 0x40 && pd <= 0x47)
- sprintf((pbuf+strlen(pbuf)), "(pd=0x%x=national use", pd);
- else if(pd >= 0x48 && pd <= 0x4f)
- sprintf((pbuf+strlen(pbuf)), "(pd=0x%x=reserved for ETSI", pd);
- else if(pd >= 0x50 && pd <= 0xfe)
- sprintf((pbuf+strlen(pbuf)), "(pd=0x%x=reserved for other L3 protocols incl. X.25", pd);
- else
- sprintf((pbuf+strlen(pbuf)), "(pd=0x%x=reserved", pd);
- break;
- }
-
- i++;
- len--;
-
- sprintf((pbuf+strlen(pbuf)),": (");
-
- for(j = 0; j < len; j++)
- {
- if(pd == 4)
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- else
- sprintf((pbuf+strlen(pbuf)),"0x%2x", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),"))]");
-
- i += j;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and notification indicator IE (Q.932, p44)
- *---------------------------------------------------------------------------*/
-int
-p_q931notification(char *pbuf, unsigned char *buf)
-{
- int j = 0;
- int len;
- int i = 0;
- int nd;
-
- i++; /* index -> length */
- len = buf[i];
-
- i++; /* index -> notification description */
- nd = buf[i];
-
- switch(nd)
- {
- case 0x80:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, user suspended", nd);
- break;
- case 0x81:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, user resumed", nd);
- break;
- case 0x82:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, bearer service changed", nd);
- break;
-
- case 0x83:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, BER coded information", nd);
- break;
-
- case 0xc2:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, conference established", nd);
- break;
- case 0xc3:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, conference disconnected", nd);
- break;
- case 0xc4:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, other party added", nd);
- break;
- case 0xc5:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, isolated", nd);
- break;
- case 0xc6:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, reattached", nd);
- break;
- case 0xc7:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, other party isolated", nd);
- break;
- case 0xc8:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, other party reattached", nd);
- break;
- case 0xc9:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, other party split", nd);
- break;
- case 0xca:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, other party disconnected", nd);
- break;
- case 0xcb:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, conference floating", nd);
- break;
- case 0xcc:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, conference disconnected, preemption", nd);
- break;
- case 0xcf:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, conference floating, server user preempted", nd);
- break;
-
- case 0xe0:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, call is a waiting call", nd);
- break;
- case 0xe8:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, diversion activated", nd);
- break;
- case 0xe9: /* ECT, EN 300 369-1 V1.2.4 p12) */
- sprintf((pbuf+strlen(pbuf)), "0x%2x, call transferred, alerting", nd);
- break;
- case 0xea: /* ECT, EN 300 369-1 V1.2.4 p12) */
- sprintf((pbuf+strlen(pbuf)), "0x%2x, call transferred, active", nd);
- break;
- case 0xee:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, reverse charging", nd);
- break;
-
- case 0xf9:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, remote hold", nd);
- break;
- case 0xfa:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, remote retrieval", nd);
- break;
- case 0xfb:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, call is diverting", nd);
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "0x%2x, undefined", nd);
- break;
- }
-
- i++;
- len--;
-
- if(len)
- {
- sprintf((pbuf+strlen(pbuf)),": (");
-
- for(; j < len; j++)
- {
- if(nd == 4)
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- else
- sprintf((pbuf+strlen(pbuf)),"0x%2x", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),")");
- }
- sprintf((pbuf+strlen(pbuf)),"]");
- i += j;
-
- return(i);
-}
-
-/*---------------------------------------------------------------------------*
- * decode and print redirecting/redirection number
- *---------------------------------------------------------------------------*/
-int
-p_q931redir(char *pbuf, unsigned char *buf)
-{
- int j;
- int len;
- int i = 0;
- int tp;
- int ind = 0;
- int indflag = 0;
- int reas = 0;
- int reasflag = 0;
-
- i++; /* index -> length */
- len = buf[i];
-
- i++; /* index -> type/plan */
- tp = buf[i];
-
- i++;
- len--;
-
- if(!(tp & 0x80))
- {
- ind = buf[i];
- indflag = 1;
- i++;
- len--;
-
- if(!(ind & 0x80))
- {
- reas = buf[i];
- reasflag = 1;
- i++;
- len--;
- }
- }
-
- for(j = 0; j < len; j++)
- {
- sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
- }
-
- switch((tp & 0x70) >> 4)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), " (type=unknown, ");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), " (type=international, ");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), " (type=national, ");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), " (type=network specific, ");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), " (type=subscriber, ");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), " (type=abbreviated, ");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), " (type=reserved (%d), ", ((tp & 0x70) >> 4));
- break;
- }
-
- switch(tp & 0x0f)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "plan=unknown");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "plan=ISDN");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "plan=Data");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "plan=Telex");
- break;
- case 8:
- sprintf((pbuf+strlen(pbuf)), "plan=National");
- break;
- case 9:
- sprintf((pbuf+strlen(pbuf)), "plan=private");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "plan=reserved (%d)", (tp & 0x0f));
- break;
- }
-
- if(indflag)
- {
- sprintf((pbuf+strlen(pbuf)), ",\n ");
- switch((ind & 0x60) >> 5)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "presentation allowed");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "presentation restricted");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "number not available");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "reserved");
- break;
- }
- }
-
- if(reasflag)
- {
- sprintf((pbuf+strlen(pbuf)), ",\n ");
- switch(reas & 0x0f)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "reason for diversion: unknown");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "reason for diversion: call forwarding busy");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "reason for diversion: call forwarding unconditional");
- break;
- case 0xa:
- sprintf((pbuf+strlen(pbuf)), "reason for diversion: called DTE");
- break;
- case 0xf:
- sprintf((pbuf+strlen(pbuf)), "reason for diversion: call forwarding unconditional");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "reason for diversion: reserved (0x%2x)",reas & 0x0f);
- break;
- }
- }
-
- sprintf((pbuf+strlen(pbuf)),")]");
-
- i += j;
-
- return(i);
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdntrace/q932_fac.c b/usr.sbin/i4b/isdntrace/q932_fac.c
deleted file mode 100644
index 0a0099d..0000000
--- a/usr.sbin/i4b/isdntrace/q932_fac.c
+++ /dev/null
@@ -1,1236 +0,0 @@
-/*
- * Copyright (c) 1997, 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * q932_fac.c - decode Q.932 facilities
- * ------------------------------------
- *
- * $Id: q932_fac.c,v 1.8 2000/02/24 16:32:46 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Thu Feb 24 17:36:47 2000]
- *
- *---------------------------------------------------------------------------
- *
- * - 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 !)
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-#include "q932_fac.h"
-
-static int do_component(int length, char *pbuf);
-static char *uni_str(int code);
-static char *opval_str(int val);
-static char *bid_str(int val);
-static void next_state(char *pbuf, int class, int form, int code, int val);
-
-static void object_id(int comp_length, unsigned char *pbuf);
-
-static int byte_len;
-static unsigned char *byte_buf;
-static int state;
-
-/*---------------------------------------------------------------------------*
- * decode Q.931/Q.932 facility info element
- *---------------------------------------------------------------------------*/
-int
-q932_facility(char *pbuf, unsigned char *buf)
-{
- int len;
-
- sprintf((pbuf+strlen(pbuf)), "[facility (Q.932): ");
-
- buf++; /* length */
-
- len = *buf;
-
- buf++; /* protocol profile */
-
- sprintf((pbuf+strlen(pbuf)), "Protocol=");
-
- switch(*buf & 0x1f)
- {
- case FAC_PROTO_ROP:
- sprintf((pbuf+strlen(pbuf)), "Remote Operations Protocol\n");
- break;
-
- case FAC_PROTO_CMIP:
- sprintf((pbuf+strlen(pbuf)), "CMIP Protocol (Q.941), UNSUPPORTED!\n");
- return(len+2);
- break;
-
- case FAC_PROTO_ACSE:
- sprintf((pbuf+strlen(pbuf)), "ACSE Protocol (X.217/X.227), UNSUPPORTED!\n");
- return(len+2);
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)), "Unknown Protocol (val = 0x%x), UNSUPPORTED!\n", *buf & 0x1f);
- return(len+2);
- break;
- }
-
- /* 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, pbuf);
-
- sprintf((pbuf+(strlen(pbuf)-1)), "]"); /* XXX replace last newline */
-
- return(len+3);
-}
-
-/*---------------------------------------------------------------------------*
- * handle a component recursively
- *---------------------------------------------------------------------------*/
-static int
-do_component(int length, char *pbuf)
-{
- 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 */
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "ENTER - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
-
-again:
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "AGAIN - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
-
- /*----------------------------------------*/
- /* first component element: component tag */
- /*----------------------------------------*/
-
- /* tag class bits */
-
- sprintf((pbuf+strlen(pbuf)), "\t0x%02x Tag: ", *byte_buf);
-
- comp_tag_class = (*byte_buf & 0xc0) >> 6;
-
- switch(comp_tag_class)
- {
- case FAC_TAGCLASS_UNI:
- sprintf((pbuf+strlen(pbuf)), "Universal");
- break;
- case FAC_TAGCLASS_APW:
- sprintf((pbuf+strlen(pbuf)), "Applic-wide");
- break;
- case FAC_TAGCLASS_COS:
- sprintf((pbuf+strlen(pbuf)), "Context-spec");
- break;
- case FAC_TAGCLASS_PRU:
- sprintf((pbuf+strlen(pbuf)), "Private");
- break;
- }
-
- /* tag form bit */
-
- comp_tag_form = (*byte_buf & 0x20) > 5;
-
- sprintf((pbuf+strlen(pbuf)), ", ");
-
- if(comp_tag_form == FAC_TAGFORM_CON)
- {
- sprintf((pbuf+strlen(pbuf)), "Constructor");
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "Primitive");
- }
-
- /* tag code bits */
-
- comp_tag_code = *byte_buf & 0x1f;
-
- sprintf((pbuf+strlen(pbuf)), ", ");
-
- 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);
- sprintf((pbuf+strlen(pbuf)), "%d (ext)\n", comp_tag_code);
- }
- else
- {
- comp_tag_code = (*byte_buf & 0x1f);
-
- if(comp_tag_class == FAC_TAGCLASS_UNI)
- {
- sprintf((pbuf+strlen(pbuf)), "%s (%d)\n", uni_str(comp_tag_code), comp_tag_code);
- }
- else
- {
- sprintf((pbuf+strlen(pbuf)), "code = %d\n", comp_tag_code);
- }
- }
-
- byte_buf++;
- byte_len++;
-
- /*--------------------------------------------*/
- /* second component element: component length */
- /*--------------------------------------------*/
-
- sprintf((pbuf+strlen(pbuf)), "\t0x%02x Len: ", *byte_buf);
-
- 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));
- }
- sprintf((pbuf+strlen(pbuf)), "%d (long form)\n", comp_length);
- }
- else
- {
- comp_length = *byte_buf & 0x7f;
- sprintf((pbuf+strlen(pbuf)), "%d (short form)\n", comp_length);
- }
-
- next_state(pbuf, comp_tag_class, comp_tag_form, comp_tag_code, -1);
-
- byte_len++;
- byte_buf++;
-
- if(comp_length)
- {
-
- /*---------------------------------------------*/
- /* third component element: component contents */
- /*---------------------------------------------*/
-
- if(comp_tag_form) /* == constructor */
- {
- do_component(comp_length, pbuf);
- }
- 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;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x ", *byte_buf);
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- sprintf((pbuf+strlen(pbuf)), "Val: %d\n", val);
- }
- break;
-
- case FAC_CODEUNI_OBJI: /* object id */
-
- if(comp_length)
- object_id(comp_length, pbuf);
- break;
-
- default:
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x = %d", *byte_buf, *byte_buf);
- if(isprint(*byte_buf))
- sprintf((pbuf+strlen(pbuf)), " = '%c'", *byte_buf);
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- }
- break;
- }
- }
-
- else /* comp_tag_class != FAC_TAGCLASS_UNI */
- {
- if(comp_length)
- {
- int i;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x", *byte_buf);
- val += (*byte_buf + (i*255));
- byte_buf++;
- byte_len++;
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- }
- sprintf((pbuf+strlen(pbuf)), "\n");
- }
- }
- next_state(pbuf, comp_tag_class, comp_tag_form, comp_tag_code, val);
- }
- }
-
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "PREGOTO - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
- if(byte_len < length)
- goto again;
-#ifdef FAC_DEBUG
- sprintf((pbuf+strlen(pbuf)), "RETURN - comp_length = %d, byte_len = %d, length =%d\n", comp_length, byte_len, length);
-#endif
- return(byte_len);
-}
-
-/*---------------------------------------------------------------------------*
- * print universal id type
- *---------------------------------------------------------------------------*/
-static char *uni_str(int code)
-{
- static char *tbl[] = {
- "BOOLEAN",
- "INTEGER",
- "BIT STRING",
- "OCTET STRING",
- "NULL",
- "OBJECT IDENTIFIER",
- "OBJECT DESCRIPTOR",
- "EXTERNAL",
- "REAL",
- "ENUMERATED",
- "RESERVED11",
- "RESERVED12",
- "RESERVED13",
- "RESERVED14",
- "RESERVED15",
- "SEQUENCE",
- "SET",
- "NUMERIC STRING",
- "PRINTABLE STRING",
- "TELETEX STRING",
- "ISO646 STRING",
- "IA5 STRING",
- "GRAPHIC STRING",
- "GENERAL STRING"
- };
-
- if(code >= 1 && code <= FAC_CODEUNI_GNSTR)
- return(tbl[code-1]);
- else
- return("ERROR, Value out of Range!");
-}
-
-/*---------------------------------------------------------------------------*
- * print operation value
- *---------------------------------------------------------------------------*/
-static char *opval_str(int val)
-{
- static char buffer[80];
- char *r;
-
- switch(val)
- {
- case FAC_OPVAL_UUS:
- r = "uUs";
- break;
- case FAC_OPVAL_CUG:
- r = "cUGCall";
- break;
- case FAC_OPVAL_MCID:
- r = "mCIDRequest";
- break;
- case FAC_OPVAL_BTPY:
- r = "beginTPY";
- break;
- case FAC_OPVAL_ETPY:
- r = "endTPY";
- break;
- case FAC_OPVAL_ECT:
- r = "eCTRequest";
- break;
- case FAC_OPVAL_DIV_ACT:
- r = "activationDiversion";
- break;
- case FAC_OPVAL_DIV_DEACT:
- r = "deactivationDiversion";
- break;
- case FAC_OPVAL_DIV_ACTSN:
- r = "activationStatusNotificationDiv";
- break;
- case FAC_OPVAL_DIV_DEACTSN:
- r = "deactivationStatusNotificationDiv";
- break;
- case FAC_OPVAL_DIV_INTER:
- r = "interrogationDiversion";
- break;
- case FAC_OPVAL_DIV_INFO:
- r = "diversionInformation";
- break;
- case FAC_OPVAL_DIV_CALLDEF:
- r = "callDeflection";
- break;
- case FAC_OPVAL_DIV_CALLRER:
- r = "callRerouting";
- break;
- case FAC_OPVAL_DIV_LINF2:
- r = "divertingLegInformation2";
- break;
- case FAC_OPVAL_DIV_INVS:
- r = "invokeStatus";
- break;
- case FAC_OPVAL_DIV_INTER1:
- r = "interrogationDiversion1";
- break;
- case FAC_OPVAL_DIV_LINF1:
- r = "divertingLegInformation1";
- break;
- case FAC_OPVAL_DIV_LINF3:
- r = "divertingLegInformation3";
- break;
- case FAC_OPVAL_ER_CRCO:
- r = "explicitReservationCreationControl";
- break;
- case FAC_OPVAL_ER_MGMT:
- r = "explicitReservationManagement";
- break;
- case FAC_OPVAL_ER_CANC:
- r = "explicitReservationCancel";
- break;
- case FAC_OPVAL_MLPP_QUERY:
- r = "mLPP lfb Query";
- break;
- case FAC_OPVAL_MLPP_CALLR:
- r = "mLPP Call Request";
- break;
- case FAC_OPVAL_MLPP_CALLP:
- r = "mLPP Call Preemption";
- break;
- case FAC_OPVAL_AOC_REQ:
- r = "chargingRequest";
- break;
- case FAC_OPVAL_AOC_S_CUR:
- r = "aOCSCurrency";
- break;
- case FAC_OPVAL_AOC_S_SPC:
- r = "aOCSSpecialArrangement";
- break;
- case FAC_OPVAL_AOC_D_CUR:
- r = "aOCDCurrency";
- break;
- case FAC_OPVAL_AOC_D_UNIT:
- r = "aOCDChargingUnit";
- break;
- case FAC_OPVAL_AOC_E_CUR:
- r = "aOCECurrency";
- break;
- case FAC_OPVAL_AOC_E_UNIT:
- r = "aOCEChargingUnit";
- break;
- case FAC_OPVAL_AOC_IDOFCRG:
- r = "identificationOfCharge";
- break;
- case FAC_OPVAL_CONF_BEG:
- r = "beginConf";
- break;
- case FAC_OPVAL_CONF_ADD:
- r = "addConf";
- break;
- case FAC_OPVAL_CONF_SPLIT:
- r = "splitConf";
- break;
- case FAC_OPVAL_CONF_DROP:
- r = "dropConf";
- break;
- case FAC_OPVAL_CONF_ISOLATE:
- r = "isolateConf";
- break;
- case FAC_OPVAL_CONF_REATT:
- r = "reattachConf";
- break;
- case FAC_OPVAL_CONF_PDISC:
- r = "partyDISC";
- break;
- case FAC_OPVAL_CONF_FCONF:
- r = "floatConf";
- break;
- case FAC_OPVAL_CONF_END:
- r = "endConf";
- break;
- case FAC_OPVAL_CONF_IDCFE:
- r = "indentifyConferee";
- break;
- case FAC_OPVAL_REVC_REQ:
- r = "requestREV";
- break;
- default:
- sprintf(buffer, "unknown operation value %d!", val);
- r = buffer;
- }
- return(r);
-}
-
-/*---------------------------------------------------------------------------*
- * billing id string
- *---------------------------------------------------------------------------*/
-static char *bid_str(int val)
-{
- static char buffer[80];
- char *r;
-
- switch(val)
- {
- case 0:
- r = "normalCharging";
- break;
- case 1:
- r = "reverseCharging";
- break;
- case 2:
- r = "creditCardCharging";
- break;
- case 3:
- r = "callForwardingUnconditional";
- break;
- case 4:
- r = "callForwardingBusy";
- break;
- case 5:
- r = "callForwardingNoReply";
- break;
- case 6:
- r = "callDeflection";
- break;
- case 7:
- r = "callTransfer";
- break;
- default:
- sprintf(buffer, "unknown billing-id value %d!", val);
- r = buffer;
- }
- return(r);
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component
- *---------------------------------------------------------------------------*/
-static void
-F_1_1(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_1, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t invokeComponent\n");
- state = ST_EXP_INV_ID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result
- *---------------------------------------------------------------------------*/
-static void
-F_1_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_2, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t returnResult\n");
- state = ST_EXP_RR_INV_ID;
- }
-}
-/*---------------------------------------------------------------------------*
- * return error
- *---------------------------------------------------------------------------*/
-static void
-F_1_3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_3, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t returnError\n");
- state = ST_EXP_NIX;
- }
-}
-/*---------------------------------------------------------------------------*
- * reject
- *---------------------------------------------------------------------------*/
-static void
-F_1_4(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_1_4, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t reject\n");
- state = ST_EXP_REJ_INV_ID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_RJ2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_REJ_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * reject, general problem
- *---------------------------------------------------------------------------*/
-static void
-F_RJ30(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ30, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t General problem\n");
- }
- else
- {
- switch(val)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized component\n");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "\t problem = mistyped component\n");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "\t problem = badly structured component\n");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unknown problem code 0x%x\n", val);
- break;
- }
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * reject, invoke problem
- *---------------------------------------------------------------------------*/
-static void
-F_RJ31(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ31, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Invoke problem\n");
- }
- else
- {
- switch(val)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "\t problem = duplicate invocation\n");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized operation\n");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "\t problem = mistyped argument\n");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "\t problem = resource limitation\n");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "\t problem = initiator releasing\n");
- break;
- case 5:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized linked identifier\n");
- break;
- case 6:
- sprintf((pbuf+strlen(pbuf)), "\t problem = linked resonse unexpected\n");
- break;
- case 7:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unexpected child operation\n");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unknown problem code 0x%x\n", val);
- break;
- }
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * reject, return result problem
- *---------------------------------------------------------------------------*/
-static void
-F_RJ32(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ32, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Return result problem\n");
- }
- else
- {
- switch(val)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized invocation\n");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "\t problem = return response unexpected\n");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "\t problem = mistyped result\n");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unknown problem code 0x%x\n", val);
- break;
- }
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * reject, return error problem
- *---------------------------------------------------------------------------*/
-static void
-F_RJ33(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RJ33, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Return error problem\n");
- }
- else
- {
- switch(val)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized invocation\n");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), "\t problem = error response unexpected\n");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unrecognized error\n");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unexpected error\n");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), "\t problem = mistyped parameter\n");
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), "\t problem = unknown problem code 0x%x\n", val);
- break;
- }
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: invoke id
- *---------------------------------------------------------------------------*/
-static void
-F_RR2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RR2, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t InvokeIdentifier = %d\n", val);
- state = ST_EXP_RR_OP_VAL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * invoke component: operation value
- *---------------------------------------------------------------------------*/
-static void
-F_3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_3, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Operation Value = %s (%d)\n", opval_str(val), val);
- state = ST_EXP_INFO;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: operation value
- *---------------------------------------------------------------------------*/
-static void
-F_RR3(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RR3, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t Operation Value = %s (%d)\n", opval_str(val), val);
- state = ST_EXP_RR_RESULT;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * return result: RESULT
- *---------------------------------------------------------------------------*/
-static void
-F_RRR(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_RRR, val = %d\n", val);
-#endif
- state = ST_EXP_NIX;
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t specificChargingUnits\n");
- state = ST_EXP_RUL;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4_1(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4_1, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t freeOfCharge\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_4_2(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_4_2, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t chargeNotAvailable\n");
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_5(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_5, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t recordedUnitsList [1]\n");
- state = ST_EXP_RU;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_6(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_6, val = %d\n", val);
-#endif
- if(val == -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t RecordedUnits\n");
- state = ST_EXP_RNOU;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_7(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_7, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t NumberOfUnits = %d\n", val);
- state = ST_EXP_TOCI;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_8(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_8, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t typeOfChargingInfo = %s\n", val == 0 ? "subTotal" : "total");
- state = ST_EXP_DBID;
- }
-}
-
-/*---------------------------------------------------------------------------*
- *
- *---------------------------------------------------------------------------*/
-static void
-F_9(char *pbuf, int val)
-{
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: exec F_9, val = %d\n", val);
-#endif
- if(val != -1)
- {
- sprintf((pbuf+strlen(pbuf)), "\t AOCDBillingId = %s (%d)\n", bid_str(val), val);
- state = ST_EXP_NIX;
- }
-}
-
-/*---------------------------------------------------------------------------*
- * state table
- *---------------------------------------------------------------------------*/
-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)(char *,int); /* output: func to exec */
-} statetab[] = {
-
-/* current state tag form tag class tag code function */
-/* --------------------- ---------------------- ---------------------- ---------------------- ----------------*/
-
-/* invoke */
-
- {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 },
-
-/* return result */
-
- {ST_EXP_RR_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RR2 },
- {ST_EXP_RR_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RR3 },
- {ST_EXP_RR_RESULT, FAC_TAGFORM_CON, FAC_TAGCLASS_UNI, FAC_CODEUNI_SET, F_RRR },
-
-/* current state tag form tag class tag code function */
-/* --------------------- ---------------------- ---------------------- ---------------------- ----------------*/
-/* reject */
-
- {ST_EXP_REJ_INV_ID, FAC_TAGFORM_PRI, FAC_TAGCLASS_UNI, FAC_CODEUNI_INT, F_RJ2 },
- {ST_EXP_REJ_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 0, F_RJ30 },
- {ST_EXP_REJ_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 1, F_RJ31 },
- {ST_EXP_REJ_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 2, F_RJ32 },
- {ST_EXP_REJ_OP_VAL, FAC_TAGFORM_PRI, FAC_TAGCLASS_COS, 3, F_RJ33 },
-
-/* end */
-
- {-1, -1, -1, -1, NULL }
-};
-
-/*---------------------------------------------------------------------------*
- * state decode for do_component
- *---------------------------------------------------------------------------*/
-static void
-next_state(char *pbuf, int class, int form, int code, int val)
-{
- int i;
-
-#ifdef ST_DEBUG
- sprintf((pbuf+strlen(pbuf)), "next_state: class=%d, form=%d, code=%d, val=%d\n", class, form, code, val);
-#endif
-
- 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)(pbuf, val);
- break;
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * decode OBJECT IDENTIFIER
- *---------------------------------------------------------------------------*/
-static void
-object_id(int comp_length, unsigned char *pbuf)
-{
- int x;
- int i;
- int j = 0;
- int id_org = 0;
- int etsi = 0;
-
- sprintf((pbuf+strlen(pbuf)), "\t");
-
- for(i = comp_length-1; i >= 0; i--, j++)
- {
- sprintf((pbuf+strlen(pbuf)), "0x%02x = %d", *byte_buf, *byte_buf);
-
- if(j == 0)
- {
- x = *byte_buf;
-
- if(x >= 0 && x <= 39)
- {
- sprintf((pbuf+strlen(pbuf)), " ccitt/itu-t (0)");
- switch(x)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), " recommendation (0)");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), " question (1)");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), " administration (2)");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), " network-operator (3)");
- break;
- case 4:
- sprintf((pbuf+strlen(pbuf)), " identified-organization (4)");
- id_org = 1;
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), " error: undefined-identifier (%d)", x);
- break;
- }
- }
- else if(x >= 40 && x <= 79)
- {
- sprintf((pbuf+strlen(pbuf)), " iso (1)");
- x -= 40;
- switch(x)
- {
- case 0:
- sprintf((pbuf+strlen(pbuf)), " standard (0)");
- break;
- case 1:
- sprintf((pbuf+strlen(pbuf)), " registration-authority (1)");
- break;
- case 2:
- sprintf((pbuf+strlen(pbuf)), " member-body (2)");
- break;
- case 3:
- sprintf((pbuf+strlen(pbuf)), " identified-organization (3)");
- id_org = 1;
- break;
- default:
- sprintf((pbuf+strlen(pbuf)), " error: undefined-identifier (%d)", x);
- break;
- }
- }
- else
- {
- x -= 80;
- sprintf((pbuf+strlen(pbuf)), " joint-iso-ccitt (3) ??? (%d)", x);
- }
- }
-
- if(j == 1)
- {
- if(id_org == 1)
- {
- if(*byte_buf == 0)
- {
- sprintf((pbuf+strlen(pbuf)), " etsi (0)");
- etsi = 1;
- }
- }
- }
-
- if(j == 2)
- {
- if(etsi == 1)
- {
- if(*byte_buf == 0)
- {
- sprintf((pbuf+strlen(pbuf)), " mobileDomain (0)");
- }
- if(*byte_buf == 1)
- {
- sprintf((pbuf+strlen(pbuf)), " inDomain (1)");
- }
- }
- }
-
- byte_buf++;
- byte_len++;
-
- if(i)
- sprintf((pbuf+strlen(pbuf)), "\n\t");
- else
- sprintf((pbuf+strlen(pbuf)), "\n");
- }
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdntrace/q932_fac.h b/usr.sbin/i4b/isdntrace/q932_fac.h
deleted file mode 100644
index 563de3a..0000000
--- a/usr.sbin/i4b/isdntrace/q932_fac.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 1997, 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * q932_fac.h - facility header file
- * ---------------------------------
- *
- * $Id: q932_fac.h,v 1.7 2000/02/18 16:27:39 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Fri Feb 18 17:26:07 2000]
- *
- *---------------------------------------------------------------------------
- *
- * - 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 !)
- *
- *---------------------------------------------------------------------------*/
-
-/* #define FAC_DEBUG */
-/* #define ST_DEBUG */
-
-/* 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_RR_INV_ID,
- ST_EXP_RR_OP_VAL,
- ST_EXP_RR_RESULT,
-
- ST_EXP_REJ_INV_ID,
- ST_EXP_REJ_OP_VAL,
- ST_EXP_REJ_RESULT,
-
- ST_EXP_NIX
-};
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/isdntrace/trace.c b/usr.sbin/i4b/isdntrace/trace.c
deleted file mode 100644
index 2ba1ca5..0000000
--- a/usr.sbin/i4b/isdntrace/trace.c
+++ /dev/null
@@ -1,848 +0,0 @@
-/*
- * Copyright (c) 1996, 2000 Hellmuth Michaelis. All rights reserved.
- *
- * Copyright (c) 1996 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.
- *
- *---------------------------------------------------------------------------*
- *
- * trace.c - print traces of D (B) channel activity for isdn4bsd
- * -------------------------------------------------------------
- *
- * $Id: trace.c,v 1.19 2000/08/28 07:06:42 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Aug 28 09:03:46 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-#include <unistd.h>
-
-unsigned char buf[BSIZE];
-FILE *Fout = NULL;
-FILE *BP = NULL;
-int outflag = 1;
-int header = 1;
-int print_q921 = 1;
-int unit = 0;
-int dchan = 0;
-int bchan = 0;
-int traceon = 0;
-int analyze = 0;
-int Rx = RxUDEF;
-int Tx = TxUDEF;
-int f;
-int Bopt = 0;
-int Popt = 0;
-int bpopt = 0;
-int info = 0;
-int Fopt = 0;
-int xopt = 1;
-
-int enable_trace = TRACE_D_RX | TRACE_D_TX;
-
-static char outfilename[MAXPATHLEN];
-static char routfilename[MAXPATHLEN];
-static char BPfilename[MAXPATHLEN];
-static char rBPfilename[MAXPATHLEN];
-
-static struct stat fst;
-
-static void dumpbuf( int n, unsigned char *buf, i4b_trace_hdr_t *hdr, int raw );
-static int switch_driver( int value, int rx, int tx );
-static void usage( void );
-static void exit_hdl( void );
-static void reopenfiles( int );
-void add_datetime(char *filename, char *rfilename);
-
-/*---------------------------------------------------------------------------*
- * usage instructions
- *---------------------------------------------------------------------------*/
-void
-usage(void)
-{
- fprintf(stderr,"\n");
- fprintf(stderr,"isdntrace - i4b package ISDN trace facility for passive cards (%02d.%02d.%d)\n", VERSION, REL, STEP);
- fprintf(stderr,"usage: isdntrace -a -b -d -f <file> -h -i -l -n <val> -o -p <file> -r -u <unit>\n");
- fprintf(stderr," -x -B -F -P -R <unit> -T <unit>\n");
- fprintf(stderr," -a analyzer mode ................................... (default off)\n");
- fprintf(stderr," -b switch B channel trace on ....................... (default off)\n");
- fprintf(stderr," -d switch D channel trace off ....................... (default on)\n");
- fprintf(stderr," -f <file> write output to file filename ............ (default %s0)\n", TRACE_FILE_NAME);
- fprintf(stderr," -h don't print header for each message ............. (default off)\n");
- fprintf(stderr," -i print I.430 (layer 1) INFO signals .............. (default off)\n");
- fprintf(stderr," -l don't decode low layer Q.921 messages ........... (default off)\n");
- fprintf(stderr," -n <val> process packet if it is longer than <val> octetts . (default 0)\n");
- fprintf(stderr," -o don't write output to a file .................... (default off)\n");
- fprintf(stderr," -p <file> specify filename for -B and -P ........ (default %s0)\n", BIN_FILE_NAME);
- fprintf(stderr," -r don't print raw hex/ASCII dump of protocol ...... (default off)\n");
- fprintf(stderr," -u <unit> specify controller unit number ............... (default unit 0)\n");
- fprintf(stderr," -x show packets with unknown protocol discriminator (default off)\n");
- fprintf(stderr," -B write binary trace data to file filename ........ (default off)\n");
- fprintf(stderr," -F with -P and -p: wait for more data at EOF ....... (default off)\n");
- fprintf(stderr," -P playback from binary trace data file ............ (default off)\n");
- fprintf(stderr," -R <unit> analyze Rx controller unit number (for -a) ... (default unit %d)\n", RxUDEF);
- fprintf(stderr," -T <unit> analyze Tx controller unit number (for -a) ... (default unit %d)\n", TxUDEF);
- fprintf(stderr,"\n");
- exit(1);
-}
-
-/*---------------------------------------------------------------------------*
- * main
- *---------------------------------------------------------------------------*/
-int
-main(int argc, char *argv[])
-{
- char devicename[80];
- char headerbuf[256];
-
- int n;
- int c;
- char *b;
-
- char *outfile = TRACE_FILE_NAME;
- char *binfile = BIN_FILE_NAME;
- int outfileset = 0;
- int raw = 1;
- int noct = -1;
- time_t tm;
- i4b_trace_hdr_t *ithp = NULL;
- int l;
- static struct stat fstnew;
-
- b = &buf[sizeof(i4b_trace_hdr_t)];
-
- while( (c = getopt(argc, argv, "abdf:hiln:op:ru:xBFPR:T:")) != -1)
- {
- switch(c)
- {
- case 'a':
- analyze = 1;
- break;
-
- case 'b':
- enable_trace |= (TRACE_B_RX | TRACE_B_TX);
- break;
-
- case 'd':
- enable_trace &= (~(TRACE_D_TX | TRACE_D_RX));
- break;
-
- case 'o':
- outflag = 0;
- break;
-
- case 'f':
- outfile = optarg;
- outfileset = 1;
- break;
-
- case 'n':
- noct = atoi(optarg);
- break;
-
- case 'h':
- header = 0;
- break;
-
- case 'i':
- enable_trace |= TRACE_I;
- info = 1;
- break;
-
- case 'l':
- print_q921 = 0;
- break;
-
- case 'p':
- binfile = optarg;
- bpopt = 1;
- break;
-
- case 'r':
- raw = 0;
- break;
-
- case 'u':
- unit = atoi(optarg);
- if(unit < 0 || unit >= MAX_CONTROLLERS)
- usage();
- break;
-
- case 'x':
- xopt = 0;
- break;
-
- case 'B':
- Bopt = 1;
- break;
-
- case 'F':
- Fopt = 1;
- break;
-
- case 'P':
- Popt = 1;
- break;
-
- case 'R':
- Rx = atoi(optarg);
- if(Rx < 0 || Rx >= MAX_CONTROLLERS)
- usage();
- break;
-
- case 'T':
- Tx = atoi(optarg);
- if(Tx < 0 || Tx >= MAX_CONTROLLERS)
- usage();
- break;
-
- case '?':
- default:
- usage();
- break;
- }
- }
-
- if(enable_trace == 0)
- usage();
-
- if(Bopt && Popt)
- usage();
-
- atexit(exit_hdl);
-
- if(Bopt)
- {
- if(bpopt)
- sprintf(BPfilename, "%s", binfile);
- else
- sprintf(BPfilename, "%s%d", BIN_FILE_NAME, unit);
-
- add_datetime(BPfilename, rBPfilename);
-
- if((BP = fopen(rBPfilename, "w")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", rBPfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting file [%s] to unbuffered", rBPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(Popt)
- {
- if(bpopt)
- sprintf(BPfilename, "%s", binfile);
- else
- sprintf(BPfilename, "%s%d", BIN_FILE_NAME, unit);
-
- strcpy(rBPfilename, BPfilename);
-
- if((BP = fopen(BPfilename, "r")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- if(Fopt)
- {
- if(fstat(fileno(BP), &fst))
- {
- char buffer[80];
- sprintf(buffer, "Error fstat file [%s]", BPfilename);
- perror(buffer);
- exit(1);
- }
- }
- }
- else
- {
- sprintf(devicename, "%s%d", I4BTRC_DEVICE, unit);
-
- if((f = open(devicename, O_RDWR)) < 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening trace device [%s]", devicename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(outflag)
- {
- if(outfileset == 0)
- sprintf(outfilename, "%s%d", TRACE_FILE_NAME, unit);
- else
- strcpy(outfilename, outfile);
-
- add_datetime(outfilename, routfilename);
-
- if((Fout = fopen(routfilename, "w")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error opening file [%s]", routfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting file [%s] to unbuffered", routfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if((setvbuf(stdout, (char *)NULL, _IOLBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error setting stdout to line-buffered");
- perror(buffer);
- exit(1);
- }
-
- if(!Popt)
- {
- if((switch_driver(enable_trace, Rx, Tx)) == -1)
- exit(1);
- else
- traceon = 1;
- }
-
- signal(SIGHUP, SIG_IGN); /* ignore hangup signal */
- signal(SIGUSR1, reopenfiles); /* rotate logfile(s) */
-
- time(&tm);
-
- if(analyze)
- {
- sprintf(headerbuf, "\n==== isdnanalyze controller rx #%d - tx #%d ==== started %s",
- Rx, Tx, ctime(&tm));
- }
- else
- {
- sprintf(headerbuf, "\n=========== isdntrace controller #%d =========== started %s",
- unit, ctime(&tm));
- }
-
- printf("%s", headerbuf);
-
- if(outflag)
- fprintf(Fout, "%s", headerbuf);
-
- for (;;)
- {
- if(Popt == 0)
- {
- n = read(f, buf, BSIZE);
-
- if(Bopt)
- {
- if((fwrite(buf, 1, n, BP)) != n)
- {
- char buffer[80];
- sprintf(buffer, "Error writing file [%s]", rBPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- n -= sizeof(i4b_trace_hdr_t);
- }
- else
- {
-again:
- if((fread(buf, 1, sizeof(i4b_trace_hdr_t), BP)) != sizeof(i4b_trace_hdr_t))
- {
- if(feof(BP))
- {
- if(Fopt)
- {
- if(ferror(BP))
- {
- char buffer[80];
- sprintf(buffer, "Error reading hdr from file [%s]", rBPfilename);
- perror(buffer);
- exit(1);
- }
-
- usleep(250000);
- clearerr(BP);
-
- if(stat(rBPfilename, &fstnew) != -1)
- {
- if((fst.st_ino != fstnew.st_ino) ||
- (fstnew.st_nlink == 0))
- {
- if((BP = freopen(rBPfilename, "r", BP)) == NULL)
- {
- char buffer[80];
- sprintf(buffer, "Error reopening file [%s]", rBPfilename);
- perror(buffer);
- exit(1);
- }
- stat(rBPfilename, &fst);
- }
- }
- goto again;
- }
- else
- {
- printf("\nEnd of playback input file reached.\n");
- exit(0);
- }
- }
- else
- {
- char buffer[80];
- sprintf(buffer, "Error reading hdr from file [%s]", rBPfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- ithp = (i4b_trace_hdr_t *)buf;
- l = ithp->length - sizeof(i4b_trace_hdr_t);
-
- if((n = fread(buf+sizeof(i4b_trace_hdr_t), 1, l , BP)) != l)
- {
- char buffer[80];
- sprintf(buffer, "Error reading data from file [%s]", rBPfilename);
- perror(buffer);
- exit(1);
- }
-
- }
-
- if((n > 0) && (n > noct))
- {
- dumpbuf(n, b, (i4b_trace_hdr_t *)buf, raw);
- }
- }
-}
-
-/*---------------------------------------------------------------------------*
- * format header into static buffer, return buffer address
- *---------------------------------------------------------------------------*/
-char *
-fmt_hdr(i4b_trace_hdr_t *hdr, int frm_len)
-{
- struct tm *s;
- static char hbuf[256];
- int i = 0;
-
- s = localtime((time_t *)&(hdr->time.tv_sec));
-
- if(hdr->type == TRC_CH_I) /* Layer 1 INFO's */
- {
- sprintf(hbuf,"\n-- %s - unit:%d ---------------- time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec);
- }
- else
- {
- if(hdr->trunc > 0)
- {
- sprintf(hbuf,"\n-- %s - unit:%d - frame:%6.6u - time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u - length:%d (%d) ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- hdr->count,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec,
- frm_len,
- hdr->trunc);
- }
- else
- {
- sprintf(hbuf,"\n-- %s - unit:%d - frame:%6.6u - time:%2.2d.%2.2d %2.2d:%2.2d:%2.2d.%06u - length:%d ",
- ((hdr->dir) ? "NT->TE" : "TE->NT"),
- hdr->unit,
- hdr->count,
- s->tm_mday,
- s->tm_mon + 1,
- s->tm_hour,
- s->tm_min,
- s->tm_sec,
- (u_int32_t)hdr->time.tv_usec,
- frm_len);
- }
- }
-
- for(i=strlen(hbuf); i <= NCOLS;)
- hbuf[i++] = '-';
-
- hbuf[i++] = '\n';
- hbuf[i] = '\0';
-
- return(hbuf);
-}
-
-/*---------------------------------------------------------------------------*
- * decode protocol and output to file(s)
- *---------------------------------------------------------------------------*/
-static void
-dumpbuf(int n, unsigned char *buf, i4b_trace_hdr_t *hdr, int raw)
-{
- static char l1buf[128];
- static unsigned char l2buf[32000];
- static unsigned char l3buf[32000];
- int cnt;
- int nsave = n;
- char *pbuf;
- int i, j;
-
- l1buf[0] = '\0';
- l2buf[0] = '\0';
- l3buf[0] = '\0';
-
- switch(hdr->type)
- {
- case TRC_CH_I: /* Layer 1 INFO's */
-
- /* on playback, don't display layer 1 if -i ! */
- if(!(enable_trace & TRACE_I))
- break;
-
- pbuf = &l1buf[0];
-
- switch(buf[0])
- {
- case INFO0:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO0 (No Signal)\n");
- break;
-
- case INFO1_8:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO1 (Activation Request, Priority = 8, from TE)\n");
- break;
-
- case INFO1_10:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO1 (Activation Request, Priority = 10, from TE)\n");
- break;
-
- case INFO2:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO2 (Pending Activation, from NT)\n");
- break;
-
- case INFO3:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO3 (Synchronized, from TE)\n");
- break;
-
- case INFO4_8:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO4 (Activated, Priority = 8/9, from NT)\n");
- break;
-
- case INFO4_10:
- sprintf((pbuf+strlen(pbuf)),"I430: INFO4 (Activated, Priority = 10/11, from NT)\n");
- break;
-
- default:
- sprintf((pbuf+strlen(pbuf)),"I430: ERROR, invalid INFO value 0x%x!\n", buf[0]);
- break;
- }
- break;
-
- case TRC_CH_D: /* D-channel data */
-
- cnt = decode_lapd(l2buf, n, buf, hdr->dir, raw, print_q921);
-
- n -= cnt;
- buf += cnt;
-
- if(n)
- {
- switch(*buf)
- {
- case 0x40:
- case 0x41:
- decode_1tr6(l3buf, n, cnt, buf, raw);
- break;
-
- case 0x08:
- decode_q931(l3buf, n, cnt, buf, raw);
- break;
-
- default:
- if(xopt)
- {
- l2buf[0] = '\0';
- l3buf[0] = '\0';
- }
- else
- {
- decode_unknownl3(l3buf, n, cnt, buf, raw);
- }
- break;
- }
- }
- break;
-
- default: /* B-channel data */
-
- pbuf = &l2buf[0];
-
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"B%d:%.3x ", hdr->type, i);
-
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
-
- sprintf((pbuf+strlen(pbuf))," ");
-
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
-
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- break;
- }
-
- if(header && ((l1buf[0] != '\0' || l2buf[0] != '\0') || (l3buf[0] != 0)))
- {
- char *p;
- p = fmt_hdr(hdr, nsave);
- printf("%s", p);
- if(outflag)
- fprintf(Fout, "%s", p);
- }
-
- if(l1buf[0] != '\0')
- {
- printf("%s", l1buf);
- if(outflag)
- fprintf(Fout, "%s", l1buf);
- }
-
- if(l2buf[0] != '\0')
- {
- printf("%s", l2buf);
- if(outflag)
- fprintf(Fout, "%s", l2buf);
- }
-
- if(l3buf[0] != '\0')
- {
- printf("%s", l3buf);
- if(outflag)
- fprintf(Fout, "%s", l3buf);
- }
-}
-
-/*---------------------------------------------------------------------------*
- * exit handler function to be called at program exit
- *---------------------------------------------------------------------------*/
-void
-exit_hdl()
-{
- if(traceon)
- switch_driver(TRACE_OFF, Rx, Tx);
-}
-
-/*---------------------------------------------------------------------------*
- * switch driver debugging output on/off
- *---------------------------------------------------------------------------*/
-static int
-switch_driver(int value, int rx, int tx)
-{
- char buffer[80];
- int v = value;
-
- if(analyze == 0)
- {
- if(ioctl(f, I4B_TRC_SET, &v) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_SET, val = %d", v);
- perror(buffer);
- return(-1);
- }
- }
- else
- {
- if(value == TRACE_OFF)
- {
- if(ioctl(f, I4B_TRC_RESETA, &v) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_RESETA - ");
- perror(buffer);
- return(-1);
- }
- }
- else
- {
- i4b_trace_setupa_t tsa;
-
- tsa.rxunit = rx;
- tsa.rxflags = value;
- tsa.txunit = tx;
- tsa.txflags = value;
-
- if(ioctl(f, I4B_TRC_SETA, &tsa) < 0)
- {
- sprintf(buffer, "Error ioctl I4B_TRC_SETA, val = %d", v);
- perror(buffer);
- return(-1);
- }
- }
- }
- return(0);
-}
-
-/*---------------------------------------------------------------------------*
- * reopen files to support rotating logfile(s) on SIGUSR1
- *
- * based on an idea from Ripley (ripley@nostromo.in-berlin.de)
- *
- * close file and reopen it for append. this will be a nop
- * if the previously opened file hasn't moved but will open
- * a new one otherwise, thus enabling a rotation...
- *
- *---------------------------------------------------------------------------*/
-static void
-reopenfiles(int dummy)
-{
- if(outflag)
- {
- fclose(Fout);
-
- add_datetime(outfilename, routfilename);
-
- if((Fout = fopen(routfilename, "a")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-opening file [%s]", routfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(Fout, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-setting file [%s] to unbuffered", routfilename);
- perror(buffer);
- exit(1);
- }
- }
-
- if(Bopt)
- {
-
- fclose(BP);
-
- add_datetime(BPfilename, rBPfilename);
-
- if((BP = fopen(rBPfilename, "a")) == NULL)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-opening file [%s]", rBPfilename);
- perror(buffer);
- exit(1);
- }
-
- if((setvbuf(BP, (char *)NULL, _IONBF, 0)) != 0)
- {
- char buffer[80];
-
- sprintf(buffer, "Error re-setting file [%s] to unbuffered", rBPfilename);
- perror(buffer);
- exit(1);
- }
- }
-}
-
-void
-add_datetime(char *filename, char *rfilename)
-{
- time_t timeb;
- struct tm *tmp;
- FILE *fx;
-
- time(&timeb);
- tmp = localtime(&timeb);
-
- sprintf(rfilename, "%s-", filename);
-
- strftime(rfilename+strlen(rfilename), MAXPATHLEN-strlen(rfilename)-1,
- "%Y%m%d-%H%M%S", tmp);
-
- if((fx = fopen(rfilename, "r")) != NULL)
- {
- fclose(fx);
-
- sleep(1);
-
- time(&timeb);
- tmp = localtime(&timeb);
-
- sprintf(rfilename, "%s-", filename);
-
- strftime(rfilename+strlen(rfilename), MAXPATHLEN-strlen(rfilename)-1,
- "%Y%m%d-%H%M%S", tmp);
- }
-}
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/trace.h b/usr.sbin/i4b/isdntrace/trace.h
deleted file mode 100644
index 95c6861..0000000
--- a/usr.sbin/i4b/isdntrace/trace.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 1996, 2000 Hellmuth Michaelis. All rights reserved.
- *
- * Copyright (c) 1996 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.
- *
- *---------------------------------------------------------------------------
- *
- * trace.h - header file for isdn trace
- * ------------------------------------
- *
- * $Id: trace.h,v 1.12 2000/02/14 16:25:22 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Mon Feb 14 14:43:40 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <sys/uio.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_trace.h>
-
-#include "pcause_1tr6.h" /* obsolete german national ISDN */
-#include "pcause_q850.h"
-
-#define I4BTRC_DEVICE "/dev/i4btrc" /* trace device file */
-#define TRACE_FILE_NAME "isdntrace" /* default output filename */
-#define BIN_FILE_NAME "isdntracebin" /* default binary filename */
-
-#define BSIZE 4096 /* read buffer size */
-#define NCOLS 80 /* screen width */
-
-#define RxUDEF 0 /* analyze mode, default unit for receiver side */
-#define TxUDEF 1 /* analyze mode, default unit for transmitter side */
-
-int decode_lapd(char *pbuf, int n, unsigned char *buf, int is_te, int raw, int printit);
-void decode_q931(char *pbuf, int n, int off, unsigned char *buf, int raw);
-void decode_unknownl3(char *pbuf, int n, int off, unsigned char *buf, int raw);
-void decode_1tr6(char *pbuf, int n, int off, unsigned char *buf, int raw);
-char *print_error(int prot, unsigned char code);
-int q931_facility(char *pbuf, unsigned char *buf);
-int p_q931cause(char *pbuf, unsigned char *buf);
-int p_q931address(char *pbuf, unsigned char *buf);
-int p_q931bc(char *pbuf, unsigned char *buf);
-int p_q931high_compat(char *pbuf, unsigned char *buf);
-int q932_facility(char *pbuf, unsigned char *buf);
-int p_q931user_user(char *pbuf, unsigned char *buf);
-int p_q931notification(char *pbuf, unsigned char *buf);
-int p_q931redir(char *pbuf, unsigned char *buf);
-
-/* EOF */
diff --git a/usr.sbin/i4b/isdntrace/unknownl3.c b/usr.sbin/i4b/isdntrace/unknownl3.c
deleted file mode 100644
index 8967a6a9..0000000
--- a/usr.sbin/i4b/isdntrace/unknownl3.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2000 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.
- *
- *---------------------------------------------------------------------------
- *
- * unknownl3.c - print L3 packets with unknown PD
- * ----------------------------------------------
- *
- * $Id: unknownl3.c,v 1.2 2000/02/13 15:26:52 hm Exp $
- *
- * $FreeBSD$
- *
- * last edit-date: [Sun Feb 13 14:16:44 2000]
- *
- *---------------------------------------------------------------------------*/
-
-#include "trace.h"
-
-/*---------------------------------------------------------------------------*
- * decode unknown protocol
- *---------------------------------------------------------------------------*/
-void
-decode_unknownl3(char *pbuf, int n, int off, unsigned char *buf, int raw)
-{
- int pd;
- int j;
- int i;
-
- if(n <= 0)
- return;
-
- *pbuf = '\0';
-
- if(raw)
- {
- for (i = 0; i < n; i += 16)
- {
- sprintf((pbuf+strlen(pbuf)),"Dump:%.3d ", i+off);
- for (j = 0; j < 16; j++)
- if (i + j < n)
- sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf))," ");
- sprintf((pbuf+strlen(pbuf))," ");
- for (j = 0; j < 16 && i + j < n; j++)
- if (isprint(buf[i + j]))
- sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
- else
- sprintf((pbuf+strlen(pbuf)),".");
- sprintf((pbuf+strlen(pbuf)),"\n");
- }
- }
-
- i = 0;
-
- /* protocol discriminator */
-
- pd = buf[i];
-
- sprintf((pbuf+strlen(pbuf)), "PD%02X: ", pd);
-
- if(pd >= 0x00 && pd <= 0x07)
- sprintf((pbuf+strlen(pbuf)), "pd=User-User (0x%02x)",pd);
- else if(pd == 0x08)
- sprintf((pbuf+strlen(pbuf)), "pd=Q.931/I.451");
- else if(pd >= 0x10 && pd <= 0x3f)
- sprintf((pbuf+strlen(pbuf)), "pd=Other Layer 3 or X.25 (0x%02x)",pd);
- else if(pd >= 0x40 && pd <= 0x4f)
- sprintf((pbuf+strlen(pbuf)), "pd=National Use (0x%02x)",pd);
- else if(pd >= 0x50 && pd <= 0xfe)
- sprintf((pbuf+strlen(pbuf)), "pd=Other Layer 3 or X.25 (0x%02x)",pd);
- else
- sprintf((pbuf+strlen(pbuf)), "pd=Reserved (0x%02x)",pd);
-
- sprintf((pbuf+strlen(pbuf)), "\n [");
- for(j = 0; j < (n-i); j++)
- {
- sprintf((pbuf+strlen(pbuf)),"0x%02x ", buf[j+i]);
- }
-
- sprintf((pbuf+strlen(pbuf)),"]\n");
-}
-
-/* EOF */
-
diff --git a/usr.sbin/i4b/man/Makefile b/usr.sbin/i4b/man/Makefile
deleted file mode 100644
index 75e464b..0000000
--- a/usr.sbin/i4b/man/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-MAN= i4b.4 i4bcapi.4 i4bctl.4 i4bq921.4 \
- i4bq931.4 i4brbch.4 i4btel.4 i4btrc.4 iavc.4 isic.4 ifpi.4 \
- ifpi2.4 ifpnp.4 ihfc.4 itjc.4 iwic.4
-
-# Temporary removed i4bing.4 i4bipr.4 i4bisppp.4 for 7.0 timeframe.
-# In case they are back also remove them from ObsoleteFiles.inc.
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/i4b/man/i4b.4 b/usr.sbin/i4b/man/i4b.4
deleted file mode 100644
index be7b224..0000000
--- a/usr.sbin/i4b/man/i4b.4
+++ /dev/null
@@ -1,110 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 12:07:13 2002]
-.\"
-.Dd July 5, 2007
-.Dt I4B 4
-.Os
-.Sh NAME
-.Nm i4b
-.Nd isdn4bsd call control ISDN driver
-.Sh SYNOPSIS
-.Cd device \&"i4b\&"
-.Sh DESCRIPTION
-The
-.Nm
-device driver is used by the
-.Xr isdnd 8
-daemon to exchange messages with the isdn4bsd kernel part for the purpose
-of call establishment, control and disconnection and to access various
-control and status informations.
-The
-.Nm
-device can only be opened by a single process and is not meant to be used
-by user programs.
-.Pp
-The messages and message parameters are documented in the include
-file
-.Em /usr/include/i4b/i4b_ioctl.h .
-.Pp
-The most important available ioctl's are:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I4B_CDID_REQ
-Request a unique Call Description IDentifier (cdid) which identifies
-uniquely a single interaction of the local D channel with the exchange.
-.It Ar I4B_CONNECT_REQ
-Actively request a call setup to a remote ISDN subscriber.
-.It Ar I4B_CONNECT_RESP
-Respond to an incoming call, either accept, reject or ignore it.
-.It Ar I4B_DISCONNECT_REQ
-Actively terminate a connection.
-.It Ar I4B_CTRL_INFO_REQ
-Request information about an installed ISDN controller card.
-.It Ar I4B_DIALOUT_RESP
-Give information about call setup to driver who requested dialing out.
-.It Ar I4B_TIMEOUT_UPD
-Update the kernels timeout value(s) in case of dynamically calculated
-shorthold mode timing changes.
-.It Ar I4B_UPDOWN_IND
-Inform the kernel userland drivers about interface soft up/down status
-changes.
-.It Ar I4B_CTRL_DOWNLOAD
-Download firmware to active card(s).
-.It Ar I4B_ACTIVE_DIAGNOSTIC
-Return diagnostic information from active cards.
-.El
-.Pp
-Status and event messages available from the kernel are:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar MSG_CONNECT_IND
-An incoming call from a remote ISDN user is indicated.
-.It Ar MSG_CONNECT_ACTIVE_IND
-After an incoming call has been accepted locally or an outgoing call has
-been accepted by a remote, the exchange signaled an active connection
-and the corresponding B-channel is switched through.
-.It Ar MSG_DISCONNECT_IND
-A call was terminated.
-.It Ar MSG_DIALOUT_IND
-A userland interface driver requests the daemon to dial out (typically a
-network interface when a packet arrives in its send queue).
-.It Ar MSG_IDLE_TIMEOUT_IND
-A call was terminated by the isdn4bsd kernel driver because a B-channel
-idle timeout occurred.
-.It Ar MSG_ACCT_IND
-Accounting information from a network driver.
-.It Ar MSG_CHARGING_IND
-Charging information from the kernel.
-.El
-.Sh SEE ALSO
-.Xr isdnd 8
-.Sh AUTHORS
-The
-.Nm
-device driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4bcapi.4 b/usr.sbin/i4b/man/i4bcapi.4
deleted file mode 100644
index 95d2bba..0000000
--- a/usr.sbin/i4b/man/i4bcapi.4
+++ /dev/null
@@ -1,59 +0,0 @@
-.\"
-.\" Copyright (c) 2001 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Fri May 25 09:38:45 2001]
-.\"
-.Dd May 21, 2001
-.Dt I4BCAPI 4
-.Os
-.Sh NAME
-.Nm i4bcapi
-.Nd CAPI driver for the isdn4bsd kernel part
-.Sh SYNOPSIS
-.Cd "device \*[q]i4bcapi\*[q]"
-.Sh DESCRIPTION
-.Nm
-is a CAPI driver for the
-.Em isdn4bsd
-package.
-It sits between layer\~4 of isdn4bsd and a driver for an active
-ISDN card; currently only the
-.Xr iavc 4
-driver for the AVM B1 and T1 family of active cards is supported.
-.Sh SEE ALSO
-.Xr iavc 4
-.Sh STANDARDS
-CAPI 2.0
-.Pq Pa http://www.capi.org/
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-device driver was written by
-.An Juha-Matti Liukkonen Aq jml@cubical.fi
-(Cubical Solutions Ltd, Finland).
-This manpage was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4bctl.4 b/usr.sbin/i4b/man/i4bctl.4
deleted file mode 100644
index 20b42e8..0000000
--- a/usr.sbin/i4b/man/i4bctl.4
+++ /dev/null
@@ -1,50 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 12:21:03 2002]
-.\"
-.Dd July 28, 2002
-.Dt I4BCTL 4
-.Os
-.Sh NAME
-.Nm i4bctl
-.Nd control device for the isdn4bsd kernel part
-.Sh SYNOPSIS
-.Cd device \&"i4bctl\&"
-.Sh DESCRIPTION
-The
-.Nm
-device is used by the
-.Xr isdndebug 8
-utility to get and set the current debugging level and other information
-of the isdn4bsd package kernel ISDN handling layers.
-.Sh SEE ALSO
-.Xr isdndebug 8
-.Sh AUTHORS
-The
-.Nm
-device driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@kts.org .
diff --git a/usr.sbin/i4b/man/i4bing.4 b/usr.sbin/i4b/man/i4bing.4
deleted file mode 100644
index 0322088..0000000
--- a/usr.sbin/i4b/man/i4bing.4
+++ /dev/null
@@ -1,63 +0,0 @@
-.\"
-.\" Copyright (c) 2000, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 12:21:13 2002]
-.\"
-.Dd July 28, 2002
-.Dt I4BING 4
-.Os
-.Sh NAME
-.Nm i4bing
-.Nd isdn4bsd NetGraph ISDN B-channel interface driver
-.Sh SYNOPSIS
-.Cd device \&"i4bing\&" Op count
-.Sh DESCRIPTION
-The
-.Nm
-driver interfaces the
-.Fx
-NetGraph subsystem with the
-isdn4bsd package.
-.Pp
-The driver just packs packets received from the NetGraph subsystem without
-anything appended or prepended into raw HDLC packets on the B channel and
-transfers them to a remote site.
-Packets received from the remote site are queued into the NetGraph
-subsystem.
-.Pp
-In the case where a packet for a remote site arrives in the driver and no
-connection has been established yet, the driver communicates with the
-.Xr isdnd 8
-daemon to establish a connection.
-.Sh SEE ALSO
-.Xr netgraph 4 ,
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8
-.Sh AUTHORS
-The
-.Nm
-device driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4bipr.4 b/usr.sbin/i4b/man/i4bipr.4
deleted file mode 100644
index 6bbc1fa..0000000
--- a/usr.sbin/i4b/man/i4bipr.4
+++ /dev/null
@@ -1,96 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 14:29:08 2002]
-.\"
-.Dd July 28, 2002
-.Dt I4BIPR 4
-.Os
-.Sh NAME
-.Nm i4bipr
-.Nd isdn4bsd IP over ISDN B-channel network driver
-.Sh SYNOPSIS
-.Cd device \&"i4bipr\&" Op count
-.Sh DESCRIPTION
-The
-.Nm
-driver interfaces the IP subsystem of the operating system with the
-isdn4bsd package so that transport of IP packets over an ISDN link
-is possible.
-.Pp
-The driver just packs IP packets without anything appended or prepended
-into raw HDLC packets on the B channel and transfers them to a remote site.
-IP packets received from the remote site are queued into the local IP
-protocol stack.
-.Pp
-The format of the resulting packet on the B channel is:
-.Pp
-.Dl (HDLC opening flag) (IP-packet) (CRC) (HDLC closing flag)
-.Pp
-In the case where an IP packet for a remote site arrives in the driver and no
-connection has been established yet, the driver communicates with the
-.Xr isdnd 8
-daemon to establish a connection.
-.Pp
-The driver has support for interfacing to the
-.Xr bpf 4
-subsystem for using
-.Xr tcpdump 1
-with the
-.Nm ipr
-interfaces.
-.Pp
-The driver optionally (when compiled with the IPR_VJ option) provides Van
-Jacobsen header compression, under control of the link0 and link1 options to
-.Xr ifconfig 8 :
-.Pp
-.Bl -tag -width 15n -offset indent -compact
-.It link0
-Apply VJ compression to outgoing packets on this interface, and assume that
-incoming packets require decompression.
-.It link1
-Check incoming packets for Van Jacobsen compression; if they appear to be
-compressed, automatically set link0.
-.El
-.Pp
-The default values are
-.Em on
-for
-.Em link1
-and
-.Em off
-for
-.Em link0 .
-.Sh SEE ALSO
-.Xr tcpdump 1 ,
-.Xr bpf 4 ,
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8
-.Sh AUTHORS
-The
-.Nm
-device driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4bisppp.4 b/usr.sbin/i4b/man/i4bisppp.4
deleted file mode 100644
index 7ef4a96..0000000
--- a/usr.sbin/i4b/man/i4bisppp.4
+++ /dev/null
@@ -1,123 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 12:43:22 2002]
-.\"
-.Dd July 28, 2002
-.Dt I4BISPPP 4
-.Os
-.Sh NAME
-.Nm i4bisppp
-.Nd isdn4bsd synchronous PPP over ISDN B-channel network driver
-.Sh SYNOPSIS
-.Cd device \&"i4bisppp\&" Op count
-.Cd device sppp
-.Sh DESCRIPTION
-The
-.Nm
-driver interfaces the IP subsystem of the operating system with the
-isdn4bsd package so that a transport of IP packets over an ISDN link
-is possible.
-.Pp
-The driver is just a glue layer between the
-.Xr sppp 4
-backend and the ISDN4BSD package and needs the
-.Xr sppp 4
-driver configured into the kernel.
-.Pp
-The network interfaces provided by this driver are named
-.Em isp<n> ,
-where <n> is a number between 0 and count-1 from the kernel config line.
-.Pp
-For configuration of the i4bsppp driver, either the
-.Xr spppcontrol 8
-utility is used or the driver can be configured via
-.Xr isdnd 8
-and its associated
-.Xr isdnd.rc 5
-file.
-.Pp
-In case an IP packet for a remote side arrives in the driver and no
-connection is established yet, the driver communicates with the
-.Xr isdnd 8
-daemon to establish a connection.
-.Pp
-The driver has support for interfacing to the
-.Xr bpf 4
-subsystem for using
-.Xr tcpdump 1
-with the
-.Nm isp
-interfaces.
-.Pp
-.Sh LINK0 and LINK1
-The
-.Em link0
-and
-.Em link1
-flags given as parameters to
-.Xr ifconfig 8
-have the following meaning for the
-.Em isp<n>
-devices:
-.Bl -tag -width link0 -compact
-.Pp
-.It Li link0
-wait passively for connection
-.Pp
-.It Li link1
-auto-dial on output
-.El
-.Pp
-The
-.Em link0
-and
-.Em link1
-flags are set to
-.Em off
-by default.
-.Pp
-See
-.Xr sppp 4
-for a more detailed discussion of the flags.
-.Sh SEE ALSO
-.Xr tcpdump 1 ,
-.Xr bpf 4 ,
-.Xr sppp 4 ,
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8 ,
-.Xr spppcontrol 8
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-device driver was written by
-.An Joerg Wunsch Aq joerg@FreeBSD.org
-and then added to ISDN4BSD by
-.An Gary Jennejohn Aq gj@FreeBSD.org .
-.Pp
-This manpage was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4bq921.4 b/usr.sbin/i4b/man/i4bq921.4
deleted file mode 100644
index ecd7293..0000000
--- a/usr.sbin/i4b/man/i4bq921.4
+++ /dev/null
@@ -1,48 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 12:49:44 2002]
-.\"
-.Dd July 28, 2002
-.Dt I4BQ921 4
-.Os
-.Sh NAME
-.Nm i4bq921
-.Nd isdn4bsd pseudo device driver handling the Q.921 protocol
-.Sh SYNOPSIS
-.Cd device \&"i4bq921\&"
-.Sh DESCRIPTION
-.Nm
-is the ISDN D channel layer 2 handler.
-.Sh SEE ALSO
-.Xr i4bq931 4
-.Sh STANDARDS
-ITU Recommendation Q.920 and Q.921
-.Sh AUTHORS
-The
-.Nm
-driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4bq931.4 b/usr.sbin/i4b/man/i4bq931.4
deleted file mode 100644
index 937840d..0000000
--- a/usr.sbin/i4b/man/i4bq931.4
+++ /dev/null
@@ -1,48 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 14:11:55 2002]
-.\"
-.Dd July 28, 2002
-.Dt I4BQ931 4
-.Os
-.Sh NAME
-.Nm i4bq931
-.Nd isdn4bsd pseudo device driver handling the Q.931 protocol
-.Sh SYNOPSIS
-.Cd device \&"i4bq931\&"
-.Sh DESCRIPTION
-.Nm
-is the ISDN D channel layer 3 handler.
-.Sh SEE ALSO
-.Xr i4bq921 4
-.Sh STANDARDS
-ITU Recommendation Q.930 and Q.931
-.Sh AUTHORS
-The
-.Nm
-driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4brbch.4 b/usr.sbin/i4b/man/i4brbch.4
deleted file mode 100644
index aaa6044..0000000
--- a/usr.sbin/i4b/man/i4brbch.4
+++ /dev/null
@@ -1,49 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 12:52:34 2002]
-.\"
-.Dd July 28, 2002
-.Dt I4BRBCH 4
-.Os
-.Sh NAME
-.Nm i4brbch
-.Nd isdn4bsd ISDN Raw B-CHannel access driver
-.Sh SYNOPSIS
-.Cd device \&"i4brbch\&" Op count
-.Sh DESCRIPTION
-The
-.Nm
-driver provides an interface to the raw untranslated B-channel.
-It is part of the isdn4bsd package.
-.Sh SEE ALSO
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8
-.Sh AUTHORS
-The
-.Nm
-device driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4btel.4 b/usr.sbin/i4b/man/i4btel.4
deleted file mode 100644
index d8e17f4..0000000
--- a/usr.sbin/i4b/man/i4btel.4
+++ /dev/null
@@ -1,133 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 14:14:06 2002]
-.\"
-.Dd July 28, 2002
-.Dt I4BTEL 4
-.Os
-.Sh NAME
-.Nm i4btel
-.Nd isdn4bsd ISDN B-channel telephony interface driver
-.Sh SYNOPSIS
-.Cd device \&"i4btel\&" Op count
-.Sh DESCRIPTION
-The
-.Nm
-driver provides an interface to the ISDN B-channel for telephony applications
-and is currently used by the
-.Xr isdnd 8
-for answering machine support.
-The driver is part of the isdn4bsd package.
-.Pp
-The lower six bits of the drivers's minor number is used to specify a
-unit number, whereas the upper two bits specify a functionality.
-.Pp
-Functionality zero is the usual telephony data stream i/o driver.
-.Pp
-Functionality one is used to enable commands to dial out and hang up and
-receive responses about the state of the dial out progress and status.
-This commands may change in the future, for details see the file
-.Em i4b_tel_ioctl.h
-and the
-.Xr isdnphone 8
-utility.
-.Pp
-The telephony data stream comes out of the line in a bit-reversed format,
-so the
-.Nm
-driver does the bit-reversion process in any case.
-.Pp
-Additionally, the user can specify to do A-law to u-law, u-law to A-law
-or no conversion at all in the i4btel driver by using the
-.Xr isdntelctl 8
-utility.
-.Pp
-The driver is able to process several ioctl's:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar I4B_TEL_GETAUDIOFMT
-get currently used audio format conversion.
-.It Ar I4B_TEL_SETAUDIOFMT
-set currently used audio format conversion.
-.It Ar I4B_TEL_EMPTYINPUTQUEUE
-clear the input queue.
-.El
-.Pp
-For the I4B_TEL_GETAUDIOFMT and I4B_TEL_SETAUDIOFMT, the following
-parameters are available:
-.Pp
-.Bl -tag -width Ds -compact -offset indent
-.It Ar CVT_NONE
-do no A-law/u-law audio format conversion.
-The conversion path looks like this:
-.Pp
-USER <--> bitreversing <--> ISDN-line
-.Pp
-.It Ar CVT_ALAW2ULAW
-set set audio format conversion to do an audio conversion from A-law
-(on the ISDN line) to u-law (in the userland).
-The
-.Xr read 2
-conversion path looks like this:
-.Pp
-USER <-- u-law/A-law <-- bitreversing <-- ISDN-line
-.Pp
-and the
-.Xr write 2
-conversion path looks like this:
-.Pp
-USER --> u-law/A-law --> bitreversing --> ISDN-line
-.Pp
-.It Ar CVT_ULAW2ALAW
-set set audio format conversion to do an audio conversion from u-law
-(on the ISDN line) to A-law (in the userland).
-The
-.Xr read 2
-conversion path looks like this:
-.Pp
-USER <-- A-law/u-law <-- bitreversing <-- ISDN-line
-.Pp
-and the
-.Xr write 2
-conversion path looks like this:
-.Pp
-USER --> A-law/u-law --> bitreversing --> ISDN-line
-.Pp
-.El
-.Sh SEE ALSO
-.Xr g711conv 1 ,
-.Xr isdnd.rc 5 ,
-.Xr isdnd 8 ,
-.Xr isdnphone 8 ,
-.Xr isdntelctl 8
-.Sh STANDARDS
-A-Law and u-Law are specified in ITU Recommendation G.711.
-.Sh AUTHORS
-The
-.Nm
-device driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/i4btrc.4 b/usr.sbin/i4b/man/i4btrc.4
deleted file mode 100644
index cbd6a7f..0000000
--- a/usr.sbin/i4b/man/i4btrc.4
+++ /dev/null
@@ -1,54 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 14:21:03 2002]
-.\"
-.Dd July 30, 1999
-.Dt I4BTRC 4
-.Os
-.Sh NAME
-.Nm i4btrc
-.Nd "isdn4bsd ISDN interface driver for D and B channel tracing
-.Sh SYNOPSIS
-.Cd device \&"i4btrc\&" Op count
-.Sh DESCRIPTION
-The
-.Nm
-driver is used to add a header to the data got from the D and/or B channel
-and queues it to be read and further processed by the
-.Xr isdntrace 8
-or
-.Xr isdndecode 8
-utilities.
-.Sh SEE ALSO
-.Xr isdnd 8 ,
-.Xr isdndecode 8 ,
-.Xr isdntrace 8
-.Sh AUTHORS
-The
-.Nm
-device driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/iavc.4 b/usr.sbin/i4b/man/iavc.4
deleted file mode 100644
index e737e64..0000000
--- a/usr.sbin/i4b/man/iavc.4
+++ /dev/null
@@ -1,73 +0,0 @@
-.\"
-.\" Copyright (c) 2001, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 16:37:51 2002]
-.\"
-.Dd July 28, 2002
-.Dt IAVC 4
-.Os
-.Sh NAME
-.Nm iavc
-.Nd isdn4bsd AVM B1/T1 driver
-.Sh SYNOPSIS
-.Cd "device iavc"
-.Cd device \&"i4bcapi\&"
-.Pp
-NOTE:
-For the B1 ISA card, something like
-.Pp
-.Bd -literal -offset indent
-hint.iavc.0.at="isa"
-hint.iavc.0.port="0x150"
-hint.iavc.0.irq="5"
-.Ed
-.Pp
-must be added to
-.Pa /boot/device.hints
-.Sh DESCRIPTION
-The
-.Nm
-driver is used to access the AVM family of active cards to the
-.Xr i4bcapi 4
-driver and the
-.Em isdn4bsd
-package.
-Currently the AVM B1 PCI, the AVM B1 ISA and the AVM T1 PCI
-cards are supported.
-.Sh SEE ALSO
-.Xr i4bcapi 4
-.Sh STANDARDS
-CAPI 2.0
-.Pq Pa http://www.capi.org/
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-device driver was written by
-.An Juha-Matti Liukkonen Aq jml@cubical.fi
-(Cubical Solutions Ltd, Finland).
-This manpage was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/usr.sbin/i4b/man/ifpi.4 b/usr.sbin/i4b/man/ifpi.4
deleted file mode 100644
index f2f3cdf..0000000
--- a/usr.sbin/i4b/man/ifpi.4
+++ /dev/null
@@ -1,64 +0,0 @@
-.\"
-.\" Copyright (c) 2000, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 16:38:40 2002]
-.\"
-.Dd July 28, 2002
-.Dt IFPI 4
-.Os
-.Sh NAME
-.Nm ifpi
-.Nd isdn4bsd AVM Fritz!Card PCI Version 1 driver
-.Sh SYNOPSIS
-.Cd device ifpi
-.Sh DESCRIPTION
-The
-.Nm
-driver provides D-channel layer 1 support as specified in ITU Recommendation
-I.430 and layer 1 support for the B-channel.
-.Pp
-The driver supports passive PCI ISDN Version 1.0 cards from AVM based on the
-proprietary B-channel controller and PCI interface chip from AVM, Berlin,
-Germany.
-.Sh CAVEATS
-The driver is still in a somewhat experimental state.
-.Sh SEE ALSO
-.Xr i4bq921 4 ,
-.Xr i4bq931 4 ,
-.Xr ifpi2 4
-.Sh STANDARDS
-CCITT Recommendation I.430
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was written by
-.An Gary Jennejohn Aq gj@FreeBSD.org .
-.Pp
-This manpage was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
-.Sh BUGS
-Always at least one left.
diff --git a/usr.sbin/i4b/man/ifpi2.4 b/usr.sbin/i4b/man/ifpi2.4
deleted file mode 100644
index 4889079..0000000
--- a/usr.sbin/i4b/man/ifpi2.4
+++ /dev/null
@@ -1,60 +0,0 @@
-.\"
-.\" Copyright (c) 2001 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.
-.\"
-.\" 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 16:38:22 2002]
-.\"
-.Dd July 28, 2002
-.Dt IFPI2 4
-.Os
-.Sh NAME
-.Nm ifpi2
-.Nd isdn4bsd AVM Fritz!Card PCI Version 2 driver
-.Sh SYNOPSIS
-.Cd device \&"ifpi2\&"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides D-channel layer 1 support as specified in ITU Recommendation
-I.430 and layer 1 support for the B-channel.
-.Pp
-The driver supports the version 2 passive PCI ISDN cards from AVM based on
-the proprietary B-channel controller and PCI interface chip from AVM, Berlin,
-Germany.
-.Sh CAVEATS
-The driver is still in a somewhat experimental state.
-.Sh SEE ALSO
-.Xr i4bq921 4 ,
-.Xr i4bq931 4 ,
-.Xr ifpi 4
-.Sh STANDARDS
-CCITT Recommendation I.430
-.Sh AUTHORS
-The
-.Nm
-driver and manpage were written by
-.An Gary Jennejohn Aq gj@FreeBSD.org .
-.Sh BUGS
-Always at least one left.
diff --git a/usr.sbin/i4b/man/ifpnp.4 b/usr.sbin/i4b/man/ifpnp.4
deleted file mode 100644
index bf89218..0000000
--- a/usr.sbin/i4b/man/ifpnp.4
+++ /dev/null
@@ -1,67 +0,0 @@
-.\"
-.\" Copyright (c) 2000 Udo Schweigert. 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.
-.\"
-.\" $Ust: src/i4b/man/ifpnp.4,v 1.4 2000/04/18 08:26:31 ust Exp $
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 16:39:35 2002]
-.\"
-.Dd July 28, 2002
-.Dt IFPNP 4
-.Os
-.Sh NAME
-.Nm ifpnp
-.Nd isdn4bsd AVM Fritz!Card ISA PnP driver
-.Sh SYNOPSIS
-.Cd "device ifpnp"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides D-channel layer 1 supports as specified in ITU Recommendation
-I.430 and layer 1 support for the B-channel.
-.Pp
-The driver supports passive ISA PnP ISDN cards from AVM, based on the
-proprietary B-channel controller and ISA PnP interface chip from
-AVM, Berlin, Germany.
-.Sh CAVEATS
-The driver is still in a somewhat experimental state.
-.Sh SEE ALSO
-.Xr i4bq921 4 ,
-.Xr i4bq931 4
-.Sh STANDARDS
-CCITT Recommendation I.430
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was written by
-.An Udo Schweigert Aq ust@cert.siemens.de .
-.Pp
-This manpage was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org
-and
-.An Udo Schweigert .
-.Sh BUGS
-Always at least one left.
diff --git a/usr.sbin/i4b/man/ihfc.4 b/usr.sbin/i4b/man/ihfc.4
deleted file mode 100644
index 4d91391..0000000
--- a/usr.sbin/i4b/man/ihfc.4
+++ /dev/null
@@ -1,71 +0,0 @@
-.\"
-.\" Copyright (c) 2000, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 16:47:55 2002]
-.\"
-.Dd July 28, 2002
-.Dt IHFC 4
-.Os
-.Sh NAME
-.Nm ihfc
-.Nd isdn4bsd ISA Cologne Chip HFC[-S][-SP] 2B[DS0] driver
-.Sh SYNOPSIS
-.Cd "device ihfc"
-.Pp
-NOTE:
-.Pp
-Something like:
-.Li hint.ihfc.0.at="isa"
-must be added to
-.Pa /boot/device.hints
-The driver will automatically probe for io-base and irq.
-.Sh DESCRIPTION
-The
-.Nm
-driver provides D-channel layer 1 supports as specified in ITU Recommendation
-I.430 and layer 1 support for the B-channel.
-.Pp
-The driver supports some passive ISA ISDN cards based on the
-HFC[-S][-SP] 2B[DS0] chips from Cologne Chip, currently this are the
-Teles 16.3c ISA PnP, the AcerISDN P10 ISA PnP and the TELEINT ISDN SPEED No.1.
-.Sh CAVEATS
-The driver is still in an experimental state.
-.Sh SEE ALSO
-.Xr i4bq921 4 ,
-.Xr i4bq931 4
-.Sh STANDARDS
-CCITT Recommendation I.430
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was written by
-.An Hans Petter Selasky Aq hselasky@c2i.net .
-.Pp
-This manpage was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
-.Sh BUGS
-Always at least one left.
diff --git a/usr.sbin/i4b/man/isic.4 b/usr.sbin/i4b/man/isic.4
deleted file mode 100644
index e545c08..0000000
--- a/usr.sbin/i4b/man/isic.4
+++ /dev/null
@@ -1,359 +0,0 @@
-.\"
-.\" Copyright (c) 1997, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 20:14:24 2002]
-.\"
-.Dd July 28, 2002
-.Dt ISIC 4
-.Os
-.Sh NAME
-.Nm isic
-.Nd isdn4bsd Siemens ISDN Chipset device driver
-.Sh SYNOPSIS
-.Cd "device isic"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides D-channel layer 1 supports as specified in ITU Recommendation
-I.430 and layer 1 support for the B-channel.
-.Pp
-The driver supports several 8 and 16bit passive ISA, ISA PnP and PCI
-ISDN cards from various manufacturers which are all based upon the
-popular Siemens ISDN chipset consisting of the ISDN Subscriber Access
-Controller ISAC (such as the PEB2085 or PSB 2186) and the High-Level
-Serial Communications Controller Extended HSCX (such as the SAB82525
-or PSB21525).
-The newer IPAC chip (which integrates an ISAC and a HSCX in one chip,
-with the added benefit of larger FIFO buffers) is also supported.
-.Sh SUPPORTED CARDS: ISA bus, NON-PnP
-.Bl -tag -width Ds -compact
-.It Ar Teles S0/8, Dr. Neuhaus Niccy 1008, Creatix ISDN-S0/8
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options TEL_S0_8
-.Ed
-.Pp
-The required entry in
-.Xr device.hints 5
-file is:
-.Pp
-.Bd -literal -offset indent
-hint.isic.0.at="isa"
-hint.isic.0.maddr="0xd0000"
-hint.isic.0.irq="5"
-hint.isic.0.flags="1"
-.Ed
-.Pp
-Notice that this cards must not have a
-.Em port
-value.
-.Pp
-Valid values for hint.isic.N.irq are 2, 3, 4, 5, 6 and 7.
-.Pp
-The i/o ports are memory mapped and the memory start address (hint.isic.N.maddr)
-may be in the range 0xA0000 to 0xDF000 and use a region of 4kB of memory.
-.Pp
-.It Ar Teles S0/16, Creatix ISDN-S0, Dr. Neuhaus Niccy 1016
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options TEL_S0_16
-.Ed
-.Pp
-The required entry in
-.Xr device.hints 5
-file is:
-.Pp
-.Bd -literal -offset indent
-hint.isic.0.at="isa"
-hint.isic.0.port="0xd80"
-hint.isic.0.maddr="0xd0000"
-hint.isic.0.irq="5"
-hint.isic.0.flags="2"
-.Ed
-.Pp
-These boards have a jumper which specifies an i/o base address
-(hint.isic.N.port) of either 0xd80, 0xe80 or 0xf80.
-The remaining necessary configuration values are then
-programmed at run time by accessing this i/o port.
-.Pp
-Valid interrupts (hint.isic.N.irq) are 2, 3, 4, 5, 10, 11, 12 or 15.
-.Pp
-Valid memory start addresses (hint.isic.N.maddr) are
-0xC0000, 0xC2000, 0xC4000, 0xC6000, 0xC8000, 0xCA000, 0xCC000, 0xCE000,
-0xD0000, 0xD2000, 0xD4000, 0xD6000, 0xD8000, 0xDA000, 0xDC000 and
-0xDE000.
-.Pp
-Notice: Although the jumpers are labeled 0xd80, 0xe80 or 0xf80, they
-also require i/o space at addresses 0x180, 0x280 or 0x380.
-.Pp
-.It Ar Teles S0/16.3
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options TEL_S0_16_3
-.Ed
-.Pp
-The required entry in
-.Xr device.hints 5
-file is:
-.Pp
-.Bd -literal -offset indent
-hint.isic.0.at="isa"
-hint.isic.0.port="0xd80"
-hint.isic.0.irq="5"
-hint.isic.0.flags="3"
-.Ed
-.Pp
-This card is completely i/o mapped and must not have an
-.Em maddr
-statement in the hints file.
-.Pp
-Valid interrupts (hint.isic.N.irq) are 2, 5, 9, 10, 12 or 15.
-.Pp
-These boards have a jumper which specifies an i/o base address
-(hint.isic.N.port) of either 0xd80, 0xe80 or 0xf80.
-.Pp
-Notice: Although the switch positions are labeled 0x180, 0x280 and 0x380,
-the card is to be configured at 0xd80, 0xe80 or 0xf80 respectively!
-.Pp
-.It Ar AVM A1 and AVM Fritz!Card
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options AVM_A1
-.Ed
-.Pp
-The required entry in
-.Xr device.hints 5
-file is:
-.Pp
-.Bd -literal -offset indent
-hint.isic.0.at="isa"
-hint.isic.0.port="0x340"
-hint.isic.0.irq="5"
-hint.isic.0.flags="4"
-.Ed
-.Pp
-These boards have a jumper which specifies an i/o base address (hint.isic.N.port)
-of either 0x200, 0x240, 0x300 or 0x340.
-.Pp
-Valid interrupt (hint.isic.N.irq) values are 3, 4, 5, 6, 7, 10, 11, 12 or 15.
-.Pp
-Older Versions of the AVM A1 also require setting of an IRQ jumper, newer
-versions of this and the Fritz!Card only have an i/o base jumper and the
-interrupt is setup at runtime by reprogramming a register.
-.Pp
-.It Ar USRobotics Sportster ISDN TA intern and Stollmann Tina pp
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options USR_STI
-.Ed
-.Pp
-The required entry in
-.Xr device.hints 5
-file is:
-.Pp
-.Bd -literal -offset indent
-hint.isic.0.at="isa"
-hint.isic.0.port="0x268"
-hint.isic.0.irq="5"
-hint.isic.0.flags="7"
-.Ed
-.Pp
-Valid i/o port values (hint.isic.N.port) are 0x200, 0x208, 0x210, 0x218,
-0x220, 0x228, 0x230, 0x238, 0x240, 0x248, 0x250, 0x258, 0x260, 0x268,
-0x270 and 0x278.
-.Pp
-Valid interrupt (hint.isic.N.irq) values are 5, 7, 10, 11, 12, 14, 15.
-.Pp
-Notice: this card has a strange address decoding scheme resulting in
-occupying 64 windows of some bytes length over the whole i/o address
-range.
-.Pp
-.It Ar ITK ix1 Micro ( < V.3, non-PnP version )
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options ITKIX1
-.Ed
-.Pp
-The required entry in
-.Xr device.hints 5
-file is:
-.Pp
-.Bd -literal -offset indent
-hint.isic.0.at="isa"
-hint.isic.0.port="0x398"
-hint.isic.0.irq="10"
-hint.isic.0.flags="18"
-.Ed
-.Pp
-Valid i/o port values must be in the range (<unknown>).
-.Pp
-Valid interrupt configurations are (<unknown>).
-.Pp
-.It Ar ELSA MicroLink ISDN/PCC-16 and ELSA PCFpro
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options ELSA_PCC16
-.Ed
-.Pp
-The required entry in
-.Xr device.hints 5
-file is:
-.Pp
-.Bd -literal -offset indent
-hint.isic.0.at="isa"
-hint.isic.0.port="0x360"
-hint.isic.0.irq="10"
-hint.isic.0.flags="20"
-.Ed
-.Pp
-Valid i/o port (hint.isic.N.port) values are 0x160, 0x170, 0x260 and 0x360.
-.Pp
-Valid interrupt (hint.isic.N.irq) values are 2, 3, 5, 10, 11 and 15.
-.Pp
-The LED's are not supported and are off.
-.Pp
-.El
-.Sh SUPPORTED CARDS: ISA bus, PnP (Plug 'n Pray)
-.Bl -tag -width Ds -compact
-.It Ar Teles S0/16.3 PnP
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options TEL_S0_16_3_P
-.Ed
-.Pp
-.It Ar Creatix ISDN-S0 P&P
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options CRTX_S0_P
-.Ed
-.Pp
-.It Ar "Dr. Neuhaus Niccy Go@"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options DRN_NGO
-.Ed
-.Pp
-.It Ar "Sedlbauer Win Speed"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options SEDLBAUER
-.Ed
-.Pp
-.It Ar "Dynalink IS64PH"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options DYNALINK
-.Ed
-.Pp
-.It Ar "ELSA QuickStep 1000pro ISA"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options ELSA_QS1ISA
-.Ed
-.Pp
-The LED's are not supported and are off.
-.Pp
-.It Ar "Siemens I-Surf 2.0"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options SIEMENS_ISURF2
-.Ed
-.Pp
-.It Ar "Asuscom ISDNlink 128K ISA"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options ASUSCOM_IPAC
-.Ed
-.Pp
-.It Ar "Eicon Diehl DIVA 2.0 and 2.02"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options EICON_DIVA
-.Ed
-.Pp
-.It Ar "Compaq Microcom 610 ISDN card (Compaq series PSB2222I)"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options COMPAQ_M610
-.Ed
-.Pp
-.El
-.Sh SUPPORTED CARDS: PCI bus
-.Bl -tag -width Ds -compact
-.It Ar "ELSA QuickStep 1000pro-PCI"
-.Pp
-The required entry in the kernel config file is:
-.Bd -literal -offset indent
-options ELSA_QS1PCI
-.Ed
-.Pp
-The LED's are not supported and are off.
-.Pp
-.El
-.Sh CAVEATS
-Note that all of ISA boards with i/o ports actually use several ranges
-of port addresses; Teles happen to refer to the 0xd80 range in their
-documentation (the board also uses 0x180 etc.), while AVM happen to refer
-to the 0x200 range in their documentation (the board also uses 0x600 etc.)
-The driver matches the manufacturers' description for the purposes of
-configuration, but of course makes use of all the ports in order to
-operate the card.
-.Sh SEE ALSO
-.Xr i4bq921 4 ,
-.Xr i4bq931 4
-.Sh STANDARDS
-CCITT Recommendation I.430
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver and this manpage were written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
-It is based on earlier work of
-.An Arne Helme ,
-.An Andrew Gordon
-and
-.An Gary Jennejohn Aq gj@FreeBSD.org .
-.Sh BUGS
-Since there is no hardware documentation available from the manufacturers
-of several boards, it is likely that there are many bugs left.
diff --git a/usr.sbin/i4b/man/itjc.4 b/usr.sbin/i4b/man/itjc.4
deleted file mode 100644
index be4f9fe..0000000
--- a/usr.sbin/i4b/man/itjc.4
+++ /dev/null
@@ -1,66 +0,0 @@
-.\"
-.\" Copyright (c) 2001 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Fri Jan 12 10:07:04 2001]
-.\"
-.Dd January 12, 2001
-.Dt ITJC 4
-.Os
-.Sh NAME
-.Nm itjc
-.Nd isdn4bsd NETjet-S / Teles PCI-TJ hardware driver
-.Sh SYNOPSIS
-.Cd "device itjc"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides D-channel layer 1 supports as specified in ITU Recommendation
-I.430 and layer 1 support for the B-channel.
-.Pp
-The driver supports passive PCI ISDN cards based on the combination of
-the Siemens/Infineon ISAC chip and the Tiger Jet Network Inc.\& Tiger 300/320
-chip.
-.Pp
-Currently supported cards are the Traverse Technologies NETjet-S PCI ISDN
-card and the Teles PCI-TJ.
-.Sh CAVEATS
-The driver is in an experimental state.
-.Sh SEE ALSO
-.Xr i4bq921 4 ,
-.Xr i4bq931 4
-.Sh STANDARDS
-CCITT Recommendation I.430
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was written by
-.An Sergio de Souza Prallon Aq prallon@tmp.com.br .
-.Pp
-This manpage was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
-.Sh BUGS
-Always at least one left.
diff --git a/usr.sbin/i4b/man/iwic.4 b/usr.sbin/i4b/man/iwic.4
deleted file mode 100644
index 8d9b4df..0000000
--- a/usr.sbin/i4b/man/iwic.4
+++ /dev/null
@@ -1,68 +0,0 @@
-.\"
-.\" Copyright (c) 2000, 2002 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.
-.\"
-.\" $FreeBSD$
-.\"
-.\" last edit-date: [Sun Jul 28 16:49:47 2002]
-.\"
-.Dd July 28, 2002
-.Dt IWIC 4
-.Os
-.Sh NAME
-.Nm iwic
-.Nd isdn4bsd Winbond ISDN Chip device driver
-.Sh SYNOPSIS
-.Cd "device iwic0"
-.Sh DESCRIPTION
-The
-.Nm
-driver provides D-channel layer 1 supports as specified in ITU Recommendation
-I.430 and layer 1 support for the B-channel.
-.Pp
-The driver supports passive PCI ISDN cards from various manufacturers
-based on the Winbond W6692 chip.
-.Sh SUPPORTED CARDS
-.Bl -tag -width Ds -compact
-.It Ar ASUSCOM P-IN100-ST-D
-.Pp
-.It Ar Dynalink IS64PPH
-.El
-.Sh CAVEATS
-The driver is still in a somewhat experimental state.
-.Sh SEE ALSO
-.Xr i4bq921 4 ,
-.Xr i4bq931 4
-.Sh STANDARDS
-CCITT Recommendation I.430
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was written by
-.An Dave Boyce Aq dave@abyss.demon.co.uk .
-.Pp
-This manpage was written by
-.An Hellmuth Michaelis Aq hm@FreeBSD.org .
-.Sh BUGS
-Layer 1 persistent deactivation not yet implemented.
diff --git a/usr.sbin/mergemaster/mergemaster.sh b/usr.sbin/mergemaster/mergemaster.sh
index e21d466..91d964e 100755
--- a/usr.sbin/mergemaster/mergemaster.sh
+++ b/usr.sbin/mergemaster/mergemaster.sh
@@ -670,7 +670,7 @@ CONFIRMED_UMASK=${NEW_UMASK:-0022}
#
# Warn users who still have old rc files
#
-for file in atm devfs diskless1 diskless2 isdn network network6 pccard \
+for file in atm devfs diskless1 diskless2 network network6 pccard \
serial syscons sysctl alpha amd64 i386 ia64 sparc64; do
if [ -f "${DESTDIR}/etc/rc.${file}" ]; then
OLD_RC_PRESENT=1
@@ -696,7 +696,7 @@ case "${OLD_RC_PRESENT}" in
[nN]*) ;;
*)
mkdir -p /var/tmp/mergemaster/old_rc
- for file in atm devfs diskless1 diskless2 isdn network network6 pccard \
+ for file in atm devfs diskless1 diskless2 network network6 pccard \
serial syscons sysctl alpha amd64 i386 ia64 sparc64; do
if [ -f "${DESTDIR}/etc/rc.${file}" ]; then
mv ${DESTDIR}/etc/rc.${file} /var/tmp/mergemaster/old_rc/
diff --git a/usr.sbin/ppp/Makefile b/usr.sbin/ppp/Makefile
index ea8a462..e8ae0e3 100644
--- a/usr.sbin/ppp/Makefile
+++ b/usr.sbin/ppp/Makefile
@@ -15,7 +15,6 @@ WARNS?= 3
CFLAGS+=-DRELEASE_CRUNCH
PPP_NO_ATM=
PPP_NO_DES=
-PPP_NO_I4B=
PPP_NO_KLDLOAD=
PPP_NO_NAT=
PPP_NO_PAM=
@@ -26,9 +25,6 @@ PPP_NO_SUID=
.if ${MK_ATM} == "no"
PPP_NO_ATM=
.endif
-.if ${MK_I4B} == "no"
-PPP_NO_I4B=
-.endif
.if ${MK_PAM_SUPPORT} == "no"
PPP_NO_PAM=
.endif
@@ -101,12 +97,6 @@ LDADD+= -lradius
DPADD+= ${LIBRADIUS}
.endif
-.if defined(PPP_NO_I4B) || ${MACHINE_ARCH} != "i386"
-CFLAGS+=-DNOI4B
-.else
-SRCS+= i4b.c
-.endif
-
.if defined(PPP_NO_NETGRAPH)
CFLAGS+=-DNONETGRAPH
.else
diff --git a/usr.sbin/ppp/i4b.c b/usr.sbin/ppp/i4b.c
deleted file mode 100644
index f079625..0000000
--- a/usr.sbin/ppp/i4b.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/*-
- * Copyright (c) 1999 Brian Somers <brian@Awfulhak.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.
- *
- * $FreeBSD$
- */
-
-#include <sys/param.h>
-
-#include <sys/un.h>
-#if defined(__OpenBSD__) || defined(__NetBSD__)
-#include <sys/ioctl.h>
-#endif
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#ifdef __NetBSD__
-#include <netisdn/i4b_ioctl.h>
-#include <netisdn/i4b_rbch_ioctl.h>
-#else
-#include <i4b/i4b_ioctl.h>
-#include <i4b/i4b_rbch_ioctl.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysexits.h>
-#include <sys/uio.h>
-#include <termios.h>
-#include <unistd.h>
-
-#include "layer.h"
-#include "defs.h"
-#include "mbuf.h"
-#include "log.h"
-#include "timer.h"
-#include "lqr.h"
-#include "hdlc.h"
-#include "throughput.h"
-#include "fsm.h"
-#include "lcp.h"
-#include "ccp.h"
-#include "link.h"
-#include "async.h"
-#include "descriptor.h"
-#include "physical.h"
-#include "mp.h"
-#include "chat.h"
-#include "auth.h"
-#include "chap.h"
-#include "cbcp.h"
-#include "datalink.h"
-#include "main.h"
-#include "i4b.h"
-
-#define Online(dev) ((dev)->mbits & TIOCM_CD)
-
-struct i4bdevice {
- struct device dev; /* What struct physical knows about */
- struct pppTimer Timer; /* CD checks */
- int mbits; /* Current DCD status */
- int carrier_seconds; /* seconds before CD is *required* */
-};
-
-#define device2i4b(d) ((d)->type == I4B_DEVICE ? (struct i4bdevice *)d : NULL)
-
-unsigned
-i4b_DeviceSize(void)
-{
- return sizeof(struct i4bdevice);
-}
-
-/*
- * i4b_Timeout() watches the DCD signal and mentions it if it's status
- * changes.
- */
-static void
-i4b_Timeout(void *data)
-{
- struct physical *p = data;
- struct i4bdevice *dev = device2i4b(p->handler);
- int ombits, change;
-
- timer_Stop(&dev->Timer);
- dev->Timer.load = SECTICKS; /* Once a second please */
- timer_Start(&dev->Timer);
- ombits = dev->mbits;
-
- if (p->fd >= 0) {
- if (ioctl(p->fd, TIOCMGET, &dev->mbits) < 0) {
- log_Printf(LogPHASE, "%s: ioctl error (%s)!\n", p->link.name,
- strerror(errno));
- datalink_Down(p->dl, CLOSE_NORMAL);
- timer_Stop(&dev->Timer);
- return;
- }
- } else
- dev->mbits = 0;
-
- if (ombits == -1) {
- /* First time looking for carrier */
- if (Online(dev))
- log_Printf(LogPHASE, "%s: %s: CD detected\n", p->link.name, p->name.full);
- else if (++dev->carrier_seconds >= dev->dev.cd.delay) {
- log_Printf(LogPHASE, "%s: %s: No carrier"
- " (increase ``set cd'' from %d ?)\n",
- p->link.name, p->name.full, dev->dev.cd.delay);
- timer_Stop(&dev->Timer);
- /* i4b_AwaitCarrier() will notice */
- } else {
- /* Keep waiting */
- log_Printf(LogDEBUG, "%s: %s: Still no carrier (%d/%d)\n",
- p->link.name, p->name.full, dev->carrier_seconds,
- dev->dev.cd.delay);
- dev->mbits = -1;
- }
- } else {
- change = ombits ^ dev->mbits;
- if (change & TIOCM_CD) {
- if (dev->mbits & TIOCM_CD)
- log_Printf(LogDEBUG, "%s: offline -> online\n", p->link.name);
- else {
- log_Printf(LogDEBUG, "%s: online -> offline\n", p->link.name);
- log_Printf(LogPHASE, "%s: Carrier lost\n", p->link.name);
- datalink_Down(p->dl, CLOSE_NORMAL);
- timer_Stop(&dev->Timer);
- }
- } else
- log_Printf(LogDEBUG, "%s: Still %sline\n", p->link.name,
- Online(dev) ? "on" : "off");
- }
-}
-
-static void
-i4b_StartTimer(struct physical *p)
-{
- struct i4bdevice *dev = device2i4b(p->handler);
-
- timer_Stop(&dev->Timer);
- dev->Timer.load = SECTICKS;
- dev->Timer.func = i4b_Timeout;
- dev->Timer.name = "i4b CD";
- dev->Timer.arg = p;
- log_Printf(LogDEBUG, "%s: Using i4b_Timeout [%p]\n",
- p->link.name, i4b_Timeout);
- timer_Start(&dev->Timer);
-}
-
-static int
-i4b_AwaitCarrier(struct physical *p)
-{
- struct i4bdevice *dev = device2i4b(p->handler);
-
- if (dev->mbits == -1) {
- if (dev->Timer.state == TIMER_STOPPED) {
- dev->carrier_seconds = 0;
- i4b_StartTimer(p);
- }
- return CARRIER_PENDING; /* Not yet ! */
- }
-
- return Online(dev) ? CARRIER_OK : CARRIER_LOST;
-}
-
-static int
-i4b_Raw(struct physical *p)
-{
- int oldflag;
-
- log_Printf(LogDEBUG, "%s: Entering i4b_Raw\n", p->link.name);
-
- oldflag = fcntl(p->fd, F_GETFL, 0);
- if (oldflag < 0)
- return 0;
- fcntl(p->fd, F_SETFL, oldflag | O_NONBLOCK);
-
- return 1;
-}
-
-static void
-i4b_Offline(struct physical *p)
-{
- struct i4bdevice *dev = device2i4b(p->handler);
-
- if (p->fd >= 0) {
- timer_Stop(&dev->Timer);
- if (Online(dev)) {
- int dummy;
-
- dummy = 1;
- ioctl(p->fd, TIOCCDTR, &dummy);
- }
- }
-}
-
-static void
-i4b_Cooked(struct physical *p)
-{
- int oldflag;
-
- i4b_Offline(p); /* In case of emergency close()s */
-
- if ((oldflag = fcntl(p->fd, F_GETFL, 0)) != -1)
- fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK);
-}
-
-static void
-i4b_StopTimer(struct physical *p)
-{
- struct i4bdevice *dev = device2i4b(p->handler);
-
- timer_Stop(&dev->Timer);
-}
-
-static void
-i4b_Free(struct physical *p)
-{
- struct i4bdevice *dev = device2i4b(p->handler);
-
- i4b_Offline(p); /* In case of emergency close()s */
- free(dev);
-}
-
-static unsigned
-i4b_Speed(struct physical *p)
-{
- struct termios ios;
- unsigned ret;
-
- if (tcgetattr(p->fd, &ios) == -1 ||
- (ret = SpeedToUnsigned(cfgetispeed(&ios))) == 0)
- ret = 64000;
-
- return ret;
-}
-
-static const char *
-i4b_OpenInfo(struct physical *p)
-{
- struct i4bdevice *dev = device2i4b(p->handler);
- static char buf[26];
-
- if (Online(dev))
- snprintf(buf, sizeof buf, "carrier took %ds", dev->carrier_seconds);
- else
- *buf = '\0';
-
- return buf;
-}
-
-static int
-i4b_Slot(struct physical *p)
-{
- struct stat st;
-
- if (fstat(p->fd, &st) == 0)
- return minor(st.st_rdev);
-
- return -1;
-}
-
-static void
-i4b_device2iov(struct device *d, struct iovec *iov, int *niov,
- int maxiov __unused, int *auxfd __unused, int *nauxfd __unused)
-{
- struct i4bdevice *dev = device2i4b(d);
- int sz = physical_MaxDeviceSize();
-
- iov[*niov].iov_base = realloc(d, sz);
- if (iov[*niov].iov_base == NULL) {
- log_Printf(LogALERT, "Failed to allocate memory: %d\n", sz);
- AbortProgram(EX_OSERR);
- }
- iov[*niov].iov_len = sz;
- (*niov)++;
-
- if (dev->Timer.state != TIMER_STOPPED) {
- timer_Stop(&dev->Timer);
- dev->Timer.state = TIMER_RUNNING;
- }
-}
-
-static struct device basei4bdevice = {
- I4B_DEVICE,
- "i4b",
- 0,
- { CD_REQUIRED, DEF_I4BCDDELAY },
- i4b_AwaitCarrier,
- NULL,
- i4b_Raw,
- i4b_Offline,
- i4b_Cooked,
- NULL,
- i4b_StopTimer,
- i4b_Free,
- NULL,
- NULL,
- i4b_device2iov,
- i4b_Speed,
- i4b_OpenInfo,
- i4b_Slot
-};
-
-struct device *
-i4b_iov2device(int type, struct physical *p, struct iovec *iov, int *niov,
- int maxiov __unused, int *auxfd __unused, int *nauxfd __unused)
-{
- if (type == I4B_DEVICE) {
- struct i4bdevice *dev = (struct i4bdevice *)iov[(*niov)++].iov_base;
-
- dev = realloc(dev, sizeof *dev); /* Reduce to the correct size */
- if (dev == NULL) {
- log_Printf(LogALERT, "Failed to allocate memory: %d\n",
- (int)(sizeof *dev));
- AbortProgram(EX_OSERR);
- }
-
- /* Refresh function pointers etc */
- memcpy(&dev->dev, &basei4bdevice, sizeof dev->dev);
-
- physical_SetupStack(p, dev->dev.name, PHYSICAL_NOFORCE);
- if (dev->Timer.state != TIMER_STOPPED) {
- dev->Timer.state = TIMER_STOPPED;
- p->handler = &dev->dev; /* For the benefit of StartTimer */
- i4b_StartTimer(p);
- }
- return &dev->dev;
- }
-
- return NULL;
-}
-
-struct device *
-i4b_Create(struct physical *p)
-{
- struct i4bdevice *dev;
- int oldflag, dial;
- msg_vr_req_t req;
- telno_t number;
-
- if (p->fd < 0 || ioctl(p->fd, I4B_RBCH_VR_REQ, &req))
- /* Don't want this */
- return NULL;
-
- /*
- * We don't bother validating the version.... all versions of i4b that
- * support I4B_RBCH_VR_REQ are fair game :-)
- */
-
- if (*p->name.full == '\0') {
- physical_SetDevice(p, ttyname(p->fd));
- log_Printf(LogDEBUG, "%s: Input is an i4b version %d.%d.%d isdn "
- "device (%s)\n", p->link.name, req.version, req.release,
- req.step, p->name.full);
- dial = 0;
- } else {
- log_Printf(LogDEBUG, "%s: Opened %s (i4b version %d.%d.%d)\n",
- p->link.name, p->name.full, req.version, req.release, req.step);
- dial = 1;
- }
-
- /* We're gonna return an i4bdevice (unless something goes horribly wrong) */
-
- if ((dev = malloc(sizeof *dev)) == NULL) {
- /* Complete failure - parent doesn't continue trying to ``create'' */
- close(p->fd);
- p->fd = -1;
- return NULL;
- }
-
- memcpy(&dev->dev, &basei4bdevice, sizeof dev->dev);
- memset(&dev->Timer, '\0', sizeof dev->Timer);
- dev->mbits = -1;
-
- switch (p->cfg.cd.necessity) {
- case CD_VARIABLE:
- dev->dev.cd.delay = p->cfg.cd.delay;
- break;
- case CD_REQUIRED:
- dev->dev.cd = p->cfg.cd;
- break;
- case CD_NOTREQUIRED:
- log_Printf(LogWARN, "%s: Carrier must be set, using ``set cd %d!''\n",
- p->link.name, dev->dev.cd.delay);
- case CD_DEFAULT:
- break;
- }
-
- oldflag = fcntl(p->fd, F_GETFL, 0);
- if (oldflag < 0) {
- /* Complete failure - parent doesn't continue trying to ``create'' */
-
- log_Printf(LogWARN, "%s: Open: Cannot get physical flags: %s\n",
- p->link.name, strerror(errno));
- i4b_Cooked(p);
- close(p->fd);
- p->fd = -1;
- free(dev);
- return NULL;
- } else
- fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK);
-
- if (dial) {
- strncpy(number, datalink_ChoosePhoneNumber(p->dl), sizeof number - 1);
- number[sizeof number - 1] = '\0';
- if (number[0] == '\0')
- dial = 0;
- }
- if (dial && ioctl(p->fd, I4B_RBCH_DIALOUT, number) == -1) {
- /* Complete failure - parent doesn't continue trying to ``create'' */
-
- log_Printf(LogWARN, "%s: ioctl(I4B_RBCH_DIALOUT): %s\n",
- p->link.name, strerror(errno));
- i4b_Cooked(p);
- close(p->fd);
- p->fd = -1;
- free(dev);
- return NULL;
- }
-
- physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNC);
-
- return &dev->dev;
-}
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c
index a96c1ba..adcd2cf 100644
--- a/usr.sbin/ppp/physical.c
+++ b/usr.sbin/ppp/physical.c
@@ -97,9 +97,6 @@
#include "udp.h"
#include "exec.h"
#include "tty.h"
-#ifndef NOI4B
-#include "i4b.h"
-#endif
#ifndef NONETGRAPH
#include "ether.h"
#include "netgraph.h"
@@ -126,13 +123,6 @@ struct {
int *, int, int *, int *);
unsigned (*DeviceSize)(void);
} devices[] = {
-#ifndef NOI4B
- /*
- * This must come before ``tty'' so that the probe routine is
- * able to identify it as a more specific type of terminal device.
- */
- { i4b_Create, i4b_iov2device, i4b_DeviceSize },
-#endif
{ tty_Create, tty_iov2device, tty_DeviceSize },
#ifndef NONETGRAPH
/*
diff --git a/usr.sbin/ppp/ppp.8.m4 b/usr.sbin/ppp/ppp.8.m4
index 705e366..b42c13c 100644
--- a/usr.sbin/ppp/ppp.8.m4
+++ b/usr.sbin/ppp/ppp.8.m4
@@ -344,13 +344,6 @@ conventional serial device.
UDP connections force
.Nm
into synchronous mode.
-.It Supports PPP over ISDN.
-If
-.Nm
-is given a raw B-channel i4b device to open as a link, it is able to talk
-to the
-.Xr isdnd 8
-daemon to establish an ISDN connection.
.It Supports PPP over Ethernet (rfc 2516).
If
.Nm
@@ -4456,12 +4449,6 @@ for carrier.
.Pp
As ptys do not support the TIOCMGET ioctl, the tty device will switch all
carrier detection off when it detects that the device is a pty.
-.It ISDN (i4b) Devices
-Carrier is checked once per second for 6 seconds.
-If it is not set after
-the sixth second, the connection attempt is considered to have failed and
-the device is closed.
-Carrier is always required for i4b devices.
.It PPPoE (netgraph) Devices
Carrier is checked once per second for 5 seconds.
If it is not set after
@@ -4588,11 +4575,9 @@ This sets the device(s) to which
will talk to the given
.Dq value .
.Pp
-All ISDN and serial device names are expected to begin with
+All serial device names are expected to begin with
.Pa /dev/ .
-ISDN devices are usually called
-.Pa i4brbchX
-and serial devices are usually called
+Serial devices are usually called
.Pa cuaXX .
.Pp
If
@@ -6090,7 +6075,6 @@ ifdef({LOCALRAD},{},{.Xr libradius 3 ,
.Xr getty 8 ,
.Xr inetd 8 ,
.Xr init 8 ,
-.Xr isdnd 8 ,
.Xr named 8 ,
.Xr ping 8 ,
.Xr pppctl 8 ,
OpenPOWER on IntegriCloud