kernel/eka/include/d32usbcsc.h
branchRCL_3
changeset 44 3e88ff8f41d5
parent 43 c1f20ce4abcf
equal deleted inserted replaced
43:c1f20ce4abcf 44:3e88ff8f41d5
     1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   381 		EControlRemoveStringDescriptor,
   381 		EControlRemoveStringDescriptor,
   382         EControlSetOtgDescriptor,
   382         EControlSetOtgDescriptor,
   383         EControlGetOtgDescriptor,
   383         EControlGetOtgDescriptor,
   384         EControlGetOtgFeatures, 
   384         EControlGetOtgFeatures, 
   385 		EControlRealizeInterface,
   385 		EControlRealizeInterface,
   386 		EControlStartNextInAlternateSetting
   386 		EControlStartNextInAlternateSetting	
   387 		};
   387 		};
   388 
   388 
   389 
   389 
   390  // const static TUint KFieldIdPos     = 0;
   390  // const static TUint KFieldIdPos     = 0;
   391 	const static TUint KFieldIdMask    = 0xFF;
   391 	const static TUint KFieldIdMask    = 0xFF;
   397 
   397 
   398 public:
   398 public:
   399 
   399 
   400 #ifndef __KERNEL_MODE__
   400 #ifndef __KERNEL_MODE__
   401 
   401 
   402 
       
   403 	/** Opens a channel.
   402 	/** Opens a channel.
   404 
   403 
   405 		@param aUnit This should be 0 (zero).
   404 		@param aUnit This should be 0 (zero).
   406 		@param aShare if this channel can be used in another process.
   405 
   407 
   406 		@return KErrNone if successful.
   408 		@return KErrNone if successful.
   407 	*/
   409 	*/
   408 	inline TInt Open(TInt aUnit);
   410 	inline TInt Open(TInt aUnit, TBool aShare=ETrue);
       
   411 
       
   412 	/** Opens a channel which has created.
       
   413 
       
   414 		@param aMsg client-server message contain the handle of this channel.
       
   415 		@param aPos index of message slot that contain handle.
       
   416 		@param aType ownership type of the handle.
       
   417 
       
   418 		@return KErrNone if successful.
       
   419 	*/
       
   420 
       
   421 	inline TInt Open(RMessagePtr2 aMsg, TInt aIndex, TOwnerType aType=EOwnerProcess);
       
   422 
   409 
   423 	inline TVersion VersionRequired() const;
   410 	inline TVersion VersionRequired() const;
   424 
   411 
   425 	/** Stalls ep0 to signal command fault to the host.
   412 	/** Stalls ep0 to signal command fault to the host.
   426 
   413 
  1306 
  1293 
  1307 	@param	aChunk	aChunk will point to RChunk currently in use by BIL
  1294 	@param	aChunk	aChunk will point to RChunk currently in use by BIL
  1308 	@return KErrNone on success otherwise a system wide error code, if an error has occurred.
  1295 	@return KErrNone on success otherwise a system wide error code, if an error has occurred.
  1309 	*/
  1296 	*/
  1310 	IMPORT_C TInt GetDataTransferChunk(RChunk*& aChunk);
  1297 	IMPORT_C TInt GetDataTransferChunk(RChunk*& aChunk);
  1311 	/**
       
  1312 	Call this function to reset alternate setting related data to initial state,
       
  1313 	this API should be called when device state goes to undefined.
       
  1314 	*/
       
  1315 	IMPORT_C void ResetAltSetting();
       
  1316 
       
  1317 	
       
  1318 
  1298 
  1319 private:
  1299 private:
  1320  	/** @internalTechnology */
       
  1321 	TInt Empty(TUint aBufferOffset);
       
  1322 	/** @internalTechnology */
  1300 	/** @internalTechnology */
  1323 	TInt Drain(TUint aBuffer);
  1301 	TInt Drain(TUint aBuffer);
  1324 	/** @internalTechnology */ 
  1302 	/** @internalTechnology */ 
  1325 	TInt Peek(TUint aBuffer);
  1303 	TInt Peek(TUint aBuffer);
  1326 	/** @internalTechnology */ 
  1304 	/** @internalTechnology */ 
  1507 
  1485 
  1508 	@returns the endpoint number opened by this object.
  1486 	@returns the endpoint number opened by this object.
  1509 	*/
  1487 	*/
  1510 	inline TInt GetEndpointNumber();
  1488 	inline TInt GetEndpointNumber();
  1511 
  1489 
  1512 	inline TInt BufferNumber();
       
  1513 
       
  1514 private:
  1490 private:
  1515 	/** @internalTechnology */
  1491 	/** @internalTechnology */
  1516 	void Construct(RDevUsbcScClient* aClient, TUint8* aBaseAddr, const TUsbcScHdrEndpointRecord* aEpType,
  1492 	void Construct(RDevUsbcScClient* aClient, TUint8* aBaseAddr, const TUsbcScHdrEndpointRecord* aEpType,
  1517 		 				TInt aEndpointNumber, SUsbcScBufferHeader* aEndpointHdr=NULL);
  1493 		 				TInt aEndpointNumber, SUsbcScBufferHeader* aEndpointHdr=NULL);
  1518 
  1494