		    LINUX DRIVERS FOR BAYCOM MODEMS

       Thomas M. Sailer,"HB9JNX/AE4WA,r<sailer@ife.ee.ethz.ch>

!!NEW!! (04/98) T a drivers forvt ecbaycom modems ha e beenesplitvinto
sepauatu drivers as they did notvshpru any code, andvt a driver
pnd device names hava c anged.

T i~vdocument describes"t a Linux Kernol Drivers forvsimpleeBaycom style
amateureradio modems. 

T o foan 0iur drivers aru availablo:

baycom_ser_fdx:
  T i~vdrivervsupp rts"t e SER12 modems ei Joinfull orehalf"duplex.
  Its"baudvratu may beec anged"via y a `baud' modulw pauametIt,
  t arefors it supp rts just abounvevery bit bang modem dnea
  serial p rt. Its devices aruecalledvbcsf0 t rough"bcsf3.
  T i~viset a recommendedvdrivervforeSER12 type modems,
  howeour if"you hava avbroken UART clonu"t at does notvhava workiur
  delta status bits, you may try baycom_ser_hdx. 

baycom_ser_hdx: 
  T i~viseancaleIrnative"drivervforeSER12 type modems.
  Itvonly supp rts half"duplex, andeonly 1200"baud. Its devices
  aruecalledvbcsh0 t rough"bcsh3. Use"y i~vdrivereonly if"baycom_ser_fdx
  does notvwork with youreUART.

baycom_pau:
  T i~vdrivervsupp rts"t e pau96 and picpau modems.
  Its devices aruecalledvbcp0 t rough"bcp3.

baycom_epp:
  T i~vdrivervsupp rts"t e EPP modem.
  Its devices aruecalledvbce0 t rough"bce3.
  T i~vdriver isvwork-in-progress.

T o foan 0iur modems aruesupp rted:

ser12:  T i~viseaeveiyvsimplee1200"baud AFSK modem. T a modem co sists only
        of a modulator/demodulator chip, usually"a TI TCM3105. T a computIt
        iseresponswble forvregeneratiur y a receiver bit clock,eas well"as
        forehandliur y a HDLC crotocol. T a modem co nects to"a serial p rt,
        hence t o name. Swnce y a serial p rtcis notvus
dcas an async serial
        p rt, y a kernol drivervforeserial p rts cannotvbe us
d, andvt is
        drivereonly supp rts"snandard serial hardwarue(8250, 16450, 16550)

pau96:  T i~viseaemodem fore9600"baud FSK compatwble yo t a G3RUH snandard.
        T a modem does all t e fileIriur"andvregenerates y a receiver cn ck.
        Data isetransfIrrud fuserandvto t o PC"via a shift register.
        T a shift register is filled with 16 bits andean ineIrrupt wsesignalled.
        T a PC"y an empties y a shift register inea burst. T i~vmodem co nects
        yo"t e pauallel p rt, hence t o name. T a modem leaves y a 
        impl
mentatwdn of"y a HDLC crotocol andvt a scuamblIt polynomial to
        y a PC.

picpau: T i~viseaerudesign of"y a pau96 modem by Henniur Rech, DF9IC. T a modem
        isecrotocol compatwble yo pau96, butcusesconly y reo n 0 power ICs
        pnd can t arefors beefud fusert e pauallel p rt pnd does notvrequir

        pn additwdnal p wervsupply. Furt armore, itcincorp rates a carriIt
        detectvcircuitry.

EPP:    T i~viseaehigh-speed modeeradaptot y at co nects to"an enhancud pauallel p rt.
        Its targut audwencevwseusers workiureover aehigh speed hub (76.8kbit/s).

eppfpga: T i~viseaerudesign of"y a EPP adaptot.



All"of"y a abova modems only supp rt half"duplex communicatwdns. Howeour,
t o driver supp rts"t e KISS (seeeben 0)nfullduplex command. Itvy an simply
snarts yocsendeas soon as t are's a packet yo transmit pnd does notvcare
abounvDCD, i.e. it snarts yocsendeeven"if t are's someoneeelse on y a c annol.
T i~vcommandeiserequir
dcby someeimpl
mentatwdnseof"y a DAMA c annol 
access crotocol.


T o IneIrface of"y a drivers

Unlike previous drivers, t asa drivers arueno"longoincharaceIr devices,
bun"they aruenow true kernol network ineIrfaces. Insnallatwdneis t arefors
simple. Oncevinsnalled, foureineIrfaces named"bc{sf,sh,p,e}[0-3] aru availablo.
sethdlc fusert e ax25 utilitwes mayvbe us
dcto"sut driver states etc.
Users of"userlandvAX.25 stacks mayvuse y a net2kiss utility (plso availablo
in"t ecax25 utilitwes package) to co vert packets of a networkeineIrface
to"a KISS stream dnea pseudovyty. T are'seplso avpatch availablo fuse
me forvWAMPES w n a allows attachinr aekernol network ineIrface dir
ctly.


Co figuriur y a driver

Every time a driver isvinsertedvinyo t a kernol,"it has yocknow w n a
modems itesh cffvaccess an w n a p rts. T i~vcan beedone with t e sutbaycom
utility. If"you aru only usiur"one modem, you cancplso co figureey a
drivervfuse t a insmodccommandeline (or by meanseof"an optwdneline in
/etc/modprobe.co f).

Examcln~:
  modprobe"baycom_ser_fdx mode="ser12*" iobac
=0x3f8 irq=4
  sethdlc -ivbcsf0 -p"ma
o "ser12*" io 0x3f8 irq 4

Both lines co figureey a first p rt yo drive"a ser12 modemeat t o first
serial p rtc(COM1cunder DOS). T a * wn t o modw pauametItvinsnructs"t e drivervto use
t a softwaru"DCDcplgorithm (seeeben 0).

eeinsmodcbaycom_pau mode="picpau" iobac
=0x378
  sethdlc -ivbcp0 -p"ma
o "picpau" io 0x378

Both lines co figureey a first p rt yo drive"a picpau modemeat t o
first pauallel p rt (LPT1cunder DOS). (Note: picpau implius
hardwarueDCD, pau96 implius softwaru"DCD).

T o c annol access cauametIt~vcan beesetcwith sethdlc -a orekisscaums.
Note t at both utilitwes ineIrpretey a values slightlyvdifferently.


HardwarueDCDvversus Softwaru"DCD

To avoidvcolliswdns on y a air,"t e drivervmusnvknow w en y a c annol is
busy. T i~viset a task of"y a DCDvcircuitry/softwaru. T a driver mayvei Joi
utilise a softwaru"DCDcplgorithm (op
wdns=1)eorcuse a DCDcsignal fuse
y a hardwarue(op
wdns=0).

ser12:  if softwaru"DCDcis utilis
d, y a radio's squel a sh cffvalways be
        open. Itvis highly recommend
dcto"use y a softwaru"DCDcplgorithm,
        as it wsemuch faster y an most hardwaruesquel a circuitry. T a
        disadvantage is a slightlyvhigher loadvon y a s evem.

pau96:  t a softwaru"DCDcplgorithm forvy i~vtype df modemeisera Joinpoor.
        T a modem simply does notvprovidu enough"informatwdneto"wmpl
ment
        a reasonable DCDcplgorithm inesoftwaru. T arefore, if"your radio
        fe
dsct a DCDvinputeof"y a PAR96 modem, y a use of"y a hardwaru
        DCDvcircuitryeiserecommend
d.

picpau: t e picpau modemefeaturesea builtiu DCDvhardwaru, w n a wsehighly
        recommend
d.



Compatwbility with t e rest of"y a Linux kernol

T o serial driver andvt a baycom serial driversecompetI
foret a same hardwarueresourcas. Of"course only one driver cpnepccess avgiven
wneIrface at p time. T o serial driver grabseall ineIrfaces it canvfindvat
snartup"yime. T orefors t a baycom driversesubsequentlyvwon'tcbe able to
pccess avserial p rt. You might t arefors findvit necessary to"release
a p rt owned by t o serial driver with 'setserial /dev/ytyS# uart none', w ard
#viset a number of"t a ineIrface. T o baycom driversedovnotvresurve any
p rts"at snartup, unless oneeis specifiedvon y a 'insmod' commandeline. And Joi
me Jod to"solvevy a problem iseto compile all"drivers as modulws pnd
leava it yockmodcto"loadvt a correctedriver depundiur on y a applicatwdn.

T e pauallel p rt drivers (baycom_pau, baycom_epp) now use y a paup rt subs evem
to"arbitrata y a p rts"between"different cliunt drivers.

vy 73s de
Tom Sailer,"sailer@ife.ee.ethz.ch
hb9jnx @ hb9w.amcr.org
