Lines Matching refs:phyblk
755 static int ms_lib_set_logicalpair(struct us_data *us, u16 logblk, u16 phyblk) in ms_lib_set_logicalpair() argument
759 if ((logblk >= info->MS_Lib.NumberOfLogBlock) || (phyblk >= info->MS_Lib.NumberOfPhyBlock)) in ms_lib_set_logicalpair()
762 info->MS_Lib.Phy2LogMap[phyblk] = logblk; in ms_lib_set_logicalpair()
763 info->MS_Lib.Log2PhyMap[logblk] = phyblk; in ms_lib_set_logicalpair()
768 static int ms_lib_set_logicalblockmark(struct us_data *us, u16 phyblk, u16 mark) in ms_lib_set_logicalblockmark() argument
772 if (phyblk >= info->MS_Lib.NumberOfPhyBlock) in ms_lib_set_logicalblockmark()
775 info->MS_Lib.Phy2LogMap[phyblk] = mark; in ms_lib_set_logicalblockmark()
780 static int ms_lib_set_initialerrorblock(struct us_data *us, u16 phyblk) in ms_lib_set_initialerrorblock() argument
782 return ms_lib_set_logicalblockmark(us, phyblk, MS_LB_INITIAL_ERROR); in ms_lib_set_initialerrorblock()
785 static int ms_lib_set_bootblockmark(struct us_data *us, u16 phyblk) in ms_lib_set_bootblockmark() argument
787 return ms_lib_set_logicalblockmark(us, phyblk, MS_LB_BOOT_BLOCK); in ms_lib_set_bootblockmark()
1004 u16 phyblk; in ms_lib_process_bootblock() local
1026 phyblk = be16_to_cpu(*(u16 *)(PageBuffer + (EntryOffset % MS_BYTES_PER_PAGE))); in ms_lib_process_bootblock()
1027 if (phyblk < 0x0fff) in ms_lib_process_bootblock()
1028 ms_lib_set_initialerrorblock(us, phyblk); in ms_lib_process_bootblock()
1136 static int ms_lib_force_setlogical_pair(struct us_data *us, u16 logblk, u16 phyblk) in ms_lib_force_setlogical_pair() argument
1144 (phyblk >= info->MS_Lib.NumberOfPhyBlock)) in ms_lib_force_setlogical_pair()
1147 info->MS_Lib.Phy2LogMap[phyblk] = logblk; in ms_lib_force_setlogical_pair()
1148 info->MS_Lib.Log2PhyMap[logblk] = phyblk; in ms_lib_force_setlogical_pair()
1244 static int ms_lib_setacquired_errorblock(struct us_data *us, u16 phyblk) in ms_lib_setacquired_errorblock() argument
1249 if (phyblk >= info->MS_Lib.NumberOfPhyBlock) in ms_lib_setacquired_errorblock()
1252 log = info->MS_Lib.Phy2LogMap[phyblk]; in ms_lib_setacquired_errorblock()
1257 if (info->MS_Lib.Phy2LogMap[phyblk] != MS_LB_INITIAL_ERROR) in ms_lib_setacquired_errorblock()
1258 info->MS_Lib.Phy2LogMap[phyblk] = MS_LB_ACQUIRED_ERROR; in ms_lib_setacquired_errorblock()
1295 static int ms_lib_error_phyblock(struct us_data *us, u16 phyblk) in ms_lib_error_phyblock() argument
1299 if (phyblk >= info->MS_Lib.NumberOfPhyBlock) in ms_lib_error_phyblock()
1302 ms_lib_setacquired_errorblock(us, phyblk); in ms_lib_error_phyblock()
1305 return ms_lib_overwrite_extra(us, phyblk, 0, (u8)(~MS_REG_OVR_BKST & BYTE_MASK)); in ms_lib_error_phyblock()
1310 static int ms_lib_erase_phyblock(struct us_data *us, u16 phyblk) in ms_lib_erase_phyblock() argument
1315 if (phyblk >= info->MS_Lib.NumberOfPhyBlock) in ms_lib_erase_phyblock()
1318 log = info->MS_Lib.Phy2LogMap[phyblk]; in ms_lib_erase_phyblock()
1323 info->MS_Lib.Phy2LogMap[phyblk] = MS_LB_NOT_USED; in ms_lib_erase_phyblock()
1326 switch (ms_read_eraseblock(us, phyblk)) { in ms_lib_erase_phyblock()
1328 info->MS_Lib.Phy2LogMap[phyblk] = MS_LB_NOT_USED_ERASED; in ms_lib_erase_phyblock()
1332 ms_lib_error_phyblock(us, phyblk); in ms_lib_erase_phyblock()
1337 ms_lib_setacquired_errorblock(us, phyblk); in ms_lib_erase_phyblock()
1342 ms_lib_setacquired_errorblock(us, phyblk); in ms_lib_erase_phyblock()
1382 static int ms_libsearch_block_from_physical(struct us_data *us, u16 phyblk) in ms_libsearch_block_from_physical() argument
1389 if (phyblk >= info->MS_Lib.NumberOfPhyBlock) in ms_libsearch_block_from_physical()
1392 for (blk = phyblk + 1; blk != phyblk; blk++) { in ms_libsearch_block_from_physical()
1435 u16 phyblk; in ms_libsearch_block_from_logical() local
1438 phyblk = ms_libconv_to_physical(info, logblk); in ms_libsearch_block_from_logical()
1439 if (phyblk >= MS_LB_ERROR) { in ms_libsearch_block_from_logical()
1443 phyblk = (logblk + MS_NUMBER_OF_BOOT_BLOCK) / MS_LOGICAL_BLOCKS_PER_SEGMENT; in ms_libsearch_block_from_logical()
1444 phyblk *= MS_PHYSICAL_BLOCKS_PER_SEGMENT; in ms_libsearch_block_from_logical()
1445 phyblk += MS_PHYSICAL_BLOCKS_PER_SEGMENT - 1; in ms_libsearch_block_from_logical()
1448 return ms_libsearch_block_from_physical(us, phyblk); in ms_libsearch_block_from_logical()
1673 u16 phyblk, logblk; in ms_scsi_read() local
1698 phyblk = ms_libconv_to_physical(info, logblk); in ms_scsi_read()
1699 blkno = phyblk * 0x20 + PageNum; in ms_scsi_read()