13static void checkGenTdQueue(
void)
17 if ( !memPool->m_freeHcTdList )
21 for ( queueStart_tmp1 = memPool->m_tdQueueStart; queueStart_tmp1 && queueStart_tmp1->m_inTdQueue != GENTD_QUEUE;
22 queueStart_tmp1 = queueStart_tmp1->m_busyNext )
25 if ( queueStart_tmp1 )
26 handleIoReqList(queueStart_tmp1);
33 const void *bufferEnd;
49 tdHcArea = arg->m_hcArea;
50 curBufPtr = (u8 *)arg->m_curBufPtr;
51 bufferEnd = arg->m_bufferEnd;
52 lut_ptr1 = &memPool->m_hcTdToIoReqLUT[arg - memPool->m_hcTdBuf];
53 hcRes = tdHcArea >> 28;
61 if ( bufferEnd && ((tdHcArea & 0x180000) != 0) )
64 req_1->m_transferedBytes = curBufPtr ? (u32)(curBufPtr - (u8 *)req_1->m_destPtr) : req_1->m_length;
67 req_1->m_resultCode = hcRes;
68 if ( hcRes || ((tdHcArea & 0xE00000) != 0xE00000) )
75 ed = req_1->m_correspEndpoint->m_hcEd;
76 if ( hcRes && ED_HALTED(*ed) )
78 for ( tdListPos_2 = (
UsbdHcTD_t *)((uiptr)ed->m_tdHead & ~0xF); tdListPos_2 && tdListPos_2 != ed->m_tdTail;
79 tdListPos_2 = nextTd )
83 nextTd = tdListPos_2->m_next;
85 lut_ptr2 = &memPool->m_hcTdToIoReqLUT[tdListPos_2 - memPool->m_hcTdBuf];
92 for ( listPos = firstElem; listPos && listPos != req_2; listPos = listPos->m_next )
100 req_2->m_prev = lastElem;
102 lastElem->m_next = req_2;
105 req_2->m_next = NULL;
108 ed->m_tdHead = ed->m_tdTail;
110 for ( pos = firstElem; pos; pos = next_tmp1 )
113 next_tmp1 = pos->m_next;
114 if ( pos->m_correspEndpoint->m_correspDevice )
116 if ( pos->m_callbackProc )
117 pos->m_callbackProc(pos);
127static void checkIsoTdQueue(
void)
131 if ( !memPool->m_freeHcIsoTdList )
135 for ( queueStart_tmp1 = memPool->m_tdQueueStart; queueStart_tmp1 && queueStart_tmp1->m_inTdQueue != ISOTD_QUEUE;
136 queueStart_tmp1 = queueStart_tmp1->m_busyNext )
139 if ( queueStart_tmp1 )
140 handleIoReqList(queueStart_tmp1);
146 unsigned int psw_tmp;
163 hcArea = arg->m_hcArea;
164 psw_tmp = arg->m_psw[0];
165 tdHcRes = hcArea >> 28;
166 pswRes = psw_tmp >> 12;
167 lut_ptr1 = &memPool->m_hcIsoTdToIoReqLUT[arg - memPool->m_hcIsoTdBuf];
168 pswOfs = psw_tmp & 0x7FF;
175 if ( req_1->m_req.bNumPackets )
176 bcopy(arg->m_psw, req_1->m_req.Packets, 16);
178 req_1->m_transferedBytes = 0;
179 if ( req_1->m_req.bNumPackets )
181 req_1->m_resultCode = tdHcRes;
185 req_1->m_resultCode = tdHcRes | (pswRes << 4);
188 if ( (req_1->m_correspEndpoint->m_hcEd->m_hcArea.stru.m_hcArea & HCED_DIR_MASK) == HCED_DIR_IN )
189 req_1->m_transferedBytes = pswOfs;
191 req_1->m_transferedBytes = req_1->m_length;
194 req_1->m_prev = NULL;
196 req_1->m_next = NULL;
198 ed = req_1->m_correspEndpoint->m_hcEd;
199 tdHead = ed->m_tdHead;
200 if ( ED_HALTED(*ed) )
207 nextTd = curTd->m_next;
209 lut_ptr2 = &memPool->m_hcIsoTdToIoReqLUT[curTd - memPool->m_hcIsoTdBuf];
214 for ( listPos = listStart; listPos && listPos != req_2; listPos = listPos->m_next )
222 req_2->m_prev = listEnd;
224 listEnd->m_next = req_2;
227 req_2->m_next = NULL;
231 ed->m_tdHead = ed->m_tdTail;
233 for ( pos = listStart; pos; pos = next_tmp1 )
236 next_tmp1 = pos->m_next;
237 if ( pos->m_correspEndpoint->m_correspDevice )
239 if ( pos->m_callbackProc )
240 pos->m_callbackProc(pos);