1 /* -----------------------------------------------------------------------------
2 * Copyright (c) 2011 Ozmo Inc
3 * Released under the GNU General Public License Version 2 (GPLv2).
4 * -----------------------------------------------------------------------------
9 #include <asm/byteorder.h>
13 #define OZ_ALLOCATED_SPACE(__x) (LL_RESERVED_SPACE(__x)+(__x)->needed_tailroom)
19 #define OZ_PRESLEEP_TOUT 11
21 /* Maximun sizes of tx frames. */
22 #define OZ_MAX_TX_SIZE 760
24 /* Maximum number of uncompleted isoc frames that can be pending in network. */
25 #define OZ_MAX_SUBMITTED_ISOC 16
27 /* Maximum number of uncompleted isoc frames that can be pending in Tx Queue. */
28 #define OZ_MAX_TX_QUEUE_ISOC 32
30 /* Application handler functions.
35 int (*start)(struct oz_pd *pd, int resume);
36 void (*stop)(struct oz_pd *pd, int pause);
37 void (*rx)(struct oz_pd *pd, struct oz_elt *elt);
38 int (*heartbeat)(struct oz_pd *pd);
39 void (*farewell)(struct oz_pd *pd, u8 ep_num, u8 *data, u8 len);
42 int oz_protocol_init(char *devs);
43 void oz_protocol_term(void);
44 int oz_get_pd_list(struct oz_mac_addr *addr, int max_count);
45 void oz_app_enable(int app_id, int enable);
46 struct oz_pd *oz_pd_find(const u8 *mac_addr);
47 void oz_binding_add(const char *net_dev);
48 void oz_binding_remove(const char *net_dev);
49 void oz_timer_add(struct oz_pd *pd, int type, unsigned long due_time);
50 void oz_timer_delete(struct oz_pd *pd, int type);
51 void oz_pd_request_heartbeat(struct oz_pd *pd);
52 void oz_pd_heartbeat_handler(unsigned long data);
53 void oz_pd_timeout_handler(unsigned long data);
54 enum hrtimer_restart oz_pd_heartbeat_event(struct hrtimer *timer);
55 enum hrtimer_restart oz_pd_timeout_event(struct hrtimer *timer);
56 int oz_get_pd_status_list(char *pd_list, int max_count);
57 int oz_get_binding_list(char *buf, int max_if);
59 extern struct kmem_cache *oz_elt_info_cache;
60 extern struct kmem_cache *oz_tx_frame_cache;
62 #endif /* _OZPROTO_H */