Loading net/tipc/bcast.c +23 −23 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ #define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */ #define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */ /** /** * struct bcbearer_pair - a pair of bearers used by broadcast link * struct tipc_bcbearer_pair - a pair of bearers used by broadcast link * @primary: pointer to primary bearer * @primary: pointer to primary bearer * @secondary: pointer to secondary bearer * @secondary: pointer to secondary bearer * * Loading @@ -54,13 +54,13 @@ * to be paired. * to be paired. */ */ struct bcbearer_pair { struct tipc_bcbearer_pair { struct tipc_bearer *primary; struct tipc_bearer *primary; struct tipc_bearer *secondary; struct tipc_bearer *secondary; }; }; /** /** * struct bcbearer - bearer used by broadcast link * struct tipc_bcbearer - bearer used by broadcast link * @bearer: (non-standard) broadcast bearer structure * @bearer: (non-standard) broadcast bearer structure * @media: (non-standard) broadcast media structure * @media: (non-standard) broadcast media structure * @bpairs: array of bearer pairs * @bpairs: array of bearer pairs Loading @@ -74,17 +74,17 @@ struct bcbearer_pair { * prevented through use of the spinlock "bc_lock". * prevented through use of the spinlock "bc_lock". */ */ struct bcbearer { struct tipc_bcbearer { struct tipc_bearer bearer; struct tipc_bearer bearer; struct media media; struct tipc_media media; struct bcbearer_pair bpairs[MAX_BEARERS]; struct tipc_bcbearer_pair bpairs[MAX_BEARERS]; struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; struct tipc_bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; struct tipc_node_map remains; struct tipc_node_map remains; struct tipc_node_map remains_new; struct tipc_node_map remains_new; }; }; /** /** * struct bclink - link used for broadcast messages * struct tipc_bclink - link used for broadcast messages * @link: (non-standard) broadcast link structure * @link: (non-standard) broadcast link structure * @node: (non-standard) node structure representing b'cast link's peer node * @node: (non-standard) node structure representing b'cast link's peer node * @bcast_nodes: map of broadcast-capable nodes * @bcast_nodes: map of broadcast-capable nodes Loading @@ -93,19 +93,19 @@ struct bcbearer { * Handles sequence numbering, fragmentation, bundling, etc. * Handles sequence numbering, fragmentation, bundling, etc. */ */ struct bclink { struct tipc_bclink { struct link link; struct tipc_link link; struct tipc_node node; struct tipc_node node; struct tipc_node_map bcast_nodes; struct tipc_node_map bcast_nodes; struct tipc_node *retransmit_to; struct tipc_node *retransmit_to; }; }; static struct bcbearer bcast_bearer; static struct tipc_bcbearer bcast_bearer; static struct bclink bcast_link; static struct tipc_bclink bcast_link; static struct bcbearer *bcbearer = &bcast_bearer; static struct tipc_bcbearer *bcbearer = &bcast_bearer; static struct bclink *bclink = &bcast_link; static struct tipc_bclink *bclink = &bcast_link; static struct link *bcl = &bcast_link.link; static struct tipc_link *bcl = &bcast_link.link; static DEFINE_SPINLOCK(bc_lock); static DEFINE_SPINLOCK(bc_lock); Loading Loading @@ -308,7 +308,7 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked) static void bclink_send_ack(struct tipc_node *n_ptr) static void bclink_send_ack(struct tipc_node *n_ptr) { { struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; struct tipc_link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; if (l_ptr != NULL) if (l_ptr != NULL) tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); Loading Loading @@ -677,8 +677,8 @@ static int tipc_bcbearer_send(struct sk_buff *buf, void tipc_bcbearer_sort(void) void tipc_bcbearer_sort(void) { { struct bcbearer_pair *bp_temp = bcbearer->bpairs_temp; struct tipc_bcbearer_pair *bp_temp = bcbearer->bpairs_temp; struct bcbearer_pair *bp_curr; struct tipc_bcbearer_pair *bp_curr; int b_index; int b_index; int pri; int pri; Loading Loading @@ -893,9 +893,9 @@ static void tipc_nmap_diff(struct tipc_node_map *nm_a, * tipc_port_list_add - add a port to a port list, ensuring no duplicates * tipc_port_list_add - add a port to a port list, ensuring no duplicates */ */ void tipc_port_list_add(struct port_list *pl_ptr, u32 port) void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port) { { struct port_list *item = pl_ptr; struct tipc_port_list *item = pl_ptr; int i; int i; int item_sz = PLSIZE; int item_sz = PLSIZE; int cnt = pl_ptr->count; int cnt = pl_ptr->count; Loading Loading @@ -927,10 +927,10 @@ void tipc_port_list_add(struct port_list *pl_ptr, u32 port) * * */ */ void tipc_port_list_free(struct port_list *pl_ptr) void tipc_port_list_free(struct tipc_port_list *pl_ptr) { { struct port_list *item; struct tipc_port_list *item; struct port_list *next; struct tipc_port_list *next; for (item = pl_ptr->next; item; item = next) { for (item = pl_ptr->next; item; item = next) { next = item->next; next = item->next; Loading net/tipc/bcast.h +5 −5 Original line number Original line Diff line number Diff line Loading @@ -54,15 +54,15 @@ struct tipc_node_map { #define PLSIZE 32 #define PLSIZE 32 /** /** * struct port_list - set of node local destination ports * struct tipc_port_list - set of node local destination ports * @count: # of ports in set (only valid for first entry in list) * @count: # of ports in set (only valid for first entry in list) * @next: pointer to next entry in list * @next: pointer to next entry in list * @ports: array of port references * @ports: array of port references */ */ struct port_list { struct tipc_port_list { int count; int count; struct port_list *next; struct tipc_port_list *next; u32 ports[PLSIZE]; u32 ports[PLSIZE]; }; }; Loading @@ -83,8 +83,8 @@ static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_m return !memcmp(nm_a, nm_b, sizeof(*nm_a)); return !memcmp(nm_a, nm_b, sizeof(*nm_a)); } } void tipc_port_list_add(struct port_list *pl_ptr, u32 port); void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port); void tipc_port_list_free(struct port_list *pl_ptr); void tipc_port_list_free(struct tipc_port_list *pl_ptr); void tipc_bclink_init(void); void tipc_bclink_init(void); void tipc_bclink_stop(void); void tipc_bclink_stop(void); Loading net/tipc/bearer.c +22 −20 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,7 @@ #define MAX_ADDR_STR 32 #define MAX_ADDR_STR 32 static struct media *media_list[MAX_MEDIA]; static struct tipc_media *media_list[MAX_MEDIA]; static u32 media_count; static u32 media_count; struct tipc_bearer tipc_bearers[MAX_BEARERS]; struct tipc_bearer tipc_bearers[MAX_BEARERS]; Loading @@ -68,7 +68,7 @@ static int media_name_valid(const char *name) * tipc_media_find - locates specified media object by name * tipc_media_find - locates specified media object by name */ */ struct media *tipc_media_find(const char *name) struct tipc_media *tipc_media_find(const char *name) { { u32 i; u32 i; Loading @@ -83,7 +83,7 @@ struct media *tipc_media_find(const char *name) * media_find_id - locates specified media object by type identifier * media_find_id - locates specified media object by type identifier */ */ static struct media *media_find_id(u8 type) static struct tipc_media *media_find_id(u8 type) { { u32 i; u32 i; Loading @@ -100,7 +100,7 @@ static struct media *media_find_id(u8 type) * Bearers for this media type must be activated separately at a later stage. * Bearers for this media type must be activated separately at a later stage. */ */ int tipc_register_media(struct media *m_ptr) int tipc_register_media(struct tipc_media *m_ptr) { { int res = -EINVAL; int res = -EINVAL; Loading Loading @@ -138,7 +138,7 @@ int tipc_register_media(struct media *m_ptr) void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) { { char addr_str[MAX_ADDR_STR]; char addr_str[MAX_ADDR_STR]; struct media *m_ptr; struct tipc_media *m_ptr; m_ptr = media_find_id(a->media_id); m_ptr = media_find_id(a->media_id); Loading Loading @@ -185,7 +185,7 @@ struct sk_buff *tipc_media_get_names(void) */ */ static int bearer_name_validate(const char *name, static int bearer_name_validate(const char *name, struct bearer_name *name_parts) struct tipc_bearer_names *name_parts) { { char name_copy[TIPC_MAX_BEARER_NAME]; char name_copy[TIPC_MAX_BEARER_NAME]; char *media_name; char *media_name; Loading Loading @@ -318,7 +318,7 @@ void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest) static int bearer_push(struct tipc_bearer *b_ptr) static int bearer_push(struct tipc_bearer *b_ptr) { { u32 res = 0; u32 res = 0; struct link *ln, *tln; struct tipc_link *ln, *tln; if (b_ptr->blocked) if (b_ptr->blocked) return 0; return 0; Loading Loading @@ -364,7 +364,8 @@ void tipc_continue(struct tipc_bearer *b_ptr) * bearer.lock is busy * bearer.lock is busy */ */ static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct link *l_ptr) static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) { { list_move_tail(&l_ptr->link_list, &b_ptr->cong_links); list_move_tail(&l_ptr->link_list, &b_ptr->cong_links); } } Loading @@ -377,7 +378,7 @@ static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct link * bearer.lock is free * bearer.lock is free */ */ void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr) void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) { { spin_lock_bh(&b_ptr->lock); spin_lock_bh(&b_ptr->lock); tipc_bearer_schedule_unlocked(b_ptr, l_ptr); tipc_bearer_schedule_unlocked(b_ptr, l_ptr); Loading @@ -390,7 +391,8 @@ void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr) * and if there is, try to resolve it before returning. * and if there is, try to resolve it before returning. * 'tipc_net_lock' is read_locked when this function is called * 'tipc_net_lock' is read_locked when this function is called */ */ int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr) int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) { { int res = 1; int res = 1; Loading @@ -409,7 +411,7 @@ int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr * tipc_bearer_congested - determines if bearer is currently congested * tipc_bearer_congested - determines if bearer is currently congested */ */ int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr) int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) { { if (unlikely(b_ptr->blocked)) if (unlikely(b_ptr->blocked)) return 1; return 1; Loading @@ -425,8 +427,8 @@ int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr) int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) { { struct tipc_bearer *b_ptr; struct tipc_bearer *b_ptr; struct media *m_ptr; struct tipc_media *m_ptr; struct bearer_name b_name; struct tipc_bearer_names b_names; char addr_string[16]; char addr_string[16]; u32 bearer_id; u32 bearer_id; u32 with_this_prio; u32 with_this_prio; Loading @@ -438,7 +440,7 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) name); name); return -ENOPROTOOPT; return -ENOPROTOOPT; } } if (!bearer_name_validate(name, &b_name)) { if (!bearer_name_validate(name, &b_names)) { warn("Bearer <%s> rejected, illegal name\n", name); warn("Bearer <%s> rejected, illegal name\n", name); return -EINVAL; return -EINVAL; } } Loading @@ -463,10 +465,10 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) write_lock_bh(&tipc_net_lock); write_lock_bh(&tipc_net_lock); m_ptr = tipc_media_find(b_name.media_name); m_ptr = tipc_media_find(b_names.media_name); if (!m_ptr) { if (!m_ptr) { warn("Bearer <%s> rejected, media <%s> not registered\n", name, warn("Bearer <%s> rejected, media <%s> not registered\n", name, b_name.media_name); b_names.media_name); goto exit; goto exit; } } Loading Loading @@ -544,8 +546,8 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) int tipc_block_bearer(const char *name) int tipc_block_bearer(const char *name) { { struct tipc_bearer *b_ptr = NULL; struct tipc_bearer *b_ptr = NULL; struct link *l_ptr; struct tipc_link *l_ptr; struct link *temp_l_ptr; struct tipc_link *temp_l_ptr; read_lock_bh(&tipc_net_lock); read_lock_bh(&tipc_net_lock); b_ptr = tipc_bearer_find(name); b_ptr = tipc_bearer_find(name); Loading Loading @@ -579,8 +581,8 @@ int tipc_block_bearer(const char *name) static void bearer_disable(struct tipc_bearer *b_ptr) static void bearer_disable(struct tipc_bearer *b_ptr) { { struct link *l_ptr; struct tipc_link *l_ptr; struct link *temp_l_ptr; struct tipc_link *temp_l_ptr; info("Disabling bearer <%s>\n", b_ptr->name); info("Disabling bearer <%s>\n", b_ptr->name); spin_lock_bh(&b_ptr->lock); spin_lock_bh(&b_ptr->lock); Loading net/tipc/bearer.h +12 −11 Original line number Original line Diff line number Diff line Loading @@ -74,7 +74,7 @@ struct tipc_media_addr { struct tipc_bearer; struct tipc_bearer; /** /** * struct media - TIPC media information available to internal users * struct tipc_media - TIPC media information available to internal users * @send_msg: routine which handles buffer transmission * @send_msg: routine which handles buffer transmission * @enable_bearer: routine which enables a bearer * @enable_bearer: routine which enables a bearer * @disable_bearer: routine which disables a bearer * @disable_bearer: routine which disables a bearer Loading @@ -90,7 +90,7 @@ struct tipc_bearer; * @name: media name * @name: media name */ */ struct media { struct tipc_media { int (*send_msg)(struct sk_buff *buf, int (*send_msg)(struct sk_buff *buf, struct tipc_bearer *b_ptr, struct tipc_bearer *b_ptr, struct tipc_media_addr *dest); struct tipc_media_addr *dest); Loading Loading @@ -139,12 +139,12 @@ struct tipc_bearer { struct tipc_media_addr addr; /* initalized by media */ struct tipc_media_addr addr; /* initalized by media */ char name[TIPC_MAX_BEARER_NAME]; char name[TIPC_MAX_BEARER_NAME]; spinlock_t lock; spinlock_t lock; struct media *media; struct tipc_media *media; u32 priority; u32 priority; u32 window; u32 window; u32 tolerance; u32 tolerance; u32 identity; u32 identity; struct link_req *link_req; struct tipc_link_req *link_req; struct list_head links; struct list_head links; struct list_head cong_links; struct list_head cong_links; int active; int active; Loading @@ -152,19 +152,19 @@ struct tipc_bearer { struct tipc_node_map nodes; struct tipc_node_map nodes; }; }; struct bearer_name { struct tipc_bearer_names { char media_name[TIPC_MAX_MEDIA_NAME]; char media_name[TIPC_MAX_MEDIA_NAME]; char if_name[TIPC_MAX_IF_NAME]; char if_name[TIPC_MAX_IF_NAME]; }; }; struct link; struct tipc_link; extern struct tipc_bearer tipc_bearers[]; extern struct tipc_bearer tipc_bearers[]; /* /* * TIPC routines available to supported media types * TIPC routines available to supported media types */ */ int tipc_register_media(struct media *m_ptr); int tipc_register_media(struct tipc_media *m_ptr); void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr); void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr); Loading @@ -188,12 +188,13 @@ struct sk_buff *tipc_media_get_names(void); struct sk_buff *tipc_bearer_get_names(void); struct sk_buff *tipc_bearer_get_names(void); void tipc_bearer_add_dest(struct tipc_bearer *b_ptr, u32 dest); void tipc_bearer_add_dest(struct tipc_bearer *b_ptr, u32 dest); void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest); void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest); void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr); void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr); struct tipc_bearer *tipc_bearer_find(const char *name); struct tipc_bearer *tipc_bearer_find(const char *name); struct tipc_bearer *tipc_bearer_find_interface(const char *if_name); struct tipc_bearer *tipc_bearer_find_interface(const char *if_name); struct media *tipc_media_find(const char *name); struct tipc_media *tipc_media_find(const char *name); int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr); int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr); struct tipc_link *l_ptr); int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr); void tipc_bearer_stop(void); void tipc_bearer_stop(void); void tipc_bearer_lock_push(struct tipc_bearer *b_ptr); void tipc_bearer_lock_push(struct tipc_bearer *b_ptr); Loading net/tipc/discover.c +10 −10 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,7 @@ /** /** * struct link_req - information about an ongoing link setup request * struct tipc_link_req - information about an ongoing link setup request * @bearer: bearer issuing requests * @bearer: bearer issuing requests * @dest: destination address for request messages * @dest: destination address for request messages * @domain: network domain to which links can be established * @domain: network domain to which links can be established Loading @@ -54,7 +54,7 @@ * @timer: timer governing period between requests * @timer: timer governing period between requests * @timer_intv: current interval between requests (in ms) * @timer_intv: current interval between requests (in ms) */ */ struct link_req { struct tipc_link_req { struct tipc_bearer *bearer; struct tipc_bearer *bearer; struct tipc_media_addr dest; struct tipc_media_addr dest; u32 domain; u32 domain; Loading Loading @@ -120,7 +120,7 @@ static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr, void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) { { struct tipc_node *n_ptr; struct tipc_node *n_ptr; struct link *link; struct tipc_link *link; struct tipc_media_addr media_addr, *addr; struct tipc_media_addr media_addr, *addr; struct sk_buff *rbuf; struct sk_buff *rbuf; struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf); Loading Loading @@ -218,7 +218,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) * and is either not currently searching or is searching at a slow rate * and is either not currently searching or is searching at a slow rate */ */ static void disc_update(struct link_req *req) static void disc_update(struct tipc_link_req *req) { { if (!req->num_nodes) { if (!req->num_nodes) { if ((req->timer_intv == TIPC_LINK_REQ_INACTIVE) || if ((req->timer_intv == TIPC_LINK_REQ_INACTIVE) || Loading @@ -234,7 +234,7 @@ static void disc_update(struct link_req *req) * @req: ptr to link request structure * @req: ptr to link request structure */ */ void tipc_disc_add_dest(struct link_req *req) void tipc_disc_add_dest(struct tipc_link_req *req) { { req->num_nodes++; req->num_nodes++; } } Loading @@ -244,7 +244,7 @@ void tipc_disc_add_dest(struct link_req *req) * @req: ptr to link request structure * @req: ptr to link request structure */ */ void tipc_disc_remove_dest(struct link_req *req) void tipc_disc_remove_dest(struct tipc_link_req *req) { { req->num_nodes--; req->num_nodes--; disc_update(req); disc_update(req); Loading @@ -255,7 +255,7 @@ void tipc_disc_remove_dest(struct link_req *req) * @req: ptr to link request structure * @req: ptr to link request structure */ */ static void disc_send_msg(struct link_req *req) static void disc_send_msg(struct tipc_link_req *req) { { if (!req->bearer->blocked) if (!req->bearer->blocked) tipc_bearer_send(req->bearer, req->buf, &req->dest); tipc_bearer_send(req->bearer, req->buf, &req->dest); Loading @@ -268,7 +268,7 @@ static void disc_send_msg(struct link_req *req) * Called whenever a link setup request timer associated with a bearer expires. * Called whenever a link setup request timer associated with a bearer expires. */ */ static void disc_timeout(struct link_req *req) static void disc_timeout(struct tipc_link_req *req) { { int max_delay; int max_delay; Loading Loading @@ -316,7 +316,7 @@ static void disc_timeout(struct link_req *req) int tipc_disc_create(struct tipc_bearer *b_ptr, int tipc_disc_create(struct tipc_bearer *b_ptr, struct tipc_media_addr *dest, u32 dest_domain) struct tipc_media_addr *dest, u32 dest_domain) { { struct link_req *req; struct tipc_link_req *req; req = kmalloc(sizeof(*req), GFP_ATOMIC); req = kmalloc(sizeof(*req), GFP_ATOMIC); if (!req) if (!req) Loading Loading @@ -345,7 +345,7 @@ int tipc_disc_create(struct tipc_bearer *b_ptr, * @req: ptr to link request structure * @req: ptr to link request structure */ */ void tipc_disc_delete(struct link_req *req) void tipc_disc_delete(struct tipc_link_req *req) { { k_cancel_timer(&req->timer); k_cancel_timer(&req->timer); k_term_timer(&req->timer); k_term_timer(&req->timer); Loading Loading
net/tipc/bcast.c +23 −23 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ #define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */ #define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */ /** /** * struct bcbearer_pair - a pair of bearers used by broadcast link * struct tipc_bcbearer_pair - a pair of bearers used by broadcast link * @primary: pointer to primary bearer * @primary: pointer to primary bearer * @secondary: pointer to secondary bearer * @secondary: pointer to secondary bearer * * Loading @@ -54,13 +54,13 @@ * to be paired. * to be paired. */ */ struct bcbearer_pair { struct tipc_bcbearer_pair { struct tipc_bearer *primary; struct tipc_bearer *primary; struct tipc_bearer *secondary; struct tipc_bearer *secondary; }; }; /** /** * struct bcbearer - bearer used by broadcast link * struct tipc_bcbearer - bearer used by broadcast link * @bearer: (non-standard) broadcast bearer structure * @bearer: (non-standard) broadcast bearer structure * @media: (non-standard) broadcast media structure * @media: (non-standard) broadcast media structure * @bpairs: array of bearer pairs * @bpairs: array of bearer pairs Loading @@ -74,17 +74,17 @@ struct bcbearer_pair { * prevented through use of the spinlock "bc_lock". * prevented through use of the spinlock "bc_lock". */ */ struct bcbearer { struct tipc_bcbearer { struct tipc_bearer bearer; struct tipc_bearer bearer; struct media media; struct tipc_media media; struct bcbearer_pair bpairs[MAX_BEARERS]; struct tipc_bcbearer_pair bpairs[MAX_BEARERS]; struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; struct tipc_bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; struct tipc_node_map remains; struct tipc_node_map remains; struct tipc_node_map remains_new; struct tipc_node_map remains_new; }; }; /** /** * struct bclink - link used for broadcast messages * struct tipc_bclink - link used for broadcast messages * @link: (non-standard) broadcast link structure * @link: (non-standard) broadcast link structure * @node: (non-standard) node structure representing b'cast link's peer node * @node: (non-standard) node structure representing b'cast link's peer node * @bcast_nodes: map of broadcast-capable nodes * @bcast_nodes: map of broadcast-capable nodes Loading @@ -93,19 +93,19 @@ struct bcbearer { * Handles sequence numbering, fragmentation, bundling, etc. * Handles sequence numbering, fragmentation, bundling, etc. */ */ struct bclink { struct tipc_bclink { struct link link; struct tipc_link link; struct tipc_node node; struct tipc_node node; struct tipc_node_map bcast_nodes; struct tipc_node_map bcast_nodes; struct tipc_node *retransmit_to; struct tipc_node *retransmit_to; }; }; static struct bcbearer bcast_bearer; static struct tipc_bcbearer bcast_bearer; static struct bclink bcast_link; static struct tipc_bclink bcast_link; static struct bcbearer *bcbearer = &bcast_bearer; static struct tipc_bcbearer *bcbearer = &bcast_bearer; static struct bclink *bclink = &bcast_link; static struct tipc_bclink *bclink = &bcast_link; static struct link *bcl = &bcast_link.link; static struct tipc_link *bcl = &bcast_link.link; static DEFINE_SPINLOCK(bc_lock); static DEFINE_SPINLOCK(bc_lock); Loading Loading @@ -308,7 +308,7 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked) static void bclink_send_ack(struct tipc_node *n_ptr) static void bclink_send_ack(struct tipc_node *n_ptr) { { struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; struct tipc_link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; if (l_ptr != NULL) if (l_ptr != NULL) tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0); Loading Loading @@ -677,8 +677,8 @@ static int tipc_bcbearer_send(struct sk_buff *buf, void tipc_bcbearer_sort(void) void tipc_bcbearer_sort(void) { { struct bcbearer_pair *bp_temp = bcbearer->bpairs_temp; struct tipc_bcbearer_pair *bp_temp = bcbearer->bpairs_temp; struct bcbearer_pair *bp_curr; struct tipc_bcbearer_pair *bp_curr; int b_index; int b_index; int pri; int pri; Loading Loading @@ -893,9 +893,9 @@ static void tipc_nmap_diff(struct tipc_node_map *nm_a, * tipc_port_list_add - add a port to a port list, ensuring no duplicates * tipc_port_list_add - add a port to a port list, ensuring no duplicates */ */ void tipc_port_list_add(struct port_list *pl_ptr, u32 port) void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port) { { struct port_list *item = pl_ptr; struct tipc_port_list *item = pl_ptr; int i; int i; int item_sz = PLSIZE; int item_sz = PLSIZE; int cnt = pl_ptr->count; int cnt = pl_ptr->count; Loading Loading @@ -927,10 +927,10 @@ void tipc_port_list_add(struct port_list *pl_ptr, u32 port) * * */ */ void tipc_port_list_free(struct port_list *pl_ptr) void tipc_port_list_free(struct tipc_port_list *pl_ptr) { { struct port_list *item; struct tipc_port_list *item; struct port_list *next; struct tipc_port_list *next; for (item = pl_ptr->next; item; item = next) { for (item = pl_ptr->next; item; item = next) { next = item->next; next = item->next; Loading
net/tipc/bcast.h +5 −5 Original line number Original line Diff line number Diff line Loading @@ -54,15 +54,15 @@ struct tipc_node_map { #define PLSIZE 32 #define PLSIZE 32 /** /** * struct port_list - set of node local destination ports * struct tipc_port_list - set of node local destination ports * @count: # of ports in set (only valid for first entry in list) * @count: # of ports in set (only valid for first entry in list) * @next: pointer to next entry in list * @next: pointer to next entry in list * @ports: array of port references * @ports: array of port references */ */ struct port_list { struct tipc_port_list { int count; int count; struct port_list *next; struct tipc_port_list *next; u32 ports[PLSIZE]; u32 ports[PLSIZE]; }; }; Loading @@ -83,8 +83,8 @@ static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_m return !memcmp(nm_a, nm_b, sizeof(*nm_a)); return !memcmp(nm_a, nm_b, sizeof(*nm_a)); } } void tipc_port_list_add(struct port_list *pl_ptr, u32 port); void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port); void tipc_port_list_free(struct port_list *pl_ptr); void tipc_port_list_free(struct tipc_port_list *pl_ptr); void tipc_bclink_init(void); void tipc_bclink_init(void); void tipc_bclink_stop(void); void tipc_bclink_stop(void); Loading
net/tipc/bearer.c +22 −20 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,7 @@ #define MAX_ADDR_STR 32 #define MAX_ADDR_STR 32 static struct media *media_list[MAX_MEDIA]; static struct tipc_media *media_list[MAX_MEDIA]; static u32 media_count; static u32 media_count; struct tipc_bearer tipc_bearers[MAX_BEARERS]; struct tipc_bearer tipc_bearers[MAX_BEARERS]; Loading @@ -68,7 +68,7 @@ static int media_name_valid(const char *name) * tipc_media_find - locates specified media object by name * tipc_media_find - locates specified media object by name */ */ struct media *tipc_media_find(const char *name) struct tipc_media *tipc_media_find(const char *name) { { u32 i; u32 i; Loading @@ -83,7 +83,7 @@ struct media *tipc_media_find(const char *name) * media_find_id - locates specified media object by type identifier * media_find_id - locates specified media object by type identifier */ */ static struct media *media_find_id(u8 type) static struct tipc_media *media_find_id(u8 type) { { u32 i; u32 i; Loading @@ -100,7 +100,7 @@ static struct media *media_find_id(u8 type) * Bearers for this media type must be activated separately at a later stage. * Bearers for this media type must be activated separately at a later stage. */ */ int tipc_register_media(struct media *m_ptr) int tipc_register_media(struct tipc_media *m_ptr) { { int res = -EINVAL; int res = -EINVAL; Loading Loading @@ -138,7 +138,7 @@ int tipc_register_media(struct media *m_ptr) void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a) { { char addr_str[MAX_ADDR_STR]; char addr_str[MAX_ADDR_STR]; struct media *m_ptr; struct tipc_media *m_ptr; m_ptr = media_find_id(a->media_id); m_ptr = media_find_id(a->media_id); Loading Loading @@ -185,7 +185,7 @@ struct sk_buff *tipc_media_get_names(void) */ */ static int bearer_name_validate(const char *name, static int bearer_name_validate(const char *name, struct bearer_name *name_parts) struct tipc_bearer_names *name_parts) { { char name_copy[TIPC_MAX_BEARER_NAME]; char name_copy[TIPC_MAX_BEARER_NAME]; char *media_name; char *media_name; Loading Loading @@ -318,7 +318,7 @@ void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest) static int bearer_push(struct tipc_bearer *b_ptr) static int bearer_push(struct tipc_bearer *b_ptr) { { u32 res = 0; u32 res = 0; struct link *ln, *tln; struct tipc_link *ln, *tln; if (b_ptr->blocked) if (b_ptr->blocked) return 0; return 0; Loading Loading @@ -364,7 +364,8 @@ void tipc_continue(struct tipc_bearer *b_ptr) * bearer.lock is busy * bearer.lock is busy */ */ static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct link *l_ptr) static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) { { list_move_tail(&l_ptr->link_list, &b_ptr->cong_links); list_move_tail(&l_ptr->link_list, &b_ptr->cong_links); } } Loading @@ -377,7 +378,7 @@ static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct link * bearer.lock is free * bearer.lock is free */ */ void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr) void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) { { spin_lock_bh(&b_ptr->lock); spin_lock_bh(&b_ptr->lock); tipc_bearer_schedule_unlocked(b_ptr, l_ptr); tipc_bearer_schedule_unlocked(b_ptr, l_ptr); Loading @@ -390,7 +391,8 @@ void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr) * and if there is, try to resolve it before returning. * and if there is, try to resolve it before returning. * 'tipc_net_lock' is read_locked when this function is called * 'tipc_net_lock' is read_locked when this function is called */ */ int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr) int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) { { int res = 1; int res = 1; Loading @@ -409,7 +411,7 @@ int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr * tipc_bearer_congested - determines if bearer is currently congested * tipc_bearer_congested - determines if bearer is currently congested */ */ int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr) int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr) { { if (unlikely(b_ptr->blocked)) if (unlikely(b_ptr->blocked)) return 1; return 1; Loading @@ -425,8 +427,8 @@ int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr) int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) { { struct tipc_bearer *b_ptr; struct tipc_bearer *b_ptr; struct media *m_ptr; struct tipc_media *m_ptr; struct bearer_name b_name; struct tipc_bearer_names b_names; char addr_string[16]; char addr_string[16]; u32 bearer_id; u32 bearer_id; u32 with_this_prio; u32 with_this_prio; Loading @@ -438,7 +440,7 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) name); name); return -ENOPROTOOPT; return -ENOPROTOOPT; } } if (!bearer_name_validate(name, &b_name)) { if (!bearer_name_validate(name, &b_names)) { warn("Bearer <%s> rejected, illegal name\n", name); warn("Bearer <%s> rejected, illegal name\n", name); return -EINVAL; return -EINVAL; } } Loading @@ -463,10 +465,10 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) write_lock_bh(&tipc_net_lock); write_lock_bh(&tipc_net_lock); m_ptr = tipc_media_find(b_name.media_name); m_ptr = tipc_media_find(b_names.media_name); if (!m_ptr) { if (!m_ptr) { warn("Bearer <%s> rejected, media <%s> not registered\n", name, warn("Bearer <%s> rejected, media <%s> not registered\n", name, b_name.media_name); b_names.media_name); goto exit; goto exit; } } Loading Loading @@ -544,8 +546,8 @@ int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority) int tipc_block_bearer(const char *name) int tipc_block_bearer(const char *name) { { struct tipc_bearer *b_ptr = NULL; struct tipc_bearer *b_ptr = NULL; struct link *l_ptr; struct tipc_link *l_ptr; struct link *temp_l_ptr; struct tipc_link *temp_l_ptr; read_lock_bh(&tipc_net_lock); read_lock_bh(&tipc_net_lock); b_ptr = tipc_bearer_find(name); b_ptr = tipc_bearer_find(name); Loading Loading @@ -579,8 +581,8 @@ int tipc_block_bearer(const char *name) static void bearer_disable(struct tipc_bearer *b_ptr) static void bearer_disable(struct tipc_bearer *b_ptr) { { struct link *l_ptr; struct tipc_link *l_ptr; struct link *temp_l_ptr; struct tipc_link *temp_l_ptr; info("Disabling bearer <%s>\n", b_ptr->name); info("Disabling bearer <%s>\n", b_ptr->name); spin_lock_bh(&b_ptr->lock); spin_lock_bh(&b_ptr->lock); Loading
net/tipc/bearer.h +12 −11 Original line number Original line Diff line number Diff line Loading @@ -74,7 +74,7 @@ struct tipc_media_addr { struct tipc_bearer; struct tipc_bearer; /** /** * struct media - TIPC media information available to internal users * struct tipc_media - TIPC media information available to internal users * @send_msg: routine which handles buffer transmission * @send_msg: routine which handles buffer transmission * @enable_bearer: routine which enables a bearer * @enable_bearer: routine which enables a bearer * @disable_bearer: routine which disables a bearer * @disable_bearer: routine which disables a bearer Loading @@ -90,7 +90,7 @@ struct tipc_bearer; * @name: media name * @name: media name */ */ struct media { struct tipc_media { int (*send_msg)(struct sk_buff *buf, int (*send_msg)(struct sk_buff *buf, struct tipc_bearer *b_ptr, struct tipc_bearer *b_ptr, struct tipc_media_addr *dest); struct tipc_media_addr *dest); Loading Loading @@ -139,12 +139,12 @@ struct tipc_bearer { struct tipc_media_addr addr; /* initalized by media */ struct tipc_media_addr addr; /* initalized by media */ char name[TIPC_MAX_BEARER_NAME]; char name[TIPC_MAX_BEARER_NAME]; spinlock_t lock; spinlock_t lock; struct media *media; struct tipc_media *media; u32 priority; u32 priority; u32 window; u32 window; u32 tolerance; u32 tolerance; u32 identity; u32 identity; struct link_req *link_req; struct tipc_link_req *link_req; struct list_head links; struct list_head links; struct list_head cong_links; struct list_head cong_links; int active; int active; Loading @@ -152,19 +152,19 @@ struct tipc_bearer { struct tipc_node_map nodes; struct tipc_node_map nodes; }; }; struct bearer_name { struct tipc_bearer_names { char media_name[TIPC_MAX_MEDIA_NAME]; char media_name[TIPC_MAX_MEDIA_NAME]; char if_name[TIPC_MAX_IF_NAME]; char if_name[TIPC_MAX_IF_NAME]; }; }; struct link; struct tipc_link; extern struct tipc_bearer tipc_bearers[]; extern struct tipc_bearer tipc_bearers[]; /* /* * TIPC routines available to supported media types * TIPC routines available to supported media types */ */ int tipc_register_media(struct media *m_ptr); int tipc_register_media(struct tipc_media *m_ptr); void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr); void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr); Loading @@ -188,12 +188,13 @@ struct sk_buff *tipc_media_get_names(void); struct sk_buff *tipc_bearer_get_names(void); struct sk_buff *tipc_bearer_get_names(void); void tipc_bearer_add_dest(struct tipc_bearer *b_ptr, u32 dest); void tipc_bearer_add_dest(struct tipc_bearer *b_ptr, u32 dest); void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest); void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest); void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr); void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr); struct tipc_bearer *tipc_bearer_find(const char *name); struct tipc_bearer *tipc_bearer_find(const char *name); struct tipc_bearer *tipc_bearer_find_interface(const char *if_name); struct tipc_bearer *tipc_bearer_find_interface(const char *if_name); struct media *tipc_media_find(const char *name); struct tipc_media *tipc_media_find(const char *name); int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr); int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr); struct tipc_link *l_ptr); int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr); void tipc_bearer_stop(void); void tipc_bearer_stop(void); void tipc_bearer_lock_push(struct tipc_bearer *b_ptr); void tipc_bearer_lock_push(struct tipc_bearer *b_ptr); Loading
net/tipc/discover.c +10 −10 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,7 @@ /** /** * struct link_req - information about an ongoing link setup request * struct tipc_link_req - information about an ongoing link setup request * @bearer: bearer issuing requests * @bearer: bearer issuing requests * @dest: destination address for request messages * @dest: destination address for request messages * @domain: network domain to which links can be established * @domain: network domain to which links can be established Loading @@ -54,7 +54,7 @@ * @timer: timer governing period between requests * @timer: timer governing period between requests * @timer_intv: current interval between requests (in ms) * @timer_intv: current interval between requests (in ms) */ */ struct link_req { struct tipc_link_req { struct tipc_bearer *bearer; struct tipc_bearer *bearer; struct tipc_media_addr dest; struct tipc_media_addr dest; u32 domain; u32 domain; Loading Loading @@ -120,7 +120,7 @@ static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr, void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) { { struct tipc_node *n_ptr; struct tipc_node *n_ptr; struct link *link; struct tipc_link *link; struct tipc_media_addr media_addr, *addr; struct tipc_media_addr media_addr, *addr; struct sk_buff *rbuf; struct sk_buff *rbuf; struct tipc_msg *msg = buf_msg(buf); struct tipc_msg *msg = buf_msg(buf); Loading Loading @@ -218,7 +218,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr) * and is either not currently searching or is searching at a slow rate * and is either not currently searching or is searching at a slow rate */ */ static void disc_update(struct link_req *req) static void disc_update(struct tipc_link_req *req) { { if (!req->num_nodes) { if (!req->num_nodes) { if ((req->timer_intv == TIPC_LINK_REQ_INACTIVE) || if ((req->timer_intv == TIPC_LINK_REQ_INACTIVE) || Loading @@ -234,7 +234,7 @@ static void disc_update(struct link_req *req) * @req: ptr to link request structure * @req: ptr to link request structure */ */ void tipc_disc_add_dest(struct link_req *req) void tipc_disc_add_dest(struct tipc_link_req *req) { { req->num_nodes++; req->num_nodes++; } } Loading @@ -244,7 +244,7 @@ void tipc_disc_add_dest(struct link_req *req) * @req: ptr to link request structure * @req: ptr to link request structure */ */ void tipc_disc_remove_dest(struct link_req *req) void tipc_disc_remove_dest(struct tipc_link_req *req) { { req->num_nodes--; req->num_nodes--; disc_update(req); disc_update(req); Loading @@ -255,7 +255,7 @@ void tipc_disc_remove_dest(struct link_req *req) * @req: ptr to link request structure * @req: ptr to link request structure */ */ static void disc_send_msg(struct link_req *req) static void disc_send_msg(struct tipc_link_req *req) { { if (!req->bearer->blocked) if (!req->bearer->blocked) tipc_bearer_send(req->bearer, req->buf, &req->dest); tipc_bearer_send(req->bearer, req->buf, &req->dest); Loading @@ -268,7 +268,7 @@ static void disc_send_msg(struct link_req *req) * Called whenever a link setup request timer associated with a bearer expires. * Called whenever a link setup request timer associated with a bearer expires. */ */ static void disc_timeout(struct link_req *req) static void disc_timeout(struct tipc_link_req *req) { { int max_delay; int max_delay; Loading Loading @@ -316,7 +316,7 @@ static void disc_timeout(struct link_req *req) int tipc_disc_create(struct tipc_bearer *b_ptr, int tipc_disc_create(struct tipc_bearer *b_ptr, struct tipc_media_addr *dest, u32 dest_domain) struct tipc_media_addr *dest, u32 dest_domain) { { struct link_req *req; struct tipc_link_req *req; req = kmalloc(sizeof(*req), GFP_ATOMIC); req = kmalloc(sizeof(*req), GFP_ATOMIC); if (!req) if (!req) Loading Loading @@ -345,7 +345,7 @@ int tipc_disc_create(struct tipc_bearer *b_ptr, * @req: ptr to link request structure * @req: ptr to link request structure */ */ void tipc_disc_delete(struct link_req *req) void tipc_disc_delete(struct tipc_link_req *req) { { k_cancel_timer(&req->timer); k_cancel_timer(&req->timer); k_term_timer(&req->timer); k_term_timer(&req->timer); Loading