Merge branch 'dmaengine' into async-tx-next
Conflicts: crypto/async_tx/async_xor.c drivers/dma/ioat/dma_v2.h drivers/dma/ioat/pci.c drivers/md/raid5.c
This commit is contained in:
@@ -57,6 +57,7 @@ header-y += dlmconstants.h
|
||||
header-y += dlm_device.h
|
||||
header-y += dlm_netlink.h
|
||||
header-y += dm-ioctl.h
|
||||
header-y += dm-log-userspace.h
|
||||
header-y += dn.h
|
||||
header-y += dqblk_xfs.h
|
||||
header-y += efs_fs_sb.h
|
||||
@@ -135,6 +136,7 @@ header-y += posix_types.h
|
||||
header-y += ppdev.h
|
||||
header-y += prctl.h
|
||||
header-y += qnxtypes.h
|
||||
header-y += qnx4_fs.h
|
||||
header-y += radeonfb.h
|
||||
header-y += raw.h
|
||||
header-y += resource.h
|
||||
@@ -307,10 +309,11 @@ unifdef-y += pmu.h
|
||||
unifdef-y += poll.h
|
||||
unifdef-y += ppp_defs.h
|
||||
unifdef-y += ppp-comp.h
|
||||
unifdef-y += pps.h
|
||||
unifdef-y += ptrace.h
|
||||
unifdef-y += qnx4_fs.h
|
||||
unifdef-y += quota.h
|
||||
unifdef-y += random.h
|
||||
unifdef-y += rfkill.h
|
||||
unifdef-y += irqnr.h
|
||||
unifdef-y += reboot.h
|
||||
unifdef-y += reiserfs_fs.h
|
||||
|
@@ -113,13 +113,10 @@ void acpi_irq_stats_init(void);
|
||||
extern u32 acpi_irq_handled;
|
||||
extern u32 acpi_irq_not_handled;
|
||||
|
||||
extern struct acpi_mcfg_allocation *pci_mmcfg_config;
|
||||
extern int pci_mmcfg_config_num;
|
||||
|
||||
extern int sbf_port;
|
||||
extern unsigned long acpi_realmode_flags;
|
||||
|
||||
int acpi_register_gsi (u32 gsi, int triggering, int polarity);
|
||||
int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
|
||||
int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
|
||||
|
||||
#ifdef CONFIG_X86_IO_APIC
|
||||
@@ -293,7 +290,10 @@ void __init acpi_s4_no_nvs(void);
|
||||
OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL)
|
||||
|
||||
extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags);
|
||||
extern void acpi_early_init(void);
|
||||
|
||||
#else /* CONFIG_ACPI */
|
||||
static inline void acpi_early_init(void) { }
|
||||
|
||||
static inline int early_acpi_boot_init(void)
|
||||
{
|
||||
|
@@ -41,8 +41,6 @@ struct adfs_discrecord {
|
||||
#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/adfs_fs_i.h>
|
||||
#include <linux/adfs_fs_sb.h>
|
||||
/*
|
||||
* Calculate the boot block checksum on an ADFS drive. Note that this will
|
||||
* appear to be correct if the sector contains all zeros, so also check that
|
||||
@@ -60,17 +58,6 @@ static inline int adfs_checkbblk(unsigned char *ptr)
|
||||
|
||||
return (result & 0xff) != ptr[511];
|
||||
}
|
||||
|
||||
static inline struct adfs_sb_info *ADFS_SB(struct super_block *sb)
|
||||
{
|
||||
return sb->s_fs_info;
|
||||
}
|
||||
|
||||
static inline struct adfs_inode_info *ADFS_I(struct inode *inode)
|
||||
{
|
||||
return container_of(inode, struct adfs_inode_info, vfs_inode);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* linux/include/linux/adfs_fs_i.h
|
||||
*
|
||||
* Copyright (C) 1997 Russell King
|
||||
*/
|
||||
|
||||
#ifndef _ADFS_FS_I
|
||||
#define _ADFS_FS_I
|
||||
|
||||
/*
|
||||
* adfs file system inode data in memory
|
||||
*/
|
||||
struct adfs_inode_info {
|
||||
loff_t mmu_private;
|
||||
unsigned long parent_id; /* object id of parent */
|
||||
__u32 loadaddr; /* RISC OS load address */
|
||||
__u32 execaddr; /* RISC OS exec address */
|
||||
unsigned int filetype; /* RISC OS file type */
|
||||
unsigned int attr; /* RISC OS permissions */
|
||||
unsigned int stamped:1; /* RISC OS file has date/time */
|
||||
struct inode vfs_inode;
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* linux/include/linux/adfs_fs_sb.h
|
||||
*
|
||||
* Copyright (C) 1997-1999 Russell King
|
||||
*/
|
||||
|
||||
#ifndef _ADFS_FS_SB
|
||||
#define _ADFS_FS_SB
|
||||
|
||||
/*
|
||||
* Forward-declare this
|
||||
*/
|
||||
struct adfs_discmap;
|
||||
struct adfs_dir_ops;
|
||||
|
||||
/*
|
||||
* ADFS file system superblock data in memory
|
||||
*/
|
||||
struct adfs_sb_info {
|
||||
struct adfs_discmap *s_map; /* bh list containing map */
|
||||
struct adfs_dir_ops *s_dir; /* directory operations */
|
||||
|
||||
uid_t s_uid; /* owner uid */
|
||||
gid_t s_gid; /* owner gid */
|
||||
umode_t s_owner_mask; /* ADFS owner perm -> unix perm */
|
||||
umode_t s_other_mask; /* ADFS other perm -> unix perm */
|
||||
|
||||
__u32 s_ids_per_zone; /* max. no ids in one zone */
|
||||
__u32 s_idlen; /* length of ID in map */
|
||||
__u32 s_map_size; /* sector size of a map */
|
||||
unsigned long s_size; /* total size (in blocks) of this fs */
|
||||
signed int s_map2blk; /* shift left by this for map->sector */
|
||||
unsigned int s_log2sharesize;/* log2 share size */
|
||||
__le32 s_version; /* disc format version */
|
||||
unsigned int s_namelen; /* maximum number of characters in name */
|
||||
};
|
||||
|
||||
#endif
|
@@ -70,7 +70,7 @@ struct agp_memory {
|
||||
struct agp_memory *next;
|
||||
struct agp_memory *prev;
|
||||
struct agp_bridge_data *bridge;
|
||||
unsigned long *memory;
|
||||
struct page **pages;
|
||||
size_t page_count;
|
||||
int key;
|
||||
int num_scratch_pages;
|
||||
|
264
include/linux/amba/pl022.h
Normal file
264
include/linux/amba/pl022.h
Normal file
@@ -0,0 +1,264 @@
|
||||
/*
|
||||
* include/linux/amba/pl022.h
|
||||
*
|
||||
* Copyright (C) 2008-2009 ST-Ericsson AB
|
||||
* Copyright (C) 2006 STMicroelectronics Pvt. Ltd.
|
||||
*
|
||||
* Author: Linus Walleij <linus.walleij@stericsson.com>
|
||||
*
|
||||
* Initial version inspired by:
|
||||
* linux-2.6.17-rc3-mm1/drivers/spi/pxa2xx_spi.c
|
||||
* Initial adoption to PL022 by:
|
||||
* Sachin Verma <sachin.verma@st.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 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.
|
||||
*/
|
||||
|
||||
#ifndef _SSP_PL022_H
|
||||
#define _SSP_PL022_H
|
||||
|
||||
#include <linux/device.h>
|
||||
|
||||
/**
|
||||
* whether SSP is in loopback mode or not
|
||||
*/
|
||||
enum ssp_loopback {
|
||||
LOOPBACK_DISABLED,
|
||||
LOOPBACK_ENABLED
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_interface - interfaces allowed for this SSP Controller
|
||||
* @SSP_INTERFACE_MOTOROLA_SPI: Motorola Interface
|
||||
* @SSP_INTERFACE_TI_SYNC_SERIAL: Texas Instrument Synchronous Serial
|
||||
* interface
|
||||
* @SSP_INTERFACE_NATIONAL_MICROWIRE: National Semiconductor Microwire
|
||||
* interface
|
||||
* @SSP_INTERFACE_UNIDIRECTIONAL: Unidirectional interface (STn8810
|
||||
* &STn8815 only)
|
||||
*/
|
||||
enum ssp_interface {
|
||||
SSP_INTERFACE_MOTOROLA_SPI,
|
||||
SSP_INTERFACE_TI_SYNC_SERIAL,
|
||||
SSP_INTERFACE_NATIONAL_MICROWIRE,
|
||||
SSP_INTERFACE_UNIDIRECTIONAL
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_hierarchy - whether SSP is configured as Master or Slave
|
||||
*/
|
||||
enum ssp_hierarchy {
|
||||
SSP_MASTER,
|
||||
SSP_SLAVE
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_clock_params - clock parameters, to set SSP clock at a
|
||||
* desired freq
|
||||
*/
|
||||
struct ssp_clock_params {
|
||||
u8 cpsdvsr; /* value from 2 to 254 (even only!) */
|
||||
u8 scr; /* value from 0 to 255 */
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_rx_endian - endianess of Rx FIFO Data
|
||||
*/
|
||||
enum ssp_rx_endian {
|
||||
SSP_RX_MSB,
|
||||
SSP_RX_LSB
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_tx_endian - endianess of Tx FIFO Data
|
||||
*/
|
||||
enum ssp_tx_endian {
|
||||
SSP_TX_MSB,
|
||||
SSP_TX_LSB
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_data_size - number of bits in one data element
|
||||
*/
|
||||
enum ssp_data_size {
|
||||
SSP_DATA_BITS_4 = 0x03, SSP_DATA_BITS_5, SSP_DATA_BITS_6,
|
||||
SSP_DATA_BITS_7, SSP_DATA_BITS_8, SSP_DATA_BITS_9,
|
||||
SSP_DATA_BITS_10, SSP_DATA_BITS_11, SSP_DATA_BITS_12,
|
||||
SSP_DATA_BITS_13, SSP_DATA_BITS_14, SSP_DATA_BITS_15,
|
||||
SSP_DATA_BITS_16, SSP_DATA_BITS_17, SSP_DATA_BITS_18,
|
||||
SSP_DATA_BITS_19, SSP_DATA_BITS_20, SSP_DATA_BITS_21,
|
||||
SSP_DATA_BITS_22, SSP_DATA_BITS_23, SSP_DATA_BITS_24,
|
||||
SSP_DATA_BITS_25, SSP_DATA_BITS_26, SSP_DATA_BITS_27,
|
||||
SSP_DATA_BITS_28, SSP_DATA_BITS_29, SSP_DATA_BITS_30,
|
||||
SSP_DATA_BITS_31, SSP_DATA_BITS_32
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_mode - SSP mode of operation (Communication modes)
|
||||
*/
|
||||
enum ssp_mode {
|
||||
INTERRUPT_TRANSFER,
|
||||
POLLING_TRANSFER,
|
||||
DMA_TRANSFER
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_rx_level_trig - receive FIFO watermark level which triggers
|
||||
* IT: Interrupt fires when _N_ or more elements in RX FIFO.
|
||||
*/
|
||||
enum ssp_rx_level_trig {
|
||||
SSP_RX_1_OR_MORE_ELEM,
|
||||
SSP_RX_4_OR_MORE_ELEM,
|
||||
SSP_RX_8_OR_MORE_ELEM,
|
||||
SSP_RX_16_OR_MORE_ELEM,
|
||||
SSP_RX_32_OR_MORE_ELEM
|
||||
};
|
||||
|
||||
/**
|
||||
* Transmit FIFO watermark level which triggers (IT Interrupt fires
|
||||
* when _N_ or more empty locations in TX FIFO)
|
||||
*/
|
||||
enum ssp_tx_level_trig {
|
||||
SSP_TX_1_OR_MORE_EMPTY_LOC,
|
||||
SSP_TX_4_OR_MORE_EMPTY_LOC,
|
||||
SSP_TX_8_OR_MORE_EMPTY_LOC,
|
||||
SSP_TX_16_OR_MORE_EMPTY_LOC,
|
||||
SSP_TX_32_OR_MORE_EMPTY_LOC
|
||||
};
|
||||
|
||||
/**
|
||||
* enum SPI Clock Phase - clock phase (Motorola SPI interface only)
|
||||
* @SSP_CLK_RISING_EDGE: Receive data on rising edge
|
||||
* @SSP_CLK_FALLING_EDGE: Receive data on falling edge
|
||||
*/
|
||||
enum ssp_spi_clk_phase {
|
||||
SSP_CLK_RISING_EDGE,
|
||||
SSP_CLK_FALLING_EDGE
|
||||
};
|
||||
|
||||
/**
|
||||
* enum SPI Clock Polarity - clock polarity (Motorola SPI interface only)
|
||||
* @SSP_CLK_POL_IDLE_LOW: Low inactive level
|
||||
* @SSP_CLK_POL_IDLE_HIGH: High inactive level
|
||||
*/
|
||||
enum ssp_spi_clk_pol {
|
||||
SSP_CLK_POL_IDLE_LOW,
|
||||
SSP_CLK_POL_IDLE_HIGH
|
||||
};
|
||||
|
||||
/**
|
||||
* Microwire Conrol Lengths Command size in microwire format
|
||||
*/
|
||||
enum ssp_microwire_ctrl_len {
|
||||
SSP_BITS_4 = 0x03, SSP_BITS_5, SSP_BITS_6,
|
||||
SSP_BITS_7, SSP_BITS_8, SSP_BITS_9,
|
||||
SSP_BITS_10, SSP_BITS_11, SSP_BITS_12,
|
||||
SSP_BITS_13, SSP_BITS_14, SSP_BITS_15,
|
||||
SSP_BITS_16, SSP_BITS_17, SSP_BITS_18,
|
||||
SSP_BITS_19, SSP_BITS_20, SSP_BITS_21,
|
||||
SSP_BITS_22, SSP_BITS_23, SSP_BITS_24,
|
||||
SSP_BITS_25, SSP_BITS_26, SSP_BITS_27,
|
||||
SSP_BITS_28, SSP_BITS_29, SSP_BITS_30,
|
||||
SSP_BITS_31, SSP_BITS_32
|
||||
};
|
||||
|
||||
/**
|
||||
* enum Microwire Wait State
|
||||
* @SSP_MWIRE_WAIT_ZERO: No wait state inserted after last command bit
|
||||
* @SSP_MWIRE_WAIT_ONE: One wait state inserted after last command bit
|
||||
*/
|
||||
enum ssp_microwire_wait_state {
|
||||
SSP_MWIRE_WAIT_ZERO,
|
||||
SSP_MWIRE_WAIT_ONE
|
||||
};
|
||||
|
||||
/**
|
||||
* enum Microwire - whether Full/Half Duplex
|
||||
* @SSP_MICROWIRE_CHANNEL_FULL_DUPLEX: SSPTXD becomes bi-directional,
|
||||
* SSPRXD not used
|
||||
* @SSP_MICROWIRE_CHANNEL_HALF_DUPLEX: SSPTXD is an output, SSPRXD is
|
||||
* an input.
|
||||
*/
|
||||
enum ssp_duplex {
|
||||
SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
|
||||
SSP_MICROWIRE_CHANNEL_HALF_DUPLEX
|
||||
};
|
||||
|
||||
/**
|
||||
* CHIP select/deselect commands
|
||||
*/
|
||||
enum ssp_chip_select {
|
||||
SSP_CHIP_SELECT,
|
||||
SSP_CHIP_DESELECT
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* struct pl022_ssp_master - device.platform_data for SPI controller devices.
|
||||
* @num_chipselect: chipselects are used to distinguish individual
|
||||
* SPI slaves, and are numbered from zero to num_chipselects - 1.
|
||||
* each slave has a chipselect signal, but it's common that not
|
||||
* every chipselect is connected to a slave.
|
||||
* @enable_dma: if true enables DMA driven transfers.
|
||||
*/
|
||||
struct pl022_ssp_controller {
|
||||
u16 bus_id;
|
||||
u8 num_chipselect;
|
||||
u8 enable_dma:1;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ssp_config_chip - spi_board_info.controller_data for SPI
|
||||
* slave devices, copied to spi_device.controller_data.
|
||||
*
|
||||
* @lbm: used for test purpose to internally connect RX and TX
|
||||
* @iface: Interface type(Motorola, TI, Microwire, Universal)
|
||||
* @hierarchy: sets whether interface is master or slave
|
||||
* @slave_tx_disable: SSPTXD is disconnected (in slave mode only)
|
||||
* @clk_freq: Tune freq parameters of SSP(when in master mode)
|
||||
* @endian_rx: Endianess of Data in Rx FIFO
|
||||
* @endian_tx: Endianess of Data in Tx FIFO
|
||||
* @data_size: Width of data element(4 to 32 bits)
|
||||
* @com_mode: communication mode: polling, Interrupt or DMA
|
||||
* @rx_lev_trig: Rx FIFO watermark level (for IT & DMA mode)
|
||||
* @tx_lev_trig: Tx FIFO watermark level (for IT & DMA mode)
|
||||
* @clk_phase: Motorola SPI interface Clock phase
|
||||
* @clk_pol: Motorola SPI interface Clock polarity
|
||||
* @ctrl_len: Microwire interface: Control length
|
||||
* @wait_state: Microwire interface: Wait state
|
||||
* @duplex: Microwire interface: Full/Half duplex
|
||||
* @cs_control: function pointer to board-specific function to
|
||||
* assert/deassert I/O port to control HW generation of devices chip-select.
|
||||
* @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph)
|
||||
* @dma_config: DMA configuration for SSP controller and peripheral
|
||||
*/
|
||||
struct pl022_config_chip {
|
||||
struct device *dev;
|
||||
enum ssp_loopback lbm;
|
||||
enum ssp_interface iface;
|
||||
enum ssp_hierarchy hierarchy;
|
||||
bool slave_tx_disable;
|
||||
struct ssp_clock_params clk_freq;
|
||||
enum ssp_rx_endian endian_rx;
|
||||
enum ssp_tx_endian endian_tx;
|
||||
enum ssp_data_size data_size;
|
||||
enum ssp_mode com_mode;
|
||||
enum ssp_rx_level_trig rx_lev_trig;
|
||||
enum ssp_tx_level_trig tx_lev_trig;
|
||||
enum ssp_spi_clk_phase clk_phase;
|
||||
enum ssp_spi_clk_pol clk_pol;
|
||||
enum ssp_microwire_ctrl_len ctrl_len;
|
||||
enum ssp_microwire_wait_state wait_state;
|
||||
enum ssp_duplex duplex;
|
||||
void (*cs_control) (u32 control);
|
||||
};
|
||||
|
||||
#endif /* _SSP_PL022_H */
|
15
include/linux/amba/pl061.h
Normal file
15
include/linux/amba/pl061.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/* platform data for the PL061 GPIO driver */
|
||||
|
||||
struct pl061_platform_data {
|
||||
/* number of the first GPIO */
|
||||
unsigned gpio_base;
|
||||
|
||||
/* number of the first IRQ.
|
||||
* If the IRQ functionality in not desired this must be set to
|
||||
* (unsigned) -1.
|
||||
*/
|
||||
unsigned irq_base;
|
||||
|
||||
u8 directions; /* startup directions, 1: out, 0: in */
|
||||
u8 values; /* startup values */
|
||||
};
|
@@ -114,6 +114,9 @@
|
||||
#define UART011_IFLS_TX4_8 (2 << 0)
|
||||
#define UART011_IFLS_TX6_8 (3 << 0)
|
||||
#define UART011_IFLS_TX7_8 (4 << 0)
|
||||
/* special values for ST vendor with deeper fifo */
|
||||
#define UART011_IFLS_RX_HALF (5 << 3)
|
||||
#define UART011_IFLS_TX_HALF (5 << 0)
|
||||
|
||||
#define UART011_OEIM (1 << 10) /* overrun error interrupt mask */
|
||||
#define UART011_BEIM (1 << 9) /* break error interrupt mask */
|
||||
|
@@ -800,6 +800,20 @@ static inline int ata_id_is_ssd(const u16 *id)
|
||||
return id[ATA_ID_ROT_SPEED] == 0x01;
|
||||
}
|
||||
|
||||
static inline int ata_id_pio_need_iordy(const u16 *id, const u8 pio)
|
||||
{
|
||||
/* CF spec. r4.1 Table 22 says no IORDY on PIO5 and PIO6. */
|
||||
if (pio > 4 && ata_id_is_cfa(id))
|
||||
return 0;
|
||||
/* For PIO3 and higher it is mandatory. */
|
||||
if (pio > 2)
|
||||
return 1;
|
||||
/* Turn it on when possible. */
|
||||
if (ata_id_has_iordy(id))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ata_drive_40wire(const u16 *dev_id)
|
||||
{
|
||||
if (ata_id_is_sata(dev_id))
|
||||
|
@@ -10,6 +10,7 @@
|
||||
* @bus_width: Number of data lines wired up the slot
|
||||
* @detect_pin: GPIO pin wired to the card detect switch
|
||||
* @wp_pin: GPIO pin wired to the write protect sensor
|
||||
* @detect_is_active_high: The state of the detect pin when it is active
|
||||
*
|
||||
* If a given slot is not present on the board, @bus_width should be
|
||||
* set to 0. The other fields are ignored in this case.
|
||||
@@ -24,6 +25,7 @@ struct mci_slot_pdata {
|
||||
unsigned int bus_width;
|
||||
int detect_pin;
|
||||
int wp_pin;
|
||||
bool detect_is_active_high;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -599,6 +599,8 @@ extern void audit_log_untrustedstring(struct audit_buffer *ab,
|
||||
extern void audit_log_d_path(struct audit_buffer *ab,
|
||||
const char *prefix,
|
||||
struct path *path);
|
||||
extern void audit_log_key(struct audit_buffer *ab,
|
||||
char *key);
|
||||
extern void audit_log_lost(const char *message);
|
||||
extern int audit_update_lsm_rules(void);
|
||||
|
||||
@@ -621,6 +623,7 @@ extern int audit_enabled;
|
||||
#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
|
||||
#define audit_log_untrustedstring(a,s) do { ; } while (0)
|
||||
#define audit_log_d_path(b, p, d) do { ; } while (0)
|
||||
#define audit_log_key(b, k) do { ; } while (0)
|
||||
#define audit_enabled 0
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -218,12 +218,12 @@ struct bio {
|
||||
#define bio_sectors(bio) ((bio)->bi_size >> 9)
|
||||
#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio))
|
||||
|
||||
static inline unsigned int bio_cur_sectors(struct bio *bio)
|
||||
static inline unsigned int bio_cur_bytes(struct bio *bio)
|
||||
{
|
||||
if (bio->bi_vcnt)
|
||||
return bio_iovec(bio)->bv_len >> 9;
|
||||
return bio_iovec(bio)->bv_len;
|
||||
else /* dataless requests such as discard */
|
||||
return bio->bi_size >> 9;
|
||||
return bio->bi_size;
|
||||
}
|
||||
|
||||
static inline void *bio_data(struct bio *bio)
|
||||
@@ -279,7 +279,7 @@ static inline int bio_has_allocated_vec(struct bio *bio)
|
||||
#define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \
|
||||
(((addr1) | (mask)) == (((addr2) - 1) | (mask)))
|
||||
#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \
|
||||
__BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, (q)->seg_boundary_mask)
|
||||
__BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q)))
|
||||
#define BIO_SEG_BOUNDARY(q, b1, b2) \
|
||||
BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2)))
|
||||
|
||||
@@ -506,7 +506,7 @@ static inline int bio_has_data(struct bio *bio)
|
||||
}
|
||||
|
||||
/*
|
||||
* BIO list managment for use by remapping drivers (e.g. DM or MD).
|
||||
* BIO list management for use by remapping drivers (e.g. DM or MD) and loop.
|
||||
*
|
||||
* A bio_list anchors a singly-linked list of bios chained through the bi_next
|
||||
* member of the bio. The bio_list also caches the last list member to allow
|
||||
@@ -590,6 +590,11 @@ static inline void bio_list_merge_head(struct bio_list *bl,
|
||||
bl->head = bl2->head;
|
||||
}
|
||||
|
||||
static inline struct bio *bio_list_peek(struct bio_list *bl)
|
||||
{
|
||||
return bl->head;
|
||||
}
|
||||
|
||||
static inline struct bio *bio_list_pop(struct bio_list *bl)
|
||||
{
|
||||
struct bio *bio = bl->head;
|
||||
|
@@ -166,19 +166,9 @@ struct request {
|
||||
enum rq_cmd_type_bits cmd_type;
|
||||
unsigned long atomic_flags;
|
||||
|
||||
/* Maintain bio traversal state for part by part I/O submission.
|
||||
* hard_* are block layer internals, no driver should touch them!
|
||||
*/
|
||||
|
||||
sector_t sector; /* next sector to submit */
|
||||
sector_t hard_sector; /* next sector to complete */
|
||||
unsigned long nr_sectors; /* no. of sectors left to submit */
|
||||
unsigned long hard_nr_sectors; /* no. of sectors left to complete */
|
||||
/* no. of sectors left to submit in the current segment */
|
||||
unsigned int current_nr_sectors;
|
||||
|
||||
/* no. of sectors left to complete in the current segment */
|
||||
unsigned int hard_cur_sectors;
|
||||
/* the following two fields are internal, NEVER access directly */
|
||||
sector_t __sector; /* sector cursor */
|
||||
unsigned int __data_len; /* total data len */
|
||||
|
||||
struct bio *bio;
|
||||
struct bio *biotail;
|
||||
@@ -211,8 +201,8 @@ struct request {
|
||||
|
||||
unsigned short ioprio;
|
||||
|
||||
void *special;
|
||||
char *buffer;
|
||||
void *special; /* opaque pointer available for LLD use */
|
||||
char *buffer; /* kaddr of the current segment if available */
|
||||
|
||||
int tag;
|
||||
int errors;
|
||||
@@ -226,10 +216,9 @@ struct request {
|
||||
unsigned char __cmd[BLK_MAX_CDB];
|
||||
unsigned char *cmd;
|
||||
|
||||
unsigned int data_len;
|
||||
unsigned int extra_len; /* length of alignment and padding */
|
||||
unsigned int sense_len;
|
||||
void *data;
|
||||
unsigned int resid_len; /* residual count */
|
||||
void *sense;
|
||||
|
||||
unsigned long deadline;
|
||||
@@ -318,6 +307,26 @@ struct blk_cmd_filter {
|
||||
struct kobject kobj;
|
||||
};
|
||||
|
||||
struct queue_limits {
|
||||
unsigned long bounce_pfn;
|
||||
unsigned long seg_boundary_mask;
|
||||
|
||||
unsigned int max_hw_sectors;
|
||||
unsigned int max_sectors;
|
||||
unsigned int max_segment_size;
|
||||
unsigned int physical_block_size;
|
||||
unsigned int alignment_offset;
|
||||
unsigned int io_min;
|
||||
unsigned int io_opt;
|
||||
|
||||
unsigned short logical_block_size;
|
||||
unsigned short max_hw_segments;
|
||||
unsigned short max_phys_segments;
|
||||
|
||||
unsigned char misaligned;
|
||||
unsigned char no_cluster;
|
||||
};
|
||||
|
||||
struct request_queue
|
||||
{
|
||||
/*
|
||||
@@ -369,7 +378,6 @@ struct request_queue
|
||||
/*
|
||||
* queue needs bounce pages for pages above this limit
|
||||
*/
|
||||
unsigned long bounce_pfn;
|
||||
gfp_t bounce_gfp;
|
||||
|
||||
/*
|
||||
@@ -398,14 +406,6 @@ struct request_queue
|
||||
unsigned int nr_congestion_off;
|
||||
unsigned int nr_batching;
|
||||
|
||||
unsigned int max_sectors;
|
||||
unsigned int max_hw_sectors;
|
||||
unsigned short max_phys_segments;
|
||||
unsigned short max_hw_segments;
|
||||
unsigned short hardsect_size;
|
||||
unsigned int max_segment_size;
|
||||
|
||||
unsigned long seg_boundary_mask;
|
||||
void *dma_drain_buffer;
|
||||
unsigned int dma_drain_size;
|
||||
unsigned int dma_pad_mask;
|
||||
@@ -415,12 +415,14 @@ struct request_queue
|
||||
struct list_head tag_busy_list;
|
||||
|
||||
unsigned int nr_sorted;
|
||||
unsigned int in_flight;
|
||||
unsigned int in_flight[2];
|
||||
|
||||
unsigned int rq_timeout;
|
||||
struct timer_list timeout;
|
||||
struct list_head timeout_list;
|
||||
|
||||
struct queue_limits limits;
|
||||
|
||||
/*
|
||||
* sg stuff
|
||||
*/
|
||||
@@ -522,6 +524,11 @@ static inline void queue_flag_clear_unlocked(unsigned int flag,
|
||||
__clear_bit(flag, &q->queue_flags);
|
||||
}
|
||||
|
||||
static inline int queue_in_flight(struct request_queue *q)
|
||||
{
|
||||
return q->in_flight[0] + q->in_flight[1];
|
||||
}
|
||||
|
||||
static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
|
||||
{
|
||||
WARN_ON_ONCE(!queue_is_locked(q));
|
||||
@@ -752,10 +759,17 @@ extern void blk_rq_init(struct request_queue *q, struct request *rq);
|
||||
extern void blk_put_request(struct request *);
|
||||
extern void __blk_put_request(struct request_queue *, struct request *);
|
||||
extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
|
||||
extern struct request *blk_make_request(struct request_queue *, struct bio *,
|
||||
gfp_t);
|
||||
extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
|
||||
extern void blk_requeue_request(struct request_queue *, struct request *);
|
||||
extern int blk_rq_check_limits(struct request_queue *q, struct request *rq);
|
||||
extern int blk_lld_busy(struct request_queue *q);
|
||||
extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
|
||||
struct bio_set *bs, gfp_t gfp_mask,
|
||||
int (*bio_ctr)(struct bio *, struct bio *, void *),
|
||||
void *data);
|
||||
extern void blk_rq_unprep_clone(struct request *rq);
|
||||
extern int blk_insert_cloned_request(struct request_queue *q,
|
||||
struct request *rq);
|
||||
extern void blk_plug_device(struct request_queue *);
|
||||
@@ -767,12 +781,6 @@ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
|
||||
extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
|
||||
struct scsi_ioctl_command __user *);
|
||||
|
||||
/*
|
||||
* Temporary export, until SCSI gets fixed up.
|
||||
*/
|
||||
extern int blk_rq_append_bio(struct request_queue *q, struct request *rq,
|
||||
struct bio *bio);
|
||||
|
||||
/*
|
||||
* A queue has just exitted congestion. Note this in the global counter of
|
||||
* congested queues, and wake up anyone who was waiting for requests to be
|
||||
@@ -798,7 +806,6 @@ extern void blk_sync_queue(struct request_queue *q);
|
||||
extern void __blk_stop_queue(struct request_queue *q);
|
||||
extern void __blk_run_queue(struct request_queue *);
|
||||
extern void blk_run_queue(struct request_queue *);
|
||||
extern void blk_start_queueing(struct request_queue *);
|
||||
extern int blk_rq_map_user(struct request_queue *, struct request *,
|
||||
struct rq_map_data *, void __user *, unsigned long,
|
||||
gfp_t);
|
||||
@@ -831,41 +838,73 @@ static inline void blk_run_address_space(struct address_space *mapping)
|
||||
blk_run_backing_dev(mapping->backing_dev_info, NULL);
|
||||
}
|
||||
|
||||
extern void blkdev_dequeue_request(struct request *req);
|
||||
/*
|
||||
* blk_rq_pos() : the current sector
|
||||
* blk_rq_bytes() : bytes left in the entire request
|
||||
* blk_rq_cur_bytes() : bytes left in the current segment
|
||||
* blk_rq_sectors() : sectors left in the entire request
|
||||
* blk_rq_cur_sectors() : sectors left in the current segment
|
||||
*/
|
||||
static inline sector_t blk_rq_pos(const struct request *rq)
|
||||
{
|
||||
return rq->__sector;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_bytes(const struct request *rq)
|
||||
{
|
||||
return rq->__data_len;
|
||||
}
|
||||
|
||||
static inline int blk_rq_cur_bytes(const struct request *rq)
|
||||
{
|
||||
return rq->bio ? bio_cur_bytes(rq->bio) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_cur_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* blk_end_request() and friends.
|
||||
* __blk_end_request() and end_request() must be called with
|
||||
* the request queue spinlock acquired.
|
||||
* Request issue related functions.
|
||||
*/
|
||||
extern struct request *blk_peek_request(struct request_queue *q);
|
||||
extern void blk_start_request(struct request *rq);
|
||||
extern struct request *blk_fetch_request(struct request_queue *q);
|
||||
|
||||
/*
|
||||
* Request completion related functions.
|
||||
*
|
||||
* blk_update_request() completes given number of bytes and updates
|
||||
* the request without completing it.
|
||||
*
|
||||
* blk_end_request() and friends. __blk_end_request() must be called
|
||||
* with the request queue spinlock acquired.
|
||||
*
|
||||
* Several drivers define their own end_request and call
|
||||
* blk_end_request() for parts of the original function.
|
||||
* This prevents code duplication in drivers.
|
||||
*/
|
||||
extern int blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern int __blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern int blk_end_bidi_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes, unsigned int bidi_bytes);
|
||||
extern void end_request(struct request *, int);
|
||||
extern int blk_end_request_callback(struct request *rq, int error,
|
||||
unsigned int nr_bytes,
|
||||
int (drv_callback)(struct request *));
|
||||
extern bool blk_update_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern bool blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void blk_end_request_all(struct request *rq, int error);
|
||||
extern bool blk_end_request_cur(struct request *rq, int error);
|
||||
extern bool __blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void __blk_end_request_all(struct request *rq, int error);
|
||||
extern bool __blk_end_request_cur(struct request *rq, int error);
|
||||
|
||||
extern void blk_complete_request(struct request *);
|
||||
extern void __blk_complete_request(struct request *);
|
||||
extern void blk_abort_request(struct request *);
|
||||
extern void blk_abort_queue(struct request_queue *);
|
||||
extern void blk_update_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
|
||||
/*
|
||||
* blk_end_request() takes bytes instead of sectors as a complete size.
|
||||
* blk_rq_bytes() returns bytes left to complete in the entire request.
|
||||
* blk_rq_cur_bytes() returns bytes left to complete in the current segment.
|
||||
*/
|
||||
extern unsigned int blk_rq_bytes(struct request *rq);
|
||||
extern unsigned int blk_rq_cur_bytes(struct request *rq);
|
||||
|
||||
/*
|
||||
* Access functions for manipulating queue properties
|
||||
@@ -877,10 +916,21 @@ extern void blk_cleanup_queue(struct request_queue *);
|
||||
extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
|
||||
extern void blk_queue_bounce_limit(struct request_queue *, u64);
|
||||
extern void blk_queue_max_sectors(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_hardsect_size(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_logical_block_size(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_physical_block_size(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_alignment_offset(struct request_queue *q,
|
||||
unsigned int alignment);
|
||||
extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
|
||||
extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
|
||||
extern void blk_set_default_limits(struct queue_limits *lim);
|
||||
extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
sector_t offset);
|
||||
extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
|
||||
sector_t offset);
|
||||
extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
|
||||
extern void blk_queue_dma_pad(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int);
|
||||
@@ -967,19 +1017,87 @@ extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
|
||||
|
||||
#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
|
||||
|
||||
static inline int queue_hardsect_size(struct request_queue *q)
|
||||
static inline unsigned long queue_bounce_pfn(struct request_queue *q)
|
||||
{
|
||||
return q->limits.bounce_pfn;
|
||||
}
|
||||
|
||||
static inline unsigned long queue_segment_boundary(struct request_queue *q)
|
||||
{
|
||||
return q->limits.seg_boundary_mask;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_max_sectors(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_sectors;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_hw_sectors;
|
||||
}
|
||||
|
||||
static inline unsigned short queue_max_hw_segments(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_hw_segments;
|
||||
}
|
||||
|
||||
static inline unsigned short queue_max_phys_segments(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_phys_segments;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_max_segment_size(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_segment_size;
|
||||
}
|
||||
|
||||
static inline unsigned short queue_logical_block_size(struct request_queue *q)
|
||||
{
|
||||
int retval = 512;
|
||||
|
||||
if (q && q->hardsect_size)
|
||||
retval = q->hardsect_size;
|
||||
if (q && q->limits.logical_block_size)
|
||||
retval = q->limits.logical_block_size;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static inline int bdev_hardsect_size(struct block_device *bdev)
|
||||
static inline unsigned short bdev_logical_block_size(struct block_device *bdev)
|
||||
{
|
||||
return queue_hardsect_size(bdev_get_queue(bdev));
|
||||
return queue_logical_block_size(bdev_get_queue(bdev));
|
||||
}
|
||||
|
||||
static inline unsigned int queue_physical_block_size(struct request_queue *q)
|
||||
{
|
||||
return q->limits.physical_block_size;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_io_min(struct request_queue *q)
|
||||
{
|
||||
return q->limits.io_min;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_io_opt(struct request_queue *q)
|
||||
{
|
||||
return q->limits.io_opt;
|
||||
}
|
||||
|
||||
static inline int queue_alignment_offset(struct request_queue *q)
|
||||
{
|
||||
if (q && q->limits.misaligned)
|
||||
return -1;
|
||||
|
||||
if (q && q->limits.alignment_offset)
|
||||
return q->limits.alignment_offset;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int queue_sector_alignment_offset(struct request_queue *q,
|
||||
sector_t sector)
|
||||
{
|
||||
return ((sector << 9) - q->limits.alignment_offset)
|
||||
& (q->limits.io_min - 1);
|
||||
}
|
||||
|
||||
static inline int queue_dma_alignment(struct request_queue *q)
|
||||
@@ -1109,6 +1227,8 @@ struct block_device_operations {
|
||||
int (*direct_access) (struct block_device *, sector_t,
|
||||
void **, unsigned long *);
|
||||
int (*media_changed) (struct gendisk *);
|
||||
unsigned long long (*set_capacity) (struct gendisk *,
|
||||
unsigned long long);
|
||||
int (*revalidate_disk) (struct gendisk *);
|
||||
int (*getgeo)(struct block_device *, struct hd_geometry *);
|
||||
struct module *owner;
|
||||
|
@@ -116,9 +116,9 @@ struct blk_io_trace {
|
||||
* The remap event
|
||||
*/
|
||||
struct blk_io_trace_remap {
|
||||
__be32 device;
|
||||
__be32 device_from;
|
||||
__be64 sector;
|
||||
__be32 device_to;
|
||||
__be64 sector_from;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -165,8 +165,9 @@ struct blk_trace {
|
||||
|
||||
extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
|
||||
extern void blk_trace_shutdown(struct request_queue *);
|
||||
extern int do_blk_trace_setup(struct request_queue *q,
|
||||
char *name, dev_t dev, struct blk_user_trace_setup *buts);
|
||||
extern int do_blk_trace_setup(struct request_queue *q, char *name,
|
||||
dev_t dev, struct block_device *bdev,
|
||||
struct blk_user_trace_setup *buts);
|
||||
extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
|
||||
|
||||
/**
|
||||
@@ -193,22 +194,42 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
|
||||
extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
|
||||
void *data, size_t len);
|
||||
extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
|
||||
struct block_device *bdev,
|
||||
char __user *arg);
|
||||
extern int blk_trace_startstop(struct request_queue *q, int start);
|
||||
extern int blk_trace_remove(struct request_queue *q);
|
||||
extern int blk_trace_init_sysfs(struct device *dev);
|
||||
|
||||
extern struct attribute_group blk_trace_attr_group;
|
||||
|
||||
#else /* !CONFIG_BLK_DEV_IO_TRACE */
|
||||
#define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY)
|
||||
#define blk_trace_shutdown(q) do { } while (0)
|
||||
#define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY)
|
||||
#define blk_add_driver_data(q, rq, data, len) do {} while (0)
|
||||
#define blk_trace_setup(q, name, dev, arg) (-ENOTTY)
|
||||
#define blk_trace_startstop(q, start) (-ENOTTY)
|
||||
#define blk_trace_remove(q) (-ENOTTY)
|
||||
#define blk_add_trace_msg(q, fmt, ...) do { } while (0)
|
||||
# define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY)
|
||||
# define blk_trace_shutdown(q) do { } while (0)
|
||||
# define do_blk_trace_setup(q, name, dev, bdev, buts) (-ENOTTY)
|
||||
# define blk_add_driver_data(q, rq, data, len) do {} while (0)
|
||||
# define blk_trace_setup(q, name, dev, bdev, arg) (-ENOTTY)
|
||||
# define blk_trace_startstop(q, start) (-ENOTTY)
|
||||
# define blk_trace_remove(q) (-ENOTTY)
|
||||
# define blk_add_trace_msg(q, fmt, ...) do { } while (0)
|
||||
static inline int blk_trace_init_sysfs(struct device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BLK_DEV_IO_TRACE */
|
||||
|
||||
#if defined(CONFIG_EVENT_TRACING) && defined(CONFIG_BLOCK)
|
||||
|
||||
static inline int blk_cmd_buf_len(struct request *rq)
|
||||
{
|
||||
return blk_pc_request(rq) ? rq->cmd_len * 3 : 1;
|
||||
}
|
||||
|
||||
extern void blk_dump_cmd(char *buf, struct request *rq);
|
||||
extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes);
|
||||
extern void blk_fill_rwbs_rq(char *rwbs, struct request *rq);
|
||||
|
||||
#endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#ifndef _LINUX_BUG_H
|
||||
#define _LINUX_BUG_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <asm/bug.h>
|
||||
|
||||
enum bug_trap_type {
|
||||
@@ -24,10 +23,6 @@ const struct bug_entry *find_bug(unsigned long bugaddr);
|
||||
|
||||
enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs);
|
||||
|
||||
int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
|
||||
struct module *);
|
||||
void module_bug_cleanup(struct module *);
|
||||
|
||||
/* These are defined by the architecture */
|
||||
int is_valid_bugaddr(unsigned long addr);
|
||||
|
||||
@@ -38,13 +33,6 @@ static inline enum bug_trap_type report_bug(unsigned long bug_addr,
|
||||
{
|
||||
return BUG_TRAP_TYPE_BUG;
|
||||
}
|
||||
static inline int module_bug_finalize(const Elf_Ehdr *hdr,
|
||||
const Elf_Shdr *sechdrs,
|
||||
struct module *mod)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void module_bug_cleanup(struct module *mod) {}
|
||||
|
||||
#endif /* CONFIG_GENERIC_BUG */
|
||||
#endif /* _LINUX_BUG_H */
|
||||
|
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/kmemcheck.h>
|
||||
|
||||
#define C2PORT_NAME_LEN 32
|
||||
|
||||
@@ -20,8 +21,10 @@
|
||||
/* Main struct */
|
||||
struct c2port_ops;
|
||||
struct c2port_device {
|
||||
kmemcheck_bitfield_begin(flags);
|
||||
unsigned int access:1;
|
||||
unsigned int flash_access:1;
|
||||
kmemcheck_bitfield_end(flags);
|
||||
|
||||
int id;
|
||||
char name[C2PORT_NAME_LEN];
|
||||
|
@@ -1,3 +1,4 @@
|
||||
header-y += raw.h
|
||||
header-y += bcm.h
|
||||
header-y += error.h
|
||||
header-y += netlink.h
|
||||
|
70
include/linux/can/dev.h
Normal file
70
include/linux/can/dev.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* linux/can/dev.h
|
||||
*
|
||||
* Definitions for the CAN network device driver interface
|
||||
*
|
||||
* Copyright (C) 2006 Andrey Volkov <avolkov@varma-el.com>
|
||||
* Varma Electronics Oy
|
||||
*
|
||||
* Copyright (C) 2008 Wolfgang Grandegger <wg@grandegger.com>
|
||||
*
|
||||
* Send feedback to <socketcan-users@lists.berlios.de>
|
||||
*/
|
||||
|
||||
#ifndef CAN_DEV_H
|
||||
#define CAN_DEV_H
|
||||
|
||||
#include <linux/can/netlink.h>
|
||||
#include <linux/can/error.h>
|
||||
|
||||
/*
|
||||
* CAN mode
|
||||
*/
|
||||
enum can_mode {
|
||||
CAN_MODE_STOP = 0,
|
||||
CAN_MODE_START,
|
||||
CAN_MODE_SLEEP
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN common private data
|
||||
*/
|
||||
#define CAN_ECHO_SKB_MAX 4
|
||||
|
||||
struct can_priv {
|
||||
struct can_device_stats can_stats;
|
||||
|
||||
struct can_bittiming bittiming;
|
||||
struct can_bittiming_const *bittiming_const;
|
||||
struct can_clock clock;
|
||||
|
||||
enum can_state state;
|
||||
u32 ctrlmode;
|
||||
|
||||
int restart_ms;
|
||||
struct timer_list restart_timer;
|
||||
|
||||
struct sk_buff *echo_skb[CAN_ECHO_SKB_MAX];
|
||||
|
||||
int (*do_set_bittiming)(struct net_device *dev);
|
||||
int (*do_set_mode)(struct net_device *dev, enum can_mode mode);
|
||||
int (*do_get_state)(const struct net_device *dev,
|
||||
enum can_state *state);
|
||||
};
|
||||
|
||||
struct net_device *alloc_candev(int sizeof_priv);
|
||||
void free_candev(struct net_device *dev);
|
||||
|
||||
int open_candev(struct net_device *dev);
|
||||
void close_candev(struct net_device *dev);
|
||||
|
||||
int register_candev(struct net_device *dev);
|
||||
void unregister_candev(struct net_device *dev);
|
||||
|
||||
int can_restart_now(struct net_device *dev);
|
||||
void can_bus_off(struct net_device *dev);
|
||||
|
||||
void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx);
|
||||
void can_get_echo_skb(struct net_device *dev, int idx);
|
||||
|
||||
#endif /* CAN_DEV_H */
|
113
include/linux/can/netlink.h
Normal file
113
include/linux/can/netlink.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* linux/can/netlink.h
|
||||
*
|
||||
* Definitions for the CAN netlink interface
|
||||
*
|
||||
* Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
|
||||
*
|
||||
* Send feedback to <socketcan-users@lists.berlios.de>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CAN_NETLINK_H
|
||||
#define CAN_NETLINK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* CAN bit-timing parameters
|
||||
*
|
||||
* For futher information, please read chapter "8 BIT TIMING
|
||||
* REQUIREMENTS" of the "Bosch CAN Specification version 2.0"
|
||||
* at http://www.semiconductors.bosch.de/pdf/can2spec.pdf.
|
||||
*/
|
||||
struct can_bittiming {
|
||||
__u32 bitrate; /* Bit-rate in bits/second */
|
||||
__u32 sample_point; /* Sample point in one-tenth of a percent */
|
||||
__u32 tq; /* Time quanta (TQ) in nanoseconds */
|
||||
__u32 prop_seg; /* Propagation segment in TQs */
|
||||
__u32 phase_seg1; /* Phase buffer segment 1 in TQs */
|
||||
__u32 phase_seg2; /* Phase buffer segment 2 in TQs */
|
||||
__u32 sjw; /* Synchronisation jump width in TQs */
|
||||
__u32 brp; /* Bit-rate prescaler */
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN harware-dependent bit-timing constant
|
||||
*
|
||||
* Used for calculating and checking bit-timing parameters
|
||||
*/
|
||||
struct can_bittiming_const {
|
||||
char name[16]; /* Name of the CAN controller hardware */
|
||||
__u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */
|
||||
__u32 tseg1_max;
|
||||
__u32 tseg2_min; /* Time segement 2 = phase_seg2 */
|
||||
__u32 tseg2_max;
|
||||
__u32 sjw_max; /* Synchronisation jump width */
|
||||
__u32 brp_min; /* Bit-rate prescaler */
|
||||
__u32 brp_max;
|
||||
__u32 brp_inc;
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN clock parameters
|
||||
*/
|
||||
struct can_clock {
|
||||
__u32 freq; /* CAN system clock frequency in Hz */
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN operational and error states
|
||||
*/
|
||||
enum can_state {
|
||||
CAN_STATE_ERROR_ACTIVE = 0, /* RX/TX error count < 96 */
|
||||
CAN_STATE_ERROR_WARNING, /* RX/TX error count < 128 */
|
||||
CAN_STATE_ERROR_PASSIVE, /* RX/TX error count < 256 */
|
||||
CAN_STATE_BUS_OFF, /* RX/TX error count >= 256 */
|
||||
CAN_STATE_STOPPED, /* Device is stopped */
|
||||
CAN_STATE_SLEEPING, /* Device is sleeping */
|
||||
CAN_STATE_MAX
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN controller mode
|
||||
*/
|
||||
struct can_ctrlmode {
|
||||
__u32 mask;
|
||||
__u32 flags;
|
||||
};
|
||||
|
||||
#define CAN_CTRLMODE_LOOPBACK 0x1 /* Loopback mode */
|
||||
#define CAN_CTRLMODE_LISTENONLY 0x2 /* Listen-only mode */
|
||||
#define CAN_CTRLMODE_3_SAMPLES 0x4 /* Triple sampling mode */
|
||||
|
||||
/*
|
||||
* CAN device statistics
|
||||
*/
|
||||
struct can_device_stats {
|
||||
__u32 bus_error; /* Bus errors */
|
||||
__u32 error_warning; /* Changes to error warning state */
|
||||
__u32 error_passive; /* Changes to error passive state */
|
||||
__u32 bus_off; /* Changes to bus off state */
|
||||
__u32 arbitration_lost; /* Arbitration lost errors */
|
||||
__u32 restarts; /* CAN controller re-starts */
|
||||
};
|
||||
|
||||
/*
|
||||
* CAN netlink interface
|
||||
*/
|
||||
enum {
|
||||
IFLA_CAN_UNSPEC,
|
||||
IFLA_CAN_BITTIMING,
|
||||
IFLA_CAN_BITTIMING_CONST,
|
||||
IFLA_CAN_CLOCK,
|
||||
IFLA_CAN_STATE,
|
||||
IFLA_CAN_CTRLMODE,
|
||||
IFLA_CAN_RESTART_MS,
|
||||
IFLA_CAN_RESTART,
|
||||
__IFLA_CAN_MAX
|
||||
};
|
||||
|
||||
#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
|
||||
|
||||
#endif /* CAN_NETLINK_H */
|
35
include/linux/can/platform/sja1000.h
Normal file
35
include/linux/can/platform/sja1000.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef _CAN_PLATFORM_SJA1000_H_
|
||||
#define _CAN_PLATFORM_SJA1000_H_
|
||||
|
||||
/* clock divider register */
|
||||
#define CDR_CLKOUT_MASK 0x07
|
||||
#define CDR_CLK_OFF 0x08 /* Clock off (CLKOUT pin) */
|
||||
#define CDR_RXINPEN 0x20 /* TX1 output is RX irq output */
|
||||
#define CDR_CBP 0x40 /* CAN input comparator bypass */
|
||||
#define CDR_PELICAN 0x80 /* PeliCAN mode */
|
||||
|
||||
/* output control register */
|
||||
#define OCR_MODE_BIPHASE 0x00
|
||||
#define OCR_MODE_TEST 0x01
|
||||
#define OCR_MODE_NORMAL 0x02
|
||||
#define OCR_MODE_CLOCK 0x03
|
||||
#define OCR_MODE_MASK 0x07
|
||||
#define OCR_TX0_INVERT 0x04
|
||||
#define OCR_TX0_PULLDOWN 0x08
|
||||
#define OCR_TX0_PULLUP 0x10
|
||||
#define OCR_TX0_PUSHPULL 0x18
|
||||
#define OCR_TX1_INVERT 0x20
|
||||
#define OCR_TX1_PULLDOWN 0x40
|
||||
#define OCR_TX1_PULLUP 0x80
|
||||
#define OCR_TX1_PUSHPULL 0xc0
|
||||
#define OCR_TX_MASK 0xfc
|
||||
#define OCR_TX_SHIFT 2
|
||||
|
||||
struct sja1000_platform_data {
|
||||
u32 clock; /* CAN bus oscillator frequency in Hz */
|
||||
|
||||
u8 ocr; /* output control register */
|
||||
u8 cdr; /* clock divider register */
|
||||
};
|
||||
|
||||
#endif /* !_CAN_PLATFORM_SJA1000_H_ */
|
231
include/linux/cb710.h
Normal file
231
include/linux/cb710.h
Normal file
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* cb710/cb710.h
|
||||
*
|
||||
* Copyright by Michał Mirosław, 2008-2009
|
||||
*
|
||||
* 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_CB710_DRIVER_H
|
||||
#define LINUX_CB710_DRIVER_H
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mmc/host.h>
|
||||
|
||||
struct cb710_slot;
|
||||
|
||||
typedef int (*cb710_irq_handler_t)(struct cb710_slot *);
|
||||
|
||||
/* per-virtual-slot structure */
|
||||
struct cb710_slot {
|
||||
struct platform_device pdev;
|
||||
void __iomem *iobase;
|
||||
cb710_irq_handler_t irq_handler;
|
||||
};
|
||||
|
||||
/* per-device structure */
|
||||
struct cb710_chip {
|
||||
struct pci_dev *pdev;
|
||||
void __iomem *iobase;
|
||||
unsigned platform_id;
|
||||
#ifdef CONFIG_CB710_DEBUG_ASSUMPTIONS
|
||||
atomic_t slot_refs_count;
|
||||
#endif
|
||||
unsigned slot_mask;
|
||||
unsigned slots;
|
||||
spinlock_t irq_lock;
|
||||
struct cb710_slot slot[0];
|
||||
};
|
||||
|
||||
/* NOTE: cb710_chip.slots is modified only during device init/exit and
|
||||
* they are all serialized wrt themselves */
|
||||
|
||||
/* cb710_chip.slot_mask values */
|
||||
#define CB710_SLOT_MMC 1
|
||||
#define CB710_SLOT_MS 2
|
||||
#define CB710_SLOT_SM 4
|
||||
|
||||
/* slot port accessors - so the logic is more clear in the code */
|
||||
#define CB710_PORT_ACCESSORS(t) \
|
||||
static inline void cb710_write_port_##t(struct cb710_slot *slot, \
|
||||
unsigned port, u##t value) \
|
||||
{ \
|
||||
iowrite##t(value, slot->iobase + port); \
|
||||
} \
|
||||
\
|
||||
static inline u##t cb710_read_port_##t(struct cb710_slot *slot, \
|
||||
unsigned port) \
|
||||
{ \
|
||||
return ioread##t(slot->iobase + port); \
|
||||
} \
|
||||
\
|
||||
static inline void cb710_modify_port_##t(struct cb710_slot *slot, \
|
||||
unsigned port, u##t set, u##t clear) \
|
||||
{ \
|
||||
iowrite##t( \
|
||||
(ioread##t(slot->iobase + port) & ~clear)|set, \
|
||||
slot->iobase + port); \
|
||||
}
|
||||
|
||||
CB710_PORT_ACCESSORS(8)
|
||||
CB710_PORT_ACCESSORS(16)
|
||||
CB710_PORT_ACCESSORS(32)
|
||||
|
||||
void cb710_pci_update_config_reg(struct pci_dev *pdev,
|
||||
int reg, uint32_t and, uint32_t xor);
|
||||
void cb710_set_irq_handler(struct cb710_slot *slot,
|
||||
cb710_irq_handler_t handler);
|
||||
|
||||
/* some device struct walking */
|
||||
|
||||
static inline struct cb710_slot *cb710_pdev_to_slot(
|
||||
struct platform_device *pdev)
|
||||
{
|
||||
return container_of(pdev, struct cb710_slot, pdev);
|
||||
}
|
||||
|
||||
static inline struct cb710_chip *cb710_slot_to_chip(struct cb710_slot *slot)
|
||||
{
|
||||
return dev_get_drvdata(slot->pdev.dev.parent);
|
||||
}
|
||||
|
||||
static inline struct device *cb710_slot_dev(struct cb710_slot *slot)
|
||||
{
|
||||
return &slot->pdev.dev;
|
||||
}
|
||||
|
||||
static inline struct device *cb710_chip_dev(struct cb710_chip *chip)
|
||||
{
|
||||
return &chip->pdev->dev;
|
||||
}
|
||||
|
||||
/* debugging aids */
|
||||
|
||||
#ifdef CONFIG_CB710_DEBUG
|
||||
void cb710_dump_regs(struct cb710_chip *chip, unsigned dump);
|
||||
#else
|
||||
#define cb710_dump_regs(c, d) do {} while (0)
|
||||
#endif
|
||||
|
||||
#define CB710_DUMP_REGS_MMC 0x0F
|
||||
#define CB710_DUMP_REGS_MS 0x30
|
||||
#define CB710_DUMP_REGS_SM 0xC0
|
||||
#define CB710_DUMP_REGS_ALL 0xFF
|
||||
#define CB710_DUMP_REGS_MASK 0xFF
|
||||
|
||||
#define CB710_DUMP_ACCESS_8 0x100
|
||||
#define CB710_DUMP_ACCESS_16 0x200
|
||||
#define CB710_DUMP_ACCESS_32 0x400
|
||||
#define CB710_DUMP_ACCESS_ALL 0x700
|
||||
#define CB710_DUMP_ACCESS_MASK 0x700
|
||||
|
||||
#endif /* LINUX_CB710_DRIVER_H */
|
||||
/*
|
||||
* cb710/sgbuf2.h
|
||||
*
|
||||
* Copyright by Michał Mirosław, 2008-2009
|
||||
*
|
||||
* 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_CB710_SG_H
|
||||
#define LINUX_CB710_SG_H
|
||||
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/scatterlist.h>
|
||||
|
||||
/**
|
||||
* cb710_sg_miter_stop_writing - stop mapping iteration after writing
|
||||
* @miter: sg mapping iter to be stopped
|
||||
*
|
||||
* Description:
|
||||
* Stops mapping iterator @miter. @miter should have been started
|
||||
* started using sg_miter_start(). A stopped iteration can be
|
||||
* resumed by calling sg_miter_next() on it. This is useful when
|
||||
* resources (kmap) need to be released during iteration.
|
||||
*
|
||||
* This is a convenience wrapper that will be optimized out for arches
|
||||
* that don't need flush_kernel_dcache_page().
|
||||
*
|
||||
* Context:
|
||||
* IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
|
||||
*/
|
||||
static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter)
|
||||
{
|
||||
if (miter->page)
|
||||
flush_kernel_dcache_page(miter->page);
|
||||
sg_miter_stop(miter);
|
||||
}
|
||||
|
||||
/*
|
||||
* 32-bit PIO mapping sg iterator
|
||||
*
|
||||
* Hides scatterlist access issues - fragment boundaries, alignment, page
|
||||
* mapping - for drivers using 32-bit-word-at-a-time-PIO (ie. PCI devices
|
||||
* without DMA support).
|
||||
*
|
||||
* Best-case reading (transfer from device):
|
||||
* sg_miter_start();
|
||||
* cb710_sg_dwiter_write_from_io();
|
||||
* cb710_sg_miter_stop_writing();
|
||||
*
|
||||
* Best-case writing (transfer to device):
|
||||
* sg_miter_start();
|
||||
* cb710_sg_dwiter_read_to_io();
|
||||
* sg_miter_stop();
|
||||
*/
|
||||
|
||||
uint32_t cb710_sg_dwiter_read_next_block(struct sg_mapping_iter *miter);
|
||||
void cb710_sg_dwiter_write_next_block(struct sg_mapping_iter *miter, uint32_t data);
|
||||
|
||||
/**
|
||||
* cb710_sg_dwiter_write_from_io - transfer data to mapped buffer from 32-bit IO port
|
||||
* @miter: sg mapping iter
|
||||
* @port: PIO port - IO or MMIO address
|
||||
* @count: number of 32-bit words to transfer
|
||||
*
|
||||
* Description:
|
||||
* Reads @count 32-bit words from register @port and stores it in
|
||||
* buffer iterated by @miter. Data that would overflow the buffer
|
||||
* is silently ignored. Iterator is advanced by 4*@count bytes
|
||||
* or to the buffer's end whichever is closer.
|
||||
*
|
||||
* Context:
|
||||
* IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
|
||||
*/
|
||||
static inline void cb710_sg_dwiter_write_from_io(struct sg_mapping_iter *miter,
|
||||
void __iomem *port, size_t count)
|
||||
{
|
||||
while (count-- > 0)
|
||||
cb710_sg_dwiter_write_next_block(miter, ioread32(port));
|
||||
}
|
||||
|
||||
/**
|
||||
* cb710_sg_dwiter_read_to_io - transfer data to 32-bit IO port from mapped buffer
|
||||
* @miter: sg mapping iter
|
||||
* @port: PIO port - IO or MMIO address
|
||||
* @count: number of 32-bit words to transfer
|
||||
*
|
||||
* Description:
|
||||
* Writes @count 32-bit words to register @port from buffer iterated
|
||||
* through @miter. If buffer ends before @count words are written
|
||||
* missing data is replaced by zeroes. @miter is advanced by 4*@count
|
||||
* bytes or to the buffer's end whichever is closer.
|
||||
*
|
||||
* Context:
|
||||
* IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
|
||||
*/
|
||||
static inline void cb710_sg_dwiter_read_to_io(struct sg_mapping_iter *miter,
|
||||
void __iomem *port, size_t count)
|
||||
{
|
||||
while (count-- > 0)
|
||||
iowrite32(cb710_sg_dwiter_read_next_block(miter), port);
|
||||
}
|
||||
|
||||
#endif /* LINUX_CB710_SG_H */
|
@@ -28,6 +28,8 @@ int cdev_add(struct cdev *, dev_t, unsigned);
|
||||
|
||||
void cdev_del(struct cdev *);
|
||||
|
||||
int cdev_index(struct inode *inode);
|
||||
|
||||
void cd_forget(struct inode *);
|
||||
|
||||
extern struct backing_dev_info directly_mappable_cdev_bdi;
|
||||
|
@@ -142,4 +142,17 @@ struct clk *clk_get_parent(struct clk *clk);
|
||||
*/
|
||||
struct clk *clk_get_sys(const char *dev_id, const char *con_id);
|
||||
|
||||
/**
|
||||
* clk_add_alias - add a new clock alias
|
||||
* @alias: name for clock alias
|
||||
* @alias_dev_name: device name
|
||||
* @id: platform specific clock name
|
||||
* @dev: device
|
||||
*
|
||||
* Allows using generic clock names for drivers by adding a new alias.
|
||||
* Assumes clkdev, see clkdev.h for more info.
|
||||
*/
|
||||
int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
|
||||
struct device *dev);
|
||||
|
||||
#endif
|
||||
|
@@ -143,3 +143,12 @@ extern void clockevents_notify(unsigned long reason, void *arg);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GENERIC_CLOCKEVENTS
|
||||
extern ktime_t clockevents_get_next_event(int cpu);
|
||||
#else
|
||||
static inline ktime_t clockevents_get_next_event(int cpu)
|
||||
{
|
||||
return (ktime_t) { .tv64 = KTIME_MAX };
|
||||
}
|
||||
#endif
|
||||
|
@@ -288,7 +288,15 @@ static inline cycle_t clocksource_read(struct clocksource *cs)
|
||||
*/
|
||||
static inline int clocksource_enable(struct clocksource *cs)
|
||||
{
|
||||
return cs->enable ? cs->enable(cs) : 0;
|
||||
int ret = 0;
|
||||
|
||||
if (cs->enable)
|
||||
ret = cs->enable(cs);
|
||||
|
||||
/* save mult_orig on enable */
|
||||
cs->mult_orig = cs->mult;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -222,6 +222,8 @@ int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from);
|
||||
int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);
|
||||
int get_compat_sigevent(struct sigevent *event,
|
||||
const struct compat_sigevent __user *u_event);
|
||||
long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig,
|
||||
struct compat_siginfo __user *uinfo);
|
||||
|
||||
static inline int compat_timeval_compare(struct compat_timeval *lhs,
|
||||
struct compat_timeval *rhs)
|
||||
|
@@ -16,6 +16,12 @@
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GCOV_KERNEL
|
||||
# if __GNUC_MINOR__ < 4
|
||||
# error "GCOV profiling support for gcc versions below 3.4 not included"
|
||||
# endif /* __GNUC_MINOR__ */
|
||||
#endif /* CONFIG_GCOV_KERNEL */
|
||||
|
||||
/*
|
||||
* A trick to suppress uninitialized variable warning without generating any
|
||||
* code
|
||||
|
@@ -261,6 +261,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
|
||||
# define __section(S) __attribute__ ((__section__(#S)))
|
||||
#endif
|
||||
|
||||
/* Are two types/vars the same type (ignoring qualifiers)? */
|
||||
#ifndef __same_type
|
||||
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Prevent the compiler from merging or refetching accesses. The compiler
|
||||
* is also forbidden from reordering successive instances of ACCESS_ONCE(),
|
||||
|
@@ -41,8 +41,10 @@
|
||||
#define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */
|
||||
#define CN_DST_IDX 0x6
|
||||
#define CN_DST_VAL 0x1
|
||||
#define CN_IDX_DM 0x7 /* Device Mapper */
|
||||
#define CN_VAL_DM_USERSPACE_LOG 0x1
|
||||
|
||||
#define CN_NETLINK_USERS 7
|
||||
#define CN_NETLINK_USERS 8
|
||||
|
||||
/*
|
||||
* Maximum connector's message size.
|
||||
|
@@ -69,7 +69,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb)
|
||||
|
||||
int cpu_up(unsigned int cpu);
|
||||
void notify_cpu_starting(unsigned int cpu);
|
||||
extern void cpu_hotplug_init(void);
|
||||
extern void cpu_maps_update_begin(void);
|
||||
extern void cpu_maps_update_done(void);
|
||||
|
||||
@@ -84,10 +83,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void cpu_hotplug_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void cpu_maps_update_begin(void)
|
||||
{
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@
|
||||
|
||||
extern int number_of_cpusets; /* How many cpusets are defined in system? */
|
||||
|
||||
extern int cpuset_init_early(void);
|
||||
extern int cpuset_init(void);
|
||||
extern void cpuset_init_smp(void);
|
||||
extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
|
||||
@@ -27,7 +26,6 @@ extern void cpuset_cpus_allowed_locked(struct task_struct *p,
|
||||
extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
|
||||
#define cpuset_current_mems_allowed (current->mems_allowed)
|
||||
void cpuset_init_current_mems_allowed(void);
|
||||
void cpuset_update_task_memory_state(void);
|
||||
int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask);
|
||||
|
||||
extern int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask);
|
||||
@@ -92,9 +90,13 @@ extern void rebuild_sched_domains(void);
|
||||
|
||||
extern void cpuset_print_task_mems_allowed(struct task_struct *p);
|
||||
|
||||
static inline void set_mems_allowed(nodemask_t nodemask)
|
||||
{
|
||||
current->mems_allowed = nodemask;
|
||||
}
|
||||
|
||||
#else /* !CONFIG_CPUSETS */
|
||||
|
||||
static inline int cpuset_init_early(void) { return 0; }
|
||||
static inline int cpuset_init(void) { return 0; }
|
||||
static inline void cpuset_init_smp(void) {}
|
||||
|
||||
@@ -116,7 +118,6 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
|
||||
|
||||
#define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY])
|
||||
static inline void cpuset_init_current_mems_allowed(void) {}
|
||||
static inline void cpuset_update_task_memory_state(void) {}
|
||||
|
||||
static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask)
|
||||
{
|
||||
@@ -188,6 +189,10 @@ static inline void cpuset_print_task_mems_allowed(struct task_struct *p)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void set_mems_allowed(nodemask_t nodemask)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_CPUSETS */
|
||||
|
||||
#endif /* _LINUX_CPUSET_H */
|
||||
|
@@ -2,9 +2,8 @@
|
||||
#define __CRAMFS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
|
||||
#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
|
||||
#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
|
||||
#define CRAMFS_SIGNATURE "Compressed ROMFS"
|
||||
|
||||
/*
|
||||
|
@@ -142,19 +142,6 @@ struct CYZ_BOOT_CTRL {
|
||||
|
||||
|
||||
#ifndef DP_WINDOW_SIZE
|
||||
/* #include "cyclomz.h" */
|
||||
/****************** ****************** *******************/
|
||||
/*
|
||||
* The data types defined below are used in all ZFIRM interface
|
||||
* data structures. They accomodate differences between HW
|
||||
* architectures and compilers.
|
||||
*/
|
||||
|
||||
typedef __u64 ucdouble; /* 64 bits, unsigned */
|
||||
typedef __u32 uclong; /* 32 bits, unsigned */
|
||||
typedef __u16 ucshort; /* 16 bits, unsigned */
|
||||
typedef __u8 ucchar; /* 8 bits, unsigned */
|
||||
|
||||
/*
|
||||
* Memory Window Sizes
|
||||
*/
|
||||
@@ -507,16 +494,20 @@ struct ZFW_CTRL {
|
||||
|
||||
/* Per card data structure */
|
||||
struct cyclades_card {
|
||||
void __iomem *base_addr;
|
||||
void __iomem *ctl_addr;
|
||||
int irq;
|
||||
unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
|
||||
unsigned int first_line; /* minor number of first channel on card */
|
||||
unsigned int nports; /* Number of ports in the card */
|
||||
int bus_index; /* address shift - 0 for ISA, 1 for PCI */
|
||||
int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */
|
||||
spinlock_t card_lock;
|
||||
struct cyclades_port *ports;
|
||||
void __iomem *base_addr;
|
||||
union {
|
||||
void __iomem *p9050;
|
||||
struct RUNTIME_9060 __iomem *p9060;
|
||||
} ctl_addr;
|
||||
int irq;
|
||||
unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
|
||||
unsigned int first_line; /* minor number of first channel on card */
|
||||
unsigned int nports; /* Number of ports in the card */
|
||||
int bus_index; /* address shift - 0 for ISA, 1 for PCI */
|
||||
int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */
|
||||
u32 hw_ver;
|
||||
spinlock_t card_lock;
|
||||
struct cyclades_port *ports;
|
||||
};
|
||||
|
||||
/***************************************
|
||||
|
@@ -180,10 +180,12 @@ d_iput: no no no yes
|
||||
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
|
||||
#define DCACHE_UNHASHED 0x0010
|
||||
|
||||
#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */
|
||||
#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched by inotify */
|
||||
|
||||
#define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */
|
||||
|
||||
#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */
|
||||
|
||||
extern spinlock_t dcache_lock;
|
||||
extern seqlock_t rename_lock;
|
||||
|
||||
@@ -351,6 +353,11 @@ static inline int d_unhashed(struct dentry *dentry)
|
||||
return (dentry->d_flags & DCACHE_UNHASHED);
|
||||
}
|
||||
|
||||
static inline int d_unlinked(struct dentry *dentry)
|
||||
{
|
||||
return d_unhashed(dentry) && !IS_ROOT(dentry);
|
||||
}
|
||||
|
||||
static inline struct dentry *dget_parent(struct dentry *dentry)
|
||||
{
|
||||
struct dentry *ret;
|
||||
@@ -368,7 +375,7 @@ static inline int d_mountpoint(struct dentry *dentry)
|
||||
return dentry->d_mounted;
|
||||
}
|
||||
|
||||
extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *);
|
||||
extern struct vfsmount *lookup_mnt(struct path *);
|
||||
extern struct dentry *lookup_create(struct nameidata *nd, int is_dir);
|
||||
|
||||
extern int sysctl_vfs_cache_pressure;
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include <linux/bio.h>
|
||||
#include <linux/blkdev.h>
|
||||
|
||||
struct dm_dev;
|
||||
struct dm_target;
|
||||
struct dm_table;
|
||||
struct mapped_device;
|
||||
@@ -21,6 +22,7 @@ typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t;
|
||||
union map_info {
|
||||
void *ptr;
|
||||
unsigned long long ll;
|
||||
unsigned flush_request;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -80,6 +82,15 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd,
|
||||
typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
|
||||
struct bio_vec *biovec, int max_size);
|
||||
|
||||
typedef int (*iterate_devices_callout_fn) (struct dm_target *ti,
|
||||
struct dm_dev *dev,
|
||||
sector_t physical_start,
|
||||
void *data);
|
||||
|
||||
typedef int (*dm_iterate_devices_fn) (struct dm_target *ti,
|
||||
iterate_devices_callout_fn fn,
|
||||
void *data);
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* 0: The target can handle the next I/O immediately.
|
||||
@@ -92,7 +103,8 @@ void dm_error(const char *message);
|
||||
/*
|
||||
* Combine device limits.
|
||||
*/
|
||||
void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev);
|
||||
int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
|
||||
sector_t start, void *data);
|
||||
|
||||
struct dm_dev {
|
||||
struct block_device *bdev;
|
||||
@@ -138,23 +150,12 @@ struct target_type {
|
||||
dm_ioctl_fn ioctl;
|
||||
dm_merge_fn merge;
|
||||
dm_busy_fn busy;
|
||||
dm_iterate_devices_fn iterate_devices;
|
||||
|
||||
/* For internal device-mapper use. */
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
struct io_restrictions {
|
||||
unsigned long bounce_pfn;
|
||||
unsigned long seg_boundary_mask;
|
||||
unsigned max_hw_sectors;
|
||||
unsigned max_sectors;
|
||||
unsigned max_segment_size;
|
||||
unsigned short hardsect_size;
|
||||
unsigned short max_hw_segments;
|
||||
unsigned short max_phys_segments;
|
||||
unsigned char no_cluster; /* inverted so that 0 is default */
|
||||
};
|
||||
|
||||
struct dm_target {
|
||||
struct dm_table *table;
|
||||
struct target_type *type;
|
||||
@@ -163,15 +164,18 @@ struct dm_target {
|
||||
sector_t begin;
|
||||
sector_t len;
|
||||
|
||||
/* FIXME: turn this into a mask, and merge with io_restrictions */
|
||||
/* Always a power of 2 */
|
||||
sector_t split_io;
|
||||
|
||||
/*
|
||||
* These are automatically filled in by
|
||||
* dm_table_get_device.
|
||||
* A number of zero-length barrier requests that will be submitted
|
||||
* to the target for the purpose of flushing cache.
|
||||
*
|
||||
* The request number will be placed in union map_info->flush_request.
|
||||
* It is a responsibility of the target driver to remap these requests
|
||||
* to the real underlying devices.
|
||||
*/
|
||||
struct io_restrictions limits;
|
||||
unsigned num_flush_requests;
|
||||
|
||||
/* target specific data */
|
||||
void *private;
|
||||
@@ -230,6 +234,7 @@ struct gendisk *dm_disk(struct mapped_device *md);
|
||||
int dm_suspended(struct mapped_device *md);
|
||||
int dm_noflush_suspending(struct dm_target *ti);
|
||||
union map_info *dm_get_mapinfo(struct bio *bio);
|
||||
union map_info *dm_get_rq_mapinfo(struct request *rq);
|
||||
|
||||
/*
|
||||
* Geometry functions.
|
||||
@@ -392,4 +397,12 @@ static inline unsigned long to_bytes(sector_t n)
|
||||
return (n << SECTOR_SHIFT);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
* Helper for block layer and dm core operations
|
||||
*---------------------------------------------------------------*/
|
||||
void dm_dispatch_request(struct request *rq);
|
||||
void dm_requeue_unmapped_request(struct request *rq);
|
||||
void dm_kill_unmapped_request(struct request *rq, int error);
|
||||
int dm_underlying_device_busy(struct request_queue *q);
|
||||
|
||||
#endif /* _LINUX_DEVICE_MAPPER_H */
|
||||
|
@@ -62,8 +62,6 @@ struct bus_type {
|
||||
void (*shutdown)(struct device *dev);
|
||||
|
||||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*suspend_late)(struct device *dev, pm_message_t state);
|
||||
int (*resume_early)(struct device *dev);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
@@ -116,6 +114,8 @@ extern int bus_unregister_notifier(struct bus_type *bus,
|
||||
#define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */
|
||||
#define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be
|
||||
unbound */
|
||||
#define BUS_NOTIFY_UNBOUND_DRIVER 0x00000005 /* driver is unbound
|
||||
from the device */
|
||||
|
||||
extern struct kset *bus_get_kset(struct bus_type *bus);
|
||||
extern struct klist *bus_get_device_klist(struct bus_type *bus);
|
||||
@@ -194,6 +194,7 @@ struct class {
|
||||
struct kobject *dev_kobj;
|
||||
|
||||
int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
|
||||
char *(*nodename)(struct device *dev);
|
||||
|
||||
void (*class_release)(struct class *class);
|
||||
void (*dev_release)(struct device *dev);
|
||||
@@ -289,11 +290,9 @@ struct device_type {
|
||||
const char *name;
|
||||
struct attribute_group **groups;
|
||||
int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
|
||||
char *(*nodename)(struct device *dev);
|
||||
void (*release)(struct device *dev);
|
||||
|
||||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
};
|
||||
|
||||
@@ -491,6 +490,7 @@ extern struct device *device_find_child(struct device *dev, void *data,
|
||||
extern int device_rename(struct device *dev, char *new_name);
|
||||
extern int device_move(struct device *dev, struct device *new_parent,
|
||||
enum dpm_order dpm_order);
|
||||
extern const char *device_get_nodename(struct device *dev, const char **tmp);
|
||||
|
||||
/*
|
||||
* Root device objects for grouping under /sys/devices
|
||||
|
@@ -81,8 +81,8 @@ struct dlm_lksb {
|
||||
* the cluster, the calling node joins it.
|
||||
*/
|
||||
|
||||
int dlm_new_lockspace(char *name, int namelen, dlm_lockspace_t **lockspace,
|
||||
uint32_t flags, int lvblen);
|
||||
int dlm_new_lockspace(const char *name, int namelen,
|
||||
dlm_lockspace_t **lockspace, uint32_t flags, int lvblen);
|
||||
|
||||
/*
|
||||
* dlm_release_lockspace
|
||||
|
@@ -123,6 +123,16 @@ struct dm_ioctl {
|
||||
__u32 target_count; /* in/out */
|
||||
__s32 open_count; /* out */
|
||||
__u32 flags; /* in/out */
|
||||
|
||||
/*
|
||||
* event_nr holds either the event number (input and output) or the
|
||||
* udev cookie value (input only).
|
||||
* The DM_DEV_WAIT ioctl takes an event number as input.
|
||||
* The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls
|
||||
* use the field as a cookie to return in the DM_COOKIE
|
||||
* variable with the uevents they issue.
|
||||
* For output, the ioctls return the event number, not the cookie.
|
||||
*/
|
||||
__u32 event_nr; /* in/out */
|
||||
__u32 padding;
|
||||
|
||||
@@ -256,9 +266,9 @@ enum {
|
||||
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
|
||||
|
||||
#define DM_VERSION_MAJOR 4
|
||||
#define DM_VERSION_MINOR 14
|
||||
#define DM_VERSION_MINOR 15
|
||||
#define DM_VERSION_PATCHLEVEL 0
|
||||
#define DM_VERSION_EXTRA "-ioctl (2008-04-23)"
|
||||
#define DM_VERSION_EXTRA "-ioctl (2009-04-01)"
|
||||
|
||||
/* Status bits */
|
||||
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
|
||||
|
386
include/linux/dm-log-userspace.h
Normal file
386
include/linux/dm-log-userspace.h
Normal file
@@ -0,0 +1,386 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2009 Red Hat, Inc.
|
||||
*
|
||||
* This file is released under the LGPL.
|
||||
*/
|
||||
|
||||
#ifndef __DM_LOG_USERSPACE_H__
|
||||
#define __DM_LOG_USERSPACE_H__
|
||||
|
||||
#include <linux/dm-ioctl.h> /* For DM_UUID_LEN */
|
||||
|
||||
/*
|
||||
* The device-mapper userspace log module consists of a kernel component and
|
||||
* a user-space component. The kernel component implements the API defined
|
||||
* in dm-dirty-log.h. Its purpose is simply to pass the parameters and
|
||||
* return values of those API functions between kernel and user-space.
|
||||
*
|
||||
* Below are defined the 'request_types' - DM_ULOG_CTR, DM_ULOG_DTR, etc.
|
||||
* These request types represent the different functions in the device-mapper
|
||||
* dirty log API. Each of these is described in more detail below.
|
||||
*
|
||||
* The user-space program must listen for requests from the kernel (representing
|
||||
* the various API functions) and process them.
|
||||
*
|
||||
* User-space begins by setting up the communication link (error checking
|
||||
* removed for clarity):
|
||||
* fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
|
||||
* addr.nl_family = AF_NETLINK;
|
||||
* addr.nl_groups = CN_IDX_DM;
|
||||
* addr.nl_pid = 0;
|
||||
* r = bind(fd, (struct sockaddr *) &addr, sizeof(addr));
|
||||
* opt = addr.nl_groups;
|
||||
* setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &opt, sizeof(opt));
|
||||
*
|
||||
* User-space will then wait to receive requests form the kernel, which it
|
||||
* will process as described below. The requests are received in the form,
|
||||
* ((struct dm_ulog_request) + (additional data)). Depending on the request
|
||||
* type, there may or may not be 'additional data'. In the descriptions below,
|
||||
* you will see 'Payload-to-userspace' and 'Payload-to-kernel'. The
|
||||
* 'Payload-to-userspace' is what the kernel sends in 'additional data' as
|
||||
* necessary parameters to complete the request. The 'Payload-to-kernel' is
|
||||
* the 'additional data' returned to the kernel that contains the necessary
|
||||
* results of the request. The 'data_size' field in the dm_ulog_request
|
||||
* structure denotes the availability and amount of payload data.
|
||||
*/
|
||||
|
||||
/*
|
||||
* DM_ULOG_CTR corresponds to (found in dm-dirty-log.h):
|
||||
* int (*ctr)(struct dm_dirty_log *log, struct dm_target *ti,
|
||||
* unsigned argc, char **argv);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* A single string containing all the argv arguments separated by ' 's
|
||||
* Payload-to-kernel:
|
||||
* None. ('data_size' in the dm_ulog_request struct should be 0.)
|
||||
*
|
||||
* The UUID contained in the dm_ulog_request structure is the reference that
|
||||
* will be used by all request types to a specific log. The constructor must
|
||||
* record this assotiation with instance created.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_CTR 1
|
||||
|
||||
/*
|
||||
* DM_ULOG_DTR corresponds to (found in dm-dirty-log.h):
|
||||
* void (*dtr)(struct dm_dirty_log *log);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* A single string containing all the argv arguments separated by ' 's
|
||||
* Payload-to-kernel:
|
||||
* None. ('data_size' in the dm_ulog_request struct should be 0.)
|
||||
*
|
||||
* The UUID contained in the dm_ulog_request structure is all that is
|
||||
* necessary to identify the log instance being destroyed. There is no
|
||||
* payload data.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and clearing
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_DTR 2
|
||||
|
||||
/*
|
||||
* DM_ULOG_PRESUSPEND corresponds to (found in dm-dirty-log.h):
|
||||
* int (*presuspend)(struct dm_dirty_log *log);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* None.
|
||||
*
|
||||
* The UUID contained in the dm_ulog_request structure is all that is
|
||||
* necessary to identify the log instance being presuspended. There is no
|
||||
* payload data.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_PRESUSPEND 3
|
||||
|
||||
/*
|
||||
* DM_ULOG_POSTSUSPEND corresponds to (found in dm-dirty-log.h):
|
||||
* int (*postsuspend)(struct dm_dirty_log *log);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* None.
|
||||
*
|
||||
* The UUID contained in the dm_ulog_request structure is all that is
|
||||
* necessary to identify the log instance being postsuspended. There is no
|
||||
* payload data.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_POSTSUSPEND 4
|
||||
|
||||
/*
|
||||
* DM_ULOG_RESUME corresponds to (found in dm-dirty-log.h):
|
||||
* int (*resume)(struct dm_dirty_log *log);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* None.
|
||||
*
|
||||
* The UUID contained in the dm_ulog_request structure is all that is
|
||||
* necessary to identify the log instance being resumed. There is no
|
||||
* payload data.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_RESUME 5
|
||||
|
||||
/*
|
||||
* DM_ULOG_GET_REGION_SIZE corresponds to (found in dm-dirty-log.h):
|
||||
* uint32_t (*get_region_size)(struct dm_dirty_log *log);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* uint64_t - contains the region size
|
||||
*
|
||||
* The region size is something that was determined at constructor time.
|
||||
* It is returned in the payload area and 'data_size' is set to
|
||||
* reflect this.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field appropriately.
|
||||
*/
|
||||
#define DM_ULOG_GET_REGION_SIZE 6
|
||||
|
||||
/*
|
||||
* DM_ULOG_IS_CLEAN corresponds to (found in dm-dirty-log.h):
|
||||
* int (*is_clean)(struct dm_dirty_log *log, region_t region);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* uint64_t - the region to get clean status on
|
||||
* Payload-to-kernel:
|
||||
* int64_t - 1 if clean, 0 otherwise
|
||||
*
|
||||
* Payload is sizeof(uint64_t) and contains the region for which the clean
|
||||
* status is being made.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - filling the payload with 0 (not clean) or
|
||||
* 1 (clean), setting 'data_size' and 'error' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_IS_CLEAN 7
|
||||
|
||||
/*
|
||||
* DM_ULOG_IN_SYNC corresponds to (found in dm-dirty-log.h):
|
||||
* int (*in_sync)(struct dm_dirty_log *log, region_t region,
|
||||
* int can_block);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* uint64_t - the region to get sync status on
|
||||
* Payload-to-kernel:
|
||||
* int64_t - 1 if in-sync, 0 otherwise
|
||||
*
|
||||
* Exactly the same as 'is_clean' above, except this time asking "has the
|
||||
* region been recovered?" vs. "is the region not being modified?"
|
||||
*/
|
||||
#define DM_ULOG_IN_SYNC 8
|
||||
|
||||
/*
|
||||
* DM_ULOG_FLUSH corresponds to (found in dm-dirty-log.h):
|
||||
* int (*flush)(struct dm_dirty_log *log);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* None.
|
||||
*
|
||||
* No incoming or outgoing payload. Simply flush log state to disk.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and clearing
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_FLUSH 9
|
||||
|
||||
/*
|
||||
* DM_ULOG_MARK_REGION corresponds to (found in dm-dirty-log.h):
|
||||
* void (*mark_region)(struct dm_dirty_log *log, region_t region);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* uint64_t [] - region(s) to mark
|
||||
* Payload-to-kernel:
|
||||
* None.
|
||||
*
|
||||
* Incoming payload contains the one or more regions to mark dirty.
|
||||
* The number of regions contained in the payload can be determined from
|
||||
* 'data_size/sizeof(uint64_t)'.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and clearing
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_MARK_REGION 10
|
||||
|
||||
/*
|
||||
* DM_ULOG_CLEAR_REGION corresponds to (found in dm-dirty-log.h):
|
||||
* void (*clear_region)(struct dm_dirty_log *log, region_t region);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* uint64_t [] - region(s) to clear
|
||||
* Payload-to-kernel:
|
||||
* None.
|
||||
*
|
||||
* Incoming payload contains the one or more regions to mark clean.
|
||||
* The number of regions contained in the payload can be determined from
|
||||
* 'data_size/sizeof(uint64_t)'.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and clearing
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_CLEAR_REGION 11
|
||||
|
||||
/*
|
||||
* DM_ULOG_GET_RESYNC_WORK corresponds to (found in dm-dirty-log.h):
|
||||
* int (*get_resync_work)(struct dm_dirty_log *log, region_t *region);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* {
|
||||
* int64_t i; -- 1 if recovery necessary, 0 otherwise
|
||||
* uint64_t r; -- The region to recover if i=1
|
||||
* }
|
||||
* 'data_size' should be set appropriately.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field appropriately.
|
||||
*/
|
||||
#define DM_ULOG_GET_RESYNC_WORK 12
|
||||
|
||||
/*
|
||||
* DM_ULOG_SET_REGION_SYNC corresponds to (found in dm-dirty-log.h):
|
||||
* void (*set_region_sync)(struct dm_dirty_log *log,
|
||||
* region_t region, int in_sync);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* {
|
||||
* uint64_t - region to set sync state on
|
||||
* int64_t - 0 if not-in-sync, 1 if in-sync
|
||||
* }
|
||||
* Payload-to-kernel:
|
||||
* None.
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and clearing
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_SET_REGION_SYNC 13
|
||||
|
||||
/*
|
||||
* DM_ULOG_GET_SYNC_COUNT corresponds to (found in dm-dirty-log.h):
|
||||
* region_t (*get_sync_count)(struct dm_dirty_log *log);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* uint64_t - the number of in-sync regions
|
||||
*
|
||||
* No incoming payload. Kernel-bound payload contains the number of
|
||||
* regions that are in-sync (in a size_t).
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_GET_SYNC_COUNT 14
|
||||
|
||||
/*
|
||||
* DM_ULOG_STATUS_INFO corresponds to (found in dm-dirty-log.h):
|
||||
* int (*status)(struct dm_dirty_log *log, STATUSTYPE_INFO,
|
||||
* char *result, unsigned maxlen);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* Character string containing STATUSTYPE_INFO
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_STATUS_INFO 15
|
||||
|
||||
/*
|
||||
* DM_ULOG_STATUS_TABLE corresponds to (found in dm-dirty-log.h):
|
||||
* int (*status)(struct dm_dirty_log *log, STATUSTYPE_TABLE,
|
||||
* char *result, unsigned maxlen);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* None.
|
||||
* Payload-to-kernel:
|
||||
* Character string containing STATUSTYPE_TABLE
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_STATUS_TABLE 16
|
||||
|
||||
/*
|
||||
* DM_ULOG_IS_REMOTE_RECOVERING corresponds to (found in dm-dirty-log.h):
|
||||
* int (*is_remote_recovering)(struct dm_dirty_log *log, region_t region);
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* uint64_t - region to determine recovery status on
|
||||
* Payload-to-kernel:
|
||||
* {
|
||||
* int64_t is_recovering; -- 0 if no, 1 if yes
|
||||
* uint64_t in_sync_hint; -- lowest region still needing resync
|
||||
* }
|
||||
*
|
||||
* When the request has been processed, user-space must return the
|
||||
* dm_ulog_request to the kernel - setting the 'error' field and
|
||||
* 'data_size' appropriately.
|
||||
*/
|
||||
#define DM_ULOG_IS_REMOTE_RECOVERING 17
|
||||
|
||||
/*
|
||||
* (DM_ULOG_REQUEST_MASK & request_type) to get the request type
|
||||
*
|
||||
* Payload-to-userspace:
|
||||
* A single string containing all the argv arguments separated by ' 's
|
||||
* Payload-to-kernel:
|
||||
* None. ('data_size' in the dm_ulog_request struct should be 0.)
|
||||
*
|
||||
* We are reserving 8 bits of the 32-bit 'request_type' field for the
|
||||
* various request types above. The remaining 24-bits are currently
|
||||
* set to zero and are reserved for future use and compatibility concerns.
|
||||
*
|
||||
* User-space should always use DM_ULOG_REQUEST_TYPE to aquire the
|
||||
* request type from the 'request_type' field to maintain forward compatibility.
|
||||
*/
|
||||
#define DM_ULOG_REQUEST_MASK 0xFF
|
||||
#define DM_ULOG_REQUEST_TYPE(request_type) \
|
||||
(DM_ULOG_REQUEST_MASK & (request_type))
|
||||
|
||||
struct dm_ulog_request {
|
||||
char uuid[DM_UUID_LEN]; /* Ties a request to a specific mirror log */
|
||||
char padding[7]; /* Padding because DM_UUID_LEN = 129 */
|
||||
|
||||
int32_t error; /* Used to report back processing errors */
|
||||
|
||||
uint32_t seq; /* Sequence number for request */
|
||||
uint32_t request_type; /* DM_ULOG_* defined above */
|
||||
uint32_t data_size; /* How much data (not including this struct) */
|
||||
|
||||
char data[0];
|
||||
};
|
||||
|
||||
#endif /* __DM_LOG_USERSPACE_H__ */
|
@@ -32,6 +32,8 @@ extern void dma_debug_add_bus(struct bus_type *bus);
|
||||
|
||||
extern void dma_debug_init(u32 num_entries);
|
||||
|
||||
extern int dma_debug_resize_entries(u32 num_entries);
|
||||
|
||||
extern void debug_dma_map_page(struct device *dev, struct page *page,
|
||||
size_t offset, size_t size,
|
||||
int direction, dma_addr_t dma_addr,
|
||||
@@ -91,6 +93,11 @@ static inline void dma_debug_init(u32 num_entries)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int dma_debug_resize_entries(u32 num_entries)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void debug_dma_map_page(struct device *dev, struct page *page,
|
||||
size_t offset, size_t size,
|
||||
int direction, dma_addr_t dma_addr,
|
||||
|
@@ -63,24 +63,26 @@ struct dma_map_ops {
|
||||
|
||||
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
|
||||
|
||||
typedef u64 DMA_nnBIT_MASK __deprecated;
|
||||
|
||||
/*
|
||||
* NOTE: do not use the below macros in new code and do not add new definitions
|
||||
* here.
|
||||
*
|
||||
* Instead, just open-code DMA_BIT_MASK(n) within your driver
|
||||
*/
|
||||
#define DMA_64BIT_MASK DMA_BIT_MASK(64)
|
||||
#define DMA_48BIT_MASK DMA_BIT_MASK(48)
|
||||
#define DMA_47BIT_MASK DMA_BIT_MASK(47)
|
||||
#define DMA_40BIT_MASK DMA_BIT_MASK(40)
|
||||
#define DMA_39BIT_MASK DMA_BIT_MASK(39)
|
||||
#define DMA_35BIT_MASK DMA_BIT_MASK(35)
|
||||
#define DMA_32BIT_MASK DMA_BIT_MASK(32)
|
||||
#define DMA_31BIT_MASK DMA_BIT_MASK(31)
|
||||
#define DMA_30BIT_MASK DMA_BIT_MASK(30)
|
||||
#define DMA_29BIT_MASK DMA_BIT_MASK(29)
|
||||
#define DMA_28BIT_MASK DMA_BIT_MASK(28)
|
||||
#define DMA_24BIT_MASK DMA_BIT_MASK(24)
|
||||
#define DMA_64BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(64)
|
||||
#define DMA_48BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(48)
|
||||
#define DMA_47BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(47)
|
||||
#define DMA_40BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(40)
|
||||
#define DMA_39BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(39)
|
||||
#define DMA_35BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(35)
|
||||
#define DMA_32BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(32)
|
||||
#define DMA_31BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(31)
|
||||
#define DMA_30BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(30)
|
||||
#define DMA_29BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(29)
|
||||
#define DMA_28BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(28)
|
||||
#define DMA_24BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(24)
|
||||
|
||||
#define DMA_MASK_NONE 0x0ULL
|
||||
|
||||
@@ -107,9 +109,20 @@ static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
|
||||
#include <asm-generic/dma-mapping-broken.h>
|
||||
#endif
|
||||
|
||||
/* Backwards compat, remove in 2.7.x */
|
||||
#define dma_sync_single dma_sync_single_for_cpu
|
||||
#define dma_sync_sg dma_sync_sg_for_cpu
|
||||
/* for backwards compatibility, removed soon */
|
||||
static inline void __deprecated dma_sync_single(struct device *dev,
|
||||
dma_addr_t addr, size_t size,
|
||||
enum dma_data_direction dir)
|
||||
{
|
||||
dma_sync_single_for_cpu(dev, addr, size, dir);
|
||||
}
|
||||
|
||||
static inline void __deprecated dma_sync_sg(struct device *dev,
|
||||
struct scatterlist *sg, int nelems,
|
||||
enum dma_data_direction dir)
|
||||
{
|
||||
dma_sync_sg_for_cpu(dev, sg, nelems, dir);
|
||||
}
|
||||
|
||||
static inline u64 dma_get_mask(struct device *dev)
|
||||
{
|
||||
|
@@ -13,6 +13,10 @@
|
||||
#define DMA_PTE_WRITE (2)
|
||||
#define DMA_PTE_SNP (1 << 11)
|
||||
|
||||
#define CONTEXT_TT_MULTI_LEVEL 0
|
||||
#define CONTEXT_TT_DEV_IOTLB 1
|
||||
#define CONTEXT_TT_PASS_THROUGH 2
|
||||
|
||||
struct intel_iommu;
|
||||
struct dmar_domain;
|
||||
struct root_entry;
|
||||
@@ -21,11 +25,16 @@ extern void free_dmar_iommu(struct intel_iommu *iommu);
|
||||
|
||||
#ifdef CONFIG_DMAR
|
||||
extern int iommu_calculate_agaw(struct intel_iommu *iommu);
|
||||
extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
|
||||
#else
|
||||
static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int dmar_disabled;
|
||||
|
@@ -211,8 +211,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param);
|
||||
* @flags: flags to augment operation preparation, control completion, and
|
||||
* communicate status
|
||||
* @phys: physical address of the descriptor
|
||||
* @tx_list: driver common field for operations that require multiple
|
||||
* descriptors
|
||||
* @chan: target channel for this operation
|
||||
* @tx_submit: set the prepared descriptor(s) to be executed by the engine
|
||||
* @callback: routine to call after this operation is complete
|
||||
@@ -226,7 +224,6 @@ struct dma_async_tx_descriptor {
|
||||
dma_cookie_t cookie;
|
||||
enum dma_ctrl_flags flags; /* not a 'long' to pack with cookie */
|
||||
dma_addr_t phys;
|
||||
struct list_head tx_list;
|
||||
struct dma_chan *chan;
|
||||
dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
|
||||
dma_async_tx_callback callback;
|
||||
|
@@ -108,6 +108,7 @@ struct irte {
|
||||
};
|
||||
#ifdef CONFIG_INTR_REMAP
|
||||
extern int intr_remapping_enabled;
|
||||
extern int intr_remapping_supported(void);
|
||||
extern int enable_intr_remapping(int);
|
||||
extern void disable_intr_remapping(void);
|
||||
extern int reenable_intr_remapping(int);
|
||||
@@ -125,6 +126,8 @@ extern int free_irte(int irq);
|
||||
extern int irq_remapped(int irq);
|
||||
extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev);
|
||||
extern struct intel_iommu *map_ioapic_to_ir(int apic);
|
||||
extern int set_ioapic_sid(struct irte *irte, int apic);
|
||||
extern int set_msi_sid(struct irte *irte, struct pci_dev *dev);
|
||||
#else
|
||||
static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
|
||||
{
|
||||
@@ -155,8 +158,19 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline int set_ioapic_sid(struct irte *irte, int apic)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define irq_remapped(irq) (0)
|
||||
#define enable_intr_remapping(mode) (-1)
|
||||
#define disable_intr_remapping() (0)
|
||||
#define reenable_intr_remapping(mode) (0)
|
||||
#define intr_remapping_enabled (0)
|
||||
#endif
|
||||
|
||||
@@ -185,6 +199,15 @@ struct dmar_rmrr_unit {
|
||||
|
||||
#define for_each_rmrr_units(rmrr) \
|
||||
list_for_each_entry(rmrr, &dmar_rmrr_units, list)
|
||||
|
||||
struct dmar_atsr_unit {
|
||||
struct list_head list; /* list of ATSR units */
|
||||
struct acpi_dmar_header *hdr; /* ACPI header */
|
||||
struct pci_dev **devices; /* target devices */
|
||||
int devices_cnt; /* target device count */
|
||||
u8 include_all:1; /* include all ports */
|
||||
};
|
||||
|
||||
/* Intel DMAR initialization functions */
|
||||
extern int intel_iommu_init(void);
|
||||
#else
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
struct dnotify_struct {
|
||||
struct dnotify_struct * dn_next;
|
||||
unsigned long dn_mask;
|
||||
__u32 dn_mask;
|
||||
int dn_fd;
|
||||
struct file * dn_filp;
|
||||
fl_owner_t dn_owner;
|
||||
@@ -21,23 +21,18 @@ struct dnotify_struct {
|
||||
|
||||
#ifdef CONFIG_DNOTIFY
|
||||
|
||||
extern void __inode_dir_notify(struct inode *, unsigned long);
|
||||
#define DNOTIFY_ALL_EVENTS (FS_DELETE | FS_DELETE_CHILD |\
|
||||
FS_MODIFY | FS_MODIFY_CHILD |\
|
||||
FS_ACCESS | FS_ACCESS_CHILD |\
|
||||
FS_ATTRIB | FS_ATTRIB_CHILD |\
|
||||
FS_CREATE | FS_DN_RENAME |\
|
||||
FS_MOVED_FROM | FS_MOVED_TO)
|
||||
|
||||
extern void dnotify_flush(struct file *, fl_owner_t);
|
||||
extern int fcntl_dirnotify(int, struct file *, unsigned long);
|
||||
extern void dnotify_parent(struct dentry *, unsigned long);
|
||||
|
||||
static inline void inode_dir_notify(struct inode *inode, unsigned long event)
|
||||
{
|
||||
if (inode->i_dnotify_mask & (event))
|
||||
__inode_dir_notify(inode, event);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static inline void __inode_dir_notify(struct inode *inode, unsigned long event)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void dnotify_flush(struct file *filp, fl_owner_t id)
|
||||
{
|
||||
}
|
||||
@@ -47,14 +42,6 @@ static inline int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void dnotify_parent(struct dentry *dentry, unsigned long event)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void inode_dir_notify(struct inode *inode, unsigned long event)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DNOTIFY */
|
||||
|
||||
#endif /* __KERNEL __ */
|
||||
|
@@ -101,7 +101,7 @@ typedef struct {
|
||||
u64 attribute;
|
||||
} efi_memory_desc_t;
|
||||
|
||||
typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg);
|
||||
typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg);
|
||||
|
||||
/*
|
||||
* Types and defines for Time Services
|
||||
|
@@ -78,12 +78,12 @@ static inline void eisa_driver_unregister (struct eisa_driver *edrv) { }
|
||||
/* Mimics pci.h... */
|
||||
static inline void *eisa_get_drvdata (struct eisa_device *edev)
|
||||
{
|
||||
return edev->dev.driver_data;
|
||||
return dev_get_drvdata(&edev->dev);
|
||||
}
|
||||
|
||||
static inline void eisa_set_drvdata (struct eisa_device *edev, void *data)
|
||||
{
|
||||
edev->dev.driver_data = data;
|
||||
dev_set_drvdata(&edev->dev, data);
|
||||
}
|
||||
|
||||
/* The EISA root device. There's rumours about machines with multiple
|
||||
|
@@ -103,10 +103,8 @@ extern int elv_merge(struct request_queue *, struct request **, struct bio *);
|
||||
extern void elv_merge_requests(struct request_queue *, struct request *,
|
||||
struct request *);
|
||||
extern void elv_merged_request(struct request_queue *, struct request *, int);
|
||||
extern void elv_dequeue_request(struct request_queue *, struct request *);
|
||||
extern void elv_requeue_request(struct request_queue *, struct request *);
|
||||
extern int elv_queue_empty(struct request_queue *);
|
||||
extern struct request *elv_next_request(struct request_queue *q);
|
||||
extern struct request *elv_former_request(struct request_queue *, struct request *);
|
||||
extern struct request *elv_latter_request(struct request_queue *, struct request *);
|
||||
extern int elv_register_queue(struct request_queue *q);
|
||||
@@ -171,7 +169,7 @@ enum {
|
||||
ELV_MQUEUE_MUST,
|
||||
};
|
||||
|
||||
#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
|
||||
#define rq_end_sector(rq) (blk_rq_pos(rq) + blk_rq_sectors(rq))
|
||||
#define rb_entry_rq(node) rb_entry((node), struct request, rb_node)
|
||||
|
||||
/*
|
||||
|
@@ -182,6 +182,33 @@ static inline unsigned compare_ether_addr_64bits(const u8 addr1[6+2],
|
||||
return compare_ether_addr(addr1, addr2);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* is_etherdev_addr - Tell if given Ethernet address belongs to the device.
|
||||
* @dev: Pointer to a device structure
|
||||
* @addr: Pointer to a six-byte array containing the Ethernet address
|
||||
*
|
||||
* Compare passed address with all addresses of the device. Return true if the
|
||||
* address if one of the device addresses.
|
||||
*
|
||||
* Note that this function calls compare_ether_addr_64bits() so take care of
|
||||
* the right padding.
|
||||
*/
|
||||
static inline bool is_etherdev_addr(const struct net_device *dev,
|
||||
const u8 addr[6 + 2])
|
||||
{
|
||||
struct netdev_hw_addr *ha;
|
||||
int res = 1;
|
||||
|
||||
rcu_read_lock();
|
||||
for_each_dev_addr(dev, ha) {
|
||||
res = compare_ether_addr_64bits(addr, ha->addr);
|
||||
if (!res)
|
||||
break;
|
||||
}
|
||||
rcu_read_unlock();
|
||||
return !res;
|
||||
}
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/**
|
||||
|
@@ -26,11 +26,14 @@ struct ethtool_cmd {
|
||||
__u8 phy_address;
|
||||
__u8 transceiver; /* Which transceiver to use */
|
||||
__u8 autoneg; /* Enable or disable autonegotiation */
|
||||
__u8 mdio_support;
|
||||
__u32 maxtxpkt; /* Tx pkts before generating tx int */
|
||||
__u32 maxrxpkt; /* Rx pkts before generating rx int */
|
||||
__u16 speed_hi;
|
||||
__u16 reserved2;
|
||||
__u32 reserved[3];
|
||||
__u8 eth_tp_mdix;
|
||||
__u8 reserved2;
|
||||
__u32 lp_advertising; /* Features the link partner advertises */
|
||||
__u32 reserved[2];
|
||||
};
|
||||
|
||||
static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
|
||||
@@ -563,6 +566,11 @@ struct ethtool_ops {
|
||||
#define SUPPORTED_Pause (1 << 13)
|
||||
#define SUPPORTED_Asym_Pause (1 << 14)
|
||||
#define SUPPORTED_2500baseX_Full (1 << 15)
|
||||
#define SUPPORTED_Backplane (1 << 16)
|
||||
#define SUPPORTED_1000baseKX_Full (1 << 17)
|
||||
#define SUPPORTED_10000baseKX4_Full (1 << 18)
|
||||
#define SUPPORTED_10000baseKR_Full (1 << 19)
|
||||
#define SUPPORTED_10000baseR_FEC (1 << 20)
|
||||
|
||||
/* Indicates what features are advertised by the interface. */
|
||||
#define ADVERTISED_10baseT_Half (1 << 0)
|
||||
@@ -581,6 +589,11 @@ struct ethtool_ops {
|
||||
#define ADVERTISED_Pause (1 << 13)
|
||||
#define ADVERTISED_Asym_Pause (1 << 14)
|
||||
#define ADVERTISED_2500baseX_Full (1 << 15)
|
||||
#define ADVERTISED_Backplane (1 << 16)
|
||||
#define ADVERTISED_1000baseKX_Full (1 << 17)
|
||||
#define ADVERTISED_10000baseKX4_Full (1 << 18)
|
||||
#define ADVERTISED_10000baseKR_Full (1 << 19)
|
||||
#define ADVERTISED_10000baseR_FEC (1 << 20)
|
||||
|
||||
/* The following are all involved in forcing a particular link
|
||||
* mode for the device for setting things. When getting the
|
||||
@@ -605,6 +618,7 @@ struct ethtool_ops {
|
||||
#define PORT_MII 0x02
|
||||
#define PORT_FIBRE 0x03
|
||||
#define PORT_BNC 0x04
|
||||
#define PORT_OTHER 0xff
|
||||
|
||||
/* Which transceiver to use. */
|
||||
#define XCVR_INTERNAL 0x00
|
||||
@@ -619,6 +633,11 @@ struct ethtool_ops {
|
||||
#define AUTONEG_DISABLE 0x00
|
||||
#define AUTONEG_ENABLE 0x01
|
||||
|
||||
/* Mode MDI or MDI-X */
|
||||
#define ETH_TP_MDI_INVALID 0x00
|
||||
#define ETH_TP_MDI 0x01
|
||||
#define ETH_TP_MDI_X 0x02
|
||||
|
||||
/* Wake-On-Lan options. */
|
||||
#define WAKE_PHY (1 << 0)
|
||||
#define WAKE_UCAST (1 << 1)
|
||||
|
@@ -103,10 +103,6 @@ struct ext3_inode_info {
|
||||
*/
|
||||
struct rw_semaphore xattr_sem;
|
||||
#endif
|
||||
#ifdef CONFIG_EXT3_FS_POSIX_ACL
|
||||
struct posix_acl *i_acl;
|
||||
struct posix_acl *i_default_acl;
|
||||
#endif
|
||||
|
||||
struct list_head i_orphan; /* unlinked but open inodes */
|
||||
|
||||
|
@@ -3,4 +3,25 @@
|
||||
|
||||
#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* Space reservation ioctls and argument structure
|
||||
* are designed to be compatible with the legacy XFS ioctls.
|
||||
*/
|
||||
struct space_resv {
|
||||
__s16 l_type;
|
||||
__s16 l_whence;
|
||||
__s64 l_start;
|
||||
__s64 l_len; /* len == 0 means until end of file */
|
||||
__s32 l_sysid;
|
||||
__u32 l_pid;
|
||||
__s32 l_pad[4]; /* reserved area */
|
||||
};
|
||||
|
||||
#define FS_IOC_RESVSP _IOW('X', 40, struct space_resv)
|
||||
#define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _FALLOC_H_ */
|
||||
|
@@ -677,6 +677,9 @@ struct fb_ops {
|
||||
/* get capability given var */
|
||||
void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps,
|
||||
struct fb_var_screeninfo *var);
|
||||
|
||||
/* teardown any resources to do with this framebuffer */
|
||||
void (*fb_destroy)(struct fb_info *info);
|
||||
};
|
||||
|
||||
#ifdef CONFIG_FB_TILEBLITTING
|
||||
@@ -786,6 +789,8 @@ struct fb_tile_ops {
|
||||
#define FBINFO_MISC_USEREVENT 0x10000 /* event request
|
||||
from userspace */
|
||||
#define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */
|
||||
#define FBINFO_MISC_FIRMWARE 0x40000 /* a replaceable firmware
|
||||
inited framebuffer */
|
||||
|
||||
/* A driver may set this flag to indicate that it does want a set_par to be
|
||||
* called every time when fbcon_switch is executed. The advantage is that with
|
||||
@@ -854,7 +859,12 @@ struct fb_info {
|
||||
u32 state; /* Hardware state i.e suspend */
|
||||
void *fbcon_par; /* fbcon use-only private area */
|
||||
/* From here on everything is device dependent */
|
||||
void *par;
|
||||
void *par;
|
||||
/* we need the PCI or similiar aperture base/size not
|
||||
smem_start/size as smem_start may just be an object
|
||||
allocated inside the aperture so may not actually overlap */
|
||||
resource_size_t aperture_base;
|
||||
resource_size_t aperture_size;
|
||||
};
|
||||
|
||||
#ifdef MODULE
|
||||
@@ -893,7 +903,7 @@ struct fb_info {
|
||||
#define fb_writeq sbus_writeq
|
||||
#define fb_memset sbus_memset_io
|
||||
|
||||
#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__)
|
||||
#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__)
|
||||
|
||||
#define fb_readb __raw_readb
|
||||
#define fb_readw __raw_readw
|
||||
|
445
include/linux/firewire.h
Normal file
445
include/linux/firewire.h
Normal file
@@ -0,0 +1,445 @@
|
||||
#ifndef _LINUX_FIREWIRE_H
|
||||
#define _LINUX_FIREWIRE_H
|
||||
|
||||
#include <linux/completion.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args)
|
||||
#define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args)
|
||||
|
||||
static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
|
||||
{
|
||||
u32 *dst = _dst;
|
||||
__be32 *src = _src;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < size / 4; i++)
|
||||
dst[i] = be32_to_cpu(src[i]);
|
||||
}
|
||||
|
||||
static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size)
|
||||
{
|
||||
fw_memcpy_from_be32(_dst, _src, size);
|
||||
}
|
||||
#define CSR_REGISTER_BASE 0xfffff0000000ULL
|
||||
|
||||
/* register offsets are relative to CSR_REGISTER_BASE */
|
||||
#define CSR_STATE_CLEAR 0x0
|
||||
#define CSR_STATE_SET 0x4
|
||||
#define CSR_NODE_IDS 0x8
|
||||
#define CSR_RESET_START 0xc
|
||||
#define CSR_SPLIT_TIMEOUT_HI 0x18
|
||||
#define CSR_SPLIT_TIMEOUT_LO 0x1c
|
||||
#define CSR_CYCLE_TIME 0x200
|
||||
#define CSR_BUS_TIME 0x204
|
||||
#define CSR_BUSY_TIMEOUT 0x210
|
||||
#define CSR_BUS_MANAGER_ID 0x21c
|
||||
#define CSR_BANDWIDTH_AVAILABLE 0x220
|
||||
#define CSR_CHANNELS_AVAILABLE 0x224
|
||||
#define CSR_CHANNELS_AVAILABLE_HI 0x224
|
||||
#define CSR_CHANNELS_AVAILABLE_LO 0x228
|
||||
#define CSR_BROADCAST_CHANNEL 0x234
|
||||
#define CSR_CONFIG_ROM 0x400
|
||||
#define CSR_CONFIG_ROM_END 0x800
|
||||
#define CSR_FCP_COMMAND 0xB00
|
||||
#define CSR_FCP_RESPONSE 0xD00
|
||||
#define CSR_FCP_END 0xF00
|
||||
#define CSR_TOPOLOGY_MAP 0x1000
|
||||
#define CSR_TOPOLOGY_MAP_END 0x1400
|
||||
#define CSR_SPEED_MAP 0x2000
|
||||
#define CSR_SPEED_MAP_END 0x3000
|
||||
|
||||
#define CSR_OFFSET 0x40
|
||||
#define CSR_LEAF 0x80
|
||||
#define CSR_DIRECTORY 0xc0
|
||||
|
||||
#define CSR_DESCRIPTOR 0x01
|
||||
#define CSR_VENDOR 0x03
|
||||
#define CSR_HARDWARE_VERSION 0x04
|
||||
#define CSR_NODE_CAPABILITIES 0x0c
|
||||
#define CSR_UNIT 0x11
|
||||
#define CSR_SPECIFIER_ID 0x12
|
||||
#define CSR_VERSION 0x13
|
||||
#define CSR_DEPENDENT_INFO 0x14
|
||||
#define CSR_MODEL 0x17
|
||||
#define CSR_INSTANCE 0x18
|
||||
#define CSR_DIRECTORY_ID 0x20
|
||||
|
||||
struct fw_csr_iterator {
|
||||
u32 *p;
|
||||
u32 *end;
|
||||
};
|
||||
|
||||
void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 *p);
|
||||
int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value);
|
||||
|
||||
extern struct bus_type fw_bus_type;
|
||||
|
||||
struct fw_card_driver;
|
||||
struct fw_node;
|
||||
|
||||
struct fw_card {
|
||||
const struct fw_card_driver *driver;
|
||||
struct device *device;
|
||||
struct kref kref;
|
||||
struct completion done;
|
||||
|
||||
int node_id;
|
||||
int generation;
|
||||
int current_tlabel;
|
||||
u64 tlabel_mask;
|
||||
struct list_head transaction_list;
|
||||
struct timer_list flush_timer;
|
||||
unsigned long reset_jiffies;
|
||||
|
||||
unsigned long long guid;
|
||||
unsigned max_receive;
|
||||
int link_speed;
|
||||
int config_rom_generation;
|
||||
|
||||
spinlock_t lock; /* Take this lock when handling the lists in
|
||||
* this struct. */
|
||||
struct fw_node *local_node;
|
||||
struct fw_node *root_node;
|
||||
struct fw_node *irm_node;
|
||||
u8 color; /* must be u8 to match the definition in struct fw_node */
|
||||
int gap_count;
|
||||
bool beta_repeaters_present;
|
||||
|
||||
int index;
|
||||
|
||||
struct list_head link;
|
||||
|
||||
/* Work struct for BM duties. */
|
||||
struct delayed_work work;
|
||||
int bm_retries;
|
||||
int bm_generation;
|
||||
|
||||
bool broadcast_channel_allocated;
|
||||
u32 broadcast_channel;
|
||||
u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
|
||||
};
|
||||
|
||||
static inline struct fw_card *fw_card_get(struct fw_card *card)
|
||||
{
|
||||
kref_get(&card->kref);
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
void fw_card_release(struct kref *kref);
|
||||
|
||||
static inline void fw_card_put(struct fw_card *card)
|
||||
{
|
||||
kref_put(&card->kref, fw_card_release);
|
||||
}
|
||||
|
||||
struct fw_attribute_group {
|
||||
struct attribute_group *groups[2];
|
||||
struct attribute_group group;
|
||||
struct attribute *attrs[12];
|
||||
};
|
||||
|
||||
enum fw_device_state {
|
||||
FW_DEVICE_INITIALIZING,
|
||||
FW_DEVICE_RUNNING,
|
||||
FW_DEVICE_GONE,
|
||||
FW_DEVICE_SHUTDOWN,
|
||||
};
|
||||
|
||||
/*
|
||||
* Note, fw_device.generation always has to be read before fw_device.node_id.
|
||||
* Use SMP memory barriers to ensure this. Otherwise requests will be sent
|
||||
* to an outdated node_id if the generation was updated in the meantime due
|
||||
* to a bus reset.
|
||||
*
|
||||
* Likewise, fw-core will take care to update .node_id before .generation so
|
||||
* that whenever fw_device.generation is current WRT the actual bus generation,
|
||||
* fw_device.node_id is guaranteed to be current too.
|
||||
*
|
||||
* The same applies to fw_device.card->node_id vs. fw_device.generation.
|
||||
*
|
||||
* fw_device.config_rom and fw_device.config_rom_length may be accessed during
|
||||
* the lifetime of any fw_unit belonging to the fw_device, before device_del()
|
||||
* was called on the last fw_unit. Alternatively, they may be accessed while
|
||||
* holding fw_device_rwsem.
|
||||
*/
|
||||
struct fw_device {
|
||||
atomic_t state;
|
||||
struct fw_node *node;
|
||||
int node_id;
|
||||
int generation;
|
||||
unsigned max_speed;
|
||||
struct fw_card *card;
|
||||
struct device device;
|
||||
|
||||
struct mutex client_list_mutex;
|
||||
struct list_head client_list;
|
||||
|
||||
u32 *config_rom;
|
||||
size_t config_rom_length;
|
||||
int config_rom_retries;
|
||||
unsigned is_local:1;
|
||||
unsigned max_rec:4;
|
||||
unsigned cmc:1;
|
||||
unsigned irmc:1;
|
||||
unsigned bc_implemented:2;
|
||||
|
||||
struct delayed_work work;
|
||||
struct fw_attribute_group attribute_group;
|
||||
};
|
||||
|
||||
static inline struct fw_device *fw_device(struct device *dev)
|
||||
{
|
||||
return container_of(dev, struct fw_device, device);
|
||||
}
|
||||
|
||||
static inline int fw_device_is_shutdown(struct fw_device *device)
|
||||
{
|
||||
return atomic_read(&device->state) == FW_DEVICE_SHUTDOWN;
|
||||
}
|
||||
|
||||
static inline struct fw_device *fw_device_get(struct fw_device *device)
|
||||
{
|
||||
get_device(&device->device);
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
static inline void fw_device_put(struct fw_device *device)
|
||||
{
|
||||
put_device(&device->device);
|
||||
}
|
||||
|
||||
int fw_device_enable_phys_dma(struct fw_device *device);
|
||||
|
||||
/*
|
||||
* fw_unit.directory must not be accessed after device_del(&fw_unit.device).
|
||||
*/
|
||||
struct fw_unit {
|
||||
struct device device;
|
||||
u32 *directory;
|
||||
struct fw_attribute_group attribute_group;
|
||||
};
|
||||
|
||||
static inline struct fw_unit *fw_unit(struct device *dev)
|
||||
{
|
||||
return container_of(dev, struct fw_unit, device);
|
||||
}
|
||||
|
||||
static inline struct fw_unit *fw_unit_get(struct fw_unit *unit)
|
||||
{
|
||||
get_device(&unit->device);
|
||||
|
||||
return unit;
|
||||
}
|
||||
|
||||
static inline void fw_unit_put(struct fw_unit *unit)
|
||||
{
|
||||
put_device(&unit->device);
|
||||
}
|
||||
|
||||
static inline struct fw_device *fw_parent_device(struct fw_unit *unit)
|
||||
{
|
||||
return fw_device(unit->device.parent);
|
||||
}
|
||||
|
||||
struct ieee1394_device_id;
|
||||
|
||||
struct fw_driver {
|
||||
struct device_driver driver;
|
||||
/* Called when the parent device sits through a bus reset. */
|
||||
void (*update)(struct fw_unit *unit);
|
||||
const struct ieee1394_device_id *id_table;
|
||||
};
|
||||
|
||||
struct fw_packet;
|
||||
struct fw_request;
|
||||
|
||||
typedef void (*fw_packet_callback_t)(struct fw_packet *packet,
|
||||
struct fw_card *card, int status);
|
||||
typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
|
||||
void *data, size_t length,
|
||||
void *callback_data);
|
||||
/*
|
||||
* Important note: The callback must guarantee that either fw_send_response()
|
||||
* or kfree() is called on the @request.
|
||||
*/
|
||||
typedef void (*fw_address_callback_t)(struct fw_card *card,
|
||||
struct fw_request *request,
|
||||
int tcode, int destination, int source,
|
||||
int generation, int speed,
|
||||
unsigned long long offset,
|
||||
void *data, size_t length,
|
||||
void *callback_data);
|
||||
|
||||
struct fw_packet {
|
||||
int speed;
|
||||
int generation;
|
||||
u32 header[4];
|
||||
size_t header_length;
|
||||
void *payload;
|
||||
size_t payload_length;
|
||||
dma_addr_t payload_bus;
|
||||
u32 timestamp;
|
||||
|
||||
/*
|
||||
* This callback is called when the packet transmission has
|
||||
* completed; for successful transmission, the status code is
|
||||
* the ack received from the destination, otherwise it's a
|
||||
* negative errno: ENOMEM, ESTALE, ETIMEDOUT, ENODEV, EIO.
|
||||
* The callback can be called from tasklet context and thus
|
||||
* must never block.
|
||||
*/
|
||||
fw_packet_callback_t callback;
|
||||
int ack;
|
||||
struct list_head link;
|
||||
void *driver_data;
|
||||
};
|
||||
|
||||
struct fw_transaction {
|
||||
int node_id; /* The generation is implied; it is always the current. */
|
||||
int tlabel;
|
||||
int timestamp;
|
||||
struct list_head link;
|
||||
|
||||
struct fw_packet packet;
|
||||
|
||||
/*
|
||||
* The data passed to the callback is valid only during the
|
||||
* callback.
|
||||
*/
|
||||
fw_transaction_callback_t callback;
|
||||
void *callback_data;
|
||||
};
|
||||
|
||||
struct fw_address_handler {
|
||||
u64 offset;
|
||||
size_t length;
|
||||
fw_address_callback_t address_callback;
|
||||
void *callback_data;
|
||||
struct list_head link;
|
||||
};
|
||||
|
||||
struct fw_address_region {
|
||||
u64 start;
|
||||
u64 end;
|
||||
};
|
||||
|
||||
extern const struct fw_address_region fw_high_memory_region;
|
||||
|
||||
int fw_core_add_address_handler(struct fw_address_handler *handler,
|
||||
const struct fw_address_region *region);
|
||||
void fw_core_remove_address_handler(struct fw_address_handler *handler);
|
||||
void fw_send_response(struct fw_card *card,
|
||||
struct fw_request *request, int rcode);
|
||||
void fw_send_request(struct fw_card *card, struct fw_transaction *t,
|
||||
int tcode, int destination_id, int generation, int speed,
|
||||
unsigned long long offset, void *payload, size_t length,
|
||||
fw_transaction_callback_t callback, void *callback_data);
|
||||
int fw_cancel_transaction(struct fw_card *card,
|
||||
struct fw_transaction *transaction);
|
||||
int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
|
||||
int generation, int speed, unsigned long long offset,
|
||||
void *payload, size_t length);
|
||||
|
||||
static inline int fw_stream_packet_destination_id(int tag, int channel, int sy)
|
||||
{
|
||||
return tag << 14 | channel << 8 | sy;
|
||||
}
|
||||
|
||||
struct fw_descriptor {
|
||||
struct list_head link;
|
||||
size_t length;
|
||||
u32 immediate;
|
||||
u32 key;
|
||||
const u32 *data;
|
||||
};
|
||||
|
||||
int fw_core_add_descriptor(struct fw_descriptor *desc);
|
||||
void fw_core_remove_descriptor(struct fw_descriptor *desc);
|
||||
|
||||
/*
|
||||
* The iso packet format allows for an immediate header/payload part
|
||||
* stored in 'header' immediately after the packet info plus an
|
||||
* indirect payload part that is pointer to by the 'payload' field.
|
||||
* Applications can use one or the other or both to implement simple
|
||||
* low-bandwidth streaming (e.g. audio) or more advanced
|
||||
* scatter-gather streaming (e.g. assembling video frame automatically).
|
||||
*/
|
||||
struct fw_iso_packet {
|
||||
u16 payload_length; /* Length of indirect payload. */
|
||||
u32 interrupt:1; /* Generate interrupt on this packet */
|
||||
u32 skip:1; /* Set to not send packet at all. */
|
||||
u32 tag:2;
|
||||
u32 sy:4;
|
||||
u32 header_length:8; /* Length of immediate header. */
|
||||
u32 header[0];
|
||||
};
|
||||
|
||||
#define FW_ISO_CONTEXT_TRANSMIT 0
|
||||
#define FW_ISO_CONTEXT_RECEIVE 1
|
||||
|
||||
#define FW_ISO_CONTEXT_MATCH_TAG0 1
|
||||
#define FW_ISO_CONTEXT_MATCH_TAG1 2
|
||||
#define FW_ISO_CONTEXT_MATCH_TAG2 4
|
||||
#define FW_ISO_CONTEXT_MATCH_TAG3 8
|
||||
#define FW_ISO_CONTEXT_MATCH_ALL_TAGS 15
|
||||
|
||||
/*
|
||||
* An iso buffer is just a set of pages mapped for DMA in the
|
||||
* specified direction. Since the pages are to be used for DMA, they
|
||||
* are not mapped into the kernel virtual address space. We store the
|
||||
* DMA address in the page private. The helper function
|
||||
* fw_iso_buffer_map() will map the pages into a given vma.
|
||||
*/
|
||||
struct fw_iso_buffer {
|
||||
enum dma_data_direction direction;
|
||||
struct page **pages;
|
||||
int page_count;
|
||||
};
|
||||
|
||||
int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
|
||||
int page_count, enum dma_data_direction direction);
|
||||
void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card);
|
||||
|
||||
struct fw_iso_context;
|
||||
typedef void (*fw_iso_callback_t)(struct fw_iso_context *context,
|
||||
u32 cycle, size_t header_length,
|
||||
void *header, void *data);
|
||||
struct fw_iso_context {
|
||||
struct fw_card *card;
|
||||
int type;
|
||||
int channel;
|
||||
int speed;
|
||||
size_t header_size;
|
||||
fw_iso_callback_t callback;
|
||||
void *callback_data;
|
||||
};
|
||||
|
||||
struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
|
||||
int type, int channel, int speed, size_t header_size,
|
||||
fw_iso_callback_t callback, void *callback_data);
|
||||
int fw_iso_context_queue(struct fw_iso_context *ctx,
|
||||
struct fw_iso_packet *packet,
|
||||
struct fw_iso_buffer *buffer,
|
||||
unsigned long payload);
|
||||
int fw_iso_context_start(struct fw_iso_context *ctx,
|
||||
int cycle, int sync, int tags);
|
||||
int fw_iso_context_stop(struct fw_iso_context *ctx);
|
||||
void fw_iso_context_destroy(struct fw_iso_context *ctx);
|
||||
|
||||
#endif /* _LINUX_FIREWIRE_H */
|
@@ -24,21 +24,17 @@
|
||||
*/
|
||||
#ifdef CONFIG_FIRMWARE_MEMMAP
|
||||
|
||||
int firmware_map_add(resource_size_t start, resource_size_t end,
|
||||
const char *type);
|
||||
int firmware_map_add_early(resource_size_t start, resource_size_t end,
|
||||
const char *type);
|
||||
int firmware_map_add(u64 start, u64 end, const char *type);
|
||||
int firmware_map_add_early(u64 start, u64 end, const char *type);
|
||||
|
||||
#else /* CONFIG_FIRMWARE_MEMMAP */
|
||||
|
||||
static inline int firmware_map_add(resource_size_t start, resource_size_t end,
|
||||
const char *type)
|
||||
static inline int firmware_map_add(u64 start, u64 end, const char *type)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int firmware_map_add_early(resource_size_t start,
|
||||
resource_size_t end, const char *type)
|
||||
static inline int firmware_map_add_early(u64 start, u64 end, const char *type)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@@ -5,7 +5,6 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#define FIRMWARE_NAME_MAX 30
|
||||
#define FW_ACTION_NOHOTPLUG 0
|
||||
#define FW_ACTION_HOTPLUG 1
|
||||
|
||||
|
@@ -710,6 +710,9 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
|
||||
#define i_size_ordered_init(inode) do { } while (0)
|
||||
#endif
|
||||
|
||||
struct posix_acl;
|
||||
#define ACL_NOT_CACHED ((void *)(-1))
|
||||
|
||||
struct inode {
|
||||
struct hlist_node i_hash;
|
||||
struct list_head i_list;
|
||||
@@ -729,8 +732,8 @@ struct inode {
|
||||
struct timespec i_atime;
|
||||
struct timespec i_mtime;
|
||||
struct timespec i_ctime;
|
||||
unsigned int i_blkbits;
|
||||
blkcnt_t i_blocks;
|
||||
unsigned int i_blkbits;
|
||||
unsigned short i_bytes;
|
||||
umode_t i_mode;
|
||||
spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
|
||||
@@ -751,13 +754,12 @@ struct inode {
|
||||
struct block_device *i_bdev;
|
||||
struct cdev *i_cdev;
|
||||
};
|
||||
int i_cindex;
|
||||
|
||||
__u32 i_generation;
|
||||
|
||||
#ifdef CONFIG_DNOTIFY
|
||||
unsigned long i_dnotify_mask; /* Directory notify events */
|
||||
struct dnotify_struct *i_dnotify; /* for directory notifications */
|
||||
#ifdef CONFIG_FSNOTIFY
|
||||
__u32 i_fsnotify_mask; /* all events this inode cares about */
|
||||
struct hlist_head i_fsnotify_mark_entries; /* fsnotify mark entries */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INOTIFY
|
||||
@@ -773,6 +775,10 @@ struct inode {
|
||||
atomic_t i_writecount;
|
||||
#ifdef CONFIG_SECURITY
|
||||
void *i_security;
|
||||
#endif
|
||||
#ifdef CONFIG_FS_POSIX_ACL
|
||||
struct posix_acl *i_acl;
|
||||
struct posix_acl *i_default_acl;
|
||||
#endif
|
||||
void *i_private; /* fs or device private pointer */
|
||||
};
|
||||
@@ -880,7 +886,7 @@ struct file_ra_state {
|
||||
there are only # of pages ahead */
|
||||
|
||||
unsigned int ra_pages; /* Maximum readahead window */
|
||||
int mmap_miss; /* Cache miss stat for mmap accesses */
|
||||
unsigned int mmap_miss; /* Cache miss stat for mmap accesses */
|
||||
loff_t prev_pos; /* Cache last read() position */
|
||||
};
|
||||
|
||||
@@ -1108,6 +1114,7 @@ extern void locks_copy_lock(struct file_lock *, struct file_lock *);
|
||||
extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
|
||||
extern void locks_remove_posix(struct file *, fl_owner_t);
|
||||
extern void locks_remove_flock(struct file *);
|
||||
extern void locks_release_private(struct file_lock *);
|
||||
extern void posix_test_lock(struct file *, struct file_lock *);
|
||||
extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
|
||||
extern int posix_lock_file_wait(struct file *, struct file_lock *);
|
||||
@@ -1321,7 +1328,7 @@ struct super_block {
|
||||
struct rw_semaphore s_umount;
|
||||
struct mutex s_lock;
|
||||
int s_count;
|
||||
int s_need_sync_fs;
|
||||
int s_need_sync;
|
||||
atomic_t s_active;
|
||||
#ifdef CONFIG_SECURITY
|
||||
void *s_security;
|
||||
@@ -1372,11 +1379,6 @@ struct super_block {
|
||||
* generic_show_options()
|
||||
*/
|
||||
char *s_options;
|
||||
|
||||
/*
|
||||
* storage for asynchronous operations
|
||||
*/
|
||||
struct list_head s_async_list;
|
||||
};
|
||||
|
||||
extern struct timespec current_fs_time(struct super_block *sb);
|
||||
@@ -1800,7 +1802,7 @@ extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
|
||||
extern int may_umount_tree(struct vfsmount *);
|
||||
extern int may_umount(struct vfsmount *);
|
||||
extern long do_mount(char *, char *, char *, unsigned long, void *);
|
||||
extern struct vfsmount *collect_mounts(struct vfsmount *, struct dentry *);
|
||||
extern struct vfsmount *collect_mounts(struct path *);
|
||||
extern void drop_collected_mounts(struct vfsmount *);
|
||||
|
||||
extern int vfs_statfs(struct dentry *, struct kstatfs *);
|
||||
@@ -1911,6 +1913,8 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
|
||||
|
||||
extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
|
||||
struct file *filp);
|
||||
extern int do_fallocate(struct file *file, int mode, loff_t offset,
|
||||
loff_t len);
|
||||
extern long do_sys_open(int dfd, const char __user *filename, int flags,
|
||||
int mode);
|
||||
extern struct file *filp_open(const char *, int, int);
|
||||
@@ -1919,14 +1923,19 @@ extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
|
||||
extern int filp_close(struct file *, fl_owner_t id);
|
||||
extern char * getname(const char __user *);
|
||||
|
||||
/* fs/ioctl.c */
|
||||
|
||||
extern int ioctl_preallocate(struct file *filp, void __user *argp);
|
||||
|
||||
/* fs/dcache.c */
|
||||
extern void __init vfs_caches_init_early(void);
|
||||
extern void __init vfs_caches_init(unsigned long);
|
||||
|
||||
extern struct kmem_cache *names_cachep;
|
||||
|
||||
#define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL)
|
||||
#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
|
||||
#define __getname_gfp(gfp) kmem_cache_alloc(names_cachep, (gfp))
|
||||
#define __getname() __getname_gfp(GFP_KERNEL)
|
||||
#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
|
||||
#ifndef CONFIG_AUDITSYSCALL
|
||||
#define putname(name) __putname(name)
|
||||
#else
|
||||
@@ -1947,8 +1956,6 @@ extern struct super_block *freeze_bdev(struct block_device *);
|
||||
extern void emergency_thaw_all(void);
|
||||
extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
|
||||
extern int fsync_bdev(struct block_device *);
|
||||
extern int fsync_super(struct super_block *);
|
||||
extern int fsync_no_super(struct block_device *);
|
||||
#else
|
||||
static inline void bd_forget(struct inode *inode) {}
|
||||
static inline int sync_blockdev(struct block_device *bdev) { return 0; }
|
||||
@@ -1964,6 +1971,7 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
extern int sync_filesystem(struct super_block *);
|
||||
extern const struct file_operations def_blk_fops;
|
||||
extern const struct file_operations def_chr_fops;
|
||||
extern const struct file_operations bad_sock_fops;
|
||||
@@ -2043,9 +2051,6 @@ extern int __invalidate_device(struct block_device *);
|
||||
extern int invalidate_partition(struct gendisk *, int);
|
||||
#endif
|
||||
extern int invalidate_inodes(struct super_block *);
|
||||
unsigned long __invalidate_mapping_pages(struct address_space *mapping,
|
||||
pgoff_t start, pgoff_t end,
|
||||
bool be_atomic);
|
||||
unsigned long invalidate_mapping_pages(struct address_space *mapping,
|
||||
pgoff_t start, pgoff_t end);
|
||||
|
||||
@@ -2082,12 +2087,8 @@ extern int filemap_fdatawrite_range(struct address_space *mapping,
|
||||
|
||||
extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync);
|
||||
extern void sync_supers(void);
|
||||
extern void sync_filesystems(int wait);
|
||||
extern void __fsync_super(struct super_block *sb);
|
||||
extern void emergency_sync(void);
|
||||
extern void emergency_remount(void);
|
||||
extern int do_remount_sb(struct super_block *sb, int flags,
|
||||
void *data, int force);
|
||||
#ifdef CONFIG_BLOCK
|
||||
extern sector_t bmap(struct inode *, sector_t);
|
||||
#endif
|
||||
@@ -2205,6 +2206,8 @@ extern int generic_segment_checks(const struct iovec *iov,
|
||||
/* 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 default_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,
|
||||
@@ -2354,6 +2357,8 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
|
||||
extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
|
||||
loff_t *ppos, const void *from, size_t available);
|
||||
|
||||
extern int simple_fsync(struct file *, struct dentry *, int);
|
||||
|
||||
#ifdef CONFIG_MIGRATION
|
||||
extern int buffer_migrate_page(struct address_space *,
|
||||
struct page *, struct page *);
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#define FS_ENET_PD_H
|
||||
|
||||
#include <linux/string.h>
|
||||
#include <linux/of_mdio.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
#define FS_ENET_NAME "fs_enet"
|
||||
@@ -130,10 +131,7 @@ struct fs_platform_info {
|
||||
|
||||
u32 device_flags;
|
||||
|
||||
int phy_addr; /* the phy address (-1 no phy) */
|
||||
char bus_id[16];
|
||||
int phy_irq; /* the phy irq (if it exists) */
|
||||
|
||||
struct device_node *phy_node;
|
||||
const struct fs_mii_bus_info *bus_info;
|
||||
|
||||
int rx_ring, tx_ring; /* number of buffers on rx */
|
||||
|
@@ -79,10 +79,6 @@ struct fsl_spi_platform_data {
|
||||
u16 max_chipselect;
|
||||
void (*cs_control)(struct spi_device *spi, bool on);
|
||||
u32 sysclk;
|
||||
|
||||
/* Legacy hooks, used by mpc52xx_psc_spi driver. */
|
||||
void (*activate_cs)(u8 cs, u8 polarity);
|
||||
void (*deactivate_cs)(u8 cs, u8 polarity);
|
||||
};
|
||||
|
||||
struct mpc8xx_pcmcia_ops {
|
||||
|
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <linux/dnotify.h>
|
||||
#include <linux/inotify.h>
|
||||
#include <linux/fsnotify_backend.h>
|
||||
#include <linux/audit.h>
|
||||
|
||||
/*
|
||||
@@ -22,18 +23,44 @@
|
||||
static inline void fsnotify_d_instantiate(struct dentry *entry,
|
||||
struct inode *inode)
|
||||
{
|
||||
__fsnotify_d_instantiate(entry, inode);
|
||||
|
||||
inotify_d_instantiate(entry, inode);
|
||||
}
|
||||
|
||||
/* Notify this dentry's parent about a child's events. */
|
||||
static inline void fsnotify_parent(struct dentry *dentry, __u32 mask)
|
||||
{
|
||||
__fsnotify_parent(dentry, mask);
|
||||
|
||||
inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
|
||||
}
|
||||
|
||||
/*
|
||||
* fsnotify_d_move - entry has been moved
|
||||
* Called with dcache_lock and entry->d_lock held.
|
||||
*/
|
||||
static inline void fsnotify_d_move(struct dentry *entry)
|
||||
{
|
||||
/*
|
||||
* On move we need to update entry->d_flags to indicate if the new parent
|
||||
* cares about events from this entry.
|
||||
*/
|
||||
__fsnotify_update_dcache_flags(entry);
|
||||
|
||||
inotify_d_move(entry);
|
||||
}
|
||||
|
||||
/*
|
||||
* fsnotify_link_count - inode's link count changed
|
||||
*/
|
||||
static inline void fsnotify_link_count(struct inode *inode)
|
||||
{
|
||||
inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL);
|
||||
|
||||
fsnotify(inode, FS_ATTRIB, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* fsnotify_move - file old_name at old_dir was moved to new_name at new_dir
|
||||
*/
|
||||
@@ -42,42 +69,62 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
|
||||
int isdir, struct inode *target, struct dentry *moved)
|
||||
{
|
||||
struct inode *source = moved->d_inode;
|
||||
u32 cookie = inotify_get_cookie();
|
||||
u32 in_cookie = inotify_get_cookie();
|
||||
u32 fs_cookie = fsnotify_get_cookie();
|
||||
__u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM);
|
||||
__u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO);
|
||||
|
||||
if (old_dir == new_dir)
|
||||
inode_dir_notify(old_dir, DN_RENAME);
|
||||
else {
|
||||
inode_dir_notify(old_dir, DN_DELETE);
|
||||
inode_dir_notify(new_dir, DN_CREATE);
|
||||
old_dir_mask |= FS_DN_RENAME;
|
||||
|
||||
if (isdir) {
|
||||
isdir = IN_ISDIR;
|
||||
old_dir_mask |= FS_IN_ISDIR;
|
||||
new_dir_mask |= FS_IN_ISDIR;
|
||||
}
|
||||
|
||||
if (isdir)
|
||||
isdir = IN_ISDIR;
|
||||
inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name,
|
||||
inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir, in_cookie, old_name,
|
||||
source);
|
||||
inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name,
|
||||
inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, in_cookie, new_name,
|
||||
source);
|
||||
|
||||
fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie);
|
||||
fsnotify(new_dir, new_dir_mask, new_dir, FSNOTIFY_EVENT_INODE, new_name, fs_cookie);
|
||||
|
||||
if (target) {
|
||||
inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL, NULL);
|
||||
inotify_inode_is_dead(target);
|
||||
|
||||
/* this is really a link_count change not a removal */
|
||||
fsnotify_link_count(target);
|
||||
}
|
||||
|
||||
if (source) {
|
||||
inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
|
||||
fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
}
|
||||
audit_inode_child(new_name, moved, new_dir);
|
||||
}
|
||||
|
||||
/*
|
||||
* fsnotify_inode_delete - and inode is being evicted from cache, clean up is needed
|
||||
*/
|
||||
static inline void fsnotify_inode_delete(struct inode *inode)
|
||||
{
|
||||
__fsnotify_inode_delete(inode);
|
||||
}
|
||||
|
||||
/*
|
||||
* fsnotify_nameremove - a filename was removed from a directory
|
||||
*/
|
||||
static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
|
||||
{
|
||||
__u32 mask = FS_DELETE;
|
||||
|
||||
if (isdir)
|
||||
isdir = IN_ISDIR;
|
||||
dnotify_parent(dentry, DN_DELETE);
|
||||
inotify_dentry_parent_queue_event(dentry, IN_DELETE|isdir, 0, dentry->d_name.name);
|
||||
mask |= FS_IN_ISDIR;
|
||||
|
||||
fsnotify_parent(dentry, mask);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -87,14 +134,9 @@ static inline void fsnotify_inoderemove(struct inode *inode)
|
||||
{
|
||||
inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL, NULL);
|
||||
inotify_inode_is_dead(inode);
|
||||
}
|
||||
|
||||
/*
|
||||
* fsnotify_link_count - inode's link count changed
|
||||
*/
|
||||
static inline void fsnotify_link_count(struct inode *inode)
|
||||
{
|
||||
inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL);
|
||||
fsnotify(inode, FS_DELETE_SELF, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
__fsnotify_inode_delete(inode);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -102,10 +144,11 @@ static inline void fsnotify_link_count(struct inode *inode)
|
||||
*/
|
||||
static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
|
||||
{
|
||||
inode_dir_notify(inode, DN_CREATE);
|
||||
inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
|
||||
dentry->d_inode);
|
||||
audit_inode_child(dentry->d_name.name, dentry, inode);
|
||||
|
||||
fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -115,11 +158,12 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
|
||||
*/
|
||||
static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry)
|
||||
{
|
||||
inode_dir_notify(dir, DN_CREATE);
|
||||
inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name,
|
||||
inode);
|
||||
fsnotify_link_count(inode);
|
||||
audit_inode_child(new_dentry->d_name.name, new_dentry, dir);
|
||||
|
||||
fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -127,10 +171,13 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct
|
||||
*/
|
||||
static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
|
||||
{
|
||||
inode_dir_notify(inode, DN_CREATE);
|
||||
inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0,
|
||||
dentry->d_name.name, dentry->d_inode);
|
||||
__u32 mask = (FS_CREATE | FS_IN_ISDIR);
|
||||
struct inode *d_inode = dentry->d_inode;
|
||||
|
||||
inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode);
|
||||
audit_inode_child(dentry->d_name.name, dentry, inode);
|
||||
|
||||
fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -139,14 +186,15 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
|
||||
static inline void fsnotify_access(struct dentry *dentry)
|
||||
{
|
||||
struct inode *inode = dentry->d_inode;
|
||||
u32 mask = IN_ACCESS;
|
||||
__u32 mask = FS_ACCESS;
|
||||
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
mask |= IN_ISDIR;
|
||||
mask |= FS_IN_ISDIR;
|
||||
|
||||
dnotify_parent(dentry, DN_ACCESS);
|
||||
inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
|
||||
inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
|
||||
|
||||
fsnotify_parent(dentry, mask);
|
||||
fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -155,14 +203,15 @@ static inline void fsnotify_access(struct dentry *dentry)
|
||||
static inline void fsnotify_modify(struct dentry *dentry)
|
||||
{
|
||||
struct inode *inode = dentry->d_inode;
|
||||
u32 mask = IN_MODIFY;
|
||||
__u32 mask = FS_MODIFY;
|
||||
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
mask |= IN_ISDIR;
|
||||
mask |= FS_IN_ISDIR;
|
||||
|
||||
dnotify_parent(dentry, DN_MODIFY);
|
||||
inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
|
||||
inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
|
||||
|
||||
fsnotify_parent(dentry, mask);
|
||||
fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -171,13 +220,15 @@ static inline void fsnotify_modify(struct dentry *dentry)
|
||||
static inline void fsnotify_open(struct dentry *dentry)
|
||||
{
|
||||
struct inode *inode = dentry->d_inode;
|
||||
u32 mask = IN_OPEN;
|
||||
__u32 mask = FS_OPEN;
|
||||
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
mask |= IN_ISDIR;
|
||||
mask |= FS_IN_ISDIR;
|
||||
|
||||
inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
|
||||
inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
|
||||
|
||||
fsnotify_parent(dentry, mask);
|
||||
fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -187,15 +238,16 @@ static inline void fsnotify_close(struct file *file)
|
||||
{
|
||||
struct dentry *dentry = file->f_path.dentry;
|
||||
struct inode *inode = dentry->d_inode;
|
||||
const char *name = dentry->d_name.name;
|
||||
fmode_t mode = file->f_mode;
|
||||
u32 mask = (mode & FMODE_WRITE) ? IN_CLOSE_WRITE : IN_CLOSE_NOWRITE;
|
||||
__u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE;
|
||||
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
mask |= IN_ISDIR;
|
||||
mask |= FS_IN_ISDIR;
|
||||
|
||||
inotify_dentry_parent_queue_event(dentry, mask, 0, name);
|
||||
inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
|
||||
|
||||
fsnotify_parent(dentry, mask);
|
||||
fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -204,13 +256,15 @@ static inline void fsnotify_close(struct file *file)
|
||||
static inline void fsnotify_xattr(struct dentry *dentry)
|
||||
{
|
||||
struct inode *inode = dentry->d_inode;
|
||||
u32 mask = IN_ATTRIB;
|
||||
__u32 mask = FS_ATTRIB;
|
||||
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
mask |= IN_ISDIR;
|
||||
mask |= FS_IN_ISDIR;
|
||||
|
||||
inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
|
||||
inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
|
||||
|
||||
fsnotify_parent(dentry, mask);
|
||||
fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -220,50 +274,37 @@ static inline void fsnotify_xattr(struct dentry *dentry)
|
||||
static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
|
||||
{
|
||||
struct inode *inode = dentry->d_inode;
|
||||
int dn_mask = 0;
|
||||
u32 in_mask = 0;
|
||||
__u32 mask = 0;
|
||||
|
||||
if (ia_valid & ATTR_UID)
|
||||
mask |= FS_ATTRIB;
|
||||
if (ia_valid & ATTR_GID)
|
||||
mask |= FS_ATTRIB;
|
||||
if (ia_valid & ATTR_SIZE)
|
||||
mask |= FS_MODIFY;
|
||||
|
||||
if (ia_valid & ATTR_UID) {
|
||||
in_mask |= IN_ATTRIB;
|
||||
dn_mask |= DN_ATTRIB;
|
||||
}
|
||||
if (ia_valid & ATTR_GID) {
|
||||
in_mask |= IN_ATTRIB;
|
||||
dn_mask |= DN_ATTRIB;
|
||||
}
|
||||
if (ia_valid & ATTR_SIZE) {
|
||||
in_mask |= IN_MODIFY;
|
||||
dn_mask |= DN_MODIFY;
|
||||
}
|
||||
/* both times implies a utime(s) call */
|
||||
if ((ia_valid & (ATTR_ATIME | ATTR_MTIME)) == (ATTR_ATIME | ATTR_MTIME))
|
||||
{
|
||||
in_mask |= IN_ATTRIB;
|
||||
dn_mask |= DN_ATTRIB;
|
||||
} else if (ia_valid & ATTR_ATIME) {
|
||||
in_mask |= IN_ACCESS;
|
||||
dn_mask |= DN_ACCESS;
|
||||
} else if (ia_valid & ATTR_MTIME) {
|
||||
in_mask |= IN_MODIFY;
|
||||
dn_mask |= DN_MODIFY;
|
||||
}
|
||||
if (ia_valid & ATTR_MODE) {
|
||||
in_mask |= IN_ATTRIB;
|
||||
dn_mask |= DN_ATTRIB;
|
||||
}
|
||||
mask |= FS_ATTRIB;
|
||||
else if (ia_valid & ATTR_ATIME)
|
||||
mask |= FS_ACCESS;
|
||||
else if (ia_valid & ATTR_MTIME)
|
||||
mask |= FS_MODIFY;
|
||||
|
||||
if (dn_mask)
|
||||
dnotify_parent(dentry, dn_mask);
|
||||
if (in_mask) {
|
||||
if (ia_valid & ATTR_MODE)
|
||||
mask |= FS_ATTRIB;
|
||||
|
||||
if (mask) {
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
in_mask |= IN_ISDIR;
|
||||
inotify_inode_queue_event(inode, in_mask, 0, NULL, NULL);
|
||||
inotify_dentry_parent_queue_event(dentry, in_mask, 0,
|
||||
dentry->d_name.name);
|
||||
mask |= FS_IN_ISDIR;
|
||||
inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
|
||||
|
||||
fsnotify_parent(dentry, mask);
|
||||
fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_INOTIFY /* inotify helpers */
|
||||
#if defined(CONFIG_INOTIFY) || defined(CONFIG_FSNOTIFY) /* notify helpers */
|
||||
|
||||
/*
|
||||
* fsnotify_oldname_init - save off the old filename before we change it
|
||||
@@ -281,7 +322,7 @@ static inline void fsnotify_oldname_free(const char *old_name)
|
||||
kfree(old_name);
|
||||
}
|
||||
|
||||
#else /* CONFIG_INOTIFY */
|
||||
#else /* CONFIG_INOTIFY || CONFIG_FSNOTIFY */
|
||||
|
||||
static inline const char *fsnotify_oldname_init(const char *name)
|
||||
{
|
||||
|
387
include/linux/fsnotify_backend.h
Normal file
387
include/linux/fsnotify_backend.h
Normal file
@@ -0,0 +1,387 @@
|
||||
/*
|
||||
* Filesystem access notification for Linux
|
||||
*
|
||||
* Copyright (C) 2008 Red Hat, Inc., Eric Paris <eparis@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_FSNOTIFY_BACKEND_H
|
||||
#define __LINUX_FSNOTIFY_BACKEND_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/idr.h> /* inotify uses this */
|
||||
#include <linux/fs.h> /* struct inode */
|
||||
#include <linux/list.h>
|
||||
#include <linux/path.h> /* struct path */
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
|
||||
/*
|
||||
* IN_* from inotfy.h lines up EXACTLY with FS_*, this is so we can easily
|
||||
* convert between them. dnotify only needs conversion at watch creation
|
||||
* so no perf loss there. fanotify isn't defined yet, so it can use the
|
||||
* wholes if it needs more events.
|
||||
*/
|
||||
#define FS_ACCESS 0x00000001 /* File was accessed */
|
||||
#define FS_MODIFY 0x00000002 /* File was modified */
|
||||
#define FS_ATTRIB 0x00000004 /* Metadata changed */
|
||||
#define FS_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
|
||||
#define FS_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
|
||||
#define FS_OPEN 0x00000020 /* File was opened */
|
||||
#define FS_MOVED_FROM 0x00000040 /* File was moved from X */
|
||||
#define FS_MOVED_TO 0x00000080 /* File was moved to Y */
|
||||
#define FS_CREATE 0x00000100 /* Subfile was created */
|
||||
#define FS_DELETE 0x00000200 /* Subfile was deleted */
|
||||
#define FS_DELETE_SELF 0x00000400 /* Self was deleted */
|
||||
#define FS_MOVE_SELF 0x00000800 /* Self was moved */
|
||||
|
||||
#define FS_UNMOUNT 0x00002000 /* inode on umount fs */
|
||||
#define FS_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
|
||||
#define FS_IN_IGNORED 0x00008000 /* last inotify event here */
|
||||
|
||||
#define FS_IN_ISDIR 0x40000000 /* event occurred against dir */
|
||||
#define FS_IN_ONESHOT 0x80000000 /* only send event once */
|
||||
|
||||
#define FS_DN_RENAME 0x10000000 /* file renamed */
|
||||
#define FS_DN_MULTISHOT 0x20000000 /* dnotify multishot */
|
||||
|
||||
/* This inode cares about things that happen to its children. Always set for
|
||||
* dnotify and inotify. */
|
||||
#define FS_EVENT_ON_CHILD 0x08000000
|
||||
|
||||
/* This is a list of all events that may get sent to a parernt based on fs event
|
||||
* happening to inodes inside that directory */
|
||||
#define FS_EVENTS_POSS_ON_CHILD (FS_ACCESS | FS_MODIFY | FS_ATTRIB |\
|
||||
FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN |\
|
||||
FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE |\
|
||||
FS_DELETE)
|
||||
|
||||
/* listeners that hard code group numbers near the top */
|
||||
#define DNOTIFY_GROUP_NUM UINT_MAX
|
||||
#define INOTIFY_GROUP_NUM (DNOTIFY_GROUP_NUM-1)
|
||||
|
||||
struct fsnotify_group;
|
||||
struct fsnotify_event;
|
||||
struct fsnotify_mark_entry;
|
||||
struct fsnotify_event_private_data;
|
||||
|
||||
/*
|
||||
* Each group much define these ops. The fsnotify infrastructure will call
|
||||
* these operations for each relevant group.
|
||||
*
|
||||
* should_send_event - given a group, inode, and mask this function determines
|
||||
* if the group is interested in this event.
|
||||
* handle_event - main call for a group to handle an fs event
|
||||
* free_group_priv - called when a group refcnt hits 0 to clean up the private union
|
||||
* freeing-mark - this means that a mark has been flagged to die when everything
|
||||
* finishes using it. The function is supplied with what must be a
|
||||
* valid group and inode to use to clean up.
|
||||
*/
|
||||
struct fsnotify_ops {
|
||||
bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode, __u32 mask);
|
||||
int (*handle_event)(struct fsnotify_group *group, struct fsnotify_event *event);
|
||||
void (*free_group_priv)(struct fsnotify_group *group);
|
||||
void (*freeing_mark)(struct fsnotify_mark_entry *entry, struct fsnotify_group *group);
|
||||
void (*free_event_priv)(struct fsnotify_event_private_data *priv);
|
||||
};
|
||||
|
||||
/*
|
||||
* A group is a "thing" that wants to receive notification about filesystem
|
||||
* events. The mask holds the subset of event types this group cares about.
|
||||
* refcnt on a group is up to the implementor and at any moment if it goes 0
|
||||
* everything will be cleaned up.
|
||||
*/
|
||||
struct fsnotify_group {
|
||||
/*
|
||||
* global list of all groups receiving events from fsnotify.
|
||||
* anchored by fsnotify_groups and protected by either fsnotify_grp_mutex
|
||||
* or fsnotify_grp_srcu depending on write vs read.
|
||||
*/
|
||||
struct list_head group_list;
|
||||
|
||||
/*
|
||||
* Defines all of the event types in which this group is interested.
|
||||
* This mask is a bitwise OR of the FS_* events from above. Each time
|
||||
* this mask changes for a group (if it changes) the correct functions
|
||||
* must be called to update the global structures which indicate global
|
||||
* interest in event types.
|
||||
*/
|
||||
__u32 mask;
|
||||
|
||||
/*
|
||||
* How the refcnt is used is up to each group. When the refcnt hits 0
|
||||
* fsnotify will clean up all of the resources associated with this group.
|
||||
* As an example, the dnotify group will always have a refcnt=1 and that
|
||||
* will never change. Inotify, on the other hand, has a group per
|
||||
* inotify_init() and the refcnt will hit 0 only when that fd has been
|
||||
* closed.
|
||||
*/
|
||||
atomic_t refcnt; /* things with interest in this group */
|
||||
unsigned int group_num; /* simply prevents accidental group collision */
|
||||
|
||||
const struct fsnotify_ops *ops; /* how this group handles things */
|
||||
|
||||
/* needed to send notification to userspace */
|
||||
struct mutex notification_mutex; /* protect the notification_list */
|
||||
struct list_head notification_list; /* list of event_holder this group needs to send to userspace */
|
||||
wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */
|
||||
unsigned int q_len; /* events on the queue */
|
||||
unsigned int max_events; /* maximum events allowed on the list */
|
||||
|
||||
/* stores all fastapth entries assoc with this group so they can be cleaned on unregister */
|
||||
spinlock_t mark_lock; /* protect mark_entries list */
|
||||
atomic_t num_marks; /* 1 for each mark entry and 1 for not being
|
||||
* past the point of no return when freeing
|
||||
* a group */
|
||||
struct list_head mark_entries; /* all inode mark entries for this group */
|
||||
|
||||
/* prevents double list_del of group_list. protected by global fsnotify_grp_mutex */
|
||||
bool on_group_list;
|
||||
|
||||
/* groups can define private fields here or use the void *private */
|
||||
union {
|
||||
void *private;
|
||||
#ifdef CONFIG_INOTIFY_USER
|
||||
struct inotify_group_private_data {
|
||||
spinlock_t idr_lock;
|
||||
struct idr idr;
|
||||
u32 last_wd;
|
||||
struct fasync_struct *fa; /* async notification */
|
||||
struct user_struct *user;
|
||||
} inotify_data;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* A single event can be queued in multiple group->notification_lists.
|
||||
*
|
||||
* each group->notification_list will point to an event_holder which in turns points
|
||||
* to the actual event that needs to be sent to userspace.
|
||||
*
|
||||
* Seemed cheaper to create a refcnt'd event and a small holder for every group
|
||||
* than create a different event for every group
|
||||
*
|
||||
*/
|
||||
struct fsnotify_event_holder {
|
||||
struct fsnotify_event *event;
|
||||
struct list_head event_list;
|
||||
};
|
||||
|
||||
/*
|
||||
* Inotify needs to tack data onto an event. This struct lets us later find the
|
||||
* correct private data of the correct group.
|
||||
*/
|
||||
struct fsnotify_event_private_data {
|
||||
struct fsnotify_group *group;
|
||||
struct list_head event_list;
|
||||
};
|
||||
|
||||
/*
|
||||
* all of the information about the original object we want to now send to
|
||||
* a group. If you want to carry more info from the accessing task to the
|
||||
* listener this structure is where you need to be adding fields.
|
||||
*/
|
||||
struct fsnotify_event {
|
||||
/*
|
||||
* If we create an event we are also likely going to need a holder
|
||||
* to link to a group. So embed one holder in the event. Means only
|
||||
* one allocation for the common case where we only have one group
|
||||
*/
|
||||
struct fsnotify_event_holder holder;
|
||||
spinlock_t lock; /* protection for the associated event_holder and private_list */
|
||||
/* to_tell may ONLY be dereferenced during handle_event(). */
|
||||
struct inode *to_tell; /* either the inode the event happened to or its parent */
|
||||
/*
|
||||
* depending on the event type we should have either a path or inode
|
||||
* We hold a reference on path, but NOT on inode. Since we have the ref on
|
||||
* the path, it may be dereferenced at any point during this object's
|
||||
* lifetime. That reference is dropped when this object's refcnt hits
|
||||
* 0. If this event contains an inode instead of a path, the inode may
|
||||
* ONLY be used during handle_event().
|
||||
*/
|
||||
union {
|
||||
struct path path;
|
||||
struct inode *inode;
|
||||
};
|
||||
/* when calling fsnotify tell it if the data is a path or inode */
|
||||
#define FSNOTIFY_EVENT_NONE 0
|
||||
#define FSNOTIFY_EVENT_PATH 1
|
||||
#define FSNOTIFY_EVENT_INODE 2
|
||||
#define FSNOTIFY_EVENT_FILE 3
|
||||
int data_type; /* which of the above union we have */
|
||||
atomic_t refcnt; /* how many groups still are using/need to send this event */
|
||||
__u32 mask; /* the type of access, bitwise OR for FS_* event types */
|
||||
|
||||
u32 sync_cookie; /* used to corrolate events, namely inotify mv events */
|
||||
char *file_name;
|
||||
size_t name_len;
|
||||
|
||||
struct list_head private_data_list; /* groups can store private data here */
|
||||
};
|
||||
|
||||
/*
|
||||
* a mark is simply an entry attached to an in core inode which allows an
|
||||
* fsnotify listener to indicate they are either no longer interested in events
|
||||
* of a type matching mask or only interested in those events.
|
||||
*
|
||||
* these are flushed when an inode is evicted from core and may be flushed
|
||||
* when the inode is modified (as seen by fsnotify_access). Some fsnotify users
|
||||
* (such as dnotify) will flush these when the open fd is closed and not at
|
||||
* inode eviction or modification.
|
||||
*/
|
||||
struct fsnotify_mark_entry {
|
||||
__u32 mask; /* mask this mark entry is for */
|
||||
/* we hold ref for each i_list and g_list. also one ref for each 'thing'
|
||||
* in kernel that found and may be using this mark. */
|
||||
atomic_t refcnt; /* active things looking at this mark */
|
||||
struct inode *inode; /* inode this entry is associated with */
|
||||
struct fsnotify_group *group; /* group this mark entry is for */
|
||||
struct hlist_node i_list; /* list of mark_entries by inode->i_fsnotify_mark_entries */
|
||||
struct list_head g_list; /* list of mark_entries by group->i_fsnotify_mark_entries */
|
||||
spinlock_t lock; /* protect group, inode, and killme */
|
||||
struct list_head free_i_list; /* tmp list used when freeing this mark */
|
||||
struct list_head free_g_list; /* tmp list used when freeing this mark */
|
||||
void (*free_mark)(struct fsnotify_mark_entry *entry); /* called on final put+free */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_FSNOTIFY
|
||||
|
||||
/* called from the vfs helpers */
|
||||
|
||||
/* main fsnotify call to send events */
|
||||
extern void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
|
||||
const char *name, u32 cookie);
|
||||
extern void __fsnotify_parent(struct dentry *dentry, __u32 mask);
|
||||
extern void __fsnotify_inode_delete(struct inode *inode);
|
||||
extern u32 fsnotify_get_cookie(void);
|
||||
|
||||
static inline int fsnotify_inode_watches_children(struct inode *inode)
|
||||
{
|
||||
/* FS_EVENT_ON_CHILD is set if the inode may care */
|
||||
if (!(inode->i_fsnotify_mask & FS_EVENT_ON_CHILD))
|
||||
return 0;
|
||||
/* this inode might care about child events, does it care about the
|
||||
* specific set of events that can happen on a child? */
|
||||
return inode->i_fsnotify_mask & FS_EVENTS_POSS_ON_CHILD;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the dentry with a flag indicating the interest of its parent to receive
|
||||
* filesystem events when those events happens to this dentry->d_inode.
|
||||
*/
|
||||
static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
|
||||
{
|
||||
struct dentry *parent;
|
||||
|
||||
assert_spin_locked(&dcache_lock);
|
||||
assert_spin_locked(&dentry->d_lock);
|
||||
|
||||
parent = dentry->d_parent;
|
||||
if (fsnotify_inode_watches_children(parent->d_inode))
|
||||
dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED;
|
||||
else
|
||||
dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED;
|
||||
}
|
||||
|
||||
/*
|
||||
* fsnotify_d_instantiate - instantiate a dentry for inode
|
||||
* Called with dcache_lock held.
|
||||
*/
|
||||
static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode)
|
||||
{
|
||||
if (!inode)
|
||||
return;
|
||||
|
||||
assert_spin_locked(&dcache_lock);
|
||||
|
||||
spin_lock(&dentry->d_lock);
|
||||
__fsnotify_update_dcache_flags(dentry);
|
||||
spin_unlock(&dentry->d_lock);
|
||||
}
|
||||
|
||||
/* called from fsnotify listeners, such as fanotify or dnotify */
|
||||
|
||||
/* must call when a group changes its ->mask */
|
||||
extern void fsnotify_recalc_global_mask(void);
|
||||
/* get a reference to an existing or create a new group */
|
||||
extern struct fsnotify_group *fsnotify_obtain_group(unsigned int group_num,
|
||||
__u32 mask,
|
||||
const struct fsnotify_ops *ops);
|
||||
/* run all marks associated with this group and update group->mask */
|
||||
extern void fsnotify_recalc_group_mask(struct fsnotify_group *group);
|
||||
/* drop reference on a group from fsnotify_obtain_group */
|
||||
extern void fsnotify_put_group(struct fsnotify_group *group);
|
||||
|
||||
/* take a reference to an event */
|
||||
extern void fsnotify_get_event(struct fsnotify_event *event);
|
||||
extern void fsnotify_put_event(struct fsnotify_event *event);
|
||||
/* find private data previously attached to an event and unlink it */
|
||||
extern struct fsnotify_event_private_data *fsnotify_remove_priv_from_event(struct fsnotify_group *group,
|
||||
struct fsnotify_event *event);
|
||||
|
||||
/* attach the event to the group notification queue */
|
||||
extern int fsnotify_add_notify_event(struct fsnotify_group *group, struct fsnotify_event *event,
|
||||
struct fsnotify_event_private_data *priv);
|
||||
/* true if the group notification queue is empty */
|
||||
extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group);
|
||||
/* return, but do not dequeue the first event on the notification queue */
|
||||
extern struct fsnotify_event *fsnotify_peek_notify_event(struct fsnotify_group *group);
|
||||
/* return AND dequeue the first event on the notification queue */
|
||||
extern struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group *group);
|
||||
|
||||
/* functions used to manipulate the marks attached to inodes */
|
||||
|
||||
/* run all marks associated with an inode and update inode->i_fsnotify_mask */
|
||||
extern void fsnotify_recalc_inode_mask(struct inode *inode);
|
||||
extern void fsnotify_init_mark(struct fsnotify_mark_entry *entry, void (*free_mark)(struct fsnotify_mark_entry *entry));
|
||||
/* find (and take a reference) to a mark associated with group and inode */
|
||||
extern struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *group, struct inode *inode);
|
||||
/* attach the mark to both the group and the inode */
|
||||
extern int fsnotify_add_mark(struct fsnotify_mark_entry *entry, struct fsnotify_group *group, struct inode *inode);
|
||||
/* given a mark, flag it to be freed when all references are dropped */
|
||||
extern void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry);
|
||||
/* run all the marks in a group, and flag them to be freed */
|
||||
extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group);
|
||||
extern void fsnotify_get_mark(struct fsnotify_mark_entry *entry);
|
||||
extern void fsnotify_put_mark(struct fsnotify_mark_entry *entry);
|
||||
extern void fsnotify_unmount_inodes(struct list_head *list);
|
||||
|
||||
/* put here because inotify does some weird stuff when destroying watches */
|
||||
extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
|
||||
void *data, int data_is, const char *name,
|
||||
u32 cookie);
|
||||
|
||||
#else
|
||||
|
||||
static inline void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
|
||||
const char *name, u32 cookie)
|
||||
{}
|
||||
|
||||
static inline void __fsnotify_parent(struct dentry *dentry, __u32 mask)
|
||||
{}
|
||||
|
||||
static inline void __fsnotify_inode_delete(struct inode *inode)
|
||||
{}
|
||||
|
||||
static inline void __fsnotify_update_dcache_flags(struct dentry *dentry)
|
||||
{}
|
||||
|
||||
static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode)
|
||||
{}
|
||||
|
||||
static inline u32 fsnotify_get_cookie(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void fsnotify_unmount_inodes(struct list_head *list)
|
||||
{}
|
||||
|
||||
#endif /* CONFIG_FSNOTIFY */
|
||||
|
||||
#endif /* __KERNEL __ */
|
||||
|
||||
#endif /* __LINUX_FSNOTIFY_BACKEND_H */
|
@@ -233,8 +233,6 @@ extern int ftrace_arch_read_dyn_info(char *buf, int size);
|
||||
|
||||
extern int skip_trace(unsigned long ip);
|
||||
|
||||
extern void ftrace_release(void *start, unsigned long size);
|
||||
|
||||
extern void ftrace_disable_daemon(void);
|
||||
extern void ftrace_enable_daemon(void);
|
||||
#else
|
||||
@@ -325,13 +323,8 @@ static inline void __ftrace_enabled_restore(int enabled)
|
||||
|
||||
#ifdef CONFIG_FTRACE_MCOUNT_RECORD
|
||||
extern void ftrace_init(void);
|
||||
extern void ftrace_init_module(struct module *mod,
|
||||
unsigned long *start, unsigned long *end);
|
||||
#else
|
||||
static inline void ftrace_init(void) { }
|
||||
static inline void
|
||||
ftrace_init_module(struct module *mod,
|
||||
unsigned long *start, unsigned long *end) { }
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -368,6 +361,8 @@ struct ftrace_ret_stack {
|
||||
unsigned long ret;
|
||||
unsigned long func;
|
||||
unsigned long long calltime;
|
||||
unsigned long long subtime;
|
||||
unsigned long fp;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -378,9 +373,8 @@ struct ftrace_ret_stack {
|
||||
extern void return_to_handler(void);
|
||||
|
||||
extern int
|
||||
ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth);
|
||||
extern void
|
||||
ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret);
|
||||
ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth,
|
||||
unsigned long frame_pointer);
|
||||
|
||||
/*
|
||||
* Sometimes we don't want to trace a function with the function
|
||||
@@ -496,8 +490,15 @@ static inline int test_tsk_trace_graph(struct task_struct *tsk)
|
||||
|
||||
extern int ftrace_dump_on_oops;
|
||||
|
||||
#ifdef CONFIG_PREEMPT
|
||||
#define INIT_TRACE_RECURSION .trace_recursion = 0,
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_TRACING */
|
||||
|
||||
#ifndef INIT_TRACE_RECURSION
|
||||
#define INIT_TRACE_RECURSION
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HW_BRANCH_TRACER
|
||||
|
||||
|
172
include/linux/ftrace_event.h
Normal file
172
include/linux/ftrace_event.h
Normal file
@@ -0,0 +1,172 @@
|
||||
#ifndef _LINUX_FTRACE_EVENT_H
|
||||
#define _LINUX_FTRACE_EVENT_H
|
||||
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/ring_buffer.h>
|
||||
#include <linux/percpu.h>
|
||||
|
||||
struct trace_array;
|
||||
struct tracer;
|
||||
struct dentry;
|
||||
|
||||
DECLARE_PER_CPU(struct trace_seq, ftrace_event_seq);
|
||||
|
||||
struct trace_print_flags {
|
||||
unsigned long mask;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
|
||||
unsigned long flags,
|
||||
const struct trace_print_flags *flag_array);
|
||||
|
||||
const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val,
|
||||
const struct trace_print_flags *symbol_array);
|
||||
|
||||
/*
|
||||
* The trace entry - the most basic unit of tracing. This is what
|
||||
* is printed in the end as a single line in the trace output, such as:
|
||||
*
|
||||
* bash-15816 [01] 235.197585: idle_cpu <- irq_enter
|
||||
*/
|
||||
struct trace_entry {
|
||||
unsigned short type;
|
||||
unsigned char flags;
|
||||
unsigned char preempt_count;
|
||||
int pid;
|
||||
int tgid;
|
||||
};
|
||||
|
||||
#define FTRACE_MAX_EVENT \
|
||||
((1 << (sizeof(((struct trace_entry *)0)->type) * 8)) - 1)
|
||||
|
||||
/*
|
||||
* Trace iterator - used by printout routines who present trace
|
||||
* results to users and which routines might sleep, etc:
|
||||
*/
|
||||
struct trace_iterator {
|
||||
struct trace_array *tr;
|
||||
struct tracer *trace;
|
||||
void *private;
|
||||
int cpu_file;
|
||||
struct mutex mutex;
|
||||
struct ring_buffer_iter *buffer_iter[NR_CPUS];
|
||||
unsigned long iter_flags;
|
||||
|
||||
/* The below is zeroed out in pipe_read */
|
||||
struct trace_seq seq;
|
||||
struct trace_entry *ent;
|
||||
int cpu;
|
||||
u64 ts;
|
||||
|
||||
loff_t pos;
|
||||
long idx;
|
||||
|
||||
cpumask_var_t started;
|
||||
};
|
||||
|
||||
|
||||
typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
|
||||
int flags);
|
||||
struct trace_event {
|
||||
struct hlist_node node;
|
||||
struct list_head list;
|
||||
int type;
|
||||
trace_print_func trace;
|
||||
trace_print_func raw;
|
||||
trace_print_func hex;
|
||||
trace_print_func binary;
|
||||
};
|
||||
|
||||
extern int register_ftrace_event(struct trace_event *event);
|
||||
extern int unregister_ftrace_event(struct trace_event *event);
|
||||
|
||||
/* Return values for print_line callback */
|
||||
enum print_line_t {
|
||||
TRACE_TYPE_PARTIAL_LINE = 0, /* Retry after flushing the seq */
|
||||
TRACE_TYPE_HANDLED = 1,
|
||||
TRACE_TYPE_UNHANDLED = 2, /* Relay to other output functions */
|
||||
TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */
|
||||
};
|
||||
|
||||
|
||||
struct ring_buffer_event *
|
||||
trace_current_buffer_lock_reserve(int type, unsigned long len,
|
||||
unsigned long flags, int pc);
|
||||
void trace_current_buffer_unlock_commit(struct ring_buffer_event *event,
|
||||
unsigned long flags, int pc);
|
||||
void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event,
|
||||
unsigned long flags, int pc);
|
||||
void trace_current_buffer_discard_commit(struct ring_buffer_event *event);
|
||||
|
||||
void tracing_record_cmdline(struct task_struct *tsk);
|
||||
|
||||
struct ftrace_event_call {
|
||||
struct list_head list;
|
||||
char *name;
|
||||
char *system;
|
||||
struct dentry *dir;
|
||||
struct trace_event *event;
|
||||
int enabled;
|
||||
int (*regfunc)(void);
|
||||
void (*unregfunc)(void);
|
||||
int id;
|
||||
int (*raw_init)(void);
|
||||
int (*show_format)(struct trace_seq *s);
|
||||
int (*define_fields)(void);
|
||||
struct list_head fields;
|
||||
int filter_active;
|
||||
void *filter;
|
||||
void *mod;
|
||||
|
||||
#ifdef CONFIG_EVENT_PROFILE
|
||||
atomic_t profile_count;
|
||||
int (*profile_enable)(struct ftrace_event_call *);
|
||||
void (*profile_disable)(struct ftrace_event_call *);
|
||||
#endif
|
||||
};
|
||||
|
||||
#define MAX_FILTER_PRED 32
|
||||
#define MAX_FILTER_STR_VAL 128
|
||||
|
||||
extern int init_preds(struct ftrace_event_call *call);
|
||||
extern void destroy_preds(struct ftrace_event_call *call);
|
||||
extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
|
||||
extern int filter_current_check_discard(struct ftrace_event_call *call,
|
||||
void *rec,
|
||||
struct ring_buffer_event *event);
|
||||
|
||||
extern int trace_define_field(struct ftrace_event_call *call, char *type,
|
||||
char *name, int offset, int size, int is_signed);
|
||||
|
||||
#define is_signed_type(type) (((type)(-1)) < 0)
|
||||
|
||||
int trace_set_clr_event(const char *system, const char *event, int set);
|
||||
|
||||
/*
|
||||
* The double __builtin_constant_p is because gcc will give us an error
|
||||
* if we try to allocate the static variable to fmt if it is not a
|
||||
* constant. Even with the outer if statement optimizing out.
|
||||
*/
|
||||
#define event_trace_printk(ip, fmt, args...) \
|
||||
do { \
|
||||
__trace_printk_check_format(fmt, ##args); \
|
||||
tracing_record_cmdline(current); \
|
||||
if (__builtin_constant_p(fmt)) { \
|
||||
static const char *trace_printk_fmt \
|
||||
__attribute__((section("__trace_printk_fmt"))) = \
|
||||
__builtin_constant_p(fmt) ? fmt : NULL; \
|
||||
\
|
||||
__trace_bprintk(ip, trace_printk_fmt, ##args); \
|
||||
} else \
|
||||
__trace_printk(ip, fmt, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define __common_field(type, item, is_signed) \
|
||||
ret = trace_define_field(event_call, #type, "common_" #item, \
|
||||
offsetof(typeof(field.ent), item), \
|
||||
sizeof(field.ent.item), is_signed); \
|
||||
if (ret) \
|
||||
return ret;
|
||||
|
||||
#endif /* _LINUX_FTRACE_EVENT_H */
|
@@ -120,6 +120,13 @@ struct fuse_file_lock {
|
||||
#define FUSE_EXPORT_SUPPORT (1 << 4)
|
||||
#define FUSE_BIG_WRITES (1 << 5)
|
||||
|
||||
/**
|
||||
* CUSE INIT request/reply flags
|
||||
*
|
||||
* CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
|
||||
*/
|
||||
#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
|
||||
|
||||
/**
|
||||
* Release flags
|
||||
*/
|
||||
@@ -210,6 +217,9 @@ enum fuse_opcode {
|
||||
FUSE_DESTROY = 38,
|
||||
FUSE_IOCTL = 39,
|
||||
FUSE_POLL = 40,
|
||||
|
||||
/* CUSE specific operations */
|
||||
CUSE_INIT = 4096,
|
||||
};
|
||||
|
||||
enum fuse_notify_code {
|
||||
@@ -401,6 +411,27 @@ struct fuse_init_out {
|
||||
__u32 max_write;
|
||||
};
|
||||
|
||||
#define CUSE_INIT_INFO_MAX 4096
|
||||
|
||||
struct cuse_init_in {
|
||||
__u32 major;
|
||||
__u32 minor;
|
||||
__u32 unused;
|
||||
__u32 flags;
|
||||
};
|
||||
|
||||
struct cuse_init_out {
|
||||
__u32 major;
|
||||
__u32 minor;
|
||||
__u32 unused;
|
||||
__u32 flags;
|
||||
__u32 max_read;
|
||||
__u32 max_write;
|
||||
__u32 dev_major; /* chardev major */
|
||||
__u32 dev_minor; /* chardev minor */
|
||||
__u32 spare[10];
|
||||
};
|
||||
|
||||
struct fuse_interrupt_in {
|
||||
__u64 unique;
|
||||
};
|
||||
|
@@ -23,6 +23,8 @@ union ktime;
|
||||
#define FUTEX_TRYLOCK_PI 8
|
||||
#define FUTEX_WAIT_BITSET 9
|
||||
#define FUTEX_WAKE_BITSET 10
|
||||
#define FUTEX_WAIT_REQUEUE_PI 11
|
||||
#define FUTEX_CMP_REQUEUE_PI 12
|
||||
|
||||
#define FUTEX_PRIVATE_FLAG 128
|
||||
#define FUTEX_CLOCK_REALTIME 256
|
||||
@@ -38,6 +40,10 @@ union ktime;
|
||||
#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITS | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITS | FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | \
|
||||
FUTEX_PRIVATE_FLAG)
|
||||
#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | \
|
||||
FUTEX_PRIVATE_FLAG)
|
||||
|
||||
/*
|
||||
* Support for robust futexes: the kernel cleans up held futexes at
|
||||
|
@@ -11,6 +11,7 @@
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/io.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/device.h>
|
||||
@@ -62,7 +63,7 @@ struct gameport_driver {
|
||||
|
||||
struct device_driver driver;
|
||||
|
||||
unsigned int ignore;
|
||||
bool ignore;
|
||||
};
|
||||
#define to_gameport_driver(d) container_of(d, struct gameport_driver, driver)
|
||||
|
||||
|
8
include/linux/gcd.h
Normal file
8
include/linux/gcd.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _GCD_H
|
||||
#define _GCD_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
unsigned long gcd(unsigned long a, unsigned long b) __attribute_const__;
|
||||
|
||||
#endif /* _GCD_H */
|
@@ -90,6 +90,7 @@ struct disk_stats {
|
||||
struct hd_struct {
|
||||
sector_t start_sect;
|
||||
sector_t nr_sects;
|
||||
sector_t alignment_offset;
|
||||
struct device __dev;
|
||||
struct kobject *holder_dir;
|
||||
int policy, partno;
|
||||
@@ -113,6 +114,7 @@ struct hd_struct {
|
||||
#define GENHD_FL_UP 16
|
||||
#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
|
||||
#define GENHD_FL_EXT_DEVT 64 /* allow extended devt */
|
||||
#define GENHD_FL_NATIVE_CAPACITY 128
|
||||
|
||||
#define BLK_SCSI_MAX_CMDS (256)
|
||||
#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
|
||||
@@ -140,7 +142,7 @@ struct gendisk {
|
||||
* disks that can't be partitioned. */
|
||||
|
||||
char disk_name[DISK_NAME_LEN]; /* name of major driver */
|
||||
|
||||
char *(*nodename)(struct gendisk *gd);
|
||||
/* Array of pointers to partitions indexed by partno.
|
||||
* Protected with matching bdev lock but stat and other
|
||||
* non-critical accesses use RCU. Always access through
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/topology.h>
|
||||
#include <linux/mmdebug.h>
|
||||
|
||||
struct vm_area_struct;
|
||||
|
||||
@@ -20,7 +21,8 @@ struct vm_area_struct;
|
||||
#define __GFP_DMA ((__force gfp_t)0x01u)
|
||||
#define __GFP_HIGHMEM ((__force gfp_t)0x02u)
|
||||
#define __GFP_DMA32 ((__force gfp_t)0x04u)
|
||||
|
||||
#define __GFP_MOVABLE ((__force gfp_t)0x08u) /* Page is movable */
|
||||
#define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE)
|
||||
/*
|
||||
* Action modifiers - doesn't change the zoning
|
||||
*
|
||||
@@ -50,9 +52,20 @@ struct vm_area_struct;
|
||||
#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
|
||||
#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */
|
||||
#define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */
|
||||
#define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */
|
||||
|
||||
#define __GFP_BITS_SHIFT 21 /* Room for 21 __GFP_FOO bits */
|
||||
#ifdef CONFIG_KMEMCHECK
|
||||
#define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */
|
||||
#else
|
||||
#define __GFP_NOTRACK ((__force gfp_t)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This may seem redundant, but it's a way of annotating false positives vs.
|
||||
* allocations that simply cannot be supported (e.g. page tables).
|
||||
*/
|
||||
#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
|
||||
|
||||
#define __GFP_BITS_SHIFT 22 /* Room for 22 __GFP_FOO bits */
|
||||
#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
|
||||
|
||||
/* This equals 0, but use constants in case they ever change */
|
||||
@@ -85,6 +98,9 @@ struct vm_area_struct;
|
||||
__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\
|
||||
__GFP_NORETRY|__GFP_NOMEMALLOC)
|
||||
|
||||
/* Control slab gfp mask during early boot */
|
||||
#define GFP_BOOT_MASK __GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS)
|
||||
|
||||
/* Control allocation constraints */
|
||||
#define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE)
|
||||
|
||||
@@ -112,24 +128,105 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
|
||||
((gfp_flags & __GFP_RECLAIMABLE) != 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
#define OPT_ZONE_HIGHMEM ZONE_HIGHMEM
|
||||
#else
|
||||
#define OPT_ZONE_HIGHMEM ZONE_NORMAL
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ZONE_DMA
|
||||
#define OPT_ZONE_DMA ZONE_DMA
|
||||
#else
|
||||
#define OPT_ZONE_DMA ZONE_NORMAL
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ZONE_DMA32
|
||||
#define OPT_ZONE_DMA32 ZONE_DMA32
|
||||
#else
|
||||
#define OPT_ZONE_DMA32 ZONE_NORMAL
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GFP_ZONE_TABLE is a word size bitstring that is used for looking up the
|
||||
* zone to use given the lowest 4 bits of gfp_t. Entries are ZONE_SHIFT long
|
||||
* and there are 16 of them to cover all possible combinations of
|
||||
* __GFP_DMA, __GFP_DMA32, __GFP_MOVABLE and __GFP_HIGHMEM
|
||||
*
|
||||
* The zone fallback order is MOVABLE=>HIGHMEM=>NORMAL=>DMA32=>DMA.
|
||||
* But GFP_MOVABLE is not only a zone specifier but also an allocation
|
||||
* policy. Therefore __GFP_MOVABLE plus another zone selector is valid.
|
||||
* Only 1bit of the lowest 3 bit (DMA,DMA32,HIGHMEM) can be set to "1".
|
||||
*
|
||||
* bit result
|
||||
* =================
|
||||
* 0x0 => NORMAL
|
||||
* 0x1 => DMA or NORMAL
|
||||
* 0x2 => HIGHMEM or NORMAL
|
||||
* 0x3 => BAD (DMA+HIGHMEM)
|
||||
* 0x4 => DMA32 or DMA or NORMAL
|
||||
* 0x5 => BAD (DMA+DMA32)
|
||||
* 0x6 => BAD (HIGHMEM+DMA32)
|
||||
* 0x7 => BAD (HIGHMEM+DMA32+DMA)
|
||||
* 0x8 => NORMAL (MOVABLE+0)
|
||||
* 0x9 => DMA or NORMAL (MOVABLE+DMA)
|
||||
* 0xa => MOVABLE (Movable is valid only if HIGHMEM is set too)
|
||||
* 0xb => BAD (MOVABLE+HIGHMEM+DMA)
|
||||
* 0xc => DMA32 (MOVABLE+HIGHMEM+DMA32)
|
||||
* 0xd => BAD (MOVABLE+DMA32+DMA)
|
||||
* 0xe => BAD (MOVABLE+DMA32+HIGHMEM)
|
||||
* 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA)
|
||||
*
|
||||
* ZONES_SHIFT must be <= 2 on 32 bit platforms.
|
||||
*/
|
||||
|
||||
#if 16 * ZONES_SHIFT > BITS_PER_LONG
|
||||
#error ZONES_SHIFT too large to create GFP_ZONE_TABLE integer
|
||||
#endif
|
||||
|
||||
#define GFP_ZONE_TABLE ( \
|
||||
(ZONE_NORMAL << 0 * ZONES_SHIFT) \
|
||||
| (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \
|
||||
| (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \
|
||||
| (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \
|
||||
| (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \
|
||||
| (OPT_ZONE_DMA << (__GFP_MOVABLE | __GFP_DMA) * ZONES_SHIFT) \
|
||||
| (ZONE_MOVABLE << (__GFP_MOVABLE | __GFP_HIGHMEM) * ZONES_SHIFT)\
|
||||
| (OPT_ZONE_DMA32 << (__GFP_MOVABLE | __GFP_DMA32) * ZONES_SHIFT)\
|
||||
)
|
||||
|
||||
/*
|
||||
* GFP_ZONE_BAD is a bitmap for all combination of __GFP_DMA, __GFP_DMA32
|
||||
* __GFP_HIGHMEM and __GFP_MOVABLE that are not permitted. One flag per
|
||||
* entry starting with bit 0. Bit is set if the combination is not
|
||||
* allowed.
|
||||
*/
|
||||
#define GFP_ZONE_BAD ( \
|
||||
1 << (__GFP_DMA | __GFP_HIGHMEM) \
|
||||
| 1 << (__GFP_DMA | __GFP_DMA32) \
|
||||
| 1 << (__GFP_DMA32 | __GFP_HIGHMEM) \
|
||||
| 1 << (__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM) \
|
||||
| 1 << (__GFP_MOVABLE | __GFP_HIGHMEM | __GFP_DMA) \
|
||||
| 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA) \
|
||||
| 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_HIGHMEM) \
|
||||
| 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA | __GFP_HIGHMEM)\
|
||||
)
|
||||
|
||||
static inline enum zone_type gfp_zone(gfp_t flags)
|
||||
{
|
||||
#ifdef CONFIG_ZONE_DMA
|
||||
if (flags & __GFP_DMA)
|
||||
return ZONE_DMA;
|
||||
enum zone_type z;
|
||||
int bit = flags & GFP_ZONEMASK;
|
||||
|
||||
z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) &
|
||||
((1 << ZONES_SHIFT) - 1);
|
||||
|
||||
if (__builtin_constant_p(bit))
|
||||
BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
else {
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
#endif
|
||||
#ifdef CONFIG_ZONE_DMA32
|
||||
if (flags & __GFP_DMA32)
|
||||
return ZONE_DMA32;
|
||||
#endif
|
||||
if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) ==
|
||||
(__GFP_HIGHMEM | __GFP_MOVABLE))
|
||||
return ZONE_MOVABLE;
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
if (flags & __GFP_HIGHMEM)
|
||||
return ZONE_HIGHMEM;
|
||||
#endif
|
||||
return ZONE_NORMAL;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -169,30 +266,19 @@ static inline void arch_alloc_page(struct page *page, int order) { }
|
||||
#endif
|
||||
|
||||
struct page *
|
||||
__alloc_pages_internal(gfp_t gfp_mask, unsigned int order,
|
||||
__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
|
||||
struct zonelist *zonelist, nodemask_t *nodemask);
|
||||
|
||||
static inline struct page *
|
||||
__alloc_pages(gfp_t gfp_mask, unsigned int order,
|
||||
struct zonelist *zonelist)
|
||||
{
|
||||
return __alloc_pages_internal(gfp_mask, order, zonelist, NULL);
|
||||
return __alloc_pages_nodemask(gfp_mask, order, zonelist, NULL);
|
||||
}
|
||||
|
||||
static inline struct page *
|
||||
__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
|
||||
struct zonelist *zonelist, nodemask_t *nodemask)
|
||||
{
|
||||
return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask);
|
||||
}
|
||||
|
||||
|
||||
static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
|
||||
unsigned int order)
|
||||
{
|
||||
if (unlikely(order >= MAX_ORDER))
|
||||
return NULL;
|
||||
|
||||
/* Unknown node is current node */
|
||||
if (nid < 0)
|
||||
nid = numa_node_id();
|
||||
@@ -200,15 +286,20 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
|
||||
return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
|
||||
}
|
||||
|
||||
static inline struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask,
|
||||
unsigned int order)
|
||||
{
|
||||
VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES);
|
||||
|
||||
return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order);
|
||||
|
||||
static inline struct page *
|
||||
alloc_pages(gfp_t gfp_mask, unsigned int order)
|
||||
{
|
||||
if (unlikely(order >= MAX_ORDER))
|
||||
return NULL;
|
||||
|
||||
return alloc_pages_current(gfp_mask, order);
|
||||
}
|
||||
extern struct page *alloc_page_vma(gfp_t gfp_mask,
|
||||
@@ -245,4 +336,23 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
|
||||
void drain_all_pages(void);
|
||||
void drain_local_pages(void *dummy);
|
||||
|
||||
extern bool oom_killer_disabled;
|
||||
|
||||
static inline void oom_killer_disable(void)
|
||||
{
|
||||
oom_killer_disabled = true;
|
||||
}
|
||||
|
||||
static inline void oom_killer_enable(void)
|
||||
{
|
||||
oom_killer_disabled = false;
|
||||
}
|
||||
|
||||
extern gfp_t gfp_allowed_mask;
|
||||
|
||||
static inline void set_gfp_allowed_mask(gfp_t mask)
|
||||
{
|
||||
gfp_allowed_mask = mask;
|
||||
}
|
||||
|
||||
#endif /* __LINUX_GFP_H */
|
||||
|
@@ -238,6 +238,42 @@ struct hid_item {
|
||||
#define HID_GD_RIGHT 0x00010092
|
||||
#define HID_GD_LEFT 0x00010093
|
||||
|
||||
#define HID_DG_DIGITIZER 0x000d0001
|
||||
#define HID_DG_PEN 0x000d0002
|
||||
#define HID_DG_LIGHTPEN 0x000d0003
|
||||
#define HID_DG_TOUCHSCREEN 0x000d0004
|
||||
#define HID_DG_TOUCHPAD 0x000d0005
|
||||
#define HID_DG_STYLUS 0x000d0020
|
||||
#define HID_DG_PUCK 0x000d0021
|
||||
#define HID_DG_FINGER 0x000d0022
|
||||
#define HID_DG_TIPPRESSURE 0x000d0030
|
||||
#define HID_DG_BARRELPRESSURE 0x000d0031
|
||||
#define HID_DG_INRANGE 0x000d0032
|
||||
#define HID_DG_TOUCH 0x000d0033
|
||||
#define HID_DG_UNTOUCH 0x000d0034
|
||||
#define HID_DG_TAP 0x000d0035
|
||||
#define HID_DG_TABLETFUNCTIONKEY 0x000d0039
|
||||
#define HID_DG_PROGRAMCHANGEKEY 0x000d003a
|
||||
#define HID_DG_INVERT 0x000d003c
|
||||
#define HID_DG_TIPSWITCH 0x000d0042
|
||||
#define HID_DG_TIPSWITCH2 0x000d0043
|
||||
#define HID_DG_BARRELSWITCH 0x000d0044
|
||||
#define HID_DG_ERASER 0x000d0045
|
||||
#define HID_DG_TABLETPICK 0x000d0046
|
||||
/*
|
||||
* as of May 20, 2009 the usages below are not yet in the official USB spec
|
||||
* but are being pushed by Microsft as described in their paper "Digitizer
|
||||
* Drivers for Windows Touch and Pen-Based Computers"
|
||||
*/
|
||||
#define HID_DG_CONFIDENCE 0x000d0047
|
||||
#define HID_DG_WIDTH 0x000d0048
|
||||
#define HID_DG_HEIGHT 0x000d0049
|
||||
#define HID_DG_CONTACTID 0x000d0051
|
||||
#define HID_DG_INPUTMODE 0x000d0052
|
||||
#define HID_DG_DEVICEINDEX 0x000d0053
|
||||
#define HID_DG_CONTACTCOUNT 0x000d0054
|
||||
#define HID_DG_CONTACTMAX 0x000d0055
|
||||
|
||||
/*
|
||||
* HID report types --- Ouch! HID spec says 1 2 3!
|
||||
*/
|
||||
|
@@ -55,7 +55,9 @@ static inline void *kmap(struct page *page)
|
||||
return page_address(page);
|
||||
}
|
||||
|
||||
#define kunmap(page) do { (void) (page); } while (0)
|
||||
static inline void kunmap(struct page *page)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void *kmap_atomic(struct page *page, enum km_type idx)
|
||||
{
|
||||
|
@@ -30,8 +30,11 @@ struct hrtimer_cpu_base;
|
||||
* Mode arguments of xxx_hrtimer functions:
|
||||
*/
|
||||
enum hrtimer_mode {
|
||||
HRTIMER_MODE_ABS, /* Time value is absolute */
|
||||
HRTIMER_MODE_REL, /* Time value is relative to now */
|
||||
HRTIMER_MODE_ABS = 0x0, /* Time value is absolute */
|
||||
HRTIMER_MODE_REL = 0x1, /* Time value is relative to now */
|
||||
HRTIMER_MODE_PINNED = 0x02, /* Timer is bound to CPU */
|
||||
HRTIMER_MODE_ABS_PINNED = 0x02,
|
||||
HRTIMER_MODE_REL_PINNED = 0x03,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@@ -11,6 +11,8 @@
|
||||
|
||||
struct ctl_table;
|
||||
|
||||
int PageHuge(struct page *page);
|
||||
|
||||
static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
|
||||
{
|
||||
return vma->vm_flags & VM_HUGETLB;
|
||||
@@ -31,7 +33,7 @@ void hugetlb_report_meminfo(struct seq_file *);
|
||||
int hugetlb_report_node_meminfo(int, char *);
|
||||
unsigned long hugetlb_total_pages(void);
|
||||
int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
unsigned long address, int write_access);
|
||||
unsigned long address, unsigned int flags);
|
||||
int hugetlb_reserve_pages(struct inode *inode, long from, long to,
|
||||
struct vm_area_struct *vma,
|
||||
int acctflags);
|
||||
@@ -61,6 +63,11 @@ void hugetlb_change_protection(struct vm_area_struct *vma,
|
||||
|
||||
#else /* !CONFIG_HUGETLB_PAGE */
|
||||
|
||||
static inline int PageHuge(struct page *page)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
|
||||
{
|
||||
return 0;
|
||||
@@ -91,7 +98,7 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
|
||||
#define pud_huge(x) 0
|
||||
#define is_hugepage_only_range(mm, addr, len) 0
|
||||
#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
|
||||
#define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; })
|
||||
#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; })
|
||||
|
||||
#define hugetlb_change_protection(vma, address, end, newprot)
|
||||
|
||||
|
@@ -14,6 +14,8 @@
|
||||
struct ocores_i2c_platform_data {
|
||||
u32 regstep; /* distance between registers */
|
||||
u32 clock_khz; /* input clock in kHz */
|
||||
u8 num_devices; /* number of devices in the devices list */
|
||||
struct i2c_board_info const *devices; /* devices connected to the bus */
|
||||
};
|
||||
|
||||
#endif /* _LINUX_I2C_OCORES_H */
|
||||
|
@@ -47,6 +47,7 @@ struct i2c_driver;
|
||||
union i2c_smbus_data;
|
||||
struct i2c_board_info;
|
||||
|
||||
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
|
||||
/*
|
||||
* The master routines are the ones normally used to transmit data to devices
|
||||
* on a bus (or read from them). Apart from two basic transfer functions to
|
||||
@@ -93,6 +94,7 @@ extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client,
|
||||
extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
|
||||
u8 command, u8 length,
|
||||
const u8 *values);
|
||||
#endif /* I2C */
|
||||
|
||||
/**
|
||||
* struct i2c_driver - represent an I2C device driver
|
||||
@@ -100,9 +102,8 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
|
||||
* @class: What kind of i2c device we instantiate (for detect)
|
||||
* @attach_adapter: Callback for bus addition (for legacy drivers)
|
||||
* @detach_adapter: Callback for bus removal (for legacy drivers)
|
||||
* @detach_client: Callback for device removal (for legacy drivers)
|
||||
* @probe: Callback for device binding (new-style drivers)
|
||||
* @remove: Callback for device unbinding (new-style drivers)
|
||||
* @probe: Callback for device binding
|
||||
* @remove: Callback for device unbinding
|
||||
* @shutdown: Callback for device shutdown
|
||||
* @suspend: Callback for device suspend
|
||||
* @resume: Callback for device resume
|
||||
@@ -137,26 +138,14 @@ struct i2c_driver {
|
||||
int id;
|
||||
unsigned int class;
|
||||
|
||||
/* Notifies the driver that a new bus has appeared. This routine
|
||||
* can be used by the driver to test if the bus meets its conditions
|
||||
* & seek for the presence of the chip(s) it supports. If found, it
|
||||
* registers the client(s) that are on the bus to the i2c admin. via
|
||||
* i2c_attach_client. (LEGACY I2C DRIVERS ONLY)
|
||||
/* Notifies the driver that a new bus has appeared or is about to be
|
||||
* removed. You should avoid using this if you can, it will probably
|
||||
* be removed in a near future.
|
||||
*/
|
||||
int (*attach_adapter)(struct i2c_adapter *);
|
||||
int (*detach_adapter)(struct i2c_adapter *);
|
||||
|
||||
/* tells the driver that a client is about to be deleted & gives it
|
||||
* the chance to remove its private data. Also, if the client struct
|
||||
* has been dynamically allocated by the driver in the function above,
|
||||
* it must be freed here. (LEGACY I2C DRIVERS ONLY)
|
||||
*/
|
||||
int (*detach_client)(struct i2c_client *) __deprecated;
|
||||
|
||||
/* Standard driver model interfaces, for "new style" i2c drivers.
|
||||
* With the driver model, device enumeration is NEVER done by drivers;
|
||||
* it's done by infrastructure. (NEW STYLE DRIVERS ONLY)
|
||||
*/
|
||||
/* Standard driver model interfaces */
|
||||
int (*probe)(struct i2c_client *, const struct i2c_device_id *);
|
||||
int (*remove)(struct i2c_client *);
|
||||
|
||||
@@ -191,9 +180,8 @@ struct i2c_driver {
|
||||
* @driver: device's driver, hence pointer to access routines
|
||||
* @dev: Driver model device node for the slave.
|
||||
* @irq: indicates the IRQ generated by this device (if any)
|
||||
* @list: list of active/busy clients (DEPRECATED)
|
||||
* @detected: member of an i2c_driver.clients list
|
||||
* @released: used to synchronize client releases & detaches and references
|
||||
* @detected: member of an i2c_driver.clients list or i2c-core's
|
||||
* userspace_devices list
|
||||
*
|
||||
* An i2c_client identifies a single device (i.e. chip) connected to an
|
||||
* i2c bus. The behaviour exposed to Linux is defined by the driver
|
||||
@@ -209,9 +197,7 @@ struct i2c_client {
|
||||
struct i2c_driver *driver; /* and our access routines */
|
||||
struct device dev; /* the device structure */
|
||||
int irq; /* irq issued by device */
|
||||
struct list_head list; /* DEPRECATED */
|
||||
struct list_head detected;
|
||||
struct completion released;
|
||||
};
|
||||
#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
|
||||
|
||||
@@ -248,11 +234,10 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
|
||||
* that, such as chip type, configuration, associated IRQ, and so on.
|
||||
*
|
||||
* i2c_board_info is used to build tables of information listing I2C devices
|
||||
* that are present. This information is used to grow the driver model tree
|
||||
* for "new style" I2C drivers. For mainboards this is done statically using
|
||||
* i2c_register_board_info(); bus numbers identify adapters that aren't
|
||||
* yet available. For add-on boards, i2c_new_device() does this dynamically
|
||||
* with the adapter already known.
|
||||
* that are present. This information is used to grow the driver model tree.
|
||||
* For mainboards this is done statically using i2c_register_board_info();
|
||||
* bus numbers identify adapters that aren't yet available. For add-on boards,
|
||||
* i2c_new_device() does this dynamically with the adapter already known.
|
||||
*/
|
||||
struct i2c_board_info {
|
||||
char type[I2C_NAME_SIZE];
|
||||
@@ -277,6 +262,7 @@ struct i2c_board_info {
|
||||
.type = dev_type, .addr = (dev_addr)
|
||||
|
||||
|
||||
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
|
||||
/* Add-on boards should register/unregister their devices; e.g. a board
|
||||
* with integrated I2C, a config eeprom, sensors, and a codec that's
|
||||
* used in conjunction with the primary hardware.
|
||||
@@ -300,6 +286,7 @@ extern struct i2c_client *
|
||||
i2c_new_dummy(struct i2c_adapter *adap, u16 address);
|
||||
|
||||
extern void i2c_unregister_device(struct i2c_client *);
|
||||
#endif /* I2C */
|
||||
|
||||
/* Mainboard arch_initcall() code should register all its I2C devices.
|
||||
* This is done at arch_initcall time, before declaring any i2c adapters.
|
||||
@@ -316,7 +303,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* I2C_BOARDINFO */
|
||||
|
||||
/*
|
||||
* The following structs are for those who like to implement new bus drivers:
|
||||
@@ -352,21 +339,15 @@ struct i2c_adapter {
|
||||
const struct i2c_algorithm *algo; /* the algorithm to access the bus */
|
||||
void *algo_data;
|
||||
|
||||
/* --- administration stuff. */
|
||||
int (*client_register)(struct i2c_client *) __deprecated;
|
||||
int (*client_unregister)(struct i2c_client *) __deprecated;
|
||||
|
||||
/* data fields that are valid for all devices */
|
||||
u8 level; /* nesting level for lockdep */
|
||||
struct mutex bus_lock;
|
||||
struct mutex clist_lock;
|
||||
|
||||
int timeout; /* in jiffies */
|
||||
int retries;
|
||||
struct device dev; /* the adapter device */
|
||||
|
||||
int nr;
|
||||
struct list_head clients; /* DEPRECATED */
|
||||
char name[48];
|
||||
struct completion dev_released;
|
||||
};
|
||||
@@ -412,11 +393,16 @@ struct i2c_client_address_data {
|
||||
/* The numbers to use to set I2C bus address */
|
||||
#define ANY_I2C_BUS 0xffff
|
||||
|
||||
/* Construct an I2C_CLIENT_END-terminated array of i2c addresses */
|
||||
#define I2C_ADDRS(addr, addrs...) \
|
||||
((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END })
|
||||
|
||||
|
||||
/* ----- functions exported by i2c.o */
|
||||
|
||||
/* administration...
|
||||
*/
|
||||
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
|
||||
extern int i2c_add_adapter(struct i2c_adapter *);
|
||||
extern int i2c_del_adapter(struct i2c_adapter *);
|
||||
extern int i2c_add_numbered_adapter(struct i2c_adapter *);
|
||||
@@ -429,11 +415,6 @@ static inline int i2c_add_driver(struct i2c_driver *driver)
|
||||
return i2c_register_driver(THIS_MODULE, driver);
|
||||
}
|
||||
|
||||
/* These are deprecated, your driver should use the standard .probe()
|
||||
* and .remove() methods instead. */
|
||||
extern int __deprecated i2c_attach_client(struct i2c_client *);
|
||||
extern int __deprecated i2c_detach_client(struct i2c_client *);
|
||||
|
||||
extern struct i2c_client *i2c_use_client(struct i2c_client *client);
|
||||
extern void i2c_release_client(struct i2c_client *client);
|
||||
|
||||
@@ -442,14 +423,6 @@ extern void i2c_release_client(struct i2c_client *client);
|
||||
extern void i2c_clients_command(struct i2c_adapter *adap,
|
||||
unsigned int cmd, void *arg);
|
||||
|
||||
/* Detect function. It iterates over all possible addresses itself.
|
||||
* It will only call found_proc if some client is connected at the
|
||||
* specific address (unless a 'force' matched);
|
||||
*/
|
||||
extern int i2c_probe(struct i2c_adapter *adapter,
|
||||
const struct i2c_client_address_data *address_data,
|
||||
int (*found_proc) (struct i2c_adapter *, int, int));
|
||||
|
||||
extern struct i2c_adapter *i2c_get_adapter(int id);
|
||||
extern void i2c_put_adapter(struct i2c_adapter *adap);
|
||||
|
||||
@@ -471,6 +444,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
|
||||
{
|
||||
return adap->nr;
|
||||
}
|
||||
#endif /* I2C */
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/**
|
||||
|
46
include/linux/i2c/lm8323.h
Normal file
46
include/linux/i2c/lm8323.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* lm8323.h - Configuration for LM8323 keypad driver.
|
||||
*
|
||||
* 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 (version 2 of the License only).
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_LM8323_H
|
||||
#define __LINUX_LM8323_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Largest keycode that the chip can send, plus one,
|
||||
* so keys can be mapped directly at the index of the
|
||||
* LM8323 keycode instead of subtracting one.
|
||||
*/
|
||||
#define LM8323_KEYMAP_SIZE (0x7f + 1)
|
||||
|
||||
#define LM8323_NUM_PWMS 3
|
||||
|
||||
struct lm8323_platform_data {
|
||||
int debounce_time; /* Time to watch for key bouncing, in ms. */
|
||||
int active_time; /* Idle time until sleep, in ms. */
|
||||
|
||||
int size_x;
|
||||
int size_y;
|
||||
bool repeat;
|
||||
const unsigned short *keymap;
|
||||
|
||||
const char *pwm_names[LM8323_NUM_PWMS];
|
||||
|
||||
const char *name; /* Device name. */
|
||||
};
|
||||
|
||||
#endif /* __LINUX_LM8323_H */
|
@@ -15,4 +15,5 @@ struct pca953x_platform_data {
|
||||
int (*teardown)(struct i2c_client *client,
|
||||
unsigned gpio, unsigned ngpio,
|
||||
void *context);
|
||||
char **names;
|
||||
};
|
||||
|
@@ -175,16 +175,16 @@ struct icmp6_filter {
|
||||
|
||||
|
||||
extern void icmpv6_send(struct sk_buff *skb,
|
||||
int type, int code,
|
||||
u8 type, u8 code,
|
||||
__u32 info,
|
||||
struct net_device *dev);
|
||||
|
||||
extern int icmpv6_init(void);
|
||||
extern int icmpv6_err_convert(int type, int code,
|
||||
extern int icmpv6_err_convert(u8 type, u8 code,
|
||||
int *err);
|
||||
extern void icmpv6_cleanup(void);
|
||||
extern void icmpv6_param_prob(struct sk_buff *skb,
|
||||
int code, int pos);
|
||||
u8 code, int pos);
|
||||
|
||||
struct flowi;
|
||||
struct in6_addr;
|
||||
|
@@ -26,6 +26,9 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/mutex.h>
|
||||
|
||||
/* for request_sense */
|
||||
#include <linux/cdrom.h>
|
||||
|
||||
#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300)
|
||||
# define SUPPORT_VLB_SYNC 0
|
||||
#else
|
||||
@@ -153,12 +156,6 @@ enum {
|
||||
#define REQ_PARK_HEADS 0x22
|
||||
#define REQ_UNPARK_HEADS 0x23
|
||||
|
||||
/*
|
||||
* Check for an interrupt and acknowledge the interrupt status
|
||||
*/
|
||||
struct hwif_s;
|
||||
typedef int (ide_ack_intr_t)(struct hwif_s *);
|
||||
|
||||
/*
|
||||
* hwif_chipset_t is used to keep track of the specific hardware
|
||||
* chipset used by each IDE interface, if known.
|
||||
@@ -175,20 +172,18 @@ typedef u8 hwif_chipset_t;
|
||||
/*
|
||||
* Structure to hold all information about the location of this port
|
||||
*/
|
||||
typedef struct hw_regs_s {
|
||||
struct ide_hw {
|
||||
union {
|
||||
struct ide_io_ports io_ports;
|
||||
unsigned long io_ports_array[IDE_NR_PORTS];
|
||||
};
|
||||
|
||||
int irq; /* our irq number */
|
||||
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
|
||||
hwif_chipset_t chipset;
|
||||
struct device *dev, *parent;
|
||||
unsigned long config;
|
||||
} hw_regs_t;
|
||||
};
|
||||
|
||||
static inline void ide_std_init_ports(hw_regs_t *hw,
|
||||
static inline void ide_std_init_ports(struct ide_hw *hw,
|
||||
unsigned long io_addr,
|
||||
unsigned long ctl_addr)
|
||||
{
|
||||
@@ -215,21 +210,12 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
|
||||
|
||||
/*
|
||||
* Special Driver Flags
|
||||
*
|
||||
* set_geometry : respecify drive geometry
|
||||
* recalibrate : seek to cyl 0
|
||||
* set_multmode : set multmode count
|
||||
* reserved : unused
|
||||
*/
|
||||
typedef union {
|
||||
unsigned all : 8;
|
||||
struct {
|
||||
unsigned set_geometry : 1;
|
||||
unsigned recalibrate : 1;
|
||||
unsigned set_multmode : 1;
|
||||
unsigned reserved : 5;
|
||||
} b;
|
||||
} special_t;
|
||||
enum {
|
||||
IDE_SFLAG_SET_GEOMETRY = (1 << 0),
|
||||
IDE_SFLAG_RECALIBRATE = (1 << 1),
|
||||
IDE_SFLAG_SET_MULTMODE = (1 << 2),
|
||||
};
|
||||
|
||||
/*
|
||||
* Status returned from various ide_ functions
|
||||
@@ -324,7 +310,6 @@ struct ide_cmd {
|
||||
unsigned int cursg_ofs;
|
||||
|
||||
struct request *rq; /* copy of request */
|
||||
void *special; /* valid_t generally */
|
||||
};
|
||||
|
||||
/* ATAPI packet command flags */
|
||||
@@ -339,11 +324,6 @@ enum {
|
||||
PC_FLAG_WRITING = (1 << 6),
|
||||
};
|
||||
|
||||
/*
|
||||
* With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes.
|
||||
* This is used for several packet commands (not for READ/WRITE commands).
|
||||
*/
|
||||
#define IDE_PC_BUFFER_SIZE 64
|
||||
#define ATAPI_WAIT_PC (60 * HZ)
|
||||
|
||||
struct ide_atapi_pc {
|
||||
@@ -355,16 +335,6 @@ struct ide_atapi_pc {
|
||||
|
||||
/* bytes to transfer */
|
||||
int req_xfer;
|
||||
/* bytes actually transferred */
|
||||
int xferred;
|
||||
|
||||
/* data buffer */
|
||||
u8 *buf;
|
||||
/* current buffer position */
|
||||
u8 *cur_pos;
|
||||
int buf_size;
|
||||
/* missing/available data on the current buffer */
|
||||
int b_count;
|
||||
|
||||
/* the corresponding request */
|
||||
struct request *rq;
|
||||
@@ -375,12 +345,6 @@ struct ide_atapi_pc {
|
||||
* those are more or less driver-specific and some of them are subject
|
||||
* to change/removal later.
|
||||
*/
|
||||
u8 pc_buf[IDE_PC_BUFFER_SIZE];
|
||||
|
||||
/* idetape only */
|
||||
struct idetape_bh *bh;
|
||||
char *b_data;
|
||||
|
||||
unsigned long timeout;
|
||||
};
|
||||
|
||||
@@ -397,6 +361,7 @@ struct ide_drive_s;
|
||||
struct ide_disk_ops {
|
||||
int (*check)(struct ide_drive_s *, const char *);
|
||||
int (*get_capacity)(struct ide_drive_s *);
|
||||
u64 (*set_capacity)(struct ide_drive_s *, u64);
|
||||
void (*setup)(struct ide_drive_s *);
|
||||
void (*flush)(struct ide_drive_s *);
|
||||
int (*init_media)(struct ide_drive_s *, struct gendisk *);
|
||||
@@ -474,6 +439,8 @@ enum {
|
||||
IDE_DFLAG_NICE1 = (1 << 5),
|
||||
/* device is physically present */
|
||||
IDE_DFLAG_PRESENT = (1 << 6),
|
||||
/* disable Host Protected Area */
|
||||
IDE_DFLAG_NOHPA = (1 << 7),
|
||||
/* id read from device (synthetic if not set) */
|
||||
IDE_DFLAG_ID_READ = (1 << 8),
|
||||
IDE_DFLAG_NOPROBE = (1 << 9),
|
||||
@@ -512,6 +479,7 @@ enum {
|
||||
/* write protect */
|
||||
IDE_DFLAG_WP = (1 << 29),
|
||||
IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30),
|
||||
IDE_DFLAG_NIEN_QUIRK = (1 << 31),
|
||||
};
|
||||
|
||||
struct ide_drive_s {
|
||||
@@ -536,14 +504,13 @@ struct ide_drive_s {
|
||||
unsigned long sleep; /* sleep until this time */
|
||||
unsigned long timeout; /* max time to wait for irq */
|
||||
|
||||
special_t special; /* special action flags */
|
||||
u8 special_flags; /* special action flags */
|
||||
|
||||
u8 select; /* basic drive/head select reg value */
|
||||
u8 retry_pio; /* retrying dma capable host in pio */
|
||||
u8 waiting_for_dma; /* dma currently in progress */
|
||||
u8 dma; /* atapi dma flag */
|
||||
|
||||
u8 quirk_list; /* considered quirky, set for a specific host */
|
||||
u8 init_speed; /* transfer rate set at boot */
|
||||
u8 current_speed; /* current transfer rate set */
|
||||
u8 desired_speed; /* desired transfer rate set */
|
||||
@@ -565,11 +532,10 @@ struct ide_drive_s {
|
||||
|
||||
unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */
|
||||
unsigned int cyl; /* "real" number of cyls */
|
||||
unsigned int drive_data; /* used by set_pio_mode/dev_select() */
|
||||
void *drive_data; /* used by set_pio_mode/dev_select() */
|
||||
unsigned int failures; /* current failure count */
|
||||
unsigned int max_failures; /* maximum allowed failure count */
|
||||
u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */
|
||||
|
||||
u64 probed_capacity;/* initial/native media capacity */
|
||||
u64 capacity64; /* total number of sectors */
|
||||
|
||||
int lun; /* logical unit */
|
||||
@@ -593,16 +559,16 @@ struct ide_drive_s {
|
||||
/* callback for packet commands */
|
||||
int (*pc_callback)(struct ide_drive_s *, int);
|
||||
|
||||
void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *);
|
||||
int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,
|
||||
unsigned int, int);
|
||||
|
||||
ide_startstop_t (*irq_handler)(struct ide_drive_s *);
|
||||
|
||||
unsigned long atapi_flags;
|
||||
|
||||
struct ide_atapi_pc request_sense_pc;
|
||||
struct request request_sense_rq;
|
||||
|
||||
/* current sense rq and buffer */
|
||||
bool sense_rq_armed;
|
||||
struct request sense_rq;
|
||||
struct request_sense sense_data;
|
||||
};
|
||||
|
||||
typedef struct ide_drive_s ide_drive_t;
|
||||
@@ -663,6 +629,7 @@ struct ide_port_ops {
|
||||
void (*maskproc)(ide_drive_t *, int);
|
||||
void (*quirkproc)(ide_drive_t *);
|
||||
void (*clear_irq)(ide_drive_t *);
|
||||
int (*test_irq)(struct hwif_s *);
|
||||
|
||||
u8 (*mdma_filter)(ide_drive_t *);
|
||||
u8 (*udma_filter)(ide_drive_t *);
|
||||
@@ -688,6 +655,10 @@ struct ide_dma_ops {
|
||||
u8 (*dma_sff_read_status)(struct hwif_s *);
|
||||
};
|
||||
|
||||
enum {
|
||||
IDE_PFLAG_PROBING = (1 << 0),
|
||||
};
|
||||
|
||||
struct ide_host;
|
||||
|
||||
typedef struct hwif_s {
|
||||
@@ -704,6 +675,8 @@ typedef struct hwif_s {
|
||||
|
||||
ide_drive_t *devices[MAX_DRIVES + 1];
|
||||
|
||||
unsigned long port_flags;
|
||||
|
||||
u8 major; /* our major number */
|
||||
u8 index; /* 0 for ide0; 1 for ide1; ... */
|
||||
u8 channel; /* for dual-port chips: 0=primary, 1=secondary */
|
||||
@@ -722,8 +695,6 @@ typedef struct hwif_s {
|
||||
|
||||
struct device *dev;
|
||||
|
||||
ide_ack_intr_t *ack_intr;
|
||||
|
||||
void (*rw_disk)(ide_drive_t *, struct request *);
|
||||
|
||||
const struct ide_tp_ops *tp_ops;
|
||||
@@ -1144,6 +1115,8 @@ void SELECT_MASK(ide_drive_t *, int);
|
||||
u8 ide_read_error(ide_drive_t *);
|
||||
void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *);
|
||||
|
||||
int ide_check_ireason(ide_drive_t *, struct request *, int, int, int);
|
||||
|
||||
int ide_check_atapi_device(ide_drive_t *, const char *);
|
||||
|
||||
void ide_init_pc(struct ide_atapi_pc *);
|
||||
@@ -1168,13 +1141,17 @@ enum {
|
||||
REQ_IDETAPE_WRITE = (1 << 3),
|
||||
};
|
||||
|
||||
int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *);
|
||||
int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *,
|
||||
void *, unsigned int);
|
||||
|
||||
int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *);
|
||||
int ide_do_start_stop(ide_drive_t *, struct gendisk *, int);
|
||||
int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
|
||||
void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *);
|
||||
void ide_retry_pc(ide_drive_t *, struct gendisk *);
|
||||
void ide_retry_pc(ide_drive_t *drive);
|
||||
|
||||
void ide_prep_sense(ide_drive_t *drive, struct request *rq);
|
||||
int ide_queue_sense_rq(ide_drive_t *drive, void *special);
|
||||
|
||||
int ide_cd_expiry(ide_drive_t *);
|
||||
|
||||
@@ -1225,7 +1202,7 @@ static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev)
|
||||
}
|
||||
|
||||
void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *,
|
||||
hw_regs_t *, hw_regs_t **);
|
||||
struct ide_hw *, struct ide_hw **);
|
||||
void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
|
||||
@@ -1464,16 +1441,18 @@ static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {}
|
||||
void ide_register_region(struct gendisk *);
|
||||
void ide_unregister_region(struct gendisk *);
|
||||
|
||||
void ide_check_nien_quirk_list(ide_drive_t *);
|
||||
void ide_undecoded_slave(ide_drive_t *);
|
||||
|
||||
void ide_port_apply_params(ide_hwif_t *);
|
||||
int ide_sysfs_register_port(ide_hwif_t *);
|
||||
|
||||
struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **);
|
||||
struct ide_host *ide_host_alloc(const struct ide_port_info *, struct ide_hw **,
|
||||
unsigned int);
|
||||
void ide_host_free(struct ide_host *);
|
||||
int ide_host_register(struct ide_host *, const struct ide_port_info *,
|
||||
hw_regs_t **);
|
||||
int ide_host_add(const struct ide_port_info *, hw_regs_t **,
|
||||
struct ide_hw **);
|
||||
int ide_host_add(const struct ide_port_info *, struct ide_hw **, unsigned int,
|
||||
struct ide_host **);
|
||||
void ide_host_remove(struct ide_host *);
|
||||
int ide_legacy_device_add(const struct ide_port_info *, unsigned long);
|
||||
@@ -1533,6 +1512,7 @@ int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int);
|
||||
int ide_scan_pio_blacklist(char *);
|
||||
const char *ide_xfer_verbose(u8);
|
||||
u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
|
||||
int ide_pio_need_iordy(ide_drive_t *, const u8);
|
||||
int ide_set_pio_mode(ide_drive_t *, u8);
|
||||
int ide_set_dma_mode(ide_drive_t *, u8);
|
||||
void ide_set_pio(ide_drive_t *, u8);
|
||||
@@ -1570,6 +1550,16 @@ static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive)
|
||||
return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL;
|
||||
}
|
||||
|
||||
static inline void *ide_get_drivedata(ide_drive_t *drive)
|
||||
{
|
||||
return drive->drive_data;
|
||||
}
|
||||
|
||||
static inline void ide_set_drivedata(ide_drive_t *drive, void *data)
|
||||
{
|
||||
drive->drive_data = data;
|
||||
}
|
||||
|
||||
#define ide_port_for_each_dev(i, dev, port) \
|
||||
for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++)
|
||||
|
||||
|
@@ -493,6 +493,7 @@ struct ieee80211s_hdr {
|
||||
/* Mesh flags */
|
||||
#define MESH_FLAGS_AE_A4 0x1
|
||||
#define MESH_FLAGS_AE_A5_A6 0x2
|
||||
#define MESH_FLAGS_AE 0x3
|
||||
#define MESH_FLAGS_PS_DEEP 0x4
|
||||
|
||||
/**
|
||||
@@ -540,10 +541,10 @@ struct ieee80211_tim_ie {
|
||||
u8 dtim_period;
|
||||
u8 bitmap_ctrl;
|
||||
/* variable size: 1 - 251 bytes */
|
||||
u8 virtual_map[0];
|
||||
u8 virtual_map[1];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define WLAN_SA_QUERY_TR_ID_LEN 16
|
||||
#define WLAN_SA_QUERY_TR_ID_LEN 2
|
||||
|
||||
struct ieee80211_mgmt {
|
||||
__le16 frame_control;
|
||||
@@ -1068,8 +1069,12 @@ enum ieee80211_category {
|
||||
WLAN_CATEGORY_DLS = 2,
|
||||
WLAN_CATEGORY_BACK = 3,
|
||||
WLAN_CATEGORY_PUBLIC = 4,
|
||||
WLAN_CATEGORY_HT = 7,
|
||||
WLAN_CATEGORY_SA_QUERY = 8,
|
||||
WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
|
||||
WLAN_CATEGORY_WMM = 17,
|
||||
WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
|
||||
WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
|
||||
};
|
||||
|
||||
/* SPECTRUM_MGMT action code */
|
||||
@@ -1081,6 +1086,15 @@ enum ieee80211_spectrum_mgmt_actioncode {
|
||||
WLAN_ACTION_SPCT_CHL_SWITCH = 4,
|
||||
};
|
||||
|
||||
/* Security key length */
|
||||
enum ieee80211_key_len {
|
||||
WLAN_KEY_LEN_WEP40 = 5,
|
||||
WLAN_KEY_LEN_WEP104 = 13,
|
||||
WLAN_KEY_LEN_CCMP = 16,
|
||||
WLAN_KEY_LEN_TKIP = 32,
|
||||
WLAN_KEY_LEN_AES_CMAC = 16,
|
||||
};
|
||||
|
||||
/*
|
||||
* IEEE 802.11-2007 7.3.2.9 Country information element
|
||||
*
|
||||
@@ -1261,7 +1275,9 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
|
||||
if (ieee80211_has_protected(hdr->frame_control))
|
||||
return true;
|
||||
category = ((u8 *) hdr) + 24;
|
||||
return *category != WLAN_CATEGORY_PUBLIC;
|
||||
return *category != WLAN_CATEGORY_PUBLIC &&
|
||||
*category != WLAN_CATEGORY_HT &&
|
||||
*category != WLAN_CATEGORY_VENDOR_SPECIFIC;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -1383,4 +1399,43 @@ static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_tu_to_usec - convert time units (TU) to microseconds
|
||||
* @tu: the TUs
|
||||
*/
|
||||
static inline unsigned long ieee80211_tu_to_usec(unsigned long tu)
|
||||
{
|
||||
return 1024 * tu;
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee80211_check_tim - check if AID bit is set in TIM
|
||||
* @tim: the TIM IE
|
||||
* @tim_len: length of the TIM IE
|
||||
* @aid: the AID to look for
|
||||
*/
|
||||
static inline bool ieee80211_check_tim(struct ieee80211_tim_ie *tim,
|
||||
u8 tim_len, u16 aid)
|
||||
{
|
||||
u8 mask;
|
||||
u8 index, indexn1, indexn2;
|
||||
|
||||
if (unlikely(!tim || tim_len < sizeof(*tim)))
|
||||
return false;
|
||||
|
||||
aid &= 0x3fff;
|
||||
index = aid / 8;
|
||||
mask = 1 << (aid & 7);
|
||||
|
||||
indexn1 = tim->bitmap_ctrl & 0xfe;
|
||||
indexn2 = tim_len + indexn1 - 4;
|
||||
|
||||
if (index < indexn1 || index > indexn2)
|
||||
return false;
|
||||
|
||||
index -= indexn1;
|
||||
|
||||
return !!(tim->virtual_map[index] & mask);
|
||||
}
|
||||
|
||||
#endif /* LINUX_IEEE80211_H */
|
||||
|
@@ -67,6 +67,9 @@
|
||||
#define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */
|
||||
#define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */
|
||||
#define IFF_WAN_HDLC 0x200 /* WAN HDLC device */
|
||||
#define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to
|
||||
* release skb->dst
|
||||
*/
|
||||
|
||||
#define IF_GET_IFACE 0x0001 /* for querying only */
|
||||
#define IF_GET_PROTO 0x0002
|
||||
|
@@ -86,6 +86,8 @@
|
||||
#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
|
||||
#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
|
||||
#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
|
||||
#define ARPHRD_IEEE802154 804
|
||||
#define ARPHRD_IEEE802154_PHY 805
|
||||
|
||||
#define ARPHRD_PHONET 820 /* PhoNet media type */
|
||||
#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
|
||||
|
@@ -79,6 +79,7 @@
|
||||
#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
|
||||
#define ETH_P_TIPC 0x88CA /* TIPC */
|
||||
#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
|
||||
#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
|
||||
#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
|
||||
|
||||
/*
|
||||
@@ -106,6 +107,7 @@
|
||||
#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
|
||||
#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
|
||||
#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
|
||||
#define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */
|
||||
|
||||
/*
|
||||
* This is an Ethernet frame header.
|
||||
|
@@ -46,6 +46,8 @@ struct sockaddr_ll
|
||||
#define PACKET_VERSION 10
|
||||
#define PACKET_HDRLEN 11
|
||||
#define PACKET_RESERVE 12
|
||||
#define PACKET_TX_RING 13
|
||||
#define PACKET_LOSS 14
|
||||
|
||||
struct tpacket_stats
|
||||
{
|
||||
@@ -63,14 +65,22 @@ struct tpacket_auxdata
|
||||
__u16 tp_vlan_tci;
|
||||
};
|
||||
|
||||
/* Rx ring - header status */
|
||||
#define TP_STATUS_KERNEL 0x0
|
||||
#define TP_STATUS_USER 0x1
|
||||
#define TP_STATUS_COPY 0x2
|
||||
#define TP_STATUS_LOSING 0x4
|
||||
#define TP_STATUS_CSUMNOTREADY 0x8
|
||||
|
||||
/* Tx ring - header status */
|
||||
#define TP_STATUS_AVAILABLE 0x0
|
||||
#define TP_STATUS_SEND_REQUEST 0x1
|
||||
#define TP_STATUS_SENDING 0x2
|
||||
#define TP_STATUS_WRONG_FORMAT 0x4
|
||||
|
||||
struct tpacket_hdr
|
||||
{
|
||||
unsigned long tp_status;
|
||||
#define TP_STATUS_KERNEL 0
|
||||
#define TP_STATUS_USER 1
|
||||
#define TP_STATUS_COPY 2
|
||||
#define TP_STATUS_LOSING 4
|
||||
#define TP_STATUS_CSUMNOTREADY 8
|
||||
unsigned int tp_len;
|
||||
unsigned int tp_snaplen;
|
||||
unsigned short tp_mac;
|
||||
@@ -135,5 +145,6 @@ struct packet_mreq
|
||||
#define PACKET_MR_MULTICAST 0
|
||||
#define PACKET_MR_PROMISC 1
|
||||
#define PACKET_MR_ALLMULTI 2
|
||||
#define PACKET_MR_UNICAST 3
|
||||
|
||||
#endif
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#define IFF_NO_PI 0x1000
|
||||
#define IFF_ONE_QUEUE 0x2000
|
||||
#define IFF_VNET_HDR 0x4000
|
||||
#define IFF_TUN_EXCL 0x8000
|
||||
|
||||
/* Features for GSO (TUNSETOFFLOAD). */
|
||||
#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
|
||||
|
@@ -44,7 +44,7 @@ struct ip_tunnel_prl {
|
||||
__u16 flags;
|
||||
__u16 __reserved;
|
||||
__u32 datalen;
|
||||
__u32 __reserved2;
|
||||
__u32 rs_delay;
|
||||
/* data follows */
|
||||
};
|
||||
|
||||
|
@@ -118,8 +118,7 @@ extern int vlan_hwaccel_do_receive(struct sk_buff *skb);
|
||||
extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
|
||||
unsigned int vlan_tci, struct sk_buff *skb);
|
||||
extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
|
||||
unsigned int vlan_tci,
|
||||
struct napi_gro_fraginfo *info);
|
||||
unsigned int vlan_tci);
|
||||
|
||||
#else
|
||||
static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
|
||||
@@ -154,8 +153,7 @@ static inline int vlan_gro_receive(struct napi_struct *napi,
|
||||
}
|
||||
|
||||
static inline int vlan_gro_frags(struct napi_struct *napi,
|
||||
struct vlan_group *grp, unsigned int vlan_tci,
|
||||
struct napi_gro_fraginfo *info)
|
||||
struct vlan_group *grp, unsigned int vlan_tci)
|
||||
{
|
||||
return NET_RX_DROP;
|
||||
}
|
||||
|
@@ -13,14 +13,17 @@
|
||||
#include <linux/fs.h>
|
||||
struct linux_binprm;
|
||||
|
||||
#define IMA_COUNT_UPDATE 1
|
||||
#define IMA_COUNT_LEAVE 0
|
||||
|
||||
#ifdef CONFIG_IMA
|
||||
extern int ima_bprm_check(struct linux_binprm *bprm);
|
||||
extern int ima_inode_alloc(struct inode *inode);
|
||||
extern void ima_inode_free(struct inode *inode);
|
||||
extern int ima_path_check(struct path *path, int mask);
|
||||
extern int ima_path_check(struct path *path, int mask, int update_counts);
|
||||
extern void ima_file_free(struct file *file);
|
||||
extern int ima_file_mmap(struct file *file, unsigned long prot);
|
||||
extern void ima_shm_check(struct file *file);
|
||||
extern void ima_counts_get(struct file *file);
|
||||
|
||||
#else
|
||||
static inline int ima_bprm_check(struct linux_binprm *bprm)
|
||||
@@ -38,7 +41,7 @@ static inline void ima_inode_free(struct inode *inode)
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int ima_path_check(struct path *path, int mask)
|
||||
static inline int ima_path_check(struct path *path, int mask, int update_counts)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -53,7 +56,7 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void ima_shm_check(struct file *file)
|
||||
static inline void ima_counts_get(struct file *file)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -107,6 +107,7 @@ struct in_addr {
|
||||
#define MCAST_JOIN_SOURCE_GROUP 46
|
||||
#define MCAST_LEAVE_SOURCE_GROUP 47
|
||||
#define MCAST_MSFILTER 48
|
||||
#define IP_MULTICAST_ALL 49
|
||||
|
||||
#define MCAST_EXCLUDE 0
|
||||
#define MCAST_INCLUDE 1
|
||||
|
@@ -2,8 +2,6 @@
|
||||
#define _LINUX_INIT_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/section-names.h>
|
||||
#include <linux/stringify.h>
|
||||
|
||||
/* These macros are used to mark some functions or
|
||||
* initialized data (doesn't apply to uninitialized data)
|
||||
@@ -31,7 +29,7 @@
|
||||
* sign followed by value, e.g.:
|
||||
*
|
||||
* static int init_variable __initdata = 0;
|
||||
* static char linux_logo[] __initdata = { 0x32, 0x36, ... };
|
||||
* static const char linux_logo[] __initconst = { 0x32, 0x36, ... };
|
||||
*
|
||||
* Don't forget to initialize data not at file scope, i.e. within a function,
|
||||
* as gcc otherwise puts the data into the bss section and not into the init
|
||||
@@ -101,7 +99,7 @@
|
||||
#define __memexitconst __section(.memexit.rodata)
|
||||
|
||||
/* For assembly routines */
|
||||
#define __HEAD .section __stringify(HEAD_TEXT_SECTION),"ax"
|
||||
#define __HEAD .section ".head.text","ax"
|
||||
#define __INIT .section ".init.text","ax"
|
||||
#define __FINIT .previous
|
||||
|
||||
@@ -136,6 +134,9 @@ typedef void (*exitcall_t)(void);
|
||||
extern initcall_t __con_initcall_start[], __con_initcall_end[];
|
||||
extern initcall_t __security_initcall_start[], __security_initcall_end[];
|
||||
|
||||
/* Used for contructor calls. */
|
||||
typedef void (*ctor_fn_t)(void);
|
||||
|
||||
/* Defined in init/main.c */
|
||||
extern int do_one_initcall(initcall_t fn);
|
||||
extern char __initdata boot_command_line[];
|
||||
@@ -225,7 +226,8 @@ struct obs_kernel_param {
|
||||
* obs_kernel_param "array" too far apart in .init.setup.
|
||||
*/
|
||||
#define __setup_param(str, unique_id, fn, early) \
|
||||
static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \
|
||||
static const char __setup_str_##unique_id[] __initconst \
|
||||
__aligned(1) = str; \
|
||||
static struct obs_kernel_param __setup_##unique_id \
|
||||
__used __section(.init.setup) \
|
||||
__attribute__((aligned((sizeof(long))))) \
|
||||
|
@@ -15,18 +15,6 @@
|
||||
extern struct files_struct init_files;
|
||||
extern struct fs_struct init_fs;
|
||||
|
||||
#define INIT_MM(name) \
|
||||
{ \
|
||||
.mm_rb = RB_ROOT, \
|
||||
.pgd = swapper_pg_dir, \
|
||||
.mm_users = ATOMIC_INIT(2), \
|
||||
.mm_count = ATOMIC_INIT(1), \
|
||||
.mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \
|
||||
.page_table_lock = __SPIN_LOCK_UNLOCKED(name.page_table_lock), \
|
||||
.mmlist = LIST_HEAD_INIT(name.mmlist), \
|
||||
.cpu_vm_mask = CPU_MASK_ALL, \
|
||||
}
|
||||
|
||||
#define INIT_SIGNALS(sig) { \
|
||||
.count = ATOMIC_INIT(1), \
|
||||
.wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
|
||||
@@ -108,6 +96,15 @@ extern struct group_info init_groups;
|
||||
|
||||
extern struct cred init_cred;
|
||||
|
||||
#ifdef CONFIG_PERF_COUNTERS
|
||||
# define INIT_PERF_COUNTERS(tsk) \
|
||||
.perf_counter_mutex = \
|
||||
__MUTEX_INITIALIZER(tsk.perf_counter_mutex), \
|
||||
.perf_counter_list = LIST_HEAD_INIT(tsk.perf_counter_list),
|
||||
#else
|
||||
# define INIT_PERF_COUNTERS(tsk)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* INIT_TASK is used to set up the first task table, touch at
|
||||
* your own risk!. Base=0, limit=0x1fffff (=2MB)
|
||||
@@ -145,8 +142,8 @@ extern struct cred init_cred;
|
||||
.group_leader = &tsk, \
|
||||
.real_cred = &init_cred, \
|
||||
.cred = &init_cred, \
|
||||
.cred_exec_mutex = \
|
||||
__MUTEX_INITIALIZER(tsk.cred_exec_mutex), \
|
||||
.cred_guard_mutex = \
|
||||
__MUTEX_INITIALIZER(tsk.cred_guard_mutex), \
|
||||
.comm = "swapper", \
|
||||
.thread = INIT_THREAD, \
|
||||
.fs = &init_fs, \
|
||||
@@ -171,9 +168,11 @@ extern struct cred init_cred;
|
||||
}, \
|
||||
.dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
|
||||
INIT_IDS \
|
||||
INIT_PERF_COUNTERS(tsk) \
|
||||
INIT_TRACE_IRQFLAGS \
|
||||
INIT_LOCKDEP \
|
||||
INIT_FTRACE_GRAPH \
|
||||
INIT_TRACE_RECURSION \
|
||||
}
|
||||
|
||||
|
||||
|
@@ -53,6 +53,7 @@ struct input_absinfo {
|
||||
__s32 maximum;
|
||||
__s32 fuzz;
|
||||
__s32 flat;
|
||||
__s32 resolution;
|
||||
};
|
||||
|
||||
#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
|
||||
@@ -1109,6 +1110,7 @@ struct input_dev {
|
||||
int absmin[ABS_MAX + 1];
|
||||
int absfuzz[ABS_MAX + 1];
|
||||
int absflat[ABS_MAX + 1];
|
||||
int absres[ABS_MAX + 1];
|
||||
|
||||
int (*open)(struct input_dev *dev);
|
||||
void (*close)(struct input_dev *dev);
|
||||
|
@@ -53,6 +53,7 @@
|
||||
#define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */
|
||||
#define DMAR_IQH_REG 0x80 /* Invalidation queue head register */
|
||||
#define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */
|
||||
#define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */
|
||||
#define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */
|
||||
#define DMAR_ICS_REG 0x98 /* Invalidation complete status register */
|
||||
#define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */
|
||||
@@ -120,8 +121,10 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
|
||||
(ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16)
|
||||
#define ecap_coherent(e) ((e) & 0x1)
|
||||
#define ecap_qis(e) ((e) & 0x2)
|
||||
#define ecap_pass_through(e) ((e >> 6) & 0x1)
|
||||
#define ecap_eim_support(e) ((e >> 4) & 0x1)
|
||||
#define ecap_ir_support(e) ((e >> 3) & 0x1)
|
||||
#define ecap_dev_iotlb_support(e) (((e) >> 2) & 0x1)
|
||||
#define ecap_max_handle_mask(e) ((e >> 20) & 0xf)
|
||||
#define ecap_sc_support(e) ((e >> 7) & 0x1) /* Snooping Control */
|
||||
|
||||
@@ -197,6 +200,8 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
|
||||
#define DMA_FSTS_PPF ((u32)2)
|
||||
#define DMA_FSTS_PFO ((u32)1)
|
||||
#define DMA_FSTS_IQE (1 << 4)
|
||||
#define DMA_FSTS_ICE (1 << 5)
|
||||
#define DMA_FSTS_ITE (1 << 6)
|
||||
#define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
|
||||
|
||||
/* FRCD_REG, 32 bits access */
|
||||
@@ -225,7 +230,8 @@ do { \
|
||||
enum {
|
||||
QI_FREE,
|
||||
QI_IN_USE,
|
||||
QI_DONE
|
||||
QI_DONE,
|
||||
QI_ABORT
|
||||
};
|
||||
|
||||
#define QI_CC_TYPE 0x1
|
||||
@@ -254,6 +260,12 @@ enum {
|
||||
#define QI_CC_DID(did) (((u64)did) << 16)
|
||||
#define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4))
|
||||
|
||||
#define QI_DEV_IOTLB_SID(sid) ((u64)((sid) & 0xffff) << 32)
|
||||
#define QI_DEV_IOTLB_QDEP(qdep) (((qdep) & 0x1f) << 16)
|
||||
#define QI_DEV_IOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK)
|
||||
#define QI_DEV_IOTLB_SIZE 1
|
||||
#define QI_DEV_IOTLB_MAX_INVS 32
|
||||
|
||||
struct qi_desc {
|
||||
u64 low, high;
|
||||
};
|
||||
@@ -280,10 +292,10 @@ struct ir_table {
|
||||
#endif
|
||||
|
||||
struct iommu_flush {
|
||||
int (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm,
|
||||
u64 type, int non_present_entry_flush);
|
||||
int (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr,
|
||||
unsigned int size_order, u64 type, int non_present_entry_flush);
|
||||
void (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid,
|
||||
u8 fm, u64 type);
|
||||
void (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr,
|
||||
unsigned int size_order, u64 type);
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -302,6 +314,7 @@ struct intel_iommu {
|
||||
spinlock_t register_lock; /* protect register handling */
|
||||
int seq_id; /* sequence id of the iommu */
|
||||
int agaw; /* agaw of this iommu */
|
||||
int msagaw; /* max sagaw of this iommu */
|
||||
unsigned int irq;
|
||||
unsigned char name[13]; /* Device Name */
|
||||
|
||||
@@ -329,6 +342,7 @@ static inline void __iommu_flush_cache(
|
||||
}
|
||||
|
||||
extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev);
|
||||
extern int dmar_find_matched_atsr_unit(struct pci_dev *dev);
|
||||
|
||||
extern int alloc_iommu(struct dmar_drhd_unit *drhd);
|
||||
extern void free_iommu(struct intel_iommu *iommu);
|
||||
@@ -337,11 +351,12 @@ extern void dmar_disable_qi(struct intel_iommu *iommu);
|
||||
extern int dmar_reenable_qi(struct intel_iommu *iommu);
|
||||
extern void qi_global_iec(struct intel_iommu *iommu);
|
||||
|
||||
extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid,
|
||||
u8 fm, u64 type, int non_present_entry_flush);
|
||||
extern int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
|
||||
unsigned int size_order, u64 type,
|
||||
int non_present_entry_flush);
|
||||
extern void qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid,
|
||||
u8 fm, u64 type);
|
||||
extern void qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
|
||||
unsigned int size_order, u64 type);
|
||||
extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep,
|
||||
u64 addr, unsigned mask);
|
||||
|
||||
extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
|
||||
|
||||
|
@@ -183,6 +183,7 @@ extern void disable_irq(unsigned int irq);
|
||||
extern void enable_irq(unsigned int irq);
|
||||
|
||||
/* The following three functions are for the core kernel use only. */
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS
|
||||
extern void suspend_device_irqs(void);
|
||||
extern void resume_device_irqs(void);
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
@@ -190,6 +191,11 @@ extern int check_wakeup_irqs(void);
|
||||
#else
|
||||
static inline int check_wakeup_irqs(void) { return 0; }
|
||||
#endif
|
||||
#else
|
||||
static inline void suspend_device_irqs(void) { };
|
||||
static inline void resume_device_irqs(void) { };
|
||||
static inline int check_wakeup_irqs(void) { return 0; }
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
|
||||
|
||||
@@ -466,6 +472,20 @@ static inline void tasklet_hi_schedule(struct tasklet_struct *t)
|
||||
__tasklet_hi_schedule(t);
|
||||
}
|
||||
|
||||
extern void __tasklet_hi_schedule_first(struct tasklet_struct *t);
|
||||
|
||||
/*
|
||||
* This version avoids touching any other tasklets. Needed for kmemcheck
|
||||
* in order not to take any page faults while enqueueing this tasklet;
|
||||
* consider VERY carefully whether you really need this or
|
||||
* tasklet_hi_schedule()...
|
||||
*/
|
||||
static inline void tasklet_hi_schedule_first(struct tasklet_struct *t)
|
||||
{
|
||||
if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state))
|
||||
__tasklet_hi_schedule_first(t);
|
||||
}
|
||||
|
||||
|
||||
static inline void tasklet_disable_nosync(struct tasklet_struct *t)
|
||||
{
|
||||
@@ -566,6 +586,6 @@ struct irq_desc;
|
||||
extern int early_irq_init(void);
|
||||
extern int arch_probe_nr_irqs(void);
|
||||
extern int arch_early_irq_init(void);
|
||||
extern int arch_init_chip_data(struct irq_desc *desc, int cpu);
|
||||
extern int arch_init_chip_data(struct irq_desc *desc, int node);
|
||||
|
||||
#endif
|
||||
|
@@ -64,7 +64,7 @@ struct cfq_io_context {
|
||||
* and kmalloc'ed. These could be shared between processes.
|
||||
*/
|
||||
struct io_context {
|
||||
atomic_t refcount;
|
||||
atomic_long_t refcount;
|
||||
atomic_t nr_tasks;
|
||||
|
||||
/* all the fields below are protected by this lock */
|
||||
@@ -91,8 +91,8 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
|
||||
* if ref count is zero, don't allow sharing (ioc is going away, it's
|
||||
* a race).
|
||||
*/
|
||||
if (ioc && atomic_inc_not_zero(&ioc->refcount)) {
|
||||
atomic_inc(&ioc->nr_tasks);
|
||||
if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) {
|
||||
atomic_long_inc(&ioc->refcount);
|
||||
return ioc;
|
||||
}
|
||||
|
||||
|
@@ -49,6 +49,8 @@ struct resource_list {
|
||||
#define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */
|
||||
#define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */
|
||||
|
||||
#define IORESOURCE_MEM_64 0x00100000
|
||||
|
||||
#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
|
||||
#define IORESOURCE_DISABLED 0x10000000
|
||||
#define IORESOURCE_UNSET 0x20000000
|
||||
|
@@ -94,13 +94,8 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; }
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_IPC_NS)
|
||||
extern void free_ipc_ns(struct ipc_namespace *ns);
|
||||
extern struct ipc_namespace *copy_ipcs(unsigned long flags,
|
||||
struct ipc_namespace *ns);
|
||||
extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
|
||||
void (*free)(struct ipc_namespace *,
|
||||
struct kern_ipc_perm *));
|
||||
|
||||
static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
|
||||
{
|
||||
if (ns)
|
||||
|
@@ -169,6 +169,12 @@ struct ipv6_devconf {
|
||||
__s32 accept_dad;
|
||||
void *sysctl;
|
||||
};
|
||||
|
||||
struct ipv6_params {
|
||||
__s32 disable_ipv6;
|
||||
__s32 autoconf;
|
||||
};
|
||||
extern struct ipv6_params ipv6_defaults;
|
||||
#endif
|
||||
|
||||
/* index values for the variables in ipv6_devconf */
|
||||
|
@@ -117,7 +117,7 @@ struct irq_chip {
|
||||
void (*eoi)(unsigned int irq);
|
||||
|
||||
void (*end)(unsigned int irq);
|
||||
void (*set_affinity)(unsigned int irq,
|
||||
int (*set_affinity)(unsigned int irq,
|
||||
const struct cpumask *dest);
|
||||
int (*retrigger)(unsigned int irq);
|
||||
int (*set_type)(unsigned int irq, unsigned int flow_type);
|
||||
@@ -157,7 +157,7 @@ struct irq_2_iommu;
|
||||
* @irqs_unhandled: stats field for spurious unhandled interrupts
|
||||
* @lock: locking for SMP
|
||||
* @affinity: IRQ affinity on SMP
|
||||
* @cpu: cpu index useful for balancing
|
||||
* @node: node index useful for balancing
|
||||
* @pending_mask: pending rebalanced interrupts
|
||||
* @threads_active: number of irqaction threads currently running
|
||||
* @wait_for_threads: wait queue for sync_irq to wait for threaded handlers
|
||||
@@ -187,7 +187,7 @@ struct irq_desc {
|
||||
spinlock_t lock;
|
||||
#ifdef CONFIG_SMP
|
||||
cpumask_var_t affinity;
|
||||
unsigned int cpu;
|
||||
unsigned int node;
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
cpumask_var_t pending_mask;
|
||||
#endif
|
||||
@@ -201,26 +201,23 @@ struct irq_desc {
|
||||
} ____cacheline_internodealigned_in_smp;
|
||||
|
||||
extern void arch_init_copy_chip_data(struct irq_desc *old_desc,
|
||||
struct irq_desc *desc, int cpu);
|
||||
struct irq_desc *desc, int node);
|
||||
extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc);
|
||||
|
||||
#ifndef CONFIG_SPARSE_IRQ
|
||||
extern struct irq_desc irq_desc[NR_IRQS];
|
||||
#else /* CONFIG_SPARSE_IRQ */
|
||||
extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
|
||||
#endif /* CONFIG_SPARSE_IRQ */
|
||||
|
||||
extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
|
||||
|
||||
static inline struct irq_desc *
|
||||
irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
|
||||
return irq_to_desc(irq);
|
||||
#else
|
||||
return desc;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NUMA_IRQ_DESC
|
||||
extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int node);
|
||||
#else
|
||||
static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
|
||||
{
|
||||
return desc;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
|
||||
|
||||
/*
|
||||
* Migration helpers for obsolete names, they will go away:
|
||||
@@ -386,7 +383,7 @@ extern void set_irq_noprobe(unsigned int irq);
|
||||
extern void set_irq_probe(unsigned int irq);
|
||||
|
||||
/* Handle dynamic irq creation and destruction */
|
||||
extern unsigned int create_irq_nr(unsigned int irq_want);
|
||||
extern unsigned int create_irq_nr(unsigned int irq_want, int node);
|
||||
extern int create_irq(void);
|
||||
extern void destroy_irq(unsigned int irq);
|
||||
|
||||
@@ -424,47 +421,44 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/**
|
||||
* init_alloc_desc_masks - allocate cpumasks for irq_desc
|
||||
* alloc_desc_masks - allocate cpumasks for irq_desc
|
||||
* @desc: pointer to irq_desc struct
|
||||
* @cpu: cpu which will be handling the cpumasks
|
||||
* @node: node which will be handling the cpumasks
|
||||
* @boot: true if need bootmem
|
||||
*
|
||||
* Allocates affinity and pending_mask cpumask if required.
|
||||
* Returns true if successful (or not required).
|
||||
* Side effect: affinity has all bits set, pending_mask has all bits clear.
|
||||
*/
|
||||
static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
||||
bool boot)
|
||||
static inline bool alloc_desc_masks(struct irq_desc *desc, int node,
|
||||
bool boot)
|
||||
{
|
||||
int node;
|
||||
gfp_t gfp = GFP_ATOMIC;
|
||||
|
||||
if (boot) {
|
||||
alloc_bootmem_cpumask_var(&desc->affinity);
|
||||
cpumask_setall(desc->affinity);
|
||||
if (boot)
|
||||
gfp = GFP_NOWAIT;
|
||||
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
alloc_bootmem_cpumask_var(&desc->pending_mask);
|
||||
cpumask_clear(desc->pending_mask);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
node = cpu_to_node(cpu);
|
||||
|
||||
if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node))
|
||||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
if (!alloc_cpumask_var_node(&desc->affinity, gfp, node))
|
||||
return false;
|
||||
cpumask_setall(desc->affinity);
|
||||
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) {
|
||||
if (!alloc_cpumask_var_node(&desc->pending_mask, gfp, node)) {
|
||||
free_cpumask_var(desc->affinity);
|
||||
return false;
|
||||
}
|
||||
cpumask_clear(desc->pending_mask);
|
||||
#endif
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void init_desc_masks(struct irq_desc *desc)
|
||||
{
|
||||
cpumask_setall(desc->affinity);
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
cpumask_clear(desc->pending_mask);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* init_copy_desc_masks - copy cpumasks for irq_desc
|
||||
* @old_desc: pointer to old irq_desc struct
|
||||
@@ -478,7 +472,7 @@ static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
||||
static inline void init_copy_desc_masks(struct irq_desc *old_desc,
|
||||
struct irq_desc *new_desc)
|
||||
{
|
||||
#ifdef CONFIG_CPUMASKS_OFFSTACK
|
||||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
cpumask_copy(new_desc->affinity, old_desc->affinity);
|
||||
|
||||
#ifdef CONFIG_GENERIC_PENDING_IRQ
|
||||
@@ -499,12 +493,16 @@ static inline void free_desc_masks(struct irq_desc *old_desc,
|
||||
|
||||
#else /* !CONFIG_SMP */
|
||||
|
||||
static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
|
||||
static inline bool alloc_desc_masks(struct irq_desc *desc, int node,
|
||||
bool boot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void init_desc_masks(struct irq_desc *desc)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void init_copy_desc_masks(struct irq_desc *old_desc,
|
||||
struct irq_desc *new_desc)
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user