net/nfc/digital_dep.c
Source file repositories/reference/linux-study-clean/net/nfc/digital_dep.c
File Facts
- System
- Linux kernel
- Corpus path
net/nfc/digital_dep.c- Extension
.c- Size
- 35067 bytes
- Lines
- 1634
- 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
digital.h
Detected Declarations
struct digital_atr_reqstruct digital_atr_resstruct digital_psl_reqstruct digital_psl_resstruct digital_dep_req_resfunction digital_payload_bits_to_sizefunction digital_payload_size_to_bitsfunction digital_skb_push_dep_sodfunction digital_skb_pull_dep_sodfunction digital_send_dep_data_prepfunction digital_recv_dep_data_gatherfunction digital_in_recv_psl_resfunction digital_in_send_psl_reqfunction digital_in_recv_atr_resfunction digital_in_send_atr_reqfunction digital_in_send_ackfunction digital_in_send_nackfunction digital_in_send_atnfunction digital_in_send_rtoxfunction digital_in_send_saved_skbfunction digital_in_recv_dep_resfunction digital_in_send_dep_reqfunction digital_tg_set_rf_techfunction digital_tg_send_ackfunction digital_tg_send_atnfunction digital_tg_send_saved_skbfunction digital_tg_recv_dep_reqfunction digital_tg_send_dep_resfunction digital_tg_send_dep_resfunction digital_tg_send_psl_res_completefunction digital_tg_send_psl_resfunction digital_tg_recv_psl_reqfunction digital_tg_send_atr_res_completefunction digital_tg_send_atr_resfunction digital_tg_recv_atr_req
Annotated Snippet
struct digital_atr_req {
u8 dir;
u8 cmd;
u8 nfcid3[10];
u8 did;
u8 bs;
u8 br;
u8 pp;
u8 gb[];
} __packed;
struct digital_atr_res {
u8 dir;
u8 cmd;
u8 nfcid3[10];
u8 did;
u8 bs;
u8 br;
u8 to;
u8 pp;
u8 gb[];
} __packed;
struct digital_psl_req {
u8 dir;
u8 cmd;
u8 did;
u8 brs;
u8 fsl;
} __packed;
struct digital_psl_res {
u8 dir;
u8 cmd;
u8 did;
} __packed;
struct digital_dep_req_res {
u8 dir;
u8 cmd;
u8 pfb;
} __packed;
static void digital_in_recv_dep_res(struct nfc_digital_dev *ddev, void *arg,
struct sk_buff *resp);
static void digital_tg_recv_dep_req(struct nfc_digital_dev *ddev, void *arg,
struct sk_buff *resp);
static const u8 digital_payload_bits_map[4] = {
[0] = 64,
[1] = 128,
[2] = 192,
[3] = 254
};
/* Response Waiting Time for ATR_RES PDU in ms
*
* RWT(ATR_RES) = RWT(nfcdep,activation) + dRWT(nfcdep) + dT(nfcdep,initiator)
*
* with:
* RWT(nfcdep,activation) = 4096 * 2^12 / f(c) s
* dRWT(nfcdep) = 16 / f(c) s
* dT(nfcdep,initiator) = 100 ms
* f(c) = 13560000 Hz
*/
#define DIGITAL_ATR_RES_RWT 1337
/* Response Waiting Time for other DEP PDUs in ms
*
* max_rwt = rwt + dRWT(nfcdep) + dT(nfcdep,initiator)
*
* with:
* rwt = (256 * 16 / f(c)) * 2^wt s
* dRWT(nfcdep) = 16 / f(c) s
* dT(nfcdep,initiator) = 100 ms
* f(c) = 13560000 Hz
* 0 <= wt <= 14 (given by the target by the TO field of ATR_RES response)
*/
#define DIGITAL_NFC_DEP_IN_MAX_WT 14
#define DIGITAL_NFC_DEP_TG_MAX_WT 14
static const u16 digital_rwt_map[DIGITAL_NFC_DEP_IN_MAX_WT + 1] = {
100, 101, 101, 102, 105,
110, 119, 139, 177, 255,
409, 719, 1337, 2575, 5049,
};
static u8 digital_payload_bits_to_size(u8 payload_bits)
{
if (payload_bits >= ARRAY_SIZE(digital_payload_bits_map))
return 0;
Annotation
- Immediate include surface: `digital.h`.
- Detected declarations: `struct digital_atr_req`, `struct digital_atr_res`, `struct digital_psl_req`, `struct digital_psl_res`, `struct digital_dep_req_res`, `function digital_payload_bits_to_size`, `function digital_payload_size_to_bits`, `function digital_skb_push_dep_sod`, `function digital_skb_pull_dep_sod`, `function digital_send_dep_data_prep`.
- 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.