zyxel-revert/context.h

44 lines
752 B
C
Raw Permalink Normal View History

2007-04-23 10:23:40 +02:00
#ifndef _CONTEXT_H_
#define _CONTEXT_H_
2007-05-02 20:42:12 +02:00
#include "filedata.h"
2007-05-02 21:21:59 +02:00
#include "linebuffer.h"
2007-04-23 10:23:40 +02:00
#include "list.h"
2007-05-02 21:52:00 +02:00
#define FLAG_CONFIG 0x01
#define FLAG_FIRMWARE 0x02
#define FLAG_SPEEDUP 0x04
2007-04-23 10:23:40 +02:00
struct context {
struct list_head list;
/* device local stuff */
int fd;
int (* dev_close)(struct context *context);
int (* dev_setbaudrate)(struct context *context, int baudrate);
char *devname;
void *dev_privdata;
/* event stuff */
struct event_fd *event;
/* statemachine */
int state;
2007-05-02 21:52:00 +02:00
int flags;
2007-04-23 10:23:40 +02:00
/* line buffer */
2007-05-02 21:21:59 +02:00
struct linebuffer *lbuf;
2007-04-23 10:23:40 +02:00
/* xmodem */
int lastpkt;
2007-05-02 20:42:12 +02:00
struct filedata *file;
2007-04-23 10:23:40 +02:00
};
2007-05-02 20:42:12 +02:00
struct context * create_context(const char *filename);
2007-04-23 10:23:40 +02:00
int destroy_context(struct context *ctx);
int context_close(void);
#endif /* _CONTEXT_H_ */