/* atmdd.h */ /* Copyright (c) 1996 Robert Geist and James Westall * Clemson University Dept. of Computer Science * * 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. */ #ifndef APP_MODE #include #include #include #include #include #include #include #include #include #include #include #include #include #include extern int atm_open(struct inode *inode, struct file *fp); extern int atm_release(struct inode *inode,struct file *fp); extern int atm_ioctl(struct inode *inode, struct file *fp, unsigned int func_code, unsigned long arg); #endif #if 0 #include #include #endif #include "atmuser.h" #include "atmxram.h" #include "ape25.h" /* This is the linux defined file operation table */ #define APE25_MAJOR 15 /* Device id */ #define PCI_VENDOR_ID_IBM 0x1014 #define PCI_DEVICE_ID_ATM_APE25 0x0053 struct udmatype { unsigned int phys_base; unsigned int *virt_base; unsigned int *kbase; }; #ifdef FULL_STACK #define XB_SIZE 128 /* Size of a transmit buffer */ #define XB_COUNT 1 /* Number of transmit buffers */ #define XBH_COUNT 128 /* Number of transmit headers */ #define RB_SIZE (9400) /* Same for receive buffers. */ #define RB_COUNT 1 #define RBH_COUNT 64 #define SKB_COUNT 32 #else #define XB_SIZE 2048 /* Size of a transmit buffer */ #define XB_COUNT 48 /* Number of transmit buffers */ #define XBH_COUNT 48 /* Number of transmit headers */ #define RB_SIZE 2048 /* Same for receive buffers. */ #define RB_COUNT 48 #define RBH_COUNT 256 #endif struct xbftype { char data[XB_SIZE]; }; struct rbftype { char data[RB_SIZE]; }; /* For this version of the driver we use a Max SDU = bufsize */ /* Thus there will always be a 1 to one correspondence betweeen */ /* transmit frame descriptors and transmit buffers. */ struct xbptype { struct tfdtype tfds[XBH_COUNT]; struct xbftype xbfs[XB_COUNT]; }; struct rbptype { struct rbhtype rbhs[RBH_COUNT]; struct rbftype rbfs[RB_COUNT]; }; struct pddtype { unsigned char pci_bus; unsigned char pci_devfn; unsigned char pci_irq; unsigned char pci_revid; unsigned short pci_vendor; unsigned short pci_device; unsigned short pci_command; unsigned short pci_status; unsigned int pci_iobase; unsigned int *pci_membase; unsigned char esi[7]; /* End system identifier data */ struct udmatype dmabuf[2]; struct xbptype *xbpool; /* Transmit buffer pool. */ struct rbptype *rbpool; /* Receive buffer pool. */ struct tfdtype *free_tfds; struct tfdtype *stcl; /* -> xmit complete list. */ spinlock_t xmitlock; /* Sending side SMP lock */ #if 0 /* Not too sure about this yet.. */ spinlock_t recvlock; /* Receiver SMP lock */ spinlock_t xramlock; /* XRAM SMP lock */ #else #define recvlock xmitlock #define xramlock xmitlock #endif /* Head and tail pointers to the free list of transmit */ /* frame descriptors. */ struct tfdtype *sftfdl; /* -> xmit complete list. */ struct tfdtype *eftfdl; /* -> xmit complete list. */ struct rbhtype *erfl; /* -> END of receive free list */ struct rbhtype *srrl[8]; /* Start of recv ready lists */ #if 0 struct wait_queue *tfd_waitq; /* Wait queue for xmit descs. */ struct wait_queue *tbc_waitq[LC_COUNT]; /* Wait queue for xmit descs. */ struct wait_queue *rlc_waitq[LC_COUNT]; #else wait_queue_head_t tfd_waitq; /* Wait queue for xmit descs. */ wait_queue_head_t tbc_waitq[LC_COUNT]; /* Wait queue for xmit descs. */ wait_queue_head_t rlc_waitq[LC_COUNT]; struct sk_buff_head tx_queue[LC_COUNT]; /* Output packet queue */ int tx_backlog[LC_COUNT]; /* Queue population */ int tx_pending; /* Total backlog */ int last_tx_vcc; /* Used for RR queueing */ int max_lc_ndx; #endif unsigned short lc_to_vci[LC_COUNT]; /* LCndx to VCI mapping table */ unsigned short vci_to_lc[LCI_COUNT]; /* VCI to LCndx mapping table */ struct rbhtype *slcrbl[LC_COUNT]; /* Start of lc based rcv buf lst */ struct rbhtype *elcrbl[LC_COUNT]; /* End of lc based rcv buf lst */ struct rbhtype *sfreerbh; /* Start of free RBH list */ struct rbhtype *efreerbh; /* End of free RBH list. */ int tbcount[LC_COUNT]; /* Transmit buffers alloc. */ int tbtolowp; /* Transmit buffers alloc */ /* to low priority LC's */ unsigned char lcstatus[LC_COUNT]; /* LC status byte. */ /* The atm device structure */ #ifdef FULL_STACK struct atm_dev *atmdev; /* -> registered device struct */ #endif #ifdef CAPTURE_PMD struct pmdtype *pmddata; #endif #ifdef CAPTURE_BUF unsigned int logbuflen; unsigned char logbuf[RB_SIZE]; unsigned int xlogbuflen; unsigned char xlogbuf[RB_SIZE]; #endif #ifdef SYNTHETIC_DROPS unsigned int tqmax; /* Configurable constraint */ unsigned int dropthresh; /* on xmit queue length */ #endif };