X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2Faic7xxx_old.c;h=770f1647e4d6796fde8f6b81cf1c2bc6fe80a1a7;hb=0aafd42982cc422558751c9e9e1327000694584a;hp=ba414d73d6f146ea60e17bdd1be8bcf2436e134d;hpb=5167311cae6aa3a5ff5afd39f88c32a435c969ef;p=linux-2.6.git diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index ba414d73d..770f1647e 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c @@ -224,7 +224,6 @@ #include #include #include -#include #include #include #include @@ -1291,7 +1290,7 @@ static void aic7xxx_check_scbs(struct aic7xxx_host *p, char *buffer); * ***************************************************************************/ -static inline unsigned char +static unsigned char aic_inb(struct aic7xxx_host *p, long port) { #ifdef MMAPIO @@ -1310,7 +1309,7 @@ aic_inb(struct aic7xxx_host *p, long port) #endif } -static inline void +static void aic_outb(struct aic7xxx_host *p, unsigned char val, long port) { #ifdef MMAPIO @@ -1838,7 +1837,7 @@ aic7xxx_print_sequencer(struct aic7xxx_host *p, int downloaded) * Description: * Return a string describing the driver. *-F*************************************************************************/ -const char * +static const char * aic7xxx_info(struct Scsi_Host *dooh) { static char buffer[256]; @@ -2701,12 +2700,12 @@ aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb) struct scatterlist *sg; sg = (struct scatterlist *)cmd->request_buffer; - pci_unmap_sg(p->pdev, sg, cmd->use_sg, scsi_to_pci_dma_dir(cmd->sc_data_direction)); + pci_unmap_sg(p->pdev, sg, cmd->use_sg, cmd->sc_data_direction); } else if (cmd->request_bufflen) pci_unmap_single(p->pdev, aic7xxx_mapping(cmd), cmd->request_bufflen, - scsi_to_pci_dma_dir(cmd->sc_data_direction)); + cmd->sc_data_direction); if (scb->flags & SCB_SENSE) { pci_unmap_single(p->pdev, @@ -6515,7 +6514,7 @@ do_aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs) static void aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev) { - Scsi_Device *sdpnt = aic_dev->SDptr; + struct scsi_device *sdpnt = aic_dev->SDptr; unsigned char tindex; tindex = sdpnt->id | (sdpnt->channel << 3); @@ -6582,7 +6581,7 @@ aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev) * Set up the initial aic_dev struct pointers *-F*************************************************************************/ static int -aic7xxx_slave_alloc(Scsi_Device *SDptr) +aic7xxx_slave_alloc(struct scsi_device *SDptr) { struct aic7xxx_host *p = (struct aic7xxx_host *)SDptr->host->hostdata; struct aic_dev_data *aic_dev; @@ -6645,7 +6644,7 @@ aic7xxx_slave_alloc(Scsi_Device *SDptr) * queueing to be [en|dis]abled for a specific adapter. *-F*************************************************************************/ static void -aic7xxx_device_queue_depth(struct aic7xxx_host *p, Scsi_Device *device) +aic7xxx_device_queue_depth(struct aic7xxx_host *p, struct scsi_device *device) { int tag_enabled = FALSE; struct aic_dev_data *aic_dev = device->hostdata; @@ -6735,7 +6734,7 @@ aic7xxx_device_queue_depth(struct aic7xxx_host *p, Scsi_Device *device) * prepare for this device to go away *-F*************************************************************************/ static void -aic7xxx_slave_destroy(Scsi_Device *SDptr) +aic7xxx_slave_destroy(struct scsi_device *SDptr) { struct aic_dev_data *aic_dev = SDptr->hostdata; @@ -6755,7 +6754,7 @@ aic7xxx_slave_destroy(Scsi_Device *SDptr) * depths, allocate command structs, etc. *-F*************************************************************************/ static int -aic7xxx_slave_configure(Scsi_Device *SDptr) +aic7xxx_slave_configure(struct scsi_device *SDptr) { struct aic7xxx_host *p = (struct aic7xxx_host *) SDptr->host->hostdata; struct aic_dev_data *aic_dev; @@ -7866,7 +7865,7 @@ detect_maxscb(struct aic7xxx_host *p) * Register a Adaptec aic7xxx chip SCSI controller with the kernel. *-F*************************************************************************/ static int -aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p, +aic7xxx_register(struct scsi_host_template *template, struct aic7xxx_host *p, int reset_delay) { int i, result; @@ -8413,7 +8412,7 @@ aic7xxx_chip_reset(struct aic7xxx_host *p) * and a pointer to a aic7xxx_host struct upon success. *-F*************************************************************************/ static struct aic7xxx_host * -aic7xxx_alloc(Scsi_Host_Template *sht, struct aic7xxx_host *temp) +aic7xxx_alloc(struct scsi_host_template *sht, struct aic7xxx_host *temp) { struct aic7xxx_host *p = NULL; struct Scsi_Host *host; @@ -8449,7 +8448,6 @@ aic7xxx_alloc(Scsi_Host_Template *sht, struct aic7xxx_host *temp) } p->host_no = host->host_no; } - scsi_set_device(host, &p->pdev->dev); return (p); } @@ -8494,8 +8492,7 @@ aic7xxx_free(struct aic7xxx_host *p) - scb_dma->dma_offset), scb_dma->dma_address); } - if (p->scb_data->scb_array[i]->kmalloc_ptr != NULL) - kfree(p->scb_data->scb_array[i]->kmalloc_ptr); + kfree(p->scb_data->scb_array[i]->kmalloc_ptr); p->scb_data->scb_array[i] = NULL; } @@ -8994,7 +8991,7 @@ aic7xxx_configure_bugs(struct aic7xxx_host *p) * mid-level SCSI code is overhauled. *-F*************************************************************************/ static int -aic7xxx_detect(Scsi_Host_Template *template) +aic7xxx_detect(struct scsi_host_template *template) { struct aic7xxx_host *temp_p = NULL; struct aic7xxx_host *current_p = NULL; @@ -10229,7 +10226,7 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd, sg = (struct scatterlist *)cmd->request_buffer; scb->sg_length = 0; - use_sg = pci_map_sg(p->pdev, sg, cmd->use_sg, scsi_to_pci_dma_dir(cmd->sc_data_direction)); + use_sg = pci_map_sg(p->pdev, sg, cmd->use_sg, cmd->sc_data_direction); /* * Copy the segments into the SG array. NOTE!!! - We used to * have the first entry both in the data_pointer area and the first @@ -10257,7 +10254,7 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd, { unsigned int address = pci_map_single(p->pdev, cmd->request_buffer, cmd->request_bufflen, - scsi_to_pci_dma_dir(cmd->sc_data_direction)); + cmd->sc_data_direction); aic7xxx_mapping(cmd) = address; scb->sg_list[0].address = cpu_to_le32(address); scb->sg_list[0].length = cpu_to_le32(cmd->request_bufflen); @@ -10359,7 +10356,7 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *)) * Returns an enumerated type that indicates the status of the operation. *-F*************************************************************************/ static int -aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) +__aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) { struct aic7xxx_host *p; struct aic7xxx_scb *scb; @@ -10552,6 +10549,18 @@ aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) return SUCCESS; } +static int +aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) +{ + int rc; + + spin_lock_irq(cmd->device->host->host_lock); + rc = __aic7xxx_bus_device_reset(cmd); + spin_unlock_irq(cmd->device->host->host_lock); + + return rc; +} + /*+F************************************************************************* * Function: @@ -10564,8 +10573,7 @@ static void aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd) { - printk("aic7xxx driver version %s/%s\n", AIC7XXX_C_VERSION, - UTS_RELEASE); + printk("aic7xxx driver version %s\n", AIC7XXX_C_VERSION); printk("Controller type:\n %s\n", board_names[p->board_name_index]); printk("p->flags=0x%lx, p->chip=0x%x, p->features=0x%x, " "sequencer %s paused\n", @@ -10587,7 +10595,7 @@ aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd) * Abort the current SCSI command(s). *-F*************************************************************************/ static int -aic7xxx_abort(Scsi_Cmnd *cmd) +__aic7xxx_abort(Scsi_Cmnd *cmd) { struct aic7xxx_scb *scb = NULL; struct aic7xxx_host *p; @@ -10804,6 +10812,19 @@ success: return SUCCESS; } +static int +aic7xxx_abort(Scsi_Cmnd *cmd) +{ + int rc; + + spin_lock_irq(cmd->device->host->host_lock); + rc = __aic7xxx_abort(cmd); + spin_unlock_irq(cmd->device->host->host_lock); + + return rc; +} + + /*+F************************************************************************* * Function: * aic7xxx_reset @@ -10822,6 +10843,8 @@ aic7xxx_reset(Scsi_Cmnd *cmd) struct aic_dev_data *aic_dev; p = (struct aic7xxx_host *) cmd->device->host->hostdata; + spin_lock_irq(p->host->host_lock); + aic_dev = AIC_DEV(cmd); if(aic7xxx_position(cmd) < p->scb_data->numscbs) { @@ -10861,6 +10884,7 @@ aic7xxx_reset(Scsi_Cmnd *cmd) * longer have it. */ unpause_sequencer(p, FALSE); + spin_unlock_irq(p->host->host_lock); return SUCCESS; } @@ -10884,7 +10908,6 @@ aic7xxx_reset(Scsi_Cmnd *cmd) unpause_sequencer(p, FALSE); spin_unlock_irq(p->host->host_lock); ssleep(2); - spin_lock_irq(p->host->host_lock); return SUCCESS; } @@ -11138,7 +11161,7 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_VERSION(AIC7XXX_H_VERSION); -static Scsi_Host_Template driver_template = { +static struct scsi_host_template driver_template = { .proc_info = aic7xxx_proc_info, .detect = aic7xxx_detect, .release = aic7xxx_release,