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
aic7xxx_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 "aiclib.h"
#include "aic7xxx.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  ahc_linux_dma_tag
 
struct  ahc_linux_device
 
struct  scb_platform_data
 
struct  ahc_platform_data
 
struct  info_str
 

Macros

#define AIC_LIB_PREFIX   ahc
 
#define ahc_htobe16(x)   cpu_to_be16(x)
 
#define ahc_htobe32(x)   cpu_to_be32(x)
 
#define ahc_htobe64(x)   cpu_to_be64(x)
 
#define ahc_htole16(x)   cpu_to_le16(x)
 
#define ahc_htole32(x)   cpu_to_le32(x)
 
#define ahc_htole64(x)   cpu_to_le64(x)
 
#define ahc_be16toh(x)   be16_to_cpu(x)
 
#define ahc_be32toh(x)   be32_to_cpu(x)
 
#define ahc_be64toh(x)   be64_to_cpu(x)
 
#define ahc_le16toh(x)   le16_to_cpu(x)
 
#define ahc_le32toh(x)   le32_to_cpu(x)
 
#define ahc_le64toh(x)   le64_to_cpu(x)
 
#define BUS_DMA_WAITOK   0x0
 
#define BUS_DMA_NOWAIT   0x1
 
#define BUS_DMA_ALLOCNOW   0x2
 
#define BUS_DMA_LOAD_SEGS
 
#define BUS_SPACE_MAXADDR   0xFFFFFFFF
 
#define BUS_SPACE_MAXADDR_32BIT   0xFFFFFFFF
 
#define BUS_SPACE_MAXSIZE_32BIT   0xFFFFFFFF
 
#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 ahc_dmamap_sync(ahc, dma_tag, dmamap, offset, len, op)
 
#define AIC_DEBUG_REGISTERS   0
 
#define AIC7XXX_DRIVER_VERSION   "7.0"
 
#define AHC_TAG_SUCCESS_INTERVAL   50
 
#define AHC_LOCK_TAGS_COUNT   50
 
#define AHC_OTAG_THRESH   500
 
#define AHC_NSEG   128
 
#define AHC_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 AHC_PCI_CONFIG   0
 
#define bootverbose   aic7xxx_verbose
 

Typedefs

typedef struct pci_devahc_dev_softc_t
 
typedef struct scsi_cmndahc_io_ctx_t
 
typedef uint32_t bus_size_t
 
typedef struct bus_dma_segment bus_dma_segment_t
 
typedef struct ahc_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)
 

Enumerations

enum  bus_space_tag_t { BUS_SPACE_MEMIO, BUS_SPACE_PIO, BUS_SPACE_MEMIO, BUS_SPACE_PIO }
 
enum  ahc_linux_dev_flags { AHC_DEV_FREEZE_TIL_EMPTY = 0x02, AHC_DEV_Q_BASIC = 0x10, AHC_DEV_Q_TAGGED = 0x20, AHC_DEV_PERIODIC_OTAG = 0x40 }
 
enum  ahc_power_state { AHC_POWER_STATE_D0, AHC_POWER_STATE_D1, AHC_POWER_STATE_D2, AHC_POWER_STATE_D3 }
 

Functions

int ahc_dma_tag_create (struct ahc_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 ahc_dma_tag_destroy (struct ahc_softc *, bus_dma_tag_t)
 
int ahc_dmamem_alloc (struct ahc_softc *, bus_dma_tag_t, void **, int, bus_dmamap_t *)
 
void ahc_dmamem_free (struct ahc_softc *, bus_dma_tag_t, void *, bus_dmamap_t)
 
void ahc_dmamap_destroy (struct ahc_softc *, bus_dma_tag_t, bus_dmamap_t)
 
int ahc_dmamap_load (struct ahc_softc *ahc, bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, bus_dmamap_callback_t *, void *, int)
 
int ahc_dmamap_unload (struct ahc_softc *, bus_dma_tag_t, bus_dmamap_t)
 
void ahc_delay (long)
 
uint8_t ahc_inb (struct ahc_softc *ahc, long port)
 
void ahc_outb (struct ahc_softc *ahc, long port, uint8_t val)
 
void ahc_outsb (struct ahc_softc *ahc, long port, uint8_t *, int count)
 
void ahc_insb (struct ahc_softc *ahc, long port, uint8_t *, int count)
 
int ahc_linux_register_host (struct ahc_softc *, struct scsi_host_template *)
 
int ahc_linux_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int)
 
int ahc_platform_alloc (struct ahc_softc *ahc, void *platform_arg)
 
