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 unsigned int portno, limit; 107 int rc = 0; 108 109 rc = kstrtouint(buf, 16, &portno); 110 if (rc) 111 return rc; 112 if (portno > QETH_MAX_PORTNO) 113 return -EINVAL; 114 115 mutex_lock(&card->conf_mutex); 116 if (card->state != CARD_STATE_DOWN) { 117 rc = -EPERM; 118 goto out; 119 } 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 int rc = 0; 252 253 rc = kstrtouint(buf, 10, &cnt); 254 if (rc) 255 return rc; 256 257 mutex_lock(&card->conf_mutex); 258 if (card->state != CARD_STATE_DOWN) { 259 rc = -EPERM; 260 goto out; 261 } 262 263 cnt = clamp(cnt, QETH_IN_BUF_COUNT_MIN, QETH_IN_BUF_COUNT_MAX); 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 enum qeth_discipline_id newdis; 345 unsigned int input; 346 int rc; 347 348 rc = kstrtouint(buf, 16, &input); 349 if (rc) 350 return rc; 351 352 switch (input) { 353 case 0: 354 newdis = QETH_DISCIPLINE_LAYER3; 355 break; 356 case 1: 357 newdis = QETH_DISCIPLINE_LAYER2; 358 break; 359 default: 360 return -EINVAL; 361 } 362 363 mutex_lock(&card->discipline_mutex); 364 if (card->state != CARD_STATE_DOWN) { 365 rc = -EPERM; 366 goto out; 367 } 368 369 if (card->options.layer == newdis) 370 goto out; 371 if (card->info.layer_enforced) { 372 /* fixed layer, can't switch */ 373 rc = -EOPNOTSUPP; 374 goto out; 375 } 376 377 if (card->discipline) { 378 /* start with a new, pristine netdevice: */ 379 ndev = qeth_clone_netdev(card->dev); 380 if (!ndev) { 381 rc = -ENOMEM; 382 goto out; 383 } 384 385 card->discipline->remove(card->gdev); 386 qeth_core_free_discipline(card); 387 free_netdev(card->dev); 388 card->dev = ndev; 389 } 390 391 rc = qeth_core_load_discipline(card, newdis); 392 if (rc) 393 goto out; 394 395 rc = card->discipline->setup(card->gdev); 396 if (rc) 397 qeth_core_free_discipline(card); 398 out: 399 mutex_unlock(&card->discipline_mutex); 400 return rc ? rc : count; 401 } 402 403 static DEVICE_ATTR(layer2, 0644, qeth_dev_layer2_show, 404 qeth_dev_layer2_store); 405 406 #define ATTR_QETH_ISOLATION_NONE ("none") 407 #define ATTR_QETH_ISOLATION_FWD ("forward") 408 #define ATTR_QETH_ISOLATION_DROP ("drop") 409 410 static ssize_t qeth_dev_isolation_show(struct device *dev, 411 struct device_attribute *attr, char *buf) 412 { 413 struct qeth_card *card = dev_get_drvdata(dev); 414 415 switch (card->options.isolation) { 416 case ISOLATION_MODE_NONE: 417 return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_NONE); 418 case ISOLATION_MODE_FWD: 419 return snprintf(buf, 9, "%s\n", ATTR_QETH_ISOLATION_FWD); 420 case ISOLATION_MODE_DROP: 421 return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_DROP); 422 default: 423 return snprintf(buf, 5, "%s\n", "N/A"); 424 } 425 } 426 427 static ssize_t qeth_dev_isolation_store(struct device *dev, 428 struct device_attribute *attr, const char *buf, size_t count) 429 { 430 struct qeth_card *card = dev_get_drvdata(dev); 431 enum qeth_ipa_isolation_modes isolation; 432 int rc = 0; 433 434 mutex_lock(&card->conf_mutex); 435 if (!IS_OSD(card) && !IS_OSX(card)) { 436 rc = -EOPNOTSUPP; 437 dev_err(&card->gdev->dev, "Adapter does not " 438 "support QDIO data connection isolation\n"); 439 goto out; 440 } 441 442 /* parse input into isolation mode */ 443 if (sysfs_streq(buf, ATTR_QETH_ISOLATION_NONE)) { 444 isolation = ISOLATION_MODE_NONE; 445 } else if (sysfs_streq(buf, ATTR_QETH_ISOLATION_FWD)) { 446 isolation = ISOLATION_MODE_FWD; 447 } else if (sysfs_streq(buf, ATTR_QETH_ISOLATION_DROP)) { 448 isolation = ISOLATION_MODE_DROP; 449 } else { 450 rc = -EINVAL; 451 goto out; 452 } 453 454 if (qeth_card_hw_is_reachable(card)) 455 rc = qeth_setadpparms_set_access_ctrl(card, isolation); 456 457 if (!rc) 458 WRITE_ONCE(card->options.isolation, isolation); 459 460 out: 461 mutex_unlock(&card->conf_mutex); 462 463 return rc ? rc : count; 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 unsigned int input; 557 int rc; 558 559 rc = kstrtouint(buf, 10, &input); 560 if (rc) 561 return rc; 562 563 if (input > max_value) 564 return -EINVAL; 565 566 mutex_lock(&card->conf_mutex); 567 if (card->state != CARD_STATE_DOWN) 568 rc = -EPERM; 569 else 570 *value = input; 571 mutex_unlock(&card->conf_mutex); 572 return rc ? rc : count; 573 } 574 575 static ssize_t qeth_dev_blkt_total_show(struct device *dev, 576 struct device_attribute *attr, char *buf) 577 { 578 struct qeth_card *card = dev_get_drvdata(dev); 579 580 return sprintf(buf, "%i\n", card->info.blkt.time_total); 581 } 582 583 static ssize_t qeth_dev_blkt_total_store(struct device *dev, 584 struct device_attribute *attr, const char *buf, size_t count) 585 { 586 struct qeth_card *card = dev_get_drvdata(dev); 587 588 return qeth_dev_blkt_store(card, buf, count, 589 &card->info.blkt.time_total, 5000); 590 } 591 592 static DEVICE_ATTR(total, 0644, qeth_dev_blkt_total_show, 593 qeth_dev_blkt_total_store); 594 595 static ssize_t qeth_dev_blkt_inter_show(struct device *dev, 596 struct device_attribute *attr, char *buf) 597 { 598 struct qeth_card *card = dev_get_drvdata(dev); 599 600 return sprintf(buf, "%i\n", card->info.blkt.inter_packet); 601 } 602 603 static ssize_t qeth_dev_blkt_inter_store(struct device *dev, 604 struct device_attribute *attr, const char *buf, size_t count) 605 { 606 struct qeth_card *card = dev_get_drvdata(dev); 607 608 return qeth_dev_blkt_store(card, buf, count, 609 &card->info.blkt.inter_packet, 1000); 610 } 611 612 static DEVICE_ATTR(inter, 0644, qeth_dev_blkt_inter_show, 613 qeth_dev_blkt_inter_store); 614 615 static ssize_t qeth_dev_blkt_inter_jumbo_show(struct device *dev, 616 struct device_attribute *attr, char *buf) 617 { 618 struct qeth_card *card = dev_get_drvdata(dev); 619 620 return sprintf(buf, "%i\n", card->info.blkt.inter_packet_jumbo); 621 } 622 623 static ssize_t qeth_dev_blkt_inter_jumbo_store(struct device *dev, 624 struct device_attribute *attr, const char *buf, size_t count) 625 { 626 struct qeth_card *card = dev_get_drvdata(dev); 627 628 return qeth_dev_blkt_store(card, buf, count, 629 &card->info.blkt.inter_packet_jumbo, 1000); 630 } 631 632 static DEVICE_ATTR(inter_jumbo, 0644, qeth_dev_blkt_inter_jumbo_show, 633 qeth_dev_blkt_inter_jumbo_store); 634 635 static struct attribute *qeth_blkt_device_attrs[] = { 636 &dev_attr_total.attr, 637 &dev_attr_inter.attr, 638 &dev_attr_inter_jumbo.attr, 639 NULL, 640 }; 641 const struct attribute_group qeth_device_blkt_group = { 642 .name = "blkt", 643 .attrs = qeth_blkt_device_attrs, 644 }; 645 EXPORT_SYMBOL_GPL(qeth_device_blkt_group); 646 647 static struct attribute *qeth_device_attrs[] = { 648 &dev_attr_state.attr, 649 &dev_attr_chpid.attr, 650 &dev_attr_if_name.attr, 651 &dev_attr_card_type.attr, 652 &dev_attr_inbuf_size.attr, 653 &dev_attr_portno.attr, 654 &dev_attr_portname.attr, 655 &dev_attr_priority_queueing.attr, 656 &dev_attr_buffer_count.attr, 657 &dev_attr_recover.attr, 658 &dev_attr_performance_stats.attr, 659 &dev_attr_layer2.attr, 660 &dev_attr_isolation.attr, 661 &dev_attr_hw_trap.attr, 662 &dev_attr_switch_attrs.attr, 663 NULL, 664 }; 665 const struct attribute_group qeth_device_attr_group = { 666 .attrs = qeth_device_attrs, 667 }; 668 EXPORT_SYMBOL_GPL(qeth_device_attr_group); 669 670 const struct attribute_group *qeth_generic_attr_groups[] = { 671 &qeth_device_attr_group, 672 &qeth_device_blkt_group, 673 NULL, 674 }; 675 676 static struct attribute *qeth_osn_device_attrs[] = { 677 &dev_attr_state.attr, 678 &dev_attr_chpid.attr, 679 &dev_attr_if_name.attr, 680 &dev_attr_card_type.attr, 681 &dev_attr_buffer_count.attr, 682 &dev_attr_recover.attr, 683 NULL, 684 }; 685 static struct attribute_group qeth_osn_device_attr_group = { 686 .attrs = qeth_osn_device_attrs, 687 }; 688 const struct attribute_group *qeth_osn_attr_groups[] = { 689 &qeth_osn_device_attr_group, 690 NULL, 691 }; 692