cardbus.c (107321) | cardbus.c (109623) |
---|---|
1/* 2 * Copyright (c) 2000,2001 Jonathan Chen. 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 --- 11 unchanged lines hidden (view full) --- 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/* 2 * Copyright (c) 2000,2001 Jonathan Chen. 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 --- 11 unchanged lines hidden (view full) --- 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/cardbus/cardbus.c 107321 2002-11-27 17:30:41Z imp $ | 28 * $FreeBSD: head/sys/dev/cardbus/cardbus.c 109623 2003-01-21 08:56:16Z alfred $ |
29 */ 30 31/* 32 * Cardbus Bus Driver 33 * 34 * much of the bus code was stolen directly from sys/pci/pci.c 35 * (Copyright (c) 1997, Stefan Esser <se@freebsd.org>) 36 * --- 382 unchanged lines hidden (view full) --- 419cardbus_read_device(device_t brdev, int b, int s, int f) 420{ 421#define REG(n, w) PCIB_READ_CONFIG(brdev, b, s, f, n, w) 422 pcicfgregs *cfg = NULL; 423 struct cardbus_devinfo *devlist_entry = NULL; 424 425 if (REG(PCIR_DEVVENDOR, 4) != 0xffffffff) { 426 devlist_entry = malloc(sizeof(struct cardbus_devinfo), | 29 */ 30 31/* 32 * Cardbus Bus Driver 33 * 34 * much of the bus code was stolen directly from sys/pci/pci.c 35 * (Copyright (c) 1997, Stefan Esser <se@freebsd.org>) 36 * --- 382 unchanged lines hidden (view full) --- 419cardbus_read_device(device_t brdev, int b, int s, int f) 420{ 421#define REG(n, w) PCIB_READ_CONFIG(brdev, b, s, f, n, w) 422 pcicfgregs *cfg = NULL; 423 struct cardbus_devinfo *devlist_entry = NULL; 424 425 if (REG(PCIR_DEVVENDOR, 4) != 0xffffffff) { 426 devlist_entry = malloc(sizeof(struct cardbus_devinfo), |
427 M_DEVBUF, M_WAITOK | M_ZERO); | 427 M_DEVBUF, M_ZERO); |
428 if (devlist_entry == NULL) 429 return (NULL); 430 431 cfg = &devlist_entry->pci.cfg; 432 433 cfg->bus = b; 434 cfg->slot = s; 435 cfg->func = f; --- 830 unchanged lines hidden --- | 428 if (devlist_entry == NULL) 429 return (NULL); 430 431 cfg = &devlist_entry->pci.cfg; 432 433 cfg->bus = b; 434 cfg->slot = s; 435 cfg->func = f; --- 830 unchanged lines hidden --- |