/* structure that is the state information for the default credit distribution callback
* drivers should instantiate (zero-init as well) this structure in their driver instance
* and pass it as a context to the HTC credit distribution functions */
-typedef struct _COMMON_CREDIT_STATE_INFO {
+struct common_credit_state_info {
int TotalAvailableCredits; /* total credits in the system at startup */
int CurrentFreeCredits; /* credits available in the pool that have not been
given out to endpoints */
HTC_ENDPOINT_CREDIT_DIST *pLowestPriEpDist; /* pointer to the lowest priority endpoint dist struct */
-} COMMON_CREDIT_STATE_INFO;
+};
typedef struct {
s32 (*setupTransport)(void *ar);
#endif
/* OS-independent APIs */
-int ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, COMMON_CREDIT_STATE_INFO *pCredInfo);
+int ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, struct common_credit_state_info *pCredInfo);
int ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data);
#define DATA_SVCS_USED 4
#endif
-static void RedistributeCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
+static void RedistributeCredits(struct common_credit_state_info *pCredInfo,
HTC_ENDPOINT_CREDIT_DIST *pEPDistList);
-static void SeekCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
+static void SeekCredits(struct common_credit_state_info *pCredInfo,
HTC_ENDPOINT_CREDIT_DIST *pEPDistList);
/* reduce an ep's credits back to a set limit */
-static INLINE void ReduceCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
+static INLINE void ReduceCredits(struct common_credit_state_info *pCredInfo,
HTC_ENDPOINT_CREDIT_DIST *pEpDist,
int Limit)
{
{
HTC_ENDPOINT_CREDIT_DIST *pCurEpDist;
int count;
- COMMON_CREDIT_STATE_INFO *pCredInfo = (COMMON_CREDIT_STATE_INFO *)Context;
+ struct common_credit_state_info *pCredInfo = (struct common_credit_state_info *)Context;
pCredInfo->CurrentFreeCredits = TotalCredits;
pCredInfo->TotalAvailableCredits = TotalCredits;
HTC_CREDIT_DIST_REASON Reason)
{
HTC_ENDPOINT_CREDIT_DIST *pCurEpDist;
- COMMON_CREDIT_STATE_INFO *pCredInfo = (COMMON_CREDIT_STATE_INFO *)Context;
+ struct common_credit_state_info *pCredInfo = (struct common_credit_state_info *)Context;
switch (Reason) {
case HTC_CREDIT_DIST_SEND_COMPLETE :
}
/* redistribute credits based on activity change */
-static void RedistributeCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
+static void RedistributeCredits(struct common_credit_state_info *pCredInfo,
HTC_ENDPOINT_CREDIT_DIST *pEPDistList)
{
HTC_ENDPOINT_CREDIT_DIST *pCurEpDist = pEPDistList;
}
/* HTC has an endpoint that needs credits, pEPDist is the endpoint in question */
-static void SeekCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
+static void SeekCredits(struct common_credit_state_info *pCredInfo,
HTC_ENDPOINT_CREDIT_DIST *pEPDist)
{
HTC_ENDPOINT_CREDIT_DIST *pCurEpDist;
}
/* initialize and setup credit distribution */
-int ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, COMMON_CREDIT_STATE_INFO *pCredInfo)
+int ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, struct common_credit_state_info *pCredInfo)
{
HTC_SERVICE_ID servicepriority[5];
- A_MEMZERO(pCredInfo,sizeof(COMMON_CREDIT_STATE_INFO));
+ A_MEMZERO(pCredInfo,sizeof(struct common_credit_state_info));
servicepriority[0] = WMI_CONTROL_SVC; /* highest */
servicepriority[1] = WMI_DATA_VO_SVC;