VirtualBox

Changeset 104302 in vbox for trunk/src/VBox/Devices/USB


Ignore:
Timestamp:
Apr 12, 2024 7:31:00 AM (8 months ago)
Author:
vboxsync
Message:

DevOHCI: Reworked ohciR3GetDirection() to not return a separate failure/success indicator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r104277 r104302  
    30883088 * we do not raise an unrecoverable error but the caller may wish to.
    30893089 */
    3090 static bool ohciR3GetDirection(PPDMDEVINS pDevIns, POHCI pThis, POHCICC pThisCC, PCOHCIED pEd, VUSBDIRECTION *pEnmDir)
     3090static VUSBDIRECTION ohciR3GetDirection(PPDMDEVINS pDevIns, POHCI pThis, POHCICC pThisCC, PCOHCIED pEd)
    30913091{
    30923092    RT_NOREF(pThisCC);
     
    31023102            default:
    31033103                Log(("ohciR3GetDirection: Invalid direction!!!! Ed.hwinfo=%#x\n", pEd->hwinfo));
    3104                 *pEnmDir = VUSBDIRECTION_INVALID;
    3105                 return false;
    31063104        }
    31073105    }
     
    31243122                    default:
    31253123                        Log(("ohciR3GetDirection: Invalid direction!!!! Td.hwinfo=%#x Ed.hwinfo=%#x\n", Td.hwinfo, pEd->hwinfo));
    3126                         *pEnmDir = VUSBDIRECTION_INVALID;
    3127                         return false;
    31283124                }
    31293125        }
    31303126   }
    31313127
    3132     *pEnmDir = enmDir;
    3133     return true;
     3128    return enmDir;
    31343129}
    31353130
     
    38903885                uint8_t uAddr  = Ed.hwinfo & ED_HWINFO_FUNCTION;
    38913886                uint8_t uEndPt = (Ed.hwinfo & ED_HWINFO_ENDPOINT) >> ED_HWINFO_ENDPOINT_SHIFT;
    3892                 VUSBDIRECTION enmDir;
    3893                 if (ohciR3GetDirection(pDevIns, pThis, pThisCC, &Ed, &enmDir))
     3887                VUSBDIRECTION enmDir = ohciR3GetDirection(pDevIns, pThis, pThisCC, &Ed);
     3888                if (enmDir != VUSBDIRECTION_INVALID)
    38943889                {
    38953890                    pThisCC->RootHub.pIRhConn->pfnAbortEpByAddr(pThisCC->RootHub.pIRhConn, uAddr, uEndPt, enmDir);
     
    39503945               uint8_t uAddr  = Ed.hwinfo & ED_HWINFO_FUNCTION;
    39513946               uint8_t uEndPt = (Ed.hwinfo & ED_HWINFO_ENDPOINT) >> ED_HWINFO_ENDPOINT_SHIFT;
    3952                VUSBDIRECTION enmDir;
    3953                if (ohciR3GetDirection(pDevIns, pThis, pThisCC, &Ed, &enmDir))
     3947               VUSBDIRECTION enmDir = ohciR3GetDirection(pDevIns, pThis, pThisCC, &Ed);
     3948               if (enmDir != VUSBDIRECTION_INVALID)
    39543949               {
    39553950                   pThisCC->RootHub.pIRhConn->pfnAbortEpByAddr(pThisCC->RootHub.pIRhConn, uAddr, uEndPt, enmDir);
     
    41204115                uint8_t uAddr  = Ed.hwinfo & ED_HWINFO_FUNCTION;
    41214116                uint8_t uEndPt = (Ed.hwinfo & ED_HWINFO_ENDPOINT) >> ED_HWINFO_ENDPOINT_SHIFT;
    4122                 VUSBDIRECTION enmDir;
    4123                 if (ohciR3GetDirection(pDevIns, pThis, pThisCC, &Ed, &enmDir))
     4117                VUSBDIRECTION enmDir = ohciR3GetDirection(pDevIns, pThis, pThisCC, &Ed);
     4118                if (enmDir != VUSBDIRECTION_INVALID)
    41244119                {
    41254120                    pThisCC->RootHub.pIRhConn->pfnAbortEpByAddr(pThisCC->RootHub.pIRhConn, uAddr, uEndPt, enmDir);
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