Lines Matching full:pi
32 struct pnpinfo *pi; in pnp_scan() local
70 STAILQ_FOREACH(pi, &pnp_devices, pi_link) { in pnp_scan()
71 pager_output(STAILQ_FIRST(&pi->pi_ident)->id_ident); /* first ident should be canonical */ in pnp_scan()
72 if (pi->pi_desc != NULL) { in pnp_scan()
74 pager_output(pi->pi_desc); in pnp_scan()
91 struct pnpinfo *pi; in pnp_discard() local
94 pi = STAILQ_FIRST(&pnp_devices); in pnp_discard()
96 pnp_freeinfo(pi); in pnp_discard()
101 * Add a unique identifier to (pi)
104 pnp_addident(struct pnpinfo *pi, char *ident) in pnp_addident() argument
108 STAILQ_FOREACH(id, &pi->pi_ident, id_link) in pnp_addident()
114 STAILQ_INSERT_TAIL(&pi->pi_ident, id, id_link); in pnp_addident()
123 struct pnpinfo *pi; in pnp_allocinfo() local
125 pi = malloc(sizeof(struct pnpinfo)); in pnp_allocinfo()
126 bzero(pi, sizeof(struct pnpinfo)); in pnp_allocinfo()
127 STAILQ_INIT(&pi->pi_ident); in pnp_allocinfo()
128 return(pi); in pnp_allocinfo()
135 pnp_freeinfo(struct pnpinfo *pi) in pnp_freeinfo() argument
139 while (!STAILQ_EMPTY(&pi->pi_ident)) { in pnp_freeinfo()
140 id = STAILQ_FIRST(&pi->pi_ident); in pnp_freeinfo()
141 STAILQ_REMOVE_HEAD(&pi->pi_ident, id_link); in pnp_freeinfo()
145 if (pi->pi_desc) in pnp_freeinfo()
146 free(pi->pi_desc); in pnp_freeinfo()
147 if (pi->pi_module) in pnp_freeinfo()
148 free(pi->pi_module); in pnp_freeinfo()
149 if (pi->pi_argv) in pnp_freeinfo()
150 free(pi->pi_argv); in pnp_freeinfo()
151 free(pi); in pnp_freeinfo()
158 pnp_addinfo(struct pnpinfo *pi) in pnp_addinfo() argument
160 STAILQ_INSERT_TAIL(&pnp_devices, pi, pi_link); in pnp_addinfo()