Commit 367b468d authored by David S. Miller's avatar David S. Miller

net/bluetooth/rfcomm/core.c: Update for new sendmsg args.

parent d09b1b68
......@@ -575,6 +575,8 @@ struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *
/* ---- RFCOMM frame sending ---- */
static int rfcomm_send_frame(struct rfcomm_session *s, u8 *data, int len)
{
struct kiocb iocb;
struct sock_iocb *si;
struct socket *sock = s->sock;
struct iovec iv = { data, len };
struct msghdr msg;
......@@ -585,8 +587,16 @@ static int rfcomm_send_frame(struct rfcomm_session *s, u8 *data, int len)
memset(&msg, 0, sizeof(msg));
msg.msg_iovlen = 1;
msg.msg_iov = &iv;
err = sock->ops->sendmsg(sock, &msg, len, 0);
init_sync_kiocb(&iocb, NULL);
si = kiocb_to_siocb(&iocb);
si->scm = NULL;
si->sock = sock;
si->msg = &msg;
si->size = len;
err = sock->ops->sendmsg(&iocb, sock, &msg, len, NULL);
if (-EIOCBQUEUED == err)
err = wait_on_sync_kiocb(&iocb);
return err;
}
......@@ -799,10 +809,13 @@ static int rfcomm_send_msc(struct rfcomm_session *s, int cr, u8 dlci, u8 v24_sig
static int rfcomm_send_test(struct rfcomm_session *s, int cr, u8 *pattern, int len)
{
struct kiocb iocb;
struct sock_iocb *si;
struct socket *sock = s->sock;
struct iovec iv[3];
struct msghdr msg;
unsigned char hdr[5], crc[1];
int err;
if (len > 125)
return -EINVAL;
......@@ -827,7 +840,18 @@ static int rfcomm_send_test(struct rfcomm_session *s, int cr, u8 *pattern, int l
memset(&msg, 0, sizeof(msg));
msg.msg_iovlen = 3;
msg.msg_iov = iv;
return sock->ops->sendmsg(sock, &msg, 6 + len, 0);
init_sync_kiocb(&iocb, NULL);
si = kiocb_to_siocb(&iocb);
si->scm = NULL;
si->sock = sock;
si->msg = &msg;
si->size = 6 + len;
err = sock->ops->sendmsg(&iocb, sock, &msg, 6 + len, NULL);
if (-EIOCBQUEUED == err)
err = wait_on_sync_kiocb(&iocb);
return err;
}
static int rfcomm_send_credits(struct rfcomm_session *s, u8 addr, u8 credits)
......
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