From 1c08859c6ba7846e555407d0eb1de52050bda308 Mon Sep 17 00:00:00 2001 From: msmith Date: Sat, 21 Apr 2001 04:08:26 +0000 Subject: Avoid divide-by-zero for devices that the adapter has not negotiated a transfer speed with. --- sys/dev/mly/mly_cam.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/dev/mly') diff --git a/sys/dev/mly/mly_cam.c b/sys/dev/mly/mly_cam.c index f27be2b..c326988 100644 --- a/sys/dev/mly/mly_cam.c +++ b/sys/dev/mly/mly_cam.c @@ -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) { -- cgit v1.1