Lines Matching refs:sock

56 	struct nl_sock *sock;  in create_nl_socket()  local
58 sock = nl_socket_alloc(); in create_nl_socket()
59 if (sock == NULL) { in create_nl_socket()
65 if (nl_connect(sock, protocol)) { in create_nl_socket()
68 nl_socket_free(sock); in create_nl_socket()
72 return sock; in create_nl_socket()
165 int cld80211_recv_msg(struct nl_sock *sock, struct nl_cb *cb) in cld80211_recv_msg() argument
167 if (!sock || !cb) { in cld80211_recv_msg()
168 ALOGE("%s: %s is NULL", getprogname(), sock?"cb":"sock"); in cld80211_recv_msg()
172 int res = nl_recvmsgs(sock, cb); in cld80211_recv_msg()
180 static void cld80211_handle_event(int events, struct nl_sock *sock, in cld80211_handle_event() argument
185 cld80211_recv_msg(sock, cb); in cld80211_handle_event()
189 cld80211_recv_msg(sock, cb); in cld80211_handle_event()
264 int ret = nl_socket_add_membership(ctx->sock, id); in cld80211_add_mcast_group()
287 int ret = nl_socket_drop_membership(ctx->sock, id); in cld80211_remove_mcast_group()
334 if (!ctx || !ctx->sock || !nlmsg) { in cld80211_send_msg()
339 err = nl_send_auto_complete(ctx->sock, nlmsg); /* send message */ in cld80211_send_msg()
355 if (!ctx || !ctx->sock || !nlmsg) { in cld80211_send_recv_msg()
364 err = nl_send_auto_complete(ctx->sock, nlmsg); /* send message */ in cld80211_send_recv_msg()
383 int res = nl_recvmsgs(ctx->sock, cb); in cld80211_send_recv_msg()
403 if (!ctx || !ctx->sock || !valid_handler) { in cld80211_recv()
422 pfd[0].fd = nl_socket_get_fd(ctx->sock); in cld80211_recv()
435 cld80211_handle_event(pfd[0].revents, ctx->sock, cb); in cld80211_recv()
460 ctx->sock = create_nl_socket(NETLINK_GENERIC); in cld80211_init()
461 if (ctx->sock == NULL) { in cld80211_init()
467 if (nl_socket_set_buffer_size(ctx->sock, SOCK_BUF_SIZE , 0) < 0) { in cld80211_init()
473 ctx->netlink_familyid = genl_ctrl_resolve(ctx->sock, "cld80211"); in cld80211_init()
480 ctx->nlctrl_familyid = genl_ctrl_resolve(ctx->sock, "nlctrl"); in cld80211_init()
495 if (ctx->sock) { in cld80211_init()
496 nl_socket_free(ctx->sock); in cld80211_init()
505 if (!ctx || !ctx->sock) { in cld80211_deinit()
509 nl_socket_free(ctx->sock); in cld80211_deinit()