• Zhengping Jiang's avatar
    Bluetooth: hci_sync: Resume adv with no RPA when active scan · 3c44a431
    Zhengping Jiang authored
    The address resolution should be disabled during the active scan,
    so all the advertisements can reach the host. The advertising
    has to be paused before disabling the address resolution,
    because the advertising will prevent any changes to the resolving
    list and the address resolution status. Skipping this will cause
    the hci error and the discovery failure.
    
    According to the bluetooth specification:
    "7.8.44 LE Set Address Resolution Enable command
    
    This command shall not be used when:
    - Advertising (other than periodic advertising) is enabled,
    - Scanning is enabled, or
    - an HCI_LE_Create_Connection, HCI_LE_Extended_Create_Connection, or
      HCI_LE_Periodic_Advertising_Create_Sync command is outstanding."
    
    If the host is using RPA, the controller needs to generate RPA for
    the advertising, so the advertising must remain paused during the
    active scan.
    
    If the host is not using RPA, the advertising can be resumed after
    disabling the address resolution.
    
    Fixes: 9afc675e
    
     ("Bluetooth: hci_sync: allow advertise when scan without RPA")
    Signed-off-by: default avatarZhengping Jiang <jiangzp@google.com>
    Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
    3c44a431
hci_sync.c 161 KB