kbuild: Fix instrumentation removal breakage on avr32
[wrt350n-kernel.git] / drivers / s390 / net / qeth_fs.h
blob61faf05517d63bdb3071856e0383c485c4148858
1 /*
2 * linux/drivers/s390/net/qeth_fs.h
4 * Linux on zSeries OSA Express and HiperSockets support.
6 * This header file contains definitions related to sysfs and procfs.
8 * Copyright 2000,2003 IBM Corporation
9 * Author(s): Thomas Spatzier <tspat@de.ibm.com>
12 #ifndef __QETH_FS_H__
13 #define __QETH_FS_H__
15 #ifdef CONFIG_PROC_FS
16 extern int
17 qeth_create_procfs_entries(void);
19 extern void
20 qeth_remove_procfs_entries(void);
21 #else
22 static inline int
23 qeth_create_procfs_entries(void)
25 return 0;
28 static inline void
29 qeth_remove_procfs_entries(void)
32 #endif /* CONFIG_PROC_FS */
34 extern int
35 qeth_create_device_attributes(struct device *dev);
37 extern void
38 qeth_remove_device_attributes(struct device *dev);
40 extern int
41 qeth_create_device_attributes_osn(struct device *dev);
43 extern void
44 qeth_remove_device_attributes_osn(struct device *dev);
46 extern int
47 qeth_create_driver_attributes(void);
49 extern void
50 qeth_remove_driver_attributes(void);
53 * utility functions used in qeth_proc.c and qeth_sys.c
56 static inline const char *
57 qeth_get_checksum_str(struct qeth_card *card)
59 if (card->options.checksum_type == SW_CHECKSUMMING)
60 return "sw";
61 else if (card->options.checksum_type == HW_CHECKSUMMING)
62 return "hw";
63 else
64 return "no";
67 static inline const char *
68 qeth_get_prioq_str(struct qeth_card *card, char *buf)
70 if (card->qdio.do_prio_queueing == QETH_NO_PRIO_QUEUEING)
71 sprintf(buf, "always_q_%i", card->qdio.default_out_queue);
72 else
73 strcpy(buf, (card->qdio.do_prio_queueing ==
74 QETH_PRIO_Q_ING_PREC)?
75 "by_prec." : "by_ToS");
76 return buf;
79 static inline const char *
80 qeth_get_bufsize_str(struct qeth_card *card)
82 if (card->qdio.in_buf_size == 16384)
83 return "16k";
84 else if (card->qdio.in_buf_size == 24576)
85 return "24k";
86 else if (card->qdio.in_buf_size == 32768)
87 return "32k";
88 else if (card->qdio.in_buf_size == 40960)
89 return "40k";
90 else
91 return "64k";
94 static inline const char *
95 qeth_get_cardname(struct qeth_card *card)
97 if (card->info.guestlan) {
98 switch (card->info.type) {
99 case QETH_CARD_TYPE_OSAE:
100 return " Guest LAN QDIO";
101 case QETH_CARD_TYPE_IQD:
102 return " Guest LAN Hiper";
103 default:
104 return " unknown";
106 } else {
107 switch (card->info.type) {
108 case QETH_CARD_TYPE_OSAE:
109 return " OSD Express";
110 case QETH_CARD_TYPE_IQD:
111 return " HiperSockets";
112 case QETH_CARD_TYPE_OSN:
113 return " OSN QDIO";
114 default:
115 return " unknown";
118 return " n/a";
121 /* max length to be returned: 14 */
122 static inline const char *
123 qeth_get_cardname_short(struct qeth_card *card)
125 if (card->info.guestlan){
126 switch (card->info.type){
127 case QETH_CARD_TYPE_OSAE:
128 return "GuestLAN QDIO";
129 case QETH_CARD_TYPE_IQD:
130 return "GuestLAN Hiper";
131 default:
132 return "unknown";
134 } else {
135 switch (card->info.type) {
136 case QETH_CARD_TYPE_OSAE:
137 switch (card->info.link_type) {
138 case QETH_LINK_TYPE_FAST_ETH:
139 return "OSD_100";
140 case QETH_LINK_TYPE_HSTR:
141 return "HSTR";
142 case QETH_LINK_TYPE_GBIT_ETH:
143 return "OSD_1000";
144 case QETH_LINK_TYPE_10GBIT_ETH:
145 return "OSD_10GIG";
146 case QETH_LINK_TYPE_LANE_ETH100:
147 return "OSD_FE_LANE";
148 case QETH_LINK_TYPE_LANE_TR:
149 return "OSD_TR_LANE";
150 case QETH_LINK_TYPE_LANE_ETH1000:
151 return "OSD_GbE_LANE";
152 case QETH_LINK_TYPE_LANE:
153 return "OSD_ATM_LANE";
154 default:
155 return "OSD_Express";
157 case QETH_CARD_TYPE_IQD:
158 return "HiperSockets";
159 case QETH_CARD_TYPE_OSN:
160 return "OSN";
161 default:
162 return "unknown";
165 return "n/a";
168 #endif /* __QETH_FS_H__ */