summaryrefslogtreecommitdiff
path: root/wct4xxp
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-11-30 20:17:42 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-11-30 20:17:42 +0000
commit60ce4f51a67b4dd14e2d1c35e7d9b5bc000ff8e0 (patch)
treea30737babb75b33740ded47703d8a9cb07193944 /wct4xxp
parent7521b0cc52e5fe9a7a7fbc0d8a22d4e528ccee90 (diff)
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.2@3263 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 925ba76..278a650 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;
@@ -481,11 +490,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);
@@ -540,7 +553,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;