Commit b874dec2 authored by Samuel Ortiz's avatar Samuel Ortiz

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: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 94f418a2
...@@ -608,6 +608,25 @@ static int llcp_sock_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -608,6 +608,25 @@ static int llcp_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
lock_sock(sk); lock_sock(sk);
if (sk->sk_type == SOCK_DGRAM) {
struct sockaddr_nfc_llcp *addr =
(struct sockaddr_nfc_llcp *)msg->msg_name;
if (msg->msg_namelen < sizeof(*addr)) {
release_sock(sk);
pr_err("Invalid socket address length %d\n",
msg->msg_namelen);
return -EINVAL;
}
release_sock(sk);
return nfc_llcp_send_ui_frame(llcp_sock, addr->dsap, addr->ssap,
msg, len);
}
if (sk->sk_state != LLCP_CONNECTED) { if (sk->sk_state != LLCP_CONNECTED) {
release_sock(sk); release_sock(sk);
return -ENOTCONN; return -ENOTCONN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment