net/nfc/nci/rsp.c
Source file repositories/reference/linux-study-clean/net/nfc/nci/rsp.c
File Facts
- System
- Linux kernel
- Corpus path
net/nfc/nci/rsp.c- Extension
.c- Size
- 11327 bytes
- Lines
- 429
- 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.
- 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/types.hlinux/interrupt.hlinux/bitops.hlinux/skbuff.h../nfc.hnet/nfc/nci.hnet/nfc/nci_core.h
Detected Declarations
function Controllerfunction nci_core_init_rsp_packet_v1function nci_core_init_rsp_packet_v2function nci_core_init_rsp_packetfunction nci_core_set_config_rsp_packetfunction nci_rf_disc_map_rsp_packetfunction nci_rf_disc_rsp_packetfunction nci_rf_disc_select_rsp_packetfunction nci_rf_deactivate_rsp_packetfunction nci_nfcee_discover_rsp_packetfunction nci_nfcee_mode_set_rsp_packetfunction nci_core_conn_create_rsp_packetfunction nci_core_conn_close_rsp_packetfunction nci_rsp_packet
Annotated Snippet
if (rsp->status == NCI_STATUS_OK) {
ndev->nci_ver = rsp->nci_ver;
pr_debug("nci_ver 0x%x, config_status 0x%x\n",
rsp->nci_ver, rsp->config_status);
}
nci_req_complete(ndev, rsp->status);
}
}
static u8 nci_core_init_rsp_packet_v1(struct nci_dev *ndev,
const struct sk_buff *skb)
{
const struct nci_core_init_rsp_1 *rsp_1 = (void *)skb->data;
const struct nci_core_init_rsp_2 *rsp_2;
pr_debug("status 0x%x\n", rsp_1->status);
if (rsp_1->status != NCI_STATUS_OK)
return rsp_1->status;
ndev->nfcc_features = __le32_to_cpu(rsp_1->nfcc_features);
ndev->num_supported_rf_interfaces = rsp_1->num_supported_rf_interfaces;
ndev->num_supported_rf_interfaces =
min((int)ndev->num_supported_rf_interfaces,
NCI_MAX_SUPPORTED_RF_INTERFACES);
memcpy(ndev->supported_rf_interfaces,
rsp_1->supported_rf_interfaces,
ndev->num_supported_rf_interfaces);
rsp_2 = (void *) (skb->data + 6 + rsp_1->num_supported_rf_interfaces);
ndev->max_logical_connections = rsp_2->max_logical_connections;
ndev->max_routing_table_size =
__le16_to_cpu(rsp_2->max_routing_table_size);
ndev->max_ctrl_pkt_payload_len =
rsp_2->max_ctrl_pkt_payload_len;
ndev->max_size_for_large_params =
__le16_to_cpu(rsp_2->max_size_for_large_params);
ndev->manufact_id =
rsp_2->manufact_id;
ndev->manufact_specific_info =
__le32_to_cpu(rsp_2->manufact_specific_info);
return NCI_STATUS_OK;
}
static u8 nci_core_init_rsp_packet_v2(struct nci_dev *ndev,
const struct sk_buff *skb)
{
const struct nci_core_init_rsp_nci_ver2 *rsp = (void *)skb->data;
const u8 *supported_rf_interface = rsp->supported_rf_interfaces;
u8 rf_interface_idx = 0;
u8 rf_extension_cnt = 0;
pr_debug("status %x\n", rsp->status);
if (rsp->status != NCI_STATUS_OK)
return rsp->status;
ndev->nfcc_features = __le32_to_cpu(rsp->nfcc_features);
ndev->num_supported_rf_interfaces = rsp->num_supported_rf_interfaces;
ndev->num_supported_rf_interfaces =
min((int)ndev->num_supported_rf_interfaces,
NCI_MAX_SUPPORTED_RF_INTERFACES);
while (rf_interface_idx < ndev->num_supported_rf_interfaces) {
ndev->supported_rf_interfaces[rf_interface_idx++] = *supported_rf_interface++;
/* skip rf extension parameters */
rf_extension_cnt = *supported_rf_interface++;
supported_rf_interface += rf_extension_cnt;
}
ndev->max_logical_connections = rsp->max_logical_connections;
ndev->max_routing_table_size =
__le16_to_cpu(rsp->max_routing_table_size);
ndev->max_ctrl_pkt_payload_len =
rsp->max_ctrl_pkt_payload_len;
ndev->max_size_for_large_params = NCI_MAX_LARGE_PARAMS_NCI_v2;
return NCI_STATUS_OK;
}
static void nci_core_init_rsp_packet(struct nci_dev *ndev, const struct sk_buff *skb)
{
u8 status = 0;
Annotation
- Immediate include surface: `linux/types.h`, `linux/interrupt.h`, `linux/bitops.h`, `linux/skbuff.h`, `../nfc.h`, `net/nfc/nci.h`, `net/nfc/nci_core.h`.
- Detected declarations: `function Controller`, `function nci_core_init_rsp_packet_v1`, `function nci_core_init_rsp_packet_v2`, `function nci_core_init_rsp_packet`, `function nci_core_set_config_rsp_packet`, `function nci_rf_disc_map_rsp_packet`, `function nci_rf_disc_rsp_packet`, `function nci_rf_disc_select_rsp_packet`, `function nci_rf_deactivate_rsp_packet`, `function nci_nfcee_discover_rsp_packet`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.