Lines Matching defs:fd

160 EventHub::Device::Device(int fd, int32_t id, const String8& path,
163 fd(fd), id(id), path(path), identifier(identifier),
182 if (fd >= 0) {
183 ::close(fd);
184 fd = -1;
291 if(ioctl(device->fd, EVIOCGABS(axis), &info)) {
292 ALOGW("Error reading absolute controller %d for device %s fd %d, errno=%d",
293 axis, device->identifier.name.string(), device->fd, errno);
343 if (ioctl(device->fd, EVIOCGKEY(sizeof(keyState)), keyState) >= 0) {
361 if (ioctl(device->fd, EVIOCGKEY(sizeof(keyState)), keyState) >= 0) {
383 if (ioctl(device->fd, EVIOCGSW(sizeof(swState)), swState) >= 0) {
400 if(ioctl(device->fd, EVIOCGABS(axis), &info)) {
401 ALOGW("Error reading absolute controller %d for device %s fd %d, errno=%d",
402 axis, device->identifier.name.string(), device->fd, errno);
525 nWrite = write(device->fd, &ev, sizeof(struct input_event));
577 if (ioctl(device->fd, EVIOCSFF, &effect)) {
590 if (write(device->fd, &ev, sizeof(ev)) != sizeof(ev)) {
612 if (write(device->fd, &ev, sizeof(ev)) != sizeof(ev)) {
749 int32_t readSize = read(device->fd, readBuffer,
753 ALOGW("could not get event, removed? (fd: %d size: %d bufferSize: %d "
755 device->fd, readSize, bufferSize, capacity, errno);
972 int fd = open(devicePath, O_RDWR | O_CLOEXEC);
973 if(fd < 0) {
981 if(ioctl(fd, EVIOCGNAME(sizeof(buffer) - 1), &buffer) < 1) {
993 close(fd);
1000 if(ioctl(fd, EVIOCGVERSION, &driverVersion)) {
1002 close(fd);
1008 if(ioctl(fd, EVIOCGID, &inputId)) {
1010 close(fd);
1019 if(ioctl(fd, EVIOCGPHYS(sizeof(buffer) - 1), &buffer) < 1) {
1027 if(ioctl(fd, EVIOCGUNIQ(sizeof(buffer) - 1), &buffer) < 1) {
1038 if (fcntl(fd, F_SETFL, O_NONBLOCK)) {
1040 close(fd);
1044 // Allocate device. (The device object takes ownership of the fd at this point.)
1046 Device* device = new Device(fd, deviceId, String8(devicePath), identifier);
1065 ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(device->keyBitmask)), device->keyBitmask);
1066 ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(device->absBitmask)), device->absBitmask);
1067 ioctl(fd, EVIOCGBIT(EV_REL, sizeof(device->relBitmask)), device->relBitmask);
1068 ioctl(fd, EVIOCGBIT(EV_SW, sizeof(device->swBitmask)), device->swBitmask);
1069 ioctl(fd, EVIOCGBIT(EV_LED, sizeof(device->ledBitmask)), device->ledBitmask);
1070 ioctl(fd, EVIOCGBIT(EV_FF, sizeof(device->ffBitmask)), device->ffBitmask);
1071 ioctl(fd, EVIOCGPROP(sizeof(device->propBitmask)), device->propBitmask);
1206 if (epoll_ctl(mEpollFd, EPOLL_CTL_ADD, fd, &eventItem)) {
1207 ALOGE("Could not add device fd to epoll instance. errno=%d", errno);
1214 bool usingSuspendBlockIoctl = !ioctl(fd, EVIOCSSUSPENDBLOCK, 1);
1232 bool usingClockIoctl = !ioctl(fd, EVIOCSCLOCKID, &clockId);
1234 ALOGI("New device: id=%d, fd=%d, path='%s', name='%s', classes=0x%x, "
1237 deviceId, fd, devicePath, device->identifier.name.string(),
1347 ALOGI("Removed device: path=%s name=%s id=%d fd=%d classes=0x%x\n",
1349 device->fd, device->classes);
1358 if (epoll_ctl(mEpollFd, EPOLL_CTL_DEL, device->fd, NULL)) {
1359 ALOGW("Could not remove device fd from epoll instance. errno=%d", errno);