xref: /openbmc/linux/drivers/s390/net/qeth_core_sys.c (revision 55fd7e02)
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_SOFTSETUP:
28 		if (card->dev->flags & IFF_UP)
29 			return sprintf(buf, "UP (LAN %s)\n",
30 				       netif_carrier_ok(card->dev) ? "ONLINE" :
31 								     "OFFLINE");
32 		return sprintf(buf, "SOFTSETUP\n");
33 	default:
34 		return sprintf(buf, "UNKNOWN\n");
35 	}
36 }
37 
38 static DEVICE_ATTR(state, 0444, qeth_dev_state_show, NULL);
39 
40 static ssize_t qeth_dev_chpid_show(struct device *dev,
41 				struct device_attribute *attr, char *buf)
42 {
43 	struct qeth_card *card = dev_get_drvdata(dev);
44 
45 	return sprintf(buf, "%02X\n", card->info.chpid);
46 }
47 
48 static DEVICE_ATTR(chpid, 0444, qeth_dev_chpid_show, NULL);
49 
50 static ssize_t qeth_dev_if_name_show(struct device *dev,
51 				struct device_attribute *attr, char *buf)
52 {
53 	struct qeth_card *card = dev_get_drvdata(dev);
54 
55 	return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card));
56 }
57 
58 static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL);
59 
60 static ssize_t qeth_dev_card_type_show(struct device *dev,
61 				struct device_attribute *attr, char *buf)
62 {
63 	struct qeth_card *card = dev_get_drvdata(dev);
64 
65 	return sprintf(buf, "%s\n", qeth_get_cardname_short(card));
66 }
67 
68 static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL);
69 
70 static const char *qeth_get_bufsize_str(struct qeth_card *card)
71 {
72 	if (card->qdio.in_buf_size == 16384)
73 		return "16k";
74 	else if (card->qdio.in_buf_size == 24576)
75 		return "24k";
76 	else if (card->qdio.in_buf_size == 32768)
77 		return "32k";
78 	else if (card->qdio.in_buf_size == 40960)
79 		return "40k";
80 	else
81 		return "64k";
82 }
83 
84 static ssize_t qeth_dev_inbuf_size_show(struct device *dev,
85 				struct device_attribute *attr, char *buf)
86 {
87 	struct qeth_card *card = dev_get_drvdata(dev);
88 
89 	return sprintf(buf, "%s\n", qeth_get_bufsize_str(card));
90 }
91 
92 static DEVICE_ATTR(inbuf_size, 0444, qeth_dev_inbuf_size_show, NULL);
93 
94 static ssize_t qeth_dev_portno_show(struct device *dev,
95 			struct device_attribute *attr, char *buf)
96 {
97 	struct qeth_card *card = dev_get_drvdata(dev);
98 
99 	return sprintf(buf, "%i\n", card->dev->dev_port);
100 }
101 
102 static ssize_t qeth_dev_portno_store(struct device *dev,
103 		struct device_attribute *attr, const char *buf, size_t count)
104 {
105 	struct qeth_card *card = dev_get_drvdata(dev);
106 	char *tmp;
107 	unsigned int portno, limit;
108 	int rc = 0;
109 
110 	mutex_lock(&card->conf_mutex);
111 	if (card->state != CARD_STATE_DOWN) {
112 		rc = -EPERM;
113 		goto out;
114 	}
115 
116 	portno = simple_strtoul(buf, &tmp, 16);
117 	if (portno > QETH_MAX_PORTNO) {
118 		rc = -EINVAL;
119 		goto out;
120 	}
121 	limit = (card->ssqd.pcnt ? card->ssqd.pcnt - 1 : card->ssqd.pcnt);
122 	if (portno > limit) {
123 		rc = -EINVAL;
124 		goto out;
125 	}
126 	card->dev->dev_port = portno;
127 out:
128 	mutex_unlock(&card->conf_mutex);
129 	return rc ? rc : count;
130 }
131 
132 static DEVICE_ATTR(portno, 0644, qeth_dev_portno_show, qeth_dev_portno_store);
133 
134 static ssize_t qeth_dev_portname_show(struct device *dev,
135 				struct device_attribute *attr, char *buf)
136 {
137 	return sprintf(buf, "no portname required\n");
138 }
139 
140 static ssize_t qeth_dev_portname_store(struct device *dev,
141 		struct device_attribute *attr, const char *buf, size_t count)
142 {
143 	struct qeth_card *card = dev_get_drvdata(dev);
144 
145 	dev_warn_once(&card->gdev->dev,
146 		      "portname is deprecated and is ignored\n");
147 	return count;
148 }
149 
150 static DEVICE_ATTR(portname, 0644, qeth_dev_portname_show,
151 		qeth_dev_portname_store);
152 
153 static ssize_t qeth_dev_prioqing_show(struct device *dev,
154 				struct device_attribute *attr, char *buf)
155 {
156 	struct qeth_card *card = dev_get_drvdata(dev);
157 
158 	switch (card->qdio.do_prio_queueing) {
159 	case QETH_PRIO_Q_ING_PREC:
160 		return sprintf(buf, "%s\n", "by precedence");
161 	case QETH_PRIO_Q_ING_TOS:
162 		return sprintf(buf, "%s\n", "by type of service");
163 	case QETH_PRIO_Q_ING_SKB:
164 		return sprintf(buf, "%s\n", "by skb-priority");
165 	case QETH_PRIO_Q_ING_VLAN:
166 		return sprintf(buf, "%s\n", "by VLAN headers");
167 	default:
168 		return sprintf(buf, "always queue %i\n",
169 			       card->qdio.default_out_queue);
170 	}
171 }
172 
173 static ssize_t qeth_dev_prioqing_store(struct device *dev,
174 		struct device_attribute *attr, const char *buf, size_t count)
175 {
176 	struct qeth_card *card = dev_get_drvdata(dev);
177 	int rc = 0;
178 
179 	if (IS_IQD(card) || IS_VM_NIC(card))
180 		return -EOPNOTSUPP;
181 
182 	mutex_lock(&card->conf_mutex);
183 	if (card->state != CARD_STATE_DOWN) {
184 		rc = -EPERM;
185 		goto out;
186 	}
187 
188 	/* check if 1920 devices are supported ,
189 	 * if though we have to permit priority queueing
190 	 */
191 	if (card->qdio.no_out_queues == 1) {
192 		card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
193 		rc = -EPERM;
194 		goto out;
195 	}
196 
197 	if (sysfs_streq(buf, "prio_queueing_prec")) {
198 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC;
199 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
200 	} else if (sysfs_streq(buf, "prio_queueing_skb")) {
201 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_SKB;
202 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
203 	} else if (sysfs_streq(buf, "prio_queueing_tos")) {
204 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS;
205 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
206 	} else if (sysfs_streq(buf, "prio_queueing_vlan")) {
207 		if (IS_LAYER3(card)) {
208 			rc = -EOPNOTSUPP;
209 			goto out;
210 		}
211 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_VLAN;
212 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
213 	} else if (sysfs_streq(buf, "no_prio_queueing:0")) {
214 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED;
215 		card->qdio.default_out_queue = 0;
216 	} else if (sysfs_streq(buf, "no_prio_queueing:1")) {
217 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED;
218 		card->qdio.default_out_queue = 1;
219 	} else if (sysfs_streq(buf, "no_prio_queueing:2")) {
220 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED;
221 		card->qdio.default_out_queue = 2;
222 	} else if (sysfs_streq(buf, "no_prio_queueing:3")) {
223 		card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED;
224 		card->qdio.default_out_queue = 3;
225 	} else if (sysfs_streq(buf, "no_prio_queueing")) {
226 		card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
227 		card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
228 	} else
229 		rc = -EINVAL;
230 out:
231 	mutex_unlock(&card->conf_mutex);
232 	return rc ? rc : count;
233 }
234 
235 static DEVICE_ATTR(priority_queueing, 0644, qeth_dev_prioqing_show,
236 		qeth_dev_prioqing_store);
237 
238 static ssize_t qeth_dev_bufcnt_show(struct device *dev,
239 				struct device_attribute *attr, char *buf)
240 {
241 	struct qeth_card *card = dev_get_drvdata(dev);
242 
243 	return sprintf(buf, "%i\n", card->qdio.in_buf_pool.buf_count);
244 }
245 
246 static ssize_t qeth_dev_bufcnt_store(struct device *dev,
247 		struct device_attribute *attr, const char *buf, size_t count)
248 {
249 	struct qeth_card *card = dev_get_drvdata(dev);
250 	unsigned int cnt;
251 	char *tmp;
252 	int rc = 0;
253 
254 	mutex_lock(&card->conf_mutex);
255 	if (card->state != CARD_STATE_DOWN) {
256 		rc = -EPERM;
257 		goto out;
258 	}
259 
260 	cnt = simple_strtoul(buf, &tmp, 10);
261 	cnt = (cnt < QETH_IN_BUF_COUNT_MIN) ? QETH_IN_BUF_COUNT_MIN :
262 		((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt);
263 
264 	rc = qeth_resize_buffer_pool(card, cnt);
265 
266 out:
267 	mutex_unlock(&card->conf_mutex);
268 	return rc ? rc : count;
269 }
270 
271 static DEVICE_ATTR(buffer_count, 0644, qeth_dev_bufcnt_show,
272 		qeth_dev_bufcnt_store);
273 
274 static ssize_t qeth_dev_recover_store(struct device *dev,
275 		struct device_attribute *attr, const char *buf, size_t count)
276 {
277 	struct qeth_card *card = dev_get_drvdata(dev);
278 	bool reset;
279 	int rc;
280 
281 	rc = kstrtobool(buf, &reset);
282 	if (rc)
283 		return rc;
284 
285 	if (!qeth_card_hw_is_reachable(card))
286 		return -EPERM;
287 
288 	if (reset)
289 		rc = qeth_schedule_recovery(card);
290 
291 	return rc ? rc : 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