Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame^] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * (C)Copyright 1998,1999 SysKonnect, |
| 4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * The information in this file is provided "AS IS" without warranty. |
| 12 | * |
| 13 | ******************************************************************************/ |
| 14 | |
| 15 | /* |
| 16 | * Operating system-dependent definitions that have to be defined |
| 17 | * before any other header files are included. |
| 18 | */ |
| 19 | |
| 20 | // HWM (HardWare Module) Definitions |
| 21 | // ----------------------- |
| 22 | |
| 23 | #ifdef __LITTLE_ENDIAN |
| 24 | #define LITTLE_ENDIAN |
| 25 | #else |
| 26 | #define BIG_ENDIAN |
| 27 | #endif |
| 28 | |
| 29 | // this is set in the makefile |
| 30 | // #define PCI /* only PCI adapters supported by this driver */ |
| 31 | // #define MEM_MAPPED_IO /* use memory mapped I/O */ |
| 32 | |
| 33 | |
| 34 | #define USE_CAN_ADDR /* DA and SA in MAC header are canonical. */ |
| 35 | |
| 36 | #define MB_OUTSIDE_SMC /* SMT Mbufs outside of smc struct. */ |
| 37 | |
| 38 | // ----------------------- |
| 39 | |
| 40 | |
| 41 | // SMT Definitions |
| 42 | // ----------------------- |
| 43 | #define SYNC /* allow synchronous frames */ |
| 44 | |
| 45 | // #define SBA /* Synchronous Bandwidth Allocator support */ |
| 46 | /* not available as free source */ |
| 47 | |
| 48 | #define ESS /* SBA End Station Support */ |
| 49 | |
| 50 | #define SMT_PANIC(smc, nr, msg) printk(KERN_INFO "SMT PANIC: code: %d, msg: %s\n",nr,msg) |
| 51 | |
| 52 | |
| 53 | #ifdef DEBUG |
| 54 | #define printf(s,args...) printk(KERN_INFO s, ## args) |
| 55 | #endif |
| 56 | |
| 57 | // #define HW_PTR u_long |
| 58 | // ----------------------- |
| 59 | |
| 60 | |
| 61 | |
| 62 | // HWM and OS-specific buffer definitions |
| 63 | // ----------------------- |
| 64 | |
| 65 | // default number of receive buffers. |
| 66 | #define NUM_RECEIVE_BUFFERS 10 |
| 67 | |
| 68 | // default number of transmit buffers. |
| 69 | #define NUM_TRANSMIT_BUFFERS 10 |
| 70 | |
| 71 | // Number of SMT buffers (Mbufs). |
| 72 | #define NUM_SMT_BUF 4 |
| 73 | |
| 74 | // Number of TXDs for asynchronous transmit queue. |
| 75 | #define HWM_ASYNC_TXD_COUNT (NUM_TRANSMIT_BUFFERS + NUM_SMT_BUF) |
| 76 | |
| 77 | // Number of TXDs for synchronous transmit queue. |
| 78 | #define HWM_SYNC_TXD_COUNT HWM_ASYNC_TXD_COUNT |
| 79 | |
| 80 | |
| 81 | // Number of RXDs for receive queue #1. |
| 82 | // Note: Workaround for ASIC Errata #7: One extra RXD is required. |
| 83 | #if (NUM_RECEIVE_BUFFERS > 100) |
| 84 | #define SMT_R1_RXD_COUNT (1 + 100) |
| 85 | #else |
| 86 | #define SMT_R1_RXD_COUNT (1 + NUM_RECEIVE_BUFFERS) |
| 87 | #endif |
| 88 | |
| 89 | // Number of RXDs for receive queue #2. |
| 90 | #define SMT_R2_RXD_COUNT 0 // Not used. |
| 91 | // ----------------------- |
| 92 | |
| 93 | |
| 94 | |
| 95 | /* |
| 96 | * OS-specific part of the transmit/receive descriptor structure (TXD/RXD). |
| 97 | * |
| 98 | * Note: The size of these structures must follow this rule: |
| 99 | * |
| 100 | * sizeof(struct) + 2*sizeof(void*) == n * 16, n >= 1 |
| 101 | * |
| 102 | * We use the dma_addr fields under Linux to keep track of the |
| 103 | * DMA address of the packet data, for later pci_unmap_single. -DaveM |
| 104 | */ |
| 105 | |
| 106 | struct s_txd_os { // os-specific part of transmit descriptor |
| 107 | struct sk_buff *skb; |
| 108 | dma_addr_t dma_addr; |
| 109 | } ; |
| 110 | |
| 111 | struct s_rxd_os { // os-specific part of receive descriptor |
| 112 | struct sk_buff *skb; |
| 113 | dma_addr_t dma_addr; |
| 114 | } ; |
| 115 | |
| 116 | |
| 117 | /* |
| 118 | * So we do not need to make too many modifications to the generic driver |
| 119 | * parts, we take advantage of the AIX byte swapping macro interface. |
| 120 | */ |
| 121 | |
| 122 | #define AIX_REVERSE(x) ((u32)le32_to_cpu((u32)(x))) |
| 123 | #define MDR_REVERSE(x) ((u32)le32_to_cpu((u32)(x))) |