Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ql4_nx.c File Reference
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/pci.h>
#include <linux/ratelimit.h>
#include "ql4_def.h"
#include "ql4_glbl.h"
#include "ql4_inline.h"
#include <asm-generic/io-64-nonatomic-lo-hi.h>

Go to the source code of this file.

Data Structures

struct  ql4_init_msix_entry
 

Macros

#define MASK(n)   DMA_BIT_MASK(n)
 
#define MN_WIN(addr)   (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff))
 
#define OCM_WIN(addr)   (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff))
 
#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 CRB_BLK(off)   ((off >> 20) & 0x3f)
 
#define CRB_SUBBLK(off)   ((off >> 16) & 0xf)
 
#define CRB_WINDOW_2M   (0x130060)
 
#define CRB_HI(off)
 
#define QLA82XX_PCI_CAMQM_2M_END   (0x04800800UL)
 
#define QLA82XX_PCI_CAMQM_2M_BASE   (0x000ff800UL)
 
#define CRB_INDIRECT_2M   (0x1e0000UL)
 
#define MAX_CRB_XFORM   60
 
#define qla4_8xxx_crb_addr_transform(name)
 
#define CRB_WIN_LOCK_TIMEOUT   100000000
 
#define IDC_LOCK_TIMEOUT   100000000
 
#define MTU_FUDGE_FACTOR   100
 
#define MD_DIRECT_ROM_WINDOW   0x42110030
 
#define MD_DIRECT_ROM_READ_BASE   0x42150000
 
#define MD_MIU_TEST_AGT_CTRL   0x41000090
 
#define MD_MIU_TEST_AGT_ADDR_LO   0x41000094
 
#define MD_MIU_TEST_AGT_ADDR_HI   0x41000098
 
#define OPTROM_BURST_SIZE   0x1000
 
#define OPTROM_BURST_DWORDS   (OPTROM_BURST_SIZE / 4)
 
#define FARX_DATA_FLAG   BIT_31
 
#define FARX_ACCESS_FLASH_CONF   0x7FFD0000
 
#define FARX_ACCESS_FLASH_DATA   0x7FF00000
 
#define FLASH_BLK_SIZE_4K   0x1000
 
#define FLASH_BLK_SIZE_32K   0x8000
 
#define FLASH_BLK_SIZE_64K   0x10000
 
#define QLA82XX_IDC_PARAM_ADDR   0x003e885c
 

Functions

void qla4_82xx_wr_32 (struct scsi_qla_host *ha, ulong off, u32 data)
 
uint32_t qla4_82xx_rd_32 (struct scsi_qla_host *ha, ulong off)
 
int qla4_82xx_md_rd_32 (struct scsi_qla_host *ha, uint32_t off, uint32_t *data)
 
int qla4_82xx_md_wr_32 (struct scsi_qla_host *ha, uint32_t off, uint32_t data)
 
int qla4_82xx_crb_win_lock (struct scsi_qla_host *ha)
 
void qla4_82xx_crb_win_unlock (struct scsi_qla_host *ha)
 
int qla4_82xx_idc_lock (struct scsi_qla_host *ha)
 
void qla4_82xx_idc_unlock (struct scsi_qla_host *ha)
 
int qla4_82xx_pci_get_crb_addr_2M (struct scsi_qla_host *ha, ulong *off)
 
int qla4_82xx_pci_mem_read_2M (struct scsi_qla_host *ha, u64 off, void *data, int size)
 
int qla4_82xx_pci_mem_write_2M (struct scsi_qla_host *ha, u64 off, void *data, int size)
 
void qla4_8xxx_set_drv_active (struct scsi_qla_host *ha)
 
void qla4_8xxx_clear_drv_active (struct scsi_qla_host *ha)
 
int qla4_8xxx_need_reset (struct scsi_qla_host *ha)
 
void qla4_8xxx_set_rst_ready (struct scsi_qla_host *ha)
 
