Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

eata_dma.c File Reference

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/malloc.h>
#include <linux/in.h>
#include <linux/bios32.h>
#include <linux/pci.h>
#include <linux/proc_fs.h>
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <asm/types.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/pgtable.h>
#include <linux/blk.h>
#include "scsi.h"
#include "sd.h"
#include "hosts.h"
#include "eata_dma.h"
#include "eata_dma_proc.h"
#include <linux/stat.h>
#include <linux/config.h>
#include "eata_dma_proc.c"

Include dependency graph for eata_dma.c:

Go to the source code of this file.

Functions

void eata_scsi_done (Scsi_Cmnd *scmd)
void eata_fake_int_handler (s32 irq, void *dev_id, struct pt_regs *regs)
void eata_latency_in (struct eata_ccb *cp, hostdata *hd)
void eata_latency_out (struct eata_ccb *cp, Scsi_Cmnd *cmd)
void eata_int_handler (int, void *, struct pt_regs *)
void do_eata_int_handler (int irq, void *dev_id, struct pt_regs *regs)
int eata_send_command (u32 addr, u32 base, u8 command)
int eata_send_immediate (u32 base, u32 addr, u8 ifc, u8 code, u8 code2)
int eata_queue (Scsi_Cmnd *cmd, void(*done)(Scsi_Cmnd *))
int eata_abort (Scsi_Cmnd *cmd)
int eata_reset (Scsi_Cmnd *cmd, unsigned int resetflags)
static void eata_select_queue_depths (struct Scsi_Host *host, Scsi_Device *devicelist)
int check_blink_state (long base)
char * get_board_data (u32 base, u32 irq, u32 id)
int get_conf_PIO (u32 base, struct get_conf *buf)
void print_config (struct get_conf *gc)
short register_HBA (u32 base, struct get_conf *gc, Scsi_Host_Template *tpnt, u8 bustype)
void find_EISA (struct get_conf *buf, Scsi_Host_Template *tpnt)
void find_ISA (struct get_conf *buf, Scsi_Host_Template *tpnt)
void find_PCI (struct get_conf *buf, Scsi_Host_Template *tpnt)
int eata_detect (Scsi_Host_Template *tpnt)

Variables

proc_dir_entry proc_scsi_eata_dma
static u32 ISAbases []
static unchar EISAbases []
static uint registered_HBAs = 0
static struct Scsi_Hostlast_HBA = NULL
static struct Scsi_Hostfirst_HBA = NULL
static unchar reg_IRQ []
static unchar reg_IRQL []
static struct eata_spstatus = 0
static void * dma_scratch = 0
static struct eata_registerfake_int_base
static int fake_int_result
static int fake_int_happened
static ulong int_counter = 0
static ulong queue_counter = 0


Function Documentation

int check_blink_state long  base  ) 
 

Definition at line 906 of file eata_dma.c.

References DBG, DBG_BLINK, FALSE, htonl(), inl, printk, state, TRUE, u32, uint, and ushort.

Referenced by find_EISA(), find_ISA(), and find_PCI().

Here is the call graph for this function:

void do_eata_int_handler int  irq,
void *  dev_id,
struct pt_regs regs
 

Definition at line 250 of file eata_dma.c.

References eata_int_handler(), io_request_lock, spin_lock_irqsave, and spin_unlock_irqrestore.

Referenced by eata_detect().

Here is the call graph for this function:

int eata_abort Scsi_Cmnd cmd  ) 
 

Definition at line 630 of file eata_dma.c.

References scsi_cmnd::abort_reason, Scsi_Host::base, CD, cli, DBG, DBG_ABNORM, DBG_DELAY, DELAY, eata_int_handler(), FREE, HA_ABUSY, HA_AIRQ, HA_RAUXSTAT, scsi_cmnd::host, Scsi_Host::host_no, HZ, inb, Scsi_Host::irq, LOCKED, loop, scsi_cmnd::lun, next, panic(), scsi_cmnd::pid, printk, RESET, restore_flags, save_flags, SCSI_ABORT_BUSY, SCSI_ABORT_ERROR, SCSI_ABORT_NOT_RUNNING, scsi_cmnd::target, u32, uint, ulong, USED, and x.

Here is the call graph for this function:

int eata_detect Scsi_Host_Template tpnt  ) 
 

Definition at line 1528 of file eata_dma.c.

