[POWERPC] ppc: m48t35 add missing bracket
[linux/fpc-iii.git] / include / rxrpc / message.h
blobb318f273d4f216162096244de55eb33b95ba0bff
1 /* message.h: Rx message caching
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #ifndef _LINUX_RXRPC_MESSAGE_H
13 #define _LINUX_RXRPC_MESSAGE_H
15 #include <rxrpc/packet.h>
17 /*****************************************************************************/
19 * Rx message record
21 struct rxrpc_message
23 atomic_t usage;
24 struct list_head link; /* list link */
25 struct timeval stamp; /* time received or last sent */
26 rxrpc_seq_t seq; /* message sequence number */
28 int state; /* the state the message is currently in */
29 #define RXRPC_MSG_PREPARED 0
30 #define RXRPC_MSG_SENT 1
31 #define RXRPC_MSG_ACKED 2 /* provisionally ACK'd */
32 #define RXRPC_MSG_DONE 3 /* definitively ACK'd (msg->seq<ack.firstPacket) */
33 #define RXRPC_MSG_RECEIVED 4
34 #define RXRPC_MSG_ERROR -1
35 char rttdone; /* used for RTT */
37 struct rxrpc_transport *trans; /* transport received through */
38 struct rxrpc_connection *conn; /* connection received over */
39 struct sk_buff *pkt; /* received packet */
40 off_t offset; /* offset into pkt of next byte of data */
42 struct rxrpc_header hdr; /* message header */
44 int dcount; /* data part count */
45 size_t dsize; /* data size */
46 #define RXRPC_MSG_MAX_IOCS 8
47 struct kvec data[RXRPC_MSG_MAX_IOCS]; /* message data */
48 unsigned long dfree; /* bit mask indicating kfree(data[x]) if T */
51 #define rxrpc_get_message(M) do { atomic_inc(&(M)->usage); } while(0)
53 extern void __rxrpc_put_message(struct rxrpc_message *msg);
54 static inline void rxrpc_put_message(struct rxrpc_message *msg)
56 BUG_ON(atomic_read(&msg->usage)<=0);
57 if (atomic_dec_and_test(&msg->usage))
58 __rxrpc_put_message(msg);
61 extern int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
62 struct rxrpc_call *call,
63 uint8_t type,
64 int count,
65 struct kvec *diov,
66 gfp_t alloc_flags,
67 struct rxrpc_message **_msg);
69 extern int rxrpc_conn_sendmsg(struct rxrpc_connection *conn, struct rxrpc_message *msg);
71 #endif /* _LINUX_RXRPC_MESSAGE_H */