From 64c962fed5f50a7f82f8b570e000cdcff757862b Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 25 Feb 2009 09:04:19 -0600 Subject: More cleanup. 2009-02-25 David Smith * debug.h: Removed unused variable '_stp_transport_state'. * print_new.c (stp_print_flush): Ifdef'ed out call to utt_reserve(). * runtime.h: Added _stp_warn() prototype. * transport/control.c: Includes control.h, mempool.c, and symbols.c. Renamed '_stp_attached' to '_stp_ctl_attached'. * transport/control.h: Removed _stp_pool_q declaration. * transport/debugfs.c (_stp_register_ctl_channel_fs): Uses _stp_get_module_dir(). * transport/transport.c: Cleanup. * transport/transport.h: Ditto. --- runtime/transport/control.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'runtime/transport/control.c') diff --git a/runtime/transport/control.c b/runtime/transport/control.c index edde244d..7626305a 100644 --- a/runtime/transport/control.c +++ b/runtime/transport/control.c @@ -9,6 +9,10 @@ * later version. */ +#include "control.h" +#include "../mempool.c" +#include "symbols.c" + static _stp_mempool_t *_stp_pool_q; static struct list_head _stp_ctl_ready_q; static DEFINE_SPINLOCK(_stp_ctl_ready_lock); @@ -192,7 +196,7 @@ static ssize_t _stp_ctl_read_cmd(struct file *file, char __user *buf, static int _stp_ctl_open_cmd(struct inode *inode, struct file *file) { - if (_stp_attached) + if (_stp_ctl_attached) return -1; _stp_attach(); return 0; @@ -200,7 +204,7 @@ static int _stp_ctl_open_cmd(struct inode *inode, struct file *file) static int _stp_ctl_close_cmd(struct inode *inode, struct file *file) { - if (_stp_attached) + if (_stp_ctl_attached) _stp_detach(); return 0; } -- cgit From 4a8c28f93fa29e47c604e80e383c826070d6c383 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 6 May 2009 12:25:02 -0500 Subject: Start of support for older transport and cleanup. * runtime/transport/control.c: Added inclusion of linux/delay.h to get declaration of msleep(). * runtime/transport/relay_v2.c: New skeleton file for transport version 2. * runtime/transport/ring_buffer.c: Cleanup. * runtime/transport/transport.c: Ditto. --- runtime/transport/control.c | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/transport/control.c') diff --git a/runtime/transport/control.c b/runtime/transport/control.c index 7626305a..4e07a0a7 100644 --- a/runtime/transport/control.c +++ b/runtime/transport/control.c @@ -12,6 +12,7 @@ #include "control.h" #include "../mempool.c" #include "symbols.c" +#include static _stp_mempool_t *_stp_pool_q; static struct list_head _stp_ctl_ready_q; -- cgit From 01adca5bca8d61e3fdf09017496deec8859fe12d Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 3 Jun 2009 13:04:54 -0500 Subject: Fixed STP_TRANSPORT_VERSION 1 behavior. * runtime/transport/control.c (_stp_ctl_write_dbug): Added support for more messages. * runtime/transport/relay_v2.c (_stp_transport_data_fs_start): New function. (_stp_transport_data_fs_stop): Ditto. (_stp_transport_data_fs_close): Moved some functionality into _stp_transport_data_fs_stop() and calls _stp_transport_data_fs_stop() also. (_stp_transport_data_fs_init): Moved some functionality into _stp_transport_data_fs_start() and calls _stp_transport_data_fs_start() also. * runtime/transport/relayfs.c (_stp_transport_data_fs_start): New function. (_stp_transport_data_fs_stop): Ditto. (_stp_transport_data_fs_close): Moved some functionality into _stp_transport_data_fs_stop() and calls _stp_transport_data_fs_stop() also. (_stp_transport_data_fs_init): Moved some functionality into _stp_transport_data_fs_start() and calls _stp_transport_data_fs_start() also. * runtime/transport/ring_buffer.c (_stp_transport_data_fs_start): New empty function. (_stp_transport_data_fs_stop): Ditto. * runtime/transport/transport.h: Added _stp_transport_data_fs_start() and _stp_transport_data_fs_stop() prototypes. * runtime/transport/transport.c (_stp_cleanup_and_exit): Calls _stp_transport_data_fs_stop(). (_stp_transport_close): Calls _stp_transport_fs_close() earlier. (_stp_transport_init): Calls _stp_transport_data_fs_start(). --- runtime/transport/control.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'runtime/transport/control.c') diff --git a/runtime/transport/control.c b/runtime/transport/control.c index a1624152..11338eb2 100644 --- a/runtime/transport/control.c +++ b/runtime/transport/control.c @@ -100,6 +100,24 @@ static void _stp_ctl_write_dbug(int type, void *data, int len) case STP_TRANSPORT: _dbug("sending STP_TRANSPORT\n"); break; + case STP_CONNECT: + _dbug("sending STP_CONNECT\n"); + break; + case STP_DISCONNECT: + _dbug("sending STP_DISCONNECT\n"); + break; + case STP_BULK: + _dbug("sending STP_BULK\n"); + break; + case STP_READY: + case STP_RELOCATION: + case STP_BUF_INFO: + case STP_SUBBUFS_CONSUMED: + _dbug("sending old message\n"); + break; + case STP_REALTIME_DATA: + _dbug("sending %d bytes of STP_REALTIME_DATA\n", len); + break; case STP_REQUEST_EXIT: _dbug("sending STP_REQUEST_EXIT\n"); break; -- cgit From af274e5bd4593fa79c0489e0b6105f4bd23310c8 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 3 Jun 2009 15:20:46 -0500 Subject: Make sure all DEBUG_TRANS output uses printk. * runtime/transport/control.c (_stp_ctl_write_cmd): Calls dbug_trans2 instead of _dbug (so that printk is used instead of the transport itself). (_stp_ctl_write_dbug): Ditto. * runtime/debug.h (dbug_trans2): New macro. --- runtime/transport/control.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'runtime/transport/control.c') diff --git a/runtime/transport/control.c b/runtime/transport/control.c index 11338eb2..35130f0f 100644 --- a/runtime/transport/control.c +++ b/runtime/transport/control.c @@ -37,7 +37,8 @@ static ssize_t _stp_ctl_write_cmd(struct file *file, const char __user *buf, siz #ifdef DEBUG_TRANS if (type < STP_MAX_CMD) - _dbug("Got %s. len=%d\n", _stp_command_name[type], (int)count); + dbug_trans2("Got %s. len=%d\n", _stp_command_name[type], + (int)count); #endif switch (type) { @@ -84,45 +85,46 @@ static void _stp_ctl_write_dbug(int type, void *data, int len) char buf[64]; switch (type) { case STP_START: - _dbug("sending STP_START\n"); + dbug_trans2("sending STP_START\n"); break; case STP_EXIT: - _dbug("sending STP_EXIT\n"); + dbug_trans2("sending STP_EXIT\n"); break; case STP_OOB_DATA: snprintf(buf, sizeof(buf), "%s", (char *)data); - _dbug("sending %d bytes of STP_OOB_DATA: %s\n", len, buf); + dbug_trans2("sending %d bytes of STP_OOB_DATA: %s\n", len, + buf); break; case STP_SYSTEM: snprintf(buf, sizeof(buf), "%s", (char *)data); - _dbug("sending STP_SYSTEM: %s\n", buf); + dbug_trans2("sending STP_SYSTEM: %s\n", buf); break; case STP_TRANSPORT: - _dbug("sending STP_TRANSPORT\n"); + dbug_trans2("sending STP_TRANSPORT\n"); break; case STP_CONNECT: - _dbug("sending STP_CONNECT\n"); + dbug_trans2("sending STP_CONNECT\n"); break; case STP_DISCONNECT: - _dbug("sending STP_DISCONNECT\n"); + dbug_trans2("sending STP_DISCONNECT\n"); break; case STP_BULK: - _dbug("sending STP_BULK\n"); + dbug_trans2("sending STP_BULK\n"); break; case STP_READY: case STP_RELOCATION: case STP_BUF_INFO: case STP_SUBBUFS_CONSUMED: - _dbug("sending old message\n"); + dbug_trans2("sending old message\n"); break; case STP_REALTIME_DATA: - _dbug("sending %d bytes of STP_REALTIME_DATA\n", len); + dbug_trans2("sending %d bytes of STP_REALTIME_DATA\n", len); break; case STP_REQUEST_EXIT: - _dbug("sending STP_REQUEST_EXIT\n"); + dbug_trans2("sending STP_REQUEST_EXIT\n"); break; default: - _dbug("ERROR: unknown message type: %d\n", type); + dbug_trans2("ERROR: unknown message type: %d\n", type); break; } } -- cgit