Lines Matching full:ud

176 	struct sndstat_userdev *ud;  in sndstat_remove_all_userdevs()  local
180 while ((ud = TAILQ_FIRST(&pf->userdev_list)) != NULL) { in sndstat_remove_all_userdevs()
181 TAILQ_REMOVE(&pf->userdev_list, ud, link); in sndstat_remove_all_userdevs()
182 free(ud->provider, M_DEVBUF); in sndstat_remove_all_userdevs()
183 free(ud->desc, M_DEVBUF); in sndstat_remove_all_userdevs()
184 free(ud->devnode, M_DEVBUF); in sndstat_remove_all_userdevs()
185 free(ud->nameunit, M_DEVBUF); in sndstat_remove_all_userdevs()
186 nvlist_destroy(ud->provider_nvl); in sndstat_remove_all_userdevs()
187 free(ud, M_DEVBUF); in sndstat_remove_all_userdevs()
301 struct sndstat_userdev *ud; in sndstat_write() local
303 ud = sndstat_line2userdev(pf, line, strlen(line)); in sndstat_write()
304 if (ud == NULL) in sndstat_write()
308 TAILQ_INSERT_TAIL(&pf->userdev_list, ud, link); in sndstat_write()
600 sndstat_build_userland_nvlist(struct sndstat_userdev *ud, nvlist_t **dip) in sndstat_build_userland_nvlist() argument
612 nvlist_add_number(di, SNDST_DSPS_PCHAN, ud->pchan); in sndstat_build_userland_nvlist()
613 nvlist_add_number(di, SNDST_DSPS_RCHAN, ud->rchan); in sndstat_build_userland_nvlist()
614 nvlist_add_string(di, SNDST_DSPS_NAMEUNIT, ud->nameunit); in sndstat_build_userland_nvlist()
616 di, SNDST_DSPS_DEVNODE, ud->devnode); in sndstat_build_userland_nvlist()
617 nvlist_add_string(di, SNDST_DSPS_DESC, ud->desc); in sndstat_build_userland_nvlist()
618 if (ud->pchan != 0) { in sndstat_build_userland_nvlist()
620 ud->info_play.min_rate); in sndstat_build_userland_nvlist()
622 ud->info_play.max_rate); in sndstat_build_userland_nvlist()
624 ud->info_play.formats); in sndstat_build_userland_nvlist()
625 diinfo = sndstat_create_diinfo_nv(ud->info_play.min_rate, in sndstat_build_userland_nvlist()
626 ud->info_play.max_rate, ud->info_play.formats, in sndstat_build_userland_nvlist()
627 ud->info_play.min_chn, ud->info_play.max_chn); in sndstat_build_userland_nvlist()
633 if (ud->rchan != 0) { in sndstat_build_userland_nvlist()
635 ud->info_rec.min_rate); in sndstat_build_userland_nvlist()
637 ud->info_rec.max_rate); in sndstat_build_userland_nvlist()
639 ud->info_rec.formats); in sndstat_build_userland_nvlist()
640 diinfo = sndstat_create_diinfo_nv(ud->info_rec.min_rate, in sndstat_build_userland_nvlist()
641 ud->info_rec.max_rate, ud->info_rec.formats, in sndstat_build_userland_nvlist()
642 ud->info_rec.min_chn, ud->info_rec.max_chn); in sndstat_build_userland_nvlist()
649 (ud->provider != NULL) ? ud->provider : ""); in sndstat_build_userland_nvlist()
650 if (ud->provider_nvl != NULL) in sndstat_build_userland_nvlist()
652 di, SNDST_DSPS_PROVIDER_INFO, ud->provider_nvl); in sndstat_build_userland_nvlist()
702 struct sndstat_userdev *ud; in sndstat_create_devs_nvlist() local
706 TAILQ_FOREACH(ud, &pf->userdev_list, link) { in sndstat_create_devs_nvlist()
709 err = sndstat_build_userland_nvlist(ud, &di); in sndstat_create_devs_nvlist()
896 sndstat_dsp_unpack_nvlist(const nvlist_t *nvlist, struct sndstat_userdev *ud) in sndstat_dsp_unpack_nvlist() argument
954 ud->provider = (provider != NULL) ? strdup(provider, M_DEVBUF) : NULL; in sndstat_dsp_unpack_nvlist()
955 ud->devnode = strdup(devnode, M_DEVBUF); in sndstat_dsp_unpack_nvlist()
956 ud->nameunit = strdup(nameunit, M_DEVBUF); in sndstat_dsp_unpack_nvlist()
957 ud->desc = strdup(desc, M_DEVBUF); in sndstat_dsp_unpack_nvlist()
958 ud->pchan = pchan; in sndstat_dsp_unpack_nvlist()
959 ud->rchan = rchan; in sndstat_dsp_unpack_nvlist()
960 ud->info_play.min_rate = pminrate; in sndstat_dsp_unpack_nvlist()
961 ud->info_play.max_rate = pmaxrate; in sndstat_dsp_unpack_nvlist()
962 ud->info_play.formats = pfmts; in sndstat_dsp_unpack_nvlist()
963 ud->info_play.min_chn = pminchn; in sndstat_dsp_unpack_nvlist()
964 ud->info_play.max_chn = pmaxchn; in sndstat_dsp_unpack_nvlist()
965 ud->info_rec.min_rate = rminrate; in sndstat_dsp_unpack_nvlist()
966 ud->info_rec.max_rate = rmaxrate; in sndstat_dsp_unpack_nvlist()
967 ud->info_rec.formats = rfmts; in sndstat_dsp_unpack_nvlist()
968 ud->info_rec.min_chn = rminchn; in sndstat_dsp_unpack_nvlist()
969 ud->info_rec.max_chn = rmaxchn; in sndstat_dsp_unpack_nvlist()
970 ud->provider_nvl = provider_nvl; in sndstat_dsp_unpack_nvlist()
1009 struct sndstat_userdev *ud = in sndstat_add_user_devs() local
1010 malloc(sizeof(*ud), M_DEVBUF, M_WAITOK); in sndstat_add_user_devs()
1011 err = sndstat_dsp_unpack_nvlist(dsps[i], ud); in sndstat_add_user_devs()
1016 TAILQ_INSERT_TAIL(&pf->userdev_list, ud, link); in sndstat_add_user_devs()
1098 struct sndstat_userdev *ud; in sndstat_line2userdev() local
1101 ud = malloc(sizeof(*ud), M_DEVBUF, M_WAITOK|M_ZERO); in sndstat_line2userdev()
1103 ud->provider = NULL; in sndstat_line2userdev()
1104 ud->provider_nvl = NULL; in sndstat_line2userdev()
1108 ud->nameunit = strndup(line, e - line, M_DEVBUF); in sndstat_line2userdev()
1109 ud->devnode = malloc(e - line + 1, M_DEVBUF, M_WAITOK | M_ZERO); in sndstat_line2userdev()
1110 strlcat(ud->devnode, ud->nameunit, e - line + 1); in sndstat_line2userdev()
1120 ud->desc = strndup(line, e - line, M_DEVBUF); in sndstat_line2userdev()
1132 ud->pchan = 1; in sndstat_line2userdev()
1135 ud->rchan = 1; in sndstat_line2userdev()
1137 return (ud); in sndstat_line2userdev()
1140 free(ud->nameunit, M_DEVBUF); in sndstat_line2userdev()
1141 free(ud->devnode, M_DEVBUF); in sndstat_line2userdev()
1142 free(ud->desc, M_DEVBUF); in sndstat_line2userdev()
1143 free(ud, M_DEVBUF); in sndstat_line2userdev()
1407 struct sndstat_userdev *ud; in sndstat_prepare() local
1418 TAILQ_FOREACH(ud, &pf->userdev_list, link) { in sndstat_prepare()
1419 const char *caps = (ud->pchan && ud->rchan) ? in sndstat_prepare()
1421 (ud->pchan ? "play" : (ud->rchan ? "rec" : "")); in sndstat_prepare()
1422 sbuf_printf(s, "%s: <%s>", ud->nameunit, ud->desc); in sndstat_prepare()