summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-08-05 19:13:07 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-08-05 19:13:07 +0200
commit6ac0cf129270aef989785e3fbc84abc238a29e92 (patch)
treee24b43e3ace522a1a4db5cfa40da7246aee21041
parent7c5897933f4f64594602b2e38264af705c061754 (diff)
downloadpcitool-6ac0cf129270aef989785e3fbc84abc238a29e92.tar.gz
pcitool-6ac0cf129270aef989785e3fbc84abc238a29e92.tar.bz2
pcitool-6ac0cf129270aef989785e3fbc84abc238a29e92.tar.xz
pcitool-6ac0cf129270aef989785e3fbc84abc238a29e92.zip
Read model from environmental variable if defined
-rw-r--r--CMakeLists.txt2
-rw-r--r--docs/README6
-rw-r--r--pcilib/pci.c3
3 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0aeb45a..bbe5a74 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
project(pcitool)
-set(PCILIB_VERSION "0.2.0")
+set(PCILIB_VERSION "0.2.1")
set(PCILIB_ABI_VERSION "2")
cmake_minimum_required(VERSION 2.6)
diff --git a/docs/README b/docs/README
index ba22acf..335ebef 100644
--- a/docs/README
+++ b/docs/README
@@ -1,14 +1,16 @@
Supported environmental variables
=================================
- PCILIB_PLUGIN_DIR - override path to directory with plugins
+ PCILIB_MODEL - defines the requested model (is overriden with -m option)
+ PCILIB_PLUGIN_DIR - override path to directory with plugins
- PCILIB_DEBUG_DMA - Enable DMA debugging
+ PCILIB_DEBUG_DMA - Enable DMA debugging
PCILIB_DEBUG_MISSING_EVENTS - Enable debugging of missing events (frames for instance)
IPECAMERA_DEBUG_BROKEN_FRAMES - Store broken frames in the specified directory (variable may specify directory)
IPECAMERA_DEBUG_RAW_PACKETS - Store all raw packets read from DMA grouped in frames (variable may specify directory)
IPECAMERA_DEBUG_RAW_FRAMES - Store all raw frames (variable may specify directory)
IPECAMERA_DEBUG_HARDWARE - Produce various debugging information about ipecamera operation
IPECAMERA_DEBUG_FRAME_HEADERS - Print headers of each frame
+ IPECAMERA_DEBUG_API - Print messages while entering and finishing standard API calls
PCILIB_BENCHMARK_HARDWARE - Remove all unnecessary software processing (like copying memcpy) to check hardware performance
PCILIB_BENCHMARK_STREAMING - Emulate streaming mode while benchmarking DMA engines
diff --git a/pcilib/pci.c b/pcilib/pci.c
index 512e891..6078a6e 100644
--- a/pcilib/pci.c
+++ b/pcilib/pci.c
@@ -108,6 +108,9 @@ pcilib_t *pcilib_open(const char *device, const char *model) {
size_t i;
pcilib_t *ctx = malloc(sizeof(pcilib_t));
+ if (!model)
+ model = getenv("PCILIB_MODEL");
+
if (ctx) {
memset(ctx, 0, sizeof(pcilib_t));
ctx->pci_cfg_space_fd = -1;