Resync with broadcom drivers 5.100.138.20 and utilities.
[tomato.git] / release / src-rt / include / etioctl.h
blob5cc773f1b0e8098bca665712f8b987f164010778
1 /*
2 * BCM44XX Ethernet Windows device driver custom OID definitions.
4 * Copyright (C) 2010, Broadcom Corporation. All Rights Reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * $Id: etioctl.h,v 13.17.86.2 2010-12-21 02:38:54 Exp $
20 #ifndef _etioctl_h_
21 #define _etioctl_h_
24 * Minor kludge alert:
25 * Duplicate a few definitions that irelay requires from epiioctl.h here
26 * so caller doesn't have to include this file and epiioctl.h .
27 * If this grows any more, it would be time to move these irelay-specific
28 * definitions out of the epiioctl.h and into a separate driver common file.
30 #ifndef EPICTRL_COOKIE
31 #define EPICTRL_COOKIE 0xABADCEDE
32 #endif
34 /* common ioctl definitions */
35 #define ETCUP 0
36 #define ETCDOWN 1
37 #define ETCLOOP 2
38 #define ETCDUMP 3
39 #define ETCSETMSGLEVEL 4
40 #define ETCPROMISC 5
41 #define ETCVAR 6
42 #define ETCSPEED 7
43 #define ETCPHYRD 9
44 #define ETCPHYWR 10
45 #define ETCQOS 11
46 #define ETCPHYRD2 12
47 #define ETCPHYWR2 13
48 #define ETCROBORD 14
49 #define ETCROBOWR 15
52 * A set of iovars defined for ET set/get
54 #define IOV_ET_POWER_SAVE_MODE 1
55 #define IOV_ET_CLEAR_DUMP 2
56 #define IOV_ET_ROBO_DEVID 3
58 #if defined(linux) || defined(__ECOS)
59 #define SIOCSETCUP (SIOCDEVPRIVATE + ETCUP)
60 #define SIOCSETCDOWN (SIOCDEVPRIVATE + ETCDOWN)
61 #define SIOCSETCLOOP (SIOCDEVPRIVATE + ETCLOOP)
62 #define SIOCGETCDUMP (SIOCDEVPRIVATE + ETCDUMP)
63 #define SIOCSETCSETMSGLEVEL (SIOCDEVPRIVATE + ETCSETMSGLEVEL)
64 #define SIOCSETCPROMISC (SIOCDEVPRIVATE + ETCPROMISC)
65 #define SIOCSETGETVAR (SIOCDEVPRIVATE + ETCVAR)
66 #define SIOCSETCSPEED (SIOCDEVPRIVATE + ETCSPEED)
67 #define SIOCTXGEN (SIOCDEVPRIVATE + 8)
68 #define SIOCGETCPHYRD (SIOCDEVPRIVATE + ETCPHYRD)
69 #define SIOCSETCPHYWR (SIOCDEVPRIVATE + ETCPHYWR)
70 #define SIOCSETCQOS (SIOCDEVPRIVATE + ETCQOS)
71 #define SIOCGETCPHYRD2 (SIOCDEVPRIVATE + ETCPHYRD2)
72 #define SIOCSETCPHYWR2 (SIOCDEVPRIVATE + ETCPHYWR2)
73 #define SIOCGETCROBORD (SIOCDEVPRIVATE + ETCROBORD)
74 #define SIOCSETCROBOWR (SIOCDEVPRIVATE + ETCROBOWR)
76 /* structure to send a generic var set/get */
77 typedef struct et_var_s {
78 uint cmd;
79 uint set;
80 void *buf;
81 uint len;
82 } et_var_t;
84 /* arg to SIOCTXGEN */
85 struct txg {
86 uint32 num; /* number of frames to send */
87 uint32 delay; /* delay in microseconds between sending each */
88 uint32 size; /* size of ether frame to send */
89 uchar buf[1514]; /* starting ether frame data */
91 #endif /* linux */
94 #if defined(__NetBSD__)
95 #define SIOCSETCUP _IOW('e', 0, struct ifreq)
96 #define SIOCSETCDOWN _IOW('e', 1, struct ifreq)
97 #define SIOCSETCLOOP _IOW('e', 2, struct ifreq)
98 #define SIOCGETCDUMP _IOWR('e', 3, struct ifreq)
99 #define SIOCSETCSETMSGLEVEL _IOW('e', 4, struct ifreq)
100 #define SIOCSETCPROMISC _IOW('e', 5, struct ifreq)
101 #define SIOCSETCTXDOWN _IOW('e', 6, struct ifreq) /* obsolete */
102 #define SIOCSETCSPEED _IOW('e', 7, struct ifreq)
103 #define SIOCTXGEN _IOW('e', 8, struct ifreq)
104 #define SIOCGETCPHYRD _IOWR('e', 9, struct ifreq)
105 #define SIOCSETCPHYWR _IOW('e', 10, struct ifreq)
106 #define SIOCSETCQOS _IOW('e', 11, struct ifreq)
107 #define SIOCGETCPHYRD2 _IOWR('e', 12, struct ifreq)
108 #define SIOCSETCPHYWR2 _IOW('e', 13, struct ifreq)
109 #define SIOCGETCROBORD _IOWR('e', 14, struct ifreq)
110 #define SIOCSETCROBOWR _IOW('e', 15, struct ifreq)
112 /* arg to SIOCTXGEN */
113 struct txg {
114 uint32 num; /* number of frames to send */
115 uint32 delay; /* delay in microseconds between sending each */
116 uint32 size; /* size of ether frame to send */
117 uchar buf[1514]; /* starting ether frame data */
119 #endif /* __NetBSD__ */
122 * custom OID support
124 * 0xFF - implementation specific OID
125 * 0xE4 - first byte of Broadcom PCI vendor ID
126 * 0x14 - second byte of Broadcom PCI vendor ID
127 * 0xXX - the custom OID number
129 #define ET_OID_BASE 0xFFE41400 /* OID Base for ET */
131 #define OID_ET_UP (ET_OID_BASE + ETCUP)
132 #define OID_ET_DOWN (ET_OID_BASE + ETCDOWN)
133 #define OID_ET_LOOP (ET_OID_BASE + ETCLOOP)
134 #define OID_ET_DUMP (ET_OID_BASE + ETCDUMP)
135 #define OID_ET_SETMSGLEVEL (ET_OID_BASE + ETCSETMSGLEVEL)
136 #define OID_ET_PROMISC (ET_OID_BASE + ETCPROMISC)
137 #define OID_ET_TXDOWN (ET_OID_BASE + 6)
138 #define OID_ET_SPEED (ET_OID_BASE + ETCSPEED)
139 #define OID_ET_GETINSTANCE (ET_OID_BASE + 8)
140 #define OID_ET_SETCALLBACK (ET_OID_BASE + 9)
141 #define OID_ET_UNSETCALLBACK (ET_OID_BASE + 10)
143 #define IS_ET_OID(oid) (((oid) & 0xFFFFFF00) == 0xFFE41400)
145 #define ET_ISQUERYOID(oid) ((oid == OID_ET_DUMP) || (oid == OID_ET_GETINSTANCE))
147 /* OID_ET_SETCALLBACK data type */
148 typedef struct et_cb {
149 void (*fn)(void *, int); /* Callback function */
150 void *context; /* Passed to callback function */
151 } et_cb_t;
153 #endif /* _etioctl_h_ */