diff options
Diffstat (limited to 'drivers/scsi/aha152x.c')
| -rw-r--r-- | drivers/scsi/aha152x.c | 93 | 
1 files changed, 33 insertions, 60 deletions
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 8eab8587ff2..e86eb6a921f 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -239,7 +239,6 @@  #include <asm/irq.h>  #include <linux/io.h>  #include <linux/blkdev.h> -#include <asm/system.h>  #include <linux/completion.h>  #include <linux/errno.h>  #include <linux/string.h> @@ -421,11 +420,20 @@ MODULE_PARM_DESC(aha152x1, "parameters for second controller");  #endif /* MODULE */  #ifdef __ISAPNP__ -static struct isapnp_device_id id_table[] __devinitdata = { -	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, -		ISAPNP_VENDOR('A','D','P'), ISAPNP_FUNCTION(0x1505), 0 }, -	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, -		ISAPNP_VENDOR('A','D','P'), ISAPNP_FUNCTION(0x1530), 0 }, +static struct isapnp_device_id id_table[] = { +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1502), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1505), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1510), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1515), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1520), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x2015), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1522), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x2215), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1530), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x3015), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x1532), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x3215), 0 }, +	{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,	ISAPNP_VENDOR('A', 'D', 'P'), ISAPNP_FUNCTION(0x6360), 0 },  	{ ISAPNP_DEVICE_SINGLE_END, }  };  MODULE_DEVICE_TABLE(isapnp, id_table); @@ -849,7 +857,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)  	SETPORT(SIMODE0, 0);  	SETPORT(SIMODE1, 0); -	if( request_irq(shpnt->irq, swintr, IRQF_DISABLED|IRQF_SHARED, "aha152x", shpnt) ) { +	if (request_irq(shpnt->irq, swintr, IRQF_SHARED, "aha152x", shpnt)) {  		printk(KERN_ERR "aha152x%d: irq %d busy.\n", shpnt->host_no, shpnt->irq);  		goto out_host_put;  	} @@ -883,7 +891,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)  	SETPORT(SSTAT0, 0x7f);  	SETPORT(SSTAT1, 0xef); -	if ( request_irq(shpnt->irq, intr, IRQF_DISABLED|IRQF_SHARED, "aha152x", shpnt) ) { +	if (request_irq(shpnt->irq, intr, IRQF_SHARED, "aha152x", shpnt)) {  		printk(KERN_ERR "aha152x%d: failed to reassign irq %d.\n", shpnt->host_no, shpnt->irq);  		goto out_host_put;  	} @@ -1056,7 +1064,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,   *  queue a command   *   */ -static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) +static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))  {  #if 0  	if(*SCpnt->cmnd == REQUEST_SENSE) { @@ -1070,6 +1078,8 @@ static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))  	return aha152x_internal_queue(SCpnt, NULL, 0, done);  } +static DEF_SCSI_QCMD(aha152x_queue) +  /*   *   @@ -2967,15 +2977,14 @@ static void show_queues(struct Scsi_Host *shpnt)  }  #undef SPRINTF -#define SPRINTF(args...) pos += sprintf(pos, ## args) +#define SPRINTF(args...) seq_printf(m, ##args) -static int get_command(char *pos, Scsi_Cmnd * ptr) +static void get_command(struct seq_file *m, Scsi_Cmnd * ptr)  { -	char *start = pos;  	int i; -	SPRINTF("0x%08x: target=%d; lun=%d; cmnd=( ", -		(unsigned int) ptr, ptr->device->id, ptr->device->lun); +	SPRINTF("%p: target=%d; lun=%d; cmnd=( ", +		ptr, ptr->device->id, ptr->device->lun);  	for (i = 0; i < COMMAND_SIZE(ptr->cmnd[0]); i++)  		SPRINTF("0x%02x ", ptr->cmnd[i]); @@ -3001,13 +3010,10 @@ static int get_command(char *pos, Scsi_Cmnd * ptr)  	if (ptr->SCp.phase & syncneg)  		SPRINTF("syncneg|");  	SPRINTF("; next=0x%p\n", SCNEXT(ptr)); - -	return (pos - start);  } -static int get_ports(struct Scsi_Host *shpnt, char *pos) +static void get_ports(struct seq_file *m, struct Scsi_Host *shpnt)  { -	char *start = pos;  	int s;  	SPRINTF("\n%s: %s(%s) ", CURRENT_SC ? "on bus" : "waiting", states[STATE].name, states[PREVSTATE].name); @@ -3263,11 +3269,9 @@ static int get_ports(struct Scsi_Host *shpnt, char *pos)  	if (s & ENREQINIT)  		SPRINTF("ENREQINIT ");  	SPRINTF(")\n"); - -	return (pos - start);  } -static int aha152x_set_info(char *buffer, int length, struct Scsi_Host *shpnt) +static int aha152x_set_info(struct Scsi_Host *shpnt, char *buffer, int length)  {  	if(!shpnt || !buffer || length<8 || strncmp("aha152x ", buffer, 8)!=0)  		return -EINVAL; @@ -3310,26 +3314,11 @@ static int aha152x_set_info(char *buffer, int length, struct Scsi_Host *shpnt)  	return length;  } -#undef SPRINTF -#define SPRINTF(args...) \ -	do { if(pos < buffer + length) pos += sprintf(pos, ## args); } while(0) - -static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start, -		      off_t offset, int length, int inout) +static int aha152x_show_info(struct seq_file *m, struct Scsi_Host *shpnt)  {  	int i; -	char *pos = buffer;  	Scsi_Cmnd *ptr;  	unsigned long flags; -	int thislength; - -	DPRINTK(debug_procinfo,  -	       KERN_DEBUG "aha152x_proc_info: buffer=%p offset=%ld length=%d hostno=%d inout=%d\n", -	       buffer, offset, length, shpnt->host_no, inout); - - -	if (inout) -		return aha152x_set_info(buffer, length, shpnt);  	SPRINTF(AHA152X_REVID "\n"); @@ -3382,25 +3371,25 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start  	if (ISSUE_SC) {  		SPRINTF("not yet issued commands:\n");  		for (ptr = ISSUE_SC; ptr; ptr = SCNEXT(ptr)) -			pos += get_command(pos, ptr); +			get_command(m, ptr);  	} else  		SPRINTF("no not yet issued commands\n");  	DO_UNLOCK(flags);  	if (CURRENT_SC) {  		SPRINTF("current command:\n"); -		pos += get_command(pos, CURRENT_SC); +		get_command(m, CURRENT_SC);  	} else  		SPRINTF("no current command\n");  	if (DISCONNECTED_SC) {  		SPRINTF("disconnected commands:\n");  		for (ptr = DISCONNECTED_SC; ptr; ptr = SCNEXT(ptr)) -			pos += get_command(pos, ptr); +			get_command(m, ptr);  	} else  		SPRINTF("no disconnected commands\n"); -	pos += get_ports(shpnt, pos); +	get_ports(m, shpnt);  #if defined(AHA152X_STAT)  	SPRINTF("statistics:\n" @@ -3430,24 +3419,7 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start  			HOSTDATA(shpnt)->time[i]);  	}  #endif - -	DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: pos=%p\n", pos); - -	thislength = pos - (buffer + offset); -	DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: length=%d thislength=%d\n", length, thislength); - -	if(thislength<0) { -		DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: output too short\n"); -		*start = NULL; -		return 0; -	} - -	thislength = thislength<length ? thislength : length; - -	DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: return %d\n", thislength); - -	*start = buffer + offset; -	return thislength < length ? thislength : length; +	return 0;  }  static int aha152x_adjust_queue(struct scsi_device *device) @@ -3460,7 +3432,8 @@ static struct scsi_host_template aha152x_driver_template = {  	.module				= THIS_MODULE,  	.name				= AHA152X_REVID,  	.proc_name			= "aha152x", -	.proc_info			= aha152x_proc_info, +	.show_info			= aha152x_show_info, +	.write_info			= aha152x_set_info,  	.queuecommand			= aha152x_queue,  	.eh_abort_handler		= aha152x_abort,  	.eh_device_reset_handler	= aha152x_device_reset,  | 