void ahc_platform_free (struct ahc_softc *ahc)
 
void ahc_platform_freeze_devq (struct ahc_softc *ahc, struct scb *scb)
 
void ahc_platform_set_tags (struct ahc_softc *ahc, struct scsi_device *sdev, struct ahc_devinfo *devinfo, ahc_queue_alg)
 
int ahc_platform_abort_scbs (struct ahc_softc *ahc, int target, char channel, int lun, u_int tag, role_t role, uint32_t status)
 
irqreturn_t ahc_linux_isr (int irq, void *dev_id)
 
void ahc_platform_flushwork (struct ahc_softc *ahc)
 
void ahc_done (struct ahc_softc *, struct scb *)
 
void ahc_send_async (struct ahc_softc *, char channel, u_int target, u_int lun, ac_code)
 
void ahc_print_path (struct ahc_softc *, struct scb *)
 
void ahc_platform_dump_card_state (struct ahc_softc *ahc)
 

Variables

u_int aic7xxx_no_probe
 
u_int aic7xxx_allow_memio
 
struct scsi_host_template aic7xxx_driver_template
 
u_int aic7xxx_verbose
 

Macro Definition Documentation

#define ahc_be16toh (   x)    be16_to_cpu(x)

Definition at line 122 of file aic7xxx_osm.h.

#define ahc_be32toh (   x)    be32_to_cpu(x)

Definition at line 123 of file aic7xxx_osm.h.

#define ahc_be64toh (   x)    be64_to_cpu(x)

Definition at line 124 of file aic7xxx_osm.h.

#define ahc_dmamap_sync (   ahc,
  dma_tag,
  dmamap,
  offset,
  len,
  op 
)

Definition at line 219 of file aic7xxx_osm.h.

#define ahc_htobe16 (   x)    cpu_to_be16(x)

Definition at line 115 of file aic7xxx_osm.h.

#define ahc_htobe32 (   x)    cpu_to_be32(x)

Definition at line 116 of file aic7xxx_osm.h.

#define ahc_htobe64 (   x)    cpu_to_be64(x)

Definition at line 117 of file aic7xxx_osm.h.

#define ahc_htole16 (   x)    cpu_to_le16(x)

Definition at line 118 of file aic7xxx_osm.h.

#define ahc_htole32 (   x)    cpu_to_le32(x)

Definition at line 119 of file aic7xxx_osm.h.

#define ahc_htole64 (   x)    cpu_to_le64(x)

Definition at line 120 of file aic7xxx_osm.h.

#define ahc_le16toh (   x)    le16_to_cpu(x)

Definition at line 125 of file aic7xxx_osm.h.

#define ahc_le32toh (   x)    le32_to_cpu(x)

Definition at line 126 of file aic7xxx_osm.h.

#define ahc_le64toh (   x)    le64_to_cpu(x)

Definition at line 127 of file aic7xxx_osm.h.

#define AHC_LINUX_NOIRQ   ((uint32_t)~0)

Definition at line 362 of file aic7xxx_osm.h.

#define AHC_LOCK_TAGS_COUNT   50

Definition at line 312 of file aic7xxx_osm.h.

#define AHC_NSEG   128

Definition at line 334 of file aic7xxx_osm.h.

#define AHC_OTAG_THRESH   500

Definition at line 324 of file aic7xxx_osm.h.

#define AHC_PCI_CONFIG   0

Definition at line 706 of file aic7xxx_osm.h.

#define AHC_TAG_SUCCESS_INTERVAL   50

Definition at line 290 of file aic7xxx_osm.h.

#define AIC7XXX_DRIVER_VERSION   "7.0"

Definition at line 238 of file aic7xxx_osm.h.

#define AIC_DEBUG_REGISTERS   0

Definition at line 225 of file aic7xxx_osm.h.

#define AIC_LIB_PREFIX   ahc

Definition at line 83 of file aic7xxx_osm.h.

#define bootverbose   aic7xxx_verbose

Definition at line 708 of file aic7xxx_osm.h.

#define BUS_DMA_ALLOCNOW   0x2

Definition at line 169 of file aic7xxx_osm.h.

#define BUS_DMA_LOAD_SEGS
Value:
0x4 /*
* Argument is an S/G list not
* a single buffer.
*/

Definition at line 170 of file aic7xxx_osm.h.

#define BUS_DMA_NOWAIT   0x1

Definition at line 168 of file aic7xxx_osm.h.

#define BUS_DMA_WAITOK   0x0

Definition at line 167 of file aic7xxx_osm.h.

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

