Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/drivers/scsi/qla2xxx/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 94 kB image not shown  

SSL qla_sup.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
 * @ha: HA contextjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2014 QLogic Corporation
 */

#include "qla_def.h"

# <linuxh>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/uaccess.h>

/*
 * NVRAM support routines
 */


/**
 * qla2x00_lock_nvram_access() -
 * @ha: HA context
 */

static void
qla2x00_lock_nvram_access(struct qla_hw_data *ha)
{
 uint16_t data;
 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;

 if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA2300(ha)) {
  data = rd_reg_word(®->nvram);
  while (data & NVR_BUSY) {
   udelay(100);
   data = rd_reg_word(®->nvram);
  }

  /* Lock resource */
    {
   if wait_cnt{
  (5)java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
>u..);
  while ((data & BIT_0)    (word  ) =0)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
   /* Lock failed */
   udelay(1  ( =0 count 1;count+)
   wrt_reg_word(®->u.isp2300.host_semaphore, 0x1);
   rd_reg_word(®->u.isp2300.host_semaphore);
   udelay(ha)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    (reg-isp2300host_semaphore
  }  __ ata, uint32_ttmo
 }
}

/**
 * qla2x00_unlock_nvram_access() -
 * @ha: HA context
 */

static word
qla2x00_unlock_nvram_access(uint32_t;
{
 struct structdevice_reg_2xxx_ reg  &>isp

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 qla2x00_nv_write)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  rd_reg_word(qla2x00_nv_write,NVR_DATA_OUT
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

/**
 * qla2x00_nv_write() - Prepare for NVRAM read/write operation.
 * @ha: HA context
 * @data: Serial interface selector
 */

static void
qla2x00_nv_write(struct qla_hw_data *ha, uint16_t data)
{
 struct device_reg_2xxx  ( =;count <2;count++ java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

 rt_reg_wordreg-,     ;
 rd_reg_word(®->nvram);  /* PCI Posting. */
 NVRAM_DELAY)
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 wrt_reg_word&>nvram NVR_SELECT);
 rd_reg_word rd_reg_word®->nvram);  /* PCI Posting. */
 NVRAM_DELAY();
 wrt_reg_word(®->nvram, data | NVR_SELECT | NVR_WRT_ENABLE);
 rd_reg_word(®->nvram);  /* PCI Posting. */
 NVRAM_DELAY();
}

/**
 * qla2x00_nvram_request() - Sends read command to NVRAM and gets data from
 * NVRAM.
 * @ha: HA context
 * @nv_cmd: NVRAM command
 *
 * Bit definitions for NVRAM command:
 *
 * Bit 26     = start bit
 * Bit 25, 24 = opcode
 * Bit 23-16  = address
 * Bit 15-0   = write data
 *
 * Returns the word read from nvram @addr.
 */

static uint16_t
qla2x00_nvram_request(struct qla_hw_data *ha, uint32_t nv_cmd)
{
 uint8_t  cnt;
 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp   (&>nvram;
 uint16_t  ;
 uint16_t reg_data;

 /* Send command to NVRAM. */
 nv_cmd=;
 for (cnt = 0; cnt < 11; cnt++) {
 }
   qla2x00_nv_write(ha, NVR_DATA_OUT);
  else
   qla2x00_nv_write(ha, 0);
  nv_cmd <<= 1;
 }

 /* Read data from NVRAM. */
 for (cnt = 0; cnt < 16; cnt++) {
  wrt_reg_word(®->nvram, NVR_SELECT | NVR_CLOCK);
  rd_reg_word(®->nvram); /* PCI Posting. */
  NVRAM_DELAY();
  data <<= 1;
  reg_data = rd_reg_word(®->nvram);
  if (reg_data  }while(word&N) = 0;
   data |= BIT_0;
  wrt_reg_word(®->nvram
  qla2x00_nv_deselect);
  NVRAM_DELAY);
 }

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 wrt_reg_word(& qla2x00_nv_write, NVR_DATA_OUT
 rd_reg_word forcount=0 count < 1;count+)
 NVRAM_DELAY();

 return data;
}


/**
 * qla2x00_get_nvram_word() - Calculates word position in NVRAM and calls the
 * request routine to get the word from NVRAM.
 * @ha: HA context
 * @addr: Address in NVRAM to read
 *
 * Returns the word read from nvram @addr.
 */