References Scsi_Host::base, BUSMASTER, Scsi_Host::can_queue, DBG, DBG_DELAY, DBG_PROBE, DELAY, Scsi_Host::dma_channel, dma_scratch, do_eata_int_handler(), DPT_DEBUG, find_EISA(), find_ISA(), find_PCI(), free_irq(), Scsi_Host::host_no, Scsi_Host::irq, MAXIRQ, name, NULL, printk, SHT::proc_dir, reg_IRQ, registered_HBAs, request_irq(), revision, SA_INTERRUPT, SA_SHIRQ, scsi_init_free(), scsi_init_malloc(), SD, Scsi_Host::sg_tablesize, Scsi_Host::this_id, TRUE, u32, VER_MAJOR, VER_MINOR, and VER_SUB.

Here is the call graph for this function:

void eata_fake_int_handler s32  irq,
void *  dev_id,
struct pt_regs regs
 

Definition at line 136 of file eata_dma.c.

References DBG, DBG_INTR3, fake_int_happened, fake_int_result, HA_RSTATUS, inb, printk, TRUE, and ulong.

Referenced by register_HBA().

void eata_int_handler int  ,
void *  ,
struct pt_regs
 

Definition at line 259 of file eata_dma.c.

References Scsi_Host::base, eata_sp::ccb, eata_ccb::cmd, DBG, DBG_DELAY, DBG_INTR, DBG_STATUS, DELAY, scsi_cmnd::device, DID_ABORT, DID_BUS_BUSY, DID_ERROR, DID_OK, DID_RESET, DID_TIME_OUT, eata_latency_in(), eata_sp::EOC, FALSE, FREE, HA_AIRQ, HA_BUS_PARITY, HA_BUS_RESET, HA_CP_ABORT_NA, HA_CP_ABORTED, HA_CP_RESET, HA_CP_RESET_NA, HA_ERR_CMD_TO, HA_ERR_SEL_TO, HA_INIT_POWERUP, HA_NO_ERROR, HA_PARITY_ERR, HA_RAUXSTAT, HA_RESET_STUCK, HA_RSENSE_FAIL, HA_RSTATUS, HA_SCSI_HUNG, HA_UNX_BUS_FREE, HA_UNX_BUSPHASE, HA_UNX_MSGRJCT, eata_sp::hba_stat, HD, scsi_cmnd::host, inb, int_counter, Scsi_Host::irq, KERN_DEBUG, KERN_ERR, KERN_WARNING, LOCKED, scsi_cmnd::lun, MAXTARGET, next, NULL, scsi_cmnd::pid, printk, RESET, scsi_cmnd::result, result, scsi_cmnd::scsi_done, eata_sp::scsi_stat, SD, scsi_cmnd::sense_buffer, sp, eata_ccb::status, sys_cacheflush(), scsi_cmnd::target, eata_ccb::timestamp, TRUE, TYPE_TAPE, uint, x, x50, and xf.

Referenced by do_eata_int_handler(), eata_abort(), eata_queue(), and eata_reset().

Here is the call graph for this function:

void eata_latency_in struct eata_ccb cp,
hostdata hd
[inline]
 

Definition at line 172 of file eata_dma.c.

References jiffies, READ, eata_ccb::rw_latency, eata_ccb::sizeindex, time(), eata_ccb::timestamp, uint, and WRITE.

Referenced by eata_int_handler().

Here is the call graph for this function:

void eata_latency_out struct eata_ccb cp,
Scsi_Cmnd cmd
[inline]
 

Definition at line 199 of file eata_dma.c.

References scsi_cmnd::cmnd, jiffies, ntohl(), ntohs(), OTHER, READ, READ_10, READ_12, READ_6, eata_ccb::rw_latency, eata_ccb::sizeindex, eata_ccb::timestamp, WRITE, WRITE_10, WRITE_12, WRITE_6, x, and z.

Referenced by eata_queue().

Here is the call graph for this function:

int eata_queue Scsi_Cmnd cmd,
void(*)(Scsi_Cmnd *)  done
 

Definition at line 474 of file eata_dma.c.

