cvs commit: src/sys/dev/fxp if_fxp.c

Matthew N. Dodd mdodd at FreeBSD.ORG
Tue Apr 15 07:31:26 PDT 2003


On Tue, 15 Apr 2003, M. Warner Losh wrote:
> Yup.  Here's the patch I came up with.  Care to review?

I'd like to read the BARs and see if its enabled so we can emit a warning
if its not (and a driver is requesting it.)

This may be an early notifiation we can provide to users that their box
may not be setup correctly.

Other than that, it looks fine.

> Index: pci.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/pci/pci.c,v
> retrieving revision 1.212
> diff -u -r1.212 pci.c
> --- pci.c	19 Feb 2003 05:47:09 -0000	1.212
> +++ pci.c	15 Apr 2003 14:23:03 -0000
> @@ -1301,21 +1301,33 @@
>  	 * XXX add support here for SYS_RES_IOPORT and SYS_RES_MEMORY
>  	 */
>  	if (device_get_parent(child) == dev) {
> -		/*
> -		 * If the child device doesn't have an interrupt routed
> -		 * and is deserving of an interrupt, try to assign it one.
> -		 */
> -		if ((type == SYS_RES_IRQ) &&
> -		    !PCI_INTERRUPT_VALID(cfg->intline) &&
> -		    (cfg->intpin != 0)) {
> -			cfg->intline = PCIB_ROUTE_INTERRUPT(
> -				device_get_parent(dev), child, cfg->intpin);
> -			if (PCI_INTERRUPT_VALID(cfg->intline)) {
> -				pci_write_config(child, PCIR_INTLINE,
> -				    cfg->intline, 1);
> -				resource_list_add(rl, SYS_RES_IRQ, 0,
> -				    cfg->intline, cfg->intline, 1);
> +		switch (type) {
> +		case SYS_RES_IRQ:
> +			/*
> +			 * If the child device doesn't have an
> +			 * interrupt routed and is deserving of an
> +			 * interrupt, try to assign it one.
> +			 */
> +			if (!PCI_INTERRUPT_VALID(cfg->intline) &&
> +			    (cfg->intpin != 0)) {
> +				cfg->intline = PCIB_ROUTE_INTERRUPT(
> +				    device_get_parent(dev), child, cfg->intpin);
> +				if (PCI_INTERRUPT_VALID(cfg->intline)) {
> +					pci_write_config(child, PCIR_INTLINE,
> +					    cfg->intline, 1);
> +					resource_list_add(rl, SYS_RES_IRQ, 0,
> +					    cfg->intline, cfg->intline, 1);
> +				}
>  			}
> +			break;
> +		case SYS_RES_IOPORT:
> +		case SYS_RES_MEMORY:
> +			/*
> +			 * Enable the I/O mode.  We should also be allocating
> +			 * resources too. XXX
> +			 */
> +			pci_enable_io_method(dev, child, type);
> +			break;
>  		}
>  	}
>
>

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| winter at jurai.net |       2 x '84 Volvo 245DL        | ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |


More information about the cvs-src mailing list