os/kernelhwsrv/kerneltest/f32test/shostmassstorage/msman/inc/cusbhost.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
sl@0
    17
#ifndef CUSBHOST
sl@0
    18
#define CUSBHOST
sl@0
    19
sl@0
    20
class TUsbInterfaceDescriptor;
sl@0
    21
class TUsbDeviceDescriptor;
sl@0
    22
class RUsbInterface;
sl@0
    23
class THostMassStorageConfig;
sl@0
    24
sl@0
    25
class CUsbMsMountManager;
sl@0
    26
class CUsbHostAo;
sl@0
    27
sl@0
    28
class MDriveDisplay;
sl@0
    29
sl@0
    30
class CUsbHost: public CBase, public MUsbHostBusEventObserver
sl@0
    31
    {
sl@0
    32
public:
sl@0
    33
	static CUsbHost* NewL();
sl@0
    34
	~CUsbHost();
sl@0
    35
protected:
sl@0
    36
    void ConstructL();
sl@0
    37
	CUsbHost();
sl@0
    38
sl@0
    39
public:
sl@0
    40
    TInt DevicesNumber() const;
sl@0
    41
    void DriveMap(TDriveMap& aDriveMap) const;
sl@0
    42
    void DeviceMap(TInt aDeviceIndex, TDeviceMap& aDeviceMap) const;
sl@0
    43
sl@0
    44
    void Start();
sl@0
    45
sl@0
    46
protected:
sl@0
    47
    void ProcessBusEventL();
sl@0
    48
sl@0
    49
private:
sl@0
    50
    void OpenHubL();
sl@0
    51
    void CloseHubL();
sl@0
    52
    void LoadFileSystemL();
sl@0
    53
sl@0
    54
    void StartUsbHostMs(TRequestStatus& aStatus);
sl@0
    55
    void Cancel();
sl@0
    56
sl@0
    57
    RUsbHubDriver::TBusEvent::TEvent WaitForBusEvent();
sl@0
    58
sl@0
    59
    TToken OpenDeviceL();
sl@0
    60
    void CloseDeviceL();
sl@0
    61
    void CloseAllDevicesL();
sl@0
    62
sl@0
    63
    void MountDeviceL();
sl@0
    64
    void DismountDeviceL();
sl@0
    65
    void DismountAllFileSystemsL();
sl@0
    66
sl@0
    67
private:
sl@0
    68
    CUsbHostAo* iUsbHostAo;
sl@0
    69
    
sl@0
    70
    RUsbHubDriver iHubDriver;
sl@0
    71
sl@0
    72
    CUsbMsMountManager* iMountManager;
sl@0
    73
sl@0
    74
    TUint iDeviceHandle;
sl@0
    75
sl@0
    76
    RUsbHubDriver::TBusEvent iEvent;
sl@0
    77
    };
sl@0
    78
sl@0
    79
sl@0
    80
class CUsbHostDisp: public CUsbHost
sl@0
    81
    {
sl@0
    82
public:
sl@0
    83
	static CUsbHostDisp* NewL(MDriveDisplay& aDriveDisplay);
sl@0
    84
	~CUsbHostDisp();
sl@0
    85
private:
sl@0
    86
    void ConstructL();
sl@0
    87
	CUsbHostDisp(MDriveDisplay& aDriveDisplay);
sl@0
    88
sl@0
    89
private:
sl@0
    90
    void ProcessBusEventL();
sl@0
    91
sl@0
    92
private:
sl@0
    93
    MDriveDisplay& iDriveDisplay;
sl@0
    94
    };
sl@0
    95
sl@0
    96
#endif