summaryrefslogtreecommitdiffstats
path: root/cli.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-10-21 03:44:27 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-10-21 03:44:27 +0200
commit32bd82e4b4748cbe7b4734030dfb135feab4dffc (patch)
tree5a4a6c77d2f51f4d8e9081961b31bb6b53c64948 /cli.c
parentb407c19d68509af786ed13fb22e66bebbf73c0d8 (diff)
downloadpcitool-32bd82e4b4748cbe7b4734030dfb135feab4dffc.tar.gz
pcitool-32bd82e4b4748cbe7b4734030dfb135feab4dffc.tar.bz2
pcitool-32bd82e4b4748cbe7b4734030dfb135feab4dffc.tar.xz
pcitool-32bd82e4b4748cbe7b4734030dfb135feab4dffc.zip
Accept short addresses for IPECamera FPGA registers
Diffstat (limited to 'cli.c')
-rw-r--r--cli.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index 308092d..8c65830 100644
--- a/cli.c
+++ b/cli.c
@@ -1537,7 +1537,14 @@ int main(int argc, char **argv) {
if ((start >= ranges[i].start)&&(start <= ranges[i].end)) break;
// register access in plain mode
- if (ranges[i].start != ranges[i].end) ++mode;
+ if (ranges[i].start != ranges[i].end) {
+ pcilib_register_bank_t regbank = pcilib_find_bank_by_addr(handle, ranges[i].bank);
+ if (regbank == PCILIB_REGISTER_BANK_INVALID) Error("Configuration error: register bank specified in the address range is not found");
+
+ bank = model_info->banks[regbank].name;
+ start += ranges[i].addr_shift;
+ ++mode;
+ }
}
} else {
if (pcilib_find_register(handle, bank, addr) == PCILIB_REGISTER_INVALID) {