mirror of https://gitee.com/openkylin/linux.git
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:
parent
94f418a206
commit
b874dec21d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue