treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / fddi / skfp / h / osdef1st.h
blob2e318fc591bf81163024bf10eb7f7689b5dc07cf
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 ******************************************************************************/
11 /*
12 * Operating system-dependent definitions that have to be defined
13 * before any other header files are included.
16 // HWM (HardWare Module) Definitions
17 // -----------------------
19 #include <asm/byteorder.h>
21 #ifdef __LITTLE_ENDIAN
22 #define LITTLE_ENDIAN
23 #else
24 #define BIG_ENDIAN
25 #endif
27 // this is set in the makefile
28 // #define PCI /* only PCI adapters supported by this driver */
29 // #define MEM_MAPPED_IO /* use memory mapped I/O */
32 #define USE_CAN_ADDR /* DA and SA in MAC header are canonical. */
34 #define MB_OUTSIDE_SMC /* SMT Mbufs outside of smc struct. */
36 // -----------------------
39 // SMT Definitions
40 // -----------------------
41 #define SYNC /* allow synchronous frames */
43 // #define SBA /* Synchronous Bandwidth Allocator support */
44 /* not available as free source */
46 #define ESS /* SBA End Station Support */
48 #define SMT_PANIC(smc, nr, msg) printk(KERN_INFO "SMT PANIC: code: %d, msg: %s\n",nr,msg)
51 #ifdef DEBUG
52 #define printf(s,args...) printk(KERN_INFO s, ## args)
53 #endif
55 // #define HW_PTR u_long
56 // -----------------------
60 // HWM and OS-specific buffer definitions
61 // -----------------------
63 // default number of receive buffers.
64 #define NUM_RECEIVE_BUFFERS 10
66 // default number of transmit buffers.
67 #define NUM_TRANSMIT_BUFFERS 10
69 // Number of SMT buffers (Mbufs).
70 #define NUM_SMT_BUF 4
72 // Number of TXDs for asynchronous transmit queue.
73 #define HWM_ASYNC_TXD_COUNT (NUM_TRANSMIT_BUFFERS + NUM_SMT_BUF)
75 // Number of TXDs for synchronous transmit queue.
76 #define HWM_SYNC_TXD_COUNT HWM_ASYNC_TXD_COUNT
79 // Number of RXDs for receive queue #1.
80 // Note: Workaround for ASIC Errata #7: One extra RXD is required.
81 #if (NUM_RECEIVE_BUFFERS > 100)
82 #define SMT_R1_RXD_COUNT (1 + 100)
83 #else
84 #define SMT_R1_RXD_COUNT (1 + NUM_RECEIVE_BUFFERS)
85 #endif
87 // Number of RXDs for receive queue #2.
88 #define SMT_R2_RXD_COUNT 0 // Not used.
89 // -----------------------
94 * OS-specific part of the transmit/receive descriptor structure (TXD/RXD).
96 * Note: The size of these structures must follow this rule:
98 * sizeof(struct) + 2*sizeof(void*) == n * 16, n >= 1
100 * We use the dma_addr fields under Linux to keep track of the
101 * DMA address of the packet data, for later pci_unmap_single. -DaveM
104 struct s_txd_os { // os-specific part of transmit descriptor
105 struct sk_buff *skb;
106 dma_addr_t dma_addr;
109 struct s_rxd_os { // os-specific part of receive descriptor
110 struct sk_buff *skb;
111 dma_addr_t dma_addr;
116 * So we do not need to make too many modifications to the generic driver
117 * parts, we take advantage of the AIX byte swapping macro interface.
120 #define AIX_REVERSE(x) ((u32)le32_to_cpu((u32)(x)))
121 #define MDR_REVERSE(x) ((u32)le32_to_cpu((u32)(x)))