From owner-p4-projects@FreeBSD.ORG Fri Nov 17 18:23:48 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 9924716A412; Fri, 17 Nov 2006 18:23:48 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F83F16A403 for ; Fri, 17 Nov 2006 18:23:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3682F43D53 for ; Fri, 17 Nov 2006 18:23:48 +0000 (GMT) (envelope-from jhb@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 kAHINmij023620 for ; Fri, 17 Nov 2006 18:23:48 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kAHINlWI023615 for perforce@freebsd.org; Fri, 17 Nov 2006 18:23:47 GMT (envelope-from jhb@freebsd.org) Date: Fri, 17 Nov 2006 18:23:47 GMT Message-Id: <200611171823.kAHINlWI023615@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 110164 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: Fri, 17 Nov 2006 18:23:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=110164 Change 110164 by jhb@jhb_mutex on 2006/11/17 18:23:25 IFC @110160. Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/db_trace.c#22 integrate .. //depot/projects/smpng/sys/arm/arm/nexus.c#9 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/ep80219_machdep.c#3 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#22 integrate .. //depot/projects/smpng/sys/boot/arm/at91/boot0/Makefile#4 integrate .. //depot/projects/smpng/sys/boot/arm/at91/boot0/arm_init.s#2 delete .. //depot/projects/smpng/sys/boot/arm/at91/boot0iic/Makefile#3 integrate .. //depot/projects/smpng/sys/boot/arm/at91/boot0iic/main.c#4 integrate .. //depot/projects/smpng/sys/boot/arm/at91/boot0spi/Makefile#3 integrate .. //depot/projects/smpng/sys/boot/arm/at91/boot0spi/main.c#4 integrate .. //depot/projects/smpng/sys/boot/arm/at91/boot2/Makefile#3 integrate .. //depot/projects/smpng/sys/boot/arm/at91/boot2/boot2.c#3 integrate .. //depot/projects/smpng/sys/boot/arm/at91/bootiic/Makefile#4 integrate .. //depot/projects/smpng/sys/boot/arm/at91/bootiic/arm_init.S#3 delete .. //depot/projects/smpng/sys/boot/arm/at91/bootspi/Makefile#5 integrate .. //depot/projects/smpng/sys/boot/arm/at91/bootspi/arm_init.S#3 delete .. //depot/projects/smpng/sys/boot/arm/at91/libat91/arm_init.S#1 branch .. //depot/projects/smpng/sys/boot/arm/at91/libat91/mci_device.c#3 delete .. //depot/projects/smpng/sys/boot/i386/loader/main.c#15 integrate .. //depot/projects/smpng/sys/dev/ata/ata-all.c#85 integrate .. //depot/projects/smpng/sys/dev/bce/if_bce.c#9 integrate .. //depot/projects/smpng/sys/dev/bce/if_bcereg.h#5 integrate .. //depot/projects/smpng/sys/dev/isp/isp.c#47 integrate .. //depot/projects/smpng/sys/dev/isp/isp_library.c#7 integrate .. //depot/projects/smpng/sys/dev/isp/ispmbox.h#23 integrate .. //depot/projects/smpng/sys/dev/mpt/mpt.c#20 integrate .. //depot/projects/smpng/sys/dev/mpt/mpt_cam.c#16 integrate .. //depot/projects/smpng/sys/dev/mpt/mpt_pci.c#26 integrate .. //depot/projects/smpng/sys/dev/pci/pci.c#77 integrate .. //depot/projects/smpng/sys/dev/syscons/syscons.c#58 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs_ioctl.c#15 integrate .. //depot/projects/smpng/sys/i386/i386/db_trace.c#34 integrate .. //depot/projects/smpng/sys/i386/i386/intr_machdep.c#21 integrate .. //depot/projects/smpng/sys/i386/i386/io_apic.c#20 integrate .. //depot/projects/smpng/sys/i386/i386/pmap.c#110 integrate .. //depot/projects/smpng/sys/kern/kern_condvar.c#43 integrate .. //depot/projects/smpng/sys/kern/kern_synch.c#107 integrate .. //depot/projects/smpng/sys/kern/subr_sleepqueue.c#28 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_node.c#25 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_vnops.c#63 integrate .. //depot/projects/smpng/sys/sun4v/include/tte_hash.h#3 integrate .. //depot/projects/smpng/sys/sun4v/sun4v/pmap.c#5 integrate .. //depot/projects/smpng/sys/sun4v/sun4v/tte_hash.c#3 integrate .. //depot/projects/smpng/sys/sys/sleepqueue.h#8 integrate Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/db_trace.c#22 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.77 2006/11/15 19:53:47 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.78 2006/11/17 16:37:35 jhb Exp $"); #include #include @@ -200,7 +200,7 @@ static void db_print_stack_entry(const char *, int, char **, long *, db_addr_t); static void decode_syscall(int, struct thread *); -static char * watchtype_str(int type); +static const char * watchtype_str(int type); int amd64_set_watch(int watchnum, unsigned long watchaddr, int size, int access, struct dbreg *d); int amd64_clr_watch(int watchnum, struct dbreg *d); @@ -648,8 +648,8 @@ db_expr_t addr; db_expr_t size; { + struct dbreg d; int i; - struct dbreg d; fill_dbregs(NULL, &d); @@ -668,8 +668,7 @@ } -static -char * +static const char * watchtype_str(type) int type; { ==== //depot/projects/smpng/sys/arm/arm/nexus.c#9 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/nexus.c,v 1.9 2006/10/25 21:11:46 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/nexus.c,v 1.10 2006/11/17 11:56:56 cognet Exp $"); #include #include @@ -142,7 +142,7 @@ int i; for (i = rman_get_start(r); i <= rman_get_end(r); i++) - arm_mask_irq(rman_get_start(r)); + arm_mask_irq(i); error = arm_remove_irqhandler(ih); return (error); } ==== //depot/projects/smpng/sys/arm/xscale/i80321/ep80219_machdep.c#3 (text+ko) ==== @@ -49,7 +49,7 @@ #include "opt_ddb.h" #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.3 2006/10/26 21:42:17 jb Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.4 2006/11/17 00:53:39 kevlo Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -474,7 +474,6 @@ /* Do basic tuning, hz etc */ init_param1(); init_param2(physmem); - avail_end = 0xa0000000 + memsize - 1; kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); ==== //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#22 (text+ko) ==== @@ -49,7 +49,7 @@ #include "opt_ddb.h" #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.24 2006/10/26 21:42:17 jb Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.25 2006/11/17 00:53:39 kevlo Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -477,7 +477,6 @@ /* Do basic tuning, hz etc */ init_param1(); init_param2(physmem); - avail_end = 0xa0000000 + memsize - 1; kdb_init(); return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); ==== //depot/projects/smpng/sys/boot/arm/at91/boot0/Makefile#4 (text) ==== @@ -1,11 +1,14 @@ -# $FreeBSD: src/sys/boot/arm/at91/boot0/Makefile,v 1.4 2006/08/18 20:26:54 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/boot0/Makefile,v 1.5 2006/11/16 00:53:27 imp Exp $ + +.PATH: ${.CURDIR}/../libat91 P=boot0 FILES=${P} -SRCS=arm_init.s main.c +SRCS=arm_init.S main.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .include +CFLAGS+=-DBOOT_BOOT0 ==== //depot/projects/smpng/sys/boot/arm/at91/boot0iic/Makefile#3 (text) ==== @@ -1,12 +1,14 @@ -# $FreeBSD: src/sys/boot/arm/at91/boot0iic/Makefile,v 1.2 2006/08/16 23:14:52 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/boot0iic/Makefile,v 1.3 2006/11/16 00:53:27 imp Exp $ -.PATH: ${.CURDIR}/../boot0 +.PATH: ${.CURDIR}/../libat91 P=boot0iic FILES=${P} -SRCS=arm_init.s main.c +SRCS=arm_init.S main.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .include + +CFLAGS+=-DBOOT_BOOT0 ==== //depot/projects/smpng/sys/boot/arm/at91/boot0iic/main.c#4 (text) ==== @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/arm/at91/boot0iic/main.c,v 1.3 2006/11/09 19:55:25 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/boot0iic/main.c,v 1.4 2006/11/16 00:49:50 imp Exp $ */ #include "at91rm9200.h" @@ -32,12 +32,19 @@ main(void) { char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ + int len, sec; - while (xmodem_rx(addr) == -1) + printf("\nSend data to be written into EEPROM\n"); + while ((len = xmodem_rx(addr)) == -1) + continue; + sec = GetSeconds() + 1; + while (sec >= GetSeconds()) continue; + printf("\nWriting EEPROM from 0x%x to addr 0, 0x%x bytes\n", addr, + len); InitEEPROM(); - printf("Writing EEPROM from 0x%x to addr 0\n", addr); - WriteEEPROM(0, addr, 8192); - printf("Write complete. Press reset\n"); + printf("init done\n"); + WriteEEPROM(0, addr, len); + printf("\nWrote %d bytes. Press reset\n", len); return (1); } ==== //depot/projects/smpng/sys/boot/arm/at91/boot0spi/Makefile#3 (text) ==== @@ -1,13 +1,14 @@ -# $FreeBSD: src/sys/boot/arm/at91/boot0spi/Makefile,v 1.2 2006/08/16 23:18:07 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/boot0spi/Makefile,v 1.3 2006/11/16 00:53:27 imp Exp $ -.PATH: ${.CURDIR}/../boot0 +.PATH: ${.CURDIR}/../libat91 P=boot0spi FILES=${P} -SRCS=arm_init.s main.c +SRCS=arm_init.S main.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .include +CFLAGS+=-DBOOT_BOOT0 ==== //depot/projects/smpng/sys/boot/arm/at91/boot0spi/main.c#4 (text) ==== @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/arm/at91/boot0spi/main.c,v 1.3 2006/10/21 22:43:07 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/boot0spi/main.c,v 1.4 2006/11/16 00:48:53 imp Exp $ */ #include "at91rm9200.h" @@ -29,21 +29,23 @@ #include "at91rm9200_lowlevel.h" #include "spi_flash.h" -#define OFFSET 0 +#define LOADER_OFFSET 0 +#define FPGA_OFFSET (15 * FLASH_PAGE_SIZE) +#define OFFSET LOADER_OFFSET int main(void) { int len, i, j, off; - char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ - char *addr2 = (char *)SDRAM_BASE + (2 << 20); /* Load to base + 2MB */ - char *addr3 = (char *)SDRAM_BASE + (3 << 20); /* Load to base + 2MB */ + char *addr = (char *)SDRAM_BASE + (1 << 20); /* download at + 1MB */ + char *addr2 = (char *)SDRAM_BASE + (2 << 20); /* readback to + 2MB */ + char *addr3 = (char *)SDRAM_BASE + (3 << 20); /* extra copy at + 3MB */ SPI_InitFlash(); printf("Waiting for data\n"); while ((len = xmodem_rx(addr)) == -1) continue; - printf("\nDownloaded %u bytes.\n", len); + // Need extra copy at addr3 memcpy(addr3, addr, (len + FLASH_PAGE_SIZE - 1) / FLASH_PAGE_SIZE * FLASH_PAGE_SIZE); printf("Writing %u bytes to flash at %u\n", len, OFFSET); for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { @@ -57,5 +59,6 @@ if (j >= 10) printf("Bad Readback at %u\n", i); } + printf("Done\n"); return (1); } ==== //depot/projects/smpng/sys/boot/arm/at91/boot2/Makefile#3 (text+ko) ==== @@ -1,19 +1,16 @@ -# $FreeBSD: src/sys/boot/arm/at91/boot2/Makefile,v 1.2 2006/11/09 20:07:26 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/boot2/Makefile,v 1.3 2006/11/16 00:48:04 imp Exp $ -.PATH: ${.CURDIR}/../libat91 +.PATH: ${.CURDIR}/../libat91 ${.CURDIR}/../bootspi P=boot2 FILES=${P} -SRCS=arm_init.S boot2.c ${BOOT_FLAVOR}_board.c +SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:L}_board.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .include -.if ${BOOT_FLAVOR} == "tsc" -SRCS+=ee.c -.endif .if ${BOOT_FLAVOR} == "kb920x" CFLAGS+=-DBOOT_IIC .endif ==== //depot/projects/smpng/sys/boot/arm/at91/boot2/boot2.c#3 (text+ko) ==== @@ -14,7 +14,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/arm/at91/boot2/boot2.c,v 1.2 2006/11/09 20:07:26 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/arm/at91/boot2/boot2.c,v 1.3 2006/11/16 00:47:31 imp Exp $"); #include #include @@ -29,7 +29,6 @@ #include "emac.h" #include "lib.h" #include "sd-card.h" -#include "ee.h" #include "board.h" #define RBX_ASKNAME 0x0 /* -a */ ==== //depot/projects/smpng/sys/boot/arm/at91/bootiic/Makefile#4 (text) ==== @@ -1,6 +1,6 @@ -# $FreeBSD: src/sys/boot/arm/at91/bootiic/Makefile,v 1.4 2006/11/09 20:23:51 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/bootiic/Makefile,v 1.5 2006/11/16 00:53:27 imp Exp $ -.PATH: ${.CURDIR}/../libat91 +.PATH: ${.CURDIR}/../libat91 P=bootiic FILES=${P} @@ -11,4 +11,4 @@ .include -CFLAGS += -DBOOT_IIC +CFLAGS += -DBOOT_IIC -DBOOT_COMMANDS ==== //depot/projects/smpng/sys/boot/arm/at91/bootspi/Makefile#5 (text) ==== @@ -1,6 +1,6 @@ -# $FreeBSD: src/sys/boot/arm/at91/bootspi/Makefile,v 1.5 2006/11/09 20:45:22 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/bootspi/Makefile,v 1.6 2006/11/16 00:53:27 imp Exp $ -.PATH: ${.CURDIR}/../libat91 +.PATH: ${.CURDIR}/../libat91 P=bootspi FILES=${P} @@ -14,3 +14,4 @@ .if ${MK_FPGA} == "yes" CFLAGS += -DTSC_FPGA .endif +CFLAGS += -DBOOT_COMMANDS ==== //depot/projects/smpng/sys/boot/i386/loader/main.c#15 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.38 2006/11/02 01:23:18 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/loader/main.c,v 1.39 2006/11/16 13:32:30 ru Exp $"); /* * MD bootstrap main() and assorted miscellaneous @@ -191,7 +191,7 @@ extract_currdev(void) { struct i386_devdesc new_currdev; - int major, biosdev = -1; + int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.d_dev = &biosdisk; @@ -222,7 +222,6 @@ B_CONTROLLER(initial_bootdev) - 1; new_currdev.d_kind.biosdisk.partition = B_PARTITION(initial_bootdev); biosdev = initial_bootinfo->bi_bios_dev; - major = B_TYPE(initial_bootdev); /* * If we are booted by an old bootstrap, we have to guess at the BIOS ==== //depot/projects/smpng/sys/dev/ata/ata-all.c#85 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.274 2006/09/11 18:33:59 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.275 2006/11/17 11:13:47 sos Exp $"); #include "opt_ata.h" #include @@ -601,12 +601,12 @@ isprint(atadev->param.model[1]))) { struct ata_params *atacap = &atadev->param; char buffer[64]; -#if BYTE_ORDER == BIG_ENDIAN +#ifndef __ARMEB__ int16_t *ptr; for (ptr = (int16_t *)atacap; ptr < (int16_t *)atacap + sizeof(struct ata_params)/2; ptr++) { - *ptr = bswap16(*ptr); + *ptr = le16toh(*ptr); } #endif if (!(!strncmp(atacap->model, "FX", 2) || ==== //depot/projects/smpng/sys/dev/bce/if_bce.c#9 (text) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.19 2006/11/15 20:04:56 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.21 2006/11/16 06:28:54 scottl Exp $"); /* * The following controllers are supported by this driver: @@ -4261,7 +4261,7 @@ if (sc->tx_mbuf_ptr[sw_tx_chain_cons] != NULL) { /* Validate that this is the last tx_bd. */ - DBRUNIF((!(txbd->tx_bd_vlan_tag_flags & TX_BD_FLAGS_END)), + DBRUNIF((!(txbd->tx_bd_flags & TX_BD_FLAGS_END)), BCE_PRINTF(sc, "%s(%d): tx_bd END flag not set but " "txmbuf == NULL!\n", __FILE__, __LINE__); bce_breakpoint(sc)); @@ -4529,9 +4529,9 @@ bus_dmamap_t map; struct tx_bd *txbd = NULL; struct mbuf *m0; - u32 vlan_tag_flags = 0; + u16 vlan_tag = 0, flags = 0; + u16 chain_prod, prod; u32 prod_bseq; - u16 chain_prod, prod; #ifdef BCE_DEBUG u16 debug_prod; @@ -4542,15 +4542,16 @@ m0 = *m_head; if (m0->m_pkthdr.csum_flags) { if (m0->m_pkthdr.csum_flags & CSUM_IP) - vlan_tag_flags |= TX_BD_FLAGS_IP_CKSUM; + flags |= TX_BD_FLAGS_IP_CKSUM; if (m0->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) - vlan_tag_flags |= TX_BD_FLAGS_TCP_UDP_CKSUM; + flags |= TX_BD_FLAGS_TCP_UDP_CKSUM; } /* Transfer any VLAN tags to the bd. */ - if (m0->m_flags & M_VLANTAG) - vlan_tag_flags |= (TX_BD_FLAGS_VLAN_TAG | - (m0->m_pkthdr.ether_vtag << 16)); + if (m0->m_flags & M_VLANTAG) { + flags |= TX_BD_FLAGS_VLAN_TAG; + vlan_tag = m0->m_pkthdr.ether_vtag; + } /* Map the mbuf into DMAable memory. */ prod = sc->tx_prod; @@ -4634,15 +4635,16 @@ txbd->tx_bd_haddr_lo = htole32(BCE_ADDR_LO(segs[i].ds_addr)); txbd->tx_bd_haddr_hi = htole32(BCE_ADDR_HI(segs[i].ds_addr)); txbd->tx_bd_mss_nbytes = htole16(segs[i].ds_len); - txbd->tx_bd_vlan_tag_flags = htole16(vlan_tag_flags); + txbd->tx_bd_vlan_tag = htole16(vlan_tag); + txbd->tx_bd_flags = htole16(flags); prod_bseq += segs[i].ds_len; if (i == 0) - txbd->tx_bd_vlan_tag_flags |=htole16(TX_BD_FLAGS_START); + txbd->tx_bd_flags |= htole16(TX_BD_FLAGS_START); prod = NEXT_TX_BD(prod); } /* Set the END flag on the last TX buffer descriptor. */ - txbd->tx_bd_vlan_tag_flags |= htole16(TX_BD_FLAGS_END); + txbd->tx_bd_flags |= htole16(TX_BD_FLAGS_END); DBRUN(BCE_INFO_SEND, bce_dump_tx_chain(sc, debug_prod, nseg)); @@ -4652,17 +4654,14 @@ __FUNCTION__, prod, chain_prod, prod_bseq); /* - * Ensure that the map for this transmission + * Ensure that the mbuf pointer for this transmission * is placed at the array index of the last * descriptor in this chain. This is done * because a single map is used for all * segments of the mbuf and we don't want to - * delete the map before all of the segments + * unload the map before all of the segments * have been freed. */ - sc->tx_mbuf_map[TX_CHAIN_IDX(sc->tx_prod)] = - sc->tx_mbuf_map[chain_prod]; - sc->tx_mbuf_map[chain_prod] = map; sc->tx_mbuf_ptr[chain_prod] = m0; sc->used_tx_bd += nsegs; @@ -4673,7 +4672,7 @@ DBRUN(BCE_VERBOSE_SEND, bce_dump_tx_mbuf_chain(sc, chain_prod, nsegs)); - /* prod still points the last used tx_bd at this point. */ + /* prod points to the next free tx_bd at this point. */ sc->tx_prod = prod; sc->tx_prod_bseq = prod_bseq; @@ -4711,8 +4710,11 @@ "tx_prod_bseq = 0x%08X\n", __FUNCTION__, tx_prod, tx_chain_prod, sc->tx_prod_bseq); - /* Keep adding entries while there is space in the ring. */ - while (sc->tx_mbuf_ptr[tx_chain_prod] == NULL) { + /* + * Keep adding entries while there is space in the ring. We keep + * BCE_TX_SLACK_SPACE entries unused at all times. + */ + while (sc->used_tx_bd < USABLE_TX_BD - BCE_TX_SLACK_SPACE) { /* Check for any frames to send. */ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); @@ -6161,9 +6163,10 @@ else /* Normal tx_bd entry. */ BCE_PRINTF(sc, "tx_bd[0x%04X]: haddr = 0x%08X:%08X, nbytes = 0x%08X, " - "flags = 0x%08X\n", idx, + "vlan tag= 0x%4X, "flags = 0x%04X\n", idx, txbd->tx_bd_haddr_hi, txbd->tx_bd_haddr_lo, - txbd->tx_bd_mss_nbytes, txbd->tx_bd_vlan_tag_flags); + txbd->tx_bd_mss_nbytes, txbd->tx_bd_vlan_tag, + txbd->tx_bd_flags); } ==== //depot/projects/smpng/sys/dev/bce/if_bcereg.h#5 (text) ==== @@ -26,7 +26,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/bce/if_bcereg.h,v 1.9 2006/10/24 08:24:31 scottl Exp $ + * $FreeBSD: src/sys/dev/bce/if_bcereg.h,v 1.10 2006/11/16 06:28:54 scottl Exp $ */ #ifndef _BCE_H_DEFINED @@ -737,7 +737,8 @@ u32 tx_bd_haddr_hi; u32 tx_bd_haddr_lo; u32 tx_bd_mss_nbytes; - u32 tx_bd_vlan_tag_flags; + u16 tx_bd_flags; + u16 tx_bd_vlan_tag; #define TX_BD_FLAGS_CONN_FAULT (1<<0) #define TX_BD_FLAGS_TCP_UDP_CKSUM (1<<1) #define TX_BD_FLAGS_IP_CKSUM (1<<2) ==== //depot/projects/smpng/sys/dev/isp/isp.c#47 (text+ko) ==== @@ -26,8 +26,9 @@ /* * Machine and OS Independent (well, as best as possible) - * code for the Qlogic ISP SCSI adapters. + * code for the Qlogic ISP SCSI and FC-SCSI adapters. */ + /* * Inspiration and ideas about this driver are from Erik Moe's Linux driver * (qlogicisp.c) and Dave Miller's SBus version of same (qlogicisp.c). Some @@ -42,7 +43,7 @@ #endif #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD: src/sys/dev/isp/isp.c,v 1.129 2006/11/14 08:45:47 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp.c,v 1.131 2006/11/16 00:39:56 mjacob Exp $"); #include #endif #ifdef __OpenBSD__ @@ -2231,9 +2232,8 @@ } mbs.param[2] = portid >> 16; mbs.param[3] = portid; - mbs.logval = MBLOGNONE; - mbs.timeout = 250000; + mbs.timeout = 500000; isp_mboxcmd(isp, &mbs); switch (mbs.param[0]) { @@ -2286,6 +2286,7 @@ mbs.param[1] = handle << 8; } mbs.logval = MBLOGNONE; + mbs.timeout = 100000; isp_mboxcmd(isp, &mbs); } @@ -2314,6 +2315,7 @@ mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); + mbs.timeout = 250000; mbs.logval = MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR; if (dolock) { FC_SCRATCH_ACQUIRE(isp); @@ -2368,7 +2370,6 @@ } } mbs.logval = MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR; - mbs.timeout = 30000; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return (wwn); @@ -2928,7 +2929,13 @@ * which shift on a loop. */ if (tmp.node_wwn == 0 || tmp.port_wwn == 0 || tmp.portid == 0) { - isp_prt(isp, ISP_LOGWARN, "bad pdb @ loop %d", handle); + int a, b, c; + a = (tmp.node_wwn == 0); + b = (tmp.port_wwn == 0); + c = (tmp.portid == 0); + isp_prt(isp, ISP_LOGWARN, + "bad pdb (%1d%1d%1d) @ handle 0x%x", a, b, c, + handle); isp_dump_portdb(isp); continue; } @@ -2996,7 +3003,7 @@ * decide what to do. */ isp_prt(isp, ISP_LOGSANCFG, - "Loop Port 0x%06x@0x%x changed", + "Loop Port 0x%02x@0x%x changed", tmp.portid, tmp.handle); lp->state = FC_PORTDB_STATE_CHANGED; lp->new_portid = tmp.portid; @@ -3035,7 +3042,7 @@ lp->port_wwn = tmp.port_wwn; lp->node_wwn = tmp.node_wwn; isp_prt(isp, ISP_LOGSANCFG, - "Loop Port 0x%06x@0x%x is New Entry", + "Loop Port 0x%02x@0x%x is New Entry", tmp.portid, tmp.handle); } fcp->isp_loopstate = LOOP_LSCAN_DONE; @@ -4855,7 +4862,8 @@ switch (etype) { case RQSTYPE_RESPONSE: XS_SET_STATE_STAT(isp, xs, sp); - if (resp) { + if (resp && rlen >= 4 && + resp[FCP_RSPNS_CODE_OFFSET] != 0) { isp_prt(isp, ISP_LOGWARN, "%d.%d FCP RESPONSE: 0x%x", XS_TGT(xs), XS_LUN(xs), @@ -6796,7 +6804,6 @@ MEMZERO(&mbs, sizeof (mbs)); mbs.param[0] = MBOX_GET_FW_STATE; mbs.logval = MBLOGALL; - mbs.timeout = 100000; isp_mboxcmd(isp, &mbs); if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { fcp->isp_fwstate = mbs.param[1]; ==== //depot/projects/smpng/sys/dev/isp/isp_library.c#7 (text) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2006 by Matthew Jacob + * Copyright (c) 2006 by Matthew Jacob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ #endif #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_library.c,v 1.7 2006/11/14 08:45:48 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_library.c,v 1.9 2006/11/16 00:39:56 mjacob Exp $"); #include #endif #ifdef __OpenBSD__ @@ -268,9 +268,9 @@ } else { SNPRINTF(mb, sizeof (mb), "---"); } - isp_prt(isp, ISP_LOGALL, "%d: %s al%d tgt %s %s 0x%06x =>%s" - " 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x", i, - dbs[lp->state], lp->autologin, mb, + isp_prt(isp, ISP_LOGALL, "%d: hdl 0x%x %s al%d tgt %s %s " + "0x%06x =>%s 0x%06x; WWNN 0x%08x%08x WWPN 0x%08x%08x", i, + lp->handle, dbs[lp->state], lp->autologin, mb, roles[lp->roles], lp->portid, roles[lp->new_roles], lp->new_portid, (uint32_t) (lp->node_wwn >> 32), ==== //depot/projects/smpng/sys/dev/isp/ispmbox.h#23 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/ispmbox.h,v 1.53 2006/11/02 03:21:31 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/ispmbox.h,v 1.54 2006/11/16 00:39:56 mjacob Exp $ */ /*- * Mailbox and Queue Entry Definitions for for Qlogic ISP SCSI adapters. * @@ -1347,4 +1347,30 @@ #define els_recv_dsd_a4732 inout.out._els_recv_dsd_a4732 #define els_recv_dsd_a6348 inout.out._els_recv_dsd_a6348 } els_t; + +/* + * A handy package structure for running FC-SCSI commands via RUN IOCB A64. + */ +typedef struct { + uint16_t handle; + uint16_t lun; + uint32_t portid; + uint32_t timeout; + union { + struct { + uint32_t data_length; + uint8_t do_read; + uint8_t pad[3]; + uint8_t cdb[16]; + void *data_ptr; + } beg; + struct { + uint32_t data_residual; + uint8_t status; + uint8_t pad; + uint16_t sense_length; + uint8_t sense_data[32]; + } end; + } fcd; +} isp_xcmd_t; #endif /* _ISPMBOX_H */ ==== //depot/projects/smpng/sys/dev/mpt/mpt.c#20 (text+ko) ==== @@ -96,7 +96,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.35 2006/09/07 23:08:21 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.36 2006/11/15 21:46:36 jb Exp $"); #include #include /* XXX For static handler registration */ @@ -547,6 +547,10 @@ handled = 0; msg = (MSG_EVENT_NOTIFY_REPLY *)reply_frame; + msg->EventDataLength = le16toh(msg->EventDataLength); + msg->IOCStatus = le16toh(msg->IOCStatus); + msg->IOCLogInfo = le32toh(msg->IOCLogInfo); + msg->Event = le32toh(msg->Event); MPT_PERS_FOREACH(mpt, pers) handled += pers->event(mpt, req, msg); @@ -566,7 +570,7 @@ request_t *ack_req; uint32_t context; - context = htole32(req->index|MPT_REPLY_HANDLER_EVENTS); + context = req->index | MPT_REPLY_HANDLER_EVENTS; ack_req = mpt_get_request(mpt, FALSE); if (ack_req == NULL) { struct mpt_evtf_record *evtf; @@ -683,9 +687,9 @@ ackp = (MSG_EVENT_ACK *)ack_req->req_vbuf; memset(ackp, 0, sizeof (*ackp)); ackp->Function = MPI_FUNCTION_EVENT_ACK; - ackp->Event = msg->Event; - ackp->EventContext = msg->EventContext; - ackp->MsgContext = context; + ackp->Event = htole32(msg->Event); + ackp->EventContext = htole32(msg->EventContext); + ackp->MsgContext = htole32(context); mpt_check_doorbell(mpt); mpt_send_cmd(mpt, ack_req); } @@ -1375,7 +1379,7 @@ /* Send the command */ for (i = 0; i < len; i++) { - mpt_write(mpt, MPT_OFFSET_DOORBELL, *data32++); + mpt_write(mpt, MPT_OFFSET_DOORBELL, htole32(*data32++)); if (mpt_wait_db_ack(mpt) != MPT_OK) { mpt_prt(mpt, "mpt_send_handshake_cmd timeout! index = %d\n", @@ -1392,6 +1396,7 @@ { int left, reply_left; u_int16_t *data16; + uint32_t data; MSG_DEFAULT_REPLY *hdr; /* We move things out in 16 bit chunks */ @@ -1405,7 +1410,8 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout1\n"); return ETIMEDOUT; } - *data16++ = mpt_read(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; + data = mpt_read(mpt, MPT_OFFSET_DOORBELL); + *data16++ = le16toh(data & MPT_DB_DATA_MASK); mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); /* Get Second Word */ @@ -1413,7 +1419,8 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout2\n"); return ETIMEDOUT; } - *data16++ = mpt_read(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; + data = mpt_read(mpt, MPT_OFFSET_DOORBELL); + *data16++ = le16toh(data & MPT_DB_DATA_MASK); mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); /* @@ -1443,10 +1450,11 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout3\n"); return ETIMEDOUT; } - datum = mpt_read(mpt, MPT_OFFSET_DOORBELL); + data = mpt_read(mpt, MPT_OFFSET_DOORBELL); + datum = le16toh(data & MPT_DB_DATA_MASK); if (reply_left-- > 0) - *data16++ = datum & MPT_DB_DATA_MASK; + *data16++ = datum; mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); } @@ -1553,9 +1561,9 @@ cfgp->Header.PageLength = PageLength; cfgp->Header.PageNumber = PageNumber; cfgp->Header.PageType = PageType; - cfgp->PageAddress = PageAddress; + cfgp->PageAddress = htole32(PageAddress); se = (SGE_SIMPLE32 *)&cfgp->PageBufferSGE; - se->Address = addr; + se->Address = htole32(addr); MPI_pSGE_SET_LENGTH(se, len); MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | @@ -1563,6 +1571,7 @@ ((Action == MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT || Action == MPI_CONFIG_ACTION_PAGE_WRITE_NVRAM) ? MPI_SGE_FLAGS_HOST_TO_IOC : MPI_SGE_FLAGS_IOC_TO_HOST))); + se->FlagsLength = htole32(se->FlagsLength); cfgp->MsgContext = htole32(req->index | MPT_REPLY_HANDLER_CONFIG); mpt_check_doorbell(mpt); @@ -2488,7 +2497,7 @@ pfp.MaxDevices); mpt->mpt_port_type = pfp.PortType; - mpt->mpt_proto_flags = pfp.ProtocolFlags; + mpt->mpt_proto_flags = le16toh(pfp.ProtocolFlags); if (pfp.PortType != MPI_PORTFACTS_PORTTYPE_SCSI && pfp.PortType != MPI_PORTFACTS_PORTTYPE_SAS && pfp.PortType != MPI_PORTFACTS_PORTTYPE_FC) { @@ -2521,10 +2530,10 @@ * if this is different from what is wanted. */ mpt->role = MPT_ROLE_NONE; - if (pfp.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) { + if (mpt->mpt_proto_flags & MPI_PORTFACTS_PROTOCOL_INITIATOR) { mpt->role |= MPT_ROLE_INITIATOR; } - if (pfp.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) { + if (mpt->mpt_proto_flags & MPI_PORTFACTS_PROTOCOL_TARGET) { mpt->role |= MPT_ROLE_TARGET; } if (mpt_enable_ioc(mpt, 0) != MPT_OK) { ==== //depot/projects/smpng/sys/dev/mpt/mpt_cam.c#16 (text+ko) ==== @@ -94,7 +94,7 @@ * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.37 2006/11/02 23:19:00 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.40 2006/11/17 00:19:55 mjacob Exp $"); #include #include @@ -1036,6 +1036,7 @@ MPI_pSGE_SET_FLAGS(se1, (MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_END_OF_LIST)); + se1->FlagsLength = htole32(se1->FlagsLength); goto out; } @@ -1093,7 +1094,7 @@ uint32_t tf; memset(se, 0, sizeof (*se)); - se->Address.Low = dm_segs->ds_addr; + se->Address.Low = htole32(dm_segs->ds_addr & 0xffffffff); if (sizeof(bus_addr_t) > 4) { se->Address.High = ((uint64_t) dm_segs->ds_addr) >> 32; } @@ -1107,6 +1108,7 @@ MPI_SGE_FLAGS_END_OF_BUFFER; } MPI_pSGE_SET_FLAGS(se, tf); + se->FlagsLength = htole32(se->FlagsLength); } if (seg == nseg) { @@ -1169,9 +1171,9 @@ chain_list_addr += cur_off; if (sizeof (bus_addr_t) > 4) { ce->Address.High = - (uint32_t) ((uint64_t)chain_list_addr >> 32); + htole32((uint32_t) ((uint64_t)chain_list_addr >> 32)); } - ce->Address.Low = (uint32_t) chain_list_addr; + ce->Address.Low = htole32((uint32_t) chain_list_addr); ce->Flags = MPI_SGE_FLAGS_CHAIN_ELEMENT | MPI_SGE_FLAGS_64_BIT_ADDRESSING; @@ -1208,10 +1210,10 @@ */ while (seg < this_seg_lim) { memset(se, 0, sizeof (*se)); - se->Address.Low = dm_segs->ds_addr; + se->Address.Low = htole32(dm_segs->ds_addr); if (sizeof (bus_addr_t) > 4) { se->Address.High = - ((uint64_t)dm_segs->ds_addr) >> 32; + htole32(((uint64_t)dm_segs->ds_addr) >> 32); } MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; @@ -1223,6 +1225,7 @@ MPI_SGE_FLAGS_END_OF_BUFFER; } MPI_pSGE_SET_FLAGS(se, tf); + se->FlagsLength = htole32(se->FlagsLength); se++; seg++; dm_segs++; @@ -1436,6 +1439,7 @@ MPI_pSGE_SET_FLAGS(se1, (MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_END_OF_LIST)); + se1->FlagsLength = htole32(se1->FlagsLength); goto out; } @@ -1507,6 +1511,7 @@ MPI_SGE_FLAGS_END_OF_BUFFER; } MPI_pSGE_SET_FLAGS(se, tf); + se->FlagsLength = htole32(se->FlagsLength); } if (seg == nseg) { @@ -1622,6 +1627,7 @@ MPI_SGE_FLAGS_END_OF_BUFFER; } MPI_pSGE_SET_FLAGS(se, tf); + se->FlagsLength = htole32(se->FlagsLength); >>> TRUNCATED FOR MAIL (1000 lines) <<<