require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_PCI_UHCIREG_H_)) {
    eval 'sub _DEV_PCI_UHCIREG_H_ () {1;}' unless defined(&_DEV_PCI_UHCIREG_H_);
    eval 'sub PCI_USBREV () {0x60;}' unless defined(&PCI_USBREV);
    eval 'sub PCI_USBREV_MASK () {0xff;}' unless defined(&PCI_USBREV_MASK);
    eval 'sub PCI_USBREV_PRE_1_0 () {0x;}' unless defined(&PCI_USBREV_PRE_1_0);
    eval 'sub PCI_USBREV_1_0 () {0x10;}' unless defined(&PCI_USBREV_1_0);
    eval 'sub PCI_USBREV_1_1 () {0x11;}' unless defined(&PCI_USBREV_1_1);
    eval 'sub PCI_LEGSUP () {0xc0;}' unless defined(&PCI_LEGSUP);
    eval 'sub PCI_LEGSUP_USBPIRQDEN () {0x2000;}' unless defined(&PCI_LEGSUP_USBPIRQDEN);
    eval 'sub PCI_CBIO () {0x20;}' unless defined(&PCI_CBIO);
    eval 'sub PCI_INTERFACE_UHCI () {0x;}' unless defined(&PCI_INTERFACE_UHCI);
    eval 'sub UHCI_CMD () {0x;}' unless defined(&UHCI_CMD);
    eval 'sub UHCI_CMD_RS () {0x1;}' unless defined(&UHCI_CMD_RS);
    eval 'sub UHCI_CMD_HCRESET () {0x2;}' unless defined(&UHCI_CMD_HCRESET);
    eval 'sub UHCI_CMD_GRESET () {0x4;}' unless defined(&UHCI_CMD_GRESET);
    eval 'sub UHCI_CMD_EGSM () {0x8;}' unless defined(&UHCI_CMD_EGSM);
    eval 'sub UHCI_CMD_FGR () {0x10;}' unless defined(&UHCI_CMD_FGR);
    eval 'sub UHCI_CMD_SWDBG () {0x20;}' unless defined(&UHCI_CMD_SWDBG);
    eval 'sub UHCI_CMD_CF () {0x40;}' unless defined(&UHCI_CMD_CF);
    eval 'sub UHCI_CMD_MAXP () {0x80;}' unless defined(&UHCI_CMD_MAXP);
    eval 'sub UHCI_STS () {0x2;}' unless defined(&UHCI_STS);
    eval 'sub UHCI_STS_USBINT () {0x1;}' unless defined(&UHCI_STS_USBINT);
    eval 'sub UHCI_STS_USBEI () {0x2;}' unless defined(&UHCI_STS_USBEI);
    eval 'sub UHCI_STS_RD () {0x4;}' unless defined(&UHCI_STS_RD);
    eval 'sub UHCI_STS_HSE () {0x8;}' unless defined(&UHCI_STS_HSE);
    eval 'sub UHCI_STS_HCPE () {0x10;}' unless defined(&UHCI_STS_HCPE);
    eval 'sub UHCI_STS_HCH () {0x20;}' unless defined(&UHCI_STS_HCH);
    eval 'sub UHCI_STS_ALLINTRS () {0x3f;}' unless defined(&UHCI_STS_ALLINTRS);
    eval 'sub UHCI_INTR () {0x4;}' unless defined(&UHCI_INTR);
    eval 'sub UHCI_INTR_TOCRCIE () {0x1;}' unless defined(&UHCI_INTR_TOCRCIE);
    eval 'sub UHCI_INTR_RIE () {0x2;}' unless defined(&UHCI_INTR_RIE);
    eval 'sub UHCI_INTR_IOCE () {0x4;}' unless defined(&UHCI_INTR_IOCE);
    eval 'sub UHCI_INTR_SPIE () {0x8;}' unless defined(&UHCI_INTR_SPIE);
    eval 'sub UHCI_FRNUM () {0x6;}' unless defined(&UHCI_FRNUM);
    eval 'sub UHCI_FRNUM_MASK () {0x3ff;}' unless defined(&UHCI_FRNUM_MASK);
    eval 'sub UHCI_FLBASEADDR () {0x8;}' unless defined(&UHCI_FLBASEADDR);
    eval 'sub UHCI_SOF () {0xc;}' unless defined(&UHCI_SOF);
    eval 'sub UHCI_SOF_MASK () {0x7f;}' unless defined(&UHCI_SOF_MASK);
    eval 'sub UHCI_PORTSC1 () {0x10;}' unless defined(&UHCI_PORTSC1);
    eval 'sub UHCI_PORTSC2 () {0x12;}' unless defined(&UHCI_PORTSC2);
    eval 'sub UHCI_PORTSC_CCS () {0x1;}' unless defined(&UHCI_PORTSC_CCS);
    eval 'sub UHCI_PORTSC_CSC () {0x2;}' unless defined(&UHCI_PORTSC_CSC);
    eval 'sub UHCI_PORTSC_PE () {0x4;}' unless defined(&UHCI_PORTSC_PE);
    eval 'sub UHCI_PORTSC_POEDC () {0x8;}' unless defined(&UHCI_PORTSC_POEDC);
    eval 'sub UHCI_PORTSC_LS () {0x30;}' unless defined(&UHCI_PORTSC_LS);
    eval 'sub UHCI_PORTSC_LS_SHIFT () {4;}' unless defined(&UHCI_PORTSC_LS_SHIFT);
    eval 'sub UHCI_PORTSC_RD () {0x40;}' unless defined(&UHCI_PORTSC_RD);
    eval 'sub UHCI_PORTSC_LSDA () {0x100;}' unless defined(&UHCI_PORTSC_LSDA);
    eval 'sub UHCI_PORTSC_PR () {0x200;}' unless defined(&UHCI_PORTSC_PR);
    eval 'sub UHCI_PORTSC_OCI () {0x400;}' unless defined(&UHCI_PORTSC_OCI);
    eval 'sub UHCI_PORTSC_OCIC () {0x800;}' unless defined(&UHCI_PORTSC_OCIC);
    eval 'sub UHCI_PORTSC_SUSP () {0x1000;}' unless defined(&UHCI_PORTSC_SUSP);
    eval 'sub URWMASK {
        my($x) = @_;
	    eval q((($x) & ( &UHCI_PORTSC_SUSP |  &UHCI_PORTSC_PR |  &UHCI_PORTSC_RD |  &UHCI_PORTSC_PE)));
    }' unless defined(&URWMASK);
    eval 'sub UHCI_FRAMELIST_COUNT () {1024;}' unless defined(&UHCI_FRAMELIST_COUNT);
    eval 'sub UHCI_FRAMELIST_ALIGN () {4096;}' unless defined(&UHCI_FRAMELIST_ALIGN);
    eval 'sub UHCI_TD_ALIGN () {16;}' unless defined(&UHCI_TD_ALIGN);
    eval 'sub UHCI_QH_ALIGN () {16;}' unless defined(&UHCI_QH_ALIGN);
    eval 'sub UHCI_PTR_T () {0x1;}' unless defined(&UHCI_PTR_T);
    eval 'sub UHCI_PTR_TD () {0x;}' unless defined(&UHCI_PTR_TD);
    eval 'sub UHCI_PTR_QH () {0x2;}' unless defined(&UHCI_PTR_QH);
    eval 'sub UHCI_PTR_VF () {0x4;}' unless defined(&UHCI_PTR_VF);
    eval 'sub UHCI_QH_REMOVE_DELAY () {5;}' unless defined(&UHCI_QH_REMOVE_DELAY);
    eval 'sub UHCI_TD_GET_ACTLEN {
        my($s) = @_;
	    eval q(((($s) + 1) & 0x3ff));
    }' unless defined(&UHCI_TD_GET_ACTLEN);
    eval 'sub UHCI_TD_ZERO_ACTLEN {
        my($t) = @_;
	    eval q((($t) | 0x3ff));
    }' unless defined(&UHCI_TD_ZERO_ACTLEN);
    eval 'sub UHCI_TD_BITSTUFF () {0x20000;}' unless defined(&UHCI_TD_BITSTUFF);
    eval 'sub UHCI_TD_CRCTO () {0x40000;}' unless defined(&UHCI_TD_CRCTO);
    eval 'sub UHCI_TD_NAK () {0x80000;}' unless defined(&UHCI_TD_NAK);
    eval 'sub UHCI_TD_BABBLE () {0x100000;}' unless defined(&UHCI_TD_BABBLE);
    eval 'sub UHCI_TD_DBUFFER () {0x200000;}' unless defined(&UHCI_TD_DBUFFER);
    eval 'sub UHCI_TD_STALLED () {0x400000;}' unless defined(&UHCI_TD_STALLED);
    eval 'sub UHCI_TD_ACTIVE () {0x800000;}' unless defined(&UHCI_TD_ACTIVE);
    eval 'sub UHCI_TD_IOC () {0x1000000;}' unless defined(&UHCI_TD_IOC);
    eval 'sub UHCI_TD_IOS () {0x2000000;}' unless defined(&UHCI_TD_IOS);
    eval 'sub UHCI_TD_LS () {0x4000000;}' unless defined(&UHCI_TD_LS);
    eval 'sub UHCI_TD_GET_ERRCNT {
        my($s) = @_;
	    eval q(((($s) >> 27) & 3));
    }' unless defined(&UHCI_TD_GET_ERRCNT);
    eval 'sub UHCI_TD_SET_ERRCNT {
        my($n) = @_;
	    eval q((($n) << 27));
    }' unless defined(&UHCI_TD_SET_ERRCNT);
    eval 'sub UHCI_TD_SPD () {0x20000000;}' unless defined(&UHCI_TD_SPD);
    eval 'sub UHCI_TD_PID_IN () {0x69;}' unless defined(&UHCI_TD_PID_IN);
    eval 'sub UHCI_TD_PID_OUT () {0xe1;}' unless defined(&UHCI_TD_PID_OUT);
    eval 'sub UHCI_TD_PID_SETUP () {0x2d;}' unless defined(&UHCI_TD_PID_SETUP);
    eval 'sub UHCI_TD_GET_PID {
        my($s) = @_;
	    eval q((($s) & 0xff));
    }' unless defined(&UHCI_TD_GET_PID);
    eval 'sub UHCI_TD_SET_DEVADDR {
        my($a) = @_;
	    eval q((($a) << 8));
    }' unless defined(&UHCI_TD_SET_DEVADDR);
    eval 'sub UHCI_TD_GET_DEVADDR {
        my($s) = @_;
	    eval q(((($s) >> 8) & 0x7f));
    }' unless defined(&UHCI_TD_GET_DEVADDR);
    eval 'sub UHCI_TD_SET_ENDPT {
        my($e) = @_;
	    eval q(((($e)&0xf) << 15));
    }' unless defined(&UHCI_TD_SET_ENDPT);
    eval 'sub UHCI_TD_GET_ENDPT {
        my($s) = @_;
	    eval q(((($s) >> 15) & 0xf));
    }' unless defined(&UHCI_TD_GET_ENDPT);
    eval 'sub UHCI_TD_SET_DT {
        my($t) = @_;
	    eval q((($t) << 19));
    }' unless defined(&UHCI_TD_SET_DT);
    eval 'sub UHCI_TD_GET_DT {
        my($s) = @_;
	    eval q(((($s) >> 19) & 1));
    }' unless defined(&UHCI_TD_GET_DT);
    eval 'sub UHCI_TD_SET_MAXLEN {
        my($l) = @_;
	    eval q(((($l)-1) << 21));
    }' unless defined(&UHCI_TD_SET_MAXLEN);
    eval 'sub UHCI_TD_GET_MAXLEN {
        my($s) = @_;
	    eval q((((($s) >> 21) + 1) & 0x7ff));
    }' unless defined(&UHCI_TD_GET_MAXLEN);
    eval 'sub UHCI_TD_MAXLEN_MASK () {0xffe00000;}' unless defined(&UHCI_TD_MAXLEN_MASK);
    eval 'sub UHCI_TD_ERROR () {( &UHCI_TD_BITSTUFF| &UHCI_TD_CRCTO| &UHCI_TD_BABBLE| &UHCI_TD_DBUFFER| &UHCI_TD_STALLED);}' unless defined(&UHCI_TD_ERROR);
    eval 'sub UHCI_TD_SETUP {
        my($len, $endp, $dev) = @_;
	    eval q(( &UHCI_TD_SET_MAXLEN($len) |  &UHCI_TD_SET_ENDPT($endp) |  &UHCI_TD_SET_DEVADDR($dev) |  &UHCI_TD_PID_SETUP));
    }' unless defined(&UHCI_TD_SETUP);
    eval 'sub UHCI_TD_OUT {
        my($len, $endp, $dev, $dt) = @_;
	    eval q(( &UHCI_TD_SET_MAXLEN($len) |  &UHCI_TD_SET_ENDPT($endp) |  &UHCI_TD_SET_DEVADDR($dev) |  &UHCI_TD_PID_OUT |  &UHCI_TD_SET_DT($dt)));
    }' unless defined(&UHCI_TD_OUT);
    eval 'sub UHCI_TD_IN {
        my($len, $endp, $dev, $dt) = @_;
	    eval q(( &UHCI_TD_SET_MAXLEN($len) |  &UHCI_TD_SET_ENDPT($endp) |  &UHCI_TD_SET_DEVADDR($dev) |  &UHCI_TD_PID_IN |  &UHCI_TD_SET_DT($dt)));
    }' unless defined(&UHCI_TD_IN);
}
1;
