require '_h2ph_pre.ph';

unless(defined(&__ISDN_H__)) {
    eval 'sub __ISDN_H__ () {1;}' unless defined(&__ISDN_H__);
    require 'linux/ioctl.ph';
    if(defined(&CONFIG_COBALT_MICRO_SERVER)) {
	eval 'sub ISDN_MAX_DRIVERS () {2;}' unless defined(&ISDN_MAX_DRIVERS);
	eval 'sub ISDN_MAX_CHANNELS () {8;}' unless defined(&ISDN_MAX_CHANNELS);
    } else {
	eval 'sub ISDN_MAX_DRIVERS () {32;}' unless defined(&ISDN_MAX_DRIVERS);
	eval 'sub ISDN_MAX_CHANNELS () {64;}' unless defined(&ISDN_MAX_CHANNELS);
    }
    eval 'sub IIOCNETAIF () { &_IO(ord(\'I\'),1);}' unless defined(&IIOCNETAIF);
    eval 'sub IIOCNETDIF () { &_IO(ord(\'I\'),2);}' unless defined(&IIOCNETDIF);
    eval 'sub IIOCNETSCF () { &_IO(ord(\'I\'),3);}' unless defined(&IIOCNETSCF);
    eval 'sub IIOCNETGCF () { &_IO(ord(\'I\'),4);}' unless defined(&IIOCNETGCF);
    eval 'sub IIOCNETANM () { &_IO(ord(\'I\'),5);}' unless defined(&IIOCNETANM);
    eval 'sub IIOCNETDNM () { &_IO(ord(\'I\'),6);}' unless defined(&IIOCNETDNM);
    eval 'sub IIOCNETGNM () { &_IO(ord(\'I\'),7);}' unless defined(&IIOCNETGNM);
    eval 'sub IIOCGETSET () { &_IO(ord(\'I\'),8);}' unless defined(&IIOCGETSET);
    eval 'sub IIOCSETSET () { &_IO(ord(\'I\'),9);}' unless defined(&IIOCSETSET);
    eval 'sub IIOCSETVER () { &_IO(ord(\'I\'),10);}' unless defined(&IIOCSETVER);
    eval 'sub IIOCNETHUP () { &_IO(ord(\'I\'),11);}' unless defined(&IIOCNETHUP);
    eval 'sub IIOCSETGST () { &_IO(ord(\'I\'),12);}' unless defined(&IIOCSETGST);
    eval 'sub IIOCSETBRJ () { &_IO(ord(\'I\'),13);}' unless defined(&IIOCSETBRJ);
    eval 'sub IIOCSIGPRF () { &_IO(ord(\'I\'),14);}' unless defined(&IIOCSIGPRF);
    eval 'sub IIOCGETPRF () { &_IO(ord(\'I\'),15);}' unless defined(&IIOCGETPRF);
    eval 'sub IIOCSETPRF () { &_IO(ord(\'I\'),16);}' unless defined(&IIOCSETPRF);
    eval 'sub IIOCGETMAP () { &_IO(ord(\'I\'),17);}' unless defined(&IIOCGETMAP);
    eval 'sub IIOCSETMAP () { &_IO(ord(\'I\'),18);}' unless defined(&IIOCSETMAP);
    eval 'sub IIOCNETASL () { &_IO(ord(\'I\'),19);}' unless defined(&IIOCNETASL);
    eval 'sub IIOCNETDIL () { &_IO(ord(\'I\'),20);}' unless defined(&IIOCNETDIL);
    eval 'sub IIOCGETCPS () { &_IO(ord(\'I\'),21);}' unless defined(&IIOCGETCPS);
    eval 'sub IIOCGETDVR () { &_IO(ord(\'I\'),22);}' unless defined(&IIOCGETDVR);
    eval 'sub IIOCNETLCR () { &_IO(ord(\'I\'),23);}' unless defined(&IIOCNETLCR);
    eval 'sub IIOCNETDWRSET () { &_IO(ord(\'I\'),24);}' unless defined(&IIOCNETDWRSET);
    eval 'sub IIOCNETALN () { &_IO(ord(\'I\'),32);}' unless defined(&IIOCNETALN);
    eval 'sub IIOCNETDLN () { &_IO(ord(\'I\'),33);}' unless defined(&IIOCNETDLN);
    eval 'sub IIOCNETGPN () { &_IO(ord(\'I\'),34);}' unless defined(&IIOCNETGPN);
    eval 'sub IIOCDBGVAR () { &_IO(ord(\'I\'),127);}' unless defined(&IIOCDBGVAR);
    eval 'sub IIOCDRVCTL () { &_IO(ord(\'I\'),128);}' unless defined(&IIOCDRVCTL);
    eval 'sub SIOCGKEEPPERIOD () {( &SIOCDEVPRIVATE + 0);}' unless defined(&SIOCGKEEPPERIOD);
    eval 'sub SIOCSKEEPPERIOD () {( &SIOCDEVPRIVATE + 1);}' unless defined(&SIOCSKEEPPERIOD);
    eval 'sub SIOCGDEBSERINT () {( &SIOCDEVPRIVATE + 2);}' unless defined(&SIOCGDEBSERINT);
    eval 'sub SIOCSDEBSERINT () {( &SIOCDEVPRIVATE + 3);}' unless defined(&SIOCSDEBSERINT);
    eval 'sub ISDN_NET_ENCAP_ETHER () {0;}' unless defined(&ISDN_NET_ENCAP_ETHER);
    eval 'sub ISDN_NET_ENCAP_RAWIP () {1;}' unless defined(&ISDN_NET_ENCAP_RAWIP);
    eval 'sub ISDN_NET_ENCAP_IPTYP () {2;}' unless defined(&ISDN_NET_ENCAP_IPTYP);
    eval 'sub ISDN_NET_ENCAP_CISCOHDLC () {3;}' unless defined(&ISDN_NET_ENCAP_CISCOHDLC);
    eval 'sub ISDN_NET_ENCAP_SYNCPPP () {4;}' unless defined(&ISDN_NET_ENCAP_SYNCPPP);
    eval 'sub ISDN_NET_ENCAP_UIHDLC () {5;}' unless defined(&ISDN_NET_ENCAP_UIHDLC);
    eval 'sub ISDN_NET_ENCAP_CISCOHDLCK () {6;}' unless defined(&ISDN_NET_ENCAP_CISCOHDLCK);
    eval 'sub ISDN_NET_ENCAP_X25IFACE () {7;}' unless defined(&ISDN_NET_ENCAP_X25IFACE);
    eval 'sub ISDN_NET_ENCAP_MAX_ENCAP () { &ISDN_NET_ENCAP_X25IFACE;}' unless defined(&ISDN_NET_ENCAP_MAX_ENCAP);
    eval 'sub ISDN_USAGE_NONE () {0;}' unless defined(&ISDN_USAGE_NONE);
    eval 'sub ISDN_USAGE_RAW () {1;}' unless defined(&ISDN_USAGE_RAW);
    eval 'sub ISDN_USAGE_MODEM () {2;}' unless defined(&ISDN_USAGE_MODEM);
    eval 'sub ISDN_USAGE_NET () {3;}' unless defined(&ISDN_USAGE_NET);
    eval 'sub ISDN_USAGE_VOICE () {4;}' unless defined(&ISDN_USAGE_VOICE);
    eval 'sub ISDN_USAGE_FAX () {5;}' unless defined(&ISDN_USAGE_FAX);
    eval 'sub ISDN_USAGE_MASK () {7;}' unless defined(&ISDN_USAGE_MASK);
    eval 'sub ISDN_USAGE_DISABLED () {32;}' unless defined(&ISDN_USAGE_DISABLED);
    eval 'sub ISDN_USAGE_EXCLUSIVE () {64;}' unless defined(&ISDN_USAGE_EXCLUSIVE);
    eval 'sub ISDN_USAGE_OUTGOING () {128;}' unless defined(&ISDN_USAGE_OUTGOING);
    eval 'sub ISDN_MODEM_NUMREG () {24;}' unless defined(&ISDN_MODEM_NUMREG);
    eval 'sub ISDN_LMSNLEN () {255;}' unless defined(&ISDN_LMSNLEN);
    eval 'sub ISDN_CMSGLEN () {50;}' unless defined(&ISDN_CMSGLEN);
    eval 'sub ISDN_MSNLEN () {32;}' unless defined(&ISDN_MSNLEN);
    eval 'sub NET_DV () {0x6;}' unless defined(&NET_DV);
    eval 'sub TTY_DV () {0x6;}' unless defined(&TTY_DV);
    eval 'sub INF_DV () {0x1;}' unless defined(&INF_DV);
    eval 'sub ISDN_NET_DIALMODE_MASK () {0xc0;}' unless defined(&ISDN_NET_DIALMODE_MASK);
    eval 'sub ISDN_NET_DM_OFF () {0x;}' unless defined(&ISDN_NET_DM_OFF);
    eval 'sub ISDN_NET_DM_MANUAL () {0x40;}' unless defined(&ISDN_NET_DM_MANUAL);
    eval 'sub ISDN_NET_DM_AUTO () {0x80;}' unless defined(&ISDN_NET_DM_AUTO);
    eval 'sub ISDN_NET_DIALMODE {
        local($x) = @_;
	    eval q(((($x))-> &flags &  &ISDN_NET_DIALMODE_MASK));
    }' unless defined(&ISDN_NET_DIALMODE);
}
1;
