os/kernelhwsrv/kerneltest/f32test/shostmassstorage/msman/inc/cusbhost.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/f32test/shostmassstorage/msman/inc/cusbhost.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,96 @@
     1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +#ifndef CUSBHOST
    1.21 +#define CUSBHOST
    1.22 +
    1.23 +class TUsbInterfaceDescriptor;
    1.24 +class TUsbDeviceDescriptor;
    1.25 +class RUsbInterface;
    1.26 +class THostMassStorageConfig;
    1.27 +
    1.28 +class CUsbMsMountManager;
    1.29 +class CUsbHostAo;
    1.30 +
    1.31 +class MDriveDisplay;
    1.32 +
    1.33 +class CUsbHost: public CBase, public MUsbHostBusEventObserver
    1.34 +    {
    1.35 +public:
    1.36 +	static CUsbHost* NewL();
    1.37 +	~CUsbHost();
    1.38 +protected:
    1.39 +    void ConstructL();
    1.40 +	CUsbHost();
    1.41 +
    1.42 +public:
    1.43 +    TInt DevicesNumber() const;
    1.44 +    void DriveMap(TDriveMap& aDriveMap) const;
    1.45 +    void DeviceMap(TInt aDeviceIndex, TDeviceMap& aDeviceMap) const;
    1.46 +
    1.47 +    void Start();
    1.48 +
    1.49 +protected:
    1.50 +    void ProcessBusEventL();
    1.51 +
    1.52 +private:
    1.53 +    void OpenHubL();
    1.54 +    void CloseHubL();
    1.55 +    void LoadFileSystemL();
    1.56 +
    1.57 +    void StartUsbHostMs(TRequestStatus& aStatus);
    1.58 +    void Cancel();
    1.59 +
    1.60 +    RUsbHubDriver::TBusEvent::TEvent WaitForBusEvent();
    1.61 +
    1.62 +    TToken OpenDeviceL();
    1.63 +    void CloseDeviceL();
    1.64 +    void CloseAllDevicesL();
    1.65 +
    1.66 +    void MountDeviceL();
    1.67 +    void DismountDeviceL();
    1.68 +    void DismountAllFileSystemsL();
    1.69 +
    1.70 +private:
    1.71 +    CUsbHostAo* iUsbHostAo;
    1.72 +    
    1.73 +    RUsbHubDriver iHubDriver;
    1.74 +
    1.75 +    CUsbMsMountManager* iMountManager;
    1.76 +
    1.77 +    TUint iDeviceHandle;
    1.78 +
    1.79 +    RUsbHubDriver::TBusEvent iEvent;
    1.80 +    };
    1.81 +
    1.82 +
    1.83 +class CUsbHostDisp: public CUsbHost
    1.84 +    {
    1.85 +public:
    1.86 +	static CUsbHostDisp* NewL(MDriveDisplay& aDriveDisplay);
    1.87 +	~CUsbHostDisp();
    1.88 +private:
    1.89 +    void ConstructL();
    1.90 +	CUsbHostDisp(MDriveDisplay& aDriveDisplay);
    1.91 +
    1.92 +private:
    1.93 +    void ProcessBusEventL();
    1.94 +
    1.95 +private:
    1.96 +    MDriveDisplay& iDriveDisplay;
    1.97 +    };
    1.98 +
    1.99 +#endif