[TG3]: Set minimal hw interrupt mitigation.
[linux-2.6/verdex.git] / drivers / s390 / net / qeth_fs.h
blob5c9a51ce91b6287301364fc7e3179d3024a3bfac
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 #define VERSION_QETH_FS_H "$Revision: 1.9 $"
17 extern const char *VERSION_QETH_PROC_C;
18 extern const char *VERSION_QETH_SYS_C;
20 #ifdef CONFIG_PROC_FS
21 extern int
22 qeth_create_procfs_entries(void);
24 extern void
25 qeth_remove_procfs_entries(void);
26 #else
27 static inline int
28 qeth_create_procfs_entries(void)
30 return 0;
33 static inline void
34 qeth_remove_procfs_entries(void)
37 #endif /* CONFIG_PROC_FS */
39 extern int
40 qeth_create_device_attributes(struct device *dev);
42 extern void
43 qeth_remove_device_attributes(struct device *dev);
45 extern int
46 qeth_create_driver_attributes(void);
48 extern void
49 qeth_remove_driver_attributes(void);
52 * utility functions used in qeth_proc.c and qeth_sys.c
55 static inline const char *
56 qeth_get_checksum_str(struct qeth_card *card)
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";
66 static inline const char *
67 qeth_get_prioq_str(struct qeth_card *card, char *buf)
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;
78 static inline const char *
79 qeth_get_bufsize_str(struct qeth_card *card)
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";
93 static inline const char *
94 qeth_get_cardname(struct qeth_card *card)
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";
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";
115 return " n/a";
118 /* max length to be returned: 14 */
119 static inline const char *
120 qeth_get_cardname_short(struct qeth_card *card)
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";
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";
154 case QETH_CARD_TYPE_IQD:
155 return "HiperSockets";
156 default:
157 return "unknown";
160 return "n/a";
163 #endif /* __QETH_FS_H__ */