]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Handle the HCIGETDEVLIST ioctl.
authorTom Hughes <tom@compton.nu>
Thu, 26 Jun 2014 11:44:46 +0000 (11:44 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 26 Jun 2014 11:44:46 +0000 (11:44 +0000)
Based on patch from Tomasz Nowak via BZ#335034.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14109

NEWS
coregrind/m_syswrap/syswrap-linux.c
docs/internals/3_9_BUGSTATUS.txt
include/vki/vki-linux.h

diff --git a/NEWS b/NEWS
index bdf4fb22dbea58f68ab44d2616a8093b4a58759b..a693111c5bf20c32ba07f547b264046969fd97c4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -160,6 +160,7 @@ where XXXXXX is the bug number as listed below.
 334705  sendmsg and recvmsg should guard against bogus msghdr fields.
 334727  Build fails with -Werror=format-security
 334788  clarify doc about --log-file initial program directory
+335034  Unhandled ioctl: HCIGETDEVLIST
 335155  vgdb, fix error print statement.
 335262  arm64: movi 8bit version is not supported
 335263  arm64: dmb instruction is not implemented
index 8ea032e6b8c184894e5206bc49a65a870646d43e..e1157e95a887ac8864598f9d9a0cb3d4c32629c7 100644 (file)
@@ -6903,6 +6903,17 @@ PRE(sys_ioctl)
        break;
 #  endif /* defined(VGPV_*_linux_android) */
 
+   case VKI_HCIGETDEVLIST:
+      if (ARG3) {
+         struct vki_hci_dev_list_req* dlr = (struct vki_hci_dev_list_req*)ARG3;
+         PRE_MEM_READ("ioctl(HCIGETDEVLIST)",
+                      (Addr)ARG3, sizeof(struct vki_hci_dev_list_req));
+         PRE_MEM_WRITE("ioctl(HCIGETDEVLIST)",
+                       (Addr)ARG3 + sizeof(struct vki_hci_dev_list_req),
+                       dlr->dev_num * sizeof(struct vki_hci_dev_req));
+      }
+      break;
+      
    case VKI_HCIINQUIRY:
       if (ARG3) {
          struct vki_hci_inquiry_req* ir = (struct vki_hci_inquiry_req*)ARG3;
@@ -8005,6 +8016,14 @@ POST(sys_ioctl)
        break;
 #  endif /* defined(VGPV_*_linux_android) */
 
+   case VKI_HCIGETDEVLIST:
+      if (ARG3) {
+        struct vki_hci_dev_list_req* dlr = (struct vki_hci_dev_list_req*)ARG3;
+        POST_MEM_WRITE((Addr)ARG3 + sizeof(struct vki_hci_dev_list_req),
+                       dlr->dev_num * sizeof(struct vki_hci_dev_req));
+      }
+      break;
+
    case VKI_HCIINQUIRY:
       if (ARG3) {
         struct vki_hci_inquiry_req* ir = (struct vki_hci_inquiry_req*)ARG3;
index a0a4878b494fc20656aae4e1a452b36c6dd01e00..9e779c38237aba61d537388365e190ec0cab2d50 100644 (file)
@@ -168,7 +168,6 @@ For bugs reported before this time, see 3_8_BUGSTATUS.txt
 ========================================================================
 ========================================================================
 
-335034  Unhandled ioctl: HCIGETDEVLIST
 334936  patch to fix false positives on alsa SNDRV_CTL_* ioctls
 333628  Out of tree build  (is fixed, but needs to land)
 335143  Capabilities not supported
@@ -180,7 +179,6 @@ For bugs reported before this time, see 3_8_BUGSTATUS.txt
 334802  valgrind does not always explain why a given option is bad
 334834  PPC64 Little Endian support, patch 2
 334836  PPC64 Little Endian support, patch 3 testcase fixes
-335034  Unhandled ioctl: HCIGETDEVLIST
 335353  expected output of exp-sgcheck/tests/hackedbz2 mismatch with gcc 4.8.1
 335441  unhandled ioctl 0x8905 (SIOCATMARK) when running wine under valgrind (patch)
 249435  Analyzing wine programs with callgrind triggers a crash (NEEDS CLOSE)
index 225da00ae8766eda84a51a5382677aaf52f00246..9123e24720c9e7808254d0aebc6b7d702e2ab501 100644 (file)
@@ -2956,6 +2956,17 @@ typedef struct {
 #define VKI_HCIDEVRESTAT    _VKI_IOW('H', 204, int)
 
 #define VKI_HCIGETDEVLIST   _VKI_IOR('H', 210, int)
+
+struct vki_hci_dev_req {
+       __vki_u16  dev_id;
+       __vki_u32  dev_opt;
+};
+
+struct vki_hci_dev_list_req {
+       __vki_u16  dev_num;
+       struct vki_hci_dev_req dev_req[0];      /* hci_dev_req structures */
+};
+
 #define VKI_HCIGETDEVINFO   _VKI_IOR('H', 211, int)
 #define VKI_HCIGETCONNLIST  _VKI_IOR('H', 212, int)
 #define VKI_HCIGETCONNINFO  _VKI_IOR('H', 213, int)