bfad_bsg.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef BFAD_BSG_H
  18. #define BFAD_BSG_H
  19. #include "bfa_defs.h"
  20. #include "bfa_defs_fcs.h"
  21. /* Definitions of vendor unique structures and command codes passed in
  22. * using FC_BSG_HST_VENDOR message code.
  23. */
  24. enum {
  25. IOCMD_IOC_GET_ATTR = 0x1,
  26. IOCMD_IOC_GET_INFO,
  27. IOCMD_PORT_GET_ATTR,
  28. IOCMD_LPORT_GET_ATTR,
  29. IOCMD_RPORT_GET_ADDR,
  30. IOCMD_FABRIC_GET_LPORTS,
  31. IOCMD_ITNIM_GET_ATTR,
  32. };
  33. struct bfa_bsg_ioc_info_s {
  34. bfa_status_t status;
  35. u16 bfad_num;
  36. u16 rsvd;
  37. char serialnum[64];
  38. char hwpath[BFA_STRING_32];
  39. char adapter_hwpath[BFA_STRING_32];
  40. char guid[BFA_ADAPTER_SYM_NAME_LEN*2];
  41. char name[BFA_ADAPTER_SYM_NAME_LEN];
  42. char port_name[BFA_ADAPTER_SYM_NAME_LEN];
  43. char eth_name[BFA_ADAPTER_SYM_NAME_LEN];
  44. wwn_t pwwn;
  45. wwn_t nwwn;
  46. wwn_t factorypwwn;
  47. wwn_t factorynwwn;
  48. mac_t mac;
  49. mac_t factory_mac; /* Factory mac address */
  50. mac_t current_mac; /* Currently assigned mac address */
  51. enum bfa_ioc_type_e ioc_type;
  52. u16 pvid; /* Port vlan id */
  53. u16 rsvd1;
  54. u32 host;
  55. u32 bandwidth; /* For PF support */
  56. u32 rsvd2;
  57. };
  58. struct bfa_bsg_ioc_attr_s {
  59. bfa_status_t status;
  60. u16 bfad_num;
  61. u16 rsvd;
  62. struct bfa_ioc_attr_s ioc_attr;
  63. };
  64. struct bfa_bsg_port_attr_s {
  65. bfa_status_t status;
  66. u16 bfad_num;
  67. u16 rsvd;
  68. struct bfa_port_attr_s attr;
  69. };
  70. struct bfa_bsg_lport_attr_s {
  71. bfa_status_t status;
  72. u16 bfad_num;
  73. u16 vf_id;
  74. wwn_t pwwn;
  75. struct bfa_lport_attr_s port_attr;
  76. };
  77. struct bfa_bsg_rport_scsi_addr_s {
  78. bfa_status_t status;
  79. u16 bfad_num;
  80. u16 vf_id;
  81. wwn_t pwwn;
  82. wwn_t rpwwn;
  83. u32 host;
  84. u32 bus;
  85. u32 target;
  86. u32 lun;
  87. };
  88. struct bfa_bsg_fabric_get_lports_s {
  89. bfa_status_t status;
  90. u16 bfad_num;
  91. u16 vf_id;
  92. u64 buf_ptr;
  93. u32 nports;
  94. u32 rsvd;
  95. };
  96. struct bfa_bsg_itnim_attr_s {
  97. bfa_status_t status;
  98. u16 bfad_num;
  99. u16 vf_id;
  100. wwn_t lpwwn;
  101. wwn_t rpwwn;
  102. struct bfa_itnim_attr_s attr;
  103. };
  104. struct bfa_bsg_fcpt_s {
  105. bfa_status_t status;
  106. u16 vf_id;
  107. wwn_t lpwwn;
  108. wwn_t dpwwn;
  109. u32 tsecs;
  110. int cts;
  111. enum fc_cos cos;
  112. struct fchs_s fchs;
  113. };
  114. #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s
  115. struct bfa_bsg_data {
  116. int payload_len;
  117. void *payload;
  118. };
  119. #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \
  120. (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \
  121. BFA_STATUS_FAILED : BFA_STATUS_OK)
  122. #endif /* BFAD_BSG_H */