nfc_data_exchange(9)
π nfc_data_exchange(9) β the kernel API manual, but make it cute β¨
okay so bestie, this page lives in the Kernel API Manual and it's literally called nfc_data_exchange. yes it's a mouthful, no you don't have to be scared of it. it's giving "small function, big responsibility" energy π«Ά
πΈ NAME πΈ
nfc_data_exchange β transceive data π«
like, you send stuff, you receive stuff. transceive. the word ate, honestly.
π SYNOPSIS π
int nfc_data_exchange (struct nfc_dev *dev , u32 target_idx , struct
sk_buff *skb , data_exchange_cb_t cb , void *cb_context );
that's the whole signature, character for character, no notes π
π¦ ARGUMENTS π¦
devβ the nfc device that found the target. it's the one who did the finding, so it gets to be the star of the show β¨target_idxβ index of the target. au32, so a plain little number pointing at who you're talking to πskbβ data to be sent. the actual payload, the whole reason you're here π¦cbβ callback called when the response is received. it'sdata_exchange_cb_t, and it gets pinged the moment the response lands πcb_contextβ parameter for the callback function. avoid *, so it can be literally anything you want to hand over to your callback π
β DESCRIPTION β
okay so this is the important bit, don't skip it, this is the vibe check of the whole page:
The user must wait for the callback before calling this function again.
that's it. that's the rule. no calling it twice, no being impatient, no "but i'm built different." wait for the callback. then call it again. periodt. π
π SEE ALSO π
the kernel file is ./net/nfc/core.c, and there's a whole friend group of related functions β go say hi to all of them:
nfc_fw_download_done(9)nfc_dev_up(9)nfc_dev_down(9)nfc_start_poll(9)nfc_stop_poll(9)nfc_activate_target(9)nfc_deactivate_target(9)nfc_alloc_send_skb(9)nfc_alloc_recv_skb(9)nfc_targets_found(9)nfc_target_lost(9)nfc_allocate_device(9)nfc_register_device(9)nfc_unregister_rfkill(9)nfc_remove_device(9)nfc_unregister_device(9)
and that's the whole page bestie, go forth and transceive responsibly π§ββοΈπ
sign-off szn: this page comes from ./net/nfc and it's dated October 2026 β so like, future-core of it all β³πΈ mwah, bye! π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms