usbmgmt/usbmgr/host/functiondrivers/ms/msmm/server/src/msmmengine.cpp
changeset 49 93c0009bd947
parent 29 59aa7d6e3e0f
equal deleted inserted replaced
48:21625e5de155 49:93c0009bd947
    99         }
    99         }
   100     OstTraceFunctionExit0( CMSMMENGINE_ADDUSBMSINTERFACEL_EXIT );
   100     OstTraceFunctionExit0( CMSMMENGINE_ADDUSBMSINTERFACEL_EXIT );
   101     return interface;
   101     return interface;
   102     }
   102     }
   103 
   103 
   104 void CMsmmEngine::AddUsbMsLogicalUnitL(TInt aDeviceId,
   104 TUsbMsLogicalUnit* CMsmmEngine::AddUsbMsLogicalUnitL(TInt aDeviceId,
   105         TInt aInterfaceNumber, TInt aLogicalUnitNumber, TText aDrive)
   105         TInt aInterfaceNumber, TInt aLogicalUnitNumber, TText aDrive)
   106     {
   106     {
   107     OstTraceFunctionEntry0( CMSMMENGINE_ADDUSBMSLOGICALUNITL_ENTRY );
   107     OstTraceFunctionEntry0( CMSMMENGINE_ADDUSBMSLOGICALUNITL_ENTRY );
   108     
   108     
   109     TUsbMsDevice* device = SearchDevice(aDeviceId);
   109     TUsbMsDevice* device = SearchDevice(aDeviceId);
   111         {
   111         {
   112         User::Leave(KErrArgument); // A proper device node can't be found
   112         User::Leave(KErrArgument); // A proper device node can't be found
   113         }
   113         }
   114     
   114     
   115     TUsbMsInterface* interface = SearchInterface(device, aInterfaceNumber);
   115     TUsbMsInterface* interface = SearchInterface(device, aInterfaceNumber);
       
   116     TUsbMsLogicalUnit* logicalUnit = NULL;
   116     if (interface)
   117     if (interface)
   117         {
   118         {
   118         AddUsbMsLogicalUnitNodeL(interface, aLogicalUnitNumber, aDrive);
   119         logicalUnit = AddUsbMsLogicalUnitNodeL(interface, aLogicalUnitNumber, aDrive);
   119         }
   120         }
   120     else
   121     else
   121         {
   122         {
   122         User::Leave(KErrArgument); // A proper interface node can't be found
   123         User::Leave(KErrArgument); // A proper interface node can't be found
   123         }
   124         }
   124     OstTraceFunctionExit0( CMSMMENGINE_ADDUSBMSLOGICALUNITL_EXIT );
   125     OstTraceFunctionExit0( CMSMMENGINE_ADDUSBMSLOGICALUNITL_EXIT );
       
   126     return logicalUnit;
   125     }
   127     }
   126 
   128 
   127 void CMsmmEngine::RemoveUsbMsNode(TMsmmNodeBase* aNodeToBeRemoved)
   129 void CMsmmEngine::RemoveUsbMsNode(TMsmmNodeBase* aNodeToBeRemoved)
   128     {
   130     {
   129     OstTraceFunctionEntry0( CMSMMENGINE_REMOVEUSBMSNODE_ENTRY );
   131     OstTraceFunctionEntry0( CMSMMENGINE_REMOVEUSBMSNODE_ENTRY );