diff options
Diffstat (limited to 'src/intf.c')
-rw-r--r-- | src/intf.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -4,8 +4,7 @@ #include "intf.h" #include "list.h" #include "fsm.h" - -int tsnif_debug = 0; +#include "debug.h" static struct tsnif_term *term_find(struct tsnif_handle *h, int type, int idx) { @@ -52,7 +51,7 @@ static int trans_cb(struct trans_handle *h, struct trans_msg *msg) struct tsnif_handle *handle; struct tsnif_term *term; - TSNIF_DEBUG("got cmd %d, type %d, idx %d\n", + TSNIF_DEBUG(INTF, "got cmd %d, type %d, idx %d\n", msg->cmd, msg->type, msg->idx); handle = container_of(h, struct tsnif_handle, trans); @@ -90,7 +89,7 @@ static int init_mgroup(struct tsnif_handle *h) { struct trans_msg msg; - TSNIF_DEBUG("sending mgroup command\n"); + TSNIF_DEBUG(INTF, "sending mgroup command\n"); msg.cmd = TSNIF_CMD_MGROUP; return trans_send(&h->trans, &msg); @@ -159,10 +158,10 @@ int tsnif_attach(struct tsnif_term *term) struct trans_msg msg; struct tsnif_handle *h = term->handle; - TSNIF_DEBUG("type %d, idx %d\n", term->type, term->idx); + TSNIF_DEBUG(INTF, "type %d, idx %d\n", term->type, term->idx); if (fsm_send(term, TSNIF_CMD_ATTACH)) { - TSNIF_DEBUG("wrong state (%d) skiping detach\n", + TSNIF_DEBUG(INTF, "wrong state (%d) skiping detach\n", term->state); return -1; } @@ -179,10 +178,10 @@ int tsnif_detach(struct tsnif_term *term) struct trans_msg msg; struct tsnif_handle *h = term->handle; - TSNIF_DEBUG("type %d, idx %d\n", term->type, term->idx); + TSNIF_DEBUG(INTF, "type %d, idx %d\n", term->type, term->idx); if (fsm_send(term, TSNIF_CMD_DETACH)) { - TSNIF_DEBUG("wrong state (%d) skiping detach\n", + TSNIF_DEBUG(INTF, "wrong state (%d) skiping detach\n", term->state); return -1; } @@ -198,7 +197,7 @@ int tsnif_list(struct tsnif_handle *h) { struct trans_msg msg; - TSNIF_DEBUG("sending list command\n"); + TSNIF_DEBUG(INTF, "sending list command\n"); memset(&msg, 0x0, sizeof(msg)); msg.cmd = TSNIF_CMD_TTY_LIST; |