Wed Jul 24 03:00:34 2013 UTC ()
Add pci_config_{read,write}_dword to <linux/pci.h>.


(riastradh)
diff -r1.1.2.2 -r1.1.2.3 src/sys/external/bsd/drm2/include/linux/pci.h

cvs diff -r1.1.2.2 -r1.1.2.3 src/sys/external/bsd/drm2/include/linux/pci.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/include/linux/pci.h 2013/07/24 01:59:37 1.1.2.2
+++ src/sys/external/bsd/drm2/include/linux/pci.h 2013/07/24 03:00:34 1.1.2.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci.h,v 1.1.2.2 2013/07/24 01:59:37 riastradh Exp $ */ 1/* $NetBSD: pci.h,v 1.1.2.3 2013/07/24 03:00:34 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -39,14 +39,26 @@ struct pci_device_id; @@ -39,14 +39,26 @@ struct pci_device_id;
39struct pci_dev { 39struct pci_dev {
40 struct pci_attach_args pd_pa; 40 struct pci_attach_args pd_pa;
41}; 41};
42 42
43#define PCI_CAP_ID_AGP PCI_CAP_AGP 43#define PCI_CAP_ID_AGP PCI_CAP_AGP
44 44
45static inline int 45static inline int
46pci_find_capability(struct pci_dev *pdev, int cap) 46pci_find_capability(struct pci_dev *pdev, int cap)
47{ 47{
48 return pci_get_capability(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag, cap, 48 return pci_get_capability(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag, cap,
49 NULL, NULL); 49 NULL, NULL);
50} 50}
51 51
 52static inline void
 53pci_config_read_dword(struct pci_dev *pdev, int reg, uint32_t *valuep)
 54{
 55 *valuep = pci_conf_read(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag, reg);
 56}
 57
 58static inline void
 59pci_config_write_dword(struct pci_dev *pdev, int reg, uint32_t value)
 60{
 61 pci_conf_write(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag, reg, value);
 62}
 63
52#endif /* _LINUX_PCI_H_ */ 64#endif /* _LINUX_PCI_H_ */