summaryrefslogtreecommitdiff
path: root/openpcd/firmware/src/openpcd.h
diff options
context:
space:
mode:
author(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-07-30 10:14:06 +0000
committer(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-07-30 10:14:06 +0000
commitc19a9345b92522c905f75fcdcd5d8fea6678887c (patch)
treefeb2999c0648b5066b4850910bebc0585c7938ef /openpcd/firmware/src/openpcd.h
parent616c33c49c3e6a2156a7489142915e32e7783073 (diff)
introduce new req_ctx api and handling
git-svn-id: https://svn.openpcd.org:2342/trunk@59 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpcd/firmware/src/openpcd.h')
-rw-r--r--openpcd/firmware/src/openpcd.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/openpcd/firmware/src/openpcd.h b/openpcd/firmware/src/openpcd.h
index 56304e1..fa93dce 100644
--- a/openpcd/firmware/src/openpcd.h
+++ b/openpcd/firmware/src/openpcd.h
@@ -23,7 +23,7 @@
#define OPENPCD_IRQ_PRIO_UDP (AT91C_AIC_PRIOR_LOWEST+1)
#define OPENPCD_IRQ_PRIO_RC632 AT91C_AIC_PRIOR_LOWEST
-#define MAX_REQSIZE 256
+#define MAX_REQSIZE 64
#define MAX_HDRSIZE 8
#define req_buf_payload(x) (x->data[x->hdr_len])
@@ -38,17 +38,29 @@ struct req_buf {
};
struct req_ctx {
- //u_int16_t seq; /* request sequence number */
-
- u_int32_t flags;
-
+ u_int16_t seq; /* request sequence number */
+ u_int16_t flags;
+ volatile u_int32_t state;
struct req_buf rx;
struct req_buf tx;
};
+#define RCTX_STATE_FREE 0x00
+#define RCTX_STATE_UDP_RCV_BUSY 0x01
+#define RCTX_STATE_UDP_RCV_DONE 0x02
+#define RCTX_STATE_MAIN_PROCESSING 0x03
+#define RCTX_STATE_RC632IRQ_BUSY 0x04
+
+#define RCTX_STATE_UDP_EP2_PENDING 0x10
+#define RCTX_STATE_UDP_EP2_BUSY 0x11
+
+#define RCTX_STATE_UDP_EP3_PENDING 0x12
+#define RCTX_STATE_UDP_EP3_BUSY 0x13
+
#define NUM_REQ_CTX 8
-extern struct req_ctx *req_ctx_find_get(void);
+extern struct req_ctx *req_ctx_find_get(unsigned long old_state, unsigned long new_state);
extern struct req_ctx *req_ctx_find_busy(void);
+extern void req_ctx_set_state(struct req_ctx *ctx, unsigned long new_state);
extern void req_ctx_put(struct req_ctx *ctx);
extern u_int8_t req_ctx_num(struct req_ctx *ctx);
personal git repositories of Harald Welte. Your mileage may vary