3 #include "tapi-device.h"
4 #include "tapi-ioctl.h"
6 int tapi_device_open(unsigned int id
, struct tapi_device
*dev
)
10 snprintf(path
, sizeof(path
), "/dev/tapi%dC", id
);
11 dev
->control_fd
= open(path
, 0);
12 if (dev
->control_fd
< 0)
15 snprintf(dev
->stream_path
, 100, "/dev/tapi%dS", id
);
23 int tapi_link_alloc(struct tapi_device
*dev
, unsigned int ep1
, unsigned int ep2
)
25 return ioctl(dev
->control_fd
, TAPI_CONTROL_IOCTL_LINK_ALLOC
, (ep1
<< 16) | ep2
);
28 int tapi_link_free(struct tapi_device
*dev
, unsigned int link
)
30 return ioctl(dev
->control_fd
, TAPI_CONTROL_IOCTL_LINK_FREE
, link
);
33 int tapi_link_enable(struct tapi_device
*dev
, unsigned int link
)
35 return ioctl(dev
->control_fd
, TAPI_CONTROL_IOCTL_LINK_ENABLE
, link
);
38 int tapi_link_disable(struct tapi_device
*dev
, unsigned int link
)
40 return ioctl(dev
->control_fd
, TAPI_CONTROL_IOCTL_LINK_DISABLE
, link
);
43 int tapi_sync(struct tapi_device
*dev
)
45 return ioctl(dev
->control_fd
, TAPI_CONTROL_IOCTL_SYNC
, 0);