Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
qla_nx.c File Reference
#include "qla_def.h"
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/ratelimit.h>
#include <linux/vmalloc.h>
#include <scsi/scsi_tcq.h>

Go to the source code of this file.

Macros

#define MASK(n)   ((1ULL<<(n))-1)
 
#define MN_WIN(addr)
 
#define OCM_WIN(addr)
 
#define MS_WIN(addr)   (addr & 0x0ffc0000)
 
#define QLA82XX_PCI_MN_2M   (0)
 
#define QLA82XX_PCI_MS_2M   (0x80000)
 
#define QLA82XX_PCI_OCM0_2M   (0xc0000)
 
#define VALID_OCM_ADDR(addr)   (((addr) & 0x3f800) != 0x3f800)
 
#define GET_MEM_OFFS_2M(addr)   (addr & MASK(18))
 
#define BLOCK_PROTECT_BITS   0x0F
 
#define CRB_BLK(off)   ((off >> 20) & 0x3f)
 
#define CRB_SUBBLK(off)   ((off >> 16) & 0xf)
 
#define CRB_WINDOW_2M   (0x130060)
 
#define QLA82XX_PCI_CAMQM_2M_END   (0x04800800UL)
 
#define CRB_HI(off)
 
#define QLA82XX_PCI_CAMQM_2M_BASE   (0x000ff800UL)
 
#define CRB_INDIRECT_2M   (0x1e0000UL)
 
#define MAX_CRB_XFORM   60
 
#define qla82xx_crb_addr_transform(name)
 
#define CRB_WIN_LOCK_TIMEOUT   100000000
 
#define IDC_LOCK_TIMEOUT   100000000
 
#define QLA82XX_ADDR_IN_RANGE(addr, low, high)   (((addr) <= (high)) && ((addr) >= (low)))
 
#define MTU_FUDGE_FACTOR   100
 

Functions

charqdev_state (uint32_t dev_state)
 
int qla82xx_wr_32 (struct qla_hw_data *ha, ulong off, u32 data)
 
int qla82xx_rd_32 (struct qla_hw_data *ha, ulong off)
 
int qla82xx_idc_lock (struct qla_hw_data *ha)
 
void qla82xx_idc_unlock (struct qla_hw_data *ha)
 
int qla82xx_md_rw_32 (struct qla_hw_data *ha, uint32_t off, u32 data, uint8_t flag)
 
int qla82xx_pci_mem_read_2M (struct qla_hw_data *ha, u64 off, void *data, int size)
 
int qla82xx_pci_region_offset (struct pci_dev *pdev, int region)
 
int qla82xx_iospace_config (struct qla_hw_data *ha)
 
int qla82xx_pci_config (scsi_qla_host_t *vha)
 
void qla82xx_reset_chip (scsi_qla_host_t *vha)
 
void qla82xx_config_rings (struct scsi_qla_host *vha)
 
void qla82xx_reset_adapter (struct scsi_qla_host *vha)
 
int qla82xx_validate_firmware_blob (scsi_qla_host_t *vha, uint8_t fw_type)
 
irqreturn_t qla82xx_intr_handler (int irq, void *dev_id)
 
irqreturn_t qla82xx_msix_default (int irq, void *dev_id)
 
irqreturn_t qla82xx_msix_rsp_q (int irq, void *dev_id)
 
void qla82xx_poll (int irq, void *dev_id)
 
void qla82xx_enable_intrs (struct qla_hw_data *ha)
 
void qla82xx_disable_intrs (struct qla_hw_data *ha)
 
void qla82xx_init_flags (struct qla_hw_data *ha)
 
void qla82xx_set_idc_version (scsi_qla_host_t *vha)
 
void qla82xx_set_drv_active (scsi_qla_host_t *vha)
 
void qla82xx_clear_drv_active (struct qla_hw_data *ha)
 
void qla82xx_clear_qsnt_ready (scsi_qla_host_t *vha)
 
int qla82xx_start_firmware (scsi_qla_host_t *vha)
 
uint8_tqla82xx_read_optrom_data (struct scsi_qla_host *vha, uint8_t *buf, uint32_t offset, uint32_t length)
 
int qla82xx_write_optrom_data (struct scsi_qla_host *vha, uint8_t *buf, uint32_t offset, uint32_t length)
 
