Lines Matching refs:hp

124 	struct nwam_handle *hp;  in nwam_create()  local
128 if (nwam_read(type, dbname, name, 0, &hp) == NWAM_SUCCESS) { in nwam_create()
129 nwam_free(hp); in nwam_create()
137 nwam_get_name(struct nwam_handle *hp, char **namep) in nwam_get_name() argument
139 assert(hp != NULL && namep != NULL); in nwam_get_name()
141 if ((*namep = strdup(hp->nwh_name)) == NULL) { in nwam_get_name()
149 nwam_set_name(struct nwam_handle *hp, const char *name) in nwam_set_name() argument
151 assert(hp != NULL && name != NULL); in nwam_set_name()
153 if (hp->nwh_committed) in nwam_set_name()
156 if (strlen(name) >= sizeof (hp->nwh_name)) in nwam_set_name()
159 (void) strcpy(hp->nwh_name, name); in nwam_set_name()
209 struct nwam_handle *hp; in nwam_walk() local
253 flags & NWAM_FLAG_GLOBAL_MASK, &hp); in nwam_walk()
261 if ((selectcb == NULL) || (selectcb(hp, flags, data) == 0)) { in nwam_walk()
262 ret = cb(hp, data); in nwam_walk()
264 nwam_free(hp); in nwam_walk()
271 nwam_free(hp); in nwam_walk()
281 nwam_free(struct nwam_handle *hp) in nwam_free() argument
283 if (hp != NULL) { in nwam_free()
284 if (hp->nwh_data != NULL) in nwam_free()
285 nwam_free_object_list(hp->nwh_data); in nwam_free()
286 free(hp); in nwam_free()
299 struct nwam_handle *hp; in nwam_copy() local
303 if (nwam_read(oldhp->nwh_object_type, dbname, newname, 0, &hp) in nwam_copy()
305 nwam_free(hp); in nwam_copy()
324 nwam_walk_props(struct nwam_handle *hp, in nwam_walk_props() argument
333 assert(hp != NULL && hp->nwh_data != NULL && cb != NULL); in nwam_walk_props()
337 while ((err = nwam_next_object_prop(hp->nwh_data, lastpropname, in nwam_walk_props()
365 nwam_commit(const char *dbname, struct nwam_handle *hp, uint64_t flags) in nwam_commit() argument
373 assert(hp != NULL); in nwam_commit()
382 (hp->nwh_object_type == NWAM_OBJECT_TYPE_KNOWN_WLAN ? in nwam_commit()
387 is_ncu = (hp->nwh_object_type == NWAM_OBJECT_TYPE_NCU); in nwam_commit()
392 switch (nwam_read(hp->nwh_object_type, (char *)dbname, hp->nwh_name, 0, in nwam_commit()
399 if (hp->nwh_object_type == NWAM_OBJECT_TYPE_NCP) in nwam_commit()
408 hp->nwh_object_type == NWAM_OBJECT_TYPE_NCP ? NULL : hp->nwh_name, in nwam_commit()
409 iflags, hp->nwh_data); in nwam_commit()
413 hp->nwh_committed = B_TRUE; in nwam_commit()
423 (void) nwam_request_action(hp->nwh_object_type, in nwam_commit()
424 hp->nwh_name, ncpname, action); in nwam_commit()
428 (void) nwam_request_action(hp->nwh_object_type, hp->nwh_name, in nwam_commit()
435 nwam_is_active(struct nwam_handle *hp) in nwam_is_active() argument
440 return ((nwam_get_state(NULL, hp, &state, &aux) == NWAM_SUCCESS && in nwam_is_active()
445 nwam_destroy(const char *dbname, struct nwam_handle *hp, uint64_t flags) in nwam_destroy() argument
451 assert(hp != NULL); in nwam_destroy()
456 (hp->nwh_object_type == NWAM_OBJECT_TYPE_KNOWN_WLAN ? in nwam_destroy()
460 is_ncp = hp->nwh_object_type == NWAM_OBJECT_TYPE_NCP; in nwam_destroy()
461 is_ncu = hp->nwh_object_type == NWAM_OBJECT_TYPE_NCU; in nwam_destroy()
462 name = hp->nwh_name; in nwam_destroy()
465 if (!is_ncp && !is_ncu && nwam_is_active(hp)) in nwam_destroy()
480 (void) nwam_request_action(hp->nwh_object_type, name, in nwam_destroy()
485 (void) nwam_request_action(hp->nwh_object_type, name, NULL, in nwam_destroy()
490 nwam_free(hp); in nwam_destroy()
501 nwam_enable(const char *parent, struct nwam_handle *hp) in nwam_enable() argument
503 return (nwam_request_action(hp->nwh_object_type, hp->nwh_name, in nwam_enable()
508 nwam_disable(const char *parent, struct nwam_handle *hp) in nwam_disable() argument
510 return (nwam_request_action(hp->nwh_object_type, hp->nwh_name, in nwam_disable()
515 nwam_get_state(const char *parent, struct nwam_handle *hp, nwam_state_t *statep, in nwam_get_state() argument
518 return (nwam_request_state(hp->nwh_object_type, hp->nwh_name, parent, in nwam_get_state()
676 nwam_validate_prop(struct nwam_prop_table table, struct nwam_handle *hp, in nwam_validate_prop() argument
681 assert(hp != NULL && propname != NULL); in nwam_validate_prop()
691 nwam_validate(struct nwam_prop_table table, struct nwam_handle *hp, in nwam_validate() argument
697 assert(hp != NULL); in nwam_validate()
702 err1 = nwam_walk_props(hp, nwam_validate_prop_internal, &via, in nwam_validate()