Lines Matching refs:client

28 #include <net/9p/client.h>
91 * @client: reference to client instance for this connection
114 struct p9_client *client;
217 p9_client_cb(m->client, req, REQ_STATUS_ERROR);
222 p9_fd_poll(struct p9_client *client, struct poll_table_struct *pt, int *err)
227 if (client && client->status == Connected)
228 ts = client->trans;
244 * @client: client instance
250 static int p9_fd_read(struct p9_client *client, void *v, int len)
256 if (client && client->status != Disconnected)
257 ts = client->trans;
268 client->status = Disconnected;
301 err = p9_fd_read(m->client, m->rc.sdata + m->rc.offset,
329 m->rreq = p9_tag_lookup(m->client, m->rc.tag);
349 p9_req_put(m->client, m->rreq);
368 p9_client_cb(m->client, m->rreq, REQ_STATUS_RCVD);
385 p9_req_put(m->client, m->rreq);
396 n = p9_fd_poll(m->client, NULL, NULL);
412 * @client: client instance
418 static int p9_fd_write(struct p9_client *client, void *v, int len)
423 if (client && client->status != Disconnected)
424 ts = client->trans;
434 client->status = Disconnected;
483 err = p9_fd_write(m->client, m->wbuf + m->wpos, m->wsize - m->wpos);
499 p9_req_put(m->client, m->wreq);
510 n = p9_fd_poll(m->client, NULL, NULL);
578 * @client: client instance
583 static void p9_conn_create(struct p9_client *client)
586 struct p9_trans_fd *ts = client->trans;
589 p9_debug(P9_DEBUG_TRANS, "client %p msize %d\n", client, client->msize);
592 m->client = client;
602 n = p9_fd_poll(client, &m->pt, NULL);
628 n = p9_fd_poll(m->client, NULL, &err);
660 * @client: client instance
665 static int p9_fd_request(struct p9_client *client, struct p9_req_t *req)
668 struct p9_trans_fd *ts = client->trans;
688 n = p9_fd_poll(m->client, NULL, NULL);
696 static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req)
698 struct p9_trans_fd *ts = client->trans;
702 p9_debug(P9_DEBUG_TRANS, "client %p req %p\n", client, req);
709 p9_req_put(client, req);
717 static int p9_fd_cancelled(struct p9_client *client, struct p9_req_t *req)
719 struct p9_trans_fd *ts = client->trans;
722 p9_debug(P9_DEBUG_TRANS, "client %p req %p\n", client, req);
740 p9_req_put(client, req);
826 static int p9_fd_open(struct p9_client *client, int rfd, int wfd)
854 client->trans = ts;
855 client->status = Connected;
868 static int p9_socket_open(struct p9_client *client, struct socket *csocket)
891 client->trans = p;
892 client->status = Connected;
896 p9_conn_create(client);
914 p9_req_put(m->client, m->rreq);
919 p9_req_put(m->client, m->wreq);
925 m->client = NULL;
930 * @client: client instance
934 static void p9_fd_close(struct p9_client *client)
938 if (!client)
941 ts = client->trans;
945 client->status = Disconnected;
993 p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args)
1009 client->trans_opts.tcp.port = opts.port;
1010 client->trans_opts.tcp.privport = opts.privport;
1042 return p9_socket_open(client, csocket);
1046 p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
1082 return p9_socket_open(client, csocket);
1086 p9_fd_create(struct p9_client *client, const char *addr, char *args)
1094 client->trans_opts.fd.rfd = opts.rfd;
1095 client->trans_opts.fd.wfd = opts.wfd;
1102 err = p9_fd_open(client, opts.rfd, opts.wfd);
1106 p9_conn_create(client);