net/llc/llc_c_ac.c
Source file repositories/reference/linux-study-clean/net/llc/llc_c_ac.c
File Facts
- System
- Linux kernel
- Corpus path
net/llc/llc_c_ac.c- Extension
.c- Size
- 36124 bytes
- Lines
- 1449
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netdevice.hlinux/slab.hnet/llc_conn.hnet/llc_sap.hnet/sock.hnet/llc_c_ev.hnet/llc_c_ac.hnet/llc_c_st.hnet/llc_pdu.hnet/llc.h
Detected Declarations
function llc_conn_ac_clear_remote_busyfunction llc_conn_ac_conn_indfunction llc_conn_ac_conn_confirmfunction llc_conn_ac_data_confirmfunction llc_conn_ac_data_indfunction llc_conn_ac_disc_indfunction llc_conn_ac_disc_confirmfunction llc_conn_ac_rst_indfunction LLC_PDU_TYPE_IS_Ufunction llc_conn_ac_rst_confirmfunction llc_conn_ac_clear_remote_busy_if_f_eq_1function llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2function llc_conn_ac_send_disc_cmd_p_set_xfunction llc_conn_ac_send_dm_rsp_f_set_pfunction llc_conn_ac_send_dm_rsp_f_set_1function llc_conn_ac_send_frmr_rsp_f_set_xfunction llc_conn_ac_resend_frmr_rsp_f_set_0function llc_conn_ac_resend_frmr_rsp_f_set_pfunction llc_conn_ac_send_i_cmd_p_set_1function llc_conn_ac_send_i_cmd_p_set_0function llc_conn_ac_send_i_xxx_x_set_0function llc_conn_ac_resend_i_xxx_x_set_0function llc_conn_ac_resend_i_xxx_x_set_0_or_send_rrfunction llc_conn_ac_resend_i_rsp_f_set_1function llc_conn_ac_send_rej_cmd_p_set_1function llc_conn_ac_send_rej_rsp_f_set_1function llc_conn_ac_send_rej_xxx_x_set_0function llc_conn_ac_send_rnr_cmd_p_set_1function llc_conn_ac_send_rnr_rsp_f_set_1function llc_conn_ac_send_rnr_xxx_x_set_0function llc_conn_ac_set_remote_busyfunction llc_conn_ac_opt_send_rnr_xxx_x_set_0function llc_conn_ac_send_rr_cmd_p_set_1function llc_conn_ac_send_rr_rsp_f_set_1function llc_conn_ac_send_ack_rsp_f_set_1function llc_conn_ac_send_rr_xxx_x_set_0function llc_conn_ac_send_ack_xxx_x_set_0function llc_conn_set_p_flagfunction llc_conn_ac_send_sabme_cmd_p_set_xfunction llc_conn_ac_send_ua_rsp_f_set_pfunction llc_conn_ac_set_s_flag_0function llc_conn_ac_set_s_flag_1function llc_conn_ac_start_p_timerfunction llc_conn_ac_send_ack_if_neededfunction llc_conn_ac_rst_sendack_flagfunction llc_conn_ac_send_i_rsp_f_set_ackpffunction llc_conn_ac_send_i_as_ackfunction llc_conn_ac_send_rr_rsp_f_set_ackpf
Annotated Snippet
LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_FRMR) {
reason = LLC_RESET_REASON_LOCAL;
rc = 0;
} else if (LLC_PDU_IS_CMD(pdu) &&
LLC_PDU_TYPE_IS_U(pdu) &&
LLC_U_PDU_CMD(pdu) == LLC_2_PDU_CMD_SABME) {
reason = LLC_RESET_REASON_REMOTE;
rc = 0;
}
break;
case LLC_CONN_EV_TYPE_ACK_TMR:
case LLC_CONN_EV_TYPE_P_TMR:
case LLC_CONN_EV_TYPE_REJ_TMR:
case LLC_CONN_EV_TYPE_BUSY_TMR:
if (llc->retry_count > llc->n2) {
reason = LLC_RESET_REASON_LOCAL;
rc = 0;
}
break;
}
if (!rc) {
ev->reason = reason;
ev->ind_prim = LLC_RESET_PRIM;
}
return rc;
}
int llc_conn_ac_rst_confirm(struct sock *sk, struct sk_buff *skb)
{
struct llc_conn_state_ev *ev = llc_conn_ev(skb);
ev->reason = 0;
ev->cfm_prim = LLC_RESET_PRIM;
return 0;
}
int llc_conn_ac_clear_remote_busy_if_f_eq_1(struct sock *sk,
struct sk_buff *skb)
{
struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
if (LLC_PDU_IS_RSP(pdu) &&
LLC_PDU_TYPE_IS_I(pdu) &&
LLC_I_PF_IS_1(pdu) && llc_sk(sk)->ack_pf)
llc_conn_ac_clear_remote_busy(sk, skb);
return 0;
}
int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock *sk,
struct sk_buff *skb)
{
struct llc_sock *llc = llc_sk(sk);
if (llc->data_flag == 2)
timer_delete(&llc->rej_sent_timer.timer);
return 0;
}
int llc_conn_ac_send_disc_cmd_p_set_x(struct sock *sk, struct sk_buff *skb)
{
int rc = -ENOBUFS;
struct llc_sock *llc = llc_sk(sk);
struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0);
if (nskb) {
struct llc_sap *sap = llc->sap;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
llc_pdu_init_as_disc_cmd(nskb, 1);
rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
if (unlikely(rc))
goto free;
llc_conn_send_pdu(sk, nskb);
llc_conn_ac_set_p_flag_1(sk, skb);
}
out:
return rc;
free:
kfree_skb(nskb);
goto out;
}
int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb)
{
int rc = -ENOBUFS;
struct llc_sock *llc = llc_sk(sk);
struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0);
if (nskb) {
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/slab.h`, `net/llc_conn.h`, `net/llc_sap.h`, `net/sock.h`, `net/llc_c_ev.h`, `net/llc_c_ac.h`, `net/llc_c_st.h`.
- Detected declarations: `function llc_conn_ac_clear_remote_busy`, `function llc_conn_ac_conn_ind`, `function llc_conn_ac_conn_confirm`, `function llc_conn_ac_data_confirm`, `function llc_conn_ac_data_ind`, `function llc_conn_ac_disc_ind`, `function llc_conn_ac_disc_confirm`, `function llc_conn_ac_rst_ind`, `function LLC_PDU_TYPE_IS_U`, `function llc_conn_ac_rst_confirm`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.