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

powertec.c File Reference

#include <linux/module.h>
#include <linux/blk.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h>
#include <asm/dma.h>
#include <asm/ecard.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/pgtable.h>
#include "../../scsi/sd.h"
#include "../../scsi/hosts.h"
#include "powertec.h"

Include dependency graph for powertec.c:

Go to the source code of this file.

Defines

#define POWERTEC_XTALFREQ   40
#define POWERTEC_ASYNC_PERIOD   200
#define POWERTEC_SYNC_DEPTH   7
#define POWERTECSCSI_LIST   { MANU_ALSYSTEMS, PROD_ALSYS_SCSIATAPI }
#define POWERTEC_FAS216_OFFSET   0xc00
#define POWERTEC_FAS216_SHIFT   4
#define POWERTEC_INTR_STATUS   0x800
#define POWERTEC_INTR_BIT   0x80
#define POWERTEC_RESET_CONTROL   0x406
#define POWERTEC_RESET_BIT   1
#define POWERTEC_TERM_CONTROL   0x806
#define POWERTEC_TERM_ENABLE   1
#define POWERTEC_INTR_CONTROL   0x407
#define POWERTEC_INTR_ENABLE   1
#define POWERTEC_INTR_DISABLE   0
#define VER_MAJOR   0
#define VER_MINOR   0
#define VER_PATCH   2

Functions

 MODULE_AUTHOR ("Russell King")
 MODULE_DESCRIPTION ("Powertec SCSI driver")
 MODULE_PARM (term,"1-8i")
 MODULE_PARM_DESC (term,"SCSI bus termination")
static void powertecscsi_irqenable (struct expansion_card *ec, int irqnr)
static void powertecscsi_irqdisable (struct expansion_card *ec, int irqnr)
static void powertecscsi_terminator_ctl (struct Scsi_Host *host, int on_off)
static void powertecscsi_intr (int irq, void *dev_id, struct pt_regs *regs)
static void powertecscsi_invalidate (char *addr, long len, fasdmadir_t direction)
static fasdmatype_t powertecscsi_dma_setup (struct Scsi_Host *host, Scsi_Pointer *SCp, fasdmadir_t direction, fasdmatype_t min_type)
static void powertecscsi_dma_stop (struct Scsi_Host *host, Scsi_Pointer *SCp)
int powertecscsi_detect (Scsi_Host_Template *tpnt)
int powertecscsi_release (struct Scsi_Host *host)
const char * powertecscsi_info (struct Scsi_Host *host)
static int powertecscsi_set_proc_info (struct Scsi_Host *host, char *buffer, int length)
int powertecscsi_proc_info (char *buffer, char **start, off_t offset, int length, int host_no, int inout)

Variables

static struct expansion_cardecs [MAX_ECARDS]
int term [MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }
static struct proc_dir_entry proc_scsi_powertec
static const expansioncard_ops_t powertecscsi_ops


Define Documentation

#define POWERTEC_ASYNC_PERIOD   200
 

Definition at line 41 of file powertec.c.

Referenced by powertecscsi_detect().

#define POWERTEC_FAS216_OFFSET   0xc00
 

Definition at line 49 of file powertec.c.

Referenced by powertecscsi_detect(), and powertecscsi_release().

#define POWERTEC_FAS216_SHIFT   4
 

Definition at line 50 of file powertec.c.

Referenced by powertecscsi_detect(), and powertecscsi_release().

#define POWERTEC_INTR_BIT   0x80
 

Definition at line 53 of file powertec.c.

Referenced by powertecscsi_detect().

#define POWERTEC_INTR_CONTROL   0x407
 

Definition at line 61 of file powertec.c.

Referenced by powertecscsi_detect().

#define POWERTEC_INTR_DISABLE   0
 

Definition at line 63 of file powertec.c.

Referenced by powertecscsi_irqdisable().

#define POWERTEC_INTR_ENABLE   1
 

Definition at line 62 of file powertec.c.

Referenced by powertecscsi_irqenable().

#define POWERTEC_INTR_STATUS   0x800
 

Definition at line 52 of file powertec.c.

