blob: ff422e77375509cb05329f15db345648465947f7 [file] [log] [blame]
wdenkfe8c2802002-11-03 00:38:21 +00001/****************************************************************************
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 */
Wolfgang Denka1be4762008-05-20 16:00:29 +020033#define SIOCNICE SIOCDEVPRIVATE+7
wdenkfe8c2802002-11-03 00:38:21 +000034
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__
wdenk57b2d802003-06-27 21:31:46 +000052 /* 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;
wdenkfe8c2802002-11-03 00:38:21 +000058
wdenk57b2d802003-06-27 21:31:46 +000059 /* 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;
wdenkfe8c2802002-11-03 00:38:21 +000067#endif
68
wdenk57b2d802003-06-27 21:31:46 +000069 /* 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;
wdenkfe8c2802002-11-03 00:38:21 +000075
wdenk57b2d802003-06-27 21:31:46 +000076 /* cmd = NICE_CMD_BLINK_LED */
77 struct
78 {
79 unsigned int nrqus4_blink_time; /* blink duration in seconds */
80 } nrqu_nrqus4;
wdenkfe8c2802002-11-03 00:38:21 +000081
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_ */