linux/drivers/scsi/ppa.c

/* ppa.c   --  low level driver for the IOMEGA PPA3 
 * parallel port SCSI host adapter.
 * 
 * (The PPA3 is the embedded controller in the ZIP drive.)
 * 
 * (c) 1995,1996 Grant R. Guenther, [email protected],
 * under the terms of the GNU General Public License.
 * 
 */

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/blkdev.h>
#include <linux/parport.h>
#include <linux/workqueue.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <asm/io.h>

#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>


static void ppa_reset_pulse(unsigned int base);

ppa_struct;

#include  "ppa.h"

static unsigned int mode =;
module_param(mode, uint, 0644);
MODULE_PARM_DESC();

static struct scsi_pointer *ppa_scsi_pointer(struct scsi_cmnd *cmd)
{}

static inline ppa_struct *ppa_dev(struct Scsi_Host *host)
{}

static DEFINE_SPINLOCK(arbitration_lock);

static void got_it(ppa_struct *dev)
{}

static void ppa_wakeup(void *ref)
{}

static int ppa_pb_claim(ppa_struct *dev)
{}

static void ppa_pb_dismiss(ppa_struct *dev)
{}

static inline void ppa_pb_release(ppa_struct *dev)
{}

/*
 * Start of Chipset kludges
 */

/* This is to give the ppa driver a way to modify the timings (and other
 * parameters) by writing to the /proc/scsi/ppa/0 file.
 * Very simple method really... (To simple, no error checking :( )
 * Reason: Kernel hackers HATE having to unload and reload modules for
 * testing...
 * Also gives a method to use a script to obtain optimum timings (TODO)
 */

static inline int ppa_write_info(struct Scsi_Host *host, char *buffer, int length)
{}

static int ppa_show_info(struct seq_file *m, struct Scsi_Host *host)
{}

static int device_check(ppa_struct *dev, bool autodetect);

#if PPA_DEBUG > 0
#define ppa_fail
static inline void ppa_fail_func(ppa_struct *dev, int error_code)
#else
static inline void ppa_fail(ppa_struct *dev, int error_code)
#endif
{}

/*
 * Wait for the high bit to be set.
 * 
 * In principle, this could be tied to an interrupt, but the adapter
 * doesn't appear to be designed to support interrupts.  We spin on
 * the 0x80 ready bit. 
 */
static unsigned char ppa_wait(ppa_struct *dev)
{}

/*
 * Clear EPP Timeout Bit 
 */
static inline void epp_reset(unsigned short ppb)
{}

/* 
 * Wait for empty ECP fifo (if we are in ECP fifo mode only)
 */
static inline void ecp_sync(ppa_struct *dev)
{}

static int ppa_byte_out(unsigned short base, const char *buffer, int len)
{}

static int ppa_byte_in(unsigned short base, char *buffer, int len)
{}

static int ppa_nibble_in(unsigned short base, char *buffer, int len)
{}

static int ppa_out(ppa_struct *dev, char *buffer, int len)
{}

static int ppa_in(ppa_struct *dev, char *buffer, int len)
{}

/* end of ppa_io.h */
static inline void ppa_d_pulse(unsigned short ppb, unsigned char b)
{}

static void ppa_disconnect(ppa_struct *dev)
{}

static inline void ppa_c_pulse(unsigned short ppb, unsigned char b)
{}

static inline void ppa_connect(ppa_struct *dev, int flag)
{}

static int ppa_select(ppa_struct *dev, int target)
{}

/* 
 * This is based on a trace of what the Iomega DOS 'guest' driver does.
 * I've tried several different kinds of parallel ports with guest and
 * coded this to react in the same ways that it does.
 * 
 * The return value from this function is just a hint about where the
 * handshaking failed.
 * 
 */
static int ppa_init(ppa_struct *dev)
{}

static inline int ppa_send_command(struct scsi_cmnd *cmd)
{}

/*
 * The bulk flag enables some optimisations in the data transfer loops,
 * it should be true for any command that transfers data in integral
 * numbers of sectors.
 * 
 * The driver appears to remain stable if we speed up the parallel port
 * i/o in this function, but not elsewhere.
 */
static int ppa_completion(struct scsi_cmnd *const cmd)
{}

/*
 * Since the PPA itself doesn't generate interrupts, we use
 * the scheduler's task queue to generate a stream of call-backs and
 * complete the request when the drive is ready.
 */
static void ppa_interrupt(struct work_struct *work)
{}

static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
{}

static int ppa_queuecommand_lck(struct scsi_cmnd *cmd)
{}

static DEF_SCSI_QCMD(ppa_queuecommand)

/*
 * Apparently the disk->capacity attribute is off by 1 sector 
 * for all disk drives.  We add the one here, but it should really
 * be done in sd.c.  Even if it gets fixed there, this will still
 * work.
 */
static int ppa_biosparam(struct scsi_device *sdev, struct block_device *dev,
	      sector_t capacity, int ip[])
{}

static int ppa_abort(struct scsi_cmnd *cmd)
{}

static void ppa_reset_pulse(unsigned int base)
{}

static int ppa_reset(struct scsi_cmnd *cmd)
{}

static int device_check(ppa_struct *dev, bool autodetect)
{}

static const struct scsi_host_template ppa_template =;

/***************************************************************************
 *                   Parallel port probing routines                        *
 ***************************************************************************/

static LIST_HEAD(ppa_hosts);

/*
 * Finds the first available device number that can be alloted to the
 * new ppa device and returns the address of the previous node so that
 * we can add to the tail and have a list in the ascending order.
 */

static inline ppa_struct *find_parent(void)
{}

static int __ppa_attach(struct parport *pb)
{}

static void ppa_attach(struct parport *pb)
{}

static void ppa_detach(struct parport *pb)
{}

static struct parport_driver ppa_driver =;
module_parport_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();