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>
This commit is contained in:
Samuel Ortiz 2012-10-16 15:04:10 +02:00
parent 94f418a206
commit b874dec21d
1 changed files with 19 additions and 0 deletions

View File

@ -608,6 +608,25 @@ static int llcp_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
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) {
release_sock(sk);
return -ENOTCONN;