drivers/nfc/port100.c
Source file repositories/reference/linux-study-clean/drivers/nfc/port100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/nfc/port100.c- Extension
.c- Size
- 42878 bytes
- Lines
- 1641
- 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.
- 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/module.hlinux/usb.hnet/nfc/digital.h
Detected Declarations
struct port100struct port100_in_rf_settingstruct port100_tg_rf_settingstruct port100_protocolstruct port100struct port100_cmdstruct port100_framestruct port100_ack_framestruct port100_cb_argstruct port100_tg_comm_rf_cmdstruct port100_tg_comm_rf_resstruct port100_sync_cmd_responsefunction port100_checksumfunction port100_data_checksumfunction port100_tx_frame_initfunction port100_tx_frame_finishfunction port100_tx_update_payload_lenfunction port100_rx_frame_is_validfunction port100_rx_frame_is_ackfunction port100_rx_frame_sizefunction port100_rx_frame_is_cmd_responsefunction port100_recv_responsefunction port100_submit_urb_for_responsefunction port100_recv_ackfunction port100_submit_urb_for_ackfunction port100_send_ackfunction port100_send_frame_asyncfunction port100_build_cmd_framefunction port100_send_async_completefunction port100_send_cmd_asyncfunction port100_wq_cmd_completefunction port100_send_sync_completefunction port100_send_completefunction port100_abort_cmdfunction port100_set_command_typefunction port100_get_command_type_maskfunction port100_get_firmware_versionfunction port100_switch_rffunction port100_in_set_rffunction port100_in_set_framingfunction port100_in_configure_hwfunction port100_in_comm_rf_completefunction port100_in_send_cmdfunction port100_tg_set_rffunction port100_tg_set_framingfunction port100_tg_configure_hwfunction port100_tg_target_activatedfunction port100_tg_comm_rf_complete
Annotated Snippet
struct port100_in_rf_setting {
u8 in_send_set_number;
u8 in_send_comm_type;
u8 in_recv_set_number;
u8 in_recv_comm_type;
} __packed;
#define PORT100_COMM_TYPE_IN_212F 0x01
#define PORT100_COMM_TYPE_IN_424F 0x02
#define PORT100_COMM_TYPE_IN_106A 0x03
#define PORT100_COMM_TYPE_IN_106B 0x07
static const struct port100_in_rf_setting in_rf_settings[] = {
[NFC_DIGITAL_RF_TECH_212F] = {
.in_send_set_number = 1,
.in_send_comm_type = PORT100_COMM_TYPE_IN_212F,
.in_recv_set_number = 15,
.in_recv_comm_type = PORT100_COMM_TYPE_IN_212F,
},
[NFC_DIGITAL_RF_TECH_424F] = {
.in_send_set_number = 1,
.in_send_comm_type = PORT100_COMM_TYPE_IN_424F,
.in_recv_set_number = 15,
.in_recv_comm_type = PORT100_COMM_TYPE_IN_424F,
},
[NFC_DIGITAL_RF_TECH_106A] = {
.in_send_set_number = 2,
.in_send_comm_type = PORT100_COMM_TYPE_IN_106A,
.in_recv_set_number = 15,
.in_recv_comm_type = PORT100_COMM_TYPE_IN_106A,
},
[NFC_DIGITAL_RF_TECH_106B] = {
.in_send_set_number = 3,
.in_send_comm_type = PORT100_COMM_TYPE_IN_106B,
.in_recv_set_number = 15,
.in_recv_comm_type = PORT100_COMM_TYPE_IN_106B,
},
/* Ensures the array has NFC_DIGITAL_RF_TECH_LAST elements */
[NFC_DIGITAL_RF_TECH_LAST] = { 0 },
};
/**
* struct port100_tg_rf_setting - Setting sets structure for tg_set_rf command
*
* @tg_set_number: Represents the entry index in the port-100 RF Base Table.
* This table contains multiple RF setting sets required for RF
* communication. this field is used for both send and receive
* settings.
*
* @tg_comm_type: Sets the communication type to be used to send and receive
* data.
*/
struct port100_tg_rf_setting {
u8 tg_set_number;
u8 tg_comm_type;
} __packed;
#define PORT100_COMM_TYPE_TG_106A 0x0B
#define PORT100_COMM_TYPE_TG_212F 0x0C
#define PORT100_COMM_TYPE_TG_424F 0x0D
static const struct port100_tg_rf_setting tg_rf_settings[] = {
[NFC_DIGITAL_RF_TECH_106A] = {
.tg_set_number = 8,
.tg_comm_type = PORT100_COMM_TYPE_TG_106A,
},
[NFC_DIGITAL_RF_TECH_212F] = {
.tg_set_number = 8,
.tg_comm_type = PORT100_COMM_TYPE_TG_212F,
},
[NFC_DIGITAL_RF_TECH_424F] = {
.tg_set_number = 8,
.tg_comm_type = PORT100_COMM_TYPE_TG_424F,
},
/* Ensures the array has NFC_DIGITAL_RF_TECH_LAST elements */
[NFC_DIGITAL_RF_TECH_LAST] = { 0 },
};
#define PORT100_IN_PROT_INITIAL_GUARD_TIME 0x00
#define PORT100_IN_PROT_ADD_CRC 0x01
#define PORT100_IN_PROT_CHECK_CRC 0x02
#define PORT100_IN_PROT_MULTI_CARD 0x03
#define PORT100_IN_PROT_ADD_PARITY 0x04
#define PORT100_IN_PROT_CHECK_PARITY 0x05
#define PORT100_IN_PROT_BITWISE_AC_RECV_MODE 0x06
#define PORT100_IN_PROT_VALID_BIT_NUMBER 0x07
#define PORT100_IN_PROT_CRYPTO1 0x08
#define PORT100_IN_PROT_ADD_SOF 0x09
#define PORT100_IN_PROT_CHECK_SOF 0x0A
Annotation
- Immediate include surface: `linux/module.h`, `linux/usb.h`, `net/nfc/digital.h`.
- Detected declarations: `struct port100`, `struct port100_in_rf_setting`, `struct port100_tg_rf_setting`, `struct port100_protocol`, `struct port100`, `struct port100_cmd`, `struct port100_frame`, `struct port100_ack_frame`, `struct port100_cb_arg`, `struct port100_tg_comm_rf_cmd`.
- 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.
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.