From owner-p4-projects@FreeBSD.ORG Sun Feb 8 00:15:05 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B5E6B106567C; Sun, 8 Feb 2009 00:15:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 722A71065676; Sun, 8 Feb 2009 00:15:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 16B558FC25; Sun, 8 Feb 2009 00:15:04 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n180Ewqx085834; Sat, 7 Feb 2009 17:14:58 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 07 Feb 2009 17:14:59 -0700 (MST) Message-Id: <20090207.171459.835090967.imp@bsdimp.com> To: gonzo@freebsd.org From: "M. Warner Losh" In-Reply-To: <200902072354.n17Ns2B2044214@repoman.freebsd.org> References: <200902072354.n17Ns2B2044214@repoman.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: perforce@freebsd.org Subject: Re: PERFORCE change 157347 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: Sun, 08 Feb 2009 00:15:06 -0000 In message: <200902072354.n17Ns2B2044214@repoman.freebsd.org> Oleksandr Tymoshenko writes: : ==== //depot/projects/avr32/src/share/mk/bsd.endian.mk#2 (text+ko) ==== : : @@ -4,6 +4,7 @@ : ${MACHINE_ARCH} == "i386" || \ : ${MACHINE_ARCH} == "ia64" || \ : (${MACHINE_ARCH} == "arm" && !defined(TARGET_BIG_ENDIAN)) || \ : + ${MACHINE_ARCH} == "avr32" || \ : (${MACHINE_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN)) : TARGET_ENDIANNESS= 1234 : .elif ${MACHINE_ARCH} == "powerpc" || \ We've *GOT* to find a better way of doing this. Warner From owner-p4-projects@FreeBSD.ORG Sun Feb 8 05:39:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C4D1C1065672; Sun, 8 Feb 2009 05:39:53 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75357106566C for ; Sun, 8 Feb 2009 05:39:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 638558FC16 for ; Sun, 8 Feb 2009 05:39:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n185drxg097682 for ; Sun, 8 Feb 2009 05:39:53 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n185drmi097680 for perforce@freebsd.org; Sun, 8 Feb 2009 05:39:53 GMT (envelope-from gonzo@FreeBSD.org) Date: Sun, 8 Feb 2009 05:39:53 GMT Message-Id: <200902080539.n185drmi097680@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 157352 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: Sun, 08 Feb 2009 05:39:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=157352 Change 157352 by gonzo@gonzo_figaro on 2009/02/08 05:39:17 - AVR32 is big-endian. Put the condition to wrong place. Shame on me Affected files ... .. //depot/projects/avr32/src/share/mk/bsd.endian.mk#3 edit Differences ... ==== //depot/projects/avr32/src/share/mk/bsd.endian.mk#3 (text+ko) ==== @@ -4,12 +4,12 @@ ${MACHINE_ARCH} == "i386" || \ ${MACHINE_ARCH} == "ia64" || \ (${MACHINE_ARCH} == "arm" && !defined(TARGET_BIG_ENDIAN)) || \ - ${MACHINE_ARCH} == "avr32" || \ (${MACHINE_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN)) TARGET_ENDIANNESS= 1234 .elif ${MACHINE_ARCH} == "powerpc" || \ ${MACHINE_ARCH} == "sparc64" || \ ${MACHINE_ARCH} == "arm" || \ + ${MACHINE_ARCH} == "avr32" || \ ${MACHINE_ARCH} == "mips" TARGET_ENDIANNESS= 4321 .endif From owner-p4-projects@FreeBSD.ORG Sun Feb 8 07:19:37 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1D84E1065673; Sun, 8 Feb 2009 07:19:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFD8B106564A for ; Sun, 8 Feb 2009 07:19:36 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BD0AD8FC19 for ; Sun, 8 Feb 2009 07:19:36 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n187JaKw007438 for ; Sun, 8 Feb 2009 07:19:36 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n187Ja2P007436 for perforce@freebsd.org; Sun, 8 Feb 2009 07:19:36 GMT (envelope-from andrew@freebsd.org) Date: Sun, 8 Feb 2009 07:19:36 GMT Message-Id: <200902080719.n187Ja2P007436@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157355 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: Sun, 08 Feb 2009 07:19:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=157355 Change 157355 by andrew@andrew_bender on 2009/02/08 07:19:02 Move the definitions common to s3c2410 and s3c2440 to the common header and rename ass appropriate. Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/neo1973_machdep.c#11 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c2410reg.h#6 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0.c#3 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_mci.c#5 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_nand.c#4 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0reg.h#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/s3c2xx0/neo1973_machdep.c#11 (text+ko) ==== @@ -147,9 +147,9 @@ /* * Map the IRQ Controller */ - _A(S3C2410_INTCTL_BASE), - _A(S3C2410_INTCTL_BASE), - _S(S3C2410_INTCTL_SIZE), + _A(S3C24X0_INTCTL_BASE), + _A(S3C24X0_INTCTL_BASE), + _S(S3C24X0_INTCTL_SIZE), VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, @@ -157,9 +157,9 @@ /* * Map the UART to VA == PA */ - _A(S3C2410_UART0_BASE), - _A(S3C2410_UART0_BASE), - _S(S3C2410_UART_BASE(3) - S3C2410_UART0_BASE), + _A(S3C24X0_UART0_BASE), + _A(S3C24X0_UART0_BASE), + _S(S3C24X0_UART_BASE(3) - S3C24X0_UART0_BASE), VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, @@ -167,9 +167,9 @@ /* * Map the LCD to VA == PA */ - _A(S3C2410_LCDC_BASE), - _A(S3C2410_LCDC_BASE), - _S(S3C2410_LCDC_SIZE), + _A(S3C24X0_LCDC_BASE), + _A(S3C24X0_LCDC_BASE), + _S(S3C24X0_LCDC_SIZE), VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, @@ -177,8 +177,8 @@ /* * Map the MMC/SD to VA == PA */ - _A(S3C2410_SDI_BASE), - _A(S3C2410_SDI_BASE), + _A(S3C24X0_SDI_BASE), + _A(S3C24X0_SDI_BASE), _S(S3C2410_SDI_SIZE), VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, @@ -187,8 +187,8 @@ /* * Map the IIC to VA == PA */ - _A(S3C2410_IIC_BASE), - _A(S3C2410_IIC_BASE), + _A(S3C24X0_IIC_BASE), + _A(S3C24X0_IIC_BASE), _S(S3C24X0_IIC_SIZE), VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, @@ -374,8 +374,8 @@ cpu_idcache_wbinv_all(); /* Disable all peripheral interrupts */ - ioreg_write32(S3C2410_INTCTL_BASE + INTCTL_INTMSK, ~0); - s3c2410_uart_vaddr = S3C2410_UART0_BASE; + ioreg_write32(S3C24X0_INTCTL_BASE + INTCTL_INTMSK, ~0); + s3c2410_uart_vaddr = S3C24X0_UART_BASE(0); cninit(); /* Set stack for exception handlers */ ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c2410reg.h#6 (text+ko) ==== @@ -39,9 +39,7 @@ #ifndef _ARM_S3C2XX0_S3C2410REG_H_ #define _ARM_S3C2XX0_S3C2410REG_H_ -/* common definitions for S3C2800, S3C2400 and S3C2410 */ -#include -/* common definitions for S3C2400 and S3C2410 */ +/* common definitions for S3C2410 and S3C2440 */ #include /* @@ -51,100 +49,19 @@ #define S3C2410_BANK_START(n) (S3C2410_BANK_SIZE*(n)) #define S3C2410_SDRAM_START S3C2410_BANK_START(6) -/* - * Physical address of integrated peripherals - */ -#define S3C2410_MEMCTL_BASE 0x48000000 /* memory controller */ -#define S3C2410_USBHC_BASE 0x49000000 /* USB Host controller */ -#define S3C2410_INTCTL_BASE 0x4a000000 /* Interrupt controller */ -#define S3C2410_DMAC_BASE 0x4b000000 -#define S3C2410_DMAC_SIZE 0xe4 -#define S3C2410_CLKMAN_BASE 0x4c000000 /* clock & power management */ -#define S3C2410_LCDC_BASE 0x4d000000 /* LCD controller */ -#define S3C2410_LCDC_SIZE 0x60 -#define S3C2410_NANDFC_BASE 0x4e000000 /* NAND Flash controller */ -#define S3C2410_NANDFC_SIZE 0x18 -#define S3C2410_UART0_BASE 0x50000000 -#define S3C2410_UART_BASE(n) (S3C2410_UART0_BASE+0x4000*(n)) -#define S3C2410_TIMER_BASE 0x51000000 -#define S3C2410_USBDC_BASE 0x5200140 -#define S3C2410_USBDC_SIZE 0x130 -#define S3C2410_WDT_BASE 0x53000000 -#define S3C2410_IIC_BASE 0x54000000 -#define S3C2410_IIS_BASE 0x55000000 -#define S3C2410_GPIO_BASE 0x56000000 -#define S3C2410_GPIO_SIZE 0xb4 -#define S3C2410_ADC_BASE 0x58000000 -#define S3C2410_ADC_SIZE 0x14 -#define S3C2410_SPI0_BASE 0x59000000 -#define S3C2410_SPI1_BASE 0x59000020 -#define S3C2410_SDI_BASE 0x5a000000 /* SD Interface */ -#define S3C2410_SDI_SIZE 0x44 - -#define S3C2410_REG_BASE 0x48000000 -#define S3C2410_REG_SIZE 0x13000000 -/* interrupt control (additional defs for 2410) */ -#define ICU_LEN (32+11) - -#define INTCTL_SUBSRCPND 0x18 /* sub source pending (2410 only) */ -#define INTCTL_INTSUBMSK 0x1c /* sub mask (2410 only) */ - -/* 2410 has more than 32 interrupt sources. These are sub-sources - * that are OR-ed into main interrupt sources, and controlled via - * SUBSRCPND and SUBSRCMSK registers */ - -#define S3C2410_SUBIRQ_MIN 32 -#define S3C2410_SUBIRQ_MAX (32+10) - -/* cascaded to INT_ADCTC */ -#define S3C2410_INT_ADC (S3C2410_SUBIRQ_MIN+10) /* AD converter */ -#define S3C2410_INT_TC (S3C2410_SUBIRQ_MIN+9) /* Touch screen */ -/* cascaded to INT_UART2 */ -#define S3C2410_INT_ERR2 (S3C2410_SUBIRQ_MIN+8) /* UART2 Error interrupt */ -#define S3C2410_INT_TXD2 (S3C2410_SUBIRQ_MIN+7) /* UART2 Tx interrupt */ -#define S3C2410_INT_RXD2 (S3C2410_SUBIRQ_MIN+6) /* UART2 Rx interrupt */ -/* cascaded to INT_UART1 */ -#define S3C2410_INT_ERR1 (S3C2410_SUBIRQ_MIN+5) /* UART1 Error interrupt */ -#define S3C2410_INT_TXD1 (S3C2410_SUBIRQ_MIN+4) /* UART1 Tx interrupt */ -#define S3C2410_INT_RXD1 (S3C2410_SUBIRQ_MIN+3) /* UART1 Rx interrupt */ -/* cascaded to INT_UART0 */ -#define S3C2410_INT_ERR0 (S3C2410_SUBIRQ_MIN+2) /* UART0 Error interrupt */ -#define S3C2410_INT_TXD0 (S3C2410_SUBIRQ_MIN+1) /* UART0 Tx interrupt */ -#define S3C2410_INT_RXD0 (S3C2410_SUBIRQ_MIN+0) /* UART0 Rx interrupt */ - -#define S3C2410_INTCTL_SIZE 0x20 +/* interrupt control */ +#define S3C2410_SUBIRQ_MAX (S3C24X0_SUBIRQ_MIN+10) - /* Clock control */ -#define CLKMAN_LOCKTIME 0x00 -#define CLKMAN_MPLLCON 0x04 -#define CLKMAN_UPLLCON 0x08 -#define CLKMAN_CLKCON 0x0c -#define CLKCON_SPI (1<<18) -#define CLKCON_IIS (1<<17) -#define CLKCON_IIC (1<<16) -#define CLKCON_ADC (1<<15) -#define CLKCON_RTC (1<<14) -#define CLKCON_GPIO (1<<13) -#define CLKCON_UART2 (1<<12) -#define CLKCON_UART1 (1<<11) -#define CLKCON_UART0 (1<<10) /* PCLK to UART0 */ -#define CLKCON_SDI (1<<9) -#define CLKCON_TIMER (1<<8) /* PCLK to TIMER */ -#define CLKCON_USBD (1<<7) /* PCLK to USB device controller */ -#define CLKCON_USBH (1<<6) /* PCLK to USB host controller */ -#define CLKCON_LCDC (1<<5) /* PCLK to LCD controller */ -#define CLKCON_NANDFC (1<<4) /* PCLK to NAND Flash controller */ -#define CLKCON_IDLE (1<<2) /* 1=transition to IDLE mode */ +/* CLKMAN_CLKCON */ #define CLKCON_STOP (1<<0) /* 1=transition to STOP mode */ -#define CLKMAN_CLKSLOW 0x10 -#define CLKMAN_CLKDIVN 0x14 +/* CLKMAN_CLKDIVN */ #define CLKDIVN_HDIVN (1<<1) /* hclk=fclk/2 */ -#define CLKDIVN_PDIVN (1<<0) /* pclk=hclk/2 */ /* NAND Flash controller */ -#define NANDFC_NFCONF 0x00 /* Configuration */ +#define S3C2410_NANDFC_SIZE 0x18 +/* NANDFC_NFCONF */ #define NFCONF_ENABLE (1<<15) /* NAND controller enabled */ #define NFCONF_ECC (1<<12) /* Initialize ECC decoder/encoder */ #define NFCONF_FCE (1<<11) /* Flash chip enabled */ @@ -155,127 +72,18 @@ #define NANDFC_NFADDR 0x08 /* address */ #define NANDFC_NFDATA 0x0c /* data */ #define NANDFC_NFSTAT 0x10 /* operation status */ -#define NFSTAT_READY (1<<0) /* NAND flash memory ready/busy status */ #define NANDFC_NFECC 0x14 /* ecc */ /* GPIO */ -#define GPIO_PACON 0x00 /* port A configuration */ -#define PCON_INPUT 0 /* Input port */ -#define PCON_OUTPUT 1 /* Output port */ -#define PCON_ALTFUN 2 /* Alternate function */ -#define PCON_ALTFUN2 3 /* Alternate function */ -#define GPIO_PADAT 0x04 /* port A data */ -#define GPIO_PBCON 0x10 -#define GPIO_PBDAT 0x14 -#define GPIO_PBUP 0x18 -#define GPIO_PCCON 0x20 -#define GPIO_PCDAT 0x24 -#define GPIO_PCUP 0x28 -#define GPIO_PDCON 0x30 -#define GPIO_PDDAT 0x34 -#define GPIO_PDUP 0x38 -#define GPIO_PECON 0x40 -#define GPIO_PEDAT 0x44 -#define GPIO_PEUP 0x48 -#define GPIO_PFCON 0x50 -#define GPIO_PFDAT 0x54 -#define GPIO_PFUP 0x58 -#define GPIO_PGCON 0x60 -#define GPIO_PGDAT 0x64 -#define GPIO_PGUP 0x68 -#define GPIO_PHCON 0x70 -#define GPIO_PHDAT 0x74 -#define GPIO_PHUP 0x78 -#define GPIO_MISCCR 0x80 /* miscellaneous control */ -#define GPIO_DCLKCON 0x84 /* DCLK 0/1 */ -#define GPIO_EXTINT(n) (0x88+4*(n)) /* external int control 0/1/2 */ -#define GPIO_EINTFLT(n) (0x94+4*(n)) /* external int filter control 0..3 */ -#define GPIO_EINTMASK 0xa4 -#define GPIO_EINTPEND 0xa8 -#define GPIO_GSTATUS0 0xac /* external pin status */ -#define GPIO_GSTATUS1 0xb0 /* external pin status */ - -#define GPIO_SET_FUNC(v,port,func) \ - (((v) & ~(3<<(2*(port))))|((func)<<(2*(port)))) - -#define EXTINTR_LOW 0x00 -#define EXTINTR_HIGH 0x01 -#define EXTINTR_FALLING 0x02 -#define EXTINTR_RISING 0x04 -#define EXTINTR_BOTH 0x06 +#define S3C2410_GPIO_SIZE 0xb4 /* SD interface */ -#define SDI_CON 0x00 -#define SDI_PRE 0x04 -#define SDI_CARG 0x08 -#define SDI_CCON 0x0c -#define CCON_ABORDCMD (1<<12) /* Abort SDIO CMD12/52 */ -#define CCON_WITHDATA (1<<11) /* CMD with data */ -#define CCON_LONGRSP (1<<10) /* 136 bit response */ -#define CCON_WAITRSP (1<<9) /* Host waits for response */ -#define CCON_CMD_START (1<<8) -#define CCON_CMDINDEX_MASK (0x7F) /* Command number index */ -#define SDI_CSTA 0x10 -#define CSTA_RSPFAIL (1<<12) -#define CSTA_CMDSENT (1<<11) -#define CSTA_CMDTOUT (1<<10) -#define CSTA_RSPFIN (1<<9) -#define CSTA_CMDON (1<<8) -#define SDI_RSP0 0x14 -#define SDI_RSP1 0x18 -#define SDI_RSP2 0x1c -#define SDI_RSP3 0x20 -#define SDI_DTIMER 0x24 -#define SDI_BSIZE 0x28 -#define SDI_DCON 0x2c -#define DCON_PRDTYPE (1<<21) -#define DCON_TARSP (1<<20) /* Transmit after response */ -#define DCON_RACMD (1<<19) /* Receive after command */ -#define DCON_BACMD (1<<18) /* Busy after command */ -#define DCON_BLKMODE (1<<17) /* Stream/Block mode */ -#define DCON_WIDEBUS (1<<16) /* Standard/Wide bus */ -#define DCON_ENDMA (1<<15) /* DMA Enable */ +#define S3C2410_SDI_SIZE 0x44 #define DCON_STOP (1<<14) /* Force the transfer to stop */ -/* Determine the direction of the data transfer */ -#define DCON_DATA_READY (0<<12) /* No transfer */ -#define DCON_ONLYBUST (1<<12) /* Check if busy */ -#define DCON_DATA_RECEIVE (2<<12) /* Receive data from SD */ -#define DCON_DATA_TRANSMIT (3<<12) /* Send data to SD */ -#define DCON_BLKNUM_MASK (0x7FF) /* Block number */ -#define SDI_DCNT 0x30 -#define SDI_DSTA 0x34 -#define SDI_FSTA 0x38 -#define SDI_DAT 0x3c -#define SDI_IMSK 0x40 /* Interrupt mask */ +#define S3C2410_SDI_DAT 0x3c +#define S3C2410_SDI_IMSK 0x40 /* Interrupt mask */ /* ADC */ -/* XXX: ADCCON register is common to both S3C2410 and S3C2400, - * but other registers are different. - */ -#define ADC_ADCCON 0x00 -#define ADCCON_ENABLE_START (1<<0) -#define ADCCON_READ_START (1<<1) -#define ADCCON_STDBM (1<<2) -#define ADCCON_SEL_MUX_SHIFT 3 -#define ADCCON_SEL_MUX_MASK (0x7< #include #include -#include +#include #include #define S3C2XX0_XTAL_CLK 12000000 @@ -190,20 +190,20 @@ if (type == SYS_RES_IRQ && start == end) { switch (start) { case S3C24X0_INT_ADCTC: - start = S3C2410_INT_TC; - end = S3C2410_INT_ADC; + start = S3C24X0_INT_TC; + end = S3C24X0_INT_ADC; break; - case S3C2410_INT_UART0: - start = S3C2410_INT_RXD0; - end = S3C2410_INT_ERR0; + case S3C24X0_INT_UART0: + start = S3C24X0_INT_RXD0; + end = S3C24X0_INT_ERR0; break; - case S3C2410_INT_UART1: - start = S3C2410_INT_RXD1; - end = S3C2410_INT_ERR1; + case S3C24X0_INT_UART1: + start = S3C24X0_INT_RXD1; + end = S3C24X0_INT_ERR1; break; - case S3C2410_INT_UART2: - start = S3C2410_INT_RXD2; - end = S3C2410_INT_ERR2; + case S3C24X0_INT_UART2: + start = S3C24X0_INT_RXD2; + end = S3C24X0_INT_ERR2; break; default: break; @@ -304,43 +304,43 @@ sc->sc_sx.sc_iot = iot = &s3c2xx0_bs_tag; if (bus_space_map(iot, - S3C2410_INTCTL_BASE, S3C2410_INTCTL_SIZE, + S3C24X0_INTCTL_BASE, S3C24X0_INTCTL_SIZE, BUS_SPACE_MAP_LINEAR, &sc->sc_sx.sc_intctl_ioh)) panic("Cannot map registers"); /* Map the GPIO registers */ - if (bus_space_map(iot, S3C2410_GPIO_BASE, S3C2410_GPIO_SIZE, + if (bus_space_map(iot, S3C24X0_GPIO_BASE, S3C2410_GPIO_SIZE, 0, &sc->sc_sx.sc_gpio_ioh)) panic("Cannot map GPIO registers"); /* Memory controller */ - if (bus_space_map(iot, S3C2410_MEMCTL_BASE, + if (bus_space_map(iot, S3C24X0_MEMCTL_BASE, S3C24X0_MEMCTL_SIZE, 0, &sc->sc_sx.sc_memctl_ioh)) panic("cannot map MEMC"); /* Clock manager */ - if (bus_space_map(iot, S3C2410_CLKMAN_BASE, + if (bus_space_map(iot, S3C24X0_CLKMAN_BASE, S3C24X0_CLKMAN_SIZE, 0, &sc->sc_sx.sc_clkman_ioh)) panic("cannot map clock"); /* LCD controller */ - if (bus_space_map(iot, S3C2410_LCDC_BASE, - S3C2410_LCDC_SIZE, 0, &sc->sc_sx.sc_lcd_ioh)) + if (bus_space_map(iot, S3C24X0_LCDC_BASE, + S3C24X0_LCDC_SIZE, 0, &sc->sc_sx.sc_lcd_ioh)) panic("cannot map LCD"); /* MMC/SD */ - if (bus_space_map(iot, S3C2410_SDI_BASE, + if (bus_space_map(iot, S3C24X0_SDI_BASE, S3C2410_SDI_SIZE, 0, &sc->sc_sx.sc_mci_ioh)) panic("cannot map MMC/SD"); /* I2C */ - if (bus_space_map(iot, S3C2410_IIC_BASE, + if (bus_space_map(iot, S3C24X0_IIC_BASE, S3C24X0_IIC_SIZE, 0, &sc->sc_sx.sc_iic_ioh)) panic("cannot map IIC"); #if 0 /* Real time clock */ - if (bus_space_map(iot, S3C2410_RTC_BASE, + if (bus_space_map(iot, S3C24X0_RTC_BASE, S3C24X0_RTC_SIZE, 0, &sc->sc_sx.sc_rtc_ioh)) FAIL("RTC"); #endif - if (bus_space_map(iot, S3C2410_TIMER_BASE, + if (bus_space_map(iot, S3C24X0_TIMER_BASE, S3C24X0_TIMER_SIZE, 0, &sc->sc_timer_ioh)) panic("cannot map TIMER"); @@ -360,33 +360,33 @@ * Attach children devices */ s3c2xx0_softc->s3c2xx0_irq_rman.rm_type = RMAN_ARRAY; - s3c2xx0_softc->s3c2xx0_irq_rman.rm_descr = "S3C2410 IRQs"; + s3c2xx0_softc->s3c2xx0_irq_rman.rm_descr = "S3C24X0 IRQs"; s3c2xx0_softc->s3c2xx0_mem_rman.rm_type = RMAN_ARRAY; - s3c2xx0_softc->s3c2xx0_mem_rman.rm_descr = "S3C2410 Memory"; + s3c2xx0_softc->s3c2xx0_mem_rman.rm_descr = "S3C24X0 Memory"; if (rman_init(&s3c2xx0_softc->s3c2xx0_irq_rman) != 0 || rman_manage_region(&s3c2xx0_softc->s3c2xx0_irq_rman, 0, - S3C2410_SUBIRQ_MAX - 1) != 0) - panic("s3c2410_attach: failed to set up IRQ rman"); + S3C2410_SUBIRQ_MAX) != 0) + panic("s3c24x0_attach: failed to set up IRQ rman"); /* Manage the registor memory space */ if (rman_init(&s3c2xx0_softc->s3c2xx0_mem_rman) != 0 || - rman_manage_region(&s3c2xx0_softc->s3c2xx0_mem_rman, S3C2410_REG_BASE, - S3C2410_REG_BASE + S3C2410_REG_SIZE) != 0) - panic("s3c2410_attach: failed to set up register rman"); + rman_manage_region(&s3c2xx0_softc->s3c2xx0_mem_rman, S3C24X0_REG_BASE, + S3C24X0_REG_BASE + S3C24X0_REG_SIZE) != 0) + panic("s3c24x0_attach: failed to set up register rman"); s3c24x0_add_child(dev, 0, "nand", 0); s3c24x0_add_child(dev, 0, "timer", 0); /* Add the MMC/SD and set it's irq/registers */ child = s3c24x0_add_child(dev, 0, "s3c24x0_mci", 0); - bus_set_resource(child, SYS_RES_IRQ, 0, S3C2410_INT_SDI, 1); - bus_set_resource(child, SYS_RES_IOPORT, 0, S3C2410_SDI_BASE, + bus_set_resource(child, SYS_RES_IRQ, 0, S3C24X0_INT_SDI, 1); + bus_set_resource(child, SYS_RES_IOPORT, 0, S3C24X0_SDI_BASE, S3C2410_SDI_SIZE); /* Add the uart and set it's irq and registers */ child = s3c24x0_add_child(dev, 0, "uart", 0); - bus_set_resource(child, SYS_RES_IRQ, 0, S3C2410_INT_UART0, 1); - bus_set_resource(child, SYS_RES_IOPORT, 0, S3C2410_UART0_BASE, - S3C2410_UART_BASE(1) - S3C2410_UART0_BASE); + bus_set_resource(child, SYS_RES_IRQ, 0, S3C24X0_INT_UART0, 1); + bus_set_resource(child, SYS_RES_IOPORT, 0, S3C24X0_UART0_BASE, + S3C24X0_UART_BASE(1) - S3C24X0_UART0_BASE); bus_generic_probe(dev); bus_generic_attach(dev); @@ -465,7 +465,7 @@ { (void) disable_interrupts(I32_bit|F32_bit); - *(volatile unsigned int *)(S3C2410_WDT_BASE + WDT_WTCON) + *(volatile unsigned int *)(S3C24X0_WDT_BASE + WDT_WTCON) = (0 << WTCON_PRESCALE_SHIFT) | WTCON_ENABLE | WTCON_CLKSEL_16 | WTCON_ENRST; for(;;); @@ -497,9 +497,9 @@ switch (irq) { case S3C24X0_INT_ADCTC: - case S3C2410_INT_UART0: - case S3C2410_INT_UART1: - case S3C2410_INT_UART2: + case S3C24X0_INT_UART0: + case S3C24X0_INT_UART1: + case S3C24X0_INT_UART2: /* Find the sub IRQ */ irq = 0x7ff; irq &= bus_space_read_4(&s3c2xx0_bs_tag, @@ -516,7 +516,7 @@ s3c2xx0_softc->sc_intctl_ioh, INTCTL_SUBSRCPND, (1 << irq)); - return (S3C2410_SUBIRQ_MIN + irq); + return (S3C24X0_SUBIRQ_MIN + irq); } return (irq); @@ -529,7 +529,7 @@ { u_int32_t mask; - if (irq < S3C2410_SUBIRQ_MIN) { + if (irq < S3C24X0_SUBIRQ_MIN) { mask = bus_space_read_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTMSK); mask |= (1 << irq); @@ -538,7 +538,7 @@ } else { mask = bus_space_read_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK); - mask |= (1 << (irq - S3C2410_SUBIRQ_MIN)); + mask |= (1 << (irq - S3C24X0_SUBIRQ_MIN)); bus_space_write_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK, mask); } @@ -549,35 +549,35 @@ { u_int32_t mask; - if (irq >= S3C2410_SUBIRQ_MIN) { + if (irq >= S3C24X0_SUBIRQ_MIN) { mask = bus_space_read_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK); - mask &= ~(1 << (irq - S3C2410_SUBIRQ_MIN)); + mask &= ~(1 << (irq - S3C24X0_SUBIRQ_MIN)); bus_space_write_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTSUBMSK, mask); /* Find the other irq to unmask */ switch (irq) { - case S3C2410_INT_ADC: - case S3C2410_INT_TC: + case S3C24X0_INT_ADC: + case S3C24X0_INT_TC: irq = S3C24X0_INT_ADCTC; break; - case S3C2410_INT_RXD0: - case S3C2410_INT_TXD0: - case S3C2410_INT_ERR0: - irq = S3C2410_INT_UART0; + case S3C24X0_INT_RXD0: + case S3C24X0_INT_TXD0: + case S3C24X0_INT_ERR0: + irq = S3C24X0_INT_UART0; break; - case S3C2410_INT_RXD1: - case S3C2410_INT_TXD1: - case S3C2410_INT_ERR1: - irq = S3C2410_INT_UART1; + case S3C24X0_INT_RXD1: + case S3C24X0_INT_TXD1: + case S3C24X0_INT_ERR1: + irq = S3C24X0_INT_UART1; break; - case S3C2410_INT_RXD2: - case S3C2410_INT_TXD2: - case S3C2410_INT_ERR2: - irq = S3C2410_INT_UART2; + case S3C24X0_INT_RXD2: + case S3C24X0_INT_TXD2: + case S3C24X0_INT_ERR2: + irq = S3C24X0_INT_UART2; break; default: /* We don't know which other IRQ to unmask */ ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_mci.c#5 (text+ko) ==== @@ -286,7 +286,7 @@ vaddr = cmd->data->data; write_cnt = cmd->data->len; while (write_cnt > 0) { - WR4(sc, SDI_DAT, *(vaddr++)); + WR4(sc, S3C2410_SDI_DAT, *(vaddr++)); write_cnt -= 4; } } @@ -294,7 +294,7 @@ vaddr = cmd->data->data; read_cnt = cmd->data->len; while (read_cnt > 0) { - *(vaddr++) = RD4(sc, SDI_DAT); + *(vaddr++) = RD4(sc, S3C2410_SDI_DAT); read_cnt -= 4; } } ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_nand.c#4 (text+ko) ==== @@ -131,7 +131,7 @@ sc->sc_sx.sc_iot = iot = &s3c2xx0_bs_tag; - if (bus_space_map(sc->sc_sx.sc_iot, S3C2410_NANDFC_BASE, + if (bus_space_map(sc->sc_sx.sc_iot, S3C24X0_NANDFC_BASE, S3C2410_NANDFC_SIZE, 0, &sc->sc_nand_ioh)) panic("Cannot map NAND registers"); ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0reg.h#2 (text+ko) ==== @@ -40,6 +40,39 @@ #ifndef _ARM_S3C2XX0_S3C24X0REG_H_ #define _ARM_S3C2XX0_S3C24X0REG_H_ +/* common definitions for S3C2800, S3C2410 and S3C2440 */ +#include + +/* + * Physical address of integrated peripherals + */ +#define S3C24X0_MEMCTL_BASE 0x48000000 /* memory controller */ +#define S3C24X0_USBHC_BASE 0x49000000 /* USB Host controller */ +#define S3C24X0_INTCTL_BASE 0x4a000000 /* Interrupt controller */ +#define S3C24X0_INTCTL_SIZE 0x20 +#define S3C24X0_DMAC_BASE 0x4b000000 +#define S3C24X0_DMAC_SIZE 0xe4 +#define S3C24X0_CLKMAN_BASE 0x4c000000 /* clock & power management */ +#define S3C24X0_LCDC_BASE 0x4d000000 /* LCD controller */ +#define S3C24X0_LCDC_SIZE 0x64 +#define S3C24X0_NANDFC_BASE 0x4e000000 /* NAND Flash controller */ +#define S3C24X0_UART0_BASE 0x50000000 +#define S3C24X0_UART_BASE(n) (S3C24X0_UART0_BASE+0x4000*(n)) +#define S3C24X0_TIMER_BASE 0x51000000 +#define S3C24X0_USBDC_BASE 0x5200140 +#define S3C24X0_USBDC_SIZE 0x130 +#define S3C24X0_WDT_BASE 0x53000000 +#define S3C24X0_IIC_BASE 0x54000000 +#define S3C24X0_IIS_BASE 0x55000000 +#define S3C24X0_GPIO_BASE 0x56000000 +#define S3C24X0_ADC_BASE 0x58000000 +#define S3C24X0_SPI0_BASE 0x59000000 +#define S3C24X0_SPI1_BASE 0x59000020 +#define S3C24X0_SDI_BASE 0x5a000000 /* SD Interface */ + +#define S3C24X0_REG_BASE 0x48000000 +#define S3C24X0_REG_SIZE 0x13000000 + /* Memory controller */ #define MEMCTL_BWSCON 0x00 /* Bus width and wait status */ #define BWSCON_DW0_SHIFT 1 /* bank0 is odd */ @@ -101,31 +134,27 @@ #define INTCTL_PRIORITY 0x0c /* IRQ Priority control */ #define INTCTL_INTPND 0x10 /* Interrupt request status */ #define INTCTL_INTOFFSET 0x14 /* Interrupt request source */ +#define INTCTL_SUBSRCPND 0x18 /* sub source pending */ +#define INTCTL_INTSUBMSK 0x1c /* sub mask */ /* Interrupt source */ -#define S3C24X0_INT_ADCTC 31 /* ADC (and TC for 2410 */ +#define S3C24X0_INT_ADCTC 31 /* ADC (and TC for 2410) */ #define S3C24X0_INT_RTC 30 /* RTC alarm */ -#define S3C2400_INT_UTXD1 29 /* UART1 Tx INT (2400 only) */ -#define S3C2410_INT_SPI1 29 /* SPI 1 (2410 only) */ -#define S3C2400_INT_UTXD0 28 /* UART0 Tx INT (2400 only) */ -#define S3C2410_INT_UART0 28 /* UART0 (2410 only) */ +#define S3C24X0_INT_SPI1 29 /* SPI 1 */ +#define S3C24X0_INT_UART0 28 /* UART0 */ #define S3C24X0_INT_IIC 27 #define S3C24X0_INT_USBH 26 /* USB Host */ #define S3C24X0_INT_USBD 25 /* USB Device */ -#define S3C2400_INT_URXD1 24 /* UART1 Rx INT (2400 only) */ -#define S3C2400_INT_URXD0 23 /* UART0 Rx INT (2400 only) */ -#define S3C2410_INT_UART1 23 /* UART0 (2410 only) */ +#define S3C24X0_INT_UART1 23 /* UART0 (2410 only) */ #define S3C24X0_INT_SPI0 22 /* SPI 0 */ -#define S3C2400_INT_MMC 21 -#define S3C2410_INT_SDI 21 +#define S3C24X0_INT_SDI 21 #define S3C24X0_INT_DMA3 20 #define S3C24X0_INT_DMA2 19 #define S3C24X0_INT_DMA1 18 #define S3C24X0_INT_DMA0 17 -#define S3C2410_INT_LCD 16 +#define S3C24X0_INT_LCD 16 -#define S3C2400_INT_UERR 15 /* UART 0/1 Error int (2400) */ -#define S3C2410_INT_UART2 15 /* UART2 int (2410) */ +#define S3C24X0_INT_UART2 15 /* UART2 int (2410) */ #define S3C24X0_INT_TIMER4 14 #define S3C24X0_INT_TIMER3 13 #define S3C24X0_INT_TIMER2 12 @@ -134,11 +163,32 @@ #define S3C24X0_INT_TIMER(n) (10+(n)) /* timer interrupt [4:0] */ #define S3C24X0_INT_WDT 9 /* Watch dog timer */ #define S3C24X0_INT_TICK 8 -#define S3C2410_INT_BFLT 7 /* Battery fault */ -#define S3C2410_INT_8_23 5 /* Ext int 8..23 */ -#define S3C2410_INT_4_7 4 /* Ext int 4..7 */ -#define S3C24X0_INT_EXT(n) (n) /* External interrupt [7:0] for 2400, - * [3:0] for 2410 */ +#define S3C24X0_INT_BFLT 7 /* Battery fault */ +#define S3C24X0_INT_8_23 5 /* Ext int 8..23 */ +#define S3C24X0_INT_4_7 4 /* Ext int 4..7 */ +#define S3C24X0_INT_EXT(n) (n) /* External interrupt [3:0] for 24{1,4}0 */ + +/* 24{1,4}0 has more than 32 interrupt sources. These are sub-sources + * that are OR-ed into main interrupt sources, and controlled via + * SUBSRCPND and SUBSRCMSK registers */ +#define S3C24X0_SUBIRQ_MIN 32 + +/* cascaded to INT_ADCTC */ +#define S3C24X0_INT_ADC (S3C24X0_SUBIRQ_MIN+10) /* AD converter */ +#define S3C24X0_INT_TC (S3C24X0_SUBIRQ_MIN+9) /* Touch screen */ +/* cascaded to INT_UART2 */ +#define S3C24X0_INT_ERR2 (S3C24X0_SUBIRQ_MIN+8) /* UART2 Error interrupt */ +#define S3C24X0_INT_TXD2 (S3C24X0_SUBIRQ_MIN+7) /* UART2 Tx interrupt */ +#define S3C24X0_INT_RXD2 (S3C24X0_SUBIRQ_MIN+6) /* UART2 Rx interrupt */ +/* cascaded to INT_UART1 */ +#define S3C24X0_INT_ERR1 (S3C24X0_SUBIRQ_MIN+5) /* UART1 Error interrupt */ +#define S3C24X0_INT_TXD1 (S3C24X0_SUBIRQ_MIN+4) /* UART1 Tx interrupt */ +#define S3C24X0_INT_RXD1 (S3C24X0_SUBIRQ_MIN+3) /* UART1 Rx interrupt */ +/* cascaded to INT_UART0 */ +#define S3C24X0_INT_ERR0 (S3C24X0_SUBIRQ_MIN+2) /* UART0 Error interrupt */ +#define S3C24X0_INT_TXD0 (S3C24X0_SUBIRQ_MIN+1) /* UART0 Tx interrupt */ +#define S3C24X0_INT_RXD0 (S3C24X0_SUBIRQ_MIN+0) /* UART0 Rx interrupt */ + /* DMA controller */ /* XXX */ @@ -153,6 +203,25 @@ #define PLLCON_SDIV_SHIFT 0 #define PLLCON_SDIV_MASK (0x03< Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BD8A31065670; Sun, 8 Feb 2009 11:43:05 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAB0106566B for ; Sun, 8 Feb 2009 11:43:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 68F0F8FC14 for ; Sun, 8 Feb 2009 11:43:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Bh5nQ045570 for ; Sun, 8 Feb 2009 11:43:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n18Bh4b1045568 for perforce@freebsd.org; Sun, 8 Feb 2009 11:43:04 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 8 Feb 2009 11:43:04 GMT Message-Id: <200902081143.n18Bh4b1045568@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157361 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: Sun, 08 Feb 2009 11:43:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=157361 Change 157361 by hselasky@hselasky_laptop001 on 2009/02/08 11:42:15 IFC @ 157360 Affected files ... .. //depot/projects/usb/src/sys/amd64/amd64/exception.S#9 integrate .. //depot/projects/usb/src/sys/amd64/amd64/machdep.c#12 integrate .. //depot/projects/usb/src/sys/amd64/amd64/mp_machdep.c#16 integrate .. //depot/projects/usb/src/sys/amd64/conf/NOTES#14 integrate .. //depot/projects/usb/src/sys/amd64/include/intr_machdep.h#7 integrate .. //depot/projects/usb/src/sys/amd64/include/legacyvar.h#3 integrate .. //depot/projects/usb/src/sys/amd64/pci/pci_bus.c#6 integrate .. //depot/projects/usb/src/sys/arm/arm/busdma_machdep.c#15 integrate .. //depot/projects/usb/src/sys/arm/arm/dump_machdep.c#6 integrate .. //depot/projects/usb/src/sys/arm/arm/elf_trampoline.c#10 integrate .. //depot/projects/usb/src/sys/arm/arm/pmap.c#13 integrate .. //depot/projects/usb/src/sys/arm/arm/vm_machdep.c#8 integrate .. //depot/projects/usb/src/sys/arm/conf/AVILA#11 integrate .. //depot/projects/usb/src/sys/arm/conf/AVILA.hints#4 integrate .. //depot/projects/usb/src/sys/arm/include/atomic.h#6 integrate .. //depot/projects/usb/src/sys/arm/sa11x0/assabet_machdep.c#7 integrate .. //depot/projects/usb/src/sys/arm/xscale/ixp425/avila_machdep.c#10 integrate .. //depot/projects/usb/src/sys/arm/xscale/ixp425/files.ixp425#6 integrate .. //depot/projects/usb/src/sys/arm/xscale/ixp425/ixp425.c#7 integrate .. //depot/projects/usb/src/sys/arm/xscale/ixp425/ixp425reg.h#4 integrate .. //depot/projects/usb/src/sys/conf/NOTES#27 integrate .. //depot/projects/usb/src/sys/conf/files#50 integrate .. //depot/projects/usb/src/sys/conf/options#20 integrate .. //depot/projects/usb/src/sys/conf/options.amd64#7 integrate .. //depot/projects/usb/src/sys/conf/options.i386#9 integrate .. //depot/projects/usb/src/sys/conf/options.ia64#3 integrate .. //depot/projects/usb/src/sys/conf/options.mips#3 integrate .. //depot/projects/usb/src/sys/conf/options.pc98#7 integrate .. //depot/projects/usb/src/sys/crypto/via/padlock.c#8 integrate .. //depot/projects/usb/src/sys/dev/acpi_support/acpi_panasonic.c#4 integrate .. //depot/projects/usb/src/sys/dev/acpica/acpi_pcib_acpi.c#5 integrate .. //depot/projects/usb/src/sys/dev/ae/if_ae.c#3 integrate .. //depot/projects/usb/src/sys/dev/agp/agp.c#5 integrate .. //depot/projects/usb/src/sys/dev/an/if_an.c#7 integrate .. //depot/projects/usb/src/sys/dev/an/if_anreg.h#4 integrate .. //depot/projects/usb/src/sys/dev/ata/ata-disk.c#11 integrate .. //depot/projects/usb/src/sys/dev/ata/atapi-cam.c#9 integrate .. //depot/projects/usb/src/sys/dev/ata/atapi-cd.c#8 integrate .. //depot/projects/usb/src/sys/dev/ata/atapi-fd.c#6 integrate .. //depot/projects/usb/src/sys/dev/ata/atapi-tape.c#7 integrate .. //depot/projects/usb/src/sys/dev/ath/ath_hal/ah_regdomain.c#4 integrate .. //depot/projects/usb/src/sys/dev/ath/ath_hal/ar5212/ar5212.h#3 integrate .. //depot/projects/usb/src/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c#4 integrate .. //depot/projects/usb/src/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c#3 integrate .. //depot/projects/usb/src/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c#3 integrate .. //depot/projects/usb/src/sys/dev/ath/if_ath.c#16 integrate .. //depot/projects/usb/src/sys/dev/ath/if_athioctl.h#6 integrate .. //depot/projects/usb/src/sys/dev/atkbdc/atkbdc_isa.c#3 integrate .. //depot/projects/usb/src/sys/dev/bge/if_bge.c#14 integrate .. //depot/projects/usb/src/sys/dev/bm/if_bm.c#6 integrate .. //depot/projects/usb/src/sys/dev/cardbus/cardbus.c#9 integrate .. //depot/projects/usb/src/sys/dev/cardbus/cardbus_device.c#6 integrate .. //depot/projects/usb/src/sys/dev/cfi/cfi_bus_ixp4xx.c#1 branch .. //depot/projects/usb/src/sys/dev/cfi/cfi_core.c#2 integrate .. //depot/projects/usb/src/sys/dev/cfi/cfi_dev.c#2 integrate .. //depot/projects/usb/src/sys/dev/cfi/cfi_reg.h#2 integrate .. //depot/projects/usb/src/sys/dev/cfi/cfi_var.h#2 integrate .. //depot/projects/usb/src/sys/dev/exca/exca.c#5 integrate .. //depot/projects/usb/src/sys/dev/firewire/firewire.c#9 integrate .. //depot/projects/usb/src/sys/dev/firewire/fwohci.c#6 integrate .. //depot/projects/usb/src/sys/dev/firewire/fwohci_pci.c#6 integrate .. //depot/projects/usb/src/sys/dev/firewire/fwohcivar.h#4 integrate .. //depot/projects/usb/src/sys/dev/firewire/sbp.c#6 integrate .. //depot/projects/usb/src/sys/dev/fxp/if_fxp.c#8 integrate .. //depot/projects/usb/src/sys/dev/hifn/hifn7751.c#4 integrate .. //depot/projects/usb/src/sys/dev/ichsmb/ichsmb.c#6 integrate .. //depot/projects/usb/src/sys/dev/ipmi/ipmi_acpi.c#2 integrate .. //depot/projects/usb/src/sys/dev/ipmi/ipmi_smbios.c#4 integrate .. //depot/projects/usb/src/sys/dev/kbdmux/kbdmux.c#8 integrate .. //depot/projects/usb/src/sys/dev/lmc/if_lmc.c#9 integrate .. //depot/projects/usb/src/sys/dev/lmc/if_lmc.h#5 integrate .. //depot/projects/usb/src/sys/dev/mmc/mmc.c#8 integrate .. //depot/projects/usb/src/sys/dev/mmc/mmcreg.h#4 integrate .. //depot/projects/usb/src/sys/dev/my/if_my.c#6 integrate .. //depot/projects/usb/src/sys/dev/nve/if_nve.c#7 integrate .. //depot/projects/usb/src/sys/dev/pccard/card_if.m#2 integrate .. //depot/projects/usb/src/sys/dev/pccard/pccard.c#5 integrate .. //depot/projects/usb/src/sys/dev/pccard/pccard_cis.c#6 integrate .. //depot/projects/usb/src/sys/dev/pccard/pccardvarp.h#4 integrate .. //depot/projects/usb/src/sys/dev/pccbb/pccbb.c#10 integrate .. //depot/projects/usb/src/sys/dev/pccbb/pccbb_pci.c#8 integrate .. //depot/projects/usb/src/sys/dev/pccbb/pccbbvar.h#7 integrate .. //depot/projects/usb/src/sys/dev/pci/pci_user.c#5 integrate .. //depot/projects/usb/src/sys/dev/pci/pcireg.h#9 integrate .. //depot/projects/usb/src/sys/dev/pcn/if_pcn.c#3 integrate .. //depot/projects/usb/src/sys/dev/ppbus/ppbconf.h#7 integrate .. //depot/projects/usb/src/sys/dev/ppc/ppc.c#9 integrate .. //depot/projects/usb/src/sys/dev/ppc/ppcvar.h#5 integrate .. //depot/projects/usb/src/sys/dev/safe/safe.c#5 integrate .. //depot/projects/usb/src/sys/dev/scc/scc_if.m#3 integrate .. //depot/projects/usb/src/sys/dev/si/si.c#6 integrate .. //depot/projects/usb/src/sys/dev/smbus/smb.c#5 integrate .. //depot/projects/usb/src/sys/dev/snp/snp.c#10 integrate .. //depot/projects/usb/src/sys/dev/sound/macio/aoa.c#2 integrate .. //depot/projects/usb/src/sys/dev/sound/macio/aoa.h#2 integrate .. //depot/projects/usb/src/sys/dev/sound/macio/davbus.c#2 integrate .. //depot/projects/usb/src/sys/dev/sound/macio/i2s.c#2 integrate .. //depot/projects/usb/src/sys/dev/sound/macio/snapper.c#2 integrate .. //depot/projects/usb/src/sys/dev/sound/macio/tumbler.c#2 integrate .. //depot/projects/usb/src/sys/dev/usb/if_rum.c#37 integrate .. //depot/projects/usb/src/sys/dev/usb/if_urtw.c#2 integrate .. //depot/projects/usb/src/sys/dev/usb/usbdevs#42 integrate .. //depot/projects/usb/src/sys/dev/usb2/bluetooth/ubtbcmfw2.c#14 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.c#31 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/ohci2.c#28 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#28 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_error.c#6 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.c#16 integrate .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_devid.h#28 integrate .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_devtable.h#28 integrate .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_error.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_hid.h#7 integrate .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_mfunc.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_revision.h#7 integrate .. //depot/projects/usb/src/sys/dev/usb2/input/uhid2.c#16 integrate .. //depot/projects/usb/src/sys/dev/usb2/quirk/usb2_quirk.c#14 integrate .. //depot/projects/usb/src/sys/dev/usb2/quirk/usb2_quirk.h#7 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/uftdi2.c#20 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#25 integrate .. //depot/projects/usb/src/sys/dev/xen/netback/netback.c#2 integrate .. //depot/projects/usb/src/sys/dev/xen/netfront/netfront.c#6 integrate .. //depot/projects/usb/src/sys/fs/fifofs/fifo_vnops.c#9 integrate .. //depot/projects/usb/src/sys/fs/udf/ecma167-udf.h#3 integrate .. //depot/projects/usb/src/sys/fs/udf/udf.h#3 integrate .. //depot/projects/usb/src/sys/fs/udf/udf_vfsops.c#8 integrate .. //depot/projects/usb/src/sys/fs/udf/udf_vnops.c#10 integrate .. //depot/projects/usb/src/sys/geom/geom_subr.c#9 integrate .. //depot/projects/usb/src/sys/geom/part/g_part_bsd.c#8 integrate .. //depot/projects/usb/src/sys/geom/part/g_part_mbr.c#6 integrate .. //depot/projects/usb/src/sys/i386/conf/NOTES#16 integrate .. //depot/projects/usb/src/sys/i386/i386/vm_machdep.c#11 integrate .. //depot/projects/usb/src/sys/i386/xen/clock.c#4 integrate .. //depot/projects/usb/src/sys/i386/xen/xen_machdep.c#7 integrate .. //depot/projects/usb/src/sys/ia64/conf/NOTES#4 integrate .. //depot/projects/usb/src/sys/ia64/ia64/mca.c#3 integrate .. //depot/projects/usb/src/sys/ia64/include/mca.h#2 integrate .. //depot/projects/usb/src/sys/kern/kern_jail.c#16 integrate .. //depot/projects/usb/src/sys/kern/kern_linker.c#12 integrate .. //depot/projects/usb/src/sys/kern/kern_lock.c#11 integrate .. //depot/projects/usb/src/sys/kern/kern_sysctl.c#11 integrate .. //depot/projects/usb/src/sys/kern/subr_autoconf.c#5 integrate .. //depot/projects/usb/src/sys/kern/subr_bus.c#16 integrate .. //depot/projects/usb/src/sys/kern/subr_clist.c#4 integrate .. //depot/projects/usb/src/sys/kern/subr_devstat.c#2 integrate .. //depot/projects/usb/src/sys/kern/subr_disk.c#4 integrate .. //depot/projects/usb/src/sys/kern/subr_firmware.c#8 integrate .. //depot/projects/usb/src/sys/kern/subr_kobj.c#3 integrate .. //depot/projects/usb/src/sys/kern/subr_prf.c#8 integrate .. //depot/projects/usb/src/sys/kern/subr_prof.c#5 integrate .. //depot/projects/usb/src/sys/kern/subr_rman.c#9 integrate .. //depot/projects/usb/src/sys/kern/subr_rtc.c#3 integrate .. //depot/projects/usb/src/sys/kern/subr_taskqueue.c#7 integrate .. //depot/projects/usb/src/sys/kern/subr_witness.c#16 integrate .. //depot/projects/usb/src/sys/kern/sys_generic.c#11 integrate .. //depot/projects/usb/src/sys/kern/tty.c#16 integrate .. //depot/projects/usb/src/sys/kern/tty_inq.c#2 integrate .. //depot/projects/usb/src/sys/kern/tty_outq.c#2 integrate .. //depot/projects/usb/src/sys/kern/uipc_socket.c#16 integrate .. //depot/projects/usb/src/sys/kern/vfs_bio.c#13 integrate .. //depot/projects/usb/src/sys/kern/vfs_init.c#4 integrate .. //depot/projects/usb/src/sys/kern/vfs_mount.c#17 integrate .. //depot/projects/usb/src/sys/kern/vfs_subr.c#17 integrate .. //depot/projects/usb/src/sys/kern/vfs_syscalls.c#16 integrate .. //depot/projects/usb/src/sys/mips/mips/busdma_machdep.c#3 integrate .. //depot/projects/usb/src/sys/modules/libalias/libalias/Makefile#3 integrate .. //depot/projects/usb/src/sys/net/if.c#17 integrate .. //depot/projects/usb/src/sys/net/if_ethersubr.c#14 integrate .. //depot/projects/usb/src/sys/net/rtsock.c#18 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211.c#14 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_crypto.h#8 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_ddb.c#9 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_scan_sta.c#8 integrate .. //depot/projects/usb/src/sys/netatalk/ddp_usrreq.c#6 integrate .. //depot/projects/usb/src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c#6 integrate .. //depot/projects/usb/src/sys/netinet/in.c#17 integrate .. //depot/projects/usb/src/sys/netinet/in_pcb.c#18 integrate .. //depot/projects/usb/src/sys/netinet/ip_divert.c#13 integrate .. //depot/projects/usb/src/sys/netinet/ip_fw_nat.c#6 integrate .. //depot/projects/usb/src/sys/netinet/ip_ipsec.c#10 integrate .. //depot/projects/usb/src/sys/netinet/ip_output.c#13 integrate .. //depot/projects/usb/src/sys/netinet/libalias/alias.c#6 integrate .. //depot/projects/usb/src/sys/netinet/libalias/alias_db.c#9 integrate .. //depot/projects/usb/src/sys/netinet/libalias/alias_local.h#5 integrate .. //depot/projects/usb/src/sys/netinet/libalias/alias_sctp.c#1 branch .. //depot/projects/usb/src/sys/netinet/libalias/alias_sctp.h#1 branch .. //depot/projects/usb/src/sys/netinet/raw_ip.c#17 integrate .. //depot/projects/usb/src/sys/netinet/sctp_auth.c#9 integrate .. //depot/projects/usb/src/sys/netinet/sctp_constants.h#12 integrate .. //depot/projects/usb/src/sys/netinet/sctp_crc32.c#5 integrate .. //depot/projects/usb/src/sys/netinet/sctp_crc32.h#4 integrate .. //depot/projects/usb/src/sys/netinet/sctp_input.c#13 integrate .. //depot/projects/usb/src/sys/netinet/sctp_os_bsd.h#12 integrate .. //depot/projects/usb/src/sys/netinet/sctp_output.c#14 integrate .. //depot/projects/usb/src/sys/netinet/sctp_pcb.c#14 integrate .. //depot/projects/usb/src/sys/netinet/sctp_pcb.h#13 integrate .. //depot/projects/usb/src/sys/netinet/sctp_sysctl.c#10 integrate .. //depot/projects/usb/src/sys/netinet/sctp_uio.h#11 integrate .. //depot/projects/usb/src/sys/netinet/sctp_usrreq.c#13 integrate .. //depot/projects/usb/src/sys/netinet/sctputil.c#15 integrate .. //depot/projects/usb/src/sys/netinet/sctputil.h#10 integrate .. //depot/projects/usb/src/sys/netinet/tcp_subr.c#17 integrate .. //depot/projects/usb/src/sys/netinet/tcp_usrreq.c#14 integrate .. //depot/projects/usb/src/sys/netinet/udp_usrreq.c#17 integrate .. //depot/projects/usb/src/sys/netinet6/frag6.c#12 integrate .. //depot/projects/usb/src/sys/netinet6/in6.c#16 integrate .. //depot/projects/usb/src/sys/netinet6/in6_pcb.c#14 integrate .. //depot/projects/usb/src/sys/netinet6/in6_src.c#15 integrate .. //depot/projects/usb/src/sys/netinet6/ip6_forward.c#12 integrate .. //depot/projects/usb/src/sys/netinet6/ip6_input.c#16 integrate .. //depot/projects/usb/src/sys/netinet6/ip6_ipsec.c#8 integrate .. //depot/projects/usb/src/sys/netinet6/ip6_output.c#10 integrate .. //depot/projects/usb/src/sys/netinet6/ip6_var.h#11 integrate .. //depot/projects/usb/src/sys/netinet6/nd6_rtr.c#12 integrate .. //depot/projects/usb/src/sys/netinet6/raw_ip6.c#16 integrate .. //depot/projects/usb/src/sys/netinet6/sctp6_usrreq.c#11 integrate .. //depot/projects/usb/src/sys/netinet6/udp6_usrreq.c#16 integrate .. //depot/projects/usb/src/sys/netinet6/vinet6.h#5 integrate .. //depot/projects/usb/src/sys/netipsec/ipsec.c#15 integrate .. //depot/projects/usb/src/sys/netipsec/ipsec.h#12 integrate .. //depot/projects/usb/src/sys/netipsec/ipsec6.h#6 integrate .. //depot/projects/usb/src/sys/opencrypto/cryptosoft.c#7 integrate .. //depot/projects/usb/src/sys/pc98/conf/NOTES#14 integrate .. //depot/projects/usb/src/sys/rpc/clnt_rc.c#5 integrate .. //depot/projects/usb/src/sys/security/audit/audit_pipe.c#12 integrate .. //depot/projects/usb/src/sys/sys/cfictl.h#3 integrate .. //depot/projects/usb/src/sys/sys/clist.h#4 integrate .. //depot/projects/usb/src/sys/sys/conf.h#14 integrate .. //depot/projects/usb/src/sys/sys/elf_common.h#10 integrate .. //depot/projects/usb/src/sys/sys/jail.h#9 integrate .. //depot/projects/usb/src/sys/sys/kobj.h#4 integrate .. //depot/projects/usb/src/sys/sys/lockmgr.h#8 integrate .. //depot/projects/usb/src/sys/sys/mount.h#14 integrate .. //depot/projects/usb/src/sys/sys/pciio.h#3 integrate .. //depot/projects/usb/src/sys/sys/sysctl.h#14 integrate .. //depot/projects/usb/src/sys/sys/tty.h#8 integrate .. //depot/projects/usb/src/sys/sys/ttyqueue.h#3 integrate .. //depot/projects/usb/src/sys/ufs/ffs/ffs_alloc.c#9 integrate Differences ... ==== //depot/projects/usb/src/sys/amd64/amd64/exception.S#9 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.136 2009/01/14 14:20:08 kib Exp $ + * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.137 2009/02/03 09:01:45 jkoshy Exp $ */ #include "opt_atpic.h" @@ -383,22 +383,24 @@ * NMI handling is special. * * First, NMIs do not respect the state of the processor's RFLAGS.IF - * bit and the NMI handler may be invoked at any time, including when - * the processor is in a critical section with RFLAGS.IF == 0. In - * particular, this means that the processor's GS.base values could be - * inconsistent on entry to the handler, and so we need to read - * MSR_GSBASE to determine if a 'swapgs' is needed. We use '%ebx', a - * C-preserved register, to remember whether to swap GS back on the - * exit path. + * bit. The NMI handler may be entered at any time, including when + * the processor is in a critical section with RFLAGS.IF == 0. + * The processor's GS.base value could be invalid on entry to the + * handler. * * Second, the processor treats NMIs specially, blocking further NMIs - * until an 'iretq' instruction is executed. We therefore need to - * execute the NMI handler with interrupts disabled to prevent a - * nested interrupt from executing an 'iretq' instruction and - * inadvertently taking the processor out of NMI mode. + * until an 'iretq' instruction is executed. We thus need to execute + * the NMI handler with interrupts disabled, to prevent a nested interrupt + * from executing an 'iretq' instruction and inadvertently taking the + * processor out of NMI mode. * - * Third, the NMI handler runs on its own stack (tss_ist1), shared - * with the double fault handler. + * Third, the NMI handler runs on its own stack (tss_ist2). The canonical + * GS.base value for the processor is stored just above the bottom of its + * NMI stack. For NMIs taken from kernel mode, the current value in + * the processor's GS.base is saved at entry to C-preserved register %r12, + * the canonical value for GS.base is then loaded into the processor, and + * the saved value is restored at exit time. For NMIs taken from user mode, + * the cheaper 'SWAPGS' instructions are used for swapping GS.base. */ IDTVEC(nmi) @@ -423,12 +425,22 @@ movq %r15,TF_R15(%rsp) xorl %ebx,%ebx testb $SEL_RPL_MASK,TF_CS(%rsp) - jnz nmi_needswapgs /* we came from userland */ + jnz nmi_fromuserspace + /* + * We've interrupted the kernel. Preserve GS.base in %r12. + */ movl $MSR_GSBASE,%ecx rdmsr - cmpl $VM_MAXUSER_ADDRESS >> 32,%edx - jae nmi_calltrap /* GS.base holds a kernel VA */ -nmi_needswapgs: + movq %rax,%r12 + shlq $32,%rdx + orq %rdx,%r12 + /* Retrieve and load the canonical value for GS.base. */ + movq TF_SIZE(%rsp),%rdx + movl %edx,%eax + shrq $32,%rdx + wrmsr + jmp nmi_calltrap +nmi_fromuserspace: incl %ebx swapgs /* Note: this label is also used by ddb and gdb: */ @@ -439,14 +451,19 @@ MEXITCOUNT #ifdef HWPMC_HOOKS /* - * Check if the current trap was from user mode and if so - * whether the current thread needs a user call chain to be - * captured. We are still in NMI mode at this point. + * Capture a userspace callchain if needed. + * + * - Check if the current trap was from user mode. + * - Check if the current thread is valid. + * - Check if the thread requires a user call chain to be + * captured. + * + * We are still in NMI mode at this point. */ - testb $SEL_RPL_MASK,TF_CS(%rsp) - jz nocallchain - movq PCPU(CURTHREAD),%rax /* curthread present? */ - orq %rax,%rax + testl %ebx,%ebx + jz nocallchain /* not from userspace */ + movq PCPU(CURTHREAD),%rax + orq %rax,%rax /* curthread present? */ jz nocallchain testl $TDP_CALLCHAIN,TD_PFLAGS(%rax) /* flagged for capture? */ jz nocallchain @@ -498,8 +515,18 @@ nocallchain: #endif testl %ebx,%ebx - jz nmi_restoreregs + jz nmi_kernelexit swapgs + jmp nmi_restoreregs +nmi_kernelexit: + /* + * Put back the preserved MSR_GSBASE value. + */ + movl $MSR_GSBASE,%ecx + movq %r12,%rdx + movl %edx,%eax + shrq $32,%rdx + wrmsr nmi_restoreregs: movq TF_RDI(%rsp),%rdi movq TF_RSI(%rsp),%rsi ==== //depot/projects/usb/src/sys/amd64/amd64/machdep.c#12 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.690 2008/09/08 09:59:05 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.691 2009/02/03 09:01:45 jkoshy Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -809,6 +809,9 @@ static char dblfault_stack[PAGE_SIZE] __aligned(16); +static char nmi0_stack[PAGE_SIZE] __aligned(16); +CTASSERT(sizeof(struct nmi_pcpu) == 16); + struct amd64tss common_tss[MAXCPU]; /* software prototypes -- in more palatable form */ @@ -1291,6 +1294,7 @@ caddr_t kmdp; int gsel_tss, x; struct pcpu *pc; + struct nmi_pcpu *np; u_int64_t msr; char *env; @@ -1365,7 +1369,7 @@ setidt(x, &IDTVEC(rsvd), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_DE, &IDTVEC(div), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_DB, &IDTVEC(dbg), SDT_SYSIGT, SEL_KPL, 0); - setidt(IDT_NMI, &IDTVEC(nmi), SDT_SYSIGT, SEL_KPL, 1); + setidt(IDT_NMI, &IDTVEC(nmi), SDT_SYSIGT, SEL_KPL, 2); setidt(IDT_BP, &IDTVEC(bpt), SDT_SYSIGT, SEL_UPL, 0); setidt(IDT_OF, &IDTVEC(ofl), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_BR, &IDTVEC(bnd), SDT_SYSIGT, SEL_KPL, 0); @@ -1438,6 +1442,14 @@ /* doublefault stack space, runs on ist1 */ common_tss[0].tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)]; + /* + * NMI stack, runs on ist2. The pcpu pointer is stored just + * above the start of the ist2 stack. + */ + np = ((struct nmi_pcpu *) &nmi0_stack[sizeof(nmi0_stack)]) - 1; + np->np_pcpu = (register_t) pc; + common_tss[0].tss_ist2 = (long) np; + /* Set the IO permission bitmap (empty due to tss seg limit) */ common_tss[0].tss_iobase = sizeof(struct amd64tss); ==== //depot/projects/usb/src/sys/amd64/amd64/mp_machdep.c#16 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.296 2009/01/29 09:22:56 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.297 2009/02/03 09:01:45 jkoshy Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -92,6 +92,7 @@ /* Temporary holder for double fault stack */ char *doublefault_stack; +char *nmi_stack; /* Hotwire a 0->4MB V==P mapping */ extern pt_entry_t *KPTphys; @@ -437,6 +438,7 @@ init_secondary(void) { struct pcpu *pc; + struct nmi_pcpu *np; u_int64_t msr, cr0; int cpu, gsel_tss, x; struct region_descriptor ap_gdt; @@ -450,6 +452,10 @@ common_tss[cpu].tss_iobase = sizeof(struct amd64tss); common_tss[cpu].tss_ist1 = (long)&doublefault_stack[PAGE_SIZE]; + /* The NMI stack runs on IST2. */ + np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; + common_tss[cpu].tss_ist2 = (long) np; + /* Prepare private GDT */ gdt_segs[GPROC0_SEL].ssd_base = (long) &common_tss[cpu]; ssdtosyssd(&gdt_segs[GPROC0_SEL], @@ -474,6 +480,9 @@ pc->pc_rsp0 = 0; pc->pc_gs32p = &gdt[NGDT * cpu + GUGS32_SEL]; + /* Save the per-cpu pointer for use by the NMI handler. */ + np->np_pcpu = (register_t) pc; + wrmsr(MSR_FSBASE, 0); /* User value */ wrmsr(MSR_GSBASE, (u_int64_t)pc); wrmsr(MSR_KGSBASE, (u_int64_t)pc); /* XXX User value while we're in the kernel */ @@ -725,6 +734,7 @@ /* allocate and set up an idle stack data page */ bootstacks[cpu] = (void *)kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE); doublefault_stack = (char *)kmem_alloc(kernel_map, PAGE_SIZE); + nmi_stack = (char *)kmem_alloc(kernel_map, PAGE_SIZE); bootSTK = (char *)bootstacks[cpu] + KSTACK_PAGES * PAGE_SIZE - 8; bootAP = cpu; ==== //depot/projects/usb/src/sys/amd64/conf/NOTES#14 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.83 2008/12/01 16:53:01 sam Exp $ +# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.86 2009/02/07 00:01:10 wkoszek Exp $ # # @@ -150,6 +150,11 @@ # AGP GART support device agp +# +# AGP debugging. +# +options AGP_DEBUG + ##################################################################### # HARDWARE DEVICE CONFIGURATION @@ -267,7 +272,6 @@ # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking # ral: Ralink Technology IEEE 802.11 wireless adapter -# ural: Ralink Technology RT2500USB IEEE 802.11 wireless adapter # wpi: Intel 3945ABG Wireless LAN controller device ed @@ -277,10 +281,9 @@ device iwi device iwn device ipw -device nfe # nVidia nForce MCP on-board Ethernet Networking -device nve # nVidia nForce MCP on-board Ethernet Networking +device nfe +device nve device ral -device ural device wpi device ath # Atheros pci/cardbus NIC's @@ -356,9 +359,11 @@ # Miscellaneous hardware: # # ipmi: Intelligent Platform Management Interface +# pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) # smbios: DMI/SMBIOS entry point # vpd: Vital Product Data kernel interface # asmc: Apple System Management Controller +# si: Specialix International SI/XIO or SX intelligent serial card # Notes on the Specialix SI/XIO driver: # The host card is memory, not IO mapped. @@ -367,13 +372,14 @@ # The cards can use an IRQ of 11, 12 or 15. device ipmi -# Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) device pbio hint.pbio.0.at="isa" hint.pbio.0.port="0x360" device smbios device vpd device asmc +#device si + # # Laptop/Notebook options: # ==== //depot/projects/usb/src/sys/amd64/include/intr_machdep.h#7 (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/amd64/include/intr_machdep.h,v 1.20 2009/01/29 09:22:56 jeff Exp $ + * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.21 2009/02/03 09:01:45 jkoshy Exp $ */ #ifndef __MACHINE_INTR_MACHDEP_H__ @@ -120,6 +120,15 @@ struct trapframe; +/* + * The following data structure holds per-cpu data, and is placed just + * above the top of the space used for the NMI stack. + */ +struct nmi_pcpu { + register_t np_pcpu; + register_t __padding; /* pad to 16 bytes */ +}; + extern struct mtx icu_lock; extern int elcr_found; ==== //depot/projects/usb/src/sys/amd64/include/legacyvar.h#3 (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/amd64/include/legacyvar.h,v 1.8 2007/09/30 11:05:13 marius Exp $ + * $FreeBSD: src/sys/amd64/include/legacyvar.h,v 1.9 2009/02/08 07:03:34 imp Exp $ */ #ifndef _MACHINE_LEGACYVAR_H_ @@ -43,12 +43,12 @@ #undef LEGACY_ACCESSOR int legacy_pcib_maxslots(device_t dev); -uint32_t legacy_pcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes); +uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, int bytes); int legacy_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); -void legacy_pcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes); +void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, uint32_t data, int bytes); int legacy_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child, ==== //depot/projects/usb/src/sys/amd64/pci/pci_bus.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.122 2007/09/30 11:05:13 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.123 2009/02/08 07:02:42 imp Exp $"); #include "opt_cpu.h" @@ -55,9 +55,9 @@ /* read configuration space register */ -u_int32_t -legacy_pcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes) +uint32_t +legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) { return(pci_cfgregread(bus, slot, func, reg, bytes)); } @@ -65,8 +65,8 @@ /* write configuration space register */ void -legacy_pcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes) +legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t data, int bytes) { pci_cfgregwrite(bus, slot, func, reg, data, bytes); } ==== //depot/projects/usb/src/sys/arm/arm/busdma_machdep.c#15 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.41 2009/01/30 07:01:32 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.42 2009/02/04 01:14:06 cognet Exp $"); /* * ARM bus dma support routines @@ -1168,7 +1168,7 @@ STAILQ_FOREACH(bpage, &map->bpages, links) { if ((vm_offset_t)buf >= bpage->datavaddr && - (vm_offset_t)buf + len < bpage->datavaddr + + (vm_offset_t)buf + len <= bpage->datavaddr + bpage->datacount) return (1); } ==== //depot/projects/usb/src/sys/arm/arm/dump_machdep.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/dump_machdep.c,v 1.6 2008/11/06 16:20:27 raj Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/dump_machdep.c,v 1.7 2009/02/02 20:09:14 cognet Exp $"); #include #include @@ -158,14 +158,12 @@ { struct dumperinfo *di = (struct dumperinfo*)arg; vm_paddr_t pa; - vm_offset_t va; uint32_t pgs; size_t counter, sz, chunk; int c, error; error = 0; /* catch case in which chunk size is 0 */ counter = 0; - va = 0; pgs = mdp->md_size / PAGE_SIZE; pa = mdp->md_start; ==== //depot/projects/usb/src/sys/arm/arm/elf_trampoline.c#10 (text+ko) ==== @@ -23,7 +23,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.23 2009/01/09 10:45:04 raj Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.24 2009/02/02 20:09:14 cognet Exp $"); #include #include #include @@ -404,11 +404,11 @@ int symtabindex = -1; int symstrindex = -1; vm_offset_t lastaddr = 0; - Elf_Addr ssym = 0, esym = 0; + Elf_Addr ssym = 0; Elf_Dyn *dp; eh = (Elf32_Ehdr *)kstart; - ssym = esym = 0; + ssym = 0; entry_point = (void*)eh->e_entry; memcpy(phdr, (void *)(kstart + eh->e_phoff ), eh->e_phnum * sizeof(phdr[0])); ==== //depot/projects/usb/src/sys/arm/arm/pmap.c#13 (text+ko) ==== @@ -147,7 +147,7 @@ #include "opt_vm.h" #include -__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.106 2008/11/06 16:28:28 raj Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.107 2009/02/02 20:09:14 cognet Exp $"); #include #include #include @@ -3102,7 +3102,7 @@ pmap_remove_all(vm_page_t m) { pv_entry_t pv; - pt_entry_t *ptep, pte; + pt_entry_t *ptep; struct l2_bucket *l2b; boolean_t flush = FALSE; pmap_t curpm; @@ -3130,7 +3130,6 @@ l2b = pmap_get_l2_bucket(pv->pv_pmap, pv->pv_va); KASSERT(l2b != NULL, ("No l2 bucket")); ptep = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; - pte = *ptep; *ptep = 0; PTE_SYNC_CURRENT(pv->pv_pmap, ptep); pmap_free_l2_bucket(pv->pv_pmap, l2b, 1); ==== //depot/projects/usb/src/sys/arm/arm/vm_machdep.c#8 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.37 2008/08/04 14:47:49 raj Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.38 2009/02/02 20:09:14 cognet Exp $"); #include #include @@ -108,14 +108,13 @@ cpu_fork(register struct thread *td1, register struct proc *p2, struct thread *td2, int flags) { - struct pcb *pcb1, *pcb2; + struct pcb *pcb2; struct trapframe *tf; struct switchframe *sf; struct mdproc *mdp2; if ((flags & RFPROC) == 0) return; - pcb1 = td1->td_pcb; pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; #ifdef __XSCALE__ #ifndef CPU_XSCALE_CORE3 ==== //depot/projects/usb/src/sys/arm/conf/AVILA#11 (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/arm/conf/AVILA,v 1.21 2008/12/27 17:22:17 bz Exp $ +# $FreeBSD: src/sys/arm/conf/AVILA,v 1.22 2009/02/03 19:16:04 sam Exp $ ident AVILA @@ -66,13 +66,15 @@ device pci device uart +device ixpwdog # watchdog timer +device cfi # flash support + # I2C Bus device iicbus device iicbb device iic device ixpiic # I2C bus glue -device ixpwdog # watchdog timer device ds1672 # DS1672 on I2C bus device ad7418 # AD7418 on I2C bus ==== //depot/projects/usb/src/sys/arm/conf/AVILA.hints#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/arm/conf/AVILA.hints,v 1.4 2008/12/20 03:26:09 sam Exp $ +# $FreeBSD: src/sys/arm/conf/AVILA.hints,v 1.5 2009/02/03 19:16:04 sam Exp $ # # Device wiring for the Gateworks Avila 2384. @@ -29,6 +29,10 @@ hint.npe.1.mii="B" hint.npe.1.phy=1 +# FLASH +hint.cfi.0.at="ixp0" +hint.cfi.0.addr=0x50000000 + # CF IDE controller hint.ata_avila.0.at="ixp0" ==== //depot/projects/usb/src/sys/arm/include/atomic.h#6 (text+ko) ==== @@ -33,7 +33,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/arm/include/atomic.h,v 1.25 2008/11/22 05:55:56 kmacy Exp $ + * $FreeBSD: src/sys/arm/include/atomic.h,v 1.26 2009/02/03 19:06:12 sam Exp $ */ #ifndef _MACHINE_ATOMIC_H_ @@ -344,7 +344,8 @@ #define atomic_clear_ptr atomic_clear_32 #define atomic_set_ptr atomic_set_32 -#define atomic_cmpset_ptr atomic_cmpset_32 +#define atomic_cmpset_ptr(dst, old, new) \ + atomic_cmpset_32((volatile u_int *)(dst), (u_int)(old), (u_int)(new)) #define atomic_cmpset_rel_ptr atomic_cmpset_ptr #define atomic_cmpset_acq_ptr atomic_cmpset_ptr #define atomic_store_ptr atomic_store_32 ==== //depot/projects/usb/src/sys/arm/sa11x0/assabet_machdep.c#7 (text+ko) ==== @@ -47,7 +47,7 @@ #include -__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.26 2008/12/01 10:16:25 stas Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.28 2009/02/02 20:24:29 cognet Exp $"); #include "opt_md.h" @@ -210,12 +210,10 @@ struct pv_addr md_addr; struct pv_addr md_bla; int loop; - u_int kerneldatasize, symbolsize; u_int l1pagetable; vm_offset_t freemempos; vm_offset_t lastalloced; vm_offset_t lastaddr; - vm_size_t pt_size; uint32_t memsize = 32 * 1024 * 1024; sa1110_uart_vaddr = SACOM1_VBASE; @@ -232,8 +230,6 @@ physical_end = lastaddr; physical_freestart = (((vm_offset_t)physical_end) + PAGE_MASK) & ~PAGE_MASK; md_addr.pv_va = md_addr.pv_pa = MDROOT_ADDR; - kerneldatasize = (u_int32_t)&end - (u_int32_t)KERNVIRTADDR; - symbolsize = 0; freemempos = (vm_offset_t)round_page(physical_freestart); memset((void *)freemempos, 0, 256*1024); /* Define a macro to simplify memory allocation */ @@ -265,14 +261,12 @@ } } - valloc_pages(systempage, 1); - /* * Allocate a page for the system page mapped to V0x00000000 * This page will just contain the system vectors and can be * shared by all processes. */ - pt_size = round_page(freemempos) - physical_freestart; + valloc_pages(systempage, 1); /* Allocate stacks for all modes */ valloc_pages(irqstack, IRQ_STACK_SIZE); ==== //depot/projects/usb/src/sys/arm/xscale/ixp425/avila_machdep.c#10 (text+ko) ==== @@ -48,7 +48,7 @@ #include "opt_msgbuf.h" #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.14 2008/12/20 03:26:09 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.15 2009/02/03 19:16:04 sam Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -154,6 +154,10 @@ { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* CFI Flash on the Expansion Bus */ + { IXP425_EXP_BUS_CS0_VBASE, IXP425_EXP_BUS_CS0_HWBASE, + IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* IXP425 PCI Configuration */ { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, ==== //depot/projects/usb/src/sys/arm/xscale/ixp425/files.ixp425#6 (text+ko) ==== @@ -1,4 +1,4 @@ -#$FreeBSD: src/sys/arm/xscale/ixp425/files.ixp425,v 1.7 2008/12/23 17:40:02 sam Exp $ +#$FreeBSD: src/sys/arm/xscale/ixp425/files.ixp425,v 1.8 2009/02/03 19:16:04 sam Exp $ arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard arm/arm/irq_dispatch.S standard @@ -15,6 +15,7 @@ arm/xscale/ixp425/uart_bus_ixp425.c optional uart arm/xscale/ixp425/ixp425_a4x_space.c optional uart arm/xscale/ixp425/ixp425_a4x_io.S optional uart +dev/cfi/cfi_bus_ixp4xx.c optional cfi dev/uart/uart_dev_ns8250.c optional uart # # NPE-based Ethernet support (requires qmgr also). ==== //depot/projects/usb/src/sys/arm/xscale/ixp425/ixp425.c#7 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425.c,v 1.12 2008/12/23 04:48:27 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425.c,v 1.13 2009/02/03 19:16:04 sam Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -329,6 +329,8 @@ { IXP425_IO_HWBASE, IXP425_IO_SIZE, IXP425_IO_VBASE }, { IXP425_PCI_HWBASE, IXP425_PCI_SIZE, IXP425_PCI_VBASE }, { IXP425_PCI_MEM_HWBASE,IXP425_PCI_MEM_SIZE, IXP425_PCI_MEM_VBASE }, + { IXP425_EXP_BUS_CS0_HWBASE, IXP425_EXP_BUS_CS0_SIZE, + IXP425_EXP_BUS_CS0_VBASE }, /* NB: needed only for uart_cpu_getdev */ { IXP425_UART0_HWBASE, IXP425_REG_SIZE, IXP425_UART0_VBASE }, { IXP425_UART1_HWBASE, IXP425_REG_SIZE, IXP425_UART1_VBASE }, ==== //depot/projects/usb/src/sys/arm/xscale/ixp425/ixp425reg.h#4 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/arm/xscale/ixp425/ixp425reg.h,v 1.4 2008/12/23 04:48:27 sam Exp $ + * $FreeBSD: src/sys/arm/xscale/ixp425/ixp425reg.h,v 1.5 2009/02/03 19:16:04 sam Exp $ * */ @@ -76,6 +76,10 @@ * Global cache clean area * FF00 0000 --------------------------- * + * FE00 0000 --------------------------- + * 16M CFI Flash (on ext bus) + * FD00 0000 --------------------------- + * * FC00 0000 --------------------------- * PCI Data (memory space) * F800 0000 --------------------------- IXP425_PCI_MEM_VBASE @@ -649,6 +653,9 @@ #define IXP425_EXP_BUS_CSx_VBASE(i) \ (IXP425_MAC_B_VBASE + (i)*IXP425_MAC_B_SIZE) +#define IXP425_EXP_BUS_CS0_HWBASE IXP425_EXP_BUS_CSx_HWBASE(0) +#define IXP425_EXP_BUS_CS0_VBASE 0xFD000000UL +#define IXP425_EXP_BUS_CS0_SIZE 0x01000000 /* NB: 16M */ #define IXP425_EXP_BUS_CS1_HWBASE IXP425_EXP_BUS_CSx_HWBASE(1) #define IXP425_EXP_BUS_CS1_VBASE IXP425_EXP_BUS_CSx_VBASE(1) #define IXP425_EXP_BUS_CS1_SIZE 0x1000 @@ -663,7 +670,6 @@ #define IXP425_EXP_BUS_CS4_SIZE 0x1000 /* NB: not mapped (yet) */ -#define IXP425_EXP_BUS_CS0_HWBASE IXP425_EXP_BUS_CSx_HWBASE(0) #define IXP425_EXP_BUS_CS5_HWBASE IXP425_EXP_BUS_CSx_HWBASE(5) #define IXP425_EXP_BUS_CS6_HWBASE IXP425_EXP_BUS_CSx_HWBASE(6) >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Feb 8 14:44:20 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 62FD61065672; Sun, 8 Feb 2009 14:44:20 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F216106566B for ; Sun, 8 Feb 2009 14:44:20 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0C6E88FC24 for ; Sun, 8 Feb 2009 14:44:20 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n18EiJNl071943 for ; Sun, 8 Feb 2009 14:44:19 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n18EiJFh071941 for perforce@freebsd.org; Sun, 8 Feb 2009 14:44:19 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 8 Feb 2009 14:44:19 GMT Message-Id: <200902081444.n18EiJFh071941@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157369 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: Sun, 08 Feb 2009 14:44:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=157369 Change 157369 by rwatson@rwatson_cinnamon_macosx on 2009/02/08 14:43:31 Use 32-bit types for 32-bit padding. Submitted by: sson Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#87 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#87 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2008 Apple Inc. + * Copyright (c) 2004-2009 Apple Inc. * Copyright (c) 2005 SPARTA, Inc. * All rights reserved. * @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#86 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#87 $ */ #include @@ -168,7 +168,7 @@ token_t *t; u_char *dptr = NULL; u_int16_t pad0_16 = 0; - u_int16_t pad0_32 = 0; + u_int32_t pad0_32 = 0; GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int16_t) + 3 * sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); @@ -217,7 +217,7 @@ token_t *t; u_char *dptr = NULL; u_int16_t pad0_16 = 0; - u_int16_t pad0_32 = 0; + u_int32_t pad0_32 = 0; GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int16_t) + 3 * sizeof(u_int32_t) + sizeof(u_int64_t) * 2); From owner-p4-projects@FreeBSD.ORG Sun Feb 8 14:53:30 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E5B9F1065670; Sun, 8 Feb 2009 14:53:29 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0819106564A for ; Sun, 8 Feb 2009 14:53:29 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6378FC0A for ; Sun, 8 Feb 2009 14:53:29 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n18ErTes072627 for ; Sun, 8 Feb 2009 14:53:29 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n18ErTe6072625 for perforce@freebsd.org; Sun, 8 Feb 2009 14:53:29 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 8 Feb 2009 14:53:29 GMT Message-Id: <200902081453.n18ErTe6072625@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157371 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: Sun, 08 Feb 2009 14:53:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=157371 Change 157371 by rwatson@rwatson_cinnamon_macosx on 2009/02/08 14:52:55 Fix mental arithmetic error in IPv6 address encoding for socket_ex tokens. Submitted by: sson Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#88 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#88 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#87 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#88 $ */ #include @@ -962,7 +962,7 @@ 5 * sizeof(u_int16_t) + 2 * sizeof(u_int32_t)); else if (so_domain == AF_INET6) GET_TOKEN_AREA(t, dptr, sizeof(u_char) + - 5 * sizeof(u_int16_t) + 16 * sizeof(u_int32_t)); + 5 * sizeof(u_int16_t) + 8 * sizeof(u_int32_t)); else { errno = EINVAL; return (NULL); From owner-p4-projects@FreeBSD.ORG Sun Feb 8 18:09:49 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 94D471065673; Sun, 8 Feb 2009 18:09:49 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 528B6106566B for ; Sun, 8 Feb 2009 18:09:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2635D8FC16 for ; Sun, 8 Feb 2009 18:09:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n18I9nJ7004762 for ; Sun, 8 Feb 2009 18:09:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n18I9n3k004760 for perforce@freebsd.org; Sun, 8 Feb 2009 18:09:49 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 8 Feb 2009 18:09:49 GMT Message-Id: <200902081809.n18I9n3k004760@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157375 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: Sun, 08 Feb 2009 18:09:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=157375 Change 157375 by hselasky@hselasky_laptop001 on 2009/02/08 18:09:47 Style fix. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/controller/ohci2.c#29 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/controller/ohci2.c#29 (text+ko) ==== @@ -864,7 +864,7 @@ */ xfer->frlengths[xfer->aframes] += td->len - temp; } - } else{ + } else { if (xfer->aframes != xfer->nframes) { /* transfer was complete */ xfer->frlengths[xfer->aframes] += td->len; From owner-p4-projects@FreeBSD.ORG Sun Feb 8 20:26:17 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D4D2A106567C; Sun, 8 Feb 2009 20:26:16 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D6381065679 for ; Sun, 8 Feb 2009 20:26:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7B2438FC19 for ; Sun, 8 Feb 2009 20:26:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n18KQGcQ022365 for ; Sun, 8 Feb 2009 20:26:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n18KQGYG022363 for perforce@freebsd.org; Sun, 8 Feb 2009 20:26:16 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 8 Feb 2009 20:26:16 GMT Message-Id: <200902082026.n18KQGYG022363@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157384 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: Sun, 08 Feb 2009 20:26:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=157384 Change 157384 by hselasky@hselasky_laptop001 on 2009/02/08 20:25:45 USB controller: EHCI High Speed Interrupt endpoint fix. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.c#32 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.c#32 (text+ko) ==== @@ -1896,8 +1896,17 @@ EHCI_QH_SET_MPL(xfer->max_packet_size)); if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { - qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | - EHCI_QH_DTC | EHCI_QH_SET_NRL(8)); + if (methods != &ehci_device_intr_methods) { + qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | + EHCI_QH_DTC | EHCI_QH_SET_NRL(8)); + } else { + /* + * Nak-Reload count must be zero for interrupt + * endpoints See EHCI pdf file, section 4.9 + */ + qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | + EHCI_QH_DTC); + } } else { if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) { From owner-p4-projects@FreeBSD.ORG Sun Feb 8 20:27:05 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 68E4A1065674; Sun, 8 Feb 2009 20:27:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28C621065670 for ; Sun, 8 Feb 2009 20:27:05 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe16.tele2.se [212.247.155.225]) by mx1.freebsd.org (Postfix) with ESMTP id B45738FC1E for ; Sun, 8 Feb 2009 20:27:04 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=HcgQRbkXxygA:10 a=6I5d2MoRAAAA:8 a=25scGGxi_g8eth-xpakA:9 a=y9YGbA4hUIImggaEKcEA:7 a=-6kP_-IA7zdTNAqgfKQJNAkVzj0A:4 a=LY0hPdMaydYA:10 Received: from [193.217.167.198] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe16.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 449570848 for perforce@freebsd.org; Sun, 08 Feb 2009 21:27:03 +0100 From: Hans Petter Selasky To: Perforce Change Reviews Date: Sun, 8 Feb 2009 21:29:30 +0100 User-Agent: KMail/1.9.7 References: <200902082026.n18KQGYG022363@repoman.freebsd.org> In-Reply-To: <200902082026.n18KQGYG022363@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902082129.30214.hselasky@c2i.net> Cc: Subject: Re: PERFORCE change 157384 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: Sun, 08 Feb 2009 20:27:06 -0000 On Sunday 08 February 2009, Hans Petter Selasky wrote: > http://perforce.freebsd.org/chv.cgi?CH=157384 Reported by Andrew Thompson. --HPS From owner-p4-projects@FreeBSD.ORG Sun Feb 8 21:14:49 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0F4211065677; Sun, 8 Feb 2009 21:14:49 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE919106566C; Sun, 8 Feb 2009 21:14:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 817FE8FC1C; Sun, 8 Feb 2009 21:14:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id AE602FF91; Mon, 9 Feb 2009 10:14:47 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4cmQCBJw+PXC; Mon, 9 Feb 2009 10:14:43 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 9 Feb 2009 10:14:43 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 931FC1142A; Mon, 9 Feb 2009 10:14:42 +1300 (NZDT) Date: Sun, 8 Feb 2009 13:14:42 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090208211442.GA33200@citylink.fud.org.nz> References: <200902082026.n18KQGYG022363@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902082026.n18KQGYG022363@repoman.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Perforce Change Reviews Subject: Re: PERFORCE change 157384 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: Sun, 08 Feb 2009 21:14:50 -0000 On Sun, Feb 08, 2009 at 08:26:16PM +0000, Hans Petter Selasky wrote: > http://perforce.freebsd.org/chv.cgi?CH=157384 > > Change 157384 by hselasky@hselasky_laptop001 on 2009/02/08 20:25:45 > > > USB controller: EHCI High Speed Interrupt endpoint fix. > > Affected files ... > > .. //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.c#32 edit > Oh snap, I found the same problem (r188336). It helps to confirm with others reporting and working on issues that (a) a patch has been made and (b) it resolves the problem on the original hardware. cheers, Andrew From owner-p4-projects@FreeBSD.ORG Sun Feb 8 23:24:33 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4E8E41065674; Sun, 8 Feb 2009 23:24:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E3171065672 for ; Sun, 8 Feb 2009 23:24:33 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EF5A98FC0C for ; Sun, 8 Feb 2009 23:24:32 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n18NOW3U051783 for ; Sun, 8 Feb 2009 23:24:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n18NOWpX051781 for perforce@freebsd.org; Sun, 8 Feb 2009 23:24:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 8 Feb 2009 23:24:32 GMT Message-Id: <200902082324.n18NOWpX051781@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157403 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: Sun, 08 Feb 2009 23:24:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=157403 Change 157403 by rwatson@rwatson_cinnamon_macosx on 2009/02/08 23:23:57 Use au_domain_to_bsm() and au_socket_type_to_bsm() to convert arguments to au_to_socket_ex() before encoding a token. Submitted by: sson Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#89 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#89 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#88 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#89 $ */ #include @@ -969,8 +969,8 @@ } ADD_U_CHAR(dptr, AUT_SOCKET_EX); - ADD_U_INT16(dptr, so_domain); /* XXXRW: explicitly convert? */ - ADD_U_INT16(dptr, so_type); /* XXXRW: explicitly convert? */ + ADD_U_INT16(dptr, au_domain_to_bsm(so_domain)); + ADD_U_INT16(dptr, au_socket_type_to_bsm(so_type)); if (so_domain == AF_INET) { ADD_U_INT16(dptr, AU_IPv4); sin = (struct sockaddr_in *)sa_local; From owner-p4-projects@FreeBSD.ORG Sun Feb 8 23:26:36 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C35F91065673; Sun, 8 Feb 2009 23:26:35 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82336106566B for ; Sun, 8 Feb 2009 23:26:35 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6F3B68FC13 for ; Sun, 8 Feb 2009 23:26:35 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n18NQZGN051970 for ; Sun, 8 Feb 2009 23:26:35 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n18NQZgL051968 for perforce@freebsd.org; Sun, 8 Feb 2009 23:26:35 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 8 Feb 2009 23:26:35 GMT Message-Id: <200902082326.n18NQZgL051968@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157404 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: Sun, 08 Feb 2009 23:26:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=157404 Change 157404 by rwatson@rwatson_cinnamon_macosx on 2009/02/08 23:25:42 Update NEWS. Affected files ... .. //depot/projects/trustedbsd/openbsm/NEWS#31 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/NEWS#31 (text+ko) ==== @@ -15,6 +15,8 @@ cnt,argv rather than cnt so that execve(2) arguments are captured if AUE_EXECVE events are audited. These may provide more usable defaults for many users. +- Use au_domain_to_bsm(3) and au_socket_type_to_bsm(3) to convert + au_to_socket_ex(3) arguments to BSM format. OpenBSM 1.1 alpha 5 @@ -428,4 +430,4 @@ to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#30 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#31 $ From owner-p4-projects@FreeBSD.ORG Sun Feb 8 23:42:02 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0BC4E1065672; Sun, 8 Feb 2009 23:42:02 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE8F8106566C for ; Sun, 8 Feb 2009 23:42:01 +0000 (UTC) (envelope-from antab@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id ABBA18FC12 for ; Sun, 8 Feb 2009 23:42:01 +0000 (UTC) (envelope-from antab@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n18Ng18T053175 for ; Sun, 8 Feb 2009 23:42:01 GMT (envelope-from antab@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n18Ng1en053173 for perforce@freebsd.org; Sun, 8 Feb 2009 23:42:01 GMT (envelope-from antab@FreeBSD.org) Date: Sun, 8 Feb 2009 23:42:01 GMT Message-Id: <200902082342.n18Ng1en053173@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to antab@FreeBSD.org using -f From: Arnar Mar Sig To: Perforce Change Reviews Cc: Subject: PERFORCE change 157407 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: Sun, 08 Feb 2009 23:42:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=157407 Change 157407 by antab@antab_farm on 2009/02/08 23:41:58 Change nexus and at32bus to use hints instead of builtin list. Add interrupt handling, seems to be working but need to test more. Add at32_pm, at32_intc and at32_sdramc driver skeletons for testing. First draft of clock handling, just a api skeleton for device drivers to call to enable/disable and get/set rate. Affected files ... .. //depot/projects/avr32/src/sys/avr32/avr32/at32.c#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/at32_intc.c#1 add .. //depot/projects/avr32/src/sys/avr32/avr32/at32_pio.c#2 edit .. //depot/projects/avr32/src/sys/avr32/avr32/at32_pm.c#1 add .. //depot/projects/avr32/src/sys/avr32/avr32/at32_rtc.c#2 edit .. //depot/projects/avr32/src/sys/avr32/avr32/at32_sdramc.c#1 add .. //depot/projects/avr32/src/sys/avr32/avr32/at32ap700x.c#2 delete .. //depot/projects/avr32/src/sys/avr32/avr32/clock.c#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/cpu.c#4 edit .. //depot/projects/avr32/src/sys/avr32/avr32/exception.S#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/intr.c#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/machdep.c#4 edit .. //depot/projects/avr32/src/sys/avr32/avr32/nexus.c#3 edit .. //depot/projects/avr32/src/sys/avr32/conf/NGW100#4 edit .. //depot/projects/avr32/src/sys/avr32/conf/cpu/at32ap7000.hints#1 add .. //depot/projects/avr32/src/sys/avr32/conf/cpu/at32ap7002.hints#1 add .. //depot/projects/avr32/src/sys/avr32/conf/cpu/at32ap700x.hints#1 add .. //depot/projects/avr32/src/sys/avr32/include/at32.h#3 delete .. //depot/projects/avr32/src/sys/avr32/include/at32ap700x.h#2 edit .. //depot/projects/avr32/src/sys/avr32/include/cpu.h#4 edit .. //depot/projects/avr32/src/sys/avr32/include/intr.h#3 edit .. //depot/projects/avr32/src/sys/avr32/include/reg.h#3 edit .. //depot/projects/avr32/src/sys/avr32/include/reg_intc.h#2 edit .. //depot/projects/avr32/src/sys/avr32/include/reg_pm.h#1 add .. //depot/projects/avr32/src/sys/avr32/include/reg_rtc.h#2 edit .. //depot/projects/avr32/src/sys/avr32/include/reg_sdramc.h#1 add .. //depot/projects/avr32/src/sys/conf/files#2 edit .. //depot/projects/avr32/src/sys/conf/files.avr32#4 edit .. //depot/projects/avr32/src/sys/conf/ldscript.avr32#3 edit .. //depot/projects/avr32/src/sys/dev/uart/uart_dev_atmel.c#3 edit .. //depot/projects/avr32/src/sys/sys/devclk.h#1 add Differences ... ==== //depot/projects/avr32/src/sys/avr32/avr32/at32.c#3 (text+ko) ==== @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -43,39 +44,66 @@ #include #include #include -#include +#include +#include #include #include /* Prototypes */ +static int at32_probe(device_t); +static int at32_attach(device_t); +static device_t at32_add_child(device_t, int, const char *, int); +static void at32_hinted_child(device_t, const char *, int); static struct resource_list *at32_get_resource_list(device_t, device_t); static int at32_print_child(device_t, device_t); -static int at32_activate_resource(device_t, device_t, int, int, struct resource *); +static int at32_activate_resource(device_t, device_t, int, int, + struct resource *); +static int at32_deactivate_resource(device_t, device_t, int, int, + struct resource *); static int at32_teardown_intr(device_t, device_t, struct resource *, void *); -static int at32_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); -static int at32_release_resource(device_t, device_t, int, int, struct resource *); -static struct resource *at32_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); -static int at32_attach(device_t); -static void at32_add_child(device_t, int, const char *, int, bus_addr_t, bus_size_t, int); -static void at32_identify(driver_t *, device_t); -static int at32_probe(device_t); +static int at32_setup_intr(device_t, device_t, struct resource *, int, + driver_filter_t *, driver_intr_t *, void *, void **); +static int at32_release_resource(device_t, device_t, int, int, + struct resource *); +static struct resource *at32_alloc_resource(device_t, device_t, int, int *, + u_long, u_long, u_long, u_int); +static uint64_t at32_clk_get_rate(device_t, device_t); +static int at32_clk_set_rate(device_t, device_t, uint64_t); +static void at32_clk_enable(device_t, device_t); +static void at32_clk_disable(device_t, device_t); /* Driver variables and private data */ +struct at32_softc { + struct rman sc_irq_rman; + struct resource *sc_mem_res; + struct rman sc_mem_rman; +}; +struct at32_ivar { + struct resource_list resources; + int clk_bus; + int clk_index; +}; static device_method_t at32_methods[] = { DEVMETHOD(device_probe, at32_probe), DEVMETHOD(device_attach, at32_attach), - DEVMETHOD(device_identify, at32_identify), + DEVMETHOD(bus_add_child, at32_add_child), + DEVMETHOD(bus_hinted_child, at32_hinted_child), + DEVMETHOD(bus_print_child, at32_print_child), DEVMETHOD(bus_alloc_resource, at32_alloc_resource), DEVMETHOD(bus_setup_intr, at32_setup_intr), DEVMETHOD(bus_teardown_intr, at32_teardown_intr), DEVMETHOD(bus_activate_resource, at32_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_deactivate_resource, at32_deactivate_resource), DEVMETHOD(bus_get_resource_list, at32_get_resource_list), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_release_resource, at32_release_resource), - DEVMETHOD(bus_print_child, at32_print_child), + + DEVMETHOD(devclk_get_rate, at32_clk_get_rate), + DEVMETHOD(devclk_set_rate, at32_clk_set_rate), + DEVMETHOD(devclk_enable, at32_clk_enable), + DEVMETHOD(devclk_disable, at32_clk_disable), {0, 0}, }; static driver_t at32_driver = { @@ -94,87 +122,94 @@ return (0); } -static void -at32_identify(driver_t *drv, device_t parent) -{ - BUS_ADD_CHILD(parent, 0, "at32bus", 0); -} - -static void -at32_add_child(device_t dev, int prio, const char *name, int unit, - bus_addr_t addr, bus_size_t size, int irq) -{ - device_t kid; - struct at32_ivar *ivar; - - kid = device_add_child_ordered(dev, prio, name, unit); - if (kid == NULL) { - printf("Can't add child %s%d ordered\n", name, unit); - return; - } - ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); - if (ivar == NULL) { - device_delete_child(dev, kid); - printf("Can't add alloc ivar\n"); - return; - } - device_set_ivars(kid, ivar); - resource_list_init(&ivar->resources); - if (addr != 0) { - bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); - } - if (irq != -1) { - bus_set_resource(kid, SYS_RES_IRQ, 0, irq, 1); - } -} - static int at32_attach(device_t dev) { - int i; + int rid; struct at32_softc *sc = device_get_softc(dev); - struct at32_cpu_device *walker; - sc->sc_st = 0; - sc->sc_sh = AT32AP700X_BASE; - sc->dev = dev; - - // Resource list for IRQ + /* Resource list for IRQ */ + /* Reserve irqs from nexus ? */ sc->sc_irq_rman.rm_type = RMAN_ARRAY; sc->sc_irq_rman.rm_descr = "AT32 IRQs"; if (rman_init(&sc->sc_irq_rman) != 0 || - rman_manage_region(&sc->sc_irq_rman, 1, IRQ_COUNT) != 0) { - panic("at32_attach: failed to set up IRQ rman"); + rman_manage_region(&sc->sc_irq_rman, 1, IRQ_COUNT) != 0) { + panic("at32_attach: failed to set up IRQ rman\n"); } - // Resource list for system memory + /* Resource list for system memory */ + rid = 0; + sc->sc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, + AVR32_SEG_P4, 0xfffffffful, 0, RF_ACTIVE); + if (sc->sc_mem_res == NULL) { + panic("at32_attach: failed to alloc bus memory\n"); + } sc->sc_mem_rman.rm_type = RMAN_ARRAY; sc->sc_mem_rman.rm_descr = "AT32 Memory"; if (rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_mem_rman, AVR32_SEG_P4, - 0xfffffffful) != 0) { + rman_manage_region(&sc->sc_mem_rman, AVR32_SEG_P4, + 0xfffffffful) != 0) { panic("at32_attach: fail to set up memory rman\n"); } - /* Reserve memory range for INTC, we will handle access to it */ - sc->sc_intc_res = rman_reserve_resource(&sc->sc_mem_rman, - AT32AP700X_BASE + AT32AP700X_INTC_OFFSET, - AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + AT32AP700X_INTC_SIZE, - AT32AP700X_INTC_SIZE, 0, dev); - if (!sc->sc_intc_res) { - panic("at32_attach: unable to reserve INTC memory\n"); + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + bus_generic_attach(dev); + return 0; +} + +static device_t +at32_add_child(device_t bus, int order, const char *name, int unit) +{ + device_t child; + struct at32_ivar *ivar; + + ivar = malloc(sizeof(struct at32_ivar), M_DEVBUF, M_WAITOK | M_ZERO); + if (ivar == NULL) { + device_printf(bus, "Failed to allocate ivar\n"); + return (0); + } + resource_list_init(&ivar->resources); + + child = device_add_child_ordered(bus, order, name, unit); + if (child == NULL) { + device_printf(bus, "Can't add child %s%d ordered\n", name, unit); + return (0); } + device_set_ivars(child, ivar); + + return (child); +} + +static void +at32_hinted_child(device_t bus, const char *dname, int dunit) +{ + device_t child; + long maddr; + int msize, irq, result; + + child = BUS_ADD_CHILD(bus, 0, dname, dunit); + + /* + * Set hard-wired resources for hinted child using + * specific RIDs. + */ + resource_long_value(dname, dunit, "maddr", &maddr); + resource_int_value(dname, dunit, "msize", &msize); - // Add buildin devices - for (i = 0, walker = at32_cpu_devices; walker->name; i++, walker++) { - at32_add_child(dev, i, walker->name, walker->unit, - walker->mem_base, walker->mem_len, walker->irq); - }; + result = bus_set_resource(child, SYS_RES_MEMORY, 0, maddr, msize); + if (result != 0) { + device_printf(bus, "warning: bus_set_resource() failed\n"); + } - bus_generic_probe(dev); - bus_generic_attach(dev); - return 0; + if (resource_int_value(dname, dunit, "irq", &irq) == 0) { + result = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); + if (result != 0) { + device_printf(bus, + "warning: bus_set_resource() failed\n"); + } + } } static struct resource * @@ -247,32 +282,38 @@ static int at32_setup_intr(device_t dev, device_t child, struct resource *ires, int flags, - driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) + driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { if ((rman_get_flags(ires) & RF_SHAREABLE) == 0) { flags |= INTR_EXCL; } - - avr32_setup_irqhandler(device_get_nameunit(child), - filt, intr, arg, rman_get_start(ires), flags, cookiep); + BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, + intr, arg, cookiep); return (0); } static int at32_teardown_intr(device_t dev, device_t child, struct resource *res, - void *cookie) + void *cookie) { - return (avr32_remove_irqhandler(rman_get_start(res), cookie)); + return (BUS_TEARDOWN_INTR(device_get_parent(dev), child, res, cookie)); } static int at32_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) + struct resource *r) { return (rman_activate_resource(r)); } static int +at32_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + return (rman_deactivate_resource(r)); +} + +static int at32_print_child(device_t dev, device_t child) { struct at32_ivar *ivars; @@ -284,7 +325,6 @@ retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); if (device_get_flags(dev)) { @@ -304,4 +344,28 @@ return (&(ivar->resources)); } +static uint64_t +at32_clk_get_rate(device_t dev, device_t child) +{ + avr32_impl(); + return (0); +} + +static int +at32_clk_set_rate(device_t dev, device_t child, uint64_t rate) +{ + avr32_impl(); + return (0); +} + +static void +at32_clk_enable(device_t dev, device_t child) +{ + /* TODO: Implement */ +} +static void +at32_clk_disable(device_t dev, device_t child) +{ + /* TODO: Implement */ +} ==== //depot/projects/avr32/src/sys/avr32/avr32/at32_pio.c#2 (text+ko) ==== @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -105,8 +105,10 @@ at32_pio_attach(device_t dev) { struct at32_pio_softc *sc = device_get_softc(dev); + sc->dev = dev; - sc->dev = dev; + /* Make sure clock is active before doing anything */ + devclk_enable(dev); return 0; } ==== //depot/projects/avr32/src/sys/avr32/avr32/at32_rtc.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ * fRTC = 2 ^ -(PSEL + 1) * 32KHz * The datasheet also says we should set PSEL to at last 2 to ensure no ticks * are missed when entering sleep modes. - * So we will set PSEL to 14 giving us a 1Hz clock + * So we will set PSEL to 14 giving us a 1Hz */ #include @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -49,16 +50,15 @@ #include #include #include -#include #include #include #include "clock_if.h" #define RD4(off) \ - bus_space_read_4(sc->sc_bst, sc->sc_bsh, (off)) + bus_space_read_4(sc->bst, sc->bsh, (off)) #define WR4(off, val) \ - bus_space_write_4(sc->sc_bst, sc->sc_bsh, (off), (val)) + bus_space_write_4(sc->bst, sc->bsh, (off), (val)) /* Prototypes */ static int at32_rtc_probe(device_t); @@ -66,14 +66,16 @@ static int at32_rtc_detach(device_t); static int at32_rtc_gettime(device_t, struct timespec *); static int at32_rtc_settime(device_t, struct timespec *); +static int at32_rtc_activate(device_t); +static void at32_rtc_deactivate(device_t); /* Driver variables and private data */ -static struct at32_rtc_softc { - struct resource *sc_regs_res; - int sc_regs_rid; - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; -} *rtc_softc; +struct at32_rtc_softc { + struct resource *regs_res; + int regs_rid; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; static device_method_t at32_rtc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, at32_rtc_probe), @@ -104,29 +106,23 @@ at32_rtc_attach(device_t dev) { struct at32_rtc_softc *sc = device_get_softc(dev); + int err; - /* Global Pointer to private data, (cant i get with passed in - * timecounter callback? */ - rtc_softc = sc; - - /* Set private data and map register space */ - sc->sc_regs_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->sc_regs_rid, 0, - ~0, 0, RF_ACTIVE); - if (!sc->sc_regs_res) { - return (ENOMEM); + err = at32_rtc_activate(dev); + if (err) { + return (err); } - sc->sc_bsh = rman_get_bushandle(sc->sc_regs_res); - sc->sc_bst = rman_get_bustag(sc->sc_regs_res); - /* Enable RTC and set prescaler to 14 */ + /* Enable RTC and set prescaler to 2 */ WR4(AT32_RTC_CTRL, - 2 << bit_shift(RTC, CTRL, PSEL) | - bit_offset(RTC, CTRL, PCLR) | - bit_offset(RTC, CTRL, EN)); + 2 << bit_shift(RTC, CTRL, PSEL) | + bit_offset(RTC, CTRL, PCLR) | + bit_offset(RTC, CTRL, EN)); + + /* Enable interrupt on TOP */ + WR4(AT32_RTC_IER, bit_offset(RTC, IER, TOPI)); clock_register(dev, 1000000); - - return (0); } @@ -134,7 +130,12 @@ at32_rtc_detach(device_t dev) { struct at32_rtc_softc *sc = device_get_softc(dev); - bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_regs_rid, sc->sc_regs_res); + + /* Disable interrupt */ + WR4(AT32_RTC_IER, bit_offset(RTC, IER, TOPI)); + + at32_rtc_deactivate(dev); + return (0); } static int @@ -153,3 +154,42 @@ WR4(AT32_RTC_VAL, ts->tv_sec); return (0); } + +static int +at32_rtc_activate(device_t dev) +{ + struct at32_rtc_softc *sc = device_get_softc(dev); + int rid, err = ENOMEM; + + /* Make sure device clock is enabled before writing */ + devclk_enable(dev); + + /* Set private data and map register space */ + sc->regs_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->regs_rid, 0, + ~0, 0, RF_ACTIVE); + if (!sc->regs_res) { + goto err; + } + sc->bsh = rman_get_bushandle(sc->regs_res); + sc->bst = rman_get_bustag(sc->regs_res); + + return (0); + +err: + at32_rtc_deactivate(dev); + return (err); +} + +static void +at32_rtc_deactivate(device_t dev) +{ + struct at32_rtc_softc *sc = device_get_softc(dev); + + if (sc->regs_res) { + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->regs_res), sc->regs_res); + } + + /* Turn off device clock */ + devclk_disable(dev); +} ==== //depot/projects/avr32/src/sys/avr32/avr32/clock.c#3 (text+ko) ==== @@ -38,6 +38,7 @@ #include #include #include +#include #include #include ==== //depot/projects/avr32/src/sys/avr32/avr32/cpu.c#4 (text+ko) ==== @@ -64,25 +64,13 @@ #include extern vm_offset_t _evba; -extern vm_offset_t _evba_irq; void cpu_init(void) { - int i; - /* Set exception vector */ sysreg_write(EVBA, (uint32_t)&_evba); __asm__ __volatile__ ("csrf %0" : : "i"(AT32_SYS_SR_EM)); - - - /* Setup INTC, every interrupt is at priority 0 */ -/* for (i = 0; i < IRQ_COUNT; i++) { - reg_write(AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + - (i * sizeof(register_t)), INTC, IPR, - (_evba_irq - _evba)); - } -*/ } void ==== //depot/projects/avr32/src/sys/avr32/avr32/exception.S#3 (text+ko) ==== @@ -26,27 +26,52 @@ */ #include +#include #include +#include #include "assym.s" __FBSDID("$FreeBSD: $"); /* Save a trapfrome to stack */ -#define PUSH_TRAPFRAME \ - sub sp, 4; \ - stmts --sp, r0-lr; \ - mfsr r11, AT32_SYS_RAR_EX; \ - mfsr r12, AT32_SYS_RSR_EX; \ +#define PUSH_TRAPFRAME(context) \ + sub sp, 4; \ + stmts --sp, r0-lr; \ + mfsr r11, AT32_SYS_RAR_##context; \ + mfsr r12, AT32_SYS_RSR_##context; \ pushm r11-r12; /* Restore trapframe from stack */ -#define POP_TRAPFRAME \ +#define POP_TRAPFRAME(context) \ popm r11-r12; \ - mtsr AT32_SYS_RAR_EX, r11; \ - mtsr AT32_SYS_RSR_EX, r12; \ - ldmts sp++, r0-lr; \ - sub sp, -4 + mtsr AT32_SYS_RAR_##context, r11; \ + mtsr AT32_SYS_RSR_##context, r12; \ + ldmts sp++, r0-lr; \ + sub sp, -4; + +/* Handle IRQ */ +#define IRQ(num) \ + GLOBAL(intr_handle##num); \ + PUSH_TRAPFRAME(INT##num); \ + mov r10, num; \ + lddpc r12, intr_cause_offset##num; \ + ld.w r11, r12; \ + mov r12, sp; \ + call intr_handle; \ + POP_TRAPFRAME(INT##num); \ + rete; \ +intr_cause_offset##num:; \ + .long AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + \ + AT32_INTC_ICR0 - (4 * num); + +#if 0 +#define IRQ(num) \ + GLOBAL(intr_handle##num); \ + sub r12, pc, (. - i##num); \ + bral panic; \ +i##num: .asciz "IRQ!"; +#endif .section .text.evba,"ax",@progbits .align 2 @@ -110,12 +135,12 @@ /* later this should be done in assembly, but using C for now */ tlb_miss: - PUSH_TRAPFRAME + PUSH_TRAPFRAME(EX) mfsr r12, AT32_SYS_ECR mfsr r11, AT32_SYS_TLBEAR mfsr r10, AT32_SYS_TLBEHI rcall pmap_tlb_miss - POP_TRAPFRAME + POP_TRAPFRAME(EX) rete handle_critical: @@ -126,26 +151,26 @@ rete handle_illegal_opcode: - PUSH_TRAPFRAME + PUSH_TRAPFRAME(EX) mfsr r12, AT32_SYS_ECR - mov r11, sp + mov r11, sp rcall trap_handle_illegal_opcode rete handle_address_fault: - PUSH_TRAPFRAME + PUSH_TRAPFRAME(EX) mfsr r12, AT32_SYS_ECR - mov r11, sp + mov r11, sp rcall trap_handle_address_fault - POP_TRAPFRAME + POP_TRAPFRAME(EX) rete handle_protection_fault: - PUSH_TRAPFRAME + PUSH_TRAPFRAME(EX) mfsr r12, AT32_SYS_ECR - mov r11, sp + mov r11, sp rcall trap_handle_protection_fault - POP_TRAPFRAME + POP_TRAPFRAME(EX) rete handle_dtlb_modified: @@ -153,16 +178,14 @@ rete handle_breakpoint: - PUSH_TRAPFRAME - mov r12, AT32_SYS_ECR - mov r11, sp + PUSH_TRAPFRAME(EX) + mov r12, AT32_SYS_ECR + mov r11, sp rcall trap_handle_breakpoint - POP_TRAPFRAME + POP_TRAPFRAME(EX) rete -.section .text.evba.irq -ENTRY(handle_irq) - sub r12, pc, (. - 2f) - bral panic - rete -2: .asciz "Interrupt handler needed" +IRQ(0) +IRQ(1) +IRQ(2) +IRQ(3) ==== //depot/projects/avr32/src/sys/avr32/avr32/intr.c#3 (text+ko) ==== @@ -41,10 +41,12 @@ #include #include #include +#include #include /* Private data */ -static struct intr_event *intr_events[IRQ_COUNT]; +static struct intr_event *intr_event[IRQ_COUNT]; +extern vm_offset_t _evba; /* Code */ register_t @@ -70,14 +72,46 @@ } void +intr_init() +{ + size_t offset; + int i; + + /* Setup INTC, every interrupt is at priority 0 */ + for (i = 0; i < IRQ_COUNT; i++) { + offset = AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + + (i * sizeof(register_t)); + + reg_write(offset, INTC, IPR, + (vm_offset_t)intr_handle0 - (vm_offset_t)&_evba); + } + + /* Enable interrupts */ + sysreg_write(COMPARE, 0); + sysreg_write(SR, sysreg_read(SR) & ~INTR_MASK); +} + +void +intr_handle(struct trapframe *tf, int irq, int pri) +{ + if (!intr_event[irq] || TAILQ_EMPTY(&intr_event[irq]->ie_handlers)) { + printf("stray interrupt %d, priority %d\n", irq, pri); + return; + } + + if (intr_event_handle(intr_event[irq], tf) != 0) { + panic("stray interrupt %d, priority %d\n", irq, pri); + } +} + +void avr32_mask_irq(uintptr_t irq) { int pri; - avr32_impl(); pri = bit_value(INTC, IPR, INTLEVEL, - reg_read(AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + - (irq * sizeof(register_t)), INTC, IPR)); + reg_read(AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + + (irq * sizeof(register_t)), INTC, IPR)); sysreg_write(SR, sysreg_read(SR) | (bit_offset(SYS, SR, I0M) << pri)); } @@ -86,12 +120,10 @@ { int pri; - avr32_impl(); pri = bit_value(INTC, IPR, INTLEVEL, - reg_read(AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + - (irq * sizeof(register_t)), INTC, IPR)); + reg_read(AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + + (irq * sizeof(register_t)), INTC, IPR)); sysreg_write(SR, sysreg_read(SR) | ~(bit_offset(SYS, SR, I0M) << pri)); - } void @@ -105,18 +137,18 @@ return; } - event = intr_events[irq]; + event = intr_event[irq]; if (event == NULL) { error = intr_event_create(&event, (void *)irq, 0, irq, - (mask_fn)avr32_mask_irq, (mask_fn)avr32_unmask_irq, - NULL, NULL, "intr%d:", irq); + (mask_fn)avr32_mask_irq, (mask_fn)avr32_unmask_irq, + NULL, NULL, "intr%d:", irq); if (error) { return; } - intr_events[irq] = event; + intr_event[irq] = event; } intr_event_add_handler(event, name, filt, hand, arg, - intr_priority(flags), flags, cookiep); + intr_priority(flags), flags, cookiep); } int avr32_remove_irqhandler(int irq, void *cookie) @@ -124,7 +156,8 @@ struct intr_event *event; int error; - event = intr_events[irq]; + + event = intr_event[irq]; avr32_mask_irq(irq); error = intr_event_remove_handler(cookie); ==== //depot/projects/avr32/src/sys/avr32/avr32/machdep.c#4 (text+ko) ==== @@ -65,10 +65,16 @@ #include #include #include +#include + +/* Prototypes */ +void mi_startup(void); +void avr32_init(void); +static void avr32_init_proc0(void); +/* Misc variables and private data */ struct msgbuf *msgbufp = NULL; int cold = 1; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; struct pcb proc0_pcb; @@ -82,14 +88,13 @@ static void cpu_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); -// Prototypes (Should be in headers!) -void mi_startup(void); -void avr32_init(void); -void avr32_init_proc0(void); - -void avr32_init() { - cninit(); // Init console - cpu_init(); // Init needed cpu things (evb and irq) +/* Code */ +void +avr32_init() +{ + cninit(); // Init console + cpu_init(); // Init needed cpu things (evb and irq) + intr_init(); // Init interrupt handling uboot_parse_tags(); // Parse uboot tags realmem = btoc(phys_avail[1] - phys_avail[0]); @@ -102,7 +107,9 @@ mi_startup(); // Call machine independent part } -void avr32_init_proc0() { +static void +avr32_init_proc0() +{ proc_linkup(&proc0, &thread0); thread0.td_kstack = proc0_stack_end; thread0.td_kstack_pages = KSTACK_PAGES - 1; @@ -114,14 +121,16 @@ PCPU_SET(curpcb, thread0.td_pcb); } -static void cpu_startup(void *dummy) { +static void +cpu_startup(void *dummy) +{ uint32_t config; char arch_type; if (boothowto & RB_VERBOSE) { bootverbose++; } - bootverbose++; +// bootverbose++; vm_ksubmap_init(&kmi); @@ -170,7 +179,7 @@ printf("real memory = %u (%u MB)\n", ptoa(realmem), ptoa(realmem) / 1048576); - printf("avail memory = %u (%uMB)\n", ptoa(cnt.v_free_count), + printf("avail memory = %u (%u MB)\n", ptoa(cnt.v_free_count), ptoa(cnt.v_free_count) / 1048576); /* @@ -180,41 +189,57 @@ vm_pager_bufferinit(); } -void cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) { +void +cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) +{ pcpu->pc_asid_next = 1; pcpu->pc_asid_generation = 1; } -int fill_regs(struct thread *td, struct reg *regs) { +int +fill_regs(struct thread *td, struct reg *regs) +{ memcpy(regs, &td->td_frame->regs, sizeof(struct reg)); return (0); } -int fill_fpregs(struct thread *td, struct fpreg *regs) { +int +fill_fpregs(struct thread *td, struct fpreg *regs) +{ /* No FPU on avr32 */ memset(regs, 0, sizeof(struct fpreg)); return (0); } -int set_regs(struct thread *td, struct reg *regs) { +int +set_regs(struct thread *td, struct reg *regs) +{ memcpy(&td->td_frame->regs, regs, sizeof(struct reg)); return (0); } -int set_fpregs(struct thread *td, struct fpreg *regs) { +int +set_fpregs(struct thread *td, struct fpreg *regs) +{ /* No FPU on avr32 */ return (0); } -int fill_dbregs(struct thread *td, struct dbreg *regs) { +int +fill_dbregs(struct thread *td, struct dbreg *regs) +{ return (0); } -int set_dbregs(struct thread *td, struct dbreg *regs) { +int +set_dbregs(struct thread *td, struct dbreg *regs) +{ return (0); } >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon Feb 9 02:42:06 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B5639106566C; Mon, 9 Feb 2009 02:42:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72115106564A for ; Mon, 9 Feb 2009 02:42:05 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5F12B8FC0A for ; Mon, 9 Feb 2009 02:42:05 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n192g5VG079703 for ; Mon, 9 Feb 2009 02:42:05 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n192g4vr079701 for perforce@freebsd.org; Mon, 9 Feb 2009 02:42:04 GMT (envelope-from thompsa@freebsd.org) Date: Mon, 9 Feb 2009 02:42:04 GMT Message-Id: <200902090242.n192g4vr079701@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157412 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, 09 Feb 2009 02:42:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=157412 Change 157412 by thompsa@thompsa_burger on 2009/02/09 02:41:33 Sync from svn.freebsd.org/base/user/thompsa/usb which is a minimal changeset from oldUSB (no config_td). This excludes the taskqueue changes (for the moment) as requested. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#26 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumfw.h#2 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumreg.h#2 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#3 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#26 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralreg.h#2 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#3 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#29 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydfw.h#2 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#3 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#26 (text+ko) ==== @@ -1,3 +1,5 @@ +/* $FreeBSD: user/thompsa/usb/sys/dev/usb2/wlan/if_rum2.c 188355 2009-02-09 00:58:16Z thompsa $ */ + /*- * Copyright (c) 2005-2007 Damien Bergamini * Copyright (c) 2006 Niall O'Higgins @@ -16,13 +18,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* - * NOTE: all function names beginning like "rum_cfg_" can only - * be called from within the config thread function ! - */ - #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/wlan/if_rum2.c,v 1.9 2009/02/06 15:03:17 kevlo Exp $"); +__FBSDID("$FreeBSD: user/thompsa/usb/sys/dev/usb2/wlan/if_rum2.c 188355 2009-02-09 00:58:16Z thompsa $"); /*- * Ralink Technology RT2501USB/RT2601USB chipset driver @@ -34,15 +31,11 @@ #include #include -#define usb2_config_td_cc rum_config_copy -#define usb2_config_td_softc rum_softc - #define USB_DEBUG_VAR rum_debug #include #include #include -#include #include #include #include @@ -61,931 +54,815 @@ "Debug level"); #endif -/* prototypes */ +static const struct usb2_device_id rum_devs[] = { + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_HWU54DM) }, + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_2) }, + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_3) }, + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_4) }, + { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_WUG2700) }, + { USB_VP(USB_VENDOR_AMIT, USB_PRODUCT_AMIT_CGWLUSB2GO) }, + { USB_VP(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573_1) }, + { USB_VP(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573_2) }, + { USB_VP(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D7050A) }, + { USB_VP(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D9050V3) }, + { USB_VP(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSB54GC) }, + { USB_VP(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSB54GR) }, + { USB_VP(USB_VENDOR_CONCEPTRONIC2, USB_PRODUCT_CONCEPTRONIC2_C54RU2) }, + { USB_VP(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGWLUSB2GL) }, + { USB_VP(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGWLUSB2GPX) }, + { USB_VP(USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_CWD854F) }, + { USB_VP(USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_RT2573) }, + { USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWLG122C1) }, + { USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_WUA1340) }, + { USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA111) }, + { USB_VP(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA110) }, + { USB_VP(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWB01GS) }, + { USB_VP(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWI05GS) }, + { USB_VP(USB_VENDOR_GIGASET, USB_PRODUCT_GIGASET_RT2573) }, + { USB_VP(USB_VENDOR_GOODWAY, USB_PRODUCT_GOODWAY_RT2573) }, + { USB_VP(USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_HWGUSB254LB) }, + { USB_VP(USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_HWGUSB254V2AP) }, + { USB_VP(USB_VENDOR_HUAWEI3COM, USB_PRODUCT_HUAWEI3COM_WUB320G) }, + { USB_VP(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_G54HP) }, + { USB_VP(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_SG54HP) }, + { USB_VP(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_1) }, + { USB_VP(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_2) }, + { USB_VP(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_3) }, + { USB_VP(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_4) }, + { USB_VP(USB_VENDOR_NOVATECH, USB_PRODUCT_NOVATECH_RT2573) }, + { USB_VP(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54HP) }, + { USB_VP(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54MINI2) }, + { USB_VP(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSMM) }, + { USB_VP(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573) }, + { USB_VP(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573_2) }, + { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573) }, + { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573_2) }, + { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2671) }, + { USB_VP(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL113R2) }, + { USB_VP(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL172) }, + { USB_VP(USB_VENDOR_SPARKLAN, USB_PRODUCT_SPARKLAN_RT2573) }, + { USB_VP(USB_VENDOR_SURECOM, USB_PRODUCT_SURECOM_RT2573) }, +}; + +MODULE_DEPEND(rum, wlan, 1, 1, 1); +MODULE_DEPEND(rum, wlan_amrr, 1, 1, 1); +MODULE_DEPEND(rum, usb2_wlan, 1, 1, 1); +MODULE_DEPEND(rum, usb2_core, 1, 1, 1); -static device_probe_t rum_probe; +static device_probe_t rum_match; static device_attach_t rum_attach; static device_detach_t rum_detach; static usb2_callback_t rum_bulk_read_callback; -static usb2_callback_t rum_bulk_read_clear_stall_callback; static usb2_callback_t rum_bulk_write_callback; -static usb2_callback_t rum_bulk_write_clear_stall_callback; -static usb2_config_td_command_t rum_cfg_first_time_setup; -static usb2_config_td_command_t rum_config_copy; -static usb2_config_td_command_t rum_cfg_scan_start; -static usb2_config_td_command_t rum_cfg_scan_end; -static usb2_config_td_command_t rum_cfg_select_band; -static usb2_config_td_command_t rum_cfg_set_chan; -static usb2_config_td_command_t rum_cfg_enable_tsf_sync; -static usb2_config_td_command_t rum_cfg_enable_mrr; -static usb2_config_td_command_t rum_cfg_update_slot; -static usb2_config_td_command_t rum_cfg_select_antenna; -static usb2_config_td_command_t rum_cfg_set_txpreamble; -static usb2_config_td_command_t rum_cfg_update_promisc; -static usb2_config_td_command_t rum_cfg_pre_init; -static usb2_config_td_command_t rum_cfg_init; -static usb2_config_td_command_t rum_cfg_pre_stop; -static usb2_config_td_command_t rum_cfg_stop; -static usb2_config_td_command_t rum_cfg_amrr_timeout; -static usb2_config_td_command_t rum_cfg_prepare_beacon; -static usb2_config_td_command_t rum_cfg_newstate; +static usb2_proc_callback_t rum_task; +static usb2_proc_callback_t rum_scantask; +static usb2_proc_callback_t rum_promisctask; +static usb2_proc_callback_t rum_amrr_task; -static const char *rum_get_rf(uint32_t); -static int rum_ioctl_cb(struct ifnet *, u_long, caddr_t); -static void rum_std_command(struct ieee80211com *, usb2_config_td_command_t *); -static void rum_scan_start_cb(struct ieee80211com *); -static void rum_scan_end_cb(struct ieee80211com *); -static void rum_set_channel_cb(struct ieee80211com *); -static uint16_t rum_cfg_eeprom_read_2(struct rum_softc *, uint16_t); -static uint32_t rum_cfg_bbp_disbusy(struct rum_softc *); -static uint32_t rum_cfg_read(struct rum_softc *, uint16_t); -static uint8_t rum_cfg_bbp_init(struct rum_softc *); -static uint8_t rum_cfg_bbp_read(struct rum_softc *, uint8_t); -static void rum_cfg_amrr_start(struct rum_softc *); -static void rum_cfg_bbp_write(struct rum_softc *, uint8_t, uint8_t); -static void rum_cfg_do_request(struct rum_softc *, - struct usb2_device_request *, void *); -static void rum_cfg_eeprom_read(struct rum_softc *, uint16_t, void *, - uint16_t); -static void rum_cfg_load_microcode(struct rum_softc *, const uint8_t *, - uint16_t); -static void rum_cfg_read_eeprom(struct rum_softc *); -static void rum_cfg_read_multi(struct rum_softc *, uint16_t, void *, - uint16_t); -static void rum_cfg_rf_write(struct rum_softc *, uint8_t, uint32_t); -static void rum_cfg_set_bssid(struct rum_softc *, uint8_t *); -static void rum_cfg_set_macaddr(struct rum_softc *, uint8_t *); -static void rum_cfg_write(struct rum_softc *, uint16_t, uint32_t); -static void rum_cfg_write_multi(struct rum_softc *, uint16_t, void *, - uint16_t); -static void rum_end_of_commands(struct rum_softc *); -static void rum_init_cb(void *); -static void rum_start_cb(struct ifnet *); -static void rum_watchdog(void *); -static uint8_t rum_get_rssi(struct rum_softc *, uint8_t); static struct ieee80211vap *rum_vap_create(struct ieee80211com *, - const char[], int, int, int, const uint8_t[], - const uint8_t[]); -static void rum_vap_delete(struct ieee80211vap *); + const char name[IFNAMSIZ], int unit, int opmode, + int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], + const uint8_t mac[IEEE80211_ADDR_LEN]); +static void rum_vap_delete(struct ieee80211vap *); +static void rum_tx_free(struct rum_tx_data *, int); +static int rum_alloc_tx_list(struct rum_softc *); +static void rum_free_tx_list(struct rum_softc *); +static int rum_newstate(struct ieee80211vap *, + enum ieee80211_state, int); +static void rum_setup_tx_desc(struct rum_softc *, + struct rum_tx_desc *, uint32_t, uint16_t, int, + int); +static int rum_tx_mgt(struct rum_softc *, struct mbuf *, + struct ieee80211_node *); +static int rum_tx_raw(struct rum_softc *, struct mbuf *, + struct ieee80211_node *, + const struct ieee80211_bpf_params *); +static int rum_tx_data(struct rum_softc *, struct mbuf *, + struct ieee80211_node *); +static void rum_start(struct ifnet *); +static int rum_ioctl(struct ifnet *, u_long, caddr_t); +static void rum_eeprom_read(struct rum_softc *, uint16_t, void *, + int); +static uint32_t rum_read(struct rum_softc *, uint16_t); +static void rum_read_multi(struct rum_softc *, uint16_t, void *, + int); +static void rum_write(struct rum_softc *, uint16_t, uint32_t); +static void rum_write_multi(struct rum_softc *, uint16_t, void *, + size_t); +static void rum_bbp_write(struct rum_softc *, uint8_t, uint8_t); +static uint8_t rum_bbp_read(struct rum_softc *, uint8_t); +static void rum_rf_write(struct rum_softc *, uint8_t, uint32_t); +static void rum_select_antenna(struct rum_softc *); +static void rum_enable_mrr(struct rum_softc *); +static void rum_set_txpreamble(struct rum_softc *); +static void rum_set_basicrates(struct rum_softc *); +static void rum_select_band(struct rum_softc *, + struct ieee80211_channel *); +static void rum_set_chan(struct rum_softc *, + struct ieee80211_channel *); +static void rum_enable_tsf_sync(struct rum_softc *); +static void rum_update_slot(struct ifnet *); +static void rum_set_bssid(struct rum_softc *, const uint8_t *); +static void rum_set_macaddr(struct rum_softc *, const uint8_t *); +static const char *rum_get_rf(int); +static void rum_read_eeprom(struct rum_softc *); +static int rum_bbp_init(struct rum_softc *); +static void rum_init_locked(struct rum_softc *); +static void rum_init(void *); +static void rum_stop(void *); +static int rum_load_microcode(struct rum_softc *, const u_char *, + size_t); +static int rum_prepare_beacon(struct rum_softc *, + struct ieee80211vap *); +static int rum_raw_xmit(struct ieee80211_node *, struct mbuf *, + const struct ieee80211_bpf_params *); static struct ieee80211_node *rum_node_alloc(struct ieee80211vap *, - const uint8_t[]); -static void rum_newassoc(struct ieee80211_node *, int); -static void rum_cfg_disable_tsf_sync(struct rum_softc *); -static void rum_cfg_set_run(struct rum_softc *, struct rum_config_copy *); -static void rum_fill_write_queue(struct rum_softc *); -static void rum_tx_clean_queue(struct rum_softc *); -static void rum_tx_freem(struct mbuf *); -static void rum_tx_mgt(struct rum_softc *, struct mbuf *, - struct ieee80211_node *); -static struct ieee80211vap *rum_get_vap(struct rum_softc *); -static void rum_tx_data(struct rum_softc *, struct mbuf *, - struct ieee80211_node *); -static void rum_tx_prot(struct rum_softc *, const struct mbuf *, - struct ieee80211_node *, uint8_t, uint16_t); -static void rum_tx_raw(struct rum_softc *, struct mbuf *, - struct ieee80211_node *, - const struct ieee80211_bpf_params *); -static int rum_raw_xmit_cb(struct ieee80211_node *, struct mbuf *, - const struct ieee80211_bpf_params *); -static void rum_setup_desc_and_tx(struct rum_softc *, struct mbuf *, - uint32_t, uint16_t, uint16_t); -static int rum_newstate_cb(struct ieee80211vap *, - enum ieee80211_state nstate, int arg); -static void rum_update_mcast_cb(struct ifnet *); -static void rum_update_promisc_cb(struct ifnet *); + const uint8_t mac[IEEE80211_ADDR_LEN]); +static void rum_newassoc(struct ieee80211_node *, int); +static void rum_scan_start(struct ieee80211com *); +static void rum_scan_end(struct ieee80211com *); +static void rum_set_channel(struct ieee80211com *); +static int rum_get_rssi(struct rum_softc *, uint8_t); +static void rum_amrr_start(struct rum_softc *, + struct ieee80211_node *); +static void rum_amrr_timeout(void *); +static void rum_queue_command(struct rum_softc *, + usb2_proc_callback_t *, struct usb2_proc_msg *, + struct usb2_proc_msg *); -/* various supported device vendors/products */ -static const struct usb2_device_id rum_devs[] = { - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_HWU54DM, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_3, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_4, 0)}, - {USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_WUG2700, 0)}, - {USB_VPI(USB_VENDOR_AMIT, USB_PRODUCT_AMIT_CGWLUSB2GO, 0)}, - {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573_1, 0)}, - {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D7050A, 0)}, - {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D9050V3, 0)}, - {USB_VPI(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSB54GC, 0)}, - {USB_VPI(USB_VENDOR_CISCOLINKSYS, USB_PRODUCT_CISCOLINKSYS_WUSB54GR, 0)}, - {USB_VPI(USB_VENDOR_CONCEPTRONIC2, USB_PRODUCT_CONCEPTRONIC2_C54RU2, 0)}, - {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGWLUSB2GL, 0)}, - {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGWLUSB2GPX, 0)}, - {USB_VPI(USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_CWD854F, 0)}, - {USB_VPI(USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_RT2573, 0)}, - {USB_VPI(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWLG122C1, 0)}, - {USB_VPI(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_WUA1340, 0)}, - {USB_VPI(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA111, 0)}, - {USB_VPI(USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA110, 0)}, - {USB_VPI(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWB01GS, 0)}, - {USB_VPI(USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWI05GS, 0)}, - {USB_VPI(USB_VENDOR_GIGASET, USB_PRODUCT_GIGASET_RT2573, 0)}, - {USB_VPI(USB_VENDOR_GOODWAY, USB_PRODUCT_GOODWAY_RT2573, 0)}, - {USB_VPI(USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_HWGUSB254LB, 0)}, - {USB_VPI(USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_HWGUSB254V2AP, 0)}, - {USB_VPI(USB_VENDOR_HUAWEI3COM, USB_PRODUCT_HUAWEI3COM_WUB320G, 0)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_G54HP, 0)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_SG54HP, 0)}, - {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_SG54HG, 0)}, - {USB_VPI(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_1, 0)}, - {USB_VPI(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_3, 0)}, - {USB_VPI(USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_4, 0)}, - {USB_VPI(USB_VENDOR_NOVATECH, USB_PRODUCT_NOVATECH_RT2573, 0)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54HP, 0)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUS54MINI2, 0)}, - {USB_VPI(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSMM, 0)}, - {USB_VPI(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573, 0)}, - {USB_VPI(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573, 0)}, - {USB_VPI(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573_2, 0)}, - {USB_VPI(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2671, 0)}, - {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL113R2, 0)}, - {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL172, 0)}, - {USB_VPI(USB_VENDOR_SPARKLAN, USB_PRODUCT_SPARKLAN_RT2573, 0)}, - {USB_VPI(USB_VENDOR_SURECOM, USB_PRODUCT_SURECOM_RT2573, 0)}, +static const struct { + uint32_t reg; + uint32_t val; +} rum_def_mac[] = { + { RT2573_TXRX_CSR0, 0x025fb032 }, + { RT2573_TXRX_CSR1, 0x9eaa9eaf }, + { RT2573_TXRX_CSR2, 0x8a8b8c8d }, + { RT2573_TXRX_CSR3, 0x00858687 }, + { RT2573_TXRX_CSR7, 0x2e31353b }, + { RT2573_TXRX_CSR8, 0x2a2a2a2c }, + { RT2573_TXRX_CSR15, 0x0000000f }, + { RT2573_MAC_CSR6, 0x00000fff }, + { RT2573_MAC_CSR8, 0x016c030a }, + { RT2573_MAC_CSR10, 0x00000718 }, + { RT2573_MAC_CSR12, 0x00000004 }, + { RT2573_MAC_CSR13, 0x00007f00 }, + { RT2573_SEC_CSR0, 0x00000000 }, + { RT2573_SEC_CSR1, 0x00000000 }, + { RT2573_SEC_CSR5, 0x00000000 }, + { RT2573_PHY_CSR1, 0x000023b0 }, + { RT2573_PHY_CSR5, 0x00040a06 }, + { RT2573_PHY_CSR6, 0x00080606 }, + { RT2573_PHY_CSR7, 0x00000408 }, + { RT2573_AIFSN_CSR, 0x00002273 }, + { RT2573_CWMIN_CSR, 0x00002344 }, + { RT2573_CWMAX_CSR, 0x000034aa } }; -struct rum_def_mac { - uint32_t reg; - uint32_t val; -}; - -static const struct rum_def_mac rum_def_mac[] = { - {RT2573_TXRX_CSR0, 0x025fb032}, - {RT2573_TXRX_CSR1, 0x9eaa9eaf}, - {RT2573_TXRX_CSR2, 0x8a8b8c8d}, - {RT2573_TXRX_CSR3, 0x00858687}, - {RT2573_TXRX_CSR7, 0x2e31353b}, - {RT2573_TXRX_CSR8, 0x2a2a2a2c}, - {RT2573_TXRX_CSR15, 0x0000000f}, - {RT2573_MAC_CSR6, 0x00000fff}, - {RT2573_MAC_CSR8, 0x016c030a}, - {RT2573_MAC_CSR10, 0x00000718}, - {RT2573_MAC_CSR12, 0x00000004}, - {RT2573_MAC_CSR13, 0x00007f00}, - {RT2573_SEC_CSR0, 0x00000000}, - {RT2573_SEC_CSR1, 0x00000000}, - {RT2573_SEC_CSR5, 0x00000000}, - {RT2573_PHY_CSR1, 0x000023b0}, - {RT2573_PHY_CSR5, 0x00040a06}, - {RT2573_PHY_CSR6, 0x00080606}, - {RT2573_PHY_CSR7, 0x00000408}, - {RT2573_AIFSN_CSR, 0x00002273}, - {RT2573_CWMIN_CSR, 0x00002344}, - {RT2573_CWMAX_CSR, 0x000034aa} -}; - -struct rum_def_bbp { +static const struct { uint8_t reg; uint8_t val; +} rum_def_bbp[] = { + { 3, 0x80 }, + { 15, 0x30 }, + { 17, 0x20 }, + { 21, 0xc8 }, + { 22, 0x38 }, + { 23, 0x06 }, + { 24, 0xfe }, + { 25, 0x0a }, + { 26, 0x0d }, + { 32, 0x0b }, + { 34, 0x12 }, + { 37, 0x07 }, + { 39, 0xf8 }, + { 41, 0x60 }, + { 53, 0x10 }, + { 54, 0x18 }, + { 60, 0x10 }, + { 61, 0x04 }, + { 62, 0x04 }, + { 75, 0xfe }, + { 86, 0xfe }, + { 88, 0xfe }, + { 90, 0x0f }, + { 99, 0x00 }, + { 102, 0x16 }, + { 107, 0x04 } }; -static const struct rum_def_bbp rum_def_bbp[] = { - {3, 0x80}, - {15, 0x30}, - {17, 0x20}, - {21, 0xc8}, - {22, 0x38}, - {23, 0x06}, - {24, 0xfe}, - {25, 0x0a}, - {26, 0x0d}, - {32, 0x0b}, - {34, 0x12}, - {37, 0x07}, - {39, 0xf8}, - {41, 0x60}, - {53, 0x10}, - {54, 0x18}, - {60, 0x10}, - {61, 0x04}, - {62, 0x04}, - {75, 0xfe}, - {86, 0xfe}, - {88, 0xfe}, - {90, 0x0f}, - {99, 0x00}, - {102, 0x16}, - {107, 0x04} -}; +static const struct rfprog { + uint8_t chan; + uint32_t r1, r2, r3, r4; +} rum_rf5226[] = { + { 1, 0x00b03, 0x001e1, 0x1a014, 0x30282 }, + { 2, 0x00b03, 0x001e1, 0x1a014, 0x30287 }, + { 3, 0x00b03, 0x001e2, 0x1a014, 0x30282 }, + { 4, 0x00b03, 0x001e2, 0x1a014, 0x30287 }, + { 5, 0x00b03, 0x001e3, 0x1a014, 0x30282 }, + { 6, 0x00b03, 0x001e3, 0x1a014, 0x30287 }, + { 7, 0x00b03, 0x001e4, 0x1a014, 0x30282 }, + { 8, 0x00b03, 0x001e4, 0x1a014, 0x30287 }, + { 9, 0x00b03, 0x001e5, 0x1a014, 0x30282 }, + { 10, 0x00b03, 0x001e5, 0x1a014, 0x30287 }, + { 11, 0x00b03, 0x001e6, 0x1a014, 0x30282 }, + { 12, 0x00b03, 0x001e6, 0x1a014, 0x30287 }, + { 13, 0x00b03, 0x001e7, 0x1a014, 0x30282 }, + { 14, 0x00b03, 0x001e8, 0x1a014, 0x30284 }, -struct rfprog { - uint8_t chan; - uint32_t r1, r2, r3, r4; -}; + { 34, 0x00b03, 0x20266, 0x36014, 0x30282 }, + { 38, 0x00b03, 0x20267, 0x36014, 0x30284 }, + { 42, 0x00b03, 0x20268, 0x36014, 0x30286 }, + { 46, 0x00b03, 0x20269, 0x36014, 0x30288 }, -static const struct rfprog rum_rf5226[] = { - {1, 0x00b03, 0x001e1, 0x1a014, 0x30282}, - {2, 0x00b03, 0x001e1, 0x1a014, 0x30287}, - {3, 0x00b03, 0x001e2, 0x1a014, 0x30282}, - {4, 0x00b03, 0x001e2, 0x1a014, 0x30287}, - {5, 0x00b03, 0x001e3, 0x1a014, 0x30282}, - {6, 0x00b03, 0x001e3, 0x1a014, 0x30287}, - {7, 0x00b03, 0x001e4, 0x1a014, 0x30282}, - {8, 0x00b03, 0x001e4, 0x1a014, 0x30287}, - {9, 0x00b03, 0x001e5, 0x1a014, 0x30282}, - {10, 0x00b03, 0x001e5, 0x1a014, 0x30287}, - {11, 0x00b03, 0x001e6, 0x1a014, 0x30282}, - {12, 0x00b03, 0x001e6, 0x1a014, 0x30287}, - {13, 0x00b03, 0x001e7, 0x1a014, 0x30282}, - {14, 0x00b03, 0x001e8, 0x1a014, 0x30284}, + { 36, 0x00b03, 0x00266, 0x26014, 0x30288 }, + { 40, 0x00b03, 0x00268, 0x26014, 0x30280 }, + { 44, 0x00b03, 0x00269, 0x26014, 0x30282 }, + { 48, 0x00b03, 0x0026a, 0x26014, 0x30284 }, + { 52, 0x00b03, 0x0026b, 0x26014, 0x30286 }, + { 56, 0x00b03, 0x0026c, 0x26014, 0x30288 }, + { 60, 0x00b03, 0x0026e, 0x26014, 0x30280 }, + { 64, 0x00b03, 0x0026f, 0x26014, 0x30282 }, - {34, 0x00b03, 0x20266, 0x36014, 0x30282}, - {38, 0x00b03, 0x20267, 0x36014, 0x30284}, - {42, 0x00b03, 0x20268, 0x36014, 0x30286}, - {46, 0x00b03, 0x20269, 0x36014, 0x30288}, + { 100, 0x00b03, 0x0028a, 0x2e014, 0x30280 }, + { 104, 0x00b03, 0x0028b, 0x2e014, 0x30282 }, + { 108, 0x00b03, 0x0028c, 0x2e014, 0x30284 }, + { 112, 0x00b03, 0x0028d, 0x2e014, 0x30286 }, + { 116, 0x00b03, 0x0028e, 0x2e014, 0x30288 }, + { 120, 0x00b03, 0x002a0, 0x2e014, 0x30280 }, + { 124, 0x00b03, 0x002a1, 0x2e014, 0x30282 }, + { 128, 0x00b03, 0x002a2, 0x2e014, 0x30284 }, + { 132, 0x00b03, 0x002a3, 0x2e014, 0x30286 }, + { 136, 0x00b03, 0x002a4, 0x2e014, 0x30288 }, + { 140, 0x00b03, 0x002a6, 0x2e014, 0x30280 }, - {36, 0x00b03, 0x00266, 0x26014, 0x30288}, - {40, 0x00b03, 0x00268, 0x26014, 0x30280}, - {44, 0x00b03, 0x00269, 0x26014, 0x30282}, - {48, 0x00b03, 0x0026a, 0x26014, 0x30284}, - {52, 0x00b03, 0x0026b, 0x26014, 0x30286}, - {56, 0x00b03, 0x0026c, 0x26014, 0x30288}, - {60, 0x00b03, 0x0026e, 0x26014, 0x30280}, - {64, 0x00b03, 0x0026f, 0x26014, 0x30282}, + { 149, 0x00b03, 0x002a8, 0x2e014, 0x30287 }, + { 153, 0x00b03, 0x002a9, 0x2e014, 0x30289 }, + { 157, 0x00b03, 0x002ab, 0x2e014, 0x30281 }, + { 161, 0x00b03, 0x002ac, 0x2e014, 0x30283 }, + { 165, 0x00b03, 0x002ad, 0x2e014, 0x30285 } +}, rum_rf5225[] = { + { 1, 0x00b33, 0x011e1, 0x1a014, 0x30282 }, + { 2, 0x00b33, 0x011e1, 0x1a014, 0x30287 }, + { 3, 0x00b33, 0x011e2, 0x1a014, 0x30282 }, + { 4, 0x00b33, 0x011e2, 0x1a014, 0x30287 }, + { 5, 0x00b33, 0x011e3, 0x1a014, 0x30282 }, + { 6, 0x00b33, 0x011e3, 0x1a014, 0x30287 }, + { 7, 0x00b33, 0x011e4, 0x1a014, 0x30282 }, + { 8, 0x00b33, 0x011e4, 0x1a014, 0x30287 }, + { 9, 0x00b33, 0x011e5, 0x1a014, 0x30282 }, + { 10, 0x00b33, 0x011e5, 0x1a014, 0x30287 }, + { 11, 0x00b33, 0x011e6, 0x1a014, 0x30282 }, + { 12, 0x00b33, 0x011e6, 0x1a014, 0x30287 }, + { 13, 0x00b33, 0x011e7, 0x1a014, 0x30282 }, + { 14, 0x00b33, 0x011e8, 0x1a014, 0x30284 }, - {100, 0x00b03, 0x0028a, 0x2e014, 0x30280}, - {104, 0x00b03, 0x0028b, 0x2e014, 0x30282}, - {108, 0x00b03, 0x0028c, 0x2e014, 0x30284}, - {112, 0x00b03, 0x0028d, 0x2e014, 0x30286}, - {116, 0x00b03, 0x0028e, 0x2e014, 0x30288}, - {120, 0x00b03, 0x002a0, 0x2e014, 0x30280}, - {124, 0x00b03, 0x002a1, 0x2e014, 0x30282}, - {128, 0x00b03, 0x002a2, 0x2e014, 0x30284}, - {132, 0x00b03, 0x002a3, 0x2e014, 0x30286}, - {136, 0x00b03, 0x002a4, 0x2e014, 0x30288}, - {140, 0x00b03, 0x002a6, 0x2e014, 0x30280}, + { 34, 0x00b33, 0x01266, 0x26014, 0x30282 }, + { 38, 0x00b33, 0x01267, 0x26014, 0x30284 }, + { 42, 0x00b33, 0x01268, 0x26014, 0x30286 }, + { 46, 0x00b33, 0x01269, 0x26014, 0x30288 }, - {149, 0x00b03, 0x002a8, 0x2e014, 0x30287}, - {153, 0x00b03, 0x002a9, 0x2e014, 0x30289}, - {157, 0x00b03, 0x002ab, 0x2e014, 0x30281}, - {161, 0x00b03, 0x002ac, 0x2e014, 0x30283}, - {165, 0x00b03, 0x002ad, 0x2e014, 0x30285} -}; + { 36, 0x00b33, 0x01266, 0x26014, 0x30288 }, + { 40, 0x00b33, 0x01268, 0x26014, 0x30280 }, + { 44, 0x00b33, 0x01269, 0x26014, 0x30282 }, + { 48, 0x00b33, 0x0126a, 0x26014, 0x30284 }, + { 52, 0x00b33, 0x0126b, 0x26014, 0x30286 }, + { 56, 0x00b33, 0x0126c, 0x26014, 0x30288 }, + { 60, 0x00b33, 0x0126e, 0x26014, 0x30280 }, + { 64, 0x00b33, 0x0126f, 0x26014, 0x30282 }, -static const struct rfprog rum_rf5225[] = { - {1, 0x00b33, 0x011e1, 0x1a014, 0x30282}, - {2, 0x00b33, 0x011e1, 0x1a014, 0x30287}, - {3, 0x00b33, 0x011e2, 0x1a014, 0x30282}, - {4, 0x00b33, 0x011e2, 0x1a014, 0x30287}, - {5, 0x00b33, 0x011e3, 0x1a014, 0x30282}, - {6, 0x00b33, 0x011e3, 0x1a014, 0x30287}, - {7, 0x00b33, 0x011e4, 0x1a014, 0x30282}, - {8, 0x00b33, 0x011e4, 0x1a014, 0x30287}, - {9, 0x00b33, 0x011e5, 0x1a014, 0x30282}, - {10, 0x00b33, 0x011e5, 0x1a014, 0x30287}, - {11, 0x00b33, 0x011e6, 0x1a014, 0x30282}, - {12, 0x00b33, 0x011e6, 0x1a014, 0x30287}, - {13, 0x00b33, 0x011e7, 0x1a014, 0x30282}, - {14, 0x00b33, 0x011e8, 0x1a014, 0x30284}, + { 100, 0x00b33, 0x0128a, 0x2e014, 0x30280 }, + { 104, 0x00b33, 0x0128b, 0x2e014, 0x30282 }, + { 108, 0x00b33, 0x0128c, 0x2e014, 0x30284 }, + { 112, 0x00b33, 0x0128d, 0x2e014, 0x30286 }, + { 116, 0x00b33, 0x0128e, 0x2e014, 0x30288 }, + { 120, 0x00b33, 0x012a0, 0x2e014, 0x30280 }, + { 124, 0x00b33, 0x012a1, 0x2e014, 0x30282 }, + { 128, 0x00b33, 0x012a2, 0x2e014, 0x30284 }, + { 132, 0x00b33, 0x012a3, 0x2e014, 0x30286 }, + { 136, 0x00b33, 0x012a4, 0x2e014, 0x30288 }, + { 140, 0x00b33, 0x012a6, 0x2e014, 0x30280 }, - {34, 0x00b33, 0x01266, 0x26014, 0x30282}, - {38, 0x00b33, 0x01267, 0x26014, 0x30284}, - {42, 0x00b33, 0x01268, 0x26014, 0x30286}, - {46, 0x00b33, 0x01269, 0x26014, 0x30288}, - - {36, 0x00b33, 0x01266, 0x26014, 0x30288}, - {40, 0x00b33, 0x01268, 0x26014, 0x30280}, - {44, 0x00b33, 0x01269, 0x26014, 0x30282}, - {48, 0x00b33, 0x0126a, 0x26014, 0x30284}, - {52, 0x00b33, 0x0126b, 0x26014, 0x30286}, - {56, 0x00b33, 0x0126c, 0x26014, 0x30288}, - {60, 0x00b33, 0x0126e, 0x26014, 0x30280}, - {64, 0x00b33, 0x0126f, 0x26014, 0x30282}, - - {100, 0x00b33, 0x0128a, 0x2e014, 0x30280}, - {104, 0x00b33, 0x0128b, 0x2e014, 0x30282}, - {108, 0x00b33, 0x0128c, 0x2e014, 0x30284}, - {112, 0x00b33, 0x0128d, 0x2e014, 0x30286}, - {116, 0x00b33, 0x0128e, 0x2e014, 0x30288}, - {120, 0x00b33, 0x012a0, 0x2e014, 0x30280}, - {124, 0x00b33, 0x012a1, 0x2e014, 0x30282}, - {128, 0x00b33, 0x012a2, 0x2e014, 0x30284}, - {132, 0x00b33, 0x012a3, 0x2e014, 0x30286}, - {136, 0x00b33, 0x012a4, 0x2e014, 0x30288}, - {140, 0x00b33, 0x012a6, 0x2e014, 0x30280}, - - {149, 0x00b33, 0x012a8, 0x2e014, 0x30287}, - {153, 0x00b33, 0x012a9, 0x2e014, 0x30289}, - {157, 0x00b33, 0x012ab, 0x2e014, 0x30281}, - {161, 0x00b33, 0x012ac, 0x2e014, 0x30283}, - {165, 0x00b33, 0x012ad, 0x2e014, 0x30285} + { 149, 0x00b33, 0x012a8, 0x2e014, 0x30287 }, + { 153, 0x00b33, 0x012a9, 0x2e014, 0x30289 }, + { 157, 0x00b33, 0x012ab, 0x2e014, 0x30281 }, + { 161, 0x00b33, 0x012ac, 0x2e014, 0x30283 }, + { 165, 0x00b33, 0x012ad, 0x2e014, 0x30285 } }; static const struct usb2_config rum_config[RUM_N_TRANSFER] = { - [RUM_BULK_DT_WR] = { + [RUM_BULK_WR] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .mh.bufsize = (MCLBYTES + RT2573_TX_DESC_SIZE + 8), .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = &rum_bulk_write_callback, + .mh.callback = rum_bulk_write_callback, .mh.timeout = 5000, /* ms */ }, - - [RUM_BULK_DT_RD] = { + [RUM_BULK_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .mh.bufsize = (MCLBYTES + RT2573_RX_DESC_SIZE), .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &rum_bulk_read_callback, - }, - - [RUM_BULK_CS_WR] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &rum_bulk_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, - - [RUM_BULK_CS_RD] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &rum_bulk_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .mh.callback = rum_bulk_read_callback, }, }; -static devclass_t rum_devclass; - -static device_method_t rum_methods[] = { - DEVMETHOD(device_probe, rum_probe), - DEVMETHOD(device_attach, rum_attach), - DEVMETHOD(device_detach, rum_detach), - {0, 0} -}; - -static driver_t rum_driver = { - .name = "rum", - .methods = rum_methods, - .size = sizeof(struct rum_softc), -}; - -DRIVER_MODULE(rum, ushub, rum_driver, rum_devclass, NULL, 0); -MODULE_DEPEND(rum, usb2_wlan, 1, 1, 1); -MODULE_DEPEND(rum, usb2_core, 1, 1, 1); -MODULE_DEPEND(rum, wlan, 1, 1, 1); -MODULE_DEPEND(rum, wlan_amrr, 1, 1, 1); - static int -rum_probe(device_t dev) +rum_match(device_t self) { - struct usb2_attach_arg *uaa = device_get_ivars(dev); + struct usb2_attach_arg *uaa = device_get_ivars(self); - if (uaa->usb2_mode != USB_MODE_HOST) { + if (uaa->usb2_mode != USB_MODE_HOST) return (ENXIO); - } - if (uaa->info.bConfigIndex != 0) { + if (uaa->info.bConfigIndex != 0) return (ENXIO); - } - if (uaa->info.bIfaceIndex != RT2573_IFACE_INDEX) { + if (uaa->info.bIfaceIndex != RT2573_IFACE_INDEX) return (ENXIO); - } + return (usb2_lookup_id_by_uaa(rum_devs, sizeof(rum_devs), uaa)); } static int -rum_attach(device_t dev) +rum_attach(device_t self) { - struct usb2_attach_arg *uaa = device_get_ivars(dev); - struct rum_softc *sc = device_get_softc(dev); - int error; - uint8_t iface_index; + struct usb2_attach_arg *uaa = device_get_ivars(self); + struct rum_softc *sc = device_get_softc(self); + struct ieee80211com *ic; + struct ifnet *ifp; + const uint8_t *ucode = NULL; + uint8_t bands, iface_index; + uint32_t tmp; + int error, ntries, size; - device_set_usb2_desc(dev); - - mtx_init(&sc->sc_mtx, "rum lock", MTX_NETWORK_LOCK, - MTX_DEF | MTX_RECURSE); - - snprintf(sc->sc_name, sizeof(sc->sc_name), "%s", - device_get_nameunit(dev)); - + device_set_usb2_desc(self); sc->sc_udev = uaa->device; - sc->sc_unit = device_get_unit(dev); + sc->sc_dev = self; - usb2_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); + mtx_init(&sc->sc_mtx, device_get_nameunit(self), + MTX_NETWORK_LOCK, MTX_DEF); iface_index = RT2573_IFACE_INDEX; error = usb2_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, rum_config, RUM_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "could not allocate USB transfers, " + device_printf(self, "could not allocate USB transfers, " "err=%s\n", usb2_errstr(error)); goto detach; } - error = usb2_config_td_setup(&sc->sc_config_td, sc, &sc->sc_mtx, - &rum_end_of_commands, - sizeof(struct usb2_config_td_cc), 24); + error = usb2_proc_create(&sc->sc_tq, &sc->sc_mtx, + device_get_nameunit(self), USB_PRI_MED); if (error) { - device_printf(dev, "could not setup config " - "thread!\n"); + device_printf(self, "could not setup config thread!\n"); + goto detach; + } + + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + goto detach; + } + ic = ifp->if_l2com; + + RUM_LOCK(sc); + /* retrieve RT2573 rev. no */ + for (ntries = 0; ntries < 1000; ntries++) { + if ((tmp = rum_read(sc, RT2573_MAC_CSR0)) != 0) + break; + DELAY(1000); + } + if (ntries == 1000) { + device_printf(self, "timeout waiting for chip to settle\n"); + RUM_UNLOCK(sc); + goto detach; + } + + /* retrieve MAC address and various other things from EEPROM */ + rum_read_eeprom(sc); + + device_printf(self, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", + tmp, rum_get_rf(sc->rf_rev)); + + ucode = rt2573_ucode; + size = sizeof rt2573_ucode; + error = rum_load_microcode(sc, ucode, size); + if (error != 0) { + device_printf(self, "could not load 8051 microcode\n"); + RUM_UNLOCK(sc); goto detach; } - mtx_lock(&sc->sc_mtx); + RUM_UNLOCK(sc); + + ifp->if_softc = sc; + if_initname(ifp, "rum", device_get_unit(sc->sc_dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_init = rum_init; + ifp->if_ioctl = rum_ioctl; + ifp->if_start = rum_start; + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_READY(&ifp->if_snd); + + ic->ic_ifp = ifp; + ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ + + /* set device capabilities */ + ic->ic_caps = + IEEE80211_C_STA /* station mode supported */ + | IEEE80211_C_IBSS /* IBSS mode supported */ + | IEEE80211_C_MONITOR /* monitor mode supported */ + | IEEE80211_C_HOSTAP /* HostAp mode supported */ + | IEEE80211_C_TXPMGT /* tx power management */ + | IEEE80211_C_SHPREAMBLE /* short preamble supported */ + | IEEE80211_C_SHSLOT /* short slot time supported */ + | IEEE80211_C_BGSCAN /* bg scanning supported */ + | IEEE80211_C_WPA /* 802.11i */ + ; + + bands = 0; + setbit(&bands, IEEE80211_MODE_11B); + setbit(&bands, IEEE80211_MODE_11G); + if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) + setbit(&bands, IEEE80211_MODE_11A); + ieee80211_init_channels(ic, NULL, &bands); + + ieee80211_ifattach(ic); + ic->ic_newassoc = rum_newassoc; + ic->ic_raw_xmit = rum_raw_xmit; + ic->ic_node_alloc = rum_node_alloc; + ic->ic_scan_start = rum_scan_start; + ic->ic_scan_end = rum_scan_end; + ic->ic_set_channel = rum_set_channel; + + ic->ic_vap_create = rum_vap_create; + ic->ic_vap_delete = rum_vap_delete; + + sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); + + bpfattach(ifp, DLT_IEEE802_11_RADIO, + sizeof (struct ieee80211_frame) + sizeof(sc->sc_txtap)); - /* start setup */ + sc->sc_rxtap_len = sizeof sc->sc_rxtap; + sc->sc_rxtap.wr_ihdr.it_len = htole16(sc->sc_rxtap_len); + sc->sc_rxtap.wr_ihdr.it_present = htole32(RT2573_RX_RADIOTAP_PRESENT); - usb2_config_td_queue_command - (&sc->sc_config_td, NULL, &rum_cfg_first_time_setup, 0, 0); + sc->sc_txtap_len = sizeof sc->sc_txtap; + sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len); + sc->sc_txtap.wt_ihdr.it_present = htole32(RT2573_TX_RADIOTAP_PRESENT); - rum_watchdog(sc); - mtx_unlock(&sc->sc_mtx); - return (0); /* success */ + if (bootverbose) + ieee80211_announce(ic); + return 0; detach: - rum_detach(dev); + rum_detach(self); return (ENXIO); /* failure */ } static int -rum_detach(device_t dev) +rum_detach(device_t self) { - struct rum_softc *sc = device_get_softc(dev); - struct ieee80211com *ic; - struct ifnet *ifp; + struct rum_softc *sc = device_get_softc(self); + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; - usb2_config_td_drain(&sc->sc_config_td); - - mtx_lock(&sc->sc_mtx); - - usb2_callout_stop(&sc->sc_watchdog); - - rum_cfg_pre_stop(sc, NULL, 0); - - ifp = sc->sc_ifp; - ic = ifp->if_l2com; + RUM_LOCK(sc); + sc->sc_flags |= RUM_FLAG_DETACH; + rum_stop(sc); + RUM_UNLOCK(sc); - mtx_unlock(&sc->sc_mtx); - /* stop all USB transfers first */ usb2_transfer_unsetup(sc->sc_xfer, RUM_N_TRANSFER); + usb2_proc_free(&sc->sc_tq); - /* get rid of any late children */ - bus_generic_detach(dev); - if (ifp) { bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); } - usb2_config_td_unsetup(&sc->sc_config_td); - - usb2_callout_drain(&sc->sc_watchdog); - mtx_destroy(&sc->sc_mtx); return (0); } -static void -rum_cfg_do_request(struct rum_softc *sc, struct usb2_device_request *req, - void *data) +static struct ieee80211vap * +rum_vap_create(struct ieee80211com *ic, + const char name[IFNAMSIZ], int unit, int opmode, int flags, + const uint8_t bssid[IEEE80211_ADDR_LEN], + const uint8_t mac[IEEE80211_ADDR_LEN]) { - uint16_t length; - usb2_error_t err; + struct rum_softc *sc = ic->ic_ifp->if_softc; + struct rum_vap *rvp; + struct ieee80211vap *vap; -repeat: + if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */ + return NULL; + rvp = (struct rum_vap *) malloc(sizeof(struct rum_vap), + M_80211_VAP, M_NOWAIT | M_ZERO); + if (rvp == NULL) + return NULL; + vap = &rvp->vap; + /* enable s/w bmiss handling for sta mode */ + ieee80211_vap_setup(ic, vap, name, unit, opmode, + flags | IEEE80211_CLONE_NOBEACONS, bssid, mac); - if (usb2_config_td_is_gone(&sc->sc_config_td)) { - goto error; - } - err = usb2_do_request_flags - (sc->sc_udev, &sc->sc_mtx, req, data, 0, NULL, 1000); + /* override state transition machine */ + rvp->newstate = vap->iv_newstate; + vap->iv_newstate = rum_newstate; - if (err) { + rvp->sc = sc; + usb2_callout_init_mtx(&rvp->amrr_ch, &sc->sc_mtx, 0); + ieee80211_amrr_init(&rvp->amrr, vap, + IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD, + IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD, + 1000 /* 1 sec */); - DPRINTF("device request failed, err=%s " - "(ignored)\n", usb2_errstr(err)); - - /* wait a little before next try */ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon Feb 9 02:45:09 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 288CF1065672; Mon, 9 Feb 2009 02:45:09 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC8D4106566C for ; Mon, 9 Feb 2009 02:45:08 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CAE2F8FC16 for ; Mon, 9 Feb 2009 02:45:08 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n192j8LY079929 for ; Mon, 9 Feb 2009 02:45:08 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n192j8Qt079927 for perforce@freebsd.org; Mon, 9 Feb 2009 02:45:08 GMT (envelope-from thompsa@freebsd.org) Date: Mon, 9 Feb 2009 02:45:08 GMT Message-Id: <200902090245.n192j8Qt079927@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157413 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, 09 Feb 2009 02:45:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=157413 Change 157413 by thompsa@thompsa_burger on 2009/02/09 02:44:33 Remove usb2_config_td.[ch], they are no longer used. Affected files ... .. //depot/projects/usb/src/sys/conf/files#51 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_config_td.c#14 delete .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_config_td.h#9 delete .. //depot/projects/usb/src/sys/modules/usb2/core/Makefile#12 edit Differences ... ==== //depot/projects/usb/src/sys/conf/files#51 (text+ko) ==== @@ -1572,7 +1572,6 @@ # dev/usb2/core/usb2_busdma.c optional usb2_core dev/usb2/core/usb2_compat_linux.c optional usb2_core -dev/usb2/core/usb2_config_td.c optional usb2_core dev/usb2/core/usb2_core.c optional usb2_core dev/usb2/core/usb2_debug.c optional usb2_core dev/usb2/core/usb2_dev.c optional usb2_core ==== //depot/projects/usb/src/sys/modules/usb2/core/Makefile#12 (text+ko) ==== @@ -35,7 +35,6 @@ SRCS+= usb2_if.c SRCS+= usb2_busdma.c SRCS+= usb2_compat_linux.c -SRCS+= usb2_config_td.c SRCS+= usb2_core.c SRCS+= usb2_debug.c SRCS+= usb2_dev.c From owner-p4-projects@FreeBSD.ORG Mon Feb 9 08:18:42 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3BABC1065674; Mon, 9 Feb 2009 08:18:41 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDC87106566C; Mon, 9 Feb 2009 08:18:40 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id 5837F8FC1A; Mon, 9 Feb 2009 08:18:39 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=wDR0YtXPHs8A:10 a=6I5d2MoRAAAA:8 a=VLS5W9eHEuNggJaaiJAA:9 a=WPx21EvRHJ4ntiBpLigA:7 a=TMy6g1vJXm6UitatwT0lZnW9juMA:4 a=LY0hPdMaydYA:10 Received: from [193.217.167.198] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1197392953; Mon, 09 Feb 2009 09:18:38 +0100 From: Hans Petter Selasky To: Andrew Thompson Date: Mon, 9 Feb 2009 09:21:05 +0100 User-Agent: KMail/1.9.7 References: <200902090242.n192g4vr079701@repoman.freebsd.org> In-Reply-To: <200902090242.n192g4vr079701@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902090921.06610.hselasky@c2i.net> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 157412 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, 09 Feb 2009 08:18:42 -0000 On Monday 09 February 2009, Andrew Thompson wrote: > http://perforce.freebsd.org/chv.cgi?CH=157412 > > Change 157412 by thompsa@thompsa_burger on 2009/02/09 02:41:33 > > Sync from svn.freebsd.org/base/user/thompsa/usb which is a minimal > changeset from oldUSB (no config_td). > > This excludes the taskqueue changes (for the moment) as requested. > > Affected files ... > > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#26 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumfw.h#2 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumreg.h#2 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#3 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#26 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralreg.h#2 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#3 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#29 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydfw.h#2 edit > .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#3 edit > Are you planning to port in the "if_upgt" and "if_urtw" aswell? --HPS From owner-p4-projects@FreeBSD.ORG Mon Feb 9 13:43:18 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 031471065672; Mon, 9 Feb 2009 13:43:18 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6A06106566C for ; Mon, 9 Feb 2009 13:43:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A2AF08FC1A for ; Mon, 9 Feb 2009 13:43:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n19DhHjt089935 for ; Mon, 9 Feb 2009 13:43:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n19DhHQF089933 for perforce@freebsd.org; Mon, 9 Feb 2009 13:43:17 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 9 Feb 2009 13:43:17 GMT Message-Id: <200902091343.n19DhHQF089933@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157429 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, 09 Feb 2009 13:43:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=157429 Change 157429 by hselasky@hselasky_laptop001 on 2009/02/09 13:43:03 Factor out USB ethernet and USB serial driver specific control request. Fix some minor issues in USB WLAN drivers, like ensuring that xxx_tx_free() is called in all USB callback error cases. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.c#32 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.h#10 edit .. //depot/projects/usb/src/sys/dev/usb2/ethernet/usb2_ethernet.c#11 edit .. //depot/projects/usb/src/sys/dev/usb2/ethernet/usb2_ethernet.h#9 edit .. //depot/projects/usb/src/sys/dev/usb2/serial/usb2_serial.c#27 edit .. //depot/projects/usb/src/sys/dev/usb2/serial/usb2_serial.h#15 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#27 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#4 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#27 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#4 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#30 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#4 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/usb2_wlan.c#6 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/usb2_wlan.h#8 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.c#32 (text+ko) ==== @@ -477,6 +477,49 @@ } /*------------------------------------------------------------------------* + * usb2_do_request_proc - factored out code + * + * This function is factored out code. It does basically the same like + * usb2_do_request_flags, except it will check the status of the + * passed process argument before doing the USB request. If the + * process is draining the USB_ERR_IOERROR code will be returned. It + * is assumed that the mutex associated with the process is locked + * when calling this function. + *------------------------------------------------------------------------*/ +usb2_error_t +usb2_do_request_proc(struct usb2_device *udev, struct usb2_process *pproc, + struct usb2_device_request *req, void *data, uint32_t flags, + uint16_t *actlen, uint32_t timeout) +{ + usb2_error_t err; + uint16_t len; + + /* get request data length */ + len = UGETW(req->wLength); + + /* check if the device is being detached */ + if (usb2_proc_is_gone(pproc)) { + err = USB_ERR_IOERROR; + goto done; + } + + /* forward the USB request */ + err = usb2_do_request_flags(udev, pproc->up_mtx, + req, data, flags, actlen, timeout); + +done: + /* on failure we zero the data */ + /* on short packet we zero the unused data */ + if ((len != 0) && (req->bmRequestType & UE_DIR_IN)) { + if (err) + memset(data, 0, len); + else if (actlen && *actlen != len) + memset(((uint8_t *)data) + *actlen, 0, len - *actlen); + } + return (err); +} + +/*------------------------------------------------------------------------* * usb2_req_reset_port * * This function will instruct an USB HUB to perform a reset sequence ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.h#10 (text+ko) ==== @@ -27,9 +27,14 @@ #ifndef _USB2_REQUEST_H_ #define _USB2_REQUEST_H_ +struct usb2_process; + usb2_error_t usb2_do_request_flags(struct usb2_device *udev, struct mtx *mtx, struct usb2_device_request *req, void *data, uint32_t flags, uint16_t *actlen, uint32_t timeout); +usb2_error_t usb2_do_request_proc(struct usb2_device *udev, struct usb2_process *pproc, + struct usb2_device_request *req, void *data, uint32_t flags, + uint16_t *actlen, uint32_t timeout); usb2_error_t usb2_req_clear_hub_feature(struct usb2_device *udev, struct mtx *mtx, uint16_t sel); usb2_error_t usb2_req_clear_port_feature(struct usb2_device *udev, ==== //depot/projects/usb/src/sys/dev/usb2/ethernet/usb2_ethernet.c#11 (text+ko) ==== @@ -155,8 +155,8 @@ /* fork rest of the attach code */ UE_LOCK(ue); ue_queue_command(ue, ue_attach_post_task, - &ue->ue_attach_task[0].hdr, - &ue->ue_attach_task[1].hdr); + &ue->ue_sync_task[0].hdr, + &ue->ue_sync_task[1].hdr); UE_UNLOCK(ue); error: @@ -293,8 +293,8 @@ UE_LOCK(ue); if (ifp->if_drv_flags & IFF_DRV_RUNNING) ue_queue_command(ue, ue_stop_task, - &ue->ue_start_stop_task[0].hdr, - &ue->ue_start_stop_task[1].hdr); + &ue->ue_sync_task[0].hdr, + &ue->ue_sync_task[1].hdr); UE_UNLOCK(ue); } @@ -304,36 +304,6 @@ return (usb2_proc_is_gone(&ue->ue_tq)); } -/* factored out code */ -usb2_error_t -usb2_ether_do_request(struct usb2_ether *ue, - struct usb2_device_request *req, void *data, - unsigned int timeout) -{ - uint16_t len; - usb2_error_t err; - - /* get request data length */ - len = UGETW(req->wLength); - - /* check if the device is being detached */ - if (usb2_proc_is_gone(&ue->ue_tq)) { - err = USB_ERR_IOERROR; - goto done; - } - - /* do the USB request */ - err = usb2_do_request_flags(ue->ue_udev, ue->ue_mtx, - req, data, 0, NULL, timeout); - -done: - /* on failure we zero the data */ - if (err && len && (req->bmRequestType & UE_DIR_IN)) - memset(data, 0, len); - - return (err); -} - static void ue_init(void *arg) { @@ -341,8 +311,8 @@ UE_LOCK(ue); ue_queue_command(ue, ue_start_task, - &ue->ue_start_stop_task[0].hdr, - &ue->ue_start_stop_task[1].hdr); + &ue->ue_sync_task[0].hdr, + &ue->ue_sync_task[1].hdr); UE_UNLOCK(ue); } @@ -486,12 +456,12 @@ &ue->ue_promisc_task[1].hdr); else ue_queue_command(ue, ue_start_task, - &ue->ue_start_stop_task[0].hdr, - &ue->ue_start_stop_task[1].hdr); + &ue->ue_sync_task[0].hdr, + &ue->ue_sync_task[1].hdr); } else { ue_queue_command(ue, ue_stop_task, - &ue->ue_start_stop_task[0].hdr, - &ue->ue_start_stop_task[1].hdr); + &ue->ue_sync_task[0].hdr, + &ue->ue_sync_task[1].hdr); } UE_UNLOCK(ue); break; ==== //depot/projects/usb/src/sys/dev/usb2/ethernet/usb2_ethernet.h#9 (text+ko) ==== @@ -89,12 +89,11 @@ struct sysctl_ctx_list ue_sysctl_ctx; struct ifqueue ue_rxq; struct usb2_callout ue_watchdog; - struct usb2_ether_cfg_task ue_attach_task[2]; + struct usb2_ether_cfg_task ue_sync_task[2]; struct usb2_ether_cfg_task ue_media_task[2]; struct usb2_ether_cfg_task ue_multi_task[2]; struct usb2_ether_cfg_task ue_promisc_task[2]; struct usb2_ether_cfg_task ue_tick_task[2]; - struct usb2_ether_cfg_task ue_start_stop_task[2]; int ue_unit; @@ -102,10 +101,10 @@ uint8_t ue_eaddr[ETHER_ADDR_LEN]; }; +#define usb2_ether_do_request(ue,req,data,timo) \ + usb2_do_request_proc((ue)->ue_udev,&(ue)->ue_tq,req,data,0,NULL,timo) + uint8_t usb2_ether_pause(struct usb2_ether *, unsigned int); -usb2_error_t usb2_ether_do_request(struct usb2_ether *, - struct usb2_device_request *, void *, - unsigned int timeout); struct ifnet *usb2_ether_getifp(struct usb2_ether *); struct mii_data *usb2_ether_getmii(struct usb2_ether *); void *usb2_ether_getsc(struct usb2_ether *); ==== //depot/projects/usb/src/sys/dev/usb2/serial/usb2_serial.c#27 (text+ko) ==== @@ -1125,39 +1125,3 @@ usb2_cv_signal(&sc->sc_cv); mtx_unlock(sc->sc_mtx); } - -/* factored out code */ -usb2_error_t -usb2_com_cfg_do_request(struct usb2_device *udev, - struct usb2_com_softc *sc, struct usb2_device_request *req, - void *data, unsigned int flags, unsigned int timeout) -{ - struct usb2_com_super_softc *ssc = sc->sc_super; - uint16_t len; - uint16_t actlen; - usb2_error_t err; - - /* get request data length */ - len = UGETW(req->wLength); - - /* check if the device is being detached */ - if (usb2_proc_is_gone(&ssc->sc_tq)) { - err = USB_ERR_IOERROR; - goto done; - } - - /* do the USB request */ - err = usb2_do_request_flags(udev, sc->sc_mtx, - req, data, flags, &actlen, timeout); - -done: - if ((req->bmRequestType & UE_DIR_IN) && (len != 0)) { - /* on failure we zero the data */ - /* on short packet we zero the rest of the buffer */ - if (err) - memset(data, 0, len); - else if (len != actlen) - memset(((uint8_t *)data) + actlen, 0, len - actlen); - } - return (err); -} ==== //depot/projects/usb/src/sys/dev/usb2/serial/usb2_serial.h#15 (text+ko) ==== @@ -181,6 +181,9 @@ #define UCOM_LS_BREAK 0x04 }; +#define usb2_com_cfg_do_request(udev,com,req,ptr,flags,timo) \ + usb2_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo) + int usb2_com_attach(struct usb2_com_super_softc *, struct usb2_com_softc *, uint32_t, void *, const struct usb2_com_callback *callback, struct mtx *); @@ -192,7 +195,4 @@ void usb2_com_put_data(struct usb2_com_softc *, struct usb2_page_cache *, uint32_t, uint32_t); uint8_t usb2_com_cfg_is_gone(struct usb2_com_softc *); -usb2_error_t usb2_com_cfg_do_request(struct usb2_device *, - struct usb2_com_softc *, struct usb2_device_request *, void *, - unsigned int, unsigned int); #endif /* _USB2_SERIAL_H_ */ ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#27 (text+ko) ==== @@ -54,6 +54,9 @@ "Debug level"); #endif +#define rum_do_request(sc,req,data) \ + usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) + static const struct usb2_device_id rum_devs[] = { { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_HWU54DM) }, { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_2) }, @@ -116,10 +119,13 @@ static usb2_callback_t rum_bulk_read_callback; static usb2_callback_t rum_bulk_write_callback; +static usb2_proc_callback_t rum_attach_post; static usb2_proc_callback_t rum_task; static usb2_proc_callback_t rum_scantask; static usb2_proc_callback_t rum_promisctask; static usb2_proc_callback_t rum_amrr_task; +static usb2_proc_callback_t rum_init_task; +static usb2_proc_callback_t rum_stop_task; static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -169,9 +175,7 @@ static const char *rum_get_rf(int); static void rum_read_eeprom(struct rum_softc *); static int rum_bbp_init(struct rum_softc *); -static void rum_init_locked(struct rum_softc *); static void rum_init(void *); -static void rum_stop(void *); static int rum_load_microcode(struct rum_softc *, const u_char *, size_t); static int rum_prepare_beacon(struct rum_softc *, @@ -391,12 +395,8 @@ { struct usb2_attach_arg *uaa = device_get_ivars(self); struct rum_softc *sc = device_get_softc(self); - struct ieee80211com *ic; - struct ifnet *ifp; - const uint8_t *ucode = NULL; - uint8_t bands, iface_index; - uint32_t tmp; - int error, ntries, size; + uint8_t iface_index; + int error; device_set_usb2_desc(self); sc->sc_udev = uaa->device; @@ -420,42 +420,64 @@ goto detach; } - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); - if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); - goto detach; - } - ic = ifp->if_l2com; + /* fork rest of the attach code */ + RUM_LOCK(sc); + rum_queue_command(sc, rum_attach_post, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + RUM_UNLOCK(sc); + return (0); + +detach: + rum_detach(self); + return (ENXIO); /* failure */ +} + +static void +rum_attach_post(struct usb2_proc_msg *pm) +{ + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; + struct ifnet *ifp; + struct ieee80211com *ic; + unsigned int ntries; + int error; + uint32_t tmp; + uint8_t bands; - RUM_LOCK(sc); /* retrieve RT2573 rev. no */ - for (ntries = 0; ntries < 1000; ntries++) { + for (ntries = 0; ntries != 1000; ntries++) { if ((tmp = rum_read(sc, RT2573_MAC_CSR0)) != 0) break; - DELAY(1000); + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 1000) { - device_printf(self, "timeout waiting for chip to settle\n"); - RUM_UNLOCK(sc); - goto detach; + device_printf(sc->sc_dev, "timeout waiting for chip to settle\n"); + return; } /* retrieve MAC address and various other things from EEPROM */ rum_read_eeprom(sc); - device_printf(self, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", + device_printf(sc->sc_dev, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", tmp, rum_get_rf(sc->rf_rev)); - ucode = rt2573_ucode; - size = sizeof rt2573_ucode; - error = rum_load_microcode(sc, ucode, size); + error = rum_load_microcode(sc, rt2573_ucode, sizeof(rt2573_ucode)); if (error != 0) { - device_printf(self, "could not load 8051 microcode\n"); RUM_UNLOCK(sc); - goto detach; + device_printf(sc->sc_dev, "could not load 8051 microcode\n"); + return; } RUM_UNLOCK(sc); + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + RUM_LOCK(sc); + return; + } + ic = ifp->if_l2com; + ifp->if_softc = sc; if_initname(ifp, "rum", device_get_unit(sc->sc_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -516,10 +538,7 @@ if (bootverbose) ieee80211_announce(ic); - return 0; -detach: - rum_detach(self); - return (ENXIO); /* failure */ + RUM_LOCK(sc); } static int @@ -529,10 +548,8 @@ struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - RUM_LOCK(sc); - sc->sc_flags |= RUM_FLAG_DETACH; - rum_stop(sc); - RUM_UNLOCK(sc); + /* wait for any post attach or other command to complete */ + usb2_proc_drain(&sc->sc_tq); /* stop all USB transfers first */ usb2_transfer_unsetup(sc->sc_xfer, RUM_N_TRANSFER); @@ -543,6 +560,10 @@ ieee80211_ifdetach(ic); if_free(ifp); } + + /* free TX list, if any */ + rum_free_tx_list(sc); + mtx_destroy(&sc->sc_mtx); return (0); @@ -683,9 +704,6 @@ struct ieee80211_node *ni; uint32_t tmp; - if (sc->sc_flags & RUM_FLAG_DETACH) - return; - ostate = vap->iv_state; switch (sc->sc_state) { @@ -773,7 +791,7 @@ struct ieee80211_channel *c = ic->ic_curchan; struct rum_tx_data *data; struct mbuf *m; - int len; + unsigned int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -790,15 +808,6 @@ /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: -#if 0 - if (sc->sc_flags & RUM_FLAG_WAIT_COMMAND) { - /* - * don't send anything while a command is pending ! - */ - break; - } -#endif - data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -845,6 +854,13 @@ DPRINTFN(11, "transfer error, %s\n", usb2_errstr(xfer->error)); + ifp->if_oerrors++; + data = xfer->priv_fifo; + if (data != NULL) { + rum_tx_free(data, xfer->error); + xfer->priv_fifo = NULL; + } + if (xfer->error == USB_ERR_STALLED) { /* try to clear stall first */ xfer->flags.stall_pipe = 1; @@ -852,13 +868,6 @@ } if (xfer->error == USB_ERR_TIMEOUT) device_printf(sc->sc_dev, "device timeout\n"); - - ifp->if_oerrors++; - data = xfer->priv_fifo; - if (data != NULL) { - rum_tx_free(data, xfer->error); - xfer->priv_fifo = NULL; - } break; } } @@ -873,7 +882,7 @@ struct mbuf *m = NULL; uint32_t flags; uint8_t rssi = 0; - int len; + unsigned int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -965,7 +974,6 @@ goto tr_setup; } return; - } } @@ -1333,15 +1341,20 @@ RUM_LOCK(sc); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - rum_init_locked(sc); + rum_queue_command(sc, rum_init_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); startall = 1; } else rum_queue_command(sc, rum_promisctask, &sc->sc_promisctask[0].hdr, &sc->sc_promisctask[1].hdr); } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rum_stop(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + rum_queue_command(sc, rum_stop_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + } } RUM_UNLOCK(sc); if (startall) @@ -1372,7 +1385,7 @@ USETW(req.wIndex, addr); USETW(req.wLength, len); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); + error = rum_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not read EEPROM: %s\n", usb2_errstr(error)); @@ -1401,7 +1414,7 @@ USETW(req.wIndex, reg); USETW(req.wLength, len); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); + error = rum_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not multi read MAC register: %s\n", @@ -1429,7 +1442,7 @@ USETW(req.wIndex, reg); USETW(req.wLength, len); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); + error = rum_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not multi write MAC register: %s\n", @@ -1787,9 +1800,6 @@ struct ifnet *ifp = sc->sc_ifp; uint32_t tmp; - if (sc->sc_flags & RUM_FLAG_DETACH) - return; - tmp = rum_read(sc, RT2573_TXRX_CSR0); tmp &= ~RT2573_DROP_NOT_TO_ME; @@ -1933,9 +1943,11 @@ } static void -rum_init_locked(struct rum_softc *sc) +rum_init_task(struct usb2_proc_msg *pm) { #define N(a) (sizeof (a) / sizeof ((a)[0])) + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; uint32_t tmp; @@ -1944,11 +1956,8 @@ RUM_LOCK_ASSERT(sc, MA_OWNED); - if (sc->sc_flags & RUM_FLAG_DETACH) - return; + rum_stop_task(pm); - rum_stop(sc); - /* initialize MAC registers to default values */ for (i = 0; i < N(rum_def_mac); i++) rum_write(sc, rum_def_mac[i].reg, rum_def_mac[i].val); @@ -2015,7 +2024,7 @@ usb2_transfer_start(sc->sc_xfer[RUM_BULK_RD]); return; -fail: rum_stop(sc); +fail: rum_stop_task(pm); #undef N } @@ -2027,7 +2036,9 @@ struct ieee80211com *ic = ifp->if_l2com; RUM_LOCK(sc); - rum_init_locked(sc); + rum_queue_command(sc, rum_init_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); RUM_UNLOCK(sc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -2035,9 +2046,10 @@ } static void -rum_stop(void *priv) +rum_stop_task(struct usb2_proc_msg *pm) { - struct rum_softc *sc = priv; + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; uint32_t tmp; @@ -2053,10 +2065,6 @@ rum_free_tx_list(sc); - /* Stop now if the device has vanished */ - if (sc->sc_flags & RUM_FLAG_DETACH) - return; - /* disable Rx */ tmp = rum_read(sc, RT2573_TXRX_CSR0); rum_write(sc, RT2573_TXRX_CSR0, tmp | RT2573_DISABLE_RX); @@ -2083,7 +2091,7 @@ USETW(req.wIndex, 0); USETW(req.wLength, 0); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL); + error = rum_do_request(sc, &req, NULL); if (error != 0) { device_printf(sc->sc_dev, "could not run firmware: %s\n", usb2_errstr(error)); @@ -2296,9 +2304,6 @@ RUM_LOCK_ASSERT(sc, MA_OWNED); - if (sc->sc_flags & RUM_FLAG_DETACH) - return; - switch (sc->sc_scan_action) { case RUM_SCAN_START: /* abort TSF synchronization */ @@ -2395,6 +2400,11 @@ task->hdr.pm_callback = fn; task->sc = sc; + /* + * Init and stop must be synchronous! + */ + if ((fn == rum_init_task) || (fn == rum_stop_task)) + usb2_proc_mwait(&sc->sc_tq, t0, t1); } static device_method_t rum_methods[] = { ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#4 (text+ko) ==== @@ -100,14 +100,14 @@ struct usb2_process sc_tq; const struct ieee80211_rate_table *sc_rates; + struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; uint8_t rf_rev; uint8_t rffreq; - struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; - enum ieee80211_state sc_state; int sc_arg; + struct rum_task sc_synctask[2]; struct rum_task sc_task[2]; struct rum_task sc_promisctask[2]; struct rum_task sc_scantask[2]; @@ -124,9 +124,6 @@ struct mtx sc_mtx; - int sc_flags; -#define RUM_FLAG_DETACH 0x0001 - uint32_t sta[6]; uint32_t rf_regs[4]; uint8_t txpow[44]; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#27 (text+ko) ==== @@ -55,6 +55,9 @@ "Debug level"); #endif +#define ural_do_request(sc,req,data) \ + usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) + #define URAL_RSSI(rssi) \ ((rssi) > (RAL_NOISE_FLOOR + RAL_RSSI_CORR) ? \ ((rssi) - (RAL_NOISE_FLOOR + RAL_RSSI_CORR)) : 0) @@ -95,10 +98,13 @@ static usb2_callback_t ural_bulk_read_callback; static usb2_callback_t ural_bulk_write_callback; +static usb2_proc_callback_t ural_attach_post; static usb2_proc_callback_t ural_task; static usb2_proc_callback_t ural_scantask; static usb2_proc_callback_t ural_promisctask; static usb2_proc_callback_t ural_amrr_task; +static usb2_proc_callback_t ural_init_task; +static usb2_proc_callback_t ural_stop_task; static struct ieee80211vap *ural_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -153,9 +159,7 @@ static int ural_bbp_init(struct ural_softc *); static void ural_set_txantenna(struct ural_softc *, int); static void ural_set_rxantenna(struct ural_softc *, int); -static void ural_init_locked(struct ural_softc *); static void ural_init(void *); -static void ural_stop(void *); static int ural_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static void ural_amrr_start(struct ural_softc *, @@ -394,10 +398,8 @@ { struct usb2_attach_arg *uaa = device_get_ivars(self); struct ural_softc *sc = device_get_softc(self); - struct ifnet *ifp; - struct ieee80211com *ic; int error; - uint8_t bands, iface_index; + uint8_t iface_index; device_set_usb2_desc(self); sc->sc_udev = uaa->device; @@ -422,14 +424,28 @@ goto detach; } - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); - if (ifp == NULL) { - device_printf(sc->sc_dev, "can not if_alloc()\n"); - goto detach; - } - ic = ifp->if_l2com; + /* fork rest of the attach code */ + RAL_LOCK(sc); + ural_queue_command(sc, ural_attach_post, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + RAL_UNLOCK(sc); + return (0); + +detach: + ural_detach(self); + return (ENXIO); /* failure */ +} + +static void +ural_attach_post(struct usb2_proc_msg *pm) +{ + struct ural_task *task = (struct ural_task *)pm; + struct ural_softc *sc = task->sc; + struct ifnet *ifp; + struct ieee80211com *ic; + uint8_t bands; - RAL_LOCK(sc); /* retrieve RT2570 rev. no */ sc->asic_rev = ural_read(sc, RAL_MAC_CSR0); @@ -440,6 +456,14 @@ device_printf(sc->sc_dev, "MAC/BBP RT2570 (rev 0x%02x), RF %s\n", sc->asic_rev, ural_get_rf(sc->rf_rev)); + ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + device_printf(sc->sc_dev, "can not if_alloc()\n"); + RAL_LOCK(sc); + return; + } + ic = ifp->if_l2com; + ifp->if_softc = sc; if_initname(ifp, "ural", device_get_unit(sc->sc_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -500,11 +524,7 @@ if (bootverbose) ieee80211_announce(ic); - return (0); /* success */ - -detach: - ural_detach(self); - return (ENXIO); /* failure */ + RAL_LOCK(sc); } static int @@ -514,10 +534,8 @@ struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - RAL_LOCK(sc); - sc->sc_flags |= URAL_FLAG_DETACH; - ural_stop(sc); - RAL_UNLOCK(sc); + /* wait for any post attach or other command to complete */ + usb2_proc_drain(&sc->sc_tq); /* stop all USB transfers first */ usb2_transfer_unsetup(sc->sc_xfer, URAL_N_TRANSFER); @@ -528,6 +546,10 @@ ieee80211_ifdetach(ic); if_free(ifp); } + + /* free TX list, if any */ + ural_free_tx_list(sc); + mtx_destroy(&sc->sc_mtx); return (0); @@ -668,9 +690,6 @@ struct ieee80211_node *ni; struct mbuf *m; - if (sc->sc_flags & URAL_FLAG_DETACH) - return; - ostate = vap->iv_state; switch (sc->sc_state) { @@ -747,9 +766,6 @@ RAL_LOCK_ASSERT(sc, MA_OWNED); - if (sc->sc_flags & URAL_FLAG_DETACH) - return; - if (sc->sc_scan_action == URAL_SCAN_START) { /* abort TSF synchronization */ DPRINTF("starting scan\n"); @@ -806,7 +822,7 @@ struct ieee80211_channel *c = ic->ic_curchan; struct ural_tx_data *data; struct mbuf *m; - int len; + unsigned int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -823,15 +839,6 @@ /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: -#if 0 - if (sc->sc_flags & URAL_FLAG_WAIT_COMMAND) { - /* - * don't send anything while a command is pending ! - */ - break; - } -#endif - data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -878,6 +885,13 @@ DPRINTFN(11, "transfer error, %s\n", usb2_errstr(xfer->error)); + ifp->if_oerrors++; + data = xfer->priv_fifo; + if (data != NULL) { + ural_tx_free(data, xfer->error); + xfer->priv_fifo = NULL; + } + if (xfer->error == USB_ERR_STALLED) { /* try to clear stall first */ xfer->flags.stall_pipe = 1; @@ -885,13 +899,6 @@ } if (xfer->error == USB_ERR_TIMEOUT) device_printf(sc->sc_dev, "device timeout\n"); - - ifp->if_oerrors++; - data = xfer->priv_fifo; - if (data != NULL) { - ural_tx_free(data, xfer->error); - xfer->priv_fifo = NULL; - } break; } } @@ -906,7 +913,7 @@ struct mbuf *m = NULL; uint32_t flags; uint8_t rssi = 0; - int len; + unsigned int len; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -1001,7 +1008,6 @@ goto tr_setup; } return; - } } @@ -1406,15 +1412,20 @@ RAL_LOCK(sc); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - ural_init_locked(sc); + ural_queue_command(sc, ural_init_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); startall = 1; } else ural_queue_command(sc, ural_promisctask, &sc->sc_promisctask[0].hdr, &sc->sc_promisctask[1].hdr); } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - ural_stop(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ural_queue_command(sc, ural_stop_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + } } RAL_UNLOCK(sc); if (startall) @@ -1443,7 +1454,7 @@ USETW(req.wIndex, 1); USETW(req.wLength, 0); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL); + error = ural_do_request(sc, &req, NULL); if (error != 0) { device_printf(sc->sc_dev, "could not set test mode: %s\n", usb2_errstr(error)); @@ -1462,7 +1473,7 @@ USETW(req.wIndex, addr); USETW(req.wLength, len); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf); + error = ural_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, "could not read EEPROM: %s\n", usb2_errstr(error)); @@ -1482,7 +1493,7 @@ USETW(req.wIndex, reg); USETW(req.wLength, sizeof (uint16_t)); - error = usb2_do_request(sc->sc_udev, &sc->sc_mtx, &req, &val); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon Feb 9 13:59:34 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A77BD1065675; Mon, 9 Feb 2009 13:59:34 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64A2A1065672 for ; Mon, 9 Feb 2009 13:59:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 520228FC0A for ; Mon, 9 Feb 2009 13:59:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n19DxYVC091169 for ; Mon, 9 Feb 2009 13:59:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n19DxYMo091167 for perforce@freebsd.org; Mon, 9 Feb 2009 13:59:34 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 9 Feb 2009 13:59:34 GMT Message-Id: <200902091359.n19DxYMo091167@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157430 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, 09 Feb 2009 13:59:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=157430 Change 157430 by hselasky@hselasky_laptop001 on 2009/02/09 13:58:44 USB process naming cleanup. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.c#25 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.c#17 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.h#8 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.c#25 (text+ko) ==== @@ -168,16 +168,16 @@ /* Get rid of USB callback processes */ - usb2_proc_unsetup(&bus->giant_callback_proc); - usb2_proc_unsetup(&bus->non_giant_callback_proc); + usb2_proc_free(&bus->giant_callback_proc); + usb2_proc_free(&bus->non_giant_callback_proc); /* Get rid of USB roothub process */ - usb2_proc_unsetup(&bus->roothub_proc); + usb2_proc_free(&bus->roothub_proc); /* Get rid of USB explore process */ - usb2_proc_unsetup(&bus->explore_proc); + usb2_proc_free(&bus->explore_proc); return (0); } @@ -375,6 +375,8 @@ static void usb2_attach_sub(device_t dev, struct usb2_bus *bus) { + const char *pname = device_get_nameunit(dev); + /* Initialise USB process messages */ bus->explore_msg[0].hdr.pm_callback = &usb2_bus_explore; bus->explore_msg[0].bus = bus; @@ -398,20 +400,20 @@ /* Create USB explore, roothub and callback processes */ - if (usb2_proc_setup(&bus->giant_callback_proc, - &bus->bus_mtx, USB_PRI_MED)) { + if (usb2_proc_create(&bus->giant_callback_proc, + &bus->bus_mtx, pname, USB_PRI_MED)) { printf("WARNING: Creation of USB Giant " "callback process failed.\n"); - } else if (usb2_proc_setup(&bus->non_giant_callback_proc, - &bus->bus_mtx, USB_PRI_HIGH)) { + } else if (usb2_proc_create(&bus->non_giant_callback_proc, + &bus->bus_mtx, pname, USB_PRI_HIGH)) { printf("WARNING: Creation of USB non-Giant " "callback process failed.\n"); - } else if (usb2_proc_setup(&bus->roothub_proc, - &bus->bus_mtx, USB_PRI_HIGH)) { + } else if (usb2_proc_create(&bus->roothub_proc, + &bus->bus_mtx, pname, USB_PRI_HIGH)) { printf("WARNING: Creation of USB roothub " "process failed.\n"); - } else if (usb2_proc_setup(&bus->explore_proc, - &bus->bus_mtx, USB_PRI_MED)) { + } else if (usb2_proc_create(&bus->explore_proc, + &bus->bus_mtx, pname, USB_PRI_MED)) { printf("WARNING: Creation of USB explore " "process failed.\n"); } else { ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.c#17 (text+ko) ==== @@ -164,7 +164,7 @@ } /*------------------------------------------------------------------------* - * usb2_proc_setup + * usb2_proc_create * * This function will create a process using the given "prio" that can * execute callbacks. The mutex pointed to by "p_mtx" will be applied @@ -197,18 +197,12 @@ return (0); error: - usb2_proc_unsetup(up); + usb2_proc_free(up); return (ENOMEM); } -uint8_t -usb2_proc_setup(struct usb2_process *up, struct mtx *p_mtx, uint8_t prio) -{ - return (usb2_proc_create(up, p_mtx, "usbproc", prio) ? 1 : 0); -} - /*------------------------------------------------------------------------* - * usb2_proc_unsetup + * usb2_proc_free * * NOTE: If the structure pointed to by "up" is all zero, this * function does nothing. @@ -217,7 +211,7 @@ * removed nor called. *------------------------------------------------------------------------*/ void -usb2_proc_unsetup(struct usb2_process *up) +usb2_proc_free(struct usb2_process *up) { if (!(up->up_mtx)) { /* not initialised */ @@ -232,12 +226,6 @@ up->up_mtx = NULL; } -void -usb2_proc_free(struct usb2_process *up) -{ - usb2_proc_unsetup(up); -} - /*------------------------------------------------------------------------* * usb2_proc_msignal * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.h#8 (text+ko) ==== @@ -79,14 +79,11 @@ uint8_t usb2_proc_cwait(struct usb2_process *up, int timeout); uint8_t usb2_proc_is_gone(struct usb2_process *up); -uint8_t usb2_proc_setup(struct usb2_process *up, struct mtx *p_mtx, - uint8_t prio); int usb2_proc_create(struct usb2_process *up, struct mtx *p_mtx, const char *pmesg, uint8_t prio); void usb2_proc_csignal(struct usb2_process *up); void usb2_proc_drain(struct usb2_process *up); void usb2_proc_mwait(struct usb2_process *up, void *pm0, void *pm1); -void usb2_proc_unsetup(struct usb2_process *up); void usb2_proc_free(struct usb2_process *up); void *usb2_proc_msignal(struct usb2_process *up, void *pm0, void *pm1); From owner-p4-projects@FreeBSD.ORG Mon Feb 9 14:18:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EEFBA1065675; Mon, 9 Feb 2009 14:18:54 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A36B1065672 for ; Mon, 9 Feb 2009 14:18:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC4E8FC08 for ; Mon, 9 Feb 2009 14:18:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n19EIs01093596 for ; Mon, 9 Feb 2009 14:18:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n19EIsaq093594 for perforce@freebsd.org; Mon, 9 Feb 2009 14:18:54 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 9 Feb 2009 14:18:54 GMT Message-Id: <200902091418.n19EIsaq093594@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157433 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, 09 Feb 2009 14:18:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=157433 Change 157433 by hselasky@hselasky_laptop001 on 2009/02/09 14:18:31 Fix USB WLAN regression issue. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#28 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#5 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#28 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#5 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#28 (text+ko) ==== @@ -490,6 +490,7 @@ ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ + IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -1827,15 +1828,13 @@ static void rum_read_eeprom(struct rum_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; uint16_t val; #ifdef RUM_DEBUG int i; #endif /* read MAC address */ - rum_eeprom_read(sc, RT2573_EEPROM_ADDRESS, ic->ic_myaddr, 6); + rum_eeprom_read(sc, RT2573_EEPROM_ADDRESS, sc->sc_bssid, 6); rum_eeprom_read(sc, RT2573_EEPROM_ANTENNA, &val, 2); val = le16toh(val); ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#5 (text+ko) ==== @@ -127,6 +127,7 @@ uint32_t sta[6]; uint32_t rf_regs[4]; uint8_t txpow[44]; + uint8_t sc_bssid[6]; struct { uint8_t val; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#28 (text+ko) ==== @@ -476,6 +476,7 @@ ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ + IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -1978,8 +1979,6 @@ static void ural_read_eeprom(struct ural_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; uint16_t val; ural_eeprom_read(sc, RAL_EEPROM_CONFIG0, &val, 2); @@ -1992,7 +1991,7 @@ sc->nb_ant = val & 0x3; /* read MAC address */ - ural_eeprom_read(sc, RAL_EEPROM_ADDRESS, ic->ic_myaddr, 6); + ural_eeprom_read(sc, RAL_EEPROM_ADDRESS, sc->sc_bssid, 6); /* read default values for BBP registers */ ural_eeprom_read(sc, RAL_EEPROM_BBP_BASE, sc->bbp_prom, 2 * 16); ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#5 (text+ko) ==== @@ -130,6 +130,7 @@ uint16_t sta[11]; uint32_t rf_regs[4]; uint8_t txpow[14]; + uint8_t sc_bssid[6]; struct { uint8_t val; From owner-p4-projects@FreeBSD.ORG Mon Feb 9 16:15:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DE83D1065693; Mon, 9 Feb 2009 16:15:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 887481065690 for ; Mon, 9 Feb 2009 16:15:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 745808FC17 for ; Mon, 9 Feb 2009 16:15:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n19GFsCD018657 for ; Mon, 9 Feb 2009 16:15:54 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n19GFrtp018651 for perforce@freebsd.org; Mon, 9 Feb 2009 16:15:53 GMT (envelope-from jhb@freebsd.org) Date: Mon, 9 Feb 2009 16:15:53 GMT Message-Id: <200902091615.n19GFrtp018651@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 157439 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, 09 Feb 2009 16:15:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=157439 Change 157439 by jhb@jhb_jhbbsd on 2009/02/09 16:14:58 IFC @157437 Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#29 integrate .. //depot/projects/smpng/sys/amd64/conf/NOTES#47 integrate .. //depot/projects/smpng/sys/amd64/include/legacyvar.h#7 integrate .. //depot/projects/smpng/sys/amd64/pci/pci_bus.c#22 integrate .. //depot/projects/smpng/sys/arm/arm/busdma_machdep.c#27 integrate .. //depot/projects/smpng/sys/cam/cam_xpt.c#53 integrate .. //depot/projects/smpng/sys/conf/NOTES#160 integrate .. //depot/projects/smpng/sys/conf/files#226 integrate .. //depot/projects/smpng/sys/conf/options#161 integrate .. //depot/projects/smpng/sys/conf/options.amd64#24 integrate .. //depot/projects/smpng/sys/conf/options.i386#63 integrate .. //depot/projects/smpng/sys/conf/options.ia64#22 integrate .. //depot/projects/smpng/sys/conf/options.mips#3 integrate .. //depot/projects/smpng/sys/conf/options.pc98#61 integrate .. //depot/projects/smpng/sys/crypto/via/padlock.c#14 integrate .. //depot/projects/smpng/sys/dev/acpi_support/acpi_panasonic.c#7 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_pcib_acpi.c#27 integrate .. //depot/projects/smpng/sys/dev/agp/agp.c#5 integrate .. //depot/projects/smpng/sys/dev/ath/ath_hal/ah_regdomain.c#5 integrate .. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5212/ar5212.h#4 integrate .. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c#5 integrate .. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c#3 integrate .. //depot/projects/smpng/sys/dev/ath/if_ath.c#65 integrate .. //depot/projects/smpng/sys/dev/ath/if_athioctl.h#18 integrate .. //depot/projects/smpng/sys/dev/atkbdc/atkbdc_isa.c#5 integrate .. //depot/projects/smpng/sys/dev/bge/if_bge.c#103 integrate .. //depot/projects/smpng/sys/dev/bm/if_bm.c#5 integrate .. //depot/projects/smpng/sys/dev/cardbus/cardbus_device.c#4 integrate .. //depot/projects/smpng/sys/dev/cfi/cfi_core.c#3 integrate .. //depot/projects/smpng/sys/dev/cfi/cfi_dev.c#3 integrate .. //depot/projects/smpng/sys/dev/cfi/cfi_reg.h#2 integrate .. //depot/projects/smpng/sys/dev/cfi/cfi_var.h#2 integrate .. //depot/projects/smpng/sys/dev/exca/exca.c#25 integrate .. //depot/projects/smpng/sys/dev/fxp/if_fxp.c#87 integrate .. //depot/projects/smpng/sys/dev/hifn/hifn7751.c#26 integrate .. //depot/projects/smpng/sys/dev/lmc/if_lmc.c#20 integrate .. //depot/projects/smpng/sys/dev/lmc/if_lmc.h#7 integrate .. //depot/projects/smpng/sys/dev/my/if_my.c#29 integrate .. //depot/projects/smpng/sys/dev/nve/if_nve.c#18 integrate .. //depot/projects/smpng/sys/dev/pccard/card_if.m#17 integrate .. //depot/projects/smpng/sys/dev/pccard/pccard.c#47 integrate .. //depot/projects/smpng/sys/dev/pccard/pccard_cis.c#28 integrate .. //depot/projects/smpng/sys/dev/pccard/pccardvarp.h#5 integrate .. //depot/projects/smpng/sys/dev/pcn/if_pcn.c#3 integrate .. //depot/projects/smpng/sys/dev/ppc/ppc.c#24 integrate .. //depot/projects/smpng/sys/dev/ppc/ppcvar.h#8 integrate .. //depot/projects/smpng/sys/dev/re/if_re.c#70 integrate .. //depot/projects/smpng/sys/dev/safe/safe.c#13 integrate .. //depot/projects/smpng/sys/dev/scc/scc_if.m#3 integrate .. //depot/projects/smpng/sys/dev/si/si.c#26 integrate .. //depot/projects/smpng/sys/dev/sound/macio/aoa.c#2 integrate .. //depot/projects/smpng/sys/dev/sound/macio/aoa.h#2 integrate .. //depot/projects/smpng/sys/dev/sound/macio/davbus.c#2 integrate .. //depot/projects/smpng/sys/dev/sound/macio/i2s.c#2 integrate .. //depot/projects/smpng/sys/dev/sound/macio/snapper.c#2 integrate .. //depot/projects/smpng/sys/dev/sound/macio/tumbler.c#2 integrate .. //depot/projects/smpng/sys/dev/syscons/scterm-teken.c#2 integrate .. //depot/projects/smpng/sys/dev/syscons/teken/teken.c#3 integrate .. //depot/projects/smpng/sys/dev/syscons/teken/teken.h#3 integrate .. //depot/projects/smpng/sys/dev/usb/if_rum.c#8 integrate .. //depot/projects/smpng/sys/dev/usb/if_urtw.c#2 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs#125 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/ehci2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/ohci2.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/uhci2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_busdma.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/include/usb2_devid.h#5 integrate .. //depot/projects/smpng/sys/dev/usb2/include/usb2_devtable.h#5 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_rum2.c#5 integrate .. //depot/projects/smpng/sys/dev/xen/netfront/netfront.c#6 integrate .. //depot/projects/smpng/sys/fs/fifofs/fifo_vnops.c#49 integrate .. //depot/projects/smpng/sys/fs/tmpfs/tmpfs.h#5 integrate .. //depot/projects/smpng/sys/fs/tmpfs/tmpfs_subr.c#8 integrate .. //depot/projects/smpng/sys/fs/tmpfs/tmpfs_vnops.c#9 integrate .. //depot/projects/smpng/sys/fs/udf/ecma167-udf.h#7 integrate .. //depot/projects/smpng/sys/fs/udf/udf.h#10 integrate .. //depot/projects/smpng/sys/fs/udf/udf_vfsops.c#42 integrate .. //depot/projects/smpng/sys/fs/udf/udf_vnops.c#45 integrate .. //depot/projects/smpng/sys/geom/part/g_part.c#14 integrate .. //depot/projects/smpng/sys/geom/part/g_part_bsd.c#10 integrate .. //depot/projects/smpng/sys/geom/part/g_part_ebr.c#1 branch .. //depot/projects/smpng/sys/geom/part/g_part_mbr.c#6 integrate .. //depot/projects/smpng/sys/i386/conf/NOTES#138 integrate .. //depot/projects/smpng/sys/i386/i386/busdma_machdep.c#48 integrate .. //depot/projects/smpng/sys/i386/i386/vm_machdep.c#90 integrate .. //depot/projects/smpng/sys/i386/xen/clock.c#5 integrate .. //depot/projects/smpng/sys/i386/xen/pmap.c#5 integrate .. //depot/projects/smpng/sys/ia64/conf/NOTES#11 integrate .. //depot/projects/smpng/sys/ia64/ia64/busdma_machdep.c#30 integrate .. //depot/projects/smpng/sys/kern/kern_jail.c#64 integrate .. //depot/projects/smpng/sys/kern/kern_linker.c#97 integrate .. //depot/projects/smpng/sys/kern/kern_lock.c#72 integrate .. //depot/projects/smpng/sys/kern/kern_sysctl.c#59 integrate .. //depot/projects/smpng/sys/kern/subr_clist.c#5 integrate .. //depot/projects/smpng/sys/kern/tty.c#85 integrate .. //depot/projects/smpng/sys/kern/uipc_debug.c#6 integrate .. //depot/projects/smpng/sys/kern/uipc_socket.c#120 integrate .. //depot/projects/smpng/sys/kern/vfs_bio.c#115 integrate .. //depot/projects/smpng/sys/kern/vfs_init.c#27 integrate .. //depot/projects/smpng/sys/kern/vfs_mount.c#88 integrate .. //depot/projects/smpng/sys/kern/vfs_subr.c#162 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#141 integrate .. //depot/projects/smpng/sys/mips/mips/busdma_machdep.c#3 integrate .. //depot/projects/smpng/sys/mips/mips/in_cksum.c#3 integrate .. //depot/projects/smpng/sys/modules/geom/geom_part/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/geom/geom_part/geom_part_ebr/Makefile#1 branch .. //depot/projects/smpng/sys/modules/libalias/libalias/Makefile#3 integrate .. //depot/projects/smpng/sys/net/if.c#111 integrate .. //depot/projects/smpng/sys/net/rtsock.c#69 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_crypto.h#14 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_ddb.c#10 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_output.c#37 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c#20 integrate .. //depot/projects/smpng/sys/netinet/in.c#48 integrate .. //depot/projects/smpng/sys/netinet/in_pcb.c#91 integrate .. //depot/projects/smpng/sys/netinet/ip_fw_nat.c#7 integrate .. //depot/projects/smpng/sys/netinet/ip_ipsec.c#12 integrate .. //depot/projects/smpng/sys/netinet/ip_output.c#102 integrate .. //depot/projects/smpng/sys/netinet/libalias/alias.c#8 integrate .. //depot/projects/smpng/sys/netinet/libalias/alias_db.c#10 integrate .. //depot/projects/smpng/sys/netinet/libalias/alias_local.h#7 integrate .. //depot/projects/smpng/sys/netinet/libalias/alias_sctp.c#1 branch .. //depot/projects/smpng/sys/netinet/libalias/alias_sctp.h#1 branch .. //depot/projects/smpng/sys/netinet/raw_ip.c#76 integrate .. //depot/projects/smpng/sys/netinet/sctp_crc32.c#8 integrate .. //depot/projects/smpng/sys/netinet/sctp_crc32.h#6 integrate .. //depot/projects/smpng/sys/netinet/sctputil.c#26 integrate .. //depot/projects/smpng/sys/netinet/tcp_subr.c#106 integrate .. //depot/projects/smpng/sys/netinet/tcp_usrreq.c#73 integrate .. //depot/projects/smpng/sys/netinet/udp_usrreq.c#88 integrate .. //depot/projects/smpng/sys/netinet6/in6.c#50 integrate .. //depot/projects/smpng/sys/netinet6/in6_pcb.c#58 integrate .. //depot/projects/smpng/sys/netinet6/in6_src.c#39 integrate .. //depot/projects/smpng/sys/netinet6/ip6_forward.c#27 integrate .. //depot/projects/smpng/sys/netinet6/ip6_ipsec.c#7 integrate .. //depot/projects/smpng/sys/netinet6/ip6_output.c#59 integrate .. //depot/projects/smpng/sys/netinet6/raw_ip6.c#57 integrate .. //depot/projects/smpng/sys/netinet6/udp6_usrreq.c#54 integrate .. //depot/projects/smpng/sys/netipsec/ipsec.c#31 integrate .. //depot/projects/smpng/sys/netipsec/ipsec.h#18 integrate .. //depot/projects/smpng/sys/netipsec/ipsec6.h#7 integrate .. //depot/projects/smpng/sys/nfsserver/nfs_syscalls.c#40 integrate .. //depot/projects/smpng/sys/opencrypto/cryptosoft.c#16 integrate .. //depot/projects/smpng/sys/pc98/conf/NOTES#66 integrate .. //depot/projects/smpng/sys/rpc/clnt_rc.c#5 integrate .. //depot/projects/smpng/sys/security/audit/audit_bsm.c#15 integrate .. //depot/projects/smpng/sys/security/audit/audit_bsm_klib.c#14 integrate .. //depot/projects/smpng/sys/security/audit/audit_pipe.c#15 integrate .. //depot/projects/smpng/sys/security/audit/audit_private.h#13 integrate .. //depot/projects/smpng/sys/sys/bus_dma.h#4 integrate .. //depot/projects/smpng/sys/sys/cfictl.h#3 integrate .. //depot/projects/smpng/sys/sys/jail.h#22 integrate .. //depot/projects/smpng/sys/sys/lockmgr.h#27 integrate .. //depot/projects/smpng/sys/sys/mount.h#71 integrate .. //depot/projects/smpng/sys/sys/sysctl.h#55 integrate .. //depot/projects/smpng/sys/sys/tty.h#28 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_alloc.c#50 integrate .. //depot/projects/smpng/sys/vm/vm_fault.c#72 integrate .. //depot/projects/smpng/sys/vm/vm_kern.c#42 integrate .. //depot/projects/smpng/sys/vm/vm_map.c#93 integrate .. //depot/projects/smpng/sys/vm/vm_map.h#40 integrate .. //depot/projects/smpng/sys/vm/vm_mmap.c#73 integrate .. //depot/projects/smpng/sys/vm/vm_object.c#104 integrate .. //depot/projects/smpng/sys/vm/vm_object.h#36 integrate .. //depot/projects/smpng/sys/vm/vm_unix.c#12 integrate .. //depot/projects/smpng/sys/vm/vnode_pager.c#68 integrate .. //depot/projects/smpng/sys/vm/vnode_pager.h#7 integrate Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#29 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.86 2008/07/15 03:34:49 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.87 2009/02/08 22:54:58 imp Exp $"); #include #include @@ -1128,6 +1128,13 @@ bz->active_bpages++; mtx_unlock(&bounce_lock); + if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + /* page offset needs to be preserved */ + bpage->vaddr &= ~PAGE_MASK; + bpage->busaddr &= ~PAGE_MASK; + bpage->vaddr |= vaddr & PAGE_MASK; + bpage->busaddr |= vaddr & PAGE_MASK; + } bpage->datavaddr = vaddr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); ==== //depot/projects/smpng/sys/amd64/conf/NOTES#47 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.83 2008/12/01 16:53:01 sam Exp $ +# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.86 2009/02/07 00:01:10 wkoszek Exp $ # # @@ -150,6 +150,11 @@ # AGP GART support device agp +# +# AGP debugging. +# +options AGP_DEBUG + ##################################################################### # HARDWARE DEVICE CONFIGURATION @@ -267,7 +272,6 @@ # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking # ral: Ralink Technology IEEE 802.11 wireless adapter -# ural: Ralink Technology RT2500USB IEEE 802.11 wireless adapter # wpi: Intel 3945ABG Wireless LAN controller device ed @@ -277,10 +281,9 @@ device iwi device iwn device ipw -device nfe # nVidia nForce MCP on-board Ethernet Networking -device nve # nVidia nForce MCP on-board Ethernet Networking +device nfe +device nve device ral -device ural device wpi device ath # Atheros pci/cardbus NIC's @@ -356,9 +359,11 @@ # Miscellaneous hardware: # # ipmi: Intelligent Platform Management Interface +# pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) # smbios: DMI/SMBIOS entry point # vpd: Vital Product Data kernel interface # asmc: Apple System Management Controller +# si: Specialix International SI/XIO or SX intelligent serial card # Notes on the Specialix SI/XIO driver: # The host card is memory, not IO mapped. @@ -367,13 +372,14 @@ # The cards can use an IRQ of 11, 12 or 15. device ipmi -# Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) device pbio hint.pbio.0.at="isa" hint.pbio.0.port="0x360" device smbios device vpd device asmc +#device si + # # Laptop/Notebook options: # ==== //depot/projects/smpng/sys/amd64/include/legacyvar.h#7 (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/amd64/include/legacyvar.h,v 1.8 2007/09/30 11:05:13 marius Exp $ + * $FreeBSD: src/sys/amd64/include/legacyvar.h,v 1.9 2009/02/08 07:03:34 imp Exp $ */ #ifndef _MACHINE_LEGACYVAR_H_ @@ -43,12 +43,12 @@ #undef LEGACY_ACCESSOR int legacy_pcib_maxslots(device_t dev); -uint32_t legacy_pcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes); +uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, int bytes); int legacy_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); -void legacy_pcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes); +void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, uint32_t data, int bytes); int legacy_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); struct resource *legacy_pcib_alloc_resource(device_t dev, device_t child, ==== //depot/projects/smpng/sys/amd64/pci/pci_bus.c#22 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.122 2007/09/30 11:05:13 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.123 2009/02/08 07:02:42 imp Exp $"); #include "opt_cpu.h" @@ -55,9 +55,9 @@ /* read configuration space register */ -u_int32_t -legacy_pcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes) +uint32_t +legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) { return(pci_cfgregread(bus, slot, func, reg, bytes)); } @@ -65,8 +65,8 @@ /* write configuration space register */ void -legacy_pcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes) +legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t data, int bytes) { pci_cfgregwrite(bus, slot, func, reg, data, bytes); } ==== //depot/projects/smpng/sys/arm/arm/busdma_machdep.c#27 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.42 2009/02/04 01:14:06 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.43 2009/02/08 22:54:58 imp Exp $"); /* * ARM bus dma support routines @@ -1417,6 +1417,13 @@ bz->active_bpages++; mtx_unlock(&bounce_lock); + if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + /* page offset needs to be preserved */ + bpage->vaddr &= ~PAGE_MASK; + bpage->busaddr &= ~PAGE_MASK; + bpage->vaddr |= vaddr & PAGE_MASK; + bpage->busaddr |= vaddr & PAGE_MASK; + } bpage->datavaddr = vaddr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); ==== //depot/projects/smpng/sys/cam/cam_xpt.c#53 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.208 2009/01/23 21:08:00 trasz Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.209 2009/02/08 22:08:48 trasz Exp $"); #include #include @@ -4178,7 +4178,7 @@ struct sbuf sb; #ifdef INVARIANTS - if (path != NULL && path->bus != NULL && path->bus->sim != NULL) + if (path != NULL && path->bus != NULL) mtx_assert(path->bus->sim->mtx, MA_OWNED); #endif ==== //depot/projects/smpng/sys/conf/NOTES#160 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1524 2009/01/20 02:08:21 sobomax Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1527 2009/02/08 12:33:05 wkoszek Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -714,40 +714,81 @@ # # Network interfaces: # The `loop' device is MANDATORY when networking is enabled. +device loop + # The `ether' device provides generic code to handle # Ethernets; it is MANDATORY when an Ethernet device driver is # configured or token-ring is enabled. +device ether + # The `vlan' device implements the VLAN tagging of Ethernet frames # according to IEEE 802.1Q. It requires `device miibus'. +device vlan + # The `wlan' device provides generic code to support 802.11 # drivers, including host AP mode; it is MANDATORY for the wi, # and ath drivers and will eventually be required by all 802.11 drivers. +device wlan +options IEEE80211_DEBUG #enable debugging msgs +options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's + # The `wlan_wep', `wlan_tkip', and `wlan_ccmp' devices provide # support for WEP, TKIP, and AES-CCMP crypto protocols optionally # used with 802.11 devices that depend on the `wlan' module. +device wlan_wep +device wlan_ccmp +device wlan_tkip + # The `wlan_xauth' device provides support for external (i.e. user-mode) # authenticators for use with 802.11 drivers that use the `wlan' # module and support 802.1x and/or WPA security protocols. +device wlan_xauth + # The `wlan_acl' device provides a MAC-based access control mechanism # for use with 802.11 drivers operating in ap mode and using the # `wlan' module. +# The 'wlan_amrr' device provides AMRR transmit rate control algorithm +device wlan_acl +device wlan_amrr + +# Generic TokenRing +device token + # The `fddi' device provides generic code to support FDDI. +device fddi + # The `arcnet' device provides generic code to support Arcnet. +device arcnet + # The `sppp' device serves a similar role for certain types # of synchronous PPP links (like `cx', `ar'). +device sppp + # The `sl' device implements the Serial Line IP (SLIP) service. # The `ppp' device implements the Point-to-Point Protocol. + + # The `bpf' device enables the Berkeley Packet Filter. Be # aware of the legal and administrative consequences of enabling this # option. The number of devices determines the maximum number of # simultaneous BPF clients programs runnable. DHCP requires bpf. +device bpf + # The `disc' device implements a minimal network interface, # which throws away all packets sent and never receives any. It is # included for testing and benchmarking purposes. +device disc + # The `edsc' device implements a minimal Ethernet interface, # which discards all packets sent and receives none. +device edsc + # The `tap' device is a pty-like virtual Ethernet interface -# The `tun' device implements (user-)ppp and nos-tun +device tap + +# The `tun' device implements (user-)ppp and nos-tun(8) +device tun + # The `gif' device implements IPv6 over IP4 tunneling, # IPv4 over IPv6 tunneling, IPv4 over IPv4 tunneling and # IPv6 over IPv6 tunneling. @@ -755,17 +796,45 @@ # GRE and MOBILE, as specified in the RFC1701 and RFC2004. # The XBONEHACK option allows the same pair of addresses to be configured on # multiple gif interfaces. +device gif +device gre +options XBONEHACK + # The `faith' device captures packets sent to it and diverts them # to the IPv4/IPv6 translation daemon. # The `stf' device implements 6to4 encapsulation. +device faith +device stf + # The `ef' device provides support for multiple ethernet frame types # specified via ETHER_* options. See ef(4) for details. -# +device ef +options ETHER_II # enable Ethernet_II frame +options ETHER_8023 # enable Ethernet_802.3 (Novell) frame +options ETHER_8022 # enable Ethernet_802.2 frame +options ETHER_SNAP # enable Ethernet_802.2/SNAP frame + # The pf packet filter consists of three devices: # The `pf' device provides /dev/pf and the firewall code itself. # The `pflog' device provides the pflog0 interface which logs packets. # The `pfsync' device provides the pfsync0 interface used for # synchronization of firewall state tables (over the net). +device pf +device pflog +device pfsync + +# Bridge interface. +device if_bridge + +# Common Address Redundancy Protocol. See carp(4) for more details. +device carp + +# IPsec interface. +device enc + +# Link aggregation interface. +device lagg + # # The PPP_BSDCOMP option enables support for compress(1) style entire # packet compression, the PPP_DEFLATE is for zlib/gzip style compression. @@ -773,48 +842,8 @@ # events for resetting the demand dial activity timer - requires bpf. # See pppd(8) for more details. # -device ether #Generic Ethernet -device vlan #VLAN support (needs miibus) -device wlan #802.11 support -options IEEE80211_DEBUG #enable debugging msgs -options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's -device wlan_wep #802.11 WEP support -device wlan_ccmp #802.11 CCMP support -device wlan_tkip #802.11 TKIP support -device wlan_xauth #802.11 external authenticator support -device wlan_acl #802.11 MAC ACL support -device wlan_amrr #AMRR transmit rate control algorithm -device token #Generic TokenRing -device fddi #Generic FDDI -device arcnet #Generic Arcnet -device sppp #Generic Synchronous PPP -device loop #Network loopback device -device bpf #Berkeley packet filter -device disc #Discard device based on loopback -device edsc #Ethernet discard device -device tap #Virtual Ethernet driver -device tun #Tunnel driver (ppp(8), nos-tun(8)) -device gre #IP over IP tunneling -device if_bridge #Bridge interface -device pf #PF OpenBSD packet-filter firewall -device pflog #logging support interface for PF -device pfsync #synchronization interface for PF -device carp #Common Address Redundancy Protocol -device enc #IPsec interface -device lagg #Link aggregation interface -device ef # Multiple ethernet frames support -options ETHER_II # enable Ethernet_II frame -options ETHER_8023 # enable Ethernet_802.3 (Novell) frame -options ETHER_8022 # enable Ethernet_802.2 frame -options ETHER_SNAP # enable Ethernet_802.2/SNAP frame -# for IPv6 -device gif #IPv6 and IPv4 tunneling -options XBONEHACK -device faith #for IPv6 and IPv4 translation -device stf #6to4 IPv6 over IPv4 encapsulation - # # Internet family options: # @@ -2109,44 +2138,9 @@ # scd: Sony CD-ROM using proprietary (non-ATAPI) interface # mcd: Mitsumi CD-ROM using proprietary (non-ATAPI) interface # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board -# cy: Cyclades serial driver # joy: joystick (including IO DATA PCJOY PC Card joystick) -# rc: RISCom/8 multiport card -# rp: Comtrol Rocketport(ISA/PCI) - single card -# si: Specialix SI/XIO 4-32 port terminal multiplexor # cmx: OmniKey CardMan 4040 pccard smartcard reader -# Notes on the Comtrol Rocketport driver: -# -# The exact values used for rp0 depend on how many boards you have -# in the system. The manufacturer's sample configs are listed as: -# -# device rp # core driver support -# -# Comtrol Rocketport ISA single card -# hint.rp.0.at="isa" -# hint.rp.0.port="0x280" -# -# If instead you have two ISA cards, one installed at 0x100 and the -# second installed at 0x180, then you should add the following to -# your kernel probe hints: -# hint.rp.0.at="isa" -# hint.rp.0.port="0x100" -# hint.rp.1.at="isa" -# hint.rp.1.port="0x180" -# -# For 4 ISA cards, it might be something like this: -# hint.rp.0.at="isa" -# hint.rp.0.port="0x180" -# hint.rp.1.at="isa" -# hint.rp.1.port="0x100" -# hint.rp.2.at="isa" -# hint.rp.2.port="0x340" -# hint.rp.3.at="isa" -# hint.rp.3.port="0x240" -# -# For PCI cards, you need no hints. - # Mitsumi CD-ROM device mcd hint.mcd.0.at="isa" @@ -2323,6 +2317,7 @@ # ppi General-purpose I/O ("Geek Port") + IEEE1284 I/O # pps Pulse per second Timing Interface # lpbb Philips official parallel port I2C bit-banging interface +# pcfclock Parallel port clock driver. # # Supported interfaces: # ppc ISA-bus parallel port interfaces. ==== //depot/projects/smpng/sys/conf/files#226 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1365 2009/01/14 10:44:16 rwatson Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1367 2009/02/08 14:43:20 wkoszek Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1036,7 +1036,7 @@ dependency "iwn.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn.fw" \ no-implicit-rule \ - clean "iwn.fwo" + clean "iwnfw.fwo" iwn.fw optional iwnfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-4.44.17.fw.uu" \ @@ -1234,7 +1234,7 @@ dependency "rt2561.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \ no-implicit-rule \ - clean "rt2561.fwo" + clean "rt2561fw.fwo" rt2561.fw optional rt2561fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \ @@ -1248,7 +1248,7 @@ dependency "rt2561s.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \ no-implicit-rule \ - clean "rt2561s.fwo" + clean "rt2561sfw.fwo" rt2561s.fw optional rt2561sfw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \ @@ -1262,7 +1262,7 @@ dependency "rt2661.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \ no-implicit-rule \ - clean "rt2661.fwo" + clean "rt2661fw.fwo" rt2661.fw optional rt2661fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \ @@ -1276,7 +1276,7 @@ dependency "rt2860.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \ no-implicit-rule \ - clean "rt2860.fwo" + clean "rt2860fw.fwo" rt2860.fw optional rt2860fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \ @@ -1697,7 +1697,7 @@ dependency "wpi.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \ no-implicit-rule \ - clean "wpi.fwo" + clean "wpifw.fwo" wpi.fw optional wpifw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \ @@ -2387,6 +2387,7 @@ netinet/libalias/alias_mod.c optional libalias | netgraph_nat netinet/libalias/alias_proxy.c optional libalias | netgraph_nat netinet/libalias/alias_util.c optional libalias | netgraph_nat +netinet/libalias/alias_sctp.c optional libalias | netgraph_nat netinet6/dest6.c optional inet6 netinet6/frag6.c optional inet6 netinet6/icmp6.c optional inet6 ==== //depot/projects/smpng/sys/conf/options#161 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.658 2009/01/28 18:00:22 sam Exp $ +# $FreeBSD: src/sys/conf/options,v 1.660 2009/02/06 10:30:46 wkoszek Exp $ # # On the handling of kernel options # @@ -36,7 +36,7 @@ AHC_DUMP_EEPROM opt_aic7xxx.h AHC_DEBUG opt_aic7xxx.h AHC_DEBUG_OPTS opt_aic7xxx.h -AHC_REG_PRETTY_PRINT opt_aic7xxx.h +AHC_REG_PRETTY_PRINT opt_aic7xxx.h AHD_DEBUG opt_aic79xx.h AHD_DEBUG_OPTS opt_aic79xx.h AHD_TMODE_ENABLE opt_aic79xx.h @@ -137,7 +137,7 @@ MBUF_PACKET_ZONE_DISABLE opt_global.h PANIC_REBOOT_WAIT_TIME opt_panic.h PPC_DEBUG opt_ppc.h -PPC_PROBE_CHIPSET opt_ppc.h +PPC_PROBE_CHIPSET opt_ppc.h PPS_SYNC opt_ntp.h PREEMPTION opt_sched.h QUOTA @@ -424,13 +424,13 @@ # SCTP opt_sctp.h SCTP_DEBUG opt_sctp.h # Enable debug printfs -SCTP_WITH_NO_CSUM opt_sctp.h # Use this at your peril -SCTP_LOCK_LOGGING opt_sctp.h # Log to KTR lock activity -SCTP_MBUF_LOGGING opt_sctp.h # Log to KTR general mbuf aloc/free +SCTP_WITH_NO_CSUM opt_sctp.h # Use this at your peril +SCTP_LOCK_LOGGING opt_sctp.h # Log to KTR lock activity +SCTP_MBUF_LOGGING opt_sctp.h # Log to KTR general mbuf aloc/free SCTP_MBCNT_LOGGING opt_sctp.h # Log to KTR mbcnt activity -SCTP_PACKET_LOGGING opt_sctp.h # Log to a packet buffer last N packets -SCTP_LTRACE_CHUNKS opt_sctp.h # Log to KTR chunks processed -SCTP_LTRACE_ERRORS opt_sctp.h # Log to KTR error returns. +SCTP_PACKET_LOGGING opt_sctp.h # Log to a packet buffer last N packets +SCTP_LTRACE_CHUNKS opt_sctp.h # Log to KTR chunks processed +SCTP_LTRACE_ERRORS opt_sctp.h # Log to KTR error returns. # # # @@ -804,3 +804,7 @@ # Virtualize the network stack VIMAGE opt_global.h VIMAGE_GLOBALS opt_global.h + +# Common Flash Interface (CFI) options +CFI_SUPPORT_STRATAFLASH opt_cfi.h +CFI_ARMEDANDDANGEROUS opt_cfi.h ==== //depot/projects/smpng/sys/conf/options.amd64#24 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.amd64,v 1.33 2008/05/26 10:39:52 bz Exp $ +# $FreeBSD: src/sys/conf/options.amd64,v 1.34 2009/02/06 20:57:10 wkoszek Exp $ # Options specific to AMD64 platform kernels AUTO_EOI_1 opt_auto_eoi.h @@ -37,6 +37,9 @@ VGA_SLOW_IOACCESS opt_vga.h VGA_WIDTH90 opt_vga.h +# AGP debugging support +AGP_DEBUG opt_agp.h + ATKBD_DFLT_KEYMAP opt_atkbd.h # ------------------------------- ==== //depot/projects/smpng/sys/conf/options.i386#63 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.i386,v 1.243 2008/08/15 20:58:57 kmacy Exp $ +# $FreeBSD: src/sys/conf/options.i386,v 1.244 2009/02/06 20:57:10 wkoszek Exp $ # Options specific to the i386 platform kernels AUTO_EOI_1 opt_auto_eoi.h @@ -88,6 +88,9 @@ VESA VESA_DEBUG opt_vesa.h +# AGP debugging support +AGP_DEBUG opt_agp.h + PSM_DEBUG opt_psm.h PSM_HOOKRESUME opt_psm.h PSM_RESETAFTERSUSPEND opt_psm.h ==== //depot/projects/smpng/sys/conf/options.ia64#22 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.ia64,v 1.28 2007/07/30 22:42:33 marcel Exp $ +# $FreeBSD: src/sys/conf/options.ia64,v 1.29 2009/02/07 09:57:14 wkoszek Exp $ # Options specific to the ia64 platform kernels ITANIUM opt_global.h @@ -20,6 +20,9 @@ VGA_SLOW_IOACCESS opt_vga.h VGA_WIDTH90 opt_vga.h +# AGP debugging. +AGP_DEBUG opt_agp.h + PSM_HOOKRESUME opt_psm.h PSM_RESETAFTERSUSPEND opt_psm.h PSM_DEBUG opt_psm.h ==== //depot/projects/smpng/sys/conf/options.mips#3 (text+ko) ==== @@ -26,7 +26,7 @@ # SUCH DAMAGE. # # JNPR: options.mips,v 1.2 2006/09/15 12:52:34 -# $FreeBSD: src/sys/conf/options.mips,v 1.2 2008/09/19 03:36:37 imp Exp $ +# $FreeBSD: src/sys/conf/options.mips,v 1.3 2009/02/06 10:30:46 wkoszek Exp $ CPU_MIPS4KC opt_global.h CPU_MIPS32 opt_global.h @@ -48,7 +48,7 @@ KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h PHYSADDR opt_global.h -SOFTFLOAT opt_global.h +SOFTFLOAT opt_global.h TARGET_OCTEON opt_global.h TARGET_EMULATOR opt_ddb.h ==== //depot/projects/smpng/sys/conf/options.pc98#61 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.pc98,v 1.204 2008/06/14 12:51:44 wkoszek Exp $ +# $FreeBSD: src/sys/conf/options.pc98,v 1.205 2009/02/06 20:57:10 wkoszek Exp $ # Options specific to the pc98 platform kernels AUTO_EOI_1 opt_auto_eoi.h @@ -96,6 +96,7 @@ # Debugging NPX_DEBUG opt_npx.h STOP_NMI opt_cpu.h +AGP_DEBUG opt_agp.h # BPF just-in-time compiler BPF_JITTER opt_bpf.h ==== //depot/projects/smpng/sys/crypto/via/padlock.c#14 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/crypto/via/padlock.c,v 1.22 2009/01/12 19:23:46 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/crypto/via/padlock.c,v 1.23 2009/02/05 19:30:28 imp Exp $"); #include #include @@ -72,7 +72,7 @@ MALLOC_DEFINE(M_PADLOCK, "padlock_data", "PadLock Data"); static void -padlock_identify(device_t *dev, device_t parent) +padlock_identify(driver_t *drv, device_t parent) { /* NB: order 10 is so we get attached after h/w devices */ if (device_find_child(parent, "padlock", -1) == NULL && ==== //depot/projects/smpng/sys/dev/acpi_support/acpi_panasonic.c#7 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpi_support/acpi_panasonic.c,v 1.13 2007/06/17 04:40:33 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpi_support/acpi_panasonic.c,v 1.14 2009/02/05 18:39:33 imp Exp $"); #include "opt_acpi.h" #include @@ -79,7 +79,7 @@ static int acpi_panasonic_probe(device_t dev); static int acpi_panasonic_attach(device_t dev); static int acpi_panasonic_detach(device_t dev); -static void acpi_panasonic_shutdown(device_t dev); +static int acpi_panasonic_shutdown(device_t dev); static int acpi_panasonic_sysctl(SYSCTL_HANDLER_ARGS); static ACPI_INTEGER acpi_panasonic_sinf(ACPI_HANDLE h, ACPI_INTEGER index); static void acpi_panasonic_sset(ACPI_HANDLE h, ACPI_INTEGER index, @@ -220,7 +220,7 @@ return (0); } -static void +static int acpi_panasonic_shutdown(device_t dev) { struct acpi_panasonic_softc *sc; @@ -230,6 +230,7 @@ sc = device_get_softc(dev); mute = 1; hkey_sound_mute(sc->handle, HKEY_SET, &mute); + return (0); } static int ==== //depot/projects/smpng/sys/dev/acpica/acpi_pcib_acpi.c#27 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.55 2007/09/30 11:05:14 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pcib_acpi.c,v 1.56 2009/02/05 18:40:42 imp Exp $"); #include "opt_acpi.h" #include @@ -68,10 +68,11 @@ int which, uintptr_t *result); static int acpi_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); -static uint32_t acpi_pcib_read_config(device_t dev, int bus, int slot, - int func, int reg, int bytes); -static void acpi_pcib_write_config(device_t dev, int bus, int slot, - int func, int reg, uint32_t data, int bytes); +static uint32_t acpi_pcib_read_config(device_t dev, u_int bus, + u_int slot, u_int func, u_int reg, int bytes); +static void acpi_pcib_write_config(device_t dev, u_int bus, + u_int slot, u_int func, u_int reg, uint32_t data, + int bytes); static int acpi_pcib_acpi_route_interrupt(device_t pcib, device_t dev, int pin); static int acpi_pcib_alloc_msi(device_t pcib, device_t dev, @@ -297,15 +298,15 @@ } static uint32_t -acpi_pcib_read_config(device_t dev, int bus, int slot, int func, int reg, - int bytes) +acpi_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) { return (pci_cfgregread(bus, slot, func, reg, bytes)); } static void -acpi_pcib_write_config(device_t dev, int bus, int slot, int func, int reg, - uint32_t data, int bytes) +acpi_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t data, int bytes) { pci_cfgregwrite(bus, slot, func, reg, data, bytes); } ==== //depot/projects/smpng/sys/dev/agp/agp.c#5 (text+ko) ==== @@ -25,8 +25,9 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/agp/agp.c,v 1.61 2008/12/23 16:04:33 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/agp/agp.c,v 1.62 2009/02/06 20:57:10 wkoszek Exp $"); +#include "opt_agp.h" #include "opt_bus.h" #include @@ -554,7 +555,7 @@ */ m = vm_page_grab(mem->am_obj, OFF_TO_IDX(i), VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); - AGP_DPF("found page pa=%#x\n", VM_PAGE_TO_PHYS(m)); + AGP_DPF("found page pa=%#jx\n", (uintmax_t)VM_PAGE_TO_PHYS(m)); } VM_OBJECT_UNLOCK(mem->am_obj); @@ -585,8 +586,8 @@ for (j = 0; j < PAGE_SIZE && i + j < mem->am_size; j += AGP_PAGE_SIZE) { vm_offset_t pa = VM_PAGE_TO_PHYS(m) + j; - AGP_DPF("binding offset %#x to pa %#x\n", - offset + i + j, pa); + AGP_DPF("binding offset %#jx to pa %#jx\n", + (uintmax_t)offset + i + j, (uintmax_t)pa); error = AGP_BIND_PAGE(dev, offset + i + j, pa); if (error) { /* ==== //depot/projects/smpng/sys/dev/ath/ath_hal/ah_regdomain.c#5 (text+ko) ==== @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/ath/ath_hal/ah_regdomain.c,v 1.4 2009/02/03 19:00:56 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ah_regdomain.c,v 1.7 2009/02/07 01:54:57 sam Exp $ */ #include "opt_ah.h" >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon Feb 9 16:59:39 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9D40310656E2; Mon, 9 Feb 2009 16:59:39 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3186810656DF for ; Mon, 9 Feb 2009 16:59:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1DF898FC22 for ; Mon, 9 Feb 2009 16:59:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n19Gxd5T033612 for ; Mon, 9 Feb 2009 16:59:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n19GxdP6033610 for perforce@freebsd.org; Mon, 9 Feb 2009 16:59:39 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 9 Feb 2009 16:59:39 GMT Message-Id: <200902091659.n19GxdP6033610@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157443 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, 09 Feb 2009 16:59:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=157443 Change 157443 by hselasky@hselasky_laptop001 on 2009/02/09 16:59:35 USB WLAN patches: - Fix issues with freed memory accessed. - Some other minor nits. - USB WLAN adapters have been tested and found to work in device mode. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#29 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#6 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#29 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#6 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#31 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#5 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#29 (text+ko) ==== @@ -133,8 +133,8 @@ const uint8_t mac[IEEE80211_ADDR_LEN]); static void rum_vap_delete(struct ieee80211vap *); static void rum_tx_free(struct rum_tx_data *, int); -static int rum_alloc_tx_list(struct rum_softc *); -static void rum_free_tx_list(struct rum_softc *); +static void rum_setup_tx_list(struct rum_softc *); +static void rum_unsetup_tx_list(struct rum_softc *); static int rum_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void rum_setup_tx_desc(struct rum_softc *, @@ -552,19 +552,21 @@ /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); - /* stop all USB transfers first */ + /* stop all USB transfers */ usb2_transfer_unsetup(sc->sc_xfer, RUM_N_TRANSFER); usb2_proc_free(&sc->sc_tq); + /* free TX list, if any */ + RUM_LOCK(sc); + rum_unsetup_tx_list(sc); + RUM_UNLOCK(sc); + if (ifp) { bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); } - /* free TX list, if any */ - rum_free_tx_list(sc); - mtx_destroy(&sc->sc_mtx); return (0); @@ -612,11 +614,8 @@ rum_vap_delete(struct ieee80211vap *vap) { struct rum_vap *rvp = RUM_VAP(vap); - struct rum_softc *sc = rvp->sc; - RUM_LOCK(sc); - usb2_callout_stop(&rvp->amrr_ch); - RUM_UNLOCK(sc); + usb2_callout_drain(&rvp->amrr_ch); ieee80211_amrr_cleanup(&rvp->amrr); ieee80211_vap_detach(vap); free(rvp, M_80211_VAP); @@ -641,17 +640,12 @@ sc->tx_nfree++; } -static int -rum_alloc_tx_list(struct rum_softc *sc) +static void +rum_setup_tx_list(struct rum_softc *sc) { struct rum_tx_data *data; int i; - sc->tx_data = malloc(sizeof(struct rum_tx_data) * RUM_TX_LIST_COUNT, - M_USB, M_NOWAIT|M_ZERO); - if (sc->tx_data == NULL) - return (ENOMEM); - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -663,18 +657,20 @@ STAILQ_INSERT_TAIL(&sc->tx_free, data, next); sc->tx_nfree++; } - return 0; } static void -rum_free_tx_list(struct rum_softc *sc) +rum_unsetup_tx_list(struct rum_softc *sc) { struct rum_tx_data *data; int i; - if (sc->tx_data == NULL) - return; + /* make sure any subsequent use of the queues will fail */ + sc->tx_nfree = 0; + STAILQ_INIT(&sc->tx_q); + STAILQ_INIT(&sc->tx_free); + /* free up all node references and mbufs */ for (i = 0; i < RUM_TX_LIST_COUNT; i++) { data = &sc->tx_data[i]; @@ -687,8 +683,6 @@ data->ni = NULL; } } - free(sc->tx_data, M_USB); - sc->tx_data = NULL; } static void @@ -724,7 +718,8 @@ rum_enable_mrr(sc); rum_set_txpreamble(sc); rum_set_basicrates(sc); - rum_set_bssid(sc, ni->ni_bssid); + IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); + rum_set_bssid(sc, sc->sc_bssid); } if (vap->iv_opmode == IEEE80211_M_HOSTAP || @@ -1998,11 +1993,7 @@ /* * Allocate Tx and Rx xfer queues. */ - error = rum_alloc_tx_list(sc); - if (error != 0) { - device_printf(sc->sc_dev, "could not allocate Tx list\n"); - goto fail; - } + rum_setup_tx_list(sc); /* update Rx filter */ tmp = rum_read(sc, RT2573_TXRX_CSR0) & 0xffff; @@ -2056,13 +2047,17 @@ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + RUM_UNLOCK(sc); + /* - * stop all the transfers, if not already stopped: + * Drain the USB transfers, if not already drained: */ - usb2_transfer_stop(sc->sc_xfer[RUM_BULK_WR]); - usb2_transfer_stop(sc->sc_xfer[RUM_BULK_RD]); + usb2_transfer_drain(sc->sc_xfer[RUM_BULK_WR]); + usb2_transfer_drain(sc->sc_xfer[RUM_BULK_RD]); + + RUM_LOCK(sc); - rum_free_tx_list(sc); + rum_unsetup_tx_list(sc); /* disable Rx */ tmp = rum_read(sc, RT2573_TXRX_CSR0); @@ -2298,7 +2293,6 @@ struct rum_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); uint32_t tmp; RUM_LOCK_ASSERT(sc, MA_OWNED); @@ -2311,19 +2305,13 @@ rum_set_bssid(sc, ifp->if_broadcastaddr); break; - case RUM_SCAN_END: - rum_enable_tsf_sync(sc); - /* XXX keep local copy */ - rum_set_bssid(sc, vap->iv_bss->ni_bssid); - break; - case RUM_SET_CHANNEL: rum_set_chan(sc, ic->ic_curchan); break; - default: - panic("unknown scan action %d\n", sc->sc_scan_action); - /* NEVER REACHED */ + default: /* RUM_SCAN_END */ + rum_enable_tsf_sync(sc); + rum_set_bssid(sc, sc->sc_bssid); break; } } ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#6 (text+ko) ==== @@ -116,7 +116,7 @@ #define RUM_SCAN_END 1 #define RUM_SET_CHANNEL 2 - struct rum_tx_data *tx_data; + struct rum_tx_data tx_data[RUM_TX_LIST_COUNT]; rum_txdhead tx_q; rum_txdhead tx_free; int tx_nfree; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#29 (text+ko) ==== @@ -112,8 +112,8 @@ const uint8_t mac[IEEE80211_ADDR_LEN]); static void ural_vap_delete(struct ieee80211vap *); static void ural_tx_free(struct ural_tx_data *, int); -static int ural_alloc_tx_list(struct ural_softc *); -static void ural_free_tx_list(struct ural_softc *); +static void ural_setup_tx_list(struct ural_softc *); +static void ural_unsetup_tx_list(struct ural_softc *); static int ural_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void ural_setup_tx_desc(struct ural_softc *, @@ -538,19 +538,21 @@ /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); - /* stop all USB transfers first */ + /* stop all USB transfers */ usb2_transfer_unsetup(sc->sc_xfer, URAL_N_TRANSFER); usb2_proc_free(&sc->sc_tq); + /* free TX list, if any */ + RAL_LOCK(sc); + ural_unsetup_tx_list(sc); + RAL_UNLOCK(sc); + if (ifp) { bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); } - /* free TX list, if any */ - ural_free_tx_list(sc); - mtx_destroy(&sc->sc_mtx); return (0); @@ -598,11 +600,8 @@ ural_vap_delete(struct ieee80211vap *vap) { struct ural_vap *uvp = URAL_VAP(vap); - struct ural_softc *sc = uvp->sc; - RAL_LOCK(sc); - usb2_callout_stop(&uvp->amrr_ch); - RAL_UNLOCK(sc); + usb2_callout_drain(&uvp->amrr_ch); ieee80211_amrr_cleanup(&uvp->amrr); ieee80211_vap_detach(vap); free(uvp, M_80211_VAP); @@ -627,17 +626,12 @@ sc->tx_nfree++; } -static int -ural_alloc_tx_list(struct ural_softc *sc) +static void +ural_setup_tx_list(struct ural_softc *sc) { struct ural_tx_data *data; int i; - sc->tx_data = malloc(sizeof(struct ural_tx_data) * RAL_TX_LIST_COUNT, - M_USB, M_NOWAIT|M_ZERO); - if (sc->tx_data == NULL) - return (ENOMEM); - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -649,18 +643,20 @@ STAILQ_INSERT_TAIL(&sc->tx_free, data, next); sc->tx_nfree++; } - return 0; } static void -ural_free_tx_list(struct ural_softc *sc) +ural_unsetup_tx_list(struct ural_softc *sc) { struct ural_tx_data *data; int i; - if (sc->tx_data == NULL) - return; + /* make sure any subsequent use of the queues will fail */ + sc->tx_nfree = 0; + STAILQ_INIT(&sc->tx_q); + STAILQ_INIT(&sc->tx_free); + /* free up all node references and mbufs */ for (i = 0; i < RAL_TX_LIST_COUNT; i++) { data = &sc->tx_data[i]; @@ -673,8 +669,6 @@ data->ni = NULL; } } - free(sc->tx_data, M_USB); - sc->tx_data = NULL; } static void @@ -711,7 +705,8 @@ ural_update_slot(ic->ic_ifp); ural_set_txpreamble(sc); ural_set_basicrates(sc, ic->ic_bsschan); - ural_set_bssid(sc, ni->ni_bssid); + IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); + ural_set_bssid(sc, sc->sc_bssid); } if (vap->iv_opmode == IEEE80211_M_HOSTAP || @@ -763,23 +758,27 @@ struct ural_softc *sc = task->sc; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); RAL_LOCK_ASSERT(sc, MA_OWNED); - if (sc->sc_scan_action == URAL_SCAN_START) { + switch (sc->sc_scan_action) { + case URAL_SCAN_START: /* abort TSF synchronization */ DPRINTF("starting scan\n"); ural_write(sc, RAL_TXRX_CSR19, 0); ural_set_bssid(sc, ifp->if_broadcastaddr); - } else if (sc->sc_scan_action == URAL_SET_CHANNEL) { + break; + + case URAL_SET_CHANNEL: ural_set_chan(sc, ic->ic_curchan); - } else { + break; + + default: /* URAL_SCAN_END */ DPRINTF("stopping scan\n"); ural_enable_tsf_sync(sc); - /* XXX keep local copy */ - ural_set_bssid(sc, vap->iv_bss->ni_bssid); - } + ural_set_bssid(sc, sc->sc_bssid); + break; + } } static int @@ -2092,7 +2091,6 @@ struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; uint16_t tmp; - usb2_error_t error; int i, ntries; RAL_LOCK_ASSERT(sc, MA_OWNED); @@ -2143,11 +2141,7 @@ /* * Allocate Tx and Rx xfer queues. */ - error = ural_alloc_tx_list(sc); - if (error != 0) { - device_printf(sc->sc_dev, "could not allocate Tx list\n"); - goto fail; - } + ural_setup_tx_list(sc); /* kick Rx */ tmp = RAL_DROP_PHY | RAL_DROP_CRC; @@ -2198,12 +2192,14 @@ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); /* - * stop all the transfers, if not already stopped: + * Drain all the transfers, if not already drained: */ - usb2_transfer_stop(sc->sc_xfer[URAL_BULK_WR]); - usb2_transfer_stop(sc->sc_xfer[URAL_BULK_RD]); + RAL_UNLOCK(sc); + usb2_transfer_drain(sc->sc_xfer[URAL_BULK_WR]); + usb2_transfer_drain(sc->sc_xfer[URAL_BULK_RD]); + RAL_LOCK(sc); - ural_free_tx_list(sc); + ural_unsetup_tx_list(sc); /* disable Rx */ ural_write(sc, RAL_TXRX_CSR2, RAL_DISABLE_RX); ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#6 (text+ko) ==== @@ -119,7 +119,7 @@ struct ural_task sc_promisctask[2]; struct ural_task sc_scantask[2]; - struct ural_tx_data *tx_data; + struct ural_tx_data tx_data[RAL_TX_LIST_COUNT]; ural_txdhead tx_q; ural_txdhead tx_free; int tx_nfree; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#31 (text+ko) ==== @@ -64,7 +64,7 @@ ZYD_DEBUG_ANY = 0xffffffff }; #define DPRINTF(sc, m, fmt, ...) do { \ - if (sc->sc_debug & (m)) \ + if (zyd_debug & (m)) \ printf("%s: " fmt, __func__, ## __VA_ARGS__); \ } while (0) #else @@ -98,8 +98,8 @@ const uint8_t mac[IEEE80211_ADDR_LEN]); static void zyd_vap_delete(struct ieee80211vap *); static void zyd_tx_free(struct zyd_tx_data *, int); -static int zyd_alloc_tx_list(struct zyd_softc *); -static void zyd_free_tx_list(struct zyd_softc *); +static void zyd_setup_tx_list(struct zyd_softc *); +static void zyd_unsetup_tx_list(struct zyd_softc *); static struct ieee80211_node *zyd_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); static int zyd_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -293,7 +293,7 @@ if (uaa->usb2_mode != USB_MODE_HOST) return (ENXIO); - if (uaa->info.bConfigIndex != 0) + if (uaa->info.bConfigIndex != ZYD_CONFIG_INDEX) return (ENXIO); if (uaa->info.bIfaceIndex != ZYD_IFACE_INDEX) return (ENXIO); @@ -306,7 +306,7 @@ { struct usb2_attach_arg *uaa = device_get_ivars(dev); struct zyd_softc *sc = device_get_softc(dev); - int error = ENXIO; + int error; uint8_t iface_index; if (uaa->info.bcdDevice < 0x4330) { @@ -320,9 +320,7 @@ sc->sc_dev = dev; sc->sc_udev = uaa->device; sc->sc_macrev = USB_GET_DRIVER_INFO(uaa); -#ifdef USB_DEBUG - sc->sc_debug = zyd_debug; -#endif + mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -447,19 +445,19 @@ /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); - /* stop all USB transfers first */ + /* stop all USB transfers */ usb2_transfer_unsetup(sc->sc_xfer, ZYD_N_TRANSFER); usb2_proc_free(&sc->sc_tq); + /* free TX list, if any */ + zyd_unsetup_tx_list(sc); + if (ifp) { bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); } - /* free TX list, if any */ - zyd_free_tx_list(sc); - mtx_destroy(&sc->sc_mtx); return (0); @@ -530,17 +528,12 @@ sc->tx_nfree++; } -static int -zyd_alloc_tx_list(struct zyd_softc *sc) +static void +zyd_setup_tx_list(struct zyd_softc *sc) { struct zyd_tx_data *data; int i; - sc->tx_data = malloc(sizeof(struct zyd_tx_data) * ZYD_TX_LIST_CNT, - M_USB, M_NOWAIT|M_ZERO); - if (sc->tx_data == NULL) - return (ENOMEM); - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -552,18 +545,20 @@ STAILQ_INSERT_TAIL(&sc->tx_free, data, next); sc->tx_nfree++; } - return 0; } static void -zyd_free_tx_list(struct zyd_softc *sc) +zyd_unsetup_tx_list(struct zyd_softc *sc) { struct zyd_tx_data *data; int i; - if (sc->tx_data == NULL) - return; + /* make sure any subsequent use of the queues will fail */ + sc->tx_nfree = 0; + STAILQ_INIT(&sc->tx_q); + STAILQ_INIT(&sc->tx_free); + /* free up all node references and mbufs */ for (i = 0; i < ZYD_TX_LIST_CNT; i++) { data = &sc->tx_data[i]; @@ -576,8 +571,6 @@ data->ni = NULL; } } - free(sc->tx_data, M_USB); - sc->tx_data = NULL; } /* ARGUSED */ @@ -1923,13 +1916,11 @@ USETW(req.wIndex, 0); USETW(req.wLength, IEEE80211_ADDR_LEN); - ZYD_LOCK(sc); error = zyd_do_request(sc, &req, sc->sc_bssid); if (error != 0) { device_printf(sc->sc_dev, "could not read EEPROM: %s\n", usb2_errstr(error)); } - ZYD_UNLOCK(sc); return (error); } @@ -2868,10 +2859,7 @@ /* * Allocate Tx and Rx xfer queues. */ - if ((error = zyd_alloc_tx_list(sc)) != 0) { - device_printf(sc->sc_dev, "could not allocate Tx list\n"); - goto fail; - } + zyd_setup_tx_list(sc); /* enable interrupts */ zyd_write32_m(sc, ZYD_CR_INTERRUPT, ZYD_HWINT_MASK); @@ -2917,12 +2905,14 @@ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); /* - * stop all the transfers, if not already stopped: + * Drain all the transfers, if not already drained: */ - usb2_transfer_stop(sc->sc_xfer[ZYD_BULK_WR]); - usb2_transfer_stop(sc->sc_xfer[ZYD_BULK_RD]); + ZYD_UNLOCK(sc); + usb2_transfer_drain(sc->sc_xfer[ZYD_BULK_WR]); + usb2_transfer_drain(sc->sc_xfer[ZYD_BULK_RD]); + ZYD_LOCK(sc); - zyd_free_tx_list(sc); + zyd_unsetup_tx_list(sc); /* Stop now if the device was never set up */ if (!(sc->sc_flags & ZYD_FLAG_INITONCE)) @@ -3063,18 +3053,16 @@ /* want broadcast address while scanning */ zyd_set_bssid(sc, ifp->if_broadcastaddr); break; - case ZYD_SCAN_END: - /* restore previous bssid */ - zyd_set_bssid(sc, sc->sc_bssid); - break; + case ZYD_SET_CHANNEL: zyd_set_chan(sc, ic->ic_curchan); break; - default: - device_printf(sc->sc_dev, "unknown scan action %d\n", - sc->sc_scan_action); + + default: /* ZYD_SCAN_END */ + /* restore previous bssid */ + zyd_set_bssid(sc, sc->sc_bssid); break; - } + } } static void ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#5 (text+ko) ==== @@ -1127,7 +1127,7 @@ uint16_t count; } __packed; -#define ZYD_CONFIG_NO 1 +#define ZYD_CONFIG_INDEX 0 #define ZYD_IFACE_INDEX 0 #define ZYD_INTR_TIMEOUT 1000 @@ -1274,7 +1274,6 @@ #define ZYD_FLAG_INITONCE (1 << 1) #define ZYD_FLAG_INITDONE (1 << 2) int sc_if_flags; - uint32_t sc_debug; struct zyd_task sc_synctask[2]; struct zyd_task sc_mcasttask[2]; @@ -1317,7 +1316,7 @@ struct mtx sc_mtx; struct cv sc_intr_cv; - struct zyd_tx_data *tx_data; + struct zyd_tx_data tx_data[ZYD_TX_LIST_CNT]; zyd_txdhead tx_q; zyd_txdhead tx_free; int tx_nfree; From owner-p4-projects@FreeBSD.ORG Tue Feb 10 15:04:49 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 236B91065678; Tue, 10 Feb 2009 15:04:48 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6B0610656FC for ; Tue, 10 Feb 2009 15:04:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5A3888FC0A for ; Tue, 10 Feb 2009 15:04:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AF4kRB017579 for ; Tue, 10 Feb 2009 15:04:46 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1AF4jfx017577 for perforce@freebsd.org; Tue, 10 Feb 2009 15:04:45 GMT (envelope-from jhb@freebsd.org) Date: Tue, 10 Feb 2009 15:04:45 GMT Message-Id: <200902101504.n1AF4jfx017577@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 157492 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: Tue, 10 Feb 2009 15:04:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=157492 Change 157492 by jhb@jhb_jhbbsd on 2009/02/10 15:04:25 IFC @157486 Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#30 integrate .. //depot/projects/smpng/sys/amd64/conf/DEFAULTS#11 integrate .. //depot/projects/smpng/sys/arm/arm/busdma_machdep.c#28 integrate .. //depot/projects/smpng/sys/cam/cam_periph.c#30 integrate .. //depot/projects/smpng/sys/conf/NOTES#161 integrate .. //depot/projects/smpng/sys/conf/files#227 integrate .. //depot/projects/smpng/sys/conf/options#162 integrate .. //depot/projects/smpng/sys/dev/de/if_de.c#7 integrate .. //depot/projects/smpng/sys/dev/firewire/if_fwe.c#33 integrate .. //depot/projects/smpng/sys/dev/firewire/if_fwip.c#14 integrate .. //depot/projects/smpng/sys/dev/firewire/sbp.c#46 integrate .. //depot/projects/smpng/sys/dev/sound/pci/ds1.c#27 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/at91dci.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/at91dci_atmelarm.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/atmegadci.c#2 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/ehci2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/ehci2.h#4 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/ehci2_ixp4xx.c#1 branch .. //depot/projects/smpng/sys/dev/usb2/controller/ehci2_mbus.c#1 branch .. //depot/projects/smpng/sys/dev/usb2/controller/ehci2_pci.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/musb2_otg.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/ohci2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/uhci2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/usb2_controller.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/controller/uss820dci.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_config_td.c#3 delete .. //depot/projects/smpng/sys/dev/usb2/core/usb2_config_td.h#3 delete .. //depot/projects/smpng/sys/dev/usb2/core/usb2_core.h#4 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_device.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_hub.c#6 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_msctest.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_process.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_process.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_request.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_request.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_transfer.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_util.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/core/usb2_util.h#2 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_aue2.c#6 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_auereg.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_axe2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_axereg.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_cdce2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_cdcereg.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_cue2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_cuereg.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_kue2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_kuereg.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_rue2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_ruereg.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_udav2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_udavreg.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/usb2_ethernet.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/usb2_ethernet.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/include/usb2_cdc.h#2 integrate .. //depot/projects/smpng/sys/dev/usb2/misc/ufm2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/u3g2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/uark2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/ubsa2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/ubser2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/uchcom2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/ucycom2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/ufoma2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/uftdi2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/ugensa2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/uipaq2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/ulpt2.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/umct2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/umodem2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/umoscom2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/uplcom2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/usb2_serial.c#3 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/usb2_serial.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/uslcom2.c#1 branch .. //depot/projects/smpng/sys/dev/usb2/serial/uvisor2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/serial/uvscom2.c#4 integrate .. //depot/projects/smpng/sys/dev/usb2/sound/uaudio2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/storage/umass2.c#6 integrate .. //depot/projects/smpng/sys/dev/usb2/template/usb2_template_cdce.c#2 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_rum2.c#6 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_rumreg.h#2 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_rumvar.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_ural2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_uralreg.h#2 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_uralvar.h#3 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_zyd2.c#5 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_zydfw.h#2 integrate .. //depot/projects/smpng/sys/dev/usb2/wlan/if_zydreg.h#3 integrate .. //depot/projects/smpng/sys/fs/udf/ecma167-udf.h#8 integrate .. //depot/projects/smpng/sys/fs/udf/udf_vfsops.c#43 integrate .. //depot/projects/smpng/sys/fs/udf/udf_vnops.c#46 integrate .. //depot/projects/smpng/sys/geom/part/g_part_apm.c#7 integrate .. //depot/projects/smpng/sys/geom/part/g_part_gpt.c#9 integrate .. //depot/projects/smpng/sys/geom/part/g_part_pc98.c#7 integrate .. //depot/projects/smpng/sys/geom/part/g_part_vtoc8.c#6 integrate .. //depot/projects/smpng/sys/i386/conf/DEFAULTS#13 integrate .. //depot/projects/smpng/sys/i386/i386/busdma_machdep.c#49 integrate .. //depot/projects/smpng/sys/kern/uipc_debug.c#7 integrate .. //depot/projects/smpng/sys/mips/include/pmap.h#4 integrate .. //depot/projects/smpng/sys/modules/usb2/Makefile#5 integrate .. //depot/projects/smpng/sys/modules/usb2/core/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/usb2/serial_slcom/Makefile#1 branch .. //depot/projects/smpng/sys/net80211/ieee80211_regdomain.c#7 integrate .. //depot/projects/smpng/sys/netinet/sctp_uio.h#17 integrate .. //depot/projects/smpng/sys/pci/if_rl.c#76 integrate Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#30 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.87 2009/02/08 22:54:58 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.88 2009/02/09 18:03:31 cognet Exp $"); #include #include @@ -93,6 +93,7 @@ int active_bpages; int total_bounced; int total_deferred; + int map_count; bus_size_t alignment; bus_size_t boundary; bus_addr_t lowaddr; @@ -418,7 +419,7 @@ else maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (dmat->map_count > 0 && bz->total_bpages < maxpages)) { + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = MAX(atop(dmat->maxsize), 1); @@ -434,6 +435,7 @@ error = 0; } } + bz->map_count++; } else { *mapp = NULL; } @@ -457,6 +459,8 @@ __func__, dmat, EBUSY); return (EBUSY); } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; free(map, M_DEVBUF); } dmat->map_count--; @@ -989,6 +993,7 @@ bz->lowaddr = dmat->lowaddr; bz->alignment = dmat->alignment; bz->boundary = dmat->boundary; + bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); ==== //depot/projects/smpng/sys/amd64/conf/DEFAULTS#11 (text+ko) ==== @@ -1,7 +1,7 @@ # # DEFAULTS -- Default kernel configuration file for FreeBSD/amd64 # -# $FreeBSD: src/sys/amd64/conf/DEFAULTS,v 1.14 2008/12/17 17:43:22 marcel Exp $ +# $FreeBSD: src/sys/amd64/conf/DEFAULTS,v 1.15 2009/02/10 00:08:39 marcel Exp $ machine amd64 @@ -17,4 +17,5 @@ # Default partitioning schemes options GEOM_PART_BSD +options GEOM_PART_EBR options GEOM_PART_MBR ==== //depot/projects/smpng/sys/arm/arm/busdma_machdep.c#28 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.43 2009/02/08 22:54:58 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.44 2009/02/09 18:03:31 cognet Exp $"); /* * ARM bus dma support routines @@ -112,6 +112,7 @@ int active_bpages; int total_bounced; int total_deferred; + int map_count; bus_size_t alignment; bus_size_t boundary; bus_addr_t lowaddr; @@ -523,7 +524,7 @@ */ maxpages = MAX_BPAGES; if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (dmat->map_count > 0 && bz->total_bpages < maxpages)) { + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = MAX(atop(dmat->maxsize), 1); @@ -539,6 +540,7 @@ error = 0; } } + bz->map_count++; } CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, error); @@ -560,6 +562,8 @@ __func__, dmat, EBUSY); return (EBUSY); } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); @@ -1277,6 +1281,7 @@ bz->lowaddr = dmat->lowaddr; bz->alignment = dmat->alignment; bz->boundary = dmat->boundary; + bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); ==== //depot/projects/smpng/sys/cam/cam_periph.c#30 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.76 2009/01/26 15:01:47 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.77 2009/02/09 17:02:54 fjoe Exp $"); #include #include @@ -171,7 +171,7 @@ break; } xpt_unlock_buses(); - if (p_drv == NULL) { + if (*p_drv == NULL) { printf("cam_periph_alloc: invalid periph name '%s'\n", name); return (CAM_REQ_INVALID); } ==== //depot/projects/smpng/sys/conf/NOTES#161 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1527 2009/02/08 12:33:05 wkoszek Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1528 2009/02/10 00:08:39 marcel Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -147,6 +147,7 @@ options GEOM_NOP # Test class. options GEOM_PART_APM # Apple partitioning options GEOM_PART_BSD # BSD disklabel +options GEOM_PART_EBR # Extended Boot Records options GEOM_PART_GPT # GPT partitioning options GEOM_PART_MBR # MBR partitioning options GEOM_PART_PC98 # PC-9800 disk partitioning ==== //depot/projects/smpng/sys/conf/files#227 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1367 2009/02/08 14:43:20 wkoszek Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1369 2009/02/09 22:38:55 thompsa Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1567,7 +1567,6 @@ # dev/usb2/core/usb2_busdma.c optional usb2_core dev/usb2/core/usb2_compat_linux.c optional usb2_core -dev/usb2/core/usb2_config_td.c optional usb2_core dev/usb2/core/usb2_core.c optional usb2_core dev/usb2/core/usb2_debug.c optional usb2_core dev/usb2/core/usb2_dev.c optional usb2_core @@ -1624,6 +1623,7 @@ dev/usb2/serial/umodem2.c optional usb2_core usb2_serial usb2_serial_modem dev/usb2/serial/umoscom2.c optional usb2_core usb2_serial usb2_serial_moscom dev/usb2/serial/uplcom2.c optional usb2_core usb2_serial usb2_serial_plcom +dev/usb2/serial/uslcom2.c optional usb2_core usb2_serial usb2_serial_slcom dev/usb2/serial/usb2_serial.c optional usb2_core usb2_serial dev/usb2/serial/uvisor2.c optional usb2_core usb2_serial usb2_serial_visor dev/usb2/serial/uvscom2.c optional usb2_core usb2_serial usb2_serial_vscom ==== //depot/projects/smpng/sys/conf/options#162 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.660 2009/02/06 10:30:46 wkoszek Exp $ +# $FreeBSD: src/sys/conf/options,v 1.661 2009/02/10 00:08:39 marcel Exp $ # # On the handling of kernel options # @@ -92,6 +92,7 @@ GEOM_NOP opt_geom.h GEOM_PART_APM opt_geom.h GEOM_PART_BSD opt_geom.h +GEOM_PART_EBR opt_geom.h GEOM_PART_GPT opt_geom.h GEOM_PART_MBR opt_geom.h GEOM_PART_PC98 opt_geom.h ==== //depot/projects/smpng/sys/dev/de/if_de.c#7 (text) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/de/if_de.c,v 1.184 2008/04/05 17:24:44 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/de/if_de.c,v 1.185 2009/02/09 17:07:29 fjoe Exp $"); #define TULIP_HDR_DATA @@ -4561,7 +4561,7 @@ sc->tulip_setup_dma_addr = 0; } if (sc->tulip_setupbuf != NULL) { - bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupdata, + bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf, sc->tulip_setup_map); sc->tulip_setup_map = NULL; sc->tulip_setupbuf = NULL; ==== //depot/projects/smpng/sys/dev/firewire/if_fwe.c#33 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/if_fwe.c,v 1.45 2008/03/25 09:38:58 ru Exp $ + * $FreeBSD: src/sys/dev/firewire/if_fwe.c,v 1.46 2009/02/09 16:58:18 fjoe Exp $ */ #ifdef HAVE_KERNEL_OPTION_HEADERS @@ -445,7 +445,7 @@ #ifdef DEVICE_POLLING { struct ifreq *ifr = (struct ifreq *) data; - struct firewire_comm *fc = fc = fwe->fd.fc; + struct firewire_comm *fc = fwe->fd.fc; if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { ==== //depot/projects/smpng/sys/dev/firewire/if_fwip.c#14 (text+ko) ==== @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/if_fwip.c,v 1.17 2008/03/25 09:38:58 ru Exp $ + * $FreeBSD: src/sys/dev/firewire/if_fwip.c,v 1.18 2009/02/09 16:58:18 fjoe Exp $ */ #ifdef HAVE_KERNEL_OPTION_HEADERS @@ -427,7 +427,7 @@ #ifdef DEVICE_POLLING { struct ifreq *ifr = (struct ifreq *) data; - struct firewire_comm *fc = fc = fwip->fd.fc; + struct firewire_comm *fc = fwip->fd.fc; if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { ==== //depot/projects/smpng/sys/dev/firewire/sbp.c#46 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/sbp.c,v 1.98 2009/02/01 23:28:52 sbruno Exp $ + * $FreeBSD: src/sys/dev/firewire/sbp.c,v 1.99 2009/02/09 16:57:07 fjoe Exp $ * */ @@ -330,12 +330,11 @@ static void sbp_identify(driver_t *driver, device_t parent) { - device_t child; SBP_DEBUG(0) printf("sbp_identify\n"); END_DEBUG - child = BUS_ADD_CHILD(parent, 0, "sbp", device_get_unit(parent)); + BUS_ADD_CHILD(parent, 0, "sbp", device_get_unit(parent)); } /* ==== //depot/projects/smpng/sys/dev/sound/pci/ds1.c#27 (text+ko) ==== @@ -33,7 +33,7 @@ #include #include -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.52 2007/06/17 06:10:41 ariff Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.53 2009/02/09 22:59:22 cognet Exp $"); /* -------------------------------------------------------------------- */ @@ -396,7 +396,7 @@ pb->Format |= b16? 0 : 0x80000000; pb->Format |= (stereo && (ch == 2 || ch == 4))? 0x00000001 : 0; pb->LoopDefault = 0; - pb->PgBase = base? base : 0; + pb->PgBase = base; pb->PgLoop = 0; pb->PgLoopEnd = len >> ss; pb->PgLoopFrac = 0; ==== //depot/projects/smpng/sys/dev/usb2/controller/at91dci.c#3 (text+ko) ==== @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/at91dci.c,v 1.11 2009/01/13 19:05:51 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/at91dci.c,v 1.12 2009/02/09 21:47:39 thompsa Exp $"); /*- * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. @@ -275,7 +275,7 @@ DELAY(8000); } else { /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 8); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); } AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, 0); @@ -1395,7 +1395,7 @@ (sc->sc_clocks_on) (sc->sc_clocks_arg); } /* wait a little for things to stabilise */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* disable and clear all interrupts */ ==== //depot/projects/smpng/sys/dev/usb2/controller/at91dci_atmelarm.c#4 (text+ko) ==== @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/at91dci_atmelarm.c,v 1.8 2009/02/01 00:51:25 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/at91dci_atmelarm.c,v 1.9 2009/02/09 21:47:39 thompsa Exp $"); /*- * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. @@ -168,7 +168,7 @@ at91_udp_pull_down(sc); /* wait 10ms for pulldown to stabilise */ - usb2_pause_mtx(NULL, 10); + usb2_pause_mtx(NULL, hz / 100); sc->sc_iclk = at91_pmc_clock_ref("udc_clk"); sc->sc_fclk = at91_pmc_clock_ref("udpck"); ==== //depot/projects/smpng/sys/dev/usb2/controller/atmegadci.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/atmegadci.c,v 1.1 2009/01/13 18:49:35 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/atmegadci.c,v 1.2 2009/02/09 21:47:39 thompsa Exp $"); /*- * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. @@ -221,7 +221,7 @@ DELAY(8000); } else { /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 8); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); } /* hardware should have cleared RMWKUP bit */ @@ -1253,7 +1253,7 @@ (sc->sc_clocks_on) (&sc->sc_bus); /* wait a little for things to stabilise */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* enable interrupts */ ATMEGA_WRITE_1(sc, ATMEGA_UDIEN, ==== //depot/projects/smpng/sys/dev/usb2/controller/ehci2.c#5 (text+ko) ==== @@ -44,7 +44,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ehci2.c,v 1.11 2009/02/08 21:08:00 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ehci2.c,v 1.12 2009/02/09 21:47:39 thompsa Exp $"); #include #include @@ -177,7 +177,7 @@ EOWRITE4(sc, EHCI_USBCMD, 0); /* Halt controller */ for (n = 0; n != 100; n++) { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); hcr = EOREAD4(sc, EHCI_USBSTS); if (hcr & EHCI_STS_HCH) { hcr = 0; @@ -193,7 +193,7 @@ EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET); for (n = 0; n != 100; n++) { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); hcr = EOREAD4(sc, EHCI_USBCMD); if (!(hcr & EHCI_CMD_HCRESET)) { if (sc->sc_flags & EHCI_SCFLG_SETMODE) @@ -478,7 +478,7 @@ EOWRITE4(sc, EHCI_CONFIGFLAG, EHCI_CONF_CF); for (i = 0; i < 100; i++) { - usb2_pause_mtx(NULL, 1); + usb2_pause_mtx(NULL, hz / 1000); hcr = EOREAD4(sc, EHCI_USBSTS) & EHCI_STS_HCH; if (!hcr) { break; @@ -511,11 +511,12 @@ if (ehci_hc_reset(sc)) { DPRINTF("reset failed!\n"); } - /* XXX let stray task complete */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 50); USB_BUS_UNLOCK(&sc->sc_bus); + /* XXX let stray task complete */ + usb2_pause_mtx(NULL, hz / 20); + usb2_callout_drain(&sc->sc_tmo_pcd); } @@ -549,7 +550,7 @@ if (hcr == 0) { break; } - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); } if (hcr != 0) { @@ -563,7 +564,7 @@ if (hcr == EHCI_STS_HCH) { break; } - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); } if (hcr != EHCI_STS_HCH) { @@ -607,7 +608,7 @@ if (hcr) { usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_RESUME_WAIT); + USB_MS_TO_TICKS(USB_RESUME_WAIT)); for (i = 1; i <= sc->sc_noport; i++) { cmd = EOREAD4(sc, EHCI_PORTSC(i)); @@ -625,16 +626,17 @@ if (hcr != EHCI_STS_HCH) { break; } - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); } if (hcr == EHCI_STS_HCH) { device_printf(sc->sc_bus.bdev, "config timeout\n"); } - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_RESUME_WAIT); USB_BUS_UNLOCK(&sc->sc_bus); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(USB_RESUME_WAIT)); + /* catch any lost interrupts */ ehci_do_poll(&sc->sc_bus); } @@ -1140,6 +1142,9 @@ td = xfer->td_transfer_cache; td_alt_next = td->alt_next; + if (xfer->aframes != xfer->nframes) { + xfer->frlengths[xfer->aframes] = 0; + } while (1) { usb2_pc_cpu_invalidate(td->page_cache); @@ -1148,8 +1153,8 @@ len = EHCI_QTD_GET_BYTES(status); /* - * Verify the status length and subtract - * the remainder from "frlengths[]": + * Verify the status length and + * add the length to "frlengths[]": */ if (len > td->len) { /* should not happen */ @@ -1157,7 +1162,7 @@ "0x%04x/0x%04x bytes\n", len, td->len); status |= EHCI_QTD_HALTED; } else if (xfer->aframes != xfer->nframes) { - xfer->frlengths[xfer->aframes] -= len; + xfer->frlengths[xfer->aframes] += td->len - len; } /* Check for last transfer */ if (((void *)td) == xfer->td_transfer_last) { @@ -3214,9 +3219,9 @@ /* wait 20ms for resume sequence to complete */ if (use_polling) { /* polling */ - DELAY(20 * 1000); + DELAY(20000); } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 20); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); } EOWRITE4(sc, port, v & ~(EHCI_PS_SUSP | @@ -3225,9 +3230,9 @@ /* settle time */ if (use_polling) { /* polling */ - DELAY(4 * 1000); + DELAY(4000); } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 4); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250); } break; case UHF_PORT_POWER: @@ -3383,7 +3388,7 @@ } else { /* Wait for reset to complete. */ usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_PORT_ROOT_RESET_DELAY); + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); } /* Terminate reset sequence. */ @@ -3396,7 +3401,7 @@ } else { /* Wait for HC to complete reset. */ usb2_pause_mtx(&sc->sc_bus.bus_mtx, - EHCI_PORT_RESET_COMPLETE); + USB_MS_TO_TICKS(EHCI_PORT_RESET_COMPLETE)); } v = EOREAD4(sc, port); ==== //depot/projects/smpng/sys/dev/usb2/controller/ehci2.h#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/controller/ehci2.h,v 1.5 2009/01/13 19:03:01 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/controller/ehci2.h,v 1.6 2009/02/09 21:47:39 thompsa Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -468,7 +468,6 @@ struct ehci_sitd *sc_isoc_fs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]; struct ehci_itd *sc_isoc_hs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]; void *sc_intr_hdl; - device_t sc_dev; bus_size_t sc_io_size; bus_space_tag_t sc_io_tag; bus_space_handle_t sc_io_hdl; ==== //depot/projects/smpng/sys/dev/usb2/controller/ehci2_pci.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ehci2_pci.c,v 1.8 2009/02/01 00:51:25 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ehci2_pci.c,v 1.9 2009/02/09 21:47:39 thompsa Exp $"); /* * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller. @@ -237,7 +237,6 @@ USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { return (ENOMEM); } - sc->sc_dev = self; pci_enable_busmaster(self); @@ -456,7 +455,7 @@ "timed out waiting for BIOS\n"); break; } - usb2_pause_mtx(NULL, 10); /* wait 10ms */ + usb2_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } } ==== //depot/projects/smpng/sys/dev/usb2/controller/musb2_otg.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/controller/musb2_otg.c,v 1.10 2009/01/13 19:03:33 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/controller/musb2_otg.c,v 1.11 2009/02/09 21:47:39 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -223,7 +223,7 @@ DELAY(8000); } else { /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 8); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); } temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); @@ -1708,7 +1708,7 @@ (sc->sc_clocks_on) (sc->sc_clocks_arg); } /* wait a little for things to stabilise */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* disable all interrupts */ @@ -1721,7 +1721,7 @@ musbotg_pull_common(sc, 0); /* wait a little bit (10ms) */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 10); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); /* disable double packet buffering */ MUSB2_WRITE_2(sc, MUSB2_REG_RXDBDIS, 0xFFFF); ==== //depot/projects/smpng/sys/dev/usb2/controller/ohci2.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ohci2.c,v 1.9 2009/02/07 06:27:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ohci2.c,v 1.10 2009/02/09 21:47:39 thompsa Exp $"); /* * USB Open Host Controller driver. @@ -168,7 +168,7 @@ DPRINTF("SMM active, request owner change\n"); OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_OCR); for (i = 0; (i < 100) && (ctl & OHCI_IR); i++) { - usb2_pause_mtx(NULL, 1); + usb2_pause_mtx(NULL, hz / 1000); ctl = OREAD4(sc, OHCI_CONTROL); } if (ctl & OHCI_IR) { @@ -181,7 +181,8 @@ DPRINTF("cold started\n"); reset: /* controller was cold started */ - usb2_pause_mtx(NULL, USB_BUS_RESET_DELAY); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); } /* @@ -191,7 +192,8 @@ DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); - usb2_pause_mtx(NULL, USB_BUS_RESET_DELAY); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); /* we now own the host controller and the bus has been reset */ ival = OHCI_GET_IVAL(OREAD4(sc, OHCI_FM_INTERVAL)); @@ -253,7 +255,8 @@ desca = OREAD4(sc, OHCI_RH_DESCRIPTOR_A); OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca | OHCI_NOCP); OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */ - usb2_pause_mtx(NULL, OHCI_ENABLE_POWER_DELAY); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(OHCI_ENABLE_POWER_DELAY)); OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca); /* @@ -262,7 +265,8 @@ */ sc->sc_noport = 0; for (i = 0; (i < 10) && (sc->sc_noport == 0); i++) { - usb2_pause_mtx(NULL, OHCI_READ_DESC_DELAY); + usb2_pause_mtx(NULL, + USB_MS_TO_TICKS(OHCI_READ_DESC_DELAY)); sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A)); } @@ -417,11 +421,11 @@ OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS); OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); + USB_BUS_UNLOCK(&sc->sc_bus); + /* XXX let stray task complete */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 50); + usb2_pause_mtx(NULL, hz / 20); - USB_BUS_UNLOCK(&sc->sc_bus); - usb2_callout_drain(&sc->sc_tmo_rhsc); } @@ -455,7 +459,7 @@ OWRITE4(sc, OHCI_CONTROL, ctl); usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_RESUME_WAIT); + USB_MS_TO_TICKS(USB_RESUME_WAIT)); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -485,10 +489,12 @@ ctl = OREAD4(sc, OHCI_CONTROL); ctl |= OHCI_HCFS_RESUME; OWRITE4(sc, OHCI_CONTROL, ctl); - usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_DELAY); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_RESUME_DELAY)); ctl = (ctl & ~OHCI_HCFS_MASK) | OHCI_HCFS_OPERATIONAL; OWRITE4(sc, OHCI_CONTROL, ctl); - usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_RECOVERY); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_RESUME_RECOVERY)); sc->sc_control = sc->sc_intre = 0; USB_BUS_UNLOCK(&sc->sc_bus); @@ -827,6 +833,9 @@ td_alt_next = td->alt_next; td_flags = 0; + if (xfer->aframes != xfer->nframes) { + xfer->frlengths[xfer->aframes] = 0; + } while (1) { usb2_pc_cpu_invalidate(td->page_cache); @@ -850,10 +859,15 @@ cc = OHCI_CC_STALL; } else if (xfer->aframes != xfer->nframes) { /* - * subtract remaining length from - * "frlengths[]" + * Sum up total transfer length + * in "frlengths[]": */ - xfer->frlengths[xfer->aframes] -= temp; + xfer->frlengths[xfer->aframes] += td->len - temp; + } + } else { + if (xfer->aframes != xfer->nframes) { + /* transfer was complete */ + xfer->frlengths[xfer->aframes] += td->len; } } /* Check for last transfer */ @@ -2401,7 +2415,7 @@ DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); } else { usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_PORT_ROOT_RESET_DELAY); + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); } if ((OREAD4(sc, port) & UPS_RESET) == 0) { ==== //depot/projects/smpng/sys/dev/usb2/controller/uhci2.c#5 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/uhci2.c,v 1.11 2009/02/07 06:27:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/uhci2.c,v 1.12 2009/02/09 21:47:39 thompsa Exp $"); /* * USB Universal Host Controller driver. @@ -271,7 +271,7 @@ /* wait */ usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_BUS_RESET_DELAY); + USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); /* terminate all transfers */ @@ -283,7 +283,7 @@ while (n--) { /* wait one millisecond */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); if (!(UREAD2(sc, UHCI_CMD) & UHCI_CMD_HCRESET)) { goto done_1; @@ -299,7 +299,7 @@ while (n--) { /* wait one millisecond */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* check if HC is stopped */ if (UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) { @@ -345,7 +345,7 @@ while (n--) { /* wait one millisecond */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 1); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* check that controller has started */ @@ -636,7 +636,8 @@ UHCICMD(sc, UHCI_CMD_EGSM); - usb2_pause_mtx(&sc->sc_bus.bus_mtx, USB_RESUME_WAIT); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_RESUME_WAIT)); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -655,7 +656,7 @@ UHCICMD(sc, UHCI_CMD_FGR); usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_RESUME_DELAY); + USB_MS_TO_TICKS(USB_RESUME_DELAY)); /* and start traffic again */ @@ -2408,7 +2409,7 @@ if (use_polling) { DELAY(10000); } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 10); + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); } } @@ -2420,7 +2421,7 @@ DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); } else { usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_PORT_ROOT_RESET_DELAY); + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); } DPRINTFN(4, "uhci port %d reset, status0 = 0x%04x\n", @@ -2453,7 +2454,7 @@ DELAY(USB_PORT_RESET_DELAY * 1000); } else { usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_PORT_RESET_DELAY); + USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); } x = UREAD2(sc, port); @@ -2780,9 +2781,9 @@ /* wait 20ms for resume sequence to complete */ if (use_polling) { /* polling */ - DELAY(20 * 1000); + DELAY(20000); } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, 20); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Feb 10 16:15:07 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A7D4D1065670; Tue, 10 Feb 2009 16:15:06 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6383F106566B for ; Tue, 10 Feb 2009 16:15:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4F22A8FC08 for ; Tue, 10 Feb 2009 16:15:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AGF6dE023762 for ; Tue, 10 Feb 2009 16:15:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1AGF5nj023760 for perforce@freebsd.org; Tue, 10 Feb 2009 16:15:05 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 10 Feb 2009 16:15:05 GMT Message-Id: <200902101615.n1AGF5nj023760@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157496 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: Tue, 10 Feb 2009 16:15:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=157496 Change 157496 by hselasky@hselasky_laptop001 on 2009/02/10 16:14:20 IFC @ 157495 Affected files ... .. //depot/projects/usb/src/sys/amd64/amd64/busdma_machdep.c#12 integrate .. //depot/projects/usb/src/sys/amd64/conf/DEFAULTS#8 integrate .. //depot/projects/usb/src/sys/arm/arm/busdma_machdep.c#16 integrate .. //depot/projects/usb/src/sys/cam/cam_periph.c#8 integrate .. //depot/projects/usb/src/sys/cam/cam_xpt.c#14 integrate .. //depot/projects/usb/src/sys/conf/NOTES#28 integrate .. //depot/projects/usb/src/sys/conf/files#52 integrate .. //depot/projects/usb/src/sys/conf/options#21 integrate .. //depot/projects/usb/src/sys/dev/cfi/cfi_core.c#3 integrate .. //depot/projects/usb/src/sys/dev/de/if_de.c#6 integrate .. //depot/projects/usb/src/sys/dev/firewire/if_fwe.c#5 integrate .. //depot/projects/usb/src/sys/dev/firewire/if_fwip.c#7 integrate .. //depot/projects/usb/src/sys/dev/firewire/sbp.c#7 integrate .. //depot/projects/usb/src/sys/dev/re/if_re.c#14 integrate .. //depot/projects/usb/src/sys/dev/sound/pci/ds1.c#4 integrate .. //depot/projects/usb/src/sys/dev/syscons/scterm-teken.c#2 integrate .. //depot/projects/usb/src/sys/dev/syscons/teken/teken.c#4 integrate .. //depot/projects/usb/src/sys/dev/syscons/teken/teken.h#4 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/at91dci.c#27 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/at91dci_atmelarm.c#21 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.c#33 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.h#15 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/ehci2_pci.c#25 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg.c#26 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/ohci2.c#30 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#29 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.c#26 integrate .. //depot/projects/usb/src/sys/dev/usb2/controller/uss820dci.c#23 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_busdma.c#20 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_core.h#35 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#52 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_hub.c#38 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_msctest.c#18 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.c#18 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.h#9 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.c#33 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.h#11 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#42 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_util.c#12 integrate .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_util.h#8 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_aue2.c#22 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_auereg.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_axe2.c#22 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_axereg.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_cdce2.c#20 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_cdcereg.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_cue2.c#21 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_cuereg.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_kue2.c#21 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_kuereg.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_rue2.c#21 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_ruereg.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_udav2.c#21 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/if_udavreg.h#5 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/usb2_ethernet.c#12 integrate .. //depot/projects/usb/src/sys/dev/usb2/ethernet/usb2_ethernet.h#10 integrate .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_cdc.h#8 integrate .. //depot/projects/usb/src/sys/dev/usb2/misc/ufm2.c#12 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/u3g2.c#12 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/uark2.c#17 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/ubsa2.c#23 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/ubser2.c#17 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/uchcom2.c#20 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/ucycom2.c#18 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/ufoma2.c#23 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/uftdi2.c#21 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/ugensa2.c#24 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/uipaq2.c#20 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/ulpt2.c#16 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/umct2.c#17 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/umodem2.c#20 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/umoscom2.c#18 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/uplcom2.c#20 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/usb2_serial.c#28 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/usb2_serial.h#16 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/uvisor2.c#18 integrate .. //depot/projects/usb/src/sys/dev/usb2/serial/uvscom2.c#20 integrate .. //depot/projects/usb/src/sys/dev/usb2/sound/uaudio2.c#29 integrate .. //depot/projects/usb/src/sys/dev/usb2/storage/umass2.c#28 integrate .. //depot/projects/usb/src/sys/dev/usb2/template/usb2_template_cdce.c#11 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#30 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumreg.h#3 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#7 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#30 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralreg.h#3 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#7 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#32 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydfw.h#3 integrate .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#6 integrate .. //depot/projects/usb/src/sys/fs/tmpfs/tmpfs.h#6 integrate .. //depot/projects/usb/src/sys/fs/tmpfs/tmpfs_subr.c#8 integrate .. //depot/projects/usb/src/sys/fs/tmpfs/tmpfs_vnops.c#7 integrate .. //depot/projects/usb/src/sys/fs/udf/ecma167-udf.h#4 integrate .. //depot/projects/usb/src/sys/fs/udf/udf_vfsops.c#9 integrate .. //depot/projects/usb/src/sys/fs/udf/udf_vnops.c#11 integrate .. //depot/projects/usb/src/sys/geom/part/g_part.c#13 integrate .. //depot/projects/usb/src/sys/geom/part/g_part_apm.c#10 integrate .. //depot/projects/usb/src/sys/geom/part/g_part_ebr.c#1 branch .. //depot/projects/usb/src/sys/geom/part/g_part_gpt.c#11 integrate .. //depot/projects/usb/src/sys/geom/part/g_part_mbr.c#7 integrate .. //depot/projects/usb/src/sys/geom/part/g_part_pc98.c#7 integrate .. //depot/projects/usb/src/sys/geom/part/g_part_vtoc8.c#6 integrate .. //depot/projects/usb/src/sys/i386/conf/DEFAULTS#9 integrate .. //depot/projects/usb/src/sys/i386/conf/NOTES#17 integrate .. //depot/projects/usb/src/sys/i386/i386/busdma_machdep.c#15 integrate .. //depot/projects/usb/src/sys/i386/xen/pmap.c#4 integrate .. //depot/projects/usb/src/sys/ia64/ia64/busdma_machdep.c#11 integrate .. //depot/projects/usb/src/sys/kern/kern_linker.c#13 integrate .. //depot/projects/usb/src/sys/kern/link_elf.c#11 integrate .. //depot/projects/usb/src/sys/kern/link_elf_obj.c#11 integrate .. //depot/projects/usb/src/sys/kern/subr_clist.c#5 integrate .. //depot/projects/usb/src/sys/kern/uipc_debug.c#6 integrate .. //depot/projects/usb/src/sys/mips/include/pmap.h#4 integrate .. //depot/projects/usb/src/sys/mips/mips/in_cksum.c#3 integrate .. //depot/projects/usb/src/sys/modules/geom/geom_part/Makefile#2 integrate .. //depot/projects/usb/src/sys/modules/geom/geom_part/geom_part_ebr/Makefile#1 branch .. //depot/projects/usb/src/sys/modules/usb2/Makefile#12 integrate .. //depot/projects/usb/src/sys/modules/usb2/core/Makefile#13 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_output.c#16 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_regdomain.c#8 integrate .. //depot/projects/usb/src/sys/netinet/sctp_crc32.c#6 integrate .. //depot/projects/usb/src/sys/netinet/sctp_uio.h#12 integrate .. //depot/projects/usb/src/sys/netinet/sctputil.c#16 integrate .. //depot/projects/usb/src/sys/nfsserver/nfs_syscalls.c#10 integrate .. //depot/projects/usb/src/sys/pci/if_rl.c#10 integrate .. //depot/projects/usb/src/sys/security/audit/audit_bsm.c#13 integrate .. //depot/projects/usb/src/sys/security/audit/audit_bsm_klib.c#12 integrate .. //depot/projects/usb/src/sys/security/audit/audit_pipe.c#13 integrate .. //depot/projects/usb/src/sys/security/audit/audit_private.h#9 integrate .. //depot/projects/usb/src/sys/sys/bus_dma.h#9 integrate .. //depot/projects/usb/src/sys/vm/vm_fault.c#9 integrate .. //depot/projects/usb/src/sys/vm/vm_kern.c#9 integrate .. //depot/projects/usb/src/sys/vm/vm_map.c#12 integrate .. //depot/projects/usb/src/sys/vm/vm_map.h#7 integrate .. //depot/projects/usb/src/sys/vm/vm_mmap.c#14 integrate .. //depot/projects/usb/src/sys/vm/vm_object.c#13 integrate .. //depot/projects/usb/src/sys/vm/vm_object.h#6 integrate .. //depot/projects/usb/src/sys/vm/vm_unix.c#2 integrate .. //depot/projects/usb/src/sys/vm/vnode_pager.c#12 integrate .. //depot/projects/usb/src/sys/vm/vnode_pager.h#2 integrate Differences ... ==== //depot/projects/usb/src/sys/amd64/amd64/busdma_machdep.c#12 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.86 2008/07/15 03:34:49 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.88 2009/02/09 18:03:31 cognet Exp $"); #include #include @@ -93,6 +93,7 @@ int active_bpages; int total_bounced; int total_deferred; + int map_count; bus_size_t alignment; bus_size_t boundary; bus_addr_t lowaddr; @@ -418,7 +419,7 @@ else maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (dmat->map_count > 0 && bz->total_bpages < maxpages)) { + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = MAX(atop(dmat->maxsize), 1); @@ -434,6 +435,7 @@ error = 0; } } + bz->map_count++; } else { *mapp = NULL; } @@ -457,6 +459,8 @@ __func__, dmat, EBUSY); return (EBUSY); } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; free(map, M_DEVBUF); } dmat->map_count--; @@ -989,6 +993,7 @@ bz->lowaddr = dmat->lowaddr; bz->alignment = dmat->alignment; bz->boundary = dmat->boundary; + bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); ==== //depot/projects/usb/src/sys/amd64/conf/DEFAULTS#8 (text+ko) ==== @@ -1,7 +1,7 @@ # # DEFAULTS -- Default kernel configuration file for FreeBSD/amd64 # -# $FreeBSD: src/sys/amd64/conf/DEFAULTS,v 1.14 2008/12/17 17:43:22 marcel Exp $ +# $FreeBSD: src/sys/amd64/conf/DEFAULTS,v 1.15 2009/02/10 00:08:39 marcel Exp $ machine amd64 @@ -17,4 +17,5 @@ # Default partitioning schemes options GEOM_PART_BSD +options GEOM_PART_EBR options GEOM_PART_MBR ==== //depot/projects/usb/src/sys/arm/arm/busdma_machdep.c#16 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.42 2009/02/04 01:14:06 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.44 2009/02/09 18:03:31 cognet Exp $"); /* * ARM bus dma support routines @@ -112,6 +112,7 @@ int active_bpages; int total_bounced; int total_deferred; + int map_count; bus_size_t alignment; bus_size_t boundary; bus_addr_t lowaddr; @@ -523,7 +524,7 @@ */ maxpages = MAX_BPAGES; if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (dmat->map_count > 0 && bz->total_bpages < maxpages)) { + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = MAX(atop(dmat->maxsize), 1); @@ -539,6 +540,7 @@ error = 0; } } + bz->map_count++; } CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, error); @@ -560,6 +562,8 @@ __func__, dmat, EBUSY); return (EBUSY); } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); @@ -1277,6 +1281,7 @@ bz->lowaddr = dmat->lowaddr; bz->alignment = dmat->alignment; bz->boundary = dmat->boundary; + bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); ==== //depot/projects/usb/src/sys/cam/cam_periph.c#8 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.76 2009/01/26 15:01:47 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.77 2009/02/09 17:02:54 fjoe Exp $"); #include #include @@ -171,7 +171,7 @@ break; } xpt_unlock_buses(); - if (p_drv == NULL) { + if (*p_drv == NULL) { printf("cam_periph_alloc: invalid periph name '%s'\n", name); return (CAM_REQ_INVALID); } ==== //depot/projects/usb/src/sys/cam/cam_xpt.c#14 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.208 2009/01/23 21:08:00 trasz Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.209 2009/02/08 22:08:48 trasz Exp $"); #include #include @@ -4178,7 +4178,7 @@ struct sbuf sb; #ifdef INVARIANTS - if (path != NULL && path->bus != NULL && path->bus->sim != NULL) + if (path != NULL && path->bus != NULL) mtx_assert(path->bus->sim->mtx, MA_OWNED); #endif ==== //depot/projects/usb/src/sys/conf/NOTES#28 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1525 2009/02/08 00:16:24 wkoszek Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1528 2009/02/10 00:08:39 marcel Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -147,6 +147,7 @@ options GEOM_NOP # Test class. options GEOM_PART_APM # Apple partitioning options GEOM_PART_BSD # BSD disklabel +options GEOM_PART_EBR # Extended Boot Records options GEOM_PART_GPT # GPT partitioning options GEOM_PART_MBR # MBR partitioning options GEOM_PART_PC98 # PC-9800 disk partitioning @@ -2138,44 +2139,9 @@ # scd: Sony CD-ROM using proprietary (non-ATAPI) interface # mcd: Mitsumi CD-ROM using proprietary (non-ATAPI) interface # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board -# cy: Cyclades serial driver # joy: joystick (including IO DATA PCJOY PC Card joystick) -# rc: RISCom/8 multiport card -# rp: Comtrol Rocketport(ISA/PCI) - single card -# si: Specialix SI/XIO 4-32 port terminal multiplexor # cmx: OmniKey CardMan 4040 pccard smartcard reader -# Notes on the Comtrol Rocketport driver: -# -# The exact values used for rp0 depend on how many boards you have -# in the system. The manufacturer's sample configs are listed as: -# -# device rp # core driver support -# -# Comtrol Rocketport ISA single card -# hint.rp.0.at="isa" -# hint.rp.0.port="0x280" -# -# If instead you have two ISA cards, one installed at 0x100 and the -# second installed at 0x180, then you should add the following to -# your kernel probe hints: -# hint.rp.0.at="isa" -# hint.rp.0.port="0x100" -# hint.rp.1.at="isa" -# hint.rp.1.port="0x180" -# -# For 4 ISA cards, it might be something like this: -# hint.rp.0.at="isa" -# hint.rp.0.port="0x180" -# hint.rp.1.at="isa" -# hint.rp.1.port="0x100" -# hint.rp.2.at="isa" -# hint.rp.2.port="0x340" -# hint.rp.3.at="isa" -# hint.rp.3.port="0x240" -# -# For PCI cards, you need no hints. - # Mitsumi CD-ROM device mcd hint.mcd.0.at="isa" @@ -2352,6 +2318,7 @@ # ppi General-purpose I/O ("Geek Port") + IEEE1284 I/O # pps Pulse per second Timing Interface # lpbb Philips official parallel port I2C bit-banging interface +# pcfclock Parallel port clock driver. # # Supported interfaces: # ppc ISA-bus parallel port interfaces. ==== //depot/projects/usb/src/sys/conf/files#52 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1366 2009/02/08 03:02:06 piso Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1369 2009/02/09 22:38:55 thompsa Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1036,7 +1036,7 @@ dependency "iwn.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn.fw" \ no-implicit-rule \ - clean "iwn.fwo" + clean "iwnfw.fwo" iwn.fw optional iwnfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-4.44.17.fw.uu" \ @@ -1234,7 +1234,7 @@ dependency "rt2561.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \ no-implicit-rule \ - clean "rt2561.fwo" + clean "rt2561fw.fwo" rt2561.fw optional rt2561fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \ @@ -1248,7 +1248,7 @@ dependency "rt2561s.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \ no-implicit-rule \ - clean "rt2561s.fwo" + clean "rt2561sfw.fwo" rt2561s.fw optional rt2561sfw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \ @@ -1262,7 +1262,7 @@ dependency "rt2661.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \ no-implicit-rule \ - clean "rt2661.fwo" + clean "rt2661fw.fwo" rt2661.fw optional rt2661fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \ @@ -1276,7 +1276,7 @@ dependency "rt2860.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \ no-implicit-rule \ - clean "rt2860.fwo" + clean "rt2860fw.fwo" rt2860.fw optional rt2860fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \ @@ -1715,7 +1715,7 @@ dependency "wpi.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \ no-implicit-rule \ - clean "wpi.fwo" + clean "wpifw.fwo" wpi.fw optional wpifw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \ ==== //depot/projects/usb/src/sys/conf/options#21 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.660 2009/02/06 10:30:46 wkoszek Exp $ +# $FreeBSD: src/sys/conf/options,v 1.661 2009/02/10 00:08:39 marcel Exp $ # # On the handling of kernel options # @@ -92,6 +92,7 @@ GEOM_NOP opt_geom.h GEOM_PART_APM opt_geom.h GEOM_PART_BSD opt_geom.h +GEOM_PART_EBR opt_geom.h GEOM_PART_GPT opt_geom.h GEOM_PART_MBR opt_geom.h GEOM_PART_PC98 opt_geom.h ==== //depot/projects/usb/src/sys/dev/cfi/cfi_core.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/cfi/cfi_core.c,v 1.5 2009/02/07 05:32:19 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cfi/cfi_core.c,v 1.6 2009/02/08 20:29:37 sam Exp $"); #include "opt_cfi.h" @@ -439,7 +439,7 @@ * at the factory with a unique 64-bit number which is immutable. * The other segment is left blank for User (OEM) programming. * The User/OEM segment is One Time Programmable (OTP). It can also - * be locked to prevent any firther writes by setting bit 0 of the + * be locked to prevent any further writes by setting bit 0 of the * Protection Lock Register (PLR). The PLR can written only once. */ ==== //depot/projects/usb/src/sys/dev/de/if_de.c#6 (text) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/de/if_de.c,v 1.184 2008/04/05 17:24:44 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/de/if_de.c,v 1.185 2009/02/09 17:07:29 fjoe Exp $"); #define TULIP_HDR_DATA @@ -4561,7 +4561,7 @@ sc->tulip_setup_dma_addr = 0; } if (sc->tulip_setupbuf != NULL) { - bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupdata, + bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf, sc->tulip_setup_map); sc->tulip_setup_map = NULL; sc->tulip_setupbuf = NULL; ==== //depot/projects/usb/src/sys/dev/firewire/if_fwe.c#5 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/if_fwe.c,v 1.45 2008/03/25 09:38:58 ru Exp $ + * $FreeBSD: src/sys/dev/firewire/if_fwe.c,v 1.46 2009/02/09 16:58:18 fjoe Exp $ */ #ifdef HAVE_KERNEL_OPTION_HEADERS @@ -445,7 +445,7 @@ #ifdef DEVICE_POLLING { struct ifreq *ifr = (struct ifreq *) data; - struct firewire_comm *fc = fc = fwe->fd.fc; + struct firewire_comm *fc = fwe->fd.fc; if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { ==== //depot/projects/usb/src/sys/dev/firewire/if_fwip.c#7 (text+ko) ==== @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/if_fwip.c,v 1.17 2008/03/25 09:38:58 ru Exp $ + * $FreeBSD: src/sys/dev/firewire/if_fwip.c,v 1.18 2009/02/09 16:58:18 fjoe Exp $ */ #ifdef HAVE_KERNEL_OPTION_HEADERS @@ -427,7 +427,7 @@ #ifdef DEVICE_POLLING { struct ifreq *ifr = (struct ifreq *) data; - struct firewire_comm *fc = fc = fwip->fd.fc; + struct firewire_comm *fc = fwip->fd.fc; if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { ==== //depot/projects/usb/src/sys/dev/firewire/sbp.c#7 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/sbp.c,v 1.98 2009/02/01 23:28:52 sbruno Exp $ + * $FreeBSD: src/sys/dev/firewire/sbp.c,v 1.99 2009/02/09 16:57:07 fjoe Exp $ * */ @@ -330,12 +330,11 @@ static void sbp_identify(driver_t *driver, device_t parent) { - device_t child; SBP_DEBUG(0) printf("sbp_identify\n"); END_DEBUG - child = BUS_ADD_CHILD(parent, 0, "sbp", device_get_unit(parent)); + BUS_ADD_CHILD(parent, 0, "sbp", device_get_unit(parent)); } /* ==== //depot/projects/usb/src/sys/dev/re/if_re.c#14 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.151 2009/01/20 20:22:28 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.152 2009/02/09 04:59:13 yongari Exp $"); /* * RealTek 8139C+/8169/8169S/8110S/8168/8111/8101E PCI NIC driver @@ -156,7 +156,7 @@ #include "miibus_if.h" /* Tunables. */ -static int msi_disable = 1; +static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); #define RE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -2064,6 +2064,13 @@ mii_tick(mii); if ((sc->rl_flags & RL_FLAG_LINK) == 0) re_miibus_statchg(sc->rl_dev); + /* + * Reclaim transmitted frames here. Technically it is not + * necessary to do here but it ensures periodic reclamation + * regardless of Tx completion interrupt which seems to be + * lost on PCIe based controllers under certain situations. + */ + re_txeof(sc); re_watchdog(sc); callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); } ==== //depot/projects/usb/src/sys/dev/sound/pci/ds1.c#4 (text+ko) ==== @@ -33,7 +33,7 @@ #include #include -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.52 2007/06/17 06:10:41 ariff Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.53 2009/02/09 22:59:22 cognet Exp $"); /* -------------------------------------------------------------------- */ @@ -396,7 +396,7 @@ pb->Format |= b16? 0 : 0x80000000; pb->Format |= (stereo && (ch == 2 || ch == 4))? 0x00000001 : 0; pb->LoopDefault = 0; - pb->PgBase = base? base : 0; + pb->PgBase = base; pb->PgLoop = 0; pb->PgLoopEnd = len >> ss; pb->PgLoopFrac = 0; ==== //depot/projects/usb/src/sys/dev/syscons/scterm-teken.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/syscons/scterm-teken.c,v 1.1 2009/01/01 13:26:53 ed Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/syscons/scterm-teken.c,v 1.2 2009/02/09 15:55:21 ed Exp $"); #include "opt_syscons.h" @@ -49,6 +49,7 @@ #include static void scteken_revattr(unsigned char, teken_attr_t *); +static unsigned int scteken_attr(const teken_attr_t *); static sc_term_init_t scteken_init; static sc_term_term_t scteken_term; @@ -165,21 +166,25 @@ scteken_ioctl(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { + teken_stat *ts = scp->ts; vid_info_t *vi; + unsigned int attr; switch (cmd) { case GIO_ATTR: /* get current attributes */ - *(int*)data = SC_NORM_ATTR; + *(int*)data = + scteken_attr(teken_get_curattr(&ts->ts_teken)); return (0); case CONS_GETINFO: /* get current (virtual) console info */ - /* XXX: INCORRECT! */ vi = (vid_info_t *)data; if (vi->size != sizeof(struct vid_info)) return EINVAL; - vi->mv_norm.fore = SC_NORM_ATTR & 0x0f; - vi->mv_norm.back = (SC_NORM_ATTR >> 4) & 0x0f; - vi->mv_rev.fore = SC_NORM_ATTR & 0x0f; - vi->mv_rev.back = (SC_NORM_ATTR >> 4) & 0x0f; + + attr = scteken_attr(teken_get_defattr(&ts->ts_teken)); + vi->mv_norm.fore = attr & 0x0f; + vi->mv_norm.back = (attr >> 4) & 0x0f; + vi->mv_rev.fore = vi->mv_norm.back; + vi->mv_rev.back = vi->mv_norm.fore; /* * The other fields are filled by the upper routine. XXX */ @@ -280,7 +285,7 @@ } } -static inline unsigned int +static unsigned int scteken_attr(const teken_attr_t *a) { unsigned int attr = 0; @@ -300,7 +305,7 @@ attr |= FG_BLINK; #endif /* FG_BLINK */ - return (attr << 8); + return (attr); } static void @@ -337,7 +342,7 @@ } else #endif /* TEKEN_UTF8 */ { - attr = scteken_attr(a); + attr = scteken_attr(a) << 8; ch = c; } @@ -373,7 +378,7 @@ } else #endif /* TEKEN_UTF8 */ { - attr = scteken_attr(a); + attr = scteken_attr(a) << 8; ch = c; } ==== //depot/projects/usb/src/sys/dev/syscons/teken/teken.c#4 (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/dev/syscons/teken/teken.c,v 1.6 2009/01/20 11:34:28 ed Exp $ + * $FreeBSD: src/sys/dev/syscons/teken/teken.c,v 1.7 2009/02/09 15:55:21 ed Exp $ */ #include @@ -329,6 +329,20 @@ t->t_cursor = *p; } +const teken_attr_t * +teken_get_curattr(teken_t *t) +{ + + return (&t->t_curattr); +} + +const teken_attr_t * +teken_get_defattr(teken_t *t) +{ + + return (&t->t_defattr); +} + void teken_set_defattr(teken_t *t, const teken_attr_t *a) { ==== //depot/projects/usb/src/sys/dev/syscons/teken/teken.h#4 (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/dev/syscons/teken/teken.h,v 1.4 2009/01/20 11:34:28 ed Exp $ + * $FreeBSD: src/sys/dev/syscons/teken/teken.h,v 1.5 2009/02/09 15:55:21 ed Exp $ */ #ifndef _TEKEN_H_ @@ -170,7 +170,9 @@ /* Deliver character input. */ void teken_input(teken_t *, const void *, size_t); -/* Set teken attributes. */ +/* Get/set teken attributes. */ +const teken_attr_t *teken_get_curattr(teken_t *); +const teken_attr_t *teken_get_defattr(teken_t *); void teken_set_cursor(teken_t *, const teken_pos_t *); void teken_set_defattr(teken_t *, const teken_attr_t *); void teken_set_winsize(teken_t *, const teken_pos_t *); ==== //depot/projects/usb/src/sys/dev/usb2/controller/at91dci.c#27 (text+ko) ==== @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/at91dci.c,v 1.11 2009/01/13 19:05:51 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/at91dci.c,v 1.12 2009/02/09 21:47:39 thompsa Exp $"); /*- * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. ==== //depot/projects/usb/src/sys/dev/usb2/controller/at91dci_atmelarm.c#21 (text+ko) ==== @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/at91dci_atmelarm.c,v 1.8 2009/02/01 00:51:25 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/at91dci_atmelarm.c,v 1.9 2009/02/09 21:47:39 thompsa Exp $"); /*- * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. ==== //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.c#33 (text+ko) ==== @@ -44,7 +44,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ehci2.c,v 1.10 2009/02/07 15:51:32 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ehci2.c,v 1.12 2009/02/09 21:47:39 thompsa Exp $"); #include #include @@ -1896,17 +1896,10 @@ EHCI_QH_SET_MPL(xfer->max_packet_size)); if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { - if (methods != &ehci_device_intr_methods) { - qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | - EHCI_QH_DTC | EHCI_QH_SET_NRL(8)); - } else { - /* - * Nak-Reload count must be zero for interrupt - * endpoints See EHCI pdf file, section 4.9 - */ - qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | - EHCI_QH_DTC); - } + qh_endp |= (EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | + EHCI_QH_DTC); + if (methods != &ehci_device_intr_methods) + qh_endp |= EHCI_QH_SET_NRL(8); } else { if (usb2_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) { ==== //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.h#15 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/controller/ehci2.h,v 1.5 2009/01/13 19:03:01 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/controller/ehci2.h,v 1.6 2009/02/09 21:47:39 thompsa Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. ==== //depot/projects/usb/src/sys/dev/usb2/controller/ehci2_pci.c#25 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ehci2_pci.c,v 1.8 2009/02/01 00:51:25 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ehci2_pci.c,v 1.9 2009/02/09 21:47:39 thompsa Exp $"); /* * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller. ==== //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg.c#26 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/controller/musb2_otg.c,v 1.10 2009/01/13 19:03:33 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/controller/musb2_otg.c,v 1.11 2009/02/09 21:47:39 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/controller/ohci2.c#30 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ohci2.c,v 1.9 2009/02/07 06:27:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/ohci2.c,v 1.10 2009/02/09 21:47:39 thompsa Exp $"); /* * USB Open Host Controller driver. ==== //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#29 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/uhci2.c,v 1.11 2009/02/07 06:27:16 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb2/controller/uhci2.c,v 1.12 2009/02/09 21:47:39 thompsa Exp $"); /* * USB Universal Host Controller driver. ==== //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.c#26 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/controller/usb2_controller.c,v 1.9 2009/01/13 19:03:23 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/controller/usb2_controller.c,v 1.10 2009/02/09 21:47:39 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/controller/uss820dci.c#23 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/controller/uss820dci.c,v 1.9 2009/01/13 19:05:51 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/controller/uss820dci.c,v 1.10 2009/02/09 21:47:39 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky * All rights reserved. ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_busdma.c#20 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_busdma.c,v 1.7 2009/01/13 19:03:12 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_busdma.c,v 1.8 2009/02/08 22:54:58 imp Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_core.h#35 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_core.h,v 1.7 2009/01/13 19:03:12 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_core.h,v 1.8 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#52 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_device.c,v 1.11 2009/01/13 19:04:58 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_device.c,v 1.12 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_hub.c#38 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_hub.c,v 1.13 2009/02/01 00:51:25 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_hub.c,v 1.14 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_msctest.c#18 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_msctest.c,v 1.4 2009/01/04 00:12:01 alfred Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_msctest.c,v 1.5 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.c#18 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_process.c,v 1.2 2008/12/11 23:17:48 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_process.c,v 1.4 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.h#9 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_process.h,v 1.2 2008/12/11 23:13:02 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_process.h,v 1.3 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.c#33 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_request.c,v 1.7 2009/01/13 19:03:12 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_request.c,v 1.8 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.h#11 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_request.h,v 1.3 2009/01/04 00:12:01 alfred Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_request.h,v 1.4 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#42 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_transfer.c,v 1.10 2009/01/13 19:04:58 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_transfer.c,v 1.11 2009/02/09 21:56:33 thompsa Exp $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_util.c#12 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb2/core/usb2_util.c,v 1.3 2008/12/11 23:17:48 thompsa Exp $ */ +/* $FreeBSD: src/sys/dev/usb2/core/usb2_util.c,v 1.4 2009/02/09 21:56:33 thompsa Exp $ */ /*- >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Feb 10 17:40:38 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7F118106567A; Tue, 10 Feb 2009 17:40:37 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26BB61065672 for ; Tue, 10 Feb 2009 17:40:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 13F1D8FC2E for ; Tue, 10 Feb 2009 17:40:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AHeaia040809 for ; Tue, 10 Feb 2009 17:40:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1AHeWnQ040806 for perforce@freebsd.org; Tue, 10 Feb 2009 17:40:32 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 10 Feb 2009 17:40:32 GMT Message-Id: <200902101740.n1AHeWnQ040806@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157497 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: Tue, 10 Feb 2009 17:40:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=157497 Change 157497 by hselasky@hselasky_laptop001 on 2009/02/10 17:39:48 USB WLAN: Fix more races and panics after that Andrew Thompson re-ported the WLAN drivers from the old USB stack. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#31 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#31 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#33 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#7 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#31 (text+ko) ==== @@ -126,6 +126,7 @@ static usb2_proc_callback_t rum_amrr_task; static usb2_proc_callback_t rum_init_task; static usb2_proc_callback_t rum_stop_task; +static usb2_proc_callback_t rum_flush_task; static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -611,9 +612,31 @@ } static void +rum_flush_task(struct usb2_proc_msg *pm) +{ + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct rum_vap *rvp = RUM_VAP(vap); + + /* callout it stopped */ + usb2_callout_stop(&rvp->amrr_ch); +} + +static void rum_vap_delete(struct ieee80211vap *vap) { struct rum_vap *rvp = RUM_VAP(vap); + struct rum_softc *sc = rvp->sc; + + RUM_LOCK(sc); + /* wait for any pending tasks to complete */ + rum_queue_command(sc, rum_flush_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + RUM_UNLOCK(sc); usb2_callout_drain(&rvp->amrr_ch); ieee80211_amrr_cleanup(&rvp->amrr); @@ -701,9 +724,16 @@ ostate = vap->iv_state; + /* callout it stopped */ + usb2_callout_stop(&rvp->amrr_ch); + switch (sc->sc_state) { case IEEE80211_S_INIT: if (ostate == IEEE80211_S_RUN) { + /* + * BUG: this code is not executed like it + * should --hps + */ /* abort TSF synchronization */ tmp = rum_read(sc, RT2573_TXRX_CSR9); rum_write(sc, RT2573_TXRX_CSR9, tmp & ~0x00ffffff); @@ -759,8 +789,6 @@ ieee80211_state_name[nstate]); RUM_LOCK(sc); - usb2_callout_stop(&rvp->amrr_ch); - /* do it in a process context */ sc->sc_state = nstate; sc->sc_arg = arg; @@ -2183,7 +2211,9 @@ ieee80211_amrr_node_init(&rvp->amrr, &RUM_NODE(ni)->amn, ni); - usb2_callout_reset(&rvp->amrr_ch, hz, rum_amrr_timeout, rvp); + /* XXX WLAN race --hps */ + if (sc->sc_state != IEEE80211_S_INIT) + usb2_callout_reset(&rvp->amrr_ch, hz, rum_amrr_timeout, rvp); } static void @@ -2192,8 +2222,15 @@ struct rum_vap *rvp = arg; struct rum_softc *sc = rvp->sc; + /* XXX WLAN race --hps */ + if (sc->sc_state == IEEE80211_S_INIT) + return; + rum_queue_command(sc, rum_amrr_task, &rvp->amrr_task[0].hdr, &rvp->amrr_task[1].hdr); + + /* to avoid sync-issues we need to reset the callout here */ + usb2_callout_reset(&rvp->amrr_ch, hz, rum_amrr_timeout, rvp); } static void @@ -2204,7 +2241,6 @@ struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct rum_vap *rvp = RUM_VAP(vap); struct ieee80211_node *ni = vap->iv_bss; int ok, fail; @@ -2215,13 +2251,15 @@ (le32toh(sc->sta[5]) & 0xffff); /* TX ok w/ retry */ fail = (le32toh(sc->sta[5]) >> 16); /* TX retry-fail count */ + /* XXX WLAN race --hps */ + if (sc->sc_state == IEEE80211_S_INIT) + return; + ieee80211_amrr_tx_update(&RUM_NODE(ni)->amn, ok+fail, ok, (le32toh(sc->sta[5]) & 0xffff) + fail); (void) ieee80211_amrr_choose(ni, &RUM_NODE(ni)->amn); ifp->if_oerrors += fail; /* count TX retry-fail as Tx errors */ - - usb2_callout_reset(&rvp->amrr_ch, hz, rum_amrr_timeout, rvp); } /* ARGUSED */ @@ -2388,9 +2426,10 @@ task->sc = sc; /* - * Init and stop must be synchronous! + * Init, stop and flush must be synchronous! */ - if ((fn == rum_init_task) || (fn == rum_stop_task)) + if ((fn == rum_init_task) || (fn == rum_stop_task) || + (fn == rum_flush_task)) usb2_proc_mwait(&sc->sc_tq, t0, t1); } ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#31 (text+ko) ==== @@ -105,6 +105,7 @@ static usb2_proc_callback_t ural_amrr_task; static usb2_proc_callback_t ural_init_task; static usb2_proc_callback_t ural_stop_task; +static usb2_proc_callback_t ural_flush_task; static struct ieee80211vap *ural_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -597,9 +598,31 @@ } static void +ural_flush_task(struct usb2_proc_msg *pm) +{ + struct ural_task *task = (struct ural_task *)pm; + struct ural_softc *sc = task->sc; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct ural_vap *uvp = URAL_VAP(vap); + + /* callout it stopped */ + usb2_callout_stop(&uvp->amrr_ch); +} + +static void ural_vap_delete(struct ieee80211vap *vap) { struct ural_vap *uvp = URAL_VAP(vap); + struct ural_softc *sc = uvp->sc; + + RAL_LOCK(sc); + /* wait for any pending tasks to complete */ + ural_queue_command(sc, ural_flush_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + RAL_UNLOCK(sc); usb2_callout_drain(&uvp->amrr_ch); ieee80211_amrr_cleanup(&uvp->amrr); @@ -687,9 +710,16 @@ ostate = vap->iv_state; + /* callout is stopped */ + usb2_callout_stop(&uvp->amrr_ch); + switch (sc->sc_state) { case IEEE80211_S_INIT: if (ostate == IEEE80211_S_RUN) { + /* + * BUG: this code is not executed like it + * should --hps + */ /* abort TSF synchronization */ ural_write(sc, RAL_TXRX_CSR19, 0); @@ -793,8 +823,6 @@ ieee80211_state_name[nstate]); RAL_LOCK(sc); - usb2_callout_stop(&uvp->amrr_ch); - /* do it in a process context */ sc->sc_state = nstate; sc->sc_arg = arg; @@ -2269,7 +2297,9 @@ ieee80211_amrr_node_init(&uvp->amrr, &URAL_NODE(ni)->amn, ni); - usb2_callout_reset(&uvp->amrr_ch, hz, ural_amrr_timeout, uvp); + /* XXX WLAN race --hps */ + if (sc->sc_state != IEEE80211_S_INIT) + usb2_callout_reset(&uvp->amrr_ch, hz, ural_amrr_timeout, uvp); } static void @@ -2278,8 +2308,15 @@ struct ural_vap *uvp = arg; struct ural_softc *sc = uvp->sc; + /* XXX WLAN race --hps */ + if (sc->sc_state == IEEE80211_S_INIT) + return; + ural_queue_command(sc, ural_amrr_task, &uvp->amrr_task[0].hdr, &uvp->amrr_task[1].hdr); + + /* to avoid sync-issues we need to reset the callout here */ + usb2_callout_reset(&uvp->amrr_ch, hz, ural_amrr_timeout, uvp); } static void @@ -2290,7 +2327,6 @@ struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct ural_vap *uvp = URAL_VAP(vap); struct ieee80211_node *ni = vap->iv_bss; int ok, fail; @@ -2301,13 +2337,15 @@ sc->sta[8]; /* TX ok w/ retry */ fail = sc->sta[9]; /* TX retry-fail count */ + /* XXX WLAN race --hps */ + if (sc->sc_state == IEEE80211_S_INIT) + return; + ieee80211_amrr_tx_update(&URAL_NODE(ni)->amn, ok+fail, ok, sc->sta[8] + fail); (void) ieee80211_amrr_choose(ni, &URAL_NODE(ni)->amn); ifp->if_oerrors += fail; /* count TX retry-fail as Tx errors */ - - usb2_callout_reset(&uvp->amrr_ch, hz, ural_amrr_timeout, uvp); } static void @@ -2335,9 +2373,9 @@ task->sc = sc; /* - * Init and stop must be synchronous! + * Init, stop and flush must be synchronous! */ - if ((fn == ural_init_task) || (fn == ural_stop_task)) + if ((fn == ural_init_task) || (fn == ural_stop_task) || + (fn == ural_stop_task)) usb2_proc_mwait(&sc->sc_tq, t0, t1); } - ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#33 (text+ko) ==== @@ -91,6 +91,7 @@ static usb2_proc_callback_t zyd_multitask; static usb2_proc_callback_t zyd_init_task; static usb2_proc_callback_t zyd_stop_task; +static usb2_proc_callback_t zyd_flush_task; static struct ieee80211vap *zyd_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -469,6 +470,7 @@ const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac[IEEE80211_ADDR_LEN]) { + struct zyd_softc *sc = ic->ic_ifp->if_softc; struct zyd_vap *zvp; struct ieee80211vap *vap; @@ -487,6 +489,7 @@ zvp->newstate = vap->iv_newstate; vap->iv_newstate = zyd_newstate; + zvp->sc = sc; ieee80211_amrr_init(&zvp->amrr, vap, IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD, IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD, @@ -500,10 +503,24 @@ } static void +zyd_flush_task(struct usb2_proc_msg *_pm) +{ + /* nothing to do */ +} + +static void zyd_vap_delete(struct ieee80211vap *vap) { struct zyd_vap *zvp = ZYD_VAP(vap); + struct zyd_softc *sc = zvp->sc; + ZYD_LOCK(sc); + /* wait for any pending tasks to complete */ + zyd_queue_command(sc, zyd_flush_task, + &sc->sc_synctask[0].hdr, + &sc->sc_synctask[1].hdr); + ZYD_UNLOCK(sc); + ieee80211_amrr_cleanup(&zvp->amrr); ieee80211_vap_detach(vap); free(zvp, M_80211_VAP); @@ -3092,7 +3109,8 @@ /* * Init and stop must be synchronous! */ - if ((fn == zyd_init_task) || (fn == zyd_stop_task)) + if ((fn == zyd_init_task) || (fn == zyd_stop_task) || + (fn == zyd_flush_task)) usb2_proc_mwait(&sc->sc_tq, t0, t1); } ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#7 (text+ko) ==== @@ -1247,6 +1247,7 @@ struct ieee80211vap vap; int (*newstate)(struct ieee80211vap *, enum ieee80211_state, int); + struct zyd_softc *sc; struct ieee80211_amrr amrr; }; #define ZYD_VAP(vap) ((struct zyd_vap *)(vap)) From owner-p4-projects@FreeBSD.ORG Tue Feb 10 18:26:33 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B73CB1065672; Tue, 10 Feb 2009 18:26:33 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77094106566C for ; Tue, 10 Feb 2009 18:26:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 64E9A8FC22 for ; Tue, 10 Feb 2009 18:26:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AIQWLF045247 for ; Tue, 10 Feb 2009 18:26:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1AIQUGU045243 for perforce@freebsd.org; Tue, 10 Feb 2009 18:26:30 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 10 Feb 2009 18:26:30 GMT Message-Id: <200902101826.n1AIQUGU045243@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157500 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: Tue, 10 Feb 2009 18:26:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=157500 Change 157500 by hselasky@hselasky_laptop001 on 2009/02/10 18:25:47 USB WLAN: Add more debug prints. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#32 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#32 (text+ko) ==== @@ -1441,8 +1441,8 @@ error = rum_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, - "could not multi read MAC register: %s\n", - usb2_errstr(error)); + "could not multi read MAC register(0x%04x): %s\n", + reg, usb2_errstr(error)); } } @@ -1469,8 +1469,8 @@ error = rum_do_request(sc, &req, buf); if (error != 0) { device_printf(sc->sc_dev, - "could not multi write MAC register: %s\n", - usb2_errstr(error)); + "could not multi write MAC register(0x%04x): %s\n", + reg, usb2_errstr(error)); } } From owner-p4-projects@FreeBSD.ORG Tue Feb 10 18:27:35 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E1EA01065673; Tue, 10 Feb 2009 18:27:34 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE351065670 for ; Tue, 10 Feb 2009 18:27:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6818FC14 for ; Tue, 10 Feb 2009 18:27:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AIRY91045306 for ; Tue, 10 Feb 2009 18:27:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1AIRYmo045304 for perforce@freebsd.org; Tue, 10 Feb 2009 18:27:34 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 10 Feb 2009 18:27:34 GMT Message-Id: <200902101827.n1AIRYmo045304@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157501 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: Tue, 10 Feb 2009 18:27:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=157501 Change 157501 by hselasky@hselasky_laptop001 on 2009/02/10 18:26:52 USB CORE: Make sure that USB process functions simply return if the process has been drained. Remove two unused functions. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.c#19 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.h#10 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.c#19 (text+ko) ==== @@ -84,9 +84,9 @@ while (1) { - if (up->up_gone) { + if (up->up_gone) break; - } + /* * NOTE to reimplementors: dequeueing a command from the * "used" queue and executing it must be atomic, with regard @@ -213,10 +213,10 @@ void usb2_proc_free(struct usb2_process *up) { - if (!(up->up_mtx)) { - /* not initialised */ + /* check if not initialised */ + if (up->up_mtx == NULL) return; - } + usb2_proc_drain(up); usb2_cv_destroy(&up->up_cv); @@ -246,6 +246,10 @@ uint32_t d; uint8_t t; + /* check if gone, return dummy value */ + if (up->up_gone) + return (_pm0); + mtx_assert(up->up_mtx, MA_OWNED); t = 0; @@ -319,9 +323,11 @@ uint8_t usb2_proc_is_gone(struct usb2_process *up) { + if (up->up_gone) + return (1); + mtx_assert(up->up_mtx, MA_OWNED); - - return (up->up_gone ? 1 : 0); + return (0); } /*------------------------------------------------------------------------* @@ -337,6 +343,10 @@ struct usb2_proc_msg *pm0 = _pm0; struct usb2_proc_msg *pm1 = _pm1; + /* check if gone */ + if (up->up_gone) + return; + mtx_assert(up->up_mtx, MA_OWNED); if (up->up_curtd == curthread) { @@ -372,13 +382,13 @@ void usb2_proc_drain(struct usb2_process *up) { - if (!(up->up_mtx)) { - /* not initialised */ + /* check if not initialised */ + if (up->up_mtx == NULL) return; - } - if (up->up_mtx != &Giant) { + /* handle special case with Giant */ + if (up->up_mtx != &Giant) mtx_assert(up->up_mtx, MA_NOTOWNED); - } + mtx_lock(up->up_mtx); /* Set the gone flag */ @@ -398,7 +408,8 @@ if (cold) { USB_THREAD_SUSPEND(up->up_ptr); - printf("WARNING: A USB process has been left suspended!\n"); + printf("WARNING: A USB process has " + "been left suspended!\n"); break; } usb2_cv_wait(&up->up_cv, up->up_mtx); @@ -413,64 +424,3 @@ } mtx_unlock(up->up_mtx); } - -/*------------------------------------------------------------------------* - * usb2_proc_cwait - * - * This function will suspend the current process until - * "usb2_proc_signal()" or "usb2_proc_drain()" is called. The - * "timeout" parameter defines the maximum wait time in system - * ticks. If "timeout" is zero that means no timeout. - * - * NOTE: This function can only be called from within an USB process. - * - * Return values: - * USB_PROC_WAIT_TIMEOUT: Timeout - * USB_PROC_WAIT_NORMAL: Success - * Else: USB process is tearing down - *------------------------------------------------------------------------*/ -uint8_t -usb2_proc_cwait(struct usb2_process *up, int timeout) -{ - int error; - - mtx_assert(up->up_mtx, MA_OWNED); - - if (up->up_gone) { - return (USB_PROC_WAIT_DRAIN); - } - up->up_csleep = 1; - - if (timeout == 0) { - usb2_cv_wait(&up->up_cv, up->up_mtx); - error = 0; - } else { - error = usb2_cv_timedwait(&up->up_cv, up->up_mtx, timeout); - } - - up->up_csleep = 0; - - if (up->up_gone) { - return (USB_PROC_WAIT_DRAIN); - } - if (error == EWOULDBLOCK) { - return (USB_PROC_WAIT_TIMEOUT); - } - return (0); -} - -/*------------------------------------------------------------------------* - * usb2_proc_csignal - * - * This function will wakeup the given USB process. - *------------------------------------------------------------------------*/ -void -usb2_proc_csignal(struct usb2_process *up) -{ - mtx_assert(up->up_mtx, MA_OWNED); - - if (up->up_csleep) { - up->up_csleep = 0; - usb2_cv_signal(&up->up_cv); - } -} ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_process.h#10 (text+ko) ==== @@ -77,11 +77,9 @@ /* prototypes */ -uint8_t usb2_proc_cwait(struct usb2_process *up, int timeout); uint8_t usb2_proc_is_gone(struct usb2_process *up); int usb2_proc_create(struct usb2_process *up, struct mtx *p_mtx, const char *pmesg, uint8_t prio); -void usb2_proc_csignal(struct usb2_process *up); void usb2_proc_drain(struct usb2_process *up); void usb2_proc_mwait(struct usb2_process *up, void *pm0, void *pm1); void usb2_proc_free(struct usb2_process *up); From owner-p4-projects@FreeBSD.ORG Tue Feb 10 20:00:09 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 21C491065674; Tue, 10 Feb 2009 20:00:09 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5499106566B for ; Tue, 10 Feb 2009 20:00:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B26B68FC1A for ; Tue, 10 Feb 2009 20:00:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AK08gd054150 for ; Tue, 10 Feb 2009 20:00:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1AK08AF054148 for perforce@freebsd.org; Tue, 10 Feb 2009 20:00:08 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 10 Feb 2009 20:00:08 GMT Message-Id: <200902102000.n1AK08AF054148@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157504 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: Tue, 10 Feb 2009 20:00:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=157504 Change 157504 by hselasky@hselasky_laptop001 on 2009/02/10 19:59:22 USB WLAN fixes after Andrew Thompsons diff reduction against the old USB stack. 1) Fix possible NULL pointer access at detach. 2) BAN use of DELAY(), replaced with usb2_pause_mtx() 3) BAN use of delay less loops polling USB hardware. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#33 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#32 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#34 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#33 (text+ko) ==== @@ -548,7 +548,7 @@ { struct rum_softc *sc = device_get_softc(self); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); @@ -563,6 +563,7 @@ RUM_UNLOCK(sc); if (ifp) { + ic = ifp->if_l2com; bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); @@ -1480,9 +1481,10 @@ uint32_t tmp; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries != 5; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 5) { device_printf(sc->sc_dev, "could not write to BBP\n"); @@ -1499,9 +1501,10 @@ uint32_t val; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries != 5; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 5) { device_printf(sc->sc_dev, "could not read BBP\n"); @@ -1511,11 +1514,11 @@ val = RT2573_BBP_BUSY | RT2573_BBP_READ | reg << 8; rum_write(sc, RT2573_PHY_CSR3, val); - for (ntries = 0; ntries < 100; ntries++) { + for (ntries = 0; ntries != 10; ntries++) { val = rum_read(sc, RT2573_PHY_CSR3); if (!(val & RT2573_BBP_BUSY)) return val & 0xff; - DELAY(1); + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } device_printf(sc->sc_dev, "could not read BBP\n"); @@ -1528,9 +1531,10 @@ uint32_t tmp; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries != 5; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR4) & RT2573_RF_BUSY)) break; + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 5) { device_printf(sc->sc_dev, "could not write to RF\n"); @@ -1726,7 +1730,7 @@ rum_rf_write(sc, RT2573_RF3, rfprog[i].r3 | power << 7); rum_rf_write(sc, RT2573_RF4, rfprog[i].r4 | sc->rffreq << 10); - DELAY(10); + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); /* enable smart mode for MIMO-capable RFs */ bbp3 = rum_bbp_read(sc, 3); @@ -1938,11 +1942,11 @@ int i, ntries; /* wait for BBP to be ready */ - for (ntries = 0; ntries < 100; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { const uint8_t val = rum_bbp_read(sc, 0); if (val != 0 && val != 0xff) break; - DELAY(1000); + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for BBP\n"); @@ -1989,11 +1993,11 @@ rum_write(sc, RT2573_MAC_CSR1, 0); /* wait for BBP/RF to wakeup */ - for (ntries = 0; ntries < 1000; ntries++) { + for (ntries = 0; ntries != 1000; ntries++) { if (rum_read(sc, RT2573_MAC_CSR12) & 8) break; rum_write(sc, RT2573_MAC_CSR12, 4); /* force wakeup */ - DELAY(1000); + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 1000) { device_printf(sc->sc_dev, @@ -2212,7 +2216,7 @@ ieee80211_amrr_node_init(&rvp->amrr, &RUM_NODE(ni)->amn, ni); /* XXX WLAN race --hps */ - if (sc->sc_state != IEEE80211_S_INIT) + if (sc->sc_state == IEEE80211_S_RUN) usb2_callout_reset(&rvp->amrr_ch, hz, rum_amrr_timeout, rvp); } @@ -2223,7 +2227,7 @@ struct rum_softc *sc = rvp->sc; /* XXX WLAN race --hps */ - if (sc->sc_state == IEEE80211_S_INIT) + if (sc->sc_state != IEEE80211_S_RUN) return; rum_queue_command(sc, rum_amrr_task, @@ -2252,7 +2256,7 @@ fail = (le32toh(sc->sta[5]) >> 16); /* TX retry-fail count */ /* XXX WLAN race --hps */ - if (sc->sc_state == IEEE80211_S_INIT) + if (sc->sc_state != IEEE80211_S_RUN) return; ieee80211_amrr_tx_update(&RUM_NODE(ni)->amn, ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#32 (text+ko) ==== @@ -534,7 +534,7 @@ { struct ural_softc *sc = device_get_softc(self); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); @@ -549,6 +549,7 @@ RAL_UNLOCK(sc); if (ifp) { + ic = ifp->if_l2com; bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); @@ -1594,9 +1595,10 @@ uint16_t tmp; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries != 5; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR8) & RAL_BBP_BUSY)) break; + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 5) { device_printf(sc->sc_dev, "could not write to BBP\n"); @@ -1616,9 +1618,10 @@ val = RAL_BBP_WRITE | reg << 8; ural_write(sc, RAL_PHY_CSR7, val); - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries != 5; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR8) & RAL_BBP_BUSY)) break; + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 5) { device_printf(sc->sc_dev, "could not read BBP\n"); @@ -1634,9 +1637,10 @@ uint32_t tmp; int ntries; - for (ntries = 0; ntries < 5; ntries++) { + for (ntries = 0; ntries != 5; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR10) & RAL_RF_LOBUSY)) break; + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 5) { device_printf(sc->sc_dev, "could not write to RF\n"); @@ -1812,7 +1816,8 @@ /* clear CRC errors */ ural_read(sc, RAL_STA_CSR0); - DELAY(10000); + usb2_pause_mtx(&sc->sc_mtx, hz / 100); + ural_disable_rf_tune(sc); } @@ -2034,10 +2039,10 @@ int i, ntries; /* wait for BBP to be ready */ - for (ntries = 0; ntries < 100; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if (ural_bbp_read(sc, RAL_BBP_VERSION) != 0) break; - DELAY(1000); + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for BBP\n"); @@ -2133,12 +2138,12 @@ ural_write(sc, ural_def_mac[i].reg, ural_def_mac[i].val); /* wait for BBP and RF to wake up (this can take a long time!) */ - for (ntries = 0; ntries < 100; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { tmp = ural_read(sc, RAL_MAC_CSR17); if ((tmp & (RAL_BBP_AWAKE | RAL_RF_AWAKE)) == (RAL_BBP_AWAKE | RAL_RF_AWAKE)) break; - DELAY(1000); + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); } if (ntries == 100) { device_printf(sc->sc_dev, @@ -2298,7 +2303,7 @@ ieee80211_amrr_node_init(&uvp->amrr, &URAL_NODE(ni)->amn, ni); /* XXX WLAN race --hps */ - if (sc->sc_state != IEEE80211_S_INIT) + if (sc->sc_state == IEEE80211_S_RUN) usb2_callout_reset(&uvp->amrr_ch, hz, ural_amrr_timeout, uvp); } @@ -2309,7 +2314,7 @@ struct ural_softc *sc = uvp->sc; /* XXX WLAN race --hps */ - if (sc->sc_state == IEEE80211_S_INIT) + if (sc->sc_state != IEEE80211_S_RUN) return; ural_queue_command(sc, ural_amrr_task, @@ -2338,7 +2343,7 @@ fail = sc->sta[9]; /* TX retry-fail count */ /* XXX WLAN race --hps */ - if (sc->sc_state == IEEE80211_S_INIT) + if (sc->sc_state != IEEE80211_S_RUN) return; ieee80211_amrr_tx_update(&URAL_NODE(ni)->amn, ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#34 (text+ko) ==== @@ -441,7 +441,7 @@ { struct zyd_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); @@ -454,6 +454,7 @@ zyd_unsetup_tx_list(sc); if (ifp) { + ic = ifp->if_l2com; bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); From owner-p4-projects@FreeBSD.ORG Wed Feb 11 09:28:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CCE2D106566C; Wed, 11 Feb 2009 09:28:53 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83FF5106564A for ; Wed, 11 Feb 2009 09:28:53 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4B98FC2D for ; Wed, 11 Feb 2009 09:28:53 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1B9SrFP089963 for ; Wed, 11 Feb 2009 09:28:53 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1B9Sp2M089957 for perforce@freebsd.org; Wed, 11 Feb 2009 09:28:51 GMT (envelope-from trasz@freebsd.org) Date: Wed, 11 Feb 2009 09:28:51 GMT Message-Id: <200902110928.n1B9Sp2M089957@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trasz@freebsd.org using -f From: Edward Tomasz Napierala To: Perforce Change Reviews Cc: Subject: PERFORCE change 157529 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: Wed, 11 Feb 2009 09:28:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=157529 Change 157529 by trasz@trasz_victim7 on 2009/02/11 09:27:59 IFC. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/UPDATING#19 integrate .. //depot/projects/soc2008/trasz_nfs4acl/contrib/csup/updater.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/etc/rc.d/named#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/net/getaddrinfo.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/net/gethostbydns.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdlib/atol.3#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/string/memchr.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/sys/send.2#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc_r/uthread/uthread_init.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libdisk/open_disk.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/msun/src/math.h#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/release/Makefile#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/release/scripts/doFS.sh#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sbin/geom/class/part/geom_part.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sbin/ifconfig/ifieee80211.c#11 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sbin/ifconfig/regdomain.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sbin/ifconfig/regdomain.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sbin/ipfw/ipfw.8#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sbin/ipfw/nat.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sbin/mount_nfs/mount_nfs.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/share/man/man4/re.4#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/share/man/man4/rum.4#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/share/man/man4/smb.4#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/share/man/man9/lock.9#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/amd64/amd64/busdma_machdep.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/amd64/conf/DEFAULTS#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/amd64/conf/NOTES#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/amd64/include/legacyvar.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/amd64/pci/pci_bus.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/arm/arm/busdma_machdep.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/boot/sparc64/loader/main.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/cam/cam_periph.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/cam/cam_xpt.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/cam/scsi/scsi_cd.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/cam/scsi/scsi_da.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/NOTES#25 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/files#29 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/options#19 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/options.amd64#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/options.i386#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/options.ia64#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/options.mips#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/conf/options.pc98#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/crypto/via/padlock.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/acpi_support/acpi_panasonic.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/acpica/acpi_pcib_acpi.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/agp/agp.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/arcmsr/arcmsr.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ath/ath_hal/ah_regdomain.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ath/ath_hal/ar5212/ar5212.h#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ath/if_ath.c#12 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ath/if_athioctl.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/atkbdc/atkbdc_isa.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/bge/if_bge.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/cardbus/cardbus_device.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/cfi/cfi_core.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/cfi/cfi_dev.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/cfi/cfi_reg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/cfi/cfi_var.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/de/if_de.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/exca/exca.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/firewire/if_fwe.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/firewire/if_fwip.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/firewire/sbp.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/fxp/if_fxp.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/hifn/hifn7751.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/iicbus/if_ic.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/iicbus/iicbb.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/iicbus/iicbus.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/iicbus/iicsmb.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/lmc/if_lmc.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/lmc/if_lmc.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/my/if_my.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/nve/if_nve.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/pccard/card_if.m#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/pccard/pccard.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/pccard/pccard_cis.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/pccard/pccardvarp.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/pcn/if_pcn.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ppc/ppc.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ppc/ppc_pci.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/ppc/ppcvar.h#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/re/if_re.c#11 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/safe/safe.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/scc/scc_if.m#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sdhci/sdhci.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/si/si.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sis/if_sis.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/macio/aoa.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/macio/aoa.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/macio/davbus.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/macio/i2s.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/macio/snapper.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/macio/tumbler.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/sound/pci/ds1.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/syscons/scterm-teken.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/syscons/teken/teken.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/syscons/teken/teken.h#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/tl/if_tl.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/tx/if_tx.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/uart/uart_bus_pci.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/if_rum.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/if_urtw.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/usbdevs#20 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/at91dci.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/at91dci_atmelarm.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/atmegadci.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/ehci2.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/ehci2.h#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/ehci2_ixp4xx.c#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/ehci2_mbus.c#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/ehci2_pci.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/musb2_otg.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/ohci2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/uhci2.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/usb2_controller.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/controller/uss820dci.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_busdma.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_config_td.c#3 delete .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_config_td.h#3 delete .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_core.h#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_device.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_hub.c#9 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_msctest.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_process.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_process.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_request.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_request.h#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_transfer.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_util.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/core/usb2_util.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_aue2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_auereg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_axe2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_axereg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_cdce2.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_cdcereg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_cue2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_cuereg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_kue2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_kuereg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_rue2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_ruereg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_udav2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/if_udavreg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/usb2_ethernet.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/ethernet/usb2_ethernet.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/include/usb2_cdc.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/include/usb2_devid.h#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/include/usb2_devtable.h#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/misc/ufm2.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/u3g2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/uark2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/ubsa2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/ubser2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/uchcom2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/ucycom2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/ufoma2.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/uftdi2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/ugensa2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/uipaq2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/ulpt2.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/umct2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/umodem2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/umoscom2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/uplcom2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/usb2_serial.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/usb2_serial.h#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/uslcom2.c#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/uvisor2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/serial/uvscom2.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/sound/uaudio2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/storage/umass2.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/template/usb2_template_cdce.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_rum2.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_rumreg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_rumvar.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_ural2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_uralreg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_uralvar.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_zyd2.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_zydfw.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb2/wlan/if_zydreg.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/xen/netfront/netfront.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/fifofs/fifo_vnops.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/tmpfs/tmpfs.h#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/tmpfs/tmpfs_subr.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/tmpfs/tmpfs_vnops.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/udf/ecma167-udf.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/udf/udf.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/udf/udf_vfsops.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/udf/udf_vnops.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/part/g_part.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/part/g_part_apm.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/part/g_part_bsd.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/part/g_part_ebr.c#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/part/g_part_gpt.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/part/g_part_mbr.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/part/g_part_pc98.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/geom/part/g_part_vtoc8.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/i386/conf/DEFAULTS#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/i386/conf/NOTES#9 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/i386/i386/busdma_machdep.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/i386/i386/vm_machdep.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/i386/xen/pmap.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/ia64/conf/NOTES#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/ia64/ia64/busdma_machdep.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/ia64/ia64/mp_machdep.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/kern_jail.c#14 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/kern_linker.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/kern_lock.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/kern_sysctl.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/link_elf.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/link_elf_obj.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_bus.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_clist.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/tty.c#16 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/uipc_debug.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/uipc_socket.c#12 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/vfs_bio.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/vfs_init.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/vfs_mount.c#14 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/vfs_subr.c#24 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/mips/include/pmap.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/mips/mips/busdma_machdep.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/mips/mips/in_cksum.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/modules/geom/geom_part/Makefile#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/modules/geom/geom_part/geom_part_ebr/Makefile#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/modules/libalias/libalias/Makefile#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/modules/usb2/Makefile#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/modules/usb2/core/Makefile#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/modules/usb2/serial_slcom/Makefile#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/net/if.c#14 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/net/rtsock.c#13 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/net80211/ieee80211_adhoc.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/net80211/ieee80211_crypto.h#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/net80211/ieee80211_ddb.c#11 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/net80211/ieee80211_output.c#10 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/net80211/ieee80211_regdomain.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/net80211/ieee80211_tdma.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/in.c#13 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/in_pcb.c#15 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/ip_fw_nat.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/ip_ipsec.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/ip_output.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/libalias/alias.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/libalias/alias_db.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/libalias/alias_local.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/libalias/alias_sctp.c#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/libalias/alias_sctp.h#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/raw_ip.c#13 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/sctp_crc32.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/sctp_crc32.h#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/sctp_uio.h#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/sctputil.c#12 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/tcp_subr.c#14 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/tcp_usrreq.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet/udp_usrreq.c#17 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet6/in6.c#14 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet6/in6_pcb.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet6/in6_src.c#10 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet6/ip6_forward.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet6/ip6_ipsec.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet6/ip6_output.c#9 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet6/raw_ip6.c#15 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netinet6/udp6_usrreq.c#14 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netipsec/ipsec.c#11 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netipsec/ipsec.h#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/netipsec/ipsec6.h#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/nfsserver/nfs_syscalls.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/opencrypto/cryptosoft.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/pc98/conf/NOTES#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/pci/if_rl.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/pci/if_rlreg.h#11 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/rpc/clnt_rc.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/security/audit/audit_bsm.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/security/audit/audit_bsm_klib.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/security/audit/audit_pipe.c#9 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/security/audit/audit_private.h#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/include/bus_private.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/include/vmparam.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sparc64/sparc64/iommu.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sun4v/include/vmparam.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/bus_dma.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/cfictl.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/jail.h#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/kobj.h#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/lockmgr.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/mount.h#10 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/sysctl.h#9 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/tty.h#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/ufs/ffs/ffs_alloc.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vm_fault.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vm_kern.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vm_map.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vm_map.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vm_mmap.c#8 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vm_object.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vm_object.h#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vm_unix.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vnode_pager.c#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/vm/vnode_pager.h#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/README#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/ath/athstats/Makefile#6 integrate .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/ath/athstats/athstats.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/ath/athstats/main.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/ath/athstats/statfoo.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/cfi/Makefile#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/cfi/cfi.c#1 branch .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/net80211/wlanstats/main.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/tools/tools/net80211/wlanstats/wlanstats.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/usr.bin/tar/subst.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/usr.bin/tar/write.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/usr.sbin/config/main.c#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/usr.sbin/pstat/pstat.8#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/usr.sbin/pstat/pstat.c#6 integrate Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/UPDATING#19 (text+ko) ==== @@ -22,6 +22,13 @@ to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090203: + The ichsmb(4) driver has been changed to require SMBus slave + addresses be left-justified (xxxxxxx0b) rather than right-justified. + All of the other SMBus controller drivers require left-justified + slave addresses, so this change makes all the drivers provide the + same interface. + 20090201: INET6 statistics (struct ip6stat) was updated. netstat(1) needs to be recompiled. @@ -1219,4 +1226,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.560 2009/02/01 21:11:08 bz Exp $ +$FreeBSD: src/UPDATING,v 1.561 2009/02/06 15:03:14 jhb Exp $ ==== //depot/projects/soc2008/trasz_nfs4acl/contrib/csup/updater.c#3 (text) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/contrib/csup/updater.c,v 1.2 2009/01/05 15:18:16 lulf Exp $ + * $FreeBSD: src/contrib/csup/updater.c,v 1.3 2009/02/09 20:13:55 lulf Exp $ */ #include @@ -1656,10 +1656,12 @@ if (rf == NULL) { fattr_maskout(oldfattr, ~FA_MODTIME); - if (fattr_equal(oldfattr, sr->sr_serverattr) == 0) + if (fattr_equal(oldfattr, sr->sr_serverattr)) lprintf(1, " SetAttrs %s", fup->coname); else lprintf(1, " Touch %s", fup->coname); + /* Install new attributes. */ + fattr_install(sr->sr_serverattr, fup->destpath, NULL); if (fup->attic) lprintf(1, " -> Attic"); lprintf(1, "\n"); ==== //depot/projects/soc2008/trasz_nfs4acl/etc/rc.d/named#3 (text+ko) ==== @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/named,v 1.28 2008/08/01 06:11:33 dougb Exp $ +# $FreeBSD: src/etc/rc.d/named,v 1.29 2009/02/07 16:37:02 bz Exp $ # # PROVIDE: named @@ -61,10 +61,23 @@ # Mount a devfs in the chroot directory if needed # - umount ${named_chrootdir}/dev 2>/dev/null - devfs_domount ${named_chrootdir}/dev devfsrules_hide_all - devfs -m ${named_chrootdir}/dev rule apply path null unhide - devfs -m ${named_chrootdir}/dev rule apply path random unhide + if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then + umount ${named_chrootdir}/dev 2>/dev/null + devfs_domount ${named_chrootdir}/dev devfsrules_hide_all + devfs -m ${named_chrootdir}/dev rule apply path null unhide + devfs -m ${named_chrootdir}/dev rule apply path random unhide + else + if [ -c ${named_chrootdir}/dev/null -a \ + -c ${named_chrootdir}/dev/random ]; then + info "named chroot: using pre-mounted devfs." + else + err 1 "named chroot: devfs cannot be mounted from" \ + "within a jail. Thus a chrooted named cannot" \ + "be run from within a jail." \ + "To run named without chrooting it, set" \ + "named_chrootdir=\"\" in /etc/rc.conf." + fi + fi # Copy and/or update key files to the chroot /etc # @@ -113,7 +126,12 @@ named_poststop() { if [ -n "${named_chrootdir}" -a -c ${named_chrootdir}/dev/null ]; then - umount ${named_chrootdir}/dev 2>/dev/null || true + if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then + umount ${named_chrootdir}/dev 2>/dev/null || true + else + warn "named chroot:" \ + "cannot unmount devfs from inside jail!" + fi fi } ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/net/getaddrinfo.c#2 (text+ko) ==== @@ -54,7 +54,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/getaddrinfo.c,v 1.87 2008/02/03 19:07:55 ume Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/getaddrinfo.c,v 1.88 2009/02/08 16:58:05 ume Exp $"); #include "namespace.h" #include @@ -1863,7 +1863,8 @@ } } else if (type != qtype) { #ifdef DEBUG - if (type != T_KEY && type != T_SIG) + if (type != T_KEY && type != T_SIG && + type != ns_t_dname) syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", qname, p_class(C_IN), p_type(qtype), ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/net/gethostbydns.c#2 (text+ko) ==== @@ -54,7 +54,7 @@ static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/net/gethostbydns.c,v 1.58 2007/01/09 00:28:02 imp Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/net/gethostbydns.c,v 1.59 2009/02/08 16:58:05 ume Exp $"); #include #include @@ -294,7 +294,7 @@ continue; } if (type != qtype) { - if (type != T_SIG) + if (type != T_SIG && type != ns_t_dname) syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"", qname, p_class(C_IN), p_type(qtype), ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/stdlib/atol.3#2 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)atol.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/stdlib/atol.3,v 1.14 2007/01/09 00:28:09 imp Exp $ +.\" $FreeBSD: src/lib/libc/stdlib/atol.3,v 1.15 2009/02/08 08:26:58 keramida Exp $ .\" -.Dd November 28, 2001 +.Dd February 1, 2009 .Dt ATOL 3 .Os .Sh NAME @@ -78,13 +78,42 @@ It is equivalent to: .Pp .Dl "strtoll(nptr, (char **)NULL, 10);" +.Sh COMPATIBILITY +The +.Fx +implementations of the +.Fn atol +and +.Fn atoll +functions are thin wrappers around +.Fn strtol +and +.Fn stroll +respectively, so these functions will affect the value of +.Va errno +in the same way that the +.Fn strtol +and +.Fn stroll +functions are able to. +This behavior of +.Fn atol +and +.Fn atoll +is not required by +.St -isoC +or +.St -isoC-c99 , +but it is allowed by all of +.St -isoC , St -isoC-99 +and +.St -p1003.1-2001 . .Sh ERRORS The functions .Fn atol and .Fn atoll -need not -affect the value of +may affect the value of .Va errno on an error. .Sh SEE ALSO ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/string/memchr.c#3 (text+ko) ==== @@ -34,7 +34,7 @@ static char sccsid[] = "@(#)memchr.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/string/memchr.c,v 1.7 2009/02/03 20:25:36 imp Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/string/memchr.c,v 1.8 2009/02/07 19:34:44 imp Exp $"); #include @@ -45,7 +45,7 @@ const unsigned char *p = s; do { - if (*p++ == c) + if (*p++ == (unsigned char)c) return ((void *)(p - 1)); } while (--n != 0); } ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/sys/send.2#2 (text+ko) ==== @@ -26,9 +26,9 @@ .\" SUCH DAMAGE. .\" .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 -.\" $FreeBSD: src/lib/libc/sys/send.2,v 1.36 2007/04/27 10:30:31 roam Exp $ +.\" $FreeBSD: src/lib/libc/sys/send.2,v 1.37 2009/02/05 14:06:09 jamie Exp $ .\" -.Dd September 13, 2006 +.Dd February 5, 2009 .Dt SEND 2 .Os .Sh NAME @@ -190,7 +190,7 @@ The remote host was down. .It Bq Er ENETDOWN The remote network was down. -.It Bq Er EPERM +.It Bq Er EADDRNOTAVAIL The process using a .Dv SOCK_RAW socket was jailed and the source ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc_r/uthread/uthread_init.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc_r/uthread/uthread_init.c,v 1.51 2007/01/12 07:25:26 imp Exp $ + * $FreeBSD: src/lib/libc_r/uthread/uthread_init.c,v 1.52 2009/02/08 06:44:58 deischen Exp $ */ /* Allocate space for global thread variables here: */ @@ -95,6 +95,7 @@ &_getsockopt, &_ioctl, &_kevent, + &_kqueue, &_listen, &_nanosleep, &_open, ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libdisk/open_disk.c#2 (text+ko) ==== @@ -8,7 +8,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libdisk/open_disk.c,v 1.13 2008/04/24 00:11:15 marcel Exp $"); +__FBSDID("$FreeBSD: src/lib/libdisk/open_disk.c,v 1.14 2009/02/09 21:34:06 lulf Exp $"); #include #include @@ -127,6 +127,9 @@ name, a, b, line); } + /* Sanitize the parameters. */ + Sanitize_Bios_Geom(d); + /* * Calculate the number of cylinders this disk must have. If we have * an obvious insanity, we set the number of cylinders to zero. ==== //depot/projects/soc2008/trasz_nfs4acl/lib/msun/src/math.h#5 (text+ko) ==== @@ -11,7 +11,7 @@ /* * from: @(#)fdlibm.h 5.1 93/09/24 - * $FreeBSD: src/lib/msun/src/math.h,v 1.75 2009/01/08 06:12:03 das Exp $ + * $FreeBSD: src/lib/msun/src/math.h,v 1.76 2009/02/07 05:41:24 das Exp $ */ #ifndef _MATH_H_ @@ -70,12 +70,12 @@ /* XXX We need a . */ #if defined(__ia64__) || defined(__sparc64__) -#define FP_FAST_FMA +#define FP_FAST_FMA 1 #endif #ifdef __ia64__ -#define FP_FAST_FMAL +#define FP_FAST_FMAL 1 #endif -#define FP_FAST_FMAF +#define FP_FAST_FMAF 1 /* Symbolic constants to classify floating point numbers. */ #define FP_INFINITE 0x01 ==== //depot/projects/soc2008/trasz_nfs4acl/release/Makefile#6 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/Makefile,v 1.938 2008/11/13 01:47:08 kensmith Exp $ +# $FreeBSD: src/release/Makefile,v 1.940 2009/02/10 15:11:26 kensmith Exp $ # # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \ # [RELEASETAG=tag] @@ -191,7 +191,6 @@ .undef MAKE_FLOPPIES .if ${TARGET_ARCH} == "i386" -MAKE_FLOPPIES= true MAKE_DVD= SEPARATE_LIVEFS= SPLIT_MFSROOT= @@ -223,7 +222,6 @@ MFSLABEL= auto SEPARATE_LIVEFS= .elif ${TARGET_ARCH} == "amd64" -MAKE_FLOPPIES= true MAKE_DVD= FLOPPYSIZE= 1440 FLOPPYSPLITSIZE= 1392 ==== //depot/projects/soc2008/trasz_nfs4acl/release/scripts/doFS.sh#2 (text+ko) ==== @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: src/release/scripts/doFS.sh,v 1.60 2004/08/25 01:39:52 kensmith Exp $ +# $FreeBSD: src/release/scripts/doFS.sh,v 1.61 2009/02/10 15:07:57 kensmith Exp $ # set -ex @@ -73,8 +73,8 @@ if [ "x${DISKLABEL}" != "x" ] ; then ${DISKLABEL} ${MACHINE} -w ${BOOT} ${MDDEVICE} ${FSLABEL} - newfs -O1 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE}c - mount /dev/${MDDEVICE}c ${MNT} + newfs -O1 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE} + mount /dev/${MDDEVICE} ${MNT} else newfs -O1 -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE} mount /dev/${MDDEVICE} ${MNT} ==== //depot/projects/soc2008/trasz_nfs4acl/sbin/geom/class/part/geom_part.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sbin/geom/class/part/geom_part.c,v 1.16 2008/11/30 23:46:31 marcel Exp $"); +__FBSDID("$FreeBSD: src/sbin/geom/class/part/geom_part.c,v 1.17 2009/02/08 20:19:19 marcel Exp $"); #include @@ -187,17 +187,23 @@ find_provider(struct ggeom *gp, unsigned long long minsector) { struct gprovider *pp, *bestpp; - unsigned long long offset; + const char *s; unsigned long long sector, bestsector; bestpp = NULL; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { - offset = atoll(find_provcfg(pp, "offset")); - sector = offset / pp->lg_sectorsize; + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + sector = atoll(s) / pp->lg_sectorsize; + } else + sector = atoll(s); + if (sector < minsector) continue; if (bestpp != NULL && sector >= bestsector) continue; + bestpp = pp; bestsector = sector; } @@ -240,7 +246,7 @@ struct gprovider *pp; const char *s, *scheme; unsigned long long first, last, sector, end; - unsigned long long offset, length, secsz; + unsigned long long length, secsz; int idx, wblocks, wname; scheme = find_geomcfg(gp, "scheme"); @@ -258,14 +264,24 @@ scheme, fmtsize(pp->lg_mediasize)); while ((pp = find_provider(gp, first)) != NULL) { - s = find_provcfg(pp, "offset"); - offset = atoll(s); - sector = offset / secsz; - s = find_provcfg(pp, "length"); - length = atoll(s); + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + sector = atoll(s) / secsz; + } else + sector = atoll(s); + + s = find_provcfg(pp, "end"); + if (s == NULL) { + s = find_provcfg(pp, "length"); + length = atoll(s) / secsz; + end = sector + length - 1; + } else { + end = atoll(s); + length = end - sector + 1; + } s = find_provcfg(pp, "index"); idx = atoi(s); - end = sector + length / secsz; if (first < sector) { printf(" %*llu %*llu %*s - free - (%s)\n", wblocks, first, wblocks, sector - first, @@ -273,16 +289,17 @@ fmtsize((sector - first) * secsz)); } printf(" %*llu %*llu %*d %s %s (%s)\n", - wblocks, sector, wblocks, end - sector, + wblocks, sector, wblocks, length, wname, idx, find_provcfg(pp, element), fmtattrib(pp), fmtsize(pp->lg_mediasize)); - first = end; + first = end + 1; } if (first <= last) { + length = last - first + 1; printf(" %*llu %*llu %*s - free - (%s)\n", - wblocks, first, wblocks, last - first + 1, + wblocks, first, wblocks, length, wname, "", - fmtsize((last - first + 1) * secsz)); + fmtsize(length * secsz)); } printf("\n"); } ==== //depot/projects/soc2008/trasz_nfs4acl/sbin/ifconfig/ifieee80211.c#11 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sbin/ifconfig/ifieee80211.c,v 1.74 2009/02/03 00:15:19 delphij Exp $ + * $FreeBSD: src/sbin/ifconfig/ifieee80211.c,v 1.75 2009/02/07 01:12:51 sam Exp $ */ /*- @@ -99,10 +99,6 @@ #define IEEE80211_FIXED_RATE_NONE 0xff #endif -#define REQ_ECM 0x01000000 /* enable if ECM set */ -#define REQ_OUTDOOR 0x02000000 /* enable for outdoor operation */ -#define REQ_FLAGS 0xff000000 /* private flags, don't pass to os */ - /* XXX need these publicly defined or similar */ #ifndef IEEE80211_NODE_AUTH #define IEEE80211_NODE_AUTH 0x0001 /* authorized for data */ @@ -1802,6 +1798,57 @@ return 0; } +/* + * Check channel compatibility. + */ +static int +checkchan(const struct ieee80211req_chaninfo *avail, int freq, int flags) +{ + flags &= ~REQ_FLAGS; + /* + * Check if exact channel is in the calibration table; + * everything below is to deal with channels that we + * want to include but that are not explicitly listed. + */ + if (flags & IEEE80211_CHAN_HT40) { + /* NB: we use an HT40 channel center that matches HT20 */ + flags = (flags &~ IEEE80211_CHAN_HT40) | IEEE80211_CHAN_HT20; + } + if (chanlookup(avail->ic_chans, avail->ic_nchans, freq, flags) != NULL) + return 1; + if (flags & IEEE80211_CHAN_GSM) { + /* + * XXX GSM frequency mapping is handled in the kernel + * so we cannot find them in the calibration table; + * just accept the channel and the kernel will reject + * the channel list if it's wrong. + */ + return 1; + } + /* + * If this is a 1/2 or 1/4 width channel allow it if a full + * width channel is present for this frequency, and the device + * supports fractional channels on this band. This is a hack + * that avoids bloating the calibration table; it may be better + * by per-band attributes though (we are effectively calculating + * this attribute by scanning the channel list ourself). + */ + if ((flags & (IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER)) == 0) + return 0; + if (chanlookup(avail->ic_chans, avail->ic_nchans, freq, + flags &~ (IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER)) == NULL) + return 0; + if (flags & IEEE80211_CHAN_HALF) { + return chanfind(avail->ic_chans, avail->ic_nchans, + IEEE80211_CHAN_HALF | + (flags & (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ))); + } else { + return chanfind(avail->ic_chans, avail->ic_nchans, + IEEE80211_CHAN_QUARTER | + (flags & (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ))); + } +} + static void regdomain_addchans(struct ieee80211req_chaninfo *ci, const netband_head *bands, @@ -1812,15 +1859,12 @@ const struct netband *nb; const struct freqband *b; struct ieee80211_channel *c, *prev; - int freq, channelSep, hasHalfChans, hasQuarterChans; + int freq, hi_adj, lo_adj, channelSep; + uint32_t flags; + hi_adj = (chanFlags & IEEE80211_CHAN_HT40U) ? -20 : 0; + lo_adj = (chanFlags & IEEE80211_CHAN_HT40D) ? 20 : 0; channelSep = (chanFlags & IEEE80211_CHAN_2GHZ) ? 0 : 40; - hasHalfChans = chanfind(avail->ic_chans, avail->ic_nchans, - IEEE80211_CHAN_HALF | - (chanFlags & (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ))); - hasQuarterChans = chanfind(avail->ic_chans, avail->ic_nchans, - IEEE80211_CHAN_QUARTER | - (chanFlags & (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ))); LIST_FOREACH(nb, bands, next) { b = nb->band; if (verbose) { @@ -1831,63 +1875,80 @@ putchar('\n'); } prev = NULL; - for (freq = b->freqStart; freq <= b->freqEnd; freq += b->chanSep) { - uint32_t flags = nb->flags | b->flags; - - /* check if device can operate on this frequency */ + for (freq = b->freqStart + lo_adj; + freq <= b->freqEnd + hi_adj; freq += b->chanSep) { + /* + * Construct flags for the new channel. We take + * the attributes from the band descriptions except + * for HT40 which is enabled generically (i.e. +/- + * extension channel) in the band description and + * then constrained according by channel separation. + */ + flags = nb->flags | b->flags; + if (flags & IEEE80211_CHAN_HT) { + /* + * HT channels are generated specially; we're + * called to add HT20, HT40+, and HT40- chan's + * so we need to expand only band specs for + * the HT channel type being added. + */ + if ((chanFlags & IEEE80211_CHAN_HT20) && + (flags & IEEE80211_CHAN_HT20) == 0) { + if (verbose) + printf("%u: skip, not an " + "HT20 channel\n", freq); + continue; + } + if ((chanFlags & IEEE80211_CHAN_HT40) && + (flags & IEEE80211_CHAN_HT40) == 0) { + if (verbose) + printf("%u: skip, not an " + "HT40 channel\n", freq); + continue; + } + /* + * DFS and HT40 don't mix. This should be + * expressed in the regdomain database but + * just in case enforce it here. + */ + if ((chanFlags & IEEE80211_CHAN_HT40) && + (flags & IEEE80211_CHAN_DFS)) { + if (verbose) + printf("%u: skip, HT40+DFS " + "not permitted\n", freq); + continue; + } + /* NB: HT attribute comes from caller */ + flags &= ~IEEE80211_CHAN_HT; + flags |= chanFlags & IEEE80211_CHAN_HT; + } /* - * XXX GSM frequency mapping is handled in the kernel - * so we cannot find them in the calibration table; - * just construct the list and the kernel will reject - * if it's wrong. + * Check if device can operate on this frequency. */ - if (chanlookup(avail->ic_chans, avail->ic_nchans, freq, chanFlags) == NULL && - (flags & IEEE80211_CHAN_GSM) == 0) { + if (!checkchan(avail, freq, flags)) { if (verbose) { printf("%u: skip, ", freq); - printb("flags", chanFlags, + printb("flags", flags, IEEE80211_CHAN_BITS); printf(" not available\n"); } continue; } - if ((flags & IEEE80211_CHAN_HALF) && !hasHalfChans) { + if ((flags & REQ_ECM) && !reg->ecm) { if (verbose) - printf("%u: skip, device does not " - "support half-rate channel\n", - freq); + printf("%u: skip, ECM channel\n", freq); continue; } - if ((flags & IEEE80211_CHAN_QUARTER) && - !hasQuarterChans) { + if ((flags & REQ_INDOOR) && reg->location == 'O') { if (verbose) - printf("%u: skip, device does not " - "support quarter-rate channel\n", + printf("%u: skip, indoor channel\n", freq); continue; } - if ((flags & IEEE80211_CHAN_HT20) && - (chanFlags & IEEE80211_CHAN_HT20) == 0) { - if (verbose) - printf("%u: skip, device does not " - "support HT20 operation\n", freq); - continue; - } - if ((flags & IEEE80211_CHAN_HT40) && - (chanFlags & IEEE80211_CHAN_HT40) == 0) { - if (verbose) >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed Feb 11 10:47:15 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7F5861065729; Wed, 11 Feb 2009 10:47:15 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CADE1065728 for ; Wed, 11 Feb 2009 10:47:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 080B48FC17 for ; Wed, 11 Feb 2009 10:47:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BAlEpI003351 for ; Wed, 11 Feb 2009 10:47:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BAlERw003349 for perforce@freebsd.org; Wed, 11 Feb 2009 10:47:14 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 11 Feb 2009 10:47:14 GMT Message-Id: <200902111047.n1BAlERw003349@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157533 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: Wed, 11 Feb 2009 10:47:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=157533 Change 157533 by hselasky@hselasky_laptop001 on 2009/02/11 10:46:55 USB WLAN patches: - adjust timeouts back to the "HPS" values and add detach detection to the pause mechanism. - fix an extra unlock in RUM driver. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#34 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#33 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#35 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#34 (text+ko) ==== @@ -177,7 +177,7 @@ static void rum_read_eeprom(struct rum_softc *); static int rum_bbp_init(struct rum_softc *); static void rum_init(void *); -static int rum_load_microcode(struct rum_softc *, const u_char *, +static int rum_load_microcode(struct rum_softc *, const uint8_t *, size_t); static int rum_prepare_beacon(struct rum_softc *, struct ieee80211vap *); @@ -193,6 +193,7 @@ static void rum_amrr_start(struct rum_softc *, struct ieee80211_node *); static void rum_amrr_timeout(void *); +static uint8_t rum_pause(struct rum_softc *, unsigned int); static void rum_queue_command(struct rum_softc *, usb2_proc_callback_t *, struct usb2_proc_msg *, struct usb2_proc_msg *); @@ -447,12 +448,13 @@ uint8_t bands; /* retrieve RT2573 rev. no */ - for (ntries = 0; ntries != 1000; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if ((tmp = rum_read(sc, RT2573_MAC_CSR0)) != 0) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 1000) { + if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for chip to settle\n"); return; } @@ -465,7 +467,6 @@ error = rum_load_microcode(sc, rt2573_ucode, sizeof(rt2573_ucode)); if (error != 0) { - RUM_UNLOCK(sc); device_printf(sc->sc_dev, "could not load 8051 microcode\n"); return; } @@ -1481,12 +1482,13 @@ uint32_t tmp; int ntries; - for (ntries = 0; ntries != 5; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not write to BBP\n"); return; } @@ -1501,12 +1503,13 @@ uint32_t val; int ntries; - for (ntries = 0; ntries != 5; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not read BBP\n"); return 0; } @@ -1514,11 +1517,12 @@ val = RT2573_BBP_BUSY | RT2573_BBP_READ | reg << 8; rum_write(sc, RT2573_PHY_CSR3, val); - for (ntries = 0; ntries != 10; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { val = rum_read(sc, RT2573_PHY_CSR3); if (!(val & RT2573_BBP_BUSY)) return val & 0xff; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (rum_pause(sc, hz / 100)) + break; } device_printf(sc->sc_dev, "could not read BBP\n"); @@ -1531,12 +1535,13 @@ uint32_t tmp; int ntries; - for (ntries = 0; ntries != 5; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR4) & RT2573_RF_BUSY)) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not write to RF\n"); return; } @@ -1683,7 +1688,8 @@ const struct rfprog *rfprog; uint8_t bbp3, bbp94 = RT2573_BBPR94_DEFAULT; int8_t power; - u_int i, chan; + unsigned int i; + unsigned int chan; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) @@ -1730,7 +1736,7 @@ rum_rf_write(sc, RT2573_RF3, rfprog[i].r3 | power << 7); rum_rf_write(sc, RT2573_RF4, rfprog[i].r4 | sc->rffreq << 10); - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + (void)rum_pause(sc, hz / 100); /* enable smart mode for MIMO-capable RFs */ bbp3 = rum_bbp_read(sc, 3); @@ -1743,6 +1749,9 @@ if (bbp94 != RT2573_BBPR94_DEFAULT) rum_bbp_write(sc, 94, bbp94); + + /* give the chip some extra time to do the switchover */ + (void)rum_pause(sc, hz / 100); } /* @@ -1946,7 +1955,8 @@ const uint8_t val = rum_bbp_read(sc, 0); if (val != 0 && val != 0xff) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (rum_pause(sc, hz / 100)) + break; } if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for BBP\n"); @@ -1993,13 +2003,14 @@ rum_write(sc, RT2573_MAC_CSR1, 0); /* wait for BBP/RF to wakeup */ - for (ntries = 0; ntries != 1000; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if (rum_read(sc, RT2573_MAC_CSR12) & 8) break; rum_write(sc, RT2573_MAC_CSR12, 4); /* force wakeup */ - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (rum_pause(sc, hz / 100)) + break; } - if (ntries == 1000) { + if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for BBP/RF to wakeup\n"); goto fail; @@ -2101,12 +2112,17 @@ } static int -rum_load_microcode(struct rum_softc *sc, const u_char *ucode, size_t size) +rum_load_microcode(struct rum_softc *sc, const uint8_t *ucode, size_t size) { struct usb2_device_request req; uint16_t reg = RT2573_MCU_CODE_BASE; usb2_error_t error; + /* + * TODO: If the firmware is already loaded, + * then we need to return from here! + */ + /* copy firmware image into NIC */ for (; size >= 4; reg += 4, ucode += 4, size -= 4) rum_write(sc, reg, UGETDW(ucode)); @@ -2405,6 +2421,16 @@ return rssi; } +static uint8_t +rum_pause(struct rum_softc *sc, unsigned int timeout) +{ + if (usb2_proc_is_gone(&sc->sc_tq)) + return (1); + + usb2_pause_mtx(&sc->sc_mtx, timeout); + return (0); +} + static void rum_queue_command(struct rum_softc *sc, usb2_proc_callback_t *fn, struct usb2_proc_msg *t0, struct usb2_proc_msg *t1) @@ -2413,10 +2439,6 @@ RUM_LOCK_ASSERT(sc, MA_OWNED); - if (usb2_proc_is_gone(&sc->sc_tq)) { - DPRINTF("proc is gone\n"); - return; /* nothing to do */ - } /* * NOTE: The task cannot get executed before we drop the * "sc_mtx" mutex. It is safe to update fields in the message ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#33 (text+ko) ==== @@ -166,6 +166,7 @@ static void ural_amrr_start(struct ural_softc *, struct ieee80211_node *); static void ural_amrr_timeout(void *); +static uint8_t ural_pause(struct ural_softc *sc, unsigned int timeout); static void ural_queue_command(struct ural_softc *, usb2_proc_callback_t *, struct usb2_proc_msg *, struct usb2_proc_msg *); @@ -1595,12 +1596,13 @@ uint16_t tmp; int ntries; - for (ntries = 0; ntries != 5; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR8) & RAL_BBP_BUSY)) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (ural_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not write to BBP\n"); return; } @@ -1618,12 +1620,13 @@ val = RAL_BBP_WRITE | reg << 8; ural_write(sc, RAL_PHY_CSR7, val); - for (ntries = 0; ntries != 5; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR8) & RAL_BBP_BUSY)) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (ural_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not read BBP\n"); return 0; } @@ -1637,12 +1640,13 @@ uint32_t tmp; int ntries; - for (ntries = 0; ntries != 5; ntries++) { + for (ntries = 0; ntries != 100; ntries++) { if (!(ural_read(sc, RAL_PHY_CSR10) & RAL_RF_LOBUSY)) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (ural_pause(sc, hz / 100)) + break; } - if (ntries == 5) { + if (ntries == 100) { device_printf(sc->sc_dev, "could not write to RF\n"); return; } @@ -1816,7 +1820,7 @@ /* clear CRC errors */ ural_read(sc, RAL_STA_CSR0); - usb2_pause_mtx(&sc->sc_mtx, hz / 100); + (void)ural_pause(sc, hz / 100); ural_disable_rf_tune(sc); } @@ -1824,6 +1828,9 @@ /* XXX doesn't belong here */ /* update basic rate set */ ural_set_basicrates(sc, c); + + /* give the hardware some time to do the switchover */ + (void)ural_pause(sc, hz / 100); } /* @@ -2042,7 +2049,8 @@ for (ntries = 0; ntries != 100; ntries++) { if (ural_bbp_read(sc, RAL_BBP_VERSION) != 0) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (ural_pause(sc, hz / 100)) + break; } if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for BBP\n"); @@ -2143,7 +2151,8 @@ if ((tmp & (RAL_BBP_AWAKE | RAL_RF_AWAKE)) == (RAL_BBP_AWAKE | RAL_RF_AWAKE)) break; - usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + if (ural_pause(sc, hz / 100)) + break; } if (ntries == 100) { device_printf(sc->sc_dev, @@ -2238,7 +2247,11 @@ ural_write(sc, RAL_TXRX_CSR2, RAL_DISABLE_RX); /* reset ASIC and BBP (but won't reset MAC registers!) */ ural_write(sc, RAL_MAC_CSR1, RAL_RESET_ASIC | RAL_RESET_BBP); + /* wait a little */ + (void)ural_pause(sc, hz / 10); ural_write(sc, RAL_MAC_CSR1, 0); + /* wait a little */ + (void)ural_pause(sc, hz / 10); } static int @@ -2353,6 +2366,16 @@ ifp->if_oerrors += fail; /* count TX retry-fail as Tx errors */ } +static uint8_t +ural_pause(struct ural_softc *sc, unsigned int timeout) +{ + if (usb2_proc_is_gone(&sc->sc_tq)) + return (1); + + usb2_pause_mtx(&sc->sc_mtx, timeout); + return (0); +} + static void ural_queue_command(struct ural_softc *sc, usb2_proc_callback_t *fn, struct usb2_proc_msg *t0, struct usb2_proc_msg *t1) @@ -2361,10 +2384,6 @@ RAL_LOCK_ASSERT(sc, MA_OWNED); - if (usb2_proc_is_gone(&sc->sc_tq)) { - DPRINTF("proc is gone\n"); - return; /* nothing to do */ - } /* * NOTE: The task cannot get executed before we drop the * "sc_mtx" mutex. It is safe to update fields in the message ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#35 (text+ko) ==== @@ -3091,10 +3091,6 @@ ZYD_LOCK_ASSERT(sc, MA_OWNED); - if (usb2_proc_is_gone(&sc->sc_tq)) { - DPRINTF(sc, ZYD_DEBUG_STATE, "proc is gone\n"); - return; /* nothing to do */ - } /* * NOTE: The task cannot get executed before we drop the * "sc_mtx" mutex. It is safe to update fields in the message From owner-p4-projects@FreeBSD.ORG Wed Feb 11 12:33:03 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 289C610659E3; Wed, 11 Feb 2009 12:33:03 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1B31065983 for ; Wed, 11 Feb 2009 12:33:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 719F88FC15 for ; Wed, 11 Feb 2009 12:33:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BCX2N6016515 for ; Wed, 11 Feb 2009 12:33:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BCX2xR016513 for perforce@freebsd.org; Wed, 11 Feb 2009 12:33:02 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 11 Feb 2009 12:33:02 GMT Message-Id: <200902111233.n1BCX2xR016513@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157536 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: Wed, 11 Feb 2009 12:33:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=157536 Change 157536 by hselasky@hselasky_laptop001 on 2009/02/11 12:33:01 USB WLAN patches - more patches taken from the "HPS" version of the USB WLAN drivers. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#35 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#34 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#36 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#8 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#35 (text+ko) ==== @@ -54,9 +54,6 @@ "Debug level"); #endif -#define rum_do_request(sc,req,data) \ - usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) - static const struct usb2_device_id rum_devs[] = { { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_HWU54DM) }, { USB_VP(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573_2) }, @@ -128,6 +125,8 @@ static usb2_proc_callback_t rum_stop_task; static usb2_proc_callback_t rum_flush_task; +static void rum_do_request(struct rum_softc *sc, + struct usb2_device_request *req, void *data); static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], @@ -173,6 +172,8 @@ static void rum_update_slot(struct ifnet *); static void rum_set_bssid(struct rum_softc *, const uint8_t *); static void rum_set_macaddr(struct rum_softc *, const uint8_t *); +static void rum_update_mcast(struct ifnet *); +static void rum_update_promisc(struct ifnet *); static const char *rum_get_rf(int); static void rum_read_eeprom(struct rum_softc *); static int rum_bbp_init(struct rum_softc *); @@ -515,6 +516,8 @@ ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic); + ic->ic_update_mcast = rum_update_mcast; + ic->ic_update_promisc = rum_update_promisc; ic->ic_newassoc = rum_newassoc; ic->ic_raw_xmit = rum_raw_xmit; ic->ic_node_alloc = rum_node_alloc; @@ -575,6 +578,31 @@ return (0); } +static void +rum_do_request(struct rum_softc *sc, + struct usb2_device_request *req, void *data) +{ + usb2_error_t err; + + /* + * Occasionally the RUM chip will just generate control + * request timeouts. Probably a USB driver bug in the + * firmware! Try to workaround the problem. + */ + retry: + err = usb2_do_request_proc(sc->sc_udev, &sc->sc_tq, + req, data, 0, NULL, 250 /* ms */); + + if (err) { + if (!usb2_proc_is_gone(&sc->sc_tq)) { + DPRINTFN(1, "Control request failed! (ignored)\n"); + rum_pause(sc, hz / 100); + goto retry; + } + } + return; +} + static struct ieee80211vap * rum_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, int opmode, int flags, @@ -1403,7 +1431,6 @@ rum_eeprom_read(struct rum_softc *sc, uint16_t addr, void *buf, int len) { struct usb2_device_request req; - usb2_error_t error; req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = RT2573_READ_EEPROM; @@ -1411,11 +1438,7 @@ USETW(req.wIndex, addr); USETW(req.wLength, len); - error = rum_do_request(sc, &req, buf); - if (error != 0) { - device_printf(sc->sc_dev, "could not read EEPROM: %s\n", - usb2_errstr(error)); - } + rum_do_request(sc, &req, buf); } static uint32_t @@ -1432,7 +1455,6 @@ rum_read_multi(struct rum_softc *sc, uint16_t reg, void *buf, int len) { struct usb2_device_request req; - usb2_error_t error; req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = RT2573_READ_MULTI_MAC; @@ -1440,12 +1462,7 @@ USETW(req.wIndex, reg); USETW(req.wLength, len); - error = rum_do_request(sc, &req, buf); - if (error != 0) { - device_printf(sc->sc_dev, - "could not multi read MAC register(0x%04x): %s\n", - reg, usb2_errstr(error)); - } + rum_do_request(sc, &req, buf); } static void @@ -1460,7 +1477,6 @@ rum_write_multi(struct rum_softc *sc, uint16_t reg, void *buf, size_t len) { struct usb2_device_request req; - usb2_error_t error; req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = RT2573_WRITE_MULTI_MAC; @@ -1468,12 +1484,7 @@ USETW(req.wIndex, reg); USETW(req.wLength, len); - error = rum_do_request(sc, &req, buf); - if (error != 0) { - device_printf(sc->sc_dev, - "could not multi write MAC register(0x%04x): %s\n", - reg, usb2_errstr(error)); - } + rum_do_request(sc, &req, buf); } static void @@ -1849,6 +1860,27 @@ "entering" : "leaving"); } +static void +rum_update_mcast(struct ifnet *ifp) +{ + /* not supported */ +} + +static void +rum_update_promisc(struct ifnet *ifp) +{ + struct rum_softc *sc = ifp->if_softc; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + RUM_LOCK(sc); + rum_queue_command(sc, rum_promisctask, + &sc->sc_promisctask[0].hdr, + &sc->sc_promisctask[1].hdr); + RUM_UNLOCK(sc); +} + static const char * rum_get_rf(int rev) { @@ -2116,7 +2148,6 @@ { struct usb2_device_request req; uint16_t reg = RT2573_MCU_CODE_BASE; - usb2_error_t error; /* * TODO: If the firmware is already loaded, @@ -2133,12 +2164,8 @@ USETW(req.wIndex, 0); USETW(req.wLength, 0); - error = rum_do_request(sc, &req, NULL); - if (error != 0) { - device_printf(sc->sc_dev, "could not run firmware: %s\n", - usb2_errstr(error)); - } - return error; + rum_do_request(sc, &req, NULL); + return (0); } static int ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#34 (text+ko) ==== @@ -55,9 +55,6 @@ "Debug level"); #endif -#define ural_do_request(sc,req,data) \ - usb2_do_request_proc((sc)->sc_udev, &(sc)->sc_tq, req, data, 0, NULL, 5000) - #define URAL_RSSI(rssi) \ ((rssi) > (RAL_NOISE_FLOOR + RAL_RSSI_CORR) ? \ ((rssi) - (RAL_NOISE_FLOOR + RAL_RSSI_CORR)) : 0) @@ -107,6 +104,8 @@ static usb2_proc_callback_t ural_stop_task; static usb2_proc_callback_t ural_flush_task; +static void ural_do_request(struct ural_softc *sc, + struct usb2_device_request *req, void *data); static struct ieee80211vap *ural_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], @@ -155,6 +154,8 @@ const struct ieee80211_channel *); static void ural_set_bssid(struct ural_softc *, const uint8_t *); static void ural_set_macaddr(struct ural_softc *, uint8_t *); +static void ural_update_mcast(struct ifnet *); +static void ural_update_promisc(struct ifnet *); static const char *ural_get_rf(int); static void ural_read_eeprom(struct ural_softc *); static int ural_bbp_init(struct ural_softc *); @@ -501,6 +502,8 @@ ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic); + ic->ic_update_mcast = ural_update_mcast; + ic->ic_update_promisc = ural_update_promisc; ic->ic_newassoc = ural_newassoc; ic->ic_raw_xmit = ural_raw_xmit; ic->ic_node_alloc = ural_node_alloc; @@ -561,6 +564,25 @@ return (0); } +static void +ural_do_request(struct ural_softc *sc, + struct usb2_device_request *req, void *data) +{ + usb2_error_t err; + + retry: + err = usb2_do_request_proc(sc->sc_udev, &sc->sc_tq, + req, data, 0, NULL, 250 /* ms */); + + if (err) { + if (!usb2_proc_is_gone(&sc->sc_tq)) { + DPRINTFN(1, "Control request failed! (ignored)\n"); + ural_pause(sc, hz / 100); + goto retry; + } + } +} + static struct ieee80211vap * ural_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, int opmode, int flags, @@ -1476,7 +1498,6 @@ ural_set_testmode(struct ural_softc *sc) { struct usb2_device_request req; - usb2_error_t error; req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = RAL_VENDOR_REQUEST; @@ -1484,18 +1505,13 @@ USETW(req.wIndex, 1); USETW(req.wLength, 0); - error = ural_do_request(sc, &req, NULL); - if (error != 0) { - device_printf(sc->sc_dev, "could not set test mode: %s\n", - usb2_errstr(error)); - } + ural_do_request(sc, &req, NULL); } static void ural_eeprom_read(struct ural_softc *sc, uint16_t addr, void *buf, int len) { struct usb2_device_request req; - usb2_error_t error; req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = RAL_READ_EEPROM; @@ -1503,18 +1519,13 @@ USETW(req.wIndex, addr); USETW(req.wLength, len); - error = ural_do_request(sc, &req, buf); - if (error != 0) { - device_printf(sc->sc_dev, "could not read EEPROM: %s\n", - usb2_errstr(error)); - } + ural_do_request(sc, &req, buf); } static uint16_t ural_read(struct ural_softc *sc, uint16_t reg) { struct usb2_device_request req; - usb2_error_t error; uint16_t val; req.bmRequestType = UT_READ_VENDOR_DEVICE; @@ -1523,12 +1534,7 @@ USETW(req.wIndex, reg); USETW(req.wLength, sizeof (uint16_t)); - error = ural_do_request(sc, &req, &val); - if (error != 0) { - device_printf(sc->sc_dev, "could not read MAC register: %s\n", - usb2_errstr(error)); - return 0; - } + ural_do_request(sc, &req, &val); return le16toh(val); } @@ -1537,7 +1543,6 @@ ural_read_multi(struct ural_softc *sc, uint16_t reg, void *buf, int len) { struct usb2_device_request req; - usb2_error_t error; req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = RAL_READ_MULTI_MAC; @@ -1545,18 +1550,13 @@ USETW(req.wIndex, reg); USETW(req.wLength, len); - error = ural_do_request(sc, &req, buf); - if (error != 0) { - device_printf(sc->sc_dev, "could not read MAC register: %s\n", - usb2_errstr(error)); - } + ural_do_request(sc, &req, buf); } static void ural_write(struct ural_softc *sc, uint16_t reg, uint16_t val) { struct usb2_device_request req; - usb2_error_t error; req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = RAL_WRITE_MAC; @@ -1564,18 +1564,13 @@ USETW(req.wIndex, reg); USETW(req.wLength, 0); - error = ural_do_request(sc, &req, NULL); - if (error != 0) { - device_printf(sc->sc_dev, "could not write MAC register: %s\n", - usb2_errstr(error)); - } + ural_do_request(sc, &req, NULL); } static void ural_write_multi(struct ural_softc *sc, uint16_t reg, void *buf, int len) { struct usb2_device_request req; - usb2_error_t error; req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = RAL_WRITE_MULTI_MAC; @@ -1583,11 +1578,7 @@ USETW(req.wIndex, reg); USETW(req.wLength, len); - error = ural_do_request(sc, &req, buf); - if (error != 0) { - device_printf(sc->sc_dev, "could not write MAC register: %s\n", - usb2_errstr(error)); - } + ural_do_request(sc, &req, buf); } static void @@ -2000,6 +1991,27 @@ "entering" : "leaving"); } +static void +ural_update_mcast(struct ifnet *ifp) +{ + /* not supported */ +} + +static void +ural_update_promisc(struct ifnet *ifp) +{ + struct ural_softc *sc = ifp->if_softc; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + RAL_LOCK(sc); + ural_queue_command(sc, ural_promisctask, + &sc->sc_promisctask[0].hdr, + &sc->sc_promisctask[1].hdr); + RAL_UNLOCK(sc); +} + static const char * ural_get_rf(int rev) { ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#36 (text+ko) ==== @@ -419,7 +419,12 @@ ic->ic_vap_create = zyd_vap_create; ic->ic_vap_delete = zyd_vap_delete; + /* + * The same callback function is used for multicast a + * promiscious mode: + */ ic->ic_update_mcast = zyd_update_mcast; + ic->ic_update_promisc = zyd_update_mcast; bpfattach(ifp, DLT_IEEE802_11_RADIO, sizeof(struct ieee80211_frame) + sizeof(sc->sc_txtap)); @@ -2748,9 +2753,9 @@ ZYD_LOCK(sc); if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if ((ifp->if_flags ^ sc->sc_if_flags) & - (IFF_ALLMULTI | IFF_PROMISC)) - zyd_set_multi(sc); + zyd_queue_command(sc, zyd_multitask, + &sc->sc_mcasttask[0].hdr, + &sc->sc_mcasttask[1].hdr); } else { zyd_queue_command(sc, zyd_init_task, &sc->sc_synctask[0].hdr, @@ -2764,7 +2769,6 @@ &sc->sc_synctask[1].hdr); } } - sc->sc_if_flags = ifp->if_flags; ZYD_UNLOCK(sc); if (startall) ieee80211_start_all(ic); ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#8 (text+ko) ==== @@ -1274,7 +1274,6 @@ #define ZYD_FLAG_FWLOADED (1 << 0) #define ZYD_FLAG_INITONCE (1 << 1) #define ZYD_FLAG_INITDONE (1 << 2) - int sc_if_flags; struct zyd_task sc_synctask[2]; struct zyd_task sc_mcasttask[2]; From owner-p4-projects@FreeBSD.ORG Wed Feb 11 15:04:38 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7473F1065672; Wed, 11 Feb 2009 15:04:38 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ED56106566C for ; Wed, 11 Feb 2009 15:04:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0AF8FC18 for ; Wed, 11 Feb 2009 15:04:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BF4b6E042555 for ; Wed, 11 Feb 2009 15:04:37 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BF4bT4042553 for perforce@freebsd.org; Wed, 11 Feb 2009 15:04:37 GMT (envelope-from jhb@freebsd.org) Date: Wed, 11 Feb 2009 15:04:37 GMT Message-Id: <200902111504.n1BF4bT4042553@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 157542 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: Wed, 11 Feb 2009 15:04:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=157542 Change 157542 by jhb@jhb_jhbbsd on 2009/02/11 15:04:28 IFC @157539 Affected files ... .. //depot/projects/smpng/sys/boot/sparc64/loader/main.c#27 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_cd.c#36 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_da.c#84 integrate .. //depot/projects/smpng/sys/dev/arcmsr/arcmsr.c#19 integrate .. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c#4 integrate .. //depot/projects/smpng/sys/dev/ath/if_ath.c#66 integrate .. //depot/projects/smpng/sys/dev/bge/if_bge.c#104 integrate .. //depot/projects/smpng/sys/dev/iicbus/if_ic.c#19 integrate .. //depot/projects/smpng/sys/dev/iicbus/iicbb.c#10 integrate .. //depot/projects/smpng/sys/dev/iicbus/iicbus.c#14 integrate .. //depot/projects/smpng/sys/dev/iicbus/iicsmb.c#10 integrate .. //depot/projects/smpng/sys/dev/ppbus/lpt.c#25 integrate .. //depot/projects/smpng/sys/dev/ppc/ppc_pci.c#4 integrate .. //depot/projects/smpng/sys/dev/re/if_re.c#71 integrate .. //depot/projects/smpng/sys/dev/sdhci/sdhci.c#6 integrate .. //depot/projects/smpng/sys/dev/sis/if_sis.c#3 integrate .. //depot/projects/smpng/sys/dev/sound/pci/envy24.c#13 integrate .. //depot/projects/smpng/sys/dev/sound/pci/envy24ht.c#10 integrate .. //depot/projects/smpng/sys/dev/sound/pci/spicds.c#4 integrate .. //depot/projects/smpng/sys/dev/tl/if_tl.c#2 integrate .. //depot/projects/smpng/sys/dev/tx/if_tx.c#31 integrate .. //depot/projects/smpng/sys/dev/uart/uart_bus_pci.c#10 integrate .. //depot/projects/smpng/sys/ia64/ia64/mp_machdep.c#40 integrate .. //depot/projects/smpng/sys/kern/kern_linker.c#98 integrate .. //depot/projects/smpng/sys/kern/link_elf.c#48 integrate .. //depot/projects/smpng/sys/kern/link_elf_obj.c#22 integrate .. //depot/projects/smpng/sys/kern/subr_bus.c#73 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_adhoc.c#5 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_tdma.c#3 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c#19 integrate .. //depot/projects/smpng/sys/pci/if_rlreg.h#50 integrate .. //depot/projects/smpng/sys/sparc64/include/bus_private.h#8 integrate .. //depot/projects/smpng/sys/sparc64/include/vmparam.h#18 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/iommu.c#35 integrate .. //depot/projects/smpng/sys/sun4v/include/vmparam.h#6 integrate .. //depot/projects/smpng/sys/sys/kobj.h#8 integrate Differences ... ==== //depot/projects/smpng/sys/boot/sparc64/loader/main.c#27 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/sparc64/loader/main.c,v 1.39 2008/10/05 14:00:44 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/sparc64/loader/main.c,v 1.40 2009/02/10 21:48:42 marius Exp $"); /* * FreeBSD/sparc64 kernel loader - machine dependent part @@ -383,7 +383,7 @@ return (error); printf("jumping to kernel entry at %#lx.\n", e->e_entry); -#if LOADER_DEBUG +#ifdef LOADER_DEBUG pmap_print_tlb_sun4u(); #endif @@ -499,7 +499,7 @@ stxa(AA_IMMU_TAR, ASI_IMMU, TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); - flush(KERNBASE); + flush(PROMBASE); break; } wrpr(pstate, reg, 0); @@ -511,7 +511,7 @@ stxa(AA_IMMU_TAR, ASI_IMMU, TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL)); stxa(0, ASI_ITLB_DATA_IN_REG, data); - flush(KERNBASE); + flush(PROMBASE); wrpr(pstate, reg, 0); } @@ -837,7 +837,7 @@ } #ifdef LOADER_DEBUG -static const char *page_sizes[] = { +static const char *const page_sizes[] = { " 8k", " 64k", "512k", " 4m" }; ==== //depot/projects/smpng/sys/cam/scsi/scsi_cd.c#36 (text+ko) ==== @@ -46,7 +46,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.104 2009/01/08 00:45:47 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.105 2009/02/10 22:39:44 jhb Exp $"); #include "opt_cd.h" @@ -555,8 +555,6 @@ snprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number); snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); - mtx_lock(&Giant); - sysctl_ctx_init(&softc->sysctl_ctx); softc->flags |= CD_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, @@ -565,7 +563,6 @@ if (softc->sysctl_tree == NULL) { printf("cdsysctlinit: unable to allocate sysctl tree\n"); - mtx_unlock(&Giant); cam_periph_release(periph); return; } @@ -579,7 +576,6 @@ &softc->minimum_command_size, 0, cdcmdsizesysctl, "I", "Minimum CDB size"); - mtx_unlock(&Giant); cam_periph_release(periph); } ==== //depot/projects/smpng/sys/cam/scsi/scsi_da.c#84 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.233 2009/01/14 21:27:30 trasz Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.234 2009/02/10 22:39:44 jhb Exp $"); #include @@ -1086,7 +1086,6 @@ snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number); snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); - mtx_lock(&Giant); sysctl_ctx_init(&softc->sysctl_ctx); softc->flags |= DA_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, @@ -1094,7 +1093,6 @@ CTLFLAG_RD, 0, tmpstr); if (softc->sysctl_tree == NULL) { printf("dasysctlinit: unable to allocate sysctl tree\n"); - mtx_unlock(&Giant); cam_periph_release(periph); return; } @@ -1108,7 +1106,6 @@ &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); - mtx_unlock(&Giant); cam_periph_release(periph); } ==== //depot/projects/smpng/sys/dev/arcmsr/arcmsr.c#19 (text+ko) ==== @@ -56,7 +56,7 @@ ** and cause g_vfs_done() read write error ** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x ****************************************************************************************** -* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.28 2008/09/27 08:51:18 ed Exp $ +* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.29 2009/02/10 22:46:36 imp Exp $ */ #include #include @@ -140,12 +140,12 @@ */ static struct CommandControlBlock * arcmsr_get_freesrb(struct AdapterControlBlock *acb); static u_int8_t arcmsr_seek_cmd2abort(union ccb * abortccb); -static u_int32_t arcmsr_probe(device_t dev); -static u_int32_t arcmsr_attach(device_t dev); -static u_int32_t arcmsr_detach(device_t dev); +static int arcmsr_probe(device_t dev); +static int arcmsr_attach(device_t dev); +static int arcmsr_detach(device_t dev); static u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_cmd, caddr_t arg); static void arcmsr_iop_parking(struct AdapterControlBlock *acb); -static void arcmsr_shutdown(device_t dev); +static int arcmsr_shutdown(device_t dev); static void arcmsr_interrupt(struct AdapterControlBlock *acb); static void arcmsr_polling_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb); static void arcmsr_free_resource(struct AdapterControlBlock *acb); @@ -3029,7 +3029,7 @@ ************************************************************************ ************************************************************************ */ -static u_int32_t arcmsr_attach(device_t dev) +static int arcmsr_attach(device_t dev) { struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev); u_int32_t unit=device_get_unit(dev); @@ -3152,7 +3152,7 @@ ************************************************************************ ************************************************************************ */ -static u_int32_t arcmsr_probe(device_t dev) +static int arcmsr_probe(device_t dev) { u_int32_t id; static char buf[256]; @@ -3197,7 +3197,7 @@ ************************************************************************ ************************************************************************ */ -static void arcmsr_shutdown(device_t dev) +static int arcmsr_shutdown(device_t dev) { u_int32_t i; u_int32_t intmask_org; @@ -3231,13 +3231,13 @@ acb->workingsrb_doneindex=0; acb->workingsrb_startindex=0; ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); - return; + return (0); } /* ************************************************************************ ************************************************************************ */ -static u_int32_t arcmsr_detach(device_t dev) +static int arcmsr_detach(device_t dev) { struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev); int i; ==== //depot/projects/smpng/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c#4 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c,v 1.3 2009/01/28 18:00:22 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c,v 1.4 2009/02/10 19:23:25 sam Exp $ */ #include "opt_ah.h" @@ -278,14 +278,12 @@ if (on) { OS_REG_SET_BIT(ah, AR_PHY_SFCORR_LOW, AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); + ahp->ah_stats.ast_ani_ofdmon++; } else { OS_REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); + ahp->ah_stats.ast_ani_ofdmoff++; } - if (on) - ahp->ah_stats.ast_ani_ofdmon++; - else - ahp->ah_stats.ast_ani_ofdmoff++; aniState->ofdmWeakSigDetectOff = !on; break; } ==== //depot/projects/smpng/sys/dev/ath/if_ath.c#66 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.229 2009/02/07 05:34:41 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.233 2009/02/10 23:48:29 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -283,6 +283,10 @@ 0, "tx buffers allocated"); TUNABLE_INT("hw.ath.txbuf", &ath_txbuf); +static int ath_bstuck_threshold = 4; /* max missed beacons */ +SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, + 0, "max missed beacon xmits before chip reset"); + #ifdef ATH_DEBUG enum { ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ @@ -1201,7 +1205,9 @@ * Must reset the chip before we reload the * keycache as we were powered down on suspend. */ - ath_hal_reset(ah, sc->sc_opmode, sc->sc_curchan, AH_FALSE, &status); + ath_hal_reset(ah, sc->sc_opmode, + sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, + AH_FALSE, &status); ath_reset_keycache(sc); if (sc->sc_resume_up) { if (ic->ic_opmode == IEEE80211_M_STA) { @@ -1366,29 +1372,34 @@ static void ath_bmiss_vap(struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; - u_int64_t lastrx = sc->sc_lastrx; - u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); - u_int bmisstimeout = - vap->iv_bmissthreshold * vap->iv_bss->ni_intval * 1024; - - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: tsf %llu lastrx %lld (%llu) bmiss %u\n", - __func__, (unsigned long long) tsf, - (unsigned long long)(tsf - lastrx), - (unsigned long long) lastrx, bmisstimeout); /* * Workaround phantom bmiss interrupts by sanity-checking * the time of our last rx'd frame. If it is within the * beacon miss interval then ignore the interrupt. If it's * truly a bmiss we'll get another interrupt soon and that'll - * be dispatched up for processing. + * be dispatched up for processing. Note this applies only + * for h/w beacon miss events. */ - if (tsf - lastrx > bmisstimeout) - ATH_VAP(vap)->av_bmiss(vap); - else - sc->sc_stats.ast_bmiss_phantom++; + if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) { + struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; + u_int64_t lastrx = sc->sc_lastrx; + u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); + u_int bmisstimeout = + vap->iv_bmissthreshold * vap->iv_bss->ni_intval * 1024; + + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: tsf %llu lastrx %lld (%llu) bmiss %u\n", + __func__, (unsigned long long) tsf, + (unsigned long long)(tsf - lastrx), + (unsigned long long) lastrx, bmisstimeout); + + if (tsf - lastrx <= bmisstimeout) { + sc->sc_stats.ast_bmiss_phantom++; + return; + } + } + ATH_VAP(vap)->av_bmiss(vap); } static int @@ -3116,7 +3127,7 @@ DPRINTF(sc, ATH_DEBUG_BEACON, "%s: missed %u consecutive beacons\n", __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount > 3) /* NB: 3 is a guess */ + if (sc->sc_bmisscount >= ath_bstuck_threshold) taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); return; } @@ -6087,6 +6098,8 @@ /* XXX locking? */ ni->ni_ucastkey.wk_keyix = keyix; ni->ni_ucastkey.wk_rxkeyix = rxkeyix; + /* NB: must mark device key to get called back on delete */ + ni->ni_ucastkey.wk_flags |= IEEE80211_KEY_DEVKEY; IEEE80211_ADDR_COPY(ni->ni_ucastkey.wk_macaddr, ni->ni_macaddr); /* NB: this will create a pass-thru key entry */ ath_keyset(sc, &ni->ni_ucastkey, vap->iv_bss); @@ -7610,7 +7623,7 @@ DPRINTF(sc, ATH_DEBUG_BEACON, "%s: missed %u consecutive beacons\n", __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount > 3) /* NB: 3 is a guess */ + if (sc->sc_bmisscount >= ath_bstuck_threshold) taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); return; } ==== //depot/projects/smpng/sys/dev/bge/if_bge.c#104 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.217 2009/02/05 18:43:13 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.218 2009/02/10 21:54:23 marius Exp $"); /* * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. @@ -2674,11 +2674,11 @@ * if we get a conflict with the ASF firmware accessing * the PHY. */ + trys = 0; BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); again: bge_asf_driver_up(sc); - trys = 0; if (mii_phy_probe(dev, &sc->bge_miibus, bge_ifmedia_upd, bge_ifmedia_sts)) { if (trys++ < 4) { ==== //depot/projects/smpng/sys/dev/iicbus/if_ic.c#19 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/iicbus/if_ic.c,v 1.28 2009/01/06 17:23:37 nwhitehorn Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/iicbus/if_ic.c,v 1.29 2009/02/10 22:50:23 imp Exp $"); /* * I2C bus IP driver @@ -105,7 +105,7 @@ static int icoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); -static void icintr(device_t, int, char *); +static int icintr(device_t, int, char *); static device_method_t ic_methods[] = { /* device interface */ @@ -272,7 +272,7 @@ /* * icintr() */ -static void +static int icintr(device_t dev, int event, char *ptr) { struct ic_softc *sc = (struct ic_softc *)device_get_softc(dev); @@ -346,7 +346,7 @@ } mtx_unlock(&sc->ic_lock); - return; + return (0); } /* ==== //depot/projects/smpng/sys/dev/iicbus/iicbb.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/iicbus/iicbb.c,v 1.20 2008/08/04 20:46:15 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/iicbus/iicbb.c,v 1.21 2009/02/10 22:50:23 imp Exp $"); /* * Generic I2C bit-banging code @@ -72,7 +72,7 @@ static int iicbb_callback(device_t, int, caddr_t); static int iicbb_start(device_t, u_char, int); static int iicbb_stop(device_t); -static int iicbb_write(device_t, char *, int, int *, int); +static int iicbb_write(device_t, const char *, int, int *, int); static int iicbb_read(device_t, char *, int, int *, int, int); static int iicbb_reset(device_t, u_char, u_char, u_char *); @@ -372,7 +372,7 @@ } static int -iicbb_write(device_t dev, char * buf, int len, int *sent, int timeout) +iicbb_write(device_t dev, const char *buf, int len, int *sent, int timeout) { int bytes, error = 0; ==== //depot/projects/smpng/sys/dev/iicbus/iicbus.c#14 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/iicbus/iicbus.c,v 1.28 2009/01/20 00:05:43 nwhitehorn Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/iicbus/iicbus.c,v 1.29 2009/02/10 22:50:23 imp Exp $"); /* * Autoconfiguration and support routines for the Philips serial I2C bus @@ -173,7 +173,7 @@ } static int -iicbus_read_ivar(device_t bus, device_t child, int which, u_char *result) +iicbus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { struct iicbus_ivar *devi = IICBUS_IVAR(child); ==== //depot/projects/smpng/sys/dev/iicbus/iicsmb.c#10 (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/dev/iicbus/iicsmb.c,v 1.17 2009/01/06 17:23:37 nwhitehorn Exp $ + * $FreeBSD: src/sys/dev/iicbus/iicsmb.c,v 1.18 2009/02/10 22:50:23 imp Exp $ * */ @@ -84,7 +84,7 @@ static int iicsmb_detach(device_t); static void iicsmb_identify(driver_t *driver, device_t parent); -static void iicsmb_intr(device_t dev, int event, char *buf); +static int iicsmb_intr(device_t dev, int event, char *buf); static int iicsmb_callback(device_t dev, int index, void *data); static int iicsmb_quick(device_t dev, u_char slave, int how); static int iicsmb_sendb(device_t dev, u_char slave, char byte); @@ -186,7 +186,7 @@ * * iicbus interrupt handler */ -static void +static int iicsmb_intr(device_t dev, int event, char *buf) { struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev); @@ -252,7 +252,7 @@ } mtx_unlock(&sc->lock); - return; + return (0); } static int ==== //depot/projects/smpng/sys/dev/ppbus/lpt.c#25 (text+ko) ==== @@ -51,7 +51,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ppbus/lpt.c,v 1.48 2009/01/26 20:58:05 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ppbus/lpt.c,v 1.49 2009/02/11 14:25:09 jhb Exp $"); /* * Device Driver for AT parallel printer port @@ -544,10 +544,10 @@ do { /* ran out of waiting for the printer */ if (trys++ >= LPINITRDY*4) { - sc->sc_state = 0; lprintf(("status %x\n", ppb_rstr(ppbus))); lpt_release_ppbus(lptdev); + sc->sc_state = 0; ppb_unlock(ppbus); return (EBUSY); } @@ -555,9 +555,8 @@ /* wait 1/4 second, give up if we get a signal */ if (ppb_sleep(ppbus, lptdev, LPPRI | PCATCH, "lptinit", hz / 4) != EWOULDBLOCK) { + lpt_release_ppbus(lptdev); sc->sc_state = 0; - - lpt_release_ppbus(lptdev); ppb_unlock(ppbus); return (EBUSY); } @@ -577,7 +576,8 @@ ppb_wctr(ppbus, sc->sc_control); - sc->sc_state = OPEN; + sc->sc_state &= ~LPTINIT; + sc->sc_state |= OPEN; sc->sc_xfercnt = 0; /* only use timeout if using interrupt */ @@ -611,11 +611,8 @@ int err; ppb_lock(ppbus); - if (sc->sc_flags & LP_BYPASS) { - sc->sc_state = 0; - ppb_unlock(ppbus); + if (sc->sc_flags & LP_BYPASS) goto end_close; - } if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0) { ppb_unlock(ppbus); @@ -635,16 +632,16 @@ sc->sc_state &= ~OPEN; callout_stop(&sc->sc_timer); ppb_wctr(ppbus, LPC_NINIT); - sc->sc_state = 0; - sc->sc_xfercnt = 0; /* * unregistration of interrupt forced by release */ lpt_release_ppbus(lptdev); - ppb_unlock(ppbus); end_close: + sc->sc_state = 0; + sc->sc_xfercnt = 0; + ppb_unlock(ppbus); lprintf(("closed.\n")); return(0); } ==== //depot/projects/smpng/sys/dev/ppc/ppc_pci.c#4 (text) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ppc/ppc_pci.c,v 1.3 2009/01/21 23:10:06 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ppc/ppc_pci.c,v 1.4 2009/02/11 00:08:03 kaiw Exp $"); #include #include @@ -84,6 +84,7 @@ static struct pci_id pci_ids[] = { { 0x1020131f, "SIIG Cyber Parallel PCI (10x family)", 0x18 }, { 0x2020131f, "SIIG Cyber Parallel PCI (20x family)", 0x10 }, + { 0x05111407, "Lava SP BIDIR Parallel PCI", 0x10 }, { 0x80001407, "Lava Computers 2SP-PCI parallel port", 0x10 }, { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, ==== //depot/projects/smpng/sys/dev/re/if_re.c#71 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.152 2009/02/09 04:59:13 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.153 2009/02/11 00:23:56 yongari Exp $"); /* * RealTek 8139C+/8169/8169S/8110S/8168/8111/8101E PCI NIC driver @@ -1149,7 +1149,8 @@ if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); } - if (msic == RL_MSI_MESSAGES && msi_disable == 0) { + if (msic > 0 && msi_disable == 0) { + msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI messages\n", ==== //depot/projects/smpng/sys/dev/sdhci/sdhci.c#6 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/sdhci/sdhci.c,v 1.6 2009/01/28 22:53:41 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sdhci/sdhci.c,v 1.7 2009/02/10 23:13:48 imp Exp $"); #include #include @@ -1427,7 +1427,7 @@ } static int -sdhci_read_ivar(device_t bus, device_t child, int which, u_char *result) +sdhci_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { struct sdhci_slot *slot = device_get_ivars(child); ==== //depot/projects/smpng/sys/dev/sis/if_sis.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/sis/if_sis.c,v 1.5 2008/12/09 04:30:47 yongari Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sis/if_sis.c,v 1.6 2009/02/10 23:17:20 imp Exp $"); /* * SiS 900/SiS 7016 fast ethernet PCI NIC driver. Datasheets are @@ -2257,7 +2257,7 @@ * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int sis_shutdown(device_t dev) { struct sis_softc *sc; @@ -2267,6 +2267,7 @@ sis_reset(sc); sis_stop(sc); SIS_UNLOCK(sc); + return (0); } static device_method_t sis_methods[] = { ==== //depot/projects/smpng/sys/dev/sound/pci/envy24.c#13 (text+ko) ==== @@ -20,7 +20,7 @@ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ @@ -35,7 +35,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/envy24.c,v 1.14 2007/10/12 06:03:44 kevlo Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/envy24.c,v 1.15 2009/02/11 10:29:45 netchild Exp $"); MALLOC_DEFINE(M_ENVY24, "envy24", "envy24 audio"); @@ -278,7 +278,7 @@ "Envy24 audio (M Audio Delta Dio 2496)", 0x1412, 0xd631, 0x10, 0x80, 0xf0, 0x03, - 0xff, 0x00, 0x00, + 0x02, 0xc0, 0xfd, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, &delta_codec, @@ -301,6 +301,51 @@ 0x00, &delta_codec, }, + { + "Envy24 audio (M Audio Delta 66)", + 0x1412, 0xd632, + 0x15, 0x80, 0xf0, 0x03, + 0x02, 0xc0, 0xfd, + 0x10, 0x20, 0x40, 0x00, 0x00, + 0x00, + &delta_codec, + }, + { + "Envy24 audio (M Audio Delta 44)", + 0x1412, 0xd633, + 0x15, 0x80, 0xf0, 0x00, + 0x02, 0xc0, 0xfd, + 0x10, 0x20, 0x40, 0x00, 0x00, + 0x00, + &delta_codec, + }, + { + "Envy24 audio (M Audio Delta 1010)", + 0x1412, 0xd630, + 0x1f, 0x80, 0xf0, 0x03, + 0x22, 0xd0, 0xdd, + 0x10, 0x20, 0x40, 0x00, 0x00, + 0x00, + &delta_codec, + }, + { + "Envy24 audio (M Audio Delta 1010LT)", + 0x1412, 0xd63b, + 0x1f, 0x80, 0x72, 0x03, + 0x04, 0x7e, 0xfb, + 0x08, 0x02, 0x70, 0x00, 0x00, + 0x00, + &delta_codec, + }, + { + "Envy24 audio (Terratec EWX 2496)", + 0x153b, 0x1130, + 0x10, 0x80, 0xf0, 0x03, + 0xc0, 0x3f, 0x3f, + 0x10, 0x20, 0x01, 0x01, 0x00, + 0x00, + &delta_codec, + }, { "Envy24 audio (Generic)", 0, 0, ==== //depot/projects/smpng/sys/dev/sound/pci/envy24ht.c#10 (text+ko) ==== @@ -47,7 +47,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/envy24ht.c,v 1.16 2007/10/12 06:03:44 kevlo Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/envy24ht.c,v 1.17 2009/02/11 10:29:45 netchild Exp $"); MALLOC_DEFINE(M_ENVY24HT, "envy24ht", "envy24ht audio"); @@ -323,7 +323,7 @@ 0x153b, 0x1150, 0x10, 0x80, 0xf0, 0xc3, 0x7ffbc7, 0x7fffff, 0x438, - 0x20, 0x10, 0x400, 0x00, 0x00, + 0x10, 0x20, 0x400, 0x01, 0x00, 0, &spi_codec, }, @@ -349,7 +349,7 @@ "Envy24HT audio (M-Audio Revolution 7.1)", 0x1412, 0x3630, 0x43, 0x80, 0xf8, 0xc1, - 0x3fff85, 0x72, 0x4000fa, + 0x3fff85, 0x400072, 0x4000fa, 0x08, 0x02, 0x20, 0x00, 0x04, 0, &spi_codec, @@ -358,7 +358,7 @@ "Envy24GT audio (M-Audio Revolution 5.1)", 0x1412, 0x3631, 0x42, 0x80, 0xf8, 0xc1, - 0x3fff85, 0x72, 0x4000fa, + 0x3fff05, 0x4000f0, 0x4000fa, 0x08, 0x02, 0x10, 0x00, 0x03, 0, &spi_codec, @@ -391,6 +391,15 @@ &spi_codec, }, { + "Envy24HT-S audio (Terrasoniq TS22PCI)", + 0x153b, 0x117b, + 0x10, 0x80, 0xf0, 0xc3, + 0x7ffbc7, 0x7fffff, 0x438, + 0x10, 0x20, 0x400, 0x01, 0x00, + 0, + &spi_codec, + }, + { "Envy24HT audio (Generic)", 0, 0, 0x0b, 0x80, 0xfc, 0xc3, ==== //depot/projects/smpng/sys/dev/sound/pci/spicds.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/sound/pci/spicds.c,v 1.6 2007/05/27 19:58:39 joel Exp $ + * $FreeBSD: src/sys/dev/sound/pci/spicds.c,v 1.7 2009/02/11 10:29:45 netchild Exp $ */ #include @@ -234,7 +234,7 @@ if (codec->type == SPICDS_TYPE_AK4358) spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ if (codec->type == SPICDS_TYPE_AK4381) - spicds_wrcd(codec, 0x00, 0x0f); /* I2S, 24bit, power-up */ + spicds_wrcd(codec, 0x00, 0x8f); /* I2S, 24bit, power-up */ if (codec->type == SPICDS_TYPE_AK4396) spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ snd_mtxunlock(codec->lock); @@ -296,7 +296,8 @@ case SPICDS_TYPE_WM8770: right = right + 27; break; - case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396: + case SPICDS_TYPE_AK4381: + case SPICDS_TYPE_AK4396: right = right * 255 / 100; break; default: ==== //depot/projects/smpng/sys/dev/tl/if_tl.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/tl/if_tl.c,v 1.1 2008/08/14 20:02:34 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/tl/if_tl.c,v 1.2 2009/02/10 23:17:20 imp Exp $"); /* * Texas Instruments ThunderLAN driver for FreeBSD 2.2.6 and 3.x. @@ -282,7 +282,7 @@ static void tl_init_locked(struct tl_softc *); static void tl_stop(struct tl_softc *); static void tl_watchdog(struct ifnet *); -static void tl_shutdown(device_t); +static int tl_shutdown(device_t); static int tl_ifmedia_upd(struct ifnet *); static void tl_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -2347,7 +2347,7 @@ * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int tl_shutdown(dev) device_t dev; { @@ -2359,5 +2359,5 @@ tl_stop(sc); TL_UNLOCK(sc); - return; + return (0); } ==== //depot/projects/smpng/sys/dev/tx/if_tx.c#31 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/tx/if_tx.c,v 1.99 2008/09/12 14:41:53 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/tx/if_tx.c,v 1.100 2009/02/10 23:17:20 imp Exp $"); /* * EtherPower II 10/100 Fast Ethernet (SMC 9432 serie) @@ -122,7 +122,7 @@ static int epic_probe(device_t); static int epic_attach(device_t); -static void epic_shutdown(device_t); +static int epic_shutdown(device_t); static int epic_detach(device_t); static void epic_release(epic_softc_t *); static struct epic_type *epic_devtype(device_t); @@ -502,7 +502,7 @@ * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int epic_shutdown(device_t dev) { epic_softc_t *sc; @@ -512,6 +512,7 @@ EPIC_LOCK(sc); epic_stop(sc); EPIC_UNLOCK(sc); + return (0); } /* ==== //depot/projects/smpng/sys/dev/uart/uart_bus_pci.c#10 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_pci.c,v 1.11 2007/05/17 04:07:19 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_pci.c,v 1.12 2009/02/11 00:08:03 kaiw Exp $"); #include #include @@ -96,6 +96,7 @@ 0x18 }, { 0x1407, 0x0110, 0xffff, 0, "Lava Computer mfg DSerial-PCI Port A", 0x10 }, { 0x1407, 0x0111, 0xffff, 0, "Lava Computer mfg DSerial-PCI Port B", 0x10 }, +{ 0x1407, 0x0510, 0xffff, 0, "Lava SP Serial 550 PCI", 0x10 }, { 0x1409, 0x7168, 0x1409, 0x4025, "Timedia Technology Serial Port", 0x10, 8 * DEFAULT_RCLK }, { 0x1409, 0x7168, 0x1409, 0x4027, "Timedia Technology Serial Port", 0x10, ==== //depot/projects/smpng/sys/ia64/ia64/mp_machdep.c#40 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/ia64/ia64/mp_machdep.c,v 1.71 2008/10/19 20:14:48 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/ia64/ia64/mp_machdep.c,v 1.72 2009/02/10 20:29:57 marcel Exp $"); #include "opt_kstack_pages.h" @@ -267,7 +267,8 @@ if (!ap_awake) printf("SMP: WARNING: cpu%d did not wake up\n", pc->pc_cpuid); - } + } else + pc->pc_awake = 1; } } ==== //depot/projects/smpng/sys/kern/kern_linker.c#98 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_linker.c,v 1.165 2009/02/06 14:51:32 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_linker.c,v 1.166 2009/02/10 15:50:19 attilio Exp $"); #include "opt_ddb.h" #include "opt_hwpmc_hooks.h" >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed Feb 11 15:09:45 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2D6941065696; Wed, 11 Feb 2009 15:09:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79920106566B for ; Wed, 11 Feb 2009 15:09:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 65C4F8FC14 for ; Wed, 11 Feb 2009 15:09:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BF9i1L043098 for ; Wed, 11 Feb 2009 15:09:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BF9iKn043096 for perforce@freebsd.org; Wed, 11 Feb 2009 15:09:44 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 11 Feb 2009 15:09:44 GMT Message-Id: <200902111509.n1BF9iKn043096@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157544 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: Wed, 11 Feb 2009 15:09:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=157544 Change 157544 by hselasky@hselasky_laptop001 on 2009/02/11 15:09:25 USB WLAN: More fixes. - (tx_nfree == 0) is not good enough check to see if there are no TX slots left. Use STAILQ_FIRST() == NULL as indication when there are no TX slots. - remove tx_nfree variable from ZYD/RUM/RAL softc - make sure one slot is reserved for management frames. Should have reserved more frames (TODO). Reported by: Thomas Sparrevohn Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#36 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#8 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#35 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#8 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#37 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#9 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#36 (text+ko) ==== @@ -690,7 +690,6 @@ data->ni = NULL; } STAILQ_INSERT_TAIL(&sc->tx_free, data, next); - sc->tx_nfree++; } static void @@ -699,7 +698,6 @@ struct rum_tx_data *data; int i; - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -708,7 +706,6 @@ data->sc = sc; STAILQ_INSERT_TAIL(&sc->tx_free, data, next); - sc->tx_nfree++; } } @@ -719,7 +716,6 @@ int i; /* make sure any subsequent use of the queues will fail */ - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -857,7 +853,6 @@ xfer->priv_fifo = NULL; ifp->if_opackets++; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ case USB_ST_SETUP: @@ -1135,11 +1130,14 @@ } if (mprot == NULL) { /* XXX stat + msg */ - return ENOBUFS; + return (ENOBUFS); } data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(mprot); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; data->m = mprot; data->ni = ieee80211_ref_node(ni); @@ -1168,8 +1166,11 @@ RUM_LOCK_ASSERT(sc, MA_OWNED); data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(m0); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; wh = mtod(m0, struct ieee80211_frame *); if (wh->i_fc[1] & IEEE80211_FC1_WEP) { @@ -1209,7 +1210,7 @@ STAILQ_INSERT_TAIL(&sc->tx_q, data, next); usb2_transfer_start(sc->sc_xfer[RUM_BULK_WR]); - return 0; + return (0); } static int @@ -1224,8 +1225,11 @@ KASSERT(params != NULL, ("no raw xmit params")); data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(m0); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; rate = params->ibp_rate0 & IEEE80211_RATE_VAL; /* XXX validate */ @@ -1319,8 +1323,11 @@ } data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(m0); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; data->m = m0; data->ni = ni; @@ -1351,6 +1358,7 @@ { struct rum_softc *sc = ifp->if_softc; struct ieee80211_node *ni; + struct rum_tx_data *data; struct mbuf *m; RUM_LOCK(sc); @@ -1362,15 +1370,19 @@ IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - if (sc->tx_nfree == 0) { - IFQ_DRV_PREPEND(&ifp->if_snd, m); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + data = STAILQ_FIRST(&sc->tx_free); + if ((data == NULL) || (STAILQ_NEXT(data, next) == NULL)) { + /* last slot is reserved for mgt frame */ + m_freem(m); + ieee80211_free_node(ni); + ifp->if_oerrors++; + continue; } - ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; m = ieee80211_encap(ni, m); if (m == NULL) { ieee80211_free_node(ni); + ifp->if_oerrors++; continue; } if (rum_tx_data(sc, m, ni) != 0) { @@ -2084,7 +2096,6 @@ } rum_write(sc, RT2573_TXRX_CSR0, tmp); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; usb2_transfer_start(sc->sc_xfer[RUM_BULK_RD]); return; @@ -2120,7 +2131,7 @@ RUM_LOCK_ASSERT(sc, MA_OWNED); - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; RUM_UNLOCK(sc); @@ -2212,13 +2223,6 @@ ieee80211_free_node(ni); return ENETDOWN; } - if (sc->tx_nfree == 0) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - RUM_UNLOCK(sc); - m_freem(m); - ieee80211_free_node(ni); - return EIO; - } ifp->if_opackets++; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#8 (text+ko) ==== @@ -119,7 +119,6 @@ struct rum_tx_data tx_data[RUM_TX_LIST_COUNT]; rum_txdhead tx_q; rum_txdhead tx_free; - int tx_nfree; struct rum_rx_desc sc_rx_desc; struct mtx sc_mtx; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#35 (text+ko) ==== @@ -670,7 +670,6 @@ data->ni = NULL; } STAILQ_INSERT_TAIL(&sc->tx_free, data, next); - sc->tx_nfree++; } static void @@ -679,7 +678,6 @@ struct ural_tx_data *data; int i; - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -688,7 +686,6 @@ data->sc = sc; STAILQ_INSERT_TAIL(&sc->tx_free, data, next); - sc->tx_nfree++; } } @@ -699,7 +696,6 @@ int i; /* make sure any subsequent use of the queues will fail */ - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -886,7 +882,6 @@ xfer->priv_fifo = NULL; ifp->if_opackets++; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ case USB_ST_SETUP: @@ -1138,19 +1133,16 @@ { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; - struct ifnet *ifp = sc->sc_ifp; const struct ieee80211_txparam *tp; struct ural_tx_data *data; - if (sc->tx_nfree == 0) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { m_freem(m0); ieee80211_free_node(ni); - return EIO; + return (EIO); } - data = STAILQ_FIRST(&sc->tx_free); STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_bsschan)]; data->m = m0; @@ -1185,8 +1177,11 @@ RAL_LOCK_ASSERT(sc, MA_OWNED); data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(m0); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; @@ -1268,8 +1263,11 @@ return ENOBUFS; } data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(mprot); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; data->m = mprot; data->ni = ieee80211_ref_node(ni); @@ -1295,8 +1293,11 @@ KASSERT(params != NULL, ("no raw xmit params")); data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(m0); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; rate = params->ibp_rate0 & IEEE80211_RATE_VAL; /* XXX validate */ @@ -1388,8 +1389,11 @@ } data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(m0); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; data->m = m0; data->ni = ni; @@ -1420,6 +1424,7 @@ { struct ural_softc *sc = ifp->if_softc; struct ieee80211_node *ni; + struct ural_tx_data *data; struct mbuf *m; RAL_LOCK(sc); @@ -1431,15 +1436,20 @@ IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - if (sc->tx_nfree == 0) { - IFQ_DRV_PREPEND(&ifp->if_snd, m); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; + + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + data = STAILQ_FIRST(&sc->tx_free); + if ((data == NULL) || (STAILQ_NEXT(data, next) == NULL)) { + /* last slot is reserved for mgt frame */ + m_freem(m); + ieee80211_free_node(ni); + ifp->if_oerrors++; + continue; } - ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; m = ieee80211_encap(ni, m); if (m == NULL) { ieee80211_free_node(ni); + ifp->if_oerrors++; continue; } if (ural_tx_data(sc, m, ni) != 0) { @@ -2208,7 +2218,6 @@ } ural_write(sc, RAL_TXRX_CSR2, tmp); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; usb2_transfer_start(sc->sc_xfer[URAL_BULK_RD]); return; @@ -2243,7 +2252,7 @@ RAL_LOCK_ASSERT(sc, MA_OWNED); - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* * Drain all the transfers, if not already drained: @@ -2282,14 +2291,6 @@ ieee80211_free_node(ni); return ENETDOWN; } - if (sc->tx_nfree == 0) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - RAL_UNLOCK(sc); - m_freem(m); - ieee80211_free_node(ni); - return EIO; - } - ifp->if_opackets++; if (params == NULL) { ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#8 (text+ko) ==== @@ -122,7 +122,6 @@ struct ural_tx_data tx_data[RAL_TX_LIST_COUNT]; ural_txdhead tx_q; ural_txdhead tx_free; - int tx_nfree; struct ural_rx_desc sc_rx_desc; struct mtx sc_mtx; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#37 (text+ko) ==== @@ -548,7 +548,6 @@ data->ni = NULL; } STAILQ_INSERT_TAIL(&sc->tx_free, data, next); - sc->tx_nfree++; } static void @@ -557,7 +556,6 @@ struct zyd_tx_data *data; int i; - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -566,7 +564,6 @@ data->sc = sc; STAILQ_INSERT_TAIL(&sc->tx_free, data, next); - sc->tx_nfree++; } } @@ -577,7 +574,6 @@ int i; /* make sure any subsequent use of the queues will fail */ - sc->tx_nfree = 0; STAILQ_INIT(&sc->tx_q); STAILQ_INIT(&sc->tx_free); @@ -2400,8 +2396,11 @@ uint16_t pktlen; data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(m0); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; desc = &data->desc; rate = IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan) ? 12 : 2; @@ -2510,7 +2509,6 @@ xfer->priv_fifo = NULL; ifp->if_opackets++; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ case USB_ST_SETUP: @@ -2583,8 +2581,11 @@ wh = mtod(m0, struct ieee80211_frame *); data = STAILQ_FIRST(&sc->tx_free); + if (data == NULL) { + m_freem(m0); + return (ENOBUFS); + } STAILQ_REMOVE_HEAD(&sc->tx_free, next); - sc->tx_nfree--; desc = &data->desc; desc->flags = ZYD_TX_FLAG_BACKOFF; @@ -2673,6 +2674,7 @@ { struct zyd_softc *sc = ifp->if_softc; struct ieee80211_node *ni; + struct zyd_tx_data *data; struct mbuf *m; ZYD_LOCK(sc); @@ -2680,12 +2682,16 @@ IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - if (sc->tx_nfree == 0) { - IFQ_DRV_PREPEND(&ifp->if_snd, m); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; + + ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; + data = STAILQ_FIRST(&sc->tx_free); + if ((data == NULL) || (STAILQ_NEXT(data, next) == NULL)) { + /* last slot is reserved for mgt frame */ + m_freem(m); + ieee80211_free_node(ni); + ifp->if_oerrors++; + continue; } - ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; m = ieee80211_encap(ni, m); if (m == NULL) { ieee80211_free_node(ni); @@ -2717,14 +2723,6 @@ ieee80211_free_node(ni); return (ENETDOWN); } - if (sc->tx_nfree == 0) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - ZYD_UNLOCK(sc); - m_freem(m); - ieee80211_free_node(ni); - return (ENOBUFS); /* XXX */ - } - /* * Legacy path; interpret frame contents to decide * precisely how to send the frame. @@ -2886,7 +2884,6 @@ /* enable interrupts */ zyd_write32_m(sc, ZYD_CR_INTERRUPT, ZYD_HWINT_MASK); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; usb2_transfer_start(sc->sc_xfer[ZYD_BULK_RD]); usb2_transfer_start(sc->sc_xfer[ZYD_INTR_RD]); @@ -2924,7 +2921,7 @@ ZYD_LOCK_ASSERT(sc, MA_OWNED); - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* * Drain all the transfers, if not already drained: ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#9 (text+ko) ==== @@ -1319,7 +1319,6 @@ struct zyd_tx_data tx_data[ZYD_TX_LIST_CNT]; zyd_txdhead tx_q; zyd_txdhead tx_free; - int tx_nfree; struct zyd_rx_desc sc_rx_desc; struct zyd_rx_data sc_rx_data[ZYD_MAX_RXFRAMECNT]; int sc_rx_count; From owner-p4-projects@FreeBSD.ORG Wed Feb 11 15:29:04 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 98A3B106566C; Wed, 11 Feb 2009 15:29:04 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58692106564A for ; Wed, 11 Feb 2009 15:29:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 465B68FC17 for ; Wed, 11 Feb 2009 15:29:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BFT4cV044674 for ; Wed, 11 Feb 2009 15:29:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BFT4Qi044672 for perforce@freebsd.org; Wed, 11 Feb 2009 15:29:04 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 11 Feb 2009 15:29:04 GMT Message-Id: <200902111529.n1BFT4Qi044672@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157546 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: Wed, 11 Feb 2009 15:29:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=157546 Change 157546 by hselasky@hselasky_laptop001 on 2009/02/11 15:28:15 USB WLAN: Revert looping on the control request in case of error. It did not solve the problem it turns out. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#37 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#36 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#37 (text+ko) ==== @@ -584,21 +584,12 @@ { usb2_error_t err; - /* - * Occasionally the RUM chip will just generate control - * request timeouts. Probably a USB driver bug in the - * firmware! Try to workaround the problem. - */ - retry: err = usb2_do_request_proc(sc->sc_udev, &sc->sc_tq, req, data, 0, NULL, 250 /* ms */); if (err) { - if (!usb2_proc_is_gone(&sc->sc_tq)) { - DPRINTFN(1, "Control request failed! (ignored)\n"); - rum_pause(sc, hz / 100); - goto retry; - } + DPRINTFN(1, "Control request failed! (ignored)\n"); + rum_pause(sc, hz / 100); } return; } ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#36 (text+ko) ==== @@ -570,16 +570,12 @@ { usb2_error_t err; - retry: err = usb2_do_request_proc(sc->sc_udev, &sc->sc_tq, req, data, 0, NULL, 250 /* ms */); if (err) { - if (!usb2_proc_is_gone(&sc->sc_tq)) { - DPRINTFN(1, "Control request failed! (ignored)\n"); - ural_pause(sc, hz / 100); - goto retry; - } + DPRINTFN(1, "Control request failed! (ignored)\n"); + ural_pause(sc, hz / 100); } } From owner-p4-projects@FreeBSD.ORG Wed Feb 11 17:05:44 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 060D11065670; Wed, 11 Feb 2009 17:05:44 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3BFC1065679 for ; Wed, 11 Feb 2009 17:05:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 870B78FC0A for ; Wed, 11 Feb 2009 17:05:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BH5hgv065194 for ; Wed, 11 Feb 2009 17:05:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BH5hu3065192 for perforce@freebsd.org; Wed, 11 Feb 2009 17:05:43 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 11 Feb 2009 17:05:43 GMT Message-Id: <200902111705.n1BH5hu3065192@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157553 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: Wed, 11 Feb 2009 17:05:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=157553 Change 157553 by hselasky@hselasky_laptop001 on 2009/02/11 17:04:51 Need to drain wlan taskqueue at wlan detach! Affected files ... .. //depot/projects/usb/src/sys/net80211/ieee80211_proto.c#12 edit Differences ... ==== //depot/projects/usb/src/sys/net80211/ieee80211_proto.c#12 (text+ko) ==== @@ -154,6 +154,8 @@ ieee80211_wds_detach(ic); ieee80211_adhoc_detach(ic); ieee80211_sta_detach(ic); + + taskqueue_drain(taskqueue_thread, &ic->ic_parent_task); } static void From owner-p4-projects@FreeBSD.ORG Wed Feb 11 17:40:20 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A592C1065676; Wed, 11 Feb 2009 17:40:19 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F8091065674 for ; Wed, 11 Feb 2009 17:40:19 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4C90D8FC1D for ; Wed, 11 Feb 2009 17:40:19 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BHeJLY071897 for ; Wed, 11 Feb 2009 17:40:19 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BHeJ6Z071895 for perforce@freebsd.org; Wed, 11 Feb 2009 17:40:19 GMT (envelope-from pgj@FreeBSD.org) Date: Wed, 11 Feb 2009 17:40:19 GMT Message-Id: <200902111740.n1BHeJ6Z071895@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 157557 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: Wed, 11 Feb 2009 17:40:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=157557 Change 157557 by pgj@beehive on 2009/02/11 17:39:57 IFC Affected files ... .. //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/faq/book.sgml#39 integrate .. //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/handbook/cutting-edge/chapter.sgml#20 integrate .. //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/handbook/mirrors/chapter.sgml#23 integrate .. //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/handbook/network-servers/chapter.sgml#24 integrate .. //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/handbook/ports/chapter.sgml#21 integrate .. //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/handbook/ppp-and-slip/chapter.sgml#15 integrate .. //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/handbook/security/chapter.sgml#20 integrate .. //depot/projects/docproj_hu/doc/share/pgpkeys/maho.key#2 integrate .. //depot/projects/docproj_hu/doc/share/pgpkeys/miwi.key#2 integrate .. //depot/projects/docproj_hu/www/en/news/2008/Makefile#1 branch .. //depot/projects/docproj_hu/www/en/news/2008/news.xml#1 branch .. //depot/projects/docproj_hu/www/en/news/2008/press.xml#1 branch .. //depot/projects/docproj_hu/www/en/news/Makefile#3 integrate .. //depot/projects/docproj_hu/www/en/news/status/report-2008-10-2008-12.xml#2 integrate .. //depot/projects/docproj_hu/www/en/releases/index.sgml#5 integrate .. //depot/projects/docproj_hu/www/en/releng/index.sgml#13 integrate .. //depot/projects/docproj_hu/www/hu/where.sgml#13 integrate .. //depot/projects/docproj_hu/www/share/sgml/libcommon.xsl#6 integrate .. //depot/projects/docproj_hu/www/share/sgml/news.xml#37 integrate .. //depot/projects/docproj_hu/www/share/sgml/press.xml#11 integrate Differences ... ==== //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/faq/book.sgml#39 (text+ko) ==== @@ -20,7 +20,7 @@ A &os; Dokumentációs Projekt - $FreeBSD: doc/hu_HU.ISO8859-2/books/faq/book.sgml,v 1.9 2009/01/10 19:28:48 pgj Exp $ + $FreeBSD: doc/hu_HU.ISO8859-2/books/faq/book.sgml,v 1.10 2009/02/03 20:15:30 pgj Exp $ 1995 ==== //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/books/handbook/cutting-edge/chapter.sgml#20 (text+ko) ==== @@ -1,7 +1,7 @@ + - Key fingerprint = 24E3 5A0F F224 D3EB 6D2F 1A49 E403 AD85 F970 CE42 -sub 1024g/F7781B04 2002-10-17 +pub 1024D/F28B4069 2009-02-09 + Key fingerprint = 3FE4 99A9 6F41 8161 4F5F 240C 8615 A60C F28B 4069 +uid Maho NAKATA (NAKATA's FreeBSD.org alias) +sub 2048g/6B49098E 2009-02-09 ]]> ==== //depot/projects/docproj_hu/doc/share/pgpkeys/miwi.key#2 (text+ko) ==== @@ -1,41 +1,51 @@ - + -sub 2048g/B3BEE707 2007-02-23 [expires: 2009-02-22] +sub 4096g/096DA69D 2009-01-31 ]]> ==== //depot/projects/docproj_hu/www/en/news/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: www/en/news/Makefile,v 1.51 2008/12/08 09:10:44 murray Exp $ +# $FreeBSD: www/en/news/Makefile,v 1.52 2009/02/11 17:15:28 pgj Exp $ .if exists(../Makefile.conf) .include "../Makefile.conf" @@ -47,6 +47,7 @@ SUBDIR+= 2005 SUBDIR+= 2006 SUBDIR+= 2007 +SUBDIR+= 2008 SUBDIR+= status .include "${WEB_PREFIX}/share/mk/web.site.mk" ==== //depot/projects/docproj_hu/www/en/news/status/report-2008-10-2008-12.xml#2 (text+ko) ==== @@ -2,7 +2,7 @@ - + October-December @@ -131,9 +131,9 @@ - Gàbor + Gábor - Kövesdàn + Kövesdán gabor@FreeBSD.org @@ -160,7 +160,7 @@ - Make a tinderbox run with BSD grep and fix possible + Make a portbuild run with BSD grep and fix possible bugs. @@ -348,9 +348,9 @@ - Gàbor + Gábor - Kövesdàn + Kövesdán gabor@FreeBSD.org @@ -358,9 +358,9 @@ - Gàbor + Gábor - Pàli + Páli pgj@FreeBSD.org ==== //depot/projects/docproj_hu/www/en/releases/index.sgml#5 (text+ko) ==== @@ -1,10 +1,10 @@ - + ]> - + &header; @@ -70,7 +70,6 @@ Announcement: Release Notes: Hardware Notes: - Installation Notes: Readme: Errata ==== //depot/projects/docproj_hu/www/en/releng/index.sgml#13 (text+ko) ==== @@ -1,6 +1,6 @@ - + @@ -47,12 +47,13 @@ Information + To be defined FreeBSD 7.2 ==== //depot/projects/docproj_hu/www/hu/where.sgml#13 (text+ko) ==== @@ -1,5 +1,5 @@ + ==== //depot/projects/docproj_hu/www/share/sgml/libcommon.xsl#6 (text+ko) ==== @@ -1,7 +1,7 @@ - +

Old announcements: + 2008, 2007, 2006, 2005, @@ -410,6 +411,7 @@

Old press publications: + 2008, 2007, 2006, 2005, ==== //depot/projects/docproj_hu/www/share/sgml/news.xml#37 (text+ko) ==== @@ -25,7 +25,7 @@ - $FreeBSD: www/share/sgml/news.xml,v 1.223 2009/01/30 22:09:36 jamie Exp $ + $FreeBSD: www/share/sgml/news.xml,v 1.224 2009/02/11 17:15:28 pgj Exp $ @@ -104,874 +104,4 @@ - - 2008 - - - 12 - - - 25 - - - FreeBSD 7.1-RC2 Available - -

The second and last release candidate of &os; 7.1 is now - available. ISO images for Tier-1 architectures are now - available on most of the &os; - mirror sites.

- - - - - 23 - - - &os; Foundation December 2008 Newsletter - -

The &os; Foundation has published their Semi-Annual December 2008 newsletter - which summarizes what they have done to help the &os; - Project and community.

-
-
- - - 9 - - - FreeBSD 7.1-RC1 Available - -

The first release candidate of &os; 7.1 is now available. - ISO images for Tier-1 architectures are now available on - most of the &os; - mirror sites.

-
-
- - - 3 - - - BSD channel launched on YouTube - -

We are pleased to announce the availability of a - dedicated YouTube channel for technical lectures about - FreeBSD and other BSD operating systems. The channel is - available at www.youtube.com/bsdconferences.

- -

This channel allows us to post full hour long lectures - from FreeBSD conferences. The first four videos that - Julian Elisher recorded at MeetBSD have been - posted, and more are on the way.

- -
-
- - - 11 - - - 28 - - - FreeBSD 6.4-RELEASE Available - -

FreeBSD - 6.4-RELEASE is now available. Please be sure to check - the Release Notes - and Release - Errata - before installation for any late-breaking news and/or - issues with 6.4. More information about FreeBSD releases - can be found on the Release Information - page.

-
-
- - - 18 - - -

Commit bit restored: Peter - Holm (src)

-
-
- - - 16 - - - Official FreeBSD Forums Launched - -

The FreeBSD project is finally, after much work, pleased to - announce the availability of an official FreeBSD web based - discussion forum. It is our hope that this forum will serve - as a public support channel for FreeBSD users around the world - and as a complement to our fine mailing lists.

- -

You can register and start using our new service here: http://forums.FreeBSD.org.

-
-
- - - 10 - - - July - September, 2008 Status Reports - -

The July - September, 2008 Status Reports are now - available with 14 entries.

-
-
- - - 3 - -

New committer: - René Ladan (doc-nl)

-
- - - &os; 6.4-RC2 Available - -

The second Release Candidate for &os; 6.4 is now available. - ISO images for Tier-1 architectures are available for - download on most of the &os; mirror sites. - &os; 6.4-RC2 should be the last of the public test builds - for the FreeBSD 6.4 release cycle, therefore we encourage - people to test and report any outstanding bugs as soon as - possible.

-
-
- - - 1 - - New committer: <a href="mailto:versus@FreeBSD.org"> - Konrad Jankowski</a> (src) - SoC2008 alumnus. - -

New committer: Konrad Jankowski (src). - Konrad participated in Summer Of Code 2008. - He will begin his work in the i18n area, specifically in - bringing his SoC code (UTF-8 collation) to the coming releases.

-
-
- -
- - - 10 - - - 19 - - &os; 7.1-BETA2 Available - -

The second beta release of &os; 7.1 is now available. - ISO images for Tier-1 architectures can be found on most of the &os; mirror sites.

-
-
- - - 12 - - - FreeBSD 6.4-RC1 Available - -

The first release candidate of FreeBSD 6.4 is now available. - ISO images for Tier-1 architectures are now available on - most of the - FreeBSD mirror sites.

-
-
- - - 6 - - -

New committer: Lawrence - Stewart (src)

-
-
-
- - - 9 - - - 18 - - - Summer of Code Projects Completed - -

We are happy to report that 19 students successfully - completed their FreeBSD Summer of - Code projects. Congratulations to both mentors and - students, and thanks to Google for running this - program and providing funding.

-
- - -

New committer: Marko Zec - (src)

-
-
- - - 15 - - - PC-BSD 7 Released - -

PC-BSD 7 has just been released. PC-BSD is a - successful desktop operating system based on FreeBSD that - focuses on providing an easy to use desktop system for - casual computer users. The release may be downloaded or purchased on DVD.

-
- - -

New committer: Robert Noland - (src)

-
-
- - - 13 - - - &os; 6.4-BETA/7.1-BETA Available - -

The final stage of the &os;-6.4 and &os;-7.1 Release cycle - has begun with the first beta releases. The ISO images for - Tier-1 architectures are now available - for download on most of the &os; mirror sites. - We encourage people to test and report any outstanding bugs. - Please find more information about these releases on the Release Engineering Information - page.

-
-
- - - 5 - -

New committer: Josh Paetzel - (ports)

-
-
-
- - - 8 - - 26 - -

New committer: Max Brazhnikov - (ports)

-
-
- - - 25 - - -

Enhanced commit privileges: Stanislav Sedov - (src, ports)

-
-
- - - 22 - - -

Enhanced commit privileges: Edward Tomasz Napierala - (src, ports) SoC2008 alumnus.

-
-
- - - 19 - - - April - June, 2008 Status Reports - -

The April - June, 2008 Status Reports are now - available with 14 entries.

-
-
- - - 6 - - -

Enhanced commit privileges: Gábor Páli - (full doc/www)

-
-
-
- - - 7 - - - 28 - - &os; Foundation Requesting Project Proposals - -

The &os; Foundation is seeking the submission of proposals - for work relating to any of the major &os; subsystems or - infrastructure. A budget of $80,000 was allocated for 2008 - to fund multiple development projects. Proposals will be - evaluated based on desirability, technical merit and - cost-effectiveness.

- -

To find out more about the proposal process please read the call. -

-
-
- - - 21 - -

New committer: Robert Noland - (ports)

-
- - -

New committer: Yvan Vanhullebus - (src)

-
-
- - - 18 - - - &os; Foundation July 2008 Newsletter - -

The &os; Foundation has published their Semi-Annual July 2008 newsletter - which summarizes what they have done to help the &os; - Project and community.

-
-
- - - 17 - - - New &os; Core Team elected - -

The &os; Project is pleased to announce the conclusion - of our fourth consecutive democratic election of project - leadership. The &os; Core Team constitutes the - project's "Board of Directors" and is responsible for - vetting new src committers, arbitrating technical - disagreements, weighing in on policy and administrative - issues, and appointing sub-committees for handling - specific duties (security officer, release engineers, port - managers, webmasters, etc..). The core team has been - democratically elected every 2 years by active &os; - committers since 2000.

- -

Peter Wemm is rejoining the team after a 2 year hiatus, - and Kris Kennaway is joining the team for the first time. - The remaining 7 slots were filled with incumbents Wilko - Bulte, Brooks Davis, Giorgos Keramidas, George - V. Neville-Neil, Hiroki Sato, Murray Stokely, and Robert - Watson.

- -

The new core team would like to especially thank outgoing - members Wes Peters and Warner Losh for their many years of - service to &os;, our electioneer Dr. Josef Karthauser - for running another election for us, and our returning - core secretary Philip Paeps.

-
- - -

New committer: Philip M. Gollucci - (ports)

-
- - -

New committer: Greg Larkin - (ports)

-
-
- - - 8 - - iXsystems Announces Professional &os; and PC-BSD Support - Offering -

A press - release announcing the launch of iXsystems' Professional - Services Division which will provide Professional Enterprise - Grade support, consulting, and development for &os; and PC-BSD.

-
- - -

New committer: Stacey - Son (src)

-
-
- - - 3 - -

New committer: Nathan - Whitehorn (src)

-
-
-
- - - 6 - - - 23 - -

New committer: Erik - Cederstrand (projects)

-
- - - FreeBSD Technologies in Firefox 3 -

A - press - release describing FreeBSD technologies used by Mozilla - Firefox.

-
-
- - - 19 - -

New committer: Dmitry Marakasov - (ports)

-
-
- - - 16 - - -

New committer: Ermal - Luçi (src)

-
-
- - - 10 - - - New committer: <a href="mailto:ivoras@FreeBSD.org">Ivan Voras</a> - (src). SoC2005-2007 alumnus. - -

Ivan Voras is now - a src/ committer. He participated in the Google Summer of - Code program in 2005, 2006, and 2007.

- -
-
- - - 3 - - - FreeBSD begins switch to Subversion - -

The FreeBSD Project has begun the switch of its source code - management system from CVS to Subversion. At this - point in time, FreeBSD's developers are making changes to the - base system in the Subversion repository. We have a replication - system in place that exports our work to the legacy CVS tree on - a continuous basis.

- -

People who are using our extensive CVS based distribution - network (including anoncvs, CVSup, cvsweb, ftp) will not be - interrupted by our work-in-progress. We are committed to - maintaining the existing CVS based distribution system for - at least the support lifetime of all existing "stable" - branches. Security and errata patches will continue to be made - available in their usual CVS locations.

- -

We expect to make our Subversion based source tree and other - supporting infrastructure public soon. There will be new - mailing lists to subscribe to if you wish to receive Subversion - commit notifications.

- -

Our ports, doc and www trees are not affected at this time. A - separate decision will be made regarding those CVS repositories - soon.

- -

Many people have contributed to the effort, but we wish - to thank Michael Haggerty and the cvs2svn project developers - for their assistance with cvs2svn. Peter Wemm spent several weeks - of Yahoo!'s time repairing - the CVS tree, preparing for and performing the conversion, and - the configuration of the Subversion infrastructure. Yahoo! - donated the server hardware.

-
-
-
- - - 5 - - 24 - - -

New committer: Manolis - Kiagias (doc/www)

-
>>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed Feb 11 18:00:45 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5DDB2106566C; Wed, 11 Feb 2009 18:00:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F26B106564A for ; Wed, 11 Feb 2009 18:00:45 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id F13748FC0A for ; Wed, 11 Feb 2009 18:00:44 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BI0i4o073557 for ; Wed, 11 Feb 2009 18:00:44 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BI0iXk073555 for perforce@freebsd.org; Wed, 11 Feb 2009 18:00:44 GMT (envelope-from pgj@FreeBSD.org) Date: Wed, 11 Feb 2009 18:00:44 GMT Message-Id: <200902111800.n1BI0iXk073555@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 157558 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: Wed, 11 Feb 2009 18:00:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=157558 Change 157558 by pgj@beehive on 2009/02/11 18:00:10 Fix caution and warning labels MFP4 after: 3 days Affected files ... .. //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/share/sgml/freebsd.dsl#5 edit Differences ... ==== //depot/projects/docproj_hu/doc/hu_HU.ISO8859-2/share/sgml/freebsd.dsl#5 (text+ko) ==== @@ -42,6 +42,12 @@ attributes: (list (list "href" "mailto:gabor@FreeBSD.org")) (literal "gabor@FreeBSD.org>.")) )))) + + (define (local-hu-label-title-sep) + (list + (list (normalize "caution") ": ") + (list (normalize "warning") ": ") + )) ]]> From owner-p4-projects@FreeBSD.ORG Wed Feb 11 20:05:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2D3FE10656CF; Wed, 11 Feb 2009 20:05:54 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C382106568C for ; Wed, 11 Feb 2009 20:05:53 +0000 (UTC) (envelope-from antab@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 534BC8FC1D for ; Wed, 11 Feb 2009 20:05:53 +0000 (UTC) (envelope-from antab@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BK5ra6088731 for ; Wed, 11 Feb 2009 20:05:53 GMT (envelope-from antab@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BK5r9Y088729 for perforce@freebsd.org; Wed, 11 Feb 2009 20:05:53 GMT (envelope-from antab@FreeBSD.org) Date: Wed, 11 Feb 2009 20:05:53 GMT Message-Id: <200902112005.n1BK5r9Y088729@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to antab@FreeBSD.org using -f From: Arnar Mar Sig To: Perforce Change Reviews Cc: Subject: PERFORCE change 157567 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: Wed, 11 Feb 2009 20:05:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=157567 Change 157567 by antab@antab_farm on 2009/02/11 20:05:41 Misc changes to get cpu_switch() working, still does not work. Affected files ... .. //depot/projects/avr32/src/share/man/man9/mi_switch.9#2 edit .. //depot/projects/avr32/src/sys/avr32/avr32/db_interface.c#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/genassym.c#2 edit .. //depot/projects/avr32/src/sys/avr32/avr32/machdep.c#5 edit .. //depot/projects/avr32/src/sys/avr32/avr32/pm_machdep.c#4 edit .. //depot/projects/avr32/src/sys/avr32/avr32/switch.S#2 edit .. //depot/projects/avr32/src/sys/avr32/avr32/trap.c#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/vm_machdep.c#4 edit .. //depot/projects/avr32/src/sys/avr32/conf/NGW100#5 edit .. //depot/projects/avr32/src/sys/avr32/include/pcb.h#3 edit .. //depot/projects/avr32/src/sys/avr32/include/reg.h#4 edit Differences ... ==== //depot/projects/avr32/src/share/man/man9/mi_switch.9#2 (text+ko) ==== @@ -48,11 +48,11 @@ .In sys/param.h .In sys/proc.h .Ft void -.Fn mi_switch "void" +.Fn mi_switch "int flags" "struct thread *newtd" .Ft void -.Fn cpu_switch "void" +.Fn cpu_switch "struct thread *old" "struct thread *new" "struct mtx *lock" .Ft void -.Fn cpu_throw "void" +.Fn cpu_throw "struct thread *old" "struct thread *new" .Sh DESCRIPTION The .Fn mi_switch @@ -132,12 +132,8 @@ which will perform the actual thread context switch. .Pp .Fn cpu_switch -first saves the context of the current thread. -Next, it calls -.Fn choosethread -to determine which thread to run next. -Finally, it reads in the saved context of the new thread and starts to -execute the new thread. +first saves the context of the old thread, then it reads in the saved +context of the new thread and starts to execute the new thread. .Pp .Fn cpu_throw is similar to ==== //depot/projects/avr32/src/sys/avr32/avr32/db_interface.c#3 (text+ko) ==== @@ -58,13 +58,24 @@ static db_varfcn_t db_frame; #define DB_OFFSET(x) (db_expr_t *)(offsetof(struct trapframe, regs) + offsetof(struct reg, x)) -#define DB_OFFSET_REG(x, r) (db_expr_t *)(offsetof(struct trapframe, regs) + offsetof(struct reg, x) + (r * sizeof(int))) struct db_variable db_regs[] = { - { "r0", DB_OFFSET_REG(r, 0), db_frame }, - { "sp", DB_OFFSET(sp), db_frame }, - { "lr", DB_OFFSET(lr), db_frame }, - { "pc", DB_OFFSET(pc), db_frame }, - { "sr", DB_OFFSET(sr), db_frame }, + { "r0", DB_OFFSET(r0), db_frame }, + { "r1", DB_OFFSET(r1), db_frame }, + { "r2", DB_OFFSET(r2), db_frame }, + { "r3", DB_OFFSET(r3), db_frame }, + { "r4", DB_OFFSET(r4), db_frame }, + { "r5", DB_OFFSET(r5), db_frame }, + { "r6", DB_OFFSET(r6), db_frame }, + { "r7", DB_OFFSET(r7), db_frame }, + { "r8", DB_OFFSET(r8), db_frame }, + { "r9", DB_OFFSET(r9), db_frame }, + { "r10", DB_OFFSET(r10), db_frame }, + { "r11", DB_OFFSET(r11), db_frame }, + { "r12", DB_OFFSET(r12), db_frame }, + { "sp", DB_OFFSET(sp), db_frame }, + { "lr", DB_OFFSET(lr), db_frame }, + { "pc", DB_OFFSET(pc), db_frame }, + { "sr", DB_OFFSET(sr), db_frame }, }; struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); ==== //depot/projects/avr32/src/sys/avr32/avr32/genassym.c#2 (text+ko) ==== @@ -35,5 +35,8 @@ #include #include #include +#include ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); +ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); +ASSYM(TD_PCB_SIZE, sizeof(struct trapframe)); ==== //depot/projects/avr32/src/sys/avr32/avr32/machdep.c#5 (text+ko) ==== @@ -269,14 +269,6 @@ printf("Kernel dumps not implemented on this architecture\n"); } - -int -savectx(struct pcb *pcb) -{ - avr32_impl(); - return (0); -} - void makectx(struct trapframe *tf, struct pcb *pcb) { ==== //depot/projects/avr32/src/sys/avr32/avr32/pm_machdep.c#4 (text+ko) ==== @@ -78,10 +78,6 @@ return (0); } -void cpu_switch(struct thread *td, struct thread *newtd, struct mtx *lock) { - avr32_impl(); -} - /* * System call to cleanup state after a signal * has been taken. Reset signal mask and ==== //depot/projects/avr32/src/sys/avr32/avr32/switch.S#2 (text+ko) ==== @@ -26,12 +26,45 @@ */ #include +#include #include #include "assym.s" __FBSDID("$FreeBSD: $"); ENTRY(fork_trampoline) + breakpoint sub r12, pc, (. - 2f) bral panic 2: .asciz "fork_trampoline needed\n" + + +/** + * r12: Pointer to where to save context + */ +ENTRY(savectx) + mustr r11 # Get status register + st.w r12++, r11 # Store status register + sub r12, -4 # Skip PC + stm r12, r0-lr # Store rest + mov lr, r8 + retal sp # return 0 + +/** + * r12: Pointer to where to restore context from + */ +ENTRY(restorectx) + ld.w r11, r12++ # Load status register + musfr r11 # Set status register + sub r12, -4 # Skip PC + ldm r12, r0-lr # Load rest + + frs # Flush the return stack + sub pc, -2 # Flush the pipeline + + # everything looks good in gdb here, but when retal is executed something + # freaky happens and everything is lost + breakpoint + + retal pc # return 1 + ==== //depot/projects/avr32/src/sys/avr32/avr32/trap.c#3 (text+ko) ==== @@ -61,13 +61,15 @@ #include #include -static void +void trapframe_dump(struct trapframe *frame) { + register_t *reg; int i; for (i = 0; i <= 12; i++) { - printf("r%-2d = %08x ", i, frame->regs.r[i]); + reg = (register_t *)((size_t)&frame->regs.r0 - (i * sizeof(register_t))); + printf("r%-2d = %08x ", i, *reg); if (!((i+1) % 4)) { printf("\n"); } ==== //depot/projects/avr32/src/sys/avr32/avr32/vm_machdep.c#4 (text+ko) ==== @@ -67,11 +67,11 @@ bcopy(td1->td_pcb, td2->td_pcb, sizeof(struct pcb)); /* Sets regs (need to look into this better later on) */ - td2->td_pcb->pcb_regs.regs.r[10] = (register_t)fork_return; - td2->td_pcb->pcb_regs.regs.r[11] = (register_t)td2; - td2->td_pcb->pcb_regs.regs.r[12] = (register_t)td2->td_frame; - // TODO: STACK POINTER - td2->td_pcb->pcb_regs.regs.pc = (register_t)fork_trampoline; + td2->td_pcb->pcb_regs.regs.r10 = (register_t)fork_return; + td2->td_pcb->pcb_regs.regs.r11 = (register_t)td2; + td2->td_pcb->pcb_regs.regs.r12 = (register_t)td2->td_frame; + td2->td_pcb->pcb_regs.regs.sp = (register_t)td2->td_frame - sizeof(struct trapframe); + td2->td_pcb->pcb_regs.regs.lr = (register_t)fork_trampoline; td2->td_md.md_saved_intr = 0; /* TODO: probably not right. */ td2->td_md.md_spinlock_count = 1; @@ -86,8 +86,8 @@ void cpu_set_fork_handler(struct thread *td, void (*func) __P((void *)), void *arg) { - td->td_pcb->pcb_regs.regs.r[10] = (register_t)func; - td->td_pcb->pcb_regs.regs.r[11] = (register_t)arg; + td->td_pcb->pcb_regs.regs.r10 = (register_t)func; + td->td_pcb->pcb_regs.regs.r11 = (register_t)arg; } void @@ -147,10 +147,10 @@ bcopy(td0->td_pcb, td->td_pcb, sizeof(struct pcb)); /* Sets regs (need to look into this better later on) */ - td->td_pcb->pcb_regs.regs.r[10] = (register_t)fork_return; - td->td_pcb->pcb_regs.regs.r[11] = (register_t)td; - td->td_pcb->pcb_regs.regs.r[12] = (register_t)td->td_frame; - // TODO: STACK POINTER + td->td_pcb->pcb_regs.regs.r10 = (register_t)fork_return; + td->td_pcb->pcb_regs.regs.r11 = (register_t)td; + td->td_pcb->pcb_regs.regs.r12 = (register_t)td->td_frame; + td->td_pcb->pcb_regs.regs.sp = (register_t)td->td_frame - sizeof(struct trapframe); td->td_pcb->pcb_regs.regs.pc = (register_t)fork_trampoline; td->td_md.md_saved_intr = 0; /* TODO: probably not right. */ @@ -190,3 +190,24 @@ { avr32_impl(); } + +void +cpu_switch(struct thread *old, struct thread *new, struct mtx *mtx) +{ + struct pcb *oldpcb, *newpcb; + + oldpcb = old->td_pcb; + if (!savectx(oldpcb)) { + trapframe_dump(oldpcb); + avr32_debug("in from savectx\n"); + old->td_lock = mtx; + newpcb = new->td_pcb; + PCPU_SET(curthread, new); + trapframe_dump(newpcb); + restorectx(newpcb); + /* We should not get here. */ + panic("cpu_switch: restorectx() returned"); + } + panic("end of cpu_switch, return from another thread?"); +} + ==== //depot/projects/avr32/src/sys/avr32/conf/NGW100#5 (text+ko) ==== @@ -12,9 +12,9 @@ makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols #options VERBOSE_SYSINIT -#options DDB +options DDB options KDB -#options GDB +options GDB options SCHED_4BSD #4BSD scheduler #options INET #InterNETworking ==== //depot/projects/avr32/src/sys/avr32/include/pcb.h#3 (text+ko) ==== @@ -43,6 +43,8 @@ void makectx(struct trapframe *, struct pcb *); int savectx(struct pcb *); +void restorectx(struct pcb *); + #endif #endif /* !_MACHINE_PCB_H_ */ ==== //depot/projects/avr32/src/sys/avr32/include/reg.h#4 (text+ko) ==== @@ -3,12 +3,25 @@ #ifndef MACHINE_REG_H #define MACHINE_REG_H +#ifndef LOCORE struct reg { - register_t sr; // Status register - register_t pc; // Program counter - register_t lr; - register_t sp; - register_t r[13]; + register_t sr; /* Status register */ + register_t pc; /* Program counter */ + register_t lr; + register_t sp; + register_t r12; + register_t r11; + register_t r10; + register_t r9; + register_t r8; + register_t r7; + register_t r6; + register_t r5; + register_t r4; + register_t r3; + register_t r2; + register_t r1; + register_t r0; }; struct fpreg { @@ -61,8 +74,7 @@ static inline void __raw_write(volatile void *addr, uint32_t value) { *(volatile uint32_t *)addr = value; } - - +#endif #endif #endif /* !MACHINE_REG_H */ From owner-p4-projects@FreeBSD.ORG Wed Feb 11 21:40:30 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EACCA1065673; Wed, 11 Feb 2009 21:40:29 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A82401065670 for ; Wed, 11 Feb 2009 21:40:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 94A228FC2D for ; Wed, 11 Feb 2009 21:40:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1BLeTDG008425 for ; Wed, 11 Feb 2009 21:40:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1BLeTZF008423 for perforce@freebsd.org; Wed, 11 Feb 2009 21:40:29 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 11 Feb 2009 21:40:29 GMT Message-Id: <200902112140.n1BLeTZF008423@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157570 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: Wed, 11 Feb 2009 21:40:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=157570 Change 157570 by hselasky@hselasky_laptop001 on 2009/02/11 21:39:58 USB WLAN patches. - try to handle more detach races with the network stack - next state and argument must be atomically read before passing to iv_nextstate callback - increase control request timeout - make sure INIT state is handled correctly USB wise - revert changes to "ieee80211_proto.c" Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#38 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#37 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#38 edit .. //depot/projects/usb/src/sys/net80211/ieee80211_proto.c#13 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#38 (text+ko) ==== @@ -125,7 +125,7 @@ static usb2_proc_callback_t rum_stop_task; static usb2_proc_callback_t rum_flush_task; -static void rum_do_request(struct rum_softc *sc, +static usb2_error_t rum_do_request(struct rum_softc *sc, struct usb2_device_request *req, void *data); static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, @@ -154,8 +154,8 @@ static uint32_t rum_read(struct rum_softc *, uint16_t); static void rum_read_multi(struct rum_softc *, uint16_t, void *, int); -static void rum_write(struct rum_softc *, uint16_t, uint32_t); -static void rum_write_multi(struct rum_softc *, uint16_t, void *, +static usb2_error_t rum_write(struct rum_softc *, uint16_t, uint32_t); +static usb2_error_t rum_write_multi(struct rum_softc *, uint16_t, void *, size_t); static void rum_bbp_write(struct rum_softc *, uint8_t, uint8_t); static uint8_t rum_bbp_read(struct rum_softc *, uint8_t); @@ -178,7 +178,7 @@ static void rum_read_eeprom(struct rum_softc *); static int rum_bbp_init(struct rum_softc *); static void rum_init(void *); -static int rum_load_microcode(struct rum_softc *, const uint8_t *, +static void rum_load_microcode(struct rum_softc *, const uint8_t *, size_t); static int rum_prepare_beacon(struct rum_softc *, struct ieee80211vap *); @@ -444,7 +444,6 @@ struct ifnet *ifp; struct ieee80211com *ic; unsigned int ntries; - int error; uint32_t tmp; uint8_t bands; @@ -466,11 +465,12 @@ device_printf(sc->sc_dev, "MAC/BBP RT2573 (rev 0x%05x), RF %s\n", tmp, rum_get_rf(sc->rf_rev)); - error = rum_load_microcode(sc, rt2573_ucode, sizeof(rt2573_ucode)); - if (error != 0) { - device_printf(sc->sc_dev, "could not load 8051 microcode\n"); + rum_load_microcode(sc, rt2573_ucode, sizeof(rt2573_ucode)); + + /* XXX WLAN race --hps */ + if (usb2_proc_is_gone(&sc->sc_tq)) return; - } + RUM_UNLOCK(sc); ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); @@ -578,20 +578,21 @@ return (0); } -static void +static usb2_error_t rum_do_request(struct rum_softc *sc, struct usb2_device_request *req, void *data) { usb2_error_t err; err = usb2_do_request_proc(sc->sc_udev, &sc->sc_tq, - req, data, 0, NULL, 250 /* ms */); + req, data, 0, NULL, 1000 /* ms */); if (err) { - DPRINTFN(1, "Control request failed! (ignored)\n"); + DPRINTFN(1, "Control request failed, " + "%s! (ignored)\n", usb2_errstr(err)); rum_pause(sc, hz / 100); } - return; + return (err); } static struct ieee80211vap * @@ -736,21 +737,21 @@ struct rum_vap *rvp = RUM_VAP(vap); const struct ieee80211_txparam *tp; enum ieee80211_state ostate; + enum ieee80211_state nstate; struct ieee80211_node *ni; + int arg; uint32_t tmp; ostate = vap->iv_state; + nstate = sc->sc_state; + arg = sc->sc_arg; /* callout it stopped */ usb2_callout_stop(&rvp->amrr_ch); - switch (sc->sc_state) { + switch (nstate) { case IEEE80211_S_INIT: if (ostate == IEEE80211_S_RUN) { - /* - * BUG: this code is not executed like it - * should --hps - */ /* abort TSF synchronization */ tmp = rum_read(sc, RT2573_TXRX_CSR9); rum_write(sc, RT2573_TXRX_CSR9, tmp & ~0x00ffffff); @@ -785,11 +786,17 @@ break; } + /* sanity checks */ + if (nstate == IEEE80211_S_INIT) + return; + if (nstate != sc->sc_state) + return; + RUM_UNLOCK(sc); IEEE80211_LOCK(ic); - rvp->newstate(vap, sc->sc_state, sc->sc_arg); + rvp->newstate(vap, nstate, arg); if (vap->iv_newstate_cb != NULL) - vap->iv_newstate_cb(vap, sc->sc_state, sc->sc_arg); + vap->iv_newstate_cb(vap, nstate, arg); IEEE80211_UNLOCK(ic); RUM_LOCK(sc); } @@ -809,18 +816,16 @@ /* do it in a process context */ sc->sc_state = nstate; sc->sc_arg = arg; + rum_queue_command(sc, rum_task, + &sc->sc_task[0].hdr, + &sc->sc_task[1].hdr); RUM_UNLOCK(sc); if (nstate == IEEE80211_S_INIT) { rvp->newstate(vap, nstate, arg); return 0; - } else { - RUM_LOCK(sc); - rum_queue_command(sc, rum_task, &sc->sc_task[0].hdr, - &sc->sc_task[1].hdr); - RUM_UNLOCK(sc); - return EINPROGRESS; } + return (EINPROGRESS); } static void @@ -1084,8 +1089,6 @@ } } -#define RUM_TX_TIMEOUT 5000 - static int rum_sendprot(struct rum_softc *sc, const struct mbuf *m, struct ieee80211_node *ni, int prot, int rate) @@ -1468,15 +1471,15 @@ rum_do_request(sc, &req, buf); } -static void +static usb2_error_t rum_write(struct rum_softc *sc, uint16_t reg, uint32_t val) { uint32_t tmp = htole32(val); - rum_write_multi(sc, reg, &tmp, sizeof tmp); + return (rum_write_multi(sc, reg, &tmp, sizeof tmp)); } -static void +static usb2_error_t rum_write_multi(struct rum_softc *sc, uint16_t reg, void *buf, size_t len) { struct usb2_device_request req; @@ -1487,7 +1490,7 @@ USETW(req.wIndex, reg); USETW(req.wLength, len); - rum_do_request(sc, &req, buf); + return (rum_do_request(sc, &req, buf)); } static void @@ -1496,6 +1499,8 @@ uint32_t tmp; int ntries; + DPRINTFN(2, "reg=0x%08x\n", reg); + for (ntries = 0; ntries != 100; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; @@ -1517,6 +1522,8 @@ uint32_t val; int ntries; + DPRINTFN(2, "reg=0x%08x\n", reg); + for (ntries = 0; ntries != 100; ntries++) { if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) break; @@ -2088,6 +2095,8 @@ rum_write(sc, RT2573_TXRX_CSR0, tmp); ifp->if_drv_flags |= IFF_DRV_RUNNING; + + usb2_transfer_set_stall(sc->sc_xfer[RUM_BULK_WR]); usb2_transfer_start(sc->sc_xfer[RUM_BULK_RD]); return; @@ -2145,20 +2154,22 @@ rum_write(sc, RT2573_MAC_CSR1, 0); } -static int +static void rum_load_microcode(struct rum_softc *sc, const uint8_t *ucode, size_t size) { struct usb2_device_request req; uint16_t reg = RT2573_MCU_CODE_BASE; - - /* - * TODO: If the firmware is already loaded, - * then we need to return from here! - */ + usb2_error_t err; /* copy firmware image into NIC */ - for (; size >= 4; reg += 4, ucode += 4, size -= 4) - rum_write(sc, reg, UGETDW(ucode)); + for (; size >= 4; reg += 4, ucode += 4, size -= 4) { + err = rum_write(sc, reg, UGETDW(ucode)); + if (err) { + /* firmware already loaded ? */ + device_printf(sc->sc_dev, "Firmware load failed.\n"); + break; + } + } req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = RT2573_MCU_CNTL; @@ -2167,7 +2178,9 @@ USETW(req.wLength, 0); rum_do_request(sc, &req, NULL); - return (0); + + /* give the chip some time to boot */ + rum_pause(sc, hz / 8); } static int @@ -2359,10 +2372,9 @@ RUM_LOCK(sc); /* do it in a process context */ sc->sc_scan_action = RUM_SET_CHANNEL; + sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); rum_queue_command(sc, rum_scantask, &sc->sc_scantask[0].hdr, &sc->sc_scantask[1].hdr); - - sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); RUM_UNLOCK(sc); } ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#37 (text+ko) ==== @@ -454,6 +454,11 @@ /* retrieve MAC address and various other things from EEPROM */ ural_read_eeprom(sc); + + /* XXX WLAN race --hps */ + if (usb2_proc_is_gone(&sc->sc_tq)) + return; + RAL_UNLOCK(sc); device_printf(sc->sc_dev, "MAC/BBP RT2570 (rev 0x%02x), RF %s\n", @@ -571,7 +576,7 @@ usb2_error_t err; err = usb2_do_request_proc(sc->sc_udev, &sc->sc_tq, - req, data, 0, NULL, 250 /* ms */); + req, data, 0, NULL, 1000 /* ms */); if (err) { DPRINTFN(1, "Control request failed! (ignored)\n"); @@ -721,21 +726,21 @@ struct ural_vap *uvp = URAL_VAP(vap); const struct ieee80211_txparam *tp; enum ieee80211_state ostate; + enum ieee80211_state nstate; struct ieee80211_node *ni; struct mbuf *m; + int arg; ostate = vap->iv_state; + nstate = sc->sc_state; + arg = sc->sc_arg; /* callout is stopped */ usb2_callout_stop(&uvp->amrr_ch); - switch (sc->sc_state) { + switch (nstate) { case IEEE80211_S_INIT: if (ostate == IEEE80211_S_RUN) { - /* - * BUG: this code is not executed like it - * should --hps - */ /* abort TSF synchronization */ ural_write(sc, RAL_TXRX_CSR19, 0); @@ -788,11 +793,17 @@ break; } + /* sanity checks */ + if (nstate == IEEE80211_S_INIT) + return; + if (nstate != sc->sc_state) + return; + RAL_UNLOCK(sc); IEEE80211_LOCK(ic); - uvp->newstate(vap, sc->sc_state, sc->sc_arg); + uvp->newstate(vap, nstate, arg); if (vap->iv_newstate_cb != NULL) - vap->iv_newstate_cb(vap, sc->sc_state, sc->sc_arg); + vap->iv_newstate_cb(vap, nstate, arg); IEEE80211_UNLOCK(ic); RAL_LOCK(sc); } @@ -842,21 +853,18 @@ /* do it in a process context */ sc->sc_state = nstate; sc->sc_arg = arg; + ural_queue_command(sc, ural_task, + &sc->sc_task[0].hdr, + &sc->sc_task[1].hdr); RAL_UNLOCK(sc); if (nstate == IEEE80211_S_INIT) { uvp->newstate(vap, nstate, arg); return 0; - } else { - RAL_LOCK(sc); - ural_queue_command(sc, ural_task, &sc->sc_task[0].hdr, - &sc->sc_task[1].hdr); - RAL_UNLOCK(sc); - return EINPROGRESS; } + return (EINPROGRESS); } - static void ural_bulk_write_callback(struct usb2_xfer *xfer) { @@ -1726,7 +1734,7 @@ struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; uint8_t power, tmp; - u_int i, chan; + unsigned int i, chan; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) @@ -2215,6 +2223,7 @@ ural_write(sc, RAL_TXRX_CSR2, tmp); ifp->if_drv_flags |= IFF_DRV_RUNNING; + usb2_transfer_set_stall(sc->sc_xfer[URAL_BULK_WR]); usb2_transfer_start(sc->sc_xfer[URAL_BULK_RD]); return; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#38 (text+ko) ==== @@ -105,7 +105,7 @@ const uint8_t mac[IEEE80211_ADDR_LEN]); static int zyd_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int zyd_cmd(struct zyd_softc *, uint16_t, const void *, int, - void *, int, u_int); + void *, int, unsigned int); static int zyd_read16(struct zyd_softc *, uint16_t, uint16_t *); static int zyd_read32(struct zyd_softc *, uint16_t, uint32_t *); static int zyd_write16(struct zyd_softc *, uint16_t, uint16_t); @@ -371,6 +371,10 @@ return; } + /* XXX WLAN race --hps */ + if (usb2_proc_is_gone(&sc->sc_tq)) + return; + ZYD_UNLOCK(sc); ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); @@ -612,10 +616,15 @@ struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_node *ni = vap->iv_bss; + enum ieee80211_state nstate; struct zyd_vap *zvp = ZYD_VAP(vap); + int arg; int error; - switch (sc->sc_state) { + nstate = sc->sc_state; + arg = sc->sc_arg; + + switch (nstate) { case IEEE80211_S_AUTH: zyd_set_chan(sc, ic->ic_curchan); break; @@ -638,11 +647,17 @@ break; } fail: + /* sanity checks */ + if (nstate == IEEE80211_S_INIT) + return; + if (nstate != sc->sc_state) + return; + ZYD_UNLOCK(sc); IEEE80211_LOCK(ic); - zvp->newstate(vap, sc->sc_state, sc->sc_arg); + zvp->newstate(vap, nstate, arg); if (vap->iv_newstate_cb != NULL) - vap->iv_newstate_cb(vap, sc->sc_state, sc->sc_arg); + vap->iv_newstate_cb(vap, nstate, arg); IEEE80211_UNLOCK(ic); ZYD_LOCK(sc); } @@ -662,18 +677,16 @@ /* do it in a process context */ sc->sc_state = nstate; sc->sc_arg = arg; + zyd_queue_command(sc, zyd_task, + &sc->sc_task[0].hdr, + &sc->sc_task[1].hdr); ZYD_UNLOCK(sc); if (nstate == IEEE80211_S_INIT) { zvp->newstate(vap, nstate, arg); return (0); - } else { - ZYD_LOCK(sc); - zyd_queue_command(sc, zyd_task, &sc->sc_task[0].hdr, - &sc->sc_task[1].hdr); - ZYD_UNLOCK(sc); - return (EINPROGRESS); } + return (EINPROGRESS); } /* @@ -829,7 +842,7 @@ static int zyd_cmd(struct zyd_softc *sc, uint16_t code, const void *idata, int ilen, - void *odata, int olen, u_int flags) + void *odata, int olen, unsigned int flags) { struct zyd_cmd cmd; struct zyd_rq rq; @@ -1279,7 +1292,7 @@ struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct zyd_phy_pair r[] = ZYD_AL2230_PHY_BANDEDGE6; - u_int chan = ieee80211_chan2ieee(ic, c); + unsigned int chan = ieee80211_chan2ieee(ic, c); if (chan == 1 || chan == 11) r[0].val = 0x12; @@ -2104,7 +2117,7 @@ struct ieee80211com *ic = ifp->if_l2com; struct zyd_rf *rf = &sc->sc_rf; uint32_t tmp; - u_int chan; + unsigned int chan; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) { @@ -2885,6 +2898,7 @@ zyd_write32_m(sc, ZYD_CR_INTERRUPT, ZYD_HWINT_MASK); ifp->if_drv_flags |= IFF_DRV_RUNNING; + usb2_transfer_set_stall(sc->sc_xfer[ZYD_BULK_WR]); usb2_transfer_start(sc->sc_xfer[ZYD_BULK_RD]); usb2_transfer_start(sc->sc_xfer[ZYD_INTR_RD]); ==== //depot/projects/usb/src/sys/net80211/ieee80211_proto.c#13 (text+ko) ==== @@ -154,8 +154,6 @@ ieee80211_wds_detach(ic); ieee80211_adhoc_detach(ic); ieee80211_sta_detach(ic); - - taskqueue_drain(taskqueue_thread, &ic->ic_parent_task); } static void From owner-p4-projects@FreeBSD.ORG Thu Feb 12 00:06:00 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C58AC106568E; Thu, 12 Feb 2009 00:05:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B32A1065672 for ; Thu, 12 Feb 2009 00:05:59 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 395DD8FC0C for ; Thu, 12 Feb 2009 00:05:59 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1C05wov023594 for ; Thu, 12 Feb 2009 00:05:58 GMT (envelope-from zec@icir.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1C05wfX023592 for perforce@freebsd.org; Thu, 12 Feb 2009 00:05:58 GMT (envelope-from zec@icir.org) Date: Thu, 12 Feb 2009 00:05:58 GMT Message-Id: <200902120005.n1C05wfX023592@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@icir.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 157581 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: Thu, 12 Feb 2009 00:06:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=157581 Change 157581 by zec@zec_tpx32 on 2009/02/12 00:05:38 Unbreak build. Affected files ... .. //depot/projects/vimage/src/sys/netinet/ip_fw2.c#66 edit Differences ... ==== //depot/projects/vimage/src/sys/netinet/ip_fw2.c#66 (text+ko) ==== @@ -290,19 +290,16 @@ "Lifetime of dyn. rules for other situations"); SYSCTL_V_INT(V_NET, vnet_ipfw, _net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_RW, dyn_keepalive, 0, "Enable keepalives for dyn. rules"); -#endif /* SYSCTL_NODE */ + #ifdef INET6 /* * IPv6 specific variables */ -#if 0 /* XXX MARKO revisit */ -#ifdef SYSCTL_NODE -SYSCTL_DECL(_net_inet6_ip6); -#endif /* SYSCTL_NODE */ +#if 0 static struct sysctl_ctx_list ip6_fw_sysctl_ctx; static struct sysctl_oid *ip6_fw_sysctl_tree; -#endif /* 0 XXX MARKO */ +#endif #ifdef VIMAGE_GLOBALS static int fw_deny_unknown_exthdrs; From owner-p4-projects@FreeBSD.ORG Thu Feb 12 04:28:41 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 457F9106567A; Thu, 12 Feb 2009 04:28:41 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9488106564A; Thu, 12 Feb 2009 04:28:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 9C3168FC24; Thu, 12 Feb 2009 04:28:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 016F1FF35; Thu, 12 Feb 2009 17:28:40 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TBiKimLJYm8x; Thu, 12 Feb 2009 17:28:36 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 12 Feb 2009 17:28:36 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 63A4A1142B; Thu, 12 Feb 2009 17:28:36 +1300 (NZDT) Date: Wed, 11 Feb 2009 20:28:36 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090212042836.GF74077@citylink.fud.org.nz> References: <200902101740.n1AHeWnQ040806@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902101740.n1AHeWnQ040806@repoman.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Perforce Change Reviews Subject: Re: PERFORCE change 157497 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: Thu, 12 Feb 2009 04:28:45 -0000 On Tue, Feb 10, 2009 at 05:40:32PM +0000, Hans Petter Selasky wrote: > http://perforce.freebsd.org/chv.cgi?CH=157497 > > Change 157497 by hselasky@hselasky_laptop001 on 2009/02/10 17:39:48 > > > USB WLAN: Fix more races and panics after that > Andrew Thompson re-ported the WLAN drivers > from the old USB stack. > > Affected files ... Do not use personal references in the commit logs, its quite rude. From owner-p4-projects@FreeBSD.ORG Thu Feb 12 10:01:04 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B2E761065672; Thu, 12 Feb 2009 10:01:03 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7261E106566B for ; Thu, 12 Feb 2009 10:01:03 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5F20E8FC14 for ; Thu, 12 Feb 2009 10:01:03 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CA13Ju012453 for ; Thu, 12 Feb 2009 10:01:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CA13Ch012451 for perforce@freebsd.org; Thu, 12 Feb 2009 10:01:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 12 Feb 2009 10:01:03 GMT Message-Id: <200902121001.n1CA13Ch012451@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157587 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: Thu, 12 Feb 2009 10:01:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=157587 Change 157587 by rwatson@rwatson_cinnamon on 2009/02/12 10:00:55 Fix warning building on 32-bit FreeBSD systems: cast size_t to uintmax_t and use %ju for scanf. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#28 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#28 (text+ko) ==== @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#27 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#28 $ */ #include @@ -437,7 +437,7 @@ while (*str == ' ' || *str == '\t') str++; - nparsed = sscanf(str, "%lu%c", &val, &mult); + nparsed = sscanf(str, "%ju%c", (uintmax_t *)&val, &mult); switch (nparsed) { case 1: From owner-p4-projects@FreeBSD.ORG Thu Feb 12 15:34:53 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 08ACA1065677; Thu, 12 Feb 2009 15:34:53 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADFC7106564A; Thu, 12 Feb 2009 15:34:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 70BB68FC1A; Thu, 12 Feb 2009 15:34:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 92823FF39; Fri, 13 Feb 2009 04:34:51 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nr0Ko+1fw41f; Fri, 13 Feb 2009 04:34:48 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Fri, 13 Feb 2009 04:34:48 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 6A4FE1142E; Fri, 13 Feb 2009 04:34:47 +1300 (NZDT) Date: Thu, 12 Feb 2009 07:34:47 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090212153447.GG74077@citylink.fud.org.nz> References: <200902101740.n1AHeWnQ040806@repoman.freebsd.org> <20090212042836.GF74077@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090212042836.GF74077@citylink.fud.org.nz> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Perforce Change Reviews Subject: Re: PERFORCE change 157497 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: Thu, 12 Feb 2009 15:34:54 -0000 On Wed, Feb 11, 2009 at 08:28:36PM -0800, Andrew Thompson wrote: > On Tue, Feb 10, 2009 at 05:40:32PM +0000, Hans Petter Selasky wrote: > > http://perforce.freebsd.org/chv.cgi?CH=157497 > > > > Change 157497 by hselasky@hselasky_laptop001 on 2009/02/10 17:39:48 > > > > > > USB WLAN: Fix more races and panics after that > > Andrew Thompson re-ported the WLAN drivers > > from the old USB stack. > > > > Affected files ... > > Do not use personal references in the commit logs, its quite rude. Sorry for pulling you up on this Hans, I overreacted. cheers, Andrew From owner-p4-projects@FreeBSD.ORG Thu Feb 12 16:40:51 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3EF03106566C; Thu, 12 Feb 2009 16:40:51 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1D75106564A for ; Thu, 12 Feb 2009 16:40:50 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E086D8FC08 for ; Thu, 12 Feb 2009 16:40:50 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CGeoZR068685 for ; Thu, 12 Feb 2009 16:40:50 GMT (envelope-from sson@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CGeo8r068683 for perforce@freebsd.org; Thu, 12 Feb 2009 16:40:50 GMT (envelope-from sson@FreeBSD.org) Date: Thu, 12 Feb 2009 16:40:50 GMT Message-Id: <200902121640.n1CGeo8r068683@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sson@FreeBSD.org using -f From: Stacey Son To: Perforce Change Reviews Cc: Subject: PERFORCE change 157598 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: Thu, 12 Feb 2009 16:40:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=157598 Change 157598 by sson@sson_amd64 on 2009/02/12 16:40:16 On Mac OS X use setaudit_addr() instead of setaudit(). Affected files ... .. //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#5 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#5 (text+ko) ==== @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#4 $ + * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#5 $ */ #include @@ -814,9 +814,31 @@ * ADE_NOERR on success, * ADE_SETAUDIT if setaudit(2) fails. */ +#ifdef __APPLE__ int auditd_prevent_audit(void) { + auditinfo_addr_t aia; + + /* + * To prevent event feedback cycles and avoid audit becoming stalled if + * auditing is suspended we mask this processes events from being + * audited. We allow the uid, tid, and mask fields to be implicitly + * set to zero, but do set the audit session ID to the PID. + * + * XXXRW: Is there more to it than this? + */ + bzero(&aia, sizeof(aia)); + aia.ai_asid = AU_ASSIGN_ASID; + aia.ai_termid.at_type = AU_IPv4; + if (setaudit_addr(&aia, sizeof(aia)) != 0) + return (ADE_SETAUDIT); + return (ADE_NOERR); +} +#else +int +auditd_prevent_audit(void) +{ auditinfo_t ai; /* @@ -833,6 +855,7 @@ return (ADE_SETAUDIT); return (ADE_NOERR); } +#endif /* __APPLE__ */ /* * Generate and submit audit record for audit startup or shutdown. The event From owner-p4-projects@FreeBSD.ORG Thu Feb 12 19:08:22 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E65F11065670; Thu, 12 Feb 2009 19:08:21 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A64A41065673 for ; Thu, 12 Feb 2009 19:08:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 9357F8FC13 for ; Thu, 12 Feb 2009 19:08:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CJ8LE8097080 for ; Thu, 12 Feb 2009 19:08:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CJ8L3x097078 for perforce@freebsd.org; Thu, 12 Feb 2009 19:08:21 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 12 Feb 2009 19:08:21 GMT Message-Id: <200902121908.n1CJ8L3x097078@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157604 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: Thu, 12 Feb 2009 19:08:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=157604 Change 157604 by hselasky@hselasky_laptop001 on 2009/02/12 19:07:28 net80211 IFC @ 157603 Affected files ... .. //depot/projects/usb/src/sys/net80211/ieee80211.c#15 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_adhoc.c#5 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_ioctl.c#17 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_node.c#16 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_proto.c#14 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_proto.h#10 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_tdma.c#3 integrate .. //depot/projects/usb/src/sys/net80211/ieee80211_var.h#15 integrate Differences ... ==== //depot/projects/usb/src/sys/net80211/ieee80211.c#15 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211.c,v 1.62 2009/02/03 22:32:26 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211.c,v 1.63 2009/02/12 18:57:18 thompsa Exp $"); /* * IEEE 802.11 generic handler @@ -289,9 +289,9 @@ struct ifnet *ifp = ic->ic_ifp; struct ieee80211vap *vap; - /* XXX ieee80211_stop_all? */ while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) ieee80211_vap_destroy(vap); + ieee80211_waitfor_parent(ic); ieee80211_sysctl_detach(ic); ieee80211_regdomain_detach(ic); ==== //depot/projects/usb/src/sys/net80211/ieee80211_adhoc.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ #include #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_adhoc.c,v 1.8 2009/01/08 17:12:47 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_adhoc.c,v 1.9 2009/02/10 23:51:18 sam Exp $"); #endif /* @@ -110,6 +110,15 @@ #endif } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * IEEE80211_M_IBSS+IEEE80211_M_AHDEMO vap state machine handler. */ @@ -146,8 +155,11 @@ break; case IEEE80211_S_SCAN: switch (ostate) { + case IEEE80211_S_RUN: /* beacon miss */ + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + /* fall thru... */ case IEEE80211_S_INIT: - case IEEE80211_S_RUN: /* beacon miss */ if (vap->iv_des_chan != IEEE80211_CHAN_ANYC && !IEEE80211_IS_CHAN_RADAR(vap->iv_des_chan)) { /* ==== //depot/projects/usb/src/sys/net80211/ieee80211_ioctl.c#17 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.76 2009/01/28 18:39:23 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_ioctl.c,v 1.77 2009/02/12 18:57:18 thompsa Exp $"); /* * IEEE 802.11 ioctl support (FreeBSD-specific) @@ -3265,7 +3265,7 @@ } IEEE80211_UNLOCK(ic); /* Wait for parent ioctl handler if it was queued */ - taskqueue_drain(taskqueue_thread, &ic->ic_parent_task); + ieee80211_waitfor_parent(ic); break; case SIOCADDMULTI: case SIOCDELMULTI: ==== //depot/projects/usb/src/sys/net80211/ieee80211_node.c#16 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.118 2009/01/29 23:11:18 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.119 2009/02/11 18:40:09 sam Exp $"); #include "opt_wlan.h" @@ -1719,8 +1719,8 @@ if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && nt->nt_keyixmap[keyix] == ni) { IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry\n", - __func__, ni, ether_sprintf(ni->ni_macaddr)); + "%s: %p<%s> clear key map entry %u\n", + __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); nt->nt_keyixmap[keyix] = NULL; ieee80211_node_decref(ni); /* NB: don't need free */ } @@ -1763,8 +1763,7 @@ */ _ieee80211_free_node(ni); nt = NULL; - } else if (ieee80211_node_refcnt(ni) == 1 && - nt->nt_keyixmap != NULL) { + } else if (ieee80211_node_refcnt(ni) == 1 && nt->nt_keyixmap != NULL) { ieee80211_keyix keyix; /* * Check for a last reference in the key mapping table. @@ -1774,8 +1773,8 @@ nt->nt_keyixmap[keyix] == ni) { IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry", __func__, - ni, ether_sprintf(ni->ni_macaddr)); + "%s: %p<%s> clear key map entry %u", __func__, + ni, ether_sprintf(ni->ni_macaddr), keyix); nt->nt_keyixmap[keyix] = NULL; ieee80211_node_decref(ni); /* XXX needed? */ _ieee80211_free_node(ni); ==== //depot/projects/usb/src/sys/net80211/ieee80211_proto.c#14 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_proto.c,v 1.51 2008/12/18 23:00:09 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_proto.c,v 1.52 2009/02/12 18:57:18 thompsa Exp $"); /* * IEEE 802.11 protocol support. @@ -1072,6 +1072,17 @@ } /* + * Block until the parent is in a known state. This is + * used after any operations that dispatch a task (e.g. + * to auto-configure the parent device up/down). + */ +void +ieee80211_waitfor_parent(struct ieee80211com *ic) +{ + taskqueue_drain(taskqueue_thread, &ic->ic_parent_task); +} + +/* * Start a vap running. If this is the first vap to be * set running on the underlying device then we * automatically bring the device up. @@ -1258,6 +1269,8 @@ ieee80211_stop_locked(vap); } IEEE80211_UNLOCK(ic); + + ieee80211_waitfor_parent(ic); } /* @@ -1278,6 +1291,8 @@ } } IEEE80211_UNLOCK(ic); + + ieee80211_waitfor_parent(ic); } /* ==== //depot/projects/usb/src/sys/net80211/ieee80211_proto.h#10 (text+ko) ==== @@ -23,7 +23,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/net80211/ieee80211_proto.h,v 1.34 2009/01/08 17:12:47 sam Exp $ + * $FreeBSD: src/sys/net80211/ieee80211_proto.h,v 1.35 2009/02/12 18:57:18 thompsa Exp $ */ #ifndef _NET80211_IEEE80211_PROTO_H_ #define _NET80211_IEEE80211_PROTO_H_ @@ -260,6 +260,7 @@ return tid; } +void ieee80211_waitfor_parent(struct ieee80211com *); void ieee80211_start_locked(struct ieee80211vap *); void ieee80211_init(void *); void ieee80211_start_all(struct ieee80211com *); ==== //depot/projects/usb/src/sys/net80211/ieee80211_tdma.c#3 (text+ko) ==== @@ -26,7 +26,7 @@ #include #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_tdma.c,v 1.2 2009/01/29 23:12:06 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_tdma.c,v 1.4 2009/02/11 17:30:36 sam Exp $"); #endif /* @@ -173,6 +173,15 @@ setackpolicy(vap->iv_ic, 0); /* enable ACK's */ } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * TDMA state machine handler. */ @@ -180,10 +189,11 @@ tdma_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211_tdma_state *ts = vap->iv_tdma; + struct ieee80211com *ic = vap->iv_ic; enum ieee80211_state ostate; int status; - IEEE80211_LOCK_ASSERT(vap->iv_ic); + IEEE80211_LOCK_ASSERT(ic); ostate = vap->iv_state; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", @@ -201,6 +211,10 @@ */ vap->iv_state = nstate; /* state transition */ ieee80211_cancel_scan(vap); /* background scan */ + if (ostate == IEEE80211_S_RUN) { + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + } if (vap->iv_flags_ext & IEEE80211_FEXT_SCANREQ) { ieee80211_check_scan(vap, vap->iv_scanreq_flags, @@ -326,7 +340,6 @@ * Count beacon frame for s/w bmiss handling. */ vap->iv_swbmiss_count++; - vap->iv_bmiss_count = 0; /* * Process tdma ie. The contents are used to sync * the slot timing, reconfigure the bss, etc. ==== //depot/projects/usb/src/sys/net80211/ieee80211_var.h#15 (text+ko) ==== @@ -23,7 +23,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/net80211/ieee80211_var.h,v 1.69 2009/01/27 23:19:36 sam Exp $ + * $FreeBSD: src/sys/net80211/ieee80211_var.h,v 1.71 2009/02/11 18:39:20 sam Exp $ */ #ifndef _NET80211_IEEE80211_VAR_H_ #define _NET80211_IEEE80211_VAR_H_ @@ -720,10 +720,10 @@ #define IEEE80211_MSG_ANY 0xffffffff /* anything */ #define IEEE80211_MSG_BITS \ - "\20\3IOCTL\4WDS\5ACTION\6RATECTL\7ROAM\10INACT\11DOTH\12SUPERG" \ - "\13WME\14ACL\15WPA\16RADKEYS\17RADDUMP\20RADIUS\21DOT1X\22POWER" \ - "\23STATE\24OUTPUT\25SCAN\26AUTH\27ASSOC\30NODE\31ELEMID\32XRATE" \ - "\33INPUT\34CRYPTO\35DUPMPKTS\36DEBUG\3711N" + "\20\2TDMA\3IOCTL\4WDS\5ACTION\6RATECTL\7ROAM\10INACT\11DOTH\12SUPERG" \ + "\13WME\14ACL\15WPA\16RADKEYS\17RADDUMP\20RADIUS\21DOT1XSM\22DOT1X" \ + "\23POWER\24STATE\25OUTPUT\26SCAN\27AUTH\30ASSOC\31NODE\32ELEMID" \ + "\33XRATE\34INPUT\35CRYPTO\36DUPMPKTS\37DEBUG\04011N" #ifdef IEEE80211_DEBUG #define ieee80211_msg(_vap, _m) ((_vap)->iv_debug & (_m)) From owner-p4-projects@FreeBSD.ORG Thu Feb 12 20:03:18 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7FC411065675; Thu, 12 Feb 2009 20:03:18 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3354C106566C for ; Thu, 12 Feb 2009 20:03:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 065948FC1B for ; Thu, 12 Feb 2009 20:03:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CK3HpK004649 for ; Thu, 12 Feb 2009 20:03:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CK3H3q004647 for perforce@freebsd.org; Thu, 12 Feb 2009 20:03:17 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 12 Feb 2009 20:03:17 GMT Message-Id: <200902122003.n1CK3H3q004647@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157608 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: Thu, 12 Feb 2009 20:03:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=157608 Change 157608 by hselasky@hselasky_laptop001 on 2009/02/12 20:02:21 USB CORE: Make usb2_transfer_pending() NULL safe. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#43 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#43 (text+ko) ==== @@ -1690,6 +1690,10 @@ struct usb2_xfer_root *info; struct usb2_xfer_queue *pq; + if (xfer == NULL) { + /* transfer is gone */ + return (0); + } USB_XFER_LOCK_ASSERT(xfer, MA_OWNED); if (xfer->flags_int.transferring) { From owner-p4-projects@FreeBSD.ORG Thu Feb 12 20:14:31 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 02D631065678; Thu, 12 Feb 2009 20:14:31 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4FD7106564A for ; Thu, 12 Feb 2009 20:14:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A28DA8FC12 for ; Thu, 12 Feb 2009 20:14:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CKEUpk006779 for ; Thu, 12 Feb 2009 20:14:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CKEUeC006777 for perforce@freebsd.org; Thu, 12 Feb 2009 20:14:30 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 12 Feb 2009 20:14:30 GMT Message-Id: <200902122014.n1CKEUeC006777@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157609 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: Thu, 12 Feb 2009 20:14:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=157609 Change 157609 by hselasky@hselasky_laptop001 on 2009/02/12 20:14:13 Make usb2_transfer_pending() part of the USB core header file. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_core.h#36 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.h#16 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_core.h#36 (text+ko) ==== @@ -449,6 +449,7 @@ void usb2_transfer_clear_stall(struct usb2_xfer *xfer); void usb2_transfer_drain(struct usb2_xfer *xfer); void usb2_transfer_set_stall(struct usb2_xfer *xfer); +uint8_t usb2_transfer_pending(struct usb2_xfer *xfer); void usb2_transfer_start(struct usb2_xfer *xfer); void usb2_transfer_stop(struct usb2_xfer *xfer); void usb2_transfer_unsetup(struct usb2_xfer **pxfer, uint16_t n_setup); ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.h#16 (text+ko) ==== @@ -102,7 +102,6 @@ /* function prototypes */ -uint8_t usb2_transfer_pending(struct usb2_xfer *xfer); uint8_t usb2_transfer_setup_sub_malloc(struct usb2_setup_params *parm, struct usb2_page_cache **ppc, uint32_t size, uint32_t align, uint32_t count); From owner-p4-projects@FreeBSD.ORG Thu Feb 12 21:10:28 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C6B8B1065672; Thu, 12 Feb 2009 21:10:27 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8682B106566C for ; Thu, 12 Feb 2009 21:10:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 731808FC19 for ; Thu, 12 Feb 2009 21:10:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CLAROi022992 for ; Thu, 12 Feb 2009 21:10:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CLARHT022990 for perforce@freebsd.org; Thu, 12 Feb 2009 21:10:27 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 12 Feb 2009 21:10:27 GMT Message-Id: <200902122110.n1CLARHT022990@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157611 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: Thu, 12 Feb 2009 21:10:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=157611 Change 157611 by hselasky@hselasky_laptop001 on 2009/02/12 21:10:08 USB WLAN: Put more seatbelts on the drivers like in the original USB2 version. - Remove cmd request structure from the stack in ZYD driver. - Make drivers wait for transmit to complete and then halt transmit during any pending command operations. Probably not all command operations, like reading the status counters needs this halt (TODO). Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#39 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#9 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#38 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#9 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#39 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#10 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#39 (text+ko) ==== @@ -116,6 +116,7 @@ static usb2_callback_t rum_bulk_read_callback; static usb2_callback_t rum_bulk_write_callback; +static usb2_proc_callback_t rum_command_wrapper; static usb2_proc_callback_t rum_attach_post; static usb2_proc_callback_t rum_task; static usb2_proc_callback_t rum_scantask; @@ -408,6 +409,8 @@ mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, MTX_DEF); + cv_init(&sc->sc_cmd_cv, "wtxdone"); + iface_index = RT2573_IFACE_INDEX; error = usb2_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, rum_config, RUM_N_TRANSFER, sc, &sc->sc_mtx); @@ -573,6 +576,8 @@ if_free(ifp); } + cv_destroy(&sc->sc_cmd_cv); + mtx_destroy(&sc->sc_mtx); return (0); @@ -839,6 +844,10 @@ struct mbuf *m; unsigned int len; + /* wakeup waiting command, if any */ + if (sc->sc_last_task != NULL) + cv_signal(&sc->sc_cmd_cv); + switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete, %d bytes\n", xfer->actlen); @@ -853,6 +862,10 @@ /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: + /* wait for command to complete, if any */ + if (sc->sc_last_task != NULL) + break; + data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -2166,7 +2179,8 @@ err = rum_write(sc, reg, UGETDW(ucode)); if (err) { /* firmware already loaded ? */ - device_printf(sc->sc_dev, "Firmware load failed.\n"); + device_printf(sc->sc_dev, "Firmware load " + "failure! (ignored)\n"); break; } } @@ -2466,6 +2480,30 @@ } static void +rum_command_wrapper(struct usb2_proc_msg *pm) +{ + struct rum_task *task = (struct rum_task *)pm; + struct rum_softc *sc = task->sc; + struct ifnet *ifp; + + /* wait for pending transfer, if any */ + while (usb2_transfer_pending(sc->sc_xfer[RUM_BULK_WR])) + cv_wait(&sc->sc_cmd_cv, &sc->sc_mtx); + + /* execute task */ + task->func(pm); + + /* check if this is the last task executed */ + if (sc->sc_last_task == task) { + sc->sc_last_task = NULL; + ifp = sc->sc_ifp; + /* re-start TX, if any */ + if ((ifp != NULL) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) + usb2_transfer_start(sc->sc_xfer[RUM_BULK_WR]); + } +} + +static void rum_queue_command(struct rum_softc *sc, usb2_proc_callback_t *fn, struct usb2_proc_msg *t0, struct usb2_proc_msg *t1) { @@ -2482,15 +2520,19 @@ usb2_proc_msignal(&sc->sc_tq, t0, t1); /* Setup callback and softc pointers */ - task->hdr.pm_callback = fn; + task->hdr.pm_callback = rum_command_wrapper; + task->func = fn; task->sc = sc; - /* - * Init, stop and flush must be synchronous! - */ - if ((fn == rum_init_task) || (fn == rum_stop_task) || + /* Make sure that any TX operation will stop */ + sc->sc_last_task = task; + + /* + * Init, stop and flush must be synchronous! + */ + if ((fn == rum_init_task) || (fn == rum_stop_task) || (fn == rum_flush_task)) - usb2_proc_mwait(&sc->sc_tq, t0, t1); + usb2_proc_mwait(&sc->sc_tq, t0, t1); } static device_method_t rum_methods[] = { ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rumvar.h#9 (text+ko) ==== @@ -55,6 +55,7 @@ struct rum_task { struct usb2_proc_msg hdr; + usb2_proc_callback_t *func; struct rum_softc *sc; }; @@ -101,6 +102,7 @@ const struct ieee80211_rate_table *sc_rates; struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; + struct rum_task *sc_last_task; uint8_t rf_rev; uint8_t rffreq; @@ -121,6 +123,7 @@ rum_txdhead tx_free; struct rum_rx_desc sc_rx_desc; + struct cv sc_cmd_cv; struct mtx sc_mtx; uint32_t sta[6]; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#38 (text+ko) ==== @@ -95,6 +95,7 @@ static usb2_callback_t ural_bulk_read_callback; static usb2_callback_t ural_bulk_write_callback; +static usb2_proc_callback_t ural_command_wrapper; static usb2_proc_callback_t ural_attach_post; static usb2_proc_callback_t ural_task; static usb2_proc_callback_t ural_scantask; @@ -411,6 +412,8 @@ mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, MTX_DEF); + cv_init(&sc->sc_cmd_cv, "wtxdone"); + iface_index = RAL_IFACE_INDEX; error = usb2_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, ural_config, @@ -564,6 +567,8 @@ if_free(ifp); } + cv_destroy(&sc->sc_cmd_cv); + mtx_destroy(&sc->sc_mtx); return (0); @@ -876,6 +881,10 @@ struct mbuf *m; unsigned int len; + /* wakeup waiting command, if any */ + if (sc->sc_last_task != NULL) + cv_signal(&sc->sc_cmd_cv); + switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete, %d bytes\n", xfer->actlen); @@ -890,6 +899,10 @@ /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: + /* wait for command to complete, if any */ + if (sc->sc_last_task != NULL) + break; + data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -2395,6 +2408,30 @@ } static void +ural_command_wrapper(struct usb2_proc_msg *pm) +{ + struct ural_task *task = (struct ural_task *)pm; + struct ural_softc *sc = task->sc; + struct ifnet *ifp; + + /* wait for pending transfer, if any */ + while (usb2_transfer_pending(sc->sc_xfer[URAL_BULK_WR])) + cv_wait(&sc->sc_cmd_cv, &sc->sc_mtx); + + /* execute task */ + task->func(pm); + + /* check if this is the last task executed */ + if (sc->sc_last_task == task) { + sc->sc_last_task = NULL; + ifp = sc->sc_ifp; + /* re-start TX, if any */ + if ((ifp != NULL) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) + usb2_transfer_start(sc->sc_xfer[URAL_BULK_WR]); + } +} + +static void ural_queue_command(struct ural_softc *sc, usb2_proc_callback_t *fn, struct usb2_proc_msg *t0, struct usb2_proc_msg *t1) { @@ -2411,9 +2448,13 @@ usb2_proc_msignal(&sc->sc_tq, t0, t1); /* Setup callback and softc pointers */ - task->hdr.pm_callback = fn; + task->hdr.pm_callback = ural_command_wrapper; + task->func = fn; task->sc = sc; + /* Make sure that any TX operation will stop */ + sc->sc_last_task = task; + /* * Init, stop and flush must be synchronous! */ ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_uralvar.h#9 (text+ko) ==== @@ -60,6 +60,7 @@ struct ural_task { struct usb2_proc_msg hdr; + usb2_proc_callback_t *func; struct ural_softc *sc; }; @@ -110,6 +111,7 @@ uint8_t rf_rev; struct usb2_xfer *sc_xfer[URAL_N_TRANSFER]; + struct ural_task *sc_last_task; enum ieee80211_state sc_state; int sc_arg; @@ -125,6 +127,7 @@ struct ural_rx_desc sc_rx_desc; struct mtx sc_mtx; + struct cv sc_cmd_cv; uint16_t sta[11]; uint32_t rf_regs[4]; ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#39 (text+ko) ==== @@ -325,7 +325,8 @@ mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK, MTX_DEF); - STAILQ_INIT(&sc->sc_rqh); + cv_init(&sc->sc_cmd_cv, "wtxdone"); + cv_init(&sc->sc_intr_cv, "zydcmd"); iface_index = ZYD_IFACE_INDEX; error = usb2_transfer_setup(uaa->device, @@ -469,6 +470,9 @@ if_free(ifp); } + cv_destroy(&sc->sc_cmd_cv); + cv_destroy(&sc->sc_intr_cv); + mtx_destroy(&sc->sc_mtx); return (0); @@ -744,11 +748,13 @@ datalen = xfer->actlen - sizeof(cmd->code); datalen -= 2; /* XXX: padding? */ - STAILQ_FOREACH(rqp, &sc->sc_rqh, rq) { + rqp = sc->sc_curr_rq; + if (rqp != NULL) { int i, cnt; if (rqp->olen != datalen) - continue; + break; + cnt = rqp->olen / sizeof(struct zyd_pair); for (i = 0; i < cnt; i++) { if (*(((const uint16_t *)rqp->idata) + i) != @@ -756,16 +762,15 @@ break; } if (i != cnt) - continue; + break; /* copy answer into caller-supplied buffer */ bcopy(cmd->data, rqp->odata, rqp->olen); DPRINTF(sc, ZYD_DEBUG_CMD, "command %p complete, data = %*D \n", rqp, rqp->olen, rqp->odata, ":"); - wakeup(rqp); /* wakeup caller */ - break; - } - if (rqp == NULL) { + /* wakeup caller */ + cv_signal(&sc->sc_intr_cv); + } else { device_printf(sc->sc_dev, "unexpected IORD notification %*D\n", datalen, cmd->data, ":"); @@ -805,25 +810,26 @@ switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - rqp = xfer->priv_fifo; + rqp = sc->sc_curr_rq; DPRINTF(sc, ZYD_DEBUG_CMD, "command %p transferred\n", rqp); - if ((rqp->flags & ZYD_CMD_FLAG_READ) == 0) - wakeup(rqp); /* wakeup caller */ + if (rqp != NULL) { + if ((rqp->flags & ZYD_CMD_FLAG_READ) == 0) + cv_signal(&sc->sc_intr_cv); /* wakeup caller */ + } /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - STAILQ_FOREACH(rqp, &sc->sc_rqh, rq) { + rqp = sc->sc_curr_rq; + if (rqp != NULL) { if (rqp->flags & ZYD_CMD_FLAG_SENT) - continue; + break; usb2_copy_in(xfer->frbuffers, 0, rqp->cmd, rqp->ilen); xfer->frlengths[0] = rqp->ilen; - xfer->priv_fifo = rqp; rqp->flags |= ZYD_CMD_FLAG_SENT; usb2_start_hardware(xfer); - break; } break; @@ -844,38 +850,42 @@ zyd_cmd(struct zyd_softc *sc, uint16_t code, const void *idata, int ilen, void *odata, int olen, unsigned int flags) { - struct zyd_cmd cmd; - struct zyd_rq rq; int error; - if (ilen > sizeof(cmd.data)) + if (ilen > sizeof(sc->sc_cmd.data)) return (EINVAL); if (usb2_proc_is_gone(&sc->sc_tq)) return (ENXIO); - cmd.code = htole16(code); - bcopy(idata, cmd.data, ilen); + sc->sc_cmd.code = htole16(code); + bcopy(idata, sc->sc_cmd.data, ilen); DPRINTF(sc, ZYD_DEBUG_CMD, "sending cmd %p = %*D\n", - &rq, ilen, idata, ":"); + &sc->sc_rq, ilen, idata, ":"); + + sc->sc_rq.cmd = &sc->sc_cmd; + sc->sc_rq.idata = idata; + sc->sc_rq.odata = odata; + sc->sc_rq.ilen = sizeof(uint16_t) + ilen; + sc->sc_rq.olen = olen; + sc->sc_rq.flags = flags; + + /* set our hint */ + sc->sc_curr_rq = &sc->sc_rq; - rq.cmd = &cmd; - rq.idata = idata; - rq.odata = odata; - rq.ilen = sizeof(uint16_t) + ilen; - rq.olen = olen; - rq.flags = flags; - STAILQ_INSERT_TAIL(&sc->sc_rqh, &rq, rq); usb2_transfer_start(sc->sc_xfer[ZYD_INTR_RD]); usb2_transfer_start(sc->sc_xfer[ZYD_INTR_WR]); /* wait at most one second for command reply */ - error = mtx_sleep(&rq, &sc->sc_mtx, 0 , "zydcmd", hz); + error = cv_timedwait(&sc->sc_intr_cv, &sc->sc_mtx, hz); if (error) device_printf(sc->sc_dev, "command timeout\n"); - STAILQ_REMOVE(&sc->sc_rqh, &rq, zyd_rq, rq); + + /* clear our hint */ + sc->sc_curr_rq = NULL; + DPRINTF(sc, ZYD_DEBUG_CMD, "finsihed cmd %p, error = %d \n", - &rq, error); + &sc->sc_rq, error); return (error); } @@ -2511,6 +2521,10 @@ struct zyd_tx_data *data; struct mbuf *m; + /* wakeup any waiting command, if any */ + if (sc->sc_last_task != NULL) + cv_signal(&sc->sc_cmd_cv); + switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTF(sc, ZYD_DEBUG_ANY, "transfer complete, %u bytes\n", @@ -2526,6 +2540,10 @@ /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: + /* wait for command to complete, if any */ + if (sc->sc_last_task != NULL) + break; + data = STAILQ_FIRST(&sc->tx_q); if (data) { STAILQ_REMOVE_HEAD(&sc->tx_q, next); @@ -3099,6 +3117,30 @@ } static void +zyd_command_wrapper(struct usb2_proc_msg *pm) +{ + struct zyd_task *task = (struct zyd_task *)pm; + struct zyd_softc *sc = task->sc; + struct ifnet *ifp; + + /* wait for pending transfer, if any */ + while (usb2_transfer_pending(sc->sc_xfer[ZYD_BULK_WR])) + cv_wait(&sc->sc_cmd_cv, &sc->sc_mtx); + + /* execute task */ + task->func(pm); + + /* check if this is the last task executed */ + if (sc->sc_last_task == task) { + sc->sc_last_task = NULL; + ifp = sc->sc_ifp; + /* re-start TX, if any */ + if ((ifp != NULL) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) + usb2_transfer_start(sc->sc_xfer[ZYD_BULK_WR]); + } +} + +static void zyd_queue_command(struct zyd_softc *sc, usb2_proc_callback_t *fn, struct usb2_proc_msg *t0, struct usb2_proc_msg *t1) { @@ -3115,15 +3157,19 @@ usb2_proc_msignal(&sc->sc_tq, t0, t1); /* Setup callback and softc pointers */ - task->hdr.pm_callback = fn; + task->hdr.pm_callback = zyd_command_wrapper; + task->func = fn; task->sc = sc; - /* - * Init and stop must be synchronous! - */ - if ((fn == zyd_init_task) || (fn == zyd_stop_task) || + /* Make sure that any TX operation will stop */ + sc->sc_last_task = task; + + /* + * Init and stop must be synchronous! + */ + if ((fn == zyd_init_task) || (fn == zyd_stop_task) || (fn == zyd_flush_task)) - usb2_proc_mwait(&sc->sc_tq, t0, t1); + usb2_proc_mwait(&sc->sc_tq, t0, t1); } static device_method_t zyd_methods[] = { ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zydreg.h#10 (text+ko) ==== @@ -1165,6 +1165,7 @@ struct zyd_task { struct usb2_proc_msg hdr; + usb2_proc_callback_t *func; struct zyd_softc *sc; }; @@ -1267,6 +1268,8 @@ struct usb2_process sc_tq; struct usb2_xfer *sc_xfer[ZYD_N_TRANSFER]; + struct zyd_task *sc_last_task; + struct zyd_rq *sc_curr_rq; enum ieee80211_state sc_state; int sc_arg; @@ -1285,10 +1288,9 @@ struct zyd_task sc_task[2]; struct zyd_rf sc_rf; + struct zyd_cmd sc_cmd; + struct zyd_rq sc_rq; - STAILQ_HEAD(, zyd_rq) sc_rtx; - STAILQ_HEAD(, zyd_rq) sc_rqh; - uint8_t sc_bssid[IEEE80211_ADDR_LEN]; uint16_t sc_fwbase; uint8_t sc_regdomain; @@ -1315,6 +1317,7 @@ uint8_t sc_ofdm54_cal[14]; struct mtx sc_mtx; + struct cv sc_cmd_cv; struct cv sc_intr_cv; struct zyd_tx_data tx_data[ZYD_TX_LIST_CNT]; zyd_txdhead tx_q; From owner-p4-projects@FreeBSD.ORG Thu Feb 12 22:20:41 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 765DA1065678; Thu, 12 Feb 2009 22:20:40 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 352661065672 for ; Thu, 12 Feb 2009 22:20:40 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2213D8FC0A for ; Thu, 12 Feb 2009 22:20:40 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CMKcbp029441 for ; Thu, 12 Feb 2009 22:20:38 GMT (envelope-from sson@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CMKcaK029439 for perforce@freebsd.org; Thu, 12 Feb 2009 22:20:38 GMT (envelope-from sson@FreeBSD.org) Date: Thu, 12 Feb 2009 22:20:38 GMT Message-Id: <200902122220.n1CMKcaK029439@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sson@FreeBSD.org using -f From: Stacey Son To: Perforce Change Reviews Cc: Subject: PERFORCE change 157612 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: Thu, 12 Feb 2009 22:20:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=157612 Change 157612 by sson@sson_amd64 on 2009/02/12 22:19:43 Rewrite auditd_expire_trails() to use a TAILQ instead of an array since the assumption that you can stat a directory and look at the nlinks of the file count doesn't hold for all file systems. Also, if the time stamp encoded in the trail file name is valid use it instead of the mtime of the file. Affected files ... .. //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#6 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#5 $ + * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#6 $ */ #include @@ -93,9 +93,11 @@ static TAILQ_HEAD(, dir_ent) dir_q; struct audit_trail { - time_t at_mtime; + time_t at_time; char *at_path; off_t at_size; + + TAILQ_ENTRY(audit_trail) at_trls; }; static int auditd_minval = -1; @@ -309,19 +311,73 @@ } /* - * Comparison function for audit trail sorting. Compare modification times - * of trail files. + * Convert a trailname into a timestamp (seconds). Return 0 if the conversion + * was successful. */ static int -trails_cmp(const void *t1, const void *t2) +trailname_to_tstamp(char *fn, time_t *tstamp) { - struct audit_trail *a = (struct audit_trail *)t1; - struct audit_trail *b = (struct audit_trail *)t2; + struct tm tm; + char ts[TIMESTAMP_LEN]; + char *p; + + *tstamp = 0; + + /* + * Get the ending time stamp. + */ + if ((p = strchr(fn, '.')) == NULL) + return (1); + strlcpy(ts, ++p, TIMESTAMP_LEN); + if (strlen(ts) != POSTFIX_LEN) + return (1); + + bzero(&tm, sizeof(tm)); + + /* seconds (0-60) */ + p = ts + POSTFIX_LEN - 2; + printf("sec = [%s]\n", p); + tm.tm_sec = atol(p); + if (tm.tm_sec < 0 || tm.tm_sec > 60) + return (1); + + /* minutes (0-59) */ + *p = '\0'; p -= 2; + printf("min = [%s]\n", p); + tm.tm_min = atol(p); + if (tm.tm_min < 0 || tm.tm_min > 59) + return (1); + + /* hours (0 - 23) */ + *p = '\0'; p -= 2; + printf("hr = [%s]\n", p); + tm.tm_hour = atol(p); + if (tm.tm_hour < 0 || tm.tm_hour > 23) + return (1); + + /* day of month (1-31) */ + *p = '\0'; p -= 2; + printf("dom = [%s]\n", p); + tm.tm_mday = atol(p); + if (tm.tm_mday < 1 || tm.tm_mday > 31) + return (1); + + /* month (0 - 11) */ + *p = '\0'; p -= 2; + printf("mon = [%s]\n", p); + tm.tm_mon = atol(p) - 1; + if (tm.tm_mon < 0 || tm.tm_mon > 11) + return (1); - if (a->at_mtime < b->at_mtime) - return (-1); - if (a->at_mtime > b->at_mtime) + /* year (year - 1900) */ + *p = '\0'; p -= 4; + printf("yr = [%s]\n", p); + tm.tm_year = atol(p) - 1900; + if (tm.tm_year < 0) return (1); + + *tstamp = timegm(&tm); + return (0); } @@ -335,12 +391,14 @@ int auditd_expire_trails(int (*warn_expired)(char *)) { - int andflg, i, n = 0, num_trails = 0, ret = ADE_NOERR; + int andflg, ret = ADE_NOERR; size_t expire_size, total_size = 0L; time_t expire_age, oldest_time, current_time = time(NULL); struct dir_ent *traildir; - struct audit_trail *trail; + struct audit_trail *at; char *afnp, *pn; + TAILQ_HEAD(au_trls_head, audit_trail) head = + TAILQ_HEAD_INITIALIZER(head); struct stat stbuf; char activefn[MAXPATHLEN]; @@ -361,23 +419,9 @@ if ((afnp = strrchr(activefn, '/')) != NULL) afnp++; - /* - * Count up the number of audit trail files we have in all the audit - * trail directories. - */ - num_trails = 0; - TAILQ_FOREACH(traildir, &dir_q, dirs) { - if (stat(traildir->dirname, &stbuf) == 0) - num_trails += (stbuf.st_nlink - 2); - } - - trail = (struct audit_trail *)malloc(sizeof(struct audit_trail) * - num_trails); - if (NULL == trail) - return (ADE_NOMEM); /* - * Build an array of the trail files. + * Build tail queue of the trail files. */ TAILQ_FOREACH(traildir, &dir_q, dirs) { DIR *dirp; @@ -385,51 +429,64 @@ dirp = opendir(traildir->dirname); while ((dp = readdir(dirp)) != NULL) { + time_t tstamp = 0; + struct audit_trail *new; /* - * Filter non-trail files. + * Quickly filter non-trail files. */ - if (dp->d_type != DT_REG || - dp->d_namlen != (FILENAME_LEN - 1) || + if (dp->d_namlen != (FILENAME_LEN - 1) || +#ifdef DT_REG + dp->d_type != DT_REG || +#endif dp->d_name[POSTFIX_LEN] != '.') continue; - - if (n > num_trails) { - /* - * This shouldn't happen but, if it does, we - * break out of the loop and expire what trail - * files we have. Also, return there was an - * error. - */ - ret = ADE_EXPIRE; - break; - } - if (asprintf(&pn, "%s/%s", traildir->dirname, dp->d_name) < 0) { ret = ADE_NOMEM; break; } - if (stat(pn, &stbuf) < 0) { + if (stat(pn, &stbuf) < 0 || !S_ISREG(stbuf.st_mode)) { + free(pn); + continue; + } + + total_size += stbuf.st_size; + + /* + * If this is the 'current' audit trail then + * don't add it to the tail queue. + */ + if (NULL != afnp && + strncmp(dp->d_name, afnp, FILENAME_LEN) == 0) { free(pn); continue; } /* - * If the mtime is older than Jan 1, 2000 then update - * the mtime of the trail file to the current time. - * This is so we don't prematurely remove a trail file - * that was created while the system clock reset to the - * "beginning of time" but later the system clock is set - * to the correct current time. + * Get the ending time stamp encoded in the trail + * name. If we can't read it or if it is older + * than Jan 1, 2000 then use the mtime. + */ + if (trailname_to_tstamp(dp->d_name, &tstamp) != 0 || + tstamp < JAN_01_2000) + tstamp = stbuf.st_mtime; + + /* + * If the time stamp is older than Jan 1, 2000 then + * update the mtime of the trail file to the current + * time. This is so we don't prematurely remove a trail + * file that was created while the system clock reset + * to the * "beginning of time" but later the system + * clock is set to the correct current time. */ if (current_time >= JAN_01_2000 && - stbuf.st_mtime < JAN_01_2000) { + tstamp < JAN_01_2000) { struct timeval tv[2]; - stbuf.st_mtime = current_time; + tstamp = stbuf.st_mtime = current_time; TIMESPEC_TO_TIMEVAL(&tv[0], &stbuf.st_atimespec); TIMESPEC_TO_TIMEVAL(&tv[1], @@ -437,54 +494,74 @@ utimes(pn, tv); } - total_size += stbuf.st_size; - if (NULL != afnp && - strncmp(dp->d_name, afnp, FILENAME_LEN) == 0) { + /* + * Allocate and populate the new entry. + */ + new = malloc(sizeof(*new)); + if (NULL == new) { free(pn); + ret = ADE_NOMEM; + break; + } + new->at_time = tstamp; + new->at_size = stbuf.st_size; + new->at_path = pn; + + /* + * Check to see if we have a new head. Otherwise, + * walk the tailq from the tail first and do a simple + * insertion sort. + */ + if (TAILQ_EMPTY(&head) || + (new->at_time <= TAILQ_FIRST(&head)->at_time)) { + TAILQ_INSERT_HEAD(&head, new, at_trls); continue; } - trail[n].at_mtime = stbuf.st_mtime; - trail[n].at_size = stbuf.st_size; - trail[n].at_path = pn; - n++; + TAILQ_FOREACH_REVERSE(at, &head, au_trls_head, at_trls) + if (new->at_time >= at->at_time) { + TAILQ_INSERT_AFTER(&head, at, new, + at_trls); + break; + } + } } - /* - * Sort the array of trail files by the modification date. - */ - qsort(trail, n, sizeof(struct audit_trail), trails_cmp); - oldest_time = current_time - expire_age; /* * Expire trail files, oldest (mtime) first, if the given * conditions are met. */ - for (i = 0; i < n; i++) { + at = TAILQ_FIRST(&head); + while (NULL != at) { + struct audit_trail *at_next = TAILQ_NEXT(at, at_trls); + if (andflg) { if ((expire_size && total_size > expire_size) && - (expire_age && trail[i].at_mtime < oldest_time)) { + (expire_age && at->at_time < oldest_time)) { if (warn_expired) - (*warn_expired)(trail[i].at_path); - if (unlink(trail[i].at_path) < 0) + (*warn_expired)(at->at_path); + if (unlink(at->at_path) < 0) ret = ADE_EXPIRE; - total_size -= trail[i].at_size; + total_size -= at->at_size; } } else { if ((expire_size && total_size > expire_size) || - (expire_age && trail[i].at_mtime < oldest_time)) { + (expire_age && at->at_time < oldest_time)) { if (warn_expired) - (*warn_expired)(trail[i].at_path); - if (unlink(trail[i].at_path) < 0) + (*warn_expired)(at->at_path); + if (unlink(at->at_path) < 0) ret = ADE_EXPIRE; - total_size -= trail[i].at_size; + total_size -= at->at_size; } } - free(trail[i].at_path); + + free(at->at_path); + free(at); + at = at_next; } - free(trail); return (ret); } From owner-p4-projects@FreeBSD.ORG Thu Feb 12 22:52:11 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2E6E010656D5; Thu, 12 Feb 2009 22:52:11 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DABBA10656D0 for ; Thu, 12 Feb 2009 22:52:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C88AF8FC12 for ; Thu, 12 Feb 2009 22:52:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CMqAMu031889 for ; Thu, 12 Feb 2009 22:52:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CMqAXN031887 for perforce@freebsd.org; Thu, 12 Feb 2009 22:52:10 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 12 Feb 2009 22:52:10 GMT Message-Id: <200902122252.n1CMqAXN031887@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157613 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: Thu, 12 Feb 2009 22:52:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=157613 Change 157613 by hselasky@hselasky_laptop001 on 2009/02/12 22:52:05 USB WLAN: Add slight delay to resolve possible race inside the dongle firmware. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#40 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#39 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#40 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#40 (text+ko) ==== @@ -2490,6 +2490,9 @@ while (usb2_transfer_pending(sc->sc_xfer[RUM_BULK_WR])) cv_wait(&sc->sc_cmd_cv, &sc->sc_mtx); + /* make sure any hardware buffers are emptied */ + rum_pause(sc, hz / 1000); + /* execute task */ task->func(pm); ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#39 (text+ko) ==== @@ -2418,6 +2418,9 @@ while (usb2_transfer_pending(sc->sc_xfer[URAL_BULK_WR])) cv_wait(&sc->sc_cmd_cv, &sc->sc_mtx); + /* make sure any hardware FIFOs are emptied */ + ural_pause(sc, hz / 1000); + /* execute task */ task->func(pm); ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#40 (text+ko) ==== @@ -3127,6 +3127,9 @@ while (usb2_transfer_pending(sc->sc_xfer[ZYD_BULK_WR])) cv_wait(&sc->sc_cmd_cv, &sc->sc_mtx); + /* make sure any hardware FIFOs are emptied */ + usb2_pause_mtx(&sc->sc_mtx, hz / 1000); + /* execute task */ task->func(pm); From owner-p4-projects@FreeBSD.ORG Thu Feb 12 23:34:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ABD371065674; Thu, 12 Feb 2009 23:34:55 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A618106566B for ; Thu, 12 Feb 2009 23:34:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 57AEB8FC0A for ; Thu, 12 Feb 2009 23:34:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1CNYtxh036919 for ; Thu, 12 Feb 2009 23:34:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1CNYthM036917 for perforce@freebsd.org; Thu, 12 Feb 2009 23:34:55 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 12 Feb 2009 23:34:55 GMT Message-Id: <200902122334.n1CNYthM036917@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157618 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: Thu, 12 Feb 2009 23:34:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=157618 Change 157618 by hselasky@hselasky_laptop001 on 2009/02/12 23:34:24 USB WLAN: Re-introduce fix for failing control transfers after firmware load. Repeat the transfer until a) detach or b) success. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#41 edit .. //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#40 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_rum2.c#41 (text+ko) ==== @@ -588,14 +588,15 @@ struct usb2_device_request *req, void *data) { usb2_error_t err; - +retry: err = usb2_do_request_proc(sc->sc_udev, &sc->sc_tq, - req, data, 0, NULL, 1000 /* ms */); + req, data, 0, NULL, 250 /* ms */); if (err) { DPRINTFN(1, "Control request failed, " "%s! (ignored)\n", usb2_errstr(err)); - rum_pause(sc, hz / 100); + if ((sc->sc_ifp != NULL) && (!rum_pause(sc, hz / 100))) + goto retry; } return (err); } ==== //depot/projects/usb/src/sys/dev/usb2/wlan/if_ural2.c#40 (text+ko) ==== @@ -579,13 +579,15 @@ struct usb2_device_request *req, void *data) { usb2_error_t err; - +retry: err = usb2_do_request_proc(sc->sc_udev, &sc->sc_tq, - req, data, 0, NULL, 1000 /* ms */); + req, data, 0, NULL, 250 /* ms */); if (err) { - DPRINTFN(1, "Control request failed! (ignored)\n"); - ural_pause(sc, hz / 100); + DPRINTFN(1, "Control request failed, " + "%s! (ignored)\n", usb2_errstr(err)); + if ((sc->sc_ifp != NULL) && (!ural_pause(sc, hz / 100))) + goto retry; } } From owner-p4-projects@FreeBSD.ORG Fri Feb 13 04:37:08 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DBA1510656CA; Fri, 13 Feb 2009 04:37:07 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89CE210656E8 for ; Fri, 13 Feb 2009 04:37:07 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 770B88FC1F for ; Fri, 13 Feb 2009 04:37:07 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1D4b7RQ090140 for ; Fri, 13 Feb 2009 04:37:07 GMT (envelope-from sson@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1D4b7Cc090138 for perforce@freebsd.org; Fri, 13 Feb 2009 04:37:07 GMT (envelope-from sson@FreeBSD.org) Date: Fri, 13 Feb 2009 04:37:07 GMT Message-Id: <200902130437.n1D4b7Cc090138@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sson@FreeBSD.org using -f From: Stacey Son To: Perforce Change Reviews Cc: Subject: PERFORCE change 157629 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, 13 Feb 2009 04:37:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=157629 Change 157629 by sson@sson_amd64 on 2009/02/13 04:36:20 Removal of debugging code. Affected files ... .. //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#7 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#6 $ + * $P4: //depot/projects/trustedbsd/openbsm/libauditd/auditd_lib.c#7 $ */ #include @@ -336,42 +336,36 @@ /* seconds (0-60) */ p = ts + POSTFIX_LEN - 2; - printf("sec = [%s]\n", p); tm.tm_sec = atol(p); if (tm.tm_sec < 0 || tm.tm_sec > 60) return (1); /* minutes (0-59) */ *p = '\0'; p -= 2; - printf("min = [%s]\n", p); tm.tm_min = atol(p); if (tm.tm_min < 0 || tm.tm_min > 59) return (1); /* hours (0 - 23) */ *p = '\0'; p -= 2; - printf("hr = [%s]\n", p); tm.tm_hour = atol(p); if (tm.tm_hour < 0 || tm.tm_hour > 23) return (1); /* day of month (1-31) */ *p = '\0'; p -= 2; - printf("dom = [%s]\n", p); tm.tm_mday = atol(p); if (tm.tm_mday < 1 || tm.tm_mday > 31) return (1); /* month (0 - 11) */ *p = '\0'; p -= 2; - printf("mon = [%s]\n", p); tm.tm_mon = atol(p) - 1; if (tm.tm_mon < 0 || tm.tm_mon > 11) return (1); /* year (year - 1900) */ *p = '\0'; p -= 4; - printf("yr = [%s]\n", p); tm.tm_year = atol(p) - 1900; if (tm.tm_year < 0) return (1); From owner-p4-projects@FreeBSD.ORG Fri Feb 13 18:23:16 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 30E991065677; Fri, 13 Feb 2009 18:23:16 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D64981065670 for ; Fri, 13 Feb 2009 18:23:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C2BB68FC08 for ; Fri, 13 Feb 2009 18:23:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DINFJ1053402 for ; Fri, 13 Feb 2009 18:23:15 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1DINFsb053400 for perforce@freebsd.org; Fri, 13 Feb 2009 18:23:15 GMT (envelope-from jhb@freebsd.org) Date: Fri, 13 Feb 2009 18:23:15 GMT Message-Id: <200902131823.n1DINFsb053400@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 157668 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, 13 Feb 2009 18:23:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=157668 Change 157668 by jhb@jhb_jhbbsd on 2009/02/13 18:22:54 IFC @157667 Affected files ... .. //depot/projects/smpng/sys/arm/arm/genassym.c#12 integrate .. //depot/projects/smpng/sys/arm/arm/machdep.c#26 integrate .. //depot/projects/smpng/sys/arm/arm/swtch.S#19 integrate .. //depot/projects/smpng/sys/arm/include/proc.h#6 integrate .. //depot/projects/smpng/sys/arm/include/sysarch.h#5 integrate .. //depot/projects/smpng/sys/arm/xscale/ixp425/avila_machdep.c#11 integrate .. //depot/projects/smpng/sys/cam/cam_xpt.c#54 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_cd.c#37 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_da.c#85 integrate .. //depot/projects/smpng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#7 integrate .. //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#73 integrate .. //depot/projects/smpng/sys/compat/linux/linux_file.c#42 integrate .. //depot/projects/smpng/sys/compat/linux/linux_getcwd.c#28 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#64 integrate .. //depot/projects/smpng/sys/dev/ath/ath_hal/ah_internal.h#4 integrate .. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c#3 integrate .. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c#4 integrate .. //depot/projects/smpng/sys/dev/ath/if_ath.c#67 integrate .. //depot/projects/smpng/sys/dev/ath/if_athioctl.h#19 integrate .. //depot/projects/smpng/sys/dev/cm/smc90cx6.c#16 integrate .. //depot/projects/smpng/sys/dev/firewire/firewire.h#17 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohci.c#42 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohcireg.h#20 integrate .. //depot/projects/smpng/sys/dev/firewire/fwphyreg.h#4 integrate .. //depot/projects/smpng/sys/dev/iwn/if_iwn.c#3 integrate .. //depot/projects/smpng/sys/dev/mxge/if_mxge.c#25 integrate .. //depot/projects/smpng/sys/dev/puc/pucdata.c#47 integrate .. //depot/projects/smpng/sys/dev/sis/if_sis.c#4 integrate .. //depot/projects/smpng/sys/dev/sound/pci/hda/hdac.c#26 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/if_axe2.c#6 integrate .. //depot/projects/smpng/sys/dev/usb2/ethernet/usb2_ethernet.c#4 integrate .. //depot/projects/smpng/sys/dev/wpi/if_wpi.c#7 integrate .. //depot/projects/smpng/sys/fs/cd9660/cd9660_vfsops.c#10 integrate .. //depot/projects/smpng/sys/fs/coda/coda_vnops.c#7 integrate .. //depot/projects/smpng/sys/fs/udf/udf_vfsops.c#44 integrate .. //depot/projects/smpng/sys/geom/label/g_label_msdosfs.c#6 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_misc.c#35 integrate .. //depot/projects/smpng/sys/kern/kern_descrip.c#121 integrate .. //depot/projects/smpng/sys/kern/subr_disk.c#31 integrate .. //depot/projects/smpng/sys/kern/subr_taskqueue.c#38 integrate .. //depot/projects/smpng/sys/kern/tty.c#86 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#142 integrate .. //depot/projects/smpng/sys/mips/mips/busdma_machdep.c#4 integrate .. //depot/projects/smpng/sys/mips/mips/pmap.c#7 integrate .. //depot/projects/smpng/sys/modules/Makefile#154 integrate .. //depot/projects/smpng/sys/modules/acpi/acpi/Makefile#16 integrate .. //depot/projects/smpng/sys/modules/agp/Makefile#15 integrate .. //depot/projects/smpng/sys/modules/dtrace/dtrace/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/linux/Makefile#22 integrate .. //depot/projects/smpng/sys/modules/svr4/Makefile#9 integrate .. //depot/projects/smpng/sys/net/if_vlan.c#63 integrate .. //depot/projects/smpng/sys/net80211/ieee80211.c#35 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_ddb.c#11 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_freebsd.h#15 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_ioctl.c#42 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_node.c#40 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_proto.c#29 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_proto.h#20 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_tdma.c#4 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_var.h#34 integrate .. //depot/projects/smpng/sys/netinet/in_systm.h#5 integrate .. //depot/projects/smpng/sys/netinet/ip.h#16 integrate .. //depot/projects/smpng/sys/netinet/ip_dummynet.c#52 integrate .. //depot/projects/smpng/sys/netinet/ip_fw2.c#102 integrate .. //depot/projects/smpng/sys/netinet/ip_icmp.c#47 integrate .. //depot/projects/smpng/sys/netinet/ip_icmp.h#11 integrate .. //depot/projects/smpng/sys/netinet/ip_options.c#11 integrate .. //depot/projects/smpng/sys/netinet/sctp_sysctl.c#11 integrate .. //depot/projects/smpng/sys/netinet/sctp_uio.h#18 integrate .. //depot/projects/smpng/sys/netinet/tcp_debug.h#7 integrate .. //depot/projects/smpng/sys/netinet/tcp_subr.c#107 integrate .. //depot/projects/smpng/sys/nfsserver/nfs_serv.c#64 integrate .. //depot/projects/smpng/sys/sys/tty.h#29 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_vfsops.c#109 integrate Differences ... ==== //depot/projects/smpng/sys/arm/arm/genassym.c#12 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/genassym.c,v 1.12 2008/10/13 18:59:59 raj Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/genassym.c,v 1.13 2009/02/12 23:23:30 cognet Exp $"); #include #include #include @@ -96,6 +96,8 @@ ASSYM(TD_MD, offsetof(struct thread, td_md)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(MD_TP, offsetof(struct mdthread, md_tp)); +ASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start)); +ASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end)); ASSYM(TF_R0, offsetof(struct trapframe, tf_r0)); ASSYM(TF_R1, offsetof(struct trapframe, tf_r1)); ==== //depot/projects/smpng/sys/arm/arm/machdep.c#26 (text+ko) ==== @@ -46,7 +46,7 @@ #include "opt_ddb.h" #include -__FBSDID("$FreeBSD: src/sys/arm/arm/machdep.c,v 1.31 2008/04/25 05:18:48 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/machdep.c,v 1.32 2009/02/12 22:55:39 cognet Exp $"); #include #include @@ -304,7 +304,6 @@ USPACE_SVC_STACK_TOP; vector_page_setprot(VM_PROT_READ); pmap_set_pcb_pagedir(pmap_kernel(), pcb); - thread0.td_frame = (struct trapframe *)pcb->un_32.pcb32_sp - 1; pmap_postinit(); #ifdef ARM_CACHE_LOCK_ENABLE pmap_kenter_user(ARM_TP_ADDRESS, ARM_TP_ADDRESS); ==== //depot/projects/smpng/sys/arm/arm/swtch.S#19 (text+ko) ==== @@ -83,7 +83,7 @@ #include #include #include -__FBSDID("$FreeBSD: src/sys/arm/arm/swtch.S,v 1.25 2008/10/16 19:06:24 raj Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/swtch.S,v 1.27 2009/02/13 16:00:19 cognet Exp $"); /* @@ -205,8 +205,12 @@ /* Set the new tp */ ldr r6, [r5, #(TD_MD + MD_TP)] - ldr r5, =ARM_TP_ADDRESS - strt r6, [r5] + ldr r4, =ARM_TP_ADDRESS + str r6, [r4] + ldr r6, [r5, #(TD_MD + MD_RAS_START)] + str r6, [r4, #4] /* ARM_RAS_START */ + ldr r6, [r5, #(TD_MD + MD_RAS_END)] + str r6, [r4, #8] /* ARM_RAS_END */ /* Hook in a new pcb */ ldr r6, .Lcurpcb @@ -265,12 +269,20 @@ */ /* Store the old tp */ ldr r3, =ARM_TP_ADDRESS - ldrt r9, [r3] + ldr r9, [r3] str r9, [r0, #(TD_MD + MD_TP)] + ldr r9, [r3, #4] + str r9, [r0, #(TD_MD + MD_RAS_START)] + ldr r9, [r3, #8] + str r9, [r0, #(TD_MD + MD_RAS_END)] /* Set the new tp */ ldr r9, [r1, #(TD_MD + MD_TP)] - strt r9, [r3] + str r9, [r3] + ldr r9, [r1, #(TD_MD + MD_RAS_START)] + str r9, [r3, #4] + ldr r9, [r1, #(TD_MD + MD_RAS_END)] + str r9, [r3, #8] /* Get the user structure for the new process in r9 */ ldr r9, [r1, #(TD_PCB)] ==== //depot/projects/smpng/sys/arm/include/proc.h#6 (text+ko) ==== @@ -32,7 +32,7 @@ * * from: @(#)proc.h 7.1 (Berkeley) 5/15/91 * from: FreeBSD: src/sys/i386/include/proc.h,v 1.11 2001/06/29 - * $FreeBSD: src/sys/arm/include/proc.h,v 1.5 2005/04/04 21:53:52 jhb Exp $ + * $FreeBSD: src/sys/arm/include/proc.h,v 1.6 2009/02/12 23:23:30 cognet Exp $ */ #ifndef _MACHINE_PROC_H_ @@ -51,6 +51,8 @@ int md_ptrace_instr; int md_ptrace_addr; void *md_tp; + void *md_ras_start; + void *md_ras_end; }; struct mdproc { ==== //depot/projects/smpng/sys/arm/include/sysarch.h#5 (text+ko) ==== @@ -32,7 +32,7 @@ * SUCH DAMAGE. */ -/* $FreeBSD: src/sys/arm/include/sysarch.h,v 1.5 2008/02/05 10:22:33 raj Exp $ */ +/* $FreeBSD: src/sys/arm/include/sysarch.h,v 1.6 2009/02/12 23:23:30 cognet Exp $ */ #ifndef _ARM_SYSARCH_H_ #define _ARM_SYSARCH_H_ @@ -42,6 +42,9 @@ * The ARM_TP_ADDRESS points to a special purpose page, which is used as local * store for the ARM per-thread data and Restartable Atomic Sequences support. * Put it just above the "high" vectors' page. + * the cpu_switch() code assumes ARM_RAS_START is ARM_TP_ADDRESS + 4, and + * ARM_RAS_END is ARM_TP_ADDRESS + 8, so if that ever changes, be sure to + * update the cpu_switch() (and cpu_throw()) code as well. */ #define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000) #define ARM_RAS_START (ARM_TP_ADDRESS + 4) ==== //depot/projects/smpng/sys/arm/xscale/ixp425/avila_machdep.c#11 (text+ko) ==== @@ -48,7 +48,7 @@ #include "opt_msgbuf.h" #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.15 2009/02/03 19:16:04 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.16 2009/02/11 22:34:50 sam Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -334,17 +334,20 @@ alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC -#error "I am broken" /* XXX save people grief */ freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0x10100000) / + freemem_after = freemempos - ((freemem_pt - (PHYSADDR + 0x100000)) / PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR) - , (void *)0xc0100000, freemem_pt - 0x10100000, 1); - freemem_after -= ((freemem_after - 0x10001000) / PAGE_SIZE) * + arm_add_smallalloc_pages( + (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), + (void *)0xc0100000, + freemem_pt - (PHYSADDR + 0x100000), 1); + freemem_after -= ((freemem_after - (PHYSADDR + 0x1000)) / PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + (KEYVIRTADDR - KERNPHYSADDR)) - , (void *)0xc0001000, trunc_page(freemem_after) - 0x10001000, 0); + arm_add_smallalloc_pages( + (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), + (void *)0xc0001000, + trunc_page(freemem_after) - (PHYSADDR + 0x1000), 0); freemempos = trunc_page(freemem_after); freemempos -= PAGE_SIZE; #endif ==== //depot/projects/smpng/sys/cam/cam_xpt.c#54 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.209 2009/02/08 22:08:48 trasz Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.210 2009/02/13 10:04:59 scottl Exp $"); #include #include @@ -6143,10 +6143,9 @@ xpt_schedule(periph, priority); return; } - xpt_release_ccb(done_ccb); - softc->action = PROBE_TUR_FOR_NEGOTIATION; - xpt_schedule(periph, priority); - return; + + csio->data_ptr = NULL; + /* FALLTHROUGH */ } case PROBE_SERIAL_NUM_1: ==== //depot/projects/smpng/sys/cam/scsi/scsi_cd.c#37 (text+ko) ==== @@ -46,7 +46,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.105 2009/02/10 22:39:44 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.106 2009/02/11 22:29:09 jhb Exp $"); #include "opt_cd.h" @@ -401,11 +401,6 @@ xpt_print(periph->path, "removing device entry\n"); - if ((softc->flags & CD_FLAG_SCTX_INIT) != 0 - && sysctl_ctx_free(&softc->sysctl_ctx) != 0) { - xpt_print(periph->path, "can't remove sysctl context\n"); - } - /* * In the queued, non-active case, the device in question * has already been removed from the changer run queue. Since this @@ -474,9 +469,14 @@ free(softc->changer, M_DEVBUF); } cam_periph_unlock(periph); + if ((softc->flags & CD_FLAG_SCTX_INIT) != 0 + && sysctl_ctx_free(&softc->sysctl_ctx) != 0) { + xpt_print(periph->path, "can't remove sysctl context\n"); + } + disk_destroy(softc->disk); + free(softc, M_DEVBUF); cam_periph_lock(periph); - free(softc, M_DEVBUF); } static void ==== //depot/projects/smpng/sys/cam/scsi/scsi_da.c#85 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.234 2009/02/10 22:39:44 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.235 2009/02/11 22:29:09 jhb Exp $"); #include @@ -995,6 +995,8 @@ softc = (struct da_softc *)periph->softc; xpt_print(periph->path, "removing device entry\n"); + cam_periph_unlock(periph); + /* * If we can't free the sysctl tree, oh well... */ @@ -1003,11 +1005,10 @@ xpt_print(periph->path, "can't remove sysctl context\n"); } - cam_periph_unlock(periph); disk_destroy(softc->disk); callout_drain(&softc->sendordered_c); + free(softc, M_DEVBUF); cam_periph_lock(periph); - free(softc, M_DEVBUF); } static void ==== //depot/projects/smpng/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#7 (text+ko) ==== @@ -4697,8 +4697,8 @@ return (error); } - NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | MPSAFE, UIO_SYSSPACE, - ".", xvp, td); + NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | LOCKSHARED | MPSAFE, + UIO_SYSSPACE, ".", xvp, td); error = namei(&nd); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); ==== //depot/projects/smpng/sys/compat/linprocfs/linprocfs.c#73 (text+ko) ==== @@ -42,7 +42,7 @@ #include "opt_compat.h" #include -__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.134 2009/01/22 17:06:33 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.135 2009/02/13 15:32:03 jhb Exp $"); #include #include @@ -327,7 +327,7 @@ error = namei(&nd); lep = linux_emul_path; if (error == 0) { - if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) != 0) + if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0) lep = dlep; vrele(nd.ni_vp); VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); ==== //depot/projects/smpng/sys/compat/linux/linux_file.c#42 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.115 2008/09/09 16:00:17 rdivacky Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.117 2009/02/13 18:18:14 jhb Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -345,7 +345,7 @@ /* readdir(2) case. Always struct dirent. */ if (is64bit) return (EINVAL); - nbytes = sizeof(linux_dirent); + nbytes = sizeof(*linux_dirent); justone = 1; } else justone = 0; @@ -372,7 +372,7 @@ buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); lbuf = malloc(LINUX_MAXRECLEN, M_TEMP, M_WAITOK | M_ZERO); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; ==== //depot/projects/smpng/sys/compat/linux/linux_getcwd.c#28 (text+ko) ==== @@ -37,7 +37,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_getcwd.c,v 1.31 2008/10/28 13:44:11 trasz Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_getcwd.c,v 1.32 2009/02/13 18:18:14 jhb Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -163,7 +163,7 @@ cn.cn_nameptr = ".."; cn.cn_namelen = 2; cn.cn_consume = 0; - cn.cn_lkflags = LK_EXCLUSIVE; + cn.cn_lkflags = LK_SHARED; /* * At this point, lvp is locked and will be unlocked by the lookup. ==== //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#64 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.101 2008/04/21 21:24:08 rdivacky Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.102 2009/02/13 18:18:14 jhb Exp $"); #include "opt_mac.h" @@ -278,7 +278,7 @@ buflen = max(DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); again: aiov.iov_base = buf; aiov.iov_len = buflen; @@ -447,7 +447,7 @@ buflen = min(MAXBSIZE, uap->nbytes); buf = malloc(buflen, M_TEMP, M_WAITOK); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); off = fp->f_offset; again: aiov.iov_base = buf; ==== //depot/projects/smpng/sys/dev/ath/ath_hal/ah_internal.h#4 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/ath/ath_hal/ah_internal.h,v 1.3 2009/01/28 18:00:22 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ah_internal.h,v 1.5 2009/02/11 22:34:22 sam Exp $ */ #ifndef _ATH_AH_INTERAL_H_ #define _ATH_AH_INTERAL_H_ @@ -79,12 +79,12 @@ }; #ifndef AH_CHIP #define AH_CHIP(_name, _probe, _attach) \ -static struct ath_hal_chip name##_chip = { \ +static struct ath_hal_chip _name##_chip = { \ .name = #_name, \ .probe = _probe, \ .attach = _attach \ }; \ -OS_DATA_SET(ah_chips, name##_chip) +OS_DATA_SET(ah_chips, _name##_chip) #endif /* ==== //depot/projects/smpng/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c#3 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c,v 1.3 2008/12/15 00:29:26 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c,v 1.4 2009/02/13 01:50:04 sam Exp $ */ #include "opt_ah.h" @@ -321,6 +321,7 @@ case AR5212_AR2315_REV7: return "Atheros 2315 WiSoC"; case AR5212_AR2317_REV1: + case AR5212_AR2317_REV2: return "Atheros 2317 WiSoC"; case AR5212_AR2413: return "Atheros 2413"; ==== //depot/projects/smpng/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c#4 (text+ko) ==== @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c,v 1.3 2009/01/28 18:00:22 sam Exp $ + * $FreeBSD: src/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c,v 1.4 2009/02/11 22:15:37 sam Exp $ */ #include "opt_ah.h" @@ -2710,6 +2710,7 @@ } } HALASSERT(0); + *indexL = *indexR = 0; return AH_FALSE; } ==== //depot/projects/smpng/sys/dev/ath/if_ath.c#67 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.233 2009/02/10 23:48:29 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.235 2009/02/13 05:38:03 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -56,6 +56,7 @@ #include #include #include +#include #include @@ -2071,7 +2072,6 @@ ath_start(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; - struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_node *ni; struct ath_buf *bf; struct mbuf *m, *next; @@ -2141,7 +2141,7 @@ !ath_txfrag_setup(sc, &frags, m, ni)) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); - ic->ic_stats.is_tx_nobuf++; /* XXX */ + sc->sc_stats.ast_tx_nofrag++; ath_freetx(m); goto bad; } @@ -6584,6 +6584,11 @@ rt->info[sc->sc_txrix].dot11Rate &~ IEEE80211_RATE_BASIC; return copyout(&sc->sc_stats, ifr->ifr_data, sizeof (sc->sc_stats)); + case SIOCZATHSTATS: + error = priv_check(curthread, PRIV_DRIVER); + if (error == 0) + memset(&sc->sc_stats, 0, sizeof(sc->sc_stats)); + break; #ifdef ATH_DIAGAPI case SIOCGATHDIAG: error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); ==== //depot/projects/smpng/sys/dev/ath/if_athioctl.h#19 (text+ko) ==== @@ -26,7 +26,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_athioctl.h,v 1.22 2009/02/05 21:02:40 sam Exp $ + * $FreeBSD: src/sys/dev/ath/if_athioctl.h,v 1.24 2009/02/13 05:38:03 sam Exp $ */ /* @@ -117,10 +117,12 @@ u_int16_t ast_tdma_tsfadjm;/* TDMA slot adjust- (usec, smoothed)*/ u_int32_t ast_tdma_ack; /* TDMA tx failed 'cuz ACK required */ u_int32_t ast_tx_raw_fail;/* raw tx failed 'cuz h/w down */ - u_int32_t ast_pad[15]; + u_int32_t ast_tx_nofrag; /* tx dropped 'cuz no ath frag buffer */ + u_int32_t ast_pad[14]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) +#define SIOCZATHSTATS _IOWR('i', 139, struct ifreq) struct ath_diag { char ad_name[IFNAMSIZ]; /* if name, e.g. "ath0" */ ==== //depot/projects/smpng/sys/dev/cm/smc90cx6.c#16 (text+ko) ==== @@ -1,7 +1,7 @@ /* $NetBSD: smc90cx6.c,v 1.38 2001/07/07 15:57:53 thorpej Exp $ */ #include -__FBSDID("$FreeBSD: src/sys/dev/cm/smc90cx6.c,v 1.19 2007/10/12 06:03:42 kevlo Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cm/smc90cx6.c,v 1.20 2009/02/12 23:55:35 rwatson Exp $"); /*- * Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc. @@ -861,14 +861,10 @@ caddr_t data; { struct cm_softc *sc; - struct ifaddr *ifa; - struct ifreq *ifr; int error; error = 0; sc = ifp->if_softc; - ifa = (struct ifaddr *)data; - ifr = (struct ifreq *)data; #if defined(CM_DEBUG) && (CM_DEBUG > 2) if_printf(ifp, "ioctl() called, cmd = 0x%lx\n", command); ==== //depot/projects/smpng/sys/dev/firewire/firewire.h#17 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/firewire.h,v 1.22 2008/09/27 08:51:18 ed Exp $ + * $FreeBSD: src/sys/dev/firewire/firewire.h,v 1.24 2009/02/13 17:45:09 sbruno Exp $ * */ @@ -99,9 +99,16 @@ #define FWRCODE_ER_TYPE 6 #define FWRCODE_ER_ADDR 7 +/* + * Defined 1394a-2000 + * Table 5B-1 + */ #define FWSPD_S100 0 #define FWSPD_S200 1 #define FWSPD_S400 2 +#define FWSPD_S800 3 +#define FWSPD_S1600 4 +#define FWSPD_S3200 5 #define FWP_TL_VALID (1 << 7) @@ -277,6 +284,10 @@ struct fw_devinfo dev[FW_MAX_DEVLST]; }; +/* + * Defined in IEEE 1394a-2000 + * 4.3.4.1 + */ #define FW_SELF_ID_PORT_CONNECTED_TO_CHILD 3 #define FW_SELF_ID_PORT_CONNECTED_TO_PARENT 2 #define FW_SELF_ID_PORT_NOT_CONNECTED 1 @@ -305,18 +316,32 @@ phy_id:6, sequel:1, sequence_num:3, - :2, - porta:2, - portb:2, - portc:2, - portd:2, - porte:2, - portf:2, - portg:2, - porth:2, - :1, + reserved2:2, + port3:2, + port4:2, + port5:2, + port6:2, + port7:2, + port8:2, + port9:2, + port10:2, + reserved1:1, more_packets:1; } p1; + struct { + uint32_t + id:2, + phy_id:6, + sequel:1, + sequence_num:3, + :2, + port11:2, + port12:2, + port13:2, + port14:2, + port15:2, + :8; + } p2; }; #else union fw_self_id { @@ -339,20 +364,34 @@ struct { uint32_t more_packets:1, reserved1:1, - porth:2, - portg:2, - portf:2, - porte:2, - portd:2, - portc:2, - portb:2, - porta:2, + port10:2, + port9:2, + port8:2, + port7:2, + port6:2, + port5:2, + port4:2, + port3:2, reserved2:2, sequence_num:3, sequel:1, phy_id:6, id:2; } p1; + struct { + uint32_t + reserved3:8, + port15:2, + port14:2, + port13:2, + port12:2, + port11:2, + reserved4:2, + sequence_num:3, + sequel:1, + phy_id:6, + id:2; + } p2; }; #endif ==== //depot/projects/smpng/sys/dev/firewire/fwohci.c#42 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.96 2009/02/01 23:28:52 sbruno Exp $ + * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.98 2009/02/13 17:44:07 sbruno Exp $ * */ @@ -306,8 +306,8 @@ if((bm & 0x3f) == 0x3f) bm = node; if (firewire_debug) - device_printf(sc->fc.dev, - "fw_set_bus_manager: %d->%d (loop=%d)\n", bm, node, i); + device_printf(sc->fc.dev, "%s: %d->%d (loop=%d)\n", + __func__, bm, node, i); return(bm); } @@ -332,7 +332,7 @@ } if(i >= MAX_RETRY) { if (firewire_debug) - device_printf(sc->fc.dev, "phy read failed(1).\n"); + device_printf(sc->fc.dev, "%s: failed(1).\n", __func__); if (++retry < MAX_RETRY) { DELAY(100); goto again; @@ -343,15 +343,16 @@ if ((stat & OHCI_INT_REG_FAIL) != 0 || ((fun >> PHYDEV_REGADDR) & 0xf) != addr) { if (firewire_debug) - device_printf(sc->fc.dev, "phy read failed(2).\n"); + device_printf(sc->fc.dev, "%s: failed(2).\n", __func__); if (++retry < MAX_RETRY) { DELAY(100); goto again; } } - if (firewire_debug || retry >= MAX_RETRY) + if (firewire_debug > 1 || retry >= MAX_RETRY) device_printf(sc->fc.dev, - "fwphy_rddata: 0x%x loop=%d, retry=%d\n", addr, i, retry); + "%s:: 0x%x loop=%d, retry=%d\n", + __func__, addr, i, retry); #undef MAX_RETRY return((fun >> PHYDEV_RDDATA )& 0xff); } @@ -1848,7 +1849,7 @@ /* Disable bus reset interrupt until sid recv. */ OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_PHY_BUS_R); - device_printf(fc->dev, "BUS reset\n"); + device_printf(fc->dev, "%s: BUS reset\n", __func__); OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST); OWRITE(sc, OHCI_LNKCTLCLR, OHCI_CNTL_CYCSRC); @@ -1885,10 +1886,11 @@ plen = OREAD(sc, OHCI_SID_CNT); fc->nodeid = node_id & 0x3f; - device_printf(fc->dev, "node_id=0x%08x, SelfID Count=%d, ", - fc->nodeid, (plen >> 16) & 0xff); + device_printf(fc->dev, "%s: node_id=0x%08x, SelfID Count=%d, ", + __func__, fc->nodeid, (plen >> 16) & 0xff); if (!(node_id & OHCI_NODE_VALID)) { - printf("Bus reset failure\n"); + device_printf(fc->dev, "%s: Bus reset failure\n", + __func__); goto sidout; } @@ -2977,7 +2979,7 @@ db_tr = STAILQ_NEXT(db_tr, link); resCount = FWOHCI_DMA_READ(db_tr->db[0].db.desc.res) & OHCI_COUNT_MASK; - } while (resCount == 0) + } printf(" done\n"); dbch->top = db_tr; dbch->buf_offset = dbch->xferq.psize - resCount; ==== //depot/projects/smpng/sys/dev/firewire/fwohcireg.h#20 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/fwohcireg.h,v 1.23 2007/04/30 14:06:30 simokawa Exp $ + * $FreeBSD: src/sys/dev/firewire/fwohcireg.h,v 1.24 2009/02/12 03:05:42 sbruno Exp $ * */ #define PCI_CBMEM PCIR_BAR(0) @@ -411,32 +411,31 @@ #define OHCI_CNTL_PHYPKT (0x1 << 10) #define OHCI_CNTL_SID (0x1 << 9) +/* + * defined in OHCI 1.1 + * chapter 6.1 + */ #define OHCI_INT_DMA_ATRQ (0x1 << 0) #define OHCI_INT_DMA_ATRS (0x1 << 1) #define OHCI_INT_DMA_ARRQ (0x1 << 2) #define OHCI_INT_DMA_ARRS (0x1 << 3) #define OHCI_INT_DMA_PRRQ (0x1 << 4) #define OHCI_INT_DMA_PRRS (0x1 << 5) -#define OHCI_INT_DMA_IT (0x1 << 6) -#define OHCI_INT_DMA_IR (0x1 << 7) -#define OHCI_INT_PW_ERR (0x1 << 8) -#define OHCI_INT_LR_ERR (0x1 << 9) - +#define OHCI_INT_DMA_IT (0x1 << 6) +#define OHCI_INT_DMA_IR (0x1 << 7) +#define OHCI_INT_PW_ERR (0x1 << 8) +#define OHCI_INT_LR_ERR (0x1 << 9) #define OHCI_INT_PHY_SID (0x1 << 16) #define OHCI_INT_PHY_BUS_R (0x1 << 17) - #define OHCI_INT_REG_FAIL (0x1 << 18) - #define OHCI_INT_PHY_INT (0x1 << 19) #define OHCI_INT_CYC_START (0x1 << 20) #define OHCI_INT_CYC_64SECOND (0x1 << 21) #define OHCI_INT_CYC_LOST (0x1 << 22) #define OHCI_INT_CYC_ERR (0x1 << 23) - #define OHCI_INT_ERR (0x1 << 24) #define OHCI_INT_CYC_LONG (0x1 << 25) #define OHCI_INT_PHY_REG (0x1 << 26) - #define OHCI_INT_EN (0x1 << 31) #define IP_CHANNELS 0x0234 ==== //depot/projects/smpng/sys/dev/firewire/fwphyreg.h#4 (text+ko) ==== @@ -31,9 +31,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/fwphyreg.h,v 1.3 2005/01/06 01:42:41 imp Exp $ + * $FreeBSD: src/sys/dev/firewire/fwphyreg.h,v 1.4 2009/02/12 03:05:42 sbruno Exp $ */ +/* + * IEEE 1394a + * Figure 5B - 1 + */ struct phyreg_base { #if BYTE_ORDER == BIG_ENDIAN uint8_t phy_id:6, @@ -100,6 +104,10 @@ #endif }; +/* + * IEEE 1394a + * Figure 5B - 2 + */ struct phyreg_page0 { #if BYTE_ORDER == BIG_ENDIAN uint8_t astat:2, @@ -160,6 +168,10 @@ #endif }; +/* + * IEEE 1394a + * Figure 5B - 3 + */ struct phyreg_page1 { uint8_t compliance; uint8_t :8; ==== //depot/projects/smpng/sys/dev/iwn/if_iwn.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/iwn/if_iwn.c,v 1.9 2008/10/27 16:46:50 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/iwn/if_iwn.c,v 1.10 2009/02/13 16:17:05 sam Exp $"); #include #include @@ -1442,7 +1442,6 @@ if (len < sizeof (struct ieee80211_frame)) { DPRINTF(sc, IWN_DEBUG_RECV, "%s: frame too short: %d\n", __func__, len); - ic->ic_stats.is_rx_tooshort++; ifp->if_ierrors++; return; } @@ -1452,7 +1451,6 @@ if (mnew == NULL) { DPRINTF(sc, IWN_DEBUG_ANY, "%s: no mbuf to restock ring\n", __func__); - ic->ic_stats.is_rx_nobuf++; ifp->if_ierrors++; return; } @@ -1463,7 +1461,6 @@ device_printf(sc->sc_dev, "%s: bus_dmamap_load failed, error %d\n", __func__, error); m_freem(mnew); - ic->ic_stats.is_rx_nobuf++; /* XXX need stat */ ifp->if_ierrors++; return; } ==== //depot/projects/smpng/sys/dev/mxge/if_mxge.c#25 (text+ko) ==== @@ -28,7 +28,7 @@ ***************************************************************************/ #include -__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.51 2008/11/24 19:00:57 gallatin Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.52 2009/02/12 18:33:56 rdivacky Exp $"); #include #include @@ -300,7 +300,7 @@ return ENXIO; } -#if #cpu(i386) || defined __i386 || defined i386 || defined __i386__ || #cpu(x86_64) || defined __x86_64__ +#if defined __i386 || defined i386 || defined __i386__ || defined __x86_64__ static void >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Feb 13 20:17:13 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E9CA31065675; Fri, 13 Feb 2009 20:17:12 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7EEB106566B for ; Fri, 13 Feb 2009 20:17:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 94A2D8FC12 for ; Fri, 13 Feb 2009 20:17:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DKHCDw071863 for ; Fri, 13 Feb 2009 20:17:12 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1DKHCsT071861 for perforce@freebsd.org; Fri, 13 Feb 2009 20:17:12 GMT (envelope-from jhb@freebsd.org) Date: Fri, 13 Feb 2009 20:17:12 GMT Message-Id: <200902132017.n1DKHCsT071861@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 157677 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, 13 Feb 2009 20:17:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=157677 Change 157677 by jhb@jhb_jhbbsd on 2009/02/13 20:16:20 IFC @157676 Affected files ... .. //depot/projects/smpng/sys/dev/usb/u3g.c#6 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs#126 integrate .. //depot/projects/smpng/sys/kern/subr_taskqueue.c#39 integrate .. //depot/projects/smpng/sys/net/if_bridge.c#54 integrate .. //depot/projects/smpng/sys/netinet/sctp_pcb.c#26 integrate .. //depot/projects/smpng/sys/netinet/sctp_usrreq.c#23 integrate Differences ... ==== //depot/projects/smpng/sys/dev/usb/u3g.c#6 (text+ko) ==== @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/usb/u3g.c,v 1.22 2009/01/27 19:37:30 n_hibma Exp $ + * $FreeBSD: src/sys/dev/usb/u3g.c,v 1.23 2009/02/13 19:49:51 n_hibma Exp $ */ /* @@ -87,25 +87,25 @@ struct u3g_speeds_s { - u_int32_t ispeed; // Speed in bits per second - u_int32_t ospeed; // Speed in bits per second + u_int32_t ispeed; + u_int32_t ospeed; }; static const struct u3g_speeds_s u3g_speeds[] = { -#define U3GSP_GPRS 0 - {64000, 64000}, -#define U3GSP_EDGE 1 - {384000, 64000}, -#define U3GSP_CDMA 2 - {384000, 64000}, -#define U3GSP_UMTS 3 - {384000, 64000}, -#define U3GSP_HSDPA 4 - {1200000, 384000}, -#define U3GSP_HSUPA 5 - {1200000, 384000}, -#define U3GSP_HSPA 6 - {7200000, 384000}, +#define U3GSP_GPRS 0 + {64000, 64000}, +#define U3GSP_EDGE 1 + {384000, 64000}, +#define U3GSP_CDMA 2 + {384000, 64000}, +#define U3GSP_UMTS 3 + {384000, 64000}, +#define U3GSP_HSDPA 4 + {1200000, 384000}, +#define U3GSP_HSUPA 5 + {1200000, 384000}, +#define U3GSP_HSPA 6 + {7200000, 384000}, }; #define U3GIBUFSIZE 1024 @@ -122,7 +122,8 @@ #define U3GFL_HUAWEI_INIT 0x01 // Requires init command (Huawei cards) #define U3GFL_SCSI_EJECT 0x02 // Requires SCSI eject command (Novatel) #define U3GFL_SIERRA_INIT 0x04 // Requires init command (Sierra cards) -#define U3GFL_STUB_WAIT 0x08 // Device reappears after a short delay +#define U3GFL_CMOTECH_INIT 0x08 // Requires init command (CMOTECH cards) +#define U3GFL_STUB_WAIT 0x80 // Device reappears after a short delay }; // Note: The entries marked with XXX should be checked for the correct speed @@ -184,10 +185,13 @@ {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8765 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC875U }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8775_2 }, U3GSP_HSDPA, U3GFL_NONE }, // XXX - {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8780 }, U3GSP_UMTS, U3GFL_NONE }, // XXX {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8781 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT }, // Sierra TruInstaller device ID + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT }, + {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA, U3GFL_NONE }, + /* OEM: CMOTECH */ + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628 }, U3GSP_HSDPA, U3GFL_CMOTECH_INIT }, + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_DISK }, U3GSP_HSDPA, U3GFL_NONE }, }; #define u3g_lookup(v, p) ((const struct u3g_dev_type_s *)usb_lookup(u3g_devs, v, p)) @@ -437,7 +441,7 @@ struct u3gstub_softc { device_t sc_dev; usbd_device_handle sc_udev; - usbd_pipe_handle sc_pipe; + usbd_pipe_handle sc_pipe_out, sc_pipe_in; usbd_xfer_handle sc_xfer; }; @@ -457,6 +461,25 @@ return 1; } +static void +u3gstub_BBB_cb(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err) +{ + struct u3gstub_softc *sc = (struct u3gstub_softc *) priv; + unsigned char cmd[13]; + + if (err) { + device_printf(sc->sc_dev, + "Failed to send CD eject command to " + "change to modem mode\n"); + } else { + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_in, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, NULL); + int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; + if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) + DPRINTF("failed to start transfer (CSW)\n"); + } +} + static int u3gstub_scsi_eject(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) { @@ -467,7 +490,7 @@ 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ - 0x00, /* 12: CBW Flag: output, so 0 */ + 0x00, /* 12: CBW Flag: output */ 0x00, /* 13: CBW Lun */ 0x06, /* 14: CBW Length */ @@ -488,11 +511,33 @@ /* Find the bulk-out endpoints */ id = usbd_get_interface_descriptor(uaa->iface); - for (i = 0 ; i < id->bNumEndpoints ; i++) { + for (i = 0 ; i < id->bNumEndpoints; i++) { ed = usbd_interface2endpoint_descriptor(uaa->iface, i); if (ed != NULL - && UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT - && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_out) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-out pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } else { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_in) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-in pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } + } + if (sc->sc_pipe_out && sc->sc_pipe_in) break; } @@ -501,10 +546,88 @@ return 0; } - if (usbd_open_pipe(uaa->iface, ed->bEndpointAddress, - USBD_EXCLUSIVE_USE, &sc->sc_pipe) != USBD_NORMAL_COMPLETION) { - DPRINTF("failed to open bulk-out pipe on endpoint %d\n", - ed->bEndpointAddress); + sc->sc_xfer = usbd_alloc_xfer(uaa->device); + if (sc->sc_xfer == NULL) { + DPRINTF("failed to allocate xfer\n"); + return 0; + } + + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, u3gstub_BBB_cb); + int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; + if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) { + DPRINTF("failed to start transfer (CBW)\n"); + return 0; + } + + return 1; +} + +static int +u3gstub_cmotech_init(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +{ + /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c + * in sys/cam/scsi/scsi_all.h . + */ + unsigned char cmd[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x80, /* 12: CBW Flag: output, so 0 */ + 0x00, /* 13: CBW Lun */ + 0x08, /* 14: CBW Length */ + + 0xff, /* 15+0 */ + 0x52, /* 15+1 */ + 0x44, /* 15+2 */ + 0x45, /* 15+2 */ + 0x56, /* 15+4 */ + 0x43, /* 15+5 */ + 0x48, /* 15+5 */ + 0x47, /* 15+5 */ + 0x00, 0x00, 0x00, 0x00, /* 15+8..15: unused */ + 0x00, 0x00, 0x00, 0x00 + }; + + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed = NULL; + int i; + + + /* Find the bulk-out endpoints */ + id = usbd_get_interface_descriptor(uaa->iface); + for (i = 0 ; i < id->bNumEndpoints ; i++) { + ed = usbd_interface2endpoint_descriptor(uaa->iface, i); + if (ed != NULL + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_out) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-out pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } else { + if (usbd_open_pipe(uaa->iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_in) + != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-in pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } + } + } + if (sc->sc_pipe_out && sc->sc_pipe_in) + break; + } + + if (i == id->bNumEndpoints) { + DPRINTF("failed to find bulk-out pipe\n"); return 0; } @@ -514,11 +637,11 @@ return 0; } - usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe, NULL, cmd, sizeof(cmd), - 0, USBD_DEFAULT_TIMEOUT, NULL); + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, NULL, cmd, sizeof(cmd), + 0, USBD_DEFAULT_TIMEOUT, u3gstub_BBB_cb); int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) { - DPRINTF("failed to start transfer\n"); + DPRINTF("failed to start transfer (CBW)\n"); return 0; } @@ -563,6 +686,7 @@ if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT || u3g_dev_type->flags&U3GFL_SCSI_EJECT || u3g_dev_type->flags&U3GFL_SIERRA_INIT + || u3g_dev_type->flags&U3GFL_CMOTECH_INIT || u3g_dev_type->flags&U3GFL_STUB_WAIT) { /* We assume that if the first interface is still a mass * storage device the device has not yet changed appearance. @@ -620,6 +744,12 @@ "changing Sierra modem to modem mode\n"); if (!u3gstub_sierra_init(sc, uaa)) return ENXIO; + } else if (u3g_dev_type->flags&U3GFL_CMOTECH_INIT) { + if (bootverbose) + device_printf(sc->sc_dev, + "changing CMOTECH modem to modem mode\n"); + if (!u3gstub_cmotech_init(sc, uaa)) + return ENXIO; } else if (u3g_dev_type->flags&U3GFL_STUB_WAIT) { if (bootverbose) device_printf(sc->sc_dev, "waiting for modem to change " @@ -638,9 +768,13 @@ if (sc->sc_xfer) usbd_free_xfer(sc->sc_xfer); - if (sc->sc_pipe) { - usbd_abort_pipe(sc->sc_pipe); - usbd_close_pipe(sc->sc_pipe); + if (sc->sc_pipe_in) { + usbd_abort_pipe(sc->sc_pipe_in); + usbd_close_pipe(sc->sc_pipe_in); + } + if (sc->sc_pipe_out) { + usbd_abort_pipe(sc->sc_pipe_out); + usbd_close_pipe(sc->sc_pipe_out); } return 0; ==== //depot/projects/smpng/sys/dev/usb/usbdevs#126 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/usb/usbdevs,v 1.398 2009/02/06 15:03:17 kevlo Exp $ +$FreeBSD: src/sys/dev/usb/usbdevs,v 1.400 2009/02/13 19:49:51 n_hibma Exp $ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ /*- @@ -613,7 +613,7 @@ vendor GLOBALSUN 0x16ab Global Sun Technology vendor ANYDATA 0x16d5 AnyDATA Corporation vendor JABLOTRON 0x16d6 Jablotron -vendor CMOTECH 0x16d8 CMOTECH Co., Ltd. +vendor CMOTECH 0x16d8 C-motech vendor AXESSTEL 0x1726 Axesstel Co., Ltd. vendor LINKSYS4 0x1737 Linksys vendor SENAO 0x1740 Senao @@ -1030,9 +1030,11 @@ product CISCOLINKSYS WUSBF54G 0x0024 WUSBF54G /* CMOTECH products */ -product CMOTECH CNU510 0x5141 CMOTECH CDMA Technologies USB modem +product CMOTECH CNU510 0x5141 CDMA Technologies USB modem product CMOTECH CNU550 0x5543 CDMA 2000 1xRTT/1xEVDO USB modem -product CMOTECH CDMA_MODEM1 0x6280 CMOTECH CDMA Technologies USB modem +product CMOTECH CGU628 0x6006 CGU-628 +product CMOTECH CDMA_MODEM1 0x6280 CDMA Technologies USB modem +product CMOTECH DISK 0xf000 disk mode /* Compaq products */ product COMPAQ IPAQPOCKETPC 0x0003 iPAQ PocketPC @@ -1866,6 +1868,8 @@ product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL ZEROCD2 0x5030 Novatel ZeroCD +product NOVATEL U760 0x6000 Novatel U760 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ ==== //depot/projects/smpng/sys/kern/subr_taskqueue.c#39 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_taskqueue.c,v 1.47 2009/02/13 01:16:51 thompsa Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_taskqueue.c,v 1.48 2009/02/13 18:51:39 thompsa Exp $"); #include #include @@ -402,7 +402,7 @@ while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { taskqueue_run(tq); TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); - }; + } /* rendezvous with thread that asked us to terminate */ tq->tq_tcount--; ==== //depot/projects/smpng/sys/net/if_bridge.c#54 (text+ko) ==== @@ -75,7 +75,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net/if_bridge.c,v 1.120 2008/12/10 23:12:39 zec Exp $"); +__FBSDID("$FreeBSD: src/sys/net/if_bridge.c,v 1.121 2009/02/13 19:20:25 thompsa Exp $"); #include "opt_inet.h" #include "opt_inet6.h" @@ -220,6 +220,7 @@ LIST_HEAD(, bridge_iflist) sc_spanlist; /* span ports list */ struct bstp_state sc_stp; /* STP state */ uint32_t sc_brtexceeded; /* # of cache drops */ + struct ifnet *sc_ifaddr; /* member mac copied from */ u_char sc_defaddr[6]; /* Default MAC address */ }; @@ -930,15 +931,16 @@ * the mac address of the bridge to the address of the next member, or * to its default address if no members are left. */ - if (bridge_inherit_mac && - !memcmp(IF_LLADDR(sc->sc_ifp), IF_LLADDR(ifs), ETHER_ADDR_LEN)) { - if (LIST_EMPTY(&sc->sc_iflist)) + if (bridge_inherit_mac && sc->sc_ifaddr == ifs) { + if (LIST_EMPTY(&sc->sc_iflist)) { bcopy(sc->sc_defaddr, IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); - else { + sc->sc_ifaddr = NULL; + } else { fif = LIST_FIRST(&sc->sc_iflist)->bif_ifp; bcopy(IF_LLADDR(fif), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + sc->sc_ifaddr = fif; } } @@ -1039,8 +1041,10 @@ * the default randomly generated one. */ if (bridge_inherit_mac && LIST_EMPTY(&sc->sc_iflist) && - !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) + !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) { bcopy(IF_LLADDR(ifs), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + sc->sc_ifaddr = ifs; + } ifs->if_bridge = sc; bstp_create(&sc->sc_stp, &bif->bif_stp, bif->bif_ifp); ==== //depot/projects/smpng/sys/netinet/sctp_pcb.c#26 (text+ko) ==== @@ -31,7 +31,7 @@ /* $KAME: sctp_pcb.c,v 1.38 2005/03/06 16:04:18 itojun Exp $ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/sctp_pcb.c,v 1.80 2009/02/03 11:04:03 rrs Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/sctp_pcb.c,v 1.81 2009/02/13 18:44:30 rrs Exp $"); #include #include @@ -2649,9 +2649,9 @@ * will transmute the ip address to the * proper value. */ - if (p && prison_local_ip4(p->td_ucred, &sin->sin_addr) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); + if (p && (error = prison_local_ip4(p->td_ucred, &sin->sin_addr)) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); + return (error); } if (sin->sin_addr.s_addr != INADDR_ANY) { bindall = 0; @@ -2680,10 +2680,10 @@ * will transmute the ipv6 address to the * proper value. */ - if (p && prison_local_ip6(p->td_ucred, &sin6->sin6_addr, - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); + if (p && (error = prison_local_ip6(p->td_ucred, &sin6->sin6_addr, + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); + return (error); } if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { bindall = 0; ==== //depot/projects/smpng/sys/netinet/sctp_usrreq.c#23 (text+ko) ==== @@ -31,7 +31,7 @@ /* $KAME: sctp_usrreq.c,v 1.48 2005/03/07 23:26:08 itojun Exp $ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/sctp_usrreq.c,v 1.63 2009/02/03 11:04:03 rrs Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/sctp_usrreq.c,v 1.64 2009/02/13 18:44:30 rrs Exp $"); #include #include #include @@ -4088,9 +4088,8 @@ error = EINVAL; break; } - if (td != NULL && prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr))) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr)))) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #ifdef INET6 @@ -4101,10 +4100,9 @@ error = EINVAL; break; } - if (td != NULL && prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #endif @@ -4133,9 +4131,8 @@ error = EINVAL; break; } - if (td != NULL && prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr))) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip4(td->td_ucred, &(((struct sockaddr_in *)(addrs->addr))->sin_addr)))) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #ifdef INET6 @@ -4146,10 +4143,9 @@ error = EINVAL; break; } - if (td != NULL && prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, EADDRNOTAVAIL); - error = EADDRNOTAVAIL; + if (td != NULL && (error = prison_local_ip6(td->td_ucred, &(((struct sockaddr_in6 *)(addrs->addr))->sin6_addr), + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_USRREQ, error); break; } #endif @@ -4256,9 +4252,9 @@ return (EINVAL); } sin6p = (struct sockaddr_in6 *)addr; - if (p != NULL && prison_remote_ip6(p->td_ucred, &sin6p->sin6_addr) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); + if (p != NULL && (error = prison_remote_ip6(p->td_ucred, &sin6p->sin6_addr)) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + return (error); } } else #endif @@ -4270,9 +4266,9 @@ return (EINVAL); } sinp = (struct sockaddr_in *)addr; - if (p != NULL && prison_remote_ip4(p->td_ucred, &sinp->sin_addr) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); + if (p != NULL && (error = prison_remote_ip4(p->td_ucred, &sinp->sin_addr)) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); + return (error); } } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EAFNOSUPPORT); From owner-p4-projects@FreeBSD.ORG Fri Feb 13 23:49:00 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AE20B1065672; Fri, 13 Feb 2009 23:48:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AF4B106566C for ; Fri, 13 Feb 2009 23:48:59 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1068FC16 for ; Fri, 13 Feb 2009 23:48:59 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DNmx3t031751 for ; Fri, 13 Feb 2009 23:48:59 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1DNmxU2031749 for perforce@freebsd.org; Fri, 13 Feb 2009 23:48:59 GMT (envelope-from andrew@freebsd.org) Date: Fri, 13 Feb 2009 23:48:59 GMT Message-Id: <200902132348.n1DNmxU2031749@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157687 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, 13 Feb 2009 23:49:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=157687 Change 157687 by andrew@andrew_bender on 2009/02/13 23:48:52 Rename neo1973_machdep.c to s3c24x0_machdep.c in preperation of having a board specific file similar to at91 Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/neo1973_machdep.c#12 delete .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_machdep.c#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Fri Feb 13 23:55:06 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D9C201065673; Fri, 13 Feb 2009 23:55:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99FAA106564A for ; Fri, 13 Feb 2009 23:55:05 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 874A38FC08 for ; Fri, 13 Feb 2009 23:55:05 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DNt5c2032223 for ; Fri, 13 Feb 2009 23:55:05 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1DNt5tZ032221 for perforce@freebsd.org; Fri, 13 Feb 2009 23:55:05 GMT (envelope-from andrew@freebsd.org) Date: Fri, 13 Feb 2009 23:55:05 GMT Message-Id: <200902132355.n1DNt5tZ032221@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157688 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, 13 Feb 2009 23:55:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=157688 Change 157688 by andrew@andrew_bender on 2009/02/13 23:54:57 Call board_init from s3c24x0_machdep.c Implement board_init on the Neo1973 Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/board_neo.c#1 add .. //depot/projects/arm/src/sys/arm/s3c2xx0/files.neo1973#2 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/files.s3c2xx0#6 edit .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_machdep.c#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/s3c2xx0/files.neo1973#2 (text+ko) ==== @@ -1,2 +1,2 @@ # $FreeBSD: src/sys/arm/at91/files.at91,v 1.7 2007/01/05 02:06:53 ticso Exp $ -arm/s3c2xx0/neo1973_machdep.c standard +arm/s3c2xx0/board_neo.c standard ==== //depot/projects/arm/src/sys/arm/s3c2xx0/files.s3c2xx0#6 (text+ko) ==== @@ -1,6 +1,7 @@ # $FreeBSD$ arm/arm/cpufunc_asm_arm9.S standard arm/arm/irq_dispatch.S standard +arm/s3c2xx0/s3c24x0_machdep.c standard arm/s3c2xx0/s3c24x0.c standard arm/s3c2xx0/s3c2xx0_space.c standard arm/s3c2xx0/s3c24x0_clk.c standard ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_machdep.c#2 (text+ko) ==== @@ -93,6 +93,7 @@ #include #include +#include #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ #define KERNEL_PT_KERN 1 @@ -136,8 +137,6 @@ static struct trapframe proc0_tf; -extern vm_offset_t s3c2410_uart_vaddr; - #define _A(a) ((a) & ~L1_S_OFFSET) #define _S(s) (((s) + L1_S_SIZE - 1) & ~(L1_S_SIZE-1)) @@ -235,7 +234,7 @@ vm_offset_t lastaddr; int i; - uint32_t memsize = 128 * 1024 * 1024; + uint32_t memsize; i = 0; @@ -375,7 +374,7 @@ /* Disable all peripheral interrupts */ ioreg_write32(S3C24X0_INTCTL_BASE + INTCTL_INTMSK, ~0); - s3c2410_uart_vaddr = S3C24X0_UART_BASE(0); + memsize = board_init(); cninit(); /* Set stack for exception handlers */ From owner-p4-projects@FreeBSD.ORG Sat Feb 14 00:55:07 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D18F91065672; Sat, 14 Feb 2009 00:55:06 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90496106566B for ; Sat, 14 Feb 2009 00:55:06 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 63A8D8FC12 for ; Sat, 14 Feb 2009 00:55:06 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1E0t6F6051062 for ; Sat, 14 Feb 2009 00:55:06 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1E0t66w051060 for perforce@freebsd.org; Sat, 14 Feb 2009 00:55:06 GMT (envelope-from andrew@freebsd.org) Date: Sat, 14 Feb 2009 00:55:06 GMT Message-Id: <200902140055.n1E0t66w051060@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157689 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: Sat, 14 Feb 2009 00:55:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=157689 Change 157689 by andrew@andrew_bender on 2009/02/14 00:54:05 Add initial support for the LN2410SBC board Affected files ... .. //depot/projects/arm/src/sys/arm/conf/LN2410SBC#1 add .. //depot/projects/arm/src/sys/arm/s3c2xx0/board_ln2410sbc.c#1 add .. //depot/projects/arm/src/sys/arm/s3c2xx0/files.ln2410sbc#1 add .. //depot/projects/arm/src/sys/arm/s3c2xx0/std.ln2410sbc#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Sat Feb 14 12:29:25 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4B35A10656C8; Sat, 14 Feb 2009 12:29:20 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2FB710656DE for ; Sat, 14 Feb 2009 12:29:18 +0000 (UTC) (envelope-from mayur@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 18E408FC14 for ; Sat, 14 Feb 2009 12:29:18 +0000 (UTC) (envelope-from mayur@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ECTIXA056958 for ; Sat, 14 Feb 2009 12:29:18 GMT (envelope-from mayur@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1ECTI19056956 for perforce@freebsd.org; Sat, 14 Feb 2009 12:29:18 GMT (envelope-from mayur@FreeBSD.org) Date: Sat, 14 Feb 2009 12:29:18 GMT Message-Id: <200902141229.n1ECTI19056956@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mayur@FreeBSD.org using -f From: Mayur Shardul To: Perforce Change Reviews Cc: Subject: PERFORCE change 157694 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: Sat, 14 Feb 2009 12:29:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=157694 Change 157694 by mayur@mayur_freebsd_vm on 2009/02/14 12:28:48 Fixed some style related bugs. Affected files ... .. //depot/projects/soc2008/mayur_vmalgo/kern/src/sys/vm/radix_tree.c#5 edit .. //depot/projects/soc2008/mayur_vmalgo/kern/src/sys/vm/vm_page.c#6 edit .. //depot/projects/soc2008/mayur_vmalgo/kern/src/sys/vm/vm_reserv.c#6 edit Differences ... ==== //depot/projects/soc2008/mayur_vmalgo/kern/src/sys/vm/radix_tree.c#5 (text+ko) ==== @@ -46,10 +46,11 @@ SLIST_HEAD_INITIALIZER(res_rnodes_head); int rnode_size; -rtidx_t max_index(struct radix_tree *rtree, int height); -rtidx_t get_slot(rtidx_t index, struct radix_tree *rtree, int level); -struct radix_node *get_radix_node(struct radix_tree *rtree); -void put_radix_node(struct radix_node *rnode, struct radix_tree *rtree); +static rtidx_t max_index(struct radix_tree *rtree, int height); +static rtidx_t get_slot(rtidx_t index, struct radix_tree *rtree, int level); +static struct radix_node *get_radix_node(struct radix_tree *rtree); +static void put_radix_node(struct radix_node *rnode, + struct radix_tree *rtree); extern vm_offset_t rt_resmem_start, rt_resmem_end; @@ -76,14 +77,14 @@ { struct radix_tree *rtree; - if ((RTIDX_LEN % bits_per_level) != 0){ + if ((RTIDX_LEN % bits_per_level) != 0) { printf("create_radix_tree: bits_per_level must be a divisor of RTIDX_LEN = %d",RTIDX_LEN); return NULL; } rtree = (struct radix_tree *)malloc(sizeof(struct radix_tree), M_TEMP,M_NOWAIT | M_ZERO); - if (rtree == NULL){ + if (rtree == NULL) { printf("create_radix_tree: Insufficient memory\n"); return NULL; } @@ -109,7 +110,7 @@ struct radix_node *rnode; int children_cnt; - if(!SLIST_EMPTY(&res_rnodes_head)){ + if (!SLIST_EMPTY(&res_rnodes_head)) { rnode = SLIST_FIRST(&res_rnodes_head); SLIST_REMOVE_HEAD(&res_rnodes_head, next); bzero((void *)rnode, rnode_size); @@ -120,7 +121,7 @@ children_cnt = MASK(rtree->rt_bits_per_level) + 1; rnode = (struct radix_node *)malloc(sizeof(struct radix_node) + sizeof(void *)*children_cnt,M_TEMP,M_NOWAIT | M_ZERO); - if (rnode == NULL){ + if (rnode == NULL) { panic("get_radix_node: Can not allocate memory\n"); return NULL; } @@ -151,13 +152,14 @@ rtidx_t max_index(struct radix_tree *rtree, int height) { - if (height > rtree->rt_max_height ){ + if (height > rtree->rt_max_height ) { printf("max_index: The tree does not have %d levels\n", height); height = rtree->rt_max_height; } - if(height == 0) + if (height == 0) { return 0; + } return (MASK(rtree->rt_bits_per_level*height)); } @@ -176,9 +178,10 @@ slot = index & (MASK(rtree->rt_bits_per_level) << offset); slot >>= offset; - if(slot < 0 || slot > 0x10) + if (slot < 0 || slot > 0x10) { panic("VM_ALGO: Wrong slot generated index - %lu level - %d", (u_long)index,level); + } return slot; } /* @@ -198,31 +201,32 @@ rtidx_t slot; struct radix_node *rnode = NULL, *tmp; - if (rtree->rt_max_index < index){ + if (rtree->rt_max_index < index) { printf("radix_tree_insert: Index %lu too large for the tree\n" ,(u_long)index); return 1; /*TODO Replace 1 by error code*/ } /* make sure that the tree is tall enough to accomidate the index*/ - if (rtree->rt_root == NULL){ + if (rtree->rt_root == NULL) { /* just add a node at required height*/ while (index > max_index(rtree, rtree->rt_height)) rtree->rt_height++; /* this happens when index == 0*/ - if(rtree->rt_height == 0) + if (rtree->rt_height == 0) { rtree->rt_height = 1; + } rnode = get_radix_node(rtree); if (rnode == NULL){ return (ENOMEM); } rnode->rn_children_count = 0; rtree->rt_root = rnode; - }else{ - while (index > max_index(rtree, rtree->rt_height)){ + } else { + while (index > max_index(rtree, rtree->rt_height)) { /*increase the height by one*/ rnode = get_radix_node(rtree); - if (rnode == NULL){ + if (rnode == NULL) { return (ENOMEM); } rnode->rn_children_count = 1; @@ -236,17 +240,17 @@ level = rtree->rt_height - 1; tmp = rtree->rt_root; - while (level > 0){ + while (level > 0) { /* * shift by the number of bits passed so far to * create the mask */ slot = get_slot(index,rtree,level); /* add the required intermidiate nodes */ - if (tmp->rn_children[slot] == NULL){ + if (tmp->rn_children[slot] == NULL) { tmp->rn_children_count++; rnode = get_radix_node(rtree); - if (rnode == NULL){ + if (rnode == NULL) { return (ENOMEM); } rnode->rn_children_count = 0; @@ -257,10 +261,12 @@ } slot = get_slot(index,rtree,level); - if (tmp->rn_children[slot] != NULL) - printf("radix_tree_insert: value already present in the tree\n"); - else + if (tmp->rn_children[slot] != NULL) { + printf("radix_tree_insert: value already present in" + " the tree\n"); + } else { tmp->rn_children_count++; + } /*we will overwrite the old value with the new value*/ tmp->rn_children[slot] = val; return 0; @@ -281,15 +287,16 @@ rtidx_t slot; struct radix_node *tmp; - if(index > MASK(rtree->rt_height * rtree->rt_bits_per_level)){ + if (index > MASK(rtree->rt_height * rtree->rt_bits_per_level)) { return NULL; } level = rtree->rt_height - 1; tmp = rtree->rt_root; - while (tmp){ + while (tmp) { slot = get_slot(index,rtree,level); - if (level == 0) + if (level == 0) { return tmp->rn_children[slot]; + } tmp = (struct radix_node *)tmp->rn_children[slot]; level--; } @@ -309,40 +316,43 @@ SLIST_HEAD(, radix_node) rtree_path = SLIST_HEAD_INITIALIZER(rtree_path); - if(index > MASK(rtree->rt_height * rtree->rt_bits_per_level)) + if (index > MASK(rtree->rt_height * rtree->rt_bits_per_level)) { return NULL; + } level = rtree->rt_height - 1; tmp = rtree->rt_root; - while (tmp){ + while (tmp) { SLIST_INSERT_HEAD(&rtree_path, tmp,next); slot = get_slot(index,rtree,level); - if (level == 0){ - if(NULL != tmp->rn_children[slot]) + if (level == 0) { + if (NULL != tmp->rn_children[slot]) { return tmp->rn_children[slot]; + } } tmp = (struct radix_node *)tmp->rn_children[slot]; - while (tmp == NULL){ + while (tmp == NULL) { /* index not present, see if there is something * greater than index */ tmp = SLIST_FIRST(&rtree_path); SLIST_REMOVE_HEAD(&rtree_path, next); - while (1) - { + while (1) { while (slot <= MASK(rtree->rt_bits_per_level) - && tmp->rn_children[slot] == NULL) + && tmp->rn_children[slot] == NULL) { slot++; - if(slot > MASK(rtree->rt_bits_per_level)){ - if(level == rtree->rt_height - 1) + } + if (slot > MASK(rtree->rt_bits_per_level)) { + if (level == rtree->rt_height - 1) { return NULL; + } tmp = SLIST_FIRST(&rtree_path); SLIST_REMOVE_HEAD(&rtree_path, next); level++; slot = get_slot(index,rtree,level) + 1; continue; } - if(level == 0){ + if (level == 0) { return tmp->rn_children[slot]; } SLIST_INSERT_HEAD(&rtree_path, tmp, next); @@ -369,43 +379,47 @@ SLIST_HEAD(, radix_node) rtree_path = SLIST_HEAD_INITIALIZER(rtree_path); - if(index > MASK(rtree->rt_height * rtree->rt_bits_per_level)) + if (index > MASK(rtree->rt_height * rtree->rt_bits_per_level)) index = MASK(rtree->rt_height * rtree->rt_bits_per_level); level = rtree->rt_height - 1; tmp = rtree->rt_root; - while (tmp){ + while (tmp) { SLIST_INSERT_HEAD(&rtree_path, tmp,next); slot = get_slot(index,rtree,level); - if (level == 0){ - if( NULL != tmp->rn_children[slot]) + if (level == 0) { + if ( NULL != tmp->rn_children[slot]) { return tmp->rn_children[slot]; + } } tmp = (struct radix_node *)tmp->rn_children[slot]; - while (tmp == NULL){ + while (tmp == NULL) { /* index not present, see if there is something * less than index */ tmp = SLIST_FIRST(&rtree_path); SLIST_REMOVE_HEAD(&rtree_path, next); - while (1){ + while (1) { while (slot > 0 - && tmp->rn_children[slot] == NULL) + && tmp->rn_children[slot] == NULL) { slot--; - if(tmp->rn_children[slot] == NULL){ + } + if (tmp->rn_children[slot] == NULL) { slot--; } - if(slot > MASK(rtree->rt_bits_per_level)){ - if(level == rtree->rt_height - 1) + if (slot > MASK(rtree->rt_bits_per_level)) { + if (level == rtree->rt_height - 1) { return NULL; + } tmp = SLIST_FIRST(&rtree_path); SLIST_REMOVE_HEAD(&rtree_path, next); level++; slot = get_slot(index,rtree,level) - 1; continue; } - if(level == 0) + if (level == 0) { return tmp->rn_children[slot]; + } SLIST_INSERT_HEAD(&rtree_path, tmp, next); tmp = tmp->rn_children[slot]; slot = MASK(rtree->rt_bits_per_level); @@ -436,42 +450,45 @@ level = rtree->rt_height - 1; tmp = rtree->rt_root; - while(tmp){ + while (tmp) { slot = get_slot(index,rtree,level); /* The delete operation might create a branch without any * nodes we will save the root of such branch, if there is * any, and its level. */ - if (branch == NULL ){ + if (branch == NULL ) { /* if there is an intermidiate node with one * child we save details of its parent node */ - if (level != 0){ + if (level != 0) { sub_branch = (struct radix_node *) tmp->rn_children[slot]; branch_level = level; if (sub_branch != NULL && - sub_branch->rn_children_count == 1) + sub_branch->rn_children_count == 1) { branch = tmp; + } } - }else{ + } else { /* If there is some decendent with more than one * child then reset the branch to NULL */ - if (level != 0){ + if (level != 0) { sub_branch = (struct radix_node *) tmp->rn_children[slot]; if (sub_branch != NULL && - sub_branch->rn_children_count > 1) + sub_branch->rn_children_count > 1) { branch = NULL; + } } } - if (level == 0){ + if (level == 0) { val = tmp->rn_children[slot]; - if (tmp->rn_children[slot] == NULL){ - printf("radix_tree_remove: index %lu not present in the tree.\n", + if (tmp->rn_children[slot] == NULL) { + printf("radix_tree_remove: index %lu " + "not present in the tree.\n", (u_long)index); return NULL; } @@ -479,7 +496,7 @@ tmp->rn_children_count--; /* cut the branch before we return*/ - if (branch != NULL){ + if (branch != NULL) { slot = get_slot(index,rtree, branch_level); tmp = branch->rn_children[slot]; @@ -487,9 +504,9 @@ branch->rn_children_count--; branch = tmp; branch_level--; - while (branch != NULL){ + while (branch != NULL) { slot = get_slot(index,rtree, - branch_level); + branch_level); tmp = branch->rn_children[slot]; put_radix_node(branch,rtree); branch = tmp; @@ -514,18 +531,19 @@ radix_tree_shrink(struct radix_tree *rtree){ struct radix_node *tmp; - if(rtree->rt_root == NULL) + if (rtree->rt_root == NULL) { return; + } /*Adjust the height of the tree*/ while (rtree->rt_root->rn_children_count == 1 && - rtree->rt_root->rn_children[0] != NULL){ + rtree->rt_root->rn_children[0] != NULL) { tmp = rtree->rt_root; rtree->rt_root = tmp->rn_children[0]; rtree->rt_height--; put_radix_node(tmp,rtree); } /* finally see if we have an empty tree*/ - if (rtree->rt_root->rn_children_count == 0){ + if (rtree->rt_root->rn_children_count == 0) { put_radix_node(rtree->rt_root,rtree); rtree->rt_root = NULL; } ==== //depot/projects/soc2008/mayur_vmalgo/kern/src/sys/vm/vm_page.c#6 (text+ko) ==== @@ -285,8 +285,7 @@ printf("VM_ALGO:Total number of pages reserved for radix nodes : %x\n", (end - new_end)/PAGE_SIZE); end = new_end; - for(i = 0; i < RESERVED_NODE_COUNT; i++) - { + for (i = 0; i < RESERVED_NODE_COUNT; i++) { SLIST_INSERT_HEAD(&res_rnodes_head, (struct radix_node *)mapped, next); mapped += rnode_size; @@ -676,16 +675,15 @@ m->pindex = pindex; #ifdef VM_RADIX - if(object->resident_page_count == 0){ + if (object->resident_page_count == 0) { TAILQ_INSERT_TAIL(&object->memq, m, listq); - } - else{ - if((neighbour = radix_tree_lookup_ge(pindex, - &object->rtree)) != NULL){ + } else { + if ((neighbour = radix_tree_lookup_ge(pindex, + &object->rtree)) != NULL) { KASSERT( pindex != neighbour->pindex, ("vm_page_insert" ": offset already allocated")); TAILQ_INSERT_BEFORE(neighbour, m, listq); - }else{ + } else { neighbour = radix_tree_lookup_le(pindex, &object->rtree); TAILQ_INSERT_AFTER(&object->memq, neighbour, m, listq); ==== //depot/projects/soc2008/mayur_vmalgo/kern/src/sys/vm/vm_reserv.c#6 (text+ko) ==== @@ -313,29 +313,31 @@ */ #ifdef VM_RADIX mpred = radix_tree_lookup_le(pindex, &object->rtree); - if(mpred != NULL){ + if (mpred != NULL) { KASSERT(mpred->pindex != pindex, ("vm_reserv_alloc_page: pindex already allocated")); rv = vm_reserv_from_page(mpred); if (rv->object == object && vm_reserv_has_pindex(rv, pindex)) { m = &rv->pages[VM_RESERV_INDEX(object, pindex)]; // Handle vm_page_rename(m, new_object, ...). - if ((m->flags & (PG_CACHED | PG_FREE)) == 0) + if ((m->flags & (PG_CACHED | PG_FREE)) == 0) { return (NULL); + } vm_reserv_populate(rv); return (m); } } msucc = radix_tree_lookup_ge(pindex, &object->rtree); - if(msucc != NULL){ + if (msucc != NULL) { KASSERT(msucc->pindex != pindex, ("vm_reserv_alloc_page: pindex already allocated")); rv = vm_reserv_from_page(msucc); if (rv->object == object && vm_reserv_has_pindex(rv, pindex)) { m = &rv->pages[VM_RESERV_INDEX(object, pindex)]; // Handle vm_page_rename(m, new_object, ...). - if ((m->flags & (PG_CACHED | PG_FREE)) == 0) + if ((m->flags & (PG_CACHED | PG_FREE)) == 0) { return (NULL); + } vm_reserv_populate(rv); return (m); } From owner-p4-projects@FreeBSD.ORG Sat Feb 14 12:44:37 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 71F601065733; Sat, 14 Feb 2009 12:44:36 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75BE01065726 for ; Sat, 14 Feb 2009 12:44:35 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A5A7E8FC16 for ; Sat, 14 Feb 2009 12:44:33 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ECiXFN058187 for ; Sat, 14 Feb 2009 12:44:33 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1ECiXYt058184 for perforce@freebsd.org; Sat, 14 Feb 2009 12:44:33 GMT (envelope-from pgj@FreeBSD.org) Date: Sat, 14 Feb 2009 12:44:33 GMT Message-Id: <200902141244.n1ECiXYt058184@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 157695 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: Sat, 14 Feb 2009 12:44:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=157695 Change 157695 by pgj@beehive on 2009/02/14 12:43:48 IFC Affected files ... .. //depot/projects/docproj_hu/www/en/community/mailinglists.sgml#2 integrate Differences ... ==== //depot/projects/docproj_hu/www/en/community/mailinglists.sgml#2 (text+ko) ==== @@ -1,6 +1,6 @@ - + ]> @@ -54,7 +54,9 @@ or WWW.
  • Hungarian -- WWW
  • + href="mailto:bsd@hu.FreeBSD.org">bsd@hu.FreeBSD.org, Administration + or Search.
  • Indonesian -- id-freebsd-subscribe@egroups.com
  • From owner-p4-projects@FreeBSD.ORG Sat Feb 14 12:58:48 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 898041065675; Sat, 14 Feb 2009 12:58:48 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 441231065672 for ; Sat, 14 Feb 2009 12:58:48 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3245F8FC0C for ; Sat, 14 Feb 2009 12:58:48 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ECwmOh069153 for ; Sat, 14 Feb 2009 12:58:48 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1ECwmGJ069151 for perforce@freebsd.org; Sat, 14 Feb 2009 12:58:48 GMT (envelope-from pgj@FreeBSD.org) Date: Sat, 14 Feb 2009 12:58:48 GMT Message-Id: <200902141258.n1ECwmGJ069151@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 157696 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: Sat, 14 Feb 2009 12:58:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=157696 Change 157696 by pgj@beehive on 2009/02/14 12:58:41 MFen: 1.15 -> 1.16 hu/community/mailinglists.sgml Affected files ... .. //depot/projects/docproj_hu/www/hu/community/mailinglists.sgml#11 edit Differences ... ==== //depot/projects/docproj_hu/www/hu/community/mailinglists.sgml#11 (text+ko) ==== @@ -9,7 +9,7 @@ @@ -93,7 +93,10 @@ vagy WWW.
  • MagyarWWW. + href="mailto:bsd@hu.FreeBSD.org">bsd@hu.FreeBSD.org, Adminisztráció + vagy Keresés.
  • Német Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5EAF31065673; Sat, 14 Feb 2009 15:57:50 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A8E61065670 for ; Sat, 14 Feb 2009 15:57:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 06D418FC1E for ; Sat, 14 Feb 2009 15:57:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1EFvn1K096082 for ; Sat, 14 Feb 2009 15:57:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1EFvnFR096080 for perforce@freebsd.org; Sat, 14 Feb 2009 15:57:49 GMT (envelope-from hselasky@FreeBSD.org) Date: Sat, 14 Feb 2009 15:57:49 GMT Message-Id: <200902141557.n1EFvnFR096080@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157699 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: Sat, 14 Feb 2009 15:57:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=157699 Change 157699 by hselasky@hselasky_laptop001 on 2009/02/14 15:57:12 Add two new functions to the libusb20 API and required kernel ioctls. - libusb20_dev_get_iface_desc - libusb20_dev_get_info New command to usbconfig, "show_ifdrv", which will print out the kernel driver attached to the given USB device aswell. See "man libusb20" for a detailed description. Some minor style corrections long-line wrapping. Requested by: Joe Marcus Clarke Affected files ... .. //depot/projects/usb/src/lib/libusb20/libusb20.3#6 edit .. //depot/projects/usb/src/lib/libusb20/libusb20.c#14 edit .. //depot/projects/usb/src/lib/libusb20/libusb20.h#10 edit .. //depot/projects/usb/src/lib/libusb20/libusb20_int.h#7 edit .. //depot/projects/usb/src/lib/libusb20/libusb20_ugen20.c#13 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_generic.c#43 edit .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_ioctl.h#29 edit .. //depot/projects/usb/src/usr.sbin/usbconfig/dump.c#10 edit .. //depot/projects/usb/src/usr.sbin/usbconfig/dump.h#5 edit .. //depot/projects/usb/src/usr.sbin/usbconfig/usbconfig.c#12 edit Differences ... ==== //depot/projects/usb/src/lib/libusb20/libusb20.3#6 (text+ko) ==== @@ -26,7 +26,7 @@ .\" .\" $FreeBSD: src/lib/libusb20/libusb20.3,v 1.1 2008/11/04 02:31:03 alfred Exp $ .\" -.Dd Oct 23, 2008 +.Dd Feb 14, 2009 .Dt LIBUSB20 3 .Os .Sh NAME @@ -308,8 +308,32 @@ . .Pp . +.Fn libusb20_dev_get_info pdev pinfo +This function retrives the BSD specific usb2_device_info structure into the memory location given by +.Fa pinfo . +The USB device given by +.Fa pdev +must be opened before this function will succeed. +This function returns zero on success else a LIBUSB20_ERROR value is returned. +. +.Pp +. +.Fn libusb20_dev_get_iface_desc pdev iface_index pbuf len +This function retrieves the kernel interface description for the given USB +.Fa iface_index . +The format of the USB interface description is: "drivername: " +The description string is always zero terminated. +A zero length string is written in case no driver is attached to the given interface. +The USB device given by +.Fa pdev +must be opened before this function will succeed. +This function returns zero on success else a LIBUSB20_ERROR value is returned. +. +.Pp +. .Fn libusb20_dev_get_desc pdev This function returns a zero terminated string describing the given USB device. +The format of the string is: "drivername: " . .Pp . ==== //depot/projects/usb/src/lib/libusb20/libusb20.c#14 (text+ko) ==== @@ -78,6 +78,8 @@ #define dummy_tr_close (void *)dummy_int #define dummy_tr_clear_stall_sync (void *)dummy_int #define dummy_process (void *)dummy_int +#define dummy_dev_info (void *)dummy_int +#define dummy_dev_get_iface_driver (void *)dummy_int #define dummy_tr_submit (void *)dummy_void #define dummy_tr_cancel_async (void *)dummy_void @@ -99,7 +101,7 @@ xfer->is_pending = 0; } - (xfer->callback) (xfer); + xfer->callback(xfer); if (xfer->is_restart) { xfer->is_restart = 0; @@ -109,7 +111,7 @@ (!xfer->is_pending)) { xfer->is_draining = 0; xfer->status = LIBUSB20_TRANSFER_DRAINED; - (xfer->callback) (xfer); + xfer->callback(xfer); } return; } @@ -122,7 +124,7 @@ if (!xfer->is_opened) { return (LIBUSB20_ERROR_OTHER); } - error = (xfer->pdev->methods->tr_close) (xfer); + error = xfer->pdev->methods->tr_close(xfer); if (xfer->pLength) { free(xfer->pLength); @@ -168,7 +170,7 @@ } memset(xfer->ppBuffer, 0, size); - error = (xfer->pdev->methods->tr_open) (xfer, MaxBufSize, + error = xfer->pdev->methods->tr_open(xfer, MaxBufSize, MaxFrameCount, ep_no); if (error) { @@ -273,7 +275,7 @@ } xfer->is_cancel = 1; /* we are cancelling */ - (xfer->pdev->methods->tr_cancel_async) (xfer); + xfer->pdev->methods->tr_cancel_async(xfer); return; } @@ -292,7 +294,7 @@ void libusb20_tr_clear_stall_sync(struct libusb20_transfer *xfer) { - (xfer->pdev->methods->tr_clear_stall_sync) (xfer); + xfer->pdev->methods->tr_clear_stall_sync(xfer); return; } @@ -420,7 +422,7 @@ xfer->is_cancel = 0; /* not cancelling */ xfer->is_restart = 0; /* not restarting */ - (xfer->pdev->methods->tr_submit) (xfer); + xfer->pdev->methods->tr_submit(xfer); return; } @@ -452,7 +454,7 @@ } else if (pdev->claimed_interfaces & (1 << ifaceIndex)) { error = LIBUSB20_ERROR_NOT_FOUND; } else { - error = (pdev->methods->claim_interface) (pdev, ifaceIndex); + error = pdev->methods->claim_interface(pdev, ifaceIndex); } if (!error) { pdev->claimed_interfaces |= (1 << ifaceIndex); @@ -480,7 +482,7 @@ free(pdev->pTransfer); pdev->pTransfer = NULL; } - error = (pdev->beMethods->close_device) (pdev); + error = pdev->beMethods->close_device(pdev); pdev->methods = &libusb20_dummy_methods; @@ -496,7 +498,7 @@ { int error; - error = (pdev->methods->detach_kernel_driver) (pdev, ifaceIndex); + error = pdev->methods->detach_kernel_driver(pdev, ifaceIndex); return (error); } @@ -517,7 +519,7 @@ { int error; - error = (pdev->methods->kernel_driver_active) (pdev, ifaceIndex); + error = pdev->methods->kernel_driver_active(pdev, ifaceIndex); return (error); } @@ -555,7 +557,7 @@ /* set "nTransfer" early */ pdev->nTransfer = nTransferMax; - error = (pdev->beMethods->open_device) (pdev, nTransferMax); + error = pdev->beMethods->open_device(pdev, nTransferMax); if (error) { if (pdev->pTransfer != NULL) { @@ -581,7 +583,7 @@ } else if (!(pdev->claimed_interfaces & (1 << ifaceIndex))) { error = LIBUSB20_ERROR_NOT_FOUND; } else { - error = (pdev->methods->release_interface) (pdev, ifaceIndex); + error = pdev->methods->release_interface(pdev, ifaceIndex); } if (!error) { pdev->claimed_interfaces &= ~(1 << ifaceIndex); @@ -594,7 +596,7 @@ { int error; - error = (pdev->methods->reset_device) (pdev); + error = pdev->methods->reset_device(pdev); return (error); } @@ -603,7 +605,7 @@ { int error; - error = (pdev->methods->set_power_mode) (pdev, power_mode); + error = pdev->methods->set_power_mode(pdev, power_mode); return (error); } @@ -613,7 +615,7 @@ int error; uint8_t power_mode; - error = (pdev->methods->get_power_mode) (pdev, &power_mode); + error = pdev->methods->get_power_mode(pdev, &power_mode); if (error) power_mode = LIBUSB20_POWER_ON; /* fake power mode */ return (power_mode); @@ -624,7 +626,7 @@ { int error; - error = (pdev->methods->set_alt_index) (pdev, ifaceIndex, altIndex); + error = pdev->methods->set_alt_index(pdev, ifaceIndex, altIndex); return (error); } @@ -633,7 +635,7 @@ { int error; - error = (pdev->methods->set_config_index) (pdev, configIndex); + error = pdev->methods->set_config_index(pdev, configIndex); return (error); } @@ -644,7 +646,7 @@ { int error; - error = (pdev->methods->do_request_sync) (pdev, + error = pdev->methods->do_request_sync(pdev, setup, data, pactlen, timeout, flags); return (error); } @@ -799,7 +801,7 @@ } else { do_close = 0; } - error = (pdev->methods->get_config_desc_full) (pdev, + error = pdev->methods->get_config_desc_full(pdev, &ptr, &len, configIndex); if (error) { @@ -853,7 +855,7 @@ do_close = 0; } - error = (pdev->methods->get_config_index) (pdev, &cfg_index); + error = pdev->methods->get_config_index(pdev, &cfg_index); if (error) { cfg_index = 0 - 1; /* current config index */ } @@ -883,7 +885,7 @@ { int error; - error = (pdev->methods->process) (pdev); + error = pdev->methods->process(pdev); return (error); } @@ -921,10 +923,20 @@ return; } +int +libusb20_dev_get_info(struct libusb20_device *pdev, + struct usb2_device_info *pinfo) +{ + if (pinfo == NULL) + return (LIBUSB20_ERROR_INVALID_PARAM); + + return (pdev->beMethods->dev_get_info(pdev, pinfo)); +} + const char * libusb20_dev_get_backend_name(struct libusb20_device *pdev) { - return ((pdev->beMethods->get_backend_name) ()); + return (pdev->beMethods->get_backend_name()); } const char * @@ -961,25 +973,29 @@ int libusb20_dev_set_owner(struct libusb20_device *pdev, uid_t user, gid_t group) { - return ((pdev->beMethods->dev_set_owner) (pdev, user, group)); + return (pdev->beMethods->dev_set_owner(pdev, user, group)); } int libusb20_dev_set_perm(struct libusb20_device *pdev, mode_t mode) { - return ((pdev->beMethods->dev_set_perm) (pdev, mode)); + return (pdev->beMethods->dev_set_perm(pdev, mode)); } int -libusb20_dev_set_iface_owner(struct libusb20_device *pdev, uint8_t iface_index, uid_t user, gid_t group) +libusb20_dev_set_iface_owner(struct libusb20_device *pdev, + uint8_t iface_index, uid_t user, gid_t group) { - return ((pdev->beMethods->dev_set_iface_owner) (pdev, iface_index, user, group)); + return (pdev->beMethods->dev_set_iface_owner( + pdev, iface_index, user, group)); } int -libusb20_dev_set_iface_perm(struct libusb20_device *pdev, uint8_t iface_index, mode_t mode) +libusb20_dev_set_iface_perm(struct libusb20_device *pdev, + uint8_t iface_index, mode_t mode) { - return ((pdev->beMethods->dev_set_iface_perm) (pdev, iface_index, mode)); + return (pdev->beMethods->dev_set_iface_perm( + pdev, iface_index, mode)); } int @@ -993,7 +1009,7 @@ if (group == NULL) group = &b; - return ((pdev->beMethods->dev_get_owner) (pdev, user, group)); + return (pdev->beMethods->dev_get_owner(pdev, user, group)); } int @@ -1003,11 +1019,12 @@ if (mode == NULL) mode = &a; - return ((pdev->beMethods->dev_get_perm) (pdev, mode)); + return (pdev->beMethods->dev_get_perm(pdev, mode)); } int -libusb20_dev_get_iface_owner(struct libusb20_device *pdev, uint8_t iface_index, uid_t *user, gid_t *group) +libusb20_dev_get_iface_owner(struct libusb20_device *pdev, + uint8_t iface_index, uid_t *user, gid_t *group) { uid_t a; gid_t b; @@ -1017,35 +1034,51 @@ if (group == NULL) group = &b; - return ((pdev->beMethods->dev_get_iface_owner) (pdev, iface_index, user, group)); + return (pdev->beMethods->dev_get_iface_owner( + pdev, iface_index, user, group)); } int -libusb20_dev_get_iface_perm(struct libusb20_device *pdev, uint8_t iface_index, mode_t *mode) +libusb20_dev_get_iface_perm(struct libusb20_device *pdev, + uint8_t iface_index, mode_t *mode) { mode_t a; if (mode == NULL) mode = &a; - return ((pdev->beMethods->dev_get_iface_perm) (pdev, iface_index, mode)); + return (pdev->beMethods->dev_get_iface_perm( + pdev, iface_index, mode)); +} + +int +libusb20_dev_get_iface_desc(struct libusb20_device *pdev, + uint8_t iface_index, char *buf, uint8_t len) +{ + if ((buf == NULL) || (len == 0)) + return (LIBUSB20_ERROR_INVALID_PARAM); + + return (pdev->beMethods->dev_get_iface_desc( + pdev, iface_index, buf, len)); } /* USB bus operations */ int -libusb20_bus_set_owner(struct libusb20_backend *pbe, uint8_t bus, uid_t user, gid_t group) +libusb20_bus_set_owner(struct libusb20_backend *pbe, + uint8_t bus, uid_t user, gid_t group) { - return ((pbe->methods->bus_set_owner) (pbe, bus, user, group)); + return (pbe->methods->bus_set_owner(pbe, bus, user, group)); } int libusb20_bus_set_perm(struct libusb20_backend *pbe, uint8_t bus, mode_t mode) { - return ((pbe->methods->bus_set_perm) (pbe, bus, mode)); + return (pbe->methods->bus_set_perm(pbe, bus, mode)); } int -libusb20_bus_get_owner(struct libusb20_backend *pbe, uint8_t bus, uid_t *user, gid_t *group) +libusb20_bus_get_owner(struct libusb20_backend *pbe, + uint8_t bus, uid_t *user, gid_t *group) { uid_t a; gid_t b; @@ -1054,7 +1087,7 @@ user = &a; if (group == NULL) group = &b; - return ((pbe->methods->bus_get_owner) (pbe, bus, user, group)); + return (pbe->methods->bus_get_owner(pbe, bus, user, group)); } int @@ -1064,7 +1097,7 @@ if (mode == NULL) mode = &a; - return ((pbe->methods->bus_get_perm) (pbe, bus, mode)); + return (pbe->methods->bus_get_perm(pbe, bus, mode)); } /* USB backend operations */ @@ -1073,40 +1106,40 @@ libusb20_be_get_dev_quirk(struct libusb20_backend *pbe, uint16_t quirk_index, struct libusb20_quirk *pq) { - return ((pbe->methods->root_get_dev_quirk) (pbe, quirk_index, pq)); + return (pbe->methods->root_get_dev_quirk(pbe, quirk_index, pq)); } int libusb20_be_get_quirk_name(struct libusb20_backend *pbe, uint16_t quirk_index, struct libusb20_quirk *pq) { - return ((pbe->methods->root_get_quirk_name) (pbe, quirk_index, pq)); + return (pbe->methods->root_get_quirk_name(pbe, quirk_index, pq)); } int libusb20_be_add_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq) { - return ((pbe->methods->root_add_dev_quirk) (pbe, pq)); + return (pbe->methods->root_add_dev_quirk(pbe, pq)); } int libusb20_be_remove_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq) { - return ((pbe->methods->root_remove_dev_quirk) (pbe, pq)); + return (pbe->methods->root_remove_dev_quirk(pbe, pq)); } int libusb20_be_set_owner(struct libusb20_backend *pbe, uid_t user, gid_t group) { - return ((pbe->methods->root_set_owner) (pbe, user, group)); + return (pbe->methods->root_set_owner(pbe, user, group)); } int libusb20_be_set_perm(struct libusb20_backend *pbe, mode_t mode) { - return ((pbe->methods->root_set_perm) (pbe, mode)); + return (pbe->methods->root_set_perm(pbe, mode)); } int @@ -1119,7 +1152,7 @@ user = &a; if (group == NULL) group = &b; - return ((pbe->methods->root_get_owner) (pbe, user, group)); + return (pbe->methods->root_get_owner(pbe, user, group)); } int @@ -1129,7 +1162,7 @@ if (mode == NULL) mode = &a; - return ((pbe->methods->root_get_perm) (pbe, mode)); + return (pbe->methods->root_get_perm(pbe, mode)); } struct libusb20_device * @@ -1162,7 +1195,7 @@ /* do the initial device scan */ if (pbe->methods->init_backend) { - (pbe->methods->init_backend) (pbe); + pbe->methods->init_backend(pbe); } return (pbe); } @@ -1223,7 +1256,7 @@ libusb20_dev_free(pdev); } if (pbe->methods->exit_backend) { - (pbe->methods->exit_backend) (pbe); + pbe->methods->exit_backend(pbe); } return; } ==== //depot/projects/usb/src/lib/libusb20/libusb20.h#10 (text+ko) ==== @@ -175,6 +175,7 @@ LIBUSB20_POWER_RESUME, }; +struct usb2_device_info; struct libusb20_transfer; struct libusb20_backend; struct libusb20_backend_methods; @@ -260,6 +261,8 @@ int libusb20_dev_get_perm(struct libusb20_device *pdev, mode_t *mode); int libusb20_dev_get_iface_owner(struct libusb20_device *pdev, uint8_t iface_index, uid_t *user, gid_t *group); int libusb20_dev_get_iface_perm(struct libusb20_device *pdev, uint8_t iface_index, mode_t *mode); +int libusb20_dev_get_info(struct libusb20_device *pdev, struct usb2_device_info *pinfo); +int libusb20_dev_get_iface_desc(struct libusb20_device *pdev, uint8_t iface_index, char *buf, uint8_t len); struct LIBUSB20_DEVICE_DESC_DECODED *libusb20_dev_get_device_desc(struct libusb20_device *pdev); struct libusb20_config *libusb20_dev_alloc_config(struct libusb20_device *pdev, uint8_t config_index); ==== //depot/projects/usb/src/lib/libusb20/libusb20_int.h#7 (text+ko) ==== @@ -57,6 +57,8 @@ typedef int (libusb20_dev_get_iface_perm_t)(struct libusb20_device *pdev, uint8_t iface_index, mode_t *mode); typedef int (libusb20_dev_get_owner_t)(struct libusb20_device *pdev, uid_t *user, gid_t *group); typedef int (libusb20_dev_get_perm_t)(struct libusb20_device *pdev, mode_t *mode); +typedef int (libusb20_dev_get_info_t)(struct libusb20_device *pdev, struct usb2_device_info *pinfo); +typedef int (libusb20_dev_get_iface_desc_t)(struct libusb20_device *pdev, uint8_t iface_index, char *buf, uint8_t len); typedef int (libusb20_dev_set_iface_owner_t)(struct libusb20_device *pdev, uint8_t iface_index, uid_t user, gid_t group); typedef int (libusb20_dev_set_iface_perm_t)(struct libusb20_device *pdev, uint8_t iface_index, mode_t mode); typedef int (libusb20_dev_set_owner_t)(struct libusb20_device *pdev, uid_t user, gid_t group); @@ -85,8 +87,10 @@ m(n, bus_get_owner) \ m(n, bus_set_perm) \ m(n, bus_get_perm) \ + m(n, dev_get_info) \ m(n, dev_get_iface_owner) \ m(n, dev_get_iface_perm) \ + m(n, dev_get_iface_desc) \ m(n, dev_get_owner) \ m(n, dev_get_perm) \ m(n, dev_set_iface_owner) \ ==== //depot/projects/usb/src/lib/libusb20/libusb20_ugen20.c#13 (text+ko) ==== @@ -58,6 +58,8 @@ static libusb20_dev_get_iface_perm_t ugen20_dev_get_iface_perm; static libusb20_dev_get_owner_t ugen20_dev_get_owner; static libusb20_dev_get_perm_t ugen20_dev_get_perm; +static libusb20_dev_get_iface_desc_t ugen20_dev_get_iface_desc; +static libusb20_dev_get_info_t ugen20_dev_get_info; static libusb20_dev_set_iface_owner_t ugen20_dev_set_iface_owner; static libusb20_dev_set_iface_perm_t ugen20_dev_set_iface_perm; static libusb20_dev_set_owner_t ugen20_dev_set_owner; @@ -954,6 +956,34 @@ } static int +ugen20_dev_get_iface_desc(struct libusb20_device *pdev, + uint8_t iface_index, char *buf, uint8_t len) +{ + struct usb2_gen_descriptor ugd; + + memset(&ugd, 0, sizeof(ugd)); + + ugd.ugd_data = buf; + ugd.ugd_maxlen = len; + ugd.ugd_iface_index = iface_index; + + if (ioctl(pdev->file, USB_GET_IFACE_DRIVER, &ugd)) { + return (LIBUSB20_ERROR_INVALID_PARAM); + } + return (0); +} + +static int +ugen20_dev_get_info(struct libusb20_device *pdev, + struct usb2_device_info *pinfo) +{ + if (ioctl(pdev->file, USB_GET_DEVICEINFO, pinfo)) { + return (LIBUSB20_ERROR_INVALID_PARAM); + } + return (0); +} + +static int ugen20_dev_get_iface_owner(struct libusb20_device *pdev, uint8_t iface_index, uid_t *user, gid_t *group) { ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_generic.c#43 (text+ko) ==== @@ -80,6 +80,7 @@ static int ugen_set_interface(struct usb2_fifo *, uint8_t, uint8_t); static int ugen_get_cdesc(struct usb2_fifo *, struct usb2_gen_descriptor *); static int ugen_get_sdesc(struct usb2_fifo *, struct usb2_gen_descriptor *); +static int ugen_get_iface_driver(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd); static int usb2_gen_fill_deviceinfo(struct usb2_fifo *, struct usb2_device_info *); static int ugen_re_enumerate(struct usb2_fifo *); @@ -714,68 +715,64 @@ } /*------------------------------------------------------------------------* - * usb2_gen_fill_devicenames + * ugen_get_iface_driver * - * This function dumps information about an USB device names to - * userland. + * This function generates an USB interface description for userland. * * Returns: * 0: Success * Else: Failure *------------------------------------------------------------------------*/ static int -usb2_gen_fill_devicenames(struct usb2_fifo *f, struct usb2_device_names *dn) +ugen_get_iface_driver(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd) { + struct usb2_device *udev = f->udev; struct usb2_interface *iface; const char *ptr; - char *dst; - char buf[32]; - int error = 0; - int len; - int max_len; - uint8_t i; - uint8_t first = 1; + const char *desc; + unsigned int len; + unsigned int maxlen; + char buf[128]; + int error; - max_len = dn->udn_devnames_len; - dst = dn->udn_devnames_ptr; + DPRINTFN(6, "\n"); - if (max_len == 0) { + if ((ugd->ugd_data == NULL) || (ugd->ugd_maxlen == 0)) { + /* userland pointer should not be zero */ return (EINVAL); } - /* put a zero there */ - error = copyout("", dst, 1); - if (error) { - return (error); + + iface = usb2_get_iface(udev, ugd->ugd_iface_index); + if ((iface == NULL) || (iface->idesc == NULL)) { + /* invalid interface index */ + return (EINVAL); } - for (i = 0;; i++) { - iface = usb2_get_iface(f->udev, i); - if (iface == NULL) { - break; - } - if ((iface->subdev != NULL) && - device_is_attached(iface->subdev)) { - ptr = device_get_nameunit(iface->subdev); - if (!first) { - strlcpy(buf, ", ", sizeof(buf)); - } else { - buf[0] = 0; - } - strlcat(buf, ptr, sizeof(buf)); - len = strlen(buf) + 1; - if (len > max_len) { - break; - } - error = copyout(buf, dst, len); - if (error) { - return (error); - } - len--; - dst += len; - max_len -= len; - first = 0; - } + + /* read out device nameunit string, if any */ + if ((iface->subdev != NULL) && + device_is_attached(iface->subdev) && + (ptr = device_get_nameunit(iface->subdev)) && + (desc = device_get_desc(iface->subdev))) { + + /* print description */ + snprintf(buf, sizeof(buf), "%s: <%s>", ptr, desc); + + /* range checks */ + maxlen = ugd->ugd_maxlen - 1; + len = strlen(buf); + if (len > maxlen) + len = maxlen; + + /* update actual length, including terminating zero */ + ugd->ugd_actlen = len + 1; + + /* copy out interface description */ + error = copyout(buf, ugd->ugd_data, ugd->ugd_actlen); + } else { + /* zero length string is default */ + error = copyout("", ugd->ugd_data, 1); } - return (0); + return (error); } /*------------------------------------------------------------------------* @@ -2046,6 +2043,10 @@ error = ugen_get_sdesc(f, addr); break; + case USB_GET_IFACE_DRIVER: + error = ugen_get_iface_driver(f, addr); + break; + case USB_REQUEST: case USB_DO_REQUEST: if (!(fflags & FWRITE)) { @@ -2060,10 +2061,6 @@ error = usb2_gen_fill_deviceinfo(f, addr); break; - case USB_GET_DEVICENAMES: - error = usb2_gen_fill_devicenames(f, addr); - break; - case USB_DEVICESTATS: for (n = 0; n != 4; n++) { ==== //depot/projects/usb/src/sys/dev/usb2/include/usb2_ioctl.h#29 (text+ko) ==== @@ -77,13 +77,6 @@ uint8_t reserved[8]; }; -struct usb2_device_names { - char *udn_devnames_ptr; /* userland pointer to comma separated - * list of device names */ - uint16_t udn_devnames_len; /* maximum string length including - * terminating zero */ -}; - struct usb2_device_info { uint16_t udi_productNo; uint16_t udi_vendorNo; @@ -249,7 +242,7 @@ #define USB_SET_RX_BUFFER_SIZE _IOW ('U', 118, int) #define USB_SET_RX_STALL_FLAG _IOW ('U', 119, int) #define USB_SET_TX_STALL_FLAG _IOW ('U', 120, int) -#define USB_GET_DEVICENAMES _IOW ('U', 121, struct usb2_device_names) +#define USB_GET_IFACE_DRIVER _IOWR('U', 121, struct usb2_gen_descriptor) #define USB_CLAIM_INTERFACE _IOW ('U', 122, int) #define USB_RELEASE_INTERFACE _IOW ('U', 123, int) #define USB_IFACE_DRIVER_ACTIVE _IOW ('U', 124, int) ==== //depot/projects/usb/src/usr.sbin/usbconfig/dump.c#10 (text+ko) ==== @@ -176,15 +176,30 @@ } void -dump_device_info(struct libusb20_device *pdev) +dump_device_info(struct libusb20_device *pdev, uint8_t show_ifdrv) { + char buf[128]; + uint8_t n; + printf("%s, cfg=%u md=%s spd=%s pwr=%s\n", libusb20_dev_get_desc(pdev), libusb20_dev_get_config_index(pdev), dump_mode(libusb20_dev_get_mode(pdev)), dump_speed(libusb20_dev_get_speed(pdev)), dump_power_mode(libusb20_dev_get_power_mode(pdev))); - return; + + if (!show_ifdrv) + return; + + for (n = 0; n != 255; n++) { + if (libusb20_dev_get_iface_desc(pdev, n, buf, sizeof(buf))) + break; + if (buf[0] == 0) + continue; + printf("ugen%u.%u.%u: %s\n", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev), n, buf); + } } void @@ -339,7 +354,8 @@ owner = (pw = getpwuid(uid)) ? pw->pw_name : "UNKNOWN"; group = (gr = getgrgid(gid)) ? gr->gr_name : "UNKNOWN"; - printf(" " "Interface %u Access: %s:%s 0%o\n", iface, owner, group, mode); + printf(" " "Interface %u Access: %s:%s 0%o\n", + iface, owner, group, mode); } else { printf(" " "Interface %u Access: \n", iface); } ==== //depot/projects/usb/src/usr.sbin/usbconfig/dump.h#5 (text+ko) ==== @@ -27,7 +27,7 @@ const char *dump_mode(uint8_t value); const char *dump_speed(uint8_t value); const char *dump_power_mode(uint8_t value); -void dump_device_info(struct libusb20_device *pdev); +void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv); void dump_be_access(struct libusb20_backend *pbe); void dump_be_quirk_names(struct libusb20_backend *pbe); void dump_be_dev_quirks(struct libusb20_backend *pbe); ==== //depot/projects/usb/src/usr.sbin/usbconfig/usbconfig.c#12 (text+ko) ==== @@ -78,6 +78,7 @@ uint8_t got_dump_all_config:1; uint8_t got_dump_info:1; uint8_t got_dump_access:1; + uint8_t got_show_iface_driver:1; uint8_t got_remove_device_quirk:1; uint8_t got_add_device_quirk:1; uint8_t got_dump_string:1; @@ -100,6 +101,7 @@ T_SET_PERM, T_ADD_DEVICE_QUIRK, T_REMOVE_DEVICE_QUIRK, + T_SHOW_IFACE_DRIVER, T_DUMP_QUIRK_NAMES, T_DUMP_DEVICE_QUIRKS, T_DUMP_DEVICE_DESC, @@ -138,6 +140,7 @@ {"dump_string", T_DUMP_STRING, 1}, {"dump_access", T_DUMP_ACCESS, 0}, {"dump_info", T_DUMP_INFO, 0}, + {"show_ifdrv", T_SHOW_IFACE_DRIVER, 0}, {"suspend", T_SUSPEND, 0}, {"resume", T_RESUME, 0}, {"power_off", T_POWER_OFF, 0}, @@ -290,6 +293,7 @@ " dump_string " "\n" " dump_access" "\n" " dump_info" "\n" + " show_ifdrv" "\n" " suspend" "\n" " resume" "\n" " power_off" "\n" @@ -535,7 +539,8 @@ opt->got_dump_access); if (opt->got_list || dump_any) { - dump_device_info(pdev); + dump_device_info(pdev, + opt->got_show_iface_driver); } if (opt->got_dump_access) { printf("\n"); @@ -632,6 +637,10 @@ opt->got_any++; break; + case T_SHOW_IFACE_DRIVER: + opt->got_show_iface_driver = 1; + break; + case T_UNIT: if (opt->got_any) { /* allow multiple commands on the same line */