Date: Fri, 18 Oct 2013 16:32:30 GMT From: Brooks Davis <brooks@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 1135118 for review Message-ID: <201310181632.r9IGWUBR001812@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@1135118?ac=10 Change 1135118 by brooks@brooks_zenith on 2013/10/18 16:31:49 Remove support for retrieving ethernet addresses from isf(4), we haven't used it in quite a while and it's going away soon. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atse.c#16 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atse.c#16 (text+ko) ==== @@ -561,72 +561,6 @@ } static int -atse_ethernet_option_bits_read_nexus(device_t dev) -{ - const char *at, *name; - struct resource *res; - long start, end, maddr, msize; - int error, i, rid; - - if (atse_ethernet_option_bits_flag & ATSE_ETHERNET_OPTION_BITS_READ) - return (0); - - /* Find hint.map.name="config" entry. */ - for (i = 0; i < 0x80; i++) { - if (resource_string_value("map", i, "at", &at) != 0) - return (ENOENT); - if (resource_string_value("map", i, "name", &name) != 0) - continue; - if (strcmp(name, "config") != 0) - continue; - /* Found it. */ - break; - } - - error = resource_long_value("map", i, "start", &start); - error += resource_long_value("map", i, "end", &end); - if (error) - return (ENOENT); - - if (start + ALTERA_ETHERNET_OPTION_BITS_OFF + - ALTERA_ETHERNET_OPTION_BITS_LEN > end) - return (EINVAL); - - /* Now find the Intel Flash 0. */ - if (resource_long_value("isf", 0, "maddr", &maddr) != 0) - return (ENOENT); - if (resource_long_value("isf", 0, "msize", &msize) != 0) - return (ENOENT); - - /* Make sure config region maps completely into isf0. */ - if ((end - start) >= msize) - return (EINVAL); - - /* - * For mapping the region shareable, it must be an excat match, - * see subr_rman.c:rman_reserve_resource_bound(). So we must map - * the entire isf0 and later restrict ourselves. - */ - rid = 0; - res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - maddr, maddr + msize, msize, RF_ACTIVE | RF_SHAREABLE); - if (res == NULL) { - device_printf(dev, "Failed to map memory for Ethernet options: " - "0x%08jx+0x%08jx\n", (uintmax_t)maddr, (uintmax_t)msize); - return (ENXIO); - } - - for (i = 0; i < ALTERA_ETHERNET_OPTION_BITS_LEN; i++) - atse_ethernet_option_bits[i] = bus_read_1(res, - start + ALTERA_ETHERNET_OPTION_BITS_OFF + i); - - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); - atse_ethernet_option_bits_flag |= ATSE_ETHERNET_OPTION_BITS_READ; - - return (0); -} - -static int atse_ethernet_option_bits_read_fdt(device_t dev) { struct resource *res; @@ -636,12 +570,9 @@ if (atse_ethernet_option_bits_flag & ATSE_ETHERNET_OPTION_BITS_READ) return (0); - fdev = device_find_child(device_get_parent(dev), "isf", 0); - if (fdev == NULL) { - fdev = device_find_child(device_get_parent(dev), "cfi", 0); - if (fdev == NULL) - return (ENOENT); - } + fdev = device_find_child(device_get_parent(dev), "cfi", 0); + if (fdev == NULL) + return (ENOENT); rid = 0; res = bus_alloc_resource_any(fdev, SYS_RES_MEMORY, &rid, @@ -664,10 +595,6 @@ { int error; - error = atse_ethernet_option_bits_read_nexus(dev); - if (error == 0) - return (0); - error = atse_ethernet_option_bits_read_fdt(dev); if (error == 0) return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310181632.r9IGWUBR001812>