Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
pm8001_sas.h File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/dma-mapping.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <scsi/libsas.h>
#include <scsi/scsi_tcq.h>
#include <scsi/sas_ata.h>
#include <linux/atomic.h>
#include "pm8001_defs.h"

Go to the source code of this file.

Data Structures

struct  pm8001_tmf_task
 
struct  pm8001_ioctl_payload
 
struct  pm8001_dispatch
 
struct  pm8001_chip_info
 
struct  pm8001_port
 
struct  pm8001_phy
 
struct  pm8001_device
 
struct  pm8001_prd_imt
 
struct  pm8001_prd
 
struct  pm8001_ccb_info
 
struct  mpi_mem
 
struct  mpi_mem_req
 
struct  main_cfg_table
 
struct  general_status_table
 
struct  inbound_queue_table
 
struct  outbound_queue_table
 
struct  pm8001_hba_memspace
 
struct  pm8001_hba_info
 
struct  pm8001_work
 
struct  pm8001_fw_image_header
 
struct  fw_flash_updata_info
 
struct  fw_control_info
 
struct  fw_control_ex
 

Macros

#define DRV_NAME   "pm8001"
 
#define DRV_VERSION   "0.1.36"
 
#define PM8001_FAIL_LOGGING   0x01 /* Error message logging */
 
#define PM8001_INIT_LOGGING   0x02 /* driver init logging */
 
#define PM8001_DISC_LOGGING   0x04 /* discovery layer logging */
 
#define PM8001_IO_LOGGING   0x08 /* I/O path logging */
 
#define PM8001_EH_LOGGING   0x10 /* libsas EH function logging*/
 
#define PM8001_IOCTL_LOGGING   0x20 /* IOCTL message logging */
 
#define PM8001_MSG_LOGGING   0x40 /* misc message logging */
 
#define pm8001_printk(format, arg...)
 
#define PM8001_CHECK_LOGGING(HBA, LEVEL, CMD)
 
#define PM8001_EH_DBG(HBA, CMD)   PM8001_CHECK_LOGGING(HBA, PM8001_EH_LOGGING, CMD)
 
#define PM8001_INIT_DBG(HBA, CMD)   PM8001_CHECK_LOGGING(HBA, PM8001_INIT_LOGGING, CMD)
 
#define PM8001_DISC_DBG(HBA, CMD)   PM8001_CHECK_LOGGING(HBA, PM8001_DISC_LOGGING, CMD)
 
#define PM8001_IO_DBG(HBA, CMD)   PM8001_CHECK_LOGGING(HBA, PM8001_IO_LOGGING, CMD)
 
#define PM8001_FAIL_DBG(HBA, CMD)   PM8001_CHECK_LOGGING(HBA, PM8001_FAIL_LOGGING, CMD)
 
#define PM8001_IOCTL_DBG(HBA, CMD)   PM8001_CHECK_LOGGING(HBA, PM8001_IOCTL_LOGGING, CMD)
 
#define PM8001_MSG_DBG(HBA, CMD)   PM8001_CHECK_LOGGING(HBA, PM8001_MSG_LOGGING, CMD)
 
#define PM8001_USE_TASKLET
 
#define PM8001_USE_MSIX
 
#define PM8001_READ_VPD
 
#define DEV_IS_EXPANDER(type)   ((type == EDGE_DEV) || (type == FANOUT_DEV))
 
#define PM8001_NAME_LENGTH   32/* generic length of strings */
 
#define PM8001_CHIP_DISP   (pm8001_ha->chip->dispatch)
 
#define FLASH_UPDATE_COMPLETE_PENDING_REBOOT   0x00
 
#define FLASH_UPDATE_IN_PROGRESS   0x01
 
#define FLASH_UPDATE_HDR_ERR   0x02
 
#define FLASH_UPDATE_OFFSET_ERR   0x03
 
#define FLASH_UPDATE_CRC_ERR   0x04
 
#define FLASH_UPDATE_LENGTH_ERR   0x05
 
#define FLASH_UPDATE_HW_ERR   0x06
 
#define FLASH_UPDATE_DNLD_NOT_SUPPORTED   0x10
 
#define FLASH_UPDATE_DISABLED   0x11
 

Functions

struct pm8001_prd __attribute__ ((packed))
 
struct pm8001_fw_image_header __attribute__ ((packed, aligned(4)))
 
int pm8001_tag_alloc (struct pm8001_hba_info *pm8001_ha, u32 *tag_out)
 
