summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/rxrpc/call.h14
-rw-r--r--include/rxrpc/connection.h21
-rw-r--r--include/rxrpc/message.h8
-rw-r--r--include/rxrpc/packet.h47
-rw-r--r--include/rxrpc/peer.h5
-rw-r--r--include/rxrpc/rxrpc.h2
-rw-r--r--include/rxrpc/transport.h10
-rw-r--r--include/rxrpc/types.h4
8 files changed, 56 insertions, 55 deletions
diff --git a/include/rxrpc/call.h b/include/rxrpc/call.h
index 5afe044b3f46..6ac1df7012e9 100644
--- a/include/rxrpc/call.h
+++ b/include/rxrpc/call.h
@@ -67,8 +67,8 @@ struct rxrpc_call
wait_queue_head_t waitq; /* wait queue for events to happen */
struct list_head link; /* general internal list link */
struct list_head call_link; /* master call list link */
- u32 chan_ix; /* connection channel index (net order) */
- u32 call_id; /* call ID on connection (net order) */
+ uint32_t chan_ix; /* connection channel index (net order) */
+ uint32_t call_id; /* call ID on connection (net order) */
unsigned long cjif; /* jiffies at call creation */
unsigned long flags; /* control flags */
#define RXRPC_CALL_ACKS_TIMO 0x00000001 /* ACKS timeout reached */
@@ -103,7 +103,7 @@ struct rxrpc_call
char ackr_dfr_perm; /* request for deferred ACKs permitted */
rxrpc_seq_t ackr_dfr_seq; /* seqno for deferred ACK */
struct rxrpc_ackpacket ackr; /* pending normal ACK packet */
- u8 ackr_array[RXRPC_CALL_ACK_WINDOW_SIZE]; /* ACK records */
+ uint8_t ackr_array[RXRPC_CALL_ACK_WINDOW_SIZE]; /* ACK records */
/* presentation layer */
char app_last_rcv; /* T if received last packet from remote end */
@@ -131,14 +131,14 @@ struct rxrpc_call
struct list_head app_attn_link; /* application attention list linkage */
size_t app_mark; /* trigger callback when app_ready_qty>=app_mark */
char app_async_read; /* T if in async-read mode */
- u8 *app_read_buf; /* application async read buffer (app_mark size) */
- u8 *app_scr_alloc; /* application scratch allocation pointer */
+ uint8_t *app_read_buf; /* application async read buffer (app_mark size) */
+ uint8_t *app_scr_alloc; /* application scratch allocation pointer */
void *app_scr_ptr; /* application pointer into scratch buffer */
#define RXRPC_APP_MARK_EOF 0xFFFFFFFFU /* mark at end of input */
/* application scratch buffer */
- u8 app_scratch[0] __attribute__((aligned(sizeof(long))));
+ uint8_t app_scratch[0] __attribute__((aligned(sizeof(long))));
};
#define RXRPC_CALL_SCRATCH_SIZE (PAGE_SIZE - sizeof(struct rxrpc_call))
@@ -206,7 +206,7 @@ extern int rxrpc_call_read_data(struct rxrpc_call *call, void *buffer, size_t si
extern int rxrpc_call_write_data(struct rxrpc_call *call,
size_t sioc,
struct iovec siov[],
- u8 rxhdr_flags,
+ uint8_t rxhdr_flags,
int alloc_flags,
int dup_data,
size_t *size_sent);
diff --git a/include/rxrpc/connection.h b/include/rxrpc/connection.h
index fc10fed01b21..14de354724f9 100644
--- a/include/rxrpc/connection.h
+++ b/include/rxrpc/connection.h
@@ -34,6 +34,7 @@ struct rxrpc_connection
struct list_head link; /* link in peer's list */
struct list_head proc_link; /* link in proc list */
struct list_head err_link; /* link in ICMP error processing list */
+ struct list_head id_link; /* link in ID grant list */
struct sockaddr_in addr; /* remote address */
struct rxrpc_call *channels[4]; /* channels (active calls) */
wait_queue_head_t chanwait; /* wait for channel to become available */
@@ -44,19 +45,19 @@ struct rxrpc_connection
rxrpc_serial_t serial_counter; /* packet serial number counter */
/* the following should all be in net order */
- u32 in_epoch; /* peer's epoch */
- u32 out_epoch; /* my epoch */
- u32 conn_id; /* connection ID, appropriately shifted */
- u16 service_id; /* service ID */
- u8 security_ix; /* security ID */
- u8 in_clientflag; /* RXRPC_CLIENT_INITIATED if we are server */
- u8 out_clientflag; /* RXRPC_CLIENT_INITIATED if we are client */
+ uint32_t in_epoch; /* peer's epoch */
+ uint32_t out_epoch; /* my epoch */
+ uint32_t conn_id; /* connection ID, appropriately shifted */
+ uint16_t service_id; /* service ID */
+ uint8_t security_ix; /* security ID */
+ uint8_t in_clientflag; /* RXRPC_CLIENT_INITIATED if we are server */
+ uint8_t out_clientflag; /* RXRPC_CLIENT_INITIATED if we are client */
};
extern int rxrpc_create_connection(struct rxrpc_transport *trans,
- u16 port,
- u32 addr,
- unsigned short service_id,
+ uint16_t port,
+ uint32_t addr,
+ uint16_t service_id,
void *security,
struct rxrpc_connection **_conn);
diff --git a/include/rxrpc/message.h b/include/rxrpc/message.h
index 2e43c03c6857..9be208ab079e 100644
--- a/include/rxrpc/message.h
+++ b/include/rxrpc/message.h
@@ -9,8 +9,8 @@
* 2 of the License, or (at your option) any later version.
*/
-#ifndef _H_3AD3363A_3A9C_11D6_83D8_0002B3163499
-#define _H_3AD3363A_3A9C_11D6_83D8_0002B3163499
+#ifndef _LINUX_RXRPC_MESSAGE_H
+#define _LINUX_RXRPC_MESSAGE_H
#include <rxrpc/packet.h>
@@ -61,7 +61,7 @@ static inline void rxrpc_put_message(struct rxrpc_message *msg)
extern int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
struct rxrpc_call *call,
- u8 type,
+ uint8_t type,
int count,
struct iovec diov[],
int alloc_flags,
@@ -69,4 +69,4 @@ extern int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
extern int rxrpc_conn_sendmsg(struct rxrpc_connection *conn, struct rxrpc_message *msg);
-#endif /* _H_3AD3363A_3A9C_11D6_83D8_0002B3163499 */
+#endif /* _LINUX_RXRPC_MESSAGE_H */
diff --git a/include/rxrpc/packet.h b/include/rxrpc/packet.h
index 78999077f5b8..068813d65345 100644
--- a/include/rxrpc/packet.h
+++ b/include/rxrpc/packet.h
@@ -27,21 +27,21 @@ extern size_t RXRPC_MAX_PACKET_SIZE;
*/
struct rxrpc_header
{
- u32 epoch; /* client boot timestamp */
+ uint32_t epoch; /* client boot timestamp */
- u32 cid; /* connection and channel ID */
+ uint32_t cid; /* connection and channel ID */
#define RXRPC_MAXCALLS 4 /* max active calls per conn */
#define RXRPC_CHANNELMASK (RXRPC_MAXCALLS-1) /* mask for channel ID */
#define RXRPC_CIDMASK (~RXRPC_CHANNELMASK) /* mask for connection ID */
#define RXRPC_CIDSHIFT 2 /* shift for connection ID */
- u32 callNumber; /* call ID (0 for connection-level packets) */
+ uint32_t callNumber; /* call ID (0 for connection-level packets) */
#define RXRPC_PROCESS_MAXCALLS (1<<2) /* maximum number of active calls per conn (power of 2) */
- u32 seq; /* sequence number of pkt in call stream */
- u32 serial; /* serial number of pkt sent to network */
+ uint32_t seq; /* sequence number of pkt in call stream */
+ uint32_t serial; /* serial number of pkt sent to network */
- u8 type; /* packet type */
+ uint8_t type; /* packet type */
#define RXRPC_PACKET_TYPE_DATA 1 /* data */
#define RXRPC_PACKET_TYPE_ACK 2 /* ACK */
#define RXRPC_PACKET_TYPE_BUSY 3 /* call reject */
@@ -52,7 +52,7 @@ struct rxrpc_header
#define RXRPC_PACKET_TYPE_DEBUG 8 /* debug info request */
#define RXRPC_N_PACKET_TYPES 9 /* number of packet types (incl type 0) */
- u8 flags; /* packet flags */
+ uint8_t flags; /* packet flags */
#define RXRPC_CLIENT_INITIATED 0x01 /* signifies a packet generated by a client */
#define RXRPC_REQUEST_ACK 0x02 /* request an unconditional ACK of this packet */
#define RXRPC_LAST_PACKET 0x04 /* the last packet from this side for this call */
@@ -60,10 +60,10 @@ struct rxrpc_header
#define RXRPC_JUMBO_PACKET 0x20 /* [DATA] this is a jumbo packet */
#define RXRPC_SLOW_START_OK 0x20 /* [ACK] slow start supported */
- u8 userStatus; /* app-layer defined status */
- u8 securityIndex; /* security protocol ID */
- u16 _rsvd; /* reserved (used by kerberos security as cksum) */
- u16 serviceId; /* service ID */
+ uint8_t userStatus; /* app-layer defined status */
+ uint8_t securityIndex; /* security protocol ID */
+ uint16_t _rsvd; /* reserved (used by kerberos security as cksum) */
+ uint16_t serviceId; /* service ID */
} __attribute__((packed));
@@ -83,9 +83,9 @@ extern const char *rxrpc_pkts[];
*/
struct rxrpc_jumbo_header
{
- u8 flags; /* packet flags (as per rxrpc_header) */
- u8 pad;
- u16 _rsvd; /* reserved (used by kerberos security as cksum) */
+ uint8_t flags; /* packet flags (as per rxrpc_header) */
+ uint8_t pad;
+ uint16_t _rsvd; /* reserved (used by kerberos security as cksum) */
};
#define RXRPC_JUMBO_DATALEN 1412 /* non-terminal jumbo packet data length */
@@ -97,13 +97,14 @@ struct rxrpc_jumbo_header
*/
struct rxrpc_ackpacket
{
- u16 bufferSpace; /* number of packet buffers available */
- u16 maxSkew; /* diff between serno being ACK'd and highest serial no received */
- u32 firstPacket; /* sequence no of first ACK'd packet in attached list */
- u32 previousPacket; /* sequence no of previous packet received */
- u32 serial; /* serial no of packet that prompted this ACK */
-
- u8 reason; /* reason for ACK */
+ uint16_t bufferSpace; /* number of packet buffers available */
+ uint16_t maxSkew; /* diff between serno being ACK'd and highest serial no
+ * received */
+ uint32_t firstPacket; /* sequence no of first ACK'd packet in attached list */
+ uint32_t previousPacket; /* sequence no of previous packet received */
+ uint32_t serial; /* serial no of packet that prompted this ACK */
+
+ uint8_t reason; /* reason for ACK */
#define RXRPC_ACK_REQUESTED 1 /* ACK was requested on packet */
#define RXRPC_ACK_DUPLICATE 2 /* duplicate packet received */
#define RXRPC_ACK_OUT_OF_SEQUENCE 3 /* out of sequence packet received */
@@ -114,10 +115,10 @@ struct rxrpc_ackpacket
#define RXRPC_ACK_DELAY 8 /* nothing happened since received packet */
#define RXRPC_ACK_IDLE 9 /* ACK due to fully received ACK window */
- u8 nAcks; /* number of ACKs */
+ uint8_t nAcks; /* number of ACKs */
#define RXRPC_MAXACKS 255
- u8 acks[0]; /* list of ACK/NAKs */
+ uint8_t acks[0]; /* list of ACK/NAKs */
#define RXRPC_ACK_TYPE_NACK 0
#define RXRPC_ACK_TYPE_ACK 1
diff --git a/include/rxrpc/peer.h b/include/rxrpc/peer.h
index 0ab2730541ed..07e3a51b60b6 100644
--- a/include/rxrpc/peer.h
+++ b/include/rxrpc/peer.h
@@ -42,7 +42,10 @@ struct rxrpc_peer
struct rxrpc_timer timeout; /* timeout for grave destruction */
struct list_head link; /* link in transport's peer list */
struct list_head proc_link; /* link in /proc list */
- rwlock_t conn_lock; /* lock for connections */
+ rwlock_t conn_idlock; /* lock for connection IDs */
+ struct list_head conn_idlist; /* list of connections granted IDs */
+ uint32_t conn_idcounter; /* connection ID counter */
+ rwlock_t conn_lock; /* lock for active/dead connections */
struct list_head conn_active; /* active connections to/from this peer */
struct list_head conn_graveyard; /* graveyard for inactive connections */
spinlock_t conn_gylock; /* lock for conn_graveyard */
diff --git a/include/rxrpc/rxrpc.h b/include/rxrpc/rxrpc.h
index 454d59933675..df6595c32c37 100644
--- a/include/rxrpc/rxrpc.h
+++ b/include/rxrpc/rxrpc.h
@@ -14,7 +14,7 @@
#ifdef __KERNEL__
-extern u32 rxrpc_epoch;
+extern uint32_t rxrpc_epoch;
extern int rxrpc_ktrace;
extern int rxrpc_kdebug;
diff --git a/include/rxrpc/transport.h b/include/rxrpc/transport.h
index b9c225533158..92fb49c7d4b9 100644
--- a/include/rxrpc/transport.h
+++ b/include/rxrpc/transport.h
@@ -85,10 +85,11 @@ extern int rxrpc_create_transport(unsigned short port,
static inline void rxrpc_get_transport(struct rxrpc_transport *trans)
{
- if (atomic_read(&trans->usage)<=0)
+ if (atomic_read(&trans->usage) <= 0)
BUG();
atomic_inc(&trans->usage);
- //printk("rxrpc_get_transport(%p{u=%d})\n",trans,atomic_read(&trans->usage));
+ //printk("rxrpc_get_transport(%p{u=%d})\n",
+ // trans, atomic_read(&trans->usage));
}
extern void rxrpc_put_transport(struct rxrpc_transport *trans);
@@ -99,11 +100,6 @@ extern int rxrpc_add_service(struct rxrpc_transport *trans,
extern void rxrpc_del_service(struct rxrpc_transport *trans,
struct rxrpc_service *srv);
-#if 0
-extern int rxrpc_trans_add_connection(struct rxrpc_transport *trans,
- struct rxrpc_connection *conn);
-#endif
-
extern void rxrpc_trans_receive_packet(struct rxrpc_transport *trans);
extern int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
diff --git a/include/rxrpc/types.h b/include/rxrpc/types.h
index 40700bc61a6f..2f37ad8bb582 100644
--- a/include/rxrpc/types.h
+++ b/include/rxrpc/types.h
@@ -19,8 +19,8 @@
#include <linux/spinlock.h>
#include <asm/atomic.h>
-typedef unsigned rxrpc_seq_t; /* Rx message sequence number */
-typedef unsigned rxrpc_serial_t; /* Rx message serial number */
+typedef uint32_t rxrpc_seq_t; /* Rx message sequence number */
+typedef uint32_t rxrpc_serial_t; /* Rx message serial number */
struct rxrpc_call;
struct rxrpc_connection;