Commit fb03d4fc authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman

staging/keucr: don't use SUCCESS as macro name

Don't use "SUCCESS" as a macro name.  This collides with SCSI's macro
of the same name, but with a different value:

drivers/staging/keucr/smcommon.h:9:9: warning: preprocessor token SUCCESS redefined
include/scsi/scsi.h:463:9: this was the original definition
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7fb71adc
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/*************************************************************************** /***************************************************************************
Define Difinetion Define Difinetion
***************************************************************************/ ***************************************************************************/
#define SUCCESS 0x0000 /* SUCCESS */ #define SMSUCCESS 0x0000 /* SUCCESS */
#define ERROR 0xFFFF /* ERROR */ #define ERROR 0xFFFF /* ERROR */
#define CORRECT 0x0001 /* CORRECTABLE */ #define CORRECT 0x0001 /* CORRECTABLE */
......
...@@ -252,13 +252,13 @@ int Release_D_CopySector(struct us_data *us) ...@@ -252,13 +252,13 @@ int Release_D_CopySector(struct us_data *us)
if (Media.PhyBlock==NO_ASSIGN) if (Media.PhyBlock==NO_ASSIGN)
{ {
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
return(SUCCESS); return(SMSUCCESS);
} }
Clr_D_Bit(Assign[Media.Zone],Media.PhyBlock); Clr_D_Bit(Assign[Media.Zone],Media.PhyBlock);
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
return(SUCCESS); return(SMSUCCESS);
} }
/* /*
//----- Media_D_WriteSector() ------------------------------------------ //----- Media_D_WriteSector() ------------------------------------------
...@@ -568,7 +568,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -568,7 +568,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt)
// default: *c= 0; *h= 0; *s= 0; ErrCode = ERR_NoSmartMedia; return(ERROR); // default: *c= 0; *h= 0; *s= 0; ErrCode = ERR_NoSmartMedia; return(ERROR);
// } // }
// //
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// //
////Power Control & Media Exist Check Subroutine ////Power Control & Media Exist Check Subroutine
...@@ -595,7 +595,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -595,7 +595,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt)
// MediaChange = ERROR; // MediaChange = ERROR;
// //usleep(56*1024); // //usleep(56*1024);
// if ((!Check_D_CntPower())&&(!MediaChange)) // power & Media SQ change, h return success // if ((!Check_D_CntPower())&&(!MediaChange)) // power & Media SQ change, h return success
// return(SUCCESS); // return(SMSUCCESS);
// //usleep(56*1024); // //usleep(56*1024);
// //
// if (Check_D_CardExist()) // Check if card is not exist, return err // if (Check_D_CardExist()) // Check if card is not exist, return err
...@@ -614,7 +614,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -614,7 +614,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt)
// //usleep(56*1024); // //usleep(56*1024);
// Ssfdc_D_Reset(fdoExt); // Ssfdc_D_Reset(fdoExt);
// //usleep(56*1024); // //usleep(56*1024);
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// //
////-----Check_D_MediaExist() -------------------------------------------- ////-----Check_D_MediaExist() --------------------------------------------
...@@ -626,7 +626,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -626,7 +626,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt)
// if (!Check_D_CardExist()) // if (!Check_D_CardExist())
// { // {
// if (!MediaChange) // if (!MediaChange)
// return(SUCCESS); // return(SMSUCCESS);
// //
// ErrCode = ERR_ChangedMedia; // ErrCode = ERR_ChangedMedia;
// return(ERROR); // return(ERROR);
...@@ -646,7 +646,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -646,7 +646,7 @@ int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt)
// return(ERROR); // return(ERROR);
// } // }
// //
// return(SUCCESS); // return(SMSUCCESS);
//} //}
*/ */
//SmartMedia Physical Format Test Subroutine //SmartMedia Physical Format Test Subroutine
...@@ -658,7 +658,7 @@ int Check_D_MediaFmt(struct us_data *us) ...@@ -658,7 +658,7 @@ int Check_D_MediaFmt(struct us_data *us)
//usleep(56*1024); //usleep(56*1024);
if (!MediaChange) if (!MediaChange)
return(SUCCESS); return(SMSUCCESS);
MediaChange = ERROR; MediaChange = ERROR;
SectCopyMode = COMPLETED; SectCopyMode = COMPLETED;
...@@ -678,8 +678,8 @@ int Check_D_MediaFmt(struct us_data *us) ...@@ -678,8 +678,8 @@ int Check_D_MediaFmt(struct us_data *us)
} }
MediaChange = SUCCESS; MediaChange = SMSUCCESS;
return(SUCCESS); return(SMSUCCESS);
} }
/* /*
////----- Check_D_BlockIsFull() ---------------------------------- ////----- Check_D_BlockIsFull() ----------------------------------
...@@ -731,7 +731,7 @@ int Check_D_MediaFmt(struct us_data *us) ...@@ -731,7 +731,7 @@ int Check_D_MediaFmt(struct us_data *us)
// return(ERROR); // return(ERROR);
// } // }
// //
// return(SUCCESS); // return(SMSUCCESS);
//} //}
*/ */
//SmartMedia Physical Address Control Subroutine //SmartMedia Physical Address Control Subroutine
...@@ -763,7 +763,7 @@ int Conv_D_MediaAddr(struct us_data *us, DWORD addr) ...@@ -763,7 +763,7 @@ int Conv_D_MediaAddr(struct us_data *us, DWORD addr)
Clr_D_RedundantData(Redundant); Clr_D_RedundantData(Redundant);
Set_D_LogBlockAddr(Redundant); Set_D_LogBlockAddr(Redundant);
Media.PhyBlock = Log2Phy[Media.Zone][Media.LogBlock]; Media.PhyBlock = Log2Phy[Media.Zone][Media.LogBlock];
return(SUCCESS); return(SMSUCCESS);
} }
ErrCode = ERR_OutOfLBA; ErrCode = ERR_OutOfLBA;
...@@ -778,7 +778,7 @@ int Inc_D_MediaAddr(struct us_data *us) ...@@ -778,7 +778,7 @@ int Inc_D_MediaAddr(struct us_data *us)
//ADDRESS_T bb = (ADDRESS_T) &Media; //ADDRESS_T bb = (ADDRESS_T) &Media;
if (++Media.Sector<Ssfdc.MaxSectors) if (++Media.Sector<Ssfdc.MaxSectors)
return(SUCCESS); return(SMSUCCESS);
if (Log2Phy[Media.Zone]==NULL) if (Log2Phy[Media.Zone]==NULL)
{ {
...@@ -797,7 +797,7 @@ int Inc_D_MediaAddr(struct us_data *us) ...@@ -797,7 +797,7 @@ int Inc_D_MediaAddr(struct us_data *us)
Clr_D_RedundantData(Redundant); Clr_D_RedundantData(Redundant);
Set_D_LogBlockAddr(Redundant); Set_D_LogBlockAddr(Redundant);
Media.PhyBlock=Log2Phy[Media.Zone][Media.LogBlock]; Media.PhyBlock=Log2Phy[Media.Zone][Media.LogBlock];
return(SUCCESS); return(SMSUCCESS);
} }
Media.LogBlock=0; Media.LogBlock=0;
...@@ -818,7 +818,7 @@ int Inc_D_MediaAddr(struct us_data *us) ...@@ -818,7 +818,7 @@ int Inc_D_MediaAddr(struct us_data *us)
Clr_D_RedundantData(Redundant); Clr_D_RedundantData(Redundant);
Set_D_LogBlockAddr(Redundant); Set_D_LogBlockAddr(Redundant);
Media.PhyBlock=Log2Phy[Media.Zone][Media.LogBlock]; Media.PhyBlock=Log2Phy[Media.Zone][Media.LogBlock];
return(SUCCESS); return(SMSUCCESS);
} }
Media.Zone=0; Media.Zone=0;
...@@ -834,7 +834,7 @@ int Check_D_FirstSect(void) ...@@ -834,7 +834,7 @@ int Check_D_FirstSect(void)
ADDRESS_T bb = (ADDRESS_T) &Media; ADDRESS_T bb = (ADDRESS_T) &Media;
if (!Media.Sector) if (!Media.Sector)
return(SUCCESS); return(SMSUCCESS);
return(ERROR); return(ERROR);
} }
...@@ -848,7 +848,7 @@ int Check_D_LastSect(void) ...@@ -848,7 +848,7 @@ int Check_D_LastSect(void)
if (Media.Sector<(Ssfdc.MaxSectors-1)) if (Media.Sector<(Ssfdc.MaxSectors-1))
return(ERROR); return(ERROR);
return(SUCCESS); return(SMSUCCESS);
} }
*/ */
//SmartMedia Read/Write Subroutine with Retry //SmartMedia Read/Write Subroutine with Retry
...@@ -858,7 +858,7 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf) ...@@ -858,7 +858,7 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf)
DWORD err, retry; DWORD err, retry;
if (!Read_D_PhyOneSect(us, count, buf)) if (!Read_D_PhyOneSect(us, count, buf))
return(SUCCESS); return(SMSUCCESS);
if (ErrCode==ERR_HwError) if (ErrCode==ERR_HwError)
return(ERROR); return(ERROR);
if (ErrCode==ERR_DataStatus) if (ErrCode==ERR_DataStatus)
...@@ -868,7 +868,7 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf) ...@@ -868,7 +868,7 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf)
if (Ssfdc.Attribute &MWP) if (Ssfdc.Attribute &MWP)
{ {
if (ErrCode==ERR_CorReadErr) if (ErrCode==ERR_CorReadErr)
return(SUCCESS); return(SMSUCCESS);
return(ERROR); return(ERROR);
} }
...@@ -884,13 +884,13 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf) ...@@ -884,13 +884,13 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf)
ErrCode = err; ErrCode = err;
if (ErrCode==ERR_CorReadErr) if (ErrCode==ERR_CorReadErr)
return(SUCCESS); return(SMSUCCESS);
return(ERROR); return(ERROR);
} }
MediaChange = ERROR; MediaChange = ERROR;
#else #else
if (ErrCode==ERR_CorReadErr) return(SUCCESS); if (ErrCode==ERR_CorReadErr) return(SMSUCCESS);
#endif #endif
return(ERROR); return(ERROR);
...@@ -904,7 +904,7 @@ int Media_D_WriteOneSect(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf) ...@@ -904,7 +904,7 @@ int Media_D_WriteOneSect(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf)
ADDRESS_T bb = (ADDRESS_T) &Media; ADDRESS_T bb = (ADDRESS_T) &Media;
if (!Write_D_PhyOneSect(fdoExt, count, buf)) if (!Write_D_PhyOneSect(fdoExt, count, buf))
return(SUCCESS); return(SMSUCCESS);
if (ErrCode==ERR_HwError) if (ErrCode==ERR_HwError)
return(ERROR); return(ERROR);
...@@ -918,7 +918,7 @@ int Media_D_WriteOneSect(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf) ...@@ -918,7 +918,7 @@ int Media_D_WriteOneSect(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf)
} }
if (!Write_D_PhyOneSect(fdoExt, count, buf)) if (!Write_D_PhyOneSect(fdoExt, count, buf))
return(SUCCESS); return(SMSUCCESS);
if (ErrCode==ERR_HwError) if (ErrCode==ERR_HwError)
return(ERROR); return(ERROR);
} }
...@@ -940,7 +940,7 @@ int Media_D_CopyBlockHead(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -940,7 +940,7 @@ int Media_D_CopyBlockHead(PFDO_DEVICE_EXTENSION fdoExt)
for(retry=0; retry<2; retry++) for(retry=0; retry<2; retry++)
{ {
if (!Copy_D_BlockHead(fdoExt)) if (!Copy_D_BlockHead(fdoExt))
return(SUCCESS); return(SMSUCCESS);
if (ErrCode==ERR_HwError) if (ErrCode==ERR_HwError)
return(ERROR); return(ERROR);
} }
...@@ -955,7 +955,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -955,7 +955,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt)
DWORD retry; DWORD retry;
if (!Copy_D_BlockTail(fdoExt)) if (!Copy_D_BlockTail(fdoExt))
return(SUCCESS); return(SMSUCCESS);
if (ErrCode==ERR_HwError) if (ErrCode==ERR_HwError)
return(ERROR); return(ERROR);
...@@ -969,7 +969,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -969,7 +969,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt)
} }
if (!Copy_D_BlockTail(fdoExt)) if (!Copy_D_BlockTail(fdoExt))
return(SUCCESS); return(SMSUCCESS);
if (ErrCode==ERR_HwError) if (ErrCode==ERR_HwError)
return(ERROR); return(ERROR);
} }
...@@ -991,7 +991,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -991,7 +991,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt)
// ADDRESS_T bb = (ADDRESS_T) &Media; // ADDRESS_T bb = (ADDRESS_T) &Media;
// //
// if (Media.PhyBlock==NO_ASSIGN) // if (Media.PhyBlock==NO_ASSIGN)
// return(SUCCESS); // return(SMSUCCESS);
// //
// if (Log2Phy[Media.Zone]==NULL) // if (Log2Phy[Media.Zone]==NULL)
// { // {
...@@ -1019,7 +1019,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -1019,7 +1019,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt)
// //
// Clr_D_Bit(Assign[Media.Zone],Media.PhyBlock); // Clr_D_Bit(Assign[Media.Zone],Media.PhyBlock);
// Media.PhyBlock=NO_ASSIGN; // Media.PhyBlock=NO_ASSIGN;
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// //
////SmartMedia Erase Subroutine ////SmartMedia Erase Subroutine
...@@ -1072,7 +1072,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -1072,7 +1072,7 @@ int Media_D_CopyBlockTail(PFDO_DEVICE_EXTENSION fdoExt)
// } // }
// //
// } // }
// return(SUCCESS); // return(SMSUCCESS);
//} //}
*/ */
//SmartMedia Physical Sector Data Copy Subroutine //SmartMedia Physical Sector Data Copy Subroutine
...@@ -1112,7 +1112,7 @@ int Copy_D_BlockAll(struct us_data *us, DWORD mode) ...@@ -1112,7 +1112,7 @@ int Copy_D_BlockAll(struct us_data *us, DWORD mode)
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
Media.Sector=sect; Media.Sector=sect;
return(SUCCESS); return(SMSUCCESS);
} }
/* /*
//----- Copy_D_BlockHead() --------------------------------------------- //----- Copy_D_BlockHead() ---------------------------------------------
...@@ -1145,7 +1145,7 @@ int Copy_D_BlockHead(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -1145,7 +1145,7 @@ int Copy_D_BlockHead(PFDO_DEVICE_EXTENSION fdoExt)
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
Media.Sector=sect; Media.Sector=sect;
return(SUCCESS); return(SMSUCCESS);
} }
//----- Copy_D_BlockTail() --------------------------------------------- //----- Copy_D_BlockTail() ---------------------------------------------
...@@ -1174,7 +1174,7 @@ int Copy_D_BlockTail(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -1174,7 +1174,7 @@ int Copy_D_BlockTail(PFDO_DEVICE_EXTENSION fdoExt)
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
Media.Sector=sect; Media.Sector=sect;
return(SUCCESS); return(SMSUCCESS);
} }
//----- Reassign_D_BlockHead() ----------------------------------------- //----- Reassign_D_BlockHead() -----------------------------------------
...@@ -1222,7 +1222,7 @@ int Reassign_D_BlockHead(PFDO_DEVICE_EXTENSION fdoExt) ...@@ -1222,7 +1222,7 @@ int Reassign_D_BlockHead(PFDO_DEVICE_EXTENSION fdoExt)
ReadBlock=block; ReadBlock=block;
Media.Sector=sect; Media.Sector=sect;
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
return(SUCCESS); return(SMSUCCESS);
} }
*/ */
//SmartMedia Physical Block Assign/Release Subroutine //SmartMedia Physical Block Assign/Release Subroutine
...@@ -1242,7 +1242,7 @@ int Assign_D_WriteBlock(void) ...@@ -1242,7 +1242,7 @@ int Assign_D_WriteBlock(void)
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
SectCopyMode=REQ_ERASE; SectCopyMode=REQ_ERASE;
//ErrXDCode = NO_ERROR; //ErrXDCode = NO_ERROR;
return(SUCCESS); return(SMSUCCESS);
} }
} }
...@@ -1255,7 +1255,7 @@ int Assign_D_WriteBlock(void) ...@@ -1255,7 +1255,7 @@ int Assign_D_WriteBlock(void)
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
SectCopyMode=REQ_ERASE; SectCopyMode=REQ_ERASE;
//ErrXDCode = NO_ERROR; //ErrXDCode = NO_ERROR;
return(SUCCESS); return(SMSUCCESS);
} }
} }
...@@ -1278,7 +1278,7 @@ int Release_D_ReadBlock(struct us_data *us) ...@@ -1278,7 +1278,7 @@ int Release_D_ReadBlock(struct us_data *us)
SectCopyMode=COMPLETED; SectCopyMode=COMPLETED;
if (mode==COMPLETED) if (mode==COMPLETED)
return(SUCCESS); return(SMSUCCESS);
Log2Phy[Media.Zone][Media.LogBlock]=WriteBlock; Log2Phy[Media.Zone][Media.LogBlock]=WriteBlock;
Media.PhyBlock=ReadBlock; Media.PhyBlock=ReadBlock;
...@@ -1286,7 +1286,7 @@ int Release_D_ReadBlock(struct us_data *us) ...@@ -1286,7 +1286,7 @@ int Release_D_ReadBlock(struct us_data *us)
if (Media.PhyBlock==NO_ASSIGN) if (Media.PhyBlock==NO_ASSIGN)
{ {
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
return(SUCCESS); return(SMSUCCESS);
} }
if (mode==REQ_ERASE) if (mode==REQ_ERASE)
...@@ -1303,7 +1303,7 @@ int Release_D_ReadBlock(struct us_data *us) ...@@ -1303,7 +1303,7 @@ int Release_D_ReadBlock(struct us_data *us)
return(ERROR); return(ERROR);
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
return(SUCCESS); return(SMSUCCESS);
} }
//----- Release_D_WriteBlock() ----------------------------------------- //----- Release_D_WriteBlock() -----------------------------------------
...@@ -1318,7 +1318,7 @@ int Release_D_WriteBlock(struct us_data *us) ...@@ -1318,7 +1318,7 @@ int Release_D_WriteBlock(struct us_data *us)
return(ERROR); return(ERROR);
Media.PhyBlock=ReadBlock; Media.PhyBlock=ReadBlock;
return(SUCCESS); return(SMSUCCESS);
} }
//SmartMedia Physical Sector Data Copy Subroutine //SmartMedia Physical Sector Data Copy Subroutine
...@@ -1351,9 +1351,9 @@ int Copy_D_PhyOneSect(struct us_data *us) ...@@ -1351,9 +1351,9 @@ int Copy_D_PhyOneSect(struct us_data *us)
if (Check_D_DataStatus(WorkRedund)) if (Check_D_DataStatus(WorkRedund))
{ err=ERROR; break; } { err=ERROR; break; }
if (!Check_D_ReadError(WorkRedund)) if (!Check_D_ReadError(WorkRedund))
{ err=SUCCESS; break; } { err=SMSUCCESS; break; }
if (!Check_D_Correct(WorkBuf,WorkRedund)) if (!Check_D_Correct(WorkBuf,WorkRedund))
{ err=SUCCESS; break; } { err=SMSUCCESS; break; }
err=ERROR; err=ERROR;
SectCopyMode=REQ_FAIL; SectCopyMode=REQ_FAIL;
...@@ -1361,7 +1361,7 @@ int Copy_D_PhyOneSect(struct us_data *us) ...@@ -1361,7 +1361,7 @@ int Copy_D_PhyOneSect(struct us_data *us)
} }
else else
{ {
err=SUCCESS; err=SMSUCCESS;
for(i=0; i<SECTSIZE; i++) for(i=0; i<SECTSIZE; i++)
WorkBuf[i]=DUMMY_DATA; WorkBuf[i]=DUMMY_DATA;
Clr_D_RedundantData(WorkRedund); Clr_D_RedundantData(WorkRedund);
...@@ -1382,7 +1382,7 @@ int Copy_D_PhyOneSect(struct us_data *us) ...@@ -1382,7 +1382,7 @@ int Copy_D_PhyOneSect(struct us_data *us)
{ ErrCode = ERR_WriteFault; return(ERROR); } { ErrCode = ERR_WriteFault; return(ERROR); }
Media.PhyBlock=ReadBlock; Media.PhyBlock=ReadBlock;
return(SUCCESS); return(SMSUCCESS);
} }
//SmartMedia Physical Sector Read/Write/Erase Subroutine //SmartMedia Physical Sector Read/Write/Erase Subroutine
...@@ -1398,7 +1398,7 @@ int Read_D_PhyOneSect(struct us_data *us, WORD count, BYTE *buf) ...@@ -1398,7 +1398,7 @@ int Read_D_PhyOneSect(struct us_data *us, WORD count, BYTE *buf)
{ {
for(i=0; i<SECTSIZE; i++) for(i=0; i<SECTSIZE; i++)
*buf++=DUMMY_DATA; *buf++=DUMMY_DATA;
return(SUCCESS); return(SMSUCCESS);
} }
for(retry=0; retry<2; retry++) for(retry=0; retry<2; retry++)
...@@ -1420,7 +1420,7 @@ int Read_D_PhyOneSect(struct us_data *us, WORD count, BYTE *buf) ...@@ -1420,7 +1420,7 @@ int Read_D_PhyOneSect(struct us_data *us, WORD count, BYTE *buf)
{ ErrCode = ERR_DataStatus; return(ERROR); } { ErrCode = ERR_DataStatus; return(ERROR); }
if (!Check_D_ReadError(Redundant)) if (!Check_D_ReadError(Redundant))
return(SUCCESS); return(SMSUCCESS);
if (!Check_D_Correct(buf,Redundant)) if (!Check_D_Correct(buf,Redundant))
{ ErrCode = ERR_CorReadErr; return(ERROR); } { ErrCode = ERR_CorReadErr; return(ERROR); }
...@@ -1442,7 +1442,7 @@ int Write_D_PhyOneSect(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf) ...@@ -1442,7 +1442,7 @@ int Write_D_PhyOneSect(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf)
if (Ssfdc_D_CheckStatus()) if (Ssfdc_D_CheckStatus())
{ ErrCode = ERR_WriteFault; return(ERROR); } { ErrCode = ERR_WriteFault; return(ERROR); }
return(SUCCESS); return(SMSUCCESS);
} }
*/ */
//----- Erase_D_PhyOneBlock() ------------------------------------------ //----- Erase_D_PhyOneBlock() ------------------------------------------
...@@ -1456,7 +1456,7 @@ int Erase_D_PhyOneBlock(struct us_data *us) ...@@ -1456,7 +1456,7 @@ int Erase_D_PhyOneBlock(struct us_data *us)
if (Ssfdc_D_CheckStatus()) if (Ssfdc_D_CheckStatus())
{ ErrCode = ERR_WriteFault; return(ERROR); } { ErrCode = ERR_WriteFault; return(ERROR); }
return(SUCCESS); return(SMSUCCESS);
} }
//SmartMedia Physical Format Check Local Subroutine //SmartMedia Physical Format Check Local Subroutine
...@@ -1540,7 +1540,7 @@ int Set_D_PhyFmtValue(struct us_data *us) ...@@ -1540,7 +1540,7 @@ int Set_D_PhyFmtValue(struct us_data *us)
// } // }
// } // }
return(SUCCESS); return(SMSUCCESS);
} }
//----- Search_D_CIS() ------------------------------------------------- //----- Search_D_CIS() -------------------------------------------------
...@@ -1596,7 +1596,7 @@ int Search_D_CIS(struct us_data *us) ...@@ -1596,7 +1596,7 @@ int Search_D_CIS(struct us_data *us)
CisArea.PhyBlock=Media.PhyBlock; CisArea.PhyBlock=Media.PhyBlock;
CisArea.Sector=Media.Sector; CisArea.Sector=Media.Sector;
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
return(SUCCESS); return(SMSUCCESS);
} }
Media.Sector++; Media.Sector++;
...@@ -1733,7 +1733,7 @@ int Make_D_LogTable(struct us_data *us) ...@@ -1733,7 +1733,7 @@ int Make_D_LogTable(struct us_data *us)
} // End for (Media.Zone<MAX_ZONENUM) } // End for (Media.Zone<MAX_ZONENUM)
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
return(SUCCESS); return(SMSUCCESS);
} }
//----- MarkFail_D_PhyOneBlock() --------------------------------------- //----- MarkFail_D_PhyOneBlock() ---------------------------------------
...@@ -1761,7 +1761,7 @@ int MarkFail_D_PhyOneBlock(struct us_data *us) ...@@ -1761,7 +1761,7 @@ int MarkFail_D_PhyOneBlock(struct us_data *us)
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
Media.Sector=sect; Media.Sector=sect;
return(SUCCESS); return(SMSUCCESS);
} }
/* /*
// //
...@@ -1819,7 +1819,7 @@ int MarkFail_D_PhyOneBlock(struct us_data *us) ...@@ -1819,7 +1819,7 @@ int MarkFail_D_PhyOneBlock(struct us_data *us)
// //
// Ssfdc_D_Reset(fdoExt); // Ssfdc_D_Reset(fdoExt);
// //
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// //
////----- Media_D_GetMediaInfo() --------------------------------------- ////----- Media_D_GetMediaInfo() ---------------------------------------
......
...@@ -65,7 +65,7 @@ int Check_D_DataBlank(BYTE *redundant) ...@@ -65,7 +65,7 @@ int Check_D_DataBlank(BYTE *redundant)
if (*redundant++!=0xFF) if (*redundant++!=0xFF)
return(ERROR); return(ERROR);
return(SUCCESS); return(SMSUCCESS);
} }
//----- Check_D_FailBlock() -------------------------------------------- //----- Check_D_FailBlock() --------------------------------------------
...@@ -74,13 +74,13 @@ int Check_D_FailBlock(BYTE *redundant) ...@@ -74,13 +74,13 @@ int Check_D_FailBlock(BYTE *redundant)
redundant+=REDT_BLOCK; redundant+=REDT_BLOCK;
if (*redundant==0xFF) if (*redundant==0xFF)
return(SUCCESS); return(SMSUCCESS);
if (!*redundant) if (!*redundant)
return(ERROR); return(ERROR);
if (hweight8(*redundant)<7) if (hweight8(*redundant)<7)
return(ERROR); return(ERROR);
return(SUCCESS); return(SMSUCCESS);
} }
//----- Check_D_DataStatus() ------------------------------------------- //----- Check_D_DataStatus() -------------------------------------------
...@@ -89,7 +89,7 @@ int Check_D_DataStatus(BYTE *redundant) ...@@ -89,7 +89,7 @@ int Check_D_DataStatus(BYTE *redundant)
redundant+=REDT_DATA; redundant+=REDT_DATA;
if (*redundant==0xFF) if (*redundant==0xFF)
return(SUCCESS); return(SMSUCCESS);
if (!*redundant) if (!*redundant)
{ {
ErrXDCode = ERR_DataStatus; ErrXDCode = ERR_DataStatus;
...@@ -101,7 +101,7 @@ int Check_D_DataStatus(BYTE *redundant) ...@@ -101,7 +101,7 @@ int Check_D_DataStatus(BYTE *redundant)
if (hweight8(*redundant)<5) if (hweight8(*redundant)<5)
return(ERROR); return(ERROR);
return(SUCCESS); return(SMSUCCESS);
} }
//----- Load_D_LogBlockAddr() ------------------------------------------ //----- Load_D_LogBlockAddr() ------------------------------------------
...@@ -116,17 +116,17 @@ int Load_D_LogBlockAddr(BYTE *redundant) ...@@ -116,17 +116,17 @@ int Load_D_LogBlockAddr(BYTE *redundant)
if (addr1==addr2) if (addr1==addr2)
if ((addr1 &0xF000)==0x1000) if ((addr1 &0xF000)==0x1000)
{ Media.LogBlock=(addr1 &0x0FFF)/2; return(SUCCESS); } { Media.LogBlock=(addr1 &0x0FFF)/2; return(SMSUCCESS); }
if (hweight16((WORD)(addr1^addr2))!=0x01) return(ERROR); if (hweight16((WORD)(addr1^addr2))!=0x01) return(ERROR);
if ((addr1 &0xF000)==0x1000) if ((addr1 &0xF000)==0x1000)
if (!(hweight16(addr1) &0x01)) if (!(hweight16(addr1) &0x01))
{ Media.LogBlock=(addr1 &0x0FFF)/2; return(SUCCESS); } { Media.LogBlock=(addr1 &0x0FFF)/2; return(SMSUCCESS); }
if ((addr2 &0xF000)==0x1000) if ((addr2 &0xF000)==0x1000)
if (!(hweight16(addr2) &0x01)) if (!(hweight16(addr2) &0x01))
{ Media.LogBlock=(addr2 &0x0FFF)/2; return(SUCCESS); } { Media.LogBlock=(addr2 &0x0FFF)/2; return(SMSUCCESS); }
return(ERROR); return(ERROR);
} }
...@@ -220,7 +220,7 @@ int Ssfdc_D_ReadCisSect(struct us_data *us, BYTE *buf,BYTE *redundant) ...@@ -220,7 +220,7 @@ int Ssfdc_D_ReadCisSect(struct us_data *us, BYTE *buf,BYTE *redundant)
} }
Media.Zone=zone; Media.PhyBlock=block; Media.Sector=sector; Media.Zone=zone; Media.PhyBlock=block; Media.Sector=sector;
return(SUCCESS); return(SMSUCCESS);
} }
/* /*
////----- Ssfdc_D_WriteRedtMode() ---------------------------------------- ////----- Ssfdc_D_WriteRedtMode() ----------------------------------------
...@@ -426,7 +426,7 @@ int Ssfdc_D_ReadBlock(struct us_data *us, WORD count, BYTE *buf,BYTE *redundant) ...@@ -426,7 +426,7 @@ int Ssfdc_D_ReadBlock(struct us_data *us, WORD count, BYTE *buf,BYTE *redundant)
// //
// if (!_Hw_D_ChkCardIn()) // if (!_Hw_D_ChkCardIn())
// return(ERROR); // return(ERROR);
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// //
////----- Ssfdc_D_ReadSect_PIO() --------------------------------------------- ////----- Ssfdc_D_ReadSect_PIO() ---------------------------------------------
...@@ -449,7 +449,7 @@ int Ssfdc_D_ReadBlock(struct us_data *us, WORD count, BYTE *buf,BYTE *redundant) ...@@ -449,7 +449,7 @@ int Ssfdc_D_ReadBlock(struct us_data *us, WORD count, BYTE *buf,BYTE *redundant)
// //
// _Calc_D_ECCdata(buf); // _Calc_D_ECCdata(buf);
// _Set_D_SsfdcRdStandby(); // _Set_D_SsfdcRdStandby();
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// 6250 CMD 3 // 6250 CMD 3
...@@ -507,7 +507,7 @@ int Ssfdc_D_WriteSect(PFDO_DEVICE_EXTENSION fdoExt, BYTE *buf,BYTE *redundant) ...@@ -507,7 +507,7 @@ int Ssfdc_D_WriteSect(PFDO_DEVICE_EXTENSION fdoExt, BYTE *buf,BYTE *redundant)
// ENE_Print("Error\n"); // ENE_Print("Error\n");
// } // }
return(SUCCESS); return(SMSUCCESS);
} }
*/ */
//----- Ssfdc_D_CopyBlock() -------------------------------------------- //----- Ssfdc_D_CopyBlock() --------------------------------------------
...@@ -612,7 +612,7 @@ int Ssfdc_D_WriteBlock(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf,BYTE ...@@ -612,7 +612,7 @@ int Ssfdc_D_WriteBlock(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf,BYTE
// ENE_Print("Error\n"); // ENE_Print("Error\n");
// } // }
return(SUCCESS); return(SMSUCCESS);
} }
// //
////----- Ssfdc_D_WriteSect_DMA() -------------------------------------------- ////----- Ssfdc_D_WriteSect_DMA() --------------------------------------------
...@@ -702,7 +702,7 @@ int Ssfdc_D_WriteBlock(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf,BYTE ...@@ -702,7 +702,7 @@ int Ssfdc_D_WriteBlock(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf,BYTE
// if (!_Hw_D_ChkCardIn()) // if (!_Hw_D_ChkCardIn())
// return(ERROR); // return(ERROR);
// //
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// //
////----- Ssfdc_D_WriteSect_PIO() -------------------------------------------- ////----- Ssfdc_D_WriteSect_PIO() --------------------------------------------
...@@ -727,7 +727,7 @@ int Ssfdc_D_WriteBlock(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf,BYTE ...@@ -727,7 +727,7 @@ int Ssfdc_D_WriteBlock(PFDO_DEVICE_EXTENSION fdoExt, WORD count, BYTE *buf,BYTE
// //
// _Set_D_SsfdcWrStandby(); // _Set_D_SsfdcWrStandby();
// _Set_D_SsfdcRdStandby(); // _Set_D_SsfdcRdStandby();
// return(SUCCESS); // return(SMSUCCESS);
//} //}
*/ */
//----- Ssfdc_D_WriteSectForCopy() ------------------------------------- //----- Ssfdc_D_WriteSectForCopy() -------------------------------------
...@@ -891,14 +891,14 @@ int Ssfdc_D_WriteRedtData(struct us_data *us, BYTE *redundant) ...@@ -891,14 +891,14 @@ int Ssfdc_D_WriteRedtData(struct us_data *us, BYTE *redundant)
int Ssfdc_D_CheckStatus(void) int Ssfdc_D_CheckStatus(void)
{ {
// Driver // Driver
return(SUCCESS); return(SMSUCCESS);
//_Set_D_SsfdcRdCmd(RDSTATUS); //_Set_D_SsfdcRdCmd(RDSTATUS);
// //
//if (_Check_D_SsfdcStatus()) //if (_Check_D_SsfdcStatus())
//{ _Set_D_SsfdcRdStandby(); return(ERROR); } //{ _Set_D_SsfdcRdStandby(); return(ERROR); }
// //
//_Set_D_SsfdcRdStandby(); //_Set_D_SsfdcRdStandby();
//return(SUCCESS); //return(SMSUCCESS);
} }
/* /*
////NAND Memory (SmartMedia) Control Subroutine for Read Data ////NAND Memory (SmartMedia) Control Subroutine for Read Data
...@@ -1093,7 +1093,7 @@ int Ssfdc_D_CheckStatus(void) ...@@ -1093,7 +1093,7 @@ int Ssfdc_D_CheckStatus(void)
// //
// do { // do {
// if (!_Hw_D_ChkBusy()) // if (!_Hw_D_ChkBusy())
// return(SUCCESS); // return(SMSUCCESS);
// EDelay(100); // EDelay(100);
// count++; // count++;
// } while (count<=time); // } while (count<=time);
...@@ -1107,7 +1107,7 @@ int Ssfdc_D_CheckStatus(void) ...@@ -1107,7 +1107,7 @@ int Ssfdc_D_CheckStatus(void)
// if (_Hw_D_InData() & WR_FAIL) // if (_Hw_D_InData() & WR_FAIL)
// return(ERROR); // return(ERROR);
// //
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// //
//// For 712 //// For 712
...@@ -1337,7 +1337,7 @@ int Set_D_SsfdcModel(BYTE dcode) ...@@ -1337,7 +1337,7 @@ int Set_D_SsfdcModel(BYTE dcode)
return(ERROR); return(ERROR);
} }
return(SUCCESS); return(SMSUCCESS);
} }
//----- _Check_D_DevCode() --------------------------------------------- //----- _Check_D_DevCode() ---------------------------------------------
...@@ -1386,7 +1386,7 @@ BYTE _Check_D_DevCode(BYTE dcode) ...@@ -1386,7 +1386,7 @@ BYTE _Check_D_DevCode(BYTE dcode)
// if (_Hw_D_ChkPower()) // if (_Hw_D_ChkPower())
// { // {
// _Hw_D_EnableOB(); // Set SM_REG_CTRL_5 Reg. to 0x83 // _Hw_D_EnableOB(); // Set SM_REG_CTRL_5 Reg. to 0x83
// return(SUCCESS); // return(SMSUCCESS);
// } // }
// //
// _Hw_D_SetVccOff(); // _Hw_D_SetVccOff();
...@@ -1417,7 +1417,7 @@ BYTE _Check_D_DevCode(BYTE dcode) ...@@ -1417,7 +1417,7 @@ BYTE _Check_D_DevCode(BYTE dcode)
//int Check_D_CntPower(void) //int Check_D_CntPower(void)
//{ //{
// if (_Hw_D_ChkPower()) // if (_Hw_D_ChkPower())
// return(SUCCESS); // Power On // return(SMSUCCESS); // Power On
// //
// return(ERROR); // Power Off // return(ERROR); // Power Off
//} //}
...@@ -1429,7 +1429,7 @@ BYTE _Check_D_DevCode(BYTE dcode) ...@@ -1429,7 +1429,7 @@ BYTE _Check_D_DevCode(BYTE dcode)
// //
// if (!_Hw_D_ChkStatus()) // Not Status Change // if (!_Hw_D_ChkStatus()) // Not Status Change
// if (_Hw_D_ChkCardIn()) // if (_Hw_D_ChkCardIn())
// return(SUCCESS); // Card exist in Slot // return(SMSUCCESS); // Card exist in Slot
// //
// for(i=0,j=0,k=0; i<16; i++) { // for(i=0,j=0,k=0; i<16; i++) {
// if (_Hw_D_ChkCardIn()) // Status Change // if (_Hw_D_ChkCardIn()) // Status Change
...@@ -1442,7 +1442,7 @@ BYTE _Check_D_DevCode(BYTE dcode) ...@@ -1442,7 +1442,7 @@ BYTE _Check_D_DevCode(BYTE dcode)
// } // }
// //
// if (j>3) // if (j>3)
// return(SUCCESS); // Card exist in Slot // return(SMSUCCESS); // Card exist in Slot
// if (k>3) // if (k>3)
// return(ERROR); // NO Card exist in Slot // return(ERROR); // NO Card exist in Slot
// //
...@@ -1458,12 +1458,12 @@ BYTE _Check_D_DevCode(BYTE dcode) ...@@ -1458,12 +1458,12 @@ BYTE _Check_D_DevCode(BYTE dcode)
// if (_Hw_D_ChkStatus()) // if (_Hw_D_ChkStatus())
// return(ERROR); // Status Change // return(ERROR); // Status Change
// //
// return(SUCCESS); // Not Status Change // return(SMSUCCESS); // Not Status Change
//} //}
// //
////----- Check_D_SsfdcWP() ---------------------------------------------- ////----- Check_D_SsfdcWP() ----------------------------------------------
//int Check_D_SsfdcWP(void) //int Check_D_SsfdcWP(void)
//{ // ERROR: WP, SUCCESS: Not WP //{ // ERROR: WP, SMSUCCESS: Not WP
// char i; // char i;
// //
// for(i=0; i<8; i++) { // for(i=0; i<8; i++) {
...@@ -1472,7 +1472,7 @@ BYTE _Check_D_DevCode(BYTE dcode) ...@@ -1472,7 +1472,7 @@ BYTE _Check_D_DevCode(BYTE dcode)
// _Wait_D_Timer(TIME_WPCHK); // _Wait_D_Timer(TIME_WPCHK);
// } // }
// //
// return(SUCCESS); // return(SMSUCCESS);
//} //}
// //
*/ */
...@@ -1480,13 +1480,13 @@ BYTE _Check_D_DevCode(BYTE dcode) ...@@ -1480,13 +1480,13 @@ BYTE _Check_D_DevCode(BYTE dcode)
//----- Check_D_ReadError() ---------------------------------------------- //----- Check_D_ReadError() ----------------------------------------------
int Check_D_ReadError(BYTE *redundant) int Check_D_ReadError(BYTE *redundant)
{ {
return SUCCESS; return SMSUCCESS;
} }
//----- Check_D_Correct() ---------------------------------------------- //----- Check_D_Correct() ----------------------------------------------
int Check_D_Correct(BYTE *buf,BYTE *redundant) int Check_D_Correct(BYTE *buf,BYTE *redundant)
{ {
return SUCCESS; return SMSUCCESS;
} }
//----- Check_D_CISdata() ---------------------------------------------- //----- Check_D_CISdata() ----------------------------------------------
...@@ -1498,7 +1498,7 @@ int Check_D_CISdata(BYTE *buf, BYTE *redundant) ...@@ -1498,7 +1498,7 @@ int Check_D_CISdata(BYTE *buf, BYTE *redundant)
int cis_len = sizeof(cis); int cis_len = sizeof(cis);
if (!IsSSFDCCompliance && !IsXDCompliance) if (!IsSSFDCCompliance && !IsXDCompliance)
return SUCCESS; return SMSUCCESS;
if (!memcmp(redundant + 0x0D, EccBuf, 3)) if (!memcmp(redundant + 0x0D, EccBuf, 3))
return memcmp(buf, cis, cis_len); return memcmp(buf, cis, cis_len);
...@@ -1597,5 +1597,5 @@ int SM_ReadBlock(PFDO_DEVICE_EXTENSION fdoExt, BYTE *buf,BYTE *redundant) ...@@ -1597,5 +1597,5 @@ int SM_ReadBlock(PFDO_DEVICE_EXTENSION fdoExt, BYTE *buf,BYTE *redundant)
if (!NT_SUCCESS(ntStatus)) if (!NT_SUCCESS(ntStatus))
return(ERROR); return(ERROR);
return(SUCCESS); return(SMSUCCESS);
}*/ }*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment