Lines Matching refs:proto
84 static inline void bt_sock_reclassify_lock(struct socket *sock, int proto) in bt_sock_reclassify_lock() argument
94 bt_slock_key_strings[proto], &bt_slock_key[proto], in bt_sock_reclassify_lock()
95 bt_key_strings[proto], &bt_lock_key[proto]); in bt_sock_reclassify_lock()
98 int bt_sock_register(int proto, struct net_proto_family *ops) in bt_sock_register() argument
102 if (proto < 0 || proto >= BT_MAX_PROTO) in bt_sock_register()
107 if (bt_proto[proto]) in bt_sock_register()
110 bt_proto[proto] = ops; in bt_sock_register()
118 int bt_sock_unregister(int proto) in bt_sock_unregister() argument
122 if (proto < 0 || proto >= BT_MAX_PROTO) in bt_sock_unregister()
127 if (!bt_proto[proto]) in bt_sock_unregister()
130 bt_proto[proto] = NULL; in bt_sock_unregister()
160 static int bt_sock_create(struct net *net, struct socket *sock, int proto) in bt_sock_create() argument
164 if (proto == BTPROTO_RFCOMM || proto == BTPROTO_SCO || in bt_sock_create()
165 proto == BTPROTO_L2CAP) { in bt_sock_create()
174 if (proto < 0 || proto >= BT_MAX_PROTO) in bt_sock_create()
177 if (!bt_proto[proto]) in bt_sock_create()
178 request_module("bt-proto-%d", proto); in bt_sock_create()
184 if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { in bt_sock_create()
185 err = bt_proto[proto]->create(net, sock, proto); in bt_sock_create()
186 bt_sock_reclassify_lock(sock, proto); in bt_sock_create()
187 module_put(bt_proto[proto]->owner); in bt_sock_create()