net/lapb/lapb_timer.c
Source file repositories/reference/linux-study-clean/net/lapb/lapb_timer.c
File Facts
- System
- Linux kernel
- Corpus path
net/lapb/lapb_timer.c- Extension
.c- Size
- 5013 bytes
- Lines
- 207
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/types.hlinux/socket.hlinux/in.hlinux/kernel.hlinux/jiffies.hlinux/timer.hlinux/string.hlinux/sockios.hlinux/net.hlinux/inet.hlinux/skbuff.hnet/sock.hlinux/uaccess.hlinux/fcntl.hlinux/mm.hlinux/interrupt.hnet/lapb.h
Detected Declarations
function lapb_start_t1timerfunction lapb_start_t2timerfunction lapb_stop_t1timerfunction lapb_stop_t2timerfunction lapb_t1timer_runningfunction lapb_t2timer_expiryfunction lapb_t1timer_expiry
Annotated Snippet
if (lapb->n2count == lapb->n2) {
lapb_clear_queues(lapb);
lapb->state = LAPB_STATE_0;
lapb_disconnect_indication(lapb, LAPB_TIMEDOUT);
lapb_dbg(0, "(%p) S1 -> S0\n", lapb->dev);
lapb->t1timer_running = false;
goto out;
} else {
lapb->n2count++;
if (lapb->mode & LAPB_EXTENDED) {
lapb_dbg(1, "(%p) S1 TX SABME(1)\n",
lapb->dev);
lapb_send_control(lapb, LAPB_SABME, LAPB_POLLON, LAPB_COMMAND);
} else {
lapb_dbg(1, "(%p) S1 TX SABM(1)\n",
lapb->dev);
lapb_send_control(lapb, LAPB_SABM, LAPB_POLLON, LAPB_COMMAND);
}
}
break;
/*
* Awaiting disconnection state, send DISC, up to N2 times.
*/
case LAPB_STATE_2:
if (lapb->n2count == lapb->n2) {
lapb_clear_queues(lapb);
lapb->state = LAPB_STATE_0;
lapb_disconnect_confirmation(lapb, LAPB_TIMEDOUT);
lapb_dbg(0, "(%p) S2 -> S0\n", lapb->dev);
lapb->t1timer_running = false;
goto out;
} else {
lapb->n2count++;
lapb_dbg(1, "(%p) S2 TX DISC(1)\n", lapb->dev);
lapb_send_control(lapb, LAPB_DISC, LAPB_POLLON, LAPB_COMMAND);
}
break;
/*
* Data transfer state, restransmit I frames, up to N2 times.
*/
case LAPB_STATE_3:
if (lapb->n2count == lapb->n2) {
lapb_clear_queues(lapb);
lapb->state = LAPB_STATE_0;
lapb_stop_t2timer(lapb);
lapb_disconnect_indication(lapb, LAPB_TIMEDOUT);
lapb_dbg(0, "(%p) S3 -> S0\n", lapb->dev);
lapb->t1timer_running = false;
goto out;
} else {
lapb->n2count++;
lapb_requeue_frames(lapb);
lapb_kick(lapb);
}
break;
/*
* Frame reject state, restransmit FRMR frames, up to N2 times.
*/
case LAPB_STATE_4:
if (lapb->n2count == lapb->n2) {
lapb_clear_queues(lapb);
lapb->state = LAPB_STATE_0;
lapb_disconnect_indication(lapb, LAPB_TIMEDOUT);
lapb_dbg(0, "(%p) S4 -> S0\n", lapb->dev);
lapb->t1timer_running = false;
goto out;
} else {
lapb->n2count++;
lapb_transmit_frmr(lapb);
}
break;
}
lapb_start_t1timer(lapb);
out:
spin_unlock_bh(&lapb->lock);
}
Annotation
- Immediate include surface: `linux/errno.h`, `linux/types.h`, `linux/socket.h`, `linux/in.h`, `linux/kernel.h`, `linux/jiffies.h`, `linux/timer.h`, `linux/string.h`.
- Detected declarations: `function lapb_start_t1timer`, `function lapb_start_t2timer`, `function lapb_stop_t1timer`, `function lapb_stop_t2timer`, `function lapb_t1timer_running`, `function lapb_t2timer_expiry`, `function lapb_t1timer_expiry`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.