| 1 |
/* |
| 2 |
* linux/drivers/message/fusion/mptlan.h |
| 3 |
* IP Over Fibre Channel device driver. |
| 4 |
* For use with LSI Fibre Channel PCI chip/adapters |
| 5 |
* running LSI Fusion MPT (Message Passing Technology) firmware. |
| 6 |
* |
| 7 |
* Copyright (c) 2000-2008 LSI Corporation |
| 8 |
* (mailto:[email protected]) |
| 9 |
* |
| 10 |
*/ |
| 11 |
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 12 |
/* |
| 13 |
This program is free software; you can redistribute it and/or modify |
| 14 |
it under the terms of the GNU General Public License as published by |
| 15 |
the Free Software Foundation; version 2 of the License. |
| 16 |
|
| 17 |
This program is distributed in the hope that it will be useful, |
| 18 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
GNU General Public License for more details. |
| 21 |
|
| 22 |
NO WARRANTY |
| 23 |
THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR |
| 24 |
CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT |
| 25 |
LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, |
| 26 |
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is |
| 27 |
solely responsible for determining the appropriateness of using and |
| 28 |
distributing the Program and assumes all risks associated with its |
| 29 |
exercise of rights under this Agreement, including but not limited to |
| 30 |
the risks and costs of program errors, damage to or loss of data, |
| 31 |
programs or equipment, and unavailability or interruption of operations. |
| 32 |
|
| 33 |
DISCLAIMER OF LIABILITY |
| 34 |
NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY |
| 35 |
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 |
DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND |
| 37 |
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 38 |
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
| 39 |
USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED |
| 40 |
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES |
| 41 |
|
| 42 |
You should have received a copy of the GNU General Public License |
| 43 |
along with this program; if not, write to the Free Software |
| 44 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 45 |
*/ |
| 46 |
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 47 |
|
| 48 |
/* mptlan.h */ |
| 49 |
|
| 50 |
#ifndef LINUX_MPTLAN_H_INCLUDED |
| 51 |
#define LINUX_MPTLAN_H_INCLUDED |
| 52 |
/*****************************************************************************/ |
| 53 |
|
| 54 |
#include <linux/module.h> |
| 55 |
#include <linux/netdevice.h> |
| 56 |
#include <linux/errno.h> |
| 57 |
// #include <linux/etherdevice.h> |
| 58 |
#include <linux/fcdevice.h> |
| 59 |
// #include <linux/fddidevice.h> |
| 60 |
#include <linux/skbuff.h> |
| 61 |
#include <linux/if_arp.h> |
| 62 |
#include <linux/init.h> |
| 63 |
#include <linux/kernel.h> |
| 64 |
#include <linux/printk.h> |
| 65 |
#include <linux/slab.h> |
| 66 |
#include <linux/spinlock.h> |
| 67 |
#include <linux/workqueue.h> |
| 68 |
#include <linux/delay.h> |
| 69 |
|
| 70 |
#include <linux/uaccess.h> |
| 71 |
#include <asm/io.h> |
| 72 |
|
| 73 |
/* Override mptbase.h by pre-defining these! */ |
| 74 |
#define MODULEAUTHOR "LSI Corporation" |
| 75 |
|
| 76 |
#include "mptbase.h" |
| 77 |
|
| 78 |
/*****************************************************************************/ |
| 79 |
#define LANAME "Fusion MPT LAN driver" |
| 80 |
#define LANVER MPT_LINUX_VERSION_COMMON |
| 81 |
|
| 82 |
#ifdef MODULE |
| 83 |
MODULE_AUTHOR(MODULEAUTHOR); |
| 84 |
MODULE_DESCRIPTION(LANAME); |
| 85 |
#endif |
| 86 |
/*****************************************************************************/ |
| 87 |
|
| 88 |
#define MPT_LAN_MAX_BUCKETS_OUT 256 |
| 89 |
#define MPT_LAN_BUCKET_THRESH 18 /* 9 buckets in one message */ |
| 90 |
#define MPT_LAN_BUCKETS_REMAIN_MISMATCH_THRESH 10 |
| 91 |
#define MPT_LAN_RX_COPYBREAK 200 |
| 92 |
#define MPT_LAN_TX_TIMEOUT (1*HZ) |
| 93 |
#define MPT_TX_MAX_OUT_LIM 127 |
| 94 |
|
| 95 |
#define MPT_LAN_MIN_MTU 96 /* RFC2625 */ |
| 96 |
#define MPT_LAN_MAX_MTU 65280 /* RFC2625 */ |
| 97 |
#define MPT_LAN_MTU 13312 /* Max perf range + lower mem |
| 98 |
usage than 16128 */ |
| 99 |
|
| 100 |
#define MPT_LAN_NAA_RFC2625 0x1 |
| 101 |
#define MPT_LAN_NAA_QLOGIC 0x2 |
| 102 |
|
| 103 |
/* MPT LAN Reset and Suspend Resource Flags Defines */ |
| 104 |
|
| 105 |
#define MPT_LAN_RESOURCE_FLAG_RETURN_POSTED_BUCKETS 0x01 |
| 106 |
#define MPT_LAN_RESOURCE_FLAG_RETURN_PEND_TRANSMITS 0x02 |
| 107 |
|
| 108 |
/*****************************************************************************/ |
| 109 |
#ifdef MPT_LAN_IO_DEBUG |
| 110 |
#define dioprintk(x) printk x |
| 111 |
#else |
| 112 |
#define dioprintk(x) no_printk x |
| 113 |
#endif |
| 114 |
|
| 115 |
#ifdef MPT_LAN_DEBUG |
| 116 |
#define dlprintk(x) printk x |
| 117 |
#else |
| 118 |
#define dlprintk(x) no_printk x |
| 119 |
#endif |
| 120 |
|
| 121 |
#define NETDEV_TO_LANPRIV_PTR(d) ((struct mpt_lan_priv *)netdev_priv(d)) |
| 122 |
#define NETDEV_PTR_TO_IOC_NAME_s(d) (NETDEV_TO_LANPRIV_PTR(d)->mpt_dev->name) |
| 123 |
#define IOC_AND_NETDEV_NAMES_s_s(d) NETDEV_PTR_TO_IOC_NAME_s(d), (d)->name |
| 124 |
|
| 125 |
/*****************************************************************************/ |
| 126 |
#endif |
| 127 |
|