Commit 18245e18 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (8286): sms1xxx: remove typedefs

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent ca783736
This diff is collapsed.
This diff is collapsed.
......@@ -29,15 +29,16 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
struct list_head g_smsdvb_clients;
kmutex_t g_smsdvb_clientslock;
int smsdvb_onresponse(void *context, smscore_buffer_t *cb)
int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
{
smsdvb_client_t *client = (smsdvb_client_t *) context;
SmsMsgHdr_ST *phdr = (SmsMsgHdr_ST *)(((u8 *) cb->p) + cb->offset);
struct smsdvb_client_t *client = (struct smsdvb_client_t *) context;
struct SmsMsgHdr_ST *phdr =
(struct SmsMsgHdr_ST *)(((u8 *) cb->p) + cb->offset);
switch (phdr->msgType) {
case MSG_SMS_DVBT_BDA_DATA:
dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1),
cb->size - sizeof(SmsMsgHdr_ST));
cb->size - sizeof(struct SmsMsgHdr_ST));
break;
case MSG_SMS_RF_TUNE_RES:
......@@ -46,8 +47,8 @@ int smsdvb_onresponse(void *context, smscore_buffer_t *cb)
case MSG_SMS_GET_STATISTICS_RES:
{
SmsMsgStatisticsInfo_ST *p =
(SmsMsgStatisticsInfo_ST *)(phdr + 1);
struct SmsMsgStatisticsInfo_ST *p =
(struct SmsMsgStatisticsInfo_ST *)(phdr + 1);
if (p->Stat.IsDemodLocked) {
client->fe_status = FE_HAS_SIGNAL |
......@@ -82,7 +83,7 @@ int smsdvb_onresponse(void *context, smscore_buffer_t *cb)
return 0;
}
void smsdvb_unregister_client(smsdvb_client_t *client)
void smsdvb_unregister_client(struct smsdvb_client_t *client)
{
/* must be called under clientslock */
......@@ -100,16 +101,16 @@ void smsdvb_onremove(void *context)
{
kmutex_lock(&g_smsdvb_clientslock);
smsdvb_unregister_client((smsdvb_client_t *) context);
smsdvb_unregister_client((struct smsdvb_client_t *) context);
kmutex_unlock(&g_smsdvb_clientslock);
}
static int smsdvb_start_feed(struct dvb_demux_feed *feed)
{
smsdvb_client_t *client =
container_of(feed->demux, smsdvb_client_t, demux);
SmsMsgData_ST PidMsg;
struct smsdvb_client_t *client =
container_of(feed->demux, struct smsdvb_client_t, demux);
struct SmsMsgData_ST PidMsg;
printk(KERN_DEBUG "%s add pid %d(%x)\n", __func__,
feed->pid, feed->pid);
......@@ -127,9 +128,9 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed)
static int smsdvb_stop_feed(struct dvb_demux_feed *feed)
{
smsdvb_client_t *client =
container_of(feed->demux, smsdvb_client_t, demux);
SmsMsgData_ST PidMsg;
struct smsdvb_client_t *client =
container_of(feed->demux, struct smsdvb_client_t, demux);
struct SmsMsgData_ST PidMsg;
printk(KERN_DEBUG "%s remove pid %d(%x)\n", __func__,
feed->pid, feed->pid);
......@@ -145,7 +146,7 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed)
&PidMsg, sizeof(PidMsg));
}
static int smsdvb_sendrequest_and_wait(smsdvb_client_t *client,
static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client,
void *buffer, size_t size,
struct completion *completion)
{
......@@ -158,18 +159,19 @@ static int smsdvb_sendrequest_and_wait(smsdvb_client_t *client,
0 : -ETIME;
}
static int smsdvb_send_statistics_request(smsdvb_client_t *client)
static int smsdvb_send_statistics_request(struct smsdvb_client_t *client)
{
SmsMsgHdr_ST Msg = { MSG_SMS_GET_STATISTICS_REQ,
struct SmsMsgHdr_ST Msg = { MSG_SMS_GET_STATISTICS_REQ,
DVBT_BDA_CONTROL_MSG_ID,
HIF_TASK, sizeof(SmsMsgHdr_ST), 0 };
HIF_TASK, sizeof(struct SmsMsgHdr_ST), 0 };
return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg),
&client->stat_done);
}
static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat)
{
smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend);
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);
int rc = smsdvb_send_statistics_request(client);
if (!rc)
......@@ -180,7 +182,8 @@ static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat)
static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber)
{
smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend);
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);
int rc = smsdvb_send_statistics_request(client);
if (!rc)
......@@ -191,7 +194,8 @@ static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber)
static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{
smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend);
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);
int rc = smsdvb_send_statistics_request(client);
if (!rc)
......@@ -202,7 +206,8 @@ static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr)
{
smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend);
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);
int rc = smsdvb_send_statistics_request(client);
if (!rc)
......@@ -225,11 +230,11 @@ static int smsdvb_get_tune_settings(struct dvb_frontend *fe,
static int smsdvb_set_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep)
{
smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend);
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);
struct
{
SmsMsgHdr_ST Msg;
struct {
struct SmsMsgHdr_ST Msg;
u32 Data[3];
} Msg;
......@@ -259,7 +264,8 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe,
static int smsdvb_get_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *fep)
{
smsdvb_client_t *client = container_of(fe, smsdvb_client_t, frontend);
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);
printk(KERN_DEBUG "%s\n", __func__);
......@@ -303,11 +309,11 @@ static struct dvb_frontend_ops smsdvb_fe_ops = {
.read_snr = smsdvb_read_snr,
};
int smsdvb_hotplug(smscore_device_t *coredev,
int smsdvb_hotplug(struct smscore_device_t *coredev,
struct device *device, int arrival)
{
smsclient_params_t params;
smsdvb_client_t *client;
struct smsclient_params_t params;
struct smsdvb_client_t *client;
int rc;
/* device removal handled by onremove callback */
......@@ -320,7 +326,7 @@ int smsdvb_hotplug(smscore_device_t *coredev,
return 0;
}
client = kzalloc(sizeof(smsdvb_client_t), GFP_KERNEL);
client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL);
if (!client) {
printk(KERN_INFO "%s kmalloc() failed\n", __func__);
return -ENOMEM;
......@@ -439,7 +445,7 @@ void smsdvb_unregister(void)
while (!list_empty(&g_smsdvb_clients))
smsdvb_unregister_client(
(smsdvb_client_t *) g_smsdvb_clients.next);
(struct smsdvb_client_t *) g_smsdvb_clients.next);
kmutex_unlock(&g_smsdvb_clientslock);
}
......@@ -40,33 +40,31 @@
#define USB_PID_NOVA_B 0x0201
#define USB_PID_VEGA 0x0300
typedef struct _smsusb_device smsusb_device_t;
struct smsusb_device_t;
typedef struct _smsusb_urb
{
smscore_buffer_t *cb;
smsusb_device_t *dev;
struct smsusb_urb_t {
struct smscore_buffer_t *cb;
struct smsusb_device_t *dev;
struct urb urb;
} smsusb_urb_t;
struct urb urb;
};
typedef struct _smsusb_device
{
struct smsusb_device_t {
struct usb_device *udev;
smscore_device_t *coredev;
struct smscore_device_t *coredev;
smsusb_urb_t surbs[MAX_URBS];
struct smsusb_urb_t surbs[MAX_URBS];
int response_alignment;
int buffer_size;
} *psmsusb_device_t;
};
int smsusb_submit_urb(smsusb_device_t *dev, smsusb_urb_t *surb);
int smsusb_submit_urb(struct smsusb_device_t *dev, struct smsusb_urb_t *surb);
void smsusb_onresponse(struct urb *urb)
{
smsusb_urb_t *surb = (smsusb_urb_t *) urb->context;
smsusb_device_t *dev = surb->dev;
struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context;
struct smsusb_device_t *dev = surb->dev;
if (urb->status < 0) {
printk(KERN_INFO "%s error, urb status %d, %d bytes\n",
......@@ -75,7 +73,7 @@ void smsusb_onresponse(struct urb *urb)
}
if (urb->actual_length > 0) {
SmsMsgHdr_ST *phdr = (SmsMsgHdr_ST *) surb->cb->p;
struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) surb->cb->p;
if (urb->actual_length >= phdr->msgLength) {
surb->cb->size = phdr->msgLength;
......@@ -102,7 +100,7 @@ void smsusb_onresponse(struct urb *urb)
/* move buffer pointer and
* copy header to its new location */
memcpy((char *) phdr + surb->cb->offset,
phdr, sizeof(SmsMsgHdr_ST));
phdr, sizeof(struct SmsMsgHdr_ST));
} else
surb->cb->offset = 0;
......@@ -119,7 +117,7 @@ void smsusb_onresponse(struct urb *urb)
smsusb_submit_urb(dev, surb);
}
int smsusb_submit_urb(smsusb_device_t *dev, smsusb_urb_t *surb)
int smsusb_submit_urb(struct smsusb_device_t *dev, struct smsusb_urb_t *surb)
{
if (!surb->cb) {
surb->cb = smscore_getbuffer(dev->coredev);
......@@ -145,7 +143,7 @@ int smsusb_submit_urb(smsusb_device_t *dev, smsusb_urb_t *surb)
return usb_submit_urb(&surb->urb, GFP_ATOMIC);
}
void smsusb_stop_streaming(smsusb_device_t *dev)
void smsusb_stop_streaming(struct smsusb_device_t *dev)
{
int i;
......@@ -159,7 +157,7 @@ void smsusb_stop_streaming(smsusb_device_t *dev)
}
}
int smsusb_start_streaming(smsusb_device_t *dev)
int smsusb_start_streaming(struct smsusb_device_t *dev)
{
int i, rc;
......@@ -178,7 +176,7 @@ int smsusb_start_streaming(smsusb_device_t *dev)
int smsusb_sendrequest(void *context, void *buffer, size_t size)
{
smsusb_device_t *dev = (smsusb_device_t *) context;
struct smsusb_device_t *dev = (struct smsusb_device_t *) context;
int dummy;
return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2),
......@@ -235,7 +233,8 @@ int smsusb1_load_firmware(struct usb_device *udev, int id)
void smsusb1_detectmode(void *context, int *mode)
{
char *product_string = ((smsusb_device_t *) context)->udev->product;
char *product_string =
((struct smsusb_device_t *) context)->udev->product;
*mode = DEVICE_MODE_NONE;
......@@ -256,8 +255,8 @@ void smsusb1_detectmode(void *context, int *mode)
int smsusb1_setmode(void *context, int mode)
{
SmsMsgHdr_ST Msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK,
sizeof(SmsMsgHdr_ST), 0 };
struct SmsMsgHdr_ST Msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK,
sizeof(struct SmsMsgHdr_ST), 0 };
if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
printk(KERN_INFO "%s invalid firmware id specified %d\n",
......@@ -270,7 +269,8 @@ int smsusb1_setmode(void *context, int mode)
void smsusb_term_device(struct usb_interface *intf)
{
smsusb_device_t *dev = (smsusb_device_t *) usb_get_intfdata(intf);
struct smsusb_device_t *dev =
(struct smsusb_device_t *) usb_get_intfdata(intf);
if (dev) {
smsusb_stop_streaming(dev);
......@@ -289,15 +289,15 @@ void smsusb_term_device(struct usb_interface *intf)
int smsusb_init_device(struct usb_interface *intf)
{
smsdevice_params_t params;
smsusb_device_t *dev;
struct smsdevice_params_t params;
struct smsusb_device_t *dev;
int i, rc;
/* create device object */
dev = kzalloc(sizeof(smsusb_device_t), GFP_KERNEL);
dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);
if (!dev) {
printk(KERN_INFO "%s kzalloc(sizeof(smsusb_device_t) failed\n",
__func__);
printk(KERN_INFO "%s kzalloc(sizeof(struct smsusb_device_t) "
"failed\n", __func__);
return -ENOMEM;
}
......@@ -334,7 +334,7 @@ int smsusb_init_device(struct usb_interface *intf)
dev->buffer_size = USB2_BUFFER_SIZE;
dev->response_alignment =
dev->udev->ep_in[1]->desc.wMaxPacketSize -
sizeof(SmsMsgHdr_ST);
sizeof(struct SmsMsgHdr_ST);
params.flags |= SMS_DEVICE_FAMILY2;
break;
......
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