megasas_make_sgl_fusion(9)
π megasas_make_sgl_fusion β from the Kernel API Manual, bestie β¨
Okay so picture this: we're deep in the kernel, right? And this little icon, megasas_make_sgl_fusion, has one whole job β prepping a 32-bit SGL. That's it. That's the gig. SGL stands for scatter-gather list, and if you don't know what that is, don't worry, we're gonna get you there π«Ά. This page lives in the Kernel API Manual, so it's giving very much "internal kernel function, handle with care" energy.
πΈ NAME πΈ
megasas_make_sgl_fusion β Prepares 32-bit SGL. Lowkey her whole personality. Periodt.
β¨ SYNOPSIS β¨
void megasas_make_sgl_fusion (struct megasas_instance *instance , struct
scsi_cmnd *scp , struct MPI25_IEEE_SGE_CHAIN64 *sgl_ptr , struct
megasas_cmd_fusion *cmd , int sge_count );
It returns void, meaning it gives you nothing back β no return value, no little treat, no "good job" π. She does the work and dips. Iconic behavior honestly.
π ARGUMENTS π
Five arguments, five vibes, let's go bestie:
instanceβ the adapter soft state π. Think of it as the main character of this whole operation; everything you need to know about the adapter lives in here.scpβ the SCSI command from the mid-layer π¦. It's the actual command the mid-layer handed down to us, and we're just here to help it along.sgl_ptrβ the SGL to be filled in β¨. Notice the phrasing: to be filled in. This bad boy shows up empty and it's our job to fill it. No pressure or anything π .cmdβ the cmd we are working on π₯. Yep, that's the one. Right there. The command of the hour.sge_countβ the sge count πΈ. Exactly what it says on the label β the count of the sges. We love a self-describing parameter.
Ngl, this is a fill-in-the-blanks type function, not a return-a-value type function. sgl_ptr comes back different than it arrived. That's the whole plot π§.
π SEE ALSO π
So you wanna go down the rabbit hole? Say less. Here's the whole friend group π:
First up, the kernel file where this lives:
./drivers/scsi/megaraid/megaraid_sas_fusion.c
And the rest of the crew, all section (9):
megasas_adp_reset_wait_for_ready(9)megasas_check_same_4gb_region(9)megasas_enable_intr_fusion(9)megasas_disable_intr_fusion(9)megasas_get_cmd_fusion(9)megasas_return_cmd_fusion(9)megasas_write_64bit_req_desc(9)megasas_fire_cmd_fusion(9)megasas_fusion_update_can_queue(9)megasas_free_cmds_fusion(9)megasas_create_sg_sense_fusion(9)megasas_alloc_cmds_fusion(9)wait_and_poll(9)megasas_ioc_init_fusion(9)megasas_sync_pd_seq_num(9)megasas_allocate_raid_maps(9)megasas_configure_queue_sizes(9)megasas_free_ioc_init_cmd(9)megasas_init_adapter_fusion(9)megasas_fault_detect_work(9)map_cmd_status(9)megasas_is_prp_possible(9)megasas_make_prp_nvme(9)megasas_make_sgl(9)megasas_set_pd_lba(9)megasas_stream_detect(9)megasas_set_raidflag_cpu_affinity(9)megasas_build_ldio_fusion(9)megasas_build_ld_nonrw_fusion(9)megasas_build_syspd_fusion(9)megasas_build_io_fusion(9)megasas_build_and_issue_cmd_fusion(9)megasas_complete_r1_command(9)access_irq_context(9)release_irq_context(9)complete_cmd_fusion(9)megasas_enable_irq_poll(9)megasas_sync_irqs(9)megasas_irqpoll(9)megasas_complete_cmd_dpc_fusion(9)megasas_isr_fusion(9)build_mpt_mfi_pass_thru(9)build_mpt_cmd(9)megasas_issue_dcmd_fusion(9)megasas_release_fusion(9)megasas_read_fw_status_reg_fusion(9)megasas_alloc_host_crash_buffer(9)megasas_free_host_crash_buffer(9)megasas_adp_reset_fusion(9)megasas_check_reset_fusion(9)megasas_trigger_snap_dump(9)megasas_tm_response_code(9)megasas_issue_tm(9)
Like, that's a lot of siblings π but they're all family, and honestly? Every single one of them is worth a read. Iykyk.
Okay that's the whole page, bestie π β and before you close the tab: this one came out of ./drivers/scsi/megaraid and it's dated October 2026, so jot that down in your notes app because it's lowkey important. Slay, go fill in some SGLs, and remember: no cap, the details matter π
β¨π
π¦ 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