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