drivers/nfc/pn533/pn533.c
Source file repositories/reference/linux-study-clean/drivers/nfc/pn533/pn533.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/nfc/pn533/pn533.c- Extension
.c- Size
- 64945 bytes
- Lines
- 2858
- Domain
- Driver Families
- Bucket
- drivers/nfc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/device.hlinux/kernel.hlinux/module.hlinux/slab.hlinux/nfc.hlinux/netdevice.hnet/nfc/nfc.hpn533.h
Detected Declarations
struct pn533_fw_versionstruct pn533_config_max_retriesstruct pn533_config_timingstruct pn533_poll_modulationsstruct pn533_cmd_activate_responsestruct pn533_cmd_jump_dep_responsestruct pn532_autopoll_respstruct pn533_sync_cmd_responsestruct pn533_target_type_astruct pn533_target_felicastruct pn533_target_jewelstruct pn533_type_b_prot_infostruct pn533_type_b_sens_resstruct pn533_target_type_bstruct pn533_data_exchange_argfunction pn533_ext_checksumfunction pn533_std_checksumfunction pn533_std_data_checksumfunction pn533_std_tx_frame_initfunction pn533_std_tx_frame_finishfunction pn533_std_tx_update_payload_lenfunction pn533_std_rx_frame_is_validfunction pn533_rx_frame_is_ackfunction pn533_std_rx_frame_sizefunction pn533_std_get_cmd_codefunction pn533_rx_frame_is_cmd_responsefunction pn533_build_cmd_framefunction pn533_send_async_completefunction __pn533_send_asyncfunction pn533_send_data_asyncfunction pn533_send_cmd_asyncfunction pn533_send_cmd_direct_asyncfunction pn533_wq_cmd_completefunction pn533_wq_cmdfunction pn533_send_sync_completefunction pn533_target_type_a_is_validfunction pn533_target_found_type_afunction pn533_target_felica_is_validfunction pn533_target_found_felicafunction pn533_target_jewel_is_validfunction pn533_target_found_jewelfunction pn533_target_type_b_is_validfunction pn533_target_found_type_bfunction pn533_target_foundfunction pn533_poll_next_modfunction pn533_poll_reset_mod_listfunction pn533_poll_add_modfunction pn533_poll_create_mod_list
Annotated Snippet
struct pn533_fw_version {
u8 ic;
u8 ver;
u8 rev;
u8 support;
};
/* PN533_CMD_RF_CONFIGURATION */
#define PN533_CFGITEM_RF_FIELD 0x01
#define PN533_CFGITEM_TIMING 0x02
#define PN533_CFGITEM_MAX_RETRIES 0x05
#define PN533_CFGITEM_PASORI 0x82
#define PN533_CFGITEM_RF_FIELD_AUTO_RFCA 0x2
#define PN533_CFGITEM_RF_FIELD_ON 0x1
#define PN533_CFGITEM_RF_FIELD_OFF 0x0
#define PN533_CONFIG_TIMING_102 0xb
#define PN533_CONFIG_TIMING_204 0xc
#define PN533_CONFIG_TIMING_409 0xd
#define PN533_CONFIG_TIMING_819 0xe
#define PN533_CONFIG_MAX_RETRIES_NO_RETRY 0x00
#define PN533_CONFIG_MAX_RETRIES_ENDLESS 0xFF
struct pn533_config_max_retries {
u8 mx_rty_atr;
u8 mx_rty_psl;
u8 mx_rty_passive_act;
} __packed;
struct pn533_config_timing {
u8 rfu;
u8 atr_res_timeout;
u8 dep_timeout;
} __packed;
/* PN533_CMD_IN_LIST_PASSIVE_TARGET */
/* felica commands opcode */
#define PN533_FELICA_OPC_SENSF_REQ 0
#define PN533_FELICA_OPC_SENSF_RES 1
/* felica SENSF_REQ parameters */
#define PN533_FELICA_SENSF_SC_ALL 0xFFFF
#define PN533_FELICA_SENSF_RC_NO_SYSTEM_CODE 0
#define PN533_FELICA_SENSF_RC_SYSTEM_CODE 1
#define PN533_FELICA_SENSF_RC_ADVANCED_PROTOCOL 2
/* type B initiator_data values */
#define PN533_TYPE_B_AFI_ALL_FAMILIES 0
#define PN533_TYPE_B_POLL_METHOD_TIMESLOT 0
#define PN533_TYPE_B_POLL_METHOD_PROBABILISTIC 1
union pn533_cmd_poll_initdata {
struct {
u8 afi;
u8 polling_method;
} __packed type_b;
struct {
u8 opcode;
__be16 sc;
u8 rc;
u8 tsn;
} __packed felica;
};
struct pn533_poll_modulations {
struct {
u8 maxtg;
u8 brty;
union pn533_cmd_poll_initdata initiator_data;
} __packed data;
u8 len;
};
static const struct pn533_poll_modulations poll_mod[] = {
[PN533_POLL_MOD_106KBPS_A] = {
.data = {
.maxtg = 1,
.brty = 0,
},
.len = 2,
},
[PN533_POLL_MOD_212KBPS_FELICA] = {
.data = {
.maxtg = 1,
.brty = 1,
.initiator_data.felica = {
.opcode = PN533_FELICA_OPC_SENSF_REQ,
.sc = PN533_FELICA_SENSF_SC_ALL,
Annotation
- Immediate include surface: `linux/device.h`, `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/nfc.h`, `linux/netdevice.h`, `net/nfc/nfc.h`, `pn533.h`.
- Detected declarations: `struct pn533_fw_version`, `struct pn533_config_max_retries`, `struct pn533_config_timing`, `struct pn533_poll_modulations`, `struct pn533_cmd_activate_response`, `struct pn533_cmd_jump_dep_response`, `struct pn532_autopoll_resp`, `struct pn533_sync_cmd_response`, `struct pn533_target_type_a`, `struct pn533_target_felica`.
- Atlas domain: Driver Families / drivers/nfc.
- Implementation status: integration 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.