Intersystem Tranceiver/mmuxtrxif.h
author Arnaud Lenoir
Tue, 27 Jul 2010 14:02:05 +0100
changeset 17 fc9a6286e87d
parent 0 bb4b476bbb96
permissions -rw-r--r--
FYI - READ ONLY - contact arnaudl@symbian.org for any changes you want. Added data code availabe for OS&Base Services.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     1
/*
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     2
  mmuxtrxif.h
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     3
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     4
  Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     5
  All rights reserved.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     6
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     7
  This program and the accompanying materials are made available 
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     8
  under the terms of the Eclipse Public License v1.0 which accompanies 
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
     9
  this distribution, and is available at 
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    10
  http://www.eclipse.org/legal/epl-v10.html
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    11
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    12
  Initial Contributors:
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    13
  Nokia Corporation - initial contribution.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    14
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    15
  Contributors:
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    16
*/
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    17
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    18
/** @mmuxtrxif.h
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    19
@brief Abstract interface class. Part of IST API.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    20
@publishedDeviceAbstraction
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    21
*/
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    22
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    23
#ifndef __MMUXTRXIF_H__
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    24
#define __MMUXTRXIF_H__
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    25
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    26
// Include files
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    27
#include <e32def.h>         // For TInt
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    28
#include <e32cmn.h>         // For TDes8
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    29
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    30
// Macros
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    31
/*
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    32
A equals to asserted value b equals unique identifier of transceiver and c equals to TTransceiverFault codes. 
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    33
*/
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    34
#define TRX_ASSERT_FAULT_MACRO( a, b, c ) if( !( a ) ){ Kern::Fault( "mmuxtrxif:", ( ( TUint32 ) ( ( TUint32 ) b | ( TUint32 ) c << 16 ) ) ); }
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    35
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    36
/**
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    37
@brief Abstract interface class to use transceiver services.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    38
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    39
Interface implemented by transceiver and used from multiplexer.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    40
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    41
Class is used to transmit data from multiplexer to transceiver.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    42
*/
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    43
class MMuxTrxIf
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    44
    {
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    45
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    46
    public:
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    47
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    48
        /**
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    49
        Data transmission priorities.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    50
        */
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    51
        enum TDataTransmitPriority
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    52
            {
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    53
            EPriorityNormal     = 5,
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    54
            EPriorityHigh       = 10,
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    55
            };
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    56
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    57
        /**
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    58
        Interface functions fault values.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    59
        */
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    60
        enum TTransceiverFault
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    61
           {
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    62
           ENotThreadContext    = 1,
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    63
           ETransmissionFailed,
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    64
           };
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    65
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    66
        /**
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    67
        Transmits data from multiplexer to transceiver.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    68
        Transceiver is responsible of transmitting the data over the interconnection.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    69
        If data is needed to be queued, data with highest priority shall be transmitted first over the interconnection.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    70
        Transmission over the interconnection shall be done in reliable and ordered manner.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    71
        Transceiver is responsible of deallocating the data block after transmission with MTrxMuxIf::DeallocateBlock.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    72
        Transceiver is recommended to transmit data over the interconnection in its own thread context to avoid blocking calling thread for too long.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    73
        If not called in kernel thread context fault ENotThreadContext thrown with TRX_ASSERT_FAULT_MACRO.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    74
        If data transmission reliability or ordering failed fault ETransmissionFailed thrown with TRX_ASSERT_FAULT_MACRO.
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    75
        Execution:          Synchronous
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    76
        Re-entrant:         No
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    77
        Can block:          Yes
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    78
        Panic mode:         Kern::Fault
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    79
        Memory allocation:  No
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    80
        Execution time:     Quick
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    81
        SMP safe:           Yes
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    82
        @param aData data to be transmitted
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    83
        @param aPriority priority of the data to be transmitted
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    84
        @param aMuxingHeader multiplexing protocol header formulated by multiplexer
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    85
        @return void
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    86
        @pre Called always in kernel thread context
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    87
        @pre No fastmutex held
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    88
        @post Calling thread not blocked
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    89
        */
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    90
        virtual void Transmit( TDes8& aData, const TDataTransmitPriority aPriority, const TUint32 aMuxingHeader ) = 0;
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    91
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    92
    };
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    93
bb4b476bbb96 Initial contribution of SHAI APIs from Nokia.
Daniel Rubio <danielr@symbian.org>
parents:
diff changeset
    94
#endif // __MMUXTRXIF_H__