Changeset 10902 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 27, 2008 7:57:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r8155 r10902 780 780 PDRVHOSTSERIAL pData = PDMINS2DATA(pDrvIns, PDRVHOSTSERIAL); 781 781 int rc; 782 unsigned int uSerialLineFlags; 783 unsigned int uSerialLineStatus; 784 unsigned int uIoctl; 782 785 783 786 /* … … 788 791 * This should make the ioctl call return. 789 792 */ 790 rc = ioctl(pData->DeviceFile, TIOCMBIS, TIOCM_LOOP); 793 794 /* Get current status of control lines. */ 795 rc = ioctl(pData->DeviceFile, TIOCMGET, &uSerialLineStatus); 791 796 if (rc < 0) 792 797 goto ioctl_error; 793 798 794 rc = ioctl(pData->DeviceFile, TIOCMBIS, TIOCM_RTS); 799 uSerialLineFlags = TIOCM_LOOP; 800 rc = ioctl(pData->DeviceFile, TIOCMBIS, &uSerialLineFlags); 801 if (rc < 0) 802 goto ioctl_error; 803 804 /* 805 * Change current level on the RTS pin to make the ioctl call return in the 806 * monitor thread. 807 */ 808 uIoctl = (uSerialLineStatus & TIOCM_CTS) ? TIOCMBIC : TIOCMBIS; 809 uSerialLineFlags = TIOCM_RTS; 810 811 rc = ioctl(pData->DeviceFile, uIoctl, &uSerialLineFlags); 812 if (rc < 0) 813 goto ioctl_error; 814 815 /* Change RTS back to the previous level. */ 816 uIoctl = (uIoctl == TIOCMBIC) ? TIOCMBIS : TIOCMBIC; 817 818 rc = ioctl(pData->DeviceFile, uIoctl, &uSerialLineFlags); 795 819 if (rc < 0) 796 820 goto ioctl_error; … … 799 823 * Set serial device into normal state. 800 824 */ 801 rc = ioctl(pData->DeviceFile, TIOCMBIC, TIOCM_LOOP); 825 uSerialLineFlags = TIOCM_LOOP; 826 rc = ioctl(pData->DeviceFile, TIOCMBIC, &uSerialLineFlags); 802 827 if (rc >= 0) 803 828 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.