linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / scsi / lpfc / lpfc_mbox.c
index 4d016c2..e3bc8d3 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-2005 Emulex.  All rights reserved.           *
  * EMULEX and SLI are trademarks of Emulex.                        *
  * www.emulex.com                                                  *
  * Portions Copyright (C) 2004-2005 Christoph Hellwig              *
@@ -195,14 +195,8 @@ lpfc_init_link(struct lpfc_hba * phba,
                mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_PT_PT;
                mb->un.varInitLnk.link_flags |= FLAGS_TOPOLOGY_FAILOVER;
                break;
-       case FLAGS_LOCAL_LB:
-               mb->un.varInitLnk.link_flags = FLAGS_LOCAL_LB;
-               break;
        }
 
-       /* Enable asynchronous ABTS responses from firmware */
-       mb->un.varInitLnk.link_flags |= FLAGS_IMED_ABORT;
-
        /* NEW_FEATURE
         * Setting up the link speed
         */
@@ -295,36 +289,49 @@ lpfc_unreg_did(struct lpfc_hba * phba, uint32_t did, LPFC_MBOXQ_t * pmb)
        return;
 }
 
-/**********************************************/
-/*  lpfc_read_nv  Issue a READ CONFIG         */
-/*                mailbox command             */
-/**********************************************/
+/***********************************************/
+
+/*                  command to write slim      */
+/***********************************************/
 void
-lpfc_read_config(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
+lpfc_set_slim(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb, uint32_t addr,
+             uint32_t value)
 {
        MAILBOX_t *mb;
 
        mb = &pmb->mb;
        memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
 
-       mb->mbxCommand = MBX_READ_CONFIG;
+       /* addr = 0x090597 is AUTO ABTS disable for ELS commands */
+       /* addr = 0x052198 is DELAYED ABTS enable for ELS commands */
+
+       /*
+        * Always turn on DELAYED ABTS for ELS timeouts
+        */
+       if ((addr == 0x052198) && (value == 0))
+               value = 1;
+
+       mb->un.varWords[0] = addr;
+       mb->un.varWords[1] = value;
+
+       mb->mbxCommand = MBX_SET_SLIM;
        mb->mbxOwner = OWN_HOST;
        return;
 }
 
-/*************************************************/
-/*  lpfc_read_lnk_stat  Issue a READ LINK STATUS */
-/*                mailbox command                */
-/*************************************************/
+/**********************************************/
+/*  lpfc_read_nv  Issue a READ CONFIG         */
+/*                mailbox command             */
+/**********************************************/
 void
-lpfc_read_lnk_stat(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
+lpfc_read_config(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
 {
        MAILBOX_t *mb;
 
        mb = &pmb->mb;
        memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
 
-       mb->mbxCommand = MBX_READ_LNK_STAT;
+       mb->mbxCommand = MBX_READ_CONFIG;
        mb->mbxOwner = OWN_HOST;
        return;
 }
@@ -612,17 +619,6 @@ lpfc_config_port(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
                        phba->brd_no);
 }
 
-void
-lpfc_kill_board(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
-{
-       MAILBOX_t *mb = &pmb->mb;
-
-       memset(pmb, 0, sizeof(LPFC_MBOXQ_t));
-       mb->mbxCommand = MBX_KILL_BOARD;
-       mb->mbxOwner = OWN_HOST;
-       return;
-}
-
 void
 lpfc_mbox_put(struct lpfc_hba * phba, LPFC_MBOXQ_t * mbq)
 {
@@ -651,19 +647,3 @@ lpfc_mbox_get(struct lpfc_hba * phba)
 
        return mbq;
 }
-
-int
-lpfc_mbox_tmo_val(struct lpfc_hba *phba, int cmd)
-{
-       switch (cmd) {
-       case MBX_WRITE_NV:      /* 0x03 */
-       case MBX_UPDATE_CFG:    /* 0x1B */
-       case MBX_DOWN_LOAD:     /* 0x1C */
-       case MBX_DEL_LD_ENTRY:  /* 0x1D */
-       case MBX_LOAD_AREA:     /* 0x81 */
-       case MBX_FLASH_WR_ULA:  /* 0x98 */
-       case MBX_LOAD_EXP_ROM:  /* 0x9C */
-               return LPFC_MBOX_TMO_FLASH_CMD;
-       }
-       return LPFC_MBOX_TMO;
-}