Exemple #1
0
int btintel_set_diag(struct hci_dev *hdev, bool enable)
{
	struct sk_buff *skb;
	u8 param[3];
	int err;

	if (enable) {
		param[0] = 0x03;
		param[1] = 0x03;
		param[2] = 0x03;
	} else {
		param[0] = 0x00;
		param[1] = 0x00;
		param[2] = 0x00;
	}

	skb = __hci_cmd_sync(hdev, 0xfc43, 3, param, HCI_INIT_TIMEOUT);
	if (IS_ERR(skb)) {
		err = PTR_ERR(skb);
		if (err == -ENODATA)
			goto done;
		BT_ERR("%s: Changing Intel diagnostic mode failed (%d)",
		       hdev->name, err);
		return err;
	}
	kfree_skb(skb);

done:
	btintel_set_event_mask(hdev, enable);
	return 0;
}
Exemple #2
0
int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug)
{
	struct sk_buff *skb;
	u8 param[2];
	int err;

	param[0] = 0x01;
	param[1] = 0x00;

	skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_INIT_TIMEOUT);
	if (IS_ERR(skb)) {
		err = PTR_ERR(skb);
		BT_ERR("%s: Entering Intel manufacturer mode failed (%d)",
		       hdev->name, err);
		return PTR_ERR(skb);
	}
	kfree_skb(skb);

	err = btintel_set_event_mask(hdev, debug);

	param[0] = 0x00;
	param[1] = 0x00;

	skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_INIT_TIMEOUT);
	if (IS_ERR(skb)) {
		err = PTR_ERR(skb);
		BT_ERR("%s: Leaving Intel manufacturer mode failed (%d)",
		       hdev->name, err);
		return PTR_ERR(skb);
	}
	kfree_skb(skb);

	return err;
}
Exemple #3
0
int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug)
{
	int err, ret;

	err = btintel_enter_mfg(hdev);
	if (err)
		return err;

	ret = btintel_set_event_mask(hdev, debug);

	err = btintel_exit_mfg(hdev, false, false);
	if (err)
		return err;

	return ret;
}