bluetooth/btstack/linkmgr/AclDataQController.h
changeset 32 f72906e669b4
parent 0 29b1cd4cb562
equal deleted inserted replaced
31:b9d1744dc449 32:f72906e669b4
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2001-2010 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 "Eclipse Public License v1.0"
     4 // under the terms of "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".
    16 #ifndef _ACLDATAQCONTROLLER_H
    16 #ifndef _ACLDATAQCONTROLLER_H
    17 #define _ACLDATAQCONTROLLER_H
    17 #define _ACLDATAQCONTROLLER_H
    18 
    18 
    19 #include <e32base.h>
    19 #include <e32base.h>
    20 #include <bttypes.h>
    20 #include <bttypes.h>
       
    21 #include <es_mbuf.h>
    21 
    22 
    22 class CAclDataQ;
    23 class CAclDataQ;
    23 struct TDataQConnectionInfo;
    24 struct TDataQConnectionInfo;
    24 class CACLDataItem;
    25 class CACLDataItem;
    25 class CLinkMgrProtocol;
    26 class CLinkMgrProtocol;
    26 class CLinkMuxer;
    27 class CLinkMuxer;
    27 class CHCIFacade;
    28 class CHCIFacade;
       
    29 class CHostMBufPool;
    28 
    30 
    29 /**
    31 /**
    30 	Controller of the ACL data Q and of the pending packet list.
    32 	Controller of the ACL data Q and of the pending packet list.
    31 	This object holds in effect the model of how the HC operates its data 
    33 	This object holds in effect the model of how the HC operates its data 
    32 	pool, knows when ACL data are ready to be send-off for transmission and 
    34 	pool, knows when ACL data are ready to be send-off for transmission and 
    41 		TUint16 aFrameOverhead,
    43 		TUint16 aFrameOverhead,
    42 		TUint aNumBufs);
    44 		TUint aNumBufs);
    43 	~CACLDataQController();
    45 	~CACLDataQController();
    44 
    46 
    45 public:
    47 public:
       
    48 	// Outbound aspects
    46 	void InitialDataCredits(TUint16 aCredits);
    49 	void InitialDataCredits(TUint16 aCredits);
    47 	void AddItem(CACLDataItem& aACLFrame);
    50 	void AddItem(CACLDataItem& aACLFrame);
    48 	TBool IssueNextACLDataFragment();
    51 	TBool IssueNextACLDataFragment();
    49 	void GetBufferInfo(TUint16& aBufSize, TUint& aNumBufs);
    52 	void GetBufferInfo(TUint16& aBufSize, TUint& aNumBufs);
    50 	void GetDataQRecords(TUint& aQFillLevel, TUint16& aCredits);
    53 	void GetDataQRecords(TUint& aQFillLevel, TUint16& aCredits);
    55 	void FlushOccurred(THCIConnHandle aConnH); // TODO: not actually called by HCI facade
    58 	void FlushOccurred(THCIConnHandle aConnH); // TODO: not actually called by HCI facade
    56 	TInt ACLLogicalLinkUp(THCIConnHandle aConnH, TBool aIsParked);
    59 	TInt ACLLogicalLinkUp(THCIConnHandle aConnH, TBool aIsParked);
    57 	void ACLLogicalLinkDown(THCIConnHandle aConnH);
    60 	void ACLLogicalLinkDown(THCIConnHandle aConnH);
    58 	void SetParked(THCIConnHandle aConnH, TBool aParked);
    61 	void SetParked(THCIConnHandle aConnH, TBool aParked);
    59 	void CompletedPackets(THCIConnHandle aConnH, TUint16 aNo);
    62 	void CompletedPackets(THCIConnHandle aConnH, TUint16 aNo);
       
    63 	
       
    64 	// Inbound buffer related aspects
       
    65 	RMBufChain PopulateInboundBufferL(THCIConnHandle aConnH, TUint8 aFlag, const TDesC8& aData);
       
    66 	void NoExplicitInboundPoolNeeded();
       
    67 	
    60 
    68 
    61 private:
    69 private:
    62 	CACLDataQController(CHCIFacade& aHCIFacade, CLinkMuxer& aMuxer);
    70 	CACLDataQController(CHCIFacade& aHCIFacade, CLinkMuxer& aMuxer);
    63 	void ConstructL(CLinkMgrProtocol& aProtocol, TUint16 aBufSize, TUint16 aFrameOverhead, TUint aNumBufs);
    71 	void ConstructL(CLinkMgrProtocol& aProtocol, TUint16 aBufSize, TUint16 aFrameOverhead, TUint aNumBufs);
    64 	
    72 	
    82 	// implement fairer sharing of the link (otherwise connections near the 
    90 	// implement fairer sharing of the link (otherwise connections near the 
    83 	// start of the array get precedence over connections near the end).
    91 	// start of the array get precedence over connections near the end).
    84 	TUint iIndexOfLastSendingConn;
    92 	TUint iIndexOfLastSendingConn;
    85 
    93 
    86 	TUint16     iNumControllerBufs;
    94 	TUint16     iNumControllerBufs;
       
    95 	
       
    96 #ifdef HOSTCONTROLLER_TO_HOST_FLOW_CONTROL
       
    97 	CHostMBufPool* iMBufPool;
       
    98 #endif
    87 
    99 
    88 private: // unowned
   100 private: // unowned
    89 	CLinkMuxer&	iLinkMuxer;
   101 	CLinkMuxer&	iLinkMuxer;
    90 	CHCIFacade& iHCIFacade;
   102 	CHCIFacade& iHCIFacade;
    91 	};
   103 	};