Bluetooth: Rename conn->pend to conn->flags
These flags can and will be used for more general purpose values than just pending state transitions so the more common name "flags" makes more sense than "pend". Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
1dc06093a9
commit
51a8efd7d0
5 changed files with 41 additions and 42 deletions
|
@ -337,7 +337,7 @@ static void hci_conn_enter_sniff_mode(struct hci_conn *conn)
|
|||
hci_send_cmd(hdev, HCI_OP_SNIFF_SUBRATE, sizeof(cp), &cp);
|
||||
}
|
||||
|
||||
if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
|
||||
if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->flags)) {
|
||||
struct hci_cp_sniff_mode cp;
|
||||
cp.handle = cpu_to_le16(conn->handle);
|
||||
cp.max_interval = cpu_to_le16(hdev->sniff_max_interval);
|
||||
|
@ -589,9 +589,9 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
|
|||
acl->power_save = 1;
|
||||
hci_conn_enter_active_mode(acl, BT_POWER_FORCE_ACTIVE_ON);
|
||||
|
||||
if (test_bit(HCI_CONN_MODE_CHANGE_PEND, &acl->pend)) {
|
||||
if (test_bit(HCI_CONN_MODE_CHANGE_PEND, &acl->flags)) {
|
||||
/* defer SCO setup until mode change completed */
|
||||
set_bit(HCI_CONN_SCO_SETUP_PEND, &acl->pend);
|
||||
set_bit(HCI_CONN_SCO_SETUP_PEND, &acl->flags);
|
||||
return sco;
|
||||
}
|
||||
|
||||
|
@ -633,13 +633,13 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
|
|||
|
||||
conn->auth_type = auth_type;
|
||||
|
||||
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
|
||||
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
|
||||
struct hci_cp_auth_requested cp;
|
||||
cp.handle = cpu_to_le16(conn->handle);
|
||||
hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
|
||||
sizeof(cp), &cp);
|
||||
if (conn->key_type != 0xff)
|
||||
set_bit(HCI_CONN_REAUTH_PEND, &conn->pend);
|
||||
set_bit(HCI_CONN_REAUTH_PEND, &conn->flags);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -650,7 +650,7 @@ static void hci_conn_encrypt(struct hci_conn *conn)
|
|||
{
|
||||
BT_DBG("conn %p", conn);
|
||||
|
||||
if (!test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) {
|
||||
if (!test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) {
|
||||
struct hci_cp_set_conn_encrypt cp;
|
||||
cp.handle = cpu_to_le16(conn->handle);
|
||||
cp.encrypt = 0x01;
|
||||
|
@ -700,7 +700,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
|
|||
goto encrypt;
|
||||
|
||||
auth:
|
||||
if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
|
||||
if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags))
|
||||
return 0;
|
||||
|
||||
if (!hci_conn_auth(conn, sec_level, auth_type))
|
||||
|
@ -735,7 +735,7 @@ int hci_conn_change_link_key(struct hci_conn *conn)
|
|||
{
|
||||
BT_DBG("conn %p", conn);
|
||||
|
||||
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
|
||||
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
|
||||
struct hci_cp_change_conn_link_key cp;
|
||||
cp.handle = cpu_to_le16(conn->handle);
|
||||
hci_send_cmd(conn->hdev, HCI_OP_CHANGE_CONN_LINK_KEY,
|
||||
|
@ -754,7 +754,7 @@ int hci_conn_switch_role(struct hci_conn *conn, __u8 role)
|
|||
if (!role && conn->link_mode & HCI_LM_MASTER)
|
||||
return 1;
|
||||
|
||||
if (!test_and_set_bit(HCI_CONN_RSWITCH_PEND, &conn->pend)) {
|
||||
if (!test_and_set_bit(HCI_CONN_RSWITCH_PEND, &conn->flags)) {
|
||||
struct hci_cp_switch_role cp;
|
||||
bacpy(&cp.bdaddr, &conn->dst);
|
||||
cp.role = role;
|
||||
|
@ -781,7 +781,7 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active)
|
|||
if (!conn->power_save && !force_active)
|
||||
goto timer;
|
||||
|
||||
if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {
|
||||
if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->flags)) {
|
||||
struct hci_cp_exit_sniff_mode cp;
|
||||
cp.handle = cpu_to_le16(conn->handle);
|
||||
hci_send_cmd(hdev, HCI_OP_EXIT_SNIFF_MODE, sizeof(cp), &cp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue