mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-23 10:06:28 +08:00
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
This commit is contained in:
commit
8a3a320302
@ -489,7 +489,7 @@ static int btintel_version_info_tlv(struct hci_dev *hdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (version->img_type) {
|
switch (version->img_type) {
|
||||||
case 0x01:
|
case BTINTEL_IMG_BOOTLOADER:
|
||||||
variant = "Bootloader";
|
variant = "Bootloader";
|
||||||
/* It is required that every single firmware fragment is acknowledged
|
/* It is required that every single firmware fragment is acknowledged
|
||||||
* with a command complete event. If the boot parameters indicate
|
* with a command complete event. If the boot parameters indicate
|
||||||
@ -521,7 +521,10 @@ static int btintel_version_info_tlv(struct hci_dev *hdev,
|
|||||||
version->min_fw_build_nn, version->min_fw_build_cw,
|
version->min_fw_build_nn, version->min_fw_build_cw,
|
||||||
2000 + version->min_fw_build_yy);
|
2000 + version->min_fw_build_yy);
|
||||||
break;
|
break;
|
||||||
case 0x03:
|
case BTINTEL_IMG_IML:
|
||||||
|
variant = "Intermediate loader";
|
||||||
|
break;
|
||||||
|
case BTINTEL_IMG_OP:
|
||||||
variant = "Firmware";
|
variant = "Firmware";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -535,7 +538,7 @@ static int btintel_version_info_tlv(struct hci_dev *hdev,
|
|||||||
bt_dev_info(hdev, "%s timestamp %u.%u buildtype %u build %u", variant,
|
bt_dev_info(hdev, "%s timestamp %u.%u buildtype %u build %u", variant,
|
||||||
2000 + (version->timestamp >> 8), version->timestamp & 0xff,
|
2000 + (version->timestamp >> 8), version->timestamp & 0xff,
|
||||||
version->build_type, version->build_num);
|
version->build_type, version->build_num);
|
||||||
if (version->img_type == 0x03)
|
if (version->img_type == BTINTEL_IMG_OP)
|
||||||
bt_dev_info(hdev, "Firmware SHA1: 0x%8.8x", version->git_sha1);
|
bt_dev_info(hdev, "Firmware SHA1: 0x%8.8x", version->git_sha1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1172,7 +1175,7 @@ static int btintel_download_fw_tlv(struct hci_dev *hdev,
|
|||||||
* If the firmware version has changed that means it needs to be reset
|
* If the firmware version has changed that means it needs to be reset
|
||||||
* to bootloader when operational so the new firmware can be loaded.
|
* to bootloader when operational so the new firmware can be loaded.
|
||||||
*/
|
*/
|
||||||
if (ver->img_type == 0x03)
|
if (ver->img_type == BTINTEL_IMG_OP)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* iBT hardware variants 0x0b, 0x0c, 0x11, 0x12, 0x13, 0x14 support
|
/* iBT hardware variants 0x0b, 0x0c, 0x11, 0x12, 0x13, 0x14 support
|
||||||
@ -2194,10 +2197,26 @@ static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver,
|
|||||||
char *fw_name, size_t len,
|
char *fw_name, size_t len,
|
||||||
const char *suffix)
|
const char *suffix)
|
||||||
{
|
{
|
||||||
|
const char *format;
|
||||||
/* The firmware file name for new generation controllers will be
|
/* The firmware file name for new generation controllers will be
|
||||||
* ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step>
|
* ibt-<cnvi_top type+cnvi_top step>-<cnvr_top type+cnvr_top step>
|
||||||
*/
|
*/
|
||||||
snprintf(fw_name, len, "intel/ibt-%04x-%04x.%s",
|
switch (ver->cnvi_top & 0xfff) {
|
||||||
|
/* Only Blazar product supports downloading of intermediate loader
|
||||||
|
* image
|
||||||
|
*/
|
||||||
|
case BTINTEL_CNVI_BLAZARI:
|
||||||
|
if (ver->img_type == BTINTEL_IMG_BOOTLOADER)
|
||||||
|
format = "intel/ibt-%04x-%04x-iml.%s";
|
||||||
|
else
|
||||||
|
format = "intel/ibt-%04x-%04x.%s";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
format = "intel/ibt-%04x-%04x.%s";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
snprintf(fw_name, len, format,
|
||||||
INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvi_top),
|
INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvi_top),
|
||||||
INTEL_CNVX_TOP_STEP(ver->cnvi_top)),
|
INTEL_CNVX_TOP_STEP(ver->cnvi_top)),
|
||||||
INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvr_top),
|
INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvr_top),
|
||||||
@ -2230,7 +2249,7 @@ static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev,
|
|||||||
* It is not possible to use the Secure Boot Parameters in this
|
* It is not possible to use the Secure Boot Parameters in this
|
||||||
* case since that command is only available in bootloader mode.
|
* case since that command is only available in bootloader mode.
|
||||||
*/
|
*/
|
||||||
if (ver->img_type == 0x03) {
|
if (ver->img_type == BTINTEL_IMG_OP) {
|
||||||
btintel_clear_flag(hdev, INTEL_BOOTLOADER);
|
btintel_clear_flag(hdev, INTEL_BOOTLOADER);
|
||||||
btintel_check_bdaddr(hdev);
|
btintel_check_bdaddr(hdev);
|
||||||
} else {
|
} else {
|
||||||
@ -2600,13 +2619,30 @@ static int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
/* check if controller is already having an operational firmware */
|
/* check if controller is already having an operational firmware */
|
||||||
if (ver->img_type == 0x03)
|
if (ver->img_type == BTINTEL_IMG_OP)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
err = btintel_boot(hdev, boot_param);
|
err = btintel_boot(hdev, boot_param);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
err = btintel_read_version_tlv(hdev, ver);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
/* If image type returned is BTINTEL_IMG_IML, then controller supports
|
||||||
|
* intermediae loader image
|
||||||
|
*/
|
||||||
|
if (ver->img_type == BTINTEL_IMG_IML) {
|
||||||
|
err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
err = btintel_boot(hdev, boot_param);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
btintel_clear_flag(hdev, INTEL_BOOTLOADER);
|
btintel_clear_flag(hdev, INTEL_BOOTLOADER);
|
||||||
|
|
||||||
btintel_get_fw_name_tlv(ver, ddcname, sizeof(ddcname), "ddc");
|
btintel_get_fw_name_tlv(ver, ddcname, sizeof(ddcname), "ddc");
|
||||||
|
@ -51,6 +51,12 @@ struct intel_tlv {
|
|||||||
u8 val[];
|
u8 val[];
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
#define BTINTEL_CNVI_BLAZARI 0x900
|
||||||
|
|
||||||
|
#define BTINTEL_IMG_BOOTLOADER 0x01 /* Bootloader image */
|
||||||
|
#define BTINTEL_IMG_IML 0x02 /* Intermediate image */
|
||||||
|
#define BTINTEL_IMG_OP 0x03 /* Operational image */
|
||||||
|
|
||||||
struct intel_version_tlv {
|
struct intel_version_tlv {
|
||||||
u32 cnvi_top;
|
u32 cnvi_top;
|
||||||
u32 cnvr_top;
|
u32 cnvr_top;
|
||||||
|
@ -617,6 +617,11 @@ static const struct usb_device_id quirks_table[] = {
|
|||||||
BTUSB_WIDEBAND_SPEECH |
|
BTUSB_WIDEBAND_SPEECH |
|
||||||
BTUSB_VALID_LE_STATES },
|
BTUSB_VALID_LE_STATES },
|
||||||
|
|
||||||
|
/* MediaTek MT7922 Bluetooth devices */
|
||||||
|
{ USB_DEVICE(0x13d3, 0x3585), .driver_info = BTUSB_MEDIATEK |
|
||||||
|
BTUSB_WIDEBAND_SPEECH |
|
||||||
|
BTUSB_VALID_LE_STATES },
|
||||||
|
|
||||||
/* MediaTek MT7922A Bluetooth devices */
|
/* MediaTek MT7922A Bluetooth devices */
|
||||||
{ USB_DEVICE(0x0489, 0xe0d8), .driver_info = BTUSB_MEDIATEK |
|
{ USB_DEVICE(0x0489, 0xe0d8), .driver_info = BTUSB_MEDIATEK |
|
||||||
BTUSB_WIDEBAND_SPEECH |
|
BTUSB_WIDEBAND_SPEECH |
|
||||||
|
@ -1451,8 +1451,8 @@ static bool check_ucast_qos(struct bt_iso_qos *qos)
|
|||||||
|
|
||||||
static bool check_bcast_qos(struct bt_iso_qos *qos)
|
static bool check_bcast_qos(struct bt_iso_qos *qos)
|
||||||
{
|
{
|
||||||
if (qos->bcast.sync_factor == 0x00)
|
if (!qos->bcast.sync_factor)
|
||||||
return false;
|
qos->bcast.sync_factor = 0x01;
|
||||||
|
|
||||||
if (qos->bcast.packing > 0x01)
|
if (qos->bcast.packing > 0x01)
|
||||||
return false;
|
return false;
|
||||||
@ -1475,6 +1475,9 @@ static bool check_bcast_qos(struct bt_iso_qos *qos)
|
|||||||
if (qos->bcast.skip > 0x01f3)
|
if (qos->bcast.skip > 0x01f3)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!qos->bcast.sync_timeout)
|
||||||
|
qos->bcast.sync_timeout = BT_ISO_SYNC_TIMEOUT;
|
||||||
|
|
||||||
if (qos->bcast.sync_timeout < 0x000a || qos->bcast.sync_timeout > 0x4000)
|
if (qos->bcast.sync_timeout < 0x000a || qos->bcast.sync_timeout > 0x4000)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -1484,6 +1487,9 @@ static bool check_bcast_qos(struct bt_iso_qos *qos)
|
|||||||
if (qos->bcast.mse > 0x1f)
|
if (qos->bcast.mse > 0x1f)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!qos->bcast.timeout)
|
||||||
|
qos->bcast.sync_timeout = BT_ISO_SYNC_TIMEOUT;
|
||||||
|
|
||||||
if (qos->bcast.timeout < 0x000a || qos->bcast.timeout > 0x4000)
|
if (qos->bcast.timeout < 0x000a || qos->bcast.timeout > 0x4000)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user