File: ccwgroup.h

package info (click to toggle)
s390-tools 2.40.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,288 kB
  • sloc: ansic: 187,079; sh: 12,157; cpp: 5,049; makefile: 2,812; perl: 2,541; asm: 1,097; python: 697; xml: 29
file content (67 lines) | stat: -rw-r--r-- 2,022 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * zdev - Modify and display the persistent configuration of devices
 *
 * Copyright IBM Corp. 2016, 2017
 *
 * s390-tools is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef CCWGROUP_H
#define CCWGROUP_H

#include <stdbool.h>

#include "ccw.h"
#include "exit_code.h"
#include "misc.h"

#define CCWGROUP_BUS		"ccwgroup"
#define CCWGROUP_MAX_DEVIDS	3

struct ns_range_iterator;
struct subtype;
struct attrib;

struct ccwgroup_devid {
	struct ccw_devid devid[CCWGROUP_MAX_DEVIDS];
	unsigned int num;
} __attribute__ ((packed));

/**
 * ccwgroup_subtype_data - CCWGROUP subtype specific information
 * @ccwgroupdrv: The name of the CCWGROUP device driver for this subtype
 * @ccwdrv: The name of the CCW device driver for this subtype
 * @rootdrv: The name used by the driver in root_device_register.
 * @mod: The name of the main kernel module for this subtype
 * @num_devs: Number of CCW devices that are combined to form one device
 */
struct ccwgroup_subtype_data {
	const char *ccwgroupdrv;
	const char *ccwdrv;
	const char *rootdrv;
	const char *mod;
	unsigned int num_devs;
};

extern struct subtype ccwgroup_subtype;

extern struct attrib ccwgroup_attr_online;

/* ID handling. */
exit_code_t ccwgroup_parse_devid(struct ccwgroup_devid *, const char *, err_t);
bool ccwgroup_parse_devid_simple(struct ccwgroup_devid *, const char *);
bool ccwgroup_is_id_similar(const char *);
char *ccwgroup_devid_to_str(struct ccwgroup_devid *);
int ccwgroup_cmp_ids(const char *, const char *);
int ccwgroup_cmp_parsed_ids(const void *, const void *);
int ccwgroup_qsort_cmp(const void *, const void *);
struct ccwgroup_devid *ccwgroup_copy_devid(struct ccwgroup_devid *);
char *ccwgroup_get_partial_id(const char *);
bool ccwgroup_is_id_in_range(const char *id, const char *range);

/* Namespace helpers. */
void ccwgroup_range_next(struct ns_range_iterator *);
bool ccwgroup_compatible_namespace(struct namespace *);

#endif /* CCWGROUP_H */