Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
aha152x.c File Reference
#include <linux/module.h>
#include <asm/irq.h>
#include <linux/io.h>
#include <linux/blkdev.h>
#include <linux/completion.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/wait.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/isapnp.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <scsi/scsicam.h>
#include "scsi.h"
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport_spi.h>
#include <scsi/scsi_eh.h>
#include "aha152x.h"

Go to the source code of this file.

Data Structures

struct  aha152x_hostdata
 
struct  aha152x_scdata
 
struct  signature
 

Macros

#define DPRINTK(when, msgs...)
 
#define DO_LOCK(flags)   spin_lock_irqsave(&QLOCK,flags)
 
#define DO_UNLOCK(flags)   spin_unlock_irqrestore(&QLOCK,flags)
 
#define LEAD   "(scsi%d:%d:%d) "
 
#define WARN_LEAD   KERN_WARNING LEAD
 
#define INFO_LEAD   KERN_INFO LEAD
 
#define NOTE_LEAD   KERN_NOTICE LEAD
 
#define ERR_LEAD   KERN_ERR LEAD
 
#define DEBUG_LEAD   KERN_DEBUG LEAD
 
#define CMDINFO(cmd)
 
#define DELAY_DEFAULT   1000
 
#define IRQ_MIN   9
 
#define IRQ_MAX   12
 
#define HOSTDATA(shpnt)   ((struct aha152x_hostdata *) &shpnt->hostdata)
 
#define HOSTNO   ((shpnt)->host_no)
 
#define CURRENT_SC   (HOSTDATA(shpnt)->current_SC)
 
#define DONE_SC   (HOSTDATA(shpnt)->done_SC)
 
#define ISSUE_SC   (HOSTDATA(shpnt)->issue_SC)
 
#define DISCONNECTED_SC   (HOSTDATA(shpnt)->disconnected_SC)
 
#define QLOCK   (HOSTDATA(shpnt)->lock)
 
#define QLOCKER   (HOSTDATA(shpnt)->locker)
 
#define QLOCKERL   (HOSTDATA(shpnt)->lockerl)
 
#define STATE   (HOSTDATA(shpnt)->state)
 
#define PREVSTATE   (HOSTDATA(shpnt)->prevstate)
 
#define LASTSTATE   (HOSTDATA(shpnt)->laststate)
 
#define RECONN_TARGET   (HOSTDATA(shpnt)->target)
 
#define CMD_I   (HOSTDATA(shpnt)->cmd_i)
 
#define MSGO(i)   (HOSTDATA(shpnt)->msgo[i])
 
#define MSGO_I   (HOSTDATA(shpnt)->msgo_i)
 
#define MSGOLEN   (HOSTDATA(shpnt)->msgo_len)
 
#define ADDMSGO(x)   (MSGOLEN<256 ? (void)(MSGO(MSGOLEN++)=x) : aha152x_error(shpnt,"MSGO overflow"))
 
#define MSGI(i)   (HOSTDATA(shpnt)->msgi[i])
 
#define MSGILEN   (HOSTDATA(shpnt)->msgi_len)
 
#define ADDMSGI(x)   (MSGILEN<256 ? (void)(MSGI(MSGILEN++)=x) : aha152x_error(shpnt,"MSGI overflow"))
 
#define DATA_LEN   (HOSTDATA(shpnt)->data_len)
 
#define SYNCRATE   (HOSTDATA(shpnt)->syncrate[CURRENT_SC->device->id])
 
#define SYNCNEG   (HOSTDATA(shpnt)->syncneg[CURRENT_SC->device->id])
 
#define DELAY   (HOSTDATA(shpnt)->delay)
 
#define EXT_TRANS   (HOSTDATA(shpnt)->ext_trans)
 
#define TC1550   (HOSTDATA(shpnt)->tc1550)
 
#define RECONNECT   (HOSTDATA(shpnt)->reconnect)
 
#define PARITY   (HOSTDATA(shpnt)->parity)
 
#define SYNCHRONOUS   (HOSTDATA(shpnt)->synchronous)
 
#define HOSTIOPORT0   (HOSTDATA(shpnt)->io_port0)
 
#define HOSTIOPORT1   (HOSTDATA(shpnt)->io_port1)
 
#define SCDATA(SCpnt)   ((struct aha152x_scdata *) (SCpnt)->host_scribble)
 
#define SCNEXT(SCpnt)   SCDATA(SCpnt)->next
 
#define SCSEM(SCpnt)   SCDATA(SCpnt)->done
 
#define SG_ADDRESS(buffer)   ((char *) sg_virt((buffer)))
 
#define SPRINTF(args...)   pos += sprintf(pos, ## args)
 
#define SPRINTF(args...)   do { if(pos < buffer + length) pos += sprintf(pos, ## args); } while(0)
 

Enumerations

enum  {
  not_issued = 0x0001, selecting = 0x0002, identified = 0x0004, disconnected = 0x0008,
  completed = 0x0010, aborted = 0x0020, resetted = 0x0040, spiordy = 0x0080,
  syncneg = 0x0100, aborting = 0x0200, resetting = 0x0400, check_condition = 0x0800
}
 
enum  aha152x_state {
  idle =0, unknown, seldo, seldi,
  selto, busfree, msgo, cmd,
  msgi, status, datai, datao,
  parerr, rsti, maxstate
}
 

Functions

 MODULE_AUTHOR ("Jürgen Fischer")
 
 MODULE_DESCRIPTION (AHA152X_REVID)
 
 MODULE_LICENSE ("GPL")
 
struct Scsi_Hostaha152x_probe_one (struct aha152x_setup *setup)
 
void aha152x_release (struct Scsi_Host *shpnt)
 
int aha152x_host_reset_host (struct Scsi_Host *shpnt)
 
 module_init (aha152x_init)
 
 module_exit (aha152x_exit)
 
 __setup ("aha152x=", aha152x_setup)
 

Macro Definition Documentation

#define ADDMSGI (   x)    (MSGILEN<256 ? (void)(MSGI(MSGILEN++)=x) : aha152x_error(shpnt,"MSGI overflow"))

Definition at line 603 of file aha152x.c.

#define ADDMSGO (   x)    (MSGOLEN<256 ? (void)(MSGO(MSGOLEN++)=x) : aha152x_error(shpnt,"MSGO overflow"))

Definition at line 599 of file aha152x.c.

#define CMD_I   (HOSTDATA(shpnt)->cmd_i)

Definition at line 594 of file aha152x.c.

#define CMDINFO (   cmd)
Value:
(cmd) ? ((cmd)->device->host->host_no) : -1, \
(cmd) ? ((cmd)->device->id & 0x0f) : -1, \
(cmd) ? ((cmd)->device->lun & 0x07) : -1

Definition at line 321 of file aha152x.c.

#define CURRENT_SC   (HOSTDATA(shpnt)->current_SC)

Definition at line 580 of file aha152x.c.

#define DATA_LEN   (HOSTDATA(shpnt)->data_len)

Definition at line 605 of file aha152x.c.

#define DEBUG_LEAD   KERN_DEBUG LEAD

Definition at line 320 of file aha152x.c.

#define DELAY   (HOSTDATA(shpnt)->delay)

Definition at line 610 of file aha152x.c.

#define DELAY_DEFAULT   1000

Definition at line 332 of file aha152x.c.

#define DISCONNECTED_SC   (HOSTDATA(shpnt)->disconnected_SC)

Definition at line 583 of file aha152x.c.

#define DO_LOCK (   flags)    spin_lock_irqsave(&QLOCK,flags)

Definition at line 311 of file aha152x.c.

#define DO_UNLOCK (   flags)    spin_unlock_irqrestore(&QLOCK,flags)

Definition at line 312 of file aha152x.c.

#define DONE_SC   (HOSTDATA(shpnt)->done_SC)

Definition at line 581 of file aha152x.c.

#define DPRINTK (   when,
  msgs... 
)

Definition at line 310 of file aha152x.c.

#define ERR_LEAD   KERN_ERR LEAD

Definition at line 319 of file aha152x.c.

#define EXT_TRANS   (HOSTDATA(shpnt)->ext_trans)

Definition at line 611 of file aha152x.c.

#define HOSTDATA (   shpnt)    ((struct aha152x_hostdata *) &shpnt->hostdata)

Definition at line 576 of file aha152x.c.

#define HOSTIOPORT0   (HOSTDATA(shpnt)->io_port0)

Definition at line 617 of file aha152x.c.

#define HOSTIOPORT1   (HOSTDATA(shpnt)->io_port1)

Definition at line 618 of file aha152x.c.

#define HOSTNO   ((shpnt)->host_no)

Definition at line 578 of file aha152x.c.

#define INFO_LEAD   KERN_INFO LEAD

Definition at line 317 of file aha152x.c.

#define IRQ_MAX   12

Definition at line 342 of file aha152x.c.

#define IRQ_MIN   9

Definition at line 338 of file aha152x.c.

#define ISSUE_SC   (HOSTDATA(shpnt)->issue_SC)

Definition at line 582 of file aha152x.c.

#define LASTSTATE   (HOSTDATA(shpnt)->laststate)

Definition at line 590 of file aha152x.c.

#define LEAD   "(scsi%d:%d:%d) "

Definition at line 315 of file aha152x.c.