void pm8001_tag_init (struct pm8001_hba_info *pm8001_ha)
 
u32 pm8001_get_ncq_tag (struct sas_task *task, u32 *tag)
 
void pm8001_ccb_free (struct pm8001_hba_info *pm8001_ha, u32 ccb_idx)
 
void pm8001_ccb_task_free (struct pm8001_hba_info *pm8001_ha, struct sas_task *task, struct pm8001_ccb_info *ccb, u32 ccb_idx)
 
int pm8001_phy_control (struct asd_sas_phy *sas_phy, enum phy_func func, void *funcdata)
 
void pm8001_scan_start (struct Scsi_Host *shost)
 
int pm8001_scan_finished (struct Scsi_Host *shost, unsigned long time)
 
int pm8001_queue_command (struct sas_task *task, const int num, gfp_t gfp_flags)
 
int pm8001_abort_task (struct sas_task *task)
 
int pm8001_abort_task_set (struct domain_device *dev, u8 *lun)
 
int pm8001_clear_aca (struct domain_device *dev, u8 *lun)
 
int pm8001_clear_task_set (struct domain_device *dev, u8 *lun)
 
int pm8001_dev_found (struct domain_device *dev)
 
void pm8001_dev_gone (struct domain_device *dev)
 
int pm8001_lu_reset (struct domain_device *dev, u8 *lun)
 
int pm8001_I_T_nexus_reset (struct domain_device *dev)
 
int pm8001_query_task (struct sas_task *task)
 
void pm8001_open_reject_retry (struct pm8001_hba_info *pm8001_ha, struct sas_task *task_to_close, struct pm8001_device *device_to_close)
 
int pm8001_mem_alloc (struct pci_dev *pdev, void **virt_addr, dma_addr_t *pphys_addr, u32 *pphys_addr_hi, u32 *pphys_addr_lo, u32 mem_size, u32 align)
 
int pm8001_bar4_shift (struct pm8001_hba_info *pm8001_ha, u32 shiftValue)
 

Variables

struct list_head hba_list
 
struct pm8001_dispatch pm8001_8001_dispatch
 
__le64 addr
 
struct pm8001_prd_imt im_len
 
struct pm8001_ccb_info __attribute__
 
u8 vender_id [8]
 
u8 product_id
 
u8 hardware_rev
 
u8 dest_partition
 
u8 reserved
 
u8 fw_rev [4]
 
__be32 image_length
 
__be32 image_crc
 
__be32 startup_entry
 
struct workqueue_structpm8001_wq
 
struct device_attributepm8001_host_attrs []
 

Macro Definition Documentation

#define DEV_IS_EXPANDER (   type)    ((type == EDGE_DEV) || (type == FANOUT_DEV))

Definition at line 106 of file pm8001_sas.h.

#define DRV_NAME   "pm8001"

Definition at line 60 of file pm8001_sas.h.

#define DRV_VERSION   "0.1.36"

Definition at line 61 of file pm8001_sas.h.

#define FLASH_UPDATE_COMPLETE_PENDING_REBOOT   0x00

FW Flash Update status values

Definition at line 412 of file pm8001_sas.h.

#define FLASH_UPDATE_CRC_ERR   0x04

Definition at line 416 of file pm8001_sas.h.

#define FLASH_UPDATE_DISABLED   0x11

Definition at line 420 of file pm8001_sas.h.

#define FLASH_UPDATE_DNLD_NOT_SUPPORTED   0x10

Definition at line 419 of file pm8001_sas.h.

#define FLASH_UPDATE_HDR_ERR   0x02

Definition at line 414 of file pm8001_sas.h.

#define FLASH_UPDATE_HW_ERR   0x06

Definition at line 418 of file pm8001_sas.h.

#define FLASH_UPDATE_IN_PROGRESS   0x01

Definition at line 413 of file pm8001_sas.h.

#define FLASH_UPDATE_LENGTH_ERR   0x05

Definition at line 417 of file pm8001_sas.h.

#define FLASH_UPDATE_OFFSET_ERR   0x03

Definition at line 415 of file pm8001_sas.h.

#define PM8001_CHECK_LOGGING (   HBA,
  LEVEL,
  CMD 
)
Value:
do { \
if (unlikely(HBA->logging_level & LEVEL)) \
do { \
CMD; \
} while (0); \
} while (0);

Definition at line 71 of file pm8001_sas.h.

#define PM8001_CHIP_DISP   (pm8001_ha->chip->dispatch)

Definition at line 179 of file pm8001_sas.h.