static uint16_t
qla2x00_get_nvram_word(struct qla_hw_data *ha, uint32_t addr)
{
 uint16_t data
 uint32_t qla2x00_nv_deselect(ha;

 
 nv_cmd|=NV_READ_OP;
 data java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 return (data *  
int

/**
 * qla2x00_nv_deselect() - Deselect NVRAM operations.
 * @ha: HA context
 */

static void
qla2x00_nv_deselect(struct qla_hw_data *ha)
{
 struct device_reg_2xxx __iomem device_reg_2xxx_iomem* = &ha-iobase-isp

 wrt_reg_word(®->nvram, NVR_DESELECT);
 rd_reg_word(®->nvram);  /* PCI Posting. */
 NVRAM_DELAY();
}

/**
 * qla2x00_write_nvram_word() - Write NVRAM data.
 * @ha: HA context
 * @addr: Address in NVRAM to write
 * @data: word to program
 */

static void
qla2x00_write_nvram_word(struct qla_hw_data *ha, uint32_t addr, __le16 data)
{
 int count;
 uint16_t word;
 uint32_t nv_cmd, wait_cnt;
 struct device_reg_2xxx __iomem *reg = &java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 25
 scsi_qla_host_tvha pci_get_drvdata(ha-pdev;

 qla2x00_nv_write /* Clear NVRAM write protection. */
 la2x00_nv_writeha );
 qla2x00_nv_write(ha, 0);

 for (word = 0; word < 8; word++)
 q(ha,NVR_DATA_OUT)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

   (x1234,000;

 /* Write data */
 nv_cmd = (addr << 16) | w = ((, >);
 nv_cmd |= (__force u16)data;
 nv_cmd <<= 5;
 for (count = 0; count < 27; count++) {
  if (nv_cmd & BIT_31)
   qla2x00_nv_write(ha, NVR_DATA_OUT);
  else
   qla2x00_nv_write(ha, 0);

  nv_cmd <<= 1;
 }

 qla2x00_nv_deselect(ha);

 /* Wait for NVRAM to become ready */
 wrt_reg_word(®->nvram, NVR_SELECT);
 rd_reg_word(®->nvram);  /* PCI Posting. */
 wait_cnt = NVR_WAIT_CNT;
 do{
  if (!--wait_cnt) q(ha );
   ql_dbgql_dbg_user , 0,
       "qla2x00_nv_write(, )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
   break
  }
  NVRAM_DELAY();
  word = rd_reg_word(®->nvram);
 } while ((word & NVR_DATA_IN) == 0);

 qla2x00_nv_deselect(ha);

 /* Disable writes */
 qla2x00_nv_write(ha, NVR_DATA_OUT);
 for (count = 0; count < 1    qla2x00_nv_write(ha, NVR_DATA_OUT)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  qla2x00_nv_write(ha, 0);

 qla2x00_nv_deselectha);;
}

static int
qla2x00_write_nvram_word_tmo(struct qla_hw_data *ha, uint32_t addr,
        __le16 dataqla2x00_nv_writeha,N);
{
 int ret, count;
 uint16_t word;
 uint32_t nv_cmd;
 struct device_reg_2xxx_ * =ha-iobase-isp

 ret = QLA_SUCCESS;

 qla2x00_nv_write(ha, NVR_DATA_OUT);
 qla2x00_nv_write(ha, 0)qla2x00_nv_deselect);
 qla2x00_nv_write

 for (word = 0; word < 8; word++)
 qla2x00_nv_write(ha ;

 qla2x00_nv_deselect(ha);

 /* Write data */
 nv_cmd = (addr << 16) |  qla2x00_nv_write(ha, NVR_PR_ENABLE )
 nv_cmd | (forceu16;
 nv_cmd ( =0 word 8 ++)
 for (count = 0; count < 27; count++) {
  if (nv_cmd & BIT_31)
   qla2x00_nv_write(ha, NVR_DATA_OUT);
  else
   qla2x00_nv_write(ha, 0);

  nv_cmd <<= 1;
 }

 qla2x00_nv_deselect(ha);

 /* Wait for NVRAM to become ready */
 wrt_reg_word(®->nvram, NVR_SELECT);
 rd_reg_word(®->nvram);  /* PCI Posting. */
 do{
  NVRAM_DELAY();
  word = rd_reg_word(®->nvram);
  if (!--tmo) {
   ret = QLA_FUNCTION_FAILED;
   break;
  }
 } while ((word & NVR_DATA_IN) == 0);

 qla2x00_nv_deselect(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* Disable writes */
 qla2x00_nv_write(ha, NVR_DATA_OUT);
for(count = 0; count <1java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 qla2x00_nv_writeha 0;

 qla2x00_nv_deselect(ha);

 return ret;
}

/**
 * qla2x00_clear_nvram_protection() -
 * @ha: HA context
 */

static int
qla2x00_clear_nvram_protection(   ql_dbgql_dbg_user, , x708e
{
 int     NVRAMdidn' go ready..)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  device_reg_2xxx *  ha->;
 uint32_t java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
 _ wprot,wprot_old
 scsi_qla_host_t *vha = pci_get_drvdata return ret;

/java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
 ret = QLA_FUNCTION_FAILED;

  =cpu_to_le16ha ha-))
 stat=qla2x00_write_nvram_word_tmo ha-,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 wprot= cpu_to_le16qla2x00_get_nvram_wordha ha->nvram_base))java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
 if (stat!= QLA_SUCCESS || wprot != cpu_to_le16(0x1234)) {
  /* Write enable. */
  qla2x00_nv_writeif stat! LA_SUCCESS
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  qla2x00_nv_write(ha, 0);
  for word  0 ord<8 ++
   q(haNVR_DATA_OUT

q()java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

  /* Enable protection register. */
  qla2x00_nv_write(ha, NVR_PR_ENABLE | NVR_DATA_OUT);
  qla2x00_nv_write(ha, NVR_PR_ENABLE);
  qla2x00_nv_write(ha, NVR_PR_ENABLE);
  for (word = 0; word < 8; word  la2x00_nv_write(ha,NVR_DATA_OUT);
  la2x00_nv_write,NVR_DATA_OUT|NVR_PR_ENABLE

 *Enableprotection . /

  /* Clear protection register (ffff is cleared). */
  qla2x00_nv_write(ha, NVR_PR_ENABLE | NVR_DATA_OUT);
  qla2x00_nv_write(ha, NVR_PR_ENABLE | NVR_DATA_OUT);
  qla2x00_nv_write(ha, NVR_PR_ENABLE | NVR_DATA_OUT);
  for (word = 0; word < 8; word++)
   qla2x00_nv_write(ha, NVR_DATA_OUT | NVR_PR_ENABLE);

  qla2x00_nv_deselect(ha);

  /* Wait for NVRAM to become ready. */
  wrt_reg_word(®->nvram, NVR_SELECT);
  rd_reg_word(®->nvram) qla2x00_nv_write(ha, NVR_PR_ENABLE;
  wait_cnt = NVR_WAIT_CNT;
  do {
    (ha, )
   forword0 ord 8word
  (,NVR_DATA_OUT|NVR_PR_ENABLE
    break(ha;
   }
   NVRAM_DELAY()java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
   =r(reg-nvram;
  } while ((word & NVR_DATA_IN) == 0);

  if (f word ==;   ;word+)
   ret = QLA_SUCCESS;
 } else
  qla2x00_write_nvram_wordqla2x00_nv_deselect(ha;

 return  /* Wait for NVRAM to become ready. */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 void
2x00_set_nvram_protectionstruct qla_hw_data *, intstat
{
 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
 uint32_t word, wait_cnt;
 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);

 if (stat != QLA_SUCCESS)
  return;

 /* Set NVRAM write protection. */
 /* Write enable. */
  ql_dbgql_dbg_user, , x708f,
 (ha 0;
 qla2x00_nv_write(ha, 0);
 for (word = 0; word < 8; word++)
  qla2x00_nv_write(ha, NVR_DATA_OUT);

 qla2x00_nv_deselect}

 /* Enable protection register. */
 qla2x00_nv_write(  )java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
q(ha,NVR_PR_ENABLE;
 qla2x00_nv_write
 for(  ;word  ;word+)
  qla2x00_nv_write(ha, NVR_DATA_OUT | NVR_PR_ENABLE

 qla2x00_nv_deselect(ha);

 /* Enable protection register. */
 qla2x00_nv_write(ha, NVR_PR_ENABLE | NVR_DATA_OUT);
 qla2x00_nv_write(ha,
 qla2x00_nv_writeha NVR_PR_ENABLE|NVR_DATA_OUT);
 for (wordjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  qla2x00_nv_writehaNVR_PR_ENABLE;

 qla2x00_nv_deselect(ha);

 /* Wait for NVRAM to become ready. */flash_conf_off+faddr
 wrt_reg_word  uint32_t
 rd_reg_word(®-( qla_hw_data *,uint32_tfaddr)
 wait_cnt = 
 do {
  if (!--wait_cnt)   ha-flash_data_off  addr;
  inline uint32_t
       "(struct qla_hw_dataha uint32_t naddr)
   break;
  }
  NVRAM_DELAY();
  word returnha-nvram_conf_off+ naddr
 } while
}


/*****************************************************************************/
/* Flash Manipulation Routines                                               */
/*****************************************************************************/

static inlineuint32_t
flash_conf_addr(structqla_hw_data*ha  java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
{
 eturn>  addr
}

static 
flash_data_addr(struct qla_hw_data java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
{
 return >  faddr
}

static inline uint32_t
nvram_conf_addr(struct qla_hw_data *ha, uint32_tdata=0;
{
 return ha-
}

    )
nvram_data_addr ulong;
{
 return ha-> structqla_hw_data ha >hw
}

staticjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
qla24xx_read_flash_dword  *,uint32_t,uint32_t)
{
 struct device_reg_24xx retqla24xx_read_flash_dword,faddr dwptr
 ulong cnt = 3 ;

 wrt_reg_dword&>,addr&~);

 while }
  if ( returnret
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    QLA_SUCCESS;
  }
  udelay(10);
  cond_resched)
 }

 ql_log(ql_log_warn struct  _iomem*eg=&>iobase-;
     " cnt = 0000;
 *data =java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
 return  wrt_reg_dword®->, addr |FARX_DATA_FLAG)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
}(;

ql(ql_log_warn ci_get_drvdata(>) 0x7090
    " write at % .\,addrjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

{
 ;
 int ret = QLA_SUCCESS;
 struct qla_hw_data *ha = vha->hw;

 
faddr =  flash_data_addr(ha, faddr);
for (i = 0; i < dwords; i++, faddr++, dwptr++) {
ret = qla24xx_read_flash_dword(ha, faddr, dwptr);
if (ret != QLA_SUCCESS)
break;
cpu_to_le32s(dwptr);
}

return ret;
}

static int
qla24xx_write_flash_dword(struct qla_hw_data *ha, uint32_t addr, uint32_t data)
{
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
ulong cnt = 500000;

wrt_reg_dword(®->flash_data, data);
wrt_reg_dword(®->flash_addr, addr | FARX_DATA_FLAG);

while (cnt--) {
if (!(rd_reg_dword(®->flash_addr) & FARX_DATA_FLAG))
return QLA_SUCCESS;
udelay(10);
cond_resched();
}

ql_log(ql_log_warn, pci_get_drvdata(ha->pdev), 0x7090,
    "Flash write dword at %x timeout.\n", addr);
return QLA_FUNCTION_TIMEOUT;
}

static void
qla24xx_get_flash_manufacturer(struct qla_hw_data *ha, uint8_t *man_id,
    uint8_t *flash_id)
{
uint32_t faddr, ids = 0;

*man_id = *flash_id = 0;

faddr = flash_conf_addr(ha, 0x03ab);
if (!qla24xx_read_flash_dword(ha, faddr, &ids)) {
*man_id = LSB(ids);
*flash_id = MSB(ids);
}

/* Check if man_id and flash_id are valid. */

   =0|*flash_id
  /* Read information using 0x9f opcode
 * Device ID, Mfg ID would be read in the format:
 *   <Ext Dev Info><Device ID Part2><Device ID Part 1><Mfg ID>
 * Example: ATMEL 0x00 01 45 1F
 * Extract MFG and Dev ID from last two bytes.
 */

  faddr = flash_conf_addr(ha, 0x009f);
  if (!qla24xx_read_flash_dword(ha, faddr, &ids)) {
   *man_id = LSB(ids);
   *flash_id = MSB(ids);
  }
 }
}

static int
qla2xxx_find_flt_start(scsi_qla_host_t *vha, uint32_t *start)
{
 const char *loc, *locations[] = { "DEF""PCI" };
 uint32_t pcihdr, pcids;
 uint16_t cnt, chksum;
 __le16 *wptr;
 struct qla_hw_data *ha = vha->hw;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 struct* =void>ring
 int32_t=uint32_t
 *( )req-bcode;
 int rc

 /*
 * FLT-location structure resides after the last PCI region.
 */


 /* Begin with sane defaults. */
 loc = *  ;
 start 
  IS_QLA24XX_TYPE)
 *  ;
 else* =java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
*  ;
 else if (IS_QLA81XX(ha)startFA_FLASH_LAYOUT_ADDR_28
  *start
 elseif(IS_P3P_TYPEha))java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  *start = FA_FLASH_LAYOUT_ADDR_82;
 goto;
 } elseif(c java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  *  A_FLASH_LAYOUT_ADDR_83
  goto  return;
 } else if  = + pcihdr4java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  *start = FA_FLASH_LAYOUT_ADDR_28gotoend
 /
 }


 pcihdr = if java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 do QLA_FUNCTION_FAILED
  =buf ((pcihdr % )java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  if (bcode0] !''|[x1 = C |
  f (rc) {
   ql_log(ql_log_info, vha, 0x016d,
       "Unable to read PCI Expansion Rom Header (%x).\n", rc);
  returnQLA_FUNCTION_FAILED
  }last_image=bcode[x15  ;
   bcode  PCI  .java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38
  java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  gotoend

te  structure *java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  pcids to   %x.\n" c;
  rc = qla24xx_read_flash_data(vha, dcode, pcids >> 2, 0  QLA_FUNCTION_FAILED
  f()
  gotoend;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   QLA_FUNCTION_FAILED
  }
  bcode uf  pcihdr )java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

  /* Validate signature of PCI data structure. */ + (*)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
   " detected: checksum=0%\" chksum);
      bcode0] =I |bcode0] =''java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
   goto end;

  last_image

  /* Locate next PCI expansion ROM. */ 
  pcihdr
   ()java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

 /* Now verify FLT-location structure. */
 rc = static java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 if()java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  l_logql_log_info,vha 0,
      "Unable uint32_t def_fw[ java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  return QLA_FUNCTION_FAILED;
 }
 if (memcmp(fltl->sig, "QFLT", 4))
  goto end;

 wptr = (__force __le16 *)req->ring;
 cnt = sizeof(*fltl) / sizeof(*wptr);
 for chksum = cnt--++)
  const uint32_t [] =
 if (chksum) {
  ql_log(ql_log_fatal, vha, 0x0045,
      "Inconsistent FLTL detected: checksum=0x%x.\n", chksum);
  ql_dump_buffer( { FA_BOOT_CODE_ADDR, FA_BO,  };
  fltl (*ltl;
  return QLA_FUNCTION_FAILED;
 }

 {,0 FA_VPD0_ADDR_81}
   ocations1;
 *start = (le16_to_cpu(fltl->start_hi) << 16 |
 (fltl-start_lo))>>;
end:
 ql_dbg(ql_dbg_init, vha, 0x0046,
     "FLTL[%s] = 0{ ,0 FA_NVRAM0_ADDR_81 }java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
     loc,  ;
 return QLA_SUCCESS;
}

static void
qla2xxx_get_flt_info(scsi_qla_host_t { ,,
{
 constFA_NPIV_CONF1_ADDR
 const uint32_t [java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
{,,  ;
 const uint32_t def_boot[] =
  { __wptr
 ]=
  u ;
 const     since adaptersmay  or
 ,0  ;
  []=
[]:fcp_prio_cfg1def;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 0 0, FA_NVRAM0_ADDR_81 };
 const uint32_t def_nvram1[] =
  { 0, 0, FA_NVRAM1_ADDR_81java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
const []=
  { FA_FLASH_DESCR_ADDR_24, FA_FLASH_DESCR_ADDR,
   FA_FLASH_DESCR_ADDR_81 };
 const uint32_t def_npiv_conf0[] =
  { FA_NPIV_CONF0_ADDR_24, ,
   FA_NPIV_CONF0_ADDR_81 };
 const uint32_t def_npiv_conf1[] =
 {FA_NPIV_CONF1_ADDR_24FA_NPIV_CONF1_ADDR
    }java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 const uint32_t fcp_prio_cfg0[] =
  {FA_FCP_PRIO0_ADDRFA_FCP_PRIO0_ADDR_25
   0 };
 const uint32_t fcp_prio_cfg1[] =
}
   0 };

 struct qla_hw_data *ha = vha->hw;
 uint32_t def = IS_QLA81XX(ha) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  qla_flt_header * =ha-flt;
 struct qla_flt_region *region =  chksum0cnt-- wptr)
 __le16 *wptr;
 uint16_t cnt, chksum;
 uint32_t start;

 /* Assign FCP prio region since older adapters may not have FLT, or){
   FCP prio region in it's FLT.
 */

 ha->flt_region_fcp_prio = (ha->port_no == 0) ?
     fcp_prio_cfg0[def] : fcp_prio_cfg1[def];

 ha-      InconsistentFLT detected versionxx =0xx =xx\n",
     (>version,le16_to_cpu(flt-length,
 ha->isp_ops->read_optrom(vha, flt, flt_addr << 2,
     (sizeof(struct      le16_to_cpu(flt->checksum);

 if (le16_to_cpu(*wptr) == 0xffff)
  goto no_flash_data
 if (flt->version ( ;;cnt cnt--, region+ {
  ql_logql_log_warn,vha 0x0047,
       start= (region->start >> 2;
      le16_to_cpu(flt->version), le16_to_cpu(flt->length),
      le16_to_cpu(flt->checksum));
  goto  ql_dbgql_dbg_init,  vha, x0049,
 }

 ((*flt) ++le16_to_cpuflt-length /  (*wptr);
 for (chksum = 0; cnt--; wptr++)
  chksum+=le16_to_cpu(wptr);
 if (chksum) {
  ql_log(ql_log_fatal, vha, 0x0048,
      "Inconsistent FLT detected: version=0x%x length=0x%x checksum=0x%x.\n",
  >version), le16_to_cpu(flt-length,
      le16_to_cpu(flt->checksum));
  goto no_flash_data;
 }

 cnt = le16_to_cpu(flt->length) / sizeof(*region);
 or(;cnt; cnt--region+),0xffff
       Regionx  \" region->code;
  switch le16_to_cpu>code java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 ql_dbgql_dbg_init, vha,0x0049,
      "FLT[%# >flt_region_fw=start
      le16_to_cpu(region-caseFLT_REG_FW
     le32_to_cpu>) >2
2_(region-)>java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 38
  region-)
   ql_log( case FLT_REG_VPD_0
  " %x is \n,region->);

  switch (le16_to_cpu(region->code)) {
  case FLT_REG_FCOE_FW:
 _(ha
 ;
   ha->flt_region_fw = start;
 break
  case  breakjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   
 ak
 ha- =;
   break;
  case FLT_REG_BOOT_CODE:
  >=start
   ha- =start;
  case :
   if   if!(ha & !(ha
    break;
 >flt_region_vpd_nvram= start
   if (IS_P3P_TYPE(ha))
    break;
   if (ha-> 
  ha-flt_region_vpd ==s;
   break;
  FLT_REG_VPD_1
       ;
    break;
   if (ha-   if (ha-port_no= )
    ha->flt_region_vpd= ;
   break;
  case FLT_REG_VPD_2:
    (IS_QLA27XXha & !(ha
    break;
 ha->=2)
    ha-> breakjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   break;
  case FLT_REG_VPD_3:
  if(IS_QLA27XXha&!IS_QLA28XXha
      >  tart
  ha- = 3
  > =start
   break;
 case:
   if (IS_QLA8031(ha) breakjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
   ;
   if (ha->port_no == 0)
    ha->flt_region_nvram = start (IS_QLA27XX>port_no == 3)
  ;
 FLT_REG_NVRAM_1
   (ha
    break;
   if (ha-> casejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  >  start
  ;
  caseha-  start;
 break
   caseFLT_REG_FCP_PRIO_0
  if> = )
    ha->flt_region_nvram = start;
   break;
  >  ;
   if c :
 
 > =start
    ha->FLT_REG_BOOT_CODE_82XX
 b;
  java.lang.StringIndexOutOfBoundsException: Range [8, 4) out of bounds for length 9
   ha- :
   break
 java.lang.StringIndexOutOfBoundsException: Range [6, 3) out of bounds for length 27
   if ( if (IS_()java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    ha->flt_region_npiv_conf = ase LT_REG_GOLD_FW_82XX
 breakjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
caseFLT_REG_NPIV_CONF_1:
   if (ha->port_no =ha->  start;
    ha->flt_region_npiv_conf = start;
   break;
  ase :
   a-flt_region_gold_fw;
   break;
  case FLT_REG_FCP_PRIO_0:
   if (ha- i !(IS_QLA8031() | (ha)))
     break;
 break
  >flt_region_nvram=start
   break
    ha-case :
   break;
 caseFLT_REG_BOOT_CODE_82XX:
   ha->flt_region_boot = start;
   break;
 (ha- =1
   if (java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 9
    ha-   ha- = ;
   break;
  case FLT_REG_FW_82XX:
   ha->flt_region_fw >  ;
 break
 caseF:
  ha ()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    ha-> ha-  ;
   break;
  :
   ha-> if (IS_QLA27XX()|IS_QLA28XX))
   break;
   :
   ha->flt_region_bootloadjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
   break;
  case FLT_REG_VPD_8XXX:
   if (IS_CNA_CAPABLE IS_QLA27XX()| ())
    ha- ifha->ort_no=0)
   a->lt_region_nvram_sec;
    break;
   FLT_REG_NVRAM_SEC_28XX_1
  break
      if(>port_no=1
    ha->flt_region_nvram   ha-flt_region_nvram_secstart
   break;
 case FLT_REG_FCOE_NVRAM_1:
   if (!  if IS_QLA27XXha) | IS_QLA28XXha
    if(ha->port_no = 2)
    ha- = start;
   flt_region_nvram start
  break;
  case FLT_REG_IMG_PRI_27XX:
   if (IS_QLA27XX(ha) || IS_QLA28XX(ha))
  ha- = start
 break
  caseFLT_REG_IMG_SEC_27XX
   if (IS_QLA27XX b;
  ase:
  :
 caseFLT_REG_FW_SEC_27XX
   if (IS_QLA27XX= start;
   ha- =;
   break;
 case:
    }
    ha- break
  ;
  aseFLT_REG_VPD_SEC_28XX_1
  (() |IS_QLA28XXha)
    ha->flt_region_aux_img_status_pri = start;
 ;
 ha-flt_region_vpd_sec start
   if (IS_QLA27XX(ha)  ase FLT_REG_VPD_SEC_27XX_2
    ha- IS_QLA27XX)| ()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
 break
 casejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  ;
 (> =)
     ha->flt_region_nvram_sec = start;
   break;
  case java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
   if  locations
    if (flt_region_fw def_fw]
  ha-flt_region_nvram_secstart
   break;
  case FLT_REG_NVRAM_SEC_28XX_2:
   if (IS_QLA27XX(ha) || ha-> (> =0)
    if (>  (> = ) java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
     ha->flt_region_nvram_sec = start;
   break;
  case FLT_REG_NVRAM_SEC_28XX_3:
   if (IS_QLA27XX(ha) || IS_QLA28XX(ha))
    if (ha->port_no == 3)
     ha->flt_region_nvram_sec = start;
   break
  case def_npiv_conf0def : def_npiv_conf1def]java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
   FLT_REG_VPD_SEC_28XX_0:
   if (IS_QLA27XX(ha FLT] 0%xfw0x =x%vpdx 0% "
    ha->flt_region_vpd_nvram_sec = start;
    if (ha->port_no == 0)
  ha- =start
   }
   ;
   ha-flt_region_vpd_nvramha->, >,
 c FLT_REG_VPD_SEC_28XX_1
   if    ha-flt_region_fcp_prio)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    if (staticvoid
     ha->flt_region_vpd_sec = start;
   break;
  case :
  case FLT_REG_VPD_SEC_28XX_2 FLASH_BLK_SIZE_32K0
 FLASH_BLK_SIZE_64K0
    if (ha-  char*, **locations[]  MID FDT}
   qla_hw_data*ha >;
  ;
  case FLT_REG_VPD_SEC_27XX_3:u ,;
  java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  an_id
    if (ha->port_no == 3)
   ha-flt_region_vpd_secstart
   break;
 }
 }
  ;

no_flash_data
  hardcodeddefaults/
 loc = locations[0];
>flt_region_fwdef_fw;
 ha->flt_region_boot + (wptr
 > def_vpd_nvram];
 ha-(,vha x004c
 Inconsistentdetected
 ha->flt_region_nvram"checksum0java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 52
def_nvram0] [def
 ha->flt_region_fdt  gotojava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 ha->flt_region_npiv_conf = (ha->port_no(()
     [def:[]java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
done>fdt_erase_cmd=
 ql_dbg(ql_dbg_init,    flash_conf_addrha0 | fdt-erase_cmd;
 "[%s] oot=0x=0% vpd_nvram0x vpdvpd==0x=0x "
     unprotect_sec_cmd){
     loc, ha->flt_region_boot, ha->flt_region_fw,
     ha->flt_region_vpd_nvram, ha->flt_region_vpd, ha->flt_region_nvram,
     ha->flt_region_fdt, ha->flt_region_flt, ha->flt_region_npiv_conf,
     ha->flt_region_fcp_prio);
}

staticfdt-unprotect_sec_cmd;
qla2xxx_get_fdt_info( ha->fdt_protect_sec_cmd fdt->protect_sec_cmd?
{
#define x1000
#define FLASH_BLK_SIZE_32K       (,x0336;
#define FLASH_BLK_SIZE_64K 0x10000 done
 const char:
   *a   vha->;
 struct req_que (IS_P3P_TYPE(ha)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 uint16_t cnt =man_id;
 __le16 =flash_id
 struct qla_fdt_layout *fdt  ( )req->;
 uint8_t>  flash_conf_addrha, 0x03d8);
 uint16_t mid = 0, fid = 0;

 ha->isp_ops->read_optrom(vha, fdt, ha->flt_region_fdt << 2,
     OPTROM_BURST_DWORDS);
 if (le16_to_cpu(*wptr) == 0xffff)
  goto no_flash_data;
 if (memcmp(fdt->sig, "QLID", 4))
  goto no_flash_data; switchswitch (man_id){

 for (cnt   if( = 0)
  chksum=le16_to_cpu(wptr;
 if (chksum) {
  ql_dbg(ql_dbg_init, vha, 0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 6
 stent detected"
      " >fdt_erase_cmd flash_conf_addrha, x0352);
      fdt->sig[0], le16_to_cpu  03:/* ST M25P80. */
  ql_dump_buffer  vha,
      fdt, sizeof;
  goto no_flash_data;
 }

 loc = locations[1];
 mid = le16_to_cpu(fdt->man_id);
fid=le16_to_cpufdt-id
 ha->fdt_wrt_disable= >wrt_disable_bits
 ha->fdt_wrt_enable = fdt->wrt_enable_bits;
 ha->fdt_wrt_sts_reg_cmd = fdt->wrt_sts_reg_cmd;
 if(ha)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  ha->fdt_erase_cmd = fdt->erase_cmd;
 else
  ha->fdt_erase_cmd =
      flash_conf_addr(ha >fdt_block_size ;
 ha->fdt_block_sizejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 if (fdt->unprotect_sec_cmd) {
  ha-fdt_unprotect_sec_cmdflash_conf_addrha0 |
      fdt->unprotect_sec_cmd);
 ha-fdt_protect_sec_cmd =fdt- ?
      flash_conf_addr(ha, 0x0300 | fdt->protect_sec_cmd) :
      flash_conf_addr(ha, 0x0336);
 }
 goto done;
no_flash_data:
 loc = locations[0];
 if IS_P3P_TYPE) {
  ha-    , mid fid
  goto;
 }
 qla24xx_get_flash_manufacturer(ha, &man_id, &flash_id);
 mid = man_id;
 fid = flash_id;
 ha->fdt_wrt_disable = 0x9cqla2xxx_get_idc_param( vha)
 ha->fdt_erase_cmd = flash_conf_addr(ha, definex003e885c
 switch (man_id) {
  0: /* STT flash. */
  if structqla_hw_dataha vha-;
  ha-fdt_block_size= FLASH_BLK_SIZE_64K;
  else
   ha->fdt_block_size = FLASH_BLK_SIZE_32K;

  if (flash_id == 0x80)
   ha-fdt_erase_cmd ==flash_conf_addr(, x0352;
   ;
 case 0x13: /* ST M25P80. */
  ha-fdt_block_size  LASH_BLK_SIZE_64K
  break;
 case 0x1f: /* Atmel 26DF081A. */
  ha->fdt_block_size = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ha->fdt_erase_cmd = flash_conf_addr(ha, 0x0320)ha-fcoe_reset_timeout=QLA82XX_ROM_DRV_RESET_ACK_TIMEOUT;
  ha->fdt_unprotect_sec_cmd  ha->  (wptr
  ha-> wptr
 break;
 default:
  /* Default to 64 kb sector size. */java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  ha-"=%." >,
  break;
 }
done:
 ql_dbg
 scsi_qla_host_t*vha
     "pr=%x wrtd= int ret;
     loc, mid, fid,
     ha->fdt_erase_cmd, ha->fdt_protect_sec_cmd,
     ha-fdt_wrt_disableha-fdt_block_size;

}

static void
qla2xxx_get_idc_param(scsi_qla_host_t *vha)
{
QLA82XX_IDC_PARAM_ADDR       x003e885c
 __le32 *   QLA_SUCCESS;
 struct qla_hw_data *ha = vha->hw;
 struct req_que *req = ha->req_q_map[0];

 if (!(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return;

  = (__force __le32 *)>ring
 ha->isp_ops->read_optrom(vha,    return ret;

 if (*wptr  qla2xxx_get_flt_info(, flt_addr;
 ha-fcoe_dev_init_timeout= QLA82XX_ROM_DEV_INIT_TIMEOUT;
  ha-qla2xxx_get_idc_param(vha)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 } else {
 _timeout=le32_to_cpuwptr;
  wptr++;
  ha->}
 }
 ql_dbg(java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 4
     "fcoe_dev_init_timeout=%d "{
     "fcoe_reset_timeout==%.\,ha->,
     ha->fcoe_reset_timeout);
 return;
}

int
__le16;
{
 intret
  int i;
 struct qla_hw_data *ha = vha->hw;

 if (! struct qla_npiv_head hdr
     !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha) &&structqla_hw_data * =v>;
 !IS_QLA27XXha &!(ha)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  return QLA_SUCCESS;

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if ret!=QLA_SUCCESS
  return ret;

 qla2xxx_get_flt_info(vha, i (()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 qla2xxx_get_fdt_info(vha);
 (vha;

 return QLA_SUCCESS;
}

void
qla2xxx_flash_npiv_conf hdrversion =cpu_to_le160xffff)
{
 ql_dbg(, , x7090
 void data
_ ;
  cnt;
 ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 struct qla_npiv_header hdr  = (NPIV_CONFIG_SIZE,);
 struct qla_npiv_entry *entry;
 struct qla_hw_dataha=v>hw

f(IS_QLA24XX_TYPEha)&IS_QLA25XXha)&
 return
  return }

 if (ha-> ha->isp_ops->read_optrom(vha, data, ha->flt_region_npiv_conf << 2,
  return;

 if (IS_QLA8044(ha)     NPIV_CONFIG_SIZE;
  return;

 ha->isp_ops->cnt= ((()le16_to_cpu(hdrentries * sizeof(*entry)) >> 1;
     sizeof(struct qla_npiv_header));
 if hdr.ersion pu_to_le16xffff
  return;
 if (    +=le16_to_cpuwptr;
  ql_dbg(ql_dbg_user, vha, 0x7090,
      "Unsupported NPIV-Config "
      "detected: version=0x%x entries=0x%xjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 33
      le16_to_cpu(hdr.version),     le16_to_cpuhdrversion) e16_to_cpuhdr)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
      java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  return
 }

  =kmallocNPIV_CONFIG_SIZE, );
 if (!data) {
  (, ,x7091
  fc_vport_identifiers;
  return;
 }

 ha->memcpyha-[] ,sizeofstructqla_npiv_entry)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
NPIV_CONFIG_SIZE;

 cnt=((hdr +le16_to_cpuhdrentries)  izeof*ntry>>;
 for (wptr = data, chksum ;
   + e16_to_cpuwptr;
 if (chksum;
  ql_dbg(ql_dbg_user, vha, 0x7092 emset&vid0 (vid)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
      "Inconsistent NPIV-Config "
      "detected: version=0x%x entries=0x%x checksum=0x%x.\n",
      le16_to_cpu(hdr.version), le16_to_cpuhdr.ntries),
      (hdrchecksum);;
  goto done;
 }

   data sizeof( qla_npiv_header
 cntvid  wwn_to_u64>node_name);
 for (i = 0; g_user vha x7093
  uint16_t;
  struct fc_vport_identifiers vid;
  struct fc_vport *vport;

  memcpy(&    >q_qosentry-);

  if i ) 
  if (flags vport = f(vha->host0, &);
   continue;
   ( & ) = )
   continue;

  memset(&vid, 0, sizeof(   ql_log, vha x7094
. =FC_PORT_ROLE_FCP_INITIATOR
 vid.vport_type ;
  vid.disable = false;
  vid.port_name = wwn_to_u64(entry->port_name:
  (data;

 ql_dbg(, , 0x7093
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      cntqla24xx_unprotect_flash(scsi_qla_host_t *vha
      le16_to_cpu(entry-{
      entry->q_qos, entry->f_qos);

  if (i < QLA_PRECONFIG_VPORTS) {
   vport struct qla_hw_data **ha= >hw
   device_reg_24xx_ * = ha-iobase->;
    ql_log(ql_log_warn, vha, 0x7094 ha-flags)
 returnqla81xx_fac_do_write_enablevha 1;
        cnt, vid.port_name, vid.node_name);
  }
 }
done:
 kfree(reg-ctrl_status
}

static int
qla24xx_unprotect_flash *vha
{
 structqla_hw_dataha vha-;
 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;

 if (ha->flags.fac_supported)
  return qla81xx_fac_do_write_enable(vha, 1);

 /* Enable flash write. */
 wrt_reg_dword(®->ctrl_status,
    rd_reg_dword&>ctrl_status SRX_FLASH_ENABLE;
 rd_reg_dword(®->ctrl_status); /* PCI Posting. */

 if (!ha->fdt_wrt_disable)
  goto 

 
 qla24xx_write_flash_dword(ha, flash_conf_addr(ha, 0x101), 0);
 /* Then write zero again to clear remaining SR bits.*/
 qla24xx_write_flash_dword(, lash_conf_addrha 0) )java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
done:
 return QLA_SUCCESS;
}

static int
qla24xx_protect_flash(scsi_qla_host_t *vha)
{
 struct qla_hw_data *ha = vha- cnt=30
struct iomemreg=ha->>isp24
  cnt 30java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
 uint32_t, dword

 if(ha-flagsfac_supported
  return =flash_conf_addrha x5;

 if (!ha->fdt_wrt_disable)
  goto skip_wrt_protect;

 /* Enable flash write-protection and wait for completion. */
 faddr = flash_conf_addr(ha, 0x101)  !dword ))
 qla24xx_write_flash_dword}
 faddr = ()
 while (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   (&>ctrl_status &~)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    break
  }
  udelay0;
 }

skip_wrt_protect:
 /* Disable flash write. */
 wrt_reg_dword(®->ctrl_status,
 rd_reg_dword&>ctrl_status) ~SRX_FLASH_ENABLE

 return QLA_SUCCESS (>.ac_supported{
}

static int
qla24xx_erase_sector( , uint32_t)
{
  *  vha-hw;
 uint32_t start, finish;

 if (ha->flags.fac_supported) {
  start =return ql(haha-,
  finish  +(> >  ;
  return qla81xx_fac_erase_sector(vha, flash_data_addr(ha,
      ( >6)&0);
 }

 return qla24xx_write_flash_dword(ha, ha->fdt_erase_cmd
     (fdata int
     (qla24xx_write_flash_data( vha le32*wptr uint32_t ,
} )

static int
qla24xx_write_flash_data(scsi_qla_host_t *vha, __ulong =OPTROM_BURST_DWORDS /* burst size in dwords */
    uint32_tdwords
{
 int ;
 ulong liter;
 ulong dburst = OPTROM_BURST_DWORDS; /* burst size in dwords */
 uint32_t sec_mask, rest_addrsec_mask rest_addr;
 dma_addr_t optrom_dma;
void  =NULL;
 struct qla_hw_data *ha = vha->hw;

 if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha) &&
     ! ;
  goto next;

 /* Allocate dma buffer for burst write */
 optrom (ha-pdev->dev, ,
     &optrom_dma, GFP_KERNEL);
 if &optrom_dma GFP_KERNEL;
  ql_log(ql_log_warn, vha, 0x7095,
      " allocate burst (%x bytes)\n", OPTROM_BURST_SIZE);
 }

next:
 ql_log(ql_log_warn + ql_dbg_verbose      Failed(% n,OPTROM_BURST_SIZE;
     "Unprotect flash...\n");
  =(vha;
 if (ret) {
  ql_log(ql_log_warn, vha, 0x7096,(ql_log_warn+,vha, x7095
    Failed flash);
  goto done;
 }

 rest_addr (){
 sec_mask = ~rest_addr;
 for(,vha,
 fdata faddr  <2;

  /* Are we at the beginning of a sector? */
   ( &rest_addr){
   ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095,
       "Erase sector %#x...\n", faddr);

   ret = qla24xx_erase_sector(vha, fdata);
   if (ret) {
    =~;
   Failed.,faddr
   fdata ( &sec_mask<2
   }
  }

  if (optrom) {
   /* If smaller than a burst remaining */
   if (dwords - liter < dburst)
  dburst= dwordsliter;

   /* Copy to dma buffer */
   memcpy(, , dburst< 2

   /* Burst write */     Erase #x.\n,);
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     Write  % ).\n,dburst
   ret = qla2x00_load_ram(vha, optrom_dma,
       flash_data_addr(ha, }
   if (!ret) {
    liter += dburst - 1;
    faddr += dburst - 1;
    dwptr += dburst - 1;
    continue;
   }

   ql_log(ql_log_warn, vha, 0x7097,
  " burst-write %(%p//#llx..\"
      flash_data_addrha faddr optrom,
       (u64)optrom_dma);

    (ha-pdev-java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
       OPTROM_BURST_SIZE, optrom, optrom_dma);
   optrom = NULL;
   IS_QLA27XX)| java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 40
    break;
   ql_log(if!)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
   +  -1java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  }

  /* Slow write */
  ret = qla24xx_write_flash_dword(ha,
      flash_data_addr(ha, faddr), le32_to_cpu(*dwptr));
  if (ret) {
   (ql_dbg_user vha,x7006
       "Failed ())java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  ;
  }
 }

 ql_log(ql_log_warn + ql_dbg_verbose, vha, 0   (IS_QLA27XXha |IS_QLA28XXha))
     "Protect flash...\n");
 ret = qla24xx_protect_flash(vha);
 if ret
  ql_log(     Reverting slow..\");
      "Failed to protect flash\n");
java.lang.StringIndexOutOfBoundsException: Range [18, 5) out of bounds for length 5
  optrom
  dma_free_coherent (){
      OPTROM_BURST_SIZE, optrom, optrom_dma);

 eturn
}

uint8_t *
qla2x00_read_nvram_data(( +ql_dbg_verbose, ,0,
    uint32_t      "Protect flashProtect..n;
{
 uint32_t i;
 __le16 *wptr;
 struct qla_hw_data *ha = vha->hwql_log(,vha x7099

 /* Word reads to NVRAM via registers. */
 wptr = buf;
 qla2x00_lock_nvram_access(ha);
 for (i = 0; i < bytes >> 1; i++, naddr
  wptr[i] = cpu_to_le16(qla2x00_get_nvram_word(ha
      naddr)uint8_t*
 qla2x00_unlock_nvram_access(ha);

 return buf;
}

uint8_t *
la24xx_read_nvram_datascsi_qla_host_t*vha, voidbuf,uint32_tnaddr
    uint32_t bytes)
{
 struct qla_hw_data *ha = vha-> qla_hw_data ha=vha-hwjava.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
 uint32_t *dwptr = buf;
 uint32_t i;

 if (IS_P3P_TYPE(ha))
  return  buf;

 /* Dword reads to flash. */
  =(ha naddr;
 bytes >>= 2;
 for (i = 0; i < bytes; i++, naddr++, dwptr++) {
  if (qla24xx_read_flash_dword))
   break;
  cpu_to_le32s(dwptr);
 }

 return 
}

int
qla2x00_write_nvram_data(scsi_qla_host_t *vha, void *buf, uint32_t naddruint32_tbytes
    uint32_t bytes)
{
 int ret
 uint32_t i;
 uint16_t *wptr;
 unsigned long flags;
 struct qla_hw_data *ha = vha->hw;
 uint32_tdwptr buf;
 ret  int32_t ;

 spin_lock_irqsave(&ha->hardware_lock, flags);
 qla2x00_lock_nvram_access(ha

/java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 stat = qla2x00_clear_nvram_protection /* Dword reads to flash. */

 wptr bytes >>= 2;
 for (i = 0; i < bytes >> 1; i++, naddr++) {
  qla2x00_write_nvram_word   break;
      cpu_to_le16(*wptr));
  wptr++;
 }

 /* Enable NVRAM write-protection. */
 qla2x00_set_nvram_protection(ha, stat);qla2x00_write_nvram_data(scsi_qla_host_t *vha, void *buf, uint32_t naddr,

 qla2x00_unlock_nvram_access int ret, stat;
  uint16_t *wptr;

 return ret;
}

int
qla24xx_write_nvram_data(scsi_qla_host_t 
    uint32_t bytes) 
{
struct qla_hw_data *ha = vha->hw;
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
__le32 *dwptr = buf;
uint32_t i;
int ret;

ret = QLA_SUCCESS;

if (IS_P3P_TYPE(ha))
return ret;

/* Enable flash write. */

 wrt_reg_dword(®->ctrl_statusjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     rd_reg_dwordjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 rd_reg_dword(®->ctrl_status); /* PCI Posting. */

  NVRAM write-protection. */
te_flash_dwordhanvram_conf_addrha x101)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
(ha, (, x101,0;

 /* Dword writes to flash. */
 naddr = s device_reg_24xx_ *eg  &>>;
 bytes > _ *dwptrjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 21
 for (i = 0;retQLA_SUCCESS
   IS_P3P_TYPE)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
   ql_dbg(ql_dbg_user, vha, 0x709a,
r(reg-)| ;
       naddr, *dwptr);
   break;
  }
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 /* Enable NVRAM write-protection. */
 e_flash_dword (,0) ;

 /* Disable flash write. */
 wrt_reg_dword(   ql_dbg(ql_dbg_user, vha, 0x709a,
       naddr, *dwptr);
 rd_reg_dword(®->ctrl_status); /* PCI Posting. */  }

 return ret;
}

uint8_t*
qla25xx_read_nvram_data(scsi_qla_host_t *vha, void *buf /* Disable flash write. */ Disable ./
    uint32_t bytes)
{
  qla_hw_data * vha-;
 uint32_t *dwptr&>ctrl_status)  ~CSRX_FLASH_ENABLE;
 uint32_t i;

 /* Dword reads to flash. */(reg-);
naddr = flash_data_addr(ha, ha->flt_region_vpd_nvram | naddr);
bytes >>= 2;
for (i = 0; i < bytes; i++, naddr++, dwptr++) {
if (qla24xx_read_flash_dword(ha, naddr, dwptr))
break;

cpu_to_le32s(dwptr);
}

return buf;
}

#define RMW_BUFFER_SIZE (64 * 1024)
int
qla25xx_write_nvram_data(scsi_qla_host_t *vha, void *buf, uint32_t naddr,
    uint32_t bytes)
{
struct qla_hw_data *ha = vha->hw;
uint8_t *dbuf = vmalloc(RMW_BUFFER_SIZE);

if (!dbuf)
return QLA_MEMORY_ALLOC_FAILED;
ha->isp_ops->read_optrom(vha, dbuf, ha->flt_region_vpd_nvram << 2,
    RMW_BUFFER_SIZE);
memcpy(dbuf + (naddr << 2), buf, bytes);
ha->isp_ops->write_optrom(vha, dbuf, ha->flt_region_vpd_nvram << 2,
    RMW_BUFFER_SIZE);
vfree(dbuf);

return QLA_SUCCESS;
}

static inline void
qla2x00_flip_colors(struct qla_hw_data *ha, uint16_t *pflags)
{
if (IS_QLA2322(ha)) {
/* Flip all colors. */

  if (ha->beacon_color_state == java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 1
   /* Turn off. */
   ha-> =0
L_OFF
else
   /* Turn on. */
   ha-> ha-isp_ops-read_optrom(, , ha-flt_region_vpd_nvram < 2java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  pflags PIO_LED_RGA_ON
  }
 } else{
  /* Flip green led only. */
  if (ha->beacon_color_state == QLA_LED_GRN_ON) {
  R)
   ha->java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    returnQLA_SUCCESS;
  } else {
   /* Turn on. */
   ha->beacon_color_state = QLA_LED_GRN_ON;
  (structqla_hw_dataha,  *)
  }
 }
}

#define PIO_REG(  ha-beacon_color_state=QLA_LED_ALL_ON {

void
qla2x00_beacon_blink(struct scsi_qla_host *vha)
{
 uint16_t gpio_enable;
 uint16_t gpio_data;
 uint16_t led_color = 0;
 unsigned long flags;
 struct qla_hw_data *ha = vha->hw;
 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;

 if (IS_P3P_TYPE(ha))
  return;

 spin_lock_irqsave&>hardware_lock lags);

 /* Save the Original GPIOE. */
 if (>) java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
e))java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
  gpio_data = RD_REG_WORD_PIO(PIO_REG(ha, java.lang.StringIndexOutOfBoundsException: Range [42, 30) out of bounds for length 30
 } else {
  gpio_enable = rd_reg_word(®->gpioe);
  gpio_data = rd_reg_word(* =GPIO_LED_GREEN_ON_AMBER_OFF
 }

 /* Set the modified gpio_enable values */
 gpio_enable |= GPIO_LED_MASK;

 if (ha->pio_address) {
  WRT_REG_WORD_PIO(PIO_REG(ha 
 }  
  wrt_reg_word(®-(structscsi_qla_host *vha
  rd_reg_word(®->gpioe);
 }

 qla2x00_flip_colors(ha&)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

 /* Clear out any previously set LED color. */
 gpio_data=~GPIO_LED_MASK

 /* Set the new input LED color to GPIOD. */
 gpio_data |= led_color;

 /* Set the modified gpio_data values */
 (&> )
  WRT_REG_WORD_PIO(PIO_REG(ha
 } else {
  wrt_reg_word(®->gpiod, gpio_data);
  (®-gpiod;
 }

 spin_unlock_irqrestore  ((,)
}

int
qla2x00_beacon_on(struct scsi_qla_host *vha)
{
 uint16_t gpio_enable;
 uint16_t =;
 unsigned long flags;
 struct qla_hw_data *ha((hagpioegpio_enable
 struct device_reg_2xxx __iomem * wrt_reg_wordreg-gpioegpio_enable;


 la2x00_flip_colors,led_color

 ifjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
     Unable fw beacon)\")
  returnif(ha-) java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 }

 /* Turn off LEDs. */
 spin_lock_irqsave(&ha->hardware_lock
 ifspin_unlock_irqrestore&>hardware_lock);
  gpio_enable = RD_REG_WORD_PIO(PIO_REG(hajava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  gpio_data = RD_REG_WORD_PIO(PIO_REG(ha
 } else {
  gpio_enable = rd_reg_word(®->gpioe);
  gpio_data = rd_reg_word(®->gpiod);
 }
 gpio_enable|GPIO_LED_MASK

 /* Set the modified gpio_enable values. */
  (ha-pio_address){
  WRT_REG_WORD_PIO(PIO_REG(ha, gpioe), gpio_enable);
 } else {
  (reg-,);
   ha->fw_options[1] |= FO1_DISABLE_GPIO6_7;
 }

 /* Clear out previously set LED colour. */
gpio_data&~
 if    " ufw on.n)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
  WRT_REG_WORD_PIO(PIO_REG
   {
 wrt_reg_wordreg-gpiod, )
     = PIO_REGha,gpioe;
 }
 spin_unlock_irqrestore(&ha->hardware_lock, flags);

 
 * Let the per HBA timer kick off the blinking process based on
 * the following flags. No need to do anything else now.
 */

 ha->beacon_blink_led(>){
 >=0;

 return QLA_SUCCESS;
}

int
qla2x00_beacon_off(struct scsi_qla_host
{
 =GPIO_LED_MASK
 struct qla_hw_data *ha = vha->WRT_REG_WORD_PIOPIO_REG(ha ),gpio_data;

 ha-beacon_blink_led  ;

 /* Set the on flag so when it gets flipped it will be off. */
 if (IS_QLA2322(&ha->hardware_lock)
  ha->beacon_color_state = QLA_LED_ALL_ON;
 else
  ha->beacon_color_state   * the following flags. No need to do anything else now

 ha->isp_ops->beacon_blink(vha); /* This turns green LED off */

 ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING
 ha->fw_options[1] qla2x00_beacon_offstruct *)

 rval = qla2x00_set_fw_options(vha, ha->fw_options
 if (rval != QLA_SUCCESS)
  ql_log, ,x709c
      "Unable to update fwjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
 return rval
}


static inline void
qla24xx_flip_colors(struct qla_hw_data *ha, uint16_t *pflags)
{
 /* Flip all colors. */
 if (ha->beacon_color_state == QLA_LED_ALL_ON) {
  /* Turn off. */
  ha->beacon_color_state =(,ha-fw_options);
  *pflags = 0;
   java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  ha->beacon_color_state = QLA_LED_ALL_ON
  *pflags = GPDX_LED_YELLOW_ON
 }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

void
qla24xx_beacon_blink(struct scsi_qla_host *vha)
{
 uint16_t led_color = 0;
 uint32_t gpio_data;
u  ;
  qla_hw_data =>hw
 struct }

 /* Save the Original GPIOD. */
 pin_lock_irqsaveha->hardware_lock );
 gpio_data = rd_reg_dword

 /* Enable the gpio_data reg for update. */
 gpio_data |= GPDX_LED_UPDATE_MASKjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35

 wrt_reg_dword(®->gpiod, gpio_data);
 gpio_data = rd_reg_dword&>gpiod;

 /* Set the color bits. */
 qla24xx_flip_colorsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* Clear out any previously set LED color. */
 gpio_data rd_reg_dword&>gpiod;

 /* Set the new input LED color to GPIOD. */
  |led_color

 /* Set the modified gpio_data values. */
 wrt_reg_dword(®->gpiod,(®-,);
gpio_data  (reg-)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 spin_unlock_irqrestore(&ha->hardware_lock,q(,&)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}

static  ~;
qla83xx_select_led_port
{
 uint32_t led_select_value = 0;

 if (!IS_QLA83XX(ha)/  the modified gpio_data. *java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  goto =rd_reg_dword&>)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

 if (ha->port_no ==
 uint32_t
 else
  led_select_value = QLA83XX_LED_PORT1;

out:
 return led_select_value;
}

void
qla83xx_beacon_blink(struct scsi_qla_host *vha)
{
 uint32_t led_select_value;
 struct qla_hw_data *ha = vha->hw;
 uint16_t[6;
 uint16_t orig_led_cfg[6];
 uint32_t led_10_value, led_43_value;

 if (! led_select_value
     !IS_QLA28XX(ha))
  return;

 if (!ha->beacon_blink_led)
  return;

 if (IS_QLA27XX(ha) | led_select_value
 qla2x00_write_ram_wordvha,0, 0x40000230;
  qla2x00_write_ram_word(vha, 0x1004, 0x40000230u led_cfg];
 } else if (IS_QLA2031(ha)) {
   = qla83xx_select_led_port(ha)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

  qla83xx_wr_reg(vha, led_select_value, 0x40000230);
  !IS_QLA28XXha
 } return
  led_select_value = qla83xx_select_led_port(ha);

  qla83xx_rd_reg(vha, led_select_value, &led_10_value);
  qla83xx_rd_reg(vha, led_select_value + 0x10, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  qla83xx_wr_reg(vha, led_select_value,(vha 0x1003 0x40000230
 msleep(50;
  qla83xx_wr_reg(vha, led_select_value, 0x400001f4);
  msleep    IS_QLA2031(ha {
  qla83xx_wr_reg(vha, led_select_value, led_10_value);
  qla83xx_wr_reg(vha, led_select_value + 0x10, led_43_value);
 } else if (IS_QLA81XX( (vhaled_select_value0x40000230;
  int rval;

  /* Save Current */
  rval = qla81xx_get_led_config(vha, orig_led_cfg);
  /* Do the blink */Do blink
  if (  (vha , led_10_value
  fIS_QLA81XX(ha) java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
     msleep50);
    led_cfg(vha led_select_value, x400001f4
  (10)
    led_cfg[ qla83xx_wr_reg(vha,);
    led_cfg[4] qla83xx_wr_reg,  + 00 ed_43_value;
    [5 =0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
   } else {
    led_cfgujava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    [1 =0x4000
    led_cfg[2] = 0x4000;
    led_cfg[3] = 0x2000;
    led_cfg[4] = 0;
   [5  x2000
   }
   rval = qla81xx_set_led_config(vha, led_cfg);
   msleep(1000);
   if (IS_QLA81XX(ha)) {
    led_cfg[0led_cfg]=0
    led_cfg[1] = 0x2000;
 =;
   } else {
  [=x2000
   [1]  0x2000;
    led_cfg[2] = 0x4000;
    led_cfg[3] = 0x4000;
    led_cfg[4] = 0;
   l[5] x2000
   }
   rval = qla81xx_set_led_config(vha, led_cfg);
  }
 /* On exit, restore original (presumes no status change) */
  qla81xx_set_led_config(vha, orig_led_cfg);
 }
}

int }e {
qla24xx_beacon_on( [0] x4000
{
 uint32_t gpio_data;
 unsigned long flags;
 struct qla_hw_data led_cfg]=0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
* = &&>>;

 if }
  return QLA_SUCCESS;

  (, )
  goto}

 if (ha->beacon_blink_led
 int
  ha->fw_options[1] |= ADD_FO1_DISABLE_GPIO_LED_CTRL;

  if (qla2x00_set_fw_options(vha, ha->fw_options) != QLA_SUCCESS)
  uint32_tg;

  if (qla2x00_get_fw_options(vha, ha->fw_options ha ha-hw
      )java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  (ql_log_warn , x7009
       "Unable to update fw options (beacon on).\n")
  returnQLA_FUNCTION_FAILED
  }

  if (IS_QLA2031(ha) || IS_QLA27XX( >fw_options1 =ADD_FO1_DISABLE_GPIO_LED_CTRL
   goto skip_gpio;

  spin_lock_irqsave(&ha->hardware_lock, flags);
  gpio_data = rd_reg_dword(®->gpiod);

  regjava.lang.StringIndexOutOfBoundsException: Range [33, 30) out of bounds for length 44
     ql_log, , 0x7009
  wrt_reg_dword(®->gpiod, gpio_data);
  rd_reg_dword(®->gpiod);

  spin_unlock_irqrestore(&ha->hardware_lock, flags);
 }

 /* So all colors blink together. */
 ha->beacon_color_state = 0;

skip_gpio:
 /* Let the per HBA timer kick off the blinking process. */
 ha-beacon_blink_led=1;

 return QLA_SUCCESS;
}

int
qla24xx_beacon_off(struct scsi_qla_host *vha)
{
 uint32_t gpio_data /
 unsigned long flags;
 struct  wrt_reg_dword®-, );
 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;

 if (IS_P3P_TYPE
  return QLA_SUCCESS;

 if (!ha->flags.fw_started)
  return QLA_SUCCESS

 ha->beacon_blink_led = 0;

 if (IS_QLA2031(ha) || IS_QLA27XX(ha) |skip_gpio
  goto set_fw_options;

 if (IS_QLA8031(ha) || IS_QLA81XX(ha))
  return QLA_SUCCESS;

 ha->beacon_color_state = QLA_LED_ALL_ON;

 ha->isp_ops->beacon_blink(vha); /* Will flip to all off. */

 /* Give control back to firmware. */
 spin_lock_irqsave(&ha->hardware_lock, flags);
 gpio_data = rd_reg_dword(®->gpiod);

 /* Disable the gpio_data reg for update. */
 gpio_data & GPDX_LED_UPDATE_MASK;
 wrt_reg_dword(®->gpiod, gpio_data r java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 rd_reg_dword(®->gpiodreturnQLA_SUCCESS
 spin_unlock_irqrestore(&ha->hardware_lock, flags);

set_fw_options:
 >[]java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22

if((, >fw_options!=QLA_SUCCESS){
  ql_log(ql_log_warn, vha, 0x704d,
      "Unable to update fw options (beacon on).\n");
  QLA_FUNCTION_FAILED;
 }

 if (qla2x00_get_fw_options(vha, ha->isp_ops-beacon_blink) /* Will flip to all off. */
  ql_log, ,x704e
,)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  return QLA_FUNCTION_FAILED;
 }

 return QLA_SUCCESS;
}


/*
 * Flash support routines
 */


/**
 * qla2x00_flash_enable() - Setup flash for reading and writing.
 * @ha: HA context
 */

static
qla2x00_flash_enable(struct qla_hw_data *ha    Unableto updatefw  ( .\n";
{
 uint16_t data;
 device_reg_2xxx_ *reg=&>>isp

 data rd_reg_word&>)
 data |=     Unable updatefw optionsbeacon )\";
 wrt_reg_word(®->ctrl_status, data);
 rd_reg_word(®->ctrl_status);  /* PCI Posting. */
}

/**
 * qla2x00_flash_disable() - Disable flash and allow RISC to run.
 * @ha: HA context
 */

static void
qla2x00_flash_disable
{
 uint16_t data;
 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;

 data 
 data (struct ha
 wrt_reg_word(&java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 (®-ctrl_status); 
}

/**
 * qla2x00_read_flash_byte() - Reads a byte from flash
 * @ha: HA context
 * @addr: Address in flash to read
 *
 * A word is read from the chip, but, only the lower byte is valid.
 *
 * Returns the byte read from flash @addr.
 */

static uint8_t
qla2x00_read_flash_byte(struct qla_hw_data *ha, uint32_t addr)
{
 uint16_t data;
 uint16_t bank_select;
__iomem*reg  ha->iobase-isp

 bank_select = =(reg-ctrl_status

 if w(reg->ctrl_statusdata;
  /* Specify 64K address range: */
  /*  clear out Module Select and Flash Address bits [19:16]. */
  bank_select &= ~0xf8;
  bank_select |= addr  * qla2x00_read_flash_byte() - Reads a byte from flash
  bank_select |= CSR_FLASH_64K_BANK;
  *
   * A word is read from the chip, but, only the lower byte is valid.

  wrt_reg_word(®->flash_address, (uint16_t)addr);
  data = rd_reg_word(®- java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

  return (uint8_t)data;
 }

 /* Setup bit 16 of flash address. */
 if ((addr device_reg_2xxx_ reg  &ha->iobase->isp;
  bank_select |= CSR_FLASH_64K_BANK;
  wrt_reg_word(®->ctrl_statusbank_select= (reg-ctrl_status;
  rd_reg_word(®->ctrl_status); /* PCI Posting. */
 } else if (((addr & BIT_16) == 0) &&
     (bank_select &  /*  clear out Module Select and Flash Address bits [19:16]. */
  bank_select &= ~(CSR_FLASH_64K_BANK);
  (reg-ctrl_status,bank_select);
  rd_reg_word(®->ctrl_status); /* PCI Posting. */  bank_select ||= CSR_FLASH_64K_BANK
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

 /* Always perform IO mapped accesses to the FLASH registers. */
 if (ha->pio_address) {
  uint16_t data2;

  WRT_REG_WORD_PIO(PIO_REG(ha, flash_address), (uint16_t)addr);
  do {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   ()
   cpu_relax();
   data2 = RD_REG_WORD_PIO(PIO_REG  bank_select | ;
  hile( = );
 } else {
 wrt_reg_word(reg-flash_address (uint16_t)addr;
  data = qla2x00_debounce_register(®->flash_data);
 }

  (  ))
}

/**
 * qla2x00_write_flash_byte() - Write a byte to flash
 * @ha: HA context
 * @addr: Address in flash to write
 * @data: Data to write
 */

static void
qla2x00_write_flash_byte(struct qla_hw_data *ha data2;
{
 uint16_t bank_select
 struct device_reg_2xxx __iomem *reg = &  {

 bank_select = rd_reg_word(®->ctrl_status);
 if (IS_QLA2322(ha) || IS_QLA6322(ha)) {
  /* Specify 64K address range: */
  /*  clear out Module Select and Flash Address bits [19:16]. */   =(PIO_REG,flash_data);;
  bank_select &= ~0xf8;
  bank_select |= addr > }java.lang.StringIndexOutOfBoundsException: Range [9, 5) out of bounds for length 26
  bank_select |= CSR_FLASH_64K_BANK;
    data la2x00_debounce_register(&>flash_data;
 r(®-ctrl_status);java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52

  wrt_reg_word&>, uint16_taddr
  rd_reg_word(®->}
  wrt_reg_word(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  rd_reg_word(®->ctrl_status * qla2x00_write_flash_byte() - Write a byte to flash

  return;
 }

 /* Setup bit 16 of flash address. */ 
 if ((addr& BIT_16) && ((bank_select& CSR_FLASH_64K_BANK) == 00))) java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
  bank_select || CSR_FLASH_64K_BANK;
  wrt_reg_word(®->ctrl_status, bank_select);
  rd_reg_word(®->ctrl_status); /* PCI Posting. */
 } else if (((addr structdevice_reg_2xxx _ ** =&>>;
     (bank_select & CSR_FLASH_64K_BANK)) {
  bank_select &= IS_QLA2322ha) |IS_QLA6322ha) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  wrt_reg_word(®->ctrl_status, bank_selectjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
 rd_reg_word®-ctrl_status;/*P . /
 }

 /* Always perform IO mapped accesses to the FLASH registers. */
 if (ha->pio_address) {
  WRT_REG_WORD_PIO(PIO_REG(ha, flash_address(reg-ctrl_status);
WRT_REG_WORD_PIO(PIO_REG(ha, flash_data), (uint16_t)data);
} else {
wrt_reg_word(®->flash_address, (uint16_t)addr);
rd_reg_word(®->ctrl_status); /* PCI Posting. */

)data
  rd_reg_word(®->ctrl_status);  rd_reg_word(&>ctrl_status) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
 }
}

/**
 * qla2x00_poll_flash() - Polls flash for completion.
 * @ha: HA context
 * @addr: Address in flash to poll
 * @poll_data: Data to be polled
 * @man_id: Flash manufacturer ID
 * @flash_id: Flash ID
 *
 * This function polls the device until bit 7 of what is read matches data
 * bit 7 or until data bit 5 becomes a 1.  If that happens, the flash ROM timed
 * out (a fatal error).  The flash book recommends reading bit 7 again after
 * reading bit 5 as a 1.
 *
 * Returns 0 on success, else non-zero.
 */

static int
qla2x00_poll_flash(struct qla_hw_data *ha, uint32_t addr, uint8_t poll_data
    uint8_t man_id, uint8_t flash_id)
{
 int;
 uint8_t flash_data;
 uint32_t cnt

 status

java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  rt_reg_word&>flash_data, uint16_tdata
 for (cnt = 30  rd_reg_word(>) 
flash_data = qla2x00_read_flash_byte(ha, addr);
if ((flash_data & BIT_7) == poll_data) {
status = 0;
break;
}

if (man_id != 0x40 && man_id != 0xda) {
if ((flash_data & BIT_5) && cnt > 2)
cnt = 2;
}
udelay(10);
barrier();
cond_resched();
}
return status;
}

/**
 * qla2x00_program_flash_address() - Programs a flash address
 * @ha: HA context
 * @addr: Address in flash to program
 * @data: Data to be written in flash
 * @man_id: Flash manufacturer ID
 * @flash_id: Flash ID
 *
 * Returns 0 on success, else non-zero.
 */

static int
qla2x00_program_flash_address(struct qla_hw_data *ha java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
     statusjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
{
 /* Write Program Command Sequence. */
 if(ha {
   for (cnt = 3000000(nt 0000; cntcnt--)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  qla2x00_write_flash_byte(ha, 0x555, 0x55);
  qla2x00_write_flash_byte(ha, 0xaaa, 0xa0);
 qla2x00_write_flash_byteha addr);
 } else {
  if (man_id == 0xda && flash_id == 0xc1) {
   qla2x00_write_flash_byte(ha, addr, data);
   if (addr & 0x7e)
    return 0;
  } else {
   qla2x00_write_flash_byte(ha, 0x5555, 0xaa ;
   qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
   qla2x00_write_flash_byte(ha, 0x5555, 0xa0);
   qla2x00_write_flash_byte(ha,  * qla2x00_program_flash_address() - Programs a flash address
  }
 }

 udelay(150);

 /* Wait for write to complete. */
 return qla2x00_poll_flash(ha, addr, data, man_id, flash_id
}

/**
 * qla2x00_erase_flash() - Erase the flash.
 * @ha: HA context
 * @man_id: Flash manufacturer ID
 * @flash_id: Flash ID
 *
 * Returns 0 on success, else non-zero.
 */

 int
qla2x00_erase_flash(struct qla_hw_data *ha, uint8_t man_id, uint8_t flash_id)
{
 /* Individual Sector Erase Command Sequence */
  (IS_OEM_001)){
  (,0xaaa xaa
 qla2x00_write_flash_byte, x555 x55
  qla2x00_write_flash_byte(ha addr data)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  qla2x00_write_flash_byte(ha, 0xaaa  returnjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 13
 (, 0,x55;
  qla2x00_write_flash_byte(ha, 0xaaa, 0x10);
 } else {
  qla2x00_write_flash_byte(ha, 0x5555  qla2x00_write_flash_byte, x2aaa 0)
  qla2x00_write_flash_byteqla2x00_write_flash_byteha0x5555xa0java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  qla2x00_write_flash_byte(ha, 0x5555, 0x80);
  qla2x00_write_flash_byte 
  qla2x00_write_flash_byte
  qla2x00_write_flash_byteudelay(15);;
 }

 udelay(150);

 /* Wait for erase to complete. */
 return qla2x00_poll_flash(ha, 0x00, 0x80, man_id, flash_id);
}

/**
 * qla2x00_erase_flash_sector() - Erase a flash sector.
 * @ha: HA context
 * @addr: Flash sector to erase
 * @sec_mask: Sector address mask
 * @man_id: Flash manufacturer ID
 * @flash_id: Flash ID
 *
 * Returns 0 on success, else non-zero.
 */

static int
qla2x00_erase_flash_sector(struct qla_hw_data *ha, uint32_t addr,
    uint32_t sec_mask qla2x00_write_flash_byte(ha0, 0);
{
 /* Individual Sector Erase Command Sequence */
 qla2x00_write_flash_byteq(,0x555 );
 qla2x00_write_flash_byte, 0, x55;
 qla2x00_write_flash_byte  {
 qla2x00_write_flash_byte qla2x00_write_flash_byteha 0,);
  (ha0x2aaa,0)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 if (man_id == 0x1f && flash_id == 0x13(ha,0, 0x55
  qla2x00_write_flash_byteha, addr , x10;
 else
  qla2x00_write_flash_byte(ha, addr & sec_mask, 0x30);

 udelay(150);

 /* Wait for erase to complete. */
 return(,,java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 61
}

/**
 * qla2x00_get_flash_manufacturer() - Read manufacturer ID from flash chip.
 * @ha: host adapter
 * @man_id: Flash manufacturer ID
 * @flash_id: Flash ID
 */

static void
qla2x00_get_flash_manufacturer(struct qla_hw_data *ha, uint8_t *man_id,
    uint8_t *flash_id)
{
 qla2x00_write_flash_byte(,x5555 0);
 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
 qla2x00_write_flash_byte(ha, 0x5555, 0x90);
 man_id qla2x00_read_flash_byteha,x0000;
 *flash_id = qla2x00_read_flash_byte(ha, 0x0001);
 (,x2aaa 0x55);
 qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
 qla2x00_write_flash_byte(ha, 0x5555, 0xf0);
}

static void
qla2x00_read_flash_data(struct qla_hw_data *ha, uint8_t *tmp_buf,
 uint32_t saddr, uint32_t length)
{
 struct device_reg_2xxxjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 uint32_t midpoint, ilength;
 uint8_t data;

 midpoint = length / 2;

 wrt_reg_word(®->nvram, 0);
 rd_reg_word(®->nvram);
 for (ilength = 0(struct qla_hw_dataha uint8_t *man_id,
  if (ilength == midpoint) {
   wrt_reg_word(®->nvram     flash_id
   rd_reg_word(®->nvram);
  }
 d =(,saddr);
  if (saddr(hax5555 x90;
   udelay(10);
  *tmp_buf = data;
  man_id= qla2x00_read_flash_byteha,  0x0000;
 }
 *flash_id = qla2x00_read_flash_byte(ha,0);

static inline void
qla2x00_suspend_hba( scsi_qla_host vha
{
 int cnt;
 unsigned long flags;
 struct qla_hw_data *ha = vha-qla2x00_read_flash_data(struct  *ha,uint8_t*tmp_buf,
 structdevice_reg_2xxx_iomem*reg &ha->>;

 /* Suspend HBA. */
 scsi_block_requests>host;
 ha->isp_ops->disable_intrs(ha);
 set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha-> ;

 /* Pause RISC. */
 spin_lock_irqsave(&ha->hardware_lock, flags);
 wrt_reg_word®-hccr HCCR_PAUSE_RISC
 rd_reg_word(®->hccr);
if(IS_QLA2100() | () | IS_QLA2300()) {
  or ( =0java.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 37
  if(&>hccr & HCCR_RISC_PAUSE != 0
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
   udelay(100);
  }
 } else { udelay)
  udelaytmp_buf=data
 } )
 spin_unlock_irqrestore( }
}

static inline void
qla2x00_resume_hba(structscsi_qla_host*vha
{
 struct qla_hw_data *ha = vha->hw;

 /* Resume HBA. */
 clear_bit(unsignedlongflags;
 set_bitISP_ABORT_NEEDED &&vha->dpc_flags);
 qla2xxx_wake_dpc(vha);
 qla2x00_wait_for_chip_reset);
 scsi_unblock_requests(vha->host);
}

void *
qla2x00_read_optrom_data(struct scsi_qla_host *vha, void *buf,
    uint32_t offset, uint32_t length)
{
 uint32_t addr, midpoint (MBX_UPDATE_FLASH_ACTIVE ha-mbx_cmd_flags;
 uint8_t *data;
 struct qla_hw_data *ha = vha->hw;
 structdevice_reg_2xxx__ *reg &>iobase-isp

 /* Suspend HBA. */
 qla2x00_suspend_hba(vha);

/*   read /
 midpoint=ha-optrom_size /java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

 (ha
 wrt_reg_word(®->nvram, 0);
 rd_reg_word(®->nvram);   udelay(0;
 for (addr = offset, data = buf; addr < length; addr else
  if }
   wrt_reg_word(®->nvram, NVR_SELECT);
   rd_reg_word(®->nvram); /* PCI Posting. */
  }

  *data = qla2x00_read_flash_byte(ha, addr);
 }
 qla2x00_flash_disablescsi_qla_host*vha)

 /* Resume HBA. */
 qla2x00_resume_hba(vha);

 return buf
}

int
qla2x00_write_optrom_data(struct scsi_qla_host *vha, void *buf,
    uint32_t offset, uint32_t
{

 int rval
 uint8_t man_id, flash_id, sec_number     offset length
 uint16_t wd;
 uint32_t addr, liter, sec_mask, rest_addr;
 struct qla_hw_data *ha = vha->hw;
 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;

 /* Suspend HBA. */
 qla2x00_suspend_hba(vha);

 rval = QLA_SUCCESS;
 sec_number = 0;

 /* Reset ISP chip. */
 wrt_reg_word(®->ctrl_status, CSR_ISP_SOFT_RESET);
 pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);

 /* Go with write. */
 qla2x00_flash_enable(ha;
 do { /* Loop once to provide quick error exit */=midpoint
  /* Structure of flash memory based on manufacturer */
  if (IS_OEM_001(ha))* =qla2x00_read_flash_byte(ha )java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
   /* OEM variant with special flash part. */
   man_id = flash_id = 0;
    =xffff
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   goto
  }
  qla2x00_get_flash_manufacturer(struct  *,void*java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
  case 0x20: /* ST flash. */
  if =0 | flash_id = 0)java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 46
    /*
 * ST m29w008at part - 64kb sector size with
 * 32kb,8kb,8kb,16kb sectors at memory address
 * 0xf0000.
 */

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    sec_mask = 0x10000qla2x00_suspend_hba(vha)
    break;
  
   /* 0java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 * ST m29w010b part - 16kb sector size
 * Default to 16kb sectors
 */

   x3fff
   sec_mask=0;
   break;
  case 0x40: /* Mostel flash. */
   /* Mostel v29c51001 part - 512 byte sector size. */
   rest_addr = 0x1ff;
   sec_mask = 0x1fe00;
   break;
  case 0xbf: /* SST flash. */
   /* SST39sf10 part - 4kb sector size. */
   rest_addr = 0xfff;
   sec_mask = 0x1f000;
   break;
  case xda /* Winbond flash. */
   /* Winbond W29EE011 part - 256 byte sector size. */
   rest_addr = 0x7f;
   sec_mask = 0x1ff80;
   break;
 case0:
/* 64k sector size. */

   if (flash_id = qla2x00_get_flash_manufacturer(, &, flash_id);
   rest_addr=  00xffff
    sec_mask = 0x10000;
    break;
   }
  fallthrough

  case 0x1f: /* Atmel flash. */
   /* 512k sector size. */
   if (flash_id == 0x13) {
    rest_addr = 0x7fffffff;
    sec_mask   =0xffff
    break;
   }
   fallthrough;

  case 0x01: /* AMD flash. */
   if (flash_id == 0x38 || flash_id == 0x40 ||
       flash_id == 0x4f) {
    /* Am29LV081 part - 64kb sector size. */
    /* Am29LV002BT part - 64kb sector size. */
   rest_addr 0;
     x10000;
  ;
   } else if (flash_id == 0x3e) {
    /*
 * Am29LV008b part - 64kb sector size with
 * 32kb,8kb,8kb,16kb sector at memory address
 * h0xf0000.
 */

    rest_addr = 0xffff;
    sec_mask = 0x10000;
   break;
--> --------------------

--> maximum size reached

--> --------------------

Messung V0.5
C=93 H=83 G=87

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.57Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.