adds misisng include in ifxmips dsl driver compat layer
[openwrt-10.03/.git] / package / ifxmips-dsl-api / patches / 200-mei_compat.patch
1 Index: drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c
2 ===================================================================
3 --- drv_dsl_cpe_api-3.24.4.4.orig/src/mei/ifxmips_mei.c 2009-10-31 23:30:20.000000000 +0100
4 +++ drv_dsl_cpe_api-3.24.4.4/src/mei/ifxmips_mei.c      2010-01-24 14:21:32.000000000 +0100
5 @@ -41,18 +41,20 @@
6  #include <linux/init.h>
7  #include <linux/ioport.h>
8  #include <linux/delay.h>
9 +#include <linux/device.h>
10 +#include <linux/sched.h>
11  #include <asm/uaccess.h>
12  #include <asm/hardirq.h>
13 -#include <asm/ifx/ifx_regs.h>
14 -#include <asm/ifx/irq.h>
15 -#include <asm/ifx/ifx_gpio.h>
16 -//#include <asm/ifx/ifx_led.h>
17 -#include <asm/ifx/ifx_pmu.h>
18 -#include <asm/ifx/ifx_atm.h>
19 +
20 +#include <ifxmips.h>
21 +#include <ifxmips_irq.h>
22 +#include <ifxmips_gpio.h>
23 +#include <ifxmips_pmu.h>
24 +#include "ifxmips_atm.h"
25  #define IFX_MEI_BSP
26  #include "ifxmips_mei_interface.h"
27  
28 -#define IFXMIPS_RCU_RST                   IFX_RCU_RST_REQ
29 +/*#define IFXMIPS_RCU_RST                   IFX_RCU_RST_REQ
30  #define IFXMIPS_RCU_RST_REQ_ARC_JTAG      IFX_RCU_RST_REQ_ARC_JTAG
31  #define IFXMIPS_RCU_RST_REQ_DFE                  IFX_RCU_RST_REQ_DFE
32  #define IFXMIPS_RCU_RST_REQ_AFE                  IFX_RCU_RST_REQ_AFE
33 @@ -76,7 +78,7 @@
34  #define ifxmips_r32(reg)                        __raw_readl(reg)
35  #define ifxmips_w32(val, reg)                   __raw_writel(val, reg)
36  #define ifxmips_w32_mask(clear, set, reg)       ifxmips_w32((ifxmips_r32(reg) & ~clear) | set, reg)
37 -
38 +*/
39  #define IFX_MEI_EMSG(fmt, args...) printk(KERN_ERR  "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args)
40  #define IFX_MEI_DMSG(fmt, args...) printk(KERN_INFO "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args)
41  
42 @@ -173,7 +175,8 @@
43  extern void ifxmips_mask_and_ack_irq(unsigned int irq_nr);
44  #define MEI_MASK_AND_ACK_IRQ ifxmips_mask_and_ack_irq
45  
46 -static int dev_major = 105;
47 +#define MEI_MAJOR      105
48 +static int dev_major = MEI_MAJOR;
49  
50  static struct file_operations bsp_mei_operations = {
51        owner:THIS_MODULE,
52 @@ -2294,10 +2297,10 @@
53                 IFX_MEI_EMSG ("request_irq %d failed!\n", pDev->nIrq[IFX_DFEIR]);
54                 return -1;
55         }
56 -       if (request_irq (pDev->nIrq[IFX_DYING_GASP], IFX_MEI_Dying_Gasp_IrqHandle, 0, "DYING_GASP", pDev) != 0) {
57 +       /*if (request_irq (pDev->nIrq[IFX_DYING_GASP], IFX_MEI_Dying_Gasp_IrqHandle, 0, "DYING_GASP", pDev) != 0) {
58                 IFX_MEI_EMSG ("request_irq %d failed!\n", pDev->nIrq[IFX_DYING_GASP]);
59                 return -1;
60 -       }
61 +       }*/
62  //     IFX_MEI_DMSG("Device %d initialized. IER %#x\n", num, bsp_get_irq_ier(pDev->nIrq[IFX_DYING_GASP]));
63         return 0;
64  }
65 @@ -2922,6 +2925,7 @@
66  IFX_MEI_ModuleInit (void)
67  {
68         int i = 0;
69 +       static struct class *dsl_class;
70  
71         printk ("IFX MEI Version %ld.%02ld.%02ld", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision);
72  
73 @@ -2935,14 +2939,15 @@
74                 IFX_MEI_InitProcFS (i);
75  #endif
76         }
77 -        for (i = 0; i <= DSL_BSP_CB_LAST ; i++)
78 +               for (i = 0; i <= DSL_BSP_CB_LAST ; i++)
79                 dsl_bsp_event_callback[i].function = NULL;
80  
81  #ifdef CONFIG_IFXMIPS_MEI_FW_LOOPBACK
82         printk(KERN_INFO "[%s %s %d]: Start loopback test...\n", __FILE__, __func__, __LINE__);
83         DFE_Loopback_Test ();
84  #endif
85 -
86 +       dsl_class = class_create(THIS_MODULE, "ifx_mei");
87 +       device_create(dsl_class, NULL, MKDEV(MEI_MAJOR, 0), NULL, "ifx_mei");
88         return 0;
89  }
90  
91 @@ -2996,3 +3001,5 @@
92  
93  module_init (IFX_MEI_ModuleInit);
94  module_exit (IFX_MEI_ModuleExit);
95 +
96 +MODULE_LICENSE("Dual BSD/GPL");