Lines Matching refs:ld

57 #define SPAN_ROW_SIZE(map, ld, index_) (MR_LdSpanPtrGet(ld, index_, map)->spanRowSize)  argument
58 #define SPAN_ROW_DATA_SIZE(map_, ld, index_) (MR_LdSpanPtrGet(ld, index_, map)->spanRowDataSize) argument
64 static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld,
67 static u64 get_row_from_strip(struct megasas_instance *instance, u32 ld,
101 struct MR_LD_RAID *MR_LdRaidGet(u32 ld, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdRaidGet() argument
103 return &map->raidMap.ldSpanMap[ld].ldRaid; in MR_LdRaidGet()
106 static struct MR_SPAN_BLOCK_INFO *MR_LdSpanInfoGet(u32 ld, in MR_LdSpanInfoGet() argument
110 return &map->raidMap.ldSpanMap[ld].spanBlock[0]; in MR_LdSpanInfoGet()
113 static u8 MR_LdDataArmGet(u32 ld, u32 armIdx, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdDataArmGet() argument
115 return map->raidMap.ldSpanMap[ld].dataArmMap[armIdx]; in MR_LdDataArmGet()
123 u16 MR_LdSpanArrayGet(u32 ld, u32 span, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdSpanArrayGet() argument
125 return le16_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span].span.arrayRef); in MR_LdSpanArrayGet()
138 u16 MR_GetLDTgtId(u32 ld, struct MR_DRV_RAID_MAP_ALL *map) in MR_GetLDTgtId() argument
140 return le16_to_cpu(map->raidMap.ldSpanMap[ld].ldRaid.targetId); in MR_GetLDTgtId()
148 static struct MR_LD_SPAN *MR_LdSpanPtrGet(u32 ld, u32 span, in MR_LdSpanPtrGet() argument
151 return &map->raidMap.ldSpanMap[ld].spanBlock[span].span; in MR_LdSpanPtrGet()
311 u16 ld; in MR_ValidateMapInfo() local
358 ld = MR_TargetIdToLdGet(i, drv_map); in MR_ValidateMapInfo()
361 if (ld >= MEGASAS_MAX_SUPPORTED_LD_IDS) in MR_ValidateMapInfo()
364 raid = MR_LdRaidGet(ld, drv_map); in MR_ValidateMapInfo()
373 static u32 MR_GetSpanBlock(u32 ld, u64 row, u64 *span_blk, in MR_GetSpanBlock() argument
376 struct MR_SPAN_BLOCK_INFO *pSpanBlock = MR_LdSpanInfoGet(ld, map); in MR_GetSpanBlock()
378 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in MR_GetSpanBlock()
424 u32 ld, u64 row, u64 *span_blk, struct MR_DRV_RAID_MAP_ALL *map) in mr_spanset_get_span_block() argument
427 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in mr_spanset_get_span_block()
434 span_set = &(ldSpanInfo[ld].span_set[info]); in mr_spanset_get_span_block()
443 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in mr_spanset_get_span_block()
445 quad = &map->raidMap.ldSpanMap[ld]. in mr_spanset_get_span_block()
487 u32 ld, u64 strip, struct MR_DRV_RAID_MAP_ALL *map) in get_row_from_strip() argument
490 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_row_from_strip()
497 span_set = &(ldSpanInfo[ld].span_set[info]); in get_row_from_strip()
510 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_row_from_strip()
544 u32 ld, u64 row, struct MR_DRV_RAID_MAP_ALL *map) in get_strip_from_row() argument
547 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_strip_from_row()
555 span_set = &(ldSpanInfo[ld].span_set[info]); in get_strip_from_row()
563 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_strip_from_row()
565 quad = &map->raidMap.ldSpanMap[ld]. in get_strip_from_row()
584 ld, (long unsigned int)row); in get_strip_from_row()
605 u32 ld, u64 strip, struct MR_DRV_RAID_MAP_ALL *map) in get_arm_from_strip() argument
608 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_arm_from_strip()
614 span_set = &(ldSpanInfo[ld].span_set[info]); in get_arm_from_strip()
626 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_arm_from_strip()
642 ld, (long unsigned int)strip); in get_arm_from_strip()
648 static u8 get_arm(struct megasas_instance *instance, u32 ld, u8 span, u64 stripe, in get_arm() argument
651 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_arm()
659 arm = mega_mod64(stripe, SPAN_ROW_SIZE(map, ld, span)); in get_arm()
663 arm = get_arm_from_strip(instance, ld, stripe, map); in get_arm()
690 static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld, in mr_spanset_get_phy_params() argument
695 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in mr_spanset_get_phy_params()
713 logArm = get_arm_from_strip(instance, ld, stripRow, map); in mr_spanset_get_phy_params()
716 rowMod = mega_mod64(row, SPAN_ROW_SIZE(map, ld, span)); in mr_spanset_get_phy_params()
717 armQ = SPAN_ROW_SIZE(map, ld, span) - 1 - rowMod; in mr_spanset_get_phy_params()
719 if (arm >= SPAN_ROW_SIZE(map, ld, span)) in mr_spanset_get_phy_params()
720 arm -= SPAN_ROW_SIZE(map, ld, span); in mr_spanset_get_phy_params()
724 physArm = get_arm(instance, ld, span, stripRow, map); in mr_spanset_get_phy_params()
728 arRef = MR_LdSpanArrayGet(ld, span, map); in mr_spanset_get_phy_params()
759 *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); in mr_spanset_get_phy_params()
791 static u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow, in MR_GetPhyParams() argument
796 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in MR_GetPhyParams()
826 physArm = MR_LdDataArmGet(ld, mega_mod64(stripRow, in MR_GetPhyParams()
835 span = (u8)MR_GetSpanBlock(ld, row, pdBlock, map); in MR_GetPhyParams()
841 arRef = MR_LdSpanArrayGet(ld, span, map); in MR_GetPhyParams()
875 *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); in MR_GetPhyParams()
903 u32 ld, u64 stripNo, in mr_get_phy_params_r56_rmw() argument
908 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in mr_get_phy_params_r56_rmw()
929 span = (u8)MR_GetSpanBlock(ld, rowNum, pdBlock, map); in mr_get_phy_params_r56_rmw()
990 u16 ld; in MR_BuildRaidContext() local
1000 ld = MR_TargetIdToLdGet(ldTgtId, map); in MR_BuildRaidContext()
1001 raid = MR_LdRaidGet(ld, map); in MR_BuildRaidContext()
1010 if (MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize == 0) in MR_BuildRaidContext()
1019 MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize); in MR_BuildRaidContext()
1040 start_row = get_row_from_strip(instance, ld, start_strip, map); in MR_BuildRaidContext()
1041 endRow = get_row_from_strip(instance, ld, endStrip, map); in MR_BuildRaidContext()
1054 ld, start_row, pdBlock, map); in MR_BuildRaidContext()
1131 if (start_strip == (get_strip_from_row(instance, ld, start_row, map) + in MR_BuildRaidContext()
1132 SPAN_ROW_DATA_SIZE(map, ld, startlba_span) - 1)) { in MR_BuildRaidContext()
1146 if (endStrip == get_strip_from_row(instance, ld, endRow, map)) in MR_BuildRaidContext()
1171 mr_get_phy_params_r56_rmw(instance, ld, start_strip, io_info, in MR_BuildRaidContext()
1181 mr_spanset_get_phy_params(instance, ld, in MR_BuildRaidContext()
1184 MR_GetPhyParams(instance, ld, start_strip, in MR_BuildRaidContext()
1195 mr_spanset_get_phy_params(instance, ld, in MR_BuildRaidContext()
1199 MR_GetPhyParams(instance, ld, in MR_BuildRaidContext()
1230 u16 ld; in mr_update_span_set() local
1234 ld = MR_TargetIdToLdGet(ldCount, map); in mr_update_span_set()
1235 if (ld >= (MAX_LOGICAL_DRIVES_EXT - 1)) in mr_update_span_set()
1237 raid = MR_LdRaidGet(ld, map); in mr_update_span_set()
1240 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in mr_update_span_set()
1244 span_set = &(ldSpanInfo[ld].span_set[element]); in mr_update_span_set()
1245 quad = &map->raidMap.ldSpanMap[ld]. in mr_update_span_set()
1253 if (le32_to_cpu(map->raidMap.ldSpanMap[ld]. in mr_update_span_set()
1261 (ld, count, map)->spanRowDataSize; in mr_update_span_set()
1287 span_set_prev = &(ldSpanInfo[ld]. in mr_update_span_set()
1325 u16 ld; in mr_update_load_balance_params() local
1332 ld = MR_TargetIdToLdGet(ldCount, drv_map); in mr_update_load_balance_params()
1333 if (ld >= MAX_LOGICAL_DRIVES_EXT - 1) { in mr_update_load_balance_params()
1338 raid = MR_LdRaidGet(ld, drv_map); in mr_update_load_balance_params()
1355 u16 pend0, pend1, ld; in megasas_get_best_arm_pd() local
1367 ld = MR_TargetIdToLdGet(io_info->ldTgtId, drv_map); in megasas_get_best_arm_pd()
1368 raid = MR_LdRaidGet(ld, drv_map); in megasas_get_best_arm_pd()
1370 SPAN_ROW_SIZE(drv_map, ld, span) : raid->rowSize; in megasas_get_best_arm_pd()
1372 arRef = MR_LdSpanArrayGet(ld, span, drv_map); in megasas_get_best_arm_pd()