2011-02-23 20:48:06 +00:00
|
|
|
// (c) 2010 Thomas Schoebel-Theuer / 1&1 Internet AG
|
|
|
|
#ifndef MARS_SERVER_H
|
|
|
|
#define MARS_SERVER_H
|
|
|
|
|
|
|
|
#include <linux/wait.h>
|
|
|
|
|
|
|
|
#include "mars_net.h"
|
|
|
|
|
|
|
|
struct server_mref_aspect {
|
|
|
|
GENERIC_ASPECT(mref);
|
|
|
|
struct server_brick *brick;
|
2011-05-26 14:32:32 +00:00
|
|
|
struct list_head cb_head;
|
2011-02-23 20:48:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct server_output {
|
|
|
|
MARS_OUTPUT(server);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct server_brick {
|
|
|
|
MARS_BRICK(server);
|
2011-08-31 11:42:04 +00:00
|
|
|
struct list_head server_link;
|
2011-02-23 20:48:06 +00:00
|
|
|
atomic_t in_flight;
|
|
|
|
struct semaphore socket_sem;
|
2012-01-11 11:35:09 +00:00
|
|
|
struct mars_socket handler_socket;
|
2011-02-23 20:48:06 +00:00
|
|
|
struct task_struct *handler_thread;
|
2011-05-26 14:32:32 +00:00
|
|
|
struct task_struct *cb_thread;
|
2011-02-23 20:48:06 +00:00
|
|
|
wait_queue_head_t startup_event;
|
2011-05-26 14:32:32 +00:00
|
|
|
wait_queue_head_t cb_event;
|
2011-02-23 20:48:06 +00:00
|
|
|
struct generic_object_layout mref_object_layout;
|
2011-05-26 14:32:32 +00:00
|
|
|
spinlock_t cb_lock;
|
|
|
|
struct list_head cb_read_list;
|
|
|
|
struct list_head cb_write_list;
|
|
|
|
bool cb_running;
|
2011-09-02 12:17:40 +00:00
|
|
|
bool self_shutdown;
|
2011-02-23 20:48:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct server_input {
|
|
|
|
MARS_INPUT(server);
|
|
|
|
};
|
|
|
|
|
|
|
|
MARS_TYPES(server);
|
|
|
|
|
|
|
|
#endif
|