staticint roccat_common2_receive_control_status(struct usb_device *usb_dev)
{ int retval; struct roccat_common2_control control;
do {
msleep(50);
retval = roccat_common2_receive(usb_dev,
ROCCAT_COMMON_COMMAND_CONTROL,
&control, sizeof(struct roccat_common2_control));
if (retval) return retval;
switch (control.value) { case ROCCAT_COMMON_CONTROL_STATUS_OK: return0; case ROCCAT_COMMON_CONTROL_STATUS_BUSY:
msleep(500); continue; case ROCCAT_COMMON_CONTROL_STATUS_INVALID: case ROCCAT_COMMON_CONTROL_STATUS_CRITICAL: case ROCCAT_COMMON_CONTROL_STATUS_CRITICAL_NEW: return -EINVAL; default:
dev_err(&usb_dev->dev, "roccat_common2_receive_control_status: " "unknown response value 0x%x\n",
control.value); return -EINVAL;
}
} while (1);
}
int roccat_common2_send_with_status(struct usb_device *usb_dev,
uint command, voidconst *buf, uint size)
{ int retval;
retval = roccat_common2_send(usb_dev, command, buf, size); if (retval) return retval;
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.