Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux/fpc-iii.git] / drivers / staging / ozwpan / ozproto.h
blob0c49c8a0e815f98b395edb516542641294a1bca5
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
9 #include <asm/byteorder.h>
10 #include "ozdbg.h"
11 #include "ozappif.h"
13 #define OZ_ALLOCATED_SPACE(__x) (LL_RESERVED_SPACE(__x)+(__x)->needed_tailroom)
15 /* Quantum in MS */
16 #define OZ_QUANTUM 8
17 /* Default timeouts.
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.
32 typedef int (*oz_app_init_fn_t)(void);
33 typedef void (*oz_app_term_fn_t)(void);
34 typedef int (*oz_app_start_fn_t)(struct oz_pd *pd, int resume);
35 typedef void (*oz_app_stop_fn_t)(struct oz_pd *pd, int pause);
36 typedef void (*oz_app_rx_fn_t)(struct oz_pd *pd, struct oz_elt *elt);
37 typedef int (*oz_app_hearbeat_fn_t)(struct oz_pd *pd);
38 typedef void (*oz_app_farewell_fn_t)(struct oz_pd *pd, u8 ep_num,
39 u8 *data, u8 len);
41 struct 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;
52 int oz_protocol_init(char *devs);
53 void oz_protocol_term(void);
54 int oz_get_pd_list(struct oz_mac_addr *addr, int max_count);
55 void oz_app_enable(int app_id, int enable);
56 struct oz_pd *oz_pd_find(const u8 *mac_addr);
57 void oz_binding_add(const char *net_dev);
58 void oz_binding_remove(const char *net_dev);
59 void oz_timer_add(struct oz_pd *pd, int type, unsigned long due_time);
60 void oz_timer_delete(struct oz_pd *pd, int type);
61 void oz_pd_request_heartbeat(struct oz_pd *pd);
62 void oz_polling_lock_bh(void);
63 void oz_polling_unlock_bh(void);
64 void oz_pd_heartbeat_handler(unsigned long data);
65 void oz_pd_timeout_handler(unsigned long data);
66 enum hrtimer_restart oz_pd_heartbeat_event(struct hrtimer *timer);
67 enum hrtimer_restart oz_pd_timeout_event(struct hrtimer *timer);
68 int oz_get_pd_status_list(char *pd_list, int max_count);
69 int oz_get_binding_list(char *buf, int max_if);
71 #endif /* _OZPROTO_H */