References scatterlist::address, eata_ccb::Auto_Req_Sen, Scsi_Host::base, Scsi_Host::can_queue, CHANGE_DEFINITION, scsi_cmnd::channel, cli, eata_ccb::cmd, scsi_cmnd::cmd_len, scsi_cmnd::cmnd, COMPARE, COPY, COPY_VERIFY, eata_ccb::cp_cdb, eata_ccb::cp_channel, eata_ccb::cp_dataDMA, eata_ccb::cp_datalen, eata_ccb::cp_dispri, eata_ccb::cp_id, eata_ccb::cp_identify, eata_ccb::cp_lun, eata_ccb::cp_reqDMA, eata_ccb::cp_statDMA, eata_ccb::cp_viraddr, eata_sg_list::data, eata_ccb::DataIn, eata_ccb::DataOut, DBG, DBG_ABNORM, DBG_DELAY, DBG_QUEUE, DBG_REQSENSE, DELAY, DID_BUS_BUSY, DID_OK, done, EATA_CMD_DMA_SEND_CP, eata_int_handler(), eata_latency_out(), eata_send_command(), FALSE, FORMAT_UNIT, FREE, HA_AIRQ, HA_RAUXSTAT, hd, HD, scsi_cmnd::host, Scsi_Host::host_no, scsi_cmnd::host_scribble, htonl(), inb, eata_ccb::Interpret, Scsi_Host::irq, KERN_CRIT, KERN_DEBUG, kmalloc(), eata_sg_list::len, scatterlist::length, LOG_SELECT, scsi_cmnd::lun, MEDIUM_SCAN, memcpy, memset, MODE_SELECT, MODE_SELECT_10, next, NULL, panic(), scsi_cmnd::pid, printk, queue_counter, REASSIGN_BLOCKS, eata_ccb::reqlen, scsi_cmnd::request_buffer, scsi_cmnd::request_bufflen, REQUEST_SENSE, RESERVE, restore_flags, scsi_cmnd::result, s32, save_flags, eata_ccb::scatter, scsi_cmnd::scsi_done, SEARCH_EQUAL, SEARCH_EQUAL_12, SEARCH_HIGH, SEARCH_HIGH_12, SEARCH_LOW, SEARCH_LOW_12, SEND_DIAGNOSTIC, SEND_VOLUME_TAG, scsi_cmnd::sense_buffer, SET_WINDOW, eata_ccb::sg_list, Scsi_Host::sg_tablesize, hostdata::sp, eata_ccb::status, scsi_cmnd::target, TEST_UNIT_READY, Scsi_Host::this_id, TRUE, u32, uint, ulong, UPDATE_BLOCK, scsi_cmnd::use_sg, USED, virt_to_bus, WRITE_10, WRITE_12, WRITE_6, WRITE_BUFFER, WRITE_LONG, WRITE_SAME, WRITE_VERIFY, WRITE_VERIFY_12, x, and y.

Here is the call graph for this function:

int eata_reset Scsi_Cmnd cmd,
unsigned int  resetflags
 

Definition at line 688 of file eata_dma.c.

References scsi_cmnd::abort_reason, Scsi_Host::base, cli, DBG, DBG_ABNORM, DBG_DELAY, DELAY, DID_RESET, EATA_CMD_RESET, eata_int_handler(), eata_send_command(), FALSE, FREE, HA_ABUSY, HA_AIRQ, HA_RAUXSTAT, HA_RSTATUS, HD, scsi_cmnd::host, Scsi_Host::host_no, inb, io_request_lock, Scsi_Host::irq, LOCKED, loop, scsi_cmnd::lun, next, NULL, panic(), scsi_cmnd::pid, printk, RESET, restore_flags, scsi_cmnd::result, save_flags, scsi_cmnd::scsi_done, SCSI_RESET_ERROR, SCSI_RESET_PENDING, SCSI_RESET_PUNT, sp, spin_lock_irqsave, spin_unlock_irqrestore, state, success, scsi_cmnd::target, TRUE, u32, uint, ulong, and x.

Here is the call graph for this function:

void eata_scsi_done Scsi_Cmnd scmd  ) 
 

Definition at line 126 of file eata_dma.c.

References NULL, scsi_cmnd::request, RQ_SCSI_DONE, request::rq_status, request::sem, and up.

Referenced by eata_proc_info().

static void eata_select_queue_depths struct Scsi_Host host,
Scsi_Device devicelist
[static]
 

Definition at line 811 of file eata_dma.c.

References DBG, DBG_REGISTER, device, factor, IS_ISA, KERN_DEBUG, KERN_INFO, NULL, printk, SD, TYPE_DISK, TYPE_DISK_QUEUE, TYPE_MOD, TYPE_OTHER_QUEUE, TYPE_PROCESSOR, TYPE_ROM, TYPE_ROM_QUEUE, TYPE_SCANNER, TYPE_TAPE, TYPE_TAPE_QUEUE, TYPE_WORM, and UPPER_DEVICE_QUEUE_LIMIT.

Referenced by register_HBA().

int eata_send_command u32  addr,
u32  base,
u8  command
[inline]
 

Definition at line 405 of file eata_dma.c.

References FALSE, flush_cache_all, HA_ABUSY, HA_RAUXSTAT, HA_WCOMMAND, HA_WDMAADDR, inb, loop, NULL, outb, R_LIMIT, TRUE, u32, and virt_to_bus.

