PERFORCE change 169364 for review
Alexander Motin
mav at FreeBSD.org
Sat Oct 10 20:35:34 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=169364
Change 169364 by mav at mav_mavbook on 2009/10/10 20:34:54
Add done method for port-specific XPT. It will allow XPT to recover
bus from heavy error conditions.
Fix SATA scanning, broken by recent ahci/siis change.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#38 edit
.. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#104 edit
.. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.h#18 edit
.. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt_internal.h#8 edit
.. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_xpt.c#17 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#38 (text+ko) ====
@@ -183,6 +183,7 @@
static struct xpt_xport ata_xport = {
.alloc_device = ata_alloc_device,
.action = ata_action,
+ .done = xpt_done_default,
.async = ata_dev_async,
};
@@ -986,7 +987,8 @@
take_next:
/* Take next device. Wrap from 15 (PM) to 0. */
scan_info->counter = (scan_info->counter + 1 ) & 0x0f;
- if (scan_info->counter >= scan_info->cpi->max_target+1) {
+ if (scan_info->counter > scan_info->cpi->max_target -
+ ((scan_info->cpi->hba_inquiry & PI_SATAPM) ? 1 : 0)) {
xpt_free_ccb(work_ccb);
xpt_free_ccb((union ccb *)scan_info->cpi);
request_ccb = scan_info->request_ccb;
==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#104 (text+ko) ====
@@ -2989,6 +2989,13 @@
}
void
+xpt_done_default(union ccb *done_ccb)
+{
+ /* Call the peripheral driver's callback */
+ (*done_ccb->ccb_h.cbfcnp)(done_ccb->ccb_h.path->periph, done_ccb);
+}
+
+void
xpt_polled_action(union ccb *start_ccb)
{
u_int32_t timeout;
@@ -3729,6 +3736,7 @@
static struct xpt_xport xport_default = {
.alloc_device = xpt_alloc_device_default,
.action = xpt_action_default,
+ .done = xpt_done_default,
.async = xpt_dev_async_default,
};
@@ -4999,8 +5007,8 @@
xpt_run_dev_sendq(ccb_h->path->bus);
}
- /* Call the peripheral driver's callback */
- (*ccb_h->cbfcnp)(ccb_h->path->periph, (union ccb *)ccb_h);
+ /* Call the XPT's callback */
+ (*(ccb_h->path->bus->xport->done))((union ccb *)ccb_h);
}
}
==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.h#18 (text+ko) ====
@@ -87,6 +87,7 @@
void xpt_action(union ccb *new_ccb);
void xpt_action_default(union ccb *new_ccb);
+void xpt_done_default(union ccb *new_ccb);
void xpt_setup_ccb(struct ccb_hdr *ccb_h,
struct cam_path *path,
u_int32_t priority);
==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt_internal.h#8 (text+ko) ====
@@ -41,6 +41,7 @@
struct cam_et *target,
struct cam_ed *device);
typedef void (*xpt_action_func)(union ccb *start_ccb);
+typedef void (*xpt_done_func)(union ccb *done_ccb);
typedef void (*xpt_dev_async_func)(u_int32_t async_code,
struct cam_eb *bus,
struct cam_et *target,
@@ -53,6 +54,7 @@
xpt_alloc_device_func alloc_device;
xpt_release_device_func reldev;
xpt_action_func action;
+ xpt_done_func done;
xpt_dev_async_func async;
xpt_announce_periph_func announce;
};
==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_xpt.c#17 (text+ko) ====
@@ -555,6 +555,7 @@
static struct xpt_xport scsi_xport = {
.alloc_device = scsi_alloc_device,
.action = scsi_action,
+ .done = xpt_done_default,
.async = scsi_dev_async,
};
More information about the p4-projects
mailing list