ice_cpi_read_phy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ice_cpi_read_phy β€” read a CPI port register (kernel API manual, bestie edition) πŸ’…

okay so picture this: you're deep in the kernel, you're chillin' in the ice driver, and you just gotta read a register off a CPI port. that's literally what ice_cpi_read_phy is for. it's giving "small function, big responsibility." iconic behavior, no cap. ✨


🌸 SYNOPSIS 🌸

int ice_cpi_read_phy (struct ice_hw *hw , u8 phy , u32 addr , u32 *val );

like, that's the whole vibe. four args, one int coming back atcha. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • hw β€” pointer to the HW struct. your hardware bestie, the one holding all the state. don't lose her πŸ’–
  • phy β€” the phy index of the port the CPI action is taken on. which port are we doing the thing on? this one, bestie.
  • addr β€” the PHY register address. the exact spot you're peeking at πŸ‘€
  • val β€” storage for the register value. you hand over a pointer and the value gets dropped in there. it's a whole "you give me a place, I give you the tea" situation β˜•

⭐ RETURN ⭐

  • 0 on success β€” slay, it worked πŸ’…
  • other error codes when it failed to read from PHY β€” yeah that happens sometimes, it's not giving what it's supposed to give 😭

πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file that has all the lore:

./drivers/net/ethernet/intel/ice/ice_cpi.c

and the whole friend group, fr fr:

ice_cpi_get_dest_dev(9), ice_cpi_write_phy(9), ice_cpi_wait_req0_ack0(9), ice_cpi_wait_ack(9), ice_cpi_req0(9), ice_cpi_exec_cmd(9), ice_cpi_phy_lock(9), ice_cpi_exec(9), ice_cpi_set_cmd(9), ice_cpi_ena_dis_clk_ref(9)


ngl, go read ice_cpi_write_phy(9) next if you're feeling spicy β€” that's the read function's partner in crime πŸ”₯

okay that's the page!! this lil gem lives down in ./drivers/net/ethernet/intel/ice, version/date situation is October 2026, and it's filed under ice_cpi_read_phy(9) in the kernel API manual. mwah, mwah, go read a register responsibly πŸ’œπŸŒˆ

πŸ“¦ where this page comes from