void qla4_8xxx_clear_rst_ready (struct scsi_qla_host *ha)
 
int qla4_82xx_try_start_fw (struct scsi_qla_host *ha)
 
void qla4_82xx_rom_lock_recovery (struct scsi_qla_host *ha)
 
void qla4_8xxx_get_minidump (struct scsi_qla_host *ha)
 
int qla4_8xxx_device_bootstrap (struct scsi_qla_host *ha)
 
void qla4_8xxx_need_qsnt_handler (struct scsi_qla_host *ha)
 
int qla4_8xxx_update_idc_reg (struct scsi_qla_host *ha)
 
int qla4_8xxx_device_state_handler (struct scsi_qla_host *ha)
 
int qla4_8xxx_load_risc (struct scsi_qla_host *ha)
 
void qla4_82xx_queue_mbox_cmd (struct scsi_qla_host *ha, uint32_t *mbx_cmd, int in_count)
 
void qla4_82xx_process_mbox_intr (struct scsi_qla_host *ha, int out_count)
 
int qla4_8xxx_get_flash_info (struct scsi_qla_host *ha)
 
int qla4_8xxx_stop_firmware (struct scsi_qla_host *ha)
 
int qla4_82xx_isp_reset (struct scsi_qla_host *ha)
 
int qla4_8xxx_get_sys_info (struct scsi_qla_host *ha)
 
int qla4_8xxx_mbx_intr_enable (struct scsi_qla_host *ha)
 
int qla4_8xxx_mbx_intr_disable (struct scsi_qla_host *ha)
 
void qla4_82xx_enable_intrs (struct scsi_qla_host *ha)
 
void qla4_82xx_disable_intrs (struct scsi_qla_host *ha)
 
void qla4_8xxx_disable_msix (struct scsi_qla_host *ha)
 
int qla4_8xxx_enable_msix (struct scsi_qla_host *ha)
 

Variables

struct ql4_init_msix_entry __attribute__
 

Macro Definition Documentation

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

Definition at line 28 of file ql4_nx.c.

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

Definition at line 31 of file ql4_nx.c.

#define CRB_INDIRECT_2M   (0x1e0000UL)

Definition at line 35 of file ql4_nx.c.

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

Definition at line 29 of file ql4_nx.c.

#define CRB_WIN_LOCK_TIMEOUT   100000000

Definition at line 476 of file ql4_nx.c.

#define CRB_WINDOW_2M   (0x130060)

Definition at line 30 of file ql4_nx.c.

#define FARX_ACCESS_FLASH_CONF   0x7FFD0000

Definition at line 3003 of file ql4_nx.c.

#define FARX_ACCESS_FLASH_DATA   0x7FF00000

Definition at line 3004 of file ql4_nx.c.

#define FARX_DATA_FLAG   BIT_31

Definition at line 3002 of file ql4_nx.c.

#define FLASH_BLK_SIZE_32K   0x8000
#define FLASH_BLK_SIZE_4K   0x1000
#define FLASH_BLK_SIZE_64K   0x10000
#define GET_MEM_OFFS_2M (   addr)    (addr & MASK(18))

Definition at line 25 of file ql4_nx.c.

#define IDC_LOCK_TIMEOUT   100000000

Definition at line 510 of file ql4_nx.c.

#define MASK (   n)    DMA_BIT_MASK(n)

Definition at line 17 of file ql4_nx.c.

#define MAX_CRB_XFORM   60

Definition at line 47 of file ql4_nx.c.

#define MD_DIRECT_ROM_READ_BASE   0x42150000

Definition at line 2035 of file ql4_nx.c.

#define MD_DIRECT_ROM_WINDOW   0x42110030

Definition at line 2034 of file ql4_nx.c.

#define MD_MIU_TEST_AGT_ADDR_HI   0x41000098

Definition at line 2069 of file ql4_nx.c.

#define MD_MIU_TEST_AGT_ADDR_LO   0x41000094

