@@ -507,7 +507,7 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
if (((index & 0xFF) == 0x01) && (((value & 0xFF00) == 0x0100) ||
((value & 0xFF00) == 0x0200))) {
DPRINTF("USB Request: Get video control minimum setting "
- "attribute for interface %d\n", index&0xFF);
+ "attribute for interface %d\n", index & 0xFF);
if (length != 26) {
DPRINTF("USB Request: Requested %d bytes, expected 26 "
@@ -542,7 +542,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
data[24] = 0x00;
data[25] = 0x00;
ret = 26;
- } else if ((index&0xFF00) == 0x0400 && (value&0xFF00) == 0x0100) {
+ } else if (((index & 0xFF00) == 0x0400) &&
+ ((value & 0xFF00) == 0x0100)) {
/* Setting input */
DPRINTF("USB Request: Asking for minimum input\n");
if (length != 1) {
@@ -553,7 +554,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
data[0] = 0;
ret = 1;
- } else if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) {
+ } else if (((index & 0xFF00) == 0x0500) &&
+ ((value & 0xFF00) == 0x0200)) {
/* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */
DPRINTF("USB Request: Asking for minimum brightness\n");
if (length != 2) {
@@ -571,7 +573,7 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
break;
case UVCGetVideoControl | USB_UVC_GET_MAX:
if (((index & 0xFF) == 0x01) && (((value & 0xFF00) == 0x0100) ||
- ((value & 0xFF00) == 0x0200))) {
+ ((value & 0xFF00) == 0x0200))) {
DPRINTF("USB Request: Get video control maximum setting "
"attribute for interface %d\n", index & 0xFF);
@@ -620,7 +622,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
data[0] = 1;
ret = 1;
- } else if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) {
+ } else if (((index & 0xFF00) == 0x0500) &&
+ ((value & 0xFF00) == 0x0200)) {
/* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */
DPRINTF("USB Request: Asking for maximum brightness\n");
if (length != 2) {
@@ -640,7 +643,7 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
if (((index & 0xFF) == 0x01) &&
((value & 0xFF00) == 0x0100 || (value & 0xFF00) == 0x0200)) {
DPRINTF("USB Request: Get video control default setting "
- "attribute for interface %d\n", index&0xFF);
+ "attribute for interface %d\n", index & 0xFF);
if (length != 26) {
DPRINTF("USB Request: Requested %d bytes, expected 26 "
@@ -675,7 +678,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
data[24] = 0x00;
data[25] = 0x00;
ret = 26;
- } else if ((index&0xFF00) == 0x0400 && (value&0xFF00) == 0x0100) {
+ } else if (((index & 0xFF00) == 0x0400) &&
+ ((value & 0xFF00) == 0x0100)) {
/* Setting input */
DPRINTF("USB Request: Asking for default input\n");
if (length != 1) {
@@ -686,7 +690,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
data[0] = 0;
ret = 1;
- } else if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) {
+ } else if (((index & 0xFF00) == 0x0500) &&
+ ((value & 0xFF00) == 0x0200)) {
/* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */
DPRINTF("USB Request: Asking for default brightness\n");
if (length != 2) {
@@ -741,7 +746,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
first_bulk_packet = 1;
ret = 26;
- } else if ((index&0xFF00) == 0x0400 && (value&0xFF00) == 0x0100) {
+ } else if (((index & 0xFF00) == 0x0400) &&
+ ((value & 0xFF00) == 0x0100)) {
/* Setting input */
DPRINTF("Setting input to %d\n", data[0]);
if (length != 1) {
@@ -752,7 +758,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
s->current_input = data[0];
ret = 1;
- } else if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) {
+ } else if (((index & 0xFF00) == 0x0500) &&
+ ((value & 0xFF00) == 0x0200)) {
/* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */
DPRINTF("USB Request: Setting brightness, "
"value stays the same\n");
@@ -768,7 +775,8 @@ static int usb_uvc_handle_control(USBDevice *dev, USBPacket *p, int request,
}
break;
case UVCGetVideoControl | USB_UVC_GET_RES:
- if ((index&0xFF00) == 0x0500 && (value&0xFF00) == 0x0200) {
+ if (((index & 0xFF00) == 0x0500) &&
+ ((value & 0xFF00) == 0x0200)) {
/* PU_BRIGHTNESS_CONTROL of PROCESSING_UNIT */
DPRINTF("USB Request: Asking for brightness resolution\n");
if (length != 2) {
As requested by Blue Swirl (2010-06-10 17:46:16) Signed-off-by: Brad Hards <bradh@frogmouth.net> --- hw/usb-uvc.c | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 deletions(-)