|
27 | 27 |
|
28 | 28 | #include <linux/export.h> |
29 | 29 | #include <linux/debugfs.h> |
30 | | -#include <linux/errqueue.h> |
31 | 30 |
|
32 | 31 | #include <net/bluetooth/bluetooth.h> |
33 | 32 | #include <net/bluetooth/hci_core.h> |
@@ -1003,7 +1002,6 @@ static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t |
1003 | 1002 | } |
1004 | 1003 |
|
1005 | 1004 | skb_queue_head_init(&conn->data_q); |
1006 | | - skb_queue_head_init(&conn->tx_q.queue); |
1007 | 1005 |
|
1008 | 1006 | INIT_LIST_HEAD(&conn->chan_list); |
1009 | 1007 | INIT_LIST_HEAD(&conn->link_list); |
@@ -1157,7 +1155,6 @@ void hci_conn_del(struct hci_conn *conn) |
1157 | 1155 | } |
1158 | 1156 |
|
1159 | 1157 | skb_queue_purge(&conn->data_q); |
1160 | | - skb_queue_purge(&conn->tx_q.queue); |
1161 | 1158 |
|
1162 | 1159 | /* Remove the connection from the list and cleanup its remaining |
1163 | 1160 | * state. This is a separate function since for some cases like |
@@ -2901,129 +2898,6 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason) |
2901 | 2898 | return hci_cmd_sync_run_once(hdev, abort_conn_sync, conn, NULL); |
2902 | 2899 | } |
2903 | 2900 |
|
2904 | | -void hci_setup_tx_timestamp(struct sk_buff *skb, size_t key_offset, |
2905 | | - const struct sockcm_cookie *sockc) |
2906 | | -{ |
2907 | | - struct sock *sk = skb ? skb->sk : NULL; |
2908 | | - int key; |
2909 | | - |
2910 | | - /* This shall be called on a single skb of those generated by user |
2911 | | - * sendmsg(), and only when the sendmsg() does not return error to |
2912 | | - * user. This is required for keeping the tskey that increments here in |
2913 | | - * sync with possible sendmsg() counting by user. |
2914 | | - * |
2915 | | - * Stream sockets shall set key_offset to sendmsg() length in bytes |
2916 | | - * and call with the last fragment, others to 1 and first fragment. |
2917 | | - */ |
2918 | | - |
2919 | | - if (!skb || !sockc || !sk || !key_offset) |
2920 | | - return; |
2921 | | - |
2922 | | - sock_tx_timestamp(sk, sockc, &skb_shinfo(skb)->tx_flags); |
2923 | | - |
2924 | | - if (sk->sk_type == SOCK_STREAM) |
2925 | | - key = atomic_add_return(key_offset, &sk->sk_tskey); |
2926 | | - |
2927 | | - if (sockc->tsflags & SOF_TIMESTAMPING_OPT_ID && |
2928 | | - sockc->tsflags & SOF_TIMESTAMPING_TX_RECORD_MASK) { |
2929 | | - if (sockc->tsflags & SOCKCM_FLAG_TS_OPT_ID) { |
2930 | | - skb_shinfo(skb)->tskey = sockc->ts_opt_id; |
2931 | | - } else { |
2932 | | - if (sk->sk_type != SOCK_STREAM) |
2933 | | - key = atomic_inc_return(&sk->sk_tskey); |
2934 | | - skb_shinfo(skb)->tskey = key - 1; |
2935 | | - } |
2936 | | - } |
2937 | | -} |
2938 | | - |
2939 | | -void hci_conn_tx_queue(struct hci_conn *conn, struct sk_buff *skb) |
2940 | | -{ |
2941 | | - struct tx_queue *comp = &conn->tx_q; |
2942 | | - bool track = false; |
2943 | | - |
2944 | | - /* Emit SND now, ie. just before sending to driver */ |
2945 | | - if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP) |
2946 | | - __skb_tstamp_tx(skb, NULL, NULL, skb->sk, SCM_TSTAMP_SND); |
2947 | | - |
2948 | | - /* COMPLETION tstamp is emitted for tracked skb later in Number of |
2949 | | - * Completed Packets event. Available only for flow controlled cases. |
2950 | | - * |
2951 | | - * TODO: SCO support without flowctl (needs to be done in drivers) |
2952 | | - */ |
2953 | | - switch (conn->type) { |
2954 | | - case ISO_LINK: |
2955 | | - case ACL_LINK: |
2956 | | - case LE_LINK: |
2957 | | - break; |
2958 | | - case SCO_LINK: |
2959 | | - case ESCO_LINK: |
2960 | | - if (!hci_dev_test_flag(conn->hdev, HCI_SCO_FLOWCTL)) |
2961 | | - return; |
2962 | | - break; |
2963 | | - default: |
2964 | | - return; |
2965 | | - } |
2966 | | - |
2967 | | - if (skb->sk && (skb_shinfo(skb)->tx_flags & SKBTX_COMPLETION_TSTAMP)) |
2968 | | - track = true; |
2969 | | - |
2970 | | - /* If nothing is tracked, just count extra skbs at the queue head */ |
2971 | | - if (!track && !comp->tracked) { |
2972 | | - comp->extra++; |
2973 | | - return; |
2974 | | - } |
2975 | | - |
2976 | | - if (track) { |
2977 | | - skb = skb_clone_sk(skb); |
2978 | | - if (!skb) |
2979 | | - goto count_only; |
2980 | | - |
2981 | | - comp->tracked++; |
2982 | | - } else { |
2983 | | - skb = skb_clone(skb, GFP_KERNEL); |
2984 | | - if (!skb) |
2985 | | - goto count_only; |
2986 | | - } |
2987 | | - |
2988 | | - skb_queue_tail(&comp->queue, skb); |
2989 | | - return; |
2990 | | - |
2991 | | -count_only: |
2992 | | - /* Stop tracking skbs, and only count. This will not emit timestamps for |
2993 | | - * the packets, but if we get here something is more seriously wrong. |
2994 | | - */ |
2995 | | - comp->tracked = 0; |
2996 | | - comp->extra += skb_queue_len(&comp->queue) + 1; |
2997 | | - skb_queue_purge(&comp->queue); |
2998 | | -} |
2999 | | - |
3000 | | -void hci_conn_tx_dequeue(struct hci_conn *conn) |
3001 | | -{ |
3002 | | - struct tx_queue *comp = &conn->tx_q; |
3003 | | - struct sk_buff *skb; |
3004 | | - |
3005 | | - /* If there are tracked skbs, the counted extra go before dequeuing real |
3006 | | - * skbs, to keep ordering. When nothing is tracked, the ordering doesn't |
3007 | | - * matter so dequeue real skbs first to get rid of them ASAP. |
3008 | | - */ |
3009 | | - if (comp->extra && (comp->tracked || skb_queue_empty(&comp->queue))) { |
3010 | | - comp->extra--; |
3011 | | - return; |
3012 | | - } |
3013 | | - |
3014 | | - skb = skb_dequeue(&comp->queue); |
3015 | | - if (!skb) |
3016 | | - return; |
3017 | | - |
3018 | | - if (skb->sk) { |
3019 | | - comp->tracked--; |
3020 | | - __skb_tstamp_tx(skb, NULL, NULL, skb->sk, |
3021 | | - SCM_TSTAMP_COMPLETION); |
3022 | | - } |
3023 | | - |
3024 | | - kfree_skb(skb); |
3025 | | -} |
3026 | | - |
3027 | 2901 | u8 *hci_conn_key_enc_size(struct hci_conn *conn) |
3028 | 2902 | { |
3029 | 2903 | if (conn->type == ACL_LINK) { |
|
0 commit comments