Commit 247f0f3c authored by Ying Xue's avatar Ying Xue Committed by David S. Miller

tipc: align tipc function names with common naming practice in the network

Rename the following functions, which are shorter and more in line
with common naming practice in the network subsystem.

tipc_bclink_send_msg->tipc_bclink_xmit
tipc_bclink_recv_pkt->tipc_bclink_rcv
tipc_disc_recv_msg->tipc_disc_rcv
tipc_link_send_proto_msg->tipc_link_proto_xmit
link_recv_proto_msg->tipc_link_proto_rcv
link_send_sections_long->tipc_link_iovec_long_xmit
tipc_link_send_sections_fast->tipc_link_iovec_xmit_fast
tipc_link_send_sync->tipc_link_sync_xmit
tipc_link_recv_sync->tipc_link_sync_rcv
tipc_link_send_buf->__tipc_link_xmit
tipc_link_send->tipc_link_xmit
tipc_link_send_names->tipc_link_names_xmit
tipc_named_recv->tipc_named_rcv
tipc_link_recv_bundle->tipc_link_bundle_rcv
tipc_link_dup_send_queue->tipc_link_dup_queue_xmit
link_send_long_buf->tipc_link_frag_xmit

tipc_multicast->tipc_port_mcast_xmit
tipc_port_recv_mcast->tipc_port_mcast_rcv
tipc_port_reject_sections->tipc_port_iovec_reject
tipc_port_recv_proto_msg->tipc_port_proto_rcv
tipc_connect->tipc_port_connect
__tipc_connect->__tipc_port_connect
__tipc_disconnect->__tipc_port_disconnect
tipc_disconnect->tipc_port_disconnect
tipc_shutdown->tipc_port_shutdown
tipc_port_recv_msg->tipc_port_rcv
tipc_port_recv_sections->tipc_port_iovec_rcv

release->tipc_release
accept->tipc_accept
bind->tipc_bind
get_name->tipc_getname
poll->tipc_poll
send_msg->tipc_sendmsg
send_packet->tipc_send_packet
send_stream->tipc_send_stream
recv_msg->tipc_recvmsg
recv_stream->tipc_recv_stream
connect->tipc_connect
listen->tipc_listen
shutdown->tipc_shutdown
setsockopt->tipc_setsockopt
getsockopt->tipc_getsockopt

