diff options
Diffstat (limited to 'drivers/s390/net/qeth_fs.h')
-rw-r--r-- | drivers/s390/net/qeth_fs.h | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_fs.h b/drivers/s390/net/qeth_fs.h new file mode 100644 index 000000000000..5c9a51ce91b6 --- /dev/null +++ b/drivers/s390/net/qeth_fs.h | |||
@@ -0,0 +1,163 @@ | |||
1 | /* | ||
2 | * linux/drivers/s390/net/qeth_fs.h | ||
3 | * | ||
4 | * Linux on zSeries OSA Express and HiperSockets support. | ||
5 | * | ||
6 | * This header file contains definitions related to sysfs and procfs. | ||
7 | * | ||
8 | * Copyright 2000,2003 IBM Corporation | ||
9 | * Author(s): Thomas Spatzier <tspat@de.ibm.com> | ||
10 | * | ||
11 | */ | ||
12 | #ifndef __QETH_FS_H__ | ||
13 | #define __QETH_FS_H__ | ||
14 | |||
15 | #define VERSION_QETH_FS_H "$Revision: 1.9 $" | ||
16 | |||
17 | extern const char *VERSION_QETH_PROC_C; | ||
18 | extern const char *VERSION_QETH_SYS_C; | ||
19 | |||
20 | #ifdef CONFIG_PROC_FS | ||
21 | extern int | ||
22 | qeth_create_procfs_entries(void); | ||
23 | |||
24 | extern void | ||
25 | qeth_remove_procfs_entries(void); | ||
26 | #else | ||
27 | static inline int | ||
28 | qeth_create_procfs_entries(void) | ||
29 | { | ||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | static inline void | ||
34 | qeth_remove_procfs_entries(void) | ||
35 | { | ||
36 | } | ||
37 | #endif /* CONFIG_PROC_FS */ | ||
38 | |||
39 | extern int | ||
40 | qeth_create_device_attributes(struct device *dev); | ||
41 | |||
42 | extern void | ||
43 | qeth_remove_device_attributes(struct device *dev); | ||
44 | |||
45 | extern int | ||
46 | qeth_create_driver_attributes(void); | ||
47 | |||
48 | extern void | ||
49 | qeth_remove_driver_attributes(void); | ||
50 | |||
51 | /* | ||
52 | * utility functions used in qeth_proc.c and qeth_sys.c | ||
53 | */ | ||
54 | |||
55 | static inline const char * | ||
56 | qeth_get_checksum_str(struct qeth_card *card) | ||
57 | { | ||
58 | if (card->options.checksum_type == SW_CHECKSUMMING) | ||
59 | return "sw"; | ||
60 | else if (card->options.checksum_type == HW_CHECKSUMMING) | ||
61 | return "hw"; | ||
62 | else | ||
63 | return "no"; | ||
64 | } | ||
65 | |||
66 | static inline const char * | ||
67 | qeth_get_prioq_str(struct qeth_card *card, char *buf) | ||
68 | { | ||
69 | if (card->qdio.do_prio_queueing == QETH_NO_PRIO_QUEUEING) | ||
70 | sprintf(buf, "always_q_%i", card->qdio.default_out_queue); | ||
71 | else | ||
72 | strcpy(buf, (card->qdio.do_prio_queueing == | ||
73 | QETH_PRIO_Q_ING_PREC)? | ||
74 | "by_prec." : "by_ToS"); | ||
75 | return buf; | ||
76 | } | ||
77 | |||
78 | static inline const char * | ||
79 | qeth_get_bufsize_str(struct qeth_card *card) | ||
80 | { | ||
81 | if (card->qdio.in_buf_size == 16384) | ||
82 | return "16k"; | ||
83 | else if (card->qdio.in_buf_size == 24576) | ||
84 | return "24k"; | ||
85 | else if (card->qdio.in_buf_size == 32768) | ||
86 | return "32k"; | ||
87 | else if (card->qdio.in_buf_size == 40960) | ||
88 | return "40k"; | ||
89 | else | ||
90 | return "64k"; | ||
91 | } | ||
92 | |||
93 | static inline const char * | ||
94 | qeth_get_cardname(struct qeth_card *card) | ||
95 | { | ||
96 | if (card->info.guestlan) { | ||
97 | switch (card->info.type) { | ||
98 | case QETH_CARD_TYPE_OSAE: | ||
99 | return " Guest LAN QDIO"; | ||
100 | case QETH_CARD_TYPE_IQD: | ||
101 | return " Guest LAN Hiper"; | ||
102 | default: | ||
103 | return " unknown"; | ||
104 | } | ||
105 | } else { | ||
106 | switch (card->info.type) { | ||
107 | case QETH_CARD_TYPE_OSAE: | ||
108 | return " OSD Express"; | ||
109 | case QETH_CARD_TYPE_IQD: | ||
110 | return " HiperSockets"; | ||
111 | default: | ||
112 | return " unknown"; | ||
113 | } | ||
114 | } | ||
115 | return " n/a"; | ||
116 | } | ||
117 | |||
118 | /* max length to be returned: 14 */ | ||
119 | static inline const char * | ||
120 | qeth_get_cardname_short(struct qeth_card *card) | ||
121 | { | ||
122 | if (card->info.guestlan){ | ||
123 | switch (card->info.type){ | ||
124 | case QETH_CARD_TYPE_OSAE: | ||
125 | return "GuestLAN QDIO"; | ||
126 | case QETH_CARD_TYPE_IQD: | ||
127 | return "GuestLAN Hiper"; | ||
128 | default: | ||
129 | return "unknown"; | ||
130 | } | ||
131 | } else { | ||
132 | switch (card->info.type) { | ||
133 | case QETH_CARD_TYPE_OSAE: | ||
134 | switch (card->info.link_type) { | ||
135 | case QETH_LINK_TYPE_FAST_ETH: | ||
136 | return "OSD_100"; | ||
137 | case QETH_LINK_TYPE_HSTR: | ||
138 | return "HSTR"; | ||
139 | case QETH_LINK_TYPE_GBIT_ETH: | ||
140 | return "OSD_1000"; | ||
141 | case QETH_LINK_TYPE_10GBIT_ETH: | ||
142 | return "OSD_10GIG"; | ||
143 | case QETH_LINK_TYPE_LANE_ETH100: | ||
144 | return "OSD_FE_LANE"; | ||
145 | case QETH_LINK_TYPE_LANE_TR: | ||
146 | return "OSD_TR_LANE"; | ||
147 | case QETH_LINK_TYPE_LANE_ETH1000: | ||
148 | return "OSD_GbE_LANE"; | ||
149 | case QETH_LINK_TYPE_LANE: | ||
150 | return "OSD_ATM_LANE"; | ||
151 | default: | ||
152 | return "OSD_Express"; | ||
153 | } | ||
154 | case QETH_CARD_TYPE_IQD: | ||
155 | return "HiperSockets"; | ||
156 | default: | ||
157 | return "unknown"; | ||
158 | } | ||
159 | } | ||
160 | return "n/a"; | ||
161 | } | ||
162 | |||
163 | #endif /* __QETH_FS_H__ */ | ||