ca.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * ca.h
  3. *
  4. * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
  5. * & Marcus Metzler <marcus@convergence.de>
  6. * for convergence integrated media GmbH
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Lesser Public License
  10. * as published by the Free Software Foundation; either version 2.1
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. *
  22. */
  23. #ifndef _DVBCA_H_
  24. #define _DVBCA_H_
  25. /* slot interface types and info */
  26. typedef struct ca_slot_info {
  27. int num; /* slot number */
  28. int type; /* CA interface this slot supports */
  29. #define CA_CI 1 /* CI high level interface */
  30. #define CA_CI_LINK 2 /* CI link layer level interface */
  31. #define CA_CI_PHYS 4 /* CI physical layer level interface */
  32. #define CA_DESCR 8 /* built-in descrambler */
  33. #define CA_SC 128 /* simple smart card interface */
  34. unsigned int flags;
  35. #define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
  36. #define CA_CI_MODULE_READY 2
  37. } ca_slot_info_t;
  38. /* descrambler types and info */
  39. typedef struct ca_descr_info {
  40. unsigned int num; /* number of available descramblers (keys) */
  41. unsigned int type; /* type of supported scrambling system */
  42. #define CA_ECD 1
  43. #define CA_NDS 2
  44. #define CA_DSS 4
  45. } ca_descr_info_t;
  46. typedef struct ca_caps {
  47. unsigned int slot_num; /* total number of CA card and module slots */
  48. unsigned int slot_type; /* OR of all supported types */
  49. unsigned int descr_num; /* total number of descrambler slots (keys) */
  50. unsigned int descr_type; /* OR of all supported types */
  51. } ca_caps_t;
  52. /* a message to/from a CI-CAM */
  53. typedef struct ca_msg {
  54. unsigned int index;
  55. unsigned int type;
  56. unsigned int length;
  57. unsigned char msg[256];
  58. } ca_msg_t;
  59. typedef struct ca_descr {
  60. unsigned int index;
  61. unsigned int parity; /* 0 == even, 1 == odd */
  62. unsigned char cw[8];
  63. } ca_descr_t;
  64. typedef struct ca_pid {
  65. unsigned int pid;
  66. int index; /* -1 == disable*/
  67. } ca_pid_t;
  68. #define CA_RESET _IO('o', 128)
  69. #define CA_GET_CAP _IOR('o', 129, ca_caps_t)
  70. #define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t)
  71. #define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
  72. #define CA_GET_MSG _IOR('o', 132, ca_msg_t)
  73. #define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
  74. #define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
  75. #define CA_SET_PID _IOW('o', 135, ca_pid_t)
  76. #endif