Referenced by eata_queue(), eata_reset(), get_board_data(), and get_conf_PIO().

int eata_send_immediate u32  base,
u32  addr,
u8  ifc,
u8  code,
u8  code2
[inline]
 

Definition at line 438 of file eata_dma.c.

References EATA_CMD_IMMEDIATE, flush_cache_all, HA_WCODE, HA_WCODE2, HA_WCOMMAND, HA_WDMAADDR, HA_WIFC, NULL, outb, TRUE, u32, virt_to_bus, and x0.

void find_EISA struct get_conf buf,
Scsi_Host_Template tpnt
 

Definition at line 1343 of file eata_dma.c.

References ATT_ID1, ATT_ID2, ATT_ID3, check_blink_state(), DBG, DBG_EISA, DBG_PROBE, DPT_ID1, DPT_ID2, EISAbases, get_conf_PIO(), inb, IS_EISA, MAXEISA, NEC_ID1, NEC_ID2, NEC_ID3, printk, register_HBA(), TRUE, u16, u32, and u8.

Referenced by eata_detect().

Here is the call graph for this function:

void find_ISA struct get_conf buf,
Scsi_Host_Template tpnt
 

Definition at line 1391 of file eata_dma.c.

References check_blink_state(), DBG, DBG_ISA, get_conf_PIO(), IS_ISA, ISAbases, MAXISA, printk, register_HBA(), and TRUE.

Referenced by eata_detect().

Here is the call graph for this function:

void find_PCI struct get_conf buf,
Scsi_Host_Template tpnt
 

Definition at line 1414 of file eata_dma.c.

References ATT_ID1, ATT_ID2, ATT_ID3, check_blink_state(), DBG, DBG_PCI, DBG_PROBE, DPT_ID1, DPT_ID2, EISAbases, error, get_conf_PIO(), inb, IS_PCI, ISAbases, MAXISA, MAXPCI, NEC_ID1, NEC_ID2, NEC_ID3, PCI_BASE_ADDRESS_0, PCI_CLASS_DEVICE, PCI_CLASS_STORAGE_SCSI, PCI_COMMAND, PCI_COMMAND_IO, PCI_COMMAND_MASTER, PCI_DEVICE_ID_DPT, pci_present, PCI_VENDOR_ID_DPT, pcibios_find_device(), pcibios_read_config_dword(), pcibios_read_config_word(), printk, register_HBA(), s32, TRUE, u16, u32, u8, x, x01, x1000, and xf8.

Referenced by eata_detect().

Here is the call graph for this function:

char* get_board_data u32  base,
u32  irq,
u32  id
 

Definition at line 929 of file eata_dma.c.

References eata_ccb::cp_cdb, eata_ccb::cp_dataDMA, eata_ccb::cp_datalen, eata_ccb::cp_dispri, eata_ccb::cp_id, eata_ccb::cp_identify, eata_ccb::cp_lun, eata_ccb::cp_statDMA, eata_ccb::cp_viraddr, eata_ccb::DataIn, DBG, DBG_INTR3, DELAY, dma_scratch, EATA_CMD_DMA_SEND_CP, EATA_CMD_RESET, eata_send_command(), fake_int_happened, fake_int_result, FALSE, HA_RSTATUS, HA_SERROR, eata_sp::hba_stat, htonl(), HZ, inb, INQUIRY, eata_ccb::Interpret, jiffies, KERN_DEBUG, KERN_WARNING, memset, NULL, printk, scsi_init_free(), scsi_init_malloc(), eata_sp::scsi_stat, sp, time_after, time_before_eq, TRUE, u32, ulong, and virt_to_bus.

Referenced by register_HBA().

Here is the call graph for this function:

int get_conf_PIO u32  base,
struct get_conf buf
 

Definition at line 998 of file eata_dma.c.

References check_region, DBG, DBG_PIO, DBG_PROBE, EATA_CMD_PIO_READ_CONFIG, eata_send_command(), EATA_SIGNATURE, fake_int_happened, fake_int_result, FALSE, HA_RDATA, HA_RSTATUS, HA_SBUSY, HA_SDRQ, HA_SERROR, htonl(), inb, inw, loop, memset, p, printk, R_LIMIT, TRUE, u16, uint, and ulong.

Referenced by find_EISA(), find_ISA(), and find_PCI().

Here is the call graph for this function:

void print_config struct get_conf gc  ) 
 

Definition at line 1049 of file eata_dma.c.

References DBG, DELAY, DPT_DEBUG, ntohl(), ntohs(), printk, and u32.

Referenced by register_HBA().

Here is the call graph for this function:

