Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bp_ioctl.h
Go to the documentation of this file.
1 /******************************************************************************/
2 /* */
3 /* Silicom Bypass Control Utility, Copyright (c) 2005-2007 Silicom */
4 /* All rights reserved. */
5 /* */
6 /* This program is free software; you can redistribute it and/or modify */
7 /* it under the terms of the GNU General Public License as published by */
8 /* the Free Software Foundation, located in the file LICENSE. */
9 /* */
10 /* */
11 /******************************************************************************/
12 
13 #ifndef BP_IOCTL_H
14 #define BP_IOCTL_H
15 
16 #define BP_CAP 0x01 /* BIT_0 */
17 #define BP_STATUS_CAP 0x02
18 #define BP_STATUS_CHANGE_CAP 0x04
19 #define SW_CTL_CAP 0x08
20 #define BP_DIS_CAP 0x10
21 #define BP_DIS_STATUS_CAP 0x20
22 #define STD_NIC_CAP 0x40
23 #define BP_PWOFF_ON_CAP 0x80
24 #define BP_PWOFF_OFF_CAP 0x0100
25 #define BP_PWOFF_CTL_CAP 0x0200
26 #define BP_PWUP_ON_CAP 0x0400
27 #define BP_PWUP_OFF_CAP 0x0800
28 #define BP_PWUP_CTL_CAP 0x1000
29 #define WD_CTL_CAP 0x2000
30 #define WD_STATUS_CAP 0x4000
31 #define WD_TIMEOUT_CAP 0x8000
32 #define TX_CTL_CAP 0x10000
33 #define TX_STATUS_CAP 0x20000
34 #define TAP_CAP 0x40000
35 #define TAP_STATUS_CAP 0x80000
36 #define TAP_STATUS_CHANGE_CAP 0x100000
37 #define TAP_DIS_CAP 0x200000
38 #define TAP_DIS_STATUS_CAP 0x400000
39 #define TAP_PWUP_ON_CAP 0x800000
40 #define TAP_PWUP_OFF_CAP 0x1000000
41 #define TAP_PWUP_CTL_CAP 0x2000000
42 #define NIC_CAP_NEG 0x4000000
43 #define TPL_CAP 0x8000000
44 #define DISC_CAP 0x10000000
45 #define DISC_DIS_CAP 0x20000000
46 #define DISC_PWUP_CTL_CAP 0x40000000
47 
48 #define TPL2_CAP_EX 0x01
49 #define DISC_PORT_CAP_EX 0x02
50 
51 #define WD_MIN_TIME_MASK(val) (val & 0xf)
52 #define WD_STEP_COUNT_MASK(val) ((val & 0xf) << 5)
53 #define WDT_STEP_TIME 0x10 /* BIT_4 */
54 
55 #define WD_MIN_TIME_GET(desc) (desc & 0xf)
56 #define WD_STEP_COUNT_GET(desc) ((desc>>5) & 0xf)
57 
58 typedef enum {
113 #ifdef BP_SELF_TEST
114  SET_BP_SELF_TEST = 200,
115  GET_BP_SELF_TEST,
116 #endif
117 
118 } CMND_TYPE_SD;
119 
120 /*
121 * The major device number. We can't rely on dynamic
122 * registration any more, because ioctls need to know
123 * it.
124 */
125 
126 #define MAGIC_NUM 'J'
127 
128 /* for passing single values */
129 struct bpctl_cmd {
130  int status;
131  int data[8];
132  int in_param[8];
133  int out_param[8];
134 };
135 
136 #define IOCTL_TX_MSG(cmd) _IOWR(MAGIC_NUM, cmd, struct bpctl_cmd)
137 
138 #define DEVICE_NAME "bpctl"
139 
140 #endif