aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/aic7xxx
diff options
context:
space:
mode:
authorKenneth D. Merry <ken@FreeBSD.org>2012-06-26 14:51:35 +0000
committerKenneth D. Merry <ken@FreeBSD.org>2012-06-26 14:51:35 +0000
commitb79dc8a8da264fafa98697a39a967e56ed8647d1 (patch)
tree7b016bc8afd686b682aaffe21bfcace67afaf0e7 /sys/dev/aic7xxx
parent8405fe86627bd23303e30797ec2e5ec37f493491 (diff)
downloadsrc-b79dc8a8da264fafa98697a39a967e56ed8647d1.tar.gz
src-b79dc8a8da264fafa98697a39a967e56ed8647d1.zip
Fix an issue that caused the kernel to panic inside CTL when trying
to attach to target capable HBAs that implement the old immediate notify (XPT_IMMED_NOTIFY) and notify acknowledge (XPT_NOTIFY_ACK) CCBs. The new API has been in place since SVN change 196008 in 2009. The solution is two-fold: fix CTL to handle the responses from the HBAs, and convert the HBA drivers in question to use the new API. These drivers have not been tested with CTL, so how well they will interoperate with CTL is unknown. scsi_target.c: Update the userland target example code to use the new immediate notify API. scsi_ctl.c: Detect when an immediate notify CCB is returned with CAM_REQ_INVALID or CAM_PROVIDE_FAIL status, and just free it. Fix a duplicate assignment. aic79xx.c, aic79xx_osm.c: Update the aic79xx driver to use the new API. Target mode is not enabled on for this driver, so the changes will have no practical effect. aic7xxx.c, aic7xxx_osm.c: Update the aic7xxx driver to use the new API. sbp_targ.c: Update the firewire target code to work with the new API. mpt_cam.c: Update the mpt(4) driver to work with the new API. Target mode is only enabled for Fibre Channel mpt(4) devices. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=237601
Diffstat (limited to 'sys/dev/aic7xxx')
-rw-r--r--sys/dev/aic7xxx/aic79xx.c9
-rw-r--r--sys/dev/aic7xxx/aic79xx_osm.c8
-rw-r--r--sys/dev/aic7xxx/aic7xxx.c9
-rw-r--r--sys/dev/aic7xxx/aic7xxx_osm.c8
4 files changed, 16 insertions, 18 deletions
diff --git a/sys/dev/aic7xxx/aic79xx.c b/sys/dev/aic7xxx/aic79xx.c
index 86b13fadb0b7..363301bcea45 100644
--- a/sys/dev/aic7xxx/aic79xx.c
+++ b/sys/dev/aic7xxx/aic79xx.c
@@ -8561,7 +8561,7 @@ void
ahd_send_lstate_events(struct ahd_softc *ahd, struct ahd_tmode_lstate *lstate)
{
struct ccb_hdr *ccbh;
- struct ccb_immed_notify *inot;
+ struct ccb_immediate_notify *inot;
while (lstate->event_r_idx != lstate->event_w_idx
&& (ccbh = SLIST_FIRST(&lstate->immed_notifies)) != NULL) {
@@ -8569,19 +8569,18 @@ ahd_send_lstate_events(struct ahd_softc *ahd, struct ahd_tmode_lstate *lstate)
event = &lstate->event_buffer[lstate->event_r_idx];
SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle);
- inot = (struct ccb_immed_notify *)ccbh;
+ inot = (struct ccb_immediate_notify *)ccbh;
switch (event->event_type) {
case EVENT_TYPE_BUS_RESET:
ccbh->status = CAM_SCSI_BUS_RESET|CAM_DEV_QFRZN;
break;
default:
ccbh->status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN;
- inot->message_args[0] = event->event_type;
- inot->message_args[1] = event->event_arg;
+ inot->arg = event->event_type;
+ inot->seq_id = event->event_arg;
break;
}
inot->initiator_id = event->initiator_id;
- inot->sense_len = 0;
xpt_done((union ccb *)inot);
lstate->event_r_idx++;
if (lstate->event_r_idx == AHD_TMODE_EVENT_BUFFER_SIZE)
diff --git a/sys/dev/aic7xxx/aic79xx_osm.c b/sys/dev/aic7xxx/aic79xx_osm.c
index 375de63ae82e..1d44b9f7e2c6 100644
--- a/sys/dev/aic7xxx/aic79xx_osm.c
+++ b/sys/dev/aic7xxx/aic79xx_osm.c
@@ -601,8 +601,8 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
break;
}
#ifdef AHD_TARGET_MODE
- case XPT_NOTIFY_ACK:
- case XPT_IMMED_NOTIFY:
+ case XPT_NOTIFY_ACKNOWLEDGE:
+ case XPT_IMMEDIATE_NOTIFY:
{
struct ahd_tmode_tstate *tstate;
struct ahd_tmode_lstate *lstate;
@@ -1189,7 +1189,7 @@ ahd_abort_ccb(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
switch (abort_ccb->ccb_h.func_code) {
#ifdef AHD_TARGET_MODE
case XPT_ACCEPT_TARGET_IO:
- case XPT_IMMED_NOTIFY:
+ case XPT_IMMEDIATE_NOTIFY:
case XPT_CONT_TARGET_IO:
{
struct ahd_tmode_tstate *tstate;
@@ -1207,7 +1207,7 @@ ahd_abort_ccb(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
if (abort_ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO)
list = &lstate->accept_tios;
- else if (abort_ccb->ccb_h.func_code == XPT_IMMED_NOTIFY)
+ else if (abort_ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY)
list = &lstate->immed_notifies;
else
list = NULL;
diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c
index d5bac1d45630..7bbe3c58b7c0 100644
--- a/sys/dev/aic7xxx/aic7xxx.c
+++ b/sys/dev/aic7xxx/aic7xxx.c
@@ -6368,7 +6368,7 @@ void
ahc_send_lstate_events(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate)
{
struct ccb_hdr *ccbh;
- struct ccb_immed_notify *inot;
+ struct ccb_immediate_notify *inot;
while (lstate->event_r_idx != lstate->event_w_idx
&& (ccbh = SLIST_FIRST(&lstate->immed_notifies)) != NULL) {
@@ -6376,19 +6376,18 @@ ahc_send_lstate_events(struct ahc_softc *ahc, struct ahc_tmode_lstate *lstate)
event = &lstate->event_buffer[lstate->event_r_idx];
SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle);
- inot = (struct ccb_immed_notify *)ccbh;
+ inot = (struct ccb_immediate_notify *)ccbh;
switch (event->event_type) {
case EVENT_TYPE_BUS_RESET:
ccbh->status = CAM_SCSI_BUS_RESET|CAM_DEV_QFRZN;
break;
default:
ccbh->status = CAM_MESSAGE_RECV|CAM_DEV_QFRZN;
- inot->message_args[0] = event->event_type;
- inot->message_args[1] = event->event_arg;
+ inot->arg = event->event_type;
+ inot->seq_id = event->event_arg;
break;
}
inot->initiator_id = event->initiator_id;
- inot->sense_len = 0;
xpt_done((union ccb *)inot);
lstate->event_r_idx++;
if (lstate->event_r_idx == AHC_TMODE_EVENT_BUFFER_SIZE)
diff --git a/sys/dev/aic7xxx/aic7xxx_osm.c b/sys/dev/aic7xxx/aic7xxx_osm.c
index eeb06af0c235..281b00ec9e53 100644
--- a/sys/dev/aic7xxx/aic7xxx_osm.c
+++ b/sys/dev/aic7xxx/aic7xxx_osm.c
@@ -568,8 +568,8 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
}
break;
}
- case XPT_NOTIFY_ACK:
- case XPT_IMMED_NOTIFY:
+ case XPT_NOTIFY_ACKNOWLEDGE:
+ case XPT_IMMEDIATE_NOTIFY:
{
struct ahc_tmode_tstate *tstate;
struct ahc_tmode_lstate *lstate;
@@ -1248,7 +1248,7 @@ ahc_abort_ccb(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
abort_ccb = ccb->cab.abort_ccb;
switch (abort_ccb->ccb_h.func_code) {
case XPT_ACCEPT_TARGET_IO:
- case XPT_IMMED_NOTIFY:
+ case XPT_IMMEDIATE_NOTIFY:
case XPT_CONT_TARGET_IO:
{
struct ahc_tmode_tstate *tstate;
@@ -1266,7 +1266,7 @@ ahc_abort_ccb(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
if (abort_ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO)
list = &lstate->accept_tios;
- else if (abort_ccb->ccb_h.func_code == XPT_IMMED_NOTIFY)
+ else if (abort_ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY)
list = &lstate->immed_notifies;
else
list = NULL;