Changeset 23160 in vbox
- Timestamp:
- Sep 19, 2009 8:15:38 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmifs.h
r22812 r23160 1446 1446 */ 1447 1447 DECLR3CALLBACKMEMBER(int, pfnNotifyStatusLinesChanged,(PPDMICHARPORT pInterface, uint32_t fNewStatusLines)); 1448 1449 /** 1450 * Notify the device/driver that a break occurred. 1451 * 1452 * @returns VBox statsus code. 1453 * @param pInterface Pointer to the interface structure containing the called function pointer. 1454 * @thread Any thread. 1455 */ 1456 DECLR3CALLBACKMEMBER(int, pfnNotifyBreak,(PPDMICHARPORT pInterface)); 1448 1457 } PDMICHARPORT; 1449 1458 … … 1492 1501 DECLR3CALLBACKMEMBER(int, pfnSetModemLines,(PPDMICHAR pInterface, bool fRequestToSend, bool fDataTerminalReady)); 1493 1502 1503 /** 1504 * Sets the TD line into break condition. 1505 * 1506 * @returns VBox status code. 1507 * @param pInterface Pointer to the interface structure containing the called function pointer. 1508 * @param fBreak Set to true to let the device send a break false to put into normal operation. 1509 * @thread Any thread. 1510 */ 1511 DECLR3CALLBACKMEMBER(int, pfnSetBreak,(PPDMICHAR pInterface, bool fBreak)); 1494 1512 } PDMICHAR; 1495 1513 -
trunk/src/VBox/Devices/Serial/DevSerial.cpp
r22793 r23160 200 200 } else if (s->msr_changed && (s->ier & UART_IER_RLSI)) { 201 201 s->iir = UART_IIR_RLSI; 202 } else if (s->lsr & UART_LSR_BI) { 203 s->iir = 0; /* No special status bit */ 202 204 } else { 203 205 s->iir = UART_IIR_NO_INT; … … 308 310 if (break_enable != s->last_break_enable) { 309 311 s->last_break_enable = break_enable; 312 if (RT_LIKELY(s->pDrvChar)) 313 { 314 Log(("serial_io_port_write: Set break %d\n", break_enable)); 315 int rc = s->pDrvChar->pfnSetBreak(s->pDrvChar, !!break_enable); 316 AssertRC(rc); 317 } 310 318 } 311 319 } … … 494 502 } 495 503 504 static DECLCALLBACK(int) serialNotifyBreak(PPDMICHARPORT pInterface) 505 { 506 SerialState *pThis = PDMICHARPORT_2_SERIALSTATE(pInterface); 507 508 Log(("%s: pInterface=%p\n", __FUNCTION__, pInterface)); 509 510 PDMCritSectEnter(&pThis->CritSect, VERR_PERMISSION_DENIED); 511 512 pThis->lsr |= UART_LSR_BI; 513 serial_update_irq(pThis); 514 515 PDMCritSectLeave(&pThis->CritSect); 516 517 return VINF_SUCCESS; 518 } 519 496 520 #endif /* IN_RING3 */ 497 521 … … 757 781 758 782 /* ICharPort */ 759 pThis->ICharPort.pfnNotifyRead = serialNotifyRead;783 pThis->ICharPort.pfnNotifyRead = serialNotifyRead; 760 784 pThis->ICharPort.pfnNotifyStatusLinesChanged = serialNotifyStatusLinesChanged; 785 pThis->ICharPort.pfnNotifyBreak = serialNotifyBreak; 761 786 762 787 #ifdef VBOX_SERIAL_PCI -
trunk/src/VBox/Devices/Serial/DrvChar.cpp
r22277 r23160 284 284 } 285 285 286 /** 287 * Sets the TD line into break condition. 288 * 289 * @returns VBox status code. 290 * @param pInterface Pointer to the interface structure containing the called function pointer. 291 * @param fBreak Set to true to let the device send a break false to put into normal operation. 292 * @thread Any thread. 293 */ 294 static DECLCALLBACK(int) drvCharSetBreak(PPDMICHAR pInterface, bool fBreak) 295 { 296 /* Nothing to do here. */ 297 return VINF_SUCCESS; 298 } 299 286 300 /* -=-=-=-=- driver interface -=-=-=-=- */ 287 301 … … 307 321 pThis->IChar.pfnSetParameters = drvCharSetParameters; 308 322 pThis->IChar.pfnSetModemLines = drvCharSetModemLines; 323 pThis->IChar.pfnSetBreak = drvCharSetBreak; 309 324 310 325 /* -
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r22876 r23160 849 849 cbRemaining = dwNumberOfBytesTransferred; 850 850 } 851 else if (dwEventMask & EV_BREAK) 852 { 853 Log(("HostSerial#%d: Detected break\n")); 854 rc = pThis->pDrvCharPort->pfnNotifyBreak(pThis->pDrvCharPort); 855 } 851 856 else 852 857 { … … 1174 1179 } 1175 1180 1181 /** 1182 * Sets the TD line into break condition. 1183 * 1184 * @returns VBox status code. 1185 * @param pInterface Pointer to the interface structure containing the called function pointer. 1186 * @param fBreak Set to true to let the device send a break false to put into normal operation. 1187 * @thread Any thread. 1188 */ 1189 static DECLCALLBACK(int) drvHostSerialSetBreak(PPDMICHAR pInterface, bool fBreak) 1190 { 1191 PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface); 1192 1193 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 1194 if (fBreak) 1195 ioctl(pThis->DeviceFile, TIOCSBRK); 1196 else 1197 ioctl(pThis->DeviceFile, TIOCCBRK); 1198 1199 #elif defined(RT_OS_WINDOWS) 1200 if (fBreak) 1201 SetCommBreak(pThis->hDeviceFile); 1202 else 1203 ClearCommBreak(pThis->hDeviceFile); 1204 #endif 1205 1206 return VINF_SUCCESS; 1207 } 1208 1176 1209 /* -=-=-=-=- driver interface -=-=-=-=- */ 1177 1210 … … 1198 1231 #endif 1199 1232 /* IBase. */ 1200 pDrvIns->IBase.pfnQueryInterface 1233 pDrvIns->IBase.pfnQueryInterface = drvHostSerialQueryInterface; 1201 1234 /* IChar. */ 1202 pThis->IChar.pfnWrite = drvHostSerialWrite; 1203 pThis->IChar.pfnSetParameters = drvHostSerialSetParameters; 1204 pThis->IChar.pfnSetModemLines = drvHostSerialSetModemLines; 1235 pThis->IChar.pfnWrite = drvHostSerialWrite; 1236 pThis->IChar.pfnSetParameters = drvHostSerialSetParameters; 1237 pThis->IChar.pfnSetModemLines = drvHostSerialSetModemLines; 1238 pThis->IChar.pfnSetBreak = drvHostSerialSetBreak; 1205 1239 1206 1240 /** @todo Initialize all members with NIL values!! The destructor is ALWAYS called. */
Note:
See TracChangeset
for help on using the changeset viewer.