1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> 4 5<book id="s390drivers"> 6 <bookinfo> 7 <title>Writing s390 channel device drivers</title> 8 9 <authorgroup> 10 <author> 11 <firstname>Cornelia</firstname> 12 <surname>Huck</surname> 13 <affiliation> 14 <address> 15 <email>cornelia.huck@de.ibm.com</email> 16 </address> 17 </affiliation> 18 </author> 19 </authorgroup> 20 21 <copyright> 22 <year>2007</year> 23 <holder>IBM Corp.</holder> 24 </copyright> 25 26 <legalnotice> 27 <para> 28 This documentation is free software; you can redistribute 29 it and/or modify it under the terms of the GNU General Public 30 License as published by the Free Software Foundation; either 31 version 2 of the License, or (at your option) any later 32 version. 33 </para> 34 35 <para> 36 This program is distributed in the hope that it will be 37 useful, but WITHOUT ANY WARRANTY; without even the implied 38 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 39 See the GNU General Public License for more details. 40 </para> 41 42 <para> 43 You should have received a copy of the GNU General Public 44 License along with this program; if not, write to the Free 45 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 46 MA 02111-1307 USA 47 </para> 48 49 <para> 50 For more details see the file COPYING in the source 51 distribution of Linux. 52 </para> 53 </legalnotice> 54 </bookinfo> 55 56<toc></toc> 57 58 <chapter id="intro"> 59 <title>Introduction</title> 60 <para> 61 This document describes the interfaces available for device drivers that 62 drive s390 based channel attached I/O devices. This includes interfaces for 63 interaction with the hardware and interfaces for interacting with the 64 common driver core. Those interfaces are provided by the s390 common I/O 65 layer. 66 </para> 67 <para> 68 The document assumes a familarity with the technical terms associated 69 with the s390 channel I/O architecture. For a description of this 70 architecture, please refer to the "z/Architecture: Principles of 71 Operation", IBM publication no. SA22-7832. 72 </para> 73 <para> 74 While most I/O devices on a s390 system are typically driven through the 75 channel I/O mechanism described here, there are various other methods 76 (like the diag interface). These are out of the scope of this document. 77 </para> 78 <para> 79 Some additional information can also be found in the kernel source 80 under Documentation/s390/driver-model.txt. 81 </para> 82 </chapter> 83 <chapter id="ccw"> 84 <title>The ccw bus</title> 85 <para> 86 The ccw bus typically contains the majority of devices available to 87 a s390 system. Named after the channel command word (ccw), the basic 88 command structure used to address its devices, the ccw bus contains 89 so-called channel attached devices. They are addressed via I/O 90 subchannels, visible on the css bus. A device driver for 91 channel-attached devices, however, will never interact with the 92 subchannel directly, but only via the I/O device on the ccw bus, 93 the ccw device. 94 </para> 95 <sect1 id="channelIO"> 96 <title>I/O functions for channel-attached devices</title> 97 <para> 98 Some hardware structures have been translated into C structures for use 99 by the common I/O layer and device drivers. For more information on 100 the hardware structures represented here, please consult the Principles 101 of Operation. 102 </para> 103<!-- arch/s390/include/asm/cio.h --> 104<refentry id="API-struct-ccw1"> 105<refentryinfo> 106 <title>LINUX</title> 107 <productname>Kernel Hackers Manual</productname> 108 <date>July 2017</date> 109</refentryinfo> 110<refmeta> 111 <refentrytitle><phrase>struct ccw1</phrase></refentrytitle> 112 <manvolnum>9</manvolnum> 113 <refmiscinfo class="version">4.1.27</refmiscinfo> 114</refmeta> 115<refnamediv> 116 <refname>struct ccw1</refname> 117 <refpurpose> 118 channel command word 119 </refpurpose> 120</refnamediv> 121<refsynopsisdiv> 122 <title>Synopsis</title> 123 <programlisting> 124struct ccw1 { 125 __u8 cmd_code; 126 __u8 flags; 127 __u16 count; 128 __u32 cda; 129}; </programlisting> 130</refsynopsisdiv> 131 <refsect1> 132 <title>Members</title> 133 <variablelist> 134 <varlistentry> <term>cmd_code</term> 135 <listitem><para> 136command code 137 </para></listitem> 138 </varlistentry> 139 <varlistentry> <term>flags</term> 140 <listitem><para> 141flags, like IDA addressing, etc. 142 </para></listitem> 143 </varlistentry> 144 <varlistentry> <term>count</term> 145 <listitem><para> 146byte count 147 </para></listitem> 148 </varlistentry> 149 <varlistentry> <term>cda</term> 150 <listitem><para> 151data address 152 </para></listitem> 153 </varlistentry> 154 </variablelist> 155 </refsect1> 156<refsect1> 157<title>Description</title> 158<para> 159 The ccw is the basic structure to build channel programs that perform 160 operations with the device or the control unit. Only Format-1 channel 161 command words are supported. 162</para> 163</refsect1> 164</refentry> 165 166<refentry id="API-struct-erw"> 167<refentryinfo> 168 <title>LINUX</title> 169 <productname>Kernel Hackers Manual</productname> 170 <date>July 2017</date> 171</refentryinfo> 172<refmeta> 173 <refentrytitle><phrase>struct erw</phrase></refentrytitle> 174 <manvolnum>9</manvolnum> 175 <refmiscinfo class="version">4.1.27</refmiscinfo> 176</refmeta> 177<refnamediv> 178 <refname>struct erw</refname> 179 <refpurpose> 180 extended report word 181 </refpurpose> 182</refnamediv> 183<refsynopsisdiv> 184 <title>Synopsis</title> 185 <programlisting> 186struct erw { 187 __u32 res0:3; 188 __u32 auth:1; 189 __u32 pvrf:1; 190 __u32 cpt:1; 191 __u32 fsavf:1; 192 __u32 cons:1; 193 __u32 scavf:1; 194 __u32 fsaf:1; 195 __u32 scnt:6; 196 __u32 res16:16; 197}; </programlisting> 198</refsynopsisdiv> 199 <refsect1> 200 <title>Members</title> 201 <variablelist> 202 <varlistentry> <term>res0</term> 203 <listitem><para> 204 reserved 205 </para></listitem> 206 </varlistentry> 207 <varlistentry> <term>auth</term> 208 <listitem><para> 209 authorization check 210 </para></listitem> 211 </varlistentry> 212 <varlistentry> <term>pvrf</term> 213 <listitem><para> 214 path-verification-required flag 215 </para></listitem> 216 </varlistentry> 217 <varlistentry> <term>cpt</term> 218 <listitem><para> 219 channel-path timeout 220 </para></listitem> 221 </varlistentry> 222 <varlistentry> <term>fsavf</term> 223 <listitem><para> 224 failing storage address validity flag 225 </para></listitem> 226 </varlistentry> 227 <varlistentry> <term>cons</term> 228 <listitem><para> 229 concurrent sense 230 </para></listitem> 231 </varlistentry> 232 <varlistentry> <term>scavf</term> 233 <listitem><para> 234 secondary ccw address validity flag 235 </para></listitem> 236 </varlistentry> 237 <varlistentry> <term>fsaf</term> 238 <listitem><para> 239 failing storage address format 240 </para></listitem> 241 </varlistentry> 242 <varlistentry> <term>scnt</term> 243 <listitem><para> 244 sense count, if <parameter>cons</parameter> == <constant>1</constant> 245 </para></listitem> 246 </varlistentry> 247 <varlistentry> <term>res16</term> 248 <listitem><para> 249 reserved 250 </para></listitem> 251 </varlistentry> 252 </variablelist> 253 </refsect1> 254</refentry> 255 256<refentry id="API-struct-erw-eadm"> 257<refentryinfo> 258 <title>LINUX</title> 259 <productname>Kernel Hackers Manual</productname> 260 <date>July 2017</date> 261</refentryinfo> 262<refmeta> 263 <refentrytitle><phrase>struct erw_eadm</phrase></refentrytitle> 264 <manvolnum>9</manvolnum> 265 <refmiscinfo class="version">4.1.27</refmiscinfo> 266</refmeta> 267<refnamediv> 268 <refname>struct erw_eadm</refname> 269 <refpurpose> 270 EADM Subchannel extended report word 271 </refpurpose> 272</refnamediv> 273<refsynopsisdiv> 274 <title>Synopsis</title> 275 <programlisting> 276struct erw_eadm { 277 __u32 b:1; 278 __u32 r:1; 279}; </programlisting> 280</refsynopsisdiv> 281 <refsect1> 282 <title>Members</title> 283 <variablelist> 284 <varlistentry> <term>b</term> 285 <listitem><para> 286 aob error 287 </para></listitem> 288 </varlistentry> 289 <varlistentry> <term>r</term> 290 <listitem><para> 291 arsb error 292 </para></listitem> 293 </varlistentry> 294 </variablelist> 295 </refsect1> 296</refentry> 297 298<refentry id="API-struct-sublog"> 299<refentryinfo> 300 <title>LINUX</title> 301 <productname>Kernel Hackers Manual</productname> 302 <date>July 2017</date> 303</refentryinfo> 304<refmeta> 305 <refentrytitle><phrase>struct sublog</phrase></refentrytitle> 306 <manvolnum>9</manvolnum> 307 <refmiscinfo class="version">4.1.27</refmiscinfo> 308</refmeta> 309<refnamediv> 310 <refname>struct sublog</refname> 311 <refpurpose> 312 subchannel logout area 313 </refpurpose> 314</refnamediv> 315<refsynopsisdiv> 316 <title>Synopsis</title> 317 <programlisting> 318struct sublog { 319 __u32 res0:1; 320 __u32 esf:7; 321 __u32 lpum:8; 322 __u32 arep:1; 323 __u32 fvf:5; 324 __u32 sacc:2; 325 __u32 termc:2; 326 __u32 devsc:1; 327 __u32 serr:1; 328 __u32 ioerr:1; 329 __u32 seqc:3; 330}; </programlisting> 331</refsynopsisdiv> 332 <refsect1> 333 <title>Members</title> 334 <variablelist> 335 <varlistentry> <term>res0</term> 336 <listitem><para> 337 reserved 338 </para></listitem> 339 </varlistentry> 340 <varlistentry> <term>esf</term> 341 <listitem><para> 342 extended status flags 343 </para></listitem> 344 </varlistentry> 345 <varlistentry> <term>lpum</term> 346 <listitem><para> 347 last path used mask 348 </para></listitem> 349 </varlistentry> 350 <varlistentry> <term>arep</term> 351 <listitem><para> 352 ancillary report 353 </para></listitem> 354 </varlistentry> 355 <varlistentry> <term>fvf</term> 356 <listitem><para> 357 field-validity flags 358 </para></listitem> 359 </varlistentry> 360 <varlistentry> <term>sacc</term> 361 <listitem><para> 362 storage access code 363 </para></listitem> 364 </varlistentry> 365 <varlistentry> <term>termc</term> 366 <listitem><para> 367 termination code 368 </para></listitem> 369 </varlistentry> 370 <varlistentry> <term>devsc</term> 371 <listitem><para> 372 device-status check 373 </para></listitem> 374 </varlistentry> 375 <varlistentry> <term>serr</term> 376 <listitem><para> 377 secondary error 378 </para></listitem> 379 </varlistentry> 380 <varlistentry> <term>ioerr</term> 381 <listitem><para> 382 i/o-error alert 383 </para></listitem> 384 </varlistentry> 385 <varlistentry> <term>seqc</term> 386 <listitem><para> 387 sequence code 388 </para></listitem> 389 </varlistentry> 390 </variablelist> 391 </refsect1> 392</refentry> 393 394<refentry id="API-struct-esw0"> 395<refentryinfo> 396 <title>LINUX</title> 397 <productname>Kernel Hackers Manual</productname> 398 <date>July 2017</date> 399</refentryinfo> 400<refmeta> 401 <refentrytitle><phrase>struct esw0</phrase></refentrytitle> 402 <manvolnum>9</manvolnum> 403 <refmiscinfo class="version">4.1.27</refmiscinfo> 404</refmeta> 405<refnamediv> 406 <refname>struct esw0</refname> 407 <refpurpose> 408 Format 0 Extended Status Word (ESW) 409 </refpurpose> 410</refnamediv> 411<refsynopsisdiv> 412 <title>Synopsis</title> 413 <programlisting> 414struct esw0 { 415 struct sublog sublog; 416 struct erw erw; 417 __u32 faddr[2]; 418 __u32 saddr; 419}; </programlisting> 420</refsynopsisdiv> 421 <refsect1> 422 <title>Members</title> 423 <variablelist> 424 <varlistentry> <term>sublog</term> 425 <listitem><para> 426 subchannel logout 427 </para></listitem> 428 </varlistentry> 429 <varlistentry> <term>erw</term> 430 <listitem><para> 431 extended report word 432 </para></listitem> 433 </varlistentry> 434 <varlistentry> <term>faddr[2]</term> 435 <listitem><para> 436 failing storage address 437 </para></listitem> 438 </varlistentry> 439 <varlistentry> <term>saddr</term> 440 <listitem><para> 441 secondary ccw address 442 </para></listitem> 443 </varlistentry> 444 </variablelist> 445 </refsect1> 446</refentry> 447 448<refentry id="API-struct-esw1"> 449<refentryinfo> 450 <title>LINUX</title> 451 <productname>Kernel Hackers Manual</productname> 452 <date>July 2017</date> 453</refentryinfo> 454<refmeta> 455 <refentrytitle><phrase>struct esw1</phrase></refentrytitle> 456 <manvolnum>9</manvolnum> 457 <refmiscinfo class="version">4.1.27</refmiscinfo> 458</refmeta> 459<refnamediv> 460 <refname>struct esw1</refname> 461 <refpurpose> 462 Format 1 Extended Status Word (ESW) 463 </refpurpose> 464</refnamediv> 465<refsynopsisdiv> 466 <title>Synopsis</title> 467 <programlisting> 468struct esw1 { 469 __u8 zero0; 470 __u8 lpum; 471 __u16 zero16; 472 struct erw erw; 473 __u32 zeros[3]; 474}; </programlisting> 475</refsynopsisdiv> 476 <refsect1> 477 <title>Members</title> 478 <variablelist> 479 <varlistentry> <term>zero0</term> 480 <listitem><para> 481 reserved zeros 482 </para></listitem> 483 </varlistentry> 484 <varlistentry> <term>lpum</term> 485 <listitem><para> 486 last path used mask 487 </para></listitem> 488 </varlistentry> 489 <varlistentry> <term>zero16</term> 490 <listitem><para> 491 reserved zeros 492 </para></listitem> 493 </varlistentry> 494 <varlistentry> <term>erw</term> 495 <listitem><para> 496 extended report word 497 </para></listitem> 498 </varlistentry> 499 <varlistentry> <term>zeros[3]</term> 500 <listitem><para> 501 three fullwords of zeros 502 </para></listitem> 503 </varlistentry> 504 </variablelist> 505 </refsect1> 506</refentry> 507 508<refentry id="API-struct-esw2"> 509<refentryinfo> 510 <title>LINUX</title> 511 <productname>Kernel Hackers Manual</productname> 512 <date>July 2017</date> 513</refentryinfo> 514<refmeta> 515 <refentrytitle><phrase>struct esw2</phrase></refentrytitle> 516 <manvolnum>9</manvolnum> 517 <refmiscinfo class="version">4.1.27</refmiscinfo> 518</refmeta> 519<refnamediv> 520 <refname>struct esw2</refname> 521 <refpurpose> 522 Format 2 Extended Status Word (ESW) 523 </refpurpose> 524</refnamediv> 525<refsynopsisdiv> 526 <title>Synopsis</title> 527 <programlisting> 528struct esw2 { 529 __u8 zero0; 530 __u8 lpum; 531 __u16 dcti; 532 struct erw erw; 533 __u32 zeros[3]; 534}; </programlisting> 535</refsynopsisdiv> 536 <refsect1> 537 <title>Members</title> 538 <variablelist> 539 <varlistentry> <term>zero0</term> 540 <listitem><para> 541 reserved zeros 542 </para></listitem> 543 </varlistentry> 544 <varlistentry> <term>lpum</term> 545 <listitem><para> 546 last path used mask 547 </para></listitem> 548 </varlistentry> 549 <varlistentry> <term>dcti</term> 550 <listitem><para> 551 device-connect-time interval 552 </para></listitem> 553 </varlistentry> 554 <varlistentry> <term>erw</term> 555 <listitem><para> 556 extended report word 557 </para></listitem> 558 </varlistentry> 559 <varlistentry> <term>zeros[3]</term> 560 <listitem><para> 561 three fullwords of zeros 562 </para></listitem> 563 </varlistentry> 564 </variablelist> 565 </refsect1> 566</refentry> 567 568<refentry id="API-struct-esw3"> 569<refentryinfo> 570 <title>LINUX</title> 571 <productname>Kernel Hackers Manual</productname> 572 <date>July 2017</date> 573</refentryinfo> 574<refmeta> 575 <refentrytitle><phrase>struct esw3</phrase></refentrytitle> 576 <manvolnum>9</manvolnum> 577 <refmiscinfo class="version">4.1.27</refmiscinfo> 578</refmeta> 579<refnamediv> 580 <refname>struct esw3</refname> 581 <refpurpose> 582 Format 3 Extended Status Word (ESW) 583 </refpurpose> 584</refnamediv> 585<refsynopsisdiv> 586 <title>Synopsis</title> 587 <programlisting> 588struct esw3 { 589 __u8 zero0; 590 __u8 lpum; 591 __u16 res; 592 struct erw erw; 593 __u32 zeros[3]; 594}; </programlisting> 595</refsynopsisdiv> 596 <refsect1> 597 <title>Members</title> 598 <variablelist> 599 <varlistentry> <term>zero0</term> 600 <listitem><para> 601 reserved zeros 602 </para></listitem> 603 </varlistentry> 604 <varlistentry> <term>lpum</term> 605 <listitem><para> 606 last path used mask 607 </para></listitem> 608 </varlistentry> 609 <varlistentry> <term>res</term> 610 <listitem><para> 611 reserved 612 </para></listitem> 613 </varlistentry> 614 <varlistentry> <term>erw</term> 615 <listitem><para> 616 extended report word 617 </para></listitem> 618 </varlistentry> 619 <varlistentry> <term>zeros[3]</term> 620 <listitem><para> 621 three fullwords of zeros 622 </para></listitem> 623 </varlistentry> 624 </variablelist> 625 </refsect1> 626</refentry> 627 628<refentry id="API-struct-esw-eadm"> 629<refentryinfo> 630 <title>LINUX</title> 631 <productname>Kernel Hackers Manual</productname> 632 <date>July 2017</date> 633</refentryinfo> 634<refmeta> 635 <refentrytitle><phrase>struct esw_eadm</phrase></refentrytitle> 636 <manvolnum>9</manvolnum> 637 <refmiscinfo class="version">4.1.27</refmiscinfo> 638</refmeta> 639<refnamediv> 640 <refname>struct esw_eadm</refname> 641 <refpurpose> 642 EADM Subchannel Extended Status Word (ESW) 643 </refpurpose> 644</refnamediv> 645<refsynopsisdiv> 646 <title>Synopsis</title> 647 <programlisting> 648struct esw_eadm { 649 __u32 sublog; 650 struct erw_eadm erw; 651}; </programlisting> 652</refsynopsisdiv> 653 <refsect1> 654 <title>Members</title> 655 <variablelist> 656 <varlistentry> <term>sublog</term> 657 <listitem><para> 658 subchannel logout 659 </para></listitem> 660 </varlistentry> 661 <varlistentry> <term>erw</term> 662 <listitem><para> 663 extended report word 664 </para></listitem> 665 </varlistentry> 666 </variablelist> 667 </refsect1> 668</refentry> 669 670<refentry id="API-struct-irb"> 671<refentryinfo> 672 <title>LINUX</title> 673 <productname>Kernel Hackers Manual</productname> 674 <date>July 2017</date> 675</refentryinfo> 676<refmeta> 677 <refentrytitle><phrase>struct irb</phrase></refentrytitle> 678 <manvolnum>9</manvolnum> 679 <refmiscinfo class="version">4.1.27</refmiscinfo> 680</refmeta> 681<refnamediv> 682 <refname>struct irb</refname> 683 <refpurpose> 684 interruption response block 685 </refpurpose> 686</refnamediv> 687<refsynopsisdiv> 688 <title>Synopsis</title> 689 <programlisting> 690struct irb { 691 union scsw scsw; 692 union esw; 693 __u8 ecw[32]; 694}; </programlisting> 695</refsynopsisdiv> 696 <refsect1> 697 <title>Members</title> 698 <variablelist> 699 <varlistentry> <term>scsw</term> 700 <listitem><para> 701 subchannel status word 702 </para></listitem> 703 </varlistentry> 704 <varlistentry> <term>esw</term> 705 <listitem><para> 706 extended status word 707 </para></listitem> 708 </varlistentry> 709 <varlistentry> <term>ecw[32]</term> 710 <listitem><para> 711 extended control word 712 </para></listitem> 713 </varlistentry> 714 </variablelist> 715 </refsect1> 716<refsect1> 717<title>Description</title> 718<para> 719 The irb that is handed to the device driver when an interrupt occurs. For 720 solicited interrupts, the common I/O layer already performs checks whether 721 a field is valid; a field not being valid is always passed as <constant>0</constant>. 722 If a unit check occurred, <parameter>ecw</parameter> may contain sense data; this is retrieved 723 by the common I/O layer itself if the device doesn't support concurrent 724 sense (so that the device driver never needs to perform basic sene itself). 725 For unsolicited interrupts, the irb is passed as-is (expect for sense data, 726 if applicable). 727</para> 728</refsect1> 729</refentry> 730 731<refentry id="API-struct-ciw"> 732<refentryinfo> 733 <title>LINUX</title> 734 <productname>Kernel Hackers Manual</productname> 735 <date>July 2017</date> 736</refentryinfo> 737<refmeta> 738 <refentrytitle><phrase>struct ciw</phrase></refentrytitle> 739 <manvolnum>9</manvolnum> 740 <refmiscinfo class="version">4.1.27</refmiscinfo> 741</refmeta> 742<refnamediv> 743 <refname>struct ciw</refname> 744 <refpurpose> 745 command information word (CIW) layout 746 </refpurpose> 747</refnamediv> 748<refsynopsisdiv> 749 <title>Synopsis</title> 750 <programlisting> 751struct ciw { 752 __u32 et:2; 753 __u32 reserved:2; 754 __u32 ct:4; 755 __u32 cmd:8; 756 __u32 count:16; 757}; </programlisting> 758</refsynopsisdiv> 759 <refsect1> 760 <title>Members</title> 761 <variablelist> 762 <varlistentry> <term>et</term> 763 <listitem><para> 764 entry type 765 </para></listitem> 766 </varlistentry> 767 <varlistentry> <term>reserved</term> 768 <listitem><para> 769 reserved bits 770 </para></listitem> 771 </varlistentry> 772 <varlistentry> <term>ct</term> 773 <listitem><para> 774 command type 775 </para></listitem> 776 </varlistentry> 777 <varlistentry> <term>cmd</term> 778 <listitem><para> 779 command code 780 </para></listitem> 781 </varlistentry> 782 <varlistentry> <term>count</term> 783 <listitem><para> 784 command count 785 </para></listitem> 786 </varlistentry> 787 </variablelist> 788 </refsect1> 789</refentry> 790 791<refentry id="API-struct-ccw-dev-id"> 792<refentryinfo> 793 <title>LINUX</title> 794 <productname>Kernel Hackers Manual</productname> 795 <date>July 2017</date> 796</refentryinfo> 797<refmeta> 798 <refentrytitle><phrase>struct ccw_dev_id</phrase></refentrytitle> 799 <manvolnum>9</manvolnum> 800 <refmiscinfo class="version">4.1.27</refmiscinfo> 801</refmeta> 802<refnamediv> 803 <refname>struct ccw_dev_id</refname> 804 <refpurpose> 805 unique identifier for ccw devices 806 </refpurpose> 807</refnamediv> 808<refsynopsisdiv> 809 <title>Synopsis</title> 810 <programlisting> 811struct ccw_dev_id { 812 u8 ssid; 813 u16 devno; 814}; </programlisting> 815</refsynopsisdiv> 816 <refsect1> 817 <title>Members</title> 818 <variablelist> 819 <varlistentry> <term>ssid</term> 820 <listitem><para> 821 subchannel set id 822 </para></listitem> 823 </varlistentry> 824 <varlistentry> <term>devno</term> 825 <listitem><para> 826 device number 827 </para></listitem> 828 </varlistentry> 829 </variablelist> 830 </refsect1> 831<refsect1> 832<title>Description</title> 833<para> 834 This structure is not directly based on any hardware structure. The 835 hardware identifies a device by its device number and its subchannel, 836 which is in turn identified by its id. In order to get a unique identifier 837 for ccw devices across subchannel sets, <parameter>struct</parameter> ccw_dev_id has been 838 introduced. 839</para> 840</refsect1> 841</refentry> 842 843<refentry id="API-ccw-dev-id-is-equal"> 844<refentryinfo> 845 <title>LINUX</title> 846 <productname>Kernel Hackers Manual</productname> 847 <date>July 2017</date> 848</refentryinfo> 849<refmeta> 850 <refentrytitle><phrase>ccw_dev_id_is_equal</phrase></refentrytitle> 851 <manvolnum>9</manvolnum> 852 <refmiscinfo class="version">4.1.27</refmiscinfo> 853</refmeta> 854<refnamediv> 855 <refname>ccw_dev_id_is_equal</refname> 856 <refpurpose> 857 compare two ccw_dev_ids 858 </refpurpose> 859</refnamediv> 860<refsynopsisdiv> 861 <title>Synopsis</title> 862 <funcsynopsis><funcprototype> 863 <funcdef>int <function>ccw_dev_id_is_equal </function></funcdef> 864 <paramdef>struct ccw_dev_id * <parameter>dev_id1</parameter></paramdef> 865 <paramdef>struct ccw_dev_id * <parameter>dev_id2</parameter></paramdef> 866 </funcprototype></funcsynopsis> 867</refsynopsisdiv> 868<refsect1> 869 <title>Arguments</title> 870 <variablelist> 871 <varlistentry> 872 <term><parameter>dev_id1</parameter></term> 873 <listitem> 874 <para> 875 a ccw_dev_id 876 </para> 877 </listitem> 878 </varlistentry> 879 <varlistentry> 880 <term><parameter>dev_id2</parameter></term> 881 <listitem> 882 <para> 883 another ccw_dev_id 884 </para> 885 </listitem> 886 </varlistentry> 887 </variablelist> 888</refsect1> 889<refsect1> 890<title>Returns</title> 891<para> 892 <constant>1</constant> if the two structures are equal field-by-field, 893 <constant>0</constant> if not. 894</para> 895</refsect1> 896<refsect1> 897<title>Context</title> 898<para> 899 any 900</para> 901</refsect1> 902</refentry> 903 904 </sect1> 905 <sect1 id="ccwdev"> 906 <title>ccw devices</title> 907 <para> 908 Devices that want to initiate channel I/O need to attach to the ccw bus. 909 Interaction with the driver core is done via the common I/O layer, which 910 provides the abstractions of ccw devices and ccw device drivers. 911 </para> 912 <para> 913 The functions that initiate or terminate channel I/O all act upon a 914 ccw device structure. Device drivers must not bypass those functions 915 or strange side effects may happen. 916 </para> 917<!-- arch/s390/include/asm/ccwdev.h --> 918<refentry id="API-struct-ccw-device"> 919<refentryinfo> 920 <title>LINUX</title> 921 <productname>Kernel Hackers Manual</productname> 922 <date>July 2017</date> 923</refentryinfo> 924<refmeta> 925 <refentrytitle><phrase>struct ccw_device</phrase></refentrytitle> 926 <manvolnum>9</manvolnum> 927 <refmiscinfo class="version">4.1.27</refmiscinfo> 928</refmeta> 929<refnamediv> 930 <refname>struct ccw_device</refname> 931 <refpurpose> 932 channel attached device 933 </refpurpose> 934</refnamediv> 935<refsynopsisdiv> 936 <title>Synopsis</title> 937 <programlisting> 938struct ccw_device { 939 spinlock_t * ccwlock; 940 struct ccw_device_id id; 941 struct ccw_driver * drv; 942 struct device dev; 943 int online; 944 void (* handler) (struct ccw_device *, unsigned long, struct irb *); 945}; </programlisting> 946</refsynopsisdiv> 947 <refsect1> 948 <title>Members</title> 949 <variablelist> 950 <varlistentry> <term>ccwlock</term> 951 <listitem><para> 952pointer to device lock 953 </para></listitem> 954 </varlistentry> 955 <varlistentry> <term>id</term> 956 <listitem><para> 957id of this device 958 </para></listitem> 959 </varlistentry> 960 <varlistentry> <term>drv</term> 961 <listitem><para> 962ccw driver for this device 963 </para></listitem> 964 </varlistentry> 965 <varlistentry> <term>dev</term> 966 <listitem><para> 967embedded device structure 968 </para></listitem> 969 </varlistentry> 970 <varlistentry> <term>online</term> 971 <listitem><para> 972online status of device 973 </para></listitem> 974 </varlistentry> 975 <varlistentry> <term>handler</term> 976 <listitem><para> 977interrupt handler 978 </para></listitem> 979 </varlistentry> 980 </variablelist> 981 </refsect1> 982<refsect1> 983<title>Description</title> 984<para> 985 <parameter>handler</parameter> is a member of the device rather than the driver since a driver 986 can have different interrupt handlers for different ccw devices 987 (multi-subchannel drivers). 988</para> 989</refsect1> 990</refentry> 991 992<refentry id="API-struct-ccw-driver"> 993<refentryinfo> 994 <title>LINUX</title> 995 <productname>Kernel Hackers Manual</productname> 996 <date>July 2017</date> 997</refentryinfo> 998<refmeta> 999 <refentrytitle><phrase>struct ccw_driver</phrase></refentrytitle> 1000 <manvolnum>9</manvolnum> 1001 <refmiscinfo class="version">4.1.27</refmiscinfo> 1002</refmeta> 1003<refnamediv> 1004 <refname>struct ccw_driver</refname> 1005 <refpurpose> 1006 device driver for channel attached devices 1007 </refpurpose> 1008</refnamediv> 1009<refsynopsisdiv> 1010 <title>Synopsis</title> 1011 <programlisting> 1012struct ccw_driver { 1013 struct ccw_device_id * ids; 1014 int (* probe) (struct ccw_device *); 1015 void (* remove) (struct ccw_device *); 1016 int (* set_online) (struct ccw_device *); 1017 int (* set_offline) (struct ccw_device *); 1018 int (* notify) (struct ccw_device *, int); 1019 void (* path_event) (struct ccw_device *, int *); 1020 void (* shutdown) (struct ccw_device *); 1021 int (* prepare) (struct ccw_device *); 1022 void (* complete) (struct ccw_device *); 1023 int (* freeze) (struct ccw_device *); 1024 int (* thaw) (struct ccw_device *); 1025 int (* restore) (struct ccw_device *); 1026 enum uc_todo (* uc_handler) (struct ccw_device *, struct irb *); 1027 struct device_driver driver; 1028 enum interruption_class int_class; 1029}; </programlisting> 1030</refsynopsisdiv> 1031 <refsect1> 1032 <title>Members</title> 1033 <variablelist> 1034 <varlistentry> <term>ids</term> 1035 <listitem><para> 1036 ids supported by this driver 1037 </para></listitem> 1038 </varlistentry> 1039 <varlistentry> <term>probe</term> 1040 <listitem><para> 1041 function called on probe 1042 </para></listitem> 1043 </varlistentry> 1044 <varlistentry> <term>remove</term> 1045 <listitem><para> 1046 function called on remove 1047 </para></listitem> 1048 </varlistentry> 1049 <varlistentry> <term>set_online</term> 1050 <listitem><para> 1051 called when setting device online 1052 </para></listitem> 1053 </varlistentry> 1054 <varlistentry> <term>set_offline</term> 1055 <listitem><para> 1056 called when setting device offline 1057 </para></listitem> 1058 </varlistentry> 1059 <varlistentry> <term>notify</term> 1060 <listitem><para> 1061 notify driver of device state changes 1062 </para></listitem> 1063 </varlistentry> 1064 <varlistentry> <term>path_event</term> 1065 <listitem><para> 1066 notify driver of channel path events 1067 </para></listitem> 1068 </varlistentry> 1069 <varlistentry> <term>shutdown</term> 1070 <listitem><para> 1071 called at device shutdown 1072 </para></listitem> 1073 </varlistentry> 1074 <varlistentry> <term>prepare</term> 1075 <listitem><para> 1076 prepare for pm state transition 1077 </para></listitem> 1078 </varlistentry> 1079 <varlistentry> <term>complete</term> 1080 <listitem><para> 1081 undo work done in <parameter>prepare</parameter> 1082 </para></listitem> 1083 </varlistentry> 1084 <varlistentry> <term>freeze</term> 1085 <listitem><para> 1086 callback for freezing during hibernation snapshotting 1087 </para></listitem> 1088 </varlistentry> 1089 <varlistentry> <term>thaw</term> 1090 <listitem><para> 1091 undo work done in <parameter>freeze</parameter> 1092 </para></listitem> 1093 </varlistentry> 1094 <varlistentry> <term>restore</term> 1095 <listitem><para> 1096 callback for restoring after hibernation 1097 </para></listitem> 1098 </varlistentry> 1099 <varlistentry> <term>uc_handler</term> 1100 <listitem><para> 1101 callback for unit check handler 1102 </para></listitem> 1103 </varlistentry> 1104 <varlistentry> <term>driver</term> 1105 <listitem><para> 1106 embedded device driver structure 1107 </para></listitem> 1108 </varlistentry> 1109 <varlistentry> <term>int_class</term> 1110 <listitem><para> 1111 interruption class to use for accounting interrupts 1112 </para></listitem> 1113 </varlistentry> 1114 </variablelist> 1115 </refsect1> 1116</refentry> 1117 1118<!-- drivers/s390/cio/device.c --> 1119<refentry id="API-ccw-device-set-offline"> 1120<refentryinfo> 1121 <title>LINUX</title> 1122 <productname>Kernel Hackers Manual</productname> 1123 <date>July 2017</date> 1124</refentryinfo> 1125<refmeta> 1126 <refentrytitle><phrase>ccw_device_set_offline</phrase></refentrytitle> 1127 <manvolnum>9</manvolnum> 1128 <refmiscinfo class="version">4.1.27</refmiscinfo> 1129</refmeta> 1130<refnamediv> 1131 <refname>ccw_device_set_offline</refname> 1132 <refpurpose> 1133 disable a ccw device for I/O 1134 </refpurpose> 1135</refnamediv> 1136<refsynopsisdiv> 1137 <title>Synopsis</title> 1138 <funcsynopsis><funcprototype> 1139 <funcdef>int <function>ccw_device_set_offline </function></funcdef> 1140 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1141 </funcprototype></funcsynopsis> 1142</refsynopsisdiv> 1143<refsect1> 1144 <title>Arguments</title> 1145 <variablelist> 1146 <varlistentry> 1147 <term><parameter>cdev</parameter></term> 1148 <listitem> 1149 <para> 1150 target ccw device 1151 </para> 1152 </listitem> 1153 </varlistentry> 1154 </variablelist> 1155</refsect1> 1156<refsect1> 1157<title>Description</title> 1158<para> 1159 This function calls the driver's <function>set_offline</function> function for <parameter>cdev</parameter>, if 1160 given, and then disables <parameter>cdev</parameter>. 1161</para> 1162</refsect1> 1163<refsect1> 1164<title>Returns</title> 1165<para> 1166 <constant>0</constant> on success and a negative error value on failure. 1167</para> 1168</refsect1> 1169<refsect1> 1170<title>Context</title> 1171<para> 1172 enabled, ccw device lock not held 1173</para> 1174</refsect1> 1175</refentry> 1176 1177<refentry id="API-ccw-device-set-online"> 1178<refentryinfo> 1179 <title>LINUX</title> 1180 <productname>Kernel Hackers Manual</productname> 1181 <date>July 2017</date> 1182</refentryinfo> 1183<refmeta> 1184 <refentrytitle><phrase>ccw_device_set_online</phrase></refentrytitle> 1185 <manvolnum>9</manvolnum> 1186 <refmiscinfo class="version">4.1.27</refmiscinfo> 1187</refmeta> 1188<refnamediv> 1189 <refname>ccw_device_set_online</refname> 1190 <refpurpose> 1191 enable a ccw device for I/O 1192 </refpurpose> 1193</refnamediv> 1194<refsynopsisdiv> 1195 <title>Synopsis</title> 1196 <funcsynopsis><funcprototype> 1197 <funcdef>int <function>ccw_device_set_online </function></funcdef> 1198 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1199 </funcprototype></funcsynopsis> 1200</refsynopsisdiv> 1201<refsect1> 1202 <title>Arguments</title> 1203 <variablelist> 1204 <varlistentry> 1205 <term><parameter>cdev</parameter></term> 1206 <listitem> 1207 <para> 1208 target ccw device 1209 </para> 1210 </listitem> 1211 </varlistentry> 1212 </variablelist> 1213</refsect1> 1214<refsect1> 1215<title>Description</title> 1216<para> 1217 This function first enables <parameter>cdev</parameter> and then calls the driver's <function>set_online</function> 1218 function for <parameter>cdev</parameter>, if given. If <function>set_online</function> returns an error, <parameter>cdev</parameter> is 1219 disabled again. 1220</para> 1221</refsect1> 1222<refsect1> 1223<title>Returns</title> 1224<para> 1225 <constant>0</constant> on success and a negative error value on failure. 1226</para> 1227</refsect1> 1228<refsect1> 1229<title>Context</title> 1230<para> 1231 enabled, ccw device lock not held 1232</para> 1233</refsect1> 1234</refentry> 1235 1236<refentry id="API-get-ccwdev-by-dev-id"> 1237<refentryinfo> 1238 <title>LINUX</title> 1239 <productname>Kernel Hackers Manual</productname> 1240 <date>July 2017</date> 1241</refentryinfo> 1242<refmeta> 1243 <refentrytitle><phrase>get_ccwdev_by_dev_id</phrase></refentrytitle> 1244 <manvolnum>9</manvolnum> 1245 <refmiscinfo class="version">4.1.27</refmiscinfo> 1246</refmeta> 1247<refnamediv> 1248 <refname>get_ccwdev_by_dev_id</refname> 1249 <refpurpose> 1250 obtain device from a ccw device id 1251 </refpurpose> 1252</refnamediv> 1253<refsynopsisdiv> 1254 <title>Synopsis</title> 1255 <funcsynopsis><funcprototype> 1256 <funcdef>struct ccw_device * <function>get_ccwdev_by_dev_id </function></funcdef> 1257 <paramdef>struct ccw_dev_id * <parameter>dev_id</parameter></paramdef> 1258 </funcprototype></funcsynopsis> 1259</refsynopsisdiv> 1260<refsect1> 1261 <title>Arguments</title> 1262 <variablelist> 1263 <varlistentry> 1264 <term><parameter>dev_id</parameter></term> 1265 <listitem> 1266 <para> 1267 id of the device to be searched 1268 </para> 1269 </listitem> 1270 </varlistentry> 1271 </variablelist> 1272</refsect1> 1273<refsect1> 1274<title>Description</title> 1275<para> 1276 This function searches all devices attached to the ccw bus for a device 1277 matching <parameter>dev_id</parameter>. 1278</para> 1279</refsect1> 1280<refsect1> 1281<title>Returns</title> 1282<para> 1283 If a device is found its reference count is increased and returned; 1284 else <constant>NULL</constant> is returned. 1285</para> 1286</refsect1> 1287</refentry> 1288 1289<refentry id="API-get-ccwdev-by-busid"> 1290<refentryinfo> 1291 <title>LINUX</title> 1292 <productname>Kernel Hackers Manual</productname> 1293 <date>July 2017</date> 1294</refentryinfo> 1295<refmeta> 1296 <refentrytitle><phrase>get_ccwdev_by_busid</phrase></refentrytitle> 1297 <manvolnum>9</manvolnum> 1298 <refmiscinfo class="version">4.1.27</refmiscinfo> 1299</refmeta> 1300<refnamediv> 1301 <refname>get_ccwdev_by_busid</refname> 1302 <refpurpose> 1303 obtain device from a bus id 1304 </refpurpose> 1305</refnamediv> 1306<refsynopsisdiv> 1307 <title>Synopsis</title> 1308 <funcsynopsis><funcprototype> 1309 <funcdef>struct ccw_device * <function>get_ccwdev_by_busid </function></funcdef> 1310 <paramdef>struct ccw_driver * <parameter>cdrv</parameter></paramdef> 1311 <paramdef>const char * <parameter>bus_id</parameter></paramdef> 1312 </funcprototype></funcsynopsis> 1313</refsynopsisdiv> 1314<refsect1> 1315 <title>Arguments</title> 1316 <variablelist> 1317 <varlistentry> 1318 <term><parameter>cdrv</parameter></term> 1319 <listitem> 1320 <para> 1321 driver the device is owned by 1322 </para> 1323 </listitem> 1324 </varlistentry> 1325 <varlistentry> 1326 <term><parameter>bus_id</parameter></term> 1327 <listitem> 1328 <para> 1329 bus id of the device to be searched 1330 </para> 1331 </listitem> 1332 </varlistentry> 1333 </variablelist> 1334</refsect1> 1335<refsect1> 1336<title>Description</title> 1337<para> 1338 This function searches all devices owned by <parameter>cdrv</parameter> for a device with a bus 1339 id matching <parameter>bus_id</parameter>. 1340</para> 1341</refsect1> 1342<refsect1> 1343<title>Returns</title> 1344<para> 1345 If a match is found, its reference count of the found device is increased 1346 and it is returned; else <constant>NULL</constant> is returned. 1347</para> 1348</refsect1> 1349</refentry> 1350 1351<refentry id="API-ccw-driver-register"> 1352<refentryinfo> 1353 <title>LINUX</title> 1354 <productname>Kernel Hackers Manual</productname> 1355 <date>July 2017</date> 1356</refentryinfo> 1357<refmeta> 1358 <refentrytitle><phrase>ccw_driver_register</phrase></refentrytitle> 1359 <manvolnum>9</manvolnum> 1360 <refmiscinfo class="version">4.1.27</refmiscinfo> 1361</refmeta> 1362<refnamediv> 1363 <refname>ccw_driver_register</refname> 1364 <refpurpose> 1365 register a ccw driver 1366 </refpurpose> 1367</refnamediv> 1368<refsynopsisdiv> 1369 <title>Synopsis</title> 1370 <funcsynopsis><funcprototype> 1371 <funcdef>int <function>ccw_driver_register </function></funcdef> 1372 <paramdef>struct ccw_driver * <parameter>cdriver</parameter></paramdef> 1373 </funcprototype></funcsynopsis> 1374</refsynopsisdiv> 1375<refsect1> 1376 <title>Arguments</title> 1377 <variablelist> 1378 <varlistentry> 1379 <term><parameter>cdriver</parameter></term> 1380 <listitem> 1381 <para> 1382 driver to be registered 1383 </para> 1384 </listitem> 1385 </varlistentry> 1386 </variablelist> 1387</refsect1> 1388<refsect1> 1389<title>Description</title> 1390<para> 1391 This function is mainly a wrapper around <function>driver_register</function>. 1392</para> 1393</refsect1> 1394<refsect1> 1395<title>Returns</title> 1396<para> 1397 <constant>0</constant> on success and a negative error value on failure. 1398</para> 1399</refsect1> 1400</refentry> 1401 1402<refentry id="API-ccw-driver-unregister"> 1403<refentryinfo> 1404 <title>LINUX</title> 1405 <productname>Kernel Hackers Manual</productname> 1406 <date>July 2017</date> 1407</refentryinfo> 1408<refmeta> 1409 <refentrytitle><phrase>ccw_driver_unregister</phrase></refentrytitle> 1410 <manvolnum>9</manvolnum> 1411 <refmiscinfo class="version">4.1.27</refmiscinfo> 1412</refmeta> 1413<refnamediv> 1414 <refname>ccw_driver_unregister</refname> 1415 <refpurpose> 1416 deregister a ccw driver 1417 </refpurpose> 1418</refnamediv> 1419<refsynopsisdiv> 1420 <title>Synopsis</title> 1421 <funcsynopsis><funcprototype> 1422 <funcdef>void <function>ccw_driver_unregister </function></funcdef> 1423 <paramdef>struct ccw_driver * <parameter>cdriver</parameter></paramdef> 1424 </funcprototype></funcsynopsis> 1425</refsynopsisdiv> 1426<refsect1> 1427 <title>Arguments</title> 1428 <variablelist> 1429 <varlistentry> 1430 <term><parameter>cdriver</parameter></term> 1431 <listitem> 1432 <para> 1433 driver to be deregistered 1434 </para> 1435 </listitem> 1436 </varlistentry> 1437 </variablelist> 1438</refsect1> 1439<refsect1> 1440<title>Description</title> 1441<para> 1442 This function is mainly a wrapper around <function>driver_unregister</function>. 1443</para> 1444</refsect1> 1445</refentry> 1446 1447<refentry id="API-ccw-device-siosl"> 1448<refentryinfo> 1449 <title>LINUX</title> 1450 <productname>Kernel Hackers Manual</productname> 1451 <date>July 2017</date> 1452</refentryinfo> 1453<refmeta> 1454 <refentrytitle><phrase>ccw_device_siosl</phrase></refentrytitle> 1455 <manvolnum>9</manvolnum> 1456 <refmiscinfo class="version">4.1.27</refmiscinfo> 1457</refmeta> 1458<refnamediv> 1459 <refname>ccw_device_siosl</refname> 1460 <refpurpose> 1461 initiate logging 1462 </refpurpose> 1463</refnamediv> 1464<refsynopsisdiv> 1465 <title>Synopsis</title> 1466 <funcsynopsis><funcprototype> 1467 <funcdef>int <function>ccw_device_siosl </function></funcdef> 1468 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1469 </funcprototype></funcsynopsis> 1470</refsynopsisdiv> 1471<refsect1> 1472 <title>Arguments</title> 1473 <variablelist> 1474 <varlistentry> 1475 <term><parameter>cdev</parameter></term> 1476 <listitem> 1477 <para> 1478 ccw device 1479 </para> 1480 </listitem> 1481 </varlistentry> 1482 </variablelist> 1483</refsect1> 1484<refsect1> 1485<title>Description</title> 1486<para> 1487 This function is used to invoke model-dependent logging within the channel 1488 subsystem. 1489</para> 1490</refsect1> 1491</refentry> 1492 1493<!-- drivers/s390/cio/device_ops.c --> 1494<refentry id="API-ccw-device-set-options-mask"> 1495<refentryinfo> 1496 <title>LINUX</title> 1497 <productname>Kernel Hackers Manual</productname> 1498 <date>July 2017</date> 1499</refentryinfo> 1500<refmeta> 1501 <refentrytitle><phrase>ccw_device_set_options_mask</phrase></refentrytitle> 1502 <manvolnum>9</manvolnum> 1503 <refmiscinfo class="version">4.1.27</refmiscinfo> 1504</refmeta> 1505<refnamediv> 1506 <refname>ccw_device_set_options_mask</refname> 1507 <refpurpose> 1508 set some options and unset the rest 1509 </refpurpose> 1510</refnamediv> 1511<refsynopsisdiv> 1512 <title>Synopsis</title> 1513 <funcsynopsis><funcprototype> 1514 <funcdef>int <function>ccw_device_set_options_mask </function></funcdef> 1515 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1516 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 1517 </funcprototype></funcsynopsis> 1518</refsynopsisdiv> 1519<refsect1> 1520 <title>Arguments</title> 1521 <variablelist> 1522 <varlistentry> 1523 <term><parameter>cdev</parameter></term> 1524 <listitem> 1525 <para> 1526 device for which the options are to be set 1527 </para> 1528 </listitem> 1529 </varlistentry> 1530 <varlistentry> 1531 <term><parameter>flags</parameter></term> 1532 <listitem> 1533 <para> 1534 options to be set 1535 </para> 1536 </listitem> 1537 </varlistentry> 1538 </variablelist> 1539</refsect1> 1540<refsect1> 1541<title>Description</title> 1542<para> 1543 All flags specified in <parameter>flags</parameter> are set, all flags not specified in <parameter>flags</parameter> 1544 are cleared. 1545</para> 1546</refsect1> 1547<refsect1> 1548<title>Returns</title> 1549<para> 1550 <constant>0</constant> on success, -<constant>EINVAL</constant> on an invalid flag combination. 1551</para> 1552</refsect1> 1553</refentry> 1554 1555<refentry id="API-ccw-device-set-options"> 1556<refentryinfo> 1557 <title>LINUX</title> 1558 <productname>Kernel Hackers Manual</productname> 1559 <date>July 2017</date> 1560</refentryinfo> 1561<refmeta> 1562 <refentrytitle><phrase>ccw_device_set_options</phrase></refentrytitle> 1563 <manvolnum>9</manvolnum> 1564 <refmiscinfo class="version">4.1.27</refmiscinfo> 1565</refmeta> 1566<refnamediv> 1567 <refname>ccw_device_set_options</refname> 1568 <refpurpose> 1569 set some options 1570 </refpurpose> 1571</refnamediv> 1572<refsynopsisdiv> 1573 <title>Synopsis</title> 1574 <funcsynopsis><funcprototype> 1575 <funcdef>int <function>ccw_device_set_options </function></funcdef> 1576 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1577 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 1578 </funcprototype></funcsynopsis> 1579</refsynopsisdiv> 1580<refsect1> 1581 <title>Arguments</title> 1582 <variablelist> 1583 <varlistentry> 1584 <term><parameter>cdev</parameter></term> 1585 <listitem> 1586 <para> 1587 device for which the options are to be set 1588 </para> 1589 </listitem> 1590 </varlistentry> 1591 <varlistentry> 1592 <term><parameter>flags</parameter></term> 1593 <listitem> 1594 <para> 1595 options to be set 1596 </para> 1597 </listitem> 1598 </varlistentry> 1599 </variablelist> 1600</refsect1> 1601<refsect1> 1602<title>Description</title> 1603<para> 1604 All flags specified in <parameter>flags</parameter> are set, the remainder is left untouched. 1605</para> 1606</refsect1> 1607<refsect1> 1608<title>Returns</title> 1609<para> 1610 <constant>0</constant> on success, -<constant>EINVAL</constant> if an invalid flag combination would ensue. 1611</para> 1612</refsect1> 1613</refentry> 1614 1615<refentry id="API-ccw-device-clear-options"> 1616<refentryinfo> 1617 <title>LINUX</title> 1618 <productname>Kernel Hackers Manual</productname> 1619 <date>July 2017</date> 1620</refentryinfo> 1621<refmeta> 1622 <refentrytitle><phrase>ccw_device_clear_options</phrase></refentrytitle> 1623 <manvolnum>9</manvolnum> 1624 <refmiscinfo class="version">4.1.27</refmiscinfo> 1625</refmeta> 1626<refnamediv> 1627 <refname>ccw_device_clear_options</refname> 1628 <refpurpose> 1629 clear some options 1630 </refpurpose> 1631</refnamediv> 1632<refsynopsisdiv> 1633 <title>Synopsis</title> 1634 <funcsynopsis><funcprototype> 1635 <funcdef>void <function>ccw_device_clear_options </function></funcdef> 1636 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1637 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 1638 </funcprototype></funcsynopsis> 1639</refsynopsisdiv> 1640<refsect1> 1641 <title>Arguments</title> 1642 <variablelist> 1643 <varlistentry> 1644 <term><parameter>cdev</parameter></term> 1645 <listitem> 1646 <para> 1647 device for which the options are to be cleared 1648 </para> 1649 </listitem> 1650 </varlistentry> 1651 <varlistentry> 1652 <term><parameter>flags</parameter></term> 1653 <listitem> 1654 <para> 1655 options to be cleared 1656 </para> 1657 </listitem> 1658 </varlistentry> 1659 </variablelist> 1660</refsect1> 1661<refsect1> 1662<title>Description</title> 1663<para> 1664 All flags specified in <parameter>flags</parameter> are cleared, the remainder is left untouched. 1665</para> 1666</refsect1> 1667</refentry> 1668 1669<refentry id="API-ccw-device-is-pathgroup"> 1670<refentryinfo> 1671 <title>LINUX</title> 1672 <productname>Kernel Hackers Manual</productname> 1673 <date>July 2017</date> 1674</refentryinfo> 1675<refmeta> 1676 <refentrytitle><phrase>ccw_device_is_pathgroup</phrase></refentrytitle> 1677 <manvolnum>9</manvolnum> 1678 <refmiscinfo class="version">4.1.27</refmiscinfo> 1679</refmeta> 1680<refnamediv> 1681 <refname>ccw_device_is_pathgroup</refname> 1682 <refpurpose> 1683 determine if paths to this device are grouped 1684 </refpurpose> 1685</refnamediv> 1686<refsynopsisdiv> 1687 <title>Synopsis</title> 1688 <funcsynopsis><funcprototype> 1689 <funcdef>int <function>ccw_device_is_pathgroup </function></funcdef> 1690 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1691 </funcprototype></funcsynopsis> 1692</refsynopsisdiv> 1693<refsect1> 1694 <title>Arguments</title> 1695 <variablelist> 1696 <varlistentry> 1697 <term><parameter>cdev</parameter></term> 1698 <listitem> 1699 <para> 1700 ccw device 1701 </para> 1702 </listitem> 1703 </varlistentry> 1704 </variablelist> 1705</refsect1> 1706<refsect1> 1707<title>Description</title> 1708<para> 1709 Return non-zero if there is a path group, zero otherwise. 1710</para> 1711</refsect1> 1712</refentry> 1713 1714<refentry id="API-ccw-device-is-multipath"> 1715<refentryinfo> 1716 <title>LINUX</title> 1717 <productname>Kernel Hackers Manual</productname> 1718 <date>July 2017</date> 1719</refentryinfo> 1720<refmeta> 1721 <refentrytitle><phrase>ccw_device_is_multipath</phrase></refentrytitle> 1722 <manvolnum>9</manvolnum> 1723 <refmiscinfo class="version">4.1.27</refmiscinfo> 1724</refmeta> 1725<refnamediv> 1726 <refname>ccw_device_is_multipath</refname> 1727 <refpurpose> 1728 determine if device is operating in multipath mode 1729 </refpurpose> 1730</refnamediv> 1731<refsynopsisdiv> 1732 <title>Synopsis</title> 1733 <funcsynopsis><funcprototype> 1734 <funcdef>int <function>ccw_device_is_multipath </function></funcdef> 1735 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1736 </funcprototype></funcsynopsis> 1737</refsynopsisdiv> 1738<refsect1> 1739 <title>Arguments</title> 1740 <variablelist> 1741 <varlistentry> 1742 <term><parameter>cdev</parameter></term> 1743 <listitem> 1744 <para> 1745 ccw device 1746 </para> 1747 </listitem> 1748 </varlistentry> 1749 </variablelist> 1750</refsect1> 1751<refsect1> 1752<title>Description</title> 1753<para> 1754 Return non-zero if device is operating in multipath mode, zero otherwise. 1755</para> 1756</refsect1> 1757</refentry> 1758 1759<refentry id="API-ccw-device-clear"> 1760<refentryinfo> 1761 <title>LINUX</title> 1762 <productname>Kernel Hackers Manual</productname> 1763 <date>July 2017</date> 1764</refentryinfo> 1765<refmeta> 1766 <refentrytitle><phrase>ccw_device_clear</phrase></refentrytitle> 1767 <manvolnum>9</manvolnum> 1768 <refmiscinfo class="version">4.1.27</refmiscinfo> 1769</refmeta> 1770<refnamediv> 1771 <refname>ccw_device_clear</refname> 1772 <refpurpose> 1773 terminate I/O request processing 1774 </refpurpose> 1775</refnamediv> 1776<refsynopsisdiv> 1777 <title>Synopsis</title> 1778 <funcsynopsis><funcprototype> 1779 <funcdef>int <function>ccw_device_clear </function></funcdef> 1780 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1781 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 1782 </funcprototype></funcsynopsis> 1783</refsynopsisdiv> 1784<refsect1> 1785 <title>Arguments</title> 1786 <variablelist> 1787 <varlistentry> 1788 <term><parameter>cdev</parameter></term> 1789 <listitem> 1790 <para> 1791 target ccw device 1792 </para> 1793 </listitem> 1794 </varlistentry> 1795 <varlistentry> 1796 <term><parameter>intparm</parameter></term> 1797 <listitem> 1798 <para> 1799 interruption parameter; value is only used if no I/O is 1800 outstanding, otherwise the intparm associated with the I/O request 1801 is returned 1802 </para> 1803 </listitem> 1804 </varlistentry> 1805 </variablelist> 1806</refsect1> 1807<refsect1> 1808<title>Description</title> 1809<para> 1810 <function>ccw_device_clear</function> calls csch on <parameter>cdev</parameter>'s subchannel. 1811</para> 1812</refsect1> 1813<refsect1> 1814<title>Returns</title> 1815<para> 1816 <constant>0</constant> on success, 1817 -<constant>ENODEV</constant> on device not operational, 1818 -<constant>EINVAL</constant> on invalid device state. 1819</para> 1820</refsect1> 1821<refsect1> 1822<title>Context</title> 1823<para> 1824 Interrupts disabled, ccw device lock held 1825</para> 1826</refsect1> 1827</refentry> 1828 1829<refentry id="API-ccw-device-start-key"> 1830<refentryinfo> 1831 <title>LINUX</title> 1832 <productname>Kernel Hackers Manual</productname> 1833 <date>July 2017</date> 1834</refentryinfo> 1835<refmeta> 1836 <refentrytitle><phrase>ccw_device_start_key</phrase></refentrytitle> 1837 <manvolnum>9</manvolnum> 1838 <refmiscinfo class="version">4.1.27</refmiscinfo> 1839</refmeta> 1840<refnamediv> 1841 <refname>ccw_device_start_key</refname> 1842 <refpurpose> 1843 start a s390 channel program with key 1844 </refpurpose> 1845</refnamediv> 1846<refsynopsisdiv> 1847 <title>Synopsis</title> 1848 <funcsynopsis><funcprototype> 1849 <funcdef>int <function>ccw_device_start_key </function></funcdef> 1850 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1851 <paramdef>struct ccw1 * <parameter>cpa</parameter></paramdef> 1852 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 1853 <paramdef>__u8 <parameter>lpm</parameter></paramdef> 1854 <paramdef>__u8 <parameter>key</parameter></paramdef> 1855 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 1856 </funcprototype></funcsynopsis> 1857</refsynopsisdiv> 1858<refsect1> 1859 <title>Arguments</title> 1860 <variablelist> 1861 <varlistentry> 1862 <term><parameter>cdev</parameter></term> 1863 <listitem> 1864 <para> 1865 target ccw device 1866 </para> 1867 </listitem> 1868 </varlistentry> 1869 <varlistentry> 1870 <term><parameter>cpa</parameter></term> 1871 <listitem> 1872 <para> 1873 logical start address of channel program 1874 </para> 1875 </listitem> 1876 </varlistentry> 1877 <varlistentry> 1878 <term><parameter>intparm</parameter></term> 1879 <listitem> 1880 <para> 1881 user specific interruption parameter; will be presented back to 1882 <parameter>cdev</parameter>'s interrupt handler. Allows a device driver to associate 1883 the interrupt with a particular I/O request. 1884 </para> 1885 </listitem> 1886 </varlistentry> 1887 <varlistentry> 1888 <term><parameter>lpm</parameter></term> 1889 <listitem> 1890 <para> 1891 defines the channel path to be used for a specific I/O request. A 1892 value of 0 will make cio use the opm. 1893 </para> 1894 </listitem> 1895 </varlistentry> 1896 <varlistentry> 1897 <term><parameter>key</parameter></term> 1898 <listitem> 1899 <para> 1900 storage key to be used for the I/O 1901 </para> 1902 </listitem> 1903 </varlistentry> 1904 <varlistentry> 1905 <term><parameter>flags</parameter></term> 1906 <listitem> 1907 <para> 1908 additional flags; defines the action to be performed for I/O 1909 processing. 1910 </para> 1911 </listitem> 1912 </varlistentry> 1913 </variablelist> 1914</refsect1> 1915<refsect1> 1916<title>Description</title> 1917<para> 1918 Start a S/390 channel program. When the interrupt arrives, the 1919 IRQ handler is called, either immediately, delayed (dev-end missing, 1920 or sense required) or never (no IRQ handler registered). 1921</para> 1922</refsect1> 1923<refsect1> 1924<title>Returns</title> 1925<para> 1926 <constant>0</constant>, if the operation was successful; 1927 -<constant>EBUSY</constant>, if the device is busy, or status pending; 1928 -<constant>EACCES</constant>, if no path specified in <parameter>lpm</parameter> is operational; 1929 -<constant>ENODEV</constant>, if the device is not operational. 1930</para> 1931</refsect1> 1932<refsect1> 1933<title>Context</title> 1934<para> 1935 Interrupts disabled, ccw device lock held 1936</para> 1937</refsect1> 1938</refentry> 1939 1940<refentry id="API-ccw-device-start-timeout-key"> 1941<refentryinfo> 1942 <title>LINUX</title> 1943 <productname>Kernel Hackers Manual</productname> 1944 <date>July 2017</date> 1945</refentryinfo> 1946<refmeta> 1947 <refentrytitle><phrase>ccw_device_start_timeout_key</phrase></refentrytitle> 1948 <manvolnum>9</manvolnum> 1949 <refmiscinfo class="version">4.1.27</refmiscinfo> 1950</refmeta> 1951<refnamediv> 1952 <refname>ccw_device_start_timeout_key</refname> 1953 <refpurpose> 1954 start a s390 channel program with timeout and key 1955 </refpurpose> 1956</refnamediv> 1957<refsynopsisdiv> 1958 <title>Synopsis</title> 1959 <funcsynopsis><funcprototype> 1960 <funcdef>int <function>ccw_device_start_timeout_key </function></funcdef> 1961 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 1962 <paramdef>struct ccw1 * <parameter>cpa</parameter></paramdef> 1963 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 1964 <paramdef>__u8 <parameter>lpm</parameter></paramdef> 1965 <paramdef>__u8 <parameter>key</parameter></paramdef> 1966 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 1967 <paramdef>int <parameter>expires</parameter></paramdef> 1968 </funcprototype></funcsynopsis> 1969</refsynopsisdiv> 1970<refsect1> 1971 <title>Arguments</title> 1972 <variablelist> 1973 <varlistentry> 1974 <term><parameter>cdev</parameter></term> 1975 <listitem> 1976 <para> 1977 target ccw device 1978 </para> 1979 </listitem> 1980 </varlistentry> 1981 <varlistentry> 1982 <term><parameter>cpa</parameter></term> 1983 <listitem> 1984 <para> 1985 logical start address of channel program 1986 </para> 1987 </listitem> 1988 </varlistentry> 1989 <varlistentry> 1990 <term><parameter>intparm</parameter></term> 1991 <listitem> 1992 <para> 1993 user specific interruption parameter; will be presented back to 1994 <parameter>cdev</parameter>'s interrupt handler. Allows a device driver to associate 1995 the interrupt with a particular I/O request. 1996 </para> 1997 </listitem> 1998 </varlistentry> 1999 <varlistentry> 2000 <term><parameter>lpm</parameter></term> 2001 <listitem> 2002 <para> 2003 defines the channel path to be used for a specific I/O request. A 2004 value of 0 will make cio use the opm. 2005 </para> 2006 </listitem> 2007 </varlistentry> 2008 <varlistentry> 2009 <term><parameter>key</parameter></term> 2010 <listitem> 2011 <para> 2012 storage key to be used for the I/O 2013 </para> 2014 </listitem> 2015 </varlistentry> 2016 <varlistentry> 2017 <term><parameter>flags</parameter></term> 2018 <listitem> 2019 <para> 2020 additional flags; defines the action to be performed for I/O 2021 processing. 2022 </para> 2023 </listitem> 2024 </varlistentry> 2025 <varlistentry> 2026 <term><parameter>expires</parameter></term> 2027 <listitem> 2028 <para> 2029 timeout value in jiffies 2030 </para> 2031 </listitem> 2032 </varlistentry> 2033 </variablelist> 2034</refsect1> 2035<refsect1> 2036<title>Description</title> 2037<para> 2038 Start a S/390 channel program. When the interrupt arrives, the 2039 IRQ handler is called, either immediately, delayed (dev-end missing, 2040 or sense required) or never (no IRQ handler registered). 2041 This function notifies the device driver if the channel program has not 2042 completed during the time specified by <parameter>expires</parameter>. If a timeout occurs, the 2043 channel program is terminated via xsch, hsch or csch, and the device's 2044 interrupt handler will be called with an irb containing ERR_PTR(-<constant>ETIMEDOUT</constant>). 2045</para> 2046</refsect1> 2047<refsect1> 2048<title>Returns</title> 2049<para> 2050 <constant>0</constant>, if the operation was successful; 2051 -<constant>EBUSY</constant>, if the device is busy, or status pending; 2052 -<constant>EACCES</constant>, if no path specified in <parameter>lpm</parameter> is operational; 2053 -<constant>ENODEV</constant>, if the device is not operational. 2054</para> 2055</refsect1> 2056<refsect1> 2057<title>Context</title> 2058<para> 2059 Interrupts disabled, ccw device lock held 2060</para> 2061</refsect1> 2062</refentry> 2063 2064<refentry id="API-ccw-device-start"> 2065<refentryinfo> 2066 <title>LINUX</title> 2067 <productname>Kernel Hackers Manual</productname> 2068 <date>July 2017</date> 2069</refentryinfo> 2070<refmeta> 2071 <refentrytitle><phrase>ccw_device_start</phrase></refentrytitle> 2072 <manvolnum>9</manvolnum> 2073 <refmiscinfo class="version">4.1.27</refmiscinfo> 2074</refmeta> 2075<refnamediv> 2076 <refname>ccw_device_start</refname> 2077 <refpurpose> 2078 start a s390 channel program 2079 </refpurpose> 2080</refnamediv> 2081<refsynopsisdiv> 2082 <title>Synopsis</title> 2083 <funcsynopsis><funcprototype> 2084 <funcdef>int <function>ccw_device_start </function></funcdef> 2085 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2086 <paramdef>struct ccw1 * <parameter>cpa</parameter></paramdef> 2087 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 2088 <paramdef>__u8 <parameter>lpm</parameter></paramdef> 2089 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 2090 </funcprototype></funcsynopsis> 2091</refsynopsisdiv> 2092<refsect1> 2093 <title>Arguments</title> 2094 <variablelist> 2095 <varlistentry> 2096 <term><parameter>cdev</parameter></term> 2097 <listitem> 2098 <para> 2099 target ccw device 2100 </para> 2101 </listitem> 2102 </varlistentry> 2103 <varlistentry> 2104 <term><parameter>cpa</parameter></term> 2105 <listitem> 2106 <para> 2107 logical start address of channel program 2108 </para> 2109 </listitem> 2110 </varlistentry> 2111 <varlistentry> 2112 <term><parameter>intparm</parameter></term> 2113 <listitem> 2114 <para> 2115 user specific interruption parameter; will be presented back to 2116 <parameter>cdev</parameter>'s interrupt handler. Allows a device driver to associate 2117 the interrupt with a particular I/O request. 2118 </para> 2119 </listitem> 2120 </varlistentry> 2121 <varlistentry> 2122 <term><parameter>lpm</parameter></term> 2123 <listitem> 2124 <para> 2125 defines the channel path to be used for a specific I/O request. A 2126 value of 0 will make cio use the opm. 2127 </para> 2128 </listitem> 2129 </varlistentry> 2130 <varlistentry> 2131 <term><parameter>flags</parameter></term> 2132 <listitem> 2133 <para> 2134 additional flags; defines the action to be performed for I/O 2135 processing. 2136 </para> 2137 </listitem> 2138 </varlistentry> 2139 </variablelist> 2140</refsect1> 2141<refsect1> 2142<title>Description</title> 2143<para> 2144 Start a S/390 channel program. When the interrupt arrives, the 2145 IRQ handler is called, either immediately, delayed (dev-end missing, 2146 or sense required) or never (no IRQ handler registered). 2147</para> 2148</refsect1> 2149<refsect1> 2150<title>Returns</title> 2151<para> 2152 <constant>0</constant>, if the operation was successful; 2153 -<constant>EBUSY</constant>, if the device is busy, or status pending; 2154 -<constant>EACCES</constant>, if no path specified in <parameter>lpm</parameter> is operational; 2155 -<constant>ENODEV</constant>, if the device is not operational. 2156</para> 2157</refsect1> 2158<refsect1> 2159<title>Context</title> 2160<para> 2161 Interrupts disabled, ccw device lock held 2162</para> 2163</refsect1> 2164</refentry> 2165 2166<refentry id="API-ccw-device-start-timeout"> 2167<refentryinfo> 2168 <title>LINUX</title> 2169 <productname>Kernel Hackers Manual</productname> 2170 <date>July 2017</date> 2171</refentryinfo> 2172<refmeta> 2173 <refentrytitle><phrase>ccw_device_start_timeout</phrase></refentrytitle> 2174 <manvolnum>9</manvolnum> 2175 <refmiscinfo class="version">4.1.27</refmiscinfo> 2176</refmeta> 2177<refnamediv> 2178 <refname>ccw_device_start_timeout</refname> 2179 <refpurpose> 2180 start a s390 channel program with timeout 2181 </refpurpose> 2182</refnamediv> 2183<refsynopsisdiv> 2184 <title>Synopsis</title> 2185 <funcsynopsis><funcprototype> 2186 <funcdef>int <function>ccw_device_start_timeout </function></funcdef> 2187 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2188 <paramdef>struct ccw1 * <parameter>cpa</parameter></paramdef> 2189 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 2190 <paramdef>__u8 <parameter>lpm</parameter></paramdef> 2191 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 2192 <paramdef>int <parameter>expires</parameter></paramdef> 2193 </funcprototype></funcsynopsis> 2194</refsynopsisdiv> 2195<refsect1> 2196 <title>Arguments</title> 2197 <variablelist> 2198 <varlistentry> 2199 <term><parameter>cdev</parameter></term> 2200 <listitem> 2201 <para> 2202 target ccw device 2203 </para> 2204 </listitem> 2205 </varlistentry> 2206 <varlistentry> 2207 <term><parameter>cpa</parameter></term> 2208 <listitem> 2209 <para> 2210 logical start address of channel program 2211 </para> 2212 </listitem> 2213 </varlistentry> 2214 <varlistentry> 2215 <term><parameter>intparm</parameter></term> 2216 <listitem> 2217 <para> 2218 user specific interruption parameter; will be presented back to 2219 <parameter>cdev</parameter>'s interrupt handler. Allows a device driver to associate 2220 the interrupt with a particular I/O request. 2221 </para> 2222 </listitem> 2223 </varlistentry> 2224 <varlistentry> 2225 <term><parameter>lpm</parameter></term> 2226 <listitem> 2227 <para> 2228 defines the channel path to be used for a specific I/O request. A 2229 value of 0 will make cio use the opm. 2230 </para> 2231 </listitem> 2232 </varlistentry> 2233 <varlistentry> 2234 <term><parameter>flags</parameter></term> 2235 <listitem> 2236 <para> 2237 additional flags; defines the action to be performed for I/O 2238 processing. 2239 </para> 2240 </listitem> 2241 </varlistentry> 2242 <varlistentry> 2243 <term><parameter>expires</parameter></term> 2244 <listitem> 2245 <para> 2246 timeout value in jiffies 2247 </para> 2248 </listitem> 2249 </varlistentry> 2250 </variablelist> 2251</refsect1> 2252<refsect1> 2253<title>Description</title> 2254<para> 2255 Start a S/390 channel program. When the interrupt arrives, the 2256 IRQ handler is called, either immediately, delayed (dev-end missing, 2257 or sense required) or never (no IRQ handler registered). 2258 This function notifies the device driver if the channel program has not 2259 completed during the time specified by <parameter>expires</parameter>. If a timeout occurs, the 2260 channel program is terminated via xsch, hsch or csch, and the device's 2261 interrupt handler will be called with an irb containing ERR_PTR(-<constant>ETIMEDOUT</constant>). 2262</para> 2263</refsect1> 2264<refsect1> 2265<title>Returns</title> 2266<para> 2267 <constant>0</constant>, if the operation was successful; 2268 -<constant>EBUSY</constant>, if the device is busy, or status pending; 2269 -<constant>EACCES</constant>, if no path specified in <parameter>lpm</parameter> is operational; 2270 -<constant>ENODEV</constant>, if the device is not operational. 2271</para> 2272</refsect1> 2273<refsect1> 2274<title>Context</title> 2275<para> 2276 Interrupts disabled, ccw device lock held 2277</para> 2278</refsect1> 2279</refentry> 2280 2281<refentry id="API-ccw-device-halt"> 2282<refentryinfo> 2283 <title>LINUX</title> 2284 <productname>Kernel Hackers Manual</productname> 2285 <date>July 2017</date> 2286</refentryinfo> 2287<refmeta> 2288 <refentrytitle><phrase>ccw_device_halt</phrase></refentrytitle> 2289 <manvolnum>9</manvolnum> 2290 <refmiscinfo class="version">4.1.27</refmiscinfo> 2291</refmeta> 2292<refnamediv> 2293 <refname>ccw_device_halt</refname> 2294 <refpurpose> 2295 halt I/O request processing 2296 </refpurpose> 2297</refnamediv> 2298<refsynopsisdiv> 2299 <title>Synopsis</title> 2300 <funcsynopsis><funcprototype> 2301 <funcdef>int <function>ccw_device_halt </function></funcdef> 2302 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2303 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 2304 </funcprototype></funcsynopsis> 2305</refsynopsisdiv> 2306<refsect1> 2307 <title>Arguments</title> 2308 <variablelist> 2309 <varlistentry> 2310 <term><parameter>cdev</parameter></term> 2311 <listitem> 2312 <para> 2313 target ccw device 2314 </para> 2315 </listitem> 2316 </varlistentry> 2317 <varlistentry> 2318 <term><parameter>intparm</parameter></term> 2319 <listitem> 2320 <para> 2321 interruption parameter; value is only used if no I/O is 2322 outstanding, otherwise the intparm associated with the I/O request 2323 is returned 2324 </para> 2325 </listitem> 2326 </varlistentry> 2327 </variablelist> 2328</refsect1> 2329<refsect1> 2330<title>Description</title> 2331<para> 2332 <function>ccw_device_halt</function> calls hsch on <parameter>cdev</parameter>'s subchannel. 2333</para> 2334</refsect1> 2335<refsect1> 2336<title>Returns</title> 2337<para> 2338 <constant>0</constant> on success, 2339 -<constant>ENODEV</constant> on device not operational, 2340 -<constant>EINVAL</constant> on invalid device state, 2341 -<constant>EBUSY</constant> on device busy or interrupt pending. 2342</para> 2343</refsect1> 2344<refsect1> 2345<title>Context</title> 2346<para> 2347 Interrupts disabled, ccw device lock held 2348</para> 2349</refsect1> 2350</refentry> 2351 2352<refentry id="API-ccw-device-resume"> 2353<refentryinfo> 2354 <title>LINUX</title> 2355 <productname>Kernel Hackers Manual</productname> 2356 <date>July 2017</date> 2357</refentryinfo> 2358<refmeta> 2359 <refentrytitle><phrase>ccw_device_resume</phrase></refentrytitle> 2360 <manvolnum>9</manvolnum> 2361 <refmiscinfo class="version">4.1.27</refmiscinfo> 2362</refmeta> 2363<refnamediv> 2364 <refname>ccw_device_resume</refname> 2365 <refpurpose> 2366 resume channel program execution 2367 </refpurpose> 2368</refnamediv> 2369<refsynopsisdiv> 2370 <title>Synopsis</title> 2371 <funcsynopsis><funcprototype> 2372 <funcdef>int <function>ccw_device_resume </function></funcdef> 2373 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2374 </funcprototype></funcsynopsis> 2375</refsynopsisdiv> 2376<refsect1> 2377 <title>Arguments</title> 2378 <variablelist> 2379 <varlistentry> 2380 <term><parameter>cdev</parameter></term> 2381 <listitem> 2382 <para> 2383 target ccw device 2384 </para> 2385 </listitem> 2386 </varlistentry> 2387 </variablelist> 2388</refsect1> 2389<refsect1> 2390<title>Description</title> 2391<para> 2392 <function>ccw_device_resume</function> calls rsch on <parameter>cdev</parameter>'s subchannel. 2393</para> 2394</refsect1> 2395<refsect1> 2396<title>Returns</title> 2397<para> 2398 <constant>0</constant> on success, 2399 -<constant>ENODEV</constant> on device not operational, 2400 -<constant>EINVAL</constant> on invalid device state, 2401 -<constant>EBUSY</constant> on device busy or interrupt pending. 2402</para> 2403</refsect1> 2404<refsect1> 2405<title>Context</title> 2406<para> 2407 Interrupts disabled, ccw device lock held 2408</para> 2409</refsect1> 2410</refentry> 2411 2412<refentry id="API-ccw-device-get-ciw"> 2413<refentryinfo> 2414 <title>LINUX</title> 2415 <productname>Kernel Hackers Manual</productname> 2416 <date>July 2017</date> 2417</refentryinfo> 2418<refmeta> 2419 <refentrytitle><phrase>ccw_device_get_ciw</phrase></refentrytitle> 2420 <manvolnum>9</manvolnum> 2421 <refmiscinfo class="version">4.1.27</refmiscinfo> 2422</refmeta> 2423<refnamediv> 2424 <refname>ccw_device_get_ciw</refname> 2425 <refpurpose> 2426 Search for CIW command in extended sense data. 2427 </refpurpose> 2428</refnamediv> 2429<refsynopsisdiv> 2430 <title>Synopsis</title> 2431 <funcsynopsis><funcprototype> 2432 <funcdef>struct ciw * <function>ccw_device_get_ciw </function></funcdef> 2433 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2434 <paramdef>__u32 <parameter>ct</parameter></paramdef> 2435 </funcprototype></funcsynopsis> 2436</refsynopsisdiv> 2437<refsect1> 2438 <title>Arguments</title> 2439 <variablelist> 2440 <varlistentry> 2441 <term><parameter>cdev</parameter></term> 2442 <listitem> 2443 <para> 2444 ccw device to inspect 2445 </para> 2446 </listitem> 2447 </varlistentry> 2448 <varlistentry> 2449 <term><parameter>ct</parameter></term> 2450 <listitem> 2451 <para> 2452 command type to look for 2453 </para> 2454 </listitem> 2455 </varlistentry> 2456 </variablelist> 2457</refsect1> 2458<refsect1> 2459<title>Description</title> 2460<para> 2461 During SenseID, command information words (CIWs) describing special 2462 commands available to the device may have been stored in the extended 2463 sense data. This function searches for CIWs of a specified command 2464 type in the extended sense data. 2465</para> 2466</refsect1> 2467<refsect1> 2468<title>Returns</title> 2469<para> 2470 <constant>NULL</constant> if no extended sense data has been stored or if no CIW of the 2471 specified command type could be found, 2472 else a pointer to the CIW of the specified command type. 2473</para> 2474</refsect1> 2475</refentry> 2476 2477<refentry id="API-ccw-device-get-path-mask"> 2478<refentryinfo> 2479 <title>LINUX</title> 2480 <productname>Kernel Hackers Manual</productname> 2481 <date>July 2017</date> 2482</refentryinfo> 2483<refmeta> 2484 <refentrytitle><phrase>ccw_device_get_path_mask</phrase></refentrytitle> 2485 <manvolnum>9</manvolnum> 2486 <refmiscinfo class="version">4.1.27</refmiscinfo> 2487</refmeta> 2488<refnamediv> 2489 <refname>ccw_device_get_path_mask</refname> 2490 <refpurpose> 2491 get currently available paths 2492 </refpurpose> 2493</refnamediv> 2494<refsynopsisdiv> 2495 <title>Synopsis</title> 2496 <funcsynopsis><funcprototype> 2497 <funcdef>__u8 <function>ccw_device_get_path_mask </function></funcdef> 2498 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2499 </funcprototype></funcsynopsis> 2500</refsynopsisdiv> 2501<refsect1> 2502 <title>Arguments</title> 2503 <variablelist> 2504 <varlistentry> 2505 <term><parameter>cdev</parameter></term> 2506 <listitem> 2507 <para> 2508 ccw device to be queried 2509 </para> 2510 </listitem> 2511 </varlistentry> 2512 </variablelist> 2513</refsect1> 2514<refsect1> 2515<title>Returns</title> 2516<para> 2517 <constant>0</constant> if no subchannel for the device is available, 2518 else the mask of currently available paths for the ccw device's subchannel. 2519</para> 2520</refsect1> 2521</refentry> 2522 2523<refentry id="API-ccw-device-get-chp-desc"> 2524<refentryinfo> 2525 <title>LINUX</title> 2526 <productname>Kernel Hackers Manual</productname> 2527 <date>July 2017</date> 2528</refentryinfo> 2529<refmeta> 2530 <refentrytitle><phrase>ccw_device_get_chp_desc</phrase></refentrytitle> 2531 <manvolnum>9</manvolnum> 2532 <refmiscinfo class="version">4.1.27</refmiscinfo> 2533</refmeta> 2534<refnamediv> 2535 <refname>ccw_device_get_chp_desc</refname> 2536 <refpurpose> 2537 return newly allocated channel-path descriptor 2538 </refpurpose> 2539</refnamediv> 2540<refsynopsisdiv> 2541 <title>Synopsis</title> 2542 <funcsynopsis><funcprototype> 2543 <funcdef>struct channel_path_desc * <function>ccw_device_get_chp_desc </function></funcdef> 2544 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2545 <paramdef>int <parameter>chp_idx</parameter></paramdef> 2546 </funcprototype></funcsynopsis> 2547</refsynopsisdiv> 2548<refsect1> 2549 <title>Arguments</title> 2550 <variablelist> 2551 <varlistentry> 2552 <term><parameter>cdev</parameter></term> 2553 <listitem> 2554 <para> 2555 device to obtain the descriptor for 2556 </para> 2557 </listitem> 2558 </varlistentry> 2559 <varlistentry> 2560 <term><parameter>chp_idx</parameter></term> 2561 <listitem> 2562 <para> 2563 index of the channel path 2564 </para> 2565 </listitem> 2566 </varlistentry> 2567 </variablelist> 2568</refsect1> 2569<refsect1> 2570<title>Description</title> 2571<para> 2572 On success return a newly allocated copy of the channel-path description 2573 data associated with the given channel path. Return <constant>NULL</constant> on error. 2574</para> 2575</refsect1> 2576</refentry> 2577 2578<refentry id="API-ccw-device-get-id"> 2579<refentryinfo> 2580 <title>LINUX</title> 2581 <productname>Kernel Hackers Manual</productname> 2582 <date>July 2017</date> 2583</refentryinfo> 2584<refmeta> 2585 <refentrytitle><phrase>ccw_device_get_id</phrase></refentrytitle> 2586 <manvolnum>9</manvolnum> 2587 <refmiscinfo class="version">4.1.27</refmiscinfo> 2588</refmeta> 2589<refnamediv> 2590 <refname>ccw_device_get_id</refname> 2591 <refpurpose> 2592 obtain a ccw device id 2593 </refpurpose> 2594</refnamediv> 2595<refsynopsisdiv> 2596 <title>Synopsis</title> 2597 <funcsynopsis><funcprototype> 2598 <funcdef>void <function>ccw_device_get_id </function></funcdef> 2599 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2600 <paramdef>struct ccw_dev_id * <parameter>dev_id</parameter></paramdef> 2601 </funcprototype></funcsynopsis> 2602</refsynopsisdiv> 2603<refsect1> 2604 <title>Arguments</title> 2605 <variablelist> 2606 <varlistentry> 2607 <term><parameter>cdev</parameter></term> 2608 <listitem> 2609 <para> 2610 device to obtain the id for 2611 </para> 2612 </listitem> 2613 </varlistentry> 2614 <varlistentry> 2615 <term><parameter>dev_id</parameter></term> 2616 <listitem> 2617 <para> 2618 where to fill in the values 2619 </para> 2620 </listitem> 2621 </varlistentry> 2622 </variablelist> 2623</refsect1> 2624</refentry> 2625 2626<refentry id="API-ccw-device-tm-start-key"> 2627<refentryinfo> 2628 <title>LINUX</title> 2629 <productname>Kernel Hackers Manual</productname> 2630 <date>July 2017</date> 2631</refentryinfo> 2632<refmeta> 2633 <refentrytitle><phrase>ccw_device_tm_start_key</phrase></refentrytitle> 2634 <manvolnum>9</manvolnum> 2635 <refmiscinfo class="version">4.1.27</refmiscinfo> 2636</refmeta> 2637<refnamediv> 2638 <refname>ccw_device_tm_start_key</refname> 2639 <refpurpose> 2640 perform start function 2641 </refpurpose> 2642</refnamediv> 2643<refsynopsisdiv> 2644 <title>Synopsis</title> 2645 <funcsynopsis><funcprototype> 2646 <funcdef>int <function>ccw_device_tm_start_key </function></funcdef> 2647 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2648 <paramdef>struct tcw * <parameter>tcw</parameter></paramdef> 2649 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 2650 <paramdef>u8 <parameter>lpm</parameter></paramdef> 2651 <paramdef>u8 <parameter>key</parameter></paramdef> 2652 </funcprototype></funcsynopsis> 2653</refsynopsisdiv> 2654<refsect1> 2655 <title>Arguments</title> 2656 <variablelist> 2657 <varlistentry> 2658 <term><parameter>cdev</parameter></term> 2659 <listitem> 2660 <para> 2661 ccw device on which to perform the start function 2662 </para> 2663 </listitem> 2664 </varlistentry> 2665 <varlistentry> 2666 <term><parameter>tcw</parameter></term> 2667 <listitem> 2668 <para> 2669 transport-command word to be started 2670 </para> 2671 </listitem> 2672 </varlistentry> 2673 <varlistentry> 2674 <term><parameter>intparm</parameter></term> 2675 <listitem> 2676 <para> 2677 user defined parameter to be passed to the interrupt handler 2678 </para> 2679 </listitem> 2680 </varlistentry> 2681 <varlistentry> 2682 <term><parameter>lpm</parameter></term> 2683 <listitem> 2684 <para> 2685 mask of paths to use 2686 </para> 2687 </listitem> 2688 </varlistentry> 2689 <varlistentry> 2690 <term><parameter>key</parameter></term> 2691 <listitem> 2692 <para> 2693 storage key to use for storage access 2694 </para> 2695 </listitem> 2696 </varlistentry> 2697 </variablelist> 2698</refsect1> 2699<refsect1> 2700<title>Description</title> 2701<para> 2702 Start the tcw on the given ccw device. Return zero on success, non-zero 2703 otherwise. 2704</para> 2705</refsect1> 2706</refentry> 2707 2708<refentry id="API-ccw-device-tm-start-timeout-key"> 2709<refentryinfo> 2710 <title>LINUX</title> 2711 <productname>Kernel Hackers Manual</productname> 2712 <date>July 2017</date> 2713</refentryinfo> 2714<refmeta> 2715 <refentrytitle><phrase>ccw_device_tm_start_timeout_key</phrase></refentrytitle> 2716 <manvolnum>9</manvolnum> 2717 <refmiscinfo class="version">4.1.27</refmiscinfo> 2718</refmeta> 2719<refnamediv> 2720 <refname>ccw_device_tm_start_timeout_key</refname> 2721 <refpurpose> 2722 perform start function 2723 </refpurpose> 2724</refnamediv> 2725<refsynopsisdiv> 2726 <title>Synopsis</title> 2727 <funcsynopsis><funcprototype> 2728 <funcdef>int <function>ccw_device_tm_start_timeout_key </function></funcdef> 2729 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2730 <paramdef>struct tcw * <parameter>tcw</parameter></paramdef> 2731 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 2732 <paramdef>u8 <parameter>lpm</parameter></paramdef> 2733 <paramdef>u8 <parameter>key</parameter></paramdef> 2734 <paramdef>int <parameter>expires</parameter></paramdef> 2735 </funcprototype></funcsynopsis> 2736</refsynopsisdiv> 2737<refsect1> 2738 <title>Arguments</title> 2739 <variablelist> 2740 <varlistentry> 2741 <term><parameter>cdev</parameter></term> 2742 <listitem> 2743 <para> 2744 ccw device on which to perform the start function 2745 </para> 2746 </listitem> 2747 </varlistentry> 2748 <varlistentry> 2749 <term><parameter>tcw</parameter></term> 2750 <listitem> 2751 <para> 2752 transport-command word to be started 2753 </para> 2754 </listitem> 2755 </varlistentry> 2756 <varlistentry> 2757 <term><parameter>intparm</parameter></term> 2758 <listitem> 2759 <para> 2760 user defined parameter to be passed to the interrupt handler 2761 </para> 2762 </listitem> 2763 </varlistentry> 2764 <varlistentry> 2765 <term><parameter>lpm</parameter></term> 2766 <listitem> 2767 <para> 2768 mask of paths to use 2769 </para> 2770 </listitem> 2771 </varlistentry> 2772 <varlistentry> 2773 <term><parameter>key</parameter></term> 2774 <listitem> 2775 <para> 2776 storage key to use for storage access 2777 </para> 2778 </listitem> 2779 </varlistentry> 2780 <varlistentry> 2781 <term><parameter>expires</parameter></term> 2782 <listitem> 2783 <para> 2784 time span in jiffies after which to abort request 2785 </para> 2786 </listitem> 2787 </varlistentry> 2788 </variablelist> 2789</refsect1> 2790<refsect1> 2791<title>Description</title> 2792<para> 2793 Start the tcw on the given ccw device. Return zero on success, non-zero 2794 otherwise. 2795</para> 2796</refsect1> 2797</refentry> 2798 2799<refentry id="API-ccw-device-tm-start"> 2800<refentryinfo> 2801 <title>LINUX</title> 2802 <productname>Kernel Hackers Manual</productname> 2803 <date>July 2017</date> 2804</refentryinfo> 2805<refmeta> 2806 <refentrytitle><phrase>ccw_device_tm_start</phrase></refentrytitle> 2807 <manvolnum>9</manvolnum> 2808 <refmiscinfo class="version">4.1.27</refmiscinfo> 2809</refmeta> 2810<refnamediv> 2811 <refname>ccw_device_tm_start</refname> 2812 <refpurpose> 2813 perform start function 2814 </refpurpose> 2815</refnamediv> 2816<refsynopsisdiv> 2817 <title>Synopsis</title> 2818 <funcsynopsis><funcprototype> 2819 <funcdef>int <function>ccw_device_tm_start </function></funcdef> 2820 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2821 <paramdef>struct tcw * <parameter>tcw</parameter></paramdef> 2822 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 2823 <paramdef>u8 <parameter>lpm</parameter></paramdef> 2824 </funcprototype></funcsynopsis> 2825</refsynopsisdiv> 2826<refsect1> 2827 <title>Arguments</title> 2828 <variablelist> 2829 <varlistentry> 2830 <term><parameter>cdev</parameter></term> 2831 <listitem> 2832 <para> 2833 ccw device on which to perform the start function 2834 </para> 2835 </listitem> 2836 </varlistentry> 2837 <varlistentry> 2838 <term><parameter>tcw</parameter></term> 2839 <listitem> 2840 <para> 2841 transport-command word to be started 2842 </para> 2843 </listitem> 2844 </varlistentry> 2845 <varlistentry> 2846 <term><parameter>intparm</parameter></term> 2847 <listitem> 2848 <para> 2849 user defined parameter to be passed to the interrupt handler 2850 </para> 2851 </listitem> 2852 </varlistentry> 2853 <varlistentry> 2854 <term><parameter>lpm</parameter></term> 2855 <listitem> 2856 <para> 2857 mask of paths to use 2858 </para> 2859 </listitem> 2860 </varlistentry> 2861 </variablelist> 2862</refsect1> 2863<refsect1> 2864<title>Description</title> 2865<para> 2866 Start the tcw on the given ccw device. Return zero on success, non-zero 2867 otherwise. 2868</para> 2869</refsect1> 2870</refentry> 2871 2872<refentry id="API-ccw-device-tm-start-timeout"> 2873<refentryinfo> 2874 <title>LINUX</title> 2875 <productname>Kernel Hackers Manual</productname> 2876 <date>July 2017</date> 2877</refentryinfo> 2878<refmeta> 2879 <refentrytitle><phrase>ccw_device_tm_start_timeout</phrase></refentrytitle> 2880 <manvolnum>9</manvolnum> 2881 <refmiscinfo class="version">4.1.27</refmiscinfo> 2882</refmeta> 2883<refnamediv> 2884 <refname>ccw_device_tm_start_timeout</refname> 2885 <refpurpose> 2886 perform start function 2887 </refpurpose> 2888</refnamediv> 2889<refsynopsisdiv> 2890 <title>Synopsis</title> 2891 <funcsynopsis><funcprototype> 2892 <funcdef>int <function>ccw_device_tm_start_timeout </function></funcdef> 2893 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2894 <paramdef>struct tcw * <parameter>tcw</parameter></paramdef> 2895 <paramdef>unsigned long <parameter>intparm</parameter></paramdef> 2896 <paramdef>u8 <parameter>lpm</parameter></paramdef> 2897 <paramdef>int <parameter>expires</parameter></paramdef> 2898 </funcprototype></funcsynopsis> 2899</refsynopsisdiv> 2900<refsect1> 2901 <title>Arguments</title> 2902 <variablelist> 2903 <varlistentry> 2904 <term><parameter>cdev</parameter></term> 2905 <listitem> 2906 <para> 2907 ccw device on which to perform the start function 2908 </para> 2909 </listitem> 2910 </varlistentry> 2911 <varlistentry> 2912 <term><parameter>tcw</parameter></term> 2913 <listitem> 2914 <para> 2915 transport-command word to be started 2916 </para> 2917 </listitem> 2918 </varlistentry> 2919 <varlistentry> 2920 <term><parameter>intparm</parameter></term> 2921 <listitem> 2922 <para> 2923 user defined parameter to be passed to the interrupt handler 2924 </para> 2925 </listitem> 2926 </varlistentry> 2927 <varlistentry> 2928 <term><parameter>lpm</parameter></term> 2929 <listitem> 2930 <para> 2931 mask of paths to use 2932 </para> 2933 </listitem> 2934 </varlistentry> 2935 <varlistentry> 2936 <term><parameter>expires</parameter></term> 2937 <listitem> 2938 <para> 2939 time span in jiffies after which to abort request 2940 </para> 2941 </listitem> 2942 </varlistentry> 2943 </variablelist> 2944</refsect1> 2945<refsect1> 2946<title>Description</title> 2947<para> 2948 Start the tcw on the given ccw device. Return zero on success, non-zero 2949 otherwise. 2950</para> 2951</refsect1> 2952</refentry> 2953 2954<refentry id="API-ccw-device-get-mdc"> 2955<refentryinfo> 2956 <title>LINUX</title> 2957 <productname>Kernel Hackers Manual</productname> 2958 <date>July 2017</date> 2959</refentryinfo> 2960<refmeta> 2961 <refentrytitle><phrase>ccw_device_get_mdc</phrase></refentrytitle> 2962 <manvolnum>9</manvolnum> 2963 <refmiscinfo class="version">4.1.27</refmiscinfo> 2964</refmeta> 2965<refnamediv> 2966 <refname>ccw_device_get_mdc</refname> 2967 <refpurpose> 2968 accumulate max data count 2969 </refpurpose> 2970</refnamediv> 2971<refsynopsisdiv> 2972 <title>Synopsis</title> 2973 <funcsynopsis><funcprototype> 2974 <funcdef>int <function>ccw_device_get_mdc </function></funcdef> 2975 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 2976 <paramdef>u8 <parameter>mask</parameter></paramdef> 2977 </funcprototype></funcsynopsis> 2978</refsynopsisdiv> 2979<refsect1> 2980 <title>Arguments</title> 2981 <variablelist> 2982 <varlistentry> 2983 <term><parameter>cdev</parameter></term> 2984 <listitem> 2985 <para> 2986 ccw device for which the max data count is accumulated 2987 </para> 2988 </listitem> 2989 </varlistentry> 2990 <varlistentry> 2991 <term><parameter>mask</parameter></term> 2992 <listitem> 2993 <para> 2994 mask of paths to use 2995 </para> 2996 </listitem> 2997 </varlistentry> 2998 </variablelist> 2999</refsect1> 3000<refsect1> 3001<title>Description</title> 3002<para> 3003 Return the number of 64K-bytes blocks all paths at least support 3004 for a transport command. Return values <= 0 indicate failures. 3005</para> 3006</refsect1> 3007</refentry> 3008 3009<refentry id="API-ccw-device-tm-intrg"> 3010<refentryinfo> 3011 <title>LINUX</title> 3012 <productname>Kernel Hackers Manual</productname> 3013 <date>July 2017</date> 3014</refentryinfo> 3015<refmeta> 3016 <refentrytitle><phrase>ccw_device_tm_intrg</phrase></refentrytitle> 3017 <manvolnum>9</manvolnum> 3018 <refmiscinfo class="version">4.1.27</refmiscinfo> 3019</refmeta> 3020<refnamediv> 3021 <refname>ccw_device_tm_intrg</refname> 3022 <refpurpose> 3023 perform interrogate function 3024 </refpurpose> 3025</refnamediv> 3026<refsynopsisdiv> 3027 <title>Synopsis</title> 3028 <funcsynopsis><funcprototype> 3029 <funcdef>int <function>ccw_device_tm_intrg </function></funcdef> 3030 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 3031 </funcprototype></funcsynopsis> 3032</refsynopsisdiv> 3033<refsect1> 3034 <title>Arguments</title> 3035 <variablelist> 3036 <varlistentry> 3037 <term><parameter>cdev</parameter></term> 3038 <listitem> 3039 <para> 3040 ccw device on which to perform the interrogate function 3041 </para> 3042 </listitem> 3043 </varlistentry> 3044 </variablelist> 3045</refsect1> 3046<refsect1> 3047<title>Description</title> 3048<para> 3049 Perform an interrogate function on the given ccw device. Return zero on 3050 success, non-zero otherwise. 3051</para> 3052</refsect1> 3053</refentry> 3054 3055<refentry id="API-ccw-device-get-schid"> 3056<refentryinfo> 3057 <title>LINUX</title> 3058 <productname>Kernel Hackers Manual</productname> 3059 <date>July 2017</date> 3060</refentryinfo> 3061<refmeta> 3062 <refentrytitle><phrase>ccw_device_get_schid</phrase></refentrytitle> 3063 <manvolnum>9</manvolnum> 3064 <refmiscinfo class="version">4.1.27</refmiscinfo> 3065</refmeta> 3066<refnamediv> 3067 <refname>ccw_device_get_schid</refname> 3068 <refpurpose> 3069 obtain a subchannel id 3070 </refpurpose> 3071</refnamediv> 3072<refsynopsisdiv> 3073 <title>Synopsis</title> 3074 <funcsynopsis><funcprototype> 3075 <funcdef>void <function>ccw_device_get_schid </function></funcdef> 3076 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 3077 <paramdef>struct subchannel_id * <parameter>schid</parameter></paramdef> 3078 </funcprototype></funcsynopsis> 3079</refsynopsisdiv> 3080<refsect1> 3081 <title>Arguments</title> 3082 <variablelist> 3083 <varlistentry> 3084 <term><parameter>cdev</parameter></term> 3085 <listitem> 3086 <para> 3087 device to obtain the id for 3088 </para> 3089 </listitem> 3090 </varlistentry> 3091 <varlistentry> 3092 <term><parameter>schid</parameter></term> 3093 <listitem> 3094 <para> 3095 where to fill in the values 3096 </para> 3097 </listitem> 3098 </varlistentry> 3099 </variablelist> 3100</refsect1> 3101</refentry> 3102 3103 </sect1> 3104 <sect1 id="cmf"> 3105 <title>The channel-measurement facility</title> 3106 <para> 3107 The channel-measurement facility provides a means to collect 3108 measurement data which is made available by the channel subsystem 3109 for each channel attached device. 3110 </para> 3111<!-- arch/s390/include/asm/cmb.h --> 3112<refentry> 3113 <refnamediv> 3114 <refname> 3115 .//arch/s390/include/asm/cmb.h 3116 </refname> 3117 <refpurpose> 3118 Document generation inconsistency 3119 </refpurpose> 3120 </refnamediv> 3121 <refsect1> 3122 <title> 3123 Oops 3124 </title> 3125 <warning> 3126 <para> 3127 The template for this document tried to insert 3128 the structured comment from the file 3129 <filename>.//arch/s390/include/asm/cmb.h</filename> at this point, 3130 but none was found. 3131 This dummy section is inserted to allow 3132 generation to continue. 3133 </para> 3134 </warning> 3135 </refsect1> 3136</refentry> 3137<!-- drivers/s390/cio/cmf.c --> 3138<refentry id="API-enable-cmf"> 3139<refentryinfo> 3140 <title>LINUX</title> 3141 <productname>Kernel Hackers Manual</productname> 3142 <date>July 2017</date> 3143</refentryinfo> 3144<refmeta> 3145 <refentrytitle><phrase>enable_cmf</phrase></refentrytitle> 3146 <manvolnum>9</manvolnum> 3147 <refmiscinfo class="version">4.1.27</refmiscinfo> 3148</refmeta> 3149<refnamediv> 3150 <refname>enable_cmf</refname> 3151 <refpurpose> 3152 switch on the channel measurement for a specific device 3153 </refpurpose> 3154</refnamediv> 3155<refsynopsisdiv> 3156 <title>Synopsis</title> 3157 <funcsynopsis><funcprototype> 3158 <funcdef>int <function>enable_cmf </function></funcdef> 3159 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 3160 </funcprototype></funcsynopsis> 3161</refsynopsisdiv> 3162<refsect1> 3163 <title>Arguments</title> 3164 <variablelist> 3165 <varlistentry> 3166 <term><parameter>cdev</parameter></term> 3167 <listitem> 3168 <para> 3169 The ccw device to be enabled 3170 </para> 3171 </listitem> 3172 </varlistentry> 3173 </variablelist> 3174</refsect1> 3175<refsect1> 3176<title>Description</title> 3177<para> 3178 Returns <constant>0</constant> for success or a negative error value. 3179</para> 3180</refsect1> 3181<refsect1> 3182<title>Context</title> 3183<para> 3184 non-atomic 3185</para> 3186</refsect1> 3187</refentry> 3188 3189<refentry id="API-disable-cmf"> 3190<refentryinfo> 3191 <title>LINUX</title> 3192 <productname>Kernel Hackers Manual</productname> 3193 <date>July 2017</date> 3194</refentryinfo> 3195<refmeta> 3196 <refentrytitle><phrase>disable_cmf</phrase></refentrytitle> 3197 <manvolnum>9</manvolnum> 3198 <refmiscinfo class="version">4.1.27</refmiscinfo> 3199</refmeta> 3200<refnamediv> 3201 <refname>disable_cmf</refname> 3202 <refpurpose> 3203 switch off the channel measurement for a specific device 3204 </refpurpose> 3205</refnamediv> 3206<refsynopsisdiv> 3207 <title>Synopsis</title> 3208 <funcsynopsis><funcprototype> 3209 <funcdef>int <function>disable_cmf </function></funcdef> 3210 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 3211 </funcprototype></funcsynopsis> 3212</refsynopsisdiv> 3213<refsect1> 3214 <title>Arguments</title> 3215 <variablelist> 3216 <varlistentry> 3217 <term><parameter>cdev</parameter></term> 3218 <listitem> 3219 <para> 3220 The ccw device to be disabled 3221 </para> 3222 </listitem> 3223 </varlistentry> 3224 </variablelist> 3225</refsect1> 3226<refsect1> 3227<title>Description</title> 3228<para> 3229 Returns <constant>0</constant> for success or a negative error value. 3230</para> 3231</refsect1> 3232<refsect1> 3233<title>Context</title> 3234<para> 3235 non-atomic 3236</para> 3237</refsect1> 3238</refentry> 3239 3240<refentry id="API-cmf-read"> 3241<refentryinfo> 3242 <title>LINUX</title> 3243 <productname>Kernel Hackers Manual</productname> 3244 <date>July 2017</date> 3245</refentryinfo> 3246<refmeta> 3247 <refentrytitle><phrase>cmf_read</phrase></refentrytitle> 3248 <manvolnum>9</manvolnum> 3249 <refmiscinfo class="version">4.1.27</refmiscinfo> 3250</refmeta> 3251<refnamediv> 3252 <refname>cmf_read</refname> 3253 <refpurpose> 3254 read one value from the current channel measurement block 3255 </refpurpose> 3256</refnamediv> 3257<refsynopsisdiv> 3258 <title>Synopsis</title> 3259 <funcsynopsis><funcprototype> 3260 <funcdef>u64 <function>cmf_read </function></funcdef> 3261 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 3262 <paramdef>int <parameter>index</parameter></paramdef> 3263 </funcprototype></funcsynopsis> 3264</refsynopsisdiv> 3265<refsect1> 3266 <title>Arguments</title> 3267 <variablelist> 3268 <varlistentry> 3269 <term><parameter>cdev</parameter></term> 3270 <listitem> 3271 <para> 3272 the channel to be read 3273 </para> 3274 </listitem> 3275 </varlistentry> 3276 <varlistentry> 3277 <term><parameter>index</parameter></term> 3278 <listitem> 3279 <para> 3280 the index of the value to be read 3281 </para> 3282 </listitem> 3283 </varlistentry> 3284 </variablelist> 3285</refsect1> 3286<refsect1> 3287<title>Description</title> 3288<para> 3289 Returns the value read or <constant>0</constant> if the value cannot be read. 3290</para> 3291</refsect1> 3292<refsect1> 3293<title>Context</title> 3294<para> 3295 any 3296</para> 3297</refsect1> 3298</refentry> 3299 3300<refentry id="API-cmf-readall"> 3301<refentryinfo> 3302 <title>LINUX</title> 3303 <productname>Kernel Hackers Manual</productname> 3304 <date>July 2017</date> 3305</refentryinfo> 3306<refmeta> 3307 <refentrytitle><phrase>cmf_readall</phrase></refentrytitle> 3308 <manvolnum>9</manvolnum> 3309 <refmiscinfo class="version">4.1.27</refmiscinfo> 3310</refmeta> 3311<refnamediv> 3312 <refname>cmf_readall</refname> 3313 <refpurpose> 3314 read the current channel measurement block 3315 </refpurpose> 3316</refnamediv> 3317<refsynopsisdiv> 3318 <title>Synopsis</title> 3319 <funcsynopsis><funcprototype> 3320 <funcdef>int <function>cmf_readall </function></funcdef> 3321 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 3322 <paramdef>struct cmbdata * <parameter>data</parameter></paramdef> 3323 </funcprototype></funcsynopsis> 3324</refsynopsisdiv> 3325<refsect1> 3326 <title>Arguments</title> 3327 <variablelist> 3328 <varlistentry> 3329 <term><parameter>cdev</parameter></term> 3330 <listitem> 3331 <para> 3332 the channel to be read 3333 </para> 3334 </listitem> 3335 </varlistentry> 3336 <varlistentry> 3337 <term><parameter>data</parameter></term> 3338 <listitem> 3339 <para> 3340 a pointer to a data block that will be filled 3341 </para> 3342 </listitem> 3343 </varlistentry> 3344 </variablelist> 3345</refsect1> 3346<refsect1> 3347<title>Description</title> 3348<para> 3349 Returns <constant>0</constant> on success, a negative error value otherwise. 3350</para> 3351</refsect1> 3352<refsect1> 3353<title>Context</title> 3354<para> 3355 any 3356</para> 3357</refsect1> 3358</refentry> 3359 3360 </sect1> 3361 </chapter> 3362 3363 <chapter id="ccwgroup"> 3364 <title>The ccwgroup bus</title> 3365 <para> 3366 The ccwgroup bus only contains artificial devices, created by the user. 3367 Many networking devices (e.g. qeth) are in fact composed of several 3368 ccw devices (like read, write and data channel for qeth). The 3369 ccwgroup bus provides a mechanism to create a meta-device which 3370 contains those ccw devices as slave devices and can be associated 3371 with the netdevice. 3372 </para> 3373 <sect1 id="ccwgroupdevices"> 3374 <title>ccw group devices</title> 3375<!-- arch/s390/include/asm/ccwgroup.h --> 3376<refentry id="API-struct-ccwgroup-device"> 3377<refentryinfo> 3378 <title>LINUX</title> 3379 <productname>Kernel Hackers Manual</productname> 3380 <date>July 2017</date> 3381</refentryinfo> 3382<refmeta> 3383 <refentrytitle><phrase>struct ccwgroup_device</phrase></refentrytitle> 3384 <manvolnum>9</manvolnum> 3385 <refmiscinfo class="version">4.1.27</refmiscinfo> 3386</refmeta> 3387<refnamediv> 3388 <refname>struct ccwgroup_device</refname> 3389 <refpurpose> 3390 ccw group device 3391 </refpurpose> 3392</refnamediv> 3393<refsynopsisdiv> 3394 <title>Synopsis</title> 3395 <programlisting> 3396struct ccwgroup_device { 3397 enum state; 3398 unsigned int count; 3399 struct device dev; 3400 struct work_struct ungroup_work; 3401 struct ccw_device * cdev[0]; 3402}; </programlisting> 3403</refsynopsisdiv> 3404 <refsect1> 3405 <title>Members</title> 3406 <variablelist> 3407 <varlistentry> <term>state</term> 3408 <listitem><para> 3409online/offline state 3410 </para></listitem> 3411 </varlistentry> 3412 <varlistentry> <term>count</term> 3413 <listitem><para> 3414number of attached slave devices 3415 </para></listitem> 3416 </varlistentry> 3417 <varlistentry> <term>dev</term> 3418 <listitem><para> 3419embedded device structure 3420 </para></listitem> 3421 </varlistentry> 3422 <varlistentry> <term>ungroup_work</term> 3423 <listitem><para> 3424work to be done when a ccwgroup notifier has action 3425type <constant>BUS_NOTIFY_UNBIND_DRIVER</constant> 3426 </para></listitem> 3427 </varlistentry> 3428 <varlistentry> <term>cdev[0]</term> 3429 <listitem><para> 3430variable number of slave devices, allocated as needed 3431 </para></listitem> 3432 </varlistentry> 3433 </variablelist> 3434 </refsect1> 3435</refentry> 3436 3437<refentry id="API-struct-ccwgroup-driver"> 3438<refentryinfo> 3439 <title>LINUX</title> 3440 <productname>Kernel Hackers Manual</productname> 3441 <date>July 2017</date> 3442</refentryinfo> 3443<refmeta> 3444 <refentrytitle><phrase>struct ccwgroup_driver</phrase></refentrytitle> 3445 <manvolnum>9</manvolnum> 3446 <refmiscinfo class="version">4.1.27</refmiscinfo> 3447</refmeta> 3448<refnamediv> 3449 <refname>struct ccwgroup_driver</refname> 3450 <refpurpose> 3451 driver for ccw group devices 3452 </refpurpose> 3453</refnamediv> 3454<refsynopsisdiv> 3455 <title>Synopsis</title> 3456 <programlisting> 3457struct ccwgroup_driver { 3458 int (* setup) (struct ccwgroup_device *); 3459 void (* remove) (struct ccwgroup_device *); 3460 int (* set_online) (struct ccwgroup_device *); 3461 int (* set_offline) (struct ccwgroup_device *); 3462 void (* shutdown) (struct ccwgroup_device *); 3463 int (* prepare) (struct ccwgroup_device *); 3464 void (* complete) (struct ccwgroup_device *); 3465 int (* freeze) (struct ccwgroup_device *); 3466 int (* thaw) (struct ccwgroup_device *); 3467 int (* restore) (struct ccwgroup_device *); 3468 struct device_driver driver; 3469}; </programlisting> 3470</refsynopsisdiv> 3471 <refsect1> 3472 <title>Members</title> 3473 <variablelist> 3474 <varlistentry> <term>setup</term> 3475 <listitem><para> 3476 function called during device creation to setup the device 3477 </para></listitem> 3478 </varlistentry> 3479 <varlistentry> <term>remove</term> 3480 <listitem><para> 3481 function called on remove 3482 </para></listitem> 3483 </varlistentry> 3484 <varlistentry> <term>set_online</term> 3485 <listitem><para> 3486 function called when device is set online 3487 </para></listitem> 3488 </varlistentry> 3489 <varlistentry> <term>set_offline</term> 3490 <listitem><para> 3491 function called when device is set offline 3492 </para></listitem> 3493 </varlistentry> 3494 <varlistentry> <term>shutdown</term> 3495 <listitem><para> 3496 function called when device is shut down 3497 </para></listitem> 3498 </varlistentry> 3499 <varlistentry> <term>prepare</term> 3500 <listitem><para> 3501 prepare for pm state transition 3502 </para></listitem> 3503 </varlistentry> 3504 <varlistentry> <term>complete</term> 3505 <listitem><para> 3506 undo work done in <parameter>prepare</parameter> 3507 </para></listitem> 3508 </varlistentry> 3509 <varlistentry> <term>freeze</term> 3510 <listitem><para> 3511 callback for freezing during hibernation snapshotting 3512 </para></listitem> 3513 </varlistentry> 3514 <varlistentry> <term>thaw</term> 3515 <listitem><para> 3516 undo work done in <parameter>freeze</parameter> 3517 </para></listitem> 3518 </varlistentry> 3519 <varlistentry> <term>restore</term> 3520 <listitem><para> 3521 callback for restoring after hibernation 3522 </para></listitem> 3523 </varlistentry> 3524 <varlistentry> <term>driver</term> 3525 <listitem><para> 3526 embedded driver structure 3527 </para></listitem> 3528 </varlistentry> 3529 </variablelist> 3530 </refsect1> 3531</refentry> 3532 3533<!-- drivers/s390/cio/ccwgroup.c --> 3534<refentry id="API-ccwgroup-set-online"> 3535<refentryinfo> 3536 <title>LINUX</title> 3537 <productname>Kernel Hackers Manual</productname> 3538 <date>July 2017</date> 3539</refentryinfo> 3540<refmeta> 3541 <refentrytitle><phrase>ccwgroup_set_online</phrase></refentrytitle> 3542 <manvolnum>9</manvolnum> 3543 <refmiscinfo class="version">4.1.27</refmiscinfo> 3544</refmeta> 3545<refnamediv> 3546 <refname>ccwgroup_set_online</refname> 3547 <refpurpose> 3548 enable a ccwgroup device 3549 </refpurpose> 3550</refnamediv> 3551<refsynopsisdiv> 3552 <title>Synopsis</title> 3553 <funcsynopsis><funcprototype> 3554 <funcdef>int <function>ccwgroup_set_online </function></funcdef> 3555 <paramdef>struct ccwgroup_device * <parameter>gdev</parameter></paramdef> 3556 </funcprototype></funcsynopsis> 3557</refsynopsisdiv> 3558<refsect1> 3559 <title>Arguments</title> 3560 <variablelist> 3561 <varlistentry> 3562 <term><parameter>gdev</parameter></term> 3563 <listitem> 3564 <para> 3565 target ccwgroup device 3566 </para> 3567 </listitem> 3568 </varlistentry> 3569 </variablelist> 3570</refsect1> 3571<refsect1> 3572<title>Description</title> 3573<para> 3574 This function attempts to put the ccwgroup device into the online state. 3575</para> 3576</refsect1> 3577<refsect1> 3578<title>Returns</title> 3579<para> 3580 <constant>0</constant> on success and a negative error value on failure. 3581</para> 3582</refsect1> 3583</refentry> 3584 3585<refentry id="API-ccwgroup-set-offline"> 3586<refentryinfo> 3587 <title>LINUX</title> 3588 <productname>Kernel Hackers Manual</productname> 3589 <date>July 2017</date> 3590</refentryinfo> 3591<refmeta> 3592 <refentrytitle><phrase>ccwgroup_set_offline</phrase></refentrytitle> 3593 <manvolnum>9</manvolnum> 3594 <refmiscinfo class="version">4.1.27</refmiscinfo> 3595</refmeta> 3596<refnamediv> 3597 <refname>ccwgroup_set_offline</refname> 3598 <refpurpose> 3599 disable a ccwgroup device 3600 </refpurpose> 3601</refnamediv> 3602<refsynopsisdiv> 3603 <title>Synopsis</title> 3604 <funcsynopsis><funcprototype> 3605 <funcdef>int <function>ccwgroup_set_offline </function></funcdef> 3606 <paramdef>struct ccwgroup_device * <parameter>gdev</parameter></paramdef> 3607 </funcprototype></funcsynopsis> 3608</refsynopsisdiv> 3609<refsect1> 3610 <title>Arguments</title> 3611 <variablelist> 3612 <varlistentry> 3613 <term><parameter>gdev</parameter></term> 3614 <listitem> 3615 <para> 3616 target ccwgroup device 3617 </para> 3618 </listitem> 3619 </varlistentry> 3620 </variablelist> 3621</refsect1> 3622<refsect1> 3623<title>Description</title> 3624<para> 3625 This function attempts to put the ccwgroup device into the offline state. 3626</para> 3627</refsect1> 3628<refsect1> 3629<title>Returns</title> 3630<para> 3631 <constant>0</constant> on success and a negative error value on failure. 3632</para> 3633</refsect1> 3634</refentry> 3635 3636<refentry id="API-ccwgroup-create-dev"> 3637<refentryinfo> 3638 <title>LINUX</title> 3639 <productname>Kernel Hackers Manual</productname> 3640 <date>July 2017</date> 3641</refentryinfo> 3642<refmeta> 3643 <refentrytitle><phrase>ccwgroup_create_dev</phrase></refentrytitle> 3644 <manvolnum>9</manvolnum> 3645 <refmiscinfo class="version">4.1.27</refmiscinfo> 3646</refmeta> 3647<refnamediv> 3648 <refname>ccwgroup_create_dev</refname> 3649 <refpurpose> 3650 create and register a ccw group device 3651 </refpurpose> 3652</refnamediv> 3653<refsynopsisdiv> 3654 <title>Synopsis</title> 3655 <funcsynopsis><funcprototype> 3656 <funcdef>int <function>ccwgroup_create_dev </function></funcdef> 3657 <paramdef>struct device * <parameter>parent</parameter></paramdef> 3658 <paramdef>struct ccwgroup_driver * <parameter>gdrv</parameter></paramdef> 3659 <paramdef>int <parameter>num_devices</parameter></paramdef> 3660 <paramdef>const char * <parameter>buf</parameter></paramdef> 3661 </funcprototype></funcsynopsis> 3662</refsynopsisdiv> 3663<refsect1> 3664 <title>Arguments</title> 3665 <variablelist> 3666 <varlistentry> 3667 <term><parameter>parent</parameter></term> 3668 <listitem> 3669 <para> 3670 parent device for the new device 3671 </para> 3672 </listitem> 3673 </varlistentry> 3674 <varlistentry> 3675 <term><parameter>gdrv</parameter></term> 3676 <listitem> 3677 <para> 3678 driver for the new group device 3679 </para> 3680 </listitem> 3681 </varlistentry> 3682 <varlistentry> 3683 <term><parameter>num_devices</parameter></term> 3684 <listitem> 3685 <para> 3686 number of slave devices 3687 </para> 3688 </listitem> 3689 </varlistentry> 3690 <varlistentry> 3691 <term><parameter>buf</parameter></term> 3692 <listitem> 3693 <para> 3694 buffer containing comma separated bus ids of slave devices 3695 </para> 3696 </listitem> 3697 </varlistentry> 3698 </variablelist> 3699</refsect1> 3700<refsect1> 3701<title>Description</title> 3702<para> 3703 Create and register a new ccw group device as a child of <parameter>parent</parameter>. Slave 3704 devices are obtained from the list of bus ids given in <parameter>buf</parameter>. 3705</para> 3706</refsect1> 3707<refsect1> 3708<title>Returns</title> 3709<para> 3710 <constant>0</constant> on success and an error code on failure. 3711</para> 3712</refsect1> 3713<refsect1> 3714<title>Context</title> 3715<para> 3716 non-atomic 3717</para> 3718</refsect1> 3719</refentry> 3720 3721<refentry id="API-ccwgroup-driver-register"> 3722<refentryinfo> 3723 <title>LINUX</title> 3724 <productname>Kernel Hackers Manual</productname> 3725 <date>July 2017</date> 3726</refentryinfo> 3727<refmeta> 3728 <refentrytitle><phrase>ccwgroup_driver_register</phrase></refentrytitle> 3729 <manvolnum>9</manvolnum> 3730 <refmiscinfo class="version">4.1.27</refmiscinfo> 3731</refmeta> 3732<refnamediv> 3733 <refname>ccwgroup_driver_register</refname> 3734 <refpurpose> 3735 register a ccw group driver 3736 </refpurpose> 3737</refnamediv> 3738<refsynopsisdiv> 3739 <title>Synopsis</title> 3740 <funcsynopsis><funcprototype> 3741 <funcdef>int <function>ccwgroup_driver_register </function></funcdef> 3742 <paramdef>struct ccwgroup_driver * <parameter>cdriver</parameter></paramdef> 3743 </funcprototype></funcsynopsis> 3744</refsynopsisdiv> 3745<refsect1> 3746 <title>Arguments</title> 3747 <variablelist> 3748 <varlistentry> 3749 <term><parameter>cdriver</parameter></term> 3750 <listitem> 3751 <para> 3752 driver to be registered 3753 </para> 3754 </listitem> 3755 </varlistentry> 3756 </variablelist> 3757</refsect1> 3758<refsect1> 3759<title>Description</title> 3760<para> 3761 This function is mainly a wrapper around <function>driver_register</function>. 3762</para> 3763</refsect1> 3764</refentry> 3765 3766<refentry id="API-ccwgroup-driver-unregister"> 3767<refentryinfo> 3768 <title>LINUX</title> 3769 <productname>Kernel Hackers Manual</productname> 3770 <date>July 2017</date> 3771</refentryinfo> 3772<refmeta> 3773 <refentrytitle><phrase>ccwgroup_driver_unregister</phrase></refentrytitle> 3774 <manvolnum>9</manvolnum> 3775 <refmiscinfo class="version">4.1.27</refmiscinfo> 3776</refmeta> 3777<refnamediv> 3778 <refname>ccwgroup_driver_unregister</refname> 3779 <refpurpose> 3780 deregister a ccw group driver 3781 </refpurpose> 3782</refnamediv> 3783<refsynopsisdiv> 3784 <title>Synopsis</title> 3785 <funcsynopsis><funcprototype> 3786 <funcdef>void <function>ccwgroup_driver_unregister </function></funcdef> 3787 <paramdef>struct ccwgroup_driver * <parameter>cdriver</parameter></paramdef> 3788 </funcprototype></funcsynopsis> 3789</refsynopsisdiv> 3790<refsect1> 3791 <title>Arguments</title> 3792 <variablelist> 3793 <varlistentry> 3794 <term><parameter>cdriver</parameter></term> 3795 <listitem> 3796 <para> 3797 driver to be deregistered 3798 </para> 3799 </listitem> 3800 </varlistentry> 3801 </variablelist> 3802</refsect1> 3803<refsect1> 3804<title>Description</title> 3805<para> 3806 This function is mainly a wrapper around <function>driver_unregister</function>. 3807</para> 3808</refsect1> 3809</refentry> 3810 3811<refentry id="API-ccwgroup-probe-ccwdev"> 3812<refentryinfo> 3813 <title>LINUX</title> 3814 <productname>Kernel Hackers Manual</productname> 3815 <date>July 2017</date> 3816</refentryinfo> 3817<refmeta> 3818 <refentrytitle><phrase>ccwgroup_probe_ccwdev</phrase></refentrytitle> 3819 <manvolnum>9</manvolnum> 3820 <refmiscinfo class="version">4.1.27</refmiscinfo> 3821</refmeta> 3822<refnamediv> 3823 <refname>ccwgroup_probe_ccwdev</refname> 3824 <refpurpose> 3825 probe function for slave devices 3826 </refpurpose> 3827</refnamediv> 3828<refsynopsisdiv> 3829 <title>Synopsis</title> 3830 <funcsynopsis><funcprototype> 3831 <funcdef>int <function>ccwgroup_probe_ccwdev </function></funcdef> 3832 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 3833 </funcprototype></funcsynopsis> 3834</refsynopsisdiv> 3835<refsect1> 3836 <title>Arguments</title> 3837 <variablelist> 3838 <varlistentry> 3839 <term><parameter>cdev</parameter></term> 3840 <listitem> 3841 <para> 3842 ccw device to be probed 3843 </para> 3844 </listitem> 3845 </varlistentry> 3846 </variablelist> 3847</refsect1> 3848<refsect1> 3849<title>Description</title> 3850<para> 3851 This is a dummy probe function for ccw devices that are slave devices in 3852 a ccw group device. 3853</para> 3854</refsect1> 3855<refsect1> 3856<title>Returns</title> 3857<para> 3858 always <constant>0</constant> 3859</para> 3860</refsect1> 3861</refentry> 3862 3863<refentry id="API-ccwgroup-remove-ccwdev"> 3864<refentryinfo> 3865 <title>LINUX</title> 3866 <productname>Kernel Hackers Manual</productname> 3867 <date>July 2017</date> 3868</refentryinfo> 3869<refmeta> 3870 <refentrytitle><phrase>ccwgroup_remove_ccwdev</phrase></refentrytitle> 3871 <manvolnum>9</manvolnum> 3872 <refmiscinfo class="version">4.1.27</refmiscinfo> 3873</refmeta> 3874<refnamediv> 3875 <refname>ccwgroup_remove_ccwdev</refname> 3876 <refpurpose> 3877 remove function for slave devices 3878 </refpurpose> 3879</refnamediv> 3880<refsynopsisdiv> 3881 <title>Synopsis</title> 3882 <funcsynopsis><funcprototype> 3883 <funcdef>void <function>ccwgroup_remove_ccwdev </function></funcdef> 3884 <paramdef>struct ccw_device * <parameter>cdev</parameter></paramdef> 3885 </funcprototype></funcsynopsis> 3886</refsynopsisdiv> 3887<refsect1> 3888 <title>Arguments</title> 3889 <variablelist> 3890 <varlistentry> 3891 <term><parameter>cdev</parameter></term> 3892 <listitem> 3893 <para> 3894 ccw device to be removed 3895 </para> 3896 </listitem> 3897 </varlistentry> 3898 </variablelist> 3899</refsect1> 3900<refsect1> 3901<title>Description</title> 3902<para> 3903 This is a remove function for ccw devices that are slave devices in a ccw 3904 group device. It sets the ccw device offline and also deregisters the 3905 embedding ccw group device. 3906</para> 3907</refsect1> 3908</refentry> 3909 3910 </sect1> 3911 </chapter> 3912 3913 <chapter id="genericinterfaces"> 3914 <title>Generic interfaces</title> 3915 <para> 3916 Some interfaces are available to other drivers that do not necessarily 3917 have anything to do with the busses described above, but still are 3918 indirectly using basic infrastructure in the common I/O layer. 3919 One example is the support for adapter interrupts. 3920 </para> 3921<!-- drivers/s390/cio/airq.c --> 3922<refentry id="API-register-adapter-interrupt"> 3923<refentryinfo> 3924 <title>LINUX</title> 3925 <productname>Kernel Hackers Manual</productname> 3926 <date>July 2017</date> 3927</refentryinfo> 3928<refmeta> 3929 <refentrytitle><phrase>register_adapter_interrupt</phrase></refentrytitle> 3930 <manvolnum>9</manvolnum> 3931 <refmiscinfo class="version">4.1.27</refmiscinfo> 3932</refmeta> 3933<refnamediv> 3934 <refname>register_adapter_interrupt</refname> 3935 <refpurpose> 3936 register adapter interrupt handler 3937 </refpurpose> 3938</refnamediv> 3939<refsynopsisdiv> 3940 <title>Synopsis</title> 3941 <funcsynopsis><funcprototype> 3942 <funcdef>int <function>register_adapter_interrupt </function></funcdef> 3943 <paramdef>struct airq_struct * <parameter>airq</parameter></paramdef> 3944 </funcprototype></funcsynopsis> 3945</refsynopsisdiv> 3946<refsect1> 3947 <title>Arguments</title> 3948 <variablelist> 3949 <varlistentry> 3950 <term><parameter>airq</parameter></term> 3951 <listitem> 3952 <para> 3953 pointer to adapter interrupt descriptor 3954 </para> 3955 </listitem> 3956 </varlistentry> 3957 </variablelist> 3958</refsect1> 3959<refsect1> 3960<title>Description</title> 3961<para> 3962 Returns 0 on success, or -EINVAL. 3963</para> 3964</refsect1> 3965</refentry> 3966 3967<refentry id="API-unregister-adapter-interrupt"> 3968<refentryinfo> 3969 <title>LINUX</title> 3970 <productname>Kernel Hackers Manual</productname> 3971 <date>July 2017</date> 3972</refentryinfo> 3973<refmeta> 3974 <refentrytitle><phrase>unregister_adapter_interrupt</phrase></refentrytitle> 3975 <manvolnum>9</manvolnum> 3976 <refmiscinfo class="version">4.1.27</refmiscinfo> 3977</refmeta> 3978<refnamediv> 3979 <refname>unregister_adapter_interrupt</refname> 3980 <refpurpose> 3981 unregister adapter interrupt handler 3982 </refpurpose> 3983</refnamediv> 3984<refsynopsisdiv> 3985 <title>Synopsis</title> 3986 <funcsynopsis><funcprototype> 3987 <funcdef>void <function>unregister_adapter_interrupt </function></funcdef> 3988 <paramdef>struct airq_struct * <parameter>airq</parameter></paramdef> 3989 </funcprototype></funcsynopsis> 3990</refsynopsisdiv> 3991<refsect1> 3992 <title>Arguments</title> 3993 <variablelist> 3994 <varlistentry> 3995 <term><parameter>airq</parameter></term> 3996 <listitem> 3997 <para> 3998 pointer to adapter interrupt descriptor 3999 </para> 4000 </listitem> 4001 </varlistentry> 4002 </variablelist> 4003</refsect1> 4004</refentry> 4005 4006<refentry id="API-airq-iv-create"> 4007<refentryinfo> 4008 <title>LINUX</title> 4009 <productname>Kernel Hackers Manual</productname> 4010 <date>July 2017</date> 4011</refentryinfo> 4012<refmeta> 4013 <refentrytitle><phrase>airq_iv_create</phrase></refentrytitle> 4014 <manvolnum>9</manvolnum> 4015 <refmiscinfo class="version">4.1.27</refmiscinfo> 4016</refmeta> 4017<refnamediv> 4018 <refname>airq_iv_create</refname> 4019 <refpurpose> 4020 create an interrupt vector 4021 </refpurpose> 4022</refnamediv> 4023<refsynopsisdiv> 4024 <title>Synopsis</title> 4025 <funcsynopsis><funcprototype> 4026 <funcdef>struct airq_iv * <function>airq_iv_create </function></funcdef> 4027 <paramdef>unsigned long <parameter>bits</parameter></paramdef> 4028 <paramdef>unsigned long <parameter>flags</parameter></paramdef> 4029 </funcprototype></funcsynopsis> 4030</refsynopsisdiv> 4031<refsect1> 4032 <title>Arguments</title> 4033 <variablelist> 4034 <varlistentry> 4035 <term><parameter>bits</parameter></term> 4036 <listitem> 4037 <para> 4038 number of bits in the interrupt vector 4039 </para> 4040 </listitem> 4041 </varlistentry> 4042 <varlistentry> 4043 <term><parameter>flags</parameter></term> 4044 <listitem> 4045 <para> 4046 allocation flags 4047 </para> 4048 </listitem> 4049 </varlistentry> 4050 </variablelist> 4051</refsect1> 4052<refsect1> 4053<title>Description</title> 4054<para> 4055 Returns a pointer to an interrupt vector structure 4056</para> 4057</refsect1> 4058</refentry> 4059 4060<refentry id="API-airq-iv-release"> 4061<refentryinfo> 4062 <title>LINUX</title> 4063 <productname>Kernel Hackers Manual</productname> 4064 <date>July 2017</date> 4065</refentryinfo> 4066<refmeta> 4067 <refentrytitle><phrase>airq_iv_release</phrase></refentrytitle> 4068 <manvolnum>9</manvolnum> 4069 <refmiscinfo class="version">4.1.27</refmiscinfo> 4070</refmeta> 4071<refnamediv> 4072 <refname>airq_iv_release</refname> 4073 <refpurpose> 4074 release an interrupt vector 4075 </refpurpose> 4076</refnamediv> 4077<refsynopsisdiv> 4078 <title>Synopsis</title> 4079 <funcsynopsis><funcprototype> 4080 <funcdef>void <function>airq_iv_release </function></funcdef> 4081 <paramdef>struct airq_iv * <parameter>iv</parameter></paramdef> 4082 </funcprototype></funcsynopsis> 4083</refsynopsisdiv> 4084<refsect1> 4085 <title>Arguments</title> 4086 <variablelist> 4087 <varlistentry> 4088 <term><parameter>iv</parameter></term> 4089 <listitem> 4090 <para> 4091 pointer to interrupt vector structure 4092 </para> 4093 </listitem> 4094 </varlistentry> 4095 </variablelist> 4096</refsect1> 4097</refentry> 4098 4099<refentry id="API-airq-iv-alloc"> 4100<refentryinfo> 4101 <title>LINUX</title> 4102 <productname>Kernel Hackers Manual</productname> 4103 <date>July 2017</date> 4104</refentryinfo> 4105<refmeta> 4106 <refentrytitle><phrase>airq_iv_alloc</phrase></refentrytitle> 4107 <manvolnum>9</manvolnum> 4108 <refmiscinfo class="version">4.1.27</refmiscinfo> 4109</refmeta> 4110<refnamediv> 4111 <refname>airq_iv_alloc</refname> 4112 <refpurpose> 4113 allocate irq bits from an interrupt vector 4114 </refpurpose> 4115</refnamediv> 4116<refsynopsisdiv> 4117 <title>Synopsis</title> 4118 <funcsynopsis><funcprototype> 4119 <funcdef>unsigned long <function>airq_iv_alloc </function></funcdef> 4120 <paramdef>struct airq_iv * <parameter>iv</parameter></paramdef> 4121 <paramdef>unsigned long <parameter>num</parameter></paramdef> 4122 </funcprototype></funcsynopsis> 4123</refsynopsisdiv> 4124<refsect1> 4125 <title>Arguments</title> 4126 <variablelist> 4127 <varlistentry> 4128 <term><parameter>iv</parameter></term> 4129 <listitem> 4130 <para> 4131 pointer to an interrupt vector structure 4132 </para> 4133 </listitem> 4134 </varlistentry> 4135 <varlistentry> 4136 <term><parameter>num</parameter></term> 4137 <listitem> 4138 <para> 4139 number of consecutive irq bits to allocate 4140 </para> 4141 </listitem> 4142 </varlistentry> 4143 </variablelist> 4144</refsect1> 4145<refsect1> 4146<title>Description</title> 4147<para> 4148 Returns the bit number of the first irq in the allocated block of irqs, 4149 or -1UL if no bit is available or the AIRQ_IV_ALLOC flag has not been 4150 specified 4151</para> 4152</refsect1> 4153</refentry> 4154 4155<refentry id="API-airq-iv-free"> 4156<refentryinfo> 4157 <title>LINUX</title> 4158 <productname>Kernel Hackers Manual</productname> 4159 <date>July 2017</date> 4160</refentryinfo> 4161<refmeta> 4162 <refentrytitle><phrase>airq_iv_free</phrase></refentrytitle> 4163 <manvolnum>9</manvolnum> 4164 <refmiscinfo class="version">4.1.27</refmiscinfo> 4165</refmeta> 4166<refnamediv> 4167 <refname>airq_iv_free</refname> 4168 <refpurpose> 4169 free irq bits of an interrupt vector 4170 </refpurpose> 4171</refnamediv> 4172<refsynopsisdiv> 4173 <title>Synopsis</title> 4174 <funcsynopsis><funcprototype> 4175 <funcdef>void <function>airq_iv_free </function></funcdef> 4176 <paramdef>struct airq_iv * <parameter>iv</parameter></paramdef> 4177 <paramdef>unsigned long <parameter>bit</parameter></paramdef> 4178 <paramdef>unsigned long <parameter>num</parameter></paramdef> 4179 </funcprototype></funcsynopsis> 4180</refsynopsisdiv> 4181<refsect1> 4182 <title>Arguments</title> 4183 <variablelist> 4184 <varlistentry> 4185 <term><parameter>iv</parameter></term> 4186 <listitem> 4187 <para> 4188 pointer to interrupt vector structure 4189 </para> 4190 </listitem> 4191 </varlistentry> 4192 <varlistentry> 4193 <term><parameter>bit</parameter></term> 4194 <listitem> 4195 <para> 4196 number of the first irq bit to free 4197 </para> 4198 </listitem> 4199 </varlistentry> 4200 <varlistentry> 4201 <term><parameter>num</parameter></term> 4202 <listitem> 4203 <para> 4204 number of consecutive irq bits to free 4205 </para> 4206 </listitem> 4207 </varlistentry> 4208 </variablelist> 4209</refsect1> 4210</refentry> 4211 4212<refentry id="API-airq-iv-scan"> 4213<refentryinfo> 4214 <title>LINUX</title> 4215 <productname>Kernel Hackers Manual</productname> 4216 <date>July 2017</date> 4217</refentryinfo> 4218<refmeta> 4219 <refentrytitle><phrase>airq_iv_scan</phrase></refentrytitle> 4220 <manvolnum>9</manvolnum> 4221 <refmiscinfo class="version">4.1.27</refmiscinfo> 4222</refmeta> 4223<refnamediv> 4224 <refname>airq_iv_scan</refname> 4225 <refpurpose> 4226 scan interrupt vector for non-zero bits 4227 </refpurpose> 4228</refnamediv> 4229<refsynopsisdiv> 4230 <title>Synopsis</title> 4231 <funcsynopsis><funcprototype> 4232 <funcdef>unsigned long <function>airq_iv_scan </function></funcdef> 4233 <paramdef>struct airq_iv * <parameter>iv</parameter></paramdef> 4234 <paramdef>unsigned long <parameter>start</parameter></paramdef> 4235 <paramdef>unsigned long <parameter>end</parameter></paramdef> 4236 </funcprototype></funcsynopsis> 4237</refsynopsisdiv> 4238<refsect1> 4239 <title>Arguments</title> 4240 <variablelist> 4241 <varlistentry> 4242 <term><parameter>iv</parameter></term> 4243 <listitem> 4244 <para> 4245 pointer to interrupt vector structure 4246 </para> 4247 </listitem> 4248 </varlistentry> 4249 <varlistentry> 4250 <term><parameter>start</parameter></term> 4251 <listitem> 4252 <para> 4253 bit number to start the search 4254 </para> 4255 </listitem> 4256 </varlistentry> 4257 <varlistentry> 4258 <term><parameter>end</parameter></term> 4259 <listitem> 4260 <para> 4261 bit number to end the search 4262 </para> 4263 </listitem> 4264 </varlistentry> 4265 </variablelist> 4266</refsect1> 4267<refsect1> 4268<title>Description</title> 4269<para> 4270 Returns the bit number of the next non-zero interrupt bit, or 4271 -1UL if the scan completed without finding any more any non-zero bits. 4272</para> 4273</refsect1> 4274</refentry> 4275 4276 </chapter> 4277 4278</book> 4279