mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	Bluetooth: Add quirk for broken READ_VOICE_SETTING
Some fake controllers cannot be initialized because they return a smaller report than expected for READ_VOICE_SETTING. Signed-off-by: Pedro Nishiyama <nishiyama.pedro@gmail.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
		
							parent
							
								
									b9465e6670
								
							
						
					
					
						commit
						ff26b2dd65
					
				
					 3 changed files with 15 additions and 0 deletions
				
			
		| 
						 | 
					@ -354,6 +354,14 @@ enum {
 | 
				
			||||||
	 * during the hdev->setup vendor callback.
 | 
						 * during the hdev->setup vendor callback.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY,
 | 
						HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* When this quirk is set, the HCI_OP_READ_VOICE_SETTING command is
 | 
				
			||||||
 | 
						 * skipped. This is required for a subset of the CSR controller clones
 | 
				
			||||||
 | 
						 * which erroneously claim to support it.
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * This quirk must be set before hci_register_dev is called.
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						HCI_QUIRK_BROKEN_READ_VOICE_SETTING,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* HCI device flags */
 | 
					/* HCI device flags */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1925,6 +1925,10 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
 | 
				
			||||||
	((dev)->commands[20] & 0x10 && \
 | 
						((dev)->commands[20] & 0x10 && \
 | 
				
			||||||
	 !test_bit(HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE, &hdev->quirks))
 | 
						 !test_bit(HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE, &hdev->quirks))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define read_voice_setting_capable(dev) \
 | 
				
			||||||
 | 
						((dev)->commands[9] & 0x04 && \
 | 
				
			||||||
 | 
						 !test_bit(HCI_QUIRK_BROKEN_READ_VOICE_SETTING, &(dev)->quirks))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Use enhanced synchronous connection if command is supported and its quirk
 | 
					/* Use enhanced synchronous connection if command is supported and its quirk
 | 
				
			||||||
 * has not been set.
 | 
					 * has not been set.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3696,6 +3696,9 @@ static int hci_read_local_name_sync(struct hci_dev *hdev)
 | 
				
			||||||
/* Read Voice Setting */
 | 
					/* Read Voice Setting */
 | 
				
			||||||
static int hci_read_voice_setting_sync(struct hci_dev *hdev)
 | 
					static int hci_read_voice_setting_sync(struct hci_dev *hdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						if (!read_voice_setting_capable(hdev))
 | 
				
			||||||
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return __hci_cmd_sync_status(hdev, HCI_OP_READ_VOICE_SETTING,
 | 
						return __hci_cmd_sync_status(hdev, HCI_OP_READ_VOICE_SETTING,
 | 
				
			||||||
				     0, NULL, HCI_CMD_TIMEOUT);
 | 
									     0, NULL, HCI_CMD_TIMEOUT);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue