Changeset 27394 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Mar 16, 2010 12:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r26173 r27394 2 2 /** @file 3 3 * VBox stream I/O devices: Host serial driver 4 *5 * Contributed by: Alexander Eichner6 4 */ 7 5 8 6 /* 9 * Copyright (C) 2006-20 07Sun Microsystems, Inc.7 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 10 8 * 11 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 67 65 # define TIOCM_LOOP 0x8000 68 66 # endif 67 /* For linux custom baudrate code we also need serial_struct */ 68 # include <linux/serial.h> 69 69 # endif /* linux */ 70 70 … … 306 306 break; 307 307 default: 308 #ifdef RT_OS_LINUX 309 struct serial_struct serialStruct; 310 if (ioctl(pThis->DeviceFile, TIOCGSERIAL, &serialStruct) != -1) 311 { 312 serialStruct.custom_divisor = serialStruct.baud_base / Bps; 313 if (!serialStruct.custom_divisor) 314 serialStruct.custom_divisor = 1; 315 serialStruct.flags &= ~ASYNC_SPD_MASK; 316 serialStruct.flags |= ASYNC_SPD_CUST; 317 ioctl(pThis->DeviceFile, TIOCSSERIAL, &serialStruct); 318 baud_rate = B38400; 319 } 320 else 321 baud_rate = B9600; 322 #else /* !RT_OS_LINUX */ 308 323 baud_rate = B9600; 324 #endif /* !RT_OS_LINUX */ 309 325 } 310 326
Note:
See TracChangeset
for help on using the changeset viewer.