1
2
3
4
5
6#ifndef _OZPROTO_H
7#define _OZPROTO_H
8
9#include <asm/byteorder.h>
10#include "ozdbg.h"
11#include "ozappif.h"
12
13#define OZ_ALLOCATED_SPACE(__x) (LL_RESERVED_SPACE(__x)+(__x)->needed_tailroom)
14
15
16#define OZ_QUANTUM 8
17
18
19#define OZ_PRESLEEP_TOUT 11
20
21
22#define OZ_MAX_TX_SIZE 760
23
24
25#define OZ_MAX_SUBMITTED_ISOC 16
26
27
28#define OZ_MAX_TX_QUEUE_ISOC 32
29
30
31
32typedef int (*oz_app_init_fn_t)(void);
33typedef void (*oz_app_term_fn_t)(void);
34typedef int (*oz_app_start_fn_t)(struct oz_pd *pd, int resume);
35typedef void (*oz_app_stop_fn_t)(struct oz_pd *pd, int pause);
36typedef void (*oz_app_rx_fn_t)(struct oz_pd *pd, struct oz_elt *elt);
37typedef int (*oz_app_hearbeat_fn_t)(struct oz_pd *pd);
38typedef void (*oz_app_farewell_fn_t)(struct oz_pd *pd, u8 ep_num,
39 u8 *data, u8 len);
40
41struct oz_app_if {
42 oz_app_init_fn_t init;
43 oz_app_term_fn_t term;
44 oz_app_start_fn_t start;
45 oz_app_stop_fn_t stop;
46 oz_app_rx_fn_t rx;
47 oz_app_hearbeat_fn_t heartbeat;
48 oz_app_farewell_fn_t farewell;
49 int app_id;
50};
51
52int oz_protocol_init(char *devs);
53void oz_protocol_term(void);
54int oz_get_pd_list(struct oz_mac_addr *addr, int max_count);
55void oz_app_enable(int app_id, int enable);
56struct oz_pd *oz_pd_find(const u8 *mac_addr);
57void oz_binding_add(const char *net_dev);
58void oz_binding_remove(const char *net_dev);
59void oz_timer_add(struct oz_pd *pd, int type, unsigned long due_time);
60void oz_timer_delete(struct oz_pd *pd, int type);
61void oz_pd_request_heartbeat(struct oz_pd *pd);
62void oz_polling_lock_bh(void);
63void oz_polling_unlock_bh(void);
64void oz_pd_heartbeat_handler(unsigned long data);
65void oz_pd_timeout_handler(unsigned long data);
66enum hrtimer_restart oz_pd_heartbeat_event(struct hrtimer *timer);
67enum hrtimer_restart oz_pd_timeout_event(struct hrtimer *timer);
68int oz_get_pd_status_list(char *pd_list, int max_count);
69int oz_get_binding_list(char *buf, int max_if);
70
71#endif
72