source: trunk/src/ifd/sys-null.c @ 1137

Revision 1137, 2.3 KB checked in by alonbl, 3 years ago (diff)

Allow driver to specify events to poll

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * A void implementation for any platform
3 *
4 * Copyright (C) 2003 Olaf Kirch <okir@suse.de>
5 *
6 * These functions need to be re-implemented for every
7 * new platform.
8 */
9
10#include "internal.h"
11#if !defined(sun) && !defined (__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__FreeBSD_kernel__) && !defined(__linux__) && !defined(__APPLE__) && !defined(__DragonFly__)
12#include <sys/types.h>
13#include <stdio.h>
14#include <openct/driver.h>
15
16/*
17 * USB handling
18 */
19int ifd_sysdep_usb_poll_presence(ifd_device_t * dev, struct pollfd *pfd)
20{
21#if 0
22        if (pfd->revents & POLLHUP)
23                return 0;
24        pfd->fd = dev->fd;
25        pfd->events = POLLHUP;
26        return 1;
27#else
28        return -1;
29#endif
30}
31
32int ifd_sysdep_usb_get_eventfd(ifd_device_t * dev, short *events)
33{
34        return -1;
35}
36
37int ifd_sysdep_usb_control(ifd_device_t * dev, unsigned int requesttype,
38                           unsigned int request, unsigned int value,
39                           unsigned int index, void *data, size_t len,
40                           long timeout)
41{
42        return -1;
43}
44
45int ifd_sysdep_usb_set_configuration(ifd_device_t * dev, int config)
46{
47        return -1;
48}
49
50int ifd_sysdep_usb_set_interface(ifd_device_t * dev, int ifc, int alt)
51{
52        return -1;
53}
54
55int ifd_sysdep_usb_claim_interface(ifd_device_t * dev, int interface)
56{
57        return -1;
58}
59
60int ifd_sysdep_usb_release_interface(ifd_device_t * dev, int interface)
61{
62        return -1;
63}
64
65/*
66 * USB bulk transfer
67 */
68int ifd_sysdep_usb_bulk(ifd_device_t * dev, int ep, void *buffer, size_t len,
69                        long timeout)
70{
71        return -1;
72}
73
74/*
75 * USB URB capture
76 */
77struct ifd_usb_capture {
78        int type;
79        int endpoint;
80        size_t maxpacket;
81        unsigned int interface;
82};
83
84int ifd_sysdep_usb_begin_capture(ifd_device_t * dev, int type, int endpoint,
85                                 size_t maxpacket, ifd_usb_capture_t ** capret)
86{
87        return -1;
88}
89
90int ifd_sysdep_usb_capture_event(ifd_device_t * dev, ifd_usb_capture_t * cap,
91                           void *buffer, size_t len)
92{
93        return IFD_ERROR_NOT_SUPPORTED;
94}
95
96int ifd_sysdep_usb_capture(ifd_device_t * dev, ifd_usb_capture_t * cap,
97                           void *buffer, size_t len, long timeout)
98{
99        return -1;
100}
101
102int ifd_sysdep_usb_end_capture(ifd_device_t * dev, ifd_usb_capture_t * cap)
103{
104        return -1;
105}
106
107int ifd_sysdep_usb_open(const char *device)
108{
109        return -1;
110}
111
112int ifd_sysdep_usb_reset(ifd_device_t * dev)
113{
114        return -1;
115}
116
117/*
118 * Scan all usb devices to see if there is one we support
119 */
120int ifd_scan_usb(void)
121{
122        return 0;
123}
124
125#endif
Note: See TracBrowser for help on using the repository browser.