| OLD | NEW |
| 1 /* | 1 /* |
| 2 BlueZ - Bluetooth protocol stack for Linux | 2 BlueZ - Bluetooth protocol stack for Linux |
| 3 Copyright (C) 2000-2001 Qualcomm Incorporated | 3 Copyright (C) 2000-2001 Qualcomm Incorporated |
| 4 | 4 |
| 5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> | 5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> |
| 6 | 6 |
| 7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License version 2 as | 8 it under the terms of the GNU General Public License version 2 as |
| 9 published by the Free Software Foundation; | 9 published by the Free Software Foundation; |
| 10 | 10 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 msg->msg_flags |= MSG_TRUNC; | 261 msg->msg_flags |= MSG_TRUNC; |
| 262 copied = len; | 262 copied = len; |
| 263 } | 263 } |
| 264 | 264 |
| 265 skb_reset_transport_header(skb); | 265 skb_reset_transport_header(skb); |
| 266 err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 266 err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); |
| 267 if (err == 0) | 267 if (err == 0) |
| 268 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) | 268 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)) |
| 269 sock_recv_ts_and_drops(msg, sk, skb); | 269 sock_recv_ts_and_drops(msg, sk, skb); |
| 270 #else | 270 #else |
| 271 » sock_recv_timestamp(msg, sk, skb); | 271 » » sock_recv_timestamp(msg, sk, skb); |
| 272 #endif | 272 #endif |
| 273 | 273 |
| 274 skb_free_datagram(sk, skb); | 274 skb_free_datagram(sk, skb); |
| 275 | 275 |
| 276 return err ? : copied; | 276 return err ? : copied; |
| 277 } | 277 } |
| 278 EXPORT_SYMBOL(bt_sock_recvmsg); | 278 EXPORT_SYMBOL(bt_sock_recvmsg); |
| 279 | 279 |
| 280 static inline unsigned int bt_accept_poll(struct sock *parent) | 280 static inline unsigned int bt_accept_poll(struct sock *parent) |
| 281 { | 281 { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 BT_DBG("sk %p cmd %x arg %lx", sk, cmd, arg); | 345 BT_DBG("sk %p cmd %x arg %lx", sk, cmd, arg); |
| 346 | 346 |
| 347 switch (cmd) { | 347 switch (cmd) { |
| 348 case TIOCOUTQ: | 348 case TIOCOUTQ: |
| 349 if (sk->sk_state == BT_LISTEN) | 349 if (sk->sk_state == BT_LISTEN) |
| 350 return -EINVAL; | 350 return -EINVAL; |
| 351 | 351 |
| 352 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) | 352 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) |
| 353 amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); | 353 amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); |
| 354 #else | 354 #else |
| 355 amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); | 355 » » amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); |
| 356 #endif | 356 #endif |
| 357 if (amount < 0) | 357 if (amount < 0) |
| 358 amount = 0; | 358 amount = 0; |
| 359 err = put_user(amount, (int __user *) arg); | 359 err = put_user(amount, (int __user *) arg); |
| 360 break; | 360 break; |
| 361 | 361 |
| 362 case TIOCINQ: | 362 case TIOCINQ: |
| 363 if (sk->sk_state == BT_LISTEN) | 363 if (sk->sk_state == BT_LISTEN) |
| 364 return -EINVAL; | 364 return -EINVAL; |
| 365 | 365 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 } | 461 } |
| 462 | 462 |
| 463 subsys_initcall(bt_init); | 463 subsys_initcall(bt_init); |
| 464 module_exit(bt_exit); | 464 module_exit(bt_exit); |
| 465 | 465 |
| 466 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); | 466 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); |
| 467 MODULE_DESCRIPTION("Bluetooth Core ver " VERSION); | 467 MODULE_DESCRIPTION("Bluetooth Core ver " VERSION); |
| 468 MODULE_VERSION(VERSION); | 468 MODULE_VERSION(VERSION); |
| 469 MODULE_LICENSE("GPL"); | 469 MODULE_LICENSE("GPL"); |
| 470 MODULE_ALIAS_NETPROTO(PF_BLUETOOTH); | 470 MODULE_ALIAS_NETPROTO(PF_BLUETOOTH); |
| OLD | NEW |