cleanup some of the XPORT_FC code
This commit is contained in:
parent
c1c84cd9c5
commit
f053d7777b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=78710
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user