1 #include <linux/slab.h>
9 static u8
_Check_D_DevCode(u8
);
11 static u8 IsSSFDCCompliance
;
12 static u8 IsXDCompliance
;
14 struct keucr_media_info Ssfdc
;
15 struct keucr_media_address Media
;
16 struct keucr_media_area CisArea
;
20 #define EVEN 0 /* Even Page for 256byte/page */
21 #define ODD 1 /* Odd Page for 256byte/page */
24 /* SmartMedia Redundant buffer data Control Subroutine
25 *----- Check_D_DataBlank() --------------------------------------------
27 int Check_D_DataBlank(u8
*redundant
)
31 for (i
= 0; i
< REDTSIZE
; i
++)
32 if (*redundant
++ != 0xFF)
38 /* ----- Check_D_FailBlock() -------------------------------------------- */
39 int Check_D_FailBlock(u8
*redundant
)
41 redundant
+= REDT_BLOCK
;
43 if (*redundant
== 0xFF)
47 if (hweight8(*redundant
) < 7)
53 /* ----- Check_D_DataStatus() ------------------------------------------- */
54 int Check_D_DataStatus(u8
*redundant
)
56 redundant
+= REDT_DATA
;
58 if (*redundant
== 0xFF)
61 ErrXDCode
= ERR_DataStatus
;
66 if (hweight8(*redundant
) < 5)
72 /* ----- Load_D_LogBlockAddr() ------------------------------------------ */
73 int Load_D_LogBlockAddr(u8
*redundant
)
77 addr1
= (u16
)*(redundant
+ REDT_ADDR1H
)*0x0100 +
78 (u16
)*(redundant
+ REDT_ADDR1L
);
79 addr2
= (u16
)*(redundant
+ REDT_ADDR2H
)*0x0100 +
80 (u16
)*(redundant
+ REDT_ADDR2L
);
83 if ((addr1
& 0xF000) == 0x1000) {
84 Media
.LogBlock
= (addr1
& 0x0FFF) / 2;
88 if (hweight16((u16
)(addr1
^addr2
)) != 0x01)
91 if ((addr1
& 0xF000) == 0x1000)
92 if (!(hweight16(addr1
) & 0x01)) {
93 Media
.LogBlock
= (addr1
& 0x0FFF) / 2;
97 if ((addr2
& 0xF000) == 0x1000)
98 if (!(hweight16(addr2
) & 0x01)) {
99 Media
.LogBlock
= (addr2
& 0x0FFF) / 2;
106 /* ----- Clr_D_RedundantData() ------------------------------------------ */
107 void Clr_D_RedundantData(u8
*redundant
)
111 for (i
= 0; i
< REDTSIZE
; i
++)
112 *(redundant
+ i
) = 0xFF;
115 /* ----- Set_D_LogBlockAddr() ------------------------------------------- */
116 void Set_D_LogBlockAddr(u8
*redundant
)
120 *(redundant
+ REDT_BLOCK
) = 0xFF;
121 *(redundant
+ REDT_DATA
) = 0xFF;
122 addr
= Media
.LogBlock
*2 + 0x1000;
124 if ((hweight16(addr
) % 2))
127 *(redundant
+ REDT_ADDR1H
) = *(redundant
+ REDT_ADDR2H
) =
129 *(redundant
+ REDT_ADDR1L
) = *(redundant
+ REDT_ADDR2L
) = (u8
)addr
;
132 /*----- Set_D_FailBlock() ---------------------------------------------- */
133 void Set_D_FailBlock(u8
*redundant
)
137 for (i
= 0; i
< REDTSIZE
; i
++)
138 *redundant
++ = (u8
)((i
== REDT_BLOCK
) ? 0xF0 : 0xFF);
141 /* ----- Set_D_DataStaus() ---------------------------------------------- */
142 void Set_D_DataStaus(u8
*redundant
)
144 redundant
+= REDT_DATA
;
148 /* SmartMedia Function Command Subroutine
151 /* ----- Ssfdc_D_Reset() ------------------------------------------------ */
152 void Ssfdc_D_Reset(struct us_data
*us
)
157 /* ----- Ssfdc_D_ReadCisSect() ------------------------------------------ */
158 int Ssfdc_D_ReadCisSect(struct us_data
*us
, u8
*buf
, u8
*redundant
)
163 zone
= Media
.Zone
; block
= Media
.PhyBlock
; sector
= Media
.Sector
;
165 Media
.PhyBlock
= CisArea
.PhyBlock
;
166 Media
.Sector
= CisArea
.Sector
;
168 if (Ssfdc_D_ReadSect(us
, buf
, redundant
)) {
170 Media
.PhyBlock
= block
;
171 Media
.Sector
= sector
;
175 Media
.Zone
= zone
; Media
.PhyBlock
= block
; Media
.Sector
= sector
;
180 /* ----- Ssfdc_D_ReadSect() --------------------------------------------- */
181 int Ssfdc_D_ReadSect(struct us_data
*us
, u8
*buf
, u8
*redundant
)
183 struct bulk_cb_wrap
*bcb
= (struct bulk_cb_wrap
*) us
->iobuf
;
187 result
= ENE_LoadBinCode(us
, SM_RW_PATTERN
);
188 if (result
!= USB_STOR_XFER_GOOD
) {
189 dev_err(&us
->pusb_dev
->dev
,
190 "Failed to load SmartMedia read/write code\n");
191 return USB_STOR_TRANSPORT_ERROR
;
194 addr
= (u16
)Media
.Zone
*Ssfdc
.MaxBlocks
+ Media
.PhyBlock
;
195 addr
= addr
*(u16
)Ssfdc
.MaxSectors
+ Media
.Sector
;
198 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
199 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
200 bcb
->DataTransferLength
= 0x200;
204 bcb
->CDB
[4] = (u8
)addr
;
205 bcb
->CDB
[3] = (u8
)(addr
/ 0x0100);
206 bcb
->CDB
[2] = Media
.Zone
/ 2;
208 result
= ENE_SendScsiCmd(us
, FDIR_READ
, buf
, 0);
209 if (result
!= USB_STOR_XFER_GOOD
)
210 return USB_STOR_TRANSPORT_ERROR
;
213 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
214 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
215 bcb
->DataTransferLength
= 0x10;
219 bcb
->CDB
[4] = (u8
)addr
;
220 bcb
->CDB
[3] = (u8
)(addr
/ 0x0100);
221 bcb
->CDB
[2] = Media
.Zone
/ 2;
225 result
= ENE_SendScsiCmd(us
, FDIR_READ
, redundant
, 0);
226 if (result
!= USB_STOR_XFER_GOOD
)
227 return USB_STOR_TRANSPORT_ERROR
;
229 return USB_STOR_TRANSPORT_GOOD
;
232 /* ----- Ssfdc_D_ReadBlock() --------------------------------------------- */
233 int Ssfdc_D_ReadBlock(struct us_data
*us
, u16 count
, u8
*buf
,
236 struct bulk_cb_wrap
*bcb
= (struct bulk_cb_wrap
*) us
->iobuf
;
240 result
= ENE_LoadBinCode(us
, SM_RW_PATTERN
);
241 if (result
!= USB_STOR_XFER_GOOD
) {
242 dev_err(&us
->pusb_dev
->dev
,
243 "Failed to load SmartMedia read/write code\n");
244 return USB_STOR_TRANSPORT_ERROR
;
247 addr
= (u16
)Media
.Zone
*Ssfdc
.MaxBlocks
+ Media
.PhyBlock
;
248 addr
= addr
*(u16
)Ssfdc
.MaxSectors
+ Media
.Sector
;
251 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
252 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
253 bcb
->DataTransferLength
= 0x200*count
;
257 bcb
->CDB
[4] = (u8
)addr
;
258 bcb
->CDB
[3] = (u8
)(addr
/ 0x0100);
259 bcb
->CDB
[2] = Media
.Zone
/ 2;
261 result
= ENE_SendScsiCmd(us
, FDIR_READ
, buf
, 0);
262 if (result
!= USB_STOR_XFER_GOOD
)
263 return USB_STOR_TRANSPORT_ERROR
;
266 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
267 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
268 bcb
->DataTransferLength
= 0x10;
272 bcb
->CDB
[4] = (u8
)addr
;
273 bcb
->CDB
[3] = (u8
)(addr
/ 0x0100);
274 bcb
->CDB
[2] = Media
.Zone
/ 2;
278 result
= ENE_SendScsiCmd(us
, FDIR_READ
, redundant
, 0);
279 if (result
!= USB_STOR_XFER_GOOD
)
280 return USB_STOR_TRANSPORT_ERROR
;
282 return USB_STOR_TRANSPORT_GOOD
;
286 /* ----- Ssfdc_D_CopyBlock() -------------------------------------------- */
287 int Ssfdc_D_CopyBlock(struct us_data
*us
, u16 count
, u8
*buf
,
290 struct bulk_cb_wrap
*bcb
= (struct bulk_cb_wrap
*) us
->iobuf
;
292 u16 ReadAddr
, WriteAddr
;
294 result
= ENE_LoadBinCode(us
, SM_RW_PATTERN
);
295 if (result
!= USB_STOR_XFER_GOOD
) {
296 dev_err(&us
->pusb_dev
->dev
,
297 "Failed to load SmartMedia read/write code\n");
298 return USB_STOR_TRANSPORT_ERROR
;
301 ReadAddr
= (u16
)Media
.Zone
*Ssfdc
.MaxBlocks
+ ReadBlock
;
302 ReadAddr
= ReadAddr
*(u16
)Ssfdc
.MaxSectors
;
303 WriteAddr
= (u16
)Media
.Zone
*Ssfdc
.MaxBlocks
+ WriteBlock
;
304 WriteAddr
= WriteAddr
*(u16
)Ssfdc
.MaxSectors
;
306 /* Write sect data */
307 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
308 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
309 bcb
->DataTransferLength
= 0x200*count
;
313 bcb
->CDB
[7] = (u8
)WriteAddr
;
314 bcb
->CDB
[6] = (u8
)(WriteAddr
/ 0x0100);
315 bcb
->CDB
[5] = Media
.Zone
/ 2;
316 bcb
->CDB
[8] = *(redundant
+ REDT_ADDR1H
);
317 bcb
->CDB
[9] = *(redundant
+ REDT_ADDR1L
);
318 bcb
->CDB
[10] = Media
.Sector
;
320 if (ReadBlock
!= NO_ASSIGN
) {
321 bcb
->CDB
[4] = (u8
)ReadAddr
;
322 bcb
->CDB
[3] = (u8
)(ReadAddr
/ 0x0100);
323 bcb
->CDB
[2] = Media
.Zone
/ 2;
327 result
= ENE_SendScsiCmd(us
, FDIR_WRITE
, buf
, 0);
328 if (result
!= USB_STOR_XFER_GOOD
)
329 return USB_STOR_TRANSPORT_ERROR
;
331 return USB_STOR_TRANSPORT_GOOD
;
334 /* ----- Ssfdc_D_WriteSectForCopy() ------------------------------------- */
335 int Ssfdc_D_WriteSectForCopy(struct us_data
*us
, u8
*buf
, u8
*redundant
)
337 struct bulk_cb_wrap
*bcb
= (struct bulk_cb_wrap
*) us
->iobuf
;
341 result
= ENE_LoadBinCode(us
, SM_RW_PATTERN
);
342 if (result
!= USB_STOR_XFER_GOOD
) {
343 dev_err(&us
->pusb_dev
->dev
,
344 "Failed to load SmartMedia read/write code\n");
345 return USB_STOR_TRANSPORT_ERROR
;
349 addr
= (u16
)Media
.Zone
*Ssfdc
.MaxBlocks
+ Media
.PhyBlock
;
350 addr
= addr
*(u16
)Ssfdc
.MaxSectors
+ Media
.Sector
;
352 /* Write sect data */
353 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
354 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
355 bcb
->DataTransferLength
= 0x200;
359 bcb
->CDB
[7] = (u8
)addr
;
360 bcb
->CDB
[6] = (u8
)(addr
/ 0x0100);
361 bcb
->CDB
[5] = Media
.Zone
/ 2;
362 bcb
->CDB
[8] = *(redundant
+ REDT_ADDR1H
);
363 bcb
->CDB
[9] = *(redundant
+ REDT_ADDR1L
);
365 result
= ENE_SendScsiCmd(us
, FDIR_WRITE
, buf
, 0);
366 if (result
!= USB_STOR_XFER_GOOD
)
367 return USB_STOR_TRANSPORT_ERROR
;
369 return USB_STOR_TRANSPORT_GOOD
;
373 /* ----- Ssfdc_D_EraseBlock() ------------------------------------------- */
374 int Ssfdc_D_EraseBlock(struct us_data
*us
)
376 struct bulk_cb_wrap
*bcb
= (struct bulk_cb_wrap
*) us
->iobuf
;
380 result
= ENE_LoadBinCode(us
, SM_RW_PATTERN
);
381 if (result
!= USB_STOR_XFER_GOOD
) {
382 dev_err(&us
->pusb_dev
->dev
,
383 "Failed to load SmartMedia read/write code\n");
384 return USB_STOR_TRANSPORT_ERROR
;
387 addr
= (u16
)Media
.Zone
*Ssfdc
.MaxBlocks
+ Media
.PhyBlock
;
388 addr
= addr
*(u16
)Ssfdc
.MaxSectors
;
390 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
391 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
392 bcb
->DataTransferLength
= 0x200;
396 bcb
->CDB
[7] = (u8
)addr
;
397 bcb
->CDB
[6] = (u8
)(addr
/ 0x0100);
398 bcb
->CDB
[5] = Media
.Zone
/ 2;
400 result
= ENE_SendScsiCmd(us
, FDIR_READ
, NULL
, 0);
401 if (result
!= USB_STOR_XFER_GOOD
)
402 return USB_STOR_TRANSPORT_ERROR
;
404 return USB_STOR_TRANSPORT_GOOD
;
408 /*----- Ssfdc_D_ReadRedtData() ----------------------------------------- */
409 int Ssfdc_D_ReadRedtData(struct us_data
*us
, u8
*redundant
)
411 struct bulk_cb_wrap
*bcb
= (struct bulk_cb_wrap
*) us
->iobuf
;
416 result
= ENE_LoadBinCode(us
, SM_RW_PATTERN
);
417 if (result
!= USB_STOR_XFER_GOOD
) {
418 dev_err(&us
->pusb_dev
->dev
,
419 "Failed to load SmartMedia read/write code\n");
420 return USB_STOR_TRANSPORT_ERROR
;
423 addr
= (u16
)Media
.Zone
*Ssfdc
.MaxBlocks
+ Media
.PhyBlock
;
424 addr
= addr
*(u16
)Ssfdc
.MaxSectors
+ Media
.Sector
;
426 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
427 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
428 bcb
->DataTransferLength
= 0x10;
432 bcb
->CDB
[4] = (u8
)addr
;
433 bcb
->CDB
[3] = (u8
)(addr
/ 0x0100);
434 bcb
->CDB
[2] = Media
.Zone
/ 2;
438 buf
= kmalloc(0x10, GFP_KERNEL
);
439 result
= ENE_SendScsiCmd(us
, FDIR_READ
, buf
, 0);
440 memcpy(redundant
, buf
, 0x10);
442 if (result
!= USB_STOR_XFER_GOOD
)
443 return USB_STOR_TRANSPORT_ERROR
;
445 return USB_STOR_TRANSPORT_GOOD
;
449 /* ----- Ssfdc_D_WriteRedtData() ---------------------------------------- */
450 int Ssfdc_D_WriteRedtData(struct us_data
*us
, u8
*redundant
)
452 struct bulk_cb_wrap
*bcb
= (struct bulk_cb_wrap
*) us
->iobuf
;
456 result
= ENE_LoadBinCode(us
, SM_RW_PATTERN
);
457 if (result
!= USB_STOR_XFER_GOOD
) {
458 dev_err(&us
->pusb_dev
->dev
,
459 "Failed to load SmartMedia read/write code\n");
460 return USB_STOR_TRANSPORT_ERROR
;
463 addr
= (u16
)Media
.Zone
*Ssfdc
.MaxBlocks
+ Media
.PhyBlock
;
464 addr
= addr
*(u16
)Ssfdc
.MaxSectors
+ Media
.Sector
;
466 memset(bcb
, 0, sizeof(struct bulk_cb_wrap
));
467 bcb
->Signature
= cpu_to_le32(US_BULK_CB_SIGN
);
468 bcb
->DataTransferLength
= 0x10;
472 bcb
->CDB
[7] = (u8
)addr
;
473 bcb
->CDB
[6] = (u8
)(addr
/ 0x0100);
474 bcb
->CDB
[5] = Media
.Zone
/ 2;
475 bcb
->CDB
[8] = *(redundant
+ REDT_ADDR1H
);
476 bcb
->CDB
[9] = *(redundant
+ REDT_ADDR1L
);
478 result
= ENE_SendScsiCmd(us
, FDIR_READ
, NULL
, 0);
479 if (result
!= USB_STOR_XFER_GOOD
)
480 return USB_STOR_TRANSPORT_ERROR
;
482 return USB_STOR_TRANSPORT_GOOD
;
485 /* ----- Ssfdc_D_CheckStatus() ------------------------------------------ */
486 int Ssfdc_D_CheckStatus(void)
493 /* SmartMedia ID Code Check & Mode Set Subroutine
494 * ----- Set_D_SsfdcModel() ---------------------------------------------
496 int Set_D_SsfdcModel(u8 dcode
)
498 switch (_Check_D_DevCode(dcode
)) {
500 Ssfdc
.Model
= SSFDC1MB
;
501 Ssfdc
.Attribute
= FLASH
| AD3CYC
| BS16
| PS256
;
503 Ssfdc
.MaxBlocks
= 256;
504 Ssfdc
.MaxLogBlocks
= 250;
505 Ssfdc
.MaxSectors
= 8;
508 Ssfdc
.Model
= SSFDC2MB
;
509 Ssfdc
.Attribute
= FLASH
| AD3CYC
| BS16
| PS256
;
511 Ssfdc
.MaxBlocks
= 512;
512 Ssfdc
.MaxLogBlocks
= 500;
513 Ssfdc
.MaxSectors
= 8;
516 Ssfdc
.Model
= SSFDC4MB
;
517 Ssfdc
.Attribute
= FLASH
| AD3CYC
| BS16
| PS512
;
519 Ssfdc
.MaxBlocks
= 512;
520 Ssfdc
.MaxLogBlocks
= 500;
521 Ssfdc
.MaxSectors
= 16;
524 Ssfdc
.Model
= SSFDC8MB
;
525 Ssfdc
.Attribute
= FLASH
| AD3CYC
| BS16
| PS512
;
527 Ssfdc
.MaxBlocks
= 1024;
528 Ssfdc
.MaxLogBlocks
= 1000;
529 Ssfdc
.MaxSectors
= 16;
532 Ssfdc
.Model
= SSFDC16MB
;
533 Ssfdc
.Attribute
= FLASH
| AD3CYC
| BS32
| PS512
;
535 Ssfdc
.MaxBlocks
= 1024;
536 Ssfdc
.MaxLogBlocks
= 1000;
537 Ssfdc
.MaxSectors
= 32;
540 Ssfdc
.Model
= SSFDC32MB
;
541 Ssfdc
.Attribute
= FLASH
| AD3CYC
| BS32
| PS512
;
543 Ssfdc
.MaxBlocks
= 1024;
544 Ssfdc
.MaxLogBlocks
= 1000;
545 Ssfdc
.MaxSectors
= 32;
548 Ssfdc
.Model
= SSFDC64MB
;
549 Ssfdc
.Attribute
= FLASH
| AD4CYC
| BS32
| PS512
;
551 Ssfdc
.MaxBlocks
= 1024;
552 Ssfdc
.MaxLogBlocks
= 1000;
553 Ssfdc
.MaxSectors
= 32;
556 Ssfdc
.Model
= SSFDC128MB
;
557 Ssfdc
.Attribute
= FLASH
| AD4CYC
| BS32
| PS512
;
559 Ssfdc
.MaxBlocks
= 1024;
560 Ssfdc
.MaxLogBlocks
= 1000;
561 Ssfdc
.MaxSectors
= 32;
564 Ssfdc
.Model
= SSFDC256MB
;
565 Ssfdc
.Attribute
= FLASH
| AD4CYC
| BS32
| PS512
;
567 Ssfdc
.MaxBlocks
= 1024;
568 Ssfdc
.MaxLogBlocks
= 1000;
569 Ssfdc
.MaxSectors
= 32;
572 Ssfdc
.Model
= SSFDC512MB
;
573 Ssfdc
.Attribute
= FLASH
| AD4CYC
| BS32
| PS512
;
575 Ssfdc
.MaxBlocks
= 1024;
576 Ssfdc
.MaxLogBlocks
= 1000;
577 Ssfdc
.MaxSectors
= 32;
580 Ssfdc
.Model
= SSFDC1GB
;
581 Ssfdc
.Attribute
= FLASH
| AD4CYC
| BS32
| PS512
;
583 Ssfdc
.MaxBlocks
= 1024;
584 Ssfdc
.MaxLogBlocks
= 1000;
585 Ssfdc
.MaxSectors
= 32;
588 Ssfdc
.Model
= SSFDC2GB
;
589 Ssfdc
.Attribute
= FLASH
| AD4CYC
| BS32
| PS512
;
590 Ssfdc
.MaxZones
= 128;
591 Ssfdc
.MaxBlocks
= 1024;
592 Ssfdc
.MaxLogBlocks
= 1000;
593 Ssfdc
.MaxSectors
= 32;
596 Ssfdc
.Model
= NOSSFDC
;
603 /* ----- _Check_D_DevCode() --------------------------------------------- */
604 static u8
_Check_D_DevCode(u8 dcode
)
609 case 0xEC: return SSFDC1MB
; /* 8Mbit (1M) NAND */
611 case 0xEA: return SSFDC2MB
; /* 16Mbit (2M) NAND */
614 case 0xE5: return SSFDC4MB
; /* 32Mbit (4M) NAND */
615 case 0xE6: return SSFDC8MB
; /* 64Mbit (8M) NAND */
616 case 0x73: return SSFDC16MB
; /* 128Mbit (16M)NAND */
617 case 0x75: return SSFDC32MB
; /* 256Mbit (32M)NAND */
618 case 0x76: return SSFDC64MB
; /* 512Mbit (64M)NAND */
619 case 0x79: return SSFDC128MB
; /* 1Gbit(128M)NAND */
620 case 0x71: return SSFDC256MB
;
621 case 0xDC: return SSFDC512MB
;
622 case 0xD3: return SSFDC1GB
;
623 case 0xD5: return SSFDC2GB
;
624 default: return NOSSFDC
;
631 /* SmartMedia ECC Control Subroutine
632 * ----- Check_D_ReadError() ----------------------------------------------
634 int Check_D_ReadError(u8
*redundant
)
639 /* ----- Check_D_Correct() ---------------------------------------------- */
640 int Check_D_Correct(u8
*buf
, u8
*redundant
)
645 /* ----- Check_D_CISdata() ---------------------------------------------- */
646 int Check_D_CISdata(u8
*buf
, u8
*redundant
)
648 u8 cis
[] = {0x01, 0x03, 0xD9, 0x01, 0xFF, 0x18, 0x02,
651 int cis_len
= sizeof(cis
);
653 if (!IsSSFDCCompliance
&& !IsXDCompliance
)
656 if (!memcmp(redundant
+ 0x0D, EccBuf
, 3))
657 return memcmp(buf
, cis
, cis_len
);
659 if (!_Correct_D_SwECC(buf
, redundant
+ 0x0D, EccBuf
))
660 return memcmp(buf
, cis
, cis_len
);
663 if (!memcmp(redundant
+ 0x08, EccBuf
+ 0x03, 3))
664 return memcmp(buf
, cis
, cis_len
);
666 if (!_Correct_D_SwECC(buf
, redundant
+ 0x08, EccBuf
+ 0x03))
667 return memcmp(buf
, cis
, cis_len
);
672 /* ----- Set_D_RightECC() ---------------------------------------------- */
673 void Set_D_RightECC(u8
*redundant
)
675 /* Driver ECC Check */