summaryrefslogtreecommitdiffstats
path: root/sys/dev/mly
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2001-04-21 04:08:26 +0000
committermsmith <msmith@FreeBSD.org>2001-04-21 04:08:26 +0000
commit1c08859c6ba7846e555407d0eb1de52050bda308 (patch)
treea9eae3a6e24e00ad528bbe43e11011a8540d4828 /sys/dev/mly
parent929a45b2412036797b38262f3b1a840ddcf1988f (diff)
downloadFreeBSD-src-1c08859c6ba7846e555407d0eb1de52050bda308.zip
FreeBSD-src-1c08859c6ba7846e555407d0eb1de52050bda308.tar.gz
Avoid divide-by-zero for devices that the adapter has not negotiated a
transfer speed with.
Diffstat (limited to 'sys/dev/mly')
-rw-r--r--sys/dev/mly/mly_cam.c6
1 files changed, 5 insertions, 1 deletions
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) {
OpenPOWER on IntegriCloud