#define MSGI (   i)    (HOSTDATA(shpnt)->msgi[i])

Definition at line 601 of file aha152x.c.

#define MSGILEN   (HOSTDATA(shpnt)->msgi_len)

Definition at line 602 of file aha152x.c.

#define MSGO (   i)    (HOSTDATA(shpnt)->msgo[i])

Definition at line 596 of file aha152x.c.

#define MSGO_I   (HOSTDATA(shpnt)->msgo_i)

Definition at line 597 of file aha152x.c.

#define MSGOLEN   (HOSTDATA(shpnt)->msgo_len)

Definition at line 598 of file aha152x.c.

#define NOTE_LEAD   KERN_NOTICE LEAD

Definition at line 318 of file aha152x.c.

#define PARITY   (HOSTDATA(shpnt)->parity)

Definition at line 614 of file aha152x.c.

#define PREVSTATE   (HOSTDATA(shpnt)->prevstate)

Definition at line 589 of file aha152x.c.

#define QLOCK   (HOSTDATA(shpnt)->lock)

Definition at line 584 of file aha152x.c.

#define QLOCKER   (HOSTDATA(shpnt)->locker)

Definition at line 585 of file aha152x.c.

#define QLOCKERL   (HOSTDATA(shpnt)->lockerl)

Definition at line 586 of file aha152x.c.

#define RECONN_TARGET   (HOSTDATA(shpnt)->target)

Definition at line 592 of file aha152x.c.

#define RECONNECT   (HOSTDATA(shpnt)->reconnect)

Definition at line 613 of file aha152x.c.

#define SCDATA (   SCpnt)    ((struct aha152x_scdata *) (SCpnt)->host_scribble)

Definition at line 620 of file aha152x.c.

#define SCNEXT (   SCpnt)    SCDATA(SCpnt)->next

Definition at line 621 of file aha152x.c.

#define SCSEM (   SCpnt)    SCDATA(SCpnt)->done

Definition at line 622 of file aha152x.c.

#define SG_ADDRESS (   buffer)    ((char *) sg_virt((buffer)))

Definition at line 624 of file aha152x.c.

#define SPRINTF (   args...)    pos += sprintf(pos, ## args)

Definition at line 3324 of file aha152x.c.

#define SPRINTF (   args...)    do { if(pos < buffer + length) pos += sprintf(pos, ## args); } while(0)

Definition at line 3324 of file aha152x.c.

#define STATE   (HOSTDATA(shpnt)->state)

Definition at line 588 of file aha152x.c.

#define SYNCHRONOUS   (HOSTDATA(shpnt)->synchronous)

Definition at line 615 of file aha152x.c.

#define SYNCNEG   (HOSTDATA(shpnt)->syncneg[CURRENT_SC->device->id])

Definition at line 608 of file aha152x.c.

#define SYNCRATE   (HOSTDATA(shpnt)->syncrate[CURRENT_SC->device->id])

Definition at line 607 of file aha152x.c.

#define TC1550   (HOSTDATA(shpnt)->tc1550)

Definition at line 612 of file aha152x.c.

#define WARN_LEAD   KERN_WARNING LEAD

Definition at line 316 of file aha152x.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
not_issued 
selecting 
identified 
disconnected 
completed 
aborted 
resetted 
spiordy 
syncneg 
aborting 
resetting 
check_condition 

Definition at line 346 of file aha152x.c.

Enumerator:
idle 
unknown 
seldo 
seldi 
selto 
busfree 
msgo 
cmd 
msgi 
status 
datai 
datao 
parerr 
rsti 
maxstate 

Definition at line 450 of file aha152x.c.

Function Documentation

__setup ( )
int aha152x_host_reset_host ( struct Scsi_Host shpnt)

Definition at line 1334 of file aha152x.c.

struct Scsi_Host* aha152x_probe_one ( struct aha152x_setup setup)
read

Definition at line 780 of file aha152x.c.

void aha152x_release ( struct Scsi_Host shpnt)

Definition at line 916 of file aha152x.c.

MODULE_AUTHOR ( "Jürgen Fischer"  )
MODULE_DESCRIPTION ( AHA152X_REVID  )
module_exit ( aha152x_exit  )
module_init ( aha152x_init  )
MODULE_LICENSE ( "GPL"  )

Variable Documentation

void(* end)(struct Scsi_Host *)

Definition at line 666 of file aha152x.c.

void(* init)(struct Scsi_Host *)

Definition at line 664 of file aha152x.c.

char* name

Definition at line 663 of file aha152x.c.

void(* run)(struct Scsi_Host *)

Definition at line 665 of file aha152x.c.

int spio

Definition at line 667 of file aha152x.c.