ENUM STRUCT_DEVICE_FLAGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

enum struct_device_flags β€” that's the enum, bestie, and this page is from the Kernel API Manual. It's all about the flags living inside struct device, no cap 🫢


πŸŽ€ SYNOPSIS πŸŽ€

enum struct_device_flags {
    DEV_FLAG_READY_TO_PROBE ,
    DEV_FLAG_CAN_MATCH ,
    DEV_FLAG_DMA_IOMMU ,
    DEV_FLAG_DMA_SKIP_SYNC ,
    DEV_FLAG_DMA_OPS_BYPASS ,
    DEV_FLAG_STATE_SYNCED ,
    DEV_FLAG_DMA_COHERENT ,
    DEV_FLAG_OF_NODE_REUSED ,
    DEV_FLAG_OFFLINE_DISABLED ,
    DEV_FLAG_OFFLINE ,
    DEV_FLAG_COUNT

};

✨ Constants ✨

Okay so here's the whole flag lineup, and yes, every single one is iconic in its own way πŸ’…

  • DEV_FLAG_READY_TO_PROBE β€” if this one's set, then device_add has finished enough initialization that probe could be called. It's giving "ready, set, probe" energy ✨
  • DEV_FLAG_CAN_MATCH β€” the device has matched with a driver at least once, or it's in a bus (like AMBA) which can't check for matching drivers until other devices probe successfully. Lowkey a matchmaker flag πŸŽ€
  • DEV_FLAG_DMA_IOMMU β€” the device is using the default IOMMU implementation for DMA and doesn't rely on the dma_ops structure. Very "I got my own setup, thanks" πŸ’…
  • DEV_FLAG_DMA_SKIP_SYNC β€” DMA sync operations can be skipped for coherent buffers. Skipping the sync, not the vibes πŸ¦‹
  • DEV_FLAG_DMA_OPS_BYPASS β€” if set, then the dma_ops are bypassed for the streaming DMA operations (->map_* / ->unmap_* / ->sync_*), and optional (if the coherent mask is large enough) also for dma allocations. This flag is managed by the dma ops instance from ->dma_supported. Big main-character energy for the bypass 😀
  • DEV_FLAG_STATE_SYNCED β€” the hardware state of this device has been synced to match the software state of this device by calling the driver/bus sync_state callback. Synced and slaying πŸ’«
  • DEV_FLAG_DMA_COHERENT β€” this particular device is dma coherent, even if the architecture supports non-coherent devices. It's special like that πŸ’–
  • DEV_FLAG_OF_NODE_REUSED β€” set if the device-tree node is shared with an ancestor device. Family tree but make it kernel 🌳
  • DEV_FLAG_OFFLINE_DISABLED β€” if set, the device is permanently online. Never offline, not even for a vibe check πŸ”₯
  • DEV_FLAG_OFFLINE β€” set after successful invocation of bus type's .offline. Bye bestie, you're offline now 😭
  • DEV_FLAG_COUNT β€” number of defined struct_device_flags. The final boss of the enum count πŸ‘‘

πŸ’« Description πŸ’«

Each flag should have a set of accessor functions created via __create_dev_flag_accessors for each access. Like, every flag gets its accessor treatment, okay? Periodt πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/linux/device.h is the home base, and here's the whole squad of references:

Source/version check: this page is from ./include/linux, dated October 2026, and its manual name is enum struct_device_flags(9). Now go forth and flag responsibly, bestie πŸ’…βœ¨
πŸ“¦ where this page comes from