Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /******************************************************************************
0003  *
0004  *  (C)Copyright 1998,1999 SysKonnect,
0005  *  a business unit of Schneider & Koch & Co. Datensysteme GmbH.
0006  *
0007  *  The information in this file is provided "AS IS" without warranty.
0008  *
0009  ******************************************************************************/
0010 
0011 /* 
0012  * Operating system-dependent definitions that have to be defined
0013  * before any other header files are included.
0014  */
0015 
0016 // HWM (HardWare Module) Definitions
0017 // -----------------------
0018 
0019 #include <asm/byteorder.h>
0020 
0021 #ifdef __LITTLE_ENDIAN
0022 #define LITTLE_ENDIAN
0023 #else
0024 #define BIG_ENDIAN
0025 #endif
0026 
0027 // this is set in the makefile
0028 // #define PCI          /* only PCI adapters supported by this driver */
0029 // #define MEM_MAPPED_IO    /* use memory mapped I/O */
0030 
0031 
0032 #define USE_CAN_ADDR        /* DA and SA in MAC header are canonical. */
0033 
0034 #define MB_OUTSIDE_SMC      /* SMT Mbufs outside of smc struct. */
0035 
0036 // -----------------------
0037 
0038 
0039 // SMT Definitions 
0040 // -----------------------
0041 #define SYNC                /* allow synchronous frames */
0042 
0043 // #define SBA          /* Synchronous Bandwidth Allocator support */
0044                 /* not available as free source */
0045 
0046 #define ESS         /* SBA End Station Support */
0047 
0048 #define SMT_PANIC(smc, nr, msg) printk(KERN_INFO "SMT PANIC: code: %d, msg: %s\n",nr,msg)
0049 
0050 
0051 #ifdef DEBUG
0052 #define printf(s,args...) printk(KERN_INFO s, ## args)
0053 #endif
0054 
0055 // #define HW_PTR   u_long
0056 // -----------------------
0057 
0058 
0059 
0060 // HWM and OS-specific buffer definitions
0061 // -----------------------
0062 
0063 // default number of receive buffers.
0064 #define NUM_RECEIVE_BUFFERS     10
0065 
0066 // default number of transmit buffers.
0067 #define NUM_TRANSMIT_BUFFERS        10
0068 
0069 // Number of SMT buffers (Mbufs).
0070 #define NUM_SMT_BUF 4
0071 
0072 // Number of TXDs for asynchronous transmit queue.
0073 #define HWM_ASYNC_TXD_COUNT (NUM_TRANSMIT_BUFFERS + NUM_SMT_BUF)
0074 
0075 // Number of TXDs for synchronous transmit queue.
0076 #define HWM_SYNC_TXD_COUNT  HWM_ASYNC_TXD_COUNT
0077 
0078 
0079 // Number of RXDs for receive queue #1.
0080 // Note: Workaround for ASIC Errata #7: One extra RXD is required.
0081 #if (NUM_RECEIVE_BUFFERS > 100)
0082 #define SMT_R1_RXD_COUNT    (1 + 100)
0083 #else
0084 #define SMT_R1_RXD_COUNT    (1 + NUM_RECEIVE_BUFFERS)
0085 #endif
0086 
0087 // Number of RXDs for receive queue #2.
0088 #define SMT_R2_RXD_COUNT    0   // Not used.
0089 // -----------------------
0090 
0091 
0092 
0093 /*
0094  * OS-specific part of the transmit/receive descriptor structure (TXD/RXD).
0095  *
0096  * Note: The size of these structures must follow this rule:
0097  *
0098  *  sizeof(struct) + 2*sizeof(void*) == n * 16, n >= 1
0099  *
0100  * We use the dma_addr fields under Linux to keep track of the
0101  * DMA address of the packet data, for later pci_unmap_single. -DaveM
0102  */
0103 
0104 struct s_txd_os {   // os-specific part of transmit descriptor
0105     struct sk_buff *skb;
0106     dma_addr_t dma_addr;
0107 } ;
0108 
0109 struct s_rxd_os {   // os-specific part of receive descriptor
0110     struct sk_buff *skb;
0111     dma_addr_t dma_addr;
0112 } ;
0113 
0114 
0115 /*
0116  * So we do not need to make too many modifications to the generic driver
0117  * parts, we take advantage of the AIX byte swapping macro interface.
0118  */
0119 
0120 #define AIX_REVERSE(x)      ((u32)le32_to_cpu((u32)(x)))
0121 #define MDR_REVERSE(x)      ((u32)le32_to_cpu((u32)(x)))