From owner-svn-src-all@FreeBSD.ORG Mon Nov 7 18:19:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 281B2106566B; Mon, 7 Nov 2011 18:19:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F327C8FC16; Mon, 7 Nov 2011 18:19:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7IJKoR090923; Mon, 7 Nov 2011 18:19:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7IJKF5090920; Mon, 7 Nov 2011 18:19:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111071819.pA7IJKF5090920@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 18:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227311 - head/sys/dev/ti X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 18:19:21 -0000 Author: yongari Date: Mon Nov 7 18:19:20 2011 New Revision: 227311 URL: http://svn.freebsd.org/changeset/base/227311 Log: Remove ti_unit member variable in softc. While I'm here use PCIR_BAR macro. Modified: head/sys/dev/ti/if_ti.c head/sys/dev/ti/if_tireg.h Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 16:21:50 2011 (r227310) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 18:19:20 2011 (r227311) @@ -2222,7 +2222,6 @@ ti_attach(device_t dev) u_char eaddr[6]; sc = device_get_softc(dev); - sc->ti_unit = device_get_unit(dev); sc->ti_dev = dev; mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, @@ -2244,7 +2243,7 @@ ti_attach(device_t dev) */ pci_enable_busmaster(dev); - rid = TI_PCI_LOMEM; + rid = PCIR_BAR(0); sc->ti_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -2471,8 +2470,8 @@ ti_attach(device_t dev) */ /* Register the device */ - sc->dev = make_dev(&ti_cdevsw, sc->ti_unit, UID_ROOT, GID_OPERATOR, - 0600, "ti%d", sc->ti_unit); + sc->dev = make_dev(&ti_cdevsw, device_get_unit(dev), UID_ROOT, + GID_OPERATOR, 0600, "ti%d", device_get_unit(dev)); sc->dev->si_drv1 = sc; /* @@ -2563,7 +2562,7 @@ ti_detach(device_t dev) if (sc->ti_irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ti_irq); if (sc->ti_res) { - bus_release_resource(dev, SYS_RES_MEMORY, TI_PCI_LOMEM, + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->ti_res); } if (ifp) @@ -3115,7 +3114,7 @@ static void ti_init2(struct ti_softc *sc ifp = sc->ti_ifp; /* Specify MTU and interface index. */ - CSR_WRITE_4(sc, TI_GCR_IFINDEX, sc->ti_unit); + CSR_WRITE_4(sc, TI_GCR_IFINDEX, device_get_unit(sc->ti_dev)); CSR_WRITE_4(sc, TI_GCR_IFMTU, ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN); TI_DO_CMD(TI_CMD_UPDATE_GENCOM, 0, 0); Modified: head/sys/dev/ti/if_tireg.h ============================================================================== --- head/sys/dev/ti/if_tireg.h Mon Nov 7 16:21:50 2011 (r227310) +++ head/sys/dev/ti/if_tireg.h Mon Nov 7 18:19:20 2011 (r227311) @@ -1000,7 +1000,6 @@ struct ti_softc { struct resource *ti_irq; struct resource *ti_res; struct ifmedia ifmedia; /* media info */ - uint8_t ti_unit; /* interface number */ uint8_t ti_hwrev; /* Tigon rev (1 or 2) */ uint8_t ti_copper; /* 1000baseTX card */ uint8_t ti_linkstat; /* Link state */