ENUM NFC_COMMANDS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– enum nfc_commands(9) πŸ’–

okay so, bestie, welcome to the kernel API manual β€” this is the page for enum nfc_commands, which is literally just the list of every nfc command your kernel understands. yes, every single one. buckle up πŸŽ€


✨ NAME ✨

enum nfc_commands β€” the supported nfc commands, periodt πŸ’…


🌸 SYNOPSIS 🌸

enum nfc_commands {
    NFC_CMD_UNSPEC ,
    NFC_CMD_GET_DEVICE ,
    NFC_CMD_DEV_UP ,
    NFC_CMD_DEV_DOWN ,
    NFC_CMD_DEP_LINK_UP ,
    NFC_CMD_DEP_LINK_DOWN ,
    NFC_CMD_START_POLL ,
    NFC_CMD_STOP_POLL ,
    NFC_CMD_GET_TARGET ,
    NFC_EVENT_TARGETS_FOUND ,
    NFC_EVENT_DEVICE_ADDED ,
    NFC_EVENT_DEVICE_REMOVED ,
    NFC_EVENT_TARGET_LOST ,
    NFC_EVENT_TM_ACTIVATED ,
    NFC_EVENT_TM_DEACTIVATED ,
    NFC_CMD_LLC_GET_PARAMS ,
    NFC_CMD_LLC_SET_PARAMS ,
    NFC_CMD_ENABLE_SE ,
    NFC_CMD_DISABLE_SE ,
    NFC_CMD_LLC_SDREQ ,
    NFC_EVENT_LLC_SDRES ,
    NFC_CMD_FW_DOWNLOAD ,
    NFC_EVENT_SE_ADDED ,
    NFC_EVENT_SE_REMOVED ,
    NFC_EVENT_SE_CONNECTIVITY ,
    NFC_EVENT_SE_TRANSACTION ,
    NFC_CMD_GET_SE ,
    NFC_CMD_SE_IO ,
    NFC_CMD_ACTIVATE_TARGET ,
    NFC_CMD_VENDOR ,
    NFC_CMD_DEACTIVATE_TARGET

};

look at her go 😭 so many little constants. and like, some of them are CMDs and some are EVENTs β€” that's not a typo, that's the whole vibe of this enum, ok? πŸ‘‘


πŸ¦‹ Constants πŸ¦‹

  • NFC_CMD_UNSPEC β€” the unspecified command. the "idk what this is" of commands πŸ™ˆ
  • NFC_CMD_GET_DEVICE β€” request info about a device (needs NFC_ATTR_DEVICE_INDEX), or do a dump request to get a list of all nfc devices. two-for-one deal ✨
  • NFC_CMD_DEV_UP β€” turn on the nfc device (needs NFC_ATTR_DEVICE_INDEX). wakey wakey πŸ’–
  • NFC_CMD_DEV_DOWN β€” turn off the nfc device (needs NFC_ATTR_DEVICE_INDEX). nini 😴
  • NFC_CMD_DEP_LINK_UP β€” no description in the original, it just says -- undescribed -- πŸ’€ the devs really said "you'll find out"
  • NFC_CMD_DEP_LINK_DOWN β€” same situation, also -- undescribed -- πŸ™ˆ
  • NFC_CMD_START_POLL β€” start polling for targets using the protocols you pass in (needs NFC_ATTR_DEVICE_INDEX and NFC_ATTR_PROTOCOLS). both, bestie, not one πŸ”₯
  • NFC_CMD_STOP_POLL β€” stop polling for targets (needs NFC_ATTR_DEVICE_INDEX) βœ‹
  • NFC_CMD_GET_TARGET β€” dump every target that the previous poll found (needs NFC_ATTR_DEVICE_INDEX) 🎯
  • NFC_EVENT_TARGETS_FOUND β€” event fired when a new target is found; it sends NFC_ATTR_DEVICE_INDEX ⭐
  • NFC_EVENT_DEVICE_ADDED β€” event fired when a new device is registered (yes, the original spells it "registred", we're leaving that exactly as-is 😭); it sends NFC_ATTR_DEVICE_NAME, NFC_ATTR_DEVICE_INDEX and NFC_ATTR_PROTOCOLS 🫢
  • NFC_EVENT_DEVICE_REMOVED β€” event fired when a device is removed; it sends NFC_ATTR_DEVICE_INDEX 🌈
  • NFC_EVENT_TARGET_LOST β€” -- undescribed --, another mystery icon πŸ‘»
  • NFC_EVENT_TM_ACTIVATED β€” event fired when the adapter is activated in target mode πŸ”₯
  • NFC_EVENT_TM_DEACTIVATED β€” event fired when the adapter is deactivated from target mode 🧊
  • NFC_CMD_LLC_GET_PARAMS β€” request the LTO, RW, and MIUX parameters for a device πŸŽ€
  • NFC_CMD_LLC_SET_PARAMS β€” set one or more of the LTO, RW, and MIUX parameters for a device. ok this one's got rules, so listen up: LTO must be set before the link is up, otherwise -EINPROGRESS gets returned. RW and MIUX can be set at anytime and will be passed in subsequent CONNECT and CC messages. and if one of the passed parameters is wrong, none of them get set and you get -EINVAL back. all-or-nothing energy, we respect it πŸ’…
  • NFC_CMD_ENABLE_SE β€” enable the physical link to a specific secure element. once it's enabled, that secure element handles card emulation mode β€” like, starting a poll from a device that has a secure element enabled means we want to do SE based card emulation πŸƒ
  • NFC_CMD_DISABLE_SE β€” disable the physical link to a specific secure element 🚫
  • NFC_CMD_LLC_SDREQ β€” -- undescribed -- bestie the docs are simply not there 🫠
  • NFC_EVENT_LLC_SDRES β€” also -- undescribed --, twin of the one above πŸ’€
  • NFC_CMD_FW_DOWNLOAD β€” a request to load/flash firmware, or an event to inform that some firmware was loaded. dual-purpose queen πŸ‘‘
  • NFC_EVENT_SE_ADDED β€” event fired when a new secure element is discovered. typically this gets sent whenever there's a new NFC controller with either an embedded SE or an UICC one connected to it through SWP ✨
  • NFC_EVENT_SE_REMOVED β€” event fired when a secure element is removed from the system, as a consequence of e.g. an NFC controller being unplugged πŸ”Œ
  • NFC_EVENT_SE_CONNECTIVITY β€” fired whenever a secure element is requesting connectivity access. for example, a UICC SE may need to talk to a sleeping modem and will notify that need by sending this event β€” and then it's up to userspace to decide whether it wakes the modem up or not 😴 your call, bestie
  • NFC_EVENT_SE_TRANSACTION β€” sent when an application running on a specific SE notifies us about the end of a transaction. the parameter for this event is the application ID (AID) 🧾
  • NFC_CMD_GET_SE β€” dump all discovered secure elements from an NFC controller πŸ“‹
  • NFC_CMD_SE_IO β€” send/receive APDUs to/from the selected secure element πŸ”
  • NFC_CMD_ACTIVATE_TARGET β€” request the NFC controller to reactivate the target 🌟
  • NFC_CMD_VENDOR β€” vendor specific command, meant to be implemented directly from the driver so it can support hardware specific operations. driver girlies, this one's yours πŸ”§
  • NFC_CMD_DEACTIVATE_TARGET β€” request the NFC controller to deactivate the target πŸŒ™

πŸ” SEE ALSO πŸ”

Kernel file ./include/uapi/linux/nfc.h and enum nfc_attrs(9) β€” go read that one next, iykyk πŸ‘€


and that's the page!! 🫢 shoutout to ./include/uapi/linux, October 2026 for the source and the date β€” mwah, love u, thanks for the enum πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from