Lines Matching refs:ld

81 #define SPAN_ROW_SIZE(map, ld, index_) (MR_LdSpanPtrGet(ld, index_, map)->spanRowSize)  argument
82 #define SPAN_ROW_DATA_SIZE(map_, ld, index_) (MR_LdSpanPtrGet(ld, index_, map)->spanRowDataSize) argument
88 static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld,
91 static u64 get_row_from_strip(struct megasas_instance *instance, u32 ld,
126 struct MR_LD_RAID *MR_LdRaidGet(u32 ld, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdRaidGet() argument
128 return &map->raidMap.ldSpanMap[ld].ldRaid; in MR_LdRaidGet()
131 static struct MR_SPAN_BLOCK_INFO *MR_LdSpanInfoGet(u32 ld, in MR_LdSpanInfoGet() argument
135 return &map->raidMap.ldSpanMap[ld].spanBlock[0]; in MR_LdSpanInfoGet()
138 static u8 MR_LdDataArmGet(u32 ld, u32 armIdx, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdDataArmGet() argument
140 return map->raidMap.ldSpanMap[ld].dataArmMap[armIdx]; in MR_LdDataArmGet()
148 u16 MR_LdSpanArrayGet(u32 ld, u32 span, struct MR_DRV_RAID_MAP_ALL *map) in MR_LdSpanArrayGet() argument
150 return le16_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span].span.arrayRef); in MR_LdSpanArrayGet()
158 u16 MR_GetLDTgtId(u32 ld, struct MR_DRV_RAID_MAP_ALL *map) in MR_GetLDTgtId() argument
160 return le16_to_cpu(map->raidMap.ldSpanMap[ld].ldRaid.targetId); in MR_GetLDTgtId()
168 static struct MR_LD_SPAN *MR_LdSpanPtrGet(u32 ld, u32 span, in MR_LdSpanPtrGet() argument
171 return &map->raidMap.ldSpanMap[ld].spanBlock[span].span; in MR_LdSpanPtrGet()
269 u16 ld; in MR_ValidateMapInfo() local
307 ld = MR_TargetIdToLdGet(ldCount, drv_map); in MR_ValidateMapInfo()
308 raid = MR_LdRaidGet(ld, drv_map); in MR_ValidateMapInfo()
315 u32 MR_GetSpanBlock(u32 ld, u64 row, u64 *span_blk, in MR_GetSpanBlock() argument
318 struct MR_SPAN_BLOCK_INFO *pSpanBlock = MR_LdSpanInfoGet(ld, map); in MR_GetSpanBlock()
320 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in MR_GetSpanBlock()
368 u16 ld; in getSpanInfo() local
371 ld = MR_TargetIdToLdGet(ldCount, map); in getSpanInfo()
372 if (ld >= (MAX_LOGICAL_DRIVES_EXT - 1)) in getSpanInfo()
374 raid = MR_LdRaidGet(ld, map); in getSpanInfo()
376 ld, raid->spanDepth); in getSpanInfo()
380 le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in getSpanInfo()
383 span_set = &(ldSpanInfo[ld].span_set[element]); in getSpanInfo()
409 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in getSpanInfo()
412 quad = &map->raidMap.ldSpanMap[ld]. in getSpanInfo()
452 u32 ld, u64 row, u64 *span_blk, struct MR_DRV_RAID_MAP_ALL *map) in mr_spanset_get_span_block() argument
455 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in mr_spanset_get_span_block()
462 span_set = &(ldSpanInfo[ld].span_set[info]); in mr_spanset_get_span_block()
471 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in mr_spanset_get_span_block()
473 quad = &map->raidMap.ldSpanMap[ld]. in mr_spanset_get_span_block()
515 u32 ld, u64 strip, struct MR_DRV_RAID_MAP_ALL *map) in get_row_from_strip() argument
518 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_row_from_strip()
525 span_set = &(ldSpanInfo[ld].span_set[info]); in get_row_from_strip()
538 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_row_from_strip()
584 u32 ld, u64 row, struct MR_DRV_RAID_MAP_ALL *map) in get_strip_from_row() argument
587 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_strip_from_row()
595 span_set = &(ldSpanInfo[ld].span_set[info]); in get_strip_from_row()
603 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_strip_from_row()
605 quad = &map->raidMap.ldSpanMap[ld]. in get_strip_from_row()
624 ld, (long unsigned int)row); in get_strip_from_row()
645 u32 ld, u64 strip, struct MR_DRV_RAID_MAP_ALL *map) in get_arm_from_strip() argument
648 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_arm_from_strip()
654 span_set = &(ldSpanInfo[ld].span_set[info]); in get_arm_from_strip()
666 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in get_arm_from_strip()
677 "for ld=0x%x strip=0x%lx arm is 0x%x\n", ld, in get_arm_from_strip()
686 ld, (long unsigned int)strip); in get_arm_from_strip()
692 u8 get_arm(struct megasas_instance *instance, u32 ld, u8 span, u64 stripe, in get_arm() argument
695 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in get_arm()
703 arm = mega_mod64(stripe, SPAN_ROW_SIZE(map, ld, span)); in get_arm()
707 arm = get_arm_from_strip(instance, ld, stripe, map); in get_arm()
734 static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld, in mr_spanset_get_phy_params() argument
739 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in mr_spanset_get_phy_params()
757 logArm = get_arm_from_strip(instance, ld, stripRow, map); in mr_spanset_get_phy_params()
760 rowMod = mega_mod64(row, SPAN_ROW_SIZE(map, ld, span)); in mr_spanset_get_phy_params()
761 armQ = SPAN_ROW_SIZE(map, ld, span) - 1 - rowMod; in mr_spanset_get_phy_params()
763 if (arm >= SPAN_ROW_SIZE(map, ld, span)) in mr_spanset_get_phy_params()
764 arm -= SPAN_ROW_SIZE(map, ld, span); in mr_spanset_get_phy_params()
768 physArm = get_arm(instance, ld, span, stripRow, map); in mr_spanset_get_phy_params()
772 arRef = MR_LdSpanArrayGet(ld, span, map); in mr_spanset_get_phy_params()
791 *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); in mr_spanset_get_phy_params()
815 u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow, in MR_GetPhyParams() argument
820 struct MR_LD_RAID *raid = MR_LdRaidGet(ld, map); in MR_GetPhyParams()
851 physArm = MR_LdDataArmGet(ld, mega_mod64(stripRow, in MR_GetPhyParams()
860 span = (u8)MR_GetSpanBlock(ld, row, pdBlock, map); in MR_GetPhyParams()
866 arRef = MR_LdSpanArrayGet(ld, span, map); in MR_GetPhyParams()
889 *pdBlock += stripRef + le64_to_cpu(MR_LdSpanPtrGet(ld, span, map)->startBlk); in MR_GetPhyParams()
913 u32 ld, stripSize, stripe_mask; in MR_BuildRaidContext() local
934 ld = MR_TargetIdToLdGet(ldTgtId, map); in MR_BuildRaidContext()
935 raid = MR_LdRaidGet(ld, map); in MR_BuildRaidContext()
942 if (MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize == 0) in MR_BuildRaidContext()
951 MR_LdSpanPtrGet(ld, 0, map)->spanRowDataSize); in MR_BuildRaidContext()
971 start_row = get_row_from_strip(instance, ld, start_strip, map); in MR_BuildRaidContext()
972 endRow = get_row_from_strip(instance, ld, endStrip, map); in MR_BuildRaidContext()
985 ld, start_row, pdBlock, map); in MR_BuildRaidContext()
1071 if (start_strip == (get_strip_from_row(instance, ld, start_row, map) + in MR_BuildRaidContext()
1072 SPAN_ROW_DATA_SIZE(map, ld, startlba_span) - 1)) { in MR_BuildRaidContext()
1086 if (endStrip == get_strip_from_row(instance, ld, endRow, map)) in MR_BuildRaidContext()
1114 mr_spanset_get_phy_params(instance, ld, in MR_BuildRaidContext()
1117 MR_GetPhyParams(instance, ld, start_strip, in MR_BuildRaidContext()
1128 mr_spanset_get_phy_params(instance, ld, in MR_BuildRaidContext()
1132 MR_GetPhyParams(instance, ld, in MR_BuildRaidContext()
1143 get_arm_from_strip(instance, ld, start_strip, map); in MR_BuildRaidContext()
1169 u16 ld; in mr_update_span_set() local
1173 ld = MR_TargetIdToLdGet(ldCount, map); in mr_update_span_set()
1174 if (ld >= (MAX_LOGICAL_DRIVES_EXT - 1)) in mr_update_span_set()
1176 raid = MR_LdRaidGet(ld, map); in mr_update_span_set()
1179 if (le32_to_cpu(map->raidMap.ldSpanMap[ld].spanBlock[span]. in mr_update_span_set()
1183 span_set = &(ldSpanInfo[ld].span_set[element]); in mr_update_span_set()
1184 quad = &map->raidMap.ldSpanMap[ld]. in mr_update_span_set()
1192 if (le32_to_cpu(map->raidMap.ldSpanMap[ld]. in mr_update_span_set()
1200 (ld, count, map)->spanRowDataSize; in mr_update_span_set()
1226 span_set_prev = &(ldSpanInfo[ld]. in mr_update_span_set()
1268 u16 ld; in mr_update_load_balance_params() local
1275 ld = MR_TargetIdToLdGet(ldCount, drv_map); in mr_update_load_balance_params()
1276 if (ld >= MAX_LOGICAL_DRIVES_EXT) { in mr_update_load_balance_params()
1281 raid = MR_LdRaidGet(ld, drv_map); in mr_update_load_balance_params()
1297 u16 pend0, pend1, ld; in megasas_get_best_arm_pd() local
1312 ld = MR_TargetIdToLdGet(io_info->ldTgtId, drv_map); in megasas_get_best_arm_pd()
1313 raid = MR_LdRaidGet(ld, drv_map); in megasas_get_best_arm_pd()
1315 SPAN_ROW_SIZE(drv_map, ld, span) : raid->rowSize; in megasas_get_best_arm_pd()
1317 arRef = MR_LdSpanArrayGet(ld, span, drv_map); in megasas_get_best_arm_pd()