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 452 if (qeth_card_hw_is_reachable(card)) 453 rc = qeth_setadpparms_set_access_ctrl(card, isolation); 454 455 if (!rc) 456 WRITE_ONCE(card->options.isolation, isolation); 457 458 out: 459 mutex_unlock(&card->conf_mutex); 460 461 return rc ? rc : count; 462 } 463 464 static DEVICE_ATTR(isolation, 0644, qeth_dev_isolation_show, 465 qeth_dev_isolation_store); 466 467 static ssize_t qeth_dev_switch_attrs_show(struct device *dev, 468 struct device_attribute *attr, char *buf) 469 { 470 struct qeth_card *card = dev_get_drvdata(dev); 471 struct qeth_switch_info sw_info; 472 int rc = 0; 473 474 if (!qeth_card_hw_is_reachable(card)) 475 return sprintf(buf, "n/a\n"); 476 477 rc = qeth_query_switch_attributes(card, &sw_info); 478 if (rc) 479 return rc; 480 481 if (!sw_info.capabilities) 482 rc = sprintf(buf, "unknown"); 483 484 if (sw_info.capabilities & QETH_SWITCH_FORW_802_1) 485 rc = sprintf(buf, (sw_info.settings & QETH_SWITCH_FORW_802_1 ? 486 "[802.1]" : "802.1")); 487 if (sw_info.capabilities & QETH_SWITCH_FORW_REFL_RELAY) 488 rc += sprintf(buf + rc, 489 (sw_info.settings & QETH_SWITCH_FORW_REFL_RELAY ? 490 " [rr]" : " rr")); 491 rc += sprintf(buf + rc, "\n"); 492 493 return rc; 494 } 495 496 static DEVICE_ATTR(switch_attrs, 0444, 497 qeth_dev_switch_attrs_show, NULL); 498 499 static ssize_t qeth_hw_trap_show(struct device *dev, 500 struct device_attribute *attr, char *buf) 501 { 502 struct qeth_card *card = dev_get_drvdata(dev); 503 504 if (card->info.hwtrap) 505 return snprintf(buf, 5, "arm\n"); 506 else 507 return snprintf(buf, 8, "disarm\n"); 508 } 509 510 static ssize_t qeth_hw_trap_store(struct device *dev, 511 struct device_attribute *attr, const char *buf, size_t count) 512 { 513 struct qeth_card *card = dev_get_drvdata(dev); 514 int rc = 0; 515 int state = 0; 516 517 mutex_lock(&card->conf_mutex); 518 if (qeth_card_hw_is_reachable(card)) 519 state = 1; 520 521 if (sysfs_streq(buf, "arm") && !card->info.hwtrap) { 522 if (state) { 523 if (qeth_is_diagass_supported(card, 524 QETH_DIAGS_CMD_TRAP)) { 525 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM); 526 if (!rc) 527 card->info.hwtrap = 1; 528 } else 529 rc = -EINVAL; 530 } else 531 card->info.hwtrap = 1; 532 } else if (sysfs_streq(buf, "disarm") && card->info.hwtrap) { 533 if (state) { 534 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); 535 if (!rc) 536 card->info.hwtrap = 0; 537 } else 538 card->info.hwtrap = 0; 539 } else if (sysfs_streq(buf, "trap") && state && card->info.hwtrap) 540 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE); 541 else 542 rc = -EINVAL; 543 544 mutex_unlock(&card->conf_mutex); 545 return rc ? rc : count; 546 } 547 548 static DEVICE_ATTR(hw_trap, 0644, qeth_hw_trap_show, 549 qeth_hw_trap_store); 550 551 static ssize_t qeth_dev_blkt_store(struct qeth_card *card, 552 const char *buf, size_t count, int *value, int max_value) 553 { 554 char *tmp; 555 int i, rc = 0; 556 557 mutex_lock(&card->conf_mutex); 558 if (card->state != CARD_STATE_DOWN) { 559 rc = -EPERM; 560 goto out; 561 } 562 i = simple_strtoul(buf, &tmp, 10); 563 if (i <= max_value) 564 *value = i; 565 else 566 rc = -EINVAL; 567 out: 568 mutex_unlock(&card->conf_mutex); 569 return rc ? rc : count; 570 } 571 572 static ssize_t qeth_dev_blkt_total_show(struct device *dev, 573 struct device_attribute *attr, char *buf) 574 { 575 struct qeth_card *card = dev_get_drvdata(dev); 576 577 return sprintf(buf, "%i\n", card->info.blkt.time_total); 578 } 579 580 static ssize_t qeth_dev_blkt_total_store(struct device *dev, 581 struct device_attribute *attr, const char *buf, size_t count) 582 { 583 struct qeth_card *card = dev_get_drvdata(dev); 584 585 return qeth_dev_blkt_store(card, buf, count, 586 &card->info.blkt.time_total, 5000); 587 } 588 589 static DEVICE_ATTR(total, 0644, qeth_dev_blkt_total_show, 590 qeth_dev_blkt_total_store); 591 592 static ssize_t qeth_dev_blkt_inter_show(struct device *dev, 593 struct device_attribute *attr, char *buf) 594 { 595 struct qeth_card *card = dev_get_drvdata(dev); 596 597 return sprintf(buf, "%i\n", card->info.blkt.inter_packet); 598 } 599 600 static ssize_t qeth_dev_blkt_inter_store(struct device *dev, 601 struct device_attribute *attr, const char *buf, size_t count) 602 { 603 struct qeth_card *card = dev_get_drvdata(dev); 604 605 return qeth_dev_blkt_store(card, buf, count, 606 &card->info.blkt.inter_packet, 1000); 607 } 608 609 static DEVICE_ATTR(inter, 0644, qeth_dev_blkt_inter_show, 610 qeth_dev_blkt_inter_store); 611 612 static ssize_t qeth_dev_blkt_inter_jumbo_show(struct device *dev, 613 struct device_attribute *attr, char *buf) 614 { 615 struct qeth_card *card = dev_get_drvdata(dev); 616 617 return sprintf(buf, "%i\n", card->info.blkt.inter_packet_jumbo); 618 } 619 620 static ssize_t qeth_dev_blkt_inter_jumbo_store(struct device *dev, 621 struct device_attribute *attr, const char *buf, size_t count) 622 { 623 struct qeth_card *card = dev_get_drvdata(dev); 624 625 return qeth_dev_blkt_store(card, buf, count, 626 &card->info.blkt.inter_packet_jumbo, 1000); 627 } 628 629 static DEVICE_ATTR(inter_jumbo, 0644, qeth_dev_blkt_inter_jumbo_show, 630 qeth_dev_blkt_inter_jumbo_store); 631 632 static struct attribute *qeth_blkt_device_attrs[] = { 633 &dev_attr_total.attr, 634 &dev_attr_inter.attr, 635 &dev_attr_inter_jumbo.attr, 636 NULL, 637 }; 638 const struct attribute_group qeth_device_blkt_group = { 639 .name = "blkt", 640 .attrs = qeth_blkt_device_attrs, 641 }; 642 EXPORT_SYMBOL_GPL(qeth_device_blkt_group); 643 644 static struct attribute *qeth_device_attrs[] = { 645 &dev_attr_state.attr, 646 &dev_attr_chpid.attr, 647 &dev_attr_if_name.attr, 648 &dev_attr_card_type.attr, 649 &dev_attr_inbuf_size.attr, 650 &dev_attr_portno.attr, 651 &dev_attr_portname.attr, 652 &dev_attr_priority_queueing.attr, 653 &dev_attr_buffer_count.attr, 654 &dev_attr_recover.attr, 655 &dev_attr_performance_stats.attr, 656 &dev_attr_layer2.attr, 657 &dev_attr_isolation.attr, 658 &dev_attr_hw_trap.attr, 659 &dev_attr_switch_attrs.attr, 660 NULL, 661 }; 662 const struct attribute_group qeth_device_attr_group = { 663 .attrs = qeth_device_attrs, 664 }; 665 EXPORT_SYMBOL_GPL(qeth_device_attr_group); 666 667 const struct attribute_group *qeth_generic_attr_groups[] = { 668 &qeth_device_attr_group, 669 &qeth_device_blkt_group, 670 NULL, 671 }; 672 673 static struct attribute *qeth_osn_device_attrs[] = { 674 &dev_attr_state.attr, 675 &dev_attr_chpid.attr, 676 &dev_attr_if_name.attr, 677 &dev_attr_card_type.attr, 678 &dev_attr_buffer_count.attr, 679 &dev_attr_recover.attr, 680 NULL, 681 }; 682 static struct attribute_group qeth_osn_device_attr_group = { 683 .attrs = qeth_osn_device_attrs, 684 }; 685 const struct attribute_group *qeth_osn_attr_groups[] = { 686 &qeth_osn_device_attr_group, 687 NULL, 688 }; 689