| udev.h | | udev.h | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 112 | |
| /* udev_device.c */ | | /* udev_device.c */ | |
| extern struct udevice *udev_device_init(void); | | extern struct udevice *udev_device_init(void); | |
| extern void udev_device_cleanup(struct udevice *udev); | | extern void udev_device_cleanup(struct udevice *udev); | |
| extern int udev_device_event(struct udev_rules *rules, struct udevice *udev
); | | extern int udev_device_event(struct udev_rules *rules, struct udevice *udev
); | |
| extern dev_t udev_device_get_devt(struct udevice *udev); | | extern dev_t udev_device_get_devt(struct udevice *udev); | |
| | | | |
| /* udev_sysfs.c */ | | /* udev_sysfs.c */ | |
| extern char sysfs_path[PATH_SIZE]; | | extern char sysfs_path[PATH_SIZE]; | |
| extern int sysfs_init(void); | | extern int sysfs_init(void); | |
| extern void sysfs_cleanup(void); | | extern void sysfs_cleanup(void); | |
|
| extern void sysfs_device_set_values(struct sysfs_device *dev, const char *d | | extern void sysfs_device_set_values(struct sysfs_device *dev, const char *d | |
| evpath, const char *subsystem); | | evpath, | |
| | | const char *subsystem, const char *drive | |
| | | r); | |
| extern struct sysfs_device *sysfs_device_get(const char *devpath); | | extern struct sysfs_device *sysfs_device_get(const char *devpath); | |
| extern struct sysfs_device *sysfs_device_get_parent(struct sysfs_device *de
v); | | extern struct sysfs_device *sysfs_device_get_parent(struct sysfs_device *de
v); | |
| extern struct sysfs_device *sysfs_device_get_parent_with_subsystem(struct s
ysfs_device *dev, const char *subsystem); | | extern struct sysfs_device *sysfs_device_get_parent_with_subsystem(struct s
ysfs_device *dev, const char *subsystem); | |
| extern char *sysfs_attr_get_value(const char *devpath, const char *attr_nam
e); | | extern char *sysfs_attr_get_value(const char *devpath, const char *attr_nam
e); | |
| | | | |
| /* udev_node.c */ | | /* udev_node.c */ | |
| extern int udev_node_mknod(struct udevice *udev, const char *file, dev_t de
vt, mode_t mode, uid_t uid, gid_t gid); | | extern int udev_node_mknod(struct udevice *udev, const char *file, dev_t de
vt, mode_t mode, uid_t uid, gid_t gid); | |
| extern int udev_node_add(struct udevice *udev, struct udevice *udev_old); | | extern int udev_node_add(struct udevice *udev, struct udevice *udev_old); | |
| extern void udev_node_remove_symlinks(struct udevice *udev); | | extern void udev_node_remove_symlinks(struct udevice *udev); | |
| extern int udev_node_remove(struct udevice *udev); | | extern int udev_node_remove(struct udevice *udev); | |
| | | | |
End of changes. 1 change blocks. |
| 2 lines changed or deleted | | 4 lines changed or added | |
|
| udev_libc_wrapper.h | | udev_libc_wrapper.h | |
| | | | |
| skipping to change at line 61 | | skipping to change at line 61 | |
| # define __NR_inotify_rm_watch 286 | | # define __NR_inotify_rm_watch 286 | |
| #elif defined (__alpha__) | | #elif defined (__alpha__) | |
| # define __NR_inotify_init 444 | | # define __NR_inotify_init 444 | |
| # define __NR_inotify_add_watch 445 | | # define __NR_inotify_add_watch 445 | |
| # define __NR_inotify_rm_watch 446 | | # define __NR_inotify_rm_watch 446 | |
| #elif defined (__sparc__) || defined (__sparc64__) | | #elif defined (__sparc__) || defined (__sparc64__) | |
| # define __NR_inotify_init 151 | | # define __NR_inotify_init 151 | |
| # define __NR_inotify_add_watch 152 | | # define __NR_inotify_add_watch 152 | |
| # define __NR_inotify_rm_watch 156 | | # define __NR_inotify_rm_watch 156 | |
| #elif defined (__arm__) | | #elif defined (__arm__) | |
|
| # define __NR_inotify_init 316 | | # define __NR_inotify_init __NR_SYSCALL_BASE+316 | |
| # define __NR_inotify_add_watch 317 | | # define __NR_inotify_add_watch __NR_SYSCALL_BASE+317 | |
| # define __NR_inotify_rm_watch 318 | | # define __NR_inotify_rm_watch __NR_SYSCALL_BASE+318 | |
| #elif defined (__sh__) | | #elif defined (__sh__) | |
| # define __NR_inotify_init 290 | | # define __NR_inotify_init 290 | |
| # define __NR_inotify_add_watch 291 | | # define __NR_inotify_add_watch 291 | |
| # define __NR_inotify_rm_watch 292 | | # define __NR_inotify_rm_watch 292 | |
| #elif defined (__hppa__) | | #elif defined (__hppa__) | |
| # define __NR_inotify_init 269 | | # define __NR_inotify_init 269 | |
| # define __NR_inotify_add_watch 270 | | # define __NR_inotify_add_watch 270 | |
| # define __NR_inotify_rm_watch 271 | | # define __NR_inotify_rm_watch 271 | |
| #elif defined (__mips__) | | #elif defined (__mips__) | |
| # include <sgidefs.h> | | # include <sgidefs.h> | |
| | | | |
| skipping to change at line 108 | | skipping to change at line 108 | |
| { | | { | |
| return -1; | | return -1; | |
| } | | } | |
| | | | |
| static inline int inotify_add_watch(int fd, const char *name, uint32_t mask
) | | static inline int inotify_add_watch(int fd, const char *name, uint32_t mask
) | |
| { | | { | |
| return -1; | | return -1; | |
| } | | } | |
| #else | | #else | |
| /* needed until /usr/include/sys/inotify.h is working */ | | /* needed until /usr/include/sys/inotify.h is working */ | |
|
| #ifdef __KLIBC__ | | #ifndef __GLIBC__ | |
| #include <sys/inotify.h> | | #include <sys/inotify.h> | |
| #else | | #else | |
| static inline int inotify_init(void) | | static inline int inotify_init(void) | |
| { | | { | |
| return syscall(__NR_inotify_init); | | return syscall(__NR_inotify_init); | |
| } | | } | |
| | | | |
| static inline int inotify_add_watch(int fd, const char *name, uint32_t mask
) | | static inline int inotify_add_watch(int fd, const char *name, uint32_t mask
) | |
| { | | { | |
| return syscall(__NR_inotify_add_watch, fd, name, mask); | | return syscall(__NR_inotify_add_watch, fd, name, mask); | |
| } | | } | |
|
| #endif /* __KLIBC__ */ | | #endif /* __GLIBC__ */ | |
| #endif /* __NR_inotify_init */ | | #endif /* __NR_inotify_init */ | |
| | | | |
| #ifndef IN_CREATE | | #ifndef IN_CREATE | |
| #define IN_CREATE 0x00000100 /* Subfile was created */ | | #define IN_CREATE 0x00000100 /* Subfile was created */ | |
| #define IN_MOVED_FROM 0x00000040 /* File was moved from X */ | | #define IN_MOVED_FROM 0x00000040 /* File was moved from X */ | |
| #define IN_MOVED_TO 0x00000080 /* File was moved to Y */ | | #define IN_MOVED_TO 0x00000080 /* File was moved to Y */ | |
| #define IN_DELETE 0x00000200 /* Subfile was deleted */ | | #define IN_DELETE 0x00000200 /* Subfile was deleted */ | |
| #define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed
*/ | | #define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed
*/ | |
| #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* mov
es */ | | #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* mov
es */ | |
| #endif /* IN_CREATE */ | | #endif /* IN_CREATE */ | |
| | | | |
| /* needed for our signal handlers to work */ | | /* needed for our signal handlers to work */ | |
| #undef asmlinkage | | #undef asmlinkage | |
| #ifdef __i386__ | | #ifdef __i386__ | |
| #define asmlinkage __attribute__((regparm(0))) | | #define asmlinkage __attribute__((regparm(0))) | |
| #else | | #else | |
| #define asmlinkage | | #define asmlinkage | |
| #endif /* __i386__ */ | | #endif /* __i386__ */ | |
| | | | |
|
| /* headers are broken on some lazy platforms */ | | /* headers are broken on some architectures */ | |
| #ifndef __FD_SET | | #ifndef __FD_SET | |
| #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | |
| #endif | | #endif | |
| #ifndef __FD_CLR | | #ifndef __FD_CLR | |
| #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | |
| #endif | | #endif | |
| #ifndef __FD_ISSET | | #ifndef __FD_ISSET | |
| #define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) !=
0) | | #define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) !=
0) | |
| #endif | | #endif | |
| #ifndef __FD_ZERO | | #ifndef __FD_ZERO | |
| #define __FD_ZERO(set) ((void) memset ((void*) (set), 0, sizeof (fd_set))) | | #define __FD_ZERO(set) ((void) memset ((void*) (set), 0, sizeof (fd_set))) | |
| #endif | | #endif | |
| | | | |
|
| /* missing in some lazy distros */ | | | |
| #ifndef NETLINK_KOBJECT_UEVENT | | #ifndef NETLINK_KOBJECT_UEVENT | |
|
| #define NETLINK_KOBJECT_UEVENT 15 | | #define NETLINK_KOBJECT_UEVENT 15 | |
| #endif | | #endif | |
| | | | |
| #ifndef SO_RCVBUFFORCE | | #ifndef SO_RCVBUFFORCE | |
| #if defined(__alpha__) || defined(__hppa__) || defined(__sparc__) || define
d(__sparc_v9__) | | #if defined(__alpha__) || defined(__hppa__) || defined(__sparc__) || define
d(__sparc_v9__) | |
| #define SO_RCVBUFFORCE 0x100b | | #define SO_RCVBUFFORCE 0x100b | |
| #else | | #else | |
| #define SO_RCVBUFFORCE 33 | | #define SO_RCVBUFFORCE 33 | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| | | | |
End of changes. 6 change blocks. |
| 8 lines changed or deleted | | 7 lines changed or added | |
|
| udevd.h | | udevd.h | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| * General Public License for more details. | | * General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License al
ong | | * You should have received a copy of the GNU General Public License al
ong | |
| * with this program; if not, write to the Free Software Foundation, In
c., | | * with this program; if not, write to the Free Software Foundation, In
c., | |
| * 675 Mass Ave, Cambridge, MA 02139, USA. | | * 675 Mass Ave, Cambridge, MA 02139, USA. | |
| * | | * | |
| */ | | */ | |
| | | | |
| #include "list.h" | | #include "list.h" | |
| | | | |
|
| #define UDEV_MAGIC "udevd_" UDEV_VERSION | | | |
| #define UDEVD_SOCK_PATH "/org/kernel/udev/udevd" | | | |
| | | | |
| #define UDEVD_PRIORITY -4 | | #define UDEVD_PRIORITY -4 | |
| #define UDEV_PRIORITY -2 | | #define UDEV_PRIORITY -2 | |
| | | | |
| #define EVENT_QUEUE_DIR ".udev/queue" | | #define EVENT_QUEUE_DIR ".udev/queue" | |
| #define EVENT_FAILED_DIR ".udev/failed" | | #define EVENT_FAILED_DIR ".udev/failed" | |
| #define EVENT_SEQNUM ".udev/uevent_seqnum" | | #define EVENT_SEQNUM ".udev/uevent_seqnum" | |
| | | | |
| /* maximum limit of forked childs */ | | /* maximum limit of forked childs */ | |
| #define UDEVD_MAX_CHILDS 256 | | #define UDEVD_MAX_CHILDS 256 | |
| /* start to throttle forking if maximum number of running childs in our ses
sion is reached */ | | /* start to throttle forking if maximum number of running childs in our ses
sion is reached */ | |
| #define UDEVD_MAX_CHILDS_RUNNING 16 | | #define UDEVD_MAX_CHILDS_RUNNING 16 | |
| | | | |
|
| /* environment buffer, should match the kernel's size in lib/kobject_uevent
.h */ | | /* linux/include/linux/kobject.h */ | |
| #define UEVENT_BUFFER_SIZE 2048 | | #define UEVENT_BUFFER_SIZE 2048 | |
|
| #define UEVENT_NUM_ENVP 64 | | #define UEVENT_NUM_ENVP 32 | |
| | | | |
|
| enum udevd_msg_type { | | #define UDEVD_CTRL_SOCK_PATH "/org/kernel/udev/udevd" | |
| UDEVD_UNKNOWN, | | #define UDEVD_CTRL_MAGIC "udevd_" UDEV_VERSION | |
| UDEVD_UEVENT_NETLINK, | | | |
| UDEVD_STOP_EXEC_QUEUE, | | enum udevd_ctrl_msg_type { | |
| UDEVD_START_EXEC_QUEUE, | | UDEVD_CTRL_UNKNOWN, | |
| UDEVD_SET_LOG_LEVEL, | | UDEVD_CTRL_STOP_EXEC_QUEUE, | |
| UDEVD_SET_MAX_CHILDS, | | UDEVD_CTRL_START_EXEC_QUEUE, | |
| UDEVD_RELOAD_RULES, | | UDEVD_CTRL_SET_LOG_LEVEL, | |
| | | UDEVD_CTRL_SET_MAX_CHILDS, | |
| | | UDEVD_CTRL_SET_MAX_CHILDS_RUNNING, | |
| | | UDEVD_CTRL_RELOAD_RULES, | |
| }; | | }; | |
| | | | |
|
| struct udevd_msg { | | struct udevd_ctrl_msg { | |
| char magic[32]; | | char magic[32]; | |
|
| enum udevd_msg_type type; | | enum udevd_ctrl_msg_type type; | |
| char envbuf[UEVENT_BUFFER_SIZE+512]; | | char buf[256]; | |
| }; | | }; | |
| | | | |
|
| struct uevent_msg { | | struct udevd_uevent_msg { | |
| enum udevd_msg_type type; | | | |
| struct list_head node; | | struct list_head node; | |
| pid_t pid; | | pid_t pid; | |
| int exitstatus; | | int exitstatus; | |
| time_t queue_time; | | time_t queue_time; | |
| char *action; | | char *action; | |
| char *devpath; | | char *devpath; | |
| char *subsystem; | | char *subsystem; | |
|
| | | char *driver; | |
| dev_t devt; | | dev_t devt; | |
| unsigned long long seqnum; | | unsigned long long seqnum; | |
| char *physdevpath; | | char *physdevpath; | |
| unsigned int timeout; | | unsigned int timeout; | |
| char *envp[UEVENT_NUM_ENVP+1]; | | char *envp[UEVENT_NUM_ENVP+1]; | |
| char envbuf[]; | | char envbuf[]; | |
| }; | | }; | |
| | | | |
End of changes. 8 change blocks. |
| 18 lines changed or deleted | | 18 lines changed or added | |
|