Fri Apr 19 21:24:00 2024 UTC (19d)
s/Resorce/Resource/ in comment and log message.


(andvar)
diff -r1.243 -r1.244 src/sys/dev/pci/pci_subr.c
diff -r1.169 -r1.170 src/sys/dev/pci/pcireg.h

cvs diff -r1.243 -r1.244 src/sys/dev/pci/pci_subr.c (expand / switch to unified diff)

--- src/sys/dev/pci/pci_subr.c 2023/08/10 20:02:56 1.243
+++ src/sys/dev/pci/pci_subr.c 2024/04/19 21:24:00 1.244
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci_subr.c,v 1.243 2023/08/10 20:02:56 andvar Exp $ */ 1/* $NetBSD: pci_subr.c,v 1.244 2024/04/19 21:24:00 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997 Zubin D. Dittia. All rights reserved. 4 * Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
5 * Copyright (c) 1995, 1996, 1998, 2000 5 * Copyright (c) 1995, 1996, 1998, 2000
6 * Christopher G. Demetriou. All rights reserved. 6 * Christopher G. Demetriou. All rights reserved.
7 * Copyright (c) 1994 Charles M. Hannum. All rights reserved. 7 * Copyright (c) 1994 Charles M. Hannum. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35/* 35/*
36 * PCI autoconfiguration support functions. 36 * PCI autoconfiguration support functions.
37 * 37 *
38 * Note: This file is also built into a userland library (libpci). 38 * Note: This file is also built into a userland library (libpci).
39 * Pay attention to this when you make modifications. 39 * Pay attention to this when you make modifications.
40 */ 40 */
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.243 2023/08/10 20:02:56 andvar Exp $"); 43__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.244 2024/04/19 21:24:00 andvar Exp $");
44 44
45#ifdef _KERNEL_OPT 45#ifdef _KERNEL_OPT
46#include "opt_pci.h" 46#include "opt_pci.h"
47#endif 47#endif
48 48
49#include <sys/param.h> 49#include <sys/param.h>
50 50
51#ifdef _KERNEL 51#ifdef _KERNEL
52#include <sys/systm.h> 52#include <sys/systm.h>
53#include <sys/intr.h> 53#include <sys/intr.h>
54#include <sys/module.h> 54#include <sys/module.h>
55#include <sys/kmem.h> 55#include <sys/kmem.h>
56 56
@@ -2549,30 +2549,30 @@ pci_conf_print_ea_cap_prop(unsigned int  @@ -2549,30 +2549,30 @@ pci_conf_print_ea_cap_prop(unsigned int
2549{ 2549{
2550 2550
2551 switch (prop) { 2551 switch (prop) {
2552 case PCI_EA_PROP_MEM_NONPREF: 2552 case PCI_EA_PROP_MEM_NONPREF:
2553 printf("Memory Space, Non-Prefetchable\n"); 2553 printf("Memory Space, Non-Prefetchable\n");
2554 break; 2554 break;
2555 case PCI_EA_PROP_MEM_PREF: 2555 case PCI_EA_PROP_MEM_PREF:
2556 printf("Memory Space, Prefetchable\n"); 2556 printf("Memory Space, Prefetchable\n");
2557 break; 2557 break;
2558 case PCI_EA_PROP_IO: 2558 case PCI_EA_PROP_IO:
2559 printf("I/O Space\n"); 2559 printf("I/O Space\n");
2560 break; 2560 break;
2561 case PCI_EA_PROP_VF_MEM_NONPREF: 2561 case PCI_EA_PROP_VF_MEM_NONPREF:
2562 printf("Resorce for VF use, Memory Space, Non-Prefetchable\n"); 2562 printf("Resource for VF use, Memory Space, Non-Prefetchable\n");
2563 break; 2563 break;
2564 case PCI_EA_PROP_VF_MEM_PREF: 2564 case PCI_EA_PROP_VF_MEM_PREF:
2565 printf("Resorce for VF use, Memory Space, Prefetch\n"); 2565 printf("Resource for VF use, Memory Space, Prefetch\n");
2566 break; 2566 break;
2567 case PCI_EA_PROP_BB_MEM_NONPREF: 2567 case PCI_EA_PROP_BB_MEM_NONPREF:
2568 printf("Behind the Bridge, Memory Space, Non-Pref\n"); 2568 printf("Behind the Bridge, Memory Space, Non-Pref\n");
2569 break; 2569 break;
2570 case PCI_EA_PROP_BB_MEM_PREF: 2570 case PCI_EA_PROP_BB_MEM_PREF:
2571 printf("Behind the Bridge, Memory Space. Prefetchable\n"); 2571 printf("Behind the Bridge, Memory Space. Prefetchable\n");
2572 break; 2572 break;
2573 case PCI_EA_PROP_BB_IO: 2573 case PCI_EA_PROP_BB_IO:
2574 printf("Behind Bridge, I/O Space\n"); 2574 printf("Behind Bridge, I/O Space\n");
2575 break; 2575 break;
2576 case PCI_EA_PROP_MEM_UNAVAIL: 2576 case PCI_EA_PROP_MEM_UNAVAIL:
2577 printf("Memory Space Unavailable\n"); 2577 printf("Memory Space Unavailable\n");
2578 break; 2578 break;

cvs diff -r1.169 -r1.170 src/sys/dev/pci/pcireg.h (expand / switch to unified diff)

--- src/sys/dev/pci/pcireg.h 2024/02/02 22:19:13 1.169
+++ src/sys/dev/pci/pcireg.h 2024/04/19 21:24:00 1.170
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pcireg.h,v 1.169 2024/02/02 22:19:13 andvar Exp $ */ 1/* $NetBSD: pcireg.h,v 1.170 2024/04/19 21:24:00 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995, 1996, 1999, 2000 4 * Copyright (c) 1995, 1996, 1999, 2000
5 * Christopher G. Demetriou. All rights reserved. 5 * Christopher G. Demetriou. All rights reserved.
6 * Copyright (c) 1994, 1996 Charles M. Hannum. All rights reserved. 6 * Copyright (c) 1994, 1996 Charles M. Hannum. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -1953,28 +1953,28 @@ struct pci_rom { @@ -1953,28 +1953,28 @@ struct pci_rom {
1953#define PCI_EA_BEI_VFBAR0 9 /* VF BAR0 */ 1953#define PCI_EA_BEI_VFBAR0 9 /* VF BAR0 */
1954#define PCI_EA_BEI_VFBAR1 10 /* VF BAR1 */ 1954#define PCI_EA_BEI_VFBAR1 10 /* VF BAR1 */
1955#define PCI_EA_BEI_VFBAR2 11 /* VF BAR2 */ 1955#define PCI_EA_BEI_VFBAR2 11 /* VF BAR2 */
1956#define PCI_EA_BEI_VFBAR3 12 /* VF BAR3 */ 1956#define PCI_EA_BEI_VFBAR3 12 /* VF BAR3 */
1957#define PCI_EA_BEI_VFBAR4 13 /* VF BAR4 */ 1957#define PCI_EA_BEI_VFBAR4 13 /* VF BAR4 */
1958#define PCI_EA_BEI_VFBAR5 14 /* VF BAR5 */ 1958#define PCI_EA_BEI_VFBAR5 14 /* VF BAR5 */
1959#define PCI_EA_BEI_RESERVED 15 /* Reserved (treat as Not Indicated) */ 1959#define PCI_EA_BEI_RESERVED 15 /* Reserved (treat as Not Indicated) */
1960#define PCI_EA_PP __BITS(15, 8) /* Primary Properties */ 1960#define PCI_EA_PP __BITS(15, 8) /* Primary Properties */
1961#define PCI_EA_SP __BITS(23, 16) /* Secondary Properties */ 1961#define PCI_EA_SP __BITS(23, 16) /* Secondary Properties */
1962/* PP and SP's values */ 1962/* PP and SP's values */
1963#define PCI_EA_PROP_MEM_NONPREF 0x00 /* Memory Space, Non-Prefetchable */ 1963#define PCI_EA_PROP_MEM_NONPREF 0x00 /* Memory Space, Non-Prefetchable */
1964#define PCI_EA_PROP_MEM_PREF 0x01 /* Memory Space, Prefetchable */ 1964#define PCI_EA_PROP_MEM_PREF 0x01 /* Memory Space, Prefetchable */
1965#define PCI_EA_PROP_IO 0x02 /* I/O Space */ 1965#define PCI_EA_PROP_IO 0x02 /* I/O Space */
1966#define PCI_EA_PROP_VF_MEM_NONPREF 0x03 /* Resorce for VF use. Mem. Non-Pref */ 1966#define PCI_EA_PROP_VF_MEM_NONPREF 0x03 /* Resource for VF use. Mem. Non-Pref */
1967#define PCI_EA_PROP_VF_MEM_PREF 0x04 /* Resorce for VF use. Mem. Prefetch */ 1967#define PCI_EA_PROP_VF_MEM_PREF 0x04 /* Resource for VF use. Mem. Prefetch */
1968#define PCI_EA_PROP_BB_MEM_NONPREF 0x05 /* Behind Bridge: MEM. Non-Pref */ 1968#define PCI_EA_PROP_BB_MEM_NONPREF 0x05 /* Behind Bridge: MEM. Non-Pref */
1969#define PCI_EA_PROP_BB_MEM_PREF 0x06 /* Behind Bridge: MEM. Prefetch */ 1969#define PCI_EA_PROP_BB_MEM_PREF 0x06 /* Behind Bridge: MEM. Prefetch */
1970#define PCI_EA_PROP_BB_IO 0x07 /* Behind Bridge: I/O Space */ 1970#define PCI_EA_PROP_BB_IO 0x07 /* Behind Bridge: I/O Space */
1971#define PCI_EA_PROP_MEM_UNAVAIL 0xfd /* Memory Space Unavailable */ 1971#define PCI_EA_PROP_MEM_UNAVAIL 0xfd /* Memory Space Unavailable */
1972#define PCI_EA_PROP_IO_UNAVAIL 0xfe /* IO Space Unavailable */ 1972#define PCI_EA_PROP_IO_UNAVAIL 0xfe /* IO Space Unavailable */
1973#define PCI_EA_PROP_UNAVAIL 0xff /* Entry Unavailable for use */ 1973#define PCI_EA_PROP_UNAVAIL 0xff /* Entry Unavailable for use */
1974#define PCI_EA_W __BIT(30) /* Writable */ 1974#define PCI_EA_W __BIT(30) /* Writable */
1975#define PCI_EA_E __BIT(31) /* Enable for this entry */ 1975#define PCI_EA_E __BIT(31) /* Enable for this entry */
1976 1976
1977#define PCI_EA_LOWMASK __BITS(31, 2) /* Low register's mask */ 1977#define PCI_EA_LOWMASK __BITS(31, 2) /* Low register's mask */
1978#define PCI_EA_BASEMAXOFFSET_S __BIT(1) /* Field Size */ 1978#define PCI_EA_BASEMAXOFFSET_S __BIT(1) /* Field Size */
1979#define PCI_EA_BASEMAXOFFSET_64BIT __BIT(1) /* 64bit */ 1979#define PCI_EA_BASEMAXOFFSET_64BIT __BIT(1) /* 64bit */
1980#define PCI_EA_BASEMAXOFFSET_32BIT 0 /* 32bit */ 1980#define PCI_EA_BASEMAXOFFSET_32BIT 0 /* 32bit */