diff -ur --new-file old/atm/CHANGES new/atm/CHANGES --- old/atm/CHANGES Thu Jun 3 04:18:03 1999 +++ new/atm/CHANGES Fri Jun 11 22:48:24 1999 @@ -1,3 +1,25 @@ +Version 0.60 to 0.61 (11-JUN-1999) +==================== + +Bug fixes +--------- + + - nicstar: driver sometimes crashed when starting for 25 Mbps cards (Rui + Prior) + - Zeitnet driver: uPD98402.c wasn't compiled with -DEXPORT_SYMTAB with + building as a module + - net/atm/raw.c didn't export atm_init_aal5, so ATMTCP didn't load as a module + - atmtcp could still be accessed after loading and then unloading, yielding an + Oops + +Other changes +------------- + + - PPC configuration now also includes ATM (Jay Talbott) + - lots of cleanup in the Madge drivers (Giuliano Procida) + - tamed down a bit the tone in README + + Version 0.59 to 0.60 (3-JUN-1999) ==================== diff -ur --new-file old/atm/README new/atm/README --- old/atm/README Thu Jun 3 02:20:57 1999 +++ new/atm/README Fri Jun 11 21:42:48 1999 @@ -1,9 +1,9 @@ -ATM on Linux, release 0.60 (alpha) by Werner Almesberger, EPFL ICA +ATM on Linux, release 0.61 (alpha) by Werner Almesberger, EPFL ICA ============================================== Werner.Almesberger@epfl.ch -This is experimental software. There are known major bugs and certainly -even many more yet unknown problems. Internal and external interfaces are -far from being stable. In fact, they change daily. Use at your own risk. +This is experimental software. There are known bugs and certainly even +many more yet unknown problems. Internal and external interfaces may +still change every once in a while. Use at your own risk. This package contains a kernel patch for ATM protocol stacks and for ATM device drivers, source for demons, management and test tools, and some diff -ur --new-file old/atm/USAGE new/atm/USAGE --- old/atm/USAGE Thu Jun 3 04:20:33 1999 +++ new/atm/USAGE Fri Jun 11 22:49:02 1999 @@ -1,4 +1,4 @@ -%:Usage instructions - ATM on Linux, release 0.60 +%:Usage instructions - ATM on Linux, release 0.61 %:------------------------------------------------- %: %: @@ -20,7 +20,7 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.60.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.61.tar.gz - the Linux kernel, version 2.3.3, e.g. from ftp://ftp.kernel.org/pub/linux/kernel/v2.3/linux-2.3.3.tar.gz - Perl, version 4 or 5 @@ -36,7 +36,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.60.tar.gz +tar xfz atm-0.61.tar.gz and the kernel source: diff -ur --new-file old/atm/VERSION new/atm/VERSION --- old/atm/VERSION Thu Jun 3 02:19:59 1999 +++ new/atm/VERSION Fri Jun 11 21:41:33 1999 @@ -1 +1 @@ -0.60 +0.61 diff -ur --new-file old/atm/atm.patch new/atm/atm.patch --- old/atm/atm.patch Thu Jun 3 04:19:39 1999 +++ new/atm/atm.patch Fri Jun 11 22:48:49 1999 @@ -270,6 +270,18 @@ fi endmenu fi +--- ref/arch/ppc/config.in Tue May 11 17:24:32 1999 ++++ work/arch/ppc/config.in Mon Jun 7 20:49:05 1999 +@@ -141,6 +141,9 @@ + bool 'Network device support' CONFIG_NETDEVICES + if [ "$CONFIG_NETDEVICES" = "y" ]; then + source drivers/net/Config.in ++ if [ "$CONFIG_ATM" = "y" ]; then ++ source drivers/atm/Config.in ++ fi + fi + endmenu + fi --- ref/arch/sparc/config.in Tue Mar 16 01:10:43 1999 +++ work/arch/sparc/config.in Thu Jun 3 02:29:44 1999 @@ -173,6 +173,9 @@ @@ -354,8 +366,8 @@ + fi +fi --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/Makefile Thu Jun 3 02:29:44 1999 -@@ -0,0 +1,79 @@ ++++ work/drivers/atm/Makefile Fri Jun 11 21:39:03 1999 +@@ -0,0 +1,80 @@ +# File: drivers/atm/Makefile +# +# Makefile for the Linux network (ATM) device drivers. @@ -382,7 +394,8 @@ +L_OBJS += zatm.o uPD98402.o +else + ifeq ($(CONFIG_ATM_ZATM),m) -+ M_OBJS += zatm.o uPD98402.o ++ M_OBJS += zatm.o ++ MX_OBJS += uPD98402.o + endif +endif + @@ -436,8 +449,8 @@ + +include $(TOPDIR)/Rules.make --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/ambassador.c Thu Jun 3 03:53:41 1999 -@@ -0,0 +1,2652 @@ ++++ work/drivers/atm/ambassador.c Mon Jun 7 21:42:29 1999 +@@ -0,0 +1,2633 @@ +/* + Madge Ambassador ATM Adapter driver. + Copyright (C) 1995-1999 Madge Networks Ltd. @@ -484,7 +497,7 @@ + +#define maintainer_string "Giuliano Procida at Madge Networks " +#define description_string "Madge ATM Ambassador driver" -+#define version_string "1.1" ++#define version_string "1.1.3" + +static inline void __init show_version (void) { + printk ("%s version %s\n", description_string, version_string); @@ -562,11 +575,11 @@ + + The queue pairs work as follows: one queue is for supply to the + adapter, items in it are pending and are owned by the adapter; the -+ other is the for return from the adapter, items in it have been -+ dealt with by the adapter. The host adds items to the supply (TX -+ descriptors and free RX buffer descriptors) and removes items from -+ the return (TX and RX completions). The adapter deals with out of -+ order completions. ++ other is the queue for return from the adapter, items in it have ++ been dealt with by the adapter. The host adds items to the supply ++ (TX descriptors and free RX buffer descriptors) and removes items ++ from the return (TX and RX completions). The adapter deals with out ++ of order completions. + + Interrupts (card to host) and the doorbell (host to card) are used + for signalling. @@ -610,25 +623,26 @@ + + delay/spacing = latency = (20+2)/3 = 7 (buffers) (rounding up) + -+ The 20us delay assumes that there is no need to touch disk; if we -+ need touch disk to get buffers we are going to drop frames anyway. -+ ++ The 20us delay assumes that there is no need to sleep; if we need to ++ sleep to get buffers we are going to drop frames anyway. ++ + In fact, each pool should have enough buffers to support the + simultaneous reassembly of a separate frame on each VC and cope with -+ the case in which large frames arrive with round robin cell arrivals -+ on each VC. -+ ++ the case in which frames complete in round robin cell fashion on ++ each VC. ++ + Only one frame can complete at each cell arrival, so if "n" VCs are + open, the worst case is to have them all complete frames together + followed by all starting new frames together. + -+ min number of buffers = n + delay/spacing ++ desired number of buffers = n + delay/spacing + + These are the extreme requirements, however, they are "n+k" for some + "k" so we have only the constant to choose. This is the argument -+ rx_lats which current defaults at 3. ++ rx_lats which current defaults to 7. + -+ Actually, "n ? n+k : 0" is better and this is what is implemented. ++ Actually, "n ? n+k : 0" is better and this is what is implemented, ++ subject to the limit given by the pool size. + + 4. Driver locking + @@ -642,7 +656,7 @@ + and close functions. There are three reasons for a lock: 1. we need + to do atomic rate reservation and release (not used yet), 2. Opening + sometimes involves two adapter commands which must not be separated -+ by another command on the same VC, 3. the changes in RX pool size ++ by another command on the same VC, 3. the changes to RX pool size + must be atomic. The lock needs to work over context switches, so we + use a semaphore. + @@ -673,8 +687,8 @@ + + Now we: + . Note that skb_alloc rounds up size to a 16byte boundary. -+ . Ensure all areas must not traverse 4MB boundaries. -+ . Ensure all areas must not start at a E00000xx bus address. ++ . Ensure all areas do not traverse 4MB boundaries. ++ . Ensure all areas do not start at a E00000xx bus address. + (I cannot be certain, but this may always hold with Linux) + . Make all failures cause a loud message. + . Discard non-conforming SKBs (causes TX failure or RX fill delay). @@ -1320,11 +1334,9 @@ + + while (irq_ok_old != irq_ok && irq_ok < 100) { + unsigned char pool; -+#ifdef DEBUG_AMBASSADOR -+ u32 ints = rd_mem (dev, &mem->interrupt); -+#endif ++ PRINTD (DBG_IRQ, "FYI: interrupt was %08x, work %u", ++ rd_mem (dev, &mem->interrupt), irq_ok); + wr_mem (dev, &mem->interrupt, -1); -+ PRINTD (DBG_IRQ, "FYI: interrupt was %08x, work %u", ints, irq_ok); + irq_ok_old = irq_ok; + for (pool = 0; pool < NUM_RX_POOLS; ++pool) + while (!rx_take (dev, pool)) @@ -1410,9 +1422,9 @@ +/********** make rate (not quite as much fun as Horizon) **********/ + +static unsigned int make_rate (unsigned int rate, rounding r, -+ u16 * bits, unsigned int * actual) { -+ unsigned char exp = 0; /* silence gcc */ -+ unsigned int man = 0; ++ u16 * bits, unsigned int * actual) { ++ unsigned char exp = -1; // hush gcc ++ unsigned int man = -1; // hush gcc + + PRINTD (DBG_FLOW|DBG_QOS, "make_rate %u", rate); + @@ -1427,12 +1439,20 @@ + // find position of top bit, this gives e + // remove top bit and shift (rounding if feeling clever) by 9-e + -+ // XXX fix me to work with larger ints -+ + // ucode bug: please don't set bit 14! 0 not representable + -+ if (rate) { -+ // non-zero rate ++ if (rate > 0xffc00000U) { ++ // larger than largest representable rate ++ ++ if (r == round_up) { ++ return -EINVAL; ++ } else { ++ exp = 31; ++ man = 511; ++ } ++ ++ } else if (rate) { ++ // representable rate + + exp = 31; + man = rate; @@ -1447,13 +1467,14 @@ + // rate = (2^31+(man-2^31))*2^(exp-31) + // rate = (1+(man-2^31)/2^31)*2^exp + man = man<<1; ++ man &= 0xffffffffU; // a nop on 32-bit systems + // rate = (1+man/2^32)*2^exp + + // exp is in the range 0 to 31, man is in the range 0 to 2^32-1 + // time to lose significance... we want m in the range 0 to 2^9-1 + // rounding presents a minor problem... we first decide which way -+ // we are rounding (based on given rounding direction and the bits -+ // of the mantissa that are to be discarded). ++ // we are rounding (based on given rounding direction and possibly ++ // the bits of the mantissa that are to be discarded). + + switch (r) { + case round_down: { @@ -1466,13 +1487,9 @@ + if (man & (-1>>9)) { + man = (man>>(32-9)) + 1; + if (man == (1<<9)) { -+ // check for round up outside of range -+ if (exp == 31) { -+ return -EINVAL; -+ } else { -+ man = 0; -+ exp += 1; -+ } ++ // no need to check for round up outside of range ++ man = 0; ++ exp += 1; + } + } else { + man = (man>>(32-9)); @@ -1483,14 +1500,10 @@ + // check msb that we are discarding + if (man & (1<<(32-9-1))) { + man = (man>>(32-9)) + 1; -+ // if rounding up would go out of range, just stay at top + if (man == (1<<9)) { -+ if (exp == 31) { -+ man -= 1; -+ } else { -+ man = 0; -+ exp += 1; -+ } ++ // no need to check for round up outside of range ++ man = 0; ++ exp += 1; + } + } else { + man = (man>>(32-9)); @@ -1500,19 +1513,13 @@ + } + + } else { -+ // zero rate ++ // zero rate - not representable + -+ switch (r) { -+ case round_up: { -+ break; -+ } -+ case round_down: { -+ return -EINVAL; -+ break; -+ } -+ case round_nearest: { -+ break; -+ } ++ if (r == round_down) { ++ return -EINVAL; ++ } else { ++ exp = 0; ++ man = 0; + } + + } @@ -1544,18 +1551,17 @@ + struct atm_trafprm * txtp; + struct atm_trafprm * rxtp; + u16 tx_rate_bits; -+ u16 tx_vc_bits = 0; /* silence gcc */ -+ u16 tx_frame_bits = 0; -+ // int pcr; ++ u16 tx_vc_bits = -1; // hush gcc ++ u16 tx_frame_bits = -1; // hush gcc + + amb_dev * dev = AMB_DEV(atm_vcc->dev); + amb_vcc * vcc; -+ unsigned char pool = -1; // compiler warning ++ unsigned char pool = -1; // hush gcc + + PRINTD (DBG_FLOW|DBG_VCC, "amb_open %x %x", vpi, vci); + ++#ifdef ATM_VPI_UNSPEC + // UNSPEC is deprecated, remove this code eventually -+#if defined ATM_VPI_UNSPEC + if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) { + PRINTK (KERN_WARNING, "rejecting open with unspecified VPI/VCI (deprecated)"); + return -EINVAL; @@ -1722,7 +1728,6 @@ + vcc->rx_info.pool = pool; + + down (&dev->vcc_sf); -+ + /* grow RX buffer pool */ + if (!dev->rxq[pool].buffers_wanted) + dev->rxq[pool].buffers_wanted = rx_lats; @@ -1832,7 +1837,6 @@ + dev->rxq[pool].buffers_wanted = 0; + drain_rx_pool (dev, pool); + } -+ + up (&dev->vcc_sf); + } + @@ -2114,8 +2118,8 @@ + amb_open, + amb_close, + NULL, // no amb_ioctl, -+ NULL, // amb_getsockopt, -+ NULL, // amb_setsockopt, ++ NULL, // no amb_getsockopt, ++ NULL, // no amb_setsockopt, + amb_send, + amb_sg_send, + NULL, // no send_oam - not in fact used yet @@ -2158,8 +2162,9 @@ + +/********** creation of communication queues **********/ + -+static int create_queues (amb_dev * dev, unsigned int cmds, unsigned int txs, -+ unsigned int * rxs, unsigned int * rx_buffer_sizes) { ++static int __init create_queues (amb_dev * dev, unsigned int cmds, ++ unsigned int txs, unsigned int * rxs, ++ unsigned int * rx_buffer_sizes) { + unsigned char pool; + size_t total = 0; + void * memory; @@ -2288,8 +2293,8 @@ + +/********** basic loader commands and error handling **********/ + -+static int do_loader_command (const amb_dev * dev, loader_command cmd, -+ volatile loader_block * lb) { ++static int __init do_loader_command (const amb_dev * dev, loader_command cmd, ++ volatile loader_block * lb) { + + // centisecond timeouts - guessing away here + unsigned int command_timeouts [] = { @@ -2305,8 +2310,7 @@ + [adap_run_in_iram] = 1, + [adap_end_download] = 1 + }; -+ -+#if 0 /* unused */ ++ + unsigned int command_successes [] = { + [host_memory_test] = COMMAND_PASSED_TEST, + [read_adapter_memory] = COMMAND_READ_DATA_OK, @@ -2320,11 +2324,14 @@ + [adap_run_in_iram] = COMMAND_COMPLETE, + [adap_end_download] = COMMAND_COMPLETE + }; -+#endif + -+ int decode_loader_error (u32 result) { ++ int decode_loader_result (loader_command cmd, u32 result) { + int res; + const char * msg; ++ ++ if (result == command_successes[cmd]) ++ return 0; ++ + switch (result) { + case BAD_COMMAND: + res = -EINVAL; @@ -2377,12 +2384,12 @@ + default: + res = -EINVAL; + msg = "unknown error"; -+ PRINTD (DBG_LOAD|DBG_ERR, "decode_loader_error got %d=%x !", ++ PRINTD (DBG_LOAD|DBG_ERR, "decode_loader_result got %d=%x !", + result, result); + break; + } -+ if (res) -+ PRINTK (KERN_ERR, "%s", msg); ++ ++ PRINTK (KERN_ERR, "%s", msg); + return res; + } + @@ -2431,25 +2438,14 @@ + } + return 0; + } else { -+ return decode_loader_error (be32_to_cpu (lb->result)); ++ return decode_loader_result (cmd, be32_to_cpu (lb->result)); + } + -+#if 0 -+ if ((res != COMMAND_PASSED_TEST) && -+ (res != COMMAND_READ_DATA_OK) && -+ (res != COMMAND_WRITE_DATA_OK) && -+ (res != COMMAND_COMPLETE)) { -+ PRINTD (DBG_LOAD|DBG_ERR"startup cmd %d failed with error %08x", -+ cmd, res); -+ dump_registers (dev); -+ return -EIO; -+ } -+#endif +} + +/* loader: determine loader version */ + -+static int get_loader_version (const amb_dev * dev, u32 * version) { ++static int __init get_loader_version (const amb_dev * dev, u32 * version) { + loader_block lb; + int res; + @@ -2465,8 +2461,8 @@ + +/* loader: read or verify memory data blocks */ + -+static int loader_write (const amb_dev * dev, const u32 * data, -+ u32 address, unsigned int count) { ++static int __init loader_write (const amb_dev * dev, const u32 * data, ++ u32 address, unsigned int count) { + unsigned int i; + loader_block lb; + transfer_block * tb = &lb.payload.transfer; @@ -2482,8 +2478,8 @@ + return do_loader_command (dev, write_adapter_memory, &lb); +} + -+static int loader_verify (const amb_dev * dev, const u32 * data, -+ u32 address, unsigned int count) { ++static int __init loader_verify (const amb_dev * dev, const u32 * data, ++ u32 address, unsigned int count) { + unsigned int i; + loader_block lb; + transfer_block * tb = &lb.payload.transfer; @@ -2505,7 +2501,7 @@ + return res; +} + -+static int loader_start (const amb_dev * dev, u32 address) { ++static int __init loader_start (const amb_dev * dev, u32 address) { + loader_block lb; + + PRINTD (DBG_FLOW|DBG_LOAD, "loader_start"); @@ -2579,7 +2575,7 @@ + +/********** transfer and start the microcode **********/ + -+static int ucode_init (amb_dev * dev) { ++static int __init ucode_init (amb_dev * dev) { + unsigned int i = 0; + unsigned int total = 0; + const u32 * pointer = ucode_data; @@ -2625,7 +2621,7 @@ + +/********** give adapter parameters **********/ + -+static int amb_talk (amb_dev * dev) { ++static int __init amb_talk (amb_dev * dev) { + adap_talk_block a; + unsigned char pool; + unsigned long timeout; @@ -2678,7 +2674,7 @@ +} + +// get microcode version -+static void amb_ucode_version (amb_dev * dev) { ++static void __init amb_ucode_version (amb_dev * dev) { + u32 major; + u32 minor; + command cmd; @@ -2691,7 +2687,7 @@ +} + +// get end station address -+static void amb_esi (amb_dev * dev, u8 * esi) { ++static void __init amb_esi (amb_dev * dev, u8 * esi) { + u32 lower4; + u16 upper2; + command cmd; @@ -2732,7 +2728,7 @@ + return; +} + -+static int amb_init (amb_dev * dev) { ++static int __init amb_init (amb_dev * dev) { + u32 version; + + /* enable adapter doorbell */ @@ -3059,8 +3055,6 @@ +int __init amb_detect (void) { + int devs; + -+ PRINTD (DBG_FLOW|DBG_INIT, "init_module"); -+ + // sanity check - cast needed as printk does not support %Zu + if (sizeof(amb_mem) != 4*16 + 4*12) { + PRINTK (KERN_ERR, "Fix amb_mem (is %lu words).", @@ -3844,18 +3838,18 @@ + return devs; +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/atmsar11.data Thu Jun 3 02:29:45 1999 ++++ work/drivers/atm/atmsar11.data Mon Jun 7 21:45:01 1999 @@ -0,0 +1,2063 @@ +/* + Madge Ambassador ATM Adapter microcode. + Copyright (C) 1995-1999 Madge Networks Ltd. + -+ This is provided here for your convenience only. ++ This microcode data is placed under the terms of the GNU General ++ Public License. The GPL is contained in /usr/doc/copyright/GPL on a ++ Debian system and in the file COPYING in the Linux kernel source. + -+ No restrictions are placed on its use, so long as this file remains -+ unchanged. -+ -+ You may not make, use or re-distribute modified versions of this code. ++ We would prefer you not to distribute modified versions without ++ consultation and not to ask for assembly/other microcode source. +*/ + + 0x401a6800, @@ -5910,21 +5904,27 @@ + 0x00400008, + 0x00000000, --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/atmsar11.regions Thu Jun 3 02:29:45 1999 -@@ -0,0 +1,3 @@ ++++ work/drivers/atm/atmsar11.regions Mon Jun 7 21:45:02 1999 +@@ -0,0 +1,6 @@ ++/* ++ See copyright and licensing conditions in ambassador.* files. ++*/ + { 0x00000080, 993, }, + { 0xa0d0d500, 80, }, + { 0xa0d0f000, 978, }, --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/atmsar11.start Thu Jun 3 02:29:45 1999 -@@ -0,0 +1 @@ ++++ work/drivers/atm/atmsar11.start Mon Jun 7 21:45:02 1999 +@@ -0,0 +1,4 @@ ++/* ++ See copyright and licensing conditions in ambassador.* files. ++*/ + 0xa0d0f000 --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/atmtcp.c Thu Jun 3 02:29:45 1999 -@@ -0,0 +1,339 @@ ++++ work/drivers/atm/atmtcp.c Fri Jun 11 21:57:53 1999 +@@ -0,0 +1,342 @@ +/* drivers/atm/atmtcp.c - ATM over TCP "device" driver */ + -+/* Written 1997,1998 by Werner Almesberger, EPFL LRC/ICA */ ++/* Written 1997-1999 by Werner Almesberger, EPFL LRC/ICA */ + + +#include @@ -6247,8 +6247,12 @@ + return 0; +} + ++ +void cleanup_module(void) +{ ++ atm_tcp_ops.attach = NULL; ++ atm_tcp_ops.create_persistent = NULL; ++ atm_tcp_ops.remove_persistent = NULL; +} + +#else @@ -6260,7 +6264,6 @@ +}; + +#endif -+ --- /dev/null Tue Jan 1 05:00:00 1980 +++ work/drivers/atm/eni.c Thu Jun 3 03:35:52 1999 @@ -0,0 +1,2264 @@ @@ -8647,8 +8650,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/horizon.c Thu Jun 3 03:52:24 1999 -@@ -0,0 +1,3067 @@ ++++ work/drivers/atm/horizon.c Mon Jun 7 21:42:29 1999 +@@ -0,0 +1,3065 @@ +/* + Madge Horizon ATM Adapter driver. + Copyright (C) 1995-1999 Madge Networks Ltd. @@ -8702,9 +8705,9 @@ + +#define maintainer_string "Giuliano Procida at Madge Networks " +#define description_string "Madge ATM Horizon [Ultra] driver" -+#define version_string "1.1" ++#define version_string "1.1.3" + -+static void __init show_version (void) { ++static inline void __init show_version (void) { + printk ("%s version %s\n", description_string, version_string); +} + @@ -8738,7 +8741,7 @@ + + The driver is only known to work with SONET and UTP Horizon Ultra + cards at 155Mb/s. However, code is in place to deal with both the -+ original Horizon and 35Mb/s. ++ original Horizon and 25Mb/s operation. + + There are two revisions of the Horizon ASIC: the original and the + Ultra. Details of hardware bugs are in section III. @@ -8779,15 +8782,15 @@ + + 3. Initialisation + -+ The card is reset and then put into a know state. The physical layer -+ is configured for normal operation at the appropriate speed; in the -+ case of the 155 cards, the framer is initialised with line-based -+ timing; the internal RAM is zeroed and the allocation of buffers for -+ RX and TX is made; the Burnt In Address is read and copied to the -+ ATM ESI; various policy settings for RX (VPI bits, unknown VCs, oam -+ cells) are made. Ideally all policy items should be configurable at -+ module load (if not actually on-demand), however, only the vpi vs -+ vci bit allocation can be specified at insmod. ++ The card is reset and then put into a known state. The physical ++ layer is configured for normal operation at the appropriate speed; ++ in the case of the 155 cards, the framer is initialised with ++ line-based timing; the internal RAM is zeroed and the allocation of ++ buffers for RX and TX is made; the Burnt In Address is read and ++ copied to the ATM ESI; various policy settings for RX (VPI bits, ++ unknown VCs, oam cells) are made. Ideally all policy items should be ++ configurable at module load (if not actually on-demand), however, ++ only the vpi vs vci bit allocation can be specified at insmod. + + 4. Shutdown + @@ -8871,17 +8874,18 @@ + "raw cell" to ATM Linux's (48 bytes vs. 52 bytes) so neither are + supported by this driver. + -+ The Horizon has (TX) support for ABR (including UBR), VBR and CBR. -+ Each TX channel has a bucket (containing up to 31 cell units) and -+ two timers (PCR and SCR) associated with it that can be used to -+ govern cell emissions and host notification (in the case of -+ ABR). The timers may either be disabled or may be set to any of 240 -+ values (determined by the clock crystal, a fixed (?) per-device -+ divider, a configurable divider and a configurable timer preload -+ value). -+ -+ At the moment only UBR and CBR are supported by the driver. This is -+ due to my not understanding ATM Linux VBR or Horizon's VBR support. ++ The Horizon has limited support for ABR (including UBR), VBR and ++ CBR. Each TX channel has a bucket (containing up to 31 cell units) ++ and two timers (PCR and SCR) associated with it that can be used to ++ govern cell emissions and host notification (in the case of ABR this ++ is presumably so that RM cells may be emitted at appropriate times). ++ The timers may either be disabled or may be set to any of 240 values ++ (determined by the clock crystal, a fixed (?) per-device divider, a ++ configurable divider and a configurable timer preload value). ++ ++ At the moment only UBR and CBR are supported by the driver. VBR will ++ be supported as soon as ATM for Linux supports it. ABR support is ++ very unlikely as RM cell handling is completely up to the driver. + + 1. TX (TX channel setup and TX transfer) + @@ -8957,7 +8961,7 @@ + in the TX direction on the original Horizon. More complicated + solutions are likely to hurt my brain. + -+ 3. Loss of buffer on close VC ++ 2. Loss of buffer on close VC + + When a VC is being closed, the buffer associated with it is not + returned to the pool. The host must store the reference to this @@ -8966,7 +8970,7 @@ + The host intervention currently consists of stacking such a buffer + pointer at VC close and checking the stack at VC open. + -+ 4. Failure to close a VC ++ 3. Failure to close a VC + + If a VC is currently receiving a frame then closing the VC may fail + and the frame continues to be received. @@ -8974,7 +8978,7 @@ + The solution is to make sure any received frames are flushed when + ready. This is currently done just before the solution to 3. + -+ 5. PCI bus (original Horizon only, fixed in Ultra) ++ 4. PCI bus (original Horizon only, fixed in Ultra) + + Reading from the data port prior to initialisation will hang the PCI + bus. Just don't do that then! We don't. @@ -9053,7 +9057,7 @@ +static inline u32 rd_mem (const hrz_dev * dev, HDW * addr) { + // wr_regl (dev, MEM_RD_ADDR_REG_OFF, (u32) addr); + wr_regl (dev, MEM_RD_ADDR_REG_OFF, (addr - (HDW *) 0) * sizeof(HDW)); -+ return rd_regl(dev, MEMORY_PORT_OFF); ++ return rd_regl (dev, MEMORY_PORT_OFF); +} + +static inline void wr_framer (const hrz_dev * dev, u32 addr, u32 data) { @@ -9163,7 +9167,7 @@ + +/* RX channels are 10 bit integers, these fns are quite paranoid */ + -+static inline int channel_to_vpci (const u16 channel, short * vpi, int * vci) { ++static inline int channel_to_vpivci (const u16 channel, short * vpi, int * vci) { + unsigned short vci_bits = 10 - vpi_bits; + if ((channel & RX_CHANNEL_MASK) == channel) { + *vci = channel & ((~0)<tx_pcr_bits); + +#if 0 -+ if (a vbr channel) { ++ if (vcc->tx_xbr_bits == VBR_RATE_TYPE) { + // SCR timer + update_tx_channel_config (dev, tx_channel, SCR_TIMER_ACCESS, + vcc->tx_scr_bits); @@ -10236,7 +10240,7 @@ + + // ... and fullness + update_tx_channel_config (dev, tx_channel, BUCKET_FULLNESS_ACCESS, -+ vcc->tx_bucket_bits); ++ vcc->tx_bucket_bits); + } +#endif + @@ -10454,7 +10458,7 @@ + +/********** reset a card **********/ + -+static void __init hrz_reset_card (const hrz_dev * dev) { ++static void __init hrz_reset (const hrz_dev * dev) { + u32 control_0_reg = rd_regl (dev, CONTROL_0_REG); + + // why not set RESET_HORIZON to one and wait for the card to @@ -10473,18 +10477,6 @@ + wr_regl (dev, CONTROL_0_REG, control_0_reg); +} + -+/********** shutdown a card **********/ -+ -+#ifdef MODULE -+ -+static void hrz_shutdown (const hrz_dev * dev) { -+ hrz_reset_card (dev); -+ -+ GREEN_LED_OFF(dev); -+} -+ -+#endif -+ +/********** read the burnt in address **********/ + +static u16 __init read_bia (const hrz_dev * dev, u16 addr) { @@ -10583,7 +10575,7 @@ + // Reset the card to get everything in a known state + + printk (" reset"); -+ hrz_reset_card (dev); ++ hrz_reset (dev); + + // Clear all the buffer memory + @@ -10851,8 +10843,8 @@ + hrz_vcc * vccp; // allocated late + PRINTD (DBG_FLOW|DBG_VCC, "hrz_open %x %x", vpi, vci); + ++#ifdef ATM_VPI_UNSPEC + // UNSPEC is deprecated, remove this code eventually -+#if defined ATM_VPI_UNSPEC + if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) { + PRINTK (KERN_WARNING, "rejecting open with unspecified VPI/VCI (deprecated)"); + return -EINVAL; @@ -10867,7 +10859,7 @@ + } + PRINTD (DBG_VCC, "atm_find_ci gives %x %x", vpi, vci); + -+ error = vpci_to_channel (&channel, vpi, vci); ++ error = vpivci_to_channel (&channel, vpi, vci); + if (error) { + PRINTD (DBG_WARN|DBG_VCC, "VPI/VCI out of range: %hd/%d", vpi, vci); + return error; @@ -11111,7 +11103,7 @@ + // slight race (no locking) here so we may get -EAGAIN + // later; the greedy bastards would deserve it :) + PRINTD (DBG_QOS, "snatching all remaining RX bandwidth"); -+ pcr = dev->tx_avail; ++ pcr = dev->rx_avail; + } else if (pcr < 0) { + pcr = -pcr; + } @@ -11124,14 +11116,15 @@ + } + break; + } ++#if 0 + case ATM_VBR: { -+ // int scr = atm_scr_goal (txtp); ++ // int scr = atm_scr_goal (rxtp); + int scr = 1<<16; // just for fun + if (!scr) { + // slight race (no locking) here so we may get -EAGAIN + // later; the greedy bastards would deserve it :) + PRINTD (DBG_QOS, "snatching all remaining RX bandwidth"); -+ scr = dev->tx_avail; ++ scr = dev->rx_avail; + } else if (scr < 0) { + scr = -scr; + } @@ -11144,6 +11137,7 @@ + } + break; + } ++#endif + default: { + PRINTD (DBG_QOS, "unsupported RX traffic class"); + return -EINVAL; @@ -11284,8 +11278,10 @@ + MOD_DEC_USE_COUNT; +} + ++#if 0 +static int hrz_getsockopt (struct atm_vcc * atm_vcc, int level, int optname, + void *optval, int optlen) { ++ hrz_dev * dev = HRZ_DEV(atm_vcc->dev); + PRINTD (DBG_FLOW|DBG_VCC, "hrz_getsockopt"); + switch (level) { + case SOL_SOCKET: @@ -11307,6 +11303,7 @@ + +static int hrz_setsockopt (struct atm_vcc * atm_vcc, int level, int optname, + void *optval, int optlen) { ++ hrz_dev * dev = HRZ_DEV(atm_vcc->dev); + PRINTD (DBG_FLOW|DBG_VCC, "hrz_setsockopt"); + switch (level) { + case SOL_SOCKET: @@ -11325,6 +11322,7 @@ + } + return -EINVAL; +} ++#endif + +static int hrz_sg_send (struct atm_vcc * atm_vcc, + unsigned long start, @@ -11376,13 +11374,16 @@ +#if 0 + { + // VBR temporary diags ++ unsigned int count = sprintf (page, "buckets:"); + unsigned int i; + for (i = 0; i < TX_CHANS; ++i) { + if (!left--) -+ return sprintf (page, "bucket %u: %u/%u\n", i, -+ query_tx_channel_config (dev, i, BUCKET_FULLNESS_ACCESS), -+ query_tx_channel_config (dev, i, BUCKET_CAPACITY_ACCESS)); ++ count += sprintf (page, " %u/%u", ++ query_tx_channel_config (dev, i, BUCKET_FULLNESS_ACCESS), ++ query_tx_channel_config (dev, i, BUCKET_CAPACITY_ACCESS)); + } ++ count += sprintf (page+count, ".\n"); ++ return count; + } +#endif + @@ -11412,8 +11413,8 @@ + hrz_open, + hrz_close, + NULL, // no hrz_ioctl -+ hrz_getsockopt, -+ hrz_setsockopt, ++ NULL, // hrz_getsockopt, ++ NULL, // hrz_setsockopt, + hrz_send, + hrz_sg_send, + NULL, // no send_oam - not in fact used yet @@ -11559,7 +11560,7 @@ + // writes to adapter memory (handles IRQ and SMP) + spin_lock_init (&dev->mem_lock); + -+ init_waitqueue_head(&dev->tx_queue); ++ init_waitqueue_head (&dev->tx_queue); + + // vpi in 0..4, vci in 6..10 + dev->atm_dev->ci_range.vpi_bits = vpi_bits; @@ -11669,7 +11670,7 @@ + hrz_devs = dev->prev; + + PRINTD (DBG_INFO, "closing %p (atm_dev = %p)", dev, dev->atm_dev); -+ hrz_shutdown (dev); ++ hrz_reset (dev); + atm_dev_deregister (dev->atm_dev); + free_irq (dev->irq, dev); + release_region (dev->iobase, HRZ_IO_EXTENT); @@ -11717,7 +11718,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/horizon.h Thu Jun 3 03:34:26 1999 ++++ work/drivers/atm/horizon.h Mon Jun 7 21:42:29 1999 @@ -0,0 +1,506 @@ +/* + Madge Horizon ATM Adapter driver. @@ -11760,7 +11761,7 @@ +#ifndef PCI_VENDOR_ID_MADGE +#define PCI_VENDOR_ID_MADGE 0x10B6 +#endif -+#ifndef PCI_VENDOR_ID_MADGE_HORIZON ++#ifndef PCI_DEVICE_ID_MADGE_HORIZON +#define PCI_DEVICE_ID_MADGE_HORIZON 0x1000 +#endif + @@ -12094,8 +12095,6 @@ + +#define memmap ((MEMMAP *)0) + -+#define BUF_PTR(cbptr) ((cbptr) - (cell_buf *) 0) -+ +/* end horizon specific bits */ + +typedef enum { @@ -12185,6 +12184,8 @@ + +/* macros for use later */ + ++#define BUF_PTR(cbptr) ((cbptr) - (cell_buf *) 0) ++ +#define INTERESTING_INTERRUPTS \ + (RX_DATA_AV | RX_DISABLED | TX_BUS_MASTER_COMPLETE | RX_BUS_MASTER_COMPLETE) + @@ -13271,8 +13272,8 @@ + +#endif /* _LINUX_NICSTAR_H_ */ --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/nicstar.c Thu Jun 3 03:36:31 1999 -@@ -0,0 +1,3054 @@ ++++ work/drivers/atm/nicstar.c Fri Jun 11 21:25:28 1999 +@@ -0,0 +1,3055 @@ +/****************************************************************************** + * + * nicstar.c @@ -14159,6 +14160,7 @@ + card->atmdev->ci_range.vci_bits = card->vcibits; + card->atmdev->link_rate = card->max_pcr; + ++ card->atmdev->phy = NULL; +#ifdef CONFIG_ATM_NICSTAR_USE_SUNI + if (card->max_pcr == ATM_OC3_PCR) { + suni_init(card->atmdev); @@ -20741,7 +20743,7 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/drivers/atm/zatm.c Thu Jun 3 03:36:11 1999 ++++ work/drivers/atm/zatm.c Fri Jun 11 21:37:28 1999 @@ -0,0 +1,1877 @@ +/* drivers/atm/zatm.c - ZeitNet ZN122x device driver */ + @@ -25311,7 +25313,7 @@ entry->last_used=jiffies; rif_table[hash]=entry; --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/Makefile Thu Jun 3 02:29:46 1999 ++++ work/net/atm/Makefile Fri Jun 11 21:45:18 1999 @@ -0,0 +1,68 @@ +# +# Makefile for the ATM Protocol Families. @@ -25330,8 +25332,8 @@ + +ifeq ($(CONFIG_ATM),y) + -+O_OBJS = addr.o pvc.o raw.o signaling.o svc.o # party.o -+OX_OBJS = common.o atm_misc.o resources.o ++O_OBJS = addr.o pvc.o signaling.o svc.o # party.o ++OX_OBJS = common.o atm_misc.o raw.o resources.o + +ifeq ($(CONFIG_MMU_HACKS),y) +O_OBJS += mmuio.o @@ -33354,14 +33356,15 @@ +#endif +} --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/raw.c Thu Jun 3 02:29:46 1999 -@@ -0,0 +1,80 @@ ++++ work/net/atm/raw.c Fri Jun 11 21:44:28 1999 +@@ -0,0 +1,84 @@ +/* net/atm/raw.c - Raw AAL0 and AAL5 transports */ + -+/* Written 1995-1998 by Werner Almesberger, EPFL LRC */ ++/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ + + +#include ++#include +#include +#include +#include @@ -33436,6 +33439,9 @@ + vcc->push_oam = NULL; + return 0; +} ++ ++ ++EXPORT_SYMBOL(atm_init_aal5); --- /dev/null Tue Jan 1 05:00:00 1980 +++ work/net/atm/resources.c Thu Jun 3 02:29:46 1999 @@ -0,0 +1,202 @@ diff -ur --new-file old/atm/doc/usage.tex new/atm/doc/usage.tex --- old/atm/doc/usage.tex Thu Jun 3 02:21:31 1999 +++ new/atm/doc/usage.tex Fri Jun 11 21:43:13 1999 @@ -1,7 +1,7 @@ %def%:= %:\begin{verbatim} -%:Usage instructions - ATM on Linux, release 0.60 +%:Usage instructions - ATM on Linux, release 0.61 %:------------------------------------------------- %: %:\end{verbatim} @@ -38,7 +38,7 @@ \title{ATM on Linux \\ User's guide \\ - Release 0.60 (alpha)} + Release 0.61 (alpha)} \author{Werner Almesberger \\ {\tt Werner.Almesberger@epfl.ch} \\ \\ @@ -82,7 +82,7 @@ In order to install this package, you need \begin{itemize} \item the package itself - \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.60.tar.gz} + \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.61.tar.gz} \item the Linux kernel, version 2.3.3, e.g. from \url{ftp://ftp.kernel.org/pub/linux/kernel/v2.3/linux-2.3.3.tar.gz} \item Perl, version 4 or 5 @@ -99,7 +99,7 @@ distribution: \begin{verbatim} -tar xfz atm-0.60.tar.gz +tar xfz atm-0.61.tar.gz \end{verbatim} and the kernel source: diff -ur --new-file old/atm/doc/usage.txt new/atm/doc/usage.txt --- old/atm/doc/usage.txt Thu Jun 3 04:20:33 1999 +++ new/atm/doc/usage.txt Fri Jun 11 22:49:02 1999 @@ -1,4 +1,4 @@ -%:Usage instructions - ATM on Linux, release 0.60 +%:Usage instructions - ATM on Linux, release 0.61 %:------------------------------------------------- %: %: @@ -20,7 +20,7 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.60.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.61.tar.gz - the Linux kernel, version 2.3.3, e.g. from ftp://ftp.kernel.org/pub/linux/kernel/v2.3/linux-2.3.3.tar.gz - Perl, version 4 or 5 @@ -36,7 +36,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.60.tar.gz +tar xfz atm-0.61.tar.gz and the kernel source: diff -ur --new-file old/atm/mkpatch new/atm/mkpatch --- old/atm/mkpatch Thu Jun 3 00:31:03 1999 +++ new/atm/mkpatch Fri Jun 11 22:48:43 1999 @@ -12,6 +12,8 @@ arch/i386/config.in #--- arch/alpha --------------------------------------------------------------- arch/alpha/config.in +#--- arch/ppc --------------------------------------------------------------- +arch/ppc/config.in #--- arch/sparc --------------------------------------------------------------- arch/sparc/config.in #--- drivers ------------------------------------------------------------------ .