Commit 86b36f2a authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: remove the typedef sctp_xmit_t

This patch is to remove the typedef sctp_xmit_t, and
replace with enum sctp_xmit in the places where it's
using this typedef.
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 84965614
...@@ -312,12 +312,12 @@ enum { SCTP_MAX_GABS = 16 }; ...@@ -312,12 +312,12 @@ enum { SCTP_MAX_GABS = 16 };
/* These return values describe the success or failure of a number of /* These return values describe the success or failure of a number of
* routines which form the lower interface to SCTP_outqueue. * routines which form the lower interface to SCTP_outqueue.
*/ */
typedef enum { enum sctp_xmit {
SCTP_XMIT_OK, SCTP_XMIT_OK,
SCTP_XMIT_PMTU_FULL, SCTP_XMIT_PMTU_FULL,
SCTP_XMIT_RWND_FULL, SCTP_XMIT_RWND_FULL,
SCTP_XMIT_DELAY, SCTP_XMIT_DELAY,
} sctp_xmit_t; };
/* These are the commands for manipulating transports. */ /* These are the commands for manipulating transports. */
enum sctp_transport_cmd { enum sctp_transport_cmd {
......
...@@ -697,10 +697,11 @@ struct sctp_packet { ...@@ -697,10 +697,11 @@ struct sctp_packet {
void sctp_packet_init(struct sctp_packet *, struct sctp_transport *, void sctp_packet_init(struct sctp_packet *, struct sctp_transport *,
__u16 sport, __u16 dport); __u16 sport, __u16 dport);
void sctp_packet_config(struct sctp_packet *, __u32 vtag, int); void sctp_packet_config(struct sctp_packet *, __u32 vtag, int);
sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *, enum sctp_xmit sctp_packet_transmit_chunk(struct sctp_packet *packet,
struct sctp_chunk *, int, gfp_t); struct sctp_chunk *chunk,
sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *, int one_packet, gfp_t gfp);
struct sctp_chunk *); enum sctp_xmit sctp_packet_append_chunk(struct sctp_packet *packet,
struct sctp_chunk *chunk);
int sctp_packet_transmit(struct sctp_packet *, gfp_t); int sctp_packet_transmit(struct sctp_packet *, gfp_t);
void sctp_packet_free(struct sctp_packet *); void sctp_packet_free(struct sctp_packet *);
......
...@@ -57,15 +57,15 @@ ...@@ -57,15 +57,15 @@
#include <net/sctp/checksum.h> #include <net/sctp/checksum.h>
/* Forward declarations for private helpers. */ /* Forward declarations for private helpers. */
static sctp_xmit_t __sctp_packet_append_chunk(struct sctp_packet *packet, static enum sctp_xmit __sctp_packet_append_chunk(struct sctp_packet *packet,
struct sctp_chunk *chunk); struct sctp_chunk *chunk);
static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet, static enum sctp_xmit sctp_packet_can_append_data(struct sctp_packet *packet,
struct sctp_chunk *chunk); struct sctp_chunk *chunk);
static void sctp_packet_append_data(struct sctp_packet *packet, static void sctp_packet_append_data(struct sctp_packet *packet,
struct sctp_chunk *chunk); struct sctp_chunk *chunk);
static sctp_xmit_t sctp_packet_will_fit(struct sctp_packet *packet, static enum sctp_xmit sctp_packet_will_fit(struct sctp_packet *packet,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
u16 chunk_len); u16 chunk_len);
static void sctp_packet_reset(struct sctp_packet *packet) static void sctp_packet_reset(struct sctp_packet *packet)
{ {
...@@ -181,11 +181,11 @@ void sctp_packet_free(struct sctp_packet *packet) ...@@ -181,11 +181,11 @@ void sctp_packet_free(struct sctp_packet *packet)
* as it can fit in the packet, but any more data that does not fit in this * as it can fit in the packet, but any more data that does not fit in this
* packet can be sent only after receiving the COOKIE_ACK. * packet can be sent only after receiving the COOKIE_ACK.
*/ */
sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *packet, enum sctp_xmit sctp_packet_transmit_chunk(struct sctp_packet *packet,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
int one_packet, gfp_t gfp) int one_packet, gfp_t gfp)
{ {
sctp_xmit_t retval; enum sctp_xmit retval;
pr_debug("%s: packet:%p size:%zu chunk:%p size:%d\n", __func__, pr_debug("%s: packet:%p size:%zu chunk:%p size:%d\n", __func__,
packet, packet->size, chunk, chunk->skb ? chunk->skb->len : -1); packet, packet->size, chunk, chunk->skb ? chunk->skb->len : -1);
...@@ -218,12 +218,12 @@ sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *packet, ...@@ -218,12 +218,12 @@ sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *packet,
} }
/* Try to bundle an auth chunk into the packet. */ /* Try to bundle an auth chunk into the packet. */
static sctp_xmit_t sctp_packet_bundle_auth(struct sctp_packet *pkt, static enum sctp_xmit sctp_packet_bundle_auth(struct sctp_packet *pkt,
struct sctp_chunk *chunk) struct sctp_chunk *chunk)
{ {
struct sctp_association *asoc = pkt->transport->asoc; struct sctp_association *asoc = pkt->transport->asoc;
enum sctp_xmit retval = SCTP_XMIT_OK;
struct sctp_chunk *auth; struct sctp_chunk *auth;
sctp_xmit_t retval = SCTP_XMIT_OK;
/* if we don't have an association, we can't do authentication */ /* if we don't have an association, we can't do authentication */
if (!asoc) if (!asoc)
...@@ -254,10 +254,10 @@ static sctp_xmit_t sctp_packet_bundle_auth(struct sctp_packet *pkt, ...@@ -254,10 +254,10 @@ static sctp_xmit_t sctp_packet_bundle_auth(struct sctp_packet *pkt,
} }
/* Try to bundle a SACK with the packet. */ /* Try to bundle a SACK with the packet. */
static sctp_xmit_t sctp_packet_bundle_sack(struct sctp_packet *pkt, static enum sctp_xmit sctp_packet_bundle_sack(struct sctp_packet *pkt,
struct sctp_chunk *chunk) struct sctp_chunk *chunk)
{ {
sctp_xmit_t retval = SCTP_XMIT_OK; enum sctp_xmit retval = SCTP_XMIT_OK;
/* If sending DATA and haven't aleady bundled a SACK, try to /* If sending DATA and haven't aleady bundled a SACK, try to
* bundle one in to the packet. * bundle one in to the packet.
...@@ -299,11 +299,11 @@ static sctp_xmit_t sctp_packet_bundle_sack(struct sctp_packet *pkt, ...@@ -299,11 +299,11 @@ static sctp_xmit_t sctp_packet_bundle_sack(struct sctp_packet *pkt,
/* Append a chunk to the offered packet reporting back any inability to do /* Append a chunk to the offered packet reporting back any inability to do
* so. * so.
*/ */
static sctp_xmit_t __sctp_packet_append_chunk(struct sctp_packet *packet, static enum sctp_xmit __sctp_packet_append_chunk(struct sctp_packet *packet,
struct sctp_chunk *chunk) struct sctp_chunk *chunk)
{ {
sctp_xmit_t retval = SCTP_XMIT_OK;
__u16 chunk_len = SCTP_PAD4(ntohs(chunk->chunk_hdr->length)); __u16 chunk_len = SCTP_PAD4(ntohs(chunk->chunk_hdr->length));
enum sctp_xmit retval = SCTP_XMIT_OK;
/* Check to see if this chunk will fit into the packet */ /* Check to see if this chunk will fit into the packet */
retval = sctp_packet_will_fit(packet, chunk, chunk_len); retval = sctp_packet_will_fit(packet, chunk, chunk_len);
...@@ -353,10 +353,10 @@ static sctp_xmit_t __sctp_packet_append_chunk(struct sctp_packet *packet, ...@@ -353,10 +353,10 @@ static sctp_xmit_t __sctp_packet_append_chunk(struct sctp_packet *packet,
/* Append a chunk to the offered packet reporting back any inability to do /* Append a chunk to the offered packet reporting back any inability to do
* so. * so.
*/ */
sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *packet, enum sctp_xmit sctp_packet_append_chunk(struct sctp_packet *packet,
struct sctp_chunk *chunk) struct sctp_chunk *chunk)
{ {
sctp_xmit_t retval = SCTP_XMIT_OK; enum sctp_xmit retval = SCTP_XMIT_OK;
pr_debug("%s: packet:%p chunk:%p\n", __func__, packet, chunk); pr_debug("%s: packet:%p chunk:%p\n", __func__, packet, chunk);
...@@ -653,8 +653,8 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp) ...@@ -653,8 +653,8 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
********************************************************************/ ********************************************************************/
/* This private function check to see if a chunk can be added */ /* This private function check to see if a chunk can be added */
static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet, static enum sctp_xmit sctp_packet_can_append_data(struct sctp_packet *packet,
struct sctp_chunk *chunk) struct sctp_chunk *chunk)
{ {
size_t datasize, rwnd, inflight, flight_size; size_t datasize, rwnd, inflight, flight_size;
struct sctp_transport *transport = packet->transport; struct sctp_transport *transport = packet->transport;
...@@ -762,12 +762,12 @@ static void sctp_packet_append_data(struct sctp_packet *packet, ...@@ -762,12 +762,12 @@ static void sctp_packet_append_data(struct sctp_packet *packet,
sctp_chunk_assign_ssn(chunk); sctp_chunk_assign_ssn(chunk);
} }
static sctp_xmit_t sctp_packet_will_fit(struct sctp_packet *packet, static enum sctp_xmit sctp_packet_will_fit(struct sctp_packet *packet,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
u16 chunk_len) u16 chunk_len)
{ {
enum sctp_xmit retval = SCTP_XMIT_OK;
size_t psize, pmtu, maxsize; size_t psize, pmtu, maxsize;
sctp_xmit_t retval = SCTP_XMIT_OK;
psize = packet->size; psize = packet->size;
if (packet->transport->asoc) if (packet->transport->asoc)
......
...@@ -594,14 +594,14 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport, ...@@ -594,14 +594,14 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport,
static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
int rtx_timeout, int *start_timer) int rtx_timeout, int *start_timer)
{ {
struct list_head *lqueue;
struct sctp_transport *transport = pkt->transport; struct sctp_transport *transport = pkt->transport;
sctp_xmit_t status;
struct sctp_chunk *chunk, *chunk1; struct sctp_chunk *chunk, *chunk1;
int fast_rtx; struct list_head *lqueue;
enum sctp_xmit status;
int error = 0; int error = 0;
int timer = 0; int timer = 0;
int done = 0; int done = 0;
int fast_rtx;
lqueue = &q->retransmit; lqueue = &q->retransmit;
fast_rtx = q->fast_rtx; fast_rtx = q->fast_rtx;
...@@ -781,7 +781,7 @@ static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp) ...@@ -781,7 +781,7 @@ static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
struct sctp_transport *transport = NULL; struct sctp_transport *transport = NULL;
struct sctp_transport *new_transport; struct sctp_transport *new_transport;
struct sctp_chunk *chunk, *tmp; struct sctp_chunk *chunk, *tmp;
sctp_xmit_t status; enum sctp_xmit status;
int error = 0; int error = 0;
int start_timer = 0; int start_timer = 0;
int one_packet = 0; int one_packet = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment