summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2000-07-22 15:10:14 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2000-07-22 15:10:14 +0000
commit7faed6cb69f311a5e29d2a08c7a4796252fe9551 (patch)
tree9cdea87bf03239ab009cda763b14831618d8b6d1 /sys/dev/ic
parent1f0bc482cca7da5eead49de80a033bc7149182bc (diff)
sync to NetBSD:
- remove #include <vm/vm_param.h> and #include <vm/pmap.h> as they are already included with #include <vm/vm.h> - more Adv -> Adw, ADV -> ADW adjustments & other minor formatting corrections plus: - put 'Carrier Ready failure!' warning message inside #ifdef ADW_DEBUG/#endif as it appears under heavy load but is nothing but a reminder the card was too busy to notice a 'tickle' from the driver.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/adw.c7
-rw-r--r--sys/dev/ic/adwlib.c18
-rw-r--r--sys/dev/ic/adwlib.h88
-rw-r--r--sys/dev/ic/adwmcode.c4
4 files changed, 57 insertions, 60 deletions
diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c
index d0a6fd54d6b..bad480391b4 100644
--- a/sys/dev/ic/adw.c
+++ b/sys/dev/ic/adw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adw.c,v 1.7 2000/06/29 00:04:31 krw Exp $ */
+/* $OpenBSD: adw.c,v 1.8 2000/07/22 15:10:13 krw Exp $ */
/* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */
/*
@@ -55,8 +55,6 @@
#include <machine/intr.h>
#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -1406,10 +1404,13 @@ adw_async_callback(sc, code)
sc->sc_dev.dv_xname);
break;
+#ifdef ADW_DEBUG
case ADV_ASYNC_CARRIER_READY_FAILURE:
/* Carrier Ready failure. */
+ /* Warning only - RISC too busy to realize it's been tickled */
printf("%s: Carrier Ready failure!\n", sc->sc_dev.dv_xname);
break;
+#endif
default:
break;
diff --git a/sys/dev/ic/adwlib.c b/sys/dev/ic/adwlib.c
index d55eb20c8d5..2dd1b78cc40 100644
--- a/sys/dev/ic/adwlib.c
+++ b/sys/dev/ic/adwlib.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: adwlib.c,v 1.9 2000/06/29 00:04:31 krw Exp $ */
-/* $NetBSD: adwlib.c,v 1.17 2000/05/27 18:24:50 dante Exp $ */
+/* $OpenBSD: adwlib.c,v 1.10 2000/07/22 15:10:13 krw Exp $ */
+/* $NetBSD: adwlib.c,v 1.20 2000/07/04 04:17:03 itojun Exp $ */
/*
* Low level routines for the Advanced Systems Inc. SCSI controllers chips
@@ -69,8 +69,6 @@
#include <dev/pci/pcidevs.h>
#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
#include <dev/ic/adwlib.h>
#include <dev/ic/adwmcode.h>
@@ -1803,7 +1801,7 @@ ADW_SCSI_REQ_Q *scsiq;
* Tickle the RISC to tell it to read its Command Queue Head
* pointer.
*/
- ADW_WRITE_BYTE_REGISTER(iot, ioh, IOPB_TICKLE, ADV_TICKLE_A);
+ ADW_WRITE_BYTE_REGISTER(iot, ioh, IOPB_TICKLE, ADW_TICKLE_A);
if (sc->chip_type == ADW_CHIP_ASC3550) {
/*
* Clear the tickle value. In the ASC-3550 the RISC flag
@@ -1811,7 +1809,7 @@ ADW_SCSI_REQ_Q *scsiq;
* value is cleared.
*/
ADW_WRITE_BYTE_REGISTER(iot, ioh, IOPB_TICKLE,
- ADV_TICKLE_NOP);
+ ADW_TICKLE_NOP);
}
} else if (sc->chip_type == ADW_CHIP_ASC38C1600) {
/*
@@ -2036,10 +2034,10 @@ ADW_SOFTC *sc;
if (intrb_code == ADV_ASYNC_CARRIER_READY_FAILURE &&
sc->carr_pending_cnt != 0) {
ADW_WRITE_BYTE_REGISTER(iot, ioh,
- IOPB_TICKLE, ADV_TICKLE_A);
+ IOPB_TICKLE, ADW_TICKLE_A);
if (sc->chip_type == ADW_CHIP_ASC3550) {
ADW_WRITE_BYTE_REGISTER(iot, ioh,
- IOPB_TICKLE, ADV_TICKLE_NOP);
+ IOPB_TICKLE, ADW_TICKLE_NOP);
}
}
}
@@ -2187,14 +2185,14 @@ u_int32_t idle_cmd_parameter;
/*
* Tickle the RISC to tell it to process the idle command.
*/
- ADW_WRITE_BYTE_REGISTER(iot, ioh, IOPB_TICKLE, ADV_TICKLE_B);
+ ADW_WRITE_BYTE_REGISTER(iot, ioh, IOPB_TICKLE, ADW_TICKLE_B);
if (sc->chip_type == ADW_CHIP_ASC3550) {
/*
* Clear the tickle value. In the ASC-3550 the RISC flag
* command 'clr_tickle_b' does not work unless the host
* value is cleared.
*/
- ADW_WRITE_BYTE_REGISTER(iot, ioh, IOPB_TICKLE, ADV_TICKLE_NOP);
+ ADW_WRITE_BYTE_REGISTER(iot, ioh, IOPB_TICKLE, ADW_TICKLE_NOP);
}
/* Wait for up to 100 millisecond for the idle command to timeout. */
diff --git a/sys/dev/ic/adwlib.h b/sys/dev/ic/adwlib.h
index 68d5205aba0..c75230dd4e7 100644
--- a/sys/dev/ic/adwlib.h
+++ b/sys/dev/ic/adwlib.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: adwlib.h,v 1.4 2000/06/29 00:04:31 krw Exp $ */
-/* $NetBSD: adwlib.h,v 1.13 2000/05/27 18:24:50 dante Exp $ */
+/* $OpenBSD: adwlib.h,v 1.5 2000/07/22 15:10:13 krw Exp $ */
+/* $NetBSD: adwlib.h,v 1.14 2000/07/03 18:14:18 dante Exp $ */
/*
* Definitions for low level routines and data structures
@@ -58,7 +58,7 @@
/*
- * --- Adv Library Constants and Macros
+ * --- Adw Library Constants and Macros
*/
#define ADW_LIB_VERSION_MAJOR 5
@@ -72,13 +72,13 @@
/*
- * Define Adv Reset Hold Time grater than 25 uSec.
+ * Define Adw Reset Hold Time grater than 25 uSec.
* See AdwResetSCSIBus() for more info.
*/
#define ASC_SCSI_RESET_HOLD_TIME_US 60
/*
- * Define Adv EEPROM constants.
+ * Define Adw EEPROM constants.
*/
#define ASC_EEP_DVC_CFG_BEGIN (0x00)
@@ -209,10 +209,10 @@ typedef struct adw_eeprom
u_int16_t check_sum; /* 21 EEP check sum */
u_int8_t oem_name[16]; /* 22 OEM name */
u_int16_t dvc_err_code; /* 30 last device driver error code */
- u_int16_t adv_err_code; /* 31 last uc and Adv Lib error code */
+ u_int16_t adv_err_code; /* 31 last uc and Adw Lib error code */
u_int16_t adv_err_addr; /* 32 last uc error address */
u_int16_t saved_dvc_err_code; /* 33 saved last dev. driver error code */
- u_int16_t saved_adv_err_code; /* 34 saved last uc and Adv Lib error code */
+ u_int16_t saved_adv_err_code; /* 34 saved last uc and Adw Lib error code */
u_int16_t saved_adv_err_addr; /* 35 saved last uc error address */
u_int16_t reserved1[20]; /* 36 - 55 reserved */
u_int16_t cisptr_lsw; /* 56 CIS PTR LSW */
@@ -425,10 +425,10 @@ typedef struct adw_eeprom
#define ADW_CTRL_REG_CMD_WR_PCI_CFG_SPACE 0x00C3
#define ADW_CTRL_REG_CMD_RD_PCI_CFG_SPACE 0x00C2
-#define ADV_TICKLE_NOP 0x00
-#define ADV_TICKLE_A 0x01
-#define ADV_TICKLE_B 0x02
-#define ADV_TICKLE_C 0x03
+#define ADW_TICKLE_NOP 0x00
+#define ADW_TICKLE_A 0x01
+#define ADW_TICKLE_B 0x02
+#define ADW_TICKLE_C 0x03
#define ADW_SCSI_CTRL_RSTOUT 0x2000
@@ -620,7 +620,7 @@ typedef struct adw_eeprom
/*
- * Adv Library Status Definitions
+ * Adw Library Status Definitions
*/
#define ADW_TRUE 1
#define ADW_FALSE 0
@@ -688,7 +688,7 @@ typedef struct adw_dvc_cfg {
u_int8_t chip_version; /* chip version */
u_int8_t termination; /* Term. Ctrl. bits 6-5 of SCSI_CFG1 */
u_int16_t pci_device_id; /* PCI device code number */
- u_int16_t lib_version; /* Adv Library version number */
+ u_int16_t lib_version; /* Adw Library version number */
u_int16_t control_flag; /* Microcode Control Flag */
u_int16_t mcode_date; /* Microcode date */
u_int16_t mcode_version; /* Microcode version */
@@ -757,7 +757,7 @@ typedef struct adw_softc {
LIST_HEAD(, scsi_xfer) sc_queue;
struct scsi_xfer *sc_queuelast;
- int sc_freeze_dev[ADW_MAX_TID + 1];
+ int sc_freeze_dev[ADW_MAX_TID+1];
ADW_CALLBACK isr_callback; /* pointer to function, called in AdwISR() */
ADW_CALLBACK async_callback; /* pointer to function, called in AdwISR() */
@@ -811,7 +811,7 @@ typedef struct adw_scsi_req_q {
u_int32_t data_cnt; /* Data count. Ucode sets to residual. */
u_int32_t sense_addr; /* Sense buffer physical address. */
u_int32_t carr_ba; /* Carrier p-address */
- u_int8_t mflag; /* Adv Library flag field. */
+ u_int8_t mflag; /* Adw Library flag field. */
u_int8_t sense_len; /* Auto-sense length. uCode sets to residual. */
u_int8_t cdb_len; /* SCSI CDB length. Must <= 16 bytes. */
u_int8_t scsi_cntl;
@@ -827,7 +827,7 @@ typedef struct adw_scsi_req_q {
u_int32_t carr_va; /* Carrier v-address (unused) */
/*
* End of microcode structure - 60 bytes. The rest of the structure
- * is used by the Adv Library and ignored by the microcode.
+ * is used by the Adw Library and ignored by the microcode.
*/
struct scsi_sense_data *vsense_addr; /* Sense buffer virtual address. */
u_char *vdata_addr; /* Data buffer virtual address. */
@@ -945,43 +945,43 @@ typedef struct adw_scsi_req_q {
bus_space_write_4((iot), (ioh), (reg_off), (dword))
/* Read byte from LRAM. */
-#define ADW_READ_BYTE_LRAM(iot, ioh, addr, byte) \
-do { \
- bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
- (byte) = bus_space_read_1((iot), (ioh), IOPB_RAM_DATA); \
+#define ADW_READ_BYTE_LRAM(iot, ioh, addr, byte) \
+do { \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
+ (byte) = bus_space_read_1((iot), (ioh), IOPB_RAM_DATA); \
} while (0)
/* Write byte to LRAM. */
-#define ADW_WRITE_BYTE_LRAM(iot, ioh, addr, byte) \
-do { \
- bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
- bus_space_write_1((iot), (ioh), IOPB_RAM_DATA, (byte)); \
+#define ADW_WRITE_BYTE_LRAM(iot, ioh, addr, byte) \
+do { \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
+ bus_space_write_1((iot), (ioh), IOPB_RAM_DATA, (byte)); \
} while (0)
/* Read word (2 bytes) from LRAM. */
-#define ADW_READ_WORD_LRAM(iot, ioh, addr, word) \
-do { \
- bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
- (word) = bus_space_read_2((iot), (ioh), IOPW_RAM_DATA); \
+#define ADW_READ_WORD_LRAM(iot, ioh, addr, word) \
+do { \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
+ (word) = bus_space_read_2((iot), (ioh), IOPW_RAM_DATA); \
} while (0)
/* Write word (2 bytes) to LRAM. */
-#define ADW_WRITE_WORD_LRAM(iot, ioh, addr, word) \
-do { \
- bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
- bus_space_write_2((iot), (ioh), IOPW_RAM_DATA, (word)); \
+#define ADW_WRITE_WORD_LRAM(iot, ioh, addr, word) \
+do { \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_DATA, (word)); \
} while (0)
/* Write double word (4 bytes) to LRAM */
/* Because of unspecified C language ordering don't use auto-increment. */
-#define ADW_WRITE_DWORD_LRAM(iot, ioh, addr, dword) \
-do { \
- bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
- bus_space_write_2((iot), (ioh), IOPW_RAM_DATA, \
- (ushort) ((dword) & 0xFFFF)); \
- bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr) + 2); \
- bus_space_write_2((iot), (ioh), IOPW_RAM_DATA, \
- (ushort) ((dword >> 16) & 0xFFFF)); \
+#define ADW_WRITE_DWORD_LRAM(iot, ioh, addr, dword) \
+do { \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr)); \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_DATA, \
+ (u_int16_t) ((dword) & 0xFFFF)); \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_ADDR, (addr) + 2); \
+ bus_space_write_2((iot), (ioh), IOPW_RAM_DATA, \
+ (u_int16_t) ((dword >> 16) & 0xFFFF)); \
} while (0)
/* Read word (2 bytes) from LRAM assuming that the address is already set. */
@@ -998,9 +998,9 @@ do { \
* Evaluate to ADW_TRUE if a Condor chip is found the specified port
* address 'iop_base'. Otherwise evalue to ADW_FALSE.
*/
-#define ADW_FIND_SIGNATURE(iot, ioh) \
- (((ADW_READ_BYTE_REGISTER((iot), (ioh), IOPB_CHIP_ID_1) == \
- ADW_CHIP_ID_BYTE) && \
+#define ADW_FIND_SIGNATURE(iot, ioh) \
+ (((ADW_READ_BYTE_REGISTER((iot), (ioh), IOPB_CHIP_ID_1) == \
+ ADW_CHIP_ID_BYTE) && \
(ADW_READ_WORD_REGISTER((iot), (ioh), IOPW_CHIP_ID_0) == \
ADW_CHIP_ID_WORD)) ? ADW_TRUE : ADW_FALSE)
@@ -1047,7 +1047,7 @@ do { \
#define ADW_SCSI_BIT_ID_TYPE u_int16_t
/*
- * AdvInitScsiTarget() 'cntl_flag' options.
+ * AdwInitScsiTarget() 'cntl_flag' options.
*/
#define ADW_SCAN_LUN 0x01
#define ADW_CAPINFO_NOLUN 0x02
diff --git a/sys/dev/ic/adwmcode.c b/sys/dev/ic/adwmcode.c
index 25e5f580fb3..96b5052d155 100644
--- a/sys/dev/ic/adwmcode.c
+++ b/sys/dev/ic/adwmcode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adwmcode.c,v 1.4 2000/06/29 00:04:32 krw Exp $ */
+/* $OpenBSD: adwmcode.c,v 1.5 2000/07/22 15:10:13 krw Exp $ */
/* $NetBSD: adwmcode.c,v 1.5 2000/05/27 18:24:50 dante Exp $ */
/*
@@ -71,8 +71,6 @@
#include <machine/intr.h>
#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
#include "adwmcode.h"