diff options
Diffstat (limited to 'net/tipc/link.h')
| -rw-r--r-- | net/tipc/link.h | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/net/tipc/link.h b/net/tipc/link.h index e56cb532913e..73c18c140e1d 100644 --- a/net/tipc/link.h +++ b/net/tipc/link.h | |||
| @@ -45,6 +45,12 @@ | |||
| 45 | #define PUSH_FINISHED 2 | 45 | #define PUSH_FINISHED 2 |
| 46 | 46 | ||
| 47 | /* | 47 | /* |
| 48 | * Out-of-range value for link sequence numbers | ||
| 49 | */ | ||
| 50 | |||
| 51 | #define INVALID_LINK_SEQ 0x10000 | ||
| 52 | |||
| 53 | /* | ||
| 48 | * Link states | 54 | * Link states |
| 49 | */ | 55 | */ |
| 50 | 56 | ||
| @@ -61,7 +67,7 @@ | |||
| 61 | #define MAX_PKT_DEFAULT 1500 | 67 | #define MAX_PKT_DEFAULT 1500 |
| 62 | 68 | ||
| 63 | /** | 69 | /** |
| 64 | * struct link - TIPC link data structure | 70 | * struct tipc_link - TIPC link data structure |
| 65 | * @addr: network address of link's peer node | 71 | * @addr: network address of link's peer node |
| 66 | * @name: link name character string | 72 | * @name: link name character string |
| 67 | * @media_addr: media address to use when sending messages over link | 73 | * @media_addr: media address to use when sending messages over link |
| @@ -109,7 +115,7 @@ | |||
| 109 | * @stats: collects statistics regarding link activity | 115 | * @stats: collects statistics regarding link activity |
| 110 | */ | 116 | */ |
| 111 | 117 | ||
| 112 | struct link { | 118 | struct tipc_link { |
| 113 | u32 addr; | 119 | u32 addr; |
| 114 | char name[TIPC_MAX_LINK_NAME]; | 120 | char name[TIPC_MAX_LINK_NAME]; |
| 115 | struct tipc_media_addr media_addr; | 121 | struct tipc_media_addr media_addr; |
| @@ -207,24 +213,24 @@ struct link { | |||
| 207 | 213 | ||
| 208 | struct tipc_port; | 214 | struct tipc_port; |
| 209 | 215 | ||
| 210 | struct link *tipc_link_create(struct tipc_node *n_ptr, | 216 | struct tipc_link *tipc_link_create(struct tipc_node *n_ptr, |
| 211 | struct tipc_bearer *b_ptr, | 217 | struct tipc_bearer *b_ptr, |
| 212 | const struct tipc_media_addr *media_addr); | 218 | const struct tipc_media_addr *media_addr); |
| 213 | void tipc_link_delete(struct link *l_ptr); | 219 | void tipc_link_delete(struct tipc_link *l_ptr); |
| 214 | void tipc_link_changeover(struct link *l_ptr); | 220 | void tipc_link_changeover(struct tipc_link *l_ptr); |
| 215 | void tipc_link_send_duplicate(struct link *l_ptr, struct link *dest); | 221 | void tipc_link_send_duplicate(struct tipc_link *l_ptr, struct tipc_link *dest); |
| 216 | void tipc_link_reset_fragments(struct link *l_ptr); | 222 | void tipc_link_reset_fragments(struct tipc_link *l_ptr); |
| 217 | int tipc_link_is_up(struct link *l_ptr); | 223 | int tipc_link_is_up(struct tipc_link *l_ptr); |
| 218 | int tipc_link_is_active(struct link *l_ptr); | 224 | int tipc_link_is_active(struct tipc_link *l_ptr); |
| 219 | u32 tipc_link_push_packet(struct link *l_ptr); | 225 | u32 tipc_link_push_packet(struct tipc_link *l_ptr); |
| 220 | void tipc_link_stop(struct link *l_ptr); | 226 | void tipc_link_stop(struct tipc_link *l_ptr); |
| 221 | struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space, u16 cmd); | 227 | struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space, u16 cmd); |
| 222 | struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_space); | 228 | struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_space); |
| 223 | struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space); | 229 | struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space); |
| 224 | void tipc_link_reset(struct link *l_ptr); | 230 | void tipc_link_reset(struct tipc_link *l_ptr); |
| 225 | int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector); | 231 | int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector); |
| 226 | void tipc_link_send_names(struct list_head *message_list, u32 dest); | 232 | void tipc_link_send_names(struct list_head *message_list, u32 dest); |
| 227 | int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf); | 233 | int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf); |
| 228 | u32 tipc_link_get_max_pkt(u32 dest, u32 selector); | 234 | u32 tipc_link_get_max_pkt(u32 dest, u32 selector); |
| 229 | int tipc_link_send_sections_fast(struct tipc_port *sender, | 235 | int tipc_link_send_sections_fast(struct tipc_port *sender, |
| 230 | struct iovec const *msg_sect, | 236 | struct iovec const *msg_sect, |
| @@ -235,19 +241,26 @@ void tipc_link_recv_bundle(struct sk_buff *buf); | |||
| 235 | int tipc_link_recv_fragment(struct sk_buff **pending, | 241 | int tipc_link_recv_fragment(struct sk_buff **pending, |
| 236 | struct sk_buff **fb, | 242 | struct sk_buff **fb, |
| 237 | struct tipc_msg **msg); | 243 | struct tipc_msg **msg); |
| 238 | void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int prob, u32 gap, | 244 | void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ, int prob, |
| 239 | u32 tolerance, u32 priority, u32 acked_mtu); | 245 | u32 gap, u32 tolerance, u32 priority, |
| 240 | void tipc_link_push_queue(struct link *l_ptr); | 246 | u32 acked_mtu); |
| 247 | void tipc_link_push_queue(struct tipc_link *l_ptr); | ||
| 241 | u32 tipc_link_defer_pkt(struct sk_buff **head, struct sk_buff **tail, | 248 | u32 tipc_link_defer_pkt(struct sk_buff **head, struct sk_buff **tail, |
| 242 | struct sk_buff *buf); | 249 | struct sk_buff *buf); |
| 243 | void tipc_link_wakeup_ports(struct link *l_ptr, int all); | 250 | void tipc_link_wakeup_ports(struct tipc_link *l_ptr, int all); |
| 244 | void tipc_link_set_queue_limits(struct link *l_ptr, u32 window); | 251 | void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window); |
| 245 | void tipc_link_retransmit(struct link *l_ptr, struct sk_buff *start, u32 retransmits); | 252 | void tipc_link_retransmit(struct tipc_link *l_ptr, |
| 253 | struct sk_buff *start, u32 retransmits); | ||
| 246 | 254 | ||
| 247 | /* | 255 | /* |
| 248 | * Link sequence number manipulation routines (uses modulo 2**16 arithmetic) | 256 | * Link sequence number manipulation routines (uses modulo 2**16 arithmetic) |
| 249 | */ | 257 | */ |
| 250 | 258 | ||
| 259 | static inline u32 buf_seqno(struct sk_buff *buf) | ||
| 260 | { | ||
| 261 | return msg_seqno(buf_msg(buf)); | ||
| 262 | } | ||
| 263 | |||
| 251 | static inline u32 mod(u32 x) | 264 | static inline u32 mod(u32 x) |
| 252 | { | 265 | { |
| 253 | return x & 0xffffu; | 266 | return x & 0xffffu; |
| @@ -282,32 +295,32 @@ static inline u32 lesser(u32 left, u32 right) | |||
| 282 | * Link status checking routines | 295 | * Link status checking routines |
| 283 | */ | 296 | */ |
| 284 | 297 | ||
| 285 | static inline int link_working_working(struct link *l_ptr) | 298 | static inline int link_working_working(struct tipc_link *l_ptr) |
| 286 | { | 299 | { |
| 287 | return l_ptr->state == WORKING_WORKING; | 300 | return l_ptr->state == WORKING_WORKING; |
| 288 | } | 301 | } |
| 289 | 302 | ||
| 290 | static inline int link_working_unknown(struct link *l_ptr) | 303 | static inline int link_working_unknown(struct tipc_link *l_ptr) |
| 291 | { | 304 | { |
| 292 | return l_ptr->state == WORKING_UNKNOWN; | 305 | return l_ptr->state == WORKING_UNKNOWN; |
| 293 | } | 306 | } |
| 294 | 307 | ||
| 295 | static inline int link_reset_unknown(struct link *l_ptr) | 308 | static inline int link_reset_unknown(struct tipc_link *l_ptr) |
| 296 | { | 309 | { |
| 297 | return l_ptr->state == RESET_UNKNOWN; | 310 | return l_ptr->state == RESET_UNKNOWN; |
| 298 | } | 311 | } |
| 299 | 312 | ||
| 300 | static inline int link_reset_reset(struct link *l_ptr) | 313 | static inline int link_reset_reset(struct tipc_link *l_ptr) |
| 301 | { | 314 | { |
| 302 | return l_ptr->state == RESET_RESET; | 315 | return l_ptr->state == RESET_RESET; |
| 303 | } | 316 | } |
| 304 | 317 | ||
| 305 | static inline int link_blocked(struct link *l_ptr) | 318 | static inline int link_blocked(struct tipc_link *l_ptr) |
| 306 | { | 319 | { |
| 307 | return l_ptr->exp_msg_count || l_ptr->blocked; | 320 | return l_ptr->exp_msg_count || l_ptr->blocked; |
| 308 | } | 321 | } |
| 309 | 322 | ||
| 310 | static inline int link_congested(struct link *l_ptr) | 323 | static inline int link_congested(struct tipc_link *l_ptr) |
| 311 | { | 324 | { |
| 312 | return l_ptr->out_queue_size >= l_ptr->queue_limit[0]; | 325 | return l_ptr->out_queue_size >= l_ptr->queue_limit[0]; |
| 313 | } | 326 | } |
