Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
aic79xx_osm.c File Reference
#include "aic79xx_osm.h"
#include "aic79xx_inline.h"
#include <scsi/scsicam.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  adapter_tag_info_t
 
struct  ahd_linux_iocell_opts
 

Macros

#define AHD_LINUX_ERR_THRESH   1000
 
#define AIC79XX_RESET_DELAY   5000
 
#define AIC79XX_CMDS_PER_DEVICE   AHD_MAX_QUEUE
 
#define AIC79XX_CONFIGED_TAG_COMMANDS
 
#define AIC79XX_DEFAULT_PRECOMP   0xFF
 
#define AIC79XX_DEFAULT_SLEWRATE   0xFF
 
#define AIC79XX_DEFAULT_AMPLITUDE   0xFF
 
#define AIC79XX_DEFAULT_IOOPTS
 
#define AIC79XX_PRECOMP_INDEX   0
 
#define AIC79XX_SLEWRATE_INDEX   1
 
#define AIC79XX_AMPLITUDE_INDEX   2
 
#define DID_UNDERFLOW   DID_ERROR
 
#define BUILD_SCSIID(ahd, cmd)   (((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)
 

Functions

void ahd_print_path (struct ahd_softc *ahd, struct scb *scb)
 
 MODULE_AUTHOR ("Maintainer: Hannes Reinecke <[email protected]>")
 
 MODULE_DESCRIPTION ("Adaptec AIC790X U320 SCSI Host Bus Adapter driver")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_VERSION (AIC79XX_DRIVER_VERSION)
 
 module_param (aic79xx, charp, 0444)
 
 MODULE_PARM_DESC (aic79xx,"period-delimited options string:\n"" verbose Enable verbose/diagnostic logging\n"" allow_memio Allow device registers to be memory mapped\n"" debug Bitmask of debug values to enable\n"" no_reset Suppress initial bus resets\n"" extended Enable extended geometry on all controllers\n"" periodic_otag Send an ordered tagged transaction\n"" periodically to prevent tag starvation.\n"" This may be required by some older disk\n"" or drives/RAID arrays.\n"" tag_info:<tag_str> Set per-target tag depth\n"" global_tag_depth:<int> Global tag depth for all targets on all buses\n"" slewrate:<slewrate_list>Set the signal slew rate (0-15).\n"" precomp:<pcomp_list> Set the signal precompensation (0-7).\n"" amplitude:<int> Set the signal amplitude (0-7).\n"" seltime:<int> Selection Timeout:\n"" (0/256ms,1/128ms,2/64ms,3/32ms)\n"" slowcrc Turn on the SLOWCRC bit (Rev B only)\n""\n"" Sample modprobe configuration file:\n"" # Enable verbose logging\n"" # Set tag depth on Controller 2/Target 2 to 10 tags\n"" # Shorten the selection timeout to 128ms\n""\n"" options aic79xx 'aic79xx=verbose.tag_info:{{}.{}.{..10}}.seltime:1'\n")
 
void ahd_delay (long)
 
uint8_t ahd_inb (struct ahd_softc *ahd, long port)
 
void ahd_outb (struct ahd_softc *ahd, long port, uint8_t val)
 
void ahd_outw_atomic (struct ahd_softc *ahd, long port, uint16_t val)
 
void ahd_outsb (struct ahd_softc *ahd, long port, uint8_t *, int count)
 
void ahd_insb (struct ahd_softc *ahd, long port, uint8_t *, int count)
 
uint32_t ahd_pci_read_config (ahd_dev_softc_t pci, int reg, int width)
 
void ahd_pci_write_config (ahd_dev_softc_t pci, int reg, uint32_t value, int width)
 
int ahd_dma_tag_create (struct ahd_softc *ahd, bus_dma_tag_t parent, bus_size_t alignment, bus_size_t boundary, dma_addr_t lowaddr, dma_addr_t highaddr, bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, int nsegments, bus_size_t maxsegsz, int flags, bus_dma_tag_t *ret_tag)
 
void ahd_dma_tag_destroy (struct ahd_softc *ahd, bus_dma_tag_t dmat)
 
int ahd_dmamem_alloc (struct ahd_softc *ahd, bus_dma_tag_t dmat, void **vaddr, int flags, bus_dmamap_t *mapp)
 
