aboutsummaryrefslogtreecommitdiffstats
BranchCommit messageAuthorAge
archive/unc-master-3.0P-FP: fix BUG_ON releated to priority inheritanceBjoern Brandenburg13 years
archived-2013.1uncachedev: mmap memory that is not cached by CPUsGlenn Elliott12 years
archived-private-masterMerge branch 'wip-2.6.34' into old-private-masterAndrea Bastoni15 years
archived-semi-partMerge branch 'wip-semi-part' of ssh://cvs/cvs/proj/litmus/repo/litmus2010 int...Andrea Bastoni15 years
demoFurther refinementsJonathan Herman14 years
ecrts-pgm-finalMerge branch 'wip-ecrts14-pgm' of ssh://rtsrv.cs.unc.edu/home/litmus/litmus-r...Glenn Elliott12 years
ecrts14-pgm-finalMerge branch 'wip-ecrts14-pgm' of ssh://rtsrv.cs.unc.edu/home/litmus/litmus-r...Glenn Elliott12 years
gpusync-rtss12Final GPUSync implementation.Glenn Elliott12 years
gpusync/stagingRename IKGLP R2DGLP.Glenn Elliott12 years
linux-tipMerge branch 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/p...Linus Torvalds15 years
litmus2008-patch-seriesadd i386 feather-trace implementationBjoern B. Brandenburg16 years
masterPSN-EDF: use inferred_sporadic_job_release_atBjoern Brandenburg9 years
pgmmake it compileGlenn Elliott12 years
prop/litmus-signalsInfrastructure for Litmus signals.Glenn Elliott13 years
prop/robust-tie-breakFixed bug in edf_higher_prio().Glenn Elliott13 years
stagingFix tracepoint compilation errorFelipe Cerqueira13 years
test9/23/2016Namhoon Kim9 years
tracing-develTest kernel tracing events capabilitiesAndrea Bastoni16 years
v2.6.34-with-arm-patchessmsc911x: Add spinlocks around registers accessCatalin Marinas15 years
v2015.1Add ARM syscall def for get_current_budgetBjoern Brandenburg10 years
wip-2011.2-bbbLitmus core: simplify np-section protocolBjoern B. Brandenburg14 years
wip-2011.2-bbb-traceRefactor sched_trace_log_message() -> debug_trace_log_message()Andrea Bastoni14 years
wip-2012.3-gpuSOBLIV draining support for C-EDF.Glenn Elliott12 years
wip-2012.3-gpu-preportpick up last C-RM fileGlenn Elliott12 years
wip-2012.3-gpu-rtss13Fix critical bug in GPU tracker.Glenn Elliott12 years
wip-2012.3-gpu-sobliv-budget-w-ksharkProper sobliv draining and many bug fixes.Glenn Elliott12 years
wip-aedzl-finalMake it easier to compile AEDZL interfaces in liblitmus.Glenn Elliott15 years
wip-aedzl-revisedAdd sched_trace data for Apative EDZLGlenn Elliott15 years
wip-arbit-deadlineFix compilation bug.Glenn Elliott13 years
wip-aux-tasksDescription of refined aux task inheritance.Glenn Elliott13 years
wip-bbbGSN-EDF & Core: improve debug TRACE'ing for NP sectionsBjoern B. Brandenburg14 years
wip-bbb-prio-donuse correct timestampBjoern B. Brandenburg14 years
wip-better-breakImplement hash-based EDF tie-breaking.Glenn Elliott13 years
wip-binary-heapMake C-EDF work with simplified binheap_deleteGlenn Elliott13 years
wip-budgetAdded support for choices in budget policy enforcement.Glenn Elliott15 years
wip-colorSummarize schedulability with final recordJonathan Herman13 years
wip-color-jlhsched_color: Fixed two bugs causing crashing on experiment restart and a rare...Jonathan Herman13 years
wip-d10-hz1000Enable HZ=1000 on District 10Bjoern B. Brandenburg15 years
wip-default-clusteringFeature: Make default C-EDF clustering compile-time configurable.Glenn Elliott15 years
wip-dissipation-jericksoUpdate from 2.6.36 to 2.6.36.4Jeremy Erickson11 years
wip-dissipation2-jericksoUpdate 2.6.36 to 2.6.36.4Jeremy Erickson11 years
wip-ecrts14-pgmMerge branch 'wip-ecrts14-pgm' of ssh://rtsrv.cs.unc.edu/home/litmus/litmus-r...Glenn Elliott12 years
wip-edf-hsblast tested versionJonathan Herman14 years
wip-edf-osLookup table EDF-osJeremy Erickson12 years
wip-edf-tie-breakMerge branch 'wip-edf-tie-break' of ssh://rtsrv.cs.unc.edu/home/litmus/litmus...Glenn Elliott13 years
wip-edzl-critiqueUse hr_timer's active checks instead of having own flag.Glenn Elliott15 years
wip-edzl-finalImplementation of the EDZL scheduler.Glenn Elliott15 years
wip-edzl-revisedClean up comments.Glenn Elliott15 years
wip-eventsAdded support for tracing arbitrary actions.Jonathan Herman15 years
wip-extra-debugDBG: add additional tracingBjoern B. Brandenburg15 years
wip-fix-switch-jericksoAttempt to fix race condition with plugin switchingJeremy Erickson15 years
wip-fix3sched: show length of runqueue clock deactivation in /proc/sched_debugBjoern B. Brandenburg15 years
wip-fmlp-dequeueImprove FMLP queue management.Glenn Elliott14 years
wip-ft-irq-flagFeather-Trace: keep track of interrupt-related interference.Bjoern B. Brandenburg14 years
wip-gpu-cleanupEnable sched_trace log injection from userspaceGlenn Elliott13 years
wip-gpu-interruptsRemove option for threading of all softirqs.Glenn Elliott14 years
wip-gpu-rtas12Generalized GPU cost predictors + EWMA. (untested)Glenn Elliott13 years
wip-gpu-rtss12Final GPUSync implementation.Glenn Elliott13 years
wip-gpu-rtss12-srpexperimental changes to support GPUs under SRPGlenn Elliott13 years
wip-gpusync-mergeCleanup priority tracking for budget enforcement.Glenn Elliott11 years
wip-ikglpMove RSM and IKGLP imp. to own .c filesGlenn Elliott13 years
wip-k-fmlpMerge branch 'mpi-master' into wip-k-fmlpGlenn Elliott14 years
wip-kernel-coloringAdded recolor syscallNamhoon Kim7 years
wip-kernthreadsKludge work-queue processing into klitirqd.Glenn Elliott15 years
wip-klmirqd-to-auxAllow klmirqd threads to be given names.Glenn Elliott13 years
wip-ksharkMerge branch 'mpi-staging' into wip-ksharkJonathan Herman13 years
wip-litmus-3.2Merge commit 'v3.2' into litmus-stagingAndrea Bastoni13 years
wip-litmus2011.2Cleanup: Coding conformance for affinity stuff.Glenn Elliott14 years
wip-litmus3.0-2011.2Feather-Trace: keep track of interrupt-related interference.Bjoern B. Brandenburg14 years
wip-master-2.6.33-rtAvoid deadlock when switching task policy to BACKGROUND (ugly)Andrea Bastoni15 years
wip-mcRemoved ARM-specific hacks which disabled less common mixed-criticality featu...Jonathan Herman12 years
wip-mc-bipasaMC-EDF addedbipasa chattopadhyay13 years
wip-mc-jericksoSplit C/D queuesJeremy Erickson15 years
wip-mc2-cache-slackManually patched mc^2 related codeMing Yang10 years
wip-mcrit-maccosmeticMac Mollison15 years
wip-merge-3.0Prevent Linux to send IPI and queue tasks on remote CPUs.Andrea Bastoni14 years
wip-merge-v3.0Prevent Linux to send IPI and queue tasks on remote CPUs.Andrea Bastoni14 years
wip-migration-affinityNULL affinity dereference in C-EDF.Glenn Elliott14 years
wip-mmap-uncacheshare branch with othersGlenn Elliott13 years
wip-modechangeRTSS 2017 submissionNamhoon Kim8 years
wip-nested-lockingAppears to be working.Bryan Ward12 years
wip-omlp-gedfFirst implementation of G-OMLP.Glenn Elliott15 years
wip-paiSome cleanup of PAIGlenn Elliott14 years
wip-percore-lib9/21/2016Namhoon Kim9 years
wip-performanceCONFIG_DONT_PREEMPT_ON_TIE: Don't preeempt a scheduled task on priority tie.Glenn Elliott14 years
wip-pgmAdd PGM support to C-FLGlenn Elliott12 years
wip-pgm-splitFirst draft of C-FL-splitNamhoon Kim12 years
wip-pm-ovdAdd preemption-and-migration overhead tracing supportAndrea Bastoni15 years
wip-prio-inhP-EDF updated to use the generic pi framework.Glenn Elliott15 years
wip-prioq-dglBUG FIX: Support DGLs with PRIOQ_MUTEXGlenn Elliott13 years
wip-refactored-gedfGeneralizd architecture for GEDF-style scheduelrs to reduce code redundancy.Glenn Elliott15 years
wip-release-master-fixbugfix: release master CPU must signal task was pickedBjoern B. Brandenburg14 years
wip-robust-tie-breakEDF priority tie-breaks.Glenn Elliott13 years
wip-rt-ksharkMove task time accounting into the complete_job method.Jonathan Herman13 years
wip-rtas12-pgmScheduling of PGM jobs.Glenn Elliott13 years
wip-semi-partFix compile error with newer GCCJeremy Erickson12 years
wip-semi-part-edfos-jericksoUse initial CPU set by clientJeremy Erickson12 years
wip-shared-libTODO: Fix condition checks in replicate_page_move_mapping()Namhoon Kim9 years
wip-shared-lib2RTAS 2017 Submission ver.Namhoon Kim9 years
wip-shared-memInitial commit for shared libraryNamhoon Kim9 years
wip-splitting-jericksoFix release behaviorJeremy Erickson13 years
wip-splitting-omlp-jericksoBjoern's Dissertation Code with Priority DonationJeremy Erickson13 years
wip-stage-binheapAn efficient binary heap implementation.Glenn Elliott13 years
wip-sun-portDynamic memory allocation and clean exit for FeatherTraceChristopher Kenna15 years
wip-timer-tracebugfix: C-EDF, clear scheduled field of the correct CPU upon task_exitAndrea Bastoni15 years
wip-tracepointsAdd kernel-style events for sched_trace_XXX() functionsAndrea Bastoni14 years
 