#define PM8001_DISC_DBG (   HBA,
  CMD 
)    PM8001_CHECK_LOGGING(HBA, PM8001_DISC_LOGGING, CMD)

Definition at line 85 of file pm8001_sas.h.

#define PM8001_DISC_LOGGING   0x04 /* discovery layer logging */

Definition at line 64 of file pm8001_sas.h.

#define PM8001_EH_DBG (   HBA,
  CMD 
)    PM8001_CHECK_LOGGING(HBA, PM8001_EH_LOGGING, CMD)

Definition at line 79 of file pm8001_sas.h.

#define PM8001_EH_LOGGING   0x10 /* libsas EH function logging*/

Definition at line 66 of file pm8001_sas.h.

#define PM8001_FAIL_DBG (   HBA,
  CMD 
)    PM8001_CHECK_LOGGING(HBA, PM8001_FAIL_LOGGING, CMD)

Definition at line 91 of file pm8001_sas.h.

#define PM8001_FAIL_LOGGING   0x01 /* Error message logging */

Definition at line 62 of file pm8001_sas.h.

#define PM8001_INIT_DBG (   HBA,
  CMD 
)    PM8001_CHECK_LOGGING(HBA, PM8001_INIT_LOGGING, CMD)

Definition at line 82 of file pm8001_sas.h.

#define PM8001_INIT_LOGGING   0x02 /* driver init logging */

Definition at line 63 of file pm8001_sas.h.

#define PM8001_IO_DBG (   HBA,
  CMD 
)    PM8001_CHECK_LOGGING(HBA, PM8001_IO_LOGGING, CMD)

Definition at line 88 of file pm8001_sas.h.

#define PM8001_IO_LOGGING   0x08 /* I/O path logging */

Definition at line 65 of file pm8001_sas.h.

#define PM8001_IOCTL_DBG (   HBA,
  CMD 
)    PM8001_CHECK_LOGGING(HBA, PM8001_IOCTL_LOGGING, CMD)

Definition at line 94 of file pm8001_sas.h.

#define PM8001_IOCTL_LOGGING   0x20 /* IOCTL message logging */

Definition at line 67 of file pm8001_sas.h.

#define PM8001_MSG_DBG (   HBA,
  CMD 
)    PM8001_CHECK_LOGGING(HBA, PM8001_MSG_LOGGING, CMD)

Definition at line 97 of file pm8001_sas.h.

#define PM8001_MSG_LOGGING   0x40 /* misc message logging */

Definition at line 68 of file pm8001_sas.h.

#define PM8001_NAME_LENGTH   32/* generic length of strings */

Definition at line 108 of file pm8001_sas.h.

#define pm8001_printk (   format,
  arg... 
)
Value:
__func__, __LINE__, ## arg)

Definition at line 69 of file pm8001_sas.h.

#define PM8001_READ_VPD

Definition at line 103 of file pm8001_sas.h.

#define PM8001_USE_MSIX

Definition at line 102 of file pm8001_sas.h.

#define PM8001_USE_TASKLET

Definition at line 101 of file pm8001_sas.h.

Function Documentation

struct pm8001_prd __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

Scatter-gather list for preada/pwritea calls.

< Client physical address of the buffer segment.

< Page table entry describing the caching and location override characteristics of the buffer segment. Some drivers ignore this element and will require that the NOCACHE flag be set on their requests.

< Length of the buffer segment.

Definition at line 1740 of file hypervisor.h.

int pm8001_abort_task ( struct sas_task task)

Definition at line 1075 of file pm8001_sas.c.

int pm8001_abort_task_set ( struct domain_device dev,
u8 lun 
)

Definition at line 1151 of file pm8001_sas.c.

int pm8001_bar4_shift ( struct pm8001_hba_info pm8001_ha,
u32  shiftValue 
)

pm8001_bar4_shift - function is called to shift BAR base address : our hba card infomation : shifting value in memory bar.

Definition at line 345 of file pm8001_hwi.c.

void pm8001_ccb_free ( struct pm8001_hba_info pm8001_ha,
u32  ccb_idx 
)

Definition at line 499 of file pm8001_sas.c.

void pm8001_ccb_task_free ( struct pm8001_hba_info pm8001_ha,
struct sas_task task,
struct pm8001_ccb_info ccb,
u32  ccb_idx 
)

pm8001_ccb_task_free - free the sg for ssp and smp command, free the ccb. : our hba card information : the ccb which attached to ssp task : the task to be free. : ccb index.

