the hardware related to this driver can be found * at our website: http://www.quicknet.net * * Fixes: * * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET * TECHNOLOGIES, INC.HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * *****************************************************************************/ #include /****************************************************************************** * * IOCTL's used for the Quicknet Telephony Cards * * If you use the IXJCTL_TESTRAM command, the card must be power cycled to * reset the SRAM values before futher use. * ******************************************************************************/ #define IXJCTL_DSP_RESET _IO ('q', 0xC0) #define IXJCTL_RING PHONE_RING #define IXJCTL_HOOKSTATE PHONE_HOOKSTATE #define IXJCTL_MAXRINGS PHONE_MAXRINGS #define IXJCTL_RING_CADENCE PHONE_RING_CADENCE #define IXJCTL_RING_START PHONE_RING_START #define IXJCTL_RING_STOP PHONE_RING_STOP #define IXJCTL_CARDTYPE _IOR ('q', 0xC1, int) #define IXJCTL_SERIAL _IOR ('q', 0xC2, int) #define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int) #define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int) #define IXJCTL_VERSION _IOR ('q', 0xDA, char *) #define IXJCTL_DSP_IDLE _IO ('q', 0xC5) #define IXJCTL_TESTRAM _IO ('q', 0xC6) /****************************************************************************** * * This group of IOCTLs deal with the record settings of the DSP * * The IXJCTL_REC_DEPTH command sets the internal buffer depth of the DSP. * Setting a lower depth reduces latency, but increases the demand of the * application to service the driver without frame loss. The DSP has 480 * bytes of physical buffer memory for the record channel so the true * maximum limit is determined by how many frames will fit in the buffer. * * 1 uncompressed (480 byte) 16-bit linear frame. * 2 uncompressed (240 byte) 8-bit A-law/mu-law frames. * 15 TrueSpeech 8.5 frames. * 20 TrueSpeech 6.3,5.3,4.8 or 4.1 frames. * * The default in the driver is currently set to 2 frames. * * The IXJCTL_REC_VOLUME and IXJCTL_PLAY_VOLUME commands both use a Q8 * number as a parameter, 0x100 scales the signal by 1.0, 0x200 scales the * signal by 2.0, 0x80 scales the signal by 0.5. No protection is given * against over-scaling, if the multiplication factor times the input * signal exceeds 16 bits, overflow distortion will occur. The default * setting is 0x100 (1.0). * * The IXJCTL_REC_LEVEL returns the average signal level (not r.m.s.) on * the most recently recorded frame as a 16 bit value. ******************************************************************************/ #define IXJCTL_REC_CODEC PHONE_REC_CODEC #define IXJCTL_REC_START PHONE_REC_START #define IXJCTL_REC_STOP PHONE_REC_STOP #define IXJCTL_REC_DEPTH PHONE_REC_DEPTH #define IXJCTL_FRAME PHONE_FRAME #define IXJCTL_REC_VOLUME PHONE_REC_VOLUME #define IXJCTL_REC_LEVEL PHONE_REC_LEVEL typedef enum { f300_640 = 4, f300_500, f1100, f350, f400, f480, f440, f620, f20_50, f133_200, f300, f300_420, f330, f300_425, f330_440, f340, f350_400, f350_440, f350_450, f360, f380_420, f392, f400_425, f400_440, f400_450, f420, f425, f425_450, f425_475, f435, f440_450, f440_480, f445, f450, f452, f475, f480_620, f494, f500, f520, f523, f525, f540_660, f587, f590, f600, f660, f700, f740, f750, f750_1450, f770, f800, f816, f850, f857_1645, f900, f900_1300, f935_1215, f941_1477, f942, f950, f950_1400, f975, f1000, f1020, f1050, f1100_1750, f1140, f1200, f1209, f1330, f1336, lf1366, f1380, f1400, f1477, f1600, f1633_1638, f1800, f1860 } IXJ_FILTER_FREQ; typedef struct { unsigned int filter; IXJ_FILTER_FREQ freq; char enable; } IXJ_FILTER; typedef struct { char enable; char en_filter; unsigned int filter; unsigned int on1; unsigned int off1; unsigned int on2; unsigned int off2; unsigned int on3; unsigned int off3; } IXJ_FILTER_CADENCE; #define IXJCTL_SET_FILTER _IOW ('q', 0xC7, IXJ_FILTER *) #define IXJCTL_SET_FILTER_RAW _IOW ('q', 0xDD, IXJ_FILTER_RAW *) #define IXJCTL_GET_FILTER_HIST _IOW ('q', 0xC8, int) #define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *) #define IXJCTL_PLAY_CID _IO ('q', 0xD7) /****************************************************************************** * * This IOCTL allows you to reassign values in the tone index table. The * tone table has 32 entries (0 - 31), but the driver only allows entries * 13 - 27 to be modified, entry 0 is reserved for silence and 1 - 12 are * the standard DTMF digits and 28 - 31 are the DTMF tones for A, B, C & D. * The positions used internally for Call Progress Tones are as follows: * Dial Tone - 25 * Ring Back - 26 * Busy Signal - 27 * * The freq values are calculated as: * freq = cos(2 * PI * frequency / 8000) * * The most commonly needed values are already calculated and listed in the * enum IXJ_TONE_FREQ. Each tone index can have two frequencies with * different gains, if you are only using a single frequency set the unused * one to 0. * * The gain values range from 0 to 15 indicating +6dB to -24dB in 2dB * increments. * ******************************************************************************/ typedef enum { hz20 = 0x7ffa, hz50 = 0x7fe5, hz133 = 0x7f4c, hz200 = 0x7e6b, hz261 = 0x7d50, /* .63 C1 */ hz277 = 0x7cfa, /* .18 CS1 */ hz293 = 0x7c9f, /* .66 D1 */ hz300 = 0x7c75, hz311 = 0x7c32, /* .13 DS1 */ hz329 = 0x7bbf, /* .63 E1 */ hz330 = 0x7bb8, hz340 = 0x7b75, hz349 = 0x7b37, /* .23 F1 */ hz350 = 0x7b30, hz360 = 0x7ae9, hz369 = 0x7aa8, /* .99 FS1 */ hz380 = 0x7a56, hz392 = 0x79fa, /* .00 G1 */ hz400 = 0x79bb, hz415 = 0x7941, /* .30 GS1 */ hz420 = 0x7918, hz425 = 0x78ee, hz435 = 0x7899, hz440 = 0x786d, /* .00 A1 */ hz445 = 0x7842, hz450 = 0x7815, hz452 = 0x7803, hz466 = 0x7784, /* .16 AS1 */ hz475 = 0x7731, hz480 = 0x7701, hz493 = 0x7685, /* .88 B1 */ hz494 = 0x767b, hz500 = 0x7640, hz520 = 0x7578, hz523 = 0x7559, /* .25 C2 */ hz525 = 0x7544, hz540 = 0x74a7, hz554 = 0x7411, /* .37 CS2 */ hz587 = 0x72a1, /* .33 D2 */ hz590 = 0x727f, hz600 = 0x720b, hz620 = 0x711e, hz622 = 0x7106, /* .25 DS2 */ hz659 = 0x6f3b, /* .26 E2 */ hz660 = 0x6f2e, hz698 = 0x6d3d, /* .46 F2 */ hz700 = 0x6d22, hz739 = 0x6b09, /* .99 FS2 */ hz740 = 0x6afa, hz750 = 0x6a6c, hz770 = 0x694b, hz783 = 0x688b, /* .99 G2 */ hz800 = 0x678d, hz816 = 0x6698, hz830 = 0x65bf, /* .61 GS2 */ hz850 = 0x6484, hz857 = 0x6414, hz880 = 0x629f, /* .00 A2 */ hz900 = 0x6154, hz932 = 0x5f35, /* .33 AS2 */ hz935 = 0x5f01, hz941 = 0x5e9a, hz942 = 0x5e88, hz950 = 0x5dfd, hz975 = 0x5c44, hz1000 = 0x5a81, hz1020 = 0x5912, hz1050 = 0x56e2, hz1100 = 0x5320, hz1140 = 0x5007, hz1200 = 0x4b3b, hz1209 = 0x4a80, hz1215 = 0x4a02, hz1250 = 0x471c, hz1300 = 0x42e0, hz1330 = 0x4049, hz1336 = 0x3fc4, hz1366 = 0x3d22, hz1380 = 0x3be4, hz1400 = 0x3a1b, hz1450 = 0x3596, hz1477 = 0x331c, hz1500 = 0x30fb, hz1600 = 0x278d, hz1633 = 0x2462, hz1638 = 0x23e7, hz1645 = 0x233a, hz1750 = 0x18f8, hz1800 = 0x1405, hz1860 = 0xe0b, hz2100 = 0xf5f6, hz2130 = 0xf2f5, hz2450 = 0xd3b3, hz2750 = 0xb8e4 } IXJ_FREQ; typedef enum { C1 = hz261, CS1 = hz277, D1 = hz293, DS1 = hz311, E1 = hz329, F1 = hz349, FS1 = hz369, G1 = hz392, GS1 = hz415, A1 = hz440, AS1 = hz466, B1 = hz493, C2 = hz523, CS2 = hz554, D2 = hz587, DS2 = hz622, E2 = hz659, F2 = hz698, FS2 = hz739, G2 = hz783, GS2 = hz830, A2 = hz880, AS2 = hz932, } IXJ_NOTE; typedef struct { int tone_index; int freq0; int gain0; int freq1; int gain1; } IXJ_TONE; #define IXJCTL_INIT_TONE _IOW ('q', 0xC9, IXJ_TONE *) /****************************************************************************** * * The IXJCTL_TONE_CADENCE ioctl defines tone sequences used for various * Call Progress Tones (CPT). This is accomplished by setting up an array of * IXJ_CADENCE_ELEMENT structures that sequentially define the states of * the tone sequence. The tone_on_time and tone_off time are in * 250 microsecond intervals. A pointer to this array is passed to the * driver as the ce element of an IXJ_CADENCE structure. The elements_used * must be set to the number of IXJ_CADENCE_ELEMENTS in the array. The * termination variable defines what to do at the end of a cadence, the * options are to play the cadence once and stop, to repeat the last * element of the cadence indefinitely, or to repeat the entire cadence * indefinitely. The ce variable is a pointer to the array of IXJ_TONE * structures. If the freq0 variable is non-zero, the tone table contents * for the tone_index are updated to the frequencies and gains defined. It * should be noted that DTMF tones cannot be reassigned, so if DTMF tone * table indexes are used in a cadence the frequency and gain variables will * be ignored. * * If the array elements contain frequency parameters the driver will * initialize the needed tone table elements and begin playing the tone, * there is no preset limit on the number of elements in the cadence. If * there is more than one frequency used in the cadence, sequential elements * of different frequencies MUST use different tone table indexes. Only one * cadence can be played at a time. It is possible to build complex * cadences with multiple frequencies using 2 tone table indexes by * alternating between them. * ******************************************************************************/ typedef struct { int index; int tone_on_time; int tone_off_time; int freq0; int gain0; int freq1; int gain1; } IXJ_CADENCE_ELEMENT; typedef enum { PLAY_ONCE, REPEAT_LAST_ELEMENT, REPEAT_ALL } IXJ_CADENCE_TERM; typedef struct { int elements_used; IXJ_CADENCE_TERM termination; IXJ_CADENCE_ELEMENT *ce; } IXJ_CADENCE; #define IXJCTL_TONE_CADENCE _IOW ('q', 0xCA, IXJ_CADENCE *) /****************************************************************************** * * This group of IOCTLs deal with the playback settings of the DSP * ******************************************************************************/ #define IXJCTL_PLAY_CODEC PHONE_PLAY_CODEC #define IXJCTL_PLAY_START PHONE_PLAY_START #define IXJCTL_PLAY_STOP PHONE_PLAY_STOP #define IXJCTL_PLAY_DEPTH PHONE_PLAY_DEPTH #define IXJCTL_PLAY_VOLUME PHONE_PLAY_VOLUME #define IXJCTL_PLAY_LEVEL PHONE_PLAY_LEVEL /****************************************************************************** * * This group of IOCTLs deal with the Acoustic Echo Cancellation settings * of the DSP * * Issuing the IXJCTL_AEC_START com mand with a value of AEC_OFF has the * same effect as IXJCTL_AEC_STOP. This is to simplify slider bar * controls. IXJCTL_AEC_GET_LEVEL returns the current setting of the AEC. ******************************************************************************/ #define IXJCTL_AEC_START _IOW ('q', 0xCB, int) #define IXJCTL_AEC_STOP _IO ('q', 0xCC) #define IXJCTL_AEC_GET_LEVEL _IO ('q', 0xCD) #define AEC_OFF 0 #define AEC_LOW 1 #define AEC_MED 2 #define AEC_HIGH 3 #define AEC_AUTO 4 #define AEC_AGC 5 /****************************************************************************** * * Call Progress Tones, DTMF, etc. * IXJCTL_DTMF_OOB determines if DTMF signaling is sent as Out-Of-Band * only. If you pass a 1, DTMF is suppressed from the audio stream. * Tone on and off times are in 250 microsecond intervals so * ioctl(ixj1, IXJCTL_SET_TONE_ON_TIME, 360); * will set the tone on time of board ixj1 to 360 * 250us = 90ms * the default values of tone on and off times is 840 or 210ms ******************************************************************************/ #define IXJCTL_DTMF_READY PHONE_DTMF_READY #define IXJCTL_GET_DTMF PHONE_GET_DTMF #define IXJCTL_GET_DTMF_ASCII PHONE_GET_DTMF_ASCII #define IXJCTL_DTMF_OOB PHONE_DTMF_OOB #define IXJCTL_EXCEPTION PHONE_EXCEPTION #define IXJCTL_PLAY_TONE PHONE_PLAY_TONE #define IXJCTL_SET_TONE_ON_TIME PHONE_SET_TONE_ON_TIME #define IXJCTL_SET_TONE_OFF_TIME PHONE_SET_TONE_OFF_TIME #define IXJCTL_GET_TONE_ON_TIME PHONE_GET_TONE_ON_TIME #define IXJCTL_GET_TONE_OFF_TIME PHONE_GET_TONE_OFF_TIME #define IXJCTL_GET_TONE_STATE PHONE_GET_TONE_STATE #define IXJCTL_BUSY PHONE_BUSY #define IXJCTL_RINGBACK PHONE_RINGBACK #define IXJCTL_DIALTONE PHONE_DIALTONE #define IXJCTL_CPT_STOP PHONE_CPT_STOP /****************************************************************************** * LineJACK specific IOCTLs * * The lsb 4 bits of the LED argument represent the state of each of the 4 * LED's on the LineJACK ******************************************************************************/ #define IXJCTL_SET_LED _IOW ('q', 0xCE, int) #define IXJCTL_MIXER _IOW ('q', 0xCF, int) /****************************************************************************** * * The master volume controls use attenuation with 32 levels from 0 to -62dB * with steps of 2dB each, the defines should be OR'ed together then sent * as the parameter to the mixer command to change the mixer settings. * ******************************************************************************/ #define MIXER_MASTER_L 0x0000 #define MIXER_MASTER_R 0x0100 #define ATT00DB 0x00 #define ATT02DB 0x01 #define ATT04DB 0x02 #define ATT06DB 0x03 #define ATT08DB 0x04 #define ATT10DB 0x05 #define ATT12DB 0x06 #define ATT14DB 0x07 #define ATT16DB 0x08 #define ATT18DB 0x09 #define ATT20DB 0x0A #define ATT22DB 0x0B #define ATT24DB 0x0C #define ATT26DB 0x0D #define ATT28DB 0x0E #define ATT30DB 0x0F #define ATT32DB 0x10 #define ATT34DB 0x11 #define ATT36DB 0x12 #define ATT38DB 0x13 #define ATT40DB 0x14 #define ATT42DB 0x15 #define ATT44DB 0x16 #define ATT46DB 0x17 #define ATT48DB 0x18 #define ATT50DB 0x19 #define ATT52DB 0x1A #define ATT54DB 0x1B #define ATT56DB 0x1C #define ATT58DB 0x1D #define ATT60DB 0x1E #define ATT62DB 0x1F #define MASTER_MUTE 0x80 /****************************************************************************** * * The input volume controls use gain with 32 levels from +12dB to -50dB * with steps of 2dB each, the defines should be OR'ed together then sent * as the parameter to the mixer command to change the mixer settings. * ******************************************************************************/ #define MIXER_PORT_CD_L 0x0600 #define MIXER_PORT_CD_R 0x0700 #define MIXER_PORT_LINE_IN_L 0x0800 #define MIXER_PORT_LINE_IN_R 0x0900 #define MIXER_PORT_POTS_REC 0x0C00 #define MIXER_PORT_MIC 0x0E00 #define GAIN12DB 0x00 #define GAIN10DB 0x01 #define GAIN08DB 0x02 #define GAIN06DB 0x03 #define GAIN04DB 0x04 #define GAIN02DB 0x05 #define GAIN00DB 0x06 #define GAIN_02DB 0x07 #define GAIN_04DB 0x08 #define GAIN_06DB 0x09 #define GAIN_08DB 0x0A #define GAIN_10DB 0x0B #define GAIN_12DB 0x0C #define GAIN_14DB 0x0D #define GAIN_16DB 0x0E #define GAIN_18DB 0x0F #define GAIN_20DB 0x10 #define GAIN_22DB 0x11 #define GAIN_24DB 0x12 #define GAIN_26DB 0x13 #define GAIN_28DB 0x14 #define GAIN_30DB 0x15 #define GAIN_32DB 0x16 #define GAIN_34DB 0x17 #define GAIN_36DB 0x18 #define GAIN_38DB 0x19 #define GAIN_40DB 0x1A #define GAIN_42DB 0x1B #define GAIN_44DB 0x1C #define GAIN_46DB 0x1D #define GAIN_48DB 0x1E #define GAIN_50DB 0x1F #define INPUT_MUTE 0x80 /****************************************************************************** * * The POTS volume control use attenuation with 8 levels from 0dB to -28dB * with steps of 4dB each, the defines should be OR'ed together then sent * as the parameter to the mixer command to change the mixer settings. * ******************************************************************************/ #define MIXER_PORT_POTS_PLAY 0x0F00 #define POTS_ATT_00DB 0x00 #define POTS_ATT_04DB 0x01 #define POTS_ATT_08DB 0x02 #define POTS_ATT_12DB 0x03 #define POTS_ATT_16DB 0x04 #define POTS_ATT_20DB 0x05 #define POTS_ATT_24DB 0x06 #define POTS_ATT_28DB 0x07 #define POTS_MUTE 0x80 /****************************************************************************** * * The DAA controls the interface to the PSTN port. The driver loads the * US coefficients by default, so if you live in a different country you * need to load the set for your countries phone system. * ******************************************************************************/ #define IXJCTL_DAA_COEFF_SET _IOW ('q', 0xD0, int) #define DAA_US 1 /*PITA 8kHz */ #define DAA_UK 2 /*ISAR34 8kHz */ #define DAA_FRANCE 3 /* */ #define DAA_GERMANY 4 #define DAA_AUSTRALIA 5 #define DAA_JAPAN 6 /****************************************************************************** * * Use IXJCTL_PORT to set or query the port the card is set to. If the * argument is set to PORT_QUERY, the return value of the ioctl will * indicate which port is currently in use, otherwise it will change the * port. * ******************************************************************************/ #define IXJCTL_PORT _IOW ('q', 0xD1, int) #define PORT_QUERY 0 #define PORT_POTS 1 #define PORT_PSTN 2 #define PORT_SPEAKER 3 #define PORT_HANDSET 4 #define IXJCTL_PSTN_SET_STATE PHONE_PSTN_SET_STATE #define IXJCTL_PSTN_GET_STATE PHONE_PSTN_GET_STATE #define PSTN_ON_HOOK 0 #define PSTN_RINGING 1 #define PSTN_OFF_HOOK 2 #define PSTN_PULSE_DIAL 3 /****************************************************************************** * * The DAA Analog GAIN sets 2 parameters at one time, the receive gain (AGRR), * and the transmit gain (AGX). OR together the components and pass them * as the parameter to IXJCTL_DAA_AGAIN. The default setting is both at 0dB. * ******************************************************************************/ #define IXJCTL_DAA_AGAIN _IOW ('q', 0xD2, int) #define AGRR00DB 0x00 /* Analog gain in receive direction 0dB */ #define AGRR3_5DB 0x10 /* Analog gain in receive direction 3.5dB */ #define AGRR06DB 0x30 /* Analog gain in receive direction 6dB */ #define AGX00DB 0x00 /* Analog gain in transmit direction 0dB */ #define AGX_6DB 0x04 /* Analog gain in transmit direction -6dB */ #define AGX3_5DB 0x08 /* Analog gain in transmit direction 3.5dB */ #define AGX_2_5B 0x0C /* Analog gain in transmit direction -2.5dB */ #define IXJCTL_PSTN_LINETEST _IO ('q', 0xD3) #define IXJCTL_CID _IOR ('q', 0xD4, PHONE_CID *) #define IXJCTL_VMWI _IOR ('q', 0xD8, int) #define IXJCTL_CIDCW _IOW ('q', 0xD9, PHONE_CID *) /****************************************************************************** * * The wink duration is tunable with this ioctl. The default wink duration * is 320ms. You do not need to use this ioctl if you do not require a * different wink duration. * ******************************************************************************/ #define IXJCTL_WINK_DURATION PHONE_WINK_DURATION /****************************************************************************** * * This ioctl will connect the POTS port to the PSTN port on the LineJACK * In order for this to work properly the port selection should be set to * the PSTN port with IXJCTL_PORT prior to calling this ioctl. This will * enable conference calls between PSTN callers and network callers. * Passing a 1 to this ioctl enables the POTS<->PSTN connection while * passing a 0 turns it back off. * ******************************************************************************/ #define IXJCTL_POTS_PSTN _IOW ('q', 0xD5, int) /****************************************************************************** * * IOCTLs added by request. * * IXJCTL_HZ sets the value your Linux kernel uses for HZ as defined in * /usr/include/asm/param.h, this determines the fundamental * frequency of the clock ticks on your Linux system. The kernel * must be rebuilt if you change this value, also all modules you * use (except this one) must be recompiled. The default value * is 100, and you only need to use this IOCTL if you use some * other value. * * * IXJCTL_RATE sets the number of times per second that the driver polls * the DSP. This value cannot be larger than HZ. By * increasing both of these values, you may be able to reduce * latency because the max hang time that can exist between the * driver and the DSP will be reduced. * ******************************************************************************/ #define IXJCTL_HZ _IOW ('q', 0xE0, int) #define IXJCTL_RATE _IOW ('q', 0xE1, int) #define IXJCTL_FRAMES_READ _IOR ('q', 0xE2, unsigned long) #define IXJCTL_FRAMES_WRITTEN _IOR ('q', 0xE3, unsigned long) #define IXJCTL_READ_WAIT _IOR ('q', 0xE4, unsigned long) #define IXJCTL_WRITE_WAIT _IOR ('q', 0xE5, unsigned long) #define IXJCTL_DRYBUFFER_READ _IOR ('q', 0xE6, unsigned long) #define IXJCTL_DRYBUFFER_CLEAR _IO ('q', 0xE7) #define IXJCTL_DTMF_PRESCALE _IOW ('q', 0xE8, int) /****************************************************************************** * * This ioctl allows the user application to control what events the driver * will send signals for, and what signals it will send for which event. * By default, if signaling is enabled, all events will send SIGIO when * they occur. To disable signals for an event set the signal to 0. * ******************************************************************************/ typedef enum { SIG_DTMF_READY, SIG_HOOKSTATE, SIG_FLASH, SIG_PSTN_RING, SIG_CALLER_ID, SIG_PSTN_WINK, SIG_F0, SIG_F1, SIG_F2, SIG_F3, SIG_FC0, SIG_FC1, SIG_FC2, SIG_FC3, SIG_READ_READY = 33, SIG_WRITE_READY = 34 } IXJ_SIGEVENT; typedef struct { unsigned int event; int signal; } IXJ_SIGDEF; #define IXJCTL_SIGCTL _IOW ('q', 0xE9, IXJ_SIGDEF *) /****************************************************************************** * * These ioctls allow the user application to change the gain in the * Smart Cable of the Internet Phone Card. Sending -1 as a value will cause * return value to be the current setting. Valid values to set are 0x00 - 0x1F * * 11111 = +12 dB * 10111 = 0 dB * 00000 = -34.5 dB * * IXJCTL_SC_RXG sets the Receive gain * IXJCTL_SC_TXG sets the Transmit gain * ******************************************************************************/ #define IXJCTL_SC_RXG _IOW ('q', 0xEA, int) #define IXJCTL_SC_TXG _IOW ('q', 0xEB, int) /****************************************************************************** * * The intercom IOCTL's short the output from one card to the input of the * other and vice versa (actually done in the DSP read function). It is only * necessary to execute the IOCTL on one card, but it is necessary to have * both devices open to be able to detect hook switch changes. The record * codec and rate of each card must match the playback codec and rate of * the other card for this to work properly. * ******************************************************************************/ #define IXJCTL_INTERCOM_START _IOW ('q', 0xFD, int) #define IXJCTL_INTERCOM_STOP _IOW ('q', 0xFE, int) /****************************************************************************** * * new structure for accessing raw filter information * ******************************************************************************/ typedef struct { unsigned int filter; char enable; unsigned int coeff[19]; } IXJ_FILTER_RAW; #endif #ifndef __LINUX_KVM_PARA_H #define __LINUX_KVM_PARA_H /* * This header file provides a method for making a hypercall to the host * Architectures should define: * - kvm_hypercall0, kvm_hypercall1... * - kvm_arch_para_features * - kvm_para_available */ /* Return values for hypercalls */ #define KVM_ENOSYS 1000 #define KVM_EFAULT EFAULT #define KVM_E2BIG E2BIG #define KVM_EPERM EPERM #define KVM_HC_VAPIC_POLL_IRQ 1 #define KVM_HC_MMU_OP 2 #define KVM_HC_FEATURES 3 #define KVM_HC_PPC_MAP_MAGIC_PAGE 4 /* * hypercalls use architecture specific */ #include #endif /* __LINUX_KVM_PARA_H */ #ifndef __LINUX_PKT_CLS_H #define __LINUX_PKT_CLS_H #include #include /* I think i could have done better macros ; for now this is stolen from * some arch/mips code - jhs */ #define _TC_MAKE32(x) ((x)) #define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n)) #define _TC_MAKEMASK(v,n) (_TC_MAKE32((_TC_MAKE32(1)<<(v))-1) << _TC_MAKE32(n)) #define _TC_MAKEVALUE(v,n) (_TC_MAKE32(v) << _TC_MAKE32(n)) #define _TC_GETVALUE(v,n,m) ((_TC_MAKE32(v) & _TC_MAKE32(m)) >> _TC_MAKE32(n)) /* verdict bit breakdown * bit 0: when set -> this packet has been munged already bit 1: when set -> It is ok to munge this packet bit 2,3,4,5: Reclassify counter - sort of reverse TTL - if exceeded assume loop bit 6,7: Where this packet was last seen 0: Above the transmit example at the socket level 1: on the Ingress 2: on the Egress bit 8: when set --> Request not to classify on ingress. bits 9,10,11: redirect counter - redirect TTL. Loop avoidance * * */ #define TC_MUNGED _TC_MAKEMASK1(0) #define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED)) #define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED) #define TC_OK2MUNGE _TC_MAKEMASK1(1) #define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE)) #define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE) #define S_TC_VERD _TC_MAKE32(2) #define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD) #define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD) #define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD) #define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD)) #define S_TC_FROM _TC_MAKE32(6) #define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM) #define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM) #define V_TC_FROM(x) _TC_MAKEVALUE(x,S_TC_FROM) #define SET_TC_FROM(v,n) ((V_TC_FROM(n)) | (v & ~M_TC_FROM)) #define AT_STACK 0x0 #define AT_INGRESS 0x1 #define AT_EGRESS 0x2 #define TC_NCLS _TC_MAKEMASK1(8) #define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS)) #define CLR_TC_NCLS(v) ( v & ~TC_NCLS) #define S_TC_RTTL _TC_MAKE32(9) #define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL) #define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL) #define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL) #define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL)) #define S_TC_AT _TC_MAKE32(12) #define M_TC_AT _TC_MAKEMASK(2,S_TC_AT) #define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT) #define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT) #define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT)) /* Action attributes */ enum { TCA_ACT_UNSPEC, TCA_ACT_KIND, TCA_ACT_OPTIONS, TCA_ACT_INDEX, TCA_ACT_STATS, __TCA_ACT_MAX }; #define TCA_ACT_MAX __TCA_ACT_MAX #define TCA_OLD_COMPAT (TCA_ACT_MAX+1) #define TCA_ACT_MAX_PRIO 32 #define TCA_ACT_BIND 1 #define TCA_ACT_NOBIND 0 #define TCA_ACT_UNBIND 1 #define TCA_ACT_NOUNBIND 0 #define TCA_ACT_REPLACE 1 #define TCA_ACT_NOREPLACE 0 #define MAX_REC_LOOP 4 #define MAX_RED_LOOP 4 #define TC_ACT_UNSPEC (-1) #define TC_ACT_OK 0 #define TC_ACT_RECLASSIFY 1 #define TC_ACT_SHOT 2 #define TC_ACT_PIPE 3 #define TC_ACT_STOLEN 4 #define TC_ACT_QUEUED 5 #define TC_ACT_REPEAT 6 #define TC_ACT_JUMP 0x10000000 /* Action type identifiers*/ enum { TCA_ID_UNSPEC=0, TCA_ID_POLICE=1, /* other actions go here */ __TCA_ID_MAX=255 }; #define TCA_ID_MAX __TCA_ID_MAX struct tc_police { __u32 index; int action; #define TC_POLICE_UNSPEC TC_ACT_UNSPEC #define TC_POLICE_OK TC_ACT_OK #define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY #define TC_POLICE_SHOT TC_ACT_SHOT #define TC_POLICE_PIPE TC_ACT_PIPE __u32 limit; __u32 burst; __u32 mtu; struct tc_ratespec rate; struct tc_ratespec peakrate; int refcnt; int bindcnt; __u32 capab; }; struct tcf_t { __u64 install; __u64 lastuse; __u64 expires; }; struct tc_cnt { int refcnt; int bindcnt; }; #define tc_gen \ __u32 index; \ __u32 capab; \ int action; \ int refcnt; \ int bindcnt enum { TCA_POLICE_UNSPEC, TCA_POLICE_TBF, TCA_POLICE_RATE, TCA_POLICE_PEAKRATE, TCA_POLICE_AVRATE, TCA_POLICE_RESULT, __TCA_POLICE_MAX #define TCA_POLICE_RESULT TCA_POLICE_RESULT }; #define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1) /* U32 filters */ #define TC_U32_HTID(h) ((h)&0xFFF00000) #define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20) #define TC_U32_HASH(h) (((h)>>12)&0xFF) #define TC_U32_NODE(h) ((h)&0xFFF) #define TC_U32_KEY(h) ((h)&0xFFFFF) #define TC_U32_UNSPEC 0 #define TC_U32_ROOT (0xFFF00000) enum { TCA_U32_UNSPEC, TCA_U32_CLASSID, TCA_U32_HASH, TCA_U32_LINK, TCA_U32_DIVISOR, TCA_U32_SEL, TCA_U32_POLICE, TCA_U32_ACT, TCA_U32_INDEV, TCA_U32_PCNT, TCA_U32_MARK, __TCA_U32_MAX }; #define TCA_U32_MAX (__TCA_U32_MAX - 1) struct tc_u32_key { __be32 mask; __be32 val; int off; int offmask; }; struct tc_u32_sel { unsigned char flags; unsigned char offshift; unsigned char nkeys; __be16 offmask; __u16 off; short offoff; short hoff; __be32 hmask; struct tc_u32_key keys[0]; }; struct tc_u32_mark { __u32 val; __u32 mask; __u32 success; }; struct tc_u32_pcnt { __u64 rcnt; __u64 rhit; __u64 kcnts[0]; }; /* Flags */ #define TC_U32_TERMINAL 1 #define TC_U32_OFFSET 2 #define TC_U32_VAROFFSET 4 #define TC_U32_EAT 8 #define TC_U32_MAXDEPTH 8 /* RSVP filter */ enum { TCA_RSVP_UNSPEC, TCA_RSVP_CLASSID, TCA_RSVP_DST, TCA_RSVP_SRC, TCA_RSVP_PINFO, TCA_RSVP_POLICE, TCA_RSVP_ACT, __TCA_RSVP_MAX }; #define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 ) struct tc_rsvp_gpi { __u32 key; __u32 mask; int offset; }; struct tc_rsvp_pinfo { struct tc_rsvp_gpi dpi; struct tc_rsvp_gpi spi; __u8 protocol; __u8 tunnelid; __u8 tunnelhdr; __u8 pad; }; /* ROUTE filter */ enum { TCA_ROUTE4_UNSPEC, TCA_ROUTE4_CLASSID, TCA_ROUTE4_TO, TCA_ROUTE4_FROM, TCA_ROUTE4_IIF, TCA_ROUTE4_POLICE, TCA_ROUTE4_ACT, __TCA_ROUTE4_MAX }; #define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1) /* FW filter */ enum { TCA_FW_UNSPEC, TCA_FW_CLASSID, TCA_FW_POLICE, TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ TCA_FW_MASK, __TCA_FW_MAX }; #define TCA_FW_MAX (__TCA_FW_MAX - 1) /* TC index filter */ enum { TCA_TCINDEX_UNSPEC, TCA_TCINDEX_HASH, TCA_TCINDEX_MASK, TCA_TCINDEX_SHIFT, TCA_TCINDEX_FALL_THROUGH, TCA_TCINDEX_CLASSID, TCA_TCINDEX_POLICE, TCA_TCINDEX_ACT, __TCA_TCINDEX_MAX }; #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) /* Flow filter */ enum { FLOW_KEY_SRC, FLOW_KEY_DST, FLOW_KEY_PROTO, FLOW_KEY_PROTO_SRC, FLOW_KEY_PROTO_DST, FLOW_KEY_IIF, FLOW_KEY_PRIORITY, FLOW_KEY_MARK, FLOW_KEY_NFCT, FLOW_KEY_NFCT_SRC, FLOW_KEY_NFCT_DST, FLOW_KEY_NFCT_PROTO_SRC, FLOW_KEY_NFCT_PROTO_DST, FLOW_KEY_RTCLASSID, FLOW_KEY_SKUID, FLOW_KEY_SKGID, FLOW_KEY_VLAN_TAG, FLOW_KEY_RXHASH, __FLOW_KEY_MAX, }; #define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1) enum { FLOW_MODE_MAP, FLOW_MODE_HASH, }; enum { TCA_FLOW_UNSPEC, TCA_FLOW_KEYS, TCA_FLOW_MODE, TCA_FLOW_BASECLASS, TCA_FLOW_RSHIFT, TCA_FLOW_ADDEND, TCA_FLOW_MASK, TCA_FLOW_XOR, TCA_FLOW_DIVISOR, TCA_FLOW_ACT, TCA_FLOW_POLICE, TCA_FLOW_EMATCHES, TCA_FLOW_PERTURB, __TCA_FLOW_MAX }; #define TCA_FLOW_MAX (__TCA_FLOW_MAX - 1) /* Basic filter */ enum { TCA_BASIC_UNSPEC, TCA_BASIC_CLASSID, TCA_BASIC_EMATCHES, TCA_BASIC_ACT, TCA_BASIC_POLICE, __TCA_BASIC_MAX }; #define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) /* Cgroup classifier */ enum { TCA_CGROUP_UNSPEC, TCA_CGROUP_ACT, TCA_CGROUP_POLICE, TCA_CGROUP_EMATCHES, __TCA_CGROUP_MAX, }; #define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1) /* Extended Matches */ struct tcf_ematch_tree_hdr { __u16 nmatches; __u16 progid; }; enum { TCA_EMATCH_TREE_UNSPEC, TCA_EMATCH_TREE_HDR, TCA_EMATCH_TREE_LIST, __TCA_EMATCH_TREE_MAX }; #define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) struct tcf_ematch_hdr { __u16 matchid; __u16 kind; __u16 flags; __u16 pad; /* currently unused */ }; /* 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 * +-----------------------+-+-+---+ * | Unused |S|I| R | * +-----------------------+-+-+---+ * * R(2) ::= relation to next ematch * where: 0 0 END (last ematch) * 0 1 AND * 1 0 OR * 1 1 Unused (invalid) * I(1) ::= invert result * S(1) ::= simple payload */ #define TCF_EM_REL_END 0 #define TCF_EM_REL_AND (1<<0) #define TCF_EM_REL_OR (1<<1) #define TCF_EM_INVERT (1<<2) #define TCF_EM_SIMPLE (1<<3) #define TCF_EM_REL_MASK 3 #define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) enum { TCF_LAYER_LINK, TCF_LAYER_NETWORK, TCF_LAYER_TRANSPORT, __TCF_LAYER_MAX }; #define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1) /* Ematch type assignments * 1..32767 Reserved for ematches inside kernel tree * 32768..65535 Free to use, not reliable */ #define TCF_EM_CONTAINER 0 #define TCF_EM_CMP 1 #define TCF_EM_NBYTE 2 #define TCF_EM_U32 3 #define TCF_EM_META 4 #define TCF_EM_TEXT 5 #define TCF_EM_VLAN 6 #define TCF_EM_MAX 6 enum { TCF_EM_PROG_TC }; enum { TCF_EM_OPND_EQ, TCF_EM_OPND_GT, TCF_EM_OPND_LT }; #endif /* * NET3 PLIP tuning facilities for the new Niibe PLIP. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * */ #ifndef _LINUX_IF_PLIP_H #define _LINUX_IF_PLIP_H #include #define SIOCDEVPLIP SIOCDEVPRIVATE struct plipconf { unsigned short pcmd; unsigned long nibble; unsigned long trigger; }; #define PLIP_GET_TIMEOUT 0x1 #define PLIP_SET_TIMEOUT 0x2 #endif /* * Definitions for talking to the CUDA. The CUDA is a microcontroller * which controls the ADB, system power, RTC, and various other things. * * Copyright (C) 1996 Paul Mackerras. */ /* CUDA commands (2nd byte) */ #define CUDA_WARM_START 0 #define CUDA_AUTOPOLL 1 #define CUDA_GET_6805_ADDR 2 #define CUDA_GET_TIME 3 #define CUDA_GET_PRAM 7 #define CUDA_SET_6805_ADDR 8 #define CUDA_SET_TIME 9 #define CUDA_POWERDOWN 0xa #define CUDA_POWERUP_TIME 0xb #define CUDA_SET_PRAM 0xc #define CUDA_MS_RESET 0xd #define CUDA_SEND_DFAC 0xe #define CUDA_RESET_SYSTEM 0x11 #define CUDA_SET_IPL 0x12 #define CUDA_SET_AUTO_RATE 0x14 #define CUDA_GET_AUTO_RATE 0x16 #define CUDA_SET_DEVICE_LIST 0x19 #define CUDA_GET_DEVICE_LIST 0x1a #define CUDA_GET_SET_IIC 0x22 #ifndef BSG_H #define BSG_H #include #define BSG_PROTOCOL_SCSI 0 #define BSG_SUB_PROTOCOL_SCSI_CMD 0 #define BSG_SUB_PROTOCOL_SCSI_TMF 1 #define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2 /* * For flags member below * sg.h sg_io_hdr also has bits defined for it's flags member. However * none of these bits are implemented/used by bsg. The bits below are * allocated to not conflict with sg.h ones anyway. */ #define BSG_FLAG_Q_AT_TAIL 0x10 /* default, == 0 at this bit, is Q_AT_HEAD */ struct sg_io_v4 { __s32 guard; /* [i] 'Q' to differentiate from v3 */ __u32 protocol; /* [i] 0 -> SCSI , .... */ __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task management function, .... */ __u32 request_len; /* [i] in bytes */ __u64 request; /* [i], [*i] {SCSI: cdb} */ __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */ __u32 request_attr; /* [i] {SCSI: task attribute} */ __u32 request_priority; /* [i] {SCSI: task priority} */ __u32 request_extra; /* [i] {spare, for padding} */ __u32 max_response_len; /* [i] in bytes */ __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */ /* "dout_": data out (to device); "din_": data in (from device) */ __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else dout_xfer points to array of iovec */ __u32 dout_xfer_len; /* [i] bytes to be transferred to device */ __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */ __u32 din_xfer_len; /* [i] bytes to be transferred from device */ __u64 dout_xferp; /* [i], [*i] */ __u64 din_xferp; /* [i], [*o] */ __u32 timeout; /* [i] units: millisecond */ __u32 flags; /* [i] bit mask */ __u64 usr_ptr; /* [i->o] unused internally */ __u32 spare_in; /* [i] */ __u32 driver_status; /* [o] 0 -> ok */ __u32 transport_status; /* [o] 0 -> ok */ __u32 device_status; /* [o] {SCSI: command completion status} */ __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */ __u32 info; /* [o] additional information */ __u32 duration; /* [o] time to complete, in milliseconds */ __u32 response_len; /* [o] bytes of response actually written */ __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */ __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */ __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */ __u32 spare_out; /* [o] */ __u32 padding; }; #endif #ifndef _LINUX_VIRTIO_9P_H #define _LINUX_VIRTIO_9P_H /* This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. */ #include #include #include /* The feature bitmap for virtio 9P */ /* The mount point is specified in a config variable */ #define VIRTIO_9P_MOUNT_TAG 0 struct virtio_9p_config { /* length of the tag name */ __u16 tag_len; /* non-NULL terminated tag name */ __u8 tag[0]; } __attribute__((packed)); #endif /* _LINUX_VIRTIO_9P_H */ , .* .., ..install.cmd,.install,little_endian.h, big_endian.h, byteorder, if_fddi.h,baycom.h,dlm.h,if_ec.h,ipc.h,adb.h,scc.h,dlmconstants.h,ipv6.h, binfmts.h,hpet.h, n_r3964.h,tc_act,serio.h,phonet.h,if_eql.h, i2c-dev.h,hid.h,elf-em.h, if_vlan.h,xattr.h, pg.h, elfcore.h, atmbr2684.h,netrom.h,hidraw.h, dvb, synclink.h,selinux_netlink.h,atmapi.h, net_dropmon.h,tiocl.h,loop.h, fd.h,in6.h,ptrace.h,a.out.h,fuse.h,sonet.h,ipmi_msgdefs.h, elf-fdpic.h,cdrom.h, if_bridge.h,rds.h, posix_types.h, fb.h,atmppp.h,netfilter_arp.h, patchkey.h, in_route.h,igmp.h, telephony.h,icmpv6.h,netfilter_bridge.h,route.h, udf_fs_i.hcmd_/usr/local/home/bellard/cpux86/rootdisk/buildroot-2011.02/output/toolchain/linux/include/linux/byteorder/.install := perl scripts/headers_install.pl /usr/local/home/bellard/cpux86/rootdisk/buildroot-2011.02/output/toolchain/linux-2.6.37.2/include/linux/byteorder /usr/local/home/bellard/cpux86/rootdisk/buildroot-2011.02/output/toolchain/linux/include/linux/byteorder x86 big_endian.h little_endian.h; perl scripts/headers_install.pl /usr/local/home/bellard/cpux86/rootdisk/buildroot-2011.02/output/toolchain/linux-2.6.37.2/include/linux/byteorder /usr/local/home/bellard/cpux86/rootdisk/buildroot-2011.02/output/toolchain/linux/include/linux/byteorder x86 ; touch /usr/local/home/bellard/cpux86/rootdisk/buildroot-2011.02/output/toolchain/linux/include/linux/byteorder/.install #ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H #define _LINUX_BYTEORDER_LITTLE_ENDIAN_H #ifndef __LITTLE_ENDIAN #define __LITTLE_ENDIAN 1234 #endif #ifndef __LITTLE_ENDIAN_BITFIELD #define __LITTLE_ENDIAN_BITFIELD #endif #include #include #define __constant_htonl(x) ((__be32)___constant_swab32((x))) #define __constant_ntohl(x) ___constant_swab32((__be32)(x)) #define __constant_htons(x) ((__be16)___constant_swab16((x))) #define __constant_ntohs(x) ___constant_swab16((__be16)(x)) #define __constant_cpu_to_le64(x) ((__le64)(__u64)(x)) #define __constant_le64_to_cpu(x) ((__u64)(__le64)(x)) #define __constant_cpu_to_le32(x) ((__le32)(__u32)(x)) #define __constant_le32_to_cpu(x) ((__u32)(__le32)(x)) #define __constant_cpu_to_le16(x) ((__le16)(__u16)(x)) #define __constant_le16_to_cpu(x) ((__u16)(__le16)(x)) #define __constant_cpu_to_be64(x) ((__be64)___constant_swab64((x))) #define __constant_be64_to_cpu(x) ___constant_swab64((__u64)(__be64)(x)) #define __constant_cpu_to_be32(x) ((__be32)___constant_swab32((x))) #define __constant_be32_to_cpu(x) ___constant_swab32((__u32)(__be32)(x)) #define __constant_cpu_to_be16(x) ((__be16)___constant_swab16((x))) #define __constant_be16_to_cpu(x) ___constant_swab16((__u16)(__be16)(x)) #define __cpu_to_le64(x) ((__le64)(__u64)(x)) #define __le64_to_cpu(x) ((__u64)(__le64)(x)) #define __cpu_to_le32(x) ((__le32)(__u32)(x)) #define __le32_to_cpu(x) ((__u32)(__le32)(x)) #define __cpu_to_le16(x) ((__le16)(__u16)(x)) #define __le16_to_cpu(x) ((__u16)(__le16)(x)) #define __cpu_to_be64(x) ((__be64)__swab64((x))) #define __be64_to_cpu(x) __swab64((__u64)(__be64)(x)) #define __cpu_to_be32(x) ((__be32)__swab32((x))) #define __be32_to_cpu(x) __swab32((__u32)(__be32)(x)) #define __cpu_to_be16(x) ((__be16)__swab16((x))) #define __be16_to_cpu(x) __swab16((__u16)(__be16)(x)) static __inline__ __le64 __cpu_to_le64p(const __u64 *p) { return (__le64)*p; } static __inline__ __u64 __le64_to_cpup(const __le64 *p) { return (__u64)*p; } static __inline__ __le32 __cpu_to_le32p(const __u32 *p) { return (__le32)*p; } static __inline__ __u32 __le32_to_cpup(const __le32 *p) { return (__u32)*p; } static __inline__ __le16 __cpu_to_le16p(const __u16 *p) { return (__le16)*p; } static __inline__ __u16 __le16_to_cpup(const __le16 *p) { return (__u16)*p; } static __inline__ __be64 __cpu_to_be64p(const __u64 *p) { return (__be64)__swab64p(p); } static __inline__ __u64 __be64_to_cpup(const __be64 *p) { return __swab64p((__u64 *)p); } static __inline__ __be32 __cpu_to_be32p(const __u32 *p) { return (__be32)__swab32p(p); } static __inline__ __u32 __be32_to_cpup(const __be32 *p) { return __swab32p((__u32 *)p); } static __inline__ __be16 __cpu_to_be16p(const __u16 *p) { return (__be16)__swab16p(p); } static __inline__ __u16 __be16_to_cpup(const __be16 *p) { return __swab16p((__u16 *)p); } #define __cpu_to_le64s(x) do { (void)(x); } while (0) #define __le64_to_cpus(x) do { (void)(x); } while (0) #define __cpu_to_le32s(x) do { (void)(x); } while (0) #define __le32_to_cpus(x) do { (void)(x); } while (0) #define __cpu_to_le16s(x) do { (void)(x); } while (0) #define __le16_to_cpus(x) do { (void)(x); } while (0) #define __cpu_to_be64s(x) __swab64s((x)) #define __be64_to_cpus(x) __swab64s((x)) #define __cpu_to_be32s(x) __swab32s((x)) #define __be32_to_cpus(x) __swab32s((x)) #define __cpu_to_be16s(x) __swab16s((x)) #define __be16_to_cpus(x) __swab16s((x)) #endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */ #ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H #define _LINUX_BYTEORDER_BIG_ENDIAN_H #ifndef __BIG_ENDIAN #define __BIG_ENDIAN 4321 #endif #ifndef __BIG_ENDIAN_BITFIELD #define __BIG_ENDIAN_BITFIELD #endif #include #include #define __constant_htonl(x) ((__be32)(__u32)(x)) #define __constant_ntohl(x) ((__u32)(__be32)(x)) #define __constant_htons(x) ((__be16)(__u16)(x)) #define __constant_ntohs(x) ((__u16)(__be16)(x)) #define __constant_cpu_to_le64(x) ((__le64)___constant_swab64((x))) #define __constant_le64_to_cpu(x) ___constant_swab64((__u64)(__le64)(x)) #define __constant_cpu_to_le32(x) ((__le32)___constant_swab32((x))) #define __constant_le32_to_cpu(x) ___constant_swab32((__u32)(__le32)(x)) #define __constant_cpu_to_le16(x) ((__le16)___constant_swab16((x))) #define __constant_le16_to_cpu(x) ___constant_swab16((__u16)(__le16)(x)) #define __constant_cpu_to_be64(x) ((__be64)(__u64)(x)) #define __constant_be64_to_cpu(x) ((__u64)(__be64)(x)) #define __constant_cpu_to_be32(x) ((__be32)(__u32)(x)) #define __constant_be32_to_cpu(x) ((__u32)(__be32)(x)) #define __constant_cpu_to_be16(x) ((__be16)(__u16)(x)) #define __constant_be16_to_cpu(x) ((__u16)(__be16)(x)) #define __cpu_to_le64(x) ((__le64)__swab64((x))) #define __le64_to_cpu(x) __swab64((__u64)(__le64)(x)) #define __cpu_to_le32(x) ((__le32)__swab32((x))) #define __le32_to_cpu(x) __swab32((__u32)(__le32)(x)) #define __cpu_to_le16(x) ((__le16)__swab16((x))) #define __le16_to_cpu(x) __swab16((__u16)(__le16)(x)) #define __cpu_to_be64(x) ((__be64)(__u64)(x)) #define __be64_to_cpu(x) ((__u64)(__be64)(x)) #define __cpu_to_be32(x) ((__be32)(__u32)(x)) #define __be32_to_cpu(x) ((__u32)(__be32)(x)) #define __cpu_to_be16(x) ((__be16)(__u16)(x)) #define __be16_to_cpu(x) ((__u16)(__be16)(x)) static __inline__ __le64 __cpu_to_le64p(const __u64 *p) { return (__le64)__swab64p(p); } static __inline__ __u64 __le64_to_cpup(const __le64 *p) { return __swab64p((__u64 *)p); } static __inline__ __le32 __cpu_to_le32p(const __u32 *p) { return (__le32)__swab32p(p); } static __inline__ __u32 __le32_to_cpup(const __le32 *p) { return __swab32p((__u32 *)p); } static __inline__ __le16 __cpu_to_le16p(const __u16 *p) { return (__le16)__swab16p(p); } static __inline__ __u16 __le16_to_cpup(const __le16 *p) { return __swab16p((__u16 *)p); } static __inline__ __be64 __cpu_to_be64p(const __u64 *p) { return (__be64)*p; } static __inline__ __u64 __be64_to_cpup(const __be64 *p) { return (__u64)*p; } static __inline__ __be32 __cpu_to_be32p(const __u32 *p) { return (__be32)*p; } static __inline__ __u32 __be32_to_cpup(const __be32 *p) { return (__u32)*p; } static __inline__ __be16 __cpu_to_be16p(const __u16 *p) { return (__be16)*p; } static __inline__ __u16 __be16_to_cpup(const __be16 *p) { return (__u16)*p; } #define __cpu_to_le64s(x) __swab64s((x)) #define __le64_to_cpus(x) __swab64s((x)) #define __cpu_to_le32s(x) __swab32s((x)) #define __le32_to_cpus(x) __swab32s((x)) #define __cpu_to_le16s(x) __swab16s((x)) #define __le16_to_cpus(x) __swab16s((x)) #define __cpu_to_be64s(x) do { (void)(x); } while (0) #define __be64_to_cpus(x) do { (void)(x); } while (0) #define __cpu_to_be32s(x) do { (void)(x); } while (0) #define __be32_to_cpus(x) do { (void)(x); } while (0) #define __cpu_to_be16s(x) do { (void)(x); } while (0) #define __be16_to_cpus(x) do { (void)(x); } while (0) #endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ /* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * Global definitions for the ANSI FDDI interface. * * Version: @(#)if_fddi.h 1.0.2 Sep 29 2004 * * Author: Lawrence V. Stefani, * * if_fddi.h is based on previous if_ether.h and if_tr.h work by * Fred N. van Kempen, * Donald Becker, * Alan Cox, * Steve Whitehouse, * Peter De Schrijver, * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _LINUX_IF_FDDI_H #define _LINUX_IF_FDDI_H #include /* * Define max and min legal sizes. The frame sizes do not include * 4 byte FCS/CRC (frame check sequence). */ #define FDDI_K_ALEN 6 /* Octets in one FDDI address */ #define FDDI_K_8022_HLEN 16 /* Total octets in 802.2 header */ #define FDDI_K_SNAP_HLEN 21 /* Total octets in 802.2 SNAP header */ #define FDDI_K_8022_ZLEN 16 /* Min octets in 802.2 frame sans FCS */ #define FDDI_K_SNAP_ZLEN 21 /* Min octets in 802.2 SNAP frame sans FCS */ #define FDDI_K_8022_DLEN 4475 /* Max octets in 802.2 payload */ #define FDDI_K_SNAP_DLEN 4470 /* Max octets in 802.2 SNAP payload */ #define FDDI_K_LLC_ZLEN 13 /* Min octets in LLC frame sans FCS */ #define FDDI_K_LLC_LEN 4491 /* Max octets in LLC frame sans FCS */ /* Define FDDI Frame Control (FC) Byte values */ #define FDDI_FC_K_VOID 0x00 #define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80 #define FDDI_FC_K_RESTRICTED_TOKEN 0xC0 #define FDDI_FC_K_SMT_MIN 0x41 #define FDDI_FC_K_SMT_MAX 0x4F #define FDDI_FC_K_MAC_MIN 0xC1 #define FDDI_FC_K_MAC_MAX 0xCF #define FDDI_FC_K_ASYNC_LLC_MIN 0x50 #define FDDI_FC_K_ASYNC_LLC_DEF 0x54 #define FDDI_FC_K_ASYNC_LLC_MAX 0x5F #define FDDI_FC_K_SYNC_LLC_MIN 0xD0 #define FDDI_FC_K_SYNC_LLC_MAX 0xD7 #define FDDI_FC_K_IMPLEMENTOR_MIN 0x60 #define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F #define FDDI_FC_K_RESERVED_MIN 0x70 #define FDDI_FC_K_RESERVED_MAX 0x7F /* Define LLC and SNAP constants */ #define FDDI_EXTENDED_SAP 0xAA #define FDDI_UI_CMD 0x03 /* Define 802.2 Type 1 header */ struct fddi_8022_1_hdr { __u8 dsap; /* destination service access point */ __u8 ssap; /* source service access point */ __u8 ctrl; /* control byte #1 */ } __attribute__((packed)); /* Define 802.2 Type 2 header */ struct fddi_8022_2_hdr { __u8 dsap; /* destination service access point */ __u8 ssap; /* source service access point */ __u8 ctrl_1; /* control byte #1 */ __u8 ctrl_2; /* control byte #2 */ } __attribute__((packed)); /* Define 802.2 SNAP header */ #define FDDI_K_OUI_LEN 3 struct fddi_snap_hdr { __u8 dsap; /* always 0xAA */ __u8 ssap; /* always 0xAA */ __u8 ctrl; /* always 0x03 */ __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ __be16 ethertype; /* packet type ID field */ } __attribute__((packed)); /* Define FDDI LLC frame header */ struct fddihdr { __u8 fc; /* frame control */ __u8 daddr[FDDI_K_ALEN]; /* destination address */ __u8 saddr[FDDI_K_ALEN]; /* source address */ union { struct fddi_8022_1_hdr llc_8022_1; struct fddi_8022_2_hdr llc_8022_2; struct fddi_snap_hdr llc_snap; } hdr; } __attribute__((packed)); #endif /* _LINUX_IF_FDDI_H */ #ifndef _LINUX_BLKPG_H #define _LINUX_BLKPG_H /* * Partition table and disk geometry handling * * A single ioctl with lots of subfunctions: * * Device number stuff: * get_whole_disk() (given the device number of a partition, * find the device number of the encompassing disk) * get_all_partitions() (given the device number of a disk, return the * device numbers of all its known partitions) * * Partition stuff: * add_partition() * delete_partition() * test_partition_in_use() (also for test_disk_in_use) * * Geometry stuff: * get_geometry() * set_geometry() * get_bios_drivedata() * * For today, only the partition stuff - aeb, 990515 */ #include #define BLKPG _IO(0x12,105) /* The argument structure */ struct blkpg_ioctl_arg { int op; int flags; int datalen; void *data; }; /* The subfunctions (for the op field) */ #define BLKPG_ADD_PARTITION 1 #define BLKPG_DEL_PARTITION 2 /* Sizes of name fields. Unused at present. */ #define BLKPG_DEVNAMELTH 64 #define BLKPG_VOLNAMELTH 64 /* The data structure for ADD_PARTITION and DEL_PARTITION */ struct blkpg_partition { long long start; /* starting offset in bytes */ long long length; /* length in bytes */ int pno; /* partition number */ char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2, to be used in kernel messages */ char volname[BLKPG_VOLNAMELTH]; /* volume label */ }; #endif /* _LINUX_BLKPG_H */ /* * The Linux BAYCOM driver for the Baycom serial 1200 baud modem * and the parallel 9600 baud modem * (C) 1997-1998 by Thomas Sailer, HB9JNX/AE4WA */ #ifndef _BAYCOM_H #define _BAYCOM_H /* -------------------------------------------------------------------- */ /* * structs for the IOCTL commands */ struct baycom_debug_data { unsigned long debug1; unsigned long debug2; long debug3; }; struct baycom_ioctl { int cmd; union { struct baycom_debug_data dbg; } data; }; /* -------------------------------------------------------------------- */ /* * ioctl values change for baycom */ #define BAYCOMCTL_GETDEBUG 0x92 /* -------------------------------------------------------------------- */ #endif /* _BAYCOM_H */ /* --------------------------------------------------------------------- */ /****************************************************************************** ******************************************************************************* ** ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. ** Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. ** ** This copyrighted material is made available to anyone wishing to use, ** modify, copy, or redistribute it subject to the terms and conditions ** of the GNU General Public License v.2. ** ******************************************************************************* ******************************************************************************/ #ifndef __DLM_DOT_H__ #define __DLM_DOT_H__ /* * Interface to Distributed Lock Manager (DLM) * routines and structures to use DLM lockspaces */ /* Lock levels and flags are here */ #include #include typedef void dlm_lockspace_t; /* * Lock status block * * Use this structure to specify the contents of the lock value block. For a * conversion request, this structure is used to specify the lock ID of the * lock. DLM writes the status of the lock request and the lock ID assigned * to the request in the lock status block. * * sb_lkid: the returned lock ID. It is set on new (non-conversion) requests. * It is available when dlm_lock returns. * * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules * shown for the DLM_LKF_VALBLK flag. * * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock, * it was first demoted to NL to avoid conversion deadlock. * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid. * * sb_status: the returned status of the lock request set prior to AST * execution. Possible return values: * * 0 if lock request was successful * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE * -DLM_EUNLOCK if unlock request was successful * -DLM_ECANCEL if a cancel completed successfully * -EDEADLK if a deadlock was detected * -ETIMEDOUT if the lock request was canceled due to a timeout */ #define DLM_SBF_DEMOTED 0x01 #define DLM_SBF_VALNOTVALID 0x02 #define DLM_SBF_ALTMODE 0x04 struct dlm_lksb { int sb_status; __u32 sb_lkid; char sb_flags; char * sb_lvbptr; }; /* dlm_new_lockspace() flags */ #define DLM_LSFL_NODIR 0x00000001 #define DLM_LSFL_TIMEWARN 0x00000002 #define DLM_LSFL_FS 0x00000004 #define DLM_LSFL_NEWEXCL 0x00000008 #endif /* __DLM_DOT_H__ */ /* Definitions for Econet sockets. */ #ifndef __LINUX_IF_EC #define __LINUX_IF_EC /* User visible stuff. Glibc provides its own but libc5 folk will use these */ struct ec_addr { unsigned char station; /* Station number. */ unsigned char net; /* Network number. */ }; struct sockaddr_ec { unsigned short sec_family; unsigned char port; /* Port number. */ unsigned char cb; /* Control/flag byte. */ unsigned char type; /* Type of message. */ struct ec_addr addr; unsigned long cookie; }; #define ECTYPE_PACKET_RECEIVED 0 /* Packet received */ #define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed, low nibble holds status */ #define ECTYPE_TRANSMIT_OK 1 #define ECTYPE_TRANSMIT_NOT_LISTENING 2 #define ECTYPE_TRANSMIT_NET_ERROR 3 #define ECTYPE_TRANSMIT_NO_CLOCK 4 #define ECTYPE_TRANSMIT_LINE_JAMMED 5 #define ECTYPE_TRANSMIT_NOT_PRESENT 6 #endif