diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-03-02 02:49:28 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-03-02 02:49:28 +0100 |
commit | 3c58980b3ca558096340e51c215897e8614ba00a (patch) | |
tree | 54d5f8cf48c7331586ed110a548b33b161f8093e /pcilib/pci.c | |
parent | adc657ebcd01ecc2cc5f110453ef00dffde2d5c0 (diff) | |
parent | a5da7db50d02878b6d9c844b18d0d3f8ccf6c62b (diff) | |
download | pcitool-3c58980b3ca558096340e51c215897e8614ba00a.tar.gz pcitool-3c58980b3ca558096340e51c215897e8614ba00a.tar.bz2 pcitool-3c58980b3ca558096340e51c215897e8614ba00a.tar.xz pcitool-3c58980b3ca558096340e51c215897e8614ba00a.zip |
Distinguish between hardware and bus addresses in pcilib and fix cli reading from DMA when very low DMA timeout is set
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r-- | pcilib/pci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c index 19165ba..ec40c95 100644 --- a/pcilib/pci.c +++ b/pcilib/pci.c @@ -131,7 +131,7 @@ pcilib_t *pcilib_open(const char *device, const char *model) { return NULL; } - ctx->page_mask = (uintptr_t)-1; + ctx->page_mask = pcilib_get_page_mask(); if ((model)&&(!strcasecmp(model, "maintenance"))) { ctx->model = strdup("maintenance"); @@ -271,14 +271,14 @@ const pcilib_driver_version_t *pcilib_get_driver_version(pcilib_t *ctx) { const pcilib_board_info_t *pcilib_get_board_info(pcilib_t *ctx) { int ret; - if (ctx->page_mask == (uintptr_t)-1) { + if (!ctx->board_info_ready) { ret = ioctl( ctx->handle, PCIDRIVER_IOC_PCI_INFO, &ctx->board_info ); if (ret) { pcilib_error("PCIDRIVER_IOC_PCI_INFO ioctl have failed"); return NULL; } - ctx->page_mask = pcilib_get_page_mask(); + ctx->board_info_ready = 1; } return &ctx->board_info; |