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 @@ -1783,7 +1787,9 @@ static int __init MEI_module_init (void)
51 ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)ltq_mei_atm_showtime_check);
56 @@ -1907,6 +1913,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 @@ -1963,7 +1973,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 @@ -2080,6 +2092,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 @@ -2120,21 +2136,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 @@ -2454,11 +2481,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 +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 +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,20 @@ extern IFX_int32_t MEI_InternalXtmSwhowt
202 MEI_DYN_CNTRL_T *pMeiDynCntrl,
203 MEI_XTM_ShowtimeExit_t *pArgXtm);
207 + LTQ_MEI_SHOWTIME_ENTER,
208 + LTQ_MEI_SHOWTIME_EXIT
209 +} e_ltq_mei_cb_type;
211 +typedef void (*ltq_mei_atm_showtime_enter_t)(IFX_uint8_t, struct port_cell_info *, void *);
212 +typedef void (*ltq_mei_atm_showtime_exit_t)(IFX_uint8_t);
214 +void* ppa_callback_get(e_ltq_mei_cb_type type);
216 extern int ppa_callback_set(e_ltq_mei_cb_type type, void *func);
217 extern void* ppa_callback_get(e_ltq_mei_cb_type type);
220 int ltq_mei_atm_showtime_check (
221 const unsigned char line_idx,
222 --- a/src/drv_mei_cpe_device_vrx.c
223 +++ b/src/drv_mei_cpe_device_vrx.c
225 #include "drv_mei_cpe_mei_interface.h"
226 #include "drv_mei_cpe_api.h"
229 -# if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
230 -# include "ifx_pcie.h"
232 -# include "lantiq_pcie.h"
234 -#endif /* #if defined(LINUX)*/
236 IFX_int32_t MEI_GPIntProcess(MEI_MeiRegVal_t processInt, MEI_DEV_T *pMeiDev)
238 @@ -81,6 +74,7 @@ IFX_int32_t MEI_GetChipInfo(MEI_DEV_T *p
240 IFX_int32_t MEI_VR10_PcieEntitiesCheck(IFX_uint8_t nEntityNum)
243 IFX_uint32_t pcie_entitiesNum;
245 /* get information from pcie driver */
246 @@ -101,6 +95,9 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
256 @@ -115,6 +112,7 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
258 IFX_int32_t MEI_VR10_PcieEntityInit(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl)
261 IFX_uint8_t entityNum;
262 ifx_pcie_ep_dev_t MEI_pcie_ep_dev;
264 @@ -137,6 +135,9 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
265 pMeiDrvCntrl->MEI_pcie_irq = MEI_pcie_ep_dev.irq;
274 @@ -151,6 +152,7 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
276 IFX_int32_t MEI_VR10_PcieEntityFree(IFX_uint8_t entityNum)
279 if (ifx_pcie_ep_dev_info_release(entityNum))
281 PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_ERR,
282 @@ -160,6 +162,9 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
292 @@ -174,6 +179,7 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
294 IFX_int32_t MEI_VR10_InternalInitDevice(MEI_DYN_CNTRL_T *pMeiDynCntrl)
298 IOCTL_MEI_devInit_t InitDev;
299 MEI_DEV_T *pMeiDev = pMeiDynCntrl->pMeiDev;
300 @@ -198,5 +204,8 @@ IFX_int32_t MEI_VR10_InternalInitDevice(
301 *MEI_GPIO_U32REG(GPIO_P0_ALSEL1) &= ~((1 << 0) | (1 << 3) | (1 << 8));