aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/siano
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-06-15 15:50:11 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:21:40 -0400
commit59bf6b8e85209f4b875e319b42e8f13af7797826 (patch)
tree4e631b408e6c615fb944abfbd12f326bd07c42f4 /drivers/media/dvb/siano
parentfa830e8a014a206103d06a7600ed8c661b427db3 (diff)
V4L/DVB (8283): sms1xxx: 80-column cleanups
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/siano')
-rw-r--r--drivers/media/dvb/siano/smscoreapi.c123
-rw-r--r--drivers/media/dvb/siano/smscoreapi.h156
-rw-r--r--drivers/media/dvb/siano/smsdvb.c3
-rw-r--r--drivers/media/dvb/siano/smsusb.c6
4 files changed, 190 insertions, 98 deletions
diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c
index e8267178c52c..084ddc39c989 100644
--- a/drivers/media/dvb/siano/smscoreapi.c
+++ b/drivers/media/dvb/siano/smscoreapi.c
@@ -309,7 +309,8 @@ int smscore_notify_callbacks(smscore_device_t *coredev, struct device *device,
309 first = &g_smscore_notifyees; 309 first = &g_smscore_notifyees;
310 310
311 for (next = first->next; next != first; next = next->next) { 311 for (next = first->next; next != first; next = next->next) {
312 rc = ((smscore_device_notifyee_t *) next)->hotplug(coredev, device, arrival); 312 rc = ((smscore_device_notifyee_t *) next)->
313 hotplug(coredev, device, arrival);
313 if (rc < 0) 314 if (rc < 0)
314 break; 315 break;
315 } 316 }
@@ -337,7 +338,8 @@ smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer,
337 * creates coredev object for a device, prepares buffers, 338 * creates coredev object for a device, prepares buffers,
338 * creates buffer mappings, notifies registered hotplugs about new device. 339 * creates buffer mappings, notifies registered hotplugs about new device.
339 * 340 *
340 * @param params device pointer to struct with device specific parameters and handlers 341 * @param params device pointer to struct with device specific parameters
342 * and handlers
341 * @param coredev pointer to a value that receives created coredev object 343 * @param coredev pointer to a value that receives created coredev object
342 * 344 *
343 * @return 0 on success, <0 on error. 345 * @return 0 on success, <0 on error.
@@ -387,7 +389,9 @@ int smscore_register_device(smsdevice_params_t *params,
387 for (buffer = dev->common_buffer; 389 for (buffer = dev->common_buffer;
388 dev->num_buffers < params->num_buffers; 390 dev->num_buffers < params->num_buffers;
389 dev->num_buffers++, buffer += params->buffer_size) { 391 dev->num_buffers++, buffer += params->buffer_size) {
390 smscore_buffer_t *cb = smscore_createbuffer(buffer, dev->common_buffer, dev->common_buffer_phys); 392 smscore_buffer_t *cb =
393 smscore_createbuffer(buffer, dev->common_buffer,
394 dev->common_buffer_phys);
391 if (!cb) { 395 if (!cb) {
392 smscore_unregister_device(dev); 396 smscore_unregister_device(dev);
393 return -ENOMEM; 397 return -ENOMEM;
@@ -428,15 +432,18 @@ int smscore_register_device(smsdevice_params_t *params,
428/** 432/**
429 * sets initial device mode and notifies client hotplugs that device is ready 433 * sets initial device mode and notifies client hotplugs that device is ready
430 * 434 *
431 * @param coredev pointer to a coredev object returned by smscore_register_device 435 * @param coredev pointer to a coredev object returned by
436 * smscore_register_device
432 * 437 *
433 * @return 0 on success, <0 on error. 438 * @return 0 on success, <0 on error.
434 */ 439 */
435int smscore_start_device(smscore_device_t *coredev) 440int smscore_start_device(smscore_device_t *coredev)
436{ 441{
437 int rc = smscore_set_device_mode(coredev, smscore_registry_getmode(coredev->devpath)); 442 int rc = smscore_set_device_mode(
443 coredev, smscore_registry_getmode(coredev->devpath));
438 if (rc < 0) { 444 if (rc < 0) {
439 printk(KERN_INFO "%s set device mode faile , rc %d\n", __func__, rc); 445 printk(KERN_INFO "%s set device mode faile , rc %d\n",
446 __func__, rc);
440 return rc; 447 return rc;
441 } 448 }
442 449
@@ -512,9 +519,14 @@ int smscore_load_firmware_family2(smscore_device_t *coredev, void *buffer,
512 519
513 if ((coredev->device_flags & SMS_ROM_NO_RESPONSE) && 520 if ((coredev->device_flags & SMS_ROM_NO_RESPONSE) &&
514 (coredev->mode == DEVICE_MODE_NONE)) 521 (coredev->mode == DEVICE_MODE_NONE))
515 rc = coredev->sendrequest_handler(coredev->context, DataMsg, DataMsg->xMsgHeader.msgLength); 522 rc = coredev->sendrequest_handler(
523 coredev->context, DataMsg,
524 DataMsg->xMsgHeader.msgLength);
516 else 525 else
517 rc = smscore_sendrequest_and_wait(coredev, DataMsg, DataMsg->xMsgHeader.msgLength, &coredev->data_download_done); 526 rc = smscore_sendrequest_and_wait(
527 coredev, DataMsg,
528 DataMsg->xMsgHeader.msgLength,
529 &coredev->data_download_done);
518 530
519 payload += payload_size; 531 payload += payload_size;
520 size -= payload_size; 532 size -= payload_size;
@@ -529,17 +541,23 @@ int smscore_load_firmware_family2(smscore_device_t *coredev, void *buffer,
529 sizeof(SmsMsgHdr_ST) + 541 sizeof(SmsMsgHdr_ST) +
530 sizeof(u32) * 5); 542 sizeof(u32) * 5);
531 543
532 TriggerMsg->msgData[0] = firmware->StartAddress; /* Entry point */ 544 TriggerMsg->msgData[0] = firmware->StartAddress;
545 /* Entry point */
533 TriggerMsg->msgData[1] = 5; /* Priority */ 546 TriggerMsg->msgData[1] = 5; /* Priority */
534 TriggerMsg->msgData[2] = 0x200; /* Stack size */ 547 TriggerMsg->msgData[2] = 0x200; /* Stack size */
535 TriggerMsg->msgData[3] = 0; /* Parameter */ 548 TriggerMsg->msgData[3] = 0; /* Parameter */
536 TriggerMsg->msgData[4] = 4; /* Task ID */ 549 TriggerMsg->msgData[4] = 4; /* Task ID */
537 550
538 if (coredev->device_flags & SMS_ROM_NO_RESPONSE) { 551 if (coredev->device_flags & SMS_ROM_NO_RESPONSE) {
539 rc = coredev->sendrequest_handler(coredev->context, TriggerMsg, TriggerMsg->xMsgHeader.msgLength); 552 rc = coredev->sendrequest_handler(
553 coredev->context, TriggerMsg,
554 TriggerMsg->xMsgHeader.msgLength);
540 msleep(100); 555 msleep(100);
541 } else 556 } else
542 rc = smscore_sendrequest_and_wait(coredev, TriggerMsg, TriggerMsg->xMsgHeader.msgLength, &coredev->trigger_done); 557 rc = smscore_sendrequest_and_wait(
558 coredev, TriggerMsg,
559 TriggerMsg->xMsgHeader.msgLength,
560 &coredev->trigger_done);
543 } else { 561 } else {
544 SMS_INIT_MSG(msg, MSG_SW_RELOAD_EXEC_REQ, 562 SMS_INIT_MSG(msg, MSG_SW_RELOAD_EXEC_REQ,
545 sizeof(SmsMsgHdr_ST)); 563 sizeof(SmsMsgHdr_ST));
@@ -563,7 +581,8 @@ int smscore_load_firmware_family2(smscore_device_t *coredev, void *buffer,
563/** 581/**
564 * loads specified firmware into a buffer and calls device loadfirmware_handler 582 * loads specified firmware into a buffer and calls device loadfirmware_handler
565 * 583 *
566 * @param coredev pointer to a coredev object returned by smscore_register_device 584 * @param coredev pointer to a coredev object returned by
585 * smscore_register_device
567 * @param filename null-terminated string specifies firmware file name 586 * @param filename null-terminated string specifies firmware file name
568 * @param loadfirmware_handler device handler that loads firmware 587 * @param loadfirmware_handler device handler that loads firmware
569 * 588 *
@@ -595,8 +614,11 @@ int smscore_load_firmware_from_file(smscore_device_t *coredev, char *filename,
595 memcpy(fw_buffer, fw->data, fw->size); 614 memcpy(fw_buffer, fw->data, fw->size);
596 615
597 rc = (coredev->device_flags & SMS_DEVICE_FAMILY2) ? 616 rc = (coredev->device_flags & SMS_DEVICE_FAMILY2) ?
598 smscore_load_firmware_family2(coredev, fw_buffer, fw->size) : 617 smscore_load_firmware_family2(coredev,
599 loadfirmware_handler(coredev->context, fw_buffer, fw->size); 618 fw_buffer,
619 fw->size) :
620 loadfirmware_handler(coredev->context,
621 fw_buffer, fw->size);
600 622
601 kfree(fw_buffer); 623 kfree(fw_buffer);
602 } else { 624 } else {
@@ -618,9 +640,11 @@ int smscore_load_firmware_from_buffer(smscore_device_t *coredev, u8 *buffer,
618} 640}
619 641
620/** 642/**
621 * notifies all clients registered with the device, notifies hotplugs, frees all buffers and coredev object 643 * notifies all clients registered with the device, notifies hotplugs,
644 * frees all buffers and coredev object
622 * 645 *
623 * @param coredev pointer to a coredev object returned by smscore_register_device 646 * @param coredev pointer to a coredev object returned by
647 * smscore_register_device
624 * 648 *
625 * @return 0 on success, <0 on error. 649 * @return 0 on success, <0 on error.
626 */ 650 */
@@ -686,13 +710,17 @@ int smscore_detect_mode(smscore_device_t *coredev)
686 rc = smscore_sendrequest_and_wait(coredev, msg, msg->msgLength, 710 rc = smscore_sendrequest_and_wait(coredev, msg, msg->msgLength,
687 &coredev->version_ex_done); 711 &coredev->version_ex_done);
688 if (rc == -ETIME) { 712 if (rc == -ETIME) {
689 printk("%s: MSG_SMS_GET_VERSION_EX_REQ failed first try\n", __func__); 713 printk("%s: MSG_SMS_GET_VERSION_EX_REQ failed first try\n",
714 __func__);
690 715
691 if (wait_for_completion_timeout(&coredev->resume_done, 716 if (wait_for_completion_timeout(&coredev->resume_done,
692 msecs_to_jiffies(5000))) { 717 msecs_to_jiffies(5000))) {
693 rc = smscore_sendrequest_and_wait(coredev, msg, msg->msgLength, &coredev->version_ex_done); 718 rc = smscore_sendrequest_and_wait(
719 coredev, msg, msg->msgLength,
720 &coredev->version_ex_done);
694 if (rc < 0) 721 if (rc < 0)
695 printk("%s: MSG_SMS_GET_VERSION_EX_REQ failed second try, rc %d\n", __func__, rc); 722 printk("%s: MSG_SMS_GET_VERSION_EX_REQ failed "
723 "second try, rc %d\n", __func__, rc);
696 } else 724 } else
697 rc = -ETIME; 725 rc = -ETIME;
698 } 726 }
@@ -719,7 +747,8 @@ char *smscore_fw_lkup[][SMS_NUM_OF_DEVICE_TYPES] = {
719 * calls device handler to change mode of operation 747 * calls device handler to change mode of operation
720 * NOTE: stellar/usb may disconnect when changing mode 748 * NOTE: stellar/usb may disconnect when changing mode
721 * 749 *
722 * @param coredev pointer to a coredev object returned by smscore_register_device 750 * @param coredev pointer to a coredev object returned by
751 * smscore_register_device
723 * @param mode requested mode of operation 752 * @param mode requested mode of operation
724 * 753 *
725 * @return 0 on success, <0 on error. 754 * @return 0 on success, <0 on error.
@@ -757,27 +786,35 @@ int smscore_set_device_mode(smscore_device_t *coredev, int mode)
757 786
758 if (!(coredev->modes_supported & (1 << mode))) { 787 if (!(coredev->modes_supported & (1 << mode))) {
759 type = smscore_registry_gettype(coredev->devpath); 788 type = smscore_registry_gettype(coredev->devpath);
760 rc = smscore_load_firmware_from_file(coredev, smscore_fw_lkup[mode][type], NULL); 789 rc = smscore_load_firmware_from_file(
790 coredev, smscore_fw_lkup[mode][type], NULL);
761 if (rc < 0) { 791 if (rc < 0) {
762 printk(KERN_INFO "%s load firmware failed %d\n", __func__, rc); 792 printk(KERN_INFO "%s load firmware "
793 "failed %d\n", __func__, rc);
763 return rc; 794 return rc;
764 } 795 }
765 } else 796 } else
766 printk(KERN_INFO "%s mode %d supported by running firmware\n", __func__, mode); 797 printk(KERN_INFO "%s mode %d supported by running "
798 "firmware\n", __func__, mode);
767 799
768 buffer = kmalloc(sizeof(SmsMsgData_ST) + SMS_DMA_ALIGNMENT, 800 buffer = kmalloc(sizeof(SmsMsgData_ST) + SMS_DMA_ALIGNMENT,
769 GFP_KERNEL | GFP_DMA); 801 GFP_KERNEL | GFP_DMA);
770 if (buffer) { 802 if (buffer) {
771 SmsMsgData_ST *msg = (SmsMsgData_ST *) SMS_ALIGN_ADDRESS(buffer); 803 SmsMsgData_ST *msg =
804 (SmsMsgData_ST *) SMS_ALIGN_ADDRESS(buffer);
772 805
773 SMS_INIT_MSG(&msg->xMsgHeader, MSG_SMS_INIT_DEVICE_REQ, sizeof(SmsMsgData_ST)); 806 SMS_INIT_MSG(&msg->xMsgHeader, MSG_SMS_INIT_DEVICE_REQ,
807 sizeof(SmsMsgData_ST));
774 msg->msgData[0] = mode; 808 msg->msgData[0] = mode;
775 809
776 rc = smscore_sendrequest_and_wait(coredev, msg, msg->xMsgHeader.msgLength, &coredev->init_device_done); 810 rc = smscore_sendrequest_and_wait(
811 coredev, msg, msg->xMsgHeader.msgLength,
812 &coredev->init_device_done);
777 813
778 kfree(buffer); 814 kfree(buffer);
779 } else { 815 } else {
780 printk(KERN_INFO "%s Could not allocate buffer for init device message.\n", __func__); 816 printk(KERN_INFO "%s Could not allocate buffer for "
817 "init device message.\n", __func__);
781 rc = -ENOMEM; 818 rc = -ENOMEM;
782 } 819 }
783 } else { 820 } else {
@@ -810,7 +847,8 @@ int smscore_set_device_mode(smscore_device_t *coredev, int mode)
810/** 847/**
811 * calls device handler to get current mode of operation 848 * calls device handler to get current mode of operation
812 * 849 *
813 * @param coredev pointer to a coredev object returned by smscore_register_device 850 * @param coredev pointer to a coredev object returned by
851 * smscore_register_device
814 * 852 *
815 * @return current mode 853 * @return current mode
816 */ 854 */
@@ -823,12 +861,14 @@ int smscore_get_device_mode(smscore_device_t *coredev)
823 * find client by response id & type within the clients list. 861 * find client by response id & type within the clients list.
824 * return client handle or NULL. 862 * return client handle or NULL.
825 * 863 *
826 * @param coredev pointer to a coredev object returned by smscore_register_device 864 * @param coredev pointer to a coredev object returned by
865 * smscore_register_device
827 * @param data_type client data type (SMS_DONT_CARE for all types) 866 * @param data_type client data type (SMS_DONT_CARE for all types)
828 * @param id client id (SMS_DONT_CARE for all id) 867 * @param id client id (SMS_DONT_CARE for all id)
829 * 868 *
830 */ 869 */
831smscore_client_t *smscore_find_client(smscore_device_t *coredev, int data_type, int id) 870smscore_client_t *smscore_find_client(smscore_device_t *coredev,
871 int data_type, int id)
832{ 872{
833 smscore_client_t *client = NULL; 873 smscore_client_t *client = NULL;
834 struct list_head *next, *first; 874 struct list_head *next, *first;
@@ -861,15 +901,16 @@ smscore_client_t *smscore_find_client(smscore_device_t *coredev, int data_type,
861 * find client by response id/type, call clients onresponse handler 901 * find client by response id/type, call clients onresponse handler
862 * return buffer to pool on error 902 * return buffer to pool on error
863 * 903 *
864 * @param coredev pointer to a coredev object returned by smscore_register_device 904 * @param coredev pointer to a coredev object returned by
905 * smscore_register_device
865 * @param cb pointer to response buffer descriptor 906 * @param cb pointer to response buffer descriptor
866 * 907 *
867 */ 908 */
868void smscore_onresponse(smscore_device_t *coredev, smscore_buffer_t *cb) 909void smscore_onresponse(smscore_device_t *coredev, smscore_buffer_t *cb)
869{ 910{
870 SmsMsgHdr_ST *phdr = (SmsMsgHdr_ST *)((u8 *) cb->p + cb->offset); 911 SmsMsgHdr_ST *phdr = (SmsMsgHdr_ST *)((u8 *) cb->p + cb->offset);
871 smscore_client_t *client = smscore_find_client(coredev, phdr->msgType, 912 smscore_client_t *client =
872 phdr->msgDstId); 913 smscore_find_client(coredev, phdr->msgType, phdr->msgDstId);
873 int rc = -EBUSY; 914 int rc = -EBUSY;
874 915
875 static unsigned long last_sample_time = 0; 916 static unsigned long last_sample_time = 0;
@@ -943,7 +984,8 @@ void smscore_onresponse(smscore_device_t *coredev, smscore_buffer_t *cb)
943/** 984/**
944 * return pointer to next free buffer descriptor from core pool 985 * return pointer to next free buffer descriptor from core pool
945 * 986 *
946 * @param coredev pointer to a coredev object returned by smscore_register_device 987 * @param coredev pointer to a coredev object returned by
988 * smscore_register_device
947 * 989 *
948 * @return pointer to descriptor on success, NULL on error. 990 * @return pointer to descriptor on success, NULL on error.
949 */ 991 */
@@ -967,7 +1009,8 @@ smscore_buffer_t *smscore_getbuffer(smscore_device_t *coredev)
967/** 1009/**
968 * return buffer descriptor to a pool 1010 * return buffer descriptor to a pool
969 * 1011 *
970 * @param coredev pointer to a coredev object returned by smscore_register_device 1012 * @param coredev pointer to a coredev object returned by
1013 * smscore_register_device
971 * @param cb pointer buffer descriptor 1014 * @param cb pointer buffer descriptor
972 * 1015 *
973 */ 1016 */
@@ -1019,7 +1062,9 @@ int smscore_validate_client(smscore_device_t *coredev,
1019 * 1062 *
1020 * @return 0 on success, <0 on error. 1063 * @return 0 on success, <0 on error.
1021 */ 1064 */
1022int smscore_register_client(smscore_device_t *coredev, smsclient_params_t *params, smscore_client_t **client) 1065int smscore_register_client(smscore_device_t *coredev,
1066 smsclient_params_t *params,
1067 smscore_client_t **client)
1023{ 1068{
1024 smscore_client_t *newclient; 1069 smscore_client_t *newclient;
1025 /* check that no other channel with same parameters exists */ 1070 /* check that no other channel with same parameters exists */
@@ -1054,7 +1099,8 @@ int smscore_register_client(smscore_device_t *coredev, smsclient_params_t *param
1054/** 1099/**
1055 * frees smsclient object and all subclients associated with it 1100 * frees smsclient object and all subclients associated with it
1056 * 1101 *
1057 * @param client pointer to smsclient object returned by smscore_register_client 1102 * @param client pointer to smsclient object returned by
1103 * smscore_register_client
1058 * 1104 *
1059 */ 1105 */
1060void smscore_unregister_client(smscore_client_t *client) 1106void smscore_unregister_client(smscore_client_t *client)
@@ -1084,7 +1130,8 @@ void smscore_unregister_client(smscore_client_t *client)
1084 * verifies that source id is not taken by another client, 1130 * verifies that source id is not taken by another client,
1085 * calls device handler to send requests to the device 1131 * calls device handler to send requests to the device
1086 * 1132 *
1087 * @param client pointer to smsclient object returned by smscore_register_client 1133 * @param client pointer to smsclient object returned by
1134 * smscore_register_client
1088 * @param buffer pointer to a request buffer 1135 * @param buffer pointer to a request buffer
1089 * @param size size (in bytes) of request buffer 1136 * @param size size (in bytes) of request buffer
1090 * 1137 *
diff --git a/drivers/media/dvb/siano/smscoreapi.h b/drivers/media/dvb/siano/smscoreapi.h
index 4860e318a5b8..2a823b37ccf7 100644
--- a/drivers/media/dvb/siano/smscoreapi.h
+++ b/drivers/media/dvb/siano/smscoreapi.h
@@ -50,7 +50,8 @@ typedef struct mutex kmutex_t;
50 50
51#define SMS_ALLOC_ALIGNMENT 128 51#define SMS_ALLOC_ALIGNMENT 128
52#define SMS_DMA_ALIGNMENT 16 52#define SMS_DMA_ALIGNMENT 16
53#define SMS_ALIGN_ADDRESS(addr) ((((u32)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1)) 53#define SMS_ALIGN_ADDRESS(addr) \
54 ((((u32)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1))
54 55
55#define SMS_DEVICE_FAMILY2 1 56#define SMS_DEVICE_FAMILY2 1
56#define SMS_ROM_NO_RESPONSE 2 57#define SMS_ROM_NO_RESPONSE 2
@@ -68,7 +69,8 @@ typedef struct _smscore_device smscore_device_t;
68typedef struct _smscore_client smscore_client_t; 69typedef struct _smscore_client smscore_client_t;
69typedef struct _smscore_buffer smscore_buffer_t; 70typedef struct _smscore_buffer smscore_buffer_t;
70 71
71typedef int (*hotplug_t)(smscore_device_t *coredev, struct device *device, int arrival); 72typedef int (*hotplug_t)(smscore_device_t *coredev,
73 struct device *device, int arrival);
72 74
73typedef int (*setmode_t)(void *context, int mode); 75typedef int (*setmode_t)(void *context, int mode);
74typedef void (*detectmode_t)(void *context, int *mode); 76typedef void (*detectmode_t)(void *context, int *mode);
@@ -196,7 +198,8 @@ typedef struct _smsclient_params
196 (ptr)->msgType = type; (ptr)->msgSrcId = src; (ptr)->msgDstId = dst; \ 198 (ptr)->msgType = type; (ptr)->msgSrcId = src; (ptr)->msgDstId = dst; \
197 (ptr)->msgLength = len; (ptr)->msgFlags = 0; \ 199 (ptr)->msgLength = len; (ptr)->msgFlags = 0; \
198} while (0) 200} while (0)
199#define SMS_INIT_MSG(ptr, type, len) SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len) 201#define SMS_INIT_MSG(ptr, type, len) \
202 SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len)
200 203
201typedef enum 204typedef enum
202{ 205{
@@ -243,8 +246,11 @@ typedef struct SmsVersionRes_S
243 u8 Step; /* 0 - Step A */ 246 u8 Step; /* 0 - Step A */
244 u8 MetalFix; /* 0 - Metal 0 */ 247 u8 MetalFix; /* 0 - Metal 0 */
245 248
246 u8 FirmwareId; /* 0xFF � ROM, otherwise the value indicated by SMSHOSTLIB_DEVICE_MODES_E */ 249 u8 FirmwareId; /* 0xFF � ROM, otherwise the
247 u8 SupportedProtocols; /* Bitwise OR combination of supported protocols */ 250 * value indicated by
251 * SMSHOSTLIB_DEVICE_MODES_E */
252 u8 SupportedProtocols; /* Bitwise OR combination of
253 * supported protocols */
248 254
249 u8 VersionMajor; 255 u8 VersionMajor;
250 u8 VersionMinor; 256 u8 VersionMinor;
@@ -280,36 +286,44 @@ typedef struct SMSHOSTLIB_STATISTICS_S
280 s32 SNR; /* dB */ 286 s32 SNR; /* dB */
281 u32 BER; /* Post Viterbi BER [1E-5] */ 287 u32 BER; /* Post Viterbi BER [1E-5] */
282 u32 FIB_CRC; /* CRC errors percentage, valid only for DAB */ 288 u32 FIB_CRC; /* CRC errors percentage, valid only for DAB */
283 u32 TS_PER; /* Transport stream PER, 0xFFFFFFFF indicate N/A, valid only for DVB-T/H */ 289 u32 TS_PER; /* Transport stream PER, 0xFFFFFFFF indicate N/A,
284 u32 MFER; /* DVB-H frame error rate in percentage, 0xFFFFFFFF indicate N/A, valid only for DVB-H */ 290 * valid only for DVB-T/H */
291 u32 MFER; /* DVB-H frame error rate in percentage,
292 * 0xFFFFFFFF indicate N/A, valid only for DVB-H */
285 s32 RSSI; /* dBm */ 293 s32 RSSI; /* dBm */
286 s32 InBandPwr; /* In band power in dBM */ 294 s32 InBandPwr; /* In band power in dBM */
287 s32 CarrierOffset; /* Carrier Offset in bin/1024 */ 295 s32 CarrierOffset; /* Carrier Offset in bin/1024 */
288 296
289 /* Transmission parameters */ 297 /* Transmission parameters, valid only for DVB-T/H */
290 u32 Frequency; /* Frequency in Hz */ 298 u32 Frequency; /* Frequency in Hz */
291 u32 Bandwidth; /* Bandwidth in MHz, valid only for DVB-T/H */ 299 u32 Bandwidth; /* Bandwidth in MHz */
292 u32 TransmissionMode; /* Transmission Mode, for DAB modes 1-4, for DVB-T/H FFT mode carriers in Kilos */ 300 u32 TransmissionMode; /* Transmission Mode, for DAB modes 1-4,
293 u32 ModemState; /* from SMS_DvbModemState_ET , valid only for DVB-T/H */ 301 * for DVB-T/H FFT mode carriers in Kilos */
294 u32 GuardInterval; /* Guard Interval, 1 divided by value , valid only for DVB-T/H */ 302 u32 ModemState; /* from SMS_DvbModemState_ET */
295 u32 CodeRate; /* Code Rate from SMS_DvbModemState_ET, valid only for DVB-T/H */ 303 u32 GuardInterval; /* Guard Interval, 1 divided by value */
296 u32 LPCodeRate; /* Low Priority Code Rate from SMS_DvbModemState_ET, valid only for DVB-T/H */ 304 u32 CodeRate; /* Code Rate from SMS_DvbModemState_ET */
297 u32 Hierarchy; /* Hierarchy from SMS_Hierarchy_ET, valid only for DVB-T/H */ 305 u32 LPCodeRate; /* Low Priority Code Rate from SMS_DvbModemState_ET */
298 u32 Constellation; /* Constellation from SMS_Constellation_ET, valid only for DVB-T/H */ 306 u32 Hierarchy; /* Hierarchy from SMS_Hierarchy_ET */
307 u32 Constellation; /* Constellation from SMS_Constellation_ET */
299 308
300 /* Burst parameters, valid only for DVB-H */ 309 /* Burst parameters, valid only for DVB-H */
301 u32 BurstSize; /* Current burst size in bytes, valid only for DVB-H */ 310 u32 BurstSize; /* Current burst size in bytes */
302 u32 BurstDuration; /* Current burst duration in mSec, valid only for DVB-H */ 311 u32 BurstDuration; /* Current burst duration in mSec */
303 u32 BurstCycleTime; /* Current burst cycle time in mSec, valid only for DVB-H */ 312 u32 BurstCycleTime; /* Current burst cycle time in mSec */
304 u32 CalculatedBurstCycleTime; /* Current burst cycle time in mSec, as calculated by demodulator, valid only for DVB-H */ 313 u32 CalculatedBurstCycleTime; /* Current burst cycle time in mSec,
305 u32 NumOfRows; /* Number of rows in MPE table, valid only for DVB-H */ 314 * as calculated by demodulator */
306 u32 NumOfPaddCols; /* Number of padding columns in MPE table, valid only for DVB-H */ 315 u32 NumOfRows; /* Number of rows in MPE table */
307 u32 NumOfPunctCols; /* Number of puncturing columns in MPE table, valid only for DVB-H */ 316 u32 NumOfPaddCols; /* Number of padding columns in MPE table */
317 u32 NumOfPunctCols; /* Number of puncturing columns in MPE table */
318 /* Burst parameters */
308 u32 ErrorTSPackets; /* Number of erroneous transport-stream packets */ 319 u32 ErrorTSPackets; /* Number of erroneous transport-stream packets */
309 u32 TotalTSPackets; /* Total number of transport-stream packets */ 320 u32 TotalTSPackets; /* Total number of transport-stream packets */
310 u32 NumOfValidMpeTlbs; /* Number of MPE tables which do not include errors after MPE RS decoding */ 321 u32 NumOfValidMpeTlbs; /* Number of MPE tables which do not include
311 u32 NumOfInvalidMpeTlbs; /* Number of MPE tables which include errors after MPE RS decoding */ 322 * errors after MPE RS decoding */
312 u32 NumOfCorrectedMpeTlbs; /* Number of MPE tables which were corrected by MPE RS decoding */ 323 u32 NumOfInvalidMpeTlbs; /* Number of MPE tables which include errors
324 * after MPE RS decoding */
325 u32 NumOfCorrectedMpeTlbs; /* Number of MPE tables which were corrected
326 * by MPE RS decoding */
313 327
314 /* Common params */ 328 /* Common params */
315 u32 BERErrorCount; /* Number of errornous SYNC bits. */ 329 u32 BERErrorCount; /* Number of errornous SYNC bits. */
@@ -322,7 +336,8 @@ typedef struct SMSHOSTLIB_STATISTICS_S
322 u32 PreBER; /* DAB/T-DMB only: Pre Viterbi BER [1E-5] */ 336 u32 PreBER; /* DAB/T-DMB only: Pre Viterbi BER [1E-5] */
323 337
324 /* DVB-H TPS parameters */ 338 /* DVB-H TPS parameters */
325 u32 CellId; /* TPS Cell ID in bits 15..0, bits 31..16 zero; if set to 0xFFFFFFFF cell_id not yet recovered */ 339 u32 CellId; /* TPS Cell ID in bits 15..0, bits 31..16 zero;
340 * if set to 0xFFFFFFFF cell_id not yet recovered */
326 341
327} SMSHOSTLIB_STATISTICS_ST; 342} SMSHOSTLIB_STATISTICS_ST;
328 343
@@ -341,8 +356,10 @@ typedef struct
341typedef struct SMSHOSTLIB_ISDBT_LAYER_STAT_S 356typedef struct SMSHOSTLIB_ISDBT_LAYER_STAT_S
342{ 357{
343 /* Per-layer information */ 358 /* Per-layer information */
344 u32 CodeRate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET, 255 means layer does not exist */ 359 u32 CodeRate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET,
345 u32 Constellation; /* Constellation from SMSHOSTLIB_CONSTELLATION_ET, 255 means layer does not exist */ 360 * 255 means layer does not exist */
361 u32 Constellation; /* Constellation from SMSHOSTLIB_CONSTELLATION_ET,
362 * 255 means layer does not exist */
346 u32 BER; /* Post Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A */ 363 u32 BER; /* Post Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A */
347 u32 BERErrorCount; /* Post Viterbi Error Bits Count */ 364 u32 BERErrorCount; /* Post Viterbi Error Bits Count */
348 u32 BERBitCount; /* Post Viterbi Total Bits Count */ 365 u32 BERBitCount; /* Post Viterbi Total Bits Count */
@@ -350,8 +367,10 @@ typedef struct SMSHOSTLIB_ISDBT_LAYER_STAT_S
350 u32 TS_PER; /* Transport stream PER [%], 0xFFFFFFFF indicate N/A */ 367 u32 TS_PER; /* Transport stream PER [%], 0xFFFFFFFF indicate N/A */
351 u32 ErrorTSPackets; /* Number of erroneous transport-stream packets */ 368 u32 ErrorTSPackets; /* Number of erroneous transport-stream packets */
352 u32 TotalTSPackets; /* Total number of transport-stream packets */ 369 u32 TotalTSPackets; /* Total number of transport-stream packets */
353 u32 TILdepthI; /* Time interleaver depth I parameter, 255 means layer does not exist */ 370 u32 TILdepthI; /* Time interleaver depth I parameter,
354 u32 NumberOfSegments; /* Number of segments in layer A, 255 means layer does not exist */ 371 * 255 means layer does not exist */
372 u32 NumberOfSegments; /* Number of segments in layer A,
373 * 255 means layer does not exist */
355 u32 TMCCErrors; /* TMCC errors */ 374 u32 TMCCErrors; /* TMCC errors */
356} SMSHOSTLIB_ISDBT_LAYER_STAT_ST; 375} SMSHOSTLIB_ISDBT_LAYER_STAT_ST;
357 376
@@ -364,8 +383,9 @@ typedef struct SMSHOSTLIB_STATISTICS_ISDBT_S
364 * This field MUST always be first in any 383 * This field MUST always be first in any
365 * statistics structure */ 384 * statistics structure */
366 385
367 u32 FullSize; /* Total size of the structure returned by the modem. If the size requested by 386 u32 FullSize; /* Total size of the structure returned by the modem.
368 * the host is smaller than FullSize, the struct will be truncated */ 387 * If the size requested by the host is smaller than
388 * FullSize, the struct will be truncated */
369 389
370 /* Common parameters */ 390 /* Common parameters */
371 u32 IsRfLocked; /* 0 - not locked, 1 - locked */ 391 u32 IsRfLocked; /* 0 - not locked, 1 - locked */
@@ -390,7 +410,8 @@ typedef struct SMSHOSTLIB_STATISTICS_ISDBT_S
390 410
391 /* Per-layer information */ 411 /* Per-layer information */
392 /* Layers A, B and C */ 412 /* Layers A, B and C */
393 SMSHOSTLIB_ISDBT_LAYER_STAT_ST LayerInfo[3]; /* Per-layer statistics, see SMSHOSTLIB_ISDBT_LAYER_STAT_ST */ 413 SMSHOSTLIB_ISDBT_LAYER_STAT_ST LayerInfo[3]; /* Per-layer statistics,
414 see SMSHOSTLIB_ISDBT_LAYER_STAT_ST */
394 415
395 /* Interface information */ 416 /* Interface information */
396 u32 SmsToHostTxErrors; /* Total number of transmission errors. */ 417 u32 SmsToHostTxErrors; /* Total number of transmission errors. */
@@ -399,11 +420,15 @@ typedef struct SMSHOSTLIB_STATISTICS_ISDBT_S
399 420
400typedef struct SMSHOSTLIB_STATISTICS_DVB_S 421typedef struct SMSHOSTLIB_STATISTICS_DVB_S
401{ 422{
402 u32 StatisticsType; /* Enumerator identifying the type of the structure. Values are the same as SMSHOSTLIB_DEVICE_MODES_E 423 u32 StatisticsType; /* Enumerator identifying the type of the
403 * This fiels MUST always first in any statistics structure */ 424 * structure. Values are the same as
404 425 * SMSHOSTLIB_DEVICE_MODES_E
405 u32 FullSize; /* Total size of the structure returned by the modem. If the size requested by 426 * This field MUST always first in any
406 * the host is smaller than FullSize, the struct will be truncated */ 427 * statistics structure */
428
429 u32 FullSize; /* Total size of the structure returned by the modem.
430 * If the size requested by the host is smaller than
431 * FullSize, the struct will be truncated */
407 /* Common parameters */ 432 /* Common parameters */
408 u32 IsRfLocked; /* 0 - not locked, 1 - locked */ 433 u32 IsRfLocked; /* 0 - not locked, 1 - locked */
409 u32 IsDemodLocked; /* 0 - not locked, 1 - locked */ 434 u32 IsDemodLocked; /* 0 - not locked, 1 - locked */
@@ -415,7 +440,8 @@ typedef struct SMSHOSTLIB_STATISTICS_DVB_S
415 u32 BERErrorCount; /* Number of errornous SYNC bits. */ 440 u32 BERErrorCount; /* Number of errornous SYNC bits. */
416 u32 BERBitCount; /* Total number of SYNC bits. */ 441 u32 BERBitCount; /* Total number of SYNC bits. */
417 u32 TS_PER; /* Transport stream PER, 0xFFFFFFFF indicate N/A */ 442 u32 TS_PER; /* Transport stream PER, 0xFFFFFFFF indicate N/A */
418 u32 MFER; /* DVB-H frame error rate in percentage, 0xFFFFFFFF indicate N/A, valid only for DVB-H */ 443 u32 MFER; /* DVB-H frame error rate in percentage,
444 * 0xFFFFFFFF indicate N/A, valid only for DVB-H */
419 s32 RSSI; /* dBm */ 445 s32 RSSI; /* dBm */
420 s32 InBandPwr; /* In band power in dBM */ 446 s32 InBandPwr; /* In band power in dBM */
421 s32 CarrierOffset; /* Carrier Offset in bin/1024 */ 447 s32 CarrierOffset; /* Carrier Offset in bin/1024 */
@@ -427,29 +453,41 @@ typedef struct SMSHOSTLIB_STATISTICS_DVB_S
427 u32 TransmissionMode; /* FFT mode carriers in Kilos */ 453 u32 TransmissionMode; /* FFT mode carriers in Kilos */
428 u32 GuardInterval; /* Guard Interval, 1 divided by value */ 454 u32 GuardInterval; /* Guard Interval, 1 divided by value */
429 u32 CodeRate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET */ 455 u32 CodeRate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET */
430 u32 LPCodeRate; /* Low Priority Code Rate from SMSHOSTLIB_CODE_RATE_ET */ 456 u32 LPCodeRate; /* Low Priority Code Rate from
457 * SMSHOSTLIB_CODE_RATE_ET */
431 u32 Hierarchy; /* Hierarchy from SMSHOSTLIB_HIERARCHY_ET */ 458 u32 Hierarchy; /* Hierarchy from SMSHOSTLIB_HIERARCHY_ET */
432 u32 Constellation; /* Constellation from SMSHOSTLIB_CONSTELLATION_ET */ 459 u32 Constellation; /* Constellation from SMSHOSTLIB_CONSTELLATION_ET */
433 460
434 /* Burst parameters, valid only for DVB-H */ 461 /* Burst parameters, valid only for DVB-H */
435 u32 BurstSize; /* Current burst size in bytes, valid only for DVB-H */ 462 u32 BurstSize; /* Current burst size in bytes */
436 u32 BurstDuration; /* Current burst duration in mSec, valid only for DVB-H */ 463 u32 BurstDuration; /* Current burst duration in mSec */
437 u32 BurstCycleTime; /* Current burst cycle time in mSec, valid only for DVB-H */ 464 u32 BurstCycleTime; /* Current burst cycle time in mSec */
438 u32 CalculatedBurstCycleTime; /* Current burst cycle time in mSec, as calculated by demodulator, valid only for DVB-H */ 465 u32 CalculatedBurstCycleTime; /* Current burst cycle time in mSec,
439 u32 NumOfRows; /* Number of rows in MPE table, valid only for DVB-H */ 466 * as calculated by demodulator */
440 u32 NumOfPaddCols; /* Number of padding columns in MPE table, valid only for DVB-H */ 467 u32 NumOfRows; /* Number of rows in MPE table */
441 u32 NumOfPunctCols; /* Number of puncturing columns in MPE table, valid only for DVB-H */ 468 u32 NumOfPaddCols; /* Number of padding columns in MPE table */
469 u32 NumOfPunctCols; /* Number of puncturing columns in MPE table */
470
442 u32 ErrorTSPackets; /* Number of erroneous transport-stream packets */ 471 u32 ErrorTSPackets; /* Number of erroneous transport-stream packets */
443 u32 TotalTSPackets; /* Total number of transport-stream packets */ 472 u32 TotalTSPackets; /* Total number of transport-stream packets */
444 u32 NumOfValidMpeTlbs; /* Number of MPE tables which do not include errors after MPE RS decoding, valid only for DVB-H */ 473
445 u32 NumOfInvalidMpeTlbs; /* Number of MPE tables which include errors after MPE RS decoding, valid only for DVB-H */ 474 u32 NumOfValidMpeTlbs; /* Number of MPE tables which do not include
446 u32 NumOfCorrectedMpeTlbs; /* Number of MPE tables which were corrected by MPE RS decoding, valid only for DVB-H */ 475 * errors after MPE RS decoding */
476 u32 NumOfInvalidMpeTlbs; /* Number of MPE tables which include
477 * errors after MPE RS decoding */
478 u32 NumOfCorrectedMpeTlbs; /* Number of MPE tables which were
479 * corrected by MPE RS decoding */
480
447 u32 NumMPEReceived; /* DVB-H, Num MPE section received */ 481 u32 NumMPEReceived; /* DVB-H, Num MPE section received */
448 482
449 /* DVB-H TPS parameters */ 483 /* DVB-H TPS parameters */
450 u32 CellId; /* TPS Cell ID in bits 15..0, bits 31..16 zero; if set to 0xFFFFFFFF cell_id not yet recovered */ 484 u32 CellId; /* TPS Cell ID in bits 15..0, bits 31..16 zero; if set to 0xFFFFFFFF cell_id not yet recovered */
451 u32 DvbhSrvIndHP; /* DVB-H service indication info, bit 1 - Time Slicing indicator, bit 0 - MPE-FEC indicator */ 485 u32 DvbhSrvIndHP; /* DVB-H service indication info,
452 u32 DvbhSrvIndLP; /* DVB-H service indication info, bit 1 - Time Slicing indicator, bit 0 - MPE-FEC indicator */ 486 * bit 1 - Time Slicing indicator,
487 * bit 0 - MPE-FEC indicator */
488 u32 DvbhSrvIndLP; /* DVB-H service indication info,
489 * bit 1 - Time Slicing indicator,
490 * bit 0 - MPE-FEC indicator */
453 491
454 /* Interface information */ 492 /* Interface information */
455 u32 SmsToHostTxErrors; /* Total number of transmission errors. */ 493 u32 SmsToHostTxErrors; /* Total number of transmission errors. */
@@ -459,10 +497,14 @@ typedef struct SMSHOSTLIB_STATISTICS_DVB_S
459typedef struct SMSHOSTLIB_GPIO_CONFIG_S 497typedef struct SMSHOSTLIB_GPIO_CONFIG_S
460{ 498{
461 u8 Direction; /* GPIO direction: Input - 0, Output - 1 */ 499 u8 Direction; /* GPIO direction: Input - 0, Output - 1 */
462 u8 PullUpDown; /* PullUp/PullDown: None - 0, PullDown - 1, PullUp - 2, Keeper - 3 */ 500 u8 PullUpDown; /* PullUp/PullDown: None - 0,
463 u8 InputCharacteristics; /* Input Characteristics: Normal - 0, Schmitt trigger - 1 */ 501 * PullDown - 1, PullUp - 2, Keeper - 3 */
464 u8 OutputSlewRate; /* Output Slew Rate: Fast slew rate - 0, Slow slew rate - 1 */ 502 u8 InputCharacteristics; /* Input Characteristics: Normal - 0,
465 u8 OutputDriving; /* Output driving capability: 4mA - 0, 8mA - 1, 12mA - 2, 16mA - 3 */ 503 * Schmitt trigger - 1 */
504 u8 OutputSlewRate; /* Output Slew Rate:
505 * Fast slew rate - 0, Slow slew rate - 1 */
506 u8 OutputDriving; /* Output driving capability:
507 * 4mA - 0, 8mA - 1, 12mA - 2, 16mA - 3 */
466} SMSHOSTLIB_GPIO_CONFIG_ST; 508} SMSHOSTLIB_GPIO_CONFIG_ST;
467 509
468typedef struct SMSHOSTLIB_I2C_REQ_S 510typedef struct SMSHOSTLIB_I2C_REQ_S
diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c
index e3f09646bb81..f46e7facdb6b 100644
--- a/drivers/media/dvb/siano/smsdvb.c
+++ b/drivers/media/dvb/siano/smsdvb.c
@@ -313,7 +313,8 @@ int smsdvb_hotplug(smscore_device_t *coredev,
313 return 0; 313 return 0;
314 314
315 if (smscore_get_device_mode(coredev) != 4) { 315 if (smscore_get_device_mode(coredev) != 4) {
316 printk(KERN_ERR "%sSMS Device mode is not set for DVB operation.\n", __func__); 316 printk(KERN_ERR "%sSMS Device mode is not set for "
317 "DVB operation.\n", __func__);
317 return 0; 318 return 0;
318 } 319 }
319 320
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index 2361f1a5e3c4..102c5857a23d 100644
--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -395,7 +395,8 @@ int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
395 rc = usb_clear_halt(udev, usb_rcvbulkpipe(udev, 0x02)); 395 rc = usb_clear_halt(udev, usb_rcvbulkpipe(udev, 0x02));
396 396
397 if (intf->num_altsetting > 0) { 397 if (intf->num_altsetting > 0) {
398 rc = usb_set_interface(udev, intf->cur_altsetting->desc.bInterfaceNumber, 0); 398 rc = usb_set_interface(
399 udev, intf->cur_altsetting->desc.bInterfaceNumber, 0);
399 if (rc < 0) { 400 if (rc < 0) {
400 printk(KERN_INFO "%s usb_set_interface failed, " 401 printk(KERN_INFO "%s usb_set_interface failed, "
401 "rc %d\n", __func__, rc); 402 "rc %d\n", __func__, rc);
@@ -421,7 +422,8 @@ int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
421 snprintf(devpath, sizeof(devpath), "usb\\%d-%s", 422 snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
422 udev->bus->busnum, udev->devpath); 423 udev->bus->busnum, udev->devpath);
423 printk(KERN_INFO "stellar device was found.\n"); 424 printk(KERN_INFO "stellar device was found.\n");
424 return smsusb1_load_firmware(udev, smscore_registry_getmode(devpath)); 425 return smsusb1_load_firmware(
426 udev, smscore_registry_getmode(devpath));
425 } 427 }
426 428
427 rc = smsusb_init_device(intf); 429 rc = smsusb_init_device(intf);