blob: e422b41c656e26ba11185c225f350c0113d9cd38 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#ifdef CONFIG_PROC_FS
16extern int
17qeth_create_procfs_entries(void);
18
19extern void
20qeth_remove_procfs_entries(void);
21#else
22static inline int
23qeth_create_procfs_entries(void)
24{
25 return 0;
26}
27
28static inline void
29qeth_remove_procfs_entries(void)
30{
31}
32#endif /* CONFIG_PROC_FS */
33
34extern int
35qeth_create_device_attributes(struct device *dev);
36
37extern void
38qeth_remove_device_attributes(struct device *dev);
39
40extern int
Ursula Braun500f83a2005-09-30 10:19:19 +020041qeth_create_device_attributes_osn(struct device *dev);
42
43extern void
44qeth_remove_device_attributes_osn(struct device *dev);
45
46extern int
Linus Torvalds1da177e2005-04-16 15:20:36 -070047qeth_create_driver_attributes(void);
48
49extern void
50qeth_remove_driver_attributes(void);
51
52/*
53 * utility functions used in qeth_proc.c and qeth_sys.c
54 */
55
56static inline const char *
57qeth_get_checksum_str(struct qeth_card *card)
58{
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";
65}
66
67static inline const char *
68qeth_get_prioq_str(struct qeth_card *card, char *buf)
69{
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;
77}
78
79static inline const char *
80qeth_get_bufsize_str(struct qeth_card *card)
81{
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";
92}
93
94static inline const char *
95qeth_get_cardname(struct qeth_card *card)
96{
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";
105 }
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";
Ursula Braun500f83a2005-09-30 10:19:19 +0200112 case QETH_CARD_TYPE_OSN:
113 return " OSN QDIO";
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 default:
115 return " unknown";
116 }
117 }
118 return " n/a";
119}
120
121/* max length to be returned: 14 */
122static inline const char *
123qeth_get_cardname_short(struct qeth_card *card)
124{
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";
133 }
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";
156 }
157 case QETH_CARD_TYPE_IQD:
158 return "HiperSockets";
Ursula Braun500f83a2005-09-30 10:19:19 +0200159 case QETH_CARD_TYPE_OSN:
160 return "OSN";
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161 default:
162 return "unknown";
163 }
164 }
165 return "n/a";
166}
167
168#endif /* __QETH_FS_H__ */