Definition at line 207 of file aic7xxx_osm.h.

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

Definition at line 209 of file aic7xxx_osm.h.

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

Definition at line 206 of file aic7xxx_osm.h.

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

Definition at line 208 of file aic7xxx_osm.h.

#define BUS_SPACE_MAXADDR   0xFFFFFFFF

Definition at line 172 of file aic7xxx_osm.h.

#define BUS_SPACE_MAXADDR_32BIT   0xFFFFFFFF

Definition at line 173 of file aic7xxx_osm.h.

#define BUS_SPACE_MAXSIZE_32BIT   0xFFFFFFFF

Definition at line 174 of file aic7xxx_osm.h.

#define PCIM_CMD_BUSMASTEREN   0x0004

Definition at line 428 of file aic7xxx_osm.h.

#define PCIM_CMD_MEMEN   0x0002

Definition at line 427 of file aic7xxx_osm.h.

#define PCIM_CMD_MWRICEN   0x0010

Definition at line 429 of file aic7xxx_osm.h.

#define PCIM_CMD_PERRESPEN   0x0040

Definition at line 430 of file aic7xxx_osm.h.

#define PCIM_CMD_PORTEN   0x0001

Definition at line 426 of file aic7xxx_osm.h.

#define PCIM_CMD_SERRESPEN   0x0100

Definition at line 431 of file aic7xxx_osm.h.

#define PCIM_MFDEV   0x80

Definition at line 440 of file aic7xxx_osm.h.

#define PCIR_BIST   0x0f

Definition at line 441 of file aic7xxx_osm.h.

#define PCIR_CACHELNSZ   0x0c

Definition at line 437 of file aic7xxx_osm.h.

#define PCIR_CAP_PTR   0x34

Definition at line 442 of file aic7xxx_osm.h.

#define PCIR_CLASS   0x0b

Definition at line 436 of file aic7xxx_osm.h.

#define PCIR_COMMAND   0x04

Definition at line 425 of file aic7xxx_osm.h.

#define PCIR_DEVICE   0x02

Definition at line 424 of file aic7xxx_osm.h.

#define PCIR_DEVVENDOR   0x00

Definition at line 422 of file aic7xxx_osm.h.

#define PCIR_HEADERTYPE   0x0e

Definition at line 439 of file aic7xxx_osm.h.

#define PCIR_LATTIMER   0x0d

Definition at line 438 of file aic7xxx_osm.h.

#define PCIR_MAPS   0x10

Definition at line 445 of file aic7xxx_osm.h.

#define PCIR_PROGIF   0x09

Definition at line 434 of file aic7xxx_osm.h.

#define PCIR_REVID   0x08

Definition at line 433 of file aic7xxx_osm.h.

#define PCIR_STATUS   0x06

Definition at line 432 of file aic7xxx_osm.h.

#define PCIR_SUBCLASS   0x0a

Definition at line 435 of file aic7xxx_osm.h.

#define PCIR_SUBDEV_0   0x2e

Definition at line 447 of file aic7xxx_osm.h.

#define PCIR_SUBVEND_0   0x2c

Definition at line 446 of file aic7xxx_osm.h.

#define PCIR_VENDOR   0x00

Definition at line 423 of file aic7xxx_osm.h.

Typedef Documentation

Definition at line 111 of file aic7xxx_osm.h.

Definition at line 112 of file aic7xxx_osm.h.

typedef int bus_dma_filter_t(void *, dma_addr_t)

Definition at line 164 of file aic7xxx_osm.h.

Definition at line 160 of file aic7xxx_osm.h.

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

Definition at line 165 of file aic7xxx_osm.h.

Definition at line 162 of file aic7xxx_osm.h.

Definition at line 136 of file aic7xxx_osm.h.

Enumeration Type Documentation

Enumerator:
AHC_DEV_FREEZE_TIL_EMPTY 
AHC_DEV_Q_BASIC 
AHC_DEV_Q_TAGGED 
AHC_DEV_PERIODIC_OTAG 

Definition at line 248 of file aic7xxx_osm.h.

Enumerator:
AHC_POWER_STATE_D0 
AHC_POWER_STATE_D1 
AHC_POWER_STATE_D2 
AHC_POWER_STATE_D3 

Definition at line 449 of file aic7xxx_osm.h.

Enumerator:
BUS_SPACE_MEMIO 
BUS_SPACE_PIO 
BUS_SPACE_MEMIO 
BUS_SPACE_PIO 

Definition at line 138 of file aic7xxx_osm.h.

Function Documentation

