Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 #include <stdio.h>
  2 #include <stdlib.h>
  3 #include <unistd.h>
  4 #include <pthread.h>
  5 #include <sys/types.h>
  6 #include <sys/stat.h>
  7 
  8 #include "devices.h"
  9 /*
 10  * default devices names
 11  */
 12 #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
 13 struct ng_device_config ng_dev = {
 14     video:  "/dev/bktr0",
 15     radio:  NULL,
 16     vbi:    "/dev/vbi0",
 17     dsp:    "/dev/dsp",
 18     mixer:  "/dev/mixer",
 19     video_scan: {
 20         "/dev/bktr0",
 21         "/dev/bktr1",
 22         "/dev/cxm0",
 23         "/dev/cxm1",
 24         NULL
 25     },
 26     mixer_scan: {
 27         "/dev/mixer",
 28         "/dev/mixer1", 
 29         "/dev/mixer2",
 30         "/dev/mixer3",
 31         NULL
 32     }
 33 };
 34 #endif
 35 #if defined(__linux__)
 36 struct ng_device_config ng_dev = {
 37     video:  "/dev/video0", /* <rant>thank you redhat breaking
 38                             * /dev/video as symbolic link to the
 39                             * default video device ... </rant> */
 40     radio:  "/dev/radio",
 41     vbi:    "/dev/vbi",
 42     dsp:    "/dev/dsp",
 43     mixer:  "/dev/mixer",
 44     video_scan:   {
 45         "/dev/video0",
 46         "/dev/video1",
 47         "/dev/video2",
 48         "/dev/video3",
 49         NULL
 50     },
 51     mixer_scan: {
 52         "/dev/mixer",
 53         "/dev/mixer1", 
 54         "/dev/mixer2",
 55         "/dev/mixer3",
 56         NULL
 57     }
 58 };
 59 
 60 struct ng_device_config ng_dev_devfs = {
 61     video:  "/dev/v4l/video0",
 62     radio:  "/dev/v4l/radio0",
 63     vbi:    "/dev/v4l/vbi0",
 64     dsp:    "/dev/sound/dsp",
 65     mixer:  "/dev/sound/mixer",
 66     video_scan:   {
 67         "/dev/v4l/video0",
 68         "/dev/v4l/video1",
 69         "/dev/v4l/video2",
 70         "/dev/v4l/video3",
 71         NULL
 72     },
 73     mixer_scan: {
 74         "/dev/sound/mixer",
 75         "/dev/sound/mixer1", 
 76         "/dev/sound/mixer2",
 77         "/dev/sound/mixer3",
 78         NULL
 79     }
 80 };
 81 #endif
 82 
 83 void
 84 ng_device_init(void)
 85 {
 86 #if defined(__linux__)
 87     struct stat st;
 88 
 89     if (-1 == lstat("/dev/.devfsd",&st))
 90         return;
 91     if (!S_ISCHR(st.st_mode))
 92         return;
 93     ng_dev = ng_dev_devfs;
 94 #endif
 95 }
 96 
  This page was automatically generated by the LXR engine.