Avoid divide-by-zero for devices that the adapter has not negotiated a

transfer speed with.
This commit is contained in:
Mike Smith 2001-04-21 04:08:26 +00:00
parent ccd58ea72d
commit b8ce799cc4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75760

View File

@ -363,7 +363,11 @@ mly_cam_action(struct cam_sim *sim, union ccb *ccb)
cts->valid |= CCB_TRANS_TQ_VALID;
/* convert speed (MHz) to usec */
cts->sync_period = 1000000 / sc->mly_btl[bus][target].mb_speed;
if (sc->mly_btl[bus][target].mb_speed == 0) {
cts->sync_period = 1000000 / 5;
} else {
cts->sync_period = 1000000 / sc->mly_btl[bus][target].mb_speed;
}
/* convert bus width to CAM internal encoding */
switch (sc->mly_btl[bus][target].mb_width) {