udev_rules.h revision e5e322bc627a07d29a07e08f7c96bd644a3ae057
418N/A/*
2362N/A * udev_rules.h
418N/A *
418N/A * Userspace devfs
418N/A *
418N/A * Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
418N/A *
418N/A * This program is free software; you can redistribute it and/or modify it
418N/A * under the terms of the GNU General Public License as published by the
418N/A * Free Software Foundation version 2 of the License.
418N/A *
418N/A * This program is distributed in the hope that it will be useful, but
418N/A * WITHOUT ANY WARRANTY; without even the implied warranty of
418N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
418N/A * General Public License for more details.
418N/A *
418N/A * You should have received a copy of the GNU General Public License along
418N/A * with this program; if not, write to the Free Software Foundation, Inc.,
2362N/A * 675 Mass Ave, Cambridge, MA 02139, USA.
2362N/A *
2362N/A */
418N/A
418N/A#ifndef NAMEDEV_H
418N/A#define NAMEDEV_H
418N/A
418N/A#include "libsysfs/sysfs/libsysfs.h"
418N/A#include "udev.h"
418N/A#include "list.h"
418N/A
418N/A
418N/A#define FIELD_KERNEL "KERNEL"
418N/A#define FIELD_SUBSYSTEM "SUBSYSTEM"
418N/A#define FIELD_BUS "BUS"
418N/A#define FIELD_SYSFS "SYSFS"
418N/A#define FIELD_ID "ID"
418N/A#define FIELD_PROGRAM "PROGRAM"
418N/A#define FIELD_RESULT "RESULT"
418N/A#define FIELD_DRIVER "DRIVER"
418N/A#define FIELD_NAME "NAME"
418N/A#define FIELD_SYMLINK "SYMLINK"
418N/A#define FIELD_OWNER "OWNER"
418N/A#define FIELD_GROUP "GROUP"
418N/A#define FIELD_MODE "MODE"
418N/A#define FIELD_OPTIONS "OPTIONS"
418N/A
418N/A#define OPTION_IGNORE_DEVICE "ignore_device"
418N/A#define OPTION_IGNORE_REMOVE "ignore_remove"
418N/A#define OPTION_PARTITIONS "all_partitions"
418N/A
418N/A#define MAX_SYSFS_PAIRS 5
418N/A
418N/A#define RULEFILE_SUFFIX ".rules"
418N/A
418N/Astruct sysfs_pair {
418N/A char file[PATH_SIZE];
418N/A char value[VALUE_SIZE];
418N/A};
418N/A
418N/Astruct udev_rule {
418N/A struct list_head node;
418N/A
418N/A char kernel[NAME_SIZE];
418N/A char subsystem[NAME_SIZE];
418N/A char bus[NAME_SIZE];
418N/A char id[NAME_SIZE];
418N/A struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
418N/A char program[PATH_SIZE];
418N/A char result[PATH_SIZE];
418N/A char driver[NAME_SIZE];
418N/A char name[PATH_SIZE];
418N/A char symlink[PATH_SIZE];
418N/A
418N/A char owner[USER_SIZE];
418N/A char group[USER_SIZE];
418N/A mode_t mode;
418N/A
418N/A int partitions;
418N/A int ignore_device;
418N/A int ignore_remove;
418N/A
418N/A char config_file[PATH_SIZE];
418N/A int config_line;
418N/A};
418N/A
418N/Aextern struct list_head udev_rule_list;
418N/A
418N/Aextern int udev_rules_init(void);
418N/Aextern int udev_rules_get_name(struct udevice *udev, struct sysfs_class_device *class_dev);
418N/Aextern void udev_rules_close(void);
418N/A
418N/Aextern void udev_rule_dump(struct udev_rule *rule);
418N/Aextern void udev_rule_list_dump(void);
418N/A
418N/A#endif
418N/A