Lines Matching full:bst
100 acpi_battery_bst_valid(struct acpi_bst *bst)
103 return (bst->state != ACPI_BATT_STAT_NOT_PRESENT &&
104 bst->cap != ACPI_BATT_UNKNOWN && bst->volt != ACPI_BATT_UNKNOWN);
123 struct acpi_bst *bst;
142 bst = malloc(devcount * sizeof(*bst), M_TEMP, M_WAITOK | M_ZERO);
173 if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 ||
178 if (!acpi_battery_bst_valid(&bst[i]) ||
187 if ((bst[i].state & ACPI_BATT_STAT_DISCHARG) != 0)
188 bst[i].state &= ~ACPI_BATT_STAT_CHARGING;
189 batt_stat |= bst[i].state;
190 bi[i].state = bst[i].state;
199 bst[i].rate = (bst[i].rate * bix->dvol) / 1000;
200 bst[i].cap = (bst[i].cap * bix->dvol) / 1000;
217 if (bst[i].cap > bix->lfcap)
218 bst[i].cap = bix->lfcap;
221 bi[i].cap = (100 * bst[i].cap) / bix->lfcap;
225 total_cap += bst[i].cap;
231 * sequentially, thus bst.rate may only signify the one currently
232 * in use. For the remaining batteries, bst.rate will be zero,
234 * Therefore, we sum the bst.rate for batteries in the discharging
237 if (bst[i].rate != ACPI_BATT_UNKNOWN &&
238 (bst[i].state & ACPI_BATT_STAT_DISCHARG) != 0)
239 valid_rate += bst[i].rate;
252 * If any batteries are discharging, use the sum of the bst.rate
257 bi[i].min = (60 * bst[i].cap) / valid_rate;
284 battinfo->rate = bst[dev_idx].rate;
301 free(bst, M_TEMP);
412 bzero(&ioctl_arg->bst, sizeof(ioctl_arg->bst));
413 error = ACPI_BATT_GET_STATUS(dev, &ioctl_arg->bst);