Definition at line 511 of file pm8001_sas.c.

int pm8001_clear_aca ( struct domain_device dev,
u8 lun 
)

Definition at line 1161 of file pm8001_sas.c.

int pm8001_clear_task_set ( struct domain_device dev,
u8 lun 
)

Definition at line 1172 of file pm8001_sas.c.

int pm8001_dev_found ( struct domain_device dev)

Definition at line 646 of file pm8001_sas.c.

void pm8001_dev_gone ( struct domain_device dev)

Definition at line 867 of file pm8001_sas.c.

u32 pm8001_get_ncq_tag ( struct sas_task task,
u32 tag 
)

Definition at line 281 of file pm8001_sas.c.

int pm8001_I_T_nexus_reset ( struct domain_device dev)

Standard mandates link reset for ATA (type 0) and hard reset for SSP (type 1) , only for RECOVERY

Definition at line 959 of file pm8001_sas.c.

int pm8001_lu_reset ( struct domain_device dev,
u8 lun 
)

Definition at line 999 of file pm8001_sas.c.

int pm8001_mem_alloc ( struct pci_dev pdev,
void **  virt_addr,
dma_addr_t pphys_addr,
u32 pphys_addr_hi,
u32 pphys_addr_lo,
u32  mem_size,
u32  align 
)

pm8001_mem_alloc - allocate memory for pm8001. : pci device. : the allocated virtual address : the physical address high byte address. : the physical address low byte address. : memory size.

Definition at line 116 of file pm8001_sas.c.

void pm8001_open_reject_retry ( struct pm8001_hba_info pm8001_ha,
struct sas_task task_to_close,
struct pm8001_device device_to_close 
)

Definition at line 885 of file pm8001_sas.c.

int pm8001_phy_control ( struct asd_sas_phy sas_phy,
enum phy_func  func,
void funcdata 
)

pm8001_phy_control - this function should be registered to sas_domain_function_template to provide libsas used, note: this is just control the HBA phy rather than other expander phy if you want control other phy, you should use SMP command. : which phy in HBA phys. : the operation. : always NULL.

Definition at line 162 of file pm8001_sas.c.

int pm8001_query_task ( struct sas_task task)

Definition at line 1025 of file pm8001_sas.c.

int pm8001_queue_command ( struct sas_task task,
const int  num,
gfp_t  gfp_flags 
)

pm8001_queue_command - register for upper layer used, all IO commands sent to HBA are from this interface. : the task to be execute. : if can_queue great than 1, the task can be queued up. for SMP task, we always execute one one time : gfp_flags

Definition at line 493 of file pm8001_sas.c.

int pm8001_scan_finished ( struct Scsi_Host shost,
unsigned long  time 
)

Definition at line 257 of file pm8001_sas.c.

void pm8001_scan_start ( struct Scsi_Host shost)

pm8001_scan_start - we should enable all HBA phys by sending the phy_start command to HBA. : the scsi host data.

Definition at line 246 of file pm8001_sas.c.

int pm8001_tag_alloc ( struct pm8001_hba_info pm8001_ha,
u32 tag_out 
)
inline

pm8001_tag_alloc - allocate a empty tag for task used. : our hba struct : the found empty tag .

Definition at line 87 of file pm8001_sas.c.

void pm8001_tag_init ( struct pm8001_hba_info pm8001_ha)

Definition at line 101 of file pm8001_sas.c.

Variable Documentation

__le64 addr

Definition at line 226 of file pm8001_sas.h.

u8 dest_partition

Definition at line 410 of file pm8001_sas.h.

u8 fw_rev[4]

Definition at line 412 of file pm8001_sas.h.

u8 hardware_rev

Definition at line 409 of file pm8001_sas.h.

struct list_head hba_list

Definition at line 227 of file pm8001_sas.h.

__be32 image_crc

Definition at line 414 of file pm8001_sas.h.

__be32 image_length

Definition at line 413 of file pm8001_sas.h.

struct pm8001_dispatch pm8001_8001_dispatch

Definition at line 4687 of file pm8001_hwi.c.

struct device_attribute* pm8001_host_attrs[]

Definition at line 560 of file pm8001_ctl.c.

Definition at line 54 of file pm8001_init.c.

u8 product_id

Definition at line 408 of file pm8001_sas.h.

u8 reserved

Definition at line 411 of file pm8001_sas.h.

__be32 startup_entry

Definition at line 415 of file pm8001_sas.h.

u8 vender_id[8]

Definition at line 407 of file pm8001_sas.h.