Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
aic79xx_osm.h File Reference
#include <linux/types.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/byteorder.h>
#include <asm/io.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_spi.h>
#include "cam.h"
#include "queue.h"
#include "scsi_message.h"
#include "scsi_iu.h"
#include "aiclib.h"
#include "aic79xx.h"
#include <linux/spinlock.h>

Go to the source code of this file.

Data Structures

union  bus_space_handle_t
struct  bus_dma_segment
struct  ahd_linux_dma_tag
struct  ahd_linux_device
struct  scb_platform_data
struct  ahd_platform_data
struct  info_str


#define AIC_LIB_PREFIX   ahd
#define powerof2(x)   ((((x)-1)&(x))==0)
#define ahd_htobe16(x)   cpu_to_be16(x)
#define ahd_htobe32(x)   cpu_to_be32(x)
#define ahd_htobe64(x)   cpu_to_be64(x)
#define ahd_htole16(x)   cpu_to_le16(x)
#define ahd_htole32(x)   cpu_to_le32(x)
#define ahd_htole64(x)   cpu_to_le64(x)
#define ahd_be16toh(x)   be16_to_cpu(x)
#define ahd_be32toh(x)   be32_to_cpu(x)
#define ahd_be64toh(x)   be64_to_cpu(x)
#define ahd_le16toh(x)   le16_to_cpu(x)
#define ahd_le32toh(x)   le32_to_cpu(x)
#define ahd_le64toh(x)   le64_to_cpu(x)
#define BUS_DMA_WAITOK   0x0
#define BUS_DMA_NOWAIT   0x1
#define BUS_DMA_ALLOCNOW   0x2
#define BUS_DMASYNC_PREREAD   0x01 /* pre-read synchronization */
#define BUS_DMASYNC_POSTREAD   0x02 /* post-read synchronization */
#define BUS_DMASYNC_PREWRITE   0x04 /* pre-write synchronization */
#define BUS_DMASYNC_POSTWRITE   0x08 /* post-write synchronization */
#define ahd_dmamap_sync(ahd, dma_tag, dmamap, offset, len, op)
#define ahd_timer_init   init_timer
#define ahd_timer_stop   del_timer_sync
#define AIC79XX_DRIVER_VERSION   "3.0"
#define AHD_LOCK_TAGS_COUNT   50
#define AHD_OTAG_THRESH   500
#define AHD_NSEG   128
#define AHD_LINUX_NOIRQ   ((uint32_t)~0)
#define PCIR_DEVVENDOR   0x00
#define PCIR_VENDOR   0x00
#define PCIR_DEVICE   0x02
#define PCIR_COMMAND   0x04
#define PCIM_CMD_PORTEN   0x0001
#define PCIM_CMD_MEMEN   0x0002
#define PCIM_CMD_BUSMASTEREN   0x0004
#define PCIM_CMD_MWRICEN   0x0010
#define PCIM_CMD_PERRESPEN   0x0040
#define PCIM_CMD_SERRESPEN   0x0100
#define PCIR_STATUS   0x06
#define PCIR_REVID   0x08
#define PCIR_PROGIF   0x09
#define PCIR_SUBCLASS   0x0a
#define PCIR_CLASS   0x0b
#define PCIR_CACHELNSZ   0x0c
#define PCIR_LATTIMER   0x0d
#define PCIR_HEADERTYPE   0x0e
#define PCIM_MFDEV   0x80
#define PCIR_BIST   0x0f
#define PCIR_CAP_PTR   0x34
#define PCIR_MAPS   0x10
#define PCIR_SUBVEND_0   0x2c
#define PCIR_SUBDEV_0   0x2e
#define PCIXR_COMMAND   0x96
#define PCIXR_DEVADDR   0x98
#define PCIXM_DEVADDR_FNUM   0x0003 /* Function Number */
#define PCIXM_DEVADDR_DNUM   0x00F8 /* Device Number */
#define PCIXM_DEVADDR_BNUM   0xFF00 /* Bus Number */
#define PCIXR_STATUS   0x9A
#define PCIXM_STATUS_64BIT   0x0001 /* Active 64bit connection to device. */
#define PCIXM_STATUS_133CAP   0x0002 /* Device is 133MHz capable */
#define PCIXM_STATUS_SCDISC   0x0004 /* Split Completion Discarded */
#define PCIXM_STATUS_UNEXPSC   0x0008 /* Unexpected Split Completion */
#define PCIXM_STATUS_CMPLEXDEV   0x0010 /* Device Complexity (set == bridge) */
#define PCIXM_STATUS_MAXMRDBC   0x0060 /* Maximum Burst Read Count */
#define PCIXM_STATUS_MAXSPLITS   0x0380 /* Maximum Split Transactions */
#define PCIXM_STATUS_MAXCRDS   0x1C00 /* Maximum Cumulative Read Size */
#define PCIXM_STATUS_RCVDSCEM   0x2000 /* Received a Split Comp w/Error msg */
#define AHD_PCI_CONFIG   0
#define bootverbose   aic79xx_verbose


