Sun Dec 19 01:48:13 2021 UTC ()
Define pci_is_thunderbolt_attached (answer: no).


(riastradh)
diff -r1.43 -r1.44 src/sys/external/bsd/drm2/include/linux/pci.h
diff -r1.13 -r1.14 src/sys/external/bsd/drm2/linux/linux_pci.c

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

--- src/sys/external/bsd/drm2/include/linux/pci.h 2021/12/19 01:23:01 1.43
+++ src/sys/external/bsd/drm2/include/linux/pci.h 2021/12/19 01:48:12 1.44
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci.h,v 1.43 2021/12/19 01:23:01 riastradh Exp $ */ 1/* $NetBSD: pci.h,v 1.44 2021/12/19 01:48:12 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.
@@ -199,26 +199,27 @@ struct pci_dev { @@ -199,26 +199,27 @@ struct pci_dev {
199#define pci_disable_rom linux_pci_disable_rom 199#define pci_disable_rom linux_pci_disable_rom
200#define pci_dma_supported linux_pci_dma_supported 200#define pci_dma_supported linux_pci_dma_supported
201#define pci_domain_nr linux_pci_domain_nr 201#define pci_domain_nr linux_pci_domain_nr
202#define pci_enable_msi linux_pci_enable_msi 202#define pci_enable_msi linux_pci_enable_msi
203#define pci_enable_rom linux_pci_enable_rom 203#define pci_enable_rom linux_pci_enable_rom
204#define pci_find_capability linux_pci_find_capability 204#define pci_find_capability linux_pci_find_capability
205#define pci_get_class linux_pci_get_class 205#define pci_get_class linux_pci_get_class
206#define pci_get_domain_bus_and_slot linux_pci_get_domain_bus_and_slot 206#define pci_get_domain_bus_and_slot linux_pci_get_domain_bus_and_slot
207#define pci_get_drvdata linux_pci_get_drvdata 207#define pci_get_drvdata linux_pci_get_drvdata
208#define pci_iomap linux_pci_iomap 208#define pci_iomap linux_pci_iomap
209#define pci_iounmap linux_pci_iounmap 209#define pci_iounmap linux_pci_iounmap
210#define pci_is_pcie linux_pci_is_pcie 210#define pci_is_pcie linux_pci_is_pcie
211#define pci_is_root_bus linux_pci_is_root_bus 211#define pci_is_root_bus linux_pci_is_root_bus
 212#define pci_is_thunderbolt_attached linux_pci_is_thunderbolt_attached
212#define pci_map_rom linux_pci_map_rom 213#define pci_map_rom linux_pci_map_rom
213#define pci_platform_rom linux_pci_platform_rom 214#define pci_platform_rom linux_pci_platform_rom
214#define pci_read_config_byte linux_pci_read_config_byte 215#define pci_read_config_byte linux_pci_read_config_byte
215#define pci_read_config_dword linux_pci_read_config_dword 216#define pci_read_config_dword linux_pci_read_config_dword
216#define pci_read_config_word linux_pci_read_config_word 217#define pci_read_config_word linux_pci_read_config_word
217#define pci_resource_end linux_pci_resource_end 218#define pci_resource_end linux_pci_resource_end
218#define pci_resource_flags linux_pci_resource_flags 219#define pci_resource_flags linux_pci_resource_flags
219#define pci_resource_len linux_pci_resource_len 220#define pci_resource_len linux_pci_resource_len
220#define pci_resource_start linux_pci_resource_start 221#define pci_resource_start linux_pci_resource_start
221#define pci_restore_state linux_pci_restore_state 222#define pci_restore_state linux_pci_restore_state
222#define pci_save_state linux_pci_save_state 223#define pci_save_state linux_pci_save_state
223#define pci_set_drvdata linux_pci_set_drvdata 224#define pci_set_drvdata linux_pci_set_drvdata
224#define pci_set_master linux_pci_set_master 225#define pci_set_master linux_pci_set_master
@@ -237,26 +238,27 @@ void linux_pci_dev_destroy(struct pci_d @@ -237,26 +238,27 @@ void linux_pci_dev_destroy(struct pci_d
237int linux_pci_enable_device(struct pci_dev *); 238int linux_pci_enable_device(struct pci_dev *);
238void linux_pci_disable_device(struct pci_dev *); 239void linux_pci_disable_device(struct pci_dev *);
239 240
240bool pci_is_root_bus(struct pci_bus *); 241bool pci_is_root_bus(struct pci_bus *);
241int pci_domain_nr(struct pci_bus *); 242int pci_domain_nr(struct pci_bus *);
242 243
243device_t pci_dev_dev(struct pci_dev *); 244device_t pci_dev_dev(struct pci_dev *);
244void pci_set_drvdata(struct pci_dev *, void *); 245void pci_set_drvdata(struct pci_dev *, void *);
245void * pci_get_drvdata(struct pci_dev *); 246void * pci_get_drvdata(struct pci_dev *);
246 247
247int pci_find_capability(struct pci_dev *, int); 248int pci_find_capability(struct pci_dev *, int);
248bool pci_is_pcie(struct pci_dev *); 249bool pci_is_pcie(struct pci_dev *);
249bool pci_dma_supported(struct pci_dev *, uintmax_t); 250bool pci_dma_supported(struct pci_dev *, uintmax_t);
 251bool pci_is_thunderbolt_attached(struct pci_dev *);
250 252
251int pci_read_config_dword(struct pci_dev *, int, uint32_t *); 253int pci_read_config_dword(struct pci_dev *, int, uint32_t *);
252int pci_read_config_word(struct pci_dev *, int, uint16_t *); 254int pci_read_config_word(struct pci_dev *, int, uint16_t *);
253int pci_read_config_byte(struct pci_dev *, int, uint8_t *); 255int pci_read_config_byte(struct pci_dev *, int, uint8_t *);
254int pci_write_config_dword(struct pci_dev *, int, uint32_t); 256int pci_write_config_dword(struct pci_dev *, int, uint32_t);
255int pci_write_config_word(struct pci_dev *, int, uint16_t); 257int pci_write_config_word(struct pci_dev *, int, uint16_t);
256int pci_write_config_byte(struct pci_dev *, int, uint8_t); 258int pci_write_config_byte(struct pci_dev *, int, uint8_t);
257 259
258int pci_bus_read_config_dword(struct pci_bus *, unsigned, int, 260int pci_bus_read_config_dword(struct pci_bus *, unsigned, int,
259 uint32_t *); 261 uint32_t *);
260int pci_bus_read_config_word(struct pci_bus *, unsigned, int, 262int pci_bus_read_config_word(struct pci_bus *, unsigned, int,
261 uint16_t *); 263 uint16_t *);
262int pci_bus_read_config_byte(struct pci_bus *, unsigned, int, 264int pci_bus_read_config_byte(struct pci_bus *, unsigned, int,

cvs diff -r1.13 -r1.14 src/sys/external/bsd/drm2/linux/linux_pci.c (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/linux/linux_pci.c 2021/12/19 01:46:52 1.13
+++ src/sys/external/bsd/drm2/linux/linux_pci.c 2021/12/19 01:48:13 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux_pci.c,v 1.13 2021/12/19 01:46:52 riastradh Exp $ */ 1/* $NetBSD: linux_pci.c,v 1.14 2021/12/19 01:48:13 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.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifdef _KERNEL_OPT 32#ifdef _KERNEL_OPT
33#include "opt_pci.h" 33#include "opt_pci.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.13 2021/12/19 01:46:52 riastradh Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.14 2021/12/19 01:48:13 riastradh Exp $");
38 38
39#include <linux/pci.h> 39#include <linux/pci.h>
40 40
41#include <drm/drm_agp_netbsd.h> 41#include <drm/drm_agp_netbsd.h>
42 42
43device_t 43device_t
44pci_dev_dev(struct pci_dev *pdev) 44pci_dev_dev(struct pci_dev *pdev)
45{ 45{
46 46
47 return pdev->pd_dev; 47 return pdev->pd_dev;
48} 48}
49 49
50void 50void
@@ -678,26 +678,34 @@ pci_is_pcie(struct pci_dev *pdev) @@ -678,26 +678,34 @@ pci_is_pcie(struct pci_dev *pdev)
678 678
679bool 679bool
680pci_dma_supported(struct pci_dev *pdev, uintmax_t mask) 680pci_dma_supported(struct pci_dev *pdev, uintmax_t mask)
681{ 681{
682 682
683 /* XXX Cop-out. */ 683 /* XXX Cop-out. */
684 if (mask > DMA_BIT_MASK(32)) 684 if (mask > DMA_BIT_MASK(32))
685 return pci_dma64_available(&pdev->pd_pa); 685 return pci_dma64_available(&pdev->pd_pa);
686 else 686 else
687 return true; 687 return true;
688} 688}
689 689
690bool 690bool
 691pci_is_thunderbolt_attached(struct pci_dev *pdev)
 692{
 693
 694 /* XXX Cop-out. */
 695 return false;
 696}
 697
 698bool
691pci_is_root_bus(struct pci_bus *bus) 699pci_is_root_bus(struct pci_bus *bus)
692{ 700{
693 701
694 /* XXX Cop-out. */ 702 /* XXX Cop-out. */
695 return false; 703 return false;
696} 704}
697 705
698int 706int
699pci_domain_nr(struct pci_bus *bus) 707pci_domain_nr(struct pci_bus *bus)
700{ 708{
701 709
702 return device_unit(bus->pb_dev); 710 return device_unit(bus->pb_dev);
703} 711}