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