summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2002-12-30 06:54:01 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-12-30 06:54:01 -0800
commit214fd2320f43b49efa5de18d85bc72c48f99e531 (patch)
tree4562d7c4ea963e7eed2d048e935c039a14cf1ad6 /drivers
parent0907edc26127c0720549b2f45fb9b43dbad74595 (diff)
parent92bde82bb5351a8633f0c7a5e9d6b9c88f111556 (diff)
Merge bk://linuxusb.bkbits.net/linus-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/i2c-adap-ite.c6
-rw-r--r--drivers/i2c/i2c-philips-par.c16
-rw-r--r--drivers/i2c/i2c-proc.c10
-rw-r--r--drivers/scsi/Makefile1
-rw-r--r--drivers/scsi/aic7xxx/Kconfig.aic79xx16
-rw-r--r--drivers/scsi/aic7xxx/Kconfig.aic7xxx4
-rw-r--r--drivers/scsi/aic7xxx/aic7770_osm.c9
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_core.c9
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c75
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.h12
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm_pci.c8
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_core.c7
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c84
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.h12
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm_pci.c5
-rw-r--r--drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c4
-rw-r--r--drivers/scsi/aic7xxx/aiclib.c12
-rw-r--r--drivers/scsi/aic7xxx/aiclib.h4
18 files changed, 192 insertions, 102 deletions
diff --git a/drivers/i2c/i2c-adap-ite.c b/drivers/i2c/i2c-adap-ite.c
index 2c7b5103806c..28352ac46df6 100644
--- a/drivers/i2c/i2c-adap-ite.c
+++ b/drivers/i2c/i2c-adap-ite.c
@@ -61,11 +61,7 @@ static int own = 0;
static int i2c_debug=0;
static struct iic_ite gpi;
-#if (LINUX_VERSION_CODE < 0x020301)
-static struct wait_queue *iic_wait = NULL;
-#else
static wait_queue_head_t iic_wait;
-#endif
static int iic_pending;
/* ----- global defines ----------------------------------------------- */
@@ -236,9 +232,7 @@ static int __init iic_ite_init(void)
piic->iic_own = own;
iic_ite_data.data = (void *)piic;
-#if (LINUX_VERSION_CODE >= 0x020301)
init_waitqueue_head(&iic_wait);
-#endif
if (iic_hw_resrc_init() == 0) {
if (i2c_iic_add_bus(&iic_ite_ops) < 0)
return -ENODEV;
diff --git a/drivers/i2c/i2c-philips-par.c b/drivers/i2c/i2c-philips-par.c
index ce2258a20447..b489b5f37114 100644
--- a/drivers/i2c/i2c-philips-par.c
+++ b/drivers/i2c/i2c-philips-par.c
@@ -228,41 +228,25 @@ static void i2c_parport_detach (struct parport *port)
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
static struct parport_driver i2c_driver = {
"i2c-philips-par",
i2c_parport_attach,
i2c_parport_detach,
NULL
};
-#endif
int __init i2c_bitlp_init(void)
{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,4)
- struct parport *port;
-#endif
printk(KERN_INFO "i2c-philips-par.o: i2c Philips parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_register_driver(&i2c_driver);
-#else
- for (port = parport_enumerate(); port; port=port->next)
- i2c_parport_attach(port);
-#endif
return 0;
}
void __exit i2c_bitlp_exit(void)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_unregister_driver(&i2c_driver);
-#else
- struct parport *port;
- for (port = parport_enumerate(); port; port=port->next)
- i2c_parport_detach(port);
-#endif
}
MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
diff --git a/drivers/i2c/i2c-proc.c b/drivers/i2c/i2c-proc.c
index 785e9c5f3716..3b97e96de669 100644
--- a/drivers/i2c/i2c-proc.c
+++ b/drivers/i2c/i2c-proc.c
@@ -23,7 +23,6 @@
This driver puts entries in /proc/sys/dev/sensors for each I2C device
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
@@ -31,14 +30,10 @@
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/ioport.h>
-#include <asm/uaccess.h>
#include <linux/i2c.h>
#include <linux/i2c-proc.h>
#include <linux/init.h>
-
-#ifndef THIS_MODULE
-#define THIS_MODULE NULL
-#endif
+#include <asm/uaccess.h>
static int i2c_create_name(char **name, const char *prefix,
struct i2c_adapter *adapter, int addr);
@@ -56,7 +51,6 @@ static int i2c_sysctl_chips(ctl_table * table, int *name, int nlen,
#define SENSORS_ENTRY_MAX 20
static struct ctl_table_header *i2c_entries[SENSORS_ENTRY_MAX];
-static unsigned short i2c_inodes[SENSORS_ENTRY_MAX];
static struct i2c_client *i2c_clients[SENSORS_ENTRY_MAX];
@@ -197,8 +191,6 @@ int i2c_register_entry(struct i2c_client *client, const char *prefix,
return id;
}
#endif /* DEBUG */
- i2c_inodes[id - 256] =
- new_header->ctl_table->child->child->de->low_ino;
new_header->ctl_table->child->child->de->owner = controlling_mod;
return id;
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index ddfd46f701fc..18eefd83915e 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -58,6 +58,7 @@ obj-$(CONFIG_SCSI_AHA152X) += aha152x.o
obj-$(CONFIG_SCSI_AHA1542) += aha1542.o
obj-$(CONFIG_SCSI_AHA1740) += aha1740.o
obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx/
+obj-$(CONFIG_SCSI_AIC79XX) += aic7xxx/
obj-$(CONFIG_SCSI_AACRAID) += aacraid/
obj-$(CONFIG_SCSI_AIC7XXX_OLD) += aic7xxx_old.o
obj-$(CONFIG_SCSI_IPS) += ips.o
diff --git a/drivers/scsi/aic7xxx/Kconfig.aic79xx b/drivers/scsi/aic7xxx/Kconfig.aic79xx
index 0b6c04b23581..70b49a9ba691 100644
--- a/drivers/scsi/aic7xxx/Kconfig.aic79xx
+++ b/drivers/scsi/aic7xxx/Kconfig.aic79xx
@@ -1,6 +1,6 @@
#
# AIC79XX 2.5.X Kernel configuration File.
-# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic79xx#2 $
+# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic79xx#3 $
#
config SCSI_AIC79XX
tristate "Adaptec AIC79xx U320 support"
@@ -76,20 +76,20 @@ config AIC79XX_DEBUG_ENABLE
driver errors.
config AIC79XX_DEBUG_MASK
- int "Debug code enable mask (16383 for all debugging)"
- depends on SCSI_AIC79XX
- default "0"
- help
+ int "Debug code enable mask (16383 for all debugging)"
+ depends on SCSI_AIC79XX
+ default "0"
+ help
Bit mask of debug options that is only valid if the
CONFIG_AIC79XX_DEBUG_ENBLE option is enabled. The bits in this mask
are defined in the drivers/scsi/aic7xxx/aic79xx.h - search for the
variable ahd_debug in that file to find them.
config AIC79XX_REG_PRETTY_PRINT
- bool "Decode registers during diagnostics"
- depends on SCSI_AIC79XX && SCSI_AIC7XXX_BUILD_FIRMWARE
+ bool "Decode registers during diagnostics"
+ depends on SCSI_AIC79XX
default y
- help
+ help
Compile in register value tables for the output of expanded register
contents in diagnostics. This make it much easier to understand debug
output without having to refer to a data book and/or the aic7xxx.reg
diff --git a/drivers/scsi/aic7xxx/Kconfig.aic7xxx b/drivers/scsi/aic7xxx/Kconfig.aic7xxx
index 9d9a9e4b02c7..869922fd34af 100644
--- a/drivers/scsi/aic7xxx/Kconfig.aic7xxx
+++ b/drivers/scsi/aic7xxx/Kconfig.aic7xxx
@@ -1,6 +1,6 @@
#
# AIC7XXX and AIC79XX 2.5.X Kernel configuration File.
-# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic7xxx#4 $
+# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic7xxx#5 $
#
config SCSI_AIC7XXX
tristate "Adaptec AIC7xxx Fast -> U160 support (New Driver)"
@@ -92,7 +92,7 @@ config AIC7XXX_DEBUG_MASK
config AIC7XXX_REG_PRETTY_PRINT
bool "Decode registers during diagnostics"
- depends on SCSI_AIC7XXX && SCSI_AIC7XXX_BUILD_FIRMWARE
+ depends on SCSI_AIC7XXX
default y
help
Compile in register value tables for the output of expanded register
diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c
index 80d25528e95c..0646072850b9 100644
--- a/drivers/scsi/aic7xxx/aic7770_osm.c
+++ b/drivers/scsi/aic7xxx/aic7770_osm.c
@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_osm.c#11 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_osm.c#12 $
*/
#include "aic7xxx_osm.h"
@@ -61,8 +61,14 @@ aic7770_linux_probe(Scsi_Host_Template *template)
uint32_t eisa_id;
size_t id_size;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
if (check_region(eisaBase, AHC_EISA_IOSIZE) != 0)
continue;
+ request_region(eisaBase, AHC_EISA_IOSIZE, "aic7xxx");
+#else
+ if (request_region(eisaBase, AHC_EISA_IOSIZE, "aic7xxx") != 0)
+ continue;
+#endif
eisa_id = 0;
id_size = sizeof(eisa_id);
@@ -72,6 +78,7 @@ aic7770_linux_probe(Scsi_Host_Template *template)
eisa_id |= inb(eisaBase + IDOFFSET + i)
<< ((id_size-i-1) * 8);
}
+ release_region(eisaBase, AHC_EISA_IOSIZE);
if (eisa_id & 0x80000000)
continue; /* no EISA card in slot */
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 5c0951af77c6..a288ed9f9b3e 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#147 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#148 $
*
* $FreeBSD$
*/
@@ -3416,8 +3416,10 @@ reswitch:
*/
if (ahd->msgout_len != 0) {
#ifdef AHD_DEBUG
- if ((ahd_debug & AHD_SHOW_MESSAGES) != 0)
+ if ((ahd_debug & AHD_SHOW_MESSAGES) != 0) {
+ ahd_print_devinfo(ahd, &devinfo);
printf("Asserting ATN for response\n");
+ }
#endif
ahd_assert_atn(ahd);
}
@@ -7521,8 +7523,7 @@ ahd_stat_timer(void *arg)
"now %sabled. Cmds %d\n",
ahd_name(ahd),
(enint_coal & ENINT_COALESS) ? "en" : "dis",
- ahd->cmdcmplt_total,
- ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket]);
+ ahd->cmdcmplt_total);
#endif
}
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 8fb69cd8f90f..02a7612a7efd 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -1,7 +1,7 @@
/*
* Adaptec AIC79xx device driver for Linux.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#100 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#103 $
*
* --------------------------------------------------------------------------
* Copyright (c) 1994-2000 Justin T. Gibbs.
@@ -1339,7 +1339,7 @@ Scsi_Host_Template aic79xx_driver_template = {
*/
.max_sectors = 8192,
#endif
-#if defined CONFIG_HIGHIO
+#if defined CONFIG_HIGHIO || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
/* Assume RedHat Distribution with its different HIGHIO conventions. */
.can_dma_32 = 1,
@@ -2486,8 +2486,25 @@ ahd_linux_dv_thread(void *data)
printf("In DV Thread\n");
#endif
+ /*
+ * Don't care about any signals.
+ */
+ siginitsetinv(&current->blocked, 0);
+
+ /*
+ * Complete thread creation.
+ */
+ lock_kernel();
+ daemonize();
+ sprintf(current->comm, "ahd_dv_%d", ahd->unit);
+ unlock_kernel();
+
while (1) {
- down(&ahd->platform_data->dv_sem);
+ /*
+ * Use down_interruptible() rather than down() to
+ * avoid inclusion in the load average.
+ */
+ down_interruptible(&ahd->platform_data->dv_sem);
/* Check to see if we've been signaled to exit */
ahd_lock(ahd, &s);
@@ -2510,7 +2527,7 @@ ahd_linux_dv_thread(void *data)
while (LIST_FIRST(&ahd->pending_scbs) != NULL) {
ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_EMPTY;
ahd_unlock(ahd, &s);
- down(&ahd->platform_data->dv_sem);
+ down_interruptible(&ahd->platform_data->dv_sem);
ahd_lock(ahd, &s);
}
@@ -2521,7 +2538,7 @@ ahd_linux_dv_thread(void *data)
while (AHD_DV_SIMQ_FROZEN(ahd) == 0) {
ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_RELEASE;
ahd_unlock(ahd, &s);
- down(&ahd->platform_data->dv_sem);
+ down_interruptible(&ahd->platform_data->dv_sem);
ahd_lock(ahd, &s);
}
ahd_unlock(ahd, &s);
@@ -2623,6 +2640,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
AHD_TRANS_GOAL, /*paused*/FALSE);
ahd_unlock(ahd, &s);
timeout = 10 * HZ;
+ targ->flags &= ~AHD_INQ_VALID;
/* FALLTHROUGH */
case AHD_DV_STATE_INQ_VERIFY:
{
@@ -2686,7 +2704,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
ahd_unlock(ahd, &s);
#endif
- down(&ahd->platform_data->dv_cmd_sem);
+ down_interruptible(&ahd->platform_data->dv_cmd_sem);
/*
* Wait for the SIMQ to be released so that DV is the
* only reason the queue is frozen.
@@ -2695,7 +2713,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
while (AHD_DV_SIMQ_FROZEN(ahd) == 0) {
ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_RELEASE;
ahd_unlock(ahd, &s);
- down(&ahd->platform_data->dv_sem);
+ down_interruptible(&ahd->platform_data->dv_sem);
ahd_lock(ahd, &s);
}
ahd_unlock(ahd, &s);
@@ -2704,6 +2722,25 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
}
out:
+ if ((targ->flags & AHD_INQ_VALID) != 0
+ && ahd_linux_get_device(ahd, devinfo.channel - 'A',
+ devinfo.target, devinfo.lun,
+ /*alloc*/FALSE) == NULL) {
+ /*
+ * The DV state machine failed to configure this device.
+ * This is normal if DV is disabled. Since we have inquiry
+ * data, filter it and use the "optimistic" negotiation
+ * parameters found in the inquiry string.
+ */
+ ahd_linux_filter_inquiry(ahd, &devinfo);
+ if ((targ->flags & (AHD_BASIC_DV|AHD_ENHANCED_DV)) != 0) {
+ ahd_print_devinfo(ahd, &devinfo);
+ printf("DV failed to configure device. "
+ "Please file a bug report against "
+ "this driver.\n");
+ }
+ }
+
if (cmd != NULL)
free(cmd, M_DEVBUF);
@@ -2789,24 +2826,21 @@ ahd_linux_dv_transition(struct ahd_softc *ahd, struct scsi_cmnd *cmd,
break;
}
- if (ahd_linux_user_dv_setting(ahd) == 0) {
- ahd_linux_filter_inquiry(ahd, devinfo);
- AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_EXIT);
+ AHD_SET_DV_STATE(ahd, targ, targ->dv_state+1);
+ targ->flags |= AHD_INQ_VALID;
+ if (ahd_linux_user_dv_setting(ahd) == 0)
break;
- }
spi3data = targ->inq_data->spi3data;
switch (spi3data & SID_SPI_CLOCK_DT_ST) {
default:
case SID_SPI_CLOCK_ST:
/* Assume only basic DV is supported. */
- ahd_linux_filter_inquiry(ahd, devinfo);
- AHD_SET_DV_STATE(ahd, targ,
- AHD_DV_STATE_INQ_VERIFY);
+ targ->flags |= AHD_BASIC_DV;
break;
case SID_SPI_CLOCK_DT:
case SID_SPI_CLOCK_DT_ST:
- AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_REBD);
+ targ->flags |= AHD_ENHANCED_DV;
break;
}
break;
@@ -2902,8 +2936,15 @@ ahd_linux_dv_transition(struct ahd_softc *ahd, struct scsi_cmnd *cmd,
case AHD_DV_STATE_TUR:
switch (status & SS_MASK) {
case SS_NOP:
- AHD_SET_DV_STATE(ahd, targ,
- AHD_DV_STATE_INQ_ASYNC);
+ if ((targ->flags & AHD_BASIC_DV) != 0) {
+ ahd_linux_filter_inquiry(ahd, devinfo);
+ AHD_SET_DV_STATE(ahd, targ,
+ AHD_DV_STATE_INQ_VERIFY);
+ } else if ((targ->flags & AHD_ENHANCED_DV) != 0) {
+ AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_REBD);
+ } else {
+ AHD_SET_DV_STATE(ahd, targ, AHD_DV_STATE_EXIT);
+ }
break;
case SS_RETRY:
case SS_TUR:
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index 46d34b111c53..a3377dcc6f50 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#96 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#99 $
*
*/
#ifndef _AIC79XX_LINUX_H_
@@ -48,6 +48,7 @@
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/pci.h>
+#include <linux/smp_lock.h>
#include <linux/version.h>
#ifndef AHD_MODVERSION_FILE
#define __NO_VERSION__
@@ -287,7 +288,7 @@ ahd_scb_timer_reset(struct scb *scb, u_int usec)
#include <linux/smp.h>
#endif
-#define AIC79XX_DRIVER_VERSION "1.3.0.ALPHA5"
+#define AIC79XX_DRIVER_VERSION "1.3.0.ALPHA6"
/**************************** Front End Queues ********************************/
/*
@@ -424,16 +425,19 @@ struct ahd_linux_device {
};
typedef enum {
- AHD_DV_REQUIRED = 0x01
+ AHD_DV_REQUIRED = 0x01,
+ AHD_INQ_VALID = 0x02,
+ AHD_BASIC_DV = 0x04,
+ AHD_ENHANCED_DV = 0x08
} ahd_linux_targ_flags;
/* DV States */
typedef enum {
AHD_DV_STATE_EXIT = 0,
AHD_DV_STATE_INQ_SHORT_ASYNC,
- AHD_DV_STATE_TUR,
AHD_DV_STATE_INQ_ASYNC,
AHD_DV_STATE_INQ_ASYNC_VERIFY,
+ AHD_DV_STATE_TUR,
AHD_DV_STATE_REBD,
AHD_DV_STATE_INQ_VERIFY,
AHD_DV_STATE_WEB,
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
index fe598eba390d..115fcbf89e65 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#18 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#19 $
*/
#include "aic79xx_osm.h"
@@ -240,10 +240,8 @@ ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, u_long *base,
if (check_region(*base, 256) != 0
|| check_region(*base2, 256) != 0)
return (ENOMEM);
- else {
- request_region(*base, 256, "aic79xx");
- request_region(*base2, 256, "aic79xx");
- }
+ request_region(*base, 256, "aic79xx");
+ request_region(*base2, 256, "aic79xx");
#else
if (request_region(*base, 256, "aic79xx") == 0)
return (ENOMEM);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index d67bed4e6795..a69c1194203e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#104 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#105 $
*
* $FreeBSD$
*/
@@ -2772,9 +2772,12 @@ reswitch:
*/
if (ahc->msgout_len != 0) {
#ifdef AHC_DEBUG
- if ((ahc_debug & AHC_SHOW_MESSAGES) != 0)
+ if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) {
+ ahc_print_devinfo(ahc, &devinfo);
printf("Asserting ATN for response\n");
+ }
#endif
+ ahc_assert_atn(ahc);
}
} else
ahc->msgin_index++;
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 69f6593b6072..e8e2a4e91527 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -1,7 +1,7 @@
/*
* Adaptec AIC7xxx device driver for Linux.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#163 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#166 $
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
@@ -2336,8 +2336,25 @@ ahc_linux_dv_thread(void *data)
printf("Launching DV Thread\n");
#endif
+ /*
+ * Don't care about any signals.
+ */
+ siginitsetinv(&current->blocked, 0);
+
+ /*
+ * Complete thread creation.
+ */
+ lock_kernel();
+ daemonize();
+ sprintf(current->comm, "ahc_dv_%d", ahc->unit);
+ unlock_kernel();
+
while (1) {
- down(&ahc->platform_data->dv_sem);
+ /*
+ * Use down_interruptible() rather than down() to
+ * avoid inclusion in the load average.
+ */
+ down_interruptible(&ahc->platform_data->dv_sem);
/* Check to see if we've been signaled to exit */
ahc_lock(ahc, &s);
@@ -2360,7 +2377,7 @@ ahc_linux_dv_thread(void *data)
while (LIST_FIRST(&ahc->pending_scbs) != NULL) {
ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_EMPTY;
ahc_unlock(ahc, &s);
- down(&ahc->platform_data->dv_sem);
+ down_interruptible(&ahc->platform_data->dv_sem);
ahc_lock(ahc, &s);
}
@@ -2371,7 +2388,7 @@ ahc_linux_dv_thread(void *data)
while (AHC_DV_SIMQ_FROZEN(ahc) == 0) {
ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_RELEASE;
ahc_unlock(ahc, &s);
- down(&ahc->platform_data->dv_sem);
+ down_interruptible(&ahc->platform_data->dv_sem);
ahc_lock(ahc, &s);
}
ahc_unlock(ahc, &s);
@@ -2473,6 +2490,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
AHC_TRANS_GOAL, /*paused*/FALSE);
ahc_unlock(ahc, &s);
timeout = 10 * HZ;
+ targ->flags &= ~AHC_INQ_VALID;
/* FALLTHROUGH */
case AHC_DV_STATE_INQ_VERIFY:
{
@@ -2536,7 +2554,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
ahc_unlock(ahc, &s);
#endif
- down(&ahc->platform_data->dv_cmd_sem);
+ down_interruptible(&ahc->platform_data->dv_cmd_sem);
/*
* Wait for the SIMQ to be released so that DV is the
* only reason the queue is frozen.
@@ -2545,7 +2563,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
while (AHC_DV_SIMQ_FROZEN(ahc) == 0) {
ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_RELEASE;
ahc_unlock(ahc, &s);
- down(&ahc->platform_data->dv_sem);
+ down_interruptible(&ahc->platform_data->dv_sem);
ahc_lock(ahc, &s);
}
ahc_unlock(ahc, &s);
@@ -2554,6 +2572,25 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
}
out:
+ if ((targ->flags & AHC_INQ_VALID) != 0
+ && ahc_linux_get_device(ahc, devinfo.channel - 'A',
+ devinfo.target, devinfo.lun,
+ /*alloc*/FALSE) == NULL) {
+ /*
+ * The DV state machine failed to configure this device.
+ * This is normal if DV is disabled. Since we have inquiry
+ * data, filter it and use the "optimistic" negotiation
+ * parameters found in the inquiry string.
+ */
+ ahc_linux_filter_inquiry(ahc, &devinfo);
+ if ((targ->flags & (AHC_BASIC_DV|AHC_ENHANCED_DV)) != 0) {
+ ahc_print_devinfo(ahc, &devinfo);
+ printf("DV failed to configure device. "
+ "Please file a bug report against "
+ "this driver.\n");
+ }
+ }
+
if (cmd != NULL)
free(cmd, M_DEVBUF);
@@ -2639,24 +2676,21 @@ ahc_linux_dv_transition(struct ahc_softc *ahc, struct scsi_cmnd *cmd,
break;
}
- if (ahc_linux_user_dv_setting(ahc) == 0) {
- ahc_linux_filter_inquiry(ahc, devinfo);
- AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_EXIT);
+ AHC_SET_DV_STATE(ahc, targ, targ->dv_state+1);
+ targ->flags |= AHC_INQ_VALID;
+ if (ahc_linux_user_dv_setting(ahc) == 0)
break;
- }
spi3data = targ->inq_data->spi3data;
switch (spi3data & SID_SPI_CLOCK_DT_ST) {
default:
case SID_SPI_CLOCK_ST:
/* Assume only basic DV is supported. */
- ahc_linux_filter_inquiry(ahc, devinfo);
- AHC_SET_DV_STATE(ahc, targ,
- AHC_DV_STATE_INQ_VERIFY);
+ targ->flags |= AHC_BASIC_DV;
break;
case SID_SPI_CLOCK_DT:
case SID_SPI_CLOCK_DT_ST:
- AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_REBD);
+ targ->flags |= AHC_ENHANCED_DV;
break;
}
break;
@@ -2752,8 +2786,15 @@ ahc_linux_dv_transition(struct ahc_softc *ahc, struct scsi_cmnd *cmd,
case AHC_DV_STATE_TUR:
switch (status & SS_MASK) {
case SS_NOP:
- AHC_SET_DV_STATE(ahc, targ,
- AHC_DV_STATE_INQ_ASYNC);
+ if ((targ->flags & AHC_BASIC_DV) != 0) {
+ ahc_linux_filter_inquiry(ahc, devinfo);
+ AHC_SET_DV_STATE(ahc, targ,
+ AHC_DV_STATE_INQ_VERIFY);
+ } else if ((targ->flags & AHC_ENHANCED_DV) != 0) {
+ AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_REBD);
+ } else {
+ AHC_SET_DV_STATE(ahc, targ, AHC_DV_STATE_EXIT);
+ }
break;
case SS_RETRY:
case SS_TUR:
@@ -4373,6 +4414,17 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
memset(&cmd->sense_buffer[sense_size], 0,
sizeof(cmd->sense_buffer) - sense_size);
cmd->result |= (DRIVER_SENSE << 24);
+#ifdef AHC_DEBUG
+ if (ahc_debug & AHC_SHOW_SENSE) {
+ int i;
+
+ printf("Copied %d bytes of sense data:",
+ sense_size);
+ for (i = 0; i < sense_size; i++)
+ printf(" 0x%x", cmd->sense_buffer[i]);
+ printf("\n");
+ }
+#endif
}
break;
}
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 65ff6384a9a4..3e8f383baf9d 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -53,7 +53,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#111 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#114 $
*
*/
#ifndef _AIC7XXX_LINUX_H_
@@ -65,6 +65,7 @@
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/pci.h>
+#include <linux/smp_lock.h>
#include <linux/version.h>
#ifndef AHC_MODVERSION_FILE
#define __NO_VERSION__
@@ -300,7 +301,7 @@ ahc_scb_timer_reset(struct scb *scb, u_int usec)
#include <linux/smp.h>
#endif
-#define AIC7XXX_DRIVER_VERSION "6.2.24"
+#define AIC7XXX_DRIVER_VERSION "6.2.25"
/**************************** Front End Queues ********************************/
/*
@@ -437,16 +438,19 @@ struct ahc_linux_device {
};
typedef enum {
- AHC_DV_REQUIRED = 0x01
+ AHC_DV_REQUIRED = 0x01,
+ AHC_INQ_VALID = 0x02,
+ AHC_BASIC_DV = 0x04,
+ AHC_ENHANCED_DV = 0x08
} ahc_linux_targ_flags;
/* DV States */
typedef enum {
AHC_DV_STATE_EXIT = 0,
AHC_DV_STATE_INQ_SHORT_ASYNC,
- AHC_DV_STATE_TUR,
AHC_DV_STATE_INQ_ASYNC,
AHC_DV_STATE_INQ_ASYNC_VERIFY,
+ AHC_DV_STATE_TUR,
AHC_DV_STATE_REBD,
AHC_DV_STATE_INQ_VERIFY,
AHC_DV_STATE_WEB,
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index 05b12228dc10..fcc865041b62 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#41 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#42 $
*/
#include "aic7xxx_osm.h"
@@ -232,8 +232,7 @@ ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
if (check_region(*base, 256) != 0)
return (ENOMEM);
- else
- request_region(*base, 256, "aic7xxx");
+ request_region(*base, 256, "aic7xxx");
#else
if (request_region(*base, 256, "aic7xxx") == 0)
return (ENOMEM);
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
index 2e766b85c1aa..f1f448dff569 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#23 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#24 $
*
* $FreeBSD$
*/
@@ -546,7 +546,7 @@ symtable_dump(FILE *ofile, FILE *dfile)
if (num_entries == 0)
aic_print_reg_dump_start(dfile,
curnode);
- else
+ else if (dfile != NULL)
fputs(",\n", dfile);
num_entries++;
aic_print_reg_dump_entry(dfile, fieldnode);
diff --git a/drivers/scsi/aic7xxx/aiclib.c b/drivers/scsi/aic7xxx/aiclib.c
index 50270d5483fd..8b9929c58927 100644
--- a/drivers/scsi/aic7xxx/aiclib.c
+++ b/drivers/scsi/aic7xxx/aiclib.c
@@ -541,12 +541,18 @@ static struct asc_table_entry asc_table[] = {
"Rounded parameter") },
/* DTL WRSOMCAE */{SST(0x39, 0x00, SS_RDEF,
"Saving parameters not supported") },
-/* DTL WRSOM */{SST(0x3A, 0x00, SS_FATAL|ENXIO,
+/* DTL WRSOM */{SST(0x3A, 0x00, SS_NOP,
"Medium not present") },
-/* DT WR OM */{SST(0x3A, 0x01, SS_FATAL|ENXIO,
+/* DT WR OM */{SST(0x3A, 0x01, SS_NOP,
"Medium not present - tray closed") },
-/* DT WR OM */{SST(0x3A, 0x02, SS_FATAL|ENXIO,
+/* DT WR OM */{SST(0x3A, 0x01, SS_NOP,
"Medium not present - tray open") },
+/* DT WR OM */{SST(0x3A, 0x03, SS_NOP,
+ "Medium not present - Loadable") },
+/* DT WR OM */{SST(0x3A, 0x04, SS_NOP,
+ "Medium not present - medium auxiliary "
+ "memory accessible") },
+/* DT WR OM */{SST(0x3A, 0xFF, SS_NOP, NULL) },/* Range 0x05->0xFF */
/* TL */{SST(0x3B, 0x00, SS_RDEF,
"Sequential positioning error") },
/* T */{SST(0x3B, 0x01, SS_RDEF,
diff --git a/drivers/scsi/aic7xxx/aiclib.h b/drivers/scsi/aic7xxx/aiclib.h
index c13774fedac2..a06167a85fa7 100644
--- a/drivers/scsi/aic7xxx/aiclib.h
+++ b/drivers/scsi/aic7xxx/aiclib.h
@@ -827,12 +827,16 @@ extern const char *scsi_sense_key_text[];
/************************* Large Disk Handling ********************************/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+static __inline int aic_sector_div(u_long capacity, int heads, int sectors);
+
static __inline int
aic_sector_div(u_long capacity, int heads, int sectors)
{
return (capacity / (heads * sectors));
}
#else
+static __inline int aic_sector_div(sector_t capacity, int heads, int sectors);
+
static __inline int
aic_sector_div(sector_t capacity, int heads, int sectors)
{