• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/net/rxrpc/

Lines Matching refs:call

24 			   struct rxrpc_call *call,
102 * abort a call, sending an ABORT packet to the peer
104 static void rxrpc_send_abort(struct rxrpc_call *call, u32 abort_code)
106 write_lock_bh(&call->state_lock);
108 if (call->state <= RXRPC_CALL_COMPLETE) {
109 call->state = RXRPC_CALL_LOCALLY_ABORTED;
110 call->abort_code = abort_code;
111 set_bit(RXRPC_CALL_ABORT, &call->events);
112 del_timer_sync(&call->resend_timer);
113 del_timer_sync(&call->ack_timer);
114 clear_bit(RXRPC_CALL_RESEND_TIMER, &call->events);
115 clear_bit(RXRPC_CALL_ACK, &call->events);
116 clear_bit(RXRPC_CALL_RUN_RTIMER, &call->flags);
117 rxrpc_queue_call(call);
120 write_unlock_bh(&call->state_lock);
124 * send a message forming part of a client call through an RxRPC socket
134 struct rxrpc_call *call;
167 call = rxrpc_get_client_call(rx, trans, bundle, user_call_ID,
171 if (IS_ERR(call)) {
172 _leave(" = %ld", PTR_ERR(call));
173 return PTR_ERR(call);
177 call->debug_id, call->user_call_ID, call->state, call->conn);
179 if (call->state >= RXRPC_CALL_COMPLETE) {
180 /* it's too late for this call */
183 rxrpc_send_abort(call, abort_code);
186 } else if (call->state != RXRPC_CALL_CLIENT_SEND_REQUEST) {
187 /* request phase complete for this client call */
190 ret = rxrpc_send_data(iocb, rx, call, msg, len);
193 rxrpc_put_call(call);
199 * rxrpc_kernel_send_data - Allow a kernel service to send data on a call
200 * @call: The call to send data through
204 * Allow a kernel service to send data on a call. The call must be in an state
209 int rxrpc_kernel_send_data(struct rxrpc_call *call, struct msghdr *msg,
214 _enter("{%d,%s},", call->debug_id, rxrpc_call_states[call->state]);
219 lock_sock(&call->socket->sk);
222 call->debug_id, call->user_call_ID, call->state, call->conn);
224 if (call->state >= RXRPC_CALL_COMPLETE) {
225 ret = -ESHUTDOWN; /* it's too late for this call */
226 } else if (call->state != RXRPC_CALL_CLIENT_SEND_REQUEST &&
227 call->state != RXRPC_CALL_SERVER_ACK_REQUEST &&
228 call->state != RXRPC_CALL_SERVER_SEND_REPLY) {
229 ret = -EPROTO; /* request phase complete for this client call */
233 ret = rxrpc_send_data(NULL, call->socket, call, msg, len);
237 release_sock(&call->socket->sk);
245 * rxrpc_kernel_abort_call - Allow a kernel service to abort a call
246 * @call: The call to be aborted
249 * Allow a kernel service to abort a call, if it's still in an abortable state.
251 void rxrpc_kernel_abort_call(struct rxrpc_call *call, u32 abort_code)
253 _enter("{%d},%d", call->debug_id, abort_code);
255 lock_sock(&call->socket->sk);
258 call->debug_id, call->user_call_ID, call->state, call->conn);
260 if (call->state < RXRPC_CALL_COMPLETE)
261 rxrpc_send_abort(call, abort_code);
263 release_sock(&call->socket->sk);
277 struct rxrpc_call *call;
290 call = rxrpc_accept_call(rx, user_call_ID);
291 if (IS_ERR(call))
292 return PTR_ERR(call);
293 rxrpc_put_call(call);
297 call = rxrpc_find_server_call(rx, user_call_ID);
298 if (!call)
300 if (call->state >= RXRPC_CALL_COMPLETE) {
307 if (call->state != RXRPC_CALL_CLIENT_SEND_REQUEST &&
308 call->state != RXRPC_CALL_SERVER_ACK_REQUEST &&
309 call->state != RXRPC_CALL_SERVER_SEND_REPLY) {
310 /* Tx phase not yet begun for this call */
315 ret = rxrpc_send_data(iocb, rx, call, msg, len);
319 rxrpc_send_abort(call, abort_code);
326 rxrpc_put_call(call);
399 struct rxrpc_call *call,
406 CIRC_SPACE(call->acks_head, call->acks_tail, call->acks_winsz),
409 add_wait_queue(&call->tx_waitq, &myself);
414 if (CIRC_SPACE(call->acks_head, call->acks_tail,
415 call->acks_winsz) > 0)
427 remove_wait_queue(&call->tx_waitq, &myself);
436 static inline void rxrpc_instant_resend(struct rxrpc_call *call)
438 read_lock_bh(&call->state_lock);
439 if (try_to_del_timer_sync(&call->resend_timer) >= 0) {
440 clear_bit(RXRPC_CALL_RUN_RTIMER, &call->flags);
441 if (call->state < RXRPC_CALL_COMPLETE &&
442 !test_and_set_bit(RXRPC_CALL_RESEND_TIMER, &call->events))
443 rxrpc_queue_call(call);
445 read_unlock_bh(&call->state_lock);
452 static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
458 _net("queue skb %p [%d]", skb, call->acks_head);
460 ASSERT(call->acks_window != NULL);
461 call->acks_window[call->acks_head] = (unsigned long) skb;
463 call->acks_head = (call->acks_head + 1) & (call->acks_winsz - 1);
465 if (last || call->state == RXRPC_CALL_SERVER_ACK_REQUEST) {
467 write_lock_bh(&call->state_lock);
468 switch (call->state) {
470 call->state = RXRPC_CALL_CLIENT_AWAIT_REPLY;
473 call->state = RXRPC_CALL_SERVER_SEND_REPLY;
477 call->state = RXRPC_CALL_SERVER_AWAIT_ACK;
482 write_unlock_bh(&call->state_lock);
490 if (!test_and_set_bit(RXRPC_CALL_RUN_RTIMER, &call->flags)) {
492 call->resend_timer.expires = sp->resend_at;
493 add_timer(&call->resend_timer);
497 * we're ACK'ing the request phase of an incoming call */
499 if (try_to_del_timer_sync(&call->ack_timer) >= 0) {
502 ret = rxrpc_send_packet(call->conn->trans, skb);
511 rxrpc_instant_resend(call);
524 struct rxrpc_call *call,
553 skb = call->tx_pending;
554 call->tx_pending = NULL;
570 if (CIRC_SPACE(call->acks_head, call->acks_tail,
571 call->acks_winsz) <= 0) {
575 ret = rxrpc_wait_for_tx_window(rx, call,
581 max = call->conn->trans->peer->maxdata;
582 max -= call->conn->security_size;
583 max &= ~(call->conn->size_align - 1UL);
589 space = chunk + call->conn->size_align;
590 space &= ~(call->conn->size_align - 1UL);
592 size = space + call->conn->header_size;
608 _debug("HS: %u", call->conn->header_size);
609 skb_reserve(skb, call->conn->header_size);
610 skb->len += call->conn->header_size;
660 /* check for the far side aborting the call or a network error
662 if (call->state > RXRPC_CALL_COMPLETE)
667 struct rxrpc_connection *conn = call->conn;
681 sp->hdr.cid = call->cid;
682 sp->hdr.callNumber = call->call_id;
684 htonl(atomic_inc_return(&call->sequence));
696 else if (CIRC_SPACE(call->acks_head, call->acks_tail,
697 call->acks_winsz) > 1)
701 call, skb, skb->mark,
708 rxrpc_queue_packet(call, skb, segment == 0 && !more);
717 call->tx_pending = skb;
723 if (call->state == RXRPC_CALL_NETWORK_ERROR)
724 ret = call->conn->trans->peer->net_error;