summaryrefslogtreecommitdiffstats
path: root/drivers/atm/zatm.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/atm/zatm.h
downloadlinux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.gz
linux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.bz2
linux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.zip
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/atm/zatm.h')
-rw-r--r--drivers/atm/zatm.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/drivers/atm/zatm.h b/drivers/atm/zatm.h
new file mode 100644
index 000000000000..34a0480f63d6
--- /dev/null
+++ b/drivers/atm/zatm.h
@@ -0,0 +1,103 @@
+/* drivers/atm/zatm.h - ZeitNet ZN122x device driver declarations */
+
+/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */
+
+
+#ifndef DRIVER_ATM_ZATM_H
+#define DRIVER_ATM_ZATM_H
+
+#include <linux/config.h>
+#include <linux/skbuff.h>
+#include <linux/atm.h>
+#include <linux/atmdev.h>
+#include <linux/sonet.h>
+#include <linux/pci.h>
+
+
+#define DEV_LABEL "zatm"
+
+#define MAX_AAL5_PDU 10240 /* allocate for AAL5 PDUs of this size */
+#define MAX_RX_SIZE_LD 14 /* ceil(log2((MAX_AAL5_PDU+47)/48)) */
+
+#define LOW_MARK 12 /* start adding new buffers if less than 12 */
+#define HIGH_MARK 30 /* stop adding buffers after reaching 30 */
+#define OFF_CNG_THRES 5 /* threshold for offset changes */
+
+#define RX_SIZE 2 /* RX lookup entry size (in bytes) */
+#define NR_POOLS 32 /* number of free buffer pointers */
+#define POOL_SIZE 8 /* buffer entry size (in bytes) */
+#define NR_SHAPERS 16 /* number of shapers */
+#define SHAPER_SIZE 4 /* shaper entry size (in bytes) */
+#define VC_SIZE 32 /* VC dsc (TX or RX) size (in bytes) */
+
+#define RING_ENTRIES 32 /* ring entries (without back pointer) */
+#define RING_WORDS 4 /* ring element size */
+#define RING_SIZE (sizeof(unsigned long)*(RING_ENTRIES+1)*RING_WORDS)
+
+#define NR_MBX 4 /* four mailboxes */
+#define MBX_RX_0 0 /* mailbox indices */
+#define MBX_RX_1 1
+#define MBX_TX_0 2
+#define MBX_TX_1 3
+
+struct zatm_vcc {
+ /*-------------------------------- RX part */
+ int rx_chan; /* RX channel, 0 if none */
+ int pool; /* free buffer pool */
+ /*-------------------------------- TX part */
+ int tx_chan; /* TX channel, 0 if none */
+ int shaper; /* shaper, <0 if none */
+ struct sk_buff_head tx_queue; /* list of buffers in transit */
+ wait_queue_head_t tx_wait; /* for close */
+ u32 *ring; /* transmit ring */
+ int ring_curr; /* current write position */
+ int txing; /* number of transmits in progress */
+ struct sk_buff_head backlog; /* list of buffers waiting for ring */
+};
+
+struct zatm_dev {
+ /*-------------------------------- TX part */
+ int tx_bw; /* remaining bandwidth */
+ u32 free_shapers; /* bit set */
+ int ubr; /* UBR shaper; -1 if none */
+ int ubr_ref_cnt; /* number of VCs using UBR shaper */
+ /*-------------------------------- RX part */
+ int pool_ref[NR_POOLS]; /* free buffer pool usage counters */
+ volatile struct sk_buff *last_free[NR_POOLS];
+ /* last entry in respective pool */
+ struct sk_buff_head pool[NR_POOLS];/* free buffer pools */
+ struct zatm_pool_info pool_info[NR_POOLS]; /* pool information */
+ /*-------------------------------- maps */
+ struct atm_vcc **tx_map; /* TX VCCs */
+ struct atm_vcc **rx_map; /* RX VCCs */
+ int chans; /* map size, must be 2^n */
+ /*-------------------------------- mailboxes */
+ unsigned long mbx_start[NR_MBX];/* start addresses */
+ u16 mbx_end[NR_MBX]; /* end offset (in bytes) */
+ /*-------------------------------- other pointers */
+ u32 pool_base; /* Free buffer pool dsc (word addr) */
+ /*-------------------------------- ZATM links */
+ struct atm_dev *more; /* other ZATM devices */
+ /*-------------------------------- general information */
+ int mem; /* RAM on board (in bytes) */
+ int khz; /* timer clock */
+ int copper; /* PHY type */
+ unsigned char irq; /* IRQ */
+ unsigned int base; /* IO base address */
+ struct pci_dev *pci_dev; /* PCI stuff */
+ spinlock_t lock;
+};
+
+
+#define ZATM_DEV(d) ((struct zatm_dev *) (d)->dev_data)
+#define ZATM_VCC(d) ((struct zatm_vcc *) (d)->dev_data)
+
+
+struct zatm_skb_prv {
+ struct atm_skb_data _; /* reserved */
+ u32 *dsc; /* pointer to skb's descriptor */
+};
+
+#define ZATM_PRV_DSC(skb) (((struct zatm_skb_prv *) (skb)->cb)->dsc)
+
+#endif