diff -ur --new-file old/linux/drivers/atm/atmtcp.c new/linux/drivers/atm/atmtcp.c --- old/linux/drivers/atm/atmtcp.c Thu Apr 23 22:25:53 1998 +++ new/linux/drivers/atm/atmtcp.c Thu Apr 23 22:26:47 1998 @@ -208,12 +208,12 @@ }; -int atmtcp_attach(struct atm_vcc *vcc) +int atmtcp_attach(struct atm_vcc *vcc,int itf) { struct atm_dev *dev; - dev = atm_dev_register(DEV_LABEL,&atmtcp_v_dev_ops,0); - if (!dev) return -ENOMEM; + dev = atm_dev_register(DEV_LABEL,&atmtcp_v_dev_ops,itf,0); + if (!dev) return itf == -1 ? -EBUSY : -ENOMEM; dev->ci_range.vpi_bits = MAX_VPI_BITS; dev->ci_range.vci_bits = MAX_VCI_BITS; dev->dev_data = vcc; diff -ur --new-file old/linux/drivers/atm/eni.c new/linux/drivers/atm/eni.c --- old/linux/drivers/atm/eni.c Thu Apr 23 22:25:53 1998 +++ new/linux/drivers/atm/eni.c Thu Apr 23 22:26:47 1998 @@ -38,9 +38,6 @@ * Show stoppers * none * - * Major - * - test ASIC Tonga support - * * Minor * - OAM support * - fix bugs listed below @@ -348,7 +345,7 @@ printk(KERN_CRIT DEV_LABEL "(itf %d): VCI %d has " "mis-aligned RX data (0x%lx)\n",vcc->dev->number, vcc->vci,paddr); - skb->atm.size = size+skip; + ENI_PRV_SIZE(skb) = size+skip; /* PDU plus descriptor */ skb->atm.vcc = vcc; } @@ -434,7 +431,7 @@ dma_wr = (dma_wr+1) & (NR_DMA_RX-1); } if (skb) { - skb->atm.pos = eni_vcc->descr+size+1; + ENI_PRV_POS(skb) = eni_vcc->descr+size+1; skb_queue_tail(&eni_dev->rx_queue,skb); eni_vcc->last = skb; rx_enqueued++; @@ -453,7 +450,7 @@ EVENT("discard (size=%ld)\n",size,0); while (do_rx_dma(vcc,NULL,1,size,0)) EVENT("BUSY LOOP",0,0); /* could do a full fallback, but that might be more expensive */ - if (eni_vcc->rxing) eni_vcc->last->atm.pos += size+1; + if (eni_vcc->rxing) ENI_PRV_POS(eni_vcc->last) += size+1; else eni_vcc->rx_pos = (eni_vcc->rx_pos+size+1) & (eni_vcc->words-1); } @@ -708,27 +705,29 @@ } break; } - EVENT("dequeued (size=%ld,pos=0x%lx)\n",skb->atm.size, - skb->atm.pos); + EVENT("dequeued (size=%ld,pos=0x%lx)\n",ENI_PRV_SIZE(skb), + ENI_PRV_POS(skb)); rx_dequeued++; vcc = skb->atm.vcc; eni_vcc = ENI_VCC(vcc); first = 0; vci_dsc = eni_dev->vci+(vcc->vci << 2); - if (!EEPMOK(eni_vcc->rx_pos,skb->atm.size,(readl(vci_dsc+1) & - MID_VCI_READ) >> MID_VCI_READ_SHIFT,eni_vcc->words)) { + if (!EEPMOK(eni_vcc->rx_pos,ENI_PRV_SIZE(skb), + (readl(vci_dsc+1) & MID_VCI_READ) >> MID_VCI_READ_SHIFT, + eni_vcc->words)) { EVENT("requeuing\n",0,0); skb_queue_head(&eni_dev->rx_queue,skb); break; } eni_vcc->rxing--; - eni_vcc->rx_pos = skb->atm.pos & (eni_vcc->words-1); + eni_vcc->rx_pos = ENI_PRV_POS(skb) & (eni_vcc->words-1); if (!skb->len) kfree_skb(skb); else { EVENT("pushing (len=%ld)\n",skb->len,0); if (vcc->qos.aal == ATM_AAL0) *(unsigned long *) skb->data = ntohl(*(unsigned long *) skb->data); + memset(skb->cb,0,sizeof(struct eni_skb_prv)); vcc->push(vcc,skb); pushed++; } @@ -1062,8 +1061,8 @@ writel(eni_dev->dma[i*2+1],eni_dev->tx_dma+dma_wr*2+1); dma_wr = (dma_wr+1) & (NR_DMA_TX-1); } - skb->atm.pos = tx->tx_pos; - skb->atm.size = size; + ENI_PRV_POS(skb) = tx->tx_pos; + ENI_PRV_SIZE(skb) = size; ENI_VCC(vcc)->txing += size; tx->tx_pos = (tx->tx_pos+size) & (tx->words-1); DPRINTK("dma_wr set to %ld, tx_pos is now %ld\n",dma_wr,tx->tx_pos); @@ -1114,14 +1113,14 @@ NULLCHECK(vcc); tx = ENI_VCC(vcc)->tx; NULLCHECK(ENI_VCC(vcc)->tx); - DPRINTK("dequeue_tx: next 0x%lx curr 0x%x\n",skb->atm.pos, + DPRINTK("dequeue_tx: next 0x%lx curr 0x%x\n",ENI_PRV_POS(skb), readl(eni_dev->reg+MID_TX_DESCRSTART(tx->index))); - if (ENI_VCC(vcc)->txing < tx->words && skb->atm.pos == + if (ENI_VCC(vcc)->txing < tx->words && ENI_PRV_POS(skb) == readl(eni_dev->reg+MID_TX_DESCRSTART(tx->index))) { skb_queue_head(&eni_dev->tx_queue,skb); break; } - ENI_VCC(vcc)->txing -= skb->atm.size; + ENI_VCC(vcc)->txing -= ENI_PRV_SIZE(skb); if (vcc->pop) vcc->pop(vcc,skb); else dev_kfree_skb(skb); vcc->stats->tx++; @@ -1878,7 +1877,7 @@ u32 *dsc; if (skb->atm.vcc != vcc) continue; - dsc = tx->send+skb->atm.pos; + dsc = tx->send+ENI_PRV_POS(skb); *dsc = (*dsc & ~(MID_SEG_RATE | MID_SEG_PR)) | (tx->prescaler << MID_SEG_PR_SHIFT) | (tx->resolution << MID_SEG_RATE_SHIFT); @@ -1921,8 +1920,8 @@ #else -static const struct atm_buffconst bctx = { 4,0,4,0,0,0 }; -static const struct atm_buffconst bcrx = { 4,0,4,0,0,0 }; +static const struct atm_buffconst bctx = { sizeof(int),0,sizeof(int),0,0,0 }; +static const struct atm_buffconst bcrx = { sizeof(int),0,sizeof(int),0,0,0 }; #endif if (level == SOL_AAL && (optname == SO_BCTXOPT || @@ -1959,8 +1958,7 @@ dev_kfree_skb(skb); return -EINVAL; } - *(unsigned long *) skb->data = htonl(*(unsigned long *) - skb->data); + *(u32 *) skb->data = htonl(*(u32 *) skb->data); } submitted++; skb->atm.vcc = vcc; @@ -2098,7 +2096,7 @@ return -ENOMEM; } } - dev = atm_dev_register(DEV_LABEL,&ops,0); + dev = atm_dev_register(DEV_LABEL,&ops,-1,0); if (!dev) break; ENI_DEV(dev) = eni_dev; eni_dev->asic = type; diff -ur --new-file old/linux/drivers/atm/eni.h new/linux/drivers/atm/eni.h --- old/linux/drivers/atm/eni.h Thu Apr 23 22:25:53 1998 +++ new/linux/drivers/atm/eni.h Thu Apr 23 22:26:47 1998 @@ -1,6 +1,6 @@ /* drivers/atm/eni.h - Efficient Networks ENI155P device driver declarations */ -/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ #ifndef DRIVER_ATM_ENI_H @@ -101,5 +101,14 @@ #define ENI_DEV(d) ((struct eni_dev *) (d)->dev_data) #define ENI_VCC(d) ((struct eni_vcc *) (d)->dev_data) + + +struct eni_skb_prv { + unsigned long pos; /* position of next descriptor */ + int size; /* PDU size in reassembly buffer */ +}; + +#define ENI_PRV_SIZE(skb) (((struct eni_skb_prv *) (skb)->cb)->size) +#define ENI_PRV_POS(skb) (((struct eni_skb_prv *) (skb)->cb)->pos) #endif diff -ur --new-file old/linux/drivers/atm/zatm.c new/linux/drivers/atm/zatm.c --- old/linux/drivers/atm/zatm.c Thu Apr 23 22:25:53 1998 +++ new/linux/drivers/atm/zatm.c Thu Apr 23 22:26:47 1998 @@ -869,7 +869,7 @@ put[-2] |= uPD98401_TXBD_LAST; #endif } - skb->atm.pos = (unsigned long) dsc; + ZATM_PRV_DSC(skb) = dsc; skb_queue_tail(&zatm_vcc->tx_queue,skb); DPRINTK("QRP=0x%08lx\n",zpeekl(zatm_dev,zatm_vcc->tx_chan*VC_SIZE/4+ uPD98401_TXVC_QRP)); @@ -895,10 +895,10 @@ "txing\n",vcc->dev->number); return; } -if (*(u32 *) skb->atm.pos != (uPD98401_TXPD_V | uPD98401_TXPD_DP | +if (*ZATM_PRV_DSC(skb) != (uPD98401_TXPD_V | uPD98401_TXPD_DP | uPD98401_TXPD_SM | uPD98401_TXPD_AAL5)) printk("@#*$!!!! (%08x)\n", - *(u32 *) skb->atm.pos); - *(u32 *) skb->atm.pos = 0; /* mark as invalid */ + *ZATM_PRV_DSC(skb)); + *ZATM_PRV_DSC(skb) = 0; /* mark as invalid */ zatm_vcc->txing--; if (vcc->pop) vcc->pop(vcc,skb); else dev_kfree_skb(skb); @@ -1825,7 +1825,7 @@ while (!pcibios_find_device(PCI_VENDOR_ID_ZEITNET,type ? PCI_DEVICE_ID_ZEITNET_1225 : PCI_DEVICE_ID_ZEITNET_1221, index,&zatm_dev->bus,&zatm_dev->dev_fn)) { - dev = atm_dev_register(DEV_LABEL,&ops,0); + dev = atm_dev_register(DEV_LABEL,&ops,-1,0); if (!dev) break; ZATM_DEV(dev) = zatm_dev; zatm_dev->copper = type; diff -ur --new-file old/linux/drivers/atm/zatm.h new/linux/drivers/atm/zatm.h --- old/linux/drivers/atm/zatm.h Thu Apr 23 22:25:53 1998 +++ new/linux/drivers/atm/zatm.h Thu Apr 23 22:26:47 1998 @@ -1,6 +1,6 @@ /* drivers/atm/zatm.h - ZeitNet ZN122x device driver declarations */ -/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ #ifndef DRIVER_ATM_ZATM_H @@ -125,5 +125,12 @@ #define ZATM_DEV(d) ((struct zatm_dev *) (d)->dev_data) #define ZATM_VCC(d) ((struct zatm_vcc *) (d)->dev_data) + + +struct zatm_skb_prv { + u32 *dsc; /* pointer to skb's descriptor */ +}; + +#define ZATM_PRV_DSC(skb) (((struct zatm_skb_prv *) (skb)->cb)->dsc) #endif diff -ur --new-file old/linux/include/linux/atm.h new/linux/include/linux/atm.h --- old/linux/include/linux/atm.h Thu Apr 23 22:25:54 1998 +++ new/linux/include/linux/atm.h Thu Apr 23 22:26:47 1998 @@ -1,6 +1,6 @@ /* atm.h - general ATM declarations */ -/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ +/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ #ifndef _LINUX_ATM_H @@ -11,6 +11,7 @@ * documentation. Do not change them. */ +#include #include #include #include @@ -30,13 +31,6 @@ #define ATM_MAX_VPI_NNI 4096 /* maximum VPI at the NNI */ #define ATM_MAX_VCI 65535 /* maximum VCI */ -/* - * The following items should be added to sys/socket.h aka linux/socket.h - */ - -/* address families */ -#define AF_ATMPVC 6 /* ATM PVCs */ -#define AF_ATMSVC 7 /* ATM SVCs */ /* "protcol" values for the socket system call */ #define ATM_NO_AAL 0 /* AAL not specified */ @@ -47,27 +41,12 @@ #define ATM_AAL5 5 /* AAL5 (data) */ #define ATM_SAAL 12 /* signaling AAL */ -/* - * UGLY - there should only be one protocol family (PF_ATM) for both - * address families. A quick glance at some kernel internals seems to - * suggest to me that doing it the "right" way might involve some - * swimming against the stream ... - */ - -/* protocol families */ -#define PF_ATMPVC AF_ATMPVC -#define PF_ATMSVC AF_ATMSVC - /* socket option name coding functions */ -#define __SO_ENCODE(l,n,t) (((l) << 24) | ((n) << 16) | sizeof(t)) -#define __SO_LEVEL(c) ((c) >> 24) -#define __SO_NUMBER(c) (((c) >> 16) & 0xff) -#define __SO_SIZE(c) ((c) & 0xffff) - -/* layers for getsockopt/setsockopt */ -#define SOL_ATM 2 -#define SOL_AAL 3 +#define __SO_ENCODE(l,n,t) (((l) << 22) | ((n) << 16) | sizeof(t)) +#define __SO_LEVEL(c) ((c) >> 22) +#define __SO_NUMBER(c) (((c) >> 16) & 0x3f) +#define __SO_SIZE(c) ((c) & 0x3fff) /* * ATM layer diff -ur --new-file old/linux/include/linux/atm_tcp.h new/linux/include/linux/atm_tcp.h --- old/linux/include/linux/atm_tcp.h Thu Apr 23 22:25:54 1998 +++ new/linux/include/linux/atm_tcp.h Thu Apr 23 22:26:47 1998 @@ -1,7 +1,7 @@ /* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by driver-specific utilities) */ -/* Written 1997 by Werner Almesberger, EPFL LRC */ +/* Written 1997,1998 by Werner Almesberger, EPFL LRC/ICA */ #ifndef LINUX_ATM_TCP_H @@ -23,7 +23,7 @@ #ifdef __KERNEL__ -int atmtcp_attach(struct atm_vcc *vcc); +int atmtcp_attach(struct atm_vcc *vcc,int itf); #endif diff -ur --new-file old/linux/include/linux/atmarp.h new/linux/include/linux/atmarp.h --- old/linux/include/linux/atmarp.h Thu Apr 23 22:25:54 1998 +++ new/linux/include/linux/atmarp.h Thu Apr 23 22:26:47 1998 @@ -6,12 +6,7 @@ #ifndef _LINUX_ATMARP_H #define _LINUX_ATMARP_H -#ifdef __KERNEL__ /* @@@ glibc2 hack */ -#include -#else -#include -#endif - +#include #include #include @@ -36,11 +31,6 @@ #define TL_E164 0x40 -#define ATF_NULL 0x1000 /* use NULL encapsulation */ -#define ATF_ARPSRV 0x2000 /* entry describes ARP server */ -#define ATF_DEFQOS 0x4000 /* entry defines default QOS */ - - #define MAX_ATMARP_SIZE (sizeof(struct atmarphdr)-1+2*(ATM_E164_LEN+ \ ATM_ESA_LEN+4)) @@ -56,49 +46,19 @@ #define ATMARP_SETENTRY _IO('a',ATMIOC_CLIP+3) /* fill or hide ARP entry */ #define ATMARP_ENCAP _IO('a',ATMIOC_CLIP+5) /* change encapsulation */ -/* - * ATMARP ioctl request. Mimics the structure of struct arpreq in - * include/linux/if_arp.h - */ - -struct atmarpreq { - struct sockaddr arp_pa; /* protocol address */ - struct sockaddr dummy; /* hw addr in struct arpreq */ - int arp_flags; /* flags */ - struct sockaddr arp_netmask; /* netmask */ - char arp_dev[16]; /* device name */ - struct sockaddr_atmsvc arp_ha; /* PVC or SVC address */ - struct atm_qos arp_qos; /* requested QOS */ -}; - - -struct atmarp_arpsioc { - struct sockaddr pa; /* protocol address */ - int aa_len; /* size of ATM address */ - struct sockaddr_atmsvc aa; /* SVC address */ -}; - - -#define ATMARP_CTRL_MAGIC 0xac /* put this into the magic byte */ enum atmarp_ctrl_type { act_invalid, /* catch uninitialized structures */ act_need, /* need address resolution */ - act_create, /* interface has been created */ act_up, /* interface is coming up */ act_down, /* interface is going down */ - act_ioctl, /* ioctl follows */ - act_complete, /* demon indicates completion */ act_change /* interface configuration has changed */ }; struct atmarp_ctrl { - unsigned char magic; /* constant */ enum atmarp_ctrl_type type; /* message type */ - volatile int *reply; /* reply address, NULL is asynch */ int itf_num;/* interface number (if present) */ - unsigned long arg; /* argument, e.g. IP address */ - unsigned char data[1];/* optional data */ + uint32_t ip; /* IP address (act_need only) */ }; #endif diff -ur --new-file old/linux/include/linux/atmdev.h new/linux/include/linux/atmdev.h --- old/linux/include/linux/atmdev.h Thu Apr 23 22:25:54 1998 +++ new/linux/include/linux/atmdev.h Thu Apr 23 22:26:47 1998 @@ -282,7 +282,7 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, - unsigned long flags); + int number,unsigned long flags); /* number == -1: pick first available */ void atm_dev_deregister(struct atm_dev *dev); diff -ur --new-file old/linux/include/linux/skbuff.h new/linux/include/linux/skbuff.h --- old/linux/include/linux/skbuff.h Thu Apr 23 22:25:54 1998 +++ new/linux/include/linux/skbuff.h Thu Apr 23 22:26:48 1998 @@ -119,16 +119,12 @@ #endif #ifdef CONFIG_ATM struct { - int size; /* PDU size (adapter too) */ - unsigned long pos; /* adapter data */ struct atm_vcc *vcc; /* ATM VCC */ int iovcnt; /* 0 for "normal" operation */ #ifdef CONFIG_ATM_NICSTAR void *recycle_buffer; /* set when buffer should be */ /* recycled; points to vcc */ #endif - int encap; /* non-zero if encapsulated */ - /* for ATMARP */ #ifdef CONFIG_AREQUIPA int generation; /* generation number */ #endif diff -ur --new-file old/linux/include/linux/socket.h new/linux/include/linux/socket.h --- old/linux/include/linux/socket.h Tue Mar 10 18:47:26 1998 +++ new/linux/include/linux/socket.h Thu Apr 23 22:26:48 1998 @@ -138,7 +138,7 @@ #define AF_APPLETALK 5 /* Appletalk DDP */ #define AF_NETROM 6 /* Amateur Radio NET/ROM */ #define AF_BRIDGE 7 /* Multiprotocol bridge */ -#define AF_AAL5 8 /* Reserved for Werner's ATM */ +#define AF_ATMPVC 8 /* ATM PVCs */ #define AF_X25 9 /* Reserved for X.25 project */ #define AF_INET6 10 /* IP version 6 */ #define AF_ROSE 11 /* Amateur Radio X.25 PLP */ @@ -150,6 +150,7 @@ #define AF_ROUTE AF_NETLINK /* Alias to emulate 4.4BSD */ #define AF_PACKET 17 /* Packet family */ #define AF_ASH 18 /* Ash */ +#define AF_ATMSVC 20 /* ATM SVCs */ #define AF_MAX 32 /* For now.. */ /* Protocol families, same as address families. */ @@ -162,7 +163,7 @@ #define PF_APPLETALK AF_APPLETALK #define PF_NETROM AF_NETROM #define PF_BRIDGE AF_BRIDGE -#define PF_AAL5 AF_AAL5 +#define PF_ATMPVC AF_ATMPVC #define PF_X25 AF_X25 #define PF_INET6 AF_INET6 #define PF_ROSE AF_ROSE @@ -174,6 +175,7 @@ #define PF_ROUTE AF_ROUTE #define PF_PACKET AF_PACKET #define PF_ASH AF_ASH +#define PF_ATMSVC AF_ATMSVC #define PF_MAX AF_MAX @@ -220,6 +222,8 @@ #define SOL_DECNET 261 #define SOL_X25 262 #define SOL_PACKET 263 +#define SOL_ATM 264 /* ATM layer (cell level) */ +#define SOL_AAL 265 /* ATM Adaption Layer (packet level) */ /* IPX options */ #define IPX_TYPE 1 diff -ur --new-file old/linux/include/net/atmclip.h new/linux/include/net/atmclip.h --- old/linux/include/net/atmclip.h Thu Apr 23 22:25:54 1998 +++ new/linux/include/net/atmclip.h Thu Apr 23 22:26:48 1998 @@ -59,6 +59,4 @@ int clip_setentry(struct atm_vcc *vcc,u32 ip); int clip_encap(struct atm_vcc *vcc,int mode); -int clip_arp_ioctl(struct device *dev,unsigned int cmd,void *arg); - #endif diff -ur --new-file old/linux/net/atm/clip.c new/linux/net/atm/clip.c --- old/linux/net/atm/clip.c Thu Apr 23 22:25:54 1998 +++ new/linux/net/atm/clip.c Thu Apr 23 22:26:48 1998 @@ -23,6 +23,7 @@ #include #include /* for struct rtable and routing */ #include /* ip_acct_output, etc. */ +#include /* icmp_send */ #include /* for HZ */ #include /* for htons etc. */ #include /* save/restore_flags */ @@ -50,63 +51,23 @@ static int start_timer = 1; -#define WAITING 1 /* see also signaling.h */ - - -static int from_atmarpd(struct atm_vcc *vcc,struct sk_buff *skb) -{ - struct atmarp_ctrl *ctrl; - - atomic_sub(skb->truesize+ATM_PDU_OVHD,&vcc->tx_inuse); - ctrl = (struct atmarp_ctrl *) skb->data; - if (ctrl->magic != ATMARP_CTRL_MAGIC) { - printk(KERN_ALERT "from_atmarpd: bad magic 0x%x\n", - ctrl->magic); - return -EPROTO; - } - if (ctrl->type != act_complete) { - printk(KERN_ALERT "from_atmarpd: bad type 0x%x\n",ctrl->type); - return -EPROTO; - } - if (!ctrl->reply) { - printk(KERN_ALERT "from_atmarpd: no reply\n"); - return -EPROTO; - } - *ctrl->reply = ctrl->arg; - wake_up(&atmarpd_sleep); - dev_kfree_skb(skb); - return 0; -} - - -static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long arg, - void *data,int length) +static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long ip) { struct atmarp_ctrl *ctrl; struct sk_buff *skb; - int size,need_reply; - volatile int reply; DPRINTK("to_atmarpd(%d)\n",type); if (!atmarpd) return -EUNATCH; - size = sizeof(struct atmarp_ctrl)+(data ? length : 0); - skb = alloc_skb(size,GFP_ATOMIC); + skb = alloc_skb(sizeof(struct atmarp_ctrl),GFP_ATOMIC); if (!skb) return -ENOMEM; - ctrl = (struct atmarp_ctrl *) skb_put(skb,size); - need_reply = type == act_ioctl || type == act_create; - ctrl->magic = ATMARP_CTRL_MAGIC; + ctrl = (struct atmarp_ctrl *) skb_put(skb,sizeof(struct atmarp_ctrl)); ctrl->type = type; - ctrl->reply = need_reply ? &reply : NULL; ctrl->itf_num = itf; - ctrl->arg = arg; - if (data) memcpy(ctrl->data,data,length); - reply = WAITING; + ctrl->ip = ip; atomic_add(skb->truesize+ATM_PDU_OVHD,&atmarpd->rx_inuse); skb_queue_tail(&atmarpd->recvq,skb); wake_up(&atmarpd->sleep); - if (!need_reply) return 0; - while (reply == WAITING && atmarpd) sleep_on(&atmarpd_sleep); - return atmarpd ? reply : -EUNATCH; + return 0; } @@ -270,8 +231,7 @@ static void clip_neigh_solicit(struct neighbour *neigh,struct sk_buff *skb) { DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n",neigh,skb); - to_atmarpd(act_need,PRIV(neigh->dev)->number, - *(u32 *) neigh->primary_key,NULL,0); + to_atmarpd(act_need,PRIV(neigh->dev)->number,NEIGH2ENTRY(neigh)->ip); } @@ -296,7 +256,7 @@ static int clip_constructor(struct neighbour *neigh) { - struct atmarp_entry *entry = (struct atmarp_entry *) neigh->primary_key; + struct atmarp_entry *entry = NEIGH2ENTRY(neigh); struct device *dev = neigh->dev; struct in_device *in_dev = dev->ip_ptr; @@ -310,7 +270,7 @@ neigh->ops->connected_output : neigh->ops->output; entry->neigh = neigh; entry->vccs = NULL; - entry->expires = jiffies+ATMARP_RETRY_DELAY*HZ; + entry->expires = jiffies-1; return 0; } @@ -390,8 +350,10 @@ } entry = NEIGH2ENTRY(skb->dst->neighbour); if (!entry->vccs) { - if (entry->expires < jiffies) /* should be resolved */ - to_atmarpd(act_need,PRIV(dev)->number,entry->ip,NULL,0); + if (entry->expires < jiffies) {/* should be resolved */ + entry->expires = jiffies+ATMARP_RETRY_DELAY*HZ; + to_atmarpd(act_need,PRIV(dev)->number,entry->ip); + } if (entry->neigh->arp_queue.qlen < ATMARP_MAX_UNRES_PACKETS) skb_queue_tail(&entry->neigh->arp_queue,skb); else { @@ -511,34 +473,6 @@ } -int clip_arp_ioctl(struct device *dev,unsigned int cmd,void *arg) -{ - struct atmarpreq req; - __u32 *ip; - - DPRINTK("clip_ioctl\n"); - if (copy_from_user(&req,arg,sizeof(struct atmarpreq))) return -EFAULT; - if (req.arp_pa.sa_family != AF_INET) return -EPFNOSUPPORT; - ip = &((struct sockaddr_in *) &req.arp_pa)->sin_addr.s_addr; -#if 0 /* ??? fix later @@@ */ - if (!(*ip & ~dev->pa_mask) && !(req.arp_flags & (ATF_ARPSRV | - ATF_DEFQOS))) - return -EINVAL; -#endif - switch (cmd) { - case SIOCSARP: - case SIOCDARP: - case SIOCGARP: - return to_atmarpd(act_ioctl,PRIV(dev)->number,cmd,&req, - sizeof(struct atmarpreq)); - /* @@@ get will need special treatment */ - default: - return -EINVAL; - } - return 0; -} - - static int clip_init(struct device *dev) { DPRINTK("clip_init %s\n",dev->name); @@ -556,7 +490,7 @@ dev->hard_header_len = RFC1483LLC_LEN; dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST); dev->mtu = RFC1626_MTU; - return to_atmarpd(act_create,PRIV(dev)->number,0,NULL,0); + return 0; } @@ -603,16 +537,15 @@ switch (event) { case NETDEV_UP: DPRINTK("clip_device_event NETDEV_UP\n"); - (void) to_atmarpd(act_up,PRIV(dev)->number,0,NULL,0); + (void) to_atmarpd(act_up,PRIV(dev)->number,0); break; case NETDEV_DOWN: DPRINTK("clip_device_event NETDEV_DOWN\n"); - (void) to_atmarpd(act_down,PRIV(dev)->number,0,NULL,0); + (void) to_atmarpd(act_down,PRIV(dev)->number,0); break; case NETDEV_CHANGE: DPRINTK("clip_device_event NETDEV_CHANGE\n"); - (void) to_atmarpd(act_change,PRIV(dev)->number,0,NULL, - 0); + (void) to_atmarpd(act_change,PRIV(dev)->number,0); break; case NETDEV_REBOOT: case NETDEV_REGISTER: @@ -660,7 +593,7 @@ NULL, /* no ioctl */ NULL, /* no getsockopt */ NULL, /* no setsockopt */ - from_atmarpd, /* send */ + NULL, /* send */ NULL, /* no sg_send */ NULL, /* no send_oam */ NULL, /* no phy_put */ @@ -705,6 +638,6 @@ register_netdevice_notifier(&clip_dev_notifier); for (dev = clip_devs; dev; dev = PRIV(dev)->next) if (dev->flags & IFF_UP) - (void) to_atmarpd(act_up,PRIV(dev)->number,0,NULL,0); + (void) to_atmarpd(act_up,PRIV(dev)->number,0); return 0; } diff -ur --new-file old/linux/net/atm/common.c new/linux/net/atm/common.c --- old/linux/net/atm/common.c Thu Apr 23 22:25:54 1998 +++ new/linux/net/atm/common.c Thu Apr 23 22:26:48 1998 @@ -666,7 +666,7 @@ #ifdef CONFIG_ATM_TCP case SIOCSIFATMTCP: if (!suser()) return -EPERM; - error = atmtcp_attach(vcc); + error = atmtcp_attach(vcc,(int) arg); if (error >= 0) sock->state = SS_CONNECTED; return error; #endif diff -ur --new-file old/linux/net/atm/proc.c new/linux/net/atm/proc.c --- old/linux/net/atm/proc.c Thu Apr 23 22:25:54 1998 +++ new/linux/net/atm/proc.c Thu Apr 23 22:26:48 1998 @@ -222,7 +222,6 @@ ip_len = sprintf(buf+off,"%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]); off += ip_len; while (ip_len++ < 16) buf[off++] = ' '; -off += sprintf(buf+off,"[ref %d]",atomic_read(&entry->neigh->refcnt)); if (!clip_vcc) if (entry->expires > jiffies) strcpy(buf+off,"(resolving)\n"); else sprintf(buf+off,"(expired, ref %d)\n", @@ -290,14 +289,7 @@ if (!vcc->dev) sprintf(buf,"Unassigned "); else sprintf(buf,"%3d %3d %5d ",vcc->dev->number,vcc->vpi,vcc->vci); here = strchr(buf,0); - here += sprintf(here,"%-10s ",vcc == sigd ? "Signaling" : -#ifdef CONFIG_ATM_CLIP - vcc == atmarpd ? "ATMARPctrl" : -#endif -#ifdef CONFIG_AREQUIPA - vcc == aqd ? "Arequipa" : -#endif - vcc_state(vcc)); + here += sprintf(here,"%-10s ",vcc_state(vcc)); here += sprintf(here,"%s%s",vcc->remote.sas_addr.pub, *vcc->remote.sas_addr.pub && *vcc->remote.sas_addr.prv ? "+" : ""); if (*vcc->remote.sas_addr.prv) @@ -429,6 +421,11 @@ svc_info(vcc,buf); return strlen(buf); } + for (vcc = nodev_vccs; vcc; vcc = vcc->next) + if (vcc->family == PF_ATMSVC && !left--) { + svc_info(vcc,buf); + return strlen(buf); + } return 0; } #ifdef CONFIG_ATM_CLIP diff -ur --new-file old/linux/net/atm/resources.c new/linux/net/atm/resources.c --- old/linux/net/atm/resources.c Thu Apr 23 22:25:54 1998 +++ new/linux/net/atm/resources.c Thu Apr 23 22:26:48 1998 @@ -64,7 +64,7 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, - unsigned long flags) + int number,unsigned long flags) { struct atm_dev *dev; @@ -74,8 +74,17 @@ type); return NULL; } - dev->number = 0; - while (atm_find_dev(dev->number)) dev->number++; + if (number != -1) { + if (atm_find_dev(number)) { + free_atm_dev(dev); + return NULL; + } + dev->number = number; + } + else { + dev->number = 0; + while (atm_find_dev(dev->number)) dev->number++; + } dev->vccs = dev->last = NULL; dev->dev_data = NULL; barrier(); diff -ur --new-file old/linux/net/ipv4/arp.c new/linux/net/ipv4/arp.c --- old/linux/net/ipv4/arp.c Thu Apr 23 22:25:54 1998 +++ new/linux/net/ipv4/arp.c Thu Apr 23 22:26:48 1998 @@ -885,24 +885,6 @@ return -EINVAL; } -#ifdef CONFIG_ATM_CLIP - if (!dev) { - struct rtable *rt; - - err = ip_route_output(&rt, - ((struct sockaddr_in *) &r.arp_pa)->sin_addr.s_addr, - 0, 1 /* local */, 0); - if (err) return err; - dev = rt->u.dst.dev; - ip_rt_put(rt); - } - - if (dev->type == ARPHRD_ATM) { - err = clip_arp_ioctl(dev, cmd, arg); - goto out; - } -#endif - if (r.arp_pa.sa_family != AF_INET) return -EPFNOSUPPORT; .