Lines Matching refs:ld
73 #define SPAN_ROW_SIZE(map, ld, index_) (MR_LdSpanPtrGet(ld, index_, map)->spanRowSize) argument
74 #define SPAN_ROW_DATA_SIZE(map_, ld, index_) (MR_LdSpanPtrGet(ld, index_, map)->spanRowDataSize) argument
80 static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld,
83 static u64 get_row_from_strip(struct megasas_instance *instance, u32 ld,
118 struct MR_LD_RAID *MR_LdRaidGet(u32 ld, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdRaidGet() argument
120 return &map->raidMap.ldSpanMap[ld].ldRaid; in MR_LdRaidGet()
123 static struct MR_SPAN_BLOCK_INFO *MR_LdSpanInfoGet(u32 ld, in MR_LdSpanInfoGet() argument
127 return &map->raidMap.ldSpanMap[ld].spanBlock[0]; in MR_LdSpanInfoGet()
130 static u8 MR_LdDataArmGet(u32 ld, u32 armIdx, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdDataArmGet() argument
132 return map->raidMap.ldSpanMap[ld].dataArmMap[armIdx]; in MR_LdDataArmGet()
140 u16 MR_LdSpanArrayGet(u32 ld, u32 span, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdSpanArrayGet() argument
142 return le16_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span].span.arrayRef); in MR_LdSpanArrayGet()
150 u16 MR_GetLDTgtId(u32 ld, struct MR_DRV_RAID_MAP_ALL *map) in MR_GetLDTgtId() argument
152 return le16_to_cpu(map->raidMap.ldSpanMap[ld].ldRaid.targetId); in MR_GetLDTgtId()
160 static struct MR_LD_SPAN *MR_LdSpanPtrGet(u32 ld, u32 span, in MR_LdSpanPtrGet() argument
163 return &map->raidMap.ldSpanMap[ld].spanBlock[span].span; in MR_LdSpanPtrGet()
261 u16 ld; in MR_ValidateMapInfo() local
299 ld = MR_TargetIdToLdGet(ldCount, drv_map); in MR_ValidateMapInfo()
300 raid = MR_LdRaidGet(ld, drv_map); in MR_ValidateMapInfo()
307 u32 MR_GetSpanBlock(u32 ld, u64 row, u64 *span_blk, in MR_GetSpanBlock() argument
310 struct MR_SPAN_BLOCK_INFO *pSpanBlock = MR_LdSpanInfoGet(ld, map); in MR_GetSpanBlock()
312 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in MR_GetSpanBlock()
360 u16 ld; in getSpanInfo() local
363 ld = MR_TargetIdToLdGet(ldCount, map); in getSpanInfo()
364 if (ld >= (MAX_LOGICAL_DRIVES_EXT - 1)) in getSpanInfo()
366 raid = MR_LdRaidGet(ld, map); in getSpanInfo()
368 ld, raid->spanDepth); in getSpanInfo()
372 le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in getSpanInfo()
375 span_set = &(ldSpanInfo[ld].span_set[element]); in getSpanInfo()
401 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in getSpanInfo()
404 quad = &map->raidMap.ldSpanMap[ld]. in getSpanInfo()
444 u32 ld, u64 row, u64 *span_blk, struct MR_DRV_RAID_MAP_ALL *map) in mr_spanset_get_span_block() argument
447 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in mr_spanset_get_span_block()
454 span_set = &(ldSpanInfo[ld].span_set[info]); in mr_spanset_get_span_block()
463 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in mr_spanset_get_span_block()
465 quad = &map->raidMap.ldSpanMap[ld]. in mr_spanset_get_span_block()
507 u32 ld, u64 strip, struct MR_DRV_RAID_MAP_ALL *map) in get_row_from_strip() argument
510 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_row_from_strip()
517 span_set = &(ldSpanInfo[ld].span_set[info]); in get_row_from_strip()
530 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_row_from_strip()
576 u32 ld, u64 row, struct MR_DRV_RAID_MAP_ALL *map) in get_strip_from_row() argument
579 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_strip_from_row()
587 span_set = &(ldSpanInfo[ld].span_set[info]); in get_strip_from_row()
595 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_strip_from_row()
597 quad = &map->raidMap.ldSpanMap[ld]. in get_strip_from_row()
616 ld, (long unsigned int)row); in get_strip_from_row()
637 u32 ld, u64 strip, struct MR_DRV_RAID_MAP_ALL *map) in get_arm_from_strip() argument
640 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_arm_from_strip()
646 span_set = &(ldSpanInfo[ld].span_set[info]); in get_arm_from_strip()
658 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_arm_from_strip()
669 "for ld=0x%x strip=0x%lx arm is 0x%x\n", ld, in get_arm_from_strip()
678 ld, (long unsigned int)strip); in get_arm_from_strip()
684 u8 get_arm(struct megasas_instance *instance, u32 ld, u8 span, u64 stripe, in get_arm() argument
687 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_arm()
695 arm = mega_mod64(stripe, SPAN_ROW_SIZE(map, ld, span)); in get_arm()
699 arm = get_arm_from_strip(instance, ld, stripe, map); in get_arm()
726 static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld, in mr_spanset_get_phy_params() argument
731 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in mr_spanset_get_phy_params()
751 logArm = get_arm_from_strip(instance, ld, stripRow, map); in mr_spanset_get_phy_params()
754 rowMod = mega_mod64(row, SPAN_ROW_SIZE(map, ld, span)); in mr_spanset_get_phy_params()
755 armQ = SPAN_ROW_SIZE(map, ld, span) - 1 - rowMod; in mr_spanset_get_phy_params()
757 if (arm >= SPAN_ROW_SIZE(map, ld, span)) in mr_spanset_get_phy_params()
758 arm -= SPAN_ROW_SIZE(map, ld, span); in mr_spanset_get_phy_params()
762 physArm = get_arm(instance, ld, span, stripRow, map); in mr_spanset_get_phy_params()
766 arRef = MR_LdSpanArrayGet(ld, span, map); in mr_spanset_get_phy_params()
784 *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); in mr_spanset_get_phy_params()
808 u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow, in MR_GetPhyParams() argument
813 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in MR_GetPhyParams()
845 physArm = MR_LdDataArmGet(ld, mega_mod64(stripRow, in MR_GetPhyParams()
854 span = (u8)MR_GetSpanBlock(ld, row, pdBlock, map); in MR_GetPhyParams()
860 arRef = MR_LdSpanArrayGet(ld, span, map); in MR_GetPhyParams()
881 *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); in MR_GetPhyParams()
904 u32 ld, stripSize, stripe_mask; in MR_BuildRaidContext() local
924 ld = MR_TargetIdToLdGet(ldTgtId, map); in MR_BuildRaidContext()
925 raid = MR_LdRaidGet(ld, map); in MR_BuildRaidContext()
932 if (MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize == 0) in MR_BuildRaidContext()
941 MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize); in MR_BuildRaidContext()
961 start_row = get_row_from_strip(instance, ld, start_strip, map); in MR_BuildRaidContext()
962 endRow = get_row_from_strip(instance, ld, endStrip, map); in MR_BuildRaidContext()
975 ld, start_row, pdBlock, map); in MR_BuildRaidContext()
1061 if (start_strip == (get_strip_from_row(instance, ld, start_row, map) + in MR_BuildRaidContext()
1062 SPAN_ROW_DATA_SIZE(map, ld, startlba_span) - 1)) { in MR_BuildRaidContext()
1076 if (endStrip == get_strip_from_row(instance, ld, endRow, map)) in MR_BuildRaidContext()
1105 mr_spanset_get_phy_params(instance, ld, in MR_BuildRaidContext()
1108 MR_GetPhyParams(instance, ld, start_strip, in MR_BuildRaidContext()
1119 mr_spanset_get_phy_params(instance, ld, in MR_BuildRaidContext()
1123 MR_GetPhyParams(instance, ld, in MR_BuildRaidContext()
1134 get_arm_from_strip(instance, ld, start_strip, map); in MR_BuildRaidContext()
1160 u16 ld; in mr_update_span_set() local
1164 ld = MR_TargetIdToLdGet(ldCount, map); in mr_update_span_set()
1165 if (ld >= (MAX_LOGICAL_DRIVES_EXT - 1)) in mr_update_span_set()
1167 raid = MR_LdRaidGet(ld, map); in mr_update_span_set()
1170 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in mr_update_span_set()
1174 span_set = &(ldSpanInfo[ld].span_set[element]); in mr_update_span_set()
1175 quad = &map->raidMap.ldSpanMap[ld]. in mr_update_span_set()
1183 if (le32_to_cpu(map->raidMap.ldSpanMap[ld]. in mr_update_span_set()
1191 (ld, count, map)->spanRowDataSize; in mr_update_span_set()
1195 (ld, count, map)->spanRowDataSize); in mr_update_span_set()
1221 span_set_prev = &(ldSpanInfo[ld]. in mr_update_span_set()
1263 u16 ld; in mr_update_load_balance_params() local
1270 ld = MR_TargetIdToLdGet(ldCount, drv_map); in mr_update_load_balance_params()
1271 if (ld >= MAX_LOGICAL_DRIVES_EXT) { in mr_update_load_balance_params()
1276 raid = MR_LdRaidGet(ld, drv_map); in mr_update_load_balance_params()
1292 u16 pend0, pend1, ld; in megasas_get_best_arm_pd() local
1307 ld = MR_TargetIdToLdGet(io_info->ldTgtId, drv_map); in megasas_get_best_arm_pd()
1308 raid = MR_LdRaidGet(ld, drv_map); in megasas_get_best_arm_pd()
1310 SPAN_ROW_SIZE(drv_map, ld, span) : raid->rowSize; in megasas_get_best_arm_pd()
1312 arRef = MR_LdSpanArrayGet(ld, span, drv_map); in megasas_get_best_arm_pd()