Date: Wed, 30 Dec 2009 20:42:07 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r201278 - head/sys/dev/cardbus Message-ID: <200912302042.nBUKg72W070273@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Wed Dec 30 20:42:07 2009 New Revision: 201278 URL: http://svn.freebsd.org/changeset/base/201278 Log: Use bus_*() rather than bus_space_*(). Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 19:46:09 2009 (r201277) +++ head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 20:42:07 2009 (r201278) @@ -402,16 +402,11 @@ static int cardbus_read_tuple_mem(device_t cbdev, struct resource *res, uint32_t start, uint32_t *off, int *tupleid, int *len, uint8_t *tupledata) { - bus_space_tag_t bt; - bus_space_handle_t bh; int ret; - bt = rman_get_bustag(res); - bh = rman_get_bushandle(res); - - *tupleid = bus_space_read_1(bt, bh, start + *off); - *len = bus_space_read_1(bt, bh, start + *off + 1); - bus_space_read_region_1(bt, bh, *off + start + 2, tupledata, *len); + *tupleid = bus_read_1(res, start + *off); + *len = bus_read_1(res, start + *off + 1); + bus_read_region_1(res, *off + start + 2, tupledata, *len); ret = 0; *off += *len + 2; return (ret); @@ -488,8 +483,6 @@ cardbus_read_tuple_init(device_t cbdev, /* Flip to the right ROM image if CIS is in ROM */ if (space == PCIM_CIS_ASI_ROM) { - bus_space_tag_t bt; - bus_space_handle_t bh; uint32_t imagesize; uint32_t imagebase = 0; uint32_t pcidata; @@ -497,12 +490,9 @@ cardbus_read_tuple_init(device_t cbdev, int romnum = 0; int imagenum; - bt = rman_get_bustag(res); - bh = rman_get_bushandle(res); - imagenum = (*start & PCIM_CIS_ROM_MASK) >> 28; for (romnum = 0;; romnum++) { - romsig = bus_space_read_2(bt, bh, + romsig = bus_read_2(res, imagebase + CARDBUS_EXROM_SIGNATURE); if (romsig != 0xaa55) { device_printf(cbdev, "Bad header in rom %d: " @@ -522,9 +512,9 @@ cardbus_read_tuple_init(device_t cbdev, break; /* Find out where the next Option ROM image is */ - pcidata = imagebase + bus_space_read_2(bt, bh, + pcidata = imagebase + bus_read_2(res, imagebase + CARDBUS_EXROM_DATA_PTR); - imagesize = bus_space_read_2(bt, bh, + imagesize = bus_read_2(res, pcidata + CARDBUS_EXROM_DATA_IMAGE_LENGTH); if (imagesize == 0) { @@ -541,7 +531,7 @@ cardbus_read_tuple_init(device_t cbdev, /* Image size is in 512 byte units */ imagesize <<= 9; - if ((bus_space_read_1(bt, bh, pcidata + + if ((bus_read_1(res, pcidata + CARDBUS_EXROM_DATA_INDICATOR) & 0x80) != 0) { device_printf(cbdev, "Cannot find CIS in " "Option ROM\n");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912302042.nBUKg72W070273>