Broadcom SDK and wireless driver: another attempt to update to ver. 5.10.147.0
[tomato.git] / release / src-rt / include / etioctl.h
blob2ebfdb3c36d299172cd5b4918548d4dcf245b382
1 /*
2 * BCM44XX Ethernet Windows device driver custom OID definitions.
4 * Copyright (C) 2009, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11 * $Id: etioctl.h,v 13.14.2.2 2009/05/14 02:06:08 Exp $
14 #ifndef _etioctl_h_
15 #define _etioctl_h_
18 * Minor kludge alert:
19 * Duplicate a few definitions that irelay requires from epiioctl.h here
20 * so caller doesn't have to include this file and epiioctl.h .
21 * If this grows any more, it would be time to move these irelay-specific
22 * definitions out of the epiioctl.h and into a separate driver common file.
24 #ifndef EPICTRL_COOKIE
25 #define EPICTRL_COOKIE 0xABADCEDE
26 #endif
28 /* common ioctl definitions */
29 #define ETCUP 0
30 #define ETCDOWN 1
31 #define ETCLOOP 2
32 #define ETCDUMP 3
33 #define ETCSETMSGLEVEL 4
34 #define ETCPROMISC 5
35 #define ETCVAR 6
36 #define ETCSPEED 7
37 #define ETCPHYRD 9
38 #define ETCPHYWR 10
39 #define ETCQOS 11
40 #define ETCPHYRD2 12
41 #define ETCPHYWR2 13
42 #define ETCROBORD 14
43 #define ETCROBOWR 15
46 * A set of iovars defined for ET set/get
48 #define IOV_ET_POWER_SAVE_MODE 1
50 #if defined(linux)
51 #define SIOCSETCUP (SIOCDEVPRIVATE + ETCUP)
52 #define SIOCSETCDOWN (SIOCDEVPRIVATE + ETCDOWN)
53 #define SIOCSETCLOOP (SIOCDEVPRIVATE + ETCLOOP)
54 #define SIOCGETCDUMP (SIOCDEVPRIVATE + ETCDUMP)
55 #define SIOCSETCSETMSGLEVEL (SIOCDEVPRIVATE + ETCSETMSGLEVEL)
56 #define SIOCSETCPROMISC (SIOCDEVPRIVATE + ETCPROMISC)
57 #define SIOCSETGETVAR (SIOCDEVPRIVATE + ETCVAR)
58 #define SIOCSETCSPEED (SIOCDEVPRIVATE + ETCSPEED)
59 #define SIOCTXGEN (SIOCDEVPRIVATE + 8)
60 #define SIOCGETCPHYRD (SIOCDEVPRIVATE + ETCPHYRD)
61 #define SIOCSETCPHYWR (SIOCDEVPRIVATE + ETCPHYWR)
62 #define SIOCSETCQOS (SIOCDEVPRIVATE + ETCQOS)
63 #define SIOCGETCPHYRD2 (SIOCDEVPRIVATE + ETCPHYRD2)
64 #define SIOCSETCPHYWR2 (SIOCDEVPRIVATE + ETCPHYWR2)
65 #define SIOCGETCROBORD (SIOCDEVPRIVATE + ETCROBORD)
66 #define SIOCSETCROBOWR (SIOCDEVPRIVATE + ETCROBOWR)
68 /* structure to send a generic var set/get */
69 typedef struct et_var_s {
70 uint cmd;
71 uint set;
72 void *buf;
73 uint len;
74 } et_var_t;
76 /* arg to SIOCTXGEN */
77 struct txg {
78 uint32 num; /* number of frames to send */
79 uint32 delay; /* delay in microseconds between sending each */
80 uint32 size; /* size of ether frame to send */
81 uchar buf[1514]; /* starting ether frame data */
83 #endif /* linux */
87 * custom OID support
89 * 0xFF - implementation specific OID
90 * 0xE4 - first byte of Broadcom PCI vendor ID
91 * 0x14 - second byte of Broadcom PCI vendor ID
92 * 0xXX - the custom OID number
94 #define ET_OID_BASE 0xFFE41400 /* OID Base for ET */
96 #define OID_ET_UP (ET_OID_BASE + ETCUP)
97 #define OID_ET_DOWN (ET_OID_BASE + ETCDOWN)
98 #define OID_ET_LOOP (ET_OID_BASE + ETCLOOP)
99 #define OID_ET_DUMP (ET_OID_BASE + ETCDUMP)
100 #define OID_ET_SETMSGLEVEL (ET_OID_BASE + ETCSETMSGLEVEL)
101 #define OID_ET_PROMISC (ET_OID_BASE + ETCPROMISC)
102 #define OID_ET_TXDOWN (ET_OID_BASE + 6)
103 #define OID_ET_SPEED (ET_OID_BASE + ETCSPEED)
104 #define OID_ET_GETINSTANCE (ET_OID_BASE + 8)
105 #define OID_ET_SETCALLBACK (ET_OID_BASE + 9)
106 #define OID_ET_UNSETCALLBACK (ET_OID_BASE + 10)
108 #define IS_ET_OID(oid) (((oid) & 0xFFFFFF00) == 0xFFE41400)
110 #define ET_ISQUERYOID(oid) ((oid == OID_ET_DUMP) || (oid == OID_ET_GETINSTANCE))
112 /* OID_ET_SETCALLBACK data type */
113 typedef struct et_cb {
114 void (*fn)(void *, int); /* Callback function */
115 void *context; /* Passed to callback function */
116 } et_cb_t;
118 #endif /* _etioctl_h_ */