Commit a241baed authored by Marcel Holtmann's avatar Marcel Holtmann

[Bluetooth] Change inquiry_cache to hci_inquiry_cache

This patch changes the inquiry_* functions to be either local to hci_core.c
or change name from inquiry_cache_lookup to hci_inquiry_cache_lookup to try
and reduce the potential for namespace conflicts. There could be USB or SCSI
or other code that uses an inquiry_cache.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a56c56e7
...@@ -195,10 +195,8 @@ static inline long inquiry_entry_age(struct inquiry_entry *e) ...@@ -195,10 +195,8 @@ static inline long inquiry_entry_age(struct inquiry_entry *e)
return jiffies - e->timestamp; return jiffies - e->timestamp;
} }
struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info); void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info);
void inquiry_cache_flush(struct hci_dev *hdev);
int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf);
/* ----- HCI Connections ----- */ /* ----- HCI Connections ----- */
enum { enum {
......
...@@ -69,7 +69,7 @@ void hci_acl_connect(struct hci_conn *conn) ...@@ -69,7 +69,7 @@ void hci_acl_connect(struct hci_conn *conn)
bacpy(&cp.bdaddr, &conn->dst); bacpy(&cp.bdaddr, &conn->dst);
cp.pscan_rep_mode = 0x02; cp.pscan_rep_mode = 0x02;
if ((ie = inquiry_cache_lookup(hdev, &conn->dst)) && if ((ie = hci_inquiry_cache_lookup(hdev, &conn->dst)) &&
inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) { inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) {
cp.pscan_rep_mode = ie->info.pscan_rep_mode; cp.pscan_rep_mode = ie->info.pscan_rep_mode;
cp.pscan_mode = ie->info.pscan_mode; cp.pscan_mode = ie->info.pscan_mode;
......
...@@ -287,7 +287,7 @@ struct hci_dev *hci_dev_get(int index) ...@@ -287,7 +287,7 @@ struct hci_dev *hci_dev_get(int index)
EXPORT_SYMBOL(hci_dev_get); EXPORT_SYMBOL(hci_dev_get);
/* ---- Inquiry support ---- */ /* ---- Inquiry support ---- */
void inquiry_cache_flush(struct hci_dev *hdev) static void inquiry_cache_flush(struct hci_dev *hdev)
{ {
struct inquiry_cache *cache = &hdev->inq_cache; struct inquiry_cache *cache = &hdev->inq_cache;
struct inquiry_entry *next = cache->list, *e; struct inquiry_entry *next = cache->list, *e;
...@@ -301,7 +301,7 @@ void inquiry_cache_flush(struct hci_dev *hdev) ...@@ -301,7 +301,7 @@ void inquiry_cache_flush(struct hci_dev *hdev)
} }
} }
struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr) struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)
{ {
struct inquiry_cache *cache = &hdev->inq_cache; struct inquiry_cache *cache = &hdev->inq_cache;
struct inquiry_entry *e; struct inquiry_entry *e;
...@@ -314,14 +314,14 @@ struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdadd ...@@ -314,14 +314,14 @@ struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdadd
return e; return e;
} }
void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info) void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info)
{ {
struct inquiry_cache *cache = &hdev->inq_cache; struct inquiry_cache *cache = &hdev->inq_cache;
struct inquiry_entry *e; struct inquiry_entry *e;
BT_DBG("cache %p, %s", cache, batostr(&info->bdaddr)); BT_DBG("cache %p, %s", cache, batostr(&info->bdaddr));
if (!(e = inquiry_cache_lookup(hdev, &info->bdaddr))) { if (!(e = hci_inquiry_cache_lookup(hdev, &info->bdaddr))) {
/* Entry not in the cache. Add new one. */ /* Entry not in the cache. Add new one. */
if (!(e = kmalloc(sizeof(struct inquiry_entry), GFP_ATOMIC))) if (!(e = kmalloc(sizeof(struct inquiry_entry), GFP_ATOMIC)))
return; return;
...@@ -335,7 +335,7 @@ void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info) ...@@ -335,7 +335,7 @@ void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info)
cache->timestamp = jiffies; cache->timestamp = jiffies;
} }
int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf) static int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf)
{ {
struct inquiry_cache *cache = &hdev->inq_cache; struct inquiry_cache *cache = &hdev->inq_cache;
struct inquiry_info *info = (struct inquiry_info *) buf; struct inquiry_info *info = (struct inquiry_info *) buf;
......
...@@ -486,7 +486,7 @@ static inline void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff * ...@@ -486,7 +486,7 @@ static inline void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *
hci_dev_lock(hdev); hci_dev_lock(hdev);
for (; num_rsp; num_rsp--) for (; num_rsp; num_rsp--)
inquiry_cache_update(hdev, info++); hci_inquiry_cache_update(hdev, info++);
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
} }
...@@ -508,7 +508,7 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct ...@@ -508,7 +508,7 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
memcpy(tmp.dev_class, &info->dev_class, 3); memcpy(tmp.dev_class, &info->dev_class, 3);
tmp.clock_offset = info->clock_offset; tmp.clock_offset = info->clock_offset;
info++; info++;
inquiry_cache_update(hdev, &tmp); hci_inquiry_cache_update(hdev, &tmp);
} }
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment