@@ -7460,6 +7460,17 @@ const uint8_t *btdev_get_adv_addr(struct btdev *btdev, uint8_t handle)
return ext_adv_addr(btdev, ext_adv);
}
+void btdev_get_mtu(struct btdev *btdev, uint16_t *acl, uint16_t *sco,
+ uint16_t *iso)
+{
+ if (acl)
+ *acl = btdev->acl_mtu;
+ if (sco)
+ *acl = btdev->sco_mtu;
+ if (iso)
+ *iso = btdev->iso_mtu;
+}
+
void btdev_set_le_states(struct btdev *btdev, const uint8_t *le_states)
{
memcpy(btdev->le_states, le_states, sizeof(btdev->le_states));
@@ -84,6 +84,9 @@ uint8_t btdev_get_le_scan_enable(struct btdev *btdev);
const uint8_t *btdev_get_adv_addr(struct btdev *btdev, uint8_t handle);
+void btdev_get_mtu(struct btdev *btdev, uint16_t *acl, uint16_t *sco,
+ uint16_t *iso);
+
void btdev_set_le_states(struct btdev *btdev, const uint8_t *le_states);
void btdev_set_al_len(struct btdev *btdev, uint8_t len);
@@ -308,6 +308,7 @@ static struct hciemu_client *hciemu_client_new(struct hciemu *hciemu,
{
struct hciemu_client *client;
int sv[2];
+ uint16_t mtu;
client = new0(struct hciemu_client, 1);
if (!client)
@@ -342,6 +343,9 @@ static struct hciemu_client *hciemu_client_new(struct hciemu *hciemu,
client->host_source = create_source_bthost(sv[1], client->host);
client->start_source = g_idle_add(start_host, client);
+ btdev_get_mtu(client->dev, &mtu, NULL, NULL);
+ bthost_set_acl_mtu(client->host, mtu);
+
return client;
}