• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/net/tipc/

Lines Matching refs:sub

100 static void subscr_send_event(struct subscription *sub,
109 msg_sect.iov_base = (void *)&sub->evt;
112 sub->evt.event = htohl(event, sub->owner->swap);
113 sub->evt.found_lower = htohl(found_lower, sub->owner->swap);
114 sub->evt.found_upper = htohl(found_upper, sub->owner->swap);
115 sub->evt.port.ref = htohl(port_ref, sub->owner->swap);
116 sub->evt.port.node = htohl(node, sub->owner->swap);
117 tipc_send(sub->owner->port_ref, 1, &msg_sect);
126 int tipc_subscr_overlap(struct subscription *sub,
131 if (found_lower < sub->seq.lower)
132 found_lower = sub->seq.lower;
133 if (found_upper > sub->seq.upper)
134 found_upper = sub->seq.upper;
146 void tipc_subscr_report_overlap(struct subscription *sub,
154 dbg("Rep overlap %u:%u,%u<->%u,%u\n", sub->seq.type, sub->seq.lower,
155 sub->seq.upper, found_lower, found_upper);
156 if (!tipc_subscr_overlap(sub, found_lower, found_upper))
158 if (!must && !(sub->filter & TIPC_SUB_PORTS))
160 subscr_send_event(sub, found_lower, found_upper, event, port_ref, node);
167 static void subscr_timeout(struct subscription *sub)
174 subscriber_ref = sub->owner->ref;
181 if (sub->timeout == TIPC_WAIT_FOREVER) {
188 tipc_nametbl_unsubscribe(sub);
192 subscr_send_event(sub,
193 sub->evt.s.seq.lower,
194 sub->evt.s.seq.upper,
198 list_del(&sub->subscription_list);
203 k_term_timer(&sub->timer);
204 kfree(sub);
214 static void subscr_del(struct subscription *sub)
216 tipc_nametbl_unsubscribe(sub);
217 list_del(&sub->subscription_list);
218 kfree(sub);
235 struct subscription *sub;
245 list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
247 if (sub->timeout != TIPC_WAIT_FOREVER) {
248 k_cancel_timer(&sub->timer);
249 k_term_timer(&sub->timer);
251 dbg("Term: Removing sub %u,%u,%u from subscriber %x list\n",
252 sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
253 subscr_del(sub);
286 struct subscription *sub;
292 list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
294 if (!memcmp(s, &sub->evt.s, sizeof(struct tipc_subscr))) {
304 if (sub->timeout != TIPC_WAIT_FOREVER) {
305 sub->timeout = TIPC_WAIT_FOREVER;
307 k_cancel_timer(&sub->timer);
308 k_term_timer(&sub->timer);
311 dbg("Cancel: removing sub %u,%u,%u from subscriber %x list\n",
312 sub->seq.type, sub->seq.lower, sub->seq.upper, subscriber);
313 subscr_del(sub);
325 struct subscription *sub;
353 sub = kzalloc(sizeof(*sub), GFP_ATOMIC);
354 if (!sub) {
362 sub->seq.type = htohl(s->seq.type, subscriber->swap);
363 sub->seq.lower = htohl(s->seq.lower, subscriber->swap);
364 sub->seq.upper = htohl(s->seq.upper, subscriber->swap);
365 sub->timeout = htohl(s->timeout, subscriber->swap);
366 sub->filter = htohl(s->filter, subscriber->swap);
367 if ((!(sub->filter & TIPC_SUB_PORTS)
368 == !(sub->filter & TIPC_SUB_SERVICE))
369 || (sub->seq.lower > sub->seq.upper)) {
371 kfree(sub);
375 memcpy(&sub->evt.s, s, sizeof(struct tipc_subscr));
376 INIT_LIST_HEAD(&sub->subscription_list);
377 INIT_LIST_HEAD(&sub->nameseq_list);
378 list_add(&sub->subscription_list, &subscriber->subscription_list);
380 if (sub->timeout != TIPC_WAIT_FOREVER) {
381 k_init_timer(&sub->timer,
382 (Handler)subscr_timeout, (unsigned long)sub);
383 k_start_timer(&sub->timer, sub->timeout);
385 sub->owner = subscriber;
386 tipc_nametbl_subscribe(sub);