// }
//
// Initialize_D_Media();
-// return(NO_ERROR);
+// return NO_ERROR;
//}
//----- SM_FreeMem() -------------------------------------------------
Log2Phy[i] = NULL;
}
}
- return(NO_ERROR);
+ return NO_ERROR;
}
////----- Pwoff_D_SmartMedia() -------------------------------------------
//int Pwoff_D_SmartMedia(void)
//{
// PowerOff_D_Media();
-// return(NO_ERROR);
+// return NO_ERROR;
//}
//
////----- Check_D_SmartMedia() -------------------------------------------
//int Check_D_SmartMedia(void)
//{
// if (Check_D_MediaExist())
-// return(ErrCode);
+// return ErrCode;
//
-// return(NO_ERROR);
+// return NO_ERROR;
//}
//
////----- Check_D_Parameter() --------------------------------------------
//int Check_D_Parameter(PFDO_DEVICE_EXTENSION fdoExt,WORD *pcyl,BYTE *phead,BYTE *psect)
//{
// if (Check_D_MediaPower())
-// return(ErrCode);
+// return ErrCode;
//
// if (Check_D_MediaFmt(fdoExt))
-// return(ErrCode);
+// return ErrCode;
//
// if (Check_D_LogCHS(pcyl,phead,psect))
-// return(ErrCode);
+// return ErrCode;
//
-// return(NO_ERROR);
+// return NO_ERROR;
//}
//SmartMedia Read/Write/Erase Function
WORD len, bn;
//if (Check_D_MediaPower()) ; ¦b 6250 don't care
- // return(ErrCode);
+ // return ErrCode;
//if (Check_D_MediaFmt(fdoExt)) ;
- // return(ErrCode);
+ // return ErrCode;
if (Conv_D_MediaAddr(us, start))
- return(ErrCode);
+ return ErrCode;
while(1)
{
if (Media_D_ReadOneSect(us, bn, buf))
{
ErrCode = ERR_EccReadErr;
- return(ErrCode);
+ return ErrCode;
}
Media.Sector += bn;
buf += bn * SECTSIZE;
if (Inc_D_MediaAddr(us))
- return(ErrCode);
+ return ErrCode;
}
- return(NO_ERROR);
+ return NO_ERROR;
}
// here
//----- Media_D_CopySector() ------------------------------------------
/* pr_info("Media_D_CopySector !!!\n"); */
if (Conv_D_MediaAddr(us, start))
- return(ErrCode);
+ return ErrCode;
while(1)
{
if (Assign_D_WriteBlock())
- return(ERROR);
+ return ERROR;
len = Ssfdc.MaxSectors - Media.Sector;
if (count > len)
if (Ssfdc_D_CopyBlock(us,bn,buf,Redundant))
{
ErrCode = ERR_WriteFault;
- return(ErrCode);
+ return ErrCode;
}
Media.Sector = 0x1F;
if (ErrCode==ERR_HwError)
{
ErrCode = ERR_WriteFault;
- return(ErrCode);
+ return ErrCode;
}
}
count -= bn;
buf += bn * SECTSIZE;
if (Inc_D_MediaAddr(us))
- return(ErrCode);
+ return ErrCode;
}
- return(NO_ERROR);
+ return NO_ERROR;
}
//----- Release_D_CopySector() ------------------------------------------
if (Media.PhyBlock==NO_ASSIGN)
{
Media.PhyBlock=WriteBlock;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
Clr_D_Bit(Assign[Media.Zone],Media.PhyBlock);
Media.PhyBlock=WriteBlock;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
/*
//----- Media_D_WriteSector() ------------------------------------------
ADDRESS_T bb = (ADDRESS_T) &Media;
//if (Check_D_MediaPower())
- // return(ErrCode);
+ // return ErrCode;
//
//if (Check_D_MediaFmt(fdoExt))
- // return(ErrCode);
+ // return ErrCode;
//
//if (Check_D_MediaWP())
- // return(ErrCode);
+ // return ErrCode;
if (Conv_D_MediaAddr(fdoExt, start))
- return(ErrCode);
+ return ErrCode;
//ENE_Print("Media_D_WriteSector --- Sector = %x\n", Media.Sector);
if (Check_D_FirstSect())
if (Media_D_CopyBlockHead(fdoExt))
{
ErrCode = ERR_WriteFault;
- return(ErrCode);
+ return ErrCode;
}
}
if (!Check_D_FirstSect())
{
if (Assign_D_WriteBlock())
- return(ErrCode);
+ return ErrCode;
}
len = Ssfdc.MaxSectors - Media.Sector;
if (Media_D_WriteOneSect(fdoExt, bn, buf))
{
ErrCode = ERR_WriteFault;
- return(ErrCode);
+ return ErrCode;
}
Media.Sector += bn - 1;
{ if (ErrCode==ERR_HwError)
{
ErrCode = ERR_WriteFault;
- return(ErrCode);
+ return ErrCode;
}
}
}
// break;
if (Inc_D_MediaAddr(fdoExt))
- return(ErrCode);
+ return ErrCode;
}
if (!Check_D_LastSect())
- return(NO_ERROR);
+ return NO_ERROR;
if (Inc_D_MediaAddr(fdoExt))
- return(ErrCode);
+ return ErrCode;
if (Media_D_CopyBlockTail(fdoExt))
{
ErrCode = ERR_WriteFault;
- return(ErrCode);
+ return ErrCode;
}
- return(NO_ERROR);
+ return NO_ERROR;
}
//
////----- Media_D_EraseBlock() -------------------------------------------
//int Media_D_EraseBlock(PFDO_DEVICE_EXTENSION fdoExt, DWORD start,WORD count)
//{
// if (Check_D_MediaPower())
-// return(ErrCode);
+// return ErrCode;
//
// if (Check_D_MediaFmt(fdoExt))
-// return(ErrCode);
+// return ErrCode;
//
// if (Check_D_MediaWP())
-// return(ErrCode);
+// return ErrCode;
//
// if (Conv_D_MediaAddr(start))
-// return(ErrCode);
+// return ErrCode;
//
// while(Check_D_FirstSect()) {
// if (Inc_D_MediaAddr(fdoExt))
-// return(ErrCode);
+// return ErrCode;
//
// if (--count<=0)
-// return(NO_ERROR);
+// return NO_ERROR;
// }
//
// while(1) {
// if (ErrCode==ERR_HwError)
// {
// ErrCode = ERR_WriteFault;
-// return(ErrCode);
+// return ErrCode;
// }
//
// if (Inc_D_MediaAddr(fdoExt))
-// return(ErrCode);
+// return ErrCode;
//
// if (--count<=0)
-// return(NO_ERROR);
+// return NO_ERROR;
// }
//}
//
//int Media_D_EraseAll(PFDO_DEVICE_EXTENSION fdoExt)
//{
// if (Check_D_MediaPower())
-// return(ErrCode);
+// return ErrCode;
//
// if (Check_D_MediaFmtForEraseAll(fdoExt))
-// return(ErrCode);
+// return ErrCode;
//
// if (Check_D_MediaWP())
-// return(ErrCode);
+// return ErrCode;
//
// if (Media_D_EraseAllBlock())
-// return(ErrCode);
+// return ErrCode;
//
-// return(NO_ERROR);
+// return NO_ERROR;
//}
//SmartMedia Write Function for One Sector Write Mode
// ADDRESS_T bb = (ADDRESS_T) &Media;
//
// //if (Check_D_MediaPower())
-// // return(ErrCode);
+// // return ErrCode;
// //if (Check_D_MediaFmt(fdoExt))
-// // return(ErrCode);
+// // return ErrCode;
// //if (Check_D_MediaWP())
-// // return(ErrCode);
+// // return ErrCode;
// if (Conv_D_MediaAddr(fdoExt, start))
-// return(ErrCode);
+// return ErrCode;
//
// if (Check_D_FirstSect())
// if (Media_D_CopyBlockHead(fdoExt))
// {
// ErrCode = ERR_WriteFault;
-// return(ErrCode);
+// return ErrCode;
// }
//
// if (!Check_D_FirstSect())
// if (Assign_D_WriteBlock())
-// return(ErrCode);
+// return ErrCode;
//
// //for(i=0;i<SECTSIZE;i++)
// // SectBuf[i]=*buf++;
// if (Media_D_WriteOneSect(fdoExt, buf))
// {
// ErrCode = ERR_WriteFault;
-// return(ErrCode);
+// return ErrCode;
// }
//
// if (!Check_D_LastSect())
// if (ErrCode==ERR_HwError)
// {
// ErrCode = ERR_WriteFault;
-// return(ErrCode);
+// return ErrCode;
// }
// }
- return(NO_ERROR);
+ return NO_ERROR;
}
//----- Media_D_OneSectWriteNext() -------------------------------------
// ADDRESS_T bb = (ADDRESS_T) &Media;
//
// if (Inc_D_MediaAddr(fdoExt))
-// return(ErrCode);
+// return ErrCode;
//
// if (!Check_D_FirstSect())
// if (Assign_D_WriteBlock())
-// return(ErrCode);
+// return ErrCode;
//
// //for(i=0;i<SECTSIZE;i++)
// // SectBuf[i]=*buf++;
// if (Media_D_WriteOneSect(fdoExt, buf))
// {
// ErrCode = ERR_WriteFault;
-// return(ErrCode);
+// return ErrCode;
// }
//
// if (!Check_D_LastSect())
// if (ErrCode==ERR_HwError)
// {
// ErrCode = ERR_WriteFault;
-// return(ErrCode);
+// return ErrCode;
// }
// }
- return(NO_ERROR);
+ return NO_ERROR;
}
//----- Media_D_OneSectWriteFlush() ------------------------------------
int Media_D_OneSectWriteFlush(PFDO_DEVICE_EXTENSION fdoExt)
{
if (!Check_D_LastSect())
- return(NO_ERROR);
+ return NO_ERROR;
if (Inc_D_MediaAddr(fdoExt))
- return(ErrCode);
+ return ErrCode;
if (Media_D_CopyBlockTail(fdoExt))
{
ErrCode = ERR_WriteFault;
- return(ErrCode);
+ return ErrCode;
}
- return(NO_ERROR);
+ return NO_ERROR;
}
//
////LED Tern On/Off Subroutine
// case SSFDC32MB: *c=500; *h= 8; *s=16; break;
// case SSFDC64MB: *c=500; *h= 8; *s=32; break;
// case SSFDC128MB: *c=500; *h=16; *s=32; break;
-// 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(SMSUCCESS);
+// return SMSUCCESS;
//}
//
////Power Control & Media Exist Check Subroutine
// MediaChange = ERROR;
// //usleep(56*1024);
// if ((!Check_D_CntPower())&&(!MediaChange)) // ¦³ power & Media ¨S³Q change, «h return success
-// return(SMSUCCESS);
+// return SMSUCCESS;
// //usleep(56*1024);
//
// if (Check_D_CardExist()) // Check if card is not exist, return err
// {
// ErrCode = ERR_NoSmartMedia;
// MediaChange = ERROR;
-// return(ERROR);
+// return ERROR;
// }
// //usleep(56*1024);
// if (Cnt_D_PowerOn())
// {
// ErrCode = ERR_NoSmartMedia;
// MediaChange = ERROR;
-// return(ERROR);
+// return ERROR;
// }
// //usleep(56*1024);
// Ssfdc_D_Reset(fdoExt);
// //usleep(56*1024);
-// return(SMSUCCESS);
+// return SMSUCCESS;
//}
//
////-----Check_D_MediaExist() --------------------------------------------
// if (!Check_D_CardExist())
// {
// if (!MediaChange)
-// return(SMSUCCESS);
+// return SMSUCCESS;
//
// ErrCode = ERR_ChangedMedia;
-// return(ERROR);
+// return ERROR;
// }
//
// ErrCode = ERR_NoSmartMedia;
//
-// return(ERROR);
+// return ERROR;
//}
//
////----- Check_D_MediaWP() ----------------------------------------------
// if (Ssfdc.Attribute &MWP)
// {
// ErrCode = ERR_WrtProtect;
-// return(ERROR);
+// return ERROR;
// }
//
-// return(SMSUCCESS);
+// return SMSUCCESS;
//}
*/
//SmartMedia Physical Format Test Subroutine
//usleep(56*1024);
if (!MediaChange)
- return(SMSUCCESS);
+ return SMSUCCESS;
MediaChange = ERROR;
SectCopyMode = COMPLETED;
if (Set_D_PhyFmtValue(us))
{
ErrCode = ERR_UnknownMedia;
- return(ERROR);
+ return ERROR;
}
//usleep(56*1024);
if (Search_D_CIS(us))
{
ErrCode = ERR_IllegalFmt;
- return(ERROR);
+ return ERROR;
}
MediaChange = SMSUCCESS;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
/*
////----- Check_D_BlockIsFull() ----------------------------------
// if (Set_D_PhyFmtValue(fdoExt))
// {
// ErrCode = ERR_UnknownMedia;
-// return(ERROR);
+// return ERROR;
// }
//
// if (Search_D_CIS(fdoExt))
// {
// ErrCode = ERR_IllegalFmt;
-// return(ERROR);
+// return ERROR;
// }
//
-// return(SMSUCCESS);
+// return SMSUCCESS;
//}
*/
//SmartMedia Physical Address Control Subroutine
if (Make_D_LogTable(us))
{
ErrCode = ERR_IllegalFmt;
- return(ERROR);
+ return ERROR;
}
}
Clr_D_RedundantData(Redundant);
Set_D_LogBlockAddr(Redundant);
Media.PhyBlock = Log2Phy[Media.Zone][Media.LogBlock];
- return(SMSUCCESS);
+ return SMSUCCESS;
}
ErrCode = ERR_OutOfLBA;
- return(ERROR);
+ return ERROR;
}
//----- Inc_D_MediaAddr() ----------------------------------------------
//ADDRESS_T bb = (ADDRESS_T) &Media;
if (++Media.Sector<Ssfdc.MaxSectors)
- return(SMSUCCESS);
+ return SMSUCCESS;
if (Log2Phy[Media.Zone]==NULL)
{
if (Make_D_LogTable(us))
{
ErrCode = ERR_IllegalFmt;
- return(ERROR);
+ return ERROR;
}
}
Clr_D_RedundantData(Redundant);
Set_D_LogBlockAddr(Redundant);
Media.PhyBlock=Log2Phy[Media.Zone][Media.LogBlock];
- return(SMSUCCESS);
+ return SMSUCCESS;
}
Media.LogBlock=0;
if (Make_D_LogTable(us))
{
ErrCode = ERR_IllegalFmt;
- return(ERROR);
+ return ERROR;
}
}
Clr_D_RedundantData(Redundant);
Set_D_LogBlockAddr(Redundant);
Media.PhyBlock=Log2Phy[Media.Zone][Media.LogBlock];
- return(SMSUCCESS);
+ return SMSUCCESS;
}
Media.Zone=0;
ErrCode = ERR_OutOfLBA;
- return(ERROR);
+ return ERROR;
}
/*
//----- Check_D_FirstSect() --------------------------------------------
ADDRESS_T bb = (ADDRESS_T) &Media;
if (!Media.Sector)
- return(SMSUCCESS);
+ return SMSUCCESS;
- return(ERROR);
+ return ERROR;
}
//----- Check_D_LastSect() ---------------------------------------------
ADDRESS_T bb = (ADDRESS_T) &Media;
if (Media.Sector<(Ssfdc.MaxSectors-1))
- return(ERROR);
+ return ERROR;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
*/
//SmartMedia Read/Write Subroutine with Retry
DWORD err, retry;
if (!Read_D_PhyOneSect(us, count, buf))
- return(SMSUCCESS);
+ return SMSUCCESS;
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
if (ErrCode==ERR_DataStatus)
- return(ERROR);
+ return ERROR;
#ifdef RDERR_REASSIGN
if (Ssfdc.Attribute &MWP)
{
if (ErrCode==ERR_CorReadErr)
- return(SMSUCCESS);
- return(ERROR);
+ return SMSUCCESS;
+ return ERROR;
}
err=ErrCode;
if (Copy_D_BlockAll(us, (err==ERR_EccReadErr)?REQ_FAIL:REQ_ERASE))
{
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
continue;
}
ErrCode = err;
if (ErrCode==ERR_CorReadErr)
- return(SMSUCCESS);
- return(ERROR);
+ return SMSUCCESS;
+ return ERROR;
}
MediaChange = ERROR;
#else
- if (ErrCode==ERR_CorReadErr) return(SMSUCCESS);
+ if (ErrCode==ERR_CorReadErr) return SMSUCCESS;
#endif
- return(ERROR);
+ return ERROR;
}
/*
//----- Media_D_WriteOneSect() -----------------------------------------
ADDRESS_T bb = (ADDRESS_T) &Media;
if (!Write_D_PhyOneSect(fdoExt, count, buf))
- return(SMSUCCESS);
+ return SMSUCCESS;
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
for(retry=1; retry<2; retry++)
{
if (Reassign_D_BlockHead(fdoExt))
{
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
continue;
}
if (!Write_D_PhyOneSect(fdoExt, count, buf))
- return(SMSUCCESS);
+ return SMSUCCESS;
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
}
if (Release_D_WriteBlock(fdoExt))
- return(ERROR);
+ return ERROR;
ErrCode = ERR_WriteFault;
MediaChange = ERROR;
- return(ERROR);
+ return ERROR;
}
//SmartMedia Data Copy Subroutine with Retry
for(retry=0; retry<2; retry++)
{
if (!Copy_D_BlockHead(fdoExt))
- return(SMSUCCESS);
+ return SMSUCCESS;
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
}
MediaChange = ERROR;
- return(ERROR);
+ return ERROR;
}
//----- Media_D_CopyBlockTail() ----------------------------------------
DWORD retry;
if (!Copy_D_BlockTail(fdoExt))
- return(SMSUCCESS);
+ return SMSUCCESS;
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
for(retry=1; retry<2; retry++)
{
if (Reassign_D_BlockHead(fdoExt))
{
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
continue;
}
if (!Copy_D_BlockTail(fdoExt))
- return(SMSUCCESS);
+ return SMSUCCESS;
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
}
if (Release_D_WriteBlock(fdoExt))
- return(ERROR);
+ return ERROR;
ErrCode = ERR_WriteFault;
MediaChange = ERROR;
- return(ERROR);
+ return ERROR;
}
//
////----- Media_D_EraseOneBlock() ----------------------------------------
// ADDRESS_T bb = (ADDRESS_T) &Media;
//
// if (Media.PhyBlock==NO_ASSIGN)
-// return(SMSUCCESS);
+// return SMSUCCESS;
//
// if (Log2Phy[Media.Zone]==NULL)
// {
// if (Make_D_LogTable())
// {
// ErrCode = ERR_IllegalFmt;
-// return(ERROR);
+// return ERROR;
// }
// }
// Media.LogBlock = LogBlock;
// if (Erase_D_PhyOneBlock(fdoExt))
// {
// if (ErrCode==ERR_HwError)
-// return(ERROR);
+// return ERROR;
// if (MarkFail_D_PhyOneBlock())
-// return(ERROR);
+// return ERROR;
//
// ErrCode = ERR_WriteFault;
-// return(ERROR);
+// return ERROR;
// }
//
// Clr_D_Bit(Assign[Media.Zone],Media.PhyBlock);
// Media.PhyBlock=NO_ASSIGN;
-// return(SMSUCCESS);
+// return SMSUCCESS;
//}
//
////SmartMedia Erase Subroutine
// if (Ssfdc_D_ReadRedtData(Redundant))
// {
// Ssfdc_D_Reset(fdoExt);
-// return(ERROR);
+// return ERROR;
// }
//
// Ssfdc_D_Reset(fdoExt);
// if (Ssfdc_D_EraseBlock(fdoExt))
// {
// ErrCode = ERR_HwError;
-// return(ERROR);
+// return ERROR;
// }
//
// if (Ssfdc_D_CheckStatus())
// {
// if (MarkFail_D_PhyOneBlock())
-// return(ERROR);
+// return ERROR;
// }
//
// continue;
// if (Media.PhyBlock!=CisArea.PhyBlock)
// {
// ErrCode = ERR_IllegalFmt;
-// return(ERROR);
+// return ERROR;
// }
//
// cis++;
// }
//
// }
-// return(SMSUCCESS);
+// return SMSUCCESS;
//}
*/
//SmartMedia Physical Sector Data Copy Subroutine
sect=Media.Sector;
if (Assign_D_WriteBlock())
- return(ERROR);
+ return ERROR;
if (mode==REQ_FAIL)
SectCopyMode=REQ_FAIL;
if (Copy_D_PhyOneSect(us))
{
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
if (Release_D_WriteBlock(us))
- return(ERROR);
+ return ERROR;
ErrCode = ERR_WriteFault;
Media.PhyBlock=ReadBlock;
Media.Sector=sect;
- return(ERROR);
+ return ERROR;
}
}
if (Release_D_ReadBlock(us))
- return(ERROR);
+ return ERROR;
Media.PhyBlock=WriteBlock;
Media.Sector=sect;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
/*
//----- Copy_D_BlockHead() ---------------------------------------------
sect=Media.Sector;
if (Assign_D_WriteBlock())
- return(ERROR);
+ return ERROR;
for(Media.Sector=0; Media.Sector<sect; Media.Sector++)
{
if (Copy_D_PhyOneSect(fdoExt))
{
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
if (Release_D_WriteBlock(fdoExt))
- return(ERROR);
+ return ERROR;
ErrCode = ERR_WriteFault;
Media.PhyBlock=ReadBlock;
Media.Sector=sect;
- return(ERROR);
+ return ERROR;
}
}
Media.PhyBlock=WriteBlock;
Media.Sector=sect;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
//----- Copy_D_BlockTail() ---------------------------------------------
if (Copy_D_PhyOneSect(fdoExt))
{
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
Media.PhyBlock=WriteBlock;
Media.Sector=sect;
- return(ERROR);
+ return ERROR;
}
}
if (Release_D_ReadBlock(fdoExt))
- return(ERROR);
+ return ERROR;
Media.PhyBlock=WriteBlock;
Media.Sector=sect;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
//----- Reassign_D_BlockHead() -----------------------------------------
sect=Media.Sector;
if (Assign_D_WriteBlock())
- return(ERROR);
+ return ERROR;
SectCopyMode=REQ_FAIL;
if (Copy_D_PhyOneSect(fdoExt))
{
if (ErrCode==ERR_HwError)
- return(ERROR);
+ return ERROR;
if (Release_D_WriteBlock(fdoExt))
- return(ERROR);
+ return ERROR;
ErrCode = ERR_WriteFault;
SectCopyMode=mode;
Media.Sector=sect;
Media.PhyBlock=WriteBlock;
- return(ERROR);
+ return ERROR;
}
}
if (Release_D_ReadBlock(fdoExt))
- return(ERROR);
+ return ERROR;
SectCopyMode=mode;
ReadBlock=block;
Media.Sector=sect;
Media.PhyBlock=WriteBlock;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
*/
//SmartMedia Physical Block Assign/Release Subroutine
Media.PhyBlock=WriteBlock;
SectCopyMode=REQ_ERASE;
//ErrXDCode = NO_ERROR;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
}
Media.PhyBlock=WriteBlock;
SectCopyMode=REQ_ERASE;
//ErrXDCode = NO_ERROR;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
}
// For xD test
//Ssfdc.Attribute |= WP;
//ErrXDCode = ERR_WrtProtect;
- return(ERROR);
+ return ERROR;
}
//----- Release_D_ReadBlock() ------------------------------------------
SectCopyMode=COMPLETED;
if (mode==COMPLETED)
- return(SMSUCCESS);
+ return SMSUCCESS;
Log2Phy[Media.Zone][Media.LogBlock]=WriteBlock;
Media.PhyBlock=ReadBlock;
if (Media.PhyBlock==NO_ASSIGN)
{
Media.PhyBlock=WriteBlock;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
if (mode==REQ_ERASE)
{
if (Erase_D_PhyOneBlock(us))
{
- if (ErrCode==ERR_HwError) return(ERROR);
- if (MarkFail_D_PhyOneBlock(us)) return(ERROR);
+ if (ErrCode==ERR_HwError) return ERROR;
+ if (MarkFail_D_PhyOneBlock(us)) return ERROR;
}
else
Clr_D_Bit(Assign[Media.Zone],Media.PhyBlock);
}
else if (MarkFail_D_PhyOneBlock(us))
- return(ERROR);
+ return ERROR;
Media.PhyBlock=WriteBlock;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
//----- Release_D_WriteBlock() -----------------------------------------
Media.PhyBlock=WriteBlock;
if (MarkFail_D_PhyOneBlock(us))
- return(ERROR);
+ return ERROR;
Media.PhyBlock=ReadBlock;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
//SmartMedia Physical Sector Data Copy Subroutine
{
Ssfdc_D_Reset(us);
if (Ssfdc_D_ReadCisSect(us,WorkBuf,WorkRedund))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
if (Check_D_CISdata(WorkBuf,WorkRedund))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
}
if (Ssfdc_D_ReadSect(us,WorkBuf,WorkRedund))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
if (Check_D_DataStatus(WorkRedund))
{ err=ERROR; break; }
if (!Check_D_ReadError(WorkRedund))
Media.PhyBlock=WriteBlock;
if (Ssfdc_D_WriteSectForCopy(us, WorkBuf, WorkRedund))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
if (Ssfdc_D_CheckStatus())
- { ErrCode = ERR_WriteFault; return(ERROR); }
+ { ErrCode = ERR_WriteFault; return ERROR; }
Media.PhyBlock=ReadBlock;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
//SmartMedia Physical Sector Read/Write/Erase Subroutine
{
for(i=0; i<SECTSIZE; i++)
*buf++=DUMMY_DATA;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
for(retry=0; retry<2; retry++)
Ssfdc_D_Reset(us);
if (Ssfdc_D_ReadCisSect(us,WorkBuf,WorkRedund))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
if (Check_D_CISdata(WorkBuf,WorkRedund))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
}
//if (Ssfdc_D_ReadSect(fdoExt,buf,Redundant))
if (Ssfdc_D_ReadBlock(us,count,buf,Redundant))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
if (Check_D_DataStatus(Redundant))
- { ErrCode = ERR_DataStatus; return(ERROR); }
+ { ErrCode = ERR_DataStatus; return ERROR; }
if (!Check_D_ReadError(Redundant))
- return(SMSUCCESS);
+ return SMSUCCESS;
if (!Check_D_Correct(buf,Redundant))
- { ErrCode = ERR_CorReadErr; return(ERROR); }
+ { ErrCode = ERR_CorReadErr; return ERROR; }
}
ErrCode = ERR_EccReadErr;
- return(ERROR);
+ return ERROR;
}
/*
//----- Write_D_PhyOneSect() -------------------------------------------
//if (Ssfdc_D_WriteSect(fdoExt,buf,Redundant))
if (Ssfdc_D_WriteBlock(fdoExt,count,buf,Redundant))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
if (Ssfdc_D_CheckStatus())
- { ErrCode = ERR_WriteFault; return(ERROR); }
+ { ErrCode = ERR_WriteFault; return ERROR; }
- return(SMSUCCESS);
+ return SMSUCCESS;
}
*/
//----- Erase_D_PhyOneBlock() ------------------------------------------
//ADDRESS_T bb = (ADDRESS_T) &Media;
if (Ssfdc_D_EraseBlock(us))
- { ErrCode = ERR_HwError; MediaChange=ERROR; return(ERROR); }
+ { ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; }
if (Ssfdc_D_CheckStatus())
- { ErrCode = ERR_WriteFault; return(ERROR); }
+ { ErrCode = ERR_WriteFault; return ERROR; }
- return(SMSUCCESS);
+ return SMSUCCESS;
}
//SmartMedia Physical Format Check Local Subroutine
// BYTE idcode[4];
// DWORD UserDefData_1, UserDefData_2, Data, mask;
//
-// //if (!fdoExt->ChildDeviceObject) return(ERROR);
+// //if (!fdoExt->ChildDeviceObject) return ERROR;
// //pdoExt = fdoExt->ChildDeviceObject->DeviceExtension;
//
// Ssfdc_D_ReadID(idcode, READ_ID_1);
//
//if (Set_D_SsfdcModel(idcode[1]))
if (Set_D_SsfdcModel(us->SM_DeviceID))
- return(ERROR);
+ return ERROR;
// //Use Multi-function pin to differentiate SM and xD.
// UserDefData_1 = ReadPCIReg(fdoExt->BusID, fdoExt->DevID, fdoExt->FuncID, PCI_REG_USER_DEF) & 0x80;
// {
// Ssfdc_D_ReadID(idcode, READ_ID_3);
// if (idcode[2] != 0xB5)
-// return(ERROR);
+// return ERROR;
// }
// }
//
// {
// Ssfdc_D_ReadID(idcode, READ_ID_3);
// if (idcode[2] != 0xB5)
-// return(ERROR);
+// return ERROR;
// }
// }
//
// if (!IsXDCompliance)
// fdoExt->DiskType = DISKTYPE_SM;
// else
-// return(ERROR);
+// return ERROR;
// }
//
// if (fdoExt->UserDef_DiskType == 0x04) fdoExt->DiskType = DISKTYPE_XD;
// }
// }
- return(SMSUCCESS);
+ return SMSUCCESS;
}
//----- Search_D_CIS() -------------------------------------------------
if (Ssfdc_D_ReadRedtData(us, Redundant))
{
Ssfdc_D_Reset(us);
- return(ERROR);
+ return ERROR;
}
if (!Check_D_FailBlock(Redundant))
if (Media.PhyBlock==(Ssfdc.MaxBlocks-Ssfdc.MaxLogBlocks-1))
{
Ssfdc_D_Reset(us);
- return(ERROR);
+ return ERROR;
}
while (Media.Sector<CIS_SEARCH_SECT)
if (Ssfdc_D_ReadRedtData(us, Redundant))
{
Ssfdc_D_Reset(us);
- return(ERROR);
+ return ERROR;
}
}
if (!Check_D_DataStatus(Redundant))
if (Ssfdc_D_ReadSect(us,WorkBuf,Redundant))
{
Ssfdc_D_Reset(us);
- return(ERROR);
+ return ERROR;
}
if (Check_D_CISdata(WorkBuf,Redundant))
{
Ssfdc_D_Reset(us);
- return(ERROR);
+ return ERROR;
}
CisArea.PhyBlock=Media.PhyBlock;
CisArea.Sector=Media.Sector;
Ssfdc_D_Reset(us);
- return(SMSUCCESS);
+ return SMSUCCESS;
}
Media.Sector++;
}
Ssfdc_D_Reset(us);
- return(ERROR);
+ return ERROR;
}
//----- Make_D_LogTable() ----------------------------------------------
/* pr_info("ExAllocatePool Zone = %x, Addr = %x\n",
Media.Zone, Log2Phy[Media.Zone]); */
if (Log2Phy[Media.Zone]==NULL)
- return(ERROR);
+ return ERROR;
}
Media.Sector=0;
}
if (Ssfdc_D_ReadRedtData(us, Redundant))
- { Ssfdc_D_Reset(us); return(ERROR); }
+ { Ssfdc_D_Reset(us); return ERROR; }
if (!Check_D_DataBlank(Redundant))
continue;
Media.Sector = (BYTE)(Ssfdc.MaxSectors-1);
if (Ssfdc_D_ReadRedtData(us, Redundant))
- { Ssfdc_D_Reset(us); return(ERROR); }
+ { Ssfdc_D_Reset(us); return ERROR; }
if (!Load_D_LogBlockAddr(Redundant))
{
Media.PhyBlock=Log2Phy[Media.Zone][logblock];
if (Ssfdc_D_ReadRedtData(us, Redundant))
- { Ssfdc_D_Reset(us); return(ERROR); }
+ { Ssfdc_D_Reset(us); return ERROR; }
Media.PhyBlock=phyblock;
// {
// Ssfdc_D_Reset(fdoExt);
// if (Ssfdc_D_EraseBlock(fdoExt))
-// return(ERROR);
+// return ERROR;
//
// if (Ssfdc_D_CheckStatus())
// {
// if (MarkFail_D_PhyOneBlock())
-// return(ERROR);
+// return ERROR;
// }
// else
// Clr_D_Bit(Assign[Media.Zone],Media.PhyBlock);
} // End for (Media.Zone<MAX_ZONENUM)
Ssfdc_D_Reset(us);
- return(SMSUCCESS);
+ return SMSUCCESS;
}
//----- MarkFail_D_PhyOneBlock() ---------------------------------------
Media.Sector = sect;
ErrCode = ERR_HwError;
MediaChange = ERROR;
- return(ERROR);
+ return ERROR;
} // NO Status Check
}
Ssfdc_D_Reset(us);
Media.Sector=sect;
- return(SMSUCCESS);
+ return SMSUCCESS;
}
/*
//
// BYTE i;
//
// if (Check_D_MediaPower())
-// return(ErrCode);
+// return ErrCode;
//
// if (Check_D_MediaWP())
-// return(ErrCode);
+// return ErrCode;
//
// for (i=0; i<REDTSIZE; i++)
// WorkRedund[i] = 0xFF;
// if (Ssfdc_D_EraseBlock(fdoExt))
// {
// ErrCode = ERR_HwError;
-// return(ERROR);
+// return ERROR;
// }
//
// for(Media.Sector=0; Media.Sector<Ssfdc.MaxSectors; Media.Sector++)
// Ssfdc_D_Reset(fdoExt);
// ErrCode = ERR_HwError;
// MediaChange = ERROR;
-// return(ERROR);
+// return ERROR;
// } // NO Status Check
// }
//
//
// Ssfdc_D_Reset(fdoExt);
//
-// return(SMSUCCESS);
+// return SMSUCCESS;
//}
//
////----- Media_D_GetMediaInfo() ---------------------------------------