Definition at line 2068 of file ql4_nx.c.

#define MD_MIU_TEST_AGT_CTRL   0x41000090

Definition at line 2067 of file ql4_nx.c.

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

Definition at line 18 of file ql4_nx.c.

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

Definition at line 20 of file ql4_nx.c.

#define MTU_FUDGE_FACTOR   100

Definition at line 851 of file ql4_nx.c.

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

Definition at line 19 of file ql4_nx.c.

#define OPTROM_BURST_DWORDS   (OPTROM_BURST_SIZE / 4)

Definition at line 3000 of file ql4_nx.c.

#define OPTROM_BURST_SIZE   0x1000

Definition at line 2999 of file ql4_nx.c.

#define qla4_8xxx_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 51 of file ql4_nx.c.

#define QLA82XX_IDC_PARAM_ADDR   0x003e885c
#define QLA82XX_PCI_CAMQM_2M_BASE   (0x000ff800UL)

Definition at line 34 of file ql4_nx.c.

#define QLA82XX_PCI_CAMQM_2M_END   (0x04800800UL)

Definition at line 33 of file ql4_nx.c.

#define QLA82XX_PCI_MN_2M   (0)

Definition at line 21 of file ql4_nx.c.

#define QLA82XX_PCI_MS_2M   (0x80000)

Definition at line 22 of file ql4_nx.c.

#define QLA82XX_PCI_OCM0_2M   (0xc0000)

Definition at line 23 of file ql4_nx.c.

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

Definition at line 24 of file ql4_nx.c.

Function Documentation

int qla4_82xx_crb_win_lock ( struct scsi_qla_host ha)

Definition at line 478 of file ql4_nx.c.

void qla4_82xx_crb_win_unlock ( struct scsi_qla_host ha)

Definition at line 505 of file ql4_nx.c.

void qla4_82xx_disable_intrs ( struct scsi_qla_host ha)

Definition at line 3522 of file ql4_nx.c.

void qla4_82xx_enable_intrs ( struct scsi_qla_host ha)

Definition at line 3510 of file ql4_nx.c.

int qla4_82xx_idc_lock ( struct scsi_qla_host ha)

qla4_82xx_idc_lock - hw_lock : pointer to adapter structure

General purpose lock used to synchronize access to CRB_DEV_STATE, CRB_DEV_REF_COUNT, etc.

Definition at line 519 of file ql4_nx.c.

void qla4_82xx_idc_unlock ( struct scsi_qla_host ha)

Definition at line 545 of file ql4_nx.c.

int qla4_82xx_isp_reset ( struct scsi_qla_host ha)

qla4_82xx_isp_reset - Resets ISP and aborts all outstanding commands. : pointer to host adapter structure.

Definition at line 3360 of file ql4_nx.c.

int qla4_82xx_md_rd_32 ( struct scsi_qla_host ha,
uint32_t  off,
uint32_t data 
)

Definition at line 425 of file ql4_nx.c.

int qla4_82xx_md_wr_32 ( struct scsi_qla_host ha,
uint32_t  off,
uint32_t  data 
)

Definition at line 451 of file ql4_nx.c.

int qla4_82xx_pci_get_crb_addr_2M ( struct scsi_qla_host ha,
ulong off 
)

Definition at line 551 of file ql4_nx.c.

int qla4_82xx_pci_mem_read_2M ( struct scsi_qla_host ha,
u64  off,
void data,
int  size 
)

Definition at line 1257 of file ql4_nx.c.

int qla4_82xx_pci_mem_write_2M ( struct scsi_qla_host ha,
u64  off,
void data,
int  size 
)

Definition at line 1348 of file ql4_nx.c.

void qla4_82xx_process_mbox_intr ( struct scsi_qla_host ha,
int  out_count 
)

Definition at line 3289 of file ql4_nx.c.

void qla4_82xx_queue_mbox_cmd ( struct scsi_qla_host ha,
uint32_t mbx_cmd,
int  in_count 
)

