ࡱ;  % !"#${'()*+,-./0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz|}Root Entry "#$%&'()*+,-.24567 ®`VTekstStarWriter 5.0TASK,0,042,0,100,0,10838;175538;100;0;172500;14460;181230;0;0SBX sb Z Standard StarBASICSBX ARSBX AR SBX AR2c%bqq>p3 ObjBFFFE965.)䰱h I1=ԡ|8 SW5HDR./1 ![WW-Standaardalinea-lettertype Paginanummer WW8Num4z0 WW8Num5z0 WW8Num7z0 WW8Num9z0 WW8Num10z0 WW8Num11z0 WW8Num12z0 WW8Num13z0 WW8Num14z0 WW8Num17z0 WW8Num18z0 WW8Num19z0 WW8Num21z0 WW8Num22z0 WW8Num23z0 WW8Num24z0 WW8Num27z0 WW8Num29z0 WW8Num31z0 WW8Num33z0 WW8Num34z0 WW8Num36z0 WW8Num39z0 WW8Num42z0 WW8Num43z0 WW8Num44z0 WW8Num46z0 WW8Num47z0 WW8Num48z0 WW8Num49z0 WW8Num50z0 WW8Num51z0 WW8Num52z0NummeringstekenWW8Num1WW8Num2WW8Num3WW8Num4WW8Num5WW8Num6WW8Num7WW8Num8WW8Num9WW8Num10WW8Num11WW8Num12WW8Num13WW8Num14WW8Num15WW8Num16WW8Num17WW8Num18WW8Num19WW8Num20WW8Num21WW8Num22WW8Num23WW8Num24WW8Num25WW8Num26WW8Num27WW8Num28WW8Num29WW8Num30WW8Num31WW8Num32WW8Num33WW8Num34WW8Num35WW8Num36WW8Num37WW8Num38WW8Num39WW8Num40WW8Num41WW8Num42WW8Num43WW8Num44WW8Num45WW8Num46WW8Num47WW8Num48WW8Num49WW8Num50WW8Num51WW8Num52 Nummering 1 Nummering 2Outline0#Zn"Xn"Xn"Xn"`n"R2$n#.R2%n#.R2&n#.R7'n(.Arial-R7(n(.Arial-R2)n#.hR8*n).Symbol-h RJ+ n#.n"6n"Qn"ln"n"n"n"n"  R8,n).Symbolh R;-n,. Wingdingsh R;.n,. Wingdingsh R8/n).Symbolh R;0n,. Wingdings h R;1n,. Wingdings h R22n#.R23n#.RA4n2.Times New Roman -R85n).Symbol h R76n(.Arial --R17n"R88n).Symbol-h R;9n,. Wingdingsh R;:n,. Wingdingsh R7;n(.Arial-YR2<n#.RI= n"Xn"Xn"Xn"`n"n"n"n"`n" 0R;>n,. Wingdingsh R2?n#.R8@n).Symbol-h R2An#.hR;Bn,. Wingdingsh R2Cn#.R;Dn,. Wingdingsh R;En,. Wingdingsh RIF n"Pn"@n"0n"`n"n"n"n"`n" 0R;Gn,. Wingdingsh RIH n"Pn"@n"0n"`n"n"n"n"`n" 0R2In#.RAJn2.Times New Roman-R2Kn#.0R2Ln#.hR7Mn(.Arial--R8Nn).Symbolh R;On,. Wingdingsh R2Pn#.R;Qn,. Wingdingsh R;Rn,. Wingdingsh R;Sn,. Wingdingsh R8Tn).Symbolh R;Un,. Wingdings h R8Vn).Symbol!h R;Wn,. Wingdings"h RvX  n#.#n#.#6n#.#Qn#.#ln#.#n#.#n#.#n#.#n#.# n#.# RlY  n"#n"#6n"#mn"#2;n"# n"#n"#n"#[>n"# n"# m&"ZSfxDocumentInfo  Jan Evert /1ܠ Jan Evert /1 Jan Evert /1pLinux S-Link driver Info 0 Info 1 Info 2 Info 3 PRO200 Vooronderzoek.dot /1$t_|<44Standard LIBIMBEDDED LIBIMBEDDED SWG, A<  #$%&'()*./0123456789:;<=>?@ABCDGHK  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFQRSTUt0U #'@rX!'@X'@X'@X%'@dX' @ Arial  Symbol WingdingsTimes New Romantimes helveticaTahomatimesboldcourierXXX/XCX]XmXXX'^@1d d d @d d xd XXX"X,X6X@"' @eX$' @ X' @XX' @X'%@XXXS'@X+'$2@NXXXX 7'%@~XX9'&@XX8''@XX'( @ n. . . p#. . %. p#.  . !. . .  . J . ]. . . &. 2. r. . XXX&X9XLXXXdXpX|XXX@'1@=ddddddddd`ddXddddddddd$ddd$dddd  dddS SddXd ddud ddd ddd ddd ddddddXX!X4XGXZXmXXXXXXXXXX+X>A'2@dxdddd<dhdddddhdddxdxdXXX&X2X>XJXVXb5'4@7XX7S;"@eXX8S<&@XX9S=(@XX'?'@ X('@$@2 XR'D@Q X-Sr @h=e8$VP $' '(. . L.  . . . \. . . . l. 0!. #. &. |). @,. /. 1. 4. P7. :. <. ?. 6')42& P"WW-Standaardalinea-lettertypeWW-Standaardalinea-lettertype PaginanummerWW-Standaardalinea-lettertype Paginanummer@ WW8Num4z0 WW8Num4z0 #'!'''%''' ' '' WW8Num5z0 WW8Num5z0 #'!'''%''' ' '' WW8Num7z0 WW8Num7z0' WW8Num9z0 WW8Num9z0' WW8Num10z0 WW8Num10z0' WW8Num11z0 WW8Num11z0' WW8Num12z0 WW8Num12z0' WW8Num13z0 WW8Num13z0' WW8Num14z0 WW8Num14z0' WW8Num17z0 WW8Num17z0' WW8Num18z0 WW8Num18z0' WW8Num19z0 WW8Num19z0 #'!'''%''' ' '' WW8Num21z0 WW8Num21z0' WW8Num22z0 WW8Num22z0' WW8Num23z0 WW8Num23z0' WW8Num24z0 WW8Num24z0 #'!'''%''' ' '' WW8Num27z0 WW8Num27z0' WW8Num29z0 WW8Num29z0' WW8Num31z0 WW8Num31z0' WW8Num33z0 WW8Num33z0' WW8Num34z0 WW8Num34z0' WW8Num36z0 WW8Num36z0' WW8Num39z0 WW8Num39z0' WW8Num42z0 WW8Num42z0 #'!'''%''' ' '' WW8Num43z0 WW8Num43z0' WW8Num44z0 WW8Num44z0' WW8Num46z0 WW8Num46z0' WW8Num47z0 WW8Num47z0' WW8Num48z0 WW8Num48z0' WW8Num49z0 WW8Num49z0' WW8Num50z0 WW8Num50z0' WW8Num51z0 WW8Num51z0' WW8Num52z0 WW8Num52z0'NummeringstekenNummeringstekenKaderKader;7S<8S=9S>> Afbeelding Afbeelding;7S<8S=9S>> OLEOLE@;7S<8S=9S>> Standaard Standaard@ '' $''$+'%7'&9''8'('1@'Kop Standaard Tekstblok''2A'DR'  Tekstblok Standaard Tekstblok "'$+'%7'&9''8'1@'Kop 1 Standaard Standaard@ ''S'$+'(',[)1@'2A'3345'DR' dddKop 2Kop 1 Standaard@',[)1@'3345' Kop 3Kop 1 Standaard@'1@'3345' Kop 4Kop 3 Standaard1@' Kop 5Kop 4 Standaard1@' Kop 6 Standaard Standaard '1@'DR'  Voettekst Standaard Voettekst@('Index StandaardIndex Indexseparator Standaard Standaard$+'%7'1@' Trefwoordenlijst 1 Standaard Standaard$+'%7'1@' Indexkop StandaardIndexseparator$+'%7' Inhoudsopgave 1 Standaard Standaard@('1@'2A' Inhoudsopgave 2 Standaard Standaard@('1@'  Inhoudsopgave 3 Standaard Standaard@('1@'  Inhoudsopgave 4 Standaard Standaard('1@'  Koptekst StandaardKoptekst@$+'('Lijst StandaardLijst$+'%7'1@' WW-Lijst opsom.teken Standaard Standaard(',[) WW8Num42WW-Lijstnummering StandaardWW-Lijstnummering$+'%7',[) WW8Num6WW-Lijstvoortzetting StandaardWW-Lijstvoortzetting1@'  Ondertitel Standaard Standaard$+'2A'(Titel Standaard Ondertitel''S'$+'2A'(WW-Lijst opsom.teken 3 StandaardWW-Lijst opsom.teken 3,[) WW8Num4WW-Lijst opsom.teken 2 StandaardWW-Lijst opsom.teken 3,[) WW8Num5Inhoudsopgave 5 Standaard Standaard('1@' WW-Documentstructuur StandaardWW-Documentstructuur'?'Voorblad Titel StandaardVoorblad Titel' "''$+'%7'&9''8'1@' Voorblad Info Standaard Voorblad Info' "'$+'%7'&9''8'(' 1@' Inhoud Kop Standaard Standaard "''$+'&9''8'(' 1@'2A'45'DR' Paragraaf Standaard Paragraaf "'$+'&9''8'1@'2A' Historiekop Inhoud Kop Paragraaf'2A'1e regel uitspringen Standaard1e regel uitspringen@$+'WW-Platte tekst inspringen 2 StandaardWW-Platte tekst inspringen 2 'WW-Platte tekst inspringen 3 StandaardWW-Platte tekst inspringen 3Horizontale lijn Standaard Tekstblok'2A'@('0Kop inhoudsopgaveKop 1 Standaard@''',[)1@' Opschrift Standaard Opschrift' '2A'code Standaardcode'$+'(' f%5mM+c Ay!Y7oO3 {  } ' , C W<X&{4sFH^Oh+'00 h t 24@+E@R|5ɿ@xq@ÿ Jan Evert  Jan Evert PRO200 Vooronderzoek.dotLinux S-Link driver .)䰱 Tekening StarDraw 5.0SW5HDR./1 !ZZ Frameformat ZeichenformatTextformatvorlage Standaard Kop Tekstblok Kop 1 Kop 2 Kop 3 Kop 4Kop 5Kop 6 Voettekst Index Indexseparator Trefwoordenlijst 1 Indexkop Inhoudsopgave 1 Inhoudsopgave 2 Inhoudsopgave 3 Inhoudsopgave 4KoptekstLijstWW-Lijst opsom.tekenWW-LijstnummeringWW-Lijstvoortzetting( Ondertitel(TitelWW-Lijst opsom.teken 3WW-Lijst opsom.teken 2 Inhoudsopgave 5WW-DocumentstructuurVoorblad Titel Voorblad Info Inhoud Kop Paragraaf Historiekop1e regel uitspringenWW-Platte tekst inspringen 2WW-Platte tekst inspringen 30Horizontale lijn Kop inhoudsopgave OpschriftcodeWW-Standaardalinea-lettertype Paginanummer WW8Num4z0 WW8Num5z0 WW8Num7z0 WW8Num9z0 WW8Num10z0 WW8Num11z0 WW8Num12z0 WW8Num13z0 WW8Num14z0 WW8Num17z0 WW8Num18z0 WW8Num19z0 WW8Num21z0 WW8Num22z0 WW8Num23z0 WW8Num24z0 WW8Num27z0 WW8Num29z0 WW8Num31z0 WW8Num33z0 WW8Num34z0 WW8Num36z0 WW8Num39z0 WW8Num42z0 WW8Num43z0 WW8Num44z0 WW8Num46z0 WW8Num47z0 WW8Num48z0 WW8Num49z0 WW8Num50z0 WW8Num51z0 WW8Num52z0Nummeringsteken Kader Afbeelding OLERoot 84 Object1 85 Standaard  Afbeelding Tabel TekstTekeningY V.Y W.Y X.Y Y.qo'a& GeneralGeneraldNC#,###.00#,###.00SystemNC #,##0.00 CCC#,##0.00 CCCNC$#,##0.--;[RED]-$#,##0.-- $#,##0.---$#,##0.--REDNC$ MM/DD/YYYYMM/DD/YYYY def/SystemNC%MM/DD/YYMM/DD/YY def/SystemNC&NNNNMMMM DD, YYYYNNNNMMMM  DD, YYYYSystemNC' MMM D, YYMMM D, YY def/SystemNC. [HH]:MM:SS.00 [HH ]:MM:SS .00NC3MM/DD/YYYY HH:MM:SS MM/DD/YYYY HH :MM:SS  NCK MMM D, YYYYMMM D, YYYY def/SystemNCL MMMM D, YYYYMMMM  D, YYYY def/SystemNCM NN, MMM D, YYNN, MMM D, YY def/SystemNCNNN, MMMM D, YYYYNN, MMMM  D, YYYY def/SystemNCONNNNMMMM D, YYYYNNNNMMMM  D, YYYY def/SystemNCP D. MMM. YYYYD. MMM. YYYYDIN 5008 (EN 28601)NCQ D. MMMM YYYYD. MMMM  YYYYDIN 5008 (EN 28601)NCRMM-DDMM-DDDIN 5008 (EN 28601)NCSYY-MM-DDYY-MM-DDDIN 5008 (EN 28601)NCT YYYY-MM-DDYYYY-MM-DDDIN 5008 (EN 28601)NCUWWWWNC Standaard StandaarddNC#.##0,00#.##0,00SystemNC #.##0,00 CCC#.##0,00 CCCNCF #.##0,--;[RED]F #.##0,--- F #.##0,--F #.##0,---REDNC DD-MM-JJJJDD-MM-JJJJ def/SystemNCDD-MM-JJDD-MM-JJ def/SystemNCNNNND MMMM JJJJNNNND MMMM  JJJJSystemNCD MMM JJD MMM JJ def/SystemNC [UU]:MM:SS,00 [UU ]:MM:SS ,00NCDD-MM-JJJJ UU:MM:SS DD-MM-JJJJ UU :MM:SS  NC D MMM JJJJD MMM JJJJ def/SystemNC D MMMM JJJJD MMMM  JJJJ def/SystemNC NN D MMM JJNN D MMM JJ def/SystemNCNN D MMMM JJJJNN D MMMM  JJJJ def/SystemNCNNNND MMMM JJJJNNNND MMMM  JJJJ def/SystemNC D. MMM. JJJJD. MMM. JJJJDIN 5008 (EN 28601)NC D. MMMM JJJJD. MMMM  JJJJDIN 5008 (EN 28601)NCMM-DDMM-DDDIN 5008 (EN 28601)NCJJ-MM-DDJJ-MM-DDDIN 5008 (EN 28601)NC JJJJ-MM-DDJJJJ-MM-DDDIN 5008 (EN 28601)NCWWWWNC' GeneralGeneraldNC' #,###.00#,###.00SystemNC('  #,##0.00 CCC#,##0.00 CCCNC)' $#,##0.--;[RED]-$#,##0.-- $#,##0.---$#,##0.--REDNC4'  MM/DD/YYYYMM/DD/YYYY def/SystemNC5' MM/DD/YYMM/DD/YY def/SystemNC6' NNNNMMMM DD, YYYYNNNNMMMM  DD, YYYYSystemNC7'  MMM D, YYMMM D, YY def/SystemNC>'  [HH]:MM:SS.00 [HH ]:MM:SS .00NCC' MM/DD/YYYY HH:MM:SS MM/DD/YYYY HH :MM:SS  NC['  MMM D, YYYYMMM D, YYYY def/SystemNC\'  MMMM D, YYYYMMMM  D, YYYY def/SystemNC]'  NN, MMM D, YYNN, MMM D, YY def/SystemNC^' NN, MMMM D, YYYYNN, MMMM  D, YYYY def/SystemNC_' NNNNMMMM D, YYYYNNNNMMMM  D, YYYY def/SystemNC`'  D. MMM. YYYYD. MMM. YYYYDIN 5008 (EN 28601)NCa'  D. MMMM YYYYD. MMMM  YYYYDIN 5008 (EN 28601)NCb' MM-DDMM-DDDIN 5008 (EN 28601)NCc' YY-MM-DDYY-MM-DDDIN 5008 (EN 28601)NCd'  YYYY-MM-DDYYYY-MM-DDDIN 5008 (EN 28601)NCe' WWWWNCBoeseoePp UU2$:: SAP.AAPd2ddAPddAePr[ HeaderSIAP.zAPdddAPddAPNTLinux S-Link driver v1.1 SPAPdddAd A A@dA @A8 -A0$@TR$SGAPdddAPA@dAN PrD FooterS2AP.@APdddAP ddAPNT[$SPAPdddAd A A@dA @T$SaAPdddAPAd A@dA @A0A PAPd&ShAP.AAPd2ddAPddA PAPd&ZSW5HDR./1 C(517e(Build:4164)(SV517)]DAdresboekadressen!ZZ Frameformat ZeichenformatTextformatvorlage Standaard Kop Tekstblok Kop 1 Kop 2 Kop 3 Kop 4Kop 5Kop 6 Voettekst Index Indexseparator Trefwoordenlijst 1 Indexkop Inhoudsopgave 1 Inhoudsopgave 2 Inhoudsopgave 3 Inhoudsopgave 4KoptekstLijstWW-Lijst opsom.tekenWW-LijstnummeringWW-Lijstvoortzetting( Ondertitel(TitelWW-Lijst opsom.teken 3WW-Lijst opsom.teken 2 Inhoudsopgave 5WW-DocumentstructuurVoorblad Titel Voorblad Info Inhoud Kop Paragraaf Historiekop1e regel uitspringenWW-Platte tekst inspringen 2WW-Platte tekst inspringen 30Horizontale lijn Kop inhoudsopgave OpschriftcodeWW-Standaardalinea-lettertype Paginanummer WW8Num4z0 WW8Num5z0 WW8Num7z0 WW8Num9z0 WW8Num10z0 WW8Num11z0 WW8Num12z0 WW8Num13z0 WW8Num14z0 WW8Num17z0 WW8Num18z0 WW8Num19z0 WW8Num21z0 WW8Num22z0 WW8Num23z0 WW8Num24z0 WW8Num27z0 WW8Num29z0 WW8Num31z0 WW8Num33z0 WW8Num34z0 WW8Num36z0 WW8Num39z0 WW8Num42z0 WW8Num43z0 WW8Num44z0 WW8Num46z0 WW8Num47z0 WW8Num48z0 WW8Num49z0 WW8Num50z0 WW8Num51z0 WW8Num52z0Nummeringsteken Kader Afbeelding OLERoot 84 Object1 85 Standaard  Afbeelding Tabel TekstTekeningd X?1 4 5*j$lsd.dic stardiv.dicY V.Y W.Y X.Y Y.yxTable of ContentsC <#><#><#><#><#><#><#><#><#><#> ) 6FNNT$SA @T$SA @T$SA @T$SA @T$SA @T$SA @T$SA @TYSLDSKA bookman lightAhd A@A @T^S-Link Driver voor LinuxS;A bookman lightAd A @TF$S;A bookman lightAd A @TBDriver Documentation v1.1SAd A @T$SA @T$SA @T$SA @T$SA @T<$J.E. van GrootheestSAd A @T:$NIKHEF, AmsterdamSAd A @T1$May 2000SAd A @T$SA @T$SA @T $iT%)Table of ContentsK T1 Introduction 3T 1.1 Purpose 3T$1.2 Definition of terms 3T"2 General description 4T-"2.1 Assumptions and dependencies 4T$3 Interface description 6T3.1 open and close 6T 3.2 mmap 6T 3.3 select 6T 3.4 ioctl 6T/$3.5 getInfoBlock and freeInfoBlock 6T%4 Functional description 7T.#4.1 Device Driver Framework (DDF) 7T!4.1.1 Initialization 7T#4.1.2 open and release 7T 4.1.3 mmap 7T 4.1.4 poll 7T 4.1.5 ioctl 7T9.4.1.6 Interrupt- and bottom-half entry point 8T&4.2 HardWare Driver (HWD) 8T&4.2.1 PCI identifications 8T(4.2.2 powerUp and powerDown 8T-"4.2.3 startDevice and stopDevice 9T4.2.4 isInterrupt 9T/$4.2.5 enable- and disableInterrupt 9T"4.2.6 handleInterrupt 9T4.3 BUFfer (BUF) 9T1&4.3.1 openBuf, mmapBuf and closeBuf 10T2'4.3.2 getInfoBlock and freeInfoBlock 10T!4.3.3 getDataBuffer 10T$4.3.4 putInfo 10K T' IntroductionSA PTPurposeT;0This document has the purpose to describe the S-Link driver for those who have to write the application making use of it and those who have to maintain the driver. Therefore the goal of this document is to explain how the driver functions, but it is not a manual which describes each interface in detail.T}rIt is expected that the reader understands enough of the Linux kernel internals, so such things are not explained.TDefinition of termsT*$BUF Buffer module of the driverT,$!DDF Linux Device Driver FrameworkT$HWD HardWare DriverTK$@InfoBlock Basic element of communication between driver and userTG$<S-Link a definition of a hardware interface to transfer dataT"SLD Linux S-link DriverTGeneral descriptionT*The S-Link driver is a generic S-Link driver. This means that it provides only basic S-Link communication and error reporting, but nothing more. It is up to the user application to handle the data and control words that have been received and also implement the necessary error handling.T$Figure 1 shows the S-Link driver and the user interfacing with it. For clarity, the linux kernel itself is not shown and interfaces between the driver and the kernel are implicit.T$The user accesses the driver via regular system calls (open and ioctl, for example) and the BUFfer interface. The data, which came in on the S-Link, is retrieved via BUF together with the type of S-Link data and error information.l:RTSAP#APdddAPddA%PNO ObjBFFFE965A  PA  PAPAPA PAHPT<$1The driver itself consists of three parts: DDF, which implements the regular device mechanisms required by Linux, like device registration, interrupt registration and such. Module BUF manages the data buffers between the driver and the user. The HWD module implements the hardware specific device control.T'Assumptions and dependenciesT$bIt is expected of the user that infoblocks are released in the same order that they were retrievedS0APdddA @WW8Num93TEThe user does not change the contents of infoblocks under its controlS0APdddA @WW8Num93T$The driver is written such that it can handle multiple interfaces in one system and that it will also work properly in an SMP system.S0APdddA @WW8Num93T[There is only one real user per interface; the mmap system call will allow only one user to map the complete driver and have access to the buffers. Other users may open the driver and map the management part of the driver, for example to monitor the driver or perform ioctl calls.S0APdddA @WW8Num93ThThe driver makes no assumption about the order of data and contol words that are received on the S-Link.S0APdddA @WW8Num93TWhen there are no free databuffers the driver should not drop data, but halt the S-Link until another buffer has become available.S0APdddA @WW8Num93T Interface descriptionT|$qThis chapter describes the interface between the driver and the user application the way the user experiences it.Topen and closeT$tThe open system call opens the device; it returns the normal file descriptor that is to be used on subsequent calls.TSHClose will release any resources related to this process and the device.TmmapTlaThere are two ways to use the mmap call. The first one will map all memory pages, which are used for buffers etc., in the users memory space. Only one user can do this, otherwise the buffer management will go wrong. The other way to use mmap is to only map the driver management memory. This is useful for monitoring the driver separately from the user.TThe call will return an address that is to be passed to getInfoBlock and freeInfoBlock. An ioctl is provided to get the size of memory that needs to be mapped.TselectTSelect can be used on the device to wait until data is available from the device. It works in the normal way that is expected of select.TioctlTTIThis interface will provide all other functionality, including this list:TZ$Get S-Link down statusS1APPdddA @WW8Num323T_Set/get S-Link return linesS1APPdddA @WW8Num323Tr.Get the size of memory that needs to be mmapedS1APPdddA @WW8Num323TTurn on statistics; this will cause the device to put statistics in the data queue every X*100msec. X is an input parameter with the ioctl. Value 0 for X turns off statistics.S1APPdddA @WW8Num323w[*T)getInfoBlock and freeInfoBlockT^SThe user calls both these functions with the memory address from mmap as parameter.TGetInfoBlock will then return an infoblock with information or NULL if there is no data available. FreeInfoBlock gets as extra parameter an infoblock retrieved with getInfoBlock.T\$QUntil freeInfoBlock has been called, getInfoBlock will return the same infoblock.T!Functional descriptionT(Device Driver Framework (DDF)T$The DDF module is responsible for implementing all interfaces that the kernel expects and/or requires. This entails the normal file operations that any driver needs to implement and the interfaces for handling interrupts, timers and such.T$Of the file operations, only open, release, mmap, ioctl and poll are implemented, as the BUF interface replaces the read and write ones.T$DDF maintains private data for the complete device and passes this to BUF and HWD as needed. The private data is maintained per device, so multiple devices can be used simultaneously.TInitializationTs$hBoth when the driver is build as a module and integrated into the kernel is it necessary to provide an initialization routine. This routine registers the driver with the kernel as a character device and checks which interfaces are present that can be handled by the driver. For each interface a memory page is allocated to keep the private data for the device.T$In the case it is a module, also a cleanup function is needed. This function unregisters the driver and releases the memory pages.wM Topen and releaseTThe open function uses HWD powerupReset to put the interface in a known state and initializes the BUF module. The release function inverts these actions and leaves the interface in an idle state.Tw`These actions are only done in the case the driver is opened (closed) for the first (last) time.3 TmmapTFirst the driver private data is mapped to the users' address space, then the DDF mmap function passes control to the BUF mmap function which does the work of mapping the databuffer and queue memory in the users memory space.TpollT7,If a process wants to know if there is data available from the interface, it uses the select systemcall. This function is the back-end to that. The process is queued on the waitqueue (to be awakened by the interrupt routine) and a mask is returned to the caller indicating if there is data available.TioctlTThe ioctl interface is normally used to offer functionality, which is either not used often, or specific to this device. Also the S-Link driver uses the ioctl interface for such purposes. This is the driver entry point for ioctl system calls.TPEPlease refer to chapter three for a description of the possibilities.T.#The S-Link related calls will be forwarded to HWD and the statistics call is a function of DDF itself. To handle the statistics, a timer is started to handle the timeout. At the timeout the timer is restarted and a flag is set for BUF that causes putInfo to queue the statistics to the user.T1&Interrupt- and bottom-half entry pointTLAThe driver will receive an interrupt from the device when there is a change in its status. Normally in Linux most of the handling is done in the bottom-half, so more interrupts (of other devices) can be handled while most of the processing is done. The DDF-HWD interface has been designed such that this is also possible.T/$In the interrupt routine the events from the device are disabled and the bottom-half is placed in the immediate queue. During the bottom-half, HWD will finish the handling of the interrupt. If HWD indicates that data was queued to the user, DDF wakes up the processes that are waiting for it.T As an interesting option it is possible not to use the bottom-half and do all the work in the interrupt routine. Normally there are no good arguments for this, but since the application of this driver is very specific, it can be allowed to deviate from the regular Linux rules.TNormally, the bottom-half should loop and check if, after handling the interrupt, there are more events present. However, due to the hardware implementation of the INCAA interface this is will only happen in very specific circumstances which are not the normal case, so that is not done here. The problem with the hardware is that it can take the interface up to 1 microsecond to react to changes in its registers.T HardWare Driver (HWD)TThe HWD module implements all the hardware specific functionality. These are used from DDF when, for example, an interrupt has occurred.TIf S-Link datawords are expected, a DMA transfer is started into a buffer from BUF. If there is no databuffer available, a task is queued in the timer queue. This will give the user application some time to handle and free infoblocks. The task will then check if there is a free databuffer available and start a DMA transfer. If there is still no free buffer available, it will queue itself again and again until a buffer becomes available.TujFor S-Link controlwords it is easier. The controlwords are read from the AMCC fifo and queued to the user.TH=Normally controlwords are handled when the S-Link hardware indicates a type change from control to data words. However, the AMCC chip cannot generate an interrupt when there is only a controlword in the fifo. So when controlwords are expected a timer is started to take these from the fifo and queue them to the user.TPCI identificationsT$HWD defines two definitions to be used by DDF for finding and registering the correct device. These two defines are the PCI Vendor and Device Ids.T powerUp and powerDownTThe powerupReset function is to be used only once: when the driver is opened. This will reset all hardware to put it into a defined state.T3(The powerDown function does the reverse.T%startDevice and stopDeviceTE$:These two functions do exactly what you expect them to do.Tc$XStartDevice will check what type of data is waiting in the interface and prepare the hardware such that it will start receiving that data. If there are S-Link data words present, DMA is initialized, if there are control words waiting, those will be handled. After that, the device will be handled through the interrupt and bottom-half routines.TX$MStopDevice will do the opposite and make sure the device is in an idle state.T isInterruptTAs the interrupt line may be shared with other devices, DDF must be able to determine whether an interrupt occured from the interface that it manages. This function from HWD tells it if it was the current interface that generated an interrupt. If the interrupt came from its interface, the events are acknowledged and the interrupts disabled to prevent getting immediately another interrupt.w T'enable- and disableInterruptTXMThese two are used by the DDF to turn all events on and off in the interface.ThandleInterruptTThis is the workhorse function of HWD. It is called, as expected, after an interrupt has occurred to handle it. It returns to DDF an indication if data was queued in the infoblock queue.Te$ZFirst it'll need to determine what the cause of the interrupt was and then act upon those:T$WIf a DMA transfer has finished put the buffer in an infoblock and queue it to the user.S1APPdddA @WW8Num393T,If there's a change in S-Link data type, handle the change by first finishing the previous type and then preparing for the new type. If an error occurred then report that in the infoblock with the data that is forwarded to the user.S1APPdddA @WW8Num393TIn most other error situations an infoblock will be queued to the user describing the problem. The interface is restarted to capture more data.S1APPdddA @WW8Num393T BUFfer (BUF)T$The module BUF implements the interface between HWD and the user. So one part of this module operates in kernel space and the other part in user space.T$BUF delivers the data buffers, which HWD uses to capture data into using DMA and queue it until the user is ready to receive them.T$Data buffers are all the same size, which is configured by the user using the normal Linux configuration mechanisms. The number of data buffers is likewise configurable.Tf[Infoblocks are used to maintain the data that came in over the S-Link as well as secondary information like S-Link status or statistics about the link. BUF will guess the number of infoblocks to be larger than 3.5 times the number of data buffers, since the infoblocks will be used for S-Link data and control words, but not both at the same time.T$ All infoblocks have the same layout with a type indicating the information stored in the block, a message which holds secondary information about the data and a third field which holds either the data directly, or a pointer to a data buffer plus the size of the data.T$BUF uses circular queues for the infoblocks and data buffers, as those can be made interrupt-safe without locking mechanisms. This is necessary since there are no locking mechanisms that can be shared between kernel and user space and are also interrupt safe.T(openBuf, mmapBuf and closeBufTg$\These two functions serve the purpose of initializing and closing down the buffer mechanism.TH$=On open, the necessary pages of memory will be allocated for:TT$infoblock queue,S1APPdddA @WW8Num383TYdata buffer queue andS1APPdddA @WW8Num383T[$the data buffer memory.S1APPdddA @WW8Num383TH$ =And the queues will be initialized to be full of empty items.T MmapBuf makes sure that the necessary pages of memory are visible in the users memory space. Items to be mapped are the infoblock queue, the data buffer queue and the data buffer memory.T)getInfoBlock and freeInfoBlockTA$6These two function together makeup the user interface.TUsing getInfoBlock the user gets an infoblock full of information, unless the queue is empty. In that case it will return NULL and the user should use the select sytem call to wait for data.TAfter handling the data the infoblock is released using freeInfoBlock. In the case it was information using a data buffer, also the data buffer is released.T getDataBufferTzThis is the interface for HWD to get a data buffer to DMA data into. If there are data buffers available, one is returned.TIn the case that there are no data buffers, the function will return without a buffer. HWD will need to check later if there is another buffer available.TputInfoTThis is the input function to the user from HWD. HWD prepares an infoblock to be put in the queue and uses putInfo to queue it.Tf%[If there is no free infoblock available, BUF will panic() and the system needs to be reset.T%If it's time to report statistics, putInfo first checks that there are a data buffer and an infoblock available. If one of these is not present, the statistics are dropped, as S-Link data is more important than statistics. In the case that both are present, a data buffer is allocated and filled with statistics data and an infoblock is prepared. These are then queued to the user to be handled there.T TUser interfaceTThe open, close, mmap, ioctl and select functions are system calls. Check with the documentation supplied with your system for their specifics.T T;0The driver specific interfaces are (from sld.h):T<+1 infoblock_t *getFullInfoBlock( void *privData );T/+$ void freeInfoBlock( void *privData,T@+5 infoblock_t *infoBlock );T T`UNormally th e user will want to make a loop like this to handle the S-Link interface:T +doT +{T"+ infoblock_t *blockPtr;T +T7+, blockPtr = getFullInfoBlock( privDataPtr );T#+ if ( blockPtr == NULL )T + {T+ select( sldFd );T8+- blockPtr = getFullInfoBlock( privDataPtr );T+ } T$+ handleBlock( blockPtr );T)+ freeInfoBlock( privDataPtr );T +}T+while ( TRUE );T TThe handleBlock function is probably best implemented using a switch on the type of the infoblock (blockPtr->type), with the necessary implementations for the intended application and ignoring the rest of the infoblocks.T JGeneric PrinterSGENPRT PostScriptDQtQtd,,lprdefault_queueSGENPRT7 UmfV88.n? .AU&*:PUU=U&zHU@&@&&<Ur&Z4?B& E $ B & E $ B& E $ B'& E $ B4& E $ BA& E $ BN& E $ B[&U $B & U $K B &KE $K BF &8E $8 B~& E $  B& E $  B& E $ B& E $ B&8E $8B&8E $8B"&8E $8BZ& E $ Bg& E $ Bt& E $ B& E $ FU8&V &6FU@ &@8&&B.AU&*:pUU=U&zHU@&@&&3Ur&Z4? B&vBv&& Bc&U% B`& E% Bm&& Bj &U% Bg && Bd &U% Ba& E% Bn& E%  B{& E% !B& E% "B&& #B&U% $B& ES`# %B& ES`# &B& ES`# 'B& ES`# (B& ES`# )B& ES`# *B& E% +B& ES`# ,B& ES`# -B!& ES`# .B"& ES`# /B#& ES`# 0B+$& ES`# 1B8%& E% 2BE&& ES`# 3BR'& ES`# 4B_(& ES`# 5Bl)& ES`# 6FU8&V &6FU@ &@8&&%.AU&*:PUU=U&zHU@&@&&(Ur&Z4? B&v7Bv&&8Bl&$U $49B &E $:B &&;B &U $ <@B& E $ =AB& E $ >BB& E $ ?CB& E $ @DB& E $ AEFU8&V &6FU@ &@8&&3%.AU&*:pUU=U&zHU@&@&&Ur&Z4? B&vBFBv&$U $4CJB&E $DL/B&HE $HEOB%&4E $4FSB0*&&GTB6,&:U $JHVBp/&=E $=IWB0&JE $JJYFU8&V &6FU@ &@8&&8e} #U#?TU#%x .AU&*:PUU=U&zHU@&@&&`Ur&Z4?B&dE $dK]Bd&JE $JL_B&JE $JMaFU8&V &6FU@ &@8&&%VN.AU&*:pUU=U&zHU@&@&&Ur&Z4?B&vNbBv& U $OdB&&PeB& U $QgB & E $ RhB &&SiB &$U $4TmB&E $UoB&&VpB& U $WrB&&XsB&U $ YtB& EPc! ZuB& EPc! [vB& EPc! \wB &EPc!]yB5"&&^zB;$&U $ _{B8&&E $`}BR(& E $ a~FU8&V &6FU@ &@8&&Џ%4.AU&*:PUU=U&zHU@&@&&Ur&Z4?B&vbBv&&cBl&U $'dB&E $eB &'E $'fB &&gB&$U $4hB&E $iB&&jB&U $'kB& E $ lB&&mB&U $'nB$&&oB%&$U $4pB+&&qB-&U $'rB1& E $ sFU8&V &6FU@ &@8&&b%.AU&*:pUU=U&zHU@&@&&¾Ur&Z4?B&'E $'tB'&&uB&$U $4vB9 &4E $4wBm&'E $'xB&AE $AyB&&zB& U ${B&AE $A|B&!&E $}B@#&4E $4~Bt'&&Bb)& U $Bl,&&BZ.& U $Bd1& E $ FU8&V &6FU@ &@8&&к%.AU&*:PUU =U&zHU@&@&&Ur&Z4?B&B&U $ B&4E $4B/& E $ B<&&B* &1U $AB[&&BI&U $ BF&&B4&U $'BK& E $ BX&EPc!Br&4EPc!4B!&EPc!B#&&B%& U $B(&E $B*&E $B-&4E $4FU8&V &6FU@ &@8&&%Y.AU&*:pUU =U&zHU@&@&&lUr&Z4?B&'E $'B'&'E $'BN&&B<&U $ B9 & E $ BF & EPc! BS & EPc! B` & EPc! Bm& E $ Bz&'E $'B&&B&U $ B&E $B&E $B&& B& U $ B&E $ B!&&B#& U $B&& E $ B'&AE $AB-& E $ FU8&V &6FU@ &@8&&o%.AU&*:PUU =U&zHU@&@&&Ur&Z4?B&vBv& U $B& E $ B& E $ B&E $B&E $Bf&E $BL & E $  BY & E $ !Bf &E $"BL &E $#B2 &E $$B&E $%B&E $&B&E $'B&E $(B&E $)B&E $*B|&E $+Bb&E $,BH&E $-B.&E $.B&E $/B& E $ 0B&'E $'3B.& E $ 4FU8&V &6FU@ &@8&&&Zh I1=SfxDocumentInfo  Jan Evert u/1n Jan Evert u/1n uK Info 0 Info 1 Info 2 Info 3 /1.<44Standard LIBIMBEDDED LIBIMBEDDEDSBX sb Z Standard StarBASICSBX ARSBX AR SBX AR2c%bqqOh+'0 h t 1@@J@ T@ T Jan Evert  Jan Evert XOutdevItemPool 1   )     &'()*+,-./06789:;UVWXYZ[\]c !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstt      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefd0p'(@wXXX'@Fijn gearceerdFijn gestippeldXX,XX'@:X' @fX'@X'b@Pijl}}XX'@,X'"@H,XX'@kX'@X @ @ @ @ @ @ @('@J XX'O@WitXX X2'p@!22ddKleurverloop 2, ddXX6'(@YX'"@BMvv(@@SD@x^SI 0 s\ z 46ZBn8x)1̔.<觔B+̄ ޢ40:prf |q]~+H~|WFMbP@aoCē[ȡz6~U{߃XPXtXzXXXXzzh@ggggnnooppggnnggnnXXX8XJB)Q.McylJ`v&<Rh~.DZy+AWm ) I _ u  7 a w  ' = S i    - C w  5 K a w =WGQ PEditEngineItemPool 6f0Y1g*@' Z d"|,StarBatsN-` ` ,StarBatsNK",StarBatsN-,StarBatsNK"pp,StarBatsN-"  ,StarBatsN-" ,StarBatsN-"%%,StarBatsN-"0*0*,StarBatsN- r,StarBats-r,StarBats-r,StarBats-r ,StarBats-r,StarBats-r,StarBats-rpp,StarBats-rXX,StarBats-r@@,StarBats-r(#(#,StarBats- "XX,StarBatsi-",StarBatsi-",StarBatsi-"` ` ,StarBatsi-" ,StarBatsi-",StarBatsi-"hh,StarBatsi-",StarBatsi-",StarBatsi- ",StarBatsN-",StarBatsN-",StarBatsN-"` ` ,StarBatsN-" ,StarBatsN-",StarBatsN-"hh,StarBatsN-",StarBatsN-",StarBatsN-"pp,StarBatsN-XXXX 6' @'@'XX@i( dddxdddxdddxdddxxdddxYXX!X4XGXZ<(@(X (T@,StarBats!"-StarBats!"-StarBats!"-StarBats!"-StarBats!r-StarBatsX!"-StarBatsX!"-!StarBats!"-StarBats!r- StarBatsX!"- StarBats!"- StarBats!r- StarBatsX!"- ,StarBats!"-StarBats!r-StarBatsX!"-StarBats!"-StarBats!r-XXGXXXX+XdXXXXHXXXX,XeXX@'i@6.dddX,dd|d@ddd`  dddhddddddpddd xddd (#ddd% 'ddd0* "ddd ddd ddd ddddddYXX!X4XGXZXmXXXXXXXXXA'j@.ddddd,ddd#dddddXXX&X2X>XJ1'@ /dX+'@//HXX' @M/!'@o/>X'@/>timesX' @ 0hd d &Nd *d d id d  o`d #d XXX"X,X6X@XJXTX^?( @G0'@b0>X'@0>X'@0>X'@0>X'@0>X'@0>X%' @1S' @-1"' @C1' @Y1*TcNs )Hg}PZ6g* "XX,StarBatsN-",StarBatsN-",StarBatsN-"` ` ,StarBatsN-" ,StarBatsN-",StarBatsN-"hh,StarBatsN-",StarBatsN-",StarBatsN-"pp,StarBatsN- (StarBats!"-!''times'd .6q 2w  ATitelTitel@ Ondertitel Ondertitel@AchtergrondobjectenAchtergrondobjecten@ Achtergrond Achtergrond@ Aantekeningen Aantekeningen@ Overzicht 1 Overzicht 1@ Overzicht 2 Overzicht 1 Overzicht 2@ Overzicht 3 Overzicht 2 Overzicht 3@ Overzicht 4 Overzicht 3 Overzicht 4@ Overzicht 5 Overzicht 4 Overzicht 5@ Overzicht 6 Overzicht 5 Overzicht 6@ Overzicht 7 Overzicht 6 Overzicht 7@ Overzicht 8 Overzicht 7 Overzicht 8@ Overzicht 9 Overzicht 8 Overzicht 9@Standaard~LT~Gliederung 1Standaard~LT~Gliederung 1''g*@'A'+'!'''''''''Standaard~LT~Gliederung 2Standaard~LT~Gliederung 1Standaard~LT~Gliederung 2@'A''Standaard~LT~Gliederung 3Standaard~LT~Gliederung 2Standaard~LT~Gliederung 3@'A''Standaard~LT~Gliederung 4Standaard~LT~Gliederung 3Standaard~LT~Gliederung 4@'A''Standaard~LT~Gliederung 5Standaard~LT~Gliederung 4Standaard~LT~Gliederung 5@'A''Standaard~LT~Gliederung 6Standaard~LT~Gliederung 5Standaard~LT~Gliederung 6@'A''Standaard~LT~Gliederung 7Standaard~LT~Gliederung 6Standaard~LT~Gliederung 7@'A''Standaard~LT~Gliederung 8Standaard~LT~Gliederung 7Standaard~LT~Gliederung 8@'A''Standaard~LT~Gliederung 9Standaard~LT~Gliederung 8Standaard~LT~Gliederung 9@' A''Standaard~LT~TitelStandaard~LT~Titel''QQg*+'!'''''''''Standaard~LT~UntertitelStandaard~LT~Untertitel''QQg*@'+'!'''''''''Standaard~LT~NotizenStandaard~LT~Notizen ''!'''''''''Standaard~LT~HintergrundobjekteStandaard~LT~Hintergrundobjekte+;(,,--..Standaard~LT~HintergrundStandaard~LT~Hintergrund'' Standaard Standaard#'''''''''''''''+;(,,--..g* (@' A'1'+'!'''''''''Object zonder vulling StandaardObject zonder vulling'0\(a E~nXBrb DrMd##JoeMn0 /1'/1 /1ODrLy LAYER_LAYOUTDrLy LAYER_BCKGRNDDrLy LAYER_BACKGRNDOBJDrLyLAYER_CONTROLSDrLy!LAYER_MEASURELINESDrMP&JoeMtQDrML DrOb<SVDr&(%DrOb<SVDr&FK_%DrOb<SVDr&,(*JDrOb<SVDr&FK,_*JDrXXgg kStandaard~LT~GliederungDrMPBJoeMQtDrML DrObSVDr&Qt,Standaard~LT~HintergrundQtDrXXgg SStandaard~LT~GliederungDrMP6JoeMQtDrML DrObSVDr&% -7L3&Standaard~LT~Titel% -7L3uxV4B1`#Klikken om de pagina te verplaatsenStandaard~LT~Titel<( (@'DrOb SVDr& 27[Ec(  Standaard~LT~Notizen 27[EcxV4B1v7Klikken om het formaat van de aantekeningen te bewerkenStandaard~LT~Notizen<( (@'DrXXgg [Standaard~LT~GliederungDrPgbJoeMtQDrML8DrMD,DrXX$ Strooifoldergg KStandaard~LT~GliederungDrPgJoeMQtDrML8DrMD,DrObSVDr&/s4gDrObSVDr&:1 3 Standaards:1 3TxV4B1?HWD Standaard<( (@' +'DrObSVDr&/s4)Object zonder vulling/s4DrXXDrObSVDr&wJ /)s7 vDrObSVDr&;k( Standaard;k(`xV4B1KUser applicatie Standaard<( (@' +'DrObSVDr&wJ /))Object zonder vullingwJ /)DrXXDrObSVDr&.%|&0+gDrObSVDr&%'"0) Standaards%'"0)TxV4B1?DDF Standaard<( (@' +'DrObSVDr&.%|&0+)Object zonder vulling.%|&0+DrXXDrObSVDr&2m|J/ Standaard6NINDrObSVDr&#g"DrObSVDr&#)Object zonder vulling#DrObSVDr&m"B Standaardsm"BTxV4B1?BUF Standaard<( (@' +'DrXXDrObSVDr&n2)8)Object zonder vullingn2)8DrObSVDr&4$ Standaard6S#DrCn$DrCn$;xi(#DrObSVDr&q0 Standaardq0xV4B1getFullInfoBlock Standaard<( (@' releaseInfoBlock Standaard<( (@' DrOb@SVDr&r"6) Standaard6ES#S#,1B6'8(0(DrCn$DrCn$;xi?DrObSVDr&.*2 Standaard>.*2xV4B1open Standaard<( (@' close Standaard<( (@' mmap Standaard<( (@' select Standaard<( (@' ioctl Standaard<( (@' DrOb%SVDr&+]' Standaard6* +|& +\!$DrCn$DrCn$;(#xiZDrObSVDr&' * $ Standaard' * $xV4B1lopen Standaard<( (@' close Standaard<( (@' DrOb%SVDr&0 Standaard6*/#+DrCn$DrCn$;(#xiZDrObSVDr&"e& Standaard"e&xV4B1w getDataBuffer Standaard<( (@'  putInfo Standaard<( (@' DrOb%SVDr&'&0 Standaard6*/+(.%(DrCn$DrCn$;(#PFLDrOb SVDr&*$- Standaard*$-xV4B1} PCI vendor ID Standaard<( (@'  PCI device ID Standaard<( (@'  DrOb%SVDr&2*+2 Standaard6* ++ +/L'22DrCn$DrCn$;xiLDrObSVDr&',0z< StandaardE',0z<& xV4B1 powerUp Standaard<( ( @'  powerDown Standaard<( ( @'  isInterrupt Standaard<( ( @'  enableInterrupt Standaard<( ( @' disableInterrupt Standaard<( ( @' handleInterrupt Standaard<( ( @'  startDevice Standaard<( ( @'  stopDevice Standaard<( ( @'  ioctl Standaard<( ( @' DrObSVDr&   Standaardr  SxV4B1> User space Standaard<( (@' ' DrObSVDr& g  Standaardt g UxV4B1@ Kernel space Standaard<( (@' ' DrObSVDr&l67 Standaardul67VxV4B1A S-Link driver Standaard<( (@' ' DrXXgg KStandaard~LT~GliederungDrPg&JoeMQtDrML8DrMD,DrOb<SVDr&% -7L3DrObSVDr& 27[Ec(  Standaard~LT~Notizen 27[EcxxV4B1c$Aantekeningen door klikken toevoegenStandaard~LT~Notizen<( (@'DrXXgg [Standaard~LT~GliederungDrXX0Generic PrinterSGENPRT PostScriptDQtQt d,,lprdefault_queueSGENPRT Root Entry ®`VObjBFFFE965.)䰱CompObj=Ole StarBASICSfxWindowsBSwNumRulesStandardjpersist elements" XSfxDocumentInfo  BasicManager2 4SfxStyleSheets#SummaryInformation( `SwPageStyleSheets$&0StarWriterDocument&?vCompObj>Ole persist elements" SfxDocumentInfo !uStarBASICBasicManager2/4SfxWindows0SfxStyleSheets~AStandard1jSummaryInformation(38StarDrawDocument3$/(