require '_h2ph_pre.ph';

no warnings 'redefine';

eval("sub USBD_NORMAL_COMPLETION () { 0; }") unless defined(&USBD_NORMAL_COMPLETION);
eval("sub USBD_IN_PROGRESS () { 1; }") unless defined(&USBD_IN_PROGRESS);
eval("sub USBD_PENDING_REQUESTS () { 2; }") unless defined(&USBD_PENDING_REQUESTS);
eval("sub USBD_NOT_STARTED () { 3; }") unless defined(&USBD_NOT_STARTED);
eval("sub USBD_INVAL () { 4; }") unless defined(&USBD_INVAL);
eval("sub USBD_NOMEM () { 5; }") unless defined(&USBD_NOMEM);
eval("sub USBD_CANCELLED () { 6; }") unless defined(&USBD_CANCELLED);
eval("sub USBD_BAD_ADDRESS () { 7; }") unless defined(&USBD_BAD_ADDRESS);
eval("sub USBD_IN_USE () { 8; }") unless defined(&USBD_IN_USE);
eval("sub USBD_NO_ADDR () { 9; }") unless defined(&USBD_NO_ADDR);
eval("sub USBD_SET_ADDR_FAILED () { 10; }") unless defined(&USBD_SET_ADDR_FAILED);
eval("sub USBD_NO_POWER () { 11; }") unless defined(&USBD_NO_POWER);
eval("sub USBD_TOO_DEEP () { 12; }") unless defined(&USBD_TOO_DEEP);
eval("sub USBD_IOERROR () { 13; }") unless defined(&USBD_IOERROR);
eval("sub USBD_NOT_CONFIGURED () { 14; }") unless defined(&USBD_NOT_CONFIGURED);
eval("sub USBD_TIMEOUT () { 15; }") unless defined(&USBD_TIMEOUT);
eval("sub USBD_SHORT_XFER () { 16; }") unless defined(&USBD_SHORT_XFER);
eval("sub USBD_STALLED () { 17; }") unless defined(&USBD_STALLED);
eval("sub USBD_INTERRUPTED () { 18; }") unless defined(&USBD_INTERRUPTED);
eval("sub USBD_ERROR_MAX () { 19; }") unless defined(&USBD_ERROR_MAX);
unless(defined(&USBD_EXCLUSIVE_USE)) {
    sub USBD_EXCLUSIVE_USE () {	0x1;}
}
unless(defined(&USBD_DEFAULT_INTERVAL)) {
    sub USBD_DEFAULT_INTERVAL () {	(-1);}
}
unless(defined(&USBD_NO_COPY)) {
    sub USBD_NO_COPY () {	0x1;}
}
unless(defined(&USBD_SYNCHRONOUS)) {
    sub USBD_SYNCHRONOUS () {	0x2;}
}
unless(defined(&USBD_FORCE_SHORT_XFER)) {
    sub USBD_FORCE_SHORT_XFER () {	0x8;}
}
unless(defined(&USBD_NO_TIMEOUT)) {
    sub USBD_NO_TIMEOUT () {	0;}
}
unless(defined(&USBD_DEFAULT_TIMEOUT)) {
    sub USBD_DEFAULT_TIMEOUT () {	5000;}
}
if(defined( &__FreeBSD__)) {
    eval 'sub USB_CDEV_MAJOR () {108;}' unless defined(&USB_CDEV_MAJOR);
}
unless(defined(&DEVINFOSIZE)) {
    sub DEVINFOSIZE () {	1024;}
}
unless(defined(&usb_init_task)) {
    sub usb_init_task {
	my($t, $f, $a) = @_;
	eval q((($t)-> &fun = ($f), ($t)-> &arg = ($a), ($t)-> &onqueue = 0));
    }
}
unless(defined(&usb_lookup)) {
    sub usb_lookup {
	my($tbl, $vendor, $product) = @_;
	eval q( &usb_match_device(( &const 'struct usb_devno' *)($tbl), $sizeof{$tbl} / $sizeof{($tbl)[0]}, $sizeof{($tbl)[0]}, ($vendor), ($product)));
    }
}
unless(defined(&USB_PRODUCT_ANY)) {
    sub USB_PRODUCT_ANY () {	0xffff;}
}
if(defined( &__NetBSD__) || defined( &__OpenBSD__)) {
    eval 'sub UMATCH_VENDOR_PRODUCT_REV () {14;}' unless defined(&UMATCH_VENDOR_PRODUCT_REV);
    eval 'sub UMATCH_VENDOR_PRODUCT () {13;}' unless defined(&UMATCH_VENDOR_PRODUCT);
    eval 'sub UMATCH_VENDOR_DEVCLASS_DEVPROTO () {12;}' unless defined(&UMATCH_VENDOR_DEVCLASS_DEVPROTO);
    eval 'sub UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO () {11;}' unless defined(&UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO);
    eval 'sub UMATCH_DEVCLASS_DEVSUBCLASS () {10;}' unless defined(&UMATCH_DEVCLASS_DEVSUBCLASS);
    eval 'sub UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE () {9;}' unless defined(&UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE);
    eval 'sub UMATCH_VENDOR_PRODUCT_CONF_IFACE () {8;}' unless defined(&UMATCH_VENDOR_PRODUCT_CONF_IFACE);
    eval 'sub UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO () {7;}' unless defined(&UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO);
    eval 'sub UMATCH_VENDOR_IFACESUBCLASS () {6;}' unless defined(&UMATCH_VENDOR_IFACESUBCLASS);
    eval 'sub UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO () {5;}' unless defined(&UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
    eval 'sub UMATCH_IFACECLASS_IFACESUBCLASS () {4;}' unless defined(&UMATCH_IFACECLASS_IFACESUBCLASS);
    eval 'sub UMATCH_IFACECLASS () {3;}' unless defined(&UMATCH_IFACECLASS);
    eval 'sub UMATCH_IFACECLASS_GENERIC () {2;}' unless defined(&UMATCH_IFACECLASS_GENERIC);
    eval 'sub UMATCH_GENERIC () {1;}' unless defined(&UMATCH_GENERIC);
    eval 'sub UMATCH_NONE () {0;}' unless defined(&UMATCH_NONE);
}
 elsif(defined( &__FreeBSD__)) {
    eval 'sub UMATCH_VENDOR_PRODUCT_REV () {(-10);}' unless defined(&UMATCH_VENDOR_PRODUCT_REV);
    eval 'sub UMATCH_VENDOR_PRODUCT () {(-20);}' unless defined(&UMATCH_VENDOR_PRODUCT);
    eval 'sub UMATCH_VENDOR_DEVCLASS_DEVPROTO () {(-30);}' unless defined(&UMATCH_VENDOR_DEVCLASS_DEVPROTO);
    eval 'sub UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO () {(-40);}' unless defined(&UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO);
    eval 'sub UMATCH_DEVCLASS_DEVSUBCLASS () {(-50);}' unless defined(&UMATCH_DEVCLASS_DEVSUBCLASS);
    eval 'sub UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE () {(-60);}' unless defined(&UMATCH_VENDOR_PRODUCT_REV_CONF_IFACE);
    eval 'sub UMATCH_VENDOR_PRODUCT_CONF_IFACE () {(-70);}' unless defined(&UMATCH_VENDOR_PRODUCT_CONF_IFACE);
    eval 'sub UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO () {(-80);}' unless defined(&UMATCH_VENDOR_IFACESUBCLASS_IFACEPROTO);
    eval 'sub UMATCH_VENDOR_IFACESUBCLASS () {(-90);}' unless defined(&UMATCH_VENDOR_IFACESUBCLASS);
    eval 'sub UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO () {(-100);}' unless defined(&UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
    eval 'sub UMATCH_IFACECLASS_IFACESUBCLASS () {(-110);}' unless defined(&UMATCH_IFACECLASS_IFACESUBCLASS);
    eval 'sub UMATCH_IFACECLASS () {(-120);}' unless defined(&UMATCH_IFACECLASS);
    eval 'sub UMATCH_IFACECLASS_GENERIC () {(-130);}' unless defined(&UMATCH_IFACECLASS_GENERIC);
    eval 'sub UMATCH_GENERIC () {(-140);}' unless defined(&UMATCH_GENERIC);
    eval 'sub UMATCH_NONE () {( &ENXIO);}' unless defined(&UMATCH_NONE);
}
if(defined( &__FreeBSD__)) {
}
if(defined(&USB_USE_SOFTINTR)) {
    if(defined(&__HAVE_GENERIC_SOFT_INTERRUPTS)) {
	eval 'sub splusb () { &splsoftnet;}' unless defined(&splusb);
    } else {
	eval 'sub splusb () { &splsoftclock;}' unless defined(&splusb);
    }
} else {
    eval 'sub splusb () { &splbio;}' unless defined(&splusb);
}
unless(defined(&splhardusb)) {
    sub splhardusb () {	 &splbio;}
}
unless(defined(&IPL_USB)) {
    sub IPL_USB () {	 &IPL_BIO;}
}
1;
