]> git.ipfire.org Git - people/ms/u-boot.git/blame - drivers/nicext.h
Files include/linux/byteorder/{big,little}_endian.h define
[people/ms/u-boot.git] / drivers / nicext.h
CommitLineData
fe8c2806
WD
1/****************************************************************************
2 * Copyright(c) 2000-2001 Broadcom Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation.
7 *
8 * Name: nicext.h
9 *
10 * Description: Broadcom Network Interface Card Extension (NICE) is an
11 * extension to Linux NET device kernel mode drivers.
12 * NICE is designed to provide additional functionalities,
13 * such as receive packet intercept. To support Broadcom NICE,
14 * the network device driver can be modified by adding an
15 * device ioctl handler and by indicating receiving packets
16 * to the NICE receive handler. Broadcom NICE will only be
17 * enabled by a NICE-aware intermediate driver, such as
18 * Broadcom Advanced Server Program Driver (BASP). When NICE
19 * is not enabled, the modified network device drivers
20 * functions exactly as other non-NICE aware drivers.
21 *
22 * Author: Frankie Fan
23 *
24 * Created: September 17, 2000
25 *
26 ****************************************************************************/
27#ifndef _nicext_h_
28#define _nicext_h_
29
30/*
31 * ioctl for NICE
32 */
33#define SIOCNICE SIOCDEVPRIVATE+7
34
35/*
36 * SIOCNICE:
37 *
38 * The following structure needs to be less than IFNAMSIZ (16 bytes) because
39 * we're overloading ifreq.ifr_ifru.
40 *
41 * If 16 bytes is not enough, we should consider relaxing this because
42 * this is no field after ifr_ifru in the ifreq structure. But we may
43 * run into future compatiability problem in case of changing struct ifreq.
44 */
45struct nice_req
46{
47 __u32 cmd;
48
49 union
50 {
51#ifdef __KERNEL__
8bde7f77
WD
52 /* cmd = NICE_CMD_SET_RX or NICE_CMD_GET_RX */
53 struct
54 {
55 void (*nrqus1_rx)( struct sk_buff*, void* );
56 void* nrqus1_ctx;
57 } nrqu_nrqus1;
fe8c2806 58
8bde7f77
WD
59 /* cmd = NICE_CMD_QUERY_SUPPORT */
60 struct
61 {
62 __u32 nrqus2_magic;
63 __u32 nrqus2_support_rx:1;
64 __u32 nrqus2_support_vlan:1;
65 __u32 nrqus2_support_get_speed:1;
66 } nrqu_nrqus2;
fe8c2806
WD
67#endif
68
8bde7f77
WD
69 /* cmd = NICE_CMD_GET_SPEED */
70 struct
71 {
72 unsigned int nrqus3_speed; /* 0 if link is down, */
73 /* otherwise speed in Mbps */
74 } nrqu_nrqus3;
fe8c2806 75
8bde7f77
WD
76 /* cmd = NICE_CMD_BLINK_LED */
77 struct
78 {
79 unsigned int nrqus4_blink_time; /* blink duration in seconds */
80 } nrqu_nrqus4;
fe8c2806
WD
81
82 } nrq_nrqu;
83};
84
85#define nrq_rx nrq_nrqu.nrqu_nrqus1.nrqus1_rx
86#define nrq_ctx nrq_nrqu.nrqu_nrqus1.nrqus1_ctx
87#define nrq_support_rx nrq_nrqu.nrqu_nrqus2.nrqus2_support_rx
88#define nrq_magic nrq_nrqu.nrqu_nrqus2.nrqus2_magic
89#define nrq_support_vlan nrq_nrqu.nrqu_nrqus2.nrqus2_support_vlan
90#define nrq_support_get_speed nrq_nrqu.nrqu_nrqus2.nrqus2_support_get_speed
91#define nrq_speed nrq_nrqu.nrqu_nrqus3.nrqus3_speed
92#define nrq_blink_time nrq_nrqu.nrqu_nrqus4.nrqus4_blink_time
93
94/*
95 * magic constants
96 */
97#define NICE_REQUESTOR_MAGIC 0x4543494E /* NICE in ascii */
98#define NICE_DEVICE_MAGIC 0x4E494345 /* ECIN in ascii */
99
100/*
101 * command field
102 */
103#define NICE_CMD_QUERY_SUPPORT 0x00000001
104#define NICE_CMD_SET_RX 0x00000002
105#define NICE_CMD_GET_RX 0x00000003
106#define NICE_CMD_GET_SPEED 0x00000004
107#define NICE_CMD_BLINK_LED 0x00000005
108
109#endif /* _nicext_h_ */