Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
mv_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/platform_device.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <scsi/libsas.h>
#include <scsi/scsi.h>
#include <scsi/scsi_tcq.h>
#include <scsi/sas_ata.h>
#include "mv_defs.h"

Go to the source code of this file.

Data Structures

struct  mvs_dispatch
 
struct  mvs_chip_info
 
struct  mvs_err_info
 
struct  mvs_cmd_hdr
 
struct  mvs_port
 
struct  mvs_phy
 
struct  mvs_device
 
struct  phy_tuning
 
struct  ffe_control
 
struct  hba_info_page
 
struct  mvs_slot_info
 
struct  mvs_info
 
struct  mvs_prv_info
 
struct  mvs_wq
 
struct  mvs_task_exec_info
 
struct  mvs_task_list
 

Macros

#define DRV_NAME   "mvsas"
 
#define DRV_VERSION   "0.8.16"
 
#define MVS_ID_NOT_MAPPED   0x7f
 
#define WIDE_PORT_MAX_PHY   4
 
#define mv_printk(fmt, arg...)   printk(KERN_DEBUG"%s %d:" fmt, __FILE__, __LINE__, ## arg)
 
#define mv_dprintk(format, arg...)
 
#define MV_MAX_U32   0xffffffff
 
#define DEV_IS_EXPANDER(type)   ((type == EDGE_DEV) || (type == FANOUT_DEV))
 
#define bit(n)   ((u32)1 << n)
 
#define for_each_phy(__lseq_mask, __mc, __lseq)
 
#define MV_INIT_DELAYED_WORK(w, f, d)   INIT_DELAYED_WORK(w, f)
 
#define UNASSOC_D2H_FIS(id)   ((void *) mvi->rx_fis + 0x100 * id)
 
#define SATA_RECEIVED_FIS_LIST(reg_set)   ((void *) mvi->rx_fis + mvi->chip->fis_offs + 0x100 * reg_set)
 
#define SATA_RECEIVED_SDB_FIS(reg_set)   (SATA_RECEIVED_FIS_LIST(reg_set) + 0x58)
 
#define SATA_RECEIVED_D2H_FIS(reg_set)   (SATA_RECEIVED_FIS_LIST(reg_set) + 0x40)
 
#define SATA_RECEIVED_PIO_FIS(reg_set)   (SATA_RECEIVED_FIS_LIST(reg_set) + 0x20)
 
#define SATA_RECEIVED_DMA_FIS(reg_set)   (SATA_RECEIVED_FIS_LIST(reg_set) + 0x00)
 
#define MVS_MAX_SG   (1U << mvi->chip->sg_width)
 
#define MVS_CHIP_SLOT_SZ   (1U << mvi->chip->slot_width)
 
#define MVS_RX_FISL_SZ   (mvi->chip->fis_offs + (mvi->chip->fis_count * 0x100))
 
#define MVS_CHIP_DISP   (mvi->chip->dispatch)
 
#define TRASH_BUCKET_SIZE   0x20000
 

Enumerations

enum  dev_status { MVS_DEV_NORMAL = 0x0, MVS_DEV_EH = 0x1 }
 
enum  dev_reset { MVS_SOFT_RESET = 0, MVS_HARD_RESET = 1, MVS_PHY_TUNE = 2 }
 

Functions

void mvs_get_sas_addr (void *buf, u32 buflen)
 
void mvs_tag_clear (struct mvs_info *mvi, u32 tag)
 
void mvs_tag_free (struct mvs_info *mvi, u32 tag)
 
void mvs_tag_set (struct mvs_info *mvi, unsigned int tag)
 
int mvs_tag_alloc (struct mvs_info *mvi, u32 *tag_out)
 
void mvs_tag_init (struct mvs_info *mvi)
 
void mvs_iounmap (void __iomem *regs)
 
int mvs_ioremap (struct mvs_info *mvi, int bar, int bar_ex)
 
void mvs_phys_reset (struct mvs_info *mvi, u32 phy_mask, int hard)
 
int mvs_phy_control (struct asd_sas_phy *sas_phy, enum phy_func func, void *funcdata)
 
void __devinit mvs_set_sas_addr (struct mvs_info *mvi, int port_id, u32 off_lo, u32 off_hi, u64 sas_addr)
 
void mvs_scan_start (struct Scsi_Host *shost)
 
int mvs_scan_finished (struct Scsi_Host *shost, unsigned long time)
 
int mvs_queue_command (struct sas_task *task, const int num, gfp_t gfp_flags)
 
int mvs_abort_task (struct sas_task *task)
 
int mvs_abort_task_set (struct domain_device *dev, u8 *lun)
 
int mvs_clear_aca (struct domain_device *dev, u8 *lun)
 
int mvs_clear_task_set (struct domain_device *dev, u8 *lun)
 
