mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
Merge branch 'fortglx/3.7/time' of git://git.linaro.org/people/jstultz/linux into timers/core
This commit is contained in:
commit
db8c246937
8069 changed files with 470633 additions and 200995 deletions
|
|
@ -183,7 +183,6 @@ header-y += if_ppp.h
|
|||
header-y += if_pppol2tp.h
|
||||
header-y += if_pppox.h
|
||||
header-y += if_slip.h
|
||||
header-y += if_strip.h
|
||||
header-y += if_team.h
|
||||
header-y += if_tun.h
|
||||
header-y += if_tunnel.h
|
||||
|
|
@ -376,6 +375,7 @@ header-y += tty.h
|
|||
header-y += types.h
|
||||
header-y += udf_fs_i.h
|
||||
header-y += udp.h
|
||||
header-y += uhid.h
|
||||
header-y += uinput.h
|
||||
header-y += uio.h
|
||||
header-y += ultrasound.h
|
||||
|
|
@ -386,10 +386,12 @@ header-y += utime.h
|
|||
header-y += utsname.h
|
||||
header-y += uuid.h
|
||||
header-y += uvcvideo.h
|
||||
header-y += v4l2-common.h
|
||||
header-y += v4l2-dv-timings.h
|
||||
header-y += v4l2-mediabus.h
|
||||
header-y += v4l2-subdev.h
|
||||
header-y += veth.h
|
||||
header-y += vfio.h
|
||||
header-y += vhost.h
|
||||
header-y += videodev2.h
|
||||
header-y += virtio_9p.h
|
||||
|
|
|
|||
|
|
@ -1,362 +0,0 @@
|
|||
#ifndef _AC97_CODEC_H_
|
||||
#define _AC97_CODEC_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/soundcard.h>
|
||||
|
||||
/* AC97 1.0 */
|
||||
#define AC97_RESET 0x0000 //
|
||||
#define AC97_MASTER_VOL_STEREO 0x0002 // Line Out
|
||||
#define AC97_HEADPHONE_VOL 0x0004 //
|
||||
#define AC97_MASTER_VOL_MONO 0x0006 // TAD Output
|
||||
#define AC97_MASTER_TONE 0x0008 //
|
||||
#define AC97_PCBEEP_VOL 0x000a // none
|
||||
#define AC97_PHONE_VOL 0x000c // TAD Input (mono)
|
||||
#define AC97_MIC_VOL 0x000e // MIC Input (mono)
|
||||
#define AC97_LINEIN_VOL 0x0010 // Line Input (stereo)
|
||||
#define AC97_CD_VOL 0x0012 // CD Input (stereo)
|
||||
#define AC97_VIDEO_VOL 0x0014 // none
|
||||
#define AC97_AUX_VOL 0x0016 // Aux Input (stereo)
|
||||
#define AC97_PCMOUT_VOL 0x0018 // Wave Output (stereo)
|
||||
#define AC97_RECORD_SELECT 0x001a //
|
||||
#define AC97_RECORD_GAIN 0x001c
|
||||
#define AC97_RECORD_GAIN_MIC 0x001e
|
||||
#define AC97_GENERAL_PURPOSE 0x0020
|
||||
#define AC97_3D_CONTROL 0x0022
|
||||
#define AC97_MODEM_RATE 0x0024
|
||||
#define AC97_POWER_CONTROL 0x0026
|
||||
|
||||
/* AC'97 2.0 */
|
||||
#define AC97_EXTENDED_ID 0x0028 /* Extended Audio ID */
|
||||
#define AC97_EXTENDED_STATUS 0x002A /* Extended Audio Status */
|
||||
#define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */
|
||||
#define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */
|
||||
#define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */
|
||||
#define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR ADC Rate */
|
||||
#define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */
|
||||
#define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */
|
||||
#define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */
|
||||
#define AC97_RESERVED_3A 0x003A /* Reserved in AC '97 < 2.2 */
|
||||
|
||||
/* AC'97 2.2 */
|
||||
#define AC97_SPDIF_CONTROL 0x003A /* S/PDIF Control */
|
||||
|
||||
/* range 0x3c-0x58 - MODEM */
|
||||
#define AC97_EXTENDED_MODEM_ID 0x003C
|
||||
#define AC97_EXTEND_MODEM_STAT 0x003E
|
||||
#define AC97_LINE1_RATE 0x0040
|
||||
#define AC97_LINE2_RATE 0x0042
|
||||
#define AC97_HANDSET_RATE 0x0044
|
||||
#define AC97_LINE1_LEVEL 0x0046
|
||||
#define AC97_LINE2_LEVEL 0x0048
|
||||
#define AC97_HANDSET_LEVEL 0x004A
|
||||
#define AC97_GPIO_CONFIG 0x004C
|
||||
#define AC97_GPIO_POLARITY 0x004E
|
||||
#define AC97_GPIO_STICKY 0x0050
|
||||
#define AC97_GPIO_WAKE_UP 0x0052
|
||||
#define AC97_GPIO_STATUS 0x0054
|
||||
#define AC97_MISC_MODEM_STAT 0x0056
|
||||
#define AC97_RESERVED_58 0x0058
|
||||
|
||||
/* registers 0x005a - 0x007a are vendor reserved */
|
||||
|
||||
#define AC97_VENDOR_ID1 0x007c
|
||||
#define AC97_VENDOR_ID2 0x007e
|
||||
|
||||
/* volume control bit defines */
|
||||
#define AC97_MUTE 0x8000
|
||||
#define AC97_MICBOOST 0x0040
|
||||
#define AC97_LEFTVOL 0x3f00
|
||||
#define AC97_RIGHTVOL 0x003f
|
||||
|
||||
/* record mux defines */
|
||||
#define AC97_RECMUX_MIC 0x0000
|
||||
#define AC97_RECMUX_CD 0x0101
|
||||
#define AC97_RECMUX_VIDEO 0x0202
|
||||
#define AC97_RECMUX_AUX 0x0303
|
||||
#define AC97_RECMUX_LINE 0x0404
|
||||
#define AC97_RECMUX_STEREO_MIX 0x0505
|
||||
#define AC97_RECMUX_MONO_MIX 0x0606
|
||||
#define AC97_RECMUX_PHONE 0x0707
|
||||
|
||||
/* general purpose register bit defines */
|
||||
#define AC97_GP_LPBK 0x0080 /* Loopback mode */
|
||||
#define AC97_GP_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 */
|
||||
#define AC97_GP_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic */
|
||||
#define AC97_GP_RLBK 0x0400 /* Remote Loopback - Modem line codec */
|
||||
#define AC97_GP_LLBK 0x0800 /* Local Loopback - Modem Line codec */
|
||||
#define AC97_GP_LD 0x1000 /* Loudness 1=on */
|
||||
#define AC97_GP_3D 0x2000 /* 3D Enhancement 1=on */
|
||||
#define AC97_GP_ST 0x4000 /* Stereo Enhancement 1=on */
|
||||
#define AC97_GP_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */
|
||||
|
||||
/* extended audio status and control bit defines */
|
||||
#define AC97_EA_VRA 0x0001 /* Variable bit rate enable bit */
|
||||
#define AC97_EA_DRA 0x0002 /* Double-rate audio enable bit */
|
||||
#define AC97_EA_SPDIF 0x0004 /* S/PDIF Enable bit */
|
||||
#define AC97_EA_VRM 0x0008 /* Variable bit rate for MIC enable bit */
|
||||
#define AC97_EA_CDAC 0x0040 /* PCM Center DAC is ready (Read only) */
|
||||
#define AC97_EA_SDAC 0x0040 /* PCM Surround DACs are ready (Read only) */
|
||||
#define AC97_EA_LDAC 0x0080 /* PCM LFE DAC is ready (Read only) */
|
||||
#define AC97_EA_MDAC 0x0100 /* MIC ADC is ready (Read only) */
|
||||
#define AC97_EA_SPCV 0x0400 /* S/PDIF configuration valid (Read only) */
|
||||
#define AC97_EA_PRI 0x0800 /* Turns the PCM Center DAC off */
|
||||
#define AC97_EA_PRJ 0x1000 /* Turns the PCM Surround DACs off */
|
||||
#define AC97_EA_PRK 0x2000 /* Turns the PCM LFE DAC off */
|
||||
#define AC97_EA_PRL 0x4000 /* Turns the MIC ADC off */
|
||||
#define AC97_EA_SLOT_MASK 0xffcf /* Mask for slot assignment bits */
|
||||
#define AC97_EA_SPSA_3_4 0x0000 /* Slot assigned to 3 & 4 */
|
||||
#define AC97_EA_SPSA_7_8 0x0010 /* Slot assigned to 7 & 8 */
|
||||
#define AC97_EA_SPSA_6_9 0x0020 /* Slot assigned to 6 & 9 */
|
||||
#define AC97_EA_SPSA_10_11 0x0030 /* Slot assigned to 10 & 11 */
|
||||
|
||||
/* S/PDIF control bit defines */
|
||||
#define AC97_SC_PRO 0x0001 /* Professional status */
|
||||
#define AC97_SC_NAUDIO 0x0002 /* Non audio stream */
|
||||
#define AC97_SC_COPY 0x0004 /* Copyright status */
|
||||
#define AC97_SC_PRE 0x0008 /* Preemphasis status */
|
||||
#define AC97_SC_CC_MASK 0x07f0 /* Category Code mask */
|
||||
#define AC97_SC_L 0x0800 /* Generation Level status */
|
||||
#define AC97_SC_SPSR_MASK 0xcfff /* S/PDIF Sample Rate bits */
|
||||
#define AC97_SC_SPSR_44K 0x0000 /* Use 44.1kHz Sample rate */
|
||||
#define AC97_SC_SPSR_48K 0x2000 /* Use 48kHz Sample rate */
|
||||
#define AC97_SC_SPSR_32K 0x3000 /* Use 32kHz Sample rate */
|
||||
#define AC97_SC_DRS 0x4000 /* Double Rate S/PDIF */
|
||||
#define AC97_SC_V 0x8000 /* Validity status */
|
||||
|
||||
/* powerdown control and status bit defines */
|
||||
|
||||
/* status */
|
||||
#define AC97_PWR_MDM 0x0010 /* Modem section ready */
|
||||
#define AC97_PWR_REF 0x0008 /* Vref nominal */
|
||||
#define AC97_PWR_ANL 0x0004 /* Analog section ready */
|
||||
#define AC97_PWR_DAC 0x0002 /* DAC section ready */
|
||||
#define AC97_PWR_ADC 0x0001 /* ADC section ready */
|
||||
|
||||
/* control */
|
||||
#define AC97_PWR_PR0 0x0100 /* ADC and Mux powerdown */
|
||||
#define AC97_PWR_PR1 0x0200 /* DAC powerdown */
|
||||
#define AC97_PWR_PR2 0x0400 /* Output mixer powerdown (Vref on) */
|
||||
#define AC97_PWR_PR3 0x0800 /* Output mixer powerdown (Vref off) */
|
||||
#define AC97_PWR_PR4 0x1000 /* AC-link powerdown */
|
||||
#define AC97_PWR_PR5 0x2000 /* Internal Clk disable */
|
||||
#define AC97_PWR_PR6 0x4000 /* HP amp powerdown */
|
||||
#define AC97_PWR_PR7 0x8000 /* Modem off - if supported */
|
||||
|
||||
/* extended audio ID register bit defines */
|
||||
#define AC97_EXTID_VRA 0x0001
|
||||
#define AC97_EXTID_DRA 0x0002
|
||||
#define AC97_EXTID_SPDIF 0x0004
|
||||
#define AC97_EXTID_VRM 0x0008
|
||||
#define AC97_EXTID_DSA0 0x0010
|
||||
#define AC97_EXTID_DSA1 0x0020
|
||||
#define AC97_EXTID_CDAC 0x0040
|
||||
#define AC97_EXTID_SDAC 0x0080
|
||||
#define AC97_EXTID_LDAC 0x0100
|
||||
#define AC97_EXTID_AMAP 0x0200
|
||||
#define AC97_EXTID_REV0 0x0400
|
||||
#define AC97_EXTID_REV1 0x0800
|
||||
#define AC97_EXTID_ID0 0x4000
|
||||
#define AC97_EXTID_ID1 0x8000
|
||||
|
||||
/* extended status register bit defines */
|
||||
#define AC97_EXTSTAT_VRA 0x0001
|
||||
#define AC97_EXTSTAT_DRA 0x0002
|
||||
#define AC97_EXTSTAT_SPDIF 0x0004
|
||||
#define AC97_EXTSTAT_VRM 0x0008
|
||||
#define AC97_EXTSTAT_SPSA0 0x0010
|
||||
#define AC97_EXTSTAT_SPSA1 0x0020
|
||||
#define AC97_EXTSTAT_CDAC 0x0040
|
||||
#define AC97_EXTSTAT_SDAC 0x0080
|
||||
#define AC97_EXTSTAT_LDAC 0x0100
|
||||
#define AC97_EXTSTAT_MADC 0x0200
|
||||
#define AC97_EXTSTAT_SPCV 0x0400
|
||||
#define AC97_EXTSTAT_PRI 0x0800
|
||||
#define AC97_EXTSTAT_PRJ 0x1000
|
||||
#define AC97_EXTSTAT_PRK 0x2000
|
||||
#define AC97_EXTSTAT_PRL 0x4000
|
||||
|
||||
/* extended audio ID register bit defines */
|
||||
#define AC97_EXTID_VRA 0x0001
|
||||
#define AC97_EXTID_DRA 0x0002
|
||||
#define AC97_EXTID_SPDIF 0x0004
|
||||
#define AC97_EXTID_VRM 0x0008
|
||||
#define AC97_EXTID_DSA0 0x0010
|
||||
#define AC97_EXTID_DSA1 0x0020
|
||||
#define AC97_EXTID_CDAC 0x0040
|
||||
#define AC97_EXTID_SDAC 0x0080
|
||||
#define AC97_EXTID_LDAC 0x0100
|
||||
#define AC97_EXTID_AMAP 0x0200
|
||||
#define AC97_EXTID_REV0 0x0400
|
||||
#define AC97_EXTID_REV1 0x0800
|
||||
#define AC97_EXTID_ID0 0x4000
|
||||
#define AC97_EXTID_ID1 0x8000
|
||||
|
||||
/* extended status register bit defines */
|
||||
#define AC97_EXTSTAT_VRA 0x0001
|
||||
#define AC97_EXTSTAT_DRA 0x0002
|
||||
#define AC97_EXTSTAT_SPDIF 0x0004
|
||||
#define AC97_EXTSTAT_VRM 0x0008
|
||||
#define AC97_EXTSTAT_SPSA0 0x0010
|
||||
#define AC97_EXTSTAT_SPSA1 0x0020
|
||||
#define AC97_EXTSTAT_CDAC 0x0040
|
||||
#define AC97_EXTSTAT_SDAC 0x0080
|
||||
#define AC97_EXTSTAT_LDAC 0x0100
|
||||
#define AC97_EXTSTAT_MADC 0x0200
|
||||
#define AC97_EXTSTAT_SPCV 0x0400
|
||||
#define AC97_EXTSTAT_PRI 0x0800
|
||||
#define AC97_EXTSTAT_PRJ 0x1000
|
||||
#define AC97_EXTSTAT_PRK 0x2000
|
||||
#define AC97_EXTSTAT_PRL 0x4000
|
||||
|
||||
/* useful power states */
|
||||
#define AC97_PWR_D0 0x0000 /* everything on */
|
||||
#define AC97_PWR_D1 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR4
|
||||
#define AC97_PWR_D2 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4
|
||||
#define AC97_PWR_D3 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4
|
||||
#define AC97_PWR_ANLOFF AC97_PWR_PR2|AC97_PWR_PR3 /* analog section off */
|
||||
|
||||
/* Total number of defined registers. */
|
||||
#define AC97_REG_CNT 64
|
||||
|
||||
|
||||
/* OSS interface to the ac97s.. */
|
||||
#define AC97_STEREO_MASK (SOUND_MASK_VOLUME|SOUND_MASK_PCM|\
|
||||
SOUND_MASK_LINE|SOUND_MASK_CD|\
|
||||
SOUND_MASK_ALTPCM|SOUND_MASK_IGAIN|\
|
||||
SOUND_MASK_LINE1|SOUND_MASK_VIDEO)
|
||||
|
||||
#define AC97_SUPPORTED_MASK (AC97_STEREO_MASK | \
|
||||
SOUND_MASK_BASS|SOUND_MASK_TREBLE|\
|
||||
SOUND_MASK_SPEAKER|SOUND_MASK_MIC|\
|
||||
SOUND_MASK_PHONEIN|SOUND_MASK_PHONEOUT)
|
||||
|
||||
#define AC97_RECORD_MASK (SOUND_MASK_MIC|\
|
||||
SOUND_MASK_CD|SOUND_MASK_IGAIN|SOUND_MASK_VIDEO|\
|
||||
SOUND_MASK_LINE1| SOUND_MASK_LINE|\
|
||||
SOUND_MASK_PHONEIN)
|
||||
|
||||
/* original check is not good enough in case FOO is greater than
|
||||
* SOUND_MIXER_NRDEVICES because the supported_mixers has exactly
|
||||
* SOUND_MIXER_NRDEVICES elements.
|
||||
* before matching the given mixer against the bitmask in supported_mixers we
|
||||
* check if mixer number exceeds maximum allowed size which is as mentioned
|
||||
* above SOUND_MIXER_NRDEVICES */
|
||||
#define supported_mixer(CODEC,FOO) ((FOO >= 0) && \
|
||||
(FOO < SOUND_MIXER_NRDEVICES) && \
|
||||
(CODEC)->supported_mixers & (1<<FOO) )
|
||||
|
||||
struct ac97_codec {
|
||||
/* Linked list of codecs */
|
||||
struct list_head list;
|
||||
|
||||
/* AC97 controller connected with */
|
||||
void *private_data;
|
||||
|
||||
char *name;
|
||||
int id;
|
||||
int dev_mixer;
|
||||
int type;
|
||||
u32 model;
|
||||
|
||||
unsigned int modem:1;
|
||||
|
||||
struct ac97_ops *codec_ops;
|
||||
|
||||
/* controller specific lower leverl ac97 accessing routines.
|
||||
must be re-entrant safe */
|
||||
u16 (*codec_read) (struct ac97_codec *codec, u8 reg);
|
||||
void (*codec_write) (struct ac97_codec *codec, u8 reg, u16 val);
|
||||
|
||||
/* Wait for codec-ready. Ok to sleep here. */
|
||||
void (*codec_wait) (struct ac97_codec *codec);
|
||||
|
||||
/* callback used by helper drivers for interesting ac97 setups */
|
||||
void (*codec_unregister) (struct ac97_codec *codec);
|
||||
|
||||
struct ac97_driver *driver;
|
||||
void *driver_private; /* Private data for the driver */
|
||||
|
||||
spinlock_t lock;
|
||||
|
||||
/* OSS mixer masks */
|
||||
int modcnt;
|
||||
int supported_mixers;
|
||||
int stereo_mixers;
|
||||
int record_sources;
|
||||
|
||||
/* Property flags */
|
||||
int flags;
|
||||
|
||||
int bit_resolution;
|
||||
|
||||
/* OSS mixer interface */
|
||||
int (*read_mixer) (struct ac97_codec *codec, int oss_channel);
|
||||
void (*write_mixer)(struct ac97_codec *codec, int oss_channel,
|
||||
unsigned int left, unsigned int right);
|
||||
int (*recmask_io) (struct ac97_codec *codec, int rw, int mask);
|
||||
int (*mixer_ioctl)(struct ac97_codec *codec, unsigned int cmd, unsigned long arg);
|
||||
|
||||
/* saved OSS mixer states */
|
||||
unsigned int mixer_state[SOUND_MIXER_NRDEVICES];
|
||||
|
||||
/* Software Modem interface */
|
||||
int (*modem_ioctl)(struct ac97_codec *codec, unsigned int cmd, unsigned long arg);
|
||||
};
|
||||
|
||||
/*
|
||||
* Operation structures for each known AC97 chip
|
||||
*/
|
||||
|
||||
struct ac97_ops
|
||||
{
|
||||
/* Initialise */
|
||||
int (*init)(struct ac97_codec *c);
|
||||
/* Amplifier control */
|
||||
int (*amplifier)(struct ac97_codec *codec, int on);
|
||||
/* Digital mode control */
|
||||
int (*digital)(struct ac97_codec *codec, int slots, int rate, int mode);
|
||||
#define AUDIO_DIGITAL 0x8000
|
||||
#define AUDIO_PRO 0x4000
|
||||
#define AUDIO_DRS 0x2000
|
||||
#define AUDIO_CCMASK 0x003F
|
||||
|
||||
#define AC97_DELUDED_MODEM 1 /* Audio codec reports its a modem */
|
||||
#define AC97_NO_PCM_VOLUME 2 /* Volume control is missing */
|
||||
#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */
|
||||
};
|
||||
|
||||
extern int ac97_probe_codec(struct ac97_codec *);
|
||||
|
||||
extern struct ac97_codec *ac97_alloc_codec(void);
|
||||
extern void ac97_release_codec(struct ac97_codec *codec);
|
||||
|
||||
struct ac97_driver {
|
||||
struct list_head list;
|
||||
char *name;
|
||||
u32 codec_id;
|
||||
u32 codec_mask;
|
||||
int (*probe) (struct ac97_codec *codec, struct ac97_driver *driver);
|
||||
void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver);
|
||||
};
|
||||
|
||||
/* quirk types */
|
||||
enum {
|
||||
AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */
|
||||
AC97_TUNE_NONE = 0, /* nothing extra to do */
|
||||
AC97_TUNE_HP_ONLY, /* headphone (true line-out) control as master only */
|
||||
AC97_TUNE_SWAP_HP, /* swap headphone and master controls */
|
||||
AC97_TUNE_SWAP_SURROUND, /* swap master and surround controls */
|
||||
AC97_TUNE_AD_SHARING, /* for AD1985, turn on OMS bit and use headphone */
|
||||
AC97_TUNE_ALC_JACK, /* for Realtek, enable JACK detection */
|
||||
};
|
||||
|
||||
struct ac97_quirk {
|
||||
unsigned short vendor; /* PCI vendor id */
|
||||
unsigned short device; /* PCI device id */
|
||||
unsigned short mask; /* device id bit mask, 0 = accept all */
|
||||
const char *name; /* name shown as info */
|
||||
int type; /* quirk type above */
|
||||
};
|
||||
|
||||
#endif /* _AC97_CODEC_H_ */
|
||||
|
|
@ -96,7 +96,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
|
|||
void acpi_numa_slit_init (struct acpi_table_slit *slit);
|
||||
void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
|
||||
void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
|
||||
void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
|
||||
int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
|
||||
void acpi_numa_arch_fixup(void);
|
||||
|
||||
#ifdef CONFIG_ACPI_HOTPLUG_CPU
|
||||
|
|
@ -190,6 +190,8 @@ extern bool wmi_has_guid(const char *guid);
|
|||
|
||||
extern long acpi_video_get_capabilities(acpi_handle graphics_dev_handle);
|
||||
extern long acpi_is_video_device(struct acpi_device *device);
|
||||
extern void acpi_video_dmi_promote_vendor(void);
|
||||
extern void acpi_video_dmi_demote_vendor(void);
|
||||
extern int acpi_video_backlight_support(void);
|
||||
extern int acpi_video_display_switch_support(void);
|
||||
|
||||
|
|
@ -205,6 +207,14 @@ static inline long acpi_is_video_device(struct acpi_device *device)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void acpi_video_dmi_promote_vendor(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void acpi_video_dmi_demote_vendor(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int acpi_video_backlight_support(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -277,7 +287,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
|
|||
#define OSC_SB_PAD_SUPPORT 1
|
||||
#define OSC_SB_PPC_OST_SUPPORT 2
|
||||
#define OSC_SB_PR3_SUPPORT 4
|
||||
#define OSC_SB_CPUHP_OST_SUPPORT 8
|
||||
#define OSC_SB_HOTPLUG_OST_SUPPORT 8
|
||||
#define OSC_SB_APEI_SUPPORT 16
|
||||
|
||||
extern bool osc_sb_apei_support_acked;
|
||||
|
|
@ -309,6 +319,44 @@ extern bool osc_sb_apei_support_acked;
|
|||
|
||||
extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
|
||||
u32 *mask, u32 req);
|
||||
|
||||
/* Enable _OST when all relevant hotplug operations are enabled */
|
||||
#if defined(CONFIG_ACPI_HOTPLUG_CPU) && \
|
||||
(defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \
|
||||
defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \
|
||||
(defined(CONFIG_ACPI_CONTAINER) || \
|
||||
defined(CONFIG_ACPI_CONTAINER_MODULE))
|
||||
#define ACPI_HOTPLUG_OST
|
||||
#endif
|
||||
|
||||
/* _OST Source Event Code (OSPM Action) */
|
||||
#define ACPI_OST_EC_OSPM_SHUTDOWN 0x100
|
||||
#define ACPI_OST_EC_OSPM_EJECT 0x103
|
||||
#define ACPI_OST_EC_OSPM_INSERTION 0x200
|
||||
|
||||
/* _OST General Processing Status Code */
|
||||
#define ACPI_OST_SC_SUCCESS 0x0
|
||||
#define ACPI_OST_SC_NON_SPECIFIC_FAILURE 0x1
|
||||
#define ACPI_OST_SC_UNRECOGNIZED_NOTIFY 0x2
|
||||
|
||||
/* _OST OS Shutdown Processing (0x100) Status Code */
|
||||
#define ACPI_OST_SC_OS_SHUTDOWN_DENIED 0x80
|
||||
#define ACPI_OST_SC_OS_SHUTDOWN_IN_PROGRESS 0x81
|
||||
#define ACPI_OST_SC_OS_SHUTDOWN_COMPLETED 0x82
|
||||
#define ACPI_OST_SC_OS_SHUTDOWN_NOT_SUPPORTED 0x83
|
||||
|
||||
/* _OST Ejection Request (0x3, 0x103) Status Code */
|
||||
#define ACPI_OST_SC_EJECT_NOT_SUPPORTED 0x80
|
||||
#define ACPI_OST_SC_DEVICE_IN_USE 0x81
|
||||
#define ACPI_OST_SC_DEVICE_BUSY 0x82
|
||||
#define ACPI_OST_SC_EJECT_DEPENDENCY_BUSY 0x83
|
||||
#define ACPI_OST_SC_EJECT_IN_PROGRESS 0x84
|
||||
|
||||
/* _OST Insertion Request (0x200) Status Code */
|
||||
#define ACPI_OST_SC_INSERT_IN_PROGRESS 0x80
|
||||
#define ACPI_OST_SC_DRIVER_LOAD_FAILURE 0x81
|
||||
#define ACPI_OST_SC_INSERT_NOT_SUPPORTED 0x82
|
||||
|
||||
extern void acpi_early_init(void);
|
||||
|
||||
extern int acpi_nvs_register(__u64 start, __u64 size);
|
||||
|
|
|
|||
|
|
@ -126,22 +126,20 @@ struct kiocb {
|
|||
struct eventfd_ctx *ki_eventfd;
|
||||
};
|
||||
|
||||
#define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY)
|
||||
#define init_sync_kiocb(x, filp) \
|
||||
do { \
|
||||
struct task_struct *tsk = current; \
|
||||
(x)->ki_flags = 0; \
|
||||
(x)->ki_users = 1; \
|
||||
(x)->ki_key = KIOCB_SYNC_KEY; \
|
||||
(x)->ki_filp = (filp); \
|
||||
(x)->ki_ctx = NULL; \
|
||||
(x)->ki_cancel = NULL; \
|
||||
(x)->ki_retry = NULL; \
|
||||
(x)->ki_dtor = NULL; \
|
||||
(x)->ki_obj.tsk = tsk; \
|
||||
(x)->ki_user_data = 0; \
|
||||
(x)->private = NULL; \
|
||||
} while (0)
|
||||
static inline bool is_sync_kiocb(struct kiocb *kiocb)
|
||||
{
|
||||
return kiocb->ki_key == KIOCB_SYNC_KEY;
|
||||
}
|
||||
|
||||
static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
|
||||
{
|
||||
*kiocb = (struct kiocb) {
|
||||
.ki_users = 1,
|
||||
.ki_key = KIOCB_SYNC_KEY,
|
||||
.ki_filp = filp,
|
||||
.ki_obj.tsk = current,
|
||||
};
|
||||
}
|
||||
|
||||
#define AIO_RING_MAGIC 0xa10a10a1
|
||||
#define AIO_RING_COMPAT_FEATURES 1
|
||||
|
|
@ -161,8 +159,6 @@ struct aio_ring {
|
|||
struct io_event io_events[0];
|
||||
}; /* 128 bytes + ring size */
|
||||
|
||||
#define aio_ring_avail(info, ring) (((ring)->head + (info)->nr - 1 - (ring)->tail) % (info)->nr)
|
||||
|
||||
#define AIO_RING_PAGES 8
|
||||
struct aio_ring_info {
|
||||
unsigned long mmap_base;
|
||||
|
|
@ -177,6 +173,12 @@ struct aio_ring_info {
|
|||
struct page *internal_pages[AIO_RING_PAGES];
|
||||
};
|
||||
|
||||
static inline unsigned aio_ring_avail(struct aio_ring_info *info,
|
||||
struct aio_ring *ring)
|
||||
{
|
||||
return (ring->head + info->nr - 1 - ring->tail) % info->nr;
|
||||
}
|
||||
|
||||
struct kioctx {
|
||||
atomic_t users;
|
||||
int dead;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ enum alarmtimer_restart {
|
|||
|
||||
#define ALARMTIMER_STATE_INACTIVE 0x00
|
||||
#define ALARMTIMER_STATE_ENQUEUED 0x01
|
||||
#define ALARMTIMER_STATE_CALLBACK 0x02
|
||||
|
||||
/**
|
||||
* struct alarm - Alarm timer structure
|
||||
|
|
@ -35,6 +34,7 @@ enum alarmtimer_restart {
|
|||
*/
|
||||
struct alarm {
|
||||
struct timerqueue_node node;
|
||||
struct hrtimer timer;
|
||||
enum alarmtimer_restart (*function)(struct alarm *, ktime_t now);
|
||||
enum alarmtimer_type type;
|
||||
int state;
|
||||
|
|
@ -43,39 +43,12 @@ struct alarm {
|
|||
|
||||
void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
|
||||
enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
|
||||
void alarm_start(struct alarm *alarm, ktime_t start);
|
||||
int alarm_start(struct alarm *alarm, ktime_t start);
|
||||
int alarm_try_to_cancel(struct alarm *alarm);
|
||||
int alarm_cancel(struct alarm *alarm);
|
||||
|
||||
u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
|
||||
|
||||
/*
|
||||
* A alarmtimer is active, when it is enqueued into timerqueue or the
|
||||
* callback function is running.
|
||||
*/
|
||||
static inline int alarmtimer_active(const struct alarm *timer)
|
||||
{
|
||||
return timer->state != ALARMTIMER_STATE_INACTIVE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to check, whether the timer is on one of the queues
|
||||
*/
|
||||
static inline int alarmtimer_is_queued(struct alarm *timer)
|
||||
{
|
||||
return timer->state & ALARMTIMER_STATE_ENQUEUED;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to check, whether the timer is running the callback
|
||||
* function
|
||||
*/
|
||||
static inline int alarmtimer_callback_running(struct alarm *timer)
|
||||
{
|
||||
return timer->state & ALARMTIMER_STATE_CALLBACK;
|
||||
}
|
||||
|
||||
|
||||
/* Provide way to access the rtc device being used by alarmtimers */
|
||||
struct rtc_device *alarmtimer_get_rtcdev(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@ enum ssp_chip_select {
|
|||
struct dma_chan;
|
||||
/**
|
||||
* struct pl022_ssp_master - device.platform_data for SPI controller devices.
|
||||
* @bus_id: identifier for this bus
|
||||
* @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
|
||||
|
|
@ -259,19 +260,13 @@ struct pl022_ssp_controller {
|
|||
* 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
|
||||
|
|
@ -279,8 +274,6 @@ struct pl022_ssp_controller {
|
|||
* before sampling the incoming line
|
||||
* @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 {
|
||||
enum ssp_interface iface;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@
|
|||
#include <linux/dmaengine.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
struct pl08x_lli;
|
||||
struct pl08x_driver_data;
|
||||
struct pl08x_phy_chan;
|
||||
struct pl08x_txd;
|
||||
|
||||
/* Bitmasks for selecting AHB ports for DMA transfers */
|
||||
enum {
|
||||
|
|
@ -46,169 +47,28 @@ enum {
|
|||
* devices with static assignments
|
||||
* @muxval: a number usually used to poke into some mux regiser to
|
||||
* mux in the signal to this channel
|
||||
* @cctl_opt: default options for the channel control register
|
||||
* @cctl_memcpy: options for the channel control register for memcpy
|
||||
* *** not used for slave channels ***
|
||||
* @addr: source/target address in physical memory for this DMA channel,
|
||||
* can be the address of a FIFO register for burst requests for example.
|
||||
* This can be left undefined if the PrimeCell API is used for configuring
|
||||
* this.
|
||||
* @circular_buffer: whether the buffer passed in is circular and
|
||||
* shall simply be looped round round (like a record baby round
|
||||
* round round round)
|
||||
* @single: the device connected to this channel will request single DMA
|
||||
* transfers, not bursts. (Bursts are default.)
|
||||
* @periph_buses: the device connected to this channel is accessible via
|
||||
* these buses (use PL08X_AHB1 | PL08X_AHB2).
|
||||
*/
|
||||
struct pl08x_channel_data {
|
||||
char *bus_id;
|
||||
const char *bus_id;
|
||||
int min_signal;
|
||||
int max_signal;
|
||||
u32 muxval;
|
||||
u32 cctl;
|
||||
u32 cctl_memcpy;
|
||||
dma_addr_t addr;
|
||||
bool circular_buffer;
|
||||
bool single;
|
||||
u8 periph_buses;
|
||||
};
|
||||
|
||||
/**
|
||||
* Struct pl08x_bus_data - information of source or destination
|
||||
* busses for a transfer
|
||||
* @addr: current address
|
||||
* @maxwidth: the maximum width of a transfer on this bus
|
||||
* @buswidth: the width of this bus in bytes: 1, 2 or 4
|
||||
*/
|
||||
struct pl08x_bus_data {
|
||||
dma_addr_t addr;
|
||||
u8 maxwidth;
|
||||
u8 buswidth;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pl08x_phy_chan - holder for the physical channels
|
||||
* @id: physical index to this channel
|
||||
* @lock: a lock to use when altering an instance of this struct
|
||||
* @signal: the physical signal (aka channel) serving this physical channel
|
||||
* right now
|
||||
* @serving: the virtual channel currently being served by this physical
|
||||
* channel
|
||||
* @locked: channel unavailable for the system, e.g. dedicated to secure
|
||||
* world
|
||||
*/
|
||||
struct pl08x_phy_chan {
|
||||
unsigned int id;
|
||||
void __iomem *base;
|
||||
spinlock_t lock;
|
||||
int signal;
|
||||
struct pl08x_dma_chan *serving;
|
||||
bool locked;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pl08x_sg - structure containing data per sg
|
||||
* @src_addr: src address of sg
|
||||
* @dst_addr: dst address of sg
|
||||
* @len: transfer len in bytes
|
||||
* @node: node for txd's dsg_list
|
||||
*/
|
||||
struct pl08x_sg {
|
||||
dma_addr_t src_addr;
|
||||
dma_addr_t dst_addr;
|
||||
size_t len;
|
||||
struct list_head node;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pl08x_txd - wrapper for struct dma_async_tx_descriptor
|
||||
* @tx: async tx descriptor
|
||||
* @node: node for txd list for channels
|
||||
* @dsg_list: list of children sg's
|
||||
* @direction: direction of transfer
|
||||
* @llis_bus: DMA memory address (physical) start for the LLIs
|
||||
* @llis_va: virtual memory address start for the LLIs
|
||||
* @cctl: control reg values for current txd
|
||||
* @ccfg: config reg values for current txd
|
||||
*/
|
||||
struct pl08x_txd {
|
||||
struct dma_async_tx_descriptor tx;
|
||||
struct list_head node;
|
||||
struct list_head dsg_list;
|
||||
enum dma_transfer_direction direction;
|
||||
dma_addr_t llis_bus;
|
||||
struct pl08x_lli *llis_va;
|
||||
/* Default cctl value for LLIs */
|
||||
u32 cctl;
|
||||
/*
|
||||
* Settings to be put into the physical channel when we
|
||||
* trigger this txd. Other registers are in llis_va[0].
|
||||
*/
|
||||
u32 ccfg;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pl08x_dma_chan_state - holds the PL08x specific virtual channel
|
||||
* states
|
||||
* @PL08X_CHAN_IDLE: the channel is idle
|
||||
* @PL08X_CHAN_RUNNING: the channel has allocated a physical transport
|
||||
* channel and is running a transfer on it
|
||||
* @PL08X_CHAN_PAUSED: the channel has allocated a physical transport
|
||||
* channel, but the transfer is currently paused
|
||||
* @PL08X_CHAN_WAITING: the channel is waiting for a physical transport
|
||||
* channel to become available (only pertains to memcpy channels)
|
||||
*/
|
||||
enum pl08x_dma_chan_state {
|
||||
PL08X_CHAN_IDLE,
|
||||
PL08X_CHAN_RUNNING,
|
||||
PL08X_CHAN_PAUSED,
|
||||
PL08X_CHAN_WAITING,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel
|
||||
* @chan: wrappped abstract channel
|
||||
* @phychan: the physical channel utilized by this channel, if there is one
|
||||
* @phychan_hold: if non-zero, hold on to the physical channel even if we
|
||||
* have no pending entries
|
||||
* @tasklet: tasklet scheduled by the IRQ to handle actual work etc
|
||||
* @name: name of channel
|
||||
* @cd: channel platform data
|
||||
* @runtime_addr: address for RX/TX according to the runtime config
|
||||
* @runtime_direction: current direction of this channel according to
|
||||
* runtime config
|
||||
* @pend_list: queued transactions pending on this channel
|
||||
* @at: active transaction on this channel
|
||||
* @lock: a lock for this channel data
|
||||
* @host: a pointer to the host (internal use)
|
||||
* @state: whether the channel is idle, paused, running etc
|
||||
* @slave: whether this channel is a device (slave) or for memcpy
|
||||
* @device_fc: Flow Controller Settings for ccfg register. Only valid for slave
|
||||
* channels. Fill with 'true' if peripheral should be flow controller. Direction
|
||||
* will be selected at Runtime.
|
||||
* @waiting: a TX descriptor on this channel which is waiting for a physical
|
||||
* channel to become available
|
||||
*/
|
||||
struct pl08x_dma_chan {
|
||||
struct dma_chan chan;
|
||||
struct pl08x_phy_chan *phychan;
|
||||
int phychan_hold;
|
||||
struct tasklet_struct tasklet;
|
||||
char *name;
|
||||
const struct pl08x_channel_data *cd;
|
||||
dma_addr_t src_addr;
|
||||
dma_addr_t dst_addr;
|
||||
u32 src_cctl;
|
||||
u32 dst_cctl;
|
||||
enum dma_transfer_direction runtime_direction;
|
||||
struct list_head pend_list;
|
||||
struct pl08x_txd *at;
|
||||
spinlock_t lock;
|
||||
struct pl08x_driver_data *host;
|
||||
enum pl08x_dma_chan_state state;
|
||||
bool slave;
|
||||
bool device_fc;
|
||||
struct pl08x_txd *waiting;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pl08x_platform_data - the platform configuration for the PL08x
|
||||
* PrimeCells.
|
||||
|
|
@ -229,8 +89,8 @@ struct pl08x_platform_data {
|
|||
const struct pl08x_channel_data *slave_channels;
|
||||
unsigned int num_slave_channels;
|
||||
struct pl08x_channel_data memcpy_channel;
|
||||
int (*get_signal)(struct pl08x_dma_chan *);
|
||||
void (*put_signal)(struct pl08x_dma_chan *);
|
||||
int (*get_signal)(const struct pl08x_channel_data *);
|
||||
void (*put_signal)(const struct pl08x_channel_data *, int);
|
||||
u8 lli_buses;
|
||||
u8 mem_buses;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,19 +9,47 @@
|
|||
* as published by the Free Software Foundation; version 2
|
||||
* of the License.
|
||||
*/
|
||||
#ifndef __ASYNC_H__
|
||||
#define __ASYNC_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
typedef u64 async_cookie_t;
|
||||
typedef void (async_func_ptr) (void *data, async_cookie_t cookie);
|
||||
struct async_domain {
|
||||
struct list_head node;
|
||||
struct list_head domain;
|
||||
int count;
|
||||
unsigned registered:1;
|
||||
};
|
||||
|
||||
/*
|
||||
* domain participates in global async_synchronize_full
|
||||
*/
|
||||
#define ASYNC_DOMAIN(_name) \
|
||||
struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \
|
||||
.domain = LIST_HEAD_INIT(_name.domain), \
|
||||
.count = 0, \
|
||||
.registered = 1 }
|
||||
|
||||
/*
|
||||
* domain is free to go out of scope as soon as all pending work is
|
||||
* complete, this domain does not participate in async_synchronize_full
|
||||
*/
|
||||
#define ASYNC_DOMAIN_EXCLUSIVE(_name) \
|
||||
struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \
|
||||
.domain = LIST_HEAD_INIT(_name.domain), \
|
||||
.count = 0, \
|
||||
.registered = 0 }
|
||||
|
||||
extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data);
|
||||
extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data,
|
||||
struct list_head *list);
|
||||
struct async_domain *domain);
|
||||
void async_unregister_domain(struct async_domain *domain);
|
||||
extern void async_synchronize_full(void);
|
||||
extern void async_synchronize_full_domain(struct list_head *list);
|
||||
extern void async_synchronize_full_domain(struct async_domain *domain);
|
||||
extern void async_synchronize_cookie(async_cookie_t cookie);
|
||||
extern void async_synchronize_cookie_domain(async_cookie_t cookie,
|
||||
struct list_head *list);
|
||||
|
||||
struct async_domain *domain);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -578,6 +578,7 @@ static inline int ata_is_data(u8 prot)
|
|||
((u64) (id)[(n) + 0]) )
|
||||
|
||||
#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
|
||||
#define ata_id_has_da(id) ((id)[77] & (1 << 4))
|
||||
|
||||
static inline bool ata_id_has_hipm(const u16 *id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@
|
|||
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
||||
#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
|
||||
#define AUDIT_ANOM_ABEND 1701 /* Process ended abnormally */
|
||||
#define AUDIT_ANOM_LINK 1702 /* Suspicious use of file links */
|
||||
#define AUDIT_INTEGRITY_DATA 1800 /* Data integrity verification */
|
||||
#define AUDIT_INTEGRITY_METADATA 1801 /* Metadata integrity verification */
|
||||
#define AUDIT_INTEGRITY_STATUS 1802 /* Integrity enable status */
|
||||
|
|
@ -687,6 +688,8 @@ extern void audit_log_d_path(struct audit_buffer *ab,
|
|||
const struct path *path);
|
||||
extern void audit_log_key(struct audit_buffer *ab,
|
||||
char *key);
|
||||
extern void audit_log_link_denied(const char *operation,
|
||||
struct path *link);
|
||||
extern void audit_log_lost(const char *message);
|
||||
#ifdef CONFIG_SECURITY
|
||||
extern void audit_log_secctx(struct audit_buffer *ab, u32 secid);
|
||||
|
|
@ -716,6 +719,7 @@ extern int audit_enabled;
|
|||
#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_log_link_denied(o, l) do { ; } while (0)
|
||||
#define audit_log_secctx(b,s) do { ; } while (0)
|
||||
#define audit_enabled 0
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,13 +10,14 @@
|
|||
|
||||
#include <linux/percpu_counter.h>
|
||||
#include <linux/log2.h>
|
||||
#include <linux/proportions.h>
|
||||
#include <linux/flex_proportions.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/sysctl.h>
|
||||
|
||||
struct page;
|
||||
struct device;
|
||||
|
|
@ -89,7 +90,7 @@ struct backing_dev_info {
|
|||
unsigned long dirty_ratelimit;
|
||||
unsigned long balanced_dirty_ratelimit;
|
||||
|
||||
struct prop_local_percpu completions;
|
||||
struct fprop_local_percpu completions;
|
||||
int dirty_exceeded;
|
||||
|
||||
unsigned int min_ratio;
|
||||
|
|
@ -123,7 +124,6 @@ void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages,
|
|||
void bdi_start_background_writeback(struct backing_dev_info *bdi);
|
||||
int bdi_writeback_thread(void *data);
|
||||
int bdi_has_dirty_io(struct backing_dev_info *bdi);
|
||||
void bdi_arm_supers_timer(void);
|
||||
void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi);
|
||||
void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2);
|
||||
|
||||
|
|
@ -304,6 +304,8 @@ void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
|
|||
void set_bdi_congested(struct backing_dev_info *bdi, int sync);
|
||||
long congestion_wait(int sync, long timeout);
|
||||
long wait_iff_congested(struct zone *zone, int sync, long timeout);
|
||||
int pdflush_proc_obsolete(struct ctl_table *table, int write,
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos);
|
||||
|
||||
static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <linux/bcma/bcma_driver_chipcommon.h>
|
||||
#include <linux/bcma/bcma_driver_pci.h>
|
||||
#include <linux/bcma/bcma_driver_mips.h>
|
||||
#include <linux/bcma/bcma_driver_gmac_cmn.h>
|
||||
#include <linux/ssb/ssb.h> /* SPROM sharing */
|
||||
|
||||
#include "bcma_regs.h"
|
||||
|
|
@ -70,6 +71,13 @@ struct bcma_host_ops {
|
|||
|
||||
/* Core-ID values. */
|
||||
#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */
|
||||
#define BCMA_CORE_4706_CHIPCOMMON 0x500
|
||||
#define BCMA_CORE_4706_SOC_RAM 0x50E
|
||||
#define BCMA_CORE_4706_MAC_GBIT 0x52D
|
||||
#define BCMA_CORE_AMEMC 0x52E /* DDR1/2 memory controller core */
|
||||
#define BCMA_CORE_ALTA 0x534 /* I2S core */
|
||||
#define BCMA_CORE_4706_MAC_GBIT_COMMON 0x5DC
|
||||
#define BCMA_CORE_DDR23_PHY 0x5DD
|
||||
#define BCMA_CORE_INVALID 0x700
|
||||
#define BCMA_CORE_CHIPCOMMON 0x800
|
||||
#define BCMA_CORE_ILINE20 0x801
|
||||
|
|
@ -130,6 +138,36 @@ struct bcma_host_ops {
|
|||
|
||||
#define BCMA_MAX_NR_CORES 16
|
||||
|
||||
/* Chip IDs of PCIe devices */
|
||||
#define BCMA_CHIP_ID_BCM4313 0x4313
|
||||
#define BCMA_CHIP_ID_BCM43224 43224
|
||||
#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8
|
||||
#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa
|
||||
#define BCMA_CHIP_ID_BCM43225 43225
|
||||
#define BCMA_CHIP_ID_BCM43227 43227
|
||||
#define BCMA_CHIP_ID_BCM43228 43228
|
||||
#define BCMA_CHIP_ID_BCM43421 43421
|
||||
#define BCMA_CHIP_ID_BCM43428 43428
|
||||
#define BCMA_CHIP_ID_BCM43431 43431
|
||||
#define BCMA_CHIP_ID_BCM43460 43460
|
||||
#define BCMA_CHIP_ID_BCM4331 0x4331
|
||||
#define BCMA_CHIP_ID_BCM6362 0x6362
|
||||
#define BCMA_CHIP_ID_BCM4360 0x4360
|
||||
#define BCMA_CHIP_ID_BCM4352 0x4352
|
||||
|
||||
/* Chip IDs of SoCs */
|
||||
#define BCMA_CHIP_ID_BCM4706 0x5300
|
||||
#define BCMA_CHIP_ID_BCM4716 0x4716
|
||||
#define BCMA_PKG_ID_BCM4716 8
|
||||
#define BCMA_PKG_ID_BCM4717 9
|
||||
#define BCMA_PKG_ID_BCM4718 10
|
||||
#define BCMA_CHIP_ID_BCM47162 47162
|
||||
#define BCMA_CHIP_ID_BCM4748 0x4748
|
||||
#define BCMA_CHIP_ID_BCM4749 0x4749
|
||||
#define BCMA_CHIP_ID_BCM5356 0x5356
|
||||
#define BCMA_CHIP_ID_BCM5357 0x5357
|
||||
#define BCMA_CHIP_ID_BCM53572 53572
|
||||
|
||||
struct bcma_device {
|
||||
struct bcma_bus *bus;
|
||||
struct bcma_device_id id;
|
||||
|
|
@ -215,6 +253,7 @@ struct bcma_bus {
|
|||
struct bcma_drv_cc drv_cc;
|
||||
struct bcma_drv_pci drv_pci;
|
||||
struct bcma_drv_mips drv_mips;
|
||||
struct bcma_drv_gmac_cmn drv_gmac_cmn;
|
||||
|
||||
/* We decided to share SPROM struct with SSB as long as we do not need
|
||||
* any hacks for BCMA. This simplifies drivers code. */
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */
|
||||
#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */
|
||||
#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */
|
||||
#define BCMA_CC_FLASHT_NFLASH 0x00000200
|
||||
#define BCMA_CC_FLASHT_NFLASH 0x00000200 /* NAND flash */
|
||||
#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */
|
||||
#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */
|
||||
#define BCMA_PLLTYPE_NONE 0x00000000
|
||||
|
|
@ -45,6 +45,7 @@
|
|||
#define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */
|
||||
#define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */
|
||||
#define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */
|
||||
#define BCMA_CC_CAP_NFLASH 0x80000000 /* NAND flash present (rev >= 35 or BCM4706?) */
|
||||
#define BCMA_CC_CORECTL 0x0008
|
||||
#define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */
|
||||
#define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */
|
||||
|
|
@ -88,6 +89,17 @@
|
|||
#define BCMA_CC_CHIPST_4313_OTP_PRESENT 2
|
||||
#define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2
|
||||
#define BCMA_CC_CHIPST_4331_OTP_PRESENT 4
|
||||
#define BCMA_CC_CHIPST_43228_ILP_DIV_EN 0x00000001
|
||||
#define BCMA_CC_CHIPST_43228_OTP_PRESENT 0x00000002
|
||||
#define BCMA_CC_CHIPST_43228_SERDES_REFCLK_PADSEL 0x00000004
|
||||
#define BCMA_CC_CHIPST_43228_SDIO_MODE 0x00000008
|
||||
#define BCMA_CC_CHIPST_43228_SDIO_OTP_PRESENT 0x00000010
|
||||
#define BCMA_CC_CHIPST_43228_SDIO_RESET 0x00000020
|
||||
#define BCMA_CC_CHIPST_4706_PKG_OPTION BIT(0) /* 0: full-featured package 1: low-cost package */
|
||||
#define BCMA_CC_CHIPST_4706_SFLASH_PRESENT BIT(1) /* 0: parallel, 1: serial flash is present */
|
||||
#define BCMA_CC_CHIPST_4706_SFLASH_TYPE BIT(2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */
|
||||
#define BCMA_CC_CHIPST_4706_MIPS_BENDIAN BIT(3) /* 0: little, 1: big endian */
|
||||
#define BCMA_CC_CHIPST_4706_PCIE1_DISABLE BIT(5) /* PCIE1 enable strap pin */
|
||||
#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */
|
||||
#define BCMA_CC_JCMD_START 0x80000000
|
||||
#define BCMA_CC_JCMD_BUSY 0x80000000
|
||||
|
|
@ -117,10 +129,58 @@
|
|||
#define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */
|
||||
#define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */
|
||||
#define BCMA_CC_FLASHCTL 0x0040
|
||||
/* Start/busy bit in flashcontrol */
|
||||
#define BCMA_CC_FLASHCTL_OPCODE 0x000000ff
|
||||
#define BCMA_CC_FLASHCTL_ACTION 0x00000700
|
||||
#define BCMA_CC_FLASHCTL_CS_ACTIVE 0x00001000 /* Chip Select Active, rev >= 20 */
|
||||
#define BCMA_CC_FLASHCTL_START 0x80000000
|
||||
#define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START
|
||||
/* Flashcontrol action + opcodes for ST flashes */
|
||||
#define BCMA_CC_FLASHCTL_ST_WREN 0x0006 /* Write Enable */
|
||||
#define BCMA_CC_FLASHCTL_ST_WRDIS 0x0004 /* Write Disable */
|
||||
#define BCMA_CC_FLASHCTL_ST_RDSR 0x0105 /* Read Status Register */
|
||||
#define BCMA_CC_FLASHCTL_ST_WRSR 0x0101 /* Write Status Register */
|
||||
#define BCMA_CC_FLASHCTL_ST_READ 0x0303 /* Read Data Bytes */
|
||||
#define BCMA_CC_FLASHCTL_ST_PP 0x0302 /* Page Program */
|
||||
#define BCMA_CC_FLASHCTL_ST_SE 0x02d8 /* Sector Erase */
|
||||
#define BCMA_CC_FLASHCTL_ST_BE 0x00c7 /* Bulk Erase */
|
||||
#define BCMA_CC_FLASHCTL_ST_DP 0x00b9 /* Deep Power-down */
|
||||
#define BCMA_CC_FLASHCTL_ST_RES 0x03ab /* Read Electronic Signature */
|
||||
#define BCMA_CC_FLASHCTL_ST_CSA 0x1000 /* Keep chip select asserted */
|
||||
#define BCMA_CC_FLASHCTL_ST_SSE 0x0220 /* Sub-sector Erase */
|
||||
/* Flashcontrol action + opcodes for Atmel flashes */
|
||||
#define BCMA_CC_FLASHCTL_AT_READ 0x07e8
|
||||
#define BCMA_CC_FLASHCTL_AT_PAGE_READ 0x07d2
|
||||
#define BCMA_CC_FLASHCTL_AT_STATUS 0x01d7
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF1_WRITE 0x0384
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF2_WRITE 0x0387
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF1_ERASE_PROGRAM 0x0283
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF2_ERASE_PROGRAM 0x0286
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF1_PROGRAM 0x0288
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF2_PROGRAM 0x0289
|
||||
#define BCMA_CC_FLASHCTL_AT_PAGE_ERASE 0x0281
|
||||
#define BCMA_CC_FLASHCTL_AT_BLOCK_ERASE 0x0250
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF1_LOAD 0x0253
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF2_LOAD 0x0255
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF1_COMPARE 0x0260
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF2_COMPARE 0x0261
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF1_REPROGRAM 0x0258
|
||||
#define BCMA_CC_FLASHCTL_AT_BUF2_REPROGRAM 0x0259
|
||||
#define BCMA_CC_FLASHADDR 0x0044
|
||||
#define BCMA_CC_FLASHDATA 0x0048
|
||||
/* Status register bits for ST flashes */
|
||||
#define BCMA_CC_FLASHDATA_ST_WIP 0x01 /* Write In Progress */
|
||||
#define BCMA_CC_FLASHDATA_ST_WEL 0x02 /* Write Enable Latch */
|
||||
#define BCMA_CC_FLASHDATA_ST_BP_MASK 0x1c /* Block Protect */
|
||||
#define BCMA_CC_FLASHDATA_ST_BP_SHIFT 2
|
||||
#define BCMA_CC_FLASHDATA_ST_SRWD 0x80 /* Status Register Write Disable */
|
||||
/* Status register bits for Atmel flashes */
|
||||
#define BCMA_CC_FLASHDATA_AT_READY 0x80
|
||||
#define BCMA_CC_FLASHDATA_AT_MISMATCH 0x40
|
||||
#define BCMA_CC_FLASHDATA_AT_ID_MASK 0x38
|
||||
#define BCMA_CC_FLASHDATA_AT_ID_SHIFT 3
|
||||
#define BCMA_CC_BCAST_ADDR 0x0050
|
||||
#define BCMA_CC_BCAST_DATA 0x0054
|
||||
#define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */
|
||||
|
|
@ -280,6 +340,15 @@
|
|||
|
||||
/* 4706 PMU */
|
||||
#define BCMA_CC_PMU4706_MAINPLL_PLL0 0
|
||||
#define BCMA_CC_PMU6_4706_PROCPLL_OFF 4 /* The CPU PLL */
|
||||
#define BCMA_CC_PMU6_4706_PROC_P2DIV_MASK 0x000f0000
|
||||
#define BCMA_CC_PMU6_4706_PROC_P2DIV_SHIFT 16
|
||||
#define BCMA_CC_PMU6_4706_PROC_P1DIV_MASK 0x0000f000
|
||||
#define BCMA_CC_PMU6_4706_PROC_P1DIV_SHIFT 12
|
||||
#define BCMA_CC_PMU6_4706_PROC_NDIV_INT_MASK 0x00000ff8
|
||||
#define BCMA_CC_PMU6_4706_PROC_NDIV_INT_SHIFT 3
|
||||
#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_MASK 0x00000007
|
||||
#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_SHIFT 0
|
||||
|
||||
/* ALP clock on pre-PMU chips */
|
||||
#define BCMA_CC_PMU_ALP_CLOCK 20000000
|
||||
|
|
@ -308,6 +377,19 @@
|
|||
#define BCMA_CC_PPL_PCHI_OFF 5
|
||||
#define BCMA_CC_PPL_PCHI_MASK 0x0000003f
|
||||
|
||||
#define BCMA_CC_PMU_PLL_CTL0 0
|
||||
#define BCMA_CC_PMU_PLL_CTL1 1
|
||||
#define BCMA_CC_PMU_PLL_CTL2 2
|
||||
#define BCMA_CC_PMU_PLL_CTL3 3
|
||||
#define BCMA_CC_PMU_PLL_CTL4 4
|
||||
#define BCMA_CC_PMU_PLL_CTL5 5
|
||||
|
||||
#define BCMA_CC_PMU1_PLL0_PC0_P1DIV_MASK 0x00f00000
|
||||
#define BCMA_CC_PMU1_PLL0_PC0_P1DIV_SHIFT 20
|
||||
|
||||
#define BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_MASK 0x1ff00000
|
||||
#define BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_SHIFT 20
|
||||
|
||||
/* BCM4331 ChipControl numbers. */
|
||||
#define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */
|
||||
#define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */
|
||||
|
|
@ -321,9 +403,18 @@
|
|||
#define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */
|
||||
#define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */
|
||||
#define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */
|
||||
#define BCMA_CHIPCTL_4331_EXTPA_EN2 BIT(12) /* 0 ext pa disable, 1 ext pa enabled */
|
||||
#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */
|
||||
#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */
|
||||
|
||||
/* 43224 chip-specific ChipControl register bits */
|
||||
#define BCMA_CCTRL_43224_GPIO_TOGGLE 0x8000 /* gpio[3:0] pins as btcoex or s/w gpio */
|
||||
#define BCMA_CCTRL_43224A0_12MA_LED_DRIVE 0x00F000F0 /* 12 mA drive strength */
|
||||
#define BCMA_CCTRL_43224B0_12MA_LED_DRIVE 0xF0 /* 12 mA drive strength for later 43224s */
|
||||
|
||||
/* 4313 Chip specific ChipControl register bits */
|
||||
#define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */
|
||||
|
||||
/* Data for the PMU, if available.
|
||||
* Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
|
||||
*/
|
||||
|
|
@ -411,5 +502,6 @@ extern void bcma_chipco_chipctl_maskset(struct bcma_drv_cc *cc,
|
|||
u32 offset, u32 mask, u32 set);
|
||||
extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc,
|
||||
u32 offset, u32 mask, u32 set);
|
||||
extern void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid);
|
||||
|
||||
#endif /* LINUX_BCMA_DRIVER_CC_H_ */
|
||||
|
|
|
|||
100
include/linux/bcma/bcma_driver_gmac_cmn.h
Normal file
100
include/linux/bcma/bcma_driver_gmac_cmn.h
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
#ifndef LINUX_BCMA_DRIVER_GMAC_CMN_H_
|
||||
#define LINUX_BCMA_DRIVER_GMAC_CMN_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define BCMA_GMAC_CMN_STAG0 0x000
|
||||
#define BCMA_GMAC_CMN_STAG1 0x004
|
||||
#define BCMA_GMAC_CMN_STAG2 0x008
|
||||
#define BCMA_GMAC_CMN_STAG3 0x00C
|
||||
#define BCMA_GMAC_CMN_PARSER_CTL 0x020
|
||||
#define BCMA_GMAC_CMN_MIB_MAX_LEN 0x024
|
||||
#define BCMA_GMAC_CMN_PHY_ACCESS 0x100
|
||||
#define BCMA_GMAC_CMN_PA_DATA_MASK 0x0000ffff
|
||||
#define BCMA_GMAC_CMN_PA_ADDR_MASK 0x001f0000
|
||||
#define BCMA_GMAC_CMN_PA_ADDR_SHIFT 16
|
||||
#define BCMA_GMAC_CMN_PA_REG_MASK 0x1f000000
|
||||
#define BCMA_GMAC_CMN_PA_REG_SHIFT 24
|
||||
#define BCMA_GMAC_CMN_PA_WRITE 0x20000000
|
||||
#define BCMA_GMAC_CMN_PA_START 0x40000000
|
||||
#define BCMA_GMAC_CMN_PHY_CTL 0x104
|
||||
#define BCMA_GMAC_CMN_PC_EPA_MASK 0x0000001f
|
||||
#define BCMA_GMAC_CMN_PC_MCT_MASK 0x007f0000
|
||||
#define BCMA_GMAC_CMN_PC_MCT_SHIFT 16
|
||||
#define BCMA_GMAC_CMN_PC_MTE 0x00800000
|
||||
#define BCMA_GMAC_CMN_GMAC0_RGMII_CTL 0x110
|
||||
#define BCMA_GMAC_CMN_CFP_ACCESS 0x200
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_DATA0 0x210
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_DATA1 0x214
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_DATA2 0x218
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_DATA3 0x21C
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_DATA4 0x220
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_DATA5 0x224
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_DATA6 0x228
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_DATA7 0x22C
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_MASK0 0x230
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_MASK1 0x234
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_MASK2 0x238
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_MASK3 0x23C
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_MASK4 0x240
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_MASK5 0x244
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_MASK6 0x248
|
||||
#define BCMA_GMAC_CMN_CFP_TCAM_MASK7 0x24C
|
||||
#define BCMA_GMAC_CMN_CFP_ACTION_DATA 0x250
|
||||
#define BCMA_GMAC_CMN_TCAM_BIST_CTL 0x2A0
|
||||
#define BCMA_GMAC_CMN_TCAM_BIST_STATUS 0x2A4
|
||||
#define BCMA_GMAC_CMN_TCAM_CMP_STATUS 0x2A8
|
||||
#define BCMA_GMAC_CMN_TCAM_DISABLE 0x2AC
|
||||
#define BCMA_GMAC_CMN_TCAM_TEST_CTL 0x2F0
|
||||
#define BCMA_GMAC_CMN_UDF_0_A3_A0 0x300
|
||||
#define BCMA_GMAC_CMN_UDF_0_A7_A4 0x304
|
||||
#define BCMA_GMAC_CMN_UDF_0_A8 0x308
|
||||
#define BCMA_GMAC_CMN_UDF_1_A3_A0 0x310
|
||||
#define BCMA_GMAC_CMN_UDF_1_A7_A4 0x314
|
||||
#define BCMA_GMAC_CMN_UDF_1_A8 0x318
|
||||
#define BCMA_GMAC_CMN_UDF_2_A3_A0 0x320
|
||||
#define BCMA_GMAC_CMN_UDF_2_A7_A4 0x324
|
||||
#define BCMA_GMAC_CMN_UDF_2_A8 0x328
|
||||
#define BCMA_GMAC_CMN_UDF_0_B3_B0 0x330
|
||||
#define BCMA_GMAC_CMN_UDF_0_B7_B4 0x334
|
||||
#define BCMA_GMAC_CMN_UDF_0_B8 0x338
|
||||
#define BCMA_GMAC_CMN_UDF_1_B3_B0 0x340
|
||||
#define BCMA_GMAC_CMN_UDF_1_B7_B4 0x344
|
||||
#define BCMA_GMAC_CMN_UDF_1_B8 0x348
|
||||
#define BCMA_GMAC_CMN_UDF_2_B3_B0 0x350
|
||||
#define BCMA_GMAC_CMN_UDF_2_B7_B4 0x354
|
||||
#define BCMA_GMAC_CMN_UDF_2_B8 0x358
|
||||
#define BCMA_GMAC_CMN_UDF_0_C3_C0 0x360
|
||||
#define BCMA_GMAC_CMN_UDF_0_C7_C4 0x364
|
||||
#define BCMA_GMAC_CMN_UDF_0_C8 0x368
|
||||
#define BCMA_GMAC_CMN_UDF_1_C3_C0 0x370
|
||||
#define BCMA_GMAC_CMN_UDF_1_C7_C4 0x374
|
||||
#define BCMA_GMAC_CMN_UDF_1_C8 0x378
|
||||
#define BCMA_GMAC_CMN_UDF_2_C3_C0 0x380
|
||||
#define BCMA_GMAC_CMN_UDF_2_C7_C4 0x384
|
||||
#define BCMA_GMAC_CMN_UDF_2_C8 0x388
|
||||
#define BCMA_GMAC_CMN_UDF_0_D3_D0 0x390
|
||||
#define BCMA_GMAC_CMN_UDF_0_D7_D4 0x394
|
||||
#define BCMA_GMAC_CMN_UDF_0_D11_D8 0x394
|
||||
|
||||
struct bcma_drv_gmac_cmn {
|
||||
struct bcma_device *core;
|
||||
|
||||
/* Drivers accessing BCMA_GMAC_CMN_PHY_ACCESS and
|
||||
* BCMA_GMAC_CMN_PHY_CTL need to take that mutex first. */
|
||||
struct mutex phy_mutex;
|
||||
};
|
||||
|
||||
/* Register access */
|
||||
#define gmac_cmn_read16(gc, offset) bcma_read16((gc)->core, offset)
|
||||
#define gmac_cmn_read32(gc, offset) bcma_read32((gc)->core, offset)
|
||||
#define gmac_cmn_write16(gc, offset, val) bcma_write16((gc)->core, offset, val)
|
||||
#define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val)
|
||||
|
||||
#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
|
||||
extern void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
|
||||
#else
|
||||
static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { }
|
||||
#endif
|
||||
|
||||
#endif /* LINUX_BCMA_DRIVER_GMAC_CMN_H_ */
|
||||
|
|
@ -160,6 +160,7 @@ enum rq_flag_bits {
|
|||
__REQ_FLUSH_SEQ, /* request for flush sequence */
|
||||
__REQ_IO_STAT, /* account I/O stat */
|
||||
__REQ_MIXED_MERGE, /* merge of different types, fail separately */
|
||||
__REQ_KERNEL, /* direct IO to kernel pages */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
|
|
@ -201,5 +202,6 @@ enum rq_flag_bits {
|
|||
#define REQ_IO_STAT (1 << __REQ_IO_STAT)
|
||||
#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
|
||||
#define REQ_SECURE (1 << __REQ_SECURE)
|
||||
#define REQ_KERNEL (1 << __REQ_KERNEL)
|
||||
|
||||
#endif /* __LINUX_BLK_TYPES_H */
|
||||
|
|
|
|||
|
|
@ -46,16 +46,23 @@ struct blkcg_gq;
|
|||
struct request;
|
||||
typedef void (rq_end_io_fn)(struct request *, int);
|
||||
|
||||
#define BLK_RL_SYNCFULL (1U << 0)
|
||||
#define BLK_RL_ASYNCFULL (1U << 1)
|
||||
|
||||
struct request_list {
|
||||
struct request_queue *q; /* the queue this rl belongs to */
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
struct blkcg_gq *blkg; /* blkg this request pool belongs to */
|
||||
#endif
|
||||
/*
|
||||
* count[], starved[], and wait[] are indexed by
|
||||
* BLK_RW_SYNC/BLK_RW_ASYNC
|
||||
*/
|
||||
int count[2];
|
||||
int starved[2];
|
||||
int elvpriv;
|
||||
mempool_t *rq_pool;
|
||||
wait_queue_head_t wait[2];
|
||||
int count[2];
|
||||
int starved[2];
|
||||
mempool_t *rq_pool;
|
||||
wait_queue_head_t wait[2];
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -138,6 +145,7 @@ struct request {
|
|||
struct hd_struct *part;
|
||||
unsigned long start_time;
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
struct request_list *rl; /* rl this rq is alloced from */
|
||||
unsigned long long start_time_ns;
|
||||
unsigned long long io_start_time_ns; /* when passed to hardware */
|
||||
#endif
|
||||
|
|
@ -282,11 +290,16 @@ struct request_queue {
|
|||
struct list_head queue_head;
|
||||
struct request *last_merge;
|
||||
struct elevator_queue *elevator;
|
||||
int nr_rqs[2]; /* # allocated [a]sync rqs */
|
||||
int nr_rqs_elvpriv; /* # allocated rqs w/ elvpriv */
|
||||
|
||||
/*
|
||||
* the queue request freelist, one for reads and one for writes
|
||||
* If blkcg is not used, @q->root_rl serves all requests. If blkcg
|
||||
* is used, root blkg allocates from @q->root_rl and all other
|
||||
* blkgs from their own blkg->rl. Which one to use should be
|
||||
* determined using bio_request_list().
|
||||
*/
|
||||
struct request_list rq;
|
||||
struct request_list root_rl;
|
||||
|
||||
request_fn_proc *request_fn;
|
||||
make_request_fn *make_request_fn;
|
||||
|
|
@ -561,27 +574,25 @@ static inline bool rq_is_sync(struct request *rq)
|
|||
return rw_is_sync(rq->cmd_flags);
|
||||
}
|
||||
|
||||
static inline int blk_queue_full(struct request_queue *q, int sync)
|
||||
static inline bool blk_rl_full(struct request_list *rl, bool sync)
|
||||
{
|
||||
if (sync)
|
||||
return test_bit(QUEUE_FLAG_SYNCFULL, &q->queue_flags);
|
||||
return test_bit(QUEUE_FLAG_ASYNCFULL, &q->queue_flags);
|
||||
unsigned int flag = sync ? BLK_RL_SYNCFULL : BLK_RL_ASYNCFULL;
|
||||
|
||||
return rl->flags & flag;
|
||||
}
|
||||
|
||||
static inline void blk_set_queue_full(struct request_queue *q, int sync)
|
||||
static inline void blk_set_rl_full(struct request_list *rl, bool sync)
|
||||
{
|
||||
if (sync)
|
||||
queue_flag_set(QUEUE_FLAG_SYNCFULL, q);
|
||||
else
|
||||
queue_flag_set(QUEUE_FLAG_ASYNCFULL, q);
|
||||
unsigned int flag = sync ? BLK_RL_SYNCFULL : BLK_RL_ASYNCFULL;
|
||||
|
||||
rl->flags |= flag;
|
||||
}
|
||||
|
||||
static inline void blk_clear_queue_full(struct request_queue *q, int sync)
|
||||
static inline void blk_clear_rl_full(struct request_list *rl, bool sync)
|
||||
{
|
||||
if (sync)
|
||||
queue_flag_clear(QUEUE_FLAG_SYNCFULL, q);
|
||||
else
|
||||
queue_flag_clear(QUEUE_FLAG_ASYNCFULL, q);
|
||||
unsigned int flag = sync ? BLK_RL_SYNCFULL : BLK_RL_ASYNCFULL;
|
||||
|
||||
rl->flags &= ~flag;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -590,7 +601,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync)
|
|||
* it already be started by driver.
|
||||
*/
|
||||
#define RQ_NOMERGE_FLAGS \
|
||||
(REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)
|
||||
(REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD)
|
||||
#define rq_mergeable(rq) \
|
||||
(!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
|
||||
(((rq)->cmd_flags & REQ_DISCARD) || \
|
||||
|
|
@ -883,6 +894,8 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
|
|||
extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
|
||||
|
||||
extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
|
||||
extern int blk_bio_map_sg(struct request_queue *q, struct bio *bio,
|
||||
struct scatterlist *sglist);
|
||||
extern void blk_dump_rq_flags(struct request *, char *);
|
||||
extern long nr_blockdev_pages(void);
|
||||
|
||||
|
|
@ -911,11 +924,15 @@ struct blk_plug {
|
|||
};
|
||||
#define BLK_MAX_REQUEST_COUNT 16
|
||||
|
||||
struct blk_plug_cb;
|
||||
typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *, bool);
|
||||
struct blk_plug_cb {
|
||||
struct list_head list;
|
||||
void (*callback)(struct blk_plug_cb *);
|
||||
blk_plug_cb_fn callback;
|
||||
void *data;
|
||||
};
|
||||
|
||||
extern struct blk_plug_cb *blk_check_plugged(blk_plug_cb_fn unplug,
|
||||
void *data, int size);
|
||||
extern void blk_start_plug(struct blk_plug *);
|
||||
extern void blk_finish_plug(struct blk_plug *);
|
||||
extern void blk_flush_plug_list(struct blk_plug *, bool);
|
||||
|
|
@ -1124,6 +1141,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector
|
|||
& (lim->discard_granularity - 1);
|
||||
}
|
||||
|
||||
static inline int bdev_discard_alignment(struct block_device *bdev)
|
||||
{
|
||||
struct request_queue *q = bdev_get_queue(bdev);
|
||||
|
||||
if (bdev != bdev->bd_contains)
|
||||
return bdev->bd_part->discard_alignment;
|
||||
|
||||
return q->limits.discard_alignment;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
|
||||
{
|
||||
if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ struct blkpg_ioctl_arg {
|
|||
/* The subfunctions (for the op field) */
|
||||
#define BLKPG_ADD_PARTITION 1
|
||||
#define BLKPG_DEL_PARTITION 2
|
||||
#define BLKPG_RESIZE_PARTITION 3
|
||||
|
||||
/* Sizes of name fields. Unused at present. */
|
||||
#define BLKPG_DEVNAMELTH 64
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ void bsg_job_done(struct bsg_job *job, int result,
|
|||
int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name,
|
||||
bsg_job_fn *job_fn, int dd_job_size);
|
||||
void bsg_request_fn(struct request_queue *q);
|
||||
void bsg_remove_queue(struct request_queue *q);
|
||||
void bsg_goose_queue(struct request_queue *q);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
/* special address description flags for the CAN_ID */
|
||||
#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
|
||||
#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
|
||||
#define CAN_ERR_FLAG 0x20000000U /* error frame */
|
||||
#define CAN_ERR_FLAG 0x20000000U /* error message frame */
|
||||
|
||||
/* valid bits in CAN ID for frame formats */
|
||||
#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
|
||||
|
|
@ -32,32 +32,85 @@
|
|||
* Controller Area Network Identifier structure
|
||||
*
|
||||
* bit 0-28 : CAN identifier (11/29 bit)
|
||||
* bit 29 : error frame flag (0 = data frame, 1 = error frame)
|
||||
* bit 29 : error message frame flag (0 = data frame, 1 = error message)
|
||||
* bit 30 : remote transmission request flag (1 = rtr frame)
|
||||
* bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
|
||||
*/
|
||||
typedef __u32 canid_t;
|
||||
|
||||
#define CAN_SFF_ID_BITS 11
|
||||
#define CAN_EFF_ID_BITS 29
|
||||
|
||||
/*
|
||||
* Controller Area Network Error Frame Mask structure
|
||||
* Controller Area Network Error Message Frame Mask structure
|
||||
*
|
||||
* bit 0-28 : error class mask (see include/linux/can/error.h)
|
||||
* bit 29-31 : set to zero
|
||||
*/
|
||||
typedef __u32 can_err_mask_t;
|
||||
|
||||
/* CAN payload length and DLC definitions according to ISO 11898-1 */
|
||||
#define CAN_MAX_DLC 8
|
||||
#define CAN_MAX_DLEN 8
|
||||
|
||||
/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
|
||||
#define CANFD_MAX_DLC 15
|
||||
#define CANFD_MAX_DLEN 64
|
||||
|
||||
/**
|
||||
* struct can_frame - basic CAN frame structure
|
||||
* @can_id: the CAN ID of the frame and CAN_*_FLAG flags, see above.
|
||||
* @can_dlc: the data length field of the CAN frame
|
||||
* @data: the CAN frame payload.
|
||||
* @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
|
||||
* @can_dlc: frame payload length in byte (0 .. 8) aka data length code
|
||||
* N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
|
||||
* mapping of the 'data length code' to the real payload length
|
||||
* @data: CAN frame payload (up to 8 byte)
|
||||
*/
|
||||
struct can_frame {
|
||||
canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
|
||||
__u8 can_dlc; /* data length code: 0 .. 8 */
|
||||
__u8 data[8] __attribute__((aligned(8)));
|
||||
__u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
|
||||
__u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
|
||||
};
|
||||
|
||||
/*
|
||||
* defined bits for canfd_frame.flags
|
||||
*
|
||||
* The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
|
||||
* be set in the CAN frame bitstream on the wire. The EDL bit switch turns
|
||||
* the CAN controllers bitstream processor into the CAN FD mode which creates
|
||||
* two new options within the CAN FD frame specification:
|
||||
*
|
||||
* Bit Rate Switch - to indicate a second bitrate is/was used for the payload
|
||||
* Error State Indicator - represents the error state of the transmitting node
|
||||
*
|
||||
* As the CANFD_ESI bit is internally generated by the transmitting CAN
|
||||
* controller only the CANFD_BRS bit is relevant for real CAN controllers when
|
||||
* building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
|
||||
* sense for virtual CAN interfaces to test applications with echoed frames.
|
||||
*/
|
||||
#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
|
||||
#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
|
||||
|
||||
/**
|
||||
* struct canfd_frame - CAN flexible data rate frame structure
|
||||
* @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
|
||||
* @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
|
||||
* @flags: additional flags for CAN FD
|
||||
* @__res0: reserved / padding
|
||||
* @__res1: reserved / padding
|
||||
* @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
|
||||
*/
|
||||
struct canfd_frame {
|
||||
canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
|
||||
__u8 len; /* frame payload length in byte */
|
||||
__u8 flags; /* additional flags for CAN FD */
|
||||
__u8 __res0; /* reserved / padding */
|
||||
__u8 __res1; /* reserved / padding */
|
||||
__u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
|
||||
};
|
||||
|
||||
#define CAN_MTU (sizeof(struct can_frame))
|
||||
#define CANFD_MTU (sizeof(struct canfd_frame))
|
||||
|
||||
/* particular protocols of the protocol family PF_CAN */
|
||||
#define CAN_RAW 1 /* RAW sockets */
|
||||
#define CAN_BCM 2 /* Broadcast Manager */
|
||||
|
|
@ -97,7 +150,7 @@ struct sockaddr_can {
|
|||
* <received_can_id> & mask == can_id & mask
|
||||
*
|
||||
* The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
|
||||
* filter for error frames (CAN_ERR_FLAG bit set in mask).
|
||||
* filter for error message frames (CAN_ERR_FLAG bit set in mask).
|
||||
*/
|
||||
struct can_filter {
|
||||
canid_t can_id;
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@
|
|||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
|
||||
#define CAN_VERSION "20090105"
|
||||
#define CAN_VERSION "20120528"
|
||||
|
||||
/* increment this number each time you change some user-space interface */
|
||||
#define CAN_ABI_VERSION "8"
|
||||
#define CAN_ABI_VERSION "9"
|
||||
|
||||
#define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ struct can_priv {
|
|||
struct can_device_stats can_stats;
|
||||
|
||||
struct can_bittiming bittiming;
|
||||
struct can_bittiming_const *bittiming_const;
|
||||
const struct can_bittiming_const *bittiming_const;
|
||||
struct can_clock clock;
|
||||
|
||||
enum can_state state;
|
||||
|
|
@ -61,23 +61,40 @@ struct can_priv {
|
|||
* To be used in the CAN netdriver receive path to ensure conformance with
|
||||
* ISO 11898-1 Chapter 8.4.2.3 (DLC field)
|
||||
*/
|
||||
#define get_can_dlc(i) (min_t(__u8, (i), 8))
|
||||
#define get_can_dlc(i) (min_t(__u8, (i), CAN_MAX_DLC))
|
||||
#define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC))
|
||||
|
||||
/* Drop a given socketbuffer if it does not contain a valid CAN frame. */
|
||||
static inline int can_dropped_invalid_skb(struct net_device *dev,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
const struct can_frame *cf = (struct can_frame *)skb->data;
|
||||
const struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
|
||||
|
||||
if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) {
|
||||
kfree_skb(skb);
|
||||
dev->stats.tx_dropped++;
|
||||
return 1;
|
||||
}
|
||||
if (skb->protocol == htons(ETH_P_CAN)) {
|
||||
if (unlikely(skb->len != CAN_MTU ||
|
||||
cfd->len > CAN_MAX_DLEN))
|
||||
goto inval_skb;
|
||||
} else if (skb->protocol == htons(ETH_P_CANFD)) {
|
||||
if (unlikely(skb->len != CANFD_MTU ||
|
||||
cfd->len > CANFD_MAX_DLEN))
|
||||
goto inval_skb;
|
||||
} else
|
||||
goto inval_skb;
|
||||
|
||||
return 0;
|
||||
|
||||
inval_skb:
|
||||
kfree_skb(skb);
|
||||
dev->stats.tx_dropped++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* get data length from can_dlc with sanitized can_dlc */
|
||||
u8 can_dlc2len(u8 can_dlc);
|
||||
|
||||
/* map the sanitized data length to an appropriate data length code */
|
||||
u8 can_len2dlc(u8 len);
|
||||
|
||||
struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
|
||||
void free_candev(struct net_device *dev);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* linux/can/error.h
|
||||
*
|
||||
* Definitions of the CAN error frame to be filtered and passed to the user.
|
||||
* Definitions of the CAN error messages to be filtered and passed to the user.
|
||||
*
|
||||
* Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
|
||||
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
#ifndef CAN_ERROR_H
|
||||
#define CAN_ERROR_H
|
||||
|
||||
#define CAN_ERR_DLC 8 /* dlc for error frames */
|
||||
#define CAN_ERR_DLC 8 /* dlc for error message frames */
|
||||
|
||||
/* error class (mask) in can_id */
|
||||
#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ enum {
|
|||
CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */
|
||||
CAN_RAW_ERR_FILTER, /* set filter for error frames */
|
||||
CAN_RAW_LOOPBACK, /* local loopback (default:on) */
|
||||
CAN_RAW_RECV_OWN_MSGS /* receive my own msgs (default:off) */
|
||||
CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */
|
||||
CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -360,11 +360,11 @@ struct cpu_vfs_cap_data {
|
|||
|
||||
#define CAP_WAKE_ALARM 35
|
||||
|
||||
/* Allow preventing system suspends while epoll events are pending */
|
||||
/* Allow preventing system suspends */
|
||||
|
||||
#define CAP_EPOLLWAKEUP 36
|
||||
#define CAP_BLOCK_SUSPEND 36
|
||||
|
||||
#define CAP_LAST_CAP CAP_EPOLLWAKEUP
|
||||
#define CAP_LAST_CAP CAP_BLOCK_SUSPEND
|
||||
|
||||
#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
|
||||
|
||||
|
|
|
|||
27
include/linux/ceph/ceph_features.h
Normal file
27
include/linux/ceph/ceph_features.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef __CEPH_FEATURES
|
||||
#define __CEPH_FEATURES
|
||||
|
||||
/*
|
||||
* feature bits
|
||||
*/
|
||||
#define CEPH_FEATURE_UID (1<<0)
|
||||
#define CEPH_FEATURE_NOSRCADDR (1<<1)
|
||||
#define CEPH_FEATURE_MONCLOCKCHECK (1<<2)
|
||||
#define CEPH_FEATURE_FLOCK (1<<3)
|
||||
#define CEPH_FEATURE_SUBSCRIBE2 (1<<4)
|
||||
#define CEPH_FEATURE_MONNAMES (1<<5)
|
||||
#define CEPH_FEATURE_RECONNECT_SEQ (1<<6)
|
||||
#define CEPH_FEATURE_DIRLAYOUTHASH (1<<7)
|
||||
/* bits 8-17 defined by user-space; not supported yet here */
|
||||
#define CEPH_FEATURE_CRUSH_TUNABLES (1<<18)
|
||||
|
||||
/*
|
||||
* Features supported.
|
||||
*/
|
||||
#define CEPH_FEATURES_SUPPORTED_DEFAULT \
|
||||
(CEPH_FEATURE_NOSRCADDR | \
|
||||
CEPH_FEATURE_CRUSH_TUNABLES)
|
||||
|
||||
#define CEPH_FEATURES_REQUIRED_DEFAULT \
|
||||
(CEPH_FEATURE_NOSRCADDR)
|
||||
#endif
|
||||
|
|
@ -35,20 +35,6 @@
|
|||
/* arbitrary limit on max # of monitors (cluster of 3 is typical) */
|
||||
#define CEPH_MAX_MON 31
|
||||
|
||||
|
||||
/*
|
||||
* feature bits
|
||||
*/
|
||||
#define CEPH_FEATURE_UID (1<<0)
|
||||
#define CEPH_FEATURE_NOSRCADDR (1<<1)
|
||||
#define CEPH_FEATURE_MONCLOCKCHECK (1<<2)
|
||||
#define CEPH_FEATURE_FLOCK (1<<3)
|
||||
#define CEPH_FEATURE_SUBSCRIBE2 (1<<4)
|
||||
#define CEPH_FEATURE_MONNAMES (1<<5)
|
||||
#define CEPH_FEATURE_RECONNECT_SEQ (1<<6)
|
||||
#define CEPH_FEATURE_DIRLAYOUTHASH (1<<7)
|
||||
|
||||
|
||||
/*
|
||||
* ceph_file_layout - describe data layout for a file/inode
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef __CEPH_DECODE_H
|
||||
#define __CEPH_DECODE_H
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/time.h>
|
||||
#include <asm/unaligned.h>
|
||||
|
|
@ -84,6 +85,52 @@ static inline int ceph_has_room(void **p, void *end, size_t n)
|
|||
ceph_decode_copy(p, pv, n); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Allocate a buffer big enough to hold the wire-encoded string, and
|
||||
* decode the string into it. The resulting string will always be
|
||||
* terminated with '\0'. If successful, *p will be advanced
|
||||
* past the decoded data. Also, if lenp is not a null pointer, the
|
||||
* length (not including the terminating '\0') will be recorded in
|
||||
* *lenp. Note that a zero-length string is a valid return value.
|
||||
*
|
||||
* Returns a pointer to the newly-allocated string buffer, or a
|
||||
* pointer-coded errno if an error occurs. Neither *p nor *lenp
|
||||
* will have been updated if an error is returned.
|
||||
*
|
||||
* There are two possible failures:
|
||||
* - converting the string would require accessing memory at or
|
||||
* beyond the "end" pointer provided (-E
|
||||
* - memory could not be allocated for the result
|
||||
*/
|
||||
static inline char *ceph_extract_encoded_string(void **p, void *end,
|
||||
size_t *lenp, gfp_t gfp)
|
||||
{
|
||||
u32 len;
|
||||
void *sp = *p;
|
||||
char *buf;
|
||||
|
||||
ceph_decode_32_safe(&sp, end, len, bad);
|
||||
if (!ceph_has_room(&sp, end, len))
|
||||
goto bad;
|
||||
|
||||
buf = kmalloc(len + 1, gfp);
|
||||
if (!buf)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
if (len)
|
||||
memcpy(buf, sp, len);
|
||||
buf[len] = '\0';
|
||||
|
||||
*p = (char *) *p + sizeof (u32) + len;
|
||||
if (lenp)
|
||||
*lenp = (size_t) len;
|
||||
|
||||
return buf;
|
||||
|
||||
bad:
|
||||
return ERR_PTR(-ERANGE);
|
||||
}
|
||||
|
||||
/*
|
||||
* struct ceph_timespec <-> struct timespec
|
||||
*/
|
||||
|
|
@ -151,7 +198,7 @@ static inline void ceph_encode_filepath(void **p, void *end,
|
|||
u64 ino, const char *path)
|
||||
{
|
||||
u32 len = path ? strlen(path) : 0;
|
||||
BUG_ON(*p + sizeof(ino) + sizeof(len) + len > end);
|
||||
BUG_ON(*p + 1 + sizeof(ino) + sizeof(len) + len > end);
|
||||
ceph_encode_8(p, 1);
|
||||
ceph_encode_64(p, ino);
|
||||
ceph_encode_32(p, len);
|
||||
|
|
|
|||
|
|
@ -22,12 +22,6 @@
|
|||
#include "osd_client.h"
|
||||
#include "ceph_fs.h"
|
||||
|
||||
/*
|
||||
* Supported features
|
||||
*/
|
||||
#define CEPH_FEATURE_SUPPORTED_DEFAULT CEPH_FEATURE_NOSRCADDR
|
||||
#define CEPH_FEATURE_REQUIRED_DEFAULT CEPH_FEATURE_NOSRCADDR
|
||||
|
||||
/*
|
||||
* mount options
|
||||
*/
|
||||
|
|
@ -132,7 +126,7 @@ struct ceph_client {
|
|||
u32 supported_features;
|
||||
u32 required_features;
|
||||
|
||||
struct ceph_messenger *msgr; /* messenger instance */
|
||||
struct ceph_messenger msgr; /* messenger instance */
|
||||
struct ceph_mon_client monc;
|
||||
struct ceph_osd_client osdc;
|
||||
|
||||
|
|
@ -160,7 +154,7 @@ struct ceph_client {
|
|||
struct ceph_snap_context {
|
||||
atomic_t nref;
|
||||
u64 seq;
|
||||
int num_snaps;
|
||||
u32 num_snaps;
|
||||
u64 snaps[];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,6 @@ struct ceph_connection_operations {
|
|||
int (*verify_authorizer_reply) (struct ceph_connection *con, int len);
|
||||
int (*invalidate_authorizer)(struct ceph_connection *con);
|
||||
|
||||
/* protocol version mismatch */
|
||||
void (*bad_proto) (struct ceph_connection *con);
|
||||
|
||||
/* there was some error on the socket (disconnect, whatever) */
|
||||
void (*fault) (struct ceph_connection *con);
|
||||
|
||||
|
|
@ -53,6 +50,7 @@ struct ceph_messenger {
|
|||
struct ceph_entity_inst inst; /* my name+address */
|
||||
struct ceph_entity_addr my_enc_addr;
|
||||
|
||||
atomic_t stopping;
|
||||
bool nocrc;
|
||||
|
||||
/*
|
||||
|
|
@ -80,7 +78,10 @@ struct ceph_msg {
|
|||
unsigned nr_pages; /* size of page array */
|
||||
unsigned page_alignment; /* io offset in first page */
|
||||
struct ceph_pagelist *pagelist; /* instead of pages */
|
||||
|
||||
struct ceph_connection *con;
|
||||
struct list_head list_head;
|
||||
|
||||
struct kref kref;
|
||||
struct bio *bio; /* instead of pages/pagelist */
|
||||
struct bio *bio_iter; /* bio iterator */
|
||||
|
|
@ -105,23 +106,6 @@ struct ceph_msg_pos {
|
|||
#define BASE_DELAY_INTERVAL (HZ/2)
|
||||
#define MAX_DELAY_INTERVAL (5 * 60 * HZ)
|
||||
|
||||
/*
|
||||
* ceph_connection state bit flags
|
||||
*/
|
||||
#define LOSSYTX 0 /* we can close channel or drop messages on errors */
|
||||
#define CONNECTING 1
|
||||
#define NEGOTIATING 2
|
||||
#define KEEPALIVE_PENDING 3
|
||||
#define WRITE_PENDING 4 /* we have data ready to send */
|
||||
#define STANDBY 8 /* no outgoing messages, socket closed. we keep
|
||||
* the ceph_connection around to maintain shared
|
||||
* state with the peer. */
|
||||
#define CLOSED 10 /* we've closed the connection */
|
||||
#define SOCK_CLOSED 11 /* socket state changed to closed */
|
||||
#define OPENING 13 /* open connection w/ (possibly new) peer */
|
||||
#define DEAD 14 /* dead, about to kfree */
|
||||
#define BACKOFF 15
|
||||
|
||||
/*
|
||||
* A single connection with another host.
|
||||
*
|
||||
|
|
@ -131,18 +115,22 @@ struct ceph_msg_pos {
|
|||
*/
|
||||
struct ceph_connection {
|
||||
void *private;
|
||||
atomic_t nref;
|
||||
|
||||
const struct ceph_connection_operations *ops;
|
||||
|
||||
struct ceph_messenger *msgr;
|
||||
|
||||
atomic_t sock_state;
|
||||
struct socket *sock;
|
||||
unsigned long state; /* connection state (see flags above) */
|
||||
struct ceph_entity_addr peer_addr; /* peer address */
|
||||
struct ceph_entity_addr peer_addr_for_me;
|
||||
|
||||
unsigned long flags;
|
||||
unsigned long state;
|
||||
const char *error_msg; /* error message, if any */
|
||||
|
||||
struct ceph_entity_addr peer_addr; /* peer address */
|
||||
struct ceph_entity_name peer_name; /* peer name */
|
||||
struct ceph_entity_addr peer_addr_for_me;
|
||||
|
||||
unsigned peer_features;
|
||||
u32 connect_seq; /* identify the most recent connection
|
||||
attempt for this connection, client */
|
||||
|
|
@ -163,16 +151,8 @@ struct ceph_connection {
|
|||
|
||||
/* connection negotiation temps */
|
||||
char in_banner[CEPH_BANNER_MAX_LEN];
|
||||
union {
|
||||
struct { /* outgoing connection */
|
||||
struct ceph_msg_connect out_connect;
|
||||
struct ceph_msg_connect_reply in_reply;
|
||||
};
|
||||
struct { /* incoming */
|
||||
struct ceph_msg_connect in_connect;
|
||||
struct ceph_msg_connect_reply out_reply;
|
||||
};
|
||||
};
|
||||
struct ceph_msg_connect out_connect;
|
||||
struct ceph_msg_connect_reply in_reply;
|
||||
struct ceph_entity_addr actual_peer_addr;
|
||||
|
||||
/* message out temps */
|
||||
|
|
@ -215,24 +195,26 @@ extern int ceph_msgr_init(void);
|
|||
extern void ceph_msgr_exit(void);
|
||||
extern void ceph_msgr_flush(void);
|
||||
|
||||
extern struct ceph_messenger *ceph_messenger_create(
|
||||
struct ceph_entity_addr *myaddr,
|
||||
u32 features, u32 required);
|
||||
extern void ceph_messenger_destroy(struct ceph_messenger *);
|
||||
extern void ceph_messenger_init(struct ceph_messenger *msgr,
|
||||
struct ceph_entity_addr *myaddr,
|
||||
u32 supported_features,
|
||||
u32 required_features,
|
||||
bool nocrc);
|
||||
|
||||
extern void ceph_con_init(struct ceph_messenger *msgr,
|
||||
struct ceph_connection *con);
|
||||
extern void ceph_con_init(struct ceph_connection *con, void *private,
|
||||
const struct ceph_connection_operations *ops,
|
||||
struct ceph_messenger *msgr);
|
||||
extern void ceph_con_open(struct ceph_connection *con,
|
||||
__u8 entity_type, __u64 entity_num,
|
||||
struct ceph_entity_addr *addr);
|
||||
extern bool ceph_con_opened(struct ceph_connection *con);
|
||||
extern void ceph_con_close(struct ceph_connection *con);
|
||||
extern void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg);
|
||||
extern void ceph_con_revoke(struct ceph_connection *con, struct ceph_msg *msg);
|
||||
extern void ceph_con_revoke_message(struct ceph_connection *con,
|
||||
struct ceph_msg *msg);
|
||||
|
||||
extern void ceph_msg_revoke(struct ceph_msg *msg);
|
||||
extern void ceph_msg_revoke_incoming(struct ceph_msg *msg);
|
||||
|
||||
extern void ceph_con_keepalive(struct ceph_connection *con);
|
||||
extern struct ceph_connection *ceph_con_get(struct ceph_connection *con);
|
||||
extern void ceph_con_put(struct ceph_connection *con);
|
||||
|
||||
extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
|
||||
bool can_fail);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ struct ceph_mon_client {
|
|||
bool hunting;
|
||||
int cur_mon; /* last monitor i contacted */
|
||||
unsigned long sub_sent, sub_renew_after;
|
||||
struct ceph_connection *con;
|
||||
struct ceph_connection con;
|
||||
bool have_fsid;
|
||||
|
||||
/* pending generic requests */
|
||||
|
|
|
|||
|
|
@ -11,10 +11,11 @@
|
|||
struct ceph_msgpool {
|
||||
const char *name;
|
||||
mempool_t *pool;
|
||||
int type; /* preallocated message type */
|
||||
int front_len; /* preallocated payload size */
|
||||
};
|
||||
|
||||
extern int ceph_msgpool_init(struct ceph_msgpool *pool,
|
||||
extern int ceph_msgpool_init(struct ceph_msgpool *pool, int type,
|
||||
int front_len, int size, bool blocking,
|
||||
const char *name);
|
||||
extern void ceph_msgpool_destroy(struct ceph_msgpool *pool);
|
||||
|
|
|
|||
|
|
@ -499,22 +499,9 @@ struct cgroup_subsys {
|
|||
#define MAX_CGROUP_TYPE_NAMELEN 32
|
||||
const char *name;
|
||||
|
||||
/*
|
||||
* Protects sibling/children links of cgroups in this
|
||||
* hierarchy, plus protects which hierarchy (or none) the
|
||||
* subsystem is a part of (i.e. root/sibling). To avoid
|
||||
* potential deadlocks, the following operations should not be
|
||||
* undertaken while holding any hierarchy_mutex:
|
||||
*
|
||||
* - allocating memory
|
||||
* - initiating hotplug events
|
||||
*/
|
||||
struct mutex hierarchy_mutex;
|
||||
struct lock_class_key subsys_key;
|
||||
|
||||
/*
|
||||
* Link to parent, and list entry in parent's children.
|
||||
* Protected by this->hierarchy_mutex and cgroup_lock()
|
||||
* Protected by cgroup_lock()
|
||||
*/
|
||||
struct cgroupfs_root *root;
|
||||
struct list_head sibling;
|
||||
|
|
@ -602,7 +589,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
|
|||
* the lifetime of cgroup_subsys_state is subsys's matter.
|
||||
*
|
||||
* Looking up and scanning function should be called under rcu_read_lock().
|
||||
* Taking cgroup_mutex()/hierarchy_mutex() is not necessary for following calls.
|
||||
* Taking cgroup_mutex is not necessary for following calls.
|
||||
* But the css returned by this routine can be "not populated yet" or "being
|
||||
* destroyed". The caller should check css and cgroup's status.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ SUBSYS(cpuacct)
|
|||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_MEM_RES_CTLR
|
||||
#ifdef CONFIG_MEMCG
|
||||
SUBSYS(mem_cgroup)
|
||||
#endif
|
||||
|
||||
|
|
@ -72,3 +72,9 @@ SUBSYS(net_prio)
|
|||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef CONFIG_CGROUP_HUGETLB
|
||||
SUBSYS(hugetlb)
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ struct clk {
|
|||
.parent_names = _parent_names, \
|
||||
.num_parents = ARRAY_SIZE(_parent_names), \
|
||||
.parents = _parents, \
|
||||
.flags = _flags, \
|
||||
.flags = _flags | CLK_IS_BASIC, \
|
||||
}
|
||||
|
||||
#define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, \
|
||||
|
|
@ -103,9 +103,9 @@ struct clk {
|
|||
DEFINE_CLK(_name, clk_gate_ops, _flags, \
|
||||
_name##_parent_names, _name##_parents);
|
||||
|
||||
#define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
|
||||
#define _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
|
||||
_flags, _reg, _shift, _width, \
|
||||
_divider_flags, _lock) \
|
||||
_divider_flags, _table, _lock) \
|
||||
static struct clk _name; \
|
||||
static const char *_name##_parent_names[] = { \
|
||||
_parent_name, \
|
||||
|
|
@ -121,11 +121,27 @@ struct clk {
|
|||
.shift = _shift, \
|
||||
.width = _width, \
|
||||
.flags = _divider_flags, \
|
||||
.table = _table, \
|
||||
.lock = _lock, \
|
||||
}; \
|
||||
DEFINE_CLK(_name, clk_divider_ops, _flags, \
|
||||
_name##_parent_names, _name##_parents);
|
||||
|
||||
#define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
|
||||
_flags, _reg, _shift, _width, \
|
||||
_divider_flags, _lock) \
|
||||
_DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
|
||||
_flags, _reg, _shift, _width, \
|
||||
_divider_flags, NULL, _lock)
|
||||
|
||||
#define DEFINE_CLK_DIVIDER_TABLE(_name, _parent_name, \
|
||||
_parent_ptr, _flags, _reg, \
|
||||
_shift, _width, _divider_flags, \
|
||||
_table, _lock) \
|
||||
_DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
|
||||
_flags, _reg, _shift, _width, \
|
||||
_divider_flags, _table, _lock) \
|
||||
|
||||
#define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags, \
|
||||
_reg, _shift, _width, \
|
||||
_mux_flags, _lock) \
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */
|
||||
#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
|
||||
#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
|
||||
#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
|
||||
|
||||
struct clk_hw;
|
||||
|
||||
|
|
@ -143,7 +144,7 @@ struct clk_init_data {
|
|||
*/
|
||||
struct clk_hw {
|
||||
struct clk *clk;
|
||||
struct clk_init_data *init;
|
||||
const struct clk_init_data *init;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -171,6 +172,8 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
|
|||
const char *parent_name, unsigned long flags,
|
||||
unsigned long fixed_rate);
|
||||
|
||||
void of_fixed_clk_setup(struct device_node *np);
|
||||
|
||||
/**
|
||||
* struct clk_gate - gating clock
|
||||
*
|
||||
|
|
@ -203,6 +206,11 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
|
|||
void __iomem *reg, u8 bit_idx,
|
||||
u8 clk_gate_flags, spinlock_t *lock);
|
||||
|
||||
struct clk_div_table {
|
||||
unsigned int val;
|
||||
unsigned int div;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct clk_divider - adjustable divider clock
|
||||
*
|
||||
|
|
@ -210,6 +218,7 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
|
|||
* @reg: register containing the divider
|
||||
* @shift: shift to the divider bit field
|
||||
* @width: width of the divider bit field
|
||||
* @table: array of value/divider pairs, last entry should have div = 0
|
||||
* @lock: register lock
|
||||
*
|
||||
* Clock with an adjustable divider affecting its output frequency. Implements
|
||||
|
|
@ -229,6 +238,7 @@ struct clk_divider {
|
|||
u8 shift;
|
||||
u8 width;
|
||||
u8 flags;
|
||||
const struct clk_div_table *table;
|
||||
spinlock_t *lock;
|
||||
};
|
||||
|
||||
|
|
@ -240,6 +250,11 @@ struct clk *clk_register_divider(struct device *dev, const char *name,
|
|||
const char *parent_name, unsigned long flags,
|
||||
void __iomem *reg, u8 shift, u8 width,
|
||||
u8 clk_divider_flags, spinlock_t *lock);
|
||||
struct clk *clk_register_divider_table(struct device *dev, const char *name,
|
||||
const char *parent_name, unsigned long flags,
|
||||
void __iomem *reg, u8 shift, u8 width,
|
||||
u8 clk_divider_flags, const struct clk_div_table *table,
|
||||
spinlock_t *lock);
|
||||
|
||||
/**
|
||||
* struct clk_mux - multiplexer clock
|
||||
|
|
@ -334,5 +349,19 @@ void __clk_unprepare(struct clk *clk);
|
|||
void __clk_reparent(struct clk *clk, struct clk *new_parent);
|
||||
unsigned long __clk_round_rate(struct clk *clk, unsigned long rate);
|
||||
|
||||
struct of_device_id;
|
||||
|
||||
typedef void (*of_clk_init_cb_t)(struct device_node *);
|
||||
|
||||
int of_clk_add_provider(struct device_node *np,
|
||||
struct clk *(*clk_src_get)(struct of_phandle_args *args,
|
||||
void *data),
|
||||
void *data);
|
||||
void of_clk_del_provider(struct device_node *np);
|
||||
struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
|
||||
void *data);
|
||||
const char *of_clk_get_parent_name(struct device_node *np, int index);
|
||||
void of_clk_init(const struct of_device_id *matches);
|
||||
|
||||
#endif /* CONFIG_COMMON_CLK */
|
||||
#endif /* CLK_PROVIDER_H */
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#ifndef __LINUX_CLK_H
|
||||
#define __LINUX_CLK_H
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/notifier.h>
|
||||
|
||||
|
|
@ -83,43 +84,6 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
|
|||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* clk_get - lookup and obtain a reference to a clock producer.
|
||||
* @dev: device for clock "consumer"
|
||||
* @id: clock comsumer ID
|
||||
*
|
||||
* Returns a struct clk corresponding to the clock producer, or
|
||||
* valid IS_ERR() condition containing errno. The implementation
|
||||
* uses @dev and @id to determine the clock consumer, and thereby
|
||||
* the clock producer. (IOW, @id may be identical strings, but
|
||||
* clk_get may return different clock producers depending on @dev.)
|
||||
*
|
||||
* Drivers must assume that the clock source is not enabled.
|
||||
*
|
||||
* clk_get should not be called from within interrupt context.
|
||||
*/
|
||||
struct clk *clk_get(struct device *dev, const char *id);
|
||||
|
||||
/**
|
||||
* devm_clk_get - lookup and obtain a managed reference to a clock producer.
|
||||
* @dev: device for clock "consumer"
|
||||
* @id: clock comsumer ID
|
||||
*
|
||||
* Returns a struct clk corresponding to the clock producer, or
|
||||
* valid IS_ERR() condition containing errno. The implementation
|
||||
* uses @dev and @id to determine the clock consumer, and thereby
|
||||
* the clock producer. (IOW, @id may be identical strings, but
|
||||
* clk_get may return different clock producers depending on @dev.)
|
||||
*
|
||||
* Drivers must assume that the clock source is not enabled.
|
||||
*
|
||||
* devm_clk_get should not be called from within interrupt context.
|
||||
*
|
||||
* The clock will automatically be freed when the device is unbound
|
||||
* from the bus.
|
||||
*/
|
||||
struct clk *devm_clk_get(struct device *dev, const char *id);
|
||||
|
||||
/**
|
||||
* clk_prepare - prepare a clock source
|
||||
* @clk: clock source
|
||||
|
|
@ -138,6 +102,62 @@ static inline int clk_prepare(struct clk *clk)
|
|||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* clk_unprepare - undo preparation of a clock source
|
||||
* @clk: clock source
|
||||
*
|
||||
* This undoes a previously prepared clock. The caller must balance
|
||||
* the number of prepare and unprepare calls.
|
||||
*
|
||||
* Must not be called from within atomic context.
|
||||
*/
|
||||
#ifdef CONFIG_HAVE_CLK_PREPARE
|
||||
void clk_unprepare(struct clk *clk);
|
||||
#else
|
||||
static inline void clk_unprepare(struct clk *clk)
|
||||
{
|
||||
might_sleep();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAVE_CLK
|
||||
/**
|
||||
* clk_get - lookup and obtain a reference to a clock producer.
|
||||
* @dev: device for clock "consumer"
|
||||
* @id: clock consumer ID
|
||||
*
|
||||
* Returns a struct clk corresponding to the clock producer, or
|
||||
* valid IS_ERR() condition containing errno. The implementation
|
||||
* uses @dev and @id to determine the clock consumer, and thereby
|
||||
* the clock producer. (IOW, @id may be identical strings, but
|
||||
* clk_get may return different clock producers depending on @dev.)
|
||||
*
|
||||
* Drivers must assume that the clock source is not enabled.
|
||||
*
|
||||
* clk_get should not be called from within interrupt context.
|
||||
*/
|
||||
struct clk *clk_get(struct device *dev, const char *id);
|
||||
|
||||
/**
|
||||
* devm_clk_get - lookup and obtain a managed reference to a clock producer.
|
||||
* @dev: device for clock "consumer"
|
||||
* @id: clock consumer ID
|
||||
*
|
||||
* Returns a struct clk corresponding to the clock producer, or
|
||||
* valid IS_ERR() condition containing errno. The implementation
|
||||
* uses @dev and @id to determine the clock consumer, and thereby
|
||||
* the clock producer. (IOW, @id may be identical strings, but
|
||||
* clk_get may return different clock producers depending on @dev.)
|
||||
*
|
||||
* Drivers must assume that the clock source is not enabled.
|
||||
*
|
||||
* devm_clk_get should not be called from within interrupt context.
|
||||
*
|
||||
* The clock will automatically be freed when the device is unbound
|
||||
* from the bus.
|
||||
*/
|
||||
struct clk *devm_clk_get(struct device *dev, const char *id);
|
||||
|
||||
/**
|
||||
* clk_enable - inform the system when the clock source should be running.
|
||||
* @clk: clock source
|
||||
|
|
@ -166,47 +186,6 @@ int clk_enable(struct clk *clk);
|
|||
*/
|
||||
void clk_disable(struct clk *clk);
|
||||
|
||||
|
||||
/**
|
||||
* clk_unprepare - undo preparation of a clock source
|
||||
* @clk: clock source
|
||||
*
|
||||
* This undoes a previously prepared clock. The caller must balance
|
||||
* the number of prepare and unprepare calls.
|
||||
*
|
||||
* Must not be called from within atomic context.
|
||||
*/
|
||||
#ifdef CONFIG_HAVE_CLK_PREPARE
|
||||
void clk_unprepare(struct clk *clk);
|
||||
#else
|
||||
static inline void clk_unprepare(struct clk *clk)
|
||||
{
|
||||
might_sleep();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
|
||||
static inline int clk_prepare_enable(struct clk *clk)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = clk_prepare(clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = clk_enable(clk);
|
||||
if (ret)
|
||||
clk_unprepare(clk);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* clk_disable_unprepare helps cases using clk_disable in non-atomic context. */
|
||||
static inline void clk_disable_unprepare(struct clk *clk)
|
||||
{
|
||||
clk_disable(clk);
|
||||
clk_unprepare(clk);
|
||||
}
|
||||
|
||||
/**
|
||||
* clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
|
||||
* This is only valid once the clock source has been enabled.
|
||||
|
|
@ -297,6 +276,78 @@ struct clk *clk_get_parent(struct clk *clk);
|
|||
*/
|
||||
struct clk *clk_get_sys(const char *dev_id, const char *con_id);
|
||||
|
||||
#else /* !CONFIG_HAVE_CLK */
|
||||
|
||||
static inline struct clk *clk_get(struct device *dev, const char *id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct clk *devm_clk_get(struct device *dev, const char *id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void clk_put(struct clk *clk) {}
|
||||
|
||||
static inline void devm_clk_put(struct device *dev, struct clk *clk) {}
|
||||
|
||||
static inline int clk_enable(struct clk *clk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void clk_disable(struct clk *clk) {}
|
||||
|
||||
static inline unsigned long clk_get_rate(struct clk *clk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int clk_set_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline long clk_round_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int clk_set_parent(struct clk *clk, struct clk *parent)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline struct clk *clk_get_parent(struct clk *clk)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
|
||||
static inline int clk_prepare_enable(struct clk *clk)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = clk_prepare(clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = clk_enable(clk);
|
||||
if (ret)
|
||||
clk_unprepare(clk);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* clk_disable_unprepare helps cases using clk_disable in non-atomic context. */
|
||||
static inline void clk_disable_unprepare(struct clk *clk)
|
||||
{
|
||||
clk_disable(clk);
|
||||
clk_unprepare(clk);
|
||||
}
|
||||
|
||||
/**
|
||||
* clk_add_alias - add a new clock alias
|
||||
* @alias: name for clock alias
|
||||
|
|
@ -310,4 +361,23 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id);
|
|||
int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
|
||||
struct device *dev);
|
||||
|
||||
struct device_node;
|
||||
struct of_phandle_args;
|
||||
|
||||
#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
|
||||
struct clk *of_clk_get(struct device_node *np, int index);
|
||||
struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
|
||||
struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
|
||||
#else
|
||||
static inline struct clk *of_clk_get(struct device_node *np, int index)
|
||||
{
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
static inline struct clk *of_clk_get_by_name(struct device_node *np,
|
||||
const char *name)
|
||||
{
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -319,22 +319,6 @@ static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz)
|
|||
__clocksource_updatefreq_scale(cs, 1000, khz);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GENERIC_TIME_VSYSCALL
|
||||
extern void
|
||||
update_vsyscall(struct timespec *ts, struct timespec *wtm,
|
||||
struct clocksource *c, u32 mult);
|
||||
extern void update_vsyscall_tz(void);
|
||||
#else
|
||||
static inline void
|
||||
update_vsyscall(struct timespec *ts, struct timespec *wtm,
|
||||
struct clocksource *c, u32 mult)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void update_vsyscall_tz(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void timekeeping_notify(struct clocksource *clock);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
|
|||
extern int fragmentation_index(struct zone *zone, unsigned int order);
|
||||
extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
|
||||
int order, gfp_t gfp_mask, nodemask_t *mask,
|
||||
bool sync);
|
||||
bool sync, bool *contended);
|
||||
extern int compact_pgdat(pg_data_t *pgdat, int order);
|
||||
extern unsigned long compaction_suitable(struct zone *zone, int order);
|
||||
|
||||
|
|
@ -58,13 +58,13 @@ static inline bool compaction_deferred(struct zone *zone, int order)
|
|||
if (++zone->compact_considered > defer_limit)
|
||||
zone->compact_considered = defer_limit;
|
||||
|
||||
return zone->compact_considered < (1UL << zone->compact_defer_shift);
|
||||
return zone->compact_considered < defer_limit;
|
||||
}
|
||||
|
||||
#else
|
||||
static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
|
||||
int order, gfp_t gfp_mask, nodemask_t *nodemask,
|
||||
bool sync)
|
||||
bool sync, bool *contended)
|
||||
{
|
||||
return COMPACT_CONTINUE;
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ static inline void defer_compaction(struct zone *zone, int order)
|
|||
|
||||
static inline bool compaction_deferred(struct zone *zone, int order)
|
||||
{
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_COMPACTION */
|
||||
|
|
|
|||
|
|
@ -265,9 +265,9 @@ long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
|
|||
#else
|
||||
long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
|
||||
long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp,
|
||||
size_t msgsz, int msgflg);
|
||||
compat_ssize_t msgsz, int msgflg);
|
||||
long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp,
|
||||
size_t msgsz, long msgtyp, int msgflg);
|
||||
compat_ssize_t msgsz, long msgtyp, int msgflg);
|
||||
long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg);
|
||||
#endif
|
||||
long compat_sys_msgctl(int first, int second, void __user *uptr);
|
||||
|
|
|
|||
|
|
@ -73,8 +73,9 @@ enum {
|
|||
/* migration should happen before other stuff but after perf */
|
||||
CPU_PRI_PERF = 20,
|
||||
CPU_PRI_MIGRATION = 10,
|
||||
/* prepare workqueues for other notifiers */
|
||||
CPU_PRI_WORKQUEUE = 5,
|
||||
/* bring up workqueues before normal notifiers and down after */
|
||||
CPU_PRI_WORKQUEUE_UP = 5,
|
||||
CPU_PRI_WORKQUEUE_DOWN = -5,
|
||||
};
|
||||
|
||||
#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef __LINUX_CPU_RMAP_H
|
||||
#define __LINUX_CPU_RMAP_H
|
||||
|
||||
/*
|
||||
* cpu_rmap.c: CPU affinity reverse-map support
|
||||
* Copyright 2011 Solarflare Communications Inc.
|
||||
|
|
@ -71,3 +74,4 @@ extern void free_irq_cpu_rmap(struct cpu_rmap *rmap);
|
|||
extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq);
|
||||
|
||||
#endif
|
||||
#endif /* __LINUX_CPU_RMAP_H */
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ struct cpuidle_driver;
|
|||
struct cpuidle_state_usage {
|
||||
void *driver_data;
|
||||
|
||||
unsigned long long disable;
|
||||
unsigned long long usage;
|
||||
unsigned long long time; /* in US */
|
||||
};
|
||||
|
|
@ -46,7 +47,7 @@ struct cpuidle_state {
|
|||
unsigned int exit_latency; /* in US */
|
||||
int power_usage; /* in mW */
|
||||
unsigned int target_residency; /* in US */
|
||||
unsigned int disable;
|
||||
bool disabled; /* disabled on all CPUs */
|
||||
|
||||
int (*enter) (struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv,
|
||||
|
|
@ -57,6 +58,7 @@ struct cpuidle_state {
|
|||
|
||||
/* Idle State Flags */
|
||||
#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
|
||||
#define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */
|
||||
|
||||
#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
|
||||
|
||||
|
|
@ -100,6 +102,12 @@ struct cpuidle_device {
|
|||
struct list_head device_list;
|
||||
struct kobject kobj;
|
||||
struct completion kobj_unregister;
|
||||
|
||||
#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
|
||||
int safe_state_index;
|
||||
cpumask_t coupled_cpus;
|
||||
struct cpuidle_coupled *coupled;
|
||||
#endif
|
||||
};
|
||||
|
||||
DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
|
||||
|
|
@ -136,13 +144,17 @@ struct cpuidle_driver {
|
|||
extern void disable_cpuidle(void);
|
||||
extern int cpuidle_idle_call(void);
|
||||
extern int cpuidle_register_driver(struct cpuidle_driver *drv);
|
||||
struct cpuidle_driver *cpuidle_get_driver(void);
|
||||
extern struct cpuidle_driver *cpuidle_get_driver(void);
|
||||
extern struct cpuidle_driver *cpuidle_driver_ref(void);
|
||||
extern void cpuidle_driver_unref(void);
|
||||
extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
|
||||
extern int cpuidle_register_device(struct cpuidle_device *dev);
|
||||
extern void cpuidle_unregister_device(struct cpuidle_device *dev);
|
||||
|
||||
extern void cpuidle_pause_and_lock(void);
|
||||
extern void cpuidle_resume_and_unlock(void);
|
||||
extern void cpuidle_pause(void);
|
||||
extern void cpuidle_resume(void);
|
||||
extern int cpuidle_enable_device(struct cpuidle_device *dev);
|
||||
extern void cpuidle_disable_device(struct cpuidle_device *dev);
|
||||
extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
|
||||
|
|
@ -157,6 +169,8 @@ static inline int cpuidle_idle_call(void) { return -ENODEV; }
|
|||
static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
|
||||
{return -ENODEV; }
|
||||
static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
|
||||
static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }
|
||||
static inline void cpuidle_driver_unref(void) {}
|
||||
static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
|
||||
static inline int cpuidle_register_device(struct cpuidle_device *dev)
|
||||
{return -ENODEV; }
|
||||
|
|
@ -164,6 +178,8 @@ static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { }
|
|||
|
||||
static inline void cpuidle_pause_and_lock(void) { }
|
||||
static inline void cpuidle_resume_and_unlock(void) { }
|
||||
static inline void cpuidle_pause(void) { }
|
||||
static inline void cpuidle_resume(void) { }
|
||||
static inline int cpuidle_enable_device(struct cpuidle_device *dev)
|
||||
{return -ENODEV; }
|
||||
static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
|
||||
|
|
@ -176,6 +192,14 @@ static inline int cpuidle_play_dead(void) {return -ENODEV; }
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
|
||||
void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a);
|
||||
#else
|
||||
static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, atomic_t *a)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/******************************
|
||||
* CPUIDLE GOVERNOR INTERFACE *
|
||||
******************************/
|
||||
|
|
@ -202,14 +226,7 @@ struct cpuidle_governor {
|
|||
extern int cpuidle_register_governor(struct cpuidle_governor *gov);
|
||||
extern void cpuidle_unregister_governor(struct cpuidle_governor *gov);
|
||||
|
||||
#ifdef CONFIG_INTEL_IDLE
|
||||
extern int intel_idle_cpu_init(int cpu);
|
||||
#else
|
||||
static inline int intel_idle_cpu_init(int cpu) { return -1; }
|
||||
#endif
|
||||
|
||||
#else
|
||||
static inline int intel_idle_cpu_init(int cpu) { return -1; }
|
||||
|
||||
static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
|
||||
{return 0;}
|
||||
|
|
|
|||
|
|
@ -272,6 +272,8 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
|
|||
* @cpu: cpu number (< nr_cpu_ids)
|
||||
* @cpumask: the cpumask pointer
|
||||
*
|
||||
* Returns 1 if @cpu is set in @cpumask, else returns 0
|
||||
*
|
||||
* No static inline type checking - see Subtlety (1) above.
|
||||
*/
|
||||
#define cpumask_test_cpu(cpu, cpumask) \
|
||||
|
|
@ -282,6 +284,8 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
|
|||
* @cpu: cpu number (< nr_cpu_ids)
|
||||
* @cpumask: the cpumask pointer
|
||||
*
|
||||
* Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0
|
||||
*
|
||||
* test_and_set_bit wrapper for cpumasks.
|
||||
*/
|
||||
static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
|
||||
|
|
@ -294,6 +298,8 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
|
|||
* @cpu: cpu number (< nr_cpu_ids)
|
||||
* @cpumask: the cpumask pointer
|
||||
*
|
||||
* Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0
|
||||
*
|
||||
* test_and_clear_bit wrapper for cpumasks.
|
||||
*/
|
||||
static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
|
||||
|
|
@ -324,6 +330,8 @@ static inline void cpumask_clear(struct cpumask *dstp)
|
|||
* @dstp: the cpumask result
|
||||
* @src1p: the first input
|
||||
* @src2p: the second input
|
||||
*
|
||||
* If *@dstp is empty, returns 0, else returns 1
|
||||
*/
|
||||
static inline int cpumask_and(struct cpumask *dstp,
|
||||
const struct cpumask *src1p,
|
||||
|
|
@ -365,6 +373,8 @@ static inline void cpumask_xor(struct cpumask *dstp,
|
|||
* @dstp: the cpumask result
|
||||
* @src1p: the first input
|
||||
* @src2p: the second input
|
||||
*
|
||||
* If *@dstp is empty, returns 0, else returns 1
|
||||
*/
|
||||
static inline int cpumask_andnot(struct cpumask *dstp,
|
||||
const struct cpumask *src1p,
|
||||
|
|
@ -414,6 +424,8 @@ static inline bool cpumask_intersects(const struct cpumask *src1p,
|
|||
* cpumask_subset - (*src1p & ~*src2p) == 0
|
||||
* @src1p: the first input
|
||||
* @src2p: the second input
|
||||
*
|
||||
* Returns 1 if *@src1p is a subset of *@src2p, else returns 0
|
||||
*/
|
||||
static inline int cpumask_subset(const struct cpumask *src1p,
|
||||
const struct cpumask *src2p)
|
||||
|
|
@ -579,9 +591,8 @@ static inline int cpulist_scnprintf(char *buf, int len,
|
|||
}
|
||||
|
||||
/**
|
||||
* cpulist_parse_user - extract a cpumask from a user string of ranges
|
||||
* cpulist_parse - extract a cpumask from a user string of ranges
|
||||
* @buf: the buffer to extract from
|
||||
* @len: the length of the buffer
|
||||
* @dstp: the cpumask to set.
|
||||
*
|
||||
* Returns -errno, or 0 for success.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
|
|||
|
||||
extern int cpuset_init(void);
|
||||
extern void cpuset_init_smp(void);
|
||||
extern void cpuset_update_active_cpus(void);
|
||||
extern void cpuset_update_active_cpus(bool cpu_online);
|
||||
extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
|
||||
extern void cpuset_cpus_allowed_fallback(struct task_struct *p);
|
||||
extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
|
||||
|
|
@ -124,7 +124,7 @@ static inline void set_mems_allowed(nodemask_t nodemask)
|
|||
static inline int cpuset_init(void) { return 0; }
|
||||
static inline void cpuset_init_smp(void) {}
|
||||
|
||||
static inline void cpuset_update_active_cpus(void)
|
||||
static inline void cpuset_update_active_cpus(bool cpu_online)
|
||||
{
|
||||
partition_sched_domains(1, NULL, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,6 +154,14 @@ struct crush_map {
|
|||
__s32 max_buckets;
|
||||
__u32 max_rules;
|
||||
__s32 max_devices;
|
||||
|
||||
/* choose local retries before re-descent */
|
||||
__u32 choose_local_tries;
|
||||
/* choose local attempts using a fallback permutation before
|
||||
* re-descent */
|
||||
__u32 choose_local_fallback_tries;
|
||||
/* choose attempts before giving up */
|
||||
__u32 choose_total_tries;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ struct dentry {
|
|||
struct rcu_head d_rcu;
|
||||
} d_u;
|
||||
struct list_head d_subdirs; /* our children */
|
||||
struct list_head d_alias; /* inode alias list */
|
||||
struct hlist_node d_alias; /* inode alias list */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -144,7 +144,7 @@ enum dentry_d_lock_class
|
|||
};
|
||||
|
||||
struct dentry_operations {
|
||||
int (*d_revalidate)(struct dentry *, struct nameidata *);
|
||||
int (*d_revalidate)(struct dentry *, unsigned int);
|
||||
int (*d_hash)(const struct dentry *, const struct inode *,
|
||||
struct qstr *);
|
||||
int (*d_compare)(const struct dentry *, const struct inode *,
|
||||
|
|
|
|||
|
|
@ -66,14 +66,13 @@ typedef int (*dm_request_endio_fn) (struct dm_target *ti,
|
|||
struct request *clone, int error,
|
||||
union map_info *map_context);
|
||||
|
||||
typedef void (*dm_flush_fn) (struct dm_target *ti);
|
||||
typedef void (*dm_presuspend_fn) (struct dm_target *ti);
|
||||
typedef void (*dm_postsuspend_fn) (struct dm_target *ti);
|
||||
typedef int (*dm_preresume_fn) (struct dm_target *ti);
|
||||
typedef void (*dm_resume_fn) (struct dm_target *ti);
|
||||
|
||||
typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type,
|
||||
char *result, unsigned int maxlen);
|
||||
unsigned status_flags, char *result, unsigned maxlen);
|
||||
|
||||
typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv);
|
||||
|
||||
|
|
@ -139,7 +138,6 @@ struct target_type {
|
|||
dm_map_request_fn map_rq;
|
||||
dm_endio_fn end_io;
|
||||
dm_request_endio_fn rq_end_io;
|
||||
dm_flush_fn flush;
|
||||
dm_presuspend_fn presuspend;
|
||||
dm_postsuspend_fn postsuspend;
|
||||
dm_preresume_fn preresume;
|
||||
|
|
@ -188,8 +186,8 @@ struct dm_target {
|
|||
sector_t begin;
|
||||
sector_t len;
|
||||
|
||||
/* Always a power of 2 */
|
||||
sector_t split_io;
|
||||
/* If non-zero, maximum size of I/O submitted to a target. */
|
||||
uint32_t max_io_len;
|
||||
|
||||
/*
|
||||
* A number of zero-length barrier requests that will be submitted
|
||||
|
|
@ -213,16 +211,28 @@ struct dm_target {
|
|||
/* Used to provide an error string from the ctr */
|
||||
char *error;
|
||||
|
||||
/*
|
||||
* Set if this target needs to receive flushes regardless of
|
||||
* whether or not its underlying devices have support.
|
||||
*/
|
||||
bool flush_supported:1;
|
||||
|
||||
/*
|
||||
* Set if this target needs to receive discards regardless of
|
||||
* whether or not its underlying devices have support.
|
||||
*/
|
||||
unsigned discards_supported:1;
|
||||
bool discards_supported:1;
|
||||
|
||||
/*
|
||||
* Set if the target required discard request to be split
|
||||
* on max_io_len boundary.
|
||||
*/
|
||||
bool split_discard_requests:1;
|
||||
|
||||
/*
|
||||
* Set if this target does not return zeroes on discarded blocks.
|
||||
*/
|
||||
unsigned discard_zeroes_data_unsupported:1;
|
||||
bool discard_zeroes_data_unsupported:1;
|
||||
};
|
||||
|
||||
/* Each target can link one of these into the table */
|
||||
|
|
@ -359,6 +369,11 @@ void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callback
|
|||
*/
|
||||
int dm_table_complete(struct dm_table *t);
|
||||
|
||||
/*
|
||||
* Target may require that it is never sent I/O larger than len.
|
||||
*/
|
||||
int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len);
|
||||
|
||||
/*
|
||||
* Table reference counting.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ struct subsys_private;
|
|||
struct bus_type;
|
||||
struct device_node;
|
||||
struct iommu_ops;
|
||||
struct iommu_group;
|
||||
|
||||
struct bus_attribute {
|
||||
struct attribute attr;
|
||||
|
|
@ -687,8 +688,14 @@ struct device {
|
|||
const struct attribute_group **groups; /* optional groups */
|
||||
|
||||
void (*release)(struct device *dev);
|
||||
struct iommu_group *iommu_group;
|
||||
};
|
||||
|
||||
static inline struct device *kobj_to_dev(struct kobject *kobj)
|
||||
{
|
||||
return container_of(kobj, struct device, kobj);
|
||||
}
|
||||
|
||||
/* Get the wakeup routines, which depend on struct device */
|
||||
#include <linux/pm_wakeup.h>
|
||||
|
||||
|
|
@ -865,8 +872,6 @@ extern int (*platform_notify_remove)(struct device *dev);
|
|||
extern struct device *get_device(struct device *dev);
|
||||
extern void put_device(struct device *dev);
|
||||
|
||||
extern void wait_for_device_probe(void);
|
||||
|
||||
#ifdef CONFIG_DEVTMPFS
|
||||
extern int devtmpfs_create_node(struct device *dev);
|
||||
extern int devtmpfs_delete_node(struct device *dev);
|
||||
|
|
|
|||
|
|
@ -267,9 +267,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 22
|
||||
#define DM_VERSION_MINOR 23
|
||||
#define DM_VERSION_PATCHLEVEL 0
|
||||
#define DM_VERSION_EXTRA "-ioctl (2011-10-19)"
|
||||
#define DM_VERSION_EXTRA "-ioctl (2012-07-25)"
|
||||
|
||||
/* Status bits */
|
||||
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
|
||||
|
|
@ -307,6 +307,8 @@ enum {
|
|||
|
||||
/*
|
||||
* Set this to suspend without flushing queued ios.
|
||||
* Also disables flushing uncommitted changes in the thin target before
|
||||
* generating statistics for DM_TABLE_STATUS and DM_DEV_WAIT.
|
||||
*/
|
||||
#define DM_NOFLUSH_FLAG (1 << 11) /* In */
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ enum dma_attr {
|
|||
DMA_ATTR_WEAK_ORDERING,
|
||||
DMA_ATTR_WRITE_COMBINE,
|
||||
DMA_ATTR_NON_CONSISTENT,
|
||||
DMA_ATTR_NO_KERNEL_MAPPING,
|
||||
DMA_ATTR_SKIP_CPU_SYNC,
|
||||
DMA_ATTR_MAX,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ struct dma_map_ops {
|
|||
int (*mmap)(struct device *, struct vm_area_struct *,
|
||||
void *, dma_addr_t, size_t, struct dma_attrs *attrs);
|
||||
|
||||
int (*get_sgtable)(struct device *dev, struct sg_table *sgt, void *,
|
||||
dma_addr_t, size_t, struct dma_attrs *attrs);
|
||||
|
||||
dma_addr_t (*map_page)(struct device *dev, struct page *page,
|
||||
unsigned long offset, size_t size,
|
||||
enum dma_data_direction dir,
|
||||
|
|
|
|||
|
|
@ -338,6 +338,9 @@ enum dma_slave_buswidth {
|
|||
* @device_fc: Flow Controller Settings. Only valid for slave channels. Fill
|
||||
* with 'true' if peripheral should be flow controller. Direction will be
|
||||
* selected at Runtime.
|
||||
* @slave_id: Slave requester id. Only valid for slave channels. The dma
|
||||
* slave peripheral will have unique id as dma requester which need to be
|
||||
* pass as slave config.
|
||||
*
|
||||
* This struct is passed in as configuration data to a DMA engine
|
||||
* in order to set up a certain channel for DMA transport at runtime.
|
||||
|
|
@ -365,6 +368,7 @@ struct dma_slave_config {
|
|||
u32 src_maxburst;
|
||||
u32 dst_maxburst;
|
||||
bool device_fc;
|
||||
unsigned int slave_id;
|
||||
};
|
||||
|
||||
static inline const char *dma_chan_name(struct dma_chan *chan)
|
||||
|
|
@ -670,6 +674,12 @@ static inline int dmaengine_resume(struct dma_chan *chan)
|
|||
return dmaengine_device_control(chan, DMA_RESUME, 0);
|
||||
}
|
||||
|
||||
static inline enum dma_status dmaengine_tx_status(struct dma_chan *chan,
|
||||
dma_cookie_t cookie, struct dma_tx_state *state)
|
||||
{
|
||||
return chan->device->device_tx_status(chan, cookie, state);
|
||||
}
|
||||
|
||||
static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc)
|
||||
{
|
||||
return desc->tx_submit(desc);
|
||||
|
|
|
|||
|
|
@ -53,4 +53,5 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
|
|||
cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs);
|
||||
void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs);
|
||||
|
||||
extern struct sys_timer dw_apb_timer;
|
||||
#endif /* __DW_APB_TIMER_H__ */
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@
|
|||
#define _LINUX_EDAC_H_
|
||||
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/debugfs.h>
|
||||
|
||||
struct device;
|
||||
|
||||
|
|
@ -49,7 +51,19 @@ static inline void opstate_init(void)
|
|||
#define EDAC_MC_LABEL_LEN 31
|
||||
#define MC_PROC_NAME_MAX_LEN 7
|
||||
|
||||
/* memory devices */
|
||||
/**
|
||||
* enum dev_type - describe the type of memory DRAM chips used at the stick
|
||||
* @DEV_UNKNOWN: Can't be determined, or MC doesn't support detect it
|
||||
* @DEV_X1: 1 bit for data
|
||||
* @DEV_X2: 2 bits for data
|
||||
* @DEV_X4: 4 bits for data
|
||||
* @DEV_X8: 8 bits for data
|
||||
* @DEV_X16: 16 bits for data
|
||||
* @DEV_X32: 32 bits for data
|
||||
* @DEV_X64: 64 bits for data
|
||||
*
|
||||
* Typical values are x4 and x8.
|
||||
*/
|
||||
enum dev_type {
|
||||
DEV_UNKNOWN = 0,
|
||||
DEV_X1,
|
||||
|
|
@ -167,18 +181,30 @@ enum mem_type {
|
|||
#define MEM_FLAG_DDR3 BIT(MEM_DDR3)
|
||||
#define MEM_FLAG_RDDR3 BIT(MEM_RDDR3)
|
||||
|
||||
/* chipset Error Detection and Correction capabilities and mode */
|
||||
/**
|
||||
* enum edac-type - Error Detection and Correction capabilities and mode
|
||||
* @EDAC_UNKNOWN: Unknown if ECC is available
|
||||
* @EDAC_NONE: Doesn't support ECC
|
||||
* @EDAC_RESERVED: Reserved ECC type
|
||||
* @EDAC_PARITY: Detects parity errors
|
||||
* @EDAC_EC: Error Checking - no correction
|
||||
* @EDAC_SECDED: Single bit error correction, Double detection
|
||||
* @EDAC_S2ECD2ED: Chipkill x2 devices - do these exist?
|
||||
* @EDAC_S4ECD4ED: Chipkill x4 devices
|
||||
* @EDAC_S8ECD8ED: Chipkill x8 devices
|
||||
* @EDAC_S16ECD16ED: Chipkill x16 devices
|
||||
*/
|
||||
enum edac_type {
|
||||
EDAC_UNKNOWN = 0, /* Unknown if ECC is available */
|
||||
EDAC_NONE, /* Doesn't support ECC */
|
||||
EDAC_RESERVED, /* Reserved ECC type */
|
||||
EDAC_PARITY, /* Detects parity errors */
|
||||
EDAC_EC, /* Error Checking - no correction */
|
||||
EDAC_SECDED, /* Single bit error correction, Double detection */
|
||||
EDAC_S2ECD2ED, /* Chipkill x2 devices - do these exist? */
|
||||
EDAC_S4ECD4ED, /* Chipkill x4 devices */
|
||||
EDAC_S8ECD8ED, /* Chipkill x8 devices */
|
||||
EDAC_S16ECD16ED, /* Chipkill x16 devices */
|
||||
EDAC_UNKNOWN = 0,
|
||||
EDAC_NONE,
|
||||
EDAC_RESERVED,
|
||||
EDAC_PARITY,
|
||||
EDAC_EC,
|
||||
EDAC_SECDED,
|
||||
EDAC_S2ECD2ED,
|
||||
EDAC_S4ECD4ED,
|
||||
EDAC_S8ECD8ED,
|
||||
EDAC_S16ECD16ED,
|
||||
};
|
||||
|
||||
#define EDAC_FLAG_UNKNOWN BIT(EDAC_UNKNOWN)
|
||||
|
|
@ -191,18 +217,30 @@ enum edac_type {
|
|||
#define EDAC_FLAG_S8ECD8ED BIT(EDAC_S8ECD8ED)
|
||||
#define EDAC_FLAG_S16ECD16ED BIT(EDAC_S16ECD16ED)
|
||||
|
||||
/* scrubbing capabilities */
|
||||
/**
|
||||
* enum scrub_type - scrubbing capabilities
|
||||
* @SCRUB_UNKNOWN Unknown if scrubber is available
|
||||
* @SCRUB_NONE: No scrubber
|
||||
* @SCRUB_SW_PROG: SW progressive (sequential) scrubbing
|
||||
* @SCRUB_SW_SRC: Software scrub only errors
|
||||
* @SCRUB_SW_PROG_SRC: Progressive software scrub from an error
|
||||
* @SCRUB_SW_TUNABLE: Software scrub frequency is tunable
|
||||
* @SCRUB_HW_PROG: HW progressive (sequential) scrubbing
|
||||
* @SCRUB_HW_SRC: Hardware scrub only errors
|
||||
* @SCRUB_HW_PROG_SRC: Progressive hardware scrub from an error
|
||||
* SCRUB_HW_TUNABLE: Hardware scrub frequency is tunable
|
||||
*/
|
||||
enum scrub_type {
|
||||
SCRUB_UNKNOWN = 0, /* Unknown if scrubber is available */
|
||||
SCRUB_NONE, /* No scrubber */
|
||||
SCRUB_SW_PROG, /* SW progressive (sequential) scrubbing */
|
||||
SCRUB_SW_SRC, /* Software scrub only errors */
|
||||
SCRUB_SW_PROG_SRC, /* Progressive software scrub from an error */
|
||||
SCRUB_SW_TUNABLE, /* Software scrub frequency is tunable */
|
||||
SCRUB_HW_PROG, /* HW progressive (sequential) scrubbing */
|
||||
SCRUB_HW_SRC, /* Hardware scrub only errors */
|
||||
SCRUB_HW_PROG_SRC, /* Progressive hardware scrub from an error */
|
||||
SCRUB_HW_TUNABLE /* Hardware scrub frequency is tunable */
|
||||
SCRUB_UNKNOWN = 0,
|
||||
SCRUB_NONE,
|
||||
SCRUB_SW_PROG,
|
||||
SCRUB_SW_SRC,
|
||||
SCRUB_SW_PROG_SRC,
|
||||
SCRUB_SW_TUNABLE,
|
||||
SCRUB_HW_PROG,
|
||||
SCRUB_HW_SRC,
|
||||
SCRUB_HW_PROG_SRC,
|
||||
SCRUB_HW_TUNABLE
|
||||
};
|
||||
|
||||
#define SCRUB_FLAG_SW_PROG BIT(SCRUB_SW_PROG)
|
||||
|
|
@ -374,7 +412,44 @@ struct edac_mc_layer {
|
|||
#define EDAC_MAX_LAYERS 3
|
||||
|
||||
/**
|
||||
* EDAC_DIMM_PTR - Macro responsible to find a pointer inside a pointer array
|
||||
* EDAC_DIMM_OFF - Macro responsible to get a pointer offset inside a pointer array
|
||||
* for the element given by [layer0,layer1,layer2] position
|
||||
*
|
||||
* @layers: a struct edac_mc_layer array, describing how many elements
|
||||
* were allocated for each layer
|
||||
* @n_layers: Number of layers at the @layers array
|
||||
* @layer0: layer0 position
|
||||
* @layer1: layer1 position. Unused if n_layers < 2
|
||||
* @layer2: layer2 position. Unused if n_layers < 3
|
||||
*
|
||||
* For 1 layer, this macro returns &var[layer0] - &var
|
||||
* For 2 layers, this macro is similar to allocate a bi-dimensional array
|
||||
* and to return "&var[layer0][layer1] - &var"
|
||||
* For 3 layers, this macro is similar to allocate a tri-dimensional array
|
||||
* and to return "&var[layer0][layer1][layer2] - &var"
|
||||
*
|
||||
* A loop could be used here to make it more generic, but, as we only have
|
||||
* 3 layers, this is a little faster.
|
||||
* By design, layers can never be 0 or more than 3. If that ever happens,
|
||||
* a NULL is returned, causing an OOPS during the memory allocation routine,
|
||||
* with would point to the developer that he's doing something wrong.
|
||||
*/
|
||||
#define EDAC_DIMM_OFF(layers, nlayers, layer0, layer1, layer2) ({ \
|
||||
int __i; \
|
||||
if ((nlayers) == 1) \
|
||||
__i = layer0; \
|
||||
else if ((nlayers) == 2) \
|
||||
__i = (layer1) + ((layers[1]).size * (layer0)); \
|
||||
else if ((nlayers) == 3) \
|
||||
__i = (layer2) + ((layers[2]).size * ((layer1) + \
|
||||
((layers[1]).size * (layer0)))); \
|
||||
else \
|
||||
__i = -EINVAL; \
|
||||
__i; \
|
||||
})
|
||||
|
||||
/**
|
||||
* EDAC_DIMM_PTR - Macro responsible to get a pointer inside a pointer array
|
||||
* for the element given by [layer0,layer1,layer2] position
|
||||
*
|
||||
* @layers: a struct edac_mc_layer array, describing how many elements
|
||||
|
|
@ -391,30 +466,20 @@ struct edac_mc_layer {
|
|||
* and to return "&var[layer0][layer1]"
|
||||
* For 3 layers, this macro is similar to allocate a tri-dimensional array
|
||||
* and to return "&var[layer0][layer1][layer2]"
|
||||
*
|
||||
* A loop could be used here to make it more generic, but, as we only have
|
||||
* 3 layers, this is a little faster.
|
||||
* By design, layers can never be 0 or more than 3. If that ever happens,
|
||||
* a NULL is returned, causing an OOPS during the memory allocation routine,
|
||||
* with would point to the developer that he's doing something wrong.
|
||||
*/
|
||||
#define EDAC_DIMM_PTR(layers, var, nlayers, layer0, layer1, layer2) ({ \
|
||||
typeof(var) __p; \
|
||||
if ((nlayers) == 1) \
|
||||
__p = &var[layer0]; \
|
||||
else if ((nlayers) == 2) \
|
||||
__p = &var[(layer1) + ((layers[1]).size * (layer0))]; \
|
||||
else if ((nlayers) == 3) \
|
||||
__p = &var[(layer2) + ((layers[2]).size * ((layer1) + \
|
||||
((layers[1]).size * (layer0))))]; \
|
||||
else \
|
||||
typeof(*var) __p; \
|
||||
int ___i = EDAC_DIMM_OFF(layers, nlayers, layer0, layer1, layer2); \
|
||||
if (___i < 0) \
|
||||
__p = NULL; \
|
||||
else \
|
||||
__p = (var)[___i]; \
|
||||
__p; \
|
||||
})
|
||||
|
||||
|
||||
/* FIXME: add the proper per-location error counts */
|
||||
struct dimm_info {
|
||||
struct device dev;
|
||||
|
||||
char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */
|
||||
|
||||
/* Memory location data */
|
||||
|
|
@ -456,6 +521,8 @@ struct rank_info {
|
|||
};
|
||||
|
||||
struct csrow_info {
|
||||
struct device dev;
|
||||
|
||||
/* Used only by edac_mc_find_csrow_by_page() */
|
||||
unsigned long first_page; /* first page number in csrow */
|
||||
unsigned long last_page; /* last page number in csrow */
|
||||
|
|
@ -469,44 +536,26 @@ struct csrow_info {
|
|||
|
||||
struct mem_ctl_info *mci; /* the parent */
|
||||
|
||||
struct kobject kobj; /* sysfs kobject for this csrow */
|
||||
|
||||
/* channel information for this csrow */
|
||||
u32 nr_channels;
|
||||
struct rank_info *channels;
|
||||
struct rank_info **channels;
|
||||
};
|
||||
|
||||
struct mcidev_sysfs_group {
|
||||
const char *name; /* group name */
|
||||
const struct mcidev_sysfs_attribute *mcidev_attr; /* group attributes */
|
||||
};
|
||||
|
||||
struct mcidev_sysfs_group_kobj {
|
||||
struct list_head list; /* list for all instances within a mc */
|
||||
|
||||
struct kobject kobj; /* kobj for the group */
|
||||
|
||||
const struct mcidev_sysfs_group *grp; /* group description table */
|
||||
struct mem_ctl_info *mci; /* the parent */
|
||||
};
|
||||
|
||||
/* mcidev_sysfs_attribute structure
|
||||
* used for driver sysfs attributes and in mem_ctl_info
|
||||
* sysfs top level entries
|
||||
/*
|
||||
* struct errcount_attribute - used to store the several error counts
|
||||
*/
|
||||
struct mcidev_sysfs_attribute {
|
||||
/* It should use either attr or grp */
|
||||
struct attribute attr;
|
||||
const struct mcidev_sysfs_group *grp; /* Points to a group of attributes */
|
||||
|
||||
/* Ops for show/store values at the attribute - not used on group */
|
||||
ssize_t (*show)(struct mem_ctl_info *,char *);
|
||||
ssize_t (*store)(struct mem_ctl_info *, const char *,size_t);
|
||||
struct errcount_attribute_data {
|
||||
int n_layers;
|
||||
int pos[EDAC_MAX_LAYERS];
|
||||
int layer0, layer1, layer2;
|
||||
};
|
||||
|
||||
/* MEMORY controller information structure
|
||||
*/
|
||||
struct mem_ctl_info {
|
||||
struct device dev;
|
||||
struct bus_type bus;
|
||||
|
||||
struct list_head link; /* for global list of mem_ctl_info structs */
|
||||
|
||||
struct module *owner; /* Module owner of this control struct */
|
||||
|
|
@ -548,10 +597,18 @@ struct mem_ctl_info {
|
|||
unsigned long (*ctl_page_to_phys) (struct mem_ctl_info * mci,
|
||||
unsigned long page);
|
||||
int mc_idx;
|
||||
struct csrow_info *csrows;
|
||||
struct csrow_info **csrows;
|
||||
unsigned nr_csrows, num_cschannel;
|
||||
|
||||
/* Memory Controller hierarchy */
|
||||
/*
|
||||
* Memory Controller hierarchy
|
||||
*
|
||||
* There are basically two types of memory controller: the ones that
|
||||
* sees memory sticks ("dimms"), and the ones that sees memory ranks.
|
||||
* All old memory controllers enumerate memories per rank, but most
|
||||
* of the recent drivers enumerate memories per DIMM, instead.
|
||||
* When the memory controller is per rank, mem_is_per_rank is true.
|
||||
*/
|
||||
unsigned n_layers;
|
||||
struct edac_mc_layer *layers;
|
||||
bool mem_is_per_rank;
|
||||
|
|
@ -560,14 +617,14 @@ struct mem_ctl_info {
|
|||
* DIMM info. Will eventually remove the entire csrows_info some day
|
||||
*/
|
||||
unsigned tot_dimms;
|
||||
struct dimm_info *dimms;
|
||||
struct dimm_info **dimms;
|
||||
|
||||
/*
|
||||
* FIXME - what about controllers on other busses? - IDs must be
|
||||
* unique. dev pointer should be sufficiently unique, but
|
||||
* BUS:SLOT.FUNC numbers may not be unique.
|
||||
*/
|
||||
struct device *dev;
|
||||
struct device *pdev;
|
||||
const char *mod_name;
|
||||
const char *mod_ver;
|
||||
const char *ctl_name;
|
||||
|
|
@ -586,12 +643,6 @@ struct mem_ctl_info {
|
|||
|
||||
struct completion complete;
|
||||
|
||||
/* edac sysfs device control */
|
||||
struct kobject edac_mci_kobj;
|
||||
|
||||
/* list for all grp instances within a mc */
|
||||
struct list_head grp_kobj_list;
|
||||
|
||||
/* Additional top controller level attributes, but specified
|
||||
* by the low level driver.
|
||||
*
|
||||
|
|
@ -609,6 +660,13 @@ struct mem_ctl_info {
|
|||
|
||||
/* the internal state of this controller instance */
|
||||
int op_state;
|
||||
|
||||
#ifdef CONFIG_EDAC_DEBUG
|
||||
struct dentry *debugfs;
|
||||
u8 fake_inject_layer[EDAC_MAX_LAYERS];
|
||||
u32 fake_inject_ue;
|
||||
u16 fake_inject_count;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -124,17 +124,30 @@ static inline bool is_valid_ether_addr(const u8 *addr)
|
|||
}
|
||||
|
||||
/**
|
||||
* random_ether_addr - Generate software assigned random Ethernet address
|
||||
* eth_random_addr - Generate software assigned random Ethernet address
|
||||
* @addr: Pointer to a six-byte array containing the Ethernet address
|
||||
*
|
||||
* Generate a random Ethernet address (MAC) that is not multicast
|
||||
* and has the local assigned bit set.
|
||||
*/
|
||||
static inline void random_ether_addr(u8 *addr)
|
||||
static inline void eth_random_addr(u8 *addr)
|
||||
{
|
||||
get_random_bytes (addr, ETH_ALEN);
|
||||
addr [0] &= 0xfe; /* clear multicast bit */
|
||||
addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
|
||||
get_random_bytes(addr, ETH_ALEN);
|
||||
addr[0] &= 0xfe; /* clear multicast bit */
|
||||
addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
|
||||
}
|
||||
|
||||
#define random_ether_addr(addr) eth_random_addr(addr)
|
||||
|
||||
/**
|
||||
* eth_broadcast_addr - Assign broadcast address
|
||||
* @addr: Pointer to a six-byte array containing the Ethernet address
|
||||
*
|
||||
* Assign the broadcast address to the given address array.
|
||||
*/
|
||||
static inline void eth_broadcast_addr(u8 *addr)
|
||||
{
|
||||
memset(addr, 0xff, ETH_ALEN);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -149,7 +162,7 @@ static inline void random_ether_addr(u8 *addr)
|
|||
static inline void eth_hw_addr_random(struct net_device *dev)
|
||||
{
|
||||
dev->addr_assign_type |= NET_ADDR_RANDOM;
|
||||
random_ether_addr(dev->dev_addr);
|
||||
eth_random_addr(dev->dev_addr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -136,6 +136,35 @@ struct ethtool_eeprom {
|
|||
__u8 data[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ethtool_eee - Energy Efficient Ethernet information
|
||||
* @cmd: ETHTOOL_{G,S}EEE
|
||||
* @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
|
||||
* for which there is EEE support.
|
||||
* @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
|
||||
* advertised as eee capable.
|
||||
* @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
|
||||
* combinations advertised by the link partner as eee capable.
|
||||
* @eee_active: Result of the eee auto negotiation.
|
||||
* @eee_enabled: EEE configured mode (enabled/disabled).
|
||||
* @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
|
||||
* that eee was negotiated.
|
||||
* @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
|
||||
* its tx lpi (after reaching 'idle' state). Effective only when eee
|
||||
* was negotiated and tx_lpi_enabled was set.
|
||||
*/
|
||||
struct ethtool_eee {
|
||||
__u32 cmd;
|
||||
__u32 supported;
|
||||
__u32 advertised;
|
||||
__u32 lp_advertised;
|
||||
__u32 eee_active;
|
||||
__u32 eee_enabled;
|
||||
__u32 tx_lpi_enabled;
|
||||
__u32 tx_lpi_timer;
|
||||
__u32 reserved[2];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ethtool_modinfo - plugin module eeprom information
|
||||
* @cmd: %ETHTOOL_GMODULEINFO
|
||||
|
|
@ -945,6 +974,8 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
|
|||
* @get_module_info: Get the size and type of the eeprom contained within
|
||||
* a plug-in module.
|
||||
* @get_module_eeprom: Get the eeprom information from the plug-in module
|
||||
* @get_eee: Get Energy-Efficient (EEE) supported and status.
|
||||
* @set_eee: Set EEE status (enable/disable) as well as LPI timers.
|
||||
*
|
||||
* All operations are optional (i.e. the function pointer may be set
|
||||
* to %NULL) and callers must take this into account. Callers must
|
||||
|
|
@ -1011,6 +1042,8 @@ struct ethtool_ops {
|
|||
struct ethtool_modinfo *);
|
||||
int (*get_module_eeprom)(struct net_device *,
|
||||
struct ethtool_eeprom *, u8 *);
|
||||
int (*get_eee)(struct net_device *, struct ethtool_eee *);
|
||||
int (*set_eee)(struct net_device *, struct ethtool_eee *);
|
||||
|
||||
|
||||
};
|
||||
|
|
@ -1089,6 +1122,8 @@ struct ethtool_ops {
|
|||
#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
|
||||
#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
|
||||
#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
|
||||
#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
|
||||
#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
|
||||
|
||||
/* compatibility with older code */
|
||||
#define SPARC_ETH_GSET ETHTOOL_GSET
|
||||
|
|
@ -1118,6 +1153,10 @@ struct ethtool_ops {
|
|||
#define SUPPORTED_10000baseR_FEC (1 << 20)
|
||||
#define SUPPORTED_20000baseMLD2_Full (1 << 21)
|
||||
#define SUPPORTED_20000baseKR2_Full (1 << 22)
|
||||
#define SUPPORTED_40000baseKR4_Full (1 << 23)
|
||||
#define SUPPORTED_40000baseCR4_Full (1 << 24)
|
||||
#define SUPPORTED_40000baseSR4_Full (1 << 25)
|
||||
#define SUPPORTED_40000baseLR4_Full (1 << 26)
|
||||
|
||||
/* Indicates what features are advertised by the interface. */
|
||||
#define ADVERTISED_10baseT_Half (1 << 0)
|
||||
|
|
@ -1143,6 +1182,10 @@ struct ethtool_ops {
|
|||
#define ADVERTISED_10000baseR_FEC (1 << 20)
|
||||
#define ADVERTISED_20000baseMLD2_Full (1 << 21)
|
||||
#define ADVERTISED_20000baseKR2_Full (1 << 22)
|
||||
#define ADVERTISED_40000baseKR4_Full (1 << 23)
|
||||
#define ADVERTISED_40000baseCR4_Full (1 << 24)
|
||||
#define ADVERTISED_40000baseSR4_Full (1 << 25)
|
||||
#define ADVERTISED_40000baseLR4_Full (1 << 26)
|
||||
|
||||
/* The following are all involved in forcing a particular link
|
||||
* mode for the device for setting things. When getting the
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
* re-allowed until epoll_wait is called again after consuming the wakeup
|
||||
* event(s).
|
||||
*
|
||||
* Requires CAP_EPOLLWAKEUP
|
||||
* Requires CAP_BLOCK_SUSPEND
|
||||
*/
|
||||
#define EPOLLWAKEUP (1 << 29)
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* @irq_flags IRQ Flags (e.g., IRQF_TRIGGER_LOW).
|
||||
* @state_on print_state is overriden with state_on if attached. If Null,
|
||||
* default method of extcon class is used.
|
||||
* @state_off print_state is overriden with state_on if dettached. If Null,
|
||||
* @state_off print_state is overriden with state_on if detached. If Null,
|
||||
* default method of extcon class is used.
|
||||
*
|
||||
* Note that in order for state_on or state_off to be valid, both state_on
|
||||
|
|
|
|||
|
|
@ -39,4 +39,7 @@ extern void put_unused_fd(unsigned int fd);
|
|||
|
||||
extern void fd_install(unsigned int fd, struct file *file);
|
||||
|
||||
extern void flush_delayed_fput(void);
|
||||
extern void __fput_sync(struct file *);
|
||||
|
||||
#endif /* __LINUX_FILE_H */
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ static inline void fw_card_put(struct fw_card *card)
|
|||
struct fw_attribute_group {
|
||||
struct attribute_group *groups[2];
|
||||
struct attribute_group group;
|
||||
struct attribute *attrs[12];
|
||||
struct attribute *attrs[13];
|
||||
};
|
||||
|
||||
enum fw_device_state {
|
||||
|
|
@ -321,7 +321,7 @@ struct fw_transaction {
|
|||
|
||||
struct fw_address_handler {
|
||||
u64 offset;
|
||||
size_t length;
|
||||
u64 length;
|
||||
fw_address_callback_t address_callback;
|
||||
void *callback_data;
|
||||
struct list_head link;
|
||||
|
|
|
|||
101
include/linux/flex_proportions.h
Normal file
101
include/linux/flex_proportions.h
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* Floating proportions with flexible aging period
|
||||
*
|
||||
* Copyright (C) 2011, SUSE, Jan Kara <jack@suse.cz>
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_FLEX_PROPORTIONS_H
|
||||
#define _LINUX_FLEX_PROPORTIONS_H
|
||||
|
||||
#include <linux/percpu_counter.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/seqlock.h>
|
||||
|
||||
/*
|
||||
* When maximum proportion of some event type is specified, this is the
|
||||
* precision with which we allow limitting. Note that this creates an upper
|
||||
* bound on the number of events per period like
|
||||
* ULLONG_MAX >> FPROP_FRAC_SHIFT.
|
||||
*/
|
||||
#define FPROP_FRAC_SHIFT 10
|
||||
#define FPROP_FRAC_BASE (1UL << FPROP_FRAC_SHIFT)
|
||||
|
||||
/*
|
||||
* ---- Global proportion definitions ----
|
||||
*/
|
||||
struct fprop_global {
|
||||
/* Number of events in the current period */
|
||||
struct percpu_counter events;
|
||||
/* Current period */
|
||||
unsigned int period;
|
||||
/* Synchronization with period transitions */
|
||||
seqcount_t sequence;
|
||||
};
|
||||
|
||||
int fprop_global_init(struct fprop_global *p);
|
||||
void fprop_global_destroy(struct fprop_global *p);
|
||||
bool fprop_new_period(struct fprop_global *p, int periods);
|
||||
|
||||
/*
|
||||
* ---- SINGLE ----
|
||||
*/
|
||||
struct fprop_local_single {
|
||||
/* the local events counter */
|
||||
unsigned long events;
|
||||
/* Period in which we last updated events */
|
||||
unsigned int period;
|
||||
raw_spinlock_t lock; /* Protect period and numerator */
|
||||
};
|
||||
|
||||
#define INIT_FPROP_LOCAL_SINGLE(name) \
|
||||
{ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
|
||||
}
|
||||
|
||||
int fprop_local_init_single(struct fprop_local_single *pl);
|
||||
void fprop_local_destroy_single(struct fprop_local_single *pl);
|
||||
void __fprop_inc_single(struct fprop_global *p, struct fprop_local_single *pl);
|
||||
void fprop_fraction_single(struct fprop_global *p,
|
||||
struct fprop_local_single *pl, unsigned long *numerator,
|
||||
unsigned long *denominator);
|
||||
|
||||
static inline
|
||||
void fprop_inc_single(struct fprop_global *p, struct fprop_local_single *pl)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
__fprop_inc_single(p, pl);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* ---- PERCPU ----
|
||||
*/
|
||||
struct fprop_local_percpu {
|
||||
/* the local events counter */
|
||||
struct percpu_counter events;
|
||||
/* Period in which we last updated events */
|
||||
unsigned int period;
|
||||
raw_spinlock_t lock; /* Protect period and numerator */
|
||||
};
|
||||
|
||||
int fprop_local_init_percpu(struct fprop_local_percpu *pl);
|
||||
void fprop_local_destroy_percpu(struct fprop_local_percpu *pl);
|
||||
void __fprop_inc_percpu(struct fprop_global *p, struct fprop_local_percpu *pl);
|
||||
void __fprop_inc_percpu_max(struct fprop_global *p, struct fprop_local_percpu *pl,
|
||||
int max_frac);
|
||||
void fprop_fraction_percpu(struct fprop_global *p,
|
||||
struct fprop_local_percpu *pl, unsigned long *numerator,
|
||||
unsigned long *denominator);
|
||||
|
||||
static inline
|
||||
void fprop_inc_percpu(struct fprop_global *p, struct fprop_local_percpu *pl)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
__fprop_inc_percpu(p, pl);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -165,6 +165,8 @@ struct inodes_stat_t {
|
|||
#define READ 0
|
||||
#define WRITE RW_MASK
|
||||
#define READA RWA_MASK
|
||||
#define KERNEL_READ (READ|REQ_KERNEL)
|
||||
#define KERNEL_WRITE (WRITE|REQ_KERNEL)
|
||||
|
||||
#define READ_SYNC (READ | REQ_SYNC)
|
||||
#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE)
|
||||
|
|
@ -412,6 +414,7 @@ struct inodes_stat_t {
|
|||
#include <linux/shrinker.h>
|
||||
#include <linux/migrate_mode.h>
|
||||
#include <linux/uidgid.h>
|
||||
#include <linux/lockdep.h>
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
|
|
@ -427,6 +430,7 @@ struct kstatfs;
|
|||
struct vm_area_struct;
|
||||
struct vfsmount;
|
||||
struct cred;
|
||||
struct swap_info_struct;
|
||||
|
||||
extern void __init inode_init(void);
|
||||
extern void __init inode_init_early(void);
|
||||
|
|
@ -437,6 +441,8 @@ extern unsigned long get_max_files(void);
|
|||
extern int sysctl_nr_open;
|
||||
extern struct inodes_stat_t inodes_stat;
|
||||
extern int leases_enable, lease_break_time;
|
||||
extern int sysctl_protected_symlinks;
|
||||
extern int sysctl_protected_hardlinks;
|
||||
|
||||
struct buffer_head;
|
||||
typedef int (get_block_t)(struct inode *inode, sector_t iblock,
|
||||
|
|
@ -636,6 +642,11 @@ struct address_space_operations {
|
|||
int (*is_partially_uptodate) (struct page *, read_descriptor_t *,
|
||||
unsigned long);
|
||||
int (*error_remove_page)(struct address_space *, struct page *);
|
||||
|
||||
/* swapfile support */
|
||||
int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
|
||||
sector_t *span);
|
||||
void (*swap_deactivate)(struct file *file);
|
||||
};
|
||||
|
||||
extern const struct address_space_operations empty_aops;
|
||||
|
|
@ -826,7 +837,7 @@ struct inode {
|
|||
struct list_head i_lru; /* inode LRU list */
|
||||
struct list_head i_sb_list;
|
||||
union {
|
||||
struct list_head i_dentry;
|
||||
struct hlist_head i_dentry;
|
||||
struct rcu_head i_rcu;
|
||||
};
|
||||
u64 i_version;
|
||||
|
|
@ -1154,7 +1165,6 @@ struct lock_manager_operations {
|
|||
int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
|
||||
void (*lm_notify)(struct file_lock *); /* unblock callback */
|
||||
int (*lm_grant)(struct file_lock *, struct file_lock *, int);
|
||||
void (*lm_release_private)(struct file_lock *);
|
||||
void (*lm_break)(struct file_lock *);
|
||||
int (*lm_change)(struct file_lock **, int);
|
||||
};
|
||||
|
|
@ -1163,9 +1173,10 @@ struct lock_manager {
|
|||
struct list_head list;
|
||||
};
|
||||
|
||||
void locks_start_grace(struct lock_manager *);
|
||||
struct net;
|
||||
void locks_start_grace(struct net *, struct lock_manager *);
|
||||
void locks_end_grace(struct lock_manager *);
|
||||
int locks_in_grace(void);
|
||||
int locks_in_grace(struct net *);
|
||||
|
||||
/* that will die - we need it for nfs_lock_info */
|
||||
#include <linux/nfs_fs_i.h>
|
||||
|
|
@ -1437,6 +1448,8 @@ extern void f_delown(struct file *filp);
|
|||
extern pid_t f_getown(struct file *filp);
|
||||
extern int send_sigurg(struct fown_struct *fown);
|
||||
|
||||
struct mm_struct;
|
||||
|
||||
/*
|
||||
* Umount options
|
||||
*/
|
||||
|
|
@ -1450,10 +1463,34 @@ extern int send_sigurg(struct fown_struct *fown);
|
|||
extern struct list_head super_blocks;
|
||||
extern spinlock_t sb_lock;
|
||||
|
||||
/* Possible states of 'frozen' field */
|
||||
enum {
|
||||
SB_UNFROZEN = 0, /* FS is unfrozen */
|
||||
SB_FREEZE_WRITE = 1, /* Writes, dir ops, ioctls frozen */
|
||||
SB_FREEZE_PAGEFAULT = 2, /* Page faults stopped as well */
|
||||
SB_FREEZE_FS = 3, /* For internal FS use (e.g. to stop
|
||||
* internal threads if needed) */
|
||||
SB_FREEZE_COMPLETE = 4, /* ->freeze_fs finished successfully */
|
||||
};
|
||||
|
||||
#define SB_FREEZE_LEVELS (SB_FREEZE_COMPLETE - 1)
|
||||
|
||||
struct sb_writers {
|
||||
/* Counters for counting writers at each level */
|
||||
struct percpu_counter counter[SB_FREEZE_LEVELS];
|
||||
wait_queue_head_t wait; /* queue for waiting for
|
||||
writers / faults to finish */
|
||||
int frozen; /* Is sb frozen? */
|
||||
wait_queue_head_t wait_unfrozen; /* queue for waiting for
|
||||
sb to be thawed */
|
||||
#ifdef CONFIG_DEBUG_LOCK_ALLOC
|
||||
struct lockdep_map lock_map[SB_FREEZE_LEVELS];
|
||||
#endif
|
||||
};
|
||||
|
||||
struct super_block {
|
||||
struct list_head s_list; /* Keep this first */
|
||||
dev_t s_dev; /* search index; _not_ kdev_t */
|
||||
unsigned char s_dirt;
|
||||
unsigned char s_blocksize_bits;
|
||||
unsigned long s_blocksize;
|
||||
loff_t s_maxbytes; /* Max file size */
|
||||
|
|
@ -1497,8 +1534,7 @@ struct super_block {
|
|||
struct hlist_node s_instances;
|
||||
struct quota_info s_dquot; /* Diskquota specific options */
|
||||
|
||||
int s_frozen;
|
||||
wait_queue_head_t s_wait_unfrozen;
|
||||
struct sb_writers s_writers;
|
||||
|
||||
char s_id[32]; /* Informational name */
|
||||
u8 s_uuid[16]; /* UUID */
|
||||
|
|
@ -1553,14 +1589,117 @@ extern struct timespec current_fs_time(struct super_block *sb);
|
|||
/*
|
||||
* Snapshotting support.
|
||||
*/
|
||||
enum {
|
||||
SB_UNFROZEN = 0,
|
||||
SB_FREEZE_WRITE = 1,
|
||||
SB_FREEZE_TRANS = 2,
|
||||
};
|
||||
|
||||
#define vfs_check_frozen(sb, level) \
|
||||
wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
|
||||
void __sb_end_write(struct super_block *sb, int level);
|
||||
int __sb_start_write(struct super_block *sb, int level, bool wait);
|
||||
|
||||
/**
|
||||
* sb_end_write - drop write access to a superblock
|
||||
* @sb: the super we wrote to
|
||||
*
|
||||
* Decrement number of writers to the filesystem. Wake up possible waiters
|
||||
* wanting to freeze the filesystem.
|
||||
*/
|
||||
static inline void sb_end_write(struct super_block *sb)
|
||||
{
|
||||
__sb_end_write(sb, SB_FREEZE_WRITE);
|
||||
}
|
||||
|
||||
/**
|
||||
* sb_end_pagefault - drop write access to a superblock from a page fault
|
||||
* @sb: the super we wrote to
|
||||
*
|
||||
* Decrement number of processes handling write page fault to the filesystem.
|
||||
* Wake up possible waiters wanting to freeze the filesystem.
|
||||
*/
|
||||
static inline void sb_end_pagefault(struct super_block *sb)
|
||||
{
|
||||
__sb_end_write(sb, SB_FREEZE_PAGEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* sb_end_intwrite - drop write access to a superblock for internal fs purposes
|
||||
* @sb: the super we wrote to
|
||||
*
|
||||
* Decrement fs-internal number of writers to the filesystem. Wake up possible
|
||||
* waiters wanting to freeze the filesystem.
|
||||
*/
|
||||
static inline void sb_end_intwrite(struct super_block *sb)
|
||||
{
|
||||
__sb_end_write(sb, SB_FREEZE_FS);
|
||||
}
|
||||
|
||||
/**
|
||||
* sb_start_write - get write access to a superblock
|
||||
* @sb: the super we write to
|
||||
*
|
||||
* When a process wants to write data or metadata to a file system (i.e. dirty
|
||||
* a page or an inode), it should embed the operation in a sb_start_write() -
|
||||
* sb_end_write() pair to get exclusion against file system freezing. This
|
||||
* function increments number of writers preventing freezing. If the file
|
||||
* system is already frozen, the function waits until the file system is
|
||||
* thawed.
|
||||
*
|
||||
* Since freeze protection behaves as a lock, users have to preserve
|
||||
* ordering of freeze protection and other filesystem locks. Generally,
|
||||
* freeze protection should be the outermost lock. In particular, we have:
|
||||
*
|
||||
* sb_start_write
|
||||
* -> i_mutex (write path, truncate, directory ops, ...)
|
||||
* -> s_umount (freeze_super, thaw_super)
|
||||
*/
|
||||
static inline void sb_start_write(struct super_block *sb)
|
||||
{
|
||||
__sb_start_write(sb, SB_FREEZE_WRITE, true);
|
||||
}
|
||||
|
||||
static inline int sb_start_write_trylock(struct super_block *sb)
|
||||
{
|
||||
return __sb_start_write(sb, SB_FREEZE_WRITE, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* sb_start_pagefault - get write access to a superblock from a page fault
|
||||
* @sb: the super we write to
|
||||
*
|
||||
* When a process starts handling write page fault, it should embed the
|
||||
* operation into sb_start_pagefault() - sb_end_pagefault() pair to get
|
||||
* exclusion against file system freezing. This is needed since the page fault
|
||||
* is going to dirty a page. This function increments number of running page
|
||||
* faults preventing freezing. If the file system is already frozen, the
|
||||
* function waits until the file system is thawed.
|
||||
*
|
||||
* Since page fault freeze protection behaves as a lock, users have to preserve
|
||||
* ordering of freeze protection and other filesystem locks. It is advised to
|
||||
* put sb_start_pagefault() close to mmap_sem in lock ordering. Page fault
|
||||
* handling code implies lock dependency:
|
||||
*
|
||||
* mmap_sem
|
||||
* -> sb_start_pagefault
|
||||
*/
|
||||
static inline void sb_start_pagefault(struct super_block *sb)
|
||||
{
|
||||
__sb_start_write(sb, SB_FREEZE_PAGEFAULT, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* sb_start_intwrite - get write access to a superblock for internal fs purposes
|
||||
* @sb: the super we write to
|
||||
*
|
||||
* This is the third level of protection against filesystem freezing. It is
|
||||
* free for use by a filesystem. The only requirement is that it must rank
|
||||
* below sb_start_pagefault.
|
||||
*
|
||||
* For example filesystem can call sb_start_intwrite() when starting a
|
||||
* transaction which somewhat eases handling of freezing for internal sources
|
||||
* of filesystem changes (internal fs threads, discarding preallocation on file
|
||||
* close, etc.).
|
||||
*/
|
||||
static inline void sb_start_intwrite(struct super_block *sb)
|
||||
{
|
||||
__sb_start_write(sb, SB_FREEZE_FS, true);
|
||||
}
|
||||
|
||||
|
||||
extern bool inode_owner_or_capable(const struct inode *inode);
|
||||
|
||||
|
|
@ -1571,7 +1710,7 @@ extern void unlock_super(struct super_block *);
|
|||
/*
|
||||
* VFS helper functions..
|
||||
*/
|
||||
extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *);
|
||||
extern int vfs_create(struct inode *, struct dentry *, umode_t, bool);
|
||||
extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);
|
||||
extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);
|
||||
extern int vfs_symlink(struct inode *, struct dentry *, const char *);
|
||||
|
|
@ -1666,7 +1805,7 @@ struct file_operations {
|
|||
};
|
||||
|
||||
struct inode_operations {
|
||||
struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
|
||||
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
|
||||
void * (*follow_link) (struct dentry *, struct nameidata *);
|
||||
int (*permission) (struct inode *, int);
|
||||
struct posix_acl * (*get_acl)(struct inode *, int);
|
||||
|
|
@ -1674,7 +1813,7 @@ struct inode_operations {
|
|||
int (*readlink) (struct dentry *, char __user *,int);
|
||||
void (*put_link) (struct dentry *, struct nameidata *, void *);
|
||||
|
||||
int (*create) (struct inode *,struct dentry *,umode_t,struct nameidata *);
|
||||
int (*create) (struct inode *,struct dentry *, umode_t, bool);
|
||||
int (*link) (struct dentry *,struct inode *,struct dentry *);
|
||||
int (*unlink) (struct inode *,struct dentry *);
|
||||
int (*symlink) (struct inode *,struct dentry *,const char *);
|
||||
|
|
@ -1693,6 +1832,9 @@ struct inode_operations {
|
|||
int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
|
||||
u64 len);
|
||||
int (*update_time)(struct inode *, struct timespec *, int);
|
||||
int (*atomic_open)(struct inode *, struct dentry *,
|
||||
struct file *, unsigned open_flag,
|
||||
umode_t create_mode, int *opened);
|
||||
} ____cacheline_aligned;
|
||||
|
||||
struct seq_file;
|
||||
|
|
@ -1718,7 +1860,6 @@ struct super_operations {
|
|||
int (*drop_inode) (struct inode *);
|
||||
void (*evict_inode) (struct inode *);
|
||||
void (*put_super) (struct super_block *);
|
||||
void (*write_super) (struct super_block *);
|
||||
int (*sync_fs)(struct super_block *sb, int wait);
|
||||
int (*freeze_fs) (struct super_block *);
|
||||
int (*unfreeze_fs) (struct super_block *);
|
||||
|
|
@ -1881,6 +2022,7 @@ struct file_system_type {
|
|||
struct lock_class_key s_lock_key;
|
||||
struct lock_class_key s_umount_key;
|
||||
struct lock_class_key s_vfs_rename_key;
|
||||
struct lock_class_key s_writers_key[SB_FREEZE_LEVELS];
|
||||
|
||||
struct lock_class_key i_lock_key;
|
||||
struct lock_class_key i_mutex_key;
|
||||
|
|
@ -1911,7 +2053,7 @@ void free_anon_bdev(dev_t);
|
|||
struct super_block *sget(struct file_system_type *type,
|
||||
int (*test)(struct super_block *,void *),
|
||||
int (*set)(struct super_block *,void *),
|
||||
void *data);
|
||||
int flags, void *data);
|
||||
extern struct dentry *mount_pseudo(struct file_system_type *, char *,
|
||||
const struct super_operations *ops,
|
||||
const struct dentry_operations *dops,
|
||||
|
|
@ -2057,10 +2199,17 @@ extern long do_sys_open(int dfd, const char __user *filename, int flags,
|
|||
extern struct file *filp_open(const char *, int, umode_t);
|
||||
extern struct file *file_open_root(struct dentry *, struct vfsmount *,
|
||||
const char *, int);
|
||||
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
|
||||
const struct cred *);
|
||||
extern struct file * dentry_open(const struct path *, int, const struct cred *);
|
||||
extern int filp_close(struct file *, fl_owner_t id);
|
||||
extern char * getname(const char __user *);
|
||||
enum {
|
||||
FILE_CREATED = 1,
|
||||
FILE_OPENED = 2
|
||||
};
|
||||
extern int finish_open(struct file *file, struct dentry *dentry,
|
||||
int (*open)(struct inode *, struct file *),
|
||||
int *opened);
|
||||
extern int finish_no_open(struct file *file, struct dentry *dentry);
|
||||
|
||||
/* fs/ioctl.c */
|
||||
|
||||
|
|
@ -2091,6 +2240,7 @@ extern sector_t blkdev_max_block(struct block_device *bdev);
|
|||
extern void bd_forget(struct inode *inode);
|
||||
extern void bdput(struct block_device *);
|
||||
extern void invalidate_bdev(struct block_device *);
|
||||
extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);
|
||||
extern int sync_blockdev(struct block_device *bdev);
|
||||
extern void kill_bdev(struct block_device *);
|
||||
extern struct super_block *freeze_bdev(struct block_device *);
|
||||
|
|
@ -2112,6 +2262,10 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
extern int sync_filesystem(struct super_block *);
|
||||
extern const struct file_operations def_blk_fops;
|
||||
|
|
@ -2241,7 +2395,6 @@ extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
|
|||
int datasync);
|
||||
extern int vfs_fsync(struct file *file, int datasync);
|
||||
extern int generic_write_sync(struct file *file, loff_t pos, loff_t count);
|
||||
extern void sync_supers(void);
|
||||
extern void emergency_sync(void);
|
||||
extern void emergency_remount(void);
|
||||
#ifdef CONFIG_BLOCK
|
||||
|
|
@ -2311,9 +2464,6 @@ static inline void i_readcount_inc(struct inode *inode)
|
|||
}
|
||||
#endif
|
||||
extern int do_pipe_flags(int *, int);
|
||||
extern struct file *create_read_pipe(struct file *f, int flags);
|
||||
extern struct file *create_write_pipe(int flags);
|
||||
extern void free_write_pipe(struct file *);
|
||||
|
||||
extern int kernel_read(struct file *, loff_t, char *, unsigned long);
|
||||
extern struct file * open_exec(const char *);
|
||||
|
|
@ -2438,7 +2588,7 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
|
|||
extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
|
||||
extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
|
||||
extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
|
||||
int origin, loff_t maxsize);
|
||||
int origin, loff_t maxsize, loff_t eof);
|
||||
extern int generic_file_open(struct inode * inode, struct file * filp);
|
||||
extern int nonseekable_open(struct inode * inode, struct file * filp);
|
||||
|
||||
|
|
@ -2560,7 +2710,7 @@ extern int simple_write_end(struct file *file, struct address_space *mapping,
|
|||
loff_t pos, unsigned len, unsigned copied,
|
||||
struct page *page, void *fsdata);
|
||||
|
||||
extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
|
||||
extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);
|
||||
extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
|
||||
extern const struct file_operations simple_dir_operations;
|
||||
extern const struct inode_operations simple_dir_inode_operations;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ struct trace_iterator {
|
|||
void *private;
|
||||
int cpu_file;
|
||||
struct mutex mutex;
|
||||
struct ring_buffer_iter *buffer_iter[NR_CPUS];
|
||||
struct ring_buffer_iter **buffer_iter;
|
||||
unsigned long iter_flags;
|
||||
|
||||
/* trace_seq for __print_flags() and __print_symbolic() etc. */
|
||||
|
|
@ -207,6 +207,9 @@ struct ftrace_event_call {
|
|||
* bit 1: enabled
|
||||
* bit 2: filter_active
|
||||
* bit 3: enabled cmd record
|
||||
* bit 4: allow trace by non root (cap any)
|
||||
* bit 5: failed to apply filter
|
||||
* bit 6: ftrace internal event (do not enable)
|
||||
*
|
||||
* Changes to flags must hold the event_mutex.
|
||||
*
|
||||
|
|
@ -303,9 +306,10 @@ extern void *perf_trace_buf_prepare(int size, unsigned short type,
|
|||
|
||||
static inline void
|
||||
perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
|
||||
u64 count, struct pt_regs *regs, void *head)
|
||||
u64 count, struct pt_regs *regs, void *head,
|
||||
struct task_struct *task)
|
||||
{
|
||||
perf_tp_event(addr, count, raw_data, size, regs, head, rctx);
|
||||
perf_tp_event(addr, count, raw_data, size, regs, head, rctx, task);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@
|
|||
*
|
||||
* 7.19
|
||||
* - add FUSE_FALLOCATE
|
||||
*
|
||||
* 7.20
|
||||
* - add FUSE_AUTO_INVAL_DATA
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_FUSE_H
|
||||
|
|
@ -88,7 +91,7 @@
|
|||
#define FUSE_KERNEL_VERSION 7
|
||||
|
||||
/** Minor version number of this interface */
|
||||
#define FUSE_KERNEL_MINOR_VERSION 19
|
||||
#define FUSE_KERNEL_MINOR_VERSION 20
|
||||
|
||||
/** The node ID of the root inode */
|
||||
#define FUSE_ROOT_ID 1
|
||||
|
|
@ -163,10 +166,19 @@ struct fuse_file_lock {
|
|||
/**
|
||||
* INIT request/reply flags
|
||||
*
|
||||
* FUSE_ASYNC_READ: asynchronous read requests
|
||||
* FUSE_POSIX_LOCKS: remote locking for POSIX file locks
|
||||
* FUSE_FILE_OPS: kernel sends file handle for fstat, etc... (not yet supported)
|
||||
* FUSE_ATOMIC_O_TRUNC: handles the O_TRUNC open flag in the filesystem
|
||||
* FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
|
||||
* FUSE_BIG_WRITES: filesystem can handle write size larger than 4kB
|
||||
* FUSE_DONT_MASK: don't apply umask to file mode on create operations
|
||||
* FUSE_SPLICE_WRITE: kernel supports splice write on the device
|
||||
* FUSE_SPLICE_MOVE: kernel supports splice move on the device
|
||||
* FUSE_SPLICE_READ: kernel supports splice read on the device
|
||||
* FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
|
||||
* FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories
|
||||
* FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages
|
||||
*/
|
||||
#define FUSE_ASYNC_READ (1 << 0)
|
||||
#define FUSE_POSIX_LOCKS (1 << 1)
|
||||
|
|
@ -175,7 +187,12 @@ struct fuse_file_lock {
|
|||
#define FUSE_EXPORT_SUPPORT (1 << 4)
|
||||
#define FUSE_BIG_WRITES (1 << 5)
|
||||
#define FUSE_DONT_MASK (1 << 6)
|
||||
#define FUSE_SPLICE_WRITE (1 << 7)
|
||||
#define FUSE_SPLICE_MOVE (1 << 8)
|
||||
#define FUSE_SPLICE_READ (1 << 9)
|
||||
#define FUSE_FLOCK_LOCKS (1 << 10)
|
||||
#define FUSE_HAS_IOCTL_DIR (1 << 11)
|
||||
#define FUSE_AUTO_INVAL_DATA (1 << 12)
|
||||
|
||||
/**
|
||||
* CUSE INIT request/reply flags
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ enum {
|
|||
/* All generic netlink requests are serialized by a global lock. */
|
||||
extern void genl_lock(void);
|
||||
extern void genl_unlock(void);
|
||||
#ifdef CONFIG_PROVE_LOCKING
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
extern int lockdep_genl_is_held(void);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#ifdef CONFIG_BLOCK
|
||||
|
||||
#define kobj_to_dev(k) container_of((k), struct device, kobj)
|
||||
#define dev_to_disk(device) container_of((device), struct gendisk, part0.__dev)
|
||||
#define dev_to_part(device) container_of((device), struct hd_struct, __dev)
|
||||
#define disk_to_dev(disk) (&(disk)->part0.__dev)
|
||||
|
|
@ -98,7 +97,13 @@ struct partition_meta_info {
|
|||
|
||||
struct hd_struct {
|
||||
sector_t start_sect;
|
||||
/*
|
||||
* nr_sects is protected by sequence counter. One might extend a
|
||||
* partition while IO is happening to it and update of nr_sects
|
||||
* can be non-atomic on 32bit machines with 64bit sector_t.
|
||||
*/
|
||||
sector_t nr_sects;
|
||||
seqcount_t nr_sects_seq;
|
||||
sector_t alignment_offset;
|
||||
unsigned int discard_alignment;
|
||||
struct device __dev;
|
||||
|
|
@ -648,6 +653,57 @@ static inline void hd_struct_put(struct hd_struct *part)
|
|||
__delete_partition(part);
|
||||
}
|
||||
|
||||
/*
|
||||
* Any access of part->nr_sects which is not protected by partition
|
||||
* bd_mutex or gendisk bdev bd_mutex, should be done using this
|
||||
* accessor function.
|
||||
*
|
||||
* Code written along the lines of i_size_read() and i_size_write().
|
||||
* CONFIG_PREEMPT case optimizes the case of UP kernel with preemption
|
||||
* on.
|
||||
*/
|
||||
static inline sector_t part_nr_sects_read(struct hd_struct *part)
|
||||
{
|
||||
#if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP)
|
||||
sector_t nr_sects;
|
||||
unsigned seq;
|
||||
do {
|
||||
seq = read_seqcount_begin(&part->nr_sects_seq);
|
||||
nr_sects = part->nr_sects;
|
||||
} while (read_seqcount_retry(&part->nr_sects_seq, seq));
|
||||
return nr_sects;
|
||||
#elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT)
|
||||
sector_t nr_sects;
|
||||
|
||||
preempt_disable();
|
||||
nr_sects = part->nr_sects;
|
||||
preempt_enable();
|
||||
return nr_sects;
|
||||
#else
|
||||
return part->nr_sects;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Should be called with mutex lock held (typically bd_mutex) of partition
|
||||
* to provide mutual exlusion among writers otherwise seqcount might be
|
||||
* left in wrong state leaving the readers spinning infinitely.
|
||||
*/
|
||||
static inline void part_nr_sects_write(struct hd_struct *part, sector_t size)
|
||||
{
|
||||
#if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP)
|
||||
write_seqcount_begin(&part->nr_sects_seq);
|
||||
part->nr_sects = size;
|
||||
write_seqcount_end(&part->nr_sects_seq);
|
||||
#elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT)
|
||||
preempt_disable();
|
||||
part->nr_sects = size;
|
||||
preempt_enable();
|
||||
#else
|
||||
part->nr_sects = size;
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* CONFIG_BLOCK */
|
||||
|
||||
static inline void printk_all_partitions(void) { }
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ struct vm_area_struct;
|
|||
#define ___GFP_REPEAT 0x400u
|
||||
#define ___GFP_NOFAIL 0x800u
|
||||
#define ___GFP_NORETRY 0x1000u
|
||||
#define ___GFP_MEMALLOC 0x2000u
|
||||
#define ___GFP_COMP 0x4000u
|
||||
#define ___GFP_ZERO 0x8000u
|
||||
#define ___GFP_NOMEMALLOC 0x10000u
|
||||
|
|
@ -76,9 +77,14 @@ struct vm_area_struct;
|
|||
#define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */
|
||||
#define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */
|
||||
#define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */
|
||||
#define __GFP_MEMALLOC ((__force gfp_t)___GFP_MEMALLOC)/* Allow access to emergency reserves */
|
||||
#define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */
|
||||
#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */
|
||||
#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves */
|
||||
#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves.
|
||||
* This takes precedence over the
|
||||
* __GFP_MEMALLOC flag if both are
|
||||
* set
|
||||
*/
|
||||
#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */
|
||||
#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */
|
||||
#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
|
||||
|
|
@ -129,7 +135,7 @@ struct vm_area_struct;
|
|||
/* Control page allocator reclaim behavior */
|
||||
#define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
|
||||
__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\
|
||||
__GFP_NORETRY|__GFP_NOMEMALLOC)
|
||||
__GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC)
|
||||
|
||||
/* Control slab gfp mask during early boot */
|
||||
#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS))
|
||||
|
|
@ -379,6 +385,9 @@ void drain_local_pages(void *dummy);
|
|||
*/
|
||||
extern gfp_t gfp_allowed_mask;
|
||||
|
||||
/* Returns true if the gfp_mask allows use of ALLOC_NO_WATERMARK */
|
||||
bool gfp_pfmemalloc_allowed(gfp_t gfp_mask);
|
||||
|
||||
extern void pm_restrict_gfp_mask(void);
|
||||
extern void pm_restore_gfp_mask(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -170,6 +170,16 @@ struct gfs2_rindex {
|
|||
#define GFS2_RGF_NOALLOC 0x00000008
|
||||
#define GFS2_RGF_TRIMMED 0x00000010
|
||||
|
||||
struct gfs2_rgrp_lvb {
|
||||
__be32 rl_magic;
|
||||
__be32 rl_flags;
|
||||
__be32 rl_free;
|
||||
__be32 rl_dinodes;
|
||||
__be64 rl_igeneration;
|
||||
__be32 rl_unlinked;
|
||||
__be32 __pad;
|
||||
};
|
||||
|
||||
struct gfs2_rgrp {
|
||||
struct gfs2_meta_header rg_header;
|
||||
|
||||
|
|
@ -214,6 +224,7 @@ enum {
|
|||
gfs2fl_NoAtime = 7,
|
||||
gfs2fl_Sync = 8,
|
||||
gfs2fl_System = 9,
|
||||
gfs2fl_TopLevel = 10,
|
||||
gfs2fl_TruncInProg = 29,
|
||||
gfs2fl_InheritDirectio = 30,
|
||||
gfs2fl_InheritJdata = 31,
|
||||
|
|
@ -230,8 +241,9 @@ enum {
|
|||
#define GFS2_DIF_NOATIME 0x00000080
|
||||
#define GFS2_DIF_SYNC 0x00000100
|
||||
#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */
|
||||
#define GFS2_DIF_TOPDIR 0x00000400 /* New in gfs2 */
|
||||
#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */
|
||||
#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000
|
||||
#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 /* only in gfs1 */
|
||||
#define GFS2_DIF_INHERIT_JDATA 0x80000000
|
||||
|
||||
struct gfs2_dinode {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
*
|
||||
* - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
|
||||
* - bit 26 is the NMI_MASK
|
||||
* - bit 28 is the PREEMPT_ACTIVE flag
|
||||
* - bit 27 is the PREEMPT_ACTIVE flag
|
||||
*
|
||||
* PREEMPT_MASK: 0x000000ff
|
||||
* SOFTIRQ_MASK: 0x0000ff00
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ struct hid_item {
|
|||
#define HID_UP_DIGITIZER 0x000d0000
|
||||
#define HID_UP_PID 0x000f0000
|
||||
#define HID_UP_HPVENDOR 0xff7f0000
|
||||
#define HID_UP_HPVENDOR2 0xff010000
|
||||
#define HID_UP_MSVENDOR 0xff000000
|
||||
#define HID_UP_CUSTOM 0x00ff0000
|
||||
#define HID_UP_LOGIVENDOR 0xffbc0000
|
||||
|
|
|
|||
|
|
@ -39,10 +39,17 @@ extern unsigned long totalhigh_pages;
|
|||
|
||||
void kmap_flush_unused(void);
|
||||
|
||||
struct page *kmap_to_page(void *addr);
|
||||
|
||||
#else /* CONFIG_HIGHMEM */
|
||||
|
||||
static inline unsigned int nr_free_highpages(void) { return 0; }
|
||||
|
||||
static inline struct page *kmap_to_page(void *addr)
|
||||
{
|
||||
return virt_to_page(addr);
|
||||
}
|
||||
|
||||
#define totalhigh_pages 0UL
|
||||
|
||||
#ifndef ARCH_HAS_KMAP
|
||||
|
|
@ -109,55 +116,16 @@ static inline void kmap_atomic_idx_pop(void)
|
|||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NOTE:
|
||||
* kmap_atomic() and kunmap_atomic() with two arguments are deprecated.
|
||||
* We only keep them for backward compatibility, any usage of them
|
||||
* are now warned.
|
||||
*/
|
||||
|
||||
#define PASTE(a, b) a ## b
|
||||
#define PASTE2(a, b) PASTE(a, b)
|
||||
|
||||
#define NARG_(_2, _1, n, ...) n
|
||||
#define NARG(...) NARG_(__VA_ARGS__, 2, 1, :)
|
||||
|
||||
static inline void __deprecated *kmap_atomic_deprecated(struct page *page,
|
||||
enum km_type km)
|
||||
{
|
||||
return kmap_atomic(page);
|
||||
}
|
||||
|
||||
#define kmap_atomic1(...) kmap_atomic(__VA_ARGS__)
|
||||
#define kmap_atomic2(...) kmap_atomic_deprecated(__VA_ARGS__)
|
||||
#define kmap_atomic(...) PASTE2(kmap_atomic, NARG(__VA_ARGS__)(__VA_ARGS__))
|
||||
|
||||
static inline void __deprecated __kunmap_atomic_deprecated(void *addr,
|
||||
enum km_type km)
|
||||
{
|
||||
__kunmap_atomic(addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Prevent people trying to call kunmap_atomic() as if it were kunmap()
|
||||
* kunmap_atomic() should get the return value of kmap_atomic, not the page.
|
||||
*/
|
||||
#define kunmap_atomic_deprecated(addr, km) \
|
||||
do { \
|
||||
BUILD_BUG_ON(__same_type((addr), struct page *)); \
|
||||
__kunmap_atomic_deprecated(addr, km); \
|
||||
} while (0)
|
||||
|
||||
#define kunmap_atomic_withcheck(addr) \
|
||||
#define kunmap_atomic(addr) \
|
||||
do { \
|
||||
BUILD_BUG_ON(__same_type((addr), struct page *)); \
|
||||
__kunmap_atomic(addr); \
|
||||
} while (0)
|
||||
|
||||
#define kunmap_atomic1(...) kunmap_atomic_withcheck(__VA_ARGS__)
|
||||
#define kunmap_atomic2(...) kunmap_atomic_deprecated(__VA_ARGS__)
|
||||
#define kunmap_atomic(...) PASTE2(kunmap_atomic, NARG(__VA_ARGS__)(__VA_ARGS__))
|
||||
/**** End of C pre-processor tricks for deprecated macros ****/
|
||||
|
||||
/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */
|
||||
#ifndef clear_user_highpage
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@
|
|||
#include <linux/mm_types.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/hugetlb_inline.h>
|
||||
#include <linux/cgroup.h>
|
||||
|
||||
struct ctl_table;
|
||||
struct user_struct;
|
||||
struct mmu_gather;
|
||||
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
|
||||
|
|
@ -20,6 +22,11 @@ struct hugepage_subpool {
|
|||
long max_hpages, used_hpages;
|
||||
};
|
||||
|
||||
extern spinlock_t hugetlb_lock;
|
||||
extern int hugetlb_max_hstate __read_mostly;
|
||||
#define for_each_hstate(h) \
|
||||
for ((h) = hstates; (h) < &hstates[hugetlb_max_hstate]; (h)++)
|
||||
|
||||
struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
|
||||
void hugepage_put_subpool(struct hugepage_subpool *spool);
|
||||
|
||||
|
|
@ -40,9 +47,14 @@ int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *,
|
|||
struct page **, struct vm_area_struct **,
|
||||
unsigned long *, int *, int, unsigned int flags);
|
||||
void unmap_hugepage_range(struct vm_area_struct *,
|
||||
unsigned long, unsigned long, struct page *);
|
||||
void __unmap_hugepage_range(struct vm_area_struct *,
|
||||
unsigned long, unsigned long, struct page *);
|
||||
unsigned long, unsigned long, struct page *);
|
||||
void __unmap_hugepage_range_final(struct mmu_gather *tlb,
|
||||
struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end,
|
||||
struct page *ref_page);
|
||||
void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end,
|
||||
struct page *ref_page);
|
||||
int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
|
||||
void hugetlb_report_meminfo(struct seq_file *);
|
||||
int hugetlb_report_node_meminfo(int, char *);
|
||||
|
|
@ -98,7 +110,6 @@ static inline unsigned long hugetlb_total_pages(void)
|
|||
#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
|
||||
#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
|
||||
#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; })
|
||||
#define unmap_hugepage_range(vma, start, end, page) BUG()
|
||||
static inline void hugetlb_report_meminfo(struct seq_file *m)
|
||||
{
|
||||
}
|
||||
|
|
@ -112,13 +123,31 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
|
|||
#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
|
||||
#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; })
|
||||
#define huge_pte_offset(mm, address) 0
|
||||
#define dequeue_hwpoisoned_huge_page(page) 0
|
||||
static inline int dequeue_hwpoisoned_huge_page(struct page *page)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void copy_huge_page(struct page *dst, struct page *src)
|
||||
{
|
||||
}
|
||||
|
||||
#define hugetlb_change_protection(vma, address, end, newprot)
|
||||
|
||||
static inline void __unmap_hugepage_range_final(struct mmu_gather *tlb,
|
||||
struct vm_area_struct *vma, unsigned long start,
|
||||
unsigned long end, struct page *ref_page)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
static inline void __unmap_hugepage_range(struct mmu_gather *tlb,
|
||||
struct vm_area_struct *vma, unsigned long start,
|
||||
unsigned long end, struct page *ref_page)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_HUGETLB_PAGE */
|
||||
|
||||
#define HUGETLB_ANON_FILE "anon_hugepage"
|
||||
|
|
@ -199,10 +228,15 @@ struct hstate {
|
|||
unsigned long resv_huge_pages;
|
||||
unsigned long surplus_huge_pages;
|
||||
unsigned long nr_overcommit_huge_pages;
|
||||
struct list_head hugepage_activelist;
|
||||
struct list_head hugepage_freelists[MAX_NUMNODES];
|
||||
unsigned int nr_huge_pages_node[MAX_NUMNODES];
|
||||
unsigned int free_huge_pages_node[MAX_NUMNODES];
|
||||
unsigned int surplus_huge_pages_node[MAX_NUMNODES];
|
||||
#ifdef CONFIG_CGROUP_HUGETLB
|
||||
/* cgroup control files */
|
||||
struct cftype cgroup_files[5];
|
||||
#endif
|
||||
char name[HSTATE_NAME_LEN];
|
||||
};
|
||||
|
||||
|
|
@ -302,6 +336,11 @@ static inline unsigned hstate_index_to_shift(unsigned index)
|
|||
return hstates[index].order + PAGE_SHIFT;
|
||||
}
|
||||
|
||||
static inline int hstate_index(struct hstate *h)
|
||||
{
|
||||
return h - hstates;
|
||||
}
|
||||
|
||||
#else
|
||||
struct hstate {};
|
||||
#define alloc_huge_page_node(h, nid) NULL
|
||||
|
|
@ -320,6 +359,7 @@ static inline unsigned int pages_per_huge_page(struct hstate *h)
|
|||
return 1;
|
||||
}
|
||||
#define hstate_index_to_shift(index) 0
|
||||
#define hstate_index(h) 0
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_HUGETLB_H */
|
||||
|
|
|
|||
126
include/linux/hugetlb_cgroup.h
Normal file
126
include/linux/hugetlb_cgroup.h
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
* Copyright IBM Corporation, 2012
|
||||
* Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2.1 of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it would be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_HUGETLB_CGROUP_H
|
||||
#define _LINUX_HUGETLB_CGROUP_H
|
||||
|
||||
#include <linux/res_counter.h>
|
||||
|
||||
struct hugetlb_cgroup;
|
||||
/*
|
||||
* Minimum page order trackable by hugetlb cgroup.
|
||||
* At least 3 pages are necessary for all the tracking information.
|
||||
*/
|
||||
#define HUGETLB_CGROUP_MIN_ORDER 2
|
||||
|
||||
#ifdef CONFIG_CGROUP_HUGETLB
|
||||
|
||||
static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
|
||||
{
|
||||
VM_BUG_ON(!PageHuge(page));
|
||||
|
||||
if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER)
|
||||
return NULL;
|
||||
return (struct hugetlb_cgroup *)page[2].lru.next;
|
||||
}
|
||||
|
||||
static inline
|
||||
int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg)
|
||||
{
|
||||
VM_BUG_ON(!PageHuge(page));
|
||||
|
||||
if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER)
|
||||
return -1;
|
||||
page[2].lru.next = (void *)h_cg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool hugetlb_cgroup_disabled(void)
|
||||
{
|
||||
if (hugetlb_subsys.disabled)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
extern int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
|
||||
struct hugetlb_cgroup **ptr);
|
||||
extern void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
|
||||
struct hugetlb_cgroup *h_cg,
|
||||
struct page *page);
|
||||
extern void hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages,
|
||||
struct page *page);
|
||||
extern void hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
|
||||
struct hugetlb_cgroup *h_cg);
|
||||
extern int hugetlb_cgroup_file_init(int idx) __init;
|
||||
extern void hugetlb_cgroup_migrate(struct page *oldhpage,
|
||||
struct page *newhpage);
|
||||
|
||||
#else
|
||||
static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline
|
||||
int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool hugetlb_cgroup_disabled(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline int
|
||||
hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
|
||||
struct hugetlb_cgroup **ptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages,
|
||||
struct hugetlb_cgroup *h_cg,
|
||||
struct page *page)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void
|
||||
hugetlb_cgroup_uncharge_page(int idx, unsigned long nr_pages, struct page *page)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void
|
||||
hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
|
||||
struct hugetlb_cgroup *h_cg)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int __init hugetlb_cgroup_file_init(int idx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void hugetlb_cgroup_migrate(struct page *oldhpage,
|
||||
struct page *newhpage)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MEM_RES_CTLR_HUGETLB */
|
||||
#endif
|
||||
|
|
@ -12,7 +12,8 @@
|
|||
#define _LINUX_I2C_OCORES_H
|
||||
|
||||
struct ocores_i2c_platform_data {
|
||||
u32 regstep; /* distance between registers */
|
||||
u32 reg_shift; /* register offset shift value */
|
||||
u32 reg_io_width; /* register io read/write width */
|
||||
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 */
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@ extern int i2c_master_recv(const struct i2c_client *client, char *buf,
|
|||
*/
|
||||
extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
|
||||
int num);
|
||||
/* Unlocked flavor */
|
||||
extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
|
||||
int num);
|
||||
|
||||
/* This is the very generalized SMBus access routine. You probably do not
|
||||
want to use this, though; one of the functions below may be much easier,
|
||||
|
|
@ -425,6 +428,8 @@ void i2c_unlock_adapter(struct i2c_adapter *);
|
|||
#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
|
||||
/* Must equal I2C_M_TEN below */
|
||||
#define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */
|
||||
#define I2C_CLIENT_SCCB 0x9000 /* Use Omnivision SCCB protocol */
|
||||
/* Must match I2C_M_STOP|IGNORE_NAK */
|
||||
|
||||
/* i2c adapter classes (bitmask) */
|
||||
#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
|
||||
|
|
@ -541,6 +546,7 @@ struct i2c_msg {
|
|||
__u16 flags;
|
||||
#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
|
||||
#define I2C_M_RD 0x0001 /* read data, from slave to master */
|
||||
#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */
|
||||
#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
|
||||
|
|
|
|||
24
include/linux/i2c/mms114.h
Normal file
24
include/linux/i2c/mms114.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (C) 2012 Samsung Electronics Co.Ltd
|
||||
* Author: Joonyoung Shim <jy0922.shim@samsung.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundationr
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MMS114_H
|
||||
#define __LINUX_MMS114_H
|
||||
|
||||
struct mms114_platform_data {
|
||||
unsigned int x_size;
|
||||
unsigned int y_size;
|
||||
unsigned int contact_threshold;
|
||||
unsigned int moving_threshold;
|
||||
bool x_invert;
|
||||
bool y_invert;
|
||||
|
||||
void (*cfg_pin)(bool);
|
||||
};
|
||||
|
||||
#endif /* __LINUX_MMS114_H */
|
||||
|
|
@ -11,7 +11,7 @@ struct pca953x_platform_data {
|
|||
unsigned gpio_base;
|
||||
|
||||
/* initial polarity inversion setting */
|
||||
uint16_t invert;
|
||||
u32 invert;
|
||||
|
||||
/* interrupt base */
|
||||
int irq_base;
|
||||
|
|
|
|||
|
|
@ -555,6 +555,8 @@ struct twl4030_clock_init_data {
|
|||
struct twl4030_bci_platform_data {
|
||||
int *battery_tmp_tbl;
|
||||
unsigned int tblsize;
|
||||
int bb_uvolt; /* voltage to charge backup battery */
|
||||
int bb_uamp; /* current for backup battery charging */
|
||||
};
|
||||
|
||||
/* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */
|
||||
|
|
@ -683,7 +685,6 @@ struct twl4030_audio_data {
|
|||
};
|
||||
|
||||
struct twl4030_platform_data {
|
||||
unsigned irq_base, irq_end;
|
||||
struct twl4030_clock_init_data *clock;
|
||||
struct twl4030_bci_platform_data *bci;
|
||||
struct twl4030_gpio_platform_data *gpio;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#define IEEE80211_FCTL_MOREDATA 0x2000
|
||||
#define IEEE80211_FCTL_PROTECTED 0x4000
|
||||
#define IEEE80211_FCTL_ORDER 0x8000
|
||||
#define IEEE80211_FCTL_CTL_EXT 0x0f00
|
||||
|
||||
#define IEEE80211_SCTL_FRAG 0x000F
|
||||
#define IEEE80211_SCTL_SEQ 0xFFF0
|
||||
|
|
@ -54,6 +55,7 @@
|
|||
#define IEEE80211_FTYPE_MGMT 0x0000
|
||||
#define IEEE80211_FTYPE_CTL 0x0004
|
||||
#define IEEE80211_FTYPE_DATA 0x0008
|
||||
#define IEEE80211_FTYPE_EXT 0x000c
|
||||
|
||||
/* management */
|
||||
#define IEEE80211_STYPE_ASSOC_REQ 0x0000
|
||||
|
|
@ -70,6 +72,7 @@
|
|||
#define IEEE80211_STYPE_ACTION 0x00D0
|
||||
|
||||
/* control */
|
||||
#define IEEE80211_STYPE_CTL_EXT 0x0060
|
||||
#define IEEE80211_STYPE_BACK_REQ 0x0080
|
||||
#define IEEE80211_STYPE_BACK 0x0090
|
||||
#define IEEE80211_STYPE_PSPOLL 0x00A0
|
||||
|
|
@ -97,6 +100,18 @@
|
|||
#define IEEE80211_STYPE_QOS_CFPOLL 0x00E0
|
||||
#define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0
|
||||
|
||||
/* extension, added by 802.11ad */
|
||||
#define IEEE80211_STYPE_DMG_BEACON 0x0000
|
||||
|
||||
/* control extension - for IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTL_EXT */
|
||||
#define IEEE80211_CTL_EXT_POLL 0x2000
|
||||
#define IEEE80211_CTL_EXT_SPR 0x3000
|
||||
#define IEEE80211_CTL_EXT_GRANT 0x4000
|
||||
#define IEEE80211_CTL_EXT_DMG_CTS 0x5000
|
||||
#define IEEE80211_CTL_EXT_DMG_DTS 0x6000
|
||||
#define IEEE80211_CTL_EXT_SSW 0x8000
|
||||
#define IEEE80211_CTL_EXT_SSW_FBACK 0x9000
|
||||
#define IEEE80211_CTL_EXT_SSW_ACK 0xa000
|
||||
|
||||
/* miscellaneous IEEE 802.11 constants */
|
||||
#define IEEE80211_MAX_FRAG_THRESHOLD 2352
|
||||
|
|
@ -567,6 +582,26 @@ struct ieee80211s_hdr {
|
|||
#define MESH_FLAGS_AE 0x3
|
||||
#define MESH_FLAGS_PS_DEEP 0x4
|
||||
|
||||
/**
|
||||
* enum ieee80211_preq_flags - mesh PREQ element flags
|
||||
*
|
||||
* @IEEE80211_PREQ_PROACTIVE_PREP_FLAG: proactive PREP subfield
|
||||
*/
|
||||
enum ieee80211_preq_flags {
|
||||
IEEE80211_PREQ_PROACTIVE_PREP_FLAG = 1<<2,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_preq_target_flags - mesh PREQ element per target flags
|
||||
*
|
||||
* @IEEE80211_PREQ_TO_FLAG: target only subfield
|
||||
* @IEEE80211_PREQ_USN_FLAG: unknown target HWMP sequence number subfield
|
||||
*/
|
||||
enum ieee80211_preq_target_flags {
|
||||
IEEE80211_PREQ_TO_FLAG = 1<<0,
|
||||
IEEE80211_PREQ_USN_FLAG = 1<<2,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ieee80211_quiet_ie
|
||||
*
|
||||
|
|
@ -1072,6 +1107,73 @@ struct ieee80211_ht_operation {
|
|||
#define WLAN_HT_SMPS_CONTROL_STATIC 1
|
||||
#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
|
||||
|
||||
#define VHT_MCS_SUPPORTED_SET_SIZE 8
|
||||
|
||||
struct ieee80211_vht_capabilities {
|
||||
__le32 vht_capabilities_info;
|
||||
u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE];
|
||||
} __packed;
|
||||
|
||||
struct ieee80211_vht_operation {
|
||||
u8 vht_op_info_chwidth;
|
||||
u8 vht_op_info_chan_center_freq_seg1_idx;
|
||||
u8 vht_op_info_chan_center_freq_seg2_idx;
|
||||
__le16 vht_basic_mcs_set;
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
* struct ieee80211_vht_mcs_info - VHT MCS information
|
||||
* @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
|
||||
* @rx_highest: Indicates highest long GI VHT PPDU data rate
|
||||
* STA can receive. Rate expressed in units of 1 Mbps.
|
||||
* If this field is 0 this value should not be used to
|
||||
* consider the highest RX data rate supported.
|
||||
* @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
|
||||
* @tx_highest: Indicates highest long GI VHT PPDU data rate
|
||||
* STA can transmit. Rate expressed in units of 1 Mbps.
|
||||
* If this field is 0 this value should not be used to
|
||||
* consider the highest TX data rate supported.
|
||||
*/
|
||||
struct ieee80211_vht_mcs_info {
|
||||
__le16 rx_mcs_map;
|
||||
__le16 rx_highest;
|
||||
__le16 tx_mcs_map;
|
||||
__le16 tx_highest;
|
||||
} __packed;
|
||||
|
||||
#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0
|
||||
#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1
|
||||
#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2
|
||||
#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3
|
||||
|
||||
/* 802.11ac VHT Capabilities */
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
|
||||
#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
|
||||
#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
|
||||
#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
|
||||
#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
|
||||
#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
|
||||
#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
|
||||
#define IEEE80211_VHT_CAP_TXSTBC 0x00000080
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300
|
||||
#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400
|
||||
#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
|
||||
#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
|
||||
#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000
|
||||
#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000
|
||||
#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
|
||||
#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
|
||||
#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
|
||||
#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000
|
||||
#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000
|
||||
#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000
|
||||
#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000
|
||||
#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
|
||||
#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
|
||||
|
||||
/* Authentication algorithms */
|
||||
#define WLAN_AUTH_OPEN 0
|
||||
#define WLAN_AUTH_SHARED_KEY 1
|
||||
|
|
@ -1104,6 +1206,21 @@ struct ieee80211_ht_operation {
|
|||
#define WLAN_CAPABILITY_QOS (1<<9)
|
||||
#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
|
||||
#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
|
||||
|
||||
/* DMG (60gHz) 802.11ad */
|
||||
/* type - bits 0..1 */
|
||||
#define WLAN_CAPABILITY_DMG_TYPE_IBSS (1<<0) /* Tx by: STA */
|
||||
#define WLAN_CAPABILITY_DMG_TYPE_PBSS (2<<0) /* Tx by: PCP */
|
||||
#define WLAN_CAPABILITY_DMG_TYPE_AP (3<<0) /* Tx by: AP */
|
||||
|
||||
#define WLAN_CAPABILITY_DMG_CBAP_ONLY (1<<2)
|
||||
#define WLAN_CAPABILITY_DMG_CBAP_SOURCE (1<<3)
|
||||
#define WLAN_CAPABILITY_DMG_PRIVACY (1<<4)
|
||||
#define WLAN_CAPABILITY_DMG_ECPAC (1<<5)
|
||||
|
||||
#define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT (1<<8)
|
||||
#define WLAN_CAPABILITY_DMG_RADIO_MEASURE (1<<12)
|
||||
|
||||
/* measurement */
|
||||
#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0)
|
||||
#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1)
|
||||
|
|
@ -1113,7 +1230,6 @@ struct ieee80211_ht_operation {
|
|||
#define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1
|
||||
#define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2
|
||||
|
||||
|
||||
/* 802.11g ERP information element */
|
||||
#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
|
||||
#define WLAN_ERP_USE_PROTECTION (1<<1)
|
||||
|
|
@ -1125,6 +1241,16 @@ enum {
|
|||
WLAN_ERP_PREAMBLE_LONG = 1,
|
||||
};
|
||||
|
||||
/* Band ID, 802.11ad #8.4.1.45 */
|
||||
enum {
|
||||
IEEE80211_BANDID_TV_WS = 0, /* TV white spaces */
|
||||
IEEE80211_BANDID_SUB1 = 1, /* Sub-1 GHz (excluding TV white spaces) */
|
||||
IEEE80211_BANDID_2G = 2, /* 2.4 GHz */
|
||||
IEEE80211_BANDID_3G = 3, /* 3.6 GHz */
|
||||
IEEE80211_BANDID_5G = 4, /* 4.9 and 5 GHz */
|
||||
IEEE80211_BANDID_60G = 5, /* 60 GHz */
|
||||
};
|
||||
|
||||
/* Status codes */
|
||||
enum ieee80211_statuscode {
|
||||
WLAN_STATUS_SUCCESS = 0,
|
||||
|
|
@ -1176,6 +1302,17 @@ enum ieee80211_statuscode {
|
|||
WLAN_STATUS_ANTI_CLOG_REQUIRED = 76,
|
||||
WLAN_STATUS_FCG_NOT_SUPP = 78,
|
||||
WLAN_STATUS_STA_NO_TBTT = 78,
|
||||
/* 802.11ad */
|
||||
WLAN_STATUS_REJECTED_WITH_SUGGESTED_CHANGES = 39,
|
||||
WLAN_STATUS_REJECTED_FOR_DELAY_PERIOD = 47,
|
||||
WLAN_STATUS_REJECT_WITH_SCHEDULE = 83,
|
||||
WLAN_STATUS_PENDING_ADMITTING_FST_SESSION = 86,
|
||||
WLAN_STATUS_PERFORMING_FST_NOW = 87,
|
||||
WLAN_STATUS_PENDING_GAP_IN_BA_WINDOW = 88,
|
||||
WLAN_STATUS_REJECT_U_PID_SETTING = 89,
|
||||
WLAN_STATUS_REJECT_DSE_BAND = 96,
|
||||
WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99,
|
||||
WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103,
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -1332,6 +1469,43 @@ enum ieee80211_eid {
|
|||
WLAN_EID_DSE_REGISTERED_LOCATION = 58,
|
||||
WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
|
||||
WLAN_EID_EXT_CHANSWITCH_ANN = 60,
|
||||
|
||||
WLAN_EID_VHT_CAPABILITY = 191,
|
||||
WLAN_EID_VHT_OPERATION = 192,
|
||||
|
||||
/* 802.11ad */
|
||||
WLAN_EID_NON_TX_BSSID_CAP = 83,
|
||||
WLAN_EID_WAKEUP_SCHEDULE = 143,
|
||||
WLAN_EID_EXT_SCHEDULE = 144,
|
||||
WLAN_EID_STA_AVAILABILITY = 145,
|
||||
WLAN_EID_DMG_TSPEC = 146,
|
||||
WLAN_EID_DMG_AT = 147,
|
||||
WLAN_EID_DMG_CAP = 148,
|
||||
WLAN_EID_DMG_OPERATION = 151,
|
||||
WLAN_EID_DMG_BSS_PARAM_CHANGE = 152,
|
||||
WLAN_EID_DMG_BEAM_REFINEMENT = 153,
|
||||
WLAN_EID_CHANNEL_MEASURE_FEEDBACK = 154,
|
||||
WLAN_EID_AWAKE_WINDOW = 157,
|
||||
WLAN_EID_MULTI_BAND = 158,
|
||||
WLAN_EID_ADDBA_EXT = 159,
|
||||
WLAN_EID_NEXT_PCP_LIST = 160,
|
||||
WLAN_EID_PCP_HANDOVER = 161,
|
||||
WLAN_EID_DMG_LINK_MARGIN = 162,
|
||||
WLAN_EID_SWITCHING_STREAM = 163,
|
||||
WLAN_EID_SESSION_TRANSITION = 164,
|
||||
WLAN_EID_DYN_TONE_PAIRING_REPORT = 165,
|
||||
WLAN_EID_CLUSTER_REPORT = 166,
|
||||
WLAN_EID_RELAY_CAP = 167,
|
||||
WLAN_EID_RELAY_XFER_PARAM_SET = 168,
|
||||
WLAN_EID_BEAM_LINK_MAINT = 169,
|
||||
WLAN_EID_MULTIPLE_MAC_ADDR = 170,
|
||||
WLAN_EID_U_PID = 171,
|
||||
WLAN_EID_DMG_LINK_ADAPT_ACK = 172,
|
||||
WLAN_EID_QUIET_PERIOD_REQ = 175,
|
||||
WLAN_EID_QUIET_PERIOD_RESP = 177,
|
||||
WLAN_EID_EPAC_POLICY = 182,
|
||||
WLAN_EID_CLISTER_TIME_OFF = 183,
|
||||
WLAN_EID_ANTENNA_SECTOR_ID_PATTERN = 190,
|
||||
};
|
||||
|
||||
/* Action category code */
|
||||
|
|
@ -1348,7 +1522,10 @@ enum ieee80211_category {
|
|||
WLAN_CATEGORY_MESH_ACTION = 13,
|
||||
WLAN_CATEGORY_MULTIHOP_ACTION = 14,
|
||||
WLAN_CATEGORY_SELF_PROTECTED = 15,
|
||||
WLAN_CATEGORY_DMG = 16,
|
||||
WLAN_CATEGORY_WMM = 17,
|
||||
WLAN_CATEGORY_FST = 18,
|
||||
WLAN_CATEGORY_UNPROT_DMG = 20,
|
||||
WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
|
||||
WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
|
||||
};
|
||||
|
|
@ -1443,7 +1620,7 @@ enum ieee80211_tdls_actioncode {
|
|||
*
|
||||
* @IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET: the default synchronization method
|
||||
* @IEEE80211_SYNC_METHOD_VENDOR: a vendor specific synchronization method
|
||||
* that will be specified in a vendor specific information element
|
||||
* that will be specified in a vendor specific information element
|
||||
*/
|
||||
enum {
|
||||
IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET = 1,
|
||||
|
|
@ -1455,7 +1632,7 @@ enum {
|
|||
*
|
||||
* @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol
|
||||
* @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will
|
||||
* be specified in a vendor specific information element
|
||||
* be specified in a vendor specific information element
|
||||
*/
|
||||
enum {
|
||||
IEEE80211_PATH_PROTOCOL_HWMP = 1,
|
||||
|
|
@ -1467,13 +1644,35 @@ enum {
|
|||
*
|
||||
* @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric
|
||||
* @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be
|
||||
* specified in a vendor specific information element
|
||||
* specified in a vendor specific information element
|
||||
*/
|
||||
enum {
|
||||
IEEE80211_PATH_METRIC_AIRTIME = 1,
|
||||
IEEE80211_PATH_METRIC_VENDOR = 255,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_root_mode_identifier - root mesh STA mode identifier
|
||||
*
|
||||
* These attribute are used by dot11MeshHWMPRootMode to set root mesh STA mode
|
||||
*
|
||||
* @IEEE80211_ROOTMODE_NO_ROOT: the mesh STA is not a root mesh STA (default)
|
||||
* @IEEE80211_ROOTMODE_ROOT: the mesh STA is a root mesh STA if greater than
|
||||
* this value
|
||||
* @IEEE80211_PROACTIVE_PREQ_NO_PREP: the mesh STA is a root mesh STA supports
|
||||
* the proactive PREQ with proactive PREP subfield set to 0
|
||||
* @IEEE80211_PROACTIVE_PREQ_WITH_PREP: the mesh STA is a root mesh STA
|
||||
* supports the proactive PREQ with proactive PREP subfield set to 1
|
||||
* @IEEE80211_PROACTIVE_RANN: the mesh STA is a root mesh STA supports
|
||||
* the proactive RANN
|
||||
*/
|
||||
enum ieee80211_root_mode_identifier {
|
||||
IEEE80211_ROOTMODE_NO_ROOT = 0,
|
||||
IEEE80211_ROOTMODE_ROOT = 1,
|
||||
IEEE80211_PROACTIVE_PREQ_NO_PREP = 2,
|
||||
IEEE80211_PROACTIVE_PREQ_WITH_PREP = 3,
|
||||
IEEE80211_PROACTIVE_RANN = 4,
|
||||
};
|
||||
|
||||
/*
|
||||
* IEEE 802.11-2007 7.3.2.9 Country information element
|
||||
|
|
@ -1574,6 +1773,7 @@ enum ieee80211_sa_query_action {
|
|||
#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04
|
||||
#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
|
||||
#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
|
||||
#define WLAN_CIPHER_SUITE_GCMP 0x000FAC08
|
||||
|
||||
#define WLAN_CIPHER_SUITE_SMS4 0x00147201
|
||||
|
||||
|
|
@ -1589,6 +1789,10 @@ enum ieee80211_sa_query_action {
|
|||
|
||||
#define WLAN_OUI_WFA 0x506f9a
|
||||
#define WLAN_OUI_TYPE_WFA_P2P 9
|
||||
#define WLAN_OUI_MICROSOFT 0x0050f2
|
||||
#define WLAN_OUI_TYPE_MICROSOFT_WPA 1
|
||||
#define WLAN_OUI_TYPE_MICROSOFT_WMM 2
|
||||
#define WLAN_OUI_TYPE_MICROSOFT_WPS 4
|
||||
|
||||
/*
|
||||
* WMM/802.11e Tspec Element
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@
|
|||
#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
|
||||
#define IFF_TEAM_PORT 0x40000 /* device used as team port */
|
||||
#define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */
|
||||
#define IFF_LIVE_ADDR_CHANGE 0x100000 /* device supports hardware address
|
||||
* change when it's running */
|
||||
|
||||
|
||||
#define IF_GET_IFACE 0x0001 /* for querying only */
|
||||
|
|
|
|||
|
|
@ -105,7 +105,8 @@
|
|||
#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
|
||||
#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
|
||||
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
|
||||
#define ETH_P_CAN 0x000C /* Controller Area Network */
|
||||
#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */
|
||||
#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
|
||||
#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
|
||||
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
|
||||
#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
|
||||
|
|
|
|||
|
|
@ -140,6 +140,8 @@ enum {
|
|||
IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
|
||||
IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
|
||||
#define IFLA_PROMISCUITY IFLA_PROMISCUITY
|
||||
IFLA_NUM_TX_QUEUES,
|
||||
IFLA_NUM_RX_QUEUES,
|
||||
__IFLA_MAX
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* if_strip.h --
|
||||
*
|
||||
* Definitions for the STRIP interface
|
||||
*
|
||||
* Copyright 1996 The Board of Trustees of The Leland Stanford
|
||||
* Junior University. All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies. Stanford University
|
||||
* makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without
|
||||
* express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_STRIP_H
|
||||
#define __LINUX_STRIP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
typedef struct {
|
||||
__u8 c[6];
|
||||
} MetricomAddress;
|
||||
|
||||
#endif
|
||||
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/netpoll.h>
|
||||
#include <net/sch_generic.h>
|
||||
|
||||
struct team_pcpu_stats {
|
||||
u64 rx_packets;
|
||||
u64 rx_bytes;
|
||||
|
|
@ -60,9 +63,39 @@ struct team_port {
|
|||
unsigned int mtu;
|
||||
} orig;
|
||||
|
||||
struct rcu_head rcu;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
struct netpoll *np;
|
||||
#endif
|
||||
|
||||
long mode_priv[0];
|
||||
};
|
||||
|
||||
static inline bool team_port_enabled(struct team_port *port)
|
||||
{
|
||||
return port->index != -1;
|
||||
}
|
||||
|
||||
static inline bool team_port_txable(struct team_port *port)
|
||||
{
|
||||
return port->linkup && team_port_enabled(port);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
static inline void team_netpoll_send_skb(struct team_port *port,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct netpoll *np = port->np;
|
||||
|
||||
if (np)
|
||||
netpoll_send_skb(np, skb);
|
||||
}
|
||||
#else
|
||||
static inline void team_netpoll_send_skb(struct team_port *port,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
struct team_mode_ops {
|
||||
int (*init)(struct team *team);
|
||||
void (*exit)(struct team *team);
|
||||
|
|
@ -73,6 +106,8 @@ struct team_mode_ops {
|
|||
int (*port_enter)(struct team *team, struct team_port *port);
|
||||
void (*port_leave)(struct team *team, struct team_port *port);
|
||||
void (*port_change_mac)(struct team *team, struct team_port *port);
|
||||
void (*port_enabled)(struct team *team, struct team_port *port);
|
||||
void (*port_disabled)(struct team *team, struct team_port *port);
|
||||
};
|
||||
|
||||
enum team_option_type {
|
||||
|
|
@ -82,6 +117,11 @@ enum team_option_type {
|
|||
TEAM_OPTION_TYPE_BOOL,
|
||||
};
|
||||
|
||||
struct team_option_inst_info {
|
||||
u32 array_index;
|
||||
struct team_port *port; /* != NULL if per-port */
|
||||
};
|
||||
|
||||
struct team_gsetter_ctx {
|
||||
union {
|
||||
u32 u32_val;
|
||||
|
|
@ -92,23 +132,28 @@ struct team_gsetter_ctx {
|
|||
} bin_val;
|
||||
bool bool_val;
|
||||
} data;
|
||||
struct team_port *port;
|
||||
struct team_option_inst_info *info;
|
||||
};
|
||||
|
||||
struct team_option {
|
||||
struct list_head list;
|
||||
const char *name;
|
||||
bool per_port;
|
||||
unsigned int array_size; /* != 0 means the option is array */
|
||||
enum team_option_type type;
|
||||
int (*init)(struct team *team, struct team_option_inst_info *info);
|
||||
int (*getter)(struct team *team, struct team_gsetter_ctx *ctx);
|
||||
int (*setter)(struct team *team, struct team_gsetter_ctx *ctx);
|
||||
};
|
||||
|
||||
extern void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info);
|
||||
extern void team_options_change_check(struct team *team);
|
||||
|
||||
struct team_mode {
|
||||
struct list_head list;
|
||||
const char *kind;
|
||||
struct module *owner;
|
||||
size_t priv_size;
|
||||
size_t port_priv_size;
|
||||
const struct team_mode_ops *ops;
|
||||
};
|
||||
|
||||
|
|
@ -140,6 +185,21 @@ struct team {
|
|||
long mode_priv[TEAM_MODE_PRIV_LONGS];
|
||||
};
|
||||
|
||||
static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
|
||||
sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
|
||||
skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
|
||||
|
||||
skb->dev = port->dev;
|
||||
if (unlikely(netpoll_tx_running(team->dev))) {
|
||||
team_netpoll_send_skb(port, skb);
|
||||
return 0;
|
||||
}
|
||||
return dev_queue_xmit(skb);
|
||||
}
|
||||
|
||||
static inline struct hlist_head *team_port_index_hash(struct team *team,
|
||||
int port_index)
|
||||
{
|
||||
|
|
@ -178,8 +238,11 @@ extern int team_options_register(struct team *team,
|
|||
extern void team_options_unregister(struct team *team,
|
||||
const struct team_option *option,
|
||||
size_t option_count);
|
||||
extern int team_mode_register(struct team_mode *mode);
|
||||
extern int team_mode_unregister(struct team_mode *mode);
|
||||
extern int team_mode_register(const struct team_mode *mode);
|
||||
extern void team_mode_unregister(const struct team_mode *mode);
|
||||
|
||||
#define TEAM_DEFAULT_NUM_TX_QUEUES 16
|
||||
#define TEAM_DEFAULT_NUM_RX_QUEUES 16
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
|
@ -241,6 +304,7 @@ enum {
|
|||
TEAM_ATTR_OPTION_DATA, /* dynamic */
|
||||
TEAM_ATTR_OPTION_REMOVED, /* flag */
|
||||
TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
|
||||
TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
|
||||
|
||||
__TEAM_ATTR_OPTION_MAX,
|
||||
TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
|
||||
|
|
|
|||
|
|
@ -80,4 +80,18 @@ enum {
|
|||
|
||||
#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
|
||||
|
||||
/* VTI-mode i_flags */
|
||||
#define VTI_ISVTI 0x0001
|
||||
|
||||
enum {
|
||||
IFLA_VTI_UNSPEC,
|
||||
IFLA_VTI_LINK,
|
||||
IFLA_VTI_IKEY,
|
||||
IFLA_VTI_OKEY,
|
||||
IFLA_VTI_LOCAL,
|
||||
IFLA_VTI_REMOTE,
|
||||
__IFLA_VTI_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
|
||||
#endif /* _IF_TUNNEL_H_ */
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ struct iio_buffer {
|
|||
|
||||
/**
|
||||
* iio_buffer_init() - Initialize the buffer structure
|
||||
* @buffer: buffer to be initialized
|
||||
* @buffer: buffer to be initialized
|
||||
**/
|
||||
void iio_buffer_init(struct iio_buffer *buffer);
|
||||
|
||||
|
|
@ -107,8 +107,9 @@ int iio_scan_mask_query(struct iio_dev *indio_dev,
|
|||
|
||||
/**
|
||||
* iio_scan_mask_set() - set particular bit in the scan mask
|
||||
* @buffer: the buffer whose scan mask we are interested in
|
||||
* @bit: the bit to be set.
|
||||
* @indio_dev IIO device structure
|
||||
* @buffer: the buffer whose scan mask we are interested in
|
||||
* @bit: the bit to be set.
|
||||
**/
|
||||
int iio_scan_mask_set(struct iio_dev *indio_dev,
|
||||
struct iio_buffer *buffer, int bit);
|
||||
|
|
@ -116,8 +117,8 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
|
|||
/**
|
||||
* iio_push_to_buffer() - push to a registered buffer.
|
||||
* @buffer: IIO buffer structure for device
|
||||
* @scan: Full scan.
|
||||
* @timestamp:
|
||||
* @data: the data to push to the buffer
|
||||
* @timestamp: timestamp to associate with the data
|
||||
*/
|
||||
int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data,
|
||||
s64 timestamp);
|
||||
|
|
@ -126,7 +127,9 @@ int iio_update_demux(struct iio_dev *indio_dev);
|
|||
|
||||
/**
|
||||
* iio_buffer_register() - register the buffer with IIO core
|
||||
* @indio_dev: device with the buffer to be registered
|
||||
* @indio_dev: device with the buffer to be registered
|
||||
* @channels: the channel descriptions used to construct buffer
|
||||
* @num_channels: the number of channels
|
||||
**/
|
||||
int iio_buffer_register(struct iio_dev *indio_dev,
|
||||
const struct iio_chan_spec *channels,
|
||||
|
|
@ -134,7 +137,7 @@ int iio_buffer_register(struct iio_dev *indio_dev,
|
|||
|
||||
/**
|
||||
* iio_buffer_unregister() - unregister the buffer from IIO core
|
||||
* @indio_dev: the device with the buffer to be unregistered
|
||||
* @indio_dev: the device with the buffer to be unregistered
|
||||
**/
|
||||
void iio_buffer_unregister(struct iio_dev *indio_dev);
|
||||
|
||||
|
|
@ -174,6 +177,9 @@ ssize_t iio_buffer_show_enable(struct device *dev,
|
|||
|
||||
int iio_sw_buffer_preenable(struct iio_dev *indio_dev);
|
||||
|
||||
bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
|
||||
const unsigned long *mask);
|
||||
|
||||
#else /* CONFIG_IIO_BUFFER */
|
||||
|
||||
static inline int iio_buffer_register(struct iio_dev *indio_dev,
|
||||
|
|
@ -184,7 +190,7 @@ static inline int iio_buffer_register(struct iio_dev *indio_dev,
|
|||
}
|
||||
|
||||
static inline void iio_buffer_unregister(struct iio_dev *indio_dev)
|
||||
{};
|
||||
{}
|
||||
|
||||
#endif /* CONFIG_IIO_BUFFER */
|
||||
|
||||
|
|
|
|||
|
|
@ -33,17 +33,17 @@ struct iio_channel {
|
|||
* side. This typically describes the channels use within
|
||||
* the consumer. E.g. 'battery_voltage'
|
||||
*/
|
||||
struct iio_channel *iio_st_channel_get(const char *name,
|
||||
const char *consumer_channel);
|
||||
struct iio_channel *iio_channel_get(const char *name,
|
||||
const char *consumer_channel);
|
||||
|
||||
/**
|
||||
* iio_st_channel_release() - release channels obtained via iio_st_channel_get
|
||||
* iio_channel_release() - release channels obtained via iio_channel_get
|
||||
* @chan: The channel to be released.
|
||||
*/
|
||||
void iio_st_channel_release(struct iio_channel *chan);
|
||||
void iio_channel_release(struct iio_channel *chan);
|
||||
|
||||
/**
|
||||
* iio_st_channel_get_all() - get all channels associated with a client
|
||||
* iio_channel_get_all() - get all channels associated with a client
|
||||
* @name: name of consumer device.
|
||||
*
|
||||
* Returns an array of iio_channel structures terminated with one with
|
||||
|
|
@ -51,37 +51,37 @@ void iio_st_channel_release(struct iio_channel *chan);
|
|||
* This function is used by fairly generic consumers to get all the
|
||||
* channels registered as having this consumer.
|
||||
*/
|
||||
struct iio_channel *iio_st_channel_get_all(const char *name);
|
||||
struct iio_channel *iio_channel_get_all(const char *name);
|
||||
|
||||
/**
|
||||
* iio_st_channel_release_all() - reverse iio_st_get_all
|
||||
* iio_channel_release_all() - reverse iio_channel_get_all
|
||||
* @chan: Array of channels to be released.
|
||||
*/
|
||||
void iio_st_channel_release_all(struct iio_channel *chan);
|
||||
void iio_channel_release_all(struct iio_channel *chan);
|
||||
|
||||
/**
|
||||
* iio_st_read_channel_raw() - read from a given channel
|
||||
* iio_read_channel_raw() - read from a given channel
|
||||
* @channel: The channel being queried.
|
||||
* @val: Value read back.
|
||||
*
|
||||
* Note raw reads from iio channels are in adc counts and hence
|
||||
* scale will need to be applied if standard units required.
|
||||
*/
|
||||
int iio_st_read_channel_raw(struct iio_channel *chan,
|
||||
int *val);
|
||||
int iio_read_channel_raw(struct iio_channel *chan,
|
||||
int *val);
|
||||
|
||||
/**
|
||||
* iio_st_get_channel_type() - get the type of a channel
|
||||
* iio_get_channel_type() - get the type of a channel
|
||||
* @channel: The channel being queried.
|
||||
* @type: The type of the channel.
|
||||
*
|
||||
* returns the enum iio_chan_type of the channel
|
||||
*/
|
||||
int iio_st_get_channel_type(struct iio_channel *channel,
|
||||
enum iio_chan_type *type);
|
||||
int iio_get_channel_type(struct iio_channel *channel,
|
||||
enum iio_chan_type *type);
|
||||
|
||||
/**
|
||||
* iio_st_read_channel_scale() - read the scale value for a channel
|
||||
* iio_read_channel_scale() - read the scale value for a channel
|
||||
* @channel: The channel being queried.
|
||||
* @val: First part of value read back.
|
||||
* @val2: Second part of value read back.
|
||||
|
|
@ -90,7 +90,7 @@ int iio_st_get_channel_type(struct iio_channel *channel,
|
|||
* as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
|
||||
* + val2/1e6
|
||||
*/
|
||||
int iio_st_read_channel_scale(struct iio_channel *chan, int *val,
|
||||
int *val2);
|
||||
int iio_read_channel_scale(struct iio_channel *chan, int *val,
|
||||
int *val2);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
28
include/linux/iio/dac/ad5421.h
Normal file
28
include/linux/iio/dac/ad5421.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef __IIO_DAC_AD5421_H__
|
||||
#define __IIO_DAC_AD5421_H__
|
||||
|
||||
/**
|
||||
* enum ad5421_current_range - Current range the AD5421 is configured for.
|
||||
* @AD5421_CURRENT_RANGE_4mA_20mA: 4 mA to 20 mA (RANGE1,0 pins = 00)
|
||||
* @AD5421_CURRENT_RANGE_3mA8_21mA: 3.8 mA to 21 mA (RANGE1,0 pins = x1)
|
||||
* @AD5421_CURRENT_RANGE_3mA2_24mA: 3.2 mA to 24 mA (RANGE1,0 pins = 10)
|
||||
*/
|
||||
|
||||
enum ad5421_current_range {
|
||||
AD5421_CURRENT_RANGE_4mA_20mA,
|
||||
AD5421_CURRENT_RANGE_3mA8_21mA,
|
||||
AD5421_CURRENT_RANGE_3mA2_24mA,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ad5421_platform_data - AD5421 DAC driver platform data
|
||||
* @external_vref: whether an external reference voltage is used or not
|
||||
* @current_range: Current range the AD5421 is configured for
|
||||
*/
|
||||
|
||||
struct ad5421_platform_data {
|
||||
bool external_vref;
|
||||
enum ad5421_current_range current_range;
|
||||
};
|
||||
|
||||
#endif
|
||||
16
include/linux/iio/dac/ad5504.h
Normal file
16
include/linux/iio/dac/ad5504.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* AD5504 SPI DAC driver
|
||||
*
|
||||
* Copyright 2011 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2.
|
||||
*/
|
||||
|
||||
#ifndef SPI_AD5504_H_
|
||||
#define SPI_AD5504_H_
|
||||
|
||||
struct ad5504_platform_data {
|
||||
u16 vref_mv;
|
||||
};
|
||||
|
||||
#endif /* SPI_AD5504_H_ */
|
||||
25
include/linux/iio/dac/ad5791.h
Normal file
25
include/linux/iio/dac/ad5791.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* AD5791 SPI DAC driver
|
||||
*
|
||||
* Copyright 2011 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2.
|
||||
*/
|
||||
|
||||
#ifndef SPI_AD5791_H_
|
||||
#define SPI_AD5791_H_
|
||||
|
||||
/**
|
||||
* struct ad5791_platform_data - platform specific information
|
||||
* @vref_pos_mv: Vdd Positive Analog Supply Volatge (mV)
|
||||
* @vref_neg_mv: Vdd Negative Analog Supply Volatge (mV)
|
||||
* @use_rbuf_gain2: ext. amplifier connected in gain of two configuration
|
||||
*/
|
||||
|
||||
struct ad5791_platform_data {
|
||||
u16 vref_pos_mv;
|
||||
u16 vref_neg_mv;
|
||||
bool use_rbuf_gain2;
|
||||
};
|
||||
|
||||
#endif /* SPI_AD5791_H_ */
|
||||
15
include/linux/iio/dac/max517.h
Normal file
15
include/linux/iio/dac/max517.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* MAX517 DAC driver
|
||||
*
|
||||
* Copyright 2011 Roland Stigge <stigge@antcom.de>
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
#ifndef IIO_DAC_MAX517_H_
|
||||
#define IIO_DAC_MAX517_H_
|
||||
|
||||
struct max517_platform_data {
|
||||
u16 vref_mv[2];
|
||||
};
|
||||
|
||||
#endif /* IIO_DAC_MAX517_H_ */
|
||||
16
include/linux/iio/dac/mcp4725.h
Normal file
16
include/linux/iio/dac/mcp4725.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* MCP4725 DAC driver
|
||||
*
|
||||
* Copyright (C) 2012 Peter Meerwald <pmeerw@pmeerw.net>
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef IIO_DAC_MCP4725_H_
|
||||
#define IIO_DAC_MCP4725_H_
|
||||
|
||||
struct mcp4725_platform_data {
|
||||
u16 vref_mv;
|
||||
};
|
||||
|
||||
#endif /* IIO_DAC_MCP4725_H_ */
|
||||
|
|
@ -46,7 +46,7 @@ enum iio_event_direction {
|
|||
* @diff: Whether the event is for an differential channel or not.
|
||||
* @modifier: Modifier for the channel. Should be one of enum iio_modifier.
|
||||
* @direction: Direction of the event. One of enum iio_event_direction.
|
||||
* @type: Type of the event. Should be one enum iio_event_type.
|
||||
* @type: Type of the event. Should be one of enum iio_event_type.
|
||||
* @chan: Channel number for non-differential channels.
|
||||
* @chan1: First channel number for differential channels.
|
||||
* @chan2: Second channel number for differential channels.
|
||||
|
|
@ -69,7 +69,7 @@ enum iio_event_direction {
|
|||
* @chan_type: Type of the channel. Should be one of enum iio_chan_type.
|
||||
* @number: Channel number.
|
||||
* @modifier: Modifier for the channel. Should be one of enum iio_modifier.
|
||||
* @type: Type of the event. Should be one enum iio_event_type.
|
||||
* @type: Type of the event. Should be one of enum iio_event_type.
|
||||
* @direction: Direction of the event. One of enum iio_event_direction.
|
||||
*/
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ enum iio_event_direction {
|
|||
* IIO_UNMOD_EVENT_CODE() - create event identifier for unmodified channels
|
||||
* @chan_type: Type of the channel. Should be one of enum iio_chan_type.
|
||||
* @number: Channel number.
|
||||
* @type: Type of the event. Should be one enum iio_event_type.
|
||||
* @type: Type of the event. Should be one of enum iio_event_type.
|
||||
* @direction: Direction of the event. One of enum iio_event_direction.
|
||||
*/
|
||||
|
||||
|
|
|
|||
195
include/linux/iio/frequency/ad9523.h
Normal file
195
include/linux/iio/frequency/ad9523.h
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
/*
|
||||
* AD9523 SPI Low Jitter Clock Generator
|
||||
*
|
||||
* Copyright 2012 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2.
|
||||
*/
|
||||
|
||||
#ifndef IIO_FREQUENCY_AD9523_H_
|
||||
#define IIO_FREQUENCY_AD9523_H_
|
||||
|
||||
enum outp_drv_mode {
|
||||
TRISTATE,
|
||||
LVPECL_8mA,
|
||||
LVDS_4mA,
|
||||
LVDS_7mA,
|
||||
HSTL0_16mA,
|
||||
HSTL1_8mA,
|
||||
CMOS_CONF1,
|
||||
CMOS_CONF2,
|
||||
CMOS_CONF3,
|
||||
CMOS_CONF4,
|
||||
CMOS_CONF5,
|
||||
CMOS_CONF6,
|
||||
CMOS_CONF7,
|
||||
CMOS_CONF8,
|
||||
CMOS_CONF9
|
||||
};
|
||||
|
||||
enum ref_sel_mode {
|
||||
NONEREVERTIVE_STAY_ON_REFB,
|
||||
REVERT_TO_REFA,
|
||||
SELECT_REFA,
|
||||
SELECT_REFB,
|
||||
EXT_REF_SEL
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ad9523_channel_spec - Output channel configuration
|
||||
*
|
||||
* @channel_num: Output channel number.
|
||||
* @divider_output_invert_en: Invert the polarity of the output clock.
|
||||
* @sync_ignore_en: Ignore chip-level SYNC signal.
|
||||
* @low_power_mode_en: Reduce power used in the differential output modes.
|
||||
* @use_alt_clock_src: Channel divider uses alternative clk source.
|
||||
* @output_dis: Disables, powers down the entire channel.
|
||||
* @driver_mode: Output driver mode (logic level family).
|
||||
* @divider_phase: Divider initial phase after a SYNC. Range 0..63
|
||||
LSB = 1/2 of a period of the divider input clock.
|
||||
* @channel_divider: 10-bit channel divider.
|
||||
* @extended_name: Optional descriptive channel name.
|
||||
*/
|
||||
|
||||
struct ad9523_channel_spec {
|
||||
unsigned channel_num;
|
||||
bool divider_output_invert_en;
|
||||
bool sync_ignore_en;
|
||||
bool low_power_mode_en;
|
||||
/* CH0..CH3 VCXO, CH4..CH9 VCO2 */
|
||||
bool use_alt_clock_src;
|
||||
bool output_dis;
|
||||
enum outp_drv_mode driver_mode;
|
||||
unsigned char divider_phase;
|
||||
unsigned short channel_divider;
|
||||
char extended_name[16];
|
||||
};
|
||||
|
||||
enum pll1_rzero_resistor {
|
||||
RZERO_883_OHM,
|
||||
RZERO_677_OHM,
|
||||
RZERO_341_OHM,
|
||||
RZERO_135_OHM,
|
||||
RZERO_10_OHM,
|
||||
RZERO_USE_EXT_RES = 8,
|
||||
};
|
||||
|
||||
enum rpole2_resistor {
|
||||
RPOLE2_900_OHM,
|
||||
RPOLE2_450_OHM,
|
||||
RPOLE2_300_OHM,
|
||||
RPOLE2_225_OHM,
|
||||
};
|
||||
|
||||
enum rzero_resistor {
|
||||
RZERO_3250_OHM,
|
||||
RZERO_2750_OHM,
|
||||
RZERO_2250_OHM,
|
||||
RZERO_2100_OHM,
|
||||
RZERO_3000_OHM,
|
||||
RZERO_2500_OHM,
|
||||
RZERO_2000_OHM,
|
||||
RZERO_1850_OHM,
|
||||
};
|
||||
|
||||
enum cpole1_capacitor {
|
||||
CPOLE1_0_PF,
|
||||
CPOLE1_8_PF,
|
||||
CPOLE1_16_PF,
|
||||
CPOLE1_24_PF,
|
||||
_CPOLE1_24_PF, /* place holder */
|
||||
CPOLE1_32_PF,
|
||||
CPOLE1_40_PF,
|
||||
CPOLE1_48_PF,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ad9523_platform_data - platform specific information
|
||||
*
|
||||
* @vcxo_freq: External VCXO frequency in Hz
|
||||
* @refa_diff_rcv_en: REFA differential/single-ended input selection.
|
||||
* @refb_diff_rcv_en: REFB differential/single-ended input selection.
|
||||
* @zd_in_diff_en: Zero Delay differential/single-ended input selection.
|
||||
* @osc_in_diff_en: OSC differential/ single-ended input selection.
|
||||
* @refa_cmos_neg_inp_en: REFA single-ended neg./pos. input enable.
|
||||
* @refb_cmos_neg_inp_en: REFB single-ended neg./pos. input enable.
|
||||
* @zd_in_cmos_neg_inp_en: Zero Delay single-ended neg./pos. input enable.
|
||||
* @osc_in_cmos_neg_inp_en: OSC single-ended neg./pos. input enable.
|
||||
* @refa_r_div: PLL1 10-bit REFA R divider.
|
||||
* @refb_r_div: PLL1 10-bit REFB R divider.
|
||||
* @pll1_feedback_div: PLL1 10-bit Feedback N divider.
|
||||
* @pll1_charge_pump_current_nA: Magnitude of PLL1 charge pump current (nA).
|
||||
* @zero_delay_mode_internal_en: Internal, external Zero Delay mode selection.
|
||||
* @osc_in_feedback_en: PLL1 feedback path, local feedback from
|
||||
* the OSC_IN receiver or zero delay mode
|
||||
* @pll1_loop_filter_rzero: PLL1 Loop Filter Zero Resistor selection.
|
||||
* @ref_mode: Reference selection mode.
|
||||
* @pll2_charge_pump_current_nA: Magnitude of PLL2 charge pump current (nA).
|
||||
* @pll2_ndiv_a_cnt: PLL2 Feedback N-divider, A Counter, range 0..4.
|
||||
* @pll2_ndiv_b_cnt: PLL2 Feedback N-divider, B Counter, range 0..63.
|
||||
* @pll2_freq_doubler_en: PLL2 frequency doubler enable.
|
||||
* @pll2_r2_div: PLL2 R2 divider, range 0..31.
|
||||
* @pll2_vco_diff_m1: VCO1 divider, range 3..5.
|
||||
* @pll2_vco_diff_m2: VCO2 divider, range 3..5.
|
||||
* @rpole2: PLL2 loop filter Rpole resistor value.
|
||||
* @rzero: PLL2 loop filter Rzero resistor value.
|
||||
* @cpole1: PLL2 loop filter Cpole capacitor value.
|
||||
* @rzero_bypass_en: PLL2 loop filter Rzero bypass enable.
|
||||
* @num_channels: Array size of struct ad9523_channel_spec.
|
||||
* @channels: Pointer to channel array.
|
||||
* @name: Optional alternative iio device name.
|
||||
*/
|
||||
|
||||
struct ad9523_platform_data {
|
||||
unsigned long vcxo_freq;
|
||||
|
||||
/* Differential/ Single-Ended Input Configuration */
|
||||
bool refa_diff_rcv_en;
|
||||
bool refb_diff_rcv_en;
|
||||
bool zd_in_diff_en;
|
||||
bool osc_in_diff_en;
|
||||
|
||||
/*
|
||||
* Valid if differential input disabled
|
||||
* if false defaults to pos input
|
||||
*/
|
||||
bool refa_cmos_neg_inp_en;
|
||||
bool refb_cmos_neg_inp_en;
|
||||
bool zd_in_cmos_neg_inp_en;
|
||||
bool osc_in_cmos_neg_inp_en;
|
||||
|
||||
/* PLL1 Setting */
|
||||
unsigned short refa_r_div;
|
||||
unsigned short refb_r_div;
|
||||
unsigned short pll1_feedback_div;
|
||||
unsigned short pll1_charge_pump_current_nA;
|
||||
bool zero_delay_mode_internal_en;
|
||||
bool osc_in_feedback_en;
|
||||
enum pll1_rzero_resistor pll1_loop_filter_rzero;
|
||||
|
||||
/* Reference */
|
||||
enum ref_sel_mode ref_mode;
|
||||
|
||||
/* PLL2 Setting */
|
||||
unsigned int pll2_charge_pump_current_nA;
|
||||
unsigned char pll2_ndiv_a_cnt;
|
||||
unsigned char pll2_ndiv_b_cnt;
|
||||
bool pll2_freq_doubler_en;
|
||||
unsigned char pll2_r2_div;
|
||||
unsigned char pll2_vco_diff_m1; /* 3..5 */
|
||||
unsigned char pll2_vco_diff_m2; /* 3..5 */
|
||||
|
||||
/* Loop Filter PLL2 */
|
||||
enum rpole2_resistor rpole2;
|
||||
enum rzero_resistor rzero;
|
||||
enum cpole1_capacitor cpole1;
|
||||
bool rzero_bypass_en;
|
||||
|
||||
/* Output Channel Configuration */
|
||||
int num_channels;
|
||||
struct ad9523_channel_spec *channels;
|
||||
|
||||
char name[SPI_NAME_SIZE];
|
||||
};
|
||||
|
||||
#endif /* IIO_FREQUENCY_AD9523_H_ */
|
||||
128
include/linux/iio/frequency/adf4350.h
Normal file
128
include/linux/iio/frequency/adf4350.h
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* ADF4350/ADF4351 SPI PLL driver
|
||||
*
|
||||
* Copyright 2012 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2.
|
||||
*/
|
||||
|
||||
#ifndef IIO_PLL_ADF4350_H_
|
||||
#define IIO_PLL_ADF4350_H_
|
||||
|
||||
/* Registers */
|
||||
#define ADF4350_REG0 0
|
||||
#define ADF4350_REG1 1
|
||||
#define ADF4350_REG2 2
|
||||
#define ADF4350_REG3 3
|
||||
#define ADF4350_REG4 4
|
||||
#define ADF4350_REG5 5
|
||||
|
||||
/* REG0 Bit Definitions */
|
||||
#define ADF4350_REG0_FRACT(x) (((x) & 0xFFF) << 3)
|
||||
#define ADF4350_REG0_INT(x) (((x) & 0xFFFF) << 15)
|
||||
|
||||
/* REG1 Bit Definitions */
|
||||
#define ADF4350_REG1_MOD(x) (((x) & 0xFFF) << 3)
|
||||
#define ADF4350_REG1_PHASE(x) (((x) & 0xFFF) << 15)
|
||||
#define ADF4350_REG1_PRESCALER (1 << 27)
|
||||
|
||||
/* REG2 Bit Definitions */
|
||||
#define ADF4350_REG2_COUNTER_RESET_EN (1 << 3)
|
||||
#define ADF4350_REG2_CP_THREESTATE_EN (1 << 4)
|
||||
#define ADF4350_REG2_POWER_DOWN_EN (1 << 5)
|
||||
#define ADF4350_REG2_PD_POLARITY_POS (1 << 6)
|
||||
#define ADF4350_REG2_LDP_6ns (1 << 7)
|
||||
#define ADF4350_REG2_LDP_10ns (0 << 7)
|
||||
#define ADF4350_REG2_LDF_FRACT_N (0 << 8)
|
||||
#define ADF4350_REG2_LDF_INT_N (1 << 8)
|
||||
#define ADF4350_REG2_CHARGE_PUMP_CURR_uA(x) (((((x)-312) / 312) & 0xF) << 9)
|
||||
#define ADF4350_REG2_DOUBLE_BUFF_EN (1 << 13)
|
||||
#define ADF4350_REG2_10BIT_R_CNT(x) ((x) << 14)
|
||||
#define ADF4350_REG2_RDIV2_EN (1 << 24)
|
||||
#define ADF4350_REG2_RMULT2_EN (1 << 25)
|
||||
#define ADF4350_REG2_MUXOUT(x) ((x) << 26)
|
||||
#define ADF4350_REG2_NOISE_MODE(x) ((x) << 29)
|
||||
#define ADF4350_MUXOUT_THREESTATE 0
|
||||
#define ADF4350_MUXOUT_DVDD 1
|
||||
#define ADF4350_MUXOUT_GND 2
|
||||
#define ADF4350_MUXOUT_R_DIV_OUT 3
|
||||
#define ADF4350_MUXOUT_N_DIV_OUT 4
|
||||
#define ADF4350_MUXOUT_ANALOG_LOCK_DETECT 5
|
||||
#define ADF4350_MUXOUT_DIGITAL_LOCK_DETECT 6
|
||||
|
||||
/* REG3 Bit Definitions */
|
||||
#define ADF4350_REG3_12BIT_CLKDIV(x) ((x) << 3)
|
||||
#define ADF4350_REG3_12BIT_CLKDIV_MODE(x) ((x) << 16)
|
||||
#define ADF4350_REG3_12BIT_CSR_EN (1 << 18)
|
||||
#define ADF4351_REG3_CHARGE_CANCELLATION_EN (1 << 21)
|
||||
#define ADF4351_REG3_ANTI_BACKLASH_3ns_EN (1 << 22)
|
||||
#define ADF4351_REG3_BAND_SEL_CLOCK_MODE_HIGH (1 << 23)
|
||||
|
||||
/* REG4 Bit Definitions */
|
||||
#define ADF4350_REG4_OUTPUT_PWR(x) ((x) << 3)
|
||||
#define ADF4350_REG4_RF_OUT_EN (1 << 5)
|
||||
#define ADF4350_REG4_AUX_OUTPUT_PWR(x) ((x) << 6)
|
||||
#define ADF4350_REG4_AUX_OUTPUT_EN (1 << 8)
|
||||
#define ADF4350_REG4_AUX_OUTPUT_FUND (1 << 9)
|
||||
#define ADF4350_REG4_AUX_OUTPUT_DIV (0 << 9)
|
||||
#define ADF4350_REG4_MUTE_TILL_LOCK_EN (1 << 10)
|
||||
#define ADF4350_REG4_VCO_PWRDOWN_EN (1 << 11)
|
||||
#define ADF4350_REG4_8BIT_BAND_SEL_CLKDIV(x) ((x) << 12)
|
||||
#define ADF4350_REG4_RF_DIV_SEL(x) ((x) << 20)
|
||||
#define ADF4350_REG4_FEEDBACK_DIVIDED (0 << 23)
|
||||
#define ADF4350_REG4_FEEDBACK_FUND (1 << 23)
|
||||
|
||||
/* REG5 Bit Definitions */
|
||||
#define ADF4350_REG5_LD_PIN_MODE_LOW (0 << 22)
|
||||
#define ADF4350_REG5_LD_PIN_MODE_DIGITAL (1 << 22)
|
||||
#define ADF4350_REG5_LD_PIN_MODE_HIGH (3 << 22)
|
||||
|
||||
/* Specifications */
|
||||
#define ADF4350_MAX_OUT_FREQ 4400000000ULL /* Hz */
|
||||
#define ADF4350_MIN_OUT_FREQ 137500000 /* Hz */
|
||||
#define ADF4351_MIN_OUT_FREQ 34375000 /* Hz */
|
||||
#define ADF4350_MIN_VCO_FREQ 2200000000ULL /* Hz */
|
||||
#define ADF4350_MAX_FREQ_45_PRESC 3000000000ULL /* Hz */
|
||||
#define ADF4350_MAX_FREQ_PFD 32000000 /* Hz */
|
||||
#define ADF4350_MAX_BANDSEL_CLK 125000 /* Hz */
|
||||
#define ADF4350_MAX_FREQ_REFIN 250000000 /* Hz */
|
||||
#define ADF4350_MAX_MODULUS 4095
|
||||
#define ADF4350_MAX_R_CNT 1023
|
||||
|
||||
|
||||
/**
|
||||
* struct adf4350_platform_data - platform specific information
|
||||
* @name: Optional device name.
|
||||
* @clkin: REFin frequency in Hz.
|
||||
* @channel_spacing: Channel spacing in Hz (influences MODULUS).
|
||||
* @power_up_frequency: Optional, If set in Hz the PLL tunes to the desired
|
||||
* frequency on probe.
|
||||
* @ref_div_factor: Optional, if set the driver skips dynamic calculation
|
||||
* and uses this default value instead.
|
||||
* @ref_doubler_en: Enables reference doubler.
|
||||
* @ref_div2_en: Enables reference divider.
|
||||
* @r2_user_settings: User defined settings for ADF4350/1 REGISTER_2.
|
||||
* @r3_user_settings: User defined settings for ADF4350/1 REGISTER_3.
|
||||
* @r4_user_settings: User defined settings for ADF4350/1 REGISTER_4.
|
||||
* @gpio_lock_detect: Optional, if set with a valid GPIO number,
|
||||
* pll lock state is tested upon read.
|
||||
* If not used - set to -1.
|
||||
*/
|
||||
|
||||
struct adf4350_platform_data {
|
||||
char name[32];
|
||||
unsigned long clkin;
|
||||
unsigned long channel_spacing;
|
||||
unsigned long long power_up_frequency;
|
||||
|
||||
unsigned short ref_div_factor; /* 10-bit R counter */
|
||||
bool ref_doubler_en;
|
||||
bool ref_div2_en;
|
||||
|
||||
unsigned r2_user_settings;
|
||||
unsigned r3_user_settings;
|
||||
unsigned r4_user_settings;
|
||||
int gpio_lock_detect;
|
||||
};
|
||||
|
||||
#endif /* IIO_PLL_ADF4350_H_ */
|
||||
|
|
@ -129,15 +129,79 @@ struct iio_chan_spec_ext_info {
|
|||
uintptr_t private;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iio_enum - Enum channel info attribute
|
||||
* @items: An array of strings.
|
||||
* @num_items: Length of the item array.
|
||||
* @set: Set callback function, may be NULL.
|
||||
* @get: Get callback function, may be NULL.
|
||||
*
|
||||
* The iio_enum struct can be used to implement enum style channel attributes.
|
||||
* Enum style attributes are those which have a set of strings which map to
|
||||
* unsigned integer values. The IIO enum helper code takes care of mapping
|
||||
* between value and string as well as generating a "_available" file which
|
||||
* contains a list of all available items. The set callback will be called when
|
||||
* the attribute is updated. The last parameter is the index to the newly
|
||||
* activated item. The get callback will be used to query the currently active
|
||||
* item and is supposed to return the index for it.
|
||||
*/
|
||||
struct iio_enum {
|
||||
const char * const *items;
|
||||
unsigned int num_items;
|
||||
int (*set)(struct iio_dev *, const struct iio_chan_spec *, unsigned int);
|
||||
int (*get)(struct iio_dev *, const struct iio_chan_spec *);
|
||||
};
|
||||
|
||||
ssize_t iio_enum_available_read(struct iio_dev *indio_dev,
|
||||
uintptr_t priv, const struct iio_chan_spec *chan, char *buf);
|
||||
ssize_t iio_enum_read(struct iio_dev *indio_dev,
|
||||
uintptr_t priv, const struct iio_chan_spec *chan, char *buf);
|
||||
ssize_t iio_enum_write(struct iio_dev *indio_dev,
|
||||
uintptr_t priv, const struct iio_chan_spec *chan, const char *buf,
|
||||
size_t len);
|
||||
|
||||
/**
|
||||
* IIO_ENUM() - Initialize enum extended channel attribute
|
||||
* @_name: Attribute name
|
||||
* @_shared: Whether the attribute is shared between all channels
|
||||
* @_e: Pointer to a iio_enum struct
|
||||
*
|
||||
* This should usually be used together with IIO_ENUM_AVAILABLE()
|
||||
*/
|
||||
#define IIO_ENUM(_name, _shared, _e) \
|
||||
{ \
|
||||
.name = (_name), \
|
||||
.shared = (_shared), \
|
||||
.read = iio_enum_read, \
|
||||
.write = iio_enum_write, \
|
||||
.private = (uintptr_t)(_e), \
|
||||
}
|
||||
|
||||
/**
|
||||
* IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute
|
||||
* @_name: Attribute name ("_available" will be appended to the name)
|
||||
* @_e: Pointer to a iio_enum struct
|
||||
*
|
||||
* Creates a read only attribute which list all the available enum items in a
|
||||
* space separated list. This should usually be used together with IIO_ENUM()
|
||||
*/
|
||||
#define IIO_ENUM_AVAILABLE(_name, _e) \
|
||||
{ \
|
||||
.name = (_name "_available"), \
|
||||
.shared = true, \
|
||||
.read = iio_enum_available_read, \
|
||||
.private = (uintptr_t)(_e), \
|
||||
}
|
||||
|
||||
/**
|
||||
* struct iio_chan_spec - specification of a single channel
|
||||
* @type: What type of measurement is the channel making.
|
||||
* @channel: What number or name do we wish to assign the channel.
|
||||
* @channel: What number do we wish to assign the channel.
|
||||
* @channel2: If there is a second number for a differential
|
||||
* channel then this is it. If modified is set then the
|
||||
* value here specifies the modifier.
|
||||
* @address: Driver specific identifier.
|
||||
* @scan_index: Monotonic index to give ordering in scans when read
|
||||
* @scan_index: Monotonic index to give ordering in scans when read
|
||||
* from a buffer.
|
||||
* @scan_type: Sign: 's' or 'u' to specify signed or unsigned
|
||||
* realbits: Number of valid bits of data
|
||||
|
|
@ -147,14 +211,14 @@ struct iio_chan_spec_ext_info {
|
|||
* endianness: little or big endian
|
||||
* @info_mask: What information is to be exported about this channel.
|
||||
* This includes calibbias, scale etc.
|
||||
* @event_mask: What events can this channel produce.
|
||||
* @event_mask: What events can this channel produce.
|
||||
* @ext_info: Array of extended info attributes for this channel.
|
||||
* The array is NULL terminated, the last element should
|
||||
* have it's name field set to NULL.
|
||||
* have its name field set to NULL.
|
||||
* @extend_name: Allows labeling of channel attributes with an
|
||||
* informative name. Note this has no effect codes etc,
|
||||
* unlike modifiers.
|
||||
* @datasheet_name: A name used in in kernel mapping of channels. It should
|
||||
* @datasheet_name: A name used in in-kernel mapping of channels. It should
|
||||
* correspond to the first name that the channel is referred
|
||||
* to by in the datasheet (e.g. IND), or the nearest
|
||||
* possible compound name (e.g. IND-INC).
|
||||
|
|
@ -163,9 +227,8 @@ struct iio_chan_spec_ext_info {
|
|||
* channel2. Examples are IIO_MOD_X for axial sensors about
|
||||
* the 'x' axis.
|
||||
* @indexed: Specify the channel has a numerical index. If not,
|
||||
* the value in channel will be suppressed for attribute
|
||||
* but not for event codes. Typically set it to 0 when
|
||||
* the index is false.
|
||||
* the channel index number will be suppressed for sysfs
|
||||
* attributes but not for event codes.
|
||||
* @differential: Channel is differential.
|
||||
*/
|
||||
struct iio_chan_spec {
|
||||
|
|
@ -300,12 +363,16 @@ struct iio_info {
|
|||
* @predisable: [DRIVER] function to run prior to marking buffer
|
||||
* disabled
|
||||
* @postdisable: [DRIVER] function to run after marking buffer disabled
|
||||
* @validate_scan_mask: [DRIVER] function callback to check whether a given
|
||||
* scan mask is valid for the device.
|
||||
*/
|
||||
struct iio_buffer_setup_ops {
|
||||
int (*preenable)(struct iio_dev *);
|
||||
int (*postenable)(struct iio_dev *);
|
||||
int (*predisable)(struct iio_dev *);
|
||||
int (*postdisable)(struct iio_dev *);
|
||||
bool (*validate_scan_mask)(struct iio_dev *indio_dev,
|
||||
const unsigned long *scan_mask);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -329,7 +396,7 @@ struct iio_buffer_setup_ops {
|
|||
* @trig: [INTERN] current device trigger (buffer modes)
|
||||
* @pollfunc: [DRIVER] function run on trigger being received
|
||||
* @channels: [DRIVER] channel specification structure table
|
||||
* @num_channels: [DRIVER] number of chanels specified in @channels.
|
||||
* @num_channels: [DRIVER] number of channels specified in @channels.
|
||||
* @channel_attr_list: [INTERN] keep track of automatically created channel
|
||||
* attributes
|
||||
* @chan_attr_group: [INTERN] group for all attrs in base directory
|
||||
|
|
@ -419,7 +486,7 @@ extern struct bus_type iio_bus_type;
|
|||
|
||||
/**
|
||||
* iio_device_put() - reference counted deallocation of struct device
|
||||
* @dev: the iio_device containing the device
|
||||
* @indio_dev: IIO device structure containing the device
|
||||
**/
|
||||
static inline void iio_device_put(struct iio_dev *indio_dev)
|
||||
{
|
||||
|
|
@ -429,7 +496,7 @@ static inline void iio_device_put(struct iio_dev *indio_dev)
|
|||
|
||||
/**
|
||||
* dev_to_iio_dev() - Get IIO device struct from a device struct
|
||||
* @dev: The device embedded in the IIO device
|
||||
* @dev: The device embedded in the IIO device
|
||||
*
|
||||
* Note: The device must be a IIO device, otherwise the result is undefined.
|
||||
*/
|
||||
|
|
@ -438,11 +505,22 @@ static inline struct iio_dev *dev_to_iio_dev(struct device *dev)
|
|||
return container_of(dev, struct iio_dev, dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* iio_device_get() - increment reference count for the device
|
||||
* @indio_dev: IIO device structure
|
||||
*
|
||||
* Returns: The passed IIO device
|
||||
**/
|
||||
static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev)
|
||||
{
|
||||
return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL;
|
||||
}
|
||||
|
||||
/* Can we make this smaller? */
|
||||
#define IIO_ALIGN L1_CACHE_BYTES
|
||||
/**
|
||||
* iio_device_alloc() - allocate an iio_dev from a driver
|
||||
* @sizeof_priv: Space to allocate for private structure.
|
||||
* @sizeof_priv: Space to allocate for private structure.
|
||||
**/
|
||||
struct iio_dev *iio_device_alloc(int sizeof_priv);
|
||||
|
||||
|
|
@ -459,13 +537,13 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
|
|||
|
||||
/**
|
||||
* iio_device_free() - free an iio_dev from a driver
|
||||
* @dev: the iio_dev associated with the device
|
||||
* @indio_dev: the iio_dev associated with the device
|
||||
**/
|
||||
void iio_device_free(struct iio_dev *indio_dev);
|
||||
|
||||
/**
|
||||
* iio_buffer_enabled() - helper function to test if the buffer is enabled
|
||||
* @indio_dev: IIO device info structure for device
|
||||
* @indio_dev: IIO device structure for device
|
||||
**/
|
||||
static inline bool iio_buffer_enabled(struct iio_dev *indio_dev)
|
||||
{
|
||||
|
|
@ -475,7 +553,7 @@ static inline bool iio_buffer_enabled(struct iio_dev *indio_dev)
|
|||
|
||||
/**
|
||||
* iio_get_debugfs_dentry() - helper function to get the debugfs_dentry
|
||||
* @indio_dev: IIO device info structure for device
|
||||
* @indio_dev: IIO device structure for device
|
||||
**/
|
||||
#if defined(CONFIG_DEBUG_FS)
|
||||
static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
* This is matched against the datasheet_name element
|
||||
* of struct iio_chan_spec.
|
||||
* @consumer_dev_name: Name to uniquely identify the consumer device.
|
||||
* @consumer_channel: Unique name used to idenitify the channel on the
|
||||
* @consumer_channel: Unique name used to identify the channel on the
|
||||
* consumer side.
|
||||
*/
|
||||
struct iio_map {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ struct iio_const_attr {
|
|||
#define IIO_DEV_ATTR_SAMP_FREQ_AVAIL(_show) \
|
||||
IIO_DEVICE_ATTR(sampling_frequency_available, S_IRUGO, _show, NULL, 0)
|
||||
/**
|
||||
* IIO_CONST_ATTR_AVAIL_SAMP_FREQ - list available sampling frequencies
|
||||
* IIO_CONST_ATTR_SAMP_FREQ_AVAIL - list available sampling frequencies
|
||||
* @_string: frequency string for the attribute
|
||||
*
|
||||
* Constant version
|
||||
|
|
|
|||
15
include/linux/iio/triggered_buffer.h
Normal file
15
include/linux/iio/triggered_buffer.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef _LINUX_IIO_TRIGGERED_BUFFER_H_
|
||||
#define _LINUX_IIO_TRIGGERED_BUFFER_H_
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
struct iio_dev;
|
||||
struct iio_buffer_setup_ops;
|
||||
|
||||
int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
|
||||
irqreturn_t (*pollfunc_bh)(int irq, void *p),
|
||||
irqreturn_t (*pollfunc_th)(int irq, void *p),
|
||||
const struct iio_buffer_setup_ops *setup_ops);
|
||||
void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev);
|
||||
|
||||
#endif
|
||||
|
|
@ -11,7 +11,6 @@
|
|||
#define _IIO_TYPES_H_
|
||||
|
||||
enum iio_chan_type {
|
||||
/* real channel types */
|
||||
IIO_VOLTAGE,
|
||||
IIO_CURRENT,
|
||||
IIO_POWER,
|
||||
|
|
@ -28,6 +27,7 @@ enum iio_chan_type {
|
|||
IIO_TIMESTAMP,
|
||||
IIO_CAPACITANCE,
|
||||
IIO_ALTVOLTAGE,
|
||||
IIO_CCT,
|
||||
};
|
||||
|
||||
enum iio_modifier {
|
||||
|
|
@ -45,6 +45,12 @@ enum iio_modifier {
|
|||
IIO_MOD_X_OR_Y_OR_Z,
|
||||
IIO_MOD_LIGHT_BOTH,
|
||||
IIO_MOD_LIGHT_IR,
|
||||
IIO_MOD_ROOT_SUM_SQUARED_X_Y,
|
||||
IIO_MOD_SUM_SQUARED_X_Y_Z,
|
||||
IIO_MOD_LIGHT_CLEAR,
|
||||
IIO_MOD_LIGHT_RED,
|
||||
IIO_MOD_LIGHT_GREEN,
|
||||
IIO_MOD_LIGHT_BLUE,
|
||||
};
|
||||
|
||||
#define IIO_VAL_INT 1
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue