diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-03-31 07:41:49 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-03-31 07:41:49 +0000 |
commit | 316d31859eda3d7e40b042f0364547e89f5d9a5d (patch) | |
tree | 782c979f0b13e65ab5bd1be1cc49872203de118e /sys | |
parent | 7f03e1ed9fa1178bf8762e93b1f26abe95a655b8 (diff) |
qle dvas straddle 4 byte boundaries, so best to treat them as two
u_int32_ts rather than u_int64_ts.
ok jmatthew@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/qle.c | 21 | ||||
-rw-r--r-- | sys/dev/pci/qlereg.h | 11 |
2 files changed, 22 insertions, 10 deletions
diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index f18164c14a9..03cc53ea096 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.19 2014/03/27 03:52:46 dlg Exp $ */ +/* $OpenBSD: qle.c,v 1.20 2014/03/31 07:41:48 dlg Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -575,11 +575,20 @@ qle_attach(struct device *parent, struct device *self, void *aux) htolem16(&icb->icb_req_queue_len, sc->sc_maxcmds); htolem16(&icb->icb_resp_queue_len, sc->sc_maxcmds); htolem16(&icb->icb_pri_req_queue_len, 8); /* apparently the minimum */ - icb->icb_req_queue_addr = htole64(QLE_DMA_DVA(sc->sc_requests)); - icb->icb_resp_queue_addr = htole64(QLE_DMA_DVA(sc->sc_responses)); - icb->icb_pri_req_queue_addr = htole64(QLE_DMA_DVA(sc->sc_pri_requests)); - - icb->icb_link_down_nos = htole16(200); + htolem32(&icb->icb_req_queue_addr_lo, + QLE_DMA_DVA(sc->sc_requests)); + htolem32(&icb->icb_req_queue_addr_hi, + QLE_DMA_DVA(sc->sc_requests) >> 32); + htolem32(&icb->icb_resp_queue_addr_lo, + QLE_DMA_DVA(sc->sc_responses)); + htolem32(&icb->icb_resp_queue_addr_hi, + QLE_DMA_DVA(sc->sc_responses) >> 32); + htolem32(&icb->icb_pri_req_queue_addr_lo, + QLE_DMA_DVA(sc->sc_pri_requests)); + htolem32(&icb->icb_pri_req_queue_addr_hi, + QLE_DMA_DVA(sc->sc_pri_requests) >> 32); + + htolem16(&icb->icb_link_down_nos, 200); icb->icb_int_delay = 0; icb->icb_login_timeout = 0; diff --git a/sys/dev/pci/qlereg.h b/sys/dev/pci/qlereg.h index 5af29629be2..e5bcbdaae81 100644 --- a/sys/dev/pci/qlereg.h +++ b/sys/dev/pci/qlereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: qlereg.h,v 1.5 2014/03/28 04:59:34 dlg Exp $ */ +/* $OpenBSD: qlereg.h,v 1.6 2014/03/31 07:41:48 dlg Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -304,9 +304,12 @@ struct qle_init_cb { u_int16_t icb_req_queue_len; u_int16_t icb_link_down_nos; u_int16_t icb_pri_req_queue_len; - u_int64_t icb_req_queue_addr; - u_int64_t icb_resp_queue_addr; - u_int64_t icb_pri_req_queue_addr; + u_int32_t icb_req_queue_addr_lo; + u_int32_t icb_req_queue_addr_hi; + u_int32_t icb_resp_queue_addr_lo; + u_int32_t icb_resp_queue_addr_hi; + u_int32_t icb_pri_req_queue_addr_lo; + u_int32_t icb_pri_req_queue_addr_hi; u_int8_t icb_reserved2[8]; u_int16_t icb_atio_queue_in; u_int16_t icb_atio_queue_len; |