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

[PATCH] typedef uvd_t removal in usbvideo

This patch replaces typedef struct { .. } uvd_t with struct uvd as a
cleanup removing typedef *_t types.
parent 3118f2e8
......@@ -78,7 +78,7 @@ enum {
};
/*
* 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 @@ static videosize_t ibmcam_size_to_videosize(int size)
* 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 @@ case IBMCAM_MODEL_4:
* 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 @@ static ParseState_t ibmcam_parse_lines(
* 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_model2_320x240_parse_lines(
}
static ParseState_t ibmcam_model3_parse_lines(
uvd_t *uvd,
struct uvd *uvd,
usbvideo_frame_t *frame,
long *pcopylen)
{
......@@ -962,7 +962,7 @@ static ParseState_t ibmcam_model3_parse_lines(
* 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 @@ static ParseState_t ibmcam_model4_128x96_parse_lines(
* 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 @@ void ibmcam_ProcessIsocData(uvd_t *uvd, usbvideo_frame_t *frame)
* 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 @@ static int ibmcam_veio(
* 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 @@ static int ibmcam_calculate_fps(uvd_t *uvd)
* 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 @@ static void ibmcam_send_x_00_05_02(uvd_t *uvd, unsigned short x)
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 @@ static void ibmcam_send_x_01_00_05(uvd_t *uvd, unsigned short x)
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 @@ static void ibmcam_send_x_00_05_02_01(uvd_t *uvd, unsigned short x)
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 @@ static void ibmcam_send_x_00_05_02_08_01(uvd_t *uvd, unsigned short x)
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 @@ static void ibmcam_Packet_Format1(uvd_t *uvd, unsigned char fkey, unsigned char
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 @@ static void ibmcam_model2_Packet1(uvd_t *uvd, unsigned short v1, unsigned short
* 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 @@ static void ibmcam_model3_Packet1(uvd_t *uvd, unsigned short v1, unsigned short
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 @@ static void ibmcam_model4_BrightnessPacket(uvd_t *uvd, int i)
* 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 @@ static void ibmcam_adjust_contrast(uvd_t *uvd)
* 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 @@ static void ibmcam_change_lighting_conditions(uvd_t *uvd)
* 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 @@ static void ibmcam_set_sharpness(uvd_t *uvd)
*
* 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_brightness(uvd_t *uvd)
}
}
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 @@ static void ibmcam_set_hue(uvd_t *uvd)
* 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 @@ static int ibmcam_model1_setup(uvd_t *uvd)
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 @@ static int ibmcam_model2_setup(uvd_t *uvd)
* 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 @@ static void ibmcam_model1_setup_after_video_if(uvd_t *uvd)
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 @@ static void ibmcam_model2_setup_after_video_if(uvd_t *uvd)
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 @@ static void ibmcam_model4_setup_after_video_if(uvd_t *uvd)
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 @@ static void ibmcam_model3_setup_after_video_if(uvd_t *uvd)
* 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 @@ case IBMCAM_MODEL_4:
* 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_reinit_iso(uvd_t *uvd, int do_stop)
}
}
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 @@ static void ibmcam_video_start(uvd_t *uvd)
/*
* 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 @@ static int ibmcam_setup_on_open(uvd_t *uvd)
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_configure_video(uvd_t *uvd)
*/
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 @@ static void *ibmcam_probe(struct usb_device *dev, unsigned int ifnum, const stru
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;
......
......@@ -129,7 +129,7 @@ struct konicawc {
#define konicawc_set_value(uvd, value, index) konicawc_ctrl_msg(uvd, USB_DIR_OUT, 2, value, index, NULL, 0)
static int konicawc_ctrl_msg(uvd_t *uvd, u8 dir, u8 request, u16 value, u16 index, void *buf, int len)
static int konicawc_ctrl_msg(struct uvd *uvd, u8 dir, u8 request, u16 value, u16 index, void *buf, int len)
{
int retval = usb_control_msg(uvd->dev,
dir ? usb_rcvctrlpipe(uvd->dev, 0) : usb_sndctrlpipe(uvd->dev, 0),
......@@ -138,21 +138,21 @@ static int konicawc_ctrl_msg(uvd_t *uvd, u8 dir, u8 request, u16 value, u16 inde
}
static inline void konicawc_camera_on(uvd_t *uvd)
static inline void konicawc_camera_on(struct uvd *uvd)
{
DEBUG(0, "camera on");
konicawc_set_misc(uvd, 0x2, 1, 0x0b);
}
static inline void konicawc_camera_off(uvd_t *uvd)
static inline void konicawc_camera_off(struct uvd *uvd)
{
DEBUG(0, "camera off");
konicawc_set_misc(uvd, 0x2, 0, 0x0b);
}
static void konicawc_set_camera_size(uvd_t *uvd)
static void konicawc_set_camera_size(struct uvd *uvd)
{
struct konicawc *cam = (struct konicawc *)uvd->user_data;
......@@ -166,7 +166,7 @@ static void konicawc_set_camera_size(uvd_t *uvd)
}
static int konicawc_setup_on_open(uvd_t *uvd)
static int konicawc_setup_on_open(struct uvd *uvd)
{
struct konicawc *cam = (struct konicawc *)uvd->user_data;
......@@ -192,7 +192,7 @@ static int konicawc_setup_on_open(uvd_t *uvd)
}
static void konicawc_adjust_picture(uvd_t *uvd)
static void konicawc_adjust_picture(struct uvd *uvd)
{
struct konicawc *cam = (struct konicawc *)uvd->user_data;
......@@ -218,7 +218,7 @@ static void konicawc_adjust_picture(uvd_t *uvd)
}
static int konicawc_compress_iso(uvd_t *uvd, struct urb *dataurb, struct urb *stsurb)
static int konicawc_compress_iso(struct uvd *uvd, struct urb *dataurb, struct urb *stsurb)
{
char *cdata;
int i, totlen = 0;
......@@ -316,7 +316,7 @@ static int konicawc_compress_iso(uvd_t *uvd, struct urb *dataurb, struct urb *st
}
static void resubmit_urb(uvd_t *uvd, struct urb *urb)
static void resubmit_urb(struct uvd *uvd, struct urb *urb)
{
int i, ret;
for (i = 0; i < FRAMES_PER_DESC; i++) {
......@@ -334,7 +334,7 @@ static void resubmit_urb(uvd_t *uvd, struct urb *urb)
static void konicawc_isoc_irq(struct urb *urb)
{
uvd_t *uvd = urb->context;
struct uvd *uvd = urb->context;
struct konicawc *cam = (struct konicawc *)uvd->user_data;
/* We don't want to do anything if we are about to be removed! */
......@@ -375,7 +375,7 @@ static void konicawc_isoc_irq(struct urb *urb)
}
static int konicawc_start_data(uvd_t *uvd)
static int konicawc_start_data(struct uvd *uvd)
{
struct usb_device *dev = uvd->dev;
int i, errFlag;
......@@ -453,7 +453,7 @@ static int konicawc_start_data(uvd_t *uvd)
}
static void konicawc_stop_data(uvd_t *uvd)
static void konicawc_stop_data(struct uvd *uvd)
{
int i, j;
struct konicawc *cam;
......@@ -488,7 +488,7 @@ static void konicawc_stop_data(uvd_t *uvd)
}
static void konicawc_process_isoc(uvd_t *uvd, usbvideo_frame_t *frame)
static void konicawc_process_isoc(struct uvd *uvd, usbvideo_frame_t *frame)
{
struct konicawc *cam = (struct konicawc *)uvd->user_data;
int maxline = cam->maxline;
......@@ -587,7 +587,7 @@ static int konicawc_find_fps(int size, int fps)
}
static int konicawc_set_video_mode(uvd_t *uvd, struct video_window *vw)
static int konicawc_set_video_mode(struct uvd *uvd, struct video_window *vw)
{
struct konicawc *cam = (struct konicawc *)uvd->user_data;
int newspeed = cam->speed;
......@@ -653,14 +653,14 @@ static int konicawc_set_video_mode(uvd_t *uvd, struct video_window *vw)
}
static int konicawc_calculate_fps(uvd_t *uvd)
static int konicawc_calculate_fps(struct uvd *uvd)
{
struct konicawc *cam = uvd->user_data;
return spd_to_fps[cam->size][cam->speed]/3;
}
static void konicawc_configure_video(uvd_t *uvd)
static void konicawc_configure_video(struct uvd *uvd)
{
struct konicawc *cam = (struct konicawc *)uvd->user_data;
u8 buf[2];
......@@ -719,7 +719,7 @@ static void konicawc_configure_video(uvd_t *uvd)
static void *konicawc_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;
......@@ -795,7 +795,7 @@ static void *konicawc_probe(struct usb_device *dev, unsigned int ifnum, const st
uvd = usbvideo_AllocateDevice(cams);
if (uvd != NULL) {
struct konicawc *cam = (struct konicawc *)(uvd->user_data);
/* Here uvd is a fully allocated uvd_t object */
/* Here uvd is a fully allocated uvd object */
for(i = 0; i < USBVIDEO_NUMSBUF; i++) {
cam->sts_urb[i] = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL);
if(cam->sts_urb[i] == NULL) {
......@@ -858,7 +858,7 @@ static void *konicawc_probe(struct usb_device *dev, unsigned int ifnum, const st
}
static void konicawc_free_uvd(uvd_t *uvd)
static void konicawc_free_uvd(struct uvd *uvd)
{
int i;
struct konicawc *cam = (struct konicawc *)uvd->user_data;
......
......@@ -103,7 +103,7 @@ 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(uvd_t *uvd, usbvideo_frame_t *frame)
void ultracam_ProcessIsocData(struct uvd *uvd, usbvideo_frame_t *frame)
{
int n;
......@@ -140,7 +140,7 @@ void ultracam_ProcessIsocData(uvd_t *uvd, usbvideo_frame_t *frame)
* 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 @@ static int ultracam_veio(
/*
* 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 @@ static int ultracam_calculate_fps(uvd_t *uvd)
/*
* 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 @@ static void ultracam_change_lighting_conditions(uvd_t *uvd)
* 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 @@ static void ultracam_set_sharpness(uvd_t *uvd)
*
* 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 @@ static void ultracam_set_hue(uvd_t *uvd)
* 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 @@ static void ultracam_adjust_picture(uvd_t *uvd)
* 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 @@ static void ultracam_video_stop(uvd_t *uvd)
* 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 @@ static int ultracam_alternateSetting(uvd_t *uvd, int setting)
/*
* 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 @@ static int ultracam_setup_on_open(uvd_t *uvd)
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_configure_video(uvd_t *uvd)
*/
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 @@ static void *ultracam_probe(struct usb_device *dev, unsigned int ifnum ,const st
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;
......
......@@ -44,8 +44,8 @@ MODULE_PARM(video_nr, "i");
#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);
......@@ -55,7 +55,7 @@ static int usbvideo_default_procfs_write_proc(
#endif
static void usbvideo_Disconnect(struct usb_device *dev, void *ptr);
static void usbvideo_CameraRelease(uvd_t *uvd);
static void usbvideo_CameraRelease(struct uvd *uvd);
static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
......@@ -65,11 +65,11 @@ static int usbvideo_v4l_read(struct file *file, char *buf,
size_t count, loff_t *ppos);
static int usbvideo_v4l_close(struct inode *inode, struct file *file);
static int usbvideo_StartDataPump(uvd_t *uvd);
static void usbvideo_StopDataPump(uvd_t *uvd);
static int usbvideo_GetFrame(uvd_t *uvd, int frameNum);
static int usbvideo_NewFrame(uvd_t *uvd, int framenum);
static void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd,
static int usbvideo_StartDataPump(struct uvd *uvd);
static void usbvideo_StopDataPump(struct uvd *uvd);
static int usbvideo_GetFrame(struct uvd *uvd, int frameNum);
static int usbvideo_NewFrame(struct uvd *uvd, int framenum);
static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd,
usbvideo_frame_t *frame);
/*******************************/
......@@ -290,7 +290,7 @@ static void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs)
* History:
* 01-Feb-2000 Created.
*/
static void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame,
static void usbvideo_OverlayChar(struct uvd *uvd, usbvideo_frame_t *frame,
int x, int y, int ch)
{
static const unsigned short digits[16] = {
......@@ -345,7 +345,7 @@ static void usbvideo_OverlayChar(uvd_t *uvd, usbvideo_frame_t *frame,
* History:
* 01-Feb-2000 Created.
*/
static void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame,
static void usbvideo_OverlayString(struct uvd *uvd, usbvideo_frame_t *frame,
int x, int y, const char *str)
{
while (*str) {
......@@ -363,7 +363,7 @@ static void usbvideo_OverlayString(uvd_t *uvd, usbvideo_frame_t *frame,
* History:
* 01-Feb-2000 Created.
*/
static void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame)
static void usbvideo_OverlayStats(struct uvd *uvd, usbvideo_frame_t *frame)
{
const int y_diff = 8;
char tmp[16];
......@@ -486,7 +486,7 @@ static void usbvideo_OverlayStats(uvd_t *uvd, usbvideo_frame_t *frame)
* History:
* 14-Jan-2000 Corrected default multiplier.
*/
static void usbvideo_ReportStatistics(const uvd_t *uvd)
static void usbvideo_ReportStatistics(const struct uvd *uvd)
{
if ((uvd != NULL) && (uvd->stats.urb_count > 0)) {
unsigned long allPackets, badPackets, goodPackets, percent;
......@@ -614,7 +614,7 @@ EXPORT_SYMBOL(usbvideo_DrawLine);
* 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;
......@@ -730,7 +730,7 @@ EXPORT_SYMBOL(usbvideo_SayAndWait);
/* ******************************************************************** */
static void usbvideo_ClientIncModCount(uvd_t *uvd)
static void usbvideo_ClientIncModCount(struct uvd *uvd)
{
if (uvd == NULL) {
err("%s: uvd == NULL", __FUNCTION__);
......@@ -747,7 +747,7 @@ static void usbvideo_ClientIncModCount(uvd_t *uvd)
__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__);
......@@ -788,7 +788,7 @@ int usbvideo_register(
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);
......@@ -827,14 +827,14 @@ int usbvideo_register(
}
#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;
......@@ -916,7 +916,7 @@ void usbvideo_Deregister(usbvideo_t **pCams)
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) {
......@@ -936,7 +936,7 @@ void usbvideo_Deregister(usbvideo_t **pCams)
}
}
/* 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;
......@@ -968,7 +968,7 @@ EXPORT_SYMBOL(usbvideo_Deregister);
*/
static 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)) {
......@@ -1008,14 +1008,14 @@ static void usbvideo_Disconnect(struct usb_device *dev, void *ptr)
/*
* usbvideo_CameraRelease()
*
* This code does final release of uvd_t. This happens
* This code does final release of uvd. This happens
* after the device is disconnected -and- all clients
* closed their files.
*
* History:
* 27-Jan-2000 Created.
*/
static void usbvideo_CameraRelease(uvd_t *uvd)
static void usbvideo_CameraRelease(struct uvd *uvd)
{
if (uvd == NULL) {
err("%s: Illegal call", __FUNCTION__);
......@@ -1056,7 +1056,7 @@ static int usbvideo_find_struct(usbvideo_t *cams)
}
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 */
......@@ -1086,10 +1086,10 @@ static struct video_device usbvideo_template = {
.fops = &usbvideo_fops,
};
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?");
......@@ -1137,7 +1137,7 @@ uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams)
EXPORT_SYMBOL(usbvideo_AllocateDevice);
int usbvideo_RegisterVideoDevice(uvd_t *uvd)
int usbvideo_RegisterVideoDevice(struct uvd *uvd)
{
char tmp1[20], tmp2[20]; /* Buffers for printing */
......@@ -1202,7 +1202,7 @@ EXPORT_SYMBOL(usbvideo_RegisterVideoDevice);
static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma)
{
uvd_t *uvd = file->private_data;
struct uvd *uvd = file->private_data;
unsigned long start = vma->vm_start;
unsigned long size = vma->vm_end-vma->vm_start;
unsigned long page, pos;
......@@ -1247,7 +1247,7 @@ static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma)
static int usbvideo_v4l_open(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
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;
......@@ -1361,7 +1361,7 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file)
static int usbvideo_v4l_close(struct inode *inode, struct file *file)
{
struct video_device *dev = file->private_data;
uvd_t *uvd = (uvd_t *) dev;
struct uvd *uvd = (struct uvd *) dev;
int i;
if (uvd->debug > 1)
......@@ -1408,7 +1408,7 @@ static int usbvideo_v4l_close(struct inode *inode, struct file *file)
static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
{
uvd_t *uvd = file->private_data;
struct uvd *uvd = file->private_data;
if (!CAMERA_IS_OPERATIONAL(uvd))
return -EIO;
......@@ -1637,7 +1637,7 @@ static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
static int usbvideo_v4l_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
uvd_t *uvd = file->private_data;
struct uvd *uvd = file->private_data;
int noblock = file->f_flags & O_NONBLOCK;
int frmx = -1, i;
usbvideo_frame_t *frame;
......@@ -1787,7 +1787,7 @@ static int usbvideo_v4l_read(struct file *file, char *buf,
/*
* 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;
......@@ -1820,7 +1820,7 @@ static int usbvideo_CompressIsochronous(uvd_t *uvd, struct urb *urb)
static void usbvideo_IsocIrq(struct urb *urb)
{
int i, ret, 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))
......@@ -1877,7 +1877,7 @@ static void usbvideo_IsocIrq(struct urb *urb)
* of hardcoded values. Simplified by using for loop,
* allowed any number of URBs.
*/
static int usbvideo_StartDataPump(uvd_t *uvd)
static int usbvideo_StartDataPump(struct uvd *uvd)
{
struct usb_device *dev = uvd->dev;
int i, errFlag;
......@@ -1945,7 +1945,7 @@ static int usbvideo_StartDataPump(uvd_t *uvd)
* 22-Jan-2000 Corrected order of actions to work after surprise removal.
* 27-Jan-2000 Used uvd->iface, uvd->ifaceAltInactive instead of hardcoded values.
*/
static void usbvideo_StopDataPump(uvd_t *uvd)
static void usbvideo_StopDataPump(struct uvd *uvd)
{
int i, j;
......@@ -1988,7 +1988,7 @@ static void usbvideo_StopDataPump(uvd_t *uvd)
* 29-Mar-00 Added copying of previous frame into the current one.
* 6-Aug-00 Added model 3 video sizes, removed redundant width, height.
*/
static int usbvideo_NewFrame(uvd_t *uvd, int framenum)
static int usbvideo_NewFrame(struct uvd *uvd, int framenum)
{
usbvideo_frame_t *frame;
int n;
......@@ -2064,7 +2064,7 @@ static int usbvideo_NewFrame(uvd_t *uvd, int framenum)
* FLAGS_NO_DECODING set. Therefore, any regular build of any driver
* based on usbvideo can use this feature at any time.
*/
static void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame)
static void usbvideo_CollectRawData(struct uvd *uvd, usbvideo_frame_t *frame)
{
int n;
......@@ -2094,7 +2094,7 @@ static void usbvideo_CollectRawData(uvd_t *uvd, usbvideo_frame_t *frame)
}
}
static int usbvideo_GetFrame(uvd_t *uvd, int frameNum)
static int usbvideo_GetFrame(struct uvd *uvd, int frameNum)
{
usbvideo_frame_t *frame = &uvd->frame[frameNum];
......@@ -2226,7 +2226,7 @@ static int usbvideo_GetFrame(uvd_t *uvd, int frameNum)
* 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;
......@@ -2296,7 +2296,7 @@ EXPORT_SYMBOL(usbvideo_DeinterlaceFrame);
* History:
* 09-Feb-2001 Created.
*/
static void usbvideo_SoftwareContrastAdjustment(uvd_t *uvd,
static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd,
usbvideo_frame_t *frame)
{
int i, j, v4l_linesize;
......@@ -2385,7 +2385,7 @@ static void usbvideo_procfs_level1_destroy(usbvideo_t *ut)
}
}
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__);
......@@ -2411,7 +2411,7 @@ static void usbvideo_procfs_level2_create(uvd_t *uvd)
}
}
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__);
......
......@@ -203,7 +203,7 @@ typedef struct {
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 */
......@@ -248,7 +248,7 @@ typedef struct {
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
......@@ -257,22 +257,22 @@ typedef struct {
*/
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);
int (*startDataPump)(uvd_t *uvd);
void (*stopDataPump)(uvd_t *uvd);
int (*setVideoMode)(uvd_t *uvd, struct video_window *vw);
int (*startDataPump)(struct uvd *uvd);
void (*stopDataPump)(struct uvd *uvd);
int (*setVideoMode)(struct uvd *uvd, struct video_window *vw);
} usbvideo_cb_t;
struct s_usbvideo_t {
......@@ -282,7 +282,7 @@ struct s_usbvideo_t {
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 */
......@@ -290,7 +290,7 @@ struct s_usbvideo_t {
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.
*/
......@@ -328,7 +328,7 @@ void usbvideo_DrawLine(
unsigned char cr, unsigned char cg, unsigned char cb);
void usbvideo_HexDump(const unsigned char *data, int len);
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);
/* Memory allocation routines */
unsigned long usbvideo_kvirt_to_pa(unsigned long adr);
......@@ -341,13 +341,13 @@ int usbvideo_register(
const usbvideo_cb_t *cbTable,
struct module *md,
const struct usb_device_id *id_table);
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);
int usbvideo_v4l_initialize(struct video_device *dev);
void usbvideo_DeinterlaceFrame(uvd_t *uvd, usbvideo_frame_t *frame);
void usbvideo_DeinterlaceFrame(struct uvd *uvd, usbvideo_frame_t *frame);
/*
* This code performs bounds checking - use it when working with
......
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