drivers/net/fddi/skfp/smttimer.c
Source file repositories/reference/linux-study-clean/drivers/net/fddi/skfp/smttimer.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/fddi/skfp/smttimer.c- Extension
.c- Size
- 3083 bytes
- Lines
- 149
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
h/types.hh/fddi.hh/smc.h
Detected Declarations
function smt_timer_initfunction smt_timer_stopfunction smt_timer_startfunction smt_force_irqfunction smt_timer_donefunction timer_done
Annotated Snippet
if (tm == timer) {
*prev = tm->tm_next ;
if (tm->tm_next) {
tm->tm_next->tm_delta += tm->tm_delta ;
}
return ;
}
}
}
void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time,
u_long token)
{
struct smt_timer **prev ;
struct smt_timer *tm ;
u_long delta = 0 ;
time /= 16 ; /* input is uS, clock ticks are 16uS */
if (!time)
time = 1 ;
smt_timer_stop(smc,timer) ;
timer->tm_smc = smc ;
timer->tm_token = token ;
timer->tm_active = TRUE ;
if (!smc->t.st_queue) {
smc->t.st_queue = timer ;
timer->tm_next = NULL;
timer->tm_delta = time ;
hwt_start(smc,time) ;
return ;
}
/*
* timer correction
*/
timer_done(smc,0) ;
/*
* find position in queue
*/
delta = 0 ;
for (prev = &smc->t.st_queue ; (tm = *prev) ; prev = &tm->tm_next ) {
if (delta + tm->tm_delta > time) {
break ;
}
delta += tm->tm_delta ;
}
/* insert in queue */
*prev = timer ;
timer->tm_next = tm ;
timer->tm_delta = time - delta ;
if (tm)
tm->tm_delta -= timer->tm_delta ;
/*
* start new with first
*/
hwt_start(smc,smc->t.st_queue->tm_delta) ;
}
void smt_force_irq(struct s_smc *smc)
{
smt_timer_start(smc,&smc->t.st_fast,32L, EV_TOKEN(EVENT_SMT,SM_FAST));
}
void smt_timer_done(struct s_smc *smc)
{
timer_done(smc,1) ;
}
static void timer_done(struct s_smc *smc, int restart)
{
u_long delta ;
struct smt_timer *tm ;
struct smt_timer *next ;
struct smt_timer **last ;
int done = 0 ;
delta = hwt_read(smc) ;
last = &smc->t.st_queue ;
tm = smc->t.st_queue ;
while (tm && !done) {
if (delta >= tm->tm_delta) {
tm->tm_active = FALSE ;
delta -= tm->tm_delta ;
last = &tm->tm_next ;
tm = tm->tm_next ;
}
else {
tm->tm_delta -= delta ;
delta = 0 ;
done = 1 ;
Annotation
- Immediate include surface: `h/types.h`, `h/fddi.h`, `h/smc.h`.
- Detected declarations: `function smt_timer_init`, `function smt_timer_stop`, `function smt_timer_start`, `function smt_force_irq`, `function smt_timer_done`, `function timer_done`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.