100-compat.patch 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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. @@ -57,12 +57,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. #include <linux/dma-mapping.h>
  22. --- a/src/drv_mei_cpe_linux.c
  23. +++ b/src/drv_mei_cpe_linux.c
  24. @@ -114,6 +114,8 @@
  25. #include "drv_mei_cpe_api_atm_ptm_intern.h"
  26. +#include <lantiq_soc.h>
  27. +
  28. /* ===================================
  29. extern function declarations
  30. =================================== */
  31. @@ -220,6 +222,8 @@ static void MEI_NlSendMsg(IFX_char_t* pM
  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. @@ -2174,9 +2178,11 @@ static int MEI_module_init (void)
  41. return (result);
  42. }
  43. +#if 0
  44. #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
  45. ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)ltq_mei_showtime_check);
  46. #endif /* #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
  47. +#endif
  48. return 0;
  49. }
  50. @@ -2304,6 +2310,10 @@ static void MEI_module_exit (void)
  51. #else
  52. unregister_chrdev ( major_number , DRV_MEI_NAME );
  53. + device_destroy(mei_class, mei_devt);
  54. + mei_devt = 0;
  55. + class_destroy(mei_class);
  56. + mei_class = NULL;
  57. #endif
  58. #if CONFIG_PROC_FS
  59. @@ -2388,9 +2398,11 @@ static void MEI_module_exit (void)
  60. ("MEI_DRV: Chipset Basic Exit failed" MEI_DRV_CRLF));
  61. }
  62. +#if 0
  63. #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
  64. ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)NULL);
  65. #endif /* #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
  66. +#endif
  67. #if (MEI_SUPPORT_DEBUG_LOGGER == 1)
  68. if (nl_debug_sock)
  69. @@ -2514,6 +2526,10 @@ static int MEI_InitModuleRegCharDev(cons
  70. ("Using major number %d" MEI_DRV_CRLF, major_number));
  71. }
  72. + mei_class = class_create(THIS_MODULE, devName);
  73. + mei_devt = MKDEV(major_number, 0);
  74. + device_create(mei_class, NULL, mei_devt, NULL, "%s/%i", devName, 0);
  75. +
  76. return 0;
  77. #endif /* CONFIG_DEVFS_FS */
  78. }
  79. @@ -2563,21 +2579,32 @@ static int MEI_InitModuleBasics(void)
  80. }
  81. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
  82. +
  83. +#define PMU_DFE BIT(9)
  84. +
  85. static int MEI_SysClkEnable(struct clk *clk)
  86. {
  87. +#if 0
  88. if (IS_ERR(clk))
  89. return -1;
  90. clk_enable(clk);
  91. +#else
  92. + ltq_pmu_enable(PMU_DFE);
  93. +#endif
  94. return 0;
  95. }
  96. static int MEI_SysClkDisable(struct clk *clk)
  97. {
  98. +#if 0
  99. if (IS_ERR(clk))
  100. return -1;
  101. clk_disable(clk);
  102. clk_put(clk);
  103. +#else
  104. + ltq_pmu_disable(PMU_DFE);
  105. +#endif
  106. return 0;
  107. }
  108. @@ -2905,11 +2932,15 @@ IFX_int32_t MEI_IoctlInitDevice(
  109. pMeiDev->eModePoll = e_MEI_DEV_ACCESS_MODE_IRQ;
  110. pMeiDev->intMask = ME_ARC2ME_INTERRUPT_UNMASK_ALL;
  111. +#if 1
  112. + virq = (IFX_uint32_t)pInitDev->usedIRQ;
  113. +#else
  114. #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
  115. virq = (IFX_uint32_t)pInitDev->usedIRQ;
  116. #else
  117. virq = irq_create_mapping(NULL, (IFX_uint32_t)pInitDev->usedIRQ);
  118. #endif
  119. +#endif
  120. pTmpXCntrl = MEI_VrxXDevToIrqListAdd(
  121. MEI_DRV_LINENUM_GET(pMeiDev),
  122. --- a/src/drv_mei_cpe_api_atm_ptm_intern.c
  123. +++ b/src/drv_mei_cpe_api_atm_ptm_intern.c
  124. @@ -147,6 +147,7 @@ IFX_int32_t MEI_InternalXtmSwhowtimeExit
  125. return retVal;
  126. }
  127. +#if 0
  128. IFX_int32_t MEI_InternalTcRequest(
  129. MEI_DYN_CNTRL_T *pMeiDynCntrl,
  130. MEI_TC_Request_t *pArgTcRequest)
  131. @@ -232,6 +233,7 @@ IFX_int32_t MEI_InternalTcReset(
  132. return retVal;
  133. }
  134. +#endif
  135. /**
  136. Function that is used by the PP subsystem to get some showtime relevant data
  137. @@ -311,10 +313,57 @@ int ifx_mei_atm_led_blink(void)
  138. return IFX_SUCCESS;
  139. }
  140. +#if MEI_MAX_DFE_CHAN_DEVICES > 1
  141. +#error "Compat functions do not support MEI_MAX_DFE_CHAN_DEVICES > 1 yet"
  142. +#else
  143. +int (*ifx_mei_atm_showtime_enter)(struct port_cell_info *, void *) = NULL;
  144. +int (*ifx_mei_atm_showtime_exit)(void) = NULL;
  145. +
  146. +int ltq_ifx_mei_atm_showtime_enter_compat(IFX_uint8_t dslLineNum,
  147. + struct port_cell_info *cellInfo,
  148. + void *xdata) {
  149. + if (ifx_mei_atm_showtime_enter)
  150. + return ifx_mei_atm_showtime_enter(cellInfo, xdata);
  151. +
  152. + return -e_MEI_ERR_OP_FAILED;
  153. +}
  154. +
  155. +int ltq_ifx_mei_atm_showtime_exit_compat(IFX_uint8_t dslLineNum) {
  156. + if (ifx_mei_atm_showtime_exit)
  157. + return ifx_mei_atm_showtime_exit();
  158. +
  159. + return -e_MEI_ERR_OP_FAILED;
  160. +}
  161. +
  162. +void* ppa_callback_get(e_ltq_mei_cb_type type) {
  163. + switch (type) {
  164. + case LTQ_MEI_SHOWTIME_ENTER:
  165. + return &ltq_ifx_mei_atm_showtime_enter_compat;
  166. + case LTQ_MEI_SHOWTIME_EXIT:
  167. + return &ltq_ifx_mei_atm_showtime_exit_compat;
  168. + break;
  169. + }
  170. +
  171. + BUG();
  172. +}
  173. +
  174. +int ifx_mei_atm_showtime_check(int *is_showtime,
  175. + struct port_cell_info *port_cell,
  176. + void **xdata_addr) {
  177. + return ltq_mei_showtime_check(0, is_showtime, port_cell, xdata_addr);
  178. +}
  179. +
  180. +EXPORT_SYMBOL(ifx_mei_atm_showtime_enter);
  181. +EXPORT_SYMBOL(ifx_mei_atm_showtime_exit);
  182. +EXPORT_SYMBOL(ifx_mei_atm_showtime_check);
  183. +#endif
  184. +
  185. EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeEntrySignal);
  186. EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeExitSignal);
  187. +#if 0
  188. EXPORT_SYMBOL (MEI_InternalTcRequest);
  189. EXPORT_SYMBOL (MEI_InternalTcReset);
  190. +#endif
  191. EXPORT_SYMBOL(ifx_mei_atm_led_blink);
  192. #endif /* #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
  193. --- a/src/drv_mei_cpe_api_atm_ptm_intern.h
  194. +++ b/src/drv_mei_cpe_api_atm_ptm_intern.h
  195. @@ -21,7 +21,6 @@
  196. #include "drv_mei_cpe_config.h"
  197. #include "drv_mei_cpe_interface.h"
  198. -#include <net/ppa_stack_al.h>
  199. #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
  200. @@ -59,8 +58,21 @@ extern IFX_int32_t MEI_InternalTcReset(
  201. MEI_DYN_CNTRL_T *pMeiDynCntrl,
  202. MEI_TC_Reset_t *pArgTcReset);
  203. +#if 1
  204. +#include <lantiq_atm.h>
  205. +typedef enum {
  206. + LTQ_MEI_SHOWTIME_ENTER,
  207. + LTQ_MEI_SHOWTIME_EXIT
  208. +} e_ltq_mei_cb_type;
  209. +
  210. +typedef void (*ltq_mei_atm_showtime_enter_t)(IFX_uint8_t, struct port_cell_info *, void *);
  211. +typedef void (*ltq_mei_atm_showtime_exit_t)(IFX_uint8_t);
  212. +
  213. +void* ppa_callback_get(e_ltq_mei_cb_type type);
  214. +#else
  215. extern int ppa_callback_set(e_ltq_mei_cb_type type, void *func);
  216. extern void* ppa_callback_get(e_ltq_mei_cb_type type);
  217. +#endif
  218. int ltq_mei_showtime_check(
  219. const unsigned char line_idx,
  220. --- a/src/drv_mei_cpe_device_vrx.c
  221. +++ b/src/drv_mei_cpe_device_vrx.c
  222. @@ -28,17 +28,6 @@
  223. #include "drv_mei_cpe_api.h"
  224. #include "drv_mei_cpe_mei_vrx.h"
  225. -#if defined(LINUX)
  226. -# if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
  227. -# if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
  228. -# include "ifx_pcie.h"
  229. -# else
  230. -# include "../drivers/net/ethernet/lantiq/lantiq_pcie.h"
  231. -# endif
  232. -# else
  233. -# include "lantiq_pcie.h"
  234. -# endif
  235. -#endif /* #if defined(LINUX)*/
  236. IFX_int32_t MEI_GPIntProcess(MEI_MeiRegVal_t processInt, MEI_DEV_T *pMeiDev)
  237. {
  238. @@ -86,6 +75,7 @@ IFX_int32_t MEI_GetChipInfo(MEI_DEV_T *p
  239. */
  240. IFX_int32_t MEI_VR10_PcieEntitiesCheck(IFX_uint8_t nEntityNum)
  241. {
  242. +#if 0
  243. IFX_uint32_t pcie_entitiesNum;
  244. /* get information from pcie driver */
  245. @@ -110,6 +100,9 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
  246. }
  247. return IFX_SUCCESS;
  248. +#else
  249. + return IFX_ERROR;
  250. +#endif
  251. }
  252. /**
  253. @@ -124,6 +117,7 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
  254. */
  255. IFX_int32_t MEI_VR10_PcieEntityInit(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl)
  256. {
  257. +#if 0
  258. IFX_uint8_t entityNum;
  259. #if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
  260. ifx_pcie_ep_dev_t MEI_pcie_ep_dev;
  261. @@ -156,6 +150,9 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
  262. pMeiDrvCntrl->MEI_pcie_irq = 99;
  263. return IFX_SUCCESS;
  264. +#else
  265. + return IFX_ERROR;
  266. +#endif
  267. }
  268. /**
  269. @@ -170,6 +167,7 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
  270. */
  271. IFX_int32_t MEI_VR10_PcieEntityFree(IFX_uint8_t entityNum)
  272. {
  273. +#if 0
  274. #if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
  275. if (ifx_pcie_ep_dev_info_release(entityNum))
  276. #else
  277. @@ -183,6 +181,9 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
  278. }
  279. return IFX_SUCCESS;
  280. +#else
  281. + return IFX_ERROR;
  282. +#endif
  283. }
  284. /**
  285. @@ -197,6 +198,7 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
  286. */
  287. IFX_int32_t MEI_VR10_InternalInitDevice(MEI_DYN_CNTRL_T *pMeiDynCntrl)
  288. {
  289. +#if 0
  290. IFX_int32_t retVal;
  291. IOCTL_MEI_devInit_t InitDev;
  292. MEI_DEV_T *pMeiDev = pMeiDynCntrl->pMeiDev;
  293. @@ -221,6 +223,9 @@ IFX_int32_t MEI_VR10_InternalInitDevice(
  294. *MEI_GPIO_U32REG(GPIO_P0_ALSEL1) &= ~((1 << 0) | (1 << 3) | (1 << 8));
  295. return IFX_SUCCESS;
  296. +#else
  297. + return IFX_ERROR;
  298. +#endif
  299. }
  300. IFX_int32_t MEI_PLL_ConfigInit(MEI_DEV_T *pMeiDev)
  301. --- a/src/drv_mei_cpe_dsm.c
  302. +++ b/src/drv_mei_cpe_dsm.c
  303. @@ -144,7 +144,7 @@ IFX_void_t MEI_VRX_DSM_DataInit(MEI_DEV_
  304. memset((IFX_uint8_t *)&pMeiDev->firmwareFeatures, 0x00, sizeof(IOCTL_MEI_firmwareFeatures_t));
  305. pMeiDev->meiFwDlCount = 0;
  306. - pMeiDev->meiERBbuf.pCallBackFunc = mei_dsm_cb_func_hook;
  307. + pMeiDev->meiERBbuf.pCallBackFunc = NULL;
  308. PRN_DBG_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_NORMAL,
  309. ("MEI_DRV: PP callback function addr = 0x%08X" MEI_DRV_CRLF,
  310. --- a/src/drv_mei_cpe_download_vrx.c
  311. +++ b/src/drv_mei_cpe_download_vrx.c
  312. @@ -3281,12 +3281,14 @@ IFX_int32_t MEI_DEV_IoctlFirmwareDownloa
  313. /* reset TC layer */
  314. if (ret == 0)
  315. {
  316. +#if 0
  317. if (MEI_InternalTcReset(pMeiDynCntrl, &tc_reset) != 0)
  318. {
  319. PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_WRN,
  320. ("MEI_DRV[%02d]: Could not perform reset of TC-Layer!"
  321. MEI_DRV_CRLF, MEI_DRV_LINENUM_GET(pMeiDev)));
  322. }
  323. +#endif
  324. }
  325. #endif