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-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
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 // -----------------------
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)
52 #define printf(s,args...) printk(KERN_INFO s, ## args)
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).
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)
84 #define SMT_R1_RXD_COUNT (1 + NUM_RECEIVE_BUFFERS)
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
109 struct s_rxd_os
{ // os-specific part of receive descriptor
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)))