When doing remote name request, we cannot scan. In the normal case it's OK since we can expect it to finish within a short amount of time. However, there is a possibility to scan lots of devices that (1) requires Remote Name Resolve (2) is unresponsive to Remote Name Resolve When this happens, we are stuck to do Remote Name Resolve until all is done before continue scanning. This patch adds a time limit to stop us spending too long on remote name request.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -88,6 +88,7 @@ struct discovery_state { · 87 unmodified lines | ||
| 88 | 88 | u8 (*uuids)[16]; |
| 89 | 89 | unsigned long scan_start; |
| 90 | 90 | unsigned long scan_duration; |
| 91 | + unsigned long name_resolve_timeout; | |
| 91 | 92 | }; |
| 92 | 93 | |
| 93 | 94 | #define SUSPEND_NOTIFIER_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
| @@ -1759,6 +1760,8 @@ void hci_mgmt_chan_unregister(struct hci_mgmt_chan *c); · 1665 unmodified lines | ||
| 1759 | 1760 | #define DISCOV_LE_FAST_ADV_INT_MIN 0x00A0 /* 100 msec */ |
| 1760 | 1761 | #define DISCOV_LE_FAST_ADV_INT_MAX 0x00F0 /* 150 msec */ |
| 1761 | 1762 | |
| 1763 | +#define NAME_RESOLVE_DURATION msecs_to_jiffies(10240) /* 10.24 sec */ | |
| 1764 | + | |
| 1762 | 1765 | void mgmt_fill_version_info(void *ver); |
| 1763 | 1766 | int mgmt_new_settings(struct hci_dev *hdev); |
| 1764 | 1767 | void mgmt_index_added(struct hci_dev *hdev); |