RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / net / skfp / h / osdef1st.h
blob2862dca20f94bd5a4e541e84792abff11bed3ead
1 /******************************************************************************
3 * (C)Copyright 1998,1999 SysKonnect,
4 * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * The information in this file is provided "AS IS" without warranty.
13 ******************************************************************************/
15 /*
16 * Operating system-dependent definitions that have to be defined
17 * before any other header files are included.
20 // HWM (HardWare Module) Definitions
21 // -----------------------
23 #include <asm/byteorder.h>
25 #ifdef __LITTLE_ENDIAN
26 #define LITTLE_ENDIAN
27 #else
28 #define BIG_ENDIAN
29 #endif
31 // this is set in the makefile
32 // #define PCI /* only PCI adapters supported by this driver */
33 // #define MEM_MAPPED_IO /* use memory mapped I/O */
36 #define USE_CAN_ADDR /* DA and SA in MAC header are canonical. */
38 #define MB_OUTSIDE_SMC /* SMT Mbufs outside of smc struct. */
40 // -----------------------
43 // SMT Definitions
44 // -----------------------
45 #define SYNC /* allow synchronous frames */
47 // #define SBA /* Synchronous Bandwidth Allocator support */
48 /* not available as free source */
50 #define ESS /* SBA End Station Support */
52 #define SMT_PANIC(smc, nr, msg) printk(KERN_INFO "SMT PANIC: code: %d, msg: %s\n",nr,msg)
55 #ifdef DEBUG
56 #define printf(s,args...) printk(KERN_INFO s, ## args)
57 #endif
59 // #define HW_PTR u_long
60 // -----------------------
64 // HWM and OS-specific buffer definitions
65 // -----------------------
67 // default number of receive buffers.
68 #define NUM_RECEIVE_BUFFERS 10
70 // default number of transmit buffers.
71 #define NUM_TRANSMIT_BUFFERS 10
73 // Number of SMT buffers (Mbufs).
74 #define NUM_SMT_BUF 4
76 // Number of TXDs for asynchronous transmit queue.
77 #define HWM_ASYNC_TXD_COUNT (NUM_TRANSMIT_BUFFERS + NUM_SMT_BUF)
79 // Number of TXDs for synchronous transmit queue.
80 #define HWM_SYNC_TXD_COUNT HWM_ASYNC_TXD_COUNT
83 // Number of RXDs for receive queue #1.
84 #if (NUM_RECEIVE_BUFFERS > 100)
85 #define SMT_R1_RXD_COUNT (1 + 100)
86 #else
87 #define SMT_R1_RXD_COUNT (1 + NUM_RECEIVE_BUFFERS)
88 #endif
90 // Number of RXDs for receive queue #2.
91 #define SMT_R2_RXD_COUNT 0 // Not used.
92 // -----------------------
97 * OS-specific part of the transmit/receive descriptor structure (TXD/RXD).
99 * Note: The size of these structures must follow this rule:
101 * sizeof(struct) + 2*sizeof(void*) == n * 16, n >= 1
103 * We use the dma_addr fields under Linux to keep track of the
104 * DMA address of the packet data, for later pci_unmap_single. -DaveM
107 struct s_txd_os { // os-specific part of transmit descriptor
108 struct sk_buff *skb;
109 dma_addr_t dma_addr;
112 struct s_rxd_os { // os-specific part of receive descriptor
113 struct sk_buff *skb;
114 dma_addr_t dma_addr;
119 * So we do not need to make too many modifications to the generic driver
120 * parts, we take advantage of the AIX byte swapping macro interface.
123 #define AIX_REVERSE(x) ((u32)le32_to_cpu((u32)(x)))
124 #define MDR_REVERSE(x) ((u32)le32_to_cpu((u32)(x)))