static int cn_test_init(void) { int err; err = cn_add_callback(&cn_test_id, cn_test_name, cn_test_callback); if (err) goto err_out; cn_test_id.val++; err = cn_add_callback(&cn_test_id, cn_test_name, cn_test_callback); if (err) { cn_del_callback(&cn_test_id); goto err_out; } setup_timer(&cn_test_timer, cn_test_timer_func, 0); mod_timer(&cn_test_timer, jiffies + msecs_to_jiffies(1000)); pr_info("initialized with id={%u.%u}\n", cn_test_id.idx, cn_test_id.val); return 0; err_out: if (nls && nls->sk_socket) sock_release(nls->sk_socket); return err; }
static int cn_test_init(void) { int err; err = cn_add_callback(&cn_test_id, cn_test_name, cn_test_callback); if (err) goto err_out; cn_test_id.val++; err = cn_add_callback(&cn_test_id, cn_test_name, cn_test_callback); if (err) { cn_del_callback(&cn_test_id); goto err_out; } init_timer(&cn_test_timer); cn_test_timer.function = cn_test_timer_func; cn_test_timer.expires = jiffies + HZ; cn_test_timer.data = 0; add_timer(&cn_test_timer); return 0; err_out: if (nls && nls->sk_socket) sock_release(nls->sk_socket); return err; }
/* * cn_proc_init - initialization entry point * * Adds the connector callback to the connector driver. */ static int __init cn_proc_init(void) { int err = cn_add_callback(&cn_proc_event_id, "cn_proc", &cn_proc_mcast_ctl); if (err) { pr_warn("cn_proc failed to register\n"); return err; } return 0; }
/* * cn_proc_init - initialization entry point * * Adds the connector callback to the connector driver. */ static int __init cn_proc_init(void) { int err; if ((err = cn_add_callback(&cn_proc_event_id, "cn_proc", &cn_proc_mcast_ctl))) { printk(KERN_WARNING "cn_proc failed to register\n"); return err; } return 0; }
int missile_tenx_netlink_init(struct cb_id *id) { int ret; sg_cbid = id; id->idx = MISSILE_TENX_CONNECTOR_ID_IDX; id->val = MISSILE_TENX_CONNECTOR_ID_VAL; ret = cn_add_callback(id, "missile_tenx_connector_id", missile_tenx_connector_on_receive); return -ret; }
int hv_kvp_init(struct hv_util_service *srv) { int err; err = cn_add_callback(&kvp_id, kvp_name, kvp_cn_callback); if (err) return err; recv_buffer = srv->recv_buffer; return 0; }
int hv_kvp_init(void) { int err; err = cn_add_callback(&kvp_id, kvp_name, kvp_cn_callback); if (err) return err; recv_buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!recv_buffer) return -ENOMEM; return 0; }
int hv_vss_init(struct hv_util_service *srv) { int err; err = cn_add_callback(&vss_id, vss_name, vss_cn_callback); if (err) return err; recv_buffer = srv->recv_buffer; /* * When this driver loads, the user level daemon that * processes the host requests may not yet be running. * Defer processing channel callbacks until the daemon * has registered. */ vss_transaction.active = true; return 0; }