Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / ozwpan / ozproto.h
1 /* -----------------------------------------------------------------------------
2  * Copyright (c) 2011 Ozmo Inc
3  * Released under the GNU General Public License Version 2 (GPLv2).
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 /* Quantum in MS */
16 #define OZ_QUANTUM              8
17 /* Default timeouts.
18  */
19 #define OZ_PRESLEEP_TOUT        11
20
21 /* Maximun sizes of tx frames. */
22 #define OZ_MAX_TX_SIZE          760
23
24 /* Maximum number of uncompleted isoc frames that can be pending in network. */
25 #define OZ_MAX_SUBMITTED_ISOC   16
26
27 /* Maximum number of uncompleted isoc frames that can be pending in Tx Queue. */
28 #define OZ_MAX_TX_QUEUE_ISOC    32
29
30 /* Application handler functions.
31  */
32 struct oz_app_if {
33         int  (*init)(void);
34         void (*term)(void);
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);
40 };
41
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);
58
59 extern struct kmem_cache *oz_elt_info_cache;
60 extern struct kmem_cache *oz_tx_frame_cache;
61
62 #endif /* _OZPROTO_H */