sysfs_ctlreg_read(9)
π sysfs_ctlreg_read(9) β like, the Kernel API Manual bestie β¨
okay so welcome to sysfs_ctlreg_read, a page straight out of the Linux Kernel API Manual, and honestly? she's a whole vibe. sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
sysfs_ctlreg_read β the read method for reading from ctlreg. that's it, that's the function π
π¦ SYNOPSIS π¦
ssize_t sysfs_ctlreg_read (struct file *filp , struct kobject *kobj ,
const struct bin_attribute *bin_attr , char *buf , loff_t off , size_t
count );
look at her. six arguments. main character energy fr fr π
π ARGUMENTS π
filpβ the open sysfs file. the actual file object you're working with πkobjβ the kernel kobject that contains the kernel class device. her little container, her home πbin_attrβ the kernel attributes passed to us. thanks for the deets, attr π«Άbufβ if everything goes well, this contains the data from the adapter IOREG space. the payoff!! β¨offβ the offset into the buffer to the beginning of the data. where we start reading, lowkey π―countβ bytes to transfer. how much we're moving, no cap π¦
πΈ DESCRIPTION πΈ
so you get to this through /sys/class/scsi_host/hostxxx/ctlreg β that's the door, that's the address, that's where the magic happens π«
she uses the adapter io control registers to read data into buf. iconic behaviour honestly π₯
π RETURN π
okay bestie, the return values, let's go, no skipping:
-ERANGEβ theoffandcountcombo is out of range π-EINVALβoff,countor thebufaddress is invalid π- the value of
countβ meaning it worked, andbufhas the contents that were read, slay π
π SEE ALSO π
the kernel file ./drivers/scsi/lpfc/lpfc_attr.c, plus the entire extended friend group, and yes we're naming every single one of them because nobody gets left out at this party π:
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_store(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_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)
and that's the page, bestie π§π
ngl this one lives at./drivers/scsi/lpfc, dated October 2026, and she's filed undersysfs_ctlreg_read(9). periodt π β¨
π¦ 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