1 --- a/src/drv_mei_cpe_common.c
2 +++ b/src/drv_mei_cpe_common.c
4 /* get at first the driver configuration */
5 #include "drv_mei_cpe_config.h"
7 -#include "ifx_types.h"
8 #include "drv_mei_cpe_os.h"
9 #include "drv_mei_cpe_dbg.h"
11 --- a/src/drv_mei_cpe_linux.h
12 +++ b/src/drv_mei_cpe_linux.h
14 #include <linux/poll.h>
15 #include <linux/types.h>
17 -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
18 - #include <asm/ifx/ifx_types.h>
20 - #include <ifx_types.h>
23 #endif /* #if (MEI_DRV_IFXOS_ENABLE == 0)*/
25 /* ============================================================================
26 --- a/src/drv_mei_cpe_linux.c
27 +++ b/src/drv_mei_cpe_linux.c
30 #include "drv_mei_cpe_api_atm_ptm_intern.h"
32 +#include <lantiq_soc.h>
34 /* ===================================
35 extern function declarations
36 =================================== */
37 @@ -196,6 +198,8 @@ static void MEI_MemVAllocTest();
38 /* Local variables (LINUX) */
39 /* =================================== */
40 static IFX_uint8_t major_number = 0;
41 +static struct class *mei_class;
42 +static dev_t mei_devt;
44 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
45 MODULE_PARM(major_number, "b");
46 @@ -1798,7 +1802,9 @@ static int __init MEI_module_init (void)
51 ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)ltq_mei_atm_showtime_check);
56 @@ -1922,6 +1928,10 @@ static void MEI_module_exit (void)
59 unregister_chrdev ( major_number , DRV_MEI_NAME );
60 + device_destroy(mei_class, mei_devt);
62 + class_destroy(mei_class);
67 @@ -1978,7 +1988,9 @@ static void MEI_module_exit (void)
68 ("MEI_DRV: Chipset Basic Exit failed" MEI_DRV_CRLF));
72 ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)NULL);
75 /* touch one time this variable to avoid that the linker will remove it */
76 debug_level = MEI_DRV_PRN_LEVEL_OFF;
77 @@ -2095,6 +2107,10 @@ static int MEI_InitModuleRegCharDev(cons
78 ("Using major number %d" MEI_DRV_CRLF, major_number));
81 + mei_class = class_create(THIS_MODULE, devName);
82 + mei_devt = MKDEV(major_number, 0);
83 + device_create(mei_class, NULL, mei_devt, NULL, "%s/%i", devName, 0);
86 #endif /* CONFIG_DEVFS_FS */
88 @@ -2135,21 +2151,32 @@ static int MEI_InitModuleBasics(void)
91 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
93 +#define PMU_DFE BIT(9)
95 static int MEI_SysClkEnable(struct clk *clk)
102 + ltq_pmu_enable(PMU_DFE);
108 static int MEI_SysClkDisable(struct clk *clk)
116 + ltq_pmu_disable(PMU_DFE);
121 @@ -2469,11 +2496,15 @@ IFX_int32_t MEI_IoctlInitDevice(
122 pMeiDev->eModePoll = e_MEI_DEV_ACCESS_MODE_IRQ;
123 pMeiDev->intMask = ME_ARC2ME_INTERRUPT_UNMASK_ALL;
126 + virq = (IFX_uint32_t)pInitDev->usedIRQ;
128 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
129 virq = (IFX_uint32_t)pInitDev->usedIRQ;
131 virq = irq_create_mapping(NULL, (IFX_uint32_t)pInitDev->usedIRQ);
135 pTmpXCntrl = MEI_VrxXDevToIrqListAdd(
136 MEI_DRV_LINENUM_GET(pMeiDev),
137 --- a/src/drv_mei_cpe_api_atm_ptm_intern.c
138 +++ b/src/drv_mei_cpe_api_atm_ptm_intern.c
139 @@ -193,6 +193,51 @@ int ifx_mei_atm_led_blink(void)
143 +#if MEI_MAX_DFE_CHAN_DEVICES > 1
144 +#error "Compat functions do not support MEI_MAX_DFE_CHAN_DEVICES > 1 yet"
146 +int (*ifx_mei_atm_showtime_enter)(struct port_cell_info *, void *) = NULL;
147 +int (*ifx_mei_atm_showtime_exit)(void) = NULL;
149 +int ltq_ifx_mei_atm_showtime_enter_compat(IFX_uint8_t dslLineNum,
150 + struct port_cell_info *cellInfo,
152 + if (ifx_mei_atm_showtime_enter)
153 + return ifx_mei_atm_showtime_enter(cellInfo, xdata);
155 + return -e_MEI_ERR_OP_FAILED;
158 +int ltq_ifx_mei_atm_showtime_exit_compat(IFX_uint8_t dslLineNum) {
159 + if (ifx_mei_atm_showtime_exit)
160 + return ifx_mei_atm_showtime_exit();
162 + return -e_MEI_ERR_OP_FAILED;
165 +void* ppa_callback_get(e_ltq_mei_cb_type type) {
167 + case LTQ_MEI_SHOWTIME_ENTER:
168 + return <q_ifx_mei_atm_showtime_enter_compat;
169 + case LTQ_MEI_SHOWTIME_EXIT:
170 + return <q_ifx_mei_atm_showtime_exit_compat;
177 +int ifx_mei_atm_showtime_check(int *is_showtime,
178 + struct port_cell_info *port_cell,
179 + void **xdata_addr) {
180 + return ltq_mei_atm_showtime_check(0, is_showtime, port_cell, xdata_addr);
183 +EXPORT_SYMBOL(ifx_mei_atm_showtime_enter);
184 +EXPORT_SYMBOL(ifx_mei_atm_showtime_exit);
185 +EXPORT_SYMBOL(ifx_mei_atm_showtime_check);
188 EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeEntrySignal);
189 EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeExitSignal);
190 EXPORT_SYMBOL(ifx_mei_atm_led_blink);
191 --- a/src/drv_mei_cpe_api_atm_ptm_intern.h
192 +++ b/src/drv_mei_cpe_api_atm_ptm_intern.h
195 #include "drv_mei_cpe_config.h"
196 #include "drv_mei_cpe_interface.h"
197 -#include <net/ppa_stack_al.h>
199 #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
201 @@ -42,8 +41,21 @@ extern IFX_int32_t MEI_InternalXtmSwhowt
202 MEI_DYN_CNTRL_T *pMeiDynCntrl,
203 MEI_XTM_ShowtimeExit_t *pArgXtm);
206 +#include <lantiq_atm.h>
208 + LTQ_MEI_SHOWTIME_ENTER,
209 + LTQ_MEI_SHOWTIME_EXIT
210 +} e_ltq_mei_cb_type;
212 +typedef void (*ltq_mei_atm_showtime_enter_t)(IFX_uint8_t, struct port_cell_info *, void *);
213 +typedef void (*ltq_mei_atm_showtime_exit_t)(IFX_uint8_t);
215 +void* ppa_callback_get(e_ltq_mei_cb_type type);
217 extern int ppa_callback_set(e_ltq_mei_cb_type type, void *func);
218 extern void* ppa_callback_get(e_ltq_mei_cb_type type);
221 int ltq_mei_atm_showtime_check (
222 const unsigned char line_idx,
223 --- a/src/drv_mei_cpe_device_vrx.c
224 +++ b/src/drv_mei_cpe_device_vrx.c
226 #include "drv_mei_cpe_api.h"
227 #include "drv_mei_cpe_mei_vrx.h"
230 -# if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
231 -# include "ifx_pcie.h"
233 -# include "lantiq_pcie.h"
235 -#endif /* #if defined(LINUX)*/
237 IFX_int32_t MEI_GPIntProcess(MEI_MeiRegVal_t processInt, MEI_DEV_T *pMeiDev)
239 @@ -82,6 +75,7 @@ IFX_int32_t MEI_GetChipInfo(MEI_DEV_T *p
241 IFX_int32_t MEI_VR10_PcieEntitiesCheck(IFX_uint8_t nEntityNum)
244 IFX_uint32_t pcie_entitiesNum;
246 /* get information from pcie driver */
247 @@ -102,6 +96,9 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
257 @@ -116,6 +113,7 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
259 IFX_int32_t MEI_VR10_PcieEntityInit(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl)
262 IFX_uint8_t entityNum;
263 ifx_pcie_ep_dev_t MEI_pcie_ep_dev;
265 @@ -138,6 +136,9 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
266 pMeiDrvCntrl->MEI_pcie_irq = MEI_pcie_ep_dev.irq;
275 @@ -152,6 +153,7 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
277 IFX_int32_t MEI_VR10_PcieEntityFree(IFX_uint8_t entityNum)
280 if (ifx_pcie_ep_dev_info_release(entityNum))
282 PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_ERR,
283 @@ -161,6 +163,9 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
293 @@ -175,6 +180,7 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
295 IFX_int32_t MEI_VR10_InternalInitDevice(MEI_DYN_CNTRL_T *pMeiDynCntrl)
299 IOCTL_MEI_devInit_t InitDev;
300 MEI_DEV_T *pMeiDev = pMeiDynCntrl->pMeiDev;
301 @@ -199,6 +205,9 @@ IFX_int32_t MEI_VR10_InternalInitDevice(
302 *MEI_GPIO_U32REG(GPIO_P0_ALSEL1) &= ~((1 << 0) | (1 << 3) | (1 << 8));
310 IFX_int32_t MEI_PLL_ConfigInit(MEI_DEV_T *pMeiDev)
311 --- a/src/drv_mei_cpe_dsm.c
312 +++ b/src/drv_mei_cpe_dsm.c
313 @@ -138,7 +138,7 @@ IFX_void_t MEI_VRX_DSM_DataInit(MEI_DEV_
314 memset((IFX_uint8_t *)&pMeiDev->firmwareFeatures, 0x00, sizeof(IOCTL_MEI_firmwareFeatures_t));
315 pMeiDev->meiFwDlCount = 0;
317 - pMeiDev->meiERBbuf.pCallBackFunc = mei_dsm_cb_func_hook;
318 + pMeiDev->meiERBbuf.pCallBackFunc = NULL;
320 PRN_DBG_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_NORMAL,
321 ("MEI_DRV: PP callback function addr = 0x%08X" MEI_DRV_CRLF,