>From 91668d4fb82d07d59e1e6c6cc52c7ecfeaf6bf5f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 26 Sep 2014 10:58:15 -0700 Subject: [PATCH 1/6] Adjust multipage algorithm to create aligned reads for 256 byte pages At least the A300CS requires that 256 byte reads (16 * PAGESIZE) are aligned to that pagesize. Signed-off-by: Dirk Hohndel --- src/oceanic_common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/oceanic_common.c b/src/oceanic_common.c index f5f37a149596..6069157a4aaf 100644 --- a/src/oceanic_common.c +++ b/src/oceanic_common.c @@ -536,6 +536,16 @@ oceanic_common_device_foreach (dc_device_t *abstract, dc_dive_callback_t callbac if (nbytes + len > remaining) len = remaining - nbytes; // End of profile. + // for the newer device that support reads of 16 pages, the address appears + // to have to be aligned + if (device->multipage == 16 && len == PAGESIZE * device->multipage) { + if (address % (PAGESIZE * device->multipage)) { + // this wouldn't be an aligned read + // let's read a smaller subset first which should have the remaining + // reads be aligned + len = address % (PAGESIZE * device->multipage); + } + } // Move to the start of the current page. address -= len; offset -= len; -- 1.8.0.rc0.18.gf84667d