81 return swap ?
swab32(in) : in;
97 struct iovec msg_sect;
102 sub->
evt.event = htohl(event, sub->
swap);
103 sub->
evt.found_lower = htohl(found_lower, sub->
swap);
104 sub->
evt.found_upper = htohl(found_upper, sub->
swap);
105 sub->
evt.port.ref = htohl(port_ref, sub->
swap);
106 sub->
evt.port.node = htohl(node, sub->
swap);
120 if (found_lower < sub->
seq.lower)
121 found_lower = sub->
seq.lower;
122 if (found_upper > sub->
seq.upper)
123 found_upper = sub->
seq.upper;
124 if (found_lower > found_upper)
147 subscr_send_event(sub, found_lower, found_upper, event, port_ref, node);
158 server_port = tipc_port_lock(sub->
server_ref);
159 if (server_port ==
NULL)
164 tipc_port_unlock(server_port);
175 tipc_port_unlock(server_port);
178 subscr_send_event(sub, sub->
evt.s.seq.lower, sub->
evt.s.seq.upper,
182 k_term_timer(&sub->
timer);
219 spin_unlock_bh(subscriber->
lock);
229 k_cancel_timer(&sub->
timer);
230 k_term_timer(&sub->
timer);
236 spin_lock_bh(&topsrv.lock);
238 spin_unlock_bh(&topsrv.lock);
241 spin_lock_bh(subscriber->
lock);
277 spin_unlock_bh(subscriber->
lock);
278 k_cancel_timer(&sub->
timer);
279 k_term_timer(&sub->
timer);
280 spin_lock_bh(subscriber->
lock);
302 subscr_cancel(s, subscriber);
308 pr_warn(
"Subscription rejected, limit reached (%u)\n",
310 subscr_terminate(subscriber);
317 pr_warn(
"Subscription rejected, no memory\n");
318 subscr_terminate(subscriber);
323 sub->
seq.type = htohl(s->
seq.type, swap);
324 sub->
seq.lower = htohl(s->
seq.lower, swap);
325 sub->
seq.upper = htohl(s->
seq.upper, swap);
330 (sub->
seq.lower > sub->
seq.upper)) {
331 pr_warn(
"Subscription rejected, illegal request\n");
333 subscr_terminate(subscriber);
343 k_init_timer(&sub->
timer,
344 (
Handler)subscr_timeout, (
unsigned long)sub);
356 static void subscr_conn_shutdown_event(
void *usr_handle,
359 unsigned char const *
data,
366 if (tipc_port_lock(port_ref) ==
NULL)
369 subscriber_lock = subscriber->
lock;
370 subscr_terminate(subscriber);
371 spin_unlock_bh(subscriber_lock);
379 static void subscr_conn_msg_event(
void *usr_handle,
393 if (tipc_port_lock(port_ref) ==
NULL)
396 subscriber_lock = subscriber->
lock;
399 subscr_terminate(subscriber);
400 spin_unlock_bh(subscriber_lock);
402 sub = subscr_subscribe((
struct tipc_subscr *)data, subscriber);
403 spin_unlock_bh(subscriber_lock);
428 static void subscr_named_msg_event(
void *usr_handle,
442 if (subscriber ==
NULL) {
443 pr_warn(
"Subscriber rejected, no memory\n");
454 subscr_conn_shutdown_event,
457 subscr_conn_msg_event,
461 pr_warn(
"Subscriber rejected, unable to create port\n");
468 subscriber->
lock = tipc_port_lock(subscriber->
port_ref)->lock;
471 spin_lock_bh(&topsrv.lock);
473 spin_unlock_bh(&topsrv.lock);
476 server_port_ref = subscriber->
port_ref;
477 spin_unlock_bh(subscriber->
lock);
484 subscr_conn_msg_event(subscriber, server_port_ref,
495 INIT_LIST_HEAD(&topsrv.subscriber_list);
503 subscr_named_msg_event,
513 topsrv.setup_port = 0;
520 pr_err(
"Failed to create subscription service\n");
530 if (topsrv.setup_port) {
532 topsrv.setup_port = 0;
535 &topsrv.subscriber_list,
537 subscriber_lock = subscriber->
lock;
538 spin_lock_bh(subscriber_lock);
539 subscr_terminate(subscriber);
540 spin_unlock_bh(subscriber_lock);