Above changes have no impact on current users of the functions.
Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b356e978
...@@ -356,9 +356,9 @@ static void bclink_peek_nack(struct tipc_msg *msg) ...@@ -356,9 +356,9 @@ static void bclink_peek_nack(struct tipc_msg *msg)
} }
/* /*
* tipc_bclink_send_msg - broadcast a packet to all nodes in cluster * tipc_bclink_xmit - broadcast a packet to all nodes in cluster
*/ */
int tipc_bclink_send_msg(struct sk_buff *buf) int tipc_bclink_xmit(struct sk_buff *buf)
{ {
int res; int res;
...@@ -370,7 +370,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf) ...@@ -370,7 +370,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf)
goto exit; goto exit;
} }
res = tipc_link_send_buf(bcl, buf); res = __tipc_link_xmit(bcl, buf);
if (likely(res >= 0)) { if (likely(res >= 0)) {
bclink_set_last_sent(); bclink_set_last_sent();
bcl->stats.queue_sz_counts++; bcl->stats.queue_sz_counts++;
...@@ -399,19 +399,18 @@ static void bclink_accept_pkt(struct tipc_node *node, u32 seqno) ...@@ -399,19 +399,18 @@ static void bclink_accept_pkt(struct tipc_node *node, u32 seqno)
*/ */
if (((seqno - tipc_own_addr) % TIPC_MIN_LINK_WIN) == 0) { if (((seqno - tipc_own_addr) % TIPC_MIN_LINK_WIN) == 0) {
tipc_link_send_proto_msg( tipc_link_proto_xmit(node->active_links[node->addr & 1],
node->active_links[node->addr & 1], STATE_MSG, 0, 0, 0, 0, 0);
STATE_MSG, 0, 0, 0, 0, 0);
bcl->stats.sent_acks++; bcl->stats.sent_acks++;
} }
} }
/** /**
* tipc_bclink_recv_pkt - receive a broadcast packet, and deliver upwards * tipc_bclink_rcv - receive a broadcast packet, and deliver upwards
* *
* tipc_net_lock is read_locked, no other locks set * tipc_net_lock is read_locked, no other locks set
*/ */
void tipc_bclink_recv_pkt(struct sk_buff *buf) void tipc_bclink_rcv(struct sk_buff *buf)
{ {
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
struct tipc_node *node; struct tipc_node *node;
...@@ -468,7 +467,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) ...@@ -468,7 +467,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
spin_unlock_bh(&bc_lock); spin_unlock_bh(&bc_lock);
tipc_node_unlock(node); tipc_node_unlock(node);
if (likely(msg_mcast(msg))) if (likely(msg_mcast(msg)))
tipc_port_recv_mcast(buf, NULL); tipc_port_mcast_rcv(buf, NULL);
else else
kfree_skb(buf); kfree_skb(buf);
} else if (msg_user(msg) == MSG_BUNDLER) { } else if (msg_user(msg) == MSG_BUNDLER) {
...@@ -478,7 +477,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) ...@@ -478,7 +477,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
bcl->stats.recv_bundled += msg_msgcnt(msg); bcl->stats.recv_bundled += msg_msgcnt(msg);
spin_unlock_bh(&bc_lock); spin_unlock_bh(&bc_lock);
tipc_node_unlock(node); tipc_node_unlock(node);
tipc_link_recv_bundle(buf); tipc_link_bundle_rcv(buf);
} else if (msg_user(msg) == MSG_FRAGMENTER) { } else if (msg_user(msg) == MSG_FRAGMENTER) {
int ret; int ret;
ret = tipc_link_frag_rcv(&node->bclink.reasm_head, ret = tipc_link_frag_rcv(&node->bclink.reasm_head,
...@@ -503,7 +502,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) ...@@ -503,7 +502,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
bclink_accept_pkt(node, seqno); bclink_accept_pkt(node, seqno);
spin_unlock_bh(&bc_lock); spin_unlock_bh(&bc_lock);
tipc_node_unlock(node); tipc_node_unlock(node);
tipc_named_recv(buf); tipc_named_rcv(buf);
} else { } else {
spin_lock_bh(&bc_lock); spin_lock_bh(&bc_lock);
bclink_accept_pkt(node, seqno); bclink_accept_pkt(node, seqno);
......
...@@ -90,8 +90,8 @@ void tipc_bclink_add_node(u32 addr); ...@@ -90,8 +90,8 @@ void tipc_bclink_add_node(u32 addr);
void tipc_bclink_remove_node(u32 addr); void tipc_bclink_remove_node(u32 addr);
struct tipc_node *tipc_bclink_retransmit_to(void); struct tipc_node *tipc_bclink_retransmit_to(void);
void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked); void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked);
int tipc_bclink_send_msg(struct sk_buff *buf); int tipc_bclink_xmit(struct sk_buff *buf);
void tipc_bclink_recv_pkt(struct sk_buff *buf); void tipc_bclink_rcv(struct sk_buff *buf);
u32 tipc_bclink_get_last_sent(void); u32 tipc_bclink_get_last_sent(void);
u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr); u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr);
void tipc_bclink_update_link_state(struct tipc_node *n_ptr, u32 last_sent); void tipc_bclink_update_link_state(struct tipc_node *n_ptr, u32 last_sent);
......
...@@ -110,11 +110,11 @@ static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr, ...@@ -110,11 +110,11 @@ static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr,
} }
/** /**
* tipc_disc_recv_msg - handle incoming link setup message (request or response) * tipc_disc_rcv - handle incoming link setup message (request or response)
* @buf: buffer containing message * @buf: buffer containing message
* @b_ptr: bearer that message arrived on * @b_ptr: bearer that message arrived on
*/ */
void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) void tipc_disc_rcv(struct sk_buff *buf, struct tipc_bearer *b_ptr)
{ {
struct tipc_node *n_ptr; struct tipc_node *n_ptr;
struct tipc_link *link; struct tipc_link *link;
......
...@@ -44,6 +44,6 @@ int tipc_disc_create(struct tipc_bearer *b_ptr, struct tipc_media_addr *dest, ...@@ -44,6 +44,6 @@ int tipc_disc_create(struct tipc_bearer *b_ptr, struct tipc_media_addr *dest,
void tipc_disc_delete(struct tipc_link_req *req); void tipc_disc_delete(struct tipc_link_req *req);
void tipc_disc_add_dest(struct tipc_link_req *req); void tipc_disc_add_dest(struct tipc_link_req *req);
void tipc_disc_remove_dest(struct tipc_link_req *req); void tipc_disc_remove_dest(struct tipc_link_req *req);
void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr); void tipc_disc_rcv(struct sk_buff *buf, struct tipc_bearer *b_ptr);
#endif #endif
...@@ -77,19 +77,19 @@ static const char *link_unk_evt = "Unknown link event "; ...@@ -77,19 +77,19 @@ static const char *link_unk_evt = "Unknown link event ";
static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr,
struct sk_buff *buf); struct sk_buff *buf);
static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf); static void tipc_link_proto_rcv(struct tipc_link *l_ptr, struct sk_buff *buf);
static int tipc_link_tunnel_rcv(struct tipc_node *n_ptr, static int tipc_link_tunnel_rcv(struct tipc_node *n_ptr,
struct sk_buff **buf); struct sk_buff **buf);
static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance); static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance);
static int link_send_sections_long(struct tipc_port *sender, static int tipc_link_iovec_long_xmit(struct tipc_port *sender,
struct iovec const *msg_sect, struct iovec const *msg_sect,
unsigned int len, u32 destnode); unsigned int len, u32 destnode);
static void link_state_event(struct tipc_link *l_ptr, u32 event); static void link_state_event(struct tipc_link *l_ptr, u32 event);
static void link_reset_statistics(struct tipc_link *l_ptr); static void link_reset_statistics(struct tipc_link *l_ptr);
static void link_print(struct tipc_link *l_ptr, const char *str); static void link_print(struct tipc_link *l_ptr, const char *str);
static int link_send_long_buf(struct tipc_link *l_ptr, struct sk_buff *buf); static int tipc_link_frag_xmit(struct tipc_link *l_ptr, struct sk_buff *buf);
static void tipc_link_send_sync(struct tipc_link *l); static void tipc_link_sync_xmit(struct tipc_link *l);
static void tipc_link_recv_sync(struct tipc_node *n, struct sk_buff *buf); static void tipc_link_sync_rcv(struct tipc_node *n, struct sk_buff *buf);
/* /*
* Simple link routines * Simple link routines
...@@ -512,12 +512,12 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -512,12 +512,12 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
if (l_ptr->next_in_no != l_ptr->checkpoint) { if (l_ptr->next_in_no != l_ptr->checkpoint) {
l_ptr->checkpoint = l_ptr->next_in_no; l_ptr->checkpoint = l_ptr->next_in_no;
if (tipc_bclink_acks_missing(l_ptr->owner)) { if (tipc_bclink_acks_missing(l_ptr->owner)) {
tipc_link_send_proto_msg(l_ptr, STATE_MSG, tipc_link_proto_xmit(l_ptr, STATE_MSG,
0, 0, 0, 0, 0); 0, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
} else if (l_ptr->max_pkt < l_ptr->max_pkt_target) { } else if (l_ptr->max_pkt < l_ptr->max_pkt_target) {
tipc_link_send_proto_msg(l_ptr, STATE_MSG, tipc_link_proto_xmit(l_ptr, STATE_MSG,
1, 0, 0, 0, 0); 1, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
} }
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
...@@ -525,7 +525,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -525,7 +525,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
} }
l_ptr->state = WORKING_UNKNOWN; l_ptr->state = WORKING_UNKNOWN;
l_ptr->fsm_msg_cnt = 0; l_ptr->fsm_msg_cnt = 0;
tipc_link_send_proto_msg(l_ptr, STATE_MSG, 1, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
link_set_timer(l_ptr, cont_intv / 4); link_set_timer(l_ptr, cont_intv / 4);
break; break;
...@@ -535,7 +535,8 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -535,7 +535,8 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
tipc_link_reset(l_ptr); tipc_link_reset(l_ptr);
l_ptr->state = RESET_RESET; l_ptr->state = RESET_RESET;
l_ptr->fsm_msg_cnt = 0; l_ptr->fsm_msg_cnt = 0;
tipc_link_send_proto_msg(l_ptr, ACTIVATE_MSG, 0, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG,
0, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
break; break;
...@@ -557,7 +558,8 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -557,7 +558,8 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
tipc_link_reset(l_ptr); tipc_link_reset(l_ptr);
l_ptr->state = RESET_RESET; l_ptr->state = RESET_RESET;
l_ptr->fsm_msg_cnt = 0; l_ptr->fsm_msg_cnt = 0;
tipc_link_send_proto_msg(l_ptr, ACTIVATE_MSG, 0, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG,
0, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
break; break;
...@@ -567,14 +569,14 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -567,14 +569,14 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
l_ptr->fsm_msg_cnt = 0; l_ptr->fsm_msg_cnt = 0;
l_ptr->checkpoint = l_ptr->next_in_no; l_ptr->checkpoint = l_ptr->next_in_no;
if (tipc_bclink_acks_missing(l_ptr->owner)) { if (tipc_bclink_acks_missing(l_ptr->owner)) {
tipc_link_send_proto_msg(l_ptr, STATE_MSG, tipc_link_proto_xmit(l_ptr, STATE_MSG,
0, 0, 0, 0, 0); 0, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
} }
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
} else if (l_ptr->fsm_msg_cnt < l_ptr->abort_limit) { } else if (l_ptr->fsm_msg_cnt < l_ptr->abort_limit) {
tipc_link_send_proto_msg(l_ptr, STATE_MSG, tipc_link_proto_xmit(l_ptr, STATE_MSG,
1, 0, 0, 0, 0); 1, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
link_set_timer(l_ptr, cont_intv / 4); link_set_timer(l_ptr, cont_intv / 4);
} else { /* Link has failed */ } else { /* Link has failed */
...@@ -583,8 +585,8 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -583,8 +585,8 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
tipc_link_reset(l_ptr); tipc_link_reset(l_ptr);
l_ptr->state = RESET_UNKNOWN; l_ptr->state = RESET_UNKNOWN;
l_ptr->fsm_msg_cnt = 0; l_ptr->fsm_msg_cnt = 0;
tipc_link_send_proto_msg(l_ptr, RESET_MSG, tipc_link_proto_xmit(l_ptr, RESET_MSG,
0, 0, 0, 0, 0); 0, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
} }
...@@ -604,16 +606,17 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -604,16 +606,17 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
l_ptr->state = WORKING_WORKING; l_ptr->state = WORKING_WORKING;
l_ptr->fsm_msg_cnt = 0; l_ptr->fsm_msg_cnt = 0;
link_activate(l_ptr); link_activate(l_ptr);
tipc_link_send_proto_msg(l_ptr, STATE_MSG, 1, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
if (l_ptr->owner->working_links == 1) if (l_ptr->owner->working_links == 1)
tipc_link_send_sync(l_ptr); tipc_link_sync_xmit(l_ptr);
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
break; break;
case RESET_MSG: case RESET_MSG:
l_ptr->state = RESET_RESET; l_ptr->state = RESET_RESET;
l_ptr->fsm_msg_cnt = 0; l_ptr->fsm_msg_cnt = 0;
tipc_link_send_proto_msg(l_ptr, ACTIVATE_MSG, 1, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG,
1, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
break; break;
...@@ -621,7 +624,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -621,7 +624,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
l_ptr->flags |= LINK_STARTED; l_ptr->flags |= LINK_STARTED;
/* fall through */ /* fall through */
case TIMEOUT_EVT: case TIMEOUT_EVT:
tipc_link_send_proto_msg(l_ptr, RESET_MSG, 0, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, RESET_MSG, 0, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
break; break;
...@@ -639,16 +642,17 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event) ...@@ -639,16 +642,17 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
l_ptr->state = WORKING_WORKING; l_ptr->state = WORKING_WORKING;
l_ptr->fsm_msg_cnt = 0; l_ptr->fsm_msg_cnt = 0;
link_activate(l_ptr); link_activate(l_ptr);
tipc_link_send_proto_msg(l_ptr, STATE_MSG, 1, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
if (l_ptr->owner->working_links == 1) if (l_ptr->owner->working_links == 1)
tipc_link_send_sync(l_ptr); tipc_link_sync_xmit(l_ptr);
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
break; break;
case RESET_MSG: case RESET_MSG:
break; break;
case TIMEOUT_EVT: case TIMEOUT_EVT:
tipc_link_send_proto_msg(l_ptr, ACTIVATE_MSG, 0, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, ACTIVATE_MSG,
0, 0, 0, 0, 0);
l_ptr->fsm_msg_cnt++; l_ptr->fsm_msg_cnt++;
link_set_timer(l_ptr, cont_intv); link_set_timer(l_ptr, cont_intv);
break; break;
...@@ -734,11 +738,11 @@ static void link_add_chain_to_outqueue(struct tipc_link *l_ptr, ...@@ -734,11 +738,11 @@ static void link_add_chain_to_outqueue(struct tipc_link *l_ptr,
} }
/* /*
* tipc_link_send_buf() is the 'full path' for messages, called from * tipc_link_xmit() is the 'full path' for messages, called from
* inside TIPC when the 'fast path' in tipc_send_buf * inside TIPC when the 'fast path' in tipc_send_xmit
* has failed, and from link_send() * has failed, and from link_send()
*/ */
int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf) int __tipc_link_xmit(struct tipc_link *l_ptr, struct sk_buff *buf)
{ {
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
u32 size = msg_size(msg); u32 size = msg_size(msg);
...@@ -766,7 +770,7 @@ int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf) ...@@ -766,7 +770,7 @@ int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf)
/* Fragmentation needed ? */ /* Fragmentation needed ? */
if (size > max_packet) if (size > max_packet)
return link_send_long_buf(l_ptr, buf); return tipc_link_frag_xmit(l_ptr, buf);
/* Packet can be queued or sent. */ /* Packet can be queued or sent. */
if (likely(!link_congested(l_ptr))) { if (likely(!link_congested(l_ptr))) {
...@@ -810,11 +814,11 @@ int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf) ...@@ -810,11 +814,11 @@ int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf)
} }
/* /*
* tipc_link_send(): same as tipc_link_send_buf(), but the link to use has * tipc_link_xmit(): same as __tipc_link_xmit(), but the link to use
* not been selected yet, and the the owner node is not locked * has not been selected yet, and the the owner node is not locked
* Called by TIPC internal users, e.g. the name distributor * Called by TIPC internal users, e.g. the name distributor
*/ */
int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) int tipc_link_xmit(struct sk_buff *buf, u32 dest, u32 selector)
{ {
struct tipc_link *l_ptr; struct tipc_link *l_ptr;
struct tipc_node *n_ptr; struct tipc_node *n_ptr;
...@@ -826,7 +830,7 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) ...@@ -826,7 +830,7 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
tipc_node_lock(n_ptr); tipc_node_lock(n_ptr);
l_ptr = n_ptr->active_links[selector & 1]; l_ptr = n_ptr->active_links[selector & 1];
if (l_ptr) if (l_ptr)
res = tipc_link_send_buf(l_ptr, buf); res = __tipc_link_xmit(l_ptr, buf);
else else
kfree_skb(buf); kfree_skb(buf);
tipc_node_unlock(n_ptr); tipc_node_unlock(n_ptr);
...@@ -838,14 +842,14 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) ...@@ -838,14 +842,14 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
} }
/* /*
* tipc_link_send_sync - synchronize broadcast link endpoints. * tipc_link_sync_xmit - synchronize broadcast link endpoints.
* *
* Give a newly added peer node the sequence number where it should * Give a newly added peer node the sequence number where it should
* start receiving and acking broadcast packets. * start receiving and acking broadcast packets.
* *
* Called with node locked * Called with node locked
*/ */
static void tipc_link_send_sync(struct tipc_link *l) static void tipc_link_sync_xmit(struct tipc_link *l)
{ {
struct sk_buff *buf; struct sk_buff *buf;
struct tipc_msg *msg; struct tipc_msg *msg;
...@@ -862,14 +866,14 @@ static void tipc_link_send_sync(struct tipc_link *l) ...@@ -862,14 +866,14 @@ static void tipc_link_send_sync(struct tipc_link *l)
} }
/* /*
* tipc_link_recv_sync - synchronize broadcast link endpoints. * tipc_link_sync_rcv - synchronize broadcast link endpoints.
* Receive the sequence number where we should start receiving and * Receive the sequence number where we should start receiving and
* acking broadcast packets from a newly added peer node, and open * acking broadcast packets from a newly added peer node, and open
* up for reception of such packets. * up for reception of such packets.
* *
* Called with node locked * Called with node locked
*/ */
static void tipc_link_recv_sync(struct tipc_node *n, struct sk_buff *buf) static void tipc_link_sync_rcv(struct tipc_node *n, struct sk_buff *buf)
{ {
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
...@@ -879,7 +883,7 @@ static void tipc_link_recv_sync(struct tipc_node *n, struct sk_buff *buf) ...@@ -879,7 +883,7 @@ static void tipc_link_recv_sync(struct tipc_node *n, struct sk_buff *buf)
} }
/* /*
* tipc_link_send_names - send name table entries to new neighbor * tipc_link_names_xmit - send name table entries to new neighbor
* *
* Send routine for bulk delivery of name table messages when contact * Send routine for bulk delivery of name table messages when contact
* with a new neighbor occurs. No link congestion checking is performed * with a new neighbor occurs. No link congestion checking is performed
...@@ -887,7 +891,7 @@ static void tipc_link_recv_sync(struct tipc_node *n, struct sk_buff *buf) ...@@ -887,7 +891,7 @@ static void tipc_link_recv_sync(struct tipc_node *n, struct sk_buff *buf)
* small enough not to require fragmentation. * small enough not to require fragmentation.
* Called without any locks held. * Called without any locks held.
*/ */
void tipc_link_send_names(struct list_head *message_list, u32 dest) void tipc_link_names_xmit(struct list_head *message_list, u32 dest)
{ {
struct tipc_node *n_ptr; struct tipc_node *n_ptr;
struct tipc_link *l_ptr; struct tipc_link *l_ptr;
...@@ -922,13 +926,13 @@ void tipc_link_send_names(struct list_head *message_list, u32 dest) ...@@ -922,13 +926,13 @@ void tipc_link_send_names(struct list_head *message_list, u32 dest)
} }
/* /*
* link_send_buf_fast: Entry for data messages where the * tipc_link_xmit_fast: Entry for data messages where the
* destination link is known and the header is complete, * destination link is known and the header is complete,
* inclusive total message length. Very time critical. * inclusive total message length. Very time critical.
* Link is locked. Returns user data length. * Link is locked. Returns user data length.
*/ */
static int link_send_buf_fast(struct tipc_link *l_ptr, struct sk_buff *buf, static int tipc_link_xmit_fast(struct tipc_link *l_ptr, struct sk_buff *buf,
u32 *used_max_pkt) u32 *used_max_pkt)
{ {
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
int res = msg_data_sz(msg); int res = msg_data_sz(msg);
...@@ -944,18 +948,18 @@ static int link_send_buf_fast(struct tipc_link *l_ptr, struct sk_buff *buf, ...@@ -944,18 +948,18 @@ static int link_send_buf_fast(struct tipc_link *l_ptr, struct sk_buff *buf,
else else
*used_max_pkt = l_ptr->max_pkt; *used_max_pkt = l_ptr->max_pkt;
} }
return tipc_link_send_buf(l_ptr, buf); /* All other cases */ return __tipc_link_xmit(l_ptr, buf); /* All other cases */
} }
/* /*
* tipc_link_send_sections_fast: Entry for messages where the * tipc_link_iovec_xmit_fast: Entry for messages where the
* destination processor is known and the header is complete, * destination processor is known and the header is complete,
* except for total message length. * except for total message length.
* Returns user data length or errno. * Returns user data length or errno.
*/ */
int tipc_link_send_sections_fast(struct tipc_port *sender, int tipc_link_iovec_xmit_fast(struct tipc_port *sender,
struct iovec const *msg_sect, struct iovec const *msg_sect,
unsigned int len, u32 destaddr) unsigned int len, u32 destaddr)
{ {
struct tipc_msg *hdr = &sender->phdr; struct tipc_msg *hdr = &sender->phdr;
struct tipc_link *l_ptr; struct tipc_link *l_ptr;
...@@ -981,8 +985,8 @@ int tipc_link_send_sections_fast(struct tipc_port *sender, ...@@ -981,8 +985,8 @@ int tipc_link_send_sections_fast(struct tipc_port *sender,
l_ptr = node->active_links[selector]; l_ptr = node->active_links[selector];
if (likely(l_ptr)) { if (likely(l_ptr)) {
if (likely(buf)) { if (likely(buf)) {
res = link_send_buf_fast(l_ptr, buf, res = tipc_link_xmit_fast(l_ptr, buf,
&sender->max_pkt); &sender->max_pkt);
exit: exit:
tipc_node_unlock(node); tipc_node_unlock(node);
read_unlock_bh(&tipc_net_lock); read_unlock_bh(&tipc_net_lock);
...@@ -1008,8 +1012,8 @@ int tipc_link_send_sections_fast(struct tipc_port *sender, ...@@ -1008,8 +1012,8 @@ int tipc_link_send_sections_fast(struct tipc_port *sender,
if ((msg_hdr_sz(hdr) + res) <= sender->max_pkt) if ((msg_hdr_sz(hdr) + res) <= sender->max_pkt)
goto again; goto again;
return link_send_sections_long(sender, msg_sect, len, return tipc_link_iovec_long_xmit(sender, msg_sect,
destaddr); len, destaddr);
} }
tipc_node_unlock(node); tipc_node_unlock(node);
} }
...@@ -1019,13 +1023,13 @@ int tipc_link_send_sections_fast(struct tipc_port *sender, ...@@ -1019,13 +1023,13 @@ int tipc_link_send_sections_fast(struct tipc_port *sender,
if (buf) if (buf)
return tipc_reject_msg(buf, TIPC_ERR_NO_NODE); return tipc_reject_msg(buf, TIPC_ERR_NO_NODE);
if (res >= 0) if (res >= 0)
return tipc_port_reject_sections(sender, hdr, msg_sect, return tipc_port_iovec_reject(sender, hdr, msg_sect, len,
len, TIPC_ERR_NO_NODE); TIPC_ERR_NO_NODE);
return res; return res;
} }
/* /*
* link_send_sections_long(): Entry for long messages where the * tipc_link_iovec_long_xmit(): Entry for long messages where the
* destination node is known and the header is complete, * destination node is known and the header is complete,
* inclusive total message length. * inclusive total message length.
* Link and bearer congestion status have been checked to be ok, * Link and bearer congestion status have been checked to be ok,
...@@ -1038,9 +1042,9 @@ int tipc_link_send_sections_fast(struct tipc_port *sender, ...@@ -1038,9 +1042,9 @@ int tipc_link_send_sections_fast(struct tipc_port *sender,
* *
* Returns user data length or errno. * Returns user data length or errno.
*/ */
static int link_send_sections_long(struct tipc_port *sender, static int tipc_link_iovec_long_xmit(struct tipc_port *sender,
struct iovec const *msg_sect, struct iovec const *msg_sect,
unsigned int len, u32 destaddr) unsigned int len, u32 destaddr)
{ {
struct tipc_link *l_ptr; struct tipc_link *l_ptr;
struct tipc_node *node; struct tipc_node *node;
...@@ -1159,8 +1163,8 @@ static int link_send_sections_long(struct tipc_port *sender, ...@@ -1159,8 +1163,8 @@ static int link_send_sections_long(struct tipc_port *sender,
} else { } else {
reject: reject:
kfree_skb_list(buf_chain); kfree_skb_list(buf_chain);
return tipc_port_reject_sections(sender, hdr, msg_sect, return tipc_port_iovec_reject(sender, hdr, msg_sect,
len, TIPC_ERR_NO_NODE); len, TIPC_ERR_NO_NODE);
} }
/* Append chain of fragments to send queue & send them */ /* Append chain of fragments to send queue & send them */
...@@ -1469,9 +1473,9 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr) ...@@ -1469,9 +1473,9 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr)
if (unlikely(msg_non_seq(msg))) { if (unlikely(msg_non_seq(msg))) {
if (msg_user(msg) == LINK_CONFIG) if (msg_user(msg) == LINK_CONFIG)
tipc_disc_recv_msg(buf, b_ptr); tipc_disc_rcv(buf, b_ptr);
else else
tipc_bclink_recv_pkt(buf); tipc_bclink_rcv(buf);
continue; continue;
} }
...@@ -1532,14 +1536,13 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr) ...@@ -1532,14 +1536,13 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr)
if (unlikely(++l_ptr->unacked_window >= TIPC_MIN_LINK_WIN)) { if (unlikely(++l_ptr->unacked_window >= TIPC_MIN_LINK_WIN)) {
l_ptr->stats.sent_acks++; l_ptr->stats.sent_acks++;
tipc_link_send_proto_msg(l_ptr, STATE_MSG, tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0, 0);
0, 0, 0, 0, 0);
} }
/* Process the incoming packet */ /* Process the incoming packet */
if (unlikely(!link_working_working(l_ptr))) { if (unlikely(!link_working_working(l_ptr))) {
if (msg_user(msg) == LINK_PROTOCOL) { if (msg_user(msg) == LINK_PROTOCOL) {
link_recv_proto_msg(l_ptr, buf); tipc_link_proto_rcv(l_ptr, buf);
head = link_insert_deferred_queue(l_ptr, head); head = link_insert_deferred_queue(l_ptr, head);
tipc_node_unlock(n_ptr); tipc_node_unlock(n_ptr);
continue; continue;
...@@ -1600,25 +1603,25 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr) ...@@ -1600,25 +1603,25 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr)
case TIPC_HIGH_IMPORTANCE: case TIPC_HIGH_IMPORTANCE:
case TIPC_CRITICAL_IMPORTANCE: case TIPC_CRITICAL_IMPORTANCE:
tipc_node_unlock(n_ptr); tipc_node_unlock(n_ptr);
tipc_port_recv_msg(buf); tipc_port_rcv(buf);
continue; continue;
case MSG_BUNDLER: case MSG_BUNDLER:
l_ptr->stats.recv_bundles++; l_ptr->stats.recv_bundles++;
l_ptr->stats.recv_bundled += msg_msgcnt(msg); l_ptr->stats.recv_bundled += msg_msgcnt(msg);
tipc_node_unlock(n_ptr); tipc_node_unlock(n_ptr);
tipc_link_recv_bundle(buf); tipc_link_bundle_rcv(buf);
continue; continue;
case NAME_DISTRIBUTOR: case NAME_DISTRIBUTOR:
n_ptr->bclink.recv_permitted = true; n_ptr->bclink.recv_permitted = true;
tipc_node_unlock(n_ptr); tipc_node_unlock(n_ptr);
tipc_named_recv(buf); tipc_named_rcv(buf);
continue; continue;
case CONN_MANAGER: case CONN_MANAGER:
tipc_node_unlock(n_ptr); tipc_node_unlock(n_ptr);
tipc_port_recv_proto_msg(buf); tipc_port_proto_rcv(buf);
continue; continue;
case BCAST_PROTOCOL: case BCAST_PROTOCOL:
tipc_link_recv_sync(n_ptr, buf); tipc_link_sync_rcv(n_ptr, buf);
break; break;
default: default:
kfree_skb(buf); kfree_skb(buf);
...@@ -1693,7 +1696,7 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, ...@@ -1693,7 +1696,7 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr,
u32 seq_no = buf_seqno(buf); u32 seq_no = buf_seqno(buf);
if (likely(msg_user(buf_msg(buf)) == LINK_PROTOCOL)) { if (likely(msg_user(buf_msg(buf)) == LINK_PROTOCOL)) {
link_recv_proto_msg(l_ptr, buf); tipc_link_proto_rcv(l_ptr, buf);
return; return;
} }
...@@ -1715,7 +1718,7 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, ...@@ -1715,7 +1718,7 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr,
l_ptr->deferred_inqueue_sz++; l_ptr->deferred_inqueue_sz++;
l_ptr->stats.deferred_recv++; l_ptr->stats.deferred_recv++;
if ((l_ptr->deferred_inqueue_sz % 16) == 1) if ((l_ptr->deferred_inqueue_sz % 16) == 1)
tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0, 0);
} else } else
l_ptr->stats.duplicates++; l_ptr->stats.duplicates++;
} }
...@@ -1723,9 +1726,8 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, ...@@ -1723,9 +1726,8 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr,
/* /*
* Send protocol message to the other endpoint. * Send protocol message to the other endpoint.
*/ */
void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ, void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int probe_msg,
int probe_msg, u32 gap, u32 tolerance, u32 gap, u32 tolerance, u32 priority, u32 ack_mtu)
u32 priority, u32 ack_mtu)
{ {
struct sk_buff *buf = NULL; struct sk_buff *buf = NULL;
struct tipc_msg *msg = l_ptr->pmsg; struct tipc_msg *msg = l_ptr->pmsg;
...@@ -1824,7 +1826,7 @@ void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ, ...@@ -1824,7 +1826,7 @@ void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ,
* Note that network plane id propagates through the network, and may * Note that network plane id propagates through the network, and may
* change at any time. The node with lowest address rules * change at any time. The node with lowest address rules
*/ */
static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf) static void tipc_link_proto_rcv(struct tipc_link *l_ptr, struct sk_buff *buf)
{ {
u32 rec_gap = 0; u32 rec_gap = 0;
u32 max_pkt_info; u32 max_pkt_info;
...@@ -1943,8 +1945,8 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf) ...@@ -1943,8 +1945,8 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf)
msg_last_bcast(msg)); msg_last_bcast(msg));
if (rec_gap || (msg_probe(msg))) { if (rec_gap || (msg_probe(msg))) {
tipc_link_send_proto_msg(l_ptr, STATE_MSG, tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, rec_gap, 0,
0, rec_gap, 0, 0, max_pkt_ack); 0, max_pkt_ack);
} }
if (msg_seq_gap(msg)) { if (msg_seq_gap(msg)) {
l_ptr->stats.recv_nacks++; l_ptr->stats.recv_nacks++;
...@@ -1983,7 +1985,7 @@ static void tipc_link_tunnel_xmit(struct tipc_link *l_ptr, ...@@ -1983,7 +1985,7 @@ static void tipc_link_tunnel_xmit(struct tipc_link *l_ptr,
} }
skb_copy_to_linear_data(buf, tunnel_hdr, INT_H_SIZE); skb_copy_to_linear_data(buf, tunnel_hdr, INT_H_SIZE);
skb_copy_to_linear_data_offset(buf, INT_H_SIZE, msg, length); skb_copy_to_linear_data_offset(buf, INT_H_SIZE, msg, length);
tipc_link_send_buf(tunnel, buf); __tipc_link_xmit(tunnel, buf);
} }
...@@ -2016,7 +2018,7 @@ void tipc_link_failover_send_queue(struct tipc_link *l_ptr) ...@@ -2016,7 +2018,7 @@ void tipc_link_failover_send_queue(struct tipc_link *l_ptr)
if (buf) { if (buf) {
skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE); skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE);
msg_set_size(&tunnel_hdr, INT_H_SIZE); msg_set_size(&tunnel_hdr, INT_H_SIZE);
tipc_link_send_buf(tunnel, buf); __tipc_link_xmit(tunnel, buf);
} else { } else {
pr_warn("%sunable to send changeover msg\n", pr_warn("%sunable to send changeover msg\n",
link_co_err); link_co_err);
...@@ -2050,7 +2052,7 @@ void tipc_link_failover_send_queue(struct tipc_link *l_ptr) ...@@ -2050,7 +2052,7 @@ void tipc_link_failover_send_queue(struct tipc_link *l_ptr)
} }
} }
/* tipc_link_dup_send_queue(): A second link has become active. Tunnel a /* tipc_link_dup_queue_xmit(): A second link has become active. Tunnel a
* duplicate of the first link's send queue via the new link. This way, we * duplicate of the first link's send queue via the new link. This way, we
* are guaranteed that currently queued packets from a socket are delivered * are guaranteed that currently queued packets from a socket are delivered
* before future traffic from the same socket, even if this is using the * before future traffic from the same socket, even if this is using the
...@@ -2059,7 +2061,7 @@ void tipc_link_failover_send_queue(struct tipc_link *l_ptr) ...@@ -2059,7 +2061,7 @@ void tipc_link_failover_send_queue(struct tipc_link *l_ptr)
* and sequence order is preserved per sender/receiver socket pair. * and sequence order is preserved per sender/receiver socket pair.
* Owner node is locked. * Owner node is locked.
*/ */
void tipc_link_dup_send_queue(struct tipc_link *l_ptr, void tipc_link_dup_queue_xmit(struct tipc_link *l_ptr,
struct tipc_link *tunnel) struct tipc_link *tunnel)
{ {
struct sk_buff *iter; struct sk_buff *iter;
...@@ -2089,7 +2091,7 @@ void tipc_link_dup_send_queue(struct tipc_link *l_ptr, ...@@ -2089,7 +2091,7 @@ void tipc_link_dup_send_queue(struct tipc_link *l_ptr,
skb_copy_to_linear_data(outbuf, &tunnel_hdr, INT_H_SIZE); skb_copy_to_linear_data(outbuf, &tunnel_hdr, INT_H_SIZE);
skb_copy_to_linear_data_offset(outbuf, INT_H_SIZE, iter->data, skb_copy_to_linear_data_offset(outbuf, INT_H_SIZE, iter->data,
length); length);
tipc_link_send_buf(tunnel, outbuf); __tipc_link_xmit(tunnel, outbuf);
if (!tipc_link_is_up(l_ptr)) if (!tipc_link_is_up(l_ptr))
return; return;
iter = iter->next; iter = iter->next;
...@@ -2223,7 +2225,7 @@ static int tipc_link_tunnel_rcv(struct tipc_node *n_ptr, ...@@ -2223,7 +2225,7 @@ static int tipc_link_tunnel_rcv(struct tipc_node *n_ptr,
/* /*
* Bundler functionality: * Bundler functionality:
*/ */
void tipc_link_recv_bundle(struct sk_buff *buf) void tipc_link_bundle_rcv(struct sk_buff *buf)
{ {
u32 msgcount = msg_msgcnt(buf_msg(buf)); u32 msgcount = msg_msgcnt(buf_msg(buf));
u32 pos = INT_H_SIZE; u32 pos = INT_H_SIZE;
...@@ -2246,11 +2248,11 @@ void tipc_link_recv_bundle(struct sk_buff *buf) ...@@ -2246,11 +2248,11 @@ void tipc_link_recv_bundle(struct sk_buff *buf)
*/ */
/* /*
* link_send_long_buf: Entry for buffers needing fragmentation. * tipc_link_frag_xmit: Entry for buffers needing fragmentation.
* The buffer is complete, inclusive total message length. * The buffer is complete, inclusive total message length.
* Returns user data length. * Returns user data length.
*/ */
static int link_send_long_buf(struct tipc_link *l_ptr, struct sk_buff *buf) static int tipc_link_frag_xmit(struct tipc_link *l_ptr, struct sk_buff *buf)
{ {
struct sk_buff *buf_chain = NULL; struct sk_buff *buf_chain = NULL;
struct sk_buff *buf_chain_tail = (struct sk_buff *)&buf_chain; struct sk_buff *buf_chain_tail = (struct sk_buff *)&buf_chain;
...@@ -2477,13 +2479,13 @@ static int link_cmd_set_value(const char *name, u32 new_value, u16 cmd) ...@@ -2477,13 +2479,13 @@ static int link_cmd_set_value(const char *name, u32 new_value, u16 cmd)
switch (cmd) { switch (cmd) {
case TIPC_CMD_SET_LINK_TOL: case TIPC_CMD_SET_LINK_TOL:
link_set_supervision_props(l_ptr, new_value); link_set_supervision_props(l_ptr, new_value);
tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0,
0, new_value, 0, 0); new_value, 0, 0);
break; break;
case TIPC_CMD_SET_LINK_PRI: case TIPC_CMD_SET_LINK_PRI:
l_ptr->priority = new_value; l_ptr->priority = new_value;
tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0,
0, 0, new_value, 0); 0, new_value, 0);
break; break;
case TIPC_CMD_SET_LINK_WINDOW: case TIPC_CMD_SET_LINK_WINDOW:
tipc_link_set_queue_limits(l_ptr, new_value); tipc_link_set_queue_limits(l_ptr, new_value);
......
...@@ -216,8 +216,7 @@ struct tipc_link *tipc_link_create(struct tipc_node *n_ptr, ...@@ -216,8 +216,7 @@ struct tipc_link *tipc_link_create(struct tipc_node *n_ptr,
const struct tipc_media_addr *media_addr); const struct tipc_media_addr *media_addr);
void tipc_link_delete_list(unsigned int bearer_id, bool shutting_down); void tipc_link_delete_list(unsigned int bearer_id, bool shutting_down);
void tipc_link_failover_send_queue(struct tipc_link *l_ptr); void tipc_link_failover_send_queue(struct tipc_link *l_ptr);
void tipc_link_dup_send_queue(struct tipc_link *l_ptr, void tipc_link_dup_queue_xmit(struct tipc_link *l_ptr, struct tipc_link *dest);
struct tipc_link *dest);
void tipc_link_reset_fragments(struct tipc_link *l_ptr); void tipc_link_reset_fragments(struct tipc_link *l_ptr);
int tipc_link_is_up(struct tipc_link *l_ptr); int tipc_link_is_up(struct tipc_link *l_ptr);
int tipc_link_is_active(struct tipc_link *l_ptr); int tipc_link_is_active(struct tipc_link *l_ptr);
...@@ -231,23 +230,23 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, ...@@ -231,23 +230,23 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area,
int req_tlv_space); int req_tlv_space);
void tipc_link_reset(struct tipc_link *l_ptr); void tipc_link_reset(struct tipc_link *l_ptr);
void tipc_link_reset_list(unsigned int bearer_id); void tipc_link_reset_list(unsigned int bearer_id);
int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector); int tipc_link_xmit(struct sk_buff *buf, u32 dest, u32 selector);
void tipc_link_send_names(struct list_head *message_list, u32 dest); void tipc_link_names_xmit(struct list_head *message_list, u32 dest);
int __tipc_link_xmit(struct tipc_link *l_ptr, struct sk_buff *buf);
int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf); int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf);
u32 tipc_link_get_max_pkt(u32 dest, u32 selector); u32 tipc_link_get_max_pkt(u32 dest, u32 selector);
int tipc_link_send_sections_fast(struct tipc_port *sender, int tipc_link_iovec_xmit_fast(struct tipc_port *sender,
struct iovec const *msg_sect, struct iovec const *msg_sect,
unsigned int len, u32 destnode); unsigned int len, u32 destnode);
void tipc_link_recv_bundle(struct sk_buff *buf); void tipc_link_bundle_rcv(struct sk_buff *buf);
int tipc_link_frag_rcv(struct sk_buff **reasm_head, int tipc_link_frag_rcv(struct sk_buff **reasm_head,
struct sk_buff **reasm_tail, struct sk_buff **reasm_tail,
struct sk_buff **fbuf); struct sk_buff **fbuf);
void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ, int prob, void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int prob,
u32 gap, u32 tolerance, u32 priority, u32 gap, u32 tolerance, u32 priority, u32 acked_mtu);
u32 acked_mtu);
void tipc_link_push_queue(struct tipc_link *l_ptr); void tipc_link_push_queue(struct tipc_link *l_ptr);
u32 tipc_link_defer_pkt(struct sk_buff **head, struct sk_buff **tail, u32 tipc_link_defer_pkt(struct sk_buff **head, struct sk_buff **tail,
struct sk_buff *buf); struct sk_buff *buf);
void tipc_link_wakeup_ports(struct tipc_link *l_ptr, int all); void tipc_link_wakeup_ports(struct tipc_link *l_ptr, int all);
void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window); void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window);
void tipc_link_retransmit(struct tipc_link *l_ptr, void tipc_link_retransmit(struct tipc_link *l_ptr,
......
...@@ -138,7 +138,7 @@ static void named_cluster_distribute(struct sk_buff *buf) ...@@ -138,7 +138,7 @@ static void named_cluster_distribute(struct sk_buff *buf)
if (!buf_copy) if (!buf_copy)
break; break;
msg_set_destnode(buf_msg(buf_copy), n_ptr->addr); msg_set_destnode(buf_msg(buf_copy), n_ptr->addr);
tipc_link_send(buf_copy, n_ptr->addr, n_ptr->addr); tipc_link_xmit(buf_copy, n_ptr->addr, n_ptr->addr);
} }
} }
...@@ -262,7 +262,7 @@ void tipc_named_node_up(unsigned long nodearg) ...@@ -262,7 +262,7 @@ void tipc_named_node_up(unsigned long nodearg)
named_distribute(&message_list, node, &publ_zone, max_item_buf); named_distribute(&message_list, node, &publ_zone, max_item_buf);
read_unlock_bh(&tipc_nametbl_lock); read_unlock_bh(&tipc_nametbl_lock);
tipc_link_send_names(&message_list, node); tipc_link_names_xmit(&message_list, node);
} }
/** /**
...@@ -293,9 +293,9 @@ static void named_purge_publ(struct publication *publ) ...@@ -293,9 +293,9 @@ static void named_purge_publ(struct publication *publ)
} }
/** /**
* tipc_named_recv - process name table update message sent by another node * tipc_named_rcv - process name table update message sent by another node
*/ */
void tipc_named_recv(struct sk_buff *buf) void tipc_named_rcv(struct sk_buff *buf)
{ {
struct publication *publ; struct publication *publ;
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
void tipc_named_publish(struct publication *publ); void tipc_named_publish(struct publication *publ);
void tipc_named_withdraw(struct publication *publ); void tipc_named_withdraw(struct publication *publ);
void tipc_named_node_up(unsigned long node); void tipc_named_node_up(unsigned long node);
void tipc_named_recv(struct sk_buff *buf); void tipc_named_rcv(struct sk_buff *buf);
void tipc_named_reinit(void); void tipc_named_reinit(void);
#endif #endif
...@@ -146,19 +146,19 @@ void tipc_net_route_msg(struct sk_buff *buf) ...@@ -146,19 +146,19 @@ void tipc_net_route_msg(struct sk_buff *buf)
if (tipc_in_scope(dnode, tipc_own_addr)) { if (tipc_in_scope(dnode, tipc_own_addr)) {
if (msg_isdata(msg)) { if (msg_isdata(msg)) {
if (msg_mcast(msg)) if (msg_mcast(msg))
tipc_port_recv_mcast(buf, NULL); tipc_port_mcast_rcv(buf, NULL);
else if (msg_destport(msg)) else if (msg_destport(msg))
tipc_port_recv_msg(buf); tipc_port_rcv(buf);
else else
net_route_named_msg(buf); net_route_named_msg(buf);
return; return;
} }
switch (msg_user(msg)) { switch (msg_user(msg)) {
case NAME_DISTRIBUTOR: case NAME_DISTRIBUTOR:
tipc_named_recv(buf); tipc_named_rcv(buf);
break; break;
case CONN_MANAGER: case CONN_MANAGER:
tipc_port_recv_proto_msg(buf); tipc_port_proto_rcv(buf);
break; break;
default: default:
kfree_skb(buf); kfree_skb(buf);
...@@ -168,7 +168,7 @@ void tipc_net_route_msg(struct sk_buff *buf) ...@@ -168,7 +168,7 @@ void tipc_net_route_msg(struct sk_buff *buf)
/* Handle message for another node */ /* Handle message for another node */
skb_trim(buf, msg_size(msg)); skb_trim(buf, msg_size(msg));
tipc_link_send(buf, dnode, msg_link_selector(msg)); tipc_link_xmit(buf, dnode, msg_link_selector(msg));
} }
void tipc_net_start(u32 addr) void tipc_net_start(u32 addr)
......
...@@ -162,7 +162,7 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr) ...@@ -162,7 +162,7 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
pr_info("New link <%s> becomes standby\n", l_ptr->name); pr_info("New link <%s> becomes standby\n", l_ptr->name);
return; return;
} }
tipc_link_dup_send_queue(active[0], l_ptr); tipc_link_dup_queue_xmit(active[0], l_ptr);
if (l_ptr->priority == active[0]->priority) { if (l_ptr->priority == active[0]->priority) {
active[0] = l_ptr; active[0] = l_ptr;
return; return;
......
...@@ -87,10 +87,11 @@ int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg) ...@@ -87,10 +87,11 @@ int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg)
} }
/** /**
* tipc_multicast - send a multicast message to local and remote destinations * tipc_port_mcast_xmit - send a multicast message to local and remote
* destinations
*/ */
int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, int tipc_port_mcast_xmit(u32 ref, struct tipc_name_seq const *seq,
struct iovec const *msg_sect, unsigned int len) struct iovec const *msg_sect, unsigned int len)
{ {
struct tipc_msg *hdr; struct tipc_msg *hdr;
struct sk_buff *buf; struct sk_buff *buf;
...@@ -131,7 +132,7 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, ...@@ -131,7 +132,7 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq,
return -ENOMEM; return -ENOMEM;
} }
} }
res = tipc_bclink_send_msg(buf); res = tipc_bclink_xmit(buf);
if ((res < 0) && (dports.count != 0)) if ((res < 0) && (dports.count != 0))
kfree_skb(ibuf); kfree_skb(ibuf);
} else { } else {
...@@ -140,7 +141,7 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, ...@@ -140,7 +141,7 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq,
if (res >= 0) { if (res >= 0) {
if (ibuf) if (ibuf)
tipc_port_recv_mcast(ibuf, &dports); tipc_port_mcast_rcv(ibuf, &dports);
} else { } else {
tipc_port_list_free(&dports); tipc_port_list_free(&dports);
} }
...@@ -148,11 +149,11 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq, ...@@ -148,11 +149,11 @@ int tipc_multicast(u32 ref, struct tipc_name_seq const *seq,
} }
/** /**
* tipc_port_recv_mcast - deliver multicast message to all destination ports * tipc_port_mcast_rcv - deliver multicast message to all destination ports
* *
* If there is no port list, perform a lookup to create one * If there is no port list, perform a lookup to create one
*/ */
void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp) void tipc_port_mcast_rcv(struct sk_buff *buf, struct tipc_port_list *dp)
{ {
struct tipc_msg *msg; struct tipc_msg *msg;
struct tipc_port_list dports = {0, NULL, }; struct tipc_port_list dports = {0, NULL, };
...@@ -176,7 +177,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp) ...@@ -176,7 +177,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp)
msg_set_destnode(msg, tipc_own_addr); msg_set_destnode(msg, tipc_own_addr);
if (dp->count == 1) { if (dp->count == 1) {
msg_set_destport(msg, dp->ports[0]); msg_set_destport(msg, dp->ports[0]);
tipc_port_recv_msg(buf); tipc_port_rcv(buf);
tipc_port_list_free(dp); tipc_port_list_free(dp);
return; return;
} }
...@@ -191,7 +192,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp) ...@@ -191,7 +192,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp)
if ((index == 0) && (cnt != 0)) if ((index == 0) && (cnt != 0))
item = item->next; item = item->next;
msg_set_destport(buf_msg(b), item->ports[index]); msg_set_destport(buf_msg(b), item->ports[index]);
tipc_port_recv_msg(b); tipc_port_rcv(b);
} }
} }
exit: exit:
...@@ -422,17 +423,17 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err) ...@@ -422,17 +423,17 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
/* send returned message & dispose of rejected message */ /* send returned message & dispose of rejected message */
src_node = msg_prevnode(msg); src_node = msg_prevnode(msg);
if (in_own_node(src_node)) if (in_own_node(src_node))
tipc_port_recv_msg(rbuf); tipc_port_rcv(rbuf);
else else
tipc_link_send(rbuf, src_node, msg_link_selector(rmsg)); tipc_link_xmit(rbuf, src_node, msg_link_selector(rmsg));
exit: exit:
kfree_skb(buf); kfree_skb(buf);
return data_sz; return data_sz;
} }
int tipc_port_reject_sections(struct tipc_port *p_ptr, struct tipc_msg *hdr, int tipc_port_iovec_reject(struct tipc_port *p_ptr, struct tipc_msg *hdr,
struct iovec const *msg_sect, unsigned int len, struct iovec const *msg_sect, unsigned int len,
int err) int err)
{ {
struct sk_buff *buf; struct sk_buff *buf;
int res; int res;
...@@ -519,7 +520,7 @@ static struct sk_buff *port_build_peer_abort_msg(struct tipc_port *p_ptr, u32 er ...@@ -519,7 +520,7 @@ static struct sk_buff *port_build_peer_abort_msg(struct tipc_port *p_ptr, u32 er
return buf; return buf;
} }
void tipc_port_recv_proto_msg(struct sk_buff *buf) void tipc_port_proto_rcv(struct sk_buff *buf)
{ {
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
struct tipc_port *p_ptr; struct tipc_port *p_ptr;
...@@ -760,7 +761,7 @@ int tipc_withdraw(struct tipc_port *p_ptr, unsigned int scope, ...@@ -760,7 +761,7 @@ int tipc_withdraw(struct tipc_port *p_ptr, unsigned int scope,
return res; return res;
} }
int tipc_connect(u32 ref, struct tipc_portid const *peer) int tipc_port_connect(u32 ref, struct tipc_portid const *peer)
{ {
struct tipc_port *p_ptr; struct tipc_port *p_ptr;
int res; int res;
...@@ -768,17 +769,17 @@ int tipc_connect(u32 ref, struct tipc_portid const *peer) ...@@ -768,17 +769,17 @@ int tipc_connect(u32 ref, struct tipc_portid const *peer)
p_ptr = tipc_port_lock(ref); p_ptr = tipc_port_lock(ref);
if (!p_ptr) if (!p_ptr)
return -EINVAL; return -EINVAL;
res = __tipc_connect(ref, p_ptr, peer); res = __tipc_port_connect(ref, p_ptr, peer);
tipc_port_unlock(p_ptr); tipc_port_unlock(p_ptr);
return res; return res;
} }
/* /*
* __tipc_connect - connect to a remote peer * __tipc_port_connect - connect to a remote peer
* *
* Port must be locked. * Port must be locked.
*/ */
int __tipc_connect(u32 ref, struct tipc_port *p_ptr, int __tipc_port_connect(u32 ref, struct tipc_port *p_ptr,
struct tipc_portid const *peer) struct tipc_portid const *peer)
{ {
struct tipc_msg *msg; struct tipc_msg *msg;
...@@ -815,7 +816,7 @@ int __tipc_connect(u32 ref, struct tipc_port *p_ptr, ...@@ -815,7 +816,7 @@ int __tipc_connect(u32 ref, struct tipc_port *p_ptr,
* *
* Port must be locked. * Port must be locked.
*/ */
int __tipc_disconnect(struct tipc_port *tp_ptr) int __tipc_port_disconnect(struct tipc_port *tp_ptr)
{ {
if (tp_ptr->connected) { if (tp_ptr->connected) {
tp_ptr->connected = 0; tp_ptr->connected = 0;
...@@ -828,10 +829,10 @@ int __tipc_disconnect(struct tipc_port *tp_ptr) ...@@ -828,10 +829,10 @@ int __tipc_disconnect(struct tipc_port *tp_ptr)
} }
/* /*
* tipc_disconnect(): Disconnect port form peer. * tipc_port_disconnect(): Disconnect port form peer.
* This is a node local operation. * This is a node local operation.
*/ */
int tipc_disconnect(u32 ref) int tipc_port_disconnect(u32 ref)
{ {
struct tipc_port *p_ptr; struct tipc_port *p_ptr;
int res; int res;
...@@ -839,15 +840,15 @@ int tipc_disconnect(u32 ref) ...@@ -839,15 +840,15 @@ int tipc_disconnect(u32 ref)
p_ptr = tipc_port_lock(ref); p_ptr = tipc_port_lock(ref);
if (!p_ptr) if (!p_ptr)
return -EINVAL; return -EINVAL;
res = __tipc_disconnect(p_ptr); res = __tipc_port_disconnect(p_ptr);
tipc_port_unlock(p_ptr); tipc_port_unlock(p_ptr);
return res; return res;
} }
/* /*
* tipc_shutdown(): Send a SHUTDOWN msg to peer and disconnect * tipc_port_shutdown(): Send a SHUTDOWN msg to peer and disconnect
*/ */
int tipc_shutdown(u32 ref) int tipc_port_shutdown(u32 ref)
{ {
struct tipc_port *p_ptr; struct tipc_port *p_ptr;
struct sk_buff *buf = NULL; struct sk_buff *buf = NULL;
...@@ -859,13 +860,13 @@ int tipc_shutdown(u32 ref) ...@@ -859,13 +860,13 @@ int tipc_shutdown(u32 ref)
buf = port_build_peer_abort_msg(p_ptr, TIPC_CONN_SHUTDOWN); buf = port_build_peer_abort_msg(p_ptr, TIPC_CONN_SHUTDOWN);
tipc_port_unlock(p_ptr); tipc_port_unlock(p_ptr);
tipc_net_route_msg(buf); tipc_net_route_msg(buf);
return tipc_disconnect(ref); return tipc_port_disconnect(ref);
} }
/** /**
* tipc_port_recv_msg - receive message from lower layer and deliver to port user * tipc_port_rcv - receive message from lower layer and deliver to port user
*/ */
int tipc_port_recv_msg(struct sk_buff *buf) int tipc_port_rcv(struct sk_buff *buf)
{ {
struct tipc_port *p_ptr; struct tipc_port *p_ptr;
struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf);
...@@ -894,19 +895,19 @@ int tipc_port_recv_msg(struct sk_buff *buf) ...@@ -894,19 +895,19 @@ int tipc_port_recv_msg(struct sk_buff *buf)
} }
/* /*
* tipc_port_recv_sections(): Concatenate and deliver sectioned * tipc_port_iovec_rcv: Concatenate and deliver sectioned
* message for this node. * message for this node.
*/ */
static int tipc_port_recv_sections(struct tipc_port *sender, static int tipc_port_iovec_rcv(struct tipc_port *sender,
struct iovec const *msg_sect, struct iovec const *msg_sect,
unsigned int len) unsigned int len)
{ {
struct sk_buff *buf; struct sk_buff *buf;
int res; int res;
res = tipc_msg_build(&sender->phdr, msg_sect, len, MAX_MSG_SIZE, &buf); res = tipc_msg_build(&sender->phdr, msg_sect, len, MAX_MSG_SIZE, &buf);
if (likely(buf)) if (likely(buf))
tipc_port_recv_msg(buf); tipc_port_rcv(buf);
return res; return res;
} }
...@@ -927,10 +928,10 @@ int tipc_send(u32 ref, struct iovec const *msg_sect, unsigned int len) ...@@ -927,10 +928,10 @@ int tipc_send(u32 ref, struct iovec const *msg_sect, unsigned int len)
if (!tipc_port_congested(p_ptr)) { if (!tipc_port_congested(p_ptr)) {
destnode = port_peernode(p_ptr); destnode = port_peernode(p_ptr);
if (likely(!in_own_node(destnode))) if (likely(!in_own_node(destnode)))
res = tipc_link_send_sections_fast(p_ptr, msg_sect, res = tipc_link_iovec_xmit_fast(p_ptr, msg_sect, len,
len, destnode); destnode);
else else
res = tipc_port_recv_sections(p_ptr, msg_sect, len); res = tipc_port_iovec_rcv(p_ptr, msg_sect, len);
if (likely(res != -ELINKCONG)) { if (likely(res != -ELINKCONG)) {
p_ptr->congested = 0; p_ptr->congested = 0;
...@@ -974,13 +975,13 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain, ...@@ -974,13 +975,13 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain,
if (likely(destport || destnode)) { if (likely(destport || destnode)) {
if (likely(in_own_node(destnode))) if (likely(in_own_node(destnode)))
res = tipc_port_recv_sections(p_ptr, msg_sect, len); res = tipc_port_iovec_rcv(p_ptr, msg_sect, len);
else if (tipc_own_addr) else if (tipc_own_addr)
res = tipc_link_send_sections_fast(p_ptr, msg_sect, res = tipc_link_iovec_xmit_fast(p_ptr, msg_sect, len,
len, destnode); destnode);
else else
res = tipc_port_reject_sections(p_ptr, msg, msg_sect, res = tipc_port_iovec_reject(p_ptr, msg, msg_sect,
len, TIPC_ERR_NO_NODE); len, TIPC_ERR_NO_NODE);
if (likely(res != -ELINKCONG)) { if (likely(res != -ELINKCONG)) {
if (res > 0) if (res > 0)
p_ptr->sent++; p_ptr->sent++;
...@@ -991,8 +992,8 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain, ...@@ -991,8 +992,8 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain,
} }
return -ELINKCONG; return -ELINKCONG;
} }
return tipc_port_reject_sections(p_ptr, msg, msg_sect, len, return tipc_port_iovec_reject(p_ptr, msg, msg_sect, len,
TIPC_ERR_NO_NAME); TIPC_ERR_NO_NAME);
} }
/** /**
...@@ -1017,12 +1018,12 @@ int tipc_send2port(u32 ref, struct tipc_portid const *dest, ...@@ -1017,12 +1018,12 @@ int tipc_send2port(u32 ref, struct tipc_portid const *dest,
msg_set_hdr_sz(msg, BASIC_H_SIZE); msg_set_hdr_sz(msg, BASIC_H_SIZE);
if (in_own_node(dest->node)) if (in_own_node(dest->node))
res = tipc_port_recv_sections(p_ptr, msg_sect, len); res = tipc_port_iovec_rcv(p_ptr, msg_sect, len);
else if (tipc_own_addr) else if (tipc_own_addr)
res = tipc_link_send_sections_fast(p_ptr, msg_sect, len, res = tipc_link_iovec_xmit_fast(p_ptr, msg_sect, len,
dest->node); dest->node);
else else
res = tipc_port_reject_sections(p_ptr, msg, msg_sect, len, res = tipc_port_iovec_reject(p_ptr, msg, msg_sect, len,
TIPC_ERR_NO_NODE); TIPC_ERR_NO_NODE);
if (likely(res != -ELINKCONG)) { if (likely(res != -ELINKCONG)) {
if (res > 0) if (res > 0)
......
...@@ -132,25 +132,25 @@ int tipc_publish(struct tipc_port *p_ptr, unsigned int scope, ...@@ -132,25 +132,25 @@ int tipc_publish(struct tipc_port *p_ptr, unsigned int scope,
int tipc_withdraw(struct tipc_port *p_ptr, unsigned int scope, int tipc_withdraw(struct tipc_port *p_ptr, unsigned int scope,
struct tipc_name_seq const *name_seq); struct tipc_name_seq const *name_seq);
int tipc_connect(u32 portref, struct tipc_portid const *port); int tipc_port_connect(u32 portref, struct tipc_portid const *port);
int tipc_disconnect(u32 portref); int tipc_port_disconnect(u32 portref);
int tipc_shutdown(u32 ref); int tipc_port_shutdown(u32 ref);
/* /*
* The following routines require that the port be locked on entry * The following routines require that the port be locked on entry
*/ */
int __tipc_disconnect(struct tipc_port *tp_ptr); int __tipc_port_disconnect(struct tipc_port *tp_ptr);
int __tipc_connect(u32 ref, struct tipc_port *p_ptr, int __tipc_port_connect(u32 ref, struct tipc_port *p_ptr,
struct tipc_portid const *peer); struct tipc_portid const *peer);
int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg); int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg);
/* /*
* TIPC messaging routines * TIPC messaging routines
*/ */
int tipc_port_recv_msg(struct sk_buff *buf); int tipc_port_rcv(struct sk_buff *buf);
int tipc_send(u32 portref, struct iovec const *msg_sect, unsigned int len); int tipc_send(u32 portref, struct iovec const *msg_sect, unsigned int len);
int tipc_send2name(u32 portref, struct tipc_name const *name, u32 domain, int tipc_send2name(u32 portref, struct tipc_name const *name, u32 domain,
...@@ -159,15 +159,15 @@ int tipc_send2name(u32 portref, struct tipc_name const *name, u32 domain, ...@@ -159,15 +159,15 @@ int tipc_send2name(u32 portref, struct tipc_name const *name, u32 domain,
int tipc_send2port(u32 portref, struct tipc_portid const *dest, int tipc_send2port(u32 portref, struct tipc_portid const *dest,
struct iovec const *msg_sect, unsigned int len); struct iovec const *msg_sect, unsigned int len);
int tipc_multicast(u32 portref, struct tipc_name_seq const *seq, int tipc_port_mcast_xmit(u32 portref, struct tipc_name_seq const *seq,
struct iovec const *msg, unsigned int len); struct iovec const *msg, unsigned int len);
int tipc_port_reject_sections(struct tipc_port *p_ptr, struct tipc_msg *hdr, int tipc_port_iovec_reject(struct tipc_port *p_ptr, struct tipc_msg *hdr,
struct iovec const *msg_sect, unsigned int len, struct iovec const *msg_sect, unsigned int len,
int err); int err);
struct sk_buff *tipc_port_get_ports(void); struct sk_buff *tipc_port_get_ports(void);
void tipc_port_recv_proto_msg(struct sk_buff *buf); void tipc_port_proto_rcv(struct sk_buff *buf);
void tipc_port_recv_mcast(struct sk_buff *buf, struct tipc_port_list *dp); void tipc_port_mcast_rcv(struct sk_buff *buf, struct tipc_port_list *dp);
void tipc_port_reinit(void); void tipc_port_reinit(void);
/** /**
......
...@@ -60,8 +60,8 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf); ...@@ -60,8 +60,8 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf);
static void wakeupdispatch(struct tipc_port *tport); static void wakeupdispatch(struct tipc_port *tport);
static void tipc_data_ready(struct sock *sk, int len); static void tipc_data_ready(struct sock *sk, int len);
static void tipc_write_space(struct sock *sk); static void tipc_write_space(struct sock *sk);
static int release(struct socket *sock); static int tipc_release(struct socket *sock);
static int accept(struct socket *sock, struct socket *new_sock, int flags); static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags);
static const struct proto_ops packet_ops; static const struct proto_ops packet_ops;
static const struct proto_ops stream_ops; static const struct proto_ops stream_ops;
...@@ -256,7 +256,7 @@ int tipc_sock_create_local(int type, struct socket **res) ...@@ -256,7 +256,7 @@ int tipc_sock_create_local(int type, struct socket **res)
*/ */
void tipc_sock_release_local(struct socket *sock) void tipc_sock_release_local(struct socket *sock)
{ {
release(sock); tipc_release(sock);
sock->ops = NULL; sock->ops = NULL;
sock_release(sock); sock_release(sock);
} }
...@@ -282,7 +282,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock, ...@@ -282,7 +282,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock,
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = accept(sock, *newsock, flags); ret = tipc_accept(sock, *newsock, flags);
if (ret < 0) { if (ret < 0) {
sock_release(*newsock); sock_release(*newsock);
return ret; return ret;
...@@ -292,7 +292,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock, ...@@ -292,7 +292,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock,
} }
/** /**
* release - destroy a TIPC socket * tipc_release - destroy a TIPC socket
* @sock: socket to destroy * @sock: socket to destroy
* *
* This routine cleans up any messages that are still queued on the socket. * This routine cleans up any messages that are still queued on the socket.
...@@ -307,7 +307,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock, ...@@ -307,7 +307,7 @@ int tipc_sock_accept_local(struct socket *sock, struct socket **newsock,
* *
* Returns 0 on success, errno otherwise * Returns 0 on success, errno otherwise
*/ */
static int release(struct socket *sock) static int tipc_release(struct socket *sock)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport; struct tipc_port *tport;
...@@ -338,7 +338,7 @@ static int release(struct socket *sock) ...@@ -338,7 +338,7 @@ static int release(struct socket *sock)
if ((sock->state == SS_CONNECTING) || if ((sock->state == SS_CONNECTING) ||
(sock->state == SS_CONNECTED)) { (sock->state == SS_CONNECTED)) {
sock->state = SS_DISCONNECTING; sock->state = SS_DISCONNECTING;
tipc_disconnect(tport->ref); tipc_port_disconnect(tport->ref);
} }
tipc_reject_msg(buf, TIPC_ERR_NO_PORT); tipc_reject_msg(buf, TIPC_ERR_NO_PORT);
} }
...@@ -364,7 +364,7 @@ static int release(struct socket *sock) ...@@ -364,7 +364,7 @@ static int release(struct socket *sock)
} }
/** /**
* bind - associate or disassocate TIPC name(s) with a socket * tipc_bind - associate or disassocate TIPC name(s) with a socket
* @sock: socket structure * @sock: socket structure
* @uaddr: socket address describing name(s) and desired operation * @uaddr: socket address describing name(s) and desired operation
* @uaddr_len: size of socket address data structure * @uaddr_len: size of socket address data structure
...@@ -378,7 +378,8 @@ static int release(struct socket *sock) ...@@ -378,7 +378,8 @@ static int release(struct socket *sock)
* NOTE: This routine doesn't need to take the socket lock since it doesn't * NOTE: This routine doesn't need to take the socket lock since it doesn't
* access any non-constant socket information. * access any non-constant socket information.
*/ */
static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len) static int tipc_bind(struct socket *sock, struct sockaddr *uaddr,
int uaddr_len)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr; struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;
...@@ -423,7 +424,7 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len) ...@@ -423,7 +424,7 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len)
} }
/** /**
* get_name - get port ID of socket or peer socket * tipc_getname - get port ID of socket or peer socket
* @sock: socket structure * @sock: socket structure
* @uaddr: area for returned socket address * @uaddr: area for returned socket address
* @uaddr_len: area for returned length of socket address * @uaddr_len: area for returned length of socket address
...@@ -435,8 +436,8 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len) ...@@ -435,8 +436,8 @@ static int bind(struct socket *sock, struct sockaddr *uaddr, int uaddr_len)
* accesses socket information that is unchanging (or which changes in * accesses socket information that is unchanging (or which changes in
* a completely predictable manner). * a completely predictable manner).
*/ */
static int get_name(struct socket *sock, struct sockaddr *uaddr, static int tipc_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer) int *uaddr_len, int peer)
{ {
struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr; struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;
struct tipc_sock *tsock = tipc_sk(sock->sk); struct tipc_sock *tsock = tipc_sk(sock->sk);
...@@ -463,7 +464,7 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr, ...@@ -463,7 +464,7 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr,
} }
/** /**
* poll - read and possibly block on pollmask * tipc_poll - read and possibly block on pollmask
* @file: file structure associated with the socket * @file: file structure associated with the socket
* @sock: socket for which to calculate the poll bits * @sock: socket for which to calculate the poll bits
* @wait: ??? * @wait: ???
...@@ -502,8 +503,8 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr, ...@@ -502,8 +503,8 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr,
* imply that the operation will succeed, merely that it should be performed * imply that the operation will succeed, merely that it should be performed
* and will not block. * and will not block.
*/ */
static unsigned int poll(struct file *file, struct socket *sock, static unsigned int tipc_poll(struct file *file, struct socket *sock,
poll_table *wait) poll_table *wait)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
u32 mask = 0; u32 mask = 0;
...@@ -590,7 +591,7 @@ static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p) ...@@ -590,7 +591,7 @@ static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p)
} }
/** /**
* send_msg - send message in connectionless manner * tipc_sendmsg - send message in connectionless manner
* @iocb: if NULL, indicates that socket lock is already held * @iocb: if NULL, indicates that socket lock is already held
* @sock: socket structure * @sock: socket structure
* @m: message to send * @m: message to send
...@@ -603,8 +604,8 @@ static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p) ...@@ -603,8 +604,8 @@ static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p)
* *
* Returns the number of bytes sent on success, or errno otherwise * Returns the number of bytes sent on success, or errno otherwise
*/ */
static int send_msg(struct kiocb *iocb, struct socket *sock, static int tipc_sendmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t total_len) struct msghdr *m, size_t total_len)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk); struct tipc_port *tport = tipc_sk_port(sk);
...@@ -671,10 +672,10 @@ static int send_msg(struct kiocb *iocb, struct socket *sock, ...@@ -671,10 +672,10 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
res = dest_name_check(dest, m); res = dest_name_check(dest, m);
if (res) if (res)
break; break;
res = tipc_multicast(tport->ref, res = tipc_port_mcast_xmit(tport->ref,
&dest->addr.nameseq, &dest->addr.nameseq,
m->msg_iov, m->msg_iov,
total_len); total_len);
} }
if (likely(res != -ELINKCONG)) { if (likely(res != -ELINKCONG)) {
if (needs_conn && (res >= 0)) if (needs_conn && (res >= 0))
...@@ -721,7 +722,7 @@ static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p) ...@@ -721,7 +722,7 @@ static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p)
} }
/** /**
* send_packet - send a connection-oriented message * tipc_send_packet - send a connection-oriented message
* @iocb: if NULL, indicates that socket lock is already held * @iocb: if NULL, indicates that socket lock is already held
* @sock: socket structure * @sock: socket structure
* @m: message to send * @m: message to send
...@@ -731,8 +732,8 @@ static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p) ...@@ -731,8 +732,8 @@ static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p)
* *
* Returns the number of bytes sent on success, or errno otherwise * Returns the number of bytes sent on success, or errno otherwise
*/ */
static int send_packet(struct kiocb *iocb, struct socket *sock, static int tipc_send_packet(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t total_len) struct msghdr *m, size_t total_len)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk); struct tipc_port *tport = tipc_sk_port(sk);
...@@ -742,7 +743,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock, ...@@ -742,7 +743,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
/* Handle implied connection establishment */ /* Handle implied connection establishment */
if (unlikely(dest)) if (unlikely(dest))
return send_msg(iocb, sock, m, total_len); return tipc_sendmsg(iocb, sock, m, total_len);
if (total_len > TIPC_MAX_USER_MSG_SIZE) if (total_len > TIPC_MAX_USER_MSG_SIZE)
return -EMSGSIZE; return -EMSGSIZE;
...@@ -774,7 +775,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock, ...@@ -774,7 +775,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
} }
/** /**
* send_stream - send stream-oriented data * tipc_send_stream - send stream-oriented data
* @iocb: (unused) * @iocb: (unused)
* @sock: socket structure * @sock: socket structure
* @m: data to send * @m: data to send
...@@ -785,8 +786,8 @@ static int send_packet(struct kiocb *iocb, struct socket *sock, ...@@ -785,8 +786,8 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
* Returns the number of bytes sent on success (or partial success), * Returns the number of bytes sent on success (or partial success),
* or errno if no data sent * or errno if no data sent
*/ */
static int send_stream(struct kiocb *iocb, struct socket *sock, static int tipc_send_stream(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t total_len) struct msghdr *m, size_t total_len)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk); struct tipc_port *tport = tipc_sk_port(sk);
...@@ -806,7 +807,7 @@ static int send_stream(struct kiocb *iocb, struct socket *sock, ...@@ -806,7 +807,7 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
/* Handle special cases where there is no connection */ /* Handle special cases where there is no connection */
if (unlikely(sock->state != SS_CONNECTED)) { if (unlikely(sock->state != SS_CONNECTED)) {
if (sock->state == SS_UNCONNECTED) if (sock->state == SS_UNCONNECTED)
res = send_packet(NULL, sock, m, total_len); res = tipc_send_packet(NULL, sock, m, total_len);
else else
res = sock->state == SS_DISCONNECTING ? -EPIPE : -ENOTCONN; res = sock->state == SS_DISCONNECTING ? -EPIPE : -ENOTCONN;
goto exit; goto exit;
...@@ -851,7 +852,8 @@ static int send_stream(struct kiocb *iocb, struct socket *sock, ...@@ -851,7 +852,8 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
bytes_to_send = curr_left; bytes_to_send = curr_left;
my_iov.iov_base = curr_start; my_iov.iov_base = curr_start;
my_iov.iov_len = bytes_to_send; my_iov.iov_len = bytes_to_send;
res = send_packet(NULL, sock, &my_msg, bytes_to_send); res = tipc_send_packet(NULL, sock, &my_msg,
bytes_to_send);
if (res < 0) { if (res < 0) {
if (bytes_sent) if (bytes_sent)
res = bytes_sent; res = bytes_sent;
...@@ -888,7 +890,7 @@ static int auto_connect(struct socket *sock, struct tipc_msg *msg) ...@@ -888,7 +890,7 @@ static int auto_connect(struct socket *sock, struct tipc_msg *msg)
if (!p_ptr) if (!p_ptr)
return -EINVAL; return -EINVAL;
__tipc_connect(tsock->p->ref, p_ptr, &tsock->peer_name); __tipc_port_connect(tsock->p->ref, p_ptr, &tsock->peer_name);
if (msg_importance(msg) > TIPC_CRITICAL_IMPORTANCE) if (msg_importance(msg) > TIPC_CRITICAL_IMPORTANCE)
return -EINVAL; return -EINVAL;
...@@ -1023,7 +1025,7 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo) ...@@ -1023,7 +1025,7 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo)
} }
/** /**
* recv_msg - receive packet-oriented message * tipc_recvmsg - receive packet-oriented message
* @iocb: (unused) * @iocb: (unused)
* @m: descriptor for message info * @m: descriptor for message info
* @buf_len: total size of user buffer area * @buf_len: total size of user buffer area
...@@ -1034,8 +1036,8 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo) ...@@ -1034,8 +1036,8 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo)
* *
* Returns size of returned message data, errno otherwise * Returns size of returned message data, errno otherwise
*/ */
static int recv_msg(struct kiocb *iocb, struct socket *sock, static int tipc_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t buf_len, int flags) struct msghdr *m, size_t buf_len, int flags)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk); struct tipc_port *tport = tipc_sk_port(sk);
...@@ -1117,7 +1119,7 @@ static int recv_msg(struct kiocb *iocb, struct socket *sock, ...@@ -1117,7 +1119,7 @@ static int recv_msg(struct kiocb *iocb, struct socket *sock,
} }
/** /**
* recv_stream - receive stream-oriented data * tipc_recv_stream - receive stream-oriented data
* @iocb: (unused) * @iocb: (unused)
* @m: descriptor for message info * @m: descriptor for message info
* @buf_len: total size of user buffer area * @buf_len: total size of user buffer area
...@@ -1128,8 +1130,8 @@ static int recv_msg(struct kiocb *iocb, struct socket *sock, ...@@ -1128,8 +1130,8 @@ static int recv_msg(struct kiocb *iocb, struct socket *sock,
* *
* Returns size of returned message data, errno otherwise * Returns size of returned message data, errno otherwise
*/ */
static int recv_stream(struct kiocb *iocb, struct socket *sock, static int tipc_recv_stream(struct kiocb *iocb, struct socket *sock,
struct msghdr *m, size_t buf_len, int flags) struct msghdr *m, size_t buf_len, int flags)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk); struct tipc_port *tport = tipc_sk_port(sk);
...@@ -1291,7 +1293,7 @@ static u32 filter_connect(struct tipc_sock *tsock, struct sk_buff **buf) ...@@ -1291,7 +1293,7 @@ static u32 filter_connect(struct tipc_sock *tsock, struct sk_buff **buf)
if (msg_connected(msg) && tipc_port_peer_msg(tsock->p, msg)) { if (msg_connected(msg) && tipc_port_peer_msg(tsock->p, msg)) {
if (unlikely(msg_errcode(msg))) { if (unlikely(msg_errcode(msg))) {
sock->state = SS_DISCONNECTING; sock->state = SS_DISCONNECTING;
__tipc_disconnect(tsock->p); __tipc_port_disconnect(tsock->p);
} }
retval = TIPC_OK; retval = TIPC_OK;
} }
...@@ -1506,7 +1508,7 @@ static int tipc_wait_for_connect(struct socket *sock, long *timeo_p) ...@@ -1506,7 +1508,7 @@ static int tipc_wait_for_connect(struct socket *sock, long *timeo_p)
} }
/** /**
* connect - establish a connection to another TIPC port * tipc_connect - establish a connection to another TIPC port
* @sock: socket structure * @sock: socket structure
* @dest: socket address for destination port * @dest: socket address for destination port
* @destlen: size of socket address data structure * @destlen: size of socket address data structure
...@@ -1514,8 +1516,8 @@ static int tipc_wait_for_connect(struct socket *sock, long *timeo_p) ...@@ -1514,8 +1516,8 @@ static int tipc_wait_for_connect(struct socket *sock, long *timeo_p)
* *
* Returns 0 on success, errno otherwise * Returns 0 on success, errno otherwise
*/ */
static int connect(struct socket *sock, struct sockaddr *dest, int destlen, static int tipc_connect(struct socket *sock, struct sockaddr *dest,
int flags) int destlen, int flags)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest; struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest;
...@@ -1556,7 +1558,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen, ...@@ -1556,7 +1558,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
if (!timeout) if (!timeout)
m.msg_flags = MSG_DONTWAIT; m.msg_flags = MSG_DONTWAIT;
res = send_msg(NULL, sock, &m, 0); res = tipc_sendmsg(NULL, sock, &m, 0);
if ((res < 0) && (res != -EWOULDBLOCK)) if ((res < 0) && (res != -EWOULDBLOCK))
goto exit; goto exit;
...@@ -1587,13 +1589,13 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen, ...@@ -1587,13 +1589,13 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
} }
/** /**
* listen - allow socket to listen for incoming connections * tipc_listen - allow socket to listen for incoming connections
* @sock: socket structure * @sock: socket structure
* @len: (unused) * @len: (unused)
* *
* Returns 0 on success, errno otherwise * Returns 0 on success, errno otherwise
*/ */
static int listen(struct socket *sock, int len) static int tipc_listen(struct socket *sock, int len)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
int res; int res;
...@@ -1648,14 +1650,14 @@ static int tipc_wait_for_accept(struct socket *sock, long timeo) ...@@ -1648,14 +1650,14 @@ static int tipc_wait_for_accept(struct socket *sock, long timeo)
} }
/** /**
* accept - wait for connection request * tipc_accept - wait for connection request
* @sock: listening socket * @sock: listening socket
* @newsock: new socket that is to be connected * @newsock: new socket that is to be connected
* @flags: file-related flags associated with socket * @flags: file-related flags associated with socket
* *
* Returns 0 on success, errno otherwise * Returns 0 on success, errno otherwise
*/ */
static int accept(struct socket *sock, struct socket *new_sock, int flags) static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags)
{ {
struct sock *new_sk, *sk = sock->sk; struct sock *new_sk, *sk = sock->sk;
struct sk_buff *buf; struct sk_buff *buf;
...@@ -1702,7 +1704,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags) ...@@ -1702,7 +1704,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
/* Connect new socket to it's peer */ /* Connect new socket to it's peer */
new_tsock->peer_name.ref = msg_origport(msg); new_tsock->peer_name.ref = msg_origport(msg);
new_tsock->peer_name.node = msg_orignode(msg); new_tsock->peer_name.node = msg_orignode(msg);
tipc_connect(new_ref, &new_tsock->peer_name); tipc_port_connect(new_ref, &new_tsock->peer_name);
new_sock->state = SS_CONNECTED; new_sock->state = SS_CONNECTED;
tipc_set_portimportance(new_ref, msg_importance(msg)); tipc_set_portimportance(new_ref, msg_importance(msg));
...@@ -1719,7 +1721,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags) ...@@ -1719,7 +1721,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
struct msghdr m = {NULL,}; struct msghdr m = {NULL,};
advance_rx_queue(sk); advance_rx_queue(sk);
send_packet(NULL, new_sock, &m, 0); tipc_send_packet(NULL, new_sock, &m, 0);
} else { } else {
__skb_dequeue(&sk->sk_receive_queue); __skb_dequeue(&sk->sk_receive_queue);
__skb_queue_head(&new_sk->sk_receive_queue, buf); __skb_queue_head(&new_sk->sk_receive_queue, buf);
...@@ -1733,7 +1735,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags) ...@@ -1733,7 +1735,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
} }
/** /**
* shutdown - shutdown socket connection * tipc_shutdown - shutdown socket connection
* @sock: socket structure * @sock: socket structure
* @how: direction to close (must be SHUT_RDWR) * @how: direction to close (must be SHUT_RDWR)
* *
...@@ -1741,7 +1743,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags) ...@@ -1741,7 +1743,7 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
* *
* Returns 0 on success, errno otherwise * Returns 0 on success, errno otherwise
*/ */
static int shutdown(struct socket *sock, int how) static int tipc_shutdown(struct socket *sock, int how)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk); struct tipc_port *tport = tipc_sk_port(sk);
...@@ -1765,10 +1767,10 @@ static int shutdown(struct socket *sock, int how) ...@@ -1765,10 +1767,10 @@ static int shutdown(struct socket *sock, int how)
kfree_skb(buf); kfree_skb(buf);
goto restart; goto restart;
} }
tipc_disconnect(tport->ref); tipc_port_disconnect(tport->ref);
tipc_reject_msg(buf, TIPC_CONN_SHUTDOWN); tipc_reject_msg(buf, TIPC_CONN_SHUTDOWN);
} else { } else {
tipc_shutdown(tport->ref); tipc_port_shutdown(tport->ref);
} }
sock->state = SS_DISCONNECTING; sock->state = SS_DISCONNECTING;
...@@ -1794,7 +1796,7 @@ static int shutdown(struct socket *sock, int how) ...@@ -1794,7 +1796,7 @@ static int shutdown(struct socket *sock, int how)
} }
/** /**
* setsockopt - set socket option * tipc_setsockopt - set socket option
* @sock: socket structure * @sock: socket structure
* @lvl: option level * @lvl: option level
* @opt: option identifier * @opt: option identifier
...@@ -1806,8 +1808,8 @@ static int shutdown(struct socket *sock, int how) ...@@ -1806,8 +1808,8 @@ static int shutdown(struct socket *sock, int how)
* *
* Returns 0 on success, errno otherwise * Returns 0 on success, errno otherwise
*/ */
static int setsockopt(struct socket *sock, int lvl, int opt, char __user *ov, static int tipc_setsockopt(struct socket *sock, int lvl, int opt,
unsigned int ol) char __user *ov, unsigned int ol)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk); struct tipc_port *tport = tipc_sk_port(sk);
...@@ -1853,7 +1855,7 @@ static int setsockopt(struct socket *sock, int lvl, int opt, char __user *ov, ...@@ -1853,7 +1855,7 @@ static int setsockopt(struct socket *sock, int lvl, int opt, char __user *ov,
} }
/** /**
* getsockopt - get socket option * tipc_getsockopt - get socket option
* @sock: socket structure * @sock: socket structure
* @lvl: option level * @lvl: option level
* @opt: option identifier * @opt: option identifier
...@@ -1865,8 +1867,8 @@ static int setsockopt(struct socket *sock, int lvl, int opt, char __user *ov, ...@@ -1865,8 +1867,8 @@ static int setsockopt(struct socket *sock, int lvl, int opt, char __user *ov,
* *
* Returns 0 on success, errno otherwise * Returns 0 on success, errno otherwise
*/ */
static int getsockopt(struct socket *sock, int lvl, int opt, char __user *ov, static int tipc_getsockopt(struct socket *sock, int lvl, int opt,
int __user *ol) char __user *ov, int __user *ol)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk); struct tipc_port *tport = tipc_sk_port(sk);
...@@ -1927,20 +1929,20 @@ static int getsockopt(struct socket *sock, int lvl, int opt, char __user *ov, ...@@ -1927,20 +1929,20 @@ static int getsockopt(struct socket *sock, int lvl, int opt, char __user *ov,
static const struct proto_ops msg_ops = { static const struct proto_ops msg_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.family = AF_TIPC, .family = AF_TIPC,
.release = release, .release = tipc_release,
.bind = bind, .bind = tipc_bind,
.connect = connect, .connect = tipc_connect,
.socketpair = sock_no_socketpair, .socketpair = sock_no_socketpair,
.accept = sock_no_accept, .accept = sock_no_accept,
.getname = get_name, .getname = tipc_getname,
.poll = poll, .poll = tipc_poll,
.ioctl = sock_no_ioctl, .ioctl = sock_no_ioctl,
.listen = sock_no_listen, .listen = sock_no_listen,
.shutdown = shutdown, .shutdown = tipc_shutdown,
.setsockopt = setsockopt, .setsockopt = tipc_setsockopt,
.getsockopt = getsockopt, .getsockopt = tipc_getsockopt,
.sendmsg = send_msg, .sendmsg = tipc_sendmsg,
.recvmsg = recv_msg, .recvmsg = tipc_recvmsg,
.mmap = sock_no_mmap, .mmap = sock_no_mmap,
.sendpage = sock_no_sendpage .sendpage = sock_no_sendpage
}; };
...@@ -1948,20 +1950,20 @@ static const struct proto_ops msg_ops = { ...@@ -1948,20 +1950,20 @@ static const struct proto_ops msg_ops = {
static const struct proto_ops packet_ops = { static const struct proto_ops packet_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.family = AF_TIPC, .family = AF_TIPC,
.release = release, .release = tipc_release,
.bind = bind, .bind = tipc_bind,
.connect = connect, .connect = tipc_connect,
.socketpair = sock_no_socketpair, .socketpair = sock_no_socketpair,
.accept = accept, .accept = tipc_accept,
.getname = get_name, .getname = tipc_getname,
.poll = poll, .poll = tipc_poll,
.ioctl = sock_no_ioctl, .ioctl = sock_no_ioctl,
.listen = listen, .listen = tipc_listen,
.shutdown = shutdown, .shutdown = tipc_shutdown,
.setsockopt = setsockopt, .setsockopt = tipc_setsockopt,
.getsockopt = getsockopt, .getsockopt = tipc_getsockopt,
.sendmsg = send_packet, .sendmsg = tipc_send_packet,
.recvmsg = recv_msg, .recvmsg = tipc_recvmsg,
.mmap = sock_no_mmap, .mmap = sock_no_mmap,
.sendpage = sock_no_sendpage .sendpage = sock_no_sendpage
}; };
...@@ -1969,20 +1971,20 @@ static const struct proto_ops packet_ops = { ...@@ -1969,20 +1971,20 @@ static const struct proto_ops packet_ops = {
static const struct proto_ops stream_ops = { static const struct proto_ops stream_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.family = AF_TIPC, .family = AF_TIPC,
.release = release, .release = tipc_release,
.bind = bind, .bind = tipc_bind,
.connect = connect, .connect = tipc_connect,
.socketpair = sock_no_socketpair, .socketpair = sock_no_socketpair,
.accept = accept, .accept = tipc_accept,
.getname = get_name, .getname = tipc_getname,
.poll = poll, .poll = tipc_poll,
.ioctl = sock_no_ioctl, .ioctl = sock_no_ioctl,
.listen = listen, .listen = tipc_listen,
.shutdown = shutdown, .shutdown = tipc_shutdown,
.setsockopt = setsockopt, .setsockopt = tipc_setsockopt,
.getsockopt = getsockopt, .getsockopt = tipc_getsockopt,
.sendmsg = send_stream, .sendmsg = tipc_send_stream,
.recvmsg = recv_stream, .recvmsg = tipc_recv_stream,
.mmap = sock_no_mmap, .mmap = sock_no_mmap,
.sendpage = sock_no_sendpage .sendpage = sock_no_sendpage
}; };
......
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