treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / fddi / skfp / h / targetos.h
blob2474e12ac5239146191c6f96634228241b6330ea
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /******************************************************************************
4 * (C)Copyright 1998,1999 SysKonnect,
5 * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
7 * The information in this file is provided "AS IS" without warranty.
9 ******************************************************************************/
12 * Operating system specific definitions for driver and
13 * hardware module.
16 #ifndef TARGETOS_H
17 #define TARGETOS_H
20 //-------- those should go into include/linux/pci.h
21 #define PCI_VENDOR_ID_SK 0x1148
22 #define PCI_DEVICE_ID_SK_FP 0x4000
23 //--------
27 //-------- those should go into include/linux/if_fddi.h
28 #define FDDI_MAC_HDR_LEN 13
30 #define FDDI_RII 0x01 /* routing information bit */
31 #define FDDI_RCF_DIR_BIT 0x80
32 #define FDDI_RCF_LEN_MASK 0x1f
33 #define FDDI_RCF_BROADCAST 0x8000
34 #define FDDI_RCF_LIMITED_BROADCAST 0xA000
35 #define FDDI_RCF_FRAME2K 0x20
36 #define FDDI_RCF_FRAME4K 0x30
37 //--------
40 #undef ADDR
42 #include <asm/io.h>
43 #include <linux/netdevice.h>
44 #include <linux/fddidevice.h>
45 #include <linux/skbuff.h>
46 #include <linux/pci.h>
48 // is redefined by linux, but we need our definition
49 #undef ADDR
50 #ifdef MEM_MAPPED_IO
51 #define ADDR(a) (smc->hw.iop+(a))
52 #else
53 #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))))
54 #endif
56 #include "hwmtm.h"
58 #define TRUE 1
59 #define FALSE 0
61 // HWM Definitions
62 // -----------------------
63 #define FDDI_TRACE(string, arg1, arg2, arg3) // Performance analysis.
64 #ifdef PCI
65 #define NDD_TRACE(string, arg1, arg2, arg3) // Performance analysis.
66 #endif // PCI
67 #define SMT_PAGESIZE PAGE_SIZE // Size of a memory page (power of 2).
68 // -----------------------
71 // SMT Definitions
72 // -----------------------
73 #define TICKS_PER_SECOND HZ
74 #define SMC_VERSION 1
75 // -----------------------
78 // OS-Driver Definitions
79 // -----------------------
80 #define NO_ADDRESS 0xffe0 /* No Device (I/O) Address */
81 #define SKFP_MAX_NUM_BOARDS 8 /* maximum number of PCI boards */
83 #define SK_BUS_TYPE_PCI 0
84 #define SK_BUS_TYPE_EISA 1
86 #define FP_IO_LEN 256 /* length of IO area used */
88 #define u8 unsigned char
89 #define u16 unsigned short
90 #define u32 unsigned int
92 #define MAX_TX_QUEUE_LEN 20 // number of packets queued by driver
93 #define MAX_FRAME_SIZE 4550
95 #define RX_LOW_WATERMARK NUM_RECEIVE_BUFFERS / 2
96 #define TX_LOW_WATERMARK NUM_TRANSMIT_BUFFERS - 2
99 ** Include the IOCTL stuff
101 #include <linux/sockios.h>
103 #define SKFPIOCTL SIOCDEVPRIVATE
105 struct s_skfp_ioctl {
106 unsigned short cmd; /* Command to run */
107 unsigned short len; /* Length of the data buffer */
108 unsigned char __user *data; /* Pointer to the data buffer */
112 ** Recognised ioctl commands for the driver
114 #define SKFP_GET_STATS 0x05 /* Get the driver statistics */
115 #define SKFP_CLR_STATS 0x06 /* Zero out the driver statistics */
117 // The per-adapter driver structure
118 struct s_smt_os {
119 struct net_device *dev;
120 struct net_device *next_module;
121 u32 bus_type; /* bus type (0 == PCI, 1 == EISA) */
122 struct pci_dev pdev; /* PCI device structure */
124 unsigned long base_addr;
125 unsigned char factory_mac_addr[8];
126 ulong SharedMemSize;
127 ulong SharedMemHeap;
128 void* SharedMemAddr;
129 dma_addr_t SharedMemDMA;
131 ulong QueueSkb;
132 struct sk_buff_head SendSkbQueue;
134 ulong MaxFrameSize;
135 u8 ResetRequested;
137 // MAC statistics structure
138 struct fddi_statistics MacStat;
140 // receive into this local buffer if no skb available
141 // data will be not valid, because multiple RxDs can
142 // point here at the same time, it must be at least
143 // MAX_FRAME_SIZE bytes in size
144 unsigned char *LocalRxBuffer;
145 dma_addr_t LocalRxBufferDMA;
147 // Version (required by SMT module).
148 u_long smc_version ;
150 // Required by Hardware Module (HWM).
151 struct hw_modul hwm ;
153 // For SMP-savety
154 spinlock_t DriverLock;
158 typedef struct s_smt_os skfddi_priv;
160 #endif // _TARGETOS_