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 #include <linux/dma-mapping.h>
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 @@ -220,6 +222,8 @@ static void MEI_NlSendMsg(IFX_char_t* pM
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 @@ -2174,9 +2178,11 @@ static int MEI_module_init (void)
51 #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
52 ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)ltq_mei_showtime_check);
53 #endif /* #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
58 @@ -2304,6 +2310,10 @@ static void MEI_module_exit (void)
61 unregister_chrdev ( major_number , DRV_MEI_NAME );
62 + device_destroy(mei_class, mei_devt);
64 + class_destroy(mei_class);
69 @@ -2388,9 +2398,11 @@ static void MEI_module_exit (void)
70 ("MEI_DRV: Chipset Basic Exit failed" MEI_DRV_CRLF));
74 #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
75 ppa_callback_set(LTQ_MEI_SHOWTIME_CHECK, (void *)NULL);
76 #endif /* #if (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
79 #if (MEI_SUPPORT_DEBUG_LOGGER == 1)
81 @@ -2514,6 +2526,10 @@ static int MEI_InitModuleRegCharDev(cons
82 ("Using major number %d" MEI_DRV_CRLF, major_number));
85 + mei_class = class_create(THIS_MODULE, devName);
86 + mei_devt = MKDEV(major_number, 0);
87 + device_create(mei_class, NULL, mei_devt, NULL, "%s/%i", devName, 0);
90 #endif /* CONFIG_DEVFS_FS */
92 @@ -2563,21 +2579,32 @@ static int MEI_InitModuleBasics(void)
95 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
97 +#define PMU_DFE BIT(9)
99 static int MEI_SysClkEnable(struct clk *clk)
106 + ltq_pmu_enable(PMU_DFE);
112 static int MEI_SysClkDisable(struct clk *clk)
120 + ltq_pmu_disable(PMU_DFE);
125 @@ -2905,11 +2932,15 @@ IFX_int32_t MEI_IoctlInitDevice(
126 pMeiDev->eModePoll = e_MEI_DEV_ACCESS_MODE_IRQ;
127 pMeiDev->intMask = ME_ARC2ME_INTERRUPT_UNMASK_ALL;
130 + virq = (IFX_uint32_t)pInitDev->usedIRQ;
132 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
133 virq = (IFX_uint32_t)pInitDev->usedIRQ;
135 virq = irq_create_mapping(NULL, (IFX_uint32_t)pInitDev->usedIRQ);
139 pTmpXCntrl = MEI_VrxXDevToIrqListAdd(
140 MEI_DRV_LINENUM_GET(pMeiDev),
141 --- a/src/drv_mei_cpe_api_atm_ptm_intern.c
142 +++ b/src/drv_mei_cpe_api_atm_ptm_intern.c
143 @@ -147,6 +147,7 @@ IFX_int32_t MEI_InternalXtmSwhowtimeExit
148 IFX_int32_t MEI_InternalTcRequest(
149 MEI_DYN_CNTRL_T *pMeiDynCntrl,
150 MEI_TC_Request_t *pArgTcRequest)
151 @@ -232,6 +233,7 @@ IFX_int32_t MEI_InternalTcReset(
158 Function that is used by the PP subsystem to get some showtime relevant data
159 @@ -311,10 +313,57 @@ int ifx_mei_atm_led_blink(void)
163 +#if MEI_MAX_DFE_CHAN_DEVICES > 1
164 +#error "Compat functions do not support MEI_MAX_DFE_CHAN_DEVICES > 1 yet"
166 +int (*ifx_mei_atm_showtime_enter)(struct port_cell_info *, void *) = NULL;
167 +int (*ifx_mei_atm_showtime_exit)(void) = NULL;
169 +int ltq_ifx_mei_atm_showtime_enter_compat(IFX_uint8_t dslLineNum,
170 + struct port_cell_info *cellInfo,
172 + if (ifx_mei_atm_showtime_enter)
173 + return ifx_mei_atm_showtime_enter(cellInfo, xdata);
175 + return -e_MEI_ERR_OP_FAILED;
178 +int ltq_ifx_mei_atm_showtime_exit_compat(IFX_uint8_t dslLineNum) {
179 + if (ifx_mei_atm_showtime_exit)
180 + return ifx_mei_atm_showtime_exit();
182 + return -e_MEI_ERR_OP_FAILED;
185 +void* ppa_callback_get(e_ltq_mei_cb_type type) {
187 + case LTQ_MEI_SHOWTIME_ENTER:
188 + return <q_ifx_mei_atm_showtime_enter_compat;
189 + case LTQ_MEI_SHOWTIME_EXIT:
190 + return <q_ifx_mei_atm_showtime_exit_compat;
197 +int ifx_mei_atm_showtime_check(int *is_showtime,
198 + struct port_cell_info *port_cell,
199 + void **xdata_addr) {
200 + return ltq_mei_showtime_check(0, is_showtime, port_cell, xdata_addr);
203 +EXPORT_SYMBOL(ifx_mei_atm_showtime_enter);
204 +EXPORT_SYMBOL(ifx_mei_atm_showtime_exit);
205 +EXPORT_SYMBOL(ifx_mei_atm_showtime_check);
208 EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeEntrySignal);
209 EXPORT_SYMBOL (MEI_InternalXtmSwhowtimeExitSignal);
211 EXPORT_SYMBOL (MEI_InternalTcRequest);
212 EXPORT_SYMBOL (MEI_InternalTcReset);
214 EXPORT_SYMBOL(ifx_mei_atm_led_blink);
216 #endif /* #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1) */
217 --- a/src/drv_mei_cpe_api_atm_ptm_intern.h
218 +++ b/src/drv_mei_cpe_api_atm_ptm_intern.h
221 #include "drv_mei_cpe_config.h"
222 #include "drv_mei_cpe_interface.h"
223 -#include <net/ppa_stack_al.h>
225 #if (MEI_EXPORT_INTERNAL_API == 1) && (MEI_DRV_ATM_PTM_INTERFACE_ENABLE == 1)
227 @@ -59,8 +58,21 @@ extern IFX_int32_t MEI_InternalTcReset(
228 MEI_DYN_CNTRL_T *pMeiDynCntrl,
229 MEI_TC_Reset_t *pArgTcReset);
232 +#include <lantiq_atm.h>
234 + LTQ_MEI_SHOWTIME_ENTER,
235 + LTQ_MEI_SHOWTIME_EXIT
236 +} e_ltq_mei_cb_type;
238 +typedef void (*ltq_mei_atm_showtime_enter_t)(IFX_uint8_t, struct port_cell_info *, void *);
239 +typedef void (*ltq_mei_atm_showtime_exit_t)(IFX_uint8_t);
241 +void* ppa_callback_get(e_ltq_mei_cb_type type);
243 extern int ppa_callback_set(e_ltq_mei_cb_type type, void *func);
244 extern void* ppa_callback_get(e_ltq_mei_cb_type type);
247 int ltq_mei_showtime_check(
248 const unsigned char line_idx,
249 --- a/src/drv_mei_cpe_device_vrx.c
250 +++ b/src/drv_mei_cpe_device_vrx.c
252 #include "drv_mei_cpe_api.h"
253 #include "drv_mei_cpe_mei_vrx.h"
256 -# if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
257 -# if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
258 -# include "ifx_pcie.h"
260 -# include "../drivers/net/ethernet/lantiq/lantiq_pcie.h"
263 -# include "lantiq_pcie.h"
265 -#endif /* #if defined(LINUX)*/
267 IFX_int32_t MEI_GPIntProcess(MEI_MeiRegVal_t processInt, MEI_DEV_T *pMeiDev)
269 @@ -86,6 +75,7 @@ IFX_int32_t MEI_GetChipInfo(MEI_DEV_T *p
271 IFX_int32_t MEI_VR10_PcieEntitiesCheck(IFX_uint8_t nEntityNum)
274 IFX_uint32_t pcie_entitiesNum;
276 /* get information from pcie driver */
277 @@ -110,6 +100,9 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
287 @@ -124,6 +117,7 @@ IFX_int32_t MEI_VR10_PcieEntitiesCheck(I
289 IFX_int32_t MEI_VR10_PcieEntityInit(MEI_MEI_DRV_CNTRL_T *pMeiDrvCntrl)
292 IFX_uint8_t entityNum;
293 #if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
294 ifx_pcie_ep_dev_t MEI_pcie_ep_dev;
295 @@ -156,6 +150,9 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
296 pMeiDrvCntrl->MEI_pcie_irq = 99;
305 @@ -170,6 +167,7 @@ IFX_int32_t MEI_VR10_PcieEntityInit(MEI_
307 IFX_int32_t MEI_VR10_PcieEntityFree(IFX_uint8_t entityNum)
310 #if (MEI_SUPPORT_DEVICE_VR10_320 != 1)
311 if (ifx_pcie_ep_dev_info_release(entityNum))
313 @@ -183,6 +181,9 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
323 @@ -197,6 +198,7 @@ IFX_int32_t MEI_VR10_PcieEntityFree(IFX_
325 IFX_int32_t MEI_VR10_InternalInitDevice(MEI_DYN_CNTRL_T *pMeiDynCntrl)
329 IOCTL_MEI_devInit_t InitDev;
330 MEI_DEV_T *pMeiDev = pMeiDynCntrl->pMeiDev;
331 @@ -221,6 +223,9 @@ IFX_int32_t MEI_VR10_InternalInitDevice(
332 *MEI_GPIO_U32REG(GPIO_P0_ALSEL1) &= ~((1 << 0) | (1 << 3) | (1 << 8));
340 IFX_int32_t MEI_PLL_ConfigInit(MEI_DEV_T *pMeiDev)
341 --- a/src/drv_mei_cpe_dsm.c
342 +++ b/src/drv_mei_cpe_dsm.c
343 @@ -144,7 +144,7 @@ IFX_void_t MEI_VRX_DSM_DataInit(MEI_DEV_
344 memset((IFX_uint8_t *)&pMeiDev->firmwareFeatures, 0x00, sizeof(IOCTL_MEI_firmwareFeatures_t));
345 pMeiDev->meiFwDlCount = 0;
347 - pMeiDev->meiERBbuf.pCallBackFunc = mei_dsm_cb_func_hook;
348 + pMeiDev->meiERBbuf.pCallBackFunc = NULL;
350 PRN_DBG_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_NORMAL,
351 ("MEI_DRV: PP callback function addr = 0x%08X" MEI_DRV_CRLF,
352 --- a/src/drv_mei_cpe_download_vrx.c
353 +++ b/src/drv_mei_cpe_download_vrx.c
354 @@ -3281,12 +3281,14 @@ IFX_int32_t MEI_DEV_IoctlFirmwareDownloa
359 if (MEI_InternalTcReset(pMeiDynCntrl, &tc_reset) != 0)
361 PRN_ERR_USR_NL( MEI_DRV, MEI_DRV_PRN_LEVEL_WRN,
362 ("MEI_DRV[%02d]: Could not perform reset of TC-Layer!"
363 MEI_DRV_CRLF, MEI_DRV_LINENUM_GET(pMeiDev)));