Skip to content

Commit

Permalink
Attempt to make stuff "play" with newer kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
jdixon committed Feb 1, 2013
1 parent 4c4a13c commit 573c7fa
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
7 changes: 4 additions & 3 deletions asterisk/channels/chan_simpleusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 535 $")
#include <alsa/asoundlib.h>
#include <linux/ppdev.h>
#include <linux/parport.h>
#include <linux/version.h>

#define DEBUG_CAPTURES 1

Expand Down Expand Up @@ -970,7 +971,7 @@ static struct usb_device *hid_device_init(char *desired_device)
desdev[strlen(desdev) -1 ] = 0;
if (strcasecmp(desdev,devstr)) continue;

#if defined(__ARM_ARCH_7A__)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
sprintf(str,"/sys/class/sound/card%d/device",i);
memset(desdev,0,sizeof(desdev));
if (readlink(str,desdev,sizeof(desdev) - 1) == -1) continue;
Expand Down Expand Up @@ -1053,7 +1054,7 @@ static int hid_device_mklist(void)
if (desdev[strlen(desdev) - 1] == '\n')
desdev[strlen(desdev) -1 ] = 0;
if (strcasecmp(desdev,devstr)) continue;
#if defined(__ARM_ARCH_7A__)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
sprintf(str,"/sys/class/sound/card%d/device",i);
memset(desdev,0,sizeof(desdev));
if (readlink(str,desdev,sizeof(desdev) - 1) == -1) continue;
Expand Down Expand Up @@ -1114,7 +1115,7 @@ char str[200],desdev[200],*cp;

for(i = 0;i < 32; i++)
{
#if defined(__ARM_ARCH_7A__)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
sprintf(str,"/sys/class/sound/card%d/device",i);
memset(desdev,0,sizeof(desdev));
if (readlink(str,desdev,sizeof(desdev) - 1) == -1) continue;
Expand Down
28 changes: 28 additions & 0 deletions asterisk/channels/chan_usbradio.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 535 $")
#include <search.h>
#include <linux/ppdev.h>
#include <linux/parport.h>
#include <linux/version.h>
#include <alsa/asoundlib.h>

//#define HAVE_XPMRX 1
Expand Down Expand Up @@ -1094,6 +1095,14 @@ static struct usb_device *hid_device_init(char *desired_device)
if (desdev[strlen(desdev) - 1] == '\n')
desdev[strlen(desdev) -1 ] = 0;
if (strcasecmp(desdev,devstr)) continue;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
sprintf(str,"/sys/class/sound/card%d/device",i);
memset(desdev,0,sizeof(desdev));
if (readlink(str,desdev,sizeof(desdev) - 1) == -1) continue;
cp = strrchr(desdev,'/');
if (!cp) continue;
cp++;
#else
if (i) sprintf(str,"/sys/class/sound/dsp%d/device",i);
else strcpy(str,"/sys/class/sound/dsp/device");
memset(desdev,0,sizeof(desdev));
Expand All @@ -1108,6 +1117,7 @@ static struct usb_device *hid_device_init(char *desired_device)
cp = strrchr(desdev,'/');
if (!cp) continue;
cp++;
#endif
break;
}
if (i >= 32) continue;
Expand Down Expand Up @@ -1169,6 +1179,14 @@ static int hid_device_mklist(void)
if (desdev[strlen(desdev) - 1] == '\n')
desdev[strlen(desdev) -1 ] = 0;
if (strcasecmp(desdev,devstr)) continue;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
sprintf(str,"/sys/class/sound/card%d/device",i);
memset(desdev,0,sizeof(desdev));
if (readlink(str,desdev,sizeof(desdev) - 1) == -1) continue;
cp = strrchr(desdev,'/');
if (!cp) continue;
cp++;
#else
if (i) sprintf(str,"/sys/class/sound/dsp%d/device",i);
else strcpy(str,"/sys/class/sound/dsp/device");
memset(desdev,0,sizeof(desdev));
Expand All @@ -1183,6 +1201,7 @@ static int hid_device_mklist(void)
cp = strrchr(desdev,'/');
if (!cp) continue;
cp++;
#endif
break;
}
if (i >= 32)
Expand Down Expand Up @@ -1222,6 +1241,14 @@ char str[200],desdev[200],*cp;

for(i = 0;i < 32; i++)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
sprintf(str,"/sys/class/sound/card%d/device",i);
memset(desdev,0,sizeof(desdev));
if (readlink(str,desdev,sizeof(desdev) - 1) == -1) continue;
cp = strrchr(desdev,'/');
if (!cp) continue;
cp++;
#else
if (i) sprintf(str,"/sys/class/sound/dsp%d/device",i);
else strcpy(str,"/sys/class/sound/dsp/device");
memset(desdev,0,sizeof(desdev));
Expand All @@ -1236,6 +1263,7 @@ char str[200],desdev[200],*cp;
cp = strrchr(desdev,'/');
if (!cp) continue;
cp++;
#endif
if (!strcasecmp(cp,devstr)) break;
}
if (i >= 32) return -1;
Expand Down
2 changes: 1 addition & 1 deletion asterisk/res/snmp/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ static u_char *ast_var_Version(struct variable *vp, oid *name, size_t *length,
*var_len = strlen(ASTERISK_VERSION);
return (u_char *)ASTERISK_VERSION;
case ASTVERTAG:
long_ret = ASTERISK_VERSION_NUM;
long_ret = 0;
return (u_char *)&long_ret;
default:
break;
Expand Down
2 changes: 2 additions & 0 deletions zaptel/kernel/pciradio.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ With driver: 303826 (1.5 %)
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/delay.h>

Expand Down
2 changes: 2 additions & 0 deletions zaptel/kernel/wctdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <asm/io.h>
#include "proslic.h"
#include "wctdm.h"
Expand Down
2 changes: 2 additions & 0 deletions zaptel/kernel/wctdm24xxp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Tx Gain - W/Pre-Emphasis: -23.99 to 0.00 db
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/slab.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
#include <linux/semaphore.h>
#else
Expand Down

0 comments on commit 573c7fa

Please sign in to comment.