0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef TARGETOS_H
0017 #define TARGETOS_H
0018
0019
0020
0021 #define PCI_VENDOR_ID_SK 0x1148
0022 #define PCI_DEVICE_ID_SK_FP 0x4000
0023
0024
0025
0026
0027
0028 #define FDDI_MAC_HDR_LEN 13
0029
0030 #define FDDI_RII 0x01
0031 #define FDDI_RCF_DIR_BIT 0x80
0032 #define FDDI_RCF_LEN_MASK 0x1f
0033 #define FDDI_RCF_BROADCAST 0x8000
0034 #define FDDI_RCF_LIMITED_BROADCAST 0xA000
0035 #define FDDI_RCF_FRAME2K 0x20
0036 #define FDDI_RCF_FRAME4K 0x30
0037
0038
0039
0040 #undef ADDR
0041
0042 #include <asm/io.h>
0043 #include <linux/netdevice.h>
0044 #include <linux/fddidevice.h>
0045 #include <linux/skbuff.h>
0046 #include <linux/pci.h>
0047
0048
0049 #undef ADDR
0050 #ifdef MEM_MAPPED_IO
0051 #define ADDR(a) (smc->hw.iop+(a))
0052 #else
0053 #define ADDR(a) (((a)>>7) ? (outp(smc->hw.iop+B0_RAP,(a)>>7), (smc->hw.iop+( ((a)&0x7F) | ((a)>>7 ? 0x80:0)) )) : (smc->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0))))
0054 #endif
0055
0056 #include "hwmtm.h"
0057
0058 #define TRUE 1
0059 #define FALSE 0
0060
0061
0062
0063 #define FDDI_TRACE(string, arg1, arg2, arg3)
0064 #ifdef PCI
0065 #define NDD_TRACE(string, arg1, arg2, arg3)
0066 #endif
0067 #define SMT_PAGESIZE PAGE_SIZE
0068
0069
0070
0071
0072
0073 #define TICKS_PER_SECOND HZ
0074 #define SMC_VERSION 1
0075
0076
0077
0078
0079
0080 #define NO_ADDRESS 0xffe0
0081 #define SKFP_MAX_NUM_BOARDS 8
0082
0083 #define SK_BUS_TYPE_PCI 0
0084 #define SK_BUS_TYPE_EISA 1
0085
0086 #define FP_IO_LEN 256
0087
0088 #define u8 unsigned char
0089 #define u16 unsigned short
0090 #define u32 unsigned int
0091
0092 #define MAX_TX_QUEUE_LEN 20
0093 #define MAX_FRAME_SIZE 4550
0094
0095 #define RX_LOW_WATERMARK NUM_RECEIVE_BUFFERS / 2
0096 #define TX_LOW_WATERMARK NUM_TRANSMIT_BUFFERS - 2
0097
0098
0099
0100
0101 #include <linux/sockios.h>
0102
0103 #define SKFPIOCTL SIOCDEVPRIVATE
0104
0105 struct s_skfp_ioctl {
0106 unsigned short cmd;
0107 unsigned short len;
0108 unsigned char __user *data;
0109 };
0110
0111
0112
0113
0114 #define SKFP_GET_STATS 0x05
0115 #define SKFP_CLR_STATS 0x06
0116
0117
0118 struct s_smt_os {
0119 struct net_device *dev;
0120 struct net_device *next_module;
0121 u32 bus_type;
0122 struct pci_dev pdev;
0123
0124 unsigned long base_addr;
0125 unsigned char factory_mac_addr[8];
0126 ulong SharedMemSize;
0127 ulong SharedMemHeap;
0128 void* SharedMemAddr;
0129 dma_addr_t SharedMemDMA;
0130
0131 ulong QueueSkb;
0132 struct sk_buff_head SendSkbQueue;
0133
0134 ulong MaxFrameSize;
0135 u8 ResetRequested;
0136
0137
0138 struct fddi_statistics MacStat;
0139
0140
0141
0142
0143
0144 unsigned char *LocalRxBuffer;
0145 dma_addr_t LocalRxBufferDMA;
0146
0147
0148 u_long smc_version ;
0149
0150
0151 struct hw_modul hwm ;
0152
0153
0154 spinlock_t DriverLock;
0155
0156 };
0157
0158 typedef struct s_smt_os skfddi_priv;
0159
0160 #endif