aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-07-25 00:31:09 -0400
committerGrant Likely <grant.likely@secretlab.ca>2012-07-25 00:34:40 -0400
commit6aeea3ecc33b1f36dbc3b80461d15a7052ae424f (patch)
treebbd273e3e0ca76094aed8e9c77e5adfe2b07f779 /include/linux
parent9844a5524ec532aee826c35e3031637c7fc8287b (diff)
parentbdc0077af574800d24318b6945cf2344e8dbb050 (diff)
Merge remote-tracking branch 'origin' into irqdomain/next
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/ac97_codec.h362
-rw-r--r--include/linux/async.h36
-rw-r--r--include/linux/bcma/bcma.h39
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h88
-rw-r--r--include/linux/bcma/bcma_driver_gmac_cmn.h100
-rw-r--r--include/linux/bootmem.h5
-rw-r--r--include/linux/can.h70
-rw-r--r--include/linux/can/core.h4
-rw-r--r--include/linux/can/dev.h35
-rw-r--r--include/linux/can/error.h4
-rw-r--r--include/linux/can/raw.h3
-rw-r--r--include/linux/capability.h6
-rw-r--r--include/linux/ceph/messenger.h12
-rw-r--r--include/linux/cgroup.h17
-rw-r--r--include/linux/clk-private.h22
-rw-r--r--include/linux/clk-provider.h31
-rw-r--r--include/linux/clk.h24
-rw-r--r--include/linux/cpu.h5
-rw-r--r--include/linux/cpu_rmap.h4
-rw-r--r--include/linux/cpuidle.h20
-rw-r--r--include/linux/dcache.h4
-rw-r--r--include/linux/device.h4
-rw-r--r--include/linux/dmaengine.h10
-rw-r--r--include/linux/dw_apb_timer.h1
-rw-r--r--include/linux/etherdevice.h25
-rw-r--r--include/linux/ethtool.h43
-rw-r--r--include/linux/eventpoll.h2
-rw-r--r--include/linux/file.h3
-rw-r--r--include/linux/fs.h33
-rw-r--r--include/linux/ftrace_event.h5
-rw-r--r--include/linux/genetlink.h2
-rw-r--r--include/linux/gfs2_ondisk.h14
-rw-r--r--include/linux/gpio.h4
-rw-r--r--include/linux/hid.h1
-rw-r--r--include/linux/hrtimer.h10
-rw-r--r--include/linux/i2c.h3
-rw-r--r--include/linux/i2c/twl.h1
-rw-r--r--include/linux/ieee80211.h212
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_ether.h3
-rw-r--r--include/linux/if_link.h2
-rw-r--r--include/linux/if_team.h74
-rw-r--r--include/linux/if_tunnel.h14
-rw-r--r--include/linux/inetdevice.h2
-rw-r--r--include/linux/init_task.h4
-rw-r--r--include/linux/intel-iommu.h2
-rw-r--r--include/linux/io.h9
-rw-r--r--include/linux/iommu.h140
-rw-r--r--include/linux/ipv6.h36
-rw-r--r--include/linux/irq.h2
-rw-r--r--include/linux/jump_label.h17
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/key.h4
-rw-r--r--include/linux/kmsg_dump.h16
-rw-r--r--include/linux/ks8851_mll.h33
-rw-r--r--include/linux/kthread.h8
-rw-r--r--include/linux/kvm.h3
-rw-r--r--include/linux/kvm_host.h27
-rw-r--r--include/linux/libata.h4
-rw-r--r--include/linux/mdio.h28
-rw-r--r--include/linux/memblock.h4
-rw-r--r--include/linux/mfd/abx500/ab8500-codec.h52
-rw-r--r--include/linux/mfd/abx500/ab8500.h2
-rw-r--r--include/linux/mfd/s5m87xx/s5m-core.h5
-rw-r--r--include/linux/mfd/tmio.h4
-rw-r--r--include/linux/mfd/tps65217.h13
-rw-r--r--include/linux/mfd/tps65910.h6
-rw-r--r--include/linux/mii.h9
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/cmd.h4
-rw-r--r--include/linux/mlx4/device.h258
-rw-r--r--include/linux/mlx4/driver.h5
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mmc/card.h1
-rw-r--r--include/linux/mmc/cd-gpio.h18
-rw-r--r--include/linux/mmc/host.h48
-rw-r--r--include/linux/mmc/sdhci.h4
-rw-r--r--include/linux/mmc/sh_mmcif.h10
-rw-r--r--include/linux/mmc/sh_mobile_sdhi.h1
-rw-r--r--include/linux/mmc/slot-gpio.h24
-rw-r--r--include/linux/mmzone.h4
-rw-r--r--include/linux/mxsfb.h49
-rw-r--r--include/linux/namei.h18
-rw-r--r--include/linux/net.h2
-rw-r--r--include/linux/netdevice.h18
-rw-r--r--include/linux/netfilter.h26
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h2
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h39
-rw-r--r--include/linux/netfilter/nfnetlink_cthelper.h55
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h9
-rw-r--r--include/linux/netfilter/xt_connlimit.h9
-rw-r--r--include/linux/netfilter/xt_recent.h10
-rw-r--r--include/linux/netfilter_ipv4.h1
-rw-r--r--include/linux/netfilter_ipv4/Kbuild1
-rw-r--r--include/linux/netfilter_ipv4/ipt_addrtype.h27
-rw-r--r--include/linux/netfilter_ipv6.h1
-rw-r--r--include/linux/netlink.h24
-rw-r--r--include/linux/netpoll.h2
-rw-r--r--include/linux/nfc.h26
-rw-r--r--include/linux/nfs_xdr.h2
-rw-r--r--include/linux/nl80211.h234
-rw-r--r--include/linux/nl802154.h14
-rw-r--r--include/linux/of.h3
-rw-r--r--include/linux/of_iommu.h21
-rw-r--r--include/linux/of_mtd.h2
-rw-r--r--include/linux/pci-acpi.h1
-rw-r--r--include/linux/pci.h84
-rw-r--r--include/linux/pci_ids.h12
-rw-r--r--include/linux/pci_regs.h122
-rw-r--r--include/linux/perf_event.h3
-rw-r--r--include/linux/phy.h31
-rw-r--r--include/linux/pinctrl/pinctrl.h5
-rw-r--r--include/linux/pkt_cls.h6
-rw-r--r--include/linux/platform_data/clk-integrator.h1
-rw-r--r--include/linux/platform_data/clk-nomadik.h2
-rw-r--r--include/linux/platform_data/clk-u300.h1
-rw-r--r--include/linux/platform_data/mmp_audio.h22
-rw-r--r--include/linux/platform_data/omap_drm.h52
-rw-r--r--include/linux/pm_domain.h18
-rw-r--r--include/linux/pm_qos.h2
-rw-r--r--include/linux/power/smartreflex.h308
-rw-r--r--include/linux/quota.h2
-rw-r--r--include/linux/quotaops.h8
-rw-r--r--include/linux/rcupdate.h54
-rw-r--r--include/linux/rcutiny.h6
-rw-r--r--include/linux/regmap.h69
-rw-r--r--include/linux/regulator/consumer.h6
-rw-r--r--include/linux/regulator/driver.h30
-rw-r--r--include/linux/regulator/fixed.h13
-rw-r--r--include/linux/regulator/lp872x.h90
-rw-r--r--include/linux/regulator/machine.h3
-rw-r--r--include/linux/rpmsg.h6
-rw-r--r--include/linux/rtnetlink.h132
-rw-r--r--include/linux/sched.h22
-rw-r--r--include/linux/seq_file.h1
-rw-r--r--include/linux/sfi_acpi.h4
-rw-r--r--include/linux/sh_clk.h21
-rw-r--r--include/linux/sh_dma.h41
-rw-r--r--include/linux/sh_pfc.h65
-rw-r--r--include/linux/shdma-base.h124
-rw-r--r--include/linux/skbuff.h16
-rw-r--r--include/linux/smp.h5
-rw-r--r--include/linux/snmp.h9
-rw-r--r--include/linux/sock_diag.h2
-rw-r--r--include/linux/socket.h1
-rw-r--r--include/linux/spi/at86rf230.h31
-rw-r--r--include/linux/ssb/ssb.h1
-rw-r--r--include/linux/suspend.h6
-rw-r--r--include/linux/task_work.h18
-rw-r--r--include/linux/tcp.h36
-rw-r--r--include/linux/tick.h8
-rw-r--r--include/linux/time-armada-370-xp.h18
-rw-r--r--include/linux/tipc_config.h4
-rw-r--r--include/linux/tracehook.h2
-rw-r--r--include/linux/tracepoint.h2
-rw-r--r--include/linux/types.h9
-rw-r--r--include/linux/uhid.h104
-rw-r--r--include/linux/usb/tilegx.h34
-rw-r--r--include/linux/usb/usbnet.h5
-rw-r--r--include/linux/usb_usual.h4
-rw-r--r--include/linux/virtio.h1
-rw-r--r--include/linux/virtio_scsi.h9
165 files changed, 3420 insertions, 1041 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 8760be30b375..cb2a7d1ad47b 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -376,6 +376,7 @@ header-y += tty.h
376header-y += types.h 376header-y += types.h
377header-y += udf_fs_i.h 377header-y += udf_fs_i.h
378header-y += udp.h 378header-y += udp.h
379header-y += uhid.h
379header-y += uinput.h 380header-y += uinput.h
380header-y += uio.h 381header-y += uio.h
381header-y += ultrasound.h 382header-y += ultrasound.h
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
deleted file mode 100644
index 0260c3e79fdd..000000000000
--- a/include/linux/ac97_codec.h
+++ /dev/null
@@ -1,362 +0,0 @@
1#ifndef _AC97_CODEC_H_
2#define _AC97_CODEC_H_
3
4#include <linux/types.h>
5#include <linux/soundcard.h>
6
7/* AC97 1.0 */
8#define AC97_RESET 0x0000 //
9#define AC97_MASTER_VOL_STEREO 0x0002 // Line Out
10#define AC97_HEADPHONE_VOL 0x0004 //
11#define AC97_MASTER_VOL_MONO 0x0006 // TAD Output
12#define AC97_MASTER_TONE 0x0008 //
13#define AC97_PCBEEP_VOL 0x000a // none
14#define AC97_PHONE_VOL 0x000c // TAD Input (mono)
15#define AC97_MIC_VOL 0x000e // MIC Input (mono)
16#define AC97_LINEIN_VOL 0x0010 // Line Input (stereo)
17#define AC97_CD_VOL 0x0012 // CD Input (stereo)
18#define AC97_VIDEO_VOL 0x0014 // none
19#define AC97_AUX_VOL 0x0016 // Aux Input (stereo)
20#define AC97_PCMOUT_VOL 0x0018 // Wave Output (stereo)
21#define AC97_RECORD_SELECT 0x001a //
22#define AC97_RECORD_GAIN 0x001c
23#define AC97_RECORD_GAIN_MIC 0x001e
24#define AC97_GENERAL_PURPOSE 0x0020
25#define AC97_3D_CONTROL 0x0022
26#define AC97_MODEM_RATE 0x0024
27#define AC97_POWER_CONTROL 0x0026
28
29/* AC'97 2.0 */
30#define AC97_EXTENDED_ID 0x0028 /* Extended Audio ID */
31#define AC97_EXTENDED_STATUS 0x002A /* Extended Audio Status */
32#define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */
33#define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */
34#define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */
35#define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR ADC Rate */
36#define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */
37#define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */
38#define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */
39#define AC97_RESERVED_3A 0x003A /* Reserved in AC '97 < 2.2 */
40
41/* AC'97 2.2 */
42#define AC97_SPDIF_CONTROL 0x003A /* S/PDIF Control */
43
44/* range 0x3c-0x58 - MODEM */
45#define AC97_EXTENDED_MODEM_ID 0x003C
46#define AC97_EXTEND_MODEM_STAT 0x003E
47#define AC97_LINE1_RATE 0x0040
48#define AC97_LINE2_RATE 0x0042
49#define AC97_HANDSET_RATE 0x0044
50#define AC97_LINE1_LEVEL 0x0046
51#define AC97_LINE2_LEVEL 0x0048
52#define AC97_HANDSET_LEVEL 0x004A
53#define AC97_GPIO_CONFIG 0x004C
54#define AC97_GPIO_POLARITY 0x004E
55#define AC97_GPIO_STICKY 0x0050
56#define AC97_GPIO_WAKE_UP 0x0052
57#define AC97_GPIO_STATUS 0x0054
58#define AC97_MISC_MODEM_STAT 0x0056
59#define AC97_RESERVED_58 0x0058
60
61/* registers 0x005a - 0x007a are vendor reserved */
62
63#define AC97_VENDOR_ID1 0x007c
64#define AC97_VENDOR_ID2 0x007e
65
66/* volume control bit defines */
67#define AC97_MUTE 0x8000
68#define AC97_MICBOOST 0x0040
69#define AC97_LEFTVOL 0x3f00
70#define AC97_RIGHTVOL 0x003f
71
72/* record mux defines */
73#define AC97_RECMUX_MIC 0x0000
74#define AC97_RECMUX_CD 0x0101
75#define AC97_RECMUX_VIDEO 0x0202
76#define AC97_RECMUX_AUX 0x0303
77#define AC97_RECMUX_LINE 0x0404
78#define AC97_RECMUX_STEREO_MIX 0x0505
79#define AC97_RECMUX_MONO_MIX 0x0606
80#define AC97_RECMUX_PHONE 0x0707
81
82/* general purpose register bit defines */
83#define AC97_GP_LPBK 0x0080 /* Loopback mode */
84#define AC97_GP_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 */
85#define AC97_GP_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic */
86#define AC97_GP_RLBK 0x0400 /* Remote Loopback - Modem line codec */
87#define AC97_GP_LLBK 0x0800 /* Local Loopback - Modem Line codec */
88#define AC97_GP_LD 0x1000 /* Loudness 1=on */
89#define AC97_GP_3D 0x2000 /* 3D Enhancement 1=on */
90#define AC97_GP_ST 0x4000 /* Stereo Enhancement 1=on */
91#define AC97_GP_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */
92
93/* extended audio status and control bit defines */
94#define AC97_EA_VRA 0x0001 /* Variable bit rate enable bit */
95#define AC97_EA_DRA 0x0002 /* Double-rate audio enable bit */
96#define AC97_EA_SPDIF 0x0004 /* S/PDIF Enable bit */
97#define AC97_EA_VRM 0x0008 /* Variable bit rate for MIC enable bit */
98#define AC97_EA_CDAC 0x0040 /* PCM Center DAC is ready (Read only) */
99#define AC97_EA_SDAC 0x0040 /* PCM Surround DACs are ready (Read only) */
100#define AC97_EA_LDAC 0x0080 /* PCM LFE DAC is ready (Read only) */
101#define AC97_EA_MDAC 0x0100 /* MIC ADC is ready (Read only) */
102#define AC97_EA_SPCV 0x0400 /* S/PDIF configuration valid (Read only) */
103#define AC97_EA_PRI 0x0800 /* Turns the PCM Center DAC off */
104#define AC97_EA_PRJ 0x1000 /* Turns the PCM Surround DACs off */
105#define AC97_EA_PRK 0x2000 /* Turns the PCM LFE DAC off */
106#define AC97_EA_PRL 0x4000 /* Turns the MIC ADC off */
107#define AC97_EA_SLOT_MASK 0xffcf /* Mask for slot assignment bits */
108#define AC97_EA_SPSA_3_4 0x0000 /* Slot assigned to 3 & 4 */
109#define AC97_EA_SPSA_7_8 0x0010 /* Slot assigned to 7 & 8 */
110#define AC97_EA_SPSA_6_9 0x0020 /* Slot assigned to 6 & 9 */
111#define AC97_EA_SPSA_10_11 0x0030 /* Slot assigned to 10 & 11 */
112
113/* S/PDIF control bit defines */
114#define AC97_SC_PRO 0x0001 /* Professional status */
115#define AC97_SC_NAUDIO 0x0002 /* Non audio stream */
116#define AC97_SC_COPY 0x0004 /* Copyright status */
117#define AC97_SC_PRE 0x0008 /* Preemphasis status */
118#define AC97_SC_CC_MASK 0x07f0 /* Category Code mask */
119#define AC97_SC_L 0x0800 /* Generation Level status */
120#define AC97_SC_SPSR_MASK 0xcfff /* S/PDIF Sample Rate bits */
121#define AC97_SC_SPSR_44K 0x0000 /* Use 44.1kHz Sample rate */
122#define AC97_SC_SPSR_48K 0x2000 /* Use 48kHz Sample rate */
123#define AC97_SC_SPSR_32K 0x3000 /* Use 32kHz Sample rate */
124#define AC97_SC_DRS 0x4000 /* Double Rate S/PDIF */
125#define AC97_SC_V 0x8000 /* Validity status */
126
127/* powerdown control and status bit defines */
128
129/* status */
130#define AC97_PWR_MDM 0x0010 /* Modem section ready */
131#define AC97_PWR_REF 0x0008 /* Vref nominal */
132#define AC97_PWR_ANL 0x0004 /* Analog section ready */
133#define AC97_PWR_DAC 0x0002 /* DAC section ready */
134#define AC97_PWR_ADC 0x0001 /* ADC section ready */
135
136/* control */
137#define AC97_PWR_PR0 0x0100 /* ADC and Mux powerdown */
138#define AC97_PWR_PR1 0x0200 /* DAC powerdown */
139#define AC97_PWR_PR2 0x0400 /* Output mixer powerdown (Vref on) */
140#define AC97_PWR_PR3 0x0800 /* Output mixer powerdown (Vref off) */
141#define AC97_PWR_PR4 0x1000 /* AC-link powerdown */
142#define AC97_PWR_PR5 0x2000 /* Internal Clk disable */
143#define AC97_PWR_PR6 0x4000 /* HP amp powerdown */
144#define AC97_PWR_PR7 0x8000 /* Modem off - if supported */
145
146/* extended audio ID register bit defines */
147#define AC97_EXTID_VRA 0x0001
148#define AC97_EXTID_DRA 0x0002
149#define AC97_EXTID_SPDIF 0x0004
150#define AC97_EXTID_VRM 0x0008
151#define AC97_EXTID_DSA0 0x0010
152#define AC97_EXTID_DSA1 0x0020
153#define AC97_EXTID_CDAC 0x0040
154#define AC97_EXTID_SDAC 0x0080
155#define AC97_EXTID_LDAC 0x0100
156#define AC97_EXTID_AMAP 0x0200
157#define AC97_EXTID_REV0 0x0400
158#define AC97_EXTID_REV1 0x0800
159#define AC97_EXTID_ID0 0x4000
160#define AC97_EXTID_ID1 0x8000
161
162/* extended status register bit defines */
163#define AC97_EXTSTAT_VRA 0x0001
164#define AC97_EXTSTAT_DRA 0x0002
165#define AC97_EXTSTAT_SPDIF 0x0004
166#define AC97_EXTSTAT_VRM 0x0008
167#define AC97_EXTSTAT_SPSA0 0x0010
168#define AC97_EXTSTAT_SPSA1 0x0020
169#define AC97_EXTSTAT_CDAC 0x0040
170#define AC97_EXTSTAT_SDAC 0x0080
171#define AC97_EXTSTAT_LDAC 0x0100
172#define AC97_EXTSTAT_MADC 0x0200
173#define AC97_EXTSTAT_SPCV 0x0400
174#define AC97_EXTSTAT_PRI 0x0800
175#define AC97_EXTSTAT_PRJ 0x1000
176#define AC97_EXTSTAT_PRK 0x2000
177#define AC97_EXTSTAT_PRL 0x4000
178
179/* extended audio ID register bit defines */
180#define AC97_EXTID_VRA 0x0001
181#define AC97_EXTID_DRA 0x0002
182#define AC97_EXTID_SPDIF 0x0004
183#define AC97_EXTID_VRM 0x0008
184#define AC97_EXTID_DSA0 0x0010
185#define AC97_EXTID_DSA1 0x0020
186#define AC97_EXTID_CDAC 0x0040
187#define AC97_EXTID_SDAC 0x0080
188#define AC97_EXTID_LDAC 0x0100
189#define AC97_EXTID_AMAP 0x0200
190#define AC97_EXTID_REV0 0x0400
191#define AC97_EXTID_REV1 0x0800
192#define AC97_EXTID_ID0 0x4000
193#define AC97_EXTID_ID1 0x8000
194
195/* extended status register bit defines */
196#define AC97_EXTSTAT_VRA 0x0001
197#define AC97_EXTSTAT_DRA 0x0002
198#define AC97_EXTSTAT_SPDIF 0x0004
199#define AC97_EXTSTAT_VRM 0x0008
200#define AC97_EXTSTAT_SPSA0 0x0010
201#define AC97_EXTSTAT_SPSA1 0x0020
202#define AC97_EXTSTAT_CDAC 0x0040
203#define AC97_EXTSTAT_SDAC 0x0080
204#define AC97_EXTSTAT_LDAC 0x0100
205#define AC97_EXTSTAT_MADC 0x0200
206#define AC97_EXTSTAT_SPCV 0x0400
207#define AC97_EXTSTAT_PRI 0x0800
208#define AC97_EXTSTAT_PRJ 0x1000
209#define AC97_EXTSTAT_PRK 0x2000
210#define AC97_EXTSTAT_PRL 0x4000
211
212/* useful power states */
213#define AC97_PWR_D0 0x0000 /* everything on */
214#define AC97_PWR_D1 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR4
215#define AC97_PWR_D2 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4
216#define AC97_PWR_D3 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4
217#define AC97_PWR_ANLOFF AC97_PWR_PR2|AC97_PWR_PR3 /* analog section off */
218
219/* Total number of defined registers. */
220#define AC97_REG_CNT 64
221
222
223/* OSS interface to the ac97s.. */
224#define AC97_STEREO_MASK (SOUND_MASK_VOLUME|SOUND_MASK_PCM|\
225 SOUND_MASK_LINE|SOUND_MASK_CD|\
226 SOUND_MASK_ALTPCM|SOUND_MASK_IGAIN|\
227 SOUND_MASK_LINE1|SOUND_MASK_VIDEO)
228
229#define AC97_SUPPORTED_MASK (AC97_STEREO_MASK | \
230 SOUND_MASK_BASS|SOUND_MASK_TREBLE|\
231 SOUND_MASK_SPEAKER|SOUND_MASK_MIC|\
232 SOUND_MASK_PHONEIN|SOUND_MASK_PHONEOUT)
233
234#define AC97_RECORD_MASK (SOUND_MASK_MIC|\
235 SOUND_MASK_CD|SOUND_MASK_IGAIN|SOUND_MASK_VIDEO|\
236 SOUND_MASK_LINE1| SOUND_MASK_LINE|\
237 SOUND_MASK_PHONEIN)
238
239/* original check is not good enough in case FOO is greater than
240 * SOUND_MIXER_NRDEVICES because the supported_mixers has exactly
241 * SOUND_MIXER_NRDEVICES elements.
242 * before matching the given mixer against the bitmask in supported_mixers we
243 * check if mixer number exceeds maximum allowed size which is as mentioned
244 * above SOUND_MIXER_NRDEVICES */
245#define supported_mixer(CODEC,FOO) ((FOO >= 0) && \
246 (FOO < SOUND_MIXER_NRDEVICES) && \
247 (CODEC)->supported_mixers & (1<<FOO) )
248
249struct ac97_codec {
250 /* Linked list of codecs */
251 struct list_head list;
252
253 /* AC97 controller connected with */
254 void *private_data;
255
256 char *name;
257 int id;
258 int dev_mixer;
259 int type;
260 u32 model;
261
262 unsigned int modem:1;
263
264 struct ac97_ops *codec_ops;
265
266 /* controller specific lower leverl ac97 accessing routines.
267 must be re-entrant safe */
268 u16 (*codec_read) (struct ac97_codec *codec, u8 reg);
269 void (*codec_write) (struct ac97_codec *codec, u8 reg, u16 val);
270
271 /* Wait for codec-ready. Ok to sleep here. */
272 void (*codec_wait) (struct ac97_codec *codec);
273
274 /* callback used by helper drivers for interesting ac97 setups */
275 void (*codec_unregister) (struct ac97_codec *codec);
276
277 struct ac97_driver *driver;
278 void *driver_private; /* Private data for the driver */
279
280 spinlock_t lock;
281
282 /* OSS mixer masks */
283 int modcnt;
284 int supported_mixers;
285 int stereo_mixers;
286 int record_sources;
287
288 /* Property flags */
289 int flags;
290
291 int bit_resolution;
292
293 /* OSS mixer interface */
294 int (*read_mixer) (struct ac97_codec *codec, int oss_channel);
295 void (*write_mixer)(struct ac97_codec *codec, int oss_channel,
296 unsigned int left, unsigned int right);
297 int (*recmask_io) (struct ac97_codec *codec, int rw, int mask);
298 int (*mixer_ioctl)(struct ac97_codec *codec, unsigned int cmd, unsigned long arg);
299
300 /* saved OSS mixer states */
301 unsigned int mixer_state[SOUND_MIXER_NRDEVICES];
302
303 /* Software Modem interface */
304 int (*modem_ioctl)(struct ac97_codec *codec, unsigned int cmd, unsigned long arg);
305};
306
307/*
308 * Operation structures for each known AC97 chip
309 */
310
311struct ac97_ops
312{
313 /* Initialise */
314 int (*init)(struct ac97_codec *c);
315 /* Amplifier control */
316 int (*amplifier)(struct ac97_codec *codec, int on);
317 /* Digital mode control */
318 int (*digital)(struct ac97_codec *codec, int slots, int rate, int mode);
319#define AUDIO_DIGITAL 0x8000
320#define AUDIO_PRO 0x4000
321#define AUDIO_DRS 0x2000
322#define AUDIO_CCMASK 0x003F
323
324#define AC97_DELUDED_MODEM 1 /* Audio codec reports its a modem */
325#define AC97_NO_PCM_VOLUME 2 /* Volume control is missing */
326#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */
327};
328
329extern int ac97_probe_codec(struct ac97_codec *);
330
331extern struct ac97_codec *ac97_alloc_codec(void);
332extern void ac97_release_codec(struct ac97_codec *codec);
333
334struct ac97_driver {
335 struct list_head list;
336 char *name;
337 u32 codec_id;
338 u32 codec_mask;
339 int (*probe) (struct ac97_codec *codec, struct ac97_driver *driver);
340 void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver);
341};
342
343/* quirk types */
344enum {
345 AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */
346 AC97_TUNE_NONE = 0, /* nothing extra to do */
347 AC97_TUNE_HP_ONLY, /* headphone (true line-out) control as master only */
348 AC97_TUNE_SWAP_HP, /* swap headphone and master controls */
349 AC97_TUNE_SWAP_SURROUND, /* swap master and surround controls */
350 AC97_TUNE_AD_SHARING, /* for AD1985, turn on OMS bit and use headphone */
351 AC97_TUNE_ALC_JACK, /* for Realtek, enable JACK detection */
352};
353
354struct ac97_quirk {
355 unsigned short vendor; /* PCI vendor id */
356 unsigned short device; /* PCI device id */
357 unsigned short mask; /* device id bit mask, 0 = accept all */
358 const char *name; /* name shown as info */
359 int type; /* quirk type above */
360};
361
362#endif /* _AC97_CODEC_H_ */
diff --git a/include/linux/async.h b/include/linux/async.h
index 68a9530196f2..7a24fe9b44b4 100644
--- a/include/linux/async.h
+++ b/include/linux/async.h
@@ -9,19 +9,47 @@
9 * as published by the Free Software Foundation; version 2 9 * as published by the Free Software Foundation; version 2
10 * of the License. 10 * of the License.
11 */ 11 */
12#ifndef __ASYNC_H__
13#define __ASYNC_H__
12 14
13#include <linux/types.h> 15#include <linux/types.h>
14#include <linux/list.h> 16#include <linux/list.h>
15 17
16typedef u64 async_cookie_t; 18typedef u64 async_cookie_t;
17typedef void (async_func_ptr) (void *data, async_cookie_t cookie); 19typedef void (async_func_ptr) (void *data, async_cookie_t cookie);
20struct async_domain {
21 struct list_head node;
22 struct list_head domain;
23 int count;
24 unsigned registered:1;
25};
26
27/*
28 * domain participates in global async_synchronize_full
29 */
30#define ASYNC_DOMAIN(_name) \
31 struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \
32 .domain = LIST_HEAD_INIT(_name.domain), \
33 .count = 0, \
34 .registered = 1 }
35
36/*
37 * domain is free to go out of scope as soon as all pending work is
38 * complete, this domain does not participate in async_synchronize_full
39 */
40#define ASYNC_DOMAIN_EXCLUSIVE(_name) \
41 struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \
42 .domain = LIST_HEAD_INIT(_name.domain), \
43 .count = 0, \
44 .registered = 0 }
18 45
19extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data); 46extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data);
20extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data, 47extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data,
21 struct list_head *list); 48 struct async_domain *domain);
49void async_unregister_domain(struct async_domain *domain);
22extern void async_synchronize_full(void); 50extern void async_synchronize_full(void);
23extern void async_synchronize_full_domain(struct list_head *list); 51extern void async_synchronize_full_domain(struct async_domain *domain);
24extern void async_synchronize_cookie(async_cookie_t cookie); 52extern void async_synchronize_cookie(async_cookie_t cookie);
25extern void async_synchronize_cookie_domain(async_cookie_t cookie, 53extern void async_synchronize_cookie_domain(async_cookie_t cookie,
26 struct list_head *list); 54 struct async_domain *domain);
27 55#endif
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 8deaf6d050c3..1954a4e305a3 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -7,6 +7,7 @@
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/bcma/bcma_driver_mips.h> 9#include <linux/bcma/bcma_driver_mips.h>
10#include <linux/bcma/bcma_driver_gmac_cmn.h>
10#include <linux/ssb/ssb.h> /* SPROM sharing */ 11#include <linux/ssb/ssb.h> /* SPROM sharing */
11 12
12#include "bcma_regs.h" 13#include "bcma_regs.h"
@@ -70,6 +71,13 @@ struct bcma_host_ops {
70 71
71/* Core-ID values. */ 72/* Core-ID values. */
72#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ 73#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */
74#define BCMA_CORE_4706_CHIPCOMMON 0x500
75#define BCMA_CORE_4706_SOC_RAM 0x50E
76#define BCMA_CORE_4706_MAC_GBIT 0x52D
77#define BCMA_CORE_AMEMC 0x52E /* DDR1/2 memory controller core */
78#define BCMA_CORE_ALTA 0x534 /* I2S core */
79#define BCMA_CORE_4706_MAC_GBIT_COMMON 0x5DC
80#define BCMA_CORE_DDR23_PHY 0x5DD
73#define BCMA_CORE_INVALID 0x700 81#define BCMA_CORE_INVALID 0x700
74#define BCMA_CORE_CHIPCOMMON 0x800 82#define BCMA_CORE_CHIPCOMMON 0x800
75#define BCMA_CORE_ILINE20 0x801 83#define BCMA_CORE_ILINE20 0x801
@@ -130,6 +138,36 @@ struct bcma_host_ops {
130 138
131#define BCMA_MAX_NR_CORES 16 139#define BCMA_MAX_NR_CORES 16
132 140
141/* Chip IDs of PCIe devices */
142#define BCMA_CHIP_ID_BCM4313 0x4313
143#define BCMA_CHIP_ID_BCM43224 43224
144#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8
145#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa
146#define BCMA_CHIP_ID_BCM43225 43225
147#define BCMA_CHIP_ID_BCM43227 43227
148#define BCMA_CHIP_ID_BCM43228 43228
149#define BCMA_CHIP_ID_BCM43421 43421
150#define BCMA_CHIP_ID_BCM43428 43428
151#define BCMA_CHIP_ID_BCM43431 43431
152#define BCMA_CHIP_ID_BCM43460 43460
153#define BCMA_CHIP_ID_BCM4331 0x4331
154#define BCMA_CHIP_ID_BCM6362 0x6362
155#define BCMA_CHIP_ID_BCM4360 0x4360
156#define BCMA_CHIP_ID_BCM4352 0x4352
157
158/* Chip IDs of SoCs */
159#define BCMA_CHIP_ID_BCM4706 0x5300
160#define BCMA_CHIP_ID_BCM4716 0x4716
161#define BCMA_PKG_ID_BCM4716 8
162#define BCMA_PKG_ID_BCM4717 9
163#define BCMA_PKG_ID_BCM4718 10
164#define BCMA_CHIP_ID_BCM47162 47162
165#define BCMA_CHIP_ID_BCM4748 0x4748
166#define BCMA_CHIP_ID_BCM4749 0x4749
167#define BCMA_CHIP_ID_BCM5356 0x5356
168#define BCMA_CHIP_ID_BCM5357 0x5357
169#define BCMA_CHIP_ID_BCM53572 53572
170
133struct bcma_device { 171struct bcma_device {
134 struct bcma_bus *bus; 172 struct bcma_bus *bus;
135 struct bcma_device_id id; 173 struct bcma_device_id id;
@@ -215,6 +253,7 @@ struct bcma_bus {
215 struct bcma_drv_cc drv_cc; 253 struct bcma_drv_cc drv_cc;
216 struct bcma_drv_pci drv_pci; 254 struct bcma_drv_pci drv_pci;
217 struct bcma_drv_mips drv_mips; 255 struct bcma_drv_mips drv_mips;
256 struct bcma_drv_gmac_cmn drv_gmac_cmn;
218 257
219 /* We decided to share SPROM struct with SSB as long as we do not need 258 /* We decided to share SPROM struct with SSB as long as we do not need
220 * any hacks for BCMA. This simplifies drivers code. */ 259 * any hacks for BCMA. This simplifies drivers code. */
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 8bbfe31fbac8..3c80885fa829 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -24,7 +24,7 @@
24#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ 24#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */
25#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ 25#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */
26#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ 26#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */
27#define BCMA_CC_FLASHT_NFLASH 0x00000200 27#define BCMA_CC_FLASHT_NFLASH 0x00000200 /* NAND flash */
28#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ 28#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */
29#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ 29#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */
30#define BCMA_PLLTYPE_NONE 0x00000000 30#define BCMA_PLLTYPE_NONE 0x00000000
@@ -45,6 +45,7 @@
45#define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ 45#define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */
46#define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ 46#define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */
47#define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */ 47#define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */
48#define BCMA_CC_CAP_NFLASH 0x80000000 /* NAND flash present (rev >= 35 or BCM4706?) */
48#define BCMA_CC_CORECTL 0x0008 49#define BCMA_CC_CORECTL 0x0008
49#define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ 50#define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */
50#define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ 51#define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */
@@ -88,6 +89,11 @@
88#define BCMA_CC_CHIPST_4313_OTP_PRESENT 2 89#define BCMA_CC_CHIPST_4313_OTP_PRESENT 2
89#define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2 90#define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2
90#define BCMA_CC_CHIPST_4331_OTP_PRESENT 4 91#define BCMA_CC_CHIPST_4331_OTP_PRESENT 4
92#define BCMA_CC_CHIPST_4706_PKG_OPTION BIT(0) /* 0: full-featured package 1: low-cost package */
93#define BCMA_CC_CHIPST_4706_SFLASH_PRESENT BIT(1) /* 0: parallel, 1: serial flash is present */
94#define BCMA_CC_CHIPST_4706_SFLASH_TYPE BIT(2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */
95#define BCMA_CC_CHIPST_4706_MIPS_BENDIAN BIT(3) /* 0: little, 1: big endian */
96#define BCMA_CC_CHIPST_4706_PCIE1_DISABLE BIT(5) /* PCIE1 enable strap pin */
91#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ 97#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */
92#define BCMA_CC_JCMD_START 0x80000000 98#define BCMA_CC_JCMD_START 0x80000000
93#define BCMA_CC_JCMD_BUSY 0x80000000 99#define BCMA_CC_JCMD_BUSY 0x80000000
@@ -117,10 +123,58 @@
117#define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */ 123#define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */
118#define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */ 124#define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */
119#define BCMA_CC_FLASHCTL 0x0040 125#define BCMA_CC_FLASHCTL 0x0040
126/* Start/busy bit in flashcontrol */
127#define BCMA_CC_FLASHCTL_OPCODE 0x000000ff
128#define BCMA_CC_FLASHCTL_ACTION 0x00000700
129#define BCMA_CC_FLASHCTL_CS_ACTIVE 0x00001000 /* Chip Select Active, rev >= 20 */
120#define BCMA_CC_FLASHCTL_START 0x80000000 130#define BCMA_CC_FLASHCTL_START 0x80000000
121#define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START 131#define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START
132/* Flashcontrol action + opcodes for ST flashes */
133#define BCMA_CC_FLASHCTL_ST_WREN 0x0006 /* Write Enable */
134#define BCMA_CC_FLASHCTL_ST_WRDIS 0x0004 /* Write Disable */
135#define BCMA_CC_FLASHCTL_ST_RDSR 0x0105 /* Read Status Register */
136#define BCMA_CC_FLASHCTL_ST_WRSR 0x0101 /* Write Status Register */
137#define BCMA_CC_FLASHCTL_ST_READ 0x0303 /* Read Data Bytes */
138#define BCMA_CC_FLASHCTL_ST_PP 0x0302 /* Page Program */
139#define BCMA_CC_FLASHCTL_ST_SE 0x02d8 /* Sector Erase */
140#define BCMA_CC_FLASHCTL_ST_BE 0x00c7 /* Bulk Erase */
141#define BCMA_CC_FLASHCTL_ST_DP 0x00b9 /* Deep Power-down */
142#define BCMA_CC_FLASHCTL_ST_RES 0x03ab /* Read Electronic Signature */
143#define BCMA_CC_FLASHCTL_ST_CSA 0x1000 /* Keep chip select asserted */
144#define BCMA_CC_FLASHCTL_ST_SSE 0x0220 /* Sub-sector Erase */
145/* Flashcontrol action + opcodes for Atmel flashes */
146#define BCMA_CC_FLASHCTL_AT_READ 0x07e8
147#define BCMA_CC_FLASHCTL_AT_PAGE_READ 0x07d2
148#define BCMA_CC_FLASHCTL_AT_STATUS 0x01d7
149#define BCMA_CC_FLASHCTL_AT_BUF1_WRITE 0x0384
150#define BCMA_CC_FLASHCTL_AT_BUF2_WRITE 0x0387
151#define BCMA_CC_FLASHCTL_AT_BUF1_ERASE_PROGRAM 0x0283
152#define BCMA_CC_FLASHCTL_AT_BUF2_ERASE_PROGRAM 0x0286
153#define BCMA_CC_FLASHCTL_AT_BUF1_PROGRAM 0x0288
154#define BCMA_CC_FLASHCTL_AT_BUF2_PROGRAM 0x0289
155#define BCMA_CC_FLASHCTL_AT_PAGE_ERASE 0x0281
156#define BCMA_CC_FLASHCTL_AT_BLOCK_ERASE 0x0250
157#define BCMA_CC_FLASHCTL_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382
158#define BCMA_CC_FLASHCTL_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385
159#define BCMA_CC_FLASHCTL_AT_BUF1_LOAD 0x0253
160#define BCMA_CC_FLASHCTL_AT_BUF2_LOAD 0x0255
161#define BCMA_CC_FLASHCTL_AT_BUF1_COMPARE 0x0260
162#define BCMA_CC_FLASHCTL_AT_BUF2_COMPARE 0x0261
163#define BCMA_CC_FLASHCTL_AT_BUF1_REPROGRAM 0x0258
164#define BCMA_CC_FLASHCTL_AT_BUF2_REPROGRAM 0x0259
122#define BCMA_CC_FLASHADDR 0x0044 165#define BCMA_CC_FLASHADDR 0x0044
123#define BCMA_CC_FLASHDATA 0x0048 166#define BCMA_CC_FLASHDATA 0x0048
167/* Status register bits for ST flashes */
168#define BCMA_CC_FLASHDATA_ST_WIP 0x01 /* Write In Progress */
169#define BCMA_CC_FLASHDATA_ST_WEL 0x02 /* Write Enable Latch */
170#define BCMA_CC_FLASHDATA_ST_BP_MASK 0x1c /* Block Protect */
171#define BCMA_CC_FLASHDATA_ST_BP_SHIFT 2
172#define BCMA_CC_FLASHDATA_ST_SRWD 0x80 /* Status Register Write Disable */
173/* Status register bits for Atmel flashes */
174#define BCMA_CC_FLASHDATA_AT_READY 0x80
175#define BCMA_CC_FLASHDATA_AT_MISMATCH 0x40
176#define BCMA_CC_FLASHDATA_AT_ID_MASK 0x38
177#define BCMA_CC_FLASHDATA_AT_ID_SHIFT 3
124#define BCMA_CC_BCAST_ADDR 0x0050 178#define BCMA_CC_BCAST_ADDR 0x0050
125#define BCMA_CC_BCAST_DATA 0x0054 179#define BCMA_CC_BCAST_DATA 0x0054
126#define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */ 180#define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */
@@ -280,6 +334,15 @@
280 334
281/* 4706 PMU */ 335/* 4706 PMU */
282#define BCMA_CC_PMU4706_MAINPLL_PLL0 0 336#define BCMA_CC_PMU4706_MAINPLL_PLL0 0
337#define BCMA_CC_PMU6_4706_PROCPLL_OFF 4 /* The CPU PLL */
338#define BCMA_CC_PMU6_4706_PROC_P2DIV_MASK 0x000f0000
339#define BCMA_CC_PMU6_4706_PROC_P2DIV_SHIFT 16
340#define BCMA_CC_PMU6_4706_PROC_P1DIV_MASK 0x0000f000
341#define BCMA_CC_PMU6_4706_PROC_P1DIV_SHIFT 12
342#define BCMA_CC_PMU6_4706_PROC_NDIV_INT_MASK 0x00000ff8
343#define BCMA_CC_PMU6_4706_PROC_NDIV_INT_SHIFT 3
344#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_MASK 0x00000007
345#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_SHIFT 0
283 346
284/* ALP clock on pre-PMU chips */ 347/* ALP clock on pre-PMU chips */
285#define BCMA_CC_PMU_ALP_CLOCK 20000000 348#define BCMA_CC_PMU_ALP_CLOCK 20000000
@@ -308,6 +371,19 @@
308#define BCMA_CC_PPL_PCHI_OFF 5 371#define BCMA_CC_PPL_PCHI_OFF 5
309#define BCMA_CC_PPL_PCHI_MASK 0x0000003f 372#define BCMA_CC_PPL_PCHI_MASK 0x0000003f
310 373
374#define BCMA_CC_PMU_PLL_CTL0 0
375#define BCMA_CC_PMU_PLL_CTL1 1
376#define BCMA_CC_PMU_PLL_CTL2 2
377#define BCMA_CC_PMU_PLL_CTL3 3
378#define BCMA_CC_PMU_PLL_CTL4 4
379#define BCMA_CC_PMU_PLL_CTL5 5
380
381#define BCMA_CC_PMU1_PLL0_PC0_P1DIV_MASK 0x00f00000
382#define BCMA_CC_PMU1_PLL0_PC0_P1DIV_SHIFT 20
383
384#define BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_MASK 0x1ff00000
385#define BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_SHIFT 20
386
311/* BCM4331 ChipControl numbers. */ 387/* BCM4331 ChipControl numbers. */
312#define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */ 388#define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */
313#define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */ 389#define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */
@@ -321,9 +397,18 @@
321#define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */ 397#define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */
322#define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */ 398#define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */
323#define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */ 399#define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */
400#define BCMA_CHIPCTL_4331_EXTPA_EN2 BIT(12) /* 0 ext pa disable, 1 ext pa enabled */
324#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */ 401#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */
325#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */ 402#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */
326 403
404/* 43224 chip-specific ChipControl register bits */
405#define BCMA_CCTRL_43224_GPIO_TOGGLE 0x8000 /* gpio[3:0] pins as btcoex or s/w gpio */
406#define BCMA_CCTRL_43224A0_12MA_LED_DRIVE 0x00F000F0 /* 12 mA drive strength */
407#define BCMA_CCTRL_43224B0_12MA_LED_DRIVE 0xF0 /* 12 mA drive strength for later 43224s */
408
409/* 4313 Chip specific ChipControl register bits */
410#define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */
411
327/* Data for the PMU, if available. 412/* Data for the PMU, if available.
328 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 413 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
329 */ 414 */
@@ -411,5 +496,6 @@ extern void bcma_chipco_chipctl_maskset(struct bcma_drv_cc *cc,
411 u32 offset, u32 mask, u32 set); 496 u32 offset, u32 mask, u32 set);
412extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc, 497extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc,
413 u32 offset, u32 mask, u32 set); 498 u32 offset, u32 mask, u32 set);
499extern void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid);
414 500
415#endif /* LINUX_BCMA_DRIVER_CC_H_ */ 501#endif /* LINUX_BCMA_DRIVER_CC_H_ */
diff --git a/include/linux/bcma/bcma_driver_gmac_cmn.h b/include/linux/bcma/bcma_driver_gmac_cmn.h
new file mode 100644
index 000000000000..def894b83b0d
--- /dev/null
+++ b/include/linux/bcma/bcma_driver_gmac_cmn.h
@@ -0,0 +1,100 @@
1#ifndef LINUX_BCMA_DRIVER_GMAC_CMN_H_
2#define LINUX_BCMA_DRIVER_GMAC_CMN_H_
3
4#include <linux/types.h>
5
6#define BCMA_GMAC_CMN_STAG0 0x000
7#define BCMA_GMAC_CMN_STAG1 0x004
8#define BCMA_GMAC_CMN_STAG2 0x008
9#define BCMA_GMAC_CMN_STAG3 0x00C
10#define BCMA_GMAC_CMN_PARSER_CTL 0x020
11#define BCMA_GMAC_CMN_MIB_MAX_LEN 0x024
12#define BCMA_GMAC_CMN_PHY_ACCESS 0x100
13#define BCMA_GMAC_CMN_PA_DATA_MASK 0x0000ffff
14#define BCMA_GMAC_CMN_PA_ADDR_MASK 0x001f0000
15#define BCMA_GMAC_CMN_PA_ADDR_SHIFT 16
16#define BCMA_GMAC_CMN_PA_REG_MASK 0x1f000000
17#define BCMA_GMAC_CMN_PA_REG_SHIFT 24
18#define BCMA_GMAC_CMN_PA_WRITE 0x20000000
19#define BCMA_GMAC_CMN_PA_START 0x40000000
20#define BCMA_GMAC_CMN_PHY_CTL 0x104
21#define BCMA_GMAC_CMN_PC_EPA_MASK 0x0000001f
22#define BCMA_GMAC_CMN_PC_MCT_MASK 0x007f0000
23#define BCMA_GMAC_CMN_PC_MCT_SHIFT 16
24#define BCMA_GMAC_CMN_PC_MTE 0x00800000
25#define BCMA_GMAC_CMN_GMAC0_RGMII_CTL 0x110
26#define BCMA_GMAC_CMN_CFP_ACCESS 0x200
27#define BCMA_GMAC_CMN_CFP_TCAM_DATA0 0x210
28#define BCMA_GMAC_CMN_CFP_TCAM_DATA1 0x214
29#define BCMA_GMAC_CMN_CFP_TCAM_DATA2 0x218
30#define BCMA_GMAC_CMN_CFP_TCAM_DATA3 0x21C
31#define BCMA_GMAC_CMN_CFP_TCAM_DATA4 0x220
32#define BCMA_GMAC_CMN_CFP_TCAM_DATA5 0x224
33#define BCMA_GMAC_CMN_CFP_TCAM_DATA6 0x228
34#define BCMA_GMAC_CMN_CFP_TCAM_DATA7 0x22C
35#define BCMA_GMAC_CMN_CFP_TCAM_MASK0 0x230
36#define BCMA_GMAC_CMN_CFP_TCAM_MASK1 0x234
37#define BCMA_GMAC_CMN_CFP_TCAM_MASK2 0x238
38#define BCMA_GMAC_CMN_CFP_TCAM_MASK3 0x23C
39#define BCMA_GMAC_CMN_CFP_TCAM_MASK4 0x240
40#define BCMA_GMAC_CMN_CFP_TCAM_MASK5 0x244
41#define BCMA_GMAC_CMN_CFP_TCAM_MASK6 0x248
42#define BCMA_GMAC_CMN_CFP_TCAM_MASK7 0x24C
43#define BCMA_GMAC_CMN_CFP_ACTION_DATA 0x250
44#define BCMA_GMAC_CMN_TCAM_BIST_CTL 0x2A0
45#define BCMA_GMAC_CMN_TCAM_BIST_STATUS 0x2A4
46#define BCMA_GMAC_CMN_TCAM_CMP_STATUS 0x2A8
47#define BCMA_GMAC_CMN_TCAM_DISABLE 0x2AC
48#define BCMA_GMAC_CMN_TCAM_TEST_CTL 0x2F0
49#define BCMA_GMAC_CMN_UDF_0_A3_A0 0x300
50#define BCMA_GMAC_CMN_UDF_0_A7_A4 0x304
51#define BCMA_GMAC_CMN_UDF_0_A8 0x308
52#define BCMA_GMAC_CMN_UDF_1_A3_A0 0x310
53#define BCMA_GMAC_CMN_UDF_1_A7_A4 0x314
54#define BCMA_GMAC_CMN_UDF_1_A8 0x318
55#define BCMA_GMAC_CMN_UDF_2_A3_A0 0x320
56#define BCMA_GMAC_CMN_UDF_2_A7_A4 0x324
57#define BCMA_GMAC_CMN_UDF_2_A8 0x328
58#define BCMA_GMAC_CMN_UDF_0_B3_B0 0x330
59#define BCMA_GMAC_CMN_UDF_0_B7_B4 0x334
60#define BCMA_GMAC_CMN_UDF_0_B8 0x338
61#define BCMA_GMAC_CMN_UDF_1_B3_B0 0x340
62#define BCMA_GMAC_CMN_UDF_1_B7_B4 0x344
63#define BCMA_GMAC_CMN_UDF_1_B8 0x348
64#define BCMA_GMAC_CMN_UDF_2_B3_B0 0x350
65#define BCMA_GMAC_CMN_UDF_2_B7_B4 0x354
66#define BCMA_GMAC_CMN_UDF_2_B8 0x358
67#define BCMA_GMAC_CMN_UDF_0_C3_C0 0x360
68#define BCMA_GMAC_CMN_UDF_0_C7_C4 0x364
69#define BCMA_GMAC_CMN_UDF_0_C8 0x368
70#define BCMA_GMAC_CMN_UDF_1_C3_C0 0x370
71#define BCMA_GMAC_CMN_UDF_1_C7_C4 0x374
72#define BCMA_GMAC_CMN_UDF_1_C8 0x378
73#define BCMA_GMAC_CMN_UDF_2_C3_C0 0x380
74#define BCMA_GMAC_CMN_UDF_2_C7_C4 0x384
75#define BCMA_GMAC_CMN_UDF_2_C8 0x388
76#define BCMA_GMAC_CMN_UDF_0_D3_D0 0x390
77#define BCMA_GMAC_CMN_UDF_0_D7_D4 0x394
78#define BCMA_GMAC_CMN_UDF_0_D11_D8 0x394
79
80struct bcma_drv_gmac_cmn {
81 struct bcma_device *core;
82
83 /* Drivers accessing BCMA_GMAC_CMN_PHY_ACCESS and
84 * BCMA_GMAC_CMN_PHY_CTL need to take that mutex first. */
85 struct mutex phy_mutex;
86};
87
88/* Register access */
89#define gmac_cmn_read16(gc, offset) bcma_read16((gc)->core, offset)
90#define gmac_cmn_read32(gc, offset) bcma_read32((gc)->core, offset)
91#define gmac_cmn_write16(gc, offset, val) bcma_write16((gc)->core, offset, val)
92#define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val)
93
94#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
95extern void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
96#else
97static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { }
98#endif
99
100#endif /* LINUX_BCMA_DRIVER_GMAC_CMN_H_ */
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 324fe08ea3b1..6d6795d46a75 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -91,6 +91,11 @@ extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat,
91 unsigned long size, 91 unsigned long size,
92 unsigned long align, 92 unsigned long align,
93 unsigned long goal); 93 unsigned long goal);
94void *___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
95 unsigned long size,
96 unsigned long align,
97 unsigned long goal,
98 unsigned long limit);
94extern void *__alloc_bootmem_low(unsigned long size, 99extern void *__alloc_bootmem_low(unsigned long size,
95 unsigned long align, 100 unsigned long align,
96 unsigned long goal); 101 unsigned long goal);
diff --git a/include/linux/can.h b/include/linux/can.h
index 9a19bcb3eeaf..018055efc034 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -21,7 +21,7 @@
21/* special address description flags for the CAN_ID */ 21/* special address description flags for the CAN_ID */
22#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ 22#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
23#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ 23#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
24#define CAN_ERR_FLAG 0x20000000U /* error frame */ 24#define CAN_ERR_FLAG 0x20000000U /* error message frame */
25 25
26/* valid bits in CAN ID for frame formats */ 26/* valid bits in CAN ID for frame formats */
27#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ 27#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
@@ -32,32 +32,84 @@
32 * Controller Area Network Identifier structure 32 * Controller Area Network Identifier structure
33 * 33 *
34 * bit 0-28 : CAN identifier (11/29 bit) 34 * bit 0-28 : CAN identifier (11/29 bit)
35 * bit 29 : error frame flag (0 = data frame, 1 = error frame) 35 * bit 29 : error message frame flag (0 = data frame, 1 = error message)
36 * bit 30 : remote transmission request flag (1 = rtr frame) 36 * bit 30 : remote transmission request flag (1 = rtr frame)
37 * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit) 37 * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
38 */ 38 */
39typedef __u32 canid_t; 39typedef __u32 canid_t;
40 40
41#define CAN_SFF_ID_BITS 11
42#define CAN_EFF_ID_BITS 29
43
41/* 44/*
42 * Controller Area Network Error Frame Mask structure 45 * Controller Area Network Error Message Frame Mask structure
43 * 46 *
44 * bit 0-28 : error class mask (see include/linux/can/error.h) 47 * bit 0-28 : error class mask (see include/linux/can/error.h)
45 * bit 29-31 : set to zero 48 * bit 29-31 : set to zero
46 */ 49 */
47typedef __u32 can_err_mask_t; 50typedef __u32 can_err_mask_t;
48 51
52/* CAN payload length and DLC definitions according to ISO 11898-1 */
53#define CAN_MAX_DLC 8
54#define CAN_MAX_DLEN 8
55
56/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
57#define CANFD_MAX_DLC 15
58#define CANFD_MAX_DLEN 64
59
49/** 60/**
50 * struct can_frame - basic CAN frame structure 61 * struct can_frame - basic CAN frame structure
51 * @can_id: the CAN ID of the frame and CAN_*_FLAG flags, see above. 62 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
52 * @can_dlc: the data length field of the CAN frame 63 * @can_dlc: frame payload length in byte (0 .. 8) aka data length code
53 * @data: the CAN frame payload. 64 * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
65 * mapping of the 'data length code' to the real payload length
66 * @data: CAN frame payload (up to 8 byte)
54 */ 67 */
55struct can_frame { 68struct can_frame {
56 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ 69 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
57 __u8 can_dlc; /* data length code: 0 .. 8 */ 70 __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
58 __u8 data[8] __attribute__((aligned(8))); 71 __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
72};
73
74/*
75 * defined bits for canfd_frame.flags
76 *
77 * As the default for CAN FD should be to support the high data rate in the
78 * payload section of the frame (HDR) and to support up to 64 byte in the
79 * data section (EDL) the bits are only set in the non-default case.
80 * Btw. as long as there's no real implementation for CAN FD network driver
81 * these bits are only preliminary.
82 *
83 * RX: NOHDR/NOEDL - info about received CAN FD frame
84 * ESI - bit from originating CAN controller
85 * TX: NOHDR/NOEDL - control per-frame settings if supported by CAN controller
86 * ESI - bit is set by local CAN controller
87 */
88#define CANFD_NOHDR 0x01 /* frame without high data rate */
89#define CANFD_NOEDL 0x02 /* frame without extended data length */
90#define CANFD_ESI 0x04 /* error state indicator */
91
92/**
93 * struct canfd_frame - CAN flexible data rate frame structure
94 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
95 * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
96 * @flags: additional flags for CAN FD
97 * @__res0: reserved / padding
98 * @__res1: reserved / padding
99 * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
100 */
101struct canfd_frame {
102 canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
103 __u8 len; /* frame payload length in byte */
104 __u8 flags; /* additional flags for CAN FD */
105 __u8 __res0; /* reserved / padding */
106 __u8 __res1; /* reserved / padding */
107 __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
59}; 108};
60 109
110#define CAN_MTU (sizeof(struct can_frame))
111#define CANFD_MTU (sizeof(struct canfd_frame))
112
61/* particular protocols of the protocol family PF_CAN */ 113/* particular protocols of the protocol family PF_CAN */
62#define CAN_RAW 1 /* RAW sockets */ 114#define CAN_RAW 1 /* RAW sockets */
63#define CAN_BCM 2 /* Broadcast Manager */ 115#define CAN_BCM 2 /* Broadcast Manager */
@@ -97,7 +149,7 @@ struct sockaddr_can {
97 * <received_can_id> & mask == can_id & mask 149 * <received_can_id> & mask == can_id & mask
98 * 150 *
99 * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can 151 * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
100 * filter for error frames (CAN_ERR_FLAG bit set in mask). 152 * filter for error message frames (CAN_ERR_FLAG bit set in mask).
101 */ 153 */
102struct can_filter { 154struct can_filter {
103 canid_t can_id; 155 canid_t can_id;
diff --git a/include/linux/can/core.h b/include/linux/can/core.h
index 0ccc1cd28b95..78c6c52073ad 100644
--- a/include/linux/can/core.h
+++ b/include/linux/can/core.h
@@ -17,10 +17,10 @@
17#include <linux/skbuff.h> 17#include <linux/skbuff.h>
18#include <linux/netdevice.h> 18#include <linux/netdevice.h>
19 19
20#define CAN_VERSION "20090105" 20#define CAN_VERSION "20120528"
21 21
22/* increment this number each time you change some user-space interface */ 22/* increment this number each time you change some user-space interface */
23#define CAN_ABI_VERSION "8" 23#define CAN_ABI_VERSION "9"
24 24
25#define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION 25#define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION
26 26
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 5d2efe7e3f1b..2b2fc345afca 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -33,7 +33,7 @@ struct can_priv {
33 struct can_device_stats can_stats; 33 struct can_device_stats can_stats;
34 34
35 struct can_bittiming bittiming; 35 struct can_bittiming bittiming;
36 struct can_bittiming_const *bittiming_const; 36 const struct can_bittiming_const *bittiming_const;
37 struct can_clock clock; 37 struct can_clock clock;
38 38
39 enum can_state state; 39 enum can_state state;
@@ -61,23 +61,40 @@ struct can_priv {
61 * To be used in the CAN netdriver receive path to ensure conformance with 61 * To be used in the CAN netdriver receive path to ensure conformance with
62 * ISO 11898-1 Chapter 8.4.2.3 (DLC field) 62 * ISO 11898-1 Chapter 8.4.2.3 (DLC field)
63 */ 63 */
64#define get_can_dlc(i) (min_t(__u8, (i), 8)) 64#define get_can_dlc(i) (min_t(__u8, (i), CAN_MAX_DLC))
65#define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC))
65 66
66/* Drop a given socketbuffer if it does not contain a valid CAN frame. */ 67/* Drop a given socketbuffer if it does not contain a valid CAN frame. */
67static inline int can_dropped_invalid_skb(struct net_device *dev, 68static inline int can_dropped_invalid_skb(struct net_device *dev,
68 struct sk_buff *skb) 69 struct sk_buff *skb)
69{ 70{
70 const struct can_frame *cf = (struct can_frame *)skb->data; 71 const struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
71 72
72 if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) { 73 if (skb->protocol == htons(ETH_P_CAN)) {
73 kfree_skb(skb); 74 if (unlikely(skb->len != CAN_MTU ||
74 dev->stats.tx_dropped++; 75 cfd->len > CAN_MAX_DLEN))
75 return 1; 76 goto inval_skb;
76 } 77 } else if (skb->protocol == htons(ETH_P_CANFD)) {
78 if (unlikely(skb->len != CANFD_MTU ||
79 cfd->len > CANFD_MAX_DLEN))
80 goto inval_skb;
81 } else
82 goto inval_skb;
77 83
78 return 0; 84 return 0;
85
86inval_skb:
87 kfree_skb(skb);
88 dev->stats.tx_dropped++;
89 return 1;
79} 90}
80 91
92/* get data length from can_dlc with sanitized can_dlc */
93u8 can_dlc2len(u8 can_dlc);
94
95/* map the sanitized data length to an appropriate data length code */
96u8 can_len2dlc(u8 len);
97
81struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); 98struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
82void free_candev(struct net_device *dev); 99void free_candev(struct net_device *dev);
83 100
diff --git a/include/linux/can/error.h b/include/linux/can/error.h
index 63e855ea6b84..7b7148bded71 100644
--- a/include/linux/can/error.h
+++ b/include/linux/can/error.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/can/error.h 2 * linux/can/error.h
3 * 3 *
4 * Definitions of the CAN error frame to be filtered and passed to the user. 4 * Definitions of the CAN error messages to be filtered and passed to the user.
5 * 5 *
6 * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> 6 * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
@@ -12,7 +12,7 @@
12#ifndef CAN_ERROR_H 12#ifndef CAN_ERROR_H
13#define CAN_ERROR_H 13#define CAN_ERROR_H
14 14
15#define CAN_ERR_DLC 8 /* dlc for error frames */ 15#define CAN_ERR_DLC 8 /* dlc for error message frames */
16 16
17/* error class (mask) in can_id */ 17/* error class (mask) in can_id */
18#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ 18#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h
index 781f3a3701be..a814062b0719 100644
--- a/include/linux/can/raw.h
+++ b/include/linux/can/raw.h
@@ -23,7 +23,8 @@ enum {
23 CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ 23 CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */
24 CAN_RAW_ERR_FILTER, /* set filter for error frames */ 24 CAN_RAW_ERR_FILTER, /* set filter for error frames */
25 CAN_RAW_LOOPBACK, /* local loopback (default:on) */ 25 CAN_RAW_LOOPBACK, /* local loopback (default:on) */
26 CAN_RAW_RECV_OWN_MSGS /* receive my own msgs (default:off) */ 26 CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */
27 CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
27}; 28};
28 29
29#endif 30#endif
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 68d56effc328..d10b7ed595b1 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -360,11 +360,11 @@ struct cpu_vfs_cap_data {
360 360
361#define CAP_WAKE_ALARM 35 361#define CAP_WAKE_ALARM 35
362 362
363/* Allow preventing system suspends while epoll events are pending */ 363/* Allow preventing system suspends */
364 364
365#define CAP_EPOLLWAKEUP 36 365#define CAP_BLOCK_SUSPEND 36
366 366
367#define CAP_LAST_CAP CAP_EPOLLWAKEUP 367#define CAP_LAST_CAP CAP_BLOCK_SUSPEND
368 368
369#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) 369#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
370 370
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 2521a95fa6d9..44c87e731e9d 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -163,16 +163,8 @@ struct ceph_connection {
163 163
164 /* connection negotiation temps */ 164 /* connection negotiation temps */
165 char in_banner[CEPH_BANNER_MAX_LEN]; 165 char in_banner[CEPH_BANNER_MAX_LEN];
166 union { 166 struct ceph_msg_connect out_connect;
167 struct { /* outgoing connection */ 167 struct ceph_msg_connect_reply in_reply;
168 struct ceph_msg_connect out_connect;
169 struct ceph_msg_connect_reply in_reply;
170 };
171 struct { /* incoming */
172 struct ceph_msg_connect in_connect;
173 struct ceph_msg_connect_reply out_reply;
174 };
175 };
176 struct ceph_entity_addr actual_peer_addr; 168 struct ceph_entity_addr actual_peer_addr;
177 169
178 /* message out temps */ 170 /* message out temps */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index d3f5fba2c159..c90eaa803440 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -500,21 +500,8 @@ struct cgroup_subsys {
500 const char *name; 500 const char *name;
501 501
502 /* 502 /*
503 * Protects sibling/children links of cgroups in this
504 * hierarchy, plus protects which hierarchy (or none) the
505 * subsystem is a part of (i.e. root/sibling). To avoid
506 * potential deadlocks, the following operations should not be
507 * undertaken while holding any hierarchy_mutex:
508 *
509 * - allocating memory
510 * - initiating hotplug events
511 */
512 struct mutex hierarchy_mutex;
513 struct lock_class_key subsys_key;
514
515 /*
516 * Link to parent, and list entry in parent's children. 503 * Link to parent, and list entry in parent's children.
517 * Protected by this->hierarchy_mutex and cgroup_lock() 504 * Protected by cgroup_lock()
518 */ 505 */
519 struct cgroupfs_root *root; 506 struct cgroupfs_root *root;
520 struct list_head sibling; 507 struct list_head sibling;
@@ -602,7 +589,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
602 * the lifetime of cgroup_subsys_state is subsys's matter. 589 * the lifetime of cgroup_subsys_state is subsys's matter.
603 * 590 *
604 * Looking up and scanning function should be called under rcu_read_lock(). 591 * Looking up and scanning function should be called under rcu_read_lock().
605 * Taking cgroup_mutex()/hierarchy_mutex() is not necessary for following calls. 592 * Taking cgroup_mutex is not necessary for following calls.
606 * But the css returned by this routine can be "not populated yet" or "being 593 * But the css returned by this routine can be "not populated yet" or "being
607 * destroyed". The caller should check css and cgroup's status. 594 * destroyed". The caller should check css and cgroup's status.
608 */ 595 */
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index eb3f84bc5325..9c7f5807824b 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -64,7 +64,7 @@ struct clk {
64 .parent_names = _parent_names, \ 64 .parent_names = _parent_names, \
65 .num_parents = ARRAY_SIZE(_parent_names), \ 65 .num_parents = ARRAY_SIZE(_parent_names), \
66 .parents = _parents, \ 66 .parents = _parents, \
67 .flags = _flags, \ 67 .flags = _flags | CLK_IS_BASIC, \
68 } 68 }
69 69
70#define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, \ 70#define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, \
@@ -103,9 +103,9 @@ struct clk {
103 DEFINE_CLK(_name, clk_gate_ops, _flags, \ 103 DEFINE_CLK(_name, clk_gate_ops, _flags, \
104 _name##_parent_names, _name##_parents); 104 _name##_parent_names, _name##_parents);
105 105
106#define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \ 106#define _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
107 _flags, _reg, _shift, _width, \ 107 _flags, _reg, _shift, _width, \
108 _divider_flags, _lock) \ 108 _divider_flags, _table, _lock) \
109 static struct clk _name; \ 109 static struct clk _name; \
110 static const char *_name##_parent_names[] = { \ 110 static const char *_name##_parent_names[] = { \
111 _parent_name, \ 111 _parent_name, \
@@ -121,11 +121,27 @@ struct clk {
121 .shift = _shift, \ 121 .shift = _shift, \
122 .width = _width, \ 122 .width = _width, \
123 .flags = _divider_flags, \ 123 .flags = _divider_flags, \
124 .table = _table, \
124 .lock = _lock, \ 125 .lock = _lock, \
125 }; \ 126 }; \
126 DEFINE_CLK(_name, clk_divider_ops, _flags, \ 127 DEFINE_CLK(_name, clk_divider_ops, _flags, \
127 _name##_parent_names, _name##_parents); 128 _name##_parent_names, _name##_parents);
128 129
130#define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
131 _flags, _reg, _shift, _width, \
132 _divider_flags, _lock) \
133 _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
134 _flags, _reg, _shift, _width, \
135 _divider_flags, NULL, _lock)
136
137#define DEFINE_CLK_DIVIDER_TABLE(_name, _parent_name, \
138 _parent_ptr, _flags, _reg, \
139 _shift, _width, _divider_flags, \
140 _table, _lock) \
141 _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \
142 _flags, _reg, _shift, _width, \
143 _divider_flags, _table, _lock) \
144
129#define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags, \ 145#define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags, \
130 _reg, _shift, _width, \ 146 _reg, _shift, _width, \
131 _mux_flags, _lock) \ 147 _mux_flags, _lock) \
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 4a0b483986c3..77335fac943e 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -25,6 +25,7 @@
25#define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */ 25#define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */
26#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */ 26#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
27#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */ 27#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
28#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
28 29
29struct clk_hw; 30struct clk_hw;
30 31
@@ -143,7 +144,7 @@ struct clk_init_data {
143 */ 144 */
144struct clk_hw { 145struct clk_hw {
145 struct clk *clk; 146 struct clk *clk;
146 struct clk_init_data *init; 147 const struct clk_init_data *init;
147}; 148};
148 149
149/* 150/*
@@ -171,6 +172,8 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
171 const char *parent_name, unsigned long flags, 172 const char *parent_name, unsigned long flags,
172 unsigned long fixed_rate); 173 unsigned long fixed_rate);
173 174
175void of_fixed_clk_setup(struct device_node *np);
176
174/** 177/**
175 * struct clk_gate - gating clock 178 * struct clk_gate - gating clock
176 * 179 *
@@ -203,6 +206,11 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
203 void __iomem *reg, u8 bit_idx, 206 void __iomem *reg, u8 bit_idx,
204 u8 clk_gate_flags, spinlock_t *lock); 207 u8 clk_gate_flags, spinlock_t *lock);
205 208
209struct clk_div_table {
210 unsigned int val;
211 unsigned int div;
212};
213
206/** 214/**
207 * struct clk_divider - adjustable divider clock 215 * struct clk_divider - adjustable divider clock
208 * 216 *
@@ -210,6 +218,7 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
210 * @reg: register containing the divider 218 * @reg: register containing the divider
211 * @shift: shift to the divider bit field 219 * @shift: shift to the divider bit field
212 * @width: width of the divider bit field 220 * @width: width of the divider bit field
221 * @table: array of value/divider pairs, last entry should have div = 0
213 * @lock: register lock 222 * @lock: register lock
214 * 223 *
215 * Clock with an adjustable divider affecting its output frequency. Implements 224 * Clock with an adjustable divider affecting its output frequency. Implements
@@ -229,6 +238,7 @@ struct clk_divider {
229 u8 shift; 238 u8 shift;
230 u8 width; 239 u8 width;
231 u8 flags; 240 u8 flags;
241 const struct clk_div_table *table;
232 spinlock_t *lock; 242 spinlock_t *lock;
233}; 243};
234 244
@@ -240,6 +250,11 @@ struct clk *clk_register_divider(struct device *dev, const char *name,
240 const char *parent_name, unsigned long flags, 250 const char *parent_name, unsigned long flags,
241 void __iomem *reg, u8 shift, u8 width, 251 void __iomem *reg, u8 shift, u8 width,
242 u8 clk_divider_flags, spinlock_t *lock); 252 u8 clk_divider_flags, spinlock_t *lock);
253struct clk *clk_register_divider_table(struct device *dev, const char *name,
254 const char *parent_name, unsigned long flags,
255 void __iomem *reg, u8 shift, u8 width,
256 u8 clk_divider_flags, const struct clk_div_table *table,
257 spinlock_t *lock);
243 258
244/** 259/**
245 * struct clk_mux - multiplexer clock 260 * struct clk_mux - multiplexer clock
@@ -334,5 +349,19 @@ void __clk_unprepare(struct clk *clk);
334void __clk_reparent(struct clk *clk, struct clk *new_parent); 349void __clk_reparent(struct clk *clk, struct clk *new_parent);
335unsigned long __clk_round_rate(struct clk *clk, unsigned long rate); 350unsigned long __clk_round_rate(struct clk *clk, unsigned long rate);
336 351
352struct of_device_id;
353
354typedef void (*of_clk_init_cb_t)(struct device_node *);
355
356int of_clk_add_provider(struct device_node *np,
357 struct clk *(*clk_src_get)(struct of_phandle_args *args,
358 void *data),
359 void *data);
360void of_clk_del_provider(struct device_node *np);
361struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
362 void *data);
363const char *of_clk_get_parent_name(struct device_node *np, int index);
364void of_clk_init(const struct of_device_id *matches);
365
337#endif /* CONFIG_COMMON_CLK */ 366#endif /* CONFIG_COMMON_CLK */
338#endif /* CLK_PROVIDER_H */ 367#endif /* CLK_PROVIDER_H */
diff --git a/include/linux/clk.h b/include/linux/clk.h
index ad5c43e8ae8a..2fd6a4234531 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -12,6 +12,7 @@
12#ifndef __LINUX_CLK_H 12#ifndef __LINUX_CLK_H
13#define __LINUX_CLK_H 13#define __LINUX_CLK_H
14 14
15#include <linux/err.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/notifier.h> 17#include <linux/notifier.h>
17 18
@@ -86,7 +87,7 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
86/** 87/**
87 * clk_get - lookup and obtain a reference to a clock producer. 88 * clk_get - lookup and obtain a reference to a clock producer.
88 * @dev: device for clock "consumer" 89 * @dev: device for clock "consumer"
89 * @id: clock comsumer ID 90 * @id: clock consumer ID
90 * 91 *
91 * Returns a struct clk corresponding to the clock producer, or 92 * Returns a struct clk corresponding to the clock producer, or
92 * valid IS_ERR() condition containing errno. The implementation 93 * valid IS_ERR() condition containing errno. The implementation
@@ -103,7 +104,7 @@ struct clk *clk_get(struct device *dev, const char *id);
103/** 104/**
104 * devm_clk_get - lookup and obtain a managed reference to a clock producer. 105 * devm_clk_get - lookup and obtain a managed reference to a clock producer.
105 * @dev: device for clock "consumer" 106 * @dev: device for clock "consumer"
106 * @id: clock comsumer ID 107 * @id: clock consumer ID
107 * 108 *
108 * Returns a struct clk corresponding to the clock producer, or 109 * Returns a struct clk corresponding to the clock producer, or
109 * valid IS_ERR() condition containing errno. The implementation 110 * valid IS_ERR() condition containing errno. The implementation
@@ -310,4 +311,23 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id);
310int clk_add_alias(const char *alias, const char *alias_dev_name, char *id, 311int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
311 struct device *dev); 312 struct device *dev);
312 313
314struct device_node;
315struct of_phandle_args;
316
317#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
318struct clk *of_clk_get(struct device_node *np, int index);
319struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
320struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
321#else
322static inline struct clk *of_clk_get(struct device_node *np, int index)
323{
324 return ERR_PTR(-ENOENT);
325}
326static inline struct clk *of_clk_get_by_name(struct device_node *np,
327 const char *name)
328{
329 return ERR_PTR(-ENOENT);
330}
331#endif
332
313#endif 333#endif
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 2e9b9ebbeb78..ce7a074f2519 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -73,8 +73,9 @@ enum {
73 /* migration should happen before other stuff but after perf */ 73 /* migration should happen before other stuff but after perf */
74 CPU_PRI_PERF = 20, 74 CPU_PRI_PERF = 20,
75 CPU_PRI_MIGRATION = 10, 75 CPU_PRI_MIGRATION = 10,
76 /* prepare workqueues for other notifiers */ 76 /* bring up workqueues before normal notifiers and down after */
77 CPU_PRI_WORKQUEUE = 5, 77 CPU_PRI_WORKQUEUE_UP = 5,
78 CPU_PRI_WORKQUEUE_DOWN = -5,
78}; 79};
79 80
80#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ 81#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
diff --git a/include/linux/cpu_rmap.h b/include/linux/cpu_rmap.h
index 473771a528c0..ac3bbb5b9502 100644
--- a/include/linux/cpu_rmap.h
+++ b/include/linux/cpu_rmap.h
@@ -1,3 +1,6 @@
1#ifndef __LINUX_CPU_RMAP_H
2#define __LINUX_CPU_RMAP_H
3
1/* 4/*
2 * cpu_rmap.c: CPU affinity reverse-map support 5 * cpu_rmap.c: CPU affinity reverse-map support
3 * Copyright 2011 Solarflare Communications Inc. 6 * Copyright 2011 Solarflare Communications Inc.
@@ -71,3 +74,4 @@ extern void free_irq_cpu_rmap(struct cpu_rmap *rmap);
71extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq); 74extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq);
72 75
73#endif 76#endif
77#endif /* __LINUX_CPU_RMAP_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 6c26a3da0e03..89dcd30ac8ea 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -34,6 +34,7 @@ struct cpuidle_driver;
34struct cpuidle_state_usage { 34struct cpuidle_state_usage {
35 void *driver_data; 35 void *driver_data;
36 36
37 unsigned long long disable;
37 unsigned long long usage; 38 unsigned long long usage;
38 unsigned long long time; /* in US */ 39 unsigned long long time; /* in US */
39}; 40};
@@ -46,7 +47,7 @@ struct cpuidle_state {
46 unsigned int exit_latency; /* in US */ 47 unsigned int exit_latency; /* in US */
47 int power_usage; /* in mW */ 48 int power_usage; /* in mW */
48 unsigned int target_residency; /* in US */ 49 unsigned int target_residency; /* in US */
49 unsigned int disable; 50 bool disabled; /* disabled on all CPUs */
50 51
51 int (*enter) (struct cpuidle_device *dev, 52 int (*enter) (struct cpuidle_device *dev,
52 struct cpuidle_driver *drv, 53 struct cpuidle_driver *drv,
@@ -136,13 +137,17 @@ struct cpuidle_driver {
136extern void disable_cpuidle(void); 137extern void disable_cpuidle(void);
137extern int cpuidle_idle_call(void); 138extern int cpuidle_idle_call(void);
138extern int cpuidle_register_driver(struct cpuidle_driver *drv); 139extern int cpuidle_register_driver(struct cpuidle_driver *drv);
139struct cpuidle_driver *cpuidle_get_driver(void); 140extern struct cpuidle_driver *cpuidle_get_driver(void);
141extern struct cpuidle_driver *cpuidle_driver_ref(void);
142extern void cpuidle_driver_unref(void);
140extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); 143extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
141extern int cpuidle_register_device(struct cpuidle_device *dev); 144extern int cpuidle_register_device(struct cpuidle_device *dev);
142extern void cpuidle_unregister_device(struct cpuidle_device *dev); 145extern void cpuidle_unregister_device(struct cpuidle_device *dev);
143 146
144extern void cpuidle_pause_and_lock(void); 147extern void cpuidle_pause_and_lock(void);
145extern void cpuidle_resume_and_unlock(void); 148extern void cpuidle_resume_and_unlock(void);
149extern void cpuidle_pause(void);
150extern void cpuidle_resume(void);
146extern int cpuidle_enable_device(struct cpuidle_device *dev); 151extern int cpuidle_enable_device(struct cpuidle_device *dev);
147extern void cpuidle_disable_device(struct cpuidle_device *dev); 152extern void cpuidle_disable_device(struct cpuidle_device *dev);
148extern int cpuidle_wrap_enter(struct cpuidle_device *dev, 153extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
@@ -157,6 +162,8 @@ static inline int cpuidle_idle_call(void) { return -ENODEV; }
157static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 162static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
158{return -ENODEV; } 163{return -ENODEV; }
159static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } 164static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
165static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }
166static inline void cpuidle_driver_unref(void) {}
160static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } 167static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
161static inline int cpuidle_register_device(struct cpuidle_device *dev) 168static inline int cpuidle_register_device(struct cpuidle_device *dev)
162{return -ENODEV; } 169{return -ENODEV; }
@@ -164,6 +171,8 @@ static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { }
164 171
165static inline void cpuidle_pause_and_lock(void) { } 172static inline void cpuidle_pause_and_lock(void) { }
166static inline void cpuidle_resume_and_unlock(void) { } 173static inline void cpuidle_resume_and_unlock(void) { }
174static inline void cpuidle_pause(void) { }
175static inline void cpuidle_resume(void) { }
167static inline int cpuidle_enable_device(struct cpuidle_device *dev) 176static inline int cpuidle_enable_device(struct cpuidle_device *dev)
168{return -ENODEV; } 177{return -ENODEV; }
169static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } 178static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
@@ -202,14 +211,7 @@ struct cpuidle_governor {
202extern int cpuidle_register_governor(struct cpuidle_governor *gov); 211extern int cpuidle_register_governor(struct cpuidle_governor *gov);
203extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); 212extern void cpuidle_unregister_governor(struct cpuidle_governor *gov);
204 213
205#ifdef CONFIG_INTEL_IDLE
206extern int intel_idle_cpu_init(int cpu);
207#else 214#else
208static inline int intel_idle_cpu_init(int cpu) { return -1; }
209#endif
210
211#else
212static inline int intel_idle_cpu_init(int cpu) { return -1; }
213 215
214static inline int cpuidle_register_governor(struct cpuidle_governor *gov) 216static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
215{return 0;} 217{return 0;}
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 094789ff3e9f..caa34e50537e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -128,7 +128,7 @@ struct dentry {
128 struct rcu_head d_rcu; 128 struct rcu_head d_rcu;
129 } d_u; 129 } d_u;
130 struct list_head d_subdirs; /* our children */ 130 struct list_head d_subdirs; /* our children */
131 struct list_head d_alias; /* inode alias list */ 131 struct hlist_node d_alias; /* inode alias list */
132}; 132};
133 133
134/* 134/*
@@ -144,7 +144,7 @@ enum dentry_d_lock_class
144}; 144};
145 145
146struct dentry_operations { 146struct dentry_operations {
147 int (*d_revalidate)(struct dentry *, struct nameidata *); 147 int (*d_revalidate)(struct dentry *, unsigned int);
148 int (*d_hash)(const struct dentry *, const struct inode *, 148 int (*d_hash)(const struct dentry *, const struct inode *,
149 struct qstr *); 149 struct qstr *);
150 int (*d_compare)(const struct dentry *, const struct inode *, 150 int (*d_compare)(const struct dentry *, const struct inode *,
diff --git a/include/linux/device.h b/include/linux/device.h
index 161d96241b1b..5083bccae967 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -36,6 +36,7 @@ struct subsys_private;
36struct bus_type; 36struct bus_type;
37struct device_node; 37struct device_node;
38struct iommu_ops; 38struct iommu_ops;
39struct iommu_group;
39 40
40struct bus_attribute { 41struct bus_attribute {
41 struct attribute attr; 42 struct attribute attr;
@@ -687,6 +688,7 @@ struct device {
687 const struct attribute_group **groups; /* optional groups */ 688 const struct attribute_group **groups; /* optional groups */
688 689
689 void (*release)(struct device *dev); 690 void (*release)(struct device *dev);
691 struct iommu_group *iommu_group;
690}; 692};
691 693
692/* Get the wakeup routines, which depend on struct device */ 694/* Get the wakeup routines, which depend on struct device */
@@ -865,8 +867,6 @@ extern int (*platform_notify_remove)(struct device *dev);
865extern struct device *get_device(struct device *dev); 867extern struct device *get_device(struct device *dev);
866extern void put_device(struct device *dev); 868extern void put_device(struct device *dev);
867 869
868extern void wait_for_device_probe(void);
869
870#ifdef CONFIG_DEVTMPFS 870#ifdef CONFIG_DEVTMPFS
871extern int devtmpfs_create_node(struct device *dev); 871extern int devtmpfs_create_node(struct device *dev);
872extern int devtmpfs_delete_node(struct device *dev); 872extern int devtmpfs_delete_node(struct device *dev);
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 56377df39124..9c02a4508b25 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -338,6 +338,9 @@ enum dma_slave_buswidth {
338 * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill 338 * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill
339 * with 'true' if peripheral should be flow controller. Direction will be 339 * with 'true' if peripheral should be flow controller. Direction will be
340 * selected at Runtime. 340 * selected at Runtime.
341 * @slave_id: Slave requester id. Only valid for slave channels. The dma
342 * slave peripheral will have unique id as dma requester which need to be
343 * pass as slave config.
341 * 344 *
342 * This struct is passed in as configuration data to a DMA engine 345 * This struct is passed in as configuration data to a DMA engine
343 * in order to set up a certain channel for DMA transport at runtime. 346 * in order to set up a certain channel for DMA transport at runtime.
@@ -365,6 +368,7 @@ struct dma_slave_config {
365 u32 src_maxburst; 368 u32 src_maxburst;
366 u32 dst_maxburst; 369 u32 dst_maxburst;
367 bool device_fc; 370 bool device_fc;
371 unsigned int slave_id;
368}; 372};
369 373
370static inline const char *dma_chan_name(struct dma_chan *chan) 374static inline const char *dma_chan_name(struct dma_chan *chan)
@@ -670,6 +674,12 @@ static inline int dmaengine_resume(struct dma_chan *chan)
670 return dmaengine_device_control(chan, DMA_RESUME, 0); 674 return dmaengine_device_control(chan, DMA_RESUME, 0);
671} 675}
672 676
677static inline enum dma_status dmaengine_tx_status(struct dma_chan *chan,
678 dma_cookie_t cookie, struct dma_tx_state *state)
679{
680 return chan->device->device_tx_status(chan, cookie, state);
681}
682
673static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc) 683static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc)
674{ 684{
675 return desc->tx_submit(desc); 685 return desc->tx_submit(desc);
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h
index 07261d52a6df..1148575fd134 100644
--- a/include/linux/dw_apb_timer.h
+++ b/include/linux/dw_apb_timer.h
@@ -53,4 +53,5 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
53cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); 53cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs);
54void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); 54void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs);
55 55
56extern struct sys_timer dw_apb_timer;
56#endif /* __DW_APB_TIMER_H__ */ 57#endif /* __DW_APB_TIMER_H__ */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 3d406e0ede6d..d426336d92d9 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -124,17 +124,30 @@ static inline bool is_valid_ether_addr(const u8 *addr)
124} 124}
125 125
126/** 126/**
127 * random_ether_addr - Generate software assigned random Ethernet address 127 * eth_random_addr - Generate software assigned random Ethernet address
128 * @addr: Pointer to a six-byte array containing the Ethernet address 128 * @addr: Pointer to a six-byte array containing the Ethernet address
129 * 129 *
130 * Generate a random Ethernet address (MAC) that is not multicast 130 * Generate a random Ethernet address (MAC) that is not multicast
131 * and has the local assigned bit set. 131 * and has the local assigned bit set.
132 */ 132 */
133static inline void random_ether_addr(u8 *addr) 133static inline void eth_random_addr(u8 *addr)
134{ 134{
135 get_random_bytes (addr, ETH_ALEN); 135 get_random_bytes(addr, ETH_ALEN);
136 addr [0] &= 0xfe; /* clear multicast bit */ 136 addr[0] &= 0xfe; /* clear multicast bit */
137 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ 137 addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
138}
139
140#define random_ether_addr(addr) eth_random_addr(addr)
141
142/**
143 * eth_broadcast_addr - Assign broadcast address
144 * @addr: Pointer to a six-byte array containing the Ethernet address
145 *
146 * Assign the broadcast address to the given address array.
147 */
148static inline void eth_broadcast_addr(u8 *addr)
149{
150 memset(addr, 0xff, ETH_ALEN);
138} 151}
139 152
140/** 153/**
@@ -149,7 +162,7 @@ static inline void random_ether_addr(u8 *addr)
149static inline void eth_hw_addr_random(struct net_device *dev) 162static inline void eth_hw_addr_random(struct net_device *dev)
150{ 163{
151 dev->addr_assign_type |= NET_ADDR_RANDOM; 164 dev->addr_assign_type |= NET_ADDR_RANDOM;
152 random_ether_addr(dev->dev_addr); 165 eth_random_addr(dev->dev_addr);
153} 166}
154 167
155/** 168/**
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index e17fa7140588..21eff418091b 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -137,6 +137,35 @@ struct ethtool_eeprom {
137}; 137};
138 138
139/** 139/**
140 * struct ethtool_eee - Energy Efficient Ethernet information
141 * @cmd: ETHTOOL_{G,S}EEE
142 * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations
143 * for which there is EEE support.
144 * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations
145 * advertised as eee capable.
146 * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex
147 * combinations advertised by the link partner as eee capable.
148 * @eee_active: Result of the eee auto negotiation.
149 * @eee_enabled: EEE configured mode (enabled/disabled).
150 * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
151 * that eee was negotiated.
152 * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting
153 * its tx lpi (after reaching 'idle' state). Effective only when eee
154 * was negotiated and tx_lpi_enabled was set.
155 */
156struct ethtool_eee {
157 __u32 cmd;
158 __u32 supported;
159 __u32 advertised;
160 __u32 lp_advertised;
161 __u32 eee_active;
162 __u32 eee_enabled;
163 __u32 tx_lpi_enabled;
164 __u32 tx_lpi_timer;
165 __u32 reserved[2];
166};
167
168/**
140 * struct ethtool_modinfo - plugin module eeprom information 169 * struct ethtool_modinfo - plugin module eeprom information
141 * @cmd: %ETHTOOL_GMODULEINFO 170 * @cmd: %ETHTOOL_GMODULEINFO
142 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx 171 * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx
@@ -945,6 +974,8 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
945 * @get_module_info: Get the size and type of the eeprom contained within 974 * @get_module_info: Get the size and type of the eeprom contained within
946 * a plug-in module. 975 * a plug-in module.
947 * @get_module_eeprom: Get the eeprom information from the plug-in module 976 * @get_module_eeprom: Get the eeprom information from the plug-in module
977 * @get_eee: Get Energy-Efficient (EEE) supported and status.
978 * @set_eee: Set EEE status (enable/disable) as well as LPI timers.
948 * 979 *
949 * All operations are optional (i.e. the function pointer may be set 980 * All operations are optional (i.e. the function pointer may be set
950 * to %NULL) and callers must take this into account. Callers must 981 * to %NULL) and callers must take this into account. Callers must
@@ -1011,6 +1042,8 @@ struct ethtool_ops {
1011 struct ethtool_modinfo *); 1042 struct ethtool_modinfo *);
1012 int (*get_module_eeprom)(struct net_device *, 1043 int (*get_module_eeprom)(struct net_device *,
1013 struct ethtool_eeprom *, u8 *); 1044 struct ethtool_eeprom *, u8 *);
1045 int (*get_eee)(struct net_device *, struct ethtool_eee *);
1046 int (*set_eee)(struct net_device *, struct ethtool_eee *);
1014 1047
1015 1048
1016}; 1049};
@@ -1089,6 +1122,8 @@ struct ethtool_ops {
1089#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ 1122#define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */
1090#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */ 1123#define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */
1091#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */ 1124#define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */
1125#define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */
1126#define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */
1092 1127
1093/* compatibility with older code */ 1128/* compatibility with older code */
1094#define SPARC_ETH_GSET ETHTOOL_GSET 1129#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -1118,6 +1153,10 @@ struct ethtool_ops {
1118#define SUPPORTED_10000baseR_FEC (1 << 20) 1153#define SUPPORTED_10000baseR_FEC (1 << 20)
1119#define SUPPORTED_20000baseMLD2_Full (1 << 21) 1154#define SUPPORTED_20000baseMLD2_Full (1 << 21)
1120#define SUPPORTED_20000baseKR2_Full (1 << 22) 1155#define SUPPORTED_20000baseKR2_Full (1 << 22)
1156#define SUPPORTED_40000baseKR4_Full (1 << 23)
1157#define SUPPORTED_40000baseCR4_Full (1 << 24)
1158#define SUPPORTED_40000baseSR4_Full (1 << 25)
1159#define SUPPORTED_40000baseLR4_Full (1 << 26)
1121 1160
1122/* Indicates what features are advertised by the interface. */ 1161/* Indicates what features are advertised by the interface. */
1123#define ADVERTISED_10baseT_Half (1 << 0) 1162#define ADVERTISED_10baseT_Half (1 << 0)
@@ -1143,6 +1182,10 @@ struct ethtool_ops {
1143#define ADVERTISED_10000baseR_FEC (1 << 20) 1182#define ADVERTISED_10000baseR_FEC (1 << 20)
1144#define ADVERTISED_20000baseMLD2_Full (1 << 21) 1183#define ADVERTISED_20000baseMLD2_Full (1 << 21)
1145#define ADVERTISED_20000baseKR2_Full (1 << 22) 1184#define ADVERTISED_20000baseKR2_Full (1 << 22)
1185#define ADVERTISED_40000baseKR4_Full (1 << 23)
1186#define ADVERTISED_40000baseCR4_Full (1 << 24)
1187#define ADVERTISED_40000baseSR4_Full (1 << 25)
1188#define ADVERTISED_40000baseLR4_Full (1 << 26)
1146 1189
1147/* The following are all involved in forcing a particular link 1190/* The following are all involved in forcing a particular link
1148 * mode for the device for setting things. When getting the 1191 * mode for the device for setting things. When getting the
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 6f8be328770a..f4bb378ccf6a 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -34,7 +34,7 @@
34 * re-allowed until epoll_wait is called again after consuming the wakeup 34 * re-allowed until epoll_wait is called again after consuming the wakeup
35 * event(s). 35 * event(s).
36 * 36 *
37 * Requires CAP_EPOLLWAKEUP 37 * Requires CAP_BLOCK_SUSPEND
38 */ 38 */
39#define EPOLLWAKEUP (1 << 29) 39#define EPOLLWAKEUP (1 << 29)
40 40
diff --git a/include/linux/file.h b/include/linux/file.h
index 58bf158c53d9..a22408bac0d0 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -39,4 +39,7 @@ extern void put_unused_fd(unsigned int fd);
39 39
40extern void fd_install(unsigned int fd, struct file *file); 40extern void fd_install(unsigned int fd, struct file *file);
41 41
42extern void flush_delayed_fput(void);
43extern void __fput_sync(struct file *);
44
42#endif /* __LINUX_FILE_H */ 45#endif /* __LINUX_FILE_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 17fd887c798f..8fabb037a48d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -826,7 +826,7 @@ struct inode {
826 struct list_head i_lru; /* inode LRU list */ 826 struct list_head i_lru; /* inode LRU list */
827 struct list_head i_sb_list; 827 struct list_head i_sb_list;
828 union { 828 union {
829 struct list_head i_dentry; 829 struct hlist_head i_dentry;
830 struct rcu_head i_rcu; 830 struct rcu_head i_rcu;
831 }; 831 };
832 u64 i_version; 832 u64 i_version;
@@ -1571,7 +1571,7 @@ extern void unlock_super(struct super_block *);
1571/* 1571/*
1572 * VFS helper functions.. 1572 * VFS helper functions..
1573 */ 1573 */
1574extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); 1574extern int vfs_create(struct inode *, struct dentry *, umode_t, bool);
1575extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); 1575extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);
1576extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); 1576extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);
1577extern int vfs_symlink(struct inode *, struct dentry *, const char *); 1577extern int vfs_symlink(struct inode *, struct dentry *, const char *);
@@ -1666,7 +1666,7 @@ struct file_operations {
1666}; 1666};
1667 1667
1668struct inode_operations { 1668struct inode_operations {
1669 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); 1669 struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
1670 void * (*follow_link) (struct dentry *, struct nameidata *); 1670 void * (*follow_link) (struct dentry *, struct nameidata *);
1671 int (*permission) (struct inode *, int); 1671 int (*permission) (struct inode *, int);
1672 struct posix_acl * (*get_acl)(struct inode *, int); 1672 struct posix_acl * (*get_acl)(struct inode *, int);
@@ -1674,7 +1674,7 @@ struct inode_operations {
1674 int (*readlink) (struct dentry *, char __user *,int); 1674 int (*readlink) (struct dentry *, char __user *,int);
1675 void (*put_link) (struct dentry *, struct nameidata *, void *); 1675 void (*put_link) (struct dentry *, struct nameidata *, void *);
1676 1676
1677 int (*create) (struct inode *,struct dentry *,umode_t,struct nameidata *); 1677 int (*create) (struct inode *,struct dentry *, umode_t, bool);
1678 int (*link) (struct dentry *,struct inode *,struct dentry *); 1678 int (*link) (struct dentry *,struct inode *,struct dentry *);
1679 int (*unlink) (struct inode *,struct dentry *); 1679 int (*unlink) (struct inode *,struct dentry *);
1680 int (*symlink) (struct inode *,struct dentry *,const char *); 1680 int (*symlink) (struct inode *,struct dentry *,const char *);
@@ -1693,6 +1693,9 @@ struct inode_operations {
1693 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, 1693 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
1694 u64 len); 1694 u64 len);
1695 int (*update_time)(struct inode *, struct timespec *, int); 1695 int (*update_time)(struct inode *, struct timespec *, int);
1696 int (*atomic_open)(struct inode *, struct dentry *,
1697 struct file *, unsigned open_flag,
1698 umode_t create_mode, int *opened);
1696} ____cacheline_aligned; 1699} ____cacheline_aligned;
1697 1700
1698struct seq_file; 1701struct seq_file;
@@ -1911,7 +1914,7 @@ void free_anon_bdev(dev_t);
1911struct super_block *sget(struct file_system_type *type, 1914struct super_block *sget(struct file_system_type *type,
1912 int (*test)(struct super_block *,void *), 1915 int (*test)(struct super_block *,void *),
1913 int (*set)(struct super_block *,void *), 1916 int (*set)(struct super_block *,void *),
1914 void *data); 1917 int flags, void *data);
1915extern struct dentry *mount_pseudo(struct file_system_type *, char *, 1918extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1916 const struct super_operations *ops, 1919 const struct super_operations *ops,
1917 const struct dentry_operations *dops, 1920 const struct dentry_operations *dops,
@@ -2057,10 +2060,17 @@ extern long do_sys_open(int dfd, const char __user *filename, int flags,
2057extern struct file *filp_open(const char *, int, umode_t); 2060extern struct file *filp_open(const char *, int, umode_t);
2058extern struct file *file_open_root(struct dentry *, struct vfsmount *, 2061extern struct file *file_open_root(struct dentry *, struct vfsmount *,
2059 const char *, int); 2062 const char *, int);
2060extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, 2063extern struct file * dentry_open(const struct path *, int, const struct cred *);
2061 const struct cred *);
2062extern int filp_close(struct file *, fl_owner_t id); 2064extern int filp_close(struct file *, fl_owner_t id);
2063extern char * getname(const char __user *); 2065extern char * getname(const char __user *);
2066enum {
2067 FILE_CREATED = 1,
2068 FILE_OPENED = 2
2069};
2070extern int finish_open(struct file *file, struct dentry *dentry,
2071 int (*open)(struct inode *, struct file *),
2072 int *opened);
2073extern int finish_no_open(struct file *file, struct dentry *dentry);
2064 2074
2065/* fs/ioctl.c */ 2075/* fs/ioctl.c */
2066 2076
@@ -2091,6 +2101,7 @@ extern sector_t blkdev_max_block(struct block_device *bdev);
2091extern void bd_forget(struct inode *inode); 2101extern void bd_forget(struct inode *inode);
2092extern void bdput(struct block_device *); 2102extern void bdput(struct block_device *);
2093extern void invalidate_bdev(struct block_device *); 2103extern void invalidate_bdev(struct block_device *);
2104extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);
2094extern int sync_blockdev(struct block_device *bdev); 2105extern int sync_blockdev(struct block_device *bdev);
2095extern void kill_bdev(struct block_device *); 2106extern void kill_bdev(struct block_device *);
2096extern struct super_block *freeze_bdev(struct block_device *); 2107extern struct super_block *freeze_bdev(struct block_device *);
@@ -2112,6 +2123,10 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
2112{ 2123{
2113 return 0; 2124 return 0;
2114} 2125}
2126
2127static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)
2128{
2129}
2115#endif 2130#endif
2116extern int sync_filesystem(struct super_block *); 2131extern int sync_filesystem(struct super_block *);
2117extern const struct file_operations def_blk_fops; 2132extern const struct file_operations def_blk_fops;
@@ -2438,7 +2453,7 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
2438extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 2453extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
2439extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 2454extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
2440extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, 2455extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
2441 int origin, loff_t maxsize); 2456 int origin, loff_t maxsize, loff_t eof);
2442extern int generic_file_open(struct inode * inode, struct file * filp); 2457extern int generic_file_open(struct inode * inode, struct file * filp);
2443extern int nonseekable_open(struct inode * inode, struct file * filp); 2458extern int nonseekable_open(struct inode * inode, struct file * filp);
2444 2459
@@ -2560,7 +2575,7 @@ extern int simple_write_end(struct file *file, struct address_space *mapping,
2560 loff_t pos, unsigned len, unsigned copied, 2575 loff_t pos, unsigned len, unsigned copied,
2561 struct page *page, void *fsdata); 2576 struct page *page, void *fsdata);
2562 2577
2563extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 2578extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags);
2564extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); 2579extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
2565extern const struct file_operations simple_dir_operations; 2580extern const struct file_operations simple_dir_operations;
2566extern const struct inode_operations simple_dir_inode_operations; 2581extern const struct inode_operations simple_dir_inode_operations;
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 176a939d1547..af961d6f7ab1 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -65,7 +65,7 @@ struct trace_iterator {
65 void *private; 65 void *private;
66 int cpu_file; 66 int cpu_file;
67 struct mutex mutex; 67 struct mutex mutex;
68 struct ring_buffer_iter *buffer_iter[NR_CPUS]; 68 struct ring_buffer_iter **buffer_iter;
69 unsigned long iter_flags; 69 unsigned long iter_flags;
70 70
71 /* trace_seq for __print_flags() and __print_symbolic() etc. */ 71 /* trace_seq for __print_flags() and __print_symbolic() etc. */
@@ -207,6 +207,9 @@ struct ftrace_event_call {
207 * bit 1: enabled 207 * bit 1: enabled
208 * bit 2: filter_active 208 * bit 2: filter_active
209 * bit 3: enabled cmd record 209 * bit 3: enabled cmd record
210 * bit 4: allow trace by non root (cap any)
211 * bit 5: failed to apply filter
212 * bit 6: ftrace internal event (do not enable)
210 * 213 *
211 * Changes to flags must hold the event_mutex. 214 * Changes to flags must hold the event_mutex.
212 * 215 *
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index 7a114016ac7d..5ab61c1eb6bf 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -85,7 +85,7 @@ enum {
85/* All generic netlink requests are serialized by a global lock. */ 85/* All generic netlink requests are serialized by a global lock. */
86extern void genl_lock(void); 86extern void genl_lock(void);
87extern void genl_unlock(void); 87extern void genl_unlock(void);
88#ifdef CONFIG_PROVE_LOCKING 88#ifdef CONFIG_LOCKDEP
89extern int lockdep_genl_is_held(void); 89extern int lockdep_genl_is_held(void);
90#endif 90#endif
91 91
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index fa98bdb073b9..b2de1f9a88d6 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -170,6 +170,16 @@ struct gfs2_rindex {
170#define GFS2_RGF_NOALLOC 0x00000008 170#define GFS2_RGF_NOALLOC 0x00000008
171#define GFS2_RGF_TRIMMED 0x00000010 171#define GFS2_RGF_TRIMMED 0x00000010
172 172
173struct gfs2_rgrp_lvb {
174 __be32 rl_magic;
175 __be32 rl_flags;
176 __be32 rl_free;
177 __be32 rl_dinodes;
178 __be64 rl_igeneration;
179 __be32 rl_unlinked;
180 __be32 __pad;
181};
182
173struct gfs2_rgrp { 183struct gfs2_rgrp {
174 struct gfs2_meta_header rg_header; 184 struct gfs2_meta_header rg_header;
175 185
@@ -214,6 +224,7 @@ enum {
214 gfs2fl_NoAtime = 7, 224 gfs2fl_NoAtime = 7,
215 gfs2fl_Sync = 8, 225 gfs2fl_Sync = 8,
216 gfs2fl_System = 9, 226 gfs2fl_System = 9,
227 gfs2fl_TopLevel = 10,
217 gfs2fl_TruncInProg = 29, 228 gfs2fl_TruncInProg = 29,
218 gfs2fl_InheritDirectio = 30, 229 gfs2fl_InheritDirectio = 30,
219 gfs2fl_InheritJdata = 31, 230 gfs2fl_InheritJdata = 31,
@@ -230,8 +241,9 @@ enum {
230#define GFS2_DIF_NOATIME 0x00000080 241#define GFS2_DIF_NOATIME 0x00000080
231#define GFS2_DIF_SYNC 0x00000100 242#define GFS2_DIF_SYNC 0x00000100
232#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */ 243#define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */
244#define GFS2_DIF_TOPDIR 0x00000400 /* New in gfs2 */
233#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */ 245#define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */
234#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 246#define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 /* only in gfs1 */
235#define GFS2_DIF_INHERIT_JDATA 0x80000000 247#define GFS2_DIF_INHERIT_JDATA 0x80000000
236 248
237struct gfs2_dinode { 249struct gfs2_dinode {
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index f07fc2d08159..2e31e8b3a190 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -22,8 +22,8 @@
22/* Gpio pin is open source */ 22/* Gpio pin is open source */
23#define GPIOF_OPEN_SOURCE (1 << 3) 23#define GPIOF_OPEN_SOURCE (1 << 3)
24 24
25#define GPIOF_EXPORT (1 << 2) 25#define GPIOF_EXPORT (1 << 4)
26#define GPIOF_EXPORT_CHANGEABLE (1 << 3) 26#define GPIOF_EXPORT_CHANGEABLE (1 << 5)
27#define GPIOF_EXPORT_DIR_FIXED (GPIOF_EXPORT) 27#define GPIOF_EXPORT_DIR_FIXED (GPIOF_EXPORT)
28#define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE) 28#define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE)
29 29
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 449fa385703d..42970de1b40c 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -200,6 +200,7 @@ struct hid_item {
200#define HID_UP_DIGITIZER 0x000d0000 200#define HID_UP_DIGITIZER 0x000d0000
201#define HID_UP_PID 0x000f0000 201#define HID_UP_PID 0x000f0000
202#define HID_UP_HPVENDOR 0xff7f0000 202#define HID_UP_HPVENDOR 0xff7f0000
203#define HID_UP_HPVENDOR2 0xff010000
203#define HID_UP_MSVENDOR 0xff000000 204#define HID_UP_MSVENDOR 0xff000000
204#define HID_UP_CUSTOM 0x00ff0000 205#define HID_UP_CUSTOM 0x00ff0000
205#define HID_UP_LOGIVENDOR 0xffbc0000 206#define HID_UP_LOGIVENDOR 0xffbc0000
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index fd0dc30c9f15..cc07d2777bbe 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -165,6 +165,7 @@ enum hrtimer_base_type {
165 * @lock: lock protecting the base and associated clock bases 165 * @lock: lock protecting the base and associated clock bases
166 * and timers 166 * and timers
167 * @active_bases: Bitfield to mark bases with active timers 167 * @active_bases: Bitfield to mark bases with active timers
168 * @clock_was_set: Indicates that clock was set from irq context.
168 * @expires_next: absolute time of the next event which was scheduled 169 * @expires_next: absolute time of the next event which was scheduled
169 * via clock_set_next_event() 170 * via clock_set_next_event()
170 * @hres_active: State of high resolution mode 171 * @hres_active: State of high resolution mode
@@ -177,7 +178,8 @@ enum hrtimer_base_type {
177 */ 178 */
178struct hrtimer_cpu_base { 179struct hrtimer_cpu_base {
179 raw_spinlock_t lock; 180 raw_spinlock_t lock;
180 unsigned long active_bases; 181 unsigned int active_bases;
182 unsigned int clock_was_set;
181#ifdef CONFIG_HIGH_RES_TIMERS 183#ifdef CONFIG_HIGH_RES_TIMERS
182 ktime_t expires_next; 184 ktime_t expires_next;
183 int hres_active; 185 int hres_active;
@@ -286,6 +288,8 @@ extern void hrtimer_peek_ahead_timers(void);
286# define MONOTONIC_RES_NSEC HIGH_RES_NSEC 288# define MONOTONIC_RES_NSEC HIGH_RES_NSEC
287# define KTIME_MONOTONIC_RES KTIME_HIGH_RES 289# define KTIME_MONOTONIC_RES KTIME_HIGH_RES
288 290
291extern void clock_was_set_delayed(void);
292
289#else 293#else
290 294
291# define MONOTONIC_RES_NSEC LOW_RES_NSEC 295# define MONOTONIC_RES_NSEC LOW_RES_NSEC
@@ -306,6 +310,9 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer)
306{ 310{
307 return 0; 311 return 0;
308} 312}
313
314static inline void clock_was_set_delayed(void) { }
315
309#endif 316#endif
310 317
311extern void clock_was_set(void); 318extern void clock_was_set(void);
@@ -320,6 +327,7 @@ extern ktime_t ktime_get(void);
320extern ktime_t ktime_get_real(void); 327extern ktime_t ktime_get_real(void);
321extern ktime_t ktime_get_boottime(void); 328extern ktime_t ktime_get_boottime(void);
322extern ktime_t ktime_get_monotonic_offset(void); 329extern ktime_t ktime_get_monotonic_offset(void);
330extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot);
323 331
324DECLARE_PER_CPU(struct tick_device, tick_cpu_device); 332DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
325 333
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index ddfa04108baf..1d0fe4877b1f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -425,6 +425,8 @@ void i2c_unlock_adapter(struct i2c_adapter *);
425#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ 425#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
426 /* Must equal I2C_M_TEN below */ 426 /* Must equal I2C_M_TEN below */
427#define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */ 427#define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */
428#define I2C_CLIENT_SCCB 0x9000 /* Use Omnivision SCCB protocol */
429 /* Must match I2C_M_STOP|IGNORE_NAK */
428 430
429/* i2c adapter classes (bitmask) */ 431/* i2c adapter classes (bitmask) */
430#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ 432#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
@@ -541,6 +543,7 @@ struct i2c_msg {
541 __u16 flags; 543 __u16 flags;
542#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */ 544#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
543#define I2C_M_RD 0x0001 /* read data, from slave to master */ 545#define I2C_M_RD 0x0001 /* read data, from slave to master */
546#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
544#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */ 547#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */
545#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */ 548#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
546#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */ 549#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 3993477103a5..555382660bc4 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -683,7 +683,6 @@ struct twl4030_audio_data {
683}; 683};
684 684
685struct twl4030_platform_data { 685struct twl4030_platform_data {
686 unsigned irq_base, irq_end;
687 struct twl4030_clock_init_data *clock; 686 struct twl4030_clock_init_data *clock;
688 struct twl4030_bci_platform_data *bci; 687 struct twl4030_bci_platform_data *bci;
689 struct twl4030_gpio_platform_data *gpio; 688 struct twl4030_gpio_platform_data *gpio;
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ce9af8918514..e02fc682bb68 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -47,6 +47,7 @@
47#define IEEE80211_FCTL_MOREDATA 0x2000 47#define IEEE80211_FCTL_MOREDATA 0x2000
48#define IEEE80211_FCTL_PROTECTED 0x4000 48#define IEEE80211_FCTL_PROTECTED 0x4000
49#define IEEE80211_FCTL_ORDER 0x8000 49#define IEEE80211_FCTL_ORDER 0x8000
50#define IEEE80211_FCTL_CTL_EXT 0x0f00
50 51
51#define IEEE80211_SCTL_FRAG 0x000F 52#define IEEE80211_SCTL_FRAG 0x000F
52#define IEEE80211_SCTL_SEQ 0xFFF0 53#define IEEE80211_SCTL_SEQ 0xFFF0
@@ -54,6 +55,7 @@
54#define IEEE80211_FTYPE_MGMT 0x0000 55#define IEEE80211_FTYPE_MGMT 0x0000
55#define IEEE80211_FTYPE_CTL 0x0004 56#define IEEE80211_FTYPE_CTL 0x0004
56#define IEEE80211_FTYPE_DATA 0x0008 57#define IEEE80211_FTYPE_DATA 0x0008
58#define IEEE80211_FTYPE_EXT 0x000c
57 59
58/* management */ 60/* management */
59#define IEEE80211_STYPE_ASSOC_REQ 0x0000 61#define IEEE80211_STYPE_ASSOC_REQ 0x0000
@@ -70,6 +72,7 @@
70#define IEEE80211_STYPE_ACTION 0x00D0 72#define IEEE80211_STYPE_ACTION 0x00D0
71 73
72/* control */ 74/* control */
75#define IEEE80211_STYPE_CTL_EXT 0x0060
73#define IEEE80211_STYPE_BACK_REQ 0x0080 76#define IEEE80211_STYPE_BACK_REQ 0x0080
74#define IEEE80211_STYPE_BACK 0x0090 77#define IEEE80211_STYPE_BACK 0x0090
75#define IEEE80211_STYPE_PSPOLL 0x00A0 78#define IEEE80211_STYPE_PSPOLL 0x00A0
@@ -97,6 +100,18 @@
97#define IEEE80211_STYPE_QOS_CFPOLL 0x00E0 100#define IEEE80211_STYPE_QOS_CFPOLL 0x00E0
98#define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0 101#define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0
99 102
103/* extension, added by 802.11ad */
104#define IEEE80211_STYPE_DMG_BEACON 0x0000
105
106/* control extension - for IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTL_EXT */
107#define IEEE80211_CTL_EXT_POLL 0x2000
108#define IEEE80211_CTL_EXT_SPR 0x3000
109#define IEEE80211_CTL_EXT_GRANT 0x4000
110#define IEEE80211_CTL_EXT_DMG_CTS 0x5000
111#define IEEE80211_CTL_EXT_DMG_DTS 0x6000
112#define IEEE80211_CTL_EXT_SSW 0x8000
113#define IEEE80211_CTL_EXT_SSW_FBACK 0x9000
114#define IEEE80211_CTL_EXT_SSW_ACK 0xa000
100 115
101/* miscellaneous IEEE 802.11 constants */ 116/* miscellaneous IEEE 802.11 constants */
102#define IEEE80211_MAX_FRAG_THRESHOLD 2352 117#define IEEE80211_MAX_FRAG_THRESHOLD 2352
@@ -568,6 +583,26 @@ struct ieee80211s_hdr {
568#define MESH_FLAGS_PS_DEEP 0x4 583#define MESH_FLAGS_PS_DEEP 0x4
569 584
570/** 585/**
586 * enum ieee80211_preq_flags - mesh PREQ element flags
587 *
588 * @IEEE80211_PREQ_PROACTIVE_PREP_FLAG: proactive PREP subfield
589 */
590enum ieee80211_preq_flags {
591 IEEE80211_PREQ_PROACTIVE_PREP_FLAG = 1<<2,
592};
593
594/**
595 * enum ieee80211_preq_target_flags - mesh PREQ element per target flags
596 *
597 * @IEEE80211_PREQ_TO_FLAG: target only subfield
598 * @IEEE80211_PREQ_USN_FLAG: unknown target HWMP sequence number subfield
599 */
600enum ieee80211_preq_target_flags {
601 IEEE80211_PREQ_TO_FLAG = 1<<0,
602 IEEE80211_PREQ_USN_FLAG = 1<<2,
603};
604
605/**
571 * struct ieee80211_quiet_ie 606 * struct ieee80211_quiet_ie
572 * 607 *
573 * This structure refers to "Quiet information element" 608 * This structure refers to "Quiet information element"
@@ -1072,6 +1107,73 @@ struct ieee80211_ht_operation {
1072#define WLAN_HT_SMPS_CONTROL_STATIC 1 1107#define WLAN_HT_SMPS_CONTROL_STATIC 1
1073#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 1108#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
1074 1109
1110#define VHT_MCS_SUPPORTED_SET_SIZE 8
1111
1112struct ieee80211_vht_capabilities {
1113 __le32 vht_capabilities_info;
1114 u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE];
1115} __packed;
1116
1117struct ieee80211_vht_operation {
1118 u8 vht_op_info_chwidth;
1119 u8 vht_op_info_chan_center_freq_seg1_idx;
1120 u8 vht_op_info_chan_center_freq_seg2_idx;
1121 __le16 vht_basic_mcs_set;
1122} __packed;
1123
1124/**
1125 * struct ieee80211_vht_mcs_info - VHT MCS information
1126 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
1127 * @rx_highest: Indicates highest long GI VHT PPDU data rate
1128 * STA can receive. Rate expressed in units of 1 Mbps.
1129 * If this field is 0 this value should not be used to
1130 * consider the highest RX data rate supported.
1131 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
1132 * @tx_highest: Indicates highest long GI VHT PPDU data rate
1133 * STA can transmit. Rate expressed in units of 1 Mbps.
1134 * If this field is 0 this value should not be used to
1135 * consider the highest TX data rate supported.
1136 */
1137struct ieee80211_vht_mcs_info {
1138 __le16 rx_mcs_map;
1139 __le16 rx_highest;
1140 __le16 tx_mcs_map;
1141 __le16 tx_highest;
1142} __packed;
1143
1144#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0
1145#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1
1146#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2
1147#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3
1148
1149/* 802.11ac VHT Capabilities */
1150#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
1151#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
1152#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1153#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1154#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
1155#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
1156#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
1157#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
1158#define IEEE80211_VHT_CAP_TXSTBC 0x00000080
1159#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100
1160#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200
1161#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300
1162#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400
1163#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1164#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1165#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000
1166#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000
1167#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1168#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1169#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
1170#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000
1171#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000
1172#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000
1173#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000
1174#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
1175#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
1176
1075/* Authentication algorithms */ 1177/* Authentication algorithms */
1076#define WLAN_AUTH_OPEN 0 1178#define WLAN_AUTH_OPEN 0
1077#define WLAN_AUTH_SHARED_KEY 1 1179#define WLAN_AUTH_SHARED_KEY 1
@@ -1104,6 +1206,21 @@ struct ieee80211_ht_operation {
1104#define WLAN_CAPABILITY_QOS (1<<9) 1206#define WLAN_CAPABILITY_QOS (1<<9)
1105#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 1207#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
1106#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) 1208#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
1209
1210/* DMG (60gHz) 802.11ad */
1211/* type - bits 0..1 */
1212#define WLAN_CAPABILITY_DMG_TYPE_IBSS (1<<0) /* Tx by: STA */
1213#define WLAN_CAPABILITY_DMG_TYPE_PBSS (2<<0) /* Tx by: PCP */
1214#define WLAN_CAPABILITY_DMG_TYPE_AP (3<<0) /* Tx by: AP */
1215
1216#define WLAN_CAPABILITY_DMG_CBAP_ONLY (1<<2)
1217#define WLAN_CAPABILITY_DMG_CBAP_SOURCE (1<<3)
1218#define WLAN_CAPABILITY_DMG_PRIVACY (1<<4)
1219#define WLAN_CAPABILITY_DMG_ECPAC (1<<5)
1220
1221#define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT (1<<8)
1222#define WLAN_CAPABILITY_DMG_RADIO_MEASURE (1<<12)
1223
1107/* measurement */ 1224/* measurement */
1108#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0) 1225#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0)
1109#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1) 1226#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1)
@@ -1113,7 +1230,6 @@ struct ieee80211_ht_operation {
1113#define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1 1230#define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1
1114#define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2 1231#define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2
1115 1232
1116
1117/* 802.11g ERP information element */ 1233/* 802.11g ERP information element */
1118#define WLAN_ERP_NON_ERP_PRESENT (1<<0) 1234#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
1119#define WLAN_ERP_USE_PROTECTION (1<<1) 1235#define WLAN_ERP_USE_PROTECTION (1<<1)
@@ -1125,6 +1241,16 @@ enum {
1125 WLAN_ERP_PREAMBLE_LONG = 1, 1241 WLAN_ERP_PREAMBLE_LONG = 1,
1126}; 1242};
1127 1243
1244/* Band ID, 802.11ad #8.4.1.45 */
1245enum {
1246 IEEE80211_BANDID_TV_WS = 0, /* TV white spaces */
1247 IEEE80211_BANDID_SUB1 = 1, /* Sub-1 GHz (excluding TV white spaces) */
1248 IEEE80211_BANDID_2G = 2, /* 2.4 GHz */
1249 IEEE80211_BANDID_3G = 3, /* 3.6 GHz */
1250 IEEE80211_BANDID_5G = 4, /* 4.9 and 5 GHz */
1251 IEEE80211_BANDID_60G = 5, /* 60 GHz */
1252};
1253
1128/* Status codes */ 1254/* Status codes */
1129enum ieee80211_statuscode { 1255enum ieee80211_statuscode {
1130 WLAN_STATUS_SUCCESS = 0, 1256 WLAN_STATUS_SUCCESS = 0,
@@ -1176,6 +1302,17 @@ enum ieee80211_statuscode {
1176 WLAN_STATUS_ANTI_CLOG_REQUIRED = 76, 1302 WLAN_STATUS_ANTI_CLOG_REQUIRED = 76,
1177 WLAN_STATUS_FCG_NOT_SUPP = 78, 1303 WLAN_STATUS_FCG_NOT_SUPP = 78,
1178 WLAN_STATUS_STA_NO_TBTT = 78, 1304 WLAN_STATUS_STA_NO_TBTT = 78,
1305 /* 802.11ad */
1306 WLAN_STATUS_REJECTED_WITH_SUGGESTED_CHANGES = 39,
1307 WLAN_STATUS_REJECTED_FOR_DELAY_PERIOD = 47,
1308 WLAN_STATUS_REJECT_WITH_SCHEDULE = 83,
1309 WLAN_STATUS_PENDING_ADMITTING_FST_SESSION = 86,
1310 WLAN_STATUS_PERFORMING_FST_NOW = 87,
1311 WLAN_STATUS_PENDING_GAP_IN_BA_WINDOW = 88,
1312 WLAN_STATUS_REJECT_U_PID_SETTING = 89,
1313 WLAN_STATUS_REJECT_DSE_BAND = 96,
1314 WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99,
1315 WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103,
1179}; 1316};
1180 1317
1181 1318
@@ -1332,6 +1469,43 @@ enum ieee80211_eid {
1332 WLAN_EID_DSE_REGISTERED_LOCATION = 58, 1469 WLAN_EID_DSE_REGISTERED_LOCATION = 58,
1333 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59, 1470 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
1334 WLAN_EID_EXT_CHANSWITCH_ANN = 60, 1471 WLAN_EID_EXT_CHANSWITCH_ANN = 60,
1472
1473 WLAN_EID_VHT_CAPABILITY = 191,
1474 WLAN_EID_VHT_OPERATION = 192,
1475
1476 /* 802.11ad */
1477 WLAN_EID_NON_TX_BSSID_CAP = 83,
1478 WLAN_EID_WAKEUP_SCHEDULE = 143,
1479 WLAN_EID_EXT_SCHEDULE = 144,
1480 WLAN_EID_STA_AVAILABILITY = 145,
1481 WLAN_EID_DMG_TSPEC = 146,
1482 WLAN_EID_DMG_AT = 147,
1483 WLAN_EID_DMG_CAP = 148,
1484 WLAN_EID_DMG_OPERATION = 151,
1485 WLAN_EID_DMG_BSS_PARAM_CHANGE = 152,
1486 WLAN_EID_DMG_BEAM_REFINEMENT = 153,
1487 WLAN_EID_CHANNEL_MEASURE_FEEDBACK = 154,
1488 WLAN_EID_AWAKE_WINDOW = 157,
1489 WLAN_EID_MULTI_BAND = 158,
1490 WLAN_EID_ADDBA_EXT = 159,
1491 WLAN_EID_NEXT_PCP_LIST = 160,
1492 WLAN_EID_PCP_HANDOVER = 161,
1493 WLAN_EID_DMG_LINK_MARGIN = 162,
1494 WLAN_EID_SWITCHING_STREAM = 163,
1495 WLAN_EID_SESSION_TRANSITION = 164,
1496 WLAN_EID_DYN_TONE_PAIRING_REPORT = 165,
1497 WLAN_EID_CLUSTER_REPORT = 166,
1498 WLAN_EID_RELAY_CAP = 167,
1499 WLAN_EID_RELAY_XFER_PARAM_SET = 168,
1500 WLAN_EID_BEAM_LINK_MAINT = 169,
1501 WLAN_EID_MULTIPLE_MAC_ADDR = 170,
1502 WLAN_EID_U_PID = 171,
1503 WLAN_EID_DMG_LINK_ADAPT_ACK = 172,
1504 WLAN_EID_QUIET_PERIOD_REQ = 175,
1505 WLAN_EID_QUIET_PERIOD_RESP = 177,
1506 WLAN_EID_EPAC_POLICY = 182,
1507 WLAN_EID_CLISTER_TIME_OFF = 183,
1508 WLAN_EID_ANTENNA_SECTOR_ID_PATTERN = 190,
1335}; 1509};
1336 1510
1337/* Action category code */ 1511/* Action category code */
@@ -1348,7 +1522,10 @@ enum ieee80211_category {
1348 WLAN_CATEGORY_MESH_ACTION = 13, 1522 WLAN_CATEGORY_MESH_ACTION = 13,
1349 WLAN_CATEGORY_MULTIHOP_ACTION = 14, 1523 WLAN_CATEGORY_MULTIHOP_ACTION = 14,
1350 WLAN_CATEGORY_SELF_PROTECTED = 15, 1524 WLAN_CATEGORY_SELF_PROTECTED = 15,
1525 WLAN_CATEGORY_DMG = 16,
1351 WLAN_CATEGORY_WMM = 17, 1526 WLAN_CATEGORY_WMM = 17,
1527 WLAN_CATEGORY_FST = 18,
1528 WLAN_CATEGORY_UNPROT_DMG = 20,
1352 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, 1529 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
1353 WLAN_CATEGORY_VENDOR_SPECIFIC = 127, 1530 WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
1354}; 1531};
@@ -1443,7 +1620,7 @@ enum ieee80211_tdls_actioncode {
1443 * 1620 *
1444 * @IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET: the default synchronization method 1621 * @IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET: the default synchronization method
1445 * @IEEE80211_SYNC_METHOD_VENDOR: a vendor specific synchronization method 1622 * @IEEE80211_SYNC_METHOD_VENDOR: a vendor specific synchronization method
1446 * that will be specified in a vendor specific information element 1623 * that will be specified in a vendor specific information element
1447 */ 1624 */
1448enum { 1625enum {
1449 IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET = 1, 1626 IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET = 1,
@@ -1455,7 +1632,7 @@ enum {
1455 * 1632 *
1456 * @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol 1633 * @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol
1457 * @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will 1634 * @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will
1458 * be specified in a vendor specific information element 1635 * be specified in a vendor specific information element
1459 */ 1636 */
1460enum { 1637enum {
1461 IEEE80211_PATH_PROTOCOL_HWMP = 1, 1638 IEEE80211_PATH_PROTOCOL_HWMP = 1,
@@ -1467,13 +1644,35 @@ enum {
1467 * 1644 *
1468 * @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric 1645 * @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric
1469 * @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be 1646 * @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be
1470 * specified in a vendor specific information element 1647 * specified in a vendor specific information element
1471 */ 1648 */
1472enum { 1649enum {
1473 IEEE80211_PATH_METRIC_AIRTIME = 1, 1650 IEEE80211_PATH_METRIC_AIRTIME = 1,
1474 IEEE80211_PATH_METRIC_VENDOR = 255, 1651 IEEE80211_PATH_METRIC_VENDOR = 255,
1475}; 1652};
1476 1653
1654/**
1655 * enum ieee80211_root_mode_identifier - root mesh STA mode identifier
1656 *
1657 * These attribute are used by dot11MeshHWMPRootMode to set root mesh STA mode
1658 *
1659 * @IEEE80211_ROOTMODE_NO_ROOT: the mesh STA is not a root mesh STA (default)
1660 * @IEEE80211_ROOTMODE_ROOT: the mesh STA is a root mesh STA if greater than
1661 * this value
1662 * @IEEE80211_PROACTIVE_PREQ_NO_PREP: the mesh STA is a root mesh STA supports
1663 * the proactive PREQ with proactive PREP subfield set to 0
1664 * @IEEE80211_PROACTIVE_PREQ_WITH_PREP: the mesh STA is a root mesh STA
1665 * supports the proactive PREQ with proactive PREP subfield set to 1
1666 * @IEEE80211_PROACTIVE_RANN: the mesh STA is a root mesh STA supports
1667 * the proactive RANN
1668 */
1669enum ieee80211_root_mode_identifier {
1670 IEEE80211_ROOTMODE_NO_ROOT = 0,
1671 IEEE80211_ROOTMODE_ROOT = 1,
1672 IEEE80211_PROACTIVE_PREQ_NO_PREP = 2,
1673 IEEE80211_PROACTIVE_PREQ_WITH_PREP = 3,
1674 IEEE80211_PROACTIVE_RANN = 4,
1675};
1477 1676
1478/* 1677/*
1479 * IEEE 802.11-2007 7.3.2.9 Country information element 1678 * IEEE 802.11-2007 7.3.2.9 Country information element
@@ -1574,6 +1773,7 @@ enum ieee80211_sa_query_action {
1574#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 1773#define WLAN_CIPHER_SUITE_CCMP 0x000FAC04
1575#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 1774#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
1576#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 1775#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
1776#define WLAN_CIPHER_SUITE_GCMP 0x000FAC08
1577 1777
1578#define WLAN_CIPHER_SUITE_SMS4 0x00147201 1778#define WLAN_CIPHER_SUITE_SMS4 0x00147201
1579 1779
@@ -1589,6 +1789,10 @@ enum ieee80211_sa_query_action {
1589 1789
1590#define WLAN_OUI_WFA 0x506f9a 1790#define WLAN_OUI_WFA 0x506f9a
1591#define WLAN_OUI_TYPE_WFA_P2P 9 1791#define WLAN_OUI_TYPE_WFA_P2P 9
1792#define WLAN_OUI_MICROSOFT 0x0050f2
1793#define WLAN_OUI_TYPE_MICROSOFT_WPA 1
1794#define WLAN_OUI_TYPE_MICROSOFT_WMM 2
1795#define WLAN_OUI_TYPE_MICROSOFT_WPS 4
1592 1796
1593/* 1797/*
1594 * WMM/802.11e Tspec Element 1798 * WMM/802.11e Tspec Element
diff --git a/include/linux/if.h b/include/linux/if.h
index f995c663c493..1ec407b01e46 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -81,6 +81,8 @@
81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ 81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
82#define IFF_TEAM_PORT 0x40000 /* device used as team port */ 82#define IFF_TEAM_PORT 0x40000 /* device used as team port */
83#define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */ 83#define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */
84#define IFF_LIVE_ADDR_CHANGE 0x100000 /* device supports hardware address
85 * change when it's running */
84 86
85 87
86#define IF_GET_IFACE 0x0001 /* for querying only */ 88#define IF_GET_IFACE 0x0001 /* for querying only */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 56d907a2c804..167ce5b363d2 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -105,7 +105,8 @@
105#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ 105#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
106#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ 106#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
107#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ 107#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
108#define ETH_P_CAN 0x000C /* Controller Area Network */ 108#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */
109#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
109#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ 110#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
110#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ 111#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
111#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ 112#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index f715750d0b87..ac173bd2ab65 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -140,6 +140,8 @@ enum {
140 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */ 140 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
141 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */ 141 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
142#define IFLA_PROMISCUITY IFLA_PROMISCUITY 142#define IFLA_PROMISCUITY IFLA_PROMISCUITY
143 IFLA_NUM_TX_QUEUES,
144 IFLA_NUM_RX_QUEUES,
143 __IFLA_MAX 145 __IFLA_MAX
144}; 146};
145 147
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 8185f57a9c7f..6960fc1841a7 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -13,6 +13,9 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/netpoll.h>
17#include <net/sch_generic.h>
18
16struct team_pcpu_stats { 19struct team_pcpu_stats {
17 u64 rx_packets; 20 u64 rx_packets;
18 u64 rx_bytes; 21 u64 rx_bytes;
@@ -60,9 +63,54 @@ struct team_port {
60 unsigned int mtu; 63 unsigned int mtu;
61 } orig; 64 } orig;
62 65
63 struct rcu_head rcu; 66#ifdef CONFIG_NET_POLL_CONTROLLER
67 struct netpoll *np;
68#endif
69
70 long mode_priv[0];
64}; 71};
65 72
73static inline bool team_port_enabled(struct team_port *port)
74{
75 return port->index != -1;
76}
77
78static inline bool team_port_txable(struct team_port *port)
79{
80 return port->linkup && team_port_enabled(port);
81}
82
83#ifdef CONFIG_NET_POLL_CONTROLLER
84static inline void team_netpoll_send_skb(struct team_port *port,
85 struct sk_buff *skb)
86{
87 struct netpoll *np = port->np;
88
89 if (np)
90 netpoll_send_skb(np, skb);
91}
92#else
93static inline void team_netpoll_send_skb(struct team_port *port,
94 struct sk_buff *skb)
95{
96}
97#endif
98
99static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
100 struct sk_buff *skb)
101{
102 BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
103 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
104 skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
105
106 skb->dev = port->dev;
107 if (unlikely(netpoll_tx_running(port->dev))) {
108 team_netpoll_send_skb(port, skb);
109 return 0;
110 }
111 return dev_queue_xmit(skb);
112}
113
66struct team_mode_ops { 114struct team_mode_ops {
67 int (*init)(struct team *team); 115 int (*init)(struct team *team);
68 void (*exit)(struct team *team); 116 void (*exit)(struct team *team);
@@ -73,6 +121,8 @@ struct team_mode_ops {
73 int (*port_enter)(struct team *team, struct team_port *port); 121 int (*port_enter)(struct team *team, struct team_port *port);
74 void (*port_leave)(struct team *team, struct team_port *port); 122 void (*port_leave)(struct team *team, struct team_port *port);
75 void (*port_change_mac)(struct team *team, struct team_port *port); 123 void (*port_change_mac)(struct team *team, struct team_port *port);
124 void (*port_enabled)(struct team *team, struct team_port *port);
125 void (*port_disabled)(struct team *team, struct team_port *port);
76}; 126};
77 127
78enum team_option_type { 128enum team_option_type {
@@ -82,6 +132,11 @@ enum team_option_type {
82 TEAM_OPTION_TYPE_BOOL, 132 TEAM_OPTION_TYPE_BOOL,
83}; 133};
84 134
135struct team_option_inst_info {
136 u32 array_index;
137 struct team_port *port; /* != NULL if per-port */
138};
139
85struct team_gsetter_ctx { 140struct team_gsetter_ctx {
86 union { 141 union {
87 u32 u32_val; 142 u32 u32_val;
@@ -92,23 +147,28 @@ struct team_gsetter_ctx {
92 } bin_val; 147 } bin_val;
93 bool bool_val; 148 bool bool_val;
94 } data; 149 } data;
95 struct team_port *port; 150 struct team_option_inst_info *info;
96}; 151};
97 152
98struct team_option { 153struct team_option {
99 struct list_head list; 154 struct list_head list;
100 const char *name; 155 const char *name;
101 bool per_port; 156 bool per_port;
157 unsigned int array_size; /* != 0 means the option is array */
102 enum team_option_type type; 158 enum team_option_type type;
159 int (*init)(struct team *team, struct team_option_inst_info *info);
103 int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); 160 int (*getter)(struct team *team, struct team_gsetter_ctx *ctx);
104 int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); 161 int (*setter)(struct team *team, struct team_gsetter_ctx *ctx);
105}; 162};
106 163
164extern void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info);
165extern void team_options_change_check(struct team *team);
166
107struct team_mode { 167struct team_mode {
108 struct list_head list;
109 const char *kind; 168 const char *kind;
110 struct module *owner; 169 struct module *owner;
111 size_t priv_size; 170 size_t priv_size;
171 size_t port_priv_size;
112 const struct team_mode_ops *ops; 172 const struct team_mode_ops *ops;
113}; 173};
114 174
@@ -178,8 +238,11 @@ extern int team_options_register(struct team *team,
178extern void team_options_unregister(struct team *team, 238extern void team_options_unregister(struct team *team,
179 const struct team_option *option, 239 const struct team_option *option,
180 size_t option_count); 240 size_t option_count);
181extern int team_mode_register(struct team_mode *mode); 241extern int team_mode_register(const struct team_mode *mode);
182extern int team_mode_unregister(struct team_mode *mode); 242extern void team_mode_unregister(const struct team_mode *mode);
243
244#define TEAM_DEFAULT_NUM_TX_QUEUES 16
245#define TEAM_DEFAULT_NUM_RX_QUEUES 16
183 246
184#endif /* __KERNEL__ */ 247#endif /* __KERNEL__ */
185 248
@@ -241,6 +304,7 @@ enum {
241 TEAM_ATTR_OPTION_DATA, /* dynamic */ 304 TEAM_ATTR_OPTION_DATA, /* dynamic */
242 TEAM_ATTR_OPTION_REMOVED, /* flag */ 305 TEAM_ATTR_OPTION_REMOVED, /* flag */
243 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */ 306 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
307 TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
244 308
245 __TEAM_ATTR_OPTION_MAX, 309 __TEAM_ATTR_OPTION_MAX,
246 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, 310 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 16b92d008bed..5efff60b6f56 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -80,4 +80,18 @@ enum {
80 80
81#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) 81#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1)
82 82
83/* VTI-mode i_flags */
84#define VTI_ISVTI 0x0001
85
86enum {
87 IFLA_VTI_UNSPEC,
88 IFLA_VTI_LINK,
89 IFLA_VTI_IKEY,
90 IFLA_VTI_OKEY,
91 IFLA_VTI_LOCAL,
92 IFLA_VTI_REMOTE,
93 __IFLA_VTI_MAX,
94};
95
96#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
83#endif /* _IF_TUNNEL_H_ */ 97#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 597f4a9f3240..67f9ddacb70c 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -38,6 +38,7 @@ enum
38 IPV4_DEVCONF_ACCEPT_LOCAL, 38 IPV4_DEVCONF_ACCEPT_LOCAL,
39 IPV4_DEVCONF_SRC_VMARK, 39 IPV4_DEVCONF_SRC_VMARK,
40 IPV4_DEVCONF_PROXY_ARP_PVLAN, 40 IPV4_DEVCONF_PROXY_ARP_PVLAN,
41 IPV4_DEVCONF_ROUTE_LOCALNET,
41 __IPV4_DEVCONF_MAX 42 __IPV4_DEVCONF_MAX
42}; 43};
43 44
@@ -131,6 +132,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
131#define IN_DEV_PROMOTE_SECONDARIES(in_dev) \ 132#define IN_DEV_PROMOTE_SECONDARIES(in_dev) \
132 IN_DEV_ORCONF((in_dev), \ 133 IN_DEV_ORCONF((in_dev), \
133 PROMOTE_SECONDARIES) 134 PROMOTE_SECONDARIES)
135#define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET)
134 136
135#define IN_DEV_RX_REDIRECTS(in_dev) \ 137#define IN_DEV_RX_REDIRECTS(in_dev) \
136 ((IN_DEV_FORWARD(in_dev) && \ 138 ((IN_DEV_FORWARD(in_dev) && \
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 9e65eff6af3b..8a7476186990 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -168,8 +168,8 @@ extern struct cred init_cred;
168 .children = LIST_HEAD_INIT(tsk.children), \ 168 .children = LIST_HEAD_INIT(tsk.children), \
169 .sibling = LIST_HEAD_INIT(tsk.sibling), \ 169 .sibling = LIST_HEAD_INIT(tsk.sibling), \
170 .group_leader = &tsk, \ 170 .group_leader = &tsk, \
171 RCU_INIT_POINTER(.real_cred, &init_cred), \ 171 RCU_POINTER_INITIALIZER(real_cred, &init_cred), \
172 RCU_INIT_POINTER(.cred, &init_cred), \ 172 RCU_POINTER_INITIALIZER(cred, &init_cred), \
173 .comm = INIT_TASK_COMM, \ 173 .comm = INIT_TASK_COMM, \
174 .thread = INIT_THREAD, \ 174 .thread = INIT_THREAD, \
175 .fs = &init_fs, \ 175 .fs = &init_fs, \
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index e6ca56de9936..78e2ada50cd5 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -308,6 +308,8 @@ enum {
308 308
309struct intel_iommu { 309struct intel_iommu {
310 void __iomem *reg; /* Pointer to hardware regs, virtual addr */ 310 void __iomem *reg; /* Pointer to hardware regs, virtual addr */
311 u64 reg_phys; /* physical address of hw register set */
312 u64 reg_size; /* size of hw register set */
311 u64 cap; 313 u64 cap;
312 u64 ecap; 314 u64 ecap;
313 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ 315 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */
diff --git a/include/linux/io.h b/include/linux/io.h
index 7fd2d2138bf3..069e4075f872 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -67,4 +67,13 @@ int check_signature(const volatile void __iomem *io_addr,
67 const unsigned char *signature, int length); 67 const unsigned char *signature, int length);
68void devm_ioremap_release(struct device *dev, void *res); 68void devm_ioremap_release(struct device *dev, void *res);
69 69
70/*
71 * Some systems do not have legacy ISA devices.
72 * /dev/port is not a valid interface on these systems.
73 * So for those archs, <asm/io.h> should define the following symbol.
74 */
75#ifndef arch_has_dev_port
76#define arch_has_dev_port() (1)
77#endif
78
70#endif /* _LINUX_IO_H */ 79#endif /* _LINUX_IO_H */
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 450293f6d68b..54d6d690073c 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -26,6 +26,7 @@
26#define IOMMU_CACHE (4) /* DMA cache coherency */ 26#define IOMMU_CACHE (4) /* DMA cache coherency */
27 27
28struct iommu_ops; 28struct iommu_ops;
29struct iommu_group;
29struct bus_type; 30struct bus_type;
30struct device; 31struct device;
31struct iommu_domain; 32struct iommu_domain;
@@ -37,16 +38,28 @@ struct iommu_domain;
37typedef int (*iommu_fault_handler_t)(struct iommu_domain *, 38typedef int (*iommu_fault_handler_t)(struct iommu_domain *,
38 struct device *, unsigned long, int, void *); 39 struct device *, unsigned long, int, void *);
39 40
41struct iommu_domain_geometry {
42 dma_addr_t aperture_start; /* First address that can be mapped */
43 dma_addr_t aperture_end; /* Last address that can be mapped */
44 bool force_aperture; /* DMA only allowed in mappable range? */
45};
46
40struct iommu_domain { 47struct iommu_domain {
41 struct iommu_ops *ops; 48 struct iommu_ops *ops;
42 void *priv; 49 void *priv;
43 iommu_fault_handler_t handler; 50 iommu_fault_handler_t handler;
44 void *handler_token; 51 void *handler_token;
52 struct iommu_domain_geometry geometry;
45}; 53};
46 54
47#define IOMMU_CAP_CACHE_COHERENCY 0x1 55#define IOMMU_CAP_CACHE_COHERENCY 0x1
48#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ 56#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
49 57
58enum iommu_attr {
59 DOMAIN_ATTR_MAX,
60 DOMAIN_ATTR_GEOMETRY,
61};
62
50#ifdef CONFIG_IOMMU_API 63#ifdef CONFIG_IOMMU_API
51 64
52/** 65/**
@@ -59,7 +72,10 @@ struct iommu_domain {
59 * @unmap: unmap a physically contiguous memory region from an iommu domain 72 * @unmap: unmap a physically contiguous memory region from an iommu domain
60 * @iova_to_phys: translate iova to physical address 73 * @iova_to_phys: translate iova to physical address
61 * @domain_has_cap: domain capabilities query 74 * @domain_has_cap: domain capabilities query
62 * @commit: commit iommu domain 75 * @add_device: add device to iommu grouping
76 * @remove_device: remove device from iommu grouping
77 * @domain_get_attr: Query domain attributes
78 * @domain_set_attr: Change domain attributes
63 * @pgsize_bitmap: bitmap of supported page sizes 79 * @pgsize_bitmap: bitmap of supported page sizes
64 */ 80 */
65struct iommu_ops { 81struct iommu_ops {
@@ -75,10 +91,23 @@ struct iommu_ops {
75 unsigned long iova); 91 unsigned long iova);
76 int (*domain_has_cap)(struct iommu_domain *domain, 92 int (*domain_has_cap)(struct iommu_domain *domain,
77 unsigned long cap); 93 unsigned long cap);
94 int (*add_device)(struct device *dev);
95 void (*remove_device)(struct device *dev);
78 int (*device_group)(struct device *dev, unsigned int *groupid); 96 int (*device_group)(struct device *dev, unsigned int *groupid);
97 int (*domain_get_attr)(struct iommu_domain *domain,
98 enum iommu_attr attr, void *data);
99 int (*domain_set_attr)(struct iommu_domain *domain,
100 enum iommu_attr attr, void *data);
79 unsigned long pgsize_bitmap; 101 unsigned long pgsize_bitmap;
80}; 102};
81 103
104#define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */
105#define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */
106#define IOMMU_GROUP_NOTIFY_BIND_DRIVER 3 /* Pre Driver bind */
107#define IOMMU_GROUP_NOTIFY_BOUND_DRIVER 4 /* Post Driver bind */
108#define IOMMU_GROUP_NOTIFY_UNBIND_DRIVER 5 /* Pre Driver unbind */
109#define IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER 6 /* Post Driver unbind */
110
82extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); 111extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops);
83extern bool iommu_present(struct bus_type *bus); 112extern bool iommu_present(struct bus_type *bus);
84extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); 113extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
@@ -97,7 +126,34 @@ extern int iommu_domain_has_cap(struct iommu_domain *domain,
97 unsigned long cap); 126 unsigned long cap);
98extern void iommu_set_fault_handler(struct iommu_domain *domain, 127extern void iommu_set_fault_handler(struct iommu_domain *domain,
99 iommu_fault_handler_t handler, void *token); 128 iommu_fault_handler_t handler, void *token);
100extern int iommu_device_group(struct device *dev, unsigned int *groupid); 129
130extern int iommu_attach_group(struct iommu_domain *domain,
131 struct iommu_group *group);
132extern void iommu_detach_group(struct iommu_domain *domain,
133 struct iommu_group *group);
134extern struct iommu_group *iommu_group_alloc(void);
135extern void *iommu_group_get_iommudata(struct iommu_group *group);
136extern void iommu_group_set_iommudata(struct iommu_group *group,
137 void *iommu_data,
138 void (*release)(void *iommu_data));
139extern int iommu_group_set_name(struct iommu_group *group, const char *name);
140extern int iommu_group_add_device(struct iommu_group *group,
141 struct device *dev);
142extern void iommu_group_remove_device(struct device *dev);
143extern int iommu_group_for_each_dev(struct iommu_group *group, void *data,
144 int (*fn)(struct device *, void *));
145extern struct iommu_group *iommu_group_get(struct device *dev);
146extern void iommu_group_put(struct iommu_group *group);
147extern int iommu_group_register_notifier(struct iommu_group *group,
148 struct notifier_block *nb);
149extern int iommu_group_unregister_notifier(struct iommu_group *group,
150 struct notifier_block *nb);
151extern int iommu_group_id(struct iommu_group *group);
152
153extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr,
154 void *data);
155extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr,
156 void *data);
101 157
102/** 158/**
103 * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework 159 * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework
@@ -142,6 +198,7 @@ static inline int report_iommu_fault(struct iommu_domain *domain,
142#else /* CONFIG_IOMMU_API */ 198#else /* CONFIG_IOMMU_API */
143 199
144struct iommu_ops {}; 200struct iommu_ops {};
201struct iommu_group {};
145 202
146static inline bool iommu_present(struct bus_type *bus) 203static inline bool iommu_present(struct bus_type *bus)
147{ 204{
@@ -197,11 +254,88 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain,
197{ 254{
198} 255}
199 256
200static inline int iommu_device_group(struct device *dev, unsigned int *groupid) 257int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group)
258{
259 return -ENODEV;
260}
261
262void iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group)
263{
264}
265
266struct iommu_group *iommu_group_alloc(void)
267{
268 return ERR_PTR(-ENODEV);
269}
270
271void *iommu_group_get_iommudata(struct iommu_group *group)
272{
273 return NULL;
274}
275
276void iommu_group_set_iommudata(struct iommu_group *group, void *iommu_data,
277 void (*release)(void *iommu_data))
278{
279}
280
281int iommu_group_set_name(struct iommu_group *group, const char *name)
282{
283 return -ENODEV;
284}
285
286int iommu_group_add_device(struct iommu_group *group, struct device *dev)
287{
288 return -ENODEV;
289}
290
291void iommu_group_remove_device(struct device *dev)
292{
293}
294
295int iommu_group_for_each_dev(struct iommu_group *group, void *data,
296 int (*fn)(struct device *, void *))
297{
298 return -ENODEV;
299}
300
301struct iommu_group *iommu_group_get(struct device *dev)
302{
303 return NULL;
304}
305
306void iommu_group_put(struct iommu_group *group)
307{
308}
309
310int iommu_group_register_notifier(struct iommu_group *group,
311 struct notifier_block *nb)
201{ 312{
202 return -ENODEV; 313 return -ENODEV;
203} 314}
204 315
316int iommu_group_unregister_notifier(struct iommu_group *group,
317 struct notifier_block *nb)
318{
319 return 0;
320}
321
322int iommu_group_id(struct iommu_group *group)
323{
324 return -ENODEV;
325}
326
327static inline int iommu_domain_get_attr(struct iommu_domain *domain,
328 enum iommu_attr attr, void *data)
329{
330 return -EINVAL;
331}
332
333static inline int iommu_domain_set_attr(struct iommu_domain *domain,
334 enum iommu_attr attr, void *data)
335{
336 return -EINVAL;
337}
338
205#endif /* CONFIG_IOMMU_API */ 339#endif /* CONFIG_IOMMU_API */
206 340
207#endif /* __LINUX_IOMMU_H */ 341#endif /* __LINUX_IOMMU_H */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 8260ef779762..379e433e15e0 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -299,9 +299,9 @@ struct ipv6_pinfo {
299 struct in6_addr rcv_saddr; 299 struct in6_addr rcv_saddr;
300 struct in6_addr daddr; 300 struct in6_addr daddr;
301 struct in6_pktinfo sticky_pktinfo; 301 struct in6_pktinfo sticky_pktinfo;
302 struct in6_addr *daddr_cache; 302 const struct in6_addr *daddr_cache;
303#ifdef CONFIG_IPV6_SUBTREES 303#ifdef CONFIG_IPV6_SUBTREES
304 struct in6_addr *saddr_cache; 304 const struct in6_addr *saddr_cache;
305#endif 305#endif
306 306
307 __be32 flow_label; 307 __be32 flow_label;
@@ -410,6 +410,22 @@ struct tcp6_sock {
410 410
411extern int inet6_sk_rebuild_header(struct sock *sk); 411extern int inet6_sk_rebuild_header(struct sock *sk);
412 412
413struct inet6_timewait_sock {
414 struct in6_addr tw_v6_daddr;
415 struct in6_addr tw_v6_rcv_saddr;
416};
417
418struct tcp6_timewait_sock {
419 struct tcp_timewait_sock tcp6tw_tcp;
420 struct inet6_timewait_sock tcp6tw_inet6;
421};
422
423static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
424{
425 return (struct inet6_timewait_sock *)(((u8 *)sk) +
426 inet_twsk(sk)->tw_ipv6_offset);
427}
428
413#if IS_ENABLED(CONFIG_IPV6) 429#if IS_ENABLED(CONFIG_IPV6)
414static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 430static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
415{ 431{
@@ -459,28 +475,12 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
459#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 475#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
460#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 476#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
461 477
462struct inet6_timewait_sock {
463 struct in6_addr tw_v6_daddr;
464 struct in6_addr tw_v6_rcv_saddr;
465};
466
467struct tcp6_timewait_sock {
468 struct tcp_timewait_sock tcp6tw_tcp;
469 struct inet6_timewait_sock tcp6tw_inet6;
470};
471
472static inline u16 inet6_tw_offset(const struct proto *prot) 478static inline u16 inet6_tw_offset(const struct proto *prot)
473{ 479{
474 return prot->twsk_prot->twsk_obj_size - 480 return prot->twsk_prot->twsk_obj_size -
475 sizeof(struct inet6_timewait_sock); 481 sizeof(struct inet6_timewait_sock);
476} 482}
477 483
478static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
479{
480 return (struct inet6_timewait_sock *)(((u8 *)sk) +
481 inet_twsk(sk)->tw_ipv6_offset);
482}
483
484static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk) 484static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk)
485{ 485{
486 return likely(sk->sk_state != TCP_TIME_WAIT) ? 486 return likely(sk->sk_state != TCP_TIME_WAIT) ?
diff --git a/include/linux/irq.h b/include/linux/irq.h
index a5261e3d2e3c..553fb66da130 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -150,9 +150,7 @@ struct irq_data {
150 void *handler_data; 150 void *handler_data;
151 void *chip_data; 151 void *chip_data;
152 struct msi_desc *msi_desc; 152 struct msi_desc *msi_desc;
153#ifdef CONFIG_SMP
154 cpumask_var_t affinity; 153 cpumask_var_t affinity;
155#endif
156}; 154};
157 155
158/* 156/*
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index c513a40510f5..0976fc46d1e0 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -42,8 +42,7 @@
42 * allowed. 42 * allowed.
43 * 43 *
44 * Not initializing the key (static data is initialized to 0s anyway) is the 44 * Not initializing the key (static data is initialized to 0s anyway) is the
45 * same as using STATIC_KEY_INIT_FALSE and static_key_false() is 45 * same as using STATIC_KEY_INIT_FALSE.
46 * equivalent with static_branch().
47 * 46 *
48*/ 47*/
49 48
@@ -107,12 +106,6 @@ static __always_inline bool static_key_true(struct static_key *key)
107 return !static_key_false(key); 106 return !static_key_false(key);
108} 107}
109 108
110/* Deprecated. Please use 'static_key_false() instead. */
111static __always_inline bool static_branch(struct static_key *key)
112{
113 return arch_static_branch(key);
114}
115
116extern struct jump_entry __start___jump_table[]; 109extern struct jump_entry __start___jump_table[];
117extern struct jump_entry __stop___jump_table[]; 110extern struct jump_entry __stop___jump_table[];
118 111
@@ -166,14 +159,6 @@ static __always_inline bool static_key_true(struct static_key *key)
166 return false; 159 return false;
167} 160}
168 161
169/* Deprecated. Please use 'static_key_false() instead. */
170static __always_inline bool static_branch(struct static_key *key)
171{
172 if (unlikely(atomic_read(&key->enabled)) > 0)
173 return true;
174 return false;
175}
176
177static inline void static_key_slow_inc(struct static_key *key) 162static inline void static_key_slow_inc(struct static_key *key)
178{ 163{
179 atomic_inc(&key->enabled); 164 atomic_inc(&key->enabled);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e07f5e0c5df4..604382143bcf 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -377,7 +377,6 @@ extern enum system_states {
377 SYSTEM_HALT, 377 SYSTEM_HALT,
378 SYSTEM_POWER_OFF, 378 SYSTEM_POWER_OFF,
379 SYSTEM_RESTART, 379 SYSTEM_RESTART,
380 SYSTEM_SUSPEND_DISK,
381} system_state; 380} system_state;
382 381
383#define TAINT_PROPRIETARY_MODULE 0 382#define TAINT_PROPRIETARY_MODULE 0
diff --git a/include/linux/key.h b/include/linux/key.h
index 4cd22ed627ef..cef3b315ba7c 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -303,7 +303,9 @@ static inline bool key_is_instantiated(const struct key *key)
303 rwsem_is_locked(&((struct key *)(KEY))->sem))) 303 rwsem_is_locked(&((struct key *)(KEY))->sem)))
304 304
305#define rcu_assign_keypointer(KEY, PAYLOAD) \ 305#define rcu_assign_keypointer(KEY, PAYLOAD) \
306 (rcu_assign_pointer((KEY)->payload.rcudata, PAYLOAD)) 306do { \
307 rcu_assign_pointer((KEY)->payload.rcudata, (PAYLOAD)); \
308} while (0)
307 309
308#ifdef CONFIG_SYSCTL 310#ifdef CONFIG_SYSCTL
309extern ctl_table key_sysctls[]; 311extern ctl_table key_sysctls[];
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h
index d6bd50110ec2..2e7a1e032c71 100644
--- a/include/linux/kmsg_dump.h
+++ b/include/linux/kmsg_dump.h
@@ -55,12 +55,17 @@ struct kmsg_dumper {
55#ifdef CONFIG_PRINTK 55#ifdef CONFIG_PRINTK
56void kmsg_dump(enum kmsg_dump_reason reason); 56void kmsg_dump(enum kmsg_dump_reason reason);
57 57
58bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog,
59 char *line, size_t size, size_t *len);
60
58bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, 61bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog,
59 char *line, size_t size, size_t *len); 62 char *line, size_t size, size_t *len);
60 63
61bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, 64bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog,
62 char *buf, size_t size, size_t *len); 65 char *buf, size_t size, size_t *len);
63 66
67void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper);
68
64void kmsg_dump_rewind(struct kmsg_dumper *dumper); 69void kmsg_dump_rewind(struct kmsg_dumper *dumper);
65 70
66int kmsg_dump_register(struct kmsg_dumper *dumper); 71int kmsg_dump_register(struct kmsg_dumper *dumper);
@@ -71,6 +76,13 @@ static inline void kmsg_dump(enum kmsg_dump_reason reason)
71{ 76{
72} 77}
73 78
79static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper,
80 bool syslog, const char *line,
81 size_t size, size_t *len)
82{
83 return false;
84}
85
74static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, 86static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog,
75 const char *line, size_t size, size_t *len) 87 const char *line, size_t size, size_t *len)
76{ 88{
@@ -83,6 +95,10 @@ static inline bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog,
83 return false; 95 return false;
84} 96}
85 97
98static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper)
99{
100}
101
86static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper) 102static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper)
87{ 103{
88} 104}
diff --git a/include/linux/ks8851_mll.h b/include/linux/ks8851_mll.h
new file mode 100644
index 000000000000..e9ccfb59ed30
--- /dev/null
+++ b/include/linux/ks8851_mll.h
@@ -0,0 +1,33 @@
1/*
2 * ks8861_mll platform data struct definition
3 * Copyright (c) 2012 BTicino S.p.A.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef _LINUX_KS8851_MLL_H
20#define _LINUX_KS8851_MLL_H
21
22#include <linux/if_ether.h>
23
24/**
25 * struct ks8851_mll_platform_data - Platform data of the KS8851_MLL network driver
26 * @macaddr: The MAC address of the device, set to all 0:s to use the on in
27 * the chip.
28 */
29struct ks8851_mll_platform_data {
30 u8 mac_addr[ETH_ALEN];
31};
32
33#endif
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 0714b24c0e45..22ccf9dee177 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -49,8 +49,6 @@ extern int tsk_fork_get_node(struct task_struct *tsk);
49 * can be queued and flushed using queue/flush_kthread_work() 49 * can be queued and flushed using queue/flush_kthread_work()
50 * respectively. Queued kthread_works are processed by a kthread 50 * respectively. Queued kthread_works are processed by a kthread
51 * running kthread_worker_fn(). 51 * running kthread_worker_fn().
52 *
53 * A kthread_work can't be freed while it is executing.
54 */ 52 */
55struct kthread_work; 53struct kthread_work;
56typedef void (*kthread_work_func_t)(struct kthread_work *work); 54typedef void (*kthread_work_func_t)(struct kthread_work *work);
@@ -59,15 +57,14 @@ struct kthread_worker {
59 spinlock_t lock; 57 spinlock_t lock;
60 struct list_head work_list; 58 struct list_head work_list;
61 struct task_struct *task; 59 struct task_struct *task;
60 struct kthread_work *current_work;
62}; 61};
63 62
64struct kthread_work { 63struct kthread_work {
65 struct list_head node; 64 struct list_head node;
66 kthread_work_func_t func; 65 kthread_work_func_t func;
67 wait_queue_head_t done; 66 wait_queue_head_t done;
68 atomic_t flushing; 67 struct kthread_worker *worker;
69 int queue_seq;
70 int done_seq;
71}; 68};
72 69
73#define KTHREAD_WORKER_INIT(worker) { \ 70#define KTHREAD_WORKER_INIT(worker) { \
@@ -79,7 +76,6 @@ struct kthread_work {
79 .node = LIST_HEAD_INIT((work).node), \ 76 .node = LIST_HEAD_INIT((work).node), \
80 .func = (fn), \ 77 .func = (fn), \
81 .done = __WAIT_QUEUE_HEAD_INITIALIZER((work).done), \ 78 .done = __WAIT_QUEUE_HEAD_INITIALIZER((work).done), \
82 .flushing = ATOMIC_INIT(0), \
83 } 79 }
84 80
85#define DEFINE_KTHREAD_WORKER(worker) \ 81#define DEFINE_KTHREAD_WORKER(worker) \
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 09f2b3aa2da7..2ce09aa7d3b3 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -617,6 +617,7 @@ struct kvm_ppc_smmu_info {
617#define KVM_CAP_SIGNAL_MSI 77 617#define KVM_CAP_SIGNAL_MSI 77
618#define KVM_CAP_PPC_GET_SMMU_INFO 78 618#define KVM_CAP_PPC_GET_SMMU_INFO 78
619#define KVM_CAP_S390_COW 79 619#define KVM_CAP_S390_COW 79
620#define KVM_CAP_PPC_ALLOC_HTAB 80
620 621
621#ifdef KVM_CAP_IRQ_ROUTING 622#ifdef KVM_CAP_IRQ_ROUTING
622 623
@@ -828,6 +829,8 @@ struct kvm_s390_ucas_mapping {
828#define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi) 829#define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi)
829/* Available with KVM_CAP_PPC_GET_SMMU_INFO */ 830/* Available with KVM_CAP_PPC_GET_SMMU_INFO */
830#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) 831#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info)
832/* Available with KVM_CAP_PPC_ALLOC_HTAB */
833#define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32)
831 834
832/* 835/*
833 * ioctls for vcpu fds 836 * ioctls for vcpu fds
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 96c158a37d3e..b70b48b01098 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -306,7 +306,7 @@ struct kvm {
306 struct hlist_head irq_ack_notifier_list; 306 struct hlist_head irq_ack_notifier_list;
307#endif 307#endif
308 308
309#ifdef KVM_ARCH_WANT_MMU_NOTIFIER 309#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
310 struct mmu_notifier mmu_notifier; 310 struct mmu_notifier mmu_notifier;
311 unsigned long mmu_notifier_seq; 311 unsigned long mmu_notifier_seq;
312 long mmu_notifier_count; 312 long mmu_notifier_count;
@@ -314,13 +314,19 @@ struct kvm {
314 long tlbs_dirty; 314 long tlbs_dirty;
315}; 315};
316 316
317/* The guest did something we don't support. */ 317#define kvm_err(fmt, ...) \
318#define pr_unimpl(vcpu, fmt, ...) \ 318 pr_err("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
319 pr_err_ratelimited("kvm: %i: cpu%i " fmt, \ 319#define kvm_info(fmt, ...) \
320 current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__) 320 pr_info("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
321#define kvm_debug(fmt, ...) \
322 pr_debug("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__)
323#define kvm_pr_unimpl(fmt, ...) \
324 pr_err_ratelimited("kvm [%i]: " fmt, \
325 task_tgid_nr(current), ## __VA_ARGS__)
321 326
322#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) 327/* The guest did something we don't support. */
323#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) 328#define vcpu_unimpl(vcpu, fmt, ...) \
329 kvm_pr_unimpl("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__)
324 330
325static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) 331static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
326{ 332{
@@ -535,6 +541,9 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
535 541
536void kvm_free_physmem(struct kvm *kvm); 542void kvm_free_physmem(struct kvm *kvm);
537 543
544void *kvm_kvzalloc(unsigned long size);
545void kvm_kvfree(const void *addr);
546
538#ifndef __KVM_HAVE_ARCH_VM_ALLOC 547#ifndef __KVM_HAVE_ARCH_VM_ALLOC
539static inline struct kvm *kvm_arch_alloc_vm(void) 548static inline struct kvm *kvm_arch_alloc_vm(void)
540{ 549{
@@ -771,7 +780,7 @@ struct kvm_stats_debugfs_item {
771extern struct kvm_stats_debugfs_item debugfs_entries[]; 780extern struct kvm_stats_debugfs_item debugfs_entries[];
772extern struct dentry *kvm_debugfs_dir; 781extern struct dentry *kvm_debugfs_dir;
773 782
774#ifdef KVM_ARCH_WANT_MMU_NOTIFIER 783#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
775static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) 784static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq)
776{ 785{
777 if (unlikely(vcpu->kvm->mmu_notifier_count)) 786 if (unlikely(vcpu->kvm->mmu_notifier_count))
@@ -793,7 +802,7 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se
793} 802}
794#endif 803#endif
795 804
796#ifdef CONFIG_HAVE_KVM_IRQCHIP 805#ifdef KVM_CAP_IRQ_ROUTING
797 806
798#define KVM_MAX_IRQ_ROUTES 1024 807#define KVM_MAX_IRQ_ROUTES 1024
799 808
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 6e887c742a27..53da442f892d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -846,6 +846,8 @@ struct ata_port_operations {
846 void (*error_handler)(struct ata_port *ap); 846 void (*error_handler)(struct ata_port *ap);
847 void (*lost_interrupt)(struct ata_port *ap); 847 void (*lost_interrupt)(struct ata_port *ap);
848 void (*post_internal_cmd)(struct ata_queued_cmd *qc); 848 void (*post_internal_cmd)(struct ata_queued_cmd *qc);
849 void (*sched_eh)(struct ata_port *ap);
850 void (*end_eh)(struct ata_port *ap);
849 851
850 /* 852 /*
851 * Optional features 853 * Optional features
@@ -1167,6 +1169,8 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
1167 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 1169 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
1168 ata_postreset_fn_t postreset); 1170 ata_postreset_fn_t postreset);
1169extern void ata_std_error_handler(struct ata_port *ap); 1171extern void ata_std_error_handler(struct ata_port *ap);
1172extern void ata_std_sched_eh(struct ata_port *ap);
1173extern void ata_std_end_eh(struct ata_port *ap);
1170extern int ata_link_nr_enabled(struct ata_link *link); 1174extern int ata_link_nr_enabled(struct ata_link *link);
1171 1175
1172/* 1176/*
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index dfb947959ec9..7cccafe50e7b 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -43,7 +43,11 @@
43#define MDIO_PKGID2 15 43#define MDIO_PKGID2 15
44#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */ 44#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */
45#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */ 45#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */
46#define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */
47#define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */
46#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */ 48#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */
49#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
50#define MDIO_AN_EEE_LPABLE 61 /* EEE link partner ability */
47 51
48/* Media-dependent registers. */ 52/* Media-dependent registers. */
49#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */ 53#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */
@@ -56,7 +60,6 @@
56#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ 60#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */
57#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ 61#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */
58#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ 62#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */
59#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
60 63
61/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ 64/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
62#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ 65#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
@@ -82,6 +85,7 @@
82#define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART 85#define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART
83#define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE 86#define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE
84#define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */ 87#define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */
88#define MDIO_PCS_CTRL1_CLKSTOP_EN 0x400 /* Stop the clock during LPI */
85 89
86/* 10 Gb/s */ 90/* 10 Gb/s */
87#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00) 91#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)
@@ -237,9 +241,25 @@
237#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ 241#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */
238#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ 242#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */
239 243
240/* AN EEE Advertisement register. */ 244/* EEE Supported/Advertisement/LP Advertisement registers.
241#define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */ 245 *
242#define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */ 246 * EEE capability Register (3.20), Advertisement (7.60) and
247 * Link partner ability (7.61) registers have and can use the same identical
248 * bit masks.
249 */
250#define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */
251#define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */
252/* Note: the two defines above can be potentially used by the user-land
253 * and cannot remove them now.
254 * So, we define the new generic MDIO_EEE_100TX and MDIO_EEE_1000T macros
255 * using the previous ones (that can be considered obsolete).
256 */
257#define MDIO_EEE_100TX MDIO_AN_EEE_ADV_100TX /* 100TX EEE cap */
258#define MDIO_EEE_1000T MDIO_AN_EEE_ADV_1000T /* 1000T EEE cap */
259#define MDIO_EEE_10GT 0x0008 /* 10GT EEE cap */
260#define MDIO_EEE_1000KX 0x0010 /* 1000KX EEE cap */
261#define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */
262#define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */
243 263
244/* LASI RX_ALARM control/status registers. */ 264/* LASI RX_ALARM control/status registers. */
245#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ 265#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index a6bb10235148..19dc455b4f3d 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -50,9 +50,7 @@ phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end,
50 phys_addr_t size, phys_addr_t align, int nid); 50 phys_addr_t size, phys_addr_t align, int nid);
51phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, 51phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end,
52 phys_addr_t size, phys_addr_t align); 52 phys_addr_t size, phys_addr_t align);
53int memblock_free_reserved_regions(void); 53phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr);
54int memblock_reserve_reserved_regions(void);
55
56void memblock_allow_resize(void); 54void memblock_allow_resize(void);
57int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); 55int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid);
58int memblock_add(phys_addr_t base, phys_addr_t size); 56int memblock_add(phys_addr_t base, phys_addr_t size);
diff --git a/include/linux/mfd/abx500/ab8500-codec.h b/include/linux/mfd/abx500/ab8500-codec.h
new file mode 100644
index 000000000000..dc6529202cdd
--- /dev/null
+++ b/include/linux/mfd/abx500/ab8500-codec.h
@@ -0,0 +1,52 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2012
3 *
4 * Author: Ola Lilja <ola.o.lilja@stericsson.com>
5 * for ST-Ericsson.
6 *
7 * License terms:
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
12 */
13
14#ifndef AB8500_CORE_CODEC_H
15#define AB8500_CORE_CODEC_H
16
17/* Mic-types */
18enum amic_type {
19 AMIC_TYPE_SINGLE_ENDED,
20 AMIC_TYPE_DIFFERENTIAL
21};
22
23/* Mic-biases */
24enum amic_micbias {
25 AMIC_MICBIAS_VAMIC1,
26 AMIC_MICBIAS_VAMIC2
27};
28
29/* Bias-voltage */
30enum ear_cm_voltage {
31 EAR_CMV_0_95V,
32 EAR_CMV_1_10V,
33 EAR_CMV_1_27V,
34 EAR_CMV_1_58V
35};
36
37/* Analog microphone settings */
38struct amic_settings {
39 enum amic_type mic1_type;
40 enum amic_type mic2_type;
41 enum amic_micbias mic1a_micbias;
42 enum amic_micbias mic1b_micbias;
43 enum amic_micbias mic2_micbias;
44};
45
46/* Platform data structure for the audio-parts of the AB8500 */
47struct ab8500_codec_platform_data {
48 struct amic_settings amics;
49 enum ear_cm_voltage ear_cmv;
50};
51
52#endif
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 91dd3ef63e99..bc9b84b60ec6 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -266,6 +266,7 @@ struct ab8500 {
266struct regulator_reg_init; 266struct regulator_reg_init;
267struct regulator_init_data; 267struct regulator_init_data;
268struct ab8500_gpio_platform_data; 268struct ab8500_gpio_platform_data;
269struct ab8500_codec_platform_data;
269 270
270/** 271/**
271 * struct ab8500_platform_data - AB8500 platform data 272 * struct ab8500_platform_data - AB8500 platform data
@@ -284,6 +285,7 @@ struct ab8500_platform_data {
284 int num_regulator; 285 int num_regulator;
285 struct regulator_init_data *regulator; 286 struct regulator_init_data *regulator;
286 struct ab8500_gpio_platform_data *gpio; 287 struct ab8500_gpio_platform_data *gpio;
288 struct ab8500_codec_platform_data *codec;
287}; 289};
288 290
289extern int __devinit ab8500_init(struct ab8500 *ab8500, 291extern int __devinit ab8500_init(struct ab8500 *ab8500,
diff --git a/include/linux/mfd/s5m87xx/s5m-core.h b/include/linux/mfd/s5m87xx/s5m-core.h
index 21603b42f22f..0b2e0ed309f5 100644
--- a/include/linux/mfd/s5m87xx/s5m-core.h
+++ b/include/linux/mfd/s5m87xx/s5m-core.h
@@ -347,6 +347,7 @@ struct s5m_platform_data {
347 bool buck_voltage_lock; 347 bool buck_voltage_lock;
348 348
349 int buck_gpios[3]; 349 int buck_gpios[3];
350 int buck_ds[3];
350 int buck2_voltage[8]; 351 int buck2_voltage[8];
351 bool buck2_gpiodvs; 352 bool buck2_gpiodvs;
352 int buck3_voltage[8]; 353 int buck3_voltage[8];
@@ -369,6 +370,10 @@ struct s5m_platform_data {
369 bool buck2_ramp_enable; 370 bool buck2_ramp_enable;
370 bool buck3_ramp_enable; 371 bool buck3_ramp_enable;
371 bool buck4_ramp_enable; 372 bool buck4_ramp_enable;
373
374 int buck2_init;
375 int buck3_init;
376 int buck4_init;
372}; 377};
373 378
374#endif /* __LINUX_MFD_S5M_CORE_H */ 379#endif /* __LINUX_MFD_S5M_CORE_H */
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index f5171dbf8850..d83af39815ab 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -101,6 +101,7 @@ struct tmio_mmc_host;
101struct tmio_mmc_data { 101struct tmio_mmc_data {
102 unsigned int hclk; 102 unsigned int hclk;
103 unsigned long capabilities; 103 unsigned long capabilities;
104 unsigned long capabilities2;
104 unsigned long flags; 105 unsigned long flags;
105 u32 ocr_mask; /* available voltages */ 106 u32 ocr_mask; /* available voltages */
106 struct tmio_mmc_dma *dma; 107 struct tmio_mmc_dma *dma;
@@ -110,6 +111,9 @@ struct tmio_mmc_data {
110 void (*set_clk_div)(struct platform_device *host, int state); 111 void (*set_clk_div)(struct platform_device *host, int state);
111 int (*get_cd)(struct platform_device *host); 112 int (*get_cd)(struct platform_device *host);
112 int (*write16_hook)(struct tmio_mmc_host *host, int addr); 113 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
114 /* clock management callbacks */
115 int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
116 void (*clk_disable)(struct platform_device *pdev);
113}; 117};
114 118
115/* 119/*
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index e030ef9a64ee..12c06870829a 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -217,7 +217,8 @@ enum tps65217_regulator_id {
217 * Board data may be used to initialize regulator. 217 * Board data may be used to initialize regulator.
218 */ 218 */
219struct tps65217_board { 219struct tps65217_board {
220 struct regulator_init_data *tps65217_init_data; 220 struct regulator_init_data *tps65217_init_data[TPS65217_NUM_REGULATOR];
221 struct device_node *of_node[TPS65217_NUM_REGULATOR];
221}; 222};
222 223
223/** 224/**
@@ -227,11 +228,6 @@ struct tps65217_board {
227 * @max_uV: minimum micro volts 228 * @max_uV: minimum micro volts
228 * @vsel_to_uv: Function pointer to get voltage from selector 229 * @vsel_to_uv: Function pointer to get voltage from selector
229 * @uv_to_vsel: Function pointer to get selector from voltage 230 * @uv_to_vsel: Function pointer to get selector from voltage
230 * @table: Table for non-uniform voltage step-size
231 * @table_len: Length of the voltage table
232 * @enable_mask: Regulator enable mask bits
233 * @set_vout_reg: Regulator output voltage set register
234 * @set_vout_mask: Regulator output voltage set mask
235 * 231 *
236 * This data is used to check the regualtor voltage limits while setting. 232 * This data is used to check the regualtor voltage limits while setting.
237 */ 233 */
@@ -241,11 +237,6 @@ struct tps_info {
241 int max_uV; 237 int max_uV;
242 int (*vsel_to_uv)(unsigned int vsel); 238 int (*vsel_to_uv)(unsigned int vsel);
243 int (*uv_to_vsel)(int uV, unsigned int *vsel); 239 int (*uv_to_vsel)(int uV, unsigned int *vsel);
244 const int *table;
245 unsigned int table_len;
246 unsigned int enable_mask;
247 unsigned int set_vout_reg;
248 unsigned int set_vout_mask;
249}; 240};
250 241
251/** 242/**
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index dd8dc0a6c462..6c4c478e21a4 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -880,4 +880,10 @@ static inline int tps65910_reg_clear_bits(struct tps65910 *tps65910, u8 reg,
880 return regmap_update_bits(tps65910->regmap, reg, mask, 0); 880 return regmap_update_bits(tps65910->regmap, reg, mask, 0);
881} 881}
882 882
883static inline int tps65910_reg_update_bits(struct tps65910 *tps65910, u8 reg,
884 u8 mask, u8 val)
885{
886 return regmap_update_bits(tps65910->regmap, reg, mask, val);
887}
888
883#endif /* __LINUX_MFD_TPS65910_H */ 889#endif /* __LINUX_MFD_TPS65910_H */
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 2783eca629a0..8ef3a7a11592 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -21,6 +21,8 @@
21#define MII_EXPANSION 0x06 /* Expansion register */ 21#define MII_EXPANSION 0x06 /* Expansion register */
22#define MII_CTRL1000 0x09 /* 1000BASE-T control */ 22#define MII_CTRL1000 0x09 /* 1000BASE-T control */
23#define MII_STAT1000 0x0a /* 1000BASE-T status */ 23#define MII_STAT1000 0x0a /* 1000BASE-T status */
24#define MII_MMD_CTRL 0x0d /* MMD Access Control Register */
25#define MII_MMD_DATA 0x0e /* MMD Access Data Register */
24#define MII_ESTATUS 0x0f /* Extended Status */ 26#define MII_ESTATUS 0x0f /* Extended Status */
25#define MII_DCOUNTER 0x12 /* Disconnect counter */ 27#define MII_DCOUNTER 0x12 /* Disconnect counter */
26#define MII_FCSCOUNTER 0x13 /* False carrier counter */ 28#define MII_FCSCOUNTER 0x13 /* False carrier counter */
@@ -141,6 +143,13 @@
141#define FLOW_CTRL_TX 0x01 143#define FLOW_CTRL_TX 0x01
142#define FLOW_CTRL_RX 0x02 144#define FLOW_CTRL_RX 0x02
143 145
146/* MMD Access Control register fields */
147#define MII_MMD_CTRL_DEVAD_MASK 0x1f /* Mask MMD DEVAD*/
148#define MII_MMD_CTRL_ADDR 0x0000 /* Address */
149#define MII_MMD_CTRL_NOINCR 0x4000 /* no post increment */
150#define MII_MMD_CTRL_INCR_RDWT 0x8000 /* post increment on reads & writes */
151#define MII_MMD_CTRL_INCR_ON_WT 0xC000 /* post increment on writes only */
152
144/* This structure is used in all SIOCxMIIxxx ioctl calls */ 153/* This structure is used in all SIOCxMIIxxx ioctl calls */
145struct mii_ioctl_data { 154struct mii_ioctl_data {
146 __u16 phy_id; 155 __u16 phy_id;
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 0549d2115507..e0deeb2cc939 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -35,6 +35,7 @@
35#define MPT_MINOR 220 35#define MPT_MINOR 220
36#define MPT2SAS_MINOR 221 36#define MPT2SAS_MINOR 221
37#define UINPUT_MINOR 223 37#define UINPUT_MINOR 223
38#define MISC_MCELOG_MINOR 227
38#define HPET_MINOR 228 39#define HPET_MINOR 228
39#define FUSE_MINOR 229 40#define FUSE_MINOR 229
40#define KVM_MINOR 232 41#define KVM_MINOR 232
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 1f3860a8a109..260695186256 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -154,6 +154,10 @@ enum {
154 /* set port opcode modifiers */ 154 /* set port opcode modifiers */
155 MLX4_SET_PORT_PRIO2TC = 0x8, 155 MLX4_SET_PORT_PRIO2TC = 0x8,
156 MLX4_SET_PORT_SCHEDULER = 0x9, 156 MLX4_SET_PORT_SCHEDULER = 0x9,
157
158 /* register/delete flow steering network rules */
159 MLX4_QP_FLOW_STEERING_ATTACH = 0x65,
160 MLX4_QP_FLOW_STEERING_DETACH = 0x66,
157}; 161};
158 162
159enum { 163enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 6a8f002b8ed3..bd6c9fcdf2dd 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -36,6 +36,7 @@
36#include <linux/pci.h> 36#include <linux/pci.h>
37#include <linux/completion.h> 37#include <linux/completion.h>
38#include <linux/radix-tree.h> 38#include <linux/radix-tree.h>
39#include <linux/cpu_rmap.h>
39 40
40#include <linux/atomic.h> 41#include <linux/atomic.h>
41 42
@@ -56,6 +57,13 @@ enum {
56 MLX4_MAX_PORTS = 2 57 MLX4_MAX_PORTS = 2
57}; 58};
58 59
60/* base qkey for use in sriov tunnel-qp/proxy-qp communication.
61 * These qkeys must not be allowed for general use. This is a 64k range,
62 * and to test for violation, we use the mask (protect against future chg).
63 */
64#define MLX4_RESERVED_QKEY_BASE (0xFFFF0000)
65#define MLX4_RESERVED_QKEY_MASK (0xFFFF0000)
66
59enum { 67enum {
60 MLX4_BOARD_ID_LEN = 64 68 MLX4_BOARD_ID_LEN = 64
61}; 69};
@@ -70,6 +78,36 @@ enum {
70 MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1) 78 MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1)
71}; 79};
72 80
81/* Driver supports 3 diffrent device methods to manage traffic steering:
82 * -device managed - High level API for ib and eth flow steering. FW is
83 * managing flow steering tables.
84 * - B0 steering mode - Common low level API for ib and (if supported) eth.
85 * - A0 steering mode - Limited low level API for eth. In case of IB,
86 * B0 mode is in use.
87 */
88enum {
89 MLX4_STEERING_MODE_A0,
90 MLX4_STEERING_MODE_B0,
91 MLX4_STEERING_MODE_DEVICE_MANAGED
92};
93
94static inline const char *mlx4_steering_mode_str(int steering_mode)
95{
96 switch (steering_mode) {
97 case MLX4_STEERING_MODE_A0:
98 return "A0 steering";
99
100 case MLX4_STEERING_MODE_B0:
101 return "B0 steering";
102
103 case MLX4_STEERING_MODE_DEVICE_MANAGED:
104 return "Device managed flow steering";
105
106 default:
107 return "Unrecognize steering mode";
108 }
109}
110
73enum { 111enum {
74 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 112 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
75 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 113 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
@@ -96,13 +134,15 @@ enum {
96 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, 134 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
97 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, 135 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42,
98 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, 136 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48,
99 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55 137 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55,
138 MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59,
100}; 139};
101 140
102enum { 141enum {
103 MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0, 142 MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0,
104 MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, 143 MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1,
105 MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2 144 MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2,
145 MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3
106}; 146};
107 147
108#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) 148#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)
@@ -138,6 +178,7 @@ enum mlx4_event {
138 MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18, 178 MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18,
139 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, 179 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b,
140 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, 180 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c,
181 MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d,
141 MLX4_EVENT_TYPE_NONE = 0xff, 182 MLX4_EVENT_TYPE_NONE = 0xff,
142}; 183};
143 184
@@ -235,12 +276,32 @@ enum {
235 MLX4_MAX_FAST_REG_PAGES = 511, 276 MLX4_MAX_FAST_REG_PAGES = 511,
236}; 277};
237 278
279enum {
280 MLX4_DEV_PMC_SUBTYPE_GUID_INFO = 0x14,
281 MLX4_DEV_PMC_SUBTYPE_PORT_INFO = 0x15,
282 MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE = 0x16,
283};
284
285/* Port mgmt change event handling */
286enum {
287 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK = 1 << 0,
288 MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK = 1 << 1,
289 MLX4_EQ_PORT_INFO_LID_CHANGE_MASK = 1 << 2,
290 MLX4_EQ_PORT_INFO_CLIENT_REREG_MASK = 1 << 3,
291 MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4,
292};
293
294#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \
295 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK)
296
238static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 297static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
239{ 298{
240 return (major << 32) | (minor << 16) | subminor; 299 return (major << 32) | (minor << 16) | subminor;
241} 300}
242 301
243struct mlx4_phys_caps { 302struct mlx4_phys_caps {
303 u32 gid_phys_table_len[MLX4_MAX_PORTS + 1];
304 u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1];
244 u32 num_phys_eqs; 305 u32 num_phys_eqs;
245}; 306};
246 307
@@ -273,6 +334,8 @@ struct mlx4_caps {
273 int max_qp_init_rdma; 334 int max_qp_init_rdma;
274 int max_qp_dest_rdma; 335 int max_qp_dest_rdma;
275 int sqp_start; 336 int sqp_start;
337 u32 base_sqpn;
338 u32 base_tunnel_sqpn;
276 int num_srqs; 339 int num_srqs;
277 int max_srq_wqes; 340 int max_srq_wqes;
278 int max_srq_sge; 341 int max_srq_sge;
@@ -295,6 +358,8 @@ struct mlx4_caps {
295 int num_amgms; 358 int num_amgms;
296 int reserved_mcgs; 359 int reserved_mcgs;
297 int num_qp_per_mgm; 360 int num_qp_per_mgm;
361 int steering_mode;
362 int fs_log_max_ucast_qp_range_size;
298 int num_pds; 363 int num_pds;
299 int reserved_pds; 364 int reserved_pds;
300 int max_xrcds; 365 int max_xrcds;
@@ -509,8 +574,85 @@ struct mlx4_dev {
509 u8 rev_id; 574 u8 rev_id;
510 char board_id[MLX4_BOARD_ID_LEN]; 575 char board_id[MLX4_BOARD_ID_LEN];
511 int num_vfs; 576 int num_vfs;
577 u64 regid_promisc_array[MLX4_MAX_PORTS + 1];
578 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1];
512}; 579};
513 580
581struct mlx4_eqe {
582 u8 reserved1;
583 u8 type;
584 u8 reserved2;
585 u8 subtype;
586 union {
587 u32 raw[6];
588 struct {
589 __be32 cqn;
590 } __packed comp;
591 struct {
592 u16 reserved1;
593 __be16 token;
594 u32 reserved2;
595 u8 reserved3[3];
596 u8 status;
597 __be64 out_param;
598 } __packed cmd;
599 struct {
600 __be32 qpn;
601 } __packed qp;
602 struct {
603 __be32 srqn;
604 } __packed srq;
605 struct {
606 __be32 cqn;
607 u32 reserved1;
608 u8 reserved2[3];
609 u8 syndrome;
610 } __packed cq_err;
611 struct {
612 u32 reserved1[2];
613 __be32 port;
614 } __packed port_change;
615 struct {
616 #define COMM_CHANNEL_BIT_ARRAY_SIZE 4
617 u32 reserved;
618 u32 bit_vec[COMM_CHANNEL_BIT_ARRAY_SIZE];
619 } __packed comm_channel_arm;
620 struct {
621 u8 port;
622 u8 reserved[3];
623 __be64 mac;
624 } __packed mac_update;
625 struct {
626 __be32 slave_id;
627 } __packed flr_event;
628 struct {
629 __be16 current_temperature;
630 __be16 warning_threshold;
631 } __packed warming;
632 struct {
633 u8 reserved[3];
634 u8 port;
635 union {
636 struct {
637 __be16 mstr_sm_lid;
638 __be16 port_lid;
639 __be32 changed_attr;
640 u8 reserved[3];
641 u8 mstr_sm_sl;
642 __be64 gid_prefix;
643 } __packed port_info;
644 struct {
645 __be32 block_ptr;
646 __be32 tbl_entries_mask;
647 } __packed tbl_change_info;
648 } params;
649 } __packed port_mgmt_change;
650 } event;
651 u8 slave_id;
652 u8 reserved3[2];
653 u8 owner;
654} __packed;
655
514struct mlx4_init_port_param { 656struct mlx4_init_port_param {
515 int set_guid0; 657 int set_guid0;
516 int set_node_guid; 658 int set_node_guid;
@@ -534,6 +676,15 @@ struct mlx4_init_port_param {
534 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ 676 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
535 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) 677 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE))
536 678
679#define MLX4_INVALID_SLAVE_ID 0xFF
680
681void handle_port_mgmt_change_event(struct work_struct *work);
682
683static inline int mlx4_master_func_num(struct mlx4_dev *dev)
684{
685 return dev->caps.function;
686}
687
537static inline int mlx4_is_master(struct mlx4_dev *dev) 688static inline int mlx4_is_master(struct mlx4_dev *dev)
538{ 689{
539 return dev->flags & MLX4_FLAG_MASTER; 690 return dev->flags & MLX4_FLAG_MASTER;
@@ -623,9 +774,99 @@ int mlx4_unicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
623int mlx4_unicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], 774int mlx4_unicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
624 enum mlx4_protocol prot); 775 enum mlx4_protocol prot);
625int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], 776int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
626 int block_mcast_loopback, enum mlx4_protocol protocol); 777 u8 port, int block_mcast_loopback,
778 enum mlx4_protocol protocol, u64 *reg_id);
627int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], 779int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
628 enum mlx4_protocol protocol); 780 enum mlx4_protocol protocol, u64 reg_id);
781
782enum {
783 MLX4_DOMAIN_UVERBS = 0x1000,
784 MLX4_DOMAIN_ETHTOOL = 0x2000,
785 MLX4_DOMAIN_RFS = 0x3000,
786 MLX4_DOMAIN_NIC = 0x5000,
787};
788
789enum mlx4_net_trans_rule_id {
790 MLX4_NET_TRANS_RULE_ID_ETH = 0,
791 MLX4_NET_TRANS_RULE_ID_IB,
792 MLX4_NET_TRANS_RULE_ID_IPV6,
793 MLX4_NET_TRANS_RULE_ID_IPV4,
794 MLX4_NET_TRANS_RULE_ID_TCP,
795 MLX4_NET_TRANS_RULE_ID_UDP,
796 MLX4_NET_TRANS_RULE_NUM, /* should be last */
797};
798
799enum mlx4_net_trans_promisc_mode {
800 MLX4_FS_PROMISC_NONE = 0,
801 MLX4_FS_PROMISC_UPLINK,
802 /* For future use. Not implemented yet */
803 MLX4_FS_PROMISC_FUNCTION_PORT,
804 MLX4_FS_PROMISC_ALL_MULTI,
805};
806
807struct mlx4_spec_eth {
808 u8 dst_mac[6];
809 u8 dst_mac_msk[6];
810 u8 src_mac[6];
811 u8 src_mac_msk[6];
812 u8 ether_type_enable;
813 __be16 ether_type;
814 __be16 vlan_id_msk;
815 __be16 vlan_id;
816};
817
818struct mlx4_spec_tcp_udp {
819 __be16 dst_port;
820 __be16 dst_port_msk;
821 __be16 src_port;
822 __be16 src_port_msk;
823};
824
825struct mlx4_spec_ipv4 {
826 __be32 dst_ip;
827 __be32 dst_ip_msk;
828 __be32 src_ip;
829 __be32 src_ip_msk;
830};
831
832struct mlx4_spec_ib {
833 __be32 r_qpn;
834 __be32 qpn_msk;
835 u8 dst_gid[16];
836 u8 dst_gid_msk[16];
837};
838
839struct mlx4_spec_list {
840 struct list_head list;
841 enum mlx4_net_trans_rule_id id;
842 union {
843 struct mlx4_spec_eth eth;
844 struct mlx4_spec_ib ib;
845 struct mlx4_spec_ipv4 ipv4;
846 struct mlx4_spec_tcp_udp tcp_udp;
847 };
848};
849
850enum mlx4_net_trans_hw_rule_queue {
851 MLX4_NET_TRANS_Q_FIFO,
852 MLX4_NET_TRANS_Q_LIFO,
853};
854
855struct mlx4_net_trans_rule {
856 struct list_head list;
857 enum mlx4_net_trans_hw_rule_queue queue_mode;
858 bool exclusive;
859 bool allow_loopback;
860 enum mlx4_net_trans_promisc_mode promisc_mode;
861 u8 port;
862 u16 priority;
863 u32 qpn;
864};
865
866int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn,
867 enum mlx4_net_trans_promisc_mode mode);
868int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port,
869 enum mlx4_net_trans_promisc_mode mode);
629int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); 870int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port);
630int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port); 871int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port);
631int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); 872int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port);
@@ -659,7 +900,8 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr,
659int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); 900int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr);
660int mlx4_SYNC_TPT(struct mlx4_dev *dev); 901int mlx4_SYNC_TPT(struct mlx4_dev *dev);
661int mlx4_test_interrupts(struct mlx4_dev *dev); 902int mlx4_test_interrupts(struct mlx4_dev *dev);
662int mlx4_assign_eq(struct mlx4_dev *dev, char* name , int* vector); 903int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
904 int *vector);
663void mlx4_release_eq(struct mlx4_dev *dev, int vec); 905void mlx4_release_eq(struct mlx4_dev *dev, int vec);
664 906
665int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); 907int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
@@ -668,4 +910,10 @@ int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);
668int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx); 910int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx);
669void mlx4_counter_free(struct mlx4_dev *dev, u32 idx); 911void mlx4_counter_free(struct mlx4_dev *dev, u32 idx);
670 912
913int mlx4_flow_attach(struct mlx4_dev *dev,
914 struct mlx4_net_trans_rule *rule, u64 *reg_id);
915int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id);
916
917int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey);
918
671#endif /* MLX4_DEVICE_H */ 919#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index 5f1298b1b5ef..d813704b963b 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -37,18 +37,21 @@
37 37
38struct mlx4_dev; 38struct mlx4_dev;
39 39
40#define MLX4_MAC_MASK 0xffffffffffffULL
41
40enum mlx4_dev_event { 42enum mlx4_dev_event {
41 MLX4_DEV_EVENT_CATASTROPHIC_ERROR, 43 MLX4_DEV_EVENT_CATASTROPHIC_ERROR,
42 MLX4_DEV_EVENT_PORT_UP, 44 MLX4_DEV_EVENT_PORT_UP,
43 MLX4_DEV_EVENT_PORT_DOWN, 45 MLX4_DEV_EVENT_PORT_DOWN,
44 MLX4_DEV_EVENT_PORT_REINIT, 46 MLX4_DEV_EVENT_PORT_REINIT,
47 MLX4_DEV_EVENT_PORT_MGMT_CHANGE,
45}; 48};
46 49
47struct mlx4_interface { 50struct mlx4_interface {
48 void * (*add) (struct mlx4_dev *dev); 51 void * (*add) (struct mlx4_dev *dev);
49 void (*remove)(struct mlx4_dev *dev, void *context); 52 void (*remove)(struct mlx4_dev *dev, void *context);
50 void (*event) (struct mlx4_dev *dev, void *context, 53 void (*event) (struct mlx4_dev *dev, void *context,
51 enum mlx4_dev_event event, int port); 54 enum mlx4_dev_event event, unsigned long param);
52 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); 55 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port);
53 struct list_head list; 56 struct list_head list;
54 enum mlx4_protocol protocol; 57 enum mlx4_protocol protocol;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b36d08ce5c57..f9f279cf5b1b 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1591,6 +1591,7 @@ void vmemmap_populate_print_last(void);
1591enum mf_flags { 1591enum mf_flags {
1592 MF_COUNT_INCREASED = 1 << 0, 1592 MF_COUNT_INCREASED = 1 << 0,
1593 MF_ACTION_REQUIRED = 1 << 1, 1593 MF_ACTION_REQUIRED = 1 << 1,
1594 MF_MUST_KILL = 1 << 2,
1594}; 1595};
1595extern int memory_failure(unsigned long pfn, int trapno, int flags); 1596extern int memory_failure(unsigned long pfn, int trapno, int flags);
1596extern void memory_failure_queue(unsigned long pfn, int trapno, int flags); 1597extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index d76513b5b263..111aca5e97f3 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -149,6 +149,7 @@ struct sd_switch_caps {
149#define SD_SET_CURRENT_LIMIT_400 1 149#define SD_SET_CURRENT_LIMIT_400 1
150#define SD_SET_CURRENT_LIMIT_600 2 150#define SD_SET_CURRENT_LIMIT_600 2
151#define SD_SET_CURRENT_LIMIT_800 3 151#define SD_SET_CURRENT_LIMIT_800 3
152#define SD_SET_CURRENT_NO_CHANGE (-1)
152 153
153#define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200) 154#define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200)
154#define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400) 155#define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400)
diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h
deleted file mode 100644
index cefaba038ccb..000000000000
--- a/include/linux/mmc/cd-gpio.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * Generic GPIO card-detect helper header
3 *
4 * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef MMC_CD_GPIO_H
12#define MMC_CD_GPIO_H
13
14struct mmc_host;
15int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio);
16void mmc_cd_gpio_free(struct mmc_host *host);
17
18#endif
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 0707d228d7f1..f578a71d82a6 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -11,6 +11,7 @@
11#define LINUX_MMC_HOST_H 11#define LINUX_MMC_HOST_H
12 12
13#include <linux/leds.h> 13#include <linux/leds.h>
14#include <linux/mutex.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/fault-inject.h> 17#include <linux/fault-inject.h>
@@ -150,11 +151,31 @@ struct mmc_async_req {
150 int (*err_check) (struct mmc_card *, struct mmc_async_req *); 151 int (*err_check) (struct mmc_card *, struct mmc_async_req *);
151}; 152};
152 153
153struct mmc_hotplug { 154/**
154 unsigned int irq; 155 * struct mmc_slot - MMC slot functions
156 *
157 * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL
158 * @lock: protect the @handler_priv pointer
159 * @handler_priv: MMC/SD-card slot context
160 *
161 * Some MMC/SD host controllers implement slot-functions like card and
162 * write-protect detection natively. However, a large number of controllers
163 * leave these functions to the CPU. This struct provides a hook to attach
164 * such slot-function drivers.
165 */
166struct mmc_slot {
167 int cd_irq;
168 struct mutex lock;
155 void *handler_priv; 169 void *handler_priv;
156}; 170};
157 171
172struct regulator;
173
174struct mmc_supply {
175 struct regulator *vmmc; /* Card power supply */
176 struct regulator *vqmmc; /* Optional Vccq supply */
177};
178
158struct mmc_host { 179struct mmc_host {
159 struct device *parent; 180 struct device *parent;
160 struct device class_dev; 181 struct device class_dev;
@@ -168,6 +189,9 @@ struct mmc_host {
168 u32 ocr_avail_sd; /* SD-specific OCR */ 189 u32 ocr_avail_sd; /* SD-specific OCR */
169 u32 ocr_avail_mmc; /* MMC-specific OCR */ 190 u32 ocr_avail_mmc; /* MMC-specific OCR */
170 struct notifier_block pm_notify; 191 struct notifier_block pm_notify;
192 u32 max_current_330;
193 u32 max_current_300;
194 u32 max_current_180;
171 195
172#define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ 196#define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */
173#define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */ 197#define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */
@@ -211,16 +235,9 @@ struct mmc_host {
211#define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ 235#define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */
212#define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ 236#define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */
213#define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ 237#define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */
214#define MMC_CAP_SET_XPC_330 (1 << 20) /* Host supports >150mA current at 3.3V */
215#define MMC_CAP_SET_XPC_300 (1 << 21) /* Host supports >150mA current at 3.0V */
216#define MMC_CAP_SET_XPC_180 (1 << 22) /* Host supports >150mA current at 1.8V */
217#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ 238#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */
218#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ 239#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */
219#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ 240#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */
220#define MMC_CAP_MAX_CURRENT_200 (1 << 26) /* Host max current limit is 200mA */
221#define MMC_CAP_MAX_CURRENT_400 (1 << 27) /* Host max current limit is 400mA */
222#define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */
223#define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */
224#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ 241#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
225#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ 242#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */
226 243
@@ -238,6 +255,8 @@ struct mmc_host {
238#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ 255#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */
239#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */ 256#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */
240#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ 257#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
258#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
259#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
241 260
242 mmc_pm_flag_t pm_caps; /* supported pm features */ 261 mmc_pm_flag_t pm_caps; /* supported pm features */
243 unsigned int power_notify_type; 262 unsigned int power_notify_type;
@@ -290,7 +309,7 @@ struct mmc_host {
290 309
291 struct delayed_work detect; 310 struct delayed_work detect;
292 int detect_change; /* card detect flag */ 311 int detect_change; /* card detect flag */
293 struct mmc_hotplug hotplug; 312 struct mmc_slot slot;
294 313
295 const struct mmc_bus_ops *bus_ops; /* current bus driver */ 314 const struct mmc_bus_ops *bus_ops; /* current bus driver */
296 unsigned int bus_refs; /* reference counter */ 315 unsigned int bus_refs; /* reference counter */
@@ -309,6 +328,7 @@ struct mmc_host {
309#ifdef CONFIG_REGULATOR 328#ifdef CONFIG_REGULATOR
310 bool regulator_enabled; /* regulator state */ 329 bool regulator_enabled; /* regulator state */
311#endif 330#endif
331 struct mmc_supply supply;
312 332
313 struct dentry *debugfs_root; 333 struct dentry *debugfs_root;
314 334
@@ -357,13 +377,12 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host)
357 wake_up_process(host->sdio_irq_thread); 377 wake_up_process(host->sdio_irq_thread);
358} 378}
359 379
360struct regulator;
361
362#ifdef CONFIG_REGULATOR 380#ifdef CONFIG_REGULATOR
363int mmc_regulator_get_ocrmask(struct regulator *supply); 381int mmc_regulator_get_ocrmask(struct regulator *supply);
364int mmc_regulator_set_ocr(struct mmc_host *mmc, 382int mmc_regulator_set_ocr(struct mmc_host *mmc,
365 struct regulator *supply, 383 struct regulator *supply,
366 unsigned short vdd_bit); 384 unsigned short vdd_bit);
385int mmc_regulator_get_supply(struct mmc_host *mmc);
367#else 386#else
368static inline int mmc_regulator_get_ocrmask(struct regulator *supply) 387static inline int mmc_regulator_get_ocrmask(struct regulator *supply)
369{ 388{
@@ -376,6 +395,11 @@ static inline int mmc_regulator_set_ocr(struct mmc_host *mmc,
376{ 395{
377 return 0; 396 return 0;
378} 397}
398
399static inline int mmc_regulator_get_supply(struct mmc_host *mmc)
400{
401 return 0;
402}
379#endif 403#endif
380 404
381int mmc_card_awake(struct mmc_host *host); 405int mmc_card_awake(struct mmc_host *host);
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index e9051e1cb1ce..ac83b105bedd 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -122,6 +122,7 @@ struct sdhci_host {
122#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ 122#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */
123#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ 123#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */
124#define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */ 124#define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */
125#define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */
125 126
126 unsigned int version; /* SDHCI spec. version */ 127 unsigned int version; /* SDHCI spec. version */
127 128
@@ -155,7 +156,8 @@ struct sdhci_host {
155 156
156 struct timer_list timer; /* Timer for timeouts */ 157 struct timer_list timer; /* Timer for timeouts */
157 158
158 unsigned int caps; /* Alternative capabilities */ 159 unsigned int caps; /* Alternative CAPABILITY_0 */
160 unsigned int caps1; /* Alternative CAPABILITY_1 */
159 161
160 unsigned int ocr_avail_sdio; /* OCR bit masks */ 162 unsigned int ocr_avail_sdio; /* OCR bit masks */
161 unsigned int ocr_avail_sd; 163 unsigned int ocr_avail_sd;
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 05f0e3db1c12..e7d5dd67bb74 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -32,18 +32,14 @@
32 * 1111 : Peripheral clock (sup_pclk set '1') 32 * 1111 : Peripheral clock (sup_pclk set '1')
33 */ 33 */
34 34
35struct sh_mmcif_dma {
36 struct sh_dmae_slave chan_priv_tx;
37 struct sh_dmae_slave chan_priv_rx;
38};
39
40struct sh_mmcif_plat_data { 35struct sh_mmcif_plat_data {
41 void (*set_pwr)(struct platform_device *pdev, int state); 36 void (*set_pwr)(struct platform_device *pdev, int state);
42 void (*down_pwr)(struct platform_device *pdev); 37 void (*down_pwr)(struct platform_device *pdev);
43 int (*get_cd)(struct platform_device *pdef); 38 int (*get_cd)(struct platform_device *pdef);
44 struct sh_mmcif_dma *dma; /* Deprecated. Instead */ 39 unsigned int slave_id_tx; /* embedded slave_id_[tr]x */
45 unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */
46 unsigned int slave_id_rx; 40 unsigned int slave_id_rx;
41 bool use_cd_gpio : 1;
42 unsigned int cd_gpio;
47 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ 43 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
48 unsigned long caps; 44 unsigned long caps;
49 u32 ocr; 45 u32 ocr;
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
index e94e620aeddc..b65679ffa880 100644
--- a/include/linux/mmc/sh_mobile_sdhi.h
+++ b/include/linux/mmc/sh_mobile_sdhi.h
@@ -23,6 +23,7 @@ struct sh_mobile_sdhi_info {
23 int dma_slave_rx; 23 int dma_slave_rx;
24 unsigned long tmio_flags; 24 unsigned long tmio_flags;
25 unsigned long tmio_caps; 25 unsigned long tmio_caps;
26 unsigned long tmio_caps2;
26 u32 tmio_ocr_mask; /* available MMC voltages */ 27 u32 tmio_ocr_mask; /* available MMC voltages */
27 unsigned int cd_gpio; 28 unsigned int cd_gpio;
28 struct tmio_mmc_data *pdata; 29 struct tmio_mmc_data *pdata;
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h
new file mode 100644
index 000000000000..7d88d27bfafa
--- /dev/null
+++ b/include/linux/mmc/slot-gpio.h
@@ -0,0 +1,24 @@
1/*
2 * Generic GPIO card-detect helper header
3 *
4 * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef MMC_SLOT_GPIO_H
12#define MMC_SLOT_GPIO_H
13
14struct mmc_host;
15
16int mmc_gpio_get_ro(struct mmc_host *host);
17int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio);
18void mmc_gpio_free_ro(struct mmc_host *host);
19
20int mmc_gpio_get_cd(struct mmc_host *host);
21int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio);
22void mmc_gpio_free_cd(struct mmc_host *host);
23
24#endif
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 2427706f78b4..458988bd55a1 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -188,7 +188,7 @@ static inline int is_unevictable_lru(enum lru_list lru)
188struct zone_reclaim_stat { 188struct zone_reclaim_stat {
189 /* 189 /*
190 * The pageout code in vmscan.c keeps track of how many of the 190 * The pageout code in vmscan.c keeps track of how many of the
191 * mem/swap backed and file backed pages are refeferenced. 191 * mem/swap backed and file backed pages are referenced.
192 * The higher the rotated/scanned ratio, the more valuable 192 * The higher the rotated/scanned ratio, the more valuable
193 * that cache is. 193 * that cache is.
194 * 194 *
@@ -694,7 +694,7 @@ typedef struct pglist_data {
694 range, including holes */ 694 range, including holes */
695 int node_id; 695 int node_id;
696 wait_queue_head_t kswapd_wait; 696 wait_queue_head_t kswapd_wait;
697 struct task_struct *kswapd; 697 struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */
698 int kswapd_max_order; 698 int kswapd_max_order;
699 enum zone_type classzone_idx; 699 enum zone_type classzone_idx;
700} pg_data_t; 700} pg_data_t;
diff --git a/include/linux/mxsfb.h b/include/linux/mxsfb.h
new file mode 100644
index 000000000000..f14943d55315
--- /dev/null
+++ b/include/linux/mxsfb.h
@@ -0,0 +1,49 @@
1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
14 * MA 02110-1301, USA.
15 */
16
17#ifndef __LINUX_MXSFB_H
18#define __LINUX_MXSFB_H
19
20#include <linux/fb.h>
21
22#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */
23#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
24#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
25#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
26
27#define FB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
28#define FB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */
29
30struct mxsfb_platform_data {
31 struct fb_videomode *mode_list;
32 unsigned mode_count;
33
34 unsigned default_bpp;
35
36 unsigned dotclk_delay; /* refer manual HW_LCDIF_VDCTRL4 register */
37 unsigned ld_intf_width; /* refer STMLCDIF_* macros */
38
39 unsigned fb_size; /* Size of the video memory. If zero a
40 * default will be used
41 */
42 unsigned long fb_phys; /* physical address for the video memory. If
43 * zero the framebuffer memory will be dynamically
44 * allocated. If specified,fb_size must also be specified.
45 * fb_phys must be unused by Linux.
46 */
47};
48
49#endif /* __LINUX_MXSFB_H */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index ffc02135c483..d2ef8b34b967 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -7,12 +7,6 @@
7 7
8struct vfsmount; 8struct vfsmount;
9 9
10struct open_intent {
11 int flags;
12 int create_mode;
13 struct file *file;
14};
15
16enum { MAX_NESTED_LINKS = 8 }; 10enum { MAX_NESTED_LINKS = 8 };
17 11
18struct nameidata { 12struct nameidata {
@@ -25,11 +19,6 @@ struct nameidata {
25 int last_type; 19 int last_type;
26 unsigned depth; 20 unsigned depth;
27 char *saved_names[MAX_NESTED_LINKS + 1]; 21 char *saved_names[MAX_NESTED_LINKS + 1];
28
29 /* Intent data */
30 union {
31 struct open_intent open;
32 } intent;
33}; 22};
34 23
35/* 24/*
@@ -78,13 +67,10 @@ extern int kern_path(const char *, unsigned, struct path *);
78 67
79extern struct dentry *kern_path_create(int, const char *, struct path *, int); 68extern struct dentry *kern_path_create(int, const char *, struct path *, int);
80extern struct dentry *user_path_create(int, const char __user *, struct path *, int); 69extern struct dentry *user_path_create(int, const char __user *, struct path *, int);
81extern int kern_path_parent(const char *, struct nameidata *); 70extern struct dentry *kern_path_locked(const char *, struct path *);
82extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 71extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
83 const char *, unsigned int, struct path *); 72 const char *, unsigned int, struct path *);
84 73
85extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
86 int (*open)(struct inode *, struct file *));
87
88extern struct dentry *lookup_one_len(const char *, struct dentry *, int); 74extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
89 75
90extern int follow_down_one(struct path *); 76extern int follow_down_one(struct path *);
@@ -94,6 +80,8 @@ extern int follow_up(struct path *);
94extern struct dentry *lock_rename(struct dentry *, struct dentry *); 80extern struct dentry *lock_rename(struct dentry *, struct dentry *);
95extern void unlock_rename(struct dentry *, struct dentry *); 81extern void unlock_rename(struct dentry *, struct dentry *);
96 82
83extern void nd_jump_link(struct nameidata *nd, struct path *path);
84
97static inline void nd_set_link(struct nameidata *nd, char *path) 85static inline void nd_set_link(struct nameidata *nd, char *path)
98{ 86{
99 nd->saved_names[nd->depth] = path; 87 nd->saved_names[nd->depth] = path;
diff --git a/include/linux/net.h b/include/linux/net.h
index e9ac2df079ba..99276c3dc89a 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -72,6 +72,7 @@ struct net;
72#define SOCK_NOSPACE 2 72#define SOCK_NOSPACE 2
73#define SOCK_PASSCRED 3 73#define SOCK_PASSCRED 3
74#define SOCK_PASSSEC 4 74#define SOCK_PASSSEC 4
75#define SOCK_EXTERNALLY_ALLOCATED 5
75 76
76#ifndef ARCH_HAS_SOCKET_TYPES 77#ifndef ARCH_HAS_SOCKET_TYPES
77/** 78/**
@@ -247,6 +248,7 @@ extern int sock_recvmsg(struct socket *sock, struct msghdr *msg,
247 size_t size, int flags); 248 size_t size, int flags);
248extern int sock_map_fd(struct socket *sock, int flags); 249extern int sock_map_fd(struct socket *sock, int flags);
249extern struct socket *sockfd_lookup(int fd, int *err); 250extern struct socket *sockfd_lookup(int fd, int *err);
251extern struct socket *sock_from_file(struct file *file, int *err);
250#define sockfd_put(sock) fput(sock->file) 252#define sockfd_put(sock) fput(sock->file)
251extern int net_ratelimit(void); 253extern int net_ratelimit(void);
252 254
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d94cb1431519..eb06e58bed0b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1046,10 +1046,9 @@ struct net_device {
1046 */ 1046 */
1047 char name[IFNAMSIZ]; 1047 char name[IFNAMSIZ];
1048 1048
1049 struct pm_qos_request pm_qos_req; 1049 /* device name hash chain, please keep it close to name[] */
1050
1051 /* device name hash chain */
1052 struct hlist_node name_hlist; 1050 struct hlist_node name_hlist;
1051
1053 /* snmp alias */ 1052 /* snmp alias */
1054 char *ifalias; 1053 char *ifalias;
1055 1054
@@ -1322,6 +1321,8 @@ struct net_device {
1322 1321
1323 /* group the device belongs to */ 1322 /* group the device belongs to */
1324 int group; 1323 int group;
1324
1325 struct pm_qos_request pm_qos_req;
1325}; 1326};
1326#define to_net_dev(d) container_of(d, struct net_device, dev) 1327#define to_net_dev(d) container_of(d, struct net_device, dev)
1327 1328
@@ -1626,6 +1627,7 @@ extern int dev_alloc_name(struct net_device *dev, const char *name);
1626extern int dev_open(struct net_device *dev); 1627extern int dev_open(struct net_device *dev);
1627extern int dev_close(struct net_device *dev); 1628extern int dev_close(struct net_device *dev);
1628extern void dev_disable_lro(struct net_device *dev); 1629extern void dev_disable_lro(struct net_device *dev);
1630extern int dev_loopback_xmit(struct sk_buff *newskb);
1629extern int dev_queue_xmit(struct sk_buff *skb); 1631extern int dev_queue_xmit(struct sk_buff *skb);
1630extern int register_netdevice(struct net_device *dev); 1632extern int register_netdevice(struct net_device *dev);
1631extern void unregister_netdevice_queue(struct net_device *dev, 1633extern void unregister_netdevice_queue(struct net_device *dev,
@@ -2108,7 +2110,12 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev,
2108static inline int netif_copy_real_num_queues(struct net_device *to_dev, 2110static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2109 const struct net_device *from_dev) 2111 const struct net_device *from_dev)
2110{ 2112{
2111 netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues); 2113 int err;
2114
2115 err = netif_set_real_num_tx_queues(to_dev,
2116 from_dev->real_num_tx_queues);
2117 if (err)
2118 return err;
2112#ifdef CONFIG_RPS 2119#ifdef CONFIG_RPS
2113 return netif_set_real_num_rx_queues(to_dev, 2120 return netif_set_real_num_rx_queues(to_dev,
2114 from_dev->real_num_rx_queues); 2121 from_dev->real_num_rx_queues);
@@ -2117,6 +2124,9 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2117#endif 2124#endif
2118} 2125}
2119 2126
2127#define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2128extern int netif_get_num_default_rss_queues(void);
2129
2120/* Use this variant when it is known for sure that it 2130/* Use this variant when it is known for sure that it
2121 * is executing from hardware interrupt context or with hardware interrupts 2131 * is executing from hardware interrupt context or with hardware interrupts
2122 * disabled. 2132 * disabled.
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index ff9c84c29b28..c613cf0d7884 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -94,6 +94,16 @@ static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1,
94 a1->all[3] == a2->all[3]; 94 a1->all[3] == a2->all[3];
95} 95}
96 96
97static inline void nf_inet_addr_mask(const union nf_inet_addr *a1,
98 union nf_inet_addr *result,
99 const union nf_inet_addr *mask)
100{
101 result->all[0] = a1->all[0] & mask->all[0];
102 result->all[1] = a1->all[1] & mask->all[1];
103 result->all[2] = a1->all[2] & mask->all[2];
104 result->all[3] = a1->all[3] & mask->all[3];
105}
106
97extern void netfilter_init(void); 107extern void netfilter_init(void);
98 108
99/* Largest hook number + 1 */ 109/* Largest hook number + 1 */
@@ -383,6 +393,22 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
383extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; 393extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu;
384extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); 394extern void nf_ct_attach(struct sk_buff *, struct sk_buff *);
385extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; 395extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
396
397struct nf_conn;
398struct nlattr;
399
400struct nfq_ct_hook {
401 size_t (*build_size)(const struct nf_conn *ct);
402 int (*build)(struct sk_buff *skb, struct nf_conn *ct);
403 int (*parse)(const struct nlattr *attr, struct nf_conn *ct);
404};
405extern struct nfq_ct_hook __rcu *nfq_ct_hook;
406
407struct nfq_ct_nat_hook {
408 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct,
409 u32 ctinfo, int off);
410};
411extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook;
386#else 412#else
387static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} 413static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
388#endif 414#endif
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 1697036336b6..874ae8f2706b 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -10,6 +10,7 @@ header-y += nfnetlink.h
10header-y += nfnetlink_acct.h 10header-y += nfnetlink_acct.h
11header-y += nfnetlink_compat.h 11header-y += nfnetlink_compat.h
12header-y += nfnetlink_conntrack.h 12header-y += nfnetlink_conntrack.h
13header-y += nfnetlink_cthelper.h
13header-y += nfnetlink_cttimeout.h 14header-y += nfnetlink_cttimeout.h
14header-y += nfnetlink_log.h 15header-y += nfnetlink_log.h
15header-y += nfnetlink_queue.h 16header-y += nfnetlink_queue.h
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index 0ce91d56a5f2..0dfc8b7210a3 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -2,6 +2,8 @@
2#define __NF_CONNTRACK_SIP_H__ 2#define __NF_CONNTRACK_SIP_H__
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <net/netfilter/nf_conntrack_expect.h>
6
5#define SIP_PORT 5060 7#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600 8#define SIP_TIMEOUT 3600
7 9
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index a1048c1587d1..18341cdb2443 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -50,7 +50,8 @@ struct nfgenmsg {
50#define NFNL_SUBSYS_IPSET 6 50#define NFNL_SUBSYS_IPSET 6
51#define NFNL_SUBSYS_ACCT 7 51#define NFNL_SUBSYS_ACCT 7
52#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 52#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
53#define NFNL_SUBSYS_COUNT 9 53#define NFNL_SUBSYS_CTHELPER 9
54#define NFNL_SUBSYS_COUNT 10
54 55
55#ifdef __KERNEL__ 56#ifdef __KERNEL__
56 57
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index e58e4b93c108..f649f7423ca2 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -7,6 +7,8 @@ enum cntl_msg_types {
7 IPCTNL_MSG_CT_GET, 7 IPCTNL_MSG_CT_GET,
8 IPCTNL_MSG_CT_DELETE, 8 IPCTNL_MSG_CT_DELETE,
9 IPCTNL_MSG_CT_GET_CTRZERO, 9 IPCTNL_MSG_CT_GET_CTRZERO,
10 IPCTNL_MSG_CT_GET_STATS_CPU,
11 IPCTNL_MSG_CT_GET_STATS,
10 12
11 IPCTNL_MSG_MAX 13 IPCTNL_MSG_MAX
12}; 14};
@@ -15,6 +17,7 @@ enum ctnl_exp_msg_types {
15 IPCTNL_MSG_EXP_NEW, 17 IPCTNL_MSG_EXP_NEW,
16 IPCTNL_MSG_EXP_GET, 18 IPCTNL_MSG_EXP_GET,
17 IPCTNL_MSG_EXP_DELETE, 19 IPCTNL_MSG_EXP_DELETE,
20 IPCTNL_MSG_EXP_GET_STATS_CPU,
18 21
19 IPCTNL_MSG_EXP_MAX 22 IPCTNL_MSG_EXP_MAX
20}; 23};
@@ -191,6 +194,7 @@ enum ctattr_expect_nat {
191enum ctattr_help { 194enum ctattr_help {
192 CTA_HELP_UNSPEC, 195 CTA_HELP_UNSPEC,
193 CTA_HELP_NAME, 196 CTA_HELP_NAME,
197 CTA_HELP_INFO,
194 __CTA_HELP_MAX 198 __CTA_HELP_MAX
195}; 199};
196#define CTA_HELP_MAX (__CTA_HELP_MAX - 1) 200#define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
@@ -202,4 +206,39 @@ enum ctattr_secctx {
202}; 206};
203#define CTA_SECCTX_MAX (__CTA_SECCTX_MAX - 1) 207#define CTA_SECCTX_MAX (__CTA_SECCTX_MAX - 1)
204 208
209enum ctattr_stats_cpu {
210 CTA_STATS_UNSPEC,
211 CTA_STATS_SEARCHED,
212 CTA_STATS_FOUND,
213 CTA_STATS_NEW,
214 CTA_STATS_INVALID,
215 CTA_STATS_IGNORE,
216 CTA_STATS_DELETE,
217 CTA_STATS_DELETE_LIST,
218 CTA_STATS_INSERT,
219 CTA_STATS_INSERT_FAILED,
220 CTA_STATS_DROP,
221 CTA_STATS_EARLY_DROP,
222 CTA_STATS_ERROR,
223 CTA_STATS_SEARCH_RESTART,
224 __CTA_STATS_MAX,
225};
226#define CTA_STATS_MAX (__CTA_STATS_MAX - 1)
227
228enum ctattr_stats_global {
229 CTA_STATS_GLOBAL_UNSPEC,
230 CTA_STATS_GLOBAL_ENTRIES,
231 __CTA_STATS_GLOBAL_MAX,
232};
233#define CTA_STATS_GLOBAL_MAX (__CTA_STATS_GLOBAL_MAX - 1)
234
235enum ctattr_expect_stats {
236 CTA_STATS_EXP_UNSPEC,
237 CTA_STATS_EXP_NEW,
238 CTA_STATS_EXP_CREATE,
239 CTA_STATS_EXP_DELETE,
240 __CTA_STATS_EXP_MAX,
241};
242#define CTA_STATS_EXP_MAX (__CTA_STATS_EXP_MAX - 1)
243
205#endif /* _IPCONNTRACK_NETLINK_H */ 244#endif /* _IPCONNTRACK_NETLINK_H */
diff --git a/include/linux/netfilter/nfnetlink_cthelper.h b/include/linux/netfilter/nfnetlink_cthelper.h
new file mode 100644
index 000000000000..33659f6fad3e
--- /dev/null
+++ b/include/linux/netfilter/nfnetlink_cthelper.h
@@ -0,0 +1,55 @@
1#ifndef _NFNL_CTHELPER_H_
2#define _NFNL_CTHELPER_H_
3
4#define NFCT_HELPER_STATUS_DISABLED 0
5#define NFCT_HELPER_STATUS_ENABLED 1
6
7enum nfnl_acct_msg_types {
8 NFNL_MSG_CTHELPER_NEW,
9 NFNL_MSG_CTHELPER_GET,
10 NFNL_MSG_CTHELPER_DEL,
11 NFNL_MSG_CTHELPER_MAX
12};
13
14enum nfnl_cthelper_type {
15 NFCTH_UNSPEC,
16 NFCTH_NAME,
17 NFCTH_TUPLE,
18 NFCTH_QUEUE_NUM,
19 NFCTH_POLICY,
20 NFCTH_PRIV_DATA_LEN,
21 NFCTH_STATUS,
22 __NFCTH_MAX
23};
24#define NFCTH_MAX (__NFCTH_MAX - 1)
25
26enum nfnl_cthelper_policy_type {
27 NFCTH_POLICY_SET_UNSPEC,
28 NFCTH_POLICY_SET_NUM,
29 NFCTH_POLICY_SET,
30 NFCTH_POLICY_SET1 = NFCTH_POLICY_SET,
31 NFCTH_POLICY_SET2,
32 NFCTH_POLICY_SET3,
33 NFCTH_POLICY_SET4,
34 __NFCTH_POLICY_SET_MAX
35};
36#define NFCTH_POLICY_SET_MAX (__NFCTH_POLICY_SET_MAX - 1)
37
38enum nfnl_cthelper_pol_type {
39 NFCTH_POLICY_UNSPEC,
40 NFCTH_POLICY_NAME,
41 NFCTH_POLICY_EXPECT_MAX,
42 NFCTH_POLICY_EXPECT_TIMEOUT,
43 __NFCTH_POLICY_MAX
44};
45#define NFCTH_POLICY_MAX (__NFCTH_POLICY_MAX - 1)
46
47enum nfnl_cthelper_tuple_type {
48 NFCTH_TUPLE_UNSPEC,
49 NFCTH_TUPLE_L3PROTONUM,
50 NFCTH_TUPLE_L4PROTONUM,
51 __NFCTH_TUPLE_MAX,
52};
53#define NFCTH_TUPLE_MAX (__NFCTH_TUPLE_MAX - 1)
54
55#endif /* _NFNL_CTHELPER_H */
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index 24b32e6c009e..3b1c1360aedf 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -42,6 +42,8 @@ enum nfqnl_attr_type {
42 NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */ 42 NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */
43 NFQA_HWADDR, /* nfqnl_msg_packet_hw */ 43 NFQA_HWADDR, /* nfqnl_msg_packet_hw */
44 NFQA_PAYLOAD, /* opaque data payload */ 44 NFQA_PAYLOAD, /* opaque data payload */
45 NFQA_CT, /* nf_conntrack_netlink.h */
46 NFQA_CT_INFO, /* enum ip_conntrack_info */
45 47
46 __NFQA_MAX 48 __NFQA_MAX
47}; 49};
@@ -84,8 +86,15 @@ enum nfqnl_attr_config {
84 NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ 86 NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */
85 NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ 87 NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */
86 NFQA_CFG_QUEUE_MAXLEN, /* __u32 */ 88 NFQA_CFG_QUEUE_MAXLEN, /* __u32 */
89 NFQA_CFG_MASK, /* identify which flags to change */
90 NFQA_CFG_FLAGS, /* value of these flags (__u32) */
87 __NFQA_CFG_MAX 91 __NFQA_CFG_MAX
88}; 92};
89#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) 93#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
90 94
95/* Flags for NFQA_CFG_FLAGS */
96#define NFQA_CFG_F_FAIL_OPEN (1 << 0)
97#define NFQA_CFG_F_CONNTRACK (1 << 1)
98#define NFQA_CFG_F_MAX (1 << 2)
99
91#endif /* _NFNETLINK_QUEUE_H */ 100#endif /* _NFNETLINK_QUEUE_H */
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h
index d1366f05d1b2..f1656096121e 100644
--- a/include/linux/netfilter/xt_connlimit.h
+++ b/include/linux/netfilter/xt_connlimit.h
@@ -22,13 +22,8 @@ struct xt_connlimit_info {
22#endif 22#endif
23 }; 23 };
24 unsigned int limit; 24 unsigned int limit;
25 union { 25 /* revision 1 */
26 /* revision 0 */ 26 __u32 flags;
27 unsigned int inverse;
28
29 /* revision 1 */
30 __u32 flags;
31 };
32 27
33 /* Used internally by the kernel */ 28 /* Used internally by the kernel */
34 struct xt_connlimit_data *data __attribute__((aligned(8))); 29 struct xt_connlimit_data *data __attribute__((aligned(8)));
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h
index 83318e01425e..6ef36c113e89 100644
--- a/include/linux/netfilter/xt_recent.h
+++ b/include/linux/netfilter/xt_recent.h
@@ -32,4 +32,14 @@ struct xt_recent_mtinfo {
32 __u8 side; 32 __u8 side;
33}; 33};
34 34
35struct xt_recent_mtinfo_v1 {
36 __u32 seconds;
37 __u32 hit_count;
38 __u8 check_set;
39 __u8 invert;
40 char name[XT_RECENT_NAME_LEN];
41 __u8 side;
42 union nf_inet_addr mask;
43};
44
35#endif /* _LINUX_NETFILTER_XT_RECENT_H */ 45#endif /* _LINUX_NETFILTER_XT_RECENT_H */
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index fa0946c549d3..e2b12801378d 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -66,6 +66,7 @@ enum nf_ip_hook_priorities {
66 NF_IP_PRI_SECURITY = 50, 66 NF_IP_PRI_SECURITY = 50,
67 NF_IP_PRI_NAT_SRC = 100, 67 NF_IP_PRI_NAT_SRC = 100,
68 NF_IP_PRI_SELINUX_LAST = 225, 68 NF_IP_PRI_SELINUX_LAST = 225,
69 NF_IP_PRI_CONNTRACK_HELPER = 300,
69 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, 70 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
70 NF_IP_PRI_LAST = INT_MAX, 71 NF_IP_PRI_LAST = INT_MAX,
71}; 72};
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index c61b8fb1a9ef..8ba0c5b72ea9 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -5,7 +5,6 @@ header-y += ipt_LOG.h
5header-y += ipt_REJECT.h 5header-y += ipt_REJECT.h
6header-y += ipt_TTL.h 6header-y += ipt_TTL.h
7header-y += ipt_ULOG.h 7header-y += ipt_ULOG.h
8header-y += ipt_addrtype.h
9header-y += ipt_ah.h 8header-y += ipt_ah.h
10header-y += ipt_ecn.h 9header-y += ipt_ecn.h
11header-y += ipt_ttl.h 10header-y += ipt_ttl.h
diff --git a/include/linux/netfilter_ipv4/ipt_addrtype.h b/include/linux/netfilter_ipv4/ipt_addrtype.h
deleted file mode 100644
index 0da42237c8da..000000000000
--- a/include/linux/netfilter_ipv4/ipt_addrtype.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef _IPT_ADDRTYPE_H
2#define _IPT_ADDRTYPE_H
3
4#include <linux/types.h>
5
6enum {
7 IPT_ADDRTYPE_INVERT_SOURCE = 0x0001,
8 IPT_ADDRTYPE_INVERT_DEST = 0x0002,
9 IPT_ADDRTYPE_LIMIT_IFACE_IN = 0x0004,
10 IPT_ADDRTYPE_LIMIT_IFACE_OUT = 0x0008,
11};
12
13struct ipt_addrtype_info_v1 {
14 __u16 source; /* source-type mask */
15 __u16 dest; /* dest-type mask */
16 __u32 flags;
17};
18
19/* revision 0 */
20struct ipt_addrtype_info {
21 __u16 source; /* source-type mask */
22 __u16 dest; /* dest-type mask */
23 __u32 invert_source;
24 __u32 invert_dest;
25};
26
27#endif
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 57c025127f1d..7c8a513ce7a3 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -71,6 +71,7 @@ enum nf_ip6_hook_priorities {
71 NF_IP6_PRI_SECURITY = 50, 71 NF_IP6_PRI_SECURITY = 50,
72 NF_IP6_PRI_NAT_SRC = 100, 72 NF_IP6_PRI_NAT_SRC = 100,
73 NF_IP6_PRI_SELINUX_LAST = 225, 73 NF_IP6_PRI_SELINUX_LAST = 225,
74 NF_IP6_PRI_CONNTRACK_HELPER = 300,
74 NF_IP6_PRI_LAST = INT_MAX, 75 NF_IP6_PRI_LAST = INT_MAX,
75}; 76};
76 77
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 0f628ffa420c..f74dd133788f 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -174,11 +174,17 @@ struct netlink_skb_parms {
174extern void netlink_table_grab(void); 174extern void netlink_table_grab(void);
175extern void netlink_table_ungrab(void); 175extern void netlink_table_ungrab(void);
176 176
177extern struct sock *netlink_kernel_create(struct net *net, 177/* optional Netlink kernel configuration parameters */
178 int unit,unsigned int groups, 178struct netlink_kernel_cfg {
179 void (*input)(struct sk_buff *skb), 179 unsigned int groups;
180 struct mutex *cb_mutex, 180 void (*input)(struct sk_buff *skb);
181 struct module *module); 181 struct mutex *cb_mutex;
182 void (*bind)(int group);
183};
184
185extern struct sock *netlink_kernel_create(struct net *net, int unit,
186 struct module *module,
187 struct netlink_kernel_cfg *cfg);
182extern void netlink_kernel_release(struct sock *sk); 188extern void netlink_kernel_release(struct sock *sk);
183extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); 189extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
184extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 190extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
@@ -241,14 +247,6 @@ struct netlink_notify {
241struct nlmsghdr * 247struct nlmsghdr *
242__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags); 248__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags);
243 249
244#define NLMSG_NEW(skb, pid, seq, type, len, flags) \
245({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \
246 goto nlmsg_failure; \
247 __nlmsg_put(skb, pid, seq, type, len, flags); })
248
249#define NLMSG_PUT(skb, pid, seq, type, len) \
250 NLMSG_NEW(skb, pid, seq, type, len, 0)
251
252struct netlink_dump_control { 250struct netlink_dump_control {
253 int (*dump)(struct sk_buff *skb, struct netlink_callback *); 251 int (*dump)(struct sk_buff *skb, struct netlink_callback *);
254 int (*done)(struct netlink_callback*); 252 int (*done)(struct netlink_callback*);
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 5dfa091c3347..28f5389c924b 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -43,7 +43,7 @@ struct netpoll_info {
43void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 43void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
44void netpoll_print_options(struct netpoll *np); 44void netpoll_print_options(struct netpoll *np);
45int netpoll_parse_options(struct netpoll *np, char *opt); 45int netpoll_parse_options(struct netpoll *np, char *opt);
46int __netpoll_setup(struct netpoll *np); 46int __netpoll_setup(struct netpoll *np, struct net_device *ndev);
47int netpoll_setup(struct netpoll *np); 47int netpoll_setup(struct netpoll *np);
48int netpoll_trap(void); 48int netpoll_trap(void);
49void netpoll_set_trap(int trap); 49void netpoll_set_trap(int trap);
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
index 0ae9b5857c83..6189f27e305b 100644
--- a/include/linux/nfc.h
+++ b/include/linux/nfc.h
@@ -56,6 +56,10 @@
56 * %NFC_ATTR_PROTOCOLS) 56 * %NFC_ATTR_PROTOCOLS)
57 * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed 57 * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed
58 * (it sends %NFC_ATTR_DEVICE_INDEX) 58 * (it sends %NFC_ATTR_DEVICE_INDEX)
59 * @NFC_EVENT_TM_ACTIVATED: event emitted when the adapter is activated in
60 * target mode.
61 * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated
62 * from target mode.
59 */ 63 */
60enum nfc_commands { 64enum nfc_commands {
61 NFC_CMD_UNSPEC, 65 NFC_CMD_UNSPEC,
@@ -71,6 +75,8 @@ enum nfc_commands {
71 NFC_EVENT_DEVICE_ADDED, 75 NFC_EVENT_DEVICE_ADDED,
72 NFC_EVENT_DEVICE_REMOVED, 76 NFC_EVENT_DEVICE_REMOVED,
73 NFC_EVENT_TARGET_LOST, 77 NFC_EVENT_TARGET_LOST,
78 NFC_EVENT_TM_ACTIVATED,
79 NFC_EVENT_TM_DEACTIVATED,
74/* private: internal use only */ 80/* private: internal use only */
75 __NFC_CMD_AFTER_LAST 81 __NFC_CMD_AFTER_LAST
76}; 82};
@@ -94,6 +100,8 @@ enum nfc_commands {
94 * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes 100 * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes
95 * @NFC_ATTR_COMM_MODE: Passive or active mode 101 * @NFC_ATTR_COMM_MODE: Passive or active mode
96 * @NFC_ATTR_RF_MODE: Initiator or target 102 * @NFC_ATTR_RF_MODE: Initiator or target
103 * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for
104 * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for
97 */ 105 */
98enum nfc_attrs { 106enum nfc_attrs {
99 NFC_ATTR_UNSPEC, 107 NFC_ATTR_UNSPEC,
@@ -109,6 +117,8 @@ enum nfc_attrs {
109 NFC_ATTR_COMM_MODE, 117 NFC_ATTR_COMM_MODE,
110 NFC_ATTR_RF_MODE, 118 NFC_ATTR_RF_MODE,
111 NFC_ATTR_DEVICE_POWERED, 119 NFC_ATTR_DEVICE_POWERED,
120 NFC_ATTR_IM_PROTOCOLS,
121 NFC_ATTR_TM_PROTOCOLS,
112/* private: internal use only */ 122/* private: internal use only */
113 __NFC_ATTR_AFTER_LAST 123 __NFC_ATTR_AFTER_LAST
114}; 124};
@@ -118,6 +128,7 @@ enum nfc_attrs {
118#define NFC_NFCID1_MAXSIZE 10 128#define NFC_NFCID1_MAXSIZE 10
119#define NFC_SENSB_RES_MAXSIZE 12 129#define NFC_SENSB_RES_MAXSIZE 12
120#define NFC_SENSF_RES_MAXSIZE 18 130#define NFC_SENSF_RES_MAXSIZE 18
131#define NFC_GB_MAXSIZE 48
121 132
122/* NFC protocols */ 133/* NFC protocols */
123#define NFC_PROTO_JEWEL 1 134#define NFC_PROTO_JEWEL 1
@@ -125,8 +136,9 @@ enum nfc_attrs {
125#define NFC_PROTO_FELICA 3 136#define NFC_PROTO_FELICA 3
126#define NFC_PROTO_ISO14443 4 137#define NFC_PROTO_ISO14443 4
127#define NFC_PROTO_NFC_DEP 5 138#define NFC_PROTO_NFC_DEP 5
139#define NFC_PROTO_ISO14443_B 6
128 140
129#define NFC_PROTO_MAX 6 141#define NFC_PROTO_MAX 7
130 142
131/* NFC communication modes */ 143/* NFC communication modes */
132#define NFC_COMM_ACTIVE 0 144#define NFC_COMM_ACTIVE 0
@@ -135,13 +147,15 @@ enum nfc_attrs {
135/* NFC RF modes */ 147/* NFC RF modes */
136#define NFC_RF_INITIATOR 0 148#define NFC_RF_INITIATOR 0
137#define NFC_RF_TARGET 1 149#define NFC_RF_TARGET 1
150#define NFC_RF_NONE 2
138 151
139/* NFC protocols masks used in bitsets */ 152/* NFC protocols masks used in bitsets */
140#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) 153#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL)
141#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE) 154#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE)
142#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA) 155#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA)
143#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443) 156#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443)
144#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) 157#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
158#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
145 159
146struct sockaddr_nfc { 160struct sockaddr_nfc {
147 sa_family_t sa_family; 161 sa_family_t sa_family;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 8aadd90b808a..d3b7c18b18f4 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1374,7 +1374,7 @@ struct nfs_rpc_ops {
1374 int (*readlink)(struct inode *, struct page *, unsigned int, 1374 int (*readlink)(struct inode *, struct page *, unsigned int,
1375 unsigned int); 1375 unsigned int);
1376 int (*create) (struct inode *, struct dentry *, 1376 int (*create) (struct inode *, struct dentry *,
1377 struct iattr *, int, struct nfs_open_context *); 1377 struct iattr *, int);
1378 int (*remove) (struct inode *, struct qstr *); 1378 int (*remove) (struct inode *, struct qstr *);
1379 void (*unlink_setup) (struct rpc_message *, struct inode *dir); 1379 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1380 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *); 1380 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index a6959f72745e..2f3878806403 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -170,6 +170,8 @@
170 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, 170 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, 171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. 172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
173 * The channel to use can be set on the interface or be given using the
174 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs.
173 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP 175 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
174 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface 176 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
175 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP 177 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
@@ -275,6 +277,12 @@
275 * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to 277 * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
276 * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) 278 * NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
277 * 279 *
280 * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC
281 * (for the BSSID) and %NL80211_ATTR_PMKID.
282 * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
283 * (for the BSSID) and %NL80211_ATTR_PMKID.
284 * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
285 *
278 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain 286 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
279 * has been changed and provides details of the request information 287 * has been changed and provides details of the request information
280 * that caused the change such as who initiated the regulatory request 288 * that caused the change such as who initiated the regulatory request
@@ -454,6 +462,10 @@
454 * the frame. 462 * the frame.
455 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for 463 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
456 * backward compatibility. 464 * backward compatibility.
465 *
466 * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE
467 * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE
468 *
457 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command 469 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
458 * is used to configure connection quality monitoring notification trigger 470 * is used to configure connection quality monitoring notification trigger
459 * levels. 471 * levels.
@@ -759,6 +771,9 @@ enum nl80211_commands {
759 * @NL80211_ATTR_IFNAME: network interface name 771 * @NL80211_ATTR_IFNAME: network interface name
760 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype 772 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
761 * 773 *
774 * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
775 * that don't have a netdev (u64)
776 *
762 * @NL80211_ATTR_MAC: MAC address (various uses) 777 * @NL80211_ATTR_MAC: MAC address (various uses)
763 * 778 *
764 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of 779 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
@@ -769,6 +784,13 @@ enum nl80211_commands {
769 * section 7.3.2.25.1, e.g. 0x000FAC04) 784 * section 7.3.2.25.1, e.g. 0x000FAC04)
770 * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and 785 * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
771 * CCMP keys, each six bytes in little endian 786 * CCMP keys, each six bytes in little endian
787 * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key
788 * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the
789 * default management key
790 * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or
791 * other commands, indicates which pairwise cipher suites are used
792 * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or
793 * other commands, indicates which group cipher suite is used
772 * 794 *
773 * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU 795 * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
774 * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing 796 * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
@@ -1004,6 +1026,8 @@ enum nl80211_commands {
1004 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was 1026 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
1005 * acknowledged by the recipient. 1027 * acknowledged by the recipient.
1006 * 1028 *
1029 * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
1030 *
1007 * @NL80211_ATTR_CQM: connection quality monitor configuration in a 1031 * @NL80211_ATTR_CQM: connection quality monitor configuration in a
1008 * nested attribute with %NL80211_ATTR_CQM_* sub-attributes. 1032 * nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
1009 * 1033 *
@@ -1061,7 +1085,7 @@ enum nl80211_commands {
1061 * flag isn't set, the frame will be rejected. This is also used as an 1085 * flag isn't set, the frame will be rejected. This is also used as an
1062 * nl80211 capability flag. 1086 * nl80211 capability flag.
1063 * 1087 *
1064 * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16) 1088 * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16)
1065 * 1089 *
1066 * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags 1090 * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
1067 * attributes, specifying what a key should be set as default as. 1091 * attributes, specifying what a key should be set as default as.
@@ -1085,10 +1109,10 @@ enum nl80211_commands {
1085 * indicate which WoW triggers should be enabled. This is also 1109 * indicate which WoW triggers should be enabled. This is also
1086 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN 1110 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
1087 * triggers. 1111 * triggers.
1088 1112 *
1089 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan 1113 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
1090 * cycles, in msecs. 1114 * cycles, in msecs.
1091 1115 *
1092 * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more 1116 * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more
1093 * sets of attributes to match during scheduled scans. Only BSSs 1117 * sets of attributes to match during scheduled scans. Only BSSs
1094 * that match any of the sets will be reported. These are 1118 * that match any of the sets will be reported. These are
@@ -1115,7 +1139,7 @@ enum nl80211_commands {
1115 * are managed in software: interfaces of these types aren't subject to 1139 * are managed in software: interfaces of these types aren't subject to
1116 * any restrictions in their number or combinations. 1140 * any restrictions in their number or combinations.
1117 * 1141 *
1118 * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information 1142 * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information
1119 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data. 1143 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
1120 * 1144 *
1121 * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan, 1145 * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan,
@@ -1182,7 +1206,6 @@ enum nl80211_commands {
1182 * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from 1206 * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from
1183 * &enum nl80211_feature_flags and is advertised in wiphy information. 1207 * &enum nl80211_feature_flags and is advertised in wiphy information.
1184 * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe 1208 * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe
1185 *
1186 * requests while operating in AP-mode. 1209 * requests while operating in AP-mode.
1187 * This attribute holds a bitmap of the supported protocols for 1210 * This attribute holds a bitmap of the supported protocols for
1188 * offloading (see &enum nl80211_probe_resp_offload_support_attr). 1211 * offloading (see &enum nl80211_probe_resp_offload_support_attr).
@@ -1222,6 +1245,12 @@ enum nl80211_commands {
1222 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds 1245 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
1223 * or 0 to disable background scan. 1246 * or 0 to disable background scan.
1224 * 1247 *
1248 * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from
1249 * userspace. If unset it is assumed the hint comes directly from
1250 * a user. If set code could specify exactly what type of source
1251 * was used to provide the hint. For the different types of
1252 * allowed user regulatory hints see nl80211_user_reg_hint_type.
1253 *
1225 * @NL80211_ATTR_MAX: highest attribute number currently defined 1254 * @NL80211_ATTR_MAX: highest attribute number currently defined
1226 * @__NL80211_ATTR_AFTER_LAST: internal use 1255 * @__NL80211_ATTR_AFTER_LAST: internal use
1227 */ 1256 */
@@ -1473,6 +1502,10 @@ enum nl80211_attrs {
1473 1502
1474 NL80211_ATTR_BG_SCAN_PERIOD, 1503 NL80211_ATTR_BG_SCAN_PERIOD,
1475 1504
1505 NL80211_ATTR_WDEV,
1506
1507 NL80211_ATTR_USER_REG_HINT_TYPE,
1508
1476 /* add attributes here, update the policy in nl80211.c */ 1509 /* add attributes here, update the policy in nl80211.c */
1477 1510
1478 __NL80211_ATTR_AFTER_LAST, 1511 __NL80211_ATTR_AFTER_LAST,
@@ -1520,6 +1553,13 @@ enum nl80211_attrs {
1520#define NL80211_MAX_NR_CIPHER_SUITES 5 1553#define NL80211_MAX_NR_CIPHER_SUITES 5
1521#define NL80211_MAX_NR_AKM_SUITES 2 1554#define NL80211_MAX_NR_AKM_SUITES 2
1522 1555
1556#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
1557
1558/* default RSSI threshold for scan results if none specified. */
1559#define NL80211_SCAN_RSSI_THOLD_OFF -300
1560
1561#define NL80211_CQM_TXE_MAX_INTVL 1800
1562
1523/** 1563/**
1524 * enum nl80211_iftype - (virtual) interface types 1564 * enum nl80211_iftype - (virtual) interface types
1525 * 1565 *
@@ -1613,12 +1653,20 @@ struct nl80211_sta_flag_update {
1613 * 1653 *
1614 * These attribute types are used with %NL80211_STA_INFO_TXRATE 1654 * These attribute types are used with %NL80211_STA_INFO_TXRATE
1615 * when getting information about the bitrate of a station. 1655 * when getting information about the bitrate of a station.
1656 * There are 2 attributes for bitrate, a legacy one that represents
1657 * a 16-bit value, and new one that represents a 32-bit value.
1658 * If the rate value fits into 16 bit, both attributes are reported
1659 * with the same value. If the rate is too high to fit into 16 bits
1660 * (>6.5535Gbps) only 32-bit attribute is included.
1661 * User space tools encouraged to use the 32-bit attribute and fall
1662 * back to the 16-bit one for compatibility with older kernels.
1616 * 1663 *
1617 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved 1664 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
1618 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) 1665 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
1619 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) 1666 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
1620 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate 1667 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate
1621 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval 1668 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
1669 * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
1622 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined 1670 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
1623 * @__NL80211_RATE_INFO_AFTER_LAST: internal use 1671 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
1624 */ 1672 */
@@ -1628,6 +1676,7 @@ enum nl80211_rate_info {
1628 NL80211_RATE_INFO_MCS, 1676 NL80211_RATE_INFO_MCS,
1629 NL80211_RATE_INFO_40_MHZ_WIDTH, 1677 NL80211_RATE_INFO_40_MHZ_WIDTH,
1630 NL80211_RATE_INFO_SHORT_GI, 1678 NL80211_RATE_INFO_SHORT_GI,
1679 NL80211_RATE_INFO_BITRATE32,
1631 1680
1632 /* keep last */ 1681 /* keep last */
1633 __NL80211_RATE_INFO_AFTER_LAST, 1682 __NL80211_RATE_INFO_AFTER_LAST,
@@ -1788,6 +1837,9 @@ enum nl80211_mpath_info {
1788 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE 1837 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
1789 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n 1838 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
1790 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n 1839 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
1840 * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as
1841 * defined in 802.11ac
1842 * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
1791 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined 1843 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
1792 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use 1844 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
1793 */ 1845 */
@@ -1801,6 +1853,9 @@ enum nl80211_band_attr {
1801 NL80211_BAND_ATTR_HT_AMPDU_FACTOR, 1853 NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
1802 NL80211_BAND_ATTR_HT_AMPDU_DENSITY, 1854 NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
1803 1855
1856 NL80211_BAND_ATTR_VHT_MCS_SET,
1857 NL80211_BAND_ATTR_VHT_CAPA,
1858
1804 /* keep last */ 1859 /* keep last */
1805 __NL80211_BAND_ATTR_AFTER_LAST, 1860 __NL80211_BAND_ATTR_AFTER_LAST,
1806 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 1861 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
@@ -1952,6 +2007,8 @@ enum nl80211_reg_rule_attr {
1952 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved 2007 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
1953 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, 2008 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
1954 * only report BSS with matching SSID. 2009 * only report BSS with matching SSID.
2010 * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
2011 * BSS in scan results. Filtering is turned off if not specified.
1955 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter 2012 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
1956 * attribute number currently defined 2013 * attribute number currently defined
1957 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use 2014 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
@@ -1959,7 +2016,8 @@ enum nl80211_reg_rule_attr {
1959enum nl80211_sched_scan_match_attr { 2016enum nl80211_sched_scan_match_attr {
1960 __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, 2017 __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
1961 2018
1962 NL80211_ATTR_SCHED_SCAN_MATCH_SSID, 2019 NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
2020 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
1963 2021
1964 /* keep last */ 2022 /* keep last */
1965 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, 2023 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
@@ -1967,6 +2025,9 @@ enum nl80211_sched_scan_match_attr {
1967 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 2025 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
1968}; 2026};
1969 2027
2028/* only for backward compatibility */
2029#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID
2030
1970/** 2031/**
1971 * enum nl80211_reg_rule_flags - regulatory rule flags 2032 * enum nl80211_reg_rule_flags - regulatory rule flags
1972 * 2033 *
@@ -2008,6 +2069,26 @@ enum nl80211_dfs_regions {
2008}; 2069};
2009 2070
2010/** 2071/**
2072 * enum nl80211_user_reg_hint_type - type of user regulatory hint
2073 *
2074 * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always
2075 * assumed if the attribute is not set.
2076 * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular
2077 * base station. Device drivers that have been tested to work
2078 * properly to support this type of hint can enable these hints
2079 * by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature
2080 * capability on the struct wiphy. The wireless core will
2081 * ignore all cell base station hints until at least one device
2082 * present has been registered with the wireless core that
2083 * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
2084 * supported feature.
2085 */
2086enum nl80211_user_reg_hint_type {
2087 NL80211_USER_REG_HINT_USER = 0,
2088 NL80211_USER_REG_HINT_CELL_BASE = 1,
2089};
2090
2091/**
2011 * enum nl80211_survey_info - survey information 2092 * enum nl80211_survey_info - survey information
2012 * 2093 *
2013 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO 2094 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
@@ -2086,78 +2167,91 @@ enum nl80211_mntr_flags {
2086 * @__NL80211_MESHCONF_INVALID: internal use 2167 * @__NL80211_MESHCONF_INVALID: internal use
2087 * 2168 *
2088 * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in 2169 * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
2089 * millisecond units, used by the Peer Link Open message 2170 * millisecond units, used by the Peer Link Open message
2090 * 2171 *
2091 * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in 2172 * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in
2092 * millisecond units, used by the peer link management to close a peer link 2173 * millisecond units, used by the peer link management to close a peer link
2093 * 2174 *
2094 * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in 2175 * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
2095 * millisecond units 2176 * millisecond units
2096 * 2177 *
2097 * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed 2178 * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
2098 * on this mesh interface 2179 * on this mesh interface
2099 * 2180 *
2100 * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link 2181 * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
2101 * open retries that can be sent to establish a new peer link instance in a 2182 * open retries that can be sent to establish a new peer link instance in a
2102 * mesh 2183 * mesh
2103 * 2184 *
2104 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh 2185 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
2105 * point. 2186 * point.
2106 * 2187 *
2107 * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically 2188 * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically
2108 * open peer links when we detect compatible mesh peers. 2189 * open peer links when we detect compatible mesh peers.
2109 * 2190 *
2110 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames 2191 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
2111 * containing a PREQ that an MP can send to a particular destination (path 2192 * containing a PREQ that an MP can send to a particular destination (path
2112 * target) 2193 * target)
2113 * 2194 *
2114 * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths 2195 * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
2115 * (in milliseconds) 2196 * (in milliseconds)
2116 * 2197 *
2117 * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait 2198 * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
2118 * until giving up on a path discovery (in milliseconds) 2199 * until giving up on a path discovery (in milliseconds)
2119 * 2200 *
2120 * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh 2201 * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
2121 * points receiving a PREQ shall consider the forwarding information from the 2202 * points receiving a PREQ shall consider the forwarding information from
2122 * root to be valid. (TU = time unit) 2203 * the root to be valid. (TU = time unit)
2123 * 2204 *
2124 * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in 2205 * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
2125 * TUs) during which an MP can send only one action frame containing a PREQ 2206 * TUs) during which an MP can send only one action frame containing a PREQ
2126 * reference element 2207 * reference element
2127 * 2208 *
2128 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) 2209 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
2129 * that it takes for an HWMP information element to propagate across the mesh 2210 * that it takes for an HWMP information element to propagate across the
2211 * mesh
2130 * 2212 *
2131 * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not 2213 * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
2132 * 2214 *
2133 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a 2215 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
2134 * source mesh point for path selection elements. 2216 * source mesh point for path selection elements.
2135 * 2217 *
2136 * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between 2218 * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between
2137 * root announcements are transmitted. 2219 * root announcements are transmitted.
2138 * 2220 *
2139 * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has 2221 * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has
2140 * access to a broader network beyond the MBSS. This is done via Root 2222 * access to a broader network beyond the MBSS. This is done via Root
2141 * Announcement frames. 2223 * Announcement frames.
2142 * 2224 *
2143 * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in 2225 * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in
2144 * TUs) during which a mesh STA can send only one Action frame containing a 2226 * TUs) during which a mesh STA can send only one Action frame containing a
2145 * PERR element. 2227 * PERR element.
2146 * 2228 *
2147 * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding 2229 * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
2148 * or forwarding entity (default is TRUE - forwarding entity) 2230 * or forwarding entity (default is TRUE - forwarding entity)
2149 * 2231 *
2150 * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the 2232 * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
2151 * threshold for average signal strength of candidate station to establish 2233 * threshold for average signal strength of candidate station to establish
2152 * a peer link. 2234 * a peer link.
2153 *
2154 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
2155 * 2235 *
2156 * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors 2236 * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
2157 * to synchronize to for 11s default synchronization method (see 11C.12.2.2) 2237 * to synchronize to for 11s default synchronization method
2238 * (see 11C.12.2.2)
2158 * 2239 *
2159 * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode. 2240 * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
2160 * 2241 *
2242 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
2243 *
2244 * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for
2245 * which mesh STAs receiving a proactive PREQ shall consider the forwarding
2246 * information to the root mesh STA to be valid.
2247 *
2248 * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between
2249 * proactive PREQs are transmitted.
2250 *
2251 * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time
2252 * (in TUs) during which a mesh STA can send only one Action frame
2253 * containing a PREQ element for root path confirmation.
2254 *
2161 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2255 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
2162 */ 2256 */
2163enum nl80211_meshconf_params { 2257enum nl80211_meshconf_params {
@@ -2184,6 +2278,9 @@ enum nl80211_meshconf_params {
2184 NL80211_MESHCONF_RSSI_THRESHOLD, 2278 NL80211_MESHCONF_RSSI_THRESHOLD,
2185 NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, 2279 NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
2186 NL80211_MESHCONF_HT_OPMODE, 2280 NL80211_MESHCONF_HT_OPMODE,
2281 NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
2282 NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
2283 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
2187 2284
2188 /* keep last */ 2285 /* keep last */
2189 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2286 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -2199,34 +2296,36 @@ enum nl80211_meshconf_params {
2199 * @__NL80211_MESH_SETUP_INVALID: Internal use 2296 * @__NL80211_MESH_SETUP_INVALID: Internal use
2200 * 2297 *
2201 * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a 2298 * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a
2202 * vendor specific path selection algorithm or disable it to use the default 2299 * vendor specific path selection algorithm or disable it to use the
2203 * HWMP. 2300 * default HWMP.
2204 * 2301 *
2205 * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a 2302 * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a
2206 * vendor specific path metric or disable it to use the default Airtime 2303 * vendor specific path metric or disable it to use the default Airtime
2207 * metric. 2304 * metric.
2208 * 2305 *
2209 * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a 2306 * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a
2210 * robust security network ie, or a vendor specific information element that 2307 * robust security network ie, or a vendor specific information element
2211 * vendors will use to identify the path selection methods and metrics in use. 2308 * that vendors will use to identify the path selection methods and
2309 * metrics in use.
2212 * 2310 *
2213 * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication 2311 * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication
2214 * daemon will be authenticating mesh candidates. 2312 * daemon will be authenticating mesh candidates.
2215 * 2313 *
2216 * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication 2314 * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication
2217 * daemon will be securing peer link frames. AMPE is a secured version of Mesh 2315 * daemon will be securing peer link frames. AMPE is a secured version of
2218 * Peering Management (MPM) and is implemented with the assistance of a 2316 * Mesh Peering Management (MPM) and is implemented with the assistance of
2219 * userspace daemon. When this flag is set, the kernel will send peer 2317 * a userspace daemon. When this flag is set, the kernel will send peer
2220 * management frames to a userspace daemon that will implement AMPE 2318 * management frames to a userspace daemon that will implement AMPE
2221 * functionality (security capabilities selection, key confirmation, and key 2319 * functionality (security capabilities selection, key confirmation, and
2222 * management). When the flag is unset (default), the kernel can autonomously 2320 * key management). When the flag is unset (default), the kernel can
2223 * complete (unsecured) mesh peering without the need of a userspace daemon. 2321 * autonomously complete (unsecured) mesh peering without the need of a
2224 * 2322 * userspace daemon.
2225 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2226 * 2323 *
2227 * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a 2324 * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a
2228 * vendor specific synchronization method or disable it to use the default 2325 * vendor specific synchronization method or disable it to use the default
2229 * neighbor offset synchronization 2326 * neighbor offset synchronization
2327 *
2328 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2230 * 2329 *
2231 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use 2330 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
2232 */ 2331 */
@@ -2490,12 +2589,19 @@ enum nl80211_tx_rate_attributes {
2490 * enum nl80211_band - Frequency band 2589 * enum nl80211_band - Frequency band
2491 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band 2590 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
2492 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) 2591 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
2592 * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
2493 */ 2593 */
2494enum nl80211_band { 2594enum nl80211_band {
2495 NL80211_BAND_2GHZ, 2595 NL80211_BAND_2GHZ,
2496 NL80211_BAND_5GHZ, 2596 NL80211_BAND_5GHZ,
2597 NL80211_BAND_60GHZ,
2497}; 2598};
2498 2599
2600/**
2601 * enum nl80211_ps_state - powersave state
2602 * @NL80211_PS_DISABLED: powersave is disabled
2603 * @NL80211_PS_ENABLED: powersave is enabled
2604 */
2499enum nl80211_ps_state { 2605enum nl80211_ps_state {
2500 NL80211_PS_DISABLED, 2606 NL80211_PS_DISABLED,
2501 NL80211_PS_ENABLED, 2607 NL80211_PS_ENABLED,
@@ -2513,6 +2619,17 @@ enum nl80211_ps_state {
2513 * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event 2619 * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
2514 * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many 2620 * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
2515 * consecutive packets were not acknowledged by the peer 2621 * consecutive packets were not acknowledged by the peer
2622 * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures
2623 * during the given %NL80211_ATTR_CQM_TXE_INTVL before an
2624 * %NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and
2625 * %NL80211_ATTR_CQM_TXE_PKTS is generated.
2626 * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given
2627 * %NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is
2628 * checked.
2629 * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic
2630 * interval in which %NL80211_ATTR_CQM_TXE_PKTS and
2631 * %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
2632 * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
2516 * @__NL80211_ATTR_CQM_AFTER_LAST: internal 2633 * @__NL80211_ATTR_CQM_AFTER_LAST: internal
2517 * @NL80211_ATTR_CQM_MAX: highest key attribute 2634 * @NL80211_ATTR_CQM_MAX: highest key attribute
2518 */ 2635 */
@@ -2522,6 +2639,9 @@ enum nl80211_attr_cqm {
2522 NL80211_ATTR_CQM_RSSI_HYST, 2639 NL80211_ATTR_CQM_RSSI_HYST,
2523 NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, 2640 NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
2524 NL80211_ATTR_CQM_PKT_LOSS_EVENT, 2641 NL80211_ATTR_CQM_PKT_LOSS_EVENT,
2642 NL80211_ATTR_CQM_TXE_RATE,
2643 NL80211_ATTR_CQM_TXE_PKTS,
2644 NL80211_ATTR_CQM_TXE_INTVL,
2525 2645
2526 /* keep last */ 2646 /* keep last */
2527 __NL80211_ATTR_CQM_AFTER_LAST, 2647 __NL80211_ATTR_CQM_AFTER_LAST,
@@ -2534,10 +2654,14 @@ enum nl80211_attr_cqm {
2534 * configured threshold 2654 * configured threshold
2535 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the 2655 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
2536 * configured threshold 2656 * configured threshold
2657 * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss.
2658 * (Note that deauth/disassoc will still follow if the AP is not
2659 * available. This event might get used as roaming event, etc.)
2537 */ 2660 */
2538enum nl80211_cqm_rssi_threshold_event { 2661enum nl80211_cqm_rssi_threshold_event {
2539 NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, 2662 NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
2540 NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, 2663 NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
2664 NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
2541}; 2665};
2542 2666
2543 2667
@@ -2867,11 +2991,15 @@ enum nl80211_ap_sme_features {
2867 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. 2991 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
2868 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up 2992 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
2869 * the connected inactive stations in AP mode. 2993 * the connected inactive stations in AP mode.
2994 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
2995 * to work properly to suppport receiving regulatory hints from
2996 * cellular base stations.
2870 */ 2997 */
2871enum nl80211_feature_flags { 2998enum nl80211_feature_flags {
2872 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 2999 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
2873 NL80211_FEATURE_HT_IBSS = 1 << 1, 3000 NL80211_FEATURE_HT_IBSS = 1 << 1,
2874 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, 3001 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
3002 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
2875}; 3003};
2876 3004
2877/** 3005/**
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h
index 5a3db3aa5f17..fd4f2d1cdf6c 100644
--- a/include/linux/nl802154.h
+++ b/include/linux/nl802154.h
@@ -130,18 +130,8 @@ enum {
130enum { 130enum {
131 __IEEE802154_DEV_INVALID = -1, 131 __IEEE802154_DEV_INVALID = -1,
132 132
133 /* TODO: 133 IEEE802154_DEV_WPAN,
134 * Nowadays three device types supported by this stack at linux-zigbee 134 IEEE802154_DEV_MONITOR,
135 * project: WPAN = 0, MONITOR = 1 and SMAC = 2.
136 *
137 * Since this stack implementation exists many years, it's definitely
138 * bad idea to change the assigned values due to they are already used
139 * by third-party userspace software like: iz-tools, wireshark...
140 *
141 * Currently only monitor device is added and initialized by '1' for
142 * compatibility.
143 */
144 IEEE802154_DEV_MONITOR = 1,
145 135
146 __IEEE802154_DEV_MAX, 136 __IEEE802154_DEV_MAX,
147}; 137};
diff --git a/include/linux/of.h b/include/linux/of.h
index 76930ee78db5..e6c6b167949d 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -261,8 +261,7 @@ extern int of_machine_is_compatible(const char *compat);
261extern int prom_add_property(struct device_node* np, struct property* prop); 261extern int prom_add_property(struct device_node* np, struct property* prop);
262extern int prom_remove_property(struct device_node *np, struct property *prop); 262extern int prom_remove_property(struct device_node *np, struct property *prop);
263extern int prom_update_property(struct device_node *np, 263extern int prom_update_property(struct device_node *np,
264 struct property *newprop, 264 struct property *newprop);
265 struct property *oldprop);
266 265
267#if defined(CONFIG_OF_DYNAMIC) 266#if defined(CONFIG_OF_DYNAMIC)
268/* For updating the device tree at runtime */ 267/* For updating the device tree at runtime */
diff --git a/include/linux/of_iommu.h b/include/linux/of_iommu.h
new file mode 100644
index 000000000000..51a560f34bca
--- /dev/null
+++ b/include/linux/of_iommu.h
@@ -0,0 +1,21 @@
1#ifndef __OF_IOMMU_H
2#define __OF_IOMMU_H
3
4#ifdef CONFIG_OF_IOMMU
5
6extern int of_get_dma_window(struct device_node *dn, const char *prefix,
7 int index, unsigned long *busno, dma_addr_t *addr,
8 size_t *size);
9
10#else
11
12static inline int of_get_dma_window(struct device_node *dn, const char *prefix,
13 int index, unsigned long *busno, dma_addr_t *addr,
14 size_t *size)
15{
16 return -EINVAL;
17}
18
19#endif /* CONFIG_OF_IOMMU */
20
21#endif /* __OF_IOMMU_H */
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
index bae1b6094c63..ed7f267e6389 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -11,7 +11,7 @@
11 11
12#ifdef CONFIG_OF_MTD 12#ifdef CONFIG_OF_MTD
13#include <linux/of.h> 13#include <linux/of.h>
14extern const int of_get_nand_ecc_mode(struct device_node *np); 14int of_get_nand_ecc_mode(struct device_node *np);
15int of_get_nand_bus_width(struct device_node *np); 15int of_get_nand_bus_width(struct device_node *np);
16bool of_get_nand_on_flash_bbt(struct device_node *np); 16bool of_get_nand_on_flash_bbt(struct device_node *np);
17#endif 17#endif
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 44623500f419..248fba2af98a 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -17,6 +17,7 @@ extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev);
17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev, 17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
18 struct pci_dev *pci_dev); 18 struct pci_dev *pci_dev);
19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev); 19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev);
20extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
20 21
21static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) 22static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
22{ 23{
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fefb4e19bf6a..5faa8310eec9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -132,9 +132,10 @@ static inline const char *pci_power_name(pci_power_t state)
132 return pci_power_names[1 + (int) state]; 132 return pci_power_names[1 + (int) state];
133} 133}
134 134
135#define PCI_PM_D2_DELAY 200 135#define PCI_PM_D2_DELAY 200
136#define PCI_PM_D3_WAIT 10 136#define PCI_PM_D3_WAIT 10
137#define PCI_PM_BUS_WAIT 50 137#define PCI_PM_D3COLD_WAIT 100
138#define PCI_PM_BUS_WAIT 50
138 139
139/** The pci_channel state describes connectivity between the CPU and 140/** The pci_channel state describes connectivity between the CPU and
140 * the pci device. If some PCI bus between here and the pci device 141 * the pci device. If some PCI bus between here and the pci device
@@ -176,8 +177,6 @@ enum pci_dev_flags {
176 PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, 177 PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2,
177 /* Provide indication device is assigned by a Virtual Machine Manager */ 178 /* Provide indication device is assigned by a Virtual Machine Manager */
178 PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4, 179 PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4,
179 /* Device causes system crash if in D3 during S3 sleep */
180 PCI_DEV_FLAGS_NO_D3_DURING_SLEEP = (__force pci_dev_flags_t) 8,
181}; 180};
182 181
183enum pci_irq_reroute_variant { 182enum pci_irq_reroute_variant {
@@ -280,11 +279,18 @@ struct pci_dev {
280 unsigned int pme_poll:1; /* Poll device's PME status bit */ 279 unsigned int pme_poll:1; /* Poll device's PME status bit */
281 unsigned int d1_support:1; /* Low power state D1 is supported */ 280 unsigned int d1_support:1; /* Low power state D1 is supported */
282 unsigned int d2_support:1; /* Low power state D2 is supported */ 281 unsigned int d2_support:1; /* Low power state D2 is supported */
283 unsigned int no_d1d2:1; /* Only allow D0 and D3 */ 282 unsigned int no_d1d2:1; /* D1 and D2 are forbidden */
283 unsigned int no_d3cold:1; /* D3cold is forbidden */
284 unsigned int d3cold_allowed:1; /* D3cold is allowed by user */
284 unsigned int mmio_always_on:1; /* disallow turning off io/mem 285 unsigned int mmio_always_on:1; /* disallow turning off io/mem
285 decoding during bar sizing */ 286 decoding during bar sizing */
286 unsigned int wakeup_prepared:1; 287 unsigned int wakeup_prepared:1;
288 unsigned int runtime_d3cold:1; /* whether go through runtime
289 D3cold, not set for devices
290 powered on/off by the
291 corresponding bridge */
287 unsigned int d3_delay; /* D3->D0 transition time in ms */ 292 unsigned int d3_delay; /* D3->D0 transition time in ms */
293 unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */
288 294
289#ifdef CONFIG_PCIEASPM 295#ifdef CONFIG_PCIEASPM
290 struct pcie_link_state *link_state; /* ASPM link state. */ 296 struct pcie_link_state *link_state; /* ASPM link state. */
@@ -326,6 +332,8 @@ struct pci_dev {
326 unsigned int is_hotplug_bridge:1; 332 unsigned int is_hotplug_bridge:1;
327 unsigned int __aer_firmware_first_valid:1; 333 unsigned int __aer_firmware_first_valid:1;
328 unsigned int __aer_firmware_first:1; 334 unsigned int __aer_firmware_first:1;
335 unsigned int broken_intx_masking:1;
336 unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */
329 pci_dev_flags_t dev_flags; 337 pci_dev_flags_t dev_flags;
330 atomic_t enable_cnt; /* pci_enable_device has been called */ 338 atomic_t enable_cnt; /* pci_enable_device has been called */
331 339
@@ -370,6 +378,8 @@ static inline int pci_channel_offline(struct pci_dev *pdev)
370 return (pdev->error_state != pci_channel_io_normal); 378 return (pdev->error_state != pci_channel_io_normal);
371} 379}
372 380
381extern struct resource busn_resource;
382
373struct pci_host_bridge_window { 383struct pci_host_bridge_window {
374 struct list_head list; 384 struct list_head list;
375 struct resource *res; /* host bridge aperture (CPU address) */ 385 struct resource *res; /* host bridge aperture (CPU address) */
@@ -421,6 +431,7 @@ struct pci_bus {
421 struct list_head slots; /* list of slots on this bus */ 431 struct list_head slots; /* list of slots on this bus */
422 struct resource *resource[PCI_BRIDGE_RESOURCE_NUM]; 432 struct resource *resource[PCI_BRIDGE_RESOURCE_NUM];
423 struct list_head resources; /* address space routed to this bus */ 433 struct list_head resources; /* address space routed to this bus */
434 struct resource busn_res; /* bus numbers routed to this bus */
424 435
425 struct pci_ops *ops; /* configuration access functions */ 436 struct pci_ops *ops; /* configuration access functions */
426 void *sysdata; /* hook for sys-specific extension */ 437 void *sysdata; /* hook for sys-specific extension */
@@ -428,8 +439,6 @@ struct pci_bus {
428 439
429 unsigned char number; /* bus number */ 440 unsigned char number; /* bus number */
430 unsigned char primary; /* number of primary bridge */ 441 unsigned char primary; /* number of primary bridge */
431 unsigned char secondary; /* number of secondary bridge */
432 unsigned char subordinate; /* max number of subordinate buses */
433 unsigned char max_bus_speed; /* enum pci_bus_speed */ 442 unsigned char max_bus_speed; /* enum pci_bus_speed */
434 unsigned char cur_bus_speed; /* enum pci_bus_speed */ 443 unsigned char cur_bus_speed; /* enum pci_bus_speed */
435 444
@@ -476,6 +485,32 @@ static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false;
476#define PCIBIOS_SET_FAILED 0x88 485#define PCIBIOS_SET_FAILED 0x88
477#define PCIBIOS_BUFFER_TOO_SMALL 0x89 486#define PCIBIOS_BUFFER_TOO_SMALL 0x89
478 487
488/*
489 * Translate above to generic errno for passing back through non-pci.
490 */
491static inline int pcibios_err_to_errno(int err)
492{
493 if (err <= PCIBIOS_SUCCESSFUL)
494 return err; /* Assume already errno */
495
496 switch (err) {
497 case PCIBIOS_FUNC_NOT_SUPPORTED:
498 return -ENOENT;
499 case PCIBIOS_BAD_VENDOR_ID:
500 return -EINVAL;
501 case PCIBIOS_DEVICE_NOT_FOUND:
502 return -ENODEV;
503 case PCIBIOS_BAD_REGISTER_NUMBER:
504 return -EFAULT;
505 case PCIBIOS_SET_FAILED:
506 return -EIO;
507 case PCIBIOS_BUFFER_TOO_SMALL:
508 return -ENOSPC;
509 }
510
511 return -ENOTTY;
512}
513
479/* Low-level architecture-dependent routines */ 514/* Low-level architecture-dependent routines */
480 515
481struct pci_ops { 516struct pci_ops {
@@ -644,6 +679,7 @@ extern int no_pci_devices(void);
644 679
645void pcibios_fixup_bus(struct pci_bus *); 680void pcibios_fixup_bus(struct pci_bus *);
646int __must_check pcibios_enable_device(struct pci_dev *, int mask); 681int __must_check pcibios_enable_device(struct pci_dev *, int mask);
682/* Architecture specific versions may override this (weak) */
647char *pcibios_setup(char *str); 683char *pcibios_setup(char *str);
648 684
649/* Used only when drivers/pci/setup.c is used */ 685/* Used only when drivers/pci/setup.c is used */
@@ -670,6 +706,9 @@ struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
670struct pci_bus *pci_create_root_bus(struct device *parent, int bus, 706struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
671 struct pci_ops *ops, void *sysdata, 707 struct pci_ops *ops, void *sysdata,
672 struct list_head *resources); 708 struct list_head *resources);
709int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);
710int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);
711void pci_bus_release_busn_res(struct pci_bus *b);
673struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, 712struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
674 struct pci_ops *ops, void *sysdata, 713 struct pci_ops *ops, void *sysdata,
675 struct list_head *resources); 714 struct list_head *resources);
@@ -716,8 +755,6 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev);
716int pci_find_capability(struct pci_dev *dev, int cap); 755int pci_find_capability(struct pci_dev *dev, int cap);
717int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); 756int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap);
718int pci_find_ext_capability(struct pci_dev *dev, int cap); 757int pci_find_ext_capability(struct pci_dev *dev, int cap);
719int pci_bus_find_ext_capability(struct pci_bus *bus, unsigned int devfn,
720 int cap);
721int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); 758int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);
722int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 759int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap);
723struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 760struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
@@ -779,6 +816,14 @@ static inline int pci_write_config_dword(const struct pci_dev *dev, int where,
779 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); 816 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val);
780} 817}
781 818
819/* user-space driven config access */
820int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val);
821int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val);
822int pci_user_read_config_dword(struct pci_dev *dev, int where, u32 *val);
823int pci_user_write_config_byte(struct pci_dev *dev, int where, u8 val);
824int pci_user_write_config_word(struct pci_dev *dev, int where, u16 val);
825int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val);
826
782int __must_check pci_enable_device(struct pci_dev *dev); 827int __must_check pci_enable_device(struct pci_dev *dev);
783int __must_check pci_enable_device_io(struct pci_dev *dev); 828int __must_check pci_enable_device_io(struct pci_dev *dev);
784int __must_check pci_enable_device_mem(struct pci_dev *dev); 829int __must_check pci_enable_device_mem(struct pci_dev *dev);
@@ -877,7 +922,6 @@ enum pci_obff_signal_type {
877int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); 922int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
878void pci_disable_obff(struct pci_dev *dev); 923void pci_disable_obff(struct pci_dev *dev);
879 924
880bool pci_ltr_supported(struct pci_dev *dev);
881int pci_enable_ltr(struct pci_dev *dev); 925int pci_enable_ltr(struct pci_dev *dev);
882void pci_disable_ltr(struct pci_dev *dev); 926void pci_disable_ltr(struct pci_dev *dev);
883int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns); 927int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns);
@@ -1334,6 +1378,9 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1334static inline int pci_domain_nr(struct pci_bus *bus) 1378static inline int pci_domain_nr(struct pci_bus *bus)
1335{ return 0; } 1379{ return 0; }
1336 1380
1381static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1382{ return NULL; }
1383
1337#define dev_is_pci(d) (false) 1384#define dev_is_pci(d) (false)
1338#define dev_is_pf(d) (false) 1385#define dev_is_pf(d) (false)
1339#define dev_num_vf(d) (0) 1386#define dev_num_vf(d) (0)
@@ -1488,9 +1535,20 @@ enum pci_fixup_pass {
1488 1535
1489#ifdef CONFIG_PCI_QUIRKS 1536#ifdef CONFIG_PCI_QUIRKS
1490void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 1537void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
1538struct pci_dev *pci_get_dma_source(struct pci_dev *dev);
1539int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags);
1491#else 1540#else
1492static inline void pci_fixup_device(enum pci_fixup_pass pass, 1541static inline void pci_fixup_device(enum pci_fixup_pass pass,
1493 struct pci_dev *dev) {} 1542 struct pci_dev *dev) {}
1543static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev)
1544{
1545 return pci_dev_get(dev);
1546}
1547static inline int pci_dev_specific_acs_enabled(struct pci_dev *dev,
1548 u16 acs_flags)
1549{
1550 return -ENOTTY;
1551}
1494#endif 1552#endif
1495 1553
1496void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); 1554void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
@@ -1593,7 +1651,9 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
1593} 1651}
1594 1652
1595void pci_request_acs(void); 1653void pci_request_acs(void);
1596 1654bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);
1655bool pci_acs_path_enabled(struct pci_dev *start,
1656 struct pci_dev *end, u16 acs_flags);
1597 1657
1598#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */ 1658#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
1599#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT) 1659#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ab741b0d0074..fc3526077348 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -517,6 +517,7 @@
517#define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302 517#define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302
518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303
519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304
520#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403
520#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600 521#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600
521#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601 522#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601
522#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602 523#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602
@@ -2755,6 +2756,17 @@
2755#define PCI_DEVICE_ID_INTEL_IOAT_SNB7 0x3c27 2756#define PCI_DEVICE_ID_INTEL_IOAT_SNB7 0x3c27
2756#define PCI_DEVICE_ID_INTEL_IOAT_SNB8 0x3c2e 2757#define PCI_DEVICE_ID_INTEL_IOAT_SNB8 0x3c2e
2757#define PCI_DEVICE_ID_INTEL_IOAT_SNB9 0x3c2f 2758#define PCI_DEVICE_ID_INTEL_IOAT_SNB9 0x3c2f
2759#define PCI_DEVICE_ID_INTEL_UNC_HA 0x3c46
2760#define PCI_DEVICE_ID_INTEL_UNC_IMC0 0x3cb0
2761#define PCI_DEVICE_ID_INTEL_UNC_IMC1 0x3cb1
2762#define PCI_DEVICE_ID_INTEL_UNC_IMC2 0x3cb4
2763#define PCI_DEVICE_ID_INTEL_UNC_IMC3 0x3cb5
2764#define PCI_DEVICE_ID_INTEL_UNC_QPI0 0x3c41
2765#define PCI_DEVICE_ID_INTEL_UNC_QPI1 0x3c42
2766#define PCI_DEVICE_ID_INTEL_UNC_R2PCIE 0x3c43
2767#define PCI_DEVICE_ID_INTEL_UNC_R3QPI0 0x3c44
2768#define PCI_DEVICE_ID_INTEL_UNC_R3QPI1 0x3c45
2769#define PCI_DEVICE_ID_INTEL_JAKETOWN_UBOX 0x3ce0
2758#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f 2770#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
2759#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 2771#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0
2760#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 2772#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 4b608f543412..53274bff5773 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -26,6 +26,7 @@
26 * Under PCI, each device has 256 bytes of configuration address space, 26 * Under PCI, each device has 256 bytes of configuration address space,
27 * of which the first 64 bytes are standardized as follows: 27 * of which the first 64 bytes are standardized as follows:
28 */ 28 */
29#define PCI_STD_HEADER_SIZEOF 64
29#define PCI_VENDOR_ID 0x00 /* 16 bits */ 30#define PCI_VENDOR_ID 0x00 /* 16 bits */
30#define PCI_DEVICE_ID 0x02 /* 16 bits */ 31#define PCI_DEVICE_ID 0x02 /* 16 bits */
31#define PCI_COMMAND 0x04 /* 16 bits */ 32#define PCI_COMMAND 0x04 /* 16 bits */
@@ -125,7 +126,8 @@
125#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ 126#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
126#define PCI_IO_RANGE_TYPE_16 0x00 127#define PCI_IO_RANGE_TYPE_16 0x00
127#define PCI_IO_RANGE_TYPE_32 0x01 128#define PCI_IO_RANGE_TYPE_32 0x01
128#define PCI_IO_RANGE_MASK (~0x0fUL) 129#define PCI_IO_RANGE_MASK (~0x0fUL) /* Standard 4K I/O windows */
130#define PCI_IO_1K_RANGE_MASK (~0x03UL) /* Intel 1K I/O windows */
129#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ 131#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
130#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ 132#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
131#define PCI_MEMORY_LIMIT 0x22 133#define PCI_MEMORY_LIMIT 0x22
@@ -209,9 +211,12 @@
209#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 211#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
210#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ 212#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */
211#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ 213#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */
214#define PCI_CAP_ID_SECDEV 0x0F /* Secure Device */
212#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 215#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
213#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 216#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
217#define PCI_CAP_ID_SATA 0x12 /* SATA Data/Index Conf. */
214#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */ 218#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */
219#define PCI_CAP_ID_MAX PCI_CAP_ID_AF
215#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ 220#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
216#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ 221#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
217#define PCI_CAP_SIZEOF 4 222#define PCI_CAP_SIZEOF 4
@@ -276,6 +281,7 @@
276#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ 281#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
277#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ 282#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
278#define PCI_VPD_DATA 4 /* 32-bits of data returned here */ 283#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
284#define PCI_CAP_VPD_SIZEOF 8
279 285
280/* Slot Identification */ 286/* Slot Identification */
281 287
@@ -297,8 +303,10 @@
297#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ 303#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
298#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ 304#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
299#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */ 305#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */
306#define PCI_MSI_PENDING_32 16 /* Pending intrs for 32-bit devices */
300#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 307#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
301#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ 308#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
309#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */
302 310
303/* MSI-X registers */ 311/* MSI-X registers */
304#define PCI_MSIX_FLAGS 2 312#define PCI_MSIX_FLAGS 2
@@ -308,6 +316,7 @@
308#define PCI_MSIX_TABLE 4 316#define PCI_MSIX_TABLE 4
309#define PCI_MSIX_PBA 8 317#define PCI_MSIX_PBA 8
310#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 318#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
319#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
311 320
312/* MSI-X entry's format */ 321/* MSI-X entry's format */
313#define PCI_MSIX_ENTRY_SIZE 16 322#define PCI_MSIX_ENTRY_SIZE 16
@@ -338,6 +347,7 @@
338#define PCI_AF_CTRL_FLR 0x01 347#define PCI_AF_CTRL_FLR 0x01
339#define PCI_AF_STATUS 5 348#define PCI_AF_STATUS 5
340#define PCI_AF_STATUS_TP 0x01 349#define PCI_AF_STATUS_TP 0x01
350#define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */
341 351
342/* PCI-X registers */ 352/* PCI-X registers */
343 353
@@ -374,6 +384,10 @@
374#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */ 384#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
375#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ 385#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
376#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ 386#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
387#define PCI_X_ECC_CSR 8 /* ECC control and status */
388#define PCI_CAP_PCIX_SIZEOF_V0 8 /* size of registers for Version 0 */
389#define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */
390#define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */
377 391
378/* PCI Bridge Subsystem ID registers */ 392/* PCI Bridge Subsystem ID registers */
379 393
@@ -462,6 +476,7 @@
462#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ 476#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */
463#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */ 477#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */
464#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */ 478#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */
479#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints end here */
465#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 480#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
466#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */ 481#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */
467#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */ 482#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */
@@ -507,6 +522,12 @@
507#define PCI_EXP_RTSTA 32 /* Root Status */ 522#define PCI_EXP_RTSTA 32 /* Root Status */
508#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ 523#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */
509#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ 524#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */
525/*
526 * Note that the following PCI Express 'Capability Structure' registers
527 * were introduced with 'Capability Version' 0x2 (v2). These registers
528 * do not exist on devices with Capability Version 1. Use pci_pcie_cap2()
529 * to use these fields safely.
530 */
510#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ 531#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
511#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ 532#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */
512#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ 533#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */
@@ -521,6 +542,7 @@
521#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ 542#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */
522#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ 543#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */
523#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ 544#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
545#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */
524#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 546#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
525#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ 547#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
526 548
@@ -529,23 +551,43 @@
529#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) 551#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
530#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) 552#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
531 553
532#define PCI_EXT_CAP_ID_ERR 1 554#define PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error Reporting */
533#define PCI_EXT_CAP_ID_VC 2 555#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel Capability */
534#define PCI_EXT_CAP_ID_DSN 3 556#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */
535#define PCI_EXT_CAP_ID_PWR 4 557#define PCI_EXT_CAP_ID_PWR 0x04 /* Power Budgeting */
536#define PCI_EXT_CAP_ID_VNDR 11 558#define PCI_EXT_CAP_ID_RCLD 0x05 /* Root Complex Link Declaration */
537#define PCI_EXT_CAP_ID_ACS 13 559#define PCI_EXT_CAP_ID_RCILC 0x06 /* Root Complex Internal Link Control */
538#define PCI_EXT_CAP_ID_ARI 14 560#define PCI_EXT_CAP_ID_RCEC 0x07 /* Root Complex Event Collector */
539#define PCI_EXT_CAP_ID_ATS 15 561#define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */
540#define PCI_EXT_CAP_ID_SRIOV 16 562#define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */
541#define PCI_EXT_CAP_ID_PRI 19 563#define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */
542#define PCI_EXT_CAP_ID_LTR 24 564#define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor Specific */
543#define PCI_EXT_CAP_ID_PASID 27 565#define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */
566#define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */
567#define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */
568#define PCI_EXT_CAP_ID_ATS 0x0F /* Address Translation Services */
569#define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */
570#define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */
571#define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */
572#define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */
573#define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* reserved for AMD */
574#define PCI_EXT_CAP_ID_REBAR 0x15 /* resizable BAR */
575#define PCI_EXT_CAP_ID_DPA 0x16 /* dynamic power alloc */
576#define PCI_EXT_CAP_ID_TPH 0x17 /* TPH request */
577#define PCI_EXT_CAP_ID_LTR 0x18 /* latency tolerance reporting */
578#define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe */
579#define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */
580#define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */
581#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PASID
582
583#define PCI_EXT_CAP_DSN_SIZEOF 12
584#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
544 585
545/* Advanced Error Reporting */ 586/* Advanced Error Reporting */
546#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ 587#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
547#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ 588#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
548#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ 589#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
590#define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */
549#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ 591#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
550#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ 592#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
551#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ 593#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
@@ -555,6 +597,11 @@
555#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ 597#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
556#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ 598#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
557#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ 599#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
600#define PCI_ERR_UNC_ACSV 0x00200000 /* ACS Violation */
601#define PCI_ERR_UNC_INTN 0x00400000 /* internal error */
602#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */
603#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */
604#define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */
558#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ 605#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
559 /* Same bits as above */ 606 /* Same bits as above */
560#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ 607#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
@@ -565,6 +612,9 @@
565#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ 612#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
566#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ 613#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
567#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ 614#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
615#define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */
616#define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */
617#define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */
568#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ 618#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
569 /* Same bits as above */ 619 /* Same bits as above */
570#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ 620#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
@@ -596,12 +646,18 @@
596 646
597/* Virtual Channel */ 647/* Virtual Channel */
598#define PCI_VC_PORT_REG1 4 648#define PCI_VC_PORT_REG1 4
649#define PCI_VC_REG1_EVCC 0x7 /* extended vc count */
599#define PCI_VC_PORT_REG2 8 650#define PCI_VC_PORT_REG2 8
651#define PCI_VC_REG2_32_PHASE 0x2
652#define PCI_VC_REG2_64_PHASE 0x4
653#define PCI_VC_REG2_128_PHASE 0x8
600#define PCI_VC_PORT_CTRL 12 654#define PCI_VC_PORT_CTRL 12
601#define PCI_VC_PORT_STATUS 14 655#define PCI_VC_PORT_STATUS 14
602#define PCI_VC_RES_CAP 16 656#define PCI_VC_RES_CAP 16
603#define PCI_VC_RES_CTRL 20 657#define PCI_VC_RES_CTRL 20
604#define PCI_VC_RES_STATUS 26 658#define PCI_VC_RES_STATUS 26
659#define PCI_CAP_VC_BASE_SIZEOF 0x10
660#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C
605 661
606/* Power Budgeting */ 662/* Power Budgeting */
607#define PCI_PWR_DSR 4 /* Data Select Register */ 663#define PCI_PWR_DSR 4 /* Data Select Register */
@@ -614,6 +670,7 @@
614#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ 670#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
615#define PCI_PWR_CAP 12 /* Capability */ 671#define PCI_PWR_CAP 12 /* Capability */
616#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 672#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
673#define PCI_EXT_CAP_PWR_SIZEOF 16
617 674
618/* 675/*
619 * Hypertransport sub capability types 676 * Hypertransport sub capability types
@@ -646,6 +703,8 @@
646#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ 703#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
647#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */ 704#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */
648#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */ 705#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */
706#define HT_CAP_SIZEOF_LONG 28 /* slave & primary */
707#define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */
649 708
650/* Alternative Routing-ID Interpretation */ 709/* Alternative Routing-ID Interpretation */
651#define PCI_ARI_CAP 0x04 /* ARI Capability Register */ 710#define PCI_ARI_CAP 0x04 /* ARI Capability Register */
@@ -656,6 +715,7 @@
656#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ 715#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */
657#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ 716#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */
658#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ 717#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */
718#define PCI_EXT_CAP_ARI_SIZEOF 8
659 719
660/* Address Translation Service */ 720/* Address Translation Service */
661#define PCI_ATS_CAP 0x04 /* ATS Capability Register */ 721#define PCI_ATS_CAP 0x04 /* ATS Capability Register */
@@ -665,6 +725,7 @@
665#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ 725#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */
666#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ 726#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
667#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ 727#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
728#define PCI_EXT_CAP_ATS_SIZEOF 8
668 729
669/* Page Request Interface */ 730/* Page Request Interface */
670#define PCI_PRI_CTRL 0x04 /* PRI control register */ 731#define PCI_PRI_CTRL 0x04 /* PRI control register */
@@ -676,6 +737,7 @@
676#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */ 737#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */
677#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */ 738#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */
678#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ 739#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */
740#define PCI_EXT_CAP_PRI_SIZEOF 16
679 741
680/* PASID capability */ 742/* PASID capability */
681#define PCI_PASID_CAP 0x04 /* PASID feature register */ 743#define PCI_PASID_CAP 0x04 /* PASID feature register */
@@ -685,6 +747,7 @@
685#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ 747#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */
686#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ 748#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */
687#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */ 749#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */
750#define PCI_EXT_CAP_PASID_SIZEOF 8
688 751
689/* Single Root I/O Virtualization */ 752/* Single Root I/O Virtualization */
690#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ 753#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
@@ -716,12 +779,14 @@
716#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ 779#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */
717#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ 780#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
718#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ 781#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
782#define PCI_EXT_CAP_SRIOV_SIZEOF 64
719 783
720#define PCI_LTR_MAX_SNOOP_LAT 0x4 784#define PCI_LTR_MAX_SNOOP_LAT 0x4
721#define PCI_LTR_MAX_NOSNOOP_LAT 0x6 785#define PCI_LTR_MAX_NOSNOOP_LAT 0x6
722#define PCI_LTR_VALUE_MASK 0x000003ff 786#define PCI_LTR_VALUE_MASK 0x000003ff
723#define PCI_LTR_SCALE_MASK 0x00001c00 787#define PCI_LTR_SCALE_MASK 0x00001c00
724#define PCI_LTR_SCALE_SHIFT 10 788#define PCI_LTR_SCALE_SHIFT 10
789#define PCI_EXT_CAP_LTR_SIZEOF 8
725 790
726/* Access Control Service */ 791/* Access Control Service */
727#define PCI_ACS_CAP 0x04 /* ACS Capability Register */ 792#define PCI_ACS_CAP 0x04 /* ACS Capability Register */
@@ -732,7 +797,38 @@
732#define PCI_ACS_UF 0x10 /* Upstream Forwarding */ 797#define PCI_ACS_UF 0x10 /* Upstream Forwarding */
733#define PCI_ACS_EC 0x20 /* P2P Egress Control */ 798#define PCI_ACS_EC 0x20 /* P2P Egress Control */
734#define PCI_ACS_DT 0x40 /* Direct Translated P2P */ 799#define PCI_ACS_DT 0x40 /* Direct Translated P2P */
800#define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */
735#define PCI_ACS_CTRL 0x06 /* ACS Control Register */ 801#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
736#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ 802#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
737 803
804#define PCI_VSEC_HDR 4 /* extended cap - vendor specific */
805#define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */
806
807/* sata capability */
808#define PCI_SATA_REGS 4 /* SATA REGs specifier */
809#define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */
810#define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */
811#define PCI_SATA_SIZEOF_SHORT 8
812#define PCI_SATA_SIZEOF_LONG 16
813
814/* resizable BARs */
815#define PCI_REBAR_CTRL 8 /* control register */
816#define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */
817#define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */
818
819/* dynamic power allocation */
820#define PCI_DPA_CAP 4 /* capability register */
821#define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */
822#define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */
823
824/* TPH Requester */
825#define PCI_TPH_CAP 4 /* capability register */
826#define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */
827#define PCI_TPH_LOC_NONE 0x000 /* no location */
828#define PCI_TPH_LOC_CAP 0x200 /* in capability */
829#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */
830#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */
831#define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */
832#define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */
833
738#endif /* LINUX_PCI_REGS_H */ 834#endif /* LINUX_PCI_REGS_H */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 45db49f64bb4..76c5c8b724a7 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -677,6 +677,7 @@ struct hw_perf_event {
677 u64 last_tag; 677 u64 last_tag;
678 unsigned long config_base; 678 unsigned long config_base;
679 unsigned long event_base; 679 unsigned long event_base;
680 int event_base_rdpmc;
680 int idx; 681 int idx;
681 int last_cpu; 682 int last_cpu;
682 683
@@ -1106,6 +1107,8 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr,
1106 struct task_struct *task, 1107 struct task_struct *task,
1107 perf_overflow_handler_t callback, 1108 perf_overflow_handler_t callback,
1108 void *context); 1109 void *context);
1110extern void perf_pmu_migrate_context(struct pmu *pmu,
1111 int src_cpu, int dst_cpu);
1109extern u64 perf_event_read_value(struct perf_event *event, 1112extern u64 perf_event_read_value(struct perf_event *event,
1110 u64 *enabled, u64 *running); 1113 u64 *enabled, u64 *running);
1111 1114
diff --git a/include/linux/phy.h b/include/linux/phy.h
index c291cae8ce32..93b3cf77f564 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -243,6 +243,15 @@ enum phy_state {
243 PHY_RESUMING 243 PHY_RESUMING
244}; 244};
245 245
246/**
247 * struct phy_c45_device_ids - 802.3-c45 Device Identifiers
248 * @devices_in_package: Bit vector of devices present.
249 * @device_ids: The device identifer for each present device.
250 */
251struct phy_c45_device_ids {
252 u32 devices_in_package;
253 u32 device_ids[8];
254};
246 255
247/* phy_device: An instance of a PHY 256/* phy_device: An instance of a PHY
248 * 257 *
@@ -250,6 +259,8 @@ enum phy_state {
250 * bus: Pointer to the bus this PHY is on 259 * bus: Pointer to the bus this PHY is on
251 * dev: driver model device structure for this PHY 260 * dev: driver model device structure for this PHY
252 * phy_id: UID for this device found during discovery 261 * phy_id: UID for this device found during discovery
262 * c45_ids: 802.3-c45 Device Identifers if is_c45.
263 * is_c45: Set to true if this phy uses clause 45 addressing.
253 * state: state of the PHY for management purposes 264 * state: state of the PHY for management purposes
254 * dev_flags: Device-specific flags used by the PHY driver. 265 * dev_flags: Device-specific flags used by the PHY driver.
255 * addr: Bus address of PHY 266 * addr: Bus address of PHY
@@ -285,6 +296,9 @@ struct phy_device {
285 296
286 u32 phy_id; 297 u32 phy_id;
287 298
299 struct phy_c45_device_ids c45_ids;
300 bool is_c45;
301
288 enum phy_state state; 302 enum phy_state state;
289 303
290 u32 dev_flags; 304 u32 dev_flags;
@@ -412,6 +426,12 @@ struct phy_driver {
412 /* Clears up any memory if needed */ 426 /* Clears up any memory if needed */
413 void (*remove)(struct phy_device *phydev); 427 void (*remove)(struct phy_device *phydev);
414 428
429 /* Returns true if this is a suitable driver for the given
430 * phydev. If NULL, matching is based on phy_id and
431 * phy_id_mask.
432 */
433 int (*match_phy_device)(struct phy_device *phydev);
434
415 /* Handles ethtool queries for hardware time stamping. */ 435 /* Handles ethtool queries for hardware time stamping. */
416 int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti); 436 int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti);
417 437
@@ -480,7 +500,9 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
480 return mdiobus_write(phydev->bus, phydev->addr, regnum, val); 500 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
481} 501}
482 502
483struct phy_device* get_phy_device(struct mii_bus *bus, int addr); 503struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
504 bool is_c45, struct phy_c45_device_ids *c45_ids);
505struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
484int phy_device_register(struct phy_device *phy); 506int phy_device_register(struct phy_device *phy);
485int phy_init_hw(struct phy_device *phydev); 507int phy_init_hw(struct phy_device *phydev);
486struct phy_device * phy_attach(struct net_device *dev, 508struct phy_device * phy_attach(struct net_device *dev,
@@ -511,7 +533,9 @@ int genphy_read_status(struct phy_device *phydev);
511int genphy_suspend(struct phy_device *phydev); 533int genphy_suspend(struct phy_device *phydev);
512int genphy_resume(struct phy_device *phydev); 534int genphy_resume(struct phy_device *phydev);
513void phy_driver_unregister(struct phy_driver *drv); 535void phy_driver_unregister(struct phy_driver *drv);
536void phy_drivers_unregister(struct phy_driver *drv, int n);
514int phy_driver_register(struct phy_driver *new_driver); 537int phy_driver_register(struct phy_driver *new_driver);
538int phy_drivers_register(struct phy_driver *new_driver, int n);
515void phy_state_machine(struct work_struct *work); 539void phy_state_machine(struct work_struct *work);
516void phy_start_machine(struct phy_device *phydev, 540void phy_start_machine(struct phy_device *phydev,
517 void (*handler)(struct net_device *)); 541 void (*handler)(struct net_device *));
@@ -532,6 +556,11 @@ int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
532 int (*run)(struct phy_device *)); 556 int (*run)(struct phy_device *));
533int phy_scan_fixups(struct phy_device *phydev); 557int phy_scan_fixups(struct phy_device *phydev);
534 558
559int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
560int phy_get_eee_err(struct phy_device *phydev);
561int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
562int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
563
535int __init mdio_bus_init(void); 564int __init mdio_bus_init(void);
536void mdio_bus_exit(void); 565void mdio_bus_exit(void);
537 566
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 3b894a668d32..69393a662532 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -131,8 +131,9 @@ extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
131extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin); 131extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
132extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev, 132extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
133 struct pinctrl_gpio_range *range); 133 struct pinctrl_gpio_range *range);
134extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, 134extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev,
135 struct pinctrl_gpio_range *range); 135 struct pinctrl_gpio_range *ranges,
136 unsigned nranges);
136extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); 137extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
137extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); 138extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
138#else 139#else
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index defbde203d07..082eafaf026b 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -451,8 +451,10 @@ enum {
451#define TCF_EM_U32 3 451#define TCF_EM_U32 3
452#define TCF_EM_META 4 452#define TCF_EM_META 4
453#define TCF_EM_TEXT 5 453#define TCF_EM_TEXT 5
454#define TCF_EM_VLAN 6 454#define TCF_EM_VLAN 6
455#define TCF_EM_MAX 6 455#define TCF_EM_CANID 7
456#define TCF_EM_IPSET 8
457#define TCF_EM_MAX 8
456 458
457enum { 459enum {
458 TCF_EM_PROG_TC 460 TCF_EM_PROG_TC
diff --git a/include/linux/platform_data/clk-integrator.h b/include/linux/platform_data/clk-integrator.h
new file mode 100644
index 000000000000..83fe9c283bb8
--- /dev/null
+++ b/include/linux/platform_data/clk-integrator.h
@@ -0,0 +1 @@
void integrator_clk_init(bool is_cp);
diff --git a/include/linux/platform_data/clk-nomadik.h b/include/linux/platform_data/clk-nomadik.h
new file mode 100644
index 000000000000..5713c87b2477
--- /dev/null
+++ b/include/linux/platform_data/clk-nomadik.h
@@ -0,0 +1,2 @@
1/* Minimal platform data header */
2void nomadik_clk_init(void);
diff --git a/include/linux/platform_data/clk-u300.h b/include/linux/platform_data/clk-u300.h
new file mode 100644
index 000000000000..8429e73911a1
--- /dev/null
+++ b/include/linux/platform_data/clk-u300.h
@@ -0,0 +1 @@
void __init u300_clk_init(void __iomem *base);
diff --git a/include/linux/platform_data/mmp_audio.h b/include/linux/platform_data/mmp_audio.h
new file mode 100644
index 000000000000..0f25d165abd6
--- /dev/null
+++ b/include/linux/platform_data/mmp_audio.h
@@ -0,0 +1,22 @@
1/*
2 * MMP Platform AUDIO Management
3 *
4 * Copyright (c) 2011 Marvell Semiconductors Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#ifndef MMP_AUDIO_H
13#define MMP_AUDIO_H
14
15struct mmp_audio_platdata {
16 u32 period_max_capture;
17 u32 buffer_max_capture;
18 u32 period_max_playback;
19 u32 buffer_max_playback;
20};
21
22#endif /* MMP_AUDIO_H */
diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h
new file mode 100644
index 000000000000..3da73bdc2031
--- /dev/null
+++ b/include/linux/platform_data/omap_drm.h
@@ -0,0 +1,52 @@
1/*
2 * DRM/KMS platform data for TI OMAP platforms
3 *
4 * Copyright (C) 2012 Texas Instruments
5 * Author: Rob Clark <rob.clark@linaro.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef __PLATFORM_DATA_OMAP_DRM_H__
21#define __PLATFORM_DATA_OMAP_DRM_H__
22
23/*
24 * Optional platform data to configure the default configuration of which
25 * pipes/overlays/CRTCs are used.. if this is not provided, then instead the
26 * first CONFIG_DRM_OMAP_NUM_CRTCS are used, and they are each connected to
27 * one manager, with priority given to managers that are connected to
28 * detected devices. Remaining overlays are used as video planes. This
29 * should be a good default behavior for most cases, but yet there still
30 * might be times when you wish to do something different.
31 */
32struct omap_kms_platform_data {
33 /* overlays to use as CRTCs: */
34 int ovl_cnt;
35 const int *ovl_ids;
36
37 /* overlays to use as video planes: */
38 int pln_cnt;
39 const int *pln_ids;
40
41 int mgr_cnt;
42 const int *mgr_ids;
43
44 int dev_cnt;
45 const char **dev_names;
46};
47
48struct omap_drm_platform_data {
49 struct omap_kms_platform_data *kms_pdata;
50};
51
52#endif /* __PLATFORM_DATA_OMAP_DRM_H__ */
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 30f794eb3826..a7d6172922d4 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -15,6 +15,7 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/of.h> 16#include <linux/of.h>
17#include <linux/notifier.h> 17#include <linux/notifier.h>
18#include <linux/cpuidle.h>
18 19
19enum gpd_status { 20enum gpd_status {
20 GPD_STATE_ACTIVE = 0, /* PM domain is active */ 21 GPD_STATE_ACTIVE = 0, /* PM domain is active */
@@ -45,6 +46,11 @@ struct gpd_dev_ops {
45 bool (*active_wakeup)(struct device *dev); 46 bool (*active_wakeup)(struct device *dev);
46}; 47};
47 48
49struct gpd_cpu_data {
50 unsigned int saved_exit_latency;
51 struct cpuidle_state *idle_state;
52};
53
48struct generic_pm_domain { 54struct generic_pm_domain {
49 struct dev_pm_domain domain; /* PM domain operations */ 55 struct dev_pm_domain domain; /* PM domain operations */
50 struct list_head gpd_list_node; /* Node in the global PM domains list */ 56 struct list_head gpd_list_node; /* Node in the global PM domains list */
@@ -75,6 +81,7 @@ struct generic_pm_domain {
75 bool max_off_time_changed; 81 bool max_off_time_changed;
76 bool cached_power_down_ok; 82 bool cached_power_down_ok;
77 struct device_node *of_node; /* Node in device tree */ 83 struct device_node *of_node; /* Node in device tree */
84 struct gpd_cpu_data *cpu_data;
78}; 85};
79 86
80static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) 87static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
@@ -105,6 +112,7 @@ struct generic_pm_domain_data {
105 struct gpd_timing_data td; 112 struct gpd_timing_data td;
106 struct notifier_block nb; 113 struct notifier_block nb;
107 struct mutex lock; 114 struct mutex lock;
115 unsigned int refcount;
108 bool need_restore; 116 bool need_restore;
109 bool always_on; 117 bool always_on;
110}; 118};
@@ -155,6 +163,8 @@ extern int pm_genpd_add_callbacks(struct device *dev,
155 struct gpd_dev_ops *ops, 163 struct gpd_dev_ops *ops,
156 struct gpd_timing_data *td); 164 struct gpd_timing_data *td);
157extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); 165extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
166extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
167extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd);
158extern void pm_genpd_init(struct generic_pm_domain *genpd, 168extern void pm_genpd_init(struct generic_pm_domain *genpd,
159 struct dev_power_governor *gov, bool is_off); 169 struct dev_power_governor *gov, bool is_off);
160 170
@@ -211,6 +221,14 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
211{ 221{
212 return -ENOSYS; 222 return -ENOSYS;
213} 223}
224static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
225{
226 return -ENOSYS;
227}
228static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd)
229{
230 return -ENOSYS;
231}
214static inline void pm_genpd_init(struct generic_pm_domain *genpd, 232static inline void pm_genpd_init(struct generic_pm_domain *genpd,
215 struct dev_power_governor *gov, bool is_off) 233 struct dev_power_governor *gov, bool is_off)
216{ 234{
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index 233149cb19f4..9924ea1f22e0 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -66,7 +66,7 @@ enum pm_qos_req_action {
66 66
67static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) 67static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
68{ 68{
69 return req->dev != 0; 69 return req->dev != NULL;
70} 70}
71 71
72int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, 72int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
new file mode 100644
index 000000000000..3101e62a1213
--- /dev/null
+++ b/include/linux/power/smartreflex.h
@@ -0,0 +1,308 @@
1/*
2 * OMAP Smartreflex Defines and Routines
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008 Nokia Corporation
10 * Kalle Jokiniemi
11 *
12 * Copyright (C) 2007 Texas Instruments, Inc.
13 * Lesly A M <x0080970@ti.com>
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 */
19
20#ifndef __POWER_SMARTREFLEX_H
21#define __POWER_SMARTREFLEX_H
22
23#include <linux/types.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <plat/voltage.h>
27
28/*
29 * Different Smartreflex IPs version. The v1 is the 65nm version used in
30 * OMAP3430. The v2 is the update for the 45nm version of the IP
31 * used in OMAP3630 and OMAP4430
32 */
33#define SR_TYPE_V1 1
34#define SR_TYPE_V2 2
35
36/* SMART REFLEX REG ADDRESS OFFSET */
37#define SRCONFIG 0x00
38#define SRSTATUS 0x04
39#define SENVAL 0x08
40#define SENMIN 0x0C
41#define SENMAX 0x10
42#define SENAVG 0x14
43#define AVGWEIGHT 0x18
44#define NVALUERECIPROCAL 0x1c
45#define SENERROR_V1 0x20
46#define ERRCONFIG_V1 0x24
47#define IRQ_EOI 0x20
48#define IRQSTATUS_RAW 0x24
49#define IRQSTATUS 0x28
50#define IRQENABLE_SET 0x2C
51#define IRQENABLE_CLR 0x30
52#define SENERROR_V2 0x34
53#define ERRCONFIG_V2 0x38
54
55/* Bit/Shift Positions */
56
57/* SRCONFIG */
58#define SRCONFIG_ACCUMDATA_SHIFT 22
59#define SRCONFIG_SRCLKLENGTH_SHIFT 12
60#define SRCONFIG_SENNENABLE_V1_SHIFT 5
61#define SRCONFIG_SENPENABLE_V1_SHIFT 3
62#define SRCONFIG_SENNENABLE_V2_SHIFT 1
63#define SRCONFIG_SENPENABLE_V2_SHIFT 0
64#define SRCONFIG_CLKCTRL_SHIFT 0
65
66#define SRCONFIG_ACCUMDATA_MASK (0x3ff << 22)
67
68#define SRCONFIG_SRENABLE BIT(11)
69#define SRCONFIG_SENENABLE BIT(10)
70#define SRCONFIG_ERRGEN_EN BIT(9)
71#define SRCONFIG_MINMAXAVG_EN BIT(8)
72#define SRCONFIG_DELAYCTRL BIT(2)
73
74/* AVGWEIGHT */
75#define AVGWEIGHT_SENPAVGWEIGHT_SHIFT 2
76#define AVGWEIGHT_SENNAVGWEIGHT_SHIFT 0
77
78/* NVALUERECIPROCAL */
79#define NVALUERECIPROCAL_SENPGAIN_SHIFT 20
80#define NVALUERECIPROCAL_SENNGAIN_SHIFT 16
81#define NVALUERECIPROCAL_RNSENP_SHIFT 8
82#define NVALUERECIPROCAL_RNSENN_SHIFT 0
83
84/* ERRCONFIG */
85#define ERRCONFIG_ERRWEIGHT_SHIFT 16
86#define ERRCONFIG_ERRMAXLIMIT_SHIFT 8
87#define ERRCONFIG_ERRMINLIMIT_SHIFT 0
88
89#define SR_ERRWEIGHT_MASK (0x07 << 16)
90#define SR_ERRMAXLIMIT_MASK (0xff << 8)
91#define SR_ERRMINLIMIT_MASK (0xff << 0)
92
93#define ERRCONFIG_VPBOUNDINTEN_V1 BIT(31)
94#define ERRCONFIG_VPBOUNDINTST_V1 BIT(30)
95#define ERRCONFIG_MCUACCUMINTEN BIT(29)
96#define ERRCONFIG_MCUACCUMINTST BIT(28)
97#define ERRCONFIG_MCUVALIDINTEN BIT(27)
98#define ERRCONFIG_MCUVALIDINTST BIT(26)
99#define ERRCONFIG_MCUBOUNDINTEN BIT(25)
100#define ERRCONFIG_MCUBOUNDINTST BIT(24)
101#define ERRCONFIG_MCUDISACKINTEN BIT(23)
102#define ERRCONFIG_VPBOUNDINTST_V2 BIT(23)
103#define ERRCONFIG_MCUDISACKINTST BIT(22)
104#define ERRCONFIG_VPBOUNDINTEN_V2 BIT(22)
105
106#define ERRCONFIG_STATUS_V1_MASK (ERRCONFIG_VPBOUNDINTST_V1 | \
107 ERRCONFIG_MCUACCUMINTST | \
108 ERRCONFIG_MCUVALIDINTST | \
109 ERRCONFIG_MCUBOUNDINTST | \
110 ERRCONFIG_MCUDISACKINTST)
111/* IRQSTATUS */
112#define IRQSTATUS_MCUACCUMINT BIT(3)
113#define IRQSTATUS_MCVALIDINT BIT(2)
114#define IRQSTATUS_MCBOUNDSINT BIT(1)
115#define IRQSTATUS_MCUDISABLEACKINT BIT(0)
116
117/* IRQENABLE_SET and IRQENABLE_CLEAR */
118#define IRQENABLE_MCUACCUMINT BIT(3)
119#define IRQENABLE_MCUVALIDINT BIT(2)
120#define IRQENABLE_MCUBOUNDSINT BIT(1)
121#define IRQENABLE_MCUDISABLEACKINT BIT(0)
122
123/* Common Bit values */
124
125#define SRCLKLENGTH_12MHZ_SYSCLK 0x3c
126#define SRCLKLENGTH_13MHZ_SYSCLK 0x41
127#define SRCLKLENGTH_19MHZ_SYSCLK 0x60
128#define SRCLKLENGTH_26MHZ_SYSCLK 0x82
129#define SRCLKLENGTH_38MHZ_SYSCLK 0xC0
130
131/*
132 * 3430 specific values. Maybe these should be passed from board file or
133 * pmic structures.
134 */
135#define OMAP3430_SR_ACCUMDATA 0x1f4
136
137#define OMAP3430_SR1_SENPAVGWEIGHT 0x03
138#define OMAP3430_SR1_SENNAVGWEIGHT 0x03
139
140#define OMAP3430_SR2_SENPAVGWEIGHT 0x01
141#define OMAP3430_SR2_SENNAVGWEIGHT 0x01
142
143#define OMAP3430_SR_ERRWEIGHT 0x04
144#define OMAP3430_SR_ERRMAXLIMIT 0x02
145
146struct omap_sr {
147 char *name;
148 struct list_head node;
149 struct platform_device *pdev;
150 struct omap_sr_nvalue_table *nvalue_table;
151 struct voltagedomain *voltdm;
152 struct dentry *dbg_dir;
153 unsigned int irq;
154 int srid;
155 int ip_type;
156 int nvalue_count;
157 bool autocomp_active;
158 u32 clk_length;
159 u32 err_weight;
160 u32 err_minlimit;
161 u32 err_maxlimit;
162 u32 accum_data;
163 u32 senn_avgweight;
164 u32 senp_avgweight;
165 u32 senp_mod;
166 u32 senn_mod;
167 void __iomem *base;
168};
169
170/**
171 * test_cond_timeout - busy-loop, testing a condition
172 * @cond: condition to test until it evaluates to true
173 * @timeout: maximum number of microseconds in the timeout
174 * @index: loop index (integer)
175 *
176 * Loop waiting for @cond to become true or until at least @timeout
177 * microseconds have passed. To use, define some integer @index in the
178 * calling code. After running, if @index == @timeout, then the loop has
179 * timed out.
180 *
181 * Copied from omap_test_timeout */
182#define sr_test_cond_timeout(cond, timeout, index) \
183({ \
184 for (index = 0; index < timeout; index++) { \
185 if (cond) \
186 break; \
187 udelay(1); \
188 } \
189})
190
191/**
192 * struct omap_sr_pmic_data - Strucutre to be populated by pmic code to pass
193 * pmic specific info to smartreflex driver
194 *
195 * @sr_pmic_init: API to initialize smartreflex on the PMIC side.
196 */
197struct omap_sr_pmic_data {
198 void (*sr_pmic_init) (void);
199};
200
201/**
202 * struct omap_smartreflex_dev_attr - Smartreflex Device attribute.
203 *
204 * @sensor_voltdm_name: Name of voltdomain of SR instance
205 */
206struct omap_smartreflex_dev_attr {
207 const char *sensor_voltdm_name;
208};
209
210#ifdef CONFIG_POWER_AVS_OMAP
211/*
212 * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR.
213 * The smartreflex class driver should pass the class type.
214 * Should be used to populate the class_type field of the
215 * omap_smartreflex_class_data structure.
216 */
217#define SR_CLASS1 0x1
218#define SR_CLASS2 0x2
219#define SR_CLASS3 0x3
220
221/**
222 * struct omap_sr_class_data - Smartreflex class driver info
223 *
224 * @enable: API to enable a particular class smaartreflex.
225 * @disable: API to disable a particular class smartreflex.
226 * @configure: API to configure a particular class smartreflex.
227 * @notify: API to notify the class driver about an event in SR.
228 * Not needed for class3.
229 * @notify_flags: specify the events to be notified to the class driver
230 * @class_type: specify which smartreflex class.
231 * Can be used by the SR driver to take any class
232 * based decisions.
233 */
234struct omap_sr_class_data {
235 int (*enable)(struct omap_sr *sr);
236 int (*disable)(struct omap_sr *sr, int is_volt_reset);
237 int (*configure)(struct omap_sr *sr);
238 int (*notify)(struct omap_sr *sr, u32 status);
239 u8 notify_flags;
240 u8 class_type;
241};
242
243/**
244 * struct omap_sr_nvalue_table - Smartreflex n-target value info
245 *
246 * @efuse_offs: The offset of the efuse where n-target values are stored.
247 * @nvalue: The n-target value.
248 * @errminlimit: The value of the ERRMINLIMIT bitfield for this n-target
249 * @volt_nominal: microvolts DC that the VDD is initially programmed to
250 */
251struct omap_sr_nvalue_table {
252 u32 efuse_offs;
253 u32 nvalue;
254 u32 errminlimit;
255 unsigned long volt_nominal;
256};
257
258/**
259 * struct omap_sr_data - Smartreflex platform data.
260 *
261 * @name: instance name
262 * @ip_type: Smartreflex IP type.
263 * @senp_mod: SENPENABLE value for the sr
264 * @senn_mod: SENNENABLE value for sr
265 * @nvalue_count: Number of distinct nvalues in the nvalue table
266 * @enable_on_init: whether this sr module needs to enabled at
267 * boot up or not.
268 * @nvalue_table: table containing the efuse offsets and nvalues
269 * corresponding to them.
270 * @voltdm: Pointer to the voltage domain associated with the SR
271 */
272struct omap_sr_data {
273 const char *name;
274 int ip_type;
275 u32 senp_mod;
276 u32 senn_mod;
277 int nvalue_count;
278 bool enable_on_init;
279 struct omap_sr_nvalue_table *nvalue_table;
280 struct voltagedomain *voltdm;
281};
282
283/* Smartreflex module enable/disable interface */
284void omap_sr_enable(struct voltagedomain *voltdm);
285void omap_sr_disable(struct voltagedomain *voltdm);
286void omap_sr_disable_reset_volt(struct voltagedomain *voltdm);
287
288/* API to register the pmic specific data with the smartreflex driver. */
289void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data);
290
291/* Smartreflex driver hooks to be called from Smartreflex class driver */
292int sr_enable(struct voltagedomain *voltdm, unsigned long volt);
293void sr_disable(struct voltagedomain *voltdm);
294int sr_configure_errgen(struct voltagedomain *voltdm);
295int sr_disable_errgen(struct voltagedomain *voltdm);
296int sr_configure_minmax(struct voltagedomain *voltdm);
297
298/* API to register the smartreflex class driver with the smartreflex driver */
299int sr_register_class(struct omap_sr_class_data *class_data);
300#else
301static inline void omap_sr_enable(struct voltagedomain *voltdm) {}
302static inline void omap_sr_disable(struct voltagedomain *voltdm) {}
303static inline void omap_sr_disable_reset_volt(
304 struct voltagedomain *voltdm) {}
305static inline void omap_sr_register_pmic(
306 struct omap_sr_pmic_data *pmic_data) {}
307#endif
308#endif
diff --git a/include/linux/quota.h b/include/linux/quota.h
index c09fa042b5ea..524ede8a160a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -333,7 +333,7 @@ struct quotactl_ops {
333 int (*quota_on)(struct super_block *, int, int, struct path *); 333 int (*quota_on)(struct super_block *, int, int, struct path *);
334 int (*quota_on_meta)(struct super_block *, int, int); 334 int (*quota_on_meta)(struct super_block *, int, int);
335 int (*quota_off)(struct super_block *, int); 335 int (*quota_off)(struct super_block *, int);
336 int (*quota_sync)(struct super_block *, int, int); 336 int (*quota_sync)(struct super_block *, int);
337 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 337 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
338 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 338 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
339 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *); 339 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *);
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 17b977304a09..ec6b65feaaba 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -83,7 +83,8 @@ int dquot_quota_on(struct super_block *sb, int type, int format_id,
83int dquot_quota_on_mount(struct super_block *sb, char *qf_name, 83int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
84 int format_id, int type); 84 int format_id, int type);
85int dquot_quota_off(struct super_block *sb, int type); 85int dquot_quota_off(struct super_block *sb, int type);
86int dquot_quota_sync(struct super_block *sb, int type, int wait); 86int dquot_writeback_dquots(struct super_block *sb, int type);
87int dquot_quota_sync(struct super_block *sb, int type);
87int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 88int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
88int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 89int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
89int dquot_get_dqblk(struct super_block *sb, int type, qid_t id, 90int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
@@ -255,6 +256,11 @@ static inline int dquot_resume(struct super_block *sb, int type)
255 256
256#define dquot_file_open generic_file_open 257#define dquot_file_open generic_file_open
257 258
259static inline int dquot_writeback_dquots(struct super_block *sb, int type)
260{
261 return 0;
262}
263
258#endif /* CONFIG_QUOTA */ 264#endif /* CONFIG_QUOTA */
259 265
260static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) 266static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 26d1a47591f1..115ead2b5155 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -147,6 +147,7 @@ extern void synchronize_sched(void);
147 147
148extern void __rcu_read_lock(void); 148extern void __rcu_read_lock(void);
149extern void __rcu_read_unlock(void); 149extern void __rcu_read_unlock(void);
150extern void rcu_read_unlock_special(struct task_struct *t);
150void synchronize_rcu(void); 151void synchronize_rcu(void);
151 152
152/* 153/*
@@ -184,7 +185,6 @@ static inline int rcu_preempt_depth(void)
184/* Internal to kernel */ 185/* Internal to kernel */
185extern void rcu_sched_qs(int cpu); 186extern void rcu_sched_qs(int cpu);
186extern void rcu_bh_qs(int cpu); 187extern void rcu_bh_qs(int cpu);
187extern void rcu_preempt_note_context_switch(void);
188extern void rcu_check_callbacks(int cpu, int user); 188extern void rcu_check_callbacks(int cpu, int user);
189struct notifier_block; 189struct notifier_block;
190extern void rcu_idle_enter(void); 190extern void rcu_idle_enter(void);
@@ -256,6 +256,10 @@ static inline void destroy_rcu_head_on_stack(struct rcu_head *head)
256} 256}
257#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ 257#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
258 258
259#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP)
260extern int rcu_is_cpu_idle(void);
261#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP) */
262
259#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) 263#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU)
260bool rcu_lockdep_current_cpu_online(void); 264bool rcu_lockdep_current_cpu_online(void);
261#else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */ 265#else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */
@@ -267,15 +271,6 @@ static inline bool rcu_lockdep_current_cpu_online(void)
267 271
268#ifdef CONFIG_DEBUG_LOCK_ALLOC 272#ifdef CONFIG_DEBUG_LOCK_ALLOC
269 273
270#ifdef CONFIG_PROVE_RCU
271extern int rcu_is_cpu_idle(void);
272#else /* !CONFIG_PROVE_RCU */
273static inline int rcu_is_cpu_idle(void)
274{
275 return 0;
276}
277#endif /* else !CONFIG_PROVE_RCU */
278
279static inline void rcu_lock_acquire(struct lockdep_map *map) 274static inline void rcu_lock_acquire(struct lockdep_map *map)
280{ 275{
281 lock_acquire(map, 0, 0, 2, 1, NULL, _THIS_IP_); 276 lock_acquire(map, 0, 0, 2, 1, NULL, _THIS_IP_);
@@ -432,8 +427,7 @@ extern int rcu_my_thread_group_empty(void);
432static inline void rcu_preempt_sleep_check(void) 427static inline void rcu_preempt_sleep_check(void)
433{ 428{
434 rcu_lockdep_assert(!lock_is_held(&rcu_lock_map), 429 rcu_lockdep_assert(!lock_is_held(&rcu_lock_map),
435 "Illegal context switch in RCU read-side " 430 "Illegal context switch in RCU read-side critical section");
436 "critical section");
437} 431}
438#else /* #ifdef CONFIG_PROVE_RCU */ 432#else /* #ifdef CONFIG_PROVE_RCU */
439static inline void rcu_preempt_sleep_check(void) 433static inline void rcu_preempt_sleep_check(void)
@@ -514,10 +508,10 @@ static inline void rcu_preempt_sleep_check(void)
514 (_________p1); \ 508 (_________p1); \
515 }) 509 })
516#define __rcu_assign_pointer(p, v, space) \ 510#define __rcu_assign_pointer(p, v, space) \
517 ({ \ 511 do { \
518 smp_wmb(); \ 512 smp_wmb(); \
519 (p) = (typeof(*v) __force space *)(v); \ 513 (p) = (typeof(*v) __force space *)(v); \
520 }) 514 } while (0)
521 515
522 516
523/** 517/**
@@ -852,7 +846,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
852 * 846 *
853 * Assigns the specified value to the specified RCU-protected 847 * Assigns the specified value to the specified RCU-protected
854 * pointer, ensuring that any concurrent RCU readers will see 848 * pointer, ensuring that any concurrent RCU readers will see
855 * any prior initialization. Returns the value assigned. 849 * any prior initialization.
856 * 850 *
857 * Inserts memory barriers on architectures that require them 851 * Inserts memory barriers on architectures that require them
858 * (which is most of them), and also prevents the compiler from 852 * (which is most of them), and also prevents the compiler from
@@ -904,25 +898,17 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
904 * the reader-accessible portions of the linked structure. 898 * the reader-accessible portions of the linked structure.
905 */ 899 */
906#define RCU_INIT_POINTER(p, v) \ 900#define RCU_INIT_POINTER(p, v) \
907 p = (typeof(*v) __force __rcu *)(v) 901 do { \
908 902 p = (typeof(*v) __force __rcu *)(v); \
909static __always_inline bool __is_kfree_rcu_offset(unsigned long offset) 903 } while (0)
910{
911 return offset < 4096;
912}
913
914static __always_inline
915void __kfree_rcu(struct rcu_head *head, unsigned long offset)
916{
917 typedef void (*rcu_callback)(struct rcu_head *);
918
919 BUILD_BUG_ON(!__builtin_constant_p(offset));
920
921 /* See the kfree_rcu() header comment. */
922 BUILD_BUG_ON(!__is_kfree_rcu_offset(offset));
923 904
924 kfree_call_rcu(head, (rcu_callback)offset); 905/**
925} 906 * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer
907 *
908 * GCC-style initialization for an RCU-protected pointer in a structure field.
909 */
910#define RCU_POINTER_INITIALIZER(p, v) \
911 .p = (typeof(*v) __force __rcu *)(v)
926 912
927/* 913/*
928 * Does the specified offset indicate that the corresponding rcu_head 914 * Does the specified offset indicate that the corresponding rcu_head
@@ -936,7 +922,7 @@ void __kfree_rcu(struct rcu_head *head, unsigned long offset)
936#define __kfree_rcu(head, offset) \ 922#define __kfree_rcu(head, offset) \
937 do { \ 923 do { \
938 BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \ 924 BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \
939 call_rcu(head, (void (*)(struct rcu_head *))(unsigned long)(offset)); \ 925 kfree_call_rcu(head, (void (*)(struct rcu_head *))(unsigned long)(offset)); \
940 } while (0) 926 } while (0)
941 927
942/** 928/**
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 854dc4c5c271..4e56a9c69a35 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -87,6 +87,10 @@ static inline void kfree_call_rcu(struct rcu_head *head,
87 87
88#ifdef CONFIG_TINY_RCU 88#ifdef CONFIG_TINY_RCU
89 89
90static inline void rcu_preempt_note_context_switch(void)
91{
92}
93
90static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) 94static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
91{ 95{
92 *delta_jiffies = ULONG_MAX; 96 *delta_jiffies = ULONG_MAX;
@@ -95,6 +99,7 @@ static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
95 99
96#else /* #ifdef CONFIG_TINY_RCU */ 100#else /* #ifdef CONFIG_TINY_RCU */
97 101
102void rcu_preempt_note_context_switch(void);
98int rcu_preempt_needs_cpu(void); 103int rcu_preempt_needs_cpu(void);
99 104
100static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) 105static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
@@ -108,6 +113,7 @@ static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
108static inline void rcu_note_context_switch(int cpu) 113static inline void rcu_note_context_switch(int cpu)
109{ 114{
110 rcu_sched_qs(cpu); 115 rcu_sched_qs(cpu);
116 rcu_preempt_note_context_switch();
111} 117}
112 118
113/* 119/*
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 56af22ec9aba..7f7e00df3adf 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -14,12 +14,14 @@
14 */ 14 */
15 15
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/rbtree.h>
17 18
18struct module; 19struct module;
19struct device; 20struct device;
20struct i2c_client; 21struct i2c_client;
21struct spi_device; 22struct spi_device;
22struct regmap; 23struct regmap;
24struct regmap_range_cfg;
23 25
24/* An enum of all the supported cache types */ 26/* An enum of all the supported cache types */
25enum regcache_type { 27enum regcache_type {
@@ -43,6 +45,14 @@ struct reg_default {
43 45
44#ifdef CONFIG_REGMAP 46#ifdef CONFIG_REGMAP
45 47
48enum regmap_endian {
49 /* Unspecified -> 0 -> Backwards compatible default */
50 REGMAP_ENDIAN_DEFAULT = 0,
51 REGMAP_ENDIAN_BIG,
52 REGMAP_ENDIAN_LITTLE,
53 REGMAP_ENDIAN_NATIVE,
54};
55
46/** 56/**
47 * Configuration for the register map of a device. 57 * Configuration for the register map of a device.
48 * 58 *
@@ -84,6 +94,15 @@ struct reg_default {
84 * @reg_defaults_raw: Power on reset values for registers (for use with 94 * @reg_defaults_raw: Power on reset values for registers (for use with
85 * register cache support). 95 * register cache support).
86 * @num_reg_defaults_raw: Number of elements in reg_defaults_raw. 96 * @num_reg_defaults_raw: Number of elements in reg_defaults_raw.
97 * @reg_format_endian: Endianness for formatted register addresses. If this is
98 * DEFAULT, the @reg_format_endian_default value from the
99 * regmap bus is used.
100 * @val_format_endian: Endianness for formatted register values. If this is
101 * DEFAULT, the @reg_format_endian_default value from the
102 * regmap bus is used.
103 *
104 * @ranges: Array of configuration entries for virtual address ranges.
105 * @num_ranges: Number of range configuration entries.
87 */ 106 */
88struct regmap_config { 107struct regmap_config {
89 const char *name; 108 const char *name;
@@ -109,6 +128,43 @@ struct regmap_config {
109 u8 write_flag_mask; 128 u8 write_flag_mask;
110 129
111 bool use_single_rw; 130 bool use_single_rw;
131
132 enum regmap_endian reg_format_endian;
133 enum regmap_endian val_format_endian;
134
135 const struct regmap_range_cfg *ranges;
136 unsigned int n_ranges;
137};
138
139/**
140 * Configuration for indirectly accessed or paged registers.
141 * Registers, mapped to this virtual range, are accessed in two steps:
142 * 1. page selector register update;
143 * 2. access through data window registers.
144 *
145 * @range_min: Address of the lowest register address in virtual range.
146 * @range_max: Address of the highest register in virtual range.
147 *
148 * @page_sel_reg: Register with selector field.
149 * @page_sel_mask: Bit shift for selector value.
150 * @page_sel_shift: Bit mask for selector value.
151 *
152 * @window_start: Address of first (lowest) register in data window.
153 * @window_len: Number of registers in data window.
154 */
155struct regmap_range_cfg {
156 /* Registers of virtual address range */
157 unsigned int range_min;
158 unsigned int range_max;
159
160 /* Page selector for indirect addressing */
161 unsigned int selector_reg;
162 unsigned int selector_mask;
163 int selector_shift;
164
165 /* Data window (per each page) */
166 unsigned int window_start;
167 unsigned int window_len;
112}; 168};
113 169
114typedef int (*regmap_hw_write)(void *context, const void *data, 170typedef int (*regmap_hw_write)(void *context, const void *data,
@@ -133,6 +189,12 @@ typedef void (*regmap_hw_free_context)(void *context);
133 * data. 189 * data.
134 * @read_flag_mask: Mask to be set in the top byte of the register when doing 190 * @read_flag_mask: Mask to be set in the top byte of the register when doing
135 * a read. 191 * a read.
192 * @reg_format_endian_default: Default endianness for formatted register
193 * addresses. Used when the regmap_config specifies DEFAULT. If this is
194 * DEFAULT, BIG is assumed.
195 * @val_format_endian_default: Default endianness for formatted register
196 * values. Used when the regmap_config specifies DEFAULT. If this is
197 * DEFAULT, BIG is assumed.
136 */ 198 */
137struct regmap_bus { 199struct regmap_bus {
138 bool fast_io; 200 bool fast_io;
@@ -141,6 +203,8 @@ struct regmap_bus {
141 regmap_hw_read read; 203 regmap_hw_read read;
142 regmap_hw_free_context free_context; 204 regmap_hw_free_context free_context;
143 u8 read_flag_mask; 205 u8 read_flag_mask;
206 enum regmap_endian reg_format_endian_default;
207 enum regmap_endian val_format_endian_default;
144}; 208};
145 209
146struct regmap *regmap_init(struct device *dev, 210struct regmap *regmap_init(struct device *dev,
@@ -219,6 +283,7 @@ struct regmap_irq {
219 * @status_base: Base status register address. 283 * @status_base: Base status register address.
220 * @mask_base: Base mask register address. 284 * @mask_base: Base mask register address.
221 * @ack_base: Base ack address. If zero then the chip is clear on read. 285 * @ack_base: Base ack address. If zero then the chip is clear on read.
286 * @wake_base: Base address for wake enables. If zero unsupported.
222 * @irq_reg_stride: Stride to use for chips where registers are not contiguous. 287 * @irq_reg_stride: Stride to use for chips where registers are not contiguous.
223 * 288 *
224 * @num_regs: Number of registers in each control bank. 289 * @num_regs: Number of registers in each control bank.
@@ -232,6 +297,7 @@ struct regmap_irq_chip {
232 unsigned int status_base; 297 unsigned int status_base;
233 unsigned int mask_base; 298 unsigned int mask_base;
234 unsigned int ack_base; 299 unsigned int ack_base;
300 unsigned int wake_base;
235 unsigned int irq_reg_stride; 301 unsigned int irq_reg_stride;
236 302
237 int num_regs; 303 int num_regs;
@@ -243,7 +309,7 @@ struct regmap_irq_chip {
243struct regmap_irq_chip_data; 309struct regmap_irq_chip_data;
244 310
245int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, 311int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
246 int irq_base, struct regmap_irq_chip *chip, 312 int irq_base, const struct regmap_irq_chip *chip,
247 struct regmap_irq_chip_data **data); 313 struct regmap_irq_chip_data **data);
248void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); 314void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
249int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); 315int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data);
@@ -361,7 +427,6 @@ static inline int regmap_register_patch(struct regmap *map,
361static inline struct regmap *dev_get_regmap(struct device *dev, 427static inline struct regmap *dev_get_regmap(struct device *dev,
362 const char *name) 428 const char *name)
363{ 429{
364 WARN_ONCE(1, "regmap API is disabled");
365 return NULL; 430 return NULL;
366} 431}
367 432
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 4ed1b30ac5fc..da339fd8c755 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -291,6 +291,12 @@ static inline int regulator_set_voltage(struct regulator *regulator,
291 291
292static inline int regulator_get_voltage(struct regulator *regulator) 292static inline int regulator_get_voltage(struct regulator *regulator)
293{ 293{
294 return -EINVAL;
295}
296
297static inline int regulator_is_supported_voltage(struct regulator *regulator,
298 int min_uV, int max_uV)
299{
294 return 0; 300 return 0;
295} 301}
296 302
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index b0432cc2b169..bac4c871f3bd 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -32,6 +32,8 @@ enum regulator_status {
32 REGULATOR_STATUS_NORMAL, 32 REGULATOR_STATUS_NORMAL,
33 REGULATOR_STATUS_IDLE, 33 REGULATOR_STATUS_IDLE,
34 REGULATOR_STATUS_STANDBY, 34 REGULATOR_STATUS_STANDBY,
35 /* in case that any other status doesn't apply */
36 REGULATOR_STATUS_UNDEFINED,
35}; 37};
36 38
37/** 39/**
@@ -67,6 +69,8 @@ enum regulator_status {
67 * 69 *
68 * @enable_time: Time taken for the regulator voltage output voltage to 70 * @enable_time: Time taken for the regulator voltage output voltage to
69 * stabilise after being enabled, in microseconds. 71 * stabilise after being enabled, in microseconds.
72 * @set_ramp_delay: Set the ramp delay for the regulator. The driver should
73 * select ramp delay equal to or less than(closest) ramp_delay.
70 * @set_voltage_time_sel: Time taken for the regulator voltage output voltage 74 * @set_voltage_time_sel: Time taken for the regulator voltage output voltage
71 * to stabilise after being set to a new value, in microseconds. 75 * to stabilise after being set to a new value, in microseconds.
72 * The function provides the from and to voltage selector, the 76 * The function provides the from and to voltage selector, the
@@ -113,6 +117,7 @@ struct regulator_ops {
113 117
114 /* Time taken to enable or set voltage on the regulator */ 118 /* Time taken to enable or set voltage on the regulator */
115 int (*enable_time) (struct regulator_dev *); 119 int (*enable_time) (struct regulator_dev *);
120 int (*set_ramp_delay) (struct regulator_dev *, int ramp_delay);
116 int (*set_voltage_time_sel) (struct regulator_dev *, 121 int (*set_voltage_time_sel) (struct regulator_dev *,
117 unsigned int old_selector, 122 unsigned int old_selector,
118 unsigned int new_selector); 123 unsigned int new_selector);
@@ -170,11 +175,15 @@ enum regulator_type {
170 * 175 *
171 * @min_uV: Voltage given by the lowest selector (if linear mapping) 176 * @min_uV: Voltage given by the lowest selector (if linear mapping)
172 * @uV_step: Voltage increase with each selector (if linear mapping) 177 * @uV_step: Voltage increase with each selector (if linear mapping)
178 * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
179 * @volt_table: Voltage mapping table (if table based mapping)
173 * 180 *
174 * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_ 181 * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_
175 * @vsel_mask: Mask for register bitfield used for selector 182 * @vsel_mask: Mask for register bitfield used for selector
176 * @enable_reg: Register for control when using regmap enable/disable ops 183 * @enable_reg: Register for control when using regmap enable/disable ops
177 * @enable_mask: Mask for control when using regmap enable/disable ops 184 * @enable_mask: Mask for control when using regmap enable/disable ops
185 *
186 * @enable_time: Time taken for initial enable of regulator (in uS).
178 */ 187 */
179struct regulator_desc { 188struct regulator_desc {
180 const char *name; 189 const char *name;
@@ -188,11 +197,16 @@ struct regulator_desc {
188 197
189 unsigned int min_uV; 198 unsigned int min_uV;
190 unsigned int uV_step; 199 unsigned int uV_step;
200 unsigned int ramp_delay;
201
202 const unsigned int *volt_table;
191 203
192 unsigned int vsel_reg; 204 unsigned int vsel_reg;
193 unsigned int vsel_mask; 205 unsigned int vsel_mask;
194 unsigned int enable_reg; 206 unsigned int enable_reg;
195 unsigned int enable_mask; 207 unsigned int enable_mask;
208
209 unsigned int enable_time;
196}; 210};
197 211
198/** 212/**
@@ -208,6 +222,9 @@ struct regulator_desc {
208 * @of_node: OpenFirmware node to parse for device tree bindings (may be 222 * @of_node: OpenFirmware node to parse for device tree bindings (may be
209 * NULL). 223 * NULL).
210 * @regmap: regmap to use for core regmap helpers 224 * @regmap: regmap to use for core regmap helpers
225 * @ena_gpio: GPIO controlling regulator enable.
226 * @ena_gpio_invert: Sense for GPIO enable control.
227 * @ena_gpio_flags: Flags to use when calling gpio_request_one()
211 */ 228 */
212struct regulator_config { 229struct regulator_config {
213 struct device *dev; 230 struct device *dev;
@@ -215,6 +232,10 @@ struct regulator_config {
215 void *driver_data; 232 void *driver_data;
216 struct device_node *of_node; 233 struct device_node *of_node;
217 struct regmap *regmap; 234 struct regmap *regmap;
235
236 int ena_gpio;
237 unsigned int ena_gpio_invert:1;
238 unsigned int ena_gpio_flags;
218}; 239};
219 240
220/* 241/*
@@ -253,6 +274,10 @@ struct regulator_dev {
253 void *reg_data; /* regulator_dev data */ 274 void *reg_data; /* regulator_dev data */
254 275
255 struct dentry *debugfs; 276 struct dentry *debugfs;
277
278 int ena_gpio;
279 unsigned int ena_gpio_invert:1;
280 unsigned int ena_gpio_state:1;
256}; 281};
257 282
258struct regulator_dev * 283struct regulator_dev *
@@ -271,6 +296,8 @@ int regulator_mode_to_status(unsigned int);
271 296
272int regulator_list_voltage_linear(struct regulator_dev *rdev, 297int regulator_list_voltage_linear(struct regulator_dev *rdev,
273 unsigned int selector); 298 unsigned int selector);
299int regulator_list_voltage_table(struct regulator_dev *rdev,
300 unsigned int selector);
274int regulator_map_voltage_linear(struct regulator_dev *rdev, 301int regulator_map_voltage_linear(struct regulator_dev *rdev,
275 int min_uV, int max_uV); 302 int min_uV, int max_uV);
276int regulator_map_voltage_iterate(struct regulator_dev *rdev, 303int regulator_map_voltage_iterate(struct regulator_dev *rdev,
@@ -280,6 +307,9 @@ int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel);
280int regulator_is_enabled_regmap(struct regulator_dev *rdev); 307int regulator_is_enabled_regmap(struct regulator_dev *rdev);
281int regulator_enable_regmap(struct regulator_dev *rdev); 308int regulator_enable_regmap(struct regulator_dev *rdev);
282int regulator_disable_regmap(struct regulator_dev *rdev); 309int regulator_disable_regmap(struct regulator_dev *rdev);
310int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
311 unsigned int old_selector,
312 unsigned int new_selector);
283 313
284void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); 314void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
285 315
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index f83f7440b488..48918be649d4 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -22,6 +22,7 @@ struct regulator_init_data;
22/** 22/**
23 * struct fixed_voltage_config - fixed_voltage_config structure 23 * struct fixed_voltage_config - fixed_voltage_config structure
24 * @supply_name: Name of the regulator supply 24 * @supply_name: Name of the regulator supply
25 * @input_supply: Name of the input regulator supply
25 * @microvolts: Output voltage of regulator 26 * @microvolts: Output voltage of regulator
26 * @gpio: GPIO to use for enable control 27 * @gpio: GPIO to use for enable control
27 * set to -EINVAL if not used 28 * set to -EINVAL if not used
@@ -46,6 +47,7 @@ struct regulator_init_data;
46 */ 47 */
47struct fixed_voltage_config { 48struct fixed_voltage_config {
48 const char *supply_name; 49 const char *supply_name;
50 const char *input_supply;
49 int microvolts; 51 int microvolts;
50 int gpio; 52 int gpio;
51 unsigned startup_delay; 53 unsigned startup_delay;
@@ -58,14 +60,17 @@ struct fixed_voltage_config {
58struct regulator_consumer_supply; 60struct regulator_consumer_supply;
59 61
60#if IS_ENABLED(CONFIG_REGULATOR) 62#if IS_ENABLED(CONFIG_REGULATOR)
61struct platform_device *regulator_register_fixed(int id, 63struct platform_device *regulator_register_always_on(int id, const char *name,
62 struct regulator_consumer_supply *supplies, int num_supplies); 64 struct regulator_consumer_supply *supplies, int num_supplies, int uv);
63#else 65#else
64static inline struct platform_device *regulator_register_fixed(int id, 66static inline struct platform_device *regulator_register_always_on(int id, const char *name,
65 struct regulator_consumer_supply *supplies, int num_supplies) 67 struct regulator_consumer_supply *supplies, int num_supplies, int uv)
66{ 68{
67 return NULL; 69 return NULL;
68} 70}
69#endif 71#endif
70 72
73#define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
74 "fixed-dummy", s, ns, 0)
75
71#endif 76#endif
diff --git a/include/linux/regulator/lp872x.h b/include/linux/regulator/lp872x.h
new file mode 100644
index 000000000000..132e05c46661
--- /dev/null
+++ b/include/linux/regulator/lp872x.h
@@ -0,0 +1,90 @@
1/*
2 * Copyright 2012 Texas Instruments
3 *
4 * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#ifndef __LP872X_REGULATOR_H__
13#define __LP872X_REGULATOR_H__
14
15#include <linux/regulator/machine.h>
16#include <linux/platform_device.h>
17#include <linux/gpio.h>
18
19#define LP872X_MAX_REGULATORS 9
20
21enum lp872x_regulator_id {
22 LP8720_ID_BASE,
23 LP8720_ID_LDO1 = LP8720_ID_BASE,
24 LP8720_ID_LDO2,
25 LP8720_ID_LDO3,
26 LP8720_ID_LDO4,
27 LP8720_ID_LDO5,
28 LP8720_ID_BUCK,
29
30 LP8725_ID_BASE,
31 LP8725_ID_LDO1 = LP8725_ID_BASE,
32 LP8725_ID_LDO2,
33 LP8725_ID_LDO3,
34 LP8725_ID_LDO4,
35 LP8725_ID_LDO5,
36 LP8725_ID_LILO1,
37 LP8725_ID_LILO2,
38 LP8725_ID_BUCK1,
39 LP8725_ID_BUCK2,
40
41 LP872X_ID_MAX,
42};
43
44enum lp872x_dvs_state {
45 DVS_LOW = GPIOF_OUT_INIT_LOW,
46 DVS_HIGH = GPIOF_OUT_INIT_HIGH,
47};
48
49enum lp872x_dvs_sel {
50 SEL_V1,
51 SEL_V2,
52};
53
54/**
55 * lp872x_dvs
56 * @gpio : gpio pin number for dvs control
57 * @vsel : dvs selector for buck v1 or buck v2 register
58 * @init_state : initial dvs pin state
59 */
60struct lp872x_dvs {
61 int gpio;
62 enum lp872x_dvs_sel vsel;
63 enum lp872x_dvs_state init_state;
64};
65
66/**
67 * lp872x_regdata
68 * @id : regulator id
69 * @init_data : init data for each regulator
70 */
71struct lp872x_regulator_data {
72 enum lp872x_regulator_id id;
73 struct regulator_init_data *init_data;
74};
75
76/**
77 * lp872x_platform_data
78 * @general_config : the value of LP872X_GENERAL_CFG register
79 * @update_config : if LP872X_GENERAL_CFG register is updated, set true
80 * @regulator_data : platform regulator id and init data
81 * @dvs : dvs data for buck voltage control
82 */
83struct lp872x_platform_data {
84 u8 general_config;
85 bool update_config;
86 struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
87 struct lp872x_dvs *dvs;
88};
89
90#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index b02108446be7..40dd0a394cfa 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -92,6 +92,7 @@ struct regulator_state {
92 * mode. 92 * mode.
93 * @initial_state: Suspend state to set by default. 93 * @initial_state: Suspend state to set by default.
94 * @initial_mode: Mode to set at startup. 94 * @initial_mode: Mode to set at startup.
95 * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
95 */ 96 */
96struct regulation_constraints { 97struct regulation_constraints {
97 98
@@ -125,6 +126,8 @@ struct regulation_constraints {
125 /* mode to set on startup */ 126 /* mode to set on startup */
126 unsigned int initial_mode; 127 unsigned int initial_mode;
127 128
129 unsigned int ramp_delay;
130
128 /* constraint flags */ 131 /* constraint flags */
129 unsigned always_on:1; /* regulator never off when system is on */ 132 unsigned always_on:1; /* regulator never off when system is on */
130 unsigned boot_on:1; /* bootloader/firmware enabled regulator */ 133 unsigned boot_on:1; /* bootloader/firmware enabled regulator */
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h
index a8e50e44203c..82a673905edb 100644
--- a/include/linux/rpmsg.h
+++ b/include/linux/rpmsg.h
@@ -38,6 +38,8 @@
38#include <linux/types.h> 38#include <linux/types.h>
39#include <linux/device.h> 39#include <linux/device.h>
40#include <linux/mod_devicetable.h> 40#include <linux/mod_devicetable.h>
41#include <linux/kref.h>
42#include <linux/mutex.h>
41 43
42/* The feature bitmap for virtio rpmsg */ 44/* The feature bitmap for virtio rpmsg */
43#define VIRTIO_RPMSG_F_NS 0 /* RP supports name service notifications */ 45#define VIRTIO_RPMSG_F_NS 0 /* RP supports name service notifications */
@@ -120,7 +122,9 @@ typedef void (*rpmsg_rx_cb_t)(struct rpmsg_channel *, void *, int, void *, u32);
120/** 122/**
121 * struct rpmsg_endpoint - binds a local rpmsg address to its user 123 * struct rpmsg_endpoint - binds a local rpmsg address to its user
122 * @rpdev: rpmsg channel device 124 * @rpdev: rpmsg channel device
125 * @refcount: when this drops to zero, the ept is deallocated
123 * @cb: rx callback handler 126 * @cb: rx callback handler
127 * @cb_lock: must be taken before accessing/changing @cb
124 * @addr: local rpmsg address 128 * @addr: local rpmsg address
125 * @priv: private data for the driver's use 129 * @priv: private data for the driver's use
126 * 130 *
@@ -140,7 +144,9 @@ typedef void (*rpmsg_rx_cb_t)(struct rpmsg_channel *, void *, int, void *, u32);
140 */ 144 */
141struct rpmsg_endpoint { 145struct rpmsg_endpoint {
142 struct rpmsg_channel *rpdev; 146 struct rpmsg_channel *rpdev;
147 struct kref refcount;
143 rpmsg_rx_cb_t cb; 148 rpmsg_rx_cb_t cb;
149 struct mutex cb_lock;
144 u32 addr; 150 u32 addr;
145 void *priv; 151 void *priv;
146}; 152};
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 2c1de8982c85..db71c4ad8624 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -612,12 +612,6 @@ struct tcamsg {
612#include <linux/mutex.h> 612#include <linux/mutex.h>
613#include <linux/netdevice.h> 613#include <linux/netdevice.h>
614 614
615static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
616{
617 int len = strlen(str) + 1;
618 return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
619}
620
621extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); 615extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
622extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); 616extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
623extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, 617extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
@@ -625,124 +619,7 @@ extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
625extern void rtnl_set_sk_err(struct net *net, u32 group, int error); 619extern void rtnl_set_sk_err(struct net *net, u32 group, int error);
626extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); 620extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
627extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, 621extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst,
628 u32 id, u32 ts, u32 tsage, long expires, 622 u32 id, long expires, u32 error);
629 u32 error);
630
631extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
632
633#define RTA_PUT(skb, attrtype, attrlen, data) \
634({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
635 goto rtattr_failure; \
636 __rta_fill(skb, attrtype, attrlen, data); })
637
638#define RTA_APPEND(skb, attrlen, data) \
639({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \
640 goto rtattr_failure; \
641 memcpy(skb_put(skb, attrlen), data, attrlen); })
642
643#define RTA_PUT_NOHDR(skb, attrlen, data) \
644({ RTA_APPEND(skb, RTA_ALIGN(attrlen), data); \
645 memset(skb_tail_pointer(skb) - (RTA_ALIGN(attrlen) - attrlen), 0, \
646 RTA_ALIGN(attrlen) - attrlen); })
647
648#define RTA_PUT_U8(skb, attrtype, value) \
649({ u8 _tmp = (value); \
650 RTA_PUT(skb, attrtype, sizeof(u8), &_tmp); })
651
652#define RTA_PUT_U16(skb, attrtype, value) \
653({ u16 _tmp = (value); \
654 RTA_PUT(skb, attrtype, sizeof(u16), &_tmp); })
655
656#define RTA_PUT_U32(skb, attrtype, value) \
657({ u32 _tmp = (value); \
658 RTA_PUT(skb, attrtype, sizeof(u32), &_tmp); })
659
660#define RTA_PUT_U64(skb, attrtype, value) \
661({ u64 _tmp = (value); \
662 RTA_PUT(skb, attrtype, sizeof(u64), &_tmp); })
663
664#define RTA_PUT_SECS(skb, attrtype, value) \
665 RTA_PUT_U64(skb, attrtype, (value) / HZ)
666
667#define RTA_PUT_MSECS(skb, attrtype, value) \
668 RTA_PUT_U64(skb, attrtype, jiffies_to_msecs(value))
669
670#define RTA_PUT_STRING(skb, attrtype, value) \
671 RTA_PUT(skb, attrtype, strlen(value) + 1, value)
672
673#define RTA_PUT_FLAG(skb, attrtype) \
674 RTA_PUT(skb, attrtype, 0, NULL);
675
676#define RTA_NEST(skb, type) \
677({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \
678 RTA_PUT(skb, type, 0, NULL); \
679 __start; })
680
681#define RTA_NEST_END(skb, start) \
682({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
683 (skb)->len; })
684
685#define RTA_NEST_COMPAT(skb, type, attrlen, data) \
686({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \
687 RTA_PUT(skb, type, attrlen, data); \
688 RTA_NEST(skb, type); \
689 __start; })
690
691#define RTA_NEST_COMPAT_END(skb, start) \
692({ struct rtattr *__nest = (void *)(start) + NLMSG_ALIGN((start)->rta_len); \
693 (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
694 RTA_NEST_END(skb, __nest); \
695 (skb)->len; })
696
697#define RTA_NEST_CANCEL(skb, start) \
698({ if (start) \
699 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
700 -1; })
701
702#define RTA_GET_U8(rta) \
703({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u8)) \
704 goto rtattr_failure; \
705 *(u8 *) RTA_DATA(rta); })
706
707#define RTA_GET_U16(rta) \
708({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u16)) \
709 goto rtattr_failure; \
710 *(u16 *) RTA_DATA(rta); })
711
712#define RTA_GET_U32(rta) \
713({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u32)) \
714 goto rtattr_failure; \
715 *(u32 *) RTA_DATA(rta); })
716
717#define RTA_GET_U64(rta) \
718({ u64 _tmp; \
719 if (!rta || RTA_PAYLOAD(rta) < sizeof(u64)) \
720 goto rtattr_failure; \
721 memcpy(&_tmp, RTA_DATA(rta), sizeof(_tmp)); \
722 _tmp; })
723
724#define RTA_GET_FLAG(rta) (!!(rta))
725
726#define RTA_GET_SECS(rta) ((unsigned long) RTA_GET_U64(rta) * HZ)
727#define RTA_GET_MSECS(rta) (msecs_to_jiffies((unsigned long) RTA_GET_U64(rta)))
728
729static inline struct rtattr *
730__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
731{
732 struct rtattr *rta;
733 int size = RTA_LENGTH(attrlen);
734
735 rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
736 rta->rta_type = attrtype;
737 rta->rta_len = size;
738 memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size);
739 return rta;
740}
741
742#define __RTA_PUT(skb, attrtype, attrlen) \
743({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
744 goto rtattr_failure; \
745 __rta_reserve(skb, attrtype, attrlen); })
746 623
747extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); 624extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
748 625
@@ -794,13 +671,6 @@ extern void __rtnl_unlock(void);
794 } \ 671 } \
795} while(0) 672} while(0)
796 673
797static inline u32 rtm_get_table(struct rtattr **rta, u8 table)
798{
799 return RTA_GET_U32(rta[RTA_TABLE-1]);
800rtattr_failure:
801 return table;
802}
803
804extern int ndo_dflt_fdb_dump(struct sk_buff *skb, 674extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
805 struct netlink_callback *cb, 675 struct netlink_callback *cb,
806 struct net_device *dev, 676 struct net_device *dev,
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4059c0f33f07..1a2ebd39b800 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1405,7 +1405,7 @@ struct task_struct {
1405 int (*notifier)(void *priv); 1405 int (*notifier)(void *priv);
1406 void *notifier_data; 1406 void *notifier_data;
1407 sigset_t *notifier_mask; 1407 sigset_t *notifier_mask;
1408 struct hlist_head task_works; 1408 struct callback_head *task_works;
1409 1409
1410 struct audit_context *audit_context; 1410 struct audit_context *audit_context;
1411#ifdef CONFIG_AUDITSYSCALL 1411#ifdef CONFIG_AUDITSYSCALL
@@ -1546,7 +1546,6 @@ struct task_struct {
1546 unsigned long timer_slack_ns; 1546 unsigned long timer_slack_ns;
1547 unsigned long default_timer_slack_ns; 1547 unsigned long default_timer_slack_ns;
1548 1548
1549 struct list_head *scm_work_list;
1550#ifdef CONFIG_FUNCTION_GRAPH_TRACER 1549#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1551 /* Index of current stored address in ret_stack */ 1550 /* Index of current stored address in ret_stack */
1552 int curr_ret_stack; 1551 int curr_ret_stack;
@@ -1581,7 +1580,6 @@ struct task_struct {
1581#endif 1580#endif
1582#ifdef CONFIG_UPROBES 1581#ifdef CONFIG_UPROBES
1583 struct uprobe_task *utask; 1582 struct uprobe_task *utask;
1584 int uprobe_srcu_id;
1585#endif 1583#endif
1586}; 1584};
1587 1585
@@ -1871,22 +1869,12 @@ static inline void rcu_copy_process(struct task_struct *p)
1871 INIT_LIST_HEAD(&p->rcu_node_entry); 1869 INIT_LIST_HEAD(&p->rcu_node_entry);
1872} 1870}
1873 1871
1874static inline void rcu_switch_from(struct task_struct *prev)
1875{
1876 if (prev->rcu_read_lock_nesting != 0)
1877 rcu_preempt_note_context_switch();
1878}
1879
1880#else 1872#else
1881 1873
1882static inline void rcu_copy_process(struct task_struct *p) 1874static inline void rcu_copy_process(struct task_struct *p)
1883{ 1875{
1884} 1876}
1885 1877
1886static inline void rcu_switch_from(struct task_struct *prev)
1887{
1888}
1889
1890#endif 1878#endif
1891 1879
1892#ifdef CONFIG_SMP 1880#ifdef CONFIG_SMP
@@ -1909,6 +1897,14 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p,
1909} 1897}
1910#endif 1898#endif
1911 1899
1900#ifdef CONFIG_NO_HZ
1901void calc_load_enter_idle(void);
1902void calc_load_exit_idle(void);
1903#else
1904static inline void calc_load_enter_idle(void) { }
1905static inline void calc_load_exit_idle(void) { }
1906#endif /* CONFIG_NO_HZ */
1907
1912#ifndef CONFIG_CPUMASK_OFFSTACK 1908#ifndef CONFIG_CPUMASK_OFFSTACK
1913static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) 1909static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1914{ 1910{
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index fc61854f6224..83c44eefe698 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -86,6 +86,7 @@ int seq_puts(struct seq_file *m, const char *s);
86int seq_write(struct seq_file *seq, const void *data, size_t len); 86int seq_write(struct seq_file *seq, const void *data, size_t len);
87 87
88__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...); 88__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...);
89__printf(2, 0) int seq_vprintf(struct seq_file *, const char *, va_list args);
89 90
90int seq_path(struct seq_file *, const struct path *, const char *); 91int seq_path(struct seq_file *, const struct path *, const char *);
91int seq_dentry(struct seq_file *, struct dentry *, const char *); 92int seq_dentry(struct seq_file *, struct dentry *, const char *);
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
index c4a5a8cd4469..631af63af42d 100644
--- a/include/linux/sfi_acpi.h
+++ b/include/linux/sfi_acpi.h
@@ -66,7 +66,7 @@ extern int sfi_acpi_table_parse(char *signature, char *oem_id,
66 char *oem_table_id, 66 char *oem_table_id,
67 int (*handler)(struct acpi_table_header *)); 67 int (*handler)(struct acpi_table_header *));
68 68
69static inline int acpi_sfi_table_parse(char *signature, 69static inline int __init acpi_sfi_table_parse(char *signature,
70 int (*handler)(struct acpi_table_header *)) 70 int (*handler)(struct acpi_table_header *))
71{ 71{
72 if (!acpi_table_parse(signature, handler)) 72 if (!acpi_table_parse(signature, handler))
@@ -83,7 +83,7 @@ static inline int sfi_acpi_table_parse(char *signature, char *oem_id,
83 return -1; 83 return -1;
84} 84}
85 85
86static inline int acpi_sfi_table_parse(char *signature, 86static inline int __init acpi_sfi_table_parse(char *signature,
87 int (*handler)(struct acpi_table_header *)) 87 int (*handler)(struct acpi_table_header *))
88{ 88{
89 return acpi_table_parse(signature, handler); 89 return acpi_table_parse(signature, handler);
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index c513b73cd7cb..50910913b268 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -18,7 +18,6 @@ struct clk_mapping {
18 struct kref ref; 18 struct kref ref;
19}; 19};
20 20
21
22struct sh_clk_ops { 21struct sh_clk_ops {
23#ifdef CONFIG_SH_CLK_CPG_LEGACY 22#ifdef CONFIG_SH_CLK_CPG_LEGACY
24 void (*init)(struct clk *clk); 23 void (*init)(struct clk *clk);
@@ -31,6 +30,10 @@ struct sh_clk_ops {
31 long (*round_rate)(struct clk *clk, unsigned long rate); 30 long (*round_rate)(struct clk *clk, unsigned long rate);
32}; 31};
33 32
33#define SH_CLK_DIV_MSK(div) ((1 << (div)) - 1)
34#define SH_CLK_DIV4_MSK SH_CLK_DIV_MSK(4)
35#define SH_CLK_DIV6_MSK SH_CLK_DIV_MSK(6)
36
34struct clk { 37struct clk {
35 struct list_head node; 38 struct list_head node;
36 struct clk *parent; 39 struct clk *parent;
@@ -52,6 +55,7 @@ struct clk {
52 unsigned int enable_bit; 55 unsigned int enable_bit;
53 void __iomem *mapped_reg; 56 void __iomem *mapped_reg;
54 57
58 unsigned int div_mask;
55 unsigned long arch_flags; 59 unsigned long arch_flags;
56 void *priv; 60 void *priv;
57 struct clk_mapping *mapping; 61 struct clk_mapping *mapping;
@@ -65,6 +69,8 @@ struct clk {
65#define CLK_ENABLE_REG_16BIT BIT(2) 69#define CLK_ENABLE_REG_16BIT BIT(2)
66#define CLK_ENABLE_REG_8BIT BIT(3) 70#define CLK_ENABLE_REG_8BIT BIT(3)
67 71
72#define CLK_MASK_DIV_ON_DISABLE BIT(4)
73
68#define CLK_ENABLE_REG_MASK (CLK_ENABLE_REG_32BIT | \ 74#define CLK_ENABLE_REG_MASK (CLK_ENABLE_REG_32BIT | \
69 CLK_ENABLE_REG_16BIT | \ 75 CLK_ENABLE_REG_16BIT | \
70 CLK_ENABLE_REG_8BIT) 76 CLK_ENABLE_REG_8BIT)
@@ -146,14 +152,17 @@ static inline int __deprecated sh_clk_mstp32_register(struct clk *clks, int nr)
146 .enable_reg = (void __iomem *)_reg, \ 152 .enable_reg = (void __iomem *)_reg, \
147 .enable_bit = _shift, \ 153 .enable_bit = _shift, \
148 .arch_flags = _div_bitmap, \ 154 .arch_flags = _div_bitmap, \
155 .div_mask = SH_CLK_DIV4_MSK, \
149 .flags = _flags, \ 156 .flags = _flags, \
150} 157}
151 158
152struct clk_div4_table { 159struct clk_div_table {
153 struct clk_div_mult_table *div_mult_table; 160 struct clk_div_mult_table *div_mult_table;
154 void (*kick)(struct clk *clk); 161 void (*kick)(struct clk *clk);
155}; 162};
156 163
164#define clk_div4_table clk_div_table
165
157int sh_clk_div4_register(struct clk *clks, int nr, 166int sh_clk_div4_register(struct clk *clks, int nr,
158 struct clk_div4_table *table); 167 struct clk_div4_table *table);
159int sh_clk_div4_enable_register(struct clk *clks, int nr, 168int sh_clk_div4_enable_register(struct clk *clks, int nr,
@@ -165,7 +174,9 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
165 _num_parents, _src_shift, _src_width) \ 174 _num_parents, _src_shift, _src_width) \
166{ \ 175{ \
167 .enable_reg = (void __iomem *)_reg, \ 176 .enable_reg = (void __iomem *)_reg, \
168 .flags = _flags, \ 177 .enable_bit = 0, /* unused */ \
178 .flags = _flags | CLK_MASK_DIV_ON_DISABLE, \
179 .div_mask = SH_CLK_DIV6_MSK, \
169 .parent_table = _parents, \ 180 .parent_table = _parents, \
170 .parent_num = _num_parents, \ 181 .parent_num = _num_parents, \
171 .src_shift = _src_shift, \ 182 .src_shift = _src_shift, \
@@ -176,7 +187,9 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
176{ \ 187{ \
177 .parent = _parent, \ 188 .parent = _parent, \
178 .enable_reg = (void __iomem *)_reg, \ 189 .enable_reg = (void __iomem *)_reg, \
179 .flags = _flags, \ 190 .enable_bit = 0, /* unused */ \
191 .div_mask = SH_CLK_DIV6_MSK, \
192 .flags = _flags | CLK_MASK_DIV_ON_DISABLE, \
180} 193}
181 194
182int sh_clk_div6_register(struct clk *clks, int nr); 195int sh_clk_div6_register(struct clk *clks, int nr);
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index 425450b980b8..b64d6bec6f90 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -10,38 +10,27 @@
10#ifndef SH_DMA_H 10#ifndef SH_DMA_H
11#define SH_DMA_H 11#define SH_DMA_H
12 12
13#include <linux/list.h>
14#include <linux/dmaengine.h> 13#include <linux/dmaengine.h>
14#include <linux/list.h>
15#include <linux/shdma-base.h>
16#include <linux/types.h>
17
18struct device;
15 19
16/* Used by slave DMA clients to request DMA to/from a specific peripheral */ 20/* Used by slave DMA clients to request DMA to/from a specific peripheral */
17struct sh_dmae_slave { 21struct sh_dmae_slave {
18 unsigned int slave_id; /* Set by the platform */ 22 struct shdma_slave shdma_slave; /* Set by the platform */
19 struct device *dma_dev; /* Set by the platform */
20 const struct sh_dmae_slave_config *config; /* Set by the driver */
21};
22
23struct sh_dmae_regs {
24 u32 sar; /* SAR / source address */
25 u32 dar; /* DAR / destination address */
26 u32 tcr; /* TCR / transfer count */
27};
28
29struct sh_desc {
30 struct sh_dmae_regs hw;
31 struct list_head node;
32 struct dma_async_tx_descriptor async_tx;
33 enum dma_transfer_direction direction;
34 dma_cookie_t cookie;
35 size_t partial;
36 int chunks;
37 int mark;
38}; 23};
39 24
25/*
26 * Supplied by platforms to specify, how a DMA channel has to be configured for
27 * a certain peripheral
28 */
40struct sh_dmae_slave_config { 29struct sh_dmae_slave_config {
41 unsigned int slave_id; 30 int slave_id;
42 dma_addr_t addr; 31 dma_addr_t addr;
43 u32 chcr; 32 u32 chcr;
44 char mid_rid; 33 char mid_rid;
45}; 34};
46 35
47struct sh_dmae_channel { 36struct sh_dmae_channel {
@@ -110,4 +99,6 @@ struct sh_dmae_pdata {
110#define CHCR_TE 0x00000002 99#define CHCR_TE 0x00000002
111#define CHCR_IE 0x00000004 100#define CHCR_IE 0x00000004
112 101
102bool shdma_chan_filter(struct dma_chan *chan, void *arg);
103
113#endif 104#endif
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
index 5c15aed9c4b2..c19a0925829a 100644
--- a/include/linux/sh_pfc.h
+++ b/include/linux/sh_pfc.h
@@ -11,22 +11,24 @@
11#ifndef __SH_PFC_H 11#ifndef __SH_PFC_H
12#define __SH_PFC_H 12#define __SH_PFC_H
13 13
14#include <linux/stringify.h>
14#include <asm-generic/gpio.h> 15#include <asm-generic/gpio.h>
15 16
16typedef unsigned short pinmux_enum_t; 17typedef unsigned short pinmux_enum_t;
17typedef unsigned short pinmux_flag_t; 18typedef unsigned short pinmux_flag_t;
18 19
19#define PINMUX_TYPE_NONE 0 20enum {
20#define PINMUX_TYPE_FUNCTION 1 21 PINMUX_TYPE_NONE,
21#define PINMUX_TYPE_GPIO 2
22#define PINMUX_TYPE_OUTPUT 3
23#define PINMUX_TYPE_INPUT 4
24#define PINMUX_TYPE_INPUT_PULLUP 5
25#define PINMUX_TYPE_INPUT_PULLDOWN 6
26 22
27#define PINMUX_FLAG_TYPE (0x7) 23 PINMUX_TYPE_FUNCTION,
28#define PINMUX_FLAG_WANT_PULLUP (1 << 3) 24 PINMUX_TYPE_GPIO,
29#define PINMUX_FLAG_WANT_PULLDOWN (1 << 4) 25 PINMUX_TYPE_OUTPUT,
26 PINMUX_TYPE_INPUT,
27 PINMUX_TYPE_INPUT_PULLUP,
28 PINMUX_TYPE_INPUT_PULLDOWN,
29
30 PINMUX_FLAG_TYPE, /* must be last */
31};
30 32
31#define PINMUX_FLAG_DBIT_SHIFT 5 33#define PINMUX_FLAG_DBIT_SHIFT 5
32#define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT) 34#define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT)
@@ -36,9 +38,12 @@ typedef unsigned short pinmux_flag_t;
36struct pinmux_gpio { 38struct pinmux_gpio {
37 pinmux_enum_t enum_id; 39 pinmux_enum_t enum_id;
38 pinmux_flag_t flags; 40 pinmux_flag_t flags;
41 const char *name;
39}; 42};
40 43
41#define PINMUX_GPIO(gpio, data_or_mark) [gpio] = { data_or_mark } 44#define PINMUX_GPIO(gpio, data_or_mark) \
45 [gpio] = { .name = __stringify(gpio), .enum_id = data_or_mark, .flags = PINMUX_TYPE_NONE }
46
42#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0 47#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0
43 48
44struct pinmux_cfg_reg { 49struct pinmux_cfg_reg {
@@ -89,7 +94,7 @@ struct pfc_window {
89 unsigned long size; 94 unsigned long size;
90}; 95};
91 96
92struct pinmux_info { 97struct sh_pfc {
93 char *name; 98 char *name;
94 pinmux_enum_t reserved_id; 99 pinmux_enum_t reserved_id;
95 struct pinmux_range data; 100 struct pinmux_range data;
@@ -112,17 +117,45 @@ struct pinmux_info {
112 struct pinmux_irq *gpio_irq; 117 struct pinmux_irq *gpio_irq;
113 unsigned int gpio_irq_size; 118 unsigned int gpio_irq_size;
114 119
120 spinlock_t lock;
121
115 struct resource *resource; 122 struct resource *resource;
116 unsigned int num_resources; 123 unsigned int num_resources;
117 struct pfc_window *window; 124 struct pfc_window *window;
118 125
119 unsigned long unlock_reg; 126 unsigned long unlock_reg;
120
121 struct gpio_chip chip;
122}; 127};
123 128
124int register_pinmux(struct pinmux_info *pip); 129/* XXX compat for now */
125int unregister_pinmux(struct pinmux_info *pip); 130#define pinmux_info sh_pfc
131
132/* drivers/sh/pfc/gpio.c */
133int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
134
135/* drivers/sh/pfc/pinctrl.c */
136int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
137
138/* drivers/sh/pfc/core.c */
139int register_sh_pfc(struct sh_pfc *pfc);
140
141int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos);
142void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos,
143 unsigned long value);
144int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio,
145 struct pinmux_data_reg **drp, int *bitp);
146int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos,
147 pinmux_enum_t *enum_idp);
148int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type,
149 int cfg_mode);
150
151/* xxx */
152static inline int register_pinmux(struct pinmux_info *pip)
153{
154 struct sh_pfc *pfc = pip;
155 return register_sh_pfc(pfc);
156}
157
158enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };
126 159
127/* helper macro for port */ 160/* helper macro for port */
128#define PORT_1(fn, pfx, sfx) fn(pfx, sfx) 161#define PORT_1(fn, pfx, sfx) fn(pfx, sfx)
diff --git a/include/linux/shdma-base.h b/include/linux/shdma-base.h
new file mode 100644
index 000000000000..93f9821554b6
--- /dev/null
+++ b/include/linux/shdma-base.h
@@ -0,0 +1,124 @@
1/*
2 * Dmaengine driver base library for DMA controllers, found on SH-based SoCs
3 *
4 * extracted from shdma.c and headers
5 *
6 * Copyright (C) 2011-2012 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
7 * Copyright (C) 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
8 * Copyright (C) 2009 Renesas Solutions, Inc. All rights reserved.
9 * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
10 *
11 * This is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 */
15
16#ifndef SHDMA_BASE_H
17#define SHDMA_BASE_H
18
19#include <linux/dmaengine.h>
20#include <linux/interrupt.h>
21#include <linux/list.h>
22#include <linux/types.h>
23
24/**
25 * shdma_pm_state - DMA channel PM state
26 * SHDMA_PM_ESTABLISHED: either idle or during data transfer
27 * SHDMA_PM_BUSY: during the transfer preparation, when we have to
28 * drop the lock temporarily
29 * SHDMA_PM_PENDING: transfers pending
30 */
31enum shdma_pm_state {
32 SHDMA_PM_ESTABLISHED,
33 SHDMA_PM_BUSY,
34 SHDMA_PM_PENDING,
35};
36
37struct device;
38
39/*
40 * Drivers, using this library are expected to embed struct shdma_dev,
41 * struct shdma_chan, struct shdma_desc, and struct shdma_slave
42 * in their respective device, channel, descriptor and slave objects.
43 */
44
45struct shdma_slave {
46 int slave_id;
47};
48
49struct shdma_desc {
50 struct list_head node;
51 struct dma_async_tx_descriptor async_tx;
52 enum dma_transfer_direction direction;
53 dma_cookie_t cookie;
54 int chunks;
55 int mark;
56};
57
58struct shdma_chan {
59 spinlock_t chan_lock; /* Channel operation lock */
60 struct list_head ld_queue; /* Link descriptors queue */
61 struct list_head ld_free; /* Free link descriptors */
62 struct dma_chan dma_chan; /* DMA channel */
63 struct device *dev; /* Channel device */
64 void *desc; /* buffer for descriptor array */
65 int desc_num; /* desc count */
66 size_t max_xfer_len; /* max transfer length */
67 int id; /* Raw id of this channel */
68 int irq; /* Channel IRQ */
69 int slave_id; /* Client ID for slave DMA */
70 enum shdma_pm_state pm_state;
71};
72
73/**
74 * struct shdma_ops - simple DMA driver operations
75 * desc_completed: return true, if this is the descriptor, that just has
76 * completed (atomic)
77 * halt_channel: stop DMA channel operation (atomic)
78 * channel_busy: return true, if the channel is busy (atomic)
79 * slave_addr: return slave DMA address
80 * desc_setup: set up the hardware specific descriptor portion (atomic)
81 * set_slave: bind channel to a slave
82 * setup_xfer: configure channel hardware for operation (atomic)
83 * start_xfer: start the DMA transfer (atomic)
84 * embedded_desc: return Nth struct shdma_desc pointer from the
85 * descriptor array
86 * chan_irq: process channel IRQ, return true if a transfer has
87 * completed (atomic)
88 */
89struct shdma_ops {
90 bool (*desc_completed)(struct shdma_chan *, struct shdma_desc *);
91 void (*halt_channel)(struct shdma_chan *);
92 bool (*channel_busy)(struct shdma_chan *);
93 dma_addr_t (*slave_addr)(struct shdma_chan *);
94 int (*desc_setup)(struct shdma_chan *, struct shdma_desc *,
95 dma_addr_t, dma_addr_t, size_t *);
96 int (*set_slave)(struct shdma_chan *, int, bool);
97 void (*setup_xfer)(struct shdma_chan *, int);
98 void (*start_xfer)(struct shdma_chan *, struct shdma_desc *);
99 struct shdma_desc *(*embedded_desc)(void *, int);
100 bool (*chan_irq)(struct shdma_chan *, int);
101};
102
103struct shdma_dev {
104 struct dma_device dma_dev;
105 struct shdma_chan **schan;
106 const struct shdma_ops *ops;
107 size_t desc_size;
108};
109
110#define shdma_for_each_chan(c, d, i) for (i = 0, c = (d)->schan[0]; \
111 i < (d)->dma_dev.chancnt; c = (d)->schan[++i])
112
113int shdma_request_irq(struct shdma_chan *, int,
114 unsigned long, const char *);
115void shdma_free_irq(struct shdma_chan *);
116bool shdma_reset(struct shdma_dev *sdev);
117void shdma_chan_probe(struct shdma_dev *sdev,
118 struct shdma_chan *schan, int id);
119void shdma_chan_remove(struct shdma_chan *schan);
120int shdma_init(struct device *dev, struct shdma_dev *sdev,
121 int chan_num);
122void shdma_cleanup(struct shdma_dev *sdev);
123
124#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 642cb7355df3..d205c4be7f5b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1667,6 +1667,22 @@ static inline void skb_orphan(struct sk_buff *skb)
1667} 1667}
1668 1668
1669/** 1669/**
1670 * skb_orphan_frags - orphan the frags contained in a buffer
1671 * @skb: buffer to orphan frags from
1672 * @gfp_mask: allocation mask for replacement pages
1673 *
1674 * For each frag in the SKB which needs a destructor (i.e. has an
1675 * owner) create a copy of that frag and release the original
1676 * page by calling the destructor.
1677 */
1678static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask)
1679{
1680 if (likely(!(skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)))
1681 return 0;
1682 return skb_copy_ubufs(skb, gfp_mask);
1683}
1684
1685/**
1670 * __skb_queue_purge - empty a list 1686 * __skb_queue_purge - empty a list
1671 * @list: list to empty 1687 * @list: list to empty
1672 * 1688 *
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 717fb746c9a8..dd6f06be3c9f 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -90,10 +90,6 @@ void kick_all_cpus_sync(void);
90void __init call_function_init(void); 90void __init call_function_init(void);
91void generic_smp_call_function_single_interrupt(void); 91void generic_smp_call_function_single_interrupt(void);
92void generic_smp_call_function_interrupt(void); 92void generic_smp_call_function_interrupt(void);
93void ipi_call_lock(void);
94void ipi_call_unlock(void);
95void ipi_call_lock_irq(void);
96void ipi_call_unlock_irq(void);
97#else 93#else
98static inline void call_function_init(void) { } 94static inline void call_function_init(void) { }
99#endif 95#endif
@@ -181,7 +177,6 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info)
181 } while (0) 177 } while (0)
182 178
183static inline void smp_send_reschedule(int cpu) { } 179static inline void smp_send_reschedule(int cpu) { }
184#define num_booting_cpus() 1
185#define smp_prepare_boot_cpu() do {} while (0) 180#define smp_prepare_boot_cpu() do {} while (0)
186#define smp_call_function_many(mask, func, info, wait) \ 181#define smp_call_function_many(mask, func, info, wait) \
187 (up_smp_call_function(func, info)) 182 (up_smp_call_function(func, info))
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 2e68f5ba0389..00bc189cb395 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -208,7 +208,6 @@ enum
208 LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */ 208 LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */
209 LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */ 209 LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */
210 LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */ 210 LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */
211 LINUX_MIB_TCPABORTONSYN, /* TCPAbortOnSyn */
212 LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */ 211 LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */
213 LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */ 212 LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */
214 LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */ 213 LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */
@@ -233,7 +232,13 @@ enum
233 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */ 232 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
234 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */ 233 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
235 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */ 234 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */
236 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */ 235 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */
236 LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */
237 LINUX_MIB_TCPOFODROP, /* TCPOFODrop */
238 LINUX_MIB_TCPOFOMERGE, /* TCPOFOMerge */
239 LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */
240 LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */
241 LINUX_MIB_TCPFASTOPENACTIVE, /* TCPFastOpenActive */
237 __LINUX_MIB_MAX 242 __LINUX_MIB_MAX
238}; 243};
239 244
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h
index db4bae78bda9..e3e395acc2fd 100644
--- a/include/linux/sock_diag.h
+++ b/include/linux/sock_diag.h
@@ -18,6 +18,7 @@ enum {
18 SK_MEMINFO_FWD_ALLOC, 18 SK_MEMINFO_FWD_ALLOC,
19 SK_MEMINFO_WMEM_QUEUED, 19 SK_MEMINFO_WMEM_QUEUED,
20 SK_MEMINFO_OPTMEM, 20 SK_MEMINFO_OPTMEM,
21 SK_MEMINFO_BACKLOG,
21 22
22 SK_MEMINFO_VARS, 23 SK_MEMINFO_VARS,
23}; 24};
@@ -43,6 +44,5 @@ void sock_diag_save_cookie(void *sk, __u32 *cookie);
43 44
44int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr); 45int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
45 46
46extern struct sock *sock_diag_nlsk;
47#endif /* KERNEL */ 47#endif /* KERNEL */
48#endif 48#endif
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 25d6322fb635..ba7b2e817cfa 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -268,6 +268,7 @@ struct ucred {
268#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */ 268#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
269#define MSG_EOF MSG_FIN 269#define MSG_EOF MSG_FIN
270 270
271#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */
271#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file 272#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file
272 descriptor received through 273 descriptor received through
273 SCM_RIGHTS */ 274 SCM_RIGHTS */
diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h
new file mode 100644
index 000000000000..b2b1afbb3202
--- /dev/null
+++ b/include/linux/spi/at86rf230.h
@@ -0,0 +1,31 @@
1/*
2 * AT86RF230/RF231 driver
3 *
4 * Copyright (C) 2009-2012 Siemens AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Written by:
20 * Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com>
21 */
22#ifndef AT86RF230_H
23#define AT86RF230_H
24
25struct at86rf230_platform_data {
26 int rstn;
27 int slp_tr;
28 int dig2;
29};
30
31#endif
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index bc14bd738ade..bb674c02f306 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -243,6 +243,7 @@ struct ssb_bus_ops {
243#define SSB_DEV_MINI_MACPHY 0x823 243#define SSB_DEV_MINI_MACPHY 0x823
244#define SSB_DEV_ARM_1176 0x824 244#define SSB_DEV_ARM_1176 0x824
245#define SSB_DEV_ARM_7TDMI 0x825 245#define SSB_DEV_ARM_7TDMI 0x825
246#define SSB_DEV_ARM_CM3 0x82A
246 247
247/* Vendor-ID values */ 248/* Vendor-ID values */
248#define SSB_VENDOR_BROADCOM 0x4243 249#define SSB_VENDOR_BROADCOM 0x4243
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index cd83059fb592..0c808d7fa579 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -408,6 +408,12 @@ static inline void unlock_system_sleep(void) {}
408 408
409#endif /* !CONFIG_PM_SLEEP */ 409#endif /* !CONFIG_PM_SLEEP */
410 410
411#ifdef CONFIG_PM_SLEEP_DEBUG
412extern bool pm_print_times_enabled;
413#else
414#define pm_print_times_enabled (false)
415#endif
416
411#ifdef CONFIG_PM_AUTOSLEEP 417#ifdef CONFIG_PM_AUTOSLEEP
412 418
413/* kernel/power/autosleep.c */ 419/* kernel/power/autosleep.c */
diff --git a/include/linux/task_work.h b/include/linux/task_work.h
index 294d5d5e90b1..fb46b03b1852 100644
--- a/include/linux/task_work.h
+++ b/include/linux/task_work.h
@@ -4,29 +4,21 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6 6
7struct task_work; 7typedef void (*task_work_func_t)(struct callback_head *);
8typedef void (*task_work_func_t)(struct task_work *);
9
10struct task_work {
11 struct hlist_node hlist;
12 task_work_func_t func;
13 void *data;
14};
15 8
16static inline void 9static inline void
17init_task_work(struct task_work *twork, task_work_func_t func, void *data) 10init_task_work(struct callback_head *twork, task_work_func_t func)
18{ 11{
19 twork->func = func; 12 twork->func = func;
20 twork->data = data;
21} 13}
22 14
23int task_work_add(struct task_struct *task, struct task_work *twork, bool); 15int task_work_add(struct task_struct *task, struct callback_head *twork, bool);
24struct task_work *task_work_cancel(struct task_struct *, task_work_func_t); 16struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t);
25void task_work_run(void); 17void task_work_run(void);
26 18
27static inline void exit_task_work(struct task_struct *task) 19static inline void exit_task_work(struct task_struct *task)
28{ 20{
29 if (unlikely(!hlist_empty(&task->task_works))) 21 if (unlikely(task->task_works))
30 task_work_run(); 22 task_work_run();
31} 23}
32 24
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 5f359dbfcdce..eb125a4c30b3 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -243,6 +243,16 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb)
243 return (tcp_hdr(skb)->doff - 5) * 4; 243 return (tcp_hdr(skb)->doff - 5) * 4;
244} 244}
245 245
246/* TCP Fast Open */
247#define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */
248#define TCP_FASTOPEN_COOKIE_MAX 16 /* Max Fast Open Cookie size in bytes */
249
250/* TCP Fast Open Cookie as stored in memory */
251struct tcp_fastopen_cookie {
252 s8 len;
253 u8 val[TCP_FASTOPEN_COOKIE_MAX];
254};
255
246/* This defines a selective acknowledgement block. */ 256/* This defines a selective acknowledgement block. */
247struct tcp_sack_block_wire { 257struct tcp_sack_block_wire {
248 __be32 start_seq; 258 __be32 start_seq;
@@ -339,6 +349,9 @@ struct tcp_sock {
339 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ 349 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
340 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ 350 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */
341 351
352 struct list_head tsq_node; /* anchor in tsq_tasklet.head list */
353 unsigned long tsq_flags;
354
342 /* Data for direct copy to user */ 355 /* Data for direct copy to user */
343 struct { 356 struct {
344 struct sk_buff_head prequeue; 357 struct sk_buff_head prequeue;
@@ -373,7 +386,9 @@ struct tcp_sock {
373 unused : 1; 386 unused : 1;
374 u8 repair_queue; 387 u8 repair_queue;
375 u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ 388 u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */
376 early_retrans_delayed:1; /* Delayed ER timer installed */ 389 early_retrans_delayed:1, /* Delayed ER timer installed */
390 syn_data:1, /* SYN includes data */
391 syn_fastopen:1; /* SYN includes Fast Open option */
377 392
378/* RTT measurement */ 393/* RTT measurement */
379 u32 srtt; /* smoothed round trip time << 3 */ 394 u32 srtt; /* smoothed round trip time << 3 */
@@ -478,6 +493,9 @@ struct tcp_sock {
478 u32 probe_seq_start; 493 u32 probe_seq_start;
479 u32 probe_seq_end; 494 u32 probe_seq_end;
480 } mtu_probe; 495 } mtu_probe;
496 u32 mtu_info; /* We received an ICMP_FRAG_NEEDED / ICMPV6_PKT_TOOBIG
497 * while socket was owned by user.
498 */
481 499
482#ifdef CONFIG_TCP_MD5SIG 500#ifdef CONFIG_TCP_MD5SIG
483/* TCP AF-Specific parts; only used by MD5 Signature support so far */ 501/* TCP AF-Specific parts; only used by MD5 Signature support so far */
@@ -487,6 +505,9 @@ struct tcp_sock {
487 struct tcp_md5sig_info __rcu *md5sig_info; 505 struct tcp_md5sig_info __rcu *md5sig_info;
488#endif 506#endif
489 507
508/* TCP fastopen related information */
509 struct tcp_fastopen_request *fastopen_req;
510
490 /* When the cookie options are generated and exchanged, then this 511 /* When the cookie options are generated and exchanged, then this
491 * object holds a reference to them (cookie_values->kref). Also 512 * object holds a reference to them (cookie_values->kref). Also
492 * contains related tcp_cookie_transactions fields. 513 * contains related tcp_cookie_transactions fields.
@@ -494,6 +515,17 @@ struct tcp_sock {
494 struct tcp_cookie_values *cookie_values; 515 struct tcp_cookie_values *cookie_values;
495}; 516};
496 517
518enum tsq_flags {
519 TSQ_THROTTLED,
520 TSQ_QUEUED,
521 TCP_TSQ_DEFERRED, /* tcp_tasklet_func() found socket was owned */
522 TCP_WRITE_TIMER_DEFERRED, /* tcp_write_timer() found socket was owned */
523 TCP_DELACK_TIMER_DEFERRED, /* tcp_delack_timer() found socket was owned */
524 TCP_MTU_REDUCED_DEFERRED, /* tcp_v{4|6}_err() could not call
525 * tcp_v{4|6}_mtu_reduced()
526 */
527};
528
497static inline struct tcp_sock *tcp_sk(const struct sock *sk) 529static inline struct tcp_sock *tcp_sk(const struct sock *sk)
498{ 530{
499 return (struct tcp_sock *)sk; 531 return (struct tcp_sock *)sk;
@@ -507,7 +539,7 @@ struct tcp_timewait_sock {
507 u32 tw_ts_recent; 539 u32 tw_ts_recent;
508 long tw_ts_recent_stamp; 540 long tw_ts_recent_stamp;
509#ifdef CONFIG_TCP_MD5SIG 541#ifdef CONFIG_TCP_MD5SIG
510 struct tcp_md5sig_key *tw_md5_key; 542 struct tcp_md5sig_key *tw_md5_key;
511#endif 543#endif
512 /* Few sockets in timewait have cookies; in that case, then this 544 /* Few sockets in timewait have cookies; in that case, then this
513 * object holds a reference to them (tw_cookie_values->kref). 545 * object holds a reference to them (tw_cookie_values->kref).
diff --git a/include/linux/tick.h b/include/linux/tick.h
index ab8be90b5cc9..f37fceb69b73 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -31,10 +31,10 @@ enum tick_nohz_mode {
31 * struct tick_sched - sched tick emulation and no idle tick control/stats 31 * struct tick_sched - sched tick emulation and no idle tick control/stats
32 * @sched_timer: hrtimer to schedule the periodic tick in high 32 * @sched_timer: hrtimer to schedule the periodic tick in high
33 * resolution mode 33 * resolution mode
34 * @idle_tick: Store the last idle tick expiry time when the tick 34 * @last_tick: Store the last tick expiry time when the tick
35 * timer is modified for idle sleeps. This is necessary 35 * timer is modified for nohz sleeps. This is necessary
36 * to resume the tick timer operation in the timeline 36 * to resume the tick timer operation in the timeline
37 * when the CPU returns from idle 37 * when the CPU returns from nohz sleep.
38 * @tick_stopped: Indicator that the idle tick has been stopped 38 * @tick_stopped: Indicator that the idle tick has been stopped
39 * @idle_jiffies: jiffies at the entry to idle for idle time accounting 39 * @idle_jiffies: jiffies at the entry to idle for idle time accounting
40 * @idle_calls: Total number of idle calls 40 * @idle_calls: Total number of idle calls
@@ -51,7 +51,7 @@ struct tick_sched {
51 struct hrtimer sched_timer; 51 struct hrtimer sched_timer;
52 unsigned long check_clocks; 52 unsigned long check_clocks;
53 enum tick_nohz_mode nohz_mode; 53 enum tick_nohz_mode nohz_mode;
54 ktime_t idle_tick; 54 ktime_t last_tick;
55 int inidle; 55 int inidle;
56 int tick_stopped; 56 int tick_stopped;
57 unsigned long idle_jiffies; 57 unsigned long idle_jiffies;
diff --git a/include/linux/time-armada-370-xp.h b/include/linux/time-armada-370-xp.h
new file mode 100644
index 000000000000..dfdfdc03115b
--- /dev/null
+++ b/include/linux/time-armada-370-xp.h
@@ -0,0 +1,18 @@
1/*
2 * Marvell Armada 370/XP SoC timer handling.
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
9 *
10 */
11#ifndef __TIME_ARMADA_370_XPPRCMU_H
12#define __TIME_ARMADA_370_XPPRCMU_H
13
14#include <linux/init.h>
15
16void __init armada_370_xp_timer_init(void);
17
18#endif
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 9730b0e51e46..c98928420100 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -102,8 +102,8 @@
102#define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */ 102#define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */
103#define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */ 103#define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */
104#define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */ 104#define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */
105#define TIPC_CMD_SET_LOG_SIZE 0x410A /* tx unsigned, rx none */ 105#define TIPC_CMD_SET_LOG_SIZE 0x410A /* obsoleted */
106#define TIPC_CMD_DUMP_LOG 0x410B /* tx none, rx ultra_string */ 106#define TIPC_CMD_DUMP_LOG 0x410B /* obsoleted */
107#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */ 107#define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */
108 108
109/* 109/*
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 6a4d82bedb03..1e98b5530425 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -192,7 +192,7 @@ static inline void tracehook_notify_resume(struct pt_regs *regs)
192 * hlist_add_head(task->task_works); 192 * hlist_add_head(task->task_works);
193 */ 193 */
194 smp_mb__after_clear_bit(); 194 smp_mb__after_clear_bit();
195 if (unlikely(!hlist_empty(&current->task_works))) 195 if (unlikely(current->task_works))
196 task_work_run(); 196 task_work_run();
197} 197}
198 198
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index bd96ecd0e05c..802de56c41e8 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -153,7 +153,7 @@ static inline void tracepoint_synchronize_unregister(void)
153 } \ 153 } \
154 static inline void trace_##name##_rcuidle(proto) \ 154 static inline void trace_##name##_rcuidle(proto) \
155 { \ 155 { \
156 if (static_branch(&__tracepoint_##name.key)) \ 156 if (static_key_false(&__tracepoint_##name.key)) \
157 __DO_TRACE(&__tracepoint_##name, \ 157 __DO_TRACE(&__tracepoint_##name, \
158 TP_PROTO(data_proto), \ 158 TP_PROTO(data_proto), \
159 TP_ARGS(data_args), \ 159 TP_ARGS(data_args), \
diff --git a/include/linux/types.h b/include/linux/types.h
index 9c1bd539ea70..bf0dd7524b2a 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -246,14 +246,15 @@ struct ustat {
246}; 246};
247 247
248/** 248/**
249 * struct rcu_head - callback structure for use with RCU 249 * struct callback_head - callback structure for use with RCU and task_work
250 * @next: next update requests in a list 250 * @next: next update requests in a list
251 * @func: actual update function to call after the grace period. 251 * @func: actual update function to call after the grace period.
252 */ 252 */
253struct rcu_head { 253struct callback_head {
254 struct rcu_head *next; 254 struct callback_head *next;
255 void (*func)(struct rcu_head *head); 255 void (*func)(struct callback_head *head);
256}; 256};
257#define rcu_head callback_head
257 258
258#endif /* __KERNEL__ */ 259#endif /* __KERNEL__ */
259#endif /* __ASSEMBLY__ */ 260#endif /* __ASSEMBLY__ */
diff --git a/include/linux/uhid.h b/include/linux/uhid.h
new file mode 100644
index 000000000000..9c6974f16966
--- /dev/null
+++ b/include/linux/uhid.h
@@ -0,0 +1,104 @@
1#ifndef __UHID_H_
2#define __UHID_H_
3
4/*
5 * User-space I/O driver support for HID subsystem
6 * Copyright (c) 2012 David Herrmann
7 */
8
9/*
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version.
14 */
15
16/*
17 * Public header for user-space communication. We try to keep every structure
18 * aligned but to be safe we also use __attribute__((__packed__)). Therefore,
19 * the communication should be ABI compatible even between architectures.
20 */
21
22#include <linux/input.h>
23#include <linux/types.h>
24
25enum uhid_event_type {
26 UHID_CREATE,
27 UHID_DESTROY,
28 UHID_START,
29 UHID_STOP,
30 UHID_OPEN,
31 UHID_CLOSE,
32 UHID_OUTPUT,
33 UHID_OUTPUT_EV,
34 UHID_INPUT,
35 UHID_FEATURE,
36 UHID_FEATURE_ANSWER,
37};
38
39struct uhid_create_req {
40 __u8 name[128];
41 __u8 phys[64];
42 __u8 uniq[64];
43 __u8 __user *rd_data;
44 __u16 rd_size;
45
46 __u16 bus;
47 __u32 vendor;
48 __u32 product;
49 __u32 version;
50 __u32 country;
51} __attribute__((__packed__));
52
53#define UHID_DATA_MAX 4096
54
55enum uhid_report_type {
56 UHID_FEATURE_REPORT,
57 UHID_OUTPUT_REPORT,
58 UHID_INPUT_REPORT,
59};
60
61struct uhid_input_req {
62 __u8 data[UHID_DATA_MAX];
63 __u16 size;
64} __attribute__((__packed__));
65
66struct uhid_output_req {
67 __u8 data[UHID_DATA_MAX];
68 __u16 size;
69 __u8 rtype;
70} __attribute__((__packed__));
71
72struct uhid_output_ev_req {
73 __u16 type;
74 __u16 code;
75 __s32 value;
76} __attribute__((__packed__));
77
78struct uhid_feature_req {
79 __u32 id;
80 __u8 rnum;
81 __u8 rtype;
82} __attribute__((__packed__));
83
84struct uhid_feature_answer_req {
85 __u32 id;
86 __u16 err;
87 __u16 size;
88 __u8 data[UHID_DATA_MAX];
89};
90
91struct uhid_event {
92 __u32 type;
93
94 union {
95 struct uhid_create_req create;
96 struct uhid_input_req input;
97 struct uhid_output_req output;
98 struct uhid_output_ev_req output_ev;
99 struct uhid_feature_req feature;
100 struct uhid_feature_answer_req feature_answer;
101 } u;
102} __attribute__((__packed__));
103
104#endif /* __UHID_H_ */
diff --git a/include/linux/usb/tilegx.h b/include/linux/usb/tilegx.h
new file mode 100644
index 000000000000..2d65e3435680
--- /dev/null
+++ b/include/linux/usb/tilegx.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright 2012 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 *
14 * Structure to contain platform-specific data related to Tile-Gx USB
15 * controllers.
16 */
17
18#ifndef _LINUX_USB_TILEGX_H
19#define _LINUX_USB_TILEGX_H
20
21#include <gxio/usb_host.h>
22
23struct tilegx_usb_platform_data {
24 /* GXIO device index. */
25 int dev_index;
26
27 /* GXIO device context. */
28 gxio_usb_host_context_t usb_ctx;
29
30 /* Device IRQ. */
31 unsigned int irq;
32};
33
34#endif /* _LINUX_USB_TILEGX_H */
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 76f439647c4b..f87cf622317f 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -66,9 +66,8 @@ struct usbnet {
66# define EVENT_STS_SPLIT 3 66# define EVENT_STS_SPLIT 3
67# define EVENT_LINK_RESET 4 67# define EVENT_LINK_RESET 4
68# define EVENT_RX_PAUSED 5 68# define EVENT_RX_PAUSED 5
69# define EVENT_DEV_WAKING 6 69# define EVENT_DEV_ASLEEP 6
70# define EVENT_DEV_ASLEEP 7 70# define EVENT_DEV_OPEN 7
71# define EVENT_DEV_OPEN 8
72}; 71};
73 72
74static inline struct usb_driver *driver_of(struct usb_interface *intf) 73static inline struct usb_driver *driver_of(struct usb_interface *intf)
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 17df3600bcef..e84e769aaddc 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -64,7 +64,9 @@
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \ 64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
65 /* cannot handle READ_CAPACITY_16 */ \ 65 /* cannot handle READ_CAPACITY_16 */ \
66 US_FLAG(INITIAL_READ10, 0x00100000) \ 66 US_FLAG(INITIAL_READ10, 0x00100000) \
67 /* Initial READ(10) (and others) must be retried */ 67 /* Initial READ(10) (and others) must be retried */ \
68 US_FLAG(WRITE_CACHE, 0x00200000) \
69 /* Write Cache status is not available */
68 70
69#define US_FLAG(name, value) US_FL_##name = value , 71#define US_FLAG(name, value) US_FL_##name = value ,
70enum { US_DO_ALL_FLAGS }; 72enum { US_DO_ALL_FLAGS };
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 8efd28ae5597..a1ba8bbd9fbe 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -92,6 +92,7 @@ struct virtio_driver {
92 const unsigned int *feature_table; 92 const unsigned int *feature_table;
93 unsigned int feature_table_size; 93 unsigned int feature_table_size;
94 int (*probe)(struct virtio_device *dev); 94 int (*probe)(struct virtio_device *dev);
95 void (*scan)(struct virtio_device *dev);
95 void (*remove)(struct virtio_device *dev); 96 void (*remove)(struct virtio_device *dev);
96 void (*config_changed)(struct virtio_device *dev); 97 void (*config_changed)(struct virtio_device *dev);
97#ifdef CONFIG_PM 98#ifdef CONFIG_PM
diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h
index 8ddeafdc0546..dc8d305b0e05 100644
--- a/include/linux/virtio_scsi.h
+++ b/include/linux/virtio_scsi.h
@@ -69,6 +69,10 @@ struct virtio_scsi_config {
69 u32 max_lun; 69 u32 max_lun;
70} __packed; 70} __packed;
71 71
72/* Feature Bits */
73#define VIRTIO_SCSI_F_INOUT 0
74#define VIRTIO_SCSI_F_HOTPLUG 1
75
72/* Response codes */ 76/* Response codes */
73#define VIRTIO_SCSI_S_OK 0 77#define VIRTIO_SCSI_S_OK 0
74#define VIRTIO_SCSI_S_OVERRUN 1 78#define VIRTIO_SCSI_S_OVERRUN 1
@@ -105,6 +109,11 @@ struct virtio_scsi_config {
105#define VIRTIO_SCSI_T_TRANSPORT_RESET 1 109#define VIRTIO_SCSI_T_TRANSPORT_RESET 1
106#define VIRTIO_SCSI_T_ASYNC_NOTIFY 2 110#define VIRTIO_SCSI_T_ASYNC_NOTIFY 2
107 111
112/* Reasons of transport reset event */
113#define VIRTIO_SCSI_EVT_RESET_HARD 0
114#define VIRTIO_SCSI_EVT_RESET_RESCAN 1
115#define VIRTIO_SCSI_EVT_RESET_REMOVED 2
116
108#define VIRTIO_SCSI_S_SIMPLE 0 117#define VIRTIO_SCSI_S_SIMPLE 0
109#define VIRTIO_SCSI_S_ORDERED 1 118#define VIRTIO_SCSI_S_ORDERED 1
110#define VIRTIO_SCSI_S_HEAD 2 119#define VIRTIO_SCSI_S_HEAD 2