Skip to content

Commit 5bddb21

Browse files
committed
Bluetooth: revert TX timestamping
JIRA: https://issues.redhat.com/browse/RHEL-107923 Upstream Status: RHEL-only The following upstream commits: 134f4b3 Bluetooth: add support for skb TX SND/COMPLETION timestamping d415ba2 Bluetooth: ISO: add TX timestamping 11770f4 Bluetooth: L2CAP: add TX timestamping bdbcd52 Bluetooth: SCO: add TX timestamping c174cd0 Bluetooth: increment TX timestamping tskey always for stream sockets 3908feb Bluetooth: L2CAP: copy RX timestamp to new fragments dd0ccf8 Bluetooth: add support for SIOCETHTOOL ETHTOOL_GET_TS_INFO ee3e420 Bluetooth: btmtksdio: Fix wakeup source leaks on device unbind ba6535e Bluetooth: btmrvl_sdio: Fix wakeup source leaks on device unbind require commits that are not yet part of the Common Network Backport, but are scheduled to be included in RHEL-9.8, so temporarily remove them so the Bluetooth rebase build can be completed. reference: https://issues.redhat.com/browse/RHEL-101337 CNB98: net_tstamp: add SCM_TS_OPT_ID to provide OPT_ID in control message Note - These commits were reverted at the end rather than being omitted, since they impact the context of later commits in the rebase. Once RHEL-101337 is merged, this can be reverted. Signed-off-by: David Marlin <dmarlin@redhat.com>
1 parent 3be9c87 commit 5bddb21

File tree

15 files changed

+19
-388
lines changed

15 files changed

+19
-388
lines changed

drivers/bluetooth/btmrvl_sdio.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ static int btmrvl_sdio_probe_of(struct device *dev,
100100
}
101101

102102
/* Configure wakeup (enabled by default) */
103-
ret = devm_device_init_wakeup(dev);
104-
if (ret)
105-
return dev_err_probe(dev, ret, "Failed to init wakeup\n");
103+
device_init_wakeup(dev, true);
106104
}
107105
}
108106

