summaryrefslogtreecommitdiff
path: root/wct4xxp
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-11-30 20:19:40 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-11-30 20:19:40 +0000
commit9c37de41213afb929f4d7ec9e0e4866ce56d1db1 (patch)
treef28624c663ed5c855540ce8f2d80ed0b27900e00 /wct4xxp
parent57089bd399ea60f43341b452006835a823190c02 (diff)
Merged revisions 3263 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.2 ........ r3263 | mattf | 2007-11-30 14:17:42 -0600 (Fri, 30 Nov 2007) | 1 line Make sure we only disable irqs during octasic firmware load only if we have 4K stacks ........ git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3264 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp')
-rw-r--r--wct4xxp/vpm450m.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/wct4xxp/vpm450m.c b/wct4xxp/vpm450m.c
index a12b435..674dd49 100644
--- a/wct4xxp/vpm450m.c
+++ b/wct4xxp/vpm450m.c
@@ -10,10 +10,17 @@
#include <linux/vmalloc.h>
#include <linux/string.h>
#include <linux/time.h>
+#include <linux/version.h>
#include "vpm450m.h"
#include "oct6100api/oct6100_api.h"
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#include <linux/config.h>
+#else
+#include <linux/autoconf.h>
+#endif
+
/* API for Octasic access */
UINT32 Oct6100UserGetTime(tPOCT6100_GET_TIME f_pTime)
{
@@ -407,7 +414,9 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
UINT32 ulResult;
struct vpm450m *vpm450m;
int x,y,law;
+#ifdef CONFIG_4KSTACKS
unsigned long flags;
+#endif
if (!(vpm450m = kmalloc(sizeof(struct vpm450m), GFP_KERNEL)))
return NULL;
@@ -482,11 +491,15 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
* stack unfriendly. Stupid, stupid, stupid. So we disable IRQs so we
* don't run the risk of overflowing the stack while we initialize the
* octasic. */
+#ifdef CONFIG_4KSTACKS
local_irq_save(flags);
+#endif
ulResult = Oct6100ChipOpen(vpm450m->pApiInstance, ChipOpen);
if (ulResult != cOCT6100_ERR_OK) {
printk("Failed to open chip, code %08x!\n", ulResult);
+#ifdef CONFIG_4KSTACKS
local_irq_restore(flags);
+#endif
kfree(vpm450m);
kfree(ChipOpen);
kfree(ChannelOpen);
@@ -541,7 +554,9 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw, int numspans, const struct f
}
}
+#ifdef CONFIG_4KSTACKS
local_irq_restore(flags);
+#endif
kfree(ChipOpen);
kfree(ChannelOpen);
return vpm450m;