/* * Descriptor buffer is 128 byte long and contains: * * Name Offset Length Value * Vendor Signature 0 4 "DELL" * Object Signature 4 4 " WMI" * WMI Interface Version 8 4 <version> * WMI buffer length 12 4 <length> * WMI hotfix number 16 4 <hotfix>
*/ staticint dell_wmi_descriptor_probe(struct wmi_device *wdev, constvoid *context)
{ union acpi_object *obj = NULL; struct descriptor_priv *priv;
u32 *buffer; int ret;
obj = wmidev_block_query(wdev, 0); if (!obj) {
dev_err(&wdev->dev, "failed to read Dell WMI descriptor\n");
ret = -EIO; goto out;
}
if (obj->type != ACPI_TYPE_BUFFER) {
dev_err(&wdev->dev, "Dell descriptor has wrong type\n");
ret = -EINVAL;
descriptor_valid = ret; goto out;
}
/* Although it's not technically a failure, this would lead to * unexpected behavior
*/ if (obj->buffer.length != 128) {
dev_err(&wdev->dev, "Dell descriptor buffer has unexpected length (%d)\n",
obj->buffer.length);
ret = -EINVAL;
descriptor_valid = ret; goto out;
}
buffer = (u32 *)obj->buffer.pointer;
if (strncmp(obj->string.pointer, "DELL WMI", 8) != 0) {
dev_err(&wdev->dev, "Dell descriptor buffer has invalid signature (%8ph)\n",
buffer);
ret = -EINVAL;
descriptor_valid = ret; goto out;
}
descriptor_valid = 0;
if (buffer[2] != 0 && buffer[2] != 1)
dev_warn(&wdev->dev, "Dell descriptor buffer has unknown version (%lu)\n",
(unsignedlong) buffer[2]);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.