void ahd_dmamem_free (struct ahd_softc *ahd, bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
 
int ahd_dmamap_load (struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, bus_size_t buflen, bus_dmamap_callback_t *cb, void *cb_arg, int flags)
 
void ahd_dmamap_destroy (struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map)
 
int ahd_dmamap_unload (struct ahd_softc *ahd, bus_dma_tag_t dmat, bus_dmamap_t map)
 
 __setup ("aic79xx=", aic79xx_setup)
 
int ahd_linux_register_host (struct ahd_softc *ahd, struct scsi_host_template *template)
 
int ahd_platform_alloc (struct ahd_softc *ahd, void *platform_arg)
 
void ahd_platform_free (struct ahd_softc *ahd)
 
void ahd_platform_init (struct ahd_softc *ahd)
 
void ahd_platform_freeze_devq (struct ahd_softc *ahd, struct scb *scb)
 
void ahd_platform_set_tags (struct ahd_softc *ahd, struct scsi_device *sdev, struct ahd_devinfo *devinfo, ahd_queue_alg alg)
 
int ahd_platform_abort_scbs (struct ahd_softc *ahd, int target, char channel, int lun, u_int tag, role_t role, uint32_t status)
 
irqreturn_t ahd_linux_isr (int irq, void *dev_id)
 
void ahd_send_async (struct ahd_softc *ahd, char channel, u_int target, u_int lun, ac_code code)
 
void ahd_done (struct ahd_softc *ahd, struct scb *scb)
 
 module_init (ahd_linux_init)
 
 module_exit (ahd_linux_exit)
 

Variables

uint32_t aic79xx_allow_memio = ~0
 
uint32_t aic79xx_slowcrc
 
struct scsi_host_template aic79xx_driver_template
 
uint32_t aic79xx_verbose
 

Macro Definition Documentation

#define AHD_LINUX_ERR_THRESH   1000

Definition at line 61 of file aic79xx_osm.c.

#define AIC79XX_AMPLITUDE_INDEX   2

Definition at line 196 of file aic79xx_osm.c.

#define AIC79XX_CMDS_PER_DEVICE   AHD_MAX_QUEUE

Definition at line 136 of file aic79xx_osm.c.

#define AIC79XX_CONFIGED_TAG_COMMANDS
Value:
{ \
AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE, \
AIC79XX_CMDS_PER_DEVICE, AIC79XX_CMDS_PER_DEVICE \
}

Definition at line 139 of file aic79xx_osm.c.

#define AIC79XX_DEFAULT_AMPLITUDE   0xFF

Definition at line 187 of file aic79xx_osm.c.

#define AIC79XX_DEFAULT_IOOPTS
Value:
{ \
AIC79XX_DEFAULT_PRECOMP, \
AIC79XX_DEFAULT_SLEWRATE, \
AIC79XX_DEFAULT_AMPLITUDE \
}

Definition at line 188 of file aic79xx_osm.c.

#define AIC79XX_DEFAULT_PRECOMP   0xFF

Definition at line 185 of file aic79xx_osm.c.

#define AIC79XX_DEFAULT_SLEWRATE   0xFF

Definition at line 186 of file aic79xx_osm.c.

#define AIC79XX_PRECOMP_INDEX   0

Definition at line 194 of file aic79xx_osm.c.

#define AIC79XX_RESET_DELAY   5000

Definition at line 72 of file aic79xx_osm.c.

#define AIC79XX_SLEWRATE_INDEX   1

Definition at line 195 of file aic79xx_osm.c.

#define BUILD_SCSIID (   ahd,
  cmd 
)    (((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)

Definition at line 544 of file aic79xx_osm.c.

#define DID_UNDERFLOW   DID_ERROR

Definition at line 221 of file aic79xx_osm.c.

Function Documentation

__setup ( )
void ahd_delay ( long  usec)

Definition at line 376 of file aic79xx_osm.c.

int ahd_dma_tag_create ( struct ahd_softc ahd,
bus_dma_tag_t  parent,
bus_size_t  alignment,
bus_size_t  boundary,
dma_addr_t  lowaddr,
dma_addr_t  highaddr,
bus_dma_filter_t filter,
void filterarg,
bus_size_t  maxsize,
int  nsegments,
bus_size_t  maxsegsz,
int  flags,
bus_dma_tag_t ret_tag 
)

Definition at line 931 of file aic79xx_osm.c.

void ahd_dma_tag_destroy ( struct ahd_softc ahd,
bus_dma_tag_t  dmat 
)

Definition at line 959 of file aic79xx_osm.c.

void ahd_dmamap_destroy ( struct ahd_softc ahd,
bus_dma_tag_t  dmat,
bus_dmamap_t  map 
)

Definition at line 1001 of file aic79xx_osm.c.

int ahd_dmamap_load ( struct ahd_softc ahd,
bus_dma_tag_t  dmat,
bus_dmamap_t  map,
void buf,
bus_size_t  buflen,
bus_dmamap_callback_t cb,
void cb_arg,
int  flags 
)

Definition at line 984 of file aic79xx_osm.c.

int ahd_dmamap_unload ( struct ahd_softc ahd,
bus_dma_tag_t  dmat,
bus_dmamap_t  map 
)

Definition at line 1006 of file aic79xx_osm.c.

int ahd_dmamem_alloc ( struct ahd_softc ahd,
bus_dma_tag_t  dmat,
void **  vaddr,
int  flags,
bus_dmamap_t mapp 
)

Definition at line 965 of file aic79xx_osm.c.

void ahd_dmamem_free ( struct ahd_softc ahd,
bus_dma_tag_t  dmat,
void vaddr,
bus_dmamap_t  map 
)

Definition at line 976 of file aic79xx_osm.c.

void ahd_done ( struct ahd_softc ahd,
struct scb scb 
)

Definition at line 1793 of file aic79xx_osm.c.

uint8_t ahd_inb ( struct ahd_softc ahd,
long  port 
)

Definition at line 401 of file aic79xx_osm.c.

void ahd_insb ( struct ahd_softc ahd,
long  port,
uint8_t array,
int  count 
)

Definition at line 467 of file aic79xx_osm.c.

irqreturn_t ahd_linux_isr ( int  irq,
void dev_id 
)

Definition at line 1685 of file aic79xx_osm.c.

int ahd_linux_register_host ( struct ahd_softc ahd,
struct scsi_host_template template 
)

Definition at line 1223 of file aic79xx_osm.c.

void ahd_outb ( struct ahd_softc ahd,
long  port,
uint8_t  val 
)

Definition at line 431 of file aic79xx_osm.c.

void ahd_outsb ( struct ahd_softc ahd,
long  port,
uint8_t array,
int  count 
)

Definition at line 453 of file aic79xx_osm.c.

void ahd_outw_atomic ( struct ahd_softc ahd,
long  port,
uint16_t  val 
)

Definition at line 442 of file aic79xx_osm.c.

uint32_t ahd_pci_read_config ( ahd_dev_softc_t  pci,
int  reg,
int  width 
)

Definition at line 482 of file aic79xx_osm.c.

void ahd_pci_write_config ( ahd_dev_softc_t  pci,
int  reg,
uint32_t  value,
int  width 
)

Definition at line 512 of file aic79xx_osm.c.

int ahd_platform_abort_scbs ( struct ahd_softc ahd,
int  target,
char  channel,
int  lun,
u_int  tag,
role_t  role,
uint32_t  status 
)

Definition at line 1490 of file aic79xx_osm.c.

int ahd_platform_alloc ( struct ahd_softc ahd,
void platform_arg 
)

Definition at line 1324 of file aic79xx_osm.c.

void ahd_platform_free ( struct ahd_softc ahd)

Definition at line 1338 of file aic79xx_osm.c.

void ahd_platform_freeze_devq ( struct ahd_softc ahd,
struct scb scb 
)

Definition at line 1394 of file aic79xx_osm.c.

void ahd_platform_init ( struct ahd_softc ahd)

Definition at line 1374 of file aic79xx_osm.c.

void ahd_platform_set_tags ( struct ahd_softc ahd,
struct scsi_device sdev,
struct ahd_devinfo devinfo,
ahd_queue_alg  alg 
)

Definition at line 1403 of file aic79xx_osm.c.

void ahd_print_path ( struct ahd_softc ahd,
struct scb scb 
)

Definition at line 224 of file aic79xx_osm.c.

void ahd_send_async ( struct ahd_softc ahd,
char  channel,
u_int  target,
u_int  lun,
ac_code  code 
)

Definition at line 1699 of file aic79xx_osm.c.

MODULE_AUTHOR ( "Maintainer: Hannes Reinecke <[email protected]>"  )
MODULE_DESCRIPTION ( "Adaptec AIC790X U320 SCSI Host Bus Adapter driver )
module_exit ( ahd_linux_exit  )
module_init ( ahd_linux_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param ( aic79xx  ,
charp  ,
0444   
)
MODULE_PARM_DESC ( aic79xx  )
MODULE_VERSION ( AIC79XX_DRIVER_VERSION  )

Variable Documentation

uint32_t aic79xx_allow_memio = ~0

Definition at line 275 of file aic79xx_osm.c.

struct scsi_host_template aic79xx_driver_template
Initial value:
= {
.module = THIS_MODULE,
.name = "aic79xx",
.proc_name = "aic79xx",
.proc_info = ahd_linux_proc_info,
.info = ahd_linux_info,
.queuecommand = ahd_linux_queue,
.eh_abort_handler = ahd_linux_abort,
.eh_device_reset_handler = ahd_linux_dev_reset,
.eh_bus_reset_handler = ahd_linux_bus_reset,
.can_queue = AHD_MAX_QUEUE,
.this_id = -1,
.max_sectors = 8192,
.cmd_per_lun = 2,
.use_clustering = ENABLE_CLUSTERING,
.slave_alloc = ahd_linux_slave_alloc,
.slave_configure = ahd_linux_slave_configure,
.target_alloc = ahd_linux_target_alloc,
.target_destroy = ahd_linux_target_destroy,
}

Definition at line 905 of file aic79xx_osm.c.

uint32_t aic79xx_slowcrc

Definition at line 312 of file aic79xx_osm.c.

uint32_t aic79xx_verbose

Definition at line 1220 of file aic79xx_osm.c.