static int init_hue = 128;
static int hue_correction = 128;
-MODULE_PARM(debug, "i");
+module_param(debug, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug level: 0-9 (default=0)");
-MODULE_PARM(flags, "i");
+module_param(flags, int, 0);
MODULE_PARM_DESC(flags,
"Bitfield: 0=VIDIOCSYNC, "
"1=B/W, "
"4=test pattern, "
"5=separate frames, "
"6=clean frames");
-MODULE_PARM(framerate, "i");
+module_param(framerate, int, 0);
MODULE_PARM_DESC(framerate, "Framerate setting: 0=slowest, 6=fastest (default=2)");
-MODULE_PARM(init_brightness, "i");
+module_param(init_brightness, int, 0);
MODULE_PARM_DESC(init_brightness, "Brightness preconfiguration: 0-255 (default=128)");
-MODULE_PARM(init_contrast, "i");
+module_param(init_contrast, int, 0);
MODULE_PARM_DESC(init_contrast, "Contrast preconfiguration: 0-255 (default=192)");
-MODULE_PARM(init_color, "i");
+module_param(init_color, int, 0);
MODULE_PARM_DESC(init_color, "Color preconfiguration: 0-255 (default=128)");
-MODULE_PARM(init_hue, "i");
+module_param(init_hue, int, 0);
MODULE_PARM_DESC(init_hue, "Hue preconfiguration: 0-255 (default=128)");
-MODULE_PARM(hue_correction, "i");
+module_param(hue_correction, int, 0);
MODULE_PARM_DESC(hue_correction, "YUV colorspace regulation: 0-255 (default=128)");
/*
* 02-Nov-2000 First (mostly dummy) version.
* 06-Nov-2000 Rewrote to dump all data into frame.
*/
-void ultracam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame)
+static void ultracam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame)
{
int n;
{
struct usb_device *dev = interface_to_usbdev(intf);
struct uvd *uvd = NULL;
- int i, nas;
+ int ix, i, nas;
int actInterface=-1, inactInterface=-1, maxPS=0;
unsigned char video_ep = 0;
if (dev->descriptor.bNumConfigurations != 1)
return -ENODEV;
- /* Is it an IBM camera? */
- if ((dev->descriptor.idVendor != ULTRACAM_VENDOR_ID) ||
- (dev->descriptor.idProduct != ULTRACAM_PRODUCT_ID))
- return -ENODEV;
-
- info("IBM Ultra camera found (rev. 0x%04x)", dev->descriptor.bcdDevice);
+ info("IBM Ultra camera found (rev. 0x%04x)",
+ le16_to_cpu(dev->descriptor.bcdDevice));
/* Validate found interface: must have one ISO endpoint */
nas = intf->num_altsetting;
return -ENODEV;
}
/* Validate all alternate settings */
- for (i=0; i < nas; i++) {
+ for (ix=0; ix < nas; ix++) {
const struct usb_host_interface *interface;
const struct usb_endpoint_descriptor *endpoint;
- interface = &intf->altsetting[i];
+ interface = &intf->altsetting[ix];
+ i = interface->desc.bAlternateSetting;
if (interface->desc.bNumEndpoints != 1) {
err("Interface %d. has %u. endpoints!",
interface->desc.bInterfaceNumber,
interface->desc.bInterfaceNumber);
return -ENODEV;
}
- if (endpoint->wMaxPacketSize == 0) {
+ if (le16_to_cpu(endpoint->wMaxPacketSize) == 0) {
if (inactInterface < 0)
inactInterface = i;
else {
} else {
if (actInterface < 0) {
actInterface = i;
- maxPS = endpoint->wMaxPacketSize;
+ maxPS = le16_to_cpu(endpoint->wMaxPacketSize);
if (debug > 0)
info("Active setting=%d. maxPS=%d.", i, maxPS);
} else {
/* Got another active alt. setting */
- if (maxPS < endpoint->wMaxPacketSize) {
+ if (maxPS < le16_to_cpu(endpoint->wMaxPacketSize)) {
/* This one is better! */
actInterface = i;
- maxPS = endpoint->wMaxPacketSize;
+ maxPS = le16_to_cpu(endpoint->wMaxPacketSize);
if (debug > 0) {
info("Even better ctive setting=%d. maxPS=%d.",
i, maxPS);