ࡱ; S  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRTUVRoot Entry  !"#$%&'()+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk ®`VTextStarWriter 5.0{:E> SfxDocumentInfo Mike {1P;Mike {1Mike {1D Info 0 Info 1 Info 2 Info 3 {1P; <44Standard LIBIMBEDDED LIBIMBEDDED TASK,0,1,H02,0,100,1,3078;78676;110;0;73173;14971;81477;0;0SW5HDR.0{1!Outline0 #ZSBX sb Z Standard StarBASICSBX ARSBX AR SBX AR2c%bqqSWG, A<  #$%&'()*./0123456789:;<=>?@ABCDGHK  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFQRSTU0%'&@ TimesNewRomanX'@d X' @XA'2*@dxdxdxdXXJJ@!X@dP' TimesNewRoman$' '(. . p. @ . . . . . P. . . !. $. `'. 0*. -. /. 2. p5. @8. ;. =. @. 6')(0]2O yStandardStandard@ Text bodyStandard Text body2A'List Text bodyList'CaptionStandardCaption'' '2A'JJIndexStandardIndex'JJ <|Oh+'0 h t 6@@Q:@ϣ@5{У@2Mike Mike SW5HDR.0{1! Frameformat ZeichenformatTextformatvorlageStandard Text bodyListCaption IndexRoot 9Standard  Illustration Table TextDrawingY  .Y  .Y  .Y  .q= 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)NCUWWWWNCBXoePp 2$99 SAAP/=APdddAPddSAAP/=APdddAPddZSW5HDR.0{1C(569a(Build:5169)(SV569)]D!Address Book Fileaddress! Frameformat ZeichenformatTextformatvorlageStandard Text bodyListCaption IndexRoot 9Standard  Illustration Table TextDrawingd1 4 5*jK standard.dic soffice.dicZsun.dic@ IgnoreAllListY  .Y  .Y  .Y  .6NgT>Interrupt Handling DetailsSA A @T$SA A @ThDDriver hooks into the interrupt chain associated with a hardware IRQSA A @T$SA A @T1 rc = request_irq(ia_dev->irq, (void *)ia_intr,SA A @A81d A81CourierTA SA_INTERRUPT | SA_SHIRQ, "ia5515", softc);S?ACourierAd A A @TJS?ACourierA(d A A @TJS?ACourierAd A A @T6Parameters includeSA A @T$SA A @T\ The irq number (a small integer)S1APdddA A @TVThe address of the handlerS1APdddA A @TAFlagsS1APdddA A @Ti-SA_INTERRUPT -> Run with interrupts disabledS1APdddA A @TY Should be "fast" handlersS1APdddA A @Tg+SA_SHIRQ -> Allow other drivers to share S1APdddA A @Tc'Should be used for level triggered INTsS1APdddA A @T<S1APdddA A @T\ Device name for /proc/interruptsS1APdddA A @T\ Data to be passed to the hander.S1APdddA A @T<S1APdddA A @TQ/proc filesystem dataS1APdddA A @T<S1APdddA A @T&class/888/s02 ==> cat /proc/interruptsSWAPdddACourierAd A A @T! CPU0 CPU1 SWAPdddACourierAd A A @T1 0: 12185650 12483786 IO-APIC-edge timerSWAPdddACourierAd A A @T4 1: 71355 71976 IO-APIC-edge keyboardSWAPdddACourierAd A A @T3 2: 0 0 XT-PIC cascadeSWAPdddACourierAd A A @T2 3: 4 1 IO-APIC-edge serialSWAPdddACourierAd A A @T2 4: 24166 24646 IO-APIC-edge serialSWAPdddACourierAd A A @T6 12: 647142 645987 IO-APIC-edge PS/2 MouseSWAPdddACourierAd A A @T0 14: 984631 985746 IO-APIC-edge ide0SWAPdddACourierAd A A @T0 15: 2 3 IO-APIC-edge ide1SWAPdddACourierAd A A @T8 16: 9485305 9027081 IO-APIC-level eth0, nvidiaSWAPdddACourierAd A A @T2 17: 9050496 9050560 IO-APIC-level ia5575SWAPdddACourierAd A A @T2 18: 755803 757009 IO-APIC-level cs46xxSWAPdddACourierAd A A @T4 19: 0 0 IO-APIC-level usb-uhciSWAPdddACourierAd A A @T}NMI: 0 0 SWAPdddACourierAd A A @T}LOC: 24667330 24667313 SWAPdddACourierAd A A @TqERR: 0SWAPdddACourierAd A A @T<S1APdddA A @TG Values are:S1APdddA A @TF IRQ numberS1APdddA A @Tc'Interrupt counts since boot on each cpuS1APdddA A @TXInterrupt hardware interfaceS1APdddA A @T\ Device name(s) from register_irqS1APdddA A @T<S1APdddA A @TFS;APdddA PA A @T;Interrupt handlers of the fast type should complete quicklyS1APdddA A @A8 A8 ;TFS;APdddA  A A @Tk%For network devices it is common for S;APdddA  A A @TFS;APdddA  A A @Tk%Some work to need to be done quickly S;APdddA  A A @T]Schedule a DMA transferS;APdddA  A A @TFS;APdddA  A A @Tq+Other work to require a fair amount of timeS;APdddA  A A @To)Push a received packet up the input stackS;APdddA  A A @TFS;APdddA  A A @TS Bottom HalvesS;APdddA  A A @TFS;APdddA  A A @TCFor this reason processing was historically organized as two layersS;APdddA  A A @TFS;APdddA  A A @Tu/Top half - done immediately with ints disabledS;APdddA  A A @Tp*Bottom half - run later with ints enabled.S;APdddA  A A @TFS;APdddA  A A @THThe scheduling of the bottom half was the responsibility of the top halfS;APdddA  A A @TFS;APdddA  A A @TbProblems with bottom halves:S;APdddA  A A @TFS;APdddA  A A @TAMust be predefined when kernel is built.. not dynamically createdS;APdddA  A A @TaA maximum of 32 could existS;APdddA  A A @Tp*This precluded modules using bottom halvesS;APdddA  A A @TFS;APdddA  A A @TBHowever, the task queue hack effectively nullified this limitationS;APdddA  A A @TFS;APdddA  A A @TDTaskletsS1APdddA A @T<S1APdddA A @Tx<A more general mechanism for Top/Half Bottom half separationS1APdddA A @T<S1APdddA A @TJ PropertiesS'APdddA @A8 T<S1APdddA A @Tu9Scheduling is idempotent (schedule many times / run once)S1APdddA A @T<S1APdddA A @To3-> No tasklet will ever run in parallel with itselfS1APdddA A @T<S1APdddA A @Tl0Run on the SAME cpu on which they were scheduledS1APdddA A @T<S1APdddA A @Tk/-> Tasklet won't start until top half completesS1APdddA A @T<S1APdddA A @T<S1APdddA A @TXManaging tasklets:S;APdddA PA A @TSSHAPdddACourierA A @T\For each tasklet you create you will need to add a tasklet structure to the softc structure:SDAPdddA TimesNewRomanA @TOSDAPdddA TimesNewRomanA @Ty&struct tasklet_struct host_rx_tasklet;SHAPdddACourierA A @TOSDAPdddA TimesNewRomanA @T?Before you can use a tasklet you must initialize it as follows:SDAPdddA TimesNewRomanA @TOSDAPdddA TimesNewRomanA @TNtasklet_init(&softc->host_rx_tasklet, ia_host_rx_intr, (unsigned long)softc);SHAPdddACourierA A @TSSHAPdddACourierA A @TThe first parameter points to the tasklet structure being initialized, the second to the function to be run as a tasklet, and the third is a parameter to be passed to the function. SDAPdddA TimesNewRomanA @TOSDAPdddA TimesNewRomanA @T2You may see the following function in a reference:SDAPdddA TimesNewRomanA @TOSDAPdddA TimesNewRomanA @T{(tasklet_enable(&softc->host_rx_tasklet);SHAPdddACourierA A @TOSDAPdddA TimesNewRomanA @TJThis function decrements a counter which must be 0 for the tasklet to run.S'APdddA @A!8J TimesNewRomanTw(The counter is set to 0 by tasklet init!SDAPdddA TimesNewRomanA @T2S'APdddA @Ty*To schedule a tasklet function simply callSDAPdddA TimesNewRomanA @TOSDAPdddA TimesNewRomanA @T~+tasklet_schedule(&softc->host_rx_tasklet); SHAPdddACourierA A @TOSDAPdddA TimesNewRomanA @TGpassing it a pointer to the tasklet structure and not to the function!!SDAPdddA TimesNewRomanA @A8 2GTYSNAPdddA TimesNewRomanA  A @TYAt device driver unload time it is advisable to ensure no tasklets are still running via:SNAPdddA TimesNewRomanA  A @TYSNAPdddA TimesNewRomanA  A @T&tasklet_kill(&softc->host_rx_tasklet);SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @TiYou may also useSNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @T* tasklet_disable(&softc->host_rx_tasklet);S]APdddA TimesNewRomanAd A A @A8*CourierTYSNAPdddA TimesNewRomanA A @T/which increments the counter referred to above.SNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @T0Tasklet implementation issues on the 5515 driverSXAPdddA PA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @T?Use a single tasklet or one tasklet for each interrupt functionSNAPdddA TimesNewRomanA A @A8 (,TYSNAPdddA TimesNewRomanA A @Thpacket completeSNAPdddA TimesNewRomanA A @Tf host completeSNAPdddA TimesNewRomanA A @Tjtransmit completeSNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @TUExisting handler checks for all conditions now and so could a single tasklet approachS_APdddA TimesNewRomanA A @A@. TjS_APdddA TimesNewRomanA A @A@. TKMultiple tasklets might obtain slightly better performance on an MP system.S_APdddA TimesNewRomanA A @A@. TESingle tasklet would incur less scheduling overhead on both UP and MPS_APdddA TimesNewRomanA A @A@. TqSingle tasklet would be exposed to fewer race conditions and mutex requirements and thus would be boring to writeS_APdddA TimesNewRomanA A @A@. T"Therefore we use multiple taskletsS_APdddA TimesNewRomanA A @A@. TjS_APdddA TimesNewRomanA A @A@. T#Conveying state data to the taskletS_APdddA TimesNewRomanA A @A@. TjS_APdddA TimesNewRomanA A @A@. TQInterrupt must read ffred/rfred interrupt status registers to clear the interruptS_APdddA TimesNewRomanA A @A@. A8  A8 QT)Failure to do so ==> instant system crashSiAPdddA TimesNewRomanA  A A @A@. T.Simply reading the registers resets them to 0!SiAPdddA TimesNewRomanA  A A @A@. A8 TFrfred tasklet must have the status data to process interrupt correctlySiAPdddA TimesNewRomanA  A A @A@. A8 T@Multiple interrupts may happen before the tasklet actually runs.SiAPdddA TimesNewRomanA  A A @A@. TtSiAPdddA TimesNewRomanA  A A @A@. T|SolutionSiAPdddA TimesNewRomanA  A A @A@. T)Use a software queue for rfred state dataS8APdddpA @A@. A8A8 A!8 TimesNewRomanTia_intr producesSiAP^ddd@ A TimesNewRomanA  A A @A@. Ttasket consumesSiAP^ddd@ A TimesNewRomanA  A A @A@. TtSiAP^ddd@ A TimesNewRomanA  A A @A@. T.New race conditions and requirements for mutexSiAPdddA TimesNewRomanA  A A @A@. TtSiAPdddA TimesNewRomanA  A A @A@. T>Host interrupt handler calls the packet recieved handling codeS_APdddA TimesNewRomanA A @A@. TjS_APdddA TimesNewRomanA A @A@. T@ /* This code is included to reduce latency in handling ready */SNAPdddA TimesNewRomanA A @A8@A8 @A8@d A8@CourierT?/* packets and to defend against the possiblity of a lost */SaAPdddACourierAd A  A A @T?/* interrupt for a ready packet. */SaAPdddACourierAd A  A A @TlSaAPdddACourierAd A  A A @T. state = ia_get32 (&rf->state_reg) & 0xffff;SaAPdddACourierAd A  A A @T! while (!(state & R_PCQ_EMPTY))SaAPdddACourierAd A  A A @Tp {SaAPdddACourierAd A  A A @T. if (ia_proc_rcv_pkt (softc) == IA_FAIL)SaAPdddACourierAd A  A A @T| break;SaAPdddACourierAd A  A A @T2 state = ia_get32 (&rf->state_reg) & 0xffff;SaAPdddACourierAd A  A A @Tp }SaAPdddACourierAd A  A A @TjS_APdddA TimesNewRomanA A @A@. TtSiAPdddA PA TimesNewRomanA A @A@. TThus with the multi-tasklet approach the pkt complete tasklet and the host interrupt tasklet could be running the same code at the same time!!S_APdddA TimesNewRomanA A @A@. TjS_APdddA TimesNewRomanA A @A@. T<The spinlock, softc->recvlock, must be used to provide mutexSaAPdddACourierAd A  A A @A8<d A!8< TimesNewRomanT^SSAPdddA TimesNewRomanAd A @TwA crude approach could acquire the lock at the entry to ia_proc_rcv_pkt and be sure to release it at every exit point. SdAPdddA TimesNewRomanAd A @A@. A8 LSA8 SwTySnAPdddA TimesNewRomanAd A  A @A@. TfA cleaner approach involves moving all the rx_queue code out of ia_proc_rcv_pkt and into ia_setup_dma SnAPdddA TimesNewRomanAd A  A @A@. TySnAPdddA TimesNewRomanAd A  A @A@. T if (!softc->rx_buf_free)SaAPdddACourierAd A  A A @Ts {SaAPdddACourierAd A  A A @T? printk("IA 5515: rx_buf_free is null.packet dropped \n");SaAPdddACourierAd A  A A @T) softc->rfred_stat.rx_no_host_buf++;SaAPdddACourierAd A  A A @T2 ia_free_desc(softc, desc, (ia_rx_buf_t *)0);SaAPdddACourierAd A  A A @T return IA_FAIL;SaAPdddACourierAd A  A A @T }SrAPdddACourierAd A  A A @A@. T}SrAPdddACourierAd A  A A @A@. T :SrAPdddACourierAd A  A A @A@. T :SrAPdddACourierAd A  A A @A@. T}SrAPdddACourierAd A  A A @A@. T( softc->rx_buf_free->desc = desc;SrAPdddACourierAd A  A A @A@. A8(A8 (A8(d A8(CourierTCS8APdddA @A@. TInstances of the type:SrAPdddACourierAd A  A A @A@. A8d A!8 TimesNewRomanTSxAPdddA TimesNewRomanAd A  A A @A@. TIs resource x availableSxAPdddA TimesNewRomanAd A  A A @A@. TJI claim resource x and access it ONLY through a local (NOT softc) pointer SxAPdddA TimesNewRomanAd A  A A @A@. TSxAPdddA TimesNewRomanAd A  A A @A@. T=Should be as tight as possible and surrounded by spinlocks. SxAPdddA TimesNewRomanAd A  A A @A@. TSxAPdddA TimesNewRomanAd A  A A @A@. TTesting SxAPdddA TimesNewRomanAd A  A A @A@. TSxAPdddA TimesNewRomanAd A  A A @A@. T-Testing of code such as this is difficult! S8APdddA @A@. A8-A8 -A8-d A!8- TimesNewRomanTKSerious flaws may hide behind even successful tests of ssh / telnet / ftp. SxAPdddA TimesNewRomanAd A  A A @A@. TSxAPdddA TimesNewRomanAd A  A A @A@. TpSurvival of multiple instances of ping -f for an hour or so is usually a good indicator of long term survival.SxAPdddA TimesNewRomanAd A  A A @A@. TSxAPdddA TimesNewRomanAd A  A A @A@. TESurvival also depends on system configuration (in easy to hard order)SxAPdddA TimesNewRomanAd A  A A @A@. TSxAPdddA TimesNewRomanAd A  A A @A@. T*UP running UP kernel (spinlock is a no-op)SxAPdddpA TimesNewRomanAd A  A A @A@. T+UP running SMP kernel (spinlock is a lock) SxAPdddpA TimesNewRomanAd A  A A @A@. TIreveals locking errors such as trying to lock a lock that is already heldSxAP^ddd@ A TimesNewRomanAd A  A A @A@. TSMP running an SMP kernel... SxAPdddpA TimesNewRomanAd A  A A @A@. T.All manner of latent bugs come gushing forth!SxAP^ddd@ A TimesNewRomanAd A  A A @A@. A8 'A  'T SxAP^ddd@ A TimesNewRomanAd A  A A @A@. A8 TSxAPdddA TimesNewRomanAd A  A A @A@. T SAPdd,dA TimesNewRomanAd A  A A @A@. . JLexmark Optra T614 Laser PrinterLOPT614 PostScript`Tl`Tld,,lp -d lwnlwnLOPT614PageSize:LetterDuplex:NoneDuplexer:FalseInputSlot:AutoSelectMediaType:NoneTray2:FalseTray3:FalseTray4:FalseTray5:FalseMPFeeder:TrueFeeder:FalseImageEnhance:TrueResolution:600dpiSmoothing:False7 UzsV88/9?s/=U!2P  UU!2?/B!B!B,! B9! BF! BS!B!&B7!B!  B!  B ! E  B ! E  B) ! E  B6 ! E  BC ! E  BP! E  B]! E Bj! E Bw! E B! E B! E B! B! E B!EBv!EB4!EB!EB!EBn!EB,!EB!EB!E Bf!E!B$!E"B!E#B!E$B^ !E%B!!E&B!!E'B"!E(BV#! E )Bc$! *Bp%! E +B}&! E ,B'! E -B(! E .B)! E />/=U!2p  U!2?+B! E 0B ! 1B! 2B'! 3B4! 4BA! E 5BN! E  6B[! E 7Bh! E 8Bu ! E  9B ! E :B !;B !<B ! =B! >B! E ?B! E @@B! E AAB! E BBB ! E CCB! DDB#! EEB0! E FFB=! E GGBJ! E HHBW! E IIBd! E JJBq! E KKB~!LLB!MMB! NNB ! OOB!! PPB"! E QQB#! E RRB$! E SSB%! E  TTB'! E UUB(! E VVB)! E WWB,*! E  XXB9+! E YYBF,! ZZ>}/=U!2P  U!2?%B![[B!\\B! ]]B! ^^B!E__B! ``B! aaB! bbB!EcdB !deB !egB ! fhB ! giB! hjB !EikB! jlB! E kmB ! E lnB! moB$! npB1! oqB>!EprB"! qsB/! rtB<!suBD! tvBQ! uwB^!EvxBB!EwyB&!xzB ! y{B!! z|B$"! E {}B1#! |~B>$! E }BK%! E ~BX&! Ц%/=U!2p  …U!2?,B!B!B,! B9! E BF! E BS! E B`! E Bm! E Bz!EB ! E B ! E B ! E B !EB! E B! E B! B! B ! E B! E B#! E B0! E B=! E BJ! E BW! E Bd! E2 Bq! E^b B~! E^b B! E^b B! B ! B!! E B"!EB#!EB$!EB%!EBg&!EB%'!EB'!EB(!EB_)!EB*!EB*!EB+!EBW,! E %/=U!2P  U!2?.B! E B !EB'! E B4! E BA! E BN!EBh! E Bu !EB ! B !EBZ !B!EB!EB!EBR!EB!EB!EB!EBJ!EB!EB!B!EBB! E BO! E  B\! E  Bi! E  Bv! E B! E B! E B!B!EB! E B ! E B!! E B"!EB %! E B&! E B$'! E B1(! E2 B>)! E2 BK*!E^bBe,! E2 Br-! E^b B.! E^b B/! E B0! E lZRoot Entry ®`VCompObj<Ole persist elements" SfxDocumentInfo uBasicManager2 4StarBASIC SfxWindows@SwNumRulesUStandardjSfxStyleSheetsSummaryInformation( *0SwPageStyleSheets$ /StarWriterDocument&z