summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2001-06-24 18:19:24 +0000
committermjacob <mjacob@FreeBSD.org>2001-06-24 18:19:24 +0000
commit31d2b42b50742f9b1207e4642ce8f7605453aa83 (patch)
treeceaebaf1ccf2255bc81b5913fbdff61122e9d7e7 /sys
parentf4263fe73113d147d917c89743392dee695e84fe (diff)
downloadFreeBSD-src-31d2b42b50742f9b1207e4642ce8f7605453aa83.zip
FreeBSD-src-31d2b42b50742f9b1207e4642ce8f7605453aa83.tar.gz
cleanup some of the XPORT_FC code
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/cam_xpt.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 6374e47..9d5ee8f 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1512,8 +1512,7 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
path->device->lun_id);
printf("%s%d: ", periph->periph_name, periph->unit_number);
scsi_print_inquiry(&path->device->inq_data);
- if ((bootverbose)
- && (path->device->serial_num_len > 0)) {
+ if (bootverbose && path->device->serial_num_len > 0) {
/* Don't wrap the screen - print only the first 60 chars */
printf("%s%d: Serial Number %.60s\n", periph->periph_name,
periph->unit_number, path->device->serial_num);
@@ -1530,8 +1529,7 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
speed = cpi.base_transfer_speed;
freq = 0;
- if (cts.ccb_h.status == CAM_REQ_CMP
- && cts.transport == XPORT_SPI) {
+ if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) {
struct ccb_trans_settings_spi *spi;
spi = &cts.xport_specific.spi;
@@ -1544,14 +1542,13 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0)
speed *= (0x01 << spi->bus_width);
}
- if (cts.ccb_h.status == CAM_REQ_CMP
- && cts.transport == XPORT_FC) {
- struct ccb_trans_settings_fc *fc;
- fc = &cts.xport_specific.fc;
- speed = fc->bitrate;
+ if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) {
+ struct ccb_trans_settings_fc *fc = &cts.xport_specific.fc;
+ if (fc->valid & CTS_FC_VALID_SPEED) {
+ speed = fc->bitrate;
+ }
}
-
mb = speed / 1000;
if (mb > 0)
@@ -1562,8 +1559,7 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
printf("%s%d: %dKB/s transfers", periph->periph_name,
periph->unit_number, speed);
/* Report additional information about SPI connections */
- if (cts.ccb_h.status == CAM_REQ_CMP
- && cts.transport == XPORT_SPI) {
+ if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) {
struct ccb_trans_settings_spi *spi;
spi = &cts.xport_specific.spi;
@@ -1586,17 +1582,16 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
printf(")");
}
}
- if (cts.ccb_h.status == CAM_REQ_CMP
- && cts.transport == XPORT_FC) {
+ if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) {
struct ccb_trans_settings_fc *fc;
fc = &cts.xport_specific.fc;
- if (fc->wwnn)
- printf(" WWNN %q", (quad_t) fc->wwnn);
- if (fc->wwpn)
- printf(" WWPN %q", (quad_t) fc->wwpn);
- if (fc->port)
- printf(" PortID %u", fc->port);
+ if (fc->valid & CTS_FC_VALID_WWNN)
+ printf(" WWNN 0x%llx", (long long) fc->wwnn);
+ if (fc->valid & CTS_FC_VALID_WWPN)
+ printf(" WWPN 0x%llx", (long long) fc->wwpn);
+ if (fc->valid & CTS_FC_VALID_PORT)
+ printf(" PortID 0x%x", fc->port);
}
if (path->device->inq_flags & SID_CmdQue
@@ -6202,8 +6197,7 @@ xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
}
/* SPI specific sanity checking */
- if (cts->transport == XPORT_SPI
- && async_update == FALSE) {
+ if (cts->transport == XPORT_SPI && async_update == FALSE) {
u_int spi3caps;
struct ccb_trans_settings_spi *spi;
struct ccb_trans_settings_spi *cur_spi;
@@ -6239,8 +6233,8 @@ xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
&& (inq_data->flags & SID_Sync) == 0
&& cts->type == CTS_TYPE_CURRENT_SETTINGS)
|| ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0)
- || (cts->sync_offset == 0)
- || (cts->sync_period == 0)) {
+ || (cur_spi->sync_offset == 0)
+ || (cur_spi->sync_period == 0)) {
/* Force async */
spi->sync_period = 0;
spi->sync_offset = 0;
OpenPOWER on IntegriCloud