void mvs_port_formed (struct asd_sas_phy *sas_phy)
 
void mvs_port_deformed (struct asd_sas_phy *sas_phy)
 
int mvs_dev_found (struct domain_device *dev)
 
void mvs_dev_gone (struct domain_device *dev)
 
int mvs_lu_reset (struct domain_device *dev, u8 *lun)
 
int mvs_slot_complete (struct mvs_info *mvi, u32 rx_desc, u32 flags)
 
int mvs_I_T_nexus_reset (struct domain_device *dev)
 
int mvs_query_task (struct sas_task *task)
 
void mvs_release_task (struct mvs_info *mvi, struct domain_device *dev)
 
void mvs_do_release_task (struct mvs_info *mvi, int phy_no, struct domain_device *dev)
 
void mvs_int_port (struct mvs_info *mvi, int phy_no, u32 events)
 
void mvs_update_phyinfo (struct mvs_info *mvi, int i, int get_st)
 
int mvs_int_rx (struct mvs_info *mvi, bool self_clear)
 
struct mvs_devicemvs_find_dev_by_reg_set (struct mvs_info *mvi, u8 reg_set)
 

Variables

int interrupt_coalescing
 
struct mvs_tgt_initiator mvs_tgt
 
struct mvs_infotgt_mvi
 
struct mvs_dispatch mvs_64xx_dispatch
 
struct mvs_dispatch mvs_94xx_dispatch
 
struct kmem_cachemvs_task_list_cache
 

Macro Definition Documentation

#define bit (   n)    ((u32)1 << n)

Definition at line 72 of file mv_sas.h.

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

Definition at line 69 of file mv_sas.h.

#define DRV_NAME   "mvsas"

Definition at line 48 of file mv_sas.h.

#define DRV_VERSION   "0.8.16"

Definition at line 49 of file mv_sas.h.

#define for_each_phy (   __lseq_mask,
  __mc,
  __lseq 
)
Value:
for ((__mc) = (__lseq_mask), (__lseq) = 0; \
(__mc) != 0 ; \
(++__lseq), (__mc) >>= 1)

Definition at line 74 of file mv_sas.h.

#define mv_dprintk (   format,
  arg... 
)

Definition at line 58 of file mv_sas.h.

#define MV_INIT_DELAYED_WORK (   w,
  f,
  d 
)    INIT_DELAYED_WORK(w, f)

Definition at line 79 of file mv_sas.h.

#define MV_MAX_U32   0xffffffff

Definition at line 60 of file mv_sas.h.

