sas_port_add_phy(9)
π sas_port_add_phy(9) β the kernel API manual, bestie edition π
Okay so we're in the Kernel API Manual today and the star of the show is sas_port_add_phy β the little function that's like "hey bestie, come join this port" for phys. Let's get into it β¨
πΈ NAME πΈ
sas_port_add_phy β add another phy to a port to form a wide port π
π¦ SYNOPSIS π¦
void sas_port_add_phy (struct sas_port *port , struct sas_phy *phy );
Like, it returns void. No drama, no return value, it just does the thing π
π ARGUMENTS π
portβ the port you're adding the phy to, iykykphyβ the phy itself, the one being added π«Ά
β DESCRIPTION β
So here's the lore, bestie: when a port is initially created, it is empty β literally has no phys. Zero. None. A whole empty vibe π
And that's a problem, because all ports must have at least one phy to operated (yes, that's exactly what the original says, we're keeping it fr fr), and all wide ports must have at least two. So one phy minimum for a port, two minimum for a wide port β those are the rules, no cap β¨
Now, the current code makes no difference between ports and wide ports π but here's the important bit: the only object that can be connected to a remote device is a port. So β and this is the whole point β ports must be formed on all devices with phys if they're connected to anything π₯
Like, you can't just leave a phy hanging with no port and expect it to be social. Form the port. Connect the thing. Periodt π
π SEE ALSO π
The whole friend group π«Ά β and heads up, the kernel file is ./drivers/scsi/scsi_transport_sas.c:
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_alloc_num(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_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)
And that's the page, bestie! π§ This little gem comes from the Kernel API Manual, sourced from ./drivers/scsi, dated October 2026 β screenshot it, cite it, live by it ππ
π¦ 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