Ticket #8371: darwinfirewire-intel.patch

File darwinfirewire-intel.patch, 1.8 KB (added by Nigel, 14 years ago)

Recent trunk

  • mythtv/libs/libmythtv/darwinfirewiredevice.cpp

    diff --git a/mythtv/libs/libmythtv/darwinfirewiredevice.cpp b/mythtv/libs/libmythtv/darwinfirewiredevice.cpp
    index 58224c9..c2e966d 100644
    a b  
    1717#include <IOKit/firewire/IOFireWireLibIsoch.h>
    1818#include <IOKit/firewire/IOFireWireFamilyCommon.h>
    1919#include <IOKit/avc/IOFireWireAVCLib.h>
     20#include <CoreServices/CoreServices.h>   // for EndianU32_BtoN() etc.
    2021
    2122// Std C++ headers
    2223#include <algorithm>
    int DarwinFirewireDevice::GetMaxSpeed(void)  
    375376        uint32_t val;
    376377        int ret = (*fw_handle)->ReadQuadlet(
    377378            fw_handle, dev, &addr, (UInt32*) &val, false, 0);
     379        val = EndianU32_BtoN(val);
    378380
    379381        return (ret == kIOReturnSuccess) ? (int)((val>>30) & 0x3) : -1;
    380382    }
    bool DarwinFirewireDevice::IsSTBStreaming(uint *fw_channel)  
    400402    uint32_t val;
    401403    int ret = (*fw_handle)->ReadQuadlet(
    402404        fw_handle, dev, &addr, (UInt32*) &val, false, 0);
     405    val = EndianU32_BtoN(val);
    403406
    404407    if (ret != kIOReturnSuccess)
    405408        return false;
    bool DarwinFirewireDevice::UpdatePlugRegisterPrivate(  
    714717    {
    715718        return false;
    716719    }
     720    old_plug_val = EndianU32_BtoN(old_plug_val);
    717721
    718722    int old_plug_cnt = (old_plug_val >> 24) & 0x3f;
    719723    int old_fw_chan  = (old_plug_val >> 16) & 0x3f;
    bool DarwinFirewireDevice::UpdatePlugRegisterPrivate(  
    758762    new_plug_val &= ~(0x03<<14);
    759763    new_plug_val |= (new_speed & 0x03) << 14;
    760764
     765    old_plug_val = EndianU32_NtoB(old_plug_val);
     766    new_plug_val = EndianU32_NtoB(new_plug_val);
     767
    761768    return (kIOReturnSuccess == (*fw_handle)->CompareSwap(
    762769                fw_handle, dev, &addr, old_plug_val, new_plug_val, false, 0));
    763770}