Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/ata/ata_xpt.c
Show First 20 Lines • Show All 720 Lines • ▼ Show 20 Lines | negotiate: | ||||
xpt_action(start_ccb); | xpt_action(start_ccb); | ||||
} | } | ||||
static void | static void | ||||
aproberequestdefaultnegotiation(struct cam_periph *periph) | aproberequestdefaultnegotiation(struct cam_periph *periph) | ||||
{ | { | ||||
struct ccb_trans_settings cts; | struct ccb_trans_settings cts; | ||||
bzero(&cts, sizeof(cts)); | |||||
xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); | xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); | ||||
cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; | cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; | ||||
cts.type = CTS_TYPE_USER_SETTINGS; | cts.type = CTS_TYPE_USER_SETTINGS; | ||||
xpt_action((union ccb *)&cts); | xpt_action((union ccb *)&cts); | ||||
if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) | if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) | ||||
return; | return; | ||||
cts.xport_specific.valid = 0; | cts.xport_specific.valid = 0; | ||||
cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; | cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; | ||||
▲ Show 20 Lines • Show All 951 Lines • ▼ Show 20 Lines | ata_device_transport(struct cam_path *path) | ||||
} else if (path->device->protocol == PROTO_SCSI) { | } else if (path->device->protocol == PROTO_SCSI) { | ||||
path->device->protocol_version = inq_buf ? | path->device->protocol_version = inq_buf ? | ||||
SID_ANSI_REV(inq_buf) : cpi.protocol_version; | SID_ANSI_REV(inq_buf) : cpi.protocol_version; | ||||
} | } | ||||
path->device->transport_version = ident_buf ? | path->device->transport_version = ident_buf ? | ||||
ata_version(ident_buf->version_major) : cpi.transport_version; | ata_version(ident_buf->version_major) : cpi.transport_version; | ||||
/* Tell the controller what we think */ | /* Tell the controller what we think */ | ||||
bzero(&cts, sizeof(cts)); | |||||
xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); | xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); | ||||
cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; | cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; | ||||
cts.type = CTS_TYPE_CURRENT_SETTINGS; | cts.type = CTS_TYPE_CURRENT_SETTINGS; | ||||
cts.transport = path->device->transport; | cts.transport = path->device->transport; | ||||
cts.transport_version = path->device->transport_version; | cts.transport_version = path->device->transport_version; | ||||
cts.protocol = path->device->protocol; | cts.protocol = path->device->protocol; | ||||
cts.protocol_version = path->device->protocol_version; | cts.protocol_version = path->device->protocol_version; | ||||
cts.proto_specific.valid = 0; | cts.proto_specific.valid = 0; | ||||
▲ Show 20 Lines • Show All 416 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static void | static void | ||||
ata_announce_periph(struct cam_periph *periph) | ata_announce_periph(struct cam_periph *periph) | ||||
{ | { | ||||
struct ccb_trans_settings cts; | struct ccb_trans_settings cts; | ||||
u_int speed, mb; | u_int speed, mb; | ||||
bzero(&cts, sizeof(cts)); | |||||
_ata_announce_periph(periph, &cts, &speed); | _ata_announce_periph(periph, &cts, &speed); | ||||
if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) | if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) | ||||
return; | return; | ||||
mb = speed / 1000; | mb = speed / 1000; | ||||
if (mb > 0) | if (mb > 0) | ||||
printf("%s%d: %d.%03dMB/s transfers", | printf("%s%d: %d.%03dMB/s transfers", | ||||
periph->periph_name, periph->unit_number, | periph->periph_name, periph->unit_number, | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |