Re: [PATCH 2/4] Bluetooth: mgmt: Add support for Set Link Security command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Feb 17, 2012, johan.hedberg@xxxxxxxxx wrote:
> +	hdev = hci_dev_get(index);
> +	if (!hdev)
> +		return cmd_status(sk, index, MGMT_OP_SET_LINK_SECURITY,
> +						MGMT_STATUS_INVALID_PARAMS);
> +
> +	hci_dev_lock(hdev);
> +
> +	if (mgmt_pending_find(MGMT_OP_SET_LINK_SECURITY, hdev)) {
> +		err = cmd_status(sk, index, MGMT_OP_SET_LINK_SECURITY,
> +							MGMT_STATUS_BUSY);
> +		goto failed;
> +	}
> +
> +	val = !!cp->val;
> +
> +	if (test_bit(HCI_AUTH, &hdev->flags) == val) {
> +		err = send_settings_rsp(sk, MGMT_OP_SET_LINK_SECURITY, hdev);
> +		goto failed;
> +	}
> +
> +	cmd = mgmt_pending_add(sk, MGMT_OP_SET_LINK_SECURITY, hdev, data, len);
> +	if (!cmd) {
> +		err = -ENOMEM;
> +		goto failed;
> +	}
> +
> +	err = hci_send_cmd(hdev, HCI_OP_WRITE_AUTH_ENABLE, sizeof(val), &val);
> +	if (err < 0) {
> +		mgmt_pending_remove(cmd);
> +		goto failed;
> +	}

There's a missing check for HCI_UP here as well as in the corresponding
place of patch 3/4. I'll send v2's of 2/4 and 3/4 as a new patch-set
(1/4 and 4/4 are quite trivial so I wont bother resending them).

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux