diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2015-04-27 02:28:57 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2015-04-27 02:28:57 +0200 |
commit | e1265fa32837f457ee2c2fa259d12c9545af4bbf (patch) | |
tree | 64b8d5f1c81c14f019047b0cb00cb77c2dcecf55 /irq.c | |
parent | a37beb44d59cca329d0d9345c21505af81030688 (diff) | |
download | ipecamera-e1265fa32837f457ee2c2fa259d12c9545af4bbf.tar.gz ipecamera-e1265fa32837f457ee2c2fa259d12c9545af4bbf.tar.bz2 ipecamera-e1265fa32837f457ee2c2fa259d12c9545af4bbf.tar.xz ipecamera-e1265fa32837f457ee2c2fa259d12c9545af4bbf.zip |
First stand-alone ipecamera implementation
Diffstat (limited to 'irq.c')
-rw-r--r-- | irq.c | 55 |
1 files changed, 0 insertions, 55 deletions
@@ -1,55 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <strings.h> -#include <stdlib.h> -#include <stdint.h> -#include <stdarg.h> -#include <fcntl.h> -#include <unistd.h> -#include <sys/ioctl.h> -#include <sys/mman.h> -#include <arpa/inet.h> -#include <errno.h> -#include <assert.h> - -#include "pci.h" - -#include "tools.h" -#include "error.h" - -int pcilib_wait_irq(pcilib_t *ctx, pcilib_irq_hw_source_t source, pcilib_timeout_t timeout, size_t *count) { - int err; - - interrupt_wait_t arg = { 0 }; - - arg.source = source; - arg.timeout = timeout; - - if (count) arg.count = 1; - - err = ioctl(ctx->handle, PCIDRIVER_IOC_WAITI, &arg); - if (err) { - pcilib_error("PCIDRIVER_IOC_WAITI ioctl have failed"); - return PCILIB_ERROR_FAILED; - } - - if (!arg.count) return PCILIB_ERROR_TIMEOUT; - - if (count) *count = arg.count; - - return 0; -} - -int pcilib_clear_irq(pcilib_t *ctx, pcilib_irq_hw_source_t source) { - int err; - - err = ioctl(ctx->handle, PCIDRIVER_IOC_CLEAR_IOQ, source); - if (err) { - pcilib_error("PCIDRIVER_IOC_CLEAR_IOQ ioctl have failed"); - return PCILIB_ERROR_FAILED; - } - - return 0; -} - - |