The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/marvell/gtpcivar.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: gtpcivar.h,v 1.5 2003/06/12 19:18:49 scw Exp $ */
    2 
    3 /*
    4  * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
    5  * All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. Redistributions in binary form must reproduce the above copyright
   13  *    notice, this list of conditions and the following disclaimer in the
   14  *    documentation and/or other materials provided with the distribution.
   15  * 3. All advertising materials mentioning features or use of this software
   16  *    must display the following acknowledgement:
   17  *      This product includes software developed for the NetBSD Project by
   18  *      Allegro Networks, Inc., and Wasabi Systems, Inc.
   19  * 4. The name of Allegro Networks, Inc. may not be used to endorse
   20  *    or promote products derived from this software without specific prior
   21  *    written permission.
   22  * 5. The name of Wasabi Systems, Inc. may not be used to endorse
   23  *    or promote products derived from this software without specific prior
   24  *    written permission.
   25  *
   26  * THIS SOFTWARE IS PROVIDED BY ALLEGRO NETWORKS, INC. AND
   27  * WASABI SYSTEMS, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
   28  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
   29  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   30  * IN NO EVENT SHALL EITHER ALLEGRO NETWORKS, INC. OR WASABI SYSTEMS, INC.
   31  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   37  * POSSIBILITY OF SUCH DAMAGE.
   38  */
   39 
   40 #ifndef _DEV_MARVELL_GTPCIVAR_H
   41 #define _DEV_MARVELL_GTPCIVAR_H
   42 
   43 /*
   44  */
   45 struct gtpci_chipset {
   46         struct pci_chipset gtpc_pc;
   47         int gtpc_busno;
   48         pcitag_t gtpc_self;
   49         bus_space_tag_t gtpc_io_bs;
   50         bus_space_tag_t gtpc_mem_bs;
   51         bus_space_tag_t gtpc_gt_memt;
   52         bus_space_handle_t gtpc_gt_memh;
   53         bus_size_t gtpc_cfgaddr;
   54         bus_size_t gtpc_cfgdata;
   55         bus_size_t gtpc_syncreg;
   56         boolean_t gtpc_host;
   57 };
   58 
   59 
   60 #ifdef _KERNEL
   61 static uint32_t __inline
   62 gtpci_read(struct gtpci_chipset *gtpc, bus_size_t reg)
   63 {
   64         uint32_t rv;
   65         (void) bus_space_read_4(gtpc->gtpc_gt_memt, gtpc->gtpc_gt_memh,
   66             gtpc->gtpc_syncreg);
   67         rv = bus_space_read_4(gtpc->gtpc_gt_memt, gtpc->gtpc_gt_memh, reg);
   68         (void) bus_space_read_4(gtpc->gtpc_gt_memt, gtpc->gtpc_gt_memh,
   69             gtpc->gtpc_syncreg);
   70         return rv;
   71 }
   72 
   73 static void __inline
   74 gtpci_write(struct gtpci_chipset *gtpc, bus_size_t reg, uint32_t val)
   75 {
   76         (void) bus_space_read_4(gtpc->gtpc_gt_memt, gtpc->gtpc_gt_memh,
   77             gtpc->gtpc_syncreg);
   78         bus_space_write_4(gtpc->gtpc_gt_memt, gtpc->gtpc_gt_memh, reg, val);
   79         (void) bus_space_read_4(gtpc->gtpc_gt_memt, gtpc->gtpc_gt_memh,
   80             gtpc->gtpc_syncreg);
   81 }
   82 
   83 void    gtpci_bus_configure(struct gtpci_chipset *);
   84 
   85 pcitag_t gtpci_make_tag(pci_chipset_tag_t, int, int, int);
   86 void    gtpci_decompose_tag(pci_chipset_tag_t, pcitag_t, int *, int *, int *);
   87 pcireg_t gtpci_conf_read(pci_chipset_tag_t, pcitag_t, int);
   88 void    gtpci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
   89 
   90 void    gtpci_md_bus_devorder(pci_chipset_tag_t, int, char []);
   91 int     gtpci_md_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
   92 int     gtpci_md_conf_hook(pci_chipset_tag_t, int, int, int, pcireg_t);
   93 void    gtpci_md_conf_interrupt(pci_chipset_tag_t, int, int, int, int, int *);
   94 #endif /* _KERNEL */
   95 
   96 #endif /* _DEV_MARVELL_GTPCIVAR_H */

Cache object: 222aae24a91139e6292e7d4b9395d896


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.