@@ -9332,6 +9332,42 @@ static const struct exp_feat {
EXP_FEAT(rpa_resolution_uuid, rpa_resolution_func),
};
+/* A user space process can enable/disable the quality report feature
+ * by sending a property changed signal to the bluetoothd. The bluetoothd
+ * can set up the signal handlers in a file under plugins/ to call
+ * this function.
+ */
+void btd_adapter_update_kernel_quality_report(uint8_t action)
+{
+ struct mgmt_cp_set_exp_feature cp;
+ struct btd_adapter *adapter;
+
+ adapter = btd_adapter_get_default();
+ if (!adapter) {
+ info("No default adapter. Skip enabling quality report.");
+ return;
+ }
+
+ if (!adapter->quality_report_supported) {
+ info("quality report feature not supported.");
+ return;
+ }
+
+ memset(&cp, 0, sizeof(cp));
+ memcpy(cp.uuid, quality_report_uuid, 16);
+
+ cp.action = action;
+ if (cp.action > 1) {
+ error("Unexpected quality report action %u", cp.action);
+ return;
+ }
+
+ mgmt_send(adapter->mgmt, MGMT_OP_SET_EXP_FEATURE, adapter->dev_id,
+ sizeof(cp), &cp, NULL, NULL, NULL);
+ info("update kernel quality report default adapter %d enable %d",
+ adapter->dev_id, cp.action);
+}
+
static void read_exp_features_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
@@ -240,3 +240,5 @@ enum kernel_features {
};
bool btd_has_kernel_features(uint32_t feature);
+
+void btd_adapter_update_kernel_quality_report(uint8_t action);