void ahc_delay ( long  )

Definition at line 394 of file aic7xxx_osm.c.

int ahc_dma_tag_create ( struct ahc_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  
)

Definition at line 836 of file aic7xxx_osm.c.

void ahc_dma_tag_destroy ( struct ahc_softc ,
bus_dma_tag_t   
)

Definition at line 864 of file aic7xxx_osm.c.

void ahc_dmamap_destroy ( struct ahc_softc ,
bus_dma_tag_t  ,
bus_dmamap_t   
)

Definition at line 906 of file aic7xxx_osm.c.

int ahc_dmamap_load ( struct ahc_softc ahc,
bus_dma_tag_t  ,
bus_dmamap_t  ,
void ,
bus_size_t  ,
bus_dmamap_callback_t ,
void ,
int   
)

Definition at line 889 of file aic7xxx_osm.c.

int ahc_dmamap_unload ( struct ahc_softc ,
bus_dma_tag_t  ,
bus_dmamap_t   
)

Definition at line 911 of file aic7xxx_osm.c.

int ahc_dmamem_alloc ( struct ahc_softc ,
bus_dma_tag_t  ,
void **  ,
int  ,
bus_dmamap_t  
)

Definition at line 870 of file aic7xxx_osm.c.

void ahc_dmamem_free ( struct ahc_softc ,
bus_dma_tag_t  ,
void ,
bus_dmamap_t   
)

Definition at line 881 of file aic7xxx_osm.c.

void ahc_done ( struct ahc_softc ,
struct scb  
)

Definition at line 1720 of file aic7xxx_osm.c.

uint8_t ahc_inb ( struct ahc_softc ahc,
long  port 
)

Definition at line 409 of file aic7xxx_osm.c.

void ahc_insb ( struct ahc_softc ahc,
long  port,
uint8_t ,
int  count 
)

Definition at line 448 of file aic7xxx_osm.c.

irqreturn_t ahc_linux_isr ( int  irq,
void dev_id 
)

Definition at line 1608 of file aic7xxx_osm.c.

int ahc_linux_proc_info ( struct Scsi_Host ,
char ,
char **  ,
off_t  ,
int  ,
int   
)

Definition at line 335 of file aic7xxx_proc.c.

int ahc_linux_register_host ( struct ahc_softc ,
struct scsi_host_template  
)

Definition at line 1097 of file aic7xxx_osm.c.

void ahc_outb ( struct ahc_softc ahc,
long  port,
uint8_t  val 
)

Definition at line 423 of file aic7xxx_osm.c.

void ahc_outsb ( struct ahc_softc ahc,
long  port,
uint8_t ,
int  count 
)

Definition at line 434 of file aic7xxx_osm.c.

int ahc_platform_abort_scbs ( struct ahc_softc ahc,
int  target,
char  channel,
int  lun,
u_int  tag,
role_t  role,
uint32_t  status 
)

Definition at line 1366 of file aic7xxx_osm.c.

int ahc_platform_alloc ( struct ahc_softc ahc,
void platform_arg 
)

Definition at line 1221 of file aic7xxx_osm.c.

void ahc_platform_dump_card_state ( struct ahc_softc ahc)

Definition at line 2359 of file aic7xxx_osm.c.

void ahc_platform_flushwork ( struct ahc_softc ahc)

Definition at line 1622 of file aic7xxx_osm.c.

void ahc_platform_free ( struct ahc_softc ahc)

Definition at line 1240 of file aic7xxx_osm.c.

void ahc_platform_freeze_devq ( struct ahc_softc ahc,
struct scb scb 
)

Definition at line 1274 of file aic7xxx_osm.c.

void ahc_platform_set_tags ( struct ahc_softc ahc,
struct scsi_device sdev,
struct ahc_devinfo devinfo,
ahc_queue_alg   
)

Definition at line 1283 of file aic7xxx_osm.c.

void ahc_print_path ( struct ahc_softc ,
struct scb  
)

Definition at line 263 of file aic7xxx_osm.c.

void ahc_send_async ( struct ahc_softc ,
char  channel,
u_int  target,
u_int  lun,
ac_code   
)

Definition at line 1628 of file aic7xxx_osm.c.

Variable Documentation

u_int aic7xxx_allow_memio

Definition at line 310 of file aic7xxx_osm.c.

struct scsi_host_template aic7xxx_driver_template

Definition at line 802 of file aic7xxx_osm.c.

u_int aic7xxx_no_probe
u_int aic7xxx_verbose

Definition at line 1094 of file aic7xxx_osm.c.