Date: Fri, 18 Aug 2006 07:25:57 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 104459 for review Message-ID: <200608180725.k7I7PvZB059286@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=104459 Change 104459 by rdivacky@rdivacky_witten on 2006/08/18 07:25:26 IFC Affected files ... .. //depot/projects/soc2006/rdivacky_linuxolator/amd64/amd64/support.S#3 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_sysvec.c#11 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0iic/Makefile#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0iic/doit.c#2 delete .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0iic/main.c#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0spi/Makefile#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0spi/doit.c#2 delete .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0spi/main.c#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootiic/loader_prompt.c#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/Makefile#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/arm_init.S#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/arm_init.s#2 delete .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/env_vars.c#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/env_vars.h#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/loader_prompt.c#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/loader_prompt.h#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/main.c#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/Makefile#3 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/delay.c#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/emac.c#3 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/emac.h#3 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/emac_init.c#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/lib_AT91RM9200.h#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/mci_device.c#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/mci_device.h#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/reset.c#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/sd-card.c#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/sd-card.h#1 branch .. //depot/projects/soc2006/rdivacky_linuxolator/compat/freebsd32/freebsd32.h#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/compat/freebsd32/syscalls.master#6 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_misc.c#23 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_signal.c#9 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/compat/ndis/ntoskrnl_var.h#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/conf/NOTES#7 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/conf/options#8 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/dev/arl/if_arlreg.h#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/dev/ata/ata-chipset.c#8 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/dev/ath/if_athvar.h#4 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/dev/bge/if_bge.c#5 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/dev/em/if_em.c#8 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/dev/ips/ips.h#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/dev/usb/usb_port.h#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/fs/msdosfs/denode.h#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/geom/vinum/geom_vinum_raid5.h#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#54 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_sysvec.c#19 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/kern/syscalls.master#6 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/net/if_bridge.c#6 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/netinet/ip_fastfwd.c#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/netinet/ip_fw.h#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/netinet/ip_fw2.c#6 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/netinet/ip_input.c#2 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/netinet/ip_output.c#3 integrate .. //depot/projects/soc2006/rdivacky_linuxolator/nfsclient/nfs_lock.c#2 integrate Differences ... ==== //depot/projects/soc2006/rdivacky_linuxolator/amd64/amd64/support.S#3 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.118 2006/08/15 22:43:02 davidxu Exp $ + * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.119 2006/08/16 22:22:28 davidxu Exp $ */ #include "opt_ddb.h" @@ -432,7 +432,7 @@ ja fusufault movq %rsi,(%rdi) - xorq %rax,%rax + xorl %eax,%eax movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) ret ==== //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_sysvec.c#11 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.21 2006/08/15 14:58:15 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.23 2006/08/17 21:06:48 netchild Exp $"); #include "opt_compat.h" #ifndef COMPAT_IA32 ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0iic/Makefile#2 (text) ==== @@ -1,10 +1,10 @@ -# $FreeBSD: src/sys/boot/arm/at91/boot0iic/Makefile,v 1.1 2006/04/21 06:48:52 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/boot0iic/Makefile,v 1.2 2006/08/16 23:14:52 imp Exp $ .PATH: ${.CURDIR}/../boot0 P=boot0iic FILES=${P} -SRCS=arm_init.s main.c doit.c +SRCS=arm_init.s main.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0iic/main.c#2 (text) ==== @@ -21,15 +21,13 @@ * (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.1 2006/04/21 06:48:52 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/boot0iic/main.c,v 1.2 2006/08/16 23:14:52 imp Exp $ */ #include "at91rm9200.h" #include "lib.h" #include "at91rm9200_lowlevel.h" -extern void doit(void *); - int main(void) { @@ -37,6 +35,9 @@ while (xmodem_rx(addr) == -1) continue; - doit(addr); + InitEEPROM(); + printf("Writing EEPROM from 0x%x to addr 0\r\n", addr); + WriteEEPROM(0, addr, 8192); + printf("Write complete. Press reset\r\n"); return (1); } ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0spi/Makefile#2 (text) ==== @@ -1,10 +1,10 @@ -# $FreeBSD: src/sys/boot/arm/at91/boot0spi/Makefile,v 1.1 2006/04/21 06:51:08 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/boot0spi/Makefile,v 1.2 2006/08/16 23:18:07 imp Exp $ .PATH: ${.CURDIR}/../boot0 P=boot0spi FILES=${P} -SRCS=arm_init.s main.c doit.c +SRCS=arm_init.s main.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/boot0spi/main.c#2 (text) ==== @@ -21,22 +21,41 @@ * (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.1 2006/04/21 06:51:08 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/boot0spi/main.c,v 1.2 2006/08/16 23:18:07 imp Exp $ */ #include "at91rm9200.h" #include "lib.h" #include "at91rm9200_lowlevel.h" +#include "spi_flash.h" -extern void doit(void *); +#define OFFSET 0 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 */ - while (xmodem_rx(addr) == -1) + SPI_InitFlash(); + printf("Waiting for data\r\n"); + while ((len = xmodem_rx(addr)) == -1) continue; - doit(addr); + printf("\r\nDownloaded %u bytes.\r\n", len); + p_memcpy(addr3, addr, (len + FLASH_PAGE_SIZE - 1) / FLASH_PAGE_SIZE * FLASH_PAGE_SIZE); + printf("Writing %u bytes to flash at %u\r\n", len, OFFSET); + for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { + for (j = 0; j < 10; j++) { + off = i + OFFSET; + SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE); + SPI_ReadFlash(off, addr2 + i, FLASH_PAGE_SIZE); + if (p_memcmp(addr3 + i, addr2 + i, FLASH_PAGE_SIZE) == 0) + break; + } + if (j >= 10) + printf("Bad Readback at %u\r\n", i); + } return (1); } ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootiic/loader_prompt.c#2 (text+ko) ==== @@ -19,7 +19,7 @@ * only. * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/bootiic/loader_prompt.c,v 1.1 2006/08/10 19:55:52 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/bootiic/loader_prompt.c,v 1.2 2006/08/16 23:39:58 imp Exp $ *****************************************************************************/ #include "at91rm9200_lowlevel.h" @@ -266,7 +266,7 @@ if (argc > 6) { for (i = 0; i < 6; i++) mac[i] = p_ASCIIToHex(argv[i + 1]); - SetMACAddress(mac); + EMAC_SetMACAddress(mac); } break; } ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/Makefile#2 (text) ==== @@ -1,10 +1,14 @@ -# $FreeBSD: src/sys/boot/arm/at91/bootspi/Makefile,v 1.1 2006/04/19 17:16:48 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/bootspi/Makefile,v 1.2 2006/08/16 23:39:58 imp Exp $ P=bootspi FILES=${P} -SRCS=arm_init.s main.c +SRCS=arm_init.S main.c loader_prompt.c env_vars.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .include <bsd.prog.mk> + +.if ${MK_FPGA} != "no" +CFLAGS += -DTSC_FPGA +.endif ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/bootspi/main.c#2 (text) ==== @@ -1,57 +1,58 @@ -/******************************************************************************* +/*- + * Copyright (c) 2006 M. Warner Losh. All rights reserved. * - * Filename: main.c + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * Basic entry points for top-level functions + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin cosmetic changes - * 29APR2005 kb_admin modified boot delay + * This software is derived from software provided by kwikbyte without + * copyright as follows: * - * BEGIN_KBDD_BLOCK * No warranty, expressed or implied, is included with this software. It is * provided "AS IS" and no warranty of any kind including statutory or aspects * relating to merchantability or fitness for any purpose is provided. All * intellectual property rights of others is maintained with the respective * owners. This software is not copyrighted and is intended for reference * only. - * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/bootspi/main.c,v 1.1 2006/04/19 17:16:48 imp Exp $ - ******************************************************************************/ + * $FreeBSD: src/sys/boot/arm/at91/bootspi/main.c,v 1.2 2006/08/16 23:39:58 imp Exp $ + */ #include "env_vars.h" +#include "at91rm9200.h" #include "at91rm9200_lowlevel.h" #include "loader_prompt.h" #include "emac.h" #include "lib.h" +#include "spi_flash.h" -/* - * .KB_C_FN_DEFINITION_START - * int main(void) - * This global function waits at least one second, but not more than two - * seconds, for input from the serial port. If no response is recognized, - * it acts according to the parameters specified by the environment. For - * example, the function might boot an operating system. Do not return - * from this function. - * .KB_C_FN_DEFINITION_END - */ int main(void) { - + printf("\r\nBoot\r\n"); + SPI_InitFlash(); EMAC_Init(); - LoadBootCommands(); - - printf("\r\nSPI Boot loader.\r\nAutoboot...\r\n"); - - if (getc(1) == -1) + if (getc(1) == -1) { + start_wdog(30); ExecuteEnvironmentFunctions(); - - Bootloader(0); - + } + Bootloader(getc); return (1); } ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/Makefile#3 (text) ==== @@ -1,11 +1,12 @@ -# $FreeBSD: src/sys/boot/arm/at91/libat91/Makefile,v 1.3 2006/08/10 18:14:35 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/libat91/Makefile,v 1.4 2006/08/16 23:39:58 imp Exp $ .include "${.CURDIR}/../Makefile.inc" LIB= at91 INTERNALLIB= -SRCS=at91rm9200_lowlevel.c eeprom.c emac.c getc.c \ - p_string.c putchar.c printf.c spi_flash.c xmodem.c +SRCS=at91rm9200_lowlevel.c delay.c eeprom.c emac.c emac_init.c getc.c \ + p_string.c putchar.c printf.c reset.c spi_flash.c xmodem.c \ + sd-card.c mci_device.c NO_MAN= .if ${MK_TAG_LIST} != "no" ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/emac.c#3 (text) ==== @@ -19,7 +19,7 @@ * only. * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/libat91/emac.c,v 1.2 2006/08/10 18:11:22 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/libat91/emac.c,v 1.3 2006/08/16 23:39:58 imp Exp $ ******************************************************************************/ #include "at91rm9200.h" @@ -31,22 +31,14 @@ /* ********************** PRIVATE FUNCTIONS/DATA ******************************/ -static unsigned localMACSet, serverMACSet; -static unsigned char localMACAddr[6], serverMACAddr[6]; -static unsigned localMAClow, localMAChigh; -static unsigned localIPSet, serverIPSet; +static char serverMACAddr[6]; static unsigned char localIPAddr[4], serverIPAddr[4]; -static unsigned short serverPort, localPort; static int ackBlock; -static unsigned lastSize; static char *dlAddress; static unsigned transmitBuffer[1024 / sizeof(unsigned)]; static unsigned tftpSendPacket[256 / sizeof(unsigned)]; -receive_descriptor_t *p_rxBD; - - /* * .KB_C_FN_DEFINITION_START * unsigned short IP_checksum(unsigned short *p, int len) @@ -474,64 +466,8 @@ /* ************************** GLOBAL FUNCTIONS ********************************/ - /* * .KB_C_FN_DEFINITION_START - * void SetMACAddress(unsigned low_address, unsigned high_address) - * This global function sets the MAC address. low_address is the first - * four bytes while high_address is the last 2 bytes of the 48-bit value. - * .KB_C_FN_DEFINITION_END - */ -void -SetMACAddress(unsigned char mac[6]) -{ - AT91PS_PMC pPMC = AT91C_BASE_PMC; - AT91PS_EMAC pEmac = AT91C_BASE_EMAC; - - /* enable the peripheral clock before using EMAC */ - pPMC->PMC_PCER = ((unsigned) 1 << AT91C_ID_EMAC); - - p_memcpy(localMACAddr, mac, 6); - localMAClow = (mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5]; - localMAChigh = (mac[0] << 8) | mac[1]; - localMACSet = 1; - - AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_EMAC; - AT91C_BASE_PIOA->PIO_ASR = - AT91C_PA14_ERXER | AT91C_PA12_ERX0 | AT91C_PA13_ERX1 | - AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 | - AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC | - AT91C_PA7_ETXCK_EREFCK; - AT91C_BASE_PIOA->PIO_PDR = - AT91C_PA14_ERXER | AT91C_PA12_ERX0 | AT91C_PA13_ERX1 | - AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 | - AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC | - AT91C_PA7_ETXCK_EREFCK; -#ifdef BOOT_KB9202 /* Really !RMII */ - AT91C_BASE_PIOB->PIO_BSR = - AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER | - AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV | - AT91C_PB18_ECOL | AT91C_PB19_ERXCK; - AT91C_BASE_PIOB->PIO_PDR = - AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER | - AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV | - AT91C_PB18_ECOL | AT91C_PB19_ERXCK; -#endif - pEmac->EMAC_CTL = 0; - - pEmac->EMAC_CFG = (pEmac->EMAC_CFG & ~(AT91C_EMAC_CLK)) | -#ifdef BOOT_TSC - AT91C_EMAC_RMII | -#endif - AT91C_EMAC_CLK_HCLK_32 | AT91C_EMAC_CAF; - // the sequence write EMAC_SA1L and write EMAC_SA1H must be respected - pEmac->EMAC_SA1L = localMAClow; - pEmac->EMAC_SA1H = localMAChigh; -} - - -/* - * .KB_C_FN_DEFINITION_START * void SetServerIPAddress(unsigned address) * This global function sets the IP of the TFTP download server. * .KB_C_FN_DEFINITION_END @@ -624,22 +560,3 @@ if (timeout == 0) printf("TFTP TIMEOUT!\r\n"); } - - -/* - * .KB_C_FN_DEFINITION_START - * void EMAC_Init(void) - * This global function initializes variables used in tftp transfers. - * .KB_C_FN_DEFINITION_END - */ -void -EMAC_Init(void) -{ - p_rxBD = (receive_descriptor_t*)RX_BUFFER_START; - localMACSet = 0; - serverMACSet = 0; - localIPSet = 0; - serverIPSet = 0; - localPort = SWAP16(0x8002); - lastSize = 0; -} ==== //depot/projects/soc2006/rdivacky_linuxolator/boot/arm/at91/libat91/emac.h#3 (text) ==== @@ -17,14 +17,14 @@ * only. * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/libat91/emac.h,v 1.2 2006/08/10 18:11:22 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/libat91/emac.h,v 1.3 2006/08/16 23:39:58 imp Exp $ *****************************************************************************/ #ifndef _EMAC_H_ #define _EMAC_H_ -extern void SetMACAddress(unsigned char addr[6]); +extern void EMAC_SetMACAddress(unsigned char addr[6]); extern void SetServerIPAddress(unsigned address); extern void SetLocalIPAddress(unsigned address); extern void EMAC_Init(void); @@ -127,4 +127,12 @@ #define MII_SSTS_10HDX 0x1000 #endif +extern unsigned char localMACAddr[6]; +extern unsigned localMAClow, localMAChigh; +extern unsigned localMACSet, serverMACSet; +extern receive_descriptor_t *p_rxBD; +extern unsigned lastSize; +extern unsigned localIPSet, serverIPSet; +extern unsigned short serverPort, localPort; + #endif /* _EMAC_H_ */ ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/freebsd32/freebsd32.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.4 2004/04/14 23:17:37 peter Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32.h,v 1.5 2006/08/17 22:50:32 imp Exp $ */ #ifndef _COMPAT_FREEBSD32_FREEBSD32_H_ @@ -45,7 +45,7 @@ #define TV_CP(src,dst,fld) do { \ CP((src).fld,(dst).fld,tv_sec); \ CP((src).fld,(dst).fld,tv_usec); \ -} while (0); +} while (0) struct timespec32 { u_int32_t tv_sec; ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/freebsd32/syscalls.master#6 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.70 2006/07/28 19:05:26 jhb Exp $ + $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.71 2006/08/16 22:32:50 peter Exp $ ; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 ; from: src/sys/kern/syscalls.master 1.107 ; @@ -754,3 +754,5 @@ 466 AUE_NULL UNIMPL thr_setscheduler 467 AUE_NULL UNIMPL thr_getscheduler 468 AUE_NULL UNIMPL thr_setschedparam +469 AUE_NULL UNIMPL __getpath_fromfd +470 AUE_NULL UNIMPL __getpath_fromaddr ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_misc.c#23 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.182 2006/08/15 15:15:17 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.184 2006/08/17 21:21:30 netchild Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_signal.c#9 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_signal.c,v 1.57 2006/08/15 12:54:29 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_signal.c,v 1.58 2006/08/17 21:06:48 netchild Exp $"); #include <sys/param.h> #include <sys/systm.h> ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/ndis/ntoskrnl_var.h#2 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/ndis/ntoskrnl_var.h,v 1.42 2005/11/06 19:38:33 wpaul Exp $ + * $FreeBSD: src/sys/compat/ndis/ntoskrnl_var.h,v 1.43 2006/08/17 22:50:32 imp Exp $ */ #ifndef _NTOSKRNL_VAR_H_ @@ -1257,8 +1257,7 @@ (w)->wqi_func = (func); \ (w)->wqi_ctx = (ctx); \ InitializeListHead(&((w)->wqi_entry)); \ - } while (0); \ - + } while (0) /* * FreeBSD's kernel stack is 2 pages in size by default. The ==== //depot/projects/soc2006/rdivacky_linuxolator/conf/NOTES#7 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1377 2006/07/29 18:38:53 marcel Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1378 2006/08/17 00:37:03 julian Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -720,13 +720,10 @@ # # IPFIREWALL_FORWARD enables changing of the packet destination either # to do some sort of policy routing or transparent proxying. Used by -# ``ipfw forward''. +# ``ipfw forward''. All redirections apply to locally generated +# packets too. Because of this great care is required when +# crafting the ruleset. # -# IPFIREWALL_FORWARD_EXTENDED enables full packet destination changing -# including redirecting packets to local IP addresses and ports. All -# redirections apply to locally generated packets too. Because of this -# great care is required when crafting the ruleset. -# # IPSTEALTH enables code to support stealth forwarding (i.e., forwarding # packets without touching the ttl). This can be useful to hide firewalls # from traceroute and similar tools. @@ -742,7 +739,6 @@ options IPFIREWALL_VERBOSE_LIMIT=100 #limit verbosity options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default options IPFIREWALL_FORWARD #packet destination changes -options IPFIREWALL_FORWARD_EXTENDED #all packet dest changes options IPDIVERT #divert sockets options IPFILTER #ipfilter support options IPFILTER_LOG #ipfilter logging ==== //depot/projects/soc2006/rdivacky_linuxolator/conf/options#8 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.556 2006/08/03 05:19:33 jb Exp $ +# $FreeBSD: src/sys/conf/options,v 1.557 2006/08/17 00:37:03 julian Exp $ # # On the handling of kernel options # @@ -369,7 +369,6 @@ IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h IPFIREWALL_FORWARD opt_ipfw.h -IPFIREWALL_FORWARD_EXTENDED opt_ipfw.h IPSTEALTH IPX IPXIP opt_ipx.h ==== //depot/projects/soc2006/rdivacky_linuxolator/dev/arl/if_arlreg.h#2 (text+ko) ==== @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $RISS: if_arl/dev/arl/if_arlreg.h,v 1.4 2004/03/16 04:43:27 count Exp $ - * $FreeBSD: src/sys/dev/arl/if_arlreg.h,v 1.6 2005/06/10 16:49:04 brooks Exp $ + * $FreeBSD: src/sys/dev/arl/if_arlreg.h,v 1.7 2006/08/17 22:50:32 imp Exp $ */ #ifndef _IF_ARLREG_H @@ -322,7 +322,7 @@ for (i = cnt; i && ar->resetFlag; i--) { \ DELAY(delay); \ } \ - } while (0); + } while (0) #ifdef _KERNEL void arl_release_resources (device_t); ==== //depot/projects/soc2006/rdivacky_linuxolator/dev/ata/ata-chipset.c#8 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.169 2006/08/14 19:39:33 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.170 2006/08/18 00:01:29 imp Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -2533,7 +2533,7 @@ /* fill in this request */ quadp[0] = (long)ch->dma->sg_bus & 0xffffffff; - quadp[1] = (ch->dma->sg_bus & 0xffffffff00000000) >> 32; + quadp[1] = (ch->dma->sg_bus & 0xffffffff00000000ull) >> 32; wordp[4] = (request->flags & ATA_R_READ ? 0x01 : 0x00) | (tag<<1); i = 10; ==== //depot/projects/soc2006/rdivacky_linuxolator/dev/ath/if_athvar.h#4 (text+ko) ==== @@ -33,7 +33,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGES. * - * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.50 2006/06/26 03:10:45 sam Exp $ + * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.51 2006/08/17 22:50:32 imp Exp $ */ /* @@ -149,7 +149,7 @@ snprintf((_tq)->axq_name, sizeof((_tq)->axq_name), "%s_txq%u", \ device_get_nameunit((_sc)->sc_dev), (_tq)->axq_qnum); \ mtx_init(&(_tq)->axq_lock, (_tq)->axq_name, "ath_txq", MTX_DEF); \ -} while (0); +} while (0) #define ATH_TXQ_LOCK_DESTROY(_tq) mtx_destroy(&(_tq)->axq_lock) #define ATH_TXQ_LOCK(_tq) mtx_lock(&(_tq)->axq_lock) #define ATH_TXQ_UNLOCK(_tq) mtx_unlock(&(_tq)->axq_lock) ==== //depot/projects/soc2006/rdivacky_linuxolator/dev/bge/if_bge.c#5 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.136 2006/08/07 12:51:50 glebius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.137 2006/08/17 09:53:04 glebius Exp $"); /* * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. @@ -330,7 +330,7 @@ static void bge_tick(void *); static void bge_stats_update(struct bge_softc *); static void bge_stats_update_regs(struct bge_softc *); -static int bge_encap(struct bge_softc *, struct mbuf *, uint32_t *); +static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); static void bge_start_locked(struct ifnet *); @@ -2894,50 +2894,37 @@ * pointers to descriptors. */ static int -bge_encap(struct bge_softc *sc, struct mbuf *m_head, uint32_t *txidx) +bge_encap(struct bge_softc *sc, struct mbuf **m_head, uint32_t *txidx) { bus_dma_segment_t segs[BGE_NSEG_NEW]; bus_dmamap_t map; - struct bge_tx_bd *d = NULL; + struct bge_tx_bd *d; + struct mbuf *m = *m_head; struct m_tag *mtag; uint32_t idx = *txidx; - uint16_t csum_flags = 0; + uint16_t csum_flags; int nsegs, i, error; - if (m_head->m_pkthdr.csum_flags) { - if (m_head->m_pkthdr.csum_flags & CSUM_IP) - csum_flags |= BGE_TXBDFLAG_IP_CSUM; - if (m_head->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) { - csum_flags |= BGE_TXBDFLAG_TCP_UDP_CSUM; - if (m_head->m_pkthdr.len < ETHER_MIN_NOPAD && - bge_cksum_pad(m_head) != 0) - return (ENOBUFS); - } - if (m_head->m_flags & M_LASTFRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG_END; - else if (m_head->m_flags & M_FRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG; - } - - mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m_head); - map = sc->bge_cdata.bge_tx_dmamap[idx]; - error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, - m_head, segs, &nsegs, BUS_DMA_NOWAIT); - if (error) { - if (error == EFBIG) { - struct mbuf *m0; - - m0 = m_defrag(m_head, M_DONTWAIT); - if (m0 == NULL) - return (ENOBUFS); - m_head = m0; - error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, - map, m_head, segs, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, m, segs, + &nsegs, BUS_DMA_NOWAIT); + if (error == EFBIG) { + m = m_defrag(m, M_DONTWAIT); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOBUFS); } - if (error) + *m_head = m; + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, m, + segs, &nsegs, BUS_DMA_NOWAIT); + if (error) { + m_freem(m); + *m_head = NULL; return (error); - } + } + } else if (error != 0) + return (error); /* * Sanity check: avoid coming within 16 descriptors @@ -2948,6 +2935,26 @@ return (ENOBUFS); } + csum_flags = 0; + if (m->m_pkthdr.csum_flags) { + if (m->m_pkthdr.csum_flags & CSUM_IP) + csum_flags |= BGE_TXBDFLAG_IP_CSUM; + if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) { + csum_flags |= BGE_TXBDFLAG_TCP_UDP_CSUM; + if (m->m_pkthdr.len < ETHER_MIN_NOPAD && + (error = bge_cksum_pad(m)) != 0) { + bus_dmamap_unload(sc->bge_cdata.bge_mtag, map); + m_freem(m); + *m_head = NULL; + return (error); + } + } + if (m->m_flags & M_LASTFRAG) + csum_flags |= BGE_TXBDFLAG_IP_FRAG_END; + else if (m->m_flags & M_FRAG) + csum_flags |= BGE_TXBDFLAG_IP_FRAG; + } + bus_dmamap_sync(sc->bge_cdata.bge_mtag, map, BUS_DMASYNC_PREWRITE); for (i = 0; ; i++) { @@ -2963,9 +2970,10 @@ /* Mark the last segment as end of packet... */ d->bge_flags |= BGE_TXBDFLAG_END; + /* ... and put VLAN tag into first segment. */ d = &sc->bge_ldata.bge_tx_ring[*txidx]; - if (mtag != NULL) { + if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { d->bge_flags |= BGE_TXBDFLAG_VLAN_TAG; d->bge_vlan_tag = VLAN_TAG_VALUE(mtag); } else @@ -2978,7 +2986,7 @@ */ sc->bge_cdata.bge_tx_dmamap[*txidx] = sc->bge_cdata.bge_tx_dmamap[idx]; sc->bge_cdata.bge_tx_dmamap[idx] = map; - sc->bge_cdata.bge_tx_chain[idx] = m_head; + sc->bge_cdata.bge_tx_chain[idx] = m; sc->bge_txcnt += nsegs; BGE_INC(idx, BGE_TX_RING_CNT); @@ -3039,7 +3047,9 @@ * don't have room, set the OACTIVE flag and wait * for the NIC to drain the ring. */ - if (bge_encap(sc, m_head, &prodidx)) { + if (bge_encap(sc, &m_head, &prodidx)) { + if (m_head == NULL) + break; IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; ==== //depot/projects/soc2006/rdivacky_linuxolator/dev/em/if_em.c#8 (text+ko) ==== @@ -31,7 +31,7 @@ ***************************************************************************/ -/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.131 2006/08/14 09:52:35 glebius Exp $*/ +/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.132 2006/08/16 23:55:34 yongari Exp $*/ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -2865,8 +2865,6 @@ rx_buffer->m_head = m; adapter->rx_desc_base[i].buffer_addr = htole64(segs[0].ds_addr); - /* Zero out the receive descriptors status. */ - adapter->rx_desc_base[i].status = 0; return (0); } @@ -3123,6 +3121,7 @@ /* Pointer to the receive descriptor being examined. */ struct em_rx_desc *current_desc; + uint8_t status; ifp = adapter->ifp; i = adapter->next_rx_desc_to_check; @@ -3149,7 +3148,8 @@ accept_frame = 1; prev_len_adj = 0; desc_len = le16toh(current_desc->length); - if (current_desc->status & E1000_RXD_STAT_EOP) { + status = current_desc->status; + if (status & E1000_RXD_STAT_EOP) { count--; eop = 1; if (desc_len < ETHER_CRC_LEN) { @@ -3170,9 +3170,8 @@ pkt_len += adapter->fmp->m_pkthdr.len; last_byte = *(mtod(mp, caddr_t) + desc_len - 1); - if (TBI_ACCEPT(&adapter->hw, current_desc->status, - current_desc->errors, - pkt_len, last_byte)) { + if (TBI_ACCEPT(&adapter->hw, status, + current_desc->errors, pkt_len, last_byte)) { em_tbi_adjust_stats(&adapter->hw, &adapter->stats, pkt_len, adapter->hw.mac_addr); @@ -3224,7 +3223,7 @@ em_fixup_rx(adapter) != 0) goto skip; #endif - if (current_desc->status & E1000_RXD_STAT_VP) + if (status & E1000_RXD_STAT_VP) VLAN_INPUT_TAG(ifp, adapter->fmp, (le16toh(current_desc->special) & E1000_RXD_SPC_VLAN_MASK)); @@ -3250,11 +3249,11 @@ adapter->fmp = NULL; adapter->lmp = NULL; } - /* Zero out the receive descriptors status. */ - adapter->rx_desc_base[i].status = 0; m = NULL; } + /* Zero out the receive descriptors status. */ + current_desc->status = 0; bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ==== //depot/projects/soc2006/rdivacky_linuxolator/dev/ips/ips.h#2 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ips/ips.h,v 1.16 2005/11/29 09:39:41 scottl Exp $ + * $FreeBSD: src/sys/dev/ips/ips.h,v 1.17 2006/08/17 22:50:32 imp Exp $ */ #ifndef _IPS_H #define _IPS_H @@ -74,7 +74,7 @@ #define ips_set_error(command, error) do { \ (command)->status.fields.basic_status = IPS_DRV_ERROR; \ (command)->status.fields.reserved = ((error) & 0x0f); \ -} while (0); +} while (0) #ifndef IPS_DEBUG #define DEVICE_PRINTF(x...) ==== //depot/projects/soc2006/rdivacky_linuxolator/dev/usb/usb_port.h#2 (text+ko) ==== @@ -1,6 +1,6 @@ /* $OpenBSD: usb_port.h,v 1.18 2000/09/06 22:42:10 rahnds Exp $ */ /* $NetBSD: usb_port.h,v 1.68 2005/07/30 06:14:50 skrll Exp $ */ -/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.78 2006/03/01 06:31:24 imp Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.79 2006/08/17 22:42:56 imp Exp $ */ /* Also already merged from NetBSD: * $NetBSD: usb_port.h,v 1.57 2002/09/27 20:42:01 thorpej Exp $ @@ -437,7 +437,7 @@ device_detach(dev); \ free(uaap, M_USB); \ device_delete_child(device_get_parent(dev), dev); \ - } while (0); + } while (0) typedef struct malloc_type *usb_malloc_type; @@ -493,7 +493,7 @@ do { \ sc->sc_dev = self; \ device_set_desc_copy(self, devinfo); \ - } while (0); + } while (0) #define USB_DETACH(dname) \ Static int \ ==== //depot/projects/soc2006/rdivacky_linuxolator/fs/msdosfs/denode.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/fs/msdosfs/denode.h,v 1.33 2005/04/07 07:55:37 phk Exp $ */ +/* $FreeBSD: src/sys/fs/msdosfs/denode.h,v 1.34 2006/08/17 22:50:33 imp Exp $ */ /* $NetBSD: denode.h,v 1.25 1997/11/17 15:36:28 ws Exp $ */ /*- @@ -241,7 +241,7 @@ (dep)->de_flag |= DE_MODIFIED; \ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608180725.k7I7PvZB059286>