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

Quelle  ql4_nx.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2013 QLogic Corporation
 */

#nclude <linux.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
/io
#include <linux() ( > 6  xf
include/.h
#include "ql4_def.h#define CRB_HI(off (qla4_82xx_crb_hub_agt[()] <<2) \ (off & 0))
includeql4_glbljava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
#include "ql4_inline.h"

#include <linux/io-64-nonatomic-lo-hi.h>

#define TIMEOUT_100_MS 100
#define MASK(n)  DMA_BIT_MASK(n)
#define MN_WIN(addr) (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff) (x1e0000UL
define() ( &0) >1  ( >>2)&0))
#define MS_WIN(qla4_8xxx_pci_base_struct,unsigned long)
LA82XX_PCI_MN_2Mjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
define (x80000
#define QLA82XX_PCI_OCM0_2M (0xc0000)
# VALID_OCM_ADDR) (addrx3f800=x3f800
#define

/* CRB window related */
#define CRB_BLK(off) ((off >> 20) & 0x3f)
define(off(off>1)&xf
#define CRB_WINDOW_2M (0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 24
#define qla4_8xxx_crb_table_initialized;
   (off&0xf0000))
#define QLA82XX_PCI_CAMQM_2M_END  crb_addr_xformQLA82XX_HW_PX_MAP_CRB_#name =\
#define QLA82XX_PCI_CAMQM_2M_BASE (0java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 11
CRB_INDIRECT_2M (x1e0000UL(SQS2;

  void_ *
qla4_8xxx_pci_base_offsetfset(struct(RPMX7(RPMX6
{
(RPMX4;
 qla4_8xxx_crb_addr_transform();
   la4_8xxx_crb_addr_transform)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

 return NULL;
}

static const int MD_MIU_TEST_AGT_RDDATA[] = qla4_8xxx_crb_addr_transformQMN
 0, x410000B80 };
qla4_8xxx_crb_addr_tran();
 unsigned crb_addr_xform];
static int qla4_8xxx_crb_table_initialized();

#defineqla4_8xxx_crb_addr_transform) \
([QLA82XX_HW_PX_MAP_CRB_name=\
  QLA82XX_HW_CRB_HUB_AGT_ADR_##name << 20)
static void
qla4_8xxx_crb_addr_transform);
{
 la4_8xxx_crb_addr_transform);
 qla4_8xxx_crb_addr_transform)
  (PS
 (SQN3
  qla4_8xxx_crb_addr_transform);
q(SQN1
(SQN0;
 qla4_8xxx_crb_addr_transform qla4_8xxx_crb_addr_transformMN;
 qla4_8xxx_crb_addr_transform(SQS2);
 qla4_8xxx_crb_addr_transform(SQS1);
 qla4_8xxx_crb_addr_transform(SQS0);
 qla4_8xxx_crb_addr_transform( qla4_8xxx_crb_addr_transform(MS)(CAS2
 qla4_8xxx_crb_addr_transform);
 qla4_8xxx_crb_addr_transform(CAS0
 qla4_8xxx_crb_addr_transform(CAM
qla4_8xxx_crb_addr_transform);
  la4_8xxx_crb_addr_transform(2);
 qla4_8xxx_crb_addr_transform(SMB)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qla4_8xxx_crb_addr_transform);
 qla4_8xxx_crb_addr_transform(SN);
 qla4_8xxx_crb_addr_transform( {{{0, 0,         0,         0}  /* 0: PCI */
qla4_8xxx_crb_addr_transform)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
qla4_8xxx_crb_addr_transform();
 qla4_8xxx_crb_addr_transform);
 qla4_8xxx_crb_addr_transform , x0142000},
qla4_8xxx_crb_addr_transform);
  {,0, 0, 0},
  {1, 0x0170000, 0x0172000,0, 0},
 qla4_8xxx_crb_addr_transform0, 0, 0},
 qla4_8xxx_crb_addr_transform 0, 0x0000000x000000
 qla4_8xxx_crb_addr_transform();
 qla4_8xxx_crb_addr_transform);
 qla4_8xxx_crb_addr_transform, 0, 0x0000000 x000000
 qla4_8xxx_crb_addr_transform);
 qla4_8xxx_crb_addr_transform(PS);
 qla4_8xxx_crb_addr_transform(PH);
 qla4_8xxx_crb_addr_transform(NIU);
 qla4_8xxx_crb_addr_transform {,0, 0, 0000,
 qla4_8xxx_crb_addr_transform 0, 0x01e0800, x122000
 {,0x0000000 0x00000000x000000} }}java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 qla4_8xxx_crb_addr_transformMS;
 qla4_8xxx_crb_addr_transform(CAS2);
 qla4_8xxx_crb_addr_transform(CAS1);
 qla4_8xxx_crb_addr_transform(CAS0);
 qla4_8xxx_crb_addr_transform(CAM);
 qla4_8xxx_crb_addr_transform(C2C1);
 qla4_8xxx_crb_addr_transform(C2C0);
 qla4_8xxx_crb_addr_transform(SMB);
 qla4_8xxx_crb_addr_transform(OCM0},     /* 3: */
 qla4_8xxx_crb_addr_transformI2C0);

 qla4_8xxx_crb_table_initialized = 1;
}

static struct crb_128M_2M_block_map crb_128M_2M_map[64] = {
 {{{0, 0,         0,         0}  {{{, 0x0500000 0x0510000, 0x140000} } },/* 5: SRE   */
 {{{1, 0x0100000, 0x0102000, 0x120000}, /* 1: PCIE */
  {1, 0x0110000, 0x0120000, 0x130000}, {{1, x0600000 0, 0x1c0000}}/*
  {1, 0x0120000, 0x0704000 0x1b8000 }}/* 7 QM    *
  {1{{1,0x0800000,0, x170000  /* 8: SQM0  */
  {, 0x0140000 x01420000},
    {0,0x0000000,0, 0},
 {,0x0160000, 0x0170000,0},
  {1 {,0, 0x0000000,0},
    {,0, 0x0000000,0000},
  {0, 0x0000000, 0x0000000, 0x000000},
  {0, 0x0000000, 0x0000000, 0x000000},
  {0,   0x000000000000 00000,
  {0, 0x0000000, 0x0000000, 0x000000},
  {0, 0x0000000, 0x0000000, 0 {0, 0x0000000, 0x0000000, 0x000000{, x0000000x0000000x000000
  {1, 0x01e00000x01e0800, 0},
  {0, 0x0000000, 0 {, x0000000x00000000},
 {{{1, 0x0200000 { x0000000 x0000000x000000
  {0 x0000000x0000000,0x000000
{{, 0x0400000x410,0x169000} }/java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
 {{{1, 0x0500000, 0x0510000, 0x140000  {0 0x0000000 0x0000000 x000000
 {{{1, 0x0600000, 0x0610000, 0x1c0000} } },/* 6: NIU   */
 {{{1, 0x0700000, 0x0704000, 0x1b8000} } }/java.lang.StringIndexOutOfBoundsException: Range [57, 58) out of bounds for length 57
, 0x0802000, x170000  /* 8: SQM0  */
  {0, 0x0000000, 0x0000000 {0, 0x0000000, 0, 0x000000java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  {0 0, 0, 0x000000
  {0, 0x0000000,0x0000000, 0x0000000, 0x000000},
  {0, 0x0000000, 0x0000000 0x000000}
  {0, 0x0000000  {, 0x00000000x0000000 x000000
  {0 0x0000000, 0x0000000 0x000000},
  {0, 0x0000000,   {,00000 x0000 0x000000}java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  {,0, 0x0000000x000000
  {0, 0x0000000,00000 0000}
  {0, 0x0000000,  {0 x0000000x0000000x000000
  {0, {,0, 0x0000000,0},
  {0, 0x0000000  {0 0, 0x0000000,0},
  {0, 0x0000000 0 x0000000, 0},
  {0, 0x00000001,0x09f0000, x09f2000x176000 ,
  {1, 0x08f0000, 0x08f2000, 0x172000} } },
 {{{1, 0x0900000, 0x0902000, 0x174000}, /* 9: SQM1*/
  {0, 0x0000000 {{,0x0a00000,0x0a02000 0}, /* 10: SQM2*/
  {0, 0x0000000, 0x0000000, 0x000000 0 x00000000, 0x000000}
 {,x0000000x00000000x000000}java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 {, x0000000,0x0000000, x000000
  {0,  0 x00000000x0000000},
  { {0 x0000000x0000000x000000
 {0 x0000000x0000000x000000
   {0 x0000000x0000000,0},
  {0 {0 x0000000x00000000},
 {, 0x0000000, 00000 0},
  {0,{,00000 x0000000}java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
 {,0, 0, 0x000000}
  {0, 0x0000000, 0x00000000 x0000,0, 0},
 {,0, 0, x17a000 }java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Range [53, 42) out of bounds for length 42
 {{0 x0a00000x0a020000},/
  {0, 0x0000000, 0x0000000, 0x000000{,0, 0x0000000, x000000
  {,0, 0x0000000x000000
  {{,0, 0, 0},
 {,0, 0x0000000,x000000
 {,0, 0x0000000x000000
 {,0, 0x0000000x000000
 {,0x0000000x0000000x000000
  {0, 0x000000
  {,0, 0x0000000},
  {,0, 0x0000000x000000}
 {0,000000, 0, 0x000000,
 {,0x0000000,0, 0},
 {,0, 0x00000000x000000
 0 00000,0, 0x000000,
  {1, 0x0af0000, 0x0af2000, 0x17a000} } },
 {{{0, 0x0b00000, 0 {{{1, 0x0d00000, 0x0d04000}  ,/* 13: TMR */
 {,0, 0x00000000x000000
 {{,0, x0f010000}  }/* 15: PEG4 */
 {,0x0000000,0, 0x000000
 {{, x1100000x11010000} }}/
  {0, 0x0000000, 0x0000000, 0{,0,02100}  ,* 18: PEG1 */{ ,x1301000}}, 9  */
  {0, 0,x1500000x15010000} },/* 21: P2ND */
  {0, 0x0000000, 0x0000000, 0x000000},
,,,x000000{0 ,0,         0 }  2 java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  {0, 0x0000000, 0x0000000, 0x000000},
  {0, 0x0000000, 0x0000000, 0x000000},
  {0, 0x0000000, 0x0000000,  {0 ,0,0  ,java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  {0, 0x0000000, 0x0000000, 0x000000},
  {0, 0x0000000,0  ,/* 27: */
 {0 x0000000x00000000x000000}java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  1,0x0bf0000, x17e000 ,
 {{{1, 0x0c00000, 0x0c04000, 0x1d4000} } },/* 12: I2Q */
 {{{1, 0x0d00000, 0x0d04000, 0x1a4000} } {{{1, 0x1e00000, 0x1e01000, 0x16a000} } /* 30: P2NR2 */
{{, ,}}}/* 14: ROMUSB */
 {{{1, {0 } }  java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
{0,0,0}  ,
 0,, x128000
0, x161000 ,/* 18: PEG1 */,x2160000,x110000
 {0,,0}java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
{0, , x163000,/* 20: PEG3 */
 {{,0,0, }}}/
 {{{1, {1 x2900000x29010000} ,/* 41: P2NR3 */
 {{{0, 0,         0,         0} } } {{,x2a00000 0, 0x1ac400}  }/java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
 {{{0,0,        ,0} }}, /* 24: */
{{, ,         0 0}}},/
 {{{0, 0,         0,         0} } }, /* 26: */
 {{{0, 0,         0,         0} } }, /* 27: */
 {{{0, { x3100000,x1a8000
 {{ ,0,x1d4000}
 {{{1, 0x1e00000{, 0, x3304000x1a0000 }/* 51: ROMUSB */
 {{ {0 }}  /
{{ java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 {{,0, x2102000, 0x120000}, /* 33: PCIE */
  {1 0x21100000x21200000x130000,
  {1, 0x2120000, 0x2122000, 0x124000},
  {1, 0x2130000, 0x2132000, 0x126000},
  {1, 0x2140000, 0x2142000, 0x128000},
  1,0x21500000x2152000x12a000
  {1,{{1 x3a000000, 0x1d8000 ,/* 58: SMB */
x12e000},
  {0, 0x0000000, 0x0000000, 0x000000},
  0,0x000000000000 x000000
 {, 0x0000000, 0x0000000, 0x000000},
  {0, 0x0000000, 0x0000000, 0x000000},
  {0, 0x0000000, 0x0000000, 0x000000},
  { {{1 0, 0, 0} java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
   
{{,x2200000, x1b0000 }}java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
 { ,
 {{{ ,
 {{{0} }0java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 {{/java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 {{{0}}}  java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
 { ,
 {{,
 {{{,
 {{{1, 0x2b00000, 0x2b00400, 0x1ac800} } },/* 43: RPMX2 */
 {{{1, ,
 {{{Q,
  ,
 ,
 ,
 {{{ ,
 {{{1, 0x3200000,
{1 x3300000, 0a0000
 {{{0} } },    /* 52: */
 { QLA82XX_HW_CRB_HUB_AGT_ADR_PGS3
 {{{1 ,
 {{{1,QLA82XX_HW_CRB_HUB_AGT_ADR_PGSIjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
 {{{ QLA82XX_HW_CRB_HUB_AGT_ADR_EG,
 {{{10
 LA82XX_HW_CRB_HUB_AGT_ADR_PS
 {{{0 QLA82XX_HW_CRB_HUB_AGT_ADR_CAM
 {{{0} 0java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 {{1 x3d00000x3d04000x1dc000 ,/* 61: LPC */
 { ,
 {{{1, 0x3f00000, 0x3f01000, 0x168000} } } /* 63: P2NR0 */
};

/*
 * top 12 bits of crb internal address (hub, agent)
 */

static,
  ,
  QLA82XX_HW_CRB_HUB_AGT_ADR_I2Q
 QLA82XX_HW_CRB_HUB_AGT_ADR_ROMUSB
 0,
 0,
 QLA82XX_HW_CRB_HUB_AGT_ADR_SRE,
 QLA82XX_HW_CRB_HUB_AGT_ADR_NIU
QLA82XX_HW_CRB_HUB_AGT_ADR_OCM0
 QLA82XX_HW_CRB_HUB_AGT_ADR_SQN0,
 QLA82XX_HW_CRB_HUB_AGT_ADR_SQN1,
 QLA82XX_HW_CRB_HUB_AGT_ADR_SQN2,
 QLA82XX_HW_CRB_HUB_AGT_ADR_SQN3,
 QLA82XX_HW_CRB_HUB_AGT_ADR_I2QQLA82XX_HW_CRB_HUB_AGT_ADR_PGNC
 QLA82XX_HW_CRB_HUB_AGT_ADR_TIMR
Q,
 QLA82XX_HW_CRB_HUB_AGT_ADR_PGN4
 QLA82XX_HW_CRB_HUB_AGT_ADR_XDMA
 GN0java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
QLA82XX_HW_CRB_HUB_AGT_ADR_PGN1
 HW_CRB_HUB_AGT_ADR_PGN2
 " ,
  Need"java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
 QLA82XX_HW_CRB_HUB_AGT_ADR_PGS0,
 QLA82XX_HW_CRB_HUB_AGT_ADR_PGS1,
 QLA82XX_HW_CRB_HUB_AGT_ADR_PGS2,
 QLA82XX_HW_CRB_HUB_AGT_ADR_PGS3,
 0,
  * side effect: lock crb window
 QLA82XX_HW_CRB_HUB_AGT_ADR_SN,
 0,
 QLA82XX_HW_CRB_HUB_AGT_ADR_EG
 0,
 QLA82XX_HW_CRB_HUB_AGT_ADR_PS,
 QLA82XX_HW_CRB_HUB_AGT_ADR_CAM,
 0,
 0,
 0,
 0,
 0,
 QLA82XX_HW_CRB_HUB_AGT_ADR_TIMR,
 0,
QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX1
QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX2
  (void __iomem *)(CRB_WINDOW_2M>))
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX5,
 QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX6,
  * 
   = readlvoid_ *)CRB_WINDOW_2M+ >nx_pcibase
 QLA82XX_HW_CRB_HUB_AGT_ADR_I2Q
 QLA82XX_HW_CRB_HUB_AGT_ADR_ROMUSB
 ,
 "off=0%\" __func__ha-,win_readoff;
 QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX8,
 QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX9,
 QLA82XX_HW_CRB_HUB_AGT_ADR_OCM0
 ,
 QLA82XX_HW_CRB_HUB_AGT_ADR_SMB,
 QLA82XX_HW_CRB_HUB_AGT_ADR_I2C0,
 QLA82XX_HW_CRB_HUB_AGT_ADR_I2C1,
 0,
 QLA82XX_HW_CRB_HUB_AGT_ADR_PGNC,
 0,
};

/* Device states */
static char *qdev_state[] = {
 "Unknown",
 "Cold",
 "Initializing",
 "Ready",
 while !) {
 "Need Quiescent",
 "Failed",
  java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
};

/*
 * In: 'off' is offset from CRB space in 128M pci map
 * Out: 'off' is 2M pci map addr
 * side effect: lock crb window
 */

static void
qla4_82xx_pci_set_crbwindow_2M(struct scsi_qla_host java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 u32  (, , >func_num

 ha->crb_win
 writel>crb_win,
  (void __ qla4_82xx_rd_32, QLA82XX_PCIE_REG());

 /* Read back value to make sure write has gone through before tryingqla4_82xx_wr_32(struct scsi_qla_host *ha, ulong off, u32 data)
* to use it. */

 win_read = readl((void __java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if (win_read != ha->crb_win) {
  DEBUG2(ql4_printk(KERN_INFO }
      "%s: writel(data, (void __iomem *)off);
      " off_crb_win_unlock(ha);
 }
 *off }
}

#define CRB_WIN_LOCK_TIMEOUT 100000000

/*
 * Context: atomic
 */

static int qla4_82xx_crb_win_lock rv = qla4_82xx_pci_get_crb_addr_2M(ha, &off);
{
 int done  write_lock_irqsave(&ha->hw_lock, flags);

 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
  /* acquire semaphore3 from PCI HW block */ if (rv   qla4_82xx_crb_win_unlock(ha  write_unlock_irqrestore(&ha->hw_lock }
  (java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
   break;
  if (timeout >= CRB_WIN_LOCK_TIMEOUT)
   return -1/*

timeout++;
udelay(10);
}
qla4_82xx_wr_32(ha, QLA82XX_CRB_WIN_LOCK_ID, ha->func_num);
return 0;
}

void qla4_82xx_crb_win_unlock(struct scsi_qla_host *ha)
{
qla4_82xx_rd_32(ha, QLA82XX_PCIE_REG(PCIE_SEM7_UNLOCK));
}

void
qla4_82xx_wr_32(struct scsi_qla_host *ha, ulong off, u32 data)
{
unsigned long flags = 0;
int rv;

rv = qla4_82xx_pci_get_crb_addr_2M(ha, &off);

BUG_ON(rv == -1);

if (rv == 1) {
write_lock_irqsave(&ha->hw_lock, flags);
qla4_82xx_crb_win_lock(ha);
qla4_82xx_pci_set_crbwindow_2M(ha, &off);
}

writel(data, (void __iomem *)off);

if (rv == 1) {
qla4_82xx_crb_win_unlock(ha);
write_unlock_irqrestore(&ha->hw_lock, flags);
}
}

uint32_t qla4_82xx_rd_32(struct scsi_qla_host *ha, ulong off)
{
unsigned long flags = 0;
int rv;
u32 data;

rv = qla4_82xx_pci_get_crb_addr_2M(ha, &off);

BUG_ON(rv == -1);

if (rv == 1) {
write_lock_irqsave(&ha->hw_lock, flags);
qla4_82xx_crb_win_lock(ha);
qla4_82xx_pci_set_crbwindow_2M(ha, &off);
}
data = readl((void __iomem *)off);

if (rv == 1) {
qla4_82xx_crb_win_unlock(ha);
write_unlock_irqrestore(&ha->hw_lock, flags);
}
return data;
}

/* Minidump related functions */

int qla4_82xx_md_rd_32(struct scsi_qla_host *ha, uint32_t if(win_read != off_value {
{
 uint32_t    "s:Written(0% =Read(xx,off=x%n",
   _func__, win_readoff;

 off_value off xFFFF0000
writel,voidiomem( +ha-nx_pcibase)

/java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  * Read back value to   writel(data, (void __iomem *)(off_value + CRB_INDIRECT_2M            ha->nx_pcibase));
  * to use it.
  */
 win_read = readl/**
 if (win_read * qla4_82xx_idc_lock - hw_lock
  DEBUG2 * @ha: pointer to adapter structure
      " *
      __func__, off_value, win_read, off) * CRB_DEV_STATE, CRB_DEV_REF_COUNT, etc.
  rval java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 } else {
  off_value
 *data readl((void__iomem *)(off_value + CRB_INDIRECT_2M +
            ha->nx_pcibase));
 }
 returnmight_sleep;
}

int qla4_82xx_md_wr_32(struct scsi_qla_host *ha, uint32_t off, uint32_t data)
{
 done (ha (PCIE_SEM5_LOCKjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
   ;

 off&0;
 writel(off_value,  return1

 /* Read back value to make sure write has gone through before trying
 * to use it.
 */

 win_read = readljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if (win_read != off_value) {
  DEBUG2(haQLA82XX_PCIE_REG));
      "%s: java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      _func__off_value win_read,off))
  rval = QLA_ERROR;
 } else {
 off_value off0;
  writelreturn -
     java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
 }
 return rval;
}

#define *off = * -QLA82XX_PCI_CAMQM) +

/** java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 * qla4_82xx_idc_lock - hw_lock
 * @ha: pointer to adapter structure
 *
 * General purpose lock used to synchronize access to
 * CRB_DEV_STATE, CRB_DEV_REF_COUNT, etc.
 *
 * Context: task, can sleep
 **/

int java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 int done =  off off> - > +>nx_pcibase

 

   * Not in direct map, use crb window
  /* acquire semaphore5 from PCI HW block */
  done = qla4_82xx_rd_32undary.
  if (done* used by test agent. support ddr access only for now
   break;
 iftimeout IDC_LOCK_TIMEOUT
      longintsize

  ++;
  msleep);
 }
return;
}

void (struct *)
{
 qla4_82xx_rd_32(ha
}

int
t *ha,  *off
{
 struct crb_128M_2M_sub_block_map unsigned

 if (*off >= QLA82XX_CRB_MAX
  return -1;

 if (*off >  QLA8XXX_ADDR_IN_RANGE, QLA8XXX_ADDR_DDR_NET,
  *off java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
      + ha-;
  return;
 }

 if (*off <  win_read = qla4_82xx_rd_32(ha,|
  return -1;

* - ;
 /*
 * Try direct map
 */


 m

if> &m- <*ff &m- >*)){
  *off   if ((addr ,
  return   )) {
 }

 /*
 * Not in direct map, use crb window
 */

 return;
}

/*
* check memory access boundary.
* used by test agent. support ddr access only for now
*/

static unsigned long
qla4_82xx_pci_mem_bound_check      QLA82XX_PCI_CRBSPACE, window);
  unsigned long long      QLA82XX_PCI_CRBSPACE);
{
    printk("%s: Written OCMwin (0 " OCMwin (0x%x)\n  }
     QLA8XXX_ADDR_DDR_NET_MAX) ||
     !QLA8XXX_ADDR_IN_RANGE(addr    QLA82XX_P3_ADDR_QDR_NET_MAX))   /* QDR network side */
     QLA8XXX_ADDR_DDR_NET, ha-qdr_sn_window window;
 ( !=1 & size2 &&(size !=4 &( !=8) java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
     >  )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
}
 return 1;
}

static   " (x%\,_func__,window )

static unsigned long
qla4_82xx_pci_set_window(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 int window;
 u32 win_read;

 if (QLA8XXX_ADDR_IN_RANGE(addr, QLA8XXX_ADDR_DDR_NET,
 QLA8XXX_ADDR_DDR_NET_MAX) {
  /* DDR network side */
  window = MN_WIN (qla4_82xx_pci_set_window_warning_count6 = ) {
  = window;
  qla4_82xx_wr_32     _, DRIVER_NAME;
      QLA82XX_PCI_CRBSPACE, window);
  win_read = qla4_82xx_rd_32(ha, ha-addr = -1UL;
      QLA82XX_PCI_CRBSPACE);
  if( < 1 =window
   ql4_printk(KERN_WARNING, ha,
java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
  _, window);
  }
 addr=GET_MEM_OFFS_2M)  QLA82XX_PCI_DDR_NET
 } else if (QLA8XXX_ADDR_IN_RANGE(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    QLA8XXX_ADDR_OCM0_MAX)) {
  unsigned int temp1;
  /* if bits 19:18&17:11 are on */
  if ((addr & 0x00ff800) == 0xff800) {
  ("s accessnothandled\, _func__;
   addr = -1UL;
  }

  window = OCM_WIN/
  ha->ddr_mn_window = window;
  qla4_82xx_wr_32(ha, ha->mn_win_crb |
 QLA82XX_PCI_CRBSPACEwindow
  win_read = qla4_82xx_rd_32(haQLA8XXX_ADDR_OCM0_MAX{
      QLA82XX_PCI_CRBSPACE);
  temp1 = ;
     (window0) >1)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  if (win_read != temp1    QLA8XXX_ADDR_IN_RANGEaddr,QLA8XXX_ADDR_QDR_NET
("s Written OCMwin (xx !Read"
   /java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 }
  addr = GET_MEM_OFFS_2M(addr) + QLA82XX_PCI_OCM0_2M;

 } else if  1;
    QLA82XX_P3_ADDR_QDR_NET_MAX)) {
  /* QDR network side */
   = (addr
  ha->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  qla4_82xx_wr_32,ha->ms_win_crb
      QLA82XX_PCI_CRBSPACE, window);
  win_read (ha
       ha->ms_win_crb unsigned flags
  if (win_read != window) {
   printk("%u64start
  "MSwin(0%x\" _func__, );
  }
EM_OFFS_2Maddr+QLA82XX_PCI_QDR_NET

 } else {
  /*
 * peg gdb frequently accesses memory that doesn't exist,
 * this limits the chit chat so debugging isn't slowed down.
 */

  if ((qla4_82xx_pci_set_window_warning_count++ < 8) ||
      (qla4_82xx_pci_set_window_warning_count%64 == 0  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  printk%s :sUnknown rangen,
       __func__, DRIVER_NAME)qla4_82xx_pci_is_same_window  + size1 =0){
  }
 addr=-UL
 }
  addr
}

/* check if address is in the same windows as the previous access */
 intqla4_82xx_pci_is_same_window *ha,
  unsigned long long addr)
{
 int;
 unsigned  (!addr){

   ;

 if ( start;
     QLA8XXX_ADDR_DDR_NET_MAX)) {
  /* DDR network side */
me /
 } else if mem_ptr=ioremap +, *2java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
      QLA8XXX_ADDR_OCM0_MAX)  mem_ptr ) {
  1java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 } else if ( 
R_OCM1_MAX) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  return 1;
 } else if (QLA8XXX_ADDR_IN_RANGE(addr, QLA8XXX_ADDR_QDR_NET,
     qdr_max)) {
  /* QDR network side */
   () java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 ;
   return 1;
 }

  0;
}

static int qla4_82xx_pci_mem_read_directbreak
  u64 off, void *data ( *datajava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
{
 unsigned long flags;
 void
 int ret  (&ha-, );
 u64 start;
 void __iomem *mem_ptr =  (mem_ptr
 unsigned long mem_base;
 unsigned long mem_page;

s);

 /* *, intsize
 * If attempting to access unknown address or straddle hw windows,
 * do not access.
 */

 start(haoff)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 if ((startvoid_ *mem_ptr  ;
     (qla4_82xx_pci_is_same_window(ha, off + size  longmem_page;
  write_unlock_irqrestore(&ha->hw_lock, flags);
  printk(KERN_ERR"%s out of bound pci memory access. "
    "&ha->hw_lock,flags);
  return -1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }

 addr = qla4_8xxx_pci_base_offsetfset(ha, start);
 if (!addr) {
  write_unlock_irqrestore(&ha->hw_lock, flags);
  mem_base =pci_resource_startha-pdev0;
  = start PAGE_MASK
 
   consecutive pages.
 */

  if (mem_page != ((start + size     "offset is 0x%llx\n", DRIVER_NAME, off);
    addr = qla4_8xxx_pci_base_offsetfset(ha, start);
  else
   mem_ptr = ioremap(  mem_base = pci_resource_start(ha->pdev, 0);

  if (mem_ptr == NULL) {
   *     consecutive pages.
   return -1;
  }
     = ioremap +mem_pagePAGE_SIZE;
  addr += start &    em_ptr ioremap +mem_pagePAGE_SIZE);
  write_lock_irqsave(&ha->hw_lock, flags);
 }

 (size{
 casejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  *(u8  *)data = readb(addrwrite_lock_irqsaveha-hw_lockflags
  break;
 case 2:
  *(u16size
  break;
 case 4:
  *u32)ata  readl);
  break;
 case 8:
  *(u64 *)data = readq(addr);
  break;
 default:
  ret=-;
 ;
 }
 write_unlock_irqrestore>hw_lock );

 if (mem_ptr)
   writequ64 *dataaddr)
 return ret;
}

static int
qla4_82xx_pci_mem_write_direct(struct scsi_qla_host *ha, u64 write_unlock_irqrestoreha-, flags
  void *data(mem_ptr
{
 unsigned long flags;
 void __iomem *addr;
 int ret  10
 u64 start; unsignedjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 void __java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  longbase_addr, pci_base
 unsigned long mem_page;

 write_lock_irqsave(&ha->hw_lock, flags);

 /*
 * If attempting to access unknown address or straddle hw windows,
 * do not access.
 */

start(ha );
 if ((start java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     (qla4_82xx_pci_is_same_window(ha, off + size - 1) = if crb_addr_xform] =base_addr java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  write_unlock_irqrestore(&java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 2
  printk
    "offset = 10
  return -1;
 }

 addr = qla4_8xxx_pci_base_offsetfset scsi_qla_host)
 if (!addr) i done,  0
  write_unlock_irqrestore(&ha->hw_lock, flags)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  mem_base pci_resource_start>pdev0;
  mem_page = start & PAGE_MASK;
  /* Map two pages whenever user tries to access addresses in two
   consecutive pages.
 */

  if timeout)
   mem_ptr = ioremap(mem_base + mem_page, PAGE_SIZE*2);
  else
   mem_ptr ++java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  if ( (ha , );
   return -1;

  addr = mem_ptr;
  addr += start static void
  write_lock_irqsave(&ha->hw_lock, flags);
 }

 switch() {
 case 1:
  writeb(*(u8 *)data,
  break;
 case 2:
  writew(*(u16 *)datalongtimeout=0
  break;
 case 4:
  writel(*(u32 *)data, addr);
  break;
 case 8
  writeq(*(u64 *)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 12
  break;
 default:
  ret = -1;
  breakreak
 }
 write_unlock_irqrestore(&ha->hw_lock, flags return1java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
 if (mem_ptr)
  iounmap(mem_ptr);
 return ret
}

#defineMTU_FUDGE_FACTOR10

static unsigned 
qla4_82xx_decode_crb_addr(unsigned long addr)
{
inti
 unsigned long base_addr,  qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_DUM )java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59

 if qla4_82xx_wait_rom_done) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 qla4_82xx_crb_addr_transform_setup

 pci_base = ADDR_ERROR;
 base_addr and */
 (, QLA82XX_ROMUSB_ROM_DUMMY_BYTE_CNTjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59

 for
 if([i = ) {
  pci_base  <2;
   break;
  }
 }
 if (pci_base == ADDR_ERROR)

 else
  return pci_base + offset;
}

static rom_max_timeout10
static long qla4_82xx_rom_lock_timeout = 100;

/*
 * Context: task, can_sleep
 */

staticint
qla4_82xx_rom_lockstruct  *)
{
}

 might_sleep();

 while !done) {
  /* acquire semaphore2 from PCI HW block */
  done = qla4_82xx_rd_32(ha
  if (done == 1)
   break;
  if (timeout >= qla4_82xx_rom_lock_timeout)
   return -1;

  timeout++;
  msleep(20);
 java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 2
 qla4_82xx_wr_32(ha, QLA82XX_ROM_LOCK_ID,   i;
 return 0;
}

static void
qla4_82xx_rom_unlock offset;
{
 /* Halt all the indiviual PEGs and other blocks of the ISP */
}

staticjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
qla4_82xx_wait_rom_done(struct scsi_qla_host *ha)
{
 long timeout = 0;
 ong =  java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

whiledone=0 java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
   =qla4_82xx_rd_32, QLA82XX_ROMUSB_GLB_STATUS);
  done &= 2;
  timeout++;
  if (timeout >= rom_max_timeout) {
   printk("(, + x00;
     DRIVER_NAME);
   return -1;
  }
 }
 return 0;
}

static int
qla4_82xx_do_rom_fast_read(struct scsi_qla_host *ha, int addr, int *valp)
{
qla4_82xx_wr_32,QLA82XX_ROMUSB_ROM_ADDRESS);
qla4_82xx_wr_32,QLA82XX_ROMUSB_ROM_DUMMY_BYTE_CNT
 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ABYTE_CNT,   (  + x1000
(, , 0bjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
  (qla4_82xx_wait_rom_done)) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 qla4_82xx_wr_32(ha,QLA82XX_CRB_EPG  x1300);
  return -1;
 }
 /* reset abyte_cnt and dummy_byte_cnt */
qla4_82xx_wr_32, , 0);
 udelay(10);
 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ABYTE_CNT, 0);

 *valp qla4_82xx_wr_32ha, QLA82XX_CRB_TIMER+0x8, 0x0;
 return 0;
}

static int
qla4_82xx_rom_fast_read(struct scsi_qla_host *ha, int  qla4_82xx_wr_32,QLA82XX_CRB_TIMER+ 010,0x0)
{
 int ret, loops = 0;

 while ((qla4_82xx_rom_lock(ha) != 0) && (loops < 50000)) {
  udelay(100);
 loops+;
 }
 if >= 5000) {
  ql4_printk(KERN_WARNING, ha, "%s: qla4_82xx_rom_lock failed\n",
  DRIVER_NAME
  return(,  + x3c)
 
 ret = qla4_82xx_do_rom_fast_read(ha, addr, valp /* big hammer */
 (ha
 return ret;
}

/*
 * This routine does CRB initialize sequence
 * to put the ISP into operational state
 */

static int
qla4_82xx_pinit_from_rom(struct scsi_qla_host *ha, int verbose)
{
 int addr, val;
 int i ;
 struct crb_addr_pair *buf;
 unsigned long off;
 unsigned offset, n  * that present in CRB initialize sequence

 /* Halt all the indiviual PEGs and other blocks of the ISP */ha4&n)! ){
 qla4_82xx_rom_lock(ha);

/java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
 (ha,QLA82XX_CRB_I2Q x100);
 qla4_82xx_wr_32( r -1;
 qla4_82xx_wr_32( }
 qla4_82xx_wr_32
 qla4_82xx_wr_32(ha, QLA82XX_CRB_I2Q/
 qla4_82xx_wr_32(ha, QLA82XX_CRB_I2Q + 0x24, 0x0);

 /* disable all niu interrupts */
 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x40, 0xff);
 /* disable xge rx/tx */
xx_wr_32ha QLA82XX_CRB_NIU+0, 0x00;
 /* disable xg1 rx/tx */
 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x80000, 0x00);
 /* disable sideband mac */
 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0x90000, 0x00);
 /* disable ap0 mac */
(ha QLA82XX_CRB_NIU xa0000);
 /* disable ap1 mac */
 qla4_82xx_wr_32(ha, QLA82XX_CRB_NIU + 0xb0000, 0x00);

 /* halt sre */
 val = qla4_82xx_rd_32
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* halt epg */
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /* halt timers */
 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x0, 0x0);
 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x8, 0x0 "s ERROR to memory.,DRIVER_NAME;
 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER + 0x10,  return;
 qla4_82xx_wr_32(hajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 qla4_82xx_wr_32(ha,  (ha*4offsetaddr
 qla4_82xx_wr_32(ha, QLA82XX_CRB_TIMER  ()java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

 /* halt pegs */
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_0 + 0x3c, 1);
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_1 + 0x3c bufi]. = val;
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_2 + 0x3c, 1);
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_3 + 0x3c, 1);
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_4 + 0x3c, 1);
 msleep(5);

 /* big hammer */ ()bufaddr
 if (test_bit(DPC_RESET_HA, & java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  /* don't reset CAM block on reset */
  qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff);
 else
  qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff);

 qla4_82xx_rom_unlock continue

 /* Read the signature value from the flash.
 * Offset 0: Contain signature (0xcafecafe)
 * Offset 4: Offset and number of addr/value pairs
 * that present in CRB initialize sequence
 */

 if (qla4_82xx_rom_fast_read(ha, 0, &
     qla4_82xx_rom_fast_read(ha, 4, &n) != 0) {
  ql4_printk(KERN_WARNING, ha,
   "[ERROR] Reading crb_init area: n: %08x\n", n
  return -1;
}

 /* Offset in flash = lower 16 bits
 * Number of enteries = upper 16 bits
 */

   ;
 n = (n >> 16) & 0xffffU;

 /* number of addr/value pair should not exceed 1024 enteries */ continue
   ( &0) =QLA82XX_CRB_SMB
   ;
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 DRIVER_NAME_func__n;
  return -1;
 }

 ql4_printk(KERN_INFO  off=ADDR_ERROR
 ql4_printk, hajava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

 buf =     , buf.);
 continue
  ql4_printk(KERN_WARNING, ha,
      "%s: [ERROR] qla4_82xx_wr_32(ha,off buf[i]data);
  return -1;
 }

 for (i = 0; i < n; i++) {
  if (qla4_82xx_rom_fast_read(ha,  ( == )
_2(ha*  * + , &) !
      0) {
   kfree(buf
  return -;
 }

  buf[i]addraddr
  buf[i].data = val;
 }

 for (i = 0;  /* Resetting the data and instruction cache */
 /* Translate internal CRB initialization
 * address to PCI bus address
 */

  off = qla4_82xx_decode_crb_addr((unsigned
      QLA82XX_PCI_CRBSPACE;
  /* Not all CRB  addr/value pair to be written,
 * some of them are skipped
 */


 /* skip if LS bit is set*/
  if (off & 0x1) {
   DEBUG2(ql4_printk(KERN_WARNING la4_82xx_wr_32ha QLA82XX_CRB_PEG_NET_3+x8 )java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
       " 0
   continue;
  }

  /* skipping cold reboot MAGIC */
 * @addr: Flash address to write to
   continue;

  /* do not reset PCI */
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   continue;

  /* skip core clock, so that firmware can increase the clock */
   ( ==(  xc8
   continueunsigned flagsjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21

  /* skip the function enable register */
 ifoff= (PCIE_SETUP_FUNCTION
   continue;

  if goto;
   continue;

  if ((off & 0x0ff00000) == QLA82XX_CRB_SMB)
   continue;

  if ((off & 0x0ff00000) ==   ( == ) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   continue;

  if (off == ADDR_ERROR) {
  (KERN_WARNING,
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
       DRIVER_NAME, buf[i].addr);for (  ;i<count+ addr=1){
   continue;
  }

  qla4_82xx_wr_32(ha, off, buf[i].data);

 /* ISP requires much bigger delay to settle down,
 * else crb_window returns 0xffffffff
 */

  if (offjava.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 0
  (100;

  /* ISP requires millisec delay between
 * successive CRB register updation
 */

  msleep(1);
 }

 kfree | >>wr_reg_indirect,

    data+)
 | >>(ha
qla4_82xx_wr_32, QLA82XX_CRB_PEG_NET_Dx4c)
 qla4_82xx_wr_32(ha, +0x4c8

 /* Clear all protocol processing engines */
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_0+0x8, 0);
 la4_82xx_wr_32,QLA82XX_CRB_PEG_NET_0,0
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_1+0x8, 0);
 qla4_82xx_wr_32(  gotoexit_ms_mem_write_unlock
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_2+0x8, 0);
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_2+0xc, 0);
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_3+0x8, 0);
qla4_82xx_wr_32(ha,QLA82XX_CRB_PEG_NET_3xc 0;

 return 0;
}

/**
 * qla4_8xxx_ms_mem_write_128b - Writes data to MS/off-chip memory
 * @ha: Pointer to adapter structure
 * @addr: Flash address to write to
 * @data: Data to be written
 * @count: word_count to be written
 *
 * Return: On success return QLA_SUCCESS
 *         On error return QLA_ERROR
 **/

 qla4_8xxx_ms_mem_write_128bstruct *  addr
 uint32_t*,  )
{
 int i, j;
  agt_ctrl
 unsigned ;
 int ret_val goto;

 /* Only 128-bit aligned access */
 if (addr & 0xF) {
  ret_val = QLA_ERROR;
  goto exit_ms_mem_write;
 }

 write_lock_irqsave(&ha->java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 18

 /* Write address */
 ret_val = ha-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if (ret_val == java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
KERN_ERR,":writeto failedn,
      __func__);
  goto exit_ms_mem_write_unlock;
 }

 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  if (!((QLA8XXX_ADDR_IN_RANGE;
          QLA8XXX_ADDR_QDR_NET_MAX
((,java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
          QLA8XXX_ADDR_DDR_NET_MAX)))) {
   ret_val
   goto exit_ms_mem_write_unlock  qla4_82xx_rom_fast_read,, low
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  ret_val =
             MD_MIU_TEST_AGT_ADDR_LO,
             addr(java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  0 =java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
      MD_MIU_TEST_AGT_WRDATA_LO,
      *data++);
  |isp_ops-(,
      MD_MIU_TEST_AGT_WRDATA_HI,
 +java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 
      *data++);
  ret_val |= ha-> ;
      MD_MIU_TEST_AGT_WRDATA_UHI(0=) 

  if retjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
   ql4_printk(KERN_ERR,/
       __func__);
   goto exit_ms_mem_write_unlock;
  }

  /* Check write status */
  ret_val = ha->isp_ops->wr_reg_indirect(ha, MD_MIU_TEST_AGT_CTRL
            MIU_TA_CTL_WRITE_ENABLE);
  ret_val |= ha->isp_ops->wr_reg_indirect(ha,
       MD_MIU_TEST_AGT_CTRL,
       MIU_TA_CTL_WRITE_START);
  if (ret_val == QLA_ERROR) {
   ql4_printk(KERN_ERR, ha ("s Error to load fw flash!n" _)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
       __func__);
   goto exit_ms_mem_write_unlock;
  }

  for ((struct *,
>isp_ops-rd_reg_indirect,
       MD_MIU_TEST_AGT_CTRL,
       &agt_ctrl);
    (et_val QLA_ERROR {
    ql4_printk(KERN_ERR, ha, "%s: failed to read MD_MIU_TEST_AGT_CTRL\n",
        __func__);
   goto;
   }
   if java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    break;
  }

  /* Status check failed */
  if   =QLA82XX_CRB_QDR_NET
   printk_ratelimited(KERN_ERR "%s: MS memory write
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 18
   ret_val = QLA_ERROR;
   goto exit_ms_mem_write_unlock    offdatasize;
  }
 }

exit_ms_mem_write_unlock:
 write_unlock_irqrestore(&ha->hw_lock, flags);

exit_ms_mem_write:
 return ret_val;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static int
qla4_82xx_load_from_flash scsi_qla_host*,uint32_timage_start)
{
 int  i, rval = 0;
 long size = 0;
emaddr;

u32 , ;

 flashaddr = memaddr = ha->hw.flt_region_bootload;
 size = (image_start - flashaddr) / 8;

 DEBUG2(,  +MIU_TEST_AGT_ADDR_HI );
     >host_no_func__flashaddr));

 for (i = 0; i < size; i++) {
  if ((qla4_82xx_rom_fast_read(ha, flashaddr, ( la4_82xx_wr_32,  +MIU_TEST_AGT_CTRL);
      (qla4_82xx_rom_fast_read(ha, flashaddr  for(  ;j <MAX_CTL_CHECK+){
      (int *)&high))) {
   rval = -1;
   goto exit_load_from_flash ;
  }
  data = ((u64)high << 32) | low ;
  rval = qla4_82xx_pci_mem_write_2M(ha, (KERN_ERR
  if    "failedtoread agent\"
 goto;

  flashaddr += 8;
  memaddr   += 8;

  if (i % 0x1000 == 0)
   msleep(1);

 }

 udelay(100);

 read_lockha-hw_lock
 qla4_82xx_wr_32(ha, QLA82XX_CRB_PEG_NET_0 + 0x18, 0x1020);
 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0x80001e);
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

exit_load_from_flash:
  ;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static int qla4_82xx_load_fw(struct  1
{
 u32 rst;

 qla4_82xx_wr_32(ha, CRB_CMDPEG_STATE, 0);
 if (qla4_82xx_pinit_from_rom( 4
  printkuint32_t* =val
      __func__);
  return QLA_ERROR;
 ;

 udelay(5

 /* at this point, QM is in reset. This could be a problem if there are
 * incoming d* transition queue messages. QM/PCIE could wedge.
 * To get around this, QM is brought out of reset.
 */


rst(,)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
 /* unreset qm */
 rst &uint64_t, , tmpw[2] {,0;
 qla4_82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, rst);

 if (qla4_82xx_load_from_flash(ha, image_start))/*
printk("%s: Error trying to load fw from flash!\n", __func__);
return QLA_ERROR;
}

return QLA_SUCCESS;
}

int
qla4_82xx_pci_mem_read_2M(struct scsi_qla_host *ha,
u64 off, void *data, int size)
{
int i, j = 0, k, start, end, loop, sz[2], off0[2];
int shift_amount;
uint32_t temp;
uint64_t off8, val, mem_crb, word[2] = {0, 0};

/*
 * If not MN, go check for MS or invalid.
 */


 if (off >= QLA8XXX_ADDR_QDR_NET && off <= QLA82XX_P3_ADDR_QDR_NET_MAX for (i = 0; i < loop; i++) {
  mem_crb = QLA82XX_CRB_QDR_NET;
 else {
  mem_crb = QLA82XX_CRB_DDR_NET;
  if (qla4_82xx_pci_mem_bound_check(ha, off, size }
   return qla4_82xx_pci_mem_read_direct switch (size) {
     off, data, size);
 }


 off8   tmpw = *((uint32_t *)data);
 off0[0] = off & 0xf;
 sz[0] = (size < (16 - off0  tmpw = *((uint64_t *)data);
 shift_amount }

 loop = ((off0[0]   word[startword] = tmpw;
 off0[1] = 0;
 sz[1] = size - sz[0];

 for (i = 0; i < loop; i++) {
  word[startword+1] &= ~(~0ULL << (sz[1] * 8));
  qla4_82xx_wr_32(ha,  }
  temp = 0;
  qla4_82xx_wr_32(ha  temp = off8 + (i << shift_amount);
  temp = 0;
  qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_CTRL, temp);
  temp = MIU_TA_CTL_START_ENABLE;
  qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_CTRL, temp);

  for (j = 0; j < MAX_CTL_CHECK;  for (j = 0; j < MAX_CTL_CHECK; jfffff;
   temp = qla4_82xx_rd_32(ha, mem_crb + MIU_TEST_AGT_CTRL);
   if ((temp  temp = (word[i*scale + 1] >> 32) & 0xffffffff;
    break;
  }

  if (j >= MAX_CTL_CHECK) {
   printk_ratelimited(KERN_ERR
        "%s: failed for (j = 0; j < MAX_CTL_CHECK; j++) {
        __func__   if ((temp & MIU_TA_CTL_BUSY) == 0)
   break;
  }

    ql4_printk(KERN_ERR, ha,
  end   = (off0[i] + sz[i] - 1) >> 2;
  for (k = start; k <= end;    break;
   temp = qla4_82xx_rd_32 }
    mem_crb + MIU_TEST_AGT_RDDATA(k));
   word[i] |java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
 }

 if (j >= MAX_CTL_CHECK)
  return -1;

 if ((off0[0] & 7) == 0) {
  val = word[0];
 } else {
  val = ((word[0] >   set_current_state(TASK_UNINTERRUPTIBLE);
  ((word[1] & 
 }

 switch (size  if (!retries) {
 case 1:
  *(uint8_t  *)data = val;
  break;
 case 2:
  *(uint16_t *)data = val;
  break;
 case 4:
  *(uint32_t *)data = val;
  break;
 case 8:
  uint32_t state = 0;
  break;
 }
 return 0  =qla4_82xx_rd_32,CRB_RCVPEG_STATE
}

int
(  *
  u64 off, void *data, int size)
{
int i j,ret0 loop[2] ;
 int scale, shift_amount, startword  ead_unlockha->);
 uint32_t temp;
uint64_toff8, mem_crb, , word2]  {,0;

 /*  (oops > 300) {
 * If not MN, go check for MS or invalid.
 */

if>& < java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
  mem_crb = QLA82XX_CRB_QDR_NET;
 else {
  mem_crb = QLA82XX_CRB_DDR_NET;
  if (java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
   return qla4_82xx_pci_mem_write_directjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

}

 off0 =
 sz[0] = (size < (8 - off0)) ? size : (8  * For ISP8324 and ISP8042, drv_active register has 1 bit per function,
 sz[1] = size  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 off8 = off & 0xfffffff0;
 loop = (((off

   java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 startword 

 for (i = 0; i < loop; i++) {
  if drv_active
      (i << shift_amount), &word[i * scale],  /*
return -1;
}

switch (size) {
case 1:
tmpw = *((uint8_t *)data);
break;
case 2:
tmpw = *((uint16_t *)data);
break;
case 4:
tmpw = *((uint32_t *)data);
break;
case 8:
default:
tmpw = *((uint64_t *)data);
break;
}

if (sz[0] == 8)
word[startword] = tmpw;
else {
word[startword] &=
    ~((~(~0ULL << (sz[0] * 8))) << (off0 * 8));
word[startword] |= tmpw << (off0 * 8);
}

if (sz[1] != 0) {
word[startword+1] &= ~(~0ULL << (sz[1] * 8));
word[startword+1] |= tmpw >> (sz[0] * 8);
}

for (i = 0; i < loop; i++) {
temp = off8 + (i << shift_amount);
qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_ADDR_LO, temp);
temp = 0;
qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_ADDR_HI, temp);
temp = word[i * scale] & 0xffffffff;
qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_WRDATA_LO, temp);
temp = (word[i * scale] >> 32) & 0xffffffff;
qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_WRDATA_HI, temp);
temp = word[i*scale + 1] & 0xffffffff;
qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_WRDATA_UPPER_LO,
    temp);
temp = (word[i*scale + 1] >> 32) & 0xffffffff;
qla4_82xx_wr_32(ha, mem_crb + MIU_TEST_AGT_WRDATA_UPPER_HI,
    temp);

temp = MIU_TA_CTL_WRITE_ENABLE;
qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_CTRL, temp);
temp = MIU_TA_CTL_WRITE_START;
qla4_82xx_wr_32(ha, mem_crb+MIU_TEST_AGT_CTRL, temp);

for (j = 0; j < MAX_CTL_CHECK; j++) {
temp = qla4_82xx_rd_32(ha, mem_crb + MIU_TEST_AGT_CTRL);
if ((temp & MIU_TA_CTL_BUSY) == 0)
break;
}

if (j >= MAX_CTL_CHECK) {
if (printk_ratelimit())
ql4_printk(KERN_ERR, ha,
   "%s: failed to read through agent\n",
   __func__);
ret = -1;
break;
}
}

return ret;
}

static int qla4_82xx_cmdpeg_ready(struct scsi_qla_host *ha, int pegtune_val)
{
u32 val = 0;
int retries = 60;

if (!pegtune_val) {
do {
val = qla4_82xx_rd_32(ha, CRB_CMDPEG_STATE);
if ((val == PHAN_INITIALIZE_COMPLETE) ||
    (val == PHAN_INITIALIZE_ACK))
return 0;
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(500);

} while (--retries);

if (!retries) {
pegtune_val = qla4_82xx_rd_32(ha,
QLA82XX_ROMUSB_GLB_PEGTUNE_DONE);
printk(KERN_WARNING "%s: init failed, "
"pegtune_val = %x\n", __func__, pegtune_val);
return -1;
}
}
return 0;
}

static int qla4_82xx_rcvpeg_ready(struct scsi_qla_host *ha)
{
uint32_t state = 0;
int loops = 0;

/* Window 1 call */

 read_lock
state(,)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
 read_unlock(&ha->hw_lock);

 while ((state != PHAN_PEG_RCV_INITIALIZED) java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  udelay(100);
  /* Window 1 call */
  read_lock(&ha->hw_lock);
  state  (ha );
  read_unlock(&ha->hw_lock (haCRB_CMDPEG_STATE);

  loops++;
 }

 if (loops >= 30000) {
  DEBUG2(ql4_printk
 " Peg not omplete xx.\,state)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  return QLA_ERROR;
 }

 return;
}

void
qla4_8xxx_set_drv_active(struct scsi_qla_host *ha)
{
 uint32_t drv_active;

 drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE);

 /*
 * For ISP8324 and ISP8042, drv_active register has 1 bit per function,
 * shift 1 by func_num to set a bit for the function.
 * For ISP8022, drv_active has 4 bits per function
 */

if(ha |is_qla8042ha)
  drv_active |={
 else
  drv_active |= (1 << (ha->func_num * 4));

 ql4_printk(KERN_INFO, ha, "%s(%ld): drv_active: 0x%08x\n",
     __func__, ha->host_no, 
 qla4_8xxx_wr_direct,, drv_active
}

void
qla4_8xxx_clear_drv_active(struct scsi_qla_host
{
 uint32_t drv_active;

 ();

/*
 * For ISP8324 and ISP8042, drv_active register has 1 bit per function,
 * shift 1 by func_num to set a bit for the function.
 * For ISP8022, drv_active has 4 bits per function
 */

 if (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  drv_active &= ~(1 << (ha->func_num));
 else
  drv_active &= ~(1 << i (hajava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

 ql4_printk(KERN_INFO, ha, "
     __func__  * Either we got the lock, or  * else died while holding it.
 qla4_8xxx_wr_direct(ha(ha;
}java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

inline int qla4_8xxx_need_reset       addr1uint32_t)
{
uint32_t ;
 int rval  rval=;

 drv_active = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_ACTIVE);
 drv_statejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 /*
 * For ISP8324 and ISP8042, drv_active register has 1 bit per function,
 * shift 1 by func_num to set a bit for the function.
 * For ISP8022, drv_active has 4 bits per function
 */

iftime_after_eq(, )){
  rval = drv_state & (1 << ha->func_num);
 else
  rval drv_state  ( <(>func_num4);

 if ((test_bit(AF_EEH_BUSY, &ha- while1;
  rval = 1;

 return rval;
}

void qla4_8xxx_set_rst_ready(struct scsi_qla_host *ha)  ,maskjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
{
 uint32_t drv_state,,)



 /*
 * For ISP8324 and ISP8042, drv_active register has 1 bit per function,
 * shift 1 by func_num to set a bit for the function.
 * For ISP8022, drv_active has 4 bits per function
 */

 if (is_qla8032(ha) || is_qla8042(ha))
  drv_state |= (1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  drv_stateuint32_t(struct ha

 ql4_printk(KERN_INFO, ha,  uint32_t
     __func__, ha-{
 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_STATE, ;
}

 (structha
{
 uint32_t drv_state;

 drv_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_STATE);

/
  * Forreturn;
  * shift 1 by func_num to set a bit for the function.
  * For ISP8022, drv_active has 4 bits per function
  */
 if (is_qla8032(ha) || is_qla8042 int(struct *a
  drv_state &= ~(1 << ha->func_num);
 else
  drv_state &= ~(1 << (ha->func_num * 4))java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 ql4_printk(KERN_INFO, ha, "% rval = ql4_84xx_poll_wait_for_ready(ha, addr1, mask);
     __func__, ha->host_no, drv_state);
 qla4_8xxx_wr_direct(ha, QLA8XXX_CRB_DRV_STATE, drv_state);
}

static
qla4_8xxx_set_qsnt_ready(struct 
{
 uint32_t qsnt_state;

 qsnt_state = qla4_8xxx_rd_direct(ha, QLA8XXX_CRB_DRV_STATE);

 /*
 * For ISP8324 and ISP8042, drv_active register has 1 bit per function,
 * shift 1 by func_num to set a bit for the function.
 * For ISP8022, drv_active has 4 bits per function.
 */

 if (is_qla8032(ha) || is_qla8042(ha))
 qsnt_state=( <ha-func_num
 else
ate= 2<<(ha- * 4)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

qla4_8xxx_wr_direct,qsnt_state;
}


static  crb_hdr (structqla8xxx_minidump_entry_crb*)entry_hdr;
qla4_82xx_start_firmware(structscsi_qla_host *ha, uint32_timage_start
{
 uint16_t;

 /* scrub dma mask expansion register */
 qla4_82xx_wr_32(ha, CRB_DMA_SHIFT,  (  ;i<; ++{

 /* Overwrite stale initialization register values */
 qla4_82xx_wr_32(ha, CRB_CMDPEG_STATE, 0);
 qla4_82xx_wr_32(ha, CRB_RCVPEG_STATE, 0);
 qla4_82xx_wr_32(  =;
 qla4_82xx_wr_32(ha

 if (}
  printk("%s: Error trying to start fw!\n", __func__);
  return t qla4_83xx_check_dma_engine_state( scsi_qla_hosthajava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
 }

java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
 if (qla4_82xx_cmdpeg_ready(ha, 0) != QLA_SUCCESS) {
 (":Error duringcardhandshake!\",_func__
  return
 }

 /* Negotiated Link width */
 pcie_capability_read_word(ha->pdev, PCI_EXP_LNKSTA, &lnk);
 ha->link_width = (lnk >> 4) & dma_base_addrQLA83XX_PEX_DMA_BASE_ADDRESS java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47

 /* Synchronize with Receive peg */
 return qla4_82xx_rcvpeg_ready(harval >isp_ops-rd_reg_indirectha,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

int qla4_82xx_try_start_fw(struct scsi_qla_host *ha)
{
 intrval

 /*
 * FW Load priority:
 * 1) Operational firmware residing in flash.
 * 2) Fail
 */


 ql4_printk(KERN_INFO, ha,
     "FW: Retrieving flash offsets from FLT return ;
 rval = qla4_8xxx_get_flash_info(ha);
 if (rval != QLA_SUCCESS)
  return rval;

 ql4_printk(KERN_INFO structqla4_83xx_minidump_entry_rdmem_pex_dma)
     java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 1
rval(ha >.flt_region_fw)

 if (rval != QLA_SUCCESS) {
  ql4_printk dma_base_addr ;
      " FAILED...\n");
  return rval;
 }

 eturn;
}

 ,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 (ha{
  /* Someone else is holding the lock. */
  dev_info(&ha->pdev->dev, "rval >isp_ops-wr_reg_indirectha,
 }

 /*
 * Either we got the lock, or someone
 * else died while holding it.
 * In either case, unlock.
 */

qla4_82xx_rom_unlockhajava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}

static ql4_84xx_poll_wait_for_ready scsi_qla_host*ajava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    uint32_t, uint32_t)
{
 
uint32_t;
 uint32_t wait0 wait ; wait+{

 timeout = jiffies + msecs_to_jiffies(TIMEOUT_100_MS);
do
       dma_base_addr QLA83XX_PEX_DMA_CMD_STS_AND_CNTRL,
  if ((temp & mask) != 0)
   break;

  if (time_after_eq(jiffies, timeout  ( &) == )
   ql4_printk
   return QLA_ERROR;
  }
 } while (1;

 return rval;
}

staticuint32_tql4_84xx_ipmdio_rd_regstructscsi_qla_hostha,uint32_t,
    uint32_t addr3, uint32_t mask, uint32_t}
    uint32_t *data_ptr)
{
 return;
 uint32_t temp;
 uint32_t data int( scsi_qla_hostha

 rval =  uint32_t*ptr
 if ({
  goto exit_ipmdio_rd_reg;

 temp = (0x40000000 | addr);
 ha->isp_ops->wr_reg_indirect(ha, addr1, temp);

 rval = ql4_84xx_poll_wait_for_ready(ha, addr1, mask);
 if ()
  goto exit_ipmdio_rd_reg;

 ha->isp_ops->rd_reg_indirect(ha, addr3, &data);
* = data

exit_ipmdio_rd_reg:
 return rval
}


static uint32_t ql4_84xx_poll_wait_ipmdio_bus_idle(struct scsi_qla_host (ql4_printkKERN_INFO " fn: %s\, _func__);
          uint32_t addr1,
          uint32_t addr2  (;
          uint32_t ( ! ){
          uint32_t mask)

 unsigned long    "s engine notavailable Fallback to \,
 uint32_ttemp
 uint32_t rval =  returnQLA_ERROR;

 timeout = jiffies + msecs_to_jiffies(TIMEOUT_100_MS);
 o {
  ql4_84xx_ipmdio_rd_reg(ha, addr1 m_hdr=( qla4_83xx_minidump_entry_rdmem_pex_dma;
  f(temp x1! )
   break;
  if (time_after_eq(jiffies, timeout)) {
   ql4_printk(KERN_INFO, ha, "Error in (!dmem_buffer){
   return;
 }
 } while    _func__))

 return rval;
}

static int ql4_84xx_ipmdio_wr_reg(struct scsi_qla_host *ha,
      uint32_t addr1, uint32_t addr3,
      uint32_t mask, uint32_t addr,
  uint32_t)
{
 int rval = QLA_SUCCESS;

 rval
 if (rval)
  goto exit_ipmdio_wr_reg;

 ha->isp_ops-  * Prepare dma in chunks of QLA83XX_PEX_DMA_READ_SIZE.
ha->>wr_reg_indirectha , addr

 rval =  size = QLA83XX_PEX_DMA_READ_SIZE;
 ifrvaljava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 gotoexit_ipmdio_wr_reg

exit_ipmdio_wr_reg  dma_free_coherent&>>,
 rval
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static   &,
    struct     GFP_KERNEL);
    uint32_t **d_ptr)
{
 uint32_t r_addr, r_stride, loop_cnt, i, r_value;
 truct *crb_hdr
 uint32_t *data_ptr =   DEBUG2(KERN_INFO,ha

 DEBUG2(ql4_printk(KERN_INFO, ha, _)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 crb_hdr = (struct
 r_addr = crb_hdr->addr;
r_stride >.addr_stride
 loop_cnt = crb_hdr->op_count  .cmd = size

  ( = ; i <loop_cnt+)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  ha->isp_ops->rd_reg_indirect(ha (uint64_t>desc_card_addr
  *++ =(r_addr
  *data_ptr++ = cpu_to_le32       (struct)/1))
 r_addr r_stride;
 }
 *d_ptr = data_ptr;
}

static int qla4_83xx_check_dma_engine_state(struct scsi_qla_host *ha)
{
 ;
 uint32_t dma_eng_num = 0, cmd_sts_and_cntrl = 0;
 uint64_t dma_base_addr = 0;
 struct qla4_8xxx_minidump_template_hdr

 tmplt_hdr=( qla4_8xxx_minidump_template_hdr
   ha->;
 dma_eng_num =
  tmplt_hdr->saved_state_array[ java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
 dma_base_addr = QLA83XX_PEX_DMA_BASE_ADDRESS +
    (dma_eng_num * QLA83XX_PEX_DMA_NUM_OFFSET);

java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
rvalha->rd_reg_indirect,
 dma_base_addr ),
   &cmd_sts_and_cntrl);

 if (rval)
  return QLA_ERROR;

java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
 if (cmd_sts_and_cntrl & BIT_31
 return;
 else
  return QLA_ERROR;
}

static int java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      struct qla4_83xx_minidump_entry_rdmem_pex_dma *m_hdr)
{
 int rval =     rdmem_dma;
 uint32_t dma_eng_num = 0, cmd_sts_and_cntrl = 0;
 uint64_t dma_base_addr = 0;
 struct qla4_8xxx_minidump_template_hdr *tmplt_hdr

 tmplt_hdr = (struct qla4_8xxx_minidump_template_hdr *)
    u *d_ptr
 dma_eng_num =
 tmplt_hdr-saved_state_array];
  ,,r_cnt
    (dma_eng_num * QLA83XX_PEX_DMA_NUM_OFFSET ,c_value_r

 rval = ha- 
    dma_base_addr + QLA83XX_PEX_DMA_CMD_ADDR_LOW,
    m_hdr-
 if (rval)
  goto error_exit;

(hajava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  ,;
   =>.;
 ;

 rval
       +,
     ha-isp_ops-(hat_r_addr,t_value)
 if
  ;

 /* Wait for dma operation to complete. */
 for (
  rval = ha->isp_ops->rd_reg_indirect   =   ;
       (dma_base_addr>>( ,
       &cmd_sts_and_cntrl);
  if (rval) ;
 ;

  if ((cmd_sts_and_cntrl &  ;
 ;
  else
   udelay(1aaddr;
}

 /* Wait a max of 100 ms, otherwise fallback to rdmem entry read */
 if (addr>.java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  goto error_exit
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2


 ,,,addr ;
 ;

staticstruct java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
*
java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
{
=;
* ;
 ,java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  opcode ;
 void * opcode) 
 dma_addr_t rdmem_dma;  ha-isp_ops-rd_reg_indirect(ha ,);
 struct qla4_83xx_pex_dma_descriptor dma_desc;

DEBUG2ql4_printk, ha " fn: %\"_func__;

 rval = qla4_83xx_check_dma_engine_state(ha);
 if (rval != QLA_SUCCESS) {
  (ql4_printkKERN_INFO,ha
 ha->rd_reg_indirect(ha,crb_addrread_value
     _));
 return QLA_ERRORjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}

 m_hdr = (struct qla4_83xx_minidump_entry_rdmem_pex_dma *  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 rdmem_buffer = dma_alloc_coherent(&ha->pdev- }
  java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
       &rdmem_dma, GFP_KERNEL);
 if (!rdmem_buffer) { java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
  DEBUG2(ql4_printk(KERN_INFO   >.poll_timeout
    %:Unableallocatedman"
      __func__));
  return QLA_ERROR;
 }

 /* Prepare pex-dma descriptor to be written to MS memory. */
 /* dma-desc-cmd layout: if(read_value  >value_2) =
 *              0-3: dma-desc-cmd 0-3
 *              4-7: pcid function number
 *              8-15: dma-desc-cmd 8-15
 */

 dma_desc.cmd.dma_desc_cmd = (m_hdr->dma_desc_cmd & 0xff0f);
 dma_desc.cmd.dma_desc_cmd |= ((PCI_FUNC(ha->pdev->devfn) & 0xf) << 0x4);
 dma_descdma_bus_addr rdmem_dma;

 size = 0;
 read_size = 0;
 /*
 * Perform rdmem operation using pex-dma.
 * Prepare dma in chunks of QLA83XX_PEX_DMA_READ_SIZE.
 */

 while (read_size < m_hdr->read_data_size) {
  if (m_hdr->read_data_size - read_size >=
      QLA83XX_PEX_DMA_READ_SIZE)
   size = QLA83XX_PEX_DMA_READ_SIZE;
  else {
 size (m_hdr- - );

   if  (1)
 (&ha->dev
        QLA83XX_PEX_DMA_READ_SIZE,
        rdmem_buffer, rdmem_dma);

   rdmem_buffer dma_alloc_coherent(>pdev-, size
         &rdmem_dma   = >crb_strdstate_index_a
         GFP_KERNEL);
   if (!rdmem_buffer) {
    DEBUG2(ql4_printk(KERN_INFO,     {
     %s Unableallocate dma\n",
          java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
   return ;
   }
   dma_desc.dma_bus_addr = rdmem_dma;
 }

  dma_desc.src_addr = m_hdr->read_addr + read_size;
  dma_desc.cmd.read_data_size = size;

  /* Prepare: Write pex-dma descriptor to MS memory. */
  rval = qla4_8xxx_ms_mem_write_128b(ha,
         (uint64_t)m_hdr->desc_card_addr,
         (uint32_t *)&dma_desc,
         (sizeof(struct qla4_83xx_pex_dma_descriptor)/ }else{
  if (rval != QLA_SUCCESS
   ql4_printk(KERN_INFO, ha,
      "s Errorwritingrdmem-dma-init MS !java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
       __func__);
   goto error_exit;
  }

 DEBUG2(KERN_INFOha
    %: Dma-desc Instructforrdmem size%)\"
      __func__, size));
  /* Execute: Start pex-dma operation. */
  rval = qla4_83xx_start_pex_dma(ha, m_hdr);
  if (rval != QLA_SUCCESS) {
   DEBUG2(ql4_printk(KERN_INFO, ha,
       "scsi(%ld): start-pex-dma failed rval=0x%x\n",
       ha- if(>value_2
   goto error_exit;
  }

  memcpy(ata_ptr rdmem_buffer);
  data_ptr += size;
  read_size += size;
 }

 DEBUG2(ql4_printk(KERN_INFO, ha, "Leaving fn: %s\n", __func__));

*_tr=( *)data_ptr

error_exit:
 if (rdmem_buffer)
  dma_free_coherent(&ha->pdev->dev, size, rdmem_buffer,
      rdmem_dma);

 return rval;
}

static int qla4_8xxx_minidump_process_l2tag(struct scsi_qla_host *ha,
     struct qla8xxx_minidump_entry_hdr *entry_hdr,
     uint32_t **d_ptr)
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
 uint32_t, r_addr,c_addr;
 uint32_t i,  ocm_hdr = (st qla8xxx_minidump_entry_rdocm)ntry_hdr
unsigned long, w_time,;
 uint32_t c_value_w, c_value_r  = ocm_hdr-read_addr_stride;
 struct qla8xxx_minidump_entry_cache *cache_hdr;
 int rval = QLA_ERROR;
 uint32_t*data_ptr = *_ptr;

 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__));
entry_hdr;

 loop_count = cache_hdr->op_count;
r = cache_hdr-read_addr;
 c_addr = cache_hdr->control_addr;
 c_value_w = cache_hdr->cache_ctrl.write_value;

 t_r_addr = cache_hdr->tag_reg_addr;
t_value=cache_hdr-addr_ctrlinit_tag_value
 r_cnt = cache_hdr-  r_value=readl( __iomem*(r_addr + ha-nx_pcibase;
 p_wait cache_hdr-cache_ctrlpoll_wait
 p_mask   r_addr +=r_stride;

 for (i = 0; i < loop_count; i++) {
  ha->isp_ops-wr_reg_indirect(ha, t_r_addr t_value

 if(c_value_w
   ha->isp_ops->wr_reg_indirect(ha, c_addr, c_value_w);

  if (p_mask) {
   w_time = jiffies + p_wait;
   do {
    ha->isp_ops->rd_reg_indirect(ha  struct *entry_hdr
           &c_value_r);
    if ((c_value_r & p_mask) == 0) {
  r_addr s_strides_addr, loop_cnt, i, r_value
    } else if (time_after_eq(jiffies, structqla8xxx_minidump_entry_muxmux_hdr
     /* capturing dump failed */
     return rval;
   }
   } while (1);
  }

  addr = r_addr;
  for (k = 0; k < r_cnt; k++) {
   ha->isp_ops->rd_reg_indirect(ha, addr, &r_value);
   *data_ptr++ = cpu_to_le32(r_value);
   addr += cache_hdr->read_ctrl.read_addr_stride;
  }

  t_value=cache_hdr->addr_ctrltag_value_stride
 }
 *d_ptr = data_ptr;
 return QLA_SUCCESS;
}

static int qla4_8xxx_minidump_process_control(struct scsi_qla_host *ha,
    struct qla8xxx_minidump_entry_hdr *entry_hdr)
{
 struct qla8xxx_minidump_entry_crb *crb_entry;
 uint32_t read_value, opcode, poll_time, addr, index, rval = QLA_SUCCESS;
 uint32_t crb_addr;
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 structjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
intjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__));
 tmplt_hdr = (struct qla4_8xxx_minidump_template_hdr *)
      ha->fw_dump_tmplt_hdr;
 crb_entry = (struct qla8xxx_minidump_entry_crb *)entry_hdr;

 crb_addr = crb_entry->addr;
 for (i = 0; i < crb_entry->op_count; i++) {
  opcode = crb_entry->crb_ctrl.opcode;
  if (opcode & QLA8XXX_DBG_OPCODE_WR) {
   ha->isp_ops->wr_reg_indirect(ha, crb_addr,
           crb_entry->value_1);
   opcode &= ~QLA8XXX_DBG_OPCODE_WR;
  }
  if (opcode & QLA8XXX_DBG_OPCODE_RW) {
   ha->isp_ops->rd_reg_indirect(ha, crb_addr, &read_value);
   ha->isp_ops->wr_reg_indirect(ha, crb_addr, read_value);
   opcode &= ~QLA8XXX_DBG_OPCODE_RW;
  }
  if (opcode & QLA8XXX_DBG_OPCODE_AND) {
   ha->isp_ops->rd_reg_indirect(ha, crb_addr, &read_value);
   read_value &= crb_entry->value_2;
   opcode &= ~QLA8XXX_DBG_OPCODE_AND;
   if (opcode & QLA8XXX_DBG_OPCODE_OR) {
    read_value |= crb_entry->value_3;
    opcode &= ~QLA8XXX_DBG_OPCODE_OR;
   }
   ha->isp_ops->wr_reg_indirect(ha, crb_addr, read_value);
  }
  if (opcode & QLA8XXX_DBG_OPCODE_OR) {
   ha->isp_ops->rd_reg_indirect(ha, crb_addr, &read_value);
   read_value |= crb_entry->value_3;
   ha->isp_ops->wr_reg_indirect(ha, crb_addr, read_value);
   opcode &= ~QLA8XXX_DBG_OPCODE_OR;
  }
  if (opcode & QLA8XXX_DBG_OPCODE_POLL) {
   poll_time = crb_entry->crb_strd.poll_timeout;
   wtime = jiffies + poll_time;
   ha->isp_ops->rd_reg_indirect(ha, crb_addr, &read_value);

   do {
    if ((read_value & crb_entry->value_2) ==
        crb_entry->value_1) {
     break;
    } else if (time_after_eq(jiffies, wtime)) {
     /* capturing dump failed */
     rval = QLA_ERROR;
     break;
    } else {
     ha->isp_ops->rd_reg_indirect(ha,
       crb_addr, &read_value);
    }
   } while (1);
   opcode &= ~QLA8XXX_DBG_OPCODE_POLL;
  }

  if (opcode & QLA8XXX_DBG_OPCODE_RDSTATE) {
   if (crb_entry->crb_strd.state_index_a) {
    index = crb_entry->crb_strd.state_index_a;
    addr = tmplt_hdr->saved_state_array[index];
   } else {
    addr = crb_addr;
   }

   ha->isp_ops->rd_reg_indirect(ha, addr, &read_value);
   index = crb_entry->crb_ctrl.state_index_v;
   tmplt_hdr->saved_state_array[index] = read_value;
   opcode &= ~QLA8XXX_DBG_OPCODE_RDSTATE;
  }

  if (opcode & QLA8XXX_DBG_OPCODE_WRSTATE) {
   if (crb_entry->crb_strd.state_index_a) {
    index = crb_entry->crb_strd.state_index_a;
    addr = tmplt_hdr->saved_state_array[index];
   } else {
    addr = crb_addr;
   }

   if (crb_entry->crb_ctrl.state_index_v) {
    index = crb_entry->crb_ctrl.state_index_v;
    read_value =
     tmplt_hdr->saved_state_array[index];
   } else {
    read_value = crb_entry->value_1;
   }

   ha->isp_ops->wr_reg_indirect(ha, addr, read_value);
   opcode &= ~QLA8XXX_DBG_OPCODE_WRSTATE;
  }

  if (opcode & QLA8XXX_DBG_OPCODE_MDSTATE) {
   index = crb_entry->crb_ctrl.state_index_v;
   read_value = tmplt_hdr->saved_state_array[index];
   read_value <<= crb_entry->crb_ctrl.shl;
   read_value >>= crb_entry->crb_ctrl.shr;
   if (crb_entry->value_2)
    read_value &= crb_entry->value_2;
   read_value |= crb_entry->value_3;
   read_value += crb_entry->value_1;
   tmplt_hdr->saved_state_array[index] = read_value;
   opcode &= ~QLA8XXX_DBG_OPCODE_MDSTATE;
  }
  crb_addr += crb_entry->crb_strd.addr_stride;
 }
 DEBUG2(ql4_printk(KERN_INFO, ha, "Leaving fn: %s\n", __func__));
 return rval;
}

static void qla4_8xxx_minidump_process_rdocm(struct scsi_qla_host *ha,
    struct qla8xxx_minidump_entry_hdr *entry_hdr,
    uint32_t **d_ptr)
{
 uint32_t r_addr, r_stride, loop_cnt, i, r_value;
 struct qla8xxx_minidump_entry_rdocm *ocm_hdr;
 uint32_t *data_ptr = *d_ptr;

 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__));
 ocm_hdr = (struct qla8xxx_minidump_entry_rdocm *)entry_hdr;
 r_addr = ocm_hdr->read_addr;
 r_stride = ocm_hdr->read_addr_stride;
 loop_cnt = ocm_hdr->op_count;

 DEBUG2(ql4_printk(KERN_INFO, ha,
     "[%s]: r_addr: 0x%x, r_stride: 0x%x, loop_cnt: 0x%x\n",
     __func__, r_addr, r_stride, loop_cnt));

 for (i = 0; i < loop_cnt; i++) {
  r_value = readl((void __iomem *)(r_addr + ha->nx_pcibase));
  *data_ptr++ = cpu_to_le32(r_value);
  r_addr += r_stride;
 }
 DEBUG2(ql4_printk(KERN_INFO, ha, "Leaving fn: %s datacount: 0x%lx\n",
  __func__, (long unsigned int) (loop_cnt * sizeof(uint32_t))));
 *d_ptr = data_ptr;
}

static void qla4_8xxx_minidump_process_rdmux(struct scsi_qla_host *ha,
    struct qla8xxx_minidump_entry_hdr *entry_hdr,
    uint32_t **d_ptr)
{
 uint32_t r_addr, s_stride, s_addr, s_value, loop_cnt, i, r_value;
 struct qla8xxx_minidump_entry_mux *mux_hdr;
 uint32_t *data_ptr = *d_ptr;

 DEBUG2(ql4_printk(KERN_INFO, ha, "Entering fn: %s\n", __func__));
 mux_hdr = (struct qla8xxx_minidump_entry_mux *)entry_hdr;
 r_addr = mux_hdr->read_addr;
 s_addr = mux_hdr->select_addr;
 s_stride = mux_hdr->select_value_stride;
 s_value = mux_hdr->select_value;
 loop_cnt = mux_hdr->op_count;

 for (i = 0; i < loop_cnt; i++) {
  ha->isp_ops->wr_reg_indirect(ha, s_addr, s_value);
  ha->isp_ops->rd_reg_indirect(ha, r_addr, &r_value);
  *data_ptr++ = cpu_to_le32(s_value);
  *data_ptr++ = cpu_to_le32(r_value);
  s_value += s_stride;
 }
 *d_ptr = data_ptr;
}

static void qla4_8xxx_minidump_process_l1cache(struct scsi_qla_host *ha,
    struct qla8xxx_minidump_entry_hdr *entry_hdr,
    uint32_t **d_ptr)
{
 uint32_t addr, r_addr, c_addr, t_r_addr;
--> --------------------

--> maximum size reached

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

Messung V0.5
C=93 H=85 G=88

¤ Dauer der Verarbeitung: 0.30 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






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.