userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp
changeset 31 56f325a607ea
parent 0 a41df078684a
child 33 0173bcd7697c
equal deleted inserted replaced
15:4122176ea935 31:56f325a607ea
    68 void CScsiProtocol::ConstructL(TLun aLun)
    68 void CScsiProtocol::ConstructL(TLun aLun)
    69     {
    69     {
    70 	__MSFNLOG
    70 	__MSFNLOG
    71     iFsm = CMassStorageFsm::NewL(*this);
    71     iFsm = CMassStorageFsm::NewL(*this);
    72 	iState = EDisconnected;
    72 	iState = EDisconnected;
       
    73 
       
    74     const TInt blockLength = 0x200;
       
    75 
       
    76     iHeadbuf.CreateL(blockLength);
       
    77     iTailbuf.CreateL(blockLength);
    73     }
    78     }
    74 
    79 
    75 
    80 
    76 CScsiProtocol::CScsiProtocol(MTransport& aTransport)
    81 CScsiProtocol::CScsiProtocol(MTransport& aTransport)
    77 :   iSpcInterface(aTransport),
    82 :   iSpcInterface(aTransport),
    83 
    88 
    84 CScsiProtocol::~CScsiProtocol()
    89 CScsiProtocol::~CScsiProtocol()
    85     {
    90     {
    86 	__MSFNLOG
    91 	__MSFNLOG
    87     delete iFsm;
    92     delete iFsm;
       
    93     iHeadbuf.Close();
       
    94     iTailbuf.Close();
    88     delete iSbcInterface;
    95     delete iSbcInterface;
    89     }
    96     }
    90 
    97 
    91 
    98 
    92 void CScsiProtocol::InitialiseUnitL()
    99 void CScsiProtocol::InitialiseUnitL()
   349 
   356 
   350     iRemovableMedia = info.iRemovable;
   357     iRemovableMedia = info.iRemovable;
   351 
   358 
   352     // SCSI Block device
   359     // SCSI Block device
   353     iSbcInterface = new (ELeave) TSbcClientInterface(iSpcInterface.Transport());
   360     iSbcInterface = new (ELeave) TSbcClientInterface(iSpcInterface.Transport());
       
   361     iSbcInterface->InitBuffers(&iHeadbuf, &iTailbuf);
   354 
   362 
   355     return KErrNone;
   363     return KErrNone;
   356     }
   364     }
   357 
   365 
   358 
   366 
   651     {
   659     {
   652 	__MSFNLOG
   660 	__MSFNLOG
   653     // SCSI Block device
   661     // SCSI Block device
   654     ASSERT(iSbcInterface == NULL);
   662     ASSERT(iSbcInterface == NULL);
   655     iSbcInterface = new (ELeave) TSbcClientInterface(iSpcInterface.Transport());
   663     iSbcInterface = new (ELeave) TSbcClientInterface(iSpcInterface.Transport());
   656     iSbcInterface->SetCapacity(aBlockLen, aLastLba);
   664     iSbcInterface->InitBuffers(&iHeadbuf, &iTailbuf);
       
   665     iSbcInterface->SetCapacityL(aBlockLen, aLastLba);
   657     }
   666     }
   658 
   667 
   659 
   668 
   660 void CScsiProtocol::ResetSbc()
   669 void CScsiProtocol::ResetSbc()
   661     {
   670     {