Lines Matching refs:DeviceInfo
31 #define BLK_FROM_ADDR(addr) ((u32)(addr >> DeviceInfo.nBitsInBlockDataSize))
33 DeviceInfo.wBlockDataSize) >> DeviceInfo.nBitsInPageDataSize))
88 struct device_info_tag DeviceInfo;
177 #define FTL_Get_LBAPBA_Table_Mem_Size_Bytes() (DeviceInfo.wDataBlockNum *\
179 #define FTL_Get_WearCounter_Table_Mem_Size_Bytes() (DeviceInfo.wDataBlockNum *\
181 #define FTL_Get_ReadCounter_Table_Mem_Size_Bytes() (DeviceInfo.wDataBlockNum *\
184 #define FTL_Get_LBAPBA_Table_Flash_Size_Bytes() (DeviceInfo.wDataBlockNum *\
187 #define FTL_Get_LBAPBA_Table_Flash_Size_Bytes() (DeviceInfo.wDataBlockNum *\
199 if (DeviceInfo.MLCDevice) {
201 DeviceInfo.wDataBlockNum * sizeof(u8) +
202 DeviceInfo.wDataBlockNum * sizeof(u16);
205 DeviceInfo.wDataBlockNum * sizeof(u8);
247 if (DeviceInfo.MLCDevice) {
292 if (DeviceInfo.MLCDevice) {
366 blks = DeviceInfo.wSpectraEndBlock - DeviceInfo.wSpectraStartBlock;
399 dev_data->NumBlocks = DeviceInfo.wTotalBlocks;
400 dev_data->PagesPerBlock = DeviceInfo.wPagesPerBlock;
401 dev_data->PageDataSize = DeviceInfo.wPageDataSize;
402 dev_data->wECCBytesPerSector = DeviceInfo.wECCBytesPerSector;
403 dev_data->wDataBlockNum = DeviceInfo.wDataBlockNum;
421 page_size = DeviceInfo.wPageSize;
422 block_size = DeviceInfo.wPagesPerBlock * DeviceInfo.wPageDataSize;
424 block_table_size = DeviceInfo.wDataBlockNum *
426 block_table_size += (DeviceInfo.wPageDataSize -
427 (block_table_size % DeviceInfo.wPageDataSize)) %
428 DeviceInfo.wPageDataSize;
438 DeviceInfo.wDataBlockNum * sizeof(u32));
440 if (DeviceInfo.MLCDevice)
442 DeviceInfo.wDataBlockNum *
494 flag_check_blk_table = kmalloc(DeviceInfo.wDataBlockNum, GFP_ATOMIC);
497 total_bytes += DeviceInfo.wDataBlockNum;
506 mem_size = DeviceInfo.wPageSize - DeviceInfo.wPageDataSize;
533 flags_static_wear_leveling = kmalloc(DeviceInfo.wDataBlockNum,
537 total_bytes += DeviceInfo.wDataBlockNum;
542 2 * DeviceInfo.wPageSize;
544 mem_size = DeviceInfo.wPageSize;
559 buf_read_page_main_spare = kmalloc(DeviceInfo.wPageSize, GFP_ATOMIC);
562 total_bytes += DeviceInfo.wPageSize;
565 buf_write_page_main_spare = kmalloc(DeviceInfo.wPageSize, GFP_ATOMIC);
568 total_bytes += DeviceInfo.wPageSize;
571 buf_read_page_spare = kmalloc(DeviceInfo.wPageSpareSize, GFP_ATOMIC);
574 memset(buf_read_page_spare, 0xff, DeviceInfo.wPageSpareSize);
575 total_bytes += DeviceInfo.wPageSpareSize;
578 buf_get_bad_block = kmalloc(DeviceInfo.wPageSpareSize, GFP_ATOMIC);
581 memset(buf_get_bad_block, 0xff, DeviceInfo.wPageSpareSize);
582 total_bytes += DeviceInfo.wPageSpareSize;
599 DeviceInfo.wDataBlockNum * sizeof(u32));
601 if (DeviceInfo.MLCDevice)
603 DeviceInfo.wDataBlockNum *
607 mem_size = 5 * DeviceInfo.wDataBlockNum * sizeof(u32) +
608 5 * DeviceInfo.wDataBlockNum * sizeof(u8);
609 if (DeviceInfo.MLCDevice)
610 mem_size += 5 * DeviceInfo.wDataBlockNum * sizeof(u16);
782 for (i = 0; i < DeviceInfo.wPagesPerBlock; i++) {
808 Cache.cache_item_size = 1 * DeviceInfo.wPageDataSize;
892 DeviceInfo.wDataBlockNum * sizeof(u32));
894 DeviceInfo.wDataBlockNum * sizeof(u8));
895 if (DeviceInfo.MLCDevice)
897 DeviceInfo.wDataBlockNum * sizeof(u16));
916 DeviceInfo.wDataBlockNum * sizeof(u32));
918 DeviceInfo.wDataBlockNum * sizeof(u8));
919 if (DeviceInfo.MLCDevice)
921 DeviceInfo.wDataBlockNum * sizeof(u16));
986 if (DeviceInfo.MLCDevice) {
987 g_pReadCounter[phy_blk - DeviceInfo.wSpectraStartBlock]++;
988 if (g_pReadCounter[phy_blk - DeviceInfo.wSpectraStartBlock]
1018 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
1023 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
1039 * The DeviceInfo structure gets filled in
1156 DeviceInfo.nBitsInPageDataSize) * DeviceInfo.wPageDataSize);
1160 DeviceInfo.wPageDataSize, 0);
1163 memcpy(data_buf, start_addr, DeviceInfo.wPageDataSize);
1195 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
1203 PageCount * DeviceInfo.wPageDataSize, 0);
1207 PageCount * DeviceInfo.wPageDataSize);
1222 if (DeviceInfo.MLCDevice) {
1223 g_pReadCounter[Block - DeviceInfo.wSpectraStartBlock]++;
1229 DeviceInfo.wSpectraStartBlock]);
1236 Block - DeviceInfo.wSpectraStartBlock;
1238 g_pReadCounter[Block - DeviceInfo.wSpectraStartBlock];
1243 if (g_pReadCounter[Block - DeviceInfo.wSpectraStartBlock] >=
1258 if (DeviceInfo.MLCDevice) {
1259 g_pReadCounter[Block - DeviceInfo.wSpectraStartBlock]++;
1260 if (g_pReadCounter[Block - DeviceInfo.wSpectraStartBlock] >=
1297 (u32)(blk_addr >> DeviceInfo.nBitsInBlockDataSize));
1341 for (i = 0; i < DeviceInfo.wPagesPerBlock; i += Cache.pages_per_item) {
1343 i * DeviceInfo.wPageDataSize);
1345 i * DeviceInfo.wPageDataSize);
1364 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
1367 if (phy_idx > DeviceInfo.wSpectraEndBlock)
1370 if (g_pWearCounter[phy_idx -DeviceInfo.wSpectraStartBlock] < least_wear_cnt) {
1371 least_wear_cnt = g_pWearCounter[phy_idx - DeviceInfo.wSpectraStartBlock];
1396 if (blk > DeviceInfo.wDataBlockNum) {
1428 BUG_ON(pblk > DeviceInfo.wSpectraEndBlock);
1430 addr = (u64)pblk << DeviceInfo.nBitsInBlockDataSize;
1479 memset(cache_l2_blk_buf, 0xff, DeviceInfo.wPagesPerBlock * DeviceInfo.wPageDataSize);
1484 phy_blk, 0, DeviceInfo.wPagesPerBlock);
1490 for (i = 0; i < DeviceInfo.wPagesPerBlock; i++) {
1498 memcpy(cache_l2_blk_buf + i * DeviceInfo.wPageDataSize, cache_l2_page_buf, DeviceInfo.wPageDataSize);
1503 addr = (u64)pnd->logical_blk_num << DeviceInfo.nBitsInBlockDataSize;
1511 if (FAIL == GLOB_LLD_Write_Page_Main(cache_l2_blk_buf, phy_blk, 0, DeviceInfo.wPagesPerBlock)) {
1523 if (FAIL == GLOB_LLD_Write_Page_Main(cache_l2_blk_buf, phy_blk, 0, DeviceInfo.wPagesPerBlock)) {
1645 sizeof(u32) * DeviceInfo.wPagesPerBlock;
1656 for (i = 0; i < DeviceInfo.wPagesPerBlock; i++)
1665 if (cache_l2.cur_page_num >= DeviceInfo.wPagesPerBlock) {
1748 GLOB_LLD_MemCopy_CMD(pDest, pData, DeviceInfo.wPageDataSize, flag);
1751 memcpy(pDest, pData, DeviceInfo.wPageDataSize);
1785 DeviceInfo.nBitsInBlockDataSize));
1879 memset(pFlag, FAIL, DeviceInfo.wDataBlockNum);
1880 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
1893 if ((blk_idx > DeviceInfo.wSpectraEndBlock) ||
1934 (u16)(DeviceInfo.wPagesPerBlock - bt_pages);
1953 if ((0 == (new_bt_offset % DeviceInfo.wPagesPerBlock)) ||
1954 (new_bt_offset > DeviceInfo.wPagesPerBlock) ||
2012 DeviceInfo.wSpectraStartBlock, DeviceInfo.wSpectraEndBlock);
2013 for (i = DeviceInfo.wSpectraStartBlock; i <= DeviceInfo.wSpectraEndBlock; i++) {
2064 for (i = bt_pages; i < DeviceInfo.wPagesPerBlock;
2071 if (0 == memcmp(tempbuf, g_pIPF, DeviceInfo.wPageDataSize)) {
2072 if ((i + bt_pages + 1) < DeviceInfo.wPagesPerBlock) {
2309 return DeviceInfo.wDataBlockNum * sizeof(u32);
2319 return DeviceInfo.wDataBlockNum * sizeof(u8);
2360 for (j = DeviceInfo.wSpectraStartBlock;
2361 j <= (int)DeviceInfo.wSpectraEndBlock;
2457 DeviceInfo.wPageDataSize - tempvar,
2487 if (DeviceInfo.MLCDevice)
2489 DeviceInfo.wDataBlockNum * sizeof(u32)
2490 + DeviceInfo.wDataBlockNum * sizeof(u8)
2491 + DeviceInfo.wDataBlockNum * sizeof(u16));
2494 DeviceInfo.wDataBlockNum * sizeof(u32)
2495 + DeviceInfo.wDataBlockNum * sizeof(u8));
2521 return (u32)((length >> DeviceInfo.nBitsInPageDataSize) +
2541 physical_addr = (u64) DeviceInfo.wBlockDataSize *
2561 for (i = 0; i < DeviceInfo.wDataBlockNum; i++)
2596 for (i = BLOCK_TABLE_INDEX + 1; i < DeviceInfo.wDataBlockNum; i++) {
2601 cnt = g_pWearCounter[idx - DeviceInfo.wSpectraStartBlock];
2619 DeviceInfo.wDataBlockNum, 0);
2621 DeviceInfo.wDataBlockNum, 0);
2636 debug_boundary_error(*least_idx, DeviceInfo.wDataBlockNum, 0);
2654 DeviceInfo.wBlockDataSize,
2655 (u64)rep_blk * DeviceInfo.wBlockDataSize);
2658 * DeviceInfo.wBlockDataSize);
2754 memset(chang_flag, FAIL, DeviceInfo.wDataBlockNum);
2797 while ((i < DeviceInfo.wDataBlockNum) && (discard_cnt > 0) &&
2807 DeviceInfo.wBlockDataSize);
2828 DeviceInfo.wBlockDataSize);
2866 while ((i < DeviceInfo.wDataBlockNum) && (discard_cnt > 0)) {
2875 DeviceInfo.wBlockDataSize);
2911 DeviceInfo.wBlockDataSize);
2961 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
3022 DeviceInfo.wBlockDataSize);
3098 DeviceInfo.wBlockDataSize);
3215 (u64)((u64)g_wBlockTableIndex * DeviceInfo.wBlockDataSize +
3216 (u64)g_wBlockTableOffset * DeviceInfo.wPageDataSize);
3255 DeviceInfo.wPageDataSize - 4, 0);
3257 DeviceInfo.wPageSize - (wBytesCopied + 4));
3258 FTL_Insert_Block_Table_Signature(&tempBuf[DeviceInfo.wPageDataSize],
3263 DeviceInfo.wPageSize * sizeof(u8));
3277 g_pNextBlockTable += ((DeviceInfo.wPageSize * sizeof(u8)));
3292 DeviceInfo.wPageDataSize * (PageCount - 1),
3297 (PageCount - 1) * DeviceInfo.wPageDataSize);
3312 DeviceInfo.wPageDataSize * sizeof(u8);
3328 DeviceInfo.wPageDataSize, wBytesCopied);
3330 DeviceInfo.wPageSize-wBytesCopied);
3332 &tempBuf[DeviceInfo.wPageDataSize], bt_flag);
3335 DeviceInfo.wPageSize * sizeof(u8));
3440 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
3446 if (wPhysicalIndex > DeviceInfo.wSpectraEndBlock)
3450 DeviceInfo.wSpectraStartBlock] <
3454 DeviceInfo.wSpectraStartBlock];
3497 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
3501 DeviceInfo.wSpectraStartBlock] >
3505 DeviceInfo.wSpectraStartBlock];
3571 if (wBlockNum >= DeviceInfo.wSpectraStartBlock
3715 BlkIdx = (u32)(blk_addr >> DeviceInfo.nBitsInBlockDataSize);
3717 if (BlkIdx < DeviceInfo.wSpectraStartBlock) {
3741 if (DeviceInfo.MLCDevice) {
3742 g_pReadCounter[BlkIdx - DeviceInfo.wSpectraStartBlock] = 0;
3749 g_pWearCounter[BlkIdx - DeviceInfo.wSpectraStartBlock]++;
3757 BlkIdx - DeviceInfo.wSpectraStartBlock;
3759 g_pWearCounter[BlkIdx - DeviceInfo.wSpectraStartBlock];
3762 if (DeviceInfo.MLCDevice) {
3769 BlkIdx - DeviceInfo.wSpectraStartBlock;
3772 DeviceInfo.wSpectraStartBlock];
3779 if (g_pWearCounter[BlkIdx - DeviceInfo.wSpectraStartBlock] == 0xFE)
3805 for (i = 0; i < DeviceInfo.wDataBlockNum; i++) {
3810 if ((wWearIndex - DeviceInfo.wSpectraStartBlock) < 0)
3814 DeviceInfo.wSpectraStartBlock];
3823 DeviceInfo.wSpectraStartBlock]--;
3830 Index_of_MAX - DeviceInfo.wSpectraStartBlock;
3833 DeviceInfo.wSpectraStartBlock];
3838 for (i = 0; i < DeviceInfo.wDataBlockNum; i++)
3842 DeviceInfo.wSpectraStartBlock] =
3845 DeviceInfo.wSpectraStartBlock] -
3856 DeviceInfo.wSpectraStartBlock;
3859 DeviceInfo.wSpectraStartBlock];
3983 for (i = 1; i < DeviceInfo.wDataBlockNum; i++) {
3988 DeviceInfo.wSpectraStartBlock] <
3992 DeviceInfo.wSpectraStartBlock];
4034 dwOldBlockAddr, 0, DeviceInfo.wPagesPerBlock,
4044 DeviceInfo.wPagesPerBlock)) {
4059 dwOldBlockAddr, 0, DeviceInfo.wPagesPerBlock);
4072 DeviceInfo.wPagesPerBlock);