~ubuntu-branches/ubuntu/vivid/oss4/vivid-proposed

« back to all changes in this revision

Viewing changes to setup/Linux/oss/build/osscore.c

  • Committer: Package Import Robot
  • Author(s): Sebastien NOEL
  • Date: 2014-10-23 22:47:56 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20141023224756-y9n3qw7w3ewjmu96
Tags: upstream-4.2-build2010
ImportĀ upstreamĀ versionĀ 4.2-build2010

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 */
8
8
 
9
9
/*
10
 
 * Copyright (C) 4Front Technologies 2005-2009. Released under GPL2 license.
 
10
 * Copyright (C) 4Front Technologies 2005-2014. Released under GPL2 license.
11
11
 */
12
12
//#include <linux/config.h>
13
13
typedef int *ioctl_arg;
130
130
  return t;
131
131
}
132
132
 
 
133
void *memmove(void *dest, const void *src, size_t n)
 
134
{
 
135
        return oss_memcpy(dest, src, n);
 
136
}
 
137
 
133
138
void *
134
139
oss_memset (void *t, int val, size_t l)
135
140
{
276
281
  return strlen (tmp);
277
282
}
278
283
 
 
284
 
 
285
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
279
286
static struct file_operations oss_proc_operations = {
280
287
  .read = oss_read_devfiles,
281
288
};
 
289
#else
 
290
static struct file_operations fops = { 
 
291
 .owner = THIS_MODULE,
 
292
 .read = oss_read_devfiles,
 
293
};
 
294
#endif
 
295
 
282
296
 
283
297
static void
284
298
init_proc_fs (void)
285
299
{
 
300
 
 
301
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
 
302
 
286
303
  if ((oss_proc_root =
287
 
       create_proc_entry ("opensound", 0700 | S_IFDIR, NULL)) == NULL)
288
 
    {
289
 
      oss_cmn_err (CE_CONT, "Cannot create /proc/opensound\n");
290
 
      return;
291
 
    }
 
304
         create_proc_entry ("opensound", 0700 | S_IFDIR, NULL)) == NULL)
 
305
     {
 
306
         oss_cmn_err (CE_CONT, "Cannot create /proc/opensound\n");
 
307
         return;
 
308
     }
292
309
 
293
310
  if ((oss_proc_devfiles =
294
 
       create_proc_entry ("devfiles", 0600, oss_proc_root)) == NULL)
295
 
    {
296
 
      oss_cmn_err (CE_CONT, "Cannot create /proc/opensound/devfiles\n");
297
 
      return;
298
 
    }
 
311
        create_proc_entry ("devfiles", 0600, oss_proc_root)) == NULL)
 
312
     {
 
313
         oss_cmn_err (CE_CONT, "Cannot create /proc/opensound/devfiles\n");
 
314
         return;
 
315
     }
299
316
 
300
317
  oss_proc_devfiles->proc_fops = &oss_proc_operations;
 
318
 
 
319
#else
 
320
 
 
321
  if ((oss_proc_root = 
 
322
         proc_mkdir ("opensound", NULL)) == NULL )
 
323
    {
 
324
   oss_cmn_err (CE_CONT, "Cannot create /proc/opensound\n");
 
325
   return;
 
326
    }
 
327
 
 
328
  if ((oss_proc_devfiles =
 
329
   proc_create ("devfiles", 0600, oss_proc_root, &fops)) == NULL)
 
330
    {
 
331
   oss_cmn_err (CE_CONT, "Cannot create /proc/opensound/devfiles\n");
 
332
         return;
 
333
    }
 
334
 
 
335
#endif
 
336
 
301
337
}
302
338
 
303
339
static void
433
469
  return current->pid;
434
470
}
435
471
 
436
 
int
 
472
unsigned int
437
473
oss_get_uid (void)
438
474
{
 
475
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
 
476
  return current->cred->uid.val;
 
477
#else 
439
478
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
440
479
  return current->cred->uid;
441
480
#else
442
481
  return current->uid;
443
482
#endif
 
483
#endif
 
484
  return 0;
444
485
}
445
486
 
446
487
typedef struct tmout_desc
890
931
  return -EINVAL;
891
932
}
892
933
 
 
934
#if 0
893
935
static int
894
936
oss_no_fsync (struct file *f, struct dentry *d, int datasync)
895
937
{
901
943
{
902
944
  return -EINVAL;
903
945
}
 
946
#endif
904
947
 
905
948
/*
906
949
 *      Wrappers for installing and uninstalling character and block devices.
953
996
  fop->llseek = oss_no_llseek;
954
997
  fop->read = tmp_read;
955
998
  fop->write = tmp_write;
 
999
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
956
1000
  fop->readdir = NULL;          /* tmp_readdir; */
 
1001
#endif
957
1002
  fop->poll = tmp_poll;
958
1003
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35)
959
1004
  fop->ioctl = tmp_ioctl;
961
1006
  fop->mmap = tmp_mmap;
962
1007
  fop->open = tmp_open;
963
1008
  fop->release = tmp_release;
964
 
  fop->fsync = oss_no_fsync;
965
 
  fop->fasync = oss_no_fasync;
 
1009
  fop->fsync = NULL; /* oss_no_fsync; */
 
1010
  fop->fasync = NULL; /* oss_no_fasync; */
966
1011
  fop->lock = NULL;
967
1012
  fop->flush = NULL;
968
1013
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
1631
1676
extern int oss_pci_read_config_irq (oss_device_t * osdev, unsigned long where,
1632
1677
                                    unsigned char *val);
1633
1678
 
1634
 
char *
 
1679
const char *
1635
1680
oss_pci_read_devpath (dev_info_t * dip)
1636
1681
{
1637
1682
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)