/* prepare dma buffers */
for (buffer = dev->common_buffer;
dev->num_buffers < params->num_buffers;
- dev->num_buffers ++, buffer += params->buffer_size) {
+ dev->num_buffers++, buffer += params->buffer_size) {
smscore_buffer_t *cb = smscore_createbuffer(buffer, dev->common_buffer, dev->common_buffer_phys);
if (!cb) {
smscore_unregister_device(dev);
mem_address = *(u32 *) &payload[20];
}
- while (size && rc >= 0)
- {
+ while (size && rc >= 0) {
SmsDataDownload_ST *DataMsg = (SmsDataDownload_ST *) msg;
int payload_size = min((int) size, SMS_MAX_PAYLOAD_SIZE);
sizeof(SmsMsgHdr_ST) +
sizeof(u32) * 5);
- TriggerMsg->msgData[0] = firmware->StartAddress; // Entry point
- TriggerMsg->msgData[1] = 5; // Priority
- TriggerMsg->msgData[2] = 0x200; // Stack size
- TriggerMsg->msgData[3] = 0; // Parameter
- TriggerMsg->msgData[4] = 4; // Task ID
+ TriggerMsg->msgData[0] = firmware->StartAddress; /* Entry point */
+ TriggerMsg->msgData[1] = 5; /* Priority */
+ TriggerMsg->msgData[2] = 0x200; /* Stack size */
+ TriggerMsg->msgData[3] = 0; /* Parameter */
+ TriggerMsg->msgData[4] = 4; /* Task ID */
if (coredev->device_flags & SMS_ROM_NO_RESPONSE) {
rc = coredev->sendrequest_handler(coredev->context, TriggerMsg, TriggerMsg->xMsgHeader.msgLength);
while (1) {
while ((cb = smscore_getbuffer(coredev))) {
kfree(cb);
- num_buffers ++;
+ num_buffers++;
}
if (num_buffers == coredev->num_buffers)
break;
for (next = first->next;
(next != first) && !client;
next = next->next) {
- firstid = &((smscore_client_t*)next)->idlist;
+ firstid = &((smscore_client_t *)next)->idlist;
for (nextid = firstid->next;
nextid != firstid;
nextid = nextid->next) {
- if ((((smscore_idlist_t*)nextid)->id == id) &&
- (((smscore_idlist_t*)nextid)->data_type == data_type ||
- (((smscore_idlist_t*)nextid)->data_type == 0))) {
- client = (smscore_client_t*) next;
+ if ((((smscore_idlist_t *)nextid)->id == id) &&
+ (((smscore_idlist_t *)nextid)->data_type == data_type ||
+ (((smscore_idlist_t *)nextid)->data_type == 0))) {
+ client = (smscore_client_t *) next;
break;
}
}
if (!last_sample_time)
last_sample_time = time_now;
- if (time_now - last_sample_time > 10000)
- {
+ if (time_now - last_sample_time > 10000) {
printk("\n%s data rate %d bytes/secs\n", __func__,
(int)((data_total * 1000) /
(time_now - last_sample_time)));
return -EFAULT;
}
registered_client = smscore_find_client(coredev, data_type, id);
- if (registered_client == client) {
+ if (registered_client == client)
return 0;
- }
+
if (registered_client) {
PERROR("The msg ID already registered to another client.\n");
return -EEXIST;
while (!list_empty(&client->idlist)) {
smscore_idlist_t *identry =
- (smscore_idlist_t*) client->idlist.next;
+ (smscore_idlist_t *) client->idlist.next;
list_del(&identry->entry);
kfree(identry);
}
#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
#define SMS_ALLOC_ALIGNMENT 128
#define SMS_DEVICE_NOT_READY 0x8000000
typedef enum {
- SMS_STELLAR= 0,
+ SMS_STELLAR = 0,
SMS_NOVA_A0,
SMS_NOVA_B0,
SMS_VEGA,
smsdvb_client_t *client = (smsdvb_client_t *) context;
SmsMsgHdr_ST *phdr = (SmsMsgHdr_ST *)(((u8 *) cb->p) + cb->offset);
- switch(phdr->msgType) {
+ switch (phdr->msgType) {
case MSG_SMS_DVBT_BDA_DATA:
dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1),
cb->size - sizeof(SmsMsgHdr_ST));
SmsMsgStatisticsInfo_ST *p =
(SmsMsgStatisticsInfo_ST *)(phdr + 1);
- if (p->Stat.IsDemodLocked)
- {
+ if (p->Stat.IsDemodLocked) {
client->fe_status = FE_HAS_SIGNAL |
FE_HAS_CARRIER |
FE_HAS_VITERBI |
void smsdvb_unregister_client(smsdvb_client_t *client)
{
- // must be called under clientslock
+ /* must be called under clientslock */
list_del(&client->entry);
printk("%s freq %d band %d\n", __func__,
fep->frequency, fep->u.ofdm.bandwidth);
- switch(fep->u.ofdm.bandwidth)
- {
- case BANDWIDTH_8_MHZ: Msg.Data[1] = BW_8_MHZ; break;
- case BANDWIDTH_7_MHZ: Msg.Data[1] = BW_7_MHZ; break;
- case BANDWIDTH_6_MHZ: Msg.Data[1] = BW_6_MHZ; break;
- case BANDWIDTH_AUTO: return -EOPNOTSUPP;
- default: return -EINVAL;
+ switch (fep->u.ofdm.bandwidth) {
+ case BANDWIDTH_8_MHZ: Msg.Data[1] = BW_8_MHZ; break;
+ case BANDWIDTH_7_MHZ: Msg.Data[1] = BW_7_MHZ; break;
+ case BANDWIDTH_6_MHZ: Msg.Data[1] = BW_6_MHZ; break;
+ case BANDWIDTH_AUTO: return -EOPNOTSUPP;
+ default: return -EINVAL;
}
return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg),
printk("%s\n", __func__);
- // todo:
+ /* todo: */
memcpy(fep, &client->fe_params,
sizeof(struct dvb_frontend_parameters));
return 0;
static void smsdvb_release(struct dvb_frontend *fe)
{
- // do nothing
+ /* do nothing */
}
static struct dvb_frontend_ops smsdvb_fe_ops = {
smsdvb_client_t *client;
int rc;
- // device removal handled by onremove callback
+ /* device removal handled by onremove callback */
if (!arrival)
return 0;
return -ENOMEM;
}
- // register dvb adapter
+ /* register dvb adapter */
rc = dvb_register_adapter(&client->adapter, "Siano Digital Receiver",
THIS_MODULE, device, adapter_nr);
if (rc < 0) {
goto adapter_error;
}
- // init dvb demux
+ /* init dvb demux */
client->demux.dmx.capabilities = DMX_TS_FILTERING;
- client->demux.filternum = 32; // todo: nova ???
+ client->demux.filternum = 32; /* todo: nova ??? */
client->demux.feednum = 32;
client->demux.start_feed = smsdvb_start_feed;
client->demux.stop_feed = smsdvb_stop_feed;
goto dvbdmx_error;
}
- // init dmxdev
+ /* init dmxdev */
client->dmxdev.filternum = 32;
client->dmxdev.demux = &client->demux.dmx;
client->dmxdev.capabilities = 0;
goto dmxdev_error;
}
- // init and register frontend
+ /* init and register frontend */
memcpy(&client->frontend.ops, &smsdvb_fe_ops,
sizeof(struct dvb_frontend_ops));
{
int i;
- for (i = 0; i < MAX_URBS; i ++) {
+ for (i = 0; i < MAX_URBS; i++) {
usb_kill_urb(&dev->surbs[i].urb);
if (dev->surbs[i].cb) {
{
int i, rc;
- for (i = 0; i < MAX_URBS; i ++) {
+ for (i = 0; i < MAX_URBS; i++) {
rc = smsusb_submit_urb(dev, &dev->surbs[i]);
if (rc < 0) {
printk(KERN_INFO "%s smsusb_submit_urb(...) "
if (dev) {
smsusb_stop_streaming(dev);
- // unregister from smscore
+ /* unregister from smscore */
if (dev->coredev)
smscore_unregister_device(dev->coredev);
smsusb_device_t *dev;
int i, rc;
- // create device object
+ /* create device object */
dev = kzalloc(sizeof(smsusb_device_t), GFP_KERNEL);
if (!dev) {
printk(KERN_INFO "%s kzalloc(sizeof(smsusb_device_t) failed\n",
params.setmode_handler = smsusb1_setmode;
params.detectmode_handler = smsusb1_detectmode;
params.device_type = SMS_STELLAR;
- printk(KERN_INFO "%s stellar device found\n", __func__ );
+ printk(KERN_INFO "%s stellar device found\n", __func__);
break;
default:
switch (dev->udev->descriptor.idProduct) {
case USB_PID_NOVA_A:
params.device_type = SMS_NOVA_A0;
- printk(KERN_INFO "%s nova A0 found\n", __func__ );
+ printk(KERN_INFO "%s nova A0 found\n", __func__);
break;
default:
case USB_PID_NOVA_B:
return rc;
}
- // initialize urbs
+ /* initialize urbs */
for (i = 0; i < MAX_URBS; i++) {
dev->surbs[i].dev = dev;
usb_init_urb(&dev->surbs[i].urb);
printk(KERN_INFO "smsusb_probe %d\n",
intf->cur_altsetting->desc.bInterfaceNumber);
- for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i ++)
+ for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++)
printk(KERN_INFO "endpoint %d %02x %02x %d\n", i,
intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
intf->cur_altsetting->endpoint[i].desc.bmAttributes,
{ USB_DEVICE(USB_VID_SIANO, USB_PID_NOVA_A) },
{ } /* Terminating entry */
};
-MODULE_DEVICE_TABLE (usb, smsusb_id_table);
+MODULE_DEVICE_TABLE(usb, smsusb_id_table);
static struct usb_driver smsusb_driver = {
.name = "smsusb",