100-compat.patch 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. --- a/src/drv_mei_cpe_common.c
  2. +++ b/src/drv_mei_cpe_common.c
  3. @@ -19,7 +19,6 @@
  4. /* get at first the driver configuration */
  5. #include "drv_mei_cpe_config.h"
  6. -#include "ifx_types.h"
  7. #include "drv_mei_cpe_os.h"
  8. #include "drv_mei_cpe_dbg.h"
  9. --- a/src/drv_mei_cpe_linux.h
  10. +++ b/src/drv_mei_cpe_linux.h
  11. @@ -51,12 +51,6 @@
  12. #include <linux/poll.h>
  13. #include <linux/types.h>
  14. -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
  15. - #include <asm/ifx/ifx_types.h>
  16. -#else
  17. - #include <ifx_types.h>
  18. -#endif
  19. -
  20. #endif /* #if (MEI_DRV_IFXOS_ENABLE == 0)*/
  21. /* ============================================================================
  22. --- a/src/drv_mei_cpe_linux.c
  23. +++ b/src/drv_mei_cpe_linux.c
  24. @@ -98,6 +98,8 @@
  25. #include "drv_mei_cpe_api_atm_ptm_intern.h"
  26. +#include <lantiq_soc.h>
  27. +
  28. /* ===================================
  29. extern function declarations
  30. =================================== */
  31. @@ -196,6 +198,8 @@ static void MEI_MemVAllocTest();
  32. /* Local variables (LINUX) */
  33. /* =================================== */
  34. static IFX_uint8_t major_number = 0;
  35. +static struct class *mei_class;
  36. +static dev_t mei_devt;
  37. #ifdef MODULE
  38. #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
  39. MODULE_PARM(major_number, "b");
  40. @@ -1798,7 +1802,9 @@ static int __init MEI_module_init (void)
  41. return (result);
  42. }
  43. +#if 0
  44. ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)ltq_mei_atm_showtime_check);
  45. +#endif
  46. return 0;
  47. }
  48. @@ -1922,6 +1928,10 @@ static void MEI_module_exit (void)
  49. #else
  50. unregister_chrdev ( major_number , DRV_MEI_NAME );
  51. + device_destroy(mei_class, mei_devt);
  52. + mei_devt = 0;
  53. + class_destroy(mei_class);
  54. + mei_class = NULL;
  55. #endif
  56. #if CONFIG_PROC_FS
  57. @@ -1978,7 +1988,9 @@ static void MEI_module_exit (void)
  58. ("MEI_DRV: Chipset Basic Exit failed" MEI_DRV_CRLF));
  59. }
  60. +#if 0
  61. ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)NULL);
  62. +#endif
  63. /* touch one time this variable to avoid that the linker will remove it */
  64. debug_level = MEI_DRV_PRN_LEVEL_OFF;
  65. @@ -2095,6 +2107,10 @@ static int MEI_InitModuleRegCharDev(cons
  66. ("Using major number %d" MEI_DRV_CRLF, major_number));
  67. }
  68. + mei_class = class_create(THIS_MODULE, devName);
  69. + mei_devt = MKDEV(major_number, 0);
  70. + device_create(mei_class, NULL, mei_devt, NULL, "%s/%i", devName, 0);
  71. +
  72. return 0;
  73. #endif /* CONFIG_DEVFS_FS */
  74. }
  75. @@ -2135,21 +2151,32 @@ static int MEI_InitModuleBasics(void)
  76. }
  77. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
  78. +
  79. +#define PMU_DFE BIT(9)
  80. +
  81. static int MEI_SysClkEnable(struct clk *clk)
  82. {
  83. +#if 0
  84. if (IS_ERR(clk))
  85. return -1;
  86. clk_enable(clk);
  87. +#else
  88. + ltq_pmu_enable(PMU_DFE);
  89. +#endif
  90. return 0;
  91. }
  92. static int MEI_SysClkDisable(struct clk *clk)
  93. {
  94. +#if 0
  95. if (IS_ERR(clk))
  96. return -1;
  97. clk_disable(clk);
  98. clk_put(clk);
  99. +#else
  100. + ltq_pmu_disable(PMU_DFE);
  101. +#endif
  102. return 0;
  103. }
  104. @@ -2469,11 +2496,15 @@ IFX_int32_t MEI_IoctlInitDevice(
  105. pMeiDev->eModePoll = e_MEI_DEV_ACCESS_MODE_IRQ;
  106. pMeiDev->intMask = ME_ARC2ME_INTERRUPT_UNMASK_ALL;
  107. +#if 1
  108. + virq = (IFX_uint32_t)pInitDev->usedIRQ;
  109. +#else
  110. #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
  111. virq = (IFX_uint32_t)pInitDev->usedIRQ;
  112. #else
  113. virq = irq_create_mapping(NULL, (IFX_uint32_t)pInitDev->usedIRQ);
  114. #endif
  115. +#endif
  116. pTmpXCntrl = MEI_VrxXDevToIrqListAdd(
  117. MEI_DRV_LINENUM_GET(pMeiDev),
  118. --- a/src/drv_mei_cpe_api_atm_ptm_intern.c
  119. +++ b/src/drv_mei_cpe_api_atm_ptm_intern.c
  120. @@ -193,6 +193,51 @@ int ifx_mei_atm_led_blink(void)
  121. return IFX_SUCCESS;
  122. }
  123. +#if MEI_MAX_DFE_CHAN_DEVICES > 1
  124. +#error "Compat functions do not support MEI_MAX_DFE_CHAN_DEVICES > 1 yet"
  125. +#else
  126. +int (*ifx_mei_atm_showtime_enter)(struct port_cell_info *, void *) = NULL;
  127. +int (*ifx_mei_atm_showtime_exit)(void) = NULL;
  128. +
  129. +int ltq_ifx_mei_atm_showtime_enter_compat(IFX_uint8_t dslLineNum,
  130. + struct port_cell_info *cellInfo,
  131. + void *xdata) {
  132. + if (ifx_mei_atm_showtime_enter)
  133. + return ifx_mei_atm_showtime_enter(cellInfo, xdata);
  134. +
  135. + return -e_MEI_ERR_OP_FAILED;
  136. +}
  137. +
  138. +int ltq_ifx_mei_atm_showtime_exit_compat(IFX_uint8_t dslLineNum) {
  139. + if (ifx_mei_atm_showtime_exit)
  140. + return ifx_mei_atm_showtime_exit();
  141. +
  142. + return -e_MEI_ERR_OP_FAILED;
  143. +}
  144. +
  145. +void* ppa_callback_get(e_ltq_mei_cb_type type) {
  146. + switch (type) {
  147. + case LTQ_MEI_SHOWTIME_ENTER:
  148. + return &ltq_ifx_mei_atm_showtime_enter_compat;
  149. + case LTQ_MEI_SHOWTIME_EXIT:
  150. + return &ltq_ifx_mei_atm_showtime_exit_compat;
  151. + break;
  152. + }
  153. +
  154. + BUG();
  155. +}
  156. +
  157. +int ifx_mei_atm_showtime_check(int *is_showtime,
  158. + struct port_cell_info *port_cell,
  159. + void **xdata_addr) {
  160. + return ltq_mei_atm_showtime_check(0, is_showtime, port_cell, xdata_addr);
  161. +}
  162. +
  163. +EXPORT_SYMBOL(ifx_mei_atm_showtime_enter);
  164. +EXPORT_SYMBOL(ifx_mei_atm_showtime_exit);
  165. +EXPORT_SYMBOL(ifx_mei_atm_showtime_check);
  166. +#endif
  167. +
  168. EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeEntrySignal);
  169. EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeExitSignal);
  170. EXPORT_SYMBOL(ifx_mei_atm_led_blink);
  171. --- a/src/drv_mei_cpe_api_atm_ptm_intern.h
  172. +++ b/src/drv_mei_cpe_api_atm_ptm_intern.h
  173. @@ -21,7 +21,6 @@
  174. #include "drv_mei_cpe_config.h"
  175. #include "drv_mei_cpe_interface.h"
  176. -#include <net/ppa_stack_al.h>
  177. #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
  178. @@ -42,8 +41,21 @@ extern IFX_int32_t MEI_InternalXtmSwhowt
  179. MEI_DYN_CNTRL_T *pMeiDynCntrl,
  180. MEI_XTM_ShowtimeExit_t *pArgXtm);
  181. +#if 1
  182. +#include <lantiq_atm.h>
  183. +typedef enum {
  184. + LTQ_MEI_SHOWTIME_ENTER,
  185. + LTQ_MEI_SHOWTIME_EXIT
  186. +} e_ltq_mei_cb_type;
  187. +
  188. +typedef void (*ltq_mei_atm_showtime_enter_t)(IFX_uint8_t, struct port_cell_info *, void *);
  189. +typedef void (*ltq_mei_atm_showtime_exit_t)(IFX_uint8_t);
  190. +
  191. +void* ppa_callback_get(e_ltq_mei_cb_type type);
  192. +#else
  193. extern int ppa_callback_set(e_ltq_mei_cb_type type, void *func);
  194. extern void* ppa_callback_get(e_ltq_mei_cb_type type);
  195. +#endif
  196. int ltq_mei_atm_showtime_check (
  197. const unsigned char line_idx,
  198. --- a/src/drv_mei_cpe_device_vrx.c
  199. +++ b/src/drv_mei_cpe_device_vrx.c
  200. @@ -28,13 +28,6 @@
  201. #include "drv_mei_cpe_api.h"
  202. #include "drv_mei_cpe_mei_vrx.h"
  203. -#if defined(LINUX)
  204. -# if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
  205. -# include "ifx_pcie.h"
  206. -# else
  207. -# include "lantiq_pcie.h"
  208. -# endif
  209. -#endif /* #if defined(LINUX)*/
  210. IFX_int32_t MEI_GPIntProcess(MEI_MeiRegVal_t processInt, MEI_DEV_T *pMeiDev)
  211. {
  212. @@ -82,6 +75,7 @@ IFX_int32_t MEI_GetChipInfo(MEI_DEV_T *p
  213. */
  214. IFX_int32_t MEI_VR10_PcieEntitiesCheck(IFX_uint8_t nEntityNum)
  215. {
  216. +#if 0
  217. IFX_uint32_t pcie_entitiesNum;
  218. /* get information from pcie driver */
  219. @@ -102,6 +96,9 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
  220. }
  221. return IFX_SUCCESS;
  222. +#else
  223. + return IFX_ERROR;
  224. +#endif
  225. }
  226. /**
  227. @@ -116,6 +113,7 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
  228. */
  229. IFX_int32_t MEI_VR10_PcieEntityInit(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl)
  230. {
  231. +#if 0
  232. IFX_uint8_t entityNum;
  233. ifx_pcie_ep_dev_t MEI_pcie_ep_dev;
  234. @@ -138,6 +136,9 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
  235. pMeiDrvCntrl->MEI_pcie_irq = MEI_pcie_ep_dev.irq;
  236. return IFX_SUCCESS;
  237. +#else
  238. + return IFX_ERROR;
  239. +#endif
  240. }
  241. /**
  242. @@ -152,6 +153,7 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
  243. */
  244. IFX_int32_t MEI_VR10_PcieEntityFree(IFX_uint8_t entityNum)
  245. {
  246. +#if 0
  247. if (ifx_pcie_ep_dev_info_release(entityNum))
  248. {
  249. PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_ERR,
  250. @@ -161,6 +163,9 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
  251. }
  252. return IFX_SUCCESS;
  253. +#else
  254. + return IFX_ERROR;
  255. +#endif
  256. }
  257. /**
  258. @@ -175,6 +180,7 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
  259. */
  260. IFX_int32_t MEI_VR10_InternalInitDevice(MEI_DYN_CNTRL_T *pMeiDynCntrl)
  261. {
  262. +#if 0
  263. IFX_int32_t retVal;
  264. IOCTL_MEI_devInit_t InitDev;
  265. MEI_DEV_T *pMeiDev = pMeiDynCntrl->pMeiDev;
  266. @@ -199,6 +205,9 @@ IFX_int32_t MEI_VR10_InternalInitDevice(
  267. *MEI_GPIO_U32REG(GPIO_P0_ALSEL1) &= ~((1 << 0) | (1 << 3) | (1 << 8));
  268. return IFX_SUCCESS;
  269. +#else
  270. + return IFX_ERROR;
  271. +#endif
  272. }
  273. IFX_int32_t MEI_PLL_ConfigInit(MEI_DEV_T *pMeiDev)
  274. --- a/src/drv_mei_cpe_dsm.c
  275. +++ b/src/drv_mei_cpe_dsm.c
  276. @@ -138,7 +138,7 @@ IFX_void_t MEI_VRX_DSM_DataInit(MEI_DEV_
  277. memset((IFX_uint8_t *)&pMeiDev->firmwareFeatures, 0x00, sizeof(IOCTL_MEI_firmwareFeatures_t));
  278. pMeiDev->meiFwDlCount = 0;
  279. - pMeiDev->meiERBbuf.pCallBackFunc = mei_dsm_cb_func_hook;
  280. + pMeiDev->meiERBbuf.pCallBackFunc = NULL;
  281. PRN_DBG_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_NORMAL,
  282. ("MEI_DRV: PP callback function addr = 0x%08X" MEI_DRV_CRLF,