From 60ce4f51a67b4dd14e2d1c35e7d9b5bc000ff8e0 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 30 Nov 2007 20:17:42 +0000 Subject: 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 --- wct4xxp/vpm450m.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'wct4xxp') 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 #include #include +#include #include "vpm450m.h" #include "oct6100api/oct6100_api.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) +#include +#else +#include +#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; -- cgit v1.2.3