drivers/bluetooth/btmtksdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ static int btmtksdio_probe(struct sdio_func *func,
14191419
*/
14201420
pm_runtime_put_noidle(bdev->dev);
14211421

1422-
err = devm_device_init_wakeup(bdev->dev);
1422+
err = device_init_wakeup(bdev->dev, true);
14231423
if (err)
14241424
bt_dev_err(hdev, "failed to initialize device wakeup");
14251425

include/net/bluetooth/bluetooth.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <linux/poll.h>
3030
#include <net/sock.h>
3131
#include <linux/seq_file.h>
32-
#include <linux/ethtool.h>
3332

3433
#define BT_SUBSYS_VERSION 2
3534
#define BT_SUBSYS_REVISION 22
@@ -157,7 +156,6 @@ struct bt_voice {
157156
#define BT_PKT_STATUS 16
158157

159158
#define BT_SCM_PKT_STATUS 0x03
160-
#define BT_SCM_ERROR 0x04
161159

162160
#define BT_ISO_QOS 17
163161

@@ -449,9 +447,6 @@ void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status,
449447
hci_req_complete_t *req_complete,
450448
hci_req_complete_skb_t *req_complete_skb);
451449

452-
int hci_ethtool_ts_info(unsigned int index, int sk_proto,
453-
struct kernel_ethtool_ts_info *ts_info);
454-
455450
#define HCI_REQ_START BIT(0)
456451
#define HCI_REQ_SKB BIT(1)
457452

include/net/bluetooth/hci_core.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,6 @@ struct adv_info {
266266
struct delayed_work rpa_expired_cb;
267267
};
268268

269-
struct tx_queue {
270-
struct sk_buff_head queue;
271-
unsigned int extra;
272-
unsigned int tracked;
273-
};
274-
275269
#define HCI_MAX_ADV_INSTANCES 5
276270
#define HCI_DEFAULT_ADV_DURATION 2
277271

@@ -752,8 +746,6 @@ struct hci_conn {
752746
struct sk_buff_head data_q;
753747
struct list_head chan_list;
754748

755-
struct tx_queue tx_q;
756-
757749
struct delayed_work disc_work;
758750
struct delayed_work auto_accept_work;
759751
struct delayed_work idle_work;
@@ -1606,18 +1598,6 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active);
16061598
void hci_conn_failed(struct hci_conn *conn, u8 status);
16071599
u8 hci_conn_set_handle(struct hci_conn *conn, u16 handle);
16081600

1609-
void hci_conn_tx_queue(struct hci_conn *conn, struct sk_buff *skb);
1610-
void hci_conn_tx_dequeue(struct hci_conn *conn);
1611-
void hci_setup_tx_timestamp(struct sk_buff *skb, size_t key_offset,
1612-
const struct sockcm_cookie *sockc);
1613-
1614-
static inline void hci_sockcm_init(struct sockcm_cookie *sockc, struct sock *sk)
1615-
{
1616-
*sockc = (struct sockcm_cookie) {
1617-
.tsflags = READ_ONCE(sk->sk_tsflags),
1618-
};
1619-
}
1620-
16211601
/*
16221602
* hci_conn_get() and hci_conn_put() are used to control the life-time of an
16231603
* "hci_conn" object. They do not guarantee that the hci_conn object is running,

include/net/bluetooth/l2cap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,8 +955,7 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason);
955955
int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
956956
bdaddr_t *dst, u8 dst_type, u16 timeout);
957957
int l2cap_chan_reconfigure(struct l2cap_chan *chan, __u16 mtu);
958-
int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len,
959-
const struct sockcm_cookie *sockc);
958+
int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
960959
void l2cap_chan_busy(struct l2cap_chan *chan, int busy);
961960
void l2cap_chan_rx_avail(struct l2cap_chan *chan, ssize_t rx_avail);
962961
int l2cap_chan_check_security(struct l2cap_chan *chan, bool initiator);

net/bluetooth/6lowpan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ static int send_pkt(struct l2cap_chan *chan, struct sk_buff *skb,
443443
memset(&msg, 0, sizeof(msg));
444444
iov_iter_kvec(&msg.msg_iter, ITER_SOURCE, &iv, 1, skb->len);
445445

446-
err = l2cap_chan_send(chan, &msg, skb->len, NULL);
446+
err = l2cap_chan_send(chan, &msg, skb->len);
447447
if (err > 0) {
448448
netdev->stats.tx_bytes += err;
449449
netdev->stats.tx_packets++;

net/bluetooth/af_bluetooth.c

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
#include <net/bluetooth/bluetooth.h>
3535
#include <linux/proc_fs.h>
3636

37-
#include <linux/ethtool.h>
38-
#include <linux/sockios.h>
39-
4037
#include "leds.h"
4138
#include "selftest.h"
4239

@@ -566,86 +563,6 @@ __poll_t bt_sock_poll(struct file *file, struct socket *sock,
566563
}
567564
EXPORT_SYMBOL(bt_sock_poll);
568565

569-
static int bt_ethtool_get_ts_info(struct sock *sk, unsigned int index,
570-
void __user *useraddr)
571-
{
572-
struct ethtool_ts_info info;
573-
struct kernel_ethtool_ts_info ts_info = {};
574-
int ret;
575-
576-
ret = hci_ethtool_ts_info(index, sk->sk_protocol, &ts_info);
577-
if (ret == -ENODEV)
578-
return ret;
579-
else if (ret < 0)
580-
return -EIO;
581-
582-
memset(&info, 0, sizeof(info));
583-
584-
info.cmd = ETHTOOL_GET_TS_INFO;
585-
info.so_timestamping = ts_info.so_timestamping;
586-
info.phc_index = ts_info.phc_index;
587-
info.tx_types = ts_info.tx_types;
588-
info.rx_filters = ts_info.rx_filters;
589-
590-
if (copy_to_user(useraddr, &info, sizeof(info)))
591-
return -EFAULT;
592-
593-
return 0;
594-
}
595-
596-
static int bt_ethtool(struct sock *sk, const struct ifreq *ifr,
597-
void __user *useraddr)
598-
{
599-
unsigned int index;
600-
u32 ethcmd;
601-
int n;
602-
603-
if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
604-
return -EFAULT;
605-
606-
if (sscanf(ifr->ifr_name, "hci%u%n", &index, &n) != 1 ||
607-
n != strlen(ifr->ifr_name))
608-
return -ENODEV;
609-
610-
switch (ethcmd) {
611-
case ETHTOOL_GET_TS_INFO:
612-
return bt_ethtool_get_ts_info(sk, index, useraddr);
613-
}
614-
615-
return -EOPNOTSUPP;
616-
}
617-
618-
static int bt_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg)
619-
{
620-
struct sock *sk = sock->sk;
621-
struct ifreq ifr = {};
622-
void __user *data;
623-
char *colon;
624-
int ret = -ENOIOCTLCMD;
625-
626-
if (get_user_ifreq(&ifr, &data, arg))
627-
return -EFAULT;
628-
629-
ifr.ifr_name[IFNAMSIZ - 1] = 0;
630-
colon = strchr(ifr.ifr_name, ':');
631-
if (colon)
632-
*colon = 0;
633-
634-
switch (cmd) {
635-
case SIOCETHTOOL:
636-
ret = bt_ethtool(sk, &ifr, data);
637-
break;
638-
}
639-
640-
if (colon)
641-
*colon = ':';
642-
643-
if (put_user_ifreq(&ifr, arg))
644-
return -EFAULT;
645-
646-
return ret;
647-
}
648-
649566
int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
650567
{
651568
struct sock *sk = sock->sk;
@@ -678,10 +595,6 @@ int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
678595
err = put_user(amount, (int __user *)arg);
679596
break;
680597

681-
case SIOCETHTOOL:
682-
err = bt_dev_ioctl(sock, cmd, (void __user *)arg);
683-
break;
684-
685598
default:
686599
err = -ENOIOCTLCMD;
687600
break;

0 commit comments

Comments
 (0)