diff options
Diffstat (limited to 'include/net/bluetooth/bluetooth.h')
| -rw-r--r-- | include/net/bluetooth/bluetooth.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 04a6908e38d2..30fce0128dd7 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -84,7 +84,7 @@ enum { | |||
| 84 | /* BD Address */ | 84 | /* BD Address */ |
| 85 | typedef struct { | 85 | typedef struct { |
| 86 | __u8 b[6]; | 86 | __u8 b[6]; |
| 87 | } __attribute__((packed)) bdaddr_t; | 87 | } __packed bdaddr_t; |
| 88 | 88 | ||
| 89 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) | 89 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) |
| 90 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) | 90 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) |
| @@ -138,6 +138,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); | |||
| 138 | struct bt_skb_cb { | 138 | struct bt_skb_cb { |
| 139 | __u8 pkt_type; | 139 | __u8 pkt_type; |
| 140 | __u8 incoming; | 140 | __u8 incoming; |
| 141 | __u16 expect; | ||
| 141 | __u8 tx_seq; | 142 | __u8 tx_seq; |
| 142 | __u8 retries; | 143 | __u8 retries; |
| 143 | __u8 sar; | 144 | __u8 sar; |
| @@ -160,12 +161,30 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, unsigned long l | |||
| 160 | { | 161 | { |
| 161 | struct sk_buff *skb; | 162 | struct sk_buff *skb; |
| 162 | 163 | ||
| 164 | release_sock(sk); | ||
| 163 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { | 165 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { |
| 164 | skb_reserve(skb, BT_SKB_RESERVE); | 166 | skb_reserve(skb, BT_SKB_RESERVE); |
| 165 | bt_cb(skb)->incoming = 0; | 167 | bt_cb(skb)->incoming = 0; |
| 166 | } | 168 | } |
| 169 | lock_sock(sk); | ||
| 170 | |||
| 171 | if (!skb && *err) | ||
| 172 | return NULL; | ||
| 173 | |||
| 174 | *err = sock_error(sk); | ||
| 175 | if (*err) | ||
| 176 | goto out; | ||
| 177 | |||
| 178 | if (sk->sk_shutdown) { | ||
| 179 | *err = -ECONNRESET; | ||
| 180 | goto out; | ||
| 181 | } | ||
| 167 | 182 | ||
| 168 | return skb; | 183 | return skb; |
| 184 | |||
| 185 | out: | ||
| 186 | kfree_skb(skb); | ||
| 187 | return NULL; | ||
| 169 | } | 188 | } |
| 170 | 189 | ||
| 171 | int bt_err(__u16 code); | 190 | int bt_err(__u16 code); |
| @@ -176,6 +195,6 @@ extern void hci_sock_cleanup(void); | |||
| 176 | extern int bt_sysfs_init(void); | 195 | extern int bt_sysfs_init(void); |
| 177 | extern void bt_sysfs_cleanup(void); | 196 | extern void bt_sysfs_cleanup(void); |
| 178 | 197 | ||
| 179 | extern struct class *bt_class; | 198 | extern struct dentry *bt_debugfs; |
| 180 | 199 | ||
| 181 | #endif /* __BLUETOOTH_H */ | 200 | #endif /* __BLUETOOTH_H */ |