#define mv_printk (   fmt,
  arg... 
)    printk(KERN_DEBUG"%s %d:" fmt, __FILE__, __LINE__, ## arg)

Definition at line 52 of file mv_sas.h.

#define MVS_CHIP_DISP   (mvi->chip->dispatch)

Definition at line 191 of file mv_sas.h.

#define MVS_CHIP_SLOT_SZ   (1U << mvi->chip->slot_width)

Definition at line 188 of file mv_sas.h.

#define MVS_ID_NOT_MAPPED   0x7f

Definition at line 50 of file mv_sas.h.

#define MVS_MAX_SG   (1U << mvi->chip->sg_width)

Definition at line 187 of file mv_sas.h.

#define MVS_RX_FISL_SZ   (mvi->chip->fis_offs + (mvi->chip->fis_count * 0x100))

Definition at line 189 of file mv_sas.h.

#define SATA_RECEIVED_D2H_FIS (   reg_set)    (SATA_RECEIVED_FIS_LIST(reg_set) + 0x40)

Definition at line 86 of file mv_sas.h.

#define SATA_RECEIVED_DMA_FIS (   reg_set)    (SATA_RECEIVED_FIS_LIST(reg_set) + 0x00)

Definition at line 90 of file mv_sas.h.

#define SATA_RECEIVED_FIS_LIST (   reg_set)    ((void *) mvi->rx_fis + mvi->chip->fis_offs + 0x100 * reg_set)

Definition at line 82 of file mv_sas.h.

#define SATA_RECEIVED_PIO_FIS (   reg_set)    (SATA_RECEIVED_FIS_LIST(reg_set) + 0x20)

Definition at line 88 of file mv_sas.h.

#define SATA_RECEIVED_SDB_FIS (   reg_set)    (SATA_RECEIVED_FIS_LIST(reg_set) + 0x58)

Definition at line 84 of file mv_sas.h.

#define TRASH_BUCKET_SIZE   0x20000

Definition at line 411 of file mv_sas.h.

#define UNASSOC_D2H_FIS (   id)    ((void *) mvi->rx_fis + 0x100 * id)

Definition at line 80 of file mv_sas.h.

#define WIDE_PORT_MAX_PHY   4

Definition at line 51 of file mv_sas.h.

Enumeration Type Documentation

enum dev_reset
Enumerator:
MVS_SOFT_RESET 
MVS_HARD_RESET 
MVS_PHY_TUNE 

Definition at line 98 of file mv_sas.h.

enum dev_status
Enumerator:
MVS_DEV_NORMAL 
MVS_DEV_EH 

Definition at line 93 of file mv_sas.h.

Function Documentation

int mvs_abort_task ( struct sas_task task)

Definition at line 1568 of file mv_sas.c.

int mvs_abort_task_set ( struct domain_device dev,
u8 lun 
)

Definition at line 1645 of file mv_sas.c.

int mvs_clear_aca ( struct domain_device dev,
u8 lun 
)

Definition at line 1656 of file mv_sas.c.

int mvs_clear_task_set ( struct domain_device dev,
u8 lun 
)

Definition at line 1667 of file mv_sas.c.

int mvs_dev_found ( struct domain_device dev)

Definition at line 1331 of file mv_sas.c.

void mvs_dev_gone ( struct domain_device dev)

Definition at line 1360 of file mv_sas.c.

void mvs_do_release_task ( struct mvs_info mvi,
int  phy_no,
struct domain_device dev 
)

Definition at line 1925 of file mv_sas.c.

struct mvs_device* mvs_find_dev_by_reg_set ( struct mvs_info mvi,
u8  reg_set 
)
read

Definition at line 135 of file mv_sas.c.

void mvs_get_sas_addr ( void buf,
u32  buflen 
)
int mvs_I_T_nexus_reset ( struct domain_device dev)

Definition at line 1508 of file mv_sas.c.

void mvs_int_port ( struct mvs_info mvi,
int  phy_no,
u32  events 
)

Definition at line 2053 of file mv_sas.c.

int mvs_int_rx ( struct mvs_info mvi,
bool  self_clear 
)

Definition at line 2147 of file mv_sas.c.

int mvs_ioremap ( struct mvs_info mvi,
int  bar,
int  bar_ex 
)

Definition at line 322 of file mv_init.c.

void mvs_iounmap ( void __iomem regs)

Definition at line 371 of file mv_init.c.

int mvs_lu_reset ( struct domain_device dev,
u8 lun 
)

Definition at line 1486 of file mv_sas.c.

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

Definition at line 179 of file mv_sas.c.

void mvs_phys_reset ( struct mvs_info mvi,
u32  phy_mask,
int  hard 
)

Definition at line 169 of file mv_sas.c.

void mvs_port_deformed ( struct asd_sas_phy sas_phy)

Definition at line 1248 of file mv_sas.c.

void mvs_port_formed ( struct asd_sas_phy sas_phy)

Definition at line 1243 of file mv_sas.c.

int mvs_query_task ( struct sas_task task)

Definition at line 1530 of file mv_sas.c.

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

Definition at line 966 of file mv_sas.c.

void mvs_release_task ( struct mvs_info mvi,
struct domain_device dev 
)

Definition at line 1958 of file mv_sas.c.

int mvs_scan_finished ( struct Scsi_Host shost,
unsigned long  time 
)

Definition at line 303 of file mv_sas.c.

void mvs_scan_start ( struct Scsi_Host shost)

Definition at line 285 of file mv_sas.c.

void __devinit mvs_set_sas_addr ( struct mvs_info mvi,
int  port_id,
u32  off_lo,
u32  off_hi,
u64  sas_addr 
)

Definition at line 223 of file mv_sas.c.

int mvs_slot_complete ( struct mvs_info mvi,
u32  rx_desc,
u32  flags 
)

Definition at line 1803 of file mv_sas.c.

int mvs_tag_alloc ( struct mvs_info mvi,
u32 tag_out 
)
inline

Definition at line 56 of file mv_sas.c.

void mvs_tag_clear ( struct mvs_info mvi,
u32  tag 
)

Definition at line 39 of file mv_sas.c.

void mvs_tag_free ( struct mvs_info mvi,
u32  tag 
)

Definition at line 45 of file mv_sas.c.

void mvs_tag_init ( struct mvs_info mvi)

Definition at line 70 of file mv_sas.c.

void mvs_tag_set ( struct mvs_info mvi,
unsigned int  tag 
)

Definition at line 50 of file mv_sas.c.

void mvs_update_phyinfo ( struct mvs_info mvi,
int  i,
int  get_st 
)

Definition at line 1108 of file mv_sas.c.

Variable Documentation

int interrupt_coalescing

Definition at line 37 of file mv_init.c.

struct mvs_dispatch mvs_64xx_dispatch

Definition at line 775 of file mv_64xx.c.

struct mvs_dispatch mvs_94xx_dispatch

Definition at line 1009 of file mv_94xx.c.

struct kmem_cache* mvs_task_list_cache

Definition at line 40 of file mv_init.c.

struct mvs_tgt_initiator mvs_tgt
struct mvs_info* tgt_mvi