wait-for-power.patch
[u-boot-openmoko/mini2440.git] / drivers / net / nicext.h
blob4074972c07e7c5df81798f1634beb98dc1e218f5
1 /****************************************************************************
2 * Copyright(c) 2000-2001 Broadcom Corporation. All rights reserved.
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.
8 * Name: nicext.h
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.
22 * Author: Frankie Fan
24 * Created: September 17, 2000
26 ****************************************************************************/
27 #ifndef _nicext_h_
28 #define _nicext_h_
31 * ioctl for NICE
33 #define SIOCNICE SIOCDEVPRIVATE+7
36 * SIOCNICE:
38 * The following structure needs to be less than IFNAMSIZ (16 bytes) because
39 * we're overloading ifreq.ifr_ifru.
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.
45 struct nice_req
47 __u32 cmd;
49 union
51 #ifdef __KERNEL__
52 /* cmd = NICE_CMD_SET_RX or NICE_CMD_GET_RX */
53 struct
55 void (*nrqus1_rx)( struct sk_buff*, void* );
56 void* nrqus1_ctx;
57 } nrqu_nrqus1;
59 /* cmd = NICE_CMD_QUERY_SUPPORT */
60 struct
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;
67 #endif
69 /* cmd = NICE_CMD_GET_SPEED */
70 struct
72 unsigned int nrqus3_speed; /* 0 if link is down, */
73 /* otherwise speed in Mbps */
74 } nrqu_nrqus3;
76 /* cmd = NICE_CMD_BLINK_LED */
77 struct
79 unsigned int nrqus4_blink_time; /* blink duration in seconds */
80 } nrqu_nrqus4;
82 } nrq_nrqu;
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
95 * magic constants
97 #define NICE_REQUESTOR_MAGIC 0x4543494E /* NICE in ascii */
98 #define NICE_DEVICE_MAGIC 0x4E494345 /* ECIN in ascii */
101 * command field
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
109 #endif /* _nicext_h_ */