typedef struct pci_devahd_dev_softc_t
typedef struct scsi_cmndahd_io_ctx_t
typedef uint32_t bus_size_t
typedef struct bus_dma_segment bus_dma_segment_t
typedef struct ahd_linux_dma_tagbus_dma_tag_t
typedef dma_addr_t bus_dmamap_t
typedef int bus_dma_filter_t (void *, dma_addr_t)
typedef void bus_dmamap_callback_t (void *, bus_dma_segment_t *, int, int)
typedef struct timer_list ahd_timer_t


enum  ahd_linux_dev_flags { AHD_DEV_FREEZE_TIL_EMPTY = 0x02, AHD_DEV_Q_BASIC = 0x10, AHD_DEV_Q_TAGGED = 0x20, AHD_DEV_PERIODIC_OTAG = 0x40 }


int ahd_dma_tag_create (struct ahd_softc *, bus_dma_tag_t, bus_size_t, bus_size_t, dma_addr_t, dma_addr_t, bus_dma_filter_t *, void *, bus_size_t, int, bus_size_t, int, bus_dma_tag_t *)
void ahd_dma_tag_destroy (struct ahd_softc *, bus_dma_tag_t)
int ahd_dmamem_alloc (struct ahd_softc *, bus_dma_tag_t, void **, int, bus_dmamap_t *)
void ahd_dmamem_free (struct ahd_softc *, bus_dma_tag_t, void *, bus_dmamap_t)
void ahd_dmamap_destroy (struct ahd_softc *, bus_dma_tag_t, bus_dmamap_t)
int ahd_dmamap_load (struct ahd_softc *ahd, bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, bus_dmamap_callback_t *, void *, int)
int ahd_dmamap_unload (struct ahd_softc *, bus_dma_tag_t, bus_dmamap_t)
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)
int ahd_linux_register_host (struct ahd_softc *, struct scsi_host_template *)
void ahd_power_state_change (struct ahd_softc *ahd, ahd_power_state new_state)
int ahd_linux_pci_init (void)
void ahd_linux_pci_exit (void)
int ahd_pci_map_registers (struct ahd_softc *ahd)
int ahd_pci_map_int (struct ahd_softc *ahd)
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_linux_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int)
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)
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_done (struct ahd_softc *, struct scb *)
void ahd_send_async (struct ahd_softc *, char channel, u_int target, u_int lun, ac_code)
void ahd_print_path (struct ahd_softc *, struct scb *)


uint32_t aic79xx_allow_memio
struct scsi_host_template aic79xx_driver_template
uint32_t aic79xx_verbose

Macro Definition Documentation

#define ahd_be16toh (   x)    be16_to_cpu(x)

Definition at line 110 of file aic79xx_osm.h.

#define ahd_be32toh (   x)    be32_to_cpu(x)

Definition at line 111 of file aic79xx_osm.h.

#define ahd_be64toh (   x)    be64_to_cpu(x)

Definition at line 112 of file aic79xx_osm.h.

#define ahd_dmamap_sync (   ahd,

Definition at line 206 of file aic79xx_osm.h.

#define ahd_htobe16 (   x)    cpu_to_be16(x)

