OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/hid/hid_connection_linux.h" | 5 #include "device/hid/hid_connection_linux.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <libudev.h> | 9 #include <libudev.h> |
10 #include <linux/hidraw.h> | 10 #include <linux/hidraw.h> |
11 #include <sys/ioctl.h> | 11 #include <sys/ioctl.h> |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 | 14 |
| 15 #include "base/files/file_path.h" |
15 #include "base/posix/eintr_wrapper.h" | 16 #include "base/posix/eintr_wrapper.h" |
16 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
17 #include "base/tuple.h" | 18 #include "base/tuple.h" |
18 #include "device/hid/hid_service.h" | 19 #include "device/hid/hid_service.h" |
19 #include "device/hid/hid_service_linux.h" | 20 #include "device/hid/hid_service_linux.h" |
20 | 21 |
21 // These are already defined in newer versions of linux/hidraw.h. | 22 // These are already defined in newer versions of linux/hidraw.h. |
22 #ifndef HIDIOCSFEATURE | 23 #ifndef HIDIOCSFEATURE |
23 #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x06, len) | 24 #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x06, len) |
24 #endif | 25 #endif |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 !device_path.compare(0, parent_path.length(), parent_path)) { | 236 !device_path.compare(0, parent_path.length(), parent_path)) { |
236 *result = raw_path; | 237 *result = raw_path; |
237 return true; | 238 return true; |
238 } | 239 } |
239 } | 240 } |
240 | 241 |
241 return false; | 242 return false; |
242 } | 243 } |
243 | 244 |
244 } // namespace device | 245 } // namespace device |
OLD | NEW |