diff options
Diffstat (limited to 'include')
293 files changed, 5142 insertions, 5677 deletions
diff --git a/include/asm-alpha/numnodes.h b/include/asm-alpha/numnodes.h deleted file mode 100644 index cd425827e4f..00000000000 --- a/include/asm-alpha/numnodes.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _ASM_MAX_NUMNODES_H -#define _ASM_MAX_NUMNODES_H - -/* Max 128 Nodes - Marvel */ -#define NODES_SHIFT 7 - -#endif /* _ASM_MAX_NUMNODES_H */ diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h b/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h new file mode 100644 index 00000000000..f28636d61e3 --- /dev/null +++ b/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h @@ -0,0 +1,104 @@ +/* + * include/asm-arm/arch-at91rm9200/at91rm9200_mci.h + * + * Copyright (C) 2005 Ivan Kokshaysky + * Copyright (C) SAN People + * + * MultiMedia Card Interface (MCI) registers. + * Based on AT91RM9200 datasheet revision E. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef AT91RM9200_MCI_H +#define AT91RM9200_MCI_H + +#define AT91_MCI_CR 0x00 /* Control Register */ +#define AT91_MCI_MCIEN (1 << 0) /* Multi-Media Interface Enable */ +#define AT91_MCI_MCIDIS (1 << 1) /* Multi-Media Interface Disable */ +#define AT91_MCI_PWSEN (1 << 2) /* Power Save Mode Enable */ +#define AT91_MCI_PWSDIS (1 << 3) /* Power Save Mode Disable */ +#define AT91_MCI_SWRST (1 << 7) /* Software Reset */ + +#define AT91_MCI_MR 0x04 /* Mode Register */ +#define AT91_MCI_CLKDIV (0xff << 0) /* Clock Divider */ +#define AT91_MCI_PWSDIV (3 << 8) /* Power Saving Divider */ +#define AT91_MCI_PDCPADV (1 << 14) /* PDC Padding Value */ +#define AT91_MCI_PDCMODE (1 << 15) /* PDC-orientated Mode */ +#define AT91_MCI_BLKLEN (0xfff << 18) /* Data Block Length */ + +#define AT91_MCI_DTOR 0x08 /* Data Timeout Register */ +#define AT91_MCI_DTOCYC (0xf << 0) /* Data Timeout Cycle Number */ +#define AT91_MCI_DTOMUL (7 << 4) /* Data Timeout Multiplier */ +#define AT91_MCI_DTOMUL_1 (0 << 4) +#define AT91_MCI_DTOMUL_16 (1 << 4) +#define AT91_MCI_DTOMUL_128 (2 << 4) +#define AT91_MCI_DTOMUL_256 (3 << 4) +#define AT91_MCI_DTOMUL_1K (4 << 4) +#define AT91_MCI_DTOMUL_4K (5 << 4) +#define AT91_MCI_DTOMUL_64K (6 << 4) +#define AT91_MCI_DTOMUL_1M (7 << 4) + +#define AT91_MCI_SDCR 0x0c /* SD Card Register */ +#define AT91_MCI_SDCSEL (0xf << 0) /* SD Card Selector */ +#define AT91_MCI_SDCBUS (1 << 7) /* 1-bit or 4-bit bus */ + +#define AT91_MCI_ARGR 0x10 /* Argument Register */ + +#define AT91_MCI_CMDR 0x14 /* Command Register */ +#define AT91_MCI_CMDNB (0x3f << 0) /* Command Number */ +#define AT91_MCI_RSPTYP (3 << 6) /* Response Type */ +#define AT91_MCI_RSPTYP_NONE (0 << 6) +#define AT91_MCI_RSPTYP_48 (1 << 6) +#define AT91_MCI_RSPTYP_136 (2 << 6) +#define AT91_MCI_SPCMD (7 << 8) /* Special Command */ +#define AT91_MCI_SPCMD_NONE (0 << 8) +#define AT91_MCI_SPCMD_INIT (1 << 8) +#define AT91_MCI_SPCMD_SYNC (2 << 8) +#define AT91_MCI_SPCMD_ICMD (4 << 8) +#define AT91_MCI_SPCMD_IRESP (5 << 8) +#define AT91_MCI_OPDCMD (1 << 11) /* Open Drain Command */ +#define AT91_MCI_MAXLAT (1 << 12) /* Max Latency for Command to Response */ +#define AT91_MCI_TRCMD (3 << 16) /* Transfer Command */ +#define AT91_MCI_TRCMD_NONE (0 << 16) +#define AT91_MCI_TRCMD_START (1 << 16) +#define AT91_MCI_TRCMD_STOP (2 << 16) +#define AT91_MCI_TRDIR (1 << 18) /* Transfer Direction */ +#define AT91_MCI_TRTYP (3 << 19) /* Transfer Type */ +#define AT91_MCI_TRTYP_BLOCK (0 << 19) +#define AT91_MCI_TRTYP_MULTIPLE (1 << 19) +#define AT91_MCI_TRTYP_STREAM (2 << 19) + +#define AT91_MCI_RSPR(n) (0x20 + ((n) * 4)) /* Response Registers 0-3 */ +#define AT91_MCR_RDR 0x30 /* Receive Data Register */ +#define AT91_MCR_TDR 0x34 /* Transmit Data Register */ + +#define AT91_MCI_SR 0x40 /* Status Register */ +#define AT91_MCI_CMDRDY (1 << 0) /* Command Ready */ +#define AT91_MCI_RXRDY (1 << 1) /* Receiver Ready */ +#define AT91_MCI_TXRDY (1 << 2) /* Transmit Ready */ +#define AT91_MCI_BLKE (1 << 3) /* Data Block Ended */ +#define AT91_MCI_DTIP (1 << 4) /* Data Transfer in Progress */ +#define AT91_MCI_NOTBUSY (1 << 5) /* Data Not Busy */ +#define AT91_MCI_ENDRX (1 << 6) /* End of RX Buffer */ +#define AT91_MCI_ENDTX (1 << 7) /* End fo TX Buffer */ +#define AT91_MCI_RXBUFF (1 << 14) /* RX Buffer Full */ +#define AT91_MCI_TXBUFE (1 << 15) /* TX Buffer Empty */ +#define AT91_MCI_RINDE (1 << 16) /* Response Index Error */ +#define AT91_MCI_RDIRE (1 << 17) /* Response Direction Error */ +#define AT91_MCI_RCRCE (1 << 18) /* Response CRC Error */ +#define AT91_MCI_RENDE (1 << 19) /* Response End Bit Error */ +#define AT91_MCI_RTOE (1 << 20) /* Reponse Time-out Error */ +#define AT91_MCI_DCRCE (1 << 21) /* Data CRC Error */ +#define AT91_MCI_DTOE (1 << 22) /* Data Time-out Error */ +#define AT91_MCI_OVRE (1 << 30) /* Overrun */ +#define AT91_MCI_UNRE (1 << 31) /* Underrun */ + +#define AT91_MCI_IER 0x44 /* Interrupt Enable Register */ +#define AT91_MCI_IDR 0x48 /* Interrupt Disable Register */ +#define AT91_MCI_IMR 0x4c /* Interrupt Mask Register */ + +#endif diff --git a/include/asm-arm/arch-at91rm9200/board.h b/include/asm-arm/arch-at91rm9200/board.h index 2e7d1139a79..4fdef13d01d 100644 --- a/include/asm-arm/arch-at91rm9200/board.h +++ b/include/asm-arm/arch-at91rm9200/board.h @@ -38,6 +38,8 @@ extern unsigned long at91_master_clock; extern int at91_serial_map[AT91_NR_UART]; extern int at91_console_port; +#include <linux/mtd/partitions.h> + /* USB Device */ struct at91_udc_data { u8 vbus_pin; /* high == host powering us */ @@ -77,4 +79,26 @@ struct at91_usbh_data { }; extern void __init at91_add_device_usbh(struct at91_usbh_data *data); + /* NAND / SmartMedia */ +struct at91_nand_data { + u8 enable_pin; /* chip enable */ + u8 det_pin; /* card detect */ + u8 rdy_pin; /* ready/busy */ + u8 ale; /* address line number connected to ALE */ + u8 cle; /* address line number connected to CLE */ + struct mtd_partition* (*partition_info)(int, int*); +}; +extern void __init at91_add_device_nand(struct at91_nand_data *data); + + /* I2C*/ +void __init at91_add_device_i2c(void); + + /* RTC */ +void __init at91_add_device_rtc(void); + + /* LEDs */ +extern u8 at91_leds_cpu; +extern u8 at91_leds_timer; +extern void __init at91_init_leds(u8 cpu_led, u8 timer_led); + #endif diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h index 2646c01f8e9..59e6f44d3a0 100644 --- a/include/asm-arm/arch-at91rm9200/hardware.h +++ b/include/asm-arm/arch-at91rm9200/hardware.h @@ -65,6 +65,9 @@ /* SmartMedia */ #define AT91_SMARTMEDIA_BASE 0x40000000 /* NCS3: Smartmedia physical base address */ +/* Compact Flash */ +#define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */ + /* Multi-Master Memory controller */ #define AT91_UHP_BASE 0x00300000 /* USB Host controller */ diff --git a/include/asm-arm/arch-cl7500/hardware.h b/include/asm-arm/arch-cl7500/hardware.h index 2339b764f69..1adfd18e615 100644 --- a/include/asm-arm/arch-cl7500/hardware.h +++ b/include/asm-arm/arch-cl7500/hardware.h @@ -53,16 +53,12 @@ #define SCREEN_END 0xdfc00000 #define SCREEN_BASE 0xdf800000 -#define FLUSH_BASE 0xdf000000 - #define VIDC_BASE (void __iomem *)0xe0400000 #define IOMD_BASE IOMEM(0xe0200000) #define IOC_BASE IOMEM(0xe0200000) #define FLOPPYDMA_BASE IOMEM(0xe002a000) #define PCIO_BASE IOMEM(0xe0010000) -#define FLUSH_BASE_PHYS 0x00000000 /* ROM */ - #define vidc_writel(val) __raw_writel(val, VIDC_BASE) /* in/out bias for the ISA slot region */ diff --git a/include/asm-arm/arch-cl7500/memory.h b/include/asm-arm/arch-cl7500/memory.h index 34f40a6cec3..3178140e24c 100644 --- a/include/asm-arm/arch-cl7500/memory.h +++ b/include/asm-arm/arch-cl7500/memory.h @@ -26,4 +26,10 @@ #define __virt_to_bus(x) __virt_to_phys(x) #define __bus_to_virt(x) __phys_to_virt(x) +/* + * Cache flushing area - ROM + */ +#define FLUSH_BASE_PHYS 0x00000000 +#define FLUSH_BASE 0xdf000000 + #endif diff --git a/include/asm-arm/arch-ebsa110/debug-macro.S b/include/asm-arm/arch-ebsa110/debug-macro.S index f61cadabe0e..9213bfe4831 100644 --- a/include/asm-arm/arch-ebsa110/debug-macro.S +++ b/include/asm-arm/arch-ebsa110/debug-macro.S @@ -18,4 +18,4 @@ #define UART_SHIFT 2 #define FLOW_CONTROL -#include <asm/hardware/debug-8250.h> +#include <asm/hardware/debug-8250.S> diff --git a/include/asm-arm/arch-ebsa110/hardware.h b/include/asm-arm/arch-ebsa110/hardware.h index 4e41c2358f4..3ce864def41 100644 --- a/include/asm-arm/arch-ebsa110/hardware.h +++ b/include/asm-arm/arch-ebsa110/hardware.h @@ -57,9 +57,6 @@ /* * RAM definitions */ -#define FLUSH_BASE_PHYS 0x40000000 -#define FLUSH_BASE 0xdf000000 - #define UNCACHEABLE_ADDR 0xff000000 /* IRQ_STAT */ #endif diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h index 02f144520c1..c7c500e176d 100644 --- a/include/asm-arm/arch-ebsa110/memory.h +++ b/include/asm-arm/arch-ebsa110/memory.h @@ -28,4 +28,10 @@ #define __virt_to_bus(x) (x) #define __bus_to_virt(x) (x) +/* + * Cache flushing area - SRAM + */ +#define FLUSH_BASE_PHYS 0x40000000 +#define FLUSH_BASE 0xdf000000 + #endif diff --git a/include/asm-arm/arch-ebsa110/uncompress.h b/include/asm-arm/arch-ebsa110/uncompress.h index 66b19c7fd90..ae5b775eb0b 100644 --- a/include/asm-arm/arch-ebsa110/uncompress.h +++ b/include/asm-arm/arch-ebsa110/uncompress.h @@ -10,7 +10,7 @@ #include <linux/serial_reg.h> -#define SERIAL_BASE ((unsigned char *)0xfe000be0) +#define SERIAL_BASE ((unsigned char *)0xf0000be0) /* * This does not append a newline diff --git a/include/asm-arm/arch-ebsa285/hardware.h b/include/asm-arm/arch-ebsa285/hardware.h index 2ef2200f108..ec51fe92483 100644 --- a/include/asm-arm/arch-ebsa285/hardware.h +++ b/include/asm-arm/arch-ebsa285/hardware.h @@ -48,9 +48,6 @@ #define PCICFG0_SIZE 0x01000000 #define PCICFG0_BASE 0xfa000000 -#define FLUSH_SIZE 0x00100000 -#define FLUSH_BASE 0xf9000000 - #define PCIMEM_SIZE 0x01000000 #define PCIMEM_BASE 0xf0000000 @@ -61,9 +58,6 @@ #define PCIMEM_SIZE 0x80000000 #define PCIMEM_BASE 0x80000000 -#define FLUSH_SIZE 0x00100000 -#define FLUSH_BASE 0x7e000000 - #define WFLUSH_SIZE 0x01000000 #define WFLUSH_BASE 0x7d000000 @@ -94,7 +88,6 @@ #define XBUS_SWITCH_J17_11 ((*XBUS_SWITCH) & (1 << 5)) #define XBUS_SWITCH_J17_9 ((*XBUS_SWITCH) & (1 << 6)) -#define FLUSH_BASE_PHYS 0x50000000 #define UNCACHEABLE_ADDR (ARMCSR_BASE + 0x108) diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h index 09e335cd687..99181ffc7e2 100644 --- a/include/asm-arm/arch-ebsa285/memory.h +++ b/include/asm-arm/arch-ebsa285/memory.h @@ -49,12 +49,22 @@ extern unsigned long __bus_to_virt(unsigned long); #define TASK_SIZE UL(0xbf000000) #define PAGE_OFFSET UL(0xc0000000) +/* + * Cache flushing area. + */ +#define FLUSH_BASE 0xf9000000 + #elif defined(CONFIG_ARCH_CO285) /* Task size and page offset at 1.5GB */ #define TASK_SIZE UL(0x5f000000) #define PAGE_OFFSET UL(0x60000000) +/* + * Cache flushing area. + */ +#define FLUSH_BASE 0x7e000000 + #else #error "Undefined footbridge architecture" @@ -72,4 +82,6 @@ extern unsigned long __bus_to_virt(unsigned long); */ #define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3) +#define FLUSH_BASE_PHYS 0x50000000 + #endif diff --git a/include/asm-arm/arch-ep93xx/ts72xx.h b/include/asm-arm/arch-ep93xx/ts72xx.h index 412215e77f4..a94f63ff053 100644 --- a/include/asm-arm/arch-ep93xx/ts72xx.h +++ b/include/asm-arm/arch-ep93xx/ts72xx.h @@ -12,6 +12,8 @@ * febfc000 [67]0000000 4K NAND data register * febfb000 [67]0400000 4K NAND control register * febfa000 [67]0800000 4K NAND busy register + * febf9000 10800000 4K TS-5620 RTC index register + * febf8000 11700000 4K TS-5620 RTC data register */ #define TS72XX_MODEL_PHYS_BASE 0x22000000 @@ -58,6 +60,15 @@ #define TS72XX_NAND_BUSY_SIZE 0x00001000 +#define TS72XX_RTC_INDEX_VIRT_BASE 0xfebf9000 +#define TS72XX_RTC_INDEX_PHYS_BASE 0x10800000 +#define TS72XX_RTC_INDEX_SIZE 0x00001000 + +#define TS72XX_RTC_DATA_VIRT_BASE 0xfebf8000 +#define TS72XX_RTC_DATA_PHYS_BASE 0x11700000 +#define TS72XX_RTC_DATA_SIZE 0x00001000 + + #ifndef __ASSEMBLY__ #include <asm/io.h> diff --git a/include/asm-arm/arch-imx/dma.h b/include/asm-arm/arch-imx/dma.h index b45fa367d71..621ff2c730f 100644 --- a/include/asm-arm/arch-imx/dma.h +++ b/include/asm-arm/arch-imx/dma.h @@ -17,27 +17,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef __ASM_ARCH_DMA_H #define __ASM_ARCH_DMA_H -/* - * DMA registration - */ - typedef enum { DMA_PRIO_HIGH = 0, - DMA_PRIO_MEDIUM = 3, - DMA_PRIO_LOW = 6 + DMA_PRIO_MEDIUM = 1, + DMA_PRIO_LOW = 2 } imx_dma_prio; -int imx_request_dma(char *name, imx_dma_prio prio, - void (*irq_handler) (int, void *, struct pt_regs *), - void (*err_handler) (int, void *, struct pt_regs *), - void *data); - -void imx_free_dma(int dma_ch); - - #define DMA_REQ_UART3_T 2 #define DMA_REQ_UART3_R 3 #define DMA_REQ_SSI2_T 4 diff --git a/include/asm-arm/arch-imx/imx-dma.h b/include/asm-arm/arch-imx/imx-dma.h new file mode 100644 index 00000000000..f2063c1d610 --- /dev/null +++ b/include/asm-arm/arch-imx/imx-dma.h @@ -0,0 +1,90 @@ +/* + * linux/include/asm-arm/imxads/dma.h + * + * Copyright (C) 1997,1998 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <asm/dma.h> + +#ifndef __ASM_ARCH_IMX_DMA_H +#define __ASM_ARCH_IMX_DMA_H + +#define IMX_DMA_CHANNELS 11 + +/* + * struct imx_dma_channel - i.MX specific DMA extension + * @name: name specified by DMA client + * @irq_handler: client callback for end of transfer + * @err_handler: client callback for error condition + * @data: clients context data for callbacks + * @dma_mode: direction of the transfer %DMA_MODE_READ or %DMA_MODE_WRITE + * @sg: pointer to the actual read/written chunk for scatter-gather emulation + * @sgbc: counter of processed bytes in the actual read/written chunk + * @resbytes: total residual number of bytes to transfer + * (it can be lower or same as sum of SG mapped chunk sizes) + * @sgcount: number of chunks to be read/written + * + * Structure is used for IMX DMA processing. It would be probably good + * @struct dma_struct in the future for external interfacing and use + * @struct imx_dma_channel only as extension to it. + */ + +struct imx_dma_channel { + const char *name; + void (*irq_handler) (int, void *, struct pt_regs *); + void (*err_handler) (int, void *, struct pt_regs *); + void *data; + dmamode_t dma_mode; + struct scatterlist *sg; + unsigned int sgbc; + unsigned int sgcount; + unsigned int resbytes; + int dma_num; +}; + +extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS]; + + +/* The type to distinguish channel numbers parameter from ordinal int type */ +typedef int imx_dmach_t; + +int +imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address, + unsigned int dma_length, unsigned int dev_addr, dmamode_t dmamode); + +int +imx_dma_setup_sg(imx_dmach_t dma_ch, + struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length, + unsigned int dev_addr, dmamode_t dmamode); + +int +imx_dma_setup_handlers(imx_dmach_t dma_ch, + void (*irq_handler) (int, void *, struct pt_regs *), + void (*err_handler) (int, void *, struct pt_regs *), void *data); + +void imx_dma_enable(imx_dmach_t dma_ch); + +void imx_dma_disable(imx_dmach_t dma_ch); + +int imx_dma_request(imx_dmach_t dma_ch, const char *name); + +void imx_dma_free(imx_dmach_t dma_ch); + +int imx_dma_request_by_prio(imx_dmach_t *pdma_ch, const char *name, imx_dma_prio prio); + + +#endif /* _ASM_ARCH_IMX_DMA_H */ diff --git a/include/asm-arm/arch-imx/mmc.h b/include/asm-arm/arch-imx/mmc.h new file mode 100644 index 00000000000..1937151665c --- /dev/null +++ b/include/asm-arm/arch-imx/mmc.h @@ -0,0 +1,12 @@ +#ifndef ASMARM_ARCH_MMC_H +#define ASMARM_ARCH_MMC_H + +#include <linux/mmc/protocol.h> + +struct imxmmc_platform_data { + int (*card_present)(void); +}; + +extern void imx_set_mmc_info(struct imxmmc_platform_data *info); + +#endif diff --git a/include/asm-arm/arch-ixp23xx/debug-macro.S b/include/asm-arm/arch-ixp23xx/debug-macro.S index eb99fd69fd2..2b25e640247 100644 --- a/include/asm-arm/arch-ixp23xx/debug-macro.S +++ b/include/asm-arm/arch-ixp23xx/debug-macro.S @@ -17,6 +17,9 @@ tst \rx, #1 @ mmu enabled? ldreq \rx, =IXP23XX_PERIPHERAL_PHYS @ physical ldrne \rx, =IXP23XX_PERIPHERAL_VIRT @ virtual +#ifdef __ARMEB__ + orr \rx, \rx, #0x00000003 +#endif .endm #define UART_SHIFT 2 diff --git a/include/asm-arm/arch-ixp23xx/memory.h b/include/asm-arm/arch-ixp23xx/memory.h index bebcf0aa0d7..6e19f46d54d 100644 --- a/include/asm-arm/arch-ixp23xx/memory.h +++ b/include/asm-arm/arch-ixp23xx/memory.h @@ -28,6 +28,7 @@ * to an address that the kernel can use. */ #ifndef __ASSEMBLY__ +#include <asm/mach-types.h> #define __virt_to_bus(v) \ ({ unsigned int ret; \ @@ -40,6 +41,22 @@ data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \ __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); }) +/* + * Coherency support. Only supported on A2 CPUs or on A1 + * systems that have the cache coherency workaround. + */ +static inline int __ixp23xx_arch_is_coherent(void) +{ + extern unsigned int processor_id; + + if (((processor_id & 15) >= 2) || machine_is_roadrunner()) + return 1; + + return 0; +} + +#define arch_is_coherent() __ixp23xx_arch_is_coherent() + #endif diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h index f85b4685a49..e4d99060a04 100644 --- a/include/asm-arm/arch-ixp23xx/platform.h +++ b/include/asm-arm/arch-ixp23xx/platform.h @@ -22,6 +22,7 @@ void ixp23xx_sys_init(void); int ixp23xx_pci_setup(int, struct pci_sys_data *); void ixp23xx_pci_preinit(void); struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); +void ixp23xx_pci_slave_init(void); extern struct sys_timer ixp23xx_timer; diff --git a/include/asm-arm/arch-ixp23xx/uncompress.h b/include/asm-arm/arch-ixp23xx/uncompress.h index 62623fa9b2f..013575e6a9a 100644 --- a/include/asm-arm/arch-ixp23xx/uncompress.h +++ b/include/asm-arm/arch-ixp23xx/uncompress.h @@ -16,26 +16,21 @@ #define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS) -static __inline__ void putc(char c) +static inline void putc(char c) { int j; for (j = 0; j < 0x1000; j++) { if (UART_BASE[UART_LSR] & UART_LSR_THRE) break; + barrier(); } UART_BASE[UART_TX] = c; } -static void putstr(const char *s) +static inline void flush(void) { - while (*s) { - putc(*s); - if (*s == '\n') - putc('\r'); - s++; - } } #define arch_decomp_setup() diff --git a/include/asm-arm/arch-l7200/hardware.h b/include/asm-arm/arch-l7200/hardware.h index b755079befa..2ab43f3a4a8 100644 --- a/include/asm-arm/arch-l7200/hardware.h +++ b/include/asm-arm/arch-l7200/hardware.h @@ -52,9 +52,6 @@ #define ISA_SIZE 0x20000000 #define ISA_BASE 0xe0000000 -#define FLUSH_BASE_PHYS 0x40000000 /* ROM */ -#define FLUSH_BASE 0xdf000000 - #define PCIO_BASE IO_BASE #endif diff --git a/include/asm-arm/arch-l7200/memory.h b/include/asm-arm/arch-l7200/memory.h index 9e50a171f78..402df637e74 100644 --- a/include/asm-arm/arch-l7200/memory.h +++ b/include/asm-arm/arch-l7200/memory.h @@ -20,4 +20,10 @@ #define __virt_to_bus(x) __virt_to_phys(x) #define __bus_to_virt(x) __phys_to_virt(x) +/* + * Cache flushing area - ROM + */ +#define FLUSH_BASE_PHYS 0x40000000 +#define FLUSH_BASE 0xdf000000 + #endif diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h index c92bcb83762..9f1a58cbf40 100644 --- a/include/asm-arm/arch-lh7a40x/memory.h +++ b/include/asm-arm/arch-lh7a40x/memory.h @@ -31,8 +31,6 @@ #ifdef CONFIG_DISCONTIGMEM -#define NODES_SHIFT 4 /* Up to 16 nodes */ - /* * Given a kernel address, find the home node of the underlying memory. */ diff --git a/include/asm-arm/arch-omap/aic23.h b/include/asm-arm/arch-omap/aic23.h index 590bac25b7c..6513065941d 100644 --- a/include/asm-arm/arch-omap/aic23.h +++ b/include/asm-arm/arch-omap/aic23.h @@ -57,6 +57,7 @@ #define LHV_MIN 0x0000 // Analog audio path control register +#define STA_REG(x) ((x)<<6) #define STE_ENABLED 0x0020 #define DAC_SELECTED 0x0010 #define BYPASS_ON 0x0008 @@ -109,4 +110,7 @@ #define TLV320AIC23ID1 (0x1a) // cs low #define TLV320AIC23ID2 (0x1b) // cs high +void tlv320aic23_power_up(void); +void tlv320aic23_power_down(void); + #endif /* __ASM_ARCH_AIC23_H */ diff --git a/include/asm-arm/arch-omap/board-ams-delta.h b/include/asm-arm/arch-omap/board-ams-delta.h new file mode 100644 index 00000000000..0070f6d3b75 --- /dev/null +++ b/include/asm-arm/arch-omap/board-ams-delta.h @@ -0,0 +1,65 @@ +/* + * linux/include/asm-arm/arch-omap/board-ams-delta.h + * + * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef __ASM_ARCH_OMAP_AMS_DELTA_H +#define __ASM_ARCH_OMAP_AMS_DELTA_H + +#if defined (CONFIG_MACH_AMS_DELTA) + +#define AMS_DELTA_LATCH1_PHYS 0x01000000 +#define AMS_DELTA_LATCH1_VIRT 0xEA000000 +#define AMS_DELTA_MODEM_PHYS 0x04000000 +#define AMS_DELTA_MODEM_VIRT 0xEB000000 +#define AMS_DELTA_LATCH2_PHYS 0x08000000 +#define AMS_DELTA_LATCH2_VIRT 0xEC000000 + +#define AMS_DELTA_LATCH1_LED_CAMERA 0x01 +#define AMS_DELTA_LATCH1_LED_ADVERT 0x02 +#define AMS_DELTA_LATCH1_LED_EMAIL 0x04 +#define AMS_DELTA_LATCH1_LED_HANDSFREE 0x08 +#define AMS_DELTA_LATCH1_LED_VOICEMAIL 0x10 +#define AMS_DELTA_LATCH1_LED_VOICE 0x20 + +#define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001 +#define AMS_DELTA_LATCH2_LCD_NDISP 0x0002 +#define AMS_DELTA_LATCH2_NAND_NCE 0x0004 +#define AMS_DELTA_LATCH2_NAND_NRE 0x0008 +#define AMS_DELTA_LATCH2_NAND_NWP 0x0010 +#define AMS_DELTA_LATCH2_NAND_NWE 0x0020 +#define AMS_DELTA_LATCH2_NAND_ALE 0x0040 +#define AMS_DELTA_LATCH2_NAND_CLE 0x0080 +#define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000 +#define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000 + +#define AMS_DELTA_GPIO_PIN_NAND_RB 12 + +#ifndef __ASSEMBLY__ +void ams_delta_latch1_write(u8 mask, u8 value); +void ams_delta_latch2_write(u16 mask, u16 value); +#endif + +#endif /* CONFIG_MACH_AMS_DELTA */ + +#endif /* __ASM_ARCH_OMAP_AMS_DELTA_H */ diff --git a/include/asm-arm/arch-omap/board-apollon.h b/include/asm-arm/arch-omap/board-apollon.h new file mode 100644 index 00000000000..de0c5b792c5 --- /dev/null +++ b/include/asm-arm/arch-omap/board-apollon.h @@ -0,0 +1,45 @@ +/* + * linux/include/asm-arm/arch-omap/board-apollon.h + * + * Hardware definitions for Samsung OMAP24XX Apollon board. + * + * Initial creation by Kyungmin Park <kyungmin.park@samsung.com> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __ASM_ARCH_OMAP_APOLLON_H +#define __ASM_ARCH_OMAP_APOLLON_H + +/* Placeholder for APOLLON specific defines */ +/* GPMC CS0 */ +#define APOLLON_CS0_BASE 0x00000000 +/* GPMC CS1 */ +#define APOLLON_CS1_BASE 0x08000000 +#define APOLLON_ETHR_START (APOLLON_CS1_BASE + 0x300) +#define APOLLON_ETHR_GPIO_IRQ 74 +/* GPMC CS2 - reserved for OneNAND */ +#define APOLLON_CS2_BASE 0x10000000 +/* GPMC CS3 - reserved for NOR or NAND */ +#define APOLLON_CS3_BASE 0x18000000 + +#endif /* __ASM_ARCH_OMAP_APOLLON_H */ + diff --git a/include/asm-arm/arch-omap/board-h2.h b/include/asm-arm/arch-omap/board-h2.h index 39ca5a31aee..b2888ef9e9b 100644 --- a/include/asm-arm/arch-omap/board-h2.h +++ b/include/asm-arm/arch-omap/board-h2.h @@ -34,9 +34,5 @@ /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ #define OMAP1610_ETHR_START 0x04000300 -/* Samsung NAND flash at CS2B or CS3(NAND Boot) */ -#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ -#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ - #endif /* __ASM_ARCH_OMAP_H2_H */ diff --git a/include/asm-arm/arch-omap/board-h3.h b/include/asm-arm/arch-omap/board-h3.h index 1b12c1dcc2f..761ea0a1789 100644 --- a/include/asm-arm/arch-omap/board-h3.h +++ b/include/asm-arm/arch-omap/board-h3.h @@ -30,10 +30,6 @@ /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ #define OMAP1710_ETHR_START 0x04000300 -/* Samsung NAND flash at CS2B or CS3(NAND Boot) */ -#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ -#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ - #define MAXIRQNUM (IH_BOARD_BASE) #define MAXFIQNUM MAXIRQNUM #define MAXSWINUM MAXIRQNUM diff --git a/include/asm-arm/arch-omap/board-h4.h b/include/asm-arm/arch-omap/board-h4.h index 33ea29a4165..7ef664bc9e3 100644 --- a/include/asm-arm/arch-omap/board-h4.h +++ b/include/asm-arm/arch-omap/board-h4.h @@ -33,12 +33,6 @@ /* GPMC CS1 */ #define OMAP24XX_ETHR_START 0x08000300 #define OMAP24XX_ETHR_GPIO_IRQ 92 - -#define H4_CS0_BASE 0x04000000 - -#define H4_CS0_BASE 0x04000000 - -#define H4_CS0_BASE 0x04000000 - +#define H4_CS0_BASE 0x04000000 #endif /* __ASM_ARCH_OMAP_H4_H */ diff --git a/include/asm-arm/arch-omap/board-netstar.h b/include/asm-arm/arch-omap/board-netstar.h deleted file mode 100644 index 77cc0fb54d5..00000000000 --- a/include/asm-arm/arch-omap/board-netstar.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz> - * - * Hardware definitions for OMAP5910 based NetStar board. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __ASM_ARCH_NETSTAR_H -#define __ASM_ARCH_NETSTAR_H - -#include <asm/arch/tc.h> - -#define OMAP_NAND_FLASH_START1 OMAP_CS1_PHYS + (1 << 23) -#define OMAP_NAND_FLASH_START2 OMAP_CS1_PHYS + (2 << 23) - -#endif /* __ASM_ARCH_NETSTAR_H */ diff --git a/include/asm-arm/arch-omap/board-nokia.h b/include/asm-arm/arch-omap/board-nokia.h new file mode 100644 index 00000000000..72deea20349 --- /dev/null +++ b/include/asm-arm/arch-omap/board-nokia.h @@ -0,0 +1,54 @@ +/* + * linux/include/asm-arm/arch-omap/board-nokia.h + * + * Information structures for Nokia-specific board config data + * + * Copyright (C) 2005 Nokia Corporation + */ + +#ifndef _OMAP_BOARD_NOKIA_H +#define _OMAP_BOARD_NOKIA_H + +#include <linux/types.h> + +#define OMAP_TAG_NOKIA_BT 0x4e01 +#define OMAP_TAG_WLAN_CX3110X 0x4e02 +#define OMAP_TAG_CBUS 0x4e03 +#define OMAP_TAG_EM_ASIC_BB5 0x4e04 + + +#define BT_CHIP_CSR 1 +#define BT_CHIP_TI 2 + +#define BT_SYSCLK_12 1 +#define BT_SYSCLK_38_4 2 + +struct omap_bluetooth_config { + u8 chip_type; + u8 bt_wakeup_gpio; + u8 host_wakeup_gpio; + u8 reset_gpio; + u8 bt_uart; + u8 bd_addr[6]; + u8 bt_sysclk; +}; + +struct omap_wlan_cx3110x_config { + u8 chip_type; + s16 power_gpio; + s16 irq_gpio; + s16 spi_cs_gpio; +}; + +struct omap_cbus_config { + s16 clk_gpio; + s16 dat_gpio; + s16 sel_gpio; +}; + +struct omap_em_asic_bb5_config { + s16 retu_irq_gpio; + s16 tahvo_irq_gpio; +}; + +#endif diff --git a/include/asm-arm/arch-omap/board-perseus2.h b/include/asm-arm/arch-omap/board-perseus2.h index 691e52a52b4..eb74420cb43 100644 --- a/include/asm-arm/arch-omap/board-perseus2.h +++ b/include/asm-arm/arch-omap/board-perseus2.h @@ -42,8 +42,4 @@ #define NR_IRQS (MAXIRQNUM + 1) -/* Samsung NAND flash at CS2B or CS3(NAND Boot) */ -#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ -#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ - #endif diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h index a0040cd8663..6d6240a4681 100644 --- a/include/asm-arm/arch-omap/board.h +++ b/include/asm-arm/arch-omap/board.h @@ -21,9 +21,12 @@ #define OMAP_TAG_LCD 0x4f05 #define OMAP_TAG_GPIO_SWITCH 0x4f06 #define OMAP_TAG_UART 0x4f07 +#define OMAP_TAG_FBMEM 0x4f08 +#define OMAP_TAG_STI_CONSOLE 0x4f09 #define OMAP_TAG_BOOT_REASON 0x4f80 #define OMAP_TAG_FLASH_PART 0x4f81 +#define OMAP_TAG_VERSION_STR 0x4f82 struct omap_clock_config { /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */ @@ -54,6 +57,11 @@ struct omap_serial_console_config { u32 console_speed; }; +struct omap_sti_console_config { + unsigned enable:1; + u8 channel; +}; + struct omap_usb_config { /* Configure drivers according to the connectors on your board: * - "A" connector (rectagular) @@ -87,6 +95,13 @@ struct omap_lcd_config { char ctrl_name[16]; }; +struct omap_fbmem_config { + u32 fb_sram_start; + u32 fb_sram_size; + u32 fb_sdram_start; + u32 fb_sdram_size; +}; + /* Cover: * high -> closed * low -> open @@ -106,6 +121,12 @@ struct omap_gpio_switch_config { int key_code:24; /* Linux key code */ }; +struct omap_uart_config { + /* Bit field of UARTs present; bit 0 --> UART1 */ + unsigned int enabled_uarts; +}; + + struct omap_flash_part_config { char part_table[0]; }; @@ -114,11 +135,14 @@ struct omap_boot_reason_config { char reason_str[12]; }; -struct omap_uart_config { - /* Bit field of UARTs present; bit 0 --> UART1 */ - unsigned int enabled_uarts; +struct omap_version_config { + char component[12]; + char version[12]; }; + +#include <asm-arm/arch-omap/board-nokia.h> + struct omap_board_config_entry { u16 tag; u16 len; diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h index 46a0402696d..3c4eb9fbe48 100644 --- a/include/asm-arm/arch-omap/clock.h +++ b/include/asm-arm/arch-omap/clock.h @@ -19,6 +19,7 @@ struct clk { struct list_head node; struct module *owner; const char *name; + int id; struct clk *parent; unsigned long rate; __u32 flags; @@ -57,6 +58,7 @@ extern void propagate_rate(struct clk *clk); extern void followparent_recalc(struct clk * clk); extern void clk_allow_idle(struct clk *clk); extern void clk_deny_idle(struct clk *clk); +extern int clk_get_usecount(struct clk *clk); /* Clock flags */ #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ @@ -80,10 +82,11 @@ extern void clk_deny_idle(struct clk *clk); #define CM_PLL_SEL1 (1 << 18) #define CM_PLL_SEL2 (1 << 19) #define CM_SYSCLKOUT_SEL1 (1 << 20) -#define CLOCK_IN_OMAP730 (1 << 21) -#define CLOCK_IN_OMAP1510 (1 << 22) -#define CLOCK_IN_OMAP16XX (1 << 23) -#define CLOCK_IN_OMAP242X (1 << 24) -#define CLOCK_IN_OMAP243X (1 << 25) +#define CLOCK_IN_OMAP310 (1 << 21) +#define CLOCK_IN_OMAP730 (1 << 22) +#define CLOCK_IN_OMAP1510 (1 << 23) +#define CLOCK_IN_OMAP16XX (1 << 24) +#define CLOCK_IN_OMAP242X (1 << 25) +#define CLOCK_IN_OMAP243X (1 << 26) #endif diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h index d4e73efcb81..ca1202312a4 100644 --- a/include/asm-arm/arch-omap/dma.h +++ b/include/asm-arm/arch-omap/dma.h @@ -404,6 +404,7 @@ extern void omap_free_lcd_dma(void); extern void omap_setup_lcd_dma(void); extern void omap_enable_lcd_dma(void); extern void omap_stop_lcd_dma(void); +extern int omap_lcd_dma_ext_running(void); extern void omap_set_lcd_dma_ext_controller(int external); extern void omap_set_lcd_dma_single_transfer(int single); extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres, diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h index 11772c792f3..e6522e6a383 100644 --- a/include/asm-arm/arch-omap/dmtimer.h +++ b/include/asm-arm/arch-omap/dmtimer.h @@ -88,5 +88,6 @@ unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer); void omap_dm_timer_reset_counter(struct omap_dm_timer *timer); int omap_dm_timers_active(void); +u32 omap_dm_timer_modify_idlect_mask(u32 inputmask); #endif /* __ASM_ARCH_TIMER_H */ diff --git a/include/asm-arm/arch-omap/dsp.h b/include/asm-arm/arch-omap/dsp.h index 57bf4f39ca5..06dad83dd41 100644 --- a/include/asm-arm/arch-omap/dsp.h +++ b/include/asm-arm/arch-omap/dsp.h @@ -181,10 +181,16 @@ struct omap_dsp_varinfo { #define OMAP_DSP_MBCMD_PM_ENABLE 0x01 #define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00 +#define OMAP_DSP_MBCMD_KFUNC_AUDIO_PWR 0x01 +#define OMAP_DSP_MBCMD_FBCTL_UPD 0x0000 #define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002 #define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003 +#define OMAP_DSP_MBCMD_AUDIO_PWR_UP 0x0000 +#define OMAP_DSP_MBCMD_AUDIO_PWR_DOWN1 0x0001 +#define OMAP_DSP_MBCMD_AUDIO_PWR_DOWN2 0x0002 + #define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000 #define OMAP_DSP_MBCMD_TDEL_KILL 0x0001 diff --git a/include/asm-arm/arch-omap/dsp_common.h b/include/asm-arm/arch-omap/dsp_common.h index 4fcce694405..16a459dfa71 100644 --- a/include/asm-arm/arch-omap/dsp_common.h +++ b/include/asm-arm/arch-omap/dsp_common.h @@ -27,11 +27,12 @@ #ifndef ASM_ARCH_DSP_COMMON_H #define ASM_ARCH_DSP_COMMON_H -void omap_dsp_pm_suspend(void); -void omap_dsp_pm_resume(void); -void omap_dsp_request_mpui(void); -void omap_dsp_release_mpui(void); -int omap_dsp_request_mem(void); -int omap_dsp_release_mem(void); +extern void omap_dsp_request_mpui(void); +extern void omap_dsp_release_mpui(void); +extern int omap_dsp_request_mem(void); +extern int omap_dsp_release_mem(void); + +extern void (*omap_dsp_audio_pwr_up_request)(int stage); +extern void (*omap_dsp_audio_pwr_down_request)(int stage); #endif /* ASM_ARCH_DSP_COMMON_H */ diff --git a/include/asm-arm/arch-omap/gpioexpander.h b/include/asm-arm/arch-omap/gpioexpander.h new file mode 100644 index 00000000000..7a43b0a912e --- /dev/null +++ b/include/asm-arm/arch-omap/gpioexpander.h @@ -0,0 +1,24 @@ +/* + * linux/include/asm-arm/arch-omap/gpioexpander.h + * + * + * Copyright (C) 2004 Texas Instruments, Inc. + * + * This package is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef __ASM_ARCH_OMAP_GPIOEXPANDER_H +#define __ASM_ARCH_OMAP_GPIOEXPANDER_H + +/* Function Prototypes for GPIO Expander functions */ + +int read_gpio_expa(u8 *, int); +int write_gpio_expa(u8 , int); + +#endif /* __ASM_ARCH_OMAP_GPIOEXPANDER_H */ diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h index 5406b875c42..7909b729826 100644 --- a/include/asm-arm/arch-omap/hardware.h +++ b/include/asm-arm/arch-omap/hardware.h @@ -306,6 +306,10 @@ #include "board-h4.h" #endif +#ifdef CONFIG_MACH_OMAP_APOLLON +#include "board-apollon.h" +#endif + #ifdef CONFIG_MACH_OMAP_OSK #include "board-osk.h" #endif @@ -314,10 +318,6 @@ #include "board-voiceblue.h" #endif -#ifdef CONFIG_MACH_NETSTAR -#include "board-netstar.h" -#endif - #endif /* !__ASSEMBLER__ */ #endif /* __ASM_ARCH_OMAP_HARDWARE_H */ diff --git a/include/asm-arm/arch-omap/irda.h b/include/asm-arm/arch-omap/irda.h new file mode 100644 index 00000000000..805ae3575e4 --- /dev/null +++ b/include/asm-arm/arch-omap/irda.h @@ -0,0 +1,36 @@ +/* + * linux/include/asm-arm/arch-omap/irda.h + * + * Copyright (C) 2005-2006 Komal Shah <komal_shah802003@yahoo.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef ASMARM_ARCH_IRDA_H +#define ASMARM_ARCH_IRDA_H + +/* board specific transceiver capabilities */ + +#define IR_SEL 1 /* Selects IrDA */ +#define IR_SIRMODE 2 +#define IR_FIRMODE 4 +#define IR_MIRMODE 8 + +struct omap_irda_config { + int transceiver_cap; + int (*transceiver_mode)(struct device *dev, int mode); + int (*select_irda)(struct device *dev, int state); + /* Very specific to the needs of some platforms (h3,h4) + * having calls which can sleep in irda_set_speed. + */ + struct work_struct gpio_expa; + int rx_channel; + int tx_channel; + unsigned long dest_start; + unsigned long src_start; + int tx_trigger; + int rx_trigger; +}; + +#endif diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h index 4ffce1d7775..42098d99f30 100644 --- a/include/asm-arm/arch-omap/irqs.h +++ b/include/asm-arm/arch-omap/irqs.h @@ -242,6 +242,11 @@ #define INT_24XX_GPIO_BANK2 30 #define INT_24XX_GPIO_BANK3 31 #define INT_24XX_GPIO_BANK4 32 +#define INT_24XX_MCBSP1_IRQ_TX 59 +#define INT_24XX_MCBSP1_IRQ_RX 60 +#define INT_24XX_MCBSP2_IRQ_TX 62 +#define INT_24XX_MCBSP2_IRQ_RX 63 +#define INT_24XX_UART3_IRQ 74 /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and * 16 MPUIO lines */ diff --git a/include/asm-arm/arch-omap/keypad.h b/include/asm-arm/arch-omap/keypad.h new file mode 100644 index 00000000000..8a023a984ac --- /dev/null +++ b/include/asm-arm/arch-omap/keypad.h @@ -0,0 +1,36 @@ +/* + * linux/include/asm-arm/arch-omap/keypad.h + * + * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef ASMARM_ARCH_KEYPAD_H +#define ASMARM_ARCH_KEYPAD_H + +struct omap_kp_platform_data { + int rows; + int cols; + int *keymap; + unsigned int rep:1; + /* specific to OMAP242x*/ + unsigned int *row_gpios; + unsigned int *col_gpios; +}; + +/* Group (0..3) -- when multiple keys are pressed, only the + * keys pressed in the same group are considered as pressed. This is + * in order to workaround certain crappy HW designs that produce ghost + * keypresses. */ +#define GROUP_0 (0 << 16) +#define GROUP_1 (1 << 16) +#define GROUP_2 (2 << 16) +#define GROUP_3 (3 << 16) +#define GROUP_MASK GROUP_3 + +#define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val)) + +#endif + diff --git a/include/asm-arm/arch-omap/lcd_lph8923.h b/include/asm-arm/arch-omap/lcd_lph8923.h new file mode 100644 index 00000000000..004e67e22ca --- /dev/null +++ b/include/asm-arm/arch-omap/lcd_lph8923.h @@ -0,0 +1,14 @@ +#ifndef __LCD_LPH8923_H +#define __LCD_LPH8923_H + +enum lcd_lph8923_test_num { + LCD_LPH8923_TEST_RGB_LINES, +}; + +enum lcd_lph8923_test_result { + LCD_LPH8923_TEST_SUCCESS, + LCD_LPH8923_TEST_INVALID, + LCD_LPH8923_TEST_FAILED, +}; + +#endif diff --git a/include/asm-arm/arch-omap/mcbsp.h b/include/asm-arm/arch-omap/mcbsp.h index e79d98ab2ab..ed0dde4f721 100644 --- a/include/asm-arm/arch-omap/mcbsp.h +++ b/include/asm-arm/arch-omap/mcbsp.h @@ -37,6 +37,11 @@ #define OMAP1610_MCBSP2_BASE 0xfffb1000 #define OMAP1610_MCBSP3_BASE 0xe1017000 +#define OMAP24XX_MCBSP1_BASE 0x48074000 +#define OMAP24XX_MCBSP2_BASE 0x48076000 + +#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) + #define OMAP_MCBSP_REG_DRR2 0x00 #define OMAP_MCBSP_REG_DRR1 0x02 #define OMAP_MCBSP_REG_DXR2 0x04 @@ -71,9 +76,62 @@ #define OMAP_MAX_MCBSP_COUNT 3 +#define AUDIO_MCBSP_DATAWRITE (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1) +#define AUDIO_MCBSP_DATAREAD (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1) + +#define AUDIO_MCBSP OMAP_MCBSP1 +#define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX +#define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX + +#elif defined(CONFIG_ARCH_OMAP24XX) + +#define OMAP_MCBSP_REG_DRR2 0x00 +#define OMAP_MCBSP_REG_DRR1 0x04 +#define OMAP_MCBSP_REG_DXR2 0x08 +#define OMAP_MCBSP_REG_DXR1 0x0C +#define OMAP_MCBSP_REG_SPCR2 0x10 +#define OMAP_MCBSP_REG_SPCR1 0x14 +#define OMAP_MCBSP_REG_RCR2 0x18 +#define OMAP_MCBSP_REG_RCR1 0x1C +#define OMAP_MCBSP_REG_XCR2 0x20 +#define OMAP_MCBSP_REG_XCR1 0x24 +#define OMAP_MCBSP_REG_SRGR2 0x28 +#define OMAP_MCBSP_REG_SRGR1 0x2C +#define OMAP_MCBSP_REG_MCR2 0x30 +#define OMAP_MCBSP_REG_MCR1 0x34 +#define OMAP_MCBSP_REG_RCERA 0x38 +#define OMAP_MCBSP_REG_RCERB 0x3C +#define OMAP_MCBSP_REG_XCERA 0x40 +#define OMAP_MCBSP_REG_XCERB 0x44 +#define OMAP_MCBSP_REG_PCR0 0x48 +#define OMAP_MCBSP_REG_RCERC 0x4C +#define OMAP_MCBSP_REG_RCERD 0x50 +#define OMAP_MCBSP_REG_XCERC 0x54 +#define OMAP_MCBSP_REG_XCERD 0x58 +#define OMAP_MCBSP_REG_RCERE 0x5C +#define OMAP_MCBSP_REG_RCERF 0x60 +#define OMAP_MCBSP_REG_XCERE 0x64 +#define OMAP_MCBSP_REG_XCERF 0x68 +#define OMAP_MCBSP_REG_RCERG 0x6C +#define OMAP_MCBSP_REG_RCERH 0x70 +#define OMAP_MCBSP_REG_XCERG 0x74 +#define OMAP_MCBSP_REG_XCERH 0x78 + +#define OMAP_MAX_MCBSP_COUNT 2 + +#define AUDIO_MCBSP_DATAWRITE (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1) +#define AUDIO_MCBSP_DATAREAD (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1) + +#define AUDIO_MCBSP OMAP_MCBSP2 +#define AUDIO_DMA_TX OMAP24XX_DMA_MCBSP2_TX +#define AUDIO_DMA_RX OMAP24XX_DMA_MCBSP2_RX + +#endif + #define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg) #define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg) + /************************** McBSP SPCR1 bit definitions ***********************/ #define RRST 0x0001 #define RRDY 0x0002 @@ -195,6 +253,10 @@ typedef enum { OMAP_MCBSP3, } omap_mcbsp_id; +typedef int __bitwise omap_mcbsp_io_type_t; +#define OMAP_MCBSP_IRQ_IO ((__force omap_mcbsp_io_type_t) 1) +#define OMAP_MCBSP_POLL_IO ((__force omap_mcbsp_io_type_t) 2) + typedef enum { OMAP_MCBSP_WORD_8 = 0, OMAP_MCBSP_WORD_12, @@ -246,6 +308,9 @@ u32 omap_mcbsp_recv_word(unsigned int id); int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); +int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word); +int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word); + /* SPI specific API */ void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg); diff --git a/include/asm-arm/arch-omap/mcspi.h b/include/asm-arm/arch-omap/mcspi.h new file mode 100644 index 00000000000..9e7f40a88e1 --- /dev/null +++ b/include/asm-arm/arch-omap/mcspi.h @@ -0,0 +1,16 @@ +#ifndef _OMAP2_MCSPI_H +#define _OMAP2_MCSPI_H + +struct omap2_mcspi_platform_config { + unsigned long base; + unsigned short num_cs; +}; + +struct omap2_mcspi_device_config { + unsigned turbo_mode:1; + + /* Do we want one channel enabled at the same time? */ + unsigned single_channel:1; +}; + +#endif diff --git a/include/asm-arm/arch-omap/menelaus.h b/include/asm-arm/arch-omap/menelaus.h index 46be8b8d634..88cd4c87f0d 100644 --- a/include/asm-arm/arch-omap/menelaus.h +++ b/include/asm-arm/arch-omap/menelaus.h @@ -7,7 +7,7 @@ #ifndef __ASM_ARCH_MENELAUS_H #define __ASM_ARCH_MENELAUS_H -extern void menelaus_mmc_register(void (*callback)(u8 card_mask), +extern void menelaus_mmc_register(void (*callback)(unsigned long data, u8 card_mask), unsigned long data); extern void menelaus_mmc_remove(void); extern void menelaus_mmc_opendrain(int enable); diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h index 13415a9aab0..0dc24d4ba59 100644 --- a/include/asm-arm/arch-omap/mux.h +++ b/include/asm-arm/arch-omap/mux.h @@ -112,14 +112,13 @@ * as mux config */ #define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ - pull_reg, pull_bit, pull_status, \ - pu_pd_reg, pu_pd_status, debug_status)\ + pull_bit, pull_status, debug_status)\ { \ .name = desc, \ .debug = debug_status, \ MUX_REG_730(mux_reg, mode_offset, mode) \ PULL_REG_730(mux_reg, pull_bit, pull_status) \ - PU_PD_REG(pu_pd_reg, pu_pd_status) \ + PU_PD_REG(NA, 0) \ }, #define MUX_CFG_24XX(desc, reg_offset, mode, \ @@ -172,6 +171,11 @@ enum omap730_index { E4_730_KBC2, F4_730_KBC3, E3_730_KBC4, + + /* USB */ + AA17_730_USB_DM, + W16_730_USB_PU_EN, + W17_730_USB_VBUSI, }; enum omap1xxx_index { @@ -403,9 +407,53 @@ enum omap24xx_index { /* 24xx Menelaus interrupt */ W19_24XX_SYS_NIRQ, + /* 24xx clock */ + W14_24XX_SYS_CLKOUT, + + /* 242X McBSP */ + Y15_24XX_MCBSP2_CLKX, + R14_24XX_MCBSP2_FSX, + W15_24XX_MCBSP2_DR, + V15_24XX_MCBSP2_DX, + /* 24xx GPIO */ + M21_242X_GPIO11, + AA10_242X_GPIO13, + AA6_242X_GPIO14, + AA4_242X_GPIO15, + Y11_242X_GPIO16, + AA12_242X_GPIO17, + AA8_242X_GPIO58, Y20_24XX_GPIO60, + W4__24XX_GPIO74, M15_24XX_GPIO92, + V14_24XX_GPIO117, + + P20_24XX_TSC_IRQ, + + /* UART3 */ + K15_24XX_UART3_TX, + K14_24XX_UART3_RX, + + /* Keypad GPIO*/ + T19_24XX_KBR0, + R19_24XX_KBR1, + V18_24XX_KBR2, + M21_24XX_KBR3, + E5__24XX_KBR4, + M18_24XX_KBR5, + R20_24XX_KBC0, + M14_24XX_KBC1, + H19_24XX_KBC2, + V17_24XX_KBC3, + P21_24XX_KBC4, + L14_24XX_KBC5, + N19_24XX_KBC6, + + /* 24xx Menelaus Keypad GPIO */ + B3__24XX_KBR5, + AA4_24XX_KBC2, + B13_24XX_KBC6, }; #ifdef CONFIG_OMAP_MUX diff --git a/include/asm-arm/arch-omap/omap-alsa.h b/include/asm-arm/arch-omap/omap-alsa.h new file mode 100644 index 00000000000..df4695474e3 --- /dev/null +++ b/include/asm-arm/arch-omap/omap-alsa.h @@ -0,0 +1,124 @@ +/* + * linux/include/asm-arm/arch-omap/omap-alsa.h + * + * Alsa Driver for AIC23 and TSC2101 codecs on OMAP platform boards. + * + * Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi> + * + * Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil + * Written by Daniel Petrini, David Cohen, Anderson Briglia + * {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + * History + * ------- + * + * 2005/07/25 INdT-10LE Kernel Team - Alsa driver for omap osk, + * original version based in sa1100 driver + * and omap oss driver. + */ + +#ifndef __OMAP_ALSA_H +#define __OMAP_ALSA_H + +#include <sound/driver.h> +#include <asm/arch/dma.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <asm/arch/mcbsp.h> +#include <linux/platform_device.h> + +#define DMA_BUF_SIZE (1024 * 8) + +/* + * Buffer management for alsa and dma + */ +struct audio_stream { + char *id; /* identification string */ + int stream_id; /* numeric identification */ + int dma_dev; /* dma number of that device */ + int *lch; /* Chain of channels this stream is linked to */ + char started; /* to store if the chain was started or not */ + int dma_q_head; /* DMA Channel Q Head */ + int dma_q_tail; /* DMA Channel Q Tail */ + char dma_q_count; /* DMA Channel Q Count */ + int active:1; /* we are using this stream for transfer now */ + int period; /* current transfer period */ + int periods; /* current count of periods registerd in the DMA engine */ + spinlock_t dma_lock; /* for locking in DMA operations */ + snd_pcm_substream_t *stream; /* the pcm stream */ + unsigned linked:1; /* dma channels linked */ + int offset; /* store start position of the last period in the alsa buffer */ + int (*hw_start)(void); /* interface to start HW interface, e.g. McBSP */ + int (*hw_stop)(void); /* interface to stop HW interface, e.g. McBSP */ +}; + +/* + * Alsa card structure for aic23 + */ +struct snd_card_omap_codec { + snd_card_t *card; + snd_pcm_t *pcm; + long samplerate; + struct audio_stream s[2]; /* playback & capture */ +}; + +/* Codec specific information and function pointers. + * Codec (omap-alsa-aic23.c and omap-alsa-tsc2101.c) + * are responsible for defining the function pointers. + */ +struct omap_alsa_codec_config { + char *name; + struct omap_mcbsp_reg_cfg *mcbsp_regs_alsa; + snd_pcm_hw_constraint_list_t *hw_constraints_rates; + snd_pcm_hardware_t *snd_omap_alsa_playback; + snd_pcm_hardware_t *snd_omap_alsa_capture; + void (*codec_configure_dev)(void); + void (*codec_set_samplerate)(long); + void (*codec_clock_setup)(void); + int (*codec_clock_on)(void); + int (*codec_clock_off)(void); + int (*get_default_samplerate)(void); +}; + +/*********** Mixer function prototypes *************************/ +int snd_omap_mixer(struct snd_card_omap_codec *); +void snd_omap_init_mixer(void); + +#ifdef CONFIG_PM +void snd_omap_suspend_mixer(void); +void snd_omap_resume_mixer(void); +#endif + +int snd_omap_alsa_post_probe(struct platform_device *pdev, struct omap_alsa_codec_config *config); +int snd_omap_alsa_remove(struct platform_device *pdev); +#ifdef CONFIG_PM +int snd_omap_alsa_suspend(struct platform_device *pdev, pm_message_t state); +int snd_omap_alsa_resume(struct platform_device *pdev); +#else +#define snd_omap_alsa_suspend NULL +#define snd_omap_alsa_resume NULL +#endif + +void callback_omap_alsa_sound_dma(void *); + +#endif diff --git a/include/asm-arm/arch-omap/omapfb.h b/include/asm-arm/arch-omap/omapfb.h index 4ba2622cc14..fccdb3db025 100644 --- a/include/asm-arm/arch-omap/omapfb.h +++ b/include/asm-arm/arch-omap/omapfb.h @@ -34,9 +34,10 @@ #define OMAPFB_MIRROR OMAP_IOW(31, int) #define OMAPFB_SYNC_GFX OMAP_IO(37) #define OMAPFB_VSYNC OMAP_IO(38) -#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, enum omapfb_update_mode) +#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int) +#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(41, struct omapfb_update_window_old) #define OMAPFB_GET_CAPS OMAP_IOR(42, unsigned long) -#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, enum omapfb_update_mode) +#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int) #define OMAPFB_LCD_TEST OMAP_IOW(45, int) #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) #define OMAPFB_UPDATE_WINDOW OMAP_IOW(47, struct omapfb_update_window) @@ -66,9 +67,14 @@ enum omapfb_color_format { }; struct omapfb_update_window { - u32 x, y; - u32 width, height; - u32 format; + __u32 x, y; + __u32 width, height; + __u32 format; +}; + +struct omapfb_update_window_old { + __u32 x, y; + __u32 width, height; }; enum omapfb_plane { @@ -83,17 +89,17 @@ enum omapfb_channel_out { }; struct omapfb_setup_plane { - u8 plane; - u8 channel_out; - u32 offset; - u32 pos_x, pos_y; - u32 width, height; - u32 color_mode; + __u8 plane; + __u8 channel_out; + __u32 offset; + __u32 pos_x, pos_y; + __u32 width, height; + __u32 color_mode; }; struct omapfb_enable_plane { - u8 plane; - u8 enable; + __u8 plane; + __u8 enable; }; enum omapfb_color_key_type { @@ -103,10 +109,10 @@ enum omapfb_color_key_type { }; struct omapfb_color_key { - u8 channel_out; - u32 background; - u32 trans_key; - u8 key_type; + __u8 channel_out; + __u32 background; + __u32 trans_key; + __u8 key_type; }; enum omapfb_update_mode { @@ -120,6 +126,9 @@ enum omapfb_update_mode { #include <linux/completion.h> #include <linux/interrupt.h> #include <linux/fb.h> +#include <linux/mutex.h> + +#include <asm/arch/board.h> #define OMAP_LCDC_INV_VSYNC 0x0001 #define OMAP_LCDC_INV_HSYNC 0x0002 @@ -184,19 +193,38 @@ struct extif_timings { int re_cycle_time; int cs_pulse_width; int access_time; + + int clk_div; + + u32 tim[5]; /* set by extif->convert_timings */ + + int converted; }; struct lcd_ctrl_extif { int (*init) (void); void (*cleanup) (void); + void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div); + int (*convert_timings) (struct extif_timings *timings); void (*set_timings) (const struct extif_timings *timings); - void (*write_command) (u32 cmd); - u32 (*read_data) (void); - void (*write_data) (u32 data); + void (*set_bits_per_cycle)(int bpc); + void (*write_command) (const void *buf, unsigned int len); + void (*read_data) (void *buf, unsigned int len); + void (*write_data) (const void *buf, unsigned int len); void (*transfer_area) (int width, int height, void (callback)(void * data), void *data); + unsigned long max_transmit_size; }; +struct omapfb_notifier_block { + struct notifier_block nb; + void *data; +}; + +typedef int (*omapfb_notifier_callback_t)(struct omapfb_notifier_block *, + unsigned long event, + struct omapfb_device *fbdev); + struct lcd_ctrl { const char *name; void *data; @@ -204,9 +232,11 @@ struct lcd_ctrl { int (*init) (struct omapfb_device *fbdev, int ext_mode, int req_vram_size); void (*cleanup) (void); + void (*bind_client) (struct omapfb_notifier_block *nb); void (*get_vram_layout)(unsigned long *size, void **virt_base, dma_addr_t *phys_base); + int (*mmap) (struct vm_area_struct *vma); unsigned long (*get_caps) (void); int (*set_update_mode)(enum omapfb_update_mode mode); enum omapfb_update_mode (*get_update_mode)(void); @@ -240,7 +270,7 @@ struct omapfb_device { int state; int ext_lcdc; /* Using external LCD controller */ - struct semaphore rqueue_sema; + struct mutex rqueue_mutex; void *vram_virt_base; dma_addr_t vram_phys_base; @@ -261,12 +291,13 @@ struct omapfb_device { struct device *dev; }; -extern struct lcd_panel h3_panel; -extern struct lcd_panel h2_panel; -extern struct lcd_panel p2_panel; -extern struct lcd_panel osk_panel; -extern struct lcd_panel innovator1610_panel; -extern struct lcd_panel innovator1510_panel; +struct omapfb_platform_data { + struct omap_lcd_config lcd; + struct omap_fbmem_config fbmem; +}; + +#define OMAPFB_EVENT_READY 1 +#define OMAPFB_EVENT_DISABLED 2 #ifdef CONFIG_ARCH_OMAP1 extern struct lcd_ctrl omap1_lcd_ctrl; @@ -274,7 +305,20 @@ extern struct lcd_ctrl omap1_lcd_ctrl; extern struct lcd_ctrl omap2_disp_ctrl; #endif +extern void omapfb_register_panel(struct lcd_panel *panel); extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval); +extern void omapfb_notify_clients(struct omapfb_device *fbdev, + unsigned long event); +extern int omapfb_register_client(struct omapfb_notifier_block *nb, + omapfb_notifier_callback_t callback, + void *callback_data); +extern int omapfb_unregister_client(struct omapfb_notifier_block *nb); +extern int omapfb_update_window_async(struct omapfb_update_window *win, + void (*callback)(void *), + void *callback_data); + +/* in arch/arm/plat-omap/devices.c */ +extern void omapfb_reserve_mem(void); #endif /* __KERNEL__ */ diff --git a/include/asm-arm/arch-omap/param.h b/include/asm-arm/arch-omap/param.h new file mode 100644 index 00000000000..face9ad41e9 --- /dev/null +++ b/include/asm-arm/arch-omap/param.h @@ -0,0 +1,8 @@ +/* + * linux/include/asm-arm/arch-omap/param.h + * + */ + +#ifdef CONFIG_OMAP_32K_TIMER_HZ +#define HZ CONFIG_OMAP_32K_TIMER_HZ +#endif diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h index 7c790425e36..05b003f3a94 100644 --- a/include/asm-arm/arch-omap/pm.h +++ b/include/asm-arm/arch-omap/pm.h @@ -49,7 +49,7 @@ /* * ---------------------------------------------------------------------------- - * Powermanagement bitmasks + * Power management bitmasks * ---------------------------------------------------------------------------- */ #define IDLE_WAIT_CYCLES 0x00000fff @@ -112,32 +112,59 @@ #endif #ifndef __ASSEMBLER__ + +#include <linux/clk.h> + +extern void prevent_idle_sleep(void); +extern void allow_idle_sleep(void); + +/** + * clk_deny_idle - Prevents the clock from being idled during MPU idle + * @clk: clock signal handle + */ +void clk_deny_idle(struct clk *clk); + +/** + * clk_allow_idle - Counters previous clk_deny_idle + * @clk: clock signal handle + */ +void clk_deny_idle(struct clk *clk); + extern void omap_pm_idle(void); extern void omap_pm_suspend(void); extern void omap730_cpu_suspend(unsigned short, unsigned short); extern void omap1510_cpu_suspend(unsigned short, unsigned short); extern void omap1610_cpu_suspend(unsigned short, unsigned short); +extern void omap24xx_cpu_suspend(u32 dll_ctrl, u32 cpu_revision); extern void omap730_idle_loop_suspend(void); extern void omap1510_idle_loop_suspend(void); extern void omap1610_idle_loop_suspend(void); +extern void omap24xx_idle_loop_suspend(void); + +extern unsigned int omap730_cpu_suspend_sz; +extern unsigned int omap1510_cpu_suspend_sz; +extern unsigned int omap1610_cpu_suspend_sz; +extern unsigned int omap24xx_cpu_suspend_sz; +extern unsigned int omap730_idle_loop_suspend_sz; +extern unsigned int omap1510_idle_loop_suspend_sz; +extern unsigned int omap1610_idle_loop_suspend_sz; +extern unsigned int omap24xx_idle_loop_suspend_sz; #ifdef CONFIG_OMAP_SERIAL_WAKE extern void omap_serial_wake_trigger(int enable); #else +#define omap_serial_wakeup_init() {} #define omap_serial_wake_trigger(x) {} #endif /* CONFIG_OMAP_SERIAL_WAKE */ -extern unsigned int omap730_cpu_suspend_sz; -extern unsigned int omap730_idle_loop_suspend_sz; -extern unsigned int omap1510_cpu_suspend_sz; -extern unsigned int omap1510_idle_loop_suspend_sz; -extern unsigned int omap1610_cpu_suspend_sz; -extern unsigned int omap1610_idle_loop_suspend_sz; - #define ARM_SAVE(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] = omap_readl(x) #define ARM_RESTORE(x) omap_writel((arm_sleep_save[ARM_SLEEP_SAVE_##x]), (x)) #define ARM_SHOW(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] +#define DSP_SAVE(x) dsp_sleep_save[DSP_SLEEP_SAVE_##x] = __raw_readw(x) +#define DSP_RESTORE(x) __raw_writew((dsp_sleep_save[DSP_SLEEP_SAVE_##x]), (x)) +#define DSP_SHOW(x) dsp_sleep_save[DSP_SLEEP_SAVE_##x] + #define ULPD_SAVE(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] = omap_readw(x) #define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) #define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] @@ -154,6 +181,10 @@ extern unsigned int omap1610_idle_loop_suspend_sz; #define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) #define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] +#define OMAP24XX_SAVE(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] = x +#define OMAP24XX_RESTORE(x) x = omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] +#define OMAP24XX_SHOW(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] + /* * List of global OMAP registers to preserve. * More ones like CP and general purpose register values are preserved @@ -176,6 +207,15 @@ enum arm_save_state { ARM_SLEEP_SAVE_SIZE }; +enum dsp_save_state { + DSP_SLEEP_SAVE_START = 0, + /* + * DSP registers 16 bits + */ + DSP_SLEEP_SAVE_DSP_IDLECT2, + DSP_SLEEP_SAVE_SIZE +}; + enum ulpd_save_state { ULPD_SLEEP_SAVE_START = 0, /* @@ -254,5 +294,30 @@ enum mpui1610_save_state { #endif }; +enum omap24xx_save_state { + OMAP24XX_SLEEP_SAVE_START = 0, + OMAP24XX_SLEEP_SAVE_INTC_MIR0, + OMAP24XX_SLEEP_SAVE_INTC_MIR1, + OMAP24XX_SLEEP_SAVE_INTC_MIR2, + OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE, + OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE, + OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE, + OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE, + OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE, + OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1, + OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1, + OMAP24XX_SLEEP_SAVE_GPIO3_IRQENABLE1, + OMAP24XX_SLEEP_SAVE_GPIO4_IRQENABLE1, + OMAP24XX_SLEEP_SAVE_GPIO3_OE, + OMAP24XX_SLEEP_SAVE_GPIO4_OE, + OMAP24XX_SLEEP_SAVE_GPIO3_RISINGDETECT, + OMAP24XX_SLEEP_SAVE_GPIO3_FALLINGDETECT, + OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SPI1_NCS2, + OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_MCBSP1_DX, + OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SSI1_FLAG_TX, + OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SYS_NIRQW0, + OMAP24XX_SLEEP_SAVE_SIZE +}; + #endif /* ASSEMBLER */ #endif /* __ASM_ARCH_OMAP_PM_H */ diff --git a/include/asm-arm/arch-omap/prcm.h b/include/asm-arm/arch-omap/prcm.h index 7b48a5cbb15..7bcaf94bde9 100644 --- a/include/asm-arm/arch-omap/prcm.h +++ b/include/asm-arm/arch-omap/prcm.h @@ -1,5 +1,7 @@ /* - * prcm.h - Access definations for use in OMAP24XX clock and power management + * linux/include/asm-arm/arch-omap/prcm.h + * + * Access definations for use in OMAP24XX clock and power management * * Copyright (C) 2005 Texas Instruments, Inc. * @@ -21,405 +23,7 @@ #ifndef __ASM_ARM_ARCH_DPM_PRCM_H #define __ASM_ARM_ARCH_DPM_PRCM_H -/* SET_PERFORMANCE_LEVEL PARAMETERS */ -#define PRCM_HALF_SPEED 1 -#define PRCM_FULL_SPEED 2 - -#ifndef __ASSEMBLER__ - -#define PRCM_REG32(offset) __REG32(OMAP24XX_PRCM_BASE + (offset)) - -#define PRCM_REVISION PRCM_REG32(0x000) -#define PRCM_SYSCONFIG PRCM_REG32(0x010) -#define PRCM_IRQSTATUS_MPU PRCM_REG32(0x018) -#define PRCM_IRQENABLE_MPU PRCM_REG32(0x01C) -#define PRCM_VOLTCTRL PRCM_REG32(0x050) -#define PRCM_VOLTST PRCM_REG32(0x054) -#define PRCM_CLKSRC_CTRL PRCM_REG32(0x060) -#define PRCM_CLKOUT_CTRL PRCM_REG32(0x070) -#define PRCM_CLKEMUL_CTRL PRCM_REG32(0x078) -#define PRCM_CLKCFG_CTRL PRCM_REG32(0x080) -#define PRCM_CLKCFG_STATUS PRCM_REG32(0x084) -#define PRCM_VOLTSETUP PRCM_REG32(0x090) -#define PRCM_CLKSSETUP PRCM_REG32(0x094) -#define PRCM_POLCTRL PRCM_REG32(0x098) - -/* GENERAL PURPOSE */ -#define GENERAL_PURPOSE1 PRCM_REG32(0x0B0) -#define GENERAL_PURPOSE2 PRCM_REG32(0x0B4) -#define GENERAL_PURPOSE3 PRCM_REG32(0x0B8) -#define GENERAL_PURPOSE4 PRCM_REG32(0x0BC) -#define GENERAL_PURPOSE5 PRCM_REG32(0x0C0) -#define GENERAL_PURPOSE6 PRCM_REG32(0x0C4) -#define GENERAL_PURPOSE7 PRCM_REG32(0x0C8) -#define GENERAL_PURPOSE8 PRCM_REG32(0x0CC) -#define GENERAL_PURPOSE9 PRCM_REG32(0x0D0) -#define GENERAL_PURPOSE10 PRCM_REG32(0x0D4) -#define GENERAL_PURPOSE11 PRCM_REG32(0x0D8) -#define GENERAL_PURPOSE12 PRCM_REG32(0x0DC) -#define GENERAL_PURPOSE13 PRCM_REG32(0x0E0) -#define GENERAL_PURPOSE14 PRCM_REG32(0x0E4) -#define GENERAL_PURPOSE15 PRCM_REG32(0x0E8) -#define GENERAL_PURPOSE16 PRCM_REG32(0x0EC) -#define GENERAL_PURPOSE17 PRCM_REG32(0x0F0) -#define GENERAL_PURPOSE18 PRCM_REG32(0x0F4) -#define GENERAL_PURPOSE19 PRCM_REG32(0x0F8) -#define GENERAL_PURPOSE20 PRCM_REG32(0x0FC) - -/* MPU */ -#define CM_CLKSEL_MPU PRCM_REG32(0x140) -#define CM_CLKSTCTRL_MPU PRCM_REG32(0x148) -#define RM_RSTST_MPU PRCM_REG32(0x158) -#define PM_WKDEP_MPU PRCM_REG32(0x1C8) -#define PM_EVGENCTRL_MPU PRCM_REG32(0x1D4) -#define PM_EVEGENONTIM_MPU PRCM_REG32(0x1D8) -#define PM_EVEGENOFFTIM_MPU PRCM_REG32(0x1DC) -#define PM_PWSTCTRL_MPU PRCM_REG32(0x1E0) -#define PM_PWSTST_MPU PRCM_REG32(0x1E4) - -/* CORE */ -#define CM_FCLKEN1_CORE PRCM_REG32(0x200) -#define CM_FCLKEN2_CORE PRCM_REG32(0x204) -#define CM_FCLKEN3_CORE PRCM_REG32(0x208) -#define CM_ICLKEN1_CORE PRCM_REG32(0x210) -#define CM_ICLKEN2_CORE PRCM_REG32(0x214) -#define CM_ICLKEN3_CORE PRCM_REG32(0x218) -#define CM_ICLKEN4_CORE PRCM_REG32(0x21C) -#define CM_IDLEST1_CORE PRCM_REG32(0x220) -#define CM_IDLEST2_CORE PRCM_REG32(0x224) -#define CM_IDLEST3_CORE PRCM_REG32(0x228) -#define CM_IDLEST4_CORE PRCM_REG32(0x22C) -#define CM_AUTOIDLE1_CORE PRCM_REG32(0x230) -#define CM_AUTOIDLE2_CORE PRCM_REG32(0x234) -#define CM_AUTOIDLE3_CORE PRCM_REG32(0x238) -#define CM_AUTOIDLE4_CORE PRCM_REG32(0x23C) -#define CM_CLKSEL1_CORE PRCM_REG32(0x240) -#define CM_CLKSEL2_CORE PRCM_REG32(0x244) -#define CM_CLKSTCTRL_CORE PRCM_REG32(0x248) -#define PM_WKEN1_CORE PRCM_REG32(0x2A0) -#define PM_WKEN2_CORE PRCM_REG32(0x2A4) -#define PM_WKST1_CORE PRCM_REG32(0x2B0) -#define PM_WKST2_CORE PRCM_REG32(0x2B4) -#define PM_WKDEP_CORE PRCM_REG32(0x2C8) -#define PM_PWSTCTRL_CORE PRCM_REG32(0x2E0) -#define PM_PWSTST_CORE PRCM_REG32(0x2E4) - -/* GFX */ -#define CM_FCLKEN_GFX PRCM_REG32(0x300) -#define CM_ICLKEN_GFX PRCM_REG32(0x310) -#define CM_IDLEST_GFX PRCM_REG32(0x320) -#define CM_CLKSEL_GFX PRCM_REG32(0x340) -#define CM_CLKSTCTRL_GFX PRCM_REG32(0x348) -#define RM_RSTCTRL_GFX PRCM_REG32(0x350) -#define RM_RSTST_GFX PRCM_REG32(0x358) -#define PM_WKDEP_GFX PRCM_REG32(0x3C8) -#define PM_PWSTCTRL_GFX PRCM_REG32(0x3E0) -#define PM_PWSTST_GFX PRCM_REG32(0x3E4) - -/* WAKE-UP */ -#define CM_FCLKEN_WKUP PRCM_REG32(0x400) -#define CM_ICLKEN_WKUP PRCM_REG32(0x410) -#define CM_IDLEST_WKUP PRCM_REG32(0x420) -#define CM_AUTOIDLE_WKUP PRCM_REG32(0x430) -#define CM_CLKSEL_WKUP PRCM_REG32(0x440) -#define RM_RSTCTRL_WKUP PRCM_REG32(0x450) -#define RM_RSTTIME_WKUP PRCM_REG32(0x454) -#define RM_RSTST_WKUP PRCM_REG32(0x458) -#define PM_WKEN_WKUP PRCM_REG32(0x4A0) -#define PM_WKST_WKUP PRCM_REG32(0x4B0) - -/* CLOCKS */ -#define CM_CLKEN_PLL PRCM_REG32(0x500) -#define CM_IDLEST_CKGEN PRCM_REG32(0x520) -#define CM_AUTOIDLE_PLL PRCM_REG32(0x530) -#define CM_CLKSEL1_PLL PRCM_REG32(0x540) -#define CM_CLKSEL2_PLL PRCM_REG32(0x544) - -/* DSP */ -#define CM_FCLKEN_DSP PRCM_REG32(0x800) -#define CM_ICLKEN_DSP PRCM_REG32(0x810) -#define CM_IDLEST_DSP PRCM_REG32(0x820) -#define CM_AUTOIDLE_DSP PRCM_REG32(0x830) -#define CM_CLKSEL_DSP PRCM_REG32(0x840) -#define CM_CLKSTCTRL_DSP PRCM_REG32(0x848) -#define RM_RSTCTRL_DSP PRCM_REG32(0x850) -#define RM_RSTST_DSP PRCM_REG32(0x858) -#define PM_WKEN_DSP PRCM_REG32(0x8A0) -#define PM_WKDEP_DSP PRCM_REG32(0x8C8) -#define PM_PWSTCTRL_DSP PRCM_REG32(0x8E0) -#define PM_PWSTST_DSP PRCM_REG32(0x8E4) -#define PRCM_IRQSTATUS_DSP PRCM_REG32(0x8F0) -#define PRCM_IRQENABLE_DSP PRCM_REG32(0x8F4) - -/* IVA */ -#define PRCM_IRQSTATUS_IVA PRCM_REG32(0x8F8) -#define PRCM_IRQENABLE_IVA PRCM_REG32(0x8FC) - -/* Modem on 2430 */ -#define CM_FCLKEN_MDM PRCM_REG32(0xC00) -#define CM_ICLKEN_MDM PRCM_REG32(0xC10) -#define CM_IDLEST_MDM PRCM_REG32(0xC20) -#define CM_CLKSEL_MDM PRCM_REG32(0xC40) - -/* FIXME: Move to header for 2430 */ -#define DISP_BASE (OMAP24XX_L4_IO_BASE+0x50000) -#define DISP_REG32(offset) __REG32(DISP_BASE + (offset)) - -#define OMAP24XX_GPMC_BASE (L3_24XX_BASE + 0xa000) -#define GPMC_BASE (OMAP24XX_GPMC_BASE) -#define GPMC_REG32(offset) __REG32(GPMC_BASE + (offset)) - -#define GPT1_BASE (OMAP24XX_GPT1) -#define GPT1_REG32(offset) __REG32(GPT1_BASE + (offset)) - -/* Misc sysconfig */ -#define DISPC_SYSCONFIG DISP_REG32(0x410) -#define SPI_BASE (OMAP24XX_L4_IO_BASE+0x98000) -#define MCSPI1_SYSCONFIG __REG32(SPI_BASE + 0x10) -#define MCSPI2_SYSCONFIG __REG32(SPI_BASE+0x2000 + 0x10) - -//#define DSP_MMU_SYSCONFIG 0x5A000010 -#define CAMERA_MMU_SYSCONFIG __REG32(DISP_BASE+0x2C10) -//#define IVA_MMU_SYSCONFIG 0x5D000010 -//#define DSP_DMA_SYSCONFIG 0x00FCC02C -#define CAMERA_DMA_SYSCONFIG __REG32(DISP_BASE+0x282C) -#define SYSTEM_DMA_SYSCONFIG __REG32(DISP_BASE+0x602C) -#define GPMC_SYSCONFIG GPMC_REG32(0x010) -#define MAILBOXES_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x94010) -#define UART1_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6A054) -#define UART2_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6C054) -#define UART3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6E054) -//#define IVA_SYSCONFIG 0x5C060010 -#define SDRC_SYSCONFIG __REG32(OMAP24XX_SDRC_BASE+0x10) -#define SMS_SYSCONFIG __REG32(OMAP24XX_SMS_BASE+0x10) -#define SSI_SYSCONFIG __REG32(DISP_BASE+0x8010) -//#define VLYNQ_SYSCONFIG 0x67FFFE10 - -/* rkw - good cannidates for PM_ to start what nm was trying */ -#define OMAP24XX_GPT2 (OMAP24XX_L4_IO_BASE+0x2A000) -#define OMAP24XX_GPT3 (OMAP24XX_L4_IO_BASE+0x78000) -#define OMAP24XX_GPT4 (OMAP24XX_L4_IO_BASE+0x7A000) -#define OMAP24XX_GPT5 (OMAP24XX_L4_IO_BASE+0x7C000) -#define OMAP24XX_GPT6 (OMAP24XX_L4_IO_BASE+0x7E000) -#define OMAP24XX_GPT7 (OMAP24XX_L4_IO_BASE+0x80000) -#define OMAP24XX_GPT8 (OMAP24XX_L4_IO_BASE+0x82000) -#define OMAP24XX_GPT9 (OMAP24XX_L4_IO_BASE+0x84000) -#define OMAP24XX_GPT10 (OMAP24XX_L4_IO_BASE+0x86000) -#define OMAP24XX_GPT11 (OMAP24XX_L4_IO_BASE+0x88000) -#define OMAP24XX_GPT12 (OMAP24XX_L4_IO_BASE+0x8A000) - -#define GPTIMER1_SYSCONFIG GPT1_REG32(0x010) -#define GPTIMER2_SYSCONFIG __REG32(OMAP24XX_GPT2 + 0x10) -#define GPTIMER3_SYSCONFIG __REG32(OMAP24XX_GPT3 + 0x10) -#define GPTIMER4_SYSCONFIG __REG32(OMAP24XX_GPT4 + 0x10) -#define GPTIMER5_SYSCONFIG __REG32(OMAP24XX_GPT5 + 0x10) -#define GPTIMER6_SYSCONFIG __REG32(OMAP24XX_GPT6 + 0x10) -#define GPTIMER7_SYSCONFIG __REG32(OMAP24XX_GPT7 + 0x10) -#define GPTIMER8_SYSCONFIG __REG32(OMAP24XX_GPT8 + 0x10) -#define GPTIMER9_SYSCONFIG __REG32(OMAP24XX_GPT9 + 0x10) -#define GPTIMER10_SYSCONFIG __REG32(OMAP24XX_GPT10 + 0x10) -#define GPTIMER11_SYSCONFIG __REG32(OMAP24XX_GPT11 + 0x10) -#define GPTIMER12_SYSCONFIG __REG32(OMAP24XX_GPT12 + 0x10) - -#define GPIOX_BASE(X) (OMAP24XX_GPIO_BASE+(0x2000*((X)-1))) - -#define GPIO1_SYSCONFIG __REG32((GPIOX_BASE(1)+0x10)) -#define GPIO2_SYSCONFIG __REG32((GPIOX_BASE(2)+0x10)) -#define GPIO3_SYSCONFIG __REG32((GPIOX_BASE(3)+0x10)) -#define GPIO4_SYSCONFIG __REG32((GPIOX_BASE(4)+0x10)) - -/* GP TIMER 1 */ -#define GPTIMER1_TISTAT GPT1_REG32(0x014) -#define GPTIMER1_TISR GPT1_REG32(0x018) -#define GPTIMER1_TIER GPT1_REG32(0x01C) -#define GPTIMER1_TWER GPT1_REG32(0x020) -#define GPTIMER1_TCLR GPT1_REG32(0x024) -#define GPTIMER1_TCRR GPT1_REG32(0x028) -#define GPTIMER1_TLDR GPT1_REG32(0x02C) -#define GPTIMER1_TTGR GPT1_REG32(0x030) -#define GPTIMER1_TWPS GPT1_REG32(0x034) -#define GPTIMER1_TMAR GPT1_REG32(0x038) -#define GPTIMER1_TCAR1 GPT1_REG32(0x03C) -#define GPTIMER1_TSICR GPT1_REG32(0x040) -#define GPTIMER1_TCAR2 GPT1_REG32(0x044) - -/* rkw -- base fix up please... */ -#define GPTIMER3_TISR __REG32(OMAP24XX_L4_IO_BASE+0x78018) - -/* SDRC */ -#define SDRC_DLLA_CTRL __REG32(OMAP24XX_SDRC_BASE+0x060) -#define SDRC_DLLA_STATUS __REG32(OMAP24XX_SDRC_BASE+0x064) -#define SDRC_DLLB_CTRL __REG32(OMAP24XX_SDRC_BASE+0x068) -#define SDRC_DLLB_STATUS __REG32(OMAP24XX_SDRC_BASE+0x06C) -#define SDRC_POWER __REG32(OMAP24XX_SDRC_BASE+0x070) -#define SDRC_MR_0 __REG32(OMAP24XX_SDRC_BASE+0x084) - -/* GPIO 1 */ -#define GPIO1_BASE GPIOX_BASE(1) -#define GPIO1_REG32(offset) __REG32(GPIO1_BASE + (offset)) -#define GPIO1_IRQENABLE1 GPIO1_REG32(0x01C) -#define GPIO1_IRQSTATUS1 GPIO1_REG32(0x018) -#define GPIO1_IRQENABLE2 GPIO1_REG32(0x02C) -#define GPIO1_IRQSTATUS2 GPIO1_REG32(0x028) -#define GPIO1_WAKEUPENABLE GPIO1_REG32(0x020) -#define GPIO1_RISINGDETECT GPIO1_REG32(0x048) -#define GPIO1_DATAIN GPIO1_REG32(0x038) -#define GPIO1_OE GPIO1_REG32(0x034) -#define GPIO1_DATAOUT GPIO1_REG32(0x03C) - -/* GPIO2 */ -#define GPIO2_BASE GPIOX_BASE(2) -#define GPIO2_REG32(offset) __REG32(GPIO2_BASE + (offset)) -#define GPIO2_IRQENABLE1 GPIO2_REG32(0x01C) -#define GPIO2_IRQSTATUS1 GPIO2_REG32(0x018) -#define GPIO2_IRQENABLE2 GPIO2_REG32(0x02C) -#define GPIO2_IRQSTATUS2 GPIO2_REG32(0x028) -#define GPIO2_WAKEUPENABLE GPIO2_REG32(0x020) -#define GPIO2_RISINGDETECT GPIO2_REG32(0x048) -#define GPIO2_DATAIN GPIO2_REG32(0x038) -#define GPIO2_OE GPIO2_REG32(0x034) -#define GPIO2_DATAOUT GPIO2_REG32(0x03C) - -/* GPIO 3 */ -#define GPIO3_BASE GPIOX_BASE(3) -#define GPIO3_REG32(offset) __REG32(GPIO3_BASE + (offset)) -#define GPIO3_IRQENABLE1 GPIO3_REG32(0x01C) -#define GPIO3_IRQSTATUS1 GPIO3_REG32(0x018) -#define GPIO3_IRQENABLE2 GPIO3_REG32(0x02C) -#define GPIO3_IRQSTATUS2 GPIO3_REG32(0x028) -#define GPIO3_WAKEUPENABLE GPIO3_REG32(0x020) -#define GPIO3_RISINGDETECT GPIO3_REG32(0x048) -#define GPIO3_FALLINGDETECT GPIO3_REG32(0x04C) -#define GPIO3_DATAIN GPIO3_REG32(0x038) -#define GPIO3_OE GPIO3_REG32(0x034) -#define GPIO3_DATAOUT GPIO3_REG32(0x03C) -#define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050) -#define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054) - -/* GPIO 4 */ -#define GPIO4_BASE GPIOX_BASE(4) -#define GPIO4_REG32(offset) __REG32(GPIO4_BASE + (offset)) -#define GPIO4_IRQENABLE1 GPIO4_REG32(0x01C) -#define GPIO4_IRQSTATUS1 GPIO4_REG32(0x018) -#define GPIO4_IRQENABLE2 GPIO4_REG32(0x02C) -#define GPIO4_IRQSTATUS2 GPIO4_REG32(0x028) -#define GPIO4_WAKEUPENABLE GPIO4_REG32(0x020) -#define GPIO4_RISINGDETECT GPIO4_REG32(0x048) -#define GPIO4_FALLINGDETECT GPIO4_REG32(0x04C) -#define GPIO4_DATAIN GPIO4_REG32(0x038) -#define GPIO4_OE GPIO4_REG32(0x034) -#define GPIO4_DATAOUT GPIO4_REG32(0x03C) -#define GPIO4_DEBOUNCENABLE GPIO4_REG32(0x050) -#define GPIO4_DEBOUNCINGTIME GPIO4_REG32(0x054) - - -/* IO CONFIG */ -#define CONTROL_BASE (OMAP24XX_CTRL_BASE) -#define CONTROL_REG32(offset) __REG32(CONTROL_BASE + (offset)) - -#define CONTROL_PADCONF_SPI1_NCS2 CONTROL_REG32(0x104) -#define CONTROL_PADCONF_SYS_XTALOUT CONTROL_REG32(0x134) -#define CONTROL_PADCONF_UART1_RX CONTROL_REG32(0x0C8) -#define CONTROL_PADCONF_MCBSP1_DX CONTROL_REG32(0x10C) -#define CONTROL_PADCONF_GPMC_NCS4 CONTROL_REG32(0x090) -#define CONTROL_PADCONF_DSS_D5 CONTROL_REG32(0x0B8) -#define CONTROL_PADCONF_DSS_D9 CONTROL_REG32(0x0BC) -#define CONTROL_PADCONF_DSS_D13 CONTROL_REG32(0x0C0) -#define CONTROL_PADCONF_DSS_VSYNC CONTROL_REG32(0x0CC) - -/* CONTROL */ -#define CONTROL_DEVCONF CONTROL_REG32(0x274) - -/* INTERRUPT CONTROLLER */ -#define INTC_BASE (OMAP24XX_L4_IO_BASE+0xfe000) -#define INTC_REG32(offset) __REG32(INTC_BASE + (offset)) - -#define INTC1_U_BASE INTC_REG32(0x000) -#define INTC_MIR0 INTC_REG32(0x084) -#define INTC_MIR_SET0 INTC_REG32(0x08C) -#define INTC_MIR_CLEAR0 INTC_REG32(0x088) -#define INTC_ISR_CLEAR0 INTC_REG32(0x094) -#define INTC_MIR1 INTC_REG32(0x0A4) -#define INTC_MIR_SET1 INTC_REG32(0x0AC) -#define INTC_MIR_CLEAR1 INTC_REG32(0x0A8) -#define INTC_ISR_CLEAR1 INTC_REG32(0x0B4) -#define INTC_MIR2 INTC_REG32(0x0C4) -#define INTC_MIR_SET2 INTC_REG32(0x0CC) -#define INTC_MIR_CLEAR2 INTC_REG32(0x0C8) -#define INTC_ISR_CLEAR2 INTC_REG32(0x0D4) -#define INTC_SIR_IRQ INTC_REG32(0x040) -#define INTC_CONTROL INTC_REG32(0x048) -#define INTC_ILR11 INTC_REG32(0x12C) -#define INTC_ILR32 INTC_REG32(0x180) -#define INTC_ILR37 INTC_REG32(0x194) -#define INTC_SYSCONFIG INTC_REG32(0x010) - -/* RAM FIREWALL */ -#define RAMFW_BASE (0x68005000) -#define RAMFW_REG32(offset) __REG32(RAMFW_BASE + (offset)) - -#define RAMFW_REQINFOPERM0 RAMFW_REG32(0x048) -#define RAMFW_READPERM0 RAMFW_REG32(0x050) -#define RAMFW_WRITEPERM0 RAMFW_REG32(0x058) - -/* GPMC CS1 FPGA ON USER INTERFACE MODULE */ -//#define DEBUG_BOARD_LED_REGISTER 0x04000014 - -/* GPMC CS0 */ -#define GPMC_CONFIG1_0 GPMC_REG32(0x060) -#define GPMC_CONFIG2_0 GPMC_REG32(0x064) -#define GPMC_CONFIG3_0 GPMC_REG32(0x068) -#define GPMC_CONFIG4_0 GPMC_REG32(0x06C) -#define GPMC_CONFIG5_0 GPMC_REG32(0x070) -#define GPMC_CONFIG6_0 GPMC_REG32(0x074) -#define GPMC_CONFIG7_0 GPMC_REG32(0x078) - -/* GPMC CS1 */ -#define GPMC_CONFIG1_1 GPMC_REG32(0x090) -#define GPMC_CONFIG2_1 GPMC_REG32(0x094) -#define GPMC_CONFIG3_1 GPMC_REG32(0x098) -#define GPMC_CONFIG4_1 GPMC_REG32(0x09C) -#define GPMC_CONFIG5_1 GPMC_REG32(0x0a0) -#define GPMC_CONFIG6_1 GPMC_REG32(0x0a4) -#define GPMC_CONFIG7_1 GPMC_REG32(0x0a8) - -/* DSS */ -#define DSS_CONTROL DISP_REG32(0x040) -#define DISPC_CONTROL DISP_REG32(0x440) -#define DISPC_SYSSTATUS DISP_REG32(0x414) -#define DISPC_IRQSTATUS DISP_REG32(0x418) -#define DISPC_IRQENABLE DISP_REG32(0x41C) -#define DISPC_CONFIG DISP_REG32(0x444) -#define DISPC_DEFAULT_COLOR0 DISP_REG32(0x44C) -#define DISPC_DEFAULT_COLOR1 DISP_REG32(0x450) -#define DISPC_TRANS_COLOR0 DISP_REG32(0x454) -#define DISPC_TRANS_COLOR1 DISP_REG32(0x458) -#define DISPC_LINE_NUMBER DISP_REG32(0x460) -#define DISPC_TIMING_H DISP_REG32(0x464) -#define DISPC_TIMING_V DISP_REG32(0x468) -#define DISPC_POL_FREQ DISP_REG32(0x46C) -#define DISPC_DIVISOR DISP_REG32(0x470) -#define DISPC_SIZE_DIG DISP_REG32(0x478) -#define DISPC_SIZE_LCD DISP_REG32(0x47C) -#define DISPC_GFX_BA0 DISP_REG32(0x480) -#define DISPC_GFX_BA1 DISP_REG32(0x484) -#define DISPC_GFX_POSITION DISP_REG32(0x488) -#define DISPC_GFX_SIZE DISP_REG32(0x48C) -#define DISPC_GFX_ATTRIBUTES DISP_REG32(0x4A0) -#define DISPC_GFX_FIFO_THRESHOLD DISP_REG32(0x4A4) -#define DISPC_GFX_ROW_INC DISP_REG32(0x4AC) -#define DISPC_GFX_PIXEL_INC DISP_REG32(0x4B0) -#define DISPC_GFX_WINDOW_SKIP DISP_REG32(0x4B4) -#define DISPC_GFX_TABLE_BA DISP_REG32(0x4B8) -#define DISPC_DATA_CYCLE1 DISP_REG32(0x5D4) -#define DISPC_DATA_CYCLE2 DISP_REG32(0x5D8) -#define DISPC_DATA_CYCLE3 DISP_REG32(0x5DC) - -/* Wake up define for board */ -#define GPIO97 (1 << 1) -#define GPIO88 (1 << 24) - -#endif /* __ASSEMBLER__ */ +u32 omap_prcm_get_reset_sources(void); #endif diff --git a/include/asm-arm/arch-omap/sram.h b/include/asm-arm/arch-omap/sram.h index e72ccbf0fe0..6fc0dd57b7c 100644 --- a/include/asm-arm/arch-omap/sram.h +++ b/include/asm-arm/arch-omap/sram.h @@ -20,6 +20,8 @@ extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type); extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); +extern unsigned long omap_fb_sram_start; +extern unsigned long omap_fb_sram_size; /* Do not use these */ extern void sram_reprogram_clock(u32 ckctl, u32 dpllctl); diff --git a/include/asm-arm/arch-omap/system.h b/include/asm-arm/arch-omap/system.h index 6724a81bd10..67970d1a202 100644 --- a/include/asm-arm/arch-omap/system.h +++ b/include/asm-arm/arch-omap/system.h @@ -9,12 +9,13 @@ #include <asm/mach-types.h> #include <asm/hardware.h> -#include <asm/arch/prcm.h> #ifndef CONFIG_MACH_VOICEBLUE #define voiceblue_reset() do {} while (0) #endif +extern void omap_prcm_arch_reset(char mode); + static inline void arch_idle(void) { cpu_do_idle(); @@ -38,24 +39,12 @@ static inline void omap1_arch_reset(char mode) omap_writew(1, ARM_RSTCT1); } -static inline void omap2_arch_reset(char mode) -{ - u32 rate; - struct clk *vclk, *sclk; - - vclk = clk_get(NULL, "virt_prcm_set"); - sclk = clk_get(NULL, "sys_ck"); - rate = clk_get_rate(sclk); - clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */ - RM_RSTCTRL_WKUP |= 2; -} - static inline void arch_reset(char mode) { if (!cpu_is_omap24xx()) omap1_arch_reset(mode); else - omap2_arch_reset(mode); + omap_prcm_arch_reset(mode); } #endif diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 1409c5bd703..c8f53a71c07 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h @@ -485,7 +485,7 @@ #define SACR1_ENLBF (1 << 5) /* Enable Loopback */ #define SACR1_DRPL (1 << 4) /* Disable Replaying Function */ #define SACR1_DREC (1 << 3) /* Disable Recording Function */ -#define SACR1_AMSL (1 << 1) /* Specify Alternate Mode */ +#define SACR1_AMSL (1 << 0) /* Specify Alternate Mode */ #define SASR0_I2SOFF (1 << 7) /* Controller Status */ #define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */ diff --git a/include/asm-arm/arch-pxa/sharpsl.h b/include/asm-arm/arch-pxa/sharpsl.h index 0b43495d24b..94cb4982af8 100644 --- a/include/asm-arm/arch-pxa/sharpsl.h +++ b/include/asm-arm/arch-pxa/sharpsl.h @@ -27,6 +27,8 @@ struct corgits_machinfo { */ struct corgibl_machinfo { int max_intensity; + int default_intensity; + int limit_mask; void (*set_bl_intensity)(int intensity); }; extern void corgibl_limit_intensity(int limit); diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h index 9d7f87375aa..7480f4e8d97 100644 --- a/include/asm-arm/arch-rpc/hardware.h +++ b/include/asm-arm/arch-rpc/hardware.h @@ -46,7 +46,6 @@ #define SCREEN_END 0xdfc00000 #define SCREEN_BASE 0xdf800000 -#define FLUSH_BASE 0xdf000000 #define UNCACHEABLE_ADDR 0xdf010000 /* @@ -59,8 +58,6 @@ #define PCIO_BASE IOMEM(0xe0010000) #define FLOPPYDMA_BASE IOMEM(0xe002a000) -#define FLUSH_BASE_PHYS 0x00000000 /* ROM */ - #define vidc_writel(val) __raw_writel(val, VIDC_BASE) #define IO_EC_EASI_BASE 0x81400000 diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h index 0592cb3f0c7..303c424ce67 100644 --- a/include/asm-arm/arch-rpc/memory.h +++ b/include/asm-arm/arch-rpc/memory.h @@ -30,4 +30,10 @@ #define __virt_to_bus(x) __virt_to_phys(x) #define __bus_to_virt(x) __phys_to_virt(x) +/* + * Cache flushing area - ROM + */ +#define FLUSH_BASE_PHYS 0x00000000 +#define FLUSH_BASE 0xdf000000 + #endif diff --git a/include/asm-arm/arch-s3c2410/entry-macro.S b/include/asm-arm/arch-s3c2410/entry-macro.S index cc06b1bd37b..894c35cf3b1 100644 --- a/include/asm-arm/arch-s3c2410/entry-macro.S +++ b/include/asm-arm/arch-s3c2410/entry-macro.S @@ -6,116 +6,83 @@ * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. +*/ + +/* We have a problem that the INTOFFSET register does not always + * show one interrupt. Occasionally we get two interrupts through + * the prioritiser, and this causes the INTOFFSET register to show + * what looks like the logical-or of the two interrupt numbers. + * + * Thanks to Klaus, Shannon, et al for helping to debug this problem +*/ + +#define INTPND (0x10) +#define INTOFFSET (0x14) +#define EXTINTPEND (0xa8) +#define EXTINTMASK (0xa4) - * Modifications: - * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA - */ #include <asm/hardware.h> #include <asm/arch/irqs.h> - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mov \tmp, #S3C24XX_VA_IRQ - ldr \irqnr, [ \tmp, #0x14 ] @ get irq no -30000: - teq \irqnr, #4 - teqne \irqnr, #5 - beq 1002f @ external irq reg - - @ debug check to see if interrupt reported is the same - @ as the offset.... - - teq \irqnr, #0 - beq 20002f - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND - mov \irqstat, \irqstat, lsr \irqnr - tst \irqstat, #1 - bne 20002f - - /* debug/warning if we get an invalud response from the - * INTOFFSET register */ -#if 1 - stmfd r13!, { r0 - r4 , r8-r12, r14 } - ldr r1, [ \tmp, #0x14 ] @ INTOFFSET - ldr r2, [ \tmp, #0x10 ] @ INTPND - ldr r3, [ \tmp, #0x00 ] @ SRCPND - adr r0, 20003f - bl printk - b 20004f - -20003: - .ascii "<7>irq: err - bad offset %d, intpnd=%08x, srcpnd=%08x\n" - .byte 0 - .align 4 -20004: - mov r1, #1 - mov \tmp, #S3C24XX_VA_IRQ - ldmfd r13!, { r0 - r4 , r8-r12, r14 } -#endif - - @ try working out interrupt number for ourselves - mov \irqnr, #0 - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND -10021: - movs \irqstat, \irqstat, lsr#1 - bcs 30000b @ try and re-start the proccess - add \irqnr, \irqnr, #1 - cmp \irqnr, #32 - ble 10021b - - @ found no interrupt, set Z flag and leave - movs \irqnr, #0 - b 1001f - -20005: -20002: @ exit - @ we base the s3c2410x interrupts at 16 and above to allow - @ isa peripherals to have their standard interrupts, also - @ ensure that Z flag is un-set on exit - - @ note, we cannot be sure if we get IRQ_EINT0 (0) that - @ there is simply no interrupt pending, so in all other - @ cases we jump to say we have found something, otherwise - @ we check to see if the interrupt really is assrted - adds \irqnr, \irqnr, #IRQ_EINT0 - teq \irqnr, #IRQ_EINT0 - bne 1001f @ exit - ldr \irqstat, [ \tmp, #0x10 ] @ INTPND - teq \irqstat, #0 - moveq \irqnr, #0 - b 1001f - - @ we get here from no main or external interrupts pending -1002: - add \tmp, \tmp, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ - ldr \irqstat, [ \tmp, # 0xa8 ] @ EXTINTPEND - ldr \irqnr, [ \tmp, # 0xa4 ] @ EXTINTMASK - - bic \irqstat, \irqstat, \irqnr @ clear masked irqs - - mov \irqnr, #IRQ_EINT4 @ start extint nos - mov \irqstat, \irqstat, lsr#4 @ ignore bottom 4 bits -10021: - movs \irqstat, \irqstat, lsr#1 - bcs 1004f - add \irqnr, \irqnr, #1 - cmp \irqnr, #IRQ_EINT23 - ble 10021b - - @ found no interrupt, set Z flag and leave - movs \irqnr, #0 - -1004: @ ensure Z flag clear in case our MOVS shifted out the last bit - teq \irqnr, #0 + mov \base, #S3C24XX_VA_IRQ + + ldr \irqstat, [ \base, #INTPND] + bics \irqnr, \irqstat, #3<<4 @@ only an GPIO IRQ + beq 2000f + + @@ try the interrupt offset register, since it is there + + ldr \irqnr, [ \base, #INTOFFSET ] + mov \tmp, #1 + tst \irqstat, \tmp, lsl \irqnr + addne \irqnr, \irqnr, #IRQ_EINT0 + bne 1001f + + @@ the number specified is not a valid irq, so try + @@ and work it out for ourselves + + mov \irqnr, #IRQ_EINT0 @@ start here + b 3000f + +2000: + @@ load the GPIO interrupt register, and check it + + add \tmp, \base, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ + ldr \irqstat, [ \tmp, # EXTINTPEND ] + ldr \irqnr, [ \tmp, # EXTINTMASK ] + bics \irqstat, \irqstat, \irqnr + beq 1001f + + mov \irqnr, #(IRQ_EINT4 - 4) + + @@ work out which irq (if any) we got +3000: + movs \tmp, \irqstat, lsl#16 + addeq \irqnr, \irqnr, #16 + moveq \irqstat, \irqstat, lsr#16 + tst \irqstat, #0xff + addeq \irqnr, \irqnr, #8 + moveq \irqstat, \irqstat, lsr#8 + tst \irqstat, #0xf + addeq \irqnr, \irqnr, #4 + moveq \irqstat, \irqstat, lsr#4 + tst \irqstat, #0x3 + addeq \irqnr, \irqnr, #2 + moveq \irqstat, \irqstat, lsr#2 + tst \irqstat, #0x1 + addeq \irqnr, \irqnr, #1 + + @@ we have the value + movs \irqnr, \irqnr + 1001: - @ exit irq routine - .endm + @@ exit here, Z flag unset if IRQ + .endm /* currently don't need an disable_fiq macro */ .macro disable_fiq .endm - - diff --git a/include/asm-arm/arch-s3c2410/leds-gpio.h b/include/asm-arm/arch-s3c2410/leds-gpio.h new file mode 100644 index 00000000000..f07ed040622 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/leds-gpio.h @@ -0,0 +1,28 @@ +/* linux/include/asm-arm/arch-s3c2410/leds-gpio.h + * + * (c) 2006 Simtec Electronics + * http://armlinux.simtec.co.uk/ + * Ben Dooks <ben@simtec.co.uk> + * + * S3C24XX - LEDs GPIO connector + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#ifndef __ASM_ARCH_LEDSGPIO_H +#define __ASM_ARCH_LEDSGPIO_H "leds-gpio.h" + +#define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */ +#define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */ + +struct s3c24xx_led_platdata { + unsigned int gpio; + unsigned int flags; + + char *name; + char *def_trigger; +}; + +#endif /* __ASM_ARCH_LEDSGPIO_H */ diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 28711aaa496..ee008a5484f 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h @@ -14,10 +14,6 @@ #include <linux/config.h> -/* Flushing areas */ -#define FLUSH_BASE_PHYS 0xe0000000 /* SA1100 zero bank */ -#define FLUSH_BASE 0xf5000000 -#define FLUSH_BASE_MINICACHE 0xf5800000 #define UNCACHEABLE_ADDR 0xfa050000 diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h index 018a9f0e398..a29fac1387c 100644 --- a/include/asm-arm/arch-sa1100/memory.h +++ b/include/asm-arm/arch-sa1100/memory.h @@ -91,4 +91,11 @@ void sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes); #endif +/* + * Cache flushing area - SA1100 zero bank + */ +#define FLUSH_BASE_PHYS 0xe0000000 +#define FLUSH_BASE 0xf5000000 +#define FLUSH_BASE_MINICACHE 0xf5100000 + #endif diff --git a/include/asm-arm/arch-shark/hardware.h b/include/asm-arm/arch-shark/hardware.h index 4d35f8c154c..ecba4526089 100644 --- a/include/asm-arm/arch-shark/hardware.h +++ b/include/asm-arm/arch-shark/hardware.h @@ -17,11 +17,6 @@ */ #define IO_BASE 0xe0000000 -/* - * RAM definitions - */ -#define FLUSH_BASE_PHYS 0x80000000 - #else #define IO_BASE 0 @@ -33,7 +28,6 @@ #define ROMCARD_SIZE 0x08000000 #define ROMCARD_START 0x10000000 -#define FLUSH_BASE 0xdf000000 #define PCIO_BASE 0xe0000000 diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h index 95a29b4bc5d..6968d6103ea 100644 --- a/include/asm-arm/arch-shark/memory.h +++ b/include/asm-arm/arch-shark/memory.h @@ -39,4 +39,10 @@ static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsig #define __virt_to_bus(x) __virt_to_phys(x) #define __bus_to_virt(x) __phys_to_virt(x) +/* + * Cache flushing area + */ +#define FLUSH_BASE_PHYS 0x80000000 +#define FLUSH_BASE 0xdf000000 + #endif diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h index e3e8541ee63..63ca7412a46 100644 --- a/include/asm-arm/dma-mapping.h +++ b/include/asm-arm/dma-mapping.h @@ -47,7 +47,7 @@ static inline int dma_get_cache_alignment(void) static inline int dma_is_consistent(dma_addr_t handle) { - return 0; + return !!arch_is_coherent(); } /* @@ -145,7 +145,9 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, size_t size, enum dma_data_direction dir) { - consistent_sync(cpu_addr, size, dir); + if (!arch_is_coherent()) + consistent_sync(cpu_addr, size, dir); + return virt_to_dma(dev, (unsigned long)cpu_addr); } #else @@ -255,7 +257,9 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, sg->dma_address = page_to_dma(dev, sg->page) + sg->offset; virt = page_address(sg->page) + sg->offset; - consistent_sync(virt, sg->length, dir); + + if (!arch_is_coherent()) + consistent_sync(virt, sg->length, dir); } return nents; @@ -310,14 +314,16 @@ static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) { - consistent_sync((void *)dma_to_virt(dev, handle), size, dir); + if (!arch_is_coherent()) + consistent_sync((void *)dma_to_virt(dev, handle), size, dir); } static inline void dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) { - consistent_sync((void *)dma_to_virt(dev, handle), size, dir); + if (!arch_is_coherent()) + consistent_sync((void *)dma_to_virt(dev, handle), size, dir); } #else extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction); @@ -347,7 +353,8 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, for (i = 0; i < nents; i++, sg++) { char *virt = page_address(sg->page) + sg->offset; - consistent_sync(virt, sg->length, dir); + if (!arch_is_coherent()) + consistent_sync(virt, sg->length, dir); } } @@ -359,7 +366,8 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, for (i = 0; i < nents; i++, sg++) { char *virt = page_address(sg->page) + sg->offset; - consistent_sync(virt, sg->length, dir); + if (!arch_is_coherent()) + consistent_sync(virt, sg->length, dir); } } #else diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h index 6246bf83627..52bae088a18 100644 --- a/include/asm-arm/fpstate.h +++ b/include/asm-arm/fpstate.h @@ -26,7 +26,9 @@ struct vfp_hard_struct { __u64 fpregs[16]; +#if __LINUX_ARM_ARCH__ < 6 __u32 fpmx_state; +#endif __u32 fpexc; __u32 fpscr; /* diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index afa5c3ea077..20928940759 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h @@ -172,10 +172,10 @@ static inline __deprecated void *bus_to_virt(unsigned long x) * virt_addr_valid(k) indicates whether a virtual address is valid */ #ifndef CONFIG_DISCONTIGMEM -#define ARCH_PFN_OFFSET (PHYS_PFN_OFFSET) +#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) -#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)) +#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) #define PHYS_TO_NID(addr) (0) @@ -187,8 +187,8 @@ static inline __deprecated void *bus_to_virt(unsigned long x) * around in memory. */ #include <linux/numa.h> -#define arch_pfn_to_nid(pfn) (PFN_TO_NID(pfn)) -#define arch_local_page_offset(pfn, nid) (LOCAL_MAP_NR((pfn) << PAGE_OFFSET)) +#define arch_pfn_to_nid(pfn) PFN_TO_NID(pfn) +#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT) #define pfn_valid(pfn) \ ({ \ @@ -234,6 +234,14 @@ static inline __deprecated void *bus_to_virt(unsigned long x) #define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr)) #endif +/* + * Optional coherency support. Currently used only by selected + * Intel XSC3-based systems. + */ +#ifndef arch_is_coherent +#define arch_is_coherent() 0 +#endif + #endif #include <asm-generic/memory_model.h> diff --git a/include/asm-arm/numnodes.h b/include/asm-arm/numnodes.h deleted file mode 100644 index 8df36818ebc..00000000000 --- a/include/asm-arm/numnodes.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * linux/include/asm-arm/numnodes.h - * - * Copyright (C) 2002 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -/* This declaration for the size of the NUMA (CONFIG_DISCONTIGMEM) - * memory node table is the default. - * - * A good place to override this value is include/asm/arch/memory.h. - */ - -#ifndef __ASM_ARM_NUMNODES_H -#define __ASM_ARM_NUMNODES_H - -#include <asm/memory.h> - -#ifndef NODES_SHIFT -# define NODES_SHIFT 2 /* Normally, Max 4 Nodes */ -#endif - -#endif diff --git a/include/asm-arm/pgtable-hwdef.h b/include/asm-arm/pgtable-hwdef.h index 1d033495cc7..1bc1f997bda 100644 --- a/include/asm-arm/pgtable-hwdef.h +++ b/include/asm-arm/pgtable-hwdef.h @@ -73,6 +73,7 @@ #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ #define PTE_EXT_APX (1 << 9) /* v6 */ +#define PTE_EXT_COHERENT (1 << 9) /* XScale3 */ #define PTE_EXT_SHARED (1 << 10) /* v6 */ #define PTE_EXT_NG (1 << 11) /* v6 */ diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index e595ae24efe..e85c08d78dd 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -156,6 +156,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); #define L_PTE_WRITE (1 << 5) #define L_PTE_EXEC (1 << 6) #define L_PTE_DIRTY (1 << 7) +#define L_PTE_COHERENT (1 << 9) /* I/O coherent (xsc3) */ #define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */ #define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */ diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index 8f331bbd39a..ee8dfea549b 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h @@ -308,8 +308,6 @@ #define __NR_mq_notify (__NR_SYSCALL_BASE+278) #define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279) #define __NR_waitid (__NR_SYSCALL_BASE+280) - -#if defined(__ARM_EABI__) /* reserve these for un-muxing socketcall */ #define __NR_socket (__NR_SYSCALL_BASE+281) #define __NR_bind (__NR_SYSCALL_BASE+282) #define __NR_connect (__NR_SYSCALL_BASE+283) @@ -327,9 +325,6 @@ #define __NR_getsockopt (__NR_SYSCALL_BASE+295) #define __NR_sendmsg (__NR_SYSCALL_BASE+296) #define __NR_recvmsg (__NR_SYSCALL_BASE+297) -#endif - -#if defined(__ARM_EABI__) /* reserve these for un-muxing ipc */ #define __NR_semop (__NR_SYSCALL_BASE+298) #define __NR_semget (__NR_SYSCALL_BASE+299) #define __NR_semctl (__NR_SYSCALL_BASE+300) @@ -341,16 +336,10 @@ #define __NR_shmdt (__NR_SYSCALL_BASE+306) #define __NR_shmget (__NR_SYSCALL_BASE+307) #define __NR_shmctl (__NR_SYSCALL_BASE+308) -#endif - #define __NR_add_key (__NR_SYSCALL_BASE+309) #define __NR_request_key (__NR_SYSCALL_BASE+310) #define __NR_keyctl (__NR_SYSCALL_BASE+311) - -#if defined(__ARM_EABI__) /* reserved for un-muxing ipc */ #define __NR_semtimedop (__NR_SYSCALL_BASE+312) -#endif - #define __NR_vserver (__NR_SYSCALL_BASE+313) #define __NR_ioprio_set (__NR_SYSCALL_BASE+314) #define __NR_ioprio_get (__NR_SYSCALL_BASE+315) @@ -371,6 +360,24 @@ #define __ARM_NR_usr32 (__ARM_NR_BASE+4) #define __ARM_NR_set_tls (__ARM_NR_BASE+5) +/* + * The following syscalls are obsolete and no longer available for EABI. + */ +#if defined(__ARM_EABI__) +#undef __NR_time +#undef __NR_umount +#undef __NR_stime +#undef __NR_alarm +#undef __NR_utime +#undef __NR_getrlimit +#undef __NR_select +#undef __NR_readdir +#undef __NR_mmap +#undef __NR_socketcall +#undef __NR_syscall +#undef __NR_ipc +#endif + #define __sys2(x) #x #define __sys1(x) __sys2(x) diff --git a/include/asm-arm/vfpmacros.h b/include/asm-arm/vfpmacros.h index 15bd6e74c9c..27fe028b4e7 100644 --- a/include/asm-arm/vfpmacros.h +++ b/include/asm-arm/vfpmacros.h @@ -16,10 +16,18 @@ @ read all the working registers back into the VFP .macro VFPFLDMIA, base +#if __LINUX_ARM_ARCH__ < 6 LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} +#else + LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} +#endif .endm @ write all the working registers out of the VFP .macro VFPFSTMIA, base +#if __LINUX_ARM_ARCH__ < 6 STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} +#else + STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} +#endif .endm diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h index 1d63c2aa8ec..b1c593b6dbf 100644 --- a/include/asm-cris/system.h +++ b/include/asm-cris/system.h @@ -8,7 +8,6 @@ */ extern struct task_struct *resume(struct task_struct *prev, struct task_struct *next, int); -#define prepare_to_switch() do { } while(0) #define switch_to(prev,next,last) last = resume(prev,next, \ (int)&((struct task_struct *)0)->thread) diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h index 2627bbdf8a1..bb2dfe48021 100644 --- a/include/asm-cris/unistd.h +++ b/include/asm-cris/unistd.h @@ -288,7 +288,7 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_sys_kexec_load 283 +#define __NR_kexec_load 283 #define __NR_waitid 284 /* #define __NR_sys_setaltroot 285 */ #define __NR_add_key 286 diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index f72ff0c4dc0..1734ed91bcd 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h @@ -18,8 +18,6 @@ struct thread_struct; -#define prepare_to_switch() do { } while(0) - /* * switch_to(prev, next) should switch from task `prev' to `next' * `prev' will never be the same as `next'. diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index 322531caa48..2662a3e12dc 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h @@ -289,7 +289,7 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_sys_kexec_load 283 +#define __NR_kexec_load 283 #define __NR_waitid 284 /* #define __NR_sys_setaltroot 285 */ #define __NR_add_key 286 diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h index de4614840c2..9291c24f581 100644 --- a/include/asm-generic/local.h +++ b/include/asm-generic/local.h @@ -7,8 +7,15 @@ #include <asm/atomic.h> #include <asm/types.h> -/* An unsigned long type for operations which are atomic for a single - * CPU. Usually used in combination with per-cpu variables. */ +/* + * A signed long type for operations which are atomic for a single CPU. + * Usually used in combination with per-cpu variables. + * + * This is the default implementation, which uses atomic_long_t. Which is + * rather pointless. The whole point behind local_t is that some processors + * can perform atomic adds and subtracts in a manner which is atomic wrt IRQs + * running on this CPU. local_t allows exploitation of such capabilities. + */ /* Implement in terms of atomics. */ @@ -20,7 +27,7 @@ typedef struct #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } -#define local_read(l) ((unsigned long)atomic_long_read(&(l)->a)) +#define local_read(l) atomic_long_read(&(l)->a) #define local_set(l,i) atomic_long_set((&(l)->a),(i)) #define local_inc(l) atomic_long_inc(&(l)->a) #define local_dec(l) atomic_long_dec(&(l)->a) diff --git a/include/asm-generic/mutex-dec.h b/include/asm-generic/mutex-dec.h index 40c6d1f8659..29c6ac34e23 100644 --- a/include/asm-generic/mutex-dec.h +++ b/include/asm-generic/mutex-dec.h @@ -17,13 +17,14 @@ * it wasn't 1 originally. This function MUST leave the value lower than * 1 even when the "1" assertion wasn't true. */ -#define __mutex_fastpath_lock(count, fail_fn) \ -do { \ - if (unlikely(atomic_dec_return(count) < 0)) \ - fail_fn(count); \ - else \ - smp_mb(); \ -} while (0) +static inline void +__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *)) +{ + if (unlikely(atomic_dec_return(count) < 0)) + fail_fn(count); + else + smp_mb(); +} /** * __mutex_fastpath_lock_retval - try to take the lock by moving the count @@ -36,7 +37,7 @@ do { \ * or anything the slow path function returns. */ static inline int -__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) +__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *)) { if (unlikely(atomic_dec_return(count) < 0)) return fail_fn(count); @@ -59,12 +60,13 @@ __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs * to return 0 otherwise. */ -#define __mutex_fastpath_unlock(count, fail_fn) \ -do { \ - smp_mb(); \ - if (unlikely(atomic_inc_return(count) <= 0)) \ - fail_fn(count); \ -} while (0) +static inline void +__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *)) +{ + smp_mb(); + if (unlikely(atomic_inc_return(count) <= 0)) + fail_fn(count); +} #define __mutex_slowpath_needs_to_unlock() 1 diff --git a/include/asm-generic/mutex-xchg.h b/include/asm-generic/mutex-xchg.h index 1d24f47e6c4..32a2100c1ae 100644 --- a/include/asm-generic/mutex-xchg.h +++ b/include/asm-generic/mutex-xchg.h @@ -3,7 +3,7 @@ * * Generic implementation of the mutex fastpath, based on xchg(). * - * NOTE: An xchg based implementation is less optimal than an atomic + * NOTE: An xchg based implementation might be less optimal than an atomic * decrement/increment based implementation. If your architecture * has a reasonable atomic dec/inc then you should probably use * asm-generic/mutex-dec.h instead, or you could open-code an @@ -22,14 +22,14 @@ * wasn't 1 originally. This function MUST leave the value lower than 1 * even when the "1" assertion wasn't true. */ -#define __mutex_fastpath_lock(count, fail_fn) \ -do { \ - if (unlikely(atomic_xchg(count, 0) != 1)) \ - fail_fn(count); \ - else \ - smp_mb(); \ -} while (0) - +static inline void +__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *)) +{ + if (unlikely(atomic_xchg(count, 0) != 1)) + fail_fn(count); + else + smp_mb(); +} /** * __mutex_fastpath_lock_retval - try to take the lock by moving the count @@ -42,7 +42,7 @@ do { \ * or anything the slow path function returns */ static inline int -__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) +__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *)) { if (unlikely(atomic_xchg(count, 0) != 1)) return fail_fn(count); @@ -64,12 +64,13 @@ __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs * to return 0 otherwise. */ -#define __mutex_fastpath_unlock(count, fail_fn) \ -do { \ - smp_mb(); \ - if (unlikely(atomic_xchg(count, 1) != 0)) \ - fail_fn(count); \ -} while (0) +static inline void +__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *)) +{ + smp_mb(); + if (unlikely(atomic_xchg(count, 1) != 0)) + fail_fn(count); +} #define __mutex_slowpath_needs_to_unlock() 0 diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h index dfe96c7121c..8e81cf665e7 100644 --- a/include/asm-h8300/system.h +++ b/include/asm-h8300/system.h @@ -4,8 +4,6 @@ #include <linux/config.h> /* get configuration macros */ #include <linux/linkage.h> -#define prepare_to_switch() do { } while(0) - /* * switch_to(n) should switch tasks to task ptr, first checking that * ptr isn't the current task, in which case it does nothing. This diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h index 56a4a5686c8..adb05159379 100644 --- a/include/asm-h8300/unistd.h +++ b/include/asm-h8300/unistd.h @@ -285,7 +285,7 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_sys_kexec_load 283 +#define __NR_kexec_load 283 #define __NR_waitid 284 /* #define __NR_sys_setaltroot 285 */ #define __NR_add_key 286 diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index ff9ac8d19eb..288233fd77d 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h @@ -139,6 +139,8 @@ void switch_ipi_to_APIC_timer(void *cpumask); extern int timer_over_8254; +extern int modern_apic(void); + #else /* !CONFIG_X86_LOCAL_APIC */ static inline void lapic_shutdown(void) { } diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h index 03185cef8e0..5e4a35af292 100644 --- a/include/asm-i386/apicdef.h +++ b/include/asm-i386/apicdef.h @@ -37,6 +37,7 @@ #define APIC_SPIV_FOCUS_DISABLED (1<<9) #define APIC_SPIV_APIC_ENABLED (1<<8) #define APIC_ISR 0x100 +#define APIC_ISR_NR 0x8 /* Number of 32 bit ISR registers. */ #define APIC_TMR 0x180 #define APIC_IRR 0x200 #define APIC_ESR 0x280 diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h index edf65be21a9..ca82acb8cb1 100644 --- a/include/asm-i386/e820.h +++ b/include/asm-i386/e820.h @@ -35,6 +35,10 @@ struct e820map { }; extern struct e820map e820; + +extern int e820_all_mapped(unsigned long start, unsigned long end, + unsigned type); + #endif/*!__ASSEMBLY__*/ #endif/*__E820_HEADER*/ diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h index 79727afb94c..03403045c18 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-i386/floppy.h @@ -56,7 +56,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) register unsigned char st; #undef TRACE_FLPY_INT -#define NO_FLOPPY_ASSEMBLER #ifdef TRACE_FLPY_INT static int calls=0; @@ -71,38 +70,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) bytes = virtual_dma_count; #endif -#ifndef NO_FLOPPY_ASSEMBLER - __asm__ ( - "testl %1,%1" - "je 3f" -"1: inb %w4,%b0" - "andb $160,%b0" - "cmpb $160,%b0" - "jne 2f" - "incw %w4" - "testl %3,%3" - "jne 4f" - "inb %w4,%b0" - "movb %0,(%2)" - "jmp 5f" -"4: movb (%2),%0" - "outb %b0,%w4" -"5: decw %w4" - "outb %0,$0x80" - "decl %1" - "incl %2" - "testl %1,%1" - "jne 1b" -"3: inb %w4,%b0" -"2: " - : "=a" ((char) st), - "=c" ((long) virtual_dma_count), - "=S" ((long) virtual_dma_addr) - : "b" ((long) virtual_dma_mode), - "d" ((short) virtual_dma_port+4), - "1" ((long) virtual_dma_count), - "2" ((long) virtual_dma_addr)); -#else { register int lcount; register char *lptr; @@ -122,7 +89,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs) virtual_dma_addr = lptr; st = inb(virtual_dma_port+4); } -#endif #ifdef TRACE_FLPY_INT calls++; diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h index 16ef9f996e3..7f1a8a6ee32 100644 --- a/include/asm-i386/hpet.h +++ b/include/asm-i386/hpet.h @@ -89,6 +89,7 @@ * then 32 bit HPET counter wrapsaround in less than 0.5 sec. */ #define HPET_MIN_PERIOD (100000UL) +#define HPET_TICK_RATE (HZ * 100000UL) extern unsigned long hpet_tick; /* hpet clks count per tick */ extern unsigned long hpet_address; /* hpet memory map physical address */ diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h index 0177da80dde..e67fa08260f 100644 --- a/include/asm-i386/local.h +++ b/include/asm-i386/local.h @@ -5,7 +5,7 @@ typedef struct { - volatile unsigned long counter; + volatile long counter; } local_t; #define LOCAL_INIT(i) { (i) } @@ -29,7 +29,7 @@ static __inline__ void local_dec(local_t *v) :"m" (v->counter)); } -static __inline__ void local_add(unsigned long i, local_t *v) +static __inline__ void local_add(long i, local_t *v) { __asm__ __volatile__( "addl %1,%0" @@ -37,7 +37,7 @@ static __inline__ void local_add(unsigned long i, local_t *v) :"ir" (i), "m" (v->counter)); } -static __inline__ void local_sub(unsigned long i, local_t *v) +static __inline__ void local_sub(long i, local_t *v) { __asm__ __volatile__( "subl %1,%0" diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h index 62113d3bfdc..770bf6da8c3 100644 --- a/include/asm-i386/mpspec.h +++ b/include/asm-i386/mpspec.h @@ -18,7 +18,6 @@ extern void find_smp_config (void); extern void get_smp_config (void); extern int nr_ioapics; extern int apic_version [MAX_APICS]; -extern int mp_bus_id_to_type [MAX_MP_BUSSES]; extern int mp_irq_entries; extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES]; extern int mpc_default_type; diff --git a/include/asm-i386/numnodes.h b/include/asm-i386/numnodes.h deleted file mode 100644 index a61f38c8176..00000000000 --- a/include/asm-i386/numnodes.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _ASM_MAX_NUMNODES_H -#define _ASM_MAX_NUMNODES_H - -#include <linux/config.h> - -#ifdef CONFIG_X86_NUMAQ - -/* Max 16 Nodes */ -#define NODES_SHIFT 4 - -#elif defined(CONFIG_ACPI_SRAT) - -/* Max 8 Nodes */ -#define NODES_SHIFT 3 - -#endif /* CONFIG_X86_NUMAQ */ - -#endif /* _ASM_MAX_NUMNODES_H */ diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index 014e3562895..d81d6cfc1bb 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -288,7 +288,7 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_sys_kexec_load 283 +#define __NR_kexec_load 283 #define __NR_waitid 284 /* #define __NR_sys_setaltroot 285 */ #define __NR_add_key 286 @@ -318,8 +318,11 @@ #define __NR_unshare 310 #define __NR_set_robust_list 311 #define __NR_get_robust_list 312 +#define __NR_splice 313 +#define __NR_sync_file_range 314 +#define __NR_tee 315 -#define NR_syscalls 313 +#define NR_syscalls 316 /* * user-visible error numbers are in the range -1 - -128: see diff --git a/include/asm-ia64/acpi-ext.h b/include/asm-ia64/acpi-ext.h index 56d2ddc97b3..734d137dda6 100644 --- a/include/asm-ia64/acpi-ext.h +++ b/include/asm-ia64/acpi-ext.h @@ -1,12 +1,15 @@ /* - * ia64/platform/hp/common/hp_acpi.h + * (c) Copyright 2003, 2006 Hewlett-Packard Development Company, L.P. + * Alex Williamson <alex.williamson@hp.com> + * Bjorn Helgaas <bjorn.helgaas@hp.com> * - * Copyright (C) 2003 Hewlett-Packard - * Copyright (C) Alex Williamson - * Copyright (C) Bjorn Helgaas + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * Vendor specific extensions to ACPI. */ + #ifndef _ASM_IA64_ACPI_EXT_H #define _ASM_IA64_ACPI_EXT_H diff --git a/include/asm-ia64/asmmacro.h b/include/asm-ia64/asmmacro.h index d4cec32083d..edf2cebb296 100644 --- a/include/asm-ia64/asmmacro.h +++ b/include/asm-ia64/asmmacro.h @@ -38,6 +38,10 @@ name: /* * Helper macros for accessing user memory. + * + * When adding any new .section/.previous entries here, make sure to + * also add it to the DISCARD section in arch/ia64/kernel/gate.lds.S or + * unpleasant things will happen. */ .section "__ex_table", "a" // declare section & section attributes diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h index 218c458ab60..c195a9ad125 100644 --- a/include/asm-ia64/kdebug.h +++ b/include/asm-ia64/kdebug.h @@ -58,6 +58,8 @@ enum die_val { DIE_MCA_RENDZVOUS_ENTER, DIE_MCA_RENDZVOUS_PROCESS, DIE_MCA_RENDZVOUS_LEAVE, + DIE_MCA_NEW_TIMEOUT, + DIE_INIT_ENTER, DIE_INIT_MONARCH_ENTER, DIE_INIT_MONARCH_PROCESS, DIE_INIT_MONARCH_LEAVE, diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h index bfbbb8da79c..9c5389b7e62 100644 --- a/include/asm-ia64/mca.h +++ b/include/asm-ia64/mca.h @@ -148,6 +148,11 @@ extern int ia64_reg_MCA_extension(int (*fn)(void *, struct ia64_sal_os_state *) extern void ia64_unreg_MCA_extension(void); extern u64 ia64_get_rnat(u64 *); +struct ia64_mca_notify_die { + struct ia64_sal_os_state *sos; + int *monarch_cpu; +}; + #else /* __ASSEMBLY__ */ #define IA64_MCA_CORRECTED 0x0 /* Error has been corrected by OS_MCA */ diff --git a/include/asm-ia64/mutex.h b/include/asm-ia64/mutex.h index 5a3224f6af3..bed73a643a5 100644 --- a/include/asm-ia64/mutex.h +++ b/include/asm-ia64/mutex.h @@ -84,7 +84,7 @@ __mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *)) static inline int __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) { - if (likely(cmpxchg_acq(count, 1, 0)) == 1) + if (cmpxchg_acq(count, 1, 0) == 1) return 1; return 0; } diff --git a/include/asm-ia64/numnodes.h b/include/asm-ia64/numnodes.h deleted file mode 100644 index e9d356f549d..00000000000 --- a/include/asm-ia64/numnodes.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _ASM_MAX_NUMNODES_H -#define _ASM_MAX_NUMNODES_H - -#ifdef CONFIG_IA64_DIG -/* Max 8 Nodes */ -# define NODES_SHIFT 3 -#elif defined(CONFIG_IA64_HP_ZX1) || defined(CONFIG_IA64_HP_ZX1_SWIOTLB) -/* Max 32 Nodes */ -# define NODES_SHIFT 5 -#elif defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_GENERIC) -# if CONFIG_IA64_NR_NODES == 256 -# define NODES_SHIFT 8 -# elif CONFIG_IA64_NR_NODES <= 512 -# define NODES_SHIFT 9 -# elif CONFIG_IA64_NR_NODES <= 1024 -# define NODES_SHIFT 10 -# endif -#endif - -#endif /* _ASM_MAX_NUMNODES_H */ diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h index 4e7e6f23b08..37e52a2836b 100644 --- a/include/asm-ia64/pal.h +++ b/include/asm-ia64/pal.h @@ -68,6 +68,7 @@ #define PAL_SHUTDOWN 40 /* enter processor shutdown state */ #define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */ #define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */ +#define PAL_CACHE_SHARED_INFO 43 /* returns information on caches shared by logical processor */ #define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */ #define PAL_HALT_INFO 257 /* return the low power capabilities of processor */ @@ -130,7 +131,7 @@ typedef u64 pal_cache_line_state_t; #define PAL_CACHE_LINE_STATE_MODIFIED 3 /* Modified */ typedef struct pal_freq_ratio { - u64 den : 32, num : 32; /* numerator & denominator */ + u32 den, num; /* numerator & denominator */ } itc_ratio, proc_ratio; typedef union pal_cache_config_info_1_s { @@ -151,10 +152,10 @@ typedef union pal_cache_config_info_1_s { typedef union pal_cache_config_info_2_s { struct { - u64 cache_size : 32, /*cache size in bytes*/ + u32 cache_size; /*cache size in bytes*/ - alias_boundary : 8, /* 39-32 aliased addr + u32 alias_boundary : 8, /* 39-32 aliased addr * separation for max * performance. */ @@ -1647,6 +1648,33 @@ ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping) return iprv.status; } + +typedef struct pal_cache_shared_info_s +{ + u64 num_shared; + pal_proc_n_log_info1_t ppli1; + pal_proc_n_log_info2_t ppli2; +} pal_cache_shared_info_t; + +/* Get information on logical to physical processor mappings. */ +static inline s64 +ia64_pal_cache_shared_info(u64 level, + u64 type, + u64 proc_number, + pal_cache_shared_info_t *info) +{ + struct ia64_pal_retval iprv; + + PAL_CALL(iprv, PAL_CACHE_SHARED_INFO, level, type, proc_number); + + if (iprv.status == PAL_STATUS_SUCCESS) { + info->num_shared = iprv.v0; + info->ppli1.ppli1_data = iprv.v1; + info->ppli2.ppli2_data = iprv.v2; + } + + return iprv.status; +} #endif /* __ASSEMBLY__ */ #endif /* _ASM_IA64_PAL_H */ diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index 019956c613e..a40ebec6aee 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h @@ -285,12 +285,17 @@ #define __NR_faccessat 1293 /* 1294, 1295 reserved for pselect/ppoll */ #define __NR_unshare 1296 +#define __NR_splice 1297 +#define __NR_set_robust_list 1298 +#define __NR_get_robust_list 1299 +#define __NR_sync_file_range 1300 +#define __NR_tee 1301 #ifdef __KERNEL__ #include <linux/config.h> -#define NR_syscalls 273 /* length of syscall table */ +#define NR_syscalls 278 /* length of syscall table */ #define __ARCH_WANT_SYS_RT_SIGACTION diff --git a/include/asm-ia64/vga.h b/include/asm-ia64/vga.h index bc3349ffc50..091177cda22 100644 --- a/include/asm-ia64/vga.h +++ b/include/asm-ia64/vga.h @@ -17,7 +17,7 @@ extern unsigned long vga_console_iobase; extern unsigned long vga_console_membase; -#define VGA_MAP_MEM(x) ((unsigned long) ioremap(vga_console_membase + (x), 0)) +#define VGA_MAP_MEM(x) ((unsigned long) ioremap_nocache(vga_console_membase + (x), 0)) #define vga_readb(x) (*(x)) #define vga_writeb(x,y) (*(y) = (x)) diff --git a/include/asm-m32r/numnodes.h b/include/asm-m32r/numnodes.h deleted file mode 100644 index 479a39d49f8..00000000000 --- a/include/asm-m32r/numnodes.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _ASM_NUMNODES_H_ -#define _ASM_NUMNODES_H_ - -#include <linux/config.h> - -#ifdef CONFIG_DISCONTIGMEM - -#if defined(CONFIG_CHIP_M32700) -#define NODES_SHIFT 1 /* Max 2 Nodes */ -#endif /* CONFIG_CHIP_M32700 */ - -#endif /* CONFIG_DISCONTIGMEM */ - -#endif /* _ASM_NUMNODES_H_ */ - diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h index 7885b7df84a..1184293e571 100644 --- a/include/asm-m32r/smp.h +++ b/include/asm-m32r/smp.h @@ -67,7 +67,8 @@ extern volatile int cpu_2_physid[NR_CPUS]; #define raw_smp_processor_id() (current_thread_info()->cpu) extern cpumask_t cpu_callout_map; -#define cpu_possible_map cpu_callout_map +extern cpumask_t cpu_possible_map; +extern cpumask_t cpu_present_map; static __inline__ int hard_smp_processor_id(void) { diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index d6a2c613be6..c5ab5da56d2 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h @@ -22,10 +22,6 @@ * `next' and `prev' should be struct task_struct, but it isn't always defined */ -#ifndef CONFIG_SMP -#define prepare_to_switch() do { } while(0) -#endif /* not CONFIG_SMP */ - #define switch_to(prev, next, last) do { \ register unsigned long arg0 __asm__ ("r0") = (unsigned long)prev; \ register unsigned long arg1 __asm__ ("r1") = (unsigned long)next; \ diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h index e8ae61956a5..819cc28a94f 100644 --- a/include/asm-m32r/uaccess.h +++ b/include/asm-m32r/uaccess.h @@ -5,17 +5,9 @@ * linux/include/asm-m32r/uaccess.h * * M32R version. - * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> + * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> */ -#undef UACCESS_DEBUG - -#ifdef UACCESS_DEBUG -#define UAPRINTK(args...) printk(args) -#else -#define UAPRINTK(args...) -#endif /* UACCESS_DEBUG */ - /* * User space memory access functions */ @@ -38,27 +30,29 @@ #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) #ifdef CONFIG_MMU + #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) #define USER_DS MAKE_MM_SEG(PAGE_OFFSET) -#else -#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) -#define USER_DS MAKE_MM_SEG(0xFFFFFFFF) -#endif /* CONFIG_MMU */ - #define get_ds() (KERNEL_DS) -#ifdef CONFIG_MMU #define get_fs() (current_thread_info()->addr_limit) #define set_fs(x) (current_thread_info()->addr_limit = (x)) -#else + +#else /* not CONFIG_MMU */ + +#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) +#define USER_DS MAKE_MM_SEG(0xFFFFFFFF) +#define get_ds() (KERNEL_DS) + static inline mm_segment_t get_fs(void) { - return USER_DS; + return USER_DS; } static inline void set_fs(mm_segment_t s) { } -#endif /* CONFIG_MMU */ + +#endif /* not CONFIG_MMU */ #define segment_eq(a,b) ((a).seg == (b).seg) @@ -83,9 +77,9 @@ static inline void set_fs(mm_segment_t s) " subx %0, %0\n" \ " cmpu %4, %1\n" \ " subx %0, %5\n" \ - : "=&r"(flag), "=r"(sum) \ - : "1"(addr), "r"((int)(size)), \ - "r"(current_thread_info()->addr_limit.seg), "r"(0) \ + : "=&r" (flag), "=r" (sum) \ + : "1" (addr), "r" ((int)(size)), \ + "r" (current_thread_info()->addr_limit.seg), "r" (0) \ : "cbit" ); \ flag; }) @@ -113,10 +107,10 @@ static inline void set_fs(mm_segment_t s) #else static inline int access_ok(int type, const void *addr, unsigned long size) { - extern unsigned long memory_start, memory_end; - unsigned long val = (unsigned long)addr; + extern unsigned long memory_start, memory_end; + unsigned long val = (unsigned long)addr; - return ((val >= memory_start) && ((val + size) < memory_end)); + return ((val >= memory_start) && ((val + size) < memory_end)); } #endif /* CONFIG_MMU */ @@ -155,39 +149,6 @@ extern int fixup_exception(struct pt_regs *regs); * accesses to the same area of user memory). */ -extern void __get_user_1(void); -extern void __get_user_2(void); -extern void __get_user_4(void); - -#ifndef MODULE -#define __get_user_x(size,ret,x,ptr) \ - __asm__ __volatile__( \ - " mv r0, %0\n" \ - " mv r1, %1\n" \ - " bl __get_user_" #size "\n" \ - " mv %0, r0\n" \ - " mv %1, r1\n" \ - : "=r"(ret), "=r"(x) \ - : "0"(ptr) \ - : "r0", "r1", "r14" ) -#else /* MODULE */ -/* - * Use "jl" instead of "bl" for MODULE - */ -#define __get_user_x(size,ret,x,ptr) \ - __asm__ __volatile__( \ - " mv r0, %0\n" \ - " mv r1, %1\n" \ - " seth lr, #high(__get_user_" #size ")\n" \ - " or3 lr, lr, #low(__get_user_" #size ")\n" \ - " jl lr\n" \ - " mv %0, r0\n" \ - " mv %1, r1\n" \ - : "=r"(ret), "=r"(x) \ - : "0"(ptr) \ - : "r0", "r1", "r14" ) -#endif - /* Careful: we have to cast the result to the type of the pointer for sign reasons */ /** @@ -208,20 +169,7 @@ extern void __get_user_4(void); * On error, the variable @x is set to zero. */ #define get_user(x,ptr) \ -({ int __ret_gu; \ - unsigned long __val_gu; \ - __chk_user_ptr(ptr); \ - switch(sizeof (*(ptr))) { \ - case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break; \ - case 2: __get_user_x(2,__ret_gu,__val_gu,ptr); break; \ - case 4: __get_user_x(4,__ret_gu,__val_gu,ptr); break; \ - default: __get_user_x(X,__ret_gu,__val_gu,ptr); break; \ - } \ - (x) = (__typeof__(*(ptr)))__val_gu; \ - __ret_gu; \ -}) - -extern void __put_user_bad(void); + __get_user_check((x),(ptr),sizeof(*(ptr))) /** * put_user: - Write a simple value into user space. @@ -240,8 +188,7 @@ extern void __put_user_bad(void); * Returns zero on success, or -EFAULT on error. */ #define put_user(x,ptr) \ - __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) - + __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) /** * __get_user: - Get a simple variable from user space, with less checking. @@ -264,8 +211,64 @@ extern void __put_user_bad(void); * On error, the variable @x is set to zero. */ #define __get_user(x,ptr) \ - __get_user_nocheck((x),(ptr),sizeof(*(ptr))) + __get_user_nocheck((x),(ptr),sizeof(*(ptr))) +#define __get_user_nocheck(x,ptr,size) \ +({ \ + long __gu_err = 0; \ + unsigned long __gu_val; \ + might_sleep(); \ + __get_user_size(__gu_val,(ptr),(size),__gu_err); \ + (x) = (__typeof__(*(ptr)))__gu_val; \ + __gu_err; \ +}) + +#define __get_user_check(x,ptr,size) \ +({ \ + long __gu_err = -EFAULT; \ + unsigned long __gu_val = 0; \ + const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ + might_sleep(); \ + if (access_ok(VERIFY_READ,__gu_addr,size)) \ + __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \ + (x) = (__typeof__(*(ptr)))__gu_val; \ + __gu_err; \ +}) + +extern long __get_user_bad(void); + +#define __get_user_size(x,ptr,size,retval) \ +do { \ + retval = 0; \ + __chk_user_ptr(ptr); \ + switch (size) { \ + case 1: __get_user_asm(x,ptr,retval,"ub"); break; \ + case 2: __get_user_asm(x,ptr,retval,"uh"); break; \ + case 4: __get_user_asm(x,ptr,retval,""); break; \ + default: (x) = __get_user_bad(); \ + } \ +} while (0) + +#define __get_user_asm(x, addr, err, itype) \ + __asm__ __volatile__( \ + " .fillinsn\n" \ + "1: ld"itype" %1,@%2\n" \ + " .fillinsn\n" \ + "2:\n" \ + ".section .fixup,\"ax\"\n" \ + " .balign 4\n" \ + "3: ldi %0,%3\n" \ + " seth r14,#high(2b)\n" \ + " or3 r14,r14,#low(2b)\n" \ + " jmp r14\n" \ + ".previous\n" \ + ".section __ex_table,\"a\"\n" \ + " .balign 4\n" \ + " .long 1b,3b\n" \ + ".previous" \ + : "=&r" (err), "=&r" (x) \ + : "r" (addr), "i" (-EFAULT), "0" (err) \ + : "r14", "memory") /** * __put_user: - Write a simple value into user space, with less checking. @@ -287,11 +290,13 @@ extern void __put_user_bad(void); * Returns zero on success, or -EFAULT on error. */ #define __put_user(x,ptr) \ - __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) + __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) + #define __put_user_nocheck(x,ptr,size) \ ({ \ long __pu_err; \ + might_sleep(); \ __put_user_size((x),(ptr),(size),__pu_err); \ __pu_err; \ }) @@ -308,28 +313,28 @@ extern void __put_user_bad(void); }) #if defined(__LITTLE_ENDIAN__) -#define __put_user_u64(x, addr, err) \ - __asm__ __volatile__( \ - " .fillinsn\n" \ - "1: st %L1,@%2\n" \ - " .fillinsn\n" \ - "2: st %H1,@(4,%2)\n" \ - " .fillinsn\n" \ - "3:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "4: ldi %0,%3\n" \ - " seth r14,#high(3b)\n" \ - " or3 r14,r14,#low(3b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 1b,4b\n" \ - " .long 2b,4b\n" \ - ".previous" \ - : "=&r"(err) \ - : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ +#define __put_user_u64(x, addr, err) \ + __asm__ __volatile__( \ + " .fillinsn\n" \ + "1: st %L1,@%2\n" \ + " .fillinsn\n" \ + "2: st %H1,@(4,%2)\n" \ + " .fillinsn\n" \ + "3:\n" \ + ".section .fixup,\"ax\"\n" \ + " .balign 4\n" \ + "4: ldi %0,%3\n" \ + " seth r14,#high(3b)\n" \ + " or3 r14,r14,#low(3b)\n" \ + " jmp r14\n" \ + ".previous\n" \ + ".section __ex_table,\"a\"\n" \ + " .balign 4\n" \ + " .long 1b,4b\n" \ + " .long 2b,4b\n" \ + ".previous" \ + : "=&r" (err) \ + : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ : "r14", "memory") #elif defined(__BIG_ENDIAN__) @@ -353,13 +358,15 @@ extern void __put_user_bad(void); " .long 1b,4b\n" \ " .long 2b,4b\n" \ ".previous" \ - : "=&r"(err) \ - : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ + : "=&r" (err) \ + : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ : "r14", "memory") #else #error no endian defined #endif +extern void __put_user_bad(void); + #define __put_user_size(x,ptr,size,retval) \ do { \ retval = 0; \ @@ -398,52 +405,8 @@ struct __large_struct { unsigned long buf[100]; }; " .balign 4\n" \ " .long 1b,3b\n" \ ".previous" \ - : "=&r"(err) \ - : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ - : "r14", "memory") - -#define __get_user_nocheck(x,ptr,size) \ -({ \ - long __gu_err; \ - unsigned long __gu_val; \ - __get_user_size(__gu_val,(ptr),(size),__gu_err); \ - (x) = (__typeof__(*(ptr)))__gu_val; \ - __gu_err; \ -}) - -extern long __get_user_bad(void); - -#define __get_user_size(x,ptr,size,retval) \ -do { \ - retval = 0; \ - __chk_user_ptr(ptr); \ - switch (size) { \ - case 1: __get_user_asm(x,ptr,retval,"ub"); break; \ - case 2: __get_user_asm(x,ptr,retval,"uh"); break; \ - case 4: __get_user_asm(x,ptr,retval,""); break; \ - default: (x) = __get_user_bad(); \ - } \ -} while (0) - -#define __get_user_asm(x, addr, err, itype) \ - __asm__ __volatile__( \ - " .fillinsn\n" \ - "1: ld"itype" %1,@%2\n" \ - " .fillinsn\n" \ - "2:\n" \ - ".section .fixup,\"ax\"\n" \ - " .balign 4\n" \ - "3: ldi %0,%3\n" \ - " seth r14,#high(2b)\n" \ - " or3 r14,r14,#low(2b)\n" \ - " jmp r14\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n" \ - " .balign 4\n" \ - " .long 1b,3b\n" \ - ".previous" \ - : "=&r"(err), "=&r"(x) \ - : "r"(addr), "i"(-EFAULT), "0"(err) \ + : "=&r" (err) \ + : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ : "r14", "memory") /* @@ -453,7 +416,6 @@ do { \ * anything, so this is accurate. */ - /* * Copy To/From Userspace */ @@ -511,8 +473,9 @@ do { \ " .long 2b,9b\n" \ " .long 3b,9b\n" \ ".previous\n" \ - : "=&r"(__dst), "=&r"(__src), "=&r"(size), "=&r"(__c) \ - : "0"(to), "1"(from), "2"(size), "3"(size / 4) \ + : "=&r" (__dst), "=&r" (__src), "=&r" (size), \ + "=&r" (__c) \ + : "0" (to), "1" (from), "2" (size), "3" (size / 4) \ : "r14", "memory"); \ } while (0) @@ -573,8 +536,9 @@ do { \ " .long 2b,7b\n" \ " .long 3b,7b\n" \ ".previous\n" \ - : "=&r"(__dst), "=&r"(__src), "=&r"(size), "=&r"(__c) \ - : "0"(to), "1"(from), "2"(size), "3"(size / 4) \ + : "=&r" (__dst), "=&r" (__src), "=&r" (size), \ + "=&r" (__c) \ + : "0" (to), "1" (from), "2" (size), "3" (size / 4) \ : "r14", "memory"); \ } while (0) @@ -676,7 +640,7 @@ unsigned long __generic_copy_from_user(void *, const void __user *, unsigned lon #define copy_from_user(to,from,n) \ ({ \ might_sleep(); \ -__generic_copy_from_user((to),(from),(n)); \ + __generic_copy_from_user((to),(from),(n)); \ }) long __must_check strncpy_from_user(char *dst, const char __user *src, diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h index 39be87ca2a5..be0eb014c3b 100644 --- a/include/asm-m32r/unistd.h +++ b/include/asm-m32r/unistd.h @@ -292,7 +292,7 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_sys_kexec_load 283 +#define __NR_kexec_load 283 #define __NR_waitid 284 #define NR_syscalls 285 diff --git a/include/asm-mips/numnodes.h b/include/asm-mips/numnodes.h deleted file mode 100644 index 4f00c16ceeb..00000000000 --- a/include/asm-mips/numnodes.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _ASM_MAX_NUMNODES_H -#define _ASM_MAX_NUMNODES_H - -/* Max 128 Nodes */ -#define NODES_SHIFT 6 - -#endif /* _ASM_MAX_NUMNODES_H */ diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h index 4dc7253ff5d..403ea97316c 100644 --- a/include/asm-parisc/atomic.h +++ b/include/asm-parisc/atomic.h @@ -210,6 +210,8 @@ static __inline__ int atomic_read(const atomic_t *v) #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) +#define atomic_sub_and_test(i,v) (atomic_sub_return((i),(v)) == 0) + #define ATOMIC_INIT(i) ((atomic_t) { (i) }) #define smp_mb__before_atomic_dec() smp_mb() @@ -267,6 +269,7 @@ atomic64_read(const atomic64_t *v) #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0) #define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0) +#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i),(v)) == 0) #endif /* __LP64__ */ diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h index ae50f8e12ee..c831665473c 100644 --- a/include/asm-parisc/cache.h +++ b/include/asm-parisc/cache.h @@ -48,7 +48,7 @@ extern void flush_user_icache_range_asm(unsigned long, unsigned long); extern void flush_kernel_icache_range_asm(unsigned long, unsigned long); extern void flush_user_dcache_range_asm(unsigned long, unsigned long); extern void flush_kernel_dcache_range_asm(unsigned long, unsigned long); -extern void flush_kernel_dcache_page(void *); +extern void flush_kernel_dcache_page_asm(void *); extern void flush_kernel_icache_page(void *); extern void disable_sr_hashing(void); /* turns off space register hashing */ extern void disable_sr_hashing_asm(int); /* low level support for above */ diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h index c53af9ff41b..76b6b7d6046 100644 --- a/include/asm-parisc/cacheflush.h +++ b/include/asm-parisc/cacheflush.h @@ -62,7 +62,7 @@ extern void flush_dcache_page(struct page *page); #define flush_dcache_mmap_unlock(mapping) \ write_unlock_irq(&(mapping)->tree_lock) -#define flush_icache_page(vma,page) do { flush_kernel_dcache_page(page_address(page)); flush_kernel_icache_page(page_address(page)); } while (0) +#define flush_icache_page(vma,page) do { flush_kernel_dcache_page(page); flush_kernel_icache_page(page_address(page)); } while (0) #define flush_icache_range(s,e) do { flush_kernel_dcache_range_asm(s,e); flush_kernel_icache_range_asm(s,e); } while (0) @@ -184,6 +184,21 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long } +static inline void +flush_anon_page(struct page *page, unsigned long vmaddr) +{ + if (PageAnon(page)) + flush_user_dcache_page(vmaddr); +} +#define ARCH_HAS_FLUSH_ANON_PAGE + +static inline void +flush_kernel_dcache_page(struct page *page) +{ + flush_kernel_dcache_page_asm(page_address(page)); +} +#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE + #ifdef CONFIG_DEBUG_RODATA void mark_rodata_ro(void); #endif diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h index be0c7234a6d..29da31194b9 100644 --- a/include/asm-parisc/io.h +++ b/include/asm-parisc/io.h @@ -25,35 +25,11 @@ extern unsigned long parisc_vmerge_max_size; * eg dev->hpa or 0xfee00000. */ -#ifdef CONFIG_DEBUG_IOREMAP -#ifdef CONFIG_64BIT -#define NYBBLE_SHIFT 60 -#else -#define NYBBLE_SHIFT 28 -#endif -extern void gsc_bad_addr(unsigned long addr); -extern void __raw_bad_addr(const volatile void __iomem *addr); -#define gsc_check_addr(addr) \ - if ((addr >> NYBBLE_SHIFT) != 0xf) { \ - gsc_bad_addr(addr); \ - addr |= 0xfUL << NYBBLE_SHIFT; \ - } -#define __raw_check_addr(addr) \ - if (((unsigned long)addr >> NYBBLE_SHIFT) != 0xe) \ - __raw_bad_addr(addr); \ - addr = (void __iomem *)((unsigned long)addr | (0xfUL << NYBBLE_SHIFT)); -#else -#define gsc_check_addr(addr) -#define __raw_check_addr(addr) -#endif - static inline unsigned char gsc_readb(unsigned long addr) { long flags; unsigned char ret; - gsc_check_addr(addr); - __asm__ __volatile__( " rsm 2,%0\n" " ldbx 0(%2),%1\n" @@ -68,8 +44,6 @@ static inline unsigned short gsc_readw(unsigned long addr) long flags; unsigned short ret; - gsc_check_addr(addr); - __asm__ __volatile__( " rsm 2,%0\n" " ldhx 0(%2),%1\n" @@ -83,8 +57,6 @@ static inline unsigned int gsc_readl(unsigned long addr) { u32 ret; - gsc_check_addr(addr); - __asm__ __volatile__( " ldwax 0(%1),%0\n" : "=r" (ret) : "r" (addr) ); @@ -95,7 +67,6 @@ static inline unsigned int gsc_readl(unsigned long addr) static inline unsigned long long gsc_readq(unsigned long addr) { unsigned long long ret; - gsc_check_addr(addr); #ifdef __LP64__ __asm__ __volatile__( @@ -112,8 +83,6 @@ static inline unsigned long long gsc_readq(unsigned long addr) static inline void gsc_writeb(unsigned char val, unsigned long addr) { long flags; - gsc_check_addr(addr); - __asm__ __volatile__( " rsm 2,%0\n" " stbs %1,0(%2)\n" @@ -124,8 +93,6 @@ static inline void gsc_writeb(unsigned char val, unsigned long addr) static inline void gsc_writew(unsigned short val, unsigned long addr) { long flags; - gsc_check_addr(addr); - __asm__ __volatile__( " rsm 2,%0\n" " sths %1,0(%2)\n" @@ -135,8 +102,6 @@ static inline void gsc_writew(unsigned short val, unsigned long addr) static inline void gsc_writel(unsigned int val, unsigned long addr) { - gsc_check_addr(addr); - __asm__ __volatile__( " stwas %0,0(%1)\n" : : "r" (val), "r" (addr) ); @@ -144,8 +109,6 @@ static inline void gsc_writel(unsigned int val, unsigned long addr) static inline void gsc_writeq(unsigned long long val, unsigned long addr) { - gsc_check_addr(addr); - #ifdef __LP64__ __asm__ __volatile__( " stda %0,0(%1)\n" @@ -180,14 +143,7 @@ extern inline void * ioremap_nocache(unsigned long offset, unsigned long size) extern void iounmap(void __iomem *addr); -/* - * USE_HPPA_IOREMAP is the magic flag to enable or disable real ioremap() - * functionality. It's currently disabled because it may not work on some - * machines. - */ -#define USE_HPPA_IOREMAP 0 -#if USE_HPPA_IOREMAP static inline unsigned char __raw_readb(const volatile void __iomem *addr) { return (*(volatile unsigned char __force *) (addr)); @@ -221,57 +177,6 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add { *(volatile unsigned long long __force *) addr = b; } -#else /* !USE_HPPA_IOREMAP */ -static inline unsigned char __raw_readb(const volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - return gsc_readb((unsigned long) addr); -} -static inline unsigned short __raw_readw(const volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - return gsc_readw((unsigned long) addr); -} -static inline unsigned int __raw_readl(const volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - return gsc_readl((unsigned long) addr); -} -static inline unsigned long long __raw_readq(const volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - return gsc_readq((unsigned long) addr); -} - -static inline void __raw_writeb(unsigned char b, volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - gsc_writeb(b, (unsigned long) addr); -} -static inline void __raw_writew(unsigned short b, volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - gsc_writew(b, (unsigned long) addr); -} -static inline void __raw_writel(unsigned int b, volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - gsc_writel(b, (unsigned long) addr); -} -static inline void __raw_writeq(unsigned long long b, volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - gsc_writeq(b, (unsigned long) addr); -} -#endif /* !USE_HPPA_IOREMAP */ /* readb can never be const, so use __fswab instead of le*_to_cpu */ #define readb(addr) __raw_readb(addr) diff --git a/include/asm-parisc/local.h b/include/asm-parisc/local.h index 892b3b2c496..d0f55091275 100644 --- a/include/asm-parisc/local.h +++ b/include/asm-parisc/local.h @@ -4,16 +4,16 @@ #include <linux/percpu.h> #include <asm/atomic.h> -typedef atomic_t local_t; +typedef atomic_long_t local_t; -#define LOCAL_INIT(i) ATOMIC_INIT(i) -#define local_read(v) atomic_read(v) -#define local_set(v,i) atomic_set(v,i) +#define LOCAL_INIT(i) ATOMIC_LONG_INIT(i) +#define local_read(v) atomic_long_read(v) +#define local_set(v,i) atomic_long_set(v,i) -#define local_inc(v) atomic_inc(v) -#define local_dec(v) atomic_dec(v) -#define local_add(i, v) atomic_add(i, v) -#define local_sub(i, v) atomic_sub(i, v) +#define local_inc(v) atomic_long_inc(v) +#define local_dec(v) atomic_long_dec(v) +#define local_add(i, v) atomic_long_add(i, v) +#define local_sub(i, v) atomic_long_sub(i, v) #define __local_inc(v) ((v)->counter++) #define __local_dec(v) ((v)->counter--) diff --git a/include/asm-parisc/numnodes.h b/include/asm-parisc/numnodes.h deleted file mode 100644 index 6c67651efd1..00000000000 --- a/include/asm-parisc/numnodes.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _ASM_MAX_NUMNODES_H -#define _ASM_MAX_NUMNODES_H - -/* Max 8 Nodes */ -#define NODES_SHIFT 3 - -#endif /* _ASM_MAX_NUMNODES_H */ diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h index 9f303c0c3cd..45e02aa5bf4 100644 --- a/include/asm-parisc/page.h +++ b/include/asm-parisc/page.h @@ -26,7 +26,7 @@ static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, struct page *pg) { copy_user_page_asm(vto, vfrom); - flush_kernel_dcache_page(vto); + flush_kernel_dcache_page_asm(vto); /* XXX: ppc flushes icache too, should we? */ } @@ -40,14 +40,19 @@ clear_user_page(void *page, unsigned long vaddr, struct page *pg) /* * These are used to make use of C type-checking.. */ -#ifdef __LP64__ -typedef struct { unsigned long pte; } pte_t; -#else -typedef struct { - unsigned long pte; - unsigned long flags; -} pte_t; +#define STRICT_MM_TYPECHECKS +#ifdef STRICT_MM_TYPECHECKS +typedef struct { unsigned long pte; +#if !defined(CONFIG_64BIT) + unsigned long future_flags; + /* XXX: it's possible to remove future_flags and change BITS_PER_PTE_ENTRY + to 2, but then strangely the identical 32bit kernel boots on a + c3000(pa20), but not any longer on a 715(pa11). + Still investigating... HelgeD. + */ #endif +} pte_t; /* either 32 or 64bit */ + /* NOTE: even on 64 bits, these entries are __u32 because we allocate * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */ typedef struct { __u32 pmd; } pmd_t; @@ -55,25 +60,44 @@ typedef struct { __u32 pgd; } pgd_t; typedef struct { unsigned long pgprot; } pgprot_t; #define pte_val(x) ((x).pte) -#ifdef __LP64__ -#define pte_flags(x) (*(__u32 *)&((x).pte)) -#else -#define pte_flags(x) ((x).flags) -#endif - /* These do not work lvalues, so make sure we don't use them as such. */ #define pmd_val(x) ((x).pmd + 0) #define pgd_val(x) ((x).pgd + 0) #define pgprot_val(x) ((x).pgprot) -#define __pmd_val_set(x,n) (x).pmd = (n) -#define __pgd_val_set(x,n) (x).pgd = (n) - #define __pte(x) ((pte_t) { (x) } ) #define __pmd(x) ((pmd_t) { (x) } ) #define __pgd(x) ((pgd_t) { (x) } ) #define __pgprot(x) ((pgprot_t) { (x) } ) +#define __pmd_val_set(x,n) (x).pmd = (n) +#define __pgd_val_set(x,n) (x).pgd = (n) + +#else +/* + * .. while these make it easier on the compiler + */ +typedef unsigned long pte_t; +typedef __u32 pmd_t; +typedef __u32 pgd_t; +typedef unsigned long pgprot_t; + +#define pte_val(x) (x) +#define pmd_val(x) (x) +#define pgd_val(x) (x) +#define pgprot_val(x) (x) + +#define __pte(x) (x) +#define __pmd(x) (x) +#define __pgd(x) (x) +#define __pgprot(x) (x) + +#define __pmd_val_set(x,n) (x) = (n) +#define __pgd_val_set(x,n) (x) = (n) + +#endif /* STRICT_MM_TYPECHECKS */ + + typedef struct __physmem_range { unsigned long start_pfn; unsigned long pages; /* PAGE_SIZE pages */ diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index fe7f6a2f5aa..77bbafb7f73 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h @@ -289,4 +289,9 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev) { } +static inline void pcibios_penalize_isa_irq(int irq, int active) +{ + /* We don't need to penalize isa irq's */ +} + #endif /* __ASM_PARISC_PCI_H */ diff --git a/include/asm-parisc/pdc_chassis.h b/include/asm-parisc/pdc_chassis.h index adac9ac2743..a609273dc6b 100644 --- a/include/asm-parisc/pdc_chassis.h +++ b/include/asm-parisc/pdc_chassis.h @@ -6,9 +6,8 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h index 16c2ac075fc..a93960e232c 100644 --- a/include/asm-parisc/spinlock.h +++ b/include/asm-parisc/spinlock.h @@ -134,14 +134,22 @@ static __inline__ int __raw_write_trylock(raw_rwlock_t *rw) return 1; } -static __inline__ int __raw_is_read_locked(raw_rwlock_t *rw) +/* + * read_can_lock - would read_trylock() succeed? + * @lock: the rwlock in question. + */ +static __inline__ int __raw_read_can_lock(raw_rwlock_t *rw) { - return rw->counter > 0; + return rw->counter >= 0; } -static __inline__ int __raw_is_write_locked(raw_rwlock_t *rw) +/* + * write_can_lock - would write_trylock() succeed? + * @lock: the rwlock in question. + */ +static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw) { - return rw->counter < 0; + return !rw->counter; } #endif /* __ASM_SPINLOCK_H */ diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h index ac32f140b83..f2f83b04cd8 100644 --- a/include/asm-parisc/thread_info.h +++ b/include/asm-parisc/thread_info.h @@ -49,7 +49,8 @@ struct thread_info { #endif /* !__ASSEMBLY */ -#define PREEMPT_ACTIVE 0x10000000 +#define PREEMPT_ACTIVE_BIT 28 +#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT) /* * thread information flags diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h index 99817a802ca..f44b529e329 100644 --- a/include/asm-powerpc/bug.h +++ b/include/asm-powerpc/bug.h @@ -30,34 +30,60 @@ struct bug_entry *find_bug(unsigned long bugaddr); #ifdef CONFIG_BUG +/* + * BUG_ON() and WARN_ON() do their best to cooperate with compile-time + * optimisations. However depending on the complexity of the condition + * some compiler versions may not produce optimal results. + */ + #define BUG() do { \ __asm__ __volatile__( \ "1: twi 31,0,0\n" \ ".section __bug_table,\"a\"\n" \ - "\t"PPC_LONG" 1b,%0,%1,%2\n" \ + "\t"PPC_LONG" 1b,%0,%1,%2\n" \ ".previous" \ : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ } while (0) #define BUG_ON(x) do { \ - __asm__ __volatile__( \ + if (__builtin_constant_p(x)) { \ + if (x) \ + BUG(); \ + } else { \ + __asm__ __volatile__( \ "1: "PPC_TLNEI" %0,0\n" \ ".section __bug_table,\"a\"\n" \ - "\t"PPC_LONG" 1b,%1,%2,%3\n" \ + "\t"PPC_LONG" 1b,%1,%2,%3\n" \ ".previous" \ : : "r" ((long)(x)), "i" (__LINE__), \ "i" (__FILE__), "i" (__FUNCTION__)); \ + } \ } while (0) -#define WARN_ON(x) do { \ +#define __WARN() do { \ __asm__ __volatile__( \ + "1: twi 31,0,0\n" \ + ".section __bug_table,\"a\"\n" \ + "\t"PPC_LONG" 1b,%0,%1,%2\n" \ + ".previous" \ + : : "i" (__LINE__ + BUG_WARNING_TRAP), \ + "i" (__FILE__), "i" (__FUNCTION__)); \ +} while (0) + +#define WARN_ON(x) do { \ + if (__builtin_constant_p(x)) { \ + if (x) \ + __WARN(); \ + } else { \ + __asm__ __volatile__( \ "1: "PPC_TLNEI" %0,0\n" \ ".section __bug_table,\"a\"\n" \ - "\t"PPC_LONG" 1b,%1,%2,%3\n" \ + "\t"PPC_LONG" 1b,%1,%2,%3\n" \ ".previous" \ : : "r" ((long)(x)), \ "i" (__LINE__ + BUG_WARNING_TRAP), \ "i" (__FILE__), "i" (__FUNCTION__)); \ + } \ } while (0) #define HAVE_ARCH_BUG diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index fe45f6f3a4b..4321483cce5 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h @@ -188,153 +188,154 @@ extern void do_cpu_ftr_fixups(unsigned long offset); !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \ !defined(CONFIG_BOOKE)) -enum { - CPU_FTRS_PPC601 = CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE, - CPU_FTRS_603 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP, - CPU_FTRS_604 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE, - CPU_FTRS_740_NOTAU = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - CPU_FTRS_740 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | - CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - CPU_FTRS_750 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | - CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, - CPU_FTRS_750FX1 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | - CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM, - CPU_FTRS_750FX2 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | - CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_NO_DPM, - CPU_FTRS_750FX = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | - CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, - CPU_FTRS_750GX = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | - CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | - CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | - CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, - CPU_FTRS_7400_NOTAU = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | - CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | - CPU_FTR_MAYBE_CAN_NAP, - CPU_FTRS_7400 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | - CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | - CPU_FTR_MAYBE_CAN_NAP, - CPU_FTRS_7450_20 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | - CPU_FTR_NEED_COHERENT, - CPU_FTRS_7450_21 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | - CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | - CPU_FTR_NEED_COHERENT, - CPU_FTRS_7450_23 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | - CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT, - CPU_FTRS_7455_1 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | - CPU_FTR_NEED_COHERENT, - CPU_FTRS_7455_20 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | - CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | - CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS, - CPU_FTRS_7455 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | - CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | - CPU_FTR_NEED_COHERENT, - CPU_FTRS_7447_10 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | - CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | - CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, - CPU_FTRS_7447 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | - CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | - CPU_FTR_NEED_COHERENT, - CPU_FTRS_7447A = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | - CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | - CPU_FTR_NEED_COHERENT, - CPU_FTRS_82XX = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB, - CPU_FTRS_G2_LE = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | - CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS, - CPU_FTRS_E300 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | - CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | - CPU_FTR_COMMON, - CPU_FTRS_CLASSIC32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - CPU_FTRS_POWER3_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, - CPU_FTRS_POWER4_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_NODSISRALIGN, - CPU_FTRS_970_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN, - CPU_FTRS_8XX = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, - CPU_FTRS_40X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_NODSISRALIGN, - CPU_FTRS_44X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_NODSISRALIGN, - CPU_FTRS_E200 = CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN, - CPU_FTRS_E500 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_NODSISRALIGN, - CPU_FTRS_E500_2 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN, - CPU_FTRS_GENERIC_32 = CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN, +#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE) +#define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ + CPU_FTR_MAYBE_CAN_NAP) +#define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE) +#define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) +#define CPU_FTRS_740 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ + CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) +#define CPU_FTRS_750 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ + CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) +#define CPU_FTRS_750FX1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ + CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ + CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM) +#define CPU_FTRS_750FX2 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ + CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ + CPU_FTR_NO_DPM) +#define CPU_FTRS_750FX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ + CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ + CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS) +#define CPU_FTRS_750GX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ + CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS) +#define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ + CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ + CPU_FTR_MAYBE_CAN_NAP) +#define CPU_FTRS_7400 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ + CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ + CPU_FTR_MAYBE_CAN_NAP) +#define CPU_FTRS_7450_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ + CPU_FTR_NEED_COHERENT) +#define CPU_FTRS_7450_21 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | \ + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ + CPU_FTR_NEED_COHERENT) +#define CPU_FTRS_7450_23 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | \ + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT) +#define CPU_FTRS_7455_1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | \ + CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \ + CPU_FTR_NEED_COHERENT) +#define CPU_FTRS_7455_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | \ + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ + CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS) +#define CPU_FTRS_7455 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | \ + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ + CPU_FTR_NEED_COHERENT) +#define CPU_FTRS_7447_10 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | \ + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ + CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC) +#define CPU_FTRS_7447 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | \ + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ + CPU_FTR_NEED_COHERENT) +#define CPU_FTRS_7447A (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | \ + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ + CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ + CPU_FTR_NEED_COHERENT) +#define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) +#define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ + CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS) +#define CPU_FTRS_E300 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ + CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ + CPU_FTR_COMMON) +#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) +#define CPU_FTRS_POWER3_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) +#define CPU_FTRS_POWER4_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_NODSISRALIGN) +#define CPU_FTRS_970_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ + CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN) +#define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) +#define CPU_FTRS_40X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_NODSISRALIGN) +#define CPU_FTRS_44X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_NODSISRALIGN) +#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) +#define CPU_FTRS_E500 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_NODSISRALIGN) +#define CPU_FTRS_E500_2 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN) +#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) #ifdef __powerpc64__ - CPU_FTRS_POWER3 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_HPTE_TABLE | CPU_FTR_IABR, - CPU_FTRS_RS64 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | - CPU_FTR_MMCRA | CPU_FTR_CTRL, - CPU_FTRS_POWER4 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA, - CPU_FTRS_PPC970 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | - CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA, - CPU_FTRS_POWER5 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | - CPU_FTR_MMCRA | CPU_FTR_SMT | - CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | - CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR, - CPU_FTRS_CELL = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | - CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | - CPU_FTR_CTRL | CPU_FTR_PAUSE_ZERO, - CPU_FTRS_COMPATIBLE = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | - CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2, +#define CPU_FTRS_POWER3 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_IABR) +#define CPU_FTRS_RS64 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ + CPU_FTR_MMCRA | CPU_FTR_CTRL) +#define CPU_FTRS_POWER4 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA) +#define CPU_FTRS_PPC970 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ + CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA) +#define CPU_FTRS_POWER5 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ + CPU_FTR_MMCRA | CPU_FTR_SMT | \ + CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ + CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR) +#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ + CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ + CPU_FTR_CTRL | CPU_FTR_PAUSE_ZERO) +#define CPU_FTRS_COMPATIBLE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ + CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2) #endif - CPU_FTRS_POSSIBLE = #ifdef __powerpc64__ - CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | - CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_CELL | - CPU_FTR_CI_LARGE_PAGE | +#define CPU_FTRS_POSSIBLE \ + (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ + CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_CELL | \ + CPU_FTR_CI_LARGE_PAGE) #else +enum { + CPU_FTRS_POSSIBLE = #if CLASSIC_PPC CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU | CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 | @@ -368,14 +369,18 @@ enum { #ifdef CONFIG_E500 CPU_FTRS_E500 | CPU_FTRS_E500_2 | #endif -#endif /* __powerpc64__ */ 0, +}; +#endif /* __powerpc64__ */ - CPU_FTRS_ALWAYS = #ifdef __powerpc64__ - CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & - CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_CELL & +#define CPU_FTRS_ALWAYS \ + (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ + CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_CELL & \ + CPU_FTRS_POSSIBLE) #else +enum { + CPU_FTRS_ALWAYS = #if CLASSIC_PPC CPU_FTRS_PPC601 & CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU & CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 & @@ -409,9 +414,9 @@ enum { #ifdef CONFIG_E500 CPU_FTRS_E500 & CPU_FTRS_E500_2 & #endif -#endif /* __powerpc64__ */ CPU_FTRS_POSSIBLE, }; +#endif /* __powerpc64__ */ static inline int cpu_has_feature(unsigned long feature) { diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index 5207758a6dd..868c7139dbf 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h @@ -60,24 +60,10 @@ void __init pci_addr_cache_build(void); * device (including config space i/o). Call eeh_add_device_late * to finish the eeh setup for this device. */ -void eeh_add_device_early(struct device_node *); -void eeh_add_device_late(struct pci_dev *dev); void eeh_add_device_tree_early(struct device_node *); void eeh_add_device_tree_late(struct pci_bus *); /** - * eeh_remove_device - undo EEH setup for the indicated pci device - * @dev: pci device to be removed - * - * This routine should be called when a device is removed from - * a running system (e.g. by hotplug or dlpar). It unregisters - * the PCI device from the EEH subsystem. I/O errors affecting - * this device will no longer be detected after this call; thus, - * i/o errors affecting this slot may leave this device unusable. - */ -void eeh_remove_device(struct pci_dev *); - -/** * eeh_remove_device_recursive - undo EEH for device & children. * @dev: pci device to be removed * @@ -116,12 +102,6 @@ static inline int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *d static inline void pci_addr_cache_build(void) { } -static inline void eeh_add_device_early(struct device_node *dn) { } - -static inline void eeh_add_device_late(struct pci_dev *dev) { } - -static inline void eeh_remove_device(struct pci_dev *dev) { } - static inline void eeh_add_device_tree_early(struct device_node *dn) { } static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h index ce3788224ed..77069df92bf 100644 --- a/include/asm-powerpc/firmware.h +++ b/include/asm-powerpc/firmware.h @@ -82,13 +82,11 @@ enum { /* This is used to identify firmware features which are available * to the kernel. */ -extern unsigned long ppc64_firmware_features; +extern unsigned long powerpc_firmware_features; -static inline unsigned long firmware_has_feature(unsigned long feature) -{ - return (FW_FEATURE_ALWAYS & feature) || - (FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature); -} +#define firmware_has_feature(feature) \ + ((FW_FEATURE_ALWAYS & (feature)) || \ + (FW_FEATURE_POSSIBLE & powerpc_firmware_features & (feature))) extern void system_reset_fwnmi(void); extern void machine_check_fwnmi(void); diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h index e258778ca42..608164c39ef 100644 --- a/include/asm-powerpc/floppy.h +++ b/include/asm-powerpc/floppy.h @@ -35,6 +35,7 @@ #ifdef CONFIG_PCI #include <linux/pci.h> +#include <asm/ppc-pci.h> /* for ppc64_isabridge_dev */ #define fd_dma_setup(addr,size,mode,io) powerpc_fd_dma_setup(addr,size,mode,io) @@ -52,12 +53,12 @@ static __inline__ int powerpc_fd_dma_setup(char *addr, unsigned long size, if (bus_addr && (addr != prev_addr || size != prev_size || dir != prev_dir)) { /* different from last time -- unmap prev */ - pci_unmap_single(NULL, bus_addr, prev_size, prev_dir); + pci_unmap_single(ppc64_isabridge_dev, bus_addr, prev_size, prev_dir); bus_addr = 0; } if (!bus_addr) /* need to map it */ - bus_addr = pci_map_single(NULL, addr, size, dir); + bus_addr = pci_map_single(ppc64_isabridge_dev, addr, size, dir); /* remember this one as prev */ prev_addr = addr; diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index 38ca9ad6110..6cc7e1fb7bf 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h @@ -4,46 +4,88 @@ #define HVSC .long 0x44000022 -#define H_Success 0 -#define H_Busy 1 /* Hardware busy -- retry later */ -#define H_Closed 2 /* Resource closed */ -#define H_Constrained 4 /* Resource request constrained to max allowed */ -#define H_InProgress 14 /* Kind of like busy */ -#define H_Continue 18 /* Returned from H_Join on success */ -#define H_LongBusyStartRange 9900 /* Start of long busy range */ -#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ -#define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ -#define H_LongBusyOrder100msec 9902 /* Long busy, hint that 100msec is a good time to retry */ -#define H_LongBusyOrder1sec 9903 /* Long busy, hint that 1sec is a good time to retry */ -#define H_LongBusyOrder10sec 9904 /* Long busy, hint that 10sec is a good time to retry */ -#define H_LongBusyOrder100sec 9905 /* Long busy, hint that 100sec is a good time to retry */ -#define H_LongBusyEndRange 9905 /* End of long busy range */ -#define H_Hardware -1 /* Hardware error */ -#define H_Function -2 /* Function not supported */ -#define H_Privilege -3 /* Caller not privileged */ -#define H_Parameter -4 /* Parameter invalid, out-of-range or conflicting */ -#define H_Bad_Mode -5 /* Illegal msr value */ -#define H_PTEG_Full -6 /* PTEG is full */ -#define H_Not_Found -7 /* PTE was not found" */ -#define H_Reserved_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */ -#define H_NoMem -9 -#define H_Authority -10 -#define H_Permission -11 -#define H_Dropped -12 -#define H_SourceParm -13 -#define H_DestParm -14 -#define H_RemoteParm -15 -#define H_Resource -16 +#define H_SUCCESS 0 +#define H_BUSY 1 /* Hardware busy -- retry later */ +#define H_CLOSED 2 /* Resource closed */ +#define H_NOT_AVAILABLE 3 +#define H_CONSTRAINED 4 /* Resource request constrained to max allowed */ +#define H_PARTIAL 5 +#define H_IN_PROGRESS 14 /* Kind of like busy */ +#define H_PAGE_REGISTERED 15 +#define H_PARTIAL_STORE 16 +#define H_PENDING 17 /* returned from H_POLL_PENDING */ +#define H_CONTINUE 18 /* Returned from H_Join on success */ +#define H_LONG_BUSY_START_RANGE 9900 /* Start of long busy range */ +#define H_LONG_BUSY_ORDER_1_MSEC 9900 /* Long busy, hint that 1msec \ + is a good time to retry */ +#define H_LONG_BUSY_ORDER_10_MSEC 9901 /* Long busy, hint that 10msec \ + is a good time to retry */ +#define H_LONG_BUSY_ORDER_100_MSEC 9902 /* Long busy, hint that 100msec \ + is a good time to retry */ +#define H_LONG_BUSY_ORDER_1_SEC 9903 /* Long busy, hint that 1sec \ + is a good time to retry */ +#define H_LONG_BUSY_ORDER_10_SEC 9904 /* Long busy, hint that 10sec \ + is a good time to retry */ +#define H_LONG_BUSY_ORDER_100_SEC 9905 /* Long busy, hint that 100sec \ + is a good time to retry */ +#define H_LONG_BUSY_END_RANGE 9905 /* End of long busy range */ +#define H_HARDWARE -1 /* Hardware error */ +#define H_FUNCTION -2 /* Function not supported */ +#define H_PRIVILEGE -3 /* Caller not privileged */ +#define H_PARAMETER -4 /* Parameter invalid, out-of-range or conflicting */ +#define H_BAD_MODE -5 /* Illegal msr value */ +#define H_PTEG_FULL -6 /* PTEG is full */ +#define H_NOT_FOUND -7 /* PTE was not found" */ +#define H_RESERVED_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */ +#define H_NO_MEM -9 +#define H_AUTHORITY -10 +#define H_PERMISSION -11 +#define H_DROPPED -12 +#define H_SOURCE_PARM -13 +#define H_DEST_PARM -14 +#define H_REMOTE_PARM -15 +#define H_RESOURCE -16 +#define H_ADAPTER_PARM -17 +#define H_RH_PARM -18 +#define H_RCQ_PARM -19 +#define H_SCQ_PARM -20 +#define H_EQ_PARM -21 +#define H_RT_PARM -22 +#define H_ST_PARM -23 +#define H_SIGT_PARM -24 +#define H_TOKEN_PARM -25 +#define H_MLENGTH_PARM -27 +#define H_MEM_PARM -28 +#define H_MEM_ACCESS_PARM -29 +#define H_ATTR_PARM -30 +#define H_PORT_PARM -31 +#define H_MCG_PARM -32 +#define H_VL_PARM -33 +#define H_TSIZE_PARM -34 +#define H_TRACE_PARM -35 + +#define H_MASK_PARM -37 +#define H_MCG_FULL -38 +#define H_ALIAS_EXIST -39 +#define H_P_COUNTER -40 +#define H_TABLE_FULL -41 +#define H_ALT_TABLE -42 +#define H_MR_CONDITION -43 +#define H_NOT_ENOUGH_RESOURCES -44 +#define H_R_STATE -45 +#define H_RESCINDEND -46 + /* Long Busy is a condition that can be returned by the firmware * when a call cannot be completed now, but the identical call * should be retried later. This prevents calls blocking in the - * firmware for long periods of time. Annoyingly the firmware can return + * firmware for long periods of time. Annoyingly the firmware can return * a range of return codes, hinting at how long we should wait before * retrying. If you don't care for the hint, the macro below is a good * way to check for the long_busy return codes */ -#define H_isLongBusy(x) ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange)) +#define H_IS_LONG_BUSY(x) ((x >= H_LONG_BUSY_START_RANGE) \ + && (x <= H_LONG_BUSY_END_RANGE)) /* Flags */ #define H_LARGE_PAGE (1UL<<(63-16)) @@ -65,6 +107,9 @@ #define H_DABRX_KERNEL (1UL<<(63-62)) #define H_DABRX_USER (1UL<<(63-63)) +/* Each control block has to be on a 4K bondary */ +#define H_CB_ALIGNMENT 4096 + /* pSeries hypervisor opcodes */ #define H_REMOVE 0x04 #define H_ENTER 0x08 @@ -98,25 +143,52 @@ #define H_PERFMON 0x7c #define H_MIGRATE_DMA 0x78 #define H_REGISTER_VPA 0xDC -#define H_CEDE 0xE0 +#define H_CEDE 0xE0 #define H_CONFER 0xE4 -#define H_PROD 0xE8 +#define H_PROD 0xE8 #define H_GET_PPP 0xEC #define H_SET_PPP 0xF0 #define H_PURR 0xF4 -#define H_PIC 0xF8 +#define H_PIC 0xF8 #define H_REG_CRQ 0xFC #define H_FREE_CRQ 0x100 #define H_VIO_SIGNAL 0x104 #define H_SEND_CRQ 0x108 -#define H_COPY_RDMA 0x110 +#define H_COPY_RDMA 0x110 #define H_SET_XDABR 0x134 #define H_STUFF_TCE 0x138 #define H_PUT_TCE_INDIRECT 0x13C #define H_VTERM_PARTNER_INFO 0x150 #define H_REGISTER_VTERM 0x154 #define H_FREE_VTERM 0x158 -#define H_POLL_PENDING 0x1D8 +#define H_RESET_EVENTS 0x15C +#define H_ALLOC_RESOURCE 0x160 +#define H_FREE_RESOURCE 0x164 +#define H_MODIFY_QP 0x168 +#define H_QUERY_QP 0x16C +#define H_REREGISTER_PMR 0x170 +#define H_REGISTER_SMR 0x174 +#define H_QUERY_MR 0x178 +#define H_QUERY_MW 0x17C +#define H_QUERY_HCA 0x180 +#define H_QUERY_PORT 0x184 +#define H_MODIFY_PORT 0x188 +#define H_DEFINE_AQP1 0x18C +#define H_GET_TRACE_BUFFER 0x190 +#define H_DEFINE_AQP0 0x194 +#define H_RESIZE_MR 0x198 +#define H_ATTACH_MCQP 0x19C +#define H_DETACH_MCQP 0x1A0 +#define H_CREATE_RPT 0x1A4 +#define H_REMOVE_RPT 0x1A8 +#define H_REGISTER_RPAGES 0x1AC +#define H_DISABLE_AND_GETC 0x1B0 +#define H_ERROR_DATA 0x1B4 +#define H_GET_HCA_INFO 0x1B8 +#define H_GET_PERF_COUNT 0x1BC +#define H_MANAGE_TRACE 0x1C0 +#define H_QUERY_INT_STATE 0x1E4 +#define H_POLL_PENDING 0x1D8 #define H_JOIN 0x298 #define H_ENABLE_CRQ 0x2B0 @@ -151,7 +223,7 @@ long plpar_hcall_norets(unsigned long opcode, ...); */ long plpar_hcall_8arg_2ret(unsigned long opcode, unsigned long arg1, - unsigned long arg2, + unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5, @@ -175,6 +247,42 @@ long plpar_hcall_4out(unsigned long opcode, unsigned long *out3, unsigned long *out4); +long plpar_hcall_7arg_7ret(unsigned long opcode, + unsigned long arg1, + unsigned long arg2, + unsigned long arg3, + unsigned long arg4, + unsigned long arg5, + unsigned long arg6, + unsigned long arg7, + unsigned long *out1, + unsigned long *out2, + unsigned long *out3, + unsigned long *out4, + unsigned long *out5, + unsigned long *out6, + unsigned long *out7); + +long plpar_hcall_9arg_9ret(unsigned long opcode, + unsigned long arg1, + unsigned long arg2, + unsigned long arg3, + unsigned long arg4, + unsigned long arg5, + unsigned long arg6, + unsigned long arg7, + unsigned long arg8, + unsigned long arg9, + unsigned long *out1, + unsigned long *out2, + unsigned long *out3, + unsigned long *out4, + unsigned long *out5, + unsigned long *out6, + unsigned long *out7, + unsigned long *out8, + unsigned long *out9); + #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_HVCALL_H */ diff --git a/include/asm-powerpc/hvconsole.h b/include/asm-powerpc/hvconsole.h index 34daf7b9b62..35ea69e8121 100644 --- a/include/asm-powerpc/hvconsole.h +++ b/include/asm-powerpc/hvconsole.h @@ -24,28 +24,18 @@ #ifdef __KERNEL__ /* - * This is the max number of console adapters that can/will be found as - * console devices on first stage console init. Any number beyond this range - * can't be used as a console device but is still a valid tty device. + * PSeries firmware will only send/recv up to 16 bytes of character data per + * hcall. */ -#define MAX_NR_HVC_CONSOLES 16 +#define MAX_VIO_PUT_CHARS 16 +#define SIZE_VIO_GET_CHARS 16 -/* implemented by a low level driver */ -struct hv_ops { - int (*get_chars)(uint32_t vtermno, char *buf, int count); - int (*put_chars)(uint32_t vtermno, const char *buf, int count); -}; +/* + * Vio firmware always attempts to fetch MAX_VIO_GET_CHARS chars. The 'count' + * parm is included to conform to put_chars() function pointer template + */ extern int hvc_get_chars(uint32_t vtermno, char *buf, int count); extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count); -struct hvc_struct; - -/* Register a vterm and a slot index for use as a console (console_init) */ -extern int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops); -/* register a vterm for hvc tty operation (module_init or hotplug add) */ -extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq, - struct hv_ops *ops); -/* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */ -extern int __devexit hvc_remove(struct hvc_struct *hp); #endif /* __KERNEL__ */ #endif /* _PPC64_HVCONSOLE_H */ diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index 51f87d9993b..7bc6d73b282 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h @@ -54,6 +54,13 @@ */ extern unsigned int virt_irq_to_real_map[NR_IRQS]; +/* The maximum virtual IRQ number that we support. This + * can be set by the platform and will be reduced by the + * value of __irq_offset_value. It defaults to and is + * capped by (NR_IRQS - 1). + */ +extern unsigned int virt_irq_max; + /* Create a mapping for a real_irq if it doesn't already exist. * Return the virtual irq as a convenience. */ diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 5348b820788..5ed84768075 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h @@ -47,6 +47,7 @@ struct smp_ops_t { #endif struct machdep_calls { + char *name; #ifdef CONFIG_PPC64 void (*hpte_invalidate)(unsigned long slot, unsigned long va, @@ -85,9 +86,9 @@ struct machdep_calls { void (*iommu_dev_setup)(struct pci_dev *dev); void (*iommu_bus_setup)(struct pci_bus *bus); void (*irq_bus_setup)(struct pci_bus *bus); -#endif +#endif /* CONFIG_PPC64 */ - int (*probe)(int platform); + int (*probe)(void); void (*setup_arch)(void); void (*init_early)(void); /* Optional, may be NULL. */ @@ -158,6 +159,12 @@ struct machdep_calls { /* Idle loop for this platform, leave empty for default idle loop */ void (*idle_loop)(void); + /* + * Function for waiting for work with reduced power in idle loop; + * called with interrupts disabled. + */ + void (*power_save)(void); + /* Function to enable performance monitor counters for this platform, called once per cpu. */ void (*enable_pmcs)(void); @@ -170,13 +177,6 @@ struct machdep_calls { May be NULL. */ void (*init)(void); - void (*idle)(void); - void (*power_save)(void); - - void (*heartbeat)(void); - unsigned long heartbeat_reset; - unsigned long heartbeat_count; - void (*setup_io_mappings)(void); void (*early_serial_map)(void); @@ -208,8 +208,6 @@ struct machdep_calls { /* Called at then very end of pcibios_init() */ void (*pcibios_after_init)(void); - /* this is for modules, since _machine can be a define -- Cort */ - int ppc_machine; #endif /* CONFIG_PPC32 */ /* Called to shutdown machine specific hardware not already controlled @@ -242,10 +240,29 @@ struct machdep_calls { #endif /* CONFIG_KEXEC */ }; -extern void default_idle(void); -extern void native_idle(void); +extern void power4_idle(void); +extern void ppc6xx_idle(void); +/* + * ppc_md contains a copy of the machine description structure for the + * current platform. machine_id contains the initial address where the + * description was found during boot. + */ extern struct machdep_calls ppc_md; +extern struct machdep_calls *machine_id; + +#define __machine_desc __attribute__ ((__section__ (".machine.desc"))) + +#define define_machine(name) struct machdep_calls mach_##name __machine_desc = +#define machine_is(name) \ + ({ \ + extern struct machdep_calls mach_##name \ + __attribute__((weak)); \ + machine_id == &mach_##name; \ + }) + +extern void probe_machine(void); + extern char cmd_line[COMMAND_LINE_SIZE]; #ifdef CONFIG_PPC_PMAC diff --git a/include/asm-powerpc/numnodes.h b/include/asm-powerpc/numnodes.h deleted file mode 100644 index e138edae09d..00000000000 --- a/include/asm-powerpc/numnodes.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _ASM_POWERPC_MAX_NUMNODES_H -#define _ASM_POWERPC_MAX_NUMNODES_H -#ifdef __KERNEL__ - -/* Max 16 Nodes */ -#define NODES_SHIFT 4 - -#endif /* __KERNEL__ */ -#endif /* _ASM_POWERPC_MAX_NUMNODES_H */ diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h index 338e6a7cff4..5b33994cd48 100644 --- a/include/asm-powerpc/oprofile_impl.h +++ b/include/asm-powerpc/oprofile_impl.h @@ -17,9 +17,6 @@ /* Per-counter configuration as set via oprofilefs. */ struct op_counter_config { -#ifdef __powerpc64__ - unsigned long valid; -#endif unsigned long enabled; unsigned long event; unsigned long count; @@ -38,9 +35,6 @@ struct op_system_config { #endif unsigned long enable_kernel; unsigned long enable_user; -#ifdef CONFIG_PPC64 - unsigned long backtrace_spinlocks; -#endif }; /* Per-arch configuration */ @@ -56,17 +50,12 @@ struct op_powerpc_model { int num_counters; }; -#ifdef CONFIG_FSL_BOOKE extern struct op_powerpc_model op_model_fsl_booke; -#else /* Otherwise, it's classic */ - -#ifdef CONFIG_PPC64 extern struct op_powerpc_model op_model_rs64; extern struct op_powerpc_model op_model_power4; - -#else /* Otherwise, CONFIG_PPC32 */ extern struct op_powerpc_model op_model_7450; -#endif + +#ifndef CONFIG_FSL_BOOKE /* All the classic PPC parts use these */ static inline unsigned int ctr_read(unsigned int i) @@ -134,5 +123,7 @@ static inline void ctr_write(unsigned int i, unsigned int val) } #endif /* !CONFIG_FSL_BOOKE */ +extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_OPROFILE_IMPL_H */ diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h index 4465b95ebef..706325f99a8 100644 --- a/include/asm-powerpc/paca.h +++ b/include/asm-powerpc/paca.h @@ -105,5 +105,7 @@ struct paca_struct { extern struct paca_struct paca[]; +void setup_boot_paca(void); + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_PACA_H */ diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h index 464301cd0d0..184a7a4d2fd 100644 --- a/include/asm-powerpc/percpu.h +++ b/include/asm-powerpc/percpu.h @@ -27,7 +27,7 @@ #define percpu_modcopy(pcpudst, src, size) \ do { \ unsigned int __i; \ - for_each_cpu(__i) \ + for_each_possible_cpu(__i) \ memcpy((pcpudst)+__per_cpu_offset(__i), \ (src), (size)); \ } while (0) diff --git a/include/asm-powerpc/pmac_feature.h b/include/asm-powerpc/pmac_feature.h index 3221628130c..d3599cc9aa7 100644 --- a/include/asm-powerpc/pmac_feature.h +++ b/include/asm-powerpc/pmac_feature.h @@ -305,7 +305,7 @@ extern void pmac_feature_init(void); extern void pmac_set_early_video_resume(void (*proc)(void *data), void *data); extern void pmac_call_early_video_resume(void); -#define PMAC_FTR_DEF(x) ((_MACH_Pmac << 16) | (x)) +#define PMAC_FTR_DEF(x) ((0x6660000) | (x)) /* The AGP driver registers itself here */ extern void pmac_register_agp_pm(struct pci_dev *bridge, diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index 1c64a211cf1..93f83efeb31 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h @@ -22,22 +22,6 @@ * -- BenH. */ -/* Platforms codes (to be obsoleted) */ -#define PLATFORM_PSERIES 0x0100 -#define PLATFORM_PSERIES_LPAR 0x0101 -#define PLATFORM_ISERIES_LPAR 0x0201 -#define PLATFORM_LPAR 0x0001 -#define PLATFORM_POWERMAC 0x0400 -#define PLATFORM_MAPLE 0x0500 -#define PLATFORM_PREP 0x0600 -#define PLATFORM_CHRP 0x0700 -#define PLATFORM_CELL 0x1000 - -/* Compat platform codes for 32 bits */ -#define _MACH_prep PLATFORM_PREP -#define _MACH_Pmac PLATFORM_POWERMAC -#define _MACH_chrp PLATFORM_CHRP - /* PREP sub-platform types see residual.h for these */ #define _PREP_Motorola 0x01 /* motorola prep */ #define _PREP_Firm 0x02 /* firmworks prep */ @@ -49,18 +33,14 @@ #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ #define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ -#ifdef __KERNEL__ -#define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ - _machine == PLATFORM_PSERIES_LPAR) +#if defined(__KERNEL__) && defined(CONFIG_PPC32) -#if defined(CONFIG_PPC_MULTIPLATFORM) -extern int _machine; +extern int _chrp_type; -#ifdef CONFIG_PPC32 +#ifdef CONFIG_PPC_PREP /* what kind of prep workstation we are */ extern int _prep_type; -extern int _chrp_type; /* * This is used to identify the board type from a given PReP board @@ -70,17 +50,14 @@ extern int _chrp_type; extern unsigned char ucBoardRev; extern unsigned char ucBoardRevMaj, ucBoardRevMin; -#endif /* CONFIG_PPC32 */ +#endif /* CONFIG_PPC_PREP */ -#elif defined(CONFIG_PPC_ISERIES) -/* - * iSeries is soon to become MULTIPLATFORM hopefully ... - */ -#define _machine PLATFORM_ISERIES_LPAR -#else +#ifndef CONFIG_PPC_MULTIPLATFORM #define _machine 0 #endif /* CONFIG_PPC_MULTIPLATFORM */ -#endif /* __KERNEL__ */ + +#endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */ + /* * Default implementation of macro that returns current * instruction pointer ("program counter"). @@ -251,6 +228,10 @@ static inline unsigned long __pack_fe01(unsigned int fpmode) #define cpu_relax() barrier() #endif +/* Check that a certain kernel stack pointer is valid in task_struct p */ +int validate_sp(unsigned long sp, struct task_struct *p, + unsigned long nbytes); + /* * Prefetch macros. */ diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 782e13a070a..97ef1cd71a4 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h @@ -149,12 +149,14 @@ extern struct device_node *of_node_get(struct device_node *node); extern void of_node_put(struct device_node *node); /* For scanning the flat device-tree at boot time */ -int __init of_scan_flat_dt(int (*it)(unsigned long node, - const char *uname, int depth, - void *data), - void *data); -void* __init of_get_flat_dt_prop(unsigned long node, const char *name, - unsigned long *size); +extern int __init of_scan_flat_dt(int (*it)(unsigned long node, + const char *uname, int depth, + void *data), + void *data); +extern void* __init of_get_flat_dt_prop(unsigned long node, const char *name, + unsigned long *size); +extern int __init of_flat_dt_is_compatible(unsigned long node, const char *name); +extern unsigned long __init of_get_flat_dt_root(void); /* For updating the device tree at runtime */ extern void of_attach_node(struct device_node *); diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index 72bfe3af046..bd467bf5cf5 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h @@ -622,6 +622,10 @@ extern void ppc64_runlatch_off(void); extern unsigned long scom970_read(unsigned int address); extern void scom970_write(unsigned int address, unsigned long value); +#else +#define ppc64_runlatch_on() +#define ppc64_runlatch_off() + #endif /* CONFIG_PPC64 */ #define __get_SP() ({unsigned long sp; \ diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h index 98581e5a827..4a716f707cf 100644 --- a/include/asm-powerpc/smp.h +++ b/include/asm-powerpc/smp.h @@ -29,7 +29,6 @@ #endif extern int boot_cpuid; -extern int boot_cpuid_phys; extern void cpu_die(void); @@ -99,6 +98,7 @@ extern void smp_release_cpus(void); #else /* 32-bit */ #ifndef CONFIG_SMP +extern int boot_cpuid_phys; #define get_hard_smp_processor_id(cpu) boot_cpuid_phys #define set_hard_smp_processor_id(cpu, phys) #endif diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 38bacf2f6e0..f431d8b0b65 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h @@ -110,6 +110,7 @@ struct spu { char *name; unsigned long local_store_phys; u8 *local_store; + unsigned long problem_phys; struct spu_problem __iomem *problem; struct spu_priv1 __iomem *priv1; struct spu_priv2 __iomem *priv2; @@ -137,6 +138,7 @@ struct spu { void (* wbox_callback)(struct spu *spu); void (* ibox_callback)(struct spu *spu); void (* stop_callback)(struct spu *spu); + void (* mfc_callback)(struct spu *spu); char irq_c0[8]; char irq_c1[8]; @@ -149,6 +151,14 @@ int spu_irq_class_0_bottom(struct spu *spu); int spu_irq_class_1_bottom(struct spu *spu); void spu_irq_setaffinity(struct spu *spu, int cpu); +/* system callbacks from the SPU */ +struct spu_syscall_block { + u64 nr_ret; + u64 parm[6]; +}; +extern long spu_sys_callback(struct spu_syscall_block *s); + +/* syscalls implemented in spufs */ extern struct spufs_calls { asmlinkage long (*create_thread)(const char __user *name, unsigned int flags, mode_t mode); @@ -399,7 +409,6 @@ struct spu_priv1 { #define SPU_GET_REVISION_BITS(vr) (vr & SPU_REVISION_BITS) u8 pad_0x28_0x100[0x100 - 0x28]; /* 0x28 */ - /* Interrupt Area */ u64 int_mask_RW[3]; /* 0x100 */ #define CLASS0_ENABLE_DMA_ALIGNMENT_INTR 0x1L diff --git a/include/asm-powerpc/syscalls.h b/include/asm-powerpc/syscalls.h new file mode 100644 index 00000000000..c2fe79d4f90 --- /dev/null +++ b/include/asm-powerpc/syscalls.h @@ -0,0 +1,58 @@ +#ifndef __ASM_POWERPC_SYSCALLS_H +#define __ASM_POWERPC_SYSCALLS_H +#ifdef __KERNEL__ + +#include <linux/compiler.h> +#include <linux/linkage.h> +#include <linux/types.h> +#include <asm/signal.h> + +struct new_utsname; +struct pt_regs; +struct rtas_args; +struct sigaction; + +asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, + unsigned long prot, unsigned long flags, + unsigned long fd, off_t offset); +asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long pgoff); +asmlinkage int sys_execve(unsigned long a0, unsigned long a1, + unsigned long a2, unsigned long a3, unsigned long a4, + unsigned long a5, struct pt_regs *regs); +asmlinkage int sys_clone(unsigned long clone_flags, unsigned long usp, + int __user *parent_tidp, void __user *child_threadptr, + int __user *child_tidp, int p6, struct pt_regs *regs); +asmlinkage int sys_fork(unsigned long p1, unsigned long p2, + unsigned long p3, unsigned long p4, unsigned long p5, + unsigned long p6, struct pt_regs *regs); +asmlinkage int sys_vfork(unsigned long p1, unsigned long p2, + unsigned long p3, unsigned long p4, unsigned long p5, + unsigned long p6, struct pt_regs *regs); +asmlinkage int sys_pipe(int __user *fildes); +asmlinkage long sys_rt_sigaction(int sig, + const struct sigaction __user *act, + struct sigaction __user *oact, size_t sigsetsize); +asmlinkage int sys_ipc(uint call, int first, unsigned long second, + long third, void __user *ptr, long fifth); +asmlinkage long ppc64_personality(unsigned long personality); +asmlinkage int ppc_rtas(struct rtas_args __user *uargs); +asmlinkage time_t sys64_time(time_t __user * tloc); +asmlinkage long ppc_newuname(struct new_utsname __user * name); + +asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, + size_t sigsetsize); + +#ifndef __powerpc64__ +asmlinkage long sys_sigaltstack(const stack_t __user *uss, + stack_t __user *uoss, int r5, int r6, int r7, int r8, + struct pt_regs *regs); +#else /* __powerpc64__ */ +asmlinkage long sys_sigaltstack(const stack_t __user *uss, + stack_t __user *uoss, unsigned long r5, unsigned long r6, + unsigned long r7, unsigned long r8, struct pt_regs *regs); +#endif /* __powerpc64__ */ + +#endif /* __KERNEL__ */ +#endif /* __ASM_POWERPC_SYSCALLS_H */ diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 65f5a7b2646..d075725bf44 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h @@ -365,8 +365,11 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, * powers of 2 writes until it reaches sufficient alignment). * * Based on this we disable the IP header alignment in network drivers. + * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining + * cacheline alignment of buffers. */ -#define NET_IP_ALIGN 0 +#define NET_IP_ALIGN 0 +#define NET_SKB_PAD L1_CACHE_BYTES #endif #define arch_align_stack(x) (x) diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index ffc7462d77b..88b553c6b26 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h @@ -37,6 +37,8 @@ struct thread_info { int preempt_count; /* 0 => preemptable, <0 => BUG */ struct restart_block restart_block; + unsigned long local_flags; /* private flags for thread */ + /* low level flags - has atomic operations done on it */ unsigned long flags ____cacheline_aligned_in_smp; }; @@ -143,6 +145,12 @@ static inline struct thread_info *current_thread_info(void) _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) +/* Bits in local_flags */ +/* Don't move TLF_NAPPING without adjusting the code in entry_32.S */ +#define TLF_NAPPING 0 /* idle thread enabled NAP mode */ + +#define _TLF_NAPPING (1 << TLF_NAPPING) + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_THREAD_INFO_H */ diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 35556993f06..c612f1a6277 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h @@ -301,8 +301,10 @@ #define __NR_pselect6 280 #define __NR_ppoll 281 #define __NR_unshare 282 +#define __NR_splice 283 +#define __NR_tee 284 -#define __NR_syscalls 283 +#define __NR_syscalls 285 #ifdef __KERNEL__ #define __NR__exit __NR_exit @@ -425,6 +427,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 #include <linux/types.h> #include <linux/compiler.h> #include <linux/linkage.h> +#include <asm/syscalls.h> #define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_OLD_READDIR @@ -460,44 +463,10 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 * System call prototypes. */ #ifdef __KERNEL_SYSCALLS__ -extern pid_t setsid(void); -extern int write(int fd, const char *buf, off_t count); -extern int read(int fd, char *buf, off_t count); -extern off_t lseek(int fd, off_t offset, int count); -extern int dup(int fd); extern int execve(const char *file, char **argv, char **envp); -extern int open(const char *file, int flag, int mode); -extern int close(int fd); -extern pid_t waitpid(pid_t pid, int *wait_stat, int options); #endif /* __KERNEL_SYSCALLS__ */ /* - * Functions that implement syscalls. - */ -unsigned long sys_mmap(unsigned long addr, size_t len, unsigned long prot, - unsigned long flags, unsigned long fd, off_t offset); -unsigned long sys_mmap2(unsigned long addr, size_t len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long pgoff); -struct pt_regs; -int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, - unsigned long a3, unsigned long a4, unsigned long a5, - struct pt_regs *regs); -int sys_clone(unsigned long clone_flags, unsigned long usp, - int __user *parent_tidp, void __user *child_threadptr, - int __user *child_tidp, int p6, struct pt_regs *regs); -int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, - unsigned long p4, unsigned long p5, unsigned long p6, - struct pt_regs *regs); -int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, - unsigned long p4, unsigned long p5, unsigned long p6, - struct pt_regs *regs); -int sys_pipe(int __user *fildes); -struct sigaction; -long sys_rt_sigaction(int sig, const struct sigaction __user *act, - struct sigaction __user *oact, size_t sigsetsize); - -/* * "Conditional" syscalls * * What we want is __attribute__((weak,alias("sys_ni_syscall"))), diff --git a/include/asm-powerpc/vdso_datapage.h b/include/asm-powerpc/vdso_datapage.h index 7aa92086c3f..8a94f0eba5e 100644 --- a/include/asm-powerpc/vdso_datapage.h +++ b/include/asm-powerpc/vdso_datapage.h @@ -55,6 +55,9 @@ struct vdso_data { __u32 minor; /* Minor number 0x14 */ } version; + /* Note about the platform flags: it now only contains the lpar + * bit. The actual platform number is dead and burried + */ __u32 platform; /* Platform flags 0x18 */ __u32 processor; /* Processor type 0x1C */ __u64 processorCount; /* # of physical processors 0x20 */ diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index a3e8a45e45a..e1a0a7b213d 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h @@ -19,6 +19,18 @@ struct pci_dev; struct seq_file; struct file; +/* + * This is for compatibility with ARCH=powerpc. + */ +#define machine_is(x) __MACHINE_IS_##x +#define __MACHINE_IS_powermac 0 +#define __MACHINE_IS_chrp 0 +#ifdef CONFIG_PPC_PREP +#define __MACHINE_IS_prep 1 +#else +#define __MACHINE_IS_prep 0 +#endif + /* We export this macro for external modules like Alsa to know if * ppc_md.feature_call is implemented or not */ @@ -44,7 +56,7 @@ struct machdep_calls { void (*power_off)(void); void (*halt)(void); - void (*idle)(void); + void (*idle_loop)(void); void (*power_save)(void); long (*time_init)(void); /* Optional, may be NULL */ @@ -104,9 +116,6 @@ struct machdep_calls { unsigned long size, pgprot_t vma_prot); - /* this is for modules, since _machine can be a define -- Cort */ - int ppc_machine; - /* Motherboard/chipset features. This is a kind of general purpose * hook used to control some machine specific features (like reset * lines, chip power control, etc...). diff --git a/include/asm-ppc/mpc52xx.h b/include/asm-ppc/mpc52xx.h index 6167f74635f..7e9842805a2 100644 --- a/include/asm-ppc/mpc52xx.h +++ b/include/asm-ppc/mpc52xx.h @@ -355,6 +355,7 @@ struct mpc52xx_xlb { u32 snoop_window; /* XLB + 0x70 */ }; +#define MPC52xx_XLB_CFG_PLDIS (1 << 31) #define MPC52xx_XLB_CFG_SNOOP (1 << 15) /* Clock Distribution control */ @@ -427,6 +428,9 @@ extern void mpc52xx_calibrate_decr(void); extern void mpc52xx_find_bridges(void); +extern void mpc52xx_setup_cpu(void); + + /* Matching of PSC function */ struct mpc52xx_psc_func { diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index e1c62da12e7..570b355162f 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -837,7 +837,8 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma, */ #define pgtable_cache_init() do { } while (0) -extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); +extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep, + pmd_t **pmdp); #include <asm-generic/pgtable.h> diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h index 6d431d6fb02..adc5ae78492 100644 --- a/include/asm-ppc/prom.h +++ b/include/asm-ppc/prom.h @@ -8,126 +8,19 @@ #ifndef _PPC_PROM_H #define _PPC_PROM_H -#include <linux/config.h> -#include <linux/types.h> - -typedef u32 phandle; -typedef u32 ihandle; - -struct address_range { - unsigned int space; - unsigned int address; - unsigned int size; -}; - -struct interrupt_info { - int line; - int sense; /* +ve/-ve logic, edge or level, etc. */ -}; - +/* This is used in arch/ppc/mm/mem_pieces.h */ struct reg_property { unsigned int address; unsigned int size; }; -struct property { - char *name; - int length; - unsigned char *value; - struct property *next; -}; - -/* - * Note: don't change this structure for now or you'll break BootX ! - */ -struct device_node { - char *name; - char *type; - phandle node; - int n_addrs; - struct address_range *addrs; - int n_intrs; - struct interrupt_info *intrs; - char *full_name; - struct property *properties; - struct device_node *parent; - struct device_node *child; - struct device_node *sibling; - struct device_node *next; /* next device of same type */ - struct device_node *allnext; /* next in list of all nodes */ -}; - -struct prom_args; -typedef void (*prom_entry)(struct prom_args *); - -/* OBSOLETE: Old style node lookup */ -extern struct device_node *find_devices(const char *name); -extern struct device_node *find_type_devices(const char *type); -extern struct device_node *find_path_device(const char *path); -extern struct device_node *find_compatible_devices(const char *type, - const char *compat); -extern struct device_node *find_all_nodes(void); - -/* New style node lookup */ -extern struct device_node *of_find_node_by_name(struct device_node *from, - const char *name); -extern struct device_node *of_find_node_by_type(struct device_node *from, - const char *type); -extern struct device_node *of_find_compatible_node(struct device_node *from, - const char *type, const char *compat); -extern struct device_node *of_find_node_by_path(const char *path); -extern struct device_node *of_find_all_nodes(struct device_node *prev); -extern struct device_node *of_get_parent(const struct device_node *node); -extern struct device_node *of_get_next_child(const struct device_node *node, - struct device_node *prev); -extern struct device_node *of_node_get(struct device_node *node); -extern void of_node_put(struct device_node *node); - -/* Other Prototypes */ -extern void abort(void); -extern unsigned long prom_init(int, int, prom_entry); -extern void prom_print(const char *msg); -extern void relocate_nodes(void); -extern void finish_device_tree(void); -extern int device_is_compatible(struct device_node *device, const char *); -extern int machine_is_compatible(const char *compat); -extern unsigned char *get_property(struct device_node *node, const char *name, - int *lenp); -extern int prom_add_property(struct device_node* np, struct property* prop); -extern void prom_get_irq_senses(unsigned char *, int, int); -extern int prom_n_addr_cells(struct device_node* np); -extern int prom_n_size_cells(struct device_node* np); - -extern struct resource* -request_OF_resource(struct device_node* node, int index, const char* name_postfix); -extern int release_OF_resource(struct device_node* node, int index); - -extern void print_properties(struct device_node *node); -extern int call_rtas(const char *service, int nargs, int nret, - unsigned long *outputs, ...); - /* - * PCI <-> OF matching functions - */ -struct pci_bus; -struct pci_dev; -extern int pci_device_from_OF_node(struct device_node *node, - u8* bus, u8* devfn); -extern struct device_node* pci_busdev_to_OF_node(struct pci_bus *, int); -extern struct device_node* pci_device_to_OF_node(struct pci_dev *); -extern void pci_create_OF_bus_map(void); - -/* - * When we call back to the Open Firmware client interface, we usually - * have to do that before the kernel is relocated to its final location - * (this is because we can't use OF after we have overwritten the - * exception vectors with our exception handlers). These macros assist - * in performing the address calculations that we need to do to access - * data when the kernel is running at an address that is different from - * the address that the kernel is linked at. The reloc_offset() function - * returns the difference between these two addresses and the macros - * simplify the process of adding or subtracting this offset to/from - * pointer values. See arch/ppc/kernel/prom.c for how these are used. + * These macros assist in performing the address calculations that we + * need to do to access data when the kernel is running at an address + * that is different from the address that the kernel is linked at. + * The reloc_offset() function returns the difference between these + * two addresses and the macros simplify the process of adding or + * subtracting this offset to/from pointer values. */ extern unsigned long reloc_offset(void); extern unsigned long add_reloc_offset(unsigned long); @@ -136,45 +29,12 @@ extern unsigned long sub_reloc_offset(unsigned long); #define PTRRELOC(x) ((typeof(x))add_reloc_offset((unsigned long)(x))) #define PTRUNRELOC(x) ((typeof(x))sub_reloc_offset((unsigned long)(x))) - -/* - * OF address retreival & translation - */ - - -/* Translate an OF address block into a CPU physical address - */ -#define OF_BAD_ADDR ((u64)-1) -extern u64 of_translate_address(struct device_node *np, u32 *addr); - -/* Extract an address from a device, returns the region size and - * the address space flags too. The PCI version uses a BAR number - * instead of an absolute index - */ -extern u32 *of_get_address(struct device_node *dev, int index, - u64 *size, unsigned int *flags); -extern u32 *of_get_pci_address(struct device_node *dev, int bar_no, - u64 *size, unsigned int *flags); - -/* Get an address as a resource. Note that if your address is - * a PIO address, the conversion will fail if the physical address - * can't be internally converted to an IO token with - * pci_address_to_pio(), that is because it's either called to early - * or it can't be matched to any host bridge IO space - */ -extern int of_address_to_resource(struct device_node *dev, int index, - struct resource *r); -extern int of_pci_address_to_resource(struct device_node *dev, int bar, - struct resource *r); - -#ifndef CONFIG_PPC_OF /* - * Fallback definitions for builds where we don't have prom.c included. + * Fallback definitions since we don't support OF in arch/ppc any more. */ #define machine_is_compatible(x) 0 #define of_find_compatible_node(f, t, c) NULL #define get_property(p, n, l) NULL -#endif #endif /* _PPC_PROM_H */ #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h index 485a924e4d0..b74af546156 100644 --- a/include/asm-ppc/serial.h +++ b/include/asm-ppc/serial.h @@ -41,15 +41,10 @@ #else /* - * XXX Assume for now it has PC-style ISA serial ports. - * This is true for PReP and CHRP at least. + * XXX Assume it has PC-style ISA serial ports - true for PReP at least. */ #include <asm/pc_serial.h> -#if defined(CONFIG_MAC_SERIAL) -#define SERIAL_DEV_OFFSET ((_machine == _MACH_prep || _machine == _MACH_chrp) ? 0 : 2) -#endif - #endif /* !CONFIG_GEMINI and others */ #endif /* __ASM_SERIAL_H__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h index de1d9926aa6..399bf02894d 100644 --- a/include/asm-s390/atomic.h +++ b/include/asm-s390/atomic.h @@ -1,6 +1,8 @@ #ifndef __ARCH_S390_ATOMIC__ #define __ARCH_S390_ATOMIC__ +#include <linux/compiler.h> + /* * include/asm-s390/atomic.h * diff --git a/include/asm-s390/ebcdic.h b/include/asm-s390/ebcdic.h index 4cbc336e4d6..15fd2eda6c9 100644 --- a/include/asm-s390/ebcdic.h +++ b/include/asm-s390/ebcdic.h @@ -14,12 +14,12 @@ #include <types.h> #endif -extern __u8 _ascebc_500[]; /* ASCII -> EBCDIC 500 conversion table */ -extern __u8 _ebcasc_500[]; /* EBCDIC 500 -> ASCII conversion table */ -extern __u8 _ascebc[]; /* ASCII -> EBCDIC conversion table */ -extern __u8 _ebcasc[]; /* EBCDIC -> ASCII conversion table */ -extern __u8 _ebc_tolower[]; /* EBCDIC -> lowercase */ -extern __u8 _ebc_toupper[]; /* EBCDIC -> uppercase */ +extern __u8 _ascebc_500[256]; /* ASCII -> EBCDIC 500 conversion table */ +extern __u8 _ebcasc_500[256]; /* EBCDIC 500 -> ASCII conversion table */ +extern __u8 _ascebc[256]; /* ASCII -> EBCDIC conversion table */ +extern __u8 _ebcasc[256]; /* EBCDIC -> ASCII conversion table */ +extern __u8 _ebc_tolower[256]; /* EBCDIC -> lowercase */ +extern __u8 _ebc_toupper[256]; /* EBCDIC -> uppercase */ static inline void codepage_convert(const __u8 *codepage, volatile __u8 * addr, unsigned long nr) diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h index e10ed87094f..436d216601e 100644 --- a/include/asm-s390/percpu.h +++ b/include/asm-s390/percpu.h @@ -46,7 +46,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; #define percpu_modcopy(pcpudst, src, size) \ do { \ unsigned int __i; \ - for_each_cpu(__i) \ + for_each_possible_cpu(__i) \ memcpy((pcpudst)+__per_cpu_offset[__i], \ (src), (size)); \ } while (0) diff --git a/include/asm-sh/numnodes.h b/include/asm-sh/numnodes.h deleted file mode 100644 index f73e85b72ec..00000000000 --- a/include/asm-sh/numnodes.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _ASM_MAX_NUMNODES_H -#define _ASM_MAX_NUMNODES_H - -/* Max 2 Nodes */ -#define NODES_SHIFT 1 - -#endif /* _ASM_MAX_NUMNODES_H */ diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index f2c8e14d1fd..05520cebda1 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h @@ -290,7 +290,7 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_sys_kexec_load 283 +#define __NR_kexec_load 283 #define __NR_waitid 284 #define __NR_add_key 285 #define __NR_request_key 286 diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index 2a1cfa404ea..1f8f394ae37 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h @@ -333,7 +333,7 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_sys_kexec_load 311 +#define __NR_kexec_load 311 #define __NR_waitid 312 #define __NR_add_key 313 #define __NR_request_key 314 diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 64ec640a40e..2a911aa4cae 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h @@ -180,7 +180,7 @@ #define __NR_sched_get_affinity 161 /* Linux specific, getfh under SunOS */ #define __NR_getdomainname 162 /* SunOS Specific */ #define __NR_setdomainname 163 /* Common */ -/* #define __NR_ni_syscall 164 ENOSYS under SunOS */ +/* #define __NR_utrap_install 164 Linux sparc64 specific */ #define __NR_quotactl 165 /* Common */ #define __NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */ #define __NR_mount 167 /* Common */ @@ -248,7 +248,7 @@ #define __NR_setfsgid 229 /* Linux Specific */ #define __NR__newselect 230 /* Linux Specific */ #define __NR_time 231 /* Linux Specific */ -/* #define __NR_oldstat 232 Linux Specific */ +#define __NR_sys_splice 232 /* Linux Specific */ #define __NR_stime 233 /* Linux Specific */ #define __NR_statfs64 234 /* Linux Specific */ #define __NR_fstatfs64 235 /* Linux Specific */ @@ -271,7 +271,7 @@ #define __NR_getsid 252 #define __NR_fdatasync 253 #define __NR_nfsservctl 254 -#define __NR_aplib 255 +#define __NR_sys_sync_file_range 255 #define __NR_clock_settime 256 #define __NR_clock_gettime 257 #define __NR_clock_getres 258 @@ -296,7 +296,7 @@ #define __NR_mq_notify 277 #define __NR_mq_getsetattr 278 #define __NR_waitid 279 -#define __NR_sys_setaltroot 280 +#define __NR_tee 280 #define __NR_add_key 281 #define __NR_request_key 282 #define __NR_keyctl 283 diff --git a/include/asm-sparc/vga.h b/include/asm-sparc/vga.h new file mode 100644 index 00000000000..c69d5b2ba19 --- /dev/null +++ b/include/asm-sparc/vga.h @@ -0,0 +1,33 @@ +/* + * Access to VGA videoram + * + * (c) 1998 Martin Mares <mj@ucw.cz> + */ + +#ifndef _LINUX_ASM_VGA_H_ +#define _LINUX_ASM_VGA_H_ + +#include <asm/types.h> + +#define VT_BUF_HAVE_RW + +#undef scr_writew +#undef scr_readw + +static inline void scr_writew(u16 val, u16 *addr) +{ + BUG_ON((long) addr >= 0); + + *addr = val; +} + +static inline u16 scr_readw(const u16 *addr) +{ + BUG_ON((long) addr >= 0); + + return *addr; +} + +#define VGA_MAP_MEM(x,s) (x) + +#endif diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h index 82032e159a7..baef13b5895 100644 --- a/include/asm-sparc64/percpu.h +++ b/include/asm-sparc64/percpu.h @@ -26,7 +26,7 @@ register unsigned long __local_per_cpu_offset asm("g5"); #define percpu_modcopy(pcpudst, src, size) \ do { \ unsigned int __i; \ - for_each_cpu(__i) \ + for_each_possible_cpu(__i) \ memcpy((pcpudst)+__per_cpu_offset(__i), \ (src), (size)); \ } while (0) diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index a284986b154..6ada6a871cc 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -250,7 +250,7 @@ #ifdef __KERNEL__ #define __NR_time 231 /* Linux sparc32 */ #endif -/* #define __NR_oldstat 232 Linux Specific */ +#define __NR_sys_splice 232 /* Linux Specific */ #define __NR_stime 233 /* Linux Specific */ #define __NR_statfs64 234 /* Linux Specific */ #define __NR_fstatfs64 235 /* Linux Specific */ @@ -273,7 +273,7 @@ #define __NR_getsid 252 #define __NR_fdatasync 253 #define __NR_nfsservctl 254 -#define __NR_aplib 255 +#define __NR_sys_sync_file_range 255 #define __NR_clock_settime 256 #define __NR_clock_gettime 257 #define __NR_clock_getres 258 @@ -298,7 +298,7 @@ #define __NR_mq_notify 277 #define __NR_mq_getsetattr 278 #define __NR_waitid 279 -/*#define __NR_sys_setaltroot 280 available (was setaltroot) */ +#define __NR_tee 280 #define __NR_add_key 281 #define __NR_request_key 282 #define __NR_keyctl 283 diff --git a/include/asm-um/desc.h b/include/asm-um/desc.h index ac1d2a20d17..4ec34a51b62 100644 --- a/include/asm-um/desc.h +++ b/include/asm-um/desc.h @@ -1,6 +1,16 @@ #ifndef __UM_DESC_H #define __UM_DESC_H -#include "asm/arch/desc.h" +/* Taken from asm-i386/desc.h, it's the only thing we need. The rest wouldn't + * compile, and has never been used. */ +#define LDT_empty(info) (\ + (info)->base_addr == 0 && \ + (info)->limit == 0 && \ + (info)->contents == 0 && \ + (info)->read_exec_only == 1 && \ + (info)->seg_32bit == 0 && \ + (info)->limit_in_pages == 0 && \ + (info)->seg_not_present == 1 && \ + (info)->useable == 0 ) #endif diff --git a/include/asm-um/host_ldt-i386.h b/include/asm-um/host_ldt-i386.h new file mode 100644 index 00000000000..b27cb0a9dd3 --- /dev/null +++ b/include/asm-um/host_ldt-i386.h @@ -0,0 +1,34 @@ +#ifndef __ASM_HOST_LDT_I386_H +#define __ASM_HOST_LDT_I386_H + +#include "asm/arch/ldt.h" + +/* + * macros stolen from include/asm-i386/desc.h + */ +#define LDT_entry_a(info) \ + ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) + +#define LDT_entry_b(info) \ + (((info)->base_addr & 0xff000000) | \ + (((info)->base_addr & 0x00ff0000) >> 16) | \ + ((info)->limit & 0xf0000) | \ + (((info)->read_exec_only ^ 1) << 9) | \ + ((info)->contents << 10) | \ + (((info)->seg_not_present ^ 1) << 15) | \ + ((info)->seg_32bit << 22) | \ + ((info)->limit_in_pages << 23) | \ + ((info)->useable << 20) | \ + 0x7000) + +#define LDT_empty(info) (\ + (info)->base_addr == 0 && \ + (info)->limit == 0 && \ + (info)->contents == 0 && \ + (info)->read_exec_only == 1 && \ + (info)->seg_32bit == 0 && \ + (info)->limit_in_pages == 0 && \ + (info)->seg_not_present == 1 && \ + (info)->useable == 0 ) + +#endif diff --git a/include/asm-um/ldt-x86_64.h b/include/asm-um/host_ldt-x86_64.h index 96b35aada79..74a63f7d9a9 100644 --- a/include/asm-um/ldt-x86_64.h +++ b/include/asm-um/host_ldt-x86_64.h @@ -1,43 +1,8 @@ -/* - * Copyright (C) 2004 Fujitsu Siemens Computers GmbH - * Licensed under the GPL - * - * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> - */ +#ifndef __ASM_HOST_LDT_X86_64_H +#define __ASM_HOST_LDT_X86_64_H -#ifndef __ASM_LDT_X86_64_H -#define __ASM_LDT_X86_64_H - -#include "asm/semaphore.h" #include "asm/arch/ldt.h" -struct mmu_context_skas; -extern void ldt_host_info(void); -extern long init_new_ldt(struct mmu_context_skas * to_mm, - struct mmu_context_skas * from_mm); -extern void free_ldt(struct mmu_context_skas * mm); - -#define LDT_PAGES_MAX \ - ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) -#define LDT_ENTRIES_PER_PAGE \ - (PAGE_SIZE/LDT_ENTRY_SIZE) -#define LDT_DIRECT_ENTRIES \ - ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE) - -struct ldt_entry { - __u32 a; - __u32 b; -}; - -typedef struct uml_ldt { - int entry_count; - struct semaphore semaphore; - union { - struct ldt_entry * pages[LDT_PAGES_MAX]; - struct ldt_entry entries[LDT_DIRECT_ENTRIES]; - } u; -} uml_ldt_t; - /* * macros stolen from include/asm-x86_64/desc.h */ diff --git a/include/asm-um/ldt-i386.h b/include/asm-um/ldt-i386.h deleted file mode 100644 index 175722a9116..00000000000 --- a/include/asm-um/ldt-i386.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2004 Fujitsu Siemens Computers GmbH - * Licensed under the GPL - * - * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> - */ - -#ifndef __ASM_LDT_I386_H -#define __ASM_LDT_I386_H - -#include "asm/semaphore.h" -#include "asm/arch/ldt.h" - -struct mmu_context_skas; -extern void ldt_host_info(void); -extern long init_new_ldt(struct mmu_context_skas * to_mm, - struct mmu_context_skas * from_mm); -extern void free_ldt(struct mmu_context_skas * mm); - -#define LDT_PAGES_MAX \ - ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) -#define LDT_ENTRIES_PER_PAGE \ - (PAGE_SIZE/LDT_ENTRY_SIZE) -#define LDT_DIRECT_ENTRIES \ - ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE) - -struct ldt_entry { - __u32 a; - __u32 b; -}; - -typedef struct uml_ldt { - int entry_count; - struct semaphore semaphore; - union { - struct ldt_entry * pages[LDT_PAGES_MAX]; - struct ldt_entry entries[LDT_DIRECT_ENTRIES]; - } u; -} uml_ldt_t; - -/* - * macros stolen from include/asm-i386/desc.h - */ -#define LDT_entry_a(info) \ - ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) - -#define LDT_entry_b(info) \ - (((info)->base_addr & 0xff000000) | \ - (((info)->base_addr & 0x00ff0000) >> 16) | \ - ((info)->limit & 0xf0000) | \ - (((info)->read_exec_only ^ 1) << 9) | \ - ((info)->contents << 10) | \ - (((info)->seg_not_present ^ 1) << 15) | \ - ((info)->seg_32bit << 22) | \ - ((info)->limit_in_pages << 23) | \ - ((info)->useable << 20) | \ - 0x7000) - -#define LDT_empty(info) (\ - (info)->base_addr == 0 && \ - (info)->limit == 0 && \ - (info)->contents == 0 && \ - (info)->read_exec_only == 1 && \ - (info)->seg_32bit == 0 && \ - (info)->limit_in_pages == 0 && \ - (info)->seg_not_present == 1 && \ - (info)->useable == 0 ) - -#endif diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h new file mode 100644 index 00000000000..96f82a456ce --- /dev/null +++ b/include/asm-um/ldt.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2004 Fujitsu Siemens Computers GmbH + * Licensed under the GPL + * + * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> + */ + +#ifndef __ASM_LDT_H +#define __ASM_LDT_H + +#include "asm/semaphore.h" +#include "asm/host_ldt.h" + +struct mmu_context_skas; +extern void ldt_host_info(void); +extern long init_new_ldt(struct mmu_context_skas * to_mm, + struct mmu_context_skas * from_mm); +extern void free_ldt(struct mmu_context_skas * mm); + +#define LDT_PAGES_MAX \ + ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) +#define LDT_ENTRIES_PER_PAGE \ + (PAGE_SIZE/LDT_ENTRY_SIZE) +#define LDT_DIRECT_ENTRIES \ + ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE) + +struct ldt_entry { + __u32 a; + __u32 b; +}; + +typedef struct uml_ldt { + int entry_count; + struct semaphore semaphore; + union { + struct ldt_entry * pages[LDT_PAGES_MAX]; + struct ldt_entry entries[LDT_DIRECT_ENTRIES]; + } u; +} uml_ldt_t; + +#endif diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h index 4108a579eb9..595f1c3e1e4 100644 --- a/include/asm-um/processor-i386.h +++ b/include/asm-um/processor-i386.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -6,21 +6,48 @@ #ifndef __UM_PROCESSOR_I386_H #define __UM_PROCESSOR_I386_H +#include "linux/string.h" +#include "asm/host_ldt.h" +#include "asm/segment.h" + extern int host_has_xmm; extern int host_has_cmov; /* include faultinfo structure */ #include "sysdep/faultinfo.h" +struct uml_tls_struct { + struct user_desc tls; + unsigned flushed:1; + unsigned present:1; +}; + struct arch_thread { + struct uml_tls_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; unsigned long debugregs[8]; int debugregs_seq; struct faultinfo faultinfo; }; -#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ - .debugregs_seq = 0, \ - .faultinfo = { 0, 0, 0 } } +#define INIT_ARCH_THREAD { \ + .tls_array = { [ 0 ... GDT_ENTRY_TLS_ENTRIES - 1 ] = \ + { .present = 0, .flushed = 0 } }, \ + .debugregs = { [ 0 ... 7 ] = 0 }, \ + .debugregs_seq = 0, \ + .faultinfo = { 0, 0, 0 } \ +} + +static inline void arch_flush_thread(struct arch_thread *thread) +{ + /* Clear any TLS still hanging */ + memset(&thread->tls_array, 0, sizeof(thread->tls_array)); +} + +static inline void arch_copy_thread(struct arch_thread *from, + struct arch_thread *to) +{ + memcpy(&to->tls_array, &from->tls_array, sizeof(from->tls_array)); +} #include "asm/arch/user.h" diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h index e1e1255a1d3..10609af376c 100644 --- a/include/asm-um/processor-x86_64.h +++ b/include/asm-um/processor-x86_64.h @@ -28,6 +28,15 @@ extern inline void rep_nop(void) .debugregs_seq = 0, \ .faultinfo = { 0, 0, 0 } } +static inline void arch_flush_thread(struct arch_thread *thread) +{ +} + +static inline void arch_copy_thread(struct arch_thread *from, + struct arch_thread *to) +{ +} + #include "asm/arch/user.h" #define current_text_addr() \ diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h index 46599ac4403..503484305e6 100644 --- a/include/asm-um/ptrace-generic.h +++ b/include/asm-um/ptrace-generic.h @@ -28,7 +28,7 @@ struct pt_regs { union uml_pt_regs regs; }; -#define EMPTY_REGS { regs : EMPTY_UML_PT_REGS } +#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS } #define PT_REGS_IP(r) UPT_IP(&(r)->regs) #define PT_REGS_SP(r) UPT_SP(&(r)->regs) @@ -60,17 +60,9 @@ extern void show_regs(struct pt_regs *regs); extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, int error_code); -#endif +extern int arch_copy_tls(struct task_struct *new); +extern void clear_flushed_tls(struct task_struct *task); #endif -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ +#endif diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h index fe882b9d917..6e2528bb008 100644 --- a/include/asm-um/ptrace-i386.h +++ b/include/asm-um/ptrace-i386.h @@ -8,8 +8,11 @@ #define HOST_AUDIT_ARCH AUDIT_ARCH_I386 +#include "linux/compiler.h" #include "sysdep/ptrace.h" #include "asm/ptrace-generic.h" +#include "asm/host_ldt.h" +#include "choose-mode.h" #define PT_REGS_EAX(r) UPT_EAX(&(r)->regs) #define PT_REGS_EBX(r) UPT_EBX(&(r)->regs) @@ -38,15 +41,34 @@ #define user_mode(r) UPT_IS_USER(&(r)->regs) -#endif +extern int ptrace_get_thread_area(struct task_struct *child, int idx, + struct user_desc __user *user_desc); -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ +extern int ptrace_set_thread_area(struct task_struct *child, int idx, + struct user_desc __user *user_desc); + +extern int do_set_thread_area_skas(struct user_desc *info); +extern int do_get_thread_area_skas(struct user_desc *info); + +extern int do_set_thread_area_tt(struct user_desc *info); +extern int do_get_thread_area_tt(struct user_desc *info); + +extern int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to); +extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to); + +extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to); +extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to); + +static inline int do_get_thread_area(struct user_desc *info) +{ + return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info); +} + +static inline int do_set_thread_area(struct user_desc *info) +{ + return CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, info); +} + +struct task_struct; + +#endif diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h index be51219a8ff..c894e68b1f9 100644 --- a/include/asm-um/ptrace-x86_64.h +++ b/include/asm-um/ptrace-x86_64.h @@ -8,6 +8,8 @@ #define __UM_PTRACE_X86_64_H #include "linux/compiler.h" +#include "asm/errno.h" +#include "asm/host_ldt.h" #define signal_fault signal_fault_x86_64 #define __FRAME_OFFSETS /* Needed to get the R* macros */ @@ -63,15 +65,26 @@ void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where); #define profile_pc(regs) PT_REGS_IP(regs) -#endif +static inline int ptrace_get_thread_area(struct task_struct *child, int idx, + struct user_desc __user *user_desc) +{ + return -ENOSYS; +} -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ +static inline int ptrace_set_thread_area(struct task_struct *child, int idx, + struct user_desc __user *user_desc) +{ + return -ENOSYS; +} + +static inline void arch_switch_to_tt(struct task_struct *from, + struct task_struct *to) +{ +} + +static inline void arch_switch_to_skas(struct task_struct *from, + struct task_struct *to) +{ +} + +#endif diff --git a/include/asm-um/segment.h b/include/asm-um/segment.h index 55e40301f62..45183fcd10b 100644 --- a/include/asm-um/segment.h +++ b/include/asm-um/segment.h @@ -1,4 +1,10 @@ #ifndef __UM_SEGMENT_H #define __UM_SEGMENT_H +extern int host_gdt_entry_tls_min; + +#define GDT_ENTRY_TLS_ENTRIES 3 +#define GDT_ENTRY_TLS_MIN host_gdt_entry_tls_min +#define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1) + #endif diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h index 17b6b07c433..f166b9837c6 100644 --- a/include/asm-um/thread_info.h +++ b/include/asm-um/thread_info.h @@ -27,14 +27,14 @@ struct thread_info { #define INIT_THREAD_INFO(tsk) \ { \ - task: &tsk, \ - exec_domain: &default_exec_domain, \ - flags: 0, \ - cpu: 0, \ - preempt_count: 1, \ - addr_limit: KERNEL_DS, \ - restart_block: { \ - fn: do_no_restart_syscall, \ + .task = &tsk, \ + .exec_domain = &default_exec_domain, \ + .flags = 0, \ + .cpu = 0, \ + .preempt_count = 1, \ + .addr_limit = KERNEL_DS, \ + .restart_block = { \ + .fn = do_no_restart_syscall, \ }, \ } diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index 4e460d6f5ac..bea5a015f66 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h @@ -57,7 +57,7 @@ ({ \ const __typeof__((*(ptr))) __user *private_ptr = (ptr); \ (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \ - __get_user(x, private_ptr) : ((x) = 0, -EFAULT)); \ + __get_user(x, private_ptr) : ((x) = (__typeof__(*ptr))0, -EFAULT)); \ }) #define __put_user(x, ptr) \ diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h index 107decbd6e6..7091af4b786 100644 --- a/include/asm-v850/system.h +++ b/include/asm-v850/system.h @@ -18,8 +18,6 @@ #include <asm/ptrace.h> -#define prepare_to_switch() do { } while (0) - /* * switch_to(n) should switch tasks to task ptr, first checking that * ptr isn't the current task, in which case it does nothing. diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h index 8dcc3266524..93b51df5168 100644 --- a/include/asm-x86_64/e820.h +++ b/include/asm-x86_64/e820.h @@ -47,7 +47,8 @@ extern void contig_e820_setup(void); extern unsigned long e820_end_of_ram(void); extern void e820_reserve_resources(void); extern void e820_print_map(char *who); -extern int e820_mapped(unsigned long start, unsigned long end, unsigned type); +extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned type); +extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type); extern void e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end); extern void e820_setup_gap(void); diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h index 08b75c15269..18ff7ee9e77 100644 --- a/include/asm-x86_64/hpet.h +++ b/include/asm-x86_64/hpet.h @@ -51,6 +51,8 @@ #define HPET_TN_ROUTE_SHIFT 9 +#define HPET_TICK_RATE (HZ * 100000UL) + extern int is_hpet_enabled(void); extern int hpet_rtc_timer_init(void); extern int oem_force_hpet_timer(void); diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h index eeb2bcd635d..b4f4b172b15 100644 --- a/include/asm-x86_64/ia32_unistd.h +++ b/include/asm-x86_64/ia32_unistd.h @@ -317,6 +317,4 @@ #define __NR_ia32_ppoll 309 #define __NR_ia32_unshare 310 -#define IA32_NR_syscalls 315 /* must be > than biggest syscall! */ - #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index cafdfb37f0d..a05da8a50bf 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h @@ -177,7 +177,7 @@ static inline __u16 __readw(const volatile void __iomem *addr) { return *(__force volatile __u16 *)addr; } -static inline __u32 __readl(const volatile void __iomem *addr) +static __always_inline __u32 __readl(const volatile void __iomem *addr) { return *(__force volatile __u32 *)addr; } diff --git a/include/asm-x86_64/local.h b/include/asm-x86_64/local.h index bf148037d4e..cd17945bf21 100644 --- a/include/asm-x86_64/local.h +++ b/include/asm-x86_64/local.h @@ -5,7 +5,7 @@ typedef struct { - volatile unsigned long counter; + volatile long counter; } local_t; #define LOCAL_INIT(i) { (i) } @@ -13,7 +13,7 @@ typedef struct #define local_read(v) ((v)->counter) #define local_set(v,i) (((v)->counter) = (i)) -static __inline__ void local_inc(local_t *v) +static inline void local_inc(local_t *v) { __asm__ __volatile__( "incq %0" @@ -21,7 +21,7 @@ static __inline__ void local_inc(local_t *v) :"m" (v->counter)); } -static __inline__ void local_dec(local_t *v) +static inline void local_dec(local_t *v) { __asm__ __volatile__( "decq %0" @@ -29,7 +29,7 @@ static __inline__ void local_dec(local_t *v) :"m" (v->counter)); } -static __inline__ void local_add(unsigned int i, local_t *v) +static inline void local_add(long i, local_t *v) { __asm__ __volatile__( "addq %1,%0" @@ -37,7 +37,7 @@ static __inline__ void local_add(unsigned int i, local_t *v) :"ir" (i), "m" (v->counter)); } -static __inline__ void local_sub(unsigned int i, local_t *v) +static inline void local_sub(long i, local_t *v) { __asm__ __volatile__( "subq %1,%0" diff --git a/include/asm-x86_64/mce.h b/include/asm-x86_64/mce.h index 5d298b799a9..7229785094e 100644 --- a/include/asm-x86_64/mce.h +++ b/include/asm-x86_64/mce.h @@ -70,6 +70,9 @@ struct mce_log { #define MCE_THRESHOLD_BASE MCE_EXTENDED_BANK + 1 /* MCE_AMD */ #define MCE_THRESHOLD_DRAM_ECC MCE_THRESHOLD_BASE + 4 +#ifdef __KERNEL__ +#include <asm/atomic.h> + void mce_log(struct mce *m); #ifdef CONFIG_X86_MCE_INTEL void mce_intel_feature_init(struct cpuinfo_x86 *c); @@ -87,4 +90,8 @@ static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) } #endif +extern atomic_t mce_entry; + +#endif + #endif diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 6b18cd8f293..6944e7122df 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h @@ -12,7 +12,8 @@ #include <asm/smp.h> -#define NODEMAPSIZE 0xfff +/* Should really switch to dynamic allocation at some point */ +#define NODEMAPSIZE 0x4fff /* Simple perfect hash to map physical addresses to node numbers */ struct memnode { diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index f6cbb4cbb5a..1cc92fe0250 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h @@ -2,7 +2,6 @@ #define _ASM_X8664_NUMA_H 1 #include <linux/nodemask.h> -#include <asm/numnodes.h> struct bootnode { u64 start,end; @@ -18,6 +17,8 @@ extern void numa_init_array(void); extern int numa_off; extern void numa_set_node(int cpu, int node); +extern void srat_reserve_add_area(int nodeid); +extern int hotadd_percent; extern unsigned char apicid_to_node[256]; #ifdef CONFIG_NUMA diff --git a/include/asm-x86_64/numnodes.h b/include/asm-x86_64/numnodes.h deleted file mode 100644 index 32be16b8ae9..00000000000 --- a/include/asm-x86_64/numnodes.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _ASM_X8664_NUMNODES_H -#define _ASM_X8664_NUMNODES_H 1 - -#include <linux/config.h> - -#ifdef CONFIG_NUMA -#define NODES_SHIFT 6 -#else -#define NODES_SHIFT 0 -#endif - -#endif diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h index f18443fcdf0..b9e5320b762 100644 --- a/include/asm-x86_64/timex.h +++ b/include/asm-x86_64/timex.h @@ -33,7 +33,7 @@ static __always_inline cycles_t get_cycles_sync(void) unsigned eax; /* Don't do an additional sync on CPUs where we know RDTSC is already synchronous. */ - alternative_io(ASM_NOP2, "cpuid", X86_FEATURE_SYNC_RDTSC, + alternative_io("cpuid", ASM_NOP2, X86_FEATURE_SYNC_RDTSC, "=a" (eax), "0" (1) : "ebx","ecx","edx","memory"); rdtscll(ret); return ret; diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index fcc51635308..98c36eae567 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h @@ -609,8 +609,14 @@ __SYSCALL(__NR_unshare, sys_unshare) __SYSCALL(__NR_set_robust_list, sys_set_robust_list) #define __NR_get_robust_list 274 __SYSCALL(__NR_get_robust_list, sys_get_robust_list) - -#define __NR_syscall_max __NR_get_robust_list +#define __NR_splice 275 +__SYSCALL(__NR_splice, sys_splice) +#define __NR_tee 276 +__SYSCALL(__NR_tee, sys_tee) +#define __NR_sync_file_range 277 +__SYSCALL(__NR_sync_file_range, sys_sync_file_range) + +#define __NR_syscall_max __NR_sync_file_range #ifndef __NO_STUBS diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h index 9284867f1cb..b29f7ae6a08 100644 --- a/include/asm-xtensa/system.h +++ b/include/asm-xtensa/system.h @@ -111,8 +111,6 @@ extern void *_switch_to(void *last, void *next); #endif /* __ASSEMBLY__ */ -#define prepare_to_switch() do { } while(0) - #define switch_to(prev,next,last) \ do { \ clear_cpenable(); \ diff --git a/include/linux/backlight.h b/include/linux/backlight.h index bb9e5432232..75e91f5b6a0 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -19,20 +19,25 @@ struct fb_info; struct backlight_properties { /* Owner module */ struct module *owner; - /* Get the backlight power status (0: full on, 1..3: power saving - modes; 4: full off), see FB_BLANK_XXX */ - int (*get_power)(struct backlight_device *); - /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ - int (*set_power)(struct backlight_device *, int power); - /* Maximal value for brightness (read-only) */ - int max_brightness; - /* Get current backlight brightness */ + + /* Notify the backlight driver some property has changed */ + int (*update_status)(struct backlight_device *); + /* Return the current backlight brightness (accounting for power, + fb_blank etc.) */ int (*get_brightness)(struct backlight_device *); - /* Set backlight brightness (0..max_brightness) */ - int (*set_brightness)(struct backlight_device *, int brightness); /* Check if given framebuffer device is the one bound to this backlight; return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ int (*check_fb)(struct fb_info *); + + /* Current User requested brightness (0 - max_brightness) */ + int brightness; + /* Maximal value for brightness (read-only) */ + int max_brightness; + /* Current FB Power mode (0: full on, 1..3: power saving + modes; 4: full off), see FB_BLANK_XXX */ + int power; + /* FB Blanking active? (values as for power) */ + int fb_blank; }; struct backlight_device { diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d0cac8b58de..59e1259b1c4 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -17,6 +17,8 @@ #include <asm/scatterlist.h> +struct scsi_ioctl_command; + struct request_queue; typedef struct request_queue request_queue_t; struct elevator_queue; @@ -611,6 +613,8 @@ extern void blk_plug_device(request_queue_t *); extern int blk_remove_plug(request_queue_t *); extern void blk_recount_segments(request_queue_t *, struct bio *); extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); +extern int sg_scsi_ioctl(struct file *, struct request_queue *, + struct gendisk *, struct scsi_ioctl_command __user *); extern void blk_start_queue(request_queue_t *q); extern void blk_stop_queue(request_queue_t *q); extern void blk_sync_queue(struct request_queue *q); diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index de3eb8d8ae2..da2d107fe2c 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -45,6 +45,7 @@ extern unsigned long __init bootmem_bootmap_pages (unsigned long); extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); extern void __init free_bootmem (unsigned long addr, unsigned long size); extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); +extern void * __init __alloc_bootmem_nopanic (unsigned long size, unsigned long align, unsigned long goal); extern void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, unsigned long goal); diff --git a/include/linux/dcache.h b/include/linux/dcache.h index d10bd30c337..836325ee093 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -275,6 +275,7 @@ extern void d_move(struct dentry *, struct dentry *); /* appendix may either be NULL or be used for transname suffixes */ extern struct dentry * d_lookup(struct dentry *, struct qstr *); extern struct dentry * __d_lookup(struct dentry *, struct qstr *); +extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *); /* validate "insecure" dentry pointer */ extern int d_validate(struct dentry *, struct dentry *); diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 9b4751aecc2..ff61817082f 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -21,7 +21,7 @@ enum dma_data_direction { #define DMA_30BIT_MASK 0x000000003fffffffULL #define DMA_29BIT_MASK 0x000000001fffffffULL #define DMA_28BIT_MASK 0x000000000fffffffULL -#define DMA_24BIT_MASK 0x0000000000ffffffULL +#define DMA_24BIT_MASK 0x0000000000ffffffULL #include <asm/dma-mapping.h> diff --git a/include/linux/fadvise.h b/include/linux/fadvise.h index b2913bba35d..e8e747139b9 100644 --- a/include/linux/fadvise.h +++ b/include/linux/fadvise.h @@ -18,10 +18,4 @@ #define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif -/* - * Linux-specific fadvise() extensions: - */ -#define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range */ -#define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range */ - #endif /* FADVISE_H_INCLUDED */ diff --git a/include/linux/fb.h b/include/linux/fb.h index d03fadfcafe..315d89740dd 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -839,12 +839,10 @@ struct fb_info { #define FB_LEFT_POS(bpp) (32 - bpp) #define FB_SHIFT_HIGH(val, bits) ((val) >> (bits)) #define FB_SHIFT_LOW(val, bits) ((val) << (bits)) -#define FB_BIT_NR(b) (7 - (b)) #else #define FB_LEFT_POS(bpp) (0) #define FB_SHIFT_HIGH(val, bits) ((val) << (bits)) #define FB_SHIFT_LOW(val, bits) ((val) >> (bits)) -#define FB_BIT_NR(b) (b) #endif /* diff --git a/include/linux/fs.h b/include/linux/fs.h index 408fe89498f..3de2bfb2410 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -757,6 +757,13 @@ extern void send_sigio(struct fown_struct *fown, int fd, int band); extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); extern int fcntl_getlease(struct file *filp); +/* fs/sync.c */ +#define SYNC_FILE_RANGE_WAIT_BEFORE 1 +#define SYNC_FILE_RANGE_WRITE 2 +#define SYNC_FILE_RANGE_WAIT_AFTER 4 +extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, + unsigned int flags); + /* fs/locks.c */ extern void locks_init_lock(struct file_lock *); extern void locks_copy_lock(struct file_lock *, struct file_lock *); @@ -857,7 +864,7 @@ struct super_block { */ struct mutex s_vfs_rename_mutex; /* Kludge */ - /* Granuality of c/m/atime in ns. + /* Granularity of c/m/atime in ns. Cannot be worse than a second */ u32 s_time_gran; }; @@ -1032,6 +1039,8 @@ struct file_operations { int (*check_flags)(int); int (*dir_notify)(struct file *filp, unsigned long arg); int (*flock) (struct file *, int, struct file_lock *); + ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); + ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); }; struct inode_operations { @@ -1411,6 +1420,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); #endif /* fs/char_dev.c */ +#define CHRDEV_MAJOR_HASH_SIZE 255 extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); extern int register_chrdev_region(dev_t, unsigned, const char *); extern int register_chrdev(unsigned int, const char *, @@ -1418,25 +1428,17 @@ extern int register_chrdev(unsigned int, const char *, extern int unregister_chrdev(unsigned int, const char *); extern void unregister_chrdev_region(dev_t, unsigned); extern int chrdev_open(struct inode *, struct file *); -extern int get_chrdev_list(char *); -extern void *acquire_chrdev_list(void); -extern int count_chrdev_list(void); -extern void *get_next_chrdev(void *); -extern int get_chrdev_info(void *, int *, char **); -extern void release_chrdev_list(void *); +extern void chrdev_show(struct seq_file *,off_t); /* fs/block_dev.c */ +#define BLKDEV_MAJOR_HASH_SIZE 255 #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ extern const char *__bdevname(dev_t, char *buffer); extern const char *bdevname(struct block_device *bdev, char *buffer); extern struct block_device *lookup_bdev(const char *); extern struct block_device *open_bdev_excl(const char *, int, void *); extern void close_bdev_excl(struct block_device *); -extern void *acquire_blkdev_list(void); -extern int count_blkdev_list(void); -extern void *get_next_blkdev(void *); -extern int get_blkdev_info(void *, int *, char **); -extern void release_blkdev_list(void *); +extern void blkdev_show(struct seq_file *,off_t); extern void init_special_inode(struct inode *, umode_t, dev_t); @@ -1609,6 +1611,17 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor extern void do_generic_mapping_read(struct address_space *mapping, struct file_ra_state *, struct file *, loff_t *, read_descriptor_t *, read_actor_t); + +/* fs/splice.c */ +extern ssize_t generic_file_splice_read(struct file *, loff_t *, + struct pipe_inode_info *, size_t, unsigned int); +extern ssize_t generic_file_splice_write(struct pipe_inode_info *, + struct file *, loff_t *, size_t, unsigned int); +extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, + struct file *out, loff_t *, size_t len, unsigned int flags); +extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, + size_t len, unsigned int flags); + extern void file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 9c8e6da2393..71e7b2847cb 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -11,6 +11,7 @@ #include <asm/io.h> #include <linux/list.h> +#include <linux/mutex.h> #include <linux/device.h> #include <linux/timer.h> @@ -40,7 +41,7 @@ struct gameport { struct gameport *parent, *child; struct gameport_driver *drv; - struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ + struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ struct device dev; unsigned int registered; /* port has been fully registered with driver core */ @@ -137,12 +138,12 @@ static inline void gameport_set_drvdata(struct gameport *gameport, void *data) */ static inline int gameport_pin_driver(struct gameport *gameport) { - return down_interruptible(&gameport->drv_sem); + return mutex_lock_interruptible(&gameport->drv_mutex); } static inline void gameport_unpin_driver(struct gameport *gameport) { - up(&gameport->drv_sem); + mutex_unlock(&gameport->drv_mutex); } void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 10a27f29d69..2ef845b3517 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -105,6 +105,7 @@ struct gendisk { * disks that can't be partitioned. */ char disk_name[32]; /* name of major driver */ struct hd_struct **part; /* [indexed by minor] */ + int part_uevent_suppress; struct block_device_operations *fops; struct request_queue *queue; void *private_data; diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7851e6b520c..3ac452945a7 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -57,6 +57,8 @@ struct vm_area_struct; __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ __GFP_NOMEMALLOC|__GFP_HARDWALL) +/* This equals 0, but use constants in case they ever change */ +#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 93830158348..306acf1dc6d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -58,6 +58,19 @@ struct hrtimer { }; /** + * struct hrtimer_sleeper - simple sleeper structure + * + * @timer: embedded timer structure + * @task: task to wake up + * + * task is set to NULL, when the timer expires. + */ +struct hrtimer_sleeper { + struct hrtimer timer; + struct task_struct *task; +}; + +/** * struct hrtimer_base - the timer base for a specific clock * * @index: clock type index for per_cpu support when moving a timer @@ -67,7 +80,7 @@ struct hrtimer { * @first: pointer to the timer node which expires first * @resolution: the resolution of the clock, in nanoseconds * @get_time: function to retrieve the current time of the clock - * @get_sofirq_time: function to retrieve the current time from the softirq + * @get_softirq_time: function to retrieve the current time from the softirq * @curr_timer: the timer which is executing a callback right now * @softirq_time: the time when running the hrtimer queue in the softirq */ @@ -127,6 +140,9 @@ extern long hrtimer_nanosleep(struct timespec *rqtp, const enum hrtimer_mode mode, const clockid_t clockid); +extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, + struct task_struct *tsk); + /* Soft interrupt function to run the hrtimer queues: */ extern void hrtimer_run_queues(void); diff --git a/include/linux/init.h b/include/linux/init.h index ed0ac7c39fd..93dcbe1abb4 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -245,7 +245,8 @@ void __init parse_early_param(void); #define __cpuexitdata __exitdata #endif -#ifdef CONFIG_MEMORY_HOTPLUG +#if defined(CONFIG_MEMORY_HOTPLUG) || defined(CONFIG_ACPI_HOTPLUG_MEMORY) \ + || defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE) #define __meminit #define __meminitdata #define __memexit diff --git a/include/linux/input.h b/include/linux/input.h index 1d4e341b72e..b0e612dda0c 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -421,7 +421,7 @@ struct input_absinfo { #define BTN_GEAR_UP 0x151 #define KEY_OK 0x160 -#define KEY_SELECT 0x161 +#define KEY_SELECT 0x161 #define KEY_GOTO 0x162 #define KEY_CLEAR 0x163 #define KEY_POWER2 0x164 @@ -512,6 +512,15 @@ struct input_absinfo { #define KEY_FN_S 0x1e3 #define KEY_FN_B 0x1e4 +#define KEY_BRL_DOT1 0x1f1 +#define KEY_BRL_DOT2 0x1f2 +#define KEY_BRL_DOT3 0x1f3 +#define KEY_BRL_DOT4 0x1f4 +#define KEY_BRL_DOT5 0x1f5 +#define KEY_BRL_DOT6 0x1f6 +#define KEY_BRL_DOT7 0x1f7 +#define KEY_BRL_DOT8 0x1f8 + /* We avoid low common keys in module aliases so they don't get huge. */ #define KEY_MIN_INTERESTING KEY_MUTE #define KEY_MAX 0x1ff @@ -929,7 +938,7 @@ struct input_dev { struct input_handle *grab; - struct semaphore sem; /* serializes open and close operations */ + struct mutex mutex; /* serializes open and close operations */ unsigned int users; struct class_device cdev; @@ -995,11 +1004,6 @@ static inline void init_input_dev(struct input_dev *dev) struct input_dev *input_allocate_device(void); -static inline void input_free_device(struct input_dev *dev) -{ - kfree(dev); -} - static inline struct input_dev *input_get_device(struct input_dev *dev) { return to_input_dev(class_device_get(&dev->cdev)); @@ -1010,6 +1014,11 @@ static inline void input_put_device(struct input_dev *dev) class_device_put(&dev->cdev); } +static inline void input_free_device(struct input_dev *dev) +{ + input_put_device(dev); +} + int input_register_device(struct input_dev *); void input_unregister_device(struct input_dev *); diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index 53571288a9f..6d9c7e4da47 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h @@ -82,6 +82,13 @@ struct ipmi_smi_handlers { struct module *owner; + /* The low-level interface cannot start sending messages to + the upper layer until this function is called. This may + not be NULL, the lower layer must take the interface from + this call. */ + int (*start_processing)(void *send_info, + ipmi_smi_t new_intf); + /* Called to enqueue an SMI message to be sent. This operation is not allowed to fail. If an error occurs, it should report back the error in a received message. It may @@ -157,13 +164,16 @@ static inline void ipmi_demangle_device_id(unsigned char *data, } /* Add a low-level interface to the IPMI driver. Note that if the - interface doesn't know its slave address, it should pass in zero. */ + interface doesn't know its slave address, it should pass in zero. + The low-level interface should not deliver any messages to the + upper layer until the start_processing() function in the handlers + is called, and the lower layer must get the interface from that + call. */ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, void *send_info, struct ipmi_device_id *device_id, struct device *dev, - unsigned char slave_addr, - ipmi_smi_t *intf); + unsigned char slave_addr); /* * Remove a low-level interface from the IPMI driver. This will diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 99905e18053..043376920f5 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -36,6 +36,8 @@ /* LATCH is used in the interval timer and ftape setup. */ #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ +#define LATCH_HPET ((HPET_TICK_RATE + HZ/2) / HZ) + /* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can * improve accuracy by shifting LSH bits, hence calculating: * (NOM << LSH) / DEN @@ -51,9 +53,13 @@ /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) +#define ACTHZ_HPET (SH_DIV (HPET_TICK_RATE, LATCH_HPET, 8)) + /* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */ #define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8)) +#define TICK_NSEC_HPET (SH_DIV(1000000UL * 1000, ACTHZ_HPET, 8)) + /* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index e87c32a5c86..4eb851ece08 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h @@ -135,6 +135,8 @@ static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag) #define U(x) ((x) ^ 0xf000) +#define BRL_UC_ROW 0x2800 + /* keyboard.c */ struct console; diff --git a/include/linux/kernel.h b/include/linux/kernel.h index a3720f973ea..e1bd0842f6a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -176,7 +176,7 @@ static inline void console_verbose(void) extern void bust_spinlocks(int yes); extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ -extern __deprecated_for_modules int panic_timeout; +extern int panic_timeout; extern int panic_on_oops; extern int tainted; extern const char *print_tainted(void); diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h index 08488042d74..de76843bbe8 100644 --- a/include/linux/keyboard.h +++ b/include/linux/keyboard.h @@ -44,6 +44,7 @@ extern unsigned short plain_map[NR_KEYS]; #define KT_ASCII 9 #define KT_LOCK 10 #define KT_SLOCK 12 +#define KT_BRL 14 #define K(t,v) (((t)<<8)|(v)) #define KTYP(x) ((x) >> 8) @@ -427,5 +428,17 @@ extern unsigned short plain_map[NR_KEYS]; #define NR_LOCK 8 +#define K_BRL_BLANK K(KT_BRL, 0) +#define K_BRL_DOT1 K(KT_BRL, 1) +#define K_BRL_DOT2 K(KT_BRL, 2) +#define K_BRL_DOT3 K(KT_BRL, 3) +#define K_BRL_DOT4 K(KT_BRL, 4) +#define K_BRL_DOT5 K(KT_BRL, 5) +#define K_BRL_DOT6 K(KT_BRL, 6) +#define K_BRL_DOT7 K(KT_BRL, 7) +#define K_BRL_DOT8 K(KT_BRL, 8) + +#define NR_BRL 9 + #define MAX_DIACR 256 #endif diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 4cb1214ec29..dcd0623be89 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -24,6 +24,7 @@ #include <linux/rwsem.h> #include <linux/kref.h> #include <linux/kernel.h> +#include <linux/wait.h> #include <asm/atomic.h> #define KOBJ_NAME_LEN 20 @@ -56,6 +57,7 @@ struct kobject { struct kset * kset; struct kobj_type * ktype; struct dentry * dentry; + wait_queue_head_t poll; }; extern int kobject_set_name(struct kobject *, const char *, ...) diff --git a/include/linux/leds.h b/include/linux/leds.h new file mode 100644 index 00000000000..dc23c7c639f --- /dev/null +++ b/include/linux/leds.h @@ -0,0 +1,110 @@ +/* + * Driver model for leds and led triggers + * + * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu> + * Copyright (C) 2005 Richard Purdie <rpurdie@openedhand.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ +#ifndef __LINUX_LEDS_H_INCLUDED +#define __LINUX_LEDS_H_INCLUDED + +struct device; +struct class_device; +/* + * LED Core + */ + +enum led_brightness { + LED_OFF = 0, + LED_HALF = 127, + LED_FULL = 255, +}; + +struct led_classdev { + const char *name; + int brightness; + int flags; + +#define LED_SUSPENDED (1 << 0) + + /* Set LED brightness level */ + void (*brightness_set)(struct led_classdev *led_cdev, + enum led_brightness brightness); + + struct class_device *class_dev; + struct list_head node; /* LED Device list */ + char *default_trigger; /* Trigger to use */ + +#ifdef CONFIG_LEDS_TRIGGERS + /* Protects the trigger data below */ + rwlock_t trigger_lock; + + struct led_trigger *trigger; + struct list_head trig_list; + void *trigger_data; +#endif +}; + +extern int led_classdev_register(struct device *parent, + struct led_classdev *led_cdev); +extern void led_classdev_unregister(struct led_classdev *led_cdev); +extern void led_classdev_suspend(struct led_classdev *led_cdev); +extern void led_classdev_resume(struct led_classdev *led_cdev); + +/* + * LED Triggers + */ +#ifdef CONFIG_LEDS_TRIGGERS + +#define TRIG_NAME_MAX 50 + +struct led_trigger { + /* Trigger Properties */ + const char *name; + void (*activate)(struct led_classdev *led_cdev); + void (*deactivate)(struct led_classdev *led_cdev); + + /* LEDs under control by this trigger (for simple triggers) */ + rwlock_t leddev_list_lock; + struct list_head led_cdevs; + + /* Link to next registered trigger */ + struct list_head next_trig; +}; + +/* Registration functions for complex triggers */ +extern int led_trigger_register(struct led_trigger *trigger); +extern void led_trigger_unregister(struct led_trigger *trigger); + +/* Registration functions for simple triggers */ +#define DEFINE_LED_TRIGGER(x) static struct led_trigger *x; +#define DEFINE_LED_TRIGGER_GLOBAL(x) struct led_trigger *x; +extern void led_trigger_register_simple(const char *name, + struct led_trigger **trigger); +extern void led_trigger_unregister_simple(struct led_trigger *trigger); +extern void led_trigger_event(struct led_trigger *trigger, + enum led_brightness event); + +#else + +/* Triggers aren't active - null macros */ +#define DEFINE_LED_TRIGGER(x) +#define DEFINE_LED_TRIGGER_GLOBAL(x) +#define led_trigger_register_simple(x, y) do {} while(0) +#define led_trigger_unregister_simple(x) do {} while(0) +#define led_trigger_event(x, y) do {} while(0) + +#endif + +/* Trigger specific functions */ +#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK +extern void ledtrig_ide_activity(void); +#else +#define ledtrig_ide_activity() do {} while(0) +#endif + +#endif /* __LINUX_LEDS_H_INCLUDED */ diff --git a/include/linux/libata.h b/include/linux/libata.h index 047192253c3..b80d2e7fa6d 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -160,8 +160,10 @@ enum { ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ + /* host set flags */ + ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ + /* various lengths of time */ - ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ ATA_TMOUT_PIO = 30 * HZ, ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ @@ -279,6 +281,7 @@ struct ata_probe_ent { unsigned long irq; unsigned int irq_flags; unsigned long host_flags; + unsigned long host_set_flags; void __iomem *mmio_base; void *private_data; }; @@ -291,6 +294,9 @@ struct ata_host_set { unsigned int n_ports; void *private_data; const struct ata_port_operations *ops; + unsigned long flags; + int simplex_claimed; /* Keep seperate in case we + ever need to do this locked */ struct ata_port * ports[0]; }; @@ -420,6 +426,7 @@ struct ata_port_operations { void (*set_piomode) (struct ata_port *, struct ata_device *); void (*set_dmamode) (struct ata_port *, struct ata_device *); + unsigned long (*mode_filter) (const struct ata_port *, struct ata_device *, unsigned long); void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); @@ -430,6 +437,7 @@ struct ata_port_operations { void (*dev_select)(struct ata_port *ap, unsigned int device); void (*phy_reset) (struct ata_port *ap); /* obsolete */ + void (*set_mode) (struct ata_port *ap); int (*probe_reset) (struct ata_port *ap, unsigned int *classes); void (*post_set_mode) (struct ata_port *ap); @@ -515,7 +523,6 @@ extern void ata_host_set_remove(struct ata_host_set *host_set); extern int ata_scsi_detect(struct scsi_host_template *sht); extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); -extern int ata_scsi_error(struct Scsi_Host *host); extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); extern int ata_scsi_release(struct Scsi_Host *host); diff --git a/include/linux/libps2.h b/include/linux/libps2.h index a710bddda4e..08a450a9dbf 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h @@ -28,7 +28,7 @@ struct ps2dev { struct serio *serio; /* Ensures that only one command is executing at a time */ - struct semaphore cmd_sem; + struct mutex cmd_mutex; /* Used to signal completion from interrupt handler */ wait_queue_head_t wait; diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 968b1aa3732..4ca3e6ad03e 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -58,8 +58,6 @@ extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); /* need some defines for these for archs that don't support it */ extern void online_page(struct page *page); /* VM interface that may be used by firmware interface */ -extern int add_memory(u64 start, u64 size); -extern int remove_memory(u64 start, u64 size); extern int online_pages(unsigned long, unsigned long); /* reasonably generic interface to expand the physical pages in a zone */ @@ -92,11 +90,6 @@ static inline int mhp_notimplemented(const char *func) return -ENOSYS; } -static inline int __add_pages(struct zone *zone, unsigned long start_pfn, - unsigned long nr_pages) -{ - return mhp_notimplemented(__FUNCTION__); -} #endif /* ! CONFIG_MEMORY_HOTPLUG */ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, unsigned long nr_pages) @@ -105,4 +98,11 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, dump_stack(); return -ENOSYS; } + +#if defined(CONFIG_MEMORY_HOTPLUG) || defined(CONFIG_ACPI_HOTPLUG_MEMORY) \ + || defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE) +extern int add_memory(u64 start, u64 size); +extern int remove_memory(u64 start, u64 size); +#endif + #endif /* __LINUX_MEMORY_HOTPLUG_H */ diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 7d09962c3c0..ff0a64073eb 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -12,7 +12,7 @@ extern void migrate_page_copy(struct page *, struct page *); extern int migrate_page_remove_references(struct page *, struct page *, int); extern int migrate_pages(struct list_head *l, struct list_head *t, struct list_head *moved, struct list_head *failed); -int migrate_pages_to(struct list_head *pagelist, +extern int migrate_pages_to(struct list_head *pagelist, struct vm_area_struct *vma, int dest); extern int fail_migrate_page(struct page *, struct page *); @@ -26,6 +26,9 @@ static inline int putback_lru_pages(struct list_head *l) { return 0; } static inline int migrate_pages(struct list_head *l, struct list_head *t, struct list_head *moved, struct list_head *failed) { return -ENOSYS; } +static inline int migrate_pages_to(struct list_head *pagelist, + struct vm_area_struct *vma, int dest) { return 0; } + static inline int migrate_prep(void) { return -ENOSYS; } /* Possible settings for the migrate_page() method in address_operations */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 6aa016f1d3a..1154684209a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -229,10 +229,9 @@ struct page { unsigned long private; /* Mapping-private opaque data: * usually used for buffer_heads * if PagePrivate set; used for - * swp_entry_t if PageSwapCache. - * When page is free, this + * swp_entry_t if PageSwapCache; * indicates order in the buddy - * system. + * system if PG_buddy is set. */ struct address_space *mapping; /* If low bit clear, points to * inode address_space, or NULL. diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index f46afec6fbf..72fc68c5ee9 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h @@ -10,7 +10,7 @@ #ifndef __MTD_TRANS_H__ #define __MTD_TRANS_H__ -#include <asm/semaphore.h> +#include <linux/mutex.h> struct hd_geometry; struct mtd_info; @@ -22,7 +22,7 @@ struct mtd_blktrans_dev { struct mtd_blktrans_ops *tr; struct list_head list; struct mtd_info *mtd; - struct semaphore sem; + struct mutex lock; int devnum; int blksize; unsigned long size; diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h index 386a52cf8b1..9addd073bf1 100644 --- a/include/linux/mtd/doc2000.h +++ b/include/linux/mtd/doc2000.h @@ -15,7 +15,7 @@ #define __MTD_DOC2000_H__ #include <linux/mtd/mtd.h> -#include <asm/semaphore.h> +#include <linux/mutex.h> #define DoC_Sig1 0 #define DoC_Sig2 1 @@ -187,7 +187,7 @@ struct DiskOnChip { int numchips; struct Nand *chips; struct mtd_info *nextdoc; - struct semaphore lock; + struct mutex lock; }; int doc_decode_ecc(unsigned char sector[512], unsigned char ecc1[6]); diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h index 0268125a627..d7eaa40e5ab 100644 --- a/include/linux/mtd/inftl.h +++ b/include/linux/mtd/inftl.h @@ -52,6 +52,11 @@ struct INFTLrecord { int INFTL_mount(struct INFTLrecord *s); int INFTL_formatblock(struct INFTLrecord *s, int block); +extern char inftlmountrev[]; + +void INFTL_dumptables(struct INFTLrecord *s); +void INFTL_dumpVUchains(struct INFTLrecord *s); + #endif /* __KERNEL__ */ #endif /* __MTD_INFTL_H__ */ diff --git a/include/linux/namei.h b/include/linux/namei.h index e6698013e4d..58cb3d3d44b 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -75,7 +75,6 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); extern void release_open_intent(struct nameidata *); extern struct dentry * lookup_one_len(const char *, struct dentry *, int); -extern __deprecated_for_modules struct dentry * lookup_hash(struct nameidata *); extern int follow_down(struct vfsmount **, struct dentry **); extern int follow_up(struct vfsmount **, struct dentry **); diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 950dc55e519..40ccf8cc423 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -598,20 +598,7 @@ DECLARE_PER_CPU(struct softnet_data,softnet_data); #define HAVE_NETIF_QUEUE -static inline void __netif_schedule(struct net_device *dev) -{ - if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) { - unsigned long flags; - struct softnet_data *sd; - - local_irq_save(flags); - sd = &__get_cpu_var(softnet_data); - dev->next_sched = sd->output_queue; - sd->output_queue = dev; - raise_softirq_irqoff(NET_TX_SOFTIRQ); - local_irq_restore(flags); - } -} +extern void __netif_schedule(struct net_device *dev); static inline void netif_schedule(struct net_device *dev) { @@ -675,13 +662,7 @@ static inline void dev_kfree_skb_irq(struct sk_buff *skb) /* Use this variant in places where it could be invoked * either from interrupt or non-interrupt context. */ -static inline void dev_kfree_skb_any(struct sk_buff *skb) -{ - if (in_irq() || irqs_disabled()) - dev_kfree_skb_irq(skb); - else - dev_kfree_skb(skb); -} +extern void dev_kfree_skb_any(struct sk_buff *skb); #define HAVE_NETIF_RX 1 extern int netif_rx(struct sk_buff *skb); @@ -768,22 +749,9 @@ static inline int netif_device_present(struct net_device *dev) return test_bit(__LINK_STATE_PRESENT, &dev->state); } -static inline void netif_device_detach(struct net_device *dev) -{ - if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) && - netif_running(dev)) { - netif_stop_queue(dev); - } -} +extern void netif_device_detach(struct net_device *dev); -static inline void netif_device_attach(struct net_device *dev) -{ - if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) && - netif_running(dev)) { - netif_wake_queue(dev); - __netdev_watchdog_up(dev); - } -} +extern void netif_device_attach(struct net_device *dev); /* * Network interface message level settings @@ -851,20 +819,7 @@ static inline int netif_rx_schedule_prep(struct net_device *dev) * already been called and returned 1. */ -static inline void __netif_rx_schedule(struct net_device *dev) -{ - unsigned long flags; - - local_irq_save(flags); - dev_hold(dev); - list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); - if (dev->quota < 0) - dev->quota += dev->weight; - else - dev->quota = dev->weight; - __raise_softirq_irqoff(NET_RX_SOFTIRQ); - local_irq_restore(flags); -} +extern void __netif_rx_schedule(struct net_device *dev); /* Try to reschedule poll. Called by irq handler. */ diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 412e52ca972..b31a9bca936 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -110,6 +110,8 @@ struct nf_info /* Function to register/unregister hook points. */ int nf_register_hook(struct nf_hook_ops *reg); void nf_unregister_hook(struct nf_hook_ops *reg); +int nf_register_hooks(struct nf_hook_ops *reg, unsigned int n); +void nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n); /* Functions to register get/setsockopt ranges (non-inclusive). You need to check permissions yourself! */ @@ -281,16 +283,42 @@ extern void nf_invalidate_cache(int pf); Returns true or false. */ extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); -struct nf_queue_rerouter { - void (*save)(const struct sk_buff *skb, struct nf_info *info); - int (*reroute)(struct sk_buff **skb, const struct nf_info *info); - int rer_size; +struct nf_afinfo { + unsigned short family; + unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, + unsigned int dataoff, u_int8_t protocol); + void (*saveroute)(const struct sk_buff *skb, + struct nf_info *info); + int (*reroute)(struct sk_buff **skb, + const struct nf_info *info); + int route_key_size; }; -#define nf_info_reroute(x) ((void *)x + sizeof(struct nf_info)) +extern struct nf_afinfo *nf_afinfo[]; +static inline struct nf_afinfo *nf_get_afinfo(unsigned short family) +{ + return rcu_dereference(nf_afinfo[family]); +} + +static inline unsigned int +nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, + u_int8_t protocol, unsigned short family) +{ + struct nf_afinfo *afinfo; + unsigned int csum = 0; + + rcu_read_lock(); + afinfo = nf_get_afinfo(family); + if (afinfo) + csum = afinfo->checksum(skb, hook, dataoff, protocol); + rcu_read_unlock(); + return csum; +} -extern int nf_register_queue_rerouter(int pf, struct nf_queue_rerouter *rer); -extern int nf_unregister_queue_rerouter(int pf); +extern int nf_register_afinfo(struct nf_afinfo *afinfo); +extern void nf_unregister_afinfo(struct nf_afinfo *afinfo); + +#define nf_info_reroute(x) ((void *)x + sizeof(struct nf_info)) #include <net/flow.h> extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 1350e47b023..f6bdef82a32 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -142,6 +142,12 @@ struct xt_counters_info #define ASSERT_WRITE_LOCK(x) #include <linux/netfilter_ipv4/listhelp.h> +#ifdef CONFIG_COMPAT +#define COMPAT_TO_USER 1 +#define COMPAT_FROM_USER -1 +#define COMPAT_CALC_SIZE 0 +#endif + struct xt_match { struct list_head list; @@ -175,6 +181,9 @@ struct xt_match void (*destroy)(const struct xt_match *match, void *matchinfo, unsigned int matchinfosize); + /* Called when userspace align differs from kernel space one */ + int (*compat)(void *match, void **dstptr, int *size, int convert); + /* Set this to THIS_MODULE if you are a module, otherwise NULL */ struct module *me; @@ -220,6 +229,9 @@ struct xt_target void (*destroy)(const struct xt_target *target, void *targinfo, unsigned int targinfosize); + /* Called when userspace align differs from kernel space one */ + int (*compat)(void *target, void **dstptr, int *size, int convert); + /* Set this to THIS_MODULE if you are a module, otherwise NULL */ struct module *me; @@ -314,6 +326,61 @@ extern void xt_proto_fini(int af); extern struct xt_table_info *xt_alloc_table_info(unsigned int size); extern void xt_free_table_info(struct xt_table_info *info); +#ifdef CONFIG_COMPAT +#include <net/compat.h> + +struct compat_xt_entry_match +{ + union { + struct { + u_int16_t match_size; + char name[XT_FUNCTION_MAXNAMELEN - 1]; + u_int8_t revision; + } user; + u_int16_t match_size; + } u; + unsigned char data[0]; +}; + +struct compat_xt_entry_target +{ + union { + struct { + u_int16_t target_size; + char name[XT_FUNCTION_MAXNAMELEN - 1]; + u_int8_t revision; + } user; + u_int16_t target_size; + } u; + unsigned char data[0]; +}; + +/* FIXME: this works only on 32 bit tasks + * need to change whole approach in order to calculate align as function of + * current task alignment */ + +struct compat_xt_counters +{ + u_int32_t cnt[4]; +}; + +struct compat_xt_counters_info +{ + char name[XT_TABLE_MAXNAMELEN]; + compat_uint_t num_counters; + struct compat_xt_counters counters[0]; +}; + +#define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ + & ~(__alignof__(struct compat_xt_counters)-1)) + +extern void xt_compat_lock(int af); +extern void xt_compat_unlock(int af); +extern int xt_compat_match(void *match, void **dstptr, int *size, int convert); +extern int xt_compat_target(void *target, void **dstptr, int *size, + int convert); + +#endif /* CONFIG_COMPAT */ #endif /* __KERNEL__ */ #endif /* _X_TABLES_H */ diff --git a/include/linux/netfilter/xt_esp.h b/include/linux/netfilter/xt_esp.h new file mode 100644 index 00000000000..9380fb1c27d --- /dev/null +++ b/include/linux/netfilter/xt_esp.h @@ -0,0 +1,14 @@ +#ifndef _XT_ESP_H +#define _XT_ESP_H + +struct xt_esp +{ + u_int32_t spis[2]; /* Security Parameter Index */ + u_int8_t invflags; /* Inverse flags */ +}; + +/* Values for "invflags" field in struct xt_esp. */ +#define XT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ +#define XT_ESP_INV_MASK 0x01 /* All possible flags. */ + +#endif /*_XT_ESP_H*/ diff --git a/include/linux/netfilter/xt_multiport.h b/include/linux/netfilter/xt_multiport.h new file mode 100644 index 00000000000..d49ee418371 --- /dev/null +++ b/include/linux/netfilter/xt_multiport.h @@ -0,0 +1,30 @@ +#ifndef _XT_MULTIPORT_H +#define _XT_MULTIPORT_H + +enum xt_multiport_flags +{ + XT_MULTIPORT_SOURCE, + XT_MULTIPORT_DESTINATION, + XT_MULTIPORT_EITHER +}; + +#define XT_MULTI_PORTS 15 + +/* Must fit inside union xt_matchinfo: 16 bytes */ +struct xt_multiport +{ + u_int8_t flags; /* Type of comparison */ + u_int8_t count; /* Number of ports */ + u_int16_t ports[XT_MULTI_PORTS]; /* Ports */ +}; + +struct xt_multiport_v1 +{ + u_int8_t flags; /* Type of comparison */ + u_int8_t count; /* Number of ports */ + u_int16_t ports[XT_MULTI_PORTS]; /* Ports */ + u_int8_t pflags[XT_MULTI_PORTS]; /* Port flags */ + u_int8_t invert; /* Invert flag */ +}; + +#endif /*_XT_MULTIPORT_H*/ diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 43c09d790b8..85301c5e8d2 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h @@ -80,6 +80,8 @@ enum nf_ip_hook_priorities { #ifdef __KERNEL__ extern int ip_route_me_harder(struct sk_buff **pskb); extern int ip_xfrm_me_harder(struct sk_buff **pskb); +extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, + unsigned int dataoff, u_int8_t protocol); #endif /*__KERNEL__*/ #endif /*__LINUX_IP_NETFILTER_H*/ diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h index 0987cea5384..eace86bd2ad 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h @@ -3,6 +3,8 @@ #ifdef __KERNEL__ +#include <linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h> + #define RAS_PORT 1719 #define Q931_PORT 1720 #define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ @@ -25,6 +27,56 @@ struct ip_ct_h323_master { }; }; +struct ip_conntrack_expect; + +extern int get_h225_addr(unsigned char *data, TransportAddress * addr, + u_int32_t * ip, u_int16_t * port); +extern void ip_conntrack_h245_expect(struct ip_conntrack *new, + struct ip_conntrack_expect *this); +extern void ip_conntrack_q931_expect(struct ip_conntrack *new, + struct ip_conntrack_expect *this); +extern int (*set_h245_addr_hook) (struct sk_buff ** pskb, + unsigned char **data, int dataoff, + H245_TransportAddress * addr, + u_int32_t ip, u_int16_t port); +extern int (*set_h225_addr_hook) (struct sk_buff ** pskb, + unsigned char **data, int dataoff, + TransportAddress * addr, + u_int32_t ip, u_int16_t port); +extern int (*set_sig_addr_hook) (struct sk_buff ** pskb, + struct ip_conntrack * ct, + enum ip_conntrack_info ctinfo, + unsigned char **data, + TransportAddress * addr, int count); +extern int (*set_ras_addr_hook) (struct sk_buff ** pskb, + struct ip_conntrack * ct, + enum ip_conntrack_info ctinfo, + unsigned char **data, + TransportAddress * addr, int count); +extern int (*nat_rtp_rtcp_hook) (struct sk_buff ** pskb, + struct ip_conntrack * ct, + enum ip_conntrack_info ctinfo, + unsigned char **data, int dataoff, + H245_TransportAddress * addr, + u_int16_t port, u_int16_t rtp_port, + struct ip_conntrack_expect * rtp_exp, + struct ip_conntrack_expect * rtcp_exp); +extern int (*nat_t120_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, + enum ip_conntrack_info ctinfo, + unsigned char **data, int dataoff, + H245_TransportAddress * addr, u_int16_t port, + struct ip_conntrack_expect * exp); +extern int (*nat_h245_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, + enum ip_conntrack_info ctinfo, + unsigned char **data, int dataoff, + TransportAddress * addr, u_int16_t port, + struct ip_conntrack_expect * exp); +extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, + enum ip_conntrack_info ctinfo, + unsigned char **data, TransportAddress * addr, + int idx, u_int16_t port, + struct ip_conntrack_expect * exp); + #endif #endif diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h new file mode 100644 index 00000000000..0bd828081c0 --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h @@ -0,0 +1,98 @@ +/**************************************************************************** + * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 + * conntrack/NAT module. + * + * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@hotmail.com> + * + * This source code is licensed under General Public License version 2. + * + * + * This library is based on H.225 version 4, H.235 version 2 and H.245 + * version 7. It is extremely optimized to decode only the absolutely + * necessary objects in a signal for Linux kernel NAT module use, so don't + * expect it to be a full ASN.1 library. + * + * Features: + * + * 1. Small. The total size of code plus data is less than 20 KB (IA32). + * 2. Fast. Decoding Netmeeting's Setup signal 1 million times on a PIII 866 + * takes only 3.9 seconds. + * 3. No memory allocation. It uses a static object. No need to initialize or + * cleanup. + * 4. Thread safe. + * 5. Support embedded architectures that has no misaligned memory access + * support. + * + * Limitations: + * + * 1. At most 30 faststart entries. Actually this is limited by ethernet's MTU. + * If a Setup signal contains more than 30 faststart, the packet size will + * very likely exceed the MTU size, then the TPKT will be fragmented. I + * don't know how to handle this in a Netfilter module. Anybody can help? + * Although I think 30 is enough for most of the cases. + * 2. IPv4 addresses only. + * + ****************************************************************************/ + +#ifndef _IP_CONNTRACK_HELPER_H323_ASN1_H_ +#define _IP_CONNTRACK_HELPER_H323_ASN1_H_ + +/***************************************************************************** + * H.323 Types + ****************************************************************************/ +#include "ip_conntrack_helper_h323_types.h" + +typedef struct { + enum { + Q931_NationalEscape = 0x00, + Q931_Alerting = 0x01, + Q931_CallProceeding = 0x02, + Q931_Connect = 0x07, + Q931_ConnectAck = 0x0F, + Q931_Progress = 0x03, + Q931_Setup = 0x05, + Q931_SetupAck = 0x0D, + Q931_Resume = 0x26, + Q931_ResumeAck = 0x2E, + Q931_ResumeReject = 0x22, + Q931_Suspend = 0x25, + Q931_SuspendAck = 0x2D, + Q931_SuspendReject = 0x21, + Q931_UserInformation = 0x20, + Q931_Disconnect = 0x45, + Q931_Release = 0x4D, + Q931_ReleaseComplete = 0x5A, + Q931_Restart = 0x46, + Q931_RestartAck = 0x4E, + Q931_Segment = 0x60, + Q931_CongestionCtrl = 0x79, + Q931_Information = 0x7B, + Q931_Notify = 0x6E, + Q931_Status = 0x7D, + Q931_StatusEnquiry = 0x75, + Q931_Facility = 0x62 + } MessageType; + H323_UserInformation UUIE; +} Q931; + +/***************************************************************************** + * Decode Functions Return Codes + ****************************************************************************/ + +#define H323_ERROR_NONE 0 /* Decoded successfully */ +#define H323_ERROR_STOP 1 /* Decoding stopped, not really an error */ +#define H323_ERROR_BOUND -1 +#define H323_ERROR_RANGE -2 + + +/***************************************************************************** + * Decode Functions + ****************************************************************************/ + +int DecodeRasMessage(unsigned char *buf, size_t sz, RasMessage * ras); +int DecodeQ931(unsigned char *buf, size_t sz, Q931 * q931); +int DecodeMultimediaSystemControlMessage(unsigned char *buf, size_t sz, + MultimediaSystemControlMessage * + mscm); + +#endif diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h new file mode 100644 index 00000000000..cc98f7aa5ab --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h @@ -0,0 +1,938 @@ +/* Generated by Jing Min Zhao's ASN.1 parser, Mar 15 2006 + * + * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net> + * + * This source code is licensed under General Public License version 2. + */ + +typedef struct TransportAddress_ipAddress { /* SEQUENCE */ + int options; /* No use */ + unsigned ip; +} TransportAddress_ipAddress; + +typedef struct TransportAddress { /* CHOICE */ + enum { + eTransportAddress_ipAddress, + eTransportAddress_ipSourceRoute, + eTransportAddress_ipxAddress, + eTransportAddress_ip6Address, + eTransportAddress_netBios, + eTransportAddress_nsap, + eTransportAddress_nonStandardAddress, + } choice; + union { + TransportAddress_ipAddress ipAddress; + }; +} TransportAddress; + +typedef struct DataProtocolCapability { /* CHOICE */ + enum { + eDataProtocolCapability_nonStandard, + eDataProtocolCapability_v14buffered, + eDataProtocolCapability_v42lapm, + eDataProtocolCapability_hdlcFrameTunnelling, + eDataProtocolCapability_h310SeparateVCStack, + eDataProtocolCapability_h310SingleVCStack, + eDataProtocolCapability_transparent, + eDataProtocolCapability_segmentationAndReassembly, + eDataProtocolCapability_hdlcFrameTunnelingwSAR, + eDataProtocolCapability_v120, + eDataProtocolCapability_separateLANStack, + eDataProtocolCapability_v76wCompression, + eDataProtocolCapability_tcp, + eDataProtocolCapability_udp, + } choice; +} DataProtocolCapability; + +typedef struct DataApplicationCapability_application { /* CHOICE */ + enum { + eDataApplicationCapability_application_nonStandard, + eDataApplicationCapability_application_t120, + eDataApplicationCapability_application_dsm_cc, + eDataApplicationCapability_application_userData, + eDataApplicationCapability_application_t84, + eDataApplicationCapability_application_t434, + eDataApplicationCapability_application_h224, + eDataApplicationCapability_application_nlpid, + eDataApplicationCapability_application_dsvdControl, + eDataApplicationCapability_application_h222DataPartitioning, + eDataApplicationCapability_application_t30fax, + eDataApplicationCapability_application_t140, + eDataApplicationCapability_application_t38fax, + eDataApplicationCapability_application_genericDataCapability, + } choice; + union { + DataProtocolCapability t120; + }; +} DataApplicationCapability_application; + +typedef struct DataApplicationCapability { /* SEQUENCE */ + int options; /* No use */ + DataApplicationCapability_application application; +} DataApplicationCapability; + +typedef struct DataType { /* CHOICE */ + enum { + eDataType_nonStandard, + eDataType_nullData, + eDataType_videoData, + eDataType_audioData, + eDataType_data, + eDataType_encryptionData, + eDataType_h235Control, + eDataType_h235Media, + eDataType_multiplexedStream, + } choice; + union { + DataApplicationCapability data; + }; +} DataType; + +typedef struct UnicastAddress_iPAddress { /* SEQUENCE */ + int options; /* No use */ + unsigned network; +} UnicastAddress_iPAddress; + +typedef struct UnicastAddress { /* CHOICE */ + enum { + eUnicastAddress_iPAddress, + eUnicastAddress_iPXAddress, + eUnicastAddress_iP6Address, + eUnicastAddress_netBios, + eUnicastAddress_iPSourceRouteAddress, + eUnicastAddress_nsap, + eUnicastAddress_nonStandardAddress, + } choice; + union { + UnicastAddress_iPAddress iPAddress; + }; +} UnicastAddress; + +typedef struct H245_TransportAddress { /* CHOICE */ + enum { + eH245_TransportAddress_unicastAddress, + eH245_TransportAddress_multicastAddress, + } choice; + union { + UnicastAddress unicastAddress; + }; +} H245_TransportAddress; + +typedef struct H2250LogicalChannelParameters { /* SEQUENCE */ + enum { + eH2250LogicalChannelParameters_nonStandard = (1 << 31), + eH2250LogicalChannelParameters_associatedSessionID = + (1 << 30), + eH2250LogicalChannelParameters_mediaChannel = (1 << 29), + eH2250LogicalChannelParameters_mediaGuaranteedDelivery = + (1 << 28), + eH2250LogicalChannelParameters_mediaControlChannel = + (1 << 27), + eH2250LogicalChannelParameters_mediaControlGuaranteedDelivery + = (1 << 26), + eH2250LogicalChannelParameters_silenceSuppression = (1 << 25), + eH2250LogicalChannelParameters_destination = (1 << 24), + eH2250LogicalChannelParameters_dynamicRTPPayloadType = + (1 << 23), + eH2250LogicalChannelParameters_mediaPacketization = (1 << 22), + eH2250LogicalChannelParameters_transportCapability = + (1 << 21), + eH2250LogicalChannelParameters_redundancyEncoding = (1 << 20), + eH2250LogicalChannelParameters_source = (1 << 19), + } options; + H245_TransportAddress mediaChannel; + H245_TransportAddress mediaControlChannel; +} H2250LogicalChannelParameters; + +typedef struct OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters { /* CHOICE */ + enum { + eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h222LogicalChannelParameters, + eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h223LogicalChannelParameters, + eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_v76LogicalChannelParameters, + eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters, + eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_none, + } choice; + union { + H2250LogicalChannelParameters h2250LogicalChannelParameters; + }; +} OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters; + +typedef struct OpenLogicalChannel_forwardLogicalChannelParameters { /* SEQUENCE */ + enum { + eOpenLogicalChannel_forwardLogicalChannelParameters_portNumber + = (1 << 31), + eOpenLogicalChannel_forwardLogicalChannelParameters_forwardLogicalChannelDependency + = (1 << 30), + eOpenLogicalChannel_forwardLogicalChannelParameters_replacementFor + = (1 << 29), + } options; + DataType dataType; + OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters + multiplexParameters; +} OpenLogicalChannel_forwardLogicalChannelParameters; + +typedef struct OpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters { /* CHOICE */ + enum { + eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters_h223LogicalChannelParameters, + eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters_v76LogicalChannelParameters, + eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters, + } choice; + union { + H2250LogicalChannelParameters h2250LogicalChannelParameters; + }; +} OpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters; + +typedef struct OpenLogicalChannel_reverseLogicalChannelParameters { /* SEQUENCE */ + enum { + eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters + = (1 << 31), + eOpenLogicalChannel_reverseLogicalChannelParameters_reverseLogicalChannelDependency + = (1 << 30), + eOpenLogicalChannel_reverseLogicalChannelParameters_replacementFor + = (1 << 29), + } options; + OpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters + multiplexParameters; +} OpenLogicalChannel_reverseLogicalChannelParameters; + +typedef struct NetworkAccessParameters_networkAddress { /* CHOICE */ + enum { + eNetworkAccessParameters_networkAddress_q2931Address, + eNetworkAccessParameters_networkAddress_e164Address, + eNetworkAccessParameters_networkAddress_localAreaAddress, + } choice; + union { + H245_TransportAddress localAreaAddress; + }; +} NetworkAccessParameters_networkAddress; + +typedef struct NetworkAccessParameters { /* SEQUENCE */ + enum { + eNetworkAccessParameters_distribution = (1 << 31), + eNetworkAccessParameters_externalReference = (1 << 30), + eNetworkAccessParameters_t120SetupProcedure = (1 << 29), + } options; + NetworkAccessParameters_networkAddress networkAddress; +} NetworkAccessParameters; + +typedef struct OpenLogicalChannel { /* SEQUENCE */ + enum { + eOpenLogicalChannel_reverseLogicalChannelParameters = + (1 << 31), + eOpenLogicalChannel_separateStack = (1 << 30), + eOpenLogicalChannel_encryptionSync = (1 << 29), + } options; + OpenLogicalChannel_forwardLogicalChannelParameters + forwardLogicalChannelParameters; + OpenLogicalChannel_reverseLogicalChannelParameters + reverseLogicalChannelParameters; + NetworkAccessParameters separateStack; +} OpenLogicalChannel; + +typedef struct Setup_UUIE_fastStart { /* SEQUENCE OF */ + int count; + OpenLogicalChannel item[30]; +} Setup_UUIE_fastStart; + +typedef struct Setup_UUIE { /* SEQUENCE */ + enum { + eSetup_UUIE_h245Address = (1 << 31), + eSetup_UUIE_sourceAddress = (1 << 30), + eSetup_UUIE_destinationAddress = (1 << 29), + eSetup_UUIE_destCallSignalAddress = (1 << 28), + eSetup_UUIE_destExtraCallInfo = (1 << 27), + eSetup_UUIE_destExtraCRV = (1 << 26), + eSetup_UUIE_callServices = (1 << 25), + eSetup_UUIE_sourceCallSignalAddress = (1 << 24), + eSetup_UUIE_remoteExtensionAddress = (1 << 23), + eSetup_UUIE_callIdentifier = (1 << 22), + eSetup_UUIE_h245SecurityCapability = (1 << 21), + eSetup_UUIE_tokens = (1 << 20), + eSetup_UUIE_cryptoTokens = (1 << 19), + eSetup_UUIE_fastStart = (1 << 18), + eSetup_UUIE_mediaWaitForConnect = (1 << 17), + eSetup_UUIE_canOverlapSend = (1 << 16), + eSetup_UUIE_endpointIdentifier = (1 << 15), + eSetup_UUIE_multipleCalls = (1 << 14), + eSetup_UUIE_maintainConnection = (1 << 13), + eSetup_UUIE_connectionParameters = (1 << 12), + eSetup_UUIE_language = (1 << 11), + eSetup_UUIE_presentationIndicator = (1 << 10), + eSetup_UUIE_screeningIndicator = (1 << 9), + eSetup_UUIE_serviceControl = (1 << 8), + eSetup_UUIE_symmetricOperationRequired = (1 << 7), + eSetup_UUIE_capacity = (1 << 6), + eSetup_UUIE_circuitInfo = (1 << 5), + eSetup_UUIE_desiredProtocols = (1 << 4), + eSetup_UUIE_neededFeatures = (1 << 3), + eSetup_UUIE_desiredFeatures = (1 << 2), + eSetup_UUIE_supportedFeatures = (1 << 1), + eSetup_UUIE_parallelH245Control = (1 << 0), + } options; + TransportAddress h245Address; + TransportAddress destCallSignalAddress; + TransportAddress sourceCallSignalAddress; + Setup_UUIE_fastStart fastStart; +} Setup_UUIE; + +typedef struct CallProceeding_UUIE_fastStart { /* SEQUENCE OF */ + int count; + OpenLogicalChannel item[30]; +} CallProceeding_UUIE_fastStart; + +typedef struct CallProceeding_UUIE { /* SEQUENCE */ + enum { + eCallProceeding_UUIE_h245Address = (1 << 31), + eCallProceeding_UUIE_callIdentifier = (1 << 30), + eCallProceeding_UUIE_h245SecurityMode = (1 << 29), + eCallProceeding_UUIE_tokens = (1 << 28), + eCallProceeding_UUIE_cryptoTokens = (1 << 27), + eCallProceeding_UUIE_fastStart = (1 << 26), + eCallProceeding_UUIE_multipleCalls = (1 << 25), + eCallProceeding_UUIE_maintainConnection = (1 << 24), + eCallProceeding_UUIE_fastConnectRefused = (1 << 23), + eCallProceeding_UUIE_featureSet = (1 << 22), + } options; + TransportAddress h245Address; + CallProceeding_UUIE_fastStart fastStart; +} CallProceeding_UUIE; + +typedef struct Connect_UUIE_fastStart { /* SEQUENCE OF */ + int count; + OpenLogicalChannel item[30]; +} Connect_UUIE_fastStart; + +typedef struct Connect_UUIE { /* SEQUENCE */ + enum { + eConnect_UUIE_h245Address = (1 << 31), + eConnect_UUIE_callIdentifier = (1 << 30), + eConnect_UUIE_h245SecurityMode = (1 << 29), + eConnect_UUIE_tokens = (1 << 28), + eConnect_UUIE_cryptoTokens = (1 << 27), + eConnect_UUIE_fastStart = (1 << 26), + eConnect_UUIE_multipleCalls = (1 << 25), + eConnect_UUIE_maintainConnection = (1 << 24), + eConnect_UUIE_language = (1 << 23), + eConnect_UUIE_connectedAddress = (1 << 22), + eConnect_UUIE_presentationIndicator = (1 << 21), + eConnect_UUIE_screeningIndicator = (1 << 20), + eConnect_UUIE_fastConnectRefused = (1 << 19), + eConnect_UUIE_serviceControl = (1 << 18), + eConnect_UUIE_capacity = (1 << 17), + eConnect_UUIE_featureSet = (1 << 16), + } options; + TransportAddress h245Address; + Connect_UUIE_fastStart fastStart; +} Connect_UUIE; + +typedef struct Alerting_UUIE_fastStart { /* SEQUENCE OF */ + int count; + OpenLogicalChannel item[30]; +} Alerting_UUIE_fastStart; + +typedef struct Alerting_UUIE { /* SEQUENCE */ + enum { + eAlerting_UUIE_h245Address = (1 << 31), + eAlerting_UUIE_callIdentifier = (1 << 30), + eAlerting_UUIE_h245SecurityMode = (1 << 29), + eAlerting_UUIE_tokens = (1 << 28), + eAlerting_UUIE_cryptoTokens = (1 << 27), + eAlerting_UUIE_fastStart = (1 << 26), + eAlerting_UUIE_multipleCalls = (1 << 25), + eAlerting_UUIE_maintainConnection = (1 << 24), + eAlerting_UUIE_alertingAddress = (1 << 23), + eAlerting_UUIE_presentationIndicator = (1 << 22), + eAlerting_UUIE_screeningIndicator = (1 << 21), + eAlerting_UUIE_fastConnectRefused = (1 << 20), + eAlerting_UUIE_serviceControl = (1 << 19), + eAlerting_UUIE_capacity = (1 << 18), + eAlerting_UUIE_featureSet = (1 << 17), + } options; + TransportAddress h245Address; + Alerting_UUIE_fastStart fastStart; +} Alerting_UUIE; + +typedef struct Information_UUIE_fastStart { /* SEQUENCE OF */ + int count; + OpenLogicalChannel item[30]; +} Information_UUIE_fastStart; + +typedef struct Information_UUIE { /* SEQUENCE */ + enum { + eInformation_UUIE_callIdentifier = (1 << 31), + eInformation_UUIE_tokens = (1 << 30), + eInformation_UUIE_cryptoTokens = (1 << 29), + eInformation_UUIE_fastStart = (1 << 28), + eInformation_UUIE_fastConnectRefused = (1 << 27), + eInformation_UUIE_circuitInfo = (1 << 26), + } options; + Information_UUIE_fastStart fastStart; +} Information_UUIE; + +typedef struct FacilityReason { /* CHOICE */ + enum { + eFacilityReason_routeCallToGatekeeper, + eFacilityReason_callForwarded, + eFacilityReason_routeCallToMC, + eFacilityReason_undefinedReason, + eFacilityReason_conferenceListChoice, + eFacilityReason_startH245, + eFacilityReason_noH245, + eFacilityReason_newTokens, + eFacilityReason_featureSetUpdate, + eFacilityReason_forwardedElements, + eFacilityReason_transportedInformation, + } choice; +} FacilityReason; + +typedef struct Facility_UUIE_fastStart { /* SEQUENCE OF */ + int count; + OpenLogicalChannel item[30]; +} Facility_UUIE_fastStart; + +typedef struct Facility_UUIE { /* SEQUENCE */ + enum { + eFacility_UUIE_alternativeAddress = (1 << 31), + eFacility_UUIE_alternativeAliasAddress = (1 << 30), + eFacility_UUIE_conferenceID = (1 << 29), + eFacility_UUIE_callIdentifier = (1 << 28), + eFacility_UUIE_destExtraCallInfo = (1 << 27), + eFacility_UUIE_remoteExtensionAddress = (1 << 26), + eFacility_UUIE_tokens = (1 << 25), + eFacility_UUIE_cryptoTokens = (1 << 24), + eFacility_UUIE_conferences = (1 << 23), + eFacility_UUIE_h245Address = (1 << 22), + eFacility_UUIE_fastStart = (1 << 21), + eFacility_UUIE_multipleCalls = (1 << 20), + eFacility_UUIE_maintainConnection = (1 << 19), + eFacility_UUIE_fastConnectRefused = (1 << 18), + eFacility_UUIE_serviceControl = (1 << 17), + eFacility_UUIE_circuitInfo = (1 << 16), + eFacility_UUIE_featureSet = (1 << 15), + eFacility_UUIE_destinationInfo = (1 << 14), + eFacility_UUIE_h245SecurityMode = (1 << 13), + } options; + FacilityReason reason; + TransportAddress h245Address; + Facility_UUIE_fastStart fastStart; +} Facility_UUIE; + +typedef struct Progress_UUIE_fastStart { /* SEQUENCE OF */ + int count; + OpenLogicalChannel item[30]; +} Progress_UUIE_fastStart; + +typedef struct Progress_UUIE { /* SEQUENCE */ + enum { + eProgress_UUIE_h245Address = (1 << 31), + eProgress_UUIE_h245SecurityMode = (1 << 30), + eProgress_UUIE_tokens = (1 << 29), + eProgress_UUIE_cryptoTokens = (1 << 28), + eProgress_UUIE_fastStart = (1 << 27), + eProgress_UUIE_multipleCalls = (1 << 26), + eProgress_UUIE_maintainConnection = (1 << 25), + eProgress_UUIE_fastConnectRefused = (1 << 24), + } options; + TransportAddress h245Address; + Progress_UUIE_fastStart fastStart; +} Progress_UUIE; + +typedef struct H323_UU_PDU_h323_message_body { /* CHOICE */ + enum { + eH323_UU_PDU_h323_message_body_setup, + eH323_UU_PDU_h323_message_body_callProceeding, + eH323_UU_PDU_h323_message_body_connect, + eH323_UU_PDU_h323_message_body_alerting, + eH323_UU_PDU_h323_message_body_information, + eH323_UU_PDU_h323_message_body_releaseComplete, + eH323_UU_PDU_h323_message_body_facility, + eH323_UU_PDU_h323_message_body_progress, + eH323_UU_PDU_h323_message_body_empty, + eH323_UU_PDU_h323_message_body_status, + eH323_UU_PDU_h323_message_body_statusInquiry, + eH323_UU_PDU_h323_message_body_setupAcknowledge, + eH323_UU_PDU_h323_message_body_notify, + } choice; + union { + Setup_UUIE setup; + CallProceeding_UUIE callProceeding; + Connect_UUIE connect; + Alerting_UUIE alerting; + Information_UUIE information; + Facility_UUIE facility; + Progress_UUIE progress; + }; +} H323_UU_PDU_h323_message_body; + +typedef struct RequestMessage { /* CHOICE */ + enum { + eRequestMessage_nonStandard, + eRequestMessage_masterSlaveDetermination, + eRequestMessage_terminalCapabilitySet, + eRequestMessage_openLogicalChannel, + eRequestMessage_closeLogicalChannel, + eRequestMessage_requestChannelClose, + eRequestMessage_multiplexEntrySend, + eRequestMessage_requestMultiplexEntry, + eRequestMessage_requestMode, + eRequestMessage_roundTripDelayRequest, + eRequestMessage_maintenanceLoopRequest, + eRequestMessage_communicationModeRequest, + eRequestMessage_conferenceRequest, + eRequestMessage_multilinkRequest, + eRequestMessage_logicalChannelRateRequest, + } choice; + union { + OpenLogicalChannel openLogicalChannel; + }; +} RequestMessage; + +typedef struct OpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters { /* CHOICE */ + enum { + eOpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters_h222LogicalChannelParameters, + eOpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters, + } choice; + union { + H2250LogicalChannelParameters h2250LogicalChannelParameters; + }; +} OpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters; + +typedef struct OpenLogicalChannelAck_reverseLogicalChannelParameters { /* SEQUENCE */ + enum { + eOpenLogicalChannelAck_reverseLogicalChannelParameters_portNumber + = (1 << 31), + eOpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters + = (1 << 30), + eOpenLogicalChannelAck_reverseLogicalChannelParameters_replacementFor + = (1 << 29), + } options; + OpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters + multiplexParameters; +} OpenLogicalChannelAck_reverseLogicalChannelParameters; + +typedef struct H2250LogicalChannelAckParameters { /* SEQUENCE */ + enum { + eH2250LogicalChannelAckParameters_nonStandard = (1 << 31), + eH2250LogicalChannelAckParameters_sessionID = (1 << 30), + eH2250LogicalChannelAckParameters_mediaChannel = (1 << 29), + eH2250LogicalChannelAckParameters_mediaControlChannel = + (1 << 28), + eH2250LogicalChannelAckParameters_dynamicRTPPayloadType = + (1 << 27), + eH2250LogicalChannelAckParameters_flowControlToZero = + (1 << 26), + eH2250LogicalChannelAckParameters_portNumber = (1 << 25), + } options; + H245_TransportAddress mediaChannel; + H245_TransportAddress mediaControlChannel; +} H2250LogicalChannelAckParameters; + +typedef struct OpenLogicalChannelAck_forwardMultiplexAckParameters { /* CHOICE */ + enum { + eOpenLogicalChannelAck_forwardMultiplexAckParameters_h2250LogicalChannelAckParameters, + } choice; + union { + H2250LogicalChannelAckParameters + h2250LogicalChannelAckParameters; + }; +} OpenLogicalChannelAck_forwardMultiplexAckParameters; + +typedef struct OpenLogicalChannelAck { /* SEQUENCE */ + enum { + eOpenLogicalChannelAck_reverseLogicalChannelParameters = + (1 << 31), + eOpenLogicalChannelAck_separateStack = (1 << 30), + eOpenLogicalChannelAck_forwardMultiplexAckParameters = + (1 << 29), + eOpenLogicalChannelAck_encryptionSync = (1 << 28), + } options; + OpenLogicalChannelAck_reverseLogicalChannelParameters + reverseLogicalChannelParameters; + OpenLogicalChannelAck_forwardMultiplexAckParameters + forwardMultiplexAckParameters; +} OpenLogicalChannelAck; + +typedef struct ResponseMessage { /* CHOICE */ + enum { + eResponseMessage_nonStandard, + eResponseMessage_masterSlaveDeterminationAck, + eResponseMessage_masterSlaveDeterminationReject, + eResponseMessage_terminalCapabilitySetAck, + eResponseMessage_terminalCapabilitySetReject, + eResponseMessage_openLogicalChannelAck, + eResponseMessage_openLogicalChannelReject, + eResponseMessage_closeLogicalChannelAck, + eResponseMessage_requestChannelCloseAck, + eResponseMessage_requestChannelCloseReject, + eResponseMessage_multiplexEntrySendAck, + eResponseMessage_multiplexEntrySendReject, + eResponseMessage_requestMultiplexEntryAck, + eResponseMessage_requestMultiplexEntryReject, + eResponseMessage_requestModeAck, + eResponseMessage_requestModeReject, + eResponseMessage_roundTripDelayResponse, + eResponseMessage_maintenanceLoopAck, + eResponseMessage_maintenanceLoopReject, + eResponseMessage_communicationModeResponse, + eResponseMessage_conferenceResponse, + eResponseMessage_multilinkResponse, + eResponseMessage_logicalChannelRateAcknowledge, + eResponseMessage_logicalChannelRateReject, + } choice; + union { + OpenLogicalChannelAck openLogicalChannelAck; + }; +} ResponseMessage; + +typedef struct MultimediaSystemControlMessage { /* CHOICE */ + enum { + eMultimediaSystemControlMessage_request, + eMultimediaSystemControlMessage_response, + eMultimediaSystemControlMessage_command, + eMultimediaSystemControlMessage_indication, + } choice; + union { + RequestMessage request; + ResponseMessage response; + }; +} MultimediaSystemControlMessage; + +typedef struct H323_UU_PDU_h245Control { /* SEQUENCE OF */ + int count; + MultimediaSystemControlMessage item[4]; +} H323_UU_PDU_h245Control; + +typedef struct H323_UU_PDU { /* SEQUENCE */ + enum { + eH323_UU_PDU_nonStandardData = (1 << 31), + eH323_UU_PDU_h4501SupplementaryService = (1 << 30), + eH323_UU_PDU_h245Tunneling = (1 << 29), + eH323_UU_PDU_h245Control = (1 << 28), + eH323_UU_PDU_nonStandardControl = (1 << 27), + eH323_UU_PDU_callLinkage = (1 << 26), + eH323_UU_PDU_tunnelledSignallingMessage = (1 << 25), + eH323_UU_PDU_provisionalRespToH245Tunneling = (1 << 24), + eH323_UU_PDU_stimulusControl = (1 << 23), + eH323_UU_PDU_genericData = (1 << 22), + } options; + H323_UU_PDU_h323_message_body h323_message_body; + H323_UU_PDU_h245Control h245Control; +} H323_UU_PDU; + +typedef struct H323_UserInformation { /* SEQUENCE */ + enum { + eH323_UserInformation_user_data = (1 << 31), + } options; + H323_UU_PDU h323_uu_pdu; +} H323_UserInformation; + +typedef struct GatekeeperRequest { /* SEQUENCE */ + enum { + eGatekeeperRequest_nonStandardData = (1 << 31), + eGatekeeperRequest_gatekeeperIdentifier = (1 << 30), + eGatekeeperRequest_callServices = (1 << 29), + eGatekeeperRequest_endpointAlias = (1 << 28), + eGatekeeperRequest_alternateEndpoints = (1 << 27), + eGatekeeperRequest_tokens = (1 << 26), + eGatekeeperRequest_cryptoTokens = (1 << 25), + eGatekeeperRequest_authenticationCapability = (1 << 24), + eGatekeeperRequest_algorithmOIDs = (1 << 23), + eGatekeeperRequest_integrity = (1 << 22), + eGatekeeperRequest_integrityCheckValue = (1 << 21), + eGatekeeperRequest_supportsAltGK = (1 << 20), + eGatekeeperRequest_featureSet = (1 << 19), + eGatekeeperRequest_genericData = (1 << 18), + } options; + TransportAddress rasAddress; +} GatekeeperRequest; + +typedef struct GatekeeperConfirm { /* SEQUENCE */ + enum { + eGatekeeperConfirm_nonStandardData = (1 << 31), + eGatekeeperConfirm_gatekeeperIdentifier = (1 << 30), + eGatekeeperConfirm_alternateGatekeeper = (1 << 29), + eGatekeeperConfirm_authenticationMode = (1 << 28), + eGatekeeperConfirm_tokens = (1 << 27), + eGatekeeperConfirm_cryptoTokens = (1 << 26), + eGatekeeperConfirm_algorithmOID = (1 << 25), + eGatekeeperConfirm_integrity = (1 << 24), + eGatekeeperConfirm_integrityCheckValue = (1 << 23), + eGatekeeperConfirm_featureSet = (1 << 22), + eGatekeeperConfirm_genericData = (1 << 21), + } options; + TransportAddress rasAddress; +} GatekeeperConfirm; + +typedef struct RegistrationRequest_callSignalAddress { /* SEQUENCE OF */ + int count; + TransportAddress item[10]; +} RegistrationRequest_callSignalAddress; + +typedef struct RegistrationRequest_rasAddress { /* SEQUENCE OF */ + int count; + TransportAddress item[10]; +} RegistrationRequest_rasAddress; + +typedef struct RegistrationRequest { /* SEQUENCE */ + enum { + eRegistrationRequest_nonStandardData = (1 << 31), + eRegistrationRequest_terminalAlias = (1 << 30), + eRegistrationRequest_gatekeeperIdentifier = (1 << 29), + eRegistrationRequest_alternateEndpoints = (1 << 28), + eRegistrationRequest_timeToLive = (1 << 27), + eRegistrationRequest_tokens = (1 << 26), + eRegistrationRequest_cryptoTokens = (1 << 25), + eRegistrationRequest_integrityCheckValue = (1 << 24), + eRegistrationRequest_keepAlive = (1 << 23), + eRegistrationRequest_endpointIdentifier = (1 << 22), + eRegistrationRequest_willSupplyUUIEs = (1 << 21), + eRegistrationRequest_maintainConnection = (1 << 20), + eRegistrationRequest_alternateTransportAddresses = (1 << 19), + eRegistrationRequest_additiveRegistration = (1 << 18), + eRegistrationRequest_terminalAliasPattern = (1 << 17), + eRegistrationRequest_supportsAltGK = (1 << 16), + eRegistrationRequest_usageReportingCapability = (1 << 15), + eRegistrationRequest_multipleCalls = (1 << 14), + eRegistrationRequest_supportedH248Packages = (1 << 13), + eRegistrationRequest_callCreditCapability = (1 << 12), + eRegistrationRequest_capacityReportingCapability = (1 << 11), + eRegistrationRequest_capacity = (1 << 10), + eRegistrationRequest_featureSet = (1 << 9), + eRegistrationRequest_genericData = (1 << 8), + } options; + RegistrationRequest_callSignalAddress callSignalAddress; + RegistrationRequest_rasAddress rasAddress; + unsigned timeToLive; +} RegistrationRequest; + +typedef struct RegistrationConfirm_callSignalAddress { /* SEQUENCE OF */ + int count; + TransportAddress item[10]; +} RegistrationConfirm_callSignalAddress; + +typedef struct RegistrationConfirm { /* SEQUENCE */ + enum { + eRegistrationConfirm_nonStandardData = (1 << 31), + eRegistrationConfirm_terminalAlias = (1 << 30), + eRegistrationConfirm_gatekeeperIdentifier = (1 << 29), + eRegistrationConfirm_alternateGatekeeper = (1 << 28), + eRegistrationConfirm_timeToLive = (1 << 27), + eRegistrationConfirm_tokens = (1 << 26), + eRegistrationConfirm_cryptoTokens = (1 << 25), + eRegistrationConfirm_integrityCheckValue = (1 << 24), + eRegistrationConfirm_willRespondToIRR = (1 << 23), + eRegistrationConfirm_preGrantedARQ = (1 << 22), + eRegistrationConfirm_maintainConnection = (1 << 21), + eRegistrationConfirm_serviceControl = (1 << 20), + eRegistrationConfirm_supportsAdditiveRegistration = (1 << 19), + eRegistrationConfirm_terminalAliasPattern = (1 << 18), + eRegistrationConfirm_supportedPrefixes = (1 << 17), + eRegistrationConfirm_usageSpec = (1 << 16), + eRegistrationConfirm_featureServerAlias = (1 << 15), + eRegistrationConfirm_capacityReportingSpec = (1 << 14), + eRegistrationConfirm_featureSet = (1 << 13), + eRegistrationConfirm_genericData = (1 << 12), + } options; + RegistrationConfirm_callSignalAddress callSignalAddress; + unsigned timeToLive; +} RegistrationConfirm; + +typedef struct UnregistrationRequest_callSignalAddress { /* SEQUENCE OF */ + int count; + TransportAddress item[10]; +} UnregistrationRequest_callSignalAddress; + +typedef struct UnregistrationRequest { /* SEQUENCE */ + enum { + eUnregistrationRequest_endpointAlias = (1 << 31), + eUnregistrationRequest_nonStandardData = (1 << 30), + eUnregistrationRequest_endpointIdentifier = (1 << 29), + eUnregistrationRequest_alternateEndpoints = (1 << 28), + eUnregistrationRequest_gatekeeperIdentifier = (1 << 27), + eUnregistrationRequest_tokens = (1 << 26), + eUnregistrationRequest_cryptoTokens = (1 << 25), + eUnregistrationRequest_integrityCheckValue = (1 << 24), + eUnregistrationRequest_reason = (1 << 23), + eUnregistrationRequest_endpointAliasPattern = (1 << 22), + eUnregistrationRequest_supportedPrefixes = (1 << 21), + eUnregistrationRequest_alternateGatekeeper = (1 << 20), + eUnregistrationRequest_genericData = (1 << 19), + } options; + UnregistrationRequest_callSignalAddress callSignalAddress; +} UnregistrationRequest; + +typedef struct AdmissionRequest { /* SEQUENCE */ + enum { + eAdmissionRequest_callModel = (1 << 31), + eAdmissionRequest_destinationInfo = (1 << 30), + eAdmissionRequest_destCallSignalAddress = (1 << 29), + eAdmissionRequest_destExtraCallInfo = (1 << 28), + eAdmissionRequest_srcCallSignalAddress = (1 << 27), + eAdmissionRequest_nonStandardData = (1 << 26), + eAdmissionRequest_callServices = (1 << 25), + eAdmissionRequest_canMapAlias = (1 << 24), + eAdmissionRequest_callIdentifier = (1 << 23), + eAdmissionRequest_srcAlternatives = (1 << 22), + eAdmissionRequest_destAlternatives = (1 << 21), + eAdmissionRequest_gatekeeperIdentifier = (1 << 20), + eAdmissionRequest_tokens = (1 << 19), + eAdmissionRequest_cryptoTokens = (1 << 18), + eAdmissionRequest_integrityCheckValue = (1 << 17), + eAdmissionRequest_transportQOS = (1 << 16), + eAdmissionRequest_willSupplyUUIEs = (1 << 15), + eAdmissionRequest_callLinkage = (1 << 14), + eAdmissionRequest_gatewayDataRate = (1 << 13), + eAdmissionRequest_capacity = (1 << 12), + eAdmissionRequest_circuitInfo = (1 << 11), + eAdmissionRequest_desiredProtocols = (1 << 10), + eAdmissionRequest_desiredTunnelledProtocol = (1 << 9), + eAdmissionRequest_featureSet = (1 << 8), + eAdmissionRequest_genericData = (1 << 7), + } options; + TransportAddress destCallSignalAddress; + TransportAddress srcCallSignalAddress; +} AdmissionRequest; + +typedef struct AdmissionConfirm { /* SEQUENCE */ + enum { + eAdmissionConfirm_irrFrequency = (1 << 31), + eAdmissionConfirm_nonStandardData = (1 << 30), + eAdmissionConfirm_destinationInfo = (1 << 29), + eAdmissionConfirm_destExtraCallInfo = (1 << 28), + eAdmissionConfirm_destinationType = (1 << 27), + eAdmissionConfirm_remoteExtensionAddress = (1 << 26), + eAdmissionConfirm_alternateEndpoints = (1 << 25), + eAdmissionConfirm_tokens = (1 << 24), + eAdmissionConfirm_cryptoTokens = (1 << 23), + eAdmissionConfirm_integrityCheckValue = (1 << 22), + eAdmissionConfirm_transportQOS = (1 << 21), + eAdmissionConfirm_willRespondToIRR = (1 << 20), + eAdmissionConfirm_uuiesRequested = (1 << 19), + eAdmissionConfirm_language = (1 << 18), + eAdmissionConfirm_alternateTransportAddresses = (1 << 17), + eAdmissionConfirm_useSpecifiedTransport = (1 << 16), + eAdmissionConfirm_circuitInfo = (1 << 15), + eAdmissionConfirm_usageSpec = (1 << 14), + eAdmissionConfirm_supportedProtocols = (1 << 13), + eAdmissionConfirm_serviceControl = (1 << 12), + eAdmissionConfirm_multipleCalls = (1 << 11), + eAdmissionConfirm_featureSet = (1 << 10), + eAdmissionConfirm_genericData = (1 << 9), + } options; + TransportAddress destCallSignalAddress; +} AdmissionConfirm; + +typedef struct LocationRequest { /* SEQUENCE */ + enum { + eLocationRequest_endpointIdentifier = (1 << 31), + eLocationRequest_nonStandardData = (1 << 30), + eLocationRequest_sourceInfo = (1 << 29), + eLocationRequest_canMapAlias = (1 << 28), + eLocationRequest_gatekeeperIdentifier = (1 << 27), + eLocationRequest_tokens = (1 << 26), + eLocationRequest_cryptoTokens = (1 << 25), + eLocationRequest_integrityCheckValue = (1 << 24), + eLocationRequest_desiredProtocols = (1 << 23), + eLocationRequest_desiredTunnelledProtocol = (1 << 22), + eLocationRequest_featureSet = (1 << 21), + eLocationRequest_genericData = (1 << 20), + eLocationRequest_hopCount = (1 << 19), + eLocationRequest_circuitInfo = (1 << 18), + } options; + TransportAddress replyAddress; +} LocationRequest; + +typedef struct LocationConfirm { /* SEQUENCE */ + enum { + eLocationConfirm_nonStandardData = (1 << 31), + eLocationConfirm_destinationInfo = (1 << 30), + eLocationConfirm_destExtraCallInfo = (1 << 29), + eLocationConfirm_destinationType = (1 << 28), + eLocationConfirm_remoteExtensionAddress = (1 << 27), + eLocationConfirm_alternateEndpoints = (1 << 26), + eLocationConfirm_tokens = (1 << 25), + eLocationConfirm_cryptoTokens = (1 << 24), + eLocationConfirm_integrityCheckValue = (1 << 23), + eLocationConfirm_alternateTransportAddresses = (1 << 22), + eLocationConfirm_supportedProtocols = (1 << 21), + eLocationConfirm_multipleCalls = (1 << 20), + eLocationConfirm_featureSet = (1 << 19), + eLocationConfirm_genericData = (1 << 18), + eLocationConfirm_circuitInfo = (1 << 17), + eLocationConfirm_serviceControl = (1 << 16), + } options; + TransportAddress callSignalAddress; + TransportAddress rasAddress; +} LocationConfirm; + +typedef struct InfoRequestResponse_callSignalAddress { /* SEQUENCE OF */ + int count; + TransportAddress item[10]; +} InfoRequestResponse_callSignalAddress; + +typedef struct InfoRequestResponse { /* SEQUENCE */ + enum { + eInfoRequestResponse_nonStandardData = (1 << 31), + eInfoRequestResponse_endpointAlias = (1 << 30), + eInfoRequestResponse_perCallInfo = (1 << 29), + eInfoRequestResponse_tokens = (1 << 28), + eInfoRequestResponse_cryptoTokens = (1 << 27), + eInfoRequestResponse_integrityCheckValue = (1 << 26), + eInfoRequestResponse_needResponse = (1 << 25), + eInfoRequestResponse_capacity = (1 << 24), + eInfoRequestResponse_irrStatus = (1 << 23), + eInfoRequestResponse_unsolicited = (1 << 22), + eInfoRequestResponse_genericData = (1 << 21), + } options; + TransportAddress rasAddress; + InfoRequestResponse_callSignalAddress callSignalAddress; +} InfoRequestResponse; + +typedef struct RasMessage { /* CHOICE */ + enum { + eRasMessage_gatekeeperRequest, + eRasMessage_gatekeeperConfirm, + eRasMessage_gatekeeperReject, + eRasMessage_registrationRequest, + eRasMessage_registrationConfirm, + eRasMessage_registrationReject, + eRasMessage_unregistrationRequest, + eRasMessage_unregistrationConfirm, + eRasMessage_unregistrationReject, + eRasMessage_admissionRequest, + eRasMessage_admissionConfirm, + eRasMessage_admissionReject, + eRasMessage_bandwidthRequest, + eRasMessage_bandwidthConfirm, + eRasMessage_bandwidthReject, + eRasMessage_disengageRequest, + eRasMessage_disengageConfirm, + eRasMessage_disengageReject, + eRasMessage_locationRequest, + eRasMessage_locationConfirm, + eRasMessage_locationReject, + eRasMessage_infoRequest, + eRasMessage_infoRequestResponse, + eRasMessage_nonStandardMessage, + eRasMessage_unknownMessageResponse, + eRasMessage_requestInProgress, + eRasMessage_resourcesAvailableIndicate, + eRasMessage_resourcesAvailableConfirm, + eRasMessage_infoRequestAck, + eRasMessage_infoRequestNak, + eRasMessage_serviceControlIndication, + eRasMessage_serviceControlResponse, + } choice; + union { + GatekeeperRequest gatekeeperRequest; + GatekeeperConfirm gatekeeperConfirm; + RegistrationRequest registrationRequest; + RegistrationConfirm registrationConfirm; + UnregistrationRequest unregistrationRequest; + AdmissionRequest admissionRequest; + AdmissionConfirm admissionConfirm; + LocationRequest locationRequest; + LocationConfirm locationConfirm; + InfoRequestResponse infoRequestResponse; + }; +} RasMessage; diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index d5b8c0d6a12..c0dac16e190 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h @@ -316,5 +316,23 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb, void *userdata); #define IPT_ALIGN(s) XT_ALIGN(s) + +#ifdef CONFIG_COMPAT +#include <net/compat.h> + +struct compat_ipt_entry +{ + struct ipt_ip ip; + compat_uint_t nfcache; + u_int16_t target_offset; + u_int16_t next_offset; + compat_uint_t comefrom; + struct compat_xt_counters counters; + unsigned char elems[0]; +}; + +#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) + +#endif /* CONFIG_COMPAT */ #endif /*__KERNEL__*/ #endif /* _IPTABLES_H */ diff --git a/include/linux/netfilter_ipv4/ipt_esp.h b/include/linux/netfilter_ipv4/ipt_esp.h index c782a83e53e..78296e7eeff 100644 --- a/include/linux/netfilter_ipv4/ipt_esp.h +++ b/include/linux/netfilter_ipv4/ipt_esp.h @@ -1,16 +1,10 @@ #ifndef _IPT_ESP_H #define _IPT_ESP_H -struct ipt_esp -{ - u_int32_t spis[2]; /* Security Parameter Index */ - u_int8_t invflags; /* Inverse flags */ -}; +#include <linux/netfilter/xt_esp.h> - - -/* Values for "invflags" field in struct ipt_esp. */ -#define IPT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ -#define IPT_ESP_INV_MASK 0x01 /* All possible flags. */ +#define ipt_esp xt_esp +#define IPT_ESP_INV_SPI XT_ESP_INV_SPI +#define IPT_ESP_INV_MASK XT_ESP_INV_MASK #endif /*_IPT_ESP_H*/ diff --git a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h index e6b6fff811d..55fe85eca88 100644 --- a/include/linux/netfilter_ipv4/ipt_multiport.h +++ b/include/linux/netfilter_ipv4/ipt_multiport.h @@ -1,30 +1,15 @@ #ifndef _IPT_MULTIPORT_H #define _IPT_MULTIPORT_H -#include <linux/netfilter_ipv4/ip_tables.h> -enum ipt_multiport_flags -{ - IPT_MULTIPORT_SOURCE, - IPT_MULTIPORT_DESTINATION, - IPT_MULTIPORT_EITHER -}; +#include <linux/netfilter/xt_multiport.h> -#define IPT_MULTI_PORTS 15 +#define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE +#define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION +#define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER -/* Must fit inside union ipt_matchinfo: 16 bytes */ -struct ipt_multiport -{ - u_int8_t flags; /* Type of comparison */ - u_int8_t count; /* Number of ports */ - u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */ -}; +#define IPT_MULTI_PORTS XT_MULTI_PORTS + +#define ipt_multiport xt_multiport +#define ipt_multiport_v1 xt_multiport_v1 -struct ipt_multiport_v1 -{ - u_int8_t flags; /* Type of comparison */ - u_int8_t count; /* Number of ports */ - u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */ - u_int8_t pflags[IPT_MULTI_PORTS]; /* Port flags */ - u_int8_t invert; /* Invert flag */ -}; #endif /*_IPT_MULTIPORT_H*/ diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 14f2bd01088..52a7b9e7642 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h @@ -73,6 +73,9 @@ enum nf_ip6_hook_priorities { }; #ifdef CONFIG_NETFILTER +extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, + unsigned int dataoff, u_int8_t protocol); + extern int ipv6_netfilter_init(void); extern void ipv6_netfilter_fini(void); #else /* CONFIG_NETFILTER */ diff --git a/include/linux/netfilter_ipv6/ip6t_esp.h b/include/linux/netfilter_ipv6/ip6t_esp.h index a91b6abc807..f62eaf53c16 100644 --- a/include/linux/netfilter_ipv6/ip6t_esp.h +++ b/include/linux/netfilter_ipv6/ip6t_esp.h @@ -1,14 +1,10 @@ #ifndef _IP6T_ESP_H #define _IP6T_ESP_H -struct ip6t_esp -{ - u_int32_t spis[2]; /* Security Parameter Index */ - u_int8_t invflags; /* Inverse flags */ -}; +#include <linux/netfilter/xt_esp.h> -/* Values for "invflags" field in struct ip6t_esp. */ -#define IP6T_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ -#define IP6T_ESP_INV_MASK 0x01 /* All possible flags. */ +#define ip6t_esp xt_esp +#define IP6T_ESP_INV_SPI XT_ESP_INV_SPI +#define IP6T_ESP_INV_MASK XT_ESP_INV_MASK #endif /*_IP6T_ESP_H*/ diff --git a/include/linux/netfilter_ipv6/ip6t_multiport.h b/include/linux/netfilter_ipv6/ip6t_multiport.h index efe4954a868..042c92661ce 100644 --- a/include/linux/netfilter_ipv6/ip6t_multiport.h +++ b/include/linux/netfilter_ipv6/ip6t_multiport.h @@ -1,21 +1,14 @@ #ifndef _IP6T_MULTIPORT_H #define _IP6T_MULTIPORT_H -#include <linux/netfilter_ipv6/ip6_tables.h> -enum ip6t_multiport_flags -{ - IP6T_MULTIPORT_SOURCE, - IP6T_MULTIPORT_DESTINATION, - IP6T_MULTIPORT_EITHER -}; +#include <linux/netfilter/xt_multiport.h> -#define IP6T_MULTI_PORTS 15 +#define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE +#define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION +#define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER -/* Must fit inside union ip6t_matchinfo: 16 bytes */ -struct ip6t_multiport -{ - u_int8_t flags; /* Type of comparison */ - u_int8_t count; /* Number of ports */ - u_int16_t ports[IP6T_MULTI_PORTS]; /* Ports */ -}; -#endif /*_IPT_MULTIPORT_H*/ +#define IP6T_MULTI_PORTS XT_MULTI_PORTS + +#define ip6t_multiport xt_multiport + +#endif /*_IP6T_MULTIPORT_H*/ diff --git a/include/linux/numa.h b/include/linux/numa.h index f0c539bd3cf..e481feb1bfd 100644 --- a/include/linux/numa.h +++ b/include/linux/numa.h @@ -3,11 +3,9 @@ #include <linux/config.h> -#ifndef CONFIG_FLATMEM -#include <asm/numnodes.h> -#endif - -#ifndef NODES_SHIFT +#ifdef CONFIG_NODES_SHIFT +#define NODES_SHIFT CONFIG_NODES_SHIFT +#else #define NODES_SHIFT 0 #endif diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 9ea629c02a4..d276a4e2f82 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -48,8 +48,20 @@ /* * Don't use the *_dontuse flags. Use the macros. Otherwise you'll break - * locked- and dirty-page accounting. The top eight bits of page->flags are - * used for page->zone, so putting flag bits there doesn't work. + * locked- and dirty-page accounting. + * + * The page flags field is split into two parts, the main flags area + * which extends from the low bits upwards, and the fields area which + * extends from the high bits downwards. + * + * | FIELD | ... | FLAGS | + * N-1 ^ 0 + * (N-FLAGS_RESERVED) + * + * The fields area is reserved for fields mapping zone, node and SPARSEMEM + * section. The boundry between these two areas is defined by + * FLAGS_RESERVED which defines the width of the fields section + * (see linux/mmzone.h). New flags must _not_ overlap with this area. */ #define PG_locked 0 /* Page is locked. Don't touch. */ #define PG_error 1 @@ -74,7 +86,9 @@ #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ #define PG_reclaim 17 /* To be reclaimed asap */ #define PG_nosave_free 18 /* Free, should not be written */ -#define PG_uncached 19 /* Page has been mapped as uncached */ +#define PG_buddy 19 /* Page is free, on buddy lists */ + +#define PG_uncached 20 /* Page has been mapped as uncached */ /* * Global page accounting. One instance per CPU. Only unsigned longs are @@ -317,6 +331,10 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); #define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags) #define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags) +#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) +#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) +#define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) + #define PageMappedToDisk(page) test_bit(PG_mappedtodisk, &(page)->flags) #define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) #define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 839f0b3c23a..9539efd4f7e 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -72,8 +72,8 @@ extern struct page * find_get_page(struct address_space *mapping, unsigned long index); extern struct page * find_lock_page(struct address_space *mapping, unsigned long index); -extern struct page * find_trylock_page(struct address_space *mapping, - unsigned long index); +extern __deprecated_for_modules struct page * find_trylock_page( + struct address_space *mapping, unsigned long index); extern struct page * find_or_create_page(struct address_space *mapping, unsigned long index, gfp_t gfp_mask); unsigned find_get_pages(struct address_space *mapping, pgoff_t start, diff --git a/include/linux/pci.h b/include/linux/pci.h index 0aad5a378e9..3a6a4e37a48 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -97,7 +97,13 @@ enum pci_channel_state { typedef unsigned short __bitwise pci_bus_flags_t; enum pci_bus_flags { - PCI_BUS_FLAGS_NO_MSI = (pci_bus_flags_t) 1, + PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, +}; + +struct pci_cap_saved_state { + struct hlist_node next; + char cap_nr; + u32 data[0]; }; /* @@ -159,6 +165,7 @@ struct pci_dev { unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ u32 saved_config_space[16]; /* config space saved at suspend time */ + struct hlist_head saved_cap_space; struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ int rom_attr_enabled; /* has display of the rom attribute been enabled? */ struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ @@ -169,6 +176,30 @@ struct pci_dev { #define to_pci_dev(n) container_of(n, struct pci_dev, dev) #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) +static inline struct pci_cap_saved_state *pci_find_saved_cap( + struct pci_dev *pci_dev,char cap) +{ + struct pci_cap_saved_state *tmp; + struct hlist_node *pos; + + hlist_for_each_entry(tmp, pos, &pci_dev->saved_cap_space, next) { + if (tmp->cap_nr == cap) + return tmp; + } + return NULL; +} + +static inline void pci_add_saved_cap(struct pci_dev *pci_dev, + struct pci_cap_saved_state *new_cap) +{ + hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); +} + +static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap) +{ + hlist_del(&cap->next); +} + /* * For PCI devices, the region numbers are assigned this way: * diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index e2ab2ac18d6..8d03e10212f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -497,7 +497,8 @@ #define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d #define PCI_DEVICE_ID_AMD_8151_0 0x7454 -#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 +#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 +#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 @@ -773,6 +774,7 @@ #define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803 #define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b #define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803 +#define PCI_DEVICE_ID_MOTOROLA_MPC5200B 0x5809 #define PCI_VENDOR_ID_PROMISE 0x105a #define PCI_DEVICE_ID_PROMISE_20265 0x0d30 diff --git a/include/linux/pid.h b/include/linux/pid.h index 5b9082cc600..29960b03bef 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -1,6 +1,8 @@ #ifndef _LINUX_PID_H #define _LINUX_PID_H +#include <linux/rcupdate.h> + enum pid_type { PIDTYPE_PID, @@ -9,45 +11,109 @@ enum pid_type PIDTYPE_MAX }; +/* + * What is struct pid? + * + * A struct pid is the kernel's internal notion of a process identifier. + * It refers to individual tasks, process groups, and sessions. While + * there are processes attached to it the struct pid lives in a hash + * table, so it and then the processes that it refers to can be found + * quickly from the numeric pid value. The attached processes may be + * quickly accessed by following pointers from struct pid. + * + * Storing pid_t values in the kernel and refering to them later has a + * problem. The process originally with that pid may have exited and the + * pid allocator wrapped, and another process could have come along + * and been assigned that pid. + * + * Referring to user space processes by holding a reference to struct + * task_struct has a problem. When the user space process exits + * the now useless task_struct is still kept. A task_struct plus a + * stack consumes around 10K of low kernel memory. More precisely + * this is THREAD_SIZE + sizeof(struct task_struct). By comparison + * a struct pid is about 64 bytes. + * + * Holding a reference to struct pid solves both of these problems. + * It is small so holding a reference does not consume a lot of + * resources, and since a new struct pid is allocated when the numeric + * pid value is reused we don't mistakenly refer to new processes. + */ + struct pid { + atomic_t count; /* Try to keep pid_chain in the same cacheline as nr for find_pid */ int nr; struct hlist_node pid_chain; - /* list of pids with the same nr, only one of them is in the hash */ - struct list_head pid_list; + /* lists of tasks that use this pid */ + struct hlist_head tasks[PIDTYPE_MAX]; + struct rcu_head rcu; }; -#define pid_task(elem, type) \ - list_entry(elem, struct task_struct, pids[type].pid_list) +struct pid_link +{ + struct hlist_node node; + struct pid *pid; +}; + +static inline struct pid *get_pid(struct pid *pid) +{ + if (pid) + atomic_inc(&pid->count); + return pid; +} + +extern void FASTCALL(put_pid(struct pid *pid)); +extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type)); +extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, + enum pid_type)); /* * attach_pid() and detach_pid() must be called with the tasklist_lock * write-held. */ -extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr)); +extern int FASTCALL(attach_pid(struct task_struct *task, + enum pid_type type, int nr)); extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); /* * look up a PID in the hash table. Must be called with the tasklist_lock - * held. + * or rcu_read_lock() held. + */ +extern struct pid *FASTCALL(find_pid(int nr)); + +/* + * Lookup a PID in the hash table, and return with it's count elevated. */ -extern struct pid *FASTCALL(find_pid(enum pid_type, int)); +extern struct pid *find_get_pid(int nr); -extern int alloc_pidmap(void); -extern void FASTCALL(free_pidmap(int)); +extern struct pid *alloc_pid(void); +extern void FASTCALL(free_pid(struct pid *pid)); +#define pid_next(task, type) \ + ((task)->pids[(type)].node.next) + +#define pid_next_task(task, type) \ + hlist_entry(pid_next(task, type), struct task_struct, \ + pids[(type)].node) + + +/* We could use hlist_for_each_entry_rcu here but it takes more arguments + * than the do_each_task_pid/while_each_task_pid. So we roll our own + * to preserve the existing interface. + */ #define do_each_task_pid(who, type, task) \ if ((task = find_task_by_pid_type(type, who))) { \ - prefetch((task)->pids[type].pid_list.next); \ + prefetch(pid_next(task, type)); \ do { #define while_each_task_pid(who, type, task) \ - } while (task = pid_task((task)->pids[type].pid_list.next,\ - type), \ - prefetch((task)->pids[type].pid_list.next), \ - hlist_unhashed(&(task)->pids[type].pid_chain)); \ - } \ + } while (pid_next(task, type) && ({ \ + task = pid_next_task(task, type); \ + rcu_dereference(task); \ + prefetch(pid_next(task, type)); \ + 1; }) ); \ + } #endif /* _LINUX_PID_H */ diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index b12e59c7575..ef7f33c0be1 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -5,10 +5,14 @@ #define PIPE_BUFFERS (16) +#define PIPE_BUF_FLAG_STOLEN 0x01 +#define PIPE_BUF_FLAG_LRU 0x02 + struct pipe_buffer { struct page *page; unsigned int offset, len; struct pipe_buf_operations *ops; + unsigned int flags; }; struct pipe_buf_operations { @@ -16,6 +20,8 @@ struct pipe_buf_operations { void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); void (*release)(struct pipe_inode_info *, struct pipe_buffer *); + int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); + void (*get)(struct pipe_inode_info *, struct pipe_buffer *); }; struct pipe_inode_info { @@ -31,26 +37,28 @@ struct pipe_inode_info { unsigned int w_counter; struct fasync_struct *fasync_readers; struct fasync_struct *fasync_writers; + struct inode *inode; }; /* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual memory allocation, whereas PIPE_BUF makes atomicity guarantees. */ #define PIPE_SIZE PAGE_SIZE -#define PIPE_MUTEX(inode) (&(inode).i_mutex) -#define PIPE_WAIT(inode) (&(inode).i_pipe->wait) -#define PIPE_READERS(inode) ((inode).i_pipe->readers) -#define PIPE_WRITERS(inode) ((inode).i_pipe->writers) -#define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers) -#define PIPE_RCOUNTER(inode) ((inode).i_pipe->r_counter) -#define PIPE_WCOUNTER(inode) ((inode).i_pipe->w_counter) -#define PIPE_FASYNC_READERS(inode) (&((inode).i_pipe->fasync_readers)) -#define PIPE_FASYNC_WRITERS(inode) (&((inode).i_pipe->fasync_writers)) - /* Drop the inode semaphore and wait for a pipe event, atomically */ -void pipe_wait(struct inode * inode); +void pipe_wait(struct pipe_inode_info *pipe); + +struct pipe_inode_info * alloc_pipe_info(struct inode * inode); +void free_pipe_info(struct inode * inode); +void __free_pipe_info(struct pipe_inode_info *); -struct inode* pipe_new(struct inode* inode); -void free_pipe_info(struct inode* inode); +/* + * splice is tied to pipes as a transport (at least for now), so we'll just + * add the splice flags here. + */ +#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ +#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ + /* we may still block on the fd we splice */ + /* from/to, of course */ +#define SPLICE_F_MORE (0x04) /* expect more data */ #endif diff --git a/include/linux/pm.h b/include/linux/pm.h index 6df2585c016..66be58902b1 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -199,6 +199,12 @@ extern int device_suspend(pm_message_t state); extern int dpm_runtime_suspend(struct device *, pm_message_t); extern void dpm_runtime_resume(struct device *); +extern void __suspend_report_result(const char *function, void *fn, int ret); + +#define suspend_report_result(fn, ret) \ + do { \ + __suspend_report_result(__FUNCTION__, fn, ret); \ + } while (0) #else /* !CONFIG_PM */ @@ -219,6 +225,8 @@ static inline void dpm_runtime_resume(struct device * dev) { } +#define suspend_report_result(fn, ret) do { } while (0) + #endif /* changes to device_may_wakeup take effect on the next pm state change. diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h index 1252b45face..008932d73c3 100644 --- a/include/linux/pm_legacy.h +++ b/include/linux/pm_legacy.h @@ -16,11 +16,6 @@ struct pm_dev __deprecated * pm_register(pm_dev_t type, unsigned long id, pm_callback callback); /* - * Unregister a device with power management - */ -void __deprecated pm_unregister(struct pm_dev *dev); - -/* * Unregister all devices with matching callback */ void __deprecated pm_unregister_all(pm_callback callback); @@ -41,8 +36,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type, return NULL; } -static inline void pm_unregister(struct pm_dev *dev) {} - static inline void pm_unregister_all(pm_callback callback) {} static inline int pm_send_all(pm_request_t rqst, void *data) diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 135871df991..4b47a025342 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -79,7 +79,7 @@ struct kcore_list { struct vmcore { struct list_head list; unsigned long long paddr; - unsigned long size; + unsigned long long size; loff_t offset; }; diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 774e1acfb8c..f1fbae7e390 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h @@ -227,8 +227,8 @@ struct mdp_superblock_1 { */ /* These are only valid with feature bit '4' */ - __u64 reshape_position; /* next address in array-space for reshape */ __u32 new_level; /* new level we are reshaping to */ + __u64 reshape_position; /* next address in array-space for reshape */ __u32 delta_disks; /* change in number of raid_disks */ __u32 new_layout; /* new layout */ __u32 new_chunk; /* new chunk size (bytes) */ diff --git a/include/linux/sched.h b/include/linux/sched.h index d04186d8cc6..b7d31e2e172 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -100,6 +100,7 @@ DECLARE_PER_CPU(unsigned long, process_counts); extern int nr_processes(void); extern unsigned long nr_running(void); extern unsigned long nr_uninterruptible(void); +extern unsigned long nr_active(void); extern unsigned long nr_iowait(void); #include <linux/time.h> @@ -483,6 +484,7 @@ struct signal_struct { #define MAX_PRIO (MAX_RT_PRIO + 40) #define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO)) +#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) /* * Some day this will be a full-fledged user tracking system.. @@ -682,6 +684,14 @@ static inline void prefetch_stack(struct task_struct *t) { } struct audit_context; /* See audit.c */ struct mempolicy; +struct pipe_inode_info; + +enum sleep_type { + SLEEP_NORMAL, + SLEEP_NONINTERACTIVE, + SLEEP_INTERACTIVE, + SLEEP_INTERRUPTED, +}; struct task_struct { volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ @@ -705,7 +715,7 @@ struct task_struct { unsigned long sleep_avg; unsigned long long timestamp, last_ran; unsigned long long sched_time; /* sched_clock time spent running */ - int activated; + enum sleep_type sleep_type; unsigned long policy; cpumask_t cpus_allowed; @@ -751,7 +761,7 @@ struct task_struct { struct task_struct *group_leader; /* threadgroup leader */ /* PID/PID hash table linkage. */ - struct pid pids[PIDTYPE_MAX]; + struct pid_link pids[PIDTYPE_MAX]; struct list_head thread_group; struct completion *vfork_done; /* for vfork() */ @@ -873,6 +883,11 @@ struct task_struct { atomic_t fs_excl; /* holding fs exclusive resources */ struct rcu_head rcu; + + /* + * cache last used pipe for splice + */ + struct pipe_inode_info *splice_pipe; }; static inline pid_t process_group(struct task_struct *tsk) @@ -890,18 +905,18 @@ static inline pid_t process_group(struct task_struct *tsk) */ static inline int pid_alive(struct task_struct *p) { - return p->pids[PIDTYPE_PID].nr != 0; + return p->pids[PIDTYPE_PID].pid != NULL; } extern void free_task(struct task_struct *tsk); #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) -extern void __put_task_struct_cb(struct rcu_head *rhp); +extern void __put_task_struct(struct task_struct *t); static inline void put_task_struct(struct task_struct *t) { if (atomic_dec_and_test(&t->usage)) - call_rcu(&t->rcu, __put_task_struct_cb); + __put_task_struct(t); } /* @@ -1193,9 +1208,10 @@ extern void wait_task_inactive(task_t * p); #define while_each_thread(g, t) \ while ((t = next_thread(t)) != g) -#define thread_group_leader(p) (p->pid == p->tgid) +/* de_thread depends on thread_group_leader not being a pid based check */ +#define thread_group_leader(p) (p == p->group_leader) -static inline task_t *next_thread(task_t *p) +static inline task_t *next_thread(const task_t *p) { return list_entry(rcu_dereference(p->thread_group.next), task_t, thread_group); diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index 6336987dae6..2925e66a673 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h @@ -41,7 +41,8 @@ struct screen_info { u16 vesapm_off; /* 0x30 */ u16 pages; /* 0x32 */ u16 vesa_attributes; /* 0x34 */ - /* 0x36 -- 0x3f reserved for future expansion */ + u32 capabilities; /* 0x36 */ + /* 0x3a -- 0x3f reserved for future expansion */ }; extern struct screen_info screen_info; diff --git a/include/linux/sdla_asy.h b/include/linux/sdla_asy.h deleted file mode 100644 index f62242537c8..00000000000 --- a/include/linux/sdla_asy.h +++ /dev/null @@ -1,226 +0,0 @@ -/***************************************************************************** -* sdla_asy.h Header file for the Sangoma S508/S514 asynchronous code API -* -* Author: Gideon Hack -* -* Copyright: (c) 2000 Sangoma Technologies Inc. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -* ============================================================================ -* -* Jan 28, 2000 Gideon Hack Initial Version -* -*****************************************************************************/ - - -#ifndef _WANPIPE_ASYNC_H -#define _WANPIPE_ASYNC_H - -/* ---------------------------------------------------------------------------- - * Interface commands - * --------------------------------------------------------------------------*/ - -#define SET_ASY_CONFIGURATION 0xE2 /* set the asychronous operational configuration */ -#define READ_ASY_CONFIGURATION 0xE3 /* read the current asychronous operational configuration */ -#define ENABLE_ASY_COMMUNICATIONS 0xE4 /* enable asychronous communications */ -#define DISABLE_ASY_COMMUNICATIONS 0xE5 /* disable asychronous communications */ -#define READ_ASY_OPERATIONAL_STATS 0xE7 /* retrieve the asychronous operational statistics */ -#define FLUSH_ASY_OPERATIONAL_STATS 0xE8 /* flush the asychronous operational statistics */ -#define TRANSMIT_ASY_BREAK_SIGNAL 0xEC /* transmit an asychronous break signal */ - - - -/* ---------------------------------------------------------------------------- - * Return codes from interface commands - * --------------------------------------------------------------------------*/ - -#define COMMAND_INVALID_FOR_PORT 0x50 /* the command is invalid for the selected port */ -#define DISABLE_ASY_COMMS_BEFORE_CFG 0xE1 /* communications must be disabled before setting the configuration */ -#define ASY_COMMS_ENABLED 0xE1 /* communications are currently enabled */ -#define ASY_COMMS_DISABLED 0xE1 /* communications are currently disabled */ -#define ASY_CFG_BEFORE_COMMS_ENABLED 0xE2 /* perform a SET_ASY_CONFIGURATION before enabling comms */ -#define LGTH_ASY_CFG_DATA_INVALID 0xE2 /* the length of the passed configuration data is invalid */ -#define INVALID_ASY_CFG_DATA 0xE3 /* the passed configuration data is invalid */ -#define ASY_BREAK_SIGNAL_BUSY 0xEC /* a break signal is being transmitted */ - - - -/* ---------------------------------------------------------------------------- - * Constants for the SET_ASY_CONFIGURATION/READ_ASY_CONFIGURATION command - * --------------------------------------------------------------------------*/ - -/* the asynchronous configuration structure */ -typedef struct { - unsigned long baud_rate PACKED; /* the baud rate */ - unsigned short line_config_options PACKED; /* line configuration options */ - unsigned short modem_config_options PACKED; /* modem configuration options */ - unsigned short asy_API_options PACKED; /* asynchronous API options */ - unsigned short asy_protocol_options PACKED; /* asynchronous protocol options */ - unsigned short Tx_bits_per_char PACKED; /* number of bits per tx character */ - unsigned short Rx_bits_per_char PACKED; /* number of bits per received character */ - unsigned short stop_bits PACKED; /* number of stop bits per character */ - unsigned short parity PACKED; /* parity definition */ - unsigned short break_timer PACKED; /* the break signal timer */ - unsigned short asy_Rx_inter_char_timer PACKED; /* the receive inter-character timer */ - unsigned short asy_Rx_complete_length PACKED; /* the receive 'buffer complete' length */ - unsigned short XON_char PACKED; /* the XON character */ - unsigned short XOFF_char PACKED; /* the XOFF character */ - unsigned short asy_statistics_options PACKED; /* async operational stat options */ - unsigned long ptr_shared_mem_info_struct PACKED;/* ptr to the shared memory area information structure */ - unsigned long ptr_asy_Tx_stat_el_cfg_struct PACKED;/* ptr to the transmit status element configuration structure */ - unsigned long ptr_asy_Rx_stat_el_cfg_struct PACKED;/* ptr to the receive status element configuration structure */ -} ASY_CONFIGURATION_STRUCT; - -/* permitted minimum and maximum values for setting the asynchronous configuration */ -#define MIN_ASY_BAUD_RATE 50 /* maximum baud rate */ -#define MAX_ASY_BAUD_RATE 250000 /* minimum baud rate */ -#define MIN_ASY_BITS_PER_CHAR 5 /* minimum number of bits per character */ -#define MAX_ASY_BITS_PER_CHAR 8 /* maximum number of bits per character */ -#define MIN_BREAK_TMR_VAL 0 /* minimum break signal timer */ -#define MAX_BREAK_TMR_VAL 5000 /* maximum break signal timer */ -#define MIN_ASY_RX_INTER_CHAR_TMR 0 /* minimum receive inter-character timer */ -#define MAX_ASY_RX_INTER_CHAR_TMR 30000 /* maximum receive inter-character timer */ -#define MIN_ASY_RX_CPLT_LENGTH 0 /* minimum receive 'length complete' value */ -#define MAX_ASY_RX_CPLT_LENGTH 2000 /* maximum receive 'length complete' value */ - -/* bit settings for the 'asy_API_options' */ -#define ASY_RX_DATA_TRANSPARENT 0x0001 /* do not strip parity and unused bits from received characters */ - -/* bit settings for the 'asy_protocol_options' */ -#define ASY_RTS_HS_FOR_RX 0x0001 /* RTS handshaking is used for reception control */ -#define ASY_XON_XOFF_HS_FOR_RX 0x0002 /* XON/XOFF handshaking is used for reception control */ -#define ASY_XON_XOFF_HS_FOR_TX 0x0004 /* XON/XOFF handshaking is used for transmission control */ -#define ASY_DCD_HS_FOR_TX 0x0008 /* DCD handshaking is used for transmission control */ -#define ASY_CTS_HS_FOR_TX 0x0020 /* CTS handshaking is used for transmission control */ - -/* bit settings for the 'stop_bits' definition */ -#define ONE_STOP_BIT 1 /* representation for 1 stop bit */ -#define TWO_STOP_BITS 2 /* representation for 2 stop bits */ -#define ONE_AND_A_HALF_STOP_BITS 3 /* representation for 1.5 stop bits */ - -/* bit settings for the 'parity' definition */ -#define NO_PARITY 0 /* representation for no parity */ -#define ODD_PARITY 1 /* representation for odd parity */ -#define EVEN_PARITY 2 /* representation for even parity */ - - - -/* ---------------------------------------------------------------------------- - * Constants for the READ_COMMS_ERROR_STATS command (asynchronous mode) - * --------------------------------------------------------------------------*/ - -/* the communications error statistics structure */ -typedef struct { - unsigned short Rx_overrun_err_count PACKED; /* receiver overrun error count */ - unsigned short Rx_parity_err_count PACKED; /* parity errors received count */ - unsigned short Rx_framing_err_count PACKED; /* framing errors received count */ - unsigned short comms_err_stat_reserved_1 PACKED;/* reserved for later use */ - unsigned short comms_err_stat_reserved_2 PACKED;/* reserved for later use */ - unsigned short comms_err_stat_reserved_3 PACKED;/* reserved for later use */ - unsigned short comms_err_stat_reserved_4 PACKED;/* reserved for later use */ - unsigned short comms_err_stat_reserved_5 PACKED;/* reserved for later use */ - unsigned short DCD_state_change_count PACKED; /* DCD state change count */ - unsigned short CTS_state_change_count PACKED; /* CTS state change count */ -} ASY_COMMS_ERROR_STATS_STRUCT; - - - -/* ---------------------------------------------------------------------------- - * Constants for the READ_ASY_OPERATIONAL_STATS command - * --------------------------------------------------------------------------*/ - -/* the asynchronous operational statistics structure */ -typedef struct { - - /* Data transmission statistics */ - unsigned long Data_blocks_Tx_count PACKED;/* number of blocks transmitted */ - unsigned long Data_bytes_Tx_count PACKED;/* number of bytes transmitted */ - unsigned long Data_Tx_throughput PACKED;/* transmit throughput */ - unsigned long no_ms_for_Data_Tx_thruput_comp PACKED;/* millisecond time used for the Tx throughput computation */ - unsigned long Tx_Data_discard_lgth_err_count PACKED;/* number of Data blocks discarded (length error) */ - unsigned long reserved_Data_frm_Tx_stat1 PACKED;/* reserved for later use */ - unsigned long reserved_Data_frm_Tx_stat2 PACKED;/* reserved for later use */ - unsigned long reserved_Data_frm_Tx_stat3 PACKED;/* reserved for later use */ - - /* Data reception statistics */ - unsigned long Data_blocks_Rx_count PACKED;/* number of blocks received */ - unsigned long Data_bytes_Rx_count PACKED;/* number of bytes received */ - unsigned long Data_Rx_throughput PACKED;/* receive throughput */ - unsigned long no_ms_for_Data_Rx_thruput_comp PACKED;/* millisecond time used for the Rx throughput computation */ - unsigned long Rx_Data_bytes_discard_count PACKED;/* received Data bytes discarded */ - unsigned long reserved_Data_frm_Rx_stat1 PACKED;/* reserved for later use */ - - /* handshaking protocol statistics */ - unsigned short XON_chars_Tx_count PACKED; /* number of XON characters transmitted */ - unsigned short XOFF_chars_Tx_count PACKED; /* number of XOFF characters transmitted */ - unsigned short XON_chars_Rx_count PACKED; /* number of XON characters received */ - unsigned short XOFF_chars_Rx_count PACKED; /* number of XOFF characters received */ - unsigned short Tx_halt_modem_low_count PACKED; /* number of times Tx halted (modem line low) */ - unsigned short Rx_halt_RTS_low_count PACKED; /* number of times Rx halted by setting RTS low */ - unsigned long reserved_handshaking_stat1 PACKED;/* reserved for later use */ - - /* break statistics */ - unsigned short break_Tx_count PACKED; /* number of break sequences transmitted */ - unsigned short break_Rx_count PACKED; /* number of break sequences received */ - unsigned long reserved_break_stat1 PACKED;/* reserved for later use */ - - /* miscellaneous statistics */ - unsigned long reserved_misc_stat1 PACKED; /* reserved for later use */ - unsigned long reserved_misc_stat2 PACKED; /* reserved for later use */ - -} ASY_OPERATIONAL_STATS_STRUCT; - - - -/* ---------------------------------------------------------------------------- - * Constants for Data transmission - * --------------------------------------------------------------------------*/ - -/* the Data block transmit status element configuration structure */ -typedef struct { - unsigned short number_Tx_status_elements PACKED; /* number of transmit status elements */ - unsigned long base_addr_Tx_status_elements PACKED; /* base address of the transmit element list */ - unsigned long next_Tx_status_element_to_use PACKED; /* pointer to the next transmit element to be used */ -} ASY_TX_STATUS_EL_CFG_STRUCT; - - -/* the Data block transmit status element structure */ -typedef struct { - unsigned char opp_flag PACKED; /* opp flag */ - unsigned short data_length PACKED; /* length of the block to be transmitted */ - unsigned char reserved_1 PACKED; /* reserved for internal use */ - unsigned long reserved_2 PACKED; /* reserved for internal use */ - unsigned long reserved_3 PACKED; /* reserved for internal use */ - unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ -} ASY_DATA_TX_STATUS_EL_STRUCT; - - - -/* ---------------------------------------------------------------------------- - * Constants for Data reception - * --------------------------------------------------------------------------*/ - -/* the Data block receive status element configuration structure */ -typedef struct { - unsigned short number_Rx_status_elements PACKED;/* number of receive status elements */ - unsigned long base_addr_Rx_status_elements PACKED;/* base address of the receive element list */ - unsigned long next_Rx_status_element_to_use PACKED;/* pointer to the next receive element to be used */ - unsigned long base_addr_Rx_buffer PACKED;/* base address of the receive data buffer */ - unsigned long end_addr_Rx_buffer PACKED;/* end address of the receive data buffer */ -} ASY_RX_STATUS_EL_CFG_STRUCT; - -/* the Data block receive status element structure */ -typedef struct { - unsigned char opp_flag PACKED; /* opp flag */ - unsigned short data_length PACKED; /* length of the received data block */ - unsigned char reserved_1 PACKED; /* reserved for internal use */ - unsigned short time_stamp PACKED; /* receive time stamp (HDLC_STREAMING_MODE) */ - unsigned short data_buffered PACKED; /* the number of data bytes still buffered */ - unsigned long reserved_2 PACKED; /* reserved for internal use */ - unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ -} ASY_DATA_RX_STATUS_EL_STRUCT; - -#endif diff --git a/include/linux/sdla_chdlc.h b/include/linux/sdla_chdlc.h deleted file mode 100644 index d2e35a29903..00000000000 --- a/include/linux/sdla_chdlc.h +++ /dev/null @@ -1,813 +0,0 @@ -/************************************************************************* - sdla_chdlc.h Sangoma Cisco HDLC firmware API definitions - - Author: Gideon Hack - Nenad Corbic <ncorbic@sangoma.com> - - Copyright: (c) 1995-2000 Sangoma Technologies Inc. - - This program is free software; you can redistribute it and/or - modify it under the term of the GNU General Public License - as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. - -=========================================================================== - Oct 04, 1999 Nenad Corbic Updated API support - Jun 02, 1999 Gideon Hack Changes for S514 usage. - Oct 28, 1998 Jaspreet Singh Made changes for Dual Port CHDLC. - Jun 11, 1998 David Fong Initial version. -=========================================================================== - - Organization - - Compatibility notes - - Constants defining the shared memory control block (mailbox) - - Interface commands - - Return code from interface commands - - Constants for the commands (structures for casting data) - - UDP Management constants and structures - -*************************************************************************/ - -#ifndef _SDLA_CHDLC_H -# define _SDLC_CHDLC_H - -/*------------------------------------------------------------------------ - Notes: - - All structres defined in this file are byte-aligned. - - Compiler Platform - ------------------------ - GNU C Linux - -------------------------------------------------------------------------*/ - -#ifndef PACKED -#define PACKED __attribute__((packed)) -#endif /* PACKED */ - - -/* ---------------------------------------------------------------------------- - * Constants defining the shared memory control block (mailbox) - * --------------------------------------------------------------------------*/ - -#define PRI_BASE_ADDR_MB_STRUCT 0xE000 /* the base address of the mailbox structure on the adapter */ -#define SEC_BASE_ADDR_MB_STRUCT 0xE800 /* the base address of the mailbox structure on the adapter */ -#define SIZEOF_MB_DATA_BFR 2032 /* the size of the actual mailbox data area */ -#define NUMBER_MB_RESERVED_BYTES 0x0B /* the number of reserved bytes in the mailbox header area */ - - -#define MIN_LGTH_CHDLC_DATA_CFG 300 /* min length of the CHDLC data field (for configuration purposes) */ -#define PRI_MAX_NO_DATA_BYTES_IN_FRAME 15354 /* PRIMARY - max length of the CHDLC data field */ - -typedef struct { - unsigned char opp_flag PACKED; /* the opp flag */ - unsigned char command PACKED; /* the user command */ - unsigned short buffer_length PACKED; /* the data length */ - unsigned char return_code PACKED; /* the return code */ - unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; /* reserved for later */ - unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; /* the data area */ -} CHDLC_MAILBOX_STRUCT; - -typedef struct { - pid_t pid_num PACKED; - CHDLC_MAILBOX_STRUCT cmdarea PACKED; - -} CMDBLOCK_STRUCT; - - - - -/* ---------------------------------------------------------------------------- - * Interface commands - * --------------------------------------------------------------------------*/ - -/* global interface commands */ -#define READ_GLOBAL_EXCEPTION_CONDITION 0x01 -#define SET_GLOBAL_CONFIGURATION 0x02 -#define READ_GLOBAL_CONFIGURATION 0x03 -#define READ_GLOBAL_STATISTICS 0x04 -#define FLUSH_GLOBAL_STATISTICS 0x05 -#define SET_MODEM_STATUS 0x06 /* set status of DTR or RTS */ -#define READ_MODEM_STATUS 0x07 /* read status of CTS and DCD */ -#define READ_COMMS_ERROR_STATS 0x08 -#define FLUSH_COMMS_ERROR_STATS 0x09 -#define SET_TRACE_CONFIGURATION 0x0A /* set the line trace config */ -#define READ_TRACE_CONFIGURATION 0x0B /* read the line trace config */ -#define READ_TRACE_STATISTICS 0x0C /* read the trace statistics */ -#define FLUSH_TRACE_STATISTICS 0x0D /* flush the trace statistics */ -#define FT1_MONITOR_STATUS_CTRL 0x1C /* set the status of the S508/FT1 monitoring */ -#define SET_FT1_CONFIGURATION 0x18 /* set the FT1 configuration */ -#define READ_FT1_CONFIGURATION 0x19 /* read the FT1 configuration */ -#define TRANSMIT_ASYNC_DATA_TO_FT1 0x1A /* output asynchronous data to the FT1 */ -#define RECEIVE_ASYNC_DATA_FROM_FT1 0x1B /* receive asynchronous data from the FT1 */ -#define FT1_MONITOR_STATUS_CTRL 0x1C /* set the status of the FT1 monitoring */ - -#define READ_FT1_OPERATIONAL_STATS 0x1D /* read the S508/FT1 operational statistics */ -#define SET_FT1_MODE 0x1E /* set the operational mode of the S508/FT1 module */ - -/* CHDLC-level interface commands */ -#define READ_CHDLC_CODE_VERSION 0x20 -#define READ_CHDLC_EXCEPTION_CONDITION 0x21 /* read exception condition from the adapter */ -#define SET_CHDLC_CONFIGURATION 0x22 -#define READ_CHDLC_CONFIGURATION 0x23 -#define ENABLE_CHDLC_COMMUNICATIONS 0x24 -#define DISABLE_CHDLC_COMMUNICATIONS 0x25 -#define READ_CHDLC_LINK_STATUS 0x26 -#define READ_CHDLC_OPERATIONAL_STATS 0x27 -#define FLUSH_CHDLC_OPERATIONAL_STATS 0x28 -#define SET_CHDLC_INTERRUPT_TRIGGERS 0x30 /* set application interrupt triggers */ -#define READ_CHDLC_INTERRUPT_TRIGGERS 0x31 /* read application interrupt trigger configuration */ - -/* Special UDP drivers management commands */ -#define CPIPE_ENABLE_TRACING 0x50 -#define CPIPE_DISABLE_TRACING 0x51 -#define CPIPE_GET_TRACE_INFO 0x52 -#define CPIPE_GET_IBA_DATA 0x53 -#define CPIPE_FT1_READ_STATUS 0x54 -#define CPIPE_DRIVER_STAT_IFSEND 0x55 -#define CPIPE_DRIVER_STAT_INTR 0x56 -#define CPIPE_DRIVER_STAT_GEN 0x57 -#define CPIPE_FLUSH_DRIVER_STATS 0x58 -#define CPIPE_ROUTER_UP_TIME 0x59 - -/* Driver specific commands for API */ -#define CHDLC_READ_TRACE_DATA 0xE4 /* read trace data */ -#define TRACE_ALL 0x00 -#define TRACE_PROT 0x01 -#define TRACE_DATA 0x02 - -#define DISCARD_RX_ERROR_FRAMES 0x0001 - -/* ---------------------------------------------------------------------------- - * Return codes from interface commands - * --------------------------------------------------------------------------*/ - -#define COMMAND_OK 0x00 - -/* return codes from global interface commands */ -#define NO_GLOBAL_EXCEP_COND_TO_REPORT 0x01 /* there is no CHDLC exception condition to report */ -#define LGTH_GLOBAL_CFG_DATA_INVALID 0x01 /* the length of the passed global configuration data is invalid */ -#define LGTH_TRACE_CFG_DATA_INVALID 0x01 /* the length of the passed trace configuration data is invalid */ -#define IRQ_TIMEOUT_VALUE_INVALID 0x02 /* an invalid application IRQ timeout value was selected */ -#define TRACE_CONFIG_INVALID 0x02 /* the passed line trace configuration is invalid */ -#define ADAPTER_OPERATING_FREQ_INVALID 0x03 /* an invalid adapter operating frequency was selected */ -#define TRC_DEAC_TMR_INVALID 0x03 /* the trace deactivation timer is invalid */ -#define S508_FT1_ADPTR_NOT_PRESENT 0x0C /* the S508/FT1 adapter is not present */ -#define INVALID_FT1_STATUS_SELECTION 0x0D /* the S508/FT1 status selection is invalid */ -#define FT1_OP_STATS_NOT_ENABLED 0x0D /* the FT1 operational statistics have not been enabled */ -#define FT1_OP_STATS_NOT_AVAILABLE 0x0E /* the FT1 operational statistics are not currently available */ -#define S508_FT1_MODE_SELECTION_BUSY 0x0E /* the S508/FT1 adapter is busy selecting the operational mode */ - -/* return codes from command READ_GLOBAL_EXCEPTION_CONDITION */ -#define EXCEP_MODEM_STATUS_CHANGE 0x10 /* a modem status change occurred */ -#define EXCEP_TRC_DISABLED 0x11 /* the trace has been disabled */ -#define EXCEP_IRQ_TIMEOUT 0x12 /* IRQ timeout */ - -/* return codes from CHDLC-level interface commands */ -#define NO_CHDLC_EXCEP_COND_TO_REPORT 0x21 /* there is no CHDLC exception condition to report */ -#define CHDLC_COMMS_DISABLED 0x21 /* communications are not currently enabled */ -#define CHDLC_COMMS_ENABLED 0x21 /* communications are currently enabled */ -#define DISABLE_CHDLC_COMMS_BEFORE_CFG 0x21 /* CHDLC communications must be disabled before setting the configuration */ -#define ENABLE_CHDLC_COMMS_BEFORE_CONN 0x21 /* communications must be enabled before using the CHDLC_CONNECT conmmand */ -#define CHDLC_CFG_BEFORE_COMMS_ENABLED 0x22 /* perform a SET_CHDLC_CONFIGURATION before enabling comms */ -#define LGTH_CHDLC_CFG_DATA_INVALID 0x22 /* the length of the passed CHDLC configuration data is invalid */ -#define LGTH_INT_TRIGGERS_DATA_INVALID 0x22 /* the length of the passed interrupt trigger data is invalid */ -#define INVALID_IRQ_SELECTED 0x23 /* in invalid IRQ was selected in the SET_CHDLC_INTERRUPT_TRIGGERS */ -#define INVALID_CHDLC_CFG_DATA 0x23 /* the passed CHDLC configuration data is invalid */ -#define IRQ_TMR_VALUE_INVALID 0x24 /* an invalid application IRQ timer value was selected */ -#define LARGER_PERCENT_TX_BFR_REQUIRED 0x24 /* a larger Tx buffer percentage is required */ -#define LARGER_PERCENT_RX_BFR_REQUIRED 0x25 /* a larger Rx buffer percentage is required */ -#define S514_BOTH_PORTS_SAME_CLK_MODE 0x26 /* S514 - both ports must have same clock mode */ -#define INVALID_CMND_HDLC_STREAM_MODE 0x4E /* the CHDLC interface command is invalid for HDLC streaming mode */ -#define INVALID_CHDLC_COMMAND 0x4F /* the defined CHDLC interface command is invalid */ - -/* return codes from command READ_CHDLC_EXCEPTION_CONDITION */ -#define EXCEP_LINK_ACTIVE 0x30 /* the CHDLC link has become active */ -#define EXCEP_LINK_INACTIVE_MODEM 0x31 /* the CHDLC link has become inactive (modem status) */ -#define EXCEP_LINK_INACTIVE_KPALV 0x32 /* the CHDLC link has become inactive (keepalive status) */ -#define EXCEP_IP_ADDRESS_DISCOVERED 0x33 /* the IP address has been discovered */ -#define EXCEP_LOOPBACK_CONDITION 0x34 /* a loopback condition has occurred */ - - -/* return code from command CHDLC_SEND_WAIT and CHDLC_SEND_NO_WAIT */ -#define LINK_DISCONNECTED 0x21 -#define NO_TX_BFRS_AVAIL 0x24 - - -/* ---------------------------------------------------------------------------- - * Constants for the SET_GLOBAL_CONFIGURATION/READ_GLOBAL_CONFIGURATION commands - * --------------------------------------------------------------------------*/ - -/* the global configuration structure */ -typedef struct { - unsigned short adapter_config_options PACKED; /* adapter config options */ - unsigned short app_IRQ_timeout PACKED; /* application IRQ timeout */ - unsigned long adapter_operating_frequency PACKED; /* adapter operating frequency */ -} GLOBAL_CONFIGURATION_STRUCT; - -/* settings for the 'app_IRQ_timeout' */ -#define MAX_APP_IRQ_TIMEOUT_VALUE 5000 /* the maximum permitted IRQ timeout */ - - - -/* ---------------------------------------------------------------------------- - * Constants for the READ_GLOBAL_STATISTICS command - * --------------------------------------------------------------------------*/ - -/* the global statistics structure */ -typedef struct { - unsigned short app_IRQ_timeout_count PACKED; -} GLOBAL_STATS_STRUCT; - - - -/* ---------------------------------------------------------------------------- - * Constants for the READ_COMMS_ERROR_STATS command - * --------------------------------------------------------------------------*/ - -/* the communications error statistics structure */ -typedef struct { - unsigned short Rx_overrun_err_count PACKED; - unsigned short CRC_err_count PACKED; /* receiver CRC error count */ - unsigned short Rx_abort_count PACKED; /* abort frames recvd count */ - unsigned short Rx_dis_pri_bfrs_full_count PACKED;/* receiver disabled */ - unsigned short comms_err_stat_reserved_1 PACKED;/* reserved for later */ - unsigned short sec_Tx_abort_msd_Tx_int_count PACKED; /* secondary - abort frames transmitted count (missed Tx interrupt) */ - unsigned short missed_Tx_und_int_count PACKED; /* missed tx underrun interrupt count */ - unsigned short sec_Tx_abort_count PACKED; /*secondary-abort frames tx count */ - unsigned short DCD_state_change_count PACKED; /* DCD state change */ - unsigned short CTS_state_change_count PACKED; /* CTS state change */ -} COMMS_ERROR_STATS_STRUCT; - - - -/* ---------------------------------------------------------------------------- - * Constants used for line tracing - * --------------------------------------------------------------------------*/ - -/* the trace configuration structure (SET_TRACE_CONFIGURATION/READ_TRACE_CONFIGURATION commands) */ -typedef struct { - unsigned char trace_config PACKED; /* trace configuration */ - unsigned short trace_deactivation_timer PACKED; /* trace deactivation timer */ - unsigned long ptr_trace_stat_el_cfg_struct PACKED; /* a pointer to the line trace element configuration structure */ -} LINE_TRACE_CONFIG_STRUCT; - -/* 'trace_config' bit settings */ -#define TRACE_INACTIVE 0x00 /* trace is inactive */ -#define TRACE_ACTIVE 0x01 /* trace is active */ -#define TRACE_DELAY_MODE 0x04 /* operate the trace in delay mode */ -#define TRACE_DATA_FRAMES 0x08 /* trace Data frames */ -#define TRACE_SLARP_FRAMES 0x10 /* trace SLARP frames */ -#define TRACE_CDP_FRAMES 0x20 /* trace CDP frames */ - -/* the line trace status element configuration structure */ -typedef struct { - unsigned short number_trace_status_elements PACKED; /* number of line trace elements */ - unsigned long base_addr_trace_status_elements PACKED; /* base address of the trace element list */ - unsigned long next_trace_element_to_use PACKED; /* pointer to the next trace element to be used */ - unsigned long base_addr_trace_buffer PACKED; /* base address of the trace data buffer */ - unsigned long end_addr_trace_buffer PACKED; /* end address of the trace data buffer */ -} TRACE_STATUS_EL_CFG_STRUCT; - -/* the line trace status element structure */ -typedef struct { - unsigned char opp_flag PACKED; /* opp flag */ - unsigned short trace_length PACKED; /* trace length */ - unsigned char trace_type PACKED; /* trace type */ - unsigned short trace_time_stamp PACKED; /* time stamp */ - unsigned short trace_reserved_1 PACKED; /* reserved for later use */ - unsigned long trace_reserved_2 PACKED; /* reserved for later use */ - unsigned long ptr_data_bfr PACKED; /* ptr to the trace data buffer */ -} TRACE_STATUS_ELEMENT_STRUCT; - -/* "trace_type" bit settings */ -#define TRACE_INCOMING 0x00 -#define TRACE_OUTGOINGING 0x01 -#define TRACE_INCOMING_ABORTED 0x10 -#define TRACE_INCOMING_CRC_ERROR 0x20 -#define TRACE_INCOMING_OVERRUN_ERROR 0x40 - - - -/* the line trace statistics structure */ -typedef struct { - unsigned long frames_traced_count PACKED; /* number of frames traced */ - unsigned long trc_frms_not_recorded_count PACKED; /* number of trace frames discarded */ -} LINE_TRACE_STATS_STRUCT; - - -/* ---------------------------------------------------------------------------- - * Constants for the FT1_MONITOR_STATUS_CTRL command - * --------------------------------------------------------------------------*/ - -#define DISABLE_FT1_STATUS_STATISTICS 0x00 /* disable the FT1 status and statistics monitoring */ -#define ENABLE_READ_FT1_STATUS 0x01 /* read the FT1 operational status */ -#define ENABLE_READ_FT1_OP_STATS 0x02 /* read the FT1 operational statistics */ -#define FLUSH_FT1_OP_STATS 0x04 /* flush the FT1 operational statistics */ - - - - -/* ---------------------------------------------------------------------------- - * Constants for the SET_CHDLC_CONFIGURATION command - * --------------------------------------------------------------------------*/ - -/* the CHDLC configuration structure */ -typedef struct { - unsigned long baud_rate PACKED; /* the baud rate */ - unsigned short line_config_options PACKED; /* line configuration options */ - unsigned short modem_config_options PACKED; /* modem configration options */ - unsigned short modem_status_timer PACKED; /* timer for monitoring modem status changes */ - unsigned short CHDLC_API_options PACKED; /* CHDLC API options */ - unsigned short CHDLC_protocol_options PACKED; /* CHDLC protocol options */ - unsigned short percent_data_buffer_for_Tx PACKED; /* percentage data buffering used for Tx */ - unsigned short CHDLC_statistics_options PACKED; /* CHDLC operational statistics options */ - unsigned short max_CHDLC_data_field_length PACKED; /* the maximum length of the CHDLC Data field */ - unsigned short transmit_keepalive_timer PACKED; /* the transmit keepalive timer */ - unsigned short receive_keepalive_timer PACKED; /* the receive keepalive timer */ - unsigned short keepalive_error_tolerance PACKED; /* the receive keepalive error tolerance */ - unsigned short SLARP_request_timer PACKED; /* the SLARP request timer */ - unsigned long IP_address PACKED; /* the IP address */ - unsigned long IP_netmask PACKED; /* the IP netmask */ - unsigned long ptr_shared_mem_info_struct PACKED; /* a pointer to the shared memory area information structure */ - unsigned long ptr_CHDLC_Tx_stat_el_cfg_struct PACKED; /* a pointer to the transmit status element configuration structure */ - unsigned long ptr_CHDLC_Rx_stat_el_cfg_struct PACKED; /* a pointer to the receive status element configuration structure */ -} CHDLC_CONFIGURATION_STRUCT; - -/* settings for the 'line_config_options' */ -#define INTERFACE_LEVEL_V35 0x0000 /* V.35 interface level */ -#define INTERFACE_LEVEL_RS232 0x0001 /* RS-232 interface level */ - -/* settings for the 'modem_config_options' */ - -#define DONT_RAISE_DTR_RTS_ON_EN_COMMS 0x0001 -/* don't automatically raise DTR and RTS when performing an - ENABLE_CHDLC_COMMUNICATIONS command */ - -#define DONT_REPORT_CHG_IN_MODEM_STAT 0x0002 -/* don't report changes in modem status to the application */ - - -/* bit settings for the 'CHDLC_protocol_options' byte */ - -#define IGNORE_DCD_FOR_LINK_STAT 0x0001 -/* ignore DCD in determining the CHDLC link status */ - -#define IGNORE_CTS_FOR_LINK_STAT 0x0002 -/* ignore CTS in determining the CHDLC link status */ - -#define IGNORE_KPALV_FOR_LINK_STAT 0x0004 -/* ignore keepalive frames in determining the CHDLC link status */ - -#define SINGLE_TX_BUFFER 0x4000 -/* configure a single transmit buffer */ - -#define HDLC_STREAMING_MODE 0x8000 - -/* settings for the 'CHDLC_statistics_options' */ - -#define CHDLC_TX_DATA_BYTE_COUNT_STAT 0x0001 -/* record the number of Data bytes transmitted */ - -#define CHDLC_RX_DATA_BYTE_COUNT_STAT 0x0002 -/* record the number of Data bytes received */ - -#define CHDLC_TX_THROUGHPUT_STAT 0x0004 -/* compute the Data frame transmit throughput */ - -#define CHDLC_RX_THROUGHPUT_STAT 0x0008 -/* compute the Data frame receive throughput */ - - -/* permitted minimum and maximum values for setting the CHDLC configuration */ -#define PRI_MAX_BAUD_RATE_S508 2666666 /* PRIMARY - maximum baud rate (S508) */ -#define SEC_MAX_BAUD_RATE_S508 258064 /* SECONDARY - maximum baud rate (S508) */ -#define PRI_MAX_BAUD_RATE_S514 2750000 /* PRIMARY - maximum baud rate (S508) */ -#define SEC_MAX_BAUD_RATE_S514 515625 /* SECONDARY - maximum baud rate (S508) */ - -#define MIN_MODEM_TIMER 0 /* minimum modem status timer */ -#define MAX_MODEM_TIMER 5000 /* maximum modem status timer */ - -#define SEC_MAX_NO_DATA_BYTES_IN_FRAME 2048 /* SECONDARY - max length of the CHDLC data field */ - -#define MIN_Tx_KPALV_TIMER 0 /* minimum transmit keepalive timer */ -#define MAX_Tx_KPALV_TIMER 60000 /* maximum transmit keepalive timer */ -#define DEFAULT_Tx_KPALV_TIMER 10000 /* default transmit keepalive timer */ - -#define MIN_Rx_KPALV_TIMER 10 /* minimum receive keepalive timer */ -#define MAX_Rx_KPALV_TIMER 60000 /* maximum receive keepalive timer */ -#define DEFAULT_Rx_KPALV_TIMER 10000 /* default receive keepalive timer */ - -#define MIN_KPALV_ERR_TOL 1 /* min kpalv error tolerance count */ -#define MAX_KPALV_ERR_TOL 20 /* max kpalv error tolerance count */ -#define DEFAULT_KPALV_ERR_TOL 3 /* default value */ - -#define MIN_SLARP_REQ_TIMER 0 /* min transmit SLARP Request timer */ -#define MAX_SLARP_REQ_TIMER 60000 /* max transmit SLARP Request timer */ -#define DEFAULT_SLARP_REQ_TIMER 0 /* default value -- no SLARP */ - - - -/* ---------------------------------------------------------------------------- - * Constants for the READ_CHDLC_LINK_STATUS command - * --------------------------------------------------------------------------*/ - -/* the CHDLC status structure */ -typedef struct { - unsigned char CHDLC_link_status PACKED; /* CHDLC link status */ - unsigned char no_Data_frms_for_app PACKED; /* number of Data frames available for the application */ - unsigned char receiver_status PACKED; /* enabled/disabled */ - unsigned char SLARP_state PACKED; /* internal SLARP state */ -} CHDLC_LINK_STATUS_STRUCT; - -/* settings for the 'CHDLC_link_status' variable */ -#define CHDLC_LINK_INACTIVE 0x00 /* the CHDLC link is inactive */ -#define CHDLC_LINK_ACTIVE 0x01 /* the CHDLC link is active */ - - - -/* ---------------------------------------------------------------------------- - * Constants for the READ_CHDLC_OPERATIONAL_STATS command - * --------------------------------------------------------------------------*/ - -/* the CHDLC operational statistics structure */ -typedef struct { - - /* Data frame transmission statistics */ - unsigned long Data_frames_Tx_count PACKED; /* # of frames transmitted */ - unsigned long Data_bytes_Tx_count PACKED; /* # of bytes transmitted */ - unsigned long Data_Tx_throughput PACKED; /* transmit throughput */ - unsigned long no_ms_for_Data_Tx_thruput_comp PACKED; /* millisecond time used for the Tx throughput computation */ - unsigned long Tx_Data_discard_lgth_err_count PACKED; /* number of Data frames discarded (length error) */ - unsigned long reserved_Data_frm_Tx_stat1 PACKED; /* reserved for later */ - unsigned long reserved_Data_frm_Tx_stat2 PACKED; /* reserved for later */ - unsigned long reserved_Data_frm_Tx_stat3 PACKED; /* reserved for later */ - - /* Data frame reception statistics */ - unsigned long Data_frames_Rx_count PACKED; /* number of frames received */ - unsigned long Data_bytes_Rx_count PACKED; /* number of bytes received */ - unsigned long Data_Rx_throughput PACKED; /* receive throughput */ - unsigned long no_ms_for_Data_Rx_thruput_comp PACKED; /* millisecond time used for the Rx throughput computation */ - unsigned long Rx_Data_discard_short_count PACKED; /* received Data frames discarded (too short) */ - unsigned long Rx_Data_discard_long_count PACKED; /* received Data frames discarded (too long) */ - unsigned long Rx_Data_discard_inactive_count PACKED; /* received Data frames discarded (link inactive) */ - unsigned long reserved_Data_frm_Rx_stat1 PACKED; /* reserved for later */ - - /* SLARP frame transmission/reception statistics */ - unsigned long CHDLC_SLARP_REQ_Tx_count PACKED; /* number of SLARP Request frames transmitted */ - unsigned long CHDLC_SLARP_REQ_Rx_count PACKED; /* number of SLARP Request frames received */ - unsigned long CHDLC_SLARP_REPLY_Tx_count PACKED; /* number of SLARP Reply frames transmitted */ - unsigned long CHDLC_SLARP_REPLY_Rx_count PACKED; /* number of SLARP Reply frames received */ - unsigned long CHDLC_SLARP_KPALV_Tx_count PACKED; /* number of SLARP keepalive frames transmitted */ - unsigned long CHDLC_SLARP_KPALV_Rx_count PACKED; /* number of SLARP keepalive frames received */ - unsigned long reserved_SLARP_stat1 PACKED; /* reserved for later */ - unsigned long reserved_SLARP_stat2 PACKED; /* reserved for later */ - - /* CDP frame transmission/reception statistics */ - unsigned long CHDLC_CDP_Tx_count PACKED; /* number of CDP frames transmitted */ - unsigned long CHDLC_CDP_Rx_count PACKED; /* number of CDP frames received */ - unsigned long reserved_CDP_stat1 PACKED; /* reserved for later */ - unsigned long reserved_CDP_stat2 PACKED; /* reserved for later */ - unsigned long reserved_CDP_stat3 PACKED; /* reserved for later */ - unsigned long reserved_CDP_stat4 PACKED; /* reserved for later */ - unsigned long reserved_CDP_stat5 PACKED; /* reserved for later */ - unsigned long reserved_CDP_stat6 PACKED; /* reserved for later */ - - /* Incoming frames with a format error statistics */ - unsigned short Rx_frm_incomp_CHDLC_hdr_count PACKED; /* frames received of with incomplete Cisco HDLC header */ - unsigned short Rx_frms_too_long_count PACKED; /* frames received of excessive length count */ - unsigned short Rx_invalid_CHDLC_addr_count PACKED; /* frames received with an invalid CHDLC address count */ - unsigned short Rx_invalid_CHDLC_ctrl_count PACKED; /* frames received with an invalid CHDLC control field count */ - unsigned short Rx_invalid_CHDLC_type_count PACKED; /* frames received of an invalid CHDLC frame type count */ - unsigned short Rx_SLARP_invalid_code_count PACKED; /* SLARP frame received with an invalid packet code */ - unsigned short Rx_SLARP_Reply_bad_IP_addr PACKED; /* SLARP Reply received - bad IP address */ - unsigned short Rx_SLARP_Reply_bad_netmask PACKED; /* SLARP Reply received - bad netmask */ - unsigned long reserved_frm_format_err1 PACKED; /* reserved for later */ - unsigned long reserved_frm_format_err2 PACKED; /* reserved for later */ - unsigned long reserved_frm_format_err3 PACKED; /* reserved for later */ - unsigned long reserved_frm_format_err4 PACKED; /* reserved for later */ - - /* CHDLC timeout/retry statistics */ - unsigned short SLARP_Rx_keepalive_TO_count PACKED; /* timeout count for incoming SLARP frames */ - unsigned short SLARP_Request_TO_count PACKED; /* timeout count for SLARP Request frames */ - unsigned long To_retry_reserved_stat1 PACKED; /* reserved for later */ - unsigned long To_retry_reserved_stat2 PACKED; /* reserved for later */ - unsigned long To_retry_reserved_stat3 PACKED; /* reserved for later */ - - /* CHDLC link active/inactive and loopback statistics */ - unsigned short link_active_count PACKED; /* number of times that the link went active */ - unsigned short link_inactive_modem_count PACKED; /* number of times that the link went inactive (modem failure) */ - unsigned short link_inactive_keepalive_count PACKED; /* number of times that the link went inactive (keepalive failure) */ - unsigned short link_looped_count PACKED; /* link looped count */ - unsigned long link_status_reserved_stat1 PACKED; /* reserved for later use */ - unsigned long link_status_reserved_stat2 PACKED; /* reserved for later use */ - - /* miscellaneous statistics */ - unsigned long reserved_misc_stat1 PACKED; /* reserved for later */ - unsigned long reserved_misc_stat2 PACKED; /* reserved for later */ - unsigned long reserved_misc_stat3 PACKED; /* reserved for later */ - unsigned long reserved_misc_stat4 PACKED; /* reserved for later */ - -} CHDLC_OPERATIONAL_STATS_STRUCT; - - - -/* ---------------------------------------------------------------------------- - * Constants for using application interrupts - * --------------------------------------------------------------------------*/ - -/* the structure used for the SET_CHDLC_INTERRUPT_TRIGGERS/READ_CHDLC_INTERRUPT_TRIGGERS command */ -typedef struct { - unsigned char CHDLC_interrupt_triggers PACKED; /* CHDLC interrupt trigger configuration */ - unsigned char IRQ PACKED; /* IRQ to be used */ - unsigned short interrupt_timer PACKED; /* interrupt timer */ - unsigned short misc_interrupt_bits PACKED; /* miscellaneous bits */ -} CHDLC_INT_TRIGGERS_STRUCT; - -/* 'CHDLC_interrupt_triggers' bit settings */ -#define APP_INT_ON_RX_FRAME 0x01 /* interrupt on Data frame reception */ -#define APP_INT_ON_TX_FRAME 0x02 /* interrupt when an Data frame may be transmitted */ -#define APP_INT_ON_COMMAND_COMPLETE 0x04 /* interrupt when an interface command is complete */ -#define APP_INT_ON_TIMER 0x08 /* interrupt on a defined millisecond timeout */ -#define APP_INT_ON_GLOBAL_EXCEP_COND 0x10 /* interrupt on a global exception condition */ -#define APP_INT_ON_CHDLC_EXCEP_COND 0x20 /* interrupt on an CHDLC exception condition */ -#define APP_INT_ON_TRACE_DATA_AVAIL 0x80 /* interrupt when trace data is available */ - -/* interrupt types indicated at 'interrupt_type' byte of the INTERRUPT_INFORMATION_STRUCT */ -#define NO_APP_INTS_PEND 0x00 /* no interrups are pending */ -#define RX_APP_INT_PEND 0x01 /* a receive interrupt is pending */ -#define TX_APP_INT_PEND 0x02 /* a transmit interrupt is pending */ -#define COMMAND_COMPLETE_APP_INT_PEND 0x04 /* a 'command complete' interrupt is pending */ -#define TIMER_APP_INT_PEND 0x08 /* a timer interrupt is pending */ -#define GLOBAL_EXCEP_COND_APP_INT_PEND 0x10 /* a global exception condition interrupt is pending */ -#define CHDLC_EXCEP_COND_APP_INT_PEND 0x20 /* an CHDLC exception condition interrupt is pending */ -#define TRACE_DATA_AVAIL_APP_INT_PEND 0x80 /* a trace data available interrupt is pending */ - - -/* modem status changes */ -#define DCD_HIGH 0x08 -#define CTS_HIGH 0x20 - - -/* ---------------------------------------------------------------------------- - * Constants for Data frame transmission - * --------------------------------------------------------------------------*/ - -/* the Data frame transmit status element configuration structure */ -typedef struct { - unsigned short number_Tx_status_elements PACKED; /* number of transmit status elements */ - unsigned long base_addr_Tx_status_elements PACKED; /* base address of the transmit element list */ - unsigned long next_Tx_status_element_to_use PACKED; /* pointer to the next transmit element to be used */ -} CHDLC_TX_STATUS_EL_CFG_STRUCT; - -/* the Data frame transmit status element structure */ -typedef struct { - unsigned char opp_flag PACKED; /* opp flag */ - unsigned short frame_length PACKED; /* length of the frame to be transmitted */ - unsigned char reserved_1 PACKED; /* reserved for internal use */ - unsigned long reserved_2 PACKED; /* reserved for internal use */ - unsigned long reserved_3 PACKED; /* reserved for internal use */ - unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ -} CHDLC_DATA_TX_STATUS_EL_STRUCT; - - - -/* ---------------------------------------------------------------------------- - * Constants for Data frame reception - * --------------------------------------------------------------------------*/ - -/* the Data frame receive status element configuration structure */ -typedef struct { - unsigned short number_Rx_status_elements PACKED; /* number of receive status elements */ - unsigned long base_addr_Rx_status_elements PACKED; /* base address of the receive element list */ - unsigned long next_Rx_status_element_to_use PACKED; /* pointer to the next receive element to be used */ - unsigned long base_addr_Rx_buffer PACKED; /* base address of the receive data buffer */ - unsigned long end_addr_Rx_buffer PACKED; /* end address of the receive data buffer */ -} CHDLC_RX_STATUS_EL_CFG_STRUCT; - -/* the Data frame receive status element structure */ -typedef struct { - unsigned char opp_flag PACKED; /* opp flag */ - unsigned short frame_length PACKED; /* length of the received frame */ - unsigned char error_flag PACKED; /* frame errors (HDLC_STREAMING_MODE)*/ - unsigned short time_stamp PACKED; /* receive time stamp (HDLC_STREAMING_MODE) */ - unsigned long reserved_1 PACKED; /* reserved for internal use */ - unsigned short reserved_2 PACKED; /* reserved for internal use */ - unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ -} CHDLC_DATA_RX_STATUS_EL_STRUCT; - - - -/* ---------------------------------------------------------------------------- - * Constants defining the shared memory information area - * --------------------------------------------------------------------------*/ - -/* the global information structure */ -typedef struct { - unsigned char global_status PACKED; /* global status */ - unsigned char modem_status PACKED; /* current modem status */ - unsigned char global_excep_conditions PACKED; /* global exception conditions */ - unsigned char glob_info_reserved[5] PACKED; /* reserved */ - unsigned char codename[4] PACKED; /* Firmware name */ - unsigned char codeversion[4] PACKED; /* Firmware version */ -} GLOBAL_INFORMATION_STRUCT; - -/* the CHDLC information structure */ -typedef struct { - unsigned char CHDLC_status PACKED; /* CHDLC status */ - unsigned char CHDLC_excep_conditions PACKED; /* CHDLC exception conditions */ - unsigned char CHDLC_info_reserved[14] PACKED; /* reserved */ -} CHDLC_INFORMATION_STRUCT; - -/* the interrupt information structure */ -typedef struct { - unsigned char interrupt_type PACKED; /* type of interrupt triggered */ - unsigned char interrupt_permission PACKED; /* interrupt permission mask */ - unsigned char int_info_reserved[14] PACKED; /* reserved */ -} INTERRUPT_INFORMATION_STRUCT; - -/* the S508/FT1 information structure */ -typedef struct { - unsigned char parallel_port_A_input PACKED; /* input - parallel port A */ - unsigned char parallel_port_B_input PACKED; /* input - parallel port B */ - unsigned char FT1_info_reserved[14] PACKED; /* reserved */ -} FT1_INFORMATION_STRUCT; - -/* the shared memory area information structure */ -typedef struct { - GLOBAL_INFORMATION_STRUCT global_info_struct PACKED; /* the global information structure */ - CHDLC_INFORMATION_STRUCT CHDLC_info_struct PACKED; /* the CHDLC information structure */ - INTERRUPT_INFORMATION_STRUCT interrupt_info_struct PACKED; /* the interrupt information structure */ - FT1_INFORMATION_STRUCT FT1_info_struct PACKED; /* the S508/FT1 information structure */ -} SHARED_MEMORY_INFO_STRUCT; - -/* ---------------------------------------------------------------------------- - * UDP Management constants and structures - * --------------------------------------------------------------------------*/ - -/* The embedded control block for UDP mgmt - This is essentially a mailbox structure, without the large data field */ - -typedef struct { - unsigned char opp_flag PACKED; /* the opp flag */ - unsigned char command PACKED; /* the user command */ - unsigned short buffer_length PACKED; /* the data length */ - unsigned char return_code PACKED; /* the return code */ - unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; /* reserved for later */ -} cblock_t; - - -/* UDP management packet layout (data area of ip packet) */ -/* -typedef struct { - unsigned char signature[8] PACKED; - unsigned char request_reply PACKED; - unsigned char id PACKED; - unsigned char reserved[6] PACKED; - cblock_t cblock PACKED; - unsigned char num_frames PACKED; - unsigned char ismoredata PACKED; - unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; -} udp_management_packet_t; - -*/ - -typedef struct { - unsigned char num_frames PACKED; - unsigned char ismoredata PACKED; -} trace_info_t; - -typedef struct { - ip_pkt_t ip_pkt PACKED; - udp_pkt_t udp_pkt PACKED; - wp_mgmt_t wp_mgmt PACKED; - cblock_t cblock PACKED; - trace_info_t trace_info PACKED; - unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; -} chdlc_udp_pkt_t; - -typedef struct ft1_exec_cmd{ - unsigned char command PACKED; /* the user command */ - unsigned short buffer_length PACKED; /* the data length */ - unsigned char return_code PACKED; /* the return code */ - unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; -} ft1_exec_cmd_t; - -typedef struct { - unsigned char opp_flag PACKED; - ft1_exec_cmd_t cmd PACKED; - unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; -} ft1_exec_t; - -#define UDPMGMT_SIGNATURE "CTPIPEAB" - - -/* UDP/IP packet (for UDP management) layout */ -/* -typedef struct { - unsigned char reserved[2] PACKED; - unsigned short ip_length PACKED; - unsigned char reserved2[4] PACKED; - unsigned char ip_ttl PACKED; - unsigned char ip_protocol PACKED; - unsigned short ip_checksum PACKED; - unsigned long ip_src_address PACKED; - unsigned long ip_dst_address PACKED; - unsigned short udp_src_port PACKED; - unsigned short udp_dst_port PACKED; - unsigned short udp_length PACKED; - unsigned short udp_checksum PACKED; - udp_management_packet_t um_packet PACKED; -} ip_packet_t; -*/ - -/* valid ip_protocol for UDP management */ -#define UDPMGMT_UDP_PROTOCOL 0x11 - - -typedef struct { - unsigned char status PACKED; - unsigned char data_avail PACKED; - unsigned short real_length PACKED; - unsigned short time_stamp PACKED; - unsigned char data[1] PACKED; -} trace_pkt_t; - -typedef struct { - unsigned char error_flag PACKED; - unsigned short time_stamp PACKED; - unsigned char reserved[13] PACKED; -} api_rx_hdr_t; - -typedef struct { - api_rx_hdr_t api_rx_hdr PACKED; - void * data PACKED; -} api_rx_element_t; - -typedef struct { - unsigned char attr PACKED; - unsigned char reserved[15] PACKED; -} api_tx_hdr_t; - -typedef struct { - api_tx_hdr_t api_tx_hdr PACKED; - void * data PACKED; -} api_tx_element_t; - -/* ---------------------------------------------------------------------------- - * Constants for the SET_FT1_CONFIGURATION/READ_FT1_CONFIGURATION command - * --------------------------------------------------------------------------*/ - -/* the FT1 configuration structure */ -typedef struct { - unsigned short framing_mode; - unsigned short encoding_mode; - unsigned short line_build_out; - unsigned short channel_base; - unsigned short baud_rate_kbps; /* the baud rate (in kbps) */ - unsigned short clock_mode; -} ft1_config_t; - -/* settings for the 'framing_mode' */ -#define ESF_FRAMING 0x00 /* ESF framing */ -#define D4_FRAMING 0x01 /* D4 framing */ - -/* settings for the 'encoding_mode' */ -#define B8ZS_ENCODING 0x00 /* B8ZS encoding */ -#define AMI_ENCODING 0x01 /* AMI encoding */ - -/* settings for the 'line_build_out' */ -#define LN_BLD_CSU_0dB_DSX1_0_to_133 0x00 /* set build out to CSU (0db) or DSX-1 (0-133ft) */ -#define LN_BLD_DSX1_133_to_266 0x01 /* set build out DSX-1 (133-266ft) */ -#define LN_BLD_DSX1_266_to_399 0x02 /* set build out DSX-1 (266-399ft) */ -#define LN_BLD_DSX1_399_to_533 0x03 /* set build out DSX-1 (399-533ft) */ -#define LN_BLD_DSX1_533_to_655 0x04 /* set build out DSX-1 (533-655ft) */ -#define LN_BLD_CSU_NEG_7dB 0x05 /* set build out to CSU (-7.5db) */ -#define LN_BLD_CSU_NEG_15dB 0x06 /* set build out to CSU (-15db) */ -#define LN_BLD_CSU_NEG_22dB 0x07 /* set build out to CSU (-22.5db) */ - -/* settings for the 'channel_base' */ -#define MIN_CHANNEL_BASE_VALUE 1 /* the minimum permitted channel base value */ -#define MAX_CHANNEL_BASE_VALUE 24 /* the maximum permitted channel base value */ - -/* settings for the 'baud_rate_kbps' */ -#define MIN_BAUD_RATE_KBPS 0 /* the minimum permitted baud rate (kbps) */ -#define MAX_BAUD_RATE_KBPS 1536 /* the maximum permitted baud rate (kbps) */ -#define BAUD_RATE_FT1_AUTO_CONFIG 0xFFFF /* the baud rate used to trigger an automatic FT1 configuration */ - -/* settings for the 'clock_mode' */ -#define CLOCK_MODE_NORMAL 0x00 /* clock mode set to normal (slave) */ -#define CLOCK_MODE_MASTER 0x01 /* clock mode set to master */ - - -#define BAUD_RATE_FT1_AUTO_CONFIG 0xFFFF -#define AUTO_FT1_CONFIG_NOT_COMPLETE 0x08 -#define AUTO_FT1_CFG_FAIL_OP_MODE 0x0C -#define AUTO_FT1_CFG_FAIL_INVALID_LINE 0x0D - - -#ifdef _MSC_ -# pragma pack() -#endif -#endif /* _SDLA_CHDLC_H */ diff --git a/include/linux/sdla_ppp.h b/include/linux/sdla_ppp.h deleted file mode 100644 index 6f3923179c2..00000000000 --- a/include/linux/sdla_ppp.h +++ /dev/null @@ -1,575 +0,0 @@ -/***************************************************************************** -* sdla_ppp.h Sangoma PPP firmware API definitions. -* -* Author: Nenad Corbic <ncorbic@sangoma.com> -* -* Copyright: (c) 1995-1997 Sangoma Technologies Inc. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -* ============================================================================ -* Feb 24, 2000 Nenad Corbic v2.1.2 -* Jan 06, 1997 Gene Kozin v2.0 -* Apr 11, 1996 Gene Kozin Initial version. -*****************************************************************************/ -#ifndef _SDLA_PPP_H -#define _SDLA_PPP_H - -/*---------------------------------------------------------------------------- - * Notes: - * ------ - * 1. All structures defined in this file are byte-alined. - * - * Compiler Platform - * -------- -------- - * GNU C Linux - */ - -#ifndef PACKED -# define PACKED __attribute__((packed)) -#endif /* PACKED */ - -/* Adapter memory layout and important constants */ -#define PPP508_MB_VECT 0xE000 /* mailbox window vector */ -#define PPP508_MB_OFFS 0 /* mailbox offset */ -#define PPP508_FLG_OFFS 0x1000 /* status flags offset */ -#define PPP508_BUF_OFFS 0x1100 /* buffer info block offset */ -#define PPP514_MB_OFFS 0xE000 /* mailbox offset */ -#define PPP514_FLG_OFFS 0xF000 /* status flags offset */ -#define PPP514_BUF_OFFS 0xF100 /* buffer info block offset */ - -#define PPP_MAX_DATA 1008 /* command block data buffer length */ - -/****** Data Structures *****************************************************/ - -/*---------------------------------------------------------------------------- - * PPP Command Block. - */ -typedef struct ppp_cmd{ - unsigned char command PACKED; /* command code */ - unsigned short length PACKED; /* length of data buffer */ - unsigned char result PACKED; /* return code */ - unsigned char rsrv[11] PACKED; /* reserved for future use */ -} ppp_cmd_t; - -typedef struct cblock{ - unsigned char opp_flag PACKED; - unsigned char command PACKED; /* command code */ - unsigned short length PACKED; /* length of data buffer */ - unsigned char result PACKED; /* return code */ - unsigned char rsrv[11] PACKED; /* reserved for future use */ -} cblock_t; - -typedef struct ppp_udp_pkt{ - ip_pkt_t ip_pkt PACKED; - udp_pkt_t udp_pkt PACKED; - wp_mgmt_t wp_mgmt PACKED; - cblock_t cblock PACKED; - unsigned char data[MAX_LGTH_UDP_MGNT_PKT] PACKED; -} ppp_udp_pkt_t; - -typedef struct { - unsigned char status PACKED; - unsigned char data_avail PACKED; - unsigned short real_length PACKED; - unsigned short time_stamp PACKED; - unsigned char data[1] PACKED; -} trace_pkt_t; - - -typedef struct { - unsigned char opp_flag PACKED; - unsigned char trace_type PACKED; - unsigned short trace_length PACKED; - unsigned short trace_data_ptr PACKED; - unsigned short trace_time_stamp PACKED; -} trace_element_t; - -/* 'command' field defines */ -#define PPP_READ_CODE_VERSION 0x10 /* configuration commands */ -#define PPP_SET_CONFIG 0x05 -#define PPP_READ_CONFIG 0x06 -#define PPP_SET_INTR_FLAGS 0x20 -#define PPP_READ_INTR_FLAGS 0x21 -#define PPP_SET_INBOUND_AUTH 0x30 -#define PPP_SET_OUTBOUND_AUTH 0x31 -#define PPP_GET_CONNECTION_INFO 0x32 - -#define PPP_COMM_ENABLE 0x03 /* operational commands */ -#define PPP_COMM_DISABLE 0x04 -#define PPP_SEND_SIGN_FRAME 0x23 -#define PPP_READ_SIGN_RESPONSE 0x24 -#define PPP_DATALINE_MONITOR 0x33 - -#define PPP_READ_STATISTICS 0x07 /* statistics commands */ -#define PPP_FLUSH_STATISTICS 0x08 -#define PPP_READ_ERROR_STATS 0x09 -#define PPP_FLUSH_ERROR_STATS 0x0A -#define PPP_READ_PACKET_STATS 0x12 -#define PPP_FLUSH_PACKET_STATS 0x13 -#define PPP_READ_LCP_STATS 0x14 -#define PPP_FLUSH_LCP_STATS 0x15 -#define PPP_READ_LPBK_STATS 0x16 -#define PPP_FLUSH_LPBK_STATS 0x17 -#define PPP_READ_IPCP_STATS 0x18 -#define PPP_FLUSH_IPCP_STATS 0x19 -#define PPP_READ_IPXCP_STATS 0x1A -#define PPP_FLUSH_IPXCP_STATS 0x1B -#define PPP_READ_PAP_STATS 0x1C -#define PPP_FLUSH_PAP_STATS 0x1D -#define PPP_READ_CHAP_STATS 0x1E -#define PPP_FLUSH_CHAP_STATS 0x1F - -/* 'result' field defines */ -#define PPPRES_OK 0x00 /* command executed successfully */ -#define PPPRES_INVALID_STATE 0x09 /* invalid command in this context */ - -/*---------------------------------------------------------------------------- - * PPP Mailbox. - * This structure is located at offset PPP???_MB_OFFS into PPP???_MB_VECT - */ -typedef struct ppp_mbox -{ - unsigned char flag PACKED; /* 00h: command execution flag */ - ppp_cmd_t cmd PACKED; /* 01h: command block */ - unsigned char data[1] PACKED; /* 10h: variable length data buffer */ -} ppp_mbox_t; - -/*---------------------------------------------------------------------------- - * PPP Status Flags. - * This structure is located at offset PPP???_FLG_OFFS into - * PPP???_MB_VECT. - */ -typedef struct ppp_flags -{ - unsigned char iflag PACKED; /* 00: interrupt flag */ - unsigned char imask PACKED; /* 01: interrupt mask */ - unsigned char resrv PACKED; - unsigned char mstatus PACKED; /* 03: modem status */ - unsigned char lcp_state PACKED; /* 04: LCP state */ - unsigned char ppp_phase PACKED; /* 05: PPP phase */ - unsigned char ip_state PACKED; /* 06: IPCP state */ - unsigned char ipx_state PACKED; /* 07: IPXCP state */ - unsigned char pap_state PACKED; /* 08: PAP state */ - unsigned char chap_state PACKED; /* 09: CHAP state */ - unsigned short disc_cause PACKED; /* 0A: disconnection cause */ -} ppp_flags_t; - -/* 'iflag' defines */ -#define PPP_INTR_RXRDY 0x01 /* Rx ready */ -#define PPP_INTR_TXRDY 0x02 /* Tx ready */ -#define PPP_INTR_MODEM 0x04 /* modem status change (DCD, CTS) */ -#define PPP_INTR_CMD 0x08 /* interface command completed */ -#define PPP_INTR_DISC 0x10 /* data link disconnected */ -#define PPP_INTR_OPEN 0x20 /* data link open */ -#define PPP_INTR_DROP_DTR 0x40 /* DTR drop timeout expired */ -#define PPP_INTR_TIMER 0x80 /* timer interrupt */ - - -/* 'mstatus' defines */ -#define PPP_MDM_DCD 0x08 /* mdm_status: DCD */ -#define PPP_MDM_CTS 0x20 /* mdm_status: CTS */ - -/* 'disc_cause' defines */ -#define PPP_LOCAL_TERMINATION 0x0001 /* Local Request by PPP termination phase */ -#define PPP_DCD_CTS_DROP 0x0002 /* DCD and/or CTS dropped. Link down */ -#define PPP_REMOTE_TERMINATION 0x0800 /* Remote Request by PPP termination phase */ - -/* 'misc_config_bits' defines */ -#define DONT_RE_TX_ABORTED_I_FRAMES 0x01 -#define TX_FRM_BYTE_COUNT_STATS 0x02 -#define RX_FRM_BYTE_COUNT_STATS 0x04 -#define TIME_STAMP_IN_RX_FRAMES 0x08 -#define NON_STD_ADPTR_FREQ 0x10 -#define INTERFACE_LEVEL_RS232 0x20 -#define AUTO_LINK_RECOVERY 0x100 -#define DONT_TERMINATE_LNK_MAX_CONFIG 0x200 - -/* 'authentication options' defines */ -#define NO_AUTHENTICATION 0x00 -#define INBOUND_AUTH 0x80 -#define PAP_AUTH 0x01 -#define CHAP_AUTH 0x02 - -/* 'ip options' defines */ -#define L_AND_R_IP_NO_ASSIG 0x00 -#define L_IP_LOCAL_ASSIG 0x01 -#define L_IP_REMOTE_ASSIG 0x02 -#define R_IP_LOCAL_ASSIG 0x04 -#define R_IP_REMOTE_ASSIG 0x08 -#define ENABLE_IP 0x80 - -/* 'ipx options' defines */ -#define ROUTING_PROT_DEFAULT 0x20 -#define ENABLE_IPX 0x80 -#define DISABLE_IPX 0x00 - -/*---------------------------------------------------------------------------- - * PPP Buffer Info. - * This structure is located at offset PPP508_BUF_OFFS into - * PPP508_MB_VECT. - */ -typedef struct ppp508_buf_info -{ - unsigned short txb_num PACKED; /* 00: number of transmit buffers */ - unsigned long txb_ptr PACKED; /* 02: pointer to the buffer ctl. */ - unsigned long txb_nxt PACKED; - unsigned char rsrv1[22] PACKED; - unsigned short rxb_num PACKED; /* 20: number of receive buffers */ - unsigned long rxb_ptr PACKED; /* 22: pointer to the buffer ctl. */ - unsigned long rxb1_ptr PACKED; /* 26: pointer to the first buf.ctl. */ - unsigned long rxb_base PACKED; /* 2A: pointer to the buffer base */ - unsigned char rsrv2[2] PACKED; - unsigned long rxb_end PACKED; /* 30: pointer to the buffer end */ -} ppp508_buf_info_t; - -/*---------------------------------------------------------------------------- - * Transmit/Receive Buffer Control Block. - */ -typedef struct ppp_buf_ctl -{ - unsigned char flag PACKED; /* 00: 'buffer ready' flag */ - unsigned short length PACKED; /* 01: length of data */ - unsigned char reserved1[1] PACKED; /* 03: */ - unsigned char proto PACKED; /* 04: protocol */ - unsigned short timestamp PACKED; /* 05: time stamp (Rx only) */ - unsigned char reserved2[5] PACKED; /* 07: */ - union - { - unsigned short o_p[2]; /* 1C: buffer offset & page (S502) */ - unsigned long ptr; /* 1C: buffer pointer (S508) */ - } buf PACKED; -} ppp_buf_ctl_t; - -/*---------------------------------------------------------------------------- - * S508 Adapter Configuration Block (passed to the PPP_SET_CONFIG command). - */ -typedef struct ppp508_conf -{ - unsigned long line_speed PACKED; /* 00: baud rate, bps */ - unsigned short txbuf_percent PACKED; /* 04: % of Tx buffer */ - unsigned short conf_flags PACKED; /* 06: configuration bits */ - unsigned short mtu_local PACKED; /* 08: local MTU */ - unsigned short mtu_remote PACKED; /* 0A: remote MTU */ - unsigned short restart_tmr PACKED; /* 0C: restart timer */ - unsigned short auth_rsrt_tmr PACKED; /* 0E: authentication timer */ - unsigned short auth_wait_tmr PACKED; /* 10: authentication timer */ - unsigned short mdm_fail_tmr PACKED; /* 12: modem failure timer */ - unsigned short dtr_drop_tmr PACKED; /* 14: DTR drop timer */ - unsigned short connect_tmout PACKED; /* 16: connection timeout */ - unsigned short conf_retry PACKED; /* 18: max. retry */ - unsigned short term_retry PACKED; /* 1A: max. retry */ - unsigned short fail_retry PACKED; /* 1C: max. retry */ - unsigned short auth_retry PACKED; /* 1E: max. retry */ - unsigned char auth_options PACKED; /* 20: authentication opt. */ - unsigned char ip_options PACKED; /* 21: IP options */ - unsigned long ip_local PACKED; /* 22: local IP address */ - unsigned long ip_remote PACKED; /* 26: remote IP address */ - unsigned char ipx_options PACKED; /* 2A: IPX options */ - unsigned char ipx_netno[4] PACKED; /* 2B: IPX net number */ - unsigned char ipx_local[6] PACKED; /* 2F: local IPX node number*/ - unsigned char ipx_remote[6] PACKED; /* 35: remote IPX node num.*/ - unsigned char ipx_router[48] PACKED; /* 3B: IPX router name*/ - unsigned long alt_cpu_clock PACKED; /* 6B: */ -} ppp508_conf_t; - -/*---------------------------------------------------------------------------- - * S508 Adapter Read Connection Information Block - * Returned by the PPP_GET_CONNECTION_INFO command - */ -typedef struct ppp508_connect_info -{ - unsigned short mru PACKED; /* 00-01 Remote Max Rec' Unit */ - unsigned char ip_options PACKED; /* 02: Negotiated ip options */ - unsigned long ip_local PACKED; /* 03-06: local IP address */ - unsigned long ip_remote PACKED; /* 07-0A: remote IP address */ - unsigned char ipx_options PACKED; /* 0B: Negotiated ipx options */ - unsigned char ipx_netno[4] PACKED; /* 0C-0F: IPX net number */ - unsigned char ipx_local[6] PACKED; /* 10-1F: local IPX node # */ - unsigned char ipx_remote[6] PACKED; /* 16-1B: remote IPX node # */ - unsigned char ipx_router[48] PACKED; /* 1C-4B: IPX router name */ - unsigned char auth_status PACKED; /* 4C: Authentication Status */ - unsigned char inbd_auth_peerID[1] PACKED; /* 4D: variable length inbound authenticated peer ID */ -} ppp508_connect_info_t; - -/* 'line_speed' field */ -#define PPP_BITRATE_1200 0x01 -#define PPP_BITRATE_2400 0x02 -#define PPP_BITRATE_4800 0x03 -#define PPP_BITRATE_9600 0x04 -#define PPP_BITRATE_19200 0x05 -#define PPP_BITRATE_38400 0x06 -#define PPP_BITRATE_45000 0x07 -#define PPP_BITRATE_56000 0x08 -#define PPP_BITRATE_64000 0x09 -#define PPP_BITRATE_74000 0x0A -#define PPP_BITRATE_112000 0x0B -#define PPP_BITRATE_128000 0x0C -#define PPP_BITRATE_156000 0x0D - -/* Defines for the 'conf_flags' field */ -#define PPP_IGNORE_TX_ABORT 0x01 /* don't re-transmit aborted frames */ -#define PPP_ENABLE_TX_STATS 0x02 /* enable Tx statistics */ -#define PPP_ENABLE_RX_STATS 0x04 /* enable Rx statistics */ -#define PPP_ENABLE_TIMESTAMP 0x08 /* enable timestamp */ - -/* 'ip_options' defines */ -#define PPP_LOCAL_IP_LOCAL 0x01 -#define PPP_LOCAL_IP_REMOTE 0x02 -#define PPP_REMOTE_IP_LOCAL 0x04 -#define PPP_REMOTE_IP_REMOTE 0x08 - -/* 'ipx_options' defines */ -#define PPP_REMOTE_IPX_NETNO 0x01 -#define PPP_REMOTE_IPX_LOCAL 0x02 -#define PPP_REMOTE_IPX_REMOTE 0x04 -#define PPP_IPX_ROUTE_RIP_SAP 0x08 -#define PPP_IPX_ROUTE_NLSP 0x10 -#define PPP_IPX_ROUTE_DEFAULT 0x20 -#define PPP_IPX_CONF_COMPLETE 0x40 -#define PPP_IPX_ENABLE 0x80 - -/*---------------------------------------------------------------------------- - * S508 Adapter Configuration Block (returned by the PPP_READ_CONFIG command). - */ -typedef struct ppp508_get_conf -{ - unsigned long bps PACKED; /* 00: baud rate, bps */ - ppp508_conf_t conf PACKED; /* 04: requested config. */ - unsigned short txb_num PACKED; /* 6F: number of Tx buffers */ - unsigned short rxb_num PACKED; /* 71: number of Rx buffers */ -} ppp508_get_conf_t; - -/*---------------------------------------------------------------------------- - * S508 Operational Statistics (returned by the PPP_READ_STATISTIC command). - */ -typedef struct ppp508_stats -{ - unsigned short reserved1 PACKED; /* 00: */ - unsigned short rx_bad_len PACKED; /* 02: */ - unsigned short reserved2 PACKED; /* 04: */ - unsigned long tx_frames PACKED; /* 06: */ - unsigned long tx_bytes PACKED; /* 0A: */ - unsigned long rx_frames PACKED; /* 0E: */ - unsigned long rx_bytes PACKED; /* 12: */ -} ppp508_stats_t; - -/*---------------------------------------------------------------------------- - * Adapter Error Statistics (returned by the PPP_READ_ERROR_STATS command). - */ -typedef struct ppp_err_stats -{ - unsigned char rx_overrun PACKED; /* 00: Rx overrun errors */ - unsigned char rx_bad_crc PACKED; /* 01: Rx CRC errors */ - unsigned char rx_abort PACKED; /* 02: Rx aborted frames */ - unsigned char rx_lost PACKED; /* 03: Rx frames lost */ - unsigned char tx_abort PACKED; /* 04: Tx aborted frames */ - unsigned char tx_underrun PACKED; /* 05: Tx underrun errors */ - unsigned char tx_missed_intr PACKED; /* 06: Tx underruns missed */ - unsigned char reserved PACKED; /* 07: Tx underruns missed */ - unsigned char dcd_trans PACKED; /* 08: DCD transitions */ - unsigned char cts_trans PACKED; /* 09: CTS transitions */ -} ppp_err_stats_t; - -/*---------------------------------------------------------------------------- - * Packet Statistics (returned by the PPP_READ_PACKET_STATS command). - */ -typedef struct ppp_pkt_stats -{ - unsigned short rx_bad_header PACKED; /* 00: */ - unsigned short rx_prot_unknwn PACKED; /* 02: */ - unsigned short rx_too_large PACKED; /* 04: */ - unsigned short rx_lcp PACKED; /* 06: */ - unsigned short tx_lcp PACKED; /* 08: */ - unsigned short rx_ipcp PACKED; /* 0A: */ - unsigned short tx_ipcp PACKED; /* 0C: */ - unsigned short rx_ipxcp PACKED; /* 0E: */ - unsigned short tx_ipxcp PACKED; /* 10: */ - unsigned short rx_pap PACKED; /* 12: */ - unsigned short tx_pap PACKED; /* 14: */ - unsigned short rx_chap PACKED; /* 16: */ - unsigned short tx_chap PACKED; /* 18: */ - unsigned short rx_lqr PACKED; /* 1A: */ - unsigned short tx_lqr PACKED; /* 1C: */ - unsigned short rx_ip PACKED; /* 1E: */ - unsigned short tx_ip PACKED; /* 20: */ - unsigned short rx_ipx PACKED; /* 22: */ - unsigned short tx_ipx PACKED; /* 24: */ -} ppp_pkt_stats_t; - -/*---------------------------------------------------------------------------- - * LCP Statistics (returned by the PPP_READ_LCP_STATS command). - */ -typedef struct ppp_lcp_stats -{ - unsigned short rx_unknown PACKED; /* 00: unknown LCP type */ - unsigned short rx_conf_rqst PACKED; /* 02: Configure-Request */ - unsigned short rx_conf_ack PACKED; /* 04: Configure-Ack */ - unsigned short rx_conf_nak PACKED; /* 06: Configure-Nak */ - unsigned short rx_conf_rej PACKED; /* 08: Configure-Reject */ - unsigned short rx_term_rqst PACKED; /* 0A: Terminate-Request */ - unsigned short rx_term_ack PACKED; /* 0C: Terminate-Ack */ - unsigned short rx_code_rej PACKED; /* 0E: Code-Reject */ - unsigned short rx_proto_rej PACKED; /* 10: Protocol-Reject */ - unsigned short rx_echo_rqst PACKED; /* 12: Echo-Request */ - unsigned short rx_echo_reply PACKED; /* 14: Echo-Reply */ - unsigned short rx_disc_rqst PACKED; /* 16: Discard-Request */ - unsigned short tx_conf_rqst PACKED; /* 18: Configure-Request */ - unsigned short tx_conf_ack PACKED; /* 1A: Configure-Ack */ - unsigned short tx_conf_nak PACKED; /* 1C: Configure-Nak */ - unsigned short tx_conf_rej PACKED; /* 1E: Configure-Reject */ - unsigned short tx_term_rqst PACKED; /* 20: Terminate-Request */ - unsigned short tx_term_ack PACKED; /* 22: Terminate-Ack */ - unsigned short tx_code_rej PACKED; /* 24: Code-Reject */ - unsigned short tx_proto_rej PACKED; /* 26: Protocol-Reject */ - unsigned short tx_echo_rqst PACKED; /* 28: Echo-Request */ - unsigned short tx_echo_reply PACKED; /* 2A: Echo-Reply */ - unsigned short tx_disc_rqst PACKED; /* 2E: Discard-Request */ - unsigned short rx_too_large PACKED; /* 30: packets too large */ - unsigned short rx_ack_inval PACKED; /* 32: invalid Conf-Ack */ - unsigned short rx_rej_inval PACKED; /* 34: invalid Conf-Reject */ - unsigned short rx_rej_badid PACKED; /* 36: Conf-Reject w/bad ID */ -} ppp_lcp_stats_t; - -/*---------------------------------------------------------------------------- - * Loopback Error Statistics (returned by the PPP_READ_LPBK_STATS command). - */ -typedef struct ppp_lpbk_stats -{ - unsigned short conf_magic PACKED; /* 00: */ - unsigned short loc_echo_rqst PACKED; /* 02: */ - unsigned short rem_echo_rqst PACKED; /* 04: */ - unsigned short loc_echo_reply PACKED; /* 06: */ - unsigned short rem_echo_reply PACKED; /* 08: */ - unsigned short loc_disc_rqst PACKED; /* 0A: */ - unsigned short rem_disc_rqst PACKED; /* 0C: */ - unsigned short echo_tx_collsn PACKED; /* 0E: */ - unsigned short echo_rx_collsn PACKED; /* 10: */ -} ppp_lpbk_stats_t; - -/*---------------------------------------------------------------------------- - * Protocol Statistics (returned by the PPP_READ_IPCP_STATS and - * PPP_READ_IPXCP_STATS commands). - */ -typedef struct ppp_prot_stats -{ - unsigned short rx_unknown PACKED; /* 00: unknown type */ - unsigned short rx_conf_rqst PACKED; /* 02: Configure-Request */ - unsigned short rx_conf_ack PACKED; /* 04: Configure-Ack */ - unsigned short rx_conf_nak PACKED; /* 06: Configure-Nak */ - unsigned short rx_conf_rej PACKED; /* 08: Configure-Reject */ - unsigned short rx_term_rqst PACKED; /* 0A: Terminate-Request */ - unsigned short rx_term_ack PACKED; /* 0C: Terminate-Ack */ - unsigned short rx_code_rej PACKED; /* 0E: Code-Reject */ - unsigned short reserved PACKED; /* 10: */ - unsigned short tx_conf_rqst PACKED; /* 12: Configure-Request */ - unsigned short tx_conf_ack PACKED; /* 14: Configure-Ack */ - unsigned short tx_conf_nak PACKED; /* 16: Configure-Nak */ - unsigned short tx_conf_rej PACKED; /* 18: Configure-Reject */ - unsigned short tx_term_rqst PACKED; /* 1A: Terminate-Request */ - unsigned short tx_term_ack PACKED; /* 1C: Terminate-Ack */ - unsigned short tx_code_rej PACKED; /* 1E: Code-Reject */ - unsigned short rx_too_large PACKED; /* 20: packets too large */ - unsigned short rx_ack_inval PACKED; /* 22: invalid Conf-Ack */ - unsigned short rx_rej_inval PACKED; /* 24: invalid Conf-Reject */ - unsigned short rx_rej_badid PACKED; /* 26: Conf-Reject w/bad ID */ -} ppp_prot_stats_t; - -/*---------------------------------------------------------------------------- - * PAP Statistics (returned by the PPP_READ_PAP_STATS command). - */ -typedef struct ppp_pap_stats -{ - unsigned short rx_unknown PACKED; /* 00: unknown type */ - unsigned short rx_auth_rqst PACKED; /* 02: Authenticate-Request */ - unsigned short rx_auth_ack PACKED; /* 04: Authenticate-Ack */ - unsigned short rx_auth_nak PACKED; /* 06: Authenticate-Nak */ - unsigned short reserved PACKED; /* 08: */ - unsigned short tx_auth_rqst PACKED; /* 0A: Authenticate-Request */ - unsigned short tx_auth_ack PACKED; /* 0C: Authenticate-Ack */ - unsigned short tx_auth_nak PACKED; /* 0E: Authenticate-Nak */ - unsigned short rx_too_large PACKED; /* 10: packets too large */ - unsigned short rx_bad_peerid PACKED; /* 12: invalid peer ID */ - unsigned short rx_bad_passwd PACKED; /* 14: invalid password */ -} ppp_pap_stats_t; - -/*---------------------------------------------------------------------------- - * CHAP Statistics (returned by the PPP_READ_CHAP_STATS command). - */ -typedef struct ppp_chap_stats -{ - unsigned short rx_unknown PACKED; /* 00: unknown type */ - unsigned short rx_challenge PACKED; /* 02: Authenticate-Request */ - unsigned short rx_response PACKED; /* 04: Authenticate-Ack */ - unsigned short rx_success PACKED; /* 06: Authenticate-Nak */ - unsigned short rx_failure PACKED; /* 08: Authenticate-Nak */ - unsigned short reserved PACKED; /* 0A: */ - unsigned short tx_challenge PACKED; /* 0C: Authenticate-Request */ - unsigned short tx_response PACKED; /* 0E: Authenticate-Ack */ - unsigned short tx_success PACKED; /* 10: Authenticate-Nak */ - unsigned short tx_failure PACKED; /* 12: Authenticate-Nak */ - unsigned short rx_too_large PACKED; /* 14: packets too large */ - unsigned short rx_bad_peerid PACKED; /* 16: invalid peer ID */ - unsigned short rx_bad_passwd PACKED; /* 18: invalid password */ - unsigned short rx_bad_md5 PACKED; /* 1A: invalid MD5 format */ - unsigned short rx_bad_resp PACKED; /* 1C: invalid response */ -} ppp_chap_stats_t; - -/*---------------------------------------------------------------------------- - * Connection Information (returned by the PPP_GET_CONNECTION_INFO command). - */ -typedef struct ppp_conn_info -{ - unsigned short remote_mru PACKED; /* 00: */ - unsigned char ip_options PACKED; /* 02: */ - unsigned char ip_local[4] PACKED; /* 03: */ - unsigned char ip_remote[4] PACKED; /* 07: */ - unsigned char ipx_options PACKED; /* 0B: */ - unsigned char ipx_network[4] PACKED; /* 0C: */ - unsigned char ipx_local[6] PACKED; /* 10: */ - unsigned char ipx_remote[6] PACKED; /* 16: */ - unsigned char ipx_router[48] PACKED; /* 1C: */ - unsigned char auth_status PACKED; /* 4C: */ - unsigned char peer_id[0] PACKED; /* 4D: */ -} ppp_conn_info_t; - -/* Data structure for SET_TRIGGER_INTR command - */ - -typedef struct ppp_intr_info{ - unsigned char i_enable PACKED; /* 0 Interrupt enable bits */ - unsigned char irq PACKED; /* 1 Irq number */ - unsigned short timer_len PACKED; /* 2 Timer delay */ -} ppp_intr_info_t; - - -#define FT1_MONITOR_STATUS_CTRL 0x80 -#define SET_FT1_MODE 0x81 - - - -/* Special UDP drivers management commands */ -#define PPIPE_ENABLE_TRACING 0x20 -#define PPIPE_DISABLE_TRACING 0x21 -#define PPIPE_GET_TRACE_INFO 0x22 -#define PPIPE_GET_IBA_DATA 0x23 -#define PPIPE_KILL_BOARD 0x24 -#define PPIPE_FT1_READ_STATUS 0x25 -#define PPIPE_DRIVER_STAT_IFSEND 0x26 -#define PPIPE_DRIVER_STAT_INTR 0x27 -#define PPIPE_DRIVER_STAT_GEN 0x28 -#define PPIPE_FLUSH_DRIVER_STATS 0x29 -#define PPIPE_ROUTER_UP_TIME 0x30 - -#define DISABLE_TRACING 0x00 -#define TRACE_SIGNALLING_FRAMES 0x01 -#define TRACE_DATA_FRAMES 0x02 - - - -#ifdef _MSC_ -# pragma pack() -#endif -#endif /* _SDLA_PPP_H */ diff --git a/include/linux/sdla_x25.h b/include/linux/sdla_x25.h deleted file mode 100644 index 57db980e27a..00000000000 --- a/include/linux/sdla_x25.h +++ /dev/null @@ -1,772 +0,0 @@ -/***************************************************************************** -* sdla_x25.h Sangoma X.25 firmware API definitions. -* -* Author: Nenad Corbic <ncorbic@sangoma.com> -* -* Copyright: (c) 1995-2000 Sangoma Technologies Inc. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. -* ============================================================================ -* Feb 28, 2000 Nenad Corbic Updated for socket based x25api -* Dec 13, 1996 Gene Kozin Initial version -*****************************************************************************/ -#ifndef _SDLA_X25_H -#define _SDLA_X25_H - -/*---------------------------------------------------------------------------- - * Notes: - * ------ - * 1. All structures defined in this file are byte-alined. - * Compiler Platform - * -------- -------- - * GNU C Linux - * - */ - -#ifndef PACKED -# define PACKED __attribute__((packed)) -#endif /* PACKED */ - -/****** CONSTANTS DEFINITIONS ***********************************************/ - -#define X25_MAX_CHAN 255 /* max number of open X.25 circuits */ -#define X25_MAX_DATA 1024 /* max length of X.25 data buffer */ -/* - * X.25 shared memory layout. - */ -#define X25_MBOX_OFFS 0x16B0 /* general mailbox block */ -#define X25_RXMBOX_OFFS 0x1AD0 /* receive mailbox */ -#define X25_STATUS_OFFS 0x1EF0 /* X.25 status structure */ -#define X25_MB_VECTOR 0xE000 /* S514 mailbox window vecotr */ -#define X25_MISC_HDLC_BITS 0x1F00 /*X.25 miscallaneous HDLC bits */ - -/* code levels */ -#define HDLC_LEVEL 0x01 -#define X25_LEVEL 0x02 -#define X25_AND_HDLC_LEVEL 0x03 -#define DO_HDLC_LEVEL_ERROR_CHECKING 0x04 - -/****** DATA STRUCTURES *****************************************************/ - -/*---------------------------------------------------------------------------- - * X.25 Command Block. - */ -typedef struct X25Cmd -{ - unsigned char command PACKED; /* command code */ - unsigned short length PACKED; /* transfer data length */ - unsigned char result PACKED; /* return code */ - unsigned char pf PACKED; /* P/F bit */ - unsigned short lcn PACKED; /* logical channel */ - unsigned char qdm PACKED; /* Q/D/M bits */ - unsigned char cause PACKED; /* cause field */ - unsigned char diagn PACKED; /* diagnostics */ - unsigned char pktType PACKED; /* packet type */ - unsigned char resrv[4] PACKED; /* reserved */ -} TX25Cmd; - -/* - * Defines for the 'command' field. - */ -/*----- General commands --------------*/ -#define X25_SET_GLOBAL_VARS 0x0B /* set global variables */ -#define X25_READ_MODEM_STATUS 0x0C /* read modem status */ -#define X25_READ_CODE_VERSION 0x15 /* read firmware version number */ -#define X25_TRACE_CONFIGURE 0x14 /* configure trace facility */ -#define X25_READ_TRACE_DATA 0x16 /* read trace data */ -#define X25_SET_INTERRUPT_MODE 0x17 /* set interrupt generation mode */ -#define X25_READ_INTERRUPT_MODE 0x18 /* read interrupt generation mode */ -/*----- HDLC-level commands -----------*/ -#define X25_HDLC_LINK_CONFIGURE 0x01 /* configure HDLC link level */ -#define X25_HDLC_LINK_OPEN 0x02 /* open HDLC link */ -#define X25_HDLC_LINK_CLOSE 0x03 /* close HDLC link */ -#define X25_HDLC_LINK_SETUP 0x04 /* set up HDLC link */ -#define X25_HDLC_LINK_DISC 0x05 /* disconnect DHLC link */ -#define X25_HDLC_LINK_STATUS 0x06 /* read DHLC link status */ -#define X25_HDLC_READ_STATS 0x07 /* read operational statistics */ -#define X25_HDLC_FLUSH_STATS 0x08 /* flush operational statistics */ -#define X25_HDLC_READ_COMM_ERR 0x09 /* read error statistics */ -#define X25_HDLC_FLUSH_COMM_ERR 0x0A /* flush error statistics */ -#define X25_HDLC_FLUSH_BUFFERS 0x0D /* flush HDLC-level data buffers */ -#define X25_HDLC_SPRVS_CNT_STAT 0x0F /* read surervisory count status */ -#define X25_HDLC_SEND_UI_FRAME 0x10 /* send unnumbered information frame */ -#define X25_HDLC_WRITE 0x11 /* send HDLC information frame */ -#define X25_HDLC_READ 0x21 /* read HDLC information frame */ -#define X25_HDLC_READ_CONFIG 0x12 /* read HDLC configuration */ -#define X25_HDLC_SET_CONFIG 0x13 /* set HDLC configuration */ -#define SET_PROTOCOL_LEVEL 0x1F /* set protocol level */ -/*----- X.25-level commands -----------*/ -#define X25_READ 0x22 /* read X.25 packet */ -#define X25_WRITE 0x23 /* send X.25 packet */ -#define X25_PLACE_CALL 0x30 /* place a call on SVC */ -#define X25_ACCEPT_CALL 0x31 /* accept incomming call */ -#define X25_CLEAR_CALL 0x32 /* clear call */ -#define X25_CLEAR_CONFRM 0x33 /* send clear confirmation packet */ -#define X25_RESET 0x34 /* send reset request packet */ -#define X25_RESET_CONFRM 0x35 /* send reset confirmation packet */ -#define X25_RESTART 0x36 /* send restart request packet */ -#define X25_RESTART_CONFRM 0x37 /* send restart confirmation packet */ -#define X25_INTERRUPT 0x38 /* send interrupt request packet */ -#define X25_INTERRUPT_CONFRM 0x39 /* send interrupt confirmation pkt */ -#define X25_REGISTRATION_RQST 0x3A /* send registration request packet */ -#define X25_REGISTRATION_CONFRM 0x3B /* send registration confirmation */ -#define X25_IS_DATA_AVAILABLE 0x40 /* querry receive queue */ -#define X25_INCOMMING_CALL_CTL 0x41 /* select incomming call options */ -#define X25_CONFIGURE_PVC 0x42 /* configure PVC */ -#define X25_GET_ACTIVE_CHANNELS 0x43 /* get a list of active circuits */ -#define X25_READ_CHANNEL_CONFIG 0x44 /* read virt. circuit configuration */ -#define X25_FLUSH_DATA_BUFFERS 0x45 /* flush X.25-level data buffers */ -#define X25_READ_HISTORY_TABLE 0x46 /* read asynchronous event log */ -#define X25_HISTORY_TABLE_CTL 0x47 /* control asynchronous event log */ -#define X25_GET_TX_D_BIT_STATUS 0x48 /* is packet with D-bit acknowleged */ -#define X25_READ_STATISTICS 0x49 /* read X.25-level statistics */ -#define X25_FLUSH_STATISTICS 0x4A /* flush X.25-level statistics */ -#define X25_READ_CONFIGURATION 0x50 /* read HDLC & X.25 configuration */ -#define X25_SET_CONFIGURATION 0x51 /* set HDLC & X.25 configuration */ - -/* - * Defines for the 'result' field. - */ -/*----- General results ---------------*/ -#define X25RES_OK 0x00 -#define X25RES_ERROR 0x01 -#define X25RES_LINK_NOT_IN_ABM 0x02 /* link is not in ABM mode */ -#define X25RES_LINK_CLOSED 0x03 -#define X25RES_INVAL_LENGTH 0x04 -#define X25RES_INVAL_CMD 0x05 -#define X25RES_UNNUMBERED_FRAME 0x06 /* unnunbered frame received */ -#define X25RES_FRM_REJECT_MODE 0x07 /* link is in Frame Reject mode */ -#define X25RES_MODEM_FAILURE 0x08 /* DCD and/or CTS dropped */ -#define X25RES_N2_RETRY_LIMIT 0x09 /* N2 retry limit has been exceeded */ -#define X25RES_INVAL_LCN 0x30 /* invalid logical channel number */ -#define X25RES_INVAL_STATE 0x31 /* channel is not in data xfer mode */ -#define X25RES_INVAL_DATA_LEN 0x32 /* invalid data length */ -#define X25RES_NOT_READY 0x33 /* no data available / buffers full */ -#define X25RES_NETWORK_DOWN 0x34 -#define X25RES_CHANNEL_IN_USE 0x35 /* there is data queued on this LCN */ -#define X25RES_REGST_NOT_SUPPRT 0x36 /* registration not supported */ -#define X25RES_INVAL_FORMAT 0x37 /* invalid packet format */ -#define X25RES_D_BIT_NOT_SUPPRT 0x38 /* D-bit pragmatics not supported */ -#define X25RES_FACIL_NOT_SUPPRT 0x39 /* Call facility not supported */ -#define X25RES_INVAL_CALL_ARG 0x3A /* errorneous call arguments */ -#define X25RES_INVAL_CALL_DATA 0x3B /* errorneous call user data */ -#define X25RES_ASYNC_PACKET 0x40 /* asynchronous packet received */ -#define X25RES_PROTO_VIOLATION 0x41 /* protocol violation occurred */ -#define X25RES_PKT_TIMEOUT 0x42 /* X.25 packet time out */ -#define X25RES_PKT_RETRY_LIMIT 0x43 /* X.25 packet retry limit exceeded */ -/*----- Command-dependent results -----*/ -#define X25RES_LINK_DISC 0x00 /* HDLC_LINK_STATUS */ -#define X25RES_LINK_IN_ABM 0x01 /* HDLC_LINK_STATUS */ -#define X25RES_NO_DATA 0x01 /* HDLC_READ/READ_TRACE_DATA*/ -#define X25RES_TRACE_INACTIVE 0x02 /* READ_TRACE_DATA */ -#define X25RES_LINK_IS_OPEN 0x01 /* HDLC_LINK_OPEN */ -#define X25RES_LINK_IS_DISC 0x02 /* HDLC_LINK_DISC */ -#define X25RES_LINK_IS_CLOSED 0x03 /* HDLC_LINK_CLOSE */ -#define X25RES_INVAL_PARAM 0x31 /* INCOMMING_CALL_CTL */ -#define X25RES_INVAL_CONFIG 0x35 /* REGISTR_RQST/CONFRM */ - -/* - * Defines for the 'qdm_bits' field. - */ -#define X25CMD_Q_BIT_MASK 0x04 -#define X25CMD_D_BIT_MASK 0x02 -#define X25CMD_M_BIT_MASK 0x01 - -/* - * Defines for the 'pkt_type' field. - */ -/*----- Asynchronous events ------*/ -#define ASE_CLEAR_RQST 0x02 -#define ASE_RESET_RQST 0x04 -#define ASE_RESTART_RQST 0x08 -#define ASE_INTERRUPT 0x10 -#define ASE_DTE_REGISTR_RQST 0x20 -#define ASE_CALL_RQST 0x30 -#define ASE_CALL_ACCEPTED 0x31 -#define ASE_CLEAR_CONFRM 0x32 -#define ASE_RESET_CONFRM 0x33 -#define ASE_RESTART_CONFRM 0x34 -#define ASE_INTERRUPT_CONFRM 0x35 -#define ASE_DCE_REGISTR_CONFRM 0x36 -#define ASE_DIAGNOSTIC 0x37 -#define ASE_CALL_AUTO_CLEAR 0x38 -#define AUTO_RESPONSE_FLAG 0x80 -/*----- Time-Out events ----------*/ -#define TOE_RESTART_RQST 0x03 -#define TOE_CALL_RQST 0x05 -#define TOE_CLEAR_RQST 0x08 -#define TOE_RESET_RQST 0x0A -/*----- Protocol Violation events */ -#define PVE_CLEAR_RQST 0x32 -#define PVE_RESET_RQST 0x33 -#define PVE_RESTART_RQST 0x34 -#define PVE_DIAGNOSTIC 0x37 - -#define INTR_ON_RX_FRAME 0x01 -#define INTR_ON_TX_FRAME 0x02 -#define INTR_ON_MODEM_STATUS_CHANGE 0x04 -#define INTR_ON_COMMAND_COMPLETE 0x08 -#define INTR_ON_X25_ASY_TRANSACTION 0x10 -#define INTR_ON_TIMER 0x40 -#define DIRECT_RX_INTR_USAGE 0x80 - -#define NO_INTR_PENDING 0x00 -#define RX_INTR_PENDING 0x01 -#define TX_INTR_PENDING 0x02 -#define MODEM_INTR_PENDING 0x04 -#define COMMAND_COMPLETE_INTR_PENDING 0x08 -#define X25_ASY_TRANS_INTR_PENDING 0x10 -#define TIMER_INTR_PENDING 0x40 - -/*---------------------------------------------------------------------------- - * X.25 Mailbox. - * This structure is located at offsets X25_MBOX_OFFS and X25_RXMBOX_OFFS - * into shared memory window. - */ -typedef struct X25Mbox -{ - unsigned char opflag PACKED; /* 00h: execution flag */ - TX25Cmd cmd PACKED; /* 01h: command block */ - unsigned char data[1] PACKED; /* 10h: data buffer */ -} TX25Mbox; - -/*---------------------------------------------------------------------------- - * X.25 Time Stamp Structure. - */ -typedef struct X25TimeStamp -{ - unsigned char month PACKED; - unsigned char date PACKED; - unsigned char sec PACKED; - unsigned char min PACKED; - unsigned char hour PACKED; -} TX25TimeStamp; - -/*---------------------------------------------------------------------------- - * X.25 Status Block. - * This structure is located at offset X25_STATUS_OFF into shared memory - * window. - */ -typedef struct X25Status -{ - unsigned short pvc_map PACKED; /* 00h: PVC map */ - unsigned short icc_map PACKED; /* 02h: Incomming Chan. map */ - unsigned short twc_map PACKED; /* 04h: Two-way Cnan. map */ - unsigned short ogc_map PACKED; /* 06h: Outgoing Chan. map */ - TX25TimeStamp tstamp PACKED; /* 08h: timestamp (BCD) */ - unsigned char iflags PACKED; /* 0Dh: interrupt flags */ - unsigned char imask PACKED; /* 0Eh: interrupt mask */ - unsigned char resrv PACKED; /* 0Eh: */ - unsigned char gflags PACKED; /* 10h: misc. HDLC/X25 flags */ - unsigned char cflags[X25_MAX_CHAN] PACKED; /* channel status bytes */ -} TX25Status; - -/* - * Bitmasks for the 'iflags' field. - */ -#define X25_RX_INTR 0x01 /* receive interrupt */ -#define X25_TX_INTR 0x02 /* transmit interrupt */ -#define X25_MODEM_INTR 0x04 /* modem status interrupt (CTS/DCD) */ -#define X25_EVENT_INTR 0x10 /* asyncronous event encountered */ -#define X25_CMD_INTR 0x08 /* interface command complete */ - -/* - * Bitmasks for the 'gflags' field. - */ -#define X25_HDLC_ABM 0x01 /* HDLC is in ABM mode */ -#define X25_RX_READY 0x02 /* X.25 data available */ -#define X25_TRACE_READY 0x08 /* trace data available */ -#define X25_EVENT_IND 0x20 /* asynchronous event indicator */ -#define X25_TX_READY 0x40 /* space is available in Tx buf.*/ - -/* - * Bitmasks for the 'cflags' field. - */ -#define X25_XFER_MODE 0x80 /* channel is in data transfer mode */ -#define X25_TXWIN_OPEN 0x40 /* transmit window open */ -#define X25_RXBUF_MASK 0x3F /* number of data buffers available */ - -/***************************************************************************** - * Following definitions structurize contents of the TX25Mbox.data field for - * different X.25 interface commands. - ****************************************************************************/ - -/* --------------------------------------------------------------------------- - * X25_SET_GLOBAL_VARS Command. - */ -typedef struct X25GlobalVars -{ - unsigned char resrv PACKED; /* 00h: reserved */ - unsigned char dtrCtl PACKED; /* 01h: DTR control code */ - unsigned char resErr PACKED; /* 01h: '1' - reset modem error */ -} TX25GlobalVars; - -/* - * Defines for the 'dtrCtl' field. - */ -#define X25_RAISE_DTR 0x01 -#define X25_DROP_DTR 0x02 - -/* --------------------------------------------------------------------------- - * X25_READ_MODEM_STATUS Command. - */ -typedef struct X25ModemStatus -{ - unsigned char status PACKED; /* 00h: modem status */ -} TX25ModemStatus; - -/* - * Defines for the 'status' field. - */ -#define X25_CTS_MASK 0x20 -#define X25_DCD_MASK 0x08 - -/* --------------------------------------------------------------------------- - * X25_HDLC_LINK_STATUS Command. - */ -typedef struct X25LinkStatus -{ - unsigned char txQueued PACKED; /* 00h: queued Tx I-frames*/ - unsigned char rxQueued PACKED; /* 01h: queued Rx I-frames*/ - unsigned char station PACKED; /* 02h: DTE/DCE config. */ - unsigned char reserved PACKED; /* 03h: reserved */ - unsigned char sfTally PACKED; /* 04h: supervisory frame tally */ -} TX25LinkStatus; - -/* - * Defines for the 'station' field. - */ -#define X25_STATION_DTE 0x01 /* station configured as DTE */ -#define X25_STATION_DCE 0x02 /* station configured as DCE */ - -/* --------------------------------------------------------------------------- - * X25_HDLC_READ_STATS Command. - */ -typedef struct HdlcStats -{ /* a number of ... */ - unsigned short rxIFrames PACKED; /* 00h: ready Rx I-frames */ - unsigned short rxNoseq PACKED; /* 02h: frms out-of-sequence */ - unsigned short rxNodata PACKED; /* 04h: I-frms without data */ - unsigned short rxDiscarded PACKED; /* 06h: discarded frames */ - unsigned short rxTooLong PACKED; /* 08h: frames too long */ - unsigned short rxBadAddr PACKED; /* 0Ah: frms with inval.addr*/ - unsigned short txAcked PACKED; /* 0Ch: acknowledged I-frms */ - unsigned short txRetransm PACKED; /* 0Eh: re-transmit. I-frms */ - unsigned short t1Timeout PACKED; /* 10h: T1 timeouts */ - unsigned short rxSABM PACKED; /* 12h: received SABM frames */ - unsigned short rxDISC PACKED; /* 14h: received DISC frames */ - unsigned short rxDM PACKED; /* 16h: received DM frames */ - unsigned short rxFRMR PACKED; /* 18h: FRMR frames received */ - unsigned short txSABM PACKED; /* 1Ah: transm. SABM frames*/ - unsigned short txDISC PACKED; /* 1Ch: transm. DISC frames*/ - unsigned short txDM PACKED; /* 1Eh: transm. DM frames */ - unsigned short txFRMR PACKED; /* 20h: transm. FRMR frames*/ -} THdlcStats; - -/* --------------------------------------------------------------------------- - * X25_HDLC_READ_COMM_ERR Command. - */ -typedef struct HdlcCommErr -{ /* a number of ... */ - unsigned char rxOverrun PACKED; /* 00h: Rx overrun errors */ - unsigned char rxBadCrc PACKED; /* 01h: Rx CRC errors */ - unsigned char rxAborted PACKED; /* 02h: Rx aborted frames */ - unsigned char rxDropped PACKED; /* 03h: frames lost */ - unsigned char txAborted PACKED; /* 04h: Tx aborted frames */ - unsigned char txUnderrun PACKED; /* 05h: Tx underrun errors */ - unsigned char txMissIntr PACKED; /* 06h: missed underrun ints */ - unsigned char reserved PACKED; /* 07h: reserved */ - unsigned char droppedDCD PACKED; /* 08h: times DCD dropped */ - unsigned char droppedCTS PACKED; /* 09h: times CTS dropped */ -} THdlcCommErr; - -/* --------------------------------------------------------------------------- - * X25_SET_CONFIGURATION & X25_READ_CONFIGURATION Commands. - */ -typedef struct X25Config -{ -unsigned char baudRate PACKED; /* 00h: */ - unsigned char t1 PACKED; /* 01h: */ - unsigned char t2 PACKED; /* 02h: */ - unsigned char n2 PACKED; /* 03h: */ - unsigned short hdlcMTU PACKED; /* 04h: */ - unsigned char hdlcWindow PACKED; /* 06h: */ - unsigned char t4 PACKED; /* 07h: */ - unsigned char autoModem PACKED; /* 08h: */ - unsigned char autoHdlc PACKED; /* 09h: */ - unsigned char hdlcOptions PACKED; /* 0Ah: */ - unsigned char station PACKED; /* 0Bh: */ - unsigned char pktWindow PACKED; /* 0Ch: */ - unsigned short defPktSize PACKED; /* 0Dh: */ - unsigned short pktMTU PACKED; /* 0Fh: */ - unsigned short loPVC PACKED; /* 11h: */ - unsigned short hiPVC PACKED; /* 13h: */ - unsigned short loIncommingSVC PACKED; /* 15h: */ - unsigned short hiIncommingSVC PACKED; /* 17h: */ - unsigned short loTwoWaySVC PACKED; /* 19h: */ - unsigned short hiTwoWaySVC PACKED; /* 1Bh: */ - unsigned short loOutgoingSVC PACKED; /* 1Dh: */ - unsigned short hiOutgoingSVC PACKED; /* 1Fh: */ - unsigned short options PACKED; /* 21h: */ - unsigned char responseOpt PACKED; /* 23h: */ - unsigned short facil1 PACKED; /* 24h: */ - unsigned short facil2 PACKED; /* 26h: */ - unsigned short ccittFacil PACKED; /* 28h: */ - unsigned short otherFacil PACKED; /* 2Ah: */ - unsigned short ccittCompat PACKED; /* 2Ch: */ - unsigned char t10t20 PACKED; /* 2Eh: */ - unsigned char t11t21 PACKED; /* 2Fh: */ - unsigned char t12t22 PACKED; /* 30h: */ - unsigned char t13t23 PACKED; /* 31h: */ - unsigned char t16t26 PACKED; /* 32H: */ - unsigned char t28 PACKED; /* 33h: */ - unsigned char r10r20 PACKED; /* 34h: */ - unsigned char r12r22 PACKED; /* 35h: */ - unsigned char r13r23 PACKED; /* 36h: */ -} TX25Config; - -/* --------------------------------------------------------------------------- - * X25_READ_CHANNEL_CONFIG Command. - */ -typedef struct X25ChanAlloc /*----- Channel allocation -*/ -{ - unsigned short loPVC PACKED; /* 00h: lowest PVC number */ - unsigned short hiPVC PACKED; /* 02h: highest PVC number */ - unsigned short loIncommingSVC PACKED; /* 04h: lowest incoming SVC */ - unsigned short hiIncommingSVC PACKED; /* 06h: highest incoming SVC */ - unsigned short loTwoWaySVC PACKED; /* 08h: lowest two-way SVC */ - unsigned short hiTwoWaySVC PACKED; /* 0Ah: highest two-way SVC */ - unsigned short loOutgoingSVC PACKED; /* 0Ch: lowest outgoing SVC */ - unsigned short hiOutgoingSVC PACKED; /* 0Eh: highest outgoing SVC */ -} TX25ChanAlloc; - -typedef struct X25ChanCfg /*------ Channel configuration -----*/ -{ - unsigned char type PACKED; /* 00h: channel type */ - unsigned char txConf PACKED; /* 01h: Tx packet and window sizes */ - unsigned char rxConf PACKED; /* 01h: Rx packet and window sizes */ -} TX25ChanCfg; - -/* - * Defines for the 'type' field. - */ -#define X25_PVC 0x01 /* PVC */ -#define X25_SVC_IN 0x03 /* Incoming SVC */ -#define X25_SVC_TWOWAY 0x07 /* Two-way SVC */ -#define X25_SVC_OUT 0x0B /* Outgoing SVC */ - -/*---------------------------------------------------------------------------- - * X25_READ_STATISTICS Command. - */ -typedef struct X25Stats -{ /* number of packets Tx/Rx'ed */ - unsigned short txRestartRqst PACKED; /* 00h: Restart Request */ - unsigned short rxRestartRqst PACKED; /* 02h: Restart Request */ - unsigned short txRestartConf PACKED; /* 04h: Restart Confirmation */ - unsigned short rxRestartConf PACKED; /* 06h: Restart Confirmation */ - unsigned short txResetRqst PACKED; /* 08h: Reset Request */ - unsigned short rxResetRqst PACKED; /* 0Ah: Reset Request */ - unsigned short txResetConf PACKED; /* 0Ch: Reset Confirmation */ - unsigned short rxResetConf PACKED; /* 0Eh: Reset Confirmation */ - unsigned short txCallRequest PACKED; /* 10h: Call Request */ - unsigned short rxCallRequest PACKED; /* 12h: Call Request */ - unsigned short txCallAccept PACKED; /* 14h: Call Accept */ - unsigned short rxCallAccept PACKED; /* 16h: Call Accept */ - unsigned short txClearRqst PACKED; /* 18h: Clear Request */ - unsigned short rxClearRqst PACKED; /* 1Ah: Clear Request */ - unsigned short txClearConf PACKED; /* 1Ch: Clear Confirmation */ - unsigned short rxClearConf PACKED; /* 1Eh: Clear Confirmation */ - unsigned short txDiagnostic PACKED; /* 20h: Diagnostic */ - unsigned short rxDiagnostic PACKED; /* 22h: Diagnostic */ - unsigned short txRegRqst PACKED; /* 24h: Registration Request */ - unsigned short rxRegRqst PACKED; /* 26h: Registration Request */ - unsigned short txRegConf PACKED; /* 28h: Registration Confirm.*/ - unsigned short rxRegConf PACKED; /* 2Ah: Registration Confirm.*/ - unsigned short txInterrupt PACKED; /* 2Ch: Interrupt */ - unsigned short rxInterrupt PACKED; /* 2Eh: Interrupt */ - unsigned short txIntrConf PACKED; /* 30h: Interrupt Confirm. */ - unsigned short rxIntrConf PACKED; /* 32h: Interrupt Confirm. */ - unsigned short txData PACKED; /* 34h: Data */ - unsigned short rxData PACKED; /* 36h: Data */ - unsigned short txRR PACKED; /* 38h: RR */ - unsigned short rxRR PACKED; /* 3Ah: RR */ - unsigned short txRNR PACKED; /* 3Ch: RNR */ - unsigned short rxRNR PACKED; /* 3Eh: RNR */ -} TX25Stats; - -/*---------------------------------------------------------------------------- - * X25_READ_HISTORY_TABLE Command. - */ -typedef struct X25EventLog -{ - unsigned char type PACKED; /* 00h: transaction type */ - unsigned short lcn PACKED; /* 01h: logical channel num */ - unsigned char packet PACKED; /* 03h: async packet type */ - unsigned char cause PACKED; /* 04h: X.25 cause field */ - unsigned char diag PACKED; /* 05h: X.25 diag field */ - TX25TimeStamp ts PACKED; /* 06h: time stamp */ -} TX25EventLog; - -/* - * Defines for the 'type' field. - */ -#define X25LOG_INCOMMING 0x00 -#define X25LOG_APPLICATION 0x01 -#define X25LOG_AUTOMATIC 0x02 -#define X25LOG_ERROR 0x04 -#define X25LOG_TIMEOUT 0x08 -#define X25LOG_RECOVERY 0x10 - -/* - * Defines for the 'packet' field. - */ -#define X25LOG_CALL_RQST 0x0B -#define X25LOG_CALL_ACCEPTED 0x0F -#define X25LOG_CLEAR_RQST 0x13 -#define X25LOG_CLEAR_CONFRM 0x17 -#define X25LOG_RESET_RQST 0x1B -#define X25LOG_RESET_CONFRM 0x1F -#define X25LOG_RESTART_RQST 0xFB -#define X25LOG_RESTART_COMFRM 0xFF -#define X25LOG_DIAGNOSTIC 0xF1 -#define X25LOG_DTE_REG_RQST 0xF3 -#define X25LOG_DTE_REG_COMFRM 0xF7 - -/* --------------------------------------------------------------------------- - * X25_TRACE_CONFIGURE Command. - */ -typedef struct X25TraceCfg -{ - unsigned char flags PACKED; /* 00h: trace configuration flags */ - unsigned char timeout PACKED; /* 01h: timeout for trace delay mode*/ -} TX25TraceCfg; - -/* - * Defines for the 'flags' field. - */ -#define X25_TRC_ENABLE 0x01 /* bit0: '1' - trace enabled */ -#define X25_TRC_TIMESTAMP 0x02 /* bit1: '1' - time stamping enabled*/ -#define X25_TRC_DELAY 0x04 /* bit2: '1' - trace delay enabled */ -#define X25_TRC_DATA 0x08 /* bit3: '1' - trace data packets */ -#define X25_TRC_SUPERVISORY 0x10 /* bit4: '1' - trace suprvisory pkts*/ -#define X25_TRC_ASYNCHRONOUS 0x20 /* bit5: '1' - trace asynch. packets*/ -#define X25_TRC_HDLC 0x40 /* bit6: '1' - trace all packets */ -#define X25_TRC_READ 0x80 /* bit7: '1' - get current config. */ - -/* --------------------------------------------------------------------------- - * X25_READ_TRACE_DATA Command. - */ -typedef struct X25Trace /*----- Trace data structure -------*/ -{ - unsigned short length PACKED; /* 00h: trace data length */ - unsigned char type PACKED; /* 02h: trace type */ - unsigned char lost_cnt PACKED; /* 03h: N of traces lost */ - TX25TimeStamp tstamp PACKED; /* 04h: mon/date/sec/min/hour */ - unsigned short millisec PACKED; /* 09h: ms time stamp */ - unsigned char data[0] PACKED; /* 0Bh: traced frame */ -} TX25Trace; - -/* - * Defines for the 'type' field. - */ -#define X25_TRC_TYPE_MASK 0x0F /* bits 0..3: trace type */ -#define X25_TRC_TYPE_RX_FRAME 0x00 /* received frame trace */ -#define X25_TRC_TYPE_TX_FRAME 0x01 /* transmitted frame */ -#define X25_TRC_TYPE_ERR_FRAME 0x02 /* error frame */ - -#define X25_TRC_ERROR_MASK 0xF0 /* bits 4..7: error code */ -#define X25_TRCERR_RX_ABORT 0x10 /* receive abort error */ -#define X25_TRCERR_RX_BADCRC 0x20 /* receive CRC error */ -#define X25_TRCERR_RX_OVERRUN 0x30 /* receiver overrun error */ -#define X25_TRCERR_RX_TOO_LONG 0x40 /* excessive frame length error */ -#define X25_TRCERR_TX_ABORT 0x70 /* aborted frame transmittion error */ -#define X25_TRCERR_TX_UNDERRUN 0x80 /* transmit underrun error */ - -/***************************************************************************** - * Following definitions describe HDLC frame and X.25 packet formats. - ****************************************************************************/ - -typedef struct HDLCFrame /*----- DHLC Frame Format ----------*/ -{ - unsigned char addr PACKED; /* address field */ - unsigned char cntl PACKED; /* control field */ - unsigned char data[0] PACKED; -} THDLCFrame; - -typedef struct X25Pkt /*----- X.25 Paket Format ----------*/ -{ - unsigned char lcn_hi PACKED; /* 4 MSB of Logical Channel Number */ - unsigned char lcn_lo PACKED; /* 8 LSB of Logical Channel Number */ - unsigned char type PACKED; - unsigned char data[0] PACKED; -} TX25Pkt; - -/* - * Defines for the 'lcn_hi' field. - */ -#define X25_Q_BIT_MASK 0x80 /* Data Qualifier Bit mask */ -#define X25_D_BIT_MASK 0x40 /* Delivery Confirmation Bit mask */ -#define X25_M_BITS_MASK 0x30 /* Modulo Bits mask */ -#define X25_LCN_MSB_MASK 0x0F /* LCN most significant bits mask */ - -/* - * Defines for the 'type' field. - */ -#define X25PKT_DATA 0x01 /* Data packet mask */ -#define X25PKT_SUPERVISORY 0x02 /* Supervisory packet mask */ -#define X25PKT_CALL_RQST 0x0B /* Call Request/Incoming */ -#define X25PKT_CALL_ACCEPTED 0x0F /* Call Accepted/Connected */ -#define X25PKT_CLEAR_RQST 0x13 /* Clear Request/Indication */ -#define X25PKT_CLEAR_CONFRM 0x17 /* Clear Confirmation */ -#define X25PKT_RESET_RQST 0x1B /* Reset Request/Indication */ -#define X25PKT_RESET_CONFRM 0x1F /* Reset Confirmation */ -#define X25PKT_RESTART_RQST 0xFB /* Restart Request/Indication */ -#define X25PKT_RESTART_CONFRM 0xFF /* Restart Confirmation */ -#define X25PKT_INTERRUPT 0x23 /* Interrupt */ -#define X25PKT_INTERRUPT_CONFRM 0x27 /* Interrupt Confirmation */ -#define X25PKT_DIAGNOSTIC 0xF1 /* Diagnostic */ -#define X25PKT_REGISTR_RQST 0xF3 /* Registration Request */ -#define X25PKT_REGISTR_CONFRM 0xF7 /* Registration Confirmation */ -#define X25PKT_RR_MASKED 0x01 /* Receive Ready packet after masking */ -#define X25PKT_RNR_MASKED 0x05 /* Receive Not Ready after masking */ - - -typedef struct { - TX25Cmd cmd PACKED; - char data[X25_MAX_DATA] PACKED; -} mbox_cmd_t; - - -typedef struct { - unsigned char qdm PACKED; /* Q/D/M bits */ - unsigned char cause PACKED; /* cause field */ - unsigned char diagn PACKED; /* diagnostics */ - unsigned char pktType PACKED; - unsigned short length PACKED; - unsigned char result PACKED; - unsigned short lcn PACKED; - char reserved[7] PACKED; -}x25api_hdr_t; - - -typedef struct { - x25api_hdr_t hdr PACKED; - char data[X25_MAX_DATA] PACKED; -}x25api_t; - - -/* - * XPIPEMON Definitions - */ - -/* valid ip_protocol for UDP management */ -#define UDPMGMT_UDP_PROTOCOL 0x11 -#define UDPMGMT_XPIPE_SIGNATURE "XLINK8ND" -#define UDPMGMT_DRVRSTATS_SIGNATURE "DRVSTATS" - -/* values for request/reply byte */ -#define UDPMGMT_REQUEST 0x01 -#define UDPMGMT_REPLY 0x02 -#define UDP_OFFSET 12 - - -typedef struct { - unsigned char opp_flag PACKED; /* the opp flag */ - unsigned char command PACKED; /* command code */ - unsigned short length PACKED; /* transfer data length */ - unsigned char result PACKED; /* return code */ - unsigned char pf PACKED; /* P/F bit */ - unsigned short lcn PACKED; /* logical channel */ - unsigned char qdm PACKED; /* Q/D/M bits */ - unsigned char cause PACKED; /* cause field */ - unsigned char diagn PACKED; /* diagnostics */ - unsigned char pktType PACKED; /* packet type */ - unsigned char resrv[4] PACKED; /* reserved */ -} cblock_t; - -typedef struct { - ip_pkt_t ip_pkt PACKED; - udp_pkt_t udp_pkt PACKED; - wp_mgmt_t wp_mgmt PACKED; - cblock_t cblock PACKED; - unsigned char data[4080] PACKED; -} x25_udp_pkt_t; - - -typedef struct read_hdlc_stat { - unsigned short inf_frames_rx_ok PACKED; - unsigned short inf_frames_rx_out_of_seq PACKED; - unsigned short inf_frames_rx_no_data PACKED; - unsigned short inf_frames_rx_dropped PACKED; - unsigned short inf_frames_rx_data_too_long PACKED; - unsigned short inf_frames_rx_invalid_addr PACKED; - unsigned short inf_frames_tx_ok PACKED; - unsigned short inf_frames_tx_retransmit PACKED; - unsigned short T1_timeouts PACKED; - unsigned short SABM_frames_rx PACKED; - unsigned short DISC_frames_rx PACKED; - unsigned short DM_frames_rx PACKED; - unsigned short FRMR_frames_rx PACKED; - unsigned short SABM_frames_tx PACKED; - unsigned short DISC_frames_tx PACKED; - unsigned short DM_frames_tx PACKED; - unsigned short FRMR_frames_tx PACKED; -} read_hdlc_stat_t; - -typedef struct read_comms_err_stats{ - unsigned char overrun_err_rx PACKED; - unsigned char CRC_err PACKED; - unsigned char abort_frames_rx PACKED; - unsigned char frames_dropped_buf_full PACKED; - unsigned char abort_frames_tx PACKED; - unsigned char transmit_underruns PACKED; - unsigned char missed_tx_underruns_intr PACKED; - unsigned char reserved PACKED; - unsigned char DCD_drop PACKED; - unsigned char CTS_drop PACKED; -} read_comms_err_stats_t; - -typedef struct trace_data { - unsigned short length PACKED; - unsigned char type PACKED; - unsigned char trace_dropped PACKED; - unsigned char reserved[5] PACKED; - unsigned short timestamp PACKED; - unsigned char data PACKED; -} trace_data_t; - -enum {UDP_XPIPE_TYPE}; - -#define XPIPE_ENABLE_TRACING 0x14 -#define XPIPE_DISABLE_TRACING 0x14 -#define XPIPE_GET_TRACE_INFO 0x16 -#define XPIPE_FT1_READ_STATUS 0x74 -#define XPIPE_DRIVER_STAT_IFSEND 0x75 -#define XPIPE_DRIVER_STAT_INTR 0x76 -#define XPIPE_DRIVER_STAT_GEN 0x77 -#define XPIPE_FLUSH_DRIVER_STATS 0x78 -#define XPIPE_ROUTER_UP_TIME 0x79 -#define XPIPE_SET_FT1_MODE 0x81 -#define XPIPE_FT1_STATUS_CTRL 0x80 - - -/* error messages */ -#define NO_BUFFS_OR_CLOSED_WIN 0x33 -#define DATA_LENGTH_TOO_BIG 0x32 -#define NO_DATA_AVAILABLE 0x33 -#define Z80_TIMEOUT_ERROR 0x0a -#define NO_BUFFS 0x08 - - -/* Trace options */ -#define TRACE_DEFAULT 0x03 -#define TRACE_SUPERVISOR_FRMS 0x10 -#define TRACE_ASYNC_FRMS 0x20 -#define TRACE_ALL_HDLC_FRMS 0x40 -#define TRACE_DATA_FRMS 0x08 - - -#endif /* _SDLA_X25_H */ diff --git a/include/linux/sdladrv.h b/include/linux/sdladrv.h deleted file mode 100644 index c85e103d5e7..00000000000 --- a/include/linux/sdladrv.h +++ /dev/null @@ -1,66 +0,0 @@ -/***************************************************************************** -* sdladrv.h SDLA Support Module. Kernel API Definitions. -* -* Author: Gideon Hack -* -* Copyright: (c) 1995-2000 Sangoma Technologies Inc. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -* ============================================================================ -* Jun 02, 1999 Gideon Hack Added support for the S514 PCI adapter. -* Dec 11, 1996 Gene Kozin Complete overhaul. -* Oct 17, 1996 Gene Kozin Minor bug fixes. -* Jun 12, 1996 Gene Kozin Added support for S503 card. -* Dec 06, 1995 Gene Kozin Initial version. -*****************************************************************************/ -#ifndef _SDLADRV_H -#define _SDLADRV_H - - -#define SDLA_MAXIORANGE 4 /* maximum I/O port range */ -#define SDLA_WINDOWSIZE 0x2000 /* default dual-port memory window size */ -/****** Data Structures *****************************************************/ - -/*---------------------------------------------------------------------------- - * Adapter hardware configuration. Pointer to this structure is passed to all - * APIs. - */ -typedef struct sdlahw -{ - unsigned type; /* adapter type */ - unsigned fwid; /* firmware ID */ - unsigned port; /* adapter I/O port base */ - int irq; /* interrupt request level */ - char S514_cpu_no[1]; /* PCI CPU Number */ - unsigned char S514_slot_no; /* PCI Slot Number */ - char auto_pci_cfg; /* Autodetect PCI Slot */ - struct pci_dev *pci_dev; /* PCI device */ - void * dpmbase; /* dual-port memory base */ - unsigned dpmsize; /* dual-port memory size */ - unsigned pclk; /* CPU clock rate, kHz */ - unsigned long memory; /* memory size */ - unsigned long vector; /* local offset of the DPM window */ - unsigned io_range; /* I/O port range */ - unsigned char regs[SDLA_MAXIORANGE]; /* was written to registers */ - unsigned reserved[5]; -} sdlahw_t; - -/****** Function Prototypes *************************************************/ - -extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); -extern int sdla_down (sdlahw_t* hw); -extern void S514_intack (sdlahw_t* hw, u32 int_status); -extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); -extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); -extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, - unsigned len); -extern int sdla_poke (sdlahw_t* hw, unsigned long addr, void* buf, - unsigned len); -extern int sdla_exec (void* opflag); - -extern unsigned wanpipe_hw_probe(void); - -#endif /* _SDLADRV_H */ diff --git a/include/linux/sdlapci.h b/include/linux/sdlapci.h deleted file mode 100644 index 6f7c904f188..00000000000 --- a/include/linux/sdlapci.h +++ /dev/null @@ -1,72 +0,0 @@ -/***************************************************************************** -* sdlapci.h WANPIPE(tm) Multiprotocol WAN Link Driver. -* Definitions for the SDLA PCI adapter. -* -* Author: Gideon Hack <ghack@sangoma.com> -* -* Copyright: (c) 1999-2000 Sangoma Technologies Inc. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -* ============================================================================ -* Jun 02, 1999 Gideon Hack Initial version. -*****************************************************************************/ -#ifndef _SDLAPCI_H -#define _SDLAPCI_H - -/****** Defines *************************************************************/ - -/* Definitions for identifying and finding S514 PCI adapters */ -#define V3_VENDOR_ID 0x11B0 /* V3 vendor ID number */ -#define V3_DEVICE_ID 0x0002 /* V3 device ID number */ -#define SANGOMA_SUBSYS_VENDOR 0x4753 /* ID for Sangoma */ -#define PCI_DEV_SLOT_MASK 0x1F /* mask for slot numbering */ -#define PCI_IRQ_NOT_ALLOCATED 0xFF /* interrupt line for no IRQ */ - -/* Local PCI register offsets */ -#define PCI_VENDOR_ID_WORD 0x00 /* vendor ID */ -#define PCI_IO_BASE_DWORD 0x10 /* IO base */ -#define PCI_MEM_BASE0_DWORD 0x14 /* memory base - apperture 0 */ -#define PCI_MEM_BASE1_DWORD 0x18 /* memory base - apperture 1 */ -#define PCI_SUBSYS_VENDOR_WORD 0x2C /* subsystem vendor ID */ -#define PCI_INT_LINE_BYTE 0x3C /* interrupt line */ -#define PCI_INT_PIN_BYTE 0x3D /* interrupt pin */ -#define PCI_MAP0_DWORD 0x40 /* PCI to local bus address 0 */ -#define PCI_MAP1_DWORD 0x44 /* PCI to local bus address 1 */ -#define PCI_INT_STATUS 0x48 /* interrupt status */ -#define PCI_INT_CONFIG 0x4C /* interrupt configuration */ - -/* Local PCI register usage */ -#define PCI_MEMORY_ENABLE 0x00000003 /* enable PCI memory */ -#define PCI_CPU_A_MEM_DISABLE 0x00000002 /* disable CPU A memory */ -#define PCI_CPU_B_MEM_DISABLE 0x00100002 /* disable CPU B memory */ -#define PCI_ENABLE_IRQ_CPU_A 0x005A0004 /* enable IRQ for CPU A */ -#define PCI_ENABLE_IRQ_CPU_B 0x005A0008 /* enable IRQ for CPU B */ -#define PCI_DISABLE_IRQ_CPU_A 0x00000004 /* disable IRQ for CPU A */ -#define PCI_DISABLE_IRQ_CPU_B 0x00000008 /* disable IRQ for CPU B */ - -/* Setting for the Interrupt Status register */ -#define IRQ_CPU_A 0x04 /* IRQ for CPU A */ -#define IRQ_CPU_B 0x08 /* IRQ for CPU B */ - -/* The maximum size of the S514 memory */ -#define MAX_SIZEOF_S514_MEMORY (256 * 1024) - -/* S514 control register offsets within the memory address space */ -#define S514_CTRL_REG_BYTE 0x80000 - -/* S514 adapter control bytes */ -#define S514_CPU_HALT 0x00 -#define S514_CPU_START 0x01 - -/* The maximum number of S514 adapters supported */ -#define MAX_S514_CARDS 20 - -#define PCI_CARD_TYPE 0x2E -#define S514_DUAL_CPU 0x12 -#define S514_SINGLE_CPU 0x11 - -#endif /* _SDLAPCI_H */ - diff --git a/include/linux/sdlasfm.h b/include/linux/sdlasfm.h deleted file mode 100644 index 94aaa8ada66..00000000000 --- a/include/linux/sdlasfm.h +++ /dev/null @@ -1,104 +0,0 @@ -/***************************************************************************** -* sdlasfm.h WANPIPE(tm) Multiprotocol WAN Link Driver. -* Definitions for the SDLA Firmware Module (SFM). -* -* Author: Gideon Hack -* -* Copyright: (c) 1995-1999 Sangoma Technologies Inc. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -* ============================================================================ -* Jun 02, 1999 Gideon Hack Added support for the S514 adapter. -* Dec 11, 1996 Gene Kozin Cosmetic changes -* Apr 16, 1996 Gene Kozin Changed adapter & firmware IDs. Version 2 -* Dec 15, 1995 Gene Kozin Structures chaned -* Nov 09, 1995 Gene Kozin Initial version. -*****************************************************************************/ -#ifndef _SDLASFM_H -#define _SDLASFM_H - -/****** Defines *************************************************************/ - -#define SFM_VERSION 2 -#define SFM_SIGNATURE "SFM - Sangoma SDLA Firmware Module" - -/* min/max */ -#define SFM_IMAGE_SIZE 0x8000 /* max size of SDLA code image file */ -#define SFM_DESCR_LEN 256 /* max length of description string */ -#define SFM_MAX_SDLA 16 /* max number of compatible adapters */ - -/* Adapter types */ -#define SDLA_S502A 5020 -#define SDLA_S502E 5021 -#define SDLA_S503 5030 -#define SDLA_S508 5080 -#define SDLA_S507 5070 -#define SDLA_S509 5090 -#define SDLA_S514 5140 - -/* S514 PCI adapter CPU numbers */ -#define S514_CPU_A 'A' -#define S514_CPU_B 'B' - - -/* Firmware identification numbers: - * 0 .. 999 Test & Diagnostics - * 1000 .. 1999 Streaming HDLC - * 2000 .. 2999 Bisync - * 3000 .. 3999 SDLC - * 4000 .. 4999 HDLC - * 5000 .. 5999 X.25 - * 6000 .. 6999 Frame Relay - * 7000 .. 7999 PPP - * 8000 .. 8999 Cisco HDLC - */ -#define SFID_CALIB502 200 -#define SFID_STRM502 1200 -#define SFID_STRM508 1800 -#define SFID_BSC502 2200 -#define SFID_SDLC502 3200 -#define SFID_HDLC502 4200 -#define SFID_HDLC508 4800 -#define SFID_X25_502 5200 -#define SFID_X25_508 5800 -#define SFID_FR502 6200 -#define SFID_FR508 6800 -#define SFID_PPP502 7200 -#define SFID_PPP508 7800 -#define SFID_PPP514 7140 -#define SFID_CHDLC508 8800 -#define SFID_CHDLC514 8140 - -/****** Data Types **********************************************************/ - -typedef struct sfm_info /* firmware module information */ -{ - unsigned short codeid; /* firmware ID */ - unsigned short version; /* firmaware version number */ - unsigned short adapter[SFM_MAX_SDLA]; /* compatible adapter types */ - unsigned long memsize; /* minimum memory size */ - unsigned short reserved[2]; /* reserved */ - unsigned short startoffs; /* entry point offset */ - unsigned short winoffs; /* dual-port memory window offset */ - unsigned short codeoffs; /* code load offset */ - unsigned short codesize; /* code size */ - unsigned short dataoffs; /* configuration data load offset */ - unsigned short datasize; /* configuration data size */ -} sfm_info_t; - -typedef struct sfm /* SDLA firmware file structire */ -{ - char signature[80]; /* SFM file signature */ - unsigned short version; /* file format version */ - unsigned short checksum; /* info + image */ - unsigned short reserved[6]; /* reserved */ - char descr[SFM_DESCR_LEN]; /* description string */ - sfm_info_t info; /* firmware module info */ - unsigned char image[1]; /* code image (variable size) */ -} sfm_t; - -#endif /* _SDLASFM_H */ - diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index fca9b0fb5b4..5a095572881 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -73,7 +73,7 @@ static inline int write_tryseqlock(seqlock_t *sl) } /* Start of read calculation -- fetch last complete writer token */ -static inline unsigned read_seqbegin(const seqlock_t *sl) +static __always_inline unsigned read_seqbegin(const seqlock_t *sl) { unsigned ret = sl->sequence; smp_rmb(); @@ -88,7 +88,7 @@ static inline unsigned read_seqbegin(const seqlock_t *sl) * * Using xor saves one conditional branch. */ -static inline int read_seqretry(const seqlock_t *sl, unsigned iv) +static __always_inline int read_seqretry(const seqlock_t *sl, unsigned iv) { smp_rmb(); return (iv & 1) | (sl->sequence ^ iv); diff --git a/include/linux/serio.h b/include/linux/serio.h index 690aabca8ed..6348e833089 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h @@ -18,6 +18,7 @@ #include <linux/interrupt.h> #include <linux/list.h> #include <linux/spinlock.h> +#include <linux/mutex.h> #include <linux/device.h> #include <linux/mod_devicetable.h> @@ -42,7 +43,7 @@ struct serio { struct serio *parent, *child; struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ - struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ + struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ struct device dev; unsigned int registered; /* port has been fully registered with driver core */ @@ -151,17 +152,17 @@ static inline void serio_continue_rx(struct serio *serio) */ static inline int serio_pin_driver(struct serio *serio) { - return down_interruptible(&serio->drv_sem); + return mutex_lock_interruptible(&serio->drv_mutex); } static inline void serio_pin_driver_uninterruptible(struct serio *serio) { - down(&serio->drv_sem); + mutex_lock(&serio->drv_mutex); } static inline void serio_unpin_driver(struct serio *serio) { - up(&serio->drv_sem); + mutex_unlock(&serio->drv_mutex); } diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 613b9513f8b..c4619a428d9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -941,6 +941,25 @@ static inline void skb_reserve(struct sk_buff *skb, int len) #define NET_IP_ALIGN 2 #endif +/* + * The networking layer reserves some headroom in skb data (via + * dev_alloc_skb). This is used to avoid having to reallocate skb data when + * the header has to grow. In the default case, if the header has to grow + * 16 bytes or less we avoid the reallocation. + * + * Unfortunately this headroom changes the DMA alignment of the resulting + * network packet. As for NET_IP_ALIGN, this unaligned DMA is expensive + * on some architectures. An architecture can override this value, + * perhaps setting it to a cacheline in size (since that will maintain + * cacheline alignment of the DMA). It must be a power of 2. + * + * Various parts of the networking layer expect at least 16 bytes of + * headroom, you should not reduce this. + */ +#ifndef NET_SKB_PAD +#define NET_SKB_PAD 16 +#endif + extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); static inline void __skb_trim(struct sk_buff *skb, unsigned int len) @@ -1030,9 +1049,9 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) static inline struct sk_buff *__dev_alloc_skb(unsigned int length, gfp_t gfp_mask) { - struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); + struct sk_buff *skb = alloc_skb(length + NET_SKB_PAD, gfp_mask); if (likely(skb)) - skb_reserve(skb, 16); + skb_reserve(skb, NET_SKB_PAD); return skb; } #else @@ -1070,13 +1089,15 @@ static inline struct sk_buff *dev_alloc_skb(unsigned int length) */ static inline int skb_cow(struct sk_buff *skb, unsigned int headroom) { - int delta = (headroom > 16 ? headroom : 16) - skb_headroom(skb); + int delta = (headroom > NET_SKB_PAD ? headroom : NET_SKB_PAD) - + skb_headroom(skb); if (delta < 0) delta = 0; if (delta || skb_cloned(skb)) - return pskb_expand_head(skb, (delta + 15) & ~15, 0, GFP_ATOMIC); + return pskb_expand_head(skb, (delta + (NET_SKB_PAD-1)) & + ~(NET_SKB_PAD-1), 0, GFP_ATOMIC); return 0; } diff --git a/include/linux/string.h b/include/linux/string.h index dee221429ad..c61306da8c5 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -13,11 +13,6 @@ extern "C" { #endif -extern char * strpbrk(const char *,const char *); -extern char * strsep(char **,const char *); -extern __kernel_size_t strspn(const char *,const char *); -extern __kernel_size_t strcspn(const char *,const char *); - extern char *strndup_user(const char __user *, long); /* @@ -70,6 +65,18 @@ extern __kernel_size_t strlen(const char *); #ifndef __HAVE_ARCH_STRNLEN extern __kernel_size_t strnlen(const char *,__kernel_size_t); #endif +#ifndef __HAVE_ARCH_STRPBRK +extern char * strpbrk(const char *,const char *); +#endif +#ifndef __HAVE_ARCH_STRSEP +extern char * strsep(char **,const char *); +#endif +#ifndef __HAVE_ARCH_STRSPN +extern __kernel_size_t strspn(const char *,const char *); +#endif +#ifndef __HAVE_ARCH_STRCSPN +extern __kernel_size_t strcspn(const char *,const char *); +#endif #ifndef __HAVE_ARCH_MEMSET extern void * memset(void *,int,__kernel_size_t); diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 50cab2a09f2..50356438454 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -197,15 +197,16 @@ svc_take_res_page(struct svc_rqst *rqstp) return rqstp->rq_respages[rqstp->rq_resused++]; } -static inline int svc_take_page(struct svc_rqst *rqstp) +static inline void svc_take_page(struct svc_rqst *rqstp) { - if (rqstp->rq_arghi <= rqstp->rq_argused) - return -ENOMEM; + if (rqstp->rq_arghi <= rqstp->rq_argused) { + WARN_ON(1); + return; + } rqstp->rq_arghi--; rqstp->rq_respages[rqstp->rq_resused] = rqstp->rq_argpages[rqstp->rq_arghi]; rqstp->rq_resused++; - return 0; } static inline void svc_pushback_allpages(struct svc_rqst *rqstp) diff --git a/include/linux/swap.h b/include/linux/swap.h index 54eac8a39a4..5b1fdf1cff4 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -155,6 +155,7 @@ extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct * /* linux/mm/page_alloc.c */ extern unsigned long totalram_pages; extern unsigned long totalhigh_pages; +extern unsigned long totalreserve_pages; extern long nr_swap_pages; extern unsigned int nr_free_pages(void); extern unsigned int nr_free_pages_pgdat(pg_data_t *pgdat); diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index e487e3b60f6..d3ebc0e68b2 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -570,4 +570,13 @@ asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, int mode); asmlinkage long sys_unshare(unsigned long unshare_flags); +asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, + int fd_out, loff_t __user *off_out, + size_t len, unsigned int flags); + +asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); + +asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, + unsigned int flags); + #endif diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 392da5a6dac..1ea5d3cda6a 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -74,6 +74,7 @@ struct sysfs_dirent { umode_t s_mode; struct dentry * s_dentry; struct iattr * s_iattr; + atomic_t s_event; }; #define SYSFS_ROOT 0x0001 @@ -117,6 +118,7 @@ int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); int sysfs_create_group(struct kobject *, const struct attribute_group *); void sysfs_remove_group(struct kobject *, const struct attribute_group *); +void sysfs_notify(struct kobject * k, char *dir, char *attr); #else /* CONFIG_SYSFS */ @@ -185,6 +187,10 @@ static inline void sysfs_remove_group(struct kobject * k, const struct attribute ; } +static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) +{ +} + #endif /* CONFIG_SYSFS */ #endif /* _SYSFS_H_ */ diff --git a/include/linux/timer.h b/include/linux/timer.h index b5caabca553..0a485beba9f 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -6,7 +6,7 @@ #include <linux/spinlock.h> #include <linux/stddef.h> -struct timer_base_s; +struct tvec_t_base_s; struct timer_list { struct list_head entry; @@ -15,16 +15,16 @@ struct timer_list { void (*function)(unsigned long); unsigned long data; - struct timer_base_s *base; + struct tvec_t_base_s *base; }; -extern struct timer_base_s __init_timer_base; +extern struct tvec_t_base_s boot_tvec_bases; #define TIMER_INITIALIZER(_function, _expires, _data) { \ .function = (_function), \ .expires = (_expires), \ .data = (_data), \ - .base = &__init_timer_base, \ + .base = &boot_tvec_bases, \ } #define DEFINE_TIMER(_name, _function, _expires, _data) \ diff --git a/include/linux/tiocl.h b/include/linux/tiocl.h index 2c9e847f6ed..4756862c4ed 100644 --- a/include/linux/tiocl.h +++ b/include/linux/tiocl.h @@ -34,5 +34,6 @@ struct tiocl_selection { #define TIOCL_SCROLLCONSOLE 13 /* scroll console */ #define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */ #define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */ +#define TIOCL_GETKMSGREDIRECT 17 /* get the vt the kernel messages are restricted to */ #endif /* _LINUX_TIOCL_H */ diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 0976a163b45..31548303ee3 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h @@ -6,9 +6,10 @@ extern int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *c extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); +void tty_schedule_flip(struct tty_struct *tty); static inline int tty_insert_flip_char(struct tty_struct *tty, - unsigned char ch, char flag) + unsigned char ch, char flag) { struct tty_buffer *tb = tty->buf.tail; if (tb && tb->active && tb->used < tb->size) { @@ -19,26 +20,4 @@ static inline int tty_insert_flip_char(struct tty_struct *tty, return tty_insert_flip_string_flags(tty, &ch, &flag, 1); } -static inline void tty_schedule_flip(struct tty_struct *tty) -{ - unsigned long flags; - spin_lock_irqsave(&tty->buf.lock, flags); - if (tty->buf.tail != NULL) { - tty->buf.tail->active = 0; - tty->buf.tail->commit = tty->buf.tail->used; - } - spin_unlock_irqrestore(&tty->buf.lock, flags); - schedule_delayed_work(&tty->buf.work, 1); -} - -#undef _INLINE_ - - #endif /* _LINUX_TTY_FLIP_H */ - - - - - - - diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 0ff7ca68e5c..7168302f984 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h @@ -20,7 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> - * + * * Changes/Revisions: * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) * - added force feedback support @@ -51,7 +51,7 @@ struct uinput_request { struct uinput_device { struct input_dev *dev; - struct semaphore sem; + struct mutex mutex; enum uinput_state state; wait_queue_head_t waitq; unsigned char ready; diff --git a/include/linux/usb/net2280.h b/include/linux/usb/net2280.h new file mode 100644 index 00000000000..c602f884f18 --- /dev/null +++ b/include/linux/usb/net2280.h @@ -0,0 +1,444 @@ +/* + * NetChip 2280 high/full speed USB device controller. + * Unlike many such controllers, this one talks PCI. + */ +#ifndef __LINUX_USB_NET2280_H +#define __LINUX_USB_NET2280_H + +/* + * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com) + * Copyright (C) 2003 David Brownell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/*-------------------------------------------------------------------------*/ + +/* NET2280 MEMORY MAPPED REGISTERS + * + * The register layout came from the chip documentation, and the bit + * number definitions were extracted from chip specification. + * + * Use the shift operator ('<<') to build bit masks, with readl/writel + * to access the registers through PCI. + */ + +/* main registers, BAR0 + 0x0000 */ +struct net2280_regs { + // offset 0x0000 + u32 devinit; +#define LOCAL_CLOCK_FREQUENCY 8 +#define FORCE_PCI_RESET 7 +#define PCI_ID 6 +#define PCI_ENABLE 5 +#define FIFO_SOFT_RESET 4 +#define CFG_SOFT_RESET 3 +#define PCI_SOFT_RESET 2 +#define USB_SOFT_RESET 1 +#define M8051_RESET 0 + u32 eectl; +#define EEPROM_ADDRESS_WIDTH 23 +#define EEPROM_CHIP_SELECT_ACTIVE 22 +#define EEPROM_PRESENT 21 +#define EEPROM_VALID 20 +#define EEPROM_BUSY 19 +#define EEPROM_CHIP_SELECT_ENABLE 18 +#define EEPROM_BYTE_READ_START 17 +#define EEPROM_BYTE_WRITE_START 16 +#define EEPROM_READ_DATA 8 +#define EEPROM_WRITE_DATA 0 + u32 eeclkfreq; + u32 _unused0; + // offset 0x0010 + + u32 pciirqenb0; /* interrupt PCI master ... */ +#define SETUP_PACKET_INTERRUPT_ENABLE 7 +#define ENDPOINT_F_INTERRUPT_ENABLE 6 +#define ENDPOINT_E_INTERRUPT_ENABLE 5 +#define ENDPOINT_D_INTERRUPT_ENABLE 4 +#define ENDPOINT_C_INTERRUPT_ENABLE 3 +#define ENDPOINT_B_INTERRUPT_ENABLE 2 +#define ENDPOINT_A_INTERRUPT_ENABLE 1 +#define ENDPOINT_0_INTERRUPT_ENABLE 0 + u32 pciirqenb1; +#define PCI_INTERRUPT_ENABLE 31 +#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 +#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 +#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 +#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 +#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 +#define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18 +#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 +#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 +#define GPIO_INTERRUPT_ENABLE 13 +#define DMA_D_INTERRUPT_ENABLE 12 +#define DMA_C_INTERRUPT_ENABLE 11 +#define DMA_B_INTERRUPT_ENABLE 10 +#define DMA_A_INTERRUPT_ENABLE 9 +#define EEPROM_DONE_INTERRUPT_ENABLE 8 +#define VBUS_INTERRUPT_ENABLE 7 +#define CONTROL_STATUS_INTERRUPT_ENABLE 6 +#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 +#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 +#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 +#define RESUME_INTERRUPT_ENABLE 1 +#define SOF_INTERRUPT_ENABLE 0 + u32 cpu_irqenb0; /* ... or onboard 8051 */ +#define SETUP_PACKET_INTERRUPT_ENABLE 7 +#define ENDPOINT_F_INTERRUPT_ENABLE 6 +#define ENDPOINT_E_INTERRUPT_ENABLE 5 +#define ENDPOINT_D_INTERRUPT_ENABLE 4 +#define ENDPOINT_C_INTERRUPT_ENABLE 3 +#define ENDPOINT_B_INTERRUPT_ENABLE 2 +#define ENDPOINT_A_INTERRUPT_ENABLE 1 +#define ENDPOINT_0_INTERRUPT_ENABLE 0 + u32 cpu_irqenb1; +#define CPU_INTERRUPT_ENABLE 31 +#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 +#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 +#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 +#define PCI_INTA_INTERRUPT_ENABLE 24 +#define PCI_PME_INTERRUPT_ENABLE 23 +#define PCI_SERR_INTERRUPT_ENABLE 22 +#define PCI_PERR_INTERRUPT_ENABLE 21 +#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 +#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 +#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 +#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 +#define GPIO_INTERRUPT_ENABLE 13 +#define DMA_D_INTERRUPT_ENABLE 12 +#define DMA_C_INTERRUPT_ENABLE 11 +#define DMA_B_INTERRUPT_ENABLE 10 +#define DMA_A_INTERRUPT_ENABLE 9 +#define EEPROM_DONE_INTERRUPT_ENABLE 8 +#define VBUS_INTERRUPT_ENABLE 7 +#define CONTROL_STATUS_INTERRUPT_ENABLE 6 +#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 +#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 +#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 +#define RESUME_INTERRUPT_ENABLE 1 +#define SOF_INTERRUPT_ENABLE 0 + + // offset 0x0020 + u32 _unused1; + u32 usbirqenb1; +#define USB_INTERRUPT_ENABLE 31 +#define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 +#define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 +#define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 +#define PCI_INTA_INTERRUPT_ENABLE 24 +#define PCI_PME_INTERRUPT_ENABLE 23 +#define PCI_SERR_INTERRUPT_ENABLE 22 +#define PCI_PERR_INTERRUPT_ENABLE 21 +#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 +#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 +#define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 +#define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 +#define GPIO_INTERRUPT_ENABLE 13 +#define DMA_D_INTERRUPT_ENABLE 12 +#define DMA_C_INTERRUPT_ENABLE 11 +#define DMA_B_INTERRUPT_ENABLE 10 +#define DMA_A_INTERRUPT_ENABLE 9 +#define EEPROM_DONE_INTERRUPT_ENABLE 8 +#define VBUS_INTERRUPT_ENABLE 7 +#define CONTROL_STATUS_INTERRUPT_ENABLE 6 +#define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 +#define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 +#define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 +#define RESUME_INTERRUPT_ENABLE 1 +#define SOF_INTERRUPT_ENABLE 0 + u32 irqstat0; +#define INTA_ASSERTED 12 +#define SETUP_PACKET_INTERRUPT 7 +#define ENDPOINT_F_INTERRUPT 6 +#define ENDPOINT_E_INTERRUPT 5 +#define ENDPOINT_D_INTERRUPT 4 +#define ENDPOINT_C_INTERRUPT 3 +#define ENDPOINT_B_INTERRUPT 2 +#define ENDPOINT_A_INTERRUPT 1 +#define ENDPOINT_0_INTERRUPT 0 + u32 irqstat1; +#define POWER_STATE_CHANGE_INTERRUPT 27 +#define PCI_ARBITER_TIMEOUT_INTERRUPT 26 +#define PCI_PARITY_ERROR_INTERRUPT 25 +#define PCI_INTA_INTERRUPT 24 +#define PCI_PME_INTERRUPT 23 +#define PCI_SERR_INTERRUPT 22 +#define PCI_PERR_INTERRUPT 21 +#define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20 +#define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19 +#define PCI_RETRY_ABORT_INTERRUPT 17 +#define PCI_MASTER_CYCLE_DONE_INTERRUPT 16 +#define SOF_DOWN_INTERRUPT 14 +#define GPIO_INTERRUPT 13 +#define DMA_D_INTERRUPT 12 +#define DMA_C_INTERRUPT 11 +#define DMA_B_INTERRUPT 10 +#define DMA_A_INTERRUPT 9 +#define EEPROM_DONE_INTERRUPT 8 +#define VBUS_INTERRUPT 7 +#define CONTROL_STATUS_INTERRUPT 6 +#define ROOT_PORT_RESET_INTERRUPT 4 +#define SUSPEND_REQUEST_INTERRUPT 3 +#define SUSPEND_REQUEST_CHANGE_INTERRUPT 2 +#define RESUME_INTERRUPT 1 +#define SOF_INTERRUPT 0 + // offset 0x0030 + u32 idxaddr; + u32 idxdata; + u32 fifoctl; +#define PCI_BASE2_RANGE 16 +#define IGNORE_FIFO_AVAILABILITY 3 +#define PCI_BASE2_SELECT 2 +#define FIFO_CONFIGURATION_SELECT 0 + u32 _unused2; + // offset 0x0040 + u32 memaddr; +#define START 28 +#define DIRECTION 27 +#define FIFO_DIAGNOSTIC_SELECT 24 +#define MEMORY_ADDRESS 0 + u32 memdata0; + u32 memdata1; + u32 _unused3; + // offset 0x0050 + u32 gpioctl; +#define GPIO3_LED_SELECT 12 +#define GPIO3_INTERRUPT_ENABLE 11 +#define GPIO2_INTERRUPT_ENABLE 10 +#define GPIO1_INTERRUPT_ENABLE 9 +#define GPIO0_INTERRUPT_ENABLE 8 +#define GPIO3_OUTPUT_ENABLE 7 +#define GPIO2_OUTPUT_ENABLE 6 +#define GPIO1_OUTPUT_ENABLE 5 +#define GPIO0_OUTPUT_ENABLE 4 +#define GPIO3_DATA 3 +#define GPIO2_DATA 2 +#define GPIO1_DATA 1 +#define GPIO0_DATA 0 + u32 gpiostat; +#define GPIO3_INTERRUPT 3 +#define GPIO2_INTERRUPT 2 +#define GPIO1_INTERRUPT 1 +#define GPIO0_INTERRUPT 0 +} __attribute__ ((packed)); + +/* usb control, BAR0 + 0x0080 */ +struct net2280_usb_regs { + // offset 0x0080 + u32 stdrsp; +#define STALL_UNSUPPORTED_REQUESTS 31 +#define SET_TEST_MODE 16 +#define GET_OTHER_SPEED_CONFIGURATION 15 +#define GET_DEVICE_QUALIFIER 14 +#define SET_ADDRESS 13 +#define ENDPOINT_SET_CLEAR_HALT 12 +#define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11 +#define GET_STRING_DESCRIPTOR_2 10 +#define GET_STRING_DESCRIPTOR_1 9 +#define GET_STRING_DESCRIPTOR_0 8 +#define GET_SET_INTERFACE 6 +#define GET_SET_CONFIGURATION 5 +#define GET_CONFIGURATION_DESCRIPTOR 4 +#define GET_DEVICE_DESCRIPTOR 3 +#define GET_ENDPOINT_STATUS 2 +#define GET_INTERFACE_STATUS 1 +#define GET_DEVICE_STATUS 0 + u32 prodvendid; +#define PRODUCT_ID 16 +#define VENDOR_ID 0 + u32 relnum; + u32 usbctl; +#define SERIAL_NUMBER_INDEX 16 +#define PRODUCT_ID_STRING_ENABLE 13 +#define VENDOR_ID_STRING_ENABLE 12 +#define USB_ROOT_PORT_WAKEUP_ENABLE 11 +#define VBUS_PIN 10 +#define TIMED_DISCONNECT 9 +#define SUSPEND_IMMEDIATELY 7 +#define SELF_POWERED_USB_DEVICE 6 +#define REMOTE_WAKEUP_SUPPORT 5 +#define PME_POLARITY 4 +#define USB_DETECT_ENABLE 3 +#define PME_WAKEUP_ENABLE 2 +#define DEVICE_REMOTE_WAKEUP_ENABLE 1 +#define SELF_POWERED_STATUS 0 + // offset 0x0090 + u32 usbstat; +#define HIGH_SPEED 7 +#define FULL_SPEED 6 +#define GENERATE_RESUME 5 +#define GENERATE_DEVICE_REMOTE_WAKEUP 4 + u32 xcvrdiag; +#define FORCE_HIGH_SPEED_MODE 31 +#define FORCE_FULL_SPEED_MODE 30 +#define USB_TEST_MODE 24 +#define LINE_STATE 16 +#define TRANSCEIVER_OPERATION_MODE 2 +#define TRANSCEIVER_SELECT 1 +#define TERMINATION_SELECT 0 + u32 setup0123; + u32 setup4567; + // offset 0x0090 + u32 _unused0; + u32 ouraddr; +#define FORCE_IMMEDIATE 7 +#define OUR_USB_ADDRESS 0 + u32 ourconfig; +} __attribute__ ((packed)); + +/* pci control, BAR0 + 0x0100 */ +struct net2280_pci_regs { + // offset 0x0100 + u32 pcimstctl; +#define PCI_ARBITER_PARK_SELECT 13 +#define PCI_MULTI LEVEL_ARBITER 12 +#define PCI_RETRY_ABORT_ENABLE 11 +#define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10 +#define DMA_READ_MULTIPLE_ENABLE 9 +#define DMA_READ_LINE_ENABLE 8 +#define PCI_MASTER_COMMAND_SELECT 6 +#define MEM_READ_OR_WRITE 0 +#define IO_READ_OR_WRITE 1 +#define CFG_READ_OR_WRITE 2 +#define PCI_MASTER_START 5 +#define PCI_MASTER_READ_WRITE 4 +#define PCI_MASTER_WRITE 0 +#define PCI_MASTER_READ 1 +#define PCI_MASTER_BYTE_WRITE_ENABLES 0 + u32 pcimstaddr; + u32 pcimstdata; + u32 pcimststat; +#define PCI_ARBITER_CLEAR 2 +#define PCI_EXTERNAL_ARBITER 1 +#define PCI_HOST_MODE 0 +} __attribute__ ((packed)); + +/* dma control, BAR0 + 0x0180 ... array of four structs like this, + * for channels 0..3. see also struct net2280_dma: descriptor + * that can be loaded into some of these registers. + */ +struct net2280_dma_regs { /* [11.7] */ + // offset 0x0180, 0x01a0, 0x01c0, 0x01e0, + u32 dmactl; +#define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25 +#define DMA_CLEAR_COUNT_ENABLE 21 +#define DESCRIPTOR_POLLING_RATE 19 +#define POLL_CONTINUOUS 0 +#define POLL_1_USEC 1 +#define POLL_100_USEC 2 +#define POLL_1_MSEC 3 +#define DMA_VALID_BIT_POLLING_ENABLE 18 +#define DMA_VALID_BIT_ENABLE 17 +#define DMA_SCATTER_GATHER_ENABLE 16 +#define DMA_OUT_AUTO_START_ENABLE 4 +#define DMA_PREEMPT_ENABLE 3 +#define DMA_FIFO_VALIDATE 2 +#define DMA_ENABLE 1 +#define DMA_ADDRESS_HOLD 0 + u32 dmastat; +#define DMA_ABORT_DONE_INTERRUPT 27 +#define DMA_SCATTER_GATHER_DONE_INTERRUPT 25 +#define DMA_TRANSACTION_DONE_INTERRUPT 24 +#define DMA_ABORT 1 +#define DMA_START 0 + u32 _unused0 [2]; + // offset 0x0190, 0x01b0, 0x01d0, 0x01f0, + u32 dmacount; +#define VALID_BIT 31 +#define DMA_DIRECTION 30 +#define DMA_DONE_INTERRUPT_ENABLE 29 +#define END_OF_CHAIN 28 +#define DMA_BYTE_COUNT_MASK ((1<<24)-1) +#define DMA_BYTE_COUNT 0 + u32 dmaaddr; + u32 dmadesc; + u32 _unused1; +} __attribute__ ((packed)); + +/* dedicated endpoint registers, BAR0 + 0x0200 */ + +struct net2280_dep_regs { /* [11.8] */ + // offset 0x0200, 0x0210, 0x220, 0x230, 0x240 + u32 dep_cfg; + // offset 0x0204, 0x0214, 0x224, 0x234, 0x244 + u32 dep_rsp; + u32 _unused [2]; +} __attribute__ ((packed)); + +/* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs + * like this, for ep0 then the configurable endpoints A..F + * ep0 reserved for control; E and F have only 64 bytes of fifo + */ +struct net2280_ep_regs { /* [11.9] */ + // offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 + u32 ep_cfg; +#define ENDPOINT_BYTE_COUNT 16 +#define ENDPOINT_ENABLE 10 +#define ENDPOINT_TYPE 8 +#define ENDPOINT_DIRECTION 7 +#define ENDPOINT_NUMBER 0 + u32 ep_rsp; +#define SET_NAK_OUT_PACKETS 15 +#define SET_EP_HIDE_STATUS_PHASE 14 +#define SET_EP_FORCE_CRC_ERROR 13 +#define SET_INTERRUPT_MODE 12 +#define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11 +#define SET_NAK_OUT_PACKETS_MODE 10 +#define SET_ENDPOINT_TOGGLE 9 +#define SET_ENDPOINT_HALT 8 +#define CLEAR_NAK_OUT_PACKETS 7 +#define CLEAR_EP_HIDE_STATUS_PHASE 6 +#define CLEAR_EP_FORCE_CRC_ERROR 5 +#define CLEAR_INTERRUPT_MODE 4 +#define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3 +#define CLEAR_NAK_OUT_PACKETS_MODE 2 +#define CLEAR_ENDPOINT_TOGGLE 1 +#define CLEAR_ENDPOINT_HALT 0 + u32 ep_irqenb; +#define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6 +#define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5 +#define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3 +#define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2 +#define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1 +#define DATA_IN_TOKEN_INTERRUPT_ENABLE 0 + u32 ep_stat; +#define FIFO_VALID_COUNT 24 +#define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22 +#define TIMEOUT 21 +#define USB_STALL_SENT 20 +#define USB_IN_NAK_SENT 19 +#define USB_IN_ACK_RCVD 18 +#define USB_OUT_PING_NAK_SENT 17 +#define USB_OUT_ACK_SENT 16 +#define FIFO_OVERFLOW 13 +#define FIFO_UNDERFLOW 12 +#define FIFO_FULL 11 +#define FIFO_EMPTY 10 +#define FIFO_FLUSH 9 +#define SHORT_PACKET_OUT_DONE_INTERRUPT 6 +#define SHORT_PACKET_TRANSFERRED_INTERRUPT 5 +#define NAK_OUT_PACKETS 4 +#define DATA_PACKET_RECEIVED_INTERRUPT 3 +#define DATA_PACKET_TRANSMITTED_INTERRUPT 2 +#define DATA_OUT_PING_TOKEN_INTERRUPT 1 +#define DATA_IN_TOKEN_INTERRUPT 0 + // offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 + u32 ep_avail; + u32 ep_data; + u32 _unused0 [2]; +} __attribute__ ((packed)); + +#endif /* __LINUX_USB_NET2280_H */ diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index fadc535e292..dc7c621e464 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h @@ -12,6 +12,11 @@ #else #define MODULE_VERMAGIC_PREEMPT "" #endif +#ifdef CONFIG_MODULE_UNLOAD +#define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload " +#else +#define MODULE_VERMAGIC_MODULE_UNLOAD "" +#endif #ifndef MODULE_ARCH_VERMAGIC #define MODULE_ARCH_VERMAGIC "" #endif @@ -19,5 +24,5 @@ #define VERMAGIC_STRING \ UTS_RELEASE " " \ MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ - MODULE_ARCH_VERMAGIC \ + MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC \ "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index af2d6155d3f..d7670ec1ec1 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -966,66 +966,17 @@ struct v4l2_sliced_vbi_format /* Teletext World System Teletext (WST), defined on ITU-R BT.653-2 */ -#define V4L2_SLICED_TELETEXT_PAL_B (0x000001) -#define V4L2_SLICED_TELETEXT_PAL_C (0x000002) -#define V4L2_SLICED_TELETEXT_NTSC_B (0x000010) -#define V4L2_SLICED_TELETEXT_SECAM (0x000020) - -/* Teletext North American Broadcast Teletext Specification - (NABTS), defined on ITU-R BT.653-2 */ -#define V4L2_SLICED_TELETEXT_NTSC_C (0x000040) -#define V4L2_SLICED_TELETEXT_NTSC_D (0x000080) - +#define V4L2_SLICED_TELETEXT_B (0x0001) /* Video Program System, defined on ETS 300 231*/ -#define V4L2_SLICED_VPS (0x000400) - +#define V4L2_SLICED_VPS (0x0400) /* Closed Caption, defined on EIA-608 */ -#define V4L2_SLICED_CAPTION_525 (0x001000) -#define V4L2_SLICED_CAPTION_625 (0x002000) - +#define V4L2_SLICED_CAPTION_525 (0x1000) /* Wide Screen System, defined on ITU-R BT1119.1 */ -#define V4L2_SLICED_WSS_625 (0x004000) - -/* Wide Screen System, defined on IEC 61880 */ -#define V4L2_SLICED_WSS_525 (0x008000) - -/* Vertical Interval Timecode (VITC), defined on SMPTE 12M */ -#define V4l2_SLICED_VITC_625 (0x010000) -#define V4l2_SLICED_VITC_525 (0x020000) - -#define V4L2_SLICED_TELETEXT_B (V4L2_SLICED_TELETEXT_PAL_B |\ - V4L2_SLICED_TELETEXT_NTSC_B) - -#define V4L2_SLICED_TELETEXT (V4L2_SLICED_TELETEXT_PAL_B |\ - V4L2_SLICED_TELETEXT_PAL_C |\ - V4L2_SLICED_TELETEXT_SECAM |\ - V4L2_SLICED_TELETEXT_NTSC_B |\ - V4L2_SLICED_TELETEXT_NTSC_C |\ - V4L2_SLICED_TELETEXT_NTSC_D) - -#define V4L2_SLICED_CAPTION (V4L2_SLICED_CAPTION_525 |\ - V4L2_SLICED_CAPTION_625) - -#define V4L2_SLICED_WSS (V4L2_SLICED_WSS_525 |\ - V4L2_SLICED_WSS_625) - -#define V4L2_SLICED_VITC (V4L2_SLICED_VITC_525 |\ - V4L2_SLICED_VITC_625) - -#define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\ - V4L2_SLICED_TELETEXT_NTSC_C |\ - V4L2_SLICED_TELETEXT_NTSC_D |\ - V4L2_SLICED_CAPTION_525 |\ - V4L2_SLICED_WSS_525 |\ - V4l2_SLICED_VITC_525) - -#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\ - V4L2_SLICED_TELETEXT_PAL_C |\ - V4L2_SLICED_TELETEXT_SECAM |\ - V4L2_SLICED_VPS |\ - V4L2_SLICED_CAPTION_625 |\ - V4L2_SLICED_WSS_625 |\ - V4l2_SLICED_VITC_625) +#define V4L2_SLICED_WSS_625 (0x4000) + +#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) +#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) + struct v4l2_sliced_vbi_cap { diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h deleted file mode 100644 index dae9860091d..00000000000 --- a/include/linux/wanpipe.h +++ /dev/null @@ -1,483 +0,0 @@ -/***************************************************************************** -* wanpipe.h WANPIPE(tm) Multiprotocol WAN Link Driver. -* User-level API definitions. -* -* Author: Nenad Corbic <ncorbic@sangoma.com> -* Gideon Hack -* -* Copyright: (c) 1995-2000 Sangoma Technologies Inc. -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -* ============================================================================ -* Nov 3, 2000 Nenad Corbic Added config_id to sdla_t structure. -* Used to determine the protocol running. -* Jul 13, 2000 Nenad Corbic Added SyncPPP Support -* Feb 24, 2000 Nenad Corbic Added support for x25api driver -* Oct 04, 1999 Nenad Corbic New CHDLC and FRAME RELAY code, SMP support -* Jun 02, 1999 Gideon Hack Added 'update_call_count' for Cisco HDLC -* support -* Jun 26, 1998 David Fong Added 'ip_mode' in sdla_t.u.p for dynamic IP -* routing mode configuration -* Jun 12, 1998 David Fong Added Cisco HDLC union member in sdla_t -* Dec 08, 1997 Jaspreet Singh Added 'authenticator' in union of 'sdla_t' -* Nov 26, 1997 Jaspreet Singh Added 'load_sharing' structure. Also added -* 'devs_struct','dev_to_devtint_next' to 'sdla_t' -* Nov 24, 1997 Jaspreet Singh Added 'irq_dis_if_send_count', -* 'irq_dis_poll_count' to 'sdla_t'. -* Nov 06, 1997 Jaspreet Singh Added a define called 'INTR_TEST_MODE' -* Oct 20, 1997 Jaspreet Singh Added 'buff_intr_mode_unbusy' and -* 'dlci_intr_mode_unbusy' to 'sdla_t' -* Oct 18, 1997 Jaspreet Singh Added structure to maintain global driver -* statistics. -* Jan 15, 1997 Gene Kozin Version 3.1.0 -* o added UDP management stuff -* Jan 02, 1997 Gene Kozin Version 3.0.0 -*****************************************************************************/ -#ifndef _WANPIPE_H -#define _WANPIPE_H - -#include <linux/wanrouter.h> - -/* Defines */ - -#ifndef PACKED -#define PACKED __attribute__((packed)) -#endif - -#define WANPIPE_MAGIC 0x414C4453L /* signature: 'SDLA' reversed */ - -/* IOCTL numbers (up to 16) */ -#define WANPIPE_DUMP (ROUTER_USER+0) /* dump adapter's memory */ -#define WANPIPE_EXEC (ROUTER_USER+1) /* execute firmware command */ - -#define TRACE_ALL 0x00 -#define TRACE_PROT 0x01 -#define TRACE_DATA 0x02 - -/* values for request/reply byte */ -#define UDPMGMT_REQUEST 0x01 -#define UDPMGMT_REPLY 0x02 -#define UDP_OFFSET 12 - -#define MAX_CMD_BUFF 10 -#define MAX_X25_LCN 255 /* Maximum number of x25 channels */ -#define MAX_LCN_NUM 4095 /* Maximum lcn number */ -#define MAX_FT1_RETRY 100 - -#ifndef AF_WANPIPE - #define AF_WANPIPE 25 - #ifndef PF_WANPIPE - #define PF_WANPIPE AF_WANPIPE - #endif -#endif - - -#define TX_TIMEOUT 5*HZ - -/* General Critical Flags */ -#define SEND_CRIT 0x00 -#define PERI_CRIT 0x01 - -/* Chdlc and PPP polling critical flag */ -#define POLL_CRIT 0x03 - -/* Frame Relay Tx IRQ send critical flag */ -#define SEND_TXIRQ_CRIT 0x02 - -/* Frame Relay ARP critical flag */ -#define ARP_CRIT 0x03 - -/* Bit maps for dynamic interface configuration - * DYN_OPT_ON : turns this option on/off - * DEV_DOWN : device was shutdown by the driver not - * by user - */ -#define DYN_OPT_ON 0x00 -#define DEV_DOWN 0x01 - -/* - * Data structures for IOCTL calls. - */ - -typedef struct sdla_dump /* WANPIPE_DUMP */ -{ - unsigned long magic; /* for verification */ - unsigned long offset; /* absolute adapter memory address */ - unsigned long length; /* block length */ - void* ptr; /* -> buffer */ -} sdla_dump_t; - -typedef struct sdla_exec /* WANPIPE_EXEC */ -{ - unsigned long magic; /* for verification */ - void* cmd; /* -> command structure */ - void* data; /* -> data buffer */ -} sdla_exec_t; - -/* UDP management stuff */ - -typedef struct wum_header -{ - unsigned char signature[8]; /* 00h: signature */ - unsigned char type; /* 08h: request/reply */ - unsigned char command; /* 09h: commnand */ - unsigned char reserved[6]; /* 0Ah: reserved */ -} wum_header_t; - -/************************************************************************* - Data Structure for global statistics -*************************************************************************/ - -typedef struct global_stats -{ - unsigned long isr_entry; - unsigned long isr_already_critical; - unsigned long isr_rx; - unsigned long isr_tx; - unsigned long isr_intr_test; - unsigned long isr_spurious; - unsigned long isr_enable_tx_int; - unsigned long rx_intr_corrupt_rx_bfr; - unsigned long rx_intr_on_orphaned_DLCI; - unsigned long rx_intr_dev_not_started; - unsigned long tx_intr_dev_not_started; - unsigned long poll_entry; - unsigned long poll_already_critical; - unsigned long poll_processed; - unsigned long poll_tbusy_bad_status; - unsigned long poll_host_disable_irq; - unsigned long poll_host_enable_irq; - -} global_stats_t; - - -typedef struct{ - unsigned short udp_src_port PACKED; - unsigned short udp_dst_port PACKED; - unsigned short udp_length PACKED; - unsigned short udp_checksum PACKED; -} udp_pkt_t; - - -typedef struct { - unsigned char ver_inet_hdr_length PACKED; - unsigned char service_type PACKED; - unsigned short total_length PACKED; - unsigned short identifier PACKED; - unsigned short flags_frag_offset PACKED; - unsigned char ttl PACKED; - unsigned char protocol PACKED; - unsigned short hdr_checksum PACKED; - unsigned long ip_src_address PACKED; - unsigned long ip_dst_address PACKED; -} ip_pkt_t; - - -typedef struct { - unsigned char signature[8] PACKED; - unsigned char request_reply PACKED; - unsigned char id PACKED; - unsigned char reserved[6] PACKED; -} wp_mgmt_t; - -/************************************************************************* - Data Structure for if_send statistics -*************************************************************************/ -typedef struct if_send_stat{ - unsigned long if_send_entry; - unsigned long if_send_skb_null; - unsigned long if_send_broadcast; - unsigned long if_send_multicast; - unsigned long if_send_critical_ISR; - unsigned long if_send_critical_non_ISR; - unsigned long if_send_tbusy; - unsigned long if_send_tbusy_timeout; - unsigned long if_send_PIPE_request; - unsigned long if_send_wan_disconnected; - unsigned long if_send_dlci_disconnected; - unsigned long if_send_no_bfrs; - unsigned long if_send_adptr_bfrs_full; - unsigned long if_send_bfr_passed_to_adptr; - unsigned long if_send_protocol_error; - unsigned long if_send_bfr_not_passed_to_adptr; - unsigned long if_send_tx_int_enabled; - unsigned long if_send_consec_send_fail; -} if_send_stat_t; - -typedef struct rx_intr_stat{ - unsigned long rx_intr_no_socket; - unsigned long rx_intr_dev_not_started; - unsigned long rx_intr_PIPE_request; - unsigned long rx_intr_bfr_not_passed_to_stack; - unsigned long rx_intr_bfr_passed_to_stack; -} rx_intr_stat_t; - -typedef struct pipe_mgmt_stat{ - unsigned long UDP_PIPE_mgmt_kmalloc_err; - unsigned long UDP_PIPE_mgmt_direction_err; - unsigned long UDP_PIPE_mgmt_adptr_type_err; - unsigned long UDP_PIPE_mgmt_adptr_cmnd_OK; - unsigned long UDP_PIPE_mgmt_adptr_cmnd_timeout; - unsigned long UDP_PIPE_mgmt_adptr_send_passed; - unsigned long UDP_PIPE_mgmt_adptr_send_failed; - unsigned long UDP_PIPE_mgmt_not_passed_to_stack; - unsigned long UDP_PIPE_mgmt_passed_to_stack; - unsigned long UDP_PIPE_mgmt_no_socket; - unsigned long UDP_PIPE_mgmt_passed_to_adptr; -} pipe_mgmt_stat_t; - - -typedef struct { - struct sk_buff *skb; -} bh_data_t, cmd_data_t; - -#define MAX_LGTH_UDP_MGNT_PKT 2000 - - -/* This is used for interrupt testing */ -#define INTR_TEST_MODE 0x02 - -#define WUM_SIGNATURE_L 0x50495046 -#define WUM_SIGNATURE_H 0x444E3845 - -#define WUM_KILL 0x50 -#define WUM_EXEC 0x51 - -#define WANPIPE 0x00 -#define API 0x01 -#define BRIDGE 0x02 -#define BRIDGE_NODE 0x03 - -#ifdef __KERNEL__ -/****** Kernel Interface ****************************************************/ - -#include <linux/sdladrv.h> /* SDLA support module API definitions */ -#include <linux/sdlasfm.h> /* SDLA firmware module definitions */ -#include <linux/workqueue.h> -#include <linux/serial.h> -#include <linux/serialP.h> -#include <linux/serial_reg.h> -#include <asm/serial.h> -#include <linux/tty.h> -#include <linux/tty_driver.h> -#include <linux/tty_flip.h> - -/****** Data Structures *****************************************************/ - -/* Adapter Data Space. - * This structure is needed because we handle multiple cards, otherwise - * static data would do it. - */ -typedef struct sdla -{ - char devname[WAN_DRVNAME_SZ+1]; /* card name */ - sdlahw_t hw; /* hardware configuration */ - struct wan_device wandev; /* WAN device data space */ - - unsigned open_cnt; /* number of open interfaces */ - unsigned long state_tick; /* link state timestamp */ - unsigned intr_mode; /* Type of Interrupt Mode */ - char in_isr; /* interrupt-in-service flag */ - char buff_int_mode_unbusy; /* flag for carrying out dev_tint */ - char dlci_int_mode_unbusy; /* flag for carrying out dev_tint */ - long configured; /* flag for previous configurations */ - - unsigned short irq_dis_if_send_count; /* Disabling irqs in if_send*/ - unsigned short irq_dis_poll_count; /* Disabling irqs in poll routine*/ - unsigned short force_enable_irq; - char TracingEnabled; /* flag for enabling trace */ - global_stats_t statistics; /* global statistics */ - void* mbox; /* -> mailbox */ - void* rxmb; /* -> receive mailbox */ - void* flags; /* -> adapter status flags */ - void (*isr)(struct sdla* card); /* interrupt service routine */ - void (*poll)(struct sdla* card); /* polling routine */ - int (*exec)(struct sdla* card, void* u_cmd, void* u_data); - /* Used by the listen() system call */ - /* Wanpipe Socket Interface */ - int (*func) (struct sk_buff *, struct sock *); - struct sock *sk; - - /* Shutdown function */ - void (*disable_comm) (struct sdla *card); - - /* Secondary Port Device: Piggibacking */ - struct sdla *next; - - /* TTY driver variables */ - unsigned char tty_opt; - struct tty_struct *tty; - unsigned int tty_minor; - unsigned int tty_open; - unsigned char *tty_buf; - unsigned char *tty_rx; - struct work_struct tty_work; - - union - { - struct - { /****** X.25 specific data **********/ - u32 lo_pvc; - u32 hi_pvc; - u32 lo_svc; - u32 hi_svc; - struct net_device *svc_to_dev_map[MAX_X25_LCN]; - struct net_device *pvc_to_dev_map[MAX_X25_LCN]; - struct net_device *tx_dev; - struct net_device *cmd_dev; - u32 no_dev; - volatile u8 *hdlc_buf_status; - u32 tx_interrupts_pending; - u16 timer_int_enabled; - struct net_device *poll_device; - atomic_t command_busy; - - u16 udp_pkt_lgth; - u32 udp_type; - u8 udp_pkt_src; - u32 udp_lcn; - struct net_device *udp_dev; - s8 udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT]; - - u8 LAPB_hdlc; /* Option to turn off X25 and run only LAPB */ - u8 logging; /* Option to log call messages */ - u8 oob_on_modem; /* Option to send modem status to the api */ - u16 num_of_ch; /* Number of channels configured by the user */ - - struct work_struct x25_poll_work; - struct timer_list x25_timer; - } x; - struct - { /****** frame relay specific data ***/ - void* rxmb_base; /* -> first Rx buffer */ - void* rxmb_last; /* -> last Rx buffer */ - unsigned rx_base; /* S508 receive buffer base */ - unsigned rx_top; /* S508 receive buffer end */ - unsigned short node_dlci[100]; - unsigned short dlci_num; - struct net_device *dlci_to_dev_map[991 + 1]; - unsigned tx_interrupts_pending; - unsigned short timer_int_enabled; - unsigned short udp_pkt_lgth; - int udp_type; - char udp_pkt_src; - unsigned udp_dlci; - char udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT]; - void* trc_el_base; /* first trace element */ - void* trc_el_last; /* last trace element */ - void *curr_trc_el; /* current trace element */ - unsigned short trc_bfr_space; /* trace buffer space */ - unsigned char update_comms_stats; - struct net_device *arp_dev; - spinlock_t if_send_lock; - } f; - struct /****** PPP-specific data ***********/ - { - char if_name[WAN_IFNAME_SZ+1]; /* interface name */ - void* txbuf; /* -> current Tx buffer */ - void* txbuf_base; /* -> first Tx buffer */ - void* txbuf_last; /* -> last Tx buffer */ - void* rxbuf_base; /* -> first Rx buffer */ - void* rxbuf_last; /* -> last Rx buffer */ - unsigned rx_base; /* S508 receive buffer base */ - unsigned rx_top; /* S508 receive buffer end */ - char ip_mode; /* STATIC/HOST/PEER IP Mode */ - char authenticator; /* Authenticator for PAP/CHAP */ - unsigned char comm_enabled; /* Is comm enabled or not */ - unsigned char peer_route; /* Process Peer Route */ - unsigned long *txbuf_next; /* Next Tx buffer to use */ - unsigned long *rxbuf_next; /* Next Rx buffer to use */ - } p; - struct /* Cisco HDLC-specific data */ - { - char if_name[WAN_IFNAME_SZ+1]; /* interface name */ - unsigned char comm_port;/* Communication Port O or 1 */ - unsigned char usedby; /* Used by WANPIPE or API */ - void* rxmb; /* Receive mail box */ - void* flags; /* flags */ - void* tx_status; /* Tx status element */ - void* rx_status; /* Rx status element */ - void* txbuf; /* -> current Tx buffer */ - void* txbuf_base; /* -> first Tx buffer */ - void* txbuf_last; /* -> last Tx buffer */ - void* rxbuf_base; /* -> first Rx buffer */ - void* rxbuf_last; /* -> last Rx buffer */ - unsigned rx_base; /* S508 receive buffer base */ - unsigned rx_top; /* S508 receive buffer end */ - unsigned char receive_only; /* high speed receivers */ - unsigned short protocol_options; - unsigned short kpalv_tx; /* Tx kpalv timer */ - unsigned short kpalv_rx; /* Rx kpalv timer */ - unsigned short kpalv_err; /* Error tolerance */ - unsigned short slarp_timer; /* SLARP req timer */ - unsigned state; /* state of the link */ - unsigned char api_status; - unsigned char update_call_count; - unsigned short api_options; /* for async config */ - unsigned char async_mode; - unsigned short tx_bits_per_char; - unsigned short rx_bits_per_char; - unsigned short stop_bits; - unsigned short parity; - unsigned short break_timer; - unsigned short inter_char_timer; - unsigned short rx_complete_length; - unsigned short xon_char; - unsigned short xoff_char; - unsigned char comm_enabled; /* Is comm enabled or not */ - unsigned char backup; - } c; - struct - { - void* tx_status; /* Tx status element */ - void* rx_status; /* Rx status element */ - void* trace_status; /* Trace status element */ - void* txbuf; /* -> current Tx buffer */ - void* txbuf_base; /* -> first Tx buffer */ - void* txbuf_last; /* -> last Tx buffer */ - void* rxbuf_base; /* -> first Rx buffer */ - void* rxbuf_last; /* -> last Rx buffer */ - void* tracebuf; /* -> current Trace buffer */ - void* tracebuf_base; /* -> current Trace buffer */ - void* tracebuf_last; /* -> current Trace buffer */ - unsigned rx_base; /* receive buffer base */ - unsigned rx_end; /* receive buffer end */ - unsigned trace_base; /* trace buffer base */ - unsigned trace_end; /* trace buffer end */ - - } h; - } u; -} sdla_t; - -/****** Public Functions ****************************************************/ - -void wanpipe_open (sdla_t* card); /* wpmain.c */ -void wanpipe_close (sdla_t* card); /* wpmain.c */ -void wanpipe_set_state (sdla_t* card, int state); /* wpmain.c */ - -int wpx_init (sdla_t* card, wandev_conf_t* conf); /* wpx.c */ -int wpf_init (sdla_t* card, wandev_conf_t* conf); /* wpf.c */ -int wpp_init (sdla_t* card, wandev_conf_t* conf); /* wpp.c */ -int wpc_init (sdla_t* card, wandev_conf_t* conf); /* Cisco HDLC */ -int bsc_init (sdla_t* card, wandev_conf_t* conf); /* BSC streaming */ -int hdlc_init(sdla_t* card, wandev_conf_t* conf); /* HDLC support */ -int wpft1_init (sdla_t* card, wandev_conf_t* conf); /* FT1 Config support */ -int wsppp_init (sdla_t* card, wandev_conf_t* conf); /* Sync PPP on top of RAW CHDLC */ - -extern sdla_t * wanpipe_find_card(char *); -extern sdla_t * wanpipe_find_card_num (int); - -extern void wanpipe_queue_work (struct work_struct *); -extern void wanpipe_mark_bh (void); -extern void wakeup_sk_bh(struct net_device *dev); -extern int change_dev_flags(struct net_device *dev, unsigned flags); -extern unsigned long get_ip_address(struct net_device *dev, int option); -extern void add_gateway(sdla_t *card, struct net_device *dev); - - -#endif /* __KERNEL__ */ -#endif /* _WANPIPE_H */ - diff --git a/include/media/cx25840.h b/include/media/cx25840.h new file mode 100644 index 00000000000..8e7e52d659a --- /dev/null +++ b/include/media/cx25840.h @@ -0,0 +1,64 @@ +/* + cx25840.h - definition for cx25840/1/2/3 inputs + + Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _CX25840_H_ +#define _CX25840_H_ + +enum cx25840_video_input { + /* Composite video inputs In1-In8 */ + CX25840_COMPOSITE1 = 1, + CX25840_COMPOSITE2, + CX25840_COMPOSITE3, + CX25840_COMPOSITE4, + CX25840_COMPOSITE5, + CX25840_COMPOSITE6, + CX25840_COMPOSITE7, + CX25840_COMPOSITE8, + + /* S-Video inputs consist of one luma input (In1-In4) ORed with one + chroma input (In5-In8) */ + CX25840_SVIDEO_LUMA1 = 0x10, + CX25840_SVIDEO_LUMA2 = 0x20, + CX25840_SVIDEO_LUMA3 = 0x30, + CX25840_SVIDEO_LUMA4 = 0x40, + CX25840_SVIDEO_CHROMA4 = 0x400, + CX25840_SVIDEO_CHROMA5 = 0x500, + CX25840_SVIDEO_CHROMA6 = 0x600, + CX25840_SVIDEO_CHROMA7 = 0x700, + CX25840_SVIDEO_CHROMA8 = 0x800, + + /* S-Video aliases for common luma/chroma combinations */ + CX25840_SVIDEO1 = 0x510, + CX25840_SVIDEO2 = 0x620, + CX25840_SVIDEO3 = 0x730, + CX25840_SVIDEO4 = 0x840, +}; + +enum cx25840_audio_input { + /* Audio inputs: serial or In4-In8 */ + CX25840_AUDIO_SERIAL, + CX25840_AUDIO4 = 4, + CX25840_AUDIO5, + CX25840_AUDIO6, + CX25840_AUDIO7, + CX25840_AUDIO8, +}; + +#endif diff --git a/include/media/msp3400.h b/include/media/msp3400.h index 0be61a021d4..6ab854931c0 100644 --- a/include/media/msp3400.h +++ b/include/media/msp3400.h @@ -80,16 +80,16 @@ */ /* SCART input to DSP selection */ -#define MSP_IN_SCART_1 0 /* Pin SC1_IN */ -#define MSP_IN_SCART_2 1 /* Pin SC2_IN */ -#define MSP_IN_SCART_3 2 /* Pin SC3_IN */ -#define MSP_IN_SCART_4 3 /* Pin SC4_IN */ +#define MSP_IN_SCART1 0 /* Pin SC1_IN */ +#define MSP_IN_SCART2 1 /* Pin SC2_IN */ +#define MSP_IN_SCART3 2 /* Pin SC3_IN */ +#define MSP_IN_SCART4 3 /* Pin SC4_IN */ #define MSP_IN_MONO 6 /* Pin MONO_IN */ #define MSP_IN_MUTE 7 /* Mute DSP input */ #define MSP_SCART_TO_DSP(in) (in) /* Tuner input to demodulator and DSP selection */ -#define MSP_IN_TUNER_1 0 /* Analog Sound IF input pin ANA_IN1 */ -#define MSP_IN_TUNER_2 1 /* Analog Sound IF input pin ANA_IN2 */ +#define MSP_IN_TUNER1 0 /* Analog Sound IF input pin ANA_IN1 */ +#define MSP_IN_TUNER2 1 /* Analog Sound IF input pin ANA_IN2 */ #define MSP_TUNER_TO_DSP(in) ((in) << 3) /* The msp has up to 5 DSP outputs, each output can independently select @@ -109,14 +109,14 @@ DSP. This is currently not implemented. Also not implemented is the multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate a need for one of those features then additional support can be added. */ -#define MSP_DSP_OUT_TUNER 0 /* Tuner output */ -#define MSP_DSP_OUT_SCART 2 /* SCART output */ -#define MSP_DSP_OUT_I2S1 5 /* I2S1 output */ -#define MSP_DSP_OUT_I2S2 6 /* I2S2 output */ -#define MSP_DSP_OUT_I2S3 7 /* I2S3 output */ -#define MSP_DSP_OUT_MAIN_AVC 11 /* MAIN AVC processed output */ -#define MSP_DSP_OUT_MAIN 12 /* MAIN output */ -#define MSP_DSP_OUT_AUX 13 /* AUX output */ +#define MSP_DSP_IN_TUNER 0 /* Tuner DSP input */ +#define MSP_DSP_IN_SCART 2 /* SCART DSP input */ +#define MSP_DSP_IN_I2S1 5 /* I2S1 DSP input */ +#define MSP_DSP_IN_I2S2 6 /* I2S2 DSP input */ +#define MSP_DSP_IN_I2S3 7 /* I2S3 DSP input */ +#define MSP_DSP_IN_MAIN_AVC 11 /* MAIN AVC processed DSP input */ +#define MSP_DSP_IN_MAIN 12 /* MAIN DSP input */ +#define MSP_DSP_IN_AUX 13 /* AUX DSP input */ #define MSP_DSP_TO_MAIN(in) ((in) << 4) #define MSP_DSP_TO_AUX(in) ((in) << 8) #define MSP_DSP_TO_SCART1(in) ((in) << 12) @@ -125,16 +125,16 @@ /* Output SCART select: the SCART outputs can select which input to use. */ -#define MSP_OUT_SCART1 0 /* SCART1 input, bypassing the DSP */ -#define MSP_OUT_SCART2 1 /* SCART2 input, bypassing the DSP */ -#define MSP_OUT_SCART3 2 /* SCART3 input, bypassing the DSP */ -#define MSP_OUT_SCART4 3 /* SCART4 input, bypassing the DSP */ -#define MSP_OUT_SCART1_DA 4 /* DSP SCART1 output */ -#define MSP_OUT_SCART2_DA 5 /* DSP SCART2 output */ -#define MSP_OUT_MONO 6 /* MONO input, bypassing the DSP */ -#define MSP_OUT_MUTE 7 /* MUTE output */ -#define MSP_OUT_TO_SCART1(in) (in) -#define MSP_OUT_TO_SCART2(in) ((in) << 4) +#define MSP_SC_IN_SCART1 0 /* SCART1 input, bypassing the DSP */ +#define MSP_SC_IN_SCART2 1 /* SCART2 input, bypassing the DSP */ +#define MSP_SC_IN_SCART3 2 /* SCART3 input, bypassing the DSP */ +#define MSP_SC_IN_SCART4 3 /* SCART4 input, bypassing the DSP */ +#define MSP_SC_IN_DSP_SCART1 4 /* DSP SCART1 input */ +#define MSP_SC_IN_DSP_SCART2 5 /* DSP SCART2 input */ +#define MSP_SC_IN_MONO 6 /* MONO input, bypassing the DSP */ +#define MSP_SC_IN_MUTE 7 /* MUTE output */ +#define MSP_SC_TO_SCART1(in) (in) +#define MSP_SC_TO_SCART2(in) ((in) << 4) /* Shortcut macros */ #define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \ @@ -145,14 +145,14 @@ MSP_DSP_TO_SCART1(sc_i2s_src) | \ MSP_DSP_TO_SCART2(sc_i2s_src) | \ MSP_DSP_TO_I2S(sc_i2s_src)) -#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, \ - MSP_DSP_OUT_TUNER, MSP_DSP_OUT_TUNER) +#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \ + MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER) #define MSP_OUTPUT(sc) \ - (MSP_OUT_TO_SCART1(sc) | \ - MSP_OUT_TO_SCART2(sc)) + (MSP_SC_TO_SCART1(sc) | \ + MSP_SC_TO_SCART2(sc)) /* This equals the RESET position of the msp3400 ACB register */ -#define MSP_OUTPUT_DEFAULT (MSP_OUT_TO_SCART1(MSP_OUT_SCART3) | \ - MSP_OUT_TO_SCART2(MSP_OUT_SCART1_DA)) +#define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \ + MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1)) /* Tuner inputs vs. msp version */ /* Chip TUNER_1 TUNER_2 diff --git a/include/media/saa7115.h b/include/media/saa7115.h new file mode 100644 index 00000000000..6b4836f3f05 --- /dev/null +++ b/include/media/saa7115.h @@ -0,0 +1,37 @@ +/* + saa7115.h - definition for saa7113/4/5 inputs + + Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _SAA7115_H_ +#define _SAA7115_H_ + +/* SAA7113/4/5 HW inputs */ +#define SAA7115_COMPOSITE0 0 +#define SAA7115_COMPOSITE1 1 +#define SAA7115_COMPOSITE2 2 +#define SAA7115_COMPOSITE3 3 +#define SAA7115_COMPOSITE4 4 /* not available for the saa7113 */ +#define SAA7115_COMPOSITE5 5 /* not available for the saa7113 */ +#define SAA7115_SVIDEO0 6 +#define SAA7115_SVIDEO1 7 +#define SAA7115_SVIDEO2 8 +#define SAA7115_SVIDEO3 9 + +#endif + diff --git a/include/media/saa7127.h b/include/media/saa7127.h new file mode 100644 index 00000000000..bbcf862141a --- /dev/null +++ b/include/media/saa7127.h @@ -0,0 +1,41 @@ +/* + saa7127.h - definition for saa7126/7/8/9 inputs/outputs + + Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _SAA7127_H_ +#define _SAA7127_H_ + +/* Enumeration for the supported input types */ +enum saa7127_input_type { + SAA7127_INPUT_TYPE_NORMAL, + SAA7127_INPUT_TYPE_TEST_IMAGE +}; + +/* Enumeration for the supported output signal types */ +enum saa7127_output_type { + SAA7127_OUTPUT_TYPE_BOTH, + SAA7127_OUTPUT_TYPE_COMPOSITE, + SAA7127_OUTPUT_TYPE_SVIDEO, + SAA7127_OUTPUT_TYPE_RGB, + SAA7127_OUTPUT_TYPE_YUV_C, + SAA7127_OUTPUT_TYPE_YUV_V +}; + +#endif + diff --git a/include/media/upd64031a.h b/include/media/upd64031a.h new file mode 100644 index 00000000000..3ad6a32e1bc --- /dev/null +++ b/include/media/upd64031a.h @@ -0,0 +1,40 @@ +/* + * upd64031a - NEC Electronics Ghost Reduction input defines + * + * 2006 by Hans Verkuil (hverkuil@xs4all.nl) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _UPD64031A_H_ +#define _UPD64031A_H_ + +/* Ghost reduction modes */ +#define UPD64031A_GR_ON 0 +#define UPD64031A_GR_OFF 1 +#define UPD64031A_GR_THROUGH 3 + +/* Direct 3D/YCS Connection */ +#define UPD64031A_3DYCS_DISABLE (0 << 2) +#define UPD64031A_3DYCS_COMPOSITE (2 << 2) +#define UPD64031A_3DYCS_SVIDEO (3 << 2) + +/* Composite sync digital separation circuit */ +#define UPD64031A_COMPOSITE_EXTERNAL (1 << 4) + +/* Vertical sync digital separation circuit */ +#define UPD64031A_VERTICAL_EXTERNAL (1 << 5) + +#endif diff --git a/include/media/upd64083.h b/include/media/upd64083.h new file mode 100644 index 00000000000..59b6f32ba30 --- /dev/null +++ b/include/media/upd64083.h @@ -0,0 +1,58 @@ +/* + * upd6408x - NEC Electronics 3-Dimensional Y/C separation input defines + * + * 2006 by Hans Verkuil (hverkuil@xs4all.nl) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _UPD64083_H_ +#define _UPD64083_H_ + +/* There are two bits of information that the driver needs in order + to select the correct routing: the operating mode and the selection + of the Y input (external or internal). + + The first two operating modes expect a composite signal on the Y input, + the second two operating modes use both the Y and C inputs. + + Normally YCS_MODE is used for tuner and composite inputs, and the + YCNR mode is used for S-Video inputs. + + The external Y-ADC is selected when the composite input comes from a + upd64031a ghost reduction device. If this device is not present, or + the input is a S-Video signal, then the internal Y-ADC input should + be used. */ + +/* Operating modes: */ + +/* YCS mode: Y/C separation (burst locked clocking) */ +#define UPD64083_YCS_MODE 0 +/* YCS+ mode: 2D Y/C separation and YCNR (burst locked clocking) */ +#define UPD64083_YCS_PLUS_MODE 1 + +/* Note: the following two modes cannot be used in combination with the + external Y-ADC. */ +/* MNNR mode: frame comb type YNR+C delay (line locked clocking) */ +#define UPD64083_MNNR_MODE 2 +/* YCNR mode: frame recursive YCNR (burst locked clocking) */ +#define UPD64083_YCNR_MODE 3 + +/* Select external Y-ADC: this should be set if this device is used in + combination with the upd64031a ghost reduction device. + Otherwise leave at 0 (use internal Y-ADC). */ +#define UPD64083_EXT_Y_ADC (1 << 2) + +#endif diff --git a/include/net/arp.h b/include/net/arp.h index a13e30c35f4..643bded9f55 100644 --- a/include/net/arp.h +++ b/include/net/arp.h @@ -10,8 +10,6 @@ extern struct neigh_table arp_tbl; extern void arp_init(void); -extern int arp_rcv(struct sk_buff *skb, struct net_device *dev, - struct packet_type *pt, struct net_device *orig_dev); extern int arp_find(unsigned char *haddr, struct sk_buff *skb); extern int arp_ioctl(unsigned int cmd, void __user *arg); extern void arp_send(int type, int ptype, u32 dest_ip, diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 25f708ff020..59f0c83d55a 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h @@ -48,31 +48,7 @@ static inline int inet6_sk_ehashfn(const struct sock *sk) return inet6_ehashfn(laddr, lport, faddr, fport); } -static inline void __inet6_hash(struct inet_hashinfo *hashinfo, - struct sock *sk) -{ - struct hlist_head *list; - rwlock_t *lock; - - BUG_TRAP(sk_unhashed(sk)); - - if (sk->sk_state == TCP_LISTEN) { - list = &hashinfo->listening_hash[inet_sk_listen_hashfn(sk)]; - lock = &hashinfo->lhash_lock; - inet_listen_wlock(hashinfo); - } else { - unsigned int hash; - sk->sk_hash = hash = inet6_sk_ehashfn(sk); - hash &= (hashinfo->ehash_size - 1); - list = &hashinfo->ehash[hash].chain; - lock = &hashinfo->ehash[hash].lock; - write_lock(lock); - } - - __sk_add_node(sk, list); - sock_prot_inc_use(sk->sk_prot); - write_unlock(lock); -} +extern void __inet6_hash(struct inet_hashinfo *hashinfo, struct sock *sk); /* * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so @@ -80,52 +56,12 @@ static inline void __inet6_hash(struct inet_hashinfo *hashinfo, * * The sockhash lock must be held as a reader here. */ -static inline struct sock * - __inet6_lookup_established(struct inet_hashinfo *hashinfo, +extern struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo, const struct in6_addr *saddr, const u16 sport, const struct in6_addr *daddr, const u16 hnum, - const int dif) -{ - struct sock *sk; - const struct hlist_node *node; - const __u32 ports = INET_COMBINED_PORTS(sport, hnum); - /* Optimize here for direct hit, only listening connections can - * have wildcards anyways. - */ - unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport); - struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); - - prefetch(head->chain.first); - read_lock(&head->lock); - sk_for_each(sk, node, &head->chain) { - /* For IPV6 do the cheaper port and family tests first. */ - if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif)) - goto hit; /* You sunk my battleship! */ - } - /* Must check for a TIME_WAIT'er before going to listener hash. */ - sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) { - const struct inet_timewait_sock *tw = inet_twsk(sk); - - if(*((__u32 *)&(tw->tw_dport)) == ports && - sk->sk_family == PF_INET6) { - const struct inet6_timewait_sock *tw6 = inet6_twsk(sk); - - if (ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) && - ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) && - (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == dif)) - goto hit; - } - } - read_unlock(&head->lock); - return NULL; - -hit: - sock_hold(sk); - read_unlock(&head->lock); - return sk; -} + const int dif); extern struct sock *inet6_lookup_listener(struct inet_hashinfo *hashinfo, const struct in6_addr *daddr, diff --git a/include/net/ip.h b/include/net/ip.h index 8fe6156ca9b..3d2e5ca62a5 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -95,6 +95,7 @@ extern int ip_local_deliver(struct sk_buff *skb); extern int ip_mr_input(struct sk_buff *skb); extern int ip_output(struct sk_buff *skb); extern int ip_mc_output(struct sk_buff *skb); +extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); extern int ip_do_nat(struct sk_buff *skb); extern void ip_send_check(struct iphdr *ip); extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); diff --git a/include/net/sock.h b/include/net/sock.h index 2aa73c0ec6c..af2b0544586 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -938,28 +938,7 @@ static inline void sock_put(struct sock *sk) sk_free(sk); } -static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb) -{ - int rc = NET_RX_SUCCESS; - - if (sk_filter(sk, skb, 0)) - goto discard_and_relse; - - skb->dev = NULL; - - bh_lock_sock(sk); - if (!sock_owned_by_user(sk)) - rc = sk->sk_backlog_rcv(sk, skb); - else - sk_add_backlog(sk, skb); - bh_unlock_sock(sk); -out: - sock_put(sk); - return rc; -discard_and_relse: - kfree_skb(skb); - goto out; -} +extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb); /* Detach socket from process context. * Announce socket dead, detach it from wait queue and inode. @@ -1044,33 +1023,9 @@ sk_dst_reset(struct sock *sk) write_unlock(&sk->sk_dst_lock); } -static inline struct dst_entry * -__sk_dst_check(struct sock *sk, u32 cookie) -{ - struct dst_entry *dst = sk->sk_dst_cache; - - if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) { - sk->sk_dst_cache = NULL; - dst_release(dst); - return NULL; - } - - return dst; -} - -static inline struct dst_entry * -sk_dst_check(struct sock *sk, u32 cookie) -{ - struct dst_entry *dst = sk_dst_get(sk); +extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); - if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) { - sk_dst_reset(sk); - dst_release(dst); - return NULL; - } - - return dst; -} +extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) { @@ -1140,45 +1095,7 @@ extern void sk_reset_timer(struct sock *sk, struct timer_list* timer, extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); -static inline int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) -{ - int err = 0; - int skb_len; - - /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces - number of warnings when compiling with -W --ANK - */ - if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= - (unsigned)sk->sk_rcvbuf) { - err = -ENOMEM; - goto out; - } - - /* It would be deadlock, if sock_queue_rcv_skb is used - with socket lock! We assume that users of this - function are lock free. - */ - err = sk_filter(sk, skb, 1); - if (err) - goto out; - - skb->dev = NULL; - skb_set_owner_r(skb, sk); - - /* Cache the SKB length before we tack it onto the receive - * queue. Once it is added it no longer belongs to us and - * may be freed by other threads of control pulling packets - * from the queue. - */ - skb_len = skb->len; - - skb_queue_tail(&sk->sk_receive_queue, skb); - - if (!sock_flag(sk, SOCK_DEAD)) - sk->sk_data_ready(sk, skb_len); -out: - return err; -} +extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) { diff --git a/include/net/tcp.h b/include/net/tcp.h index 9418f4d1afb..3c989db8a7a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -405,9 +405,6 @@ extern int tcp_disconnect(struct sock *sk, int flags); extern void tcp_unhash(struct sock *sk); -extern int tcp_v4_hash_connecting(struct sock *sk); - - /* From syncookies.c */ extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, struct ip_options *opt); diff --git a/include/net/x25device.h b/include/net/x25device.h index 1a318374fae..1d10c879f7e 100644 --- a/include/net/x25device.h +++ b/include/net/x25device.h @@ -8,6 +8,7 @@ static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) { skb->mac.raw = skb->data; + skb->dev = dev; skb->pkt_type = PACKET_HOST; return htons(ETH_P_X25); diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 61b7504fc2b..afa508d92c9 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -143,6 +143,11 @@ struct xfrm_state /* Replay detection state at the time we sent the last notification */ struct xfrm_replay_state preplay; + /* internal flag that only holds state for delayed aevent at the + * moment + */ + u32 xflags; + /* Replay detection notification settings */ u32 replay_maxage; u32 replay_maxdiff; @@ -168,6 +173,9 @@ struct xfrm_state void *data; }; +/* xflags - make enum if more show up */ +#define XFRM_TIME_DEFER 1 + enum { XFRM_STATE_VOID, XFRM_STATE_ACQ, @@ -242,7 +250,6 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); extern void xfrm_state_delete_tunnel(struct xfrm_state *x); -struct xfrm_decap_state; struct xfrm_type { char *description; @@ -251,7 +258,7 @@ struct xfrm_type int (*init_state)(struct xfrm_state *x); void (*destructor)(struct xfrm_state *); - int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); + int (*input)(struct xfrm_state *, struct sk_buff *skb); int (*output)(struct xfrm_state *, struct sk_buff *pskb); /* Estimate maximal size of result of transformation of a dgram */ u32 (*get_max_size)(struct xfrm_state *, int size); @@ -606,25 +613,11 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); -/* Decapsulation state, used by the input to store data during - * decapsulation procedure, to be used later (during the policy - * check - */ -struct xfrm_decap_state { - char decap_data[20]; - __u16 decap_type; -}; - -struct sec_decap_state { - struct xfrm_state *xvec; - struct xfrm_decap_state decap; -}; - struct sec_path { atomic_t refcnt; int len; - struct sec_decap_state x[XFRM_MAX_DEPTH]; + struct xfrm_state *xvec[XFRM_MAX_DEPTH]; }; static inline struct sec_path * @@ -864,13 +857,19 @@ struct xfrm_algo_desc { /* XFRM tunnel handlers. */ struct xfrm_tunnel { int (*handler)(struct sk_buff *skb); - void (*err_handler)(struct sk_buff *skb, __u32 info); + int (*err_handler)(struct sk_buff *skb, __u32 info); + + struct xfrm_tunnel *next; + int priority; }; struct xfrm6_tunnel { - int (*handler)(struct sk_buff **pskb); - void (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, - int type, int code, int offset, __u32 info); + int (*handler)(struct sk_buff *skb); + int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, + int type, int code, int offset, __u32 info); + + struct xfrm6_tunnel *next; + int priority; }; extern void xfrm_init(void); @@ -906,7 +905,7 @@ extern int xfrm4_rcv(struct sk_buff *skb); extern int xfrm4_output(struct sk_buff *skb); extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); -extern int xfrm6_rcv_spi(struct sk_buff **pskb, u32 spi); +extern int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi); extern int xfrm6_rcv(struct sk_buff **pskb); extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler); extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h index b53b78d497b..6bc7472293b 100644 --- a/include/pcmcia/bulkmem.h +++ b/include/pcmcia/bulkmem.h @@ -35,7 +35,7 @@ typedef struct region_info_t { #define REGION_BAR_MASK 0xe000 #define REGION_BAR_SHIFT 13 -int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn); -int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn); +int pcmcia_get_first_region(struct pcmcia_device *handle, region_info_t *rgn); +int pcmcia_get_next_region(struct pcmcia_device *handle, region_info_t *rgn); #endif /* _LINUX_BULKMEM_H */ diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index da19c297dd6..c1da8558339 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h @@ -1,5 +1,5 @@ /* - * ciscode.h -- Definitions for bulk memory services + * ciscode.h * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -122,4 +122,7 @@ #define MANFID_XIRCOM 0x0105 +#define MANFID_POSSIO 0x030c +#define PRODID_POSSIO_GCC 0x0003 + #endif /* _LINUX_CISCODE_H */ diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h index c6a069554fd..d3bbb19caf8 100644 --- a/include/pcmcia/cistpl.h +++ b/include/pcmcia/cistpl.h @@ -586,12 +586,7 @@ typedef struct cisdump_t { cisdata_t Data[CISTPL_MAX_CIS_SIZE]; } cisdump_t; -int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple); -int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple); -int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple); -int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse); -int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info); int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis); /* don't use outside of PCMCIA core yet */ @@ -602,4 +597,20 @@ int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse); int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info); +/* ... but use these wrappers instead */ +#define pcmcia_get_first_tuple(p_dev, tuple) \ + pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple) + +#define pcmcia_get_next_tuple(p_dev, tuple) \ + pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple) + +#define pcmcia_get_tuple_data(p_dev, tuple) \ + pccard_get_tuple_data(p_dev->socket, tuple) + +#define pcmcia_parse_tuple(p_dev, tuple, parse) \ + pccard_parse_tuple(tuple, parse) + +#define pcmcia_validate_cis(p_dev, info) \ + pccard_validate_cis(p_dev->socket, p_dev->func, info) + #endif /* LINUX_CISTPL_H */ diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 52660f32663..d5838c30d20 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -109,17 +109,6 @@ typedef struct client_req_t { #define CLIENT_THIS_SOCKET 0x01 -/* For RegisterClient */ -typedef struct client_reg_t { - dev_info_t *dev_info; - u_int Attributes; /* UNUSED */ - u_int EventMask; - int (*event_handler)(event_t event, int priority, - event_callback_args_t *); - event_callback_args_t event_callback_args; - u_int Version; -} client_reg_t; - /* ModifyConfiguration */ typedef struct modconf_t { u_int Attributes; @@ -127,15 +116,16 @@ typedef struct modconf_t { } modconf_t; /* Attributes for ModifyConfiguration */ -#define CONF_IRQ_CHANGE_VALID 0x100 -#define CONF_VCC_CHANGE_VALID 0x200 -#define CONF_VPP1_CHANGE_VALID 0x400 -#define CONF_VPP2_CHANGE_VALID 0x800 +#define CONF_IRQ_CHANGE_VALID 0x0100 +#define CONF_VCC_CHANGE_VALID 0x0200 +#define CONF_VPP1_CHANGE_VALID 0x0400 +#define CONF_VPP2_CHANGE_VALID 0x0800 +#define CONF_IO_CHANGE_WIDTH 0x1000 /* For RequestConfiguration */ typedef struct config_req_t { u_int Attributes; - u_int Vcc, Vpp1, Vpp2; + u_int Vpp; /* both Vpp1 and Vpp2 */ u_int IntType; u_int ConfigBase; u_char Status, Pin, Copy, ExtStatus; @@ -389,23 +379,27 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status); int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); -int pcmcia_release_configuration(struct pcmcia_device *p_dev); -int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req); -int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req); int pcmcia_release_window(window_handle_t win); int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); -int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req); int pcmcia_suspend_card(struct pcmcia_socket *skt); int pcmcia_resume_card(struct pcmcia_socket *skt); int pcmcia_eject_card(struct pcmcia_socket *skt); int pcmcia_insert_card(struct pcmcia_socket *skt); +int pccard_reset_card(struct pcmcia_socket *skt); + +struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *p_dev); +void pcmcia_disable_device(struct pcmcia_device *p_dev); struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); void pcmcia_put_socket(struct pcmcia_socket *skt); +/* compatibility functions */ +#define pcmcia_reset_card(p_dev, req) \ + pccard_reset_card(p_dev->socket) + #endif /* __KERNEL__ */ #endif /* _LINUX_CS_H */ diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 8e2a9639647..8c339f5678c 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -39,7 +39,7 @@ typedef struct win_info_t { typedef struct bind_info_t { dev_info_t dev_info; u_char function; - struct dev_link_t *instance; + struct pcmcia_device *instance; char name[DEV_NAME_LEN]; u_short major, minor; void *next; @@ -96,6 +96,7 @@ typedef union ds_ioctl_arg_t { #ifdef __KERNEL__ #include <linux/device.h> +#include <pcmcia/ss.h> typedef struct dev_node_t { char dev_name[DEV_NAME_LEN]; @@ -103,34 +104,9 @@ typedef struct dev_node_t { struct dev_node_t *next; } dev_node_t; -typedef struct dev_link_t { - dev_node_t *dev; - u_int state, open; - wait_queue_head_t pending; - client_handle_t handle; - io_req_t io; - irq_req_t irq; - config_req_t conf; - window_handle_t win; - void *priv; - struct dev_link_t *next; -} dev_link_t; - -/* Flags for device state */ -#define DEV_PRESENT 0x01 -#define DEV_CONFIG 0x02 -#define DEV_STALE_CONFIG 0x04 /* release on close */ -#define DEV_STALE_LINK 0x08 /* detach on release */ -#define DEV_CONFIG_PENDING 0x10 -#define DEV_RELEASE_PENDING 0x20 -#define DEV_SUSPEND 0x40 -#define DEV_BUSY 0x80 - -#define DEV_OK(l) \ - ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))) - struct pcmcia_socket; +struct config_t; struct pcmcia_driver { int (*probe) (struct pcmcia_device *dev); @@ -148,6 +124,7 @@ struct pcmcia_driver { int pcmcia_register_driver(struct pcmcia_driver *driver); void pcmcia_unregister_driver(struct pcmcia_driver *driver); + struct pcmcia_device { /* the socket and the device_no [for multifunction devices] uniquely define a pcmcia_device */ @@ -160,21 +137,40 @@ struct pcmcia_device { /* the hardware "function" device; certain subdevices can * share one hardware "function" device. */ u8 func; + struct config_t* function_config; struct list_head socket_device_list; - /* deprecated, a cleaned up version will be moved into this - struct soon */ - dev_link_t *instance; - u_int state; + /* deprecated, will be cleaned up soon */ + dev_node_t *dev_node; + u_int open; + io_req_t io; + irq_req_t irq; + config_req_t conf; + window_handle_t win; + + /* Is the device suspended, or in the process of + * being removed? */ + u16 suspended:1; + u16 _removed:1; + + /* Flags whether io, irq, win configurations were + * requested, and whether the configuration is "locked" */ + u16 _irq:1; + u16 _io:1; + u16 _win:4; + u16 _locked:1; + + /* Flag whether a "fuzzy" func_id based match is + * allowed. */ + u16 allow_func_id_match:1; /* information about this device */ - u8 has_manf_id:1; - u8 has_card_id:1; - u8 has_func_id:1; + u16 has_manf_id:1; + u16 has_card_id:1; + u16 has_func_id:1; - u8 allow_func_id_match:1; - u8 reserved:4; + u16 reserved:3; u8 func_id; u16 manf_id; @@ -182,22 +178,24 @@ struct pcmcia_device { char * prod_id[4]; + struct device dev; + +#ifdef CONFIG_PCMCIA_IOCTL /* device driver wanted by cardmgr */ struct pcmcia_driver * cardmgr; +#endif - struct device dev; + /* data private to drivers */ + void *priv; }; #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) -#define handle_to_pdev(handle) (handle) #define handle_to_dev(handle) (handle->dev) -#define dev_to_instance(dev) (dev->instance) - /* error reporting */ -void cs_error(client_handle_t handle, int func, int ret); +void cs_error(struct pcmcia_device *handle, int func, int ret); #endif /* __KERNEL__ */ #endif /* _LINUX_DS_H */ diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 2889a69a7a8..5e0a01ab221 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -18,6 +18,7 @@ #include <linux/config.h> #include <linux/device.h> #include <linux/sched.h> /* task_struct, completion */ +#include <linux/mutex.h> #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> @@ -146,14 +147,15 @@ extern struct pccard_resource_ops pccard_static_ops; /* !SS_CAP_STATIC_MAP */ extern struct pccard_resource_ops pccard_nonstatic_ops; +/* static mem, dynamic IO sockets */ +extern struct pccard_resource_ops pccard_iodyn_ops; + /* * Calls to set up low-level "Socket Services" drivers */ struct pcmcia_socket; typedef struct io_window_t { - u_int Attributes; - kio_addr_t BasePort, NumPorts; kio_addr_t InUse, Config; struct resource *res; } io_window_t; @@ -162,7 +164,7 @@ typedef struct io_window_t { typedef struct window_t { u_short magic; u_short index; - client_handle_t handle; + struct pcmcia_device *handle; struct pcmcia_socket *sock; pccard_mem_map ctl; } window_t; @@ -186,7 +188,6 @@ struct pcmcia_socket { u_short lock_count; pccard_mem_map cis_mem; void __iomem *cis_virt; - struct config_t *config; struct { u_int AssignedIRQ; u_int Config; @@ -241,7 +242,7 @@ struct pcmcia_socket { #endif /* state thread */ - struct semaphore skt_sem; /* protects socket h/w state */ + struct mutex skt_mutex; /* protects socket h/w state */ struct task_struct *thread; struct completion thread_done; diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index 51ab8eddb29..5ff77558013 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h @@ -3,7 +3,7 @@ * Copyright (c) 2004 Infinicon Corporation. All rights reserved. * Copyright (c) 2004 Intel Corporation. All rights reserved. * Copyright (c) 2004 Topspin Corporation. All rights reserved. - * Copyright (c) 2004 Voltaire Corporation. All rights reserved. + * Copyright (c) 2004-2006 Voltaire Corporation. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -55,6 +55,10 @@ #define IB_MGMT_CLASS_DEVICE_MGMT 0x06 #define IB_MGMT_CLASS_CM 0x07 #define IB_MGMT_CLASS_SNMP 0x08 +#define IB_MGMT_CLASS_DEVICE_ADM 0x10 +#define IB_MGMT_CLASS_BOOT_MGMT 0x11 +#define IB_MGMT_CLASS_BIS 0x12 +#define IB_MGMT_CLASS_CONG_MGMT 0x21 #define IB_MGMT_CLASS_VENDOR_RANGE2_START 0x30 #define IB_MGMT_CLASS_VENDOR_RANGE2_END 0x4F @@ -117,6 +121,8 @@ enum { IB_MGMT_VENDOR_DATA = 216, IB_MGMT_SA_HDR = 56, IB_MGMT_SA_DATA = 200, + IB_MGMT_DEVICE_HDR = 64, + IB_MGMT_DEVICE_DATA = 192, }; struct ib_mad_hdr { @@ -603,6 +609,25 @@ struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, gfp_t gfp_mask); /** + * ib_is_mad_class_rmpp - returns whether given management class + * supports RMPP. + * @mgmt_class: management class + * + * This routine returns whether the management class supports RMPP. + */ +int ib_is_mad_class_rmpp(u8 mgmt_class); + +/** + * ib_get_mad_data_offset - returns the data offset for a given + * management class. + * @mgmt_class: management class + * + * This routine returns the data offset in the MAD for the management + * class requested. + */ +int ib_get_mad_data_offset(u8 mgmt_class); + +/** * ib_get_rmpp_segment - returns the data buffer for a given RMPP segment. * @send_buf: Previously allocated send data buffer. * @seg_num: number of segment to return diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index f404fe21cc2..ad63c215efe 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h @@ -91,34 +91,6 @@ enum ib_sa_selector { IB_SA_BEST = 3 }; -enum ib_sa_rate { - IB_SA_RATE_2_5_GBPS = 2, - IB_SA_RATE_5_GBPS = 5, - IB_SA_RATE_10_GBPS = 3, - IB_SA_RATE_20_GBPS = 6, - IB_SA_RATE_30_GBPS = 4, - IB_SA_RATE_40_GBPS = 7, - IB_SA_RATE_60_GBPS = 8, - IB_SA_RATE_80_GBPS = 9, - IB_SA_RATE_120_GBPS = 10 -}; - -static inline int ib_sa_rate_enum_to_int(enum ib_sa_rate rate) -{ - switch (rate) { - case IB_SA_RATE_2_5_GBPS: return 1; - case IB_SA_RATE_5_GBPS: return 2; - case IB_SA_RATE_10_GBPS: return 4; - case IB_SA_RATE_20_GBPS: return 8; - case IB_SA_RATE_30_GBPS: return 12; - case IB_SA_RATE_40_GBPS: return 16; - case IB_SA_RATE_60_GBPS: return 24; - case IB_SA_RATE_80_GBPS: return 32; - case IB_SA_RATE_120_GBPS: return 48; - default: return -1; - } -} - /* * Structures for SA records are named "struct ib_sa_xxx_rec." No * attempt is made to pack structures to match the physical layout of diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index c1ad6273ac6..6bbf1b36440 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -314,6 +314,34 @@ enum ib_ah_flags { IB_AH_GRH = 1 }; +enum ib_rate { + IB_RATE_PORT_CURRENT = 0, + IB_RATE_2_5_GBPS = 2, + IB_RATE_5_GBPS = 5, + IB_RATE_10_GBPS = 3, + IB_RATE_20_GBPS = 6, + IB_RATE_30_GBPS = 4, + IB_RATE_40_GBPS = 7, + IB_RATE_60_GBPS = 8, + IB_RATE_80_GBPS = 9, + IB_RATE_120_GBPS = 10 +}; + +/** + * ib_rate_to_mult - Convert the IB rate enum to a multiple of the + * base rate of 2.5 Gbit/sec. For example, IB_RATE_5_GBPS will be + * converted to 2, since 5 Gbit/sec is 2 * 2.5 Gbit/sec. + * @rate: rate to convert. + */ +int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; + +/** + * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate + * enum. + * @mult: multiple to convert. + */ +enum ib_rate mult_to_ib_rate(int mult) __attribute_const__; + struct ib_ah_attr { struct ib_global_route grh; u16 dlid; diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h index 174101b2069..d31b16d25a0 100644 --- a/include/scsi/scsi_devinfo.h +++ b/include/scsi/scsi_devinfo.h @@ -28,4 +28,5 @@ #define BLIST_NO_ULD_ATTACH 0x100000 /* device is actually for RAID config */ #define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */ #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ +#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ #endif diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index dc6862d09e5..de6ce541a04 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -140,7 +140,6 @@ struct scsi_host_template { * * Status: REQUIRED (at least one of them) */ - int (* eh_strategy_handler)(struct Scsi_Host *); int (* eh_abort_handler)(struct scsi_cmnd *); int (* eh_device_reset_handler)(struct scsi_cmnd *); int (* eh_bus_reset_handler)(struct scsi_cmnd *); diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h index d4be4d92d58..edb9525386d 100644 --- a/include/scsi/scsi_ioctl.h +++ b/include/scsi/scsi_ioctl.h @@ -41,8 +41,6 @@ typedef struct scsi_fctargaddress { } Scsi_FCTargAddress; extern int scsi_ioctl(struct scsi_device *, int, void __user *); -extern int scsi_ioctl_send_command(struct scsi_device *, - struct scsi_ioctl_command __user *); extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, void __user *arg, struct file *filp); diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index b3657f11193..cca1d4926d2 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h @@ -50,6 +50,11 @@ struct scsi_transport_template { unsigned int create_work_queue : 1; /* + * Allows a transport to override the default error handler. + */ + void (* eh_strategy_handler)(struct Scsi_Host *); + + /* * This is an optional routine that allows the transport to become * involved when a scsi io timer fires. The return value tells the * timer routine how to finish the io timeout handling: diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index cf3fec8be1e..5626225bd3a 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h @@ -202,12 +202,19 @@ struct fc_rport { /* aka fc_starget_attrs */ /* internal data */ unsigned int channel; u32 number; + u8 flags; struct list_head peers; struct device dev; struct work_struct dev_loss_work; struct work_struct scan_work; + struct work_struct stgt_delete_work; + struct work_struct rport_delete_work; } __attribute__((aligned(sizeof(unsigned long)))); +/* bit field values for struct fc_rport "flags" field: */ +#define FC_RPORT_DEVLOSS_PENDING 0x01 +#define FC_RPORT_SCAN_PENDING 0x02 + #define dev_to_rport(d) \ container_of(d, struct fc_rport, dev) #define transport_class_to_rport(classdev) \ @@ -327,13 +334,16 @@ struct fc_host_attrs { struct list_head rport_bindings; u32 next_rport_number; u32 next_target_id; - u8 flags; - struct work_struct rport_del_work; -}; -/* values for struct fc_host_attrs "flags" field: */ -#define FC_SHOST_RPORT_DEL_SCHEDULED 0x01 + /* work queues for rport state manipulation */ + char work_q_name[KOBJ_NAME_LEN]; + struct workqueue_struct *work_q; + char devloss_work_q_name[KOBJ_NAME_LEN]; + struct workqueue_struct *devloss_work_q; +}; +#define shost_to_fc_host(x) \ + ((struct fc_host_attrs *)(x)->shost_data) #define fc_host_node_name(x) \ (((struct fc_host_attrs *)(x)->shost_data)->node_name) @@ -375,10 +385,14 @@ struct fc_host_attrs { (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) #define fc_host_next_target_id(x) \ (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) -#define fc_host_flags(x) \ - (((struct fc_host_attrs *)(x)->shost_data)->flags) -#define fc_host_rport_del_work(x) \ - (((struct fc_host_attrs *)(x)->shost_data)->rport_del_work) +#define fc_host_work_q_name(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->work_q_name) +#define fc_host_work_q(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->work_q) +#define fc_host_devloss_work_q_name(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name) +#define fc_host_devloss_work_q(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q) /* The functions by which the transport class and the driver communicate */ @@ -461,10 +475,15 @@ fc_remote_port_chkready(struct fc_rport *rport) switch (rport->port_state) { case FC_PORTSTATE_ONLINE: - result = 0; + if (rport->roles & FC_RPORT_ROLE_FCP_TARGET) + result = 0; + else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) + result = DID_IMM_RETRY << 16; + else + result = DID_NO_CONNECT << 16; break; case FC_PORTSTATE_BLOCKED: - result = DID_BUS_BUSY << 16; + result = DID_IMM_RETRY << 16; break; default: result = DID_NO_CONNECT << 16; diff --git a/include/sound/core.h b/include/sound/core.h index 7f32c12b4a0..5135147f20e 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -170,13 +170,13 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int st } /* init.c */ -int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file); +int snd_power_wait(struct snd_card *card, unsigned int power_state); #else /* ! CONFIG_PM */ #define snd_power_lock(card) do { (void)(card); } while (0) #define snd_power_unlock(card) do { (void)(card); } while (0) -static inline int snd_power_wait(struct snd_card *card, unsigned int state, struct file *file) { return 0; } +static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; } #define snd_power_get_state(card) SNDRV_CTL_POWER_D0 #define snd_power_change_state(card, state) do { (void)(card); } while (0) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 15b885660bf..df70e7592ab 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -367,8 +367,9 @@ struct snd_pcm_substream { struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ struct snd_pcm_group *group; /* pointer to current group */ /* -- assigned files -- */ - struct snd_pcm_file *file; + void *file; struct file *ffile; + void (*pcm_release)(struct snd_pcm_substream *); #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) /* -- OSS things -- */ struct snd_pcm_oss_substream oss; @@ -381,13 +382,10 @@ struct snd_pcm_substream { struct snd_info_entry *proc_prealloc_entry; /* misc flags */ unsigned int no_mmap_ctrl: 1; + unsigned int hw_opened: 1; }; -#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) -#define SUBSTREAM_BUSY(substream) ((substream)->file != NULL || ((substream)->oss.file != NULL)) -#else #define SUBSTREAM_BUSY(substream) ((substream)->file != NULL) -#endif struct snd_pcm_str { @@ -460,7 +458,6 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream, struct snd_pcm_info __user *info); int snd_pcm_status(struct snd_pcm_substream *substream, struct snd_pcm_status *status); -int snd_pcm_prepare(struct snd_pcm_substream *substream); int snd_pcm_start(struct snd_pcm_substream *substream); int snd_pcm_stop(struct snd_pcm_substream *substream, int status); int snd_pcm_drain_done(struct snd_pcm_substream *substream); @@ -468,11 +465,13 @@ int snd_pcm_drain_done(struct snd_pcm_substream *substream); int snd_pcm_suspend(struct snd_pcm_substream *substream); int snd_pcm_suspend_all(struct snd_pcm *pcm); #endif -int snd_pcm_kernel_playback_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); -int snd_pcm_kernel_capture_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); -int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct snd_pcm_substream **rsubstream); +int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct file *file, + struct snd_pcm_substream **rsubstream); void snd_pcm_release_substream(struct snd_pcm_substream *substream); +int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, struct file *file, + struct snd_pcm_substream **rsubstream); +void snd_pcm_detach_substream(struct snd_pcm_substream *substream); void snd_pcm_vma_notify_data(void *client, void *data); int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); @@ -899,7 +898,6 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); -const char *snd_pcm_format_name(snd_pcm_format_t format); void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); void snd_pcm_set_sync(struct snd_pcm_substream *substream); diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h index bff0778e196..39df2baca18 100644 --- a/include/sound/pcm_oss.h +++ b/include/sound/pcm_oss.h @@ -69,8 +69,7 @@ struct snd_pcm_oss_file { struct snd_pcm_oss_substream { unsigned oss: 1; /* oss mode */ - struct snd_pcm_oss_setup *setup; /* active setup */ - struct snd_pcm_oss_file *file; + struct snd_pcm_oss_setup setup; /* active setup */ }; struct snd_pcm_oss_stream { |