aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mpt
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>2006-06-05 22:25:49 +0000
committerMatt Jacob <mjacob@FreeBSD.org>2006-06-05 22:25:49 +0000
commitfcd9a16b1fd81fb759e34c3ca6231c47734d9f54 (patch)
tree44fc43b4fe9116aec43c70e4556ba1cee946c4fb /sys/dev/mpt
parentc1c3139ed3182003f5f89d0289e6f7ade25ea166 (diff)
downloadsrc-fcd9a16b1fd81fb759e34c3ca6231c47734d9f54.tar.gz
src-fcd9a16b1fd81fb759e34c3ca6231c47734d9f54.zip
Do some source && comment cleanup.
Clean out the abortive start to homegrown, per-mpt, Domain Validation. This should really be done at a higher level. Use the PIM_SEQSCAN flag for U320- this seems to correct cases of being unable to consistently negotiate U320 in the cases where I'd seen this before. Between this and other recent checkins, this driver is pretty close to being ready for MFC. Reviewed by: scottl, ken, scsi@ MFC after: 1 week
Notes
Notes: svn path=/head/; revision=159312
Diffstat (limited to 'sys/dev/mpt')
-rw-r--r--sys/dev/mpt/mpt.h13
-rw-r--r--sys/dev/mpt/mpt_cam.c36
2 files changed, 14 insertions, 35 deletions
diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h
index 70cdb45d7342..21ef5d8bfcc9 100644
--- a/sys/dev/mpt/mpt.h
+++ b/sys/dev/mpt/mpt.h
@@ -305,7 +305,7 @@ struct req_entry {
void *sense_vbuf; /* Virtual Address of sense data */
bus_addr_t req_pbuf; /* Physical Address of Entry */
bus_addr_t sense_pbuf; /* Physical Address of sense data */
- bus_dmamap_t dmap; /* DMA map for data buffer */
+ bus_dmamap_t dmap; /* DMA map for data buffers */
struct req_entry *chain; /* for SGE overallocations */
};
@@ -541,10 +541,6 @@ struct mpt_softc {
CONFIG_PAGE_SCSI_DEVICE_1 _dev_page1[16];
uint16_t _tag_enable;
uint16_t _disc_enable;
- struct {
- uint8_t inqdata[39];
- uint8_t state;
- } _dv[16];
} spi;
#define mpt_port_page0 cfg.spi._port_page0
#define mpt_port_page1 cfg.spi._port_page1
@@ -553,10 +549,6 @@ struct mpt_softc {
#define mpt_dev_page1 cfg.spi._dev_page1
#define mpt_tag_enable cfg.spi._tag_enable
#define mpt_disc_enable cfg.spi._disc_enable
-#define mpt_dv cfg.spi._dv
-# define DV_STATE_0 0
-# define DV_STATE_1 1
-# define DV_STATE_DONE 0xff
struct mpi_fc_cfg {
CONFIG_PAGE_FC_PORT_0 _port_page0;
#define mpt_fcport_page0 cfg.fc._port_page0
@@ -643,6 +635,7 @@ struct mpt_softc {
* Deferred frame acks due to resource shortage.
*/
struct mpt_evtf_list ack_frames;
+
/*
* Target Mode Support
*/
@@ -666,7 +659,7 @@ struct mpt_softc {
uint16_t pad3;
- /* Opposing port in a 929 or 1030, or NULL */
+ /* Paired port in some dual adapters configurations */
struct mpt_softc * mpt2;
/* FW Image management */
diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c
index b23ae4234437..5e2f3ba18c9c 100644
--- a/sys/dev/mpt/mpt_cam.c
+++ b/sys/dev/mpt/mpt_cam.c
@@ -117,6 +117,7 @@ static void mpt_setwidth(struct mpt_softc *, int, int);
static void mpt_setsync(struct mpt_softc *, int, int, int);
static int mpt_update_spi_config(struct mpt_softc *, int);
static void mpt_calc_geometry(struct ccb_calc_geometry *ccg, int extended);
+
static mpt_reply_handler_t mpt_scsi_reply_handler;
static mpt_reply_handler_t mpt_scsi_tmf_reply_handler;
static mpt_reply_handler_t mpt_fc_els_reply_handler;
@@ -697,15 +698,11 @@ mpt_set_initial_config_spi(struct mpt_softc *mpt)
j == MPI_SCSIPORTPAGE2_PORT_FLAGS_OFF_DV */) {
mpt_lprt(mpt, MPT_PRT_NEGOTIATION,
"honoring BIOS transfer negotiations\n");
- for (i = 0; i < 16; i++) {
- mpt->mpt_dv[i].state = DV_STATE_DONE;
- }
} else {
for (i = 0; i < 16; i++) {
mpt->mpt_dev_page1[i].RequestedParameters = 0;
mpt->mpt_dev_page1[i].Configuration = 0;
(void) mpt_update_spi_config(mpt, i);
- mpt->mpt_dv[i].state = DV_STATE_0;
}
}
return (0);
@@ -2081,21 +2078,11 @@ mpt_scsi_reply_handler(struct mpt_softc *mpt, request_t *req,
scsi_req = (MSG_SCSI_IO_REQUEST *)req->req_vbuf;
ccb = req->ccb;
if (ccb == NULL) {
- /*
- * Peel off any 'by hand' commands here
- */
- if (req->state & REQ_STATE_NEED_WAKEUP) {
- req->state &= ~REQ_STATE_QUEUED;
- req->state |= REQ_STATE_DONE;
- wakeup(req);
- return (TRUE);
- }
- mpt_prt(mpt, "req %p:%u without CCB (state %#x "
- "func %#x index %u rf %p)\n", req, req->serno, req->state,
- scsi_req->Function, req->index, reply_frame);
- mpt_print_scsi_io_request(scsi_req);
+ mpt_prt(mpt, "mpt_scsi_reply_handler: req %p:%u with no ccb\n",
+ req, req->serno);
return (TRUE);
}
+
tgt = scsi_req->TargetID;
untimeout(mpt_timeout, ccb, ccb->ccb_h.timeout_ch);
ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
@@ -2191,7 +2178,6 @@ mpt_scsi_tmf_reply_handler(struct mpt_softc *mpt, request_t *req,
return (TRUE);
}
-
/*
* XXX: Move to definitions file
*/
@@ -2707,10 +2693,10 @@ XXXX
static void
mpt_action(struct cam_sim *sim, union ccb *ccb)
{
- struct mpt_softc *mpt;
- struct ccb_trans_settings *cts;
+ struct mpt_softc *mpt;
+ struct ccb_trans_settings *cts;
target_id_t tgt;
- int raid_passthru;
+ int raid_passthru;
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("mpt_action\n"));
@@ -2845,7 +2831,7 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
*/
if (mpt->phydisk_sim && raid_passthru == 0 &&
mpt_is_raid_volume(mpt, tgt) != 0) {
- mpt_lprt(mpt, MPT_PRT_ALWAYS,
+ mpt_lprt(mpt, MPT_PRT_NEGOTIATION,
"skipping transfer settings for RAID volumes\n");
mpt_set_ccb_status(ccb, CAM_REQ_CMP);
break;
@@ -3048,7 +3034,7 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
cpi->hba_inquiry = PI_TAG_ABLE;
} else {
cpi->max_target = 15;
- cpi->hba_misc = 0;
+ cpi->hba_misc = PIM_SEQSCAN;
cpi->initiator_id = mpt->mpt_ini_id;
cpi->base_transfer_speed = 3300;
cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16;
@@ -3061,9 +3047,9 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
*/
if (raid_passthru) {
cpi->max_target = mpt->ioc_page2->MaxPhysDisks - 1;
- cpi->initiator_id = cpi->max_target+1;
+ cpi->initiator_id = cpi->max_target + 1;
cpi->max_lun = 0;
- cpi->hba_misc = PIM_NOBUSRESET;
+ cpi->hba_misc |= PIM_NOBUSRESET;
}
if ((mpt->role & MPT_ROLE_INITIATOR) == 0) {