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()
262 int ret = nl_socket_add_membership(ctx->sock, id); in cld80211_add_mcast_group()
285 int ret = nl_socket_drop_membership(ctx->sock, id); in cld80211_remove_mcast_group()
332 if (!ctx || !ctx->sock || !nlmsg) { in cld80211_send_msg()
337 err = nl_send_auto_complete(ctx->sock, nlmsg); /* send message */ in cld80211_send_msg()
353 if (!ctx || !ctx->sock || !nlmsg) { in cld80211_send_recv_msg()
362 err = nl_send_auto_complete(ctx->sock, nlmsg); /* send message */ in cld80211_send_recv_msg()
381 int res = nl_recvmsgs(ctx->sock, cb); in cld80211_send_recv_msg()
401 if (!ctx || !ctx->sock || !valid_handler) { in cld80211_recv()
420 pfd[0].fd = nl_socket_get_fd(ctx->sock); in cld80211_recv()
433 cld80211_handle_event(pfd[0].revents, ctx->sock, cb); in cld80211_recv()
458 ctx->sock = create_nl_socket(NETLINK_GENERIC); in cld80211_init()
459 if (ctx->sock == NULL) { in cld80211_init()
465 if (nl_socket_set_buffer_size(ctx->sock, SOCK_BUF_SIZE , 0) < 0) { in cld80211_init()
471 ctx->netlink_familyid = genl_ctrl_resolve(ctx->sock, "cld80211"); in cld80211_init()
478 ctx->nlctrl_familyid = genl_ctrl_resolve(ctx->sock, "nlctrl"); in cld80211_init()
493 if (ctx->sock) { in cld80211_init()
494 nl_socket_free(ctx->sock); in cld80211_init()
503 if (!ctx || !ctx->sock) { in cld80211_deinit()
507 nl_socket_free(ctx->sock); in cld80211_deinit()