ChangeSet 1.893.2.13, 2002/12/24 11:55:52-08:00, spse@secret.org.uk [PATCH] 2.4.20 usbvideo cleanups 2/4 This is a backport of some usbvideo cleanups from 2.5: typedef struct { } uvd_t -> struct uvd diff -Nru a/drivers/usb/ibmcam.c b/drivers/usb/ibmcam.c --- a/drivers/usb/ibmcam.c Mon Jan 6 11:31:00 2003 +++ b/drivers/usb/ibmcam.c Mon Jan 6 11:31:00 2003 @@ -78,7 +78,7 @@ }; /* - * This structure lives in uvd_t->user field. + * This structure lives in uvd->user field. */ typedef struct { int initialized; /* Had we already sent init sequence? */ @@ -249,7 +249,7 @@ * History: * 1/21/00 Created. */ -static ParseState_t ibmcam_find_header(uvd_t *uvd) /* FIXME: Add frame here */ +static ParseState_t ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame here */ { usbvideo_frame_t *frame; ibmcam_t *icam; @@ -398,7 +398,7 @@ * 12-Oct-2000 Reworked to reflect interlaced nature of the data. */ static ParseState_t ibmcam_parse_lines( - uvd_t *uvd, + struct uvd *uvd, usbvideo_frame_t *frame, long *pcopylen) { @@ -663,7 +663,7 @@ * lost resolution. */ static ParseState_t ibmcam_model2_320x240_parse_lines( - uvd_t *uvd, + struct uvd *uvd, usbvideo_frame_t *frame, long *pcopylen) { @@ -817,7 +817,7 @@ } static ParseState_t ibmcam_model3_parse_lines( - uvd_t *uvd, + struct uvd *uvd, usbvideo_frame_t *frame, long *pcopylen) { @@ -962,7 +962,7 @@ * 10-Feb-2001 Created. */ static ParseState_t ibmcam_model4_128x96_parse_lines( - uvd_t *uvd, + struct uvd *uvd, usbvideo_frame_t *frame, long *pcopylen) { @@ -1049,7 +1049,7 @@ * History: * 1/21/00 Created. */ -void ibmcam_ProcessIsocData(uvd_t *uvd, usbvideo_frame_t *frame) +void ibmcam_ProcessIsocData(struct uvd *uvd, usbvideo_frame_t *frame) { ParseState_t newstate; long copylen = 0; @@ -1128,7 +1128,7 @@ * 1/27/00 Added check for dev == NULL; this happens if camera is unplugged. */ static int ibmcam_veio( - uvd_t *uvd, + struct uvd *uvd, unsigned char req, unsigned short value, unsigned short index) @@ -1195,7 +1195,7 @@ * History: * 1/18/00 Created. */ -static int ibmcam_calculate_fps(uvd_t *uvd) +static int ibmcam_calculate_fps(struct uvd *uvd) { return 3 + framerate*4 + framerate/2; } @@ -1209,33 +1209,33 @@ * History: * 1/2/00 Created. */ -static void ibmcam_send_FF_04_02(uvd_t *uvd) +static void ibmcam_send_FF_04_02(struct uvd *uvd) { ibmcam_veio(uvd, 0, 0x00FF, 0x0127); ibmcam_veio(uvd, 0, 0x0004, 0x0124); ibmcam_veio(uvd, 0, 0x0002, 0x0124); } -static void ibmcam_send_00_04_06(uvd_t *uvd) +static void ibmcam_send_00_04_06(struct uvd *uvd) { ibmcam_veio(uvd, 0, 0x0000, 0x0127); ibmcam_veio(uvd, 0, 0x0004, 0x0124); ibmcam_veio(uvd, 0, 0x0006, 0x0124); } -static void ibmcam_send_x_00(uvd_t *uvd, unsigned short x) +static void ibmcam_send_x_00(struct uvd *uvd, unsigned short x) { ibmcam_veio(uvd, 0, x, 0x0127); ibmcam_veio(uvd, 0, 0x0000, 0x0124); } -static void ibmcam_send_x_00_05(uvd_t *uvd, unsigned short x) +static void ibmcam_send_x_00_05(struct uvd *uvd, unsigned short x) { ibmcam_send_x_00(uvd, x); ibmcam_veio(uvd, 0, 0x0005, 0x0124); } -static void ibmcam_send_x_00_05_02(uvd_t *uvd, unsigned short x) +static void ibmcam_send_x_00_05_02(struct uvd *uvd, unsigned short x) { ibmcam_veio(uvd, 0, x, 0x0127); ibmcam_veio(uvd, 0, 0x0000, 0x0124); @@ -1243,7 +1243,7 @@ ibmcam_veio(uvd, 0, 0x0002, 0x0124); } -static void ibmcam_send_x_01_00_05(uvd_t *uvd, unsigned short x) +static void ibmcam_send_x_01_00_05(struct uvd *uvd, unsigned short x) { ibmcam_veio(uvd, 0, x, 0x0127); ibmcam_veio(uvd, 0, 0x0001, 0x0124); @@ -1251,7 +1251,7 @@ ibmcam_veio(uvd, 0, 0x0005, 0x0124); } -static void ibmcam_send_x_00_05_02_01(uvd_t *uvd, unsigned short x) +static void ibmcam_send_x_00_05_02_01(struct uvd *uvd, unsigned short x) { ibmcam_veio(uvd, 0, x, 0x0127); ibmcam_veio(uvd, 0, 0x0000, 0x0124); @@ -1260,7 +1260,7 @@ ibmcam_veio(uvd, 0, 0x0001, 0x0124); } -static void ibmcam_send_x_00_05_02_08_01(uvd_t *uvd, unsigned short x) +static void ibmcam_send_x_00_05_02_08_01(struct uvd *uvd, unsigned short x) { ibmcam_veio(uvd, 0, x, 0x0127); ibmcam_veio(uvd, 0, 0x0000, 0x0124); @@ -1270,7 +1270,7 @@ ibmcam_veio(uvd, 0, 0x0001, 0x0124); } -static void ibmcam_Packet_Format1(uvd_t *uvd, unsigned char fkey, unsigned char val) +static void ibmcam_Packet_Format1(struct uvd *uvd, unsigned char fkey, unsigned char val) { ibmcam_send_x_01_00_05(uvd, unknown_88); ibmcam_send_x_00_05(uvd, fkey); @@ -1284,20 +1284,20 @@ ibmcam_send_FF_04_02(uvd); } -static void ibmcam_PacketFormat2(uvd_t *uvd, unsigned char fkey, unsigned char val) +static void ibmcam_PacketFormat2(struct uvd *uvd, unsigned char fkey, unsigned char val) { ibmcam_send_x_01_00_05 (uvd, unknown_88); ibmcam_send_x_00_05 (uvd, fkey); ibmcam_send_x_00_05_02 (uvd, val); } -static void ibmcam_model2_Packet2(uvd_t *uvd) +static void ibmcam_model2_Packet2(struct uvd *uvd) { ibmcam_veio(uvd, 0, 0x00ff, 0x012d); ibmcam_veio(uvd, 0, 0xfea3, 0x0124); } -static void ibmcam_model2_Packet1(uvd_t *uvd, unsigned short v1, unsigned short v2) +static void ibmcam_model2_Packet1(struct uvd *uvd, unsigned short v1, unsigned short v2) { ibmcam_veio(uvd, 0, 0x00aa, 0x012d); ibmcam_veio(uvd, 0, 0x00ff, 0x012e); @@ -1318,7 +1318,7 @@ * 00_0096_0127 * 00_fea8_0124 */ -static void ibmcam_model3_Packet1(uvd_t *uvd, unsigned short v1, unsigned short v2) +static void ibmcam_model3_Packet1(struct uvd *uvd, unsigned short v1, unsigned short v2) { ibmcam_veio(uvd, 0, 0x0078, 0x012d); ibmcam_veio(uvd, 0, v1, 0x012f); @@ -1327,7 +1327,7 @@ ibmcam_veio(uvd, 0, 0xfea8, 0x0124); } -static void ibmcam_model4_BrightnessPacket(uvd_t *uvd, int i) +static void ibmcam_model4_BrightnessPacket(struct uvd *uvd, int i) { ibmcam_veio(uvd, 0, 0x00aa, 0x012d); ibmcam_veio(uvd, 0, 0x0026, 0x012f); @@ -1353,7 +1353,7 @@ * History: * 1/2/00 Created. */ -static void ibmcam_adjust_contrast(uvd_t *uvd) +static void ibmcam_adjust_contrast(struct uvd *uvd) { unsigned char a_contrast = uvd->vpic.contrast >> 12; unsigned char new_contrast; @@ -1428,7 +1428,7 @@ * 1/5/00 Created. * 2/20/00 Added support for Model 2 cameras. */ -static void ibmcam_change_lighting_conditions(uvd_t *uvd) +static void ibmcam_change_lighting_conditions(struct uvd *uvd) { static const char proc[] = "ibmcam_change_lighting_conditions"; @@ -1474,7 +1474,7 @@ * range [0..6], where 0 is most smooth and 6 is most sharp (raw image, I guess). * Recommended value is 4. Cameras model 2 do not have this feature at all. */ -static void ibmcam_set_sharpness(uvd_t *uvd) +static void ibmcam_set_sharpness(struct uvd *uvd) { static const char proc[] = "ibmcam_set_sharpness"; @@ -1543,7 +1543,7 @@ * * This procedure changes brightness of the picture. */ -static void ibmcam_set_brightness(uvd_t *uvd) +static void ibmcam_set_brightness(struct uvd *uvd) { static const char proc[] = "ibmcam_set_brightness"; static const unsigned short n = 1; @@ -1608,7 +1608,7 @@ } } -static void ibmcam_set_hue(uvd_t *uvd) +static void ibmcam_set_hue(struct uvd *uvd) { switch (IBMCAM_T(uvd)->camera_model) { case IBMCAM_MODEL_2: @@ -1704,14 +1704,14 @@ * This procedure gets called from V4L interface to update picture settings. * Here we change brightness and contrast. */ -static void ibmcam_adjust_picture(uvd_t *uvd) +static void ibmcam_adjust_picture(struct uvd *uvd) { ibmcam_adjust_contrast(uvd); ibmcam_set_brightness(uvd); ibmcam_set_hue(uvd); } -static int ibmcam_model1_setup(uvd_t *uvd) +static int ibmcam_model1_setup(struct uvd *uvd) { const int ntries = 5; int i; @@ -1908,7 +1908,7 @@ return (CAMERA_IS_OPERATIONAL(uvd) ? 0 : -EFAULT); } -static int ibmcam_model2_setup(uvd_t *uvd) +static int ibmcam_model2_setup(struct uvd *uvd) { ibmcam_veio(uvd, 0, 0x0000, 0x0100); /* LED on */ ibmcam_veio(uvd, 1, 0x0000, 0x0116); @@ -1966,7 +1966,7 @@ * This code adds finishing touches to the video data interface. * Here we configure the frame rate and turn on the LED. */ -static void ibmcam_model1_setup_after_video_if(uvd_t *uvd) +static void ibmcam_model1_setup_after_video_if(struct uvd *uvd) { unsigned short internal_frame_rate; @@ -1978,7 +1978,7 @@ ibmcam_veio(uvd, 0, 0xc0, 0x010c); } -static void ibmcam_model2_setup_after_video_if(uvd_t *uvd) +static void ibmcam_model2_setup_after_video_if(struct uvd *uvd) { unsigned short setup_model2_rg2, setup_model2_sat, setup_model2_yb; @@ -2154,7 +2154,7 @@ usb_clear_halt(uvd->dev, usb_rcvisocpipe(uvd->dev, uvd->video_endp)); } -static void ibmcam_model4_setup_after_video_if(uvd_t *uvd) +static void ibmcam_model4_setup_after_video_if(struct uvd *uvd) { switch (uvd->videosize) { case VIDEOSIZE_128x96: @@ -2704,7 +2704,7 @@ usb_clear_halt(uvd->dev, usb_rcvisocpipe(uvd->dev, uvd->video_endp)); } -static void ibmcam_model3_setup_after_video_if(uvd_t *uvd) +static void ibmcam_model3_setup_after_video_if(struct uvd *uvd) { int i; /* @@ -3485,7 +3485,7 @@ * This code tells camera to stop streaming. The interface remains * configured and bandwidth - claimed. */ -static void ibmcam_video_stop(uvd_t *uvd) +static void ibmcam_video_stop(struct uvd *uvd) { switch (IBMCAM_T(uvd)->camera_model) { case IBMCAM_MODEL_1: @@ -3546,7 +3546,7 @@ * History: * 1/2/00 Created. */ -static void ibmcam_reinit_iso(uvd_t *uvd, int do_stop) +static void ibmcam_reinit_iso(struct uvd *uvd, int do_stop) { switch (IBMCAM_T(uvd)->camera_model) { case IBMCAM_MODEL_1: @@ -3570,7 +3570,7 @@ } } -static void ibmcam_video_start(uvd_t *uvd) +static void ibmcam_video_start(struct uvd *uvd) { ibmcam_change_lighting_conditions(uvd); ibmcam_set_sharpness(uvd); @@ -3580,7 +3580,7 @@ /* * Return negative code on failure, 0 on success. */ -static int ibmcam_setup_on_open(uvd_t *uvd) +static int ibmcam_setup_on_open(struct uvd *uvd) { int setup_ok = 0; /* Success by default */ /* Send init sequence only once, it's large! */ @@ -3602,7 +3602,7 @@ return setup_ok; } -static void ibmcam_configure_video(uvd_t *uvd) +static void ibmcam_configure_video(struct uvd *uvd) { if (uvd == NULL) return; @@ -3658,7 +3658,7 @@ */ static void *ibmcam_probe(struct usb_device *dev, unsigned int ifnum, const struct usb_device_id *devid) { - uvd_t *uvd = NULL; + struct uvd *uvd = NULL; int i, nas, model=0, canvasX=0, canvasY=0; int actInterface=-1, inactInterface=-1, maxPS=0; unsigned char video_ep = 0; @@ -3868,7 +3868,7 @@ MOD_INC_USE_COUNT; uvd = usbvideo_AllocateDevice(cams); if (uvd != NULL) { - /* Here uvd is a fully allocated uvd_t object */ + /* Here uvd is a fully allocated uvd object */ uvd->flags = flags; uvd->debug = debug; uvd->dev = dev; diff -Nru a/drivers/usb/ultracam.c b/drivers/usb/ultracam.c --- a/drivers/usb/ultracam.c Mon Jan 6 11:31:00 2003 +++ b/drivers/usb/ultracam.c Mon Jan 6 11:31:00 2003 @@ -16,7 +16,7 @@ #define MAX_CAMERAS 4 /* How many devices we allow to connect */ /* - * This structure lives in uvd_t->user field. + * This structure lives in uvd->user field. */ typedef struct { int initialized; /* Had we already sent init sequence? */ @@ -103,7 +103,7 @@ * 02-Nov-2000 First (mostly dummy) version. * 06-Nov-2000 Rewrote to dump all data into frame. */ -void ultracam_ProcessIsocData(uvd_t *uvd, usbvideo_frame_t *frame) +void ultracam_ProcessIsocData(struct uvd *uvd, usbvideo_frame_t *frame) { int n; @@ -140,7 +140,7 @@ * 1/27/00 Added check for dev == NULL; this happens if camera is unplugged. */ static int ultracam_veio( - uvd_t *uvd, + struct uvd *uvd, unsigned char req, unsigned short value, unsigned short index, @@ -193,7 +193,7 @@ /* * ultracam_calculate_fps() */ -static int ultracam_calculate_fps(uvd_t *uvd) +static int ultracam_calculate_fps(struct uvd *uvd) { return 3 + framerate*4 + framerate/2; } @@ -201,14 +201,14 @@ /* * ultracam_adjust_contrast() */ -static void ultracam_adjust_contrast(uvd_t *uvd) +static void ultracam_adjust_contrast(struct uvd *uvd) { } /* * ultracam_change_lighting_conditions() */ -static void ultracam_change_lighting_conditions(uvd_t *uvd) +static void ultracam_change_lighting_conditions(struct uvd *uvd) { } @@ -219,7 +219,7 @@ * range [0..6], where 0 is most smooth and 6 is most sharp (raw image, I guess). * Recommended value is 4. Cameras model 2 do not have this feature at all. */ -static void ultracam_set_sharpness(uvd_t *uvd) +static void ultracam_set_sharpness(struct uvd *uvd) { } @@ -228,11 +228,11 @@ * * This procedure changes brightness of the picture. */ -static void ultracam_set_brightness(uvd_t *uvd) +static void ultracam_set_brightness(struct uvd *uvd) { } -static void ultracam_set_hue(uvd_t *uvd) +static void ultracam_set_hue(struct uvd *uvd) { } @@ -242,7 +242,7 @@ * This procedure gets called from V4L interface to update picture settings. * Here we change brightness and contrast. */ -static void ultracam_adjust_picture(uvd_t *uvd) +static void ultracam_adjust_picture(struct uvd *uvd) { ultracam_adjust_contrast(uvd); ultracam_set_brightness(uvd); @@ -255,7 +255,7 @@ * This code tells camera to stop streaming. The interface remains * configured and bandwidth - claimed. */ -static void ultracam_video_stop(uvd_t *uvd) +static void ultracam_video_stop(struct uvd *uvd) { } @@ -266,24 +266,24 @@ * resets the video pipe. This sequence was observed to reinit the * camera or, at least, to initiate ISO data stream. */ -static void ultracam_reinit_iso(uvd_t *uvd, int do_stop) +static void ultracam_reinit_iso(struct uvd *uvd, int do_stop) { } -static void ultracam_video_start(uvd_t *uvd) +static void ultracam_video_start(struct uvd *uvd) { ultracam_change_lighting_conditions(uvd); ultracam_set_sharpness(uvd); ultracam_reinit_iso(uvd, 0); } -static int ultracam_resetPipe(uvd_t *uvd) +static int ultracam_resetPipe(struct uvd *uvd) { usb_clear_halt(uvd->dev, uvd->video_endp); return 0; } -static int ultracam_alternateSetting(uvd_t *uvd, int setting) +static int ultracam_alternateSetting(struct uvd *uvd, int setting) { static const char proc[] = "ultracam_alternateSetting"; int i; @@ -299,7 +299,7 @@ /* * Return negative code on failure, 0 on success. */ -static int ultracam_setup_on_open(uvd_t *uvd) +static int ultracam_setup_on_open(struct uvd *uvd) { int setup_ok = 0; /* Success by default */ /* Send init sequence only once, it's large! */ @@ -487,7 +487,7 @@ return setup_ok; } -static void ultracam_configure_video(uvd_t *uvd) +static void ultracam_configure_video(struct uvd *uvd) { if (uvd == NULL) return; @@ -539,7 +539,7 @@ */ static void *ultracam_probe(struct usb_device *dev, unsigned int ifnum ,const struct usb_device_id *devid) { - uvd_t *uvd = NULL; + struct uvd *uvd = NULL; int i, nas; int actInterface=-1, inactInterface=-1, maxPS=0; unsigned char video_ep = 0; @@ -628,7 +628,7 @@ MOD_INC_USE_COUNT; uvd = usbvideo_AllocateDevice(cams); if (uvd != NULL) { - /* Here uvd is a fully allocated uvd_t object */ + /* Here uvd is a fully allocated uvd object */ uvd->flags = flags; uvd->debug = debug; uvd->dev = dev; diff -Nru a/drivers/usb/usbvideo.c b/drivers/usb/usbvideo.c --- a/drivers/usb/usbvideo.c Mon Jan 6 11:31:00 2003 +++ b/drivers/usb/usbvideo.c Mon Jan 6 11:31:00 2003 @@ -44,8 +44,8 @@ #if USES_PROC_FS static void usbvideo_procfs_level1_create(usbvideo_t *ut); static void usbvideo_procfs_level1_destroy(usbvideo_t *ut); -static void usbvideo_procfs_level2_create(uvd_t *uvd); -static void usbvideo_procfs_level2_destroy(uvd_t *uvd); +static void usbvideo_procfs_level2_create(struct uvd *uvd); +static void usbvideo_procfs_level2_destroy(struct uvd *uvd); static int usbvideo_default_procfs_read_proc( char *page, char **start, off_t off, int count, int *eof, void *data); @@ -240,7 +240,7 @@ * History: * 01-Feb-2000 Created. */ -void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame, +void usbvideo_OverlayChar(struct uvd *uvd, usbvideo_frame_t *frame, int x, int y, int ch) { static const unsigned short digits[16] = { @@ -295,7 +295,7 @@ * History: * 01-Feb-2000 Created. */ -void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame, +void usbvideo_OverlayString(struct uvd *uvd, usbvideo_frame_t *frame, int x, int y, const char *str) { while (*str) { @@ -313,7 +313,7 @@ * History: * 01-Feb-2000 Created. */ -void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame) +void usbvideo_OverlayStats(struct uvd *uvd, usbvideo_frame_t *frame) { const int y_diff = 8; char tmp[16]; @@ -436,7 +436,7 @@ * History: * 14-Jan-2000 Corrected default multiplier. */ -void usbvideo_ReportStatistics(const uvd_t *uvd) +void usbvideo_ReportStatistics(const struct uvd *uvd) { if ((uvd != NULL) && (uvd->stats.urb_count > 0)) { unsigned long allPackets, badPackets, goodPackets, percent; @@ -562,7 +562,7 @@ * History: * 01-Feb-2000 Created. */ -void usbvideo_TestPattern(uvd_t *uvd, int fullframe, int pmode) +void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode) { usbvideo_frame_t *frame; int num_cell = 0; @@ -672,7 +672,7 @@ /* ******************************************************************** */ -static void usbvideo_ClientIncModCount(uvd_t *uvd) +static void usbvideo_ClientIncModCount(struct uvd *uvd) { if (uvd == NULL) { err("%s: uvd == NULL", __FUNCTION__); @@ -689,7 +689,7 @@ __MOD_INC_USE_COUNT(uvd->handle->md_module); } -static void usbvideo_ClientDecModCount(uvd_t *uvd) +static void usbvideo_ClientDecModCount(struct uvd *uvd) { if (uvd == NULL) { err("%s: uvd == NULL", __FUNCTION__); @@ -729,7 +729,7 @@ return -EINVAL; } - base_size = num_cams * sizeof(uvd_t) + sizeof(usbvideo_t); + base_size = num_cams * sizeof(struct uvd) + sizeof(usbvideo_t); cams = (usbvideo_t *) kmalloc(base_size, GFP_KERNEL); if (cams == NULL) { err("Failed to allocate %d. bytes for usbvideo_t", base_size); @@ -764,14 +764,14 @@ } #endif cams->num_cameras = num_cams; - cams->cam = (uvd_t *) &cams[1]; + cams->cam = (struct uvd *) &cams[1]; cams->md_module = md; if (cams->md_module == NULL) warn("%s: module == NULL!", __FUNCTION__); init_MUTEX(&cams->lock); /* to 1 == available */ for (i = 0; i < num_cams; i++) { - uvd_t *up = &cams->cam[i]; + struct uvd *up = &cams->cam[i]; up->handle = cams; @@ -850,7 +850,7 @@ dbg("%s: Deallocating cams=$%p (%d. cameras)", __FUNCTION__, cams, cams->num_cameras); for (i=0; i < cams->num_cameras; i++) { - uvd_t *up = &cams->cam[i]; + struct uvd *up = &cams->cam[i]; int warning = 0; if (up->user_data != NULL) { @@ -870,7 +870,7 @@ } } /* Whole array was allocated in one chunk */ - dbg("%s: Freed %d uvd_t structures", + dbg("%s: Freed %d uvd structures", __FUNCTION__, cams->num_cameras); kfree(cams); *pCams = NULL; @@ -900,7 +900,7 @@ */ void usbvideo_Disconnect(struct usb_device *dev, void *ptr) { - uvd_t *uvd = (uvd_t *) ptr; + struct uvd *uvd = (struct uvd *) ptr; int i; if ((dev == NULL) || (uvd == NULL)) { @@ -936,14 +936,14 @@ /* * usbvideo_CameraRelease() * - * This code does final release of uvd_t. This happens + * This code does final release of struct uvd. This happens * after the device is disconnected -and- all clients * closed their files. * * History: * 27-Jan-2000 Created. */ -void usbvideo_CameraRelease(uvd_t *uvd) +void usbvideo_CameraRelease(struct uvd *uvd) { if (uvd == NULL) { err("%s: Illegal call", __FUNCTION__); @@ -987,7 +987,7 @@ } down(&cams->lock); for (u = 0; u < cams->num_cameras; u++) { - uvd_t *uvd = &cams->cam[u]; + struct uvd *uvd = &cams->cam[u]; if (!uvd->uvd_used) /* This one is free */ { uvd->uvd_used = 1; /* In use now */ @@ -1001,10 +1001,10 @@ return rv; } -uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams) +struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams) { int i, devnum; - uvd_t *uvd = NULL; + struct uvd *uvd = NULL; if (cams == NULL) { err("No usbvideo_t handle?"); @@ -1062,7 +1062,7 @@ return uvd; } -int usbvideo_RegisterVideoDevice(uvd_t *uvd) +int usbvideo_RegisterVideoDevice(struct uvd *uvd) { char tmp1[20], tmp2[20]; /* Buffers for printing */ @@ -1136,7 +1136,7 @@ int usbvideo_v4l_mmap(struct video_device *dev, const char *adr, unsigned long size) { - uvd_t *uvd = (uvd_t *) dev; + struct uvd *uvd = (struct uvd *) dev; unsigned long start = (unsigned long) adr; unsigned long page, pos; @@ -1179,7 +1179,7 @@ */ int usbvideo_v4l_open(struct video_device *dev, int flags) { - uvd_t *uvd = (uvd_t *) dev; + struct uvd *uvd = (struct uvd *) dev; const int sb_size = FRAMES_PER_DESC * uvd->iso_packet_len; int i, errCode = 0; @@ -1291,7 +1291,7 @@ */ void usbvideo_v4l_close(struct video_device *dev) { - uvd_t *uvd = (uvd_t *)dev; + struct uvd *uvd = (struct uvd *)dev; int i; if (uvd->debug > 1) @@ -1335,7 +1335,7 @@ */ int usbvideo_v4l_ioctl(struct video_device *dev, unsigned int cmd, void *arg) { - uvd_t *uvd = (uvd_t *)dev; + struct uvd *uvd = (struct uvd *)dev; if (!CAMERA_IS_OPERATIONAL(uvd)) return -EFAULT; @@ -1575,7 +1575,7 @@ */ long usbvideo_v4l_read(struct video_device *dev, char *buf, unsigned long count, int noblock) { - uvd_t *uvd = (uvd_t *) dev; + struct uvd *uvd = (struct uvd *) dev; int frmx = -1; usbvideo_frame_t *frame; @@ -1729,7 +1729,7 @@ /* * Make all of the blocks of data contiguous */ -static int usbvideo_CompressIsochronous(uvd_t *uvd, struct urb *urb) +static int usbvideo_CompressIsochronous(struct uvd *uvd, struct urb *urb) { char *cdata; int i, totlen = 0; @@ -1762,7 +1762,7 @@ static void usbvideo_IsocIrq(struct urb *urb) { int i, len; - uvd_t *uvd = urb->context; + struct uvd *uvd = urb->context; /* We don't want to do anything if we are about to be removed! */ if (!CAMERA_IS_OPERATIONAL(uvd)) @@ -1814,7 +1814,7 @@ * of hardcoded values. Simplified by using for loop, * allowed any number of URBs. */ -int usbvideo_StartDataPump(uvd_t *uvd) +int usbvideo_StartDataPump(struct uvd *uvd) { struct usb_device *dev = uvd->dev; int i, errFlag; @@ -1889,7 +1889,7 @@ * 22-Jan-2000 Corrected order of actions to work after surprise removal. * 27-Jan-2000 Used uvd->iface, uvd->ifaceAltInactive instead of hardcoded values. */ -void usbvideo_StopDataPump(uvd_t *uvd) +void usbvideo_StopDataPump(struct uvd *uvd) { int i, j; @@ -1932,7 +1932,7 @@ * 29-Mar-00 Added copying of previous frame into the current one. * 6-Aug-00 Added model 3 video sizes, removed redundant width, height. */ -int usbvideo_NewFrame(uvd_t *uvd, int framenum) +int usbvideo_NewFrame(struct uvd *uvd, int framenum) { usbvideo_frame_t *frame; int n; @@ -2007,7 +2007,7 @@ * FLAGS_NO_DECODING set. Therefore, any regular build of any driver * based on usbvideo can use this feature at any time. */ -void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame) +void usbvideo_CollectRawData(struct uvd *uvd, usbvideo_frame_t *frame) { int n; @@ -2037,7 +2037,7 @@ } } -int usbvideo_GetFrame(uvd_t *uvd, int frameNum) +int usbvideo_GetFrame(struct uvd *uvd, int frameNum) { usbvideo_frame_t *frame = &uvd->frame[frameNum]; @@ -2169,7 +2169,7 @@ * line above then we just copy next line. Similarly, if we need to * create a last line then preceding line is used. */ -void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame) +void usbvideo_DeinterlaceFrame(struct uvd *uvd, usbvideo_frame_t *frame) { if ((uvd == NULL) || (frame == NULL)) return; @@ -2237,7 +2237,7 @@ * History: * 09-Feb-2001 Created. */ -void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd, usbvideo_frame_t *frame) +void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd, usbvideo_frame_t *frame) { int i, j, v4l_linesize; signed long adj; @@ -2325,7 +2325,7 @@ } } -static void usbvideo_procfs_level2_create(uvd_t *uvd) +static void usbvideo_procfs_level2_create(struct uvd *uvd) { if (uvd == NULL) { err("%s: uvd == NULL", __FUNCTION__); @@ -2351,7 +2351,7 @@ } } -static void usbvideo_procfs_level2_destroy(uvd_t *uvd) +static void usbvideo_procfs_level2_destroy(struct uvd *uvd) { if (uvd == NULL) { err("%s: uvd == NULL", __FUNCTION__); diff -Nru a/drivers/usb/usbvideo.h b/drivers/usb/usbvideo.h --- a/drivers/usb/usbvideo.h Mon Jan 6 11:31:00 2003 +++ b/drivers/usb/usbvideo.h Mon Jan 6 11:31:00 2003 @@ -202,7 +202,7 @@ struct s_usbvideo_t; -typedef struct { +struct uvd { struct video_device vdev; /* Must be the first field! */ struct usb_device *dev; struct s_usbvideo_t *handle; /* Points back to the usbvideo_t */ @@ -247,7 +247,7 @@ usbvideo_statistics_t stats; struct proc_dir_entry *procfs_vEntry; /* /proc/video/MYDRIVER/video2 */ char videoName[32]; /* Holds name like "video7" */ -} uvd_t; +}; /* * usbvideo callbacks (virtual methods). They are set when usbvideo @@ -256,17 +256,17 @@ */ typedef struct { void *(*probe)(struct usb_device *, unsigned int,const struct usb_device_id *); - void (*userFree)(uvd_t *); + void (*userFree)(struct uvd *); void (*disconnect)(struct usb_device *, void *); - int (*setupOnOpen)(uvd_t *); - void (*videoStart)(uvd_t *); - void (*videoStop)(uvd_t *); - void (*processData)(uvd_t *, usbvideo_frame_t *); - void (*postProcess)(uvd_t *, usbvideo_frame_t *); - void (*adjustPicture)(uvd_t *); - int (*getFPS)(uvd_t *); - int (*overlayHook)(uvd_t *, usbvideo_frame_t *); - int (*getFrame)(uvd_t *, int); + int (*setupOnOpen)(struct uvd *); + void (*videoStart)(struct uvd *); + void (*videoStop)(struct uvd *); + void (*processData)(struct uvd *, usbvideo_frame_t *); + void (*postProcess)(struct uvd *, usbvideo_frame_t *); + void (*adjustPicture)(struct uvd *); + int (*getFPS)(struct uvd *); + int (*overlayHook)(struct uvd *, usbvideo_frame_t *); + int (*getFrame)(struct uvd *, int); int (*procfs_read)(char *page,char **start,off_t off,int count,int *eof,void *data); int (*procfs_write)(struct file *file,const char *buffer,unsigned long count,void *data); } usbvideo_cb_t; @@ -278,7 +278,7 @@ struct semaphore lock; /* Mutex protecting camera structures */ usbvideo_cb_t cb; /* Table of callbacks (virtual methods) */ struct video_device vdt; /* Video device template */ - uvd_t *cam; /* Array of camera structures */ + struct uvd *cam; /* Array of camera structures */ int uses_procfs; /* Non-zero if we create /proc entries */ struct proc_dir_entry *procfs_dEntry; /* /proc/video/MYDRIVER */ struct module *md_module; /* Minidriver module */ @@ -286,7 +286,7 @@ typedef struct s_usbvideo_t usbvideo_t; /* - * This macro retrieves callback address from the uvd_t object. + * This macro retrieves callback address from the struct uvd object. * No validity checks are done here, so be sure to check the * callback beforehand with VALID_CALLBACK. */ @@ -312,19 +312,19 @@ void RingQueue_InterruptibleSleepOn(RingQueue_t *rq); void RingQueue_WakeUpInterruptible(RingQueue_t *rq); -void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame); +void usbvideo_CollectRawData(struct uvd *uvd, usbvideo_frame_t *frame); void usbvideo_DrawLine( usbvideo_frame_t *frame, int x1, int y1, int x2, int y2, unsigned char cr, unsigned char cg, unsigned char cb); void usbvideo_HexDump(const unsigned char *data, int len); -void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame, int x, int y, int ch); -void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame, int x, int y, const char *str); -void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame); -void usbvideo_ReportStatistics(const uvd_t *uvd); +void usbvideo_OverlayChar(struct uvd *uvd, usbvideo_frame_t *frame, int x, int y, int ch); +void usbvideo_OverlayString(struct uvd *uvd, usbvideo_frame_t *frame, int x, int y, const char *str); +void usbvideo_OverlayStats(struct uvd *uvd, usbvideo_frame_t *frame); +void usbvideo_ReportStatistics(const struct uvd *uvd); void usbvideo_SayAndWait(const char *what); -void usbvideo_TestPattern(uvd_t *uvd, int fullframe, int pmode); +void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode); void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs); /* Memory allocation routines */ @@ -340,11 +340,11 @@ const char *driverName, const usbvideo_cb_t *cbTable, struct module *md); -uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams); -int usbvideo_RegisterVideoDevice(uvd_t *uvd); +struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams); +int usbvideo_RegisterVideoDevice(struct uvd *uvd); void usbvideo_Deregister(usbvideo_t **uvt); void usbvideo_Disconnect(struct usb_device *dev, void *ptr); -void usbvideo_CameraRelease(uvd_t *uvd); +void usbvideo_CameraRelease(struct uvd *uvd); void usbvideo_v4l_close(struct video_device *dev); int usbvideo_v4l_initialize(struct video_device *dev); @@ -356,12 +356,12 @@ long usbvideo_v4l_write(struct video_device *dev, const char *buf, unsigned long count, int noblock); -int usbvideo_GetFrame(uvd_t *uvd, int frameNum); -int usbvideo_NewFrame(uvd_t *uvd, int framenum); -int usbvideo_StartDataPump(uvd_t *uvd); -void usbvideo_StopDataPump(uvd_t *uvd); -void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame); -void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd, usbvideo_frame_t *frame); +int usbvideo_GetFrame(struct uvd *uvd, int frameNum); +int usbvideo_NewFrame(struct uvd *uvd, int framenum); +int usbvideo_StartDataPump(struct uvd *uvd); +void usbvideo_StopDataPump(struct uvd *uvd); +void usbvideo_DeinterlaceFrame(struct uvd *uvd, usbvideo_frame_t *frame); +void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd, usbvideo_frame_t *frame); /* * This code performs bounds checking - use it when working with