xiaoxiang781216 commented on code in PR #6949: URL: https://github.com/apache/incubator-nuttx/pull/6949#discussion_r966758936
########## net/usrsock/usrsock_dev.c: ########## @@ -1132,91 +545,55 @@ static int usrsockdev_poll(FAR struct file *filep, FAR struct pollfd *fds, ****************************************************************************/ /**************************************************************************** - * Name: usrsockdev_do_request + * Name: usrsock_request ****************************************************************************/ -int usrsockdev_do_request(FAR struct usrsock_conn_s *conn, - FAR struct iovec *iov, unsigned int iovcnt) +int usrsock_request(FAR struct iovec *iov, unsigned int iovcnt) { FAR struct usrsockdev_s *dev = &g_usrsockdev; - FAR struct usrsock_request_common_s *req_head = iov[0].iov_base; - - if (!usrsockdev_is_opened(dev)) - { - ninfo("usockid=%d; daemon has closed /dev/usrsock.\n", conn->usockid); - - return -ENETDOWN; - } - - /* Get exchange id. */ - - if (++dev->newxid == 0) - { - ++dev->newxid; - } - - req_head->xid = dev->newxid; - - /* Prepare connection for response. */ - - conn->resp.xid = req_head->xid; - conn->resp.result = -EACCES; - - ++dev->req.nbusy; /* net_lock held. */ + int ret; /* Set outstanding request for daemon to handle. */ - net_lockedwait_uninterruptible(&dev->req.sem); + net_lockedwait_uninterruptible(&dev->devsem); if (usrsockdev_is_opened(dev)) { DEBUGASSERT(dev->req.iov == NULL); - dev->req.ackxid = req_head->xid; dev->req.iov = iov; dev->req.pos = 0; dev->req.iovcnt = iovcnt; /* Notify daemon of new request. */ usrsockdev_pollnotify(dev, POLLIN); - - /* Wait ack for request. */ - - net_lockedwait_uninterruptible(&dev->req.acksem); + ret =0; Review Comment: merge to line 554 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org