- Timestamp:
- Jan 25, 2011 5:01:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DevSerial.cpp
r35353 r35717 138 138 #define XMIT_FIFO 0 139 139 #define RECV_FIFO 1 140 #define MAX_XMIT_RETRY 8140 #define MAX_XMIT_RETRY 16 141 141 142 142 /******************************************************************************* … … 273 273 if (f->count < UART_FIFO_LENGTH) 274 274 f->count++; 275 else if (fifo == XMIT_FIFO) /* need to at least adjust tail to maintain pipe state consistency */ 276 ++f->tail; 275 277 else if (fifo == RECV_FIFO) 276 278 s->lsr |= UART_LSR_OE; … … 371 373 } 372 374 373 static void serial_xmit(void *opaque )375 static void serial_xmit(void *opaque, bool bRetryXmit) 374 376 { 375 377 SerialState *s = (SerialState*)opaque; 376 uint64_t new_xmit_ts = TMTimerGet(CTX_SUFF(s->transmit_timer));377 378 378 379 if (s->tsr_retry <= 0) { … … 392 393 } else if ( RT_LIKELY(s->pDrvChar) 393 394 && RT_FAILURE(s->pDrvChar->pfnWrite(s->pDrvChar, &s->tsr, 1))) { 394 if ((s->tsr_retry >= 0) && (s->tsr_retry <= MAX_XMIT_RETRY)) { 395 s->tsr_retry++; 396 TMTimerSet(CTX_SUFF(s->transmit_timer), new_xmit_ts + s->char_transmit_time); 395 if ((s->tsr_retry >= 0) && ((!bRetryXmit) || (s->tsr_retry <= MAX_XMIT_RETRY))) { 396 if (!s->tsr_retry) 397 s->tsr_retry = 1; /* make sure the retry state is always set */ 398 else if (bRetryXmit) /* do not increase the retry count if the retry is actually caused by next char write */ 399 s->tsr_retry++; 400 401 TMTimerSet(CTX_SUFF(s->transmit_timer), TMTimerGet(CTX_SUFF(s->transmit_timer)) + s->char_transmit_time * 4); 397 402 return; 398 403 } else { … … 445 450 serial_update_irq(s); 446 451 } 447 serial_xmit(s );452 serial_xmit(s, false); 448 453 } 449 454 break; … … 810 815 { 811 816 SerialState *s = (SerialState*)pvUser; 812 serial_xmit(s );817 serial_xmit(s, true); 813 818 } 814 819
Note:
See TracChangeset
for help on using the changeset viewer.