lpfc_link_speed_store(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so this is a page from the Kernel API Manual, and the function it's about is lpfc_link_speed_store β€” the one that sets the adapter's link speed. yes it's giving sysfs-callback energy, and yes we're gonna get through it together 🫢


✨ NAME ✨

lpfc_link_speed_store β€” literally just "set the adapter's link speed". that's the whole vibe. no cap. πŸŽ€


🌸 SYNOPSIS 🌸

ssize_t lpfc_link_speed_store (struct device *dev , struct
       device_attribute *attr , const char *buf , size_t count );

that's the signature, copy it exactly, do not freestyle it, i'm begging 😭


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” a pointer to the class device. that's your main character right there πŸ‘‘
  • attr β€” unused. honestly? it's just there. it's invited to the party but it's not doing anything, and that's fine πŸ’€
  • buf β€” the data buffer. this is where the actual data lives.
  • count β€” the size of the data buffer. how many bytes we're working with.

πŸ’– DESCRIPTION πŸ’–

so here's the tea: if val is in a valid range, then we set the adapter's link speed field and we issue a lip. that's the good path, that's the slay path ✨

but β€” and this is the important part β€” if the lip fails, we reset the link speed to the old value. like a full undo. we do not leave things half-done in this house πŸ™ˆ


πŸ”₯ NOTES πŸ”₯

if the value is not in range, you log a kernel error message and return an error. periodt. no silent failures, we don't do that here πŸ’…


⭐ RETURN ⭐

  • zero if val is in range and the lip is okay. we love a clean zero πŸ₯³
  • non-zero return value from lpfc_issue_lip
  • -EINVAL when val is out of range. classic. iconic. we've all been there 😭

🌈 SEE ALSO 🌈

okay bestie this list is long, but every single one of these is here, in order, untouched, because i would never do you like that 🫢

the kernel file ./drivers/scsi/lpfc/lpfc_attr.c, plus: lpfc_jedec_to_ascii(9), lpfc_drvr_version_show(9), lpfc_enable_fip_show(9), lpfc_info_show(9), lpfc_serialnum_show(9), lpfc_temp_sensor_show(9), lpfc_modeldesc_show(9), lpfc_modelname_show(9), lpfc_programtype_show(9), lpfc_vportnum_show(9), lpfc_fwrev_show(9), lpfc_hdw_show(9), lpfc_option_rom_version_show(9), lpfc_link_state_show(9), lpfc_sli4_protocol_show(9), lpfc_oas_supported_show(9), lpfc_link_state_store(9), lpfc_num_discovered_ports_show(9), lpfc_issue_lip(9), lpfc_do_offline(9), lpfc_reset_pci_bus(9), lpfc_selective_reset(9), lpfc_issue_reset(9), lpfc_sli4_pdev_status_reg_wait(9), lpfc_sli4_pdev_reg_request(9), lpfc_nport_evt_cnt_show(9), lpfc_board_mode_show(9), lpfc_board_mode_store(9), lpfc_get_hba_info(9), lpfc_max_rpi_show(9), lpfc_used_rpi_show(9), lpfc_max_xri_show(9), lpfc_used_xri_show(9), lpfc_max_vpi_show(9), lpfc_used_vpi_show(9), lpfc_npiv_info_show(9), lpfc_poll_show(9), lpfc_poll_store(9), lpfc_sriov_hw_max_virtfn_show(9), lpfc_enable_bbcr_set(9), lpfc_wwn_set(9), lpfc_oas_tgt_show(9), lpfc_oas_tgt_store(9), lpfc_oas_priority_show(9), lpfc_oas_priority_store(9), lpfc_oas_vpt_show(9), lpfc_oas_vpt_store(9), lpfc_oas_lun_state_show(9), lpfc_oas_lun_state_store(9), lpfc_oas_lun_status_show(9), lpfc_oas_lun_state_set(9), lpfc_oas_lun_get_next(9), lpfc_oas_lun_state_change(9), lpfc_oas_lun_show(9), lpfc_oas_lun_store(9), lpfc_nodev_tmo_show(9), lpfc_nodev_tmo_init(9), lpfc_update_rport_devloss_tmo(9), lpfc_nodev_tmo_set(9), lpfc_devloss_tmo_set(9), lpfc_tgt_queue_depth_set(9), lpfc_restrict_login_init(9), lpfc_restrict_login_set(9), lpfc_topology_store(9), lpfc_static_vport_show(9), lpfc_link_speed_init(9), lpfc_aer_support_store(9), lpfc_aer_cleanup_state(9), lpfc_sriov_nr_virtfn_store(9), lpfc_request_firmware_upgrade_store(9), lpfc_request_firmware_upgrade_init(9), lpfc_force_rscn_store(9), lpfc_force_rscn_init(9), lpfc_fcp_imax_store(9), lpfc_fcp_imax_init(9), lpfc_cq_max_proc_limit_store(9), lpfc_cq_max_proc_limit_init(9), lpfc_fcp_cpu_map_show(9), lpfc_fcp_cpu_map_store(9), lpfc_fcp_cpu_map_init(9), lpfc_cpumask_irq_mode_init(9), lpfc_irq_chann_show(9), lpfc_sg_seg_cnt_show(9), lpfc_sg_seg_cnt_init(9), sysfs_ctlreg_write(9), sysfs_ctlreg_read(9), sysfs_mbox_write(9), sysfs_mbox_read(9), lpfc_alloc_sysfs_attr(9), lpfc_free_sysfs_attr(9), lpfc_get_host_symbolic_name(9), lpfc_get_host_port_id(9), lpfc_get_host_port_type(9), lpfc_get_host_port_state(9), lpfc_get_host_speed(9), lpfc_get_host_fabric_name(9), lpfc_get_stats(9), lpfc_reset_stats(9), lpfc_get_enc_info(9), lpfc_get_node_by_target(9), lpfc_get_starget_port_id(9), lpfc_get_starget_node_name(9), lpfc_get_starget_port_name(9), lpfc_set_rport_loss_tmo(9), lpfc_set_vport_symbolic_name(9), lpfc_hba_log_verbose_init(9), lpfc_get_hba_function_mode(9), lpfc_get_cfgparam(9), lpfc_nvme_mod_param_dep(9), lpfc_get_vport_cfgparam(9).

like i said. long list. but we got through it together and that's what matters πŸ’œ


and that's the whole page, bestie β€” every argument, every return value, every reference, all of it intact. now go forth and set those link speeds responsibly 🌸

okay final sign-off moment πŸŽ€ this one came out of ./drivers/scsi/lpfc, it's the October 2026 version of the Kernel API Manual, and the page itself is lpfc_link_speed_store(9) β€” that's the manual name, right there, folded in all cute at the top and again at the bottom because i love closure ✨ bye bestie, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from