Print this page
4888 Undocument dma_req(9s)
4884 EOF scsi_hba_attach
4886 EOF ddi_dmae_getlim
4887 EOF ddi_iomin
4634 undocument scsi_hba_attach() and ddi_dma_lim(9s)
4630 clean stale references to ddi_iopb_alloc and ddi_iopb_free

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/isa.c
          +++ new/usr/src/uts/i86pc/io/isa.c
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
       22 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  22   23   * Copyright (c) 2012 Gary Mills
  23   24   * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
  25   25   */
  26   26  
  27   27  /*
  28   28   *      ISA bus nexus driver
  29   29   */
  30   30  
  31   31  #include <sys/types.h>
  32   32  #include <sys/cmn_err.h>
  33   33  #include <sys/conf.h>
  34   34  #include <sys/modctl.h>
↓ open down ↓ 84 lines elided ↑ open up ↑
 119  119  };
 120  120  
 121  121  /* Serial port interrupt vectors for COM1 to COM4. */
 122  122  static int asy_intrs[] = {0x4, 0x3, 0x4, 0x3};
 123  123  /* Bitfield indicating which interrupts are overridden by eeprom config */
 124  124  static uchar_t asy_intr_override = 0;
 125  125  
 126  126  /*
 127  127   *      Local data
 128  128   */
 129      -static ddi_dma_lim_t ISA_dma_limits = {
 130      -        0,              /* address low                          */
 131      -        0x00ffffff,     /* address high                         */
 132      -        0,              /* counter max                          */
 133      -        1,              /* burstsize                            */
 134      -        DMA_UNIT_8,     /* minimum xfer                         */
 135      -        0,              /* dma speed                            */
 136      -        (uint_t)DMALIM_VER0, /* version                         */
 137      -        0x0000ffff,     /* address register                     */
 138      -        0x0000ffff,     /* counter register                     */
 139      -        1,              /* sector size                          */
 140      -        0x00000001,     /* scatter/gather list length           */
 141      -        (uint_t)0xffffffff /* request size                      */
 142      -};
 143  129  
 144  130  static ddi_dma_attr_t ISA_dma_attr = {
 145  131          DMA_ATTR_V0,
 146  132          (unsigned long long)0,
 147  133          (unsigned long long)0x00ffffff,
 148  134          0x0000ffff,
 149  135          1,
 150  136          1,
 151  137          1,
 152  138          (unsigned long long)0xffffffff,
↓ open down ↓ 418 lines elided ↑ open up ↑
 571  557          ddi_dma_attr_merge(dma_attr, &ISA_dma_attr);
 572  558          return (ddi_dma_allochdl(dip, rdip, dma_attr, waitfp, arg, handlep));
 573  559  }
 574  560  
 575  561  static int
 576  562  isa_dma_mctl(dev_info_t *dip, dev_info_t *rdip,
 577  563      ddi_dma_handle_t handle, enum ddi_dma_ctlops request,
 578  564      off_t *offp, size_t *lenp, caddr_t *objp, uint_t flags)
 579  565  {
 580  566          int rval;
 581      -        ddi_dma_lim_t defalt;
 582  567          int arg = (int)(uintptr_t)objp;
 583  568  
 584  569          switch (request) {
 585  570  
 586  571          case DDI_DMA_E_PROG:
 587  572                  return (i_dmae_prog(rdip, (struct ddi_dmae_req *)offp,
 588  573                      (ddi_dma_cookie_t *)lenp, arg));
 589  574  
 590  575          case DDI_DMA_E_ACQUIRE:
 591  576                  return (i_dmae_acquire(rdip, arg, (int(*)(caddr_t))offp,
↓ open down ↓ 19 lines elided ↑ open up ↑
 611  596                  return (DDI_SUCCESS);
 612  597  
 613  598          case DDI_DMA_E_SWSETUP:
 614  599                  return (i_dmae_swsetup(rdip, (struct ddi_dmae_req *)offp,
 615  600                      (ddi_dma_cookie_t *)lenp, arg));
 616  601  
 617  602          case DDI_DMA_E_SWSTART:
 618  603                  i_dmae_swstart(rdip, arg);
 619  604                  return (DDI_SUCCESS);
 620  605  
 621      -        case DDI_DMA_E_GETLIM:
 622      -                bcopy(&ISA_dma_limits, objp, sizeof (ddi_dma_lim_t));
 623      -                return (DDI_SUCCESS);
 624      -
 625  606          case DDI_DMA_E_GETATTR:
 626  607                  bcopy(&ISA_dma_attr, objp, sizeof (ddi_dma_attr_t));
 627  608                  return (DDI_SUCCESS);
 628  609  
 629  610          case DDI_DMA_E_1STPTY:
 630  611                  {
 631  612                          struct ddi_dmae_req req1stpty =
 632  613                              { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 633  614                          if (arg == 0) {
 634  615                                  req1stpty.der_command = DMAE_CMD_TRAN;
 635  616                                  req1stpty.der_trans = DMAE_TRANS_DMND;
 636  617                          } else {
 637  618                                  req1stpty.der_trans = DMAE_TRANS_CSCD;
 638  619                          }
 639  620                          return (i_dmae_prog(rdip, &req1stpty, NULL, arg));
 640  621                  }
 641  622  
 642      -        case DDI_DMA_IOPB_ALLOC:        /* get contiguous DMA-able memory */
 643      -        case DDI_DMA_SMEM_ALLOC:
 644      -                if (!offp) {
 645      -                        defalt = ISA_dma_limits;
 646      -                        offp = (off_t *)&defalt;
 647      -                }
 648      -                /*FALLTHROUGH*/
 649  623          default:
      624 +                /*
      625 +                 * We pass to rootnex, but it turns out that rootnex will just
      626 +                 * return failure, as we don't use ddi_dma_mctl() except
      627 +                 * for DMA engine (ISA) and DVMA (SPARC).  Arguably we could
      628 +                 * just return an error direclty here, instead.
      629 +                 */
 650  630                  rval = ddi_dma_mctl(dip, rdip, handle, request, offp,
 651  631                      lenp, objp, flags);
 652  632          }
 653  633          return (rval);
 654  634  }
 655  635  
 656  636  /*
 657  637   * Check if driver should be treated as an old pre 2.6 driver
 658  638   */
 659  639  static int
↓ open down ↓ 801 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX