diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-10-16 09:04:10 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-10-26 12:26:51 -0400 |
commit | b874dec21d1cb7a08fcbe4e442a789419dd1d51f (patch) | |
tree | 782bbf1e79f93396542b61181d0b8862bcc428a5 /net | |
parent | 94f418a206648c9be6fd84d6681d6956b8f8b106 (diff) |
NFC: Implement LLCP connection less Tx path
It simply involves getting the client dsap and ssap and calling the UI
frame building and sending routine.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/nfc/llcp/sock.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c index d511a4c2fef6..0fa1e92ceac8 100644 --- a/net/nfc/llcp/sock.c +++ b/net/nfc/llcp/sock.c | |||
@@ -608,6 +608,25 @@ static int llcp_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
608 | 608 | ||
609 | lock_sock(sk); | 609 | lock_sock(sk); |
610 | 610 | ||
611 | if (sk->sk_type == SOCK_DGRAM) { | ||
612 | struct sockaddr_nfc_llcp *addr = | ||
613 | (struct sockaddr_nfc_llcp *)msg->msg_name; | ||
614 | |||
615 | if (msg->msg_namelen < sizeof(*addr)) { | ||
616 | release_sock(sk); | ||
617 | |||
618 | pr_err("Invalid socket address length %d\n", | ||
619 | msg->msg_namelen); | ||
620 | |||
621 | return -EINVAL; | ||
622 | } | ||
623 | |||
624 | release_sock(sk); | ||
625 | |||
626 | return nfc_llcp_send_ui_frame(llcp_sock, addr->dsap, addr->ssap, | ||
627 | msg, len); | ||
628 | } | ||
629 | |||
611 | if (sk->sk_state != LLCP_CONNECTED) { | 630 | if (sk->sk_state != LLCP_CONNECTED) { |
612 | release_sock(sk); | 631 | release_sock(sk); |
613 | return -ENOTCONN; | 632 | return -ENOTCONN; |