Commit f28bef0c authored by Simon Evans's avatar Simon Evans Committed by Greg Kroah-Hartman

[PATCH] 2.5.51 More typedef removal from usbvideo

This patch against 2.5.51 removes the remaining typedefs from usbvideo

typedef enum { .. } ScanState_t -> enum ScanState
typedef enum { .. } ParseState_t -> enum ParseState
typedef enum { .. } FrameState_t -> enum FrameState
typedef enum { .. } Deinterlace_t -> enum Deinterlace
typedef struct { .. } usbvideo_t -> struct usbvideo
parent 5c33addf
...@@ -87,7 +87,7 @@ typedef struct { ...@@ -87,7 +87,7 @@ typedef struct {
} ibmcam_t; } ibmcam_t;
#define IBMCAM_T(uvd) ((ibmcam_t *)((uvd)->user_data)) #define IBMCAM_T(uvd) ((ibmcam_t *)((uvd)->user_data))
usbvideo_t *cams = NULL; struct usbvideo *cams = NULL;
static int debug = 0; static int debug = 0;
...@@ -249,7 +249,7 @@ static videosize_t ibmcam_size_to_videosize(int size) ...@@ -249,7 +249,7 @@ static videosize_t ibmcam_size_to_videosize(int size)
* History: * History:
* 1/21/00 Created. * 1/21/00 Created.
*/ */
static ParseState_t ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame here */ static enum ParseState ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame here */
{ {
struct usbvideo_frame *frame; struct usbvideo_frame *frame;
ibmcam_t *icam; ibmcam_t *icam;
...@@ -397,7 +397,7 @@ case IBMCAM_MODEL_4: ...@@ -397,7 +397,7 @@ case IBMCAM_MODEL_4:
* 21-Jan-2000 Created. * 21-Jan-2000 Created.
* 12-Oct-2000 Reworked to reflect interlaced nature of the data. * 12-Oct-2000 Reworked to reflect interlaced nature of the data.
*/ */
static ParseState_t ibmcam_parse_lines( static enum ParseState ibmcam_parse_lines(
struct uvd *uvd, struct uvd *uvd,
struct usbvideo_frame *frame, struct usbvideo_frame *frame,
long *pcopylen) long *pcopylen)
...@@ -662,7 +662,7 @@ static ParseState_t ibmcam_parse_lines( ...@@ -662,7 +662,7 @@ static ParseState_t ibmcam_parse_lines(
* them both as R component in attempt to at least partially recover the * them both as R component in attempt to at least partially recover the
* lost resolution. * lost resolution.
*/ */
static ParseState_t ibmcam_model2_320x240_parse_lines( static enum ParseState ibmcam_model2_320x240_parse_lines(
struct uvd *uvd, struct uvd *uvd,
struct usbvideo_frame *frame, struct usbvideo_frame *frame,
long *pcopylen) long *pcopylen)
...@@ -816,7 +816,7 @@ static ParseState_t ibmcam_model2_320x240_parse_lines( ...@@ -816,7 +816,7 @@ static ParseState_t ibmcam_model2_320x240_parse_lines(
return scan_Continue; return scan_Continue;
} }
static ParseState_t ibmcam_model3_parse_lines( static enum ParseState ibmcam_model3_parse_lines(
struct uvd *uvd, struct uvd *uvd,
struct usbvideo_frame *frame, struct usbvideo_frame *frame,
long *pcopylen) long *pcopylen)
...@@ -961,7 +961,7 @@ static ParseState_t ibmcam_model3_parse_lines( ...@@ -961,7 +961,7 @@ static ParseState_t ibmcam_model3_parse_lines(
* History: * History:
* 10-Feb-2001 Created. * 10-Feb-2001 Created.
*/ */
static ParseState_t ibmcam_model4_128x96_parse_lines( static enum ParseState ibmcam_model4_128x96_parse_lines(
struct uvd *uvd, struct uvd *uvd,
struct usbvideo_frame *frame, struct usbvideo_frame *frame,
long *pcopylen) long *pcopylen)
...@@ -1051,7 +1051,7 @@ static ParseState_t ibmcam_model4_128x96_parse_lines( ...@@ -1051,7 +1051,7 @@ static ParseState_t ibmcam_model4_128x96_parse_lines(
*/ */
void ibmcam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame) void ibmcam_ProcessIsocData(struct uvd *uvd, struct usbvideo_frame *frame)
{ {
ParseState_t newstate; enum ParseState newstate;
long copylen = 0; long copylen = 0;
int mod = IBMCAM_T(uvd)->camera_model; int mod = IBMCAM_T(uvd)->camera_model;
......
...@@ -51,7 +51,7 @@ enum frame_sizes { ...@@ -51,7 +51,7 @@ enum frame_sizes {
#define MAX_FRAME_SIZE SIZE_320X240 #define MAX_FRAME_SIZE SIZE_320X240
static usbvideo_t *cams; static struct usbvideo *cams;
#ifdef CONFIG_USB_DEBUG #ifdef CONFIG_USB_DEBUG
static int debug; static int debug;
......
...@@ -25,7 +25,7 @@ typedef struct { ...@@ -25,7 +25,7 @@ typedef struct {
} ultracam_t; } ultracam_t;
#define ULTRACAM_T(uvd) ((ultracam_t *)((uvd)->user_data)) #define ULTRACAM_T(uvd) ((ultracam_t *)((uvd)->user_data))
static usbvideo_t *cams = NULL; static struct usbvideo *cams = NULL;
static int debug = 0; static int debug = 0;
......
...@@ -42,8 +42,8 @@ MODULE_PARM(video_nr, "i"); ...@@ -42,8 +42,8 @@ MODULE_PARM(video_nr, "i");
* Local prototypes. * Local prototypes.
*/ */
#if USES_PROC_FS #if USES_PROC_FS
static void usbvideo_procfs_level1_create(usbvideo_t *ut); static void usbvideo_procfs_level1_create(struct usbvideo *ut);
static void usbvideo_procfs_level1_destroy(usbvideo_t *ut); static void usbvideo_procfs_level1_destroy(struct usbvideo *ut);
static void usbvideo_procfs_level2_create(struct uvd *uvd); static void usbvideo_procfs_level2_create(struct uvd *uvd);
static void usbvideo_procfs_level2_destroy(struct uvd *uvd); static void usbvideo_procfs_level2_destroy(struct uvd *uvd);
static int usbvideo_default_procfs_read_proc( static int usbvideo_default_procfs_read_proc(
...@@ -765,7 +765,7 @@ static void usbvideo_ClientDecModCount(struct uvd *uvd) ...@@ -765,7 +765,7 @@ static void usbvideo_ClientDecModCount(struct uvd *uvd)
} }
int usbvideo_register( int usbvideo_register(
usbvideo_t **pCams, struct usbvideo **pCams,
const int num_cams, const int num_cams,
const int num_extra, const int num_extra,
const char *driverName, const char *driverName,
...@@ -773,7 +773,7 @@ int usbvideo_register( ...@@ -773,7 +773,7 @@ int usbvideo_register(
struct module *md, struct module *md,
const struct usb_device_id *id_table) const struct usb_device_id *id_table)
{ {
usbvideo_t *cams; struct usbvideo *cams;
int i, base_size; int i, base_size;
/* Check parameters for sanity */ /* Check parameters for sanity */
...@@ -788,10 +788,10 @@ int usbvideo_register( ...@@ -788,10 +788,10 @@ int usbvideo_register(
return -EINVAL; return -EINVAL;
} }
base_size = num_cams * sizeof(struct uvd) + sizeof(usbvideo_t); base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo);
cams = (usbvideo_t *) kmalloc(base_size, GFP_KERNEL); cams = (struct usbvideo *) kmalloc(base_size, GFP_KERNEL);
if (cams == NULL) { if (cams == NULL) {
err("Failed to allocate %d. bytes for usbvideo_t", base_size); err("Failed to allocate %d. bytes for usbvideo struct", base_size);
return -ENOMEM; return -ENOMEM;
} }
dbg("%s: Allocated $%p (%d. bytes) for %d. cameras", dbg("%s: Allocated $%p (%d. bytes) for %d. cameras",
...@@ -823,7 +823,7 @@ int usbvideo_register( ...@@ -823,7 +823,7 @@ int usbvideo_register(
#else /* !USES_PROC_FS */ #else /* !USES_PROC_FS */
/* Report a warning so that user knows why there is no /proc entries */ /* Report a warning so that user knows why there is no /proc entries */
if ((cams->cb.procfs_read != NULL) || (cams->cb.procfs_write == NULL)) { if ((cams->cb.procfs_read != NULL) || (cams->cb.procfs_write == NULL)) {
dbg("%s: /proc fs support requested but not configured!", proc); dbg("%s: /proc fs support requested but not configured!", __FUNCTION__);
} }
#endif #endif
cams->num_cameras = num_cams; cams->num_cameras = num_cams;
...@@ -889,9 +889,9 @@ EXPORT_SYMBOL(usbvideo_register); ...@@ -889,9 +889,9 @@ EXPORT_SYMBOL(usbvideo_register);
* if you had some dynamically allocated components in ->user field then * if you had some dynamically allocated components in ->user field then
* you should free them before calling here. * you should free them before calling here.
*/ */
void usbvideo_Deregister(usbvideo_t **pCams) void usbvideo_Deregister(struct usbvideo **pCams)
{ {
usbvideo_t *cams; struct usbvideo *cams;
int i; int i;
if (pCams == NULL) { if (pCams == NULL) {
...@@ -1049,12 +1049,12 @@ static void usbvideo_CameraRelease(struct uvd *uvd) ...@@ -1049,12 +1049,12 @@ static void usbvideo_CameraRelease(struct uvd *uvd)
* History: * History:
* 27-Jan-2000 Created. * 27-Jan-2000 Created.
*/ */
static int usbvideo_find_struct(usbvideo_t *cams) static int usbvideo_find_struct(struct usbvideo *cams)
{ {
int u, rv = -1; int u, rv = -1;
if (cams == NULL) { if (cams == NULL) {
err("No usbvideo_t handle?"); err("No usbvideo handle?");
return -1; return -1;
} }
down(&cams->lock); down(&cams->lock);
...@@ -1089,13 +1089,13 @@ static struct video_device usbvideo_template = { ...@@ -1089,13 +1089,13 @@ static struct video_device usbvideo_template = {
.fops = &usbvideo_fops, .fops = &usbvideo_fops,
}; };
struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams) struct uvd *usbvideo_AllocateDevice(struct usbvideo *cams)
{ {
int i, devnum; int i, devnum;
struct uvd *uvd = NULL; struct uvd *uvd = NULL;
if (cams == NULL) { if (cams == NULL) {
err("No usbvideo_t handle?"); err("No usbvideo handle?");
return NULL; return NULL;
} }
...@@ -2357,7 +2357,7 @@ static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd, ...@@ -2357,7 +2357,7 @@ static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd,
extern struct proc_dir_entry *video_proc_entry; extern struct proc_dir_entry *video_proc_entry;
static void usbvideo_procfs_level1_create(usbvideo_t *ut) static void usbvideo_procfs_level1_create(struct usbvideo *ut)
{ {
if (ut == NULL) { if (ut == NULL) {
err("%s: ut == NULL", __FUNCTION__); err("%s: ut == NULL", __FUNCTION__);
...@@ -2376,7 +2376,7 @@ static void usbvideo_procfs_level1_create(usbvideo_t *ut) ...@@ -2376,7 +2376,7 @@ static void usbvideo_procfs_level1_create(usbvideo_t *ut)
} }
} }
static void usbvideo_procfs_level1_destroy(usbvideo_t *ut) static void usbvideo_procfs_level1_destroy(struct usbvideo *ut)
{ {
if (ut == NULL) { if (ut == NULL) {
err("%s: ut == NULL", __FUNCTION__); err("%s: ut == NULL", __FUNCTION__);
......
...@@ -126,37 +126,37 @@ struct RingQueue { ...@@ -126,37 +126,37 @@ struct RingQueue {
wait_queue_head_t wqh; /* Processes waiting */ wait_queue_head_t wqh; /* Processes waiting */
}; };
typedef enum { enum ScanState {
ScanState_Scanning, /* Scanning for header */ ScanState_Scanning, /* Scanning for header */
ScanState_Lines /* Parsing lines */ ScanState_Lines /* Parsing lines */
} ScanState_t; };
/* Completion states of the data parser */ /* Completion states of the data parser */
typedef enum { enum ParseState {
scan_Continue, /* Just parse next item */ scan_Continue, /* Just parse next item */
scan_NextFrame, /* Frame done, send it to V4L */ scan_NextFrame, /* Frame done, send it to V4L */
scan_Out, /* Not enough data for frame */ scan_Out, /* Not enough data for frame */
scan_EndParse /* End parsing */ scan_EndParse /* End parsing */
} ParseState_t; };
typedef enum { enum FrameState {
FrameState_Unused, /* Unused (no MCAPTURE) */ FrameState_Unused, /* Unused (no MCAPTURE) */
FrameState_Ready, /* Ready to start grabbing */ FrameState_Ready, /* Ready to start grabbing */
FrameState_Grabbing, /* In the process of being grabbed into */ FrameState_Grabbing, /* In the process of being grabbed into */
FrameState_Done, /* Finished grabbing, but not been synced yet */ FrameState_Done, /* Finished grabbing, but not been synced yet */
FrameState_Done_Hold, /* Are syncing or reading */ FrameState_Done_Hold, /* Are syncing or reading */
FrameState_Error, /* Something bad happened while processing */ FrameState_Error, /* Something bad happened while processing */
} FrameState_t; };
/* /*
* Some frames may contain only even or odd lines. This type * Some frames may contain only even or odd lines. This type
* specifies what type of deinterlacing is required. * specifies what type of deinterlacing is required.
*/ */
typedef enum { enum Deinterlace {
Deinterlace_None=0, Deinterlace_None=0,
Deinterlace_FillOddLines, Deinterlace_FillOddLines,
Deinterlace_FillEvenLines Deinterlace_FillEvenLines
} Deinterlace_t; };
#define USBVIDEO_NUMFRAMES 2 /* How many frames we work with */ #define USBVIDEO_NUMFRAMES 2 /* How many frames we work with */
#define USBVIDEO_NUMSBUF 2 /* How many URBs linked in a ring */ #define USBVIDEO_NUMSBUF 2 /* How many URBs linked in a ring */
...@@ -175,9 +175,9 @@ struct usbvideo_frame { ...@@ -175,9 +175,9 @@ struct usbvideo_frame {
videosize_t request; /* That's what the application asked for */ videosize_t request; /* That's what the application asked for */
unsigned short palette; /* The desired format */ unsigned short palette; /* The desired format */
FrameState_t frameState;/* State of grabbing */ enum FrameState frameState;/* State of grabbing */
ScanState_t scanstate; /* State of scanning */ enum ScanState scanstate; /* State of scanning */
Deinterlace_t deinterlace; enum Deinterlace deinterlace;
int flags; /* USBVIDEO_FRAME_FLAG_xxx bit flags */ int flags; /* USBVIDEO_FRAME_FLAG_xxx bit flags */
int curline; /* Line of frame we're working on */ int curline; /* Line of frame we're working on */
...@@ -199,12 +199,12 @@ struct usbvideo_statistics { ...@@ -199,12 +199,12 @@ struct usbvideo_statistics {
unsigned long iso_err_count; /* How many bad ISO packets received */ unsigned long iso_err_count; /* How many bad ISO packets received */
}; };
struct s_usbvideo_t; struct usbvideo;
struct uvd { struct uvd {
struct video_device vdev; /* Must be the first field! */ struct video_device vdev; /* Must be the first field! */
struct usb_device *dev; struct usb_device *dev;
struct s_usbvideo_t *handle; /* Points back to the usbvideo_t */ struct usbvideo *handle; /* Points back to the struct usbvideo */
void *user_data; /* Camera-dependent data */ void *user_data; /* Camera-dependent data */
int user_size; /* Size of that camera-dependent data */ int user_size; /* Size of that camera-dependent data */
int debug; /* Debug level for usbvideo */ int debug; /* Debug level for usbvideo */
...@@ -273,7 +273,7 @@ struct usbvideo_cb { ...@@ -273,7 +273,7 @@ struct usbvideo_cb {
int (*setVideoMode)(struct uvd *uvd, struct video_window *vw); int (*setVideoMode)(struct uvd *uvd, struct video_window *vw);
}; };
struct s_usbvideo_t { struct usbvideo {
int num_cameras; /* As allocated */ int num_cameras; /* As allocated */
struct usb_driver usbdrv; /* Interface to the USB stack */ struct usb_driver usbdrv; /* Interface to the USB stack */
char drvName[80]; /* Driver name */ char drvName[80]; /* Driver name */
...@@ -285,7 +285,7 @@ struct s_usbvideo_t { ...@@ -285,7 +285,7 @@ struct s_usbvideo_t {
struct proc_dir_entry *procfs_dEntry; /* /proc/video/MYDRIVER */ struct proc_dir_entry *procfs_dEntry; /* /proc/video/MYDRIVER */
struct module *md_module; /* Minidriver module */ struct module *md_module; /* Minidriver module */
}; };
typedef struct s_usbvideo_t usbvideo_t;
/* /*
* This macro retrieves callback address from the struct uvd object. * This macro retrieves callback address from the struct uvd object.
...@@ -332,16 +332,16 @@ void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode); ...@@ -332,16 +332,16 @@ void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode);
unsigned long usbvideo_kvirt_to_pa(unsigned long adr); unsigned long usbvideo_kvirt_to_pa(unsigned long adr);
int usbvideo_register( int usbvideo_register(
usbvideo_t **pCams, struct usbvideo **pCams,
const int num_cams, const int num_cams,
const int num_extra, const int num_extra,
const char *driverName, const char *driverName,
const struct usbvideo_cb *cbTable, const struct usbvideo_cb *cbTable,
struct module *md, struct module *md,
const struct usb_device_id *id_table); const struct usb_device_id *id_table);
struct uvd *usbvideo_AllocateDevice(usbvideo_t *cams); struct uvd *usbvideo_AllocateDevice(struct usbvideo *cams);
int usbvideo_RegisterVideoDevice(struct uvd *uvd); int usbvideo_RegisterVideoDevice(struct uvd *uvd);
void usbvideo_Deregister(usbvideo_t **uvt); void usbvideo_Deregister(struct usbvideo **uvt);
int usbvideo_v4l_initialize(struct video_device *dev); int usbvideo_v4l_initialize(struct video_device *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment