Lines Matching refs:bst
103 acpi_battery_bst_valid(struct acpi_bst *bst)
106 return (bst->state != ACPI_BATT_STAT_NOT_PRESENT &&
107 bst->cap != ACPI_BATT_UNKNOWN && bst->volt != ACPI_BATT_UNKNOWN);
125 struct acpi_bst *bst;
144 bst = malloc(devcount * sizeof(*bst), M_TEMP, M_WAITOK | M_ZERO);
177 ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 ||
182 if (!acpi_battery_bst_valid(&bst[i]) ||
191 if ((bst[i].state & ACPI_BATT_STAT_DISCHARG) != 0)
192 bst[i].state &= ~ACPI_BATT_STAT_CHARGING;
193 batt_stat |= bst[i].state;
194 bi[i].state = bst[i].state;
203 bst[i].rate = (bst[i].rate * bif->dvol) / 1000;
204 bst[i].cap = (bst[i].cap * bif->dvol) / 1000;
217 bi[i].cap = (100 * bst[i].cap) / bif->lfcap;
229 * sequentially, thus bst.rate may only signify the one currently
230 * in use. For the remaining batteries, bst.rate will be zero,
232 * Therefore, we sum the bst.rate for batteries in the discharging
235 if (bst[i].rate != ACPI_BATT_UNKNOWN &&
236 (bst[i].state & ACPI_BATT_STAT_DISCHARG) != 0)
237 valid_rate += bst[i].rate;
250 * If any batteries are discharging, use the sum of the bst.rate
255 bi[i].min = (60 * bst[i].cap) / valid_rate;
279 battinfo->rate = bst[dev_idx].rate;
298 if (bst)
299 free(bst, M_TEMP);
412 bzero(&ioctl_arg->bst, sizeof(ioctl_arg->bst));
413 error = ACPI_BATT_GET_STATUS(dev, &ioctl_arg->bst);