sas_port_alloc_num(9)
π sas_port_alloc_num β from the Kernel API Manual, bestie
Okay so picture this: it's the Kernel API Manual, and we're talking about sas_port_alloc_num(9). It's the little function that sets up a SAS port for you, number and all. Let's get into it π«Ά
β¨ NAME β¨
sas_port_alloc_num β allocate and initialize a SAS port structure. That's the whole vibe. It builds the port, it gives it a number, it's a whole matchmaker situation π
π SYNOPSIS π
struct sas_port * sas_port_alloc_num (struct device *parent );
Like, that's literally it. One arg. We love a low-effort queen π
πΈ ARGUMENTS πΈ
parentβ the parent device, aka the device that's gonna be this port's parent in the tree. The one who takes care of it. A real main character energy move π
π¦ DESCRIPTION π¦
So what it does: it allocates a SAS port structure and a number to go with it. Two for one, slay β¨
This interface is really meant for adapters where the port number genuinely has no meaning β like, the number is not the point, bestie β so in those cases the sas class should be the one managing them. Let the class handle it, it's got this π
Then it gets added to the device tree, right below the device you passed in as parent. And real talk: that parent must be either a Scsi_Host or a sas_expander_device. Those are the only two acceptable parentals. No exceptions, no cap π
π₯ RETURN π₯
NULL on error. Yep, just NULL. If it doesn't work out, that's what you get back, so check for it before you start building your whole life on top of it bestie π
π SEE ALSO π
Kernel file ./drivers/scsi/scsi_transport_sas.c β that's the home base, iykyk. And the whole extended friend group:
sas_remove_children(9)sas_remove_host(9)sas_get_address(9)sas_tlr_supported(9)sas_disable_tlr(9)sas_enable_tlr(9)sas_ata_ncq_prio_supported(9)sas_phy_alloc(9)sas_phy_add(9)sas_phy_free(9)sas_phy_delete(9)scsi_is_sas_phy(9)sas_port_alloc(9)sas_port_add(9)sas_port_free(9)sas_port_delete(9)scsi_is_sas_port(9)sas_port_get_phy(9)sas_port_add_phy(9)sas_port_delete_phy(9)sas_rphy_initialize(9)sas_end_device_alloc(9)sas_expander_alloc(9)sas_rphy_add(9)sas_rphy_free(9)sas_rphy_delete(9)sas_rphy_unlink(9)sas_rphy_remove(9)scsi_is_sas_rphy(9)sas_attach_transport(9)sas_release_transport(9)
That's the whole group chat, go say hi π§
Fr fr, one last thing:parenthas to be aScsi_Hostor asas_expander_device. Not a soft suggestion, it's the rule. Don't come crying to me π€
Alright bestie, that's the page π it lives over in <cyan>./drivers/scsi</cyan>, dated October 2026, and it's sas_port_alloc_num(9) out of the Kernel API Manual. Mwah, go allocate something iconic π
π¦ 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