URL
https://opencores.org/ocsvn/igor/igor/trunk
[/] [igor/] [trunk/] [avr/] [eth-test/] [req.h] - Blame information for rev 4
Details |
Compare with Previous |
View Log
| Line No. |
Rev |
Author |
Line |
| 1 |
4 |
atypic |
#ifndef _REQ_H_
|
| 2 |
|
|
#define _REQ_H_
|
| 3 |
|
|
#include <stdint.h>
|
| 4 |
|
|
#include "device.h"
|
| 5 |
|
|
/* Type which will be called with the devices idata->priv as argument. */
|
| 6 |
|
|
|
| 7 |
|
|
/* XXX: We can allow an extra arg parameter to struct and req_make if needed. */
|
| 8 |
|
|
typedef void req_fn_t(void *);
|
| 9 |
|
|
struct req {
|
| 10 |
|
|
struct igordev *dev; /* What device we wish to communicate with. */
|
| 11 |
|
|
uint8_t type; /* What operation do we wish to perform. */
|
| 12 |
|
|
uint8_t flags; /* Flags for request. */
|
| 13 |
|
|
uint8_t taken; /* Internal allocation flags. */
|
| 14 |
|
|
uint32_t devnum; /* What device we are performing the request on. */
|
| 15 |
|
|
req_fn_t *func; /* Perform the running of this function. */
|
| 16 |
|
|
};
|
| 17 |
|
|
/* Request types. */
|
| 18 |
|
|
#define REQ_TYPE_READ 1
|
| 19 |
|
|
#define REQ_TYPE_WRITE 2
|
| 20 |
|
|
#define REQ_TYPE_FUNC 3
|
| 21 |
|
|
#define REQ_TYPE_FLUSH 4
|
| 22 |
|
|
/* Request flags. */
|
| 23 |
|
|
#define REQ_CALLBACK 0x01
|
| 24 |
|
|
|
| 25 |
|
|
/* Max number of requests. Regulates queue length and request pool size. */
|
| 26 |
|
|
#define MAXREQ 64
|
| 27 |
|
|
|
| 28 |
|
|
volatile struct req *req_alloc(void);
|
| 29 |
|
|
void req_free(volatile struct req *);
|
| 30 |
|
|
void req_init(void);
|
| 31 |
|
|
volatile struct req *req_make(struct igordev *, uint8_t, uint8_t, uint32_t, req_fn_t *);
|
| 32 |
|
|
|
| 33 |
|
|
#endif /* !_REQ_H_ */
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.