void qla82xx_start_iocbs (scsi_qla_host_t *vha)
 
void qla82xx_rom_lock_recovery (struct qla_hw_data *ha)
 
uint32_t qla82xx_wait_for_state_change (scsi_qla_host_t *vha, uint32_t curr_state)
 
void qla8xxx_dev_failed_handler (scsi_qla_host_t *vha)
 
int qla82xx_check_md_needed (scsi_qla_host_t *vha)
 
int qla82xx_check_fw_alive (scsi_qla_host_t *vha)
 
int qla82xx_device_state_handler (scsi_qla_host_t *vha)
 
void qla82xx_clear_pending_mbx (scsi_qla_host_t *vha)
 
void qla82xx_watchdog (scsi_qla_host_t *vha)
 
int qla82xx_load_risc (scsi_qla_host_t *vha, uint32_t *srisc_addr)
 
void qla82xx_set_reset_owner (scsi_qla_host_t *vha)
 
int qla82xx_abort_isp (scsi_qla_host_t *vha)
 
int qla82xx_fcoe_ctx_reset (scsi_qla_host_t *vha)
 
int qla2x00_wait_for_fcoe_ctx_reset (scsi_qla_host_t *vha)
 
void qla82xx_chip_reset_cleanup (scsi_qla_host_t *vha)
 
int qla82xx_md_collect (scsi_qla_host_t *vha)
 
int qla82xx_md_alloc (scsi_qla_host_t *vha)
 
void qla82xx_md_free (scsi_qla_host_t *vha)
 
void qla82xx_md_prep (scsi_qla_host_t *vha)
 
int qla82xx_beacon_on (struct scsi_qla_host *vha)
 
int qla82xx_beacon_off (struct scsi_qla_host *vha)
 

Variables

int qla82xx_crb_table_initialized
 
struct crb_128M_2M_block_map crb_128M_2M_map [64]
 
unsigned qla82xx_crb_hub_agt [64]
 
charq_dev_state []
 
int qla82xx_pci_set_window_warning_count
 
uint32_t qla82xx_isr_int_target_mask_enable [8]
 
uint32_t qla82xx_isr_int_target_status [8]
 

Macro Definition Documentation

#define BLOCK_PROTECT_BITS   0x0F

Definition at line 25 of file qla_nx.c.

#define CRB_BLK (   off)    ((off >> 20) & 0x3f)

Definition at line 28 of file qla_nx.c.

#define CRB_HI (   off)
Value:
((qla82xx_crb_hub_agt[CRB_BLK(off)] << 20) | \
((off) & 0xf0000))

Definition at line 32 of file qla_nx.c.

#define CRB_INDIRECT_2M   (0x1e0000UL)

Definition at line 35 of file qla_nx.c.

#define CRB_SUBBLK (   off)    ((off >> 16) & 0xf)

Definition at line 29 of file qla_nx.c.

#define CRB_WIN_LOCK_TIMEOUT   100000000

Definition at line 448 of file qla_nx.c.

#define CRB_WINDOW_2M   (0x130060)

Definition at line 30 of file qla_nx.c.

#define GET_MEM_OFFS_2M (   addr)    (addr & MASK(18))

Definition at line 24 of file qla_nx.c.

#define IDC_LOCK_TIMEOUT   100000000

Definition at line 516 of file qla_nx.c.

#define MASK (   n)    ((1ULL<<(n))-1)

Definition at line 14 of file qla_nx.c.

#define MAX_CRB_XFORM   60

Definition at line 37 of file qla_nx.c.

#define MN_WIN (   addr)
Value:
(((addr & 0x1fc0000) >> 1) | \
((addr >> 25) & 0x3ff))

Definition at line 15 of file qla_nx.c.

#define MS_WIN (   addr)    (addr & 0x0ffc0000)

Definition at line 19 of file qla_nx.c.

#define MTU_FUDGE_FACTOR   100

Definition at line 817 of file qla_nx.c.

#define OCM_WIN (   addr)
Value:
(((addr & 0x1ff0000) >> 1) | \
((addr >> 25) & 0x3ff))

Definition at line 17 of file qla_nx.c.

#define QLA82XX_ADDR_IN_RANGE (   addr,
  low,
  high 
)    (((addr) <= (high)) && ((addr) >= (low)))

Definition at line 550 of file qla_nx.c.

#define qla82xx_crb_addr_transform (   name)
Value:
(crb_addr_xform[QLA82XX_HW_PX_MAP_CRB_##name] = \
QLA82XX_HW_CRB_HUB_AGT_ADR_##name << 20)

Definition at line 41 of file qla_nx.c.

#define QLA82XX_PCI_CAMQM_2M_BASE   (0x000ff800UL)

Definition at line 34 of file qla_nx.c.

#define QLA82XX_PCI_CAMQM_2M_END   (0x04800800UL)

Definition at line 31 of file qla_nx.c.

#define QLA82XX_PCI_MN_2M   (0)

Definition at line 20 of file qla_nx.c.

#define QLA82XX_PCI_MS_2M   (0x80000)

Definition at line 21 of file qla_nx.c.

#define QLA82XX_PCI_OCM0_2M   (0xc0000)

Definition at line 22 of file qla_nx.c.

#define VALID_OCM_ADDR (   addr)    (((addr) & 0x3f800) != 0x3f800)

Definition at line 23 of file qla_nx.c.

Function Documentation

char* qdev_state ( uint32_t  dev_state)

Definition at line 344 of file qla_nx.c.

int qla2x00_wait_for_fcoe_ctx_reset ( scsi_qla_host_t vha)

Definition at line 3593 of file qla_nx.c.

int qla82xx_abort_isp ( scsi_qla_host_t vha)

Definition at line 3485 of file qla_nx.c.

int qla82xx_beacon_off ( struct scsi_qla_host vha)

Definition at line 4454 of file qla_nx.c.

int qla82xx_beacon_on ( struct scsi_qla_host vha)

Definition at line 4434 of file qla_nx.c.

int qla82xx_check_fw_alive ( scsi_qla_host_t vha)

Definition at line 3181 of file qla_nx.c.

int qla82xx_check_md_needed ( scsi_qla_host_t vha)

Definition at line 3139 of file qla_nx.c.

void qla82xx_chip_reset_cleanup ( scsi_qla_host_t vha)

Definition at line 3619 of file qla_nx.c.

void qla82xx_clear_drv_active ( struct qla_hw_data ha)
inline

Definition at line 2347 of file qla_nx.c.

void qla82xx_clear_pending_mbx ( scsi_qla_host_t vha)

Definition at line 3354 of file qla_nx.c.

void qla82xx_clear_qsnt_ready ( scsi_qla_host_t vha)

Definition at line 2411 of file qla_nx.c.

void qla82xx_config_rings ( struct scsi_qla_host vha)

Definition at line 1743 of file qla_nx.c.

int qla82xx_device_state_handler ( scsi_qla_host_t vha)

Definition at line 3223 of file qla_nx.c.

void qla82xx_disable_intrs ( struct qla_hw_data ha)

Definition at line 2278 of file qla_nx.c.

void qla82xx_enable_intrs ( struct qla_hw_data ha)

Definition at line 2267 of file qla_nx.c.

int qla82xx_fcoe_ctx_reset ( scsi_qla_host_t vha)

Definition at line 3561 of file qla_nx.c.

int qla82xx_idc_lock ( struct qla_hw_data ha)

Definition at line 517 of file qla_nx.c.

void qla82xx_idc_unlock ( struct qla_hw_data ha)

Definition at line 544 of file qla_nx.c.

void qla82xx_init_flags ( struct qla_hw_data ha)

Definition at line 2288 of file qla_nx.c.

irqreturn_t qla82xx_intr_handler ( int  irq,
void dev_id 
)

Definition at line 2020 of file qla_nx.c.

int qla82xx_iospace_config ( struct qla_hw_data ha)

Definition at line 1634 of file qla_nx.c.

int qla82xx_load_risc ( scsi_qla_host_t vha,
uint32_t srisc_addr 
)

Definition at line 3445 of file qla_nx.c.

int qla82xx_md_alloc ( scsi_qla_host_t vha)

Definition at line 4331 of file qla_nx.c.

int qla82xx_md_collect ( scsi_qla_host_t vha)

Definition at line 4123 of file qla_nx.c.

void qla82xx_md_free ( scsi_qla_host_t vha)

Definition at line 4368 of file qla_nx.c.

void qla82xx_md_prep ( scsi_qla_host_t vha)

Definition at line 4394 of file qla_nx.c.

int qla82xx_md_rw_32 ( struct qla_hw_data ha,
uint32_t  off,
u32  data,
uint8_t  flag 
)

Definition at line 912 of file qla_nx.c.

irqreturn_t qla82xx_msix_default ( int  irq,
void dev_id 
)

Definition at line 2113 of file qla_nx.c.

irqreturn_t qla82xx_msix_rsp_q ( int  irq,
void dev_id 
)

Definition at line 2186 of file qla_nx.c.

int qla82xx_pci_config ( scsi_qla_host_t vha)

qla82xx_pci_config() - Setup ISP82xx PCI configuration registers. : HA context

Returns 0 on success.

Definition at line 1716 of file qla_nx.c.

int qla82xx_pci_mem_read_2M ( struct qla_hw_data ha,
u64  off,
void data,
int  size 
)

Definition at line 1437 of file qla_nx.c.

int qla82xx_pci_region_offset ( struct pci_dev pdev,
int  region 
)

Definition at line 1615 of file qla_nx.c.

void qla82xx_poll ( int  irq,
void dev_id 
)

Definition at line 2212 of file qla_nx.c.

int qla82xx_rd_32 ( struct qla_hw_data ha,
ulong  off 
)

Definition at line 492 of file qla_nx.c.

uint8_t* qla82xx_read_optrom_data ( struct scsi_qla_host vha,
uint8_t buf,
uint32_t  offset,
uint32_t  length 
)

Definition at line 2663 of file qla_nx.c.

void qla82xx_reset_adapter ( struct scsi_qla_host vha)

Definition at line 1767 of file qla_nx.c.

void qla82xx_reset_chip ( scsi_qla_host_t vha)

qla82xx_reset_chip() - Setup ISP82xx PCI configuration registers. : HA context

Returns 0 on success.

Definition at line 1737 of file qla_nx.c.

void qla82xx_rom_lock_recovery ( struct qla_hw_data ha)

Definition at line 2824 of file qla_nx.c.

void qla82xx_set_drv_active ( scsi_qla_host_t vha)
inline

Definition at line 2329 of file qla_nx.c.

void qla82xx_set_idc_version ( scsi_qla_host_t vha)
inline

Definition at line 2306 of file qla_nx.c.

void qla82xx_set_reset_owner ( scsi_qla_host_t vha)

Definition at line 3453 of file qla_nx.c.

int qla82xx_start_firmware ( scsi_qla_host_t vha)

Definition at line 2502 of file qla_nx.c.

void qla82xx_start_iocbs ( scsi_qla_host_t vha)

Definition at line 2792 of file qla_nx.c.

int qla82xx_validate_firmware_blob ( scsi_qla_host_t vha,
uint8_t  fw_type 
)

Definition at line 1860 of file qla_nx.c.

uint32_t qla82xx_wait_for_state_change ( scsi_qla_host_t vha,
uint32_t  curr_state 
)

Definition at line 3005 of file qla_nx.c.

void qla82xx_watchdog ( scsi_qla_host_t vha)

Definition at line 3368 of file qla_nx.c.

int qla82xx_wr_32 ( struct qla_hw_data ha,
ulong  off,
u32  data 
)

Definition at line 467 of file qla_nx.c.

int qla82xx_write_optrom_data ( struct scsi_qla_host vha,
uint8_t buf,
uint32_t  offset,
uint32_t  length 
)

Definition at line 2772 of file qla_nx.c.

void qla8xxx_dev_failed_handler ( scsi_qla_host_t vha)

Definition at line 3021 of file qla_nx.c.

Variable Documentation

struct crb_128M_2M_block_map crb_128M_2M_map[64]

Definition at line 105 of file qla_nx.c.

char* q_dev_state[]
Initial value:
= {
"Unknown",
"Cold",
"Initializing",
"Ready",
"Need Reset",
"Need Quiescent",
"Failed",
"Quiescent",
}

Definition at line 333 of file qla_nx.c.

unsigned qla82xx_crb_hub_agt[64]

Definition at line 265 of file qla_nx.c.

int qla82xx_crb_table_initialized

Definition at line 39 of file qla_nx.c.

uint32_t qla82xx_isr_int_target_mask_enable[8]
uint32_t qla82xx_isr_int_target_status[8]
int qla82xx_pci_set_window_warning_count

Definition at line 570 of file qla_nx.c.