drivers/scsi/mvsas/mv_94xx.c
Source file repositories/reference/linux-study-clean/drivers/scsi/mvsas/mv_94xx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/mvsas/mv_94xx.c- Extension
.c- Size
- 29446 bytes
- Lines
- 1183
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
mv_sas.hmv_94xx.hmv_chips.h
Detected Declarations
function mvs_94xx_detect_porttypefunction set_phy_tuningfunction set_phy_ffe_tuningfunction set_phy_ratefunction mvs_94xx_config_reg_from_hbafunction mvs_94xx_enable_xmtfunction mvs_94xx_phy_resetfunction mvs_94xx_phy_disablefunction mvs_94xx_phy_enablefunction mvs_94xx_sgpio_initfunction mvs_94xx_initfunction mvs_94xx_ioremapfunction mvs_94xx_iounmapfunction mvs_94xx_interrupt_enablefunction mvs_94xx_interrupt_disablefunction mvs_94xx_isr_statusfunction mvs_94xx_isrfunction mvs_94xx_command_activefunction mvs_94xx_clear_srs_irqfunction mvs_94xx_issue_stopfunction mvs_94xx_non_spec_ncq_errorfunction mvs_94xx_free_reg_setfunction mvs_94xx_assign_reg_setfunction mvs_94xx_make_prdfunction mvs_94xx_oob_donefunction mvs_94xx_get_dev_identify_framefunction mvs_94xx_get_att_identify_framefunction mvs_94xx_make_dev_infofunction mvs_94xx_make_att_infofunction mvs_94xx_fix_phy_infofunction mvs_94xx_phy_set_link_ratefunction mvs_94xx_clear_active_cmdsfunction mvs_94xx_spi_read_datafunction mvs_94xx_spi_write_datafunction mvs_94xx_spi_buildcmdfunction mvs_94xx_spi_issuecmdfunction mvs_94xx_spi_waitdatareadyfunction mvs_94xx_fix_dmafunction mvs_94xx_tune_interruptfunction mvs_94xx_gpio_writefunction type
Annotated Snippet
switch (i) {
case 0:
setting_0 = GENERATION_1_SETTING;
setting_1 = GENERATION_1_2_SETTING;
break;
case 1:
setting_0 = GENERATION_1_2_SETTING;
setting_1 = GENERATION_2_3_SETTING;
break;
case 2:
setting_0 = GENERATION_2_3_SETTING;
setting_1 = GENERATION_3_4_SETTING;
break;
}
/* Set:
*
* Transmitter Emphasis Enable
* Transmitter Emphasis Amplitude
* Transmitter Amplitude
*/
mvs_write_port_vsr_addr(mvi, phy_id, setting_0);
tmp = mvs_read_port_vsr_data(mvi, phy_id);
tmp &= ~(0xFBE << 16);
tmp |= (((phy_tuning.trans_emp_en << 11) |
(phy_tuning.trans_emp_amp << 7) |
(phy_tuning.trans_amp << 1)) << 16);
mvs_write_port_vsr_data(mvi, phy_id, tmp);
/* Set Transmitter Amplitude Adjust */
mvs_write_port_vsr_addr(mvi, phy_id, setting_1);
tmp = mvs_read_port_vsr_data(mvi, phy_id);
tmp &= ~(0xC000);
tmp |= (phy_tuning.trans_amp_adj << 14);
mvs_write_port_vsr_data(mvi, phy_id, tmp);
}
}
static void set_phy_ffe_tuning(struct mvs_info *mvi, int phy_id,
struct ffe_control ffe)
{
u32 tmp;
/* Don't run this if A0/B0 */
if ((mvi->pdev->revision == VANIR_A0_REV)
|| (mvi->pdev->revision == VANIR_B0_REV))
return;
/* FFE Resistor and Capacitor */
/* R10Ch DFE Resolution Control/Squelch and FFE Setting
*
* FFE_FORCE [7]
* FFE_RES_SEL [6:4]
* FFE_CAP_SEL [3:0]
*/
mvs_write_port_vsr_addr(mvi, phy_id, VSR_PHY_FFE_CONTROL);
tmp = mvs_read_port_vsr_data(mvi, phy_id);
tmp &= ~0xFF;
/* Read from HBA_Info_Page */
tmp |= ((0x1 << 7) |
(ffe.ffe_rss_sel << 4) |
(ffe.ffe_cap_sel << 0));
mvs_write_port_vsr_data(mvi, phy_id, tmp);
/* R064h PHY Mode Register 1
*
* DFE_DIS 18
*/
mvs_write_port_vsr_addr(mvi, phy_id, VSR_REF_CLOCK_CRTL);
tmp = mvs_read_port_vsr_data(mvi, phy_id);
tmp &= ~0x40001;
/* Hard coding */
/* No defines in HBA_Info_Page */
tmp |= (0 << 18);
mvs_write_port_vsr_data(mvi, phy_id, tmp);
/* R110h DFE F0-F1 Coefficient Control/DFE Update Control
*
* DFE_UPDATE_EN [11:6]
* DFE_FX_FORCE [5:0]
*/
mvs_write_port_vsr_addr(mvi, phy_id, VSR_PHY_DFE_UPDATE_CRTL);
tmp = mvs_read_port_vsr_data(mvi, phy_id);
tmp &= ~0xFFF;
/* Hard coding */
/* No defines in HBA_Info_Page */
tmp |= ((0x3F << 6) | (0x0 << 0));
mvs_write_port_vsr_data(mvi, phy_id, tmp);
Annotation
- Immediate include surface: `mv_sas.h`, `mv_94xx.h`, `mv_chips.h`.
- Detected declarations: `function mvs_94xx_detect_porttype`, `function set_phy_tuning`, `function set_phy_ffe_tuning`, `function set_phy_rate`, `function mvs_94xx_config_reg_from_hba`, `function mvs_94xx_enable_xmt`, `function mvs_94xx_phy_reset`, `function mvs_94xx_phy_disable`, `function mvs_94xx_phy_enable`, `function mvs_94xx_sgpio_init`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.