summaryrefslogtreecommitdiff
path: root/sys/dev/ic/aic7xxx.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ic/aic7xxx.h')
-rw-r--r--sys/dev/ic/aic7xxx.h80
1 files changed, 69 insertions, 11 deletions
diff --git a/sys/dev/ic/aic7xxx.h b/sys/dev/ic/aic7xxx.h
index 7a0a4c423fb..5527c1f4d3a 100644
--- a/sys/dev/ic/aic7xxx.h
+++ b/sys/dev/ic/aic7xxx.h
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: aic7xxx.h,v 1.8 2003/10/21 18:58:48 jmc Exp $
+ * $OpenBSD: aic7xxx.h,v 1.9 2003/12/24 22:45:45 krw Exp $
* Core definitions and data structures shareable across OS platforms.
*
* Copyright (c) 1994-2001 Justin T. Gibbs.
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.h,v 1.8 2003/10/21 18:58:48 jmc Exp $
+ * $Id: aic7xxx.h,v 1.9 2003/12/24 22:45:45 krw Exp $
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.h,v 1.40 2001/07/18 21:39:47 gibbs Exp $
*/
@@ -38,11 +38,14 @@
#define _AIC7XXX_H_
/* Register Definitions */
-#include "aic7xxxreg.h"
+#include "dev/microcode/aic7xxx/aic7xxx_reg.h"
+
+#include "dev/ic/aic7xxx_cam.h"
/************************* Forward Declarations *******************************/
struct ahc_platform_data;
struct scb_platform_data;
+struct seeprom_descriptor;
/****************************** Useful Macros *********************************/
#ifndef MAX
@@ -89,6 +92,14 @@ struct scb_platform_data;
(SCB_GET_TARGET(ahc, scb) + (SCB_IS_SCSIBUS_B(ahc, scb) ? 8 : 0))
#define SCB_GET_TARGET_MASK(ahc, scb) \
(0x01 << (SCB_GET_TARGET_OFFSET(ahc, scb)))
+#ifdef AHC_DEBUG
+#define SCB_IS_SILENT(scb) \
+ ((ahc_debug & AHC_SHOW_MASKED_ERRORS) == 0 \
+ && (((scb)->flags & SCB_SILENT) != 0))
+#else
+#define SCB_IS_SILENT(scb) \
+ (((scb)->flags & SCB_SILENT) != 0)
+#endif
#define TCL_TARGET_OFFSET(tcl) \
((((tcl) >> 4) & TID) >> 4)
#define TCL_LUN(tcl) \
@@ -337,7 +348,11 @@ typedef enum {
AHC_ALL_INTERRUPTS = 0x100000,
AHC_PAGESCBS = 0x400000, /* Enable SCB paging */
AHC_EDGE_INTERRUPT = 0x800000, /* Device uses edge triggered ints */
- AHC_39BIT_ADDRESSING = 0x1000000 /* Use 39 bit addressing scheme. */
+ AHC_39BIT_ADDRESSING = 0x1000000, /* Use 39 bit addressing scheme. */
+ AHC_LSCBS_ENABLED = 0x2000000, /* 64Byte SCBs enabled */
+ AHC_SCB_CONFIG_USED = 0x4000000, /* No SEEPROM but SCB2 had info. */
+ AHC_NO_BIOS_INIT = 0x8000000, /* No BIOS left over settings. */
+ AHC_DISABLE_PCI_PERR = 0x10000000
} ahc_flag;
/************************* Hardware SCB Definition ***************************/
@@ -499,6 +514,14 @@ struct sg_map_node {
#endif
};
+struct ahc_pci_busdata {
+ pci_chipset_tag_t pc;
+ pcitag_t tag;
+ u_int dev;
+ u_int func;
+ pcireg_t class;
+};
+
/*
* The current state of this SCB.
*/
@@ -521,7 +544,24 @@ typedef enum {
SCB_ABORT = 0x1000,
SCB_UNTAGGEDQ = 0x2000,
SCB_ACTIVE = 0x4000,
- SCB_TARGET_IMMEDIATE = 0x8000
+ SCB_TARGET_IMMEDIATE = 0x8000,
+ SCB_TRANSMISSION_ERROR = 0x1000,/*
+ * We detected a parity or CRC
+ * error that has effected the
+ * payload of the command. This
+ * flag is checked when normal
+ * status is returned to catch
+ * the case of a target not
+ * responding to our attempt
+ * to report the error.
+ */
+ SCB_TARGET_SCB = 0x2000,
+ SCB_SILENT = 0x4000 /*
+ * Be quiet about transmission type
+ * errors. They are expected and we
+ * don't want to upset the user. This
+ * flag is typically used during DV.
+ */
} scb_flag;
struct scb {
@@ -557,7 +597,6 @@ struct scb_data {
/*
* "Bus" addresses of our data structures.
*/
- bus_dma_tag_t hscb_dmat; /* dmat for our hardware SCB array */
bus_dmamap_t hscb_dmamap;
bus_addr_t hscb_busaddr;
#ifdef __OpenBSD__
@@ -573,7 +612,6 @@ struct scb_data {
int sense_nseg;
int sense_size;
#endif
- bus_dma_tag_t sg_dmat; /* dmat for our sg segments */
SLIST_HEAD(, sg_map_node) sg_maps;
uint8_t numscbs;
uint8_t maxhscbs; /* Number of SCBs on the card */
@@ -707,6 +745,10 @@ struct ahc_syncrate {
*/
extern struct ahc_syncrate ahc_syncrates[];
+/* Safe and valid period for async negotiations. */
+#define AHC_ASYNC_XFER_PERIOD 0x45
+#define AHC_ULTRA2_XFER_PERIOD 0x0a
+
/*
* Indexes into our table of synchronous transfer rates.
*/
@@ -934,6 +976,8 @@ struct ahc_softc {
ahc_bug bugs;
ahc_flag flags;
+ struct seeprom_config *seep_config;
+
/* Values to store in the SEQCTL register for pause and unpause */
uint8_t unpause;
uint8_t pause;
@@ -986,7 +1030,6 @@ struct ahc_softc {
* between the sequencer and kernel.
*/
bus_dma_tag_t parent_dmat;
- bus_dma_tag_t shared_data_dmat;
bus_dmamap_t shared_data_dmamap;
bus_addr_t shared_data_busaddr;
@@ -1020,6 +1063,8 @@ struct ahc_softc {
uint16_t user_discenable;/* Disconnection allowed */
uint16_t user_tagenable;/* Tagged Queuing allowed */
+
+ struct ahc_pci_busdata *bd;
};
TAILQ_HEAD(ahc_softc_tailq, ahc_softc);
@@ -1078,7 +1123,7 @@ void ahc_busy_tcl(struct ahc_softc *ahc,
u_int tcl, u_int busyid);
/***************************** PCI Front End *********************************/
-struct ahc_pci_identity *ahc_find_pci_device(ahc_dev_softc_t);
+const struct ahc_pci_identity *ahc_find_pci_device(pcireg_t, pcireg_t, u_int);
int ahc_pci_config(struct ahc_softc *,
struct ahc_pci_identity *);
@@ -1109,6 +1154,7 @@ void ahc_pause_and_flushwork(struct ahc_softc *ahc);
int ahc_suspend(struct ahc_softc *ahc);
int ahc_resume(struct ahc_softc *ahc);
void ahc_softc_insert(struct ahc_softc *);
+struct ahc_softc *ahc_find_softc(struct ahc_softc *);
void ahc_set_unit(struct ahc_softc *, int);
void ahc_set_name(struct ahc_softc *, char *);
void ahc_alloc_scbs(struct ahc_softc *ahc);
@@ -1139,6 +1185,9 @@ int ahc_search_qinfifo(struct ahc_softc *ahc, int target,
char channel, int lun, u_int tag,
role_t role, uint32_t status,
ahc_search_action action);
+int ahc_search_untagged_queues(struct ahc_softc *,
+ struct scsi_xfer *, int, char, int, uint32_t,
+ ahc_search_action);
int ahc_search_disc_list(struct ahc_softc *ahc, int target,
char channel, int lun, u_int tag,
int stop_on_first, int remove,
@@ -1147,7 +1196,7 @@ void ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb);
int ahc_reset_channel(struct ahc_softc *ahc, char channel,
int initiate_reset);
void ahc_restart(struct ahc_softc *ahc);
-void ahc_calc_residual(struct scb *scb);
+void ahc_calc_residual(struct ahc_softc *ahc, struct scb *scb);
/*************************** Utility Functions ********************************/
struct ahc_phase_table_entry*
ahc_lookup_phase_entry(int phase);
@@ -1209,7 +1258,16 @@ cam_status ahc_find_tmode_devs(struct ahc_softc *ahc,
#endif
#endif
/******************************* Debug ***************************************/
+void ahc_print_devinfo(struct ahc_softc *,
+ struct ahc_devinfo *);
void ahc_print_scb(struct scb *scb);
void ahc_dump_card_state(struct ahc_softc *ahc);
+int ahc_print_register(ahc_reg_parse_entry_t *, u_int,
+ const char *, u_int, u_int, u_int *, u_int);
+/******************************* SEEPROM *************************************/
+int ahc_acquire_seeprom(struct ahc_softc *,
+ struct seeprom_descriptor *);
+void ahc_release_seeprom(struct seeprom_descriptor *);
+
+void ahc_check_extport(struct ahc_softc *, u_int *);
#endif /* _AIC7XXX_H_ */
-