lpfc_create_device_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– lpfc_create_device_data(9) β€” the kernel API manual, but make it make sense πŸŽ€

okay so bestie, we're in the Kernel API Manual today and this page is literally about lpfc_create_device_data β€” the little function that spins up a whole device data structure for OAS. yes, that OAS. stay with me, it's gonna slay. ✨


🌸 NAME 🌸

lpfc_create_device_data β€” creates and initializes device data structure for OAS

like, it makes the thing and sets up the thing, both. overachiever behaviour fr fr πŸ’…


✨ SYNOPSIS ✨

struct lpfc_device_data* lpfc_create_device_data (struct lpfc_hba *phba
, struct lpfc_name *vport_wwpn , struct lpfc_name *target_wwpn ,
uint64_t lun , uint32_t pri , bool atomic_create );

that's the whole signature, no cap β€” copy it exactly if you're typing it out. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

six of them. all iconic, all doing their job:

  • phba β€” pointer to the host bus adapter structure. the main character, honestly.
  • vport_wwpn β€” pointer to the vport's wwpn information.
  • target_wwpn β€” pointer to the target's wwpn information.
  • lun β€” the lun on the target. yep, just the lun, living its life.
  • pri β€” priority. that's it. that's the whole description, and we respect it.
  • atomic_create β€” flag that tells us whether memory should be allocated with the GFP_ATOMIC flag or not. so like, "can we sleep or are we in a rush" energy 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

so this routine creates a device data structure β€” and not just any structure, it's the one that holds all the identifying info for the device: host wwpn, target wwpn, lun. it also keeps the state of OAS, tracks whether or not the corresponding lun is actually available by the system, and holds a pointer to the rport data. it's giving "one struct to hold the entire vibe check of a device" πŸ‘‘

return codes, bestie, memorise these:

NULL - Error
Pointer to lpfc_device_data - Success

so if you get NULL back, that's a no. if you get a lpfc_device_data pointer back, that's a yes. slay. πŸ’–


πŸ”₯ SEE ALSO πŸ”₯

first up, the actual file, because context is everything:

  • Kernel file ./drivers/scsi/lpfc/lpfc_scsi.c

and now the friend group β€” the whole extended squad, all of them, in order, exactly as the manual lists them:

that's the whole list, nothing skipped, nothing merged β€” go read them if you're nosy, iykyk 🌈


ok real talk for a sec 🫢 β€” NULL means error, a valid lpfc_device_data pointer means success. always check which one you got before you go touching that struct, bestie. no cap.

and that's the page!! πŸ’œ this one lives under ./drivers/scsi/lpfc, dated October 2026 β€” mwah, bookmark it, screenshot it, send it to the group chat. periodt. πŸ“πŸ§š

πŸ“¦ where this page comes from