/* Big device node whoopla. Basicly, it allows you to assign a 
/* Big device node whoopla. Basically, it allows you to assign a 
static int __init usb_pwc_init(void){	int i, sz;	char *sizenames[PSZ_MAX] = { "sqcif", "qsif", "qcif", "sif", "cif", "vga" };	Info("Philips webcam module version " PWC_VERSION " loaded.\n");	Info("Supports Philips PCA645/646, PCVC675/680/690, PCVC720[40]/730/740/750 & PCVC830/840.\n");	Info("Also supports the Askey VC010, various Logitech Quickcams, Samsung MPC-C10 and MPC-C30,\n");	Info("the Creative WebCam 5 & Pro Ex, SOTEC Afina Eye and Visionite VCS-UC300 and VCS-UM100.\n");	if (fps) {		if (fps < 4 || fps > 30) {			Err("Framerate out of bounds (4-30).\n");			return -EINVAL;		}		default_fps = fps;		Info("Default framerate set to %d.\n", default_fps);	}	if (size[0]) {		/* string; try matching with array */		for (sz = 0; sz < PSZ_MAX; sz++) {			if (!strcmp(sizenames[sz], size)) { /* Found! */				default_size = sz;				break;			}		}		if (sz == PSZ_MAX) {			Err("Size not recognized; try size=[sqcif | qsif | qcif | sif | cif | vga].\n");			return -EINVAL;		}		Info("Default image size set to %s [%dx%d].\n", sizenames[default_size], pwc_image_sizes[default_size].x, pwc_image_sizes[default_size].y);	}	if (mbufs) {		if (mbufs < 1 || mbufs > MAX_IMAGES) {			Err("Illegal number of mmap() buffers; use a number between 1 and %d.\n", MAX_IMAGES);			return -EINVAL;		}		default_mbufs = mbufs;		Info("Number of image buffers set to %d.\n", default_mbufs);	}	if (fbufs) {		if (fbufs < 2 || fbufs > MAX_FRAMES) {			Err("Illegal number of frame buffers; use a number between 2 and %d.\n", MAX_FRAMES);			return -EINVAL;		}		default_fbufs = fbufs;		Info("Number of frame buffers set to %d.\n", default_fbufs);	}	if (trace >= 0) {		Info("Trace options: 0x%04x\n", trace);		pwc_trace = trace;	}	if (compression >= 0) {		if (compression > 3) {			Err("Invalid compression setting; use a number between 0 (uncompressed) and 3 (high).\n");			return -EINVAL;		}		pwc_preferred_compression = compression;		Info("Preferred compression set to %d.\n", pwc_preferred_compression);	}	if (power_save)		Info("Enabling power save on open/close.\n");	if (leds[0] >= 0)		led_on = leds[0];	if (leds[1] >= 0)		led_off = leds[1];	/* Big device node whoopla. Basicly, it allows you to assign a	   device node (/dev/videoX) to a camera, based on its type	   & serial number. The format is [type[.serialnumber]:]node.	   Any camera that isn't matched by these rules gets the next	   available free device node.	 */	for (i = 0; i < MAX_DEV_HINTS; i++) {		char *s, *colon, *dot;		/* This loop also initializes the array */		device_hint[i].pdev = NULL;		s = dev_hint[i];		if (s != NULL && *s != '\0') {			device_hint[i].type = -1; /* wildcard */			strcpy(device_hint[i].serial_number, "*");			/* parse string: chop at ':' & '/' */			colon = dot = s;			while (*colon != '\0' && *colon != ':')				colon++;			while (*dot != '\0' && *dot != '.')				dot++;			/* Few sanity checks */			if (*dot != '\0' && dot > colon) {				Err("Malformed camera hint: the colon must be after the dot.\n");				return -EINVAL;			}			if (*colon == '\0') {				/* No colon */				if (*dot != '\0') {					Err("Malformed camera hint: no colon + device node given.\n");					return -EINVAL;				}				else {					/* No type or serial number specified, just a number. */					device_hint[i].device_node = pwc_atoi(s);				}			}			else {				/* There's a colon, so we have at least a type and a device node */				device_hint[i].type = pwc_atoi(s);				device_hint[i].device_node = pwc_atoi(colon + 1);				if (*dot != '\0') {					/* There's a serial number as well */					int k;										dot++;					k = 0;					while (*dot != ':' && k < 29) {						device_hint[i].serial_number[k++] = *dot;						dot++;					}					device_hint[i].serial_number[k] = '\0';				}			}#if PWC_DEBUG					Debug("device_hint[%d]:\n", i);			Debug("  type    : %d\n", device_hint[i].type);			Debug("  serial# : %s\n", device_hint[i].serial_number);			Debug("  node    : %d\n", device_hint[i].device_node);#endif					}		else			device_hint[i].type = 0; /* not filled */	} /* ..for MAX_DEV_HINTS */ 	Trace(TRACE_PROBE, "Registering driver at address 0x%p.\n", &pwc_driver);	return usb_register(&pwc_driver);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/093cf723b2b06d774929ea07982f6a466ff22314/pwc-if.c/clean/drivers/usb/media/pwc/pwc-if.c