]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Bluetooth: Remove magic bluetooth version numbers
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Thu, 1 Dec 2011 12:33:27 +0000 (14:33 +0200)
committerGustavo F. Padovan <padovan@profusion.mobi>
Fri, 2 Dec 2011 23:27:58 +0000 (08:27 +0900)
Use bluetooth names instead of BT SIG assigned numbers

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
include/net/bluetooth/bluetooth.h
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c

index 38cd3dab7f1d297359c1b94356f93e13d2012fb9..97264fc8feebf3a017e70930383eed3027febc07 100644 (file)
 #define PF_BLUETOOTH   AF_BLUETOOTH
 #endif
 
+/* Bluetooth versions */
+#define BLUETOOTH_VER_1_1      1
+#define BLUETOOTH_VER_1_2      2
+#define BLUETOOTH_VER_2_0      3
+
 /* Reserv for core and drivers use */
 #define BT_SKB_RESERVE 8
 
index de0b93e45980138235044550be69f960cd8cf9ab..b328ac611ccdf370e9a8c6b9c8fa96f218622b59 100644 (file)
@@ -123,7 +123,7 @@ static void hci_acl_connect_cancel(struct hci_conn *conn)
 
        BT_DBG("%p", conn);
 
-       if (conn->hdev->hci_ver < 2)
+       if (conn->hdev->hci_ver < BLUETOOTH_VER_1_2)
                return;
 
        bacpy(&cp.bdaddr, &conn->dst);
index e3f7a8192446db980de57d01071027600156e5c5..a3e83aa92ecddcb146ea3131525850b668fb5979 100644 (file)
@@ -500,7 +500,7 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
 
        /* CSR 1.1 dongles does not accept any bitfield so don't try to set
         * any event mask for pre 1.2 devices */
-       if (hdev->lmp_ver <= 1)
+       if (hdev->lmp_ver <= BLUETOOTH_VER_1_1)
                return;
 
        events[4] |= 0x01; /* Flow Specification Complete */
@@ -564,7 +564,7 @@ static void hci_setup(struct hci_dev *hdev)
 {
        hci_setup_event_mask(hdev);
 
-       if (hdev->hci_ver > 1)
+       if (hdev->hci_ver > BLUETOOTH_VER_1_1)
                hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL);
 
        if (hdev->features[6] & LMP_SIMPLE_PAIR) {
@@ -1558,7 +1558,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
                }
 
                /* Set packet type for incoming connection */
-               if (!conn->out && hdev->hci_ver < 3) {
+               if (!conn->out && hdev->hci_ver < BLUETOOTH_VER_2_0) {
                        struct hci_cp_change_conn_ptype cp;
                        cp.handle = ev->handle;
                        cp.pkt_type = cpu_to_le16(conn->pkt_type);