Definition at line 3273 of file ql4_nx.c.

uint32_t qla4_82xx_rd_32 ( struct scsi_qla_host ha,
ulong  off 
)

Definition at line 400 of file ql4_nx.c.

void qla4_82xx_rom_lock_recovery ( struct scsi_qla_host ha)

Definition at line 1702 of file ql4_nx.c.

int qla4_82xx_try_start_fw ( struct scsi_qla_host ha)

Definition at line 1673 of file ql4_nx.c.

void qla4_82xx_wr_32 ( struct scsi_qla_host ha,
ulong  off,
u32  data 
)

Definition at line 377 of file ql4_nx.c.

void qla4_8xxx_clear_drv_active ( struct scsi_qla_host ha)

Definition at line 1532 of file ql4_nx.c.

void qla4_8xxx_clear_rst_ready ( struct scsi_qla_host ha)

Definition at line 1598 of file ql4_nx.c.

int qla4_8xxx_device_bootstrap ( struct scsi_qla_host ha)

qla4_8xxx_device_bootstrap - Initialize device, set DEV_READY, start fw : pointer to adapter structure

Note: IDC lock must be held upon entry

Definition at line 2597 of file ql4_nx.c.

int qla4_8xxx_device_state_handler ( struct scsi_qla_host ha)

qla4_8xxx_device_state_handler - Adapter state machine : pointer to host adapter structure.

Note: IDC lock must be UNLOCKED upon entry

Definition at line 2875 of file ql4_nx.c.

void qla4_8xxx_disable_msix ( struct scsi_qla_host ha)

Definition at line 3549 of file ql4_nx.c.

int qla4_8xxx_enable_msix ( struct scsi_qla_host ha)

Definition at line 3567 of file ql4_nx.c.

int qla4_8xxx_get_flash_info ( struct scsi_qla_host ha)

Definition at line 3307 of file ql4_nx.c.

void qla4_8xxx_get_minidump ( struct scsi_qla_host ha)

Definition at line 2577 of file ql4_nx.c.

int qla4_8xxx_get_sys_info ( struct scsi_qla_host ha)

qla4_8xxx_get_sys_info - get adapter MAC address(es) and serial number : pointer to host adapter structure.

Definition at line 3397 of file ql4_nx.c.

int qla4_8xxx_load_risc ( struct scsi_qla_host ha)

Definition at line 2974 of file ql4_nx.c.

int qla4_8xxx_mbx_intr_disable ( struct scsi_qla_host ha)

Definition at line 3487 of file ql4_nx.c.

int qla4_8xxx_mbx_intr_enable ( struct scsi_qla_host ha)

Definition at line 3466 of file ql4_nx.c.

void qla4_8xxx_need_qsnt_handler ( struct scsi_qla_host ha)

qla4_8xxx_need_qsnt_handler - Code to start qsnt : pointer to adapter structure

Definition at line 2767 of file ql4_nx.c.

int qla4_8xxx_need_reset ( struct scsi_qla_host ha)
inline

Definition at line 1553 of file ql4_nx.c.

void qla4_8xxx_set_drv_active ( struct scsi_qla_host ha)

Definition at line 1510 of file ql4_nx.c.

void qla4_8xxx_set_rst_ready ( struct scsi_qla_host ha)

Definition at line 1577 of file ql4_nx.c.

int qla4_8xxx_stop_firmware ( struct scsi_qla_host ha)

qla4_8xxx_stop_firmware - stops firmware on specified adapter instance : pointer to host adapter structure.

Remarks: For iSCSI, throws away all I/O and AENs into bit bucket, so they will not be available after successful return. Driver must cleanup potential outstanding I/O's after calling this funcion.

Definition at line 3337 of file ql4_nx.c.

int qla4_8xxx_update_idc_reg ( struct scsi_qla_host ha)

Definition at line 2834 of file ql4_nx.c.

Variable Documentation