diff -ur --new-file old/atm/CHANGES new/atm/CHANGES --- old/atm/CHANGES Fri Sep 27 22:09:22 1996 +++ new/atm/CHANGES Mon Oct 14 19:35:43 1996 @@ -1,3 +1,62 @@ +Version 0.19 to 0.20 (14-OCT-1996) +==================== + +Bug fixes +--------- + + - fixed a few typos and errors in the 0.18 to 0.19 change log + - signaling traces only included hl_type bytes instead of hl_length + bytes + - TNET1570 driver: various fixes (DMA allocation, seg ring overflow, + timeouts, etc.) (Christian Paetz) + - TNET1570 driver: removed most compiler warnings (Christian Paetz) + - listen() on an arequipa_preset() socket and arequipa_preset() on a listening + socket now both return EPROTO + - oops, forgot to enable the "rm" in make uninstall + - kernel didn't set interface number field in act_create messages to atmarpd + +New features +------------ + + - added ioctl ATM_SETSC to enable or disable RX and TX single-copy per VC + - new device driver operation change_qos (not yet implemented) + - TNET1570 driver supports DEC Alphas and 64 but PCI transfer (for CIA PCI + chipsets) (Christian Paetz) + - TNET1570 driver also supports the UniNET1570 board (Christian Paetz) + - new functions text2qos and qos2text to convert between textual and binary + QOS specifications (the format is described in man qos) + - atmarp -q ip_addr qos sets the default QOS to use for all VCs created for + that IP interface + - new utility debug/delay to use machine as AAL5-level delay line + +Other changes +------------- + + - NLPIDs and vendor-specific application identifiers are now collected in + the new file /usr/include/atmsap.h + - SO_ATMQOS now attempts to change the QOS settings when invoked on an active + connection + - included Matt Welsh's bigphysarea patch (this isn't related to ATM, but it + keeps my development source tree simpler) + - arequipa_preset now initializes max_sdu to RFC1626_MTU+RFC1483LLC_LEN if + zero + - atmarp: new option qos to set the QOS parameters (uses text2qos) + Use of pcr is deprecated. + - ttcp_atm's -P option now also accepts a QOS specification string. (use of + -P is deprecated. + - atmsigd: new option -q and configuration clause io qos to + set the QOS of the signaling VC. Use of -P or io pcr is + deprecated. + - removed the backward compatibility #define class traffic_class in + linux/atm.h + - removed obsolete keywords from atmsigd.conf language + - atmarp -a now also includes QOS parameters + - UBR now respects txtp.max_pcr if set + - new rules for the use of [rt]xtp.traffic_class: both fields must be either + equal or zero, e.g. ATM_CBR in TX and ATM_UBR in RX no longer works + - doc/usage.tex now points to the man pages instead of repeating their content + + Version 0.18 to 0.19 (27-SEP-1996) ==================== @@ -53,13 +112,13 @@ the EPFL OUI - moved buffer/queue handling from lib/libatmd to saal/, because it is rather SSCOP-specific anyway - - eni and zatm drivers now complain if rx_inuse != 0 when closing (if this - ever happens, it may point out dangerous races with upper layer protocols) + - atm_release_vcc now complains if rx_inuse != 0 when closing (if this ever + happens, it may point out dangerous races with upper layer protocols) - SO_ATMQOS now issues a warning when using UBR with {min,max}_pcr != 0 - max_sdu is now set by atmarpd to MTU+RFC1483LLC_LEN (atmarp could still override this, if necessary) - - atmdump: new option -i to display the arrival interval interval instead - of the absolute time. Also changed to time format to be more readable. + - atmdump: new option -i to display the arrival interval instead of the + absolute time. Also changed the time format to be more readable. - updated the kernel configuration documentation to indicate that the SMC ATM Power155 adapters are compatible with the Efficient ENI-155 - atmarpd now deletes the old table file (containing stale information) if diff -ur --new-file old/atm/Makefile new/atm/Makefile --- old/atm/Makefile Fri Aug 30 19:57:49 1996 +++ new/atm/Makefile Wed Oct 9 11:06:31 1996 @@ -1,7 +1,7 @@ # "qgen" and "saal" _must_ appear before "sigd" # "lib" must appear before anything else -DIRS=lib maint ip test debug qgen saal sigd arpd ilmid led lane aqd +DIRS=lib maint ip test debug qgen saal sigd arpd ilmid led lane aqd #ans all: for n in $(DIRS); do $(MAKE) -C $$n || exit; done diff -ur --new-file old/atm/README new/atm/README --- old/atm/README Fri Sep 27 22:48:21 1996 +++ new/atm/README Mon Oct 14 19:36:29 1996 @@ -1,4 +1,4 @@ -ATM on Linux, release 0.19 (pre-alpha) by Werner Almesberger, EPFL LRC +ATM on Linux, release 0.20 (pre-alpha) by Werner Almesberger, EPFL LRC ====================================== werner.almesberger@lrc.di.epfl.ch This is experimental software. There are known major bugs and certainly @@ -12,7 +12,7 @@ The following network devices are supported: ATM over TCP pseudo device for "dry runs" Efficient Networks ENI155p-MF/U5 155 Mbps ATM adapter - Rolf Fiedler's TNETA1570 board + Rolf Fiedler's TNETA1570 board / UniNET1570 Zeitnet ZN1221/ZN1225 155 Mbps ATM adapter The following connection types are supported: diff -ur --new-file old/atm/Rules.make new/atm/Rules.make --- old/atm/Rules.make Mon Sep 2 19:42:16 1996 +++ new/atm/Rules.make Thu Oct 10 23:15:45 1996 @@ -30,6 +30,7 @@ INSTMAN=$(INSTPREFIX)/man INSTMAN1=$(INSTMAN)/man1 INSTMAN4=$(INSTMAN)/man4 +INSTMAN7=$(INSTMAN)/man7 INSTMAN8=$(INSTMAN)/man8 # @@ -67,12 +68,13 @@ process 0644 $(INSTHDR) $(SYSHDR); \ process 0644 $(INSTMAN1) $(MAN1); \ process 0644 $(INSTMAN4) $(MAN4); \ + process 0644 $(INSTMAN7) $(MAN7); \ process 0644 $(INSTMAN8) $(MAN8) uninstall: @process() { if [ ! -z "$$2" ]; then dir=$$1; shift; \ echo "cd $$dir; rm -f $$*"; \ - cd $$dir; echo rm -f $$*; fi }; \ + cd $$dir; rm -f $$*; fi }; \ process $(INSTBOOTBIN) $(BOOTPGMS); \ process $(INSTSYSBIN) $(SYSPGMS); \ process $(INSTUSRBIN) $(USRPGMS); \ @@ -80,6 +82,7 @@ process $(INSTHDR) $(SYSHDR); \ process $(INSTMAN1) $(MAN1); \ process $(INSTMAN4) $(MAN4); \ + process $(INSTMAN7) $(MAN7); \ process $(INSTMAN8) $(MAN8) depend: diff -ur --new-file old/atm/USAGE new/atm/USAGE --- old/atm/USAGE Fri Sep 27 23:02:47 1996 +++ new/atm/USAGE Mon Oct 14 19:06:26 1996 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.19 (pre-alpha) +Usage instructions - ATM on Linux, release 0.20 (pre-alpha) ------------------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,7 +17,7 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.18.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.20.tar.gz - the Linux kernel, version 2.0.14, e.g. from ftp://ftp.cs.helsinki.fi/pub/Software/Linux/Kernel/v2.0/linux-2.0.14.tar.gz - Perl, version 4 or 5 @@ -33,7 +33,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.18.tar.gz +tar xfz atm-0.20.tar.gz and the kernel source: @@ -60,9 +60,11 @@ atm/led/ LAN Emulation demon: led atm/lane/ LAN Emulation servers: bus, lecs, les atm/aqd/ Arequipa demon: arequipad - atm/debug/ Debugging tools: ed, en, encopy, endump, zndump, and znth + atm/debug/ Debugging tools: delay, ed, en, encopy, endump, zndump, and + znth atm/lib/ Libraries for applications and demons atm/doc/ Documentation in LaTeX and conversion tools + atm/man/ Miscellaneous man pages Kernel configuration @@ -393,25 +395,9 @@ ------------------ On adapters where the device driver supports access to raw cells ("AAL0"), -individual cells can be composed and received with the atmdump program. -atmdump is invoked as follows for receiving cells: +individual cells can be composed and received with the atmdump program. - atmdump [.]. - -For composing cells, the invocation is as follows: - - atmdump -t [-g ] [-c] [.]. - - -t specifies the cell payload type indicator (PTI) value (0-7, - defined in [1]). A list of valid payload types can be obtained by - running atmdump without arguments. - -g specifies the generic flow control (GFC) value, 0-15. By - default, atmdump uses 0. - -c sets the cell loss priority (CLP) bit. By default, atmdump sends - cells with CLP=0. - -Also, atmdump expects the cell payload on standard input. If only less than -48 bytes can be read, the remaining space is padded with zero bytes. +Man page: atmdump.8 Example: @@ -445,7 +431,7 @@ 47.0005.80FFE1000000F21A26D8.0020D4102A80.00 pc3-a.fqdn pc3-a The numeric address can be specified in any of the formats described in -[2]. The numeric address(es) of a Linux system can be determined with the +[1]. The numeric address(es) of a Linux system can be determined with the command atmaddr -n (see also section "Manual address configuration"). Many ATM tools also attempt to find the corresponding name when displaying @@ -464,36 +450,10 @@ Signaling demon --------------- -The signaling demon is started as follows - - # atmsigd [-b] [-c ] [-d] [-D ] [-l ] - [-n] [-N] [-P ] [-t ] - - -b background. Run in a forked child process after initializing. - -c use the specified configuration file instead of - /etc/atmsigd.conf - -d enables (lots of) debugging output. By default, atmsigd is - comparably quiet. - -D specifies the directory to which atmsigd will write - status and trace dumps. If tracing is not yet enabled, the trace size - is automatically set to a (small) default value. - -l write diagnostic messages to the specified file instead - of to standard error. The special name syslog is used to send - diagnostics to the system logger. - -n prints addresses in numeric format only, i.e. no address to name - translation is attempted. - -N makes atmsigd behave like the network side of the UNI (useful if - you have two PCs but no switch). Normally, it acts as the user side. - -P configures the signaling VC to use CBR at the specified peak - cell rate. By default, UBR is used on the signaling VC. - -t enables tracing and sets the number of entries that - should be kept in the trace buffer. omitted. - -If atmsigd is killed, all system calls requiring interaction with it will -return with an error and set errno to EUNATCH. +Man pages: atmsigd.8, atmsigd.conf.4 -Note that atmsigd provides only very limited functionality. Signaling is -known to work for Classical IP over ATM with a Fore ASX-200 switch. +Note that atmsigd's support for point-to-multipoint is very limited: only +operation as a single leaf of a point-to-multipoint tree works. By default, atmsigd is configured to conform to UNI 3.0. It can be compiled for UNI 3.1 by changing the STANDARDS= line at the beginning of @@ -547,27 +507,10 @@ If your switch doesn't support ILMI, you have to set the ATM address manually on the switch and on the PC(s). On the Linux side, make sure that -ilmid doesn't run, then use the atmaddr command to set the address: - - # atmaddr -a [] +ilmid doesn't interfere, then use the atmaddr command to set the +address(es). -e.g. - -# atmaddr -a 47.0005.80.ffe100.0000.f215.1065.0020EA000755.00 - -atmaddr without arguments shows the current local addresses. They are -printed in numeric format only if the option -n is given. Addresses can -be deleted with - - # atmaddr -d [] - -The whole list of local addresses of an interface can be reset (i.e. -erased) with - - # atmaddr -r [] - -atmaddr always defaults to interface zero if the interface number is -omitted. +Man pages: atmaddr.8 Manual configuration of ATM addresses on the switch depends on the brand. On a Fore ASX-200, it can be done with the following command: @@ -603,32 +546,32 @@ % echo 09 03 80 00 05 5A 80 00 06 08 80 00 02 81 83 00 48 \ 00 00 08 | ./q.dump -_pdsc = 9 +_pdsc = 9 "Q.2931 user-network call/connection control message" _cr_len = 3 call_ref = 8388613 (0x800005) -msg_type = 90 (0x5a) +msg_type = 0x5a "RELEASE COMPLETE" _ext = 1 -_flag = 0 -_action_ind = 0 +_flag = 0 "instruction field not significant" +_action_ind = 0 "clear call" msg_len = 6 (0x6) - _ie_id = ATM_IE_CAUSE + _ie_id = 0x08 "Cause" _ext = 1 - _cs = 0 - _flag = 0 - _action_ind = 0 + cause_cs = 0 "ITU-T standardized" + _flag = 0 "instruction field not significant" + _action_ind = 0 "clear call" _ie_len = 2 (0x2) _ext = 1 - location = 1 (0x1) + location = 1 "private network serving the local user" _ext = 1 - cause = ATM_CV_NO_ROUTE_DEST + cause = 3 "no route to destination" IP over ATM =========== IP over ATM is supported using two modules:* the CLIP module only supports -PVCs and only handles encapsulation according to RFC1483 [3]. InARP -(defined in RFC1577 [4]) is not supported by this mechanism. +PVCs and only handles encapsulation according to RFC1483 [2]. InARP +(defined in RFC1577 [3]) is not supported by this mechanism. * The term "module" is used here for a functional software component, not for a loadable kernel module. @@ -654,11 +597,7 @@ For a better but still immature mechanism see section "ATMARP demon". First, the VCCs have to be established. Become root on both machines and -run the clip program (see also on the man page) on each of them: - - # clip [-0] [.]. [] - -e.g. +run clip (see clip.8) on each of them, e.g.: a# clip 0.40 b# clip 0.40 @@ -693,20 +632,7 @@ actual kernel part maintains a small lookup table only containing partial information. -The ATMARP demon is started as follows - - # atmarpd [-b] [-d] [-D ] [-l ] [-n] - - -b background. Run in a forked child process after initializing. - -d enables (lots of) debugging output. By default, atmarpd is - comparably quiet. - -D changes the directory where atmarpd writes its table - (see below). By default, /var/run is used. - -l write diagnostic messages to the specified file instead - of to standard error. The special name syslog is used to send - diagnostics to the system logger. - -n prints addresses in numeric format only, i.e. no address to name - translation is attempted. +Man pages: atmarpd.8, atmarp.8 atmsigd and ilmid must already be running when atmarpd is started. Use the -b option to make sure they're properly synchronized, e.g. @@ -727,10 +653,6 @@ frequently doesn't (yet). -atmarpd implements a variant of ATMARP as defined in RFC1577 and RFC1755 -[5]. There are still several known errors and protocol violations. (And -probably a lot of unknown problems too.) - The atmarp program is used to configure ATMARP. First, you have to start atmsigd, ilmid, and atmarpd, then create an IP interface and configure it: @@ -744,14 +666,7 @@ # ifconfig atm0 10.0.0.3 up # route add -net 10.0.0.0 -If atmarp -c is used without specifying an interface, it allocates the -next available interface and prints its name on standard output. - -If only PVCs will be used, they can now be created with - - # atmarp -s [temp] [null] - -e.g. +If only PVCs will be used, they can now be created with a command like # atmarp -s 10.0.0.4 0.0.70 @@ -759,18 +674,11 @@ ARP requires LLC/SNAP encapsulation. NULL encapsulation can therefore only be used for PVCs. -Permanent entries will never time out and therefore do not generate any ARP -traffic, but atmarpd responds if the other party sends InARP requests. - When using SVCs, some additional configuration work may be necessary. If the machine is acting as the ATMARP server on that LIS, no additional configuration is necessary. Otherwise, the ATM address of the ATMARP server has to be configured. This is done by creating an entry for the network -address with the option arpsrv set: - - # atmarp -s arpsrv - -e.g. +address with the option arpsrv set, e.g. # atmarp -s \ 10.0.0.0 47.0005.80.ffe100.0000.f215.1065.0020EA000756.00 \ @@ -779,19 +687,6 @@ Note that the ATMARP server currently has to be started and configured before any clients are configured. -Additional SVC entries can be created with - - # atmarp -s - -There is also a (probably not very useful) temp option for SVCs. All -atmarp -s commands also accept an option pcr to change the -connection to CBR (default is UBR) and to set the peak cell rate. - - # atmarp -d - -deletes ARP entries. The option arpsrv has to be specified for deleting -the ARP server entry. - The kernel ATMARP table can be read via /proc/atm/arp. The table used by atmarpd is regularly printed on standard error if atmarpd is started with the -d option. If atmarpd is invoked without -d , the table is written @@ -807,24 +702,18 @@ as support for broadcasts. LANE client support is described in the file atm/led/USAGE, LANE server support is described in atm/lane/USAGE. +Man pages: bus.8, lecs.8, les.8, and zeppelin.8 + Arequipa -------- -Arequipa (Application REQUested IP over ATM, [6]) is an extension to IP +Arequipa (Application REQUested IP over ATM, [4]) is an extension to IP over ATM that adds support for using direct ATM connections (with QOS parameters, etc.) to carry traffic between INET sockets. On a system that -should use Arequipa connections, the Arequipa demon has to be started: - - # arequipad [-b] [-d] [-l ] [-n] +should use Arequipa connections, the Arequipa demon has to run. - -b background. Run in a forked child process after initializing. - -d enables debugging output. By default, arequipad is very quiet. - -l write diagnostic messages to the specified file instead - of to standard error. The special name syslog is used to send - diagnostics to the system logger. - -n prints addresses in numeric format only, i.e. no address to name - translation is attempted. +Man page: arequipad.8 The status of Arequipa connections is shown in /proc/atm/arequipa. @@ -848,17 +737,12 @@ References ========== - [1] ITU-T Recommendation I.361. B-ISDN ATM layer specification, ITU, - 1993. - [2] Almesberger, Werner. Linux ATM API, + [1] Almesberger, Werner. Linux ATM API, ftp://lrcftp.epfl.ch/pub/linux/atm/api/ , July 1996. - [3] Heinanen, Juha. Multiprotocol Encapsulation over ATM Adaptation + [2] Heinanen, Juha. Multiprotocol Encapsulation over ATM Adaptation Layer 5, RFC1483, July 1993. - [4] Laubach, Mark. Classical IP and ARP over ATM, RFC1577, January + [3] Laubach, Mark. Classical IP and ARP over ATM, RFC1577, January 1994. - [5] RFC1755; Perez, Maryann; Liaw, Fong-Ching; Mankin, Allison; Hoffman, - Eric; Grossman, Dan; Malis, Andrew. ATM Signaling Support for IP over - ATM, IETF, 1995. - [6] Almesberger, Werner; Le Boudec, Jean-Yves; Oechslin, Philippe. + [4] Almesberger, Werner; Le Boudec, Jean-Yves; Oechslin, Philippe. Application REQuested IP over ATM (AREQUIPA) (work in progress), Internet Draft draft-almesberger-arequipa-01.txt , June 1996. diff -ur --new-file old/atm/VERSION new/atm/VERSION --- old/atm/VERSION Thu Sep 26 19:26:36 1996 +++ new/atm/VERSION Sat Sep 28 07:47:48 1996 @@ -1 +1 @@ -0.19 +0.20 diff -ur --new-file old/atm/aqd/io.c new/atm/aqd/io.c --- old/atm/aqd/io.c Fri Sep 27 22:20:14 1996 +++ new/atm/aqd/io.c Tue Oct 1 17:29:45 1996 @@ -19,6 +19,7 @@ #include "atm.h" #include "atmd.h" +#include "atmsap.h" #include "io.h" diff -ur --new-file old/atm/arpd/arp.c new/atm/arpd/arp.c --- old/atm/arpd/arp.c Thu Sep 26 20:53:01 1996 +++ new/atm/arpd/arp.c Thu Oct 10 22:38:50 1996 @@ -467,11 +467,7 @@ "(%d -> %d)",entry->itf->number,itf->number); if (!entry->addr) entry->addr = alloc(sizeof(*addr)); *entry->addr = *addr; - /* need to revise this policy if we get user-settable QOS @@@ */ - memset(&entry->qos,0,sizeof(entry->qos)); - entry->qos.txtp.traffic_class = ATM_UBR; - entry->qos.txtp.max_sdu = RFC1483LLC_LEN+RFC1626_MTU; - entry->qos.rxtp = entry->qos.txtp; + entry->qos = entry->itf->qos; for (walk = entry->vccs; walk; walk = walk->next) if (!walk->connecting) if (set_ip(walk->fd,ip) < 0) @@ -799,6 +795,12 @@ } switch (cmd) { case SIOCSARP: + if (req->arp_flags & ATF_DEFQOS) { + diag(COMPONENT,DIAG_DEBUG,"got SIOCSARP ATF_DEFQOS for itf %d", + itf_num); + itf->qos = req->arp_qos; + return 0; + } if (atm2text(buffer,MAX_ATM_ADDR_LEN+1, (struct sockaddr *) &req->arp_ha,pretty) < 0) { diag(COMPONENT,DIAG_ERROR,"a2t fails on SIOCSARP"); @@ -807,6 +809,7 @@ diag(COMPONENT,DIAG_DEBUG,"got SIOCSARP for itf %d, IP %d.%d.%d.%d" ", ATM %s, flags 0x%x",itf_num,ipp[0],ipp[1],ipp[2],ipp[3],buffer, req->arp_flags); + if (!req->arp_qos.txtp.traffic_class) req->arp_qos = itf->qos; switch (req->arp_ha.sas_family) { case AF_ATMPVC: adjust_qos(itf,&req->arp_qos,req->arp_flags & ATF_NULL); diff -ur --new-file old/atm/arpd/atmarpd.8 new/atm/arpd/atmarpd.8 --- old/atm/arpd/atmarpd.8 Mon Sep 2 19:38:17 1996 +++ new/atm/arpd/atmarpd.8 Mon Oct 14 18:54:42 1996 @@ -1,4 +1,4 @@ -.TH ATMARPD 8 "Sep 2, 1996" "Linux" "Maintenance Commands" +.TH ATMARPD 8 "Oct 14, 1996" "Linux" "Maintenance Commands" .SH NAME atmarpd \- ATMARP demon .SH SYNOPSIS @@ -46,6 +46,7 @@ .TP 25 .B /var/run/atmarpd.table ATMARP table +.TP 25 .B /proc/atm/arp table of currently active IP over ATM VCs .PD diff -ur --new-file old/atm/arpd/itf.c new/atm/arpd/itf.c --- old/atm/arpd/itf.c Thu Sep 26 16:46:49 1996 +++ new/atm/arpd/itf.c Thu Oct 10 23:29:40 1996 @@ -5,6 +5,7 @@ #include #include +#include #include "atmd.h" @@ -60,6 +61,10 @@ return; } itf->number = number; + memset(&itf->qos,0,sizeof(struct atm_qos)); + itf->qos.txtp.traffic_class = ATM_UBR; + itf->qos.txtp.max_sdu = RFC1483LLC_LEN+RFC1626_MTU; + itf->qos.rxtp = itf->qos.txtp; itf->table = itf->arp_srv = NULL; Q_INSERT_HEAD(itfs,itf); } diff -ur --new-file old/atm/arpd/table.c new/atm/arpd/table.c --- old/atm/arpd/table.c Thu Sep 26 20:39:29 1996 +++ new/atm/arpd/table.c Sun Oct 13 19:04:39 1996 @@ -113,16 +113,17 @@ "netmask","NULL","ARPSRV" }; /* lower case flags are not used by ATMARP */ ENTRY *entry; VCC *vcc; - char buffer[MAX_ATM_ADDR_LEN+1]; + char addr_buf[MAX_ATM_ADDR_LEN+1]; + char qos_buf[MAX_ATM_QOS_LEN+1]; char tmp[100]; /* large enough for all flags */ unsigned char *ipp; int i; for (entry = list; entry ; entry = entry->next) { - if (!entry->addr) strcpy(buffer,""); - else if (atm2text(buffer,MAX_ATM_ADDR_LEN+1, + if (!entry->addr) strcpy(addr_buf,""); + else if (atm2text(addr_buf,MAX_ATM_ADDR_LEN+1, (struct sockaddr *) entry->addr,pretty) < 0) - strcpy(buffer,""); + strcpy(addr_buf,""); ipp = (unsigned char *) &entry->ip; *tmp = 0; for (i = 0; i < 8; i++) @@ -131,8 +132,13 @@ strcat(tmp,flag_name[i]); } output("IP %d.%d.%d.%d, state %s, addr %s, flags 0x%x<%s>",ipp[0], - ipp[1],ipp[2],ipp[3],entry_state_name[entry->state],buffer, + ipp[1],ipp[2],ipp[3],entry_state_name[entry->state],addr_buf, entry->flags,tmp); + if (entry->itf && !qos_equal(&entry->itf->qos,&entry->qos)) { + if (qos2text(qos_buf,sizeof(qos_buf),&entry->qos,0) < 0) + strcpy(qos_buf,""); + output(" QOS: %s",qos_buf); + } for (vcc = entry->vccs; vcc; vcc = vcc->next) dump_vcc(vcc); } } @@ -141,10 +147,13 @@ static void dump_itf(ITF *itf) { unsigned char *ipp; + char buf[MAX_ATM_QOS_LEN+1]; + if (qos2text(buf,sizeof(buf),&itf->qos,0) < 0) strcpy(buf,""); ipp = (unsigned char *) &itf->local_ip; output("----- Itf %d (%d.%d.%d.%d) -----",itf->number,ipp[0],ipp[1], ipp[2],ipp[3]); + output("Default QOS: %s",buf); dump_entries(itf->table); } diff -ur --new-file old/atm/arpd/table.h new/atm/arpd/table.h --- old/atm/arpd/table.h Thu Sep 26 16:46:22 1996 +++ new/atm/arpd/table.h Thu Oct 10 22:25:43 1996 @@ -51,6 +51,7 @@ unsigned long netmask; int number; int mtu; + struct atm_qos qos; /* default QOS */ ENTRY *table; ENTRY *arp_srv; /* NULL is none */ struct _itf *prev,*next; diff -ur --new-file old/atm/atm.patch new/atm/atm.patch --- old/atm/atm.patch Fri Sep 27 23:25:01 1996 +++ new/atm/atm.patch Mon Oct 14 20:04:44 1996 @@ -20,11 +20,27 @@ ls *.o > .allmods; \ echo $$MODULES | tr ' ' '\n' | sort | comm -23 .allmods - > .misc; \ --- ref/Documentation/Configure.help Wed Aug 7 08:45:41 1996 -+++ work/Documentation/Configure.help Thu Sep 26 19:32:46 1996 -@@ -1182,6 +1182,111 @@ ++++ work/Documentation/Configure.help Fri Oct 4 13:14:30 1996 +@@ -670,6 +670,14 @@ + say "386" or "486" here even if running on a Pentium or PPro + machine. If you don't know what to do, say "386". + ++Support for big physical area reservation ++CONFIG_BIGPHYS_AREA ++ Enables kernel support for reserving large areas of physical memory ++ at boot-time for use by certain device drivers (such as video ++ framegrabbers, etc.) which require it. To use this feature, boot ++ the kernel with the boot-time option 'bigphysarea=nnn' where ++ 'nnn' is the number of pages (a page is usually 4K) to reserve. ++ + Compile the kernel into the ELF object format + CONFIG_ELF_KERNEL + ELF (Executable and Linkable Format) is a format for libraries and +@@ -1181,6 +1189,111 @@ + with major number 36 and minor number 0 using mknod ("man mknod"), you can read some network related routing information from that file. Everything you write to that file will be discarded. - ++ +Asynchronous Transfer Mode (ATM) +CONFIG_ATM + You are likely to want to enable this. @@ -129,23 +145,25 @@ + using printks, but still has some impact on performance. Note that + extended debugging may create certain race conditions itself. Enable + this ONLY if you suspect problems with the driver. -+ + SCSI support? CONFIG_SCSI - If you want to use a SCSI harddisk, SCSI tapedrive, SCSI CDROM or --- ref/kernel/ksyms.c Thu Jul 18 13:28:48 1996 -+++ work/kernel/ksyms.c Thu Aug 29 15:36:29 1996 -@@ -63,6 +63,9 @@ ++++ work/kernel/ksyms.c Fri Oct 4 13:14:32 1996 +@@ -63,6 +63,12 @@ #ifdef __SMP__ #include #endif +#ifdef CONFIG_ATM +#include +#endif ++#ifdef CONFIG_BIGPHYS_AREA ++#include ++#endif extern char *get_options(char *str, int *ints); extern void set_device_ro(int dev,int flag); -@@ -77,6 +80,10 @@ +@@ -77,6 +83,10 @@ extern void hard_reset_now(void); @@ -156,7 +174,21 @@ struct symbol_table symbol_table = { #include #ifdef MODVERSIONS -@@ -351,7 +358,16 @@ +@@ -138,6 +148,13 @@ + X(high_memory), + X(update_vm_cache), + ++#ifdef CONFIG_BIGPHYS_AREA ++ /* Large physical area memory management */ ++ X(bigphysarea_alloc), ++ X(bigphysarea_free), ++ X(bigphysarea), ++#endif ++ + /* filesystem internal functions */ + X(getname), + X(putname), +@@ -351,7 +368,16 @@ #ifdef CONFIG_BLK_DEV_MD X(disk_name), /* for md.c */ #endif @@ -175,18 +207,27 @@ X(get_write_access), X(put_write_access), --- ref/arch/i386/config.in Mon May 13 06:17:23 1996 -+++ work/arch/i386/config.in Wed Aug 21 10:55:35 1996 -@@ -72,6 +72,10 @@ - endmenu - fi ++++ work/arch/i386/config.in Fri Oct 4 13:14:31 1996 +@@ -43,6 +43,8 @@ + 486 CONFIG_M486 \ + Pentium CONFIG_M586 \ + PPro CONFIG_M686" Pentium ++# Added by M. Welsh ++bool 'Support for big physical area reservation' CONFIG_BIGPHYS_AREA + endmenu -+if [ "$CONFIG_ATM" = "y" ]; then -+ source drivers/atm/Config.in + source drivers/block/Config.in +@@ -70,6 +72,10 @@ + source drivers/net/Config.in + fi + endmenu +fi + - mainmenu_option next_comment - comment 'ISDN subsystem' ++if [ "$CONFIG_ATM" = "y" ]; then ++ source drivers/atm/Config.in + fi + mainmenu_option next_comment --- ref/arch/sparc/config.in Thu Apr 25 12:22:05 1996 +++ work/arch/sparc/config.in Wed Aug 21 10:55:35 1996 @@ -100,6 +100,12 @@ @@ -371,8 +412,8 @@ + return devs; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/atmtcp.c Wed Aug 21 10:55:37 1996 -@@ -0,0 +1,316 @@ ++++ work/drivers/atm/atmtcp.c Fri Oct 4 13:02:24 1996 +@@ -0,0 +1,317 @@ +/* drivers/atm/atmtcp.c - ATM over TCP "device" driver */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -634,7 +675,8 @@ + NULL, /* no send_oam */ + NULL, /* no phy_put */ + NULL, /* no phy_get */ -+ NULL /* no feedback */ ++ NULL, /* no feedback */ ++ NULL /* no change_qos */ +}; + + @@ -690,8 +732,8 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/eni.c Fri Sep 27 16:16:48 1996 -@@ -0,0 +1,1949 @@ ++++ work/drivers/atm/eni.c Sun Oct 13 18:45:49 1996 +@@ -0,0 +1,1952 @@ +/* drivers/atm/eni.c - Efficient Networks ENI155P device driver */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -1838,14 +1880,17 @@ + struct eni_vcc *eni_vcc; + unsigned long size,mem; + int tx_ind,pcr,order; ++ int unlimited; + + eni_dev = ENI_DEV(vcc->dev); + eni_vcc = ENI_VCC(vcc); + eni_vcc->tx = NULL; + if (vcc->qos.txtp.traffic_class == ATM_NONE) return 0; + eni_vcc->txing = 0; -+ if (vcc->qos.txtp.traffic_class != ATM_UBR) -+ size = vcc->qos.txtp.max_sdu*3; /* @@@ improve */ ++ unlimited = vcc->qos.txtp.traffic_class == ATM_UBR && ++ (!vcc->qos.txtp.max_pcr || vcc->qos.txtp.max_pcr == ATM_MAX_PCR || ++ vcc->qos.txtp.max_pcr >= ATM_OC3_PCR); ++ if (!unlimited) size = vcc->qos.txtp.max_sdu*3; /* @@@ improve */ + else { + if (eni_dev->ubr) { + eni_vcc->tx = eni_dev->ubr; @@ -1859,14 +1904,13 @@ + mem = eni_alloc_mem(eni_dev,&size); + if (!mem) return -ENOBUFS; + if ((tx_ind = alloc_tx(eni_dev,&pcr,vcc->qos.txtp.min_pcr, -+ vcc->qos.txtp.max_pcr,vcc->qos.txtp.traffic_class == ATM_UBR)) < 0) -+ { ++ vcc->qos.txtp.max_pcr,unlimited)) < 0) { + eni_free_mem(eni_dev,mem,size); + return tx_ind; + } -+ if (vcc->qos.txtp.traffic_class == ATM_UBR) -+ eni_dev->ubr = &eni_dev->tx[tx_ind]; ++ if (unlimited) eni_dev->ubr = &eni_dev->tx[tx_ind]; + else eni_dev->tx_bw -= pcr; ++ if (pcr > ATM_OC3_PCR) pcr = ATM_OC3_PCR; + vcc->qos.txtp.min_pcr = vcc->qos.txtp.max_pcr = pcr; + eni_dev->tx[tx_ind].send = (volatile unsigned long *) mem; + eni_dev->tx[tx_ind].words = size >> 2; @@ -2575,7 +2619,8 @@ + NULL, /* no send_oam */ + eni_phy_put, + eni_phy_get, -+ NULL /* no feedback */ ++ NULL, /* no feedback */ ++ NULL /* no change_qos */ +}; + + @@ -2642,7 +2687,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/eni.h Fri Sep 27 15:21:16 1996 ++++ work/drivers/atm/eni.h Thu Oct 10 19:03:46 1996 @@ -0,0 +1,113 @@ +/* drivers/atm/eni.h - Efficient Networks ENI155P device driver declarations */ + @@ -3327,7 +3372,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/suni.h Fri Sep 27 15:21:16 1996 ++++ work/drivers/atm/suni.h Thu Oct 10 19:03:46 1996 @@ -0,0 +1,219 @@ +/* drivers/atm/suni.h - PMC SUNI (PHY) declarations */ + @@ -4207,8 +4252,8 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/zatm.c Fri Sep 27 14:25:13 1996 -@@ -0,0 +1,1841 @@ ++++ work/drivers/atm/zatm.c Sun Oct 13 18:47:54 1996 +@@ -0,0 +1,1844 @@ +/* drivers/atm/zatm.c - ZeitNet ZN122x device driver */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -5288,7 +5333,7 @@ + struct zatm_vcc *zatm_vcc; + unsigned long flags,*loop; + unsigned short chan; -+ int pcr; ++ int pcr,unlimited; + + DPRINTK("open_tx_first\n"); + zatm_dev = ZATM_DEV(vcc->dev); @@ -5305,17 +5350,19 @@ + restore_flags(flags); + DPRINTK("chan is %d\n",chan); + if (!chan) return -EAGAIN; -+ if (vcc->qos.txtp.traffic_class == ATM_UBR && zatm_dev->ubr != -1) -+ zatm_vcc->shaper = zatm_dev->ubr; ++ unlimited = vcc->qos.txtp.traffic_class == ATM_UBR && ++ (!vcc->qos.txtp.max_pcr || vcc->qos.txtp.max_pcr == ATM_MAX_PCR || ++ vcc->qos.txtp.max_pcr >= ATM_OC3_PCR); ++ if (unlimited && zatm_dev->ubr != -1) zatm_vcc->shaper = zatm_dev->ubr; + else { -+ if (vcc->qos.txtp.traffic_class == ATM_UBR) -+ vcc->qos.txtp.max_sdu = ATM_MAX_AAL5_PDU; ++ if (unlimited) vcc->qos.txtp.max_sdu = ATM_MAX_AAL5_PDU; + if ((zatm_vcc->shaper = alloc_shaper(vcc->dev,&pcr, -+ vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr, -+ vcc->qos.txtp.traffic_class == ATM_UBR)) < 0) { ++ vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,unlimited)) ++ < 0) { + close_tx(vcc); + return zatm_vcc->shaper; + } ++ if (pcr > ATM_OC3_PCR) pcr = ATM_OC3_PCR; + vcc->qos.txtp.min_pcr = vcc->qos.txtp.max_pcr = pcr; + } + zatm_vcc->tx_chan = chan; @@ -5984,7 +6031,8 @@ + NULL, /* no send_oam */ + zatm_phy_put, + zatm_phy_get, -+ zatm_feedback ++ zatm_feedback, ++ NULL /* no change_qos */ +}; + + @@ -6051,7 +6099,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/zatm.h Fri Sep 27 15:21:47 1996 ++++ work/drivers/atm/zatm.h Thu Oct 10 19:04:13 1996 @@ -0,0 +1,172 @@ +/* drivers/atm/zatm.h - ZeitNet ZN122x device driver declarations */ + @@ -6263,8 +6311,8 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/tneta1570.h Wed Aug 21 10:55:41 1996 -@@ -0,0 +1,310 @@ ++++ work/drivers/atm/tneta1570.h Thu Oct 10 19:04:41 1996 +@@ -0,0 +1,390 @@ +/* drivers/atm/tneta1570.h - TI TNETA1570 (SAR) declarations */ + +/* Written 1996 by Rolf Fiedler @@ -6296,14 +6344,29 @@ +#ifndef PCI_VENDOR_ID_TI +#define PCI_VENDOR_ID_TI 0x104c +#endif -+#ifndef PCI_DEVICE_ID_TI_TNETA1570 ++#ifndef PCI_DEVICE_ID_TI_TNETA1570 +#define PCI_DEVICE_ID_TI_TNETA1570 0xa001 +#endif ++#ifndef PCI_DEVICE_ID_TI_TNETA1575 ++#define PCI_DEVICE_ID_TI_TNETA1575 0xa102 ++#endif ++ + -+#define KERNEL_OFFSET 0xc0000000 /* kernel 0 is at linear 0xc0000000 */ -+#define DEV_LABEL "tneta1570" ++#define DEV_LABEL "tneta157x" +#define RAM_INCREMENT 1024 /* check in 4 kB increments */ + ++#ifdef CONFIG_ALPHA_CIA ++#define TNETA1570_MEM_OFFSET CIA_DENSE_MEM ++#define TNETA_ALIGN 7 ++#elif CONFIG_ALPHA_LCA ++#define TNETA1570_MEM_OFFSET LCA_DENSE_MEM ++#define TNETA_ALIGN 7 ++#else ++#define TNETA1570_MEM_OFFSET 0 ++#define TNETA_ALIGN 3 ++#endif ++ ++ +/*---------------------------------------------------------*/ + +/* transmit DMA state table, in control memory */ @@ -6346,11 +6409,18 @@ +#define RX_HDR 20 +#define MAX_FBR_ENTRIES 256 +struct tneta_rx_fbrptr { -+ unsigned int * buf_ptr; ++ unsigned int buf_ptr; + unsigned int buf_size; +}; + -+#define AAL5_IND (1<<26) ++#define AAL5_IND (1<<26) ++#define PAKET_OVERFLOW (1<<31) ++#define CRC_ERROR (1<<30) ++#define BUFFER_STARV (1<<29) ++#define RX_TIMEOUT (1<<28) ++#define RX_ABORT (1<<27) ++#define RX_ERRORCOND 0xf000 ++ +struct tneta_rx_compl { + unsigned int atm_header; + unsigned int error; @@ -6421,20 +6491,21 @@ + struct atm_dev *more; /* other TNETA devices */ + /*-------------------------------- general information */ + -+ volatile unsigned long *ram; /* base of phy device */ -+ volatile unsigned long *scheduler; /* base of scheduler table */ ++ volatile unsigned int *ram; /* base of phy device */ ++ volatile unsigned int *scheduler; /* base of scheduler table */ + volatile unsigned int *reg; /* base of sar regs device */ + volatile struct tneta_rx_fbrptr *free_buf_ptr; /* free buffer pointers */ -+ volatile unsigned long *rx_vpi_vci; /* rx vpi vci table */ ++ volatile unsigned int *rx_vpi_vci; /* rx vpi vci table */ + volatile struct tneta_tx_dma_state_table *tx_dma_state; /* tx dma state table */ + volatile struct tneta_rx_dma_state_table *rx_dma_state; /* rx dma state table */ -+ volatile unsigned long *phy; /* base of phy device */ ++ volatile unsigned int *phy; /* base of phy device */ + + int mem; /* RAM on board (in bytes) */ + void * base; /* board base address */ + unsigned long base_diff; /* virtual - phy base address */ + unsigned int pci_map_size; /* pci map size of board */ + unsigned char irq; /* IRQ */ ++ unsigned char chiptype; /* 1570 = 0, 1575 = 1 */ + unsigned char bus; /* PCI stuff */ + unsigned char dev_fn; +}; @@ -6445,6 +6516,34 @@ + +/*---------------------------------------------------------*/ + ++#include ++ ++#define TNETA_LOOP _IOW('a',ATMIOC_SARPRV+1,int) ++ /* set/reset tneta loopback mode*/ ++#define TNETA_INVHEC _IOW('a',ATMIOC_SARPRV+2,long) ++ /* set/reset inverse HEC generation */ ++#define TNETA_ENTX _IOW('a',ATMIOC_SARPRV+3,long) ++ /* enable/disab txing */ ++#define TNETA_ENRX _IOW('a',ATMIOC_SARPRV+4,long) ++ /* enable/disabable rxing */ ++#define TNETA_BP _IOW('a',ATMIOC_SARPRV+5,long) ++ /* intr per paket or per buffer ring */ ++#define TNETA_RAT _IOW('a',ATMIOC_SARPRV+6,int) ++ /* enable/disable rx aging timer*/ ++#define TNETA_RXUNKN _IOR('a',ATMIOC_SARPRV+7,unsigned long) ++ /* header of an unknown received cell */ ++#define TNETA_HECERR _IOR('a',ATMIOC_SARPRV+8, unsigned long) ++ /* number of HEC errors received */ ++#define TNETA_AAL5DISC _IOR('a',ATMIOC_SARPRV+9, unsigned long) ++ /* number of AAL 5 pdus discarded by tneta */ ++#define TNETA_RXCELL _IOR('a',ATMIOC_SARPRV+10, unsigned long) ++ /* number of cells received */ ++#define TNETA_TXCELL _IOR('a',ATMIOC_SARPRV+11, unsigned long) ++ /* number of cells transmitted */ ++ ++ ++ ++ +/* + * Directly Addressable Registers, memory mapped + */ @@ -6467,9 +6566,25 @@ +#define TNETA_CELL_RXC 10 /* ATM Cells RX'd # */ +#define TNETA_CELL_TXC 11 /* ATM Cells TX'd # */ +#define TNETA_S_TXM_RXM 24 /* 12L TX FIFO & RX FIFO max occupancy */ ++#define TNETA_TXM_RXM 12 /* TX FIFO & RX FIFO for 1575 */ +#define TNETA_S_VCIM 25 /* 12H VCI mask */ +#define TNETA_S_SCHEDSIZE 26 /* 13L scheduler-table-size register */ ++#define TNETA_SCHEDSIZE 13 /* scheduler-table-size register 1575 only */ +#define TNETA_RESET 14 /* software reset register */ ++#define TNETA_TXQUEUE 15 /* TX queue register 1575 only*/ ++#define TNETA_RXCOMPLCNT 16 /* RX compl ring count 1575 only */ ++#define TNETA_SIDEFBR1CNT 17 /* sideband free buffer ring cnt 1575 only */ ++#define TNETA_SIDEFBR2CNT 18 /* sideband free buffer ring cnt1575 only */ ++#define TNETA_RXTRES 19 /* rx compl ring threshold 1575 only */ ++#define TNETA_SIDERXTRES 20 /* sideband free buffer ring thresh 1575 only */ ++#define TNETA_SIDEFBR1PTR 21 /* sideband free buffer ring ptr 1575 only */ ++#define TNETA_SIDEFBR2PTR 22 /* sideband free buffer ring ptr 1575 only */ ++#define TNETA_SIDEFBR1SIZE 23 /* sideband free buffer ring size 1575 only */ ++#define TNETA_SIDEFBR2SIZE 24 /* sideband free buffer ring size 1575 only */ ++#define TNETA_CHNLADD1 25 /* channel add/del register 1 1575 only */ ++#define TNETA_CHNLADD2 26 /* channel add/del register 2 1575 only */ ++#define TNETA_TXPAUSE 27 /* transmit pause 1575 only */ ++#define TNETA_DMACOUNT 28 /* dma channel count 1575 only */ + +#define TNETA_TXCOMPLNOI 128 /* TX completion ring W/O interrupt pointer */ +#define TNETA_TXCOMPLIRQ 129 /* TX completion ring W/ interrupt pointer */ @@ -6477,7 +6592,12 @@ +#define TNETA_RXCOMPLIRQ 131 /* RX completion ring W/ interrupt pointer */ + +/* configuration register bits */ -+#define TNETA_R0_UNI 0x2000 ++#define TNETA_R0_TXBLOCK 0x40000 /* block txing 1575 only */ ++#define TNETA_R0_ENBBUS 0x20000 /* enable bus reports 1575 only */ ++#define TNETA_R0_NOPOLLTX 0x10000 /* enable performance tx 1575 only */ ++#define TNETA_R0_NOPOLLRX 0x8000 /* enable performance rx 1575 only */ ++#define TNETA_R0_COPRO 0x4000 /* coprocessor present 1575 only */ ++#define TNETA_R0_UNI 0x2000 /* uni / nni */ +#define TNETA_R0_MAX_RETRY (0xf << 9) /* 1111 max retry master */ +#define TNETA_R0_LOOP 0x0100 /* set to loop-back (reset!, no enable) */ +#define TNETA_R0_TX_HECERR 0x0080 /* force HEC error */ @@ -6487,9 +6607,16 @@ +#define TNETA_R0_ENDIAN (0x0 << 3) /* 00 little endian */ +#define TNETA_R0_PERBUFFER 0x002 +#define TNETA_R0_RAT_ENABL 0x001 /* enable reass. aging timer */ -+#define TNETA_R0_STANDARD_MODE (TNETA_R0_UNI) ++#define TNETA_R0_STANDARD_MODE 0x00002000 + +/* status register bits */ ++ ++#define TNETA_R1_LOCALBUS 0x8000 /* local bus interrupt ? 1575 only */ ++#define TNETA_R1_COPRO 0x4000 /* copro interrupt ? 1575 only */ ++#define TNETA_R1_SIDE1 0x2000 /* rx sideband 1 interrupt? 1575 only */ ++#define TNETA_R1_SIDE2 0x1000 /* rx sideband 2 interrupt? 1575 only */ ++#define TNETA_R1_RXCOMP 0x800 /* rx compl half inter. ? 1575 only */ ++#define TNETA_R1_RXHALF 0x400 /* Rx fifo half full 1575 only */ +#define TNETA_R1_PCI_MODE 0x400 /* 32/64 bit */ +#define TNETA_R1_RX_FREEZE 0x200 /* rx ring overflow */ +#define TNETA_R1_TX_FREEZE 0x100 /* tx ring overflow */ @@ -6503,6 +6630,7 @@ +#define TNETA_R1_CP_TX 0x001 /* packet segmentation completed */ +#define TNETA_R2_STANDARD_INTS (TNETA_R1_RX_FREEZE | \ + TNETA_R1_TX_FREEZE | \ ++ TNETA_R1_RX_IRR | \ + TNETA_R1_CP_RX | \ + TNETA_R1_CP_TX) +/* control memory map offsets */ @@ -6521,7 +6649,7 @@ +#define TNETA_SUNI_RD_D_AV (0x10) + +#define OWN (0x1 << 31) /* own bit, set to 1 if owned by tneta1570 */ -+#define SEG_PTR(x) (0x3fffff00 & ((unsigned int)x >> 2)) ++#define SEG_PTR(x) (0x3fffff00 & ((unsigned int)virt_to_bus(x) >> 2)) +#define BUF_PTR(x) (((unsigned int)x >> 2) & 0x3fffffff) + /* pointer to tx data buffer header, aligned to 4 byte */ + @@ -6576,16 +6704,39 @@ +#endif __KERNEL__ +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/drivers/atm/tneta1570.c Wed Aug 21 10:55:42 1996 -@@ -0,0 +1,1479 @@ -+/* drivers/atm/tneta1570.c - ti tneta1570 atm driver */ -+ -+/* Written 1996 by Rolf Fiedler (rolf.fiedler@infotech.tu-chemnitz.de) -+ * based on the atm drivers by Werner Almesberger, EPFL LRC -+ */ ++++ work/drivers/atm/tneta1570.c Wed Oct 9 11:26:38 1996 +@@ -0,0 +1,1625 @@ ++/* drivers/atm/tneta1570.c - ti tneta1570 atm driver ++ * ++ * Copyright (c) 1996 University of Technology Chemnitz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ * Written 1996 by Rolf Fiedler (atm@infotech.tu-chemnitz.de) ++ * ++ * 08/08/1996 adapted to axp, phy access, 64 bit bus access ++ * some minor bugs in dma allocation,segring overflow, ++ * timeout,... removed ++ * (paetz@infotech.tu-chemnitz.de) ++ * 10/01/1996 bug in dma channel allocattion fixed (multiple channels) ++ * ++*/ + +#include /* for extended debugging options */ + ++#include +#include +#include +#include @@ -6599,6 +6750,7 @@ +#include /* for xtime */ +#include +#include ++#include +#include +#include +#include @@ -6607,10 +6759,10 @@ +#include "suni.h" + +#define SLOW_DOWN_FACTOR 8 -+ ++#define TNETA1570_TIMEOUT 5*HZ +/* + * KNOWN BUGS: -+ * ++ * OAM support ??? , various vci/vpis + * doesn't work a bit + */ + @@ -6620,11 +6772,14 @@ +static void dequeue_AAL0(struct atm_dev *dev); /* dequeue AAL0 cells */ +static void dequeue_AAL5(struct atm_dev *dev); /* dequeue AAL5 cells */ +static int alloc_dma(struct atm_vcc *vcc); ++static unsigned char tneta1570_phy_get(struct atm_dev *,unsigned long); ++static void tneta1570_phy_put(struct atm_dev *,unsigned char, unsigned long); ++ + +#if 0 -+#define DPRINTK printk ++#define DPRINTK(format,args...) printk(format,args...) +#else -+#define DPRINTK (void) ++#define DPRINTK(format,args...) +#endif + +#ifndef CONFIG_ATM_TNETA1570_DEBUG @@ -6729,7 +6884,23 @@ + return ptr; +} + -+ ++/*------------------------------ utopia phy dummies ------------------------ */ ++static int utopia_start(struct atm_dev *dev) ++{return 0;} ++static void utopia_int(struct atm_dev *dev) ++{} ++static int utopia_ioctl(struct atm_dev *dev, unsigned cmd, unsigned long arg) ++{return 0;} ++static const struct atmphy_ops utopia_ops = { ++ utopia_start, ++ utopia_ioctl, ++ utopia_int ++}; ++int utopia_init(struct atm_dev *dev) ++{ ++ dev->phy = &utopia_ops; ++ return 0; ++} + +/*----------------------------------- RX ------------------------------------*/ + @@ -6742,7 +6913,7 @@ + */ +static int alloc_dma(struct atm_vcc *vcc) +{ -+ unsigned char unsorted[MAX_VPI], sorted[MAX_VPI]; ++ unsigned char sorted[0x78]; + unsigned int x; + int i; + struct tneta1570_dev *tneta1570_dev; @@ -6752,44 +6923,31 @@ + tneta1570_dev = TNETA1570_DEV(vcc->dev); + + x = tneta1570_dev->rx_vpi_vci[vcc->vpi]; -+ + if(x != 0) { + x = 0x7fff & (x >> 16); + return x + vcc->vci - 0x800; /* idx = value - offset */ + } else { ++ for(i=0;i<0x78;i++) ++ sorted[i]=0x00; + /* create a new vpi entry */ + /* first, find dma channel range */ -+ for(i=0; irx_vpi_vci[i] & OWN) { -+ x = tneta1570_dev->rx_vpi_vci[i]; -+ unsorted[i] = 0x7f & (x >> 24); -+ } else { -+ unsorted[i] = 0; -+ } -+ sorted[i] = 0; -+ } -+ for(i=0; irx_vpi_vci[i]; ++ sorted[(0x7f & (x >> 24))-8]=1; ++ } + } -+ for(i=0; irx_vpi_vci[vcc->vpi] = OWN | ((i+8)<<24) | (MAX_VCI); ++ if(i == 0x78) return 0; ++ tneta1570_dev->rx_vpi_vci[vcc->vpi]=OWN|((i+8)<<24)|(MAX_VCI); + return 256*i + vcc->vci; + } +} + + -+/* -+ * let the protocol have a look at the buffer -+ */ -+static unsigned long tneta1570_fetch(struct atm_vcc *vcc, int i) -+{ -+ return 0; /* not implemented yet */ -+} + +/* + * interrupt driven dequeue for rx buffer @@ -6812,16 +6970,26 @@ + NULLCHECK(tneta1570_dev); + + /* find here completion ring entries */ -+ EVENT(">completion ring post: %08x, %d\n", ++ DPRINTK(">completion ring post: %08x, %d\n", + (unsigned int)&RX_CMPL_R_IRQ(tneta1570_dev).atm_header, + tneta1570_dev->rxcmpl_ring_idx_irq); -+ + while(!(RX_CMPL_R_IRQ(tneta1570_dev).control & OWN)) { ++ if((RX_CMPL_R_IRQ(tneta1570_dev).error & BUFFER_STARV)) { ++ printk(DEV_LABEL " rx starvation error \n"); ++ cli(); ++ RX_CMPL_R_IRQ(tneta1570_dev).control = OWN; ++ tneta1570_dev->rxcmpl_ring_idx_irq++; ++ tneta1570_dev->rxcmpl_ring_idx_irq %= RXCMPLR_SZ_IRQ; ++ sti(); ++ continue; ++ } ++ cli(); + if((RX_CMPL_R_IRQ(tneta1570_dev).control & 0xff) == 0) { + dequeue_OAM(dev); + } else { + if((RX_CMPL_R_IRQ(tneta1570_dev).error & AAL5_IND)) { -+ dequeue_AAL5(dev); ++ if((RX_CMPL_R_IRQ(tneta1570_dev).buf_ptr & (1<<31))) ++ dequeue_AAL5(dev); + } else { + dequeue_AAL0(dev); + @@ -6830,10 +6998,13 @@ + RX_CMPL_R_IRQ(tneta1570_dev).control = OWN; + tneta1570_dev->rxcmpl_ring_idx_irq++; + tneta1570_dev->rxcmpl_ring_idx_irq %= RXCMPLR_SZ_IRQ; ++ sti(); + } + return ; +} + ++ ++ +static void dequeue_OAM(struct atm_dev *dev) /* dequeue AAL0 cells */ +{ + struct tneta1570_dev * tneta1570_dev; @@ -6844,27 +7015,27 @@ + NULLCHECK(dev); + tneta1570_dev = TNETA1570_DEV(dev); + NULLCHECK(tneta1570_dev); ++ + -+/* if(vcc->push_oam) printk(" PushOAM is present.\n"); */ -+ -+ p = (unsigned int *)(RX_CMPL_R_IRQ(tneta1570_dev).buf_ptr << 2); -+ skb = (struct sk_buff *)(*(p-1)); /* get skb */ -+ ++ ++ p = (unsigned int *)bus_to_virt(RX_CMPL_R_IRQ(tneta1570_dev).buf_ptr << 2); ++ skb = (struct sk_buff *)phys_to_virt(*(p-1)); /* get skb */ ++ + /* get new buffer before dequeueing old + */ + new_skb = alloc_skb(MAX_AAL0_PDU+RX_HDR, GFP_ATOMIC); + if(new_skb == NULL) { + /* add just received buffer to free list, drop pdu :-( */ -+ fbr = tneta1570_dev->free_buf_ptr[0].buf_ptr; -+ fbr[tneta1570_dev->oam_fbr_idx] = OWN | ((int)p >> 2); ++ fbr = bus_to_virt((unsigned long)tneta1570_dev->free_buf_ptr[0].buf_ptr); ++ fbr[tneta1570_dev->oam_fbr_idx] = OWN | (virt_to_bus(p) >> 2); + tneta1570_dev->oam_fbr_idx++; + tneta1570_dev->oam_fbr_idx %= AAL0_BUFS; + return; + } + + /* add newly allocated buffer to free list */ -+ fbr = tneta1570_dev->free_buf_ptr[0].buf_ptr; -+ fbr[tneta1570_dev->oam_fbr_idx] = OWN | ((unsigned int)(new_skb->data+4) >> 2); ++ fbr = bus_to_virt((unsigned long)tneta1570_dev->free_buf_ptr[0].buf_ptr); ++ fbr[tneta1570_dev->oam_fbr_idx] = OWN | (virt_to_bus(new_skb->data+4) >> 2); + *(struct sk_buff **)(new_skb->data) = new_skb; + tneta1570_dev->oam_fbr_idx++; + tneta1570_dev->oam_fbr_idx %= AAL0_BUFS; @@ -6879,11 +7050,11 @@ + skb->len = 52; + /* should check for multiple buffers @@@@ */ + skb->tail = skb->data + skb->len; -+ -+ if (/* vcc->push */ 1) { ++ ++ if (/*vcc->push*/1) { + dev_kfree_skb(skb, GFP_ATOMIC); -+ printk(" Don't know how to call push !\n"); -+ /* vcc->push(vcc,skb); */ ++/* printk(DEV_LABEL " Don't know how to call push !\n"); */ ++/* vcc->push(vcc,skb); */ + } else { + dev_kfree_skb(skb, GFP_ATOMIC); + printk(DEV_LABEL "(itf %d) No push in protocol.\n", @@ -6905,8 +7076,8 @@ + tneta1570_dev = TNETA1570_DEV(dev); + NULLCHECK(tneta1570_dev); + -+ p = (unsigned int *)(RX_CMPL_R_IRQ(tneta1570_dev).buf_ptr << 2); -+ skb = (struct sk_buff *)(*(p-1)); /* get skb */ ++ p = (unsigned int *)bus_to_virt(RX_CMPL_R_IRQ(tneta1570_dev).buf_ptr << 2); ++ skb = (struct sk_buff *)phys_to_virt(*(p-1)); /* get skb */ + + vcc = skb->atm.vcc; + NULLCHECK(vcc); @@ -6919,8 +7090,8 @@ + if(new_skb == NULL) { + /* add just received buffer to free list, drop pdu :-( */ + v = RX_CMPL_R_IRQ(tneta1570_dev).control; -+ fbr = tneta1570_dev->free_buf_ptr[0xff & v].buf_ptr; -+ fbr[tneta1570_vcc->fbr_idx] = OWN | ((int)p >> 2); ++ fbr = bus_to_virt((unsigned long)tneta1570_dev->free_buf_ptr[0xff & v].buf_ptr); ++ fbr[tneta1570_vcc->fbr_idx] = OWN | (virt_to_bus(p) >> 2); + tneta1570_vcc->fbr_idx++; + tneta1570_vcc->fbr_idx %= AAL0_BUFS; + return; @@ -6929,8 +7100,8 @@ + /* add newly allocated buffer to free list */ + + v = RX_CMPL_R_IRQ(tneta1570_dev).control; -+ fbr = tneta1570_dev->free_buf_ptr[0xff & v].buf_ptr; -+ fbr[tneta1570_vcc->fbr_idx] = OWN | ((unsigned int)(new_skb->data+4) >> 2); ++ fbr = bus_to_virt((unsigned long)tneta1570_dev->free_buf_ptr[0xff & v].buf_ptr); ++ fbr[tneta1570_vcc->fbr_idx] = OWN | (virt_to_bus(new_skb->data+4) >> 2); + *(struct sk_buff **)(new_skb->data) = new_skb; + new_skb->atm.vcc = vcc; /* link vcc info */ + tneta1570_vcc->fbr_idx++; @@ -6964,7 +7135,7 @@ +static void dequeue_AAL5(struct atm_dev *dev) /* dequeue AAL5 PDU */ +{ + struct tneta1570_dev *tneta1570_dev; -+ struct tneta1570_vcc * tneta1570_vcc; ++ struct tneta1570_vcc *tneta1570_vcc; + struct atm_vcc *vcc; + struct sk_buff *skb, *new_skb; + unsigned int *p, v, *fbr; @@ -6973,9 +7144,8 @@ + NULLCHECK(dev); + tneta1570_dev = TNETA1570_DEV(dev); + NULLCHECK(tneta1570_dev); -+ -+ p = (unsigned int *)(RX_CMPL_R_IRQ(tneta1570_dev).buf_ptr << 2); -+ skb = (struct sk_buff *)(*(p-1)); /* get skb */ ++ p = (unsigned int *)bus_to_virt(RX_CMPL_R_IRQ(tneta1570_dev).buf_ptr << 2); ++ skb = (struct sk_buff *)phys_to_virt(*(p-1)); /* get skb */ + + DPRINTK(" p %08x, skb %08x, head %08x, err %08x, sop %08x, trailer %08x, idx %08x", + p, skb, @@ -6994,21 +7164,34 @@ + /* get new buffer before dequeueing old + * if error in peek drop pdu + */ -+ new_skb = vcc->peek(vcc, MAX_AAL5_PDU+RX_HDR, NULL); -+ if(new_skb == NULL) { ++ new_skb=NULL; ++ ++ if((RX_CMPL_R_IRQ(tneta1570_dev).error & CRC_ERROR)) { ++ DPRINTK(DEV_LABEL " rx crc error.\n\n"); ++ } ++ if((RX_CMPL_R_IRQ(tneta1570_dev).error & RX_TIMEOUT)) { ++ DPRINTK(DEV_LABEL " rx time out.\n"); ++ } ++ if((RX_CMPL_R_IRQ(tneta1570_dev).error & PAKET_OVERFLOW)) { ++ DPRINTK(DEV_LABEL " rx packet overflow.\n"); ++ } ++ if(!(RX_CMPL_R_IRQ(tneta1570_dev).error & (CRC_ERROR | RX_TIMEOUT | PAKET_OVERFLOW))) ++ new_skb = vcc->peek(vcc, MAX_AAL5_PDU+RX_HDR, NULL); ++ if(new_skb == NULL) { + /* add just received buffer to free list :-( */ + v = RX_CMPL_R_IRQ(tneta1570_dev).control; -+ fbr = tneta1570_dev->free_buf_ptr[0xff & v].buf_ptr; -+ fbr[tneta1570_vcc->fbr_idx] = OWN | ((int)p >> 2); ++ fbr = bus_to_virt((unsigned long)tneta1570_dev->free_buf_ptr[(0xffff & v)].buf_ptr); ++ fbr[tneta1570_vcc->fbr_idx] = OWN | (virt_to_bus(p) >> 2); + tneta1570_vcc->fbr_idx++; + tneta1570_vcc->fbr_idx %= AAL5_BUFS; + return; + } + /* add newly allocated buffer to free list */ -+ ++ + v = RX_CMPL_R_IRQ(tneta1570_dev).control; -+ fbr = tneta1570_dev->free_buf_ptr[v].buf_ptr; -+ fbr[tneta1570_vcc->fbr_idx] = OWN | ((unsigned int)(new_skb->data+4) >> 2); ++ fbr = bus_to_virt((unsigned long)tneta1570_dev->free_buf_ptr[(v & 0xffff)].buf_ptr); ++ v=virt_to_bus(new_skb->data+4); ++ fbr[tneta1570_vcc->fbr_idx] = OWN | (v >> 2); + *(struct sk_buff **)(new_skb->data) = new_skb; + new_skb->atm.vcc = vcc; /* link context info */ + tneta1570_vcc->fbr_idx++; @@ -7045,7 +7228,7 @@ +static int start_rx(struct atm_dev *dev) +{ + int i; -+ unsigned int x; ++ unsigned long x; + unsigned int *ptr; + struct sk_buff *buf; + struct tneta1570_dev *tneta1570_dev; @@ -7064,7 +7247,7 @@ + return -ENOMEM; + } + /* align completion-ring with irq to its size */ -+ x = (unsigned int)(&tneta1570_dev->rxcmpl_ring[RXCMPLR_SZ_IRQ]); ++ x = (unsigned long)(&tneta1570_dev->rxcmpl_ring[RXCMPLR_SZ_IRQ]); + tneta1570_dev->rxcmplringptr_irq = (struct tneta_rx_compl *) + (x & (~(RXCMPLR_SZ_IRQ*sizeof(struct tneta_rx_compl) - 1))); + /* the rest is for the completion ring w/o irq */ @@ -7088,24 +7271,24 @@ + + SAR_REG_SHORT(tneta1570_dev, TNETA_S_RXCOMPLSIZEI) = RXCMPLR_SZ_IRQ-1; + SAR_REG_SHORT(tneta1570_dev, TNETA_S_RXCOMPLSIZE) = RXCMPLR_SZ_NOI-1; -+ SAR_REG_WORD(tneta1570_dev, TNETA_RXCOMPLNOI) = (unsigned int)tneta1570_dev->rxcmplringptr_noi; -+ SAR_REG_WORD(tneta1570_dev, TNETA_RXCOMPLIRQ) = (unsigned int)tneta1570_dev->rxcmplringptr_irq; ++ SAR_REG_WORD(tneta1570_dev, TNETA_RXCOMPLNOI) = (unsigned int)virt_to_bus(tneta1570_dev->rxcmplringptr_noi); ++ SAR_REG_WORD(tneta1570_dev, TNETA_RXCOMPLIRQ) = (unsigned int)virt_to_bus(tneta1570_dev->rxcmplringptr_irq); + + /* init dma 0,1,2 for oam */ + + /* alloc memory for oam fbr & buffers */ -+ ptr = kmalloc(AAL0_BUFS*sizeof(struct tneta_rx_fbrptr), GFP_KERNEL); ++ ptr = kmalloc(AAL0_BUFS*4, GFP_KERNEL); + if(ptr == NULL) printk(DEV_LABEL "PANIC on start rx \n"); + for(i=0; idata) = buf; /* link */ -+ ptr[i] = OWN | ((unsigned int)(buf->data + 4) >> 2); ++ ptr[i] = OWN | ((unsigned int)virt_to_bus(buf->data + 4) >> 2); + } + + tneta1570_dev->oam_fbr_idx = 0; + /* oam cells use fbr 0 */ -+ tneta1570_dev->free_buf_ptr[0].buf_ptr = ptr; ++ tneta1570_dev->free_buf_ptr[0].buf_ptr = (unsigned int)virt_to_bus(ptr); + tneta1570_dev->free_buf_ptr[0].buf_size = FBR_AAL0_32; + + tneta1570_dev->rx_dma_state[0].control = RX_DMA_CONTROL_AAL0; @@ -7170,7 +7353,7 @@ + + if(vcc->aal == ATM_AAL0) { + /* alloc memory for fbr & buffers */ -+ ptr = kmalloc(AAL0_BUFS*sizeof(struct tneta_rx_fbrptr), ++ ptr = kmalloc(AAL0_BUFS*4, + GFP_KERNEL); + if(ptr == NULL) printk(DEV_LABEL "PANIC on open rx \n"); + for(i=0; idata) = skb; /* link */ + skb->atm.vcc = vcc; /* link vcc info */ -+ ptr[i] = OWN | ((unsigned int)(skb->data+4) >> 2); ++ ptr[i] = OWN | ((unsigned int)virt_to_bus(skb->data+4) >> 2); + } + + tneta1570_vcc->fbr_idx = 0; -+ -+ tneta1570_dev->free_buf_ptr[fbr_idx].buf_ptr = ptr; ++ tneta1570_dev->free_buf_ptr[fbr_idx].buf_ptr = virt_to_bus(ptr); + tneta1570_dev->free_buf_ptr[fbr_idx].buf_size = FBR_AAL0_32; -+ ++ + tneta1570_dev->rx_dma_state[dma_idx].control = RX_DMA_CONTROL_AAL0; + tneta1570_dev->rx_dma_state[dma_idx].AAL0_cells = MAX_AAL0_CELLS; + tneta1570_dev->rx_dma_state[dma_idx].rx_timeout = RX_TIME_OUT; @@ -7193,7 +7375,7 @@ + + } else if(vcc->aal == ATM_AAL5) { + /* alloc memory for fbr & buffers */ -+ ptr = kmalloc(AAL5_BUFS*sizeof(struct tneta_rx_fbrptr), ++ ptr = kmalloc(AAL5_BUFS*4, + GFP_KERNEL); + if(ptr == NULL) printk(DEV_LABEL "PANIC on open rx \n"); + for(i=0; idata) = skb; /* link */ + skb->atm.vcc = vcc; /* link vcc info */ -+ ptr[i] = OWN | ((unsigned int)(skb->data+4) >> 2); ++ ptr[i] = OWN | ((unsigned int)virt_to_bus(skb->data+4) >> 2); + } + + tneta1570_vcc->fbr_idx = 0; -+ -+ tneta1570_dev->free_buf_ptr[fbr_idx].buf_ptr = ptr; ++ tneta1570_dev->free_buf_ptr[fbr_idx].buf_ptr = virt_to_bus(ptr); + tneta1570_dev->free_buf_ptr[fbr_idx].buf_size = FBR_AAL5_16; + + tneta1570_dev->rx_dma_state[dma_idx].control = RX_DMA_CONTROL_AAL5; @@ -7251,7 +7432,7 @@ + while(tneta1570_dev->rx_dma_state[dma_idx].control & OWN); + tneta1570_dev->rx_dma_state[dma_idx].dma_on_idx = 0; /* off */ + /* mark as empty */ -+ ptr = tneta1570_dev->free_buf_ptr[fbr_idx].buf_ptr; ++ ptr = bus_to_virt((unsigned long)tneta1570_dev->free_buf_ptr[fbr_idx].buf_ptr); + tneta1570_dev->free_buf_ptr[fbr_idx].buf_ptr = 0; /* mark fbr free */ + x = tneta1570_dev->free_buf_ptr[fbr_idx].buf_size; + x = x >> 10; /* ring size */ @@ -7260,8 +7441,8 @@ + x = 16 * x; + for(i=0; ifree = 1; /* ???? */ + kfree_skb(skb, FREE_READ); + } @@ -7287,7 +7468,8 @@ +static int start_tx(struct atm_dev *dev) +{ + int i; -+ unsigned int x, *seg_ring, *seg_ring_mptr; ++ unsigned int *seg_ring, *seg_ring_mptr; ++ unsigned long x; + struct tneta1570_dev *tneta1570_dev; + + EVENT(">start_tx\n",0,0); @@ -7302,7 +7484,7 @@ + } + DPRINTK("TX_CMPL_R->%08x", tneta1570_dev->txcmpl_ring); + /* align completion-ring with irq to its size */ -+ x = (unsigned int)(&tneta1570_dev->txcmpl_ring[TXCMPLR_SZ_IRQ]); ++ x = (unsigned long)(&tneta1570_dev->txcmpl_ring[TXCMPLR_SZ_IRQ]); + tneta1570_dev->txcmplringptr_irq = (unsigned int *)(x & (~(TXCMPLR_SZ_IRQ*4 - 1))); + /* the rest is for the completion ring w/o irq */ + if((tneta1570_dev->txcmplringptr_irq - TXCMPLR_SZ_NOI) > tneta1570_dev->txcmpl_ring) { @@ -7327,7 +7509,7 @@ + dev->number); + return -ENOMEM; + } -+ x = (unsigned int)(seg_ring_mptr + TX_SEG_RING_SIZE); ++ x = (unsigned long)(seg_ring_mptr + TX_SEG_RING_SIZE); + seg_ring = (unsigned int *)(x & ~(TX_SEG_RING_SIZE * 4 - 1)); + + for(i=0; itxcmplringptr_noi; -+ SAR_REG_WORD(tneta1570_dev, TNETA_TXCOMPLIRQ) = (unsigned int)tneta1570_dev->txcmplringptr_irq; ++ SAR_REG_WORD(tneta1570_dev, TNETA_TXCOMPLNOI) = (unsigned int)virt_to_bus((void*)tneta1570_dev->txcmplringptr_noi); ++ SAR_REG_WORD(tneta1570_dev, TNETA_TXCOMPLIRQ) = (unsigned int)virt_to_bus((void*)tneta1570_dev->txcmplringptr_irq); + + SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) |= TNETA_R0_TX_ENABLE; + @@ -7360,7 +7542,7 @@ +static int open_tx(struct atm_vcc *vcc) +{ + int scheduler_idx, i; -+ unsigned int x; ++ unsigned long x; + struct tneta1570_dev *tneta1570_dev; + struct tneta1570_vcc *tneta1570_vcc; + @@ -7380,7 +7562,7 @@ + return -ENOMEM; + } + /* align seg-ring to its size */ -+ x = (unsigned int)(tneta1570_vcc->seg_ring_mptr + TX_SEG_RING_SIZE); ++ x = (unsigned long)(tneta1570_vcc->seg_ring_mptr + TX_SEG_RING_SIZE); + tneta1570_vcc->seg_ring = (unsigned int *)(x & ~(TX_SEG_RING_SIZE * 4 - 1)); + + EVENT("> seg ring is at phy %x\n", (unsigned int)tneta1570_vcc->seg_ring,0); @@ -7431,8 +7613,14 @@ + tneta1570_dev = TNETA1570_DEV(vcc->dev); + tneta1570_vcc = TNETA1570_VCC(vcc); + ++ current->timeout=jiffies+TNETA1570_TIMEOUT; + while(tneta1570_vcc->txing) { -+ sleep_on(&tneta1570_vcc->tx_wait); /* wait for tx to drain */ ++ interruptible_sleep_on(&tneta1570_vcc->tx_wait); /* wait for tx to drain */ ++ if(!current->timeout){ ++ printk(DEV_LABEL " timed out while closing (%d)\n", ++ tneta1570_vcc->txing); ++ break; ++ } + } + + /* remove ptr to segmentation ring */ @@ -7451,9 +7639,9 @@ + */ +static int do_tx(struct sk_buff * skb) +{ -+ struct atm_vcc *vcc; -+ struct tneta1570_dev *tneta1570_dev; -+ struct tneta1570_vcc *tneta1570_vcc; ++ struct atm_vcc *vcc=0; ++ struct tneta1570_dev *tneta1570_dev=0; ++ struct tneta1570_vcc *tneta1570_vcc=0; + unsigned int seg_ring_entry, i; + unsigned int *buffer; + @@ -7464,7 +7652,9 @@ + tneta1570_dev = TNETA1570_DEV(vcc->dev); + NULLCHECK(tneta1570_dev); + tneta1570_vcc = TNETA1570_VCC(vcc); -+ if ((unsigned long) skb->data & 2) { ++ if(tneta1570_vcc->txing>=TX_SEG_RING_SIZE-1) ++ interruptible_sleep_on(&tneta1570_vcc->tx_wait); ++ if ((unsigned long) skb->data & TNETA_ALIGN) { + printk(DEV_LABEL "(itf %d): VCI %d has mis-aligned TX data\n", + vcc->dev->number,vcc->vci); + dev_kfree_skb(skb,FREE_WRITE); @@ -7499,7 +7689,7 @@ + buffer[6+i] = ((unsigned int *)skb->data)[i]; + buffer[2] = AAL5_PDU_INT | (0xffff & skb->len); + } -+ buffer[1] = (unsigned int)skb; ++ buffer[1] = (unsigned int)virt_to_bus(skb); + buffer[0] = 0; /* push size */ + EVENT(">data copied\n",0,0); + } else { /* push skb and put header in front of sdu */ @@ -7518,10 +7708,10 @@ + buffer[2] = AAL5_PDU_INT | (0xffff & (skb->len-24)); + buffer[0] = 24; /* push size */ + } -+ buffer[1] = (unsigned int)skb; /* store skb ptr for dequeue */ ++ buffer[1] = (unsigned int)virt_to_bus(skb); /* store skb ptr for dequeue */ + } + -+ seg_ring_entry = ((unsigned int)(&buffer[2]) >> 2) | OWN; ++ seg_ring_entry = ((unsigned int)virt_to_bus(&buffer[2]) >> 2) | OWN; + tneta1570_vcc->seg_ring[tneta1570_vcc->seg_ring_idx] = seg_ring_entry; + DPRINTK(">zippered up"); + DPRINTK(">sched %d," @@ -7537,10 +7727,11 @@ + &buffer[2], buffer[2], buffer[4]); + + /* index to seg.ring entry for next SDU */ ++ cli(); /*@@@ restore flags ??*/ + tneta1570_vcc->seg_ring_idx++; + tneta1570_vcc->seg_ring_idx %= TX_SEG_RING_SIZE; -+ + tneta1570_vcc->txing++; ++ sti(); + return 0; +} + @@ -7563,16 +7754,16 @@ + NULLCHECK(dev); + tneta1570_dev = TNETA1570_DEV(dev); + NULLCHECK(tneta1570_dev); -+ ++ cli(); + /* find here completion ring entries */ + EVENT(">completion ring post: %08x, %d\n", TX_CMPL_R_IRQ(tneta1570_dev), + tneta1570_dev->txcmpl_ring_idx_irq); + while(!(TX_CMPL_R_IRQ(tneta1570_dev) & OWN)) { -+ p = (unsigned int *)(TX_CMPL_R_IRQ(tneta1570_dev) << 2); ++ p = (unsigned int *)bus_to_virt(TX_CMPL_R_IRQ(tneta1570_dev) << 2); + TX_CMPL_R_IRQ(tneta1570_dev) = OWN; + tneta1570_dev->txcmpl_ring_idx_irq++; + tneta1570_dev->txcmpl_ring_idx_irq %= TXCMPLR_SZ_IRQ; -+ skb = (struct sk_buff *)(*(p-1)); /* get skb */ ++ skb = (struct sk_buff *)bus_to_virt(*(p-1)); /* get skb */ + v = *(p-2); /* get skb push size */ + + if(v==0) { /* free copy area */ @@ -7588,9 +7779,10 @@ + + vcc->stats->tx++; + TNETA1570_VCC(vcc)->txing--; -+ wake_up(&(TNETA1570_VCC(vcc)->tx_wait)); ++ wake_up_interruptible(&(TNETA1570_VCC(vcc)->tx_wait)); +dma_complete++; + }; ++sti(); +} + + @@ -7612,13 +7804,18 @@ +{ + struct atm_dev *dev; + struct tneta1570_dev *tneta1570_dev; -+ unsigned long reason; ++ unsigned int reason; + + EVENT(">tneta_int\n",0,0); + dev = dev_id; + tneta1570_dev = TNETA1570_DEV(dev); + while ( (reason = 0x3ff & SAR_REG_WORD(tneta1570_dev, TNETA_STATUS)) ) { + DPRINTK(DEV_LABEL ": int 0x%08x\n",reason); ++ if (reason & TNETA_R1_RX_IRR) { ++ DPRINTK(DEV_LABEL " Unknown PDU %d.%d\n", ++ (SAR_REG_WORD(tneta1570_dev,TNETA_RXUNKNOWN) & 0x3f00) >> 16, ++ SAR_REG_WORD(tneta1570_dev,TNETA_RXUNKNOWN) & 0x0ff); ++ } /* unknown cell received */ + if (reason & TNETA_R1_RX_FREEZE) { + EVENT("INT: RX Freeze - RX ring overflow\n",0,0); + } /* ? */ @@ -7688,7 +7885,8 @@ +static int tneta1570_init(struct atm_dev *dev) +{ + struct tneta1570_dev *tneta1570_dev; -+ unsigned int real_base,base; ++ unsigned long base; ++ unsigned int real_base; + unsigned short command; + unsigned char revision; + int error,i,last; @@ -7755,22 +7953,22 @@ + dev->number,pcibios_strerror(error)); + return error; + } -+ printk(DEV_LABEL "(itf %d): rev.%d,base=0x%x,irq=%d,",dev->number, -+ revision,real_base,tneta1570_dev->irq); -+ if (!(base = (unsigned long) vremap(real_base,tneta1570_dev->pci_map_size))) { ++ printk(DEV_LABEL "(itf %d): rev.%d,irq=%d,",dev->number, ++ revision,tneta1570_dev->irq); ++ if (!(base = (unsigned long) vremap((unsigned long)real_base+TNETA1570_MEM_OFFSET,tneta1570_dev->pci_map_size))) { + printk(DEV_LABEL "(itf %d): can't set up page mapping\n", + dev->number); + return error; + } + tneta1570_dev->base_diff = real_base-base; -+ tneta1570_dev->reg = (volatile unsigned int *) (base+TNETA_REG_BASE_OFFSET); -+ tneta1570_dev->scheduler = (volatile unsigned long *) (base+TNETA_SCHED_TABLE); -+ tneta1570_dev->ram = (volatile unsigned long *) (base+TNETA_SCHED_TABLE); ++ tneta1570_dev->reg = (volatile unsigned int *) (base+TNETA_REG_BASE_OFFSET); ++ tneta1570_dev->scheduler = (volatile unsigned int *) (base+TNETA_SCHED_TABLE); ++ tneta1570_dev->ram = (volatile unsigned int *) (base+TNETA_SCHED_TABLE); + tneta1570_dev->free_buf_ptr = (volatile struct tneta_rx_fbrptr *) (base+TNETA_FREE_BUFFER_POINTERS); -+ tneta1570_dev->rx_vpi_vci = (volatile unsigned long *) (base+TNETA_RX_VPIVCI_DMA_POINTERS); ++ tneta1570_dev->rx_vpi_vci = (volatile unsigned int *) (base+TNETA_RX_VPIVCI_DMA_POINTERS); + tneta1570_dev->tx_dma_state = (volatile struct tneta_tx_dma_state_table *) (base+TNETA_TX_DMA_STATE_TABLE); + tneta1570_dev->rx_dma_state = (volatile struct tneta_rx_dma_state_table *) (base+TNETA_RX_DMA_STATE_TABLE); -+ tneta1570_dev->phy = (volatile unsigned long *) (base+TNETA_SUNI_OFFSET); ++ tneta1570_dev->phy = (volatile unsigned int *) (base+TNETA_SUNI_OFFSET); + + tneta1570_dev->txcmpl_ring_idx_noi = 0; + tneta1570_dev->txcmpl_ring_idx_irq = 0; @@ -7802,7 +8000,9 @@ + if(i>RESERVED_UL || iram[i] = 0; + -+ printk("mem=%dkB\n",tneta1570_dev->mem >> 10); ++ (tneta1570_dev->reg[TNETA_STATUS] & 0x00000400)? ++ printk("mem=%dkB,mode=64 bit,",tneta1570_dev->mem >> 10): ++ printk("mem=%dkB,mode=32 bit,",tneta1570_dev->mem >> 10); + + /* reset SAR */ + reset_sar(tneta1570_dev); @@ -7810,8 +8010,8 @@ + for(i=0; iRESERVED_UL || iram[i] = 0; -+ /* TODO: check for non-SUNI, check for TAXI ? */ -+ return suni_init(dev); ++ ++ return 0; +} + + @@ -7819,6 +8019,7 @@ +{ + struct tneta1570_dev *tneta1570_dev; + int error; ++ unsigned char phy; + + EVENT(">tneta1570_start\n",0,0); + tneta1570_dev = TNETA1570_DEV(dev); @@ -7839,13 +8040,19 @@ + return error; + } + -+ /* bring suni up */ -+ error = dev->phy->start(dev); -+ if (error) return error; -+ ++ if((phy=tneta1570_phy_get(dev,0))==0x30) { ++ printk("pm5346,rev.%d \n",phy&0x0f); ++ suni_init(dev); ++ } else { ++ printk("utopia,rev.%d \n",phy&0x0f); ++ utopia_init(dev); ++ } ++ + SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) = TNETA_R0_STANDARD_MODE; + SAR_REG_WORD(tneta1570_dev, TNETA_INT_MASK) = TNETA_R2_STANDARD_INTS; + ++ error = dev->phy->start(dev); ++ if (error) return error; + error = start_tx(dev); + if (error) return error; + error = start_rx(dev); @@ -7872,16 +8079,6 @@ +} + + -+/* trying to find a connection identifier */ -+/* -+ * not implemented yet -+ */ -+static int get_ci(struct atm_vcc *vcc,short *vpi,int *vci) -+{ -+ return 0; -+} -+ -+ +static int tneta1570_open(struct atm_vcc *vcc,short vpi,int vci) +{ + struct tneta1570_dev *tneta1570_dev; @@ -7893,13 +8090,8 @@ + vcc->alloc_tx = tneta1570_alloc_tx; /* set my skb_alloc function */ + + tneta1570_dev = TNETA1570_DEV(vcc->dev); -+#if 0 /* set to 0 to test atm_find_ci (get_ci usually is faster) */ -+ error = get_ci(vcc,&vpi,&vci); /* get connection id */ -+ if (error) return error; -+#else + error = atm_find_ci(vcc,&vpi,&vci); /* get connection id */ + if (error) return error; -+#endif + vcc->vpi = vpi; + vcc->vci = vci; + if (vcc->aal != ATM_AAL0 && vcc->aal != ATM_AAL5) return -EINVAL; @@ -7925,9 +8117,73 @@ + +static int tneta1570_ioctl(struct atm_dev *dev,unsigned int cmd,unsigned long arg) +{ -+ if (cmd == 12345678) dump(dev); -+ if (!dev->phy->ioctl) return -EINVAL; -+ return dev->phy->ioctl(dev,cmd,arg); ++ struct tneta1570_dev *tneta1570_dev; ++ ++ tneta1570_dev = TNETA1570_DEV(dev); ++ printk(DEV_LABEL "ioctl \n"); ++ switch (cmd) { ++ case TNETA_LOOP: ++ if(arg) ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) |= ++ TNETA_R0_LOOP; ++ else ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) &= ++ ~TNETA_R0_LOOP; ++ return 0; ++ case TNETA_INVHEC: ++ if(arg) ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) |= ++ TNETA_R0_TX_HECERR; ++ else ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) &= ++ ~TNETA_R0_TX_HECERR; ++ return 0; ++ case TNETA_ENTX: ++ if(arg) ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) |= ++ TNETA_R0_TX_ENABLE; ++ else ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) &= ++ ~TNETA_R0_TX_ENABLE; ++ return 0; ++ case TNETA_ENRX: ++ if(arg) ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) |= ++ TNETA_R0_RX_ENABLE; ++ else ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) &= ++ ~TNETA_R0_RX_ENABLE; ++ return 0; ++ case TNETA_BP: ++ if(arg) ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) |= ++ TNETA_R0_PERBUFFER; ++ else ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) &= ++ ~TNETA_R0_PERBUFFER; ++ return 0; ++ case TNETA_RAT: ++ if(arg) ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) |= ++ TNETA_R0_RAT_ENABL; ++ else ++ SAR_REG_WORD(tneta1570_dev, TNETA_CONFIG) &= ++ ~TNETA_R0_RAT_ENABL; ++ return 0; ++ case TNETA_RXUNKN: ++ return(SAR_REG_SHORT(tneta1570_dev, TNETA_UNKNOWN_P)); ++ case TNETA_HECERR: ++ return(SAR_REG_SHORT(tneta1570_dev, TNETA_S_HEC_ERR)); ++ case TNETA_AAL5DISC: ++ return(SAR_REG_SHORT(tneta1570_dev, TNETA_S_AAL_DISCARD)); ++ case TNETA_RXCELL: ++ return(SAR_REG_WORD(tneta1570_dev, TNETA_CELL_RXC)); ++ case TNETA_TXCELL: ++ return(SAR_REG_WORD(tneta1570_dev, TNETA_CELL_TXC)); ++ default: ++ if (!dev->phy->ioctl) return -EINVAL; ++ return dev->phy->ioctl(dev,cmd,arg); ++ } +} + + @@ -7971,20 +8227,13 @@ + return do_tx(skb); +} + -+/* Scatter/Gather send, build vector and send from user space -+ * not yet implemented -+ */ -+static int tneta1570_sg_send(struct atm_vcc *vcc,unsigned long start, -+ unsigned long size) -+{ -+ return vcc->aal == ATM_AAL5 && !((start | size) & 3); -+ /* don't tolerate misalignment */ -+} -+ + +static void tneta1570_phy_put(struct atm_dev *dev,unsigned char value, + unsigned long addr) +{ ++ int i=0; ++ TNETA1570_DEV(dev)->phy[addr+TNETA_SUNI_RDREQ]=0; ++ while(i++<20 && !(TNETA1570_DEV(dev)->phy[addr+TNETA_SUNI_RDREQ] & 0x10)); + TNETA1570_DEV(dev)->phy[addr] = value; +} + @@ -7993,10 +8242,12 @@ +static unsigned char tneta1570_phy_get(struct atm_dev *dev,unsigned long addr) +{ + volatile unsigned tmp; /* force 32 bit access */ -+ ++ int i=0; + /* set address */ + TNETA1570_DEV(dev)->phy[addr+TNETA_SUNI_RDREQ]=0; -+ /* read the bugger */ ++ while(i++<20 && !(TNETA1570_DEV(dev)->phy[addr+TNETA_SUNI_RDREQ] & 0x10)); ++ TNETA1570_DEV(dev)->phy[addr+TNETA_SUNI_RDREQ]=i=0; ++ while(i++<20 && !(TNETA1570_DEV(dev)->phy[addr+TNETA_SUNI_RDREQ] & 0x08)); + tmp=TNETA1570_DEV(dev)->phy[addr]; + + return (unsigned char)(0xff & tmp); @@ -8015,7 +8266,8 @@ + NULL, /* no send_oam ???? */ + tneta1570_phy_put, + tneta1570_phy_get, -+ NULL /* no feedback */ ++ NULL, /* no feedback */ ++ NULL /* no change_qos */ +}; + + @@ -8037,6 +8289,11 @@ + PCI_DEVICE_ID_TI_TNETA1570, + index, + &tneta1570_dev->bus, ++ &tneta1570_dev->dev_fn) ++ || !pcibios_find_device(PCI_VENDOR_ID_TI, ++ PCI_DEVICE_ID_TI_TNETA1575, ++ index, ++ &tneta1570_dev->bus, + &tneta1570_dev->dev_fn)) + { + dev = atm_dev_register(DEV_LABEL,&ops,0); @@ -8057,6 +8314,23 @@ + } + return index; +} ++ ++#ifdef MODULE ++ ++int init_module(void) ++{ ++ if (!tneta1570_detect()) { ++ printk(DEV_LABEL ": no adapter found\n"); ++ return -ENXIO; ++ } ++ MOD_INC_USE_COUNT; ++ return 0; ++} ++void cleanup_module(void){ ++ ++/* not yet */ ++} ++#endif --- /dev/null Mon Jul 18 01:46:18 1994 +++ work/drivers/atm/fore200.c Wed Aug 21 10:55:43 1996 @@ -0,0 +1,26 @@ @@ -8087,8 +8361,8 @@ + return 0; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atm.h Mon Sep 2 11:44:50 1996 -@@ -0,0 +1,217 @@ ++++ work/include/linux/atm.h Wed Oct 9 20:21:33 1996 +@@ -0,0 +1,216 @@ +/* atm.h - general ATM declarations */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -8226,7 +8500,6 @@ + +#define ATM_MAX_PCR -1 /* maximum available PCR */ + -+#define class traffic_class /* backward compatibility */ +struct atm_trafprm { + unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */ + int max_pcr; /* maximum PCR in cells per second */ @@ -8307,7 +8580,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmclip.h Fri Sep 27 15:23:43 1996 ++++ work/include/linux/atmclip.h Thu Oct 10 19:13:50 1996 @@ -0,0 +1,37 @@ +/* atmclip.h - Classical IP over ATM */ + @@ -8347,8 +8620,8 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmdev.h Fri Sep 27 15:20:29 1996 -@@ -0,0 +1,245 @@ ++++ work/include/linux/atmdev.h Thu Oct 10 18:55:50 1996 +@@ -0,0 +1,255 @@ +/* atmdev.h - ATM device driver declarations */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -8414,6 +8687,8 @@ + /* get AAL layer statistics */ +#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) + /* get AAL layer statistics and zero */ ++#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int) ++ /* enable or disable single-copy */ + +/* for ATM_GETTYPE */ +#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */ @@ -8434,6 +8709,10 @@ + char vci_bits; /* 1..16, ATM_CI_MAX (-1) for maximum */ +}; + ++/* for ATM_SETSC; actually taken from the ATM_VF number space */ ++ ++#define ATM_SC_RX 1024 /* enable RX single-copy */ ++#define ATM_SC_TX 2048 /* enable TX single-copy */ + +#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out + anyway */ @@ -8470,6 +8749,9 @@ + to be available */ +#define ATM_VF_AQREL 256 /* Arequipa socket is being released */ +#define ATM_VF_AQINUSE 512 /* socket is available for Arequipa use */ ++#define ATM_VF_SCRX ATM_SC_RX /* 1024; allow single-copy in the RX dir. */ ++#define ATM_VF_SCTX ATM_SC_TX /* 2048; allow single-copy in the TX dir. */ ++ + +struct atm_vcc { + unsigned short flags; /* VCC flags (ATM_VF_*) */ @@ -8576,6 +8858,7 @@ + unsigned char (*phy_get)(struct atm_dev *dev,unsigned long addr); + void (*feedback)(struct atm_vcc *vcc,struct sk_buff *skb, + unsigned long start,unsigned long dest,int len); ++ int (*change_qos)(struct atm_vcc *vcc,struct atm_qos *qos); +}; + + @@ -8595,11 +8878,11 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmsap.h Wed Aug 21 10:55:44 1996 -@@ -0,0 +1,129 @@ ++++ work/include/linux/atmsap.h Tue Oct 1 17:24:29 1996 +@@ -0,0 +1,124 @@ +/* atmsap.h - ATM Service Access Point addressing definitions */ + -+/* Written 1995 by Werner Almesberger, EPFL LRC */ ++/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ + + +#ifndef _LINUX_ATMSAP_H @@ -8674,11 +8957,6 @@ +#define ATM_IMD_EXTENDED 2 /* extended mode of operation */ +/* END_IMD */ + -+/* -+ * Selected ISO/IEC TR 9577 Network Layer Protocol Identifiers (NLPID) -+ */ -+ -+#define NLPID_IEEE802_1_SNAP 0x80 /* IEEE 802.1 SNAP */ + +/* + * SAP structures @@ -8727,7 +9005,7 @@ + +#endif --- ref/include/linux/skbuff.h Tue Aug 20 17:09:42 1996 -+++ work/include/linux/skbuff.h Fri Sep 27 14:37:42 1996 ++++ work/include/linux/skbuff.h Thu Oct 10 18:55:49 1996 @@ -112,6 +112,21 @@ unsigned char *end; /* End pointer */ void (*destructor)(struct sk_buff *); /* Destruct function */ @@ -8806,7 +9084,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmsvc.h Wed Sep 4 15:32:45 1996 ++++ work/include/linux/atmsvc.h Thu Oct 10 19:13:51 1996 @@ -0,0 +1,51 @@ +/* atmsvc.h - ATM signaling kernel-demon interface definitions */ + @@ -9094,8 +9372,8 @@ + return CLIP(dev)->number; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/common.c Thu Sep 26 23:16:16 1996 -@@ -0,0 +1,919 @@ ++++ work/net/atm/common.c Sun Oct 13 15:52:33 1996 +@@ -0,0 +1,928 @@ +/* net/atm/common.c - ATM sockets (common part for PVC and SVC) */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -9169,7 +9447,7 @@ + vcc->upper = NULL; + vcc->sock = sock; +#endif -+ vcc->flags = 0; ++ vcc->flags = ATM_VF_SCRX | ATM_VF_SCTX; + vcc->dev = NULL; + vcc->family = sock->ops->family; + vcc->alloc_tx = alloc_tx; @@ -9480,23 +9758,27 @@ + DPRINTK("RcvM %d -= %d\n",vcc->rx_inuse,skb->truesize); + atomic_sub(skb->truesize+ATM_PDU_OVHD,&vcc->rx_inuse); +#ifdef CONFIG_MMU_HACKS -+ mmucp_tofs((unsigned long) buff,eff_len,skb,(unsigned long) skb->data); -+#else ++ if (vcc->flags & ATM_VF_SCRX) ++ mmucp_tofs((unsigned long) buff,eff_len,skb, ++ (unsigned long) skb->data); ++ else ++#endif ++ { +#ifdef DUMP_PACKETS -+ if (vcc->vci==5 || vcc->vci >32) { -+ char buf[300]; -+ int i; ++ if (vcc->vci==5 || vcc->vci >32) { ++ char buf[300]; ++ int i; + -+ for(i=0;i<99 && i < skb->len;i++) { -+ sprintf(buf+i*3,"%2.2x ", -+ 0xff&skb->data[i]); -+ } -+ printk("recv %d:%s\n",vcc->vci,buf); -+ } ++ for(i=0;i<99 && i < skb->len;i++) { ++ sprintf(buf+i*3,"%2.2x ", ++ 0xff&skb->data[i]); ++ } ++ printk("recv %d:%s\n",vcc->vci,buf); ++ } +#endif -+ memcpy_tofs(buff,skb->data,eff_len); -+ kfree_skb(skb,FREE_READ); -+#endif ++ memcpy_tofs(buff,skb->data,eff_len); ++ kfree_skb(skb,FREE_READ); ++ } + return eff_len; +} + @@ -9522,8 +9804,8 @@ + if (!size) return 0; + /* verify_area is done by net/socket.c */ +#ifdef CONFIG_MMU_HACKS -+ if (vcc->dev->ops->sg_send && vcc->dev->ops->sg_send(vcc, -+ (unsigned long) buff,size)) { ++ if ((vcc->flags & ATM_VF_SCTX) && vcc->dev->ops->sg_send && ++ vcc->dev->ops->sg_send(vcc,(unsigned long) buff,size)) { + int res,max_iov; + + max_iov = 2+size/PAGE_SIZE; @@ -9667,10 +9949,12 @@ +int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg) +{ + struct atm_dev *dev; ++ struct atm_vcc *vcc; + unsigned long eff_arg; + int rsize,wsize,len; + int error; + ++ vcc = ATM_SD(sock); + rsize = wsize = 0; + switch (cmd) { + case ATM_GETNAMES: @@ -9692,29 +9976,35 @@ + buffer),&buf->length); + } + case SIOCGSTAMP: /* borrowed from IP */ -+ if (!ATM_SD(sock)->timestamp.tv_sec) return -ENOENT; -+ ATM_SD(sock)->timestamp.tv_sec += -+ ATM_SD(sock)->timestamp.tv_usec/1000000; -+ ATM_SD(sock)->timestamp.tv_usec %= 1000000; ++ if (!vcc->timestamp.tv_sec) return -ENOENT; ++ vcc->timestamp.tv_sec += vcc->timestamp.tv_usec/1000000; ++ vcc->timestamp.tv_usec %= 1000000; + error = verify_area(VERIFY_WRITE,(void *) arg, + sizeof(struct timeval)); + if (error) return error; -+ memcpy_tofs((void *) arg,&ATM_SD(sock)->timestamp, ++ memcpy_tofs((void *) arg,&vcc->timestamp, + sizeof(struct timeval)); + return 0; ++ case ATM_SETSC: ++ if (arg & ~(ATM_VF_SCRX | ATM_VF_SCTX)) return -EINVAL; ++ /* @@@ race condition - should split flags into ++ "volatile" and non-volatile part */ ++ vcc->flags = (vcc->flags & ~(ATM_VF_SCRX | ++ ATM_VF_SCTX)) | arg; ++ return 0; + case ATMSIGD_CTRL: + if (!suser()) return -EPERM; -+ error = sigd_attach(ATM_SD(sock)); ++ error = sigd_attach(vcc); + if (!error) sock->state = SS_CONNECTED; + return error; +#ifdef CONFIG_ATM_CLIP + case CLIP_PVC: + if (!suser()) return -EPERM; -+ return atm_init_clip(ATM_SD(sock)); ++ return atm_init_clip(vcc); + case CLIP_NULENCAP: + case CLIP_LLCENCAP: + if (!suser()) return -EPERM; -+ return clip_ioctl(ATM_SD(sock)->proto_data,NULL,cmd); ++ return clip_ioctl(vcc->proto_data,NULL,cmd); + /* rather crude hack ... */ +#endif +#ifdef CONFIG_ATM_ATMARP @@ -9723,18 +10013,18 @@ + return clip_create(arg); + case ATMARPD_CTRL: + if (!suser()) return -EPERM; -+ error = atm_init_atmarp(ATM_SD(sock)); ++ error = atm_init_atmarp(vcc); + if (!error) sock->state = SS_CONNECTED; + return error; + case ATMARP_MKIP: + if (!suser()) return -EPERM; -+ return atmarp_mkip(ATM_SD(sock),arg); ++ return atmarp_mkip(vcc,arg); + case ATMARP_SETENTRY: + if (!suser()) return -EPERM; -+ return atmarp_setentry(ATM_SD(sock),arg); ++ return atmarp_setentry(vcc,arg); + case ATMARP_ENCAP: + if (!suser()) return -EPERM; -+ return atmarp_encap(ATM_SD(sock),arg); ++ return atmarp_encap(vcc,arg); +#endif +#ifdef CONFIG_AREQUIPA + case AREQUIPA_PRESET: @@ -9752,7 +10042,7 @@ + return arequipa_incoming(sock); + case AREQUIPA_CTRL: + if (!suser()) return -EPERM; -+ error = arequipad_attach(ATM_SD(sock)); ++ error = arequipad_attach(vcc); + if (!error) sock->state = SS_CONNECTED; + return error; + case AREQUIPA_CLS3RD: @@ -9763,15 +10053,15 @@ +#ifdef CONFIG_ATM_LANE + case ATMLEC_CTRL: + if (!suser()) return -EPERM; -+ error = lecd_attach(ATM_SD(sock), (int)arg); ++ error = lecd_attach(vcc, (int)arg); + if (error >=0) sock->state = SS_CONNECTED; + return error; + case ATMLEC_MCAST: + if (!suser()) return -EPERM; -+ return lec_mcast_attach(ATM_SD(sock), (int)arg); ++ return lec_mcast_attach(vcc, (int)arg); + case ATMLEC_DATA: + if (!suser()) return -EPERM; -+ return lec_vcc_attach(ATM_SD(sock), (void*)arg); ++ return lec_vcc_attach(vcc, (void*)arg); +#endif + case ATM_GETTYPE: + wsize = -1; /* special - don't check length */ @@ -9885,10 +10175,7 @@ + char *optval,int optlen) +{ + struct atm_vcc *vcc; -+ int error; + -+ error = verify_area(VERIFY_READ,optval,optlen); -+ if (error) return -EINVAL; + vcc = ATM_SD(sock); + if (level == SOL_SOCKET) { + unsigned long value; @@ -9931,7 +10218,7 @@ + (vcc->qos.rxtp.min_pcr || + vcc->qos.rxtp.max_pcr))) + printk(KERN_WARNING "Warning: " -+ "semantics of ATM_UBR will change " ++ "semantics of ATM_UBR have changed " + "with min/max_pcr != 0\n"); + vcc->flags |= ATM_VF_HASQOS; + return 0; @@ -10092,8 +10379,8 @@ + free_atm_dev(dev); +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/pvc.c Thu Sep 26 14:30:53 1996 -@@ -0,0 +1,161 @@ ++++ work/net/atm/pvc.c Fri Oct 4 13:25:32 1996 +@@ -0,0 +1,175 @@ +/* net/atm/pvc.c - ATM PVC sockets */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -10201,7 +10488,21 @@ +static int pvc_setsockopt(struct socket *sock,int level,int optname, + char *optval,int optlen) +{ -+ /* put PVC-specific code here */ ++ struct atm_vcc *vcc; ++ int error; ++ ++ error = verify_area(VERIFY_READ,optval,optlen); ++ if (error) return -EINVAL; ++ vcc = ATM_SD(sock); ++ if (level == SOL_ATM && optname == SO_ATMQOS && ++ sock->state == SS_CONNECTED) { ++ struct atm_qos qos; ++ ++ if (optlen != sizeof(struct atm_qos)) return -EINVAL; ++ if (!vcc->dev->ops->change_qos) return -EOPNOTSUPP; ++ memcpy_fromfs(&qos,optval,optlen); ++ return vcc->dev->ops->change_qos(vcc,&qos); ++ } + return atm_setsockopt(sock,level,optname,optval,optlen); +} + @@ -10373,7 +10674,7 @@ + if (atm_vcc[i].family) fn(atm_vcc+i); +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/static.h Fri Sep 27 15:23:43 1996 ++++ work/net/atm/static.h Thu Oct 10 19:13:50 1996 @@ -0,0 +1,29 @@ +/* net/atm/static.h - Staticly allocated resources */ + @@ -10405,8 +10706,8 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/svc.c Fri Sep 27 15:16:06 1996 -@@ -0,0 +1,600 @@ ++++ work/net/atm/svc.c Fri Oct 4 13:11:53 1996 +@@ -0,0 +1,604 @@ +/* net/atm/svc.c - ATM SVC sockets */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -10961,6 +11262,10 @@ +static int svc_setsockopt(struct socket *sock,int level,int optname, + char *optval,int optlen) +{ ++ int error; ++ ++ error = verify_area(VERIFY_READ,optval,optlen); ++ if (error) return -EINVAL; + /* stuff for SVCs */ + return atm_setsockopt(sock,level,optname,optval,optlen); +} @@ -11230,7 +11535,7 @@ + return 0; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/signaling.h Fri Sep 27 15:23:43 1996 ++++ work/net/atm/signaling.h Thu Oct 10 19:13:51 1996 @@ -0,0 +1,25 @@ +/* net/atm/signaling.h - ATM signaling */ + @@ -11258,8 +11563,8 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/atmarp.c Thu Sep 26 14:24:39 1996 -@@ -0,0 +1,604 @@ ++++ work/net/atm/atmarp.c Sun Oct 13 18:41:26 1996 +@@ -0,0 +1,605 @@ +/* atmarp.c - RFC1577 ATM ARP */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -11691,7 +11996,8 @@ + memcpy_fromfs(&req,arg,sizeof(struct atmarpreq)); + if (req.arp_pa.sa_family != AF_INET) return -EPFNOSUPPORT; + ip = &((struct sockaddr_in *) &req.arp_pa)->sin_addr.s_addr; -+ if (!(*ip & ~dev->pa_mask) && !(req.arp_flags & ATF_ARPSRV)) ++ if (!(*ip & ~dev->pa_mask) && !(req.arp_flags & (ATF_ARPSRV | ++ ATF_DEFQOS))) + return -EINVAL; + switch (cmd) { + case SIOCSARP: @@ -11757,9 +12063,9 @@ + dev->name = PRIV(dev)->name; + sprintf(dev->name,"atm%d",number); + dev->init = clip_init; -+ if (register_netdev(dev)) return -EIO; /* free dev ? */ + PRIV(dev)->number = number; + PRIV(dev)->table = NULL; ++ if (register_netdev(dev)) return -EIO; /* free dev ? */ + PRIV(dev)->next = clip_devs; + clip_devs = dev; + DPRINTK("registered (net:%s)\n",dev->name); @@ -11865,7 +12171,7 @@ + return 0; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/atmarp.h Fri Sep 27 15:23:43 1996 ++++ work/net/atm/atmarp.h Sun Oct 13 14:14:43 1996 @@ -0,0 +1,53 @@ +/* net/atm/atmarp.h - RFC1577 ATM ARP */ + @@ -11921,7 +12227,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/ipcommon.h Fri Sep 27 15:24:41 1996 ++++ work/net/atm/ipcommon.h Thu Oct 10 19:14:42 1996 @@ -0,0 +1,73 @@ +/* net/atm/ipcommon.h - Common items for all ways of doing IP over ATM */ + @@ -12214,8 +12520,8 @@ + return number; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/arequipa.c Fri Sep 27 18:29:03 1996 -@@ -0,0 +1,417 @@ ++++ work/net/atm/arequipa.c Thu Oct 10 20:49:08 1996 +@@ -0,0 +1,418 @@ +/* net/atm/arequipa.c - Application requested IP over ATM */ + +/* Written 1996 by Jean-Michel Pittet and Werner Almesberger, EPFL LRC */ @@ -12501,6 +12807,7 @@ +{ + int error; + ++ if (upper->state == TCP_LISTEN) return -EPROTO; + if (!aqd) { + printk(KERN_ERR "arequipa_preset: no Arequipa demon\n"); + return -EUNATCH; @@ -12663,7 +12970,7 @@ + +#endif --- ref/net/ipv4/af_inet.c Sun Aug 4 11:56:25 1996 -+++ work/net/ipv4/af_inet.c Thu Aug 29 15:37:26 1996 ++++ work/net/ipv4/af_inet.c Thu Oct 10 20:44:29 1996 @@ -105,6 +105,14 @@ #include #endif @@ -12690,7 +12997,17 @@ if(sk->opt) kfree(sk->opt); ip_rt_put(sk->ip_route_cache); -@@ -662,6 +674,10 @@ +@@ -529,6 +541,9 @@ + { + struct sock *sk = (struct sock *) sock->data; + ++#ifdef CONFIG_AREQUIPA ++ if (sk->aq_route && sk->ip_route_cache == sk->aq_route) return -EPROTO; ++#endif + if(inet_autobind(sk)!=0) + return -EAGAIN; + +@@ -662,6 +677,10 @@ sk_free(sk); return(-ESOCKTNOSUPPORT); } @@ -12701,7 +13018,7 @@ sk->socket = sock; #ifdef CONFIG_TCP_NAGLE_OFF sk->nonagle = 1; -@@ -1339,7 +1355,18 @@ +@@ -1339,7 +1358,18 @@ return((*dlci_ioctl_hook)(cmd, (void *) arg)); #endif return -ENOPKG; @@ -13204,7 +13521,7 @@ + +#endif --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/mmuio.h Fri Sep 27 15:23:43 1996 ++++ work/include/linux/mmuio.h Thu Oct 10 19:13:50 1996 @@ -0,0 +1,25 @@ +/* mmuio.h - MMU-supported high-speed I/O */ + @@ -13394,7 +13711,7 @@ + +#endif --- ref/include/linux/netdevice.h Tue Aug 20 17:11:35 1996 -+++ work/include/linux/netdevice.h Fri Sep 27 15:20:29 1996 ++++ work/include/linux/netdevice.h Thu Oct 10 18:55:50 1996 @@ -185,6 +185,8 @@ int (*set_mac_address)(struct device *dev, void *addr); #define HAVE_PRIVATE_IOCTL @@ -13414,8 +13731,8 @@ extern int ether_config(struct device *dev, struct ifmap *map); /* Support for loadable net-drivers */ --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmarp.h Mon Sep 2 19:12:43 1996 -@@ -0,0 +1,98 @@ ++++ work/include/linux/atmarp.h Thu Oct 10 22:21:34 1996 +@@ -0,0 +1,99 @@ +/* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */ + +/* Written 1995,1996 by Werner Almesberger, EPFL LRC */ @@ -13451,6 +13768,7 @@ + +#define ATF_NULL 0x040 /* use NULL encapsulation */ +#define ATF_ARPSRV 0x080 /* entry describes ARP server */ ++#define ATF_DEFQOS 0x100 /* entry defines default QOS */ + + +#define MAX_ATMARP_SIZE (sizeof(struct atmarphdr)-1+2*(ATM_E164_LEN+ \ @@ -13590,7 +13908,7 @@ /* Tell the sender its packet died... */ icmp_send(skb, ICMP_TIME_EXCEEDED, ICMP_EXC_TTL, 0, dev); --- ref/include/linux/proc_fs.h Tue Aug 20 17:09:42 1996 -+++ work/include/linux/proc_fs.h Thu Sep 26 19:23:39 1996 ++++ work/include/linux/proc_fs.h Thu Oct 10 18:55:49 1996 @@ -34,6 +34,7 @@ PROC_KSYMS, PROC_DMA, @@ -14275,8 +14593,8 @@ /* * can't register TGA yet, because PCI bus probe has *not* taken --- ref/init/main.c Mon May 20 19:33:57 1996 -+++ work/init/main.c Wed Aug 21 10:55:58 1996 -@@ -172,6 +172,8 @@ ++++ work/init/main.c Fri Oct 4 13:16:14 1996 +@@ -172,9 +172,14 @@ #endif @@ -14285,14 +14603,33 @@ #if defined(CONFIG_SYSVIPC) || defined(CONFIG_KERNELD) extern void ipc_init(void); #endif -@@ -409,6 +411,7 @@ ++#ifdef CONFIG_BIGPHYS_AREA ++extern void bigphysarea_setup(char *str, int *ints); ++#endif + + /* + * Boot command-line arguments +@@ -409,6 +414,10 @@ #ifdef CONFIG_BAYCOM { "baycom=", baycom_setup }, #endif ++#ifdef CONFIG_BIGPHYS_AREA ++ { "bigphysarea=", bigphysarea_setup }, ++#endif + { "scon=", serial_console_setup }, { 0, 0 } }; +@@ -799,6 +808,9 @@ + memory_start = console_init(memory_start,memory_end); + #ifdef CONFIG_PCI + memory_start = pci_init(memory_start,memory_end); ++#endif ++#ifdef CONFIG_BIGPHYS_AREA ++ memory_start = bigphysarea_init(memory_start,memory_end); + #endif + memory_start = kmalloc_init(memory_start,memory_end); + sti(); --- ref/drivers/block/genhd.c Tue Aug 20 15:44:45 1996 +++ work/drivers/block/genhd.c Wed Aug 21 10:55:59 1996 @@ -53,6 +53,7 @@ @@ -14426,7 +14763,7 @@ * Called once on startup. */ --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/atmlec.h Thu Sep 26 22:12:04 1996 ++++ work/include/linux/atmlec.h Thu Oct 10 19:13:50 1996 @@ -0,0 +1,64 @@ +/* + * @@ -15138,7 +15475,7 @@ + return i; +} --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/lec.h Fri Sep 27 15:23:43 1996 ++++ work/net/atm/lec.h Thu Oct 10 19:13:50 1996 @@ -0,0 +1,107 @@ +/* + * @@ -16299,7 +16636,7 @@ +} + --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/net/atm/lec_arpc.h Fri Sep 27 15:23:43 1996 ++++ work/net/atm/lec_arpc.h Thu Oct 10 19:13:50 1996 @@ -0,0 +1,102 @@ +/* + * Lec arp cache @@ -16404,7 +16741,7 @@ + +#endif --- ref/include/net/route.h Tue Aug 20 17:14:55 1996 -+++ work/include/net/route.h Fri Sep 27 15:22:44 1996 ++++ work/include/net/route.h Thu Oct 10 19:12:48 1996 @@ -26,6 +26,7 @@ #define _ROUTE_H @@ -16468,7 +16805,7 @@ #endif /* _ROUTE_H */ --- ref/include/net/sock.h Tue Aug 20 17:11:40 1996 -+++ work/include/net/sock.h Fri Sep 27 15:20:29 1996 ++++ work/include/net/sock.h Thu Oct 10 18:55:50 1996 @@ -301,7 +301,13 @@ int ip_mc_loop; /* Loopback */ char ip_mc_name[MAX_ADDR_LEN];/* Multicast device name */ @@ -16485,8 +16822,8 @@ /* * This part is used for the timeout functions (timer.c). --- /dev/null Mon Jul 18 01:46:18 1994 -+++ work/include/linux/arequipa.h Fri Sep 27 22:23:31 1996 -@@ -0,0 +1,55 @@ ++++ work/include/linux/arequipa.h Thu Oct 10 19:13:50 1996 +@@ -0,0 +1,46 @@ +/* arequipa.h - Arequipa interface definitions */ + +/* Written 1996 by Jean-Michel Pittet and Werner Almesberger, EPFL LRC */ @@ -16497,15 +16834,6 @@ + +#include + -+/* -+ * Arequipa is identified by a so-called "Vendor-Specific Application -+ * identifier" in the Q.2931 B-HLI IE. That identifier consists of three -+ * bytes with the OUI, followed by four bytes assigned by the organization -+ * owning the OUI. -+ */ -+ -+#define EPFL_OUI "\x00\x60\xD7" -+#define AREQUIPA_HLT_VS_ID EPFL_OUI "\x01\x00\x00\x01" + +#define AREQUIPA_PRESET _IO('a',ATMIOC_AREQUIPA) +#define AREQUIPA_INCOMING _IO('a',ATMIOC_AREQUIPA+1) @@ -16604,3 +16932,158 @@ /* * We may need to add it to the backlog here. +--- /dev/null Mon Jul 18 01:46:18 1994 ++++ work/include/linux/bigphysarea.h Fri Oct 4 13:14:31 1996 +@@ -0,0 +1,25 @@ ++/* linux/mm/bigphysarea.h, M. Welsh (mdw@cs.cornell.edu) ++ * Copyright (c) 1996 by Matt Welsh. ++ * ++ * This is a set of routines which allow you to reserve a large (?) ++ * amount of physical memory at boot-time, which can be allocated/deallocated ++ * by drivers. This memory is intended to be used for devices such as ++ * video framegrabbers which need a lot of physical RAM (above the amount ++ * allocated by kmalloc). This is by no means efficient or recommended; ++ * to be used only in extreme circumstances. ++ * ++ */ ++ ++#ifndef __LINUX_BIGPHYSAREA_H ++#define __LINUX_BIGPHYSAREA_H ++ ++#include ++ ++extern caddr_t bigphysarea; ++ ++extern void bigphysarea_setup(char *str, int *ints); ++extern unsigned long bigphysarea_init(unsigned long mem_start, unsigned long mem_end); ++extern caddr_t bigphysarea_alloc(int size); ++extern void bigphysarea_free(caddr_t addr, int size); ++ ++#endif __LINUX_BIGPHYSAREA_H +--- ref/mm/Makefile Fri Mar 22 11:56:56 1996 ++++ work/mm/Makefile Fri Oct 4 13:14:32 1996 +@@ -12,4 +12,8 @@ + kmalloc.o vmalloc.o \ + swap.o vmscan.o page_io.o page_alloc.o swap_state.o swapfile.o + ++ifeq ($(CONFIG_BIGPHYS_AREA),y) ++ O_OBJS += bigphysarea.o ++endif ++ + include $(TOPDIR)/Rules.make +--- /dev/null Mon Jul 18 01:46:18 1994 ++++ work/mm/bigphysarea.c Fri Oct 4 13:14:32 1996 +@@ -0,0 +1,113 @@ ++/* linux/mm/bigphysarea.c, M. Welsh (mdw@cs.cornell.edu) ++ * Copyright (c) 1996 by Matt Welsh. ++ * ++ * This is a set of routines which allow you to reserve a large (?) ++ * amount of physical memory at boot-time, which can be allocated/deallocated ++ * by drivers. This memory is intended to be used for devices such as ++ * video framegrabbers which need a lot of physical RAM (above the amount ++ * allocated by kmalloc). This is by no means efficient or recommended; ++ * to be used only in extreme circumstances. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static int bigphysarea_pages = 0; ++static unsigned char *bigphysarea_map; ++caddr_t bigphysarea; ++ ++#define BIGPHYS_FREE 0 ++#define BIGPHYS_INUSE 1 ++ ++void bigphysarea_setup(char *str, int *ints) { ++ if (ints[0] != 1) { ++ printk("bigphysarea_setup: Usage: bigphysarea=\n"); ++ } else { ++ bigphysarea_pages = ints[1]; ++ } ++} ++ ++unsigned long bigphysarea_init(unsigned long mem_start, unsigned long mem_end) { ++ int ncp, i; ++ ++ if (bigphysarea_pages == 0) return mem_start; ++ ++ ncp = (bigphysarea_pages / PAGE_SIZE) + 1; ++ bigphysarea_map = (caddr_t)((mem_start + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1)); ++ bigphysarea = bigphysarea_map + (ncp * PAGE_SIZE); ++ ++ printk("bigphysarea: Allocated %d pages at 0x%lx.\n", ++ bigphysarea_pages, (unsigned long)bigphysarea); ++ ++ for (i = 0; i < bigphysarea_pages; i++) { ++ bigphysarea_map[i] = BIGPHYS_FREE; ++ } ++ ++ return (unsigned long)(bigphysarea + (bigphysarea_pages * PAGE_SIZE)); ++} ++ ++caddr_t bigphysarea_alloc(int size) { ++ int i, j, n; ++ ++ n = (size / PAGE_SIZE) + 1; ++ ++ i = 0; ++ ++try_again: ++ /* Get the first unallocated page */ ++ for (; i < bigphysarea_pages; i++) { ++ if (bigphysarea_map[i] == BIGPHYS_FREE) break; ++ } ++ if (i == bigphysarea_pages) return NULL; ++ ++ /* Check out the region */ ++ for (j = i; (j < bigphysarea_pages) && (j < (i + n)); j++) { ++ if (bigphysarea_map[i] != BIGPHYS_FREE) break; ++ } ++ ++ if (j == (i + n)) { ++ /* Got it */ ++ for (j = i; (j < (i + n)); j++) { ++ bigphysarea_map[j] = BIGPHYS_INUSE; ++ } ++ return bigphysarea + (i * PAGE_SIZE); ++ } ++ ++ /* Try again ... */ ++ i = j; ++ goto try_again; ++ ++} ++ ++void bigphysarea_free(caddr_t addr, int size) { ++ int i, j; ++ int n = (size / PAGE_SIZE) + 1; ++ ++ i = (((unsigned int)addr - (unsigned int)bigphysarea)/PAGE_SIZE); ++ for (j = 0; j < n; j++) { ++ if (bigphysarea_map[i+j] != BIGPHYS_INUSE) return; ++ bigphysarea_map[i+j] = BIGPHYS_FREE; ++ } ++} diff -ur --new-file old/atm/debug/Makefile new/atm/debug/Makefile --- old/atm/debug/Makefile Thu Sep 26 20:52:26 1996 +++ new/atm/debug/Makefile Fri Oct 11 19:19:45 1996 @@ -1,4 +1,4 @@ -SYSPGMS=ed encopy endump zndump znth +SYSPGMS=delay ed encopy endump zndump znth MAN8= include ../Rules.make diff -ur --new-file old/atm/debug/delay.c new/atm/debug/delay.c --- old/atm/debug/delay.c Thu Jan 1 01:00:00 1970 +++ new/atm/debug/delay.c Fri Oct 11 20:34:02 1996 @@ -0,0 +1,250 @@ +/* delay.c - Simplistic AAL5-level software delay line */ + +/* Written 1996 by Werner Almesberger, EPFL-LRC */ + + +/* + * BUGS: + * - delay increases with load + * - processing delay is far too big (always measure with ping first) + * - horrifying command-line syntax + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "atm.h" + + +typedef struct _packet { + struct timeval due; + int size; + struct _packet *next; + char data[1]; +} PACKET; + +typedef struct _link { + int in,out; + struct timeval delay; + PACKET *queue,*last; + struct _link *next; +} LINK; + + +static LINK *links = NULL; +static fd_set in; +static int fds = 0; + + +#define LESS(a,b) ((a).tv_sec < (b).tv_sec || ((a).tv_sec == (b).tv_sec && \ + (a).tv_usec < (b).tv_usec)) + + +static void loop(void) +{ + LINK *link; + PACKET *p; + struct timeval now,next,delta,*to; + fd_set curr; + char *buffer; + int ready,size; + + if (!(buffer = malloc(sizeof(PACKET)-1+ATM_MAX_AAL5_PDU+4095))) { + perror("buffer"); + exit(1); + } + buffer = (char *) (((unsigned long) buffer+4095-(sizeof(PACKET)-1)) & + ~4095); + if (gettimeofday(&now,NULL) < 0) { + perror("gettimeofday"); + exit(1); + } + while (1) { + curr = in; + for (link = links; link; link = link->next) + if (link->queue) break; + if (!link) to = NULL; + else { + for (next = link->queue->due; link; link = link->next) + if (link->queue && LESS(link->queue->due,next)) + next = link->queue->due; + delta.tv_sec = next.tv_sec-now.tv_sec; + delta.tv_usec = next.tv_usec-now.tv_usec; + if (delta.tv_usec < 0) { + delta.tv_sec--; + delta.tv_usec += 1000000; + } + if (delta.tv_usec > 0) { + delta.tv_sec++; + delta.tv_usec -= 1000000; + } + if (delta.tv_sec < 0) delta.tv_sec = delta.tv_usec = 0; + to = δ + } + if ((ready = select(fds,&curr,NULL,NULL,to)) < 0) { + perror("select"); + exit(1); + } + if (gettimeofday(&now,NULL) < 0) { + perror("gettimeofday"); + exit(1); + } + if (ready) + for (link = links; link; link = link->next) + while (1) { + size = read(link->in,buffer,ATM_MAX_AAL5_PDU); + if (size < 0) + if (errno == EAGAIN) break; + else { + perror("read"); + exit(1); + } + if (size > 1) { + if (!(p = malloc(sizeof(PACKET)-1+size))) { + perror("malloc"); + exit(1); + } + memcpy(p->data,buffer,size); + p->size = size; + p->due.tv_sec = now.tv_sec+link->delay.tv_sec; + p->due.tv_usec = now.tv_usec+link->delay.tv_usec; + if (p->due.tv_usec > 1000000) { + p->due.tv_sec++; + p->due.tv_usec -= 1000000; + } + p->next = NULL; + if (link->queue) link->last->next = p; + else link->queue = p; + link->last = p; + } + } + for (link = links; link; link = link->next) + while (link->queue && LESS(link->queue->due,now)) { + p = link->queue; + link->queue = p->next; + if ((size = write(link->out,p->data,p->size)) < 0) { + perror("write"); + exit(1); + } + if (p->size != size) + fprintf(stderr,"short write: %d < %d\n",size,p->size); + free(p); + } + } +} + + +static int setup(char *spec,int tx) +{ + struct sockaddr_atmpvc addr; + struct atm_qos qos; + char *here; + int fd; + + if (!(here = strchr(spec,','))) { + memset(&qos,0,sizeof(qos)); + if (tx) qos.txtp.traffic_class = ATM_UBR; + else qos.rxtp.traffic_class = ATM_UBR; + } + else { + *here = 0; + if (text2qos(here+1,&qos,0) < 0) { + fprintf(stderr,"invalid QOS: %s\n",here+1); + exit(1); + } + } + if (tx) qos.rxtp.traffic_class = ATM_NONE; + else qos.txtp.traffic_class = ATM_NONE; + if (text2atm(spec,(struct sockaddr *) &addr,sizeof(addr), + T2A_PVC | T2A_NAME) < 0) { + fprintf(stderr,"invalid PVC: %s\n",spec); + exit(1); + } + if ((fd = socket(PF_ATMPVC,SOCK_DGRAM,ATM_AAL5)) < 0) { + perror("socket"); + exit(1); + } + if (setsockopt(fd,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { + perror("setsockopt SO_ATMQOS"); + exit(1); + } + if (bind(fd,(struct sockaddr *) &addr,sizeof(addr)) < 0) { + perror("bind"); + exit(1); + } + return fd; +} + + +static void usage(const char *name) +{ + fprintf(stderr,"usage: %s path ...\n",name); + fprintf(stderr," path :== vc/vc/delay\n"); + fprintf(stderr," vc :== [itf.]vpi.vci[,qos_spec]\n"); + fprintf(stderr," delay :== timeunit\n"); + fprintf(stderr," unit :== s | ms | us\n"); + exit(1); +} + + +int main(int argc,char **argv) +{ + LINK *dsc; + const char *name; + unsigned long delay; + char *end,*here; + + name = argv[0]; + FD_ZERO(&in); + while (argc > 1) { + argc--; + argv++; + if (!(dsc = malloc(sizeof(LINK)))) { + perror("malloc"); + return 1; + } + if (!(here = strtok(*argv,"/"))) usage(name); + dsc->in = setup(here,0); + FD_SET(dsc->in,&in); + if (dsc->in >= fds) fds = dsc->in+1; + if (fcntl(dsc->in,F_SETFL,O_NONBLOCK) < 0) { + perror("fcntl"); + return 1; + } + if (!(here = strtok(NULL,"/"))) usage(name); + dsc->out = setup(here,1); + if (!(here = strtok(NULL,"/"))) usage(name); + delay = strtoul(here,&end,10); + switch (*end) { + case 's': + dsc->delay.tv_sec = delay; + dsc->delay.tv_usec = 0; + break; + case 'm': + dsc->delay.tv_sec = delay/1000; + dsc->delay.tv_usec = (delay % 1000)*1000; + if (*++end != 's') usage(name); + break; + case 'u': + dsc->delay.tv_sec = 0; + dsc->delay.tv_usec = delay; + if (*++end != 's') usage(name); + break; + default: + usage(name); + } + if (end[1]) usage(name); + dsc->queue = dsc->last = NULL; + dsc->next = links; + links = dsc; + } + loop(); + return 0; +} diff -ur --new-file old/atm/doc/usage.tex new/atm/doc/usage.tex --- old/atm/doc/usage.tex Fri Sep 27 22:47:28 1996 +++ new/atm/doc/usage.tex Mon Oct 14 19:06:00 1996 @@ -1,7 +1,7 @@ %%def%:= %:\begin{verbatim} -%:Usage instructions - ATM on Linux, release 0.19 (pre-alpha) +%:Usage instructions - ATM on Linux, release 0.20 (pre-alpha) %:------------------------------------------------------------- %: %:\end{verbatim} @@ -38,14 +38,14 @@ \title{ATM on Linux \\ User's guide \\ - Release 0.19 (pre-alpha)} + Release 0.20 (pre-alpha)} \author{Werner Almesberger \\ {\tt werner.almesberger@lrc.di.epfl.ch} \\ \\ Laboratoire de R\'eseaux de Communication (LRC) \\ EPFL, CH-1015 Lausanne, Switzerland} -\date{September 27, 1996} +\date{October 14, 1996} \begin{document} \maketitle @@ -81,7 +81,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.18.tar.gz} + \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.20.tar.gz} \item the Linux kernel, version 2.0.14, e.g. from \url{ftp://ftp.cs.helsinki.fi/pub/Software/Linux/Kernel/v2.0/linux-2.0.14.tar.gz} \item Perl, version 4 or 5 @@ -98,7 +98,7 @@ distribution: \begin{verbatim} -tar xfz atm-0.18.tar.gz +tar xfz atm-0.20.tar.gz \end{verbatim} and the kernel source: @@ -134,10 +134,11 @@ \item[\path{atm/lane/}] LAN Emulation servers: \name{bus}, \name{lecs}, \name{les} \item[\path{atm/aqd/}] Arequipa demon: \name{arequipad} - \item[\path{atm/debug/}] Debugging tools: \name{ed}, \name{en}, - \name{encopy}, \name{endump}, \name{zndump}, and \name{znth} + \item[\path{atm/debug/}] Debugging tools: \name{delay}, \name{ed}, + \name{en}, \name{encopy}, \name{endump}, \name{zndump}, and \name{znth} \item[\path{atm/lib/}] Libraries for applications and demons \item[\path{atm/doc/}] Documentation in \LaTeX\ and conversion tools + \item[\path{atm/man/}] Miscellaneous man pages \end{description} @@ -505,33 +506,8 @@ On adapters where the device driver supports access to raw cells (``AAL0''), individual cells can be composed and received with the \name{atmdump} program. -\name{atmdump} is invoked as follows for receiving cells: -\begin{command} -atmdump \[\meta{itf}.\]\meta{vpi}.\meta{vci} -\end{command} - -For composing cells, the invocation is as follows: - -\begin{command} -atmdump -t \meta{type} \[-g \meta{gfc}\] \[-c\] - \[\meta{itf}.\]\meta{vpi}.\meta{vci} -\end{command} - -\begin{description} - \item[\raw{-t \meta{type}}] specifies the cell payload type indicator (PTI) - value (0-7, defined in - \cite{I361}). A list of valid payload types can be obtained by running - \name{atmdump} without arguments. - \item[\raw{-g \meta{gfc}}] specifies the generic flow control (GFC) value, - 0-15. By default, \name{atmdump} uses 0. - \item[\raw{-c}] sets the cell loss priority (CLP) bit. By default, - \name{atmdump} sends cells with CLP=0. -\end{description} - -Also, \name{atmdump} expects the cell payload on standard input. If only -less than 48 bytes can be read, the remaining space is padded with zero -bytes. +Man page: \name{atmdump.8} Example: {\footnotesize @@ -583,45 +559,10 @@ \subsection{Signaling demon} -The signaling demon is started as follows - -\begin{command} -\# atmsigd \[-b\] \[-c \meta{config\_file}\] \[-d\] \[-D \meta{dump\_dir}\] - \[-l \meta{logfile}\] \[-n\] \[-N\] \[-P \meta{pcr}\] - \[-t \meta{trace\_length}\] -\end{command} - -\begin{description} - \item[\raw{-b}] background. Run in a forked child process after initializing. - \item[\raw{-c \meta{config\_file}}] use the specified configuration file - instead of \path{/etc/atmsigd.conf} - \item[\raw{-d}] enables (lots of) debugging output. By default, - \name{atmsigd} is comparably quiet. - \item[\raw{-D \meta{dump\_dir}}] specifies the directory to which - \name{atmsigd} will write status and trace dumps. If tracing is not yet - enabled, the trace size is automatically set to a (small) default value. - \item[\raw{-l \meta{logfile}}] write diagnostic messages to the specified - file instead of to standard error. The special name \raw{syslog} is - used to send diagnostics to the system logger. - \item[\raw{-n}] prints addresses in numeric format only, i.e. no address to - name translation is attempted. - \item[\raw{-N}] makes \name{atmsigd} behave like the network side of the UNI - (useful if you have two PCs but no switch). Normally, it acts as the - user side. - \item[\raw{-P \meta{pcr}}] configures the signaling VC to use CBR at the - specified peak cell rate. By default, UBR is used on the signaling VC. - \item[\raw{-t \meta{trace\_length}}] enables tracing and sets the number - of entries that should be kept in the trace buffer. -omitted. - -\end{description} - -If \name{atmsigd} is killed, all system calls requiring interaction with it -will return with an error and set \name{errno} to \name{EUNATCH}. +Man pages: \name{atmsigd.8}, \name{atmsigd.conf.4} -Note that \name{atmsigd} provides only very limited functionality. -Signaling is known to work for Classical IP over ATM with a Fore ASX-200 -switch. +Note that \name{atmsigd}'s support for point-to-multipoint is very limited: +only operation as a single leaf of a point-to-multipoint tree works. By default, \name{atmsigd} is configured to conform to UNI 3.0. It can be compiled for UNI 3.1 by changing the \raw{STANDARDS=} line at the beginning @@ -634,7 +575,6 @@ \name{atmsigd} also looks for a configuration file \path{atmsigd.conf} in the current directory. -%%% {\bf NOT YET DOCUMENTED} \subsection{ILMI demon} @@ -683,36 +623,10 @@ If your switch doesn't support ILMI, you have to set the ATM address manually on the switch and on the PC(s). On the Linux side, make sure that -\name{ilmid} doesn't run, then use the -\name{atmaddr} command to set the address: +\name{ilmid} doesn't interfere, then use the \name{atmaddr} command to set +the address(es). -\begin{command} -\# atmaddr -a \[\meta{itf}\] \meta{atm\_address} -\end{command} - -e.g. - -\begin{verbatim} -# atmaddr -a 47.0005.80.ffe100.0000.f215.1065.0020EA000755.00 -\end{verbatim} - -\name{atmaddr} without arguments shows the current local addresses. They -are printed in numeric format only if the option \raw{-n} is given. Addresses -can be deleted with - -\begin{command} -\# atmaddr -d \[\meta{itf}\] \meta{atm\_address} -\end{command} - -The whole list of local addresses of an interface can be reset (i.e. erased) -with - -\begin{command} -\# atmaddr -r \[\meta{itf}\] -\end{command} - -\name{atmaddr} always defaults to interface zero if the interface number is -omitted. +Man pages: \name{atmaddr.8} Manual configuration of ATM addresses on the switch depends on the brand. On a Fore ASX-200, it can be done with the following command: @@ -750,24 +664,24 @@ \begin{verbatim} % echo 09 03 80 00 05 5A 80 00 06 08 80 00 02 81 83 00 48 \ 00 00 08 | ./q.dump -_pdsc = 9 +_pdsc = 9 "Q.2931 user-network call/connection control message" _cr_len = 3 call_ref = 8388613 (0x800005) -msg_type = 90 (0x5a) +msg_type = 0x5a "RELEASE COMPLETE" _ext = 1 -_flag = 0 -_action_ind = 0 +_flag = 0 "instruction field not significant" +_action_ind = 0 "clear call" msg_len = 6 (0x6) - _ie_id = ATM_IE_CAUSE + _ie_id = 0x08 "Cause" _ext = 1 - _cs = 0 - _flag = 0 - _action_ind = 0 + cause_cs = 0 "ITU-T standardized" + _flag = 0 "instruction field not significant" + _action_ind = 0 "clear call" _ie_len = 2 (0x2) _ext = 1 - location = 1 (0x1) + location = 1 "private network serving the local user" _ext = 1 - cause = ATM_CV_NO_ROUTE_DEST + cause = 3 "no route to destination" \end{verbatim} @@ -802,13 +716,7 @@ For a better but still immature mechanism see section \ref{atmarpd}. First, the VCCs have to be established. Become root on both machines -and run the \name{clip} program (see also on the man page) on each of them: - -\begin{command} -\# clip \[-0\] \[\meta{interface}.\]\meta{vpi}.\meta{vci} \[\meta{pcr}\] -\end{command} - -e.g. +and run \name{clip} (see \name{clip.8}) on each of them, e.g.: \begin{verbatim} a# clip 0.40 @@ -853,24 +761,7 @@ The actual kernel part maintains a small lookup table only containing partial information. -The ATMARP demon is started as follows - -\begin{command} -\# atmarpd \[-b\] \[-d\] \[-D \meta{directory}\] \[-l \meta{logfile}\] \[-n\] -\end{command} - -\begin{description} - \item[\raw{-b}] background. Run in a forked child process after initializing. - \item[\raw{-d}] enables (lots of) debugging output. By default, - \name{atmarpd} is comparably quiet. - \item[\raw{-D \meta{directory}}] changes the directory where \name{atmarpd} - writes its table (see below). By default, \path{/var/run} is used. - \item[\raw{-l \meta{logfile}}] write diagnostic messages to the specified - file instead of to standard error. The special name \raw{syslog} is - used to send diagnostics to the system logger. - \item[\raw{-n}] prints addresses in numeric format only, i.e. no address to - name translation is attempted. -\end{description} +Man pages: \name{atmarpd.8}, \name{atmarp.8} \name{atmsigd} and \name{ilmid} must already be running when \name{atmarpd} is started. Use the \raw{-b} option to make sure they're properly synchronized, @@ -896,10 +787,6 @@ frequently doesn't (yet). -\name{atmarpd} implements a variant of ATMARP as defined in RFC1577 and -RFC1755 \cite{RFC1755}. There are still several known errors and protocol -violations. (And probably a lot of unknown problems too.) - The \name{atmarp} program is used to configure ATMARP. First, you have to start \name{atmsigd}, \name{ilmid}, and \name{atmarpd}, then create an IP interface and configure it: @@ -918,16 +805,7 @@ # route add -net 10.0.0.0 \end{verbatim} -If \raw{atmarp -c} is used without specifying an interface, it allocates -the next available interface and prints its name on standard output. - -If only PVCs will be used, they can now be created with - -\begin{command} -\# atmarp -s \meta{ip\_address} \meta{pvc\_address} \[temp\] \[null\] -\end{command} - -e.g. +If only PVCs will be used, they can now be created with a command like \begin{verbatim} # atmarp -s 10.0.0.4 0.0.70 @@ -937,21 +815,11 @@ Note that ARP requires LLC/SNAP encapsulation. NULL encapsulation can therefore only be used for PVCs. -Permanent entries will never time out and therefore do not generate any -ARP traffic, but \name{atmarpd} responds if the other party sends -InARP requests. - When using SVCs, some additional configuration work may be necessary. If the machine is acting as the ATMARP server on that LIS, no additional configuration is necessary. Otherwise, the ATM address of the ATMARP server has to be configured. This is done by creating an entry for the -network address with the option \raw{arpsrv} set: - -\begin{command} -\# atmarp -s \meta{network\_address} \meta{atm\_address\_of\_server} arpsrv -\end{command} - -e.g. +network address with the option \raw{arpsrv} set, e.g. \begin{verbatim} # atmarp -s \ @@ -962,24 +830,6 @@ Note that the ATMARP server currently has to be started and configured before any clients are configured. -Additional SVC entries can be created with - -\begin{command} -\# atmarp -s \meta{ip\_address} \meta{atm\_address} -\end{command} - -There is also a (probably not very useful) \raw{temp} option for SVCs. -All \raw{atmarp -s} commands also accept an option \raw{pcr \meta{value}} -to change the connection to CBR (default is UBR) and to set the peak cell -rate. - -\begin{command} -\# atmarp -d \meta{ip\_address} -\end{command} - -deletes ARP entries. The option \raw{arpsrv} has to be specified for -deleting the ARP server entry. - The kernel ATMARP table can be read via \path{/proc/atm/arp}. The table used by \name{atmarpd} is regularly printed on standard error if \name{atmarpd} is started with the \raw{-d} option. If \name{atmarpd} is invoked without @@ -996,28 +846,17 @@ file \path{atm/led/USAGE}, LANE server support is described in \path{atm/lane/USAGE}. +Man pages: \name{bus.8}, \name{lecs.8}, \name{les.8}, and \name{zeppelin.8} + \subsection{Arequipa} Arequipa (Application REQUested IP over ATM, \cite{Arequipa}) is an extension to IP over ATM that adds support for using direct ATM connections (with QOS parameters, etc.) to carry traffic between INET sockets. On a system that -should use Arequipa connections, the Arequipa demon has to be started: +should use Arequipa connections, the Arequipa demon has to run. -\begin{command} -\# arequipad \[-b\] \[-d\] \[-l \meta{logfile}\] \[-n\] -\end{command} - -\begin{description} - \item[\raw{-b}] background. Run in a forked child process after initializing. - \item[\raw{-d}] enables debugging output. By default, \name{arequipad} is - very quiet. - \item[\raw{-l \meta{logfile}}] write diagnostic messages to the specified - file instead of to standard error. The special name \raw{syslog} is - used to send diagnostics to the system logger. - \item[\raw{-n}] prints addresses in numeric format only, i.e. no address to - name translation is attempted. -\end{description} +Man page: \name{arequipad.8} The status of Arequipa connections is shown in \path{/proc/atm/arequipa}. @@ -1043,9 +882,9 @@ \begin{thebibliography}{8} - \bibitem{I361}ITU-T Recommendation I.361. - {\em B-ISDN ATM layer specification}, - ITU, 1993. +% \bibitem{I361}ITU-T Recommendation I.361. +% {\em B-ISDN ATM layer specification}, +% ITU, 1993. \bibitem{api}Almesberger, Werner. {\em Linux ATM API}, \url{ftp://lrcftp.epfl.ch/pub/linux/atm/api/}, @@ -1056,10 +895,10 @@ \bibitem{RFC1577}Laubach, Mark. {\em Classical IP and ARP over ATM}, RFC1577, January 1994. - \bibitem{RFC1755}RFC1755; Perez, Maryann; Liaw, Fong-Ching; Mankin, Allison; - Hoffman, Eric; Grossman, Dan; Malis, Andrew. - {\em ATM Signaling Support for IP over ATM}, - IETF, 1995. +% \bibitem{RFC1755}RFC1755; Perez, Maryann; Liaw, Fong-Ching; Mankin, Allison; +% Hoffman, Eric; Grossman, Dan; Malis, Andrew. +% {\em ATM Signaling Support for IP over ATM}, +% IETF, 1995. \bibitem{Arequipa}Almesberger, Werner; Le Boudec, Jean-Yves; Oechslin, Philippe. {\em Application REQuested IP over ATM (AREQUIPA)} (work in progress), diff -ur --new-file old/atm/doc/usage.txt new/atm/doc/usage.txt --- old/atm/doc/usage.txt Fri Sep 27 23:02:47 1996 +++ new/atm/doc/usage.txt Mon Oct 14 19:06:26 1996 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.19 (pre-alpha) +Usage instructions - ATM on Linux, release 0.20 (pre-alpha) ------------------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,7 +17,7 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.18.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.20.tar.gz - the Linux kernel, version 2.0.14, e.g. from ftp://ftp.cs.helsinki.fi/pub/Software/Linux/Kernel/v2.0/linux-2.0.14.tar.gz - Perl, version 4 or 5 @@ -33,7 +33,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.18.tar.gz +tar xfz atm-0.20.tar.gz and the kernel source: @@ -60,9 +60,11 @@ atm/led/ LAN Emulation demon: led atm/lane/ LAN Emulation servers: bus, lecs, les atm/aqd/ Arequipa demon: arequipad - atm/debug/ Debugging tools: ed, en, encopy, endump, zndump, and znth + atm/debug/ Debugging tools: delay, ed, en, encopy, endump, zndump, and + znth atm/lib/ Libraries for applications and demons atm/doc/ Documentation in LaTeX and conversion tools + atm/man/ Miscellaneous man pages Kernel configuration @@ -393,25 +395,9 @@ ------------------ On adapters where the device driver supports access to raw cells ("AAL0"), -individual cells can be composed and received with the atmdump program. -atmdump is invoked as follows for receiving cells: +individual cells can be composed and received with the atmdump program. - atmdump [.]. - -For composing cells, the invocation is as follows: - - atmdump -t [-g ] [-c] [.]. - - -t specifies the cell payload type indicator (PTI) value (0-7, - defined in [1]). A list of valid payload types can be obtained by - running atmdump without arguments. - -g specifies the generic flow control (GFC) value, 0-15. By - default, atmdump uses 0. - -c sets the cell loss priority (CLP) bit. By default, atmdump sends - cells with CLP=0. - -Also, atmdump expects the cell payload on standard input. If only less than -48 bytes can be read, the remaining space is padded with zero bytes. +Man page: atmdump.8 Example: @@ -445,7 +431,7 @@ 47.0005.80FFE1000000F21A26D8.0020D4102A80.00 pc3-a.fqdn pc3-a The numeric address can be specified in any of the formats described in -[2]. The numeric address(es) of a Linux system can be determined with the +[1]. The numeric address(es) of a Linux system can be determined with the command atmaddr -n (see also section "Manual address configuration"). Many ATM tools also attempt to find the corresponding name when displaying @@ -464,36 +450,10 @@ Signaling demon --------------- -The signaling demon is started as follows - - # atmsigd [-b] [-c ] [-d] [-D ] [-l ] - [-n] [-N] [-P ] [-t ] - - -b background. Run in a forked child process after initializing. - -c use the specified configuration file instead of - /etc/atmsigd.conf - -d enables (lots of) debugging output. By default, atmsigd is - comparably quiet. - -D specifies the directory to which atmsigd will write - status and trace dumps. If tracing is not yet enabled, the trace size - is automatically set to a (small) default value. - -l write diagnostic messages to the specified file instead - of to standard error. The special name syslog is used to send - diagnostics to the system logger. - -n prints addresses in numeric format only, i.e. no address to name - translation is attempted. - -N makes atmsigd behave like the network side of the UNI (useful if - you have two PCs but no switch). Normally, it acts as the user side. - -P configures the signaling VC to use CBR at the specified peak - cell rate. By default, UBR is used on the signaling VC. - -t enables tracing and sets the number of entries that - should be kept in the trace buffer. omitted. - -If atmsigd is killed, all system calls requiring interaction with it will -return with an error and set errno to EUNATCH. +Man pages: atmsigd.8, atmsigd.conf.4 -Note that atmsigd provides only very limited functionality. Signaling is -known to work for Classical IP over ATM with a Fore ASX-200 switch. +Note that atmsigd's support for point-to-multipoint is very limited: only +operation as a single leaf of a point-to-multipoint tree works. By default, atmsigd is configured to conform to UNI 3.0. It can be compiled for UNI 3.1 by changing the STANDARDS= line at the beginning of @@ -547,27 +507,10 @@ If your switch doesn't support ILMI, you have to set the ATM address manually on the switch and on the PC(s). On the Linux side, make sure that -ilmid doesn't run, then use the atmaddr command to set the address: - - # atmaddr -a [] +ilmid doesn't interfere, then use the atmaddr command to set the +address(es). -e.g. - -# atmaddr -a 47.0005.80.ffe100.0000.f215.1065.0020EA000755.00 - -atmaddr without arguments shows the current local addresses. They are -printed in numeric format only if the option -n is given. Addresses can -be deleted with - - # atmaddr -d [] - -The whole list of local addresses of an interface can be reset (i.e. -erased) with - - # atmaddr -r [] - -atmaddr always defaults to interface zero if the interface number is -omitted. +Man pages: atmaddr.8 Manual configuration of ATM addresses on the switch depends on the brand. On a Fore ASX-200, it can be done with the following command: @@ -603,32 +546,32 @@ % echo 09 03 80 00 05 5A 80 00 06 08 80 00 02 81 83 00 48 \ 00 00 08 | ./q.dump -_pdsc = 9 +_pdsc = 9 "Q.2931 user-network call/connection control message" _cr_len = 3 call_ref = 8388613 (0x800005) -msg_type = 90 (0x5a) +msg_type = 0x5a "RELEASE COMPLETE" _ext = 1 -_flag = 0 -_action_ind = 0 +_flag = 0 "instruction field not significant" +_action_ind = 0 "clear call" msg_len = 6 (0x6) - _ie_id = ATM_IE_CAUSE + _ie_id = 0x08 "Cause" _ext = 1 - _cs = 0 - _flag = 0 - _action_ind = 0 + cause_cs = 0 "ITU-T standardized" + _flag = 0 "instruction field not significant" + _action_ind = 0 "clear call" _ie_len = 2 (0x2) _ext = 1 - location = 1 (0x1) + location = 1 "private network serving the local user" _ext = 1 - cause = ATM_CV_NO_ROUTE_DEST + cause = 3 "no route to destination" IP over ATM =========== IP over ATM is supported using two modules:* the CLIP module only supports -PVCs and only handles encapsulation according to RFC1483 [3]. InARP -(defined in RFC1577 [4]) is not supported by this mechanism. +PVCs and only handles encapsulation according to RFC1483 [2]. InARP +(defined in RFC1577 [3]) is not supported by this mechanism. * The term "module" is used here for a functional software component, not for a loadable kernel module. @@ -654,11 +597,7 @@ For a better but still immature mechanism see section "ATMARP demon". First, the VCCs have to be established. Become root on both machines and -run the clip program (see also on the man page) on each of them: - - # clip [-0] [.]. [] - -e.g. +run clip (see clip.8) on each of them, e.g.: a# clip 0.40 b# clip 0.40 @@ -693,20 +632,7 @@ actual kernel part maintains a small lookup table only containing partial information. -The ATMARP demon is started as follows - - # atmarpd [-b] [-d] [-D ] [-l ] [-n] - - -b background. Run in a forked child process after initializing. - -d enables (lots of) debugging output. By default, atmarpd is - comparably quiet. - -D changes the directory where atmarpd writes its table - (see below). By default, /var/run is used. - -l write diagnostic messages to the specified file instead - of to standard error. The special name syslog is used to send - diagnostics to the system logger. - -n prints addresses in numeric format only, i.e. no address to name - translation is attempted. +Man pages: atmarpd.8, atmarp.8 atmsigd and ilmid must already be running when atmarpd is started. Use the -b option to make sure they're properly synchronized, e.g. @@ -727,10 +653,6 @@ frequently doesn't (yet). -atmarpd implements a variant of ATMARP as defined in RFC1577 and RFC1755 -[5]. There are still several known errors and protocol violations. (And -probably a lot of unknown problems too.) - The atmarp program is used to configure ATMARP. First, you have to start atmsigd, ilmid, and atmarpd, then create an IP interface and configure it: @@ -744,14 +666,7 @@ # ifconfig atm0 10.0.0.3 up # route add -net 10.0.0.0 -If atmarp -c is used without specifying an interface, it allocates the -next available interface and prints its name on standard output. - -If only PVCs will be used, they can now be created with - - # atmarp -s [temp] [null] - -e.g. +If only PVCs will be used, they can now be created with a command like # atmarp -s 10.0.0.4 0.0.70 @@ -759,18 +674,11 @@ ARP requires LLC/SNAP encapsulation. NULL encapsulation can therefore only be used for PVCs. -Permanent entries will never time out and therefore do not generate any ARP -traffic, but atmarpd responds if the other party sends InARP requests. - When using SVCs, some additional configuration work may be necessary. If the machine is acting as the ATMARP server on that LIS, no additional configuration is necessary. Otherwise, the ATM address of the ATMARP server has to be configured. This is done by creating an entry for the network -address with the option arpsrv set: - - # atmarp -s arpsrv - -e.g. +address with the option arpsrv set, e.g. # atmarp -s \ 10.0.0.0 47.0005.80.ffe100.0000.f215.1065.0020EA000756.00 \ @@ -779,19 +687,6 @@ Note that the ATMARP server currently has to be started and configured before any clients are configured. -Additional SVC entries can be created with - - # atmarp -s - -There is also a (probably not very useful) temp option for SVCs. All -atmarp -s commands also accept an option pcr to change the -connection to CBR (default is UBR) and to set the peak cell rate. - - # atmarp -d - -deletes ARP entries. The option arpsrv has to be specified for deleting -the ARP server entry. - The kernel ATMARP table can be read via /proc/atm/arp. The table used by atmarpd is regularly printed on standard error if atmarpd is started with the -d option. If atmarpd is invoked without -d , the table is written @@ -807,24 +702,18 @@ as support for broadcasts. LANE client support is described in the file atm/led/USAGE, LANE server support is described in atm/lane/USAGE. +Man pages: bus.8, lecs.8, les.8, and zeppelin.8 + Arequipa -------- -Arequipa (Application REQUested IP over ATM, [6]) is an extension to IP +Arequipa (Application REQUested IP over ATM, [4]) is an extension to IP over ATM that adds support for using direct ATM connections (with QOS parameters, etc.) to carry traffic between INET sockets. On a system that -should use Arequipa connections, the Arequipa demon has to be started: - - # arequipad [-b] [-d] [-l ] [-n] +should use Arequipa connections, the Arequipa demon has to run. - -b background. Run in a forked child process after initializing. - -d enables debugging output. By default, arequipad is very quiet. - -l write diagnostic messages to the specified file instead - of to standard error. The special name syslog is used to send - diagnostics to the system logger. - -n prints addresses in numeric format only, i.e. no address to name - translation is attempted. +Man page: arequipad.8 The status of Arequipa connections is shown in /proc/atm/arequipa. @@ -848,17 +737,12 @@ References ========== - [1] ITU-T Recommendation I.361. B-ISDN ATM layer specification, ITU, - 1993. - [2] Almesberger, Werner. Linux ATM API, + [1] Almesberger, Werner. Linux ATM API, ftp://lrcftp.epfl.ch/pub/linux/atm/api/ , July 1996. - [3] Heinanen, Juha. Multiprotocol Encapsulation over ATM Adaptation + [2] Heinanen, Juha. Multiprotocol Encapsulation over ATM Adaptation Layer 5, RFC1483, July 1993. - [4] Laubach, Mark. Classical IP and ARP over ATM, RFC1577, January + [3] Laubach, Mark. Classical IP and ARP over ATM, RFC1577, January 1994. - [5] RFC1755; Perez, Maryann; Liaw, Fong-Ching; Mankin, Allison; Hoffman, - Eric; Grossman, Dan; Malis, Andrew. ATM Signaling Support for IP over - ATM, IETF, 1995. - [6] Almesberger, Werner; Le Boudec, Jean-Yves; Oechslin, Philippe. + [4] Almesberger, Werner; Le Boudec, Jean-Yves; Oechslin, Philippe. Application REQuested IP over ATM (AREQUIPA) (work in progress), Internet Draft draft-almesberger-arequipa-01.txt , June 1996. diff -ur --new-file old/atm/ip/atmarp.8 new/atm/ip/atmarp.8 --- old/atm/ip/atmarp.8 Thu Sep 26 15:37:29 1996 +++ new/atm/ip/atmarp.8 Thu Oct 10 23:05:06 1996 @@ -1,4 +1,4 @@ -.TH ATMARP 8 "Sep 26, 1996" "Linux" "Maintenance Commands" +.TH ATMARP 8 "Oct 10, 1996" "Linux" "Maintenance Commands" .SH NAME atmarp \- administer classical IP over ATM connections .SH SYNOPSIS @@ -11,10 +11,15 @@ .RB [[atm]\fInumber\fP] .br .B atmarp +.RB \-q +.RB \fIip_addr\fP +.RB \fIqos\fP +.br +.B atmarp .RB \-s .RB \fIip_addr\fP .RB [\fIitf\fP.]\fIvpi\fP.\fIvci\fP -.RB [ pcr\ \fIvalue\fP ] +.RB [ qos\ \fIqos\fP ] .RB [ temp ] .RB [ pub ] .RB [ null ] @@ -23,7 +28,7 @@ .RB \-s .RB \fIip_addr\fP .RB \fIatm_addr\fP -.RB [ pcr\ \fIvalue\fP ] +.RB [ qos\ \fIqos\fP ] .RB [ temp ] .RB [ pub ] .RB [ arpsrv ] @@ -49,12 +54,15 @@ create the specified IP interface. If the interface number is omitted, the operating system assigns the next free number and \fBatmarp\fP prints the resulting interface name (e.g. `atm0') on standard output. +.IP \fB\-q\fP +sets the QOS to use as the default for all VCs generated for that IP +network (\fIip_addr\fP must be the address of the network). .IP \fB\-s\fP set up a PVC or create an SVC entry. The following options are recognized: .RS -.IP \fBpcr\fP\ \fIvalue\fP -uses CBR with the specified peak cell rate. UBR is used -by default. +.IP \fBqos\fP\ \fIqos\fP +uses the specified quality of service (see qos(7) for the syntax). UBR at +link speed is used by default. .IP \fBtemp\fP does not mark the entry as permanent, i.e. it will time out and then be removed. @@ -83,5 +91,5 @@ .SH AUTHOR Werner Almesberger, EPFL LRC .SH "SEE ALSO" -atmarpd(8), clip(8) +atmarpd(8), clip(8), qos(7) .\"{{{}}} diff -ur --new-file old/atm/ip/atmarp.c new/atm/ip/atmarp.c --- old/atm/ip/atmarp.c Thu Sep 26 16:38:06 1996 +++ new/atm/ip/atmarp.c Thu Oct 10 23:20:43 1996 @@ -56,10 +56,11 @@ { fprintf(stderr,"usage: %s -a\n",name); fprintf(stderr,"%6s %s -c [[atm]N]\n","",name); - fprintf(stderr,"%6s %s -s ip_addr [itf.]vpi.vci [pcr value] [temp] [pub]" - " [null]\n","",name); - fprintf(stderr,"%6s %s -s ip_addr atm_addr [pcr value] [temp] [pub] " - "[arpsrv]\n","",name); + fprintf(stderr,"%6s %s -q ip_addr qos_spec\n","",name); + fprintf(stderr,"%6s %s -s ip_addr [itf.]vpi.vci [pcr value] [qos spec] " + "[temp] [pub] [null]\n","",name); + fprintf(stderr,"%6s %s -s ip_addr atm_addr [pcr value] [qos spec] [temp] " + "[pub] [arpsrv]\n","",name); fprintf(stderr,"%6s %s -d ip_addr [arpsrv]\n","",name); exit(1); } @@ -70,10 +71,12 @@ struct hostent *hostent; struct atmarpreq req; int c,op,s,i,req_num,num; + const char *qos; char *here,*end; op = 0; - while ((c = getopt(argc,argv,"acds")) != EOF) + qos = NULL; + while ((c = getopt(argc,argv,"acdqs")) != EOF) switch (c) { case 'a': if (argc != optind) usage(argv[0]); @@ -82,6 +85,11 @@ if (op) usage(argv[0]); op = SIOCMKCLIP; break; + case 'q': + if (op) usage(argv[0]); + op = SIOCSARP; + qos = ""; /* non-NULL */ + break; case 's': if (op) usage(argv[0]); op = SIOCSARP; @@ -118,6 +126,7 @@ return 0; case SIOCSARP: if (argc < optind+2) usage(argv[0]); + if (qos && argc > optind+2) usage(argv[0]); break; case SIOCDARP: if (argc < optind+1) usage(argv[0]); @@ -146,24 +155,30 @@ hostent->h_length); } req.arp_flags = ATF_PERM; - if (op == SIOCSARP) { + if (op == SIOCSARP && qos) { + req.arp_flags |= ATF_DEFQOS; + if (text2qos(argv[optind+1],&req.arp_qos,0)) usage(argv[0]); + } + if (op == SIOCSARP && !qos) { memset(&req.arp_qos,0,sizeof(req.arp_qos)); - req.arp_qos.txtp.traffic_class = ATM_UBR; for (i = optind+2; i < argc; i++) - if (!strcmp(argv[i],"temp")) req.arp_flags &= ~ATF_PERM; - else if (!strcmp(argv[i],"pub")) req.arp_flags |= ATF_PUBL; - else if (!strcmp(argv[i],"null")) req.arp_flags |= ATF_NULL; - else if (!strcmp(argv[i],"arpsrv")) req.arp_flags |= ATF_ARPSRV; - else if (!strcmp(argv[i],"pcr")) { - if (++i >= argc) usage(argv[0]); - req.arp_qos.txtp.max_pcr = strtol(argv[i],&end,0); - if (*end) usage(argv[0]); - } - else usage(argv[0]); -#if 0 /* atmarpd now sets max_sdu if 0 */ - req.arp_qos.txtp.max_sdu = RFC1483LLC_LEN+RFC1626_MTU; -#endif - req.arp_qos.rxtp = req.arp_qos.txtp; + if (!strcmp(argv[i],"temp")) req.arp_flags &= ~ATF_PERM; + else if (!strcmp(argv[i],"pub")) req.arp_flags |= ATF_PUBL; + else if (!strcmp(argv[i],"null")) req.arp_flags |= ATF_NULL; + else if (!strcmp(argv[i],"arpsrv")) req.arp_flags |= ATF_ARPSRV; + else if (!strcmp(argv[i],"qos")) { + if (++i >= argc) usage(argv[0]); + if (text2qos(argv[i],&req.arp_qos,0)) usage(argv[0]); + } + else if (!strcmp(argv[i],"pcr")) { + if (++i >= argc) usage(argv[0]); + req.arp_qos.txtp.traffic_class = + req.arp_qos.rxtp.traffic_class = ATM_CBR; + req.arp_qos.txtp.max_pcr = req.arp_qos.rxtp.max_pcr = + strtol(argv[i],&end,0); + if (*end) usage(argv[0]); + } + else usage(argv[0]); if (text2atm(argv[optind+1],(struct sockaddr *) &req.arp_ha, sizeof(req.arp_ha),T2A_NAME) < 0) { fprintf(stderr,"%s: invalid ATM address\n",argv[optind+1]); diff -ur --new-file old/atm/lane/Makefile new/atm/lane/Makefile --- old/atm/lane/Makefile Thu Sep 12 03:42:06 1996 +++ new/atm/lane/Makefile Tue Oct 1 17:38:25 1996 @@ -17,7 +17,7 @@ MAN8 = les.8 lecs.8 bus.8 LESBUSOBJS = mem.o load.o units.o load_lex.o timers.o dump.o atm.o \ events.o lane.o -LESOBJS = $(LESBUSOBJS) packet.o connect.o db.c +LESOBJS = $(LESBUSOBJS) packet.o connect.o db.o BUSOBJS = $(LESBUSOBJS) connect_bus.o LECSOBJS = lecs_db.o lecs_load.o lecs.o ldb.o mem_lecs.o atm_lecs.o OBJS = $(LESOBJS) $(BUSOBJS) $(LECSOBJS) diff -ur --new-file old/atm/lane/atm.c new/atm/lane/atm.c --- old/atm/lane/atm.c Sat Aug 31 14:17:24 1996 +++ new/atm/lane/atm.c Tue Oct 1 17:26:18 1996 @@ -11,11 +11,11 @@ #include #include #include -#include #include /* Local includes */ #include "atm.h" +#include "atmsap.h" #include "load.h" #include "dump.h" #include "connect.h" diff -ur --new-file old/atm/lane/atm_lecs.c new/atm/lane/atm_lecs.c --- old/atm/lane/atm_lecs.c Sat Aug 31 14:17:33 1996 +++ new/atm/lane/atm_lecs.c Tue Oct 1 17:26:28 1996 @@ -11,10 +11,10 @@ #include #include #include -#include #include /* Local includes */ +#include "atmsap.h" #include "atm_lecs.h" /* Data */ diff -ur --new-file old/atm/lane/dump.c new/atm/lane/dump.c --- old/atm/lane/dump.c Thu Sep 12 02:08:00 1996 +++ new/atm/lane/dump.c Tue Oct 1 17:26:38 1996 @@ -15,9 +15,9 @@ #include #include -#include /* Local includes */ +#include "atmsap.h" #include "dump.h" #include "lane.h" #include "load.h" diff -ur --new-file old/atm/lane/dump.h new/atm/lane/dump.h --- old/atm/lane/dump.h Thu Aug 8 23:23:24 1996 +++ new/atm/lane/dump.h Tue Oct 1 17:27:55 1996 @@ -9,9 +9,9 @@ /* System includes needed for types */ #include -#include /* Local includes needed for types */ +#include "atmsap.h" #include "units.h" #include "lane.h" diff -ur --new-file old/atm/led/conn.c new/atm/led/conn.c --- old/atm/led/conn.c Tue Sep 17 06:55:43 1996 +++ new/atm/led/conn.c Tue Oct 1 17:35:54 1996 @@ -54,6 +54,7 @@ #include "cm_sap.h" #include "lec.h" #include "atm.h" +#include "atmsap.h" #include "cm.h" #include "g_event.h" #include "conn.h" diff -ur --new-file old/atm/led/lec_ctrl.c new/atm/led/lec_ctrl.c --- old/atm/led/lec_ctrl.c Sat Aug 31 14:18:27 1996 +++ new/atm/led/lec_ctrl.c Tue Oct 1 17:34:41 1996 @@ -74,6 +74,7 @@ #include "utl.h" /* General Purpose Utilities */ #include "utl_os.h" /* Operating System Utilities */ #include "atm.h" /* ATM Specific Definitions and Macros */ +#include "atmsap.h" /* ATM SAP definition */ #include "system.h" /* ATM Subsystem Specific Stuff */ #include "g_event.h" diff -ur --new-file old/atm/lib/Makefile new/atm/lib/Makefile --- old/atm/lib/Makefile Fri Sep 27 21:56:40 1996 +++ new/atm/lib/Makefile Thu Oct 10 22:51:38 1996 @@ -1,9 +1,10 @@ -ATM_OBJS=text2atm.o atm2text.o atmequal.o sdu2cell.o +ATM_OBJS=text2atm.o atm2text.o atmequal.o sdu2cell.o text2qos.o qos2text.o \ + qosequal.o ATMD_OBJS=common.o diag.o timer.o AQ_OBJS=arequipa.o PGMS=#test GENLIBS=libatm.a libatmd.a libarequipa.a -SYSHDR=atm.h atmd.h arequipa.h +SYSHDR=atm.h atmd.h atmsap.h arequipa.h all: libatm.a libatmd.a libarequipa.a diff -ur --new-file old/atm/lib/arequipa.c new/atm/lib/arequipa.c --- old/atm/lib/arequipa.c Fri Sep 27 22:20:12 1996 +++ new/atm/lib/arequipa.c Tue Oct 8 18:47:56 1996 @@ -8,7 +8,9 @@ #include #include #include +#include +#include "atmsap.h" #include "arequipa.h" @@ -16,11 +18,15 @@ const struct atm_qos *qos) { struct sockaddr_atmsvc a; + struct atm_qos q; struct atm_blli blli; int s; if ((s = socket(addr->sas_family,SOCK_DGRAM,ATM_AAL5)) < 0) return -1; - if (setsockopt(s,SOL_ATM,SO_ATMQOS,qos,sizeof(struct atm_qos)) < 0) { + q = *qos; + if (!q.txtp.max_sdu) q.txtp.max_sdu = RFC1626_MTU+RFC1483LLC_LEN; + if (!q.rxtp.max_sdu) q.rxtp.max_sdu = RFC1626_MTU+RFC1483LLC_LEN; + if (setsockopt(s,SOL_ATM,SO_ATMQOS,&q,sizeof(q)) < 0) { (void) close(s); return -1; } diff -ur --new-file old/atm/lib/atm.h new/atm/lib/atm.h --- old/atm/lib/atm.h Tue Feb 20 13:36:30 1996 +++ new/atm/lib/atm.h Sun Oct 13 15:45:38 1996 @@ -9,6 +9,7 @@ #include #include + #define HOSTS_ATM "/etc/hosts.atm" #define T2A_PVC 1 /* address is PVC */ @@ -17,17 +18,22 @@ #define T2A_WILDCARD 8 /* allow wildcards in PVC address */ #define T2A_NNI 16 /* allow NNI VPI range (PVC) */ #define T2A_NAME 32 /* allow name resolution */ +#define T2A_REMOTE 64 /* try to use ANS if local lookup fails */ #define A2T_PRETTY 1 /* add syntactic sugar */ #define A2T_NAME 2 /* attempt name lookup */ +#define A2T_REMOTE 4 /* try to use ANS if local lookup fails */ #define AXE_WILDCARD 1 /* allow wildcard match */ #define AXE_PRVOPT 2 /* private part is optional */ +#define T2Q_DEFAULTS 1 /* structure contains default values */ + #define MAX_ATM_ADDR_LEN (2*ATM_ESA_LEN+ATM_E164_LEN+5) /* 4 dots, 1 plus */ #define MAX_ATM_NAME_LEN 256 /* wild guess */ +#define MAX_ATM_QOS_LEN 111 /* 4+2*(3+3*(7+9)+2)+1 */ int text2atm(const char *text,struct sockaddr *addr,int length,int flags); @@ -35,5 +41,8 @@ int atm_equal(const struct sockaddr_atmsvc *a,const struct sockaddr_atmsvc *b, int len,int flags); int sdu2cell(int s,int sizes,const int *sdu_size,int *num_sdu); +int text2qos(const char *text,struct atm_qos *qos,int flags); +int qos2text(char *buffer,int length,const struct atm_qos *qos,int flags); +int qos_equal(const struct atm_qos *a,const struct atm_qos *b); #endif diff -ur --new-file old/atm/lib/atmsap.h new/atm/lib/atmsap.h --- old/atm/lib/atmsap.h Thu Jan 1 01:00:00 1970 +++ new/atm/lib/atmsap.h Tue Oct 1 17:33:27 1996 @@ -0,0 +1,33 @@ +/* atmsap.h - ATM Service Access Point addressing definitions */ + +/* Written 1996 by Werner Almesberger, EPFL LRC */ + + +#ifndef _ATMSAP_H +#define _ATMSAP_H + +#include + + +/* + * Selected ISO/IEC TR 9577 Network Layer Protocol Identifiers (NLPID) + */ + +#define NLPID_IEEE802_1_SNAP 0x80 /* IEEE 802.1 SNAP */ + +/* + * Selected Organizationally Unique Identifiers (OUIs) + */ + +#define EPFL_OUI "\x00\x60\xD7" /* EPF Lausanne, CH */ + +/* + * Selected vendor-specific application identifiers (for B-HLI). Such an + * identifier consists of three bytes containing the OUI, followed by four + * bytes assigned by the organization owning the OUI. + */ + +#define AREQUIPA_HLT_VS_ID EPFL_OUI "\x01\x00\x00\x01" /* Arequipa */ +#define TTCP_HLT_VS_ID EPFL_OUI "\x01\x00\x00\x03" /* ttcp_atm */ + +#endif diff -ur --new-file old/atm/lib/qos2text.c new/atm/lib/qos2text.c --- old/atm/lib/qos2text.c Thu Jan 1 01:00:00 1970 +++ new/atm/lib/qos2text.c Wed Oct 9 18:02:20 1996 @@ -0,0 +1,80 @@ +/* qos2text.c - Converts binary encoding of QOS parameters to textual + representation */ + +/* Written 1996 by Werner Almesberger, EPFL-LRC */ + + +#include +#include + +#include "atm.h" + + +#define FLD(F) \ + if (curr->F && ((ref && (ref->F != curr->F || ref->traffic_class == \ + ATM_NONE)) || (comp && comp->F == curr->F && comp->traffic_class != \ + ATM_NONE))) { \ + if (buffer != *pos && !strchr(":,",(*pos)[-1])) *(*pos)++ = ','; \ + if (curr->F != ATM_MAX_PCR) *pos += sprintf(*pos,#F "=%d",curr->F); \ + else { \ + strcat(*pos,#F "=max"); \ + *pos += strlen(#F)+4; \ + } \ + } + + +static void params(char *buffer,char **pos,const struct atm_trafprm *ref, + const struct atm_trafprm *curr,const struct atm_trafprm *comp) +{ + FLD(max_pcr); + FLD(min_pcr); + FLD(max_sdu); +} + + +static void opt(const char *prefix,char *buffer,char **pos, + const struct atm_trafprm *ref,const struct atm_trafprm *curr, + const struct atm_trafprm *comp) +{ + char *start; + + if (curr->traffic_class == ATM_NONE) { + if (!comp) *pos += sprintf(*pos,"%snone",prefix); + return; + } + start = *pos; + params(buffer,pos,ref,curr,comp); + if (start == *pos) return; + *pos = start; + strcpy(*pos,prefix); + *pos += strlen(prefix); + params(buffer,pos,ref,curr,comp); +} + + +int qos2text(char *buffer,int length,const struct atm_qos *qos,int flags) +{ + char *pos,*start; + + if (length <= MAX_ATM_QOS_LEN) return -1; + *(pos = buffer) = 0; + switch (qos->txtp.traffic_class == ATM_NONE ? qos->rxtp.traffic_class : + qos->txtp.traffic_class) { + case ATM_UBR: + strcat(buffer,"ubr:"); + pos += 4; + break; + case ATM_CBR: + strcat(buffer,"cbr:"); + pos += 4; + break; + default: + return -1; + } + start = pos; + if (qos->txtp.traffic_class != ATM_NONE && qos->rxtp.traffic_class != + ATM_NONE) params(buffer,&pos,NULL,&qos->txtp,&qos->rxtp); + opt(start == pos ? "tx:" : ",tx:",buffer,&pos,&qos->rxtp,&qos->txtp,NULL); + opt(start == pos ? "rx:" : ",rx:",buffer,&pos,&qos->txtp,&qos->rxtp,NULL); + return 0; +} diff -ur --new-file old/atm/lib/qosequal.c new/atm/lib/qosequal.c --- old/atm/lib/qosequal.c Thu Jan 1 01:00:00 1970 +++ new/atm/lib/qosequal.c Thu Oct 10 22:51:25 1996 @@ -0,0 +1,40 @@ +/* qosequal.c - Compares QOS specifications for equality */ + +/* Written 1996 by Werner Almesberger, EPFL-LRC */ + + +#include "atm.h" + + +static int tp_equal(int traffic_class,struct atm_trafprm a,struct atm_trafprm b) +{ + switch (traffic_class) { + case ATM_NONE: + return 1; + case ATM_UBR: + break; + case ATM_CBR: + if (a.max_cdv != b.max_cdv) return 0; + break; + default: + return -1; + } + if (!a.max_pcr && !a.min_pcr) a.max_pcr = ATM_MAX_PCR; + if (!b.max_pcr && !b.min_pcr) b.max_pcr = ATM_MAX_PCR; + if (a.max_pcr != b.max_pcr || a.min_pcr != b.min_pcr) return 0; + return a.max_sdu == b.max_sdu; +} + + +int qos_equal(const struct atm_qos *a,const struct atm_qos *b) +{ + if (a->txtp.traffic_class != b->txtp.traffic_class) return 0; + if (a->txtp.traffic_class == ATM_NONE) { + if (a->rxtp.traffic_class != b->rxtp.traffic_class) return 0; + return tp_equal(a->rxtp.traffic_class,a->rxtp,b->rxtp); + } + else { + if (!tp_equal(a->txtp.traffic_class,a->txtp,b->txtp)) return 0; + return tp_equal(a->txtp.traffic_class,a->rxtp,b->rxtp); + } +} diff -ur --new-file old/atm/lib/text2atm.c new/atm/lib/text2atm.c --- old/atm/lib/text2atm.c Fri Jul 19 17:47:57 1996 +++ new/atm/lib/text2atm.c Tue Oct 1 17:25:11 1996 @@ -9,9 +9,9 @@ #include #include #include -#include #include "atm.h" +#include "atmsap.h" #define TRY_OTHER -2 diff -ur --new-file old/atm/lib/text2qos.c new/atm/lib/text2qos.c --- old/atm/lib/text2qos.c Thu Jan 1 01:00:00 1970 +++ new/atm/lib/text2qos.c Thu Oct 10 18:37:10 1996 @@ -0,0 +1,147 @@ +/* text2qos.c - Converts textual representation of QOS parameters to binary + encoding */ + +/* Written 1996 by Werner Almesberger, EPFL-LRC */ + + +#include +#include +#include +#include +#include + +#include "atm.h" + + +#define RATE_ERROR -2 + + +static int fetch(const char **pos,...) +{ + const char *value; + int ref_len,best_len,len; + int i,best; + va_list ap; + + va_start(ap,pos); + ref_len = strlen(*pos); + best_len = 0; + best = -1; + for (i = 0; (value = va_arg(ap,const char *)); i++) { + len = strlen(value); + if (*value != '!' && len <= ref_len && len > best_len && + !strncasecmp(*pos,value,len)) { + best = i; + best_len = len; + } + } + va_end(ap); + if (best > -1) (*pos) += best_len; + return best; +} + + +static int get_rate(const char **text,int up) +{ + const char mult[] = "kKmMgGg"; + const char *multiplier; + char *end; + unsigned int rate; + + if (!strncmp(*text,"max",3)) { + *text += 3; + return ATM_MAX_PCR; + } + rate = strtoul(*text,&end,10); + if (*end && (multiplier = strchr(mult,*end))) { + while (multiplier >= mult) { + if (rate > UINT_MAX/1000) return RATE_ERROR; + rate *= 1000; + multiplier -= 2; + } + end++; + } + if (strlen(end) >= 3) + if (!strncmp(end,"cps",3)) end += 3; + else if (!strncmp(end,"bps",3)) { + rate = (rate+(up ? 8*ATM_CELL_PAYLOAD-1 : 0))/8/ + ATM_CELL_PAYLOAD; + end += 3; + } + if (rate > INT_MAX) return RATE_ERROR; + *text = end; + return rate; +} + + +static int params(const char **text,struct atm_trafprm *a, + struct atm_trafprm *b) +{ + int value; + char *end; + + if (*(*text)++ != ':') return -1; + while (1) { + if (!**text) return -1; + switch (fetch(text,"max_pcr=","pcr=","min_pcr=","max_sdu=","sdu=", + NULL)) { + case 0: + case 1: + if ((value = get_rate(text,0)) == RATE_ERROR) return -1; + a->max_pcr = value; + if (b) b->max_pcr = value; + break; + case 2: + if ((value = get_rate(text,1)) == RATE_ERROR) return -1; + a->min_pcr = value; + if (b) b->min_pcr = value; + break; + case 3: + case 4: + value = strtol(*text,&end,10); + if (value < 0) return -1; + *text = end; + a->max_sdu = value; + if (b) b->max_sdu = value; + break; + default: + return 0; + } + if (!**text) break; + if (*(*text)++ != ',') return -1; + } + return 0; +} + + +int text2qos(const char *text,struct atm_qos *qos,int flags) +{ + int traffic_class; + + if ((traffic_class = fetch(&text,"!none","ubr","cbr",NULL)) < 0) return -1; + if (!(flags & T2Q_DEFAULTS)) memset(qos,0,sizeof(*qos)); + qos->txtp.traffic_class = qos->rxtp.traffic_class = traffic_class; + if (!*text) return 0; + if (params(&text,&qos->txtp,&qos->rxtp)) return -1; + if (!*text) return 0; + switch (fetch(&text,"tx","rx",NULL)) { + case 0: + if (!fetch(&text,":none",NULL)) { + qos->txtp.traffic_class = ATM_NONE; + if (*text == ',') text++; + break; + } + if (params(&text,&qos->txtp,NULL)) return -1; + break; + case 1: + text -= 2; + break; + default: + return -1; + } + if (!*text) return 0; + if (fetch(&text,"rx",NULL)) return -1; + if (!fetch(&text,":none",NULL)) qos->rxtp.traffic_class = ATM_NONE; + else if (params(&text,&qos->rxtp,NULL)) return -1; + return *text ? -1 : 0; +} diff -ur --new-file old/atm/maint/atmdump.8 new/atm/maint/atmdump.8 --- old/atm/maint/atmdump.8 Thu Sep 26 18:50:42 1996 +++ new/atm/maint/atmdump.8 Mon Oct 14 19:00:29 1996 @@ -1,4 +1,4 @@ -.TH ATMDUMP 8 "Sep 26, 1996" "Linux" "Maintenance Commands" +.TH ATMDUMP 8 "Oct 14, 1996" "Linux" "Maintenance Commands" .SH NAME atmdump \- capture or generate ATM cells .SH SYNOPSIS @@ -15,9 +15,13 @@ time stamp, the cell header contents, and a hex dump of the cell payload are shown. When sending cells, the payload type, the generic flow control (GFC), and the cell loss priority (CLP) can be set. -.PP +.P In both modes of operation, the interface number, the VPI, and the VCI have to be specified. +.P +When sending, \fBatmdump\fP expects the cell payload on standard input. +If only less than 48 bytes can be read, the remaining space is padded +with zero bytes. .SH OPTIONS .IP \fB\-i\fP displays timestamps as the interval since the last cell reception. By diff -ur --new-file old/atm/man/qos.7 new/atm/man/qos.7 --- old/atm/man/qos.7 Thu Jan 1 01:00:00 1970 +++ new/atm/man/qos.7 Thu Oct 10 20:17:33 1996 @@ -0,0 +1,92 @@ +.TH QOS 7 "Oct 10, 1996" "Linux" "Miscellaneous" +.SH NAME +qos \- Quality of Service specification +.SH DESCRIPTION +The \fBtext2qos\fP and \fBqos2text\fP functions use the format described +in this man page. Because all standard ATM tools on Linux use those +functions to convert to or from the textual representation of QOS +specifications, they expect them in the same format too. +.P +The most fundamental parameter is the \fItraffic class\fP. If the +connection is bi-directional, both directions have the same traffic +class. The traffic class is the first element in a QOS specification +and the only required one. The following traffic classes are +recognized: +.IP \fBubr\fP +Unassigned Bit Rate +.IP \fBcbr\fP +Constant Bit Rate +.P +If more parameters are supplied, the traffic class must be followed by +a colon. Traffic parameters can be specified independently for the +transmit and the receive direction. Their parameter lists are prefixed +with \fBtx:\fP and \fBrx:\fP, respectively. If both parameter lists are +present, the \fBtx:\fP list must precede the \fBrx:\fP list. If a +parameter is equal for both directions, it can be placed in a common +parameter list (without prefix). The general format is as follows: +.P +\fIclass\fB:\fIcommon_list\fP,tx:\fIlist\fB,rx:\fIlist\fP +.P +Each list consists of elements specifying a parameter. Elements can +appear in any order and they are separated with commas. The following +elements are recognized: +.IP \fBpcr=\fIrate\fP +is a synonym for \fBmax_pcr=\fIrate\fP +.IP \fBmax_pcr=\fIrate\fP +The upper limit for the peak cell rate to assign. If omitted, any rate up +to link speed may be chosen. +.IP \fBmin_pcr=\fIrate\fP +The lower limit for the peak cell rate to assign. If omitted, any rate above +zero can be chosen. +.IP \fBsdu=\fIsize\fP +is a synonym for \fBmax_sdu=\fIsize\fP +.IP \fBmax_sdu=\fIsize\fP +The size of the largest packet that may be sent or received. If omitted, +a context-dependent default value is used. +.P +Values are specified as follows: +.IP \fIrate\fP +The (decimal) rate, optionally followed by a unit. The unit may be prefixed +with one of the multipliers \fBk\fP, \fBM\fP, or \fBG\fP, meaning 1'000, +1'000'000, or 1'000'000'000, respectively. The units \fBcps\fP +(cells per second) and \fBbps\fP (bits per second) are recognized. If +multiplier and unit are omitted, cells per second are assumed. Note +that the rate is always converted to cells per second, so rounding errors +may occur when specifying the rate in bits per second. The rate must be +an integer, even if using a multiplier. It is an error to specify only a +multiplier without a unit. Link speed can be indicated by using the keyword +\fBmax\fP as the rate. +.IP \fIsize\fP +The (decimal) number of bytes. +.P +The \fBtx:\fP or \fBrx:\fP lists may also just contain the single element +\fBnone\fP, which indicates that the corresponding direction is not used. +It is an error to specify \fBnone\fP for both direction. +.P +Note that commas must never follow colons or other commas. Also, +whitespace is not allowed inside a QOS specification. QOS specifications +are case-insensitive. +.SH EXAMPLES +Each of the following lines contains a valid QOS specification: +.nf +.sp + ubr + cbr:pcr=64kbps + CBR:max_pcr=11Mbps,min_pcr=10mbps,sdu=8192 + ubr:tx:none + cbr:tx:pcr=30000,rx:none +.sp +.fi +The following specificiations are equivalent: +.nf +.sp + CBR:PCR=48Mbps + cbr:max_pcr=125000 + cbr:tx:pcr=125kcps,rx:pcr=125kcps +.sp +.fi +.SH AUTHOR +Werner Almesberger, EPFL LRC +.\" .SH "SEE ALSO" +.\" atmsigd(8), syslogd(8) +.\"{{{}}} diff -ur --new-file old/atm/mkdist new/atm/mkdist --- old/atm/mkdist Fri Sep 27 23:24:00 1996 +++ new/atm/mkdist Mon Oct 14 19:24:34 1996 @@ -18,6 +18,7 @@ atm/Makefile atm/Rules.make atm/mkdist atm/mkdiff atm/.kernel \ atm/doc/README atm/doc/usage.tex atm/doc/usage.txt atm/doc/url.sty \ atm/doc/Makefile atm/doc/rlatex atm/doc/t2a.pl \ + atm/man/qos.7 \ atm/sigd/Makefile atm/sigd/atmsigd.c atm/sigd/cfg.l atm/sigd/cfg.y \ atm/sigd/io.h atm/sigd/io.c atm/sigd/kernel.c atm/sigd/proto.h \ atm/sigd/proto.c atm/sigd/q2931.c atm/sigd/timeout.c atm/sigd/timeout.h \ @@ -63,11 +64,12 @@ atm/test/bw.c atm/test/ttcp.c atm/test/aping.c \ atm/ip/Makefile atm/ip/atmarp.c atm/ip/clip.c atm/ip/clip.8 atm/ip/atmarp.8 \ atm/debug/Makefile atm/debug/ed.c atm/debug/encopy.c atm/debug/endump.c \ - atm/debug/peek.pl atm/debug/zndump.c atm/debug/znth.c \ + atm/debug/peek.pl atm/debug/zndump.c atm/debug/znth.c atm/debug/delay.c \ atm/lib/Makefile atm/lib/atm2text.c atm/lib/atm.h atm/lib/text2atm.c \ - atm/lib/atmequal.c atm/lib/sdu2cell.c \ + atm/lib/atmequal.c atm/lib/sdu2cell.c atm/lib/atmsap.h \ atm/lib/atmd.h atm/lib/common.c atm/lib/diag.c \ atm/lib/timer.c atm/lib/arequipa.h atm/lib/arequipa.c \ + atm/lib/text2qos.c atm/lib/qos2text.c atm/lib/qosequal.c \ atm/led/USAGE atm/led/COPYRIGHT.DEC atm/led/COPYRIGHT.TUT \ atm/led/lec.h atm/led/lec_arp.h atm/led/lec_ctrl.h atm/led/emask.h \ atm/led/le_disp.h atm/led/g_event.h \ @@ -95,4 +97,6 @@ atm/lane/units.h \ atm/aqd/Makefile atm/aqd/arequipad.c atm/aqd/io.h atm/aqd/io.c \ atm/aqd/arequipad.8 \ - atm/atm.patch atm/mpr.patch | gzip -9 >$ARCHDIR/atm-$VERSION.tar.gz + atm/atm.patch atm/mpr.patch | + gzip -9 >$ARCHDIR/atm-$VERSION.tar.gz +#atm/bind-4.9.4.T4B.ATM.patch diff -ur --new-file old/atm/qgen/TODO new/atm/qgen/TODO --- old/atm/qgen/TODO Wed Oct 11 12:15:22 1995 +++ new/atm/qgen/TODO Sun Oct 13 16:06:28 1996 @@ -1,4 +1,3 @@ - - should record errors, particularly when parsing - handle repeated IEs - q_assign should remove old value (i.e. zero destination) - bit numbering is wrong; should be diff -ur --new-file old/atm/qgen/uni3x new/atm/qgen/uni3x --- old/atm/qgen/uni3x Fri Sep 27 20:47:03 1996 +++ new/atm/qgen/uni3x Tue Oct 1 17:25:58 1996 @@ -9,7 +9,7 @@ #undef linux /* grr ... */ -include +include "atmsap.h" include "q2931.h" diff -ur --new-file old/atm/sigd/atmsigd.8 new/atm/sigd/atmsigd.8 --- old/atm/sigd/atmsigd.8 Sun Sep 1 11:26:05 1996 +++ new/atm/sigd/atmsigd.8 Mon Oct 14 18:55:01 1996 @@ -1,4 +1,4 @@ -.TH ATMSIGD 8 "Sep 1, 1996" "Linux" "Maintenance Commands" +.TH ATMSIGD 8 "Oct 14, 1996" "Linux" "Maintenance Commands" .SH NAME atmsigd \- ATM signaling demon .SH SYNOPSIS @@ -10,7 +10,7 @@ .RB [ \-l\ \fIlogfile\fP ] .RB [ \-n ] .RB [ \-N ] -.RB [ \-P\ \fIpcr\fP ] +.RB [ \-q\ \fIqos\fP ] .RB [ \-t\ \fItrace_length\fP ] .SH DESCRIPTION \fBatmsigd\fP implements the ATM UNI signaling protocol. Requests to @@ -21,6 +21,9 @@ Note that \fBatmsigd\fP is not able to accept or establish connections until the local ATM address of the interface is configured by \fBilmid\fP or manually using \fBatmaddr\fP. +.P +If \fBatmsigd\fP is killed, all system calls requiring interaction with it +will return with an error and set \fBerrno\fP to \fBEUNATCH\fP. .SH OPTIONS .IP \fB\-b\fP Run in background (i.e. in a forked child process) after initializing. @@ -43,9 +46,10 @@ .IP \fB\-N\fP Makes \fPatmsigd\fB behave like the network side of the UNI (useful if you have two PCs but no switch). Normally, it acts as the user side. -.IP \fB\-P\ \fIpcr\fP -Configures the signaling VC to use CBR at the specified peak cell rate. -By default, UBR is used on the signaling VC +.IP \fB\-q\ \fIqos\fP +Configures the signaling VC to use the specified quality of service (see +qos(7) for the syntax). +By default, UBR at link speed is used on the signaling VC. .IP \fB\-t\ \fItrace_length\fP Enables tracing and sets the number of entries that should be kept in the trace buffer. @@ -54,6 +58,12 @@ .TP 25 .B /etc/atmsigd.conf configuration file +.TP 25 +.B /var/tmp/atmsigd.\fIpid\fB.status.\fIversion\fP +default location of status dumps +.TP 25 +.B /var/tmp/atmsigd.\fIpid\fB.trace.\fIversion\fP +default location of signaling trace dumps .PD .SH DEBUGGING When receiving a \fBSIGUSR1\fP signals, \fBatmsigd\fP dumps the list of all @@ -74,5 +84,5 @@ .SH AUTHOR Werner Almesberger, EPFL LRC .SH "SEE ALSO" -atmaddr(8), atmsigd.conf(4), ilmid(8) +atmaddr(8), atmsigd.conf(4), ilmid(8), qos(7) .\"{{{}}} diff -ur --new-file old/atm/sigd/atmsigd.c new/atm/sigd/atmsigd.c --- old/atm/sigd/atmsigd.c Mon Sep 2 17:50:58 1996 +++ new/atm/sigd/atmsigd.c Thu Oct 10 18:39:55 1996 @@ -38,7 +38,8 @@ int net = 0; int debug = 0; int pretty = A2T_PRETTY | A2T_NAME; -int sig_pcr = -1; +int sig_pcr = -1; /* obsolete */ +const char *sig_qos = NULL; const char *dump_dir = NULL; @@ -327,7 +328,7 @@ static void usage(const char *name) { fprintf(stderr,"usage: %s [ -b ] [ -c config_file ] [ -d ] [ -D dump_dir ]" - " [ -l logfile ] [ -n ] [ -N ] [ -P pcr ] [ -t trace_length ]\n",name); + " [ -l logfile ] [ -n ] [ -N ] [ -q qos ] [ -t trace_length ]\n",name); exit(1); } @@ -348,7 +349,7 @@ background = 0; memset(&signaling_pvc,0,sizeof(signaling_pvc)); signaling_pvc.sap_addr.vci = 5; - while ((c = getopt(argc,argv,"bc:dD:l:nNP:t:")) != EOF) + while ((c = getopt(argc,argv,"bc:dD:l:nNP:q:t:")) != EOF) switch (c) { case 'b': background = 1; @@ -376,7 +377,12 @@ case 'N': net = 1; break; - case 'P': + case 'q': + if (sig_pcr != -1) usage(argv[0]); + sig_qos = optarg; + break; + case 'P': /* obsolete */ + if (sig_qos) usage(argv[0]); sig_pcr = strtol(optarg,&end,0); if (*end) usage(argv[0]); break; diff -ur --new-file old/atm/sigd/atmsigd.conf.4 new/atm/sigd/atmsigd.conf.4 --- old/atm/sigd/atmsigd.conf.4 Sat Aug 31 19:24:24 1996 +++ new/atm/sigd/atmsigd.conf.4 Thu Oct 10 20:34:07 1996 @@ -1,4 +1,4 @@ -.TH ATMSIGD.CONF 4 "Aug 31, 1996" "Linux" "File Formats" +.TH ATMSIGD.CONF 4 "Oct 10, 1996" "Linux" "File Formats" .SH NAME atmsigd.conf \- configuration file for the ATM signaling demon .SH SYNOPSIS @@ -37,9 +37,9 @@ omitted. .IP \fBio\ level\ \fIlevel\fP Sets the debug level for IO-related messages to \fIlevel\fP. -.IP \fBio\ pcr\ \fIpcr\fP -Configures the signaling VC to use CBR at the specified peak cell rate. -By default, UBR is used on the signaling VC. +.IP \fBio\ qos\ \fIqos\fP +Configures the signaling VC to use the specified QOS (see qos(7) for the +syntax). By default, UBR at link speed is used on the signaling VC. .IP \fBio\ vc\ \fP[\fIitf\fP]\fB.\fIvpi\fB.\fIvci\fP Uses the specified VC for signaling messages instead of the usual 0.0.5. .IP \fBsaal\ level\ \fIlevel\fP @@ -93,5 +93,5 @@ .SH AUTHOR Werner Almesberger, EPFL LRC .SH "SEE ALSO" -atmsigd(8), syslogd(8) +atmsigd(8), qos(7), syslogd(8) .\"{{{}}} diff -ur --new-file old/atm/sigd/cfg.l new/atm/sigd/cfg.l --- old/atm/sigd/cfg.l Sat Aug 31 18:25:31 1996 +++ new/atm/sigd/cfg.l Thu Oct 10 20:30:50 1996 @@ -30,34 +30,27 @@ BEGIN(N); level return TOK_LEVEL; -debug | -debugging return TOK_DEBUG; /* obsolete */ -info | -information | /* obsolete */ -informational return TOK_INFO; -warn | -warning return TOK_WARN; /* obsolete */ +debug return TOK_DEBUG; +info return TOK_INFO; +warn return TOK_WARN; error return TOK_ERROR; fatal return TOK_FATAL; -sig | -signaling | /* obsolete */ -signalling return TOK_SIG; /* obsolete */ +sig return TOK_SIG; uni30 return TOK_UNI30; uni31 return TOK_UNI31; -net | /* obsolete */ network return TOK_NET; saal return TOK_SAAL; -vc | -svc return TOK_VC; /* obsolete */ +vc return TOK_VC; io return TOK_IO; -itf | -interface return TOK_ITF; /* obsolete */ +itf return TOK_ITF; vpci return TOK_VPCI; pcr return TOK_PCR; dump { BEGIN(P); token = TOK_DUMP_DIR; } log { BEGIN(P); token = TOK_LOGFILE; } +qos { BEGIN(P); /* syntacticly close to a path */ + token = TOK_QOS; } trace return TOK_TRACE; [0-9]+ { char *end; yylval.num = strtoul(yytext,&end,10); diff -ur --new-file old/atm/sigd/cfg.y new/atm/sigd/cfg.y --- old/atm/sigd/cfg.y Sat Aug 31 18:23:54 1996 +++ new/atm/sigd/cfg.y Thu Oct 10 20:31:40 1996 @@ -38,7 +38,7 @@ %token TOK_SIG TOK_UNI30 TOK_UNI31 TOK_SAAL TOK_VC %token TOK_IO TOK_NET TOK_VPCI TOK_ITF TOK_PCR TOK_TRACE %token TOK_NUMBER -%token TOK_DUMP_DIR TOK_LOGFILE +%token TOK_DUMP_DIR TOK_LOGFILE TOK_QOS %token TOK_PVC %type level opt_trace_size @@ -145,6 +145,10 @@ | TOK_PCR TOK_NUMBER { sig_pcr = $2; + } + | TOK_QOS + { + sig_qos = $1; } ; diff -ur --new-file old/atm/sigd/io.c new/atm/sigd/io.c --- old/atm/sigd/io.c Sat Aug 31 02:19:28 1996 +++ new/atm/sigd/io.c Thu Oct 10 18:39:15 1996 @@ -126,13 +126,21 @@ return -1; } memset(&qos,0,sizeof(qos)); - if (sig_pcr == -1) - qos.rxtp.traffic_class = qos.txtp.traffic_class = ATM_UBR; + qos.rxtp.max_sdu = qos.txtp.max_sdu = MAX_Q_MSG; + if (sig_qos) { + if (text2qos(sig_qos,&qos,T2Q_DEFAULTS) < 0) { + fprintf(stderr,"invalid qos: %s\n",sig_qos); + return -1; + } + } else { - qos.rxtp.traffic_class = qos.txtp.traffic_class = ATM_CBR; - qos.rxtp.min_pcr = qos.txtp.min_pcr = sig_pcr; + if (sig_pcr == -1) + qos.rxtp.traffic_class = qos.txtp.traffic_class = ATM_UBR; + else { + qos.rxtp.traffic_class = qos.txtp.traffic_class = ATM_CBR; + qos.rxtp.min_pcr = qos.txtp.min_pcr = sig_pcr; + } } - qos.rxtp.max_sdu = qos.txtp.max_sdu = MAX_Q_MSG; if (setsockopt(s,SOL_ATM,SO_ATMQOS,&qos,sizeof(qos)) < 0) { perror("setsockopt SO_ATMQOS"); return -1; diff -ur --new-file old/atm/sigd/proto.h new/atm/sigd/proto.h --- old/atm/sigd/proto.h Sat Aug 31 16:10:50 1996 +++ new/atm/sigd/proto.h Thu Oct 10 18:39:28 1996 @@ -6,9 +6,9 @@ #ifndef PROTO_H #define PROTO_H -#include #include +#include "atmsap.h" #include "atmd.h" @@ -64,6 +64,7 @@ extern int net; extern int pretty; extern int sig_pcr; +extern const char *sig_qos; extern const char *dump_dir; diff -ur --new-file old/atm/sigd/sap.c new/atm/sigd/sap.c --- old/atm/sigd/sap.c Mon Jul 29 17:27:25 1996 +++ new/atm/sigd/sap.c Sun Oct 13 17:35:30 1996 @@ -210,22 +210,20 @@ if (!*sap->sas_addr.prv) return -EDESTADDRREQ; else q_write(dsc,QF_cdpn_esa,(void *) sap->sas_addr.prv,ATM_ESA_LEN); /* improve @@@ */ + if (qos->txtp.traffic_class == ATM_UBR || qos->rxtp.traffic_class == + ATM_UBR) q_assign(dsc,QF_best_effort,0); switch (qos->txtp.traffic_class) { case ATM_NONE: - if (qos->rxtp.traffic_class == ATM_CBR) - q_assign(dsc,QF_fw_pcr_01,0); + q_assign(dsc,QF_fw_pcr_01,0); break; case ATM_UBR: - diag(COMPONENT,DIAG_DEBUG,"UBR"); - q_assign(dsc,QF_fw_pcr_01,ATM_OC3_PCR); - q_assign(dsc,QF_bw_pcr_01,ATM_OC3_PCR); - q_assign(dsc,QF_best_effort,0); - break; + /* fall through */ case ATM_CBR: /* here's a bit of policy: send the highest value we have */ pcr = SELECT_TOP_PCR(qos->txtp); - diag(COMPONENT,DIAG_DEBUG,"CBR fwd %d (%d..%d)",pcr, + diag(COMPONENT,DIAG_DEBUG,"fwd %d (%d..%d)",pcr, qos->txtp.min_pcr,qos->txtp.max_pcr); + if (pcr == ATM_MAX_PCR) pcr = ATM_OC3_PCR; q_assign(dsc,QF_fw_pcr_01,pcr); break; default: @@ -233,16 +231,17 @@ qos->txtp.traffic_class); return -EINVAL; } - switch (qos->txtp.traffic_class == ATM_UBR ? ATM_NONE : - qos->rxtp.traffic_class) { + switch (qos->rxtp.traffic_class) { case ATM_NONE: - if (qos->txtp.traffic_class == ATM_CBR) - q_assign(dsc,QF_bw_pcr_01,0); + q_assign(dsc,QF_bw_pcr_01,0); break; + case ATM_UBR: + /* fall through */ case ATM_CBR: pcr = SELECT_TOP_PCR(qos->rxtp); - diag(COMPONENT,DIAG_DEBUG,"CBR bwd %d (%d..%d)",pcr, + diag(COMPONENT,DIAG_DEBUG,"bwd %d (%d..%d)",pcr, qos->rxtp.min_pcr,qos->rxtp.max_pcr); + if (pcr == ATM_MAX_PCR) pcr = ATM_OC3_PCR; q_assign(dsc,QF_bw_pcr_01,pcr); break; default: @@ -361,23 +360,24 @@ } else { qos->txtp.traffic_class = qos->rxtp.traffic_class = ATM_CBR; - qos->txtp.max_pcr = qos->rxtp.max_pcr = 0; - /* unbalanced decoding - always sets upper bound */ - if (q_present(dsc,QF_fw_pcr_01)) { - qos->rxtp.min_pcr = 0; - qos->rxtp.max_pcr = q_fetch(dsc,QF_fw_pcr_01); - } - if (q_present(dsc,QF_bw_pcr_01)) { - qos->txtp.min_pcr = 0; - qos->txtp.max_pcr = q_fetch(dsc,QF_bw_pcr_01); - } - if (!qos->txtp.max_pcr) qos->txtp.traffic_class = ATM_NONE; - if (!qos->rxtp.max_pcr) qos->rxtp.traffic_class = ATM_NONE; - diag(COMPONENT,DIAG_DEBUG,"CBR fwd %d..%d bwd %d..%d", - qos->rxtp.min_pcr,qos->rxtp.max_pcr,qos->txtp.min_pcr, - qos->txtp.max_pcr); - /* SHOULD ... fail call if anything is missing ... @@@ */ + diag(COMPONENT,DIAG_DEBUG,"CBR"); } + qos->txtp.max_pcr = qos->rxtp.max_pcr = 0; + /* unbalanced decoding - always sets upper bound */ + if (q_present(dsc,QF_fw_pcr_01)) { + qos->rxtp.min_pcr = 0; + qos->rxtp.max_pcr = q_fetch(dsc,QF_fw_pcr_01); + } + if (q_present(dsc,QF_bw_pcr_01)) { + qos->txtp.min_pcr = 0; + qos->txtp.max_pcr = q_fetch(dsc,QF_bw_pcr_01); + } + if (!qos->txtp.max_pcr) qos->txtp.traffic_class = ATM_NONE; + if (!qos->rxtp.max_pcr) qos->rxtp.traffic_class = ATM_NONE; + diag(COMPONENT,DIAG_DEBUG,"fwd %d..%d bwd %d..%d", + qos->rxtp.min_pcr,qos->rxtp.max_pcr,qos->txtp.min_pcr, + qos->txtp.max_pcr); + /* SHOULD ... fail call if anything is missing ... @@@ */ if (q_present(dsc,QF_bw_max_sdu)) qos->txtp.max_sdu = q_fetch(dsc,QF_bw_max_sdu); if (q_present(dsc,QF_fw_max_sdu)) diff -ur --new-file old/atm/sigd/sap.h new/atm/sigd/sap.h --- old/atm/sigd/sap.h Fri Jul 26 18:01:39 1996 +++ new/atm/sigd/sap.h Tue Oct 1 17:27:33 1996 @@ -6,8 +6,10 @@ #ifndef SAP_H #define SAP_H -#include #include + +#include "atmsap.h" + int sap_check_packing(const struct sockaddr_atmsvc *packed_sap,int len); struct sockaddr_atmsvc *sap_copy(const struct sockaddr_atmsvc *sap); diff -ur --new-file old/atm/sigd/trace.c new/atm/sigd/trace.c --- old/atm/sigd/trace.c Wed Sep 4 18:24:58 1996 +++ new/atm/sigd/trace.c Wed Oct 9 11:04:32 1996 @@ -11,11 +11,11 @@ #include #include -#include #include #include "atm.h" #include "atmd.h" +#include "atmsap.h" #include "trace.h" @@ -188,7 +188,7 @@ sizeof(*bhli) ? bhli[m->svc.sas_addr.bhli.hl_type] : "???"); if (m->svc.sas_addr.bhli.hl_type == ATM_HL_USER || m->svc.sas_addr.bhli.hl_type == ATM_HL_ISO) - for (i = 0; i < m->svc.sas_addr.bhli.hl_type; i++) + for (i = 0; i < m->svc.sas_addr.bhli.hl_length; i++) append(" %02x",m->svc.sas_addr.bhli.hl_info[i]); append("\n"); for (i = 0; i <= (size-(int) sizeof(struct atmsvc_msg))/ diff -ur --new-file old/atm/test/ttcp.c new/atm/test/ttcp.c --- old/atm/test/ttcp.c Fri Sep 6 14:51:26 1996 +++ new/atm/test/ttcp.c Thu Oct 10 18:39:03 1996 @@ -92,6 +92,7 @@ int atm = 0; /* 0 = INET, !0 = ATM */ int pcr = 0; int arequipa = 0; +char *qos_spec = NULL; char *aq_host; int udp = 0; /* 0 = tcp, !0 = udp */ @@ -231,7 +232,7 @@ port_name = optarg; break; case 'P': - pcr = atoi(optarg); + qos_spec = optarg; break; case 'u': udp = 1; @@ -287,7 +288,9 @@ } if (atm || (arequipa && trans)) { - memset(satm,0,sizeof(satm)); + char *end; + + memset(&satm,0,sizeof(satm)); if (!host) satm.sas_family = AF_ATMSVC; else if (text2atm(atm ? host : aq_host,(struct sockaddr *) &satm, sizeof(satm),T2A_PVC | T2A_SVC | T2A_NAME) < 0) { @@ -295,13 +298,22 @@ exit(1); } memset(&qos,0,sizeof(qos)); - if (!trans) qos.rxtp.traffic_class = ATM_UBR; - else if (!pcr) qos.txtp.traffic_class = ATM_UBR; - else { - qos.txtp.traffic_class = ATM_CBR; - qos.txtp.max_pcr = pcr; + if (!arequipa) qos.rxtp.max_sdu = qos.txtp.max_sdu = buflen; + if (qos_spec && ((pcr = strtol(qos_spec,&end,10)), *end)) { + if (text2qos(qos_spec,&qos,T2Q_DEFAULTS) < 0) { + fprintf(stderr,"invalid QOS specification\n"); + exit(1); } - qos.rxtp.max_sdu = qos.txtp.max_sdu = buflen; + } + else { + if (!qos_spec) pcr = 0; + if (!trans) qos.rxtp.traffic_class = ATM_UBR; + else if (!pcr) qos.txtp.traffic_class = ATM_UBR; + else { + qos.txtp.traffic_class = ATM_CBR; + qos.txtp.max_pcr = pcr; + } + } if (arequipa && !udp) qos.rxtp = qos.txtp; } if (!atm && trans) { .