summaryrefslogtreecommitdiff
path: root/sys/i386/isa/bs/bsvar.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/isa/bs/bsvar.h')
-rw-r--r--sys/i386/isa/bs/bsvar.h97
1 files changed, 46 insertions, 51 deletions
diff --git a/sys/i386/isa/bs/bsvar.h b/sys/i386/isa/bs/bsvar.h
index 9eea57a6065a8..9167c2d156183 100644
--- a/sys/i386/isa/bs/bsvar.h
+++ b/sys/i386/isa/bs/bsvar.h
@@ -92,7 +92,7 @@
* PARAMETER
**************************************************/
#define NTARGETS 8
-#define RETRIES 0 /* number of retries before giving up */
+#define RETRIES 4 /* number of retries before giving up */
#define HARDRETRIES 3
#define XSMAX 4
#define BSDMABUFSIZ 0x10000
@@ -240,7 +240,7 @@ struct sc_p {
#define BSERRORBITS "\020\014busy\013abnormal\012retry\011msgerr\010fatal\007seltimeout\006sense\005timeout\004statuserr\003parity\002cmderr\001dmaerr"
-/* bsccb bsccb_flags & targ_info flags & cmd flags*/
+/* ccb & targ_info flags & cmd flags*/
#define BSREAD 0x0001
#define BSSAT 0x0002
#define BSLINK 0x0004
@@ -258,14 +258,14 @@ struct sc_p {
#define BSCFLAGSMASK (0xffff)
-struct bsccb {
- TAILQ_ENTRY(bsccb) ccb_chain;
+struct ccb {
+ TAILQ_ENTRY(ccb) ccb_chain;
- union ccb *ccb; /* upper drivers info */
+ struct scsi_xfer *xs; /* upper drivers info */
u_int lun; /* lun */
- u_int bsccb_flags; /* control flags */
+ u_int flags; /* control flags */
int rcnt; /* retry counter of this ccb */
@@ -290,75 +290,75 @@ struct bsccb {
int tcmax;
};
-GENERIC_CCB_ASSERT(bs, bsccb)
+GENERIC_CCB_ASSERT(bs, ccb)
/* target info */
struct targ_info {
-/*0*/ TAILQ_ENTRY(targ_info) ti_tchain; /* targ_info link */
+ TAILQ_ENTRY(targ_info) ti_tchain; /* targ_info link */
-/*4*/ TAILQ_ENTRY(targ_info) ti_wchain; /* wait link */
+ TAILQ_ENTRY(targ_info) ti_wchain; /* wait link */
-/*8*/ struct bs_softc *ti_bsc; /* our controller */
-/*c*/ u_int ti_id; /* scsi id */
-/*10*/ u_int ti_lun; /* current lun */
+ struct bs_softc *ti_bsc; /* our controller */
+ u_int ti_id; /* scsi id */
+ u_int ti_lun; /* current lun */
-/*14*/ struct bsccbtab ti_ctab, ti_bctab; /* ccb */
+ struct ccbtab ti_ctab, ti_bctab; /* ccb */
#define BS_TARG_NULL 0
#define BS_TARG_CTRL 1
#define BS_TARG_START 2
#define BS_TARG_SYNCH 3
#define BS_TARG_RDY 4
-/*24*/ int ti_state; /* target state */
+ int ti_state; /* target state */
-/*28*/ u_int ti_cfgflags; /* target cfg flags */
+ u_int ti_cfgflags; /* target cfg flags */
-/*2c*/ u_int ti_flags; /* flags */
-/*30*/ u_int ti_mflags; /* flags masks */
+ u_int ti_flags; /* flags */
+ u_int ti_mflags; /* flags masks */
-/*34*/ u_int ti_error; /* error flags */
-/*38*/ u_int ti_herrcnt; /* hardware err retry counter */
+ u_int ti_error; /* error flags */
+ u_int ti_herrcnt; /* hardware err retry counter */
/*****************************************
* scsi phase data
*****************************************/
-/*3c*/ struct sc_p ti_scsp; /* saved scsi data pointer */
+ struct sc_p ti_scsp; /* saved scsi data pointer */
-/*50*/ enum scsi_phase ti_phase; /* scsi phase */
-/*54*/ enum scsi_phase ti_ophase; /* previous scsi phase */
+ enum scsi_phase ti_phase; /* scsi phase */
+ enum scsi_phase ti_ophase; /* previous scsi phase */
-/*58*/ u_int8_t ti_status; /* status in */
+ u_int8_t ti_status; /* status in */
-/*59*/ u_int8_t ti_msgin[MAXMSGLEN]; /* msgin buffer */
-/*64*/ int ti_msginptr;
+ u_int8_t ti_msgin[MAXMSGLEN]; /* msgin buffer */
+ int ti_msginptr;
-/*68*/ u_int8_t ti_msgout; /* last msgout byte */
-/*69*/ u_int8_t ti_emsgout; /* last msgout byte */
-/*6c*/ u_int ti_omsgoutlen; /* for retry msgout */
+ u_int8_t ti_msgout; /* last msgout byte */
+ u_int8_t ti_emsgout; /* last msgout byte */
+ u_int ti_omsgoutlen; /* for retry msgout */
-/*70*/ struct syncdata ti_syncmax; /* synch data (scsi) */
-/*72*/ struct syncdata ti_syncnow;
-/*74*/ u_int8_t ti_sync; /* synch val (chip) */
+ struct syncdata ti_syncmax; /* synch data (scsi) */
+ struct syncdata ti_syncnow;
+ u_int8_t ti_sync; /* synch val (chip) */
/*****************************************
* bounce buffer & smit data pointer
*****************************************/
-/*75*/ u_int8_t *bounce_phys;
-/*76*/ u_int8_t *bounce_addr;
-/*78*/ u_int bounce_size;
+ u_int8_t *bounce_phys;
+ u_int8_t *bounce_addr;
+ u_int bounce_size;
-/*7c*/ u_long sm_offset;
+ u_long sm_offset;
/*****************************************
* target inq data
*****************************************/
-/*79*/ u_int8_t targ_type;
-/*7a*/ u_int8_t targ_support;
+ u_int8_t targ_type;
+ u_int8_t targ_support;
/*****************************************
* generic scsi cmd buffer for this target
*****************************************/
-/*7b*/ u_int8_t scsi_cmd[12];
+ u_int8_t scsi_cmd[12];
struct scsi_sense_data sense;
};
@@ -371,6 +371,8 @@ struct bs_softc {
*****************************************/
OS_DEPEND_DEVICE_HEADER
+ OS_DEPEND_SCSI_HEADER
+
OS_DEPEND_MISC_HEADER
/*****************************************
@@ -431,7 +433,7 @@ struct bs_softc {
u_int sc_wc; /* weight count */
int sc_poll;
- struct bsccb *sc_outccb;
+ struct ccb *sc_outccb;
/*****************************************
* wd33c93 chip depend section
@@ -460,12 +462,6 @@ struct bs_softc {
*****************************************/
#define BS_DVNAME_LEN 16
u_char sc_dvname[BS_DVNAME_LEN];
-
- /*****************************************
- * CAM support
- *****************************************/
- struct cam_sim *sim;
- struct cam_path *path;
};
/*************************************************
@@ -500,10 +496,10 @@ extern int bs_debug_flag;
/*************************************************
* Function declare
*************************************************/
-int bs_scsi_cmd_internal __P((struct bsccb *, u_int));
-struct bsccb *bscmddone __P((struct targ_info *));
+int bs_scsi_cmd_internal __P((struct ccb *, u_int));
+struct ccb *bscmddone __P((struct targ_info *));
int bscmdstart __P((struct targ_info *, int));
-int bs_scsi_cmd_poll __P((struct targ_info *, struct bsccb *));
+int bs_scsi_cmd_poll __P((struct targ_info *, struct ccb *));
int bs_sequencer __P((struct bs_softc *));
void bs_poll_timeout __P((struct bs_softc *, char *));
@@ -511,9 +507,8 @@ void bs_poll_timeout __P((struct bs_softc *, char *));
* XXX
*************************************************/
/* misc error */
-#define COMPLETE 2
-#define NOTARGET (-2)
-#define HASERROR (-1)
+#define NOTARGET -2
+#define HASERROR -1
/* XXX: use scsi_message.h */
/* status */