short register_HBA u32  base,
struct get_conf gc,
Scsi_Host_Template tpnt,
u8  bustype
 

Definition at line 1067 of file eata_dma.c.

References Scsi_Host::base, BROKEN_INQUIRY, BUSMASTER, Scsi_Host::can_queue, clear_dma_ff, Scsi_Host::cmd_per_lun, DBG, DBG_REGISTER, disable_dma(), Scsi_Host::dma_channel, get_conf::DMA_channel, DMA_MODE_CASCADE, get_conf::DMA_support, get_conf::DMA_valid, eata_fake_int_handler(), eata_select_queue_depths(), enable_dma(), FALSE, free_dma(), free_irq(), get_board_data(), get_conf::HAA_valid, hd, Scsi_Host::host_no, Scsi_Host::io_port, Scsi_Host::irq, get_conf::IRQ, get_conf::IRQ_TR, IS_EISA, IS_ISA, KERN_NOTICE, KERN_WARNING, get_conf::len, get_conf::MAX_CHAN, Scsi_Host::max_channel, get_conf::MAX_ID, Scsi_Host::max_id, get_conf::MAX_LUN, Scsi_Host::max_lun, memset, Scsi_Host::n_io_port, ntohl(), ntohs(), NULL, print_config(), printk, get_conf::queuesiz, reg_IRQ, reg_IRQL, registered_HBAs, request_dma(), request_irq(), request_region, SA_INTERRUPT, get_conf::scsi_id, scsi_register(), scsi_unregister(), SD, get_conf::SECOND, Scsi_Host::select_queue_depths, set_dma_mode(), get_conf::SG_64K, SG_SIZE, SG_SIZE_BIG, Scsi_Host::sg_tablesize, get_conf::SGsiz, size, strcpy, strncpy, Scsi_Host::this_id, TRUE, u32, ulong, Scsi_Host::unchecked_isa_dma, Scsi_Host::unique_id, Scsi_Host::wish_block, and x.

Referenced by find_EISA(), find_ISA(), and find_PCI().

Here is the call graph for this function:


Variable Documentation

void* dma_scratch = 0 [static]
 

Definition at line 117 of file eata_dma.c.

Referenced by eata_detect(), and get_board_data().

unchar EISAbases[] [static]
 

Initial value:

{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}

Definition at line 107 of file eata_dma.c.

Referenced by find_EISA(), find_PCI(), find_pio_EISA(), and find_pio_PCI().

struct eata_register* fake_int_base [static]
 

Definition at line 119 of file eata_dma.c.

int fake_int_happened [static]
 

Definition at line 121 of file eata_dma.c.

Referenced by eata_fake_int_handler(), get_board_data(), and get_conf_PIO().

int fake_int_result [static]
 

Definition at line 120 of file eata_dma.c.

Referenced by eata_fake_int_handler(), get_board_data(), and get_conf_PIO().

struct Scsi_Host* first_HBA = NULL [static]
 

Definition at line 111 of file eata_dma.c.

Referenced by eata_pio_proc_info(), and eata_proc_info().

ulong int_counter = 0 [static]
 

Definition at line 123 of file eata_dma.c.

Referenced by eata_int_handler(), eata_pio_int_handler(), eata_pio_proc_info(), eata_pio_queue(), and eata_proc_info().

u32 ISAbases[] [static]
 

Initial value:

{0x1F0, 0x170, 0x330, 0x230}

Definition at line 105 of file eata_dma.c.

Referenced by find_ISA(), find_PCI(), find_pio_ISA(), find_pio_PCI(), and get_pio_conf_PIO().

struct Scsi_Host* last_HBA = NULL [static]
 

Definition at line 110 of file eata_dma.c.

struct proc_dir_entry proc_scsi_eata_dma
 

Initial value:

 {
    PROC_SCSI_EATA, 8, "eata_dma",
    S_IFDIR | S_IRUGO | S_IXUGO, 2
}

Definition at line 100 of file eata_dma.c.

ulong queue_counter = 0 [static]
 

Definition at line 124 of file eata_dma.c.

Referenced by eata_pio_proc_info(), eata_pio_queue(), eata_proc_info(), and eata_queue().

unchar reg_IRQ[] [static]
 

Initial value:

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

Definition at line 112 of file eata_dma.c.

Referenced by eata_detect(), eata_pio_detect(), register_HBA(), and register_pio_HBA().

unchar reg_IRQL[] [static]
 

Initial value:

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

Definition at line 114 of file eata_dma.c.

Referenced by register_HBA(), and register_pio_HBA().

uint registered_HBAs = 0 [static]
 

Definition at line 109 of file eata_dma.c.

Referenced by