Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[sfrench/cifs-2.6.git] / drivers / scsi / lpfc / lpfc_sli.h
index d8ef0d2894d46bc13d7c954bdfb09fcb43f52baf..41c38d324ab005ce43efd90f27d7be2fd93c5db2 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************
  * This file is part of the Emulex Linux Device Driver for         *
  * Fibre Channel Host Bus Adapters.                                *
- * Copyright (C) 2004-2006 Emulex.  All rights reserved.           *
+ * Copyright (C) 2004-2007 Emulex.  All rights reserved.           *
  * EMULEX and SLI are trademarks of Emulex.                        *
  * www.emulex.com                                                  *
  *                                                                 *
@@ -39,9 +39,10 @@ struct lpfc_iocbq {
        IOCB_t iocb;            /* IOCB cmd */
        uint8_t retry;          /* retry counter for IOCB cmd - if needed */
        uint8_t iocb_flag;
-#define LPFC_IO_LIBDFC 1       /* libdfc iocb */
-#define LPFC_IO_WAKE   2       /* High Priority Queue signal flag */
-#define LPFC_IO_FCP    4       /* FCP command -- iocbq in scsi_buf */
+#define LPFC_IO_LIBDFC         1       /* libdfc iocb */
+#define LPFC_IO_WAKE           2       /* High Priority Queue signal flag */
+#define LPFC_IO_FCP            4       /* FCP command -- iocbq in scsi_buf */
+#define LPFC_DRIVER_ABORTED    8       /* driver aborted this request */
 
        uint8_t abort_count;
        uint8_t rsvd2;
@@ -67,6 +68,8 @@ struct lpfc_iocbq {
 #define IOCB_ERROR          2
 #define IOCB_TIMEDOUT       3
 
+#define LPFC_MBX_WAKE  1
+
 typedef struct lpfcMboxq {
        /* MBOXQs are used in single linked lists */
        struct list_head list;  /* ptr to next mailbox command */
@@ -75,6 +78,7 @@ typedef struct lpfcMboxq {
        void *context2;         /* caller context information */
 
        void (*mbox_cmpl) (struct lpfc_hba *, struct lpfcMboxq *);
+       uint8_t mbox_flag;
 
 } LPFC_MBOXQ_t;
 
@@ -172,6 +176,18 @@ struct lpfc_sli_stat {
        uint32_t mbox_busy;      /* Mailbox cmd busy */
 };
 
+/* Structure to store link status values when port stats are reset */
+struct lpfc_lnk_stat {
+       uint32_t link_failure_count;
+       uint32_t loss_of_sync_count;
+       uint32_t loss_of_signal_count;
+       uint32_t prim_seq_protocol_err_count;
+       uint32_t invalid_tx_word_count;
+       uint32_t invalid_crc_count;
+       uint32_t error_frames;
+       uint32_t link_events;
+};
+
 /* Structure used to hold SLI information */
 struct lpfc_sli {
        uint32_t num_rings;
@@ -186,7 +202,7 @@ struct lpfc_sli {
        int fcp_ring;           /* ring used for FCP initiator commands */
        int next_ring;
 
-       int ip_ring;            /* ring used for IP network drv cmds */
+       int extra_ring;         /* extra ring used for other protocols */
 
        struct lpfc_sli_stat slistat;   /* SLI statistical info */
        struct list_head mboxq;
@@ -201,6 +217,8 @@ struct lpfc_sli {
        struct lpfc_iocbq ** iocbq_lookup; /* array to lookup IOCB by IOTAG */
        size_t iocbq_lookup_len;           /* current lengs of the array */
        uint16_t  last_iotag;              /* last allocated IOTAG */
+       unsigned long  stats_start;        /* in seconds */
+       struct lpfc_lnk_stat lnk_stat_offsets;
 };
 
 /* Given a pointer to the start of the ring, and the slot number of
@@ -211,3 +229,9 @@ struct lpfc_sli {
 
 #define LPFC_MBOX_TMO           30     /* Sec tmo for outstanding mbox
                                           command */
+#define LPFC_MBOX_TMO_FLASH_CMD 300     /* Sec tmo for outstanding FLASH write
+                                        * or erase cmds. This is especially
+                                        * long because of the potential of
+                                        * multiple flash erases that can be
+                                        * spawned.
+                                        */