Bluetooth: Remove MGMT_ADDR_INVALID macro
authorAndre Guedes <andre.guedes@openbossa.org>
Tue, 3 Apr 2012 11:46:54 +0000 (08:46 -0300)
committerGustavo Padovan <gustavo@padovan.org>
Wed, 9 May 2012 03:41:37 +0000 (00:41 -0300)
This patch removes the MGMT_ADDR_INVALID macro. If the address type
isn't LE, we consider it is BR/EDR type.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
include/net/bluetooth/hci_core.h
net/bluetooth/mgmt.c

index f7cf928ab6ff0c840c1bec502f70484f9bc3b8d9..afdea9530d7b33a1bd16b6d4e4b1130b65b084a6 100644 (file)
@@ -968,7 +968,6 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event);
 #define MGMT_ADDR_BREDR                        0x00
 #define MGMT_ADDR_LE_PUBLIC            0x01
 #define MGMT_ADDR_LE_RANDOM            0x02
-#define MGMT_ADDR_INVALID              0xff
 
 #define DISCOV_TYPE_BREDR              (BIT(MGMT_ADDR_BREDR))
 #define DISCOV_TYPE_LE                 (BIT(MGMT_ADDR_LE_PUBLIC) | \
index 1ec16721ed7aec3d8488dd44995ad88190e1c822..5e80c6db6ae75d3a2bd1278bb3f168dc73f57740 100644 (file)
@@ -1640,15 +1640,15 @@ static u8 link_to_mgmt(u8 link_type, u8 addr_type)
                switch (addr_type) {
                case ADDR_LE_DEV_PUBLIC:
                        return MGMT_ADDR_LE_PUBLIC;
-               case ADDR_LE_DEV_RANDOM:
-                       return MGMT_ADDR_LE_RANDOM;
+
                default:
-                       return MGMT_ADDR_INVALID;
+                       /* Fallback to LE Random address type */
+                       return MGMT_ADDR_LE_RANDOM;
                }
-       case ACL_LINK:
-               return MGMT_ADDR_BREDR;
+
        default:
-               return MGMT_ADDR_INVALID;
+               /* Fallback to BR/EDR type */
+               return MGMT_ADDR_BREDR;
        }
 }
 
@@ -1690,7 +1690,7 @@ static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data,
                        continue;
                bacpy(&rp->addr[i].bdaddr, &c->dst);
                rp->addr[i].type = link_to_mgmt(c->type, c->dst_type);
-               if (rp->addr[i].type == MGMT_ADDR_INVALID)
+               if (c->type == SCO_LINK || c->type == ESCO_LINK)
                        continue;
                i++;
        }
This page took 0.027873 seconds and 5 git commands to generate.