Referenced by powertecscsi_detect().

#define POWERTEC_RESET_BIT   1
 

Definition at line 56 of file powertec.c.

#define POWERTEC_RESET_CONTROL   0x406
 

Definition at line 55 of file powertec.c.

#define POWERTEC_SYNC_DEPTH   7
 

Definition at line 42 of file powertec.c.

Referenced by powertecscsi_detect().

#define POWERTEC_TERM_CONTROL   0x806
 

Definition at line 58 of file powertec.c.

Referenced by powertecscsi_detect().

#define POWERTEC_TERM_ENABLE   1
 

Definition at line 59 of file powertec.c.

Referenced by powertecscsi_detect(), and powertecscsi_terminator_ctl().

#define POWERTEC_XTALFREQ   40
 

Definition at line 40 of file powertec.c.

Referenced by powertecscsi_detect().

#define POWERTECSCSI_LIST   { MANU_ALSYSTEMS, PROD_ALSYS_SCSIATAPI }
 

Definition at line 47 of file powertec.c.

Referenced by powertecscsi_detect().

#define VER_MAJOR   0
 

Definition at line 68 of file powertec.c.

#define VER_MINOR   0
 

Definition at line 69 of file powertec.c.

#define VER_PATCH   2
 

Definition at line 70 of file powertec.c.


Function Documentation

MODULE_AUTHOR "Russell King"   ) 
 

MODULE_DESCRIPTION "Powertec SCSI driver  ) 
 

MODULE_PARM term  ,
"1-8i" 
 

MODULE_PARM_DESC term  ,
"SCSI bus termination" 
 

int powertecscsi_detect Scsi_Host_Template tpnt  ) 
 

Definition at line 232 of file powertec.c.

References CNTL3_FASTCLK, CNTL3_FASTSCSI, PowerTecScsi_Info::control, count, FAS216_Info::dma, Scsi_Host::dma_channel, ecard_address(), ecard_claim, ECARD_FAST, ecard_find(), ECARD_IOC, ecard_release, ecard_startfind(), fas216_init(), Scsi_Host::host_no, FAS216_Info::ifcfg, PowerTecScsi_Info::info, Scsi_Host::io_port, ioaddr, Scsi_Host::irq, memset, NO_DMA, NO_IRQ, NULL, POWERTEC_ASYNC_PERIOD, POWERTEC_FAS216_OFFSET, POWERTEC_FAS216_SHIFT, POWERTEC_INTR_BIT, POWERTEC_INTR_CONTROL, POWERTEC_INTR_STATUS, POWERTEC_SYNC_DEPTH, POWERTEC_TERM_CONTROL, POWERTEC_TERM_ENABLE, POWERTEC_XTALFREQ, powertecscsi_dma_setup(), powertecscsi_dma_stop(), powertecscsi_intr(), POWERTECSCSI_LIST, powertecscsi_terminator_ctl(), printk, SHT::proc_dir, request_dma(), request_irq(), request_region, SA_INTERRUPT, FAS216_Info::scsi, scsi_register(), and term.

Here is the call graph for this function:

static fasdmatype_t powertecscsi_dma_setup struct Scsi_Host host,
Scsi_Pointer SCp,
fasdmadir_t  direction,
fasdmatype_t  min_type
[static]
 

Definition at line 172 of file powertec.c.

References __virt_to_bus, __virt_to_phys, scatterlist::address, dmasg_t::address, buf, scsi_pointer::buffer, disable_dma(), Scsi_Host::dma_channel, DMA_MODE_READ, DMA_MODE_WRITE, DMA_OUT, PowerTecScsi_Info::dmasg, enable_dma(), fasdma_pio, fasdma_real_all, scatterlist::length, dmasg_t::length, NO_DMA, NR_SG, powertecscsi_invalidate(), scsi_pointer::ptr, set_dma_mode(), set_dma_sg(), and scsi_pointer::this_residual.

Referenced by powertecscsi_detect().

Here is the call graph for this function:

static void powertecscsi_dma_stop struct Scsi_Host host,
Scsi_Pointer SCp
[static]
 

Definition at line 220 of file powertec.c.

References disable_dma(), Scsi_Host::dma_channel, and NO_DMA.

Referenced by powertecscsi_detect().

Here is the call graph for this function:

const char* powertecscsi_info struct Scsi_Host host  ) 
 

Definition at line 344 of file powertec.c.

References PowerTecScsi_Info::control, Scsi_Host::dma_channel, Scsi_Host::hostt, PowerTecScsi_Info::info, Scsi_Host::io_port, Scsi_Host::irq, SHT::name, NO_DMA, NO_IRQ, p, FAS216_Info::scsi, sprintf(), VER_MAJOR, VER_MINOR, and VER_PATCH.

Here is the call graph for this function:

static void powertecscsi_intr int  irq,
void *  dev_id,
struct pt_regs regs
[static]
 

Definition at line 147 of file powertec.c.

References fas216_intr().

Referenced by powertecscsi_detect().

Here is the call graph for this function:

static void powertecscsi_invalidate char *  addr,
long  len,
fasdmadir_t  direction
[static]
 

Definition at line 155 of file powertec.c.

References dma_cache_inv, dma_cache_wback, and DMA_OUT.

Referenced by powertecscsi_dma_setup().

static void powertecscsi_irqdisable struct expansion_card ec,
int  irqnr
[static]
 

Definition at line 107 of file powertec.c.

References expansion_card::irq_data, outb, port, and POWERTEC_INTR_DISABLE.

static void powertecscsi_irqenable struct expansion_card ec,
int  irqnr
[static]
 

Definition at line 95 of file powertec.c.

References expansion_card::irq_data, outb, port, and POWERTEC_INTR_ENABLE.

int powertecscsi_proc_info char *  buffer,
char **  start,
off_t  offset,
int  length,
int  host_no,
int  inout
 

Definition at line 417 of file powertec.c.

References PowerTecScsi_Info::control, Scsi_Host::dma_channel, fas216_print_device(), fas216_print_stats(), Scsi_Host::host_no, Scsi_Host::host_queue, PowerTecScsi_Info::info, Scsi_Host::io_port, Scsi_Host::irq, Scsi_Host::next, pos, powertecscsi_set_proc_info(), FAS216_Info::scsi, scsi_hostlist, sprintf(), VER_MAJOR, VER_MINOR, and VER_PATCH.

Here is the call graph for this function:

int powertecscsi_release struct Scsi_Host host  ) 
 

Definition at line 319 of file powertec.c.

References Scsi_Host::dma_channel, ecard_address(), ECARD_FAST, ECARD_IOC, ecard_release, fas216_release(), free_dma(), free_irq(), i, Scsi_Host::io_port, Scsi_Host::irq, MAX_ECARDS, NO_DMA, NO_IRQ, POWERTEC_FAS216_OFFSET, POWERTEC_FAS216_SHIFT, and release_region.

Here is the call graph for this function:

static int powertecscsi_set_proc_info struct Scsi_Host host,
char *  buffer,
int  length
[static]
 

Definition at line 381 of file powertec.c.

References EINVAL, powertecscsi_terminator_ctl(), ret, and strncmp().

Referenced by powertecscsi_proc_info().

Here is the call graph for this function:

static void powertecscsi_terminator_ctl struct Scsi_Host host,
int  on_off
[static]
 

Definition at line 128 of file powertec.c.

References PowerTecScsi_Info::control, outb, and POWERTEC_TERM_ENABLE.

Referenced by powertecscsi_detect(), and powertecscsi_set_proc_info().


Variable Documentation

struct expansion_card* ecs[MAX_ECARDS] [static]
 

Definition at line 77 of file powertec.c.

const expansioncard_ops_t powertecscsi_ops [static]
 

Initial value:

Definition at line 113 of file powertec.c.

struct proc_dir_entry proc_scsi_powertec [static]
 

Initial value:

 {
        PROC_SCSI_QLOGICISP, 8, "powertec",
        S_IFDIR | S_IRUGO | S_IXUGO, 2
}

Definition at line 84 of file powertec.c.

int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }
 

Definition at line 82 of file powertec.c.