VirtualBox

Changeset 72073 in vbox


Ignore:
Timestamp:
May 1, 2018 9:46:14 PM (7 years ago)
Author:
vboxsync
Message:

Devices/Serial: New version for the character driver while working on the conversion to the new interface, some updates to the already newly implemented host serial driver

Location:
trunk/src/VBox/Devices/Serial
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DrvCharNew.cpp

    r71987 r72073  
    1111
    1212/*
    13  * Copyright (C) 2006-2017 Oracle Corporation
     13 * Copyright (C) 2006-2018 Oracle Corporation
    1414 *
    1515 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2828#define LOG_GROUP LOG_GROUP_DRV_CHAR
    2929#include <VBox/vmm/pdmdrv.h>
     30#include <VBox/vmm/pdmserialifs.h>
    3031#include <iprt/asm.h>
    3132#include <iprt/assert.h>
  • trunk/src/VBox/Devices/Serial/DrvHostSerialNew.cpp

    r70800 r72073  
    11/* $Id$ */
    22/** @file
    3  * VBox stream I/O devices: Host serial driver
     3 * VBox serial devices: Host serial driver
    44 */
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2323#define LOG_GROUP LOG_GROUP_DRV_HOST_SERIAL
    2424#include <VBox/vmm/pdm.h>
     25#include <VBox/vmm/pdmserialifs.h>
    2526#include <VBox/err.h>
    2627
     
    442443                          | RTSERIALPORT_OPEN_F_DETECT_BREAK_CONDITION;
    443444    rc = RTSerialPortOpen(&pThis->hSerialPort, pThis->pszDevicePath, fOpenFlags);
     445    if (rc == VERR_NOT_SUPPORTED)
     446    {
     447        /*
     448         * For certain devices (or pseudo terminals) status line monitoring does not work
     449         * so try again without it.
     450         */
     451        fOpenFlags &= ~RTSERIALPORT_OPEN_F_SUPPORT_STATUS_LINE_MONITORING;
     452        rc = RTSerialPortOpen(&pThis->hSerialPort, pThis->pszDevicePath, fOpenFlags);
     453    }
     454
    444455    if (RT_FAILURE(rc))
    445456    {
     
    483494     * Register release statistics.
    484495     */
    485     PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesWritten,    STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_BYTES, "Nr of bytes written",         "/Devices/HostSerial%d/Written", pDrvIns->iInstance);
    486     PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesRead,       STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_BYTES, "Nr of bytes read",            "/Devices/HostSerial%d/Read", pDrvIns->iInstance);
     496    PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesWritten, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_BYTES,
     497                           "Nr of bytes written",         "/Devices/HostSerial%d/Written", pDrvIns->iInstance);
     498    PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesRead,    STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_BYTES,
     499                           "Nr of bytes read",            "/Devices/HostSerial%d/Read", pDrvIns->iInstance);
    487500
    488501    return VINF_SUCCESS;
     
    498511    /* szName */
    499512    "Host Serial",
    500         /* szRCMod */
     513    /* szRCMod */
    501514    "",
    502515    /* szR0Mod */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette