diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 9c31748c54da..bb3e2c98dfce 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1683,6 +1683,9 @@ options MSIZE=512 # mbuf size in bytes # # The `fatm' device provides support for Fore PCA200E ATM PCI cards. # +# The `patm' device provides support for IDT77252 based cards like +# ProSum's ProATM-155 and ProATM-25 and IDT's evaluation boards. +# # atm device provides generic atm functions and is required for # atm devices. # NATM enables the netnatm protocol family that can be used to @@ -1699,6 +1702,7 @@ device atm device en device fatm #Fore PCA200E device hatm #Fore/Marconi HE155/622 +device patm #IDT77252 cards (ProATM and IDT) device utopia #ATM PHY driver options NATM #native ATM diff --git a/sys/conf/files b/sys/conf/files index 8a29cd685a20..2565006a879a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -539,6 +539,13 @@ dev/musycc/musycc.c optional musycc dev/nge/if_nge.c optional nge dev/null/null.c standard dev/nmdm/nmdm.c optional nmdm +dev/patm/if_patm.c optional patm pci +dev/patm/if_patm_intr.c optional patm pci +dev/patm/if_patm_ioctl.c optional patm pci +dev/patm/if_patm_rx.c optional patm pci +dev/patm/if_patm_tx.c optional patm pci +dev/patm/if_patm_attach.c optional patm pci +dev/patm/if_patm_rtables.c optional patm pci dev/pccard/card_if.m standard dev/pccard/pccard.c optional pccard dev/pccard/pccard_cis.c optional pccard diff --git a/sys/dev/patm/genrtab/Makefile b/sys/dev/patm/genrtab/Makefile new file mode 100644 index 000000000000..18895f8db25c --- /dev/null +++ b/sys/dev/patm/genrtab/Makefile @@ -0,0 +1,14 @@ +# $FreeBSD$ +# +# This program is used to generate the if_patm_rtables.c file +# for the idt77252 driver. It is not installed. +# +PROG=genrtab +WARNS=5 +NOMAN=true +LDADD=-lm + +install: + +.include + diff --git a/sys/dev/patm/genrtab/genrtab.c b/sys/dev/patm/genrtab/genrtab.c new file mode 100644 index 000000000000..eef0749fc8c4 --- /dev/null +++ b/sys/dev/patm/genrtab/genrtab.c @@ -0,0 +1,458 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Hartmut Brandt + * + * This program is used to generate the different rate tables for the IDT77252 + * driver. The generated tables are slightly different from those in the + * IDT manual. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +/* verbosity flag */ +static int verbose; + +/* number of table entries */ +static const u_int tsize = 256; + +/* number of rate difference tables to create */ +static const u_int ndtables = 16; + +/* cell rate offset for log 0 */ +static const double offset = 10.0; + +/* + * Make an internal form of the interval and be sure to round down. + */ +static u_int +d2interval(double d) +{ + fp_rnd_t r; + u_int s, id; + + r = fpsetround(FP_RZ); + id = (u_int)rint(32 * d); + fpsetround(r); + + s = 0; + while (id >= 32 * 32) { + s++; + id >>= 1; + } + return ((s << 10) | (id)); +} + +/* + * Convert an internal interval back to a real one. + */ +static double +interval2d(u_int id) +{ + return ((1 << ((id >> 10) & 0xf)) * ((id & 0x3ff) / 32.0)); +} + +/* + * Convert double to ATM-Forum format. Make sure to round up. + */ +static u_int +cps2atmf(double cps) +{ + fp_rnd_t r; + u_int s, id; + + if (cps < 1.0) + return (0); + + s = 0; + while (cps >= 2.0) { + s++; + cps /= 2; + } + r = fpsetround(FP_RP); + id = (u_int)rint(512 * cps); + fpsetround(r); + + return ((1 << 14) | (s << 9) | (id & 0x1ff)); +} + +/* + * Convert ATM forum format to double + */ +static double +atmf2cps(u_int atmf) +{ + return (((atmf >> 14) & 1) * (1 << ((atmf >> 9) & 0x1f)) * + ((512 + (atmf & 0x1ff)) / 512.0)); +} + +/* + * A cell rate to the logarithmic one + */ +static double +cps2log(u_int alink, double lg) +{ + if (lg <= offset) + return (0); + if (lg >= alink) + return (tsize - 1); + + return ((tsize - 1) * (1 - log(alink / lg) / log(alink / offset))); +} + +/* + * Convert log to cell rate + */ +static double +log2cps(u_int alink, u_int lg) +{ + return (alink / pow(alink / offset, + (double)(tsize - lg - 1) / (tsize - 1))); +} + +/* + * Convert a double to an internal scaled double + */ +static u_int +d2ifp(double fp) +{ + fp_rnd_t r; + u_int s, ifp; + + fp *= (1 << 16); + + r = fpsetround(FP_RN); + ifp = (u_int)rint(fp); + fpsetround(r); + + s = 0; + while (ifp >= 1024) { + s++; + ifp >>= 1; + } + return ((s << 10) | (ifp)); +} + +/* + * Convert internal scaled float to double + */ +static double +ifp2d(u_int p) +{ + return ((p & 0x3ff) * (1 << ((p >> 10) & 0xf)) / 65536.0); +} + +/* + * Generate log to rate conversion table + */ +static void +gen_log2rate(u_int alink) +{ + u_int i, iinterval, atmf, n, nrm; + double rate, interval, xinterval, cps, xcps; + + for (i = 0; i < 256; i++) { + /* get the desired rate */ + rate = alink / pow(alink / offset, + (double)(tsize - i - 1) / (tsize - 1)); + + /* convert this to an interval */ + interval = alink / rate; + + /* make the internal form of this interval, be sure to + * round down */ + iinterval = d2interval(interval); + + /* now convert back */ + xinterval = interval2d(iinterval); + + /* make a cps from this interval */ + cps = alink / xinterval; + + /* convert this to its ATM forum format */ + atmf = cps2atmf(cps); + + /* and back */ + xcps = atmf2cps(atmf); + + /* decide on NRM */ + if (xcps < 40.0) { + nrm = 0; + n = 3; + } else if (xcps < 80.0) { + nrm = 1; + n = 4; + } else if (xcps < 160.0) { + nrm = 2; + n = 8; + } else if (xcps < 320.0) { + nrm = 3; + n = 16; + } else { + nrm = 4; + n = 32; + } + + /* print */ + if (verbose) + printf(" 0x%08x, /* %03u: cps=%f nrm=%u int=%f */\n", + (atmf << 17) | (nrm << 14) | iinterval, i, + xcps, n, xinterval); + else + printf("0x%08x,\n", (atmf << 17) | (nrm << 14) | + iinterval); + } +} + +/* + * Generate rate to log conversion table + */ +static void +gen_rate2log(u_int alink) +{ + u_int i, atmf, val, ilcr; + double cps, lcr; + fp_rnd_t r; + + val = 0; + for (i = 0; i < 512; i++) { + /* make ATM Forum CPS from index */ + atmf = (((i & 0x1f0) >> 4) << 9) | + ((i & 0xf) << 5) | (1 << 14); + + /* make cps */ + cps = atmf2cps(atmf); + + /* convert to log */ + lcr = cps2log(alink, cps); + + r = fpsetround(FP_RN); + ilcr = (u_int)rint(lcr); + fpsetround(r); + + /* put together */ + val |= ilcr << (8 * (i % 4)); + + /* print */ + if (i % 4 == 3) { + if (verbose) + printf(" 0x%08x,\t", val); + else + printf("0x%08x,\n", val); + val = 0; + } else if (verbose) + printf("\t\t"); + if (verbose) + printf("/* %03u: %f -> %f */\n", i, + cps, log2cps(alink, ilcr)); + } +} + +/* + * Generate one entry into the global table + */ +static void +gen_glob_entry(u_int alink, u_int fill, u_int ci, u_int ni) +{ + if (verbose) + printf(" 0x%08x, /* %2u/32 %8.6f, %6u, ci=%u, ni=%u */\n", + cps2atmf(alink * fill / 32.0) | (ci << 17) | (ni << 16), + fill, fill / 32.0, alink * fill / 32, ci, ni); + else + printf("0x%08x,\n", + cps2atmf(alink * fill / 32.0) | (ci << 17) | (ni << 16)); +} + +/* + * Generate global parameter table + */ +static void +gen_glob(u_int alink) +{ + u_int i; + + gen_glob_entry(alink, 32, 0, 0); + gen_glob_entry(alink, 16, 0, 0); + gen_glob_entry(alink, 8, 0, 1); + gen_glob_entry(alink, 4, 0, 1); + gen_glob_entry(alink, 2, 1, 1); + gen_glob_entry(alink, 1, 1, 1); + gen_glob_entry(alink, 0, 1, 1); + gen_glob_entry(alink, 0, 1, 1); + + for (i = 0; i < tsize/2 - 8; i++) { + if (i % 16 == 0) + printf(" "); + printf(" 0,"); + if (i % 16 == 15) + printf("\n"); + } + printf("\n"); +} + +/* + * Generate additive rate increase tables + */ +static void +gen_air(u_int alink) +{ + u_int t, i; + double diff; /* cell rate to increase by */ + double cps; + double add; + u_int val, a; + + for (t = 0; t < ndtables; t++) { + diff = (double)alink / (1 << t); + printf("/* AIR %u: diff=%f */\n", t, diff); + val = 0; + for (i = 0; i < tsize; i++) { + cps = log2cps(alink, i); + cps += diff; + if (cps > alink) + cps = alink; + + add = cps2log(alink, cps) - i; + + a = d2ifp(add); + + if (i % 2) { + val |= a << 16; + if (verbose) + printf(" 0x%08x,\t", val); + else + printf("0x%08x,\n", val); + } else { + val = a; + if (verbose) + printf("\t\t"); + } + if (verbose) + printf("/* %3u: %f */\n", i, ifp2d(add)); + } + } +} + +/* + * Generate rate decrease table + */ +static void +gen_rdf(u_int alink) +{ + double d; + u_int t, i, f, val, diff; + + for (t = 0; t < ndtables; t++) { + /* compute the log index difference */ + if (t == 0) { + d = tsize - 1; + } else { + f = 1 << t; + d = (tsize - 1) / log(alink / offset); + d *= log((double)f / (f - 1)); + } + printf(" /* RDF %u: 1/%u: %f */\n", t, 1 << t, d); + val = 0; + for (i = 0; i < tsize; i++) { + if (i < d) + diff = d2ifp(i); + else + diff = d2ifp(d); + if (i % 2) { + val |= diff << 16; + if (verbose) + printf(" 0x%08x,\t", val); + else + printf("0x%08x,\n", val); + } else { + val = diff; + if (verbose) + printf("\t\t"); + } + if (verbose) + printf("/* %3u: %f */\n", i, ifp2d(diff)); + } + } +} + +/* + * Create all the tables for a given link cell rate and link bit rate. + * The link bit rate is only used to name the table. + */ +static void +gen_tables(u_int alink, u_int mbps) +{ + printf("\n"); + printf("/*\n"); + printf(" * Tables for %ucps and %uMbps\n", alink, mbps); + printf(" */\n"); + printf("const uint32_t patm_rtables%u[128 * (4 + 2 * %u)] = {\n", + mbps, ndtables); + + gen_log2rate(alink); + gen_rate2log(alink); + gen_glob(alink); + gen_air(alink); + gen_rdf(alink); + + printf("};\n"); +} + +int +main(int argc, char *argv[]) +{ + int opt; + + while ((opt = getopt(argc, argv, "v")) != -1) + switch (opt) { + + case 'v': + verbose = 1; + break; + } + + printf("/*\n"); + printf(" * This file was generated by `%s'\n", argv[0]); + printf(" */\n"); + printf("\n"); + printf("#include \n"); + printf("__FBSDID(\"$FreeBSD$\");\n"); + printf("\n"); + printf("#include \n"); + printf("\n"); + printf("const u_int patm_rtables_size = 128 * (4 + 2 * %u);\n", + ndtables); + printf("const u_int patm_rtables_ntab = %u;\n", ndtables); + gen_tables(352768, 155); + gen_tables( 59259, 25); + return (0); +} diff --git a/sys/dev/patm/idt77252reg.h b/sys/dev/patm/idt77252reg.h new file mode 100644 index 000000000000..c970568f6ac3 --- /dev/null +++ b/sys/dev/patm/idt77252reg.h @@ -0,0 +1,476 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Hartmut Brandt + * + * $FreeBSD$ + * + * Register definitions for the IDT77252 chip. + */ + +#define PCI_VENDOR_IDT 0x111D +#define PCI_DEVICE_IDT77252 3 +#define PCI_DEVICE_IDT77v252 4 +#define PCI_DEVICE_IDT77v222 5 + +#define IDT_PCI_REG_MEMBASE 0x14 + +#define IDT_NOR_D0 0x00 /* R/W Data register 0 */ +#define IDT_NOR_D1 0x04 /* R/W Data register 1 */ +#define IDT_NOR_D2 0x08 /* R/W Data register 2 */ +#define IDT_NOR_D3 0x0C /* R/W Data register 3 */ +#define IDT_NOR_CMD 0x10 /* R/W Command */ +#define IDT_NOR_CFG 0x14 /* R/W Configuration */ +#define IDT_NOR_STAT 0x18 /* R/W Status */ +#define IDT_NOR_RSQB 0x1C /* R/W Receive status queue base */ +#define IDT_NOR_RSQT 0x20 /* R Receive status queue tail */ +#define IDT_NOR_RSQH 0x24 /* R/W Receive status queue tail */ +#define IDT_NOR_CDC 0x28 /* R/W Cell drop counter */ +#define IDT_NOR_VPEC 0x2C /* R/W VPI/VCI Lookup error counter */ +#define IDT_NOR_ICC 0x30 /* R/W Invalid cell counter */ +#define IDT_NOR_RAWCT 0x34 /* R Raw cell tail */ +#define IDT_NOR_TMR 0x38 /* R Timer */ +#define IDT_NOR_TSTB 0x3C /* R/W Transmit schedule table base */ +#define IDT_NOR_TSQB 0x40 /* R/W Transmit Status queue base */ +#define IDT_NOR_TSQT 0x44 /* R/W Transmit Status queue tail */ +#define IDT_NOR_TSQH 0x48 /* R/W Transmit Status queue head */ +#define IDT_NOR_GP 0x4C /* R/W General purpose */ +#define IDT_NOR_VPM 0x50 /* R/W VPI/VCI mask */ +#define IDT_NOR_RXFD 0x54 /* R/W Receive FIFO descriptor */ +#define IDT_NOR_RXFT 0x58 /* R/W Receive FIFO tail */ +#define IDT_NOR_RXFH 0x5C /* R/W Receive FIFO head */ +#define IDT_NOR_RAWHND 0x60 /* R/W Raw cell handle */ +#define IDT_NOR_RXSTAT 0x64 /* R Receive connection state */ +#define IDT_NOR_ABRSTD 0x68 /* R/W ABR & VBR Schedule table descriptor */ +#define IDT_NOR_ABRRQ 0x6C /* R/W ABR Ready queue pointer */ +#define IDT_NOR_VBRRQ 0x70 /* R/W VBR Ready queue pointer */ +#define IDT_NOR_RTBL 0x74 /* R/W Rate table descriptor */ +#define IDT_NOR_MXDFCT 0x78 /* R/W Maximum deficit counter */ +#define IDT_NOR_TXSTAT 0x7C /* R/W Transmit connection state */ +#define IDT_NOR_TCMDQ 0x80 /* W Transmit command queue */ +#define IDT_NOR_IRCP 0x84 /* R/W Inactive receive connection pointer */ +#define IDT_NOR_FBQP0 0x88 /* R/W Free buffer queue 0 pointer */ +#define IDT_NOR_FBQP1 0x8C /* R/W Free buffer queue 1 pointer */ +#define IDT_NOR_FBQP2 0x90 /* R/W Free buffer queue 2 pointer */ +#define IDT_NOR_FBQP3 0x94 /* R/W Free buffer queue 3 pointer */ +#define IDT_NOR_FBQS0 0x98 /* R/W Free buffer queue 0 size */ +#define IDT_NOR_FBQS1 0x9C /* R/W Free buffer queue 1 size */ +#define IDT_NOR_FBQS2 0xA0 /* R/W Free buffer queue 2 size */ +#define IDT_NOR_FBQS3 0xA4 /* R/W Free buffer queue 3 size */ +#define IDT_NOR_FBQWP0 0xA8 /* R/W Free buffer queue 0 write pointer */ +#define IDT_NOR_FBQWP1 0xAC /* R/W Free buffer queue 1 write pointer */ +#define IDT_NOR_FBQWP2 0xB0 /* R/W Free buffer queue 2 write pointer */ +#define IDT_NOR_FBQWP3 0xB4 /* R/W Free buffer queue 3 write pointer */ +#define IDT_NOR_NOW 0xB8 /* R Current transmit schedule table addr */ +#define IDT_NOR_DNOW 0xBC /* R Dynamic Now register */ +#define IDT_NOR_END 0xC0 + +/* + * Command (IDT_NOR_CMD) + */ +#define IDT_CMD_NOP 0x00000000 /* No operation */ +#define IDT_CMD_OPCL 0x20000000 /* Open/Close connection */ +#define IDT_CMD_WSRAM 0x40000000 /* Write SRAM */ +#define IDT_CMD_RSRAM 0x50000000 /* Read SRAM */ +#define IDT_CMD_WFBQ 0x60000000 /* Write free buffer queue */ +#define IDT_CMD_RUTIL 0x80000000 /* Read utility bus */ +#define IDT_CMD_WUTIL 0x90000000 /* Write utility bus */ + +#define IDT_MKCMD_OPEN(VC) (IDT_CMD_OPCL | (1 << 19) | ((V) << 4)) +#define IDT_MKCMD_CLOSE(VC) (IDT_CMD_OPCL | (0 << 19) | ((V) << 4)) +#define IDT_MKCMD_WSRAM(A, S) (IDT_CMD_WSRAM | ((A) << 2) | (S)) +#define IDT_MKCMD_RSRAM(A) (IDT_CMD_RSRAM | ((A) << 2)) +#define IDT_MKCMD_WFBQ(Q) (IDT_CMD_WFBQ | (Q)) +#define IDT_MKCMD_RUTIL(S0, S1, A) \ + (IDT_CMD_RUTIL | ((S1) << 9) | ((S0) << 8) | (A)) +#define IDT_MKCMD_WUTIL(S0, S1, A) \ + (IDT_CMD_WUTIL | ((S1) << 9) | ((S0) << 8) | (A)) + +/* + * Configuration register (CFG) + */ +#define IDT_CFG_SWRST 0x80000000 /* software reset */ +#define IDT_CFG_LOOP 0x40000000 /* internal loopback enable */ +#define IDT_CFG_RXPTH 0x20000000 /* receive path enable */ +#define IDT_CFG_IDLECLP 0x10000000 /* set CLP in null cells */ +#define IDT_CFG_TXFIFO9 0x00000000 /* Tx FIFO 9 cells */ +#define IDT_CFG_TXFIFO1 0x04000000 /* Tx FIFO 1 cells */ +#define IDT_CFG_TXFIFO2 0x08000000 /* Tx FIFO 2 cells */ +#define IDT_CFG_TXFIFO4 0x0C000000 /* Tx FIFO 4 cells */ +#define IDT_CFG_NOIDLE 0x02000000 /* don't send idle cells */ +#define IDT_CFG_RXQ128 0x00000000 /* Rx Status Queue 128 entries */ +#define IDT_CFG_RXQ256 0x00400000 /* Rx Status Queue 256 entries */ +#define IDT_CFG_RXQ512 0x00800000 /* Rx Status Queue 512 entries */ +#define IDT_CFG_ICAPT 0x00200000 /* Invalid cell accept */ +#define IDT_CFG_IGGFC 0x00100000 /* Ignore GFC field */ +#define IDT_CFG_VP0 0x00000000 /* 0 VPI bits */ +#define IDT_CFG_VP1 0x00040000 /* 1 VPI bit */ +#define IDT_CFG_VP2 0x00080000 /* 2 VPI bits */ +#define IDT_CFG_VP8 0x000C0000 /* 8 VPI bits */ +#define IDT_CFG_CTS1K 0x00000000 /* Rx Connection table 1024 entries */ +#define IDT_CFG_CTS4K 0x00010000 /* Rx Connection table 4096 entries */ +#define IDT_CFG_CTS16K 0x00020000 /* Rx Connection table 16384 entries */ +#define IDT_CFG_CTS512 0x00030000 /* Rx Connection table 512 entries */ +#define IDT_CFG_VPECA 0x00008000 /* VPI/VCI error cell accept */ +#define IDT_CFG_RXINONE 0x00000000 /* No interrupt on receive */ +#define IDT_CFG_RXIIMM 0x00001000 /* immediate interrupt */ +#define IDT_CFG_RXI28 0x00002000 /* every 0x2800 clocks */ +#define IDT_CFG_RXI4F 0x00003000 /* every 0x4F00 clocks */ +#define IDT_CFG_RXI74 0x00004000 /* every 0x7400 clocks */ +#define IDT_CFG_RAWIE 0x00000800 /* raw cell queue interrupt enable */ +#define IDT_CFG_RQFIE 0x00000400 /* Rx status queue almost full IE */ +#define IDT_CFG_CACHE 0x00000100 /* begin DMA on cache line */ +#define IDT_CFG_TIMOIE 0x00000080 /* timer roll over interrupt enable */ +#define IDT_CFG_FBIE 0x00000040 /* free buffer queue interrupt enable */ +#define IDT_CFG_TXENB 0x00000020 /* Tx enable */ +#define IDT_CFG_TXINT 0x00000010 /* Tx status interrupt enable */ +#define IDT_CFG_TXUIE 0x00000008 /* Tx underrun interrupt enable */ +#define IDT_CFG_UMODE 0x00000004 /* utopia byte mode */ +#define IDT_CFG_TXSFI 0x00000002 /* Tx status full interrupt enable */ +#define IDT_CFG_PHYIE 0x00000001 /* PHY interrupt enable */ + +/* + * Status register (STAT) + */ +#define IDT_STAT_FRAC3(S) (((S) >> 28) & 0xf) /* FBQ3 valid */ +#define IDT_STAT_FRAC2(S) (((S) >> 24) & 0xf) /* FBQ2 valid */ +#define IDT_STAT_FRAC1(S) (((S) >> 20) & 0xf) /* FBQ1 valid */ +#define IDT_STAT_FRAC0(S) (((S) >> 16) & 0xf) /* FBQ0 valid */ +#define IDT_STAT_TSIF 0x00008000 /* Tx status indicator flag */ +#define IDT_STAT_TXICP 0x00004000 /* Tx incomplete PDU */ +#define IDT_STAT_TSQF 0x00001000 /* Tx status queue full */ +#define IDT_STAT_TMROF 0x00000800 /* Timer overflow */ +#define IDT_STAT_PHYI 0x00000400 /* PHY interrupt */ +#define IDT_STAT_CMDBZ 0x00000200 /* command busy */ +#define IDT_STAT_FBQ3A 0x00000100 /* FBQ 3 attention flag */ +#define IDT_STAT_FBQ2A 0x00000080 /* FBQ 2 attention flag */ +#define IDT_STAT_RSQF 0x00000040 /* Rx status queue full */ +#define IDT_STAT_EPDU 0x00000020 /* end of CS-PDU */ +#define IDT_STAT_RAWCF 0x00000010 /* raw cell flag */ +#define IDT_STAT_FBQ1A 0x00000008 /* FBQ 1 attention flag */ +#define IDT_STAT_FBQ0A 0x00000004 /* FBQ 0 attention flag */ +#define IDT_STAT_RSQAF 0x00000002 /* Rx status queue almost full */ + +/* + * Cell drop count (CDC) + */ +#define IDT_CDC_RMID 0x00400000 /* RM cell ID error */ +#define IDT_CDC_CTE 0x00200000 /* Rx connection table error */ +#define IDT_CDC_NFB 0x00100000 /* No free buffers */ +#define IDT_CDC_OAMCRC 0x00080000 /* bad OAM CRC */ +#define IDT_CDC_RMCRC 0x00040000 /* bad RM CRC */ +#define IDT_CDC_RMFIFO 0x00020000 /* RM FIFO full */ +#define IDT_CDC_RXFIFO 0x00010000 /* Rx FIFO full */ +#define IDT_CDC(S) ((S) & 0xffff) /* cell drop counter */ + +/* + * VPI/VCI lookup error count (VPEC) + */ +#define IDT_VPEC(S) ((S) & 0xffff) + +/* + * Invalid cell count (ICC) + */ +#define IDT_ICC(S) ((S) & 0xffff) + +/* + * General purpose register + */ +#define IDT_GP_TXNCC(S) (((S) >> 24) & 0xff) /* Tx negative cell count */ +#define IDT_GP_EEDI 0x00010000 /* EEPROM data in */ +#define IDT_GP_BIGE 0x00008000 /* big endian enable */ +#define IDT_GP_RM 0x00000000 /* process RM cells */ +#define IDT_GP_RM_TEE 0x00002000 /* process RM cells and put in RawQ */ +#define IDT_GP_RM_RAW 0x00006000 /* put RM cells in RawQ */ +#define IDT_GP_DLOOP 0x00001000 /* double loopback */ +#define IDT_GP_PCIPAR 0x00000010 /* force PCI parity error */ +#define IDT_GP_PCIPERR 0x00000020 /* force PERR */ +#define IDT_GP_PCISERR 0x00000040 /* force SERR */ +#define IDT_GP_PHY_RST 0x00000008 /* PHY reset */ +#define IDT_GP_EESCLK 0x00000004 /* EEPROM clock */ +#define IDT_GP_EECS 0x00000002 /* EEPROM chip select */ +#define IDT_GP_EEDO 0x00000001 /* EEPROM data out */ + +/* + * Receive FIFO descriptor register (RXFD) + */ +#define IDT_RXFD(A, S) (((S) << 24) | ((A) << 2)) +#define IDT_RXFDS(V) (((V) >> 24) & 0xf) +#define IDT_RXFDA(V) (((V) & 0x1ffffc) >> 2) + +/* + * ABR & VBR schedule table descriptor register + */ +#define IDT_ABRSTD(A, S) (((S) << 24) | ((A) << 2)) +#define IDT_ABRSTDS(V) (((V) >> 24) & 0x7) +#define IDT_ABRSTDA(V) (((V) & 0x1ffffc) >> 2) + +/* + * ABR/VBR ready queue register + */ +#define IDT_ABRRQH(V) (((V) >> 16) & 0x3fff) +#define IDT_ABRRQT(V) (((V) >> 0) & 0x3fff) +#define IDT_VBRRQH(V) (((V) >> 16) & 0x3fff) +#define IDT_VBRRQT(V) (((V) >> 0) & 0x3fff) + +/* + * Maximum deficit limit register + */ +#define IDT_MDFCT_LCI 0x00020000 /* local congestion indicator enable */ +#define IDT_MDFCT_LNI 0x00010000 /* local no incread enable */ + +/* + * Transmit command queue register + */ +#define IDT_TCMDQ_NOP() ((0x0 << 24)) /* no operation */ +#define IDT_TCMDQ_START(C) ((0x1 << 24) | (C)) /* start connection */ +#define IDT_TCMDQ_ULACR(C, L) ((0x2 << 24) | (C) | ((L) << 16)) + /* update LACR */ +#define IDT_TCMDQ_SLACR(C, L) ((0x3 << 24) | (C) | ((L) << 16)) + /* start and update LACR */ +#define IDT_TCMDQ_UIER(C, L) ((0x4 << 24) | (C) | ((L) << 16)) + /* update Int ER */ +#define IDT_TCMDQ_HALT(C) ((0x5 << 24) | (C)) /* halt connection */ + +/* + * Free buffer queue size registers + */ +#define IDT_FBQS(T, N, C, S) (((T) << 28) | ((N) << 24) | ((C) << 20) | (S)) + +/* + * Receive status queue + */ +struct idt_rsqe { + uint32_t cid; /* VPI/VCI */ + uint32_t handle; /* buffer handle */ + uint32_t crc; /* AAL-5 CRC */ + uint32_t stat; /* div. flags */ +}; +#define IDT_RSQE_SIZE 16 /* bytes */ +#define IDT_RSQE_VPI(CID) (((CID) >> 16) & 0xff) +#define IDT_RSQE_VCI(CID) ((CID) & 0xffff) +#define IDT_RSQE_TYPE(S) (((S) >> 30) & 0x3) +#define IDT_RSQE_DATA 0x2 +#define IDT_RSQE_IDLE 0x3 +#define IDT_RSQE_VALID 0x80000000 +#define IDT_RSQE_POOL(S) (((S) >> 16) & 0x3) +#define IDT_RSQE_BUF 0x8000 +#define IDT_RSQE_NZGFC 0x4000 +#define IDT_RSQE_EPDU 0x2000 +#define IDT_RSQE_CBUF 0x1000 +#define IDT_RSQE_EFCIE 0x0800 +#define IDT_RSQE_CLP 0x0400 +#define IDT_RSQE_CRC 0x0200 +#define IDT_RSQE_CNT(S) ((S) & 0x1ff) + +#define IDT_RSQH(R) (((R) & 0x1ffc) >> 2) +#define IDT_RSQT(R) (((R) & 0x1ffc) >> 2) + +/* + * Transmit status queue + */ +#define IDT_TSQ_SIZE 1024 /* no. of entries */ +#define IDT_TSQE_SIZE 8 /* bytes */ +#define IDT_TSQE_SHIFT 3 +struct idt_tsqe { + uint32_t stat; + uint32_t stamp; +}; +#define IDT_TSQE_EMPTY 0x80000000 +#define IDT_TSQE_TYPE(E) (((E) >> 29) & 0x3) +#define IDT_TSQE_TIMER 0x0 +#define IDT_TSQE_TSR 0x1 +#define IDT_TSQE_IDLE 0x2 +#define IDT_TSQE_TBD 0x3 +#define IDT_TSQE_TAG(E) (((E) >> 24) & 0x1f) +#define IDT_TSQE_HALTED 0x10 +#define IDT_TSQE_STAMP(E) ((E) & 0xffffff) +#define IDT_TSQE_TAG_SPACE 32 + +/* + * Raw cell handle + */ +struct idt_rawhnd { + uint32_t tail; + uint32_t handle; +}; +#define IDT_RAWHND_SIZE 8 + +/* + * TST + */ +#define IDT_TST_NULL (0 << 29) /* transmit NULL cell */ +#define IDT_TST_CBR (1 << 29) /* transmit CBR cell */ +#define IDT_TST_VBR (2 << 29) /* transmit [AVU]BR cell */ +#define IDT_TST_BR (3 << 29) /* branch */ +#define IDT_TST_MASK 0x7ffff + +/* + * Free buffer queue + */ +#define IDT_FBQ_SIZE 512 /* entries */ + +/* + * Receive connection table + */ +#define IDT_RCT_FBP2 0x00400000 /* use FBQ 2 */ +#define IDT_RCT_OPEN 0x00080000 /* connection open */ +#define IDT_RCT_AAL0 0x00000000 /* AAL 0 */ +#define IDT_RCT_AAL34 0x00010000 /* AAL 3/4 */ +#define IDT_RCT_AAL5 0x00020000 /* AAL 5 */ +#define IDT_RCT_AALRAW 0x00030000 /* raw cells */ +#define IDT_RCT_AALOAM 0x00040000 /* OAM cells */ +#define IDT_RCT_RCI 0x00008000 /* raw cell interrupt enable */ +#define IDT_RCT_IACT_CNT_MASK 0x1c000000 +#define IDT_RCT_IACT_CNT_SHIFT 26 +#define IDT_RCT_ENTRY_SIZE 4 /* words */ + +/* + * Transmit connection table + */ +#define IDT_TCT_CBR 0x00000000 +#define IDT_TCT_VBR 0x40000000 +#define IDT_TCT_ABR 0x80000000 +#define IDT_TCT_UBR 0x00000000 +#define IDT_TCT_UBR_FLG 0x80000000 /* word8 flag */ +#define IDT_TCT_HALT 0x80000000 /* connection halted */ +#define IDT_TCT_IDLE 0x40000000 /* connection idle */ +#define IDT_TCT_TSIF 0x00004000 +#define IDT_TCT_MAXIDLE 0x7f000000 +#define IDT_TCT_MBS_SHIFT 16 +#define IDT_TCT_CRM_SHIFT 29 +#define IDT_TCT_NAGE_SHIFT 21 +#define IDT_TCT_LMCR_SHIFT 24 +#define IDT_TCT_CDF_SHIFT 20 +#define IDT_TCT_RDF_SHIFT 14 +#define IDT_TCT_AIR_SHIFT 8 +#define IDT_TCT_ACRI_SHIFT 16 + +/* + * Segmentation channel queue + */ +#define IDT_SCQ_SIZE 64 /* number of entries */ +struct idt_tbd { + uint32_t flags; + uint32_t addr; + uint32_t aal5; + uint32_t hdr; +}; +#define IDT_TBD_SIZE 16 /* bytes */ +#define IDT_TBD_SHIFT 4 +#define IDT_TBD_TSR 0x80000000 /* TSR entry */ +#define IDT_TBD_EPDU 0x40000000 /* end of AAL PDU */ +#define IDT_TBD_TSIF 0x20000000 /* generate status */ +#define IDT_TBD_AAL0 0x00000000 /* AAL0 */ +#define IDT_TBD_AAL34 0x04000000 /* AAL3/4 */ +#define IDT_TBD_AAL5 0x08000000 /* AAL5 */ +#define IDT_TBD_AALOAM 0x10000000 /* OAM cells */ +#define IDT_TBD_GTSI 0x02000000 /* generate transmit status entry */ +#define IDT_TBD_TAG_SHIFT 20 +#define IDT_TBD_HDR(VPI, VCI, PTI, CLP) \ + (((VPI) << 20) | ((VCI) << 4) | ((PTI) << 1) | (CLP)) +#define IDT_TBD_VPI(H) (((H) >> 20) & 0xff) +#define IDT_TBD_VCI(H) (((H) >> 4) & 0xffff) + +/* + * Segmentation channel descriptor + */ +#define IDT_SCD_SIZE 12 /* words */ + +/* + * Memory map for the different RAM sizes + * + * 16k 32k 128k 512k + * + * TxCT 0x00000/4k 0x00000/8x 0x00000/32k 0x00000/128k + * RxCT 0x01000/2k 0x02000/4k 0x08000/16k 0x20000/64k + * FBQ0 0x01800/1k 0x03000/1k 0x0c000/1k 0x30000/1k + * FBQ1 0x01c00/1k 0x03400/1k 0x0c400/1k 0x30400/1k + * FBQ2 0x02000/1k 0x03800/1k 0x0c800/1k 0x30800/1k + * FBQ3 - - - - + * RT 0x02400/4.5k 0x03c00/4.5k 0x0cc00/4.5k 0x30c00/4.5k + * SCD 0x03600/597 0x04e00/1621 0x0de00/9358 0x31e00/43036 + * TST 0x06000/2x2k 0x0c000/2x4k 0x37000/2x8k 0xef000/2x16k + * ABR ST 0x07000/2x1k 0x0e000/2x2k 0x3b000/2x8k 0xf7000/2x16k + * RxFIFO 0x07800/2k 0x0f000/4k 0x3f000/4k 0xff000/4k + * End 0x08000 0x10000 0x40000 0x100000 + */ +struct idt_mmap { + u_int sram; /* K SRAM */ + u_int max_conn; /* connections */ + u_int vcbits; /* VPI + VCI bits */ + u_int rxtab; /* CFG word for CNTBL field */ + u_int rct; /* RCT base */ + u_int rtables; /* rate table address */ + u_int scd_base; /* SCD area base address */ + u_int scd_num; /* number of SCDs */ + u_int tst1base; /* base address of TST 1 */ + u_int tst_size; /* TST size in words */ + u_int abrstd_addr; /* schedule table address */ + u_int abrstd_size; /* schedule table size */ + u_int abrstd_code; /* schedule table size */ + u_int rxfifo_addr; /* address */ + u_int rxfifo_size; /* in words */ + u_int rxfifo_code; /* size */ +}; +#define IDT_MMAP { \ + { /* 16k x 32, 512 connections */ \ + 16, 512, 9, IDT_CFG_CTS512, /* RAM, connections, VC bits */ \ + 0x01000, /* RCT base */ \ + 0x02400, /* rate table address */ \ + 0x03600, 597, /* SCD base and num */ \ + 0x06000, 2048, /* TST/words, base */ \ + 0x07000, 2048, 0x1, /* ABR schedule table */ \ + 0x07800, 2048, 0x2 /* RxFIFO size in words */ \ + }, \ + { /* 32k x 32, 1024 connections */ \ + 32, 1024, 10, IDT_CFG_CTS1K, /* RAM, connections, VC bits */ \ + 0x02000, /* RCT base */ \ + 0x03c00, /* rate table address */ \ + 0x04e00, 1621, /* SCD base and num */ \ + 0x0c000, 4096, /* TST/words, base */ \ + 0x0e000, 4096, 0x2, /* ABR schedule table */ \ + 0x0f000, 4096, 0x3 /* RxFIFO size in words */ \ + }, \ + { /* 128k x 32, 4096 connections */ \ + 128, 4096, 12, IDT_CFG_CTS4K, /* RAM, connections, VC bits */ \ + 0x08000, /* RCT base */ \ + 0x0cc00, /* rate table address */ \ + 0x0de00, 9358, /* SCD base and num */ \ + 0x37000, 8192, /* TST/words, base */ \ + 0x3b000, 16384, 0x4, /* ABR schedule table */ \ + 0x3f000, 4096, 0x3 /* RxFIFO size in words */ \ + }, \ + { /* 512k x 32, 512 connections */ \ + 512, 16384, 14, IDT_CFG_CTS16K, /* RAM, connections, VC bits */\ + 0x20000, /* RCT base */ \ + 0x30c00, /* rate table address */ \ + 0x31e00, 43036, /* SCD base and num */ \ + 0xef000, 16384, /* TST/words, base */ \ + 0xf7000, 16384, 0x5, /* ABR schedule table */ \ + 0xff000, 4096, 0x3 /* RxFIFO size in words */ \ + }, \ +} diff --git a/sys/dev/patm/if_patm.c b/sys/dev/patm/if_patm.c new file mode 100644 index 000000000000..a91de4ad616d --- /dev/null +++ b/sys/dev/patm/if_patm.c @@ -0,0 +1,499 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Hartmut Brandt + * + * Driver for IDT77252 based cards like ProSum's. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_natm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +static void patm_tst_init(struct patm_softc *sc); +static void patm_scd_init(struct patm_softc *sc); + +/* + * Start the card. This assumes the mutex to be held + */ +void +patm_initialize(struct patm_softc *sc) +{ + uint32_t cfg; + u_int i; + + patm_debug(sc, ATTACH, "configuring..."); + + /* clear SRAM */ + for (i = 0; i < sc->mmap->sram * 1024; i += 4) + patm_sram_write4(sc, i, 0, 0, 0, 0); + patm_scd_init(sc); + + /* configuration register. Setting NOIDLE makes the timing wrong! */ + cfg = IDT_CFG_TXFIFO9 | IDT_CFG_RXQ512 | PATM_CFG_VPI | + /* IDT_CFG_NOIDLE | */ sc->mmap->rxtab; + if (!(sc->flags & PATM_UNASS)) + cfg |= IDT_CFG_IDLECLP; + patm_nor_write(sc, IDT_NOR_CFG, cfg); + + /* clean all the status queues and the Raw handle */ + memset(sc->tsq, 0, sc->sq_size); + + /* initialize RSQ */ + patm_debug(sc, ATTACH, "RSQ %llx", (unsigned long long)sc->rsq_phy); + patm_nor_write(sc, IDT_NOR_RSQB, sc->rsq_phy); + patm_nor_write(sc, IDT_NOR_RSQT, sc->rsq_phy); + patm_nor_write(sc, IDT_NOR_RSQH, 0); + sc->rsq_last = PATM_RSQ_SIZE - 1; + + /* initialize TSTB */ + patm_nor_write(sc, IDT_NOR_TSTB, sc->mmap->tst1base << 2); + patm_tst_init(sc); + + /* initialize TSQ */ + for (i = 0; i < IDT_TSQ_SIZE; i++) + sc->tsq[i].stamp = htole32(IDT_TSQE_EMPTY); + patm_nor_write(sc, IDT_NOR_TSQB, sc->tsq_phy); + patm_nor_write(sc, IDT_NOR_TSQH, 0); + patm_nor_write(sc, IDT_NOR_TSQT, 0); + sc->tsq_next = sc->tsq; + + /* GP */ +#if BYTE_ORDER == BIG_ENDIAN && 0 + patm_nor_write(sc, IDT_NOR_GP, IDT_GP_BIGE); +#else + patm_nor_write(sc, IDT_NOR_GP, 0); +#endif + + /* VPM */ + patm_nor_write(sc, IDT_NOR_VPM, 0); + + /* RxFIFO */ + patm_nor_write(sc, IDT_NOR_RXFD, + IDT_RXFD(sc->mmap->rxfifo_addr, sc->mmap->rxfifo_code)); + patm_nor_write(sc, IDT_NOR_RXFT, 0); + patm_nor_write(sc, IDT_NOR_RXFH, 0); + + /* RAWHND */ + patm_debug(sc, ATTACH, "RWH %llx", + (unsigned long long)sc->rawhnd_phy); + patm_nor_write(sc, IDT_NOR_RAWHND, sc->rawhnd_phy); + + /* ABRSTD */ + patm_nor_write(sc, IDT_NOR_ABRSTD, + IDT_ABRSTD(sc->mmap->abrstd_addr, sc->mmap->abrstd_code)); + for (i = 0; i < sc->mmap->abrstd_size; i++) + patm_sram_write(sc, sc->mmap->abrstd_addr + i, 0); + patm_nor_write(sc, IDT_NOR_ABRRQ, 0); + patm_nor_write(sc, IDT_NOR_VBRRQ, 0); + + /* rate tables */ + if (sc->flags & PATM_25M) { + for (i = 0; i < patm_rtables_size; i++) + patm_sram_write(sc, sc->mmap->rtables + i, + patm_rtables25[i]); + } else { + for (i = 0; i < patm_rtables_size; i++) + patm_sram_write(sc, sc->mmap->rtables + i, + patm_rtables155[i]); + } + patm_nor_write(sc, IDT_NOR_RTBL, sc->mmap->rtables << 2); + + /* Maximum deficit */ + patm_nor_write(sc, IDT_NOR_MXDFCT, 32 | IDT_MDFCT_LCI | IDT_MDFCT_LNI); + + /* Free buffer queues */ + patm_nor_write(sc, IDT_NOR_FBQP0, 0); + patm_nor_write(sc, IDT_NOR_FBQP1, 0); + patm_nor_write(sc, IDT_NOR_FBQP2, 0); + patm_nor_write(sc, IDT_NOR_FBQP3, 0); + + patm_nor_write(sc, IDT_NOR_FBQWP0, 0); + patm_nor_write(sc, IDT_NOR_FBQWP1, 0); + patm_nor_write(sc, IDT_NOR_FBQWP2, 0); + patm_nor_write(sc, IDT_NOR_FBQWP3, 0); + + patm_nor_write(sc, IDT_NOR_FBQS0, + (SMBUF_THRESHOLD << 28) | + (SMBUF_NI_THRESH << 24) | + (SMBUF_CI_THRESH << 20) | + SMBUF_CELLS); + patm_nor_write(sc, IDT_NOR_FBQS1, + (LMBUF_THRESHOLD << 28) | + (LMBUF_NI_THRESH << 24) | + (LMBUF_CI_THRESH << 20) | + LMBUF_CELLS); + patm_nor_write(sc, IDT_NOR_FBQS2, + (VMBUF_THRESHOLD << 28) | VMBUF_CELLS); + patm_nor_write(sc, IDT_NOR_FBQS3, 0); + + /* make SCD0 for UBR0 */ + if ((sc->scd0 = patm_scd_alloc(sc)) == NULL) { + patm_printf(sc, "cannot create UBR0 SCD\n"); + patm_reset(sc); + return; + } + sc->scd0->q.ifq_maxlen = PATM_DLFT_MAXQ; + + patm_scd_setup(sc, sc->scd0); + patm_tct_setup(sc, sc->scd0, NULL); + + patm_debug(sc, ATTACH, "go..."); + + sc->utopia.flags &= ~UTP_FL_POLL_CARRIER; + sc->ifatm.ifnet.if_flags |= IFF_RUNNING; + + /* enable interrupts, Tx and Rx paths */ + cfg |= IDT_CFG_RXPTH | IDT_CFG_RXIIMM | IDT_CFG_RAWIE | IDT_CFG_RQFIE | + IDT_CFG_TIMOIE | IDT_CFG_FBIE | IDT_CFG_TXENB | IDT_CFG_TXINT | + IDT_CFG_TXUIE | IDT_CFG_TXSFI | IDT_CFG_PHYIE; + patm_nor_write(sc, IDT_NOR_CFG, cfg); +} + +/* + * External callable start function + */ +void +patm_init(void *p) +{ + struct patm_softc *sc = p; + + mtx_lock(&sc->mtx); + patm_stop(sc); + patm_initialize(sc); + mtx_unlock(&sc->mtx); +} + +/* + * Stop the interface + */ +void +patm_stop(struct patm_softc *sc) +{ + u_int i; + struct mbuf *m; + struct patm_txmap *map; + struct patm_scd *scd; + + sc->ifatm.ifnet.if_flags &= ~IFF_RUNNING; + sc->utopia.flags |= UTP_FL_POLL_CARRIER; + + patm_reset(sc); + + mtx_lock(&sc->tst_lock); + i = sc->tst_state; + sc->tst_state = 0; + callout_stop(&sc->tst_callout); + mtx_unlock(&sc->tst_lock); + + if (i != 0) { + /* this means we are just entering or leaving the timeout. + * wait a little bit. Doing this correctly would be more + * involved */ + DELAY(1000); + } + + /* + * Give any waiters on closing a VCC a chance. They will stop + * to wait if they see that IFF_RUNNING disappeared. + */ + while (!(cv_waitq_empty(&sc->vcc_cv))) { + cv_broadcast(&sc->vcc_cv); + DELAY(100); + } + + /* free large buffers */ + patm_debug(sc, ATTACH, "freeing large buffers..."); + for (i = 0; i < sc->lbuf_max; i++) + if (sc->lbufs[i].m != NULL) + patm_lbuf_free(sc, &sc->lbufs[i]); + + /* free small buffers that are on the card */ + patm_debug(sc, ATTACH, "freeing small buffers..."); + mbp_card_free(sc->sbuf_pool); + + /* free aal0 buffers that are on the card */ + patm_debug(sc, ATTACH, "freeing aal0 buffers..."); + mbp_card_free(sc->vbuf_pool); + + /* freeing partial receive chains and reset vcc state */ + for (i = 0; i < sc->mmap->max_conn; i++) { + if (sc->vccs[i] != NULL) { + if (sc->vccs[i]->chain != NULL) + m_freem(sc->vccs[i]->chain); + + if (sc->vccs[i]->vcc.flags & ATMIO_FLAG_NG) { + uma_zfree(sc->vcc_zone, sc->vccs[i]); + sc->vccs[i] = NULL; + } else { + /* keep HARP and NG */ + sc->vccs[i]->chain = NULL; + sc->vccs[i]->last = NULL; + sc->vccs[i]->vflags = 0; + } + } + } + + /* stop all active SCDs */ + while ((scd = LIST_FIRST(&sc->scd_list)) != NULL) { + /* free queue packets */ + for (;;) { + _IF_DEQUEUE(&scd->q, m); + if (m == NULL) + break; + m_freem(m); + } + + /* free transmitting packets */ + for (i = 0; i < IDT_TSQE_TAG_SPACE; i++) { + if ((m = scd->on_card[i]) != NULL) { + scd->on_card[i] = 0; + map = m->m_pkthdr.header; + + bus_dmamap_unload(sc->tx_tag, map->map); + SLIST_INSERT_HEAD(&sc->tx_maps_free, map, link); + m_freem(m); + } + } + patm_scd_free(sc, scd); + } + sc->scd0 = NULL; + + sc->flags &= ~PATM_CLR; + + /* reset raw cell queue */ + sc->rawh = NULL; +} + +/* + * Stop the card and reset it + */ +void +patm_reset(struct patm_softc *sc) +{ + + patm_debug(sc, ATTACH, "resetting..."); + + patm_nor_write(sc, IDT_NOR_CFG, IDT_CFG_SWRST); + DELAY(200); + patm_nor_write(sc, IDT_NOR_CFG, 0); + DELAY(200); + + patm_nor_write(sc, IDT_NOR_RSQH, 0); + patm_nor_write(sc, IDT_NOR_TSQH, 0); + + patm_nor_write(sc, IDT_NOR_GP, IDT_GP_PHY_RST); + DELAY(50); + patm_nor_write(sc, IDT_NOR_GP, IDT_GP_EEDO | IDT_GP_EECS); + DELAY(50); +} + +/* + * Initialize the soft TST to contain only ABR scheduling and + * write it to SRAM + */ +static void +patm_tst_init(struct patm_softc *sc) +{ + u_int i; + u_int base, idle; + + base = sc->mmap->tst1base; + idle = sc->mmap->tst1base + sc->mmap->tst_size; + + /* soft */ + for (i = 0; i < sc->mmap->tst_size - 1; i++) + sc->tst_soft[i] = IDT_TST_VBR; + + sc->tst_state = 0; + sc->tst_jump[0] = base + sc->mmap->tst_size - 1; + sc->tst_jump[1] = idle + sc->mmap->tst_size - 1; + sc->tst_base[0] = base; + sc->tst_base[1] = idle; + + /* TST1 */ + for (i = 0; i < sc->mmap->tst_size - 1; i++) + patm_sram_write(sc, base + i, IDT_TST_VBR); + patm_sram_write(sc, sc->tst_jump[0], IDT_TST_BR | (base << 2)); + + /* TST2 */ + for (i = 0; i < sc->mmap->tst_size - 1; i++) + patm_sram_write(sc, idle + i, IDT_TST_VBR); + patm_sram_write(sc, sc->tst_jump[1], IDT_TST_BR | (idle << 2)); + + sc->tst_free = sc->mmap->tst_size - 1; + sc->tst_reserve = sc->tst_free * PATM_TST_RESERVE / 100; + sc->bwrem = sc->ifatm.mib.pcr; +} + +/* + * Initialize the SCDs. This is done by building a list of all free + * SCDs in SRAM. The first word of each potential SCD is used as a + * link to the next free SCD. The list is rooted in softc. + */ +static void +patm_scd_init(struct patm_softc *sc) +{ + u_int s; /* SRAM address of current SCD */ + + sc->scd_free = 0; + for (s = sc->mmap->scd_base; s + 12 <= sc->mmap->tst1base; s += 12) { + patm_sram_write(sc, s, sc->scd_free); + sc->scd_free = s; + } +} + +/* + * allocate an SCQ + */ +struct patm_scd * +patm_scd_alloc(struct patm_softc *sc) +{ + u_int sram, next; /* SRAM address of this and next SCD */ + int error; + void *p; + struct patm_scd *scd; + bus_dmamap_t map; + bus_addr_t phy; + + /* get an SCD from the free list */ + if ((sram = sc->scd_free) == 0) + return (NULL); + next = patm_sram_read(sc, sram); + + /* allocate memory for the queue and our host stuff */ + error = bus_dmamem_alloc(sc->scd_tag, &p, BUS_DMA_NOWAIT, &map); + if (error != 0) + return (NULL); + phy = 0x3ff; + error = bus_dmamap_load(sc->scd_tag, map, p, sizeof(scd->scq), + patm_load_callback, &phy, BUS_DMA_NOWAIT); + if (error != 0) { + bus_dmamem_free(sc->scd_tag, p, map); + return (NULL); + } + KASSERT((phy & 0x1ff) == 0, ("SCD not aligned %lx", (u_long)phy)); + + scd = p; + bzero(scd, sizeof(*scd)); + + scd->sram = sram; + scd->phy = phy; + scd->map = map; + scd->space = IDT_SCQ_SIZE; + scd->last_tag = IDT_TSQE_TAG_SPACE - 1; + scd->q.ifq_maxlen = PATM_TX_IFQLEN; + + /* remove the scd from the free list */ + sc->scd_free = next; + LIST_INSERT_HEAD(&sc->scd_list, scd, link); + + return (scd); +} + +/* + * Free an SCD + */ +void +patm_scd_free(struct patm_softc *sc, struct patm_scd *scd) +{ + + LIST_REMOVE(scd, link); + + /* clear SCD and insert link word */ + patm_sram_write4(sc, scd->sram, sc->scd_free, 0, 0, 0); + patm_sram_write4(sc, scd->sram, 0, 0, 0, 0); + patm_sram_write4(sc, scd->sram, 0, 0, 0, 0); + + /* put on free list */ + sc->scd_free = scd->sram; + + /* free memory */ + bus_dmamap_unload(sc->scd_tag, scd->map); + bus_dmamem_free(sc->scd_tag, scd, scd->map); +} + +/* + * DMA loading helper function. This function handles the loading of + * all one segment DMA maps. The argument is a pointer to a bus_addr_t + * which must contain the desired alignment of the address as a bitmap. + */ +void +patm_load_callback(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + bus_addr_t *phy = arg; + + if (error) + return; + + KASSERT(nsegs == 1, + ("too many segments for DMA: %d", nsegs)); + KASSERT(segs[0].ds_addr <= 0xffffffffUL, + ("phys addr too large %lx", (u_long)segs[0].ds_addr)); + KASSERT((segs[0].ds_addr & *phy) == 0, + ("bad alignment %lx:%lx", (u_long)segs[0].ds_addr, (u_long)*phy)); + + *phy = segs[0].ds_addr; +} diff --git a/sys/dev/patm/if_patm_attach.c b/sys/dev/patm/if_patm_attach.c new file mode 100644 index 000000000000..932bb6fb3e28 --- /dev/null +++ b/sys/dev/patm/if_patm_attach.c @@ -0,0 +1,1067 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Hartmut Brandt + * + * Driver for IDT77252 based cards like ProSum's. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_natm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#ifdef ENABLE_BPF +#include +#endif +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +MODULE_DEPEND(patm, utopia, 1, 1, 1); +MODULE_DEPEND(patm, pci, 1, 1, 1); +MODULE_DEPEND(patm, atm, 1, 1, 1); +MODULE_DEPEND(patm, libmbpool, 1, 1, 1); + +devclass_t patm_devclass; + +static int patm_probe(device_t dev); +static int patm_attach(device_t dev); +static int patm_detach(device_t dev); +static device_method_t patm_methods[] = { + DEVMETHOD(device_probe, patm_probe), + DEVMETHOD(device_attach, patm_attach), + DEVMETHOD(device_detach, patm_detach), + {0,0} +}; +static driver_t patm_driver = { + "patm", + patm_methods, + sizeof(struct patm_softc), +}; +DRIVER_MODULE(patm, pci, patm_driver, patm_devclass, NULL, 0); + +static const struct { + u_int devid; + const char *desc; +} devs[] = { + { PCI_DEVICE_IDT77252, "NICStAR (77222/77252) ATM adapter" }, + { PCI_DEVICE_IDT77v252, "NICStAR (77v252) ATM adapter" }, + { PCI_DEVICE_IDT77v222, "NICStAR (77v222) ATM adapter" }, + { 0, NULL } +}; + +SYSCTL_DECL(_hw_atm); + +static int patm_phy_readregs(struct ifatm *, u_int, uint8_t *, u_int *); +static int patm_phy_writereg(struct ifatm *, u_int, u_int, u_int); +static const struct utopia_methods patm_utopia_methods = { + patm_phy_readregs, + patm_phy_writereg +}; + +static void patm_destroy(struct patm_softc *sc); + +static int patm_sysctl_istats(SYSCTL_HANDLER_ARGS); +static int patm_sysctl_eeprom(SYSCTL_HANDLER_ARGS); + +static void patm_read_eeprom(struct patm_softc *sc); +static int patm_sq_init(struct patm_softc *sc); +static int patm_rbuf_init(struct patm_softc *sc); +static int patm_txmap_init(struct patm_softc *sc); + +static void patm_env_getuint(struct patm_softc *, u_int *, const char *); + +#ifdef PATM_DEBUG +static int patm_sysctl_regs(SYSCTL_HANDLER_ARGS); +static int patm_sysctl_tsq(SYSCTL_HANDLER_ARGS); +int patm_dump_vc(u_int unit, u_int vc) __unused; +int patm_dump_regs(u_int unit) __unused; +int patm_dump_sram(u_int unit, u_int from, u_int words) __unused; +#endif + +/* + * Probe for a IDT77252 controller + */ +static int +patm_probe(device_t dev) +{ + u_int i; + + if (pci_get_vendor(dev) == PCI_VENDOR_IDT) { + for (i = 0; devs[i].desc != NULL; i++) + if (pci_get_device(dev) == devs[i].devid) { + device_set_desc(dev, devs[i].desc); + return (0); + } + } + return (ENXIO); +} + +/* + * Attach + */ +static int +patm_attach(device_t dev) +{ + struct patm_softc *sc; + int error; + struct ifnet *ifp; + int rid; + u_int a; + + static const struct idt_mmap idt_mmap[4] = IDT_MMAP; + + sc = device_get_softc(dev); + + sc->dev = dev; +#ifdef IATM_DEBUG + sc->debug = IATM_DEBUG; +#endif + sc->ifatm.mib.device = ATM_DEVICE_IDTABR25; + sc->ifatm.mib.serial = 0; + sc->ifatm.mib.hw_version = 0; + sc->ifatm.mib.sw_version = 0; + sc->ifatm.mib.vpi_bits = PATM_VPI_BITS; + sc->ifatm.mib.vci_bits = 0; /* set below */; + sc->ifatm.mib.max_vpcs = 0; + sc->ifatm.mib.max_vccs = 0; /* set below */ + sc->ifatm.mib.media = IFM_ATM_UNKNOWN; + sc->ifatm.phy = &sc->utopia; + + ifp = &sc->ifatm.ifnet; + ifp->if_softc = sc; + ifp->if_unit = device_get_unit(dev); + ifp->if_name = "patm"; + ifp->if_flags = IFF_SIMPLEX; + ifp->if_watchdog = NULL; + ifp->if_init = patm_init; + ifp->if_ioctl = patm_ioctl; + ifp->if_start = patm_start; + ifp->if_watchdog = NULL; + + /* do this early so we can destroy unconditionally */ + mtx_init(&sc->mtx, device_get_nameunit(dev), + MTX_NETWORK_LOCK, MTX_DEF); + mtx_init(&sc->tst_lock, "tst lock", NULL, MTX_DEF); + cv_init(&sc->vcc_cv, "vcc_close"); + + callout_init(&sc->tst_callout, 1); + + sysctl_ctx_init(&sc->sysctl_ctx); + + /* + * Get revision + */ + sc->revision = pci_read_config(dev, PCIR_REVID, 4) & 0xf; + + /* + * Enable PCI bus master and memory + */ + pci_enable_busmaster(dev); + + rid = IDT_PCI_REG_MEMBASE; + sc->memres = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, + 0, ~0, 1, RF_ACTIVE); + if (sc->memres == NULL) { + patm_printf(sc, "could not map memory\n"); + error = ENXIO; + goto fail; + } + sc->memh = rman_get_bushandle(sc->memres); + sc->memt = rman_get_bustag(sc->memres); + + /* + * Allocate the interrupt (enable it later) + */ + sc->irqid = 0; + sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irqid, + 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + if (sc->irqres == 0) { + patm_printf(sc, "could not allocate irq\n"); + error = ENXIO; + goto fail; + } + + /* + * Construct the sysctl tree + */ + error = ENOMEM; + if ((sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_hw_atm), OID_AUTO, + device_get_nameunit(dev), CTLFLAG_RD, 0, "")) == NULL) + goto fail; + + if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "istats", CTLFLAG_RD, sc, 0, patm_sysctl_istats, + "S", "internal statistics") == NULL) + goto fail; + + if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "eeprom", CTLFLAG_RD, sc, 0, patm_sysctl_eeprom, + "S", "EEPROM contents") == NULL) + goto fail; + + if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "lbuf_max", CTLFLAG_RD, &sc->lbuf_max, + 0, "maximum number of large receive buffers") == NULL) + goto fail; + patm_env_getuint(sc, &sc->lbuf_max, "lbuf_max"); + + if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "max_txmaps", CTLFLAG_RW, &sc->tx_maxmaps, + 0, "maximum number of TX DMA maps") == NULL) + goto fail; + patm_env_getuint(sc, &sc->tx_maxmaps, "tx_maxmaps"); + +#ifdef PATM_DEBUG + if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "debug", CTLFLAG_RW, &sc->debug, + 0, "debug flags") == NULL) + goto fail; + sc->debug = PATM_DEBUG; + patm_env_getuint(sc, &sc->debug, "debug"); + + if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "regs", CTLFLAG_RD, sc, 0, patm_sysctl_regs, + "S", "registers") == NULL) + goto fail; + + if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "tsq", CTLFLAG_RD, sc, 0, patm_sysctl_tsq, + "S", "TSQ") == NULL) + goto fail; +#endif + + patm_reset(sc); + + /* + * Detect and attach the phy. + */ + patm_debug(sc, ATTACH, "attaching utopia"); + sc->ifatm.phy = &sc->utopia; + utopia_attach(&sc->utopia, &sc->ifatm, &sc->media, &sc->mtx, + &sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + &patm_utopia_methods); + + /* + * Start the PHY because we need the autodetection + */ + patm_debug(sc, ATTACH, "starting utopia"); + mtx_lock(&sc->mtx); + utopia_start(&sc->utopia); + utopia_reset(&sc->utopia); + mtx_unlock(&sc->mtx); + + /* Read EEPROM */ + patm_read_eeprom(sc); + + /* analyze it */ + if (strncmp(sc->eeprom + PATM_PROATM_NAME_OFFSET, PATM_PROATM_NAME, + strlen(PATM_PROATM_NAME)) == 0) { + if (sc->utopia.chip->type == UTP_TYPE_IDT77105) { + sc->ifatm.mib.device = ATM_DEVICE_PROATM25; + sc->ifatm.mib.pcr = ATM_RATE_25_6M; + sc->ifatm.mib.media = IFM_ATM_UTP_25; + sc->flags |= PATM_25M; + patm_printf(sc, "ProATM 25 interface; "); + + } else { + /* cannot really know which media */ + sc->ifatm.mib.device = ATM_DEVICE_PROATM155; + sc->ifatm.mib.pcr = ATM_RATE_155M; + sc->ifatm.mib.media = IFM_ATM_MM_155; + patm_printf(sc, "ProATM 155 interface; "); + } + + bcopy(sc->eeprom + PATM_PROATM_MAC_OFFSET, sc->ifatm.mib.esi, + sizeof(sc->ifatm.mib.esi)); + + } else { + if (sc->utopia.chip->type == UTP_TYPE_IDT77105) { + sc->ifatm.mib.device = ATM_DEVICE_IDTABR25; + sc->ifatm.mib.pcr = ATM_RATE_25_6M; + sc->ifatm.mib.media = IFM_ATM_UTP_25; + sc->flags |= PATM_25M; + patm_printf(sc, "IDT77252 25MBit interface; "); + + } else { + /* cannot really know which media */ + sc->ifatm.mib.device = ATM_DEVICE_IDTABR155; + sc->ifatm.mib.pcr = ATM_RATE_155M; + sc->ifatm.mib.media = IFM_ATM_MM_155; + patm_printf(sc, "IDT77252 155MBit interface; "); + } + + bcopy(sc->eeprom + PATM_IDT_MAC_OFFSET, sc->ifatm.mib.esi, + sizeof(sc->ifatm.mib.esi)); + } + printf("idt77252 Rev. %c; %s PHY\n", 'A' + sc->revision, + sc->utopia.chip->name); + + utopia_reset_media(&sc->utopia); + utopia_init_media(&sc->utopia); + + /* + * Determine RAM size + */ + for (a = 0; a < 0x20000; a++) + patm_sram_write(sc, a, 0); + patm_sram_write(sc, 0, 0xdeadbeef); + if (patm_sram_read(sc, 0x4004) == 0xdeadbeef) + sc->mmap = &idt_mmap[0]; + else if (patm_sram_read(sc, 0x8000) == 0xdeadbeef) + sc->mmap = &idt_mmap[1]; + else if (patm_sram_read(sc, 0x20000) == 0xdeadbeef) + sc->mmap = &idt_mmap[2]; + else + sc->mmap = &idt_mmap[3]; + + sc->ifatm.mib.vci_bits = sc->mmap->vcbits - sc->ifatm.mib.vpi_bits; + sc->ifatm.mib.max_vccs = sc->mmap->max_conn; + patm_sram_write(sc, 0, 0); + patm_printf(sc, "%uK x 32 SRAM; %u connections\n", sc->mmap->sram, + sc->mmap->max_conn); + + /* initialize status queues */ + error = patm_sq_init(sc); + if (error != 0) + goto fail; + + /* get TST */ + sc->tst_soft = malloc(sizeof(uint32_t) * sc->mmap->tst_size, + M_DEVBUF, M_WAITOK); + + /* allocate all the receive buffer stuff */ + error = patm_rbuf_init(sc); + if (error != 0) + goto fail; + + /* + * Allocate SCD tag + * + * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with + * bus_dmamem_alloc() + */ + error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL, NULL, sizeof(struct patm_scd), 1, + sizeof(struct patm_scd), 0, NULL, NULL, &sc->scd_tag); + if (error) { + patm_printf(sc, "SCD DMA tag create %d\n", error); + goto fail; + } + LIST_INIT(&sc->scd_list); + + /* allocate VCC zone and pointers */ + if ((sc->vcc_zone = uma_zcreate("PATM vccs", sizeof(struct patm_vcc), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0)) == NULL) { + patm_printf(sc, "cannot allocate zone for vccs\n"); + goto fail; + } + sc->vccs = malloc(sizeof(sc->vccs[0]) * sc->mmap->max_conn, + M_DEVBUF, M_WAITOK | M_ZERO); + + /* allocate transmission resources */ + error = patm_txmap_init(sc); + if (error != 0) + goto fail; + + /* poll while we are not running */ + sc->utopia.flags |= UTP_FL_POLL_CARRIER; + + patm_debug(sc, ATTACH, "attaching interface"); + atm_ifattach(ifp); + +#ifdef ENABLE_BPF + bpfattach(ifp, DLT_ATM_RFC1483, sizeof(struct atmllc)); +#endif + + patm_debug(sc, ATTACH, "attaching interrupt handler"); + error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_NET, patm_intr, + sc, &sc->ih); + if (error != 0) { + patm_printf(sc, "could not setup interrupt\n"); + atm_ifdetach(&sc->ifatm.ifnet); + goto fail; + } + + return (0); + + fail: + patm_destroy(sc); + return (error); +} + +/* + * Detach + */ +static int +patm_detach(device_t dev) +{ + struct patm_softc *sc; + + sc = (struct patm_softc *)device_get_softc(dev); + + mtx_lock(&sc->mtx); + patm_stop(sc); + if (sc->utopia.state & UTP_ST_ATTACHED) { + patm_debug(sc, ATTACH, "detaching utopia"); + utopia_stop(&sc->utopia); + utopia_detach(&sc->utopia); + } + mtx_unlock(&sc->mtx); + + atm_ifdetach(&sc->ifatm.ifnet); + + patm_destroy(sc); + + return (0); +} + +/* + * Destroy everything. Assume we are stopped. + */ +static void +patm_destroy(struct patm_softc *sc) +{ + u_int i; + struct patm_txmap *map; + + if (sc->ih != NULL) + bus_teardown_intr(sc->dev, sc->irqres, sc->ih); + + if (sc->tx_mapzone != NULL) { + /* all maps must be free */ + while ((map = SLIST_FIRST(&sc->tx_maps_free)) != NULL) { + bus_dmamap_destroy(sc->tx_tag, map->map); + SLIST_REMOVE_HEAD(&sc->tx_maps_free, link); + uma_zfree(sc->tx_mapzone, map); + } + uma_zdestroy(sc->tx_mapzone); + } + + if (sc->scd_tag != NULL) + bus_dma_tag_destroy(sc->scd_tag); + + if (sc->tx_tag != NULL) + bus_dma_tag_destroy(sc->scd_tag); + + if (sc->vccs != NULL) { + for (i = 0; i < sc->mmap->max_conn; i++) + if (sc->vccs[i] != NULL) + uma_zfree(sc->vcc_zone, sc->vccs[i]); + free(sc->vccs, M_DEVBUF); + } + if (sc->vcc_zone != NULL) + uma_zdestroy(sc->vcc_zone); + + if (sc->lbufs != NULL) { + for (i = 0; i < sc->lbuf_max; i++) + bus_dmamap_destroy(sc->lbuf_tag, sc->lbufs[i].map); + free(sc->lbufs, M_DEVBUF); + } + + if (sc->lbuf_tag != NULL) + bus_dma_tag_destroy(sc->lbuf_tag); + + if (sc->sbuf_pool != NULL) + mbp_destroy(sc->sbuf_pool); + if (sc->vbuf_pool != NULL) + mbp_destroy(sc->vbuf_pool); + + if (sc->sbuf_tag != NULL) + bus_dma_tag_destroy(sc->sbuf_tag); + + if (sc->tst_soft != NULL) + free(sc->tst_soft, M_DEVBUF); + + /* + * Free all status queue memory resources + */ + if (sc->tsq != NULL) { + bus_dmamap_unload(sc->sq_tag, sc->sq_map); + bus_dmamem_free(sc->sq_tag, sc->tsq, sc->sq_map); + bus_dma_tag_destroy(sc->sq_tag); + } + + if (sc->irqres != NULL) + bus_release_resource(sc->dev, SYS_RES_IRQ, + sc->irqid, sc->irqres); + if (sc->memres != NULL) + bus_release_resource(sc->dev, SYS_RES_MEMORY, + IDT_PCI_REG_MEMBASE, sc->memres); + + /* this was initialize unconditionally */ + sysctl_ctx_free(&sc->sysctl_ctx); + cv_destroy(&sc->vcc_cv); + mtx_destroy(&sc->tst_lock); + mtx_destroy(&sc->mtx); +} + +/* + * Try to find a variable in the environment and parse it as an unsigned + * integer. + */ +static void +patm_env_getuint(struct patm_softc *sc, u_int *var, const char *name) +{ + char full[IFNAMSIZ + 3 + 20]; + char *val, *end; + u_long u; + + snprintf(full, sizeof(full), "hw.%s.%s", + device_get_nameunit(sc->dev), name); + + if ((val = getenv(full)) != NULL) { + u = strtoul(val, &end, 0); + if (end > val && *end == '\0') { + if (bootverbose) + patm_printf(sc, "%s=%lu\n", full, u); + *var = u; + } + freeenv(val); + } +} + +/* + * Sysctl handler for internal statistics + * + * LOCK: unlocked, needed + */ +static int +patm_sysctl_istats(SYSCTL_HANDLER_ARGS) +{ + struct patm_softc *sc = arg1; + uint32_t *ret; + int error; + + ret = malloc(sizeof(sc->stats), M_TEMP, M_WAITOK); + + mtx_lock(&sc->mtx); + bcopy(&sc->stats, ret, sizeof(sc->stats)); + mtx_unlock(&sc->mtx); + + error = SYSCTL_OUT(req, ret, sizeof(sc->stats)); + free(ret, M_TEMP); + + return (error); +} + +/* + * Sysctl handler for EEPROM + * + * LOCK: unlocked, needed + */ +static int +patm_sysctl_eeprom(SYSCTL_HANDLER_ARGS) +{ + struct patm_softc *sc = arg1; + void *ret; + int error; + + ret = malloc(sizeof(sc->eeprom), M_TEMP, M_WAITOK); + + mtx_lock(&sc->mtx); + bcopy(sc->eeprom, ret, sizeof(sc->eeprom)); + mtx_unlock(&sc->mtx); + + error = SYSCTL_OUT(req, ret, sizeof(sc->eeprom)); + free(ret, M_TEMP); + + return (error); +} + +/* + * Read the EEPROM. We assume that this is a XIRCOM 25020 + */ +static void +patm_read_eeprom(struct patm_softc *sc) +{ + u_int gp; + uint8_t byte; + int i, addr; + + static const uint32_t tab[] = { + /* CS transition to reset the chip */ + IDT_GP_EECS | IDT_GP_EESCLK, 0, + /* read command 0x03 */ + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, IDT_GP_EEDO, + IDT_GP_EESCLK | IDT_GP_EEDO, IDT_GP_EEDO, + IDT_GP_EESCLK | IDT_GP_EEDO, 0, + /* address 0x00 */ + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + IDT_GP_EESCLK, 0, + }; + + /* go to a known state (chip enabled) */ + gp = patm_nor_read(sc, IDT_NOR_GP); + gp &= ~(IDT_GP_EESCLK | IDT_GP_EECS | IDT_GP_EEDO); + + for (i = 0; i < sizeof(tab) / sizeof(tab[0]); i++) { + patm_nor_write(sc, IDT_NOR_GP, gp | tab[i]); + DELAY(40); + } + + /* read out the prom */ + for (addr = 0; addr < 256; addr++) { + byte = 0; + for (i = 0; i < 8; i++) { + byte <<= 1; + if (patm_nor_read(sc, IDT_NOR_GP) & IDT_GP_EEDI) + byte |= 1; + /* rising CLK */ + patm_nor_write(sc, IDT_NOR_GP, gp | IDT_GP_EESCLK); + DELAY(40); + /* falling clock */ + patm_nor_write(sc, IDT_NOR_GP, gp); + DELAY(40); + } + sc->eeprom[addr] = byte; + } +} + +/* + * PHY access read + */ +static int +patm_phy_readregs(struct ifatm *ifatm, u_int reg, uint8_t *val, u_int *n) +{ + struct patm_softc *sc = ifatm->ifnet.if_softc; + u_int cnt = *n; + + if (reg >= 0x100) + return (EINVAL); + + patm_cmd_wait(sc); + while (reg < 0x100 && cnt > 0) { + patm_nor_write(sc, IDT_NOR_CMD, IDT_MKCMD_RUTIL(1, 0, reg)); + patm_cmd_wait(sc); + *val = patm_nor_read(sc, IDT_NOR_D0); + patm_debug(sc, PHY, "phy(%02x)=%02x", reg, *val); + val++; + reg++; + cnt--; + } + *n = *n - cnt; + return (0); +} + +/* + * Write PHY reg + */ +static int +patm_phy_writereg(struct ifatm *ifatm, u_int reg, u_int mask, u_int val) +{ + struct patm_softc *sc = ifatm->ifnet.if_softc; + u_int old, new; + + if (reg >= 0x100) + return (EINVAL); + + patm_cmd_wait(sc); + patm_nor_write(sc, IDT_NOR_CMD, IDT_MKCMD_RUTIL(1, 0, reg)); + patm_cmd_wait(sc); + + old = patm_nor_read(sc, IDT_NOR_D0); + new = (old & ~mask) | (val & mask); + patm_debug(sc, PHY, "phy(%02x) %02x -> %02x", reg, old, new); + + patm_nor_write(sc, IDT_NOR_D0, new); + patm_nor_write(sc, IDT_NOR_CMD, IDT_MKCMD_WUTIL(1, 0, reg)); + patm_cmd_wait(sc); + + return (0); +} + +/* + * Allocate a large chunk of DMA able memory for the transmit + * and receive status queues. We align this to a page boundary + * to ensure the alignment. + */ +static int +patm_sq_init(struct patm_softc *sc) +{ + int error; + void *p; + + /* compute size of the two queues */ + sc->sq_size = IDT_TSQ_SIZE * IDT_TSQE_SIZE + + PATM_RSQ_SIZE * IDT_RSQE_SIZE + + IDT_RAWHND_SIZE; + + patm_debug(sc, ATTACH, + "allocating status queues (%zu) ...", sc->sq_size); + + /* + * allocate tag + * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with + * bus_dmamem_alloc() + */ + error = bus_dma_tag_create(NULL, PATM_SQ_ALIGNMENT, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL, NULL, sc->sq_size, 1, sc->sq_size, + 0, NULL, NULL, &sc->sq_tag); + if (error) { + patm_printf(sc, "memory DMA tag create %d\n", error); + return (error); + } + + /* allocate memory */ + error = bus_dmamem_alloc(sc->sq_tag, &p, 0, &sc->sq_map); + if (error) { + patm_printf(sc, "memory DMA alloc %d\n", error); + bus_dma_tag_destroy(sc->sq_tag); + return (error); + } + + /* map it */ + sc->tsq_phy = 0x1fff; + error = bus_dmamap_load(sc->sq_tag, sc->sq_map, p, + sc->sq_size, patm_load_callback, &sc->tsq_phy, BUS_DMA_NOWAIT); + if (error) { + patm_printf(sc, "memory DMA map load %d\n", error); + bus_dmamem_free(sc->sq_tag, p, sc->sq_map); + bus_dma_tag_destroy(sc->sq_tag); + return (error); + } + + /* set queue start */ + sc->tsq = p; + sc->rsq = (void *)((char *)p + IDT_TSQ_SIZE * IDT_TSQE_SIZE); + sc->rsq_phy = sc->tsq_phy + IDT_TSQ_SIZE * IDT_TSQE_SIZE; + sc->rawhnd = (void *)((char *)sc->rsq + PATM_RSQ_SIZE * IDT_RSQE_SIZE); + sc->rawhnd_phy = sc->rsq_phy + PATM_RSQ_SIZE * IDT_RSQE_SIZE; + + return (0); +} + +/* + * Initialize all receive buffer stuff + */ +static int +patm_rbuf_init(struct patm_softc *sc) +{ + u_int i; + int error; + + patm_debug(sc, ATTACH, "allocating Rx buffer resources ..."); + /* + * Create a tag for small buffers. We allocate these page wise. + * Don't use BUS_DMA_ALLOCNOW, because we never need bouncing with + * bus_dmamem_alloc() + */ + if ((error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + SMBUF_PAGE_SIZE, 1, SMBUF_PAGE_SIZE, 0, + NULL, NULL, &sc->sbuf_tag)) != 0) { + patm_printf(sc, "sbuf DMA tag create %d\n", error); + return (error); + } + + error = mbp_create(&sc->sbuf_pool, "patm sbufs", sc->sbuf_tag, + SMBUF_MAX_PAGES, SMBUF_PAGE_SIZE, SMBUF_CHUNK_SIZE); + if (error != 0) { + patm_printf(sc, "smbuf pool create %d\n", error); + return (error); + } + + error = mbp_create(&sc->vbuf_pool, "patm vbufs", sc->sbuf_tag, + VMBUF_MAX_PAGES, SMBUF_PAGE_SIZE, VMBUF_CHUNK_SIZE); + if (error != 0) { + patm_printf(sc, "vmbuf pool create %d\n", error); + return (error); + } + + /* + * Create a tag for large buffers. + * Don't use BUS_DMA_ALLOCNOW, because it makes no sense with multiple + * maps using one tag. Rather use BUS_DMA_NOWAIT when loading the map + * to prevent EINPROGRESS. + */ + if ((error = bus_dma_tag_create(NULL, 4, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + MCLBYTES, 1, MCLBYTES, 0, + NULL, NULL, &sc->lbuf_tag)) != 0) { + patm_printf(sc, "lbuf DMA tag create %d\n", error); + return (error); + } + + if (sc->lbuf_max < IDT_FBQ_SIZE) + sc->lbuf_max = LMBUF_MAX; + sc->lbufs = malloc(sizeof(sc->lbufs[0]) * sc->lbuf_max, + M_DEVBUF, M_ZERO | M_WAITOK); + + SLIST_INIT(&sc->lbuf_free_list); + for (i = 0; i < sc->lbuf_max; i++) { + struct lmbuf *b = &sc->lbufs[i]; + + error = bus_dmamap_create(sc->lbuf_tag, 0, &b->map); + if (error) { + /* must deallocate here, because a test for NULL + * does not work on most archs */ + while (i-- > 0) + bus_dmamap_destroy(sc->lbuf_tag, + sc->lbufs[i].map); + free(sc->lbufs, M_DEVBUF); + sc->lbufs = NULL; + return (error); + } + b->handle = i; + SLIST_INSERT_HEAD(&sc->lbuf_free_list, b, link); + } + + return (0); +} + +/* + * Allocate everything needed for the transmission maps. + */ +static int +patm_txmap_init(struct patm_softc *sc) +{ + int error; + struct patm_txmap *map; + + /* get transmission tag */ + error = bus_dma_tag_create(NULL, 1, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL, NULL, 65536, IDT_SCQ_SIZE - 1, 65536, + 0, NULL, NULL, &sc->tx_tag); + if (error) { + patm_printf(sc, "cannot allocate TX tag %d\n", error); + return (error); + } + + if ((sc->tx_mapzone = uma_zcreate("PATM tx maps", + sizeof(struct patm_txmap), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0)) == NULL) + return (ENOMEM); + + if (sc->tx_maxmaps < PATM_CFG_TXMAPS_MAX) + sc->tx_maxmaps = PATM_CFG_TXMAPS_MAX; + sc->tx_nmaps = PATM_CFG_TXMAPS_INIT; + + for (sc->tx_nmaps = 0; sc->tx_nmaps < PATM_CFG_TXMAPS_INIT; + sc->tx_nmaps++) { + map = uma_zalloc(sc->tx_mapzone, M_WAITOK); + error = bus_dmamap_create(sc->tx_tag, 0, &map->map); + if (error) { + uma_zfree(sc->tx_mapzone, map); + return (ENOMEM); + } + SLIST_INSERT_HEAD(&sc->tx_maps_free, map, link); + } + + return (0); +} + +#ifdef PATM_DEBUG + +/* + * Sysctl handler for REGS + * + * LOCK: unlocked, needed + */ +static int +patm_sysctl_regs(SYSCTL_HANDLER_ARGS) +{ + struct patm_softc *sc = arg1; + uint32_t *ret; + int error, i; + + ret = malloc(IDT_NOR_END, M_TEMP, M_WAITOK); + + mtx_lock(&sc->mtx); + for (i = 0; i < IDT_NOR_END; i += 4) + ret[i / 4] = patm_nor_read(sc, i); + mtx_unlock(&sc->mtx); + + error = SYSCTL_OUT(req, ret, IDT_NOR_END); + free(ret, M_TEMP); + + return (error); +} + +/* + * Sysctl handler for TSQ + * + * LOCK: unlocked, needed + */ +static int +patm_sysctl_tsq(SYSCTL_HANDLER_ARGS) +{ + struct patm_softc *sc = arg1; + void *ret; + int error; + + ret = malloc(IDT_TSQ_SIZE * IDT_TSQE_SIZE, M_TEMP, M_WAITOK); + + mtx_lock(&sc->mtx); + memcpy(ret, sc->tsq, IDT_TSQ_SIZE * IDT_TSQE_SIZE); + mtx_unlock(&sc->mtx); + + error = SYSCTL_OUT(req, ret, IDT_TSQ_SIZE * IDT_TSQE_SIZE); + free(ret, M_TEMP); + + return (error); +} + +/* + * debugging + */ +static struct patm_softc * +patm_dump_unit(u_int unit) +{ + devclass_t dc; + struct patm_softc *sc; + + dc = devclass_find("patm"); + if (dc == NULL) { + printf("%s: can't find devclass\n", __func__); + return (NULL); + } + sc = devclass_get_softc(dc, unit); + if (sc == NULL) { + printf("%s: invalid unit number: %d\n", __func__, unit); + return (NULL); + } + return (sc); +} + +int +patm_dump_vc(u_int unit, u_int vc) +{ + struct patm_softc *sc; + uint32_t tct[8]; + uint32_t rct[4]; + uint32_t scd[12]; + u_int i; + + if ((sc = patm_dump_unit(unit)) == NULL) + return (0); + + for (i = 0; i < 8; i++) + tct[i] = patm_sram_read(sc, vc * 8 + i); + for (i = 0; i < 4; i++) + rct[i] = patm_sram_read(sc, sc->mmap->rct + vc * 4 + i); + for (i = 0; i < 12; i++) + scd[i] = patm_sram_read(sc, (tct[0] & 0x7ffff) + i); + + printf("TCT%3u: %08x %08x %08x %08x %08x %08x %08x %08x\n", vc, + tct[0], tct[1], tct[2], tct[3], tct[4], tct[5], tct[6], tct[7]); + printf("RCT%3u: %08x %08x %08x %08x\n", vc, + rct[0], rct[1], rct[2], rct[3]); + printf("SCD%3u: %08x %08x %08x %08x %08x %08x %08x %08x\n", vc, + scd[0], scd[1], scd[2], scd[3], scd[4], scd[5], scd[6], scd[7]); + printf(" %08x %08x %08x %08x\n", + scd[8], scd[9], scd[10], scd[11]); + + return (0); +} + +int +patm_dump_regs(u_int unit) +{ + struct patm_softc *sc; + u_int i; + + if ((sc = patm_dump_unit(unit)) == NULL) + return (0); + + for (i = 0; i <= IDT_NOR_DNOW; i += 4) + printf("%x: %08x\n", i, patm_nor_read(sc, i)); + + return (0); +} + +int +patm_dump_sram(u_int unit, u_int from, u_int words) +{ + struct patm_softc *sc; + u_int i; + + if ((sc = patm_dump_unit(unit)) == NULL) + return (0); + + for (i = 0; i < words; i++) { + if (i % 8 == 0) + printf("%05x:", from + i); + printf(" %08x", patm_sram_read(sc, from + i)); + if (i % 8 == 7) + printf("\n"); + } + if (i % 8 != 0) + printf("\n"); + return (0); +} +#endif diff --git a/sys/dev/patm/if_patm_intr.c b/sys/dev/patm/if_patm_intr.c new file mode 100644 index 000000000000..129d8cdf4595 --- /dev/null +++ b/sys/dev/patm/if_patm_intr.c @@ -0,0 +1,552 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Hartmut Brandt + * + * Driver for IDT77252 based cards like ProSum's. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_natm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +static void patm_feed_sbufs(struct patm_softc *sc); +static void patm_feed_lbufs(struct patm_softc *sc); +static void patm_feed_vbufs(struct patm_softc *sc); +static void patm_intr_tsif(struct patm_softc *sc); +static void patm_intr_raw(struct patm_softc *sc); + +#ifdef PATM_DEBUG +static int patm_mbuf_cnt(u_int unit) __unused; +#endif + +/* + * Write free buf Q + */ +static __inline void +patm_fbq_write(struct patm_softc *sc, u_int queue, uint32_t h0, + uint32_t p0, uint32_t h1, uint32_t p1) +{ + patm_debug(sc, FREEQ, "supplying(%u,%#x,%#x,%#x,%#x)", + queue, h0, p0, h1, p1); + patm_nor_write(sc, IDT_NOR_D0, h0); + patm_nor_write(sc, IDT_NOR_D1, p0); + patm_nor_write(sc, IDT_NOR_D2, h1); + patm_nor_write(sc, IDT_NOR_D3, p1); + patm_cmd_exec(sc, IDT_CMD_WFBQ | queue); +} + +/* + * Interrupt + */ +void +patm_intr(void *p) +{ + struct patm_softc *sc = p; + uint32_t stat, cfg; + u_int cnt; + const uint32_t ints = IDT_STAT_TSIF | IDT_STAT_TXICP | IDT_STAT_TSQF | + IDT_STAT_TMROF | IDT_STAT_PHYI | IDT_STAT_RSQF | IDT_STAT_EPDU | + IDT_STAT_RAWCF | IDT_STAT_RSQAF; + const uint32_t fbqa = IDT_STAT_FBQ3A | IDT_STAT_FBQ2A | + IDT_STAT_FBQ1A | IDT_STAT_FBQ0A; + + mtx_lock(&sc->mtx); + + stat = patm_nor_read(sc, IDT_NOR_STAT); + patm_nor_write(sc, IDT_NOR_STAT, stat & (ints | fbqa)); + + if (!(sc->ifatm.ifnet.if_flags & IFF_RUNNING)) { + /* if we are stopped ack all interrupts and handle PHYI */ + if (stat & IDT_STAT_PHYI) { + patm_debug(sc, INTR, "PHYI (stopped)"); + utopia_intr(&sc->utopia); + } + mtx_unlock(&sc->mtx); + return; + } + + patm_debug(sc, INTR, "stat=%08x", stat); + + /* + * If the buffer queues are empty try to fill them. If this fails + * disable the interrupt. Otherwise enable the interrupt. + */ + if (stat & fbqa) { + cfg = patm_nor_read(sc, IDT_NOR_CFG); + if (stat & IDT_STAT_FBQ0A) + patm_feed_sbufs(sc); + if (stat & IDT_STAT_FBQ1A) + patm_feed_lbufs(sc); + if (stat & IDT_STAT_FBQ2A) { + /* + * Workaround for missing interrupt on AAL0. Check the + * receive status queue if the FBQ2 is not full. + */ + patm_intr_rsq(sc); + patm_feed_vbufs(sc); + } + if ((patm_nor_read(sc, IDT_NOR_STAT) & fbqa) && + (cfg & IDT_CFG_FBIE)) { + /* failed */ + patm_nor_write(sc, IDT_NOR_CFG, cfg & ~IDT_CFG_FBIE); + patm_printf(sc, "out of buffers -- intr disabled\n"); + } else if (!(cfg & IDT_CFG_FBIE)) { + patm_printf(sc, "bufQ intr re-enabled\n"); + patm_nor_write(sc, IDT_NOR_CFG, cfg | IDT_CFG_FBIE); + } + patm_nor_write(sc, IDT_NOR_STAT, fbqa); + } + + cnt = 0; + while ((stat & ints) != 0) { + if (++cnt == 200) { + patm_printf(sc, "%s: excessive interrupts\n", __func__); + patm_stop(sc); + break; + } + if (stat & IDT_STAT_TSIF) { + patm_debug(sc, INTR, "TSIF"); + patm_intr_tsif(sc); + } + if (stat & IDT_STAT_TXICP) { + patm_printf(sc, "incomplete PDU transmitted\n"); + } + if (stat & IDT_STAT_TSQF) { + patm_printf(sc, "TSQF\n"); + patm_intr_tsif(sc); + } + if (stat & IDT_STAT_TMROF) { + patm_debug(sc, INTR, "TMROF"); + patm_intr_tsif(sc); + } + if (stat & IDT_STAT_PHYI) { + patm_debug(sc, INTR, "PHYI"); + utopia_intr(&sc->utopia); + } + if (stat & IDT_STAT_RSQF) { + patm_printf(sc, "RSQF\n"); + patm_intr_rsq(sc); + } + if (stat & IDT_STAT_EPDU) { + patm_debug(sc, INTR, "EPDU"); + patm_intr_rsq(sc); + } + if (stat & IDT_STAT_RAWCF) { + patm_debug(sc, INTR, "RAWCF"); + patm_intr_raw(sc); + } + if (stat & IDT_STAT_RSQAF) { + patm_debug(sc, INTR, "RSQAF"); + patm_intr_rsq(sc); + } else if (IDT_STAT_FRAC2(stat) != 0xf) { + /* + * Workaround for missing interrupt on AAL0. Check the + * receive status queue if the FBQ2 is not full. + */ + patm_intr_rsq(sc); + } + + stat = patm_nor_read(sc, IDT_NOR_STAT); + patm_nor_write(sc, IDT_NOR_STAT, ints & stat); + patm_debug(sc, INTR, "stat=%08x", stat); + } + + mtx_unlock(&sc->mtx); + + patm_debug(sc, INTR, "... exit"); +} + +/* + * Compute the amount of buffers to feed into a given free buffer queue + * + * Feeding buffers is actually not so easy as it seems. We cannot use the + * fraction fields in the status registers, because they round down, i.e. + * if we have 34 buffers in the queue, it will show 1. If we now feed + * 512 - 1 * 32 buffers, we loose two buffers. The only reliable way to know + * how many buffers are in the queue are the FBQP registers. + */ +static u_int +patm_feed_cnt(struct patm_softc *sc, u_int q) +{ + u_int w, r, reg; + u_int feed; + int free; + + /* get the FBQ read and write pointers */ + reg = patm_nor_read(sc, IDT_NOR_FBQP0 + 4 * q); + r = (reg & 0x7ff) >> 1; + w = ((reg >> 16) & 0x7ff) >> 1; + /* compute amount of free buffers */ + if ((free = w - r) < 0) + free += 0x400; + KASSERT(free <= 512, ("bad FBQP 0x%x", reg)); + feed = 512 - free; + + /* can only feed pairs of buffers */ + feed &= ~1; + + if (feed > 0) + feed -= 2; + + patm_debug(sc, FREEQ, "feeding %u buffers into queue %u", feed, q); + + return (feed); +} + +/* + * Feed small buffers into buffer queue 0 + * + */ +static void +patm_feed_sbufs(struct patm_softc *sc) +{ + u_int feed; + bus_addr_t p0, p1; + void *v0, *v1; + uint32_t h0, h1; + + feed = patm_feed_cnt(sc, 0); + + while (feed > 0) { + if ((v0 = mbp_alloc(sc->sbuf_pool, &p0, &h0)) == NULL) + break; + if ((v1 = mbp_alloc(sc->sbuf_pool, &p1, &h1)) == NULL) { + mbp_free(sc->sbuf_pool, v0); + break; + } + patm_fbq_write(sc, 0, + h0 | MBUF_SHANDLE, (p0 + SMBUF_OFFSET), + h1 | MBUF_SHANDLE, (p1 + SMBUF_OFFSET)); + + feed -= 2; + } +} + +/* + * Feed small buffers into buffer queue 0 + */ +static void +patm_feed_vbufs(struct patm_softc *sc) +{ + u_int feed; + bus_addr_t p0, p1; + void *v0, *v1; + uint32_t h0, h1; + + feed = patm_feed_cnt(sc, 2); + + while (feed > 0) { + if ((v0 = mbp_alloc(sc->vbuf_pool, &p0, &h0)) == NULL) + break; + if ((v1 = mbp_alloc(sc->vbuf_pool, &p1, &h1)) == NULL) { + mbp_free(sc->vbuf_pool, v0); + break; + } + patm_fbq_write(sc, 2, + h0 | MBUF_VHANDLE, (p0 + VMBUF_OFFSET), + h1 | MBUF_VHANDLE, (p1 + VMBUF_OFFSET)); + + feed -= 2; + } +} + +/* + * Allocate a large buffer + */ +static struct lmbuf * +patm_lmbuf_alloc(struct patm_softc *sc) +{ + int error; + struct mbuf *m; + struct lmbuf *b; + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (NULL); + m->m_data += LMBUF_OFFSET; + + if ((b = SLIST_FIRST(&sc->lbuf_free_list)) == NULL) { + m_freem(m); + return (NULL); + } + + b->phy = 0; /* alignment */ + error = bus_dmamap_load(sc->lbuf_tag, b->map, m->m_data, LMBUF_SIZE, + patm_load_callback, &b->phy, BUS_DMA_NOWAIT); + if (error) { + patm_printf(sc, "%s -- bus_dmamap_load: %d\n", __func__, error); + m_free(m); + return (NULL); + } + + SLIST_REMOVE_HEAD(&sc->lbuf_free_list, link); + b->m = m; + + return (b); +} + +/* + * Feed large buffers into buffer queue 1 + */ +static void +patm_feed_lbufs(struct patm_softc *sc) +{ + u_int feed; + struct lmbuf *b0, *b1; + + feed = patm_feed_cnt(sc, 1); + + while (feed > 0) { + if ((b0 = patm_lmbuf_alloc(sc)) == NULL) + break; + if ((b1 = patm_lmbuf_alloc(sc)) == NULL) { + patm_lbuf_free(sc, b0); + break; + } + patm_fbq_write(sc, 1, + LMBUF_HANDLE | b0->handle, b0->phy, + LMBUF_HANDLE | b1->handle, b1->phy); + + feed -= 2; + } +} + +/* + * Handle transmit status interrupt + */ +static void +patm_intr_tsif(struct patm_softc *sc) +{ + struct idt_tsqe *tsqe = sc->tsq_next;; + struct idt_tsqe *prev = NULL; + uint32_t stamp; + + stamp = le32toh(tsqe->stamp); + if (stamp & IDT_TSQE_EMPTY) + return; + + do { + switch (IDT_TSQE_TYPE(stamp)) { + + case IDT_TSQE_TBD: + patm_tx(sc, stamp, le32toh(tsqe->stat)); + break; + + case IDT_TSQE_IDLE: + patm_tx_idle(sc, le32toh(tsqe->stat)); + break; + } + + /* recycle */ + tsqe->stat = 0; + tsqe->stamp = htole32(IDT_TSQE_EMPTY); + + /* save pointer to this entry and advance */ + prev = tsqe; + if (++tsqe == &sc->tsq[IDT_TSQ_SIZE]) + tsqe = &sc->tsq[0]; + + stamp = le32toh(tsqe->stamp); + } while (!(stamp & IDT_TSQE_EMPTY)); + + sc->tsq_next = tsqe; + patm_nor_write(sc, IDT_NOR_TSQH, ((prev - sc->tsq) << IDT_TSQE_SHIFT)); +} + +/* + * Handle receive interrupt + */ +void +patm_intr_rsq(struct patm_softc *sc) +{ + struct idt_rsqe *rsqe; + u_int stat; + + if (sc->rsq_last + 1 == PATM_RSQ_SIZE) + rsqe = &sc->rsq[0]; + else + rsqe = &sc->rsq[sc->rsq_last + 1]; + stat = le32toh(rsqe->stat); + if (!(stat & IDT_RSQE_VALID)) + return; + + while (stat & IDT_RSQE_VALID) { + patm_rx(sc, rsqe); + + /* recycle RSQE */ + rsqe->cid = 0; + rsqe->handle = 0; + rsqe->crc = 0; + rsqe->stat = 0; + + /* save pointer to this entry and advance */ + if (++sc->rsq_last == PATM_RSQ_SIZE) + sc->rsq_last = 0; + if (++rsqe == &sc->rsq[PATM_RSQ_SIZE]) + rsqe = sc->rsq; + + stat = le32toh(rsqe->stat); + } + + patm_nor_write(sc, IDT_NOR_RSQH, sc->rsq_phy | (sc->rsq_last << 2)); + + patm_feed_sbufs(sc); + patm_feed_lbufs(sc); + patm_feed_vbufs(sc); +} + +/* + * Handle raw cell receive. + * + * Note that the description on page 3-8 is wrong. The RAWHND contains not + * the same value as RAWCT. RAWCT points to the next address the chip is + * going to write to whike RAWHND points to the last cell's address the chip + * has written to. + */ +static void +patm_intr_raw(struct patm_softc *sc) +{ + uint32_t tail; + uint32_t h, *cell; + +#ifdef notyet + bus_dma_sync_size(sc->sq_tag, sc->sq_map, IDT_TSQ_SIZE * IDT_TSQE_SIZE + + PATM_RSQ_SIZE * IDT_RSQE_SIZE, sizeof(*sc->rawhnd), + BUS_DMASYNC_POSTREAD); +#endif + /* first turn */ + if (sc->rawh == NULL) { + sc->rawh = &sc->lbufs[le32toh(sc->rawhnd->handle) & MBUF_HMASK]; + } + tail = le32toh(sc->rawhnd->tail); + if (tail == sc->rawh->phy) + /* not really a raw interrupt */ + return; + + while (tail + 64 != sc->rawh->phy + sc->rawi * 64) { +#ifdef notyet + bus_dmamap_sync_size(sc->lbuf_tag, sc->rawh->map, + sc->rawi * 64, 64, BUS_DMASYNC_POSTREAD); +#endif + cell = (uint32_t *)(mtod(sc->rawh->m, u_char *) + + sc->rawi * 64); + if (sc->rawi == (LMBUF_SIZE / 64) - 1) { + /* chain */ + h = le32toh(cell[1]); + patm_lbuf_free(sc, sc->rawh); + sc->rawh = &sc->lbufs[h & MBUF_HMASK]; + sc->rawi = 0; + continue; + } + + patm_rx_raw(sc, (u_char *)cell); + sc->rawi++; + } +} + +/* + * Free a large mbuf. This is called by us. + */ +void +patm_lbuf_free(struct patm_softc *sc, struct lmbuf *b) +{ + + bus_dmamap_unload(sc->lbuf_tag, b->map); + if (b->m != NULL) { + m_free(b->m); + b->m = NULL; + } + SLIST_INSERT_HEAD(&sc->lbuf_free_list, b, link); +} + +#ifdef PATM_DEBUG +static int +patm_mbuf_cnt(u_int unit) +{ + devclass_t dc; + struct patm_softc *sc; + u_int used, card, free; + + dc = devclass_find("patm"); + if (dc == NULL) { + printf("%s: can't find devclass\n", __func__); + return (0); + } + sc = devclass_get_softc(dc, unit); + if (sc == NULL) { + printf("%s: invalid unit number: %d\n", __func__, unit); + return (0); + } + + mbp_count(sc->sbuf_pool, &used, &card, &free); + printf("sbufs: %u on card, %u used, %u free\n", card, used, free); + + mbp_count(sc->vbuf_pool, &used, &card, &free); + printf("aal0 bufs: %u on card, %u used, %u free\n", card, used, free); + + return (0); +} +#endif diff --git a/sys/dev/patm/if_patm_ioctl.c b/sys/dev/patm/if_patm_ioctl.c new file mode 100644 index 000000000000..c91e714232b1 --- /dev/null +++ b/sys/dev/patm/if_patm_ioctl.c @@ -0,0 +1,450 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Hartmut Brandt + * + * Driver for IDT77252 based cards like ProSum's. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_natm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +/* + * Open the VCC with the given parameters + */ +static int +patm_open_vcc(struct patm_softc *sc, struct atmio_openvcc *arg, u_int async) +{ + u_int cid; + struct patm_vcc *vcc; + int error = 0; + + patm_debug(sc, VCC, "Open VCC: %u.%u flags=%#x", arg->param.vpi, + arg->param.vci, arg->param.flags); + + if (!LEGAL_VPI(sc, arg->param.vpi) || !LEGAL_VCI(sc, arg->param.vci)) + return (EINVAL); + if (arg->param.vci == 0 && (arg->param.vpi != 0 || + !(arg->param.flags & ATMIO_FLAG_NOTX) || + arg->param.aal != ATMIO_AAL_RAW)) + return (EINVAL); + cid = PATM_CID(sc, arg->param.vpi, arg->param.vci); + + if ((arg->param.flags & ATMIO_FLAG_NOTX) && + (arg->param.flags & ATMIO_FLAG_NORX)) + return (EINVAL); + + if ((arg->param.traffic == ATMIO_TRAFFIC_ABR) && + (arg->param.flags & (ATMIO_FLAG_NOTX | ATMIO_FLAG_NORX))) + return (EINVAL); + + /* allocate vcc */ + vcc = uma_zalloc(sc->vcc_zone, M_NOWAIT | M_ZERO); + if (vcc == NULL) + return (ENOMEM); + + mtx_lock(&sc->mtx); + if (!(sc->ifatm.ifnet.if_flags & IFF_RUNNING)) { + /* stopped while we have analyzed the arguments */ + error = EIO; + goto done; + } + if (sc->vccs[cid] != NULL) { + /* ups, already open */ + error = EBUSY; + goto done; + } + + /* check some parameters */ + vcc->cid = cid; + vcc->vcc = arg->param; + vcc->vflags = async; + vcc->rxhand = arg->rxhand; + switch (vcc->vcc.aal) { + + case ATMIO_AAL_0: + case ATMIO_AAL_34: + case ATMIO_AAL_5: + break; + + case ATMIO_AAL_RAW: + if (arg->param.vci == 0 && + !(arg->param.flags & ATMIO_FLAG_NOTX)) { + error = EINVAL; + goto done; + } + break; + + default: + error = EINVAL; + goto done; + } + switch (vcc->vcc.traffic) { + + case ATMIO_TRAFFIC_VBR: + case ATMIO_TRAFFIC_UBR: + case ATMIO_TRAFFIC_CBR: + case ATMIO_TRAFFIC_ABR: + break; + + default: + error = EINVAL; + goto done; + } + + /* initialize */ + vcc->chain = NULL; + vcc->last = NULL; + vcc->ibytes = vcc->ipackets = 0; + vcc->obytes = vcc->opackets = 0; + + /* ask the TX and RX sides */ + patm_debug(sc, VCC, "Open VCC: asking Rx/Tx"); + if (!(vcc->vcc.flags & ATMIO_FLAG_NOTX) && + (error = patm_tx_vcc_can_open(sc, vcc)) != 0) + goto done; + if (!(vcc->vcc.flags & ATMIO_FLAG_NORX) && + (error = patm_rx_vcc_can_open(sc, vcc)) != 0) + goto done; + + /* ok - go ahead */ + sc->vccs[cid] = vcc; + + patm_debug(sc, VCC, "Open VCC: opening"); + if (!(vcc->vcc.flags & ATMIO_FLAG_NOTX)) + patm_tx_vcc_open(sc, vcc); + if (!(vcc->vcc.flags & ATMIO_FLAG_NORX)) + patm_rx_vcc_open(sc, vcc); + +#ifdef notyet + /* inform management about non-NG and NG-PVCs */ + if (!(vcc->vcc.flags & ATMIO_FLAG_NG) || + (vcc->vcc.flags & ATMIO_FLAG_PVC)) + atm_message(&sc->ifatm.ifnet, ATM_MSG_VCC_CHANGED, + (1 << 24) | (vcc->vcc.vpi << 16) | vcc->vcc.vci); +#endif + + patm_debug(sc, VCC, "Open VCC: now open"); + + /* don't free below */ + vcc = NULL; + + sc->vccs_open++; + + /* done */ + done: + mtx_unlock(&sc->mtx); + if (vcc != NULL) + uma_zfree(sc->vcc_zone, vcc); + return (error); +} + +/* + * Enable ioctl for NATM. Map to an open ioctl. + */ +static int +patm_open_vcc1(struct patm_softc *sc, struct atm_pseudoioctl *ph) +{ + struct atmio_openvcc v; + + bzero(&v, sizeof(v)); + v.param.flags = ATM_PH_FLAGS(&ph->aph) & (ATM_PH_AAL5 | ATM_PH_LLCSNAP); + v.param.vpi = ATM_PH_VPI(&ph->aph); + v.param.vci = ATM_PH_VCI(&ph->aph); + v.param.aal = (ATM_PH_FLAGS(&ph->aph) & ATM_PH_AAL5) + ? ATMIO_AAL_5 : ATMIO_AAL_0; + v.param.traffic = ATMIO_TRAFFIC_UBR;; + v.param.tparam.pcr = sc->ifatm.mib.pcr; + v.rxhand = ph->rxhand; + + return (patm_open_vcc(sc, &v, PATM_VCC_ASYNC)); +} + +/* + * Try to close the given VCC + */ +static int +patm_close_vcc(struct patm_softc *sc, struct atmio_closevcc *arg) +{ + u_int cid; + struct patm_vcc *vcc; + int error = 0; + + patm_debug(sc, VCC, "Close VCC: %u.%u", arg->vpi, arg->vci); + + if (!LEGAL_VPI(sc, arg->vpi) || !LEGAL_VCI(sc, arg->vci)) + return (EINVAL); + cid = PATM_CID(sc, arg->vpi, arg->vci); + + mtx_lock(&sc->mtx); + if (!(sc->ifatm.ifnet.if_flags & IFF_RUNNING)) { + /* stopped while we have analyzed the arguments */ + error = EIO; + goto done; + } + + vcc = sc->vccs[cid]; + if (vcc == NULL || !(vcc->vflags & PATM_VCC_OPEN)) { + error = ENOENT; + goto done; + } + + if (vcc->vflags & PATM_VCC_TX_OPEN) + patm_tx_vcc_close(sc, vcc); + if (vcc->vflags & PATM_VCC_RX_OPEN) + patm_rx_vcc_close(sc, vcc); + + if (vcc->vflags & PATM_VCC_ASYNC) + goto done; + + while (vcc->vflags & (PATM_VCC_TX_CLOSING | PATM_VCC_RX_CLOSING)) { + cv_wait(&sc->vcc_cv, &sc->mtx); + if (!(sc->ifatm.ifnet.if_flags & IFF_RUNNING)) { + /* ups, has been stopped */ + error = EIO; + goto done; + } + } + + if (!(vcc->vcc.flags & ATMIO_FLAG_NOTX)) + patm_tx_vcc_closed(sc, vcc); + if (!(vcc->vcc.flags & ATMIO_FLAG_NORX)) + patm_rx_vcc_closed(sc, vcc); + + patm_vcc_closed(sc, vcc); + + done: + mtx_unlock(&sc->mtx); + + return (error); +} + +/* + * Close a VCC asynchronuosly + */ +static int +patm_close_vcc1(struct patm_softc *sc, struct atm_pseudoioctl *ph) +{ + struct atmio_closevcc v; + + v.vpi = ATM_PH_VPI(&ph->aph); + v.vci = ATM_PH_VCI(&ph->aph); + + return (patm_close_vcc(sc, &v)); +} + +/* + * VCC has been finally closed. + */ +void +patm_vcc_closed(struct patm_softc *sc, struct patm_vcc *vcc) +{ + +#ifdef notyet + /* inform management about non-NG and NG-PVCs */ + if (!(vcc->vcc.flags & ATMIO_FLAG_NG) || + (vcc->vcc.flags & ATMIO_FLAG_PVC)) + atm_message(&sc->ifatm.ifnet, ATM_MSG_VCC_CHANGED, + (0 << 24) | (vcc->vcc.vpi << 16) | vcc->vcc.vci); +#endif + + sc->vccs_open--; + sc->vccs[vcc->cid] = NULL; + uma_zfree(sc->vcc_zone, vcc); +} + +int +patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct ifreq *ifr = (struct ifreq *)data; + struct ifaddr *ifa = (struct ifaddr *)data; + struct patm_softc *sc = ifp->if_softc; + int error = 0; + uint32_t cfg; + struct atmio_vcctable *vtab; + + switch (cmd) { + + case SIOCSIFADDR: + mtx_lock(&sc->mtx); + ifp->if_flags |= IFF_UP; + if (!(ifp->if_flags & IFF_RUNNING)) + patm_initialize(sc); + switch (ifa->ifa_addr->sa_family) { + +#ifdef INET + case AF_INET: + case AF_INET6: + ifa->ifa_rtrequest = atm_rtrequest; + break; +#endif + default: + break; + } + mtx_unlock(&sc->mtx); + break; + + case SIOCSIFFLAGS: + mtx_lock(&sc->mtx); + if (ifp->if_flags & IFF_UP) { + if (!(ifp->if_flags & IFF_RUNNING)) { + patm_initialize(sc); + } + } else { + if (ifp->if_flags & IFF_RUNNING) { + patm_stop(sc); + } + } + mtx_unlock(&sc->mtx); + break; + + case SIOCGIFMEDIA: + case SIOCSIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &sc->media, cmd); + + /* + * We need to toggle unassigned/idle cells ourself because + * the 77252 generates null cells for spacing. When switching + * null cells of it gets the timing wrong. + */ + mtx_lock(&sc->mtx); + if (ifp->if_flags & IFF_RUNNING) { + if (sc->utopia.state & UTP_ST_UNASS) { + if (!(sc->flags & PATM_UNASS)) { + cfg = patm_nor_read(sc, IDT_NOR_CFG); + cfg &= ~IDT_CFG_IDLECLP; + patm_nor_write(sc, IDT_NOR_CFG, cfg); + sc->flags |= PATM_UNASS; + } + } else { + if (sc->flags & PATM_UNASS) { + cfg = patm_nor_read(sc, IDT_NOR_CFG); + cfg |= IDT_CFG_IDLECLP; + patm_nor_write(sc, IDT_NOR_CFG, cfg); + sc->flags &= ~PATM_UNASS; + } + } + } else { + if (sc->utopia.state & UTP_ST_UNASS) + sc->flags |= PATM_UNASS; + else + sc->flags &= ~PATM_UNASS; + } + mtx_unlock(&sc->mtx); + break; + + case SIOCSIFMTU: + /* + * Set the interface MTU. + */ + if (ifr->ifr_mtu > ATMMTU) + error = EINVAL; + else + ifp->if_mtu = ifr->ifr_mtu; + break; + + case SIOCATMOPENVCC: /* netgraph/harp internal use */ + error = patm_open_vcc(sc, (struct atmio_openvcc *)data, 0); + break; + + case SIOCATMCLOSEVCC: /* netgraph and HARP internal use */ + error = patm_close_vcc(sc, (struct atmio_closevcc *)data); + break; + + case SIOCATMENA: /* NATM internal use */ + error = patm_open_vcc1(sc, (struct atm_pseudoioctl *)data); + break; + + case SIOCATMDIS: /* NATM internal use */ + error = patm_close_vcc1(sc, (struct atm_pseudoioctl *)data); + break; + + case SIOCATMGVCCS: /* external use */ + /* return vcc table */ + vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, + sc->mmap->max_conn, sc->vccs_open, &sc->mtx, 1); + error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + vtab->count * sizeof(vtab->vccs[0])); + free(vtab, M_DEVBUF); + break; + + case SIOCATMGETVCCS: /* netgraph internal use */ + vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, + sc->mmap->max_conn, sc->vccs_open, &sc->mtx, 0); + if (vtab == NULL) { + error = ENOMEM; + break; + } + *(void **)data = vtab; + break; + + default: + patm_debug(sc, IOCTL, "unknown cmd=%08lx arg=%p", cmd, data); + error = EINVAL; + break; + } + + return (error); +} diff --git a/sys/dev/patm/if_patm_rtables.c b/sys/dev/patm/if_patm_rtables.c new file mode 100644 index 000000000000..f945276690b4 --- /dev/null +++ b/sys/dev/patm/if_patm_rtables.c @@ -0,0 +1,9079 @@ +/* + * This file was generated by `genrtables/genrtab' + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +const u_int patm_rtables_size = 128 * (4 + 2 * 16); +const u_int patm_rtables_ntab = 16; + +/* + * Tables for 352768cps and 155Mbps + */ +const uint32_t patm_rtables155[128 * (4 + 2 * 16)] = { +0x8d022e27, +0x8d362e11, +0x8d702bf7, +0x8daa2bce, +0x8de62ba7, +0x8e262b81, +0x8e682b5d, +0x8eac2b3b, +0x8ef42b19, +0x8f402af9, +0x8f8c2adb, +0x8fde2abd, +0x901a2aa1, +0x90462a86, +0x90722a6c, +0x90a22a53, +0x90d42a3b, +0x91082a24, +0x913e2a0e, +0x917627f2, +0x91b227c9, +0x91ee27a2, +0x922e277d, +0x92702759, +0x92b62736, +0x92fe2715, +0x934626f6, +0x939626d7, +0x93e626ba, +0x941e269e, +0x944a2683, +0x94782669, +0x94a82650, +0x94dc2638, +0x95106621, +0x9546660b, +0x957e63ed, +0x95b863c5, +0x95f4639e, +0x96366378, +0x96786355, +0x96be6332, +0x97066311, +0x975062f2, +0x97a062d3, +0x97f262b6, +0x9824629a, +0x98506280, +0x987e6266, +0x98ae624d, +0x98e26235, +0x9914a21f, +0x994ca209, +0x99849fe8, +0x99be9fc0, +0x99fe9f99, +0x9a3e9f74, +0x9a809f51, +0x9ac69f2e, +0x9b0e9f0e, +0x9b5a9eee, +0x9ba89ed0, +0x9bfc9eb3, +0x9c2a9e97, +0x9c569e7c, +0x9c849e63, +0x9cb49e4a, +0x9ce69e33, +0x9d1cde1c, +0x9d54de06, +0x9d8cdbe3, +0x9dc6dbbb, +0x9e04db95, +0x9e44db70, +0x9e88db4c, +0x9ed0db2a, +0x9f16db0a, +0x9f64daea, +0x9fb4dacc, +0xa002dab0, +0xa02eda94, +0xa05cda79, +0xa08ada60, +0xa0bcda47, +0xa0ecda30, +0xa1231a19, +0xa1591a04, +0xa19317de, +0xa1cf17b6, +0xa20d1790, +0xa24f176b, +0xa2911748, +0xa2d91726, +0xa3211706, +0xa36d16e7, +0xa3bd16c9, +0xa40916ac, +0xa4331691, +0xa4611676, +0xa491165d, +0xa4c31644, +0xa4f5162d, +0xa5291617, +0xa5611601, +0xa59b13d9, +0xa5d513b2, +0xa615138c, +0xa6571367, +0xa6991344, +0xa6e11322, +0xa72b1302, +0xa77712e3, +0xa7c912c5, +0xa80f12a9, +0xa83b128d, +0xa8671273, +0xa895125a, +0xa8c71242, +0xa8fb122a, +0xa9311214, +0xa9670ffe, +0xa9a10fd5, +0xa9dd0fad, +0xaa1d0f87, +0xaa5d0f63, +0xaaa10f40, +0xaae90f1f, +0xab350efe, +0xab7f0ee0, +0xabd10ec2, +0xac150ea5, +0xac3f0e8a, +0xac6d0e70, +0xac9b0e57, +0xaccd0e3f, +0xad010e28, +0xad370e11, +0xad6d0bf9, +0xada70bd0, +0xade30ba9, +0xae230b83, +0xae650b5f, +0xaeab0b3c, +0xaef10b1b, +0xaf3b0afb, +0xaf890adc, +0xafdd0abe, +0xb0190aa2, +0xb0450a87, +0xb0730a6d, +0xb0a10a54, +0xb0d30a3c, +0xb1070a25, +0xb13d0a0f, +0xb17507f4, +0xb1af07cb, +0xb1ed07a4, +0xb22d077e, +0xb26f075a, +0xb2b30738, +0xb2f90717, +0xb34506f7, +0xb39506d8, +0xb3e506bb, +0xb41d069f, +0xb4490684, +0xb477066a, +0xb4a70651, +0xb4d90639, +0xb50f0622, +0xb545060c, +0xb57b03ef, +0xb5b703c6, +0xb5f5039f, +0xb633037a, +0xb6770356, +0xb6bb0334, +0xb7030313, +0xb74f02f3, +0xb79d02d5, +0xb7ed02b8, +0xb823029c, +0xb84f0281, +0xb87d0267, +0xb8ad024e, +0xb8e10236, +0xb9130220, +0xb949020a, +0xb98301f5, +0xb9bd01e1, +0xb9fd01cd, +0xba3b01bb, +0xba7f01a9, +0xbac30198, +0xbb0f0187, +0xbb5b0177, +0xbba90168, +0xbbf9015a, +0xbc29014c, +0xbc53013f, +0xbc830132, +0xbcb50125, +0xbce5011a, +0xbd1d010e, +0xbd550103, +0xbd8b00f9, +0xbdc700ef, +0xbe0700e5, +0xbe4500dc, +0xbe8900d3, +0xbecb00cb, +0xbf1d00c2, +0xbf6100bb, +0xbfb500b3, +0xc00300ac, +0xc02f00a5, +0xc05f009e, +0xc08b0098, +0xc0bb0092, +0xc0ed008c, +0xc1270086, +0xc1590081, +0xc191007c, +0xc1cd0077, +0xc20d0072, +0xc255006d, +0xc2910069, +0xc2d50065, +0xc32f0060, +0xc36b005d, +0xc3bf0059, +0xc40f0055, +0xc4350052, +0xc46d004e, +0xc499004b, +0xc4cb0048, +0xc5010045, +0xc5270043, +0xc5630040, +0xc5a7003d, +0xc5d9003b, +0xc6290038, +0xc6630036, +0xc6a10034, +0xc6e50032, +0xc72f0030, +0xc77f002e, +0xc7d7002c, +0xc81b002a, +0xc8510028, +0xc86d0027, +0xc8a90025, +0xc8cb0024, +0xc9130022, +0xc93b0021, +0xc9630020, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x03020100, +0x07060504, +0x0b0a0908, +0x100e0d0b, +0x14131211, +0x18171615, +0x1c1b1a19, +0x211f1e1c, +0x25242322, +0x29282726, +0x2c2c2b2a, +0x31302f2d, +0x36353433, +0x3a393837, +0x3d3d3c3b, +0x4241403e, +0x47464544, +0x4b4a4948, +0x4e4d4d4c, +0x5352504f, +0x58575654, +0x5c5b5a59, +0x5f5e5d5d, +0x64636160, +0x69686665, +0x6d6c6b6a, +0x706f6e6d, +0x75747271, +0x7a787776, +0x7d7d7c7b, +0x81807f7e, +0x86848382, +0x8a898887, +0x8e8d8c8b, +0x9291908f, +0x97959492, +0x9b9a9998, +0x9f9e9d9c, +0xa3a2a1a0, +0xa8a6a5a3, +0xacabaaa9, +0xb0afaead, +0xb3b3b2b1, +0xb8b7b6b4, +0xbdbcbbba, +0xc1c0bfbe, +0xc4c4c3c2, +0xc9c8c7c5, +0xcecdcccb, +0xd2d1d0cf, +0xd5d4d4d3, +0xdad9d7d6, +0xdfdedddb, +0xe3e2e1e0, +0xe6e5e4e4, +0xebeae8e7, +0xf0efeeec, +0xf4f3f2f1, +0xf7f6f5f5, +0xfcfbf9f8, +0xfffffefd, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0x000064b1, +0x000062b1, +0x000160b1, +0x00015eb1, +0x00035cb1, +0x00035ab1, +0x00030000, +0x00030000, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +/* AIR 0: diff=352768.000000 */ +0x3bf83bfc, +0x3bf03bf4, +0x3be83bec, +0x3be03be4, +0x3bd83bdc, +0x3bd03bd4, +0x3bc83bcc, +0x3bc03bc4, +0x3bb83bbc, +0x3bb03bb4, +0x3ba83bac, +0x3ba03ba4, +0x3b983b9c, +0x3b903b94, +0x3b883b8c, +0x3b803b84, +0x3b783b7c, +0x3b703b74, +0x3b683b6c, +0x3b603b64, +0x3b583b5c, +0x3b503b54, +0x3b483b4c, +0x3b403b44, +0x3b383b3c, +0x3b303b34, +0x3b283b2c, +0x3b203b24, +0x3b183b1c, +0x3b103b14, +0x3b083b0c, +0x3b003b04, +0x3af83afc, +0x3af03af4, +0x3ae83aec, +0x3ae03ae4, +0x3ad83adc, +0x3ad03ad4, +0x3ac83acc, +0x3ac03ac4, +0x3ab83abc, +0x3ab03ab4, +0x3aa83aac, +0x3aa03aa4, +0x3a983a9c, +0x3a903a94, +0x3a883a8c, +0x3a803a84, +0x3a783a7c, +0x3a703a74, +0x3a683a6c, +0x3a603a64, +0x3a583a5c, +0x3a503a54, +0x3a483a4c, +0x3a403a44, +0x3a383a3c, +0x3a303a34, +0x3a283a2c, +0x3a203a24, +0x3a183a1c, +0x3a103a14, +0x3a083a0c, +0x3a003a04, +0x37f037f8, +0x37e037e8, +0x37d037d8, +0x37c037c8, +0x37b037b8, +0x37a037a8, +0x37903798, +0x37803788, +0x37703778, +0x37603768, +0x37503758, +0x37403748, +0x37303738, +0x37203728, +0x37103718, +0x37003708, +0x36f036f8, +0x36e036e8, +0x36d036d8, +0x36c036c8, +0x36b036b8, +0x36a036a8, +0x36903698, +0x36803688, +0x36703678, +0x36603668, +0x36503658, +0x36403648, +0x36303638, +0x36203628, +0x36103618, +0x36003608, +0x33e033f0, +0x33c033d0, +0x33a033b0, +0x33803390, +0x33603370, +0x33403350, +0x33203330, +0x33003310, +0x32e032f0, +0x32c032d0, +0x32a032b0, +0x32803290, +0x32603270, +0x32403250, +0x32203230, +0x32003210, +0x2fc02fe0, +0x2f802fa0, +0x2f402f60, +0x2f002f20, +0x2ec02ee0, +0x2e802ea0, +0x2e402e60, +0x2e002e20, +0x2b802bc0, +0x2b002b40, +0x2a802ac0, +0x2a002a40, +0x27002780, +0x26002680, +0x22002300, +0x00001e00, +/* AIR 1: diff=176384.000000 */ +0x3bb43bb8, +0x3bac3bb0, +0x3ba43ba8, +0x3b9c3ba0, +0x3b943b98, +0x3b8c3b90, +0x3b843b88, +0x3b7c3b80, +0x3b743b78, +0x3b6c3b70, +0x3b643b68, +0x3b5c3b60, +0x3b543b58, +0x3b4c3b50, +0x3b443b48, +0x3b3c3b40, +0x3b343b38, +0x3b2c3b30, +0x3b243b28, +0x3b1c3b20, +0x3b143b18, +0x3b0c3b10, +0x3b043b08, +0x3afc3b00, +0x3af43af8, +0x3aec3af0, +0x3ae43ae8, +0x3adc3ae0, +0x3ad43ad8, +0x3acc3ad0, +0x3ac43ac8, +0x3abc3ac0, +0x3ab43ab8, +0x3aac3ab0, +0x3aa43aa8, +0x3a9c3aa0, +0x3a943a98, +0x3a8c3a90, +0x3a843a88, +0x3a7c3a80, +0x3a743a78, +0x3a6c3a70, +0x3a643a68, +0x3a5c3a60, +0x3a543a58, +0x3a4c3a50, +0x3a443a48, +0x3a3c3a40, +0x3a343a38, +0x3a2c3a30, +0x3a243a28, +0x3a1c3a20, +0x3a143a18, +0x3a0c3a10, +0x3a043a08, +0x37fa3a00, +0x37ea37f2, +0x37da37e2, +0x37ca37d2, +0x37ba37c2, +0x37aa37b2, +0x379a37a2, +0x378a3792, +0x377a3782, +0x376b3773, +0x375b3763, +0x374b3753, +0x373b3743, +0x372b3733, +0x371c3724, +0x370c3714, +0x36fc3704, +0x36ed36f5, +0x36dd36e5, +0x36cd36d5, +0x36be36c6, +0x36ae36b6, +0x369f36a7, +0x368f3697, +0x36803688, +0x36703678, +0x36613669, +0x3652365a, +0x3643364a, +0x3634363b, +0x3624362c, +0x3615361d, +0x3607360e, +0x33f033ff, +0x33d233e1, +0x33b533c4, +0x339833a6, +0x337b338a, +0x335e336d, +0x33423350, +0x33263334, +0x330a3318, +0x32ef32fc, +0x32d332e1, +0x32b932c6, +0x329e32ab, +0x32843291, +0x326a3277, +0x3251325e, +0x32383245, +0x3220322c, +0x32083214, +0x2fe22ff9, +0x2fb52fcb, +0x2f882f9e, +0x2f5d2f72, +0x2f332f48, +0x2f0a2f1e, +0x2ee22ef5, +0x2ebb2ece, +0x2e962ea8, +0x2e722e84, +0x2e4f2e60, +0x2e2e2e3e, +0x2e002e1e, +0x2b802bc0, +0x2b002b40, +0x2a802ac0, +0x2a002a40, +0x27002780, +0x26002680, +0x22002300, +0x00001e00, +/* AIR 2: diff=88192.000000 */ +0x3b703b74, +0x3b683b6c, +0x3b603b64, +0x3b583b5c, +0x3b503b54, +0x3b483b4c, +0x3b403b44, +0x3b383b3c, +0x3b303b34, +0x3b283b2c, +0x3b203b24, +0x3b183b1c, +0x3b103b14, +0x3b083b0c, +0x3b003b04, +0x3af83afc, +0x3af13af4, +0x3ae93aed, +0x3ae13ae5, +0x3ad93add, +0x3ad13ad5, +0x3ac93acd, +0x3ac13ac5, +0x3ab93abd, +0x3ab13ab5, +0x3aa93aad, +0x3aa13aa5, +0x3a993a9d, +0x3a913a95, +0x3a893a8d, +0x3a813a85, +0x3a793a7d, +0x3a713a75, +0x3a693a6d, +0x3a613a65, +0x3a593a5d, +0x3a513a55, +0x3a493a4d, +0x3a413a45, +0x3a393a3d, +0x3a313a35, +0x3a293a2d, +0x3a213a25, +0x3a193a1d, +0x3a113a15, +0x3a093a0d, +0x3a013a05, +0x37f337fa, +0x37e337eb, +0x37d337db, +0x37c337cb, +0x37b337bb, +0x37a337ab, +0x3793379b, +0x3783378b, +0x3774377b, +0x3764376c, +0x3754375c, +0x3744374c, +0x3734373c, +0x3725372c, +0x3715371d, +0x3705370d, +0x36f536fd, +0x36e636ee, +0x36d636de, +0x36c736ce, +0x36b736bf, +0x36a736af, +0x369836a0, +0x36893690, +0x36793681, +0x366a3671, +0x365a3662, +0x364b3653, +0x363c3644, +0x362d3634, +0x361e3625, +0x360f3616, +0x36003607, +0x33e333f2, +0x33c533d4, +0x33a833b7, +0x338b339a, +0x336e337d, +0x33523360, +0x33363344, +0x331a3328, +0x32fe330c, +0x32e332f0, +0x32c832d5, +0x32ad32ba, +0x329332a0, +0x32793286, +0x325f326c, +0x32463253, +0x322e323a, +0x32163222, +0x2ffc320a, +0x2fce2fe5, +0x2fa12fb7, +0x2f752f8b, +0x2f4a2f5f, +0x2f202f35, +0x2ef82f0c, +0x2ed12ee4, +0x2eab2ebd, +0x2e862e98, +0x2e622e74, +0x2e402e51, +0x2e202e30, +0x2e002e10, +0x2bc42be2, +0x2b8a2ba7, +0x2b532b6e, +0x2b1f2b39, +0x2aed2b05, +0x2abd2ad4, +0x2a902aa6, +0x2a652a7a, +0x2a3c2a50, +0x2a162a29, +0x27e52a04, +0x27a127c2, +0x27002780, +0x26002680, +0x22002300, +0x00001e00, +/* AIR 3: diff=44096.000000 */ +0x3b2d3b31, +0x3b253b29, +0x3b1d3b21, +0x3b153b19, +0x3b0d3b11, +0x3b053b09, +0x3afd3b01, +0x3af53af9, +0x3aed3af1, +0x3ae53ae9, +0x3add3ae1, +0x3ad53ad9, +0x3acd3ad1, +0x3ac53ac9, +0x3abd3ac1, +0x3ab53ab9, +0x3aad3ab1, +0x3aa53aa9, +0x3a9d3aa1, +0x3a953a99, +0x3a8d3a91, +0x3a853a89, +0x3a7d3a81, +0x3a753a79, +0x3a6d3a71, +0x3a653a69, +0x3a5d3a61, +0x3a553a59, +0x3a4d3a51, +0x3a453a49, +0x3a3d3a41, +0x3a353a39, +0x3a2d3a31, +0x3a253a29, +0x3a1d3a21, +0x3a153a19, +0x3a0d3a11, +0x3a053a09, +0x37fb3a01, +0x37ec37f3, +0x37dc37e4, +0x37cc37d4, +0x37bc37c4, +0x37ac37b4, +0x379c37a4, +0x378c3794, +0x377c3784, +0x376d3774, +0x375d3765, +0x374d3755, +0x373d3745, +0x372d3735, +0x371e3726, +0x370e3716, +0x36fe3706, +0x36ef36f6, +0x36df36e7, +0x36cf36d7, +0x36c036c7, +0x36b036b8, +0x36a136a8, +0x36913699, +0x36823689, +0x3672367a, +0x3663366b, +0x3654365b, +0x3645364c, +0x3635363d, +0x3626362e, +0x3617361f, +0x36083610, +0x33f33601, +0x33d633e5, +0x33b933c7, +0x339b33aa, +0x337f338d, +0x33623370, +0x33453354, +0x33293337, +0x330d331b, +0x32f23300, +0x32d732e4, +0x32bc32c9, +0x32a132af, +0x32873294, +0x326d327a, +0x32543261, +0x323b3248, +0x3223322f, +0x320b3217, +0x2fe82fff, +0x2fba2fd1, +0x2f8d2fa4, +0x2f622f78, +0x2f382f4d, +0x2f0e2f23, +0x2ee62efa, +0x2ec02ed3, +0x2e9a2ead, +0x2e762e88, +0x2e532e65, +0x2e322e42, +0x2e112e21, +0x2be62e02, +0x2baa2bc8, +0x2b722b8e, +0x2b3c2b56, +0x2b082b22, +0x2ad72aef, +0x2aa92ac0, +0x2a7d2a92, +0x2a532a67, +0x2a2b2a3f, +0x2a062a18, +0x27c627e9, +0x278427a5, +0x27462764, +0x270b2728, +0x26d426ef, +0x26a126ba, +0x26712688, +0x2644265a, +0x261a262e, +0x23e62606, +0x239c23c0, +0x2358237a, +0x22002300, +0x00001e00, +/* AIR 4: diff=22048.000000 */ +0x3ae93aed, +0x3ae13ae5, +0x3ad93add, +0x3ad13ad5, +0x3ac93acd, +0x3ac13ac5, +0x3ab93abd, +0x3ab13ab5, +0x3aaa3aae, +0x3aa23aa6, +0x3a9a3a9e, +0x3a923a96, +0x3a8a3a8e, +0x3a823a86, +0x3a7a3a7e, +0x3a723a76, +0x3a6a3a6e, +0x3a623a66, +0x3a5a3a5e, +0x3a523a56, +0x3a4a3a4e, +0x3a423a46, +0x3a3a3a3e, +0x3a323a36, +0x3a2a3a2e, +0x3a223a26, +0x3a1a3a1e, +0x3a123a16, +0x3a0a3a0e, +0x3a023a06, +0x37f437fc, +0x37e537ec, +0x37d537dd, +0x37c537cd, +0x37b537bd, +0x37a537ad, +0x3795379d, +0x3785378d, +0x3775377d, +0x3766376d, +0x3756375e, +0x3746374e, +0x3736373e, +0x3726372e, +0x3717371f, +0x3707370f, +0x36f736ff, +0x36e836ef, +0x36d836e0, +0x36c836d0, +0x36b936c1, +0x36a936b1, +0x369a36a2, +0x368a3692, +0x367b3683, +0x366c3673, +0x365c3664, +0x364d3655, +0x363e3645, +0x362f3636, +0x36203627, +0x36113618, +0x36023609, +0x33e633f5, +0x33c933d8, +0x33ac33ba, +0x338f339d, +0x33723380, +0x33553364, +0x33393347, +0x331d332b, +0x3301330f, +0x32e632f4, +0x32cb32d8, +0x32b032bd, +0x329632a3, +0x327c3289, +0x3262326f, +0x32493256, +0x3231323d, +0x32183224, +0x3201320c, +0x2fd42feb, +0x2fa62fbd, +0x2f7a2f90, +0x2f4f2f64, +0x2f252f3a, +0x2efd2f11, +0x2ed52ee9, +0x2eaf2ec2, +0x2e8a2e9c, +0x2e672e78, +0x2e442e55, +0x2e232e34, +0x2e042e13, +0x2bcb2be9, +0x2b912bae, +0x2b5a2b75, +0x2b252b3f, +0x2af22b0b, +0x2ac22ada, +0x2a952aab, +0x2a6a2a7f, +0x2a412a55, +0x2a1b2a2e, +0x27ed2a08, +0x27a827ca, +0x27682788, +0x272b2749, +0x26f3270f, +0x26bd26d7, +0x268b26a4, +0x265d2674, +0x26312646, +0x2608261c, +0x23c523ea, +0x237e23a1, +0x233c235c, +0x22fe231c, +0x22c522e1, +0x229022aa, +0x225f2277, +0x22312247, +0x2206221b, +0x1fbf1fe5, +0x1f761f99, +0x1f321f53, +0x00001e00, +/* AIR 5: diff=11024.000000 */ +0x3aa63aaa, +0x3a9e3aa2, +0x3a963a9a, +0x3a8e3a92, +0x3a863a8a, +0x3a7e3a82, +0x3a763a7a, +0x3a6e3a72, +0x3a663a6a, +0x3a5e3a62, +0x3a563a5a, +0x3a4e3a52, +0x3a463a4a, +0x3a3e3a42, +0x3a363a3a, +0x3a2e3a32, +0x3a263a2a, +0x3a1e3a22, +0x3a163a1a, +0x3a0e3a12, +0x3a063a0a, +0x37fd3a02, +0x37ed37f5, +0x37de37e5, +0x37ce37d6, +0x37be37c6, +0x37ae37b6, +0x379e37a6, +0x378e3796, +0x377e3786, +0x376e3776, +0x375f3767, +0x374f3757, +0x373f3747, +0x372f3737, +0x37203727, +0x37103718, +0x37003708, +0x36f036f8, +0x36e136e9, +0x36d136d9, +0x36c236c9, +0x36b236ba, +0x36a236aa, +0x3693369b, +0x3684368b, +0x3674367c, +0x3665366d, +0x3656365d, +0x3646364e, +0x3637363f, +0x36283630, +0x36193621, +0x360a3612, +0x33f73603, +0x33d933e8, +0x33bc33cb, +0x339f33ad, +0x33823390, +0x33653374, +0x33493357, +0x332d333b, +0x3311331f, +0x32f53303, +0x32da32e8, +0x32bf32cc, +0x32a432b2, +0x328a3297, +0x3271327d, +0x32573264, +0x323e324b, +0x32263232, +0x320e321a, +0x2fed3202, +0x2fbf2fd6, +0x2f932fa9, +0x2f672f7d, +0x2f3d2f52, +0x2f132f28, +0x2eeb2eff, +0x2ec42ed8, +0x2e9f2eb1, +0x2e7a2e8c, +0x2e572e69, +0x2e362e46, +0x2e152e25, +0x2bed2e06, +0x2bb12bcf, +0x2b782b95, +0x2b422b5d, +0x2b0e2b28, +0x2add2af5, +0x2aae2ac5, +0x2a822a98, +0x2a582a6c, +0x2a302a44, +0x2a0a2a1d, +0x27ce27f1, +0x278c27ac, +0x274d276c, +0x2712272f, +0x26db26f6, +0x26a726c0, +0x2676268e, +0x2649265f, +0x261f2633, +0x23ef260b, +0x23a523c9, +0x23602382, +0x23202340, +0x22e52302, +0x22ad22c8, +0x227a2293, +0x224a2262, +0x221e2234, +0x1fea2209, +0x1f9e1fc3, +0x1f571f7a, +0x1f161f36, +0x1ed91ef7, +0x1ea11ebd, +0x1e6e1e87, +0x1e3e1e55, +0x1e111e27, +0x1bd11bf9, +0x1b851bab, +0x1b3f1b62, +0x00001b1f, +/* AIR 6: diff=5512.000000 */ +0x3a633a67, +0x3a5b3a5f, +0x3a533a57, +0x3a4b3a4f, +0x3a433a47, +0x3a3b3a3f, +0x3a333a37, +0x3a2b3a2f, +0x3a233a27, +0x3a1b3a1f, +0x3a133a17, +0x3a0b3a0f, +0x3a033a07, +0x37f637fe, +0x37e637ee, +0x37d737de, +0x37c737cf, +0x37b737bf, +0x37a737af, +0x3797379f, +0x3787378f, +0x3777377f, +0x3767376f, +0x37583760, +0x37483750, +0x37383740, +0x37283730, +0x37193720, +0x37093711, +0x36f93701, +0x36ea36f1, +0x36da36e2, +0x36ca36d2, +0x36bb36c2, +0x36ab36b3, +0x369c36a3, +0x368c3694, +0x367d3684, +0x366d3675, +0x365e3666, +0x364f3656, +0x36403647, +0x36313638, +0x36213629, +0x3612361a, +0x3604360b, +0x33ea33f9, +0x33cc33db, +0x33af33be, +0x339233a1, +0x33753384, +0x33593367, +0x333c334b, +0x3320332e, +0x33053312, +0x32e932f7, +0x32ce32dc, +0x32b332c1, +0x329932a6, +0x327f328c, +0x32653272, +0x324c3259, +0x32333240, +0x321b3227, +0x3203320f, +0x2fd92ff0, +0x2fac2fc2, +0x2f7f2f95, +0x2f542f6a, +0x2f2a2f3f, +0x2f012f16, +0x2eda2eee, +0x2eb42ec7, +0x2e8f2ea1, +0x2e6b2e7d, +0x2e482e59, +0x2e272e38, +0x2e072e17, +0x2bd22bf1, +0x2b982bb5, +0x2b602b7c, +0x2b2b2b45, +0x2af82b11, +0x2ac82ae0, +0x2a9a2ab1, +0x2a6f2a84, +0x2a462a5a, +0x2a1f2a32, +0x27f52a0d, +0x27b027d2, +0x27702790, +0x27322751, +0x26f92715, +0x26c326de, +0x269126aa, +0x26622679, +0x2636264c, +0x260d2621, +0x23ce23f3, +0x238623a9, +0x23432364, +0x23052324, +0x22cc22e8, +0x229622b1, +0x2264227d, +0x2236224d, +0x220b2220, +0x1fc81fef, +0x1f7e1fa2, +0x1f3a1f5b, +0x1efb1f1a, +0x1ec01edd, +0x1e8a1ea5, +0x1e581e71, +0x1e2a1e40, +0x1bfe1e14, +0x1baf1bd6, +0x1b661b8a, +0x1b221b44, +0x1ae41b03, +0x1aaa1ac7, +0x1a751a8f, +0x1a441a5c, +0x1a171a2d, +0x17db1a02, +0x178e17b3, +0x17461769, +0x00001725, +/* AIR 7: diff=2756.000000 */ +0x3a1f3a23, +0x3a173a1b, +0x3a0f3a13, +0x3a073a0b, +0x37ff3a03, +0x37ef37f7, +0x37df37e7, +0x37d037d7, +0x37c037c8, +0x37b037b8, +0x37a037a8, +0x37903798, +0x37803788, +0x37703778, +0x37613768, +0x37513759, +0x37413749, +0x37313739, +0x37213729, +0x3712371a, +0x3702370a, +0x36f236fa, +0x36e336ea, +0x36d336db, +0x36c336cb, +0x36b436bc, +0x36a436ac, +0x3695369d, +0x3685368d, +0x3676367e, +0x3667366e, +0x3657365f, +0x36483650, +0x36393641, +0x362a3631, +0x361b3622, +0x360c3613, +0x33fb3604, +0x33dd33ec, +0x33c033ce, +0x33a233b1, +0x33853394, +0x33693377, +0x334c335a, +0x3330333e, +0x33143322, +0x32f93306, +0x32dd32eb, +0x32c232d0, +0x32a832b5, +0x328d329a, +0x32743280, +0x325a3267, +0x3241324e, +0x32293235, +0x3211321d, +0x2ff33205, +0x2fc52fdc, +0x2f982fae, +0x2f6c2f82, +0x2f422f57, +0x2f182f2d, +0x2ef02f04, +0x2ec92edc, +0x2ea32eb6, +0x2e7f2e91, +0x2e5b2e6d, +0x2e3a2e4a, +0x2e192e29, +0x2bf42e09, +0x2bb82bd6, +0x2b7f2b9b, +0x2b482b63, +0x2b142b2e, +0x2ae32afb, +0x2ab42acb, +0x2a872a9d, +0x2a5d2a71, +0x2a352a48, +0x2a0f2a21, +0x27d727fa, +0x279327b4, +0x27542773, +0x27192736, +0x26e126fd, +0x26ad26c7, +0x267c2694, +0x264e2665, +0x26242639, +0x23f8260f, +0x23ad23d2, +0x2368238a, +0x23282347, +0x22ec2309, +0x22b422cf, +0x22802299, +0x22502267, +0x22232239, +0x1ff4220e, +0x1fa71fcc, +0x1f5f1f82, +0x1f1d1f3e, +0x1ee01efe, +0x1ea81ec4, +0x1e741e8d, +0x1e431e5b, +0x1e161e2c, +0x1bdb1e01, +0x1b8e1bb4, +0x1b481b6a, +0x1b061b26, +0x1aca1ae8, +0x1a931aae, +0x1a5f1a78, +0x1a301a47, +0x1a041a1a, +0x17b817e0, +0x176e1792, +0x1729174b, +0x16ea1709, +0x16af16cc, +0x16791694, +0x16481660, +0x161a1630, +0x13e01604, +0x139213b8, +0x134a136d, +0x00001328, +/* AIR 8: diff=1378.000000 */ +0x37b937c1, +0x37a937b1, +0x379937a1, +0x37893791, +0x37793781, +0x37693771, +0x375a3761, +0x374a3752, +0x373a3742, +0x372a3732, +0x371a3722, +0x370b3713, +0x36fb3703, +0x36eb36f3, +0x36dc36e4, +0x36cc36d4, +0x36bd36c4, +0x36ad36b5, +0x369e36a5, +0x368e3696, +0x367f3686, +0x366f3677, +0x36603668, +0x36513658, +0x36413649, +0x3632363a, +0x3623362b, +0x3614361c, +0x3605360d, +0x33ed33fc, +0x33d033df, +0x33b333c1, +0x339633a4, +0x33793387, +0x335c336a, +0x3340334e, +0x33243332, +0x33083316, +0x32ec32fa, +0x32d132df, +0x32b732c4, +0x329c32a9, +0x3282328f, +0x32683275, +0x324f325c, +0x32363243, +0x321e322a, +0x32063212, +0x2fdf2ff6, +0x2fb12fc8, +0x2f852f9b, +0x2f592f6f, +0x2f2f2f44, +0x2f062f1b, +0x2edf2ef2, +0x2eb82ecb, +0x2e932ea5, +0x2e6f2e81, +0x2e4c2e5e, +0x2e2b2e3c, +0x2e0b2e1b, +0x2bda2bf8, +0x2b9f2bbc, +0x2b672b82, +0x2b312b4c, +0x2afe2b17, +0x2ace2ae6, +0x2aa02ab6, +0x2a742a8a, +0x2a4b2a5f, +0x2a242a37, +0x27fe2a11, +0x27b927db, +0x27772797, +0x273a2758, +0x2700271c, +0x26ca26e4, +0x269726b0, +0x2667267f, +0x263b2651, +0x26122626, +0x23d623fc, +0x238e23b2, +0x234b236c, +0x230d232b, +0x22d222ef, +0x229c22b7, +0x226a2283, +0x223c2252, +0x22102226, +0x1fd11ff8, +0x1f871fab, +0x1f421f64, +0x1f021f21, +0x1ec71ee4, +0x1e901eab, +0x1e5e1e77, +0x1e2f1e46, +0x1e041e19, +0x1bb81bdf, +0x1b6e1b93, +0x1b2a1b4c, +0x1aeb1b0a, +0x1ab11ace, +0x1a7b1a96, +0x1a4a1a62, +0x1a1c1a33, +0x17e41a07, +0x179617bd, +0x174f1772, +0x170c172d, +0x16cf16ed, +0x169716b2, +0x1663167c, +0x1633164a, +0x1607161c, +0x13bd13e4, +0x13711396, +0x132c134e, +0x12ec130c, +0x12b212ce, +0x127b1296, +0x12491262, +0x121b1232, +0x0fe21206, +0x0f940fba, +0x0f4c0f6f, +0x00000f2a, +/* AIR 9: diff=689.000000 */ +0x3733373b, +0x3723372b, +0x3714371b, +0x3704370c, +0x36f436fc, +0x36e536ec, +0x36d536dd, +0x36c536cd, +0x36b636be, +0x36a636ae, +0x3697369e, +0x3687368f, +0x36783680, +0x36693670, +0x36593661, +0x364a3652, +0x363b3642, +0x362c3633, +0x361d3624, +0x360e3615, +0x33fe3606, +0x33e033ef, +0x33c333d2, +0x33a633b4, +0x33893397, +0x336c337a, +0x3350335e, +0x33333342, +0x33173325, +0x32fc330a, +0x32e032ee, +0x32c532d3, +0x32ab32b8, +0x3291329e, +0x32773284, +0x325d326a, +0x32443251, +0x322c3238, +0x32143220, +0x2ff83208, +0x2fca2fe1, +0x2f9d2fb4, +0x2f712f87, +0x2f472f5c, +0x2f1d2f32, +0x2ef52f09, +0x2ecd2ee1, +0x2ea82eba, +0x2e832e95, +0x2e602e71, +0x2e3e2e4e, +0x2e1d2e2d, +0x2bfc2e0d, +0x2bbf2bdd, +0x2b862ba2, +0x2b4f2b6a, +0x2b1a2b34, +0x2ae92b01, +0x2ab92ad1, +0x2a8c2aa2, +0x2a622a77, +0x2a392a4d, +0x2a132a26, +0x27df2a01, +0x279b27bd, +0x275c277b, +0x2720273d, +0x26e82703, +0x26b326cd, +0x2682269a, +0x2654266a, +0x2629263e, +0x26002614, +0x23b623db, +0x23702393, +0x232f234f, +0x22f32310, +0x22ba22d6, +0x228622a0, +0x2255226d, +0x2228223e, +0x1ffd2213, +0x1fb01fd6, +0x1f681f8b, +0x1f251f46, +0x1ee71f06, +0x1eae1eca, +0x1e7a1e93, +0x1e491e61, +0x1e1c1e32, +0x1be41e06, +0x1b971bbd, +0x1b501b73, +0x1b0e1b2e, +0x1ad11aef, +0x1a991ab4, +0x1a651a7f, +0x1a351a4d, +0x1a091a1f, +0x17c117e9, +0x1776179b, +0x17311753, +0x16f11710, +0x16b616d3, +0x167f169a, +0x164d1666, +0x161f1636, +0x13e91609, +0x139b13c1, +0x13521376, +0x130f1330, +0x12d212f0, +0x129912b5, +0x1265127e, +0x1235124c, +0x1208121e, +0x0fbf0fe7, +0x0f730f98, +0x0f2e0f50, +0x0eee0f0d, +0x0eb30ed0, +0x0e7c0e97, +0x0e4a0e63, +0x0e1c0e33, +0x0be30e06, +0x0b950bbb, +0x0b4d0b70, +0x00000b2b, +/* AIR 10: diff=344.500000 */ +0x36af36b7, +0x369f36a7, +0x36903698, +0x36803688, +0x36713679, +0x36623669, +0x3652365a, +0x3643364b, +0x3634363c, +0x3625362d, +0x3616361e, +0x3607360f, +0x33f13600, +0x33d433e2, +0x33b633c5, +0x339933a8, +0x337c338b, +0x3360336e, +0x33433351, +0x33273335, +0x330b3319, +0x32f032fd, +0x32d532e2, +0x32ba32c7, +0x329f32ac, +0x32853292, +0x326b3278, +0x3252325f, +0x32393246, +0x3221322d, +0x32093215, +0x2fe42ffb, +0x2fb62fcd, +0x2f8a2fa0, +0x2f5e2f74, +0x2f342f49, +0x2f0b2f1f, +0x2ee32ef7, +0x2ebd2ed0, +0x2e972eaa, +0x2e732e85, +0x2e512e62, +0x2e2f2e40, +0x2e0f2e1f, +0x2be12bff, +0x2ba62bc3, +0x2b6d2b89, +0x2b372b52, +0x2b042b1e, +0x2ad32aeb, +0x2aa52abc, +0x2a792a8f, +0x2a502a64, +0x2a282a3c, +0x2a032a15, +0x27c127e3, +0x277f279f, +0x2741275f, +0x27072723, +0x26d026eb, +0x269d26b6, +0x266d2685, +0x26402656, +0x2616262b, +0x23df2603, +0x239723ba, +0x23532374, +0x23142333, +0x22d922f6, +0x22a322bd, +0x22702289, +0x22412258, +0x2215222b, +0x1fda2201, +0x1f8f1fb4, +0x1f4a1f6c, +0x1f091f29, +0x1ece1eeb, +0x1e971eb2, +0x1e641e7d, +0x1e341e4c, +0x1e091e1e, +0x1bc11be9, +0x1b771b9b, +0x1b321b54, +0x1af31b12, +0x1ab81ad5, +0x1a821a9c, +0x1a501a68, +0x1a211a38, +0x17ee1a0c, +0x179f17c6, +0x1757177a, +0x17141735, +0x16d616f5, +0x169d16b9, +0x16691683, +0x16391650, +0x160c1622, +0x13c613ee, +0x137a139f, +0x13341356, +0x12f41313, +0x12b812d5, +0x1282129c, +0x124f1268, +0x12211237, +0x0fec120b, +0x0f9d0fc4, +0x0f540f78, +0x0f110f32, +0x0ed30ef1, +0x0e9a0eb6, +0x0e660e7f, +0x0e350e4d, +0x0e090e1f, +0x0bc00be8, +0x0b740b99, +0x0b2f0b51, +0x0aef0b0e, +0x0ab30ad0, +0x0a7d0a98, +0x0a4b0a63, +0x0a1c0a33, +0x07e40a07, +0x079607bc, +0x074d0771, +0x0000072b, +/* AIR 11: diff=172.250000 */ +0x362d3635, +0x361e3626, +0x360f3617, +0x36013608, +0x33e433f3, +0x33c733d5, +0x33a933b8, +0x338c339b, +0x3370337e, +0x33533361, +0x33373345, +0x331b3329, +0x32ff330d, +0x32e432f1, +0x32c932d6, +0x32ae32bb, +0x329432a1, +0x327a3287, +0x3260326d, +0x32473254, +0x322f323b, +0x32163222, +0x2ffe320b, +0x2fd02fe7, +0x2fa32fb9, +0x2f772f8c, +0x2f4c2f61, +0x2f222f37, +0x2ef92f0e, +0x2ed22ee6, +0x2eac2ebf, +0x2e872e9a, +0x2e642e75, +0x2e422e53, +0x2e212e31, +0x2e012e11, +0x2bc62be4, +0x2b8d2ba9, +0x2b552b71, +0x2b212b3b, +0x2aee2b07, +0x2abf2ad6, +0x2a912aa8, +0x2a672a7c, +0x2a3e2a52, +0x2a182a2a, +0x27e72a05, +0x27a327c5, +0x27632783, +0x27272744, +0x26ee270a, +0x26b926d3, +0x268726a0, +0x26592670, +0x262e2643, +0x26052619, +0x23bf23e4, +0x2378239b, +0x23372357, +0x22fa2318, +0x22c122dd, +0x228c22a6, +0x225b2273, +0x222d2244, +0x22032218, +0x1fb91fdf, +0x1f701f94, +0x1f2d1f4e, +0x1eef1f0d, +0x1eb51ed1, +0x1e801e9a, +0x1e4e1e67, +0x1e211e37, +0x1bee1e0b, +0x1ba01bc6, +0x1b581b7b, +0x1b151b36, +0x1ad81af6, +0x1a9f1abb, +0x1a6b1a85, +0x1a3b1a52, +0x1a0e1a24, +0x17cb17f3, +0x177f17a4, +0x1739175b, +0x16f81718, +0x16bd16da, +0x168616a1, +0x1653166c, +0x1624163b, +0x13f3160e, +0x13a413cb, +0x135b137e, +0x13171338, +0x12d912f7, +0x12a012bc, +0x126b1285, +0x123a1252, +0x120d1223, +0x0fc80ff1, +0x0f7c0fa1, +0x0f360f58, +0x0ef50f15, +0x0eba0ed7, +0x0e830e9e, +0x0e500e69, +0x0e210e38, +0x0bed0e0b, +0x0b9e0bc5, +0x0b550b79, +0x0b120b33, +0x0ad40af2, +0x0a9b0ab7, +0x0a660a80, +0x0a360a4e, +0x0a090a1f, +0x07c107e9, +0x0775079a, +0x072f0751, +0x06ef070f, +0x06b406d1, +0x067d0698, +0x064b0664, +0x061d0633, +0x03e50607, +0x039603bd, +0x034e0371, +0x0000032c, +/* AIR 12: diff=86.125000 */ +0x33633371, +0x33473355, +0x332a3338, +0x330f331c, +0x32f33301, +0x32d832e5, +0x32bd32ca, +0x32a232b0, +0x32883295, +0x326e327b, +0x32553262, +0x323c3249, +0x32243230, +0x320c3218, +0x2fea3200, +0x2fbc2fd3, +0x2f8f2fa5, +0x2f642f79, +0x2f392f4e, +0x2f102f24, +0x2ee82efc, +0x2ec12ed4, +0x2e9c2eae, +0x2e782e89, +0x2e552e66, +0x2e332e44, +0x2e132e23, +0x2be82e03, +0x2bad2bca, +0x2b742b90, +0x2b3e2b59, +0x2b0a2b24, +0x2ad92af1, +0x2aaa2ac1, +0x2a7e2a94, +0x2a542a69, +0x2a2d2a40, +0x2a072a1a, +0x27c927ec, +0x278627a7, +0x27482767, +0x270d272a, +0x26d626f1, +0x26a326bc, +0x2673268a, +0x2645265c, +0x261b2630, +0x23e82607, +0x239f23c3, +0x235b237c, +0x231b233a, +0x22e022fd, +0x22a922c4, +0x2276228f, +0x2246225e, +0x221a2230, +0x1fe42206, +0x1f981fbd, +0x1f521f74, +0x1f111f31, +0x1ed51ef2, +0x1e9d1eb8, +0x1e691e83, +0x1e3a1e51, +0x1e0e1e23, +0x1bcb1bf3, +0x1b801ba4, +0x1b3a1b5c, +0x1afa1b19, +0x1abf1adc, +0x1a881aa3, +0x1a551a6e, +0x1a271a3e, +0x17f81a11, +0x17a917cf, +0x175f1783, +0x171c173d, +0x16dd16fc, +0x16a416c0, +0x166f1689, +0x163e1656, +0x16111627, +0x13cf13f8, +0x138313a8, +0x133c135f, +0x12fb131b, +0x12bf12dd, +0x128812a3, +0x1255126e, +0x1226123d, +0x0ff61210, +0x0fa60fcd, +0x0f5d0f81, +0x0f190f3a, +0x0eda0ef9, +0x0ea10ebd, +0x0e6c0e86, +0x0e3b0e53, +0x0e0e0e24, +0x0bca0bf2, +0x0b7d0ba3, +0x0b370b59, +0x0af60b16, +0x0aba0ad7, +0x0a830a9e, +0x0a500a69, +0x0a220a39, +0x07ee0a0c, +0x079f07c6, +0x07560779, +0x07120733, +0x06d406f3, +0x069b06b7, +0x06670680, +0x0636064e, +0x060a061f, +0x03c103ea, +0x0376039b, +0x03300352, +0x02ef030f, +0x02b402d1, +0x027e0298, +0x024b0264, +0x021d0234, +0x01f20207, +0x01cb01de, +0x01a701b9, +0x00000196, +/* AIR 13: diff=43.062500 */ +0x327d328a, +0x32633270, +0x324a3257, +0x3231323e, +0x32193225, +0x3202320d, +0x2fd52fec, +0x2fa82fbf, +0x2f7c2f92, +0x2f512f66, +0x2f272f3c, +0x2efe2f12, +0x2ed72eea, +0x2eb12ec3, +0x2e8c2e9e, +0x2e682e7a, +0x2e462e57, +0x2e252e35, +0x2e052e15, +0x2bce2bec, +0x2b932bb0, +0x2b5c2b77, +0x2b272b41, +0x2af42b0d, +0x2ac42adc, +0x2a972aad, +0x2a6c2a81, +0x2a432a57, +0x2a1c2a2f, +0x27f02a0a, +0x27ab27cd, +0x276a278a, +0x272e274c, +0x26f52711, +0x26bf26da, +0x268d26a6, +0x265e2675, +0x26332648, +0x260a261e, +0x23c823ed, +0x238023a3, +0x233e235f, +0x2301231f, +0x22c722e3, +0x229222ac, +0x22612279, +0x22332249, +0x2208221d, +0x1fc21fe8, +0x1f781f9c, +0x1f351f56, +0x1ef61f15, +0x1ebc1ed8, +0x1e861ea0, +0x1e541e6c, +0x1e261e3d, +0x1bf81e10, +0x1ba91bcf, +0x1b601b84, +0x1b1d1b3e, +0x1adf1afe, +0x1aa61ac2, +0x1a711a8b, +0x1a401a58, +0x1a131a29, +0x17d417fd, +0x178817ad, +0x17411764, +0x17001720, +0x16c416e1, +0x168c16a7, +0x16591672, +0x162a1641, +0x13fd1614, +0x13ad13d4, +0x13631387, +0x131f1340, +0x12e012ff, +0x12a612c3, +0x1271128b, +0x12401258, +0x12121229, +0x0fd20ffb, +0x0f850fab, +0x0f3e0f61, +0x0efd0f1d, +0x0ec00ede, +0x0e890ea4, +0x0e560e6f, +0x0e270e3e, +0x0bf70e11, +0x0ba70bce, +0x0b5d0b82, +0x0b1a0b3b, +0x0adb0afa, +0x0aa10abe, +0x0a6c0a86, +0x0a3b0a53, +0x0a0e0a24, +0x07ca07f3, +0x077e07a3, +0x0737075a, +0x06f60716, +0x06bb06d8, +0x0684069f, +0x0651066a, +0x06220639, +0x03ef060c, +0x039f03c6, +0x0356037a, +0x03130334, +0x02d502f3, +0x029c02b8, +0x02670281, +0x0237024e, +0x020a0220, +0x01e101f5, +0x01bb01cd, +0x019801a9, +0x01780188, +0x015a0169, +0x013f014c, +0x01260132, +0x010f011a, +0x00f90104, +0x00e600ef, +0x00d300dc, +0x000000cb, +/* AIR 14: diff=21.531250 */ +0x2f692f7e, +0x2f3e2f53, +0x2f152f29, +0x2eed2f01, +0x2ec62ed9, +0x2ea02eb3, +0x2e7c2e8e, +0x2e592e6a, +0x2e372e48, +0x2e172e27, +0x2bef2e07, +0x2bb42bd1, +0x2b7b2b97, +0x2b442b5f, +0x2b102b2a, +0x2adf2af7, +0x2ab02ac7, +0x2a832a99, +0x2a592a6e, +0x2a312a45, +0x2a0c2a1e, +0x27d127f4, +0x278e27af, +0x274f276e, +0x27142731, +0x26dd26f8, +0x26a926c2, +0x26782690, +0x264b2661, +0x26202635, +0x23f2260c, +0x23a823cc, +0x23632385, +0x23232342, +0x22e72304, +0x22af22cb, +0x227c2295, +0x224c2263, +0x22202235, +0x1fed220b, +0x1fa11fc6, +0x1f5a1f7d, +0x1f181f38, +0x1edc1ef9, +0x1ea31ebf, +0x1e6f1e89, +0x1e3f1e57, +0x1e131e29, +0x1bd41bfc, +0x1b881bad, +0x1b421b64, +0x1b011b21, +0x1ac51ae3, +0x1a8e1aa9, +0x1a5b1a74, +0x1a2c1a43, +0x1a011a16, +0x17b217d9, +0x1768178c, +0x17241745, +0x16e51703, +0x16ab16c7, +0x1675168f, +0x1644165c, +0x1616162d, +0x13d91601, +0x138c13b2, +0x13441367, +0x13031323, +0x12c612e4, +0x128e12aa, +0x125b1274, +0x122b1243, +0x12001215, +0x0faf0fd7, +0x0f650f89, +0x0f210f42, +0x0ee20f00, +0x0ea70ec4, +0x0e720e8c, +0x0e410e59, +0x0e130e29, +0x0bd30bfc, +0x0b860bac, +0x0b3f0b62, +0x0afd0b1e, +0x0ac10adf, +0x0a8a0aa5, +0x0a560a6f, +0x0a270a3e, +0x07f80a11, +0x07a807cf, +0x075e0782, +0x071a073b, +0x06dc06fa, +0x06a206be, +0x066d0687, +0x063c0654, +0x060f0625, +0x03cb03f4, +0x037e03a4, +0x0338035a, +0x02f70317, +0x02bb02d8, +0x0284029f, +0x0251026a, +0x02220239, +0x01f7020c, +0x01d001e3, +0x01ab01bd, +0x0189019a, +0x016a017a, +0x014e015c, +0x01340140, +0x011b0127, +0x01050110, +0x00f000fa, +0x00dd00e7, +0x00cc00d5, +0x00bc00c4, +0x00ad00b4, +0x009f00a6, +0x00930099, +0x0087008d, +0x007d0082, +0x00730078, +0x006a006e, +0x00000065, +/* AIR 15: diff=10.765625 */ +0x2e292e39, +0x2e092e18, +0x2bd52bf3, +0x2b9a2bb7, +0x2b622b7e, +0x2b2d2b47, +0x2afa2b13, +0x2aca2ae2, +0x2a9c2ab3, +0x2a712a86, +0x2a472a5c, +0x2a212a34, +0x27f82a0e, +0x27b327d5, +0x27722792, +0x27352753, +0x26fb2718, +0x26c526e0, +0x269326ac, +0x2664267b, +0x2638264d, +0x260e2623, +0x23d023f6, +0x238923ac, +0x23462367, +0x23082326, +0x22ce22ea, +0x229822b3, +0x2266227f, +0x2238224f, +0x220d2222, +0x1fcb1ff2, +0x1f811fa5, +0x1f3c1f5e, +0x1efd1f1c, +0x1ec21edf, +0x1e8c1ea7, +0x1e5a1e72, +0x1e2b1e42, +0x1e001e15, +0x1bb21bd9, +0x1b691b8d, +0x1b251b46, +0x1ae61b05, +0x1aad1ac9, +0x1a771a91, +0x1a461a5e, +0x1a191a2f, +0x17de1a03, +0x179017b6, +0x1749176c, +0x17071728, +0x16cb16e8, +0x169316ae, +0x165f1678, +0x162f1647, +0x16031619, +0x13b613de, +0x136c1390, +0x13271349, +0x12e71306, +0x12ad12ca, +0x12771291, +0x1245125e, +0x1218122e, +0x0fdc1202, +0x0f8e0fb4, +0x0f460f69, +0x0f040f25, +0x0ec70ee5, +0x0e8f0eab, +0x0e5c0e75, +0x0e2c0e43, +0x0e000e16, +0x0bb00bd8, +0x0b660b8a, +0x0b210b43, +0x0ae20b01, +0x0aa80ac5, +0x0a720a8d, +0x0a410a59, +0x0a140a2a, +0x07d407fd, +0x078707ac, +0x073f0762, +0x06fe071e, +0x06c206df, +0x068a06a5, +0x06570670, +0x0627063f, +0x03f90611, +0x03a803d0, +0x035f0383, +0x031b033c, +0x02dc02fb, +0x02a202bf, +0x026d0287, +0x023c0254, +0x020f0225, +0x01e501fa, +0x01bf01d2, +0x019c01ad, +0x017b018b, +0x015e016c, +0x01420150, +0x01290135, +0x0111011d, +0x00fc0106, +0x00e800f2, +0x00d600df, +0x00c500cd, +0x00b500bd, +0x00a700ae, +0x009a00a0, +0x008e0094, +0x00820088, +0x0078007d, +0x006f0073, +0x0066006a, +0x005e0062, +0x0057005a, +0x00500053, +0x0049004d, +0x00440046, +0x003e0041, +0x0039003c, +0x00350037, +0x00000033, + /* RDF 0: 1/1: 255.000000 */ +0x1e000000, +0x23002200, +0x26802600, +0x27802700, +0x2a402a00, +0x2ac02a80, +0x2b402b00, +0x2bc02b80, +0x2e202e00, +0x2e602e40, +0x2ea02e80, +0x2ee02ec0, +0x2f202f00, +0x2f602f40, +0x2fa02f80, +0x2fe02fc0, +0x32103200, +0x32303220, +0x32503240, +0x32703260, +0x32903280, +0x32b032a0, +0x32d032c0, +0x32f032e0, +0x33103300, +0x33303320, +0x33503340, +0x33703360, +0x33903380, +0x33b033a0, +0x33d033c0, +0x33f033e0, +0x36083600, +0x36183610, +0x36283620, +0x36383630, +0x36483640, +0x36583650, +0x36683660, +0x36783670, +0x36883680, +0x36983690, +0x36a836a0, +0x36b836b0, +0x36c836c0, +0x36d836d0, +0x36e836e0, +0x36f836f0, +0x37083700, +0x37183710, +0x37283720, +0x37383730, +0x37483740, +0x37583750, +0x37683760, +0x37783770, +0x37883780, +0x37983790, +0x37a837a0, +0x37b837b0, +0x37c837c0, +0x37d837d0, +0x37e837e0, +0x37f837f0, +0x3a043a00, +0x3a0c3a08, +0x3a143a10, +0x3a1c3a18, +0x3a243a20, +0x3a2c3a28, +0x3a343a30, +0x3a3c3a38, +0x3a443a40, +0x3a4c3a48, +0x3a543a50, +0x3a5c3a58, +0x3a643a60, +0x3a6c3a68, +0x3a743a70, +0x3a7c3a78, +0x3a843a80, +0x3a8c3a88, +0x3a943a90, +0x3a9c3a98, +0x3aa43aa0, +0x3aac3aa8, +0x3ab43ab0, +0x3abc3ab8, +0x3ac43ac0, +0x3acc3ac8, +0x3ad43ad0, +0x3adc3ad8, +0x3ae43ae0, +0x3aec3ae8, +0x3af43af0, +0x3afc3af8, +0x3b043b00, +0x3b0c3b08, +0x3b143b10, +0x3b1c3b18, +0x3b243b20, +0x3b2c3b28, +0x3b343b30, +0x3b3c3b38, +0x3b443b40, +0x3b4c3b48, +0x3b543b50, +0x3b5c3b58, +0x3b643b60, +0x3b6c3b68, +0x3b743b70, +0x3b7c3b78, +0x3b843b80, +0x3b8c3b88, +0x3b943b90, +0x3b9c3b98, +0x3ba43ba0, +0x3bac3ba8, +0x3bb43bb0, +0x3bbc3bb8, +0x3bc43bc0, +0x3bcc3bc8, +0x3bd43bd0, +0x3bdc3bd8, +0x3be43be0, +0x3bec3be8, +0x3bf43bf0, +0x3bfc3bf8, + /* RDF 1: 1/2: 16.880227 */ +0x1e000000, +0x23002200, +0x26802600, +0x27802700, +0x2a402a00, +0x2ac02a80, +0x2b402b00, +0x2bc02b80, +0x2e1c2e00, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, +0x2e1c2e1c, + /* RDF 2: 1/4: 7.005927 */ +0x1e000000, +0x23002200, +0x26802600, +0x27802700, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, +0x27802780, + /* RDF 3: 1/8: 3.251893 */ +0x1e000000, +0x23002200, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, +0x23402340, + /* RDF 4: 1/16: 1.571708 */ +0x1e000000, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, +0x1f241f24, + /* RDF 5: 1/32: 0.773177 */ +0x1b170000, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, +0x1b171b17, + /* RDF 6: 1/64: 0.383520 */ +0x17110000, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, +0x17111711, + /* RDF 7: 1/128: 0.191005 */ +0x130e0000, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, +0x130e130e, + /* RDF 8: 1/256: 0.095315 */ +0x0f0c0000, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, +0x0f0c0f0c, + /* RDF 9: 1/512: 0.047611 */ +0x0b0c0000, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, +0x0b0c0b0c, + /* RDF 10: 1/1024: 0.023794 */ +0x070b0000, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, +0x070b070b, + /* RDF 11: 1/2048: 0.011894 */ +0x030b0000, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, +0x030b030b, + /* RDF 12: 1/4096: 0.005946 */ +0x01860000, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, +0x01860186, + /* RDF 13: 1/8192: 0.002973 */ +0x00c30000, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, +0x00c300c3, + /* RDF 14: 1/16384: 0.001486 */ +0x00610000, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, +0x00610061, + /* RDF 15: 1/32768: 0.000743 */ +0x00310000, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +0x00310031, +}; + +/* + * Tables for 59259cps and 25Mbps + */ +const uint32_t patm_rtables25[128 * (4 + 2 * 16)] = { +0x8d0222e4, +0x8d3022cb, +0x8d5e22b3, +0x8d8c229c, +0x8dbc2286, +0x8df02270, +0x8e26225b, +0x8e5c2247, +0x8e922234, +0x8ecc2221, +0x8f0c220e, +0x8f481ffa, +0x8f881fd8, +0x8fca1fb7, +0x90081f97, +0x902c1f78, +0x90521f5a, +0x90781f3e, +0x90a01f22, +0x90c81f07, +0x90f21eed, +0x911e1ed4, +0x914c1ebc, +0x917c1ea4, +0x91aa1e8e, +0x91de1e78, +0x92141e62, +0x92481e4e, +0x92801e3a, +0x92ba1e27, +0x92f41e15, +0x93321e03, +0x93701be4, +0x93b41bc2, +0x93f81ba2, +0x94201b83, +0x94441b65, +0x946a1b48, +0x94921b2b, +0x94ba1b10, +0x94e41af6, +0x950e5add, +0x953c5ac4, +0x956c5aac, +0x959c5a95, +0x95cc5a7f, +0x96005a6a, +0x96365a55, +0x966c5a41, +0x96a45a2e, +0x96e05a1b, +0x971c5a09, +0x975c57ef, +0x979c57ce, +0x97e057ad, +0x9814578d, +0x9838576f, +0x985c5752, +0x98845735, +0x98ac571a, +0x98d656ff, +0x990096e5, +0x992e96cc, +0x995c96b4, +0x998a969d, +0x99ba9687, +0x99ee9671, +0x9a22965c, +0x9a589648, +0x9a929634, +0x9acc9621, +0x9b08960f, +0x9b4693fb, +0x9b8693d9, +0x9bc893b8, +0x9c089398, +0x9c2c9379, +0x9c50935c, +0x9c76933f, +0x9c9e9323, +0x9cc69308, +0x9cf292ee, +0x9d1cd2d5, +0x9d4ad2bd, +0x9d7ad2a5, +0x9daad28e, +0x9ddad279, +0x9e10d263, +0x9e46d24f, +0x9e7ed23b, +0x9eb6d228, +0x9ef4d215, +0x9f32d203, +0x9f6ecfe5, +0x9fb2cfc3, +0x9ff6cfa3, +0xa01ecf84, +0xa042cf66, +0xa068cf49, +0xa090cf2d, +0xa0b8cf11, +0xa0e2cef7, +0xa10d0ede, +0xa13b0ec5, +0xa16b0ead, +0xa19b0e96, +0xa1cb0e80, +0xa1fd0e6b, +0xa2330e56, +0xa26b0e42, +0xa2a50e2e, +0xa2dd0e1c, +0xa31b0e0a, +0xa3590bf1, +0xa39b0bcf, +0xa3df0bae, +0xa4130b8f, +0xa4370b70, +0xa45d0b53, +0xa4830b36, +0xa4ab0b1b, +0xa4d50b00, +0xa4ff0ae6, +0xa52d0acd, +0xa55b0ab5, +0xa5890a9e, +0xa5b90a88, +0xa5ed0a72, +0xa6210a5d, +0xa6570a49, +0xa6910a35, +0xa6cb0a22, +0xa7050a10, +0xa74307fd, +0xa78307db, +0xa7c707b9, +0xa807079a, +0xa82b077b, +0xa84f075d, +0xa8750740, +0xa89d0724, +0xa8c70709, +0xa8f106ef, +0xa91b06d6, +0xa94906be, +0xa97906a6, +0xa9a9068f, +0xa9db0679, +0xaa0f0664, +0xaa430650, +0xaa7b063c, +0xaab50629, +0xaaf10616, +0xab2f0604, +0xab6f03e6, +0xabaf03c5, +0xabf503a4, +0xac1f0385, +0xac430367, +0xac69034a, +0xac8f032e, +0xacb90312, +0xace102f8, +0xad0b02df, +0xad3902c6, +0xad6902ae, +0xad990297, +0xadc90281, +0xadfd026b, +0xae310257, +0xae670243, +0xaea3022f, +0xaedd021c, +0xaf1b020a, +0xaf5701f9, +0xaf9901e8, +0xafdb01d8, +0xb01101c8, +0xb03701b8, +0xb05b01aa, +0xb083019b, +0xb0a9018e, +0xb0d50180, +0xb0ff0173, +0xb12b0167, +0xb159015b, +0xb189014f, +0xb1b90144, +0xb1ed0139, +0xb21f012f, +0xb2590124, +0xb28d011b, +0xb2cb0111, +0xb3050108, +0xb34500ff, +0xb38100f7, +0xb3c900ee, +0xb40900e6, +0xb42900df, +0xb45100d7, +0xb47500d0, +0xb49d00c9, +0xb4c700c2, +0xb4ef00bc, +0xb51f00b5, +0xb54d00af, +0xb57d00a9, +0xb5a700a4, +0xb5df009e, +0xb60f0099, +0xb6430094, +0xb67b008f, +0xb6b7008a, +0xb6f90085, +0xb72f0081, +0xb76b007d, +0xb7b90078, +0xb7fd0074, +0xb8250070, +0xb841006d, +0xb86b0069, +0xb8970065, +0xb8bb0062, +0xb8e1005f, +0xb90b005c, +0xb9450058, +0xb9750055, +0xb9950053, +0xb9cb0050, +0xba05004d, +0xba43004a, +0xba710048, +0xba9f0046, +0xbaeb0043, +0xbb210041, +0xbb5b003f, +0xbb99003d, +0xbbdb003b, +0xbc110039, +0xbc370037, +0xbc610035, +0xbc8b0033, +0xbcbb0031, +0xbcd50030, +0xbd0b002e, +0xbd45002c, +0xbd65002b, +0xbd85002a, +0xbdcb0028, +0xbdf10027, +0xbe430025, +0xbe710024, +0xbe9f0023, +0xbed10022, +0xbf050021, +0xbf3d0020, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x04030100, +0x09080705, +0x0d0c0b0a, +0x1311100e, +0x18171614, +0x1d1c1b1a, +0x21201f1e, +0x27262422, +0x2d2b2a29, +0x32302f2e, +0x36353433, +0x3c3a3836, +0x41403e3d, +0x46454442, +0x4a494847, +0x504e4d4b, +0x55545351, +0x5a595857, +0x5e5d5c5b, +0x6463615f, +0x6a696766, +0x6f6d6c6b, +0x73727170, +0x79777574, +0x7e7d7c7a, +0x8382817f, +0x87868584, +0x8d8b8a88, +0x9391908e, +0x97969594, +0x9b9a9998, +0xa1a09e9c, +0xa7a6a4a3, +0xacaaa9a8, +0xb0afaead, +0xb6b4b2b1, +0xbbbab9b7, +0xc0bfbebc, +0xc4c3c2c1, +0xcac8c7c5, +0xd0cecdcb, +0xd4d3d2d1, +0xd8d7d6d5, +0xdedddbd9, +0xe4e3e1e0, +0xe9e8e6e5, +0xedecebea, +0xf3f1efee, +0xf8f7f6f4, +0xfdfcfbfa, +0xfffffffe, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0xffffffff, +0x00005f9e, +0x00005d9e, +0x00015b9e, +0x0001599e, +0x0003579e, +0x0003559e, +0x00030000, +0x00030000, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +/* AIR 0: diff=59259.000000 */ +0x3bf83bfc, +0x3bf03bf4, +0x3be83bec, +0x3be03be4, +0x3bd83bdc, +0x3bd03bd4, +0x3bc83bcc, +0x3bc03bc4, +0x3bb83bbc, +0x3bb03bb4, +0x3ba83bac, +0x3ba03ba4, +0x3b983b9c, +0x3b903b94, +0x3b883b8c, +0x3b803b84, +0x3b783b7c, +0x3b703b74, +0x3b683b6c, +0x3b603b64, +0x3b583b5c, +0x3b503b54, +0x3b483b4c, +0x3b403b44, +0x3b383b3c, +0x3b303b34, +0x3b283b2c, +0x3b203b24, +0x3b183b1c, +0x3b103b14, +0x3b083b0c, +0x3b003b04, +0x3af83afc, +0x3af03af4, +0x3ae83aec, +0x3ae03ae4, +0x3ad83adc, +0x3ad03ad4, +0x3ac83acc, +0x3ac03ac4, +0x3ab83abc, +0x3ab03ab4, +0x3aa83aac, +0x3aa03aa4, +0x3a983a9c, +0x3a903a94, +0x3a883a8c, +0x3a803a84, +0x3a783a7c, +0x3a703a74, +0x3a683a6c, +0x3a603a64, +0x3a583a5c, +0x3a503a54, +0x3a483a4c, +0x3a403a44, +0x3a383a3c, +0x3a303a34, +0x3a283a2c, +0x3a203a24, +0x3a183a1c, +0x3a103a14, +0x3a083a0c, +0x3a003a04, +0x37f037f8, +0x37e037e8, +0x37d037d8, +0x37c037c8, +0x37b037b8, +0x37a037a8, +0x37903798, +0x37803788, +0x37703778, +0x37603768, +0x37503758, +0x37403748, +0x37303738, +0x37203728, +0x37103718, +0x37003708, +0x36f036f8, +0x36e036e8, +0x36d036d8, +0x36c036c8, +0x36b036b8, +0x36a036a8, +0x36903698, +0x36803688, +0x36703678, +0x36603668, +0x36503658, +0x36403648, +0x36303638, +0x36203628, +0x36103618, +0x36003608, +0x33e033f0, +0x33c033d0, +0x33a033b0, +0x33803390, +0x33603370, +0x33403350, +0x33203330, +0x33003310, +0x32e032f0, +0x32c032d0, +0x32a032b0, +0x32803290, +0x32603270, +0x32403250, +0x32203230, +0x32003210, +0x2fc02fe0, +0x2f802fa0, +0x2f402f60, +0x2f002f20, +0x2ec02ee0, +0x2e802ea0, +0x2e402e60, +0x2e002e20, +0x2b802bc0, +0x2b002b40, +0x2a802ac0, +0x2a002a40, +0x27002780, +0x26002680, +0x22002300, +0x00001e00, +/* AIR 1: diff=29629.500000 */ +0x3ba63baa, +0x3b9e3ba2, +0x3b963b9a, +0x3b8e3b92, +0x3b863b8a, +0x3b7e3b82, +0x3b763b7a, +0x3b6e3b72, +0x3b663b6a, +0x3b5e3b62, +0x3b563b5a, +0x3b4e3b52, +0x3b463b4a, +0x3b3e3b42, +0x3b363b3a, +0x3b2e3b32, +0x3b263b2a, +0x3b1e3b22, +0x3b163b1a, +0x3b0e3b12, +0x3b063b0a, +0x3afe3b02, +0x3af63afa, +0x3aee3af2, +0x3ae63aea, +0x3ade3ae2, +0x3ad63ada, +0x3ace3ad2, +0x3ac63aca, +0x3abe3ac2, +0x3ab63aba, +0x3aae3ab2, +0x3aa63aaa, +0x3a9f3aa2, +0x3a973a9b, +0x3a8f3a93, +0x3a873a8b, +0x3a7f3a83, +0x3a773a7b, +0x3a6f3a73, +0x3a673a6b, +0x3a5f3a63, +0x3a573a5b, +0x3a4f3a53, +0x3a473a4b, +0x3a3f3a43, +0x3a373a3b, +0x3a2f3a33, +0x3a273a2b, +0x3a1f3a23, +0x3a173a1b, +0x3a0f3a13, +0x3a083a0b, +0x3a003a04, +0x37f037f8, +0x37e037e8, +0x37d037d8, +0x37c137c9, +0x37b137b9, +0x37a137a9, +0x37923799, +0x3782378a, +0x3772377a, +0x3763376a, +0x3753375b, +0x3744374b, +0x3734373c, +0x3724372c, +0x3715371d, +0x3706370d, +0x36f636fe, +0x36e736ef, +0x36d836df, +0x36c836d0, +0x36b936c1, +0x36aa36b2, +0x369b36a2, +0x368c3693, +0x367d3684, +0x366e3675, +0x365f3666, +0x36503658, +0x36423649, +0x3633363a, +0x3625362c, +0x3616361d, +0x3608360f, +0x33f43601, +0x33d833e6, +0x33bc33ca, +0x33a033ae, +0x33853392, +0x33693377, +0x334e335c, +0x33343341, +0x331a3327, +0x3300330d, +0x32e632f3, +0x32cd32d9, +0x32b432c0, +0x329c32a8, +0x3283328f, +0x326c3278, +0x32553260, +0x323e3249, +0x32273233, +0x3212321c, +0x2ff93207, +0x2fcf2fe4, +0x2fa62fba, +0x2f7e2f92, +0x2f572f6b, +0x2f322f44, +0x2f0d2f1f, +0x2ee92efb, +0x2ec72ed8, +0x2ea52eb6, +0x2e802e95, +0x2e402e60, +0x2e002e20, +0x2b802bc0, +0x2b002b40, +0x2a802ac0, +0x2a002a40, +0x27002780, +0x26002680, +0x22002300, +0x00001e00, +/* AIR 2: diff=14814.750000 */ +0x3b553b59, +0x3b4d3b51, +0x3b453b49, +0x3b3d3b41, +0x3b353b39, +0x3b2d3b31, +0x3b253b29, +0x3b1d3b21, +0x3b153b19, +0x3b0d3b11, +0x3b053b09, +0x3afd3b01, +0x3af53af9, +0x3aed3af1, +0x3ae53ae9, +0x3add3ae1, +0x3ad53ad9, +0x3acd3ad1, +0x3ac53ac9, +0x3abd3ac1, +0x3ab53ab9, +0x3aad3ab1, +0x3aa53aa9, +0x3a9d3aa1, +0x3a953a99, +0x3a8d3a91, +0x3a853a89, +0x3a7d3a81, +0x3a753a79, +0x3a6d3a71, +0x3a653a69, +0x3a5d3a61, +0x3a553a59, +0x3a4e3a51, +0x3a463a4a, +0x3a3e3a42, +0x3a363a3a, +0x3a2e3a32, +0x3a263a2a, +0x3a1e3a22, +0x3a163a1a, +0x3a0e3a12, +0x3a063a0a, +0x37fd3a02, +0x37ed37f5, +0x37dd37e5, +0x37ce37d6, +0x37be37c6, +0x37ae37b6, +0x379f37a6, +0x378f3797, +0x377f3787, +0x37703777, +0x37603768, +0x37503758, +0x37413749, +0x37313739, +0x3722372a, +0x3712371a, +0x3703370b, +0x36f436fb, +0x36e436ec, +0x36d536dd, +0x36c636cd, +0x36b636be, +0x36a736af, +0x369836a0, +0x36893691, +0x367a3682, +0x366b3673, +0x365d3664, +0x364e3655, +0x363f3646, +0x36313638, +0x36223629, +0x3614361b, +0x3605360d, +0x33ef33fd, +0x33d333e1, +0x33b733c5, +0x339b33a9, +0x3380338d, +0x33653372, +0x334a3357, +0x332f333d, +0x33153322, +0x32fb3308, +0x32e232ee, +0x32c932d5, +0x32b032bc, +0x329732a4, +0x327f328b, +0x32683273, +0x3251325c, +0x323a3245, +0x3224322f, +0x320e3219, +0x2ff13203, +0x2fc82fdc, +0x2f9f2fb3, +0x2f772f8b, +0x2f512f64, +0x2f2b2f3e, +0x2f072f19, +0x2ee32ef5, +0x2ec12ed2, +0x2ea02eb0, +0x2e802e90, +0x2e602e70, +0x2e422e51, +0x2e262e34, +0x2e0a2e18, +0x2bde2bf9, +0x2bab2bc5, +0x2b7a2b92, +0x2b4a2b62, +0x2b1d2b34, +0x2af22b07, +0x2ac82add, +0x2aa12ab5, +0x2a7b2a8e, +0x2a572a69, +0x2a352a46, +0x2a002a25, +0x27002780, +0x26002680, +0x22002300, +0x00001e00, +/* AIR 3: diff=7407.375000 */ +0x3b043b07, +0x3afc3b00, +0x3af43af8, +0x3aec3af0, +0x3ae43ae8, +0x3adc3ae0, +0x3ad43ad8, +0x3acc3ad0, +0x3ac43ac8, +0x3abc3ac0, +0x3ab43ab8, +0x3aac3ab0, +0x3aa43aa8, +0x3a9c3aa0, +0x3a943a98, +0x3a8c3a90, +0x3a843a88, +0x3a7c3a80, +0x3a743a78, +0x3a6c3a70, +0x3a643a68, +0x3a5c3a60, +0x3a543a58, +0x3a4c3a50, +0x3a443a48, +0x3a3c3a40, +0x3a343a38, +0x3a2c3a30, +0x3a243a28, +0x3a1d3a20, +0x3a153a19, +0x3a0d3a11, +0x3a053a09, +0x37fa3a01, +0x37ea37f2, +0x37db37e3, +0x37cb37d3, +0x37bb37c3, +0x37ac37b3, +0x379c37a4, +0x378c3794, +0x377c3784, +0x376d3775, +0x375d3765, +0x374e3755, +0x373e3746, +0x372f3736, +0x371f3727, +0x37103717, +0x37003708, +0x36f136f9, +0x36e236e9, +0x36d236da, +0x36c336cb, +0x36b436bb, +0x36a536ac, +0x3696369d, +0x3687368e, +0x3678367f, +0x36693670, +0x365a3661, +0x364b3653, +0x363d3644, +0x362e3635, +0x36203627, +0x36113618, +0x3603360a, +0x33ea33f8, +0x33ce33dc, +0x33b233c0, +0x339633a4, +0x337b3389, +0x3360336e, +0x33453353, +0x332b3338, +0x3311331e, +0x32f73304, +0x32dd32ea, +0x32c432d1, +0x32ac32b8, +0x3293329f, +0x327b3287, +0x3264326f, +0x324d3258, +0x32363241, +0x3220322b, +0x320a3215, +0x2fea2fff, +0x2fc12fd5, +0x2f982fac, +0x2f712f84, +0x2f4a2f5d, +0x2f252f37, +0x2f012f13, +0x2edd2eef, +0x2ebb2ecc, +0x2e9a2eaa, +0x2e7a2e8a, +0x2e5b2e6b, +0x2e3d2e4c, +0x2e212e2f, +0x2e052e13, +0x2bd52bf0, +0x2ba22bbc, +0x2b712b8a, +0x2b422b5a, +0x2b162b2c, +0x2aeb2b00, +0x2ac22ad6, +0x2a9a2aae, +0x2a752a87, +0x2a512a63, +0x2a302a40, +0x2a0f2a1f, +0x27e22a00, +0x27a827c5, +0x2771278c, +0x273d2757, +0x270c2724, +0x26dd26f4, +0x26b126c7, +0x2687269c, +0x26602673, +0x263b264d, +0x26182629, +0x23ee2607, +0x22002300, +0x00001e00, +/* AIR 4: diff=3703.687500 */ +0x3ab23ab6, +0x3aaa3aae, +0x3aa23aa6, +0x3a9a3a9e, +0x3a923a96, +0x3a8a3a8e, +0x3a823a86, +0x3a7a3a7e, +0x3a733a77, +0x3a6b3a6f, +0x3a633a67, +0x3a5b3a5f, +0x3a533a57, +0x3a4b3a4f, +0x3a433a47, +0x3a3b3a3f, +0x3a333a37, +0x3a2b3a2f, +0x3a233a27, +0x3a1b3a1f, +0x3a133a17, +0x3a0b3a0f, +0x3a033a07, +0x37f837ff, +0x37e837f0, +0x37d837e0, +0x37c837d0, +0x37b937c0, +0x37a937b1, +0x379937a1, +0x37893791, +0x377a3782, +0x376a3772, +0x375b3762, +0x374b3753, +0x373b3743, +0x372c3734, +0x371c3724, +0x370d3715, +0x36fe3705, +0x36ee36f6, +0x36df36e7, +0x36d036d7, +0x36c036c8, +0x36b136b9, +0x36a236aa, +0x3693369b, +0x3684368c, +0x3675367d, +0x3666366e, +0x3657365f, +0x36493650, +0x363a3641, +0x362c3633, +0x361d3624, +0x360f3616, +0x36003608, +0x33e533f3, +0x33c933d7, +0x33ad33bb, +0x3392339f, +0x33763384, +0x335b3369, +0x3341334e, +0x33263333, +0x330c3319, +0x32f232ff, +0x32d932e6, +0x32c032cc, +0x32a732b4, +0x328f329b, +0x32773283, +0x3260326b, +0x32493254, +0x3232323d, +0x321c3227, +0x32063211, +0x2fe32ff8, +0x2fba2fce, +0x2f912fa5, +0x2f6a2f7d, +0x2f442f57, +0x2f1e2f31, +0x2efa2f0c, +0x2ed72ee9, +0x2eb52ec6, +0x2e942ea5, +0x2e752e84, +0x2e562e65, +0x2e382e47, +0x2e1c2e2a, +0x2e002e0e, +0x2bcc2be7, +0x2b9a2bb3, +0x2b692b81, +0x2b3b2b52, +0x2b0e2b24, +0x2ae32af8, +0x2abb2acf, +0x2a942aa7, +0x2a6f2a81, +0x2a4b2a5d, +0x2a2a2a3a, +0x2a0a2a1a, +0x27d827f6, +0x279e27bb, +0x27682783, +0x2734274e, +0x2703271c, +0x26d526ec, +0x26a926bf, +0x26802695, +0x2659266c, +0x26342647, +0x26122623, +0x23e22601, +0x23a523c3, +0x236b2387, +0x2334234f, +0x2301231a, +0x22d022e8, +0x22a322b9, +0x2278228d, +0x22502264, +0x222b223d, +0x22072219, +0x1fcd1fed, +0x00001e00, +/* AIR 5: diff=1851.843750 */ +0x3a613a65, +0x3a593a5d, +0x3a513a55, +0x3a493a4d, +0x3a413a45, +0x3a393a3d, +0x3a323a36, +0x3a2a3a2e, +0x3a223a26, +0x3a1a3a1e, +0x3a123a16, +0x3a0a3a0e, +0x3a023a06, +0x37f537fd, +0x37e537ed, +0x37d537dd, +0x37c637cd, +0x37b637be, +0x37a637ae, +0x3796379e, +0x3787378f, +0x3777377f, +0x3767376f, +0x37583760, +0x37483750, +0x37393741, +0x37293731, +0x371a3721, +0x370a3712, +0x36fb3703, +0x36ec36f3, +0x36dc36e4, +0x36cd36d5, +0x36be36c5, +0x36af36b6, +0x369f36a7, +0x36903698, +0x36813689, +0x3672367a, +0x3664366b, +0x3655365c, +0x3646364d, +0x3638363f, +0x36293630, +0x361b3622, +0x360c3613, +0x33fc3605, +0x33e033ee, +0x33c433d2, +0x33a833b6, +0x338d339b, +0x3372337f, +0x33573364, +0x333c3349, +0x3322332f, +0x33083315, +0x32ee32fb, +0x32d532e1, +0x32bc32c8, +0x32a332af, +0x328b3297, +0x3273327f, +0x325c3267, +0x32453250, +0x322e3239, +0x32183223, +0x3203320d, +0x2fdc2ff1, +0x2fb22fc7, +0x2f8a2f9e, +0x2f632f77, +0x2f3d2f50, +0x2f182f2b, +0x2ef42f06, +0x2ed12ee3, +0x2eb02ec0, +0x2e8f2e9f, +0x2e6f2e7f, +0x2e512e60, +0x2e332e42, +0x2e172e25, +0x2bf82e09, +0x2bc32bdd, +0x2b912baa, +0x2b612b79, +0x2b332b4a, +0x2b062b1c, +0x2adc2af1, +0x2ab42ac8, +0x2a8d2aa0, +0x2a682a7b, +0x2a462a57, +0x2a242a35, +0x2a052a14, +0x27ce27eb, +0x279527b1, +0x275f2779, +0x272c2745, +0x26fb2713, +0x26cd26e4, +0x26a226b8, +0x2679268d, +0x26532666, +0x262e2640, +0x260c261d, +0x23d823f7, +0x239b23b9, +0x2361237d, +0x232b2346, +0x22f82311, +0x22c822e0, +0x229b22b2, +0x22712286, +0x224a225d, +0x22242237, +0x22012213, +0x1fc21fe2, +0x1f841fa3, +0x1f4b1f67, +0x1f141f2f, +0x1ee21efb, +0x1eb21eca, +0x1e861e9c, +0x1e5c1e71, +0x1e351e48, +0x1e101e22, +0x1bdd1bfe, +0x00001bbc, +/* AIR 6: diff=925.921875 */ +0x3a103a14, +0x3a093a0d, +0x3a013a05, +0x37f237fa, +0x37e237ea, +0x37d337da, +0x37c337cb, +0x37b337bb, +0x37a337ab, +0x3794379c, +0x3784378c, +0x3774377c, +0x3765376d, +0x3755375d, +0x3746374d, +0x3736373e, +0x3727372e, +0x3717371f, +0x3708370f, +0x36f83700, +0x36e936f1, +0x36da36e1, +0x36ca36d2, +0x36bb36c3, +0x36ac36b4, +0x369d36a4, +0x368e3695, +0x367f3686, +0x36703677, +0x36613668, +0x3652365a, +0x3644364b, +0x3635363c, +0x3626362e, +0x3618361f, +0x360a3611, +0x33f83603, +0x33db33e9, +0x33bf33cd, +0x33a433b1, +0x33883396, +0x336d337b, +0x3352335f, +0x33373345, +0x331d332a, +0x33033310, +0x32ea32f6, +0x32d032dd, +0x32b732c4, +0x329f32ab, +0x32873293, +0x326f327b, +0x32583263, +0x3241324c, +0x322a3236, +0x3214321f, +0x2ffe320a, +0x2fd42fe9, +0x2fab2fc0, +0x2f832f97, +0x2f5d2f70, +0x2f372f49, +0x2f122f24, +0x2eee2f00, +0x2ecb2edd, +0x2eaa2eba, +0x2e892e99, +0x2e6a2e79, +0x2e4c2e5b, +0x2e2e2e3d, +0x2e122e20, +0x2bef2e05, +0x2bbb2bd4, +0x2b892ba1, +0x2b592b70, +0x2b2b2b42, +0x2aff2b15, +0x2ad52aea, +0x2aad2ac1, +0x2a872a9a, +0x2a622a74, +0x2a402a51, +0x2a1f2a2f, +0x27ff2a0f, +0x27c427e1, +0x278b27a7, +0x27562770, +0x2723273c, +0x26f3270b, +0x26c626dc, +0x269b26b0, +0x26722686, +0x264c265f, +0x2628263a, +0x26062617, +0x23cd23ec, +0x239023ae, +0x23572373, +0x2322233c, +0x22f02308, +0x22c022d8, +0x229422aa, +0x226a227f, +0x22432256, +0x221e2230, +0x1ff8220d, +0x1fb71fd7, +0x1f7a1f98, +0x1f411f5d, +0x1f0b1f26, +0x1ed91ef2, +0x1eaa1ec1, +0x1e7e1e94, +0x1e551e69, +0x1e2e1e41, +0x1e0a1e1c, +0x1bd11bf3, +0x1b921bb1, +0x1b561b74, +0x1b1f1b3a, +0x1aeb1b04, +0x1aba1ad2, +0x1a8d1aa3, +0x1a621a77, +0x1a3a1a4e, +0x1a151a27, +0x17e51a03, +0x000017c4, +/* AIR 7: diff=462.960938 */ +0x37813789, +0x37723779, +0x3762376a, +0x3752375a, +0x3743374b, +0x3733373b, +0x3724372c, +0x3714371c, +0x3705370d, +0x36f636fd, +0x36e636ee, +0x36d736df, +0x36c836cf, +0x36b836c0, +0x36a936b1, +0x369a36a2, +0x368b3693, +0x367c3684, +0x366d3675, +0x365f3666, +0x36503657, +0x36413648, +0x3632363a, +0x3624362b, +0x3616361d, +0x3607360e, +0x33f33600, +0x33d633e5, +0x33bb33c8, +0x339f33ad, +0x33833391, +0x33683376, +0x334d335b, +0x33333340, +0x33193326, +0x32ff330c, +0x32e532f2, +0x32cc32d8, +0x32b332bf, +0x329b32a7, +0x3283328f, +0x326b3277, +0x3254325f, +0x323d3248, +0x32273232, +0x3211321c, +0x2ff73206, +0x2fcd2fe2, +0x2fa42fb9, +0x2f7d2f90, +0x2f562f69, +0x2f302f43, +0x2f0c2f1e, +0x2ee82efa, +0x2ec62ed7, +0x2ea42eb5, +0x2e842e94, +0x2e652e74, +0x2e462e55, +0x2e292e38, +0x2e0d2e1b, +0x2be62e00, +0x2bb22bcb, +0x2b802b99, +0x2b512b68, +0x2b232b3a, +0x2af82b0d, +0x2ace2ae2, +0x2aa62aba, +0x2a802a93, +0x2a5c2a6e, +0x2a3a2a4b, +0x2a192a29, +0x27f52a09, +0x27ba27d7, +0x2782279d, +0x274d2767, +0x271b2733, +0x26eb2703, +0x26be26d4, +0x269426a9, +0x266c267f, +0x26462658, +0x26222634, +0x26002611, +0x23c223e1, +0x238623a4, +0x234e236a, +0x23192333, +0x22e72300, +0x22b922d0, +0x228d22a2, +0x22632278, +0x223c2250, +0x2218222a, +0x1fec2207, +0x1fac1fcc, +0x1f701f8d, +0x1f371f53, +0x1f031f1d, +0x1ed11ee9, +0x1ea21eb9, +0x1e771e8c, +0x1e4e1e62, +0x1e281e3b, +0x1e041e16, +0x1bc61be7, +0x1b871ba6, +0x1b4c1b69, +0x1b161b31, +0x1ae21afb, +0x1ab21aca, +0x1a851a9b, +0x1a5b1a70, +0x1a341a47, +0x1a0f1a21, +0x17d917fb, +0x179917b8, +0x175c177a, +0x17241740, +0x16ef1709, +0x16be16d6, +0x169016a7, +0x1665167a, +0x163d1651, +0x1617162a, +0x13e91605, +0x000013c8, +/* AIR 8: diff=231.480469 */ +0x36e436eb, +0x36d436dc, +0x36c536cd, +0x36b636bd, +0x36a736ae, +0x3698369f, +0x36893690, +0x367a3681, +0x366b3672, +0x365c3663, +0x364d3655, +0x363f3646, +0x36303637, +0x36213629, +0x3613361a, +0x3605360c, +0x33ee33fc, +0x33d233e0, +0x33b633c4, +0x339a33a8, +0x337f338c, +0x33643371, +0x33493356, +0x332e333c, +0x33143321, +0x32fa3307, +0x32e132ed, +0x32c832d4, +0x32af32bb, +0x329632a3, +0x327e328a, +0x32673273, +0x3250325b, +0x32393244, +0x3223322e, +0x320d3218, +0x2ff03202, +0x2fc62fdb, +0x2f9d2fb2, +0x2f762f8a, +0x2f4f2f62, +0x2f2a2f3c, +0x2f052f17, +0x2ee22ef4, +0x2ec02ed1, +0x2e9e2eaf, +0x2e7e2e8e, +0x2e5f2e6f, +0x2e412e50, +0x2e242e33, +0x2e092e16, +0x2bdc2bf7, +0x2ba92bc2, +0x2b782b90, +0x2b492b60, +0x2b1b2b32, +0x2af02b06, +0x2ac72adb, +0x2a9f2ab3, +0x2a7a2a8c, +0x2a562a68, +0x2a342a45, +0x2a142a24, +0x27ea2a04, +0x27b027cd, +0x27782794, +0x2744275e, +0x2712272b, +0x26e326fa, +0x26b726cd, +0x268d26a1, +0x26652678, +0x263f2652, +0x261c262e, +0x23f6260b, +0x23b723d6, +0x237c2399, +0x23452360, +0x2310232a, +0x22df22f7, +0x22b122c7, +0x2285229b, +0x225c2270, +0x22362249, +0x22122224, +0x1fe12201, +0x1fa11fc1, +0x1f661f83, +0x1f2e1f49, +0x1efa1f13, +0x1ec91ee1, +0x1e9b1eb1, +0x1e701e85, +0x1e471e5b, +0x1e221e34, +0x1bfd1e10, +0x1bbb1bdb, +0x1b7d1b9b, +0x1b431b5f, +0x1b0c1b27, +0x1ada1af3, +0x1aaa1ac1, +0x1a7e1a93, +0x1a541a68, +0x1a2d1a40, +0x1a091a1b, +0x17ce17ef, +0x178e17ad, +0x17521770, +0x171b1736, +0x16e71700, +0x16b616ce, +0x1689169f, +0x165e1673, +0x1636164a, +0x16111623, +0x13dd13ff, +0x139c13bc, +0x1360137d, +0x13271343, +0x12f2130c, +0x12c012d9, +0x129212a9, +0x1267127c, +0x123e1252, +0x1219122b, +0x0feb1207, +0x00000fc9, +/* AIR 9: diff=115.740234 */ +0x364b3652, +0x363c3643, +0x362d3635, +0x361f3626, +0x36113618, +0x36023609, +0x33e933f7, +0x33cd33db, +0x33b133bf, +0x339533a3, +0x337a3388, +0x335f336c, +0x33443352, +0x332a3337, +0x3310331d, +0x32f63303, +0x32dc32e9, +0x32c332d0, +0x32ab32b7, +0x3292329e, +0x327a3286, +0x3263326e, +0x324c3257, +0x32353240, +0x321f322a, +0x32093214, +0x2fe82ffe, +0x2fbf2fd4, +0x2f972fab, +0x2f6f2f83, +0x2f492f5c, +0x2f232f36, +0x2eff2f11, +0x2edc2eed, +0x2eba2ecb, +0x2e992ea9, +0x2e792e89, +0x2e5a2e69, +0x2e3c2e4b, +0x2e202e2e, +0x2e042e12, +0x2bd32bee, +0x2ba02bba, +0x2b6f2b88, +0x2b412b58, +0x2b142b2a, +0x2ae92afe, +0x2ac02ad4, +0x2a992aac, +0x2a742a86, +0x2a502a62, +0x2a2e2a3f, +0x2a0e2a1e, +0x27e027fe, +0x27a627c3, +0x276f278a, +0x273b2755, +0x270a2722, +0x26db26f2, +0x26af26c5, +0x2686269a, +0x265e2672, +0x2639264b, +0x26162627, +0x23eb2605, +0x23ad23cb, +0x2372238f, +0x233b2356, +0x23072321, +0x22d722ef, +0x22a922c0, +0x227e2293, +0x22562269, +0x22302242, +0x220c221d, +0x1fd51ff6, +0x1f971fb6, +0x1f5c1f79, +0x1f251f40, +0x1ef11f0a, +0x1ec01ed8, +0x1e931ea9, +0x1e681e7d, +0x1e411e54, +0x1e1b1e2e, +0x1bf11e0a, +0x1bb01bd0, +0x1b721b91, +0x1b391b55, +0x1b031b1e, +0x1ad11aea, +0x1aa21ab9, +0x1a761a8c, +0x1a4d1a61, +0x1a271a39, +0x1a031a14, +0x17c217e3, +0x178317a2, +0x17491765, +0x1711172d, +0x16de16f7, +0x16ae16c6, +0x16811697, +0x1657166c, +0x16301643, +0x160b161d, +0x13d213f3, +0x139113b1, +0x13551373, +0x131d1339, +0x12e91303, +0x12b812d0, +0x128a12a1, +0x12601275, +0x1238124b, +0x12121225, +0x0fdf1201, +0x0f9e0fbe, +0x0f610f7f, +0x0f280f44, +0x0ef30f0d, +0x0ec10eda, +0x0e930eaa, +0x0e680e7d, +0x0e3f0e53, +0x0e190e2c, +0x0bec0e07, +0x00000bcb, +/* AIR 10: diff=57.870117 */ +0x33753383, +0x335a3368, +0x3340334d, +0x33253332, +0x330b3318, +0x32f132fe, +0x32d832e5, +0x32bf32cb, +0x32a632b3, +0x328e329a, +0x32763282, +0x325f326a, +0x32483253, +0x3231323c, +0x321b3226, +0x32053210, +0x2fe12ff6, +0x2fb82fcc, +0x2f902fa4, +0x2f682f7c, +0x2f422f55, +0x2f1d2f2f, +0x2ef92f0b, +0x2ed62ee7, +0x2eb42ec5, +0x2e932ea3, +0x2e732e83, +0x2e552e64, +0x2e372e46, +0x2e1b2e29, +0x2bff2e0d, +0x2bca2be4, +0x2b982bb1, +0x2b672b7f, +0x2b392b50, +0x2b0c2b22, +0x2ae22af7, +0x2ab92acd, +0x2a922aa5, +0x2a6d2a80, +0x2a4a2a5b, +0x2a292a39, +0x2a092a18, +0x27d627f3, +0x279c27b9, +0x27662781, +0x2732274c, +0x2702271a, +0x26d326ea, +0x26a826bd, +0x267f2693, +0x2658266b, +0x26332645, +0x26102621, +0x23e02600, +0x23a223c1, +0x23692385, +0x2332234d, +0x22ff2318, +0x22cf22e6, +0x22a122b8, +0x2277228c, +0x224f2262, +0x2229223c, +0x22062217, +0x1fca1feb, +0x1f8c1fab, +0x1f521f6f, +0x1f1b1f36, +0x1ee81f02, +0x1eb81ed0, +0x1e8b1ea2, +0x1e611e76, +0x1e3a1e4d, +0x1e151e27, +0x1be61e04, +0x1ba51bc5, +0x1b681b86, +0x1b2f1b4b, +0x1afa1b15, +0x1ac91ae1, +0x1a9a1ab1, +0x1a6f1a84, +0x1a461a5a, +0x1a201a33, +0x17fa1a0e, +0x17b717d8, +0x17791797, +0x173f175b, +0x17081723, +0x16d516ee, +0x16a616bd, +0x1679168f, +0x16501664, +0x1629163c, +0x16051617, +0x13c613e8, +0x138713a6, +0x134b1369, +0x1314132f, +0x12e012fa, +0x12b012c8, +0x12831299, +0x1258126d, +0x12311244, +0x120c121e, +0x0fd40ff6, +0x0f930fb3, +0x0f570f75, +0x0f1f0f3a, +0x0eea0f04, +0x0eb90ed1, +0x0e8b0ea2, +0x0e600e75, +0x0e380e4c, +0x0e130e25, +0x0be00e01, +0x0b9f0bbf, +0x0b620b80, +0x0b290b45, +0x0af40b0e, +0x0ac20ada, +0x0a930aaa, +0x0a680a7d, +0x0a3f0a53, +0x0a1a0a2c, +0x07ed0a08, +0x000007cb, +/* AIR 11: diff=28.935059 */ +0x3272327e, +0x325b3266, +0x3244324f, +0x322d3239, +0x32173222, +0x3202320c, +0x2fda2fef, +0x2fb12fc5, +0x2f892f9d, +0x2f622f75, +0x2f3c2f4f, +0x2f172f29, +0x2ef32f05, +0x2ed02ee1, +0x2eae2ebf, +0x2e8e2e9e, +0x2e6e2e7e, +0x2e502e5f, +0x2e322e41, +0x2e162e24, +0x2bf62e08, +0x2bc12bdb, +0x2b8f2ba8, +0x2b5f2b77, +0x2b312b48, +0x2b052b1b, +0x2ada2aef, +0x2ab22ac6, +0x2a8c2a9f, +0x2a672a79, +0x2a442a55, +0x2a232a33, +0x2a032a13, +0x27cb27e9, +0x279327af, +0x275d2777, +0x272a2743, +0x26f92711, +0x26cc26e2, +0x26a026b6, +0x2678268c, +0x26512664, +0x262d263f, +0x260b261b, +0x23d523f5, +0x239823b6, +0x235f237b, +0x23292344, +0x22f6230f, +0x22c722de, +0x229a22b0, +0x22702284, +0x2248225c, +0x22232235, +0x22002211, +0x1fbf1fdf, +0x1f821fa0, +0x1f481f65, +0x1f121f2d, +0x1ee01ef9, +0x1eb01ec8, +0x1e841e9a, +0x1e5a1e6f, +0x1e331e47, +0x1e0f1e21, +0x1bda1bfc, +0x1b9a1bb9, +0x1b5e1b7c, +0x1b261b42, +0x1af21b0b, +0x1ac01ad9, +0x1a931aa9, +0x1a681a7d, +0x1a3f1a53, +0x1a1a1a2c, +0x17ee1a08, +0x17ac17cc, +0x176f178d, +0x17351751, +0x16ff171a, +0x16cd16e6, +0x169e16b5, +0x16721688, +0x1649165d, +0x16231635, +0x13fe1610, +0x13bb13dc, +0x137c139b, +0x1342135e, +0x130b1326, +0x12d812f1, +0x12a812bf, +0x127b1291, +0x12511266, +0x122a123e, +0x12061218, +0x0fc80fea, +0x0f880fa8, +0x0f4d0f6a, +0x0f150f31, +0x0ee10efb, +0x0eb10ec9, +0x0e840e9a, +0x0e590e6e, +0x0e320e45, +0x0e0d0e1f, +0x0bd50bf7, +0x0b940bb4, +0x0b580b75, +0x0b1f0b3b, +0x0aeb0b05, +0x0aba0ad2, +0x0a8c0aa2, +0x0a610a76, +0x0a390a4c, +0x0a130a26, +0x07e10a01, +0x07a007c0, +0x07630781, +0x07290745, +0x06f4070e, +0x06c206db, +0x069406ab, +0x0668067e, +0x06400654, +0x061a062c, +0x03ed0608, +0x000003cc, +/* AIR 12: diff=14.467529 */ +0x2f352f48, +0x2f102f23, +0x2eed2efe, +0x2eca2edb, +0x2ea92eb9, +0x2e882e98, +0x2e692e78, +0x2e4a2e59, +0x2e2d2e3c, +0x2e112e1f, +0x2bed2e03, +0x2bb92bd2, +0x2b872b9f, +0x2b572b6f, +0x2b292b40, +0x2afd2b13, +0x2ad32ae8, +0x2aab2abf, +0x2a852a98, +0x2a612a73, +0x2a3e2a4f, +0x2a1d2a2e, +0x27fd2a0e, +0x27c127df, +0x278927a5, +0x2754276e, +0x2721273a, +0x26f12709, +0x26c426da, +0x269926ae, +0x26712685, +0x264b265e, +0x26272638, +0x26052616, +0x23ca23ea, +0x238e23ac, +0x23552371, +0x2320233a, +0x22ee2306, +0x22bf22d6, +0x229222a8, +0x2269227d, +0x22412255, +0x221d222f, +0x1ff5220b, +0x1fb41fd4, +0x1f781f96, +0x1f3f1f5b, +0x1f091f24, +0x1ed71ef0, +0x1ea91ec0, +0x1e7d1e92, +0x1e531e68, +0x1e2d1e40, +0x1e091e1b, +0x1bcf1bf0, +0x1b8f1bae, +0x1b541b71, +0x1b1d1b38, +0x1ae91b02, +0x1ab81ad0, +0x1a8b1aa1, +0x1a601a75, +0x1a391a4c, +0x1a141a26, +0x17e21a02, +0x17a117c1, +0x17641782, +0x172b1747, +0x16f61710, +0x16c516dd, +0x169616ad, +0x166b1680, +0x16421656, +0x161c162f, +0x13f2160a, +0x13b013d0, +0x13721390, +0x13381354, +0x1302131c, +0x12cf12e8, +0x12a012b7, +0x12741289, +0x124a125f, +0x12241237, +0x12001212, +0x0fbd0fde, +0x0f7e0f9d, +0x0f430f60, +0x0f0c0f27, +0x0ed90ef2, +0x0ea90ec0, +0x0e7c0e92, +0x0e520e67, +0x0e2b0e3e, +0x0e060e18, +0x0bc90beb, +0x0b890ba9, +0x0b4e0b6b, +0x0b160b31, +0x0ae20afc, +0x0ab10ac9, +0x0a840a9a, +0x0a5a0a6f, +0x0a320a46, +0x0a0d0a1f, +0x07d507f7, +0x079507b4, +0x07580776, +0x0720073c, +0x06eb0705, +0x06ba06d2, +0x068c06a3, +0x06610676, +0x0639064d, +0x06140626, +0x03e10602, +0x03a003c0, +0x03630381, +0x032a0346, +0x02f5030f, +0x02c302db, +0x029402ab, +0x0269027e, +0x02400254, +0x021a022d, +0x01f70208, +0x000001e6, +/* AIR 13: diff=7.233765 */ +0x2be32bfe, +0x2bb02bc9, +0x2b7e2b97, +0x2b4f2b66, +0x2b212b38, +0x2af62b0b, +0x2acc2ae1, +0x2aa52ab8, +0x2a7f2a91, +0x2a5b2a6d, +0x2a382a49, +0x2a182a28, +0x27f22a08, +0x27b727d4, +0x2780279b, +0x274b2765, +0x27192731, +0x26e92701, +0x26bc26d3, +0x269226a7, +0x266a267e, +0x26442657, +0x26212632, +0x23ff2610, +0x23c023df, +0x238423a1, +0x234c2367, +0x23172331, +0x22e522fe, +0x22b722ce, +0x228b22a0, +0x22622276, +0x223b224e, +0x22172228, +0x1fea2205, +0x1faa1fc9, +0x1f6e1f8b, +0x1f351f51, +0x1f001f1a, +0x1ecf1ee7, +0x1ea11eb7, +0x1e751e8b, +0x1e4d1e61, +0x1e261e39, +0x1e031e14, +0x1bc31be4, +0x1b851ba4, +0x1b4a1b67, +0x1b131b2e, +0x1ae01af9, +0x1ab01ac8, +0x1a831a99, +0x1a591a6e, +0x1a321a45, +0x1a0d1a1f, +0x17d717f8, +0x179617b6, +0x175a1778, +0x1722173e, +0x16ed1707, +0x16bc16d4, +0x168e16a5, +0x16641679, +0x163b164f, +0x16161628, +0x13e61604, +0x13a513c5, +0x13671386, +0x132e134a, +0x12f91313, +0x12c712df, +0x129812af, +0x126c1282, +0x12441258, +0x121d1230, +0x0ff4120b, +0x0fb20fd2, +0x0f730f92, +0x0f390f56, +0x0f030f1e, +0x0ed00ee9, +0x0ea10eb8, +0x0e750e8a, +0x0e4b0e60, +0x0e250e38, +0x0e000e12, +0x0bbe0bdf, +0x0b7f0b9e, +0x0b440b61, +0x0b0d0b28, +0x0ad90af3, +0x0aa90ac1, +0x0a7d0a93, +0x0a530a67, +0x0a2b0a3f, +0x0a070a19, +0x07ca07eb, +0x078a07a9, +0x074e076c, +0x07170732, +0x06e206fc, +0x06b206ca, +0x0684069b, +0x065a066f, +0x06320646, +0x060d061f, +0x03d603f8, +0x039503b5, +0x03590376, +0x0320033c, +0x02ec0306, +0x02ba02d3, +0x028c02a3, +0x02610277, +0x0239024d, +0x02140226, +0x01f10202, +0x01d001e0, +0x01b201c1, +0x019501a3, +0x017a0187, +0x0161016e, +0x014a0156, +0x0134013f, +0x0120012a, +0x010d0116, +0x00fb0104, +0x000000f3, +/* AIR 14: diff=3.616882 */ +0x2a332a43, +0x2a122a22, +0x27e82a03, +0x27ae27ca, +0x27762792, +0x2742275c, +0x27102729, +0x26e126f8, +0x26b526cb, +0x268b26a0, +0x26632677, +0x263e2650, +0x261b262c, +0x23f4260a, +0x23b523d4, +0x237a2397, +0x2342235e, +0x230e2328, +0x22dd22f5, +0x22af22c6, +0x22842299, +0x225b226f, +0x22342247, +0x22112222, +0x1fde1fff, +0x1f9f1fbe, +0x1f641f81, +0x1f2c1f47, +0x1ef81f11, +0x1ec71edf, +0x1e991eaf, +0x1e6e1e83, +0x1e461e5a, +0x1e201e33, +0x1bfa1e0e, +0x1bb81bd9, +0x1b7a1b99, +0x1b401b5d, +0x1b0a1b25, +0x1ad81af1, +0x1aa81ac0, +0x1a7c1a92, +0x1a521a67, +0x1a2c1a3f, +0x1a071a19, +0x17cb17ec, +0x178c17ab, +0x1750176d, +0x17191734, +0x16e516fe, +0x16b416cc, +0x1687169d, +0x165c1671, +0x16351648, +0x16101622, +0x13db13fd, +0x139a13ba, +0x135d137b, +0x13251340, +0x12f0130a, +0x12be12d7, +0x129012a7, +0x1265127a, +0x123d1251, +0x1217122a, +0x0fe81205, +0x0fa70fc7, +0x0f690f87, +0x0f300f4c, +0x0efa0f14, +0x0ec80ee0, +0x0e990eb0, +0x0e6d0e83, +0x0e440e58, +0x0e1e0e31, +0x0bf50e0c, +0x0bb30bd3, +0x0b740b93, +0x0b3a0b57, +0x0b040b1e, +0x0ad10aea, +0x0aa10ab9, +0x0a750a8b, +0x0a4c0a60, +0x0a250a38, +0x0a010a13, +0x07be07e0, +0x077f079e, +0x07440761, +0x070d0728, +0x06da06f3, +0x06aa06c1, +0x067d0693, +0x06530668, +0x062c063f, +0x06070619, +0x03ca03ec, +0x038a03aa, +0x034f036c, +0x03170332, +0x02e302fc, +0x02b202ca, +0x0285029b, +0x025a026f, +0x02330246, +0x020e0220, +0x01eb01fc, +0x01cb01db, +0x01ac01bb, +0x0190019e, +0x01760183, +0x015d0169, +0x01460152, +0x0131013b, +0x011d0127, +0x010a0113, +0x00f80101, +0x00e800f0, +0x00d900e0, +0x00ca00d2, +0x00bd00c4, +0x00b100b7, +0x00a500ab, +0x009a00a0, +0x00900095, +0x0087008b, +0x007e0082, +0x00000079, +/* AIR 15: diff=1.808441 */ +0x265d2670, +0x2638264a, +0x26152626, +0x23e82604, +0x23aa23c9, +0x2370238d, +0x23392354, +0x2305231f, +0x22d522ed, +0x22a722be, +0x227c2291, +0x22542268, +0x222e2241, +0x220b221c, +0x1fd31ff4, +0x1f941fb3, +0x1f5a1f76, +0x1f231f3e, +0x1eef1f08, +0x1ebf1ed6, +0x1e911ea8, +0x1e671e7c, +0x1e3f1e53, +0x1e1a1e2c, +0x1bee1e08, +0x1bad1bcd, +0x1b701b8e, +0x1b371b53, +0x1b011b1c, +0x1acf1ae8, +0x1aa01ab7, +0x1a741a8a, +0x1a4b1a60, +0x1a251a38, +0x1a011a13, +0x17c017e1, +0x178117a0, +0x17461763, +0x170f172a, +0x16dc16f5, +0x16ac16c4, +0x167f1695, +0x1655166a, +0x162e1641, +0x1609161b, +0x13cf13f1, +0x138f13ae, +0x13531371, +0x131b1337, +0x12e71301, +0x12b612ce, +0x1289129f, +0x125e1273, +0x1236124a, +0x12111223, +0x0fdd0fff, +0x0f9c0fbc, +0x0f5f0f7d, +0x0f260f42, +0x0ef10f0b, +0x0ebf0ed8, +0x0e910ea8, +0x0e660e7b, +0x0e3d0e51, +0x0e180e2a, +0x0be90e06, +0x0ba70bc8, +0x0b6a0b88, +0x0b300b4d, +0x0afb0b15, +0x0ac80ae1, +0x0a990ab1, +0x0a6e0a83, +0x0a450a59, +0x0a1e0a31, +0x07f60a0c, +0x07b307d4, +0x07750793, +0x073b0757, +0x0704071f, +0x06d106ea, +0x06a206b9, +0x0675068b, +0x064c0660, +0x06250638, +0x06010613, +0x03bf03e0, +0x0380039f, +0x03450362, +0x030e0329, +0x02da02f4, +0x02aa02c2, +0x027d0293, +0x02530268, +0x022c023f, +0x02070219, +0x01e501f6, +0x01c501d5, +0x01a701b6, +0x018c0199, +0x0171017e, +0x01590165, +0x0142014e, +0x012d0138, +0x01190123, +0x01070110, +0x00f600fe, +0x00e500ed, +0x00d600de, +0x00c800cf, +0x00bb00c1, +0x00af00b5, +0x00a300a9, +0x0098009e, +0x008e0093, +0x0085008a, +0x007c0081, +0x00740078, +0x006c0070, +0x00650069, +0x005f0062, +0x0058005b, +0x00530055, +0x004d0050, +0x0048004b, +0x00430046, +0x003f0041, +0x0000003d, + /* RDF 0: 1/1: 255.000000 */ +0x1e000000, +0x23002200, +0x26802600, +0x27802700, +0x2a402a00, +0x2ac02a80, +0x2b402b00, +0x2bc02b80, +0x2e202e00, +0x2e602e40, +0x2ea02e80, +0x2ee02ec0, +0x2f202f00, +0x2f602f40, +0x2fa02f80, +0x2fe02fc0, +0x32103200, +0x32303220, +0x32503240, +0x32703260, +0x32903280, +0x32b032a0, +0x32d032c0, +0x32f032e0, +0x33103300, +0x33303320, +0x33503340, +0x33703360, +0x33903380, +0x33b033a0, +0x33d033c0, +0x33f033e0, +0x36083600, +0x36183610, +0x36283620, +0x36383630, +0x36483640, +0x36583650, +0x36683660, +0x36783670, +0x36883680, +0x36983690, +0x36a836a0, +0x36b836b0, +0x36c836c0, +0x36d836d0, +0x36e836e0, +0x36f836f0, +0x37083700, +0x37183710, +0x37283720, +0x37383730, +0x37483740, +0x37583750, +0x37683760, +0x37783770, +0x37883780, +0x37983790, +0x37a837a0, +0x37b837b0, +0x37c837c0, +0x37d837d0, +0x37e837e0, +0x37f837f0, +0x3a043a00, +0x3a0c3a08, +0x3a143a10, +0x3a1c3a18, +0x3a243a20, +0x3a2c3a28, +0x3a343a30, +0x3a3c3a38, +0x3a443a40, +0x3a4c3a48, +0x3a543a50, +0x3a5c3a58, +0x3a643a60, +0x3a6c3a68, +0x3a743a70, +0x3a7c3a78, +0x3a843a80, +0x3a8c3a88, +0x3a943a90, +0x3a9c3a98, +0x3aa43aa0, +0x3aac3aa8, +0x3ab43ab0, +0x3abc3ab8, +0x3ac43ac0, +0x3acc3ac8, +0x3ad43ad0, +0x3adc3ad8, +0x3ae43ae0, +0x3aec3ae8, +0x3af43af0, +0x3afc3af8, +0x3b043b00, +0x3b0c3b08, +0x3b143b10, +0x3b1c3b18, +0x3b243b20, +0x3b2c3b28, +0x3b343b30, +0x3b3c3b38, +0x3b443b40, +0x3b4c3b48, +0x3b543b50, +0x3b5c3b58, +0x3b643b60, +0x3b6c3b68, +0x3b743b70, +0x3b7c3b78, +0x3b843b80, +0x3b8c3b88, +0x3b943b90, +0x3b9c3b98, +0x3ba43ba0, +0x3bac3ba8, +0x3bb43bb0, +0x3bbc3bb8, +0x3bc43bc0, +0x3bcc3bc8, +0x3bd43bd0, +0x3bdc3bd8, +0x3be43be0, +0x3bec3be8, +0x3bf43bf0, +0x3bfc3bf8, + /* RDF 1: 1/2: 20.346580 */ +0x1e000000, +0x23002200, +0x26802600, +0x27802700, +0x2a402a00, +0x2ac02a80, +0x2b402b00, +0x2bc02b80, +0x2e202e00, +0x2e602e40, +0x2e8b2e80, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, +0x2e8b2e8b, + /* RDF 2: 1/4: 8.444594 */ +0x1e000000, +0x23002200, +0x26802600, +0x27802700, +0x2a1c2a00, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, +0x2a1c2a1c, + /* RDF 3: 1/8: 3.919669 */ +0x1e000000, +0x23002200, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, +0x23eb23eb, + /* RDF 4: 1/16: 1.894458 */ +0x1e000000, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, +0x1fc91fc9, + /* RDF 5: 1/32: 0.931948 */ +0x1bba0000, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, +0x1bba1bba, + /* RDF 6: 1/64: 0.462276 */ +0x17b20000, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, +0x17b217b2, + /* RDF 7: 1/128: 0.230228 */ +0x13af0000, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, +0x13af13af, + /* RDF 8: 1/256: 0.114888 */ +0x0fad0000, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, +0x0fad0fad, + /* RDF 9: 1/512: 0.057388 */ +0x0bac0000, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, +0x0bac0bac, + /* RDF 10: 1/1024: 0.028680 */ +0x07ac0000, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, +0x07ac07ac, + /* RDF 11: 1/2048: 0.014336 */ +0x03ac0000, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, +0x03ac03ac, + /* RDF 12: 1/4096: 0.007167 */ +0x01d60000, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, +0x01d601d6, + /* RDF 13: 1/8192: 0.003583 */ +0x00eb0000, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, +0x00eb00eb, + /* RDF 14: 1/16384: 0.001792 */ +0x00750000, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, +0x00750075, + /* RDF 15: 1/32768: 0.000896 */ +0x003b0000, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +0x003b003b, +}; diff --git a/sys/dev/patm/if_patm_rx.c b/sys/dev/patm/if_patm_rx.c new file mode 100644 index 000000000000..53361885dfde --- /dev/null +++ b/sys/dev/patm/if_patm_rx.c @@ -0,0 +1,529 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Hartmut Brandt + * + * Driver for IDT77252 based cards like ProSum's. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_natm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#ifdef ENABLE_BPF +#include +#endif +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +static void *patm_rcv_handle(struct patm_softc *sc, u_int handle); +static void patm_rcv_free(struct patm_softc *, void *, u_int handle); +static struct mbuf *patm_rcv_mbuf(struct patm_softc *, void *, u_int, int); + +static __inline void +rct_write(struct patm_softc *sc, u_int cid, u_int w, u_int val) +{ + patm_sram_write(sc, sc->mmap->rct + cid * IDT_RCT_ENTRY_SIZE + w, val); +} +static __inline void +rct_init(struct patm_softc *sc, u_int cid, u_int w1) +{ + patm_sram_write4(sc, sc->mmap->rct + cid * IDT_RCT_ENTRY_SIZE, + w1, 0, 0, 0xffffffff); +} +static __inline u_int +rct_read(struct patm_softc *sc, u_int cid, u_int w) +{ + return (patm_sram_read(sc, sc->mmap->rct + + cid * IDT_RCT_ENTRY_SIZE + w)); +} + +/* check if we can open this one */ +int +patm_rx_vcc_can_open(struct patm_softc *sc, struct patm_vcc *vcc) +{ + return (0); +} + +/* + * open the VCC + */ +void +patm_rx_vcc_open(struct patm_softc *sc, struct patm_vcc *vcc) +{ + uint32_t w1 = IDT_RCT_OPEN; + + patm_debug(sc, VCC, "%u.%u RX opening", vcc->vcc.vpi, vcc->vcc.vci); + + switch (vcc->vcc.aal) { + case ATMIO_AAL_0: + w1 |= IDT_RCT_AAL0 | IDT_RCT_FBP2 | IDT_RCT_RCI; + break; + case ATMIO_AAL_34: + w1 |= IDT_RCT_AAL34; + break; + case ATMIO_AAL_5: + w1 |= IDT_RCT_AAL5; + break; + case ATMIO_AAL_RAW: + w1 |= IDT_RCT_AALRAW | IDT_RCT_RCI; + break; + } + + if (vcc->cid != 0) + rct_init(sc, vcc->cid, w1); + else { + /* switch the interface into promiscuous mode */ + patm_nor_write(sc, IDT_NOR_CFG, patm_nor_read(sc, IDT_NOR_CFG) | + IDT_CFG_ICAPT | IDT_CFG_VPECA); + } + + vcc->vflags |= PATM_VCC_RX_OPEN; +} + +/* close the given vcc for transmission */ +void +patm_rx_vcc_close(struct patm_softc *sc, struct patm_vcc *vcc) +{ + u_int w1; + + patm_debug(sc, VCC, "%u.%u RX closing", vcc->vcc.vpi, vcc->vcc.vci); + + if (vcc->cid == 0) { + /* switch off promiscuous mode */ + patm_nor_write(sc, IDT_NOR_CFG, patm_nor_read(sc, IDT_NOR_CFG) & + ~(IDT_CFG_ICAPT | IDT_CFG_VPECA)); + vcc->vflags &= ~PATM_VCC_RX_OPEN; + return; + } + + /* close the connection but keep state */ + w1 = rct_read(sc, vcc->cid, 0); + w1 &= ~IDT_RCT_OPEN; + rct_write(sc, vcc->cid, 0, w1); + + /* minimum idle count */ + w1 = (w1 & ~IDT_RCT_IACT_CNT_MASK) | (1 << IDT_RCT_IACT_CNT_SHIFT); + rct_write(sc, vcc->cid, 0, w1); + + /* initialize scan */ + patm_nor_write(sc, IDT_NOR_IRCP, vcc->cid); + + vcc->vflags &= ~PATM_VCC_RX_OPEN; + vcc->vflags |= PATM_VCC_RX_CLOSING; + + /* + * check the RSQ + * This is a hack. The problem is, that although an entry is written + * to the RSQ, no interrupt is generated. Also we must wait 1 cell + * time for the SAR to process the scan of our connection. + */ + DELAY(1); + patm_intr_rsq(sc); +} + +/* transmission side finally closed */ +void +patm_rx_vcc_closed(struct patm_softc *sc, struct patm_vcc *vcc) +{ + patm_debug(sc, VCC, "%u.%u RX finally closed", + vcc->vcc.vpi, vcc->vcc.vci); +} + +/* + * Handle the given receive status queue entry + */ +void +patm_rx(struct patm_softc *sc, struct idt_rsqe *rsqe) +{ + struct mbuf *m; + void *buf; + u_int stat, cid, w, cells, len, h; + struct patm_vcc *vcc; + struct atm_pseudohdr aph; + u_char *trail; + + cid = le32toh(rsqe->cid); + stat = le32toh(rsqe->stat); + h = le32toh(rsqe->handle); + + cid = PATM_CID(sc, IDT_RSQE_VPI(cid), IDT_RSQE_VCI(cid)); + vcc = sc->vccs[cid]; + + if (IDT_RSQE_TYPE(stat) == IDT_RSQE_IDLE) { + /* connection has gone idle */ + if (stat & IDT_RSQE_BUF) + patm_rcv_free(sc, patm_rcv_handle(sc, h), h); + + w = rct_read(sc, cid, 0); + if (w != 0 && !(w & IDT_RCT_OPEN)) + rct_write(sc, cid, 0, 0); + if (vcc != NULL && (vcc->vflags & PATM_VCC_RX_CLOSING)) { + patm_debug(sc, VCC, "%u.%u RX closed", vcc->vcc.vpi, + vcc->vcc.vci); + vcc->vflags &= ~PATM_VCC_RX_CLOSING; + if (vcc->vflags & PATM_VCC_ASYNC) { + patm_rx_vcc_closed(sc, vcc); + if (!(vcc->vflags & PATM_VCC_OPEN)) + patm_vcc_closed(sc, vcc); + } else + cv_signal(&sc->vcc_cv); + } + return; + } + + buf = patm_rcv_handle(sc, h); + + if (vcc == NULL || (vcc->vflags & PATM_VCC_RX_OPEN) == 0) { + patm_rcv_free(sc, buf, h); + return; + } + + cells = IDT_RSQE_CNT(stat); + KASSERT(cells > 0, ("zero cell count")); + + if (vcc->vcc.aal == ATMIO_AAL_0) { + /* deliver this packet as it is */ + if ((m = patm_rcv_mbuf(sc, buf, h, 1)) == NULL) + return; + + m->m_len = cells * 48; + m->m_pkthdr.len = m->m_len; + m->m_pkthdr.rcvif = &sc->ifatm.ifnet; + + } else if (vcc->vcc.aal == ATMIO_AAL_34) { + /* XXX AAL3/4 */ + patm_rcv_free(sc, buf, h); + return; + + } else if (vcc->vcc.aal == ATMIO_AAL_5) { + if (stat & IDT_RSQE_CRC) { + sc->ifatm.ifnet.if_ierrors++; + if (vcc->chain != NULL) { + m_freem(vcc->chain); + vcc->chain = vcc->last = NULL; + } + return; + } + + /* append to current chain */ + if (vcc->chain == NULL) { + if ((m = patm_rcv_mbuf(sc, buf, h, 1)) == NULL) + return; + m->m_len = cells * 48; + m->m_pkthdr.len = m->m_len; + m->m_pkthdr.rcvif = &sc->ifatm.ifnet; + vcc->chain = vcc->last = m; + } else { + if ((m = patm_rcv_mbuf(sc, buf, h, 0)) == NULL) + return; + m->m_len = cells * 48; + vcc->last->m_next = m; + vcc->last = m; + vcc->chain->m_pkthdr.len += m->m_len; + } + + if (!(stat & IDT_RSQE_EPDU)) + return; + + trail = mtod(m, u_char *) + m->m_len - 6; + len = (trail[0] << 8) + trail[1]; + + if ((u_int)vcc->chain->m_pkthdr.len < len + 8) { + patm_printf(sc, "%s: bad aal5 lengths %u %u\n", + __func__, (u_int)m->m_pkthdr.len, len); + m_freem(vcc->chain); + vcc->chain = vcc->last = NULL; + return; + } + m->m_len -= vcc->chain->m_pkthdr.len - len; + KASSERT(m->m_len >= 0, ("bad last mbuf")); + + m = vcc->chain; + vcc->chain = vcc->last = NULL; + m->m_pkthdr.len = len; + } else + panic("bad aal"); + +#if 0 + { + u_int i; + + for (i = 0; i < m->m_len; i++) { + printf("%02x ", mtod(m, u_char *)[i]); + } + printf("\n"); + } +#endif + + sc->ifatm.ifnet.if_ipackets++; + /* this is in if_atmsubr.c */ + /* sc->ifatm.ifnet.if_ibytes += m->m_pkthdr.len; */ + + vcc->ibytes += m->m_pkthdr.len; + vcc->ipackets++; + + ATM_PH_FLAGS(&aph) = vcc->vcc.flags & 0xff; + ATM_PH_VPI(&aph) = IDT_RSQE_VPI(cid); + ATM_PH_SETVCI(&aph, IDT_RSQE_VCI(cid)); + +#ifdef ENABLE_BPF + if (!(vcc->vcc.flags & ATMIO_FLAG_NG) && + (vcc->vcc.flags & ATM_PH_AAL5) && + (vcc->vcc.flags & ATM_PH_LLCSNAP)) + BPF_MTAP(&sc->ifatm.ifnet, m); +#endif + + atm_input(&sc->ifatm.ifnet, &aph, m, vcc->rxhand); +} + +/* + * Get the buffer for a receive handle. This is either an mbuf for + * a large handle or a pool buffer for the others. + */ +static void * +patm_rcv_handle(struct patm_softc *sc, u_int handle) +{ + void *buf; + u_int c; + + if ((handle & ~MBUF_HMASK) == LMBUF_HANDLE) { + struct lmbuf *b; + + c = handle & MBUF_HMASK; + b = &sc->lbufs[c]; + + buf = b->m; + b->m = NULL; + + bus_dmamap_sync(sc->lbuf_tag, b->map, BUS_DMASYNC_POSTREAD); + patm_lbuf_free(sc, b); + + } else if ((handle & ~MBUF_HMASK) == MBUF_VHANDLE) { + mbp_sync(sc->vbuf_pool, handle, + 0, VMBUF_SIZE, BUS_DMASYNC_POSTREAD); + buf = mbp_get(sc->vbuf_pool, handle); + + } else { + mbp_sync(sc->sbuf_pool, handle, + 0, SMBUF_SIZE, BUS_DMASYNC_POSTREAD); + buf = mbp_get(sc->sbuf_pool, handle); + } + + return (buf); +} + +/* + * Free a buffer. + */ +static void +patm_rcv_free(struct patm_softc *sc, void *p, u_int handle) +{ + if ((handle & ~MBUF_HMASK) == LMBUF_HANDLE) + m_free((struct mbuf *)p); + + else if ((handle & ~MBUF_HMASK) == MBUF_VHANDLE) + mbp_free(sc->vbuf_pool, p); + + else + mbp_free(sc->sbuf_pool, p); +} + +/* + * Make an mbuf around the buffer + */ +static struct mbuf * +patm_rcv_mbuf(struct patm_softc *sc, void *buf, u_int h, int hdr) +{ + struct mbuf *m; + + if ((h & ~MBUF_HMASK) == MBUF_LHANDLE) + return ((struct mbuf *)buf); + + if (hdr) + MGETHDR(m, M_DONTWAIT, MT_DATA); + else + MGET(m, M_DONTWAIT, MT_DATA); + if (m == NULL) { + patm_rcv_free(sc, buf, h); + return (NULL); + } + + if ((h & ~MBUF_HMASK) == MBUF_VHANDLE) { + m_extadd(m, (caddr_t)buf, VMBUF_SIZE, mbp_ext_free, + sc->vbuf_pool, M_PKTHDR, EXT_NET_DRV); + m->m_data += VMBUF_OFFSET; + } else { + m_extadd(m, (caddr_t)buf, SMBUF_SIZE, mbp_ext_free, + sc->sbuf_pool, M_PKTHDR, EXT_NET_DRV); + m->m_data += SMBUF_OFFSET; + } + + if (!(m->m_flags & M_EXT)) { + patm_rcv_free(sc, buf, h); + m_free(m); + return (NULL); + } + return (m); +} + +/* + * Process the raw cell at the given address. + */ +void +patm_rx_raw(struct patm_softc *sc, u_char *cell) +{ + u_int vpi, vci, cid; + struct patm_vcc *vcc; + struct mbuf *m; + u_char *dst; + struct timespec ts; + struct atm_pseudohdr aph; + uint64_t cts; + + sc->stats.raw_cells++; + + /* + * For some non-appearant reason the cell header + * is in the wrong endian. + */ + *(uint32_t *)cell = bswap32(*(uint32_t *)cell); + + vpi = ((cell[0] & 0xf) << 4) | ((cell[1] & 0xf0) >> 4); + vci = ((cell[1] & 0xf) << 12) | (cell[2] << 4) | ((cell[3] & 0xf0) >> 4); + cid = PATM_CID(sc, vpi, vci); + + vcc = sc->vccs[cid]; + if (vcc == NULL || !(vcc->vflags & PATM_VCC_RX_OPEN) || + vcc->vcc.aal != ATMIO_AAL_RAW) { + vcc = sc->vccs[0]; + if (vcc == NULL || !(vcc->vflags & PATM_VCC_RX_OPEN)) { + sc->stats.raw_no_vcc++; + return; + } + } + + MGETHDR(m, M_DONTWAIT, MT_DATA); + if (m == NULL) { + sc->stats.raw_no_buf++; + return; + } + m->m_pkthdr.rcvif = &sc->ifatm.ifnet; + + switch (vcc->vflags & PATM_RAW_FORMAT) { + + default: + case PATM_RAW_CELL: + m->m_len = m->m_pkthdr.len = 53; + MH_ALIGN(m, 53); + dst = mtod(m, u_char *); + *dst++ = *cell++; + *dst++ = *cell++; + *dst++ = *cell++; + *dst++ = *cell++; + *dst++ = 0; /* HEC */ + bcopy(cell + 12, dst, 48); + break; + + case PATM_RAW_NOHEC: + m->m_len = m->m_pkthdr.len = 52; + MH_ALIGN(m, 52); + dst = mtod(m, u_char *); + *dst++ = *cell++; + *dst++ = *cell++; + *dst++ = *cell++; + *dst++ = *cell++; + bcopy(cell + 12, dst, 48); + break; + + case PATM_RAW_CS: + m->m_len = m->m_pkthdr.len = 64; + MH_ALIGN(m, 64); + dst = mtod(m, u_char *); + *dst++ = *cell++; + *dst++ = *cell++; + *dst++ = *cell++; + *dst++ = *cell++; + *dst++ = 0; /* HEC */ + *dst++ = 0; /* flags */ + *dst++ = 0; /* reserved */ + *dst++ = 0; /* reserved */ + nanotime(&ts); + cts = ts.tv_sec * 1000000000ULL + ts.tv_nsec; + bcopy(dst, &cts, 8); + bcopy(cell + 12, dst + 8, 48); + break; + } + + sc->ifatm.ifnet.if_ipackets++; + /* this is in if_atmsubr.c */ + /* sc->ifatm.ifnet.if_ibytes += m->m_pkthdr.len; */ + + vcc->ibytes += m->m_pkthdr.len; + vcc->ipackets++; + + ATM_PH_FLAGS(&aph) = vcc->vcc.flags & 0xff; + ATM_PH_VPI(&aph) = vcc->vcc.vpi; + ATM_PH_SETVCI(&aph, vcc->vcc.vci); + + atm_input(&sc->ifatm.ifnet, &aph, m, vcc->rxhand); +} diff --git a/sys/dev/patm/if_patm_tx.c b/sys/dev/patm/if_patm_tx.c new file mode 100644 index 000000000000..0d460182233a --- /dev/null +++ b/sys/dev/patm/if_patm_tx.c @@ -0,0 +1,1273 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The TST allocation algorithm is from the IDT driver which is: + * + * Copyright (c) 2000, 2001 Richard Hodges and Matriplex, inc. + * All rights reserved. + * + * Copyright (c) 1996, 1997, 1998, 1999 Mark Tinguely + * All rights reserved. + * + * Author: Hartmut Brandt + * + * Driver for IDT77252 based cards like ProSum's. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_natm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#ifdef ENABLE_BPF +#include +#endif +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +static struct mbuf *patm_tx_pad(struct patm_softc *sc, struct mbuf *m0); +static void patm_launch(struct patm_softc *sc, struct patm_scd *scd); + +static struct patm_txmap *patm_txmap_get(struct patm_softc *); +static void patm_load_txbuf(void *, bus_dma_segment_t *, int, + bus_size_t, int); + +static void patm_tst_alloc(struct patm_softc *sc, struct patm_vcc *vcc); +static void patm_tst_free(struct patm_softc *sc, struct patm_vcc *vcc); +static void patm_tst_timer(void *p); +static void patm_tst_update(struct patm_softc *); + +static void patm_tct_start(struct patm_softc *sc, struct patm_vcc *); + +static const char *dump_scd(struct patm_softc *sc, struct patm_scd *scd) + __unused; +static void patm_tct_print(struct patm_softc *sc, u_int cid) __unused; + +/* + * Structure for communication with the loader function for transmission + */ +struct txarg { + struct patm_softc *sc; + struct patm_scd *scd; /* scheduling channel */ + struct patm_vcc *vcc; /* the VCC of this PDU */ + struct mbuf *mbuf; + u_int hdr; /* cell header */ +}; + +static __inline u_int +cbr2slots(struct patm_softc *sc, struct patm_vcc *vcc) +{ + /* compute the number of slots we need, make sure to get at least + * the specified PCR */ + return ((u_int)(((uint64_t)(sc->mmap->tst_size - 1) * + vcc->vcc.tparam.pcr + sc->ifatm.mib.pcr - 1) / sc->ifatm.mib.pcr)); +} + +static __inline u_int +slots2cr(struct patm_softc *sc, u_int slots) +{ + return ((slots * sc->ifatm.mib.pcr + sc->mmap->tst_size - 2) / + (sc->mmap->tst_size - 1)); +} + +/* check if we can open this one */ +int +patm_tx_vcc_can_open(struct patm_softc *sc, struct patm_vcc *vcc) +{ + + /* check resources */ + switch (vcc->vcc.traffic) { + + case ATMIO_TRAFFIC_CBR: + { + u_int slots = cbr2slots(sc, vcc); + + if (slots > sc->tst_free + sc->tst_reserve) + return (EINVAL); + break; + } + + case ATMIO_TRAFFIC_VBR: + if (vcc->vcc.tparam.scr > sc->bwrem) + return (EINVAL); + if (vcc->vcc.tparam.pcr > sc->ifatm.mib.pcr) + return (EINVAL); + if (vcc->vcc.tparam.scr > vcc->vcc.tparam.pcr || + vcc->vcc.tparam.mbs == 0) + return (EINVAL); + break; + + case ATMIO_TRAFFIC_ABR: + if (vcc->vcc.tparam.tbe == 0 || + vcc->vcc.tparam.nrm == 0) + /* needed to compute CRM */ + return (EINVAL); + if (vcc->vcc.tparam.pcr > sc->ifatm.mib.pcr || + vcc->vcc.tparam.icr > vcc->vcc.tparam.pcr || + vcc->vcc.tparam.mcr > vcc->vcc.tparam.icr) + return (EINVAL); + if (vcc->vcc.tparam.mcr > sc->bwrem || + vcc->vcc.tparam.icr > sc->bwrem) + return (EINVAL); + break; + } + + return (0); +} + +#define NEXT_TAG(T) do { \ + (T) = ((T) + 1) % IDT_TSQE_TAG_SPACE; \ + } while (0) + +/* + * open it + */ +void +patm_tx_vcc_open(struct patm_softc *sc, struct patm_vcc *vcc) +{ + struct patm_scd *scd; + + if (vcc->vcc.traffic == ATMIO_TRAFFIC_UBR) { + /* we use UBR0 */ + vcc->scd = sc->scd0; + vcc->vflags |= PATM_VCC_TX_OPEN; + return; + } + + /* get an SCD */ + scd = patm_scd_alloc(sc); + if (scd == NULL) { + /* should not happen */ + patm_printf(sc, "out of SCDs\n"); + return; + } + vcc->scd = scd; + patm_scd_setup(sc, scd); + patm_tct_setup(sc, scd, vcc); + + if (vcc->vcc.traffic != ATMIO_TRAFFIC_CBR) + patm_tct_start(sc, vcc); + + vcc->vflags |= PATM_VCC_TX_OPEN; +} + +/* + * close the given vcc for transmission + */ +void +patm_tx_vcc_close(struct patm_softc *sc, struct patm_vcc *vcc) +{ + struct patm_scd *scd; + struct mbuf *m; + + vcc->vflags |= PATM_VCC_TX_CLOSING; + + if (vcc->vcc.traffic == ATMIO_TRAFFIC_UBR) { + /* let the queue PDUs go out */ + vcc->scd = NULL; + vcc->vflags &= ~(PATM_VCC_TX_OPEN | PATM_VCC_TX_CLOSING); + return; + } + scd = vcc->scd; + + /* empty the waitq */ + for (;;) { + _IF_DEQUEUE(&scd->q, m); + if (m == NULL) + break; + m_freem(m); + } + + if (scd->num_on_card == 0) { + /* we are idle */ + vcc->vflags &= ~PATM_VCC_TX_OPEN; + + if (vcc->vcc.traffic == ATMIO_TRAFFIC_CBR) + patm_tst_free(sc, vcc); + + patm_sram_write4(sc, scd->sram + 0, 0, 0, 0, 0); + patm_sram_write4(sc, scd->sram + 4, 0, 0, 0, 0); + patm_scd_free(sc, scd); + + vcc->scd = NULL; + vcc->vflags &= ~PATM_VCC_TX_CLOSING; + + return; + } + + /* speed up transmission */ + patm_nor_write(sc, IDT_NOR_TCMDQ, IDT_TCMDQ_UIER(vcc->cid, 0xff)); + patm_nor_write(sc, IDT_NOR_TCMDQ, IDT_TCMDQ_ULACR(vcc->cid, 0xff)); + + /* wait for the interrupt to drop the number to 0 */ + patm_debug(sc, VCC, "%u buffers still on card", scd->num_on_card); +} + +/* transmission side finally closed */ +void +patm_tx_vcc_closed(struct patm_softc *sc, struct patm_vcc *vcc) +{ + + patm_debug(sc, VCC, "%u.%u TX closed", vcc->vcc.vpi, vcc->vcc.vci); + + if (vcc->vcc.traffic == ATMIO_TRAFFIC_VBR) + sc->bwrem += vcc->vcc.tparam.scr; +} + +/* + * Pull off packets from the interface queue and try to transmit them. + * If the transmission fails because of a full transmit channel, we drop + * packets for CBR and queue them for other channels up to limit. + * This limit should depend on the CDVT for VBR and ABR, but it doesn't. + */ +void +patm_start(struct ifnet *ifp) +{ + struct patm_softc *sc = (struct patm_softc *)ifp->if_softc; + struct mbuf *m; + struct atm_pseudohdr *aph; + u_int vpi, vci, cid; + struct patm_vcc *vcc; + + mtx_lock(&sc->mtx); + if (!(ifp->if_flags & IFF_RUNNING)) { + mtx_unlock(&sc->mtx); + return; + } + + while (1) { + /* get a new mbuf */ + IF_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + + /* split of pseudo header */ + if (m->m_len < sizeof(*aph) && + (m = m_pullup(m, sizeof(*aph))) == NULL) { + sc->ifatm.ifnet.if_oerrors++; + continue; + } + + aph = mtod(m, struct atm_pseudohdr *); + vci = ATM_PH_VCI(aph); + vpi = ATM_PH_VPI(aph); + m_adj(m, sizeof(*aph)); + + /* reject empty packets */ + if (m->m_pkthdr.len == 0) { + m_freem(m); + sc->ifatm.ifnet.if_oerrors++; + continue; + } + + /* check whether this is a legal vcc */ + if (!LEGAL_VPI(sc, vpi) || !LEGAL_VCI(sc, vci) || vci == 0) { + m_freem(m); + sc->ifatm.ifnet.if_oerrors++; + continue; + } + cid = PATM_CID(sc, vpi, vci); + vcc = sc->vccs[cid]; + if (vcc == NULL) { + m_freem(m); + sc->ifatm.ifnet.if_oerrors++; + continue; + } + + /* must be multiple of 48 if not AAL5 */ + if (vcc->vcc.aal == ATMIO_AAL_0 || + vcc->vcc.aal == ATMIO_AAL_34) { + /* XXX AAL3/4 format? */ + if (m->m_pkthdr.len % 48 != 0 && + (m = patm_tx_pad(sc, m)) == NULL) { + sc->ifatm.ifnet.if_oerrors++; + continue; + } + } else if (vcc->vcc.aal == ATMIO_AAL_RAW) { + switch (vcc->vflags & PATM_RAW_FORMAT) { + + default: + case PATM_RAW_CELL: + if (m->m_pkthdr.len != 53) { + sc->ifatm.ifnet.if_oerrors++; + m_freem(m); + continue; + } + break; + + case PATM_RAW_NOHEC: + if (m->m_pkthdr.len != 52) { + sc->ifatm.ifnet.if_oerrors++; + m_freem(m); + continue; + } + break; + + case PATM_RAW_CS: + if (m->m_pkthdr.len != 64) { + sc->ifatm.ifnet.if_oerrors++; + m_freem(m); + continue; + } + break; + } + } + + /* save data */ + m->m_pkthdr.header = vcc; + + /* try to put it on the channels queue */ + if (_IF_QFULL(&vcc->scd->q)) { + sc->ifatm.ifnet.if_oerrors++; + sc->stats.tx_qfull++; + m_freem(m); + continue; + } + _IF_ENQUEUE(&vcc->scd->q, m); + +#ifdef ENABLE_BPF + if (!(vcc->vcc.flags & ATMIO_FLAG_NG) && + (vcc->vcc.flags & ATM_PH_AAL5) && + (vcc->vcc.flags & ATM_PH_LLCSNAP)) + BPF_MTAP(ifp, m); +#endif + + /* kick the channel to life */ + patm_launch(sc, vcc->scd); + + } + mtx_unlock(&sc->mtx); +} + +/* + * Pad non-AAL5 packet to a multiple of 48-byte. + * We assume AAL0 only. We have still to decide on the format of AAL3/4. + */ +static struct mbuf * +patm_tx_pad(struct patm_softc *sc, struct mbuf *m0) +{ + struct mbuf *last, *m; + u_int plen, pad, space; + + plen = m_length(m0, &last); + if (plen != m0->m_pkthdr.len) { + patm_printf(sc, "%s: mbuf length mismatch %d %u\n", __func__, + m0->m_pkthdr.len, plen); + m0->m_pkthdr.len = plen; + if (plen == 0) { + m_freem(m0); + sc->ifatm.ifnet.if_oerrors++; + return (NULL); + } + if (plen % 48 == 0) + return (m0); + } + pad = 48 - plen % 48; + if (M_WRITABLE(last)) { + if (M_TRAILINGSPACE(last) >= pad) { + bzero(last->m_data + last->m_len, pad); + last->m_len += pad; + return (m0); + } + space = M_LEADINGSPACE(last); + if (space + M_TRAILINGSPACE(last) >= pad) { + bcopy(last->m_data, last->m_data + space, last->m_len); + last->m_data -= space; + bzero(last->m_data + last->m_len, pad); + last->m_len += pad; + return (m0); + } + } + MGET(m, M_DONTWAIT, MT_DATA); + if (m == 0) { + m_freem(m0); + sc->ifatm.ifnet.if_oerrors++; + return (NULL); + } + bzero(mtod(m, u_char *), pad); + m->m_len = pad; + last->m_next = m; + + return (m0); +} + +/* + * Try to put as many packets from the channels queue onto the channel + */ +static void +patm_launch(struct patm_softc *sc, struct patm_scd *scd) +{ + struct txarg a; + struct mbuf *m, *tmp; + u_int segs; + struct patm_txmap *map; + int error; + + a.sc = sc; + a.scd = scd; + + /* limit the number of outstanding packets to the tag space */ + while (scd->num_on_card < IDT_TSQE_TAG_SPACE) { + /* get the next packet */ + _IF_DEQUEUE(&scd->q, m); + if (m == NULL) + break; + + a.vcc = m->m_pkthdr.header; + + /* we must know the number of segments beforehand - count + * this may actually give a wrong number of segments for + * AAL_RAW where we still need to remove the cell header */ + segs = 0; + for (tmp = m; tmp != NULL; tmp = tmp->m_next) + if (tmp->m_len != 0) + segs++; + + /* check whether there is space in the queue */ + if (segs >= scd->space) { + /* put back */ + _IF_PREPEND(&scd->q, m); + sc->stats.tx_out_of_tbds++; + break; + } + + /* get a DMA map */ + if ((map = patm_txmap_get(sc)) == NULL) { + _IF_PREPEND(&scd->q, m); + sc->stats.tx_out_of_maps++; + break; + } + + /* load the map */ + m->m_pkthdr.header = map; + a.mbuf = m; + + /* handle AAL_RAW */ + if (a.vcc->vcc.aal == ATMIO_AAL_RAW) { + u_char hdr[4]; + + m_copydata(m, 0, 4, hdr); + a.hdr = (hdr[0] << 24) | (hdr[1] << 16) | + (hdr[2] << 8) | hdr[3]; + + switch (a.vcc->vflags & PATM_RAW_FORMAT) { + + default: + case PATM_RAW_CELL: + m_adj(m, 5); + break; + + case PATM_RAW_NOHEC: + m_adj(m, 4); + break; + + case PATM_RAW_CS: + m_adj(m, 16); + break; + } + } else + a.hdr = IDT_TBD_HDR(a.vcc->vcc.vpi, a.vcc->vcc.vci, + 0, 0); + + error = bus_dmamap_load_mbuf(sc->tx_tag, map->map, m, + patm_load_txbuf, &a, BUS_DMA_NOWAIT); + if (error == EFBIG) { + if ((m = m_defrag(m, M_DONTWAIT)) == NULL) { + sc->ifatm.ifnet.if_oerrors++; + continue; + } + error = bus_dmamap_load_mbuf(sc->tx_tag, map->map, m, + patm_load_txbuf, &a, BUS_DMA_NOWAIT); + } + if (error != 0) { + sc->stats.tx_load_err++; + sc->ifatm.ifnet.if_oerrors++; + SLIST_INSERT_HEAD(&sc->tx_maps_free, map, link); + m_freem(m); + continue; + } + + sc->ifatm.ifnet.if_opackets++; + } +} + +/* + * Load the DMA segments into the scheduling channel + */ +static void +patm_load_txbuf(void *uarg, bus_dma_segment_t *segs, int nseg, + bus_size_t mapsize, int error) +{ + struct txarg *a= uarg; + struct patm_scd *scd = a->scd; + u_int w1, w3, cnt; + struct idt_tbd *tbd = NULL; + u_int rest = mapsize; + + if (error != 0) + return; + + cnt = 0; + while (nseg > 0) { + if (segs->ds_len == 0) { + /* transmit buffer length must be > 0 */ + nseg--; + segs++; + continue; + } + /* rest after this buffer */ + rest -= segs->ds_len; + + /* put together status word */ + w1 = 0; + if (rest < 48 /* && a->vcc->vcc.aal != ATMIO_AAL_5 */) + /* last cell is in this buffer */ + w1 |= IDT_TBD_EPDU; + + if (a->vcc->vcc.aal == ATMIO_AAL_5) + w1 |= IDT_TBD_AAL5; + else if (a->vcc->vcc.aal == ATMIO_AAL_34) + w1 |= IDT_TBD_AAL34; + else + w1 |= IDT_TBD_AAL0; + + w1 |= segs->ds_len; + + /* AAL5 PDU length (unpadded) */ + if (a->vcc->vcc.aal == ATMIO_AAL_5) + w3 = mapsize; + else + w3 = 0; + + if (rest == 0) + w1 |= IDT_TBD_TSIF | IDT_TBD_GTSI | + (scd->tag << IDT_TBD_TAG_SHIFT); + + tbd = &scd->scq[scd->tail]; + + tbd->flags = htole32(w1); + tbd->addr = htole32(segs->ds_addr); + tbd->aal5 = htole32(w3); + tbd->hdr = htole32(a->hdr); + + patm_debug(a->sc, TX, "TBD(%u): %08x %08x %08x %08x", + scd->tail, w1, segs->ds_addr, w3, a->hdr); + + /* got to next entry */ + if (++scd->tail == IDT_SCQ_SIZE) + scd->tail = 0; + cnt++; + nseg--; + segs++; + } + scd->space -= cnt; + scd->num_on_card++; + + KASSERT(rest == 0, ("bad mbuf")); + KASSERT(cnt > 0, ("no segs")); + KASSERT(scd->space > 0, ("scq full")); + + KASSERT(scd->on_card[scd->tag] == NULL, + ("scd on_card wedged %u%s", scd->tag, dump_scd(a->sc, scd))); + scd->on_card[scd->tag] = a->mbuf; + a->mbuf->m_pkthdr.csum_data = cnt; + + NEXT_TAG(scd->tag); + + patm_debug(a->sc, TX, "SCD tail %u (%lx:%lx)", scd->tail, + (u_long)scd->phy, (u_long)scd->phy + (scd->tail << IDT_TBD_SHIFT)); + patm_sram_write(a->sc, scd->sram, + scd->phy + (scd->tail << IDT_TBD_SHIFT)); + + if (patm_sram_read(a->sc, a->vcc->cid * 8 + 3) & IDT_TCT_IDLE) { + /* + * if the connection is idle start it. We cannot rely + * on a flag set by patm_tx_idle() here, because sometimes + * the card seems to place an idle TSI into the TSQ but + * forgets to raise an interrupt. + */ + patm_nor_write(a->sc, IDT_NOR_TCMDQ, + IDT_TCMDQ_START(a->vcc->cid)); + } +} + +/* + * packet transmitted + */ +void +patm_tx(struct patm_softc *sc, u_int stamp, u_int status) +{ + u_int cid, tag, last; + struct mbuf *m; + struct patm_vcc *vcc; + struct patm_scd *scd; + struct patm_txmap *map; + + /* get the connection */ + cid = PATM_CID(sc, IDT_TBD_VPI(status), IDT_TBD_VCI(status)); + if ((vcc = sc->vccs[cid]) == NULL) { + /* closed UBR connection */ + return; + } + scd = vcc->scd; + + tag = IDT_TSQE_TAG(stamp); + + last = scd->last_tag; + if (tag == last) { + patm_printf(sc, "same tag %u\n", tag); + return; + } + + /* Errata 12 requests us to free all entries up to the one + * with the given tag. */ + do { + /* next tag to try */ + NEXT_TAG(last); + + m = scd->on_card[last]; + KASSERT(m != NULL, ("%stag=%u", dump_scd(sc, scd), tag)); + scd->on_card[last] = NULL; + patm_debug(sc, TX, "ok tag=%x", last); + + map = m->m_pkthdr.header; + scd->space += m->m_pkthdr.csum_data; + + bus_dmamap_sync(sc->tx_tag, map->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->tx_tag, map->map); + m_freem(m); + SLIST_INSERT_HEAD(&sc->tx_maps_free, map, link); + scd->num_on_card--; + + if (vcc->vflags & PATM_VCC_TX_CLOSING) { + if (scd->num_on_card == 0) { + /* done with this VCC */ + if (vcc->vcc.traffic == ATMIO_TRAFFIC_CBR) + patm_tst_free(sc, vcc); + + patm_sram_write4(sc, scd->sram + 0, 0, 0, 0, 0); + patm_sram_write4(sc, scd->sram + 4, 0, 0, 0, 0); + patm_scd_free(sc, scd); + + vcc->scd = NULL; + vcc->vflags &= ~PATM_VCC_TX_CLOSING; + + if (vcc->vflags & PATM_VCC_ASYNC) { + patm_tx_vcc_closed(sc, vcc); + if (!(vcc->vflags & PATM_VCC_OPEN)) + patm_vcc_closed(sc, vcc); + } else + cv_signal(&sc->vcc_cv); + return; + } + patm_debug(sc, VCC, "%u buffers still on card", + scd->num_on_card); + + if (vcc->vcc.traffic == ATMIO_TRAFFIC_ABR) { + /* insist on speeding up transmission for ABR */ + patm_nor_write(sc, IDT_NOR_TCMDQ, + IDT_TCMDQ_UIER(vcc->cid, 0xff)); + patm_nor_write(sc, IDT_NOR_TCMDQ, + IDT_TCMDQ_ULACR(vcc->cid, 0xff)); + } + } + + } while (last != tag); + scd->last_tag = tag; + + if (vcc->vcc.traffic == ATMIO_TRAFFIC_ABR) { + u_int acri, cps; + + acri = (patm_sram_read(sc, 8 * cid + 2) >> IDT_TCT_ACRI_SHIFT) + & 0x3fff; + cps = sc->ifatm.mib.pcr * 32 / + ((1 << (acri >> 10)) * (acri & 0x3ff)); + + if (cps != vcc->cps) { + /* send message */ + patm_debug(sc, VCC, "ACRI=%04x CPS=%u", acri, cps); + vcc->cps = cps; + } + } + + patm_launch(sc, scd); +} + +/* + * VBR/ABR connection went idle + * Either restart it or set the idle flag. + */ +void +patm_tx_idle(struct patm_softc *sc, u_int cid) +{ + struct patm_vcc *vcc; + + patm_debug(sc, VCC, "idle %u", cid); + + if ((vcc = sc->vccs[cid]) != NULL && + (vcc->vflags & (PATM_VCC_TX_OPEN | PATM_VCC_TX_CLOSING)) != 0 && + vcc->scd != NULL && (vcc->scd->num_on_card != 0 || + _IF_QLEN(&vcc->scd->q) != 0)) { + /* + * If there is any packet outstanding in the SCD re-activate + * the channel and kick it. + */ + patm_nor_write(sc, IDT_NOR_TCMDQ, + IDT_TCMDQ_START(vcc->cid)); + + patm_launch(sc, vcc->scd); + } +} + +/* + * Convert a (24bit) rate to the atm-forum form + * Our rate is never larger than 19 bit. + */ +static u_int +cps2atmf(u_int cps) +{ + u_int e; + + if (cps == 0) + return (0); + cps <<= 9; + e = 0; + while (cps > (1024 - 1)) { + e++; + cps >>= 1; + } + return ((1 << 14) | (e << 9) | (cps & 0x1ff)); +} + +/* + * Do a binary search on the log2rate table to convert the rate + * to its log form. This assumes that the ATM-Forum form is monotonically + * increasing with the plain cell rate. + */ +static u_int +rate2log(struct patm_softc *sc, u_int rate) +{ + const uint32_t *tbl; + u_int lower, upper, mid, done, val, afr; + + afr = cps2atmf(rate); + + if (sc->flags & PATM_25M) + tbl = patm_rtables25; + else + tbl = patm_rtables155; + + lower = 0; + upper = 255; + done = 0; + while (!done) { + mid = (lower + upper) / 2; + val = tbl[mid] >> 17; + if (val == afr || upper == lower) + break; + if (afr > val) + lower = mid + 1; + else + upper = mid - 1; + } + if (val > afr && mid > 0) + mid--; + return (mid); +} + +/* + * Return the table index for an increase table. The increase table + * must be selected not by the RIF itself, but by PCR/2^RIF. Each table + * represents an additive increase of a cell rate that can be computed + * from the first table entry (the value in this entry will not be clamped + * by the link rate). + */ +static u_int +get_air_table(struct patm_softc *sc, u_int rif, u_int pcr) +{ + const uint32_t *tbl; + u_int increase, base, lair0, ret, t, cps; + +#define GET_ENTRY(TAB, IDX) (0xffff & ((IDX & 1) ? \ + (tbl[512 + (IDX / 2) + 128 * (TAB)] >> 16) : \ + (tbl[512 + (IDX / 2) + 128 * (TAB)]))) + +#define MANT_BITS 10 +#define FRAC_BITS 16 + +#define DIFF_TO_FP(D) (((D) & ((1 << MANT_BITS) - 1)) << ((D) >> MANT_BITS)) +#define AFR_TO_INT(A) ((1 << (((A) >> 9) & 0x1f)) * \ + (512 + ((A) & 0x1ff)) / 512 * ((A) >> 14)) + + if (sc->flags & PATM_25M) + tbl = patm_rtables25; + else + tbl = patm_rtables155; + if (rif >= patm_rtables_ntab) + rif = patm_rtables_ntab - 1; + increase = pcr >> rif; + + ret = 0; + for (t = 0; t < patm_rtables_ntab; t++) { + /* get base rate of this table */ + base = GET_ENTRY(t, 0); + /* convert this to fixed point */ + lair0 = DIFF_TO_FP(base) >> FRAC_BITS; + + /* get the CPS from the log2rate table */ + cps = AFR_TO_INT(tbl[lair0] >> 17) - 10; + + if (increase >= cps) + break; + + ret = t; + } + return (ret + 4); +} + +/* + * Setup the TCT + */ +void +patm_tct_setup(struct patm_softc *sc, struct patm_scd *scd, + struct patm_vcc *vcc) +{ + uint32_t tct[8]; + u_int sram; + u_int mbs, token; + u_int tmp, crm, rdf, cdf, air, mcr; + + bzero(tct, sizeof(tct)); + if (vcc == NULL) { + /* special case for UBR0 */ + sram = 0; + tct[0] = IDT_TCT_UBR | scd->sram; + tct[7] = IDT_TCT_UBR_FLG; + + } else { + sram = vcc->cid * 8; + switch (vcc->vcc.traffic) { + + case ATMIO_TRAFFIC_CBR: + patm_tst_alloc(sc, vcc); + tct[0] = IDT_TCT_CBR | scd->sram; + /* must account for what was really allocated */ + break; + + case ATMIO_TRAFFIC_VBR: + /* compute parameters for the TCT */ + scd->init_er = rate2log(sc, vcc->vcc.tparam.pcr); + scd->lacr = rate2log(sc, vcc->vcc.tparam.scr); + + /* get the 16-bit fraction of SCR/PCR + * both a 24 bit. Do it the simple way. */ + token = (uint64_t)(vcc->vcc.tparam.scr << 16) / + vcc->vcc.tparam.pcr; + + patm_debug(sc, VCC, "VBR: init_er=%u lacr=%u " + "token=0x%04x\n", scd->init_er, scd->lacr, token); + + tct[0] = IDT_TCT_VBR | scd->sram; + tct[2] = IDT_TCT_TSIF; + tct[3] = IDT_TCT_IDLE | IDT_TCT_HALT; + tct[4] = IDT_TCT_MAXIDLE; + tct[5] = 0x01000000; + if ((mbs = vcc->vcc.tparam.mbs) > 0xff) + mbs = 0xff; + tct[6] = (mbs << 16) | token; + sc->bwrem -= vcc->vcc.tparam.scr; + break; + + case ATMIO_TRAFFIC_ABR: + scd->init_er = rate2log(sc, vcc->vcc.tparam.pcr); + scd->lacr = rate2log(sc, vcc->vcc.tparam.icr); + mcr = rate2log(sc, vcc->vcc.tparam.mcr); + + /* compute CRM */ + tmp = vcc->vcc.tparam.tbe / vcc->vcc.tparam.nrm; + if (tmp * vcc->vcc.tparam.nrm < vcc->vcc.tparam.tbe) + tmp++; + for (crm = 1; tmp > (1 << crm); crm++) + ; + if (crm > 0x7) + crm = 7; + + air = get_air_table(sc, vcc->vcc.tparam.rif, + vcc->vcc.tparam.pcr); + + if ((rdf = vcc->vcc.tparam.rdf) >= patm_rtables_ntab) + rdf = patm_rtables_ntab - 1; + rdf += patm_rtables_ntab + 4; + + if ((cdf = vcc->vcc.tparam.cdf) >= patm_rtables_ntab) + cdf = patm_rtables_ntab - 1; + cdf += patm_rtables_ntab + 4; + + patm_debug(sc, VCC, "ABR: init_er=%u lacr=%u mcr=%u " + "crm=%u air=%u rdf=%u cdf=%u\n", scd->init_er, + scd->lacr, mcr, crm, air, rdf, cdf); + + tct[0] = IDT_TCT_ABR | scd->sram; + tct[1] = crm << IDT_TCT_CRM_SHIFT; + tct[3] = IDT_TCT_HALT | IDT_TCT_IDLE | + (4 << IDT_TCT_NAGE_SHIFT); + tct[4] = mcr << IDT_TCT_LMCR_SHIFT; + tct[5] = (cdf << IDT_TCT_CDF_SHIFT) | + (rdf << IDT_TCT_RDF_SHIFT) | + (air << IDT_TCT_AIR_SHIFT); + + sc->bwrem -= vcc->vcc.tparam.mcr; + break; + } + } + + patm_sram_write4(sc, sram + 0, tct[0], tct[1], tct[2], tct[3]); + patm_sram_write4(sc, sram + 4, tct[4], tct[5], tct[6], tct[7]); + + patm_debug(sc, VCC, "TCT[%u]: %08x %08x %08x %08x %08x %08x %08x %08x", + sram / 8, patm_sram_read(sc, sram + 0), + patm_sram_read(sc, sram + 1), patm_sram_read(sc, sram + 2), + patm_sram_read(sc, sram + 3), patm_sram_read(sc, sram + 4), + patm_sram_read(sc, sram + 5), patm_sram_read(sc, sram + 6), + patm_sram_read(sc, sram + 7)); +} + +/* + * Start a channel + */ +static void +patm_tct_start(struct patm_softc *sc, struct patm_vcc *vcc) +{ + + patm_nor_write(sc, IDT_NOR_TCMDQ, IDT_TCMDQ_UIER(vcc->cid, + vcc->scd->init_er)); + patm_nor_write(sc, IDT_NOR_TCMDQ, IDT_TCMDQ_SLACR(vcc->cid, + vcc->scd->lacr)); +} + +static void +patm_tct_print(struct patm_softc *sc, u_int cid) +{ +#ifdef PATM_DEBUG + u_int sram = cid * 8; +#endif + + patm_debug(sc, VCC, "TCT[%u]: %08x %08x %08x %08x %08x %08x %08x %08x", + sram / 8, patm_sram_read(sc, sram + 0), + patm_sram_read(sc, sram + 1), patm_sram_read(sc, sram + 2), + patm_sram_read(sc, sram + 3), patm_sram_read(sc, sram + 4), + patm_sram_read(sc, sram + 5), patm_sram_read(sc, sram + 6), + patm_sram_read(sc, sram + 7)); +} + +/* + * Setup the SCD + */ +void +patm_scd_setup(struct patm_softc *sc, struct patm_scd *scd) +{ + patm_sram_write4(sc, scd->sram + 0, + scd->phy, 0, 0xffffffff, 0); + patm_sram_write4(sc, scd->sram + 4, + 0, 0, 0, 0); + + patm_debug(sc, VCC, "SCD(%x): %08x %08x %08x %08x %08x %08x %08x %08x", + scd->sram, + patm_sram_read(sc, scd->sram + 0), + patm_sram_read(sc, scd->sram + 1), + patm_sram_read(sc, scd->sram + 2), + patm_sram_read(sc, scd->sram + 3), + patm_sram_read(sc, scd->sram + 4), + patm_sram_read(sc, scd->sram + 5), + patm_sram_read(sc, scd->sram + 6), + patm_sram_read(sc, scd->sram + 7)); +} + +/* + * Grow the TX map table if possible + */ +static void +patm_txmaps_grow(struct patm_softc *sc) +{ + u_int i; + struct patm_txmap *map; + int err; + + if (sc->tx_nmaps >= sc->tx_maxmaps) + return; + + for (i = sc->tx_nmaps; i < sc->tx_nmaps + PATM_CFG_TXMAPS_STEP; i++) { + map = uma_zalloc(sc->tx_mapzone, M_NOWAIT); + err = bus_dmamap_create(sc->tx_tag, 0, &map->map); + if (err) { + uma_zfree(sc->tx_mapzone, map); + break; + } + SLIST_INSERT_HEAD(&sc->tx_maps_free, map, link); + } + + sc->tx_nmaps = i; +} + +/* + * Allocate a transmission map + */ +static struct patm_txmap * +patm_txmap_get(struct patm_softc *sc) +{ + struct patm_txmap *map; + + if ((map = SLIST_FIRST(&sc->tx_maps_free)) == NULL) { + patm_txmaps_grow(sc); + if ((map = SLIST_FIRST(&sc->tx_maps_free)) == NULL) + return (NULL); + } + SLIST_REMOVE_HEAD(&sc->tx_maps_free, link); + return (map); +} + +/* + * Look whether we are in the process of updating the TST on the chip. + * If we are set the flag that we need another update. + * If we are not start the update. + */ +static __inline void +patm_tst_start(struct patm_softc *sc) +{ + + if (!(sc->tst_state & TST_PENDING)) { + sc->tst_state |= TST_PENDING; + if (!(sc->tst_state & TST_WAIT)) { + /* timer not running */ + patm_tst_update(sc); + } + } +} + +/* + * Allocate TST entries to a CBR connection + */ +static void +patm_tst_alloc(struct patm_softc *sc, struct patm_vcc *vcc) +{ + u_int slots; + u_int qptr, pptr; + u_int qmax, pmax; + u_int pspc, last; + + mtx_lock(&sc->tst_lock); + + /* compute the number of slots we need, make sure to get at least + * the specified PCR */ + slots = cbr2slots(sc, vcc); + vcc->scd->slots = slots; + sc->bwrem -= slots2cr(sc, slots); + + patm_debug(sc, TST, "tst_alloc: cbr=%u link=%u tst=%u slots=%u", + vcc->vcc.tparam.pcr, sc->ifatm.mib.pcr, sc->mmap->tst_size, slots); + + qmax = sc->mmap->tst_size - 1; + pmax = qmax << 8; + + pspc = pmax / slots; + + pptr = pspc >> 1; /* starting point */ + qptr = pptr >> 8; + + last = qptr; + + while (slots > 0) { + if (qptr >= qmax) + qptr -= qmax; + if (sc->tst_soft[qptr] != IDT_TST_VBR) { + /* used - try next */ + qptr++; + continue; + } + patm_debug(sc, TST, "slot[%u] = %u.%u diff=%d", qptr, + vcc->vcc.vpi, vcc->vcc.vci, (int)qptr - (int)last); + last = qptr; + + sc->tst_soft[qptr] = IDT_TST_CBR | vcc->cid | TST_BOTH; + sc->tst_free--; + + if ((pptr += pspc) >= pmax) + pptr -= pmax; + qptr = pptr >> 8; + + slots--; + } + patm_tst_start(sc); + mtx_unlock(&sc->tst_lock); +} + +/* + * Free a CBR connection's TST entries + */ +static void +patm_tst_free(struct patm_softc *sc, struct patm_vcc *vcc) +{ + u_int i; + + mtx_lock(&sc->tst_lock); + for (i = 0; i < sc->mmap->tst_size - 1; i++) { + if ((sc->tst_soft[i] & IDT_TST_MASK) == vcc->cid) { + sc->tst_soft[i] = IDT_TST_VBR | TST_BOTH; + sc->tst_free++; + } + } + sc->bwrem += slots2cr(sc, vcc->scd->slots); + patm_tst_start(sc); + mtx_unlock(&sc->tst_lock); +} + +/* + * Write the soft TST into the idle incore TST and start the wait timer. + * We assume that we hold the tst lock. + */ +static void +patm_tst_update(struct patm_softc *sc) +{ + u_int flag; /* flag to clear from soft TST */ + u_int idle; /* the idle TST */ + u_int act; /* the active TST */ + u_int i; + + if (sc->tst_state & TST_ACT1) { + act = 1; + idle = 0; + flag = TST_CH0; + } else { + act = 0; + idle = 1; + flag = TST_CH1; + } + /* update the idle one */ + for (i = 0; i < sc->mmap->tst_size - 1; i++) + if (sc->tst_soft[i] & flag) { + patm_sram_write(sc, sc->tst_base[idle] + i, + sc->tst_soft[i] & ~TST_BOTH); + sc->tst_soft[i] &= ~flag; + } + /* the used one jump to the idle one */ + patm_sram_write(sc, sc->tst_jump[act], + IDT_TST_BR | (sc->tst_base[idle] << 2)); + + /* wait for the chip to jump */ + sc->tst_state &= ~TST_PENDING; + sc->tst_state |= TST_WAIT; + + callout_reset(&sc->tst_callout, 1, patm_tst_timer, sc); +} + +/* + * Timer for TST updates + */ +static void +patm_tst_timer(void *p) +{ + struct patm_softc *sc = p; + u_int act; /* active TST */ + u_int now; /* current place in TST */ + + mtx_lock(&sc->tst_lock); + + if (sc->tst_state & TST_WAIT) { + /* ignore the PENDING state while we are waiting for + * the chip to switch tables. Once the switch is done, + * we will again lock at PENDING */ + act = (sc->tst_state & TST_ACT1) ? 1 : 0; + now = patm_nor_read(sc, IDT_NOR_NOW) >> 2; + if (now >= sc->tst_base[act] && now <= sc->tst_jump[act]) { + /* not yet */ + callout_reset(&sc->tst_callout, 1, patm_tst_timer, sc); + goto done; + } + sc->tst_state &= ~TST_WAIT; + /* change back jump */ + patm_sram_write(sc, sc->tst_jump[act], + IDT_TST_BR | (sc->tst_base[act] << 2)); + + /* switch */ + sc->tst_state ^= TST_ACT1; + } + + if (sc->tst_state & TST_PENDING) + /* we got another update request while the timer was running. */ + patm_tst_update(sc); + + done: + mtx_unlock(&sc->tst_lock); +} + +static const char * +dump_scd(struct patm_softc *sc, struct patm_scd *scd) +{ + u_int i; + + for (i = 0; i < IDT_TSQE_TAG_SPACE; i++) + printf("on_card[%u] = %p\n", i, scd->on_card[i]); + printf("space=%u tag=%u num_on_card=%u last_tag=%u\n", + scd->space, scd->tag, scd->num_on_card, scd->last_tag); + + return (""); +} diff --git a/sys/dev/patm/if_patmvar.h b/sys/dev/patm/if_patmvar.h new file mode 100644 index 000000000000..c14699007dfd --- /dev/null +++ b/sys/dev/patm/if_patmvar.h @@ -0,0 +1,517 @@ +/* + * Copyright (c) 2003 + * Fraunhofer Institute for Open Communication Systems (FhG Fokus). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Hartmut Brandt + * + * $FreeBSD$ + * + * Driver for IDT77252 (ABR) based cards like ProSum's. + */ + +/* legal values are 0, 1, 2 and 8 */ +#define PATM_VPI_BITS 2 +#define PATM_CFG_VPI IDT_CFG_VP2 + +/* receive status queue size */ +#define PATM_RSQ_SIZE 512 +#define PATM_CFQ_RSQ_SIZE IDT_CFG_RXQ512 + +/* alignment for SQ memory */ +#define PATM_SQ_ALIGNMENT 8192 + +#define PATM_PROATM_NAME_OFFSET 060 +#define PATM_PROATM_NAME "PROATM" +#define PATM_PROATM_MAC_OFFSET 044 +#define PATM_IDT_MAC_OFFSET 0154 + +/* maximum number of packets on UBR queue */ +#define PATM_DLFT_MAXQ 1000 + +/* maximum number of packets on other queues. This should depend on the + * traffic contract. */ +#define PATM_TX_IFQLEN 100 + +/* + * Maximum number of DMA maps we allocate. This is the minimum that can be + * set larger via a sysctl. + * Starting number of DMA maps. + * Step for growing. + */ +#define PATM_CFG_TXMAPS_MAX 1024 +#define PATM_CFG_TXMAPS_INIT 128 +#define PATM_CFG_TXMAPS_STEP 128 + +/* percents of TST slots to keep for non-CBR traffic */ +#define PATM_TST_RESERVE 2 + +/* + * Structure to hold TX DMA maps + */ +struct patm_txmap { + SLIST_ENTRY(patm_txmap) link; + bus_dmamap_t map; +}; + +/* + * Receive buffers. + * + * We manage our own external mbufs for small receive buffers for two reasons: + * the card may consume a rather large number of buffers. Mapping each buffer + * would consume a lot of iospace on sparc64. Also the card allows us to set + * a 32-bit handle for identification of the buffers. On a 64-bit system this + * requires us to use a mapping between buffers and handles. + * + * For large buffers we use mbuf clusters directly. We track these by using + * an array of pointers (lbufs) to special structs and a free list of these + * structs. + * + * For AAL0 cell we use FBQ2 and make the 1 cell long. + */ +/* + * Define the small buffer chunk so that we have at least 16 byte free + * at the end of the chunk and that there is an integral number of chunks + * in a page. + */ +#define SMBUF_PAGE_SIZE 16384 /* 16k pages */ +#define SMBUF_MAX_PAGES 64 /* maximum number of pages */ +#define SMBUF_CHUNK_SIZE 256 /* 256 bytes per chunk */ +#define SMBUF_CELLS 5 +#define SMBUF_SIZE (SMBUF_CELLS * 48) +#define SMBUF_THRESHOLD 9 /* 9/16 of queue size */ +#define SMBUF_NI_THRESH 3 +#define SMBUF_CI_THRESH 1 + +#define VMBUF_PAGE_SIZE 16384 /* 16k pages */ +#define VMBUF_MAX_PAGES 16 /* maximum number of pages */ +#define VMBUF_CHUNK_SIZE 64 /* 64 bytes per chunk */ +#define VMBUF_CELLS 1 +#define VMBUF_SIZE (VMBUF_CELLS * 48) +#define VMBUF_THRESHOLD 15 /* 15/16 of size */ + +#define SMBUF_OFFSET (SMBUF_CHUNK_SIZE - 8 - SMBUF_SIZE) +#define VMBUF_OFFSET 0 + +#define MBUF_SHANDLE 0x00000000 +#define MBUF_LHANDLE 0x80000000 +#define MBUF_VHANDLE 0x40000000 +#define MBUF_HMASK 0x3fffffff + +/* + * Large buffers + * + * The problem with these is the maximum count. When the card assembles + * a AAL5 pdu it moves a buffer from the FBQ to the VC. This frees space + * in the FBQ, put the buffer may pend on the card for an unlimited amount + * of time (we don't idle connections). This means that the upper limit + * on buffers on the card may be (no-of-open-vcs + FBQ_SIZE). Because + * this is far too much, make this a tuneable. We could also make + * this dynamic by allocating pages of several lbufs at once during run time. + */ +#define LMBUF_MAX (IDT_FBQ_SIZE * 2) +#define LMBUF_CELLS (MCLBYTES / 48) /* 42 cells = 2048 byte */ +#define LMBUF_SIZE (LMBUF_CELLS * 48) +#define LMBUF_THRESHOLD 9 /* 9/16 of queue size */ +#define LMBUF_OFFSET (MCLBYTES - LMBUF_SIZE) +#define LMBUF_NI_THRESH 3 +#define LMBUF_CI_THRESH 1 + +#define LMBUF_HANDLE 0x80000000 + +struct lmbuf { + SLIST_ENTRY(lmbuf) link; /* free list link */ + bus_dmamap_t map; /* DMA map */ + u_int handle; /* this is the handle index */ + struct mbuf *m; /* the current mbuf */ + bus_addr_t phy; /* phy addr */ +}; + +#define PATM_CID(SC, VPI, VCI) \ + (((VPI) << (SC)->ifatm.mib.vci_bits) | (VCI)) + +/* + * Internal driver statistics + */ +struct patm_stats { + uint32_t raw_cells; + uint32_t raw_no_vcc; + uint32_t raw_no_buf; + uint32_t tx_qfull; + uint32_t tx_out_of_tbds; + uint32_t tx_out_of_maps; + uint32_t tx_load_err; +}; + +/* + * These are allocated as DMA able memory + */ +struct patm_scd { + struct idt_tbd scq[IDT_SCQ_SIZE]; + LIST_ENTRY(patm_scd) link; /* all active SCDs */ + uint32_t sram; /* SRAM address */ + bus_addr_t phy; /* physical address */ + bus_dmamap_t map; /* DMA map */ + u_int tail; /* next free entry for host */ + int space; /* number of free entries (minus one) */ + u_int slots; /* CBR slots allocated */ + uint8_t tag; /* next tag for TSI */ + uint8_t last_tag; /* last tag checked in interrupt */ + uint8_t num_on_card; /* number of PDUs on tx queue */ + uint8_t lacr; /* LogACR value */ + uint8_t init_er; /* LogER value */ + struct ifqueue q; /* queue of packets */ + struct mbuf *on_card[IDT_TSQE_TAG_SPACE]; +}; + +/* + * Per-VCC data + */ +struct patm_vcc { + struct atmio_vcc vcc; /* caller's parameters */ + void *rxhand; /* NATM handle */ + u_int vflags; /* open and other flags */ + uint32_t ipackets; /* packets received */ + uint32_t opackets; /* packets sent */ + uint64_t ibytes; /* bytes received */ + uint64_t obytes; /* bytes sent */ + struct mbuf *chain; /* currently received chain */ + struct mbuf *last; /* end of chain */ + u_int cid; /* index */ + u_int cps; /* last ABR cps */ + struct patm_scd *scd; +}; +#define PATM_VCC_TX_OPEN 0x0001 +#define PATM_VCC_RX_OPEN 0x0002 +#define PATM_VCC_TX_CLOSING 0x0004 +#define PATM_VCC_RX_CLOSING 0x0008 +#define PATM_VCC_OPEN 0x000f /* all the above */ +#define PATM_VCC_ASYNC 0x0010 + +#define PATM_RAW_CELL 0x0000 /* 53 byte cells */ +#define PATM_RAW_NOHEC 0x0100 /* 52 byte cells */ +#define PATM_RAW_CS 0x0200 /* 64 byte cell stream */ +#define PATM_RAW_FORMAT 0x0300 /* format mask */ + +/* + * Per adapter data + */ +struct patm_softc { + struct ifatm ifatm; /* common ATM stuff */ + struct mtx mtx; /* lock */ + struct ifmedia media; /* media */ + device_t dev; /* device */ + struct resource * memres; /* memory resource */ + bus_space_handle_t memh; /* handle */ + bus_space_tag_t memt; /* ... and tag */ + int irqid; /* resource id */ + struct resource * irqres; /* resource */ + void * ih; /* interrupt handle */ + struct utopia utopia; /* phy state */ + const struct idt_mmap *mmap; /* SRAM memory map */ + u_int flags; /* see below */ + u_int revision; /* chip revision */ + + /* DMAable status queue memory */ + size_t sq_size; /* size of memory area */ + bus_dma_tag_t sq_tag; /* DMA tag */ + bus_dmamap_t sq_map; /* map */ + + bus_addr_t tsq_phy; /* phys addr. */ + struct idt_tsqe *tsq; /* transmit status queue */ + struct idt_tsqe *tsq_next; /* last processed entry */ + struct idt_rsqe *rsq; /* receive status queue */ + bus_addr_t rsq_phy; /* phys addr. */ + u_int rsq_last; /* last processed entry */ + struct idt_rawhnd *rawhnd; /* raw cell handle */ + bus_addr_t rawhnd_phy; /* phys addr. */ + + /* TST */ + u_int tst_state; /* active TST and others */ + u_int tst_jump[2]; /* address of the jumps */ + u_int tst_base[2]; /* base address of TST */ + u_int *tst_soft; /* soft TST */ + struct mtx tst_lock; + struct callout tst_callout; + u_int tst_free; /* free slots */ + u_int tst_reserve; /* non-CBR reserve */ + u_int bwrem; /* remaining bandwith */ + + /* sysctl support */ + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; + + /* EEPROM contents */ + uint8_t eeprom[256]; + + /* large buffer mapping */ + bus_dma_tag_t lbuf_tag; /* DMA tag */ + u_int lbuf_max; /* maximum number */ + struct lmbuf *lbufs; /* array for indexing */ + SLIST_HEAD(,lmbuf) lbuf_free_list; /* free list */ + + /* small buffer handling */ + bus_dma_tag_t sbuf_tag; /* DMA tag */ + struct mbpool *sbuf_pool; /* pool */ + struct mbpool *vbuf_pool; /* pool */ + + /* raw cell queue */ + struct lmbuf *rawh; /* current header buf */ + u_int rawi; /* cell index into buffer */ + + /* statistics */ + struct patm_stats stats; /* statistics */ + + /* Vccs */ + struct patm_vcc **vccs; /* channel pointer array */ + u_int vccs_open; /* number of open channels */ + uma_zone_t vcc_zone; + struct cv vcc_cv; + + /* SCDs */ + uint32_t scd_free; /* SRAM of first free SCD */ + bus_dma_tag_t scd_tag; + struct patm_scd *scd0; + LIST_HEAD(, patm_scd) scd_list; /* list of all active SCDs */ + + /* Tx */ + bus_dma_tag_t tx_tag; /* for transmission */ + SLIST_HEAD(, patm_txmap) tx_maps_free; /* free maps */ + u_int tx_nmaps; /* allocated maps */ + u_int tx_maxmaps; /* maximum number */ + struct uma_zone *tx_mapzone; /* zone for maps */ + +#ifdef PATM_DEBUG + /* debugging */ + u_int debug; +#endif +}; + +/* flags */ +#define PATM_25M 0x0001 /* 25MBit card */ +#define PATM_SBUFW 0x0002 /* warned */ +#define PATM_VBUFW 0x0004 /* warned */ +#define PATM_UNASS 0x0010 /* unassigned cells */ + +#define PATM_CLR 0x0007 /* clear on stop */ + +/* tst - uses unused fields */ +#define TST_BOTH 0x03000000 +#define TST_CH0 0x01000000 +#define TST_CH1 0x02000000 +/* tst_state */ +#define TST_ACT1 0x0001 /* active TST */ +#define TST_PENDING 0x0002 /* need update */ +#define TST_WAIT 0x0004 /* wait fo jump */ + +#define patm_printf(SC, ...) if_printf(&(SC)->ifatm.ifnet, __VA_ARGS__); + +#ifdef PATM_DEBUG +/* + * Debugging + */ +enum { + DBG_ATTACH = 0x0001, /* attaching the card */ + DBG_INTR = 0x0002, /* interrupts */ + DBG_REG = 0x0004, /* register access */ + DBG_SRAM = 0x0008, /* SRAM access */ + DBG_PHY = 0x0010, /* PHY access */ + DBG_IOCTL = 0x0020, /* ioctl */ + DBG_FREEQ = 0x0040, /* free bufq supply */ + DBG_VCC = 0x0080, /* open/close */ + DBG_TX = 0x0100, /* transmission */ + DBG_TST = 0x0200, /* TST */ + + DBG_ALL = 0xffff +}; + +#define patm_debug(SC, FLAG, ...) do { \ + if((SC)->debug & DBG_##FLAG) { \ + if_printf(&(SC)->ifatm.ifnet, "%s: ", __func__); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + } \ + } while (0) +#else + +#define patm_debug(SC, FLAG, ...) do { } while (0) + +#endif + +/* start output */ +void patm_start(struct ifnet *); + +/* ioctl handler */ +int patm_ioctl(struct ifnet *, u_long, caddr_t); + +/* start the interface */ +void patm_init(void *); + +/* start the interface with the lock held */ +void patm_initialize(struct patm_softc *); + +/* stop the interface */ +void patm_stop(struct patm_softc *); + +/* software reset of interface */ +void patm_reset(struct patm_softc *); + +/* interrupt handler */ +void patm_intr(void *); + +/* check RSQ */ +void patm_intr_rsq(struct patm_softc *sc); + +/* close the given vcc for transmission */ +void patm_tx_vcc_close(struct patm_softc *, struct patm_vcc *); + +/* close the given vcc for receive */ +void patm_rx_vcc_close(struct patm_softc *, struct patm_vcc *); + +/* transmission side finally closed */ +void patm_tx_vcc_closed(struct patm_softc *, struct patm_vcc *); + +/* receive side finally closed */ +void patm_rx_vcc_closed(struct patm_softc *, struct patm_vcc *); + +/* vcc closed */ +void patm_vcc_closed(struct patm_softc *, struct patm_vcc *); + +/* check if we can open this one */ +int patm_tx_vcc_can_open(struct patm_softc *, struct patm_vcc *); + +/* check if we can open this one */ +int patm_rx_vcc_can_open(struct patm_softc *, struct patm_vcc *); + +/* open it */ +void patm_tx_vcc_open(struct patm_softc *, struct patm_vcc *); + +/* open it */ +void patm_rx_vcc_open(struct patm_softc *, struct patm_vcc *); + +/* receive packet */ +void patm_rx(struct patm_softc *, struct idt_rsqe *); + +/* packet transmitted */ +void patm_tx(struct patm_softc *, u_int, u_int); + +/* VBR connection went idle */ +void patm_tx_idle(struct patm_softc *, u_int); + +/* allocate an SCQ */ +struct patm_scd *patm_scd_alloc(struct patm_softc *); + +/* free an SCD */ +void patm_scd_free(struct patm_softc *sc, struct patm_scd *scd); + +/* setup SCD in SRAM */ +void patm_scd_setup(struct patm_softc *sc, struct patm_scd *scd); + +/* setup TCT entry in SRAM */ +void patm_tct_setup(struct patm_softc *, struct patm_scd *, struct patm_vcc *); + +/* free a large buffer */ +void patm_lbuf_free(struct patm_softc *sc, struct lmbuf *b); + +/* Process the raw cell at the given address */ +void patm_rx_raw(struct patm_softc *sc, u_char *cell); + +/* load a one segment DMA map */ +void patm_load_callback(void *, bus_dma_segment_t *, int, int); + +/* network operation register access */ +static __inline uint32_t +patm_nor_read(struct patm_softc *sc, u_int reg) +{ + uint32_t val; + + val = bus_space_read_4(sc->memt, sc->memh, reg); + patm_debug(sc, REG, "reg(0x%x)=%04x", reg, val); + return (val); +} +static __inline void +patm_nor_write(struct patm_softc *sc, u_int reg, uint32_t val) +{ + + patm_debug(sc, REG, "reg(0x%x)=%04x", reg, val); + bus_space_write_4(sc->memt, sc->memh, reg, val); +} + +/* Execute command */ +static __inline void +patm_cmd_wait(struct patm_softc *sc) +{ + while (patm_nor_read(sc, IDT_NOR_STAT) & IDT_STAT_CMDBZ) + ; +} +static __inline void +patm_cmd_exec(struct patm_softc *sc, uint32_t cmd) +{ + patm_cmd_wait(sc); + patm_nor_write(sc, IDT_NOR_CMD, cmd); +} + +/* Read/write SRAM at the given word address. */ +static __inline uint32_t +patm_sram_read(struct patm_softc *sc, u_int addr) +{ + uint32_t val; + + patm_cmd_exec(sc, IDT_MKCMD_RSRAM(addr)); + patm_cmd_wait(sc); + val = patm_nor_read(sc, IDT_NOR_D0); + patm_debug(sc, SRAM, "read %04x=%08x", addr, val); + return (val); +} +static __inline void +patm_sram_write(struct patm_softc *sc, u_int addr, uint32_t val) +{ + patm_debug(sc, SRAM, "write %04x=%08x", addr, val); + patm_cmd_wait(sc); + patm_nor_write(sc, IDT_NOR_D0, val); + patm_cmd_exec(sc, IDT_MKCMD_WSRAM(addr, 0)); +} +static __inline void +patm_sram_write4(struct patm_softc *sc, u_int addr, uint32_t v0, uint32_t v1, + uint32_t v2, uint32_t v3) +{ + patm_debug(sc, SRAM, "write %04x=%08x,%08x,%08x,%08x", + addr, v0, v1, v2, v3); + patm_cmd_wait(sc); + patm_nor_write(sc, IDT_NOR_D0, v0); + patm_nor_write(sc, IDT_NOR_D1, v1); + patm_nor_write(sc, IDT_NOR_D2, v2); + patm_nor_write(sc, IDT_NOR_D3, v3); + patm_cmd_exec(sc, IDT_MKCMD_WSRAM(addr, 3)); +} + +#define LEGAL_VPI(SC, VPI) \ + (((VPI) & ~((1 << (SC)->ifatm.mib.vpi_bits) - 1)) == 0) +#define LEGAL_VCI(SC, VCI) \ + (((VCI) & ~((1 << (SC)->ifatm.mib.vci_bits) - 1)) == 0) + +extern const uint32_t patm_rtables155[]; +extern const uint32_t patm_rtables25[]; +extern const u_int patm_rtables_size; +extern const u_int patm_rtables_ntab; diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 04d41df5e7ae..3828eeb95d48 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -88,6 +88,7 @@ SUBDIR= accf_data \ nmdm \ ntfs \ nullfs \ + patm \ pcn \ plip \ portalfs \ diff --git a/sys/modules/patm/Makefile b/sys/modules/patm/Makefile new file mode 100644 index 000000000000..7310c2077ead --- /dev/null +++ b/sys/modules/patm/Makefile @@ -0,0 +1,22 @@ +# $FreeBSD$ +# +# Author: Harti Brandt +# +.PATH: ${.CURDIR}/../../dev/patm + +KMOD= if_patm +SRCS= if_patm.c if_patm_attach.c if_patm_ioctl.c if_patm_intr.c \ + if_patm_tx.c if_patm_rx.c if_patm_rtables.c \ + device_if.h bus_if.h pci_if.h opt_inet.h opt_natm.h + +CFLAGS+= -DENABLE_BPF +# CFLAGS+= -DPATM_DEBUG=0x0 -DINVARIANT_SUPPORT -DINVARIANTS -g -DDIAGNOSTIC +# LDFLAGS+= -g + +opt_inet.h: + echo "#define INET 1" > opt_inet.h + +opt_natm.h: + echo "#define NATM 1" > opt_natm.h + +.include