mptlan.h 4.6 KB

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