Definition at line 103 of file aic79xx_osm.h.

#define ahd_htobe32 (   x)    cpu_to_be32(x)

Definition at line 104 of file aic79xx_osm.h.

#define ahd_htobe64 (   x)    cpu_to_be64(x)

Definition at line 105 of file aic79xx_osm.h.

#define ahd_htole16 (   x)    cpu_to_le16(x)

Definition at line 106 of file aic79xx_osm.h.

#define ahd_htole32 (   x)    cpu_to_le32(x)

Definition at line 107 of file aic79xx_osm.h.

#define ahd_htole64 (   x)    cpu_to_le64(x)

Definition at line 108 of file aic79xx_osm.h.

#define ahd_le16toh (   x)    le16_to_cpu(x)

Definition at line 113 of file aic79xx_osm.h.

#define ahd_le32toh (   x)    le32_to_cpu(x)

Definition at line 114 of file aic79xx_osm.h.

#define ahd_le64toh (   x)    le64_to_cpu(x)

Definition at line 115 of file aic79xx_osm.h.

#define AHD_LINUX_NOIRQ   ((uint32_t)~0)

Definition at line 357 of file aic79xx_osm.h.

#define AHD_LOCK_TAGS_COUNT   50

Definition at line 308 of file aic79xx_osm.h.

#define AHD_NSEG   128

Definition at line 330 of file aic79xx_osm.h.

#define AHD_OTAG_THRESH   500

Definition at line 320 of file aic79xx_osm.h.

#define AHD_PCI_CONFIG   0

Definition at line 695 of file aic79xx_osm.h.


Definition at line 281 of file aic79xx_osm.h.

#define ahd_timer_init   init_timer

Definition at line 220 of file aic79xx_osm.h.

#define ahd_timer_stop   del_timer_sync

Definition at line 221 of file aic79xx_osm.h.

#define AIC79XX_DRIVER_VERSION   "3.0"

Definition at line 226 of file aic79xx_osm.h.


Definition at line 215 of file aic79xx_osm.h.

#define AIC_LIB_PREFIX   ahd

Definition at line 66 of file aic79xx_osm.h.

#define bootverbose   aic79xx_verbose

Definition at line 697 of file aic79xx_osm.h.

#define BUS_DMA_ALLOCNOW   0x2

Definition at line 156 of file aic79xx_osm.h.

0x4 /*
* Argument is an S/G list not
* a single buffer.

Definition at line 157 of file aic79xx_osm.h.

#define BUS_DMA_NOWAIT   0x1

Definition at line 155 of file aic79xx_osm.h.

#define BUS_DMA_WAITOK   0x0

Definition at line 154 of file aic79xx_osm.h.

#define BUS_DMASYNC_POSTREAD   0x02 /* post-read synchronization */

Definition at line 194 of file aic79xx_osm.h.

#define BUS_DMASYNC_POSTWRITE   0x08 /* post-write synchronization */

Definition at line 196 of file aic79xx_osm.h.

#define BUS_DMASYNC_PREREAD   0x01 /* pre-read synchronization */

Definition at line 193 of file aic79xx_osm.h.

#define BUS_DMASYNC_PREWRITE   0x04 /* pre-write synchronization */

Definition at line 195 of file aic79xx_osm.h.


Definition at line 159 of file aic79xx_osm.h.


Definition at line 160 of file aic79xx_osm.h.


Definition at line 161 of file aic79xx_osm.h.

#define PCIM_CMD_BUSMASTEREN   0x0004

Definition at line 422 of file aic79xx_osm.h.

#define PCIM_CMD_MEMEN   0x0002

Definition at line 421 of file aic79xx_osm.h.

#define PCIM_CMD_MWRICEN   0x0010

Definition at line 423 of file aic79xx_osm.h.

#define PCIM_CMD_PERRESPEN   0x0040

Definition at line 424 of file aic79xx_osm.h.

#define PCIM_CMD_PORTEN   0x0001

Definition at line 420 of file aic79xx_osm.h.

#define PCIM_CMD_SERRESPEN   0x0100

