Lines Matching refs:bst
102 acpi_battery_bst_valid(struct acpi_bst *bst)
105 return (bst->state != ACPI_BATT_STAT_NOT_PRESENT &&
106 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);
178 ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 ||
183 if (!acpi_battery_bst_valid(&bst[i]) ||
192 if ((bst[i].state & ACPI_BATT_STAT_DISCHARG) != 0)
193 bst[i].state &= ~ACPI_BATT_STAT_CHARGING;
194 batt_stat |= bst[i].state;
195 bi[i].state = bst[i].state;
204 bst[i].rate = (bst[i].rate * bix->dvol) / 1000;
205 bst[i].cap = (bst[i].cap * bix->dvol) / 1000;
222 if (bst[i].cap > bix->lfcap)
223 bst[i].cap = bix->lfcap;
226 bi[i].cap = (100 * bst[i].cap) / bix->lfcap;
230 total_cap += bst[i].cap;
236 * sequentially, thus bst.rate may only signify the one currently
237 * in use. For the remaining batteries, bst.rate will be zero,
239 * Therefore, we sum the bst.rate for batteries in the discharging
242 if (bst[i].rate != ACPI_BATT_UNKNOWN &&
243 (bst[i].state & ACPI_BATT_STAT_DISCHARG) != 0)
244 valid_rate += bst[i].rate;
257 * If any batteries are discharging, use the sum of the bst.rate
262 bi[i].min = (60 * bst[i].cap) / valid_rate;
282 battinfo->rate = bst[dev_idx].rate;
299 free(bst, M_TEMP);
410 bzero(&ioctl_arg->bst, sizeof(ioctl_arg->bst));
411 error = ACPI_BATT_GET_STATUS(dev, &ioctl_arg->bst);