Merge Broadcom SDK and wireless driver 5.10.147.0 update
[tomato.git] / release / src-rt / emf / emf / emf_linux.h
blob885ab94c0a87cca0739b2c196dc32fca10d17268
1 /*
2 * Copyright (C) 2009, Broadcom Corporation
3 * All Rights Reserved.
4 *
5 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
6 * the contents of this file may not be disclosed to third parties, copied
7 * or duplicated in any form, in whole or in part, without the prior
8 * written permission of Broadcom Corporation.
10 * $Id: emf_linux.h,v 1.2 2007/04/05 23:10:03 Exp $
13 #ifndef _EMF_LINUX_H_
14 #define _EMF_LINUX_H_
16 #define EMF_MAX_INST 8
18 #ifdef EMFDBG
19 #define EMF_DUMP_PKT(data) \
20 { \
21 int32 i; \
22 for (i = 0; i < 64; i++) \
23 printk("%02x ", (data)[i]); \
24 printk("\n"); \
26 #else /* EMFDBG */
27 #define EMF_DUMP_PKT(data)
28 #endif /* EMFDBG */
30 #define EMF_BRPORT_STATE(if) (((br_port_t *)((if)->br_port))->state)
32 typedef struct emf_iflist
34 struct emf_iflist *next; /* Next pointer */
35 struct net_device *if_ptr; /* Interface pointer */
36 } emf_iflist_t;
38 typedef struct emf_info
40 struct emf_info *next; /* Next pointer */
41 int8 inst_id[16]; /* EMF Instance identifier */
42 osl_t *osh; /* OS layer handle */
43 struct net_device *br_dev; /* Bridge device pointer */
44 struct emfc_info *emfci; /* EMFC Global data handle */
45 uint32 hooks_reg; /* EMF Hooks registration */
46 emf_iflist_t *iflist_head; /* EMF interfaces list */
47 } emf_info_t;
49 typedef struct emf_struct
51 struct sock *nl_sk; /* Netlink socket */
52 emf_info_t *list_head; /* EMF instance list */
53 osl_lock_t lock; /* EMF locking */
54 int32 hooks_reg; /* EMF hooks registration ref count */
55 int32 inst_count; /* EMF instance count */
56 } emf_struct_t;
58 typedef struct br_port
60 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 6)
61 struct net_bridge *br;
62 struct net_device *dev;
63 struct list_head list;
64 uint8 priority;
65 uint8 state;
66 #else
67 struct br_port *next;
68 struct net_bridge *br;
69 struct net_device *dev;
70 int32 port_no;
71 uint16 port_id;
72 int32 state;
73 #endif
74 } br_port_t;
76 static uint32 emf_br_pre_hook(uint32, struct sk_buff **,
77 const struct net_device *,
78 const struct net_device *,
79 int32 (*)(struct sk_buff *));
80 static uint32 emf_ip_post_hook(uint32, struct sk_buff **,
81 const struct net_device *,
82 const struct net_device *,
83 int32 (*)(struct sk_buff *));
85 #endif /* _EMF_LINUX_H_ */