Definition at line 425 of file aic79xx_osm.h.

#define PCIM_MFDEV   0x80

Definition at line 434 of file aic79xx_osm.h.

#define PCIR_BIST   0x0f

Definition at line 435 of file aic79xx_osm.h.

#define PCIR_CACHELNSZ   0x0c

Definition at line 431 of file aic79xx_osm.h.

#define PCIR_CAP_PTR   0x34

Definition at line 436 of file aic79xx_osm.h.

#define PCIR_CLASS   0x0b

Definition at line 430 of file aic79xx_osm.h.

#define PCIR_COMMAND   0x04

Definition at line 419 of file aic79xx_osm.h.

#define PCIR_DEVICE   0x02

Definition at line 418 of file aic79xx_osm.h.

#define PCIR_DEVVENDOR   0x00

Definition at line 416 of file aic79xx_osm.h.

#define PCIR_HEADERTYPE   0x0e

Definition at line 433 of file aic79xx_osm.h.

#define PCIR_LATTIMER   0x0d

Definition at line 432 of file aic79xx_osm.h.

#define PCIR_MAPS   0x10

Definition at line 439 of file aic79xx_osm.h.

#define PCIR_PROGIF   0x09

Definition at line 428 of file aic79xx_osm.h.

#define PCIR_REVID   0x08

Definition at line 427 of file aic79xx_osm.h.

#define PCIR_STATUS   0x06

Definition at line 426 of file aic79xx_osm.h.

#define PCIR_SUBCLASS   0x0a

Definition at line 429 of file aic79xx_osm.h.

#define PCIR_SUBDEV_0   0x2e

Definition at line 441 of file aic79xx_osm.h.

#define PCIR_SUBVEND_0   0x2c

Definition at line 440 of file aic79xx_osm.h.

#define PCIR_VENDOR   0x00

Definition at line 417 of file aic79xx_osm.h.

#define PCIXM_DEVADDR_BNUM   0xFF00 /* Bus Number */

Definition at line 448 of file aic79xx_osm.h.

#define PCIXM_DEVADDR_DNUM   0x00F8 /* Device Number */

Definition at line 447 of file aic79xx_osm.h.

#define PCIXM_DEVADDR_FNUM   0x0003 /* Function Number */

Definition at line 446 of file aic79xx_osm.h.

#define PCIXM_STATUS_133CAP   0x0002 /* Device is 133MHz capable */

Definition at line 451 of file aic79xx_osm.h.

#define PCIXM_STATUS_64BIT   0x0001 /* Active 64bit connection to device. */

Definition at line 450 of file aic79xx_osm.h.

#define PCIXM_STATUS_CMPLEXDEV   0x0010 /* Device Complexity (set == bridge) */

Definition at line 454 of file aic79xx_osm.h.

#define PCIXM_STATUS_MAXCRDS   0x1C00 /* Maximum Cumulative Read Size */

Definition at line 457 of file aic79xx_osm.h.

#define PCIXM_STATUS_MAXMRDBC   0x0060 /* Maximum Burst Read Count */

Definition at line 455 of file aic79xx_osm.h.

#define PCIXM_STATUS_MAXSPLITS   0x0380 /* Maximum Split Transactions */

Definition at line 456 of file aic79xx_osm.h.

#define PCIXM_STATUS_RCVDSCEM   0x2000 /* Received a Split Comp w/Error msg */

Definition at line 458 of file aic79xx_osm.h.

#define PCIXM_STATUS_SCDISC   0x0004 /* Split Completion Discarded */

Definition at line 452 of file aic79xx_osm.h.

#define PCIXM_STATUS_UNEXPSC   0x0008 /* Unexpected Split Completion */

Definition at line 453 of file aic79xx_osm.h.

#define PCIXR_COMMAND   0x96

Definition at line 444 of file aic79xx_osm.h.

#define PCIXR_DEVADDR   0x98

Definition at line 445 of file aic79xx_osm.h.

#define PCIXR_STATUS   0x9A

Definition at line 449 of file aic79xx_osm.h.

#define powerof2 (   x)    ((((x)-1)&(x))==0)

