1/*
2 * BCM44XX Ethernet Windows device driver custom OID definitions.
3 *
4 * Copyright 2007, 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 1.1.1.1 2008/10/15 03:25:54 james26_jang Exp $
12 */
13
14#ifndef _etioctl_h_
15#define	_etioctl_h_
16
17/*
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.
23 */
24#ifndef EPICTRL_COOKIE
25#define EPICTRL_COOKIE		0xABADCEDE
26#endif
27
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	ETCSPEED	7
36#define ETCPHYRD	9
37#define ETCPHYWR	10
38#define	ETCQOS		11
39#define ETCPHYRD2	12
40#define ETCPHYWR2	13
41#define ETCROBORD	14
42#define ETCROBOWR	15
43
44#if defined(linux)
45#define SIOCSETCUP		(SIOCDEVPRIVATE + ETCUP)
46#define SIOCSETCDOWN		(SIOCDEVPRIVATE + ETCDOWN)
47#define SIOCSETCLOOP		(SIOCDEVPRIVATE + ETCLOOP)
48#define SIOCGETCDUMP		(SIOCDEVPRIVATE + ETCDUMP)
49#define SIOCSETCSETMSGLEVEL	(SIOCDEVPRIVATE + ETCSETMSGLEVEL)
50#define SIOCSETCPROMISC		(SIOCDEVPRIVATE + ETCPROMISC)
51#define SIOCSETCTXDOWN		(SIOCDEVPRIVATE + 6)	/* obsolete */
52#define SIOCSETCSPEED		(SIOCDEVPRIVATE + ETCSPEED)
53#define SIOCTXGEN		(SIOCDEVPRIVATE + 8)
54#define SIOCGETCPHYRD		(SIOCDEVPRIVATE + ETCPHYRD)
55#define SIOCSETCPHYWR		(SIOCDEVPRIVATE + ETCPHYWR)
56#define SIOCSETCQOS		(SIOCDEVPRIVATE + ETCQOS)
57#define SIOCGETCPHYRD2		(SIOCDEVPRIVATE + ETCPHYRD2)
58#define SIOCSETCPHYWR2		(SIOCDEVPRIVATE + ETCPHYWR2)
59#define SIOCGETCROBORD		(SIOCDEVPRIVATE + ETCROBORD)
60#define SIOCSETCROBOWR		(SIOCDEVPRIVATE + ETCROBOWR)
61
62/* arg to SIOCTXGEN */
63struct txg {
64	uint32 num;		/* number of frames to send */
65	uint32 delay;		/* delay in microseconds between sending each */
66	uint32 size;		/* size of ether frame to send */
67	uchar buf[1514];	/* starting ether frame data */
68};
69#endif /* linux */
70
71/*
72 * custom OID support
73 *
74 * 0xFF - implementation specific OID
75 * 0xE4 - first byte of Broadcom PCI vendor ID
76 * 0x14 - second byte of Broadcom PCI vendor ID
77 * 0xXX - the custom OID number
78 */
79#define ET_OID_BASE		0xFFE41400 /* OID Base for ET */
80
81#define	OID_ET_UP				(ET_OID_BASE + ETCUP)
82#define	OID_ET_DOWN				(ET_OID_BASE + ETCDOWN)
83#define	OID_ET_LOOP				(ET_OID_BASE + ETCLOOP)
84#define	OID_ET_DUMP				(ET_OID_BASE + ETCDUMP)
85#define	OID_ET_SETMSGLEVEL			(ET_OID_BASE + ETCSETMSGLEVEL)
86#define	OID_ET_PROMISC				(ET_OID_BASE + ETCPROMISC)
87#define	OID_ET_TXDOWN				(ET_OID_BASE + 6)
88#define	OID_ET_SPEED				(ET_OID_BASE + ETCSPEED)
89#define	OID_ET_GETINSTANCE			(ET_OID_BASE + 8)
90#define	OID_ET_SETCALLBACK			(ET_OID_BASE + 9)
91#define	OID_ET_UNSETCALLBACK			(ET_OID_BASE + 10)
92
93#define IS_ET_OID(oid) (((oid) & 0xFFFFFF00) == 0xFFE41400)
94
95#define	ET_ISQUERYOID(oid)	((oid == OID_ET_DUMP) || (oid == OID_ET_GETINSTANCE))
96
97/* OID_ET_SETCALLBACK data type */
98typedef struct et_cb {
99	void (*fn)(void *, int);	/* Callback function */
100	void *context;				/* Passed to callback function */
101} et_cb_t;
102
103#endif /* _etioctl_h_ */
104