pci.h (8f61992d7cc1108cebc1337451a15a0af420984c) | pci.h (4b56afaf7bf4fa37bae5b26fd93ee1ff5969c1bb) |
---|---|
1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * Copyright (c) 2020-2022 The FreeBSD Foundation 8 * --- 271 unchanged lines hidden (view full) --- 280{ \ 281 \ 282 linux_pci_unregister_driver(&_driver); \ 283} \ 284 \ 285module_init(_pci_init); \ 286module_exit(_pci_exit) 287 | 1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * Copyright (c) 2020-2022 The FreeBSD Foundation 8 * --- 271 unchanged lines hidden (view full) --- 280{ \ 281 \ 282 linux_pci_unregister_driver(&_driver); \ 283} \ 284 \ 285module_init(_pci_init); \ 286module_exit(_pci_exit) 287 |
288struct msi_msg { 289 uint32_t data; 290}; 291 292struct msi_desc { 293 struct msi_msg msg; 294 struct { 295 bool is_64; 296 } msi_attrib; 297}; 298 |
|
288/* 289 * If we find drivers accessing this from multiple KPIs we may have to 290 * refcount objects of this structure. 291 */ 292struct pci_mmio_region { 293 TAILQ_ENTRY(pci_mmio_region) next; 294 struct resource *res; 295 int rid; --- 10 unchanged lines hidden (view full) --- 306 uint16_t device; 307 uint16_t vendor; 308 uint16_t subsystem_vendor; 309 uint16_t subsystem_device; 310 unsigned int irq; 311 unsigned int devfn; 312 uint32_t class; 313 uint8_t revision; | 299/* 300 * If we find drivers accessing this from multiple KPIs we may have to 301 * refcount objects of this structure. 302 */ 303struct pci_mmio_region { 304 TAILQ_ENTRY(pci_mmio_region) next; 305 struct resource *res; 306 int rid; --- 10 unchanged lines hidden (view full) --- 317 uint16_t device; 318 uint16_t vendor; 319 uint16_t subsystem_vendor; 320 uint16_t subsystem_device; 321 unsigned int irq; 322 unsigned int devfn; 323 uint32_t class; 324 uint8_t revision; |
325 uint8_t msi_cap; |
|
314 bool managed; /* devres "pcim_*(). */ 315 bool want_iomap_res; 316 bool msi_enabled; 317 bool msix_enabled; 318 phys_addr_t rom; 319 size_t romlen; | 326 bool managed; /* devres "pcim_*(). */ 327 bool want_iomap_res; 328 bool msi_enabled; 329 bool msix_enabled; 330 phys_addr_t rom; 331 size_t romlen; |
332 /* 333 * msi_desc should be an array one day? For as long as we only support 334 * 1 MSI vector this is fine. 335 */ 336 struct msi_desc *msi_desc; |
|
320 321 TAILQ_HEAD(, pci_mmio_region) mmio; 322}; 323 324/* We need some meta-struct to keep track of these for devres. */ 325struct pci_devres { 326 bool enable_io; 327 /* PCIR_MAX_BAR_0 + 1 = 6 => BIT(0..5). */ --- 12 unchanged lines hidden (view full) --- 340/* Internal helper function(s). */ 341struct pci_dev *lkpinew_pci_dev(device_t); 342struct pci_devres *lkpi_pci_devres_get_alloc(struct pci_dev *pdev); 343void lkpi_pci_devres_release(struct device *, void *); 344struct resource *_lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size); 345struct pcim_iomap_devres *lkpi_pcim_iomap_devres_find(struct pci_dev *pdev); 346void lkpi_pcim_iomap_table_release(struct device *, void *); 347struct pci_dev *lkpi_pci_get_device(uint16_t, uint16_t, struct pci_dev *); | 337 338 TAILQ_HEAD(, pci_mmio_region) mmio; 339}; 340 341/* We need some meta-struct to keep track of these for devres. */ 342struct pci_devres { 343 bool enable_io; 344 /* PCIR_MAX_BAR_0 + 1 = 6 => BIT(0..5). */ --- 12 unchanged lines hidden (view full) --- 357/* Internal helper function(s). */ 358struct pci_dev *lkpinew_pci_dev(device_t); 359struct pci_devres *lkpi_pci_devres_get_alloc(struct pci_dev *pdev); 360void lkpi_pci_devres_release(struct device *, void *); 361struct resource *_lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size); 362struct pcim_iomap_devres *lkpi_pcim_iomap_devres_find(struct pci_dev *pdev); 363void lkpi_pcim_iomap_table_release(struct device *, void *); 364struct pci_dev *lkpi_pci_get_device(uint16_t, uint16_t, struct pci_dev *); |
365struct msi_desc *lkpi_pci_msi_desc_alloc(int); |
|
348 349static inline bool 350dev_is_pci(struct device *dev) 351{ 352 353 return (device_get_devclass(dev->bsddev) == devclass_find("pci")); 354} 355 --- 1302 unchanged lines hidden --- | 366 367static inline bool 368dev_is_pci(struct device *dev) 369{ 370 371 return (device_get_devclass(dev->bsddev) == devclass_find("pci")); 372} 373 --- 1302 unchanged lines hidden --- |