Skip to content
Snippets Groups Projects
Commit 39def136 authored by Alessandro Rubini's avatar Alessandro Rubini
Browse files

core: move header material to zio-internal.h (no technical change)


This also removes the ugly __ZIO_INTERNAL__ define we used until now

Signed-off-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent 79905a98
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,6 @@
#include <linux/init.h>
#include <linux/types.h>
#define __ZIO_INTERNAL__
#include <linux/zio.h>
#include <linux/zio-sysfs.h>
#include "zio-internal.h"
......
......@@ -300,67 +300,6 @@ void zio_ffa_free_s(struct zio_ffa *ffa, unsigned long addr, size_t size);
void zio_ffa_dump(struct zio_ffa *ffa); /* diagnostics */
void zio_ffa_reset(struct zio_ffa *ffa);
/*
* Internal code is for the core, it should not be needed by triggers etc
*/
#ifdef __ZIO_INTERNAL__
/* This list is used in the core to keep track of registered objects */
struct zio_object_list {
enum zio_object_type zobj_type;
struct list_head list;
};
struct zio_object_list_item {
struct list_head list;
char name[ZIO_OBJ_NAME_LEN]; /* object name copy*/
struct module *owner;
struct zio_obj_head *obj_head;
};
/* Global framework status (i.e., globals in zio-core) */
struct zio_status {
/* a pointer to set up standard ktype with create */
struct kobject *kobj;
/* The minor numbers are allocated with the first-fit allocator. */
struct zio_ffa *minors;
struct cdev chrdev;
dev_t basedev;
spinlock_t lock;
/* List of cset, used to retrieve a cset from a minor base*/
struct list_head list_cset;
/* The three lists of registered devices, with owner module */
struct zio_object_list all_devices;
struct zio_object_list all_trigger_types;
struct zio_object_list all_buffer_types;
};
extern struct zio_status zio_global_status;
/* Functions in zio-cdev.c */
int zio_minorbase_get(struct zio_cset *zcset);
void zio_minorbase_put(struct zio_cset *zcset);
int zio_register_cdev(void);
void zio_unregister_cdev(void);
int zio_create_chan_devices(struct zio_channel *zchan);
void zio_destroy_chan_devices(struct zio_channel *zchan);
int zio_init_buffer_fops(struct zio_buffer_type *zbuf);
int zio_fini_buffer_fops(struct zio_buffer_type *zbuf);
/* Exported but those that know to be the default */
int zio_default_buffer_init(void);
void zio_default_buffer_exit(void);
int zio_default_trigger_init(void);
void zio_default_trigger_exit(void);
struct zio_device *zio_find_device(char *name, uint32_t dev_id);
#endif /* __ZIO_INTERNAL__ */
#endif /* __KERNEL__ */
#endif /* __ZIO_H__ */
......@@ -9,7 +9,6 @@
#include <linux/init.h>
#include <linux/types.h>
#define __ZIO_INTERNAL__
#include <linux/zio.h>
#include <linux/zio-sysfs.h>
#include <linux/zio-buffer.h>
......
......@@ -10,13 +10,12 @@
#include <linux/sched.h>
#include <linux/uaccess.h>
#define __ZIO_INTERNAL__
#include <linux/zio.h>
#include <linux/zio-buffer.h>
#include <linux/zio-trigger.h>
#include "zio-internal.h"
static DEFINE_MUTEX(zmutex);
struct zio_status zio_global_status;
static struct zio_status *zstat = &zio_global_status; /* Always use ptr */
static ssize_t zio_show_version(struct class *class,
......
......@@ -10,7 +10,9 @@
#include <linux/string.h>
#include <linux/zio.h>
#include <linux/zio-buffer.h>
#include "zio-internal.h"
struct zio_status zio_global_status;
/*
* We use a local slab for control structures.
*/
......
......@@ -6,6 +6,61 @@ extern struct device_type zdev_generic_type;
extern struct device_type zobj_device_type;
extern struct device_type bi_device_type;
/* This list is used in the core to keep track of registered objects */
struct zio_object_list {
enum zio_object_type zobj_type;
struct list_head list;
};
struct zio_object_list_item {
struct list_head list;
char name[ZIO_OBJ_NAME_LEN]; /* object name copy*/
struct module *owner;
struct zio_obj_head *obj_head;
};
/* Global framework status (i.e., globals in zio-core) */
struct zio_status {
/* a pointer to set up standard ktype with create */
struct kobject *kobj;
/* The minor numbers are allocated with the first-fit allocator. */
struct zio_ffa *minors;
struct cdev chrdev;
dev_t basedev;
spinlock_t lock;
/* List of cset, used to retrieve a cset from a minor base*/
struct list_head list_cset;
/* The three lists of registered devices, with owner module */
struct zio_object_list all_devices;
struct zio_object_list all_trigger_types;
struct zio_object_list all_buffer_types;
};
extern struct zio_status zio_global_status;
/* Defined in zio-cdev.c */
extern int zio_minorbase_get(struct zio_cset *zcset);
extern void zio_minorbase_put(struct zio_cset *zcset);
extern int zio_register_cdev(void);
extern void zio_unregister_cdev(void);
extern int zio_create_chan_devices(struct zio_channel *zchan);
extern void zio_destroy_chan_devices(struct zio_channel *zchan);
extern int zio_init_buffer_fops(struct zio_buffer_type *zbuf);
extern int zio_fini_buffer_fops(struct zio_buffer_type *zbuf);
/* Exported but those that know to be the default */
extern int zio_default_buffer_init(void);
extern void zio_default_buffer_exit(void);
extern int zio_default_trigger_init(void);
extern void zio_default_trigger_exit(void);
extern struct zio_device *zio_find_device(char *name, uint32_t dev_id);
/* Defined in zio-sys.c */
extern int __zdev_register(struct zio_device *parent,
const struct zio_device_id *id);
extern int __zattr_set_copy(struct zio_attribute_set *dest,
......
......@@ -10,7 +10,6 @@
#include <linux/spinlock.h>
#include <linux/sysfs.h>
#define __ZIO_INTERNAL__
#include <linux/zio.h>
#include <linux/zio-sysfs.h>
#include <linux/zio-buffer.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment