OLD | NEW |
1 //------------------------------------------------------------------------------ | 1 //------------------------------------------------------------------------------ |
2 // <copyright file="htc_services.c" company="Atheros"> | 2 // <copyright file="htc_services.c" company="Atheros"> |
3 // Copyright (c) 2007-2008 Atheros Corporation. All rights reserved. | 3 // Copyright (c) 2007-2010 Atheros Corporation. All rights reserved. |
4 // | 4 // |
5 // This program is free software; you can redistribute it and/or modify | |
6 // it under the terms of the GNU General Public License version 2 as | |
7 // published by the Free Software Foundation; | |
8 // | 5 // |
9 // Software distributed under the License is distributed on an "AS | 6 // Permission to use, copy, modify, and/or distribute this software for any |
10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 7 // purpose with or without fee is hereby granted, provided that the above |
11 // implied. See the License for the specific language governing | 8 // copyright notice and this permission notice appear in all copies. |
12 // rights and limitations under the License. | 9 // |
| 10 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
13 // | 17 // |
14 // | 18 // |
15 //------------------------------------------------------------------------------ | 19 //------------------------------------------------------------------------------ |
16 //============================================================================== | 20 //============================================================================== |
17 // Author(s): ="Atheros" | 21 // Author(s): ="Atheros" |
18 //============================================================================== | 22 //============================================================================== |
19 #include "htc_internal.h" | 23 #include "htc_internal.h" |
20 | 24 |
21 void HTCControlTxComplete(void *Context, HTC_PACKET *pPacket) | 25 void HTCControlTxComplete(void *Context, HTC_PACKET *pPacket) |
22 { | 26 { |
(...skipping 10 matching lines...) Expand all Loading... |
33 if (pPacket->Status == A_ECANCELED) { | 37 if (pPacket->Status == A_ECANCELED) { |
34 /* this is a flush operation, return the control packet back to the pool
*/ | 38 /* this is a flush operation, return the control packet back to the pool
*/ |
35 HTC_FREE_CONTROL_RX((HTC_TARGET*)Context,pPacket); | 39 HTC_FREE_CONTROL_RX((HTC_TARGET*)Context,pPacket); |
36 return; | 40 return; |
37 } | 41 } |
38 | 42 |
39 /* the only control messages we are expecting are NULL messages (credit
resports) */ | 43 /* the only control messages we are expecting are NULL messages (credit
resports) */ |
40 if (pPacket->ActualLength > 0) { | 44 if (pPacket->ActualLength > 0) { |
41 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, | 45 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, |
42 ("HTCControlRecv, got message with length:%d \n", | 46 ("HTCControlRecv, got message with length:%d \n", |
43 pPacket->ActualLength + HTC_HDR_LENGTH)); | 47 pPacket->ActualLength + (A_UINT32)HTC_HDR_LENGTH)); |
44 | 48 |
| 49 #ifdef ATH_DEBUG_MODULE |
45 /* dump header and message */ | 50 /* dump header and message */ |
46 DebugDumpBytes(pPacket->pBuffer - HTC_HDR_LENGTH, | 51 DebugDumpBytes(pPacket->pBuffer - HTC_HDR_LENGTH, |
47 pPacket->ActualLength + HTC_HDR_LENGTH, | 52 pPacket->ActualLength + HTC_HDR_LENGTH, |
48 "Unexpected ENDPOINT 0 Message"); | 53 "Unexpected ENDPOINT 0 Message"); |
| 54 #endif |
49 } | 55 } |
50 | 56 |
51 HTC_RECYCLE_RX_PKT((HTC_TARGET*)Context,pPacket,&((HTC_TARGET*)Context)->End
Point[0]); | 57 HTC_RECYCLE_RX_PKT((HTC_TARGET*)Context,pPacket,&((HTC_TARGET*)Context)->End
Point[0]); |
52 } | 58 } |
53 | 59 |
54 A_STATUS HTCSendSetupComplete(HTC_TARGET *target) | 60 A_STATUS HTCSendSetupComplete(HTC_TARGET *target) |
55 { | 61 { |
56 HTC_PACKET *pSendPacket = NULL; | 62 HTC_PACKET *pSendPacket = NULL; |
57 A_STATUS status; | 63 A_STATUS status; |
58 | 64 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); | 128 HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle); |
123 A_STATUS status = A_OK; | 129 A_STATUS status = A_OK; |
124 HTC_PACKET *pRecvPacket = NULL; | 130 HTC_PACKET *pRecvPacket = NULL; |
125 HTC_PACKET *pSendPacket = NULL; | 131 HTC_PACKET *pSendPacket = NULL; |
126 HTC_CONNECT_SERVICE_RESPONSE_MSG *pResponseMsg; | 132 HTC_CONNECT_SERVICE_RESPONSE_MSG *pResponseMsg; |
127 HTC_CONNECT_SERVICE_MSG *pConnectMsg; | 133 HTC_CONNECT_SERVICE_MSG *pConnectMsg; |
128 HTC_ENDPOINT_ID assignedEndpoint = ENDPOINT_MAX; | 134 HTC_ENDPOINT_ID assignedEndpoint = ENDPOINT_MAX; |
129 HTC_ENDPOINT *pEndpoint; | 135 HTC_ENDPOINT *pEndpoint; |
130 unsigned int maxMsgSize = 0; | 136 unsigned int maxMsgSize = 0; |
131 | 137 |
132 AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCConnectService, target:0x%X SvcID:0x%X
\n", | 138 AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCConnectService, target:0x%lX SvcID:0x%X
\n", |
133 (A_UINT32)target, pConnectReq->ServiceID)); | 139 (unsigned long)target, pConnectReq->ServiceID)); |
134 | 140 |
135 do { | 141 do { |
136 | 142 |
137 AR_DEBUG_ASSERT(pConnectReq->ServiceID != 0); | 143 AR_DEBUG_ASSERT(pConnectReq->ServiceID != 0); |
138 | 144 |
139 if (HTC_CTRL_RSVD_SVC == pConnectReq->ServiceID) { | 145 if (HTC_CTRL_RSVD_SVC == pConnectReq->ServiceID) { |
140 /* special case for pseudo control service */ | 146 /* special case for pseudo control service */ |
141 assignedEndpoint = ENDPOINT_0; | 147 assignedEndpoint = ENDPOINT_0; |
142 maxMsgSize = HTC_MAX_CONTROL_MESSAGE_LENGTH; | 148 maxMsgSize = HTC_MAX_CONTROL_MESSAGE_LENGTH; |
143 } else { | 149 } else { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 if (target->EndPoint[ep].ServiceID == ServicePriorityOrder[i]) { | 441 if (target->EndPoint[ep].ServiceID == ServicePriorityOrder[i]) { |
436 /* queue this one to the list */ | 442 /* queue this one to the list */ |
437 AddToEndpointDistList(target, &target->EndPoint[ep].CreditDist); | 443 AddToEndpointDistList(target, &target->EndPoint[ep].CreditDist); |
438 break; | 444 break; |
439 } | 445 } |
440 } | 446 } |
441 AR_DEBUG_ASSERT(ep < ENDPOINT_MAX); | 447 AR_DEBUG_ASSERT(ep < ENDPOINT_MAX); |
442 } | 448 } |
443 | 449 |
444 } | 450 } |
OLD | NEW |