992
man pages section 9: DDI and DKI Kernel Functions Part No: 816–5180–17 August 2011

man pages section 9 DDI and DKI Kernel Functions - Oracle · bp_copyin(9F).....94 bp_copyout (9F ... 344 ddi_dma_sync(9F) ... hook_free(9F).....570 id32_alloc (9F

Embed Size (px)

Citation preview

  • man pages section 9: DDI and DKI KernelFunctions

    Part No: 816518017August 2011

  • Copyright 2011, Oracle and/or its affiliates. All rights reserved.

    License Restrictions Warranty/Consequential Damages Disclaimer

    This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectualproperty laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,transmit, distribute, exhibit, perform, publish or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software,unless required by law for interoperability, is prohibited.

    Warranty Disclaimer

    The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

    Restricted Rights Notice

    If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice isapplicable:

    U.S. GOVERNMENT RIGHTS

    Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or"commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication,disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extentapplicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007).Oracle America, Inc., 500 Oracle Parkway, Redwood City, CA 94065.

    Hazardous Applications Notice

    This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherentlydangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shallbe responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim anyliability for any damages caused by use of this software or hardware in dangerous applications.

    Trademark Notice

    Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

    Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registeredtrademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced MicroDevices. UNIX is a registered trademark of The Open Group in the United States and other countries.

    Third Party Content, Products, and Services Disclaimer

    This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation andits affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporationand its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

    111219@25097

  • Contents

    Preface ...................................................................................................................................................19

    Introduction .........................................................................................................................................23Intro(9F) ............................................................................................................................................. 24

    Kernel Functions for Drivers ..............................................................................................................53adjmsg(9F) ........................................................................................................................................... 54allocb(9F) ........................................................................................................................................... 55allocb_tmpl(9F) ................................................................................................................................. 58anocancel(9F) ..................................................................................................................................... 59aphysio(9F) ......................................................................................................................................... 60ASSERT(9F) ........................................................................................................................................... 62atomic_add(9F) ................................................................................................................................... 63atomic_and(9F) ................................................................................................................................... 65atomic_bits(9F) ................................................................................................................................. 67atomic_cas(9F) ................................................................................................................................... 68atomic_dec(9F) ................................................................................................................................... 69atomic_inc(9F) ................................................................................................................................... 71atomic_ops(9F) ................................................................................................................................... 73atomic_or(9F) ..................................................................................................................................... 74atomic_swap(9F) ................................................................................................................................. 76backq(9F) ............................................................................................................................................. 77bcanput(9F) ......................................................................................................................................... 78bcmp(9F) ................................................................................................................................................ 79bcopy(9F) ............................................................................................................................................. 80bioclone(9F) ....................................................................................................................................... 82biodone(9F) ......................................................................................................................................... 85

    3

  • bioerror(9F) ....................................................................................................................................... 87biofini(9F) ......................................................................................................................................... 88bioinit(9F) ......................................................................................................................................... 89biomodified(9F) ................................................................................................................................. 90bioreset(9F) ....................................................................................................................................... 91biosize(9F) ......................................................................................................................................... 92biowait(9F) ......................................................................................................................................... 93bp_copyin(9F) ..................................................................................................................................... 94bp_copyout(9F) ................................................................................................................................... 95bp_mapin(9F) ....................................................................................................................................... 96bp_mapout(9F) ..................................................................................................................................... 97btop(9F) ................................................................................................................................................ 98btopr(9F) ............................................................................................................................................. 99bufcall(9F) ....................................................................................................................................... 100bzero(9F) ........................................................................................................................................... 103canput(9F) ......................................................................................................................................... 104canputnext(9F) ................................................................................................................................. 105clrbuf(9F) ......................................................................................................................................... 106cmn_err(9F) ....................................................................................................................................... 107condvar(9F) ....................................................................................................................................... 113copyb(9F) ........................................................................................................................................... 117copyin(9F) ......................................................................................................................................... 119copymsg(9F) ....................................................................................................................................... 121copyout(9F) ....................................................................................................................................... 123csx_AccessConfigurationRegister(9F) ..................................................................................... 125csx_ConvertSize(9F) ...................................................................................................................... 127csx_ConvertSpeed(9F) .................................................................................................................... 128csx_CS_DDI_Info(9F) ...................................................................................................................... 129csx_DeregisterClient(9F) ............................................................................................................ 131csx_DupHandle(9F) ........................................................................................................................... 132csx_Error2Text(9F) ........................................................................................................................ 134csx_Event2Text(9F) ........................................................................................................................ 135csx_FreeHandle(9F) ........................................................................................................................ 136csx_Get8(9F) ..................................................................................................................................... 137csx_GetFirstClient(9F) ................................................................................................................ 138csx_GetFirstTuple(9F) .................................................................................................................. 140

    Contents

    man pages section 9: DDI and DKI Kernel Functions August 20114

  • csx_GetHandleOffset(9F) .............................................................................................................. 143csx_GetMappedAddr(9F) .................................................................................................................. 144csx_GetStatus(9F) ........................................................................................................................... 145csx_GetTupleData(9F) .................................................................................................................... 148csx_MakeDeviceNode(9F) ................................................................................................................ 150csx_MapLogSocket(9F) .................................................................................................................... 152csx_MapMemPage(9F) ........................................................................................................................ 153csx_ModifyConfiguration(9F) ..................................................................................................... 154csx_ModifyWindow(9F) .................................................................................................................... 157csx_Parse_CISTPL_BATTERY(9F) ................................................................................................... 159csx_Parse_CISTPL_BYTEORDER(9F) ............................................................................................... 161csx_Parse_CISTPL_CFTABLE_ENTRY(9F) ....................................................................................... 163csx_Parse_CISTPL_CONFIG(9F) ..................................................................................................... 168csx_Parse_CISTPL_DATE(9F) .......................................................................................................... 170csx_Parse_CISTPL_DEVICE(9F) ..................................................................................................... 171csx_Parse_CISTPL_DEVICEGEO(9F) ............................................................................................... 174csx_Parse_CISTPL_DEVICEGEO_A(9F) ........................................................................................... 176csx_Parse_CISTPL_FORMAT(9F) ..................................................................................................... 178csx_Parse_CISTPL_FUNCE(9F) ........................................................................................................ 180csx_Parse_CISTPL_FUNCID(9F) ..................................................................................................... 187csx_Parse_CISTPL_GEOMETRY(9F) ................................................................................................. 189csx_Parse_CISTPL_JEDEC_C(9F) ................................................................................................... 191csx_Parse_CISTPL_LINKTARGET(9F) ............................................................................................. 193csx_Parse_CISTPL_LONGLINK_A(9F) ............................................................................................. 195csx_Parse_CISTPL_LONGLINK_MFC(9F) ......................................................................................... 197csx_Parse_CISTPL_MANFID(9F) ..................................................................................................... 199csx_Parse_CISTPL_ORG(9F) ............................................................................................................ 200csx_Parse_CISTPL_SPCL(9F) .......................................................................................................... 201csx_Parse_CISTPL_SWIL(9F) .......................................................................................................... 203csx_Parse_CISTPL_VERS_1(9F) ..................................................................................................... 204csx_Parse_CISTPL_VERS_2(9F) ..................................................................................................... 205csx_ParseTuple(9F) ........................................................................................................................ 207csx_Put8(9F) ..................................................................................................................................... 209csx_RegisterClient(9F) ................................................................................................................ 210csx_ReleaseConfiguration(9F) ................................................................................................... 213csx_RepGet8(9F) ............................................................................................................................... 215

    Contents

    5

  • csx_RepPut8(9F) ............................................................................................................................... 217csx_RequestConfiguration(9F) ................................................................................................... 219csx_RequestIO(9F) ........................................................................................................................... 225csx_RequestIRQ(9F) ........................................................................................................................ 230csx_RequestSocketMask(9F) .......................................................................................................... 232csx_RequestWindow(9F) .................................................................................................................. 234csx_ResetFunction(9F) .................................................................................................................. 240csx_SetEventMask(9F) .................................................................................................................... 241csx_SetHandleOffset(9F) .............................................................................................................. 243csx_ValidateCIS(9F) ...................................................................................................................... 244datamsg(9F) ....................................................................................................................................... 245DB_BASE(9F) ....................................................................................................................................... 246ddi_add_event_handler(9F) .......................................................................................................... 247ddi_add_intr(9F) ............................................................................................................................. 249ddi_add_softintr(9F) .................................................................................................................... 252ddi_binding_name(9F) .................................................................................................................... 259ddi_btop(9F) ..................................................................................................................................... 260ddi_can_receive_sig(9F) .............................................................................................................. 261ddi_cb_register(9F) ...................................................................................................................... 262ddi_check_acc_handle(9F) ............................................................................................................ 271ddi_copyin(9F) ................................................................................................................................. 273ddi_copyout(9F) ............................................................................................................................... 276ddi_create_minor_node(9F) .......................................................................................................... 279ddi_cred(9F) ..................................................................................................................................... 281ddi_device_copy(9F) ...................................................................................................................... 283ddi_device_zero(9F) ...................................................................................................................... 285ddi_devid_compare(9F) .................................................................................................................. 286ddi_dev_is_needed(9F) .................................................................................................................. 290ddi_dev_is_sid(9F) ........................................................................................................................ 292ddi_dev_nintrs(9F) ........................................................................................................................ 293ddi_dev_nregs(9F) ........................................................................................................................... 294ddi_dev_regsize(9F) ...................................................................................................................... 295ddi_dev_report_fault(9F) ............................................................................................................ 296ddi_dma_addr_bind_handle(9F) ................................................................................................... 299ddi_dma_addr_setup(9F) ................................................................................................................ 303ddi_dma_alloc_handle(9F) ............................................................................................................ 305

    Contents

    man pages section 9: DDI and DKI Kernel Functions August 20116

  • ddi_dma_buf_bind_handle(9F) ..................................................................................................... 307ddi_dma_buf_setup(9F) .................................................................................................................. 311ddi_dma_burstsizes(9F) ................................................................................................................ 313ddi_dma_coff(9F) ............................................................................................................................. 314ddi_dma_curwin(9F) ........................................................................................................................ 315ddi_dma_devalign(9F) .................................................................................................................... 316ddi_dmae(9F) ..................................................................................................................................... 317ddi_dma_free(9F) ............................................................................................................................. 321ddi_dma_free_handle(9F) .............................................................................................................. 322ddi_dma_get_attr(9F) .................................................................................................................... 323ddi_dma_getwin(9F) ........................................................................................................................ 324ddi_dma_htoc(9F) ............................................................................................................................. 326ddi_dma_mem_alloc(9F) .................................................................................................................. 327ddi_dma_mem_free(9F) .................................................................................................................... 330ddi_dma_movwin(9F) ........................................................................................................................ 331ddi_dma_nextcookie(9F) ................................................................................................................ 333ddi_dma_nextseg(9F) ...................................................................................................................... 335ddi_dma_nextwin(9F) ...................................................................................................................... 337ddi_dma_numwin(9F) ........................................................................................................................ 339ddi_dma_segtocookie(9F) .............................................................................................................. 340ddi_dma_set_sbus64(9F) ................................................................................................................ 342ddi_dma_setup(9F) ........................................................................................................................... 344ddi_dma_sync(9F) ............................................................................................................................. 346ddi_dma_unbind_handle(9F) .......................................................................................................... 348ddi_driver_major(9F) .................................................................................................................... 349ddi_driver_name(9F) ...................................................................................................................... 350ddi_enter_critical(9F) ................................................................................................................ 351ddi_ffs(9F) ....................................................................................................................................... 352ddi_fm_acc_err_clear(9F) ............................................................................................................ 353ddi_fm_acc_err_get(9F) ................................................................................................................ 354ddi_fm_ereport_post(9F) .............................................................................................................. 356ddi_fm_handler_register(9F) ..................................................................................................... 358ddi_fm_init(9F) ............................................................................................................................... 360ddi_fm_service_impact(9F) .......................................................................................................... 362ddi_get8(9F) ..................................................................................................................................... 363ddi_get_cred(9F) ............................................................................................................................. 365

    Contents

    7

  • ddi_get_devstate(9F) .................................................................................................................... 366ddi_get_driver_private(9F) ........................................................................................................ 368ddi_get_eventcookie(9F) .............................................................................................................. 369ddi_getiminor(9F) ........................................................................................................................... 370ddi_get_instance(9F) .................................................................................................................... 371ddi_get_kt_did(9F) ........................................................................................................................ 372ddi_get_lbolt(9F) ........................................................................................................................... 373ddi_get_parent(9F) ........................................................................................................................ 374ddi_get_pid(9F) ............................................................................................................................... 375ddi_get_time(9F) ............................................................................................................................. 376ddi_in_panic(9F) ............................................................................................................................. 377ddi_intr_add_handler(9F) ............................................................................................................ 378ddi_intr_add_softint(9F) ............................................................................................................ 380ddi_intr_alloc(9F) ........................................................................................................................ 387ddi_intr_dup_handler(9F) ............................................................................................................ 390ddi_intr_enable(9F) ...................................................................................................................... 395ddi_intr_get_cap(9F) .................................................................................................................... 398ddi_intr_get_hilevel_pri(9F) ................................................................................................... 400ddi_intr_get_nintrs(9F) .............................................................................................................. 402ddi_intr_get_pending(9F) ............................................................................................................ 404ddi_intr_get_pri(9F) .................................................................................................................... 406ddi_intr_get_supported_types(9F) ........................................................................................... 408ddi_intr_hilevel(9F) .................................................................................................................... 410ddi_intr_set_mask(9F) .................................................................................................................. 412ddi_intr_set_nreq(9F) .................................................................................................................. 414ddi_io_get8(9F) ............................................................................................................................... 416ddi_iomin(9F) ................................................................................................................................... 418ddi_iopb_alloc(9F) ........................................................................................................................ 419ddi_io_put8(9F) ............................................................................................................................... 421ddi_io_rep_get8(9F) ...................................................................................................................... 423ddi_io_rep_put8(9F) ...................................................................................................................... 425ddi_log_sysevent(9F) .................................................................................................................... 427ddi_map_regs(9F) ............................................................................................................................. 431ddi_mem_alloc(9F) ........................................................................................................................... 433ddi_mem_get8(9F) ............................................................................................................................. 435ddi_mem_put8(9F) ............................................................................................................................. 437

    Contents

    man pages section 9: DDI and DKI Kernel Functions August 20118

  • ddi_mem_rep_get8(9F) .................................................................................................................... 439ddi_mem_rep_put8(9F) .................................................................................................................... 441ddi_mmap_get_model(9F) ................................................................................................................ 443ddi_model_convert_from(9F) ........................................................................................................ 445ddi_node_name(9F) ........................................................................................................................... 447ddi_no_info(9F) ............................................................................................................................... 448ddi_peek(9F) ..................................................................................................................................... 449ddi_periodic_add(9F) .................................................................................................................... 451ddi_periodic_delete(9F) .............................................................................................................. 454ddi_poke(9F) ..................................................................................................................................... 456ddi_prop_create(9F) ...................................................................................................................... 458ddi_prop_exists(9F) ...................................................................................................................... 463ddi_prop_get_int(9F) .................................................................................................................... 465ddi_prop_lookup(9F) ...................................................................................................................... 467ddi_prop_op(9F) ............................................................................................................................... 472ddi_prop_update(9F) ...................................................................................................................... 476ddi_put8(9F) ..................................................................................................................................... 480ddi_regs_map_free(9F) .................................................................................................................. 482ddi_regs_map_setup(9F) ................................................................................................................ 483ddi_remove_event_handler(9F) ................................................................................................... 485ddi_remove_minor_node(9F) .......................................................................................................... 486ddi_removing_power(9F) ................................................................................................................ 487ddi_rep_get8(9F) ............................................................................................................................. 489ddi_report_dev(9F) ........................................................................................................................ 491ddi_rep_put8(9F) ............................................................................................................................. 492ddi_root_node(9F) ........................................................................................................................... 494ddi_segmap(9F) ................................................................................................................................. 495ddi_slaveonly(9F) ........................................................................................................................... 498ddi_soft_state(9F) ........................................................................................................................ 499ddi_strtol(9F) ................................................................................................................................. 504ddi_strtoll(9F) ............................................................................................................................... 506ddi_strtoul(9F) ............................................................................................................................... 508ddi_umem_alloc(9F) ........................................................................................................................ 510ddi_umem_iosetup(9F) .................................................................................................................... 512ddi_umem_lock(9F) ........................................................................................................................... 514delay(9F) ........................................................................................................................................... 516

    Contents

    9

  • devmap_default_access(9F) .......................................................................................................... 518devmap_devmem_setup(9F) .............................................................................................................. 521devmap_do_ctxmgt(9F) .................................................................................................................... 524devmap_set_ctx_timeout(9F) ........................................................................................................ 527devmap_setup(9F) ............................................................................................................................. 528devmap_unload(9F) ........................................................................................................................... 530disksort(9F) ..................................................................................................................................... 532dlbindack(9F) ................................................................................................................................... 533drv_getparm(9F) ............................................................................................................................... 535drv_hztousec(9F) ............................................................................................................................. 537drv_priv(9F) ..................................................................................................................................... 538drv_usectohz(9F) ............................................................................................................................. 539drv_usecwait(9F) ............................................................................................................................. 540dupb(9F) .............................................................................................................................................. 541dupmsg(9F) ......................................................................................................................................... 545enableok(9F) ..................................................................................................................................... 546esballoc(9F) ..................................................................................................................................... 547esbbcall(9F) ..................................................................................................................................... 549flushband(9F) ................................................................................................................................... 550flushq(9F) ......................................................................................................................................... 551freeb(9F) ........................................................................................................................................... 553freemsg(9F) ....................................................................................................................................... 554freerbuf(9F) ..................................................................................................................................... 555freezestr(9F) ................................................................................................................................... 556geterror(9F) ..................................................................................................................................... 557gethrtime(9F) ................................................................................................................................... 558getmajor(9F) ..................................................................................................................................... 559getminor(9F) ..................................................................................................................................... 560get_pktiopb(9F) ............................................................................................................................... 561getq(9F) .............................................................................................................................................. 563getrbuf(9F) ....................................................................................................................................... 564gld(9F) ................................................................................................................................................ 565hat_getkpfnum(9F) ........................................................................................................................... 568hook_alloc(9F) ................................................................................................................................. 569hook_free(9F) ................................................................................................................................... 570id32_alloc(9F) ................................................................................................................................. 571

    Contents

    man pages section 9: DDI and DKI Kernel Functions August 201110

  • inb(9F) ................................................................................................................................................ 573insq(9F) .............................................................................................................................................. 575IOC_CONVERT_FROM(9F) .................................................................................................................... 577kmem_alloc(9F) ................................................................................................................................. 578kmem_cache_create(9F) .................................................................................................................. 580kstat_create(9F) ............................................................................................................................. 585kstat_delete(9F) ............................................................................................................................. 587kstat_install(9F) ........................................................................................................................... 588kstat_named_init(9F) .................................................................................................................... 589kstat_queue(9F) ............................................................................................................................... 590ldi_add_event_handler(9F) .......................................................................................................... 592ldi_aread(9F) ................................................................................................................................... 594ldi_devmap(9F) ................................................................................................................................. 595ldi_dump(9F) ..................................................................................................................................... 596ldi_get_dev(9F) ............................................................................................................................... 597ldi_get_eventcookie(9F) .............................................................................................................. 598ldi_get_size(9F) ............................................................................................................................. 599ldi_ident_from_dev(9F) ................................................................................................................ 600ldi_ioctl(9F) ................................................................................................................................... 601ldi_open_by_dev(9F) ...................................................................................................................... 603ldi_poll(9F) ..................................................................................................................................... 606ldi_prop_exists(9F) ...................................................................................................................... 608ldi_prop_get_int(9F) .................................................................................................................... 610ldi_prop_lookup_int_array(9F) ................................................................................................. 612ldi_putmsg(9F) ................................................................................................................................. 617ldi_read(9F) ..................................................................................................................................... 618ldi_remove_event_handler(9F) ................................................................................................... 619ldi_strategy(9F) ............................................................................................................................. 620linkb(9F) ........................................................................................................................................... 621mac(9F) ................................................................................................................................................ 622mac_hcksum_get(9F) ........................................................................................................................ 625mac_lso_get(9F) ............................................................................................................................... 627mac_prop_info_set_perm(9F) ........................................................................................................ 628makecom(9F) ....................................................................................................................................... 630makedevice(9F) ................................................................................................................................. 632max(9F) ................................................................................................................................................ 633

    Contents

    11

  • MBLKHEAD(9F) ..................................................................................................................................... 634mcopyin(9F) ....................................................................................................................................... 636mcopymsg(9F) ..................................................................................................................................... 637mcopyout(9F) ..................................................................................................................................... 638membar_ops(9F) ................................................................................................................................. 639memchr(9F) ......................................................................................................................................... 641merror(9F) ......................................................................................................................................... 643mexchange(9F) ................................................................................................................................... 644min(9F) ................................................................................................................................................ 645mioc2ack(9F) ..................................................................................................................................... 646miocack(9F) ....................................................................................................................................... 647miocnak(9F) ....................................................................................................................................... 648miocpullup(9F) ................................................................................................................................. 649mkiocb(9F) ......................................................................................................................................... 650mod_install(9F) ............................................................................................................................... 653msgdsize(9F) ..................................................................................................................................... 654msgpullup(9F) ................................................................................................................................... 655msgsize(9F) ....................................................................................................................................... 656mt-streams(9F) ................................................................................................................................. 657mutex(9F) ........................................................................................................................................... 659net_event_notify_register(9F) ................................................................................................. 662net_getifname(9F) ........................................................................................................................... 664net_getlifaddr(9F) ........................................................................................................................ 665net_getmtu(9F) ................................................................................................................................. 667net_getnetid(9F) ............................................................................................................................. 668net_getpmtuenabled(9F) ................................................................................................................ 669net_hook_register(9F) .................................................................................................................. 670net_hook_unregister(9F) .............................................................................................................. 672netinfo(9F) ....................................................................................................................................... 673net_inject(9F) ................................................................................................................................. 674net_inject_alloc(9F) .................................................................................................................... 676net_inject_free(9F) ...................................................................................................................... 677net_instance_alloc(9F) ................................................................................................................ 678net_instance_free(9F) .................................................................................................................. 679net_instance_notify_register(9F) ........................................................................................... 680net_instance_register(9F) .......................................................................................................... 682

    Contents

    man pages section 9: DDI and DKI Kernel Functions August 201112

  • net_instance_unregister(9F) ..................................................................................................... 683net_ispartialchecksum(9F) .......................................................................................................... 684net_isvalidchecksum(9F) .............................................................................................................. 685net_kstat_create(9F) .................................................................................................................... 686net_kstat_delete(9F) .................................................................................................................... 688net_lifgetnext(9F) ........................................................................................................................ 689net_netidtozonid(9F) .................................................................................................................... 691net_phygetnext(9F) ........................................................................................................................ 692net_phylookup(9F) ........................................................................................................................... 694net_protocol_lookup(9F) .............................................................................................................. 695net_protocol_notify_register(9F) ........................................................................................... 696net_protocol_release(9F) ............................................................................................................ 698net_protocol_walk(9F) .................................................................................................................. 699net_routeto(9F) ............................................................................................................................... 700net_zoneidtonetid(9F) .................................................................................................................. 701nochpoll(9F) ..................................................................................................................................... 702nodev(9F) ........................................................................................................................................... 703noenable(9F) ..................................................................................................................................... 704nulldev(9F) ....................................................................................................................................... 705nvlist_add_boolean(9F) ................................................................................................................ 706nvlist_alloc(9F) ............................................................................................................................. 709nvlist_lookup_boolean(9F) .......................................................................................................... 715nvlist_next_nvpair(9F) ................................................................................................................ 719nvlist_remove(9F) ........................................................................................................................... 721nvpair_value_byte(9F) .................................................................................................................. 722OTHERQ(9F) ......................................................................................................................................... 724outb(9F) .............................................................................................................................................. 725pci_config_get8(9F) ...................................................................................................................... 727pci_config_setup(9F) .................................................................................................................... 729pci_ereport_setup(9F) .................................................................................................................. 730pci_report_pmcap(9F) .................................................................................................................... 733pci_save_config_regs(9F) ............................................................................................................ 735physio(9F) ......................................................................................................................................... 737pm_busy_component(9F) .................................................................................................................. 739pm_power_has_changed(9F) ............................................................................................................ 741pm_raise_power(9F) ........................................................................................................................ 744

    Contents

    13

  • pm_trans_check(9F) ........................................................................................................................ 748pollwakeup(9F) ................................................................................................................................. 750priv_getbyname(9F) ........................................................................................................................ 751priv_policy(9F) ............................................................................................................................... 753proc_signal(9F) ............................................................................................................................... 755ptob(9F) .............................................................................................................................................. 757pullupmsg(9F) ................................................................................................................................... 758put(9F) ................................................................................................................................................ 760putbq(9F) ........................................................................................................................................... 761putctl1(9F) ....................................................................................................................................... 762putctl(9F) ......................................................................................................................................... 763putnext(9F) ....................................................................................................................................... 765putnextctl1(9F) ............................................................................................................................... 766putnextctl(9F) ................................................................................................................................. 767putq(9F) .............................................................................................................................................. 769qassociate(9F) ................................................................................................................................. 770qbufcall(9F) ..................................................................................................................................... 772qenable(9F) ....................................................................................................................................... 774qprocson(9F) ..................................................................................................................................... 775qreply(9F) ......................................................................................................................................... 776qsize(9F) ........................................................................................................................................... 778qtimeout(9F) ..................................................................................................................................... 779qunbufcall(9F) ................................................................................................................................. 780quntimeout(9F) ................................................................................................................................. 781qwait(9F) ........................................................................................................................................... 782qwriter(9F) ....................................................................................................................................... 784RD(9F) .................................................................................................................................................. 785rmalloc(9F) ....................................................................................................................................... 786rmallocmap(9F) ................................................................................................................................. 789rmalloc_wait(9F) ............................................................................................................................. 791rmfree(9F) ......................................................................................................................................... 792rmvb(9F) .............................................................................................................................................. 793rmvq(9F) .............................................................................................................................................. 795rwlock(9F) ......................................................................................................................................... 797SAMESTR(9F) ....................................................................................................................................... 800scsi_abort(9F) ................................................................................................................................. 801

    Contents

    man pages section 9: DDI and DKI Kernel Functions August 201114

  • scsi_alloc_consistent_buf(9F) ................................................................................................. 802scsi_cname(9F) ................................................................................................................................. 804scsi_destroy_pkt(9F) .................................................................................................................... 806scsi_dmaget(9F) ............................................................................................................................... 807scsi_errmsg(9F) ............................................................................................................................... 809scsi_ext_sense_fields(9F) .......................................................................................................... 812scsi_find_sense_descr(9F) .......................................................................................................... 814scsi_free_consistent_buf(9F) ................................................................................................... 815scsi_get_device_type_scsi_options(9F) ................................................................................ 816scsi_hba_attach_setup(9F) .......................................................................................................... 818scsi_hba_init(9F) ........................................................................................................................... 821scsi_hba_lookup_capstr(9F) ........................................................................................................ 822scsi_hba_pkt_alloc(9F) ................................................................................................................ 824scsi_hba_pkt_comp(9F) .................................................................................................................. 826scsi_hba_probe(9F) ........................................................................................................................ 827scsi_hba_tran_alloc(9F) .............................................................................................................. 828scsi_ifgetcap(9F) ........................................................................................................................... 829scsi_init_pkt(9F) ........................................................................................................................... 833scsi_log(9F) ..................................................................................................................................... 837scsi_pktalloc(9F) ........................................................................................................................... 838scsi_poll(9F) ................................................................................................................................... 840scsi_probe(9F) ................................................................................................................................. 841scsi_reset(9F) ................................................................................................................................. 843scsi_reset_notify(9F) .................................................................................................................. 845scsi_sense_key(9F) ........................................................................................................................ 846scsi_setup_cdb(9F) ........................................................................................................................ 847scsi_slave(9F) ................................................................................................................................. 848scsi_sync_pkt(9F) ........................................................................................................................... 850scsi_transport(9F) ........................................................................................................................ 851scsi_unprobe(9F) ............................................................................................................................. 852scsi_validate_sense(9F) .............................................................................................................. 853scsi_vu_errmsg(9F) ........................................................................................................................ 854semaphore(9F) ................................................................................................................................... 857sprintf(9F) ....................................................................................................................................... 859stoi(9F) .............................................................................................................................................. 861strchr(9F) ......................................................................................................................................... 862

    Contents

    15

  • strcmp(9F) ......................................................................................................................................... 863strcpy(9F) ......................................................................................................................................... 864strlen(9F) ......................................................................................................................................... 866strlog(9F) ......................................................................................................................................... 867strqget(9F) ....................................................................................................................................... 869strqset(9F) ....................................................................................................................................... 870STRUCT_DECL(9F) ............................................................................................................................... 871swab(9F) .............................................................................................................................................. 876taskq(9F) ........................................................................................................................................... 877testb(9F) ........................................................................................................................................... 880timeout(9F) ....................................................................................................................................... 882u8_strcmp(9F) ................................................................................................................................... 884u8_textprep_str(9F) ...................................................................................................................... 888u8_validate(9F) ............................................................................................................................... 892uconv_u16tou32(9F) ........................................................................................................................ 896uiomove(9F) ....................................................................................................................................... 902unbufcall(9F) ................................................................................................................................... 904unlinkb(9F) ....................................................................................................................................... 905untimeout(9F) ................................................................................................................................... 906ureadc(9F) ......................................................................................................................................... 908usb_alloc_request(9F) .................................................................................................................. 909usb_client_attach(9F) .................................................................................................................. 912usb_clr_feature(9F) ...................................................................................................................... 915usb_create_pm_components(9F) ................................................................................................... 917usb_get_addr(9F) ............................................................................................................................. 919usb_get_alt_if(9F) ........................................................................................................................ 920usb_get_cfg(9F) ............................................................................................................................... 924usb_get_current_frame_number(9F) ........................................................................................... 927usb_get_dev_data(9F) .................................................................................................................... 929usb_get_max_pkts_per_isoc_request(9F) ................................................................................ 933usb_get_status(9F) ........................................................................................................................ 935usb_get_string_descr(9F) ............................................................................................................ 937usb_handle_remote_wakeup(9F) ................................................................................................... 939usb_lookup_ep_data(9F) ................................................................................................................ 940usb_parse_data(9F) ........................................................................................................................ 942usb_pipe_bulk_xfer(9F) ................................................................................................................ 944

    Contents

    man pages section 9: DDI and DKI Kernel Functions August 201116

  • usb_pipe_close(9F) ........................................................................................................................ 947usb_pipe_ctrl_xfer(9F) ................................................................................................................ 950usb_pipe_drain_reqs(9F) .............................................................................................................. 956usb_pipe_get_max_bulk_transfer_size(9F) ............................................................................ 959usb_pipe_get_state(9F) ................................................................................................................ 961usb_pipe_intr_xfer(9F) ................................................................................................................ 963usb_pipe_isoc_xfer(9F) ................................................................................................................ 968usb_pipe_open(9F) ........................................................................................................................... 974usb_pipe_reset(9F) ........................................................................................................................ 978usb_pipe_set_private(9F) ............................................................................................................ 981usb_register_hotplug_cbs(9F) ................................................................................................... 983uwritec(9F) ....................................................................................................................................... 985va_arg(9F) ......................................................................................................................................... 986vsprintf(9F) ..................................................................................................................................... 988WR(9F) .................................................................................................................................................. 991

    Contents

    17

  • 18

  • Preface

    Both novice users and those familar with the SunOS operating system can use online man pagesto obtain information about the system and its features. A man page is intended to answerconcisely the question What does it do? The man pages in general comprise a referencemanual. They are not intended to be a tutorial.

    OverviewThe following contains a brief description of each man page section and the information itreferences: Section 1 describes, in alphabetical order, commands available with the operating system. Section 1M describes, in alphabetical order, commands that are used chiefly for system

    maintenance and administration purposes. Section 2 describes all of the system calls. Most of these calls have one or more error returns.

    An error condition is indicated by an otherwise impossible returned value. Section 3 describes functions found in various libraries, other than those functions that

    directly invoke UNIX system primitives, which are described in Section 2. Section 4 outlines the formats of various files. The C structure declarations for the file

    formats are given where applicable. Section 5 contains miscellaneous documentation such as character-set tables. Section 6 contains available games and demos. Section 7 describes various special files that refer to specific hardware peripherals and device

    drivers. STREAMS software drivers, modules and the STREAMS-generic set of system callsare also described.

    Section 9 provides reference information needed to write device drivers in the kernelenvironment. It describes two device driver interface specifications: the Device DriverInterface (DDI) and the Driver/Kernel Interface (DKI).

    Section 9E describes the DDI/DKI, DDI-only, and DKI-only entry-point routines adeveloper can include in a device driver.

    Section 9F describes the kernel functions available for use by device drivers. Section 9S describes the data structures used by drivers to share information between the

    driver and the kernel.

    19

  • Below is a generic format for man pages. The man pages of each manual section generallyfollow this order, but include only needed headings. For example, if there are no bugs to report,there is no BUGS section. See the intro pages for more information and detail about eachsection, and man(1) for more information about man pages in general.

    NAME This section gives the names of the commands or functionsdocumented, followed by a brief description of what theydo.

    SYNOPSIS This section shows the syntax of commands or functions.When a command or file does not exist in the standardpath, its full path name is shown. Options and argumentsare alphabetized, with single letter arguments first, andoptions with arguments next, unless a different argumentorder is required.

    The following special characters are used in this section:

    [ ] Brackets. The option or argument enclosed inthese brackets is optional. If the brackets areomitted, the argument must be specified.

    . . . Ellipses. Several values can be provided for theprevious argument, or the previous argumentcan be specified multiple times, for example,"filename . . ." .

    | Separator. Only one of the argumentsseparated by this character can be specified at atime.

    { } Braces. The options and/or argumentsenclosed within braces are interdependent,such that everything enclosed must be treatedas a unit.

    PROTOCOL This section occurs only in subsection 3R to indicate theprotocol description file.

    DESCRIPTION This section defines the functionality and behavior of theservice. Thus it describes concisely what the commanddoes. It does not discuss OPTIONS or cite EXAMPLES.Interactive commands, subcommands, requests, macros,and functions are described under USAGE.

    IOCTL This section appears on pages in Section 7 only. Only thedevice class that supplies appropriate parameters to theioctl(2) system call is called ioctl and generates its own

    Preface

    man pages section 9: DDI and DKI Kernel Functions August 201120

    http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1man-1http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1ioctl-2

  • heading. ioctl calls for a specific device are listedalphabetically (on the man page for that specific device).ioctl calls are used for a particular class of devices all ofwhich have an io ending, such as mtio(7I).

    OPTIONS This secton lists the command options with a concisesummary of what each option does. The options are listedliterally and in the order they appear in the SYNOPSISsection. Possible arguments to options are discussed underthe option, and where appropriate, default values aresupplied.

    OPERANDS This section lists the command operands and describeshow they affect the actions of the command.

    OUTPUT This section describes the output standard output,standard error, or output files generated by thecommand.

    RETURN VALUES If the man page documents functions that return values,this section lists these values and describes the conditionsunder which they are returned. If a function can returnonly constant values, such as 0 or 1, these values are listedin tagged paragraphs. Otherwise, a single paragraphdescribes the return values of each function. Functionsdeclared void do not return values, so they are notdiscussed in RETURN VALUES.

    ERRORS On failure, most functions place an error code in the globalvariable errno indicating why they failed. This section listsalphabetically all error codes a function can generate anddescribes the conditions that cause each error. When morethan one condition can cause the same error, eachcondition is described in a separate paragraph under theerror code.

    USAGE This section lists special rules, features, and commandsthat require in-depth explanations. The subsections listedhere are used to explain built-in functionality:

    CommandsModifiersVariablesExpressionsInput Grammar

    Preface

    21

    http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1mtio-7i

  • EXAMPLES This section provides examples of usage or of how to use acommand or function. Wherever possible a completeexample including command-line entry and machineresponse is shown. Whenever an example is given, theprompt is shown as example%, or if the user must besuperuser, example#. Examples are followed byexplanations, variable substitution rules, or returnedvalues. Most examples illustrate concepts from theSYNOPSIS, DESCRIPTION, OPTIONS, and USAGEsections.

    ENVIRONMENT VARIABLES This section lists any environment variables that thecommand or function affects, followed by a briefdescription of the effect.

    EXIT STATUS This section lists the values the command returns to thecalling program or shell and the conditions that cause thesevalues to be returned. Usually, zero is returned forsuccessful completion, and values other than zero forvarious error conditions.

    FILES This section lists all file names referred to by the man page,files of interest, and files created or required by commands.Each is followed by a descriptive summary or explanation.

    ATTRIBUTES This section lists characteristics of commands, utilities,and device drivers by defining the attribute type and itscorresponding value. See attributes(5) for moreinformation.

    SEE ALSO This section lists references to other man pages, in-housedocumentation, and outside publications.

    DIAGNOSTICS This section lists diagnostic messages with a briefexplanation of the condition causing the error.

    WARNINGS This section lists warnings about special conditions whichcould seriously affect your working conditions. This is nota list of diagnostics.

    NOTES This section lists additional information that does notbelong anywhere else on the page. It takes the form of anaside to the user, covering points of special interest.Critical information is never covered here.

    BUGS This section describes known bugs and, wherever possible,suggests workarounds.

    Preface

    man pages section 9: DDI and DKI Kernel Functions August 201122

    http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1attributes-5

  • Introduction

    R E F E R E N C E

    23

  • Intro introduction to DDI/DKI functions

    Section 9F describes the kernel functions available for use by device drivers. See Intro(9E) foran overview of device driver interfaces.

    In this section, the information for each driver function is organized under the followingheadings: NAME summarizes the function's purpose. SYNOPSIS shows the syntax of the function's entry point in the source code. #include

    directives are shown for required headers. INTERFACE LEVEL describes any architecture dependencies. ARGUMENTS describes any arguments required to invoke the function. DESCRIPTION describes general information about the function. RETURN VALUES describes the return values and messages that can result from invoking the

    function. CONTEXT indicates from which driver context (user, kernel, interrupt, or high-level

    interrupt) the function can be called. A driver function has user context if it was directly invoked because of a user thread. The

    read(9E) entry point of the driver, invoked by a read(2) system call, has user context. A driver function has kernel context if was invoked by some other part of the kernel. In a

    block device driver, the strategy(9E) entry point may be called by the page daemon towrite pages to the device. The page daemon has no relation to the current user thread, so inthis case strategy(9E) has kernel context.

    Interrupt context is kernel context, but also has an interrupt level associated with it. Driverinterrupt routines have interrupt context.Note that a mutex acquired in user or kernel context that can also be acquired in interruptcontext means that the user or kernel context thread holding that mutex is subject to all therestrictions imposed by interrupt context, for the duration of the ownership of that mutex.Please see the mutex(9F) man page for a more complete discussion of proper mutexhandling for drivers.

    High-level interrupt context is a more restricted form of interrupt context. If a driverinterrupt priority returned from ddi_intr_get_pri(9F) is greater than the priorityreturned from ddi_intr_get_hilevel_pri(9F) this indicates the interrupt handler willrun in high-level interrupt context. These interrupt routines are only allowed to callddi_intr_trigger_softint(9F), mutex_enter(9F), and mutex_exit(9F). Furthermore,mutex_enter(9F) and mutex_exit(9F) may only be called on mutexes initialized with theinterrupt priority returned by ddi_intr_get_pri(9F).

    SEE ALSO indicates functions that are related by usage and sources, and which can bereferred to for further information.

    EXAMPLES shows how the function can be used in driver code.

    Name

    Description

    Intro(9F)

    man pages section 9: DDI and DKI Kernel Functions Last Revised 11 Mar 200824

    http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1intro-9ehttp://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1read-9ehttp://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1read-2http://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1strategy-9ehttp://www.oracle.com/pls/topic/lookup?ctx=E18752&id=REFMAN1strategy-9e

  • Every driver MUST include and , in that order, and as the lastfiles the driver includes.

    The following table summarizes the STREAMS functions described in this section.

    Routine Type

    adjmsg DDI/DKI

    allocb DDI/DKI

    allocb_tmpl Solaris DDI

    backq DDI/DKI

    bcanput DDI/DKI

    bcanputnext DDI/DKI

    bufcall