Lines Matching refs:req
187 static void disc_update(struct tipc_link_req *req) in disc_update() argument
189 if (!req->num_nodes) { in disc_update()
190 if ((req->timer_intv == TIPC_LINK_REQ_INACTIVE) || in disc_update()
191 (req->timer_intv > TIPC_LINK_REQ_FAST)) { in disc_update()
192 req->timer_intv = TIPC_LINK_REQ_INIT; in disc_update()
193 mod_timer(&req->timer, jiffies + req->timer_intv); in disc_update()
202 void tipc_disc_add_dest(struct tipc_link_req *req) in tipc_disc_add_dest() argument
204 spin_lock_bh(&req->lock); in tipc_disc_add_dest()
205 req->num_nodes++; in tipc_disc_add_dest()
206 spin_unlock_bh(&req->lock); in tipc_disc_add_dest()
213 void tipc_disc_remove_dest(struct tipc_link_req *req) in tipc_disc_remove_dest() argument
215 spin_lock_bh(&req->lock); in tipc_disc_remove_dest()
216 req->num_nodes--; in tipc_disc_remove_dest()
217 disc_update(req); in tipc_disc_remove_dest()
218 spin_unlock_bh(&req->lock); in tipc_disc_remove_dest()
229 struct tipc_link_req *req = (struct tipc_link_req *)data; in disc_timeout() local
233 spin_lock_bh(&req->lock); in disc_timeout()
236 if (tipc_node(req->domain) && req->num_nodes) { in disc_timeout()
237 req->timer_intv = TIPC_LINK_REQ_INACTIVE; in disc_timeout()
248 skb = skb_clone(req->buf, GFP_ATOMIC); in disc_timeout()
250 tipc_bearer_xmit_skb(req->net, req->bearer_id, skb, &req->dest); in disc_timeout()
251 req->timer_intv *= 2; in disc_timeout()
252 if (req->num_nodes) in disc_timeout()
256 if (req->timer_intv > max_delay) in disc_timeout()
257 req->timer_intv = max_delay; in disc_timeout()
259 mod_timer(&req->timer, jiffies + req->timer_intv); in disc_timeout()
261 spin_unlock_bh(&req->lock); in disc_timeout()
276 struct tipc_link_req *req; in tipc_disc_create() local
278 req = kmalloc(sizeof(*req), GFP_ATOMIC); in tipc_disc_create()
279 if (!req) in tipc_disc_create()
281 req->buf = tipc_buf_acquire(MAX_H_SIZE, GFP_ATOMIC); in tipc_disc_create()
282 if (!req->buf) { in tipc_disc_create()
283 kfree(req); in tipc_disc_create()
287 tipc_disc_init_msg(net, req->buf, DSC_REQ_MSG, b); in tipc_disc_create()
288 memcpy(&req->dest, dest, sizeof(*dest)); in tipc_disc_create()
289 req->net = net; in tipc_disc_create()
290 req->bearer_id = b->identity; in tipc_disc_create()
291 req->domain = b->domain; in tipc_disc_create()
292 req->num_nodes = 0; in tipc_disc_create()
293 req->timer_intv = TIPC_LINK_REQ_INIT; in tipc_disc_create()
294 spin_lock_init(&req->lock); in tipc_disc_create()
295 setup_timer(&req->timer, disc_timeout, (unsigned long)req); in tipc_disc_create()
296 mod_timer(&req->timer, jiffies + req->timer_intv); in tipc_disc_create()
297 b->link_req = req; in tipc_disc_create()
298 *skb = skb_clone(req->buf, GFP_ATOMIC); in tipc_disc_create()
306 void tipc_disc_delete(struct tipc_link_req *req) in tipc_disc_delete() argument
308 del_timer_sync(&req->timer); in tipc_disc_delete()
309 kfree_skb(req->buf); in tipc_disc_delete()
310 kfree(req); in tipc_disc_delete()
321 struct tipc_link_req *req = b->link_req; in tipc_disc_reset() local
324 spin_lock_bh(&req->lock); in tipc_disc_reset()
325 tipc_disc_init_msg(net, req->buf, DSC_REQ_MSG, b); in tipc_disc_reset()
326 req->net = net; in tipc_disc_reset()
327 req->bearer_id = b->identity; in tipc_disc_reset()
328 req->domain = b->domain; in tipc_disc_reset()
329 req->num_nodes = 0; in tipc_disc_reset()
330 req->timer_intv = TIPC_LINK_REQ_INIT; in tipc_disc_reset()
331 mod_timer(&req->timer, jiffies + req->timer_intv); in tipc_disc_reset()
332 skb = skb_clone(req->buf, GFP_ATOMIC); in tipc_disc_reset()
334 tipc_bearer_xmit_skb(net, req->bearer_id, skb, &req->dest); in tipc_disc_reset()
335 spin_unlock_bh(&req->lock); in tipc_disc_reset()