···4646#define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */47474848/**4949- * struct bcbearer_pair - a pair of bearers used by broadcast link4949+ * struct tipc_bcbearer_pair - a pair of bearers used by broadcast link5050 * @primary: pointer to primary bearer5151 * @secondary: pointer to secondary bearer5252 *···5454 * to be paired.5555 */56565757-struct bcbearer_pair {5757+struct tipc_bcbearer_pair {5858 struct tipc_bearer *primary;5959 struct tipc_bearer *secondary;6060};61616262/**6363- * struct bcbearer - bearer used by broadcast link6363+ * struct tipc_bcbearer - bearer used by broadcast link6464 * @bearer: (non-standard) broadcast bearer structure6565 * @media: (non-standard) broadcast media structure6666 * @bpairs: array of bearer pairs···7474 * prevented through use of the spinlock "bc_lock".7575 */76767777-struct bcbearer {7777+struct tipc_bcbearer {7878 struct tipc_bearer bearer;7979- struct media media;8080- struct bcbearer_pair bpairs[MAX_BEARERS];8181- struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1];7979+ struct tipc_media media;8080+ struct tipc_bcbearer_pair bpairs[MAX_BEARERS];8181+ struct tipc_bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1];8282 struct tipc_node_map remains;8383 struct tipc_node_map remains_new;8484};85858686/**8787- * struct bclink - link used for broadcast messages8787+ * struct tipc_bclink - link used for broadcast messages8888 * @link: (non-standard) broadcast link structure8989 * @node: (non-standard) node structure representing b'cast link's peer node9090 * @bcast_nodes: map of broadcast-capable nodes···9393 * Handles sequence numbering, fragmentation, bundling, etc.9494 */95959696-struct bclink {9797- struct link link;9696+struct tipc_bclink {9797+ struct tipc_link link;9898 struct tipc_node node;9999 struct tipc_node_map bcast_nodes;100100 struct tipc_node *retransmit_to;101101};102102103103-static struct bcbearer bcast_bearer;104104-static struct bclink bcast_link;103103+static struct tipc_bcbearer bcast_bearer;104104+static struct tipc_bclink bcast_link;105105106106-static struct bcbearer *bcbearer = &bcast_bearer;107107-static struct bclink *bclink = &bcast_link;108108-static struct link *bcl = &bcast_link.link;106106+static struct tipc_bcbearer *bcbearer = &bcast_bearer;107107+static struct tipc_bclink *bclink = &bcast_link;108108+static struct tipc_link *bcl = &bcast_link.link;109109110110static DEFINE_SPINLOCK(bc_lock);111111···308308309309static void bclink_send_ack(struct tipc_node *n_ptr)310310{311311- struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1];311311+ struct tipc_link *l_ptr = n_ptr->active_links[n_ptr->addr & 1];312312313313 if (l_ptr != NULL)314314 tipc_link_send_proto_msg(l_ptr, STATE_MSG, 0, 0, 0, 0, 0);···677677678678void tipc_bcbearer_sort(void)679679{680680- struct bcbearer_pair *bp_temp = bcbearer->bpairs_temp;681681- struct bcbearer_pair *bp_curr;680680+ struct tipc_bcbearer_pair *bp_temp = bcbearer->bpairs_temp;681681+ struct tipc_bcbearer_pair *bp_curr;682682 int b_index;683683 int pri;684684···893893 * tipc_port_list_add - add a port to a port list, ensuring no duplicates894894 */895895896896-void tipc_port_list_add(struct port_list *pl_ptr, u32 port)896896+void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port)897897{898898- struct port_list *item = pl_ptr;898898+ struct tipc_port_list *item = pl_ptr;899899 int i;900900 int item_sz = PLSIZE;901901 int cnt = pl_ptr->count;···927927 *928928 */929929930930-void tipc_port_list_free(struct port_list *pl_ptr)930930+void tipc_port_list_free(struct tipc_port_list *pl_ptr)931931{932932- struct port_list *item;933933- struct port_list *next;932932+ struct tipc_port_list *item;933933+ struct tipc_port_list *next;934934935935 for (item = pl_ptr->next; item; item = next) {936936 next = item->next;
+5-5
net/tipc/bcast.h
···5454#define PLSIZE 3255555656/**5757- * struct port_list - set of node local destination ports5757+ * struct tipc_port_list - set of node local destination ports5858 * @count: # of ports in set (only valid for first entry in list)5959 * @next: pointer to next entry in list6060 * @ports: array of port references6161 */62626363-struct port_list {6363+struct tipc_port_list {6464 int count;6565- struct port_list *next;6565+ struct tipc_port_list *next;6666 u32 ports[PLSIZE];6767};6868···8383 return !memcmp(nm_a, nm_b, sizeof(*nm_a));8484}85858686-void tipc_port_list_add(struct port_list *pl_ptr, u32 port);8787-void tipc_port_list_free(struct port_list *pl_ptr);8686+void tipc_port_list_add(struct tipc_port_list *pl_ptr, u32 port);8787+void tipc_port_list_free(struct tipc_port_list *pl_ptr);88888989void tipc_bclink_init(void);9090void tipc_bclink_stop(void);
+22-20
net/tipc/bearer.c
···41414242#define MAX_ADDR_STR 3243434444-static struct media *media_list[MAX_MEDIA];4444+static struct tipc_media *media_list[MAX_MEDIA];4545static u32 media_count;46464747struct tipc_bearer tipc_bearers[MAX_BEARERS];···6868 * tipc_media_find - locates specified media object by name6969 */70707171-struct media *tipc_media_find(const char *name)7171+struct tipc_media *tipc_media_find(const char *name)7272{7373 u32 i;7474···8383 * media_find_id - locates specified media object by type identifier8484 */85858686-static struct media *media_find_id(u8 type)8686+static struct tipc_media *media_find_id(u8 type)8787{8888 u32 i;8989···100100 * Bearers for this media type must be activated separately at a later stage.101101 */102102103103-int tipc_register_media(struct media *m_ptr)103103+int tipc_register_media(struct tipc_media *m_ptr)104104{105105 int res = -EINVAL;106106···138138void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a)139139{140140 char addr_str[MAX_ADDR_STR];141141- struct media *m_ptr;141141+ struct tipc_media *m_ptr;142142143143 m_ptr = media_find_id(a->media_id);144144···185185 */186186187187static int bearer_name_validate(const char *name,188188- struct bearer_name *name_parts)188188+ struct tipc_bearer_names *name_parts)189189{190190 char name_copy[TIPC_MAX_BEARER_NAME];191191 char *media_name;···318318static int bearer_push(struct tipc_bearer *b_ptr)319319{320320 u32 res = 0;321321- struct link *ln, *tln;321321+ struct tipc_link *ln, *tln;322322323323 if (b_ptr->blocked)324324 return 0;···364364 * bearer.lock is busy365365 */366366367367-static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr, struct link *l_ptr)367367+static void tipc_bearer_schedule_unlocked(struct tipc_bearer *b_ptr,368368+ struct tipc_link *l_ptr)368369{369370 list_move_tail(&l_ptr->link_list, &b_ptr->cong_links);370371}···378377 * bearer.lock is free379378 */380379381381-void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr)380380+void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr)382381{383382 spin_lock_bh(&b_ptr->lock);384383 tipc_bearer_schedule_unlocked(b_ptr, l_ptr);···391390 * and if there is, try to resolve it before returning.392391 * 'tipc_net_lock' is read_locked when this function is called393392 */394394-int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr)393393+int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr,394394+ struct tipc_link *l_ptr)395395{396396 int res = 1;397397···411409 * tipc_bearer_congested - determines if bearer is currently congested412410 */413411414414-int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr)412412+int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr)415413{416414 if (unlikely(b_ptr->blocked))417415 return 1;···427425int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)428426{429427 struct tipc_bearer *b_ptr;430430- struct media *m_ptr;431431- struct bearer_name b_name;428428+ struct tipc_media *m_ptr;429429+ struct tipc_bearer_names b_names;432430 char addr_string[16];433431 u32 bearer_id;434432 u32 with_this_prio;···440438 name);441439 return -ENOPROTOOPT;442440 }443443- if (!bearer_name_validate(name, &b_name)) {441441+ if (!bearer_name_validate(name, &b_names)) {444442 warn("Bearer <%s> rejected, illegal name\n", name);445443 return -EINVAL;446444 }···465463466464 write_lock_bh(&tipc_net_lock);467465468468- m_ptr = tipc_media_find(b_name.media_name);466466+ m_ptr = tipc_media_find(b_names.media_name);469467 if (!m_ptr) {470468 warn("Bearer <%s> rejected, media <%s> not registered\n", name,471471- b_name.media_name);469469+ b_names.media_name);472470 goto exit;473471 }474472···546544int tipc_block_bearer(const char *name)547545{548546 struct tipc_bearer *b_ptr = NULL;549549- struct link *l_ptr;550550- struct link *temp_l_ptr;547547+ struct tipc_link *l_ptr;548548+ struct tipc_link *temp_l_ptr;551549552550 read_lock_bh(&tipc_net_lock);553551 b_ptr = tipc_bearer_find(name);···581579582580static void bearer_disable(struct tipc_bearer *b_ptr)583581{584584- struct link *l_ptr;585585- struct link *temp_l_ptr;582582+ struct tipc_link *l_ptr;583583+ struct tipc_link *temp_l_ptr;586584587585 info("Disabling bearer <%s>\n", b_ptr->name);588586 spin_lock_bh(&b_ptr->lock);
+12-11
net/tipc/bearer.h
···7474struct tipc_bearer;75757676/**7777- * struct media - TIPC media information available to internal users7777+ * struct tipc_media - TIPC media information available to internal users7878 * @send_msg: routine which handles buffer transmission7979 * @enable_bearer: routine which enables a bearer8080 * @disable_bearer: routine which disables a bearer···9090 * @name: media name9191 */92929393-struct media {9393+struct tipc_media {9494 int (*send_msg)(struct sk_buff *buf,9595 struct tipc_bearer *b_ptr,9696 struct tipc_media_addr *dest);···139139 struct tipc_media_addr addr; /* initalized by media */140140 char name[TIPC_MAX_BEARER_NAME];141141 spinlock_t lock;142142- struct media *media;142142+ struct tipc_media *media;143143 u32 priority;144144 u32 window;145145 u32 tolerance;146146 u32 identity;147147- struct link_req *link_req;147147+ struct tipc_link_req *link_req;148148 struct list_head links;149149 struct list_head cong_links;150150 int active;···152152 struct tipc_node_map nodes;153153};154154155155-struct bearer_name {155155+struct tipc_bearer_names {156156 char media_name[TIPC_MAX_MEDIA_NAME];157157 char if_name[TIPC_MAX_IF_NAME];158158};159159160160-struct link;160160+struct tipc_link;161161162162extern struct tipc_bearer tipc_bearers[];163163164164/*165165 * TIPC routines available to supported media types166166 */167167-int tipc_register_media(struct media *m_ptr);167167+int tipc_register_media(struct tipc_media *m_ptr);168168169169void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr);170170···188188struct sk_buff *tipc_bearer_get_names(void);189189void tipc_bearer_add_dest(struct tipc_bearer *b_ptr, u32 dest);190190void tipc_bearer_remove_dest(struct tipc_bearer *b_ptr, u32 dest);191191-void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct link *l_ptr);191191+void tipc_bearer_schedule(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr);192192struct tipc_bearer *tipc_bearer_find(const char *name);193193struct tipc_bearer *tipc_bearer_find_interface(const char *if_name);194194-struct media *tipc_media_find(const char *name);195195-int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr, struct link *l_ptr);196196-int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr);194194+struct tipc_media *tipc_media_find(const char *name);195195+int tipc_bearer_resolve_congestion(struct tipc_bearer *b_ptr,196196+ struct tipc_link *l_ptr);197197+int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct tipc_link *l_ptr);197198void tipc_bearer_stop(void);198199void tipc_bearer_lock_push(struct tipc_bearer *b_ptr);199200
+10-10
net/tipc/discover.c
···454546464747/**4848- * struct link_req - information about an ongoing link setup request4848+ * struct tipc_link_req - information about an ongoing link setup request4949 * @bearer: bearer issuing requests5050 * @dest: destination address for request messages5151 * @domain: network domain to which links can be established···5454 * @timer: timer governing period between requests5555 * @timer_intv: current interval between requests (in ms)5656 */5757-struct link_req {5757+struct tipc_link_req {5858 struct tipc_bearer *bearer;5959 struct tipc_media_addr dest;6060 u32 domain;···120120void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)121121{122122 struct tipc_node *n_ptr;123123- struct link *link;123123+ struct tipc_link *link;124124 struct tipc_media_addr media_addr, *addr;125125 struct sk_buff *rbuf;126126 struct tipc_msg *msg = buf_msg(buf);···218218 * and is either not currently searching or is searching at a slow rate219219 */220220221221-static void disc_update(struct link_req *req)221221+static void disc_update(struct tipc_link_req *req)222222{223223 if (!req->num_nodes) {224224 if ((req->timer_intv == TIPC_LINK_REQ_INACTIVE) ||···234234 * @req: ptr to link request structure235235 */236236237237-void tipc_disc_add_dest(struct link_req *req)237237+void tipc_disc_add_dest(struct tipc_link_req *req)238238{239239 req->num_nodes++;240240}···244244 * @req: ptr to link request structure245245 */246246247247-void tipc_disc_remove_dest(struct link_req *req)247247+void tipc_disc_remove_dest(struct tipc_link_req *req)248248{249249 req->num_nodes--;250250 disc_update(req);···255255 * @req: ptr to link request structure256256 */257257258258-static void disc_send_msg(struct link_req *req)258258+static void disc_send_msg(struct tipc_link_req *req)259259{260260 if (!req->bearer->blocked)261261 tipc_bearer_send(req->bearer, req->buf, &req->dest);···268268 * Called whenever a link setup request timer associated with a bearer expires.269269 */270270271271-static void disc_timeout(struct link_req *req)271271+static void disc_timeout(struct tipc_link_req *req)272272{273273 int max_delay;274274···316316int tipc_disc_create(struct tipc_bearer *b_ptr,317317 struct tipc_media_addr *dest, u32 dest_domain)318318{319319- struct link_req *req;319319+ struct tipc_link_req *req;320320321321 req = kmalloc(sizeof(*req), GFP_ATOMIC);322322 if (!req)···345345 * @req: ptr to link request structure346346 */347347348348-void tipc_disc_delete(struct link_req *req)348348+void tipc_disc_delete(struct tipc_link_req *req)349349{350350 k_cancel_timer(&req->timer);351351 k_term_timer(&req->timer);