pci.c (29368) | pci.c (31016) |
---|---|
1/* 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/* 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $Id: pci.c,v 1.78 1997/08/02 14:33:12 bde Exp $ | 26 * $Id: pci.c,v 1.79 1997/09/14 03:19:36 peter Exp $ |
27 * 28 */ 29 30#include "pci.h" 31#if NPCI > 0 32 33#include <sys/param.h> 34#include <sys/systm.h> --- 317 unchanged lines hidden (view full) --- 352 cfg->hdrtype &= ~PCIM_MFDEV; 353 354 pci_fixancient(cfg); 355 pci_hdrtypedata(cfg); 356 } 357 return (cfg); 358} 359 | 27 * 28 */ 29 30#include "pci.h" 31#if NPCI > 0 32 33#include <sys/param.h> 34#include <sys/systm.h> --- 317 unchanged lines hidden (view full) --- 352 cfg->hdrtype &= ~PCIM_MFDEV; 353 354 pci_fixancient(cfg); 355 pci_hdrtypedata(cfg); 356 } 357 return (cfg); 358} 359 |
360#if 0 |
|
360/* free pcicfgregs structure and all depending data structures */ 361 362static int 363pci_freecfg(pcicfgregs *cfg) 364{ 365 if (cfg->hdrspec != NULL) 366 free(cfg->hdrspec, M_DEVBUF); 367 if (cfg->map != NULL) 368 free(cfg->map, M_DEVBUF); 369 free(cfg, M_DEVBUF); 370 return (0); 371} | 361/* free pcicfgregs structure and all depending data structures */ 362 363static int 364pci_freecfg(pcicfgregs *cfg) 365{ 366 if (cfg->hdrspec != NULL) 367 free(cfg->hdrspec, M_DEVBUF); 368 if (cfg->map != NULL) 369 free(cfg->map, M_DEVBUF); 370 free(cfg, M_DEVBUF); 371 return (0); 372} |
373#endif |
|
372 373static void 374pci_addcfg(pcicfgregs *cfg) 375{ 376 if (bootverbose) { 377 int i; 378 printf("found->\tvendor=0x%04x, dev=0x%04x, revid=0x%02x\n", 379 cfg->vendor, cfg->device, cfg->revid); --- 106 unchanged lines hidden (view full) --- 486pci_close(dev_t dev, int flag, int devtype, struct proc *p) 487{ 488 return 0; 489} 490 491static int 492pci_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) 493{ | 374 375static void 376pci_addcfg(pcicfgregs *cfg) 377{ 378 if (bootverbose) { 379 int i; 380 printf("found->\tvendor=0x%04x, dev=0x%04x, revid=0x%02x\n", 381 cfg->vendor, cfg->device, cfg->revid); --- 106 unchanged lines hidden (view full) --- 488pci_close(dev_t dev, int flag, int devtype, struct proc *p) 489{ 490 return 0; 491} 492 493static int 494pci_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) 495{ |
494 struct pci_conf_io *cio; | |
495 struct pci_io *io; | 496 struct pci_io *io; |
496 size_t iolen; | |
497 int error; 498 499 if (cmd != PCIOCGETCONF && !(flag & FWRITE)) 500 return EPERM; 501 502 switch(cmd) { 503 case PCIOCGETCONF: 504#ifdef NOTYET --- 90 unchanged lines hidden --- | 497 int error; 498 499 if (cmd != PCIOCGETCONF && !(flag & FWRITE)) 500 return EPERM; 501 502 switch(cmd) { 503 case PCIOCGETCONF: 504#ifdef NOTYET --- 90 unchanged lines hidden --- |