Definition at line 95 of file aic79xx_osm.h.

Typedef Documentation

Definition at line 99 of file aic79xx_osm.h.

Definition at line 100 of file aic79xx_osm.h.

Definition at line 209 of file aic79xx_osm.h.

typedef int bus_dma_filter_t(void *, dma_addr_t)

Definition at line 151 of file aic79xx_osm.h.

Definition at line 147 of file aic79xx_osm.h.

typedef void bus_dmamap_callback_t(void *, bus_dma_segment_t *, int, int)

Definition at line 152 of file aic79xx_osm.h.

Definition at line 149 of file aic79xx_osm.h.

Definition at line 123 of file aic79xx_osm.h.

Enumeration Type Documentation


Definition at line 237 of file aic79xx_osm.h.


Definition at line 460 of file aic79xx_osm.h.


Definition at line 125 of file aic79xx_osm.h.

Function Documentation

void ahd_delay ( long  )

Definition at line 376 of file aic79xx_osm.c.

int ahd_dma_tag_create ( struct ahd_softc ,
bus_dma_tag_t  ,
bus_size_t  ,
bus_size_t  ,
dma_addr_t  ,
dma_addr_t  ,
bus_dma_filter_t ,
void ,
bus_size_t  ,
int  ,
bus_size_t  ,
int  ,

Definition at line 931 of file aic79xx_osm.c.

void ahd_dma_tag_destroy ( struct ahd_softc ,

Definition at line 959 of file aic79xx_osm.c.

void ahd_dmamap_destroy ( struct ahd_softc ,
bus_dma_tag_t  ,

Definition at line 1001 of file aic79xx_osm.c.

int ahd_dmamap_load ( struct ahd_softc ahd,
bus_dma_tag_t  ,
bus_dmamap_t  ,
void ,
bus_size_t  ,
bus_dmamap_callback_t ,
void ,

Definition at line 984 of file aic79xx_osm.c.

int ahd_dmamap_unload ( struct ahd_softc ,
bus_dma_tag_t  ,

Definition at line 1006 of file aic79xx_osm.c.

int ahd_dmamem_alloc ( struct ahd_softc ,
bus_dma_tag_t  ,
void **  ,
int  ,

Definition at line 965 of file aic79xx_osm.c.

void ahd_dmamem_free ( struct ahd_softc ,
bus_dma_tag_t  ,
void ,

Definition at line 976 of file aic79xx_osm.c.

void ahd_done ( struct ahd_softc ,
struct 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 ,
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.

void ahd_linux_pci_exit ( void  )

Definition at line 246 of file aic79xx_osm_pci.c.

int ahd_linux_pci_init ( void  )

Definition at line 240 of file aic79xx_osm_pci.c.

int ahd_linux_proc_info ( struct Scsi_Host ,
char ,
char **  ,
off_t  ,
int  ,

Definition at line 322 of file aic79xx_proc.c.

int ahd_linux_register_host ( struct ahd_softc ,
struct scsi_host_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 ,
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.

int ahd_pci_map_int ( struct ahd_softc ahd)

Definition at line 382 of file aic79xx_osm_pci.c.

int ahd_pci_map_registers ( struct ahd_softc ahd)

Definition at line 310 of file aic79xx_osm_pci.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,

Definition at line 1403 of file aic79xx_osm.c.

void ahd_power_state_change ( struct ahd_softc ahd,
ahd_power_state  new_state 

Definition at line 395 of file aic79xx_osm_pci.c.

void ahd_print_path ( struct ahd_softc ,
struct scb  

Definition at line 224 of file aic79xx_osm.c.

void ahd_send_async ( struct ahd_softc ,
char  channel,
u_int  target,
u_int  lun,

Definition at line 1699 of file aic79xx_osm.c.

Variable Documentation

uint32_t aic79xx_allow_memio

Definition at line 275 of file aic79xx_osm.c.

struct scsi_host_template aic79xx_driver_template

Definition at line 905 of file aic79xx_osm.c.

uint32_t aic79xx_verbose

Definition at line 1220 of file aic79xx_osm.c.