| @@ -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; |
39 | struct pci_dev { | | 39 | struct 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 | |
45 | static inline int | | 45 | static inline int |
46 | pci_find_capability(struct pci_dev *pdev, int cap) | | 46 | pci_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 | |
| | | 52 | static inline void |
| | | 53 | pci_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 | |
| | | 58 | static inline void |
| | | 59 | pci_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_ */ |