TagDownloadAuthorAge
2015.1commit 8e51b37822...Bjoern Brandenburg10 years
2013.1commit bcaacec1ca...Glenn Elliott12 years
2012.3commit c158b5fbe4...Jonathan Herman13 years
2012.2commit b53c479a0f...Glenn Elliott13 years
2012.1commit 83b11ea1c6...Bjoern B. Brandenburg14 years
rtas12-mc-beta-expcommit 8e236ee20f...Christopher Kenna14 years
2011.1commit d11808b5c6...Christopher Kenna15 years
v2.6.37-rc4commit e8a7e48bb2...Linus Torvalds15 years
v2.6.37-rc3commit 3561d43fd2...Linus Torvalds15 years
v2.6.37-rc2commit e53beacd23...Linus Torvalds15 years
v2.6.37-rc1commit c8ddb2713c...Linus Torvalds15 years
v2.6.36commit f6f94e2ab1...Linus Torvalds15 years
2010.2commit 5c5456402d...Bjoern B. Brandenburg15 years
v2.6.36-rc8commit cd07202cc8...Linus Torvalds15 years
v2.6.36-rc7commit cb655d0f3d...Linus Torvalds15 years
v2.6.36-rc6commit 899611ee7d...Linus Torvalds15 years
v2.6.36-rc5commit b30a3f6257...Linus Torvalds15 years
v2.6.36-rc4commit 49553c2ef8...Linus Torvalds15 years
v2.6.36-rc3commit 2bfc96a127...Linus Torvalds15 years
v2.6.36-rc2commit 76be97c1fc...Linus Torvalds15 years
v2.6.36-rc1commit da5cabf80e...Linus Torvalds15 years
v2.6.35commit 9fe6206f40...Linus Torvalds15 years
v2.6.35-rc6commit b37fa16e78...Linus Torvalds15 years
v2.6.35-rc5commit 1c5474a65b...Linus Torvalds15 years
v2.6.35-rc4commit 815c4163b6...Linus Torvalds15 years
v2.6.35-rc3commit 7e27d6e778...Linus Torvalds15 years
v2.6.35-rc2commit e44a21b726...Linus Torvalds15 years
v2.6.35-rc1commit 67a3e12b05...Linus Torvalds15 years
2010.1commit 7c1ff4c544...Andrea Bastoni15 years
v2.6.34commit e40152ee1e...Linus Torvalds15 years
v2.6.33.4commit 4640b4e7d9...Greg Kroah-Hartman15 years
v2.6.34-rc7commit b57f95a382...Linus Torvalds15 years
v2.6.34-rc6commit 66f41d4c5c...Linus Torvalds15 years
v2.6.33.3commit 3e7ad8ed97...Greg Kroah-Hartman15 years
v2.6.34-rc5commit 01bf0b6457...Linus Torvalds15 years
v2.6.34-rc4commit 0d0fb0f9c5...Linus Torvalds15 years
v2.6.33.2commit 19f00f070c...Greg Kroah-Hartman15 years
v2.6.34-rc3commit 2eaa9cfdf3...Linus Torvalds15 years
v2.6.34-rc2commit 220bf991b0...Linus Torvalds15 years
v2.6.33.1commit dbdafe5ccf...Greg Kroah-Hartman15 years
v2.6.34-rc1commit 57d54889cd...Linus Torvalds16 years
v2.6.33commit 60b341b778...Linus Torvalds16 years
v2.6.33-rc8commit 724e6d3fe8...Linus Torvalds16 years
v2.6.33-rc7commit 29275254ca...Linus Torvalds16 years
v2.6.33-rc6commit abe94c756c...Linus Torvalds16 years
v2.6.33-rc5commit 92dcffb916...Linus Torvalds16 years
v2.6.33-rc4commit 7284ce6c9f...Linus Torvalds16 years
v2.6.33-rc3commit 74d2e4f8d7...Linus Torvalds16 years
v2.6.33-rc2commit 6b7b284958...Linus Torvalds16 years
v2.6.33-rc1commit 55639353a0...Linus Torvalds16 years
v2.6.32commit 22763c5cf3...Linus Torvalds16 years
v2.6.32-rc8commit 648f4e3e50...Linus Torvalds16 years
v2.6.32-rc7commit 156171c71a...Linus Torvalds16 years
v2.6.32-rc6commit b419148e56...Linus Torvalds16 years
v2.6.32-rc5commit 012abeea66...Linus Torvalds16 years
v2.6.32-rc4commit 161291396e...Linus Torvalds16 years
v2.6.32-rc3commit 374576a8b6...Linus Torvalds16 years
v2.6.32-rc1commit 17d857be64...Linus Torvalds16 years
v2.6.32-rc2commit 17d857be64...Linus Torvalds16 years
v2.6.31commit 74fca6a428...Linus Torvalds16 years
v2.6.31-rc9commit e07cccf404...Linus Torvalds16 years
v2.6.31-rc8commit 326ba5010a...Linus Torvalds16 years
v2.6.31-rc7commit 422bef879e...Linus Torvalds16 years
v2.6.31-rc6commit 64f1607ffb...Linus Torvalds16 years
v2.6.31-rc5commit ed680c4ad4...Linus Torvalds16 years
v2.6.31-rc4commit 4be3bd7849...Linus Torvalds16 years
v2.6.31-rc3commit 6847e154e3...Linus Torvalds16 years
v2.6.31-rc2commit 8e4a718ff3...Linus Torvalds16 years
v2.6.31-rc1commit 28d0325ce6...Linus Torvalds16 years
v2.6.30commit 07a2039b8e...Linus Torvalds16 years
v2.6.30-rc8commit 9fa7eb283c...Linus Torvalds16 years
v2.6.30-rc7commit 59a3759d0f...Linus Torvalds16 years
v2.6.30-rc6commit 1406de8e11...Linus Torvalds16 years
v2.6.30-rc5commit 091bf7624d...Linus Torvalds16 years
v2.6.30-rc4commit 091438dd56...Linus Torvalds16 years
v2.6.30-rc3commit 0910697403...Linus Torvalds16 years
v2.6.30-rc2commit 0882e8dd3a...Linus Torvalds16 years
v2.6.30-rc1commit 577c9c456f...Linus Torvalds16 years
v2.6.29commit 8e0ee43bc2...Linus Torvalds16 years
v2.6.29-rc8commit 041b62374c...Linus Torvalds17 years
v2.6.29-rc7commit fec6c6fec3...Linus Torvalds17 years
v2.6.29-rc6commit 20f4d6c3a2...Linus Torvalds17 years
v2.6.29-rc5commit d2f8d7ee1a...Linus Torvalds17 years
v2.6.29-rc4commit 8e4921515c...Linus Torvalds17 years
v2.6.29-rc3commit 18e352e4a7...Linus Torvalds17 years
v2.6.29-rc2commit 1de9e8e70f...Linus Torvalds17 years
v2.6.29-rc1commit c59765042f...Linus Torvalds17 years
v2.6.28commit 4a6908a3a0...Linus Torvalds17 years
v2.6.28-rc9commit 929096fe9f...Linus Torvalds17 years
v2.6.28-rc8commit 8b1fae4e42...Linus Torvalds17 years
v2.6.28-rc7commit 061e41fdb5...Linus Torvalds17 years
v2.6.28-rc6commit 13d428afc0...Linus Torvalds17 years
v2.6.28-rc5commit 9bf1a2445f...Linus Torvalds17 years
v2.6.28-rc4commit f7160c7573...Linus Torvalds17 years
v2.6.28-rc3commit 45beca08dd...Linus Torvalds17 years
v2.6.28-rc2commit 0173a3265b...Linus Torvalds17 years
v2.6.28-rc1commit 57f8f7b60d...Linus Torvalds17 years
v2.6.27commit 3fa8749e58...Linus Torvalds17 years
v2.6.27-rc9commit 4330ed8ed4...Linus Torvalds17 years
v2.6.27-rc8commit 94aca1dac6...Linus Torvalds17 years
v2.6.27-rc7commit 72d31053f6...Linus Torvalds17 years
v2.6.27-rc6commit adee14b2e1...Linus Torvalds17 years
v2.6.27-rc5commit 24342c34a0...Linus Torvalds17 years
v2.6.27-rc4commit 6a55617ed5...Linus Torvalds17 years
v2.6.27-rc3commit 30a2f3c60a...Linus Torvalds17 years
v2.6.27-rc2commit 0967d61ea0...Linus Torvalds17 years
v2.6.27-rc1commit 6e86841d05...Linus Torvalds17 years
v2.6.26commit bce7f793da...Linus Torvalds17 years
v2.6.26-rc9commit b7279469d6...Linus Torvalds17 years
v2.6.26-rc8commit 543cf4cb3f...Linus Torvalds17 years
v2.6.26-rc7commit d70ac829b7...Linus Torvalds17 years
v2.6.26-rc6commit 5dd34572ad...Linus Torvalds17 years
v2.6.26-rc5commit 53c8ba9540...Linus Torvalds17 years
v2.6.26-rc4commit e490517a03...Linus Torvalds17 years
v2.6.26-rc3commit b8291ad07a...Linus Torvalds17 years
v2.6.26-rc2commit 492c2e476e...Linus Torvalds17 years
v2.6.26-rc1commit 2ddcca36c8...Linus Torvalds17 years
v2.6.25commit 4b119e21d0...Linus Torvalds17 years
v2.6.25-rc9commit 120dd64cac...Linus Torvalds17 years
v2.6.25-rc8commit 0e81a8ae37...Linus Torvalds17 years
v2.6.25-rc7commit 05dda977f2...Linus Torvalds17 years
v2.6.25-rc6commit a978b30af3...Linus Torvalds17 years
v2.6.25-rc5commit cdeeeae056...Linus Torvalds18 years
v2.6.25-rc4commit 29e8c3c304...Linus Torvalds18 years
v2.6.25-rc3commit bfa274e243...Linus Torvalds18 years
v2.6.25-rc2commit 101142c37b...Linus Torvalds18 years
v2.6.25-rc1commit 19af35546d...Linus Torvalds18 years
v2.6.24commit 49914084e7...Linus Torvalds18 years
v2.6.24-rc8commit cbd9c88369...Linus Torvalds18 years
v2.6.24-rc7commit 3ce5445046...Linus Torvalds18 years
v2.6.24-rc6commit ea67db4cdb...Linus Torvalds18 years
v2.6.24-rc5commit 82d29bf6dc...Linus Torvalds18 years
v2.6.24-rc4commit 09b56adc98...Linus Torvalds18 years
v2.6.24-rc3commit d9f8bcbf67...Linus Torvalds18 years
v2.6.24-rc2commit dbeeb816e8...Linus Torvalds18 years
v2.6.24-rc1commit c9927c2bf4...Linus Torvalds18 years
v2.6.23commit bbf25010f1...Linus Torvalds18 years
v2.6.23-rc9commit 3146b39c18...Linus Torvalds18 years
v2.6.23-rc8commit 4942de4a0e...Linus Torvalds18 years
v2.6.23-rc7commit 81cfe79b9c...Linus Torvalds18 years
v2.6.23-rc6commit 0d4cbb5e7f...Linus Torvalds18 years
v2.6.23-rc5commit 40ffbfad6b...Linus Torvalds18 years
v2.6.23-rc4commit b07d68b5ca...Linus Torvalds18 years
v2.6.23-rc3commit 39d3520c92...Linus Torvalds18 years
v2.6.23-rc2commit d4ac2477fa...Linus Torvalds18 years
v2.6.23-rc1commit f695baf2df...Linus Torvalds18 years
v2.6.22commit 7dcca30a32...Linus Torvalds18 years
v2.6.22-rc7commit a38d6181ff...Linus Torvalds18 years
v2.6.22-rc6commit 189548642c...Linus Torvalds18 years
v2.6.22-rc5commit 188e1f81ba...Linus Torvalds18 years
v2.6.22-rc4commit 5ecd3100e6...Linus Torvalds18 years
v2.6.22-rc3commit c420bc9f09...Linus Torvalds18 years
v2.6.22-rc2commit 55b637c6a0...Linus Torvalds18 years
v2.6.22-rc1commit 39403865d2...Linus Torvalds18 years
v2.6.21commit de46c33745...Linus Torvalds18 years
v2.6.21-rc7commit 94a05509a9...Linus Torvalds18 years
v2.6.21-rc6commit a21bd69e15...Linus Torvalds18 years
v2.6.21-rc5commit e0f2e3a06b...Linus Torvalds18 years
v2.6.21-rc4commit db98e0b434...Linus Torvalds18 years
v2.6.21-rc3commit 08e15e81a4...Linus Torvalds19 years
v2.6.21-rc2commit 606135a308...Linus Torvalds19 years
v2.6.21-rc1commit c8f71b01a5...Linus Torvalds19 years
v2.6.20commit 62d0cfcb27...Linus Torvalds19 years
v2.6.20-rc7commit f56df2f4db...Linus Torvalds19 years
v2.6.20-rc6commit 99abfeafb5...Linus Torvalds19 years
v2.6.20-rc5commit a8b3485287...Linus Torvalds19 years
v2.6.20-rc4commit bf81b46482...Linus Torvalds19 years
v2.6.20-rc3commit 669df1b478...Linus Torvalds19 years
v2.6.20-rc2commit 3bf8ba38f3...Linus Torvalds19 years
v2.6.20-rc1commit cc016448b0...Linus Torvalds19 years
v2.6.19commit 0215ffb08c...Linus Torvalds19 years
v2.6.19-rc6commit 44597f65f6...Linus Torvalds19 years
v2.6.19-rc5commit 80c2188127...Linus Torvalds19 years
v2.6.19-rc4commit ae99a78af3...Linus Torvalds19 years
v2.6.19-rc3commit 7059abedd2...Linus Torvalds19 years
v2.6.19-rc2commit b4bd8c6643...Linus Torvalds19 years
v2.6.19-rc1commit d223a60106...Linus Torvalds19 years
v2.6.18commit e478bec0ba...Linus Torvalds19 years
v2.6.18-rc7commit 95064a75eb...Linus Torvalds19 years
v2.6.18-rc6commit c336923b66...Linus Torvalds19 years
v2.6.18-rc5commit 60d4684068...Linus Torvalds19 years
v2.6.18-rc4commit 9f737633e6...Linus Torvalds19 years
v2.6.18-rc3commit b6ff50833a...Linus Torvalds19 years
v2.6.18-rc2commit 82d6897fef...Linus Torvalds19 years
v2.6.18-rc1commit 120bda20c6...Linus Torvalds19 years
v2.6.17commit 427abfa28a...Linus Torvalds19 years
v2.6.17-rc6commit 1def630a6a...Linus Torvalds19 years
v2.6.17-rc5commit a8bd60705a...Linus Torvalds19 years
v2.6.17-rc4commit d8c3291c73...Linus Torvalds19 years
v2.6.17-rc3commit 2be4d50295...Linus Torvalds19 years
v2.6.17-rc2commit 8bbde0e6d5...Linus Torvalds19 years
v2.6.17-rc1commit 6246b6128b...Linus Torvalds19 years
v2.6.16commit 7705a8792b...Linus Torvalds19 years
v2.6.16-rc6commit 535744878e...Linus Torvalds20 years
v2.6.16-rc5commit b9a33cebac...Linus Torvalds20 years
v2.6.16-rc4commit bd71c2b174...Linus Torvalds20 years
v2.6.16-rc3commit e9bb4c9929...Linus Torvalds20 years
v2.6.16-rc2commit 826eeb53a6...Linus Torvalds20 years
v2.6.16-rc1commit 2664b25051...Linus Torvalds20 years
v2.6.15commit 88026842b0...Linus Torvalds20 years
v2.6.15-rc7commit f89f5948fc...Linus Torvalds20 years
v2.6.15-rc6commit df7addbb45...Linus Torvalds20 years
v2.6.15-rc5commit 436b0f76f2...Linus Torvalds20 years
v2.6.15-rc4commit 5666c0947e...Linus Torvalds20 years
v2.6.15-rc3commit 624f54be20...Linus Torvalds20 years
v2.6.15-rc2commit 3bedff1d73...Linus Torvalds20 years
v2.6.15-rc1commit cd52d1ee9a...Linus Torvalds20 years
v2.6.14commit 741b2252a5...Linus Torvalds20 years
v2.6.14-rc5commit 93918e9afc...Linus Torvalds20 years
v2.6.14-rc4commit 907a426179...Linus Torvalds20 years
v2.6.14-rc3commit 1c9426e8a5...Linus Torvalds20 years
v2.6.14-rc2commit 676d55ae30...Linus Torvalds20 years
v2.6.14-rc1commit 2f4ba45a75...Linus Torvalds20 years
v2.6.13commit 02b3e4e2d7...Linus Torvalds20 years
v2.6.13-rc7commit 0572e3da3f...Linus Torvalds20 years
v2.6.13-rc6commit 6fc32179de...Linus Torvalds20 years
v2.6.13-rc5commit 9a351e30d7...Linus Torvalds20 years
v2.6.13-rc4commit 6395352334...Linus Torvalds20 years
v2.6.11tree c39ae07f39...
v2.6.11-treetree c39ae07f39...
v2.6.12commit 9ee1c939d1...
v2.6.12-rc2commit 1da177e4c3...
v2.6.12-rc3commit a2755a80f4...
v2.6.12-rc4commit 88d7bd8cb9...
v2.6.12-rc5commit 2a24ab628a...
v2.6.12-rc6commit 7cef5677ef...
v2.6.13-rc1commit 4c91aedb75...
v2.6.13-rc2commit a18bcb7450...
v2.6.13-rc3commit c32511e271...
class="hl opt">-1;); switch (event) { case CONNECT_REQUEST: IRDA_ASSERT(self->netdev != NULL, return -1;); if (self->media_busy) { /* Note : this will never happen, because we test * media busy in irlap_connect_request() and * postpone the event... - Jean II */ IRDA_DEBUG(0, "%s(), CONNECT_REQUEST: media busy!\n", __func__); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_MEDIA_BUSY); } else { irlap_send_snrm_frame(self, &self->qos_rx); /* Start Final-bit timer */ irlap_start_final_timer(self, self->final_timeout); self->retry_count = 0; irlap_next_state(self, LAP_SETUP); } break; case RECV_SNRM_CMD: /* Check if the frame contains and I field */ if (info) { self->daddr = info->daddr; self->caddr = info->caddr; irlap_next_state(self, LAP_CONN); irlap_connect_indication(self, skb); } else { IRDA_DEBUG(0, "%s(), SNRM frame does not " "contain an I field!\n", __func__); } break; case DISCOVERY_REQUEST: IRDA_ASSERT(info != NULL, return -1;); if (self->media_busy) { IRDA_DEBUG(1, "%s(), DISCOVERY_REQUEST: media busy!\n", __func__); /* irlap->log.condition = MEDIA_BUSY; */ /* This will make IrLMP try again */ irlap_discovery_confirm(self, NULL); /* Note : the discovery log is not cleaned up here, * it will be done in irlap_discovery_request() * Jean II */ return 0; } self->S = info->S; self->s = info->s; irlap_send_discovery_xid_frame(self, info->S, info->s, TRUE, info->discovery); self->frame_sent = FALSE; self->s++; irlap_start_slot_timer(self, self->slot_timeout); irlap_next_state(self, LAP_QUERY); break; case RECV_DISCOVERY_XID_CMD: IRDA_ASSERT(info != NULL, return -1;); /* Assert that this is not the final slot */ if (info->s <= info->S) { self->slot = irlap_generate_rand_time_slot(info->S, info->s); if (self->slot == info->s) { discovery_rsp = irlmp_get_discovery_response(); discovery_rsp->data.daddr = info->daddr; irlap_send_discovery_xid_frame(self, info->S, self->slot, FALSE, discovery_rsp); self->frame_sent = TRUE; } else self->frame_sent = FALSE; /* * Go to reply state until end of discovery to * inhibit our own transmissions. Set the timer * to not stay forever there... Jean II */ irlap_start_query_timer(self, info->S, info->s); irlap_next_state(self, LAP_REPLY); } else { /* This is the final slot. How is it possible ? * This would happen is both discoveries are just slightly * offset (if they are in sync, all packets are lost). * Most often, all the discovery requests will be received * in QUERY state (see my comment there), except for the * last frame that will come here. * The big trouble when it happen is that active discovery * doesn't happen, because nobody answer the discoveries * frame of the other guy, so the log shows up empty. * What should we do ? * Not much. It's too late to answer those discovery frames, * so we just pass the info to IrLMP who will put it in the * log (and post an event). * Another cause would be devices that do discovery much * slower than us, however the latest fixes should minimise * those cases... * Jean II */ IRDA_DEBUG(1, "%s(), Receiving final discovery request, missed the discovery slots :-(\n", __func__); /* Last discovery request -> in the log */ irlap_discovery_indication(self, info->discovery); } break; case MEDIA_BUSY_TIMER_EXPIRED: /* A bunch of events may be postponed because the media is * busy (usually immediately after we close a connection), * or while we are doing discovery (state query/reply). * In all those cases, the media busy flag will be cleared * when it's OK for us to process those postponed events. * This event is not mentioned in the state machines in the * IrLAP spec. It's because they didn't consider Ultra and * postponing connection request is optional. * Jean II */ #ifdef CONFIG_IRDA_ULTRA /* Send any pending Ultra frames if any */ if (!skb_queue_empty(&self->txq_ultra)) { /* We don't send the frame, just post an event. * Also, previously this code was in timer.c... * Jean II */ ret = (*state[self->state])(self, SEND_UI_FRAME, NULL, NULL); } #endif /* CONFIG_IRDA_ULTRA */ /* Check if we should try to connect. * This code was previously in irlap_do_event() */ if (self->connect_pending) { self->connect_pending = FALSE; /* This one *should* not pend in this state, except * if a socket try to connect and immediately * disconnect. - clear - Jean II */ if (self->disconnect_pending) irlap_disconnect_indication(self, LAP_DISC_INDICATION); else ret = (*state[self->state])(self, CONNECT_REQUEST, NULL, NULL); self->disconnect_pending = FALSE; } /* Note : one way to test if this code works well (including * media busy and small busy) is to create a user space * application generating an Ultra packet every 3.05 sec (or * 2.95 sec) and to see how it interact with discovery. * It's fairly easy to check that no packet is lost, that the * packets are postponed during discovery and that after * discovery indication you have a 100ms "gap". * As connection request and Ultra are now processed the same * way, this avoid the tedious job of trying IrLAP connection * in all those cases... * Jean II */ break; #ifdef CONFIG_IRDA_ULTRA case SEND_UI_FRAME: { int i; /* Only allowed to repeat an operation twice */ for (i=0; ((i<2) && (self->media_busy == FALSE)); i++) { skb = skb_dequeue(&self->txq_ultra); if (skb) irlap_send_ui_frame(self, skb, CBROADCAST, CMD_FRAME); else break; /* irlap_send_ui_frame() won't increase skb reference * count, so no dev_kfree_skb() - Jean II */ } if (i == 2) { /* Force us to listen 500 ms again */ irda_device_set_media_busy(self->netdev, TRUE); } break; } case RECV_UI_FRAME: /* Only accept broadcast frames in NDM mode */ if (info->caddr != CBROADCAST) { IRDA_DEBUG(0, "%s(), not a broadcast frame!\n", __func__); } else irlap_unitdata_indication(self, skb); break; #endif /* CONFIG_IRDA_ULTRA */ case RECV_TEST_CMD: /* Remove test frame header */ skb_pull(skb, sizeof(struct test_frame)); /* * Send response. This skb will not be sent out again, and * will only be used to send out the same info as the cmd */ irlap_send_test_frame(self, CBROADCAST, info->daddr, skb); break; case RECV_TEST_RSP: IRDA_DEBUG(0, "%s() not implemented!\n", __func__); break; default: IRDA_DEBUG(2, "%s(), Unknown event %s\n", __func__, irlap_event[event]); ret = -1; break; } return ret; } /* * Function irlap_state_query (event, skb, info) * * QUERY state * */ static int irlap_state_query(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case RECV_DISCOVERY_XID_RSP: IRDA_ASSERT(info != NULL, return -1;); IRDA_ASSERT(info->discovery != NULL, return -1;); IRDA_DEBUG(4, "%s(), daddr=%08x\n", __func__, info->discovery->data.daddr); if (!self->discovery_log) { IRDA_WARNING("%s: discovery log is gone! " "maybe the discovery timeout has been set" " too short?\n", __func__); break; } hashbin_insert(self->discovery_log, (irda_queue_t *) info->discovery, info->discovery->data.daddr, NULL); /* Keep state */ /* irlap_next_state(self, LAP_QUERY); */ break; case RECV_DISCOVERY_XID_CMD: /* Yes, it is possible to receive those frames in this mode. * Note that most often the last discovery request won't * occur here but in NDM state (see my comment there). * What should we do ? * Not much. We are currently performing our own discovery, * therefore we can't answer those frames. We don't want * to change state either. We just pass the info to * IrLMP who will put it in the log (and post an event). * Jean II */ IRDA_ASSERT(info != NULL, return -1;); IRDA_DEBUG(1, "%s(), Receiving discovery request (s = %d) while performing discovery :-(\n", __func__, info->s); /* Last discovery request ? */ if (info->s == 0xff) irlap_discovery_indication(self, info->discovery); break; case SLOT_TIMER_EXPIRED: /* * Wait a little longer if we detect an incoming frame. This * is not mentioned in the spec, but is a good thing to do, * since we want to work even with devices that violate the * timing requirements. */ if (irda_device_is_receiving(self->netdev) && !self->add_wait) { IRDA_DEBUG(2, "%s(), device is slow to answer, " "waiting some more!\n", __func__); irlap_start_slot_timer(self, msecs_to_jiffies(10)); self->add_wait = TRUE; return ret; } self->add_wait = FALSE; if (self->s < self->S) { irlap_send_discovery_xid_frame(self, self->S, self->s, TRUE, self->discovery_cmd); self->s++; irlap_start_slot_timer(self, self->slot_timeout); /* Keep state */ irlap_next_state(self, LAP_QUERY); } else { /* This is the final slot! */ irlap_send_discovery_xid_frame(self, self->S, 0xff, TRUE, self->discovery_cmd); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); /* * We are now finished with the discovery procedure, * so now we must return the results */ irlap_discovery_confirm(self, self->discovery_log); /* IrLMP should now have taken care of the log */ self->discovery_log = NULL; } break; default: IRDA_DEBUG(2, "%s(), Unknown event %s\n", __func__, irlap_event[event]); ret = -1; break; } return ret; } /* * Function irlap_state_reply (self, event, skb, info) * * REPLY, we have received a XID discovery frame from a device and we * are waiting for the right time slot to send a response XID frame * */ static int irlap_state_reply(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { discovery_t *discovery_rsp; int ret=0; IRDA_DEBUG(4, "%s()\n", __func__); IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case QUERY_TIMER_EXPIRED: IRDA_DEBUG(0, "%s(), QUERY_TIMER_EXPIRED <%ld>\n", __func__, jiffies); irlap_next_state(self, LAP_NDM); break; case RECV_DISCOVERY_XID_CMD: IRDA_ASSERT(info != NULL, return -1;); /* Last frame? */ if (info->s == 0xff) { del_timer(&self->query_timer); /* info->log.condition = REMOTE; */ /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_discovery_indication(self, info->discovery); } else { /* If it's our slot, send our reply */ if ((info->s >= self->slot) && (!self->frame_sent)) { discovery_rsp = irlmp_get_discovery_response(); discovery_rsp->data.daddr = info->daddr; irlap_send_discovery_xid_frame(self, info->S, self->slot, FALSE, discovery_rsp); self->frame_sent = TRUE; } /* Readjust our timer to accommodate devices * doing faster or slower discovery than us... * Jean II */ irlap_start_query_timer(self, info->S, info->s); /* Keep state */ //irlap_next_state(self, LAP_REPLY); } break; default: IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __func__, event, irlap_event[event]); ret = -1; break; } return ret; } /* * Function irlap_state_conn (event, skb, info) * * CONN, we have received a SNRM command and is waiting for the upper * layer to accept or refuse connection * */ static int irlap_state_conn(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; IRDA_DEBUG(4, "%s(), event=%s\n", __func__, irlap_event[ event]); IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case CONNECT_RESPONSE: skb_pull(skb, sizeof(struct snrm_frame)); IRDA_ASSERT(self->netdev != NULL, return -1;); irlap_qos_negotiate(self, skb); irlap_initiate_connection_state(self); /* * Applying the parameters now will make sure we change speed * *after* we have sent the next frame */ irlap_apply_connection_parameters(self, FALSE); /* * Sending this frame will force a speed change after it has * been sent (i.e. the frame will be sent at 9600). */ irlap_send_ua_response_frame(self, &self->qos_rx); #if 0 /* * We are allowed to send two frames, but this may increase * the connect latency, so lets not do it for now. */ /* This is full of good intentions, but doesn't work in * practice. * After sending the first UA response, we switch the * dongle to the negotiated speed, which is usually * different than 9600 kb/s. * From there, there is two solutions : * 1) The other end has received the first UA response : * it will set up the connection, move to state LAP_NRM_P, * and will ignore and drop the second UA response. * Actually, it's even worse : the other side will almost * immediately send a RR that will likely collide with the * UA response (depending on negotiated turnaround). * 2) The other end has not received the first UA response, * will stay at 9600 and will never see the second UA response. * Jean II */ irlap_send_ua_response_frame(self, &self->qos_rx); #endif /* * The WD-timer could be set to the duration of the P-timer * for this case, but it is recommended to use twice the * value (note 3 IrLAP p. 60). */ irlap_start_wd_timer(self, self->wd_timeout); irlap_next_state(self, LAP_NRM_S); break; case RECV_DISCOVERY_XID_CMD: IRDA_DEBUG(3, "%s(), event RECV_DISCOVER_XID_CMD!\n", __func__); irlap_next_state(self, LAP_NDM); break; case DISCONNECT_REQUEST: IRDA_DEBUG(0, "%s(), Disconnect request!\n", __func__); irlap_send_dm_frame(self); irlap_next_state( self, LAP_NDM); irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; default: IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __func__, event, irlap_event[event]); ret = -1; break; } return ret; } /* * Function irlap_state_setup (event, skb, frame) * * SETUP state, The local layer has transmitted a SNRM command frame to * a remote peer layer and is awaiting a reply . * */ static int irlap_state_setup(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; IRDA_DEBUG(4, "%s()\n", __func__); IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case FINAL_TIMER_EXPIRED: if (self->retry_count < self->N3) { /* * Perform random backoff, Wait a random number of time units, minimum * duration half the time taken to transmitt a SNRM frame, maximum duration * 1.5 times the time taken to transmit a SNRM frame. So this time should * between 15 msecs and 45 msecs. */ irlap_start_backoff_timer(self, msecs_to_jiffies(20 + (jiffies % 30))); } else { /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_FOUND_NONE); } break; case BACKOFF_TIMER_EXPIRED: irlap_send_snrm_frame(self, &self->qos_rx); irlap_start_final_timer(self, self->final_timeout); self->retry_count++; break; case RECV_SNRM_CMD: IRDA_DEBUG(4, "%s(), SNRM battle!\n", __func__); IRDA_ASSERT(skb != NULL, return 0;); IRDA_ASSERT(info != NULL, return 0;); /* * The device with the largest device address wins the battle * (both have sent a SNRM command!) */ if (info &&(info->daddr > self->saddr)) { del_timer(&self->final_timer); irlap_initiate_connection_state(self); IRDA_ASSERT(self->netdev != NULL, return -1;); skb_pull(skb, sizeof(struct snrm_frame)); irlap_qos_negotiate(self, skb); /* Send UA frame and then change link settings */ irlap_apply_connection_parameters(self, FALSE); irlap_send_ua_response_frame(self, &self->qos_rx); irlap_next_state(self, LAP_NRM_S); irlap_connect_confirm(self, skb); /* * The WD-timer could be set to the duration of the * P-timer for this case, but it is recommended * to use twice the value (note 3 IrLAP p. 60). */ irlap_start_wd_timer(self, self->wd_timeout); } else { /* We just ignore the other device! */ irlap_next_state(self, LAP_SETUP); } break; case RECV_UA_RSP: /* Stop F-timer */ del_timer(&self->final_timer); /* Initiate connection state */ irlap_initiate_connection_state(self); /* Negotiate connection parameters */ IRDA_ASSERT(skb->len > 10, return -1;); skb_pull(skb, sizeof(struct ua_frame)); IRDA_ASSERT(self->netdev != NULL, return -1;); irlap_qos_negotiate(self, skb); /* Set the new link setting *now* (before the rr frame) */ irlap_apply_connection_parameters(self, TRUE); self->retry_count = 0; /* Wait for turnaround time to give a chance to the other * device to be ready to receive us. * Note : the time to switch speed is typically larger * than the turnaround time, but as we don't have the other * side speed switch time, that's our best guess... * Jean II */ irlap_wait_min_turn_around(self, &self->qos_tx); /* This frame will actually be sent at the new speed */ irlap_send_rr_frame(self, CMD_FRAME); /* The timer is set to half the normal timer to quickly * detect a failure to negotiate the new connection * parameters. IrLAP 6.11.3.2, note 3. * Note that currently we don't process this failure * properly, as we should do a quick disconnect. * Jean II */ irlap_start_final_timer(self, self->final_timeout/2); irlap_next_state(self, LAP_NRM_P); irlap_connect_confirm(self, skb); break; case RECV_DM_RSP: /* FALLTHROUGH */ case RECV_DISC_CMD: del_timer(&self->final_timer); irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; default: IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __func__, event, irlap_event[event]); ret = -1; break; } return ret; } /* * Function irlap_state_offline (self, event, skb, info) * * OFFLINE state, not used for now! * */ static int irlap_state_offline(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { IRDA_DEBUG( 0, "%s(), Unknown event\n", __func__); return -1; } /* * Function irlap_state_xmit_p (self, event, skb, info) * * XMIT, Only the primary station has right to transmit, and we * therefore do not expect to receive any transmissions from other * stations. * */ static int irlap_state_xmit_p(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; switch (event) { case SEND_I_CMD: /* * Only send frame if send-window > 0. */ if ((self->window > 0) && (!self->remote_busy)) { int nextfit; #ifdef CONFIG_IRDA_DYNAMIC_WINDOW struct sk_buff *skb_next; /* With DYNAMIC_WINDOW, we keep the window size * maximum, and adapt on the packets we are sending. * At 115k, we can send only 2 packets of 2048 bytes * in a 500 ms turnaround. Without this option, we * would always limit the window to 2. With this * option, if we send smaller packets, we can send * up to 7 of them (always depending on QoS). * Jean II */ /* Look at the next skb. This is safe, as we are * the only consumer of the Tx queue (if we are not, * we have other problems) - Jean II */ skb_next = skb_peek(&self->txq); /* Check if a subsequent skb exist and would fit in * the current window (with respect to turnaround * time). * This allow us to properly mark the current packet * with the pf bit, to avoid falling back on the * second test below, and avoid waiting the * end of the window and sending a extra RR. * Note : (skb_next != NULL) <=> (skb_queue_len() > 0) * Jean II */ nextfit = ((skb_next != NULL) && ((skb_next->len + skb->len) <= self->bytes_left)); /* * The current packet may not fit ! Because of test * above, this should not happen any more !!! * Test if we have transmitted more bytes over the * link than its possible to do with the current * speed and turn-around-time. */ if((!nextfit) && (skb->len > self->bytes_left)) { IRDA_DEBUG(0, "%s(), Not allowed to transmit" " more bytes!\n", __func__); /* Requeue the skb */ skb_queue_head(&self->txq, skb_get(skb)); /* * We should switch state to LAP_NRM_P, but * that is not possible since we must be sure * that we poll the other side. Since we have * used up our time, the poll timer should * trigger anyway now, so we just wait for it * DB */ /* * Sorry, but that's not totally true. If * we send 2000B packets, we may wait another * 1000B until our turnaround expire. That's * why we need to be proactive in avoiding * coming here. - Jean II */ return -EPROTO; } /* Subtract space used by this skb */ self->bytes_left -= skb->len; #else /* CONFIG_IRDA_DYNAMIC_WINDOW */ /* Window has been adjusted for the max packet * size, so much simpler... - Jean II */ nextfit = !skb_queue_empty(&self->txq); #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ /* * Send data with poll bit cleared only if window > 1 * and there is more frames after this one to be sent */ if ((self->window > 1) && (nextfit)) { /* More packet to send in current window */ irlap_send_data_primary(self, skb); irlap_next_state(self, LAP_XMIT_P); } else { /* Final packet of window */ irlap_send_data_primary_poll(self, skb); /* * Make sure state machine does not try to send * any more frames */ ret = -EPROTO; } #ifdef CONFIG_IRDA_FAST_RR /* Peer may want to reply immediately */ self->fast_RR = FALSE; #endif /* CONFIG_IRDA_FAST_RR */ } else { IRDA_DEBUG(4, "%s(), Unable to send! remote busy?\n", __func__); skb_queue_head(&self->txq, skb_get(skb)); /* * The next ret is important, because it tells * irlap_next_state _not_ to deliver more frames */ ret = -EPROTO; } break; case POLL_TIMER_EXPIRED: IRDA_DEBUG(3, "%s(), POLL_TIMER_EXPIRED <%ld>\n", __func__, jiffies); irlap_send_rr_frame(self, CMD_FRAME); /* Return to NRM properly - Jean II */ self->window = self->window_size; #ifdef CONFIG_IRDA_DYNAMIC_WINDOW /* Allowed to transmit a maximum number of bytes again. */ self->bytes_left = self->line_capacity; #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ irlap_start_final_timer(self, self->final_timeout); irlap_next_state(self, LAP_NRM_P); break; case DISCONNECT_REQUEST: del_timer(&self->poll_timer); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_disc_frame(self); irlap_flush_all_queues(self); irlap_start_final_timer(self, self->final_timeout); self->retry_count = 0; irlap_next_state(self, LAP_PCLOSE); break; case DATA_REQUEST: /* Nothing to do, irlap_do_event() will send the packet * when we return... - Jean II */ break; default: IRDA_DEBUG(0, "%s(), Unknown event %s\n", __func__, irlap_event[event]); ret = -EINVAL; break; } return ret; } /* * Function irlap_state_pclose (event, skb, info) * * PCLOSE state */ static int irlap_state_pclose(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; IRDA_DEBUG(1, "%s()\n", __func__); IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case RECV_UA_RSP: /* FALLTHROUGH */ case RECV_DM_RSP: del_timer(&self->final_timer); /* Set new link parameters */ irlap_apply_default_connection_parameters(self); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; case FINAL_TIMER_EXPIRED: if (self->retry_count < self->N3) { irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_disc_frame(self); irlap_start_final_timer(self, self->final_timeout); self->retry_count++; /* Keep state */ } else { irlap_apply_default_connection_parameters(self); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_NO_RESPONSE); } break; default: IRDA_DEBUG(1, "%s(), Unknown event %d\n", __func__, event); ret = -1; break; } return ret; } /* * Function irlap_state_nrm_p (self, event, skb, info) * * NRM_P (Normal Response Mode as Primary), The primary station has given * permissions to a secondary station to transmit IrLAP resonse frames * (by sending a frame with the P bit set). The primary station will not * transmit any frames and is expecting to receive frames only from the * secondary to which transmission permissions has been given. */ static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; int ns_status; int nr_status; switch (event) { case RECV_I_RSP: /* Optimize for the common case */ if (unlikely(skb->len <= LAP_ADDR_HEADER + LAP_CTRL_HEADER)) { /* * Input validation check: a stir4200/mcp2150 * combination sometimes results in an empty i:rsp. * This makes no sense; we can just ignore the frame * and send an rr:cmd immediately. This happens before * changing nr or ns so triggers a retransmit */ irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, CMD_FRAME); /* Keep state */ break; } /* FIXME: must check for remote_busy below */ #ifdef CONFIG_IRDA_FAST_RR /* * Reset the fast_RR so we can use the fast RR code with * full speed the next time since peer may have more frames * to transmitt */ self->fast_RR = FALSE; #endif /* CONFIG_IRDA_FAST_RR */ IRDA_ASSERT( info != NULL, return -1;); ns_status = irlap_validate_ns_received(self, info->ns); nr_status = irlap_validate_nr_received(self, info->nr); /* * Check for expected I(nformation) frame */ if ((ns_status == NS_EXPECTED) && (nr_status == NR_EXPECTED)) { /* Update Vr (next frame for us to receive) */ self->vr = (self->vr + 1) % 8; /* Update Nr received, cleanup our retry queue */ irlap_update_nr_received(self, info->nr); /* * Got expected NR, so reset the * retry_count. This is not done by IrLAP spec, * which is strange! */ self->retry_count = 0; self->ack_required = TRUE; /* poll bit cleared? */ if (!info->pf) { /* Keep state, do not move this line */ irlap_next_state(self, LAP_NRM_P); irlap_data_indication(self, skb, FALSE); } else { /* No longer waiting for pf */ del_timer(&self->final_timer); irlap_wait_min_turn_around(self, &self->qos_tx); /* Call higher layer *before* changing state * to give them a chance to send data in the * next LAP frame. * Jean II */ irlap_data_indication(self, skb, FALSE); /* XMIT states are the most dangerous state * to be in, because user requests are * processed directly and may change state. * On the other hand, in NDM_P, those * requests are queued and we will process * them when we return to irlap_do_event(). * Jean II */ irlap_next_state(self, LAP_XMIT_P); /* This is the last frame. * Make sure it's always called in XMIT state. * - Jean II */ irlap_start_poll_timer(self, self->poll_timeout); } break; } /* Unexpected next to send (Ns) */ if ((ns_status == NS_UNEXPECTED) && (nr_status == NR_EXPECTED)) { if (!info->pf) { irlap_update_nr_received(self, info->nr); /* * Wait until the last frame before doing * anything */ /* Keep state */ irlap_next_state(self, LAP_NRM_P); } else { IRDA_DEBUG(4, "%s(), missing or duplicate frame!\n", __func__); /* Update Nr received */ irlap_update_nr_received(self, info->nr); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, CMD_FRAME); self->ack_required = FALSE; irlap_start_final_timer(self, self->final_timeout); irlap_next_state(self, LAP_NRM_P); } break; } /* * Unexpected next to receive (Nr) */ if ((ns_status == NS_EXPECTED) && (nr_status == NR_UNEXPECTED)) { if (info->pf) { self->vr = (self->vr + 1) % 8; /* Update Nr received */ irlap_update_nr_received(self, info->nr); /* Resend rejected frames */ irlap_resend_rejected_frames(self, CMD_FRAME); self->ack_required = FALSE; /* Make sure we account for the time * to transmit our frames. See comemnts * in irlap_send_data_primary_poll(). * Jean II */ irlap_start_final_timer(self, 2 * self->final_timeout); /* Keep state, do not move this line */ irlap_next_state(self, LAP_NRM_P); irlap_data_indication(self, skb, FALSE); } else { /* * Do not resend frames until the last * frame has arrived from the other * device. This is not documented in * IrLAP!! */ self->vr = (self->vr + 1) % 8; /* Update Nr received */ irlap_update_nr_received(self, info->nr); self->ack_required = FALSE; /* Keep state, do not move this line!*/ irlap_next_state(self, LAP_NRM_P); irlap_data_indication(self, skb, FALSE); } break; } /* * Unexpected next to send (Ns) and next to receive (Nr) * Not documented by IrLAP! */ if ((ns_status == NS_UNEXPECTED) && (nr_status == NR_UNEXPECTED)) { IRDA_DEBUG(4, "%s(), unexpected nr and ns!\n", __func__); if (info->pf) { /* Resend rejected frames */ irlap_resend_rejected_frames(self, CMD_FRAME); /* Give peer some time to retransmit! * But account for our own Tx. */ irlap_start_final_timer(self, 2 * self->final_timeout); /* Keep state, do not move this line */ irlap_next_state(self, LAP_NRM_P); } else { /* Update Nr received */ /* irlap_update_nr_received( info->nr); */ self->ack_required = FALSE; } break; } /* * Invalid NR or NS */ if ((nr_status == NR_INVALID) || (ns_status == NS_INVALID)) { if (info->pf) { del_timer(&self->final_timer); irlap_next_state(self, LAP_RESET_WAIT); irlap_disconnect_indication(self, LAP_RESET_INDICATION); self->xmitflag = TRUE; } else { del_timer(&self->final_timer); irlap_disconnect_indication(self, LAP_RESET_INDICATION); self->xmitflag = FALSE; } break; } IRDA_DEBUG(1, "%s(), Not implemented!\n", __func__); IRDA_DEBUG(1, "%s(), event=%s, ns_status=%d, nr_status=%d\n", __func__, irlap_event[event], ns_status, nr_status); break; case RECV_UI_FRAME: /* Poll bit cleared? */ if (!info->pf) { irlap_data_indication(self, skb, TRUE); irlap_next_state(self, LAP_NRM_P); } else { del_timer(&self->final_timer); irlap_data_indication(self, skb, TRUE); irlap_next_state(self, LAP_XMIT_P); IRDA_DEBUG(1, "%s: RECV_UI_FRAME: next state %s\n", __func__, irlap_state[self->state]); irlap_start_poll_timer(self, self->poll_timeout); } break; case RECV_RR_RSP: /* * If you get a RR, the remote isn't busy anymore, * no matter what the NR */ self->remote_busy = FALSE; /* Stop final timer */ del_timer(&self->final_timer); /* * Nr as expected? */ ret = irlap_validate_nr_received(self, info->nr); if (ret == NR_EXPECTED) { /* Update Nr received */ irlap_update_nr_received(self, info->nr); /* * Got expected NR, so reset the retry_count. This * is not done by the IrLAP standard , which is * strange! DB. */ self->retry_count = 0; irlap_wait_min_turn_around(self, &self->qos_tx); irlap_next_state(self, LAP_XMIT_P); /* Start poll timer */ irlap_start_poll_timer(self, self->poll_timeout); } else if (ret == NR_UNEXPECTED) { IRDA_ASSERT(info != NULL, return -1;); /* * Unexpected nr! */ /* Update Nr received */ irlap_update_nr_received(self, info->nr); IRDA_DEBUG(4, "RECV_RR_FRAME: Retrans:%d, nr=%d, va=%d, " "vs=%d, vr=%d\n", self->retry_count, info->nr, self->va, self->vs, self->vr); /* Resend rejected frames */ irlap_resend_rejected_frames(self, CMD_FRAME); irlap_start_final_timer(self, self->final_timeout * 2); irlap_next_state(self, LAP_NRM_P); } else if (ret == NR_INVALID) { IRDA_DEBUG(1, "%s(), Received RR with " "invalid nr !\n", __func__); irlap_next_state(self, LAP_RESET_WAIT); irlap_disconnect_indication(self, LAP_RESET_INDICATION); self->xmitflag = TRUE; } break; case RECV_RNR_RSP: IRDA_ASSERT(info != NULL, return -1;); /* Stop final timer */ del_timer(&self->final_timer); self->remote_busy = TRUE; /* Update Nr received */ irlap_update_nr_received(self, info->nr); irlap_next_state(self, LAP_XMIT_P); /* Start poll timer */ irlap_start_poll_timer(self, self->poll_timeout); break; case RECV_FRMR_RSP: del_timer(&self->final_timer); self->xmitflag = TRUE; irlap_next_state(self, LAP_RESET_WAIT); irlap_reset_indication(self); break; case FINAL_TIMER_EXPIRED: /* * We are allowed to wait for additional 300 ms if * final timer expires when we are in the middle * of receiving a frame (page 45, IrLAP). Check that * we only do this once for each frame. */ if (irda_device_is_receiving(self->netdev) && !self->add_wait) { IRDA_DEBUG(1, "FINAL_TIMER_EXPIRED when receiving a " "frame! Waiting a little bit more!\n"); irlap_start_final_timer(self, msecs_to_jiffies(300)); /* * Don't allow this to happen one more time in a row, * or else we can get a pretty tight loop here if * if we only receive half a frame. DB. */ self->add_wait = TRUE; break; } self->add_wait = FALSE; /* N2 is the disconnect timer. Until we reach it, we retry */ if (self->retry_count < self->N2) { if (skb_peek(&self->wx_list) == NULL) { /* Retry sending the pf bit to the secondary */ IRDA_DEBUG(4, "nrm_p: resending rr"); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, CMD_FRAME); } else { IRDA_DEBUG(4, "nrm_p: resend frames"); irlap_resend_rejected_frames(self, CMD_FRAME); } irlap_start_final_timer(self, self->final_timeout); self->retry_count++; IRDA_DEBUG(4, "irlap_state_nrm_p: FINAL_TIMER_EXPIRED:" " retry_count=%d\n", self->retry_count); /* Early warning event. I'm using a pretty liberal * interpretation of the spec and generate an event * every time the timer is multiple of N1 (and not * only the first time). This allow application * to know precisely if connectivity restart... * Jean II */ if((self->retry_count % self->N1) == 0) irlap_status_indication(self, STATUS_NO_ACTIVITY); /* Keep state */ } else { irlap_apply_default_connection_parameters(self); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_NO_RESPONSE); } break; case RECV_REJ_RSP: irlap_update_nr_received(self, info->nr); if (self->remote_busy) { irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, CMD_FRAME); } else irlap_resend_rejected_frames(self, CMD_FRAME); irlap_start_final_timer(self, 2 * self->final_timeout); break; case RECV_SREJ_RSP: irlap_update_nr_received(self, info->nr); if (self->remote_busy) { irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, CMD_FRAME); } else irlap_resend_rejected_frame(self, CMD_FRAME); irlap_start_final_timer(self, 2 * self->final_timeout); break; case RECV_RD_RSP: IRDA_DEBUG(1, "%s(), RECV_RD_RSP\n", __func__); irlap_flush_all_queues(self); irlap_next_state(self, LAP_XMIT_P); /* Call back the LAP state machine to do a proper disconnect */ irlap_disconnect_request(self); break; default: IRDA_DEBUG(1, "%s(), Unknown event %s\n", __func__, irlap_event[event]); ret = -1; break; } return ret; } /* * Function irlap_state_reset_wait (event, skb, info) * * We have informed the service user of a reset condition, and is * awaiting reset of disconnect request. * */ static int irlap_state_reset_wait(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; IRDA_DEBUG(3, "%s(), event = %s\n", __func__, irlap_event[event]); IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case RESET_REQUEST: if (self->xmitflag) { irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_snrm_frame(self, NULL); irlap_start_final_timer(self, self->final_timeout); irlap_next_state(self, LAP_RESET); } else { irlap_start_final_timer(self, self->final_timeout); irlap_next_state(self, LAP_RESET); } break; case DISCONNECT_REQUEST: irlap_wait_min_turn_around( self, &self->qos_tx); irlap_send_disc_frame( self); irlap_flush_all_queues( self); irlap_start_final_timer( self, self->final_timeout); self->retry_count = 0; irlap_next_state( self, LAP_PCLOSE); break; default: IRDA_DEBUG(2, "%s(), Unknown event %s\n", __func__, irlap_event[event]); ret = -1; break; } return ret; } /* * Function irlap_state_reset (self, event, skb, info) * * We have sent a SNRM reset command to the peer layer, and is awaiting * reply. * */ static int irlap_state_reset(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; IRDA_DEBUG(3, "%s(), event = %s\n", __func__, irlap_event[event]); IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case RECV_DISC_CMD: del_timer(&self->final_timer); irlap_apply_default_connection_parameters(self); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_NO_RESPONSE); break; case RECV_UA_RSP: del_timer(&self->final_timer); /* Initiate connection state */ irlap_initiate_connection_state(self); irlap_reset_confirm(); self->remote_busy = FALSE; irlap_next_state(self, LAP_XMIT_P); irlap_start_poll_timer(self, self->poll_timeout); break; case FINAL_TIMER_EXPIRED: if (self->retry_count < 3) { irlap_wait_min_turn_around(self, &self->qos_tx); IRDA_ASSERT(self->netdev != NULL, return -1;); irlap_send_snrm_frame(self, self->qos_dev); self->retry_count++; /* Experimental!! */ irlap_start_final_timer(self, self->final_timeout); irlap_next_state(self, LAP_RESET); } else if (self->retry_count >= self->N3) { irlap_apply_default_connection_parameters(self); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_NO_RESPONSE); } break; case RECV_SNRM_CMD: /* * SNRM frame is not allowed to contain an I-field in this * state */ if (!info) { IRDA_DEBUG(3, "%s(), RECV_SNRM_CMD\n", __func__); irlap_initiate_connection_state(self); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_ua_response_frame(self, &self->qos_rx); irlap_reset_confirm(); irlap_start_wd_timer(self, self->wd_timeout); irlap_next_state(self, LAP_NDM); } else { IRDA_DEBUG(0, "%s(), SNRM frame contained an I field!\n", __func__); } break; default: IRDA_DEBUG(1, "%s(), Unknown event %s\n", __func__, irlap_event[event]); ret = -1; break; } return ret; } /* * Function irlap_state_xmit_s (event, skb, info) * * XMIT_S, The secondary station has been given the right to transmit, * and we therefore do not expect to receive any transmissions from other * stations. */ static int irlap_state_xmit_s(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; IRDA_DEBUG(4, "%s(), event=%s\n", __func__, irlap_event[event]); IRDA_ASSERT(self != NULL, return -ENODEV;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -EBADR;); switch (event) { case SEND_I_CMD: /* * Send frame only if send window > 0 */ if ((self->window > 0) && (!self->remote_busy)) { int nextfit; #ifdef CONFIG_IRDA_DYNAMIC_WINDOW struct sk_buff *skb_next; /* * Same deal as in irlap_state_xmit_p(), so see * the comments at that point. * We are the secondary, so there are only subtle * differences. - Jean II */ /* Check if a subsequent skb exist and would fit in * the current window (with respect to turnaround * time). - Jean II */ skb_next = skb_peek(&self->txq); nextfit = ((skb_next != NULL) && ((skb_next->len + skb->len) <= self->bytes_left)); /* * Test if we have transmitted more bytes over the * link than its possible to do with the current * speed and turn-around-time. */ if((!nextfit) && (skb->len > self->bytes_left)) { IRDA_DEBUG(0, "%s(), Not allowed to transmit" " more bytes!\n", __func__); /* Requeue the skb */ skb_queue_head(&self->txq, skb_get(skb)); /* * Switch to NRM_S, this is only possible * when we are in secondary mode, since we * must be sure that we don't miss any RR * frames */ self->window = self->window_size; self->bytes_left = self->line_capacity; irlap_start_wd_timer(self, self->wd_timeout); irlap_next_state(self, LAP_NRM_S); /* Slight difference with primary : * here we would wait for the other side to * expire the turnaround. - Jean II */ return -EPROTO; /* Try again later */ } /* Subtract space used by this skb */ self->bytes_left -= skb->len; #else /* CONFIG_IRDA_DYNAMIC_WINDOW */ /* Window has been adjusted for the max packet * size, so much simpler... - Jean II */ nextfit = !skb_queue_empty(&self->txq); #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ /* * Send data with final bit cleared only if window > 1 * and there is more frames to be sent */ if ((self->window > 1) && (nextfit)) { irlap_send_data_secondary(self, skb); irlap_next_state(self, LAP_XMIT_S); } else { irlap_send_data_secondary_final(self, skb); irlap_next_state(self, LAP_NRM_S); /* * Make sure state machine does not try to send * any more frames */ ret = -EPROTO; } } else { IRDA_DEBUG(2, "%s(), Unable to send!\n", __func__); skb_queue_head(&self->txq, skb_get(skb)); ret = -EPROTO; } break; case DISCONNECT_REQUEST: irlap_send_rd_frame(self); irlap_flush_all_queues(self); irlap_start_wd_timer(self, self->wd_timeout); irlap_next_state(self, LAP_SCLOSE); break; case DATA_REQUEST: /* Nothing to do, irlap_do_event() will send the packet * when we return... - Jean II */ break; default: IRDA_DEBUG(2, "%s(), Unknown event %s\n", __func__, irlap_event[event]); ret = -EINVAL; break; } return ret; } /* * Function irlap_state_nrm_s (event, skb, info) * * NRM_S (Normal Response Mode as Secondary) state, in this state we are * expecting to receive frames from the primary station * */ static int irlap_state_nrm_s(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ns_status; int nr_status; int ret = 0; IRDA_DEBUG(4, "%s(), event=%s\n", __func__, irlap_event[ event]); IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case RECV_I_CMD: /* Optimize for the common case */ /* FIXME: must check for remote_busy below */ IRDA_DEBUG(4, "%s(), event=%s nr=%d, vs=%d, ns=%d, " "vr=%d, pf=%d\n", __func__, irlap_event[event], info->nr, self->vs, info->ns, self->vr, info->pf); self->retry_count = 0; ns_status = irlap_validate_ns_received(self, info->ns); nr_status = irlap_validate_nr_received(self, info->nr); /* * Check for expected I(nformation) frame */ if ((ns_status == NS_EXPECTED) && (nr_status == NR_EXPECTED)) { /* Update Vr (next frame for us to receive) */ self->vr = (self->vr + 1) % 8; /* Update Nr received */ irlap_update_nr_received(self, info->nr); /* * poll bit cleared? */ if (!info->pf) { self->ack_required = TRUE; /* * Starting WD-timer here is optional, but * not recommended. Note 6 IrLAP p. 83 */ #if 0 irda_start_timer(WD_TIMER, self->wd_timeout); #endif /* Keep state, do not move this line */ irlap_next_state(self, LAP_NRM_S); irlap_data_indication(self, skb, FALSE); break; } else { /* * We should wait before sending RR, and * also before changing to XMIT_S * state. (note 1, IrLAP p. 82) */ irlap_wait_min_turn_around(self, &self->qos_tx); /* * Give higher layers a chance to * immediately reply with some data before * we decide if we should send a RR frame * or not */ irlap_data_indication(self, skb, FALSE); /* Any pending data requests? */ if (!skb_queue_empty(&self->txq) && (self->window > 0)) { self->ack_required = TRUE; del_timer(&self->wd_timer); irlap_next_state(self, LAP_XMIT_S); } else { irlap_send_rr_frame(self, RSP_FRAME); irlap_start_wd_timer(self, self->wd_timeout); /* Keep the state */ irlap_next_state(self, LAP_NRM_S); } break; } } /* * Check for Unexpected next to send (Ns) */ if ((ns_status == NS_UNEXPECTED) && (nr_status == NR_EXPECTED)) { /* Unexpected next to send, with final bit cleared */ if (!info->pf) { irlap_update_nr_received(self, info->nr); irlap_start_wd_timer(self, self->wd_timeout); } else { /* Update Nr received */ irlap_update_nr_received(self, info->nr); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, RSP_FRAME); irlap_start_wd_timer(self, self->wd_timeout); } break; } /* * Unexpected Next to Receive(NR) ? */ if ((ns_status == NS_EXPECTED) && (nr_status == NR_UNEXPECTED)) { if (info->pf) { IRDA_DEBUG(4, "RECV_I_RSP: frame(s) lost\n"); self->vr = (self->vr + 1) % 8; /* Update Nr received */ irlap_update_nr_received(self, info->nr); /* Resend rejected frames */ irlap_resend_rejected_frames(self, RSP_FRAME); /* Keep state, do not move this line */ irlap_next_state(self, LAP_NRM_S); irlap_data_indication(self, skb, FALSE); irlap_start_wd_timer(self, self->wd_timeout); break; } /* * This is not documented in IrLAP!! Unexpected NR * with poll bit cleared */ if (!info->pf) { self->vr = (self->vr + 1) % 8; /* Update Nr received */ irlap_update_nr_received(self, info->nr); /* Keep state, do not move this line */ irlap_next_state(self, LAP_NRM_S); irlap_data_indication(self, skb, FALSE); irlap_start_wd_timer(self, self->wd_timeout); } break; } if (ret == NR_INVALID) { IRDA_DEBUG(0, "NRM_S, NR_INVALID not implemented!\n"); } if (ret == NS_INVALID) { IRDA_DEBUG(0, "NRM_S, NS_INVALID not implemented!\n"); } break; case RECV_UI_FRAME: /* * poll bit cleared? */ if (!info->pf) { irlap_data_indication(self, skb, TRUE); irlap_next_state(self, LAP_NRM_S); /* Keep state */ } else { /* * Any pending data requests? */ if (!skb_queue_empty(&self->txq) && (self->window > 0) && !self->remote_busy) { irlap_data_indication(self, skb, TRUE); del_timer(&self->wd_timer); irlap_next_state(self, LAP_XMIT_S); } else { irlap_data_indication(self, skb, TRUE); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, RSP_FRAME); self->ack_required = FALSE; irlap_start_wd_timer(self, self->wd_timeout); /* Keep the state */ irlap_next_state(self, LAP_NRM_S); } } break; case RECV_RR_CMD: self->retry_count = 0; /* * Nr as expected? */ nr_status = irlap_validate_nr_received(self, info->nr); if (nr_status == NR_EXPECTED) { if (!skb_queue_empty(&self->txq) && (self->window > 0)) { self->remote_busy = FALSE; /* Update Nr received */ irlap_update_nr_received(self, info->nr); del_timer(&self->wd_timer); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_next_state(self, LAP_XMIT_S); } else { self->remote_busy = FALSE; /* Update Nr received */ irlap_update_nr_received(self, info->nr); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_start_wd_timer(self, self->wd_timeout); /* Note : if the link is idle (this case), * we never go in XMIT_S, so we never get a * chance to process any DISCONNECT_REQUEST. * Do it now ! - Jean II */ if (self->disconnect_pending) { /* Disconnect */ irlap_send_rd_frame(self); irlap_flush_all_queues(self); irlap_next_state(self, LAP_SCLOSE); } else { /* Just send back pf bit */ irlap_send_rr_frame(self, RSP_FRAME); irlap_next_state(self, LAP_NRM_S); } } } else if (nr_status == NR_UNEXPECTED) { self->remote_busy = FALSE; irlap_update_nr_received(self, info->nr); irlap_resend_rejected_frames(self, RSP_FRAME); irlap_start_wd_timer(self, self->wd_timeout); /* Keep state */ irlap_next_state(self, LAP_NRM_S); } else { IRDA_DEBUG(1, "%s(), invalid nr not implemented!\n", __func__); } break; case RECV_SNRM_CMD: /* SNRM frame is not allowed to contain an I-field */ if (!info) { del_timer(&self->wd_timer); IRDA_DEBUG(1, "%s(), received SNRM cmd\n", __func__); irlap_next_state(self, LAP_RESET_CHECK); irlap_reset_indication(self); } else { IRDA_DEBUG(0, "%s(), SNRM frame contained an I-field!\n", __func__); } break; case RECV_REJ_CMD: irlap_update_nr_received(self, info->nr); if (self->remote_busy) { irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, RSP_FRAME); } else irlap_resend_rejected_frames(self, RSP_FRAME); irlap_start_wd_timer(self, self->wd_timeout); break; case RECV_SREJ_CMD: irlap_update_nr_received(self, info->nr); if (self->remote_busy) { irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, RSP_FRAME); } else irlap_resend_rejected_frame(self, RSP_FRAME); irlap_start_wd_timer(self, self->wd_timeout); break; case WD_TIMER_EXPIRED: /* * Wait until retry_count * n matches negotiated threshold/ * disconnect time (note 2 in IrLAP p. 82) * * Similar to irlap_state_nrm_p() -> FINAL_TIMER_EXPIRED * Note : self->wd_timeout = (self->final_timeout * 2), * which explain why we use (self->N2 / 2) here !!! * Jean II */ IRDA_DEBUG(1, "%s(), retry_count = %d\n", __func__, self->retry_count); if (self->retry_count < (self->N2 / 2)) { /* No retry, just wait for primary */ irlap_start_wd_timer(self, self->wd_timeout); self->retry_count++; if((self->retry_count % (self->N1 / 2)) == 0) irlap_status_indication(self, STATUS_NO_ACTIVITY); } else { irlap_apply_default_connection_parameters(self); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_disconnect_indication(self, LAP_NO_RESPONSE); } break; case RECV_DISC_CMD: /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); /* Send disconnect response */ irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_ua_response_frame(self, NULL); del_timer(&self->wd_timer); irlap_flush_all_queues(self); /* Set default link parameters */ irlap_apply_default_connection_parameters(self); irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; case RECV_DISCOVERY_XID_CMD: irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rr_frame(self, RSP_FRAME); self->ack_required = TRUE; irlap_start_wd_timer(self, self->wd_timeout); irlap_next_state(self, LAP_NRM_S); break; case RECV_TEST_CMD: /* Remove test frame header (only LAP header in NRM) */ skb_pull(skb, LAP_ADDR_HEADER + LAP_CTRL_HEADER); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_start_wd_timer(self, self->wd_timeout); /* Send response (info will be copied) */ irlap_send_test_frame(self, self->caddr, info->daddr, skb); break; default: IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __func__, event, irlap_event[event]); ret = -EINVAL; break; } return ret; } /* * Function irlap_state_sclose (self, event, skb, info) */ static int irlap_state_sclose(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { IRDA_DEBUG(1, "%s()\n", __func__); IRDA_ASSERT(self != NULL, return -ENODEV;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -EBADR;); switch (event) { case RECV_DISC_CMD: /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); /* Send disconnect response */ irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_ua_response_frame(self, NULL); del_timer(&self->wd_timer); /* Set default link parameters */ irlap_apply_default_connection_parameters(self); irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; case RECV_DM_RSP: /* IrLAP-1.1 p.82: in SCLOSE, S and I type RSP frames * shall take us down into default NDM state, like DM_RSP */ case RECV_RR_RSP: case RECV_RNR_RSP: case RECV_REJ_RSP: case RECV_SREJ_RSP: case RECV_I_RSP: /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); del_timer(&self->wd_timer); irlap_apply_default_connection_parameters(self); irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; case WD_TIMER_EXPIRED: /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); irlap_apply_default_connection_parameters(self); irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; default: /* IrLAP-1.1 p.82: in SCLOSE, basically any received frame * with pf=1 shall restart the wd-timer and resend the rd:rsp */ if (info != NULL && info->pf) { del_timer(&self->wd_timer); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rd_frame(self); irlap_start_wd_timer(self, self->wd_timeout); break; /* stay in SCLOSE */ } IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __func__, event, irlap_event[event]); break; } return -1; } static int irlap_state_reset_check( struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { int ret = 0; IRDA_DEBUG(1, "%s(), event=%s\n", __func__, irlap_event[event]); IRDA_ASSERT(self != NULL, return -ENODEV;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -EBADR;); switch (event) { case RESET_RESPONSE: irlap_send_ua_response_frame(self, &self->qos_rx); irlap_initiate_connection_state(self); irlap_start_wd_timer(self, WD_TIMEOUT); irlap_flush_all_queues(self); irlap_next_state(self, LAP_NRM_S); break; case DISCONNECT_REQUEST: irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_rd_frame(self); irlap_start_wd_timer(self, WD_TIMEOUT); irlap_next_state(self, LAP_SCLOSE); break; default: IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __func__, event, irlap_event[event]); ret = -EINVAL; break; } return ret; }