mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
NFC: llcp: Add support in getsockopt for RW, LTO, and MIU remote parameters
Useful for LLCP validation tests. Signed-off-by: Thierry Escande <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
parent
abd18d4330
commit
064f370c5f
2 changed files with 27 additions and 3 deletions
|
|
@ -303,7 +303,7 @@ static int nfc_llcp_getsockopt(struct socket *sock, int level, int optname,
|
|||
struct sock *sk = sock->sk;
|
||||
struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk);
|
||||
int len, err = 0;
|
||||
u16 miux;
|
||||
u16 miux, remote_miu;
|
||||
u8 rw;
|
||||
|
||||
pr_debug("%p optname %d\n", sk, optname);
|
||||
|
|
@ -339,6 +339,27 @@ static int nfc_llcp_getsockopt(struct socket *sock, int level, int optname,
|
|||
|
||||
break;
|
||||
|
||||
case NFC_LLCP_REMOTE_MIU:
|
||||
remote_miu = llcp_sock->remote_miu > LLCP_MAX_MIU ?
|
||||
local->remote_miu : llcp_sock->remote_miu;
|
||||
|
||||
if (put_user(remote_miu, (u32 __user *) optval))
|
||||
err = -EFAULT;
|
||||
|
||||
break;
|
||||
|
||||
case NFC_LLCP_REMOTE_LTO:
|
||||
if (put_user(local->remote_lto / 10, (u32 __user *) optval))
|
||||
err = -EFAULT;
|
||||
|
||||
break;
|
||||
|
||||
case NFC_LLCP_REMOTE_RW:
|
||||
if (put_user(llcp_sock->remote_rw, (u32 __user *) optval))
|
||||
err = -EFAULT;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
err = -ENOPROTOOPT;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue