sdhci-pltfm: implement platform data passing
[safe/jmp/linux-2.6] / net / rxrpc / ar-connevent.c
index 4b02815..0505cdc 100644 (file)
@@ -45,7 +45,7 @@ static void rxrpc_abort_calls(struct rxrpc_connection *conn, int state,
                                set_bit(RXRPC_CALL_CONN_ABORT, &call->events);
                        else
                                set_bit(RXRPC_CALL_RCVD_ABORT, &call->events);
-                       schedule_work(&call->processor);
+                       rxrpc_queue_call(call);
                }
                write_unlock(&call->state_lock);
        }
@@ -126,14 +126,14 @@ static int rxrpc_abort_connection(struct rxrpc_connection *conn,
  * mark a call as being on a now-secured channel
  * - must be called with softirqs disabled
  */
-void rxrpc_call_is_secure(struct rxrpc_call *call)
+static void rxrpc_call_is_secure(struct rxrpc_call *call)
 {
        _enter("%p", call);
        if (call) {
                read_lock(&call->state_lock);
                if (call->state < RXRPC_CALL_COMPLETE &&
                    !test_and_set_bit(RXRPC_CALL_SECURED, &call->events))
-                       schedule_work(&call->processor);
+                       rxrpc_queue_call(call);
                read_unlock(&call->state_lock);
        }
 }
@@ -150,11 +150,15 @@ static int rxrpc_process_event(struct rxrpc_connection *conn,
        u32 serial;
        int loop, ret;
 
-       if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED)
+       if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) {
+               kleave(" = -ECONNABORTED [%u]", conn->state);
                return -ECONNABORTED;
+       }
 
        serial = ntohl(sp->hdr.serial);
 
+       _enter("{%d},{%u,%%%u},", conn->debug_id, sp->hdr.type, serial);
+
        switch (sp->hdr.type) {
        case RXRPC_PACKET_TYPE_ABORT:
                if (skb_copy_bits(skb, 0, &tmp, sizeof(tmp)) < 0)
@@ -199,6 +203,7 @@ static int rxrpc_process_event(struct rxrpc_connection *conn,
                return 0;
 
        default:
+               _leave(" = -EPROTO [%u]", sp->hdr.type);
                return -EPROTO;
        }
 }
@@ -308,6 +313,22 @@ protocol_error:
 }
 
 /*
+ * put a packet up for transport-level abort
+ */
+void rxrpc_reject_packet(struct rxrpc_local *local, struct sk_buff *skb)
+{
+       CHECK_SLAB_OKAY(&local->usage);
+
+       if (!atomic_inc_not_zero(&local->usage)) {
+               printk("resurrected on reject\n");
+               BUG();
+       }
+
+       skb_queue_tail(&local->reject_queue, skb);
+       rxrpc_queue_work(&local->rejecter);
+}
+
+/*
  * reject packets through the local endpoint
  */
 void rxrpc_reject_packets(struct work_struct *work)