mptlan.h 4.6 KB

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