From owner-p4-projects@FreeBSD.ORG Mon Dec 4 23:02:34 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F400216A4D0; Mon, 4 Dec 2006 23:02:33 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDAC716A4C9 for ; Mon, 4 Dec 2006 23:02:33 +0000 (UTC) (envelope-from jkim@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 918E743CC4 for ; Mon, 4 Dec 2006 23:01:52 +0000 (GMT) (envelope-from jkim@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kB4N2Rcx048955 for ; Mon, 4 Dec 2006 23:02:27 GMT (envelope-from jkim@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kB4N2Q6a048949 for perforce@freebsd.org; Mon, 4 Dec 2006 23:02:26 GMT (envelope-from jkim@freebsd.org) Date: Mon, 4 Dec 2006 23:02:26 GMT Message-Id: <200612042302.kB4N2Q6a048949@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jkim@freebsd.org using -f From: Jung-uk Kim To: Perforce Change Reviews Cc: Subject: PERFORCE change 111079 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2006 23:02:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=111079 Change 111079 by jkim@jkim_hammer on 2006/12/04 23:02:01 IFC Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/conf/GENERIC#6 integrate .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysvec.c#6 integrate .. //depot/projects/linuxolator/src/sys/arm/arm/pmap.c#5 integrate .. //depot/projects/linuxolator/src/sys/compat/linsysfs/linsysfs.c#3 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#42 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_stats.c#6 integrate .. //depot/projects/linuxolator/src/sys/dev/bge/if_bge.c#7 integrate .. //depot/projects/linuxolator/src/sys/dev/bge/if_bgereg.h#4 integrate .. //depot/projects/linuxolator/src/sys/dev/hme/if_hme.c#2 integrate .. //depot/projects/linuxolator/src/sys/fs/msdosfs/msdosfs_vnops.c#4 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_thr.c#6 integrate .. //depot/projects/linuxolator/src/sys/kern/kern_umtx.c#8 integrate .. //depot/projects/linuxolator/src/sys/kern/subr_lock.c#4 integrate .. //depot/projects/linuxolator/src/sys/kern/subr_rman.c#3 integrate .. //depot/projects/linuxolator/src/sys/net/bridgestp.c#7 integrate .. //depot/projects/linuxolator/src/sys/net/bridgestp.h#5 integrate .. //depot/projects/linuxolator/src/sys/net/if_bridge.c#9 integrate .. //depot/projects/linuxolator/src/sys/net/if_bridgevar.h#5 integrate .. //depot/projects/linuxolator/src/sys/netinet/igmp.c#3 integrate .. //depot/projects/linuxolator/src/sys/sun4v/conf/GENERIC#5 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/tsb.h#3 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/pmap.c#7 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/tsb.c#4 integrate .. //depot/projects/linuxolator/src/sys/sys/proc.h#7 integrate .. //depot/projects/linuxolator/src/sys/sys/umtx.h#6 integrate Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/conf/GENERIC#6 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.469 2006/11/22 10:34:12 ru Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.470 2006/12/03 21:02:09 netchild Exp $ cpu HAMMER ident GENERIC @@ -71,11 +71,6 @@ # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel -# Linux 32-bit ABI support -options COMPAT_LINUX32 # Compatible with i386 linux binaries -options LINPROCFS -options LINSYSFS - # Bus support. device acpi device pci ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysvec.c#6 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.25 2006/10/31 17:53:02 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.26 2006/12/03 21:06:07 netchild Exp $"); #include "opt_compat.h" #ifndef COMPAT_IA32 ==== //depot/projects/linuxolator/src/sys/arm/arm/pmap.c#5 (text+ko) ==== @@ -147,7 +147,7 @@ #include "opt_vm.h" #include -__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.76 2006/12/01 12:29:55 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.77 2006/12/04 12:55:00 cognet Exp $"); #include #include #include @@ -2807,6 +2807,7 @@ if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_flag_clear(m, PG_WRITEABLE); pmap_free_pv_entry(pv); + pmap_free_l2_bucket(pmap, l2b, 1); } vm_page_unlock_queues(); cpu_idcache_wbinv_all(); ==== //depot/projects/linuxolator/src/sys/compat/linsysfs/linsysfs.c#3 (text) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linsysfs/linsysfs.c,v 1.2 2006/05/11 15:27:58 ambrisko Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linsysfs/linsysfs.c,v 1.3 2006/12/03 21:00:31 netchild Exp $"); #include #include @@ -268,10 +268,10 @@ static int linsysfs_uninit(PFS_INIT_ARGS) { - struct scsi_host_queue *scsi_host, *scsi_host_temp; + struct scsi_host_queue *scsi_host, *scsi_host_tmp; - TAILQ_FOREACH_SAFE(scsi_host, &scsi_host_q, scsi_host_next, - scsi_host_temp) { + TAILQ_FOREACH_SAFE(scsi_host, &scsi_host_q, scsi_host_next, + scsi_host_tmp) { TAILQ_REMOVE(&scsi_host_q, scsi_host, scsi_host_next); free(scsi_host->path, M_TEMP); free(scsi_host, M_TEMP); ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#42 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.198 2006/12/02 14:56:25 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.199 2006/12/04 22:46:09 jkim Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_stats.c#6 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_stats.c,v 1.85 2006/10/22 11:52:11 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_stats.c,v 1.86 2006/12/04 22:38:52 jkim Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/linuxolator/src/sys/dev/bge/if_bge.c#7 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.154 2006/12/01 01:37:45 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.157 2006/12/04 22:12:21 jkim Exp $"); /* * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. @@ -281,36 +281,12 @@ { 0, NULL } }; -#define BGE_IS_5705_OR_BEYOND(sc) \ - ((sc)->bge_asicrev == BGE_ASICREV_BCM5705 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5750 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5714_A0 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5780 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5714 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5752 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5755 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5787) +#define BGE_IS_JUMBO_CAPABLE(sc) ((sc)->bge_flags & BGE_FLAG_JUMBO) +#define BGE_IS_5700_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5700_FAMILY) +#define BGE_IS_5705_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5705_PLUS) +#define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5714_FAMILY) +#define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) -#define BGE_IS_575X_PLUS(sc) \ - ((sc)->bge_asicrev == BGE_ASICREV_BCM5750 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5714_A0 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5780 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5714 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5752 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5755 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5787) - -#define BGE_IS_5714_FAMILY(sc) \ - ((sc)->bge_asicrev == BGE_ASICREV_BCM5714_A0 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5780 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5714) - -#define BGE_IS_JUMBO_CAPABLE(sc) \ - ((sc)->bge_asicrev == BGE_ASICREV_BCM5700 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5701 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5703 || \ - (sc)->bge_asicrev == BGE_ASICREV_BCM5704) - const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); static int bge_probe(device_t); @@ -1229,23 +1205,13 @@ /* Note: the BCM5704 has a smaller mbuf space than other chips. */ - if (!(BGE_IS_5705_OR_BEYOND(sc))) { + if (!(BGE_IS_5705_PLUS(sc))) { /* Configure mbuf memory pool */ - if (sc->bge_flags & BGE_FLAG_EXTRAM) { - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_BASEADDR, - BGE_EXT_SSRAM); - if (sc->bge_asicrev == BGE_ASICREV_BCM5704) - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_LEN, 0x10000); - else - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_LEN, 0x18000); - } else { - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_BASEADDR, - BGE_BUFFPOOL_1); - if (sc->bge_asicrev == BGE_ASICREV_BCM5704) - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_LEN, 0x10000); - else - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_LEN, 0x18000); - } + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_BASEADDR, BGE_BUFFPOOL_1); + if (sc->bge_asicrev == BGE_ASICREV_BCM5704) + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_LEN, 0x10000); + else + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_LEN, 0x18000); /* Configure DMA resource pool */ CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_BASEADDR, @@ -1254,7 +1220,7 @@ } /* Configure mbuf pool watermarks */ - if (!(BGE_IS_5705_OR_BEYOND(sc))) { + if (!(BGE_IS_5705_PLUS(sc))) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0); CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x10); } else { @@ -1268,7 +1234,7 @@ CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_HIWAT, 10); /* Enable buffer manager */ - if (!(BGE_IS_5705_OR_BEYOND(sc))) { + if (!(BGE_IS_5705_PLUS(sc))) { CSR_WRITE_4(sc, BGE_BMAN_MODE, BGE_BMANMODE_ENABLE|BGE_BMANMODE_LOMBUF_ATTN); @@ -1310,15 +1276,12 @@ BGE_ADDR_HI(sc->bge_ldata.bge_rx_std_ring_paddr); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREREAD); - if (BGE_IS_5705_OR_BEYOND(sc)) + if (BGE_IS_5705_PLUS(sc)) rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(512, 0); else rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); - if (sc->bge_flags & BGE_FLAG_EXTRAM) - rcb->bge_nicaddr = BGE_EXT_STD_RX_RINGS; - else - rcb->bge_nicaddr = BGE_STD_RX_RINGS; + rcb->bge_nicaddr = BGE_STD_RX_RINGS; CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_HI, rcb->bge_hostaddr.bge_addr_hi); CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_LO, rcb->bge_hostaddr.bge_addr_lo); @@ -1344,10 +1307,7 @@ BUS_DMASYNC_PREREAD); rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD|BGE_RCB_FLAG_RING_DISABLED); - if (sc->bge_flags & BGE_FLAG_EXTRAM) - rcb->bge_nicaddr = BGE_EXT_JUMBO_RX_RINGS; - else - rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; + rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_HI, rcb->bge_hostaddr.bge_addr_hi); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_LO, @@ -1393,7 +1353,7 @@ RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); RCB_WRITE_4(sc, vrcb, bge_nicaddr, BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT)); - if (!(BGE_IS_5705_OR_BEYOND(sc))) + if (!(BGE_IS_5705_PLUS(sc))) RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, BGE_RCB_MAXLEN_FLAGS(BGE_TX_RING_CNT, 0)); @@ -1477,7 +1437,7 @@ CSR_WRITE_4(sc, BGE_HCC_TX_COAL_TICKS, sc->bge_tx_coal_ticks); CSR_WRITE_4(sc, BGE_HCC_RX_MAX_COAL_BDS, sc->bge_rx_max_coal_bds); CSR_WRITE_4(sc, BGE_HCC_TX_MAX_COAL_BDS, sc->bge_tx_max_coal_bds); - if (!(BGE_IS_5705_OR_BEYOND(sc))) { + if (!(BGE_IS_5705_PLUS(sc))) { CSR_WRITE_4(sc, BGE_HCC_RX_COAL_TICKS_INT, 0); CSR_WRITE_4(sc, BGE_HCC_TX_COAL_TICKS_INT, 0); } @@ -1485,7 +1445,7 @@ CSR_WRITE_4(sc, BGE_HCC_TX_MAX_COAL_BDS_INT, 0); /* Set up address of statistics block */ - if (!(BGE_IS_5705_OR_BEYOND(sc))) { + if (!(BGE_IS_5705_PLUS(sc))) { CSR_WRITE_4(sc, BGE_HCC_STATS_ADDR_HI, BGE_ADDR_HI(sc->bge_ldata.bge_stats_paddr)); CSR_WRITE_4(sc, BGE_HCC_STATS_ADDR_LO, @@ -1514,7 +1474,7 @@ CSR_WRITE_4(sc, BGE_RXLP_MODE, BGE_RXLPMODE_ENABLE); /* Turn on RX list selector state machine. */ - if (!(BGE_IS_5705_OR_BEYOND(sc))) + if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); /* Turn on DMA, clear stats */ @@ -1537,7 +1497,7 @@ #endif /* Turn on DMA completion state machine */ - if (!(BGE_IS_5705_OR_BEYOND(sc))) + if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_DMAC_MODE, BGE_DMACMODE_ENABLE); /* Turn on write DMA state machine */ @@ -1558,7 +1518,7 @@ CSR_WRITE_4(sc, BGE_RDBDI_MODE, BGE_RDBDIMODE_ENABLE); /* Turn on Mbuf cluster free state machine */ - if (!(BGE_IS_5705_OR_BEYOND(sc))) + if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_MBCF_MODE, BGE_MBCFMODE_ENABLE); /* Turn on send BD completion state machine */ @@ -2156,11 +2116,38 @@ sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); + /* Save chipset family. */ + switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5700: + case BGE_ASICREV_BCM5701: + case BGE_ASICREV_BCM5703: + case BGE_ASICREV_BCM5704: + sc->bge_flags |= BGE_FLAG_5700_FAMILY | BGE_FLAG_JUMBO; + break; + + case BGE_ASICREV_BCM5714_A0: + case BGE_ASICREV_BCM5780: + case BGE_ASICREV_BCM5714: + sc->bge_flags |= BGE_FLAG_5714_FAMILY /* | BGE_FLAG_JUMBO */; + /* Fall through */ + + case BGE_ASICREV_BCM5750: + case BGE_ASICREV_BCM5752: + case BGE_ASICREV_BCM5755: + case BGE_ASICREV_BCM5787: + sc->bge_flags |= BGE_FLAG_575X_PLUS; + /* Fall through */ + + case BGE_ASICREV_BCM5705: + sc->bge_flags |= BGE_FLAG_5705_PLUS; + break; + } + /* * XXX: Broadcom Linux driver. Not in specs or eratta. * PCI-Express? */ - if (BGE_IS_5705_OR_BEYOND(sc)) { + if (BGE_IS_5705_PLUS(sc)) { uint32_t v; v = pci_read_config(dev, BGE_PCI_MSI_CAPID, 4); @@ -2240,7 +2227,7 @@ } /* 5705 limits RX return ring to 512 entries. */ - if (BGE_IS_5705_OR_BEYOND(sc)) + if (BGE_IS_5705_PLUS(sc)) sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705; else sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT; @@ -2944,7 +2931,7 @@ BGE_LOCK_ASSERT(sc); - if (BGE_IS_5705_OR_BEYOND(sc)) + if (BGE_IS_5705_PLUS(sc)) bge_stats_update_regs(sc); else bge_stats_update(sc); @@ -3661,7 +3648,7 @@ if_printf(ifp, "watchdog timeout -- resetting\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - bge_init(sc); + bge_init_locked(sc); ifp->if_oerrors++; } @@ -3693,7 +3680,7 @@ BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); BGE_CLRBIT(sc, BGE_RBDI_MODE, BGE_RBDIMODE_ENABLE); BGE_CLRBIT(sc, BGE_RXLP_MODE, BGE_RXLPMODE_ENABLE); - if (!(BGE_IS_5705_OR_BEYOND(sc))) + if (!(BGE_IS_5705_PLUS(sc))) BGE_CLRBIT(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); BGE_CLRBIT(sc, BGE_RDBDI_MODE, BGE_RBDIMODE_ENABLE); BGE_CLRBIT(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE); @@ -3707,7 +3694,7 @@ BGE_CLRBIT(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); BGE_CLRBIT(sc, BGE_RDMA_MODE, BGE_RDMAMODE_ENABLE); BGE_CLRBIT(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE); - if (!(BGE_IS_5705_OR_BEYOND(sc))) + if (!(BGE_IS_5705_PLUS(sc))) BGE_CLRBIT(sc, BGE_DMAC_MODE, BGE_DMACMODE_ENABLE); BGE_CLRBIT(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE); @@ -3717,11 +3704,11 @@ */ BGE_CLRBIT(sc, BGE_HCC_MODE, BGE_HCCMODE_ENABLE); BGE_CLRBIT(sc, BGE_WDMA_MODE, BGE_WDMAMODE_ENABLE); - if (!(BGE_IS_5705_OR_BEYOND(sc))) + if (!(BGE_IS_5705_PLUS(sc))) BGE_CLRBIT(sc, BGE_MBCF_MODE, BGE_MBCFMODE_ENABLE); CSR_WRITE_4(sc, BGE_FTQ_RESET, 0xFFFFFFFF); CSR_WRITE_4(sc, BGE_FTQ_RESET, 0); - if (!(BGE_IS_5705_OR_BEYOND(sc))) { + if (!(BGE_IS_5705_PLUS(sc))) { BGE_CLRBIT(sc, BGE_BMAN_MODE, BGE_BMANMODE_ENABLE); BGE_CLRBIT(sc, BGE_MARB_MODE, BGE_MARBMODE_ENABLE); } ==== //depot/projects/linuxolator/src/sys/dev/bge/if_bgereg.h#4 (text+ko) ==== @@ -30,7 +30,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.58 2006/12/01 01:08:52 jkim Exp $ + * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.60 2006/12/04 22:12:21 jkim Exp $ */ /* @@ -2455,12 +2455,17 @@ struct resource *bge_res; struct ifmedia bge_ifmedia; /* TBI media info */ uint32_t bge_flags; -#define BGE_FLAG_EXTRAM 0x00000001 /* Has external SSRAM. */ +#define BGE_FLAG_EXTRAM 0x00000001 /* External SSRAM (unused) */ #define BGE_FLAG_TBI 0x00000002 #define BGE_FLAG_RX_ALIGNBUG 0x00000004 #define BGE_FLAG_NO3LED 0x00000008 #define BGE_FLAG_PCIX 0x00000010 #define BGE_FLAG_PCIE 0x00000020 +#define BGE_FLAG_JUMBO 0x00000040 +#define BGE_FLAG_5700_FAMILY 0x00000100 +#define BGE_FLAG_5705_PLUS 0x00000200 +#define BGE_FLAG_5714_FAMILY 0x00000400 +#define BGE_FLAG_575X_PLUS 0x00000800 uint32_t bge_chipid; uint8_t bge_asicrev; uint8_t bge_chiprev; ==== //depot/projects/linuxolator/src/sys/dev/hme/if_hme.c#2 (text+ko) ==== @@ -34,11 +34,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * from: NetBSD: hme.c,v 1.29 2002/05/05 03:02:38 thorpej Exp + * from: NetBSD: hme.c,v 1.35 2003/02/27 14:58:22 pk Exp */ #include -__FBSDID("$FreeBSD: src/sys/dev/hme/if_hme.c,v 1.49 2006/08/12 01:19:37 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/hme/if_hme.c,v 1.51 2006/12/04 01:53:40 marius Exp $"); /* * HME Ethernet module driver. @@ -115,6 +115,7 @@ static void hme_setladrf(struct hme_softc *, int); static int hme_mediachange(struct ifnet *); +static int hme_mediachange_locked(struct hme_softc *); static void hme_mediastatus(struct ifnet *, struct ifmediareq *); static int hme_load_txmbuf(struct hme_softc *, struct mbuf **); @@ -310,19 +311,21 @@ /* * Walk along the list of attached MII devices and - * establish an `MII instance' to `phy number' - * mapping. We'll use this mapping in media change - * requests to determine which phy to use to program - * the MIF configuration register. + * establish an `MII instance' to `PHY number' + * mapping. We'll use this mapping to enable the MII + * drivers of the external transceiver according to + * the currently selected media. */ - for (child = LIST_FIRST(&sc->sc_mii->mii_phys); child != NULL; - child = LIST_NEXT(child, mii_list)) { + sc->sc_phys[0] = sc->sc_phys[1] = -1; + LIST_FOREACH(child, &sc->sc_mii->mii_phys, mii_list) { /* * Note: we support just two PHYs: the built-in * internal device and an external on the MII * connector. */ - if (child->mii_phy > 1 || child->mii_inst > 1) { + if ((child->mii_phy != HME_PHYAD_EXTERNAL && + child->mii_phy != HME_PHYAD_INTERNAL) || + child->mii_inst > 1) { device_printf(sc->sc_dev, "cannot accommodate " "MII device %s at phy %d, instance %d\n", device_get_name(child->mii_dev), @@ -476,6 +479,9 @@ callout_stop(&sc->sc_tick_ch); sc->sc_ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + /* Mask all interrupts */ + HME_SEB_WRITE_4(sc, HME_SEBI_IMASK, 0xffffffff); + /* Reset transmitter and receiver */ HME_SEB_WRITE_4(sc, HME_SEBI_RESET, HME_SEB_RESET_ETX | HME_SEB_RESET_ERX); @@ -741,7 +747,6 @@ v = ((ea[4] << 8) | ea[5]) & 0x3fff; HME_MAC_WRITE_4(sc, HME_MACI_RANDSEED, v); - /* Note: Accepting power-on default for other MAC registers here.. */ /* step 5. RX MAC registers & counters */ @@ -833,9 +838,6 @@ /* step 11. XIF Configuration */ v = HME_MAC_READ_4(sc, HME_MACI_XIF); v |= HME_MAC_XIF_OE; - /* If an external transceiver is connected, enable its MII drivers */ - if ((HME_MIF_READ_4(sc, HME_MIFI_CFG) & HME_MIF_CFG_MDI1) != 0) - v |= HME_MAC_XIF_MIIENABLE; CTR1(KTR_HME, "hme_init: programming XIF to %x", (u_int)v); HME_MAC_WRITE_4(sc, HME_MACI_XIF, v); @@ -871,9 +873,7 @@ #endif /* Set the current media. */ - /* - * mii_mediachg(sc->sc_mii); - */ + hme_mediachange_locked(sc); /* Start the one second timer. */ callout_reset(&sc->sc_tick_ch, hz, hme_tick, sc); @@ -1290,7 +1290,11 @@ { if ((status & HME_SEB_STAT_MIFIRQ) != 0) { - device_printf(sc->sc_dev, "XXXlink status changed\n"); + device_printf(sc->sc_dev, "XXXlink status changed: " + "cfg=%#x, stat=%#x, sm=%#x\n", + HME_MIF_READ_4(sc, HME_MIFI_CFG), + HME_MIF_READ_4(sc, HME_MIFI_STAT), + HME_MIF_READ_4(sc, HME_MIFI_SM)); return; } @@ -1322,7 +1326,6 @@ HME_UNLOCK(sc); } - static void hme_watchdog(struct ifnet *ifp) { @@ -1351,10 +1354,26 @@ { u_int32_t v; - /* Configure the MIF in frame mode */ - v = HME_MIF_READ_4(sc, HME_MIFI_CFG); - v &= ~HME_MIF_CFG_BBMODE; - HME_MIF_WRITE_4(sc, HME_MIFI_CFG, v); + /* + * Configure the MIF in frame mode, polling disabled, internal PHY + * selected. + */ + HME_MIF_WRITE_4(sc, HME_MIFI_CFG, 0); + + /* + * If the currently selected media uses the external transceiver, + * enable its MII drivers (which basically isolates the internal + * one and vice versa). In case the current media hasn't been set, + * yet, we default to the internal transceiver. + */ + v = HME_MAC_READ_4(sc, HME_MACI_XIF); + if (sc->sc_mii != NULL && sc->sc_mii->mii_media.ifm_cur != NULL && + sc->sc_phys[IFM_INST(sc->sc_mii->mii_media.ifm_cur->ifm_media)] == + HME_PHYAD_EXTERNAL) + v |= HME_MAC_XIF_MIIENABLE; + else + v &= ~HME_MAC_XIF_MIIENABLE; + HME_MAC_WRITE_4(sc, HME_MACI_XIF, v); } /* @@ -1363,17 +1382,21 @@ int hme_mii_readreg(device_t dev, int phy, int reg) { - struct hme_softc *sc = device_get_softc(dev); + struct hme_softc *sc; int n; u_int32_t v; + /* We can at most have two PHYs. */ + if (phy != HME_PHYAD_EXTERNAL && phy != HME_PHYAD_INTERNAL) + return (0); + + sc = device_get_softc(dev); /* Select the desired PHY in the MIF configuration register */ v = HME_MIF_READ_4(sc, HME_MIFI_CFG); - /* Clear PHY select bit */ - v &= ~HME_MIF_CFG_PHY; if (phy == HME_PHYAD_EXTERNAL) - /* Set PHY select bit to get at external device */ v |= HME_MIF_CFG_PHY; + else + v &= ~HME_MIF_CFG_PHY; HME_MIF_WRITE_4(sc, HME_MIFI_CFG, v); /* Construct the frame command */ @@ -1387,9 +1410,8 @@ for (n = 0; n < 100; n++) { DELAY(1); v = HME_MIF_READ_4(sc, HME_MIFI_FO); - if (v & HME_MIF_FO_TALSB) { + if (v & HME_MIF_FO_TALSB) return (v & HME_MIF_FO_DATA); - } } device_printf(sc->sc_dev, "mii_read timeout\n"); @@ -1399,17 +1421,21 @@ int hme_mii_writereg(device_t dev, int phy, int reg, int val) { - struct hme_softc *sc = device_get_softc(dev); + struct hme_softc *sc; int n; u_int32_t v; + /* We can at most have two PHYs. */ + if (phy != HME_PHYAD_EXTERNAL && phy != HME_PHYAD_INTERNAL) + return (0); + + sc = device_get_softc(dev); /* Select the desired PHY in the MIF configuration register */ v = HME_MIF_READ_4(sc, HME_MIFI_CFG); - /* Clear PHY select bit */ - v &= ~HME_MIF_CFG_PHY; if (phy == HME_PHYAD_EXTERNAL) - /* Set PHY select bit to get at external device */ v |= HME_MIF_CFG_PHY; + else + v &= ~HME_MIF_CFG_PHY; HME_MIF_WRITE_4(sc, HME_MIFI_CFG, v); /* Construct the frame command */ @@ -1435,25 +1461,16 @@ void hme_mii_statchg(device_t dev) { - struct hme_softc *sc = device_get_softc(dev); - int instance; - int phy; + struct hme_softc *sc; u_int32_t v; - instance = IFM_INST(sc->sc_mii->mii_media.ifm_cur->ifm_media); - phy = sc->sc_phys[instance]; + sc = device_get_softc(dev); + #ifdef HMEDEBUG if (sc->sc_debug) - printf("hme_mii_statchg: status change: phy = %d\n", phy); + device_printf(sc->sc_dev, "hme_mii_statchg: status change\n"); #endif - /* Select the current PHY in the MIF configuration register */ - v = HME_MIF_READ_4(sc, HME_MIFI_CFG); - v &= ~HME_MIF_CFG_PHY; - if (phy == HME_PHYAD_EXTERNAL) - v |= HME_MIF_CFG_PHY; - HME_MIF_WRITE_4(sc, HME_MIFI_CFG, v); - /* Set the MAC Full Duplex bit appropriately */ v = HME_MAC_READ_4(sc, HME_MACI_TXCFG); if (!hme_mac_bitflip(sc, HME_MACI_TXCFG, v, HME_MAC_TXCFG_ENABLE, 0)) @@ -1474,11 +1491,39 @@ int error; HME_LOCK(sc); - error = mii_mediachg(sc->sc_mii); + error = hme_mediachange_locked(sc); HME_UNLOCK(sc); return (error); } +static int +hme_mediachange_locked(struct hme_softc *sc) +{ + struct mii_softc *child; + + HME_LOCK_ASSERT(sc, MA_OWNED); +#ifdef HMEDEBUG + if (sc->sc_debug) + device_printf(sc->sc_dev, "hme_mediachange_locked"); +#endif + + hme_mifinit(sc); + + /* + * If both PHYs are present reset them. This is required for + * unisolating the previously isolated PHY when switching PHYs. + * As the above hme_mifinit() call will set the MII drivers in + * the XIF configuration register accoring to the currently + * selected media, there should be no window during which the + * data paths of both transceivers are open at the same time, + * even if the PHY device drivers use MIIF_NOISOLATE. + */ + if (sc->sc_phys[0] != -1 && sc->sc_phys[1] != -1) + LIST_FOREACH(child, &sc->sc_mii->mii_phys, mii_list) + mii_phy_reset(child); + return (mii_mediachg(sc->sc_mii)); +} + static void hme_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) { ==== //depot/projects/linuxolator/src/sys/fs/msdosfs/msdosfs_vnops.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/fs/msdosfs/msdosfs_vnops.c,v 1.165 2006/11/06 13:41:57 rwatson Exp $ */ +/* $FreeBSD: src/sys/fs/msdosfs/msdosfs_vnops.c,v 1.166 2006/12/03 19:04:26 maxim Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -343,13 +343,15 @@ vap->va_rdev = 0; vap->va_size = dep->de_FileSize; fattime2timespec(dep->de_MDate, dep->de_MTime, 0, 0, &vap->va_mtime); + vap->va_ctime = vap->va_mtime; if (pmp->pm_flags & MSDOSFSMNT_LONGNAME) { fattime2timespec(dep->de_ADate, 0, 0, 0, &vap->va_atime); fattime2timespec(dep->de_CDate, dep->de_CTime, dep->de_CHun, - 0, &vap->va_ctime); + 0, &vap->va_birthtime); } else { vap->va_atime = vap->va_mtime; - vap->va_ctime = vap->va_mtime; + vap->va_birthtime.tv_sec = -1; + vap->va_birthtime.tv_nsec = 0; } vap->va_flags = 0; if ((dep->de_Attributes & ATTR_ARCHIVE) == 0) ==== //depot/projects/linuxolator/src/sys/kern/kern_thr.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_thr.c,v 1.56 2006/11/11 16:46:31 trhodes Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_thr.c,v 1.57 2006/12/04 14:15:12 davidxu Exp $"); #include "opt_compat.h" #include "opt_posix.h" @@ -402,6 +402,12 @@ TIMESPEC_TO_TIMEVAL(&tv, tsp); hz = tvtohz(&tv); } + + if (td->td_pflags & TDP_WAKEUP) { + td->td_pflags &= ~TDP_WAKEUP; + return (0); + } + PROC_LOCK(td->td_proc); if ((td->td_flags & TDF_THRWAKEUP) == 0) error = msleep((void *)td, &td->td_proc->p_mtx, PCATCH, "lthr", @@ -430,6 +436,11 @@ struct proc *p; struct thread *ttd; + if (uap->id == td->td_tid) { + td->td_pflags |= TDP_WAKEUP; + return (0); + } + p = td->td_proc; PROC_LOCK(p); ttd = thread_find(p, uap->id); ==== //depot/projects/linuxolator/src/sys/kern/kern_umtx.c#8 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_umtx.c,v 1.55 2006/12/03 01:49:22 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_umtx.c,v 1.56 2006/12/04 14:15:12 davidxu Exp $"); #include "opt_compat.h" #include @@ -2170,7 +2170,7 @@ static int do_cv_wait(struct thread *td, struct ucond *cv, struct umutex *m, - struct timespec *timeout) + struct timespec *timeout, u_long wflags) { struct umtx_q *uq; struct timeval tv; @@ -2202,7 +2202,11 @@ umtxq_lock(&uq->uq_key); if (error == 0) { - if (timeout == NULL) { + if ((wflags & UMTX_CHECK_UNPARKING) && + (td->td_pflags & TDP_WAKEUP)) { + td->td_pflags &= ~TDP_WAKEUP; + error = EINTR; + } else if (timeout == NULL) { error = umtxq_sleep(uq, "ucond", 0); } else { getnanouptime(&ets); @@ -2236,7 +2240,8 @@ * occur, and indeed a kernel based implementation * can not avoid it. */ - umtxq_signal(&uq->uq_key, 1); + if (!umtxq_signal(&uq->uq_key, 1)) + error = 0; } if (error == ERESTART) error = EINTR; @@ -2431,7 +2436,7 @@ } ts = &timeout; } - return (do_cv_wait(td, uap->obj, uap->uaddr1, ts)); + return (do_cv_wait(td, uap->obj, uap->uaddr1, ts, uap->val)); } static int @@ -2592,7 +2597,7 @@ return (EINVAL); ts = &timeout; } - return (do_cv_wait(td, uap->obj, uap->uaddr1, ts)); + return (do_cv_wait(td, uap->obj, uap->uaddr1, ts, uap->val)); } static _umtx_op_func op_table_compat32[] = { ==== //depot/projects/linuxolator/src/sys/kern/subr_lock.c#4 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_lock.c,v 1.11 2006/11/13 05:41:46 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_lock.c,v 1.12 2006/12/04 22:15:50 kmacy Exp $"); #include "opt_ddb.h" #include "opt_mprof.h" @@ -260,10 +260,10 @@ l->lpo_filename = file; l->lpo_lineno = line; l->lpo_acqtime = nanoseconds(); - if (waittime) { - if (l->lpo_acqtime > waittime) - l->lpo_waittime = l->lpo_acqtime - waittime; - } + if (waittime && (l->lpo_acqtime > waittime)) + l->lpo_waittime = l->lpo_acqtime - waittime; + else + l->lpo_waittime = 0; } } ==== //depot/projects/linuxolator/src/sys/kern/subr_rman.c#3 (text+ko) ==== @@ -56,11 +56,12 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_rman.c,v 1.53 2006/09/11 19:31:52 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_rman.c,v 1.54 2006/12/04 16:45:23 jhb Exp $"); #include #include #include +#include #include #include #include @@ -169,10 +170,12 @@ mtx_lock(rm->rm_mtx); /* Skip entries before us. */ - for (s = TAILQ_FIRST(&rm->rm_list); - s && s->r_end + 1 < r->r_start; - s = TAILQ_NEXT(s, r_link)) - ; + TAILQ_FOREACH(s, &rm->rm_list, r_link) { + if (s->r_end == ULONG_MAX) + break; + if (s->r_end + 1 >= r->r_start) + break; + } /* If we ran off the end of the list, insert at the tail. */ if (s == NULL) { ==== //depot/projects/linuxolator/src/sys/net/bridgestp.c#7 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net/bridgestp.c,v 1.31 2006/11/27 00:35:40 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/net/bridgestp.c,v 1.32 2006/12/04 14:45:02 syrinx Exp $"); #include #include @@ -1637,7 +1637,10 @@ struct bstp_state *bs = bp->bp_bs; BSTP_LOCK(bs); - bp->bp_operedge = set; + if ((bp->bp_operedge = set) == 0) + bp->bp_flags &= ~BSTP_PORT_ADMEDGE; + else + bp->bp_flags |= BSTP_PORT_ADMEDGE; BSTP_UNLOCK(bs); return (0); } @@ -1809,8 +1812,12 @@ if (bp->bp_role == BSTP_ROLE_DISABLED) bstp_enable_port(bs, bp); } else { - if (bp->bp_role != BSTP_ROLE_DISABLED) + if (bp->bp_role != BSTP_ROLE_DISABLED) { bstp_disable_port(bs, bp); + if ((bp->bp_flags & BSTP_PORT_ADMEDGE) && + bp->bp_protover == BSTP_PROTO_RSTP) + bp->bp_operedge = 1; + } } return; } ==== //depot/projects/linuxolator/src/sys/net/bridgestp.h#5 (text+ko) ==== @@ -67,7 +67,7 @@ * * OpenBSD: if_bridge.h,v 1.14 2001/03/22 03:48:29 jason Exp * - * $FreeBSD: src/sys/net/bridgestp.h,v 1.10 2006/12/01 18:25:18 imp Exp $ + * $FreeBSD: src/sys/net/bridgestp.h,v 1.11 2006/12/04 14:45:02 syrinx Exp $ */ /* @@ -109,6 +109,7 @@ #define BSTP_PORT_ADMCOST 0x0008 #define BSTP_PORT_AUTOEDGE 0x0010 #define BSTP_PORT_AUTOP2P 0x0020 +#define BSTP_PORT_ADMEDGE 0x0040 /* BPDU priority */ #define BSTP_PDU_SUPERIOR 1 ==== //depot/projects/linuxolator/src/sys/net/if_bridge.c#9 (text+ko) ==== @@ -80,7 +80,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net/if_bridge.c,v 1.89 2006/11/27 00:35:40 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/net/if_bridge.c,v 1.91 2006/12/04 14:45:02 syrinx Exp $"); #include "opt_inet.h" #include "opt_inet6.h" @@ -421,7 +421,7 @@ BC_F_COPYOUT }, { bridge_ioctl_gifsstp, sizeof(struct ifbpstpconf), - BC_F_COPYOUT }, + BC_F_COPYIN|BC_F_COPYOUT }, { bridge_ioctl_sproto, sizeof(struct ifbrparam), BC_F_COPYIN|BC_F_SUSER }, >>> TRUNCATED FOR MAIL (1000 lines) <<<