drivers/nfc/st95hf/core.c
Source file repositories/reference/linux-study-clean/drivers/nfc/st95hf/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/nfc/st95hf/core.c- Extension
.c- Size
- 32893 bytes
- Lines
- 1252
- Domain
- Driver Families
- Bucket
- drivers/nfc
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/gpio/consumer.hlinux/init.hlinux/interrupt.hlinux/irq.hlinux/module.hlinux/netdevice.hlinux/nfc.hlinux/of.hlinux/property.hlinux/regulator/consumer.hlinux/wait.hnet/nfc/digital.hnet/nfc/nfc.hspi.h
Detected Declarations
struct cmdstruct param_liststruct st95_digital_cmd_complete_argstruct st95hf_contextenum st95hf_cmd_listfunction st95hf_send_recv_cmdfunction st95hf_echo_commandfunction secondary_configuration_type4afunction secondary_configuration_type4bfunction st95hf_select_protocolfunction st95hf_send_st95enable_negativepulsefunction busfunction st95hf_por_sequencefunction iso14443_config_fdtfunction st95hf_handle_wtxfunction st95hf_error_handlingfunction st95hf_response_handlerfunction st95hf_irq_handlerfunction st95hf_irq_thread_handlerfunction st95hf_in_send_cmdfunction st95hf_in_configure_hwfunction rf_offfunction st95hf_in_send_cmdfunction st95hf_tg_configure_hwfunction st95hf_tg_send_cmdfunction st95hf_tg_listenfunction st95hf_tg_get_rf_techfunction st95hf_switch_rffunction st95hf_abort_cmdfunction st95hf_probefunction st95hf_remove
Annotated Snippet
struct cmd {
int cmd_len;
unsigned char cmd_id;
unsigned char no_cmd_params;
unsigned char cmd_params[MAX_CMD_PARAMS];
enum req_type req;
};
struct param_list {
int param_offset;
int new_param_val;
};
/*
* List of top-level cmds to be used internally by the driver.
* All these commands are build on top of ST95HF basic commands
* such as SEND_RECEIVE_CMD, PROTOCOL_SELECT_CMD, etc.
* These top level cmds are used internally while implementing various ops of
* digital layer/driver probe or extending the digital framework layer for
* features that are not yet implemented there, for example, WTX cmd handling.
*/
enum st95hf_cmd_list {
CMD_ECHO,
CMD_ISO14443A_CONFIG,
CMD_ISO14443A_DEMOGAIN,
CMD_ISO14443B_DEMOGAIN,
CMD_ISO14443A_PROTOCOL_SELECT,
CMD_ISO14443B_PROTOCOL_SELECT,
CMD_WTX_RESPONSE,
CMD_FIELD_OFF,
CMD_ISO15693_PROTOCOL_SELECT,
};
static const struct cmd cmd_array[] = {
[CMD_ECHO] = {
.cmd_len = 0x2,
.cmd_id = ECHO_CMD,
.no_cmd_params = 0,
.req = SYNC,
},
[CMD_ISO14443A_CONFIG] = {
.cmd_len = 0x7,
.cmd_id = WRITE_REGISTER_CMD,
.no_cmd_params = 0x4,
.cmd_params = {0x3A, 0x00, 0x5A, 0x04},
.req = SYNC,
},
[CMD_ISO14443A_DEMOGAIN] = {
.cmd_len = 0x7,
.cmd_id = WRITE_REGISTER_CMD,
.no_cmd_params = 0x4,
.cmd_params = {0x68, 0x01, 0x01, 0xDF},
.req = SYNC,
},
[CMD_ISO14443B_DEMOGAIN] = {
.cmd_len = 0x7,
.cmd_id = WRITE_REGISTER_CMD,
.no_cmd_params = 0x4,
.cmd_params = {0x68, 0x01, 0x01, 0x51},
.req = SYNC,
},
[CMD_ISO14443A_PROTOCOL_SELECT] = {
.cmd_len = 0x7,
.cmd_id = PROTOCOL_SELECT_CMD,
.no_cmd_params = 0x4,
.cmd_params = {ISO14443A_PROTOCOL_CODE, 0x00, 0x01, 0xA0},
.req = SYNC,
},
[CMD_ISO14443B_PROTOCOL_SELECT] = {
.cmd_len = 0x7,
.cmd_id = PROTOCOL_SELECT_CMD,
.no_cmd_params = 0x4,
.cmd_params = {ISO14443B_PROTOCOL_CODE, 0x01, 0x03, 0xFF},
.req = SYNC,
},
[CMD_WTX_RESPONSE] = {
.cmd_len = 0x6,
.cmd_id = SEND_RECEIVE_CMD,
.no_cmd_params = 0x3,
.cmd_params = {0xF2, 0x00, TRFLAG_NFCA_STD_FRAME_CRC},
.req = ASYNC,
},
[CMD_FIELD_OFF] = {
.cmd_len = 0x5,
.cmd_id = PROTOCOL_SELECT_CMD,
.no_cmd_params = 0x2,
.cmd_params = {0x0, 0x0},
.req = SYNC,
},
[CMD_ISO15693_PROTOCOL_SELECT] = {
Annotation
- Immediate include surface: `linux/err.h`, `linux/gpio/consumer.h`, `linux/init.h`, `linux/interrupt.h`, `linux/irq.h`, `linux/module.h`, `linux/netdevice.h`, `linux/nfc.h`.
- Detected declarations: `struct cmd`, `struct param_list`, `struct st95_digital_cmd_complete_arg`, `struct st95hf_context`, `enum st95hf_cmd_list`, `function st95hf_send_recv_cmd`, `function st95hf_echo_command`, `function secondary_configuration_type4a`, `function secondary_configuration_type4b`, `function st95hf_select_protocol`.
- Atlas domain: Driver Families / drivers/nfc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.