xref: /linux/drivers/s390/net/qeth_core_sys.c (revision 6fdcba32711044c35c0e1b094cbd8f3f0b4472c9)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  *    Copyright IBM Corp. 2007
4  *    Author(s): Utz Bacher <utz.bacher@de.ibm.com>,
5  *		 Frank Pavlic <fpavlic@de.ibm.com>,
6  *		 Thomas Spatzier <tspat@de.ibm.com>,
7  *		 Frank Blaschka <frank.blaschka@de.ibm.com>
8  */
9 
10 #define KMSG_COMPONENT "qeth"
11 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
12 
13 #include <linux/list.h>
14 #include <linux/rwsem.h>
15 #include <asm/ebcdic.h>
16 
17 #include "qeth_core.h"
18 
19 static ssize_t qeth_dev_state_show(struct device *dev,
20 				struct device_attribute *attr, char *buf)
21 {
22 	struct qeth_card *card = dev_get_drvdata(dev);
23 
24 	switch (card->state) {
25 	case CARD_STATE_DOWN:
26 		return sprintf(buf, "DOWN\n");
27 	case CARD_STATE_HARDSETUP:
28 		return sprintf(buf, "HARDSETUP\n");
29 	case CARD_STATE_SOFTSETUP:
30 		if (card->dev->flags & IFF_UP)
31 			return sprintf(buf, "UP (LAN %s)\n",
32 				       netif_carrier_ok(card->dev) ? "ONLINE" :
33 								     "OFFLINE");
34 		return sprintf(buf, "SOFTSETUP\n");
35 	default:
36 		return sprintf(buf, "UNKNOWN\n");
37 	}
38 }
39 
40 static DEVICE_ATTR(state, 0444, qeth_dev_state_show, NULL);
41 
42 static ssize_t qeth_dev_chpid_show(struct device *dev,
43 				struct device_attribute *attr, char *buf)
44 {
45 	struct qeth_card *card = dev_get_drvdata(dev);
46 
47 	return sprintf(buf, "%02X\n", card->info.chpid);
48 }
49 
50 static DEVICE_ATTR(chpid, 0444, qeth_dev_chpid_show, NULL);
51 
52 static ssize_t qeth_dev_if_name_show(struct device *dev,
53 				struct device_attribute *attr, char *buf)
54 {
55 	struct qeth_card *card = dev_get_drvdata(dev);
56 
57 	return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card));
58 }
59 
60 static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL);
61 
62 static ssize_t qeth_dev_card_type_show(struct device *dev,
63 				struct device_attribute *attr, char *buf)
64 {
65 	struct qeth_card *card = dev_get_drvdata(dev);
66 
67 	return sprintf(buf, "%s\n", qeth_get_cardname_short(card));
68 }
69 
70 static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL);
71 
72 static const char *qeth_get_bufsize_str(struct qeth_card *card)
73 {
74 	if (card->qdio.in_buf_size == 16384)
75 		return "16k";
76 	else if (card->qdio.in_buf_size == 24576)
77 		return "24k";
78 	else if (card->qdio.in_buf_size == 32768)
79 		return "32k";
80 	else if (card->qdio.in_buf_size == 40960)
81 		return "40k";
82 	else
83 		return "64k";
84 }
85 
86 static ssize_t qeth_dev_inbuf_size_show(struct device *dev,
87 				struct device_attribute *attr, char *buf)
88 {
89 	struct qeth_card *card = dev_get_drvdata(dev);
90 
91 	return sprintf(buf, "%s\n", qeth_get_bufsize_str(card));
92 }
93 
94 static DEVICE_ATTR(inbuf_size, 0444, qeth_dev_inbuf_size_show, NULL);
95 
96 static ssize_t qeth_dev_portno_show(struct device *dev,
97 			struct device_attribute *attr, char *buf)
98 {
99 	struct qeth_card *card = dev_get_drvdata(dev);
100 
101 	return sprintf(buf, "%i\n", card->dev->dev_port);
102 }
103 
104 static ssize_t qeth_dev_portno_store(struct device *dev,
105 		struct device_attribute *attr, const char *buf, size_t count)
106 {
107 	struct qeth_card *card = dev_get_drvdata(dev);
108 	char *tmp;
109 	unsigned int portno, limit;
110 	int rc = 0;
111 
112 	mutex_lock(&card->conf_mutex);
113 	if (card->state != CARD_STATE_DOWN) {
114 		rc = -EPERM;
115 		goto out;
116 	}
117 
118 	portno = simple_strtoul(buf, &tmp, 16);
119 	if (portno > QETH_MAX_PORTNO) {
120 		rc = -EINVAL;
121 		goto out;
122 	}
123 	limit = (card->ssqd.pcnt ? card->ssqd.pcnt - 1 : card->ssqd.pcnt);
124 	if (portno > limit) {
125 		rc = -EINVAL;
126 		goto out;
127 	}
128 	card->dev->dev_port = portno;
129 out:
130 	mutex_unlock(&card->conf_mutex);
131 	return rc ? rc : count;
132 }
133 
134 static DEVICE_ATTR(portno, 0644, qeth_dev_portno_show, qeth_dev_portno_store);
135 
136 static ssize_t qeth_dev_portname_show(struct device *dev,
137 				struct device_attribute *attr, char *buf)
138 {
139 	return sprintf(buf, "no portname required\n");
140 }
141 
142 static ssize_t qeth_dev_portname_store(struct device *dev,
143 		struct device_attribute *attr, const char *buf, size_t count)
144 {
145 	struct qeth_card *card = dev_get_drvdata(dev);
146 
147 	dev_warn_once(&card->gdev->dev,
148 		      "portname is deprecated and is ignored\n");
149 	return count;
150 }
151 
152 static DEVICE_ATTR(portname, 0644, qeth_dev_portname_show,
153 		qeth_dev_portname_store);
154 
155 static ssize_t qeth_dev_prioqing_show(struct device *dev,
156 				struct device_attribute *attr, char *buf)
157 {
158 	struct qeth_card *card = dev_get_drvdata(dev);
159 
160 	switch (card->qdio.do_prio_queueing) {
161 	case QETH_PRIO_Q_ING_PREC:
162 		return sprintf(buf, "%s\n", "by precedence");
163 	case QETH_PRIO_Q_ING_TOS:
164 		return sprintf(buf, "%s\n", "by type of service");
165 	case QETH_PRIO_Q_ING_SKB:
166 		return sprintf(buf, "%s\n", "by skb-priority");
167 	case QETH_PRIO_Q_ING_VLAN:
168 		return sprintf(buf, "%s\n", "by VLAN headers");
169 	default:
170 		return sprintf(buf, "always queue %i\n",
171 			       card->qdio.default_out_queue);
172 	}
173 }
174 
175 static ssize_t qeth_dev_prioqing_store(struct device *dev,
176 		struct device_attribute *attr, const char *buf, size_t count)
177 {
178 	struct qeth_card *card = dev_get_drvdata(dev);
179 	int rc = 0;
180 
181 	if (IS_IQD(card))
182 		return -EOPNOTSUPP;
183 
184 	mutex_lock(&card->conf_mutex);
185 	if (card->state != CARD_STATE_DOWN) {
186 		rc = -EPERM;
187 		goto out;
188 	}
189 
190 	/* check if 1920 devices are supported ,
191 	 * if though we have to permit priority queueing
192 	 */
193 	if (card->qdio.no_out_queues == 1) {
194 		card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
195 		rc = -EPERM;
196 		goto out;
197 	}
198 
199 	if (sysfs_streq(buf, "prio_queueing_prec")) {
200 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC;
201 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
202 	} else if (sysfs_streq(buf, "prio_queueing_skb")) {
203 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_SKB;
204 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
205 	} else if (sysfs_streq(buf, "prio_queueing_tos")) {
206 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS;
207 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
208 	} else if (sysfs_streq(buf, "prio_queueing_vlan")) {
209 		if (IS_LAYER3(card)) {
210 			rc = -ENOTSUPP;
211 			goto out;
212 		}
213 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_VLAN;
214 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
215 	} else if (sysfs_streq(buf, "no_prio_queueing:0")) {
216 		card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
217 		card->qdio.default_out_queue = 0;
218 	} else if (sysfs_streq(buf, "no_prio_queueing:1")) {
219 		card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
220 		card->qdio.default_out_queue = 1;
221 	} else if (sysfs_streq(buf, "no_prio_queueing:2")) {
222 		card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
223 		card->qdio.default_out_queue = 2;
224 	} else if (sysfs_streq(buf, "no_prio_queueing:3")) {
225 		card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
226 		card->qdio.default_out_queue = 3;
227 	} else if (sysfs_streq(buf, "no_prio_queueing")) {
228 		card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
229 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
230 	} else
231 		rc = -EINVAL;
232 out:
233 	mutex_unlock(&card->conf_mutex);
234 	return rc ? rc : count;
235 }
236 
237 static DEVICE_ATTR(priority_queueing, 0644, qeth_dev_prioqing_show,
238 		qeth_dev_prioqing_store);
239 
240 static ssize_t qeth_dev_bufcnt_show(struct device *dev,
241 				struct device_attribute *attr, char *buf)
242 {
243 	struct qeth_card *card = dev_get_drvdata(dev);
244 
245 	return sprintf(buf, "%i\n", card->qdio.in_buf_pool.buf_count);
246 }
247 
248 static ssize_t qeth_dev_bufcnt_store(struct device *dev,
249 		struct device_attribute *attr, const char *buf, size_t count)
250 {
251 	struct qeth_card *card = dev_get_drvdata(dev);
252 	char *tmp;
253 	int cnt, old_cnt;
254 	int rc = 0;
255 
256 	mutex_lock(&card->conf_mutex);
257 	if (card->state != CARD_STATE_DOWN) {
258 		rc = -EPERM;
259 		goto out;
260 	}
261 
262 	old_cnt = card->qdio.in_buf_pool.buf_count;
263 	cnt = simple_strtoul(buf, &tmp, 10);
264 	cnt = (cnt < QETH_IN_BUF_COUNT_MIN) ? QETH_IN_BUF_COUNT_MIN :
265 		((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt);
266 	if (old_cnt != cnt) {
267 		rc = qeth_realloc_buffer_pool(card, cnt);
268 	}
269 out:
270 	mutex_unlock(&card->conf_mutex);
271 	return rc ? rc : count;
272 }
273 
274 static DEVICE_ATTR(buffer_count, 0644, qeth_dev_bufcnt_show,
275 		qeth_dev_bufcnt_store);
276 
277 static ssize_t qeth_dev_recover_store(struct device *dev,
278 		struct device_attribute *attr, const char *buf, size_t count)
279 {
280 	struct qeth_card *card = dev_get_drvdata(dev);
281 	char *tmp;
282 	int i;
283 
284 	if (!qeth_card_hw_is_reachable(card))
285 		return -EPERM;
286 
287 	i = simple_strtoul(buf, &tmp, 16);
288 	if (i == 1)
289 		qeth_schedule_recovery(card);
290 
291 	return count;
292 }
293 
294 static DEVICE_ATTR(recover, 0200, NULL, qeth_dev_recover_store);
295 
296 static ssize_t qeth_dev_performance_stats_show(struct device *dev,
297 				struct device_attribute *attr, char *buf)
298 {
299 	return sprintf(buf, "1\n");
300 }
301 
302 static ssize_t qeth_dev_performance_stats_store(struct device *dev,
303 		struct device_attribute *attr, const char *buf, size_t count)
304 {
305 	struct qeth_card *card = dev_get_drvdata(dev);
306 	struct qeth_qdio_out_q *queue;
307 	unsigned int i;
308 	bool reset;
309 	int rc;
310 
311 	rc = kstrtobool(buf, &reset);
312 	if (rc)
313 		return rc;
314 
315 	if (reset) {
316 		memset(&card->stats, 0, sizeof(card->stats));
317 		for (i = 0; i < card->qdio.no_out_queues; i++) {
318 			queue = card->qdio.out_qs[i];
319 			if (!queue)
320 				break;
321 			memset(&queue->stats, 0, sizeof(queue->stats));
322 		}
323 	}
324 
325 	return count;
326 }
327 
328 static DEVICE_ATTR(performance_stats, 0644, qeth_dev_performance_stats_show,
329 		   qeth_dev_performance_stats_store);
330 
331 static ssize_t qeth_dev_layer2_show(struct device *dev,
332 		struct device_attribute *attr, char *buf)
333 {
334 	struct qeth_card *card = dev_get_drvdata(dev);
335 
336 	return sprintf(buf, "%i\n", card->options.layer);
337 }
338 
339 static ssize_t qeth_dev_layer2_store(struct device *dev,
340 		struct device_attribute *attr, const char *buf, size_t count)
341 {
342 	struct qeth_card *card = dev_get_drvdata(dev);
343 	struct net_device *ndev;
344 	char *tmp;
345 	int i, rc = 0;
346 	enum qeth_discipline_id newdis;
347 
348 	mutex_lock(&card->discipline_mutex);
349 	if (card->state != CARD_STATE_DOWN) {
350 		rc = -EPERM;
351 		goto out;
352 	}
353 
354 	i = simple_strtoul(buf, &tmp, 16);
355 	switch (i) {
356 	case 0:
357 		newdis = QETH_DISCIPLINE_LAYER3;
358 		break;
359 	case 1:
360 		newdis = QETH_DISCIPLINE_LAYER2;
361 		break;
362 	default:
363 		rc = -EINVAL;
364 		goto out;
365 	}
366 
367 	if (card->options.layer == newdis)
368 		goto out;
369 	if (card->info.layer_enforced) {
370 		/* fixed layer, can't switch */
371 		rc = -EOPNOTSUPP;
372 		goto out;
373 	}
374 
375 	if (card->discipline) {
376 		/* start with a new, pristine netdevice: */
377 		ndev = qeth_clone_netdev(card->dev);
378 		if (!ndev) {
379 			rc = -ENOMEM;
380 			goto out;
381 		}
382 
383 		card->discipline->remove(card->gdev);
384 		qeth_core_free_discipline(card);
385 		free_netdev(card->dev);
386 		card->dev = ndev;
387 	}
388 
389 	rc = qeth_core_load_discipline(card, newdis);
390 	if (rc)
391 		goto out;
392 
393 	rc = card->discipline->setup(card->gdev);
394 	if (rc)
395 		qeth_core_free_discipline(card);
396 out:
397 	mutex_unlock(&card->discipline_mutex);
398 	return rc ? rc : count;
399 }
400 
401 static DEVICE_ATTR(layer2, 0644, qeth_dev_layer2_show,
402 		   qeth_dev_layer2_store);
403 
404 #define ATTR_QETH_ISOLATION_NONE	("none")
405 #define ATTR_QETH_ISOLATION_FWD		("forward")
406 #define ATTR_QETH_ISOLATION_DROP	("drop")
407 
408 static ssize_t qeth_dev_isolation_show(struct device *dev,
409 				struct device_attribute *attr, char *buf)
410 {
411 	struct qeth_card *card = dev_get_drvdata(dev);
412 
413 	switch (card->options.isolation) {
414 	case ISOLATION_MODE_NONE:
415 		return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_NONE);
416 	case ISOLATION_MODE_FWD:
417 		return snprintf(buf, 9, "%s\n", ATTR_QETH_ISOLATION_FWD);
418 	case ISOLATION_MODE_DROP:
419 		return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_DROP);
420 	default:
421 		return snprintf(buf, 5, "%s\n", "N/A");
422 	}
423 }
424 
425 static ssize_t qeth_dev_isolation_store(struct device *dev,
426 		struct device_attribute *attr, const char *buf, size_t count)
427 {
428 	struct qeth_card *card = dev_get_drvdata(dev);
429 	enum qeth_ipa_isolation_modes isolation;
430 	int rc = 0;
431 
432 	mutex_lock(&card->conf_mutex);
433 	if (!IS_OSD(card) && !IS_OSX(card)) {
434 		rc = -EOPNOTSUPP;
435 		dev_err(&card->gdev->dev, "Adapter does not "
436 			"support QDIO data connection isolation\n");
437 		goto out;
438 	}
439 
440 	/* parse input into isolation mode */
441 	if (sysfs_streq(buf, ATTR_QETH_ISOLATION_NONE)) {
442 		isolation = ISOLATION_MODE_NONE;
443 	} else if (sysfs_streq(buf, ATTR_QETH_ISOLATION_FWD)) {
444 		isolation = ISOLATION_MODE_FWD;
445 	} else if (sysfs_streq(buf, ATTR_QETH_ISOLATION_DROP)) {
446 		isolation = ISOLATION_MODE_DROP;
447 	} else {
448 		rc = -EINVAL;
449 		goto out;
450 	}
451 	rc = count;
452 
453 	/* defer IP assist if device is offline (until discipline->set_online)*/
454 	card->options.prev_isolation = card->options.isolation;
455 	card->options.isolation = isolation;
456 	if (qeth_card_hw_is_reachable(card)) {
457 		int ipa_rc = qeth_set_access_ctrl_online(card, 1);
458 		if (ipa_rc != 0)
459 			rc = ipa_rc;
460 	}
461 out:
462 	mutex_unlock(&card->conf_mutex);
463 	return rc;
464 }
465 
466 static DEVICE_ATTR(isolation, 0644, qeth_dev_isolation_show,
467 			qeth_dev_isolation_store);
468 
469 static ssize_t qeth_dev_switch_attrs_show(struct device *dev,
470 				struct device_attribute *attr, char *buf)
471 {
472 	struct qeth_card *card = dev_get_drvdata(dev);
473 	struct qeth_switch_info sw_info;
474 	int	rc = 0;
475 
476 	if (!qeth_card_hw_is_reachable(card))
477 		return sprintf(buf, "n/a\n");
478 
479 	rc = qeth_query_switch_attributes(card, &sw_info);
480 	if (rc)
481 		return rc;
482 
483 	if (!sw_info.capabilities)
484 		rc = sprintf(buf, "unknown");
485 
486 	if (sw_info.capabilities & QETH_SWITCH_FORW_802_1)
487 		rc = sprintf(buf, (sw_info.settings & QETH_SWITCH_FORW_802_1 ?
488 							"[802.1]" : "802.1"));
489 	if (sw_info.capabilities & QETH_SWITCH_FORW_REFL_RELAY)
490 		rc += sprintf(buf + rc,
491 			(sw_info.settings & QETH_SWITCH_FORW_REFL_RELAY ?
492 							" [rr]" : " rr"));
493 	rc += sprintf(buf + rc, "\n");
494 
495 	return rc;
496 }
497 
498 static DEVICE_ATTR(switch_attrs, 0444,
499 		   qeth_dev_switch_attrs_show, NULL);
500 
501 static ssize_t qeth_hw_trap_show(struct device *dev,
502 				struct device_attribute *attr, char *buf)
503 {
504 	struct qeth_card *card = dev_get_drvdata(dev);
505 
506 	if (card->info.hwtrap)
507 		return snprintf(buf, 5, "arm\n");
508 	else
509 		return snprintf(buf, 8, "disarm\n");
510 }
511 
512 static ssize_t qeth_hw_trap_store(struct device *dev,
513 		struct device_attribute *attr, const char *buf, size_t count)
514 {
515 	struct qeth_card *card = dev_get_drvdata(dev);
516 	int rc = 0;
517 	int state = 0;
518 
519 	mutex_lock(&card->conf_mutex);
520 	if (qeth_card_hw_is_reachable(card))
521 		state = 1;
522 
523 	if (sysfs_streq(buf, "arm") && !card->info.hwtrap) {
524 		if (state) {
525 			if (qeth_is_diagass_supported(card,
526 			    QETH_DIAGS_CMD_TRAP)) {
527 				rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM);
528 				if (!rc)
529 					card->info.hwtrap = 1;
530 			} else
531 				rc = -EINVAL;
532 		} else
533 			card->info.hwtrap = 1;
534 	} else if (sysfs_streq(buf, "disarm") && card->info.hwtrap) {
535 		if (state) {
536 			rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
537 			if (!rc)
538 				card->info.hwtrap = 0;
539 		} else
540 			card->info.hwtrap = 0;
541 	} else if (sysfs_streq(buf, "trap") && state && card->info.hwtrap)
542 		rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE);
543 	else
544 		rc = -EINVAL;
545 
546 	mutex_unlock(&card->conf_mutex);
547 	return rc ? rc : count;
548 }
549 
550 static DEVICE_ATTR(hw_trap, 0644, qeth_hw_trap_show,
551 		   qeth_hw_trap_store);
552 
553 static ssize_t qeth_dev_blkt_store(struct qeth_card *card,
554 		const char *buf, size_t count, int *value, int max_value)
555 {
556 	char *tmp;
557 	int i, rc = 0;
558 
559 	mutex_lock(&card->conf_mutex);
560 	if (card->state != CARD_STATE_DOWN) {
561 		rc = -EPERM;
562 		goto out;
563 	}
564 	i = simple_strtoul(buf, &tmp, 10);
565 	if (i <= max_value)
566 		*value = i;
567 	else
568 		rc = -EINVAL;
569 out:
570 	mutex_unlock(&card->conf_mutex);
571 	return rc ? rc : count;
572 }
573 
574 static ssize_t qeth_dev_blkt_total_show(struct device *dev,
575 				struct device_attribute *attr, char *buf)
576 {
577 	struct qeth_card *card = dev_get_drvdata(dev);
578 
579 	return sprintf(buf, "%i\n", card->info.blkt.time_total);
580 }
581 
582 static ssize_t qeth_dev_blkt_total_store(struct device *dev,
583 		struct device_attribute *attr, const char *buf, size_t count)
584 {
585 	struct qeth_card *card = dev_get_drvdata(dev);
586 
587 	return qeth_dev_blkt_store(card, buf, count,
588 				   &card->info.blkt.time_total, 5000);
589 }
590 
591 static DEVICE_ATTR(total, 0644, qeth_dev_blkt_total_show,
592 		   qeth_dev_blkt_total_store);
593 
594 static ssize_t qeth_dev_blkt_inter_show(struct device *dev,
595 				struct device_attribute *attr, char *buf)
596 {
597 	struct qeth_card *card = dev_get_drvdata(dev);
598 
599 	return sprintf(buf, "%i\n", card->info.blkt.inter_packet);
600 }
601 
602 static ssize_t qeth_dev_blkt_inter_store(struct device *dev,
603 		struct device_attribute *attr, const char *buf, size_t count)
604 {
605 	struct qeth_card *card = dev_get_drvdata(dev);
606 
607 	return qeth_dev_blkt_store(card, buf, count,
608 				   &card->info.blkt.inter_packet, 1000);
609 }
610 
611 static DEVICE_ATTR(inter, 0644, qeth_dev_blkt_inter_show,
612 		   qeth_dev_blkt_inter_store);
613 
614 static ssize_t qeth_dev_blkt_inter_jumbo_show(struct device *dev,
615 				struct device_attribute *attr, char *buf)
616 {
617 	struct qeth_card *card = dev_get_drvdata(dev);
618 
619 	return sprintf(buf, "%i\n", card->info.blkt.inter_packet_jumbo);
620 }
621 
622 static ssize_t qeth_dev_blkt_inter_jumbo_store(struct device *dev,
623 		struct device_attribute *attr, const char *buf, size_t count)
624 {
625 	struct qeth_card *card = dev_get_drvdata(dev);
626 
627 	return qeth_dev_blkt_store(card, buf, count,
628 				   &card->info.blkt.inter_packet_jumbo, 1000);
629 }
630 
631 static DEVICE_ATTR(inter_jumbo, 0644, qeth_dev_blkt_inter_jumbo_show,
632 		   qeth_dev_blkt_inter_jumbo_store);
633 
634 static struct attribute *qeth_blkt_device_attrs[] = {
635 	&dev_attr_total.attr,
636 	&dev_attr_inter.attr,
637 	&dev_attr_inter_jumbo.attr,
638 	NULL,
639 };
640 const struct attribute_group qeth_device_blkt_group = {
641 	.name = "blkt",
642 	.attrs = qeth_blkt_device_attrs,
643 };
644 EXPORT_SYMBOL_GPL(qeth_device_blkt_group);
645 
646 static struct attribute *qeth_device_attrs[] = {
647 	&dev_attr_state.attr,
648 	&dev_attr_chpid.attr,
649 	&dev_attr_if_name.attr,
650 	&dev_attr_card_type.attr,
651 	&dev_attr_inbuf_size.attr,
652 	&dev_attr_portno.attr,
653 	&dev_attr_portname.attr,
654 	&dev_attr_priority_queueing.attr,
655 	&dev_attr_buffer_count.attr,
656 	&dev_attr_recover.attr,
657 	&dev_attr_performance_stats.attr,
658 	&dev_attr_layer2.attr,
659 	&dev_attr_isolation.attr,
660 	&dev_attr_hw_trap.attr,
661 	&dev_attr_switch_attrs.attr,
662 	NULL,
663 };
664 const struct attribute_group qeth_device_attr_group = {
665 	.attrs = qeth_device_attrs,
666 };
667 EXPORT_SYMBOL_GPL(qeth_device_attr_group);
668 
669 const struct attribute_group *qeth_generic_attr_groups[] = {
670 	&qeth_device_attr_group,
671 	&qeth_device_blkt_group,
672 	NULL,
673 };
674 
675 static struct attribute *qeth_osn_device_attrs[] = {
676 	&dev_attr_state.attr,
677 	&dev_attr_chpid.attr,
678 	&dev_attr_if_name.attr,
679 	&dev_attr_card_type.attr,
680 	&dev_attr_buffer_count.attr,
681 	&dev_attr_recover.attr,
682 	NULL,
683 };
684 static struct attribute_group qeth_osn_device_attr_group = {
685 	.attrs = qeth_osn_device_attrs,
686 };
687 const struct attribute_group *qeth_osn_attr_groups[] = {
688 	&qeth_osn_device_attr_group,
689 	NULL,
690 };
691