aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/port.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/port.h')
-rw-r--r--net/tipc/port.h55
1 files changed, 4 insertions, 51 deletions
diff --git a/net/tipc/port.h b/net/tipc/port.h
index cf4ca5b1d9a4..3087da39ee47 100644
--- a/net/tipc/port.h
+++ b/net/tipc/port.h
@@ -53,17 +53,13 @@
53 * @connected: non-zero if port is currently connected to a peer port 53 * @connected: non-zero if port is currently connected to a peer port
54 * @conn_type: TIPC type used when connection was established 54 * @conn_type: TIPC type used when connection was established
55 * @conn_instance: TIPC instance used when connection was established 55 * @conn_instance: TIPC instance used when connection was established
56 * @conn_unacked: number of unacknowledged messages received from peer port
57 * @published: non-zero if port has one or more associated names 56 * @published: non-zero if port has one or more associated names
58 * @congested: non-zero if cannot send because of link or port congestion
59 * @max_pkt: maximum packet size "hint" used when building messages sent by port 57 * @max_pkt: maximum packet size "hint" used when building messages sent by port
60 * @ref: unique reference to port in TIPC object registry 58 * @ref: unique reference to port in TIPC object registry
61 * @phdr: preformatted message header used when sending messages 59 * @phdr: preformatted message header used when sending messages
62 * @port_list: adjacent ports in TIPC's global list of ports 60 * @port_list: adjacent ports in TIPC's global list of ports
63 * @wait_list: adjacent ports in list of ports waiting on link congestion 61 * @wait_list: adjacent ports in list of ports waiting on link congestion
64 * @waiting_pkts: 62 * @waiting_pkts:
65 * @sent: # of non-empty messages sent by port
66 * @acked: # of non-empty message acknowledgements from connected port's peer
67 * @publications: list of publications for port 63 * @publications: list of publications for port
68 * @pub_count: total # of publications port has made during its lifetime 64 * @pub_count: total # of publications port has made during its lifetime
69 * @probing_state: 65 * @probing_state:
@@ -76,17 +72,13 @@ struct tipc_port {
76 int connected; 72 int connected;
77 u32 conn_type; 73 u32 conn_type;
78 u32 conn_instance; 74 u32 conn_instance;
79 u32 conn_unacked;
80 int published; 75 int published;
81 u32 congested;
82 u32 max_pkt; 76 u32 max_pkt;
83 u32 ref; 77 u32 ref;
84 struct tipc_msg phdr; 78 struct tipc_msg phdr;
85 struct list_head port_list; 79 struct list_head port_list;
86 struct list_head wait_list; 80 struct list_head wait_list;
87 u32 waiting_pkts; 81 u32 waiting_pkts;
88 u32 sent;
89 u32 acked;
90 struct list_head publications; 82 struct list_head publications;
91 u32 pub_count; 83 u32 pub_count;
92 u32 probing_state; 84 u32 probing_state;
@@ -104,8 +96,6 @@ struct tipc_port_list;
104u32 tipc_port_init(struct tipc_port *p_ptr, 96u32 tipc_port_init(struct tipc_port *p_ptr,
105 const unsigned int importance); 97 const unsigned int importance);
106 98
107int tipc_reject_msg(struct sk_buff *buf, u32 err);
108
109void tipc_acknowledge(u32 port_ref, u32 ack); 99void tipc_acknowledge(u32 port_ref, u32 ack);
110 100
111void tipc_port_destroy(struct tipc_port *p_ptr); 101void tipc_port_destroy(struct tipc_port *p_ptr);
@@ -122,8 +112,6 @@ int tipc_port_disconnect(u32 portref);
122 112
123int tipc_port_shutdown(u32 ref); 113int tipc_port_shutdown(u32 ref);
124 114
125void tipc_port_wakeup(struct tipc_port *port);
126
127/* 115/*
128 * The following routines require that the port be locked on entry 116 * The following routines require that the port be locked on entry
129 */ 117 */
@@ -132,39 +120,7 @@ int __tipc_port_connect(u32 ref, struct tipc_port *p_ptr,
132 struct tipc_portid const *peer); 120 struct tipc_portid const *peer);
133int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg); 121int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg);
134 122
135/*
136 * TIPC messaging routines
137 */
138
139int tipc_send(struct tipc_port *port,
140 struct iovec const *msg_sect,
141 unsigned int len);
142
143int tipc_send2name(struct tipc_port *port,
144 struct tipc_name const *name,
145 u32 domain,
146 struct iovec const *msg_sect,
147 unsigned int len);
148
149int tipc_send2port(struct tipc_port *port,
150 struct tipc_portid const *dest,
151 struct iovec const *msg_sect,
152 unsigned int len);
153
154int tipc_port_mcast_xmit(struct tipc_port *port,
155 struct tipc_name_seq const *seq,
156 struct iovec const *msg,
157 unsigned int len);
158
159int tipc_port_iovec_reject(struct tipc_port *p_ptr,
160 struct tipc_msg *hdr,
161 struct iovec const *msg_sect,
162 unsigned int len,
163 int err);
164
165struct sk_buff *tipc_port_get_ports(void); 123struct sk_buff *tipc_port_get_ports(void);
166void tipc_port_proto_rcv(struct sk_buff *buf);
167void tipc_port_mcast_rcv(struct sk_buff *buf, struct tipc_port_list *dp);
168void tipc_port_reinit(void); 124void tipc_port_reinit(void);
169 125
170/** 126/**
@@ -185,12 +141,6 @@ static inline void tipc_port_unlock(struct tipc_port *p_ptr)
185 spin_unlock_bh(p_ptr->lock); 141 spin_unlock_bh(p_ptr->lock);
186} 142}
187 143
188static inline int tipc_port_congested(struct tipc_port *p_ptr)
189{
190 return ((p_ptr->sent - p_ptr->acked) >= TIPC_FLOWCTRL_WIN);
191}
192
193
194static inline u32 tipc_port_peernode(struct tipc_port *p_ptr) 144static inline u32 tipc_port_peernode(struct tipc_port *p_ptr)
195{ 145{
196 return msg_destnode(&p_ptr->phdr); 146 return msg_destnode(&p_ptr->phdr);
@@ -229,9 +179,12 @@ static inline int tipc_port_importance(struct tipc_port *port)
229 return msg_importance(&port->phdr); 179 return msg_importance(&port->phdr);
230} 180}
231 181
232static inline void tipc_port_set_importance(struct tipc_port *port, int imp) 182static inline int tipc_port_set_importance(struct tipc_port *port, int imp)
233{ 183{
184 if (imp > TIPC_CRITICAL_IMPORTANCE)
185 return -EINVAL;
234 msg_set_importance(&port->phdr, (u32)imp); 186 msg_set_importance(&port->phdr, (u32)imp);
187 return 0;
235} 188}
236 189
237#endif 190#endif