Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d861d8b authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Marcel Holtmann
Browse files

Bluetooth: Make hci_send_sco() void



It also removes an unneeded check for the MTU. The check is done before
on sco_send_frame()

Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: default avatarJoão Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 4f7ac181
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -637,7 +637,7 @@ int hci_unregister_notifier(struct notifier_block *nb);

int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param);
int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags);
int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);
void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);

void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode);

+1 −8
Original line number Diff line number Diff line
@@ -1308,18 +1308,13 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
EXPORT_SYMBOL(hci_send_acl);

/* Send SCO data */
int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)
void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)
{
	struct hci_dev *hdev = conn->hdev;
	struct hci_sco_hdr hdr;

	BT_DBG("%s len %d", hdev->name, skb->len);

	if (skb->len > hdev->sco_mtu) {
		kfree_skb(skb);
		return -EINVAL;
	}

	hdr.handle = cpu_to_le16(conn->handle);
	hdr.dlen   = skb->len;

@@ -1332,8 +1327,6 @@ int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)

	skb_queue_tail(&conn->data_q, skb);
	tasklet_schedule(&hdev->tx_task);

	return 0;
}
EXPORT_SYMBOL(hci_send_sco);

+1 −2
Original line number Diff line number Diff line
@@ -249,8 +249,7 @@ static inline int sco_send_frame(struct sock *sk, struct msghdr *msg, int len)
		goto fail;
	}

	if ((err = hci_send_sco(conn->hcon, skb)) < 0)
		return err;
	hci_send_sco(conn->hcon, skb);

	return count;