Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
be_cmds.h
Go to the documentation of this file.
1 
18 #ifndef BEISCSI_CMDS_H
19 #define BEISCSI_CMDS_H
20 
28 struct be_sge {
29  u32 pa_lo;
30  u32 pa_hi;
31  u32 len;
32 };
33 
34 #define MCC_WRB_SGE_CNT_SHIFT 3 /* bits 3 - 7 of dword 0 */
35 #define MCC_WRB_SGE_CNT_MASK 0x1F /* bits 3 - 7 of dword 0 */
36 struct be_mcc_wrb {
37  u32 embedded; /* dword 0 */
38  u32 payload_length; /* dword 1 */
39  u32 tag0; /* dword 2 */
40  u32 tag1; /* dword 3 */
41  u32 rsvd; /* dword 4 */
42  union {
43  u8 embedded_payload[236]; /* used by embedded cmds */
44  struct be_sge sgl[19]; /* used by non-embedded cmds */
45  } payload;
46 };
47 
48 #define CQE_FLAGS_VALID_MASK (1 << 31)
49 #define CQE_FLAGS_ASYNC_MASK (1 << 30)
50 #define CQE_FLAGS_COMPLETED_MASK (1 << 28)
51 #define CQE_FLAGS_CONSUMED_MASK (1 << 27)
52 
53 /* Completion Status */
54 #define MCC_STATUS_SUCCESS 0x0
55 
56 #define CQE_STATUS_COMPL_MASK 0xFFFF
57 #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
58 #define CQE_STATUS_EXTD_MASK 0xFFFF
59 #define CQE_STATUS_EXTD_SHIFT 16 /* bits 0 - 15 */
60 
61 struct be_mcc_compl {
62  u32 status; /* dword 0 */
63  u32 tag0; /* dword 1 */
64  u32 tag1; /* dword 2 */
65  u32 flags; /* dword 3 */
66 };
67 
68 /********* Mailbox door bell *************/
79 #define MPU_MAILBOX_DB_OFFSET 0x160
80 #define MPU_MAILBOX_DB_RDY_MASK 0x1 /* bit 0 */
81 #define MPU_MAILBOX_DB_HI_MASK 0x2 /* bit 1 */
82 
83 /********** MPU semphore ******************/
84 #define MPU_EP_SEMAPHORE_OFFSET 0xac
85 #define EP_SEMAPHORE_POST_STAGE_MASK 0x0000FFFF
86 #define EP_SEMAPHORE_POST_ERR_MASK 0x1
87 #define EP_SEMAPHORE_POST_ERR_SHIFT 31
88 
89 /********** MCC door bell ************/
90 #define DB_MCCQ_OFFSET 0x140
91 #define DB_MCCQ_RING_ID_MASK 0x7FF /* bits 0 - 10 */
92 /* Number of entries posted */
93 #define DB_MCCQ_NUM_POSTED_SHIFT 16 /* bits 16 - 29 */
94 
95 /* MPU semphore POST stage values */
96 #define POST_STAGE_ARMFW_RDY 0xc000 /* FW is done with POST */
97 
102 #define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
103 #define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
104 #define ASYNC_EVENT_CODE_LINK_STATE 0x1
105 struct be_async_event_trailer {
106  u32 code;
107 };
108 
109 enum {
112 };
113 
121  u8 port_duplex;
122  u8 port_speed;
123  u8 port_fault;
124  u8 rsvd0[7];
125  struct be_async_event_trailer trailer;
126 } __packed;
127 
128 struct be_mcc_mailbox {
129  struct be_mcc_wrb wrb;
130  struct be_mcc_compl compl;
131 };
132 
133 /* Type of subsystems supported by FW */
134 #define CMD_SUBSYSTEM_COMMON 0x1
135 #define CMD_SUBSYSTEM_ISCSI 0x2
136 #define CMD_SUBSYSTEM_ETH 0x3
137 #define CMD_SUBSYSTEM_ISCSI_INI 0x6
138 #define CMD_COMMON_TCP_UPLOAD 0x1
139 
144 #define OPCODE_COMMON_CQ_CREATE 12
145 #define OPCODE_COMMON_EQ_CREATE 13
146 #define OPCODE_COMMON_MCC_CREATE 21
147 #define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32
148 #define OPCODE_COMMON_GET_FW_VERSION 35
149 #define OPCODE_COMMON_MODIFY_EQ_DELAY 41
150 #define OPCODE_COMMON_FIRMWARE_CONFIG 42
151 #define OPCODE_COMMON_MCC_DESTROY 53
152 #define OPCODE_COMMON_CQ_DESTROY 54
153 #define OPCODE_COMMON_EQ_DESTROY 55
154 #define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
155 #define OPCODE_COMMON_FUNCTION_RESET 61
156 
162 #define OPCODE_COMMON_ISCSI_CFG_POST_SGL_PAGES 2
163 #define OPCODE_COMMON_ISCSI_CFG_REMOVE_SGL_PAGES 3
164 #define OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG 7
165 #define OPCODE_COMMON_ISCSI_NTWK_SET_VLAN 14
166 #define OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR 17
167 #define OPCODE_COMMON_ISCSI_NTWK_REL_STATELESS_IP_ADDR 18
168 #define OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR 21
169 #define OPCODE_COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY 22
170 #define OPCODE_COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY 23
171 #define OPCODE_COMMON_ISCSI_NTWK_GET_ALL_IF_ID 24
172 #define OPCODE_COMMON_ISCSI_NTWK_GET_IF_INFO 25
173 #define OPCODE_COMMON_ISCSI_SET_FRAGNUM_BITS_FOR_SGL_CRA 61
174 #define OPCODE_COMMON_ISCSI_DEFQ_CREATE 64
175 #define OPCODE_COMMON_ISCSI_DEFQ_DESTROY 65
176 #define OPCODE_COMMON_ISCSI_WRBQ_CREATE 66
177 #define OPCODE_COMMON_ISCSI_WRBQ_DESTROY 67
178 
179 struct be_cmd_req_hdr {
180  u8 opcode; /* dword 0 */
181  u8 subsystem; /* dword 0 */
182  u8 port_number; /* dword 0 */
183  u8 domain; /* dword 0 */
184  u32 timeout; /* dword 1 */
185  u32 request_length; /* dword 2 */
186  u32 rsvd0; /* dword 3 */
187 };
188 
189 struct be_cmd_resp_hdr {
190  u32 info; /* dword 0 */
191  u32 status; /* dword 1 */
192  u32 response_length; /* dword 2 */
193  u32 actual_resp_len; /* dword 3 */
194 };
195 
196 struct phys_addr {
197  u32 lo;
198  u32 hi;
199 };
200 
201 /**************************
202  * BE Command definitions *
203  **************************/
204 
209 struct amap_eq_context {
210  u8 cidx[13]; /* dword 0 */
211  u8 rsvd0[3]; /* dword 0 */
212  u8 epidx[13]; /* dword 0 */
213  u8 valid; /* dword 0 */
214  u8 rsvd1; /* dword 0 */
215  u8 size; /* dword 0 */
216  u8 pidx[13]; /* dword 1 */
217  u8 rsvd2[3]; /* dword 1 */
218  u8 pd[10]; /* dword 1 */
219  u8 count[3]; /* dword 1 */
220  u8 solevent; /* dword 1 */
221  u8 stalled; /* dword 1 */
222  u8 armed; /* dword 1 */
223  u8 rsvd3[4]; /* dword 2 */
224  u8 func[8]; /* dword 2 */
225  u8 rsvd4; /* dword 2 */
226  u8 delaymult[10]; /* dword 2 */
227  u8 rsvd5[2]; /* dword 2 */
228  u8 phase[2]; /* dword 2 */
229  u8 nodelay; /* dword 2 */
230  u8 rsvd6[4]; /* dword 2 */
231  u8 rsvd7[32]; /* dword 3 */
232 } __packed;
233 
234 struct be_cmd_req_eq_create {
235  struct be_cmd_req_hdr hdr; /* dw[4] */
236  u16 num_pages; /* sword */
237  u16 rsvd0; /* sword */
238  u8 context[sizeof(struct amap_eq_context) / 8]; /* dw[4] */
239  struct phys_addr pages[8];
240 } __packed;
241 
242 struct be_cmd_resp_eq_create {
243  struct be_cmd_resp_hdr resp_hdr;
244  u16 eq_id; /* sword */
245  u16 rsvd0; /* sword */
246 } __packed;
247 
258 } __packed;
259 
264 } __packed;
265 
276 } __packed;
277 
282  u8 addr[16];
284 } __packed;
285 
298 } __packed;
299 
310 } __packed;
311 
315  u8 isid[6];
324 } __packed;
325 
329 } __packed;
330 
334 } __packed;
335 
336 struct mac_addr {
338  u8 addr[ETH_ALEN];
339 } __packed;
340 
343 } __packed;
344 
349 };
350 
353 #define BE_REOPEN_ALL_SESSIONS 0x00
354 #define BE_REOPEN_BOOT_SESSIONS 0x01
355 #define BE_REOPEN_A_SESSION 0x02
359 } __packed;
360 
365 } __packed;
366 
367 
373 } __packed;
374 
377  struct mac_addr mac;
378 };
379 
384  u8 addr[16];
387 } __packed;
388 
393 } __packed;
394 
402 } __packed;
403 
409 } __packed;
410 
414 } __packed;
415 
419 } __packed;
420 
421 
428 } __packed;
429 
434 } __packed;
435 
440 } __packed;
441 
445 } __packed;
446 
450 } __packed;
451 
452 #define BEISCSI_VLAN_DISABLE 0xFFFF
457 } __packed;
458 /******************** Create CQ ***************************/
464  u8 cidx[11]; /* dword 0 */
465  u8 rsvd0; /* dword 0 */
466  u8 coalescwm[2]; /* dword 0 */
467  u8 nodelay; /* dword 0 */
468  u8 epidx[11]; /* dword 0 */
469  u8 rsvd1; /* dword 0 */
470  u8 count[2]; /* dword 0 */
471  u8 valid; /* dword 0 */
472  u8 solevent; /* dword 0 */
473  u8 eventable; /* dword 0 */
474  u8 pidx[11]; /* dword 1 */
475  u8 rsvd2; /* dword 1 */
476  u8 pd[10]; /* dword 1 */
477  u8 eqid[8]; /* dword 1 */
478  u8 stalled; /* dword 1 */
479  u8 armed; /* dword 1 */
480  u8 rsvd3[4]; /* dword 2 */
481  u8 func[8]; /* dword 2 */
482  u8 rsvd4[20]; /* dword 2 */
483  u8 rsvd5[32]; /* dword 3 */
484 } __packed;
485 
486 struct be_cmd_req_cq_create {
487  struct be_cmd_req_hdr hdr;
488  u16 num_pages;
490  u8 context[sizeof(struct amap_cq_context) / 8];
491  struct phys_addr pages[4];
492 } __packed;
493 
494 struct be_cmd_resp_cq_create {
495  struct be_cmd_resp_hdr hdr;
496  u16 cq_id;
497  u16 rsvd0;
498 } __packed;
499 
500 /******************** Create MCCQ ***************************/
507  u8 rsvd0[2];
511  u8 cq_id[10];
513  u8 fid[8];
514  u8 pdid[9];
516  u8 rsvd1[32];
517  u8 rsvd2[32];
518 } __packed;
519 
520 struct be_cmd_req_mcc_create {
521  struct be_cmd_req_hdr hdr;
522  u16 num_pages;
524  u8 context[sizeof(struct amap_mcc_context) / 8];
525  struct phys_addr pages[8];
526 } __packed;
527 
528 struct be_cmd_resp_mcc_create {
529  struct be_cmd_resp_hdr hdr;
530  u16 id;
531  u16 rsvd0;
532 } __packed;
533 
534 /******************** Q Destroy ***************************/
535 /* Type of Queue to be destroyed */
536 enum {
537  QTYPE_EQ = 1,
543 };
544 
545 struct be_cmd_req_q_destroy {
546  struct be_cmd_req_hdr hdr;
547  u16 id;
548  u16 bypass_flush; /* valid only for rx q destroy */
549 } __packed;
550 
551 struct macaddr {
552  u8 byte[ETH_ALEN];
553 };
554 
560  struct macaddr mac[32];
561 } __packed;
562 
563 static inline void *embedded_payload(struct be_mcc_wrb *wrb)
564 {
565  return wrb->payload.embedded_payload;
566 }
567 
568 static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb)
569 {
570  return &wrb->payload.sgl[0];
571 }
572 
573 /******************** Modify EQ Delay *******************/
575  struct be_cmd_req_hdr hdr;
576  u32 num_eq;
577  struct {
578  u32 eq_id;
579  u32 phase;
581  } delay[8];
582 } __packed;
583 
584 /******************** Get MAC ADDR *******************/
585 
586 #define ETH_ALEN 6
587 
597  u32 rsvd[23];
598 };
599 
609  u32 rsvd[23];
610 };
611 
612 #define BEISCSI_ALIAS_LEN 32
613 
620 } __packed;
621 
625 } __packed;
626 
627 /*** Port Speed Values ***/
628 #define BE2ISCSI_LINK_SPEED_ZERO 0x00
629 #define BE2ISCSI_LINK_SPEED_10MBPS 0x01
630 #define BE2ISCSI_LINK_SPEED_100MBPS 0x02
631 #define BE2ISCSI_LINK_SPEED_1GBPS 0x03
632 #define BE2ISCSI_LINK_SPEED_10GBPS 0x04
643 } __packed;
644 
646  struct be_queue_info *eq, int eq_delay);
647 
649  struct be_queue_info *cq, struct be_queue_info *eq,
650  bool sol_evts, bool no_delay,
651  int num_cqe_dma_coalesce);
652 
654  int type);
655 int beiscsi_cmd_mccq_create(struct beiscsi_hba *phba,
656  struct be_queue_info *mccq,
657  struct be_queue_info *cq);
658 
659 int be_poll_mcc(struct be_ctrl_info *ctrl);
661  struct beiscsi_hba *phba);
662 unsigned int be_cmd_get_initname(struct beiscsi_hba *phba);
663 unsigned int be_cmd_get_port_speed(struct beiscsi_hba *phba);
664 
665 void free_mcc_tag(struct be_ctrl_info *ctrl, unsigned int tag);
666 /*ISCSI Functuions */
668 
669 struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem);
670 struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba);
671 int be_mcc_notify_wait(struct beiscsi_hba *phba);
672 void be_mcc_notify(struct beiscsi_hba *phba);
673 unsigned int alloc_mcc_tag(struct beiscsi_hba *phba);
677  struct be_mcc_compl *compl);
678 
679 int be_mbox_notify(struct be_ctrl_info *ctrl);
680 
682  struct be_queue_info *cq,
683  struct be_queue_info *dq, int length,
684  int entry_size);
685 
687  struct be_dma_mem *q_mem, u32 page_offset,
688  u32 num_pages);
689 
690 int beiscsi_cmd_reset_function(struct beiscsi_hba *phba);
691 
692 int be_cmd_wrbq_create(struct be_ctrl_info *ctrl, struct be_dma_mem *q_mem,
693  struct be_queue_info *wrbq);
694 
695 bool is_link_state_evt(u32 trailer);
696 
697 /* Configuration Functions */
698 int be_cmd_set_vlan(struct beiscsi_hba *phba, uint16_t vlan_tag);
699 
701  u32 dw[4];
702 } __packed;
703 
705  u8 dbuf_cindex[13]; /* dword 0 */
706  u8 rsvd0[3]; /* dword 0 */
707  u8 ring_size[4]; /* dword 0 */
708  u8 ring_state[4]; /* dword 0 */
709  u8 rsvd1[8]; /* dword 0 */
710  u8 dbuf_pindex[13]; /* dword 1 */
711  u8 rsvd2; /* dword 1 */
712  u8 pci_func_id[8]; /* dword 1 */
713  u8 rx_pdid[9]; /* dword 1 */
714  u8 rx_pdid_valid; /* dword 1 */
715  u8 default_buffer_size[16]; /* dword 2 */
716  u8 cq_id_recv[10]; /* dword 2 */
717  u8 rx_pdid_not_valid; /* dword 2 */
718  u8 rsvd3[5]; /* dword 2 */
719  u8 rsvd4[32]; /* dword 3 */
720 } __packed;
721 
728  struct phys_addr pages[8];
729 } __packed;
730 
735 } __packed;
736 
742  struct phys_addr pages[26];
744 } __packed;
745 
751  struct phys_addr pages[8];
752 } __packed;
753 
758 } __packed;
759 
760 #define SOL_CID_MASK 0x0000FFC0
761 #define SOL_CODE_MASK 0x0000003F
762 #define SOL_WRB_INDEX_MASK 0x00FF0000
763 #define SOL_CMD_WND_MASK 0xFF000000
764 #define SOL_RES_CNT_MASK 0x7FFFFFFF
765 #define SOL_EXP_CMD_SN_MASK 0xFFFFFFFF
766 #define SOL_HW_STS_MASK 0x000000FF
767 #define SOL_STS_MASK 0x0000FF00
768 #define SOL_RESP_MASK 0x00FF0000
769 #define SOL_FLAGS_MASK 0x7F000000
770 #define SOL_S_MASK 0x80000000
771 
772 struct sol_cqe {
773  u32 dw[4];
774 };
775 
776 struct amap_sol_cqe {
777  u8 hw_sts[8]; /* dword 0 */
778  u8 i_sts[8]; /* dword 0 */
779  u8 i_resp[8]; /* dword 0 */
780  u8 i_flags[7]; /* dword 0 */
781  u8 s; /* dword 0 */
782  u8 i_exp_cmd_sn[32]; /* dword 1 */
783  u8 code[6]; /* dword 2 */
784  u8 cid[10]; /* dword 2 */
785  u8 wrb_index[8]; /* dword 2 */
786  u8 i_cmd_wnd[8]; /* dword 2 */
787  u8 i_res_cnt[31]; /* dword 3 */
788  u8 valid; /* dword 3 */
789 } __packed;
790 
791 #define SOL_ICD_INDEX_MASK 0x0003FFC0
793  u8 hw_sts[8]; /* dword 0 */
794  u8 i_sts[8]; /* dword 0 */
795  u8 i_resp[8]; /* dword 0 */
796  u8 i_flags[7]; /* dword 0 */
797  u8 s; /* dword 0 */
798  u8 i_exp_cmd_sn[32]; /* dword 1 */
799  u8 code[6]; /* dword 2 */
800  u8 icd_index[12]; /* dword 2 */
801  u8 rsvd[6]; /* dword 2 */
802  u8 i_cmd_wnd[8]; /* dword 2 */
803  u8 i_res_cnt[31]; /* dword 3 */
804  u8 valid; /* dword 3 */
805 } __packed;
806 
807 
808 
814 #define DB_WRB_POST_CID_MASK 0x3FF /* bits 0 - 9 */
815 #define DB_DEF_PDU_WRB_INDEX_MASK 0xFF /* bits 0 - 9 */
816 
817 #define DB_DEF_PDU_WRB_INDEX_SHIFT 16
818 #define DB_DEF_PDU_NUM_POSTED_SHIFT 24
819 
823 } __packed;
824 
830 
831 } __packed;
832 
833 struct eq_delay {
837 } __packed;
838 
842  struct eq_delay delay[8];
843 } __packed;
844 
856  u8 rsvd0[3];
857 } __packed;
858 
864 
865 } __packed;
866 
868  struct MCC_WRB *wrb;
870 } __packed;
871 
872 #define DB_DEF_PDU_RING_ID_MASK 0x3FF /* bits 0 - 9 */
873 #define DB_DEF_PDU_CQPROC_MASK 0x3FFF /* bits 0 - 9 */
874 #define DB_DEF_PDU_REARM_SHIFT 14
875 #define DB_DEF_PDU_EVENT_SHIFT 15
876 #define DB_DEF_PDU_CQPROC_SHIFT 16
877 
878 struct dmsg_cqe {
879  u32 dw[4];
880 } __packed;
881 
887 } __packed;
888 
890  u32 dw[32];
891 } __packed;
892 
896 } __packed;
897 
912 };
913 
914 struct be_fw_cfg {
920  struct be_ulp_fw_cfg ulp[2];
922 } __packed;
923 
928 } __packed;
929 
930 #define ISCSI_OPCODE_SCSI_DATA_OUT 5
931 #define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
932 #define OPCODE_COMMON_MODIFY_EQ_DELAY 41
933 #define OPCODE_COMMON_ISCSI_CLEANUP 59
934 #define OPCODE_COMMON_TCP_UPLOAD 56
935 #define OPCODE_COMMON_ISCSI_TCP_CONNECT_AND_OFFLOAD 70
936 #define OPCODE_COMMON_ISCSI_ERROR_RECOVERY_INVALIDATE_COMMANDS 1
937 #define OPCODE_ISCSI_INI_CFG_GET_HBA_NAME 6
938 #define OPCODE_ISCSI_INI_CFG_SET_HBA_NAME 7
939 #define OPCODE_ISCSI_INI_SESSION_GET_A_SESSION 14
940 #define OPCODE_ISCSI_INI_DRIVER_REOPEN_ALL_SESSIONS 36
941 #define OPCODE_ISCSI_INI_DRIVER_OFFLOAD_SESSION 41
942 #define OPCODE_ISCSI_INI_DRIVER_INVALIDATE_CONNECTION 42
943 #define OPCODE_ISCSI_INI_BOOT_GET_BOOT_TARGET 52
944 #define OPCODE_COMMON_WRITE_FLASH 96
945 #define OPCODE_COMMON_READ_FLASH 97
946 
947 /* --- CMD_ISCSI_INVALIDATE_CONNECTION_TYPE --- */
948 #define CMD_ISCSI_COMMAND_INVALIDATE 1
949 #define CMD_ISCSI_CONNECTION_INVALIDATE 0x8001
950 #define CMD_ISCSI_CONNECTION_ISSUE_TCP_RST 0x8002
951 
952 #define INI_WR_CMD 1 /* Initiator write command */
953 #define INI_TMF_CMD 2 /* Initiator TMF command */
954 #define INI_NOPOUT_CMD 3 /* Initiator; Send a NOP-OUT */
955 #define INI_RD_CMD 5 /* Initiator requesting to send
956  * a read command
957  */
958 #define TGT_CTX_UPDT_CMD 7 /* Target context update */
959 #define TGT_STS_CMD 8 /* Target R2T and other BHS
960  * where only the status number
961  * need to be updated
962  */
963 #define TGT_DATAIN_CMD 9 /* Target Data-Ins in response
964  * to read command
965  */
966 #define TGT_SOS_PDU 10 /* Target:standalone status
967  * response
968  */
969 #define TGT_DM_CMD 11 /* Indicates that the bhs
970  * preparedby
971  * driver should not be touched
972  */
973 /* --- CMD_CHUTE_TYPE --- */
974 #define CMD_CONNECTION_CHUTE_0 1
975 #define CMD_CONNECTION_CHUTE_1 2
976 #define CMD_CONNECTION_CHUTE_2 3
977 
978 #define EQ_MAJOR_CODE_COMPLETION 0
979 
980 #define CMD_ISCSI_SESSION_DEL_CFG_FROM_FLASH 0
981 #define CMD_ISCSI_SESSION_SAVE_CFG_ON_FLASH 1
982 
983 /* --- CONNECTION_UPLOAD_PARAMS --- */
984 /* These parameters are used to define the type of upload desired. */
985 #define CONNECTION_UPLOAD_GRACEFUL 1 /* Graceful upload */
986 #define CONNECTION_UPLOAD_ABORT_RESET 2 /* Abortive upload with
987  * reset
988  */
989 #define CONNECTION_UPLOAD_ABORT 3 /* Abortive upload without
990  * reset
991  */
992 #define CONNECTION_UPLOAD_ABORT_WITH_SEQ 4 /* Abortive upload with reset,
993  * sequence number by driver */
995 /* Returns byte size of given field with a structure. */
997 /* Returns the number of items in the field array. */
998 #define BE_NUMBER_OF_FIELD(_type_, _field_) \
999  (FIELD_SIZEOF(_type_, _field_)/sizeof((((_type_ *)0)->_field_[0])))\
1006 #define SOL_CMD_COMPLETE 1 /* Solicited command completed
1007  * normally
1008  */
1009 #define SOL_CMD_KILLED_DATA_DIGEST_ERR 2 /* Solicited command got
1010  * invalidated internally due
1011  * to Data Digest error
1012  */
1013 #define CXN_KILLED_PDU_SIZE_EXCEEDS_DSL 3 /* Connection got invalidated
1014  * internally
1015  * due to a received PDU
1016  * size > DSL
1017  */
1018 #define CXN_KILLED_BURST_LEN_MISMATCH 4 /* Connection got invalidated
1019  * internally due ti received
1020  * PDU sequence size >
1021  * FBL/MBL.
1022  */
1023 #define CXN_KILLED_AHS_RCVD 5 /* Connection got invalidated
1024  * internally due to a received
1025  * PDU Hdr that has
1026  * AHS */
1027 #define CXN_KILLED_HDR_DIGEST_ERR 6 /* Connection got invalidated
1028  * internally due to Hdr Digest
1029  * error
1030  */
1031 #define CXN_KILLED_UNKNOWN_HDR 7 /* Connection got invalidated
1032  * internally
1033  * due to a bad opcode in the
1034  * pdu hdr
1035  */
1036 #define CXN_KILLED_STALE_ITT_TTT_RCVD 8 /* Connection got invalidated
1037  * internally due to a received
1038  * ITT/TTT that does not belong
1039  * to this Connection
1040  */
1041 #define CXN_KILLED_INVALID_ITT_TTT_RCVD 9 /* Connection got invalidated
1042  * internally due to received
1043  * ITT/TTT value > Max
1044  * Supported ITTs/TTTs
1045  */
1046 #define CXN_KILLED_RST_RCVD 10 /* Connection got invalidated
1047  * internally due to an
1048  * incoming TCP RST
1049  */
1050 #define CXN_KILLED_TIMED_OUT 11 /* Connection got invalidated
1051  * internally due to timeout on
1052  * tcp segment 12 retransmit
1053  * attempts failed
1054  */
1055 #define CXN_KILLED_RST_SENT 12 /* Connection got invalidated
1056  * internally due to TCP RST
1057  * sent by the Tx side
1058  */
1059 #define CXN_KILLED_FIN_RCVD 13 /* Connection got invalidated
1060  * internally due to an
1061  * incoming TCP FIN.
1062  */
1063 #define CXN_KILLED_BAD_UNSOL_PDU_RCVD 14 /* Connection got invalidated
1064  * internally due to bad
1065  * unsolicited PDU Unsolicited
1066  * PDUs are PDUs with
1067  * ITT=0xffffffff
1068  */
1069 #define CXN_KILLED_BAD_WRB_INDEX_ERROR 15 /* Connection got invalidated
1070  * internally due to bad WRB
1071  * index.
1072  */
1073 #define CXN_KILLED_OVER_RUN_RESIDUAL 16 /* Command got invalidated
1074  * internally due to received
1075  * command has residual
1076  * over run bytes.
1077  */
1078 #define CXN_KILLED_UNDER_RUN_RESIDUAL 17 /* Command got invalidated
1079  * internally due to received
1080  * command has residual under
1081  * run bytes.
1082  */
1083 #define CMD_KILLED_INVALID_STATSN_RCVD 18 /* Command got invalidated
1084  * internally due to a received
1085  * PDU has an invalid StatusSN
1086  */
1087 #define CMD_KILLED_INVALID_R2T_RCVD 19 /* Command got invalidated
1088  * internally due to a received
1089  * an R2T with some invalid
1090  * fields in it
1091  */
1092 #define CMD_CXN_KILLED_LUN_INVALID 20 /* Command got invalidated
1093  * internally due to received
1094  * PDU has an invalid LUN.
1095  */
1096 #define CMD_CXN_KILLED_ICD_INVALID 21 /* Command got invalidated
1097  * internally due to the
1098  * corresponding ICD not in a
1099  * valid state
1100  */
1101 #define CMD_CXN_KILLED_ITT_INVALID 22 /* Command got invalidated due
1102  * to received PDU has an
1103  * invalid ITT.
1104  */
1105 #define CMD_CXN_KILLED_SEQ_OUTOFORDER 23 /* Command got invalidated due
1106  * to received sequence buffer
1107  * offset is out of order.
1108  */
1109 #define CMD_CXN_KILLED_INVALID_DATASN_RCVD 24 /* Command got invalidated
1110  * internally due to a
1111  * received PDU has an invalid
1112  * DataSN
1113  */
1114 #define CXN_INVALIDATE_NOTIFY 25 /* Connection invalidation
1115  * completion notify.
1116  */
1117 #define CXN_INVALIDATE_INDEX_NOTIFY 26 /* Connection invalidation
1118  * completion
1119  * with data PDU index.
1120  */
1121 #define CMD_INVALIDATED_NOTIFY 27 /* Command invalidation
1122  * completionnotifify.
1123  */
1124 #define UNSOL_HDR_NOTIFY 28 /* Unsolicited header notify.*/
1125 #define UNSOL_DATA_NOTIFY 29 /* Unsolicited data notify.*/
1126 #define UNSOL_DATA_DIGEST_ERROR_NOTIFY 30 /* Unsolicited data digest
1127  * error notify.
1128  */
1129 #define DRIVERMSG_NOTIFY 31 /* TCP acknowledge based
1130  * notification.
1131  */
1132 #define CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN 32 /* Connection got invalidated
1133  * internally due to command
1134  * and data are not on same
1135  * connection.
1136  */
1137 #define SOL_CMD_KILLED_DIF_ERR 33 /* Solicited command got
1138  * invalidated internally due
1139  * to DIF error
1140  */
1141 #define CXN_KILLED_SYN_RCVD 34 /* Connection got invalidated
1142  * internally due to incoming
1143  * TCP SYN
1144  */
1145 #define CXN_KILLED_IMM_DATA_RCVD 35 /* Connection got invalidated
1146  * internally due to an
1147  * incoming Unsolicited PDU
1148  * that has immediate data on
1149  * the cxn
1150  */
1151 
1152 int beiscsi_pci_soft_reset(struct beiscsi_hba *phba);
1153 int be_chk_reset_complete(struct beiscsi_hba *phba);
1154 
1155 void be_wrb_hdr_prepare(struct be_mcc_wrb *wrb, int payload_len,
1156  bool embedded, u8 sge_cnt);
1157 
1158 void be_cmd_hdr_prepare(struct be_cmd_req_hdr *req_hdr,
1159  u8 subsystem, u8 opcode, int cmd_len);
1160 
1161 #endif /* !BEISCSI_CMDS_H */