void __exit hidp_cleanup_sockets(void) { if (bt_sock_unregister(BTPROTO_HIDP) < 0) BT_ERR("Can't unregister HIDP socket"); proto_unregister(&hidp_proto); }
static int __init mptp_init(void) { int rc; rc = proto_register(&mptp_prot, 1); if (unlikely(rc)) { log_error("Error registering mptp protocol\n"); goto out; } rc = inet_add_protocol(&mptp_protocol, IPPROTO_MPTP); if (unlikely(rc)) { log_error("Error adding mptp protocol\n"); goto out_unregister; } inet_register_protosw(&mptp_protosw); log_debug("MPTP entered\n"); return 0; out_unregister: proto_unregister(&mptp_prot); out: return rc; }
static int __init dccp_v4_init(void) { int err = proto_register(&dccp_v4_prot, 1); if (err != 0) goto out; err = inet_add_protocol(&dccp_v4_protocol, IPPROTO_DCCP); if (err != 0) goto out_proto_unregister; inet_register_protosw(&dccp_v4_protosw); err = register_pernet_subsys(&dccp_v4_ops); if (err) goto out_destroy_ctl_sock; out: return err; out_destroy_ctl_sock: inet_unregister_protosw(&dccp_v4_protosw); inet_del_protocol(&dccp_v4_protocol, IPPROTO_DCCP); out_proto_unregister: proto_unregister(&dccp_v4_prot); goto out; }
static int __vsock_core_init(void) { int err; vsock_init_tables(); err = misc_register(&vsock_device); if (err) { pr_err("Failed to register misc device\n"); return -ENOENT; } err = proto_register(&vsock_proto, 1); /* we want our slab */ if (err) { pr_err("Cannot register vsock protocol\n"); goto err_misc_deregister; } err = sock_register(&vsock_family_ops); if (err) { pr_err("could not register af_vsock (%d) address family: %d\n", AF_VSOCK, err); goto err_unregister_proto; } return 0; err_unregister_proto: proto_unregister(&vsock_proto); err_misc_deregister: misc_deregister(&vsock_device); return err; }
int __init bnep_sock_init(void) { int err; err = proto_register(&bnep_proto, 0); if (err < 0) return err; err = bt_sock_register(BTPROTO_BNEP, &bnep_sock_family_ops); if (err < 0) { BT_ERR("Can't register BNEP socket"); goto error; } err = bt_procfs_init(&init_net, "bnep", &bnep_sk_list, NULL); if (err < 0) { BT_ERR("Failed to create BNEP proc file"); bt_sock_unregister(BTPROTO_BNEP); goto error; } BT_INFO("BNEP socket layer initialized"); return 0; error: proto_unregister(&bnep_proto); return err; }
int __init hidp_init_sockets(void) { int err; err = proto_register(&hidp_proto, 0); if (err < 0) return err; err = bt_sock_register(BTPROTO_HIDP, &hidp_sock_family_ops); if (err < 0) { BT_ERR("Can't register HIDP socket"); goto error; } err = bt_procfs_init(&init_net, "hidp", &hidp_sk_list, NULL); if (err < 0) { BT_ERR("Failed to create HIDP proc file"); bt_sock_unregister(BTPROTO_HIDP); goto error; } BT_INFO("HIDP socket layer initialized"); return 0; error: proto_unregister(&hidp_proto); return err; }
void cmtp_cleanup_sockets(void) { if (bt_sock_unregister(BTPROTO_CMTP) < 0) BT_ERR("Can't unregister CMTP socket"); proto_unregister(&cmtp_proto); }
int cmtp_init_sockets(void) { int err; err = proto_register(&cmtp_proto, 0); if (err < 0) return err; err = bt_sock_register(BTPROTO_CMTP, &cmtp_sock_family_ops); if (err < 0) { BT_ERR("Can't register CMTP socket"); goto error; } err = bt_procfs_init(THIS_MODULE, &init_net, "cmtp", &cmtp_sk_list, NULL); if (err < 0) { BT_ERR("Failed to create CMTP proc file"); bt_sock_unregister(BTPROTO_HIDP); goto error; } BT_INFO("CMTP socket layer initialized"); return 0; error: proto_unregister(&cmtp_proto); return err; }
void __exit bnep_sock_cleanup(void) { if (bt_sock_unregister(BTPROTO_BNEP) < 0) BT_ERR("Can't unregister BNEP socket"); proto_unregister(&bnep_proto); }
void l2cap_cleanup_sockets(void) { if (bt_sock_unregister(BTPROTO_L2CAP) < 0) BT_ERR("L2CAP socket unregistration failed"); proto_unregister(&l2cap_proto); }
static void __exit dccp_v4_exit(void) { unregister_pernet_subsys(&dccp_v4_ops); inet_unregister_protosw(&dccp_v4_protosw); inet_del_protocol(&dccp_v4_protocol, IPPROTO_DCCP); proto_unregister(&dccp_v4_prot); }
void phonet_proto_unregister(int protocol, struct phonet_protocol *pp) { spin_lock(&proto_tab_lock); BUG_ON(proto_tab[protocol] != pp); proto_tab[protocol] = NULL; spin_unlock(&proto_tab_lock); proto_unregister(pp->prot); }
void nfc_proto_unregister(const struct nfc_protocol *nfc_proto) { write_lock(&proto_tab_lock); proto_tab[nfc_proto->id] = NULL; write_unlock(&proto_tab_lock); proto_unregister(nfc_proto->proto); }
void cmtp_cleanup_sockets(void) { bt_procfs_cleanup(&init_net, "cmtp"); if (bt_sock_unregister(BTPROTO_CMTP) < 0) BT_ERR("Can't unregister CMTP socket"); proto_unregister(&cmtp_proto); }
void __exit bnep_sock_cleanup(void) { bt_procfs_cleanup(&init_net, "bnep"); if (bt_sock_unregister(BTPROTO_BNEP) < 0) BT_ERR("Can't unregister BNEP socket"); proto_unregister(&bnep_proto); }
static void __exit llc2_exit(void) { llc_station_exit(); llc_remove_pack(LLC_DEST_SAP); llc_remove_pack(LLC_DEST_CONN); sock_unregister(PF_LLC); llc_proc_exit(); proto_unregister(&llc_proto); }
void tipc_socket_stop(void) { if (!sockets_enabled) return; sockets_enabled = 0; sock_unregister(tipc_family_ops.family); proto_unregister(&tipc_proto); }
void phonet_proto_unregister(int protocol, struct phonet_protocol *pp) { mutex_lock(&proto_tab_lock); BUG_ON(proto_tab[protocol] != pp); rcu_assign_pointer(proto_tab[protocol], NULL); mutex_unlock(&proto_tab_lock); synchronize_rcu(); proto_unregister(pp->prot); }
void phonet_proto_unregister(unsigned int protocol, struct phonet_protocol *pp) { mutex_lock(&proto_tab_lock); BUG_ON(proto_tab[protocol] != pp); RCU_INIT_POINTER(proto_tab[protocol], NULL); mutex_unlock(&proto_tab_lock); synchronize_rcu(); proto_unregister(pp->prot); }
static void __exit mptp_exit(void) { inet_unregister_protosw(&mptp_protosw); inet_del_protocol(&mptp_protocol, IPPROTO_MPTP); proto_unregister(&mptp_prot); log_debug("MPTP exited\n"); }
static void __exit vrr_exit(void) { sock_unregister(AF_VRR); dev_remove_pack(&vrr_packet_type); del_timer(&vrr_timer); /* Cleanup routing/sysfs stuff here */ kobject_put(vrr_obj); proto_unregister(&vrr_proto); }
int __vsock_core_init(const struct vsock_transport *t, struct module *owner) { int err = mutex_lock_interruptible(&vsock_register_mutex); if (err) return err; if (transport) { err = -EBUSY; goto err_busy; } /* Transport must be the owner of the protocol so that it can't * unload while there are open sockets. */ vsock_proto.owner = owner; transport = t; vsock_init_tables(); vsock_device.minor = MISC_DYNAMIC_MINOR; err = misc_register(&vsock_device); if (err) { pr_err("Failed to register misc device\n"); goto err_reset_transport; } err = proto_register(&vsock_proto, 1); /* we want our slab */ if (err) { pr_err("Cannot register vsock protocol\n"); goto err_deregister_misc; } err = sock_register(&vsock_family_ops); if (err) { pr_err("could not register af_vsock (%d) address family: %d\n", AF_VSOCK, err); goto err_unregister_proto; } mutex_unlock(&vsock_register_mutex); return 0; err_unregister_proto: proto_unregister(&vsock_proto); err_deregister_misc: misc_deregister(&vsock_device); err_reset_transport: transport = NULL; err_busy: mutex_unlock(&vsock_register_mutex); return err; }
void vsock_core_exit(void) { mutex_lock(&vsock_register_mutex); misc_deregister(&vsock_device); sock_unregister(AF_VSOCK); proto_unregister(&vsock_proto); /* We do not want the assignment below re-ordered. */ mb(); transport = NULL; mutex_unlock(&vsock_register_mutex); }
void cleanup_module(void) { /* * Added by MSEVILLA (12-9-2012) * Cleanup my character device */ device_destroy(my_class, MKDEV(major_no, 0)); class_unregister(my_class); class_destroy(my_class); unregister_chrdev(major_no, DEVICE_NAME); printk(KERN_INFO "removing mobile_host module\n"); proto_unregister(&udpmhost_prot); sock_unregister(AF_MHOST); dev_remove_pack(&mhost_ptype); }
int __init hidp_init_sockets(void) { int err; err = proto_register(&hidp_proto, 0); if (err < 0) return err; err = bt_sock_register(BTPROTO_HIDP, &hidp_sock_family_ops); if (err < 0) goto error; return 0; error: BT_ERR("Can't register HIDP socket"); proto_unregister(&hidp_proto); return err; }
int __init bnep_sock_init(void) { int err; err = proto_register(&bnep_proto, 0); if (err < 0) return err; err = bt_sock_register(BTPROTO_BNEP, &bnep_sock_family_ops); if (err < 0) goto error; return 0; error: BT_ERR("Can't register BNEP socket"); proto_unregister(&bnep_proto); return err; }
int cmtp_init_sockets(void) { int err; err = proto_register(&cmtp_proto, 0); if (err < 0) return err; err = bt_sock_register(BTPROTO_CMTP, &cmtp_sock_family_ops); if (err < 0) goto error; return 0; error: BT_ERR("Can't register CMTP socket"); proto_unregister(&cmtp_proto); return err; }
void __init udplite4_register(void) { if (proto_register(&udplite_prot, 1)) goto out_register_err; if (inet_add_protocol(&udplite_protocol, IPPROTO_UDPLITE) < 0) goto out_unregister_proto; inet_register_protosw(&udplite4_protosw); if (udplite4_proc_init()) printk(KERN_ERR "%s: Cannot register /proc!\n", __func__); return; out_unregister_proto: proto_unregister(&udplite_prot); out_register_err: printk(KERN_CRIT "%s: Cannot add UDP-Lite protocol.\n", __FUNCTION__); }
void __init udplite4_register(void) { udp_table_init(&udplite_table, "UDP-Lite"); if (proto_register(&udplite_prot, 1)) goto out_register_err; if (inet_add_protocol(&udplite_protocol, IPPROTO_UDPLITE) < 0) goto out_unregister_proto; inet_register_protosw(&udplite4_protosw); if (udplite4_proc_init()) pr_err("%s: Cannot register /proc!\n", __func__); return; out_unregister_proto: proto_unregister(&udplite_prot); out_register_err: pr_crit("%s: Cannot add UDP-Lite protocol\n", __func__); }
int __init l2cap_init_sockets(void) { int err; err = proto_register(&l2cap_proto, 0); if (err < 0) return err; err = bt_sock_register(BTPROTO_L2CAP, &l2cap_sock_family_ops); if (err < 0) goto error; BT_INFO("L2CAP socket layer initialized"); return 0; error: BT_ERR("L2CAP socket registration failed"); proto_unregister(&l2cap_proto); return err; }