aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-25 17:23:57 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-25 17:23:57 -0500
commit2a859ab07b6ab66f4134c4fffc341398bd3d328c (patch)
treec5e7eaf3bffbc18feb326940e39794328d98dc07 /include/linux
parentcedddd812a79a4fda3885a15711aee3de78c4a24 (diff)
parente716e014384688d1a50d1aa5213ee74748c6d4e0 (diff)
Merge branch 'merge' into next
Merge my own merge branch to get various fixes from there and upstream, especially the hvc console tty refcouting fixes which which testing is quite a bit harder...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild26
-rw-r--r--include/linux/byteorder/Kbuild0
-rw-r--r--include/linux/caif/Kbuild0
-rw-r--r--include/linux/can/Kbuild0
-rw-r--r--include/linux/coredump.h1
-rw-r--r--include/linux/dvb/Kbuild8
-rw-r--r--include/linux/dvb/audio.h135
-rw-r--r--include/linux/dvb/ca.h90
-rw-r--r--include/linux/dvb/dmx.h130
-rw-r--r--include/linux/dvb/frontend.h516
-rw-r--r--include/linux/dvb/net.h52
-rw-r--r--include/linux/dvb/osd.h144
-rw-r--r--include/linux/dvb/version.h29
-rw-r--r--include/linux/dvb/video.h249
-rw-r--r--include/linux/dynamic_debug.h2
-rw-r--r--include/linux/extcon.h2
-rw-r--r--include/linux/hsi/Kbuild1
-rw-r--r--include/linux/hsi/hsi_char.h63
-rw-r--r--include/linux/iio/iio.h16
-rw-r--r--include/linux/isdn/Kbuild0
-rw-r--r--include/linux/kvm_host.h15
-rw-r--r--include/linux/memblock.h1
-rw-r--r--include/linux/mfd/max77693.h13
-rw-r--r--include/linux/mmc/Kbuild0
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/ipset/Kbuild0
-rw-r--r--include/linux/netfilter_arp/Kbuild0
-rw-r--r--include/linux/netfilter_bridge/Kbuild0
-rw-r--r--include/linux/netfilter_ipv4/Kbuild0
-rw-r--r--include/linux/netfilter_ipv6/Kbuild0
-rw-r--r--include/linux/nfsd/Kbuild0
-rw-r--r--include/linux/of.h7
-rw-r--r--include/linux/of_address.h4
-rw-r--r--include/linux/of_irq.h4
-rw-r--r--include/linux/percpu-rwsem.h28
-rw-r--r--include/linux/perf_event.h10
-rw-r--r--include/linux/pid_namespace.h8
-rw-r--r--include/linux/raid/Kbuild2
-rw-r--r--include/linux/raid/md_p.h301
-rw-r--r--include/linux/raid/md_u.h141
-rw-r--r--include/linux/ratelimit.h27
-rw-r--r--include/linux/rbtree_augmented.h1
-rw-r--r--include/linux/spi/Kbuild0
-rw-r--r--include/linux/spi/tsc2005.h2
-rw-r--r--include/linux/sunrpc/Kbuild0
-rw-r--r--include/linux/tc_act/Kbuild0
-rw-r--r--include/linux/tc_ematch/Kbuild0
-rw-r--r--include/linux/tcp.h3
-rw-r--r--include/linux/uprobes.h11
-rw-r--r--include/linux/usb.h11
-rw-r--r--include/linux/usb/Kbuild10
-rw-r--r--include/linux/usb/audio.h524
-rw-r--r--include/linux/usb/cdc.h412
-rw-r--r--include/linux/usb/ch11.h266
-rw-r--r--include/linux/usb/ch9.h960
-rw-r--r--include/linux/usb/functionfs.h167
-rw-r--r--include/linux/usb/g_printer.h35
-rw-r--r--include/linux/usb/gadgetfs.h88
-rw-r--r--include/linux/usb/midi.h112
-rw-r--r--include/linux/usb/tmc.h43
-rw-r--r--include/linux/usb/video.h568
-rw-r--r--include/linux/wimax/Kbuild0
62 files changed, 83 insertions, 5156 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 5b57367e28db..7fe2dae251e5 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -1,31 +1,5 @@
1header-y += byteorder/
2header-y += can/
3header-y += caif/
4header-y += dvb/ 1header-y += dvb/
5header-y += hdlc/ 2header-y += hdlc/
6header-y += hsi/ 3header-y += hsi/
7header-y += isdn/
8header-y += mmc/
9header-y += nfsd/
10header-y += raid/ 4header-y += raid/
11header-y += spi/
12header-y += sunrpc/
13header-y += tc_act/
14header-y += tc_ematch/
15header-y += netfilter/
16header-y += netfilter_arp/
17header-y += netfilter_bridge/
18header-y += netfilter_ipv4/
19header-y += netfilter_ipv6/
20header-y += usb/ 5header-y += usb/
21header-y += wimax/
22
23ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
24 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),)
25endif
26ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
27 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),)
28endif
29ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
30 $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),)
31endif
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/byteorder/Kbuild
+++ /dev/null
diff --git a/include/linux/caif/Kbuild b/include/linux/caif/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/caif/Kbuild
+++ /dev/null
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/can/Kbuild
+++ /dev/null
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
index 1775eb8acc03..1d7399314a89 100644
--- a/include/linux/coredump.h
+++ b/include/linux/coredump.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <linux/fs.h> 6#include <linux/fs.h>
7#include <asm/siginfo.h>
7 8
8/* 9/*
9 * These are the only things you should do on a core-file: use only these 10 * These are the only things you should do on a core-file: use only these
diff --git a/include/linux/dvb/Kbuild b/include/linux/dvb/Kbuild
index f4dba8637f98..e69de29bb2d1 100644
--- a/include/linux/dvb/Kbuild
+++ b/include/linux/dvb/Kbuild
@@ -1,8 +0,0 @@
1header-y += audio.h
2header-y += ca.h
3header-y += dmx.h
4header-y += frontend.h
5header-y += net.h
6header-y += osd.h
7header-y += version.h
8header-y += video.h
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h
deleted file mode 100644
index d47bccd604e4..000000000000
--- a/include/linux/dvb/audio.h
+++ /dev/null
@@ -1,135 +0,0 @@
1/*
2 * audio.h
3 *
4 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
5 * & Marcus Metzler <marcus@convergence.de>
6 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Lesser Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23
24#ifndef _DVBAUDIO_H_
25#define _DVBAUDIO_H_
26
27#include <linux/types.h>
28
29typedef enum {
30 AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
31 AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
32} audio_stream_source_t;
33
34
35typedef enum {
36 AUDIO_STOPPED, /* Device is stopped */
37 AUDIO_PLAYING, /* Device is currently playing */
38 AUDIO_PAUSED /* Device is paused */
39} audio_play_state_t;
40
41
42typedef enum {
43 AUDIO_STEREO,
44 AUDIO_MONO_LEFT,
45 AUDIO_MONO_RIGHT,
46 AUDIO_MONO,
47 AUDIO_STEREO_SWAPPED
48} audio_channel_select_t;
49
50
51typedef struct audio_mixer {
52 unsigned int volume_left;
53 unsigned int volume_right;
54 // what else do we need? bass, pass-through, ...
55} audio_mixer_t;
56
57
58typedef struct audio_status {
59 int AV_sync_state; /* sync audio and video? */
60 int mute_state; /* audio is muted */
61 audio_play_state_t play_state; /* current playback state */
62 audio_stream_source_t stream_source; /* current stream source */
63 audio_channel_select_t channel_select; /* currently selected channel */
64 int bypass_mode; /* pass on audio data to */
65 audio_mixer_t mixer_state; /* current mixer state */
66} audio_status_t; /* separate decoder hardware */
67
68
69typedef
70struct audio_karaoke { /* if Vocal1 or Vocal2 are non-zero, they get mixed */
71 int vocal1; /* into left and right t at 70% each */
72 int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
73 int melody; /* mixed into the left channel and */
74 /* Vocal2 into the right channel at 100% each. */
75 /* if Melody is non-zero, the melody channel gets mixed*/
76} audio_karaoke_t; /* into left and right */
77
78
79typedef __u16 audio_attributes_t;
80/* bits: descr. */
81/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
82/* 12 multichannel extension */
83/* 11-10 audio type (0=not spec, 1=language included) */
84/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
85/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */
86/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
87/* 2- 0 number of audio channels (n+1 channels) */
88
89
90/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */
91#define AUDIO_CAP_DTS 1
92#define AUDIO_CAP_LPCM 2
93#define AUDIO_CAP_MP1 4
94#define AUDIO_CAP_MP2 8
95#define AUDIO_CAP_MP3 16
96#define AUDIO_CAP_AAC 32
97#define AUDIO_CAP_OGG 64
98#define AUDIO_CAP_SDDS 128
99#define AUDIO_CAP_AC3 256
100
101#define AUDIO_STOP _IO('o', 1)
102#define AUDIO_PLAY _IO('o', 2)
103#define AUDIO_PAUSE _IO('o', 3)
104#define AUDIO_CONTINUE _IO('o', 4)
105#define AUDIO_SELECT_SOURCE _IO('o', 5)
106#define AUDIO_SET_MUTE _IO('o', 6)
107#define AUDIO_SET_AV_SYNC _IO('o', 7)
108#define AUDIO_SET_BYPASS_MODE _IO('o', 8)
109#define AUDIO_CHANNEL_SELECT _IO('o', 9)
110#define AUDIO_GET_STATUS _IOR('o', 10, audio_status_t)
111
112#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int)
113#define AUDIO_CLEAR_BUFFER _IO('o', 12)
114#define AUDIO_SET_ID _IO('o', 13)
115#define AUDIO_SET_MIXER _IOW('o', 14, audio_mixer_t)
116#define AUDIO_SET_STREAMTYPE _IO('o', 15)
117#define AUDIO_SET_EXT_ID _IO('o', 16)
118#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t)
119#define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t)
120
121/**
122 * AUDIO_GET_PTS
123 *
124 * Read the 33 bit presentation time stamp as defined
125 * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
126 *
127 * The PTS should belong to the currently played
128 * frame if possible, but may also be a value close to it
129 * like the PTS of the last decoded frame or the last PTS
130 * extracted by the PES parser.
131 */
132#define AUDIO_GET_PTS _IOR('o', 19, __u64)
133#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20)
134
135#endif /* _DVBAUDIO_H_ */
diff --git a/include/linux/dvb/ca.h b/include/linux/dvb/ca.h
deleted file mode 100644
index c18537f3e449..000000000000
--- a/include/linux/dvb/ca.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * ca.h
3 *
4 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
5 * & Marcus Metzler <marcus@convergence.de>
6 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Lesser Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23
24#ifndef _DVBCA_H_
25#define _DVBCA_H_
26
27/* slot interface types and info */
28
29typedef struct ca_slot_info {
30 int num; /* slot number */
31
32 int type; /* CA interface this slot supports */
33#define CA_CI 1 /* CI high level interface */
34#define CA_CI_LINK 2 /* CI link layer level interface */
35#define CA_CI_PHYS 4 /* CI physical layer level interface */
36#define CA_DESCR 8 /* built-in descrambler */
37#define CA_SC 128 /* simple smart card interface */
38
39 unsigned int flags;
40#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
41#define CA_CI_MODULE_READY 2
42} ca_slot_info_t;
43
44
45/* descrambler types and info */
46
47typedef struct ca_descr_info {
48 unsigned int num; /* number of available descramblers (keys) */
49 unsigned int type; /* type of supported scrambling system */
50#define CA_ECD 1
51#define CA_NDS 2
52#define CA_DSS 4
53} ca_descr_info_t;
54
55typedef struct ca_caps {
56 unsigned int slot_num; /* total number of CA card and module slots */
57 unsigned int slot_type; /* OR of all supported types */
58 unsigned int descr_num; /* total number of descrambler slots (keys) */
59 unsigned int descr_type; /* OR of all supported types */
60} ca_caps_t;
61
62/* a message to/from a CI-CAM */
63typedef struct ca_msg {
64 unsigned int index;
65 unsigned int type;
66 unsigned int length;
67 unsigned char msg[256];
68} ca_msg_t;
69
70typedef struct ca_descr {
71 unsigned int index;
72 unsigned int parity; /* 0 == even, 1 == odd */
73 unsigned char cw[8];
74} ca_descr_t;
75
76typedef struct ca_pid {
77 unsigned int pid;
78 int index; /* -1 == disable*/
79} ca_pid_t;
80
81#define CA_RESET _IO('o', 128)
82#define CA_GET_CAP _IOR('o', 129, ca_caps_t)
83#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t)
84#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
85#define CA_GET_MSG _IOR('o', 132, ca_msg_t)
86#define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
87#define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
88#define CA_SET_PID _IOW('o', 135, ca_pid_t)
89
90#endif
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
index f078f3ac82d4..0be6d8f2b52b 100644
--- a/include/linux/dvb/dmx.h
+++ b/include/linux/dvb/dmx.h
@@ -20,138 +20,10 @@
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * 21 *
22 */ 22 */
23
24#ifndef _DVBDMX_H_ 23#ifndef _DVBDMX_H_
25#define _DVBDMX_H_ 24#define _DVBDMX_H_
26 25
27#include <linux/types.h>
28#ifdef __KERNEL__
29#include <linux/time.h> 26#include <linux/time.h>
30#else 27#include <uapi/linux/dvb/dmx.h>
31#include <time.h>
32#endif
33
34
35#define DMX_FILTER_SIZE 16
36
37typedef enum
38{
39 DMX_OUT_DECODER, /* Streaming directly to decoder. */
40 DMX_OUT_TAP, /* Output going to a memory buffer */
41 /* (to be retrieved via the read command).*/
42 DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */
43 /* (to be retrieved by reading from the */
44 /* logical DVR device). */
45 DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
46} dmx_output_t;
47
48
49typedef enum
50{
51 DMX_IN_FRONTEND, /* Input from a front-end device. */
52 DMX_IN_DVR /* Input from the logical DVR device. */
53} dmx_input_t;
54
55
56typedef enum
57{
58 DMX_PES_AUDIO0,
59 DMX_PES_VIDEO0,
60 DMX_PES_TELETEXT0,
61 DMX_PES_SUBTITLE0,
62 DMX_PES_PCR0,
63
64 DMX_PES_AUDIO1,
65 DMX_PES_VIDEO1,
66 DMX_PES_TELETEXT1,
67 DMX_PES_SUBTITLE1,
68 DMX_PES_PCR1,
69
70 DMX_PES_AUDIO2,
71 DMX_PES_VIDEO2,
72 DMX_PES_TELETEXT2,
73 DMX_PES_SUBTITLE2,
74 DMX_PES_PCR2,
75
76 DMX_PES_AUDIO3,
77 DMX_PES_VIDEO3,
78 DMX_PES_TELETEXT3,
79 DMX_PES_SUBTITLE3,
80 DMX_PES_PCR3,
81
82 DMX_PES_OTHER
83} dmx_pes_type_t;
84
85#define DMX_PES_AUDIO DMX_PES_AUDIO0
86#define DMX_PES_VIDEO DMX_PES_VIDEO0
87#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
88#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
89#define DMX_PES_PCR DMX_PES_PCR0
90
91
92typedef struct dmx_filter
93{
94 __u8 filter[DMX_FILTER_SIZE];
95 __u8 mask[DMX_FILTER_SIZE];
96 __u8 mode[DMX_FILTER_SIZE];
97} dmx_filter_t;
98
99
100struct dmx_sct_filter_params
101{
102 __u16 pid;
103 dmx_filter_t filter;
104 __u32 timeout;
105 __u32 flags;
106#define DMX_CHECK_CRC 1
107#define DMX_ONESHOT 2
108#define DMX_IMMEDIATE_START 4
109#define DMX_KERNEL_CLIENT 0x8000
110};
111
112
113struct dmx_pes_filter_params
114{
115 __u16 pid;
116 dmx_input_t input;
117 dmx_output_t output;
118 dmx_pes_type_t pes_type;
119 __u32 flags;
120};
121
122typedef struct dmx_caps {
123 __u32 caps;
124 int num_decoders;
125} dmx_caps_t;
126
127typedef enum {
128 DMX_SOURCE_FRONT0 = 0,
129 DMX_SOURCE_FRONT1,
130 DMX_SOURCE_FRONT2,
131 DMX_SOURCE_FRONT3,
132 DMX_SOURCE_DVR0 = 16,
133 DMX_SOURCE_DVR1,
134 DMX_SOURCE_DVR2,
135 DMX_SOURCE_DVR3
136} dmx_source_t;
137
138struct dmx_stc {
139 unsigned int num; /* input : which STC? 0..N */
140 unsigned int base; /* output: divisor for stc to get 90 kHz clock */
141 __u64 stc; /* output: stc in 'base'*90 kHz units */
142};
143
144
145#define DMX_START _IO('o', 41)
146#define DMX_STOP _IO('o', 42)
147#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
148#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
149#define DMX_SET_BUFFER_SIZE _IO('o', 45)
150#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
151#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
152#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
153#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
154#define DMX_ADD_PID _IOW('o', 51, __u16)
155#define DMX_REMOVE_PID _IOW('o', 52, __u16)
156 28
157#endif /*_DVBDMX_H_*/ 29#endif /*_DVBDMX_H_*/
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
deleted file mode 100644
index c12d452cb40d..000000000000
--- a/include/linux/dvb/frontend.h
+++ /dev/null
@@ -1,516 +0,0 @@
1/*
2 * frontend.h
3 *
4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
5 * Ralph Metzler <ralph@convergence.de>
6 * Holger Waechtler <holger@convergence.de>
7 * Andre Draszik <ad@convergence.de>
8 * for convergence integrated media GmbH
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; either version 2.1
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 *
24 */
25
26#ifndef _DVBFRONTEND_H_
27#define _DVBFRONTEND_H_
28
29#include <linux/types.h>
30
31typedef enum fe_type {
32 FE_QPSK,
33 FE_QAM,
34 FE_OFDM,
35 FE_ATSC
36} fe_type_t;
37
38
39typedef enum fe_caps {
40 FE_IS_STUPID = 0,
41 FE_CAN_INVERSION_AUTO = 0x1,
42 FE_CAN_FEC_1_2 = 0x2,
43 FE_CAN_FEC_2_3 = 0x4,
44 FE_CAN_FEC_3_4 = 0x8,
45 FE_CAN_FEC_4_5 = 0x10,
46 FE_CAN_FEC_5_6 = 0x20,
47 FE_CAN_FEC_6_7 = 0x40,
48 FE_CAN_FEC_7_8 = 0x80,
49 FE_CAN_FEC_8_9 = 0x100,
50 FE_CAN_FEC_AUTO = 0x200,
51 FE_CAN_QPSK = 0x400,
52 FE_CAN_QAM_16 = 0x800,
53 FE_CAN_QAM_32 = 0x1000,
54 FE_CAN_QAM_64 = 0x2000,
55 FE_CAN_QAM_128 = 0x4000,
56 FE_CAN_QAM_256 = 0x8000,
57 FE_CAN_QAM_AUTO = 0x10000,
58 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
59 FE_CAN_BANDWIDTH_AUTO = 0x40000,
60 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
61 FE_CAN_HIERARCHY_AUTO = 0x100000,
62 FE_CAN_8VSB = 0x200000,
63 FE_CAN_16VSB = 0x400000,
64 FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */
65 FE_CAN_MULTISTREAM = 0x4000000, /* frontend supports multistream filtering */
66 FE_CAN_TURBO_FEC = 0x8000000, /* frontend supports "turbo fec modulation" */
67 FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
68 FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
69 FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */
70 FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */
71} fe_caps_t;
72
73
74struct dvb_frontend_info {
75 char name[128];
76 fe_type_t type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
77 __u32 frequency_min;
78 __u32 frequency_max;
79 __u32 frequency_stepsize;
80 __u32 frequency_tolerance;
81 __u32 symbol_rate_min;
82 __u32 symbol_rate_max;
83 __u32 symbol_rate_tolerance; /* ppm */
84 __u32 notifier_delay; /* DEPRECATED */
85 fe_caps_t caps;
86};
87
88
89/**
90 * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
91 * the meaning of this struct...
92 */
93struct dvb_diseqc_master_cmd {
94 __u8 msg [6]; /* { framing, address, command, data [3] } */
95 __u8 msg_len; /* valid values are 3...6 */
96};
97
98
99struct dvb_diseqc_slave_reply {
100 __u8 msg [4]; /* { framing, data [3] } */
101 __u8 msg_len; /* valid values are 0...4, 0 means no msg */
102 int timeout; /* return from ioctl after timeout ms with */
103}; /* errorcode when no message was received */
104
105
106typedef enum fe_sec_voltage {
107 SEC_VOLTAGE_13,
108 SEC_VOLTAGE_18,
109 SEC_VOLTAGE_OFF
110} fe_sec_voltage_t;
111
112
113typedef enum fe_sec_tone_mode {
114 SEC_TONE_ON,
115 SEC_TONE_OFF
116} fe_sec_tone_mode_t;
117
118
119typedef enum fe_sec_mini_cmd {
120 SEC_MINI_A,
121 SEC_MINI_B
122} fe_sec_mini_cmd_t;
123
124
125/**
126 * enum fe_status - enumerates the possible frontend status
127 * @FE_HAS_SIGNAL: found something above the noise level
128 * @FE_HAS_CARRIER: found a DVB signal
129 * @FE_HAS_VITERBI: FEC is stable
130 * @FE_HAS_SYNC: found sync bytes
131 * @FE_HAS_LOCK: everything's working
132 * @FE_TIMEDOUT: no lock within the last ~2 seconds
133 * @FE_REINIT: frontend was reinitialized, application is recommended
134 * to reset DiSEqC, tone and parameters
135 */
136
137typedef enum fe_status {
138 FE_HAS_SIGNAL = 0x01,
139 FE_HAS_CARRIER = 0x02,
140 FE_HAS_VITERBI = 0x04,
141 FE_HAS_SYNC = 0x08,
142 FE_HAS_LOCK = 0x10,
143 FE_TIMEDOUT = 0x20,
144 FE_REINIT = 0x40,
145} fe_status_t;
146
147typedef enum fe_spectral_inversion {
148 INVERSION_OFF,
149 INVERSION_ON,
150 INVERSION_AUTO
151} fe_spectral_inversion_t;
152
153
154typedef enum fe_code_rate {
155 FEC_NONE = 0,
156 FEC_1_2,
157 FEC_2_3,
158 FEC_3_4,
159 FEC_4_5,
160 FEC_5_6,
161 FEC_6_7,
162 FEC_7_8,
163 FEC_8_9,
164 FEC_AUTO,
165 FEC_3_5,
166 FEC_9_10,
167 FEC_2_5,
168} fe_code_rate_t;
169
170
171typedef enum fe_modulation {
172 QPSK,
173 QAM_16,
174 QAM_32,
175 QAM_64,
176 QAM_128,
177 QAM_256,
178 QAM_AUTO,
179 VSB_8,
180 VSB_16,
181 PSK_8,
182 APSK_16,
183 APSK_32,
184 DQPSK,
185 QAM_4_NR,
186} fe_modulation_t;
187
188typedef enum fe_transmit_mode {
189 TRANSMISSION_MODE_2K,
190 TRANSMISSION_MODE_8K,
191 TRANSMISSION_MODE_AUTO,
192 TRANSMISSION_MODE_4K,
193 TRANSMISSION_MODE_1K,
194 TRANSMISSION_MODE_16K,
195 TRANSMISSION_MODE_32K,
196 TRANSMISSION_MODE_C1,
197 TRANSMISSION_MODE_C3780,
198} fe_transmit_mode_t;
199
200#if defined(__DVB_CORE__) || !defined (__KERNEL__)
201typedef enum fe_bandwidth {
202 BANDWIDTH_8_MHZ,
203 BANDWIDTH_7_MHZ,
204 BANDWIDTH_6_MHZ,
205 BANDWIDTH_AUTO,
206 BANDWIDTH_5_MHZ,
207 BANDWIDTH_10_MHZ,
208 BANDWIDTH_1_712_MHZ,
209} fe_bandwidth_t;
210#endif
211
212typedef enum fe_guard_interval {
213 GUARD_INTERVAL_1_32,
214 GUARD_INTERVAL_1_16,
215 GUARD_INTERVAL_1_8,
216 GUARD_INTERVAL_1_4,
217 GUARD_INTERVAL_AUTO,
218 GUARD_INTERVAL_1_128,
219 GUARD_INTERVAL_19_128,
220 GUARD_INTERVAL_19_256,
221 GUARD_INTERVAL_PN420,
222 GUARD_INTERVAL_PN595,
223 GUARD_INTERVAL_PN945,
224} fe_guard_interval_t;
225
226
227typedef enum fe_hierarchy {
228 HIERARCHY_NONE,
229 HIERARCHY_1,
230 HIERARCHY_2,
231 HIERARCHY_4,
232 HIERARCHY_AUTO
233} fe_hierarchy_t;
234
235enum fe_interleaving {
236 INTERLEAVING_NONE,
237 INTERLEAVING_AUTO,
238 INTERLEAVING_240,
239 INTERLEAVING_720,
240};
241
242#if defined(__DVB_CORE__) || !defined (__KERNEL__)
243struct dvb_qpsk_parameters {
244 __u32 symbol_rate; /* symbol rate in Symbols per second */
245 fe_code_rate_t fec_inner; /* forward error correction (see above) */
246};
247
248struct dvb_qam_parameters {
249 __u32 symbol_rate; /* symbol rate in Symbols per second */
250 fe_code_rate_t fec_inner; /* forward error correction (see above) */
251 fe_modulation_t modulation; /* modulation type (see above) */
252};
253
254struct dvb_vsb_parameters {
255 fe_modulation_t modulation; /* modulation type (see above) */
256};
257
258struct dvb_ofdm_parameters {
259 fe_bandwidth_t bandwidth;
260 fe_code_rate_t code_rate_HP; /* high priority stream code rate */
261 fe_code_rate_t code_rate_LP; /* low priority stream code rate */
262 fe_modulation_t constellation; /* modulation type (see above) */
263 fe_transmit_mode_t transmission_mode;
264 fe_guard_interval_t guard_interval;
265 fe_hierarchy_t hierarchy_information;
266};
267
268
269struct dvb_frontend_parameters {
270 __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
271 /* intermediate frequency in kHz for QPSK */
272 fe_spectral_inversion_t inversion;
273 union {
274 struct dvb_qpsk_parameters qpsk;
275 struct dvb_qam_parameters qam;
276 struct dvb_ofdm_parameters ofdm;
277 struct dvb_vsb_parameters vsb;
278 } u;
279};
280
281struct dvb_frontend_event {
282 fe_status_t status;
283 struct dvb_frontend_parameters parameters;
284};
285#endif
286
287/* S2API Commands */
288#define DTV_UNDEFINED 0
289#define DTV_TUNE 1
290#define DTV_CLEAR 2
291#define DTV_FREQUENCY 3
292#define DTV_MODULATION 4
293#define DTV_BANDWIDTH_HZ 5
294#define DTV_INVERSION 6
295#define DTV_DISEQC_MASTER 7
296#define DTV_SYMBOL_RATE 8
297#define DTV_INNER_FEC 9
298#define DTV_VOLTAGE 10
299#define DTV_TONE 11
300#define DTV_PILOT 12
301#define DTV_ROLLOFF 13
302#define DTV_DISEQC_SLAVE_REPLY 14
303
304/* Basic enumeration set for querying unlimited capabilities */
305#define DTV_FE_CAPABILITY_COUNT 15
306#define DTV_FE_CAPABILITY 16
307#define DTV_DELIVERY_SYSTEM 17
308
309/* ISDB-T and ISDB-Tsb */
310#define DTV_ISDBT_PARTIAL_RECEPTION 18
311#define DTV_ISDBT_SOUND_BROADCASTING 19
312
313#define DTV_ISDBT_SB_SUBCHANNEL_ID 20
314#define DTV_ISDBT_SB_SEGMENT_IDX 21
315#define DTV_ISDBT_SB_SEGMENT_COUNT 22
316
317#define DTV_ISDBT_LAYERA_FEC 23
318#define DTV_ISDBT_LAYERA_MODULATION 24
319#define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25
320#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26
321
322#define DTV_ISDBT_LAYERB_FEC 27
323#define DTV_ISDBT_LAYERB_MODULATION 28
324#define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29
325#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30
326
327#define DTV_ISDBT_LAYERC_FEC 31
328#define DTV_ISDBT_LAYERC_MODULATION 32
329#define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33
330#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34
331
332#define DTV_API_VERSION 35
333
334#define DTV_CODE_RATE_HP 36
335#define DTV_CODE_RATE_LP 37
336#define DTV_GUARD_INTERVAL 38
337#define DTV_TRANSMISSION_MODE 39
338#define DTV_HIERARCHY 40
339
340#define DTV_ISDBT_LAYER_ENABLED 41
341
342#define DTV_STREAM_ID 42
343#define DTV_ISDBS_TS_ID_LEGACY DTV_STREAM_ID
344#define DTV_DVBT2_PLP_ID_LEGACY 43
345
346#define DTV_ENUM_DELSYS 44
347
348/* ATSC-MH */
349#define DTV_ATSCMH_FIC_VER 45
350#define DTV_ATSCMH_PARADE_ID 46
351#define DTV_ATSCMH_NOG 47
352#define DTV_ATSCMH_TNOG 48
353#define DTV_ATSCMH_SGN 49
354#define DTV_ATSCMH_PRC 50
355#define DTV_ATSCMH_RS_FRAME_MODE 51
356#define DTV_ATSCMH_RS_FRAME_ENSEMBLE 52
357#define DTV_ATSCMH_RS_CODE_MODE_PRI 53
358#define DTV_ATSCMH_RS_CODE_MODE_SEC 54
359#define DTV_ATSCMH_SCCC_BLOCK_MODE 55
360#define DTV_ATSCMH_SCCC_CODE_MODE_A 56
361#define DTV_ATSCMH_SCCC_CODE_MODE_B 57
362#define DTV_ATSCMH_SCCC_CODE_MODE_C 58
363#define DTV_ATSCMH_SCCC_CODE_MODE_D 59
364
365#define DTV_INTERLEAVING 60
366#define DTV_LNA 61
367
368#define DTV_MAX_COMMAND DTV_LNA
369
370typedef enum fe_pilot {
371 PILOT_ON,
372 PILOT_OFF,
373 PILOT_AUTO,
374} fe_pilot_t;
375
376typedef enum fe_rolloff {
377 ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
378 ROLLOFF_20,
379 ROLLOFF_25,
380 ROLLOFF_AUTO,
381} fe_rolloff_t;
382
383typedef enum fe_delivery_system {
384 SYS_UNDEFINED,
385 SYS_DVBC_ANNEX_A,
386 SYS_DVBC_ANNEX_B,
387 SYS_DVBT,
388 SYS_DSS,
389 SYS_DVBS,
390 SYS_DVBS2,
391 SYS_DVBH,
392 SYS_ISDBT,
393 SYS_ISDBS,
394 SYS_ISDBC,
395 SYS_ATSC,
396 SYS_ATSCMH,
397 SYS_DTMB,
398 SYS_CMMB,
399 SYS_DAB,
400 SYS_DVBT2,
401 SYS_TURBO,
402 SYS_DVBC_ANNEX_C,
403} fe_delivery_system_t;
404
405/* backward compatibility */
406#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A
407#define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */
408
409/* ATSC-MH */
410
411enum atscmh_sccc_block_mode {
412 ATSCMH_SCCC_BLK_SEP = 0,
413 ATSCMH_SCCC_BLK_COMB = 1,
414 ATSCMH_SCCC_BLK_RES = 2,
415};
416
417enum atscmh_sccc_code_mode {
418 ATSCMH_SCCC_CODE_HLF = 0,
419 ATSCMH_SCCC_CODE_QTR = 1,
420 ATSCMH_SCCC_CODE_RES = 2,
421};
422
423enum atscmh_rs_frame_ensemble {
424 ATSCMH_RSFRAME_ENS_PRI = 0,
425 ATSCMH_RSFRAME_ENS_SEC = 1,
426};
427
428enum atscmh_rs_frame_mode {
429 ATSCMH_RSFRAME_PRI_ONLY = 0,
430 ATSCMH_RSFRAME_PRI_SEC = 1,
431 ATSCMH_RSFRAME_RES = 2,
432};
433
434enum atscmh_rs_code_mode {
435 ATSCMH_RSCODE_211_187 = 0,
436 ATSCMH_RSCODE_223_187 = 1,
437 ATSCMH_RSCODE_235_187 = 2,
438 ATSCMH_RSCODE_RES = 3,
439};
440
441#define NO_STREAM_ID_FILTER (~0U)
442#define LNA_AUTO (~0U)
443
444struct dtv_cmds_h {
445 char *name; /* A display name for debugging purposes */
446
447 __u32 cmd; /* A unique ID */
448
449 /* Flags */
450 __u32 set:1; /* Either a set or get property */
451 __u32 buffer:1; /* Does this property use the buffer? */
452 __u32 reserved:30; /* Align */
453};
454
455struct dtv_property {
456 __u32 cmd;
457 __u32 reserved[3];
458 union {
459 __u32 data;
460 struct {
461 __u8 data[32];
462 __u32 len;
463 __u32 reserved1[3];
464 void *reserved2;
465 } buffer;
466 } u;
467 int result;
468} __attribute__ ((packed));
469
470/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
471#define DTV_IOCTL_MAX_MSGS 64
472
473struct dtv_properties {
474 __u32 num;
475 struct dtv_property *props;
476};
477
478#define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties)
479#define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties)
480
481
482/**
483 * When set, this flag will disable any zigzagging or other "normal" tuning
484 * behaviour. Additionally, there will be no automatic monitoring of the lock
485 * status, and hence no frontend events will be generated. If a frontend device
486 * is closed, this flag will be automatically turned off when the device is
487 * reopened read-write.
488 */
489#define FE_TUNE_MODE_ONESHOT 0x01
490
491
492#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
493
494#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
495#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
496#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
497#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
498
499#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
500#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
501#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
502
503#define FE_READ_STATUS _IOR('o', 69, fe_status_t)
504#define FE_READ_BER _IOR('o', 70, __u32)
505#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)
506#define FE_READ_SNR _IOR('o', 72, __u16)
507#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
508
509#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
510#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
511#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */
512#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
513
514#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
515
516#endif /*_DVBFRONTEND_H_*/
diff --git a/include/linux/dvb/net.h b/include/linux/dvb/net.h
deleted file mode 100644
index f451e7eb0b0b..000000000000
--- a/include/linux/dvb/net.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * net.h
3 *
4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
5 * & Ralph Metzler <ralph@convergence.de>
6 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23
24#ifndef _DVBNET_H_
25#define _DVBNET_H_
26
27#include <linux/types.h>
28
29struct dvb_net_if {
30 __u16 pid;
31 __u16 if_num;
32 __u8 feedtype;
33#define DVB_NET_FEEDTYPE_MPE 0 /* multi protocol encapsulation */
34#define DVB_NET_FEEDTYPE_ULE 1 /* ultra lightweight encapsulation */
35};
36
37
38#define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if)
39#define NET_REMOVE_IF _IO('o', 53)
40#define NET_GET_IF _IOWR('o', 54, struct dvb_net_if)
41
42
43/* binary compatibility cruft: */
44struct __dvb_net_if_old {
45 __u16 pid;
46 __u16 if_num;
47};
48#define __NET_ADD_IF_OLD _IOWR('o', 52, struct __dvb_net_if_old)
49#define __NET_GET_IF_OLD _IOWR('o', 54, struct __dvb_net_if_old)
50
51
52#endif /*_DVBNET_H_*/
diff --git a/include/linux/dvb/osd.h b/include/linux/dvb/osd.h
deleted file mode 100644
index 880e68435832..000000000000
--- a/include/linux/dvb/osd.h
+++ /dev/null
@@ -1,144 +0,0 @@
1/*
2 * osd.h
3 *
4 * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>
5 * & Marcus Metzler <marcus@convergence.de>
6 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Lesser Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23
24#ifndef _DVBOSD_H_
25#define _DVBOSD_H_
26
27#include <linux/compiler.h>
28
29typedef enum {
30 // All functions return -2 on "not open"
31 OSD_Close=1, // ()
32 // Disables OSD and releases the buffers
33 // returns 0 on success
34 OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
35 // Opens OSD with this size and bit depth
36 // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
37 OSD_Show, // ()
38 // enables OSD mode
39 // returns 0 on success
40 OSD_Hide, // ()
41 // disables OSD mode
42 // returns 0 on success
43 OSD_Clear, // ()
44 // Sets all pixel to color 0
45 // returns 0 on success
46 OSD_Fill, // (color)
47 // Sets all pixel to color <col>
48 // returns 0 on success
49 OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1})
50 // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
51 // R,G,B: 0..255
52 // R=Red, G=Green, B=Blue
53 // opacity=0: pixel opacity 0% (only video pixel shows)
54 // opacity=1..254: pixel opacity as specified in header
55 // opacity=255: pixel opacity 100% (only OSD pixel shows)
56 // returns 0 on success, -1 on error
57 OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
58 // Set a number of entries in the palette
59 // sets the entries "firstcolor" through "lastcolor" from the array "data"
60 // data has 4 byte for each color:
61 // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
62 OSD_SetTrans, // (transparency{color})
63 // Sets transparency of mixed pixel (0..15)
64 // returns 0 on success
65 OSD_SetPixel, // (x0,y0,color)
66 // sets pixel <x>,<y> to color number <col>
67 // returns 0 on success, -1 on error
68 OSD_GetPixel, // (x0,y0)
69 // returns color number of pixel <x>,<y>, or -1
70 OSD_SetRow, // (x0,y0,x1,data)
71 // fills pixels x0,y through x1,y with the content of data[]
72 // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
73 OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data)
74 // fills pixels x0,y0 through x1,y1 with the content of data[]
75 // inc contains the width of one line in the data block,
76 // inc<=0 uses blockwidth as linewidth
77 // returns 0 on success, -1 on clipping all pixel
78 OSD_FillRow, // (x0,y0,x1,color)
79 // fills pixels x0,y through x1,y with the color <col>
80 // returns 0 on success, -1 on clipping all pixel
81 OSD_FillBlock, // (x0,y0,x1,y1,color)
82 // fills pixels x0,y0 through x1,y1 with the color <col>
83 // returns 0 on success, -1 on clipping all pixel
84 OSD_Line, // (x0,y0,x1,y1,color)
85 // draw a line from x0,y0 to x1,y1 with the color <col>
86 // returns 0 on success
87 OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11
88 // fills parameters with the picture dimensions and the pixel aspect ratio
89 // returns 0 on success
90 OSD_Test, // ()
91 // draws a test picture. for debugging purposes only
92 // returns 0 on success
93// TODO: remove "test" in final version
94 OSD_Text, // (x0,y0,size,color,text)
95 OSD_SetWindow, // (x0) set window with number 0<x0<8 as current
96 OSD_MoveWindow, // move current window to (x0, y0)
97 OSD_OpenRaw, // Open other types of OSD windows
98} OSD_Command;
99
100typedef struct osd_cmd_s {
101 OSD_Command cmd;
102 int x0;
103 int y0;
104 int x1;
105 int y1;
106 int color;
107 void __user *data;
108} osd_cmd_t;
109
110/* OSD_OpenRaw: set 'color' to desired window type */
111typedef enum {
112 OSD_BITMAP1, /* 1 bit bitmap */
113 OSD_BITMAP2, /* 2 bit bitmap */
114 OSD_BITMAP4, /* 4 bit bitmap */
115 OSD_BITMAP8, /* 8 bit bitmap */
116 OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */
117 OSD_BITMAP2HR, /* 2 bit bitmap half resolution */
118 OSD_BITMAP4HR, /* 4 bit bitmap half resolution */
119 OSD_BITMAP8HR, /* 8 bit bitmap half resolution */
120 OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */
121 OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */
122 OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */
123 OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */
124 OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */
125 OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */
126 OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */
127 OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */
128 OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/
129 OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */
130 OSD_VIDEONSIZE, /* Full Size MPEG Video Display */
131 OSD_CURSOR /* Cursor */
132} osd_raw_window_t;
133
134typedef struct osd_cap_s {
135 int cmd;
136#define OSD_CAP_MEMSIZE 1 /* memory size */
137 long val;
138} osd_cap_t;
139
140
141#define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
142#define OSD_GET_CAPABILITY _IOR('o', 161, osd_cap_t)
143
144#endif
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
deleted file mode 100644
index 827cce7e33e3..000000000000
--- a/include/linux/dvb/version.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * version.h
3 *
4 * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>
5 * for convergence integrated media GmbH
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2.1
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 */
22
23#ifndef _DVBVERSION_H_
24#define _DVBVERSION_H_
25
26#define DVB_API_VERSION 5
27#define DVB_API_VERSION_MINOR 9
28
29#endif /*_DVBVERSION_H_*/
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h
index 1d750c0fd86e..85c20d925696 100644
--- a/include/linux/dvb/video.h
+++ b/include/linux/dvb/video.h
@@ -20,257 +20,10 @@
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * 21 *
22 */ 22 */
23
24#ifndef _DVBVIDEO_H_ 23#ifndef _DVBVIDEO_H_
25#define _DVBVIDEO_H_ 24#define _DVBVIDEO_H_
26 25
27#include <linux/types.h>
28#ifdef __KERNEL__
29#include <linux/compiler.h> 26#include <linux/compiler.h>
30#else 27#include <uapi/linux/dvb/video.h>
31#include <stdint.h>
32#include <time.h>
33#endif
34
35typedef enum {
36 VIDEO_FORMAT_4_3, /* Select 4:3 format */
37 VIDEO_FORMAT_16_9, /* Select 16:9 format. */
38 VIDEO_FORMAT_221_1 /* 2.21:1 */
39} video_format_t;
40
41
42typedef enum {
43 VIDEO_SYSTEM_PAL,
44 VIDEO_SYSTEM_NTSC,
45 VIDEO_SYSTEM_PALN,
46 VIDEO_SYSTEM_PALNc,
47 VIDEO_SYSTEM_PALM,
48 VIDEO_SYSTEM_NTSC60,
49 VIDEO_SYSTEM_PAL60,
50 VIDEO_SYSTEM_PALM60
51} video_system_t;
52
53
54typedef enum {
55 VIDEO_PAN_SCAN, /* use pan and scan format */
56 VIDEO_LETTER_BOX, /* use letterbox format */
57 VIDEO_CENTER_CUT_OUT /* use center cut out format */
58} video_displayformat_t;
59
60typedef struct {
61 int w;
62 int h;
63 video_format_t aspect_ratio;
64} video_size_t;
65
66typedef enum {
67 VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
68 VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
69 comes from the user through the write
70 system call */
71} video_stream_source_t;
72
73
74typedef enum {
75 VIDEO_STOPPED, /* Video is stopped */
76 VIDEO_PLAYING, /* Video is currently playing */
77 VIDEO_FREEZED /* Video is freezed */
78} video_play_state_t;
79
80
81/* Decoder commands */
82#define VIDEO_CMD_PLAY (0)
83#define VIDEO_CMD_STOP (1)
84#define VIDEO_CMD_FREEZE (2)
85#define VIDEO_CMD_CONTINUE (3)
86
87/* Flags for VIDEO_CMD_FREEZE */
88#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0)
89
90/* Flags for VIDEO_CMD_STOP */
91#define VIDEO_CMD_STOP_TO_BLACK (1 << 0)
92#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1)
93
94/* Play input formats: */
95/* The decoder has no special format requirements */
96#define VIDEO_PLAY_FMT_NONE (0)
97/* The decoder requires full GOPs */
98#define VIDEO_PLAY_FMT_GOP (1)
99
100/* The structure must be zeroed before use by the application
101 This ensures it can be extended safely in the future. */
102struct video_command {
103 __u32 cmd;
104 __u32 flags;
105 union {
106 struct {
107 __u64 pts;
108 } stop;
109
110 struct {
111 /* 0 or 1000 specifies normal speed,
112 1 specifies forward single stepping,
113 -1 specifies backward single stepping,
114 >1: playback at speed/1000 of the normal speed,
115 <-1: reverse playback at (-speed/1000) of the normal speed. */
116 __s32 speed;
117 __u32 format;
118 } play;
119
120 struct {
121 __u32 data[16];
122 } raw;
123 };
124};
125
126/* FIELD_UNKNOWN can be used if the hardware does not know whether
127 the Vsync is for an odd, even or progressive (i.e. non-interlaced)
128 field. */
129#define VIDEO_VSYNC_FIELD_UNKNOWN (0)
130#define VIDEO_VSYNC_FIELD_ODD (1)
131#define VIDEO_VSYNC_FIELD_EVEN (2)
132#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3)
133
134struct video_event {
135 __s32 type;
136#define VIDEO_EVENT_SIZE_CHANGED 1
137#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
138#define VIDEO_EVENT_DECODER_STOPPED 3
139#define VIDEO_EVENT_VSYNC 4
140 __kernel_time_t timestamp;
141 union {
142 video_size_t size;
143 unsigned int frame_rate; /* in frames per 1000sec */
144 unsigned char vsync_field; /* unknown/odd/even/progressive */
145 } u;
146};
147
148
149struct video_status {
150 int video_blank; /* blank video on freeze? */
151 video_play_state_t play_state; /* current state of playback */
152 video_stream_source_t stream_source; /* current source (demux/memory) */
153 video_format_t video_format; /* current aspect ratio of stream*/
154 video_displayformat_t display_format;/* selected cropping mode */
155};
156
157
158struct video_still_picture {
159 char __user *iFrame; /* pointer to a single iframe in memory */
160 __s32 size;
161};
162
163
164typedef
165struct video_highlight {
166 int active; /* 1=show highlight, 0=hide highlight */
167 __u8 contrast1; /* 7- 4 Pattern pixel contrast */
168 /* 3- 0 Background pixel contrast */
169 __u8 contrast2; /* 7- 4 Emphasis pixel-2 contrast */
170 /* 3- 0 Emphasis pixel-1 contrast */
171 __u8 color1; /* 7- 4 Pattern pixel color */
172 /* 3- 0 Background pixel color */
173 __u8 color2; /* 7- 4 Emphasis pixel-2 color */
174 /* 3- 0 Emphasis pixel-1 color */
175 __u32 ypos; /* 23-22 auto action mode */
176 /* 21-12 start y */
177 /* 9- 0 end y */
178 __u32 xpos; /* 23-22 button color number */
179 /* 21-12 start x */
180 /* 9- 0 end x */
181} video_highlight_t;
182
183
184typedef struct video_spu {
185 int active;
186 int stream_id;
187} video_spu_t;
188
189
190typedef struct video_spu_palette { /* SPU Palette information */
191 int length;
192 __u8 __user *palette;
193} video_spu_palette_t;
194
195
196typedef struct video_navi_pack {
197 int length; /* 0 ... 1024 */
198 __u8 data[1024];
199} video_navi_pack_t;
200
201
202typedef __u16 video_attributes_t;
203/* bits: descr. */
204/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
205/* 13-12 TV system (0=525/60, 1=625/50) */
206/* 11-10 Aspect ratio (0=4:3, 3=16:9) */
207/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
208/* 7 line 21-1 data present in GOP (1=yes, 0=no) */
209/* 6 line 21-2 data present in GOP (1=yes, 0=no) */
210/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
211/* 2 source letterboxed (1=yes, 0=no) */
212/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */
213
214
215/* bit definitions for capabilities: */
216/* can the hardware decode MPEG1 and/or MPEG2? */
217#define VIDEO_CAP_MPEG1 1
218#define VIDEO_CAP_MPEG2 2
219/* can you send a system and/or program stream to video device?
220 (you still have to open the video and the audio device but only
221 send the stream to the video device) */
222#define VIDEO_CAP_SYS 4
223#define VIDEO_CAP_PROG 8
224/* can the driver also handle SPU, NAVI and CSS encoded data?
225 (CSS API is not present yet) */
226#define VIDEO_CAP_SPU 16
227#define VIDEO_CAP_NAVI 32
228#define VIDEO_CAP_CSS 64
229
230
231#define VIDEO_STOP _IO('o', 21)
232#define VIDEO_PLAY _IO('o', 22)
233#define VIDEO_FREEZE _IO('o', 23)
234#define VIDEO_CONTINUE _IO('o', 24)
235#define VIDEO_SELECT_SOURCE _IO('o', 25)
236#define VIDEO_SET_BLANK _IO('o', 26)
237#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status)
238#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event)
239#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29)
240#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture)
241#define VIDEO_FAST_FORWARD _IO('o', 31)
242#define VIDEO_SLOWMOTION _IO('o', 32)
243#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int)
244#define VIDEO_CLEAR_BUFFER _IO('o', 34)
245#define VIDEO_SET_ID _IO('o', 35)
246#define VIDEO_SET_STREAMTYPE _IO('o', 36)
247#define VIDEO_SET_FORMAT _IO('o', 37)
248#define VIDEO_SET_SYSTEM _IO('o', 38)
249#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t)
250#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t)
251#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t)
252#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t)
253#define VIDEO_SET_ATTRIBUTES _IO('o', 53)
254#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t)
255#define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int)
256
257/**
258 * VIDEO_GET_PTS
259 *
260 * Read the 33 bit presentation time stamp as defined
261 * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
262 *
263 * The PTS should belong to the currently played
264 * frame if possible, but may also be a value close to it
265 * like the PTS of the last decoded frame or the last PTS
266 * extracted by the PES parser.
267 */
268#define VIDEO_GET_PTS _IOR('o', 57, __u64)
269
270/* Read the number of displayed frames since the decoder was started */
271#define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64)
272
273#define VIDEO_COMMAND _IOWR('o', 59, struct video_command)
274#define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command)
275 28
276#endif /*_DVBVIDEO_H_*/ 29#endif /*_DVBVIDEO_H_*/
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index c18257b0fa72..6dd4787a798a 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -61,7 +61,7 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
61 const char *fmt, ...); 61 const char *fmt, ...);
62 62
63#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ 63#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
64 static struct _ddebug __used __aligned(8) \ 64 static struct _ddebug __aligned(8) \
65 __attribute__((section("__verbose"))) name = { \ 65 __attribute__((section("__verbose"))) name = { \
66 .modname = KBUILD_MODNAME, \ 66 .modname = KBUILD_MODNAME, \
67 .function = __func__, \ 67 .function = __func__, \
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index 7443a560c9d0..2c26c14cd710 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -68,7 +68,7 @@ enum extcon_cable_name {
68 EXTCON_VIDEO_OUT, 68 EXTCON_VIDEO_OUT,
69 EXTCON_MECHANICAL, 69 EXTCON_MECHANICAL,
70}; 70};
71extern const char *extcon_cable_name[]; 71extern const char extcon_cable_name[][CABLE_NAME_MAX + 1];
72 72
73struct extcon_cable; 73struct extcon_cable;
74 74
diff --git a/include/linux/hsi/Kbuild b/include/linux/hsi/Kbuild
index 271a770b4784..e69de29bb2d1 100644
--- a/include/linux/hsi/Kbuild
+++ b/include/linux/hsi/Kbuild
@@ -1 +0,0 @@
1header-y += hsi_char.h
diff --git a/include/linux/hsi/hsi_char.h b/include/linux/hsi/hsi_char.h
deleted file mode 100644
index 76160b4f455d..000000000000
--- a/include/linux/hsi/hsi_char.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * Part of the HSI character device driver.
3 *
4 * Copyright (C) 2010 Nokia Corporation. All rights reserved.
5 *
6 * Contact: Andras Domokos <andras.domokos at nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23
24#ifndef __HSI_CHAR_H
25#define __HSI_CHAR_H
26
27#define HSI_CHAR_MAGIC 'k'
28#define HSC_IOW(num, dtype) _IOW(HSI_CHAR_MAGIC, num, dtype)
29#define HSC_IOR(num, dtype) _IOR(HSI_CHAR_MAGIC, num, dtype)
30#define HSC_IOWR(num, dtype) _IOWR(HSI_CHAR_MAGIC, num, dtype)
31#define HSC_IO(num) _IO(HSI_CHAR_MAGIC, num)
32
33#define HSC_RESET HSC_IO(16)
34#define HSC_SET_PM HSC_IO(17)
35#define HSC_SEND_BREAK HSC_IO(18)
36#define HSC_SET_RX HSC_IOW(19, struct hsc_rx_config)
37#define HSC_GET_RX HSC_IOW(20, struct hsc_rx_config)
38#define HSC_SET_TX HSC_IOW(21, struct hsc_tx_config)
39#define HSC_GET_TX HSC_IOW(22, struct hsc_tx_config)
40
41#define HSC_PM_DISABLE 0
42#define HSC_PM_ENABLE 1
43
44#define HSC_MODE_STREAM 1
45#define HSC_MODE_FRAME 2
46#define HSC_FLOW_SYNC 0
47#define HSC_ARB_RR 0
48#define HSC_ARB_PRIO 1
49
50struct hsc_rx_config {
51 uint32_t mode;
52 uint32_t flow;
53 uint32_t channels;
54};
55
56struct hsc_tx_config {
57 uint32_t mode;
58 uint32_t channels;
59 uint32_t speed;
60 uint32_t arb_mode;
61};
62
63#endif /* __HSI_CHAR_H */
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index c0ae76ac4e0b..7806c24e5bc8 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -618,4 +618,20 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev)
618}; 618};
619#endif 619#endif
620 620
621/**
622 * IIO_DEGREE_TO_RAD() - Convert degree to rad
623 * @deg: A value in degree
624 *
625 * Returns the given value converted from degree to rad
626 */
627#define IIO_DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL)
628
629/**
630 * IIO_G_TO_M_S_2() - Convert g to meter / second**2
631 * @g: A value in g
632 *
633 * Returns the given value converted from g to meter / second**2
634 */
635#define IIO_G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL)
636
621#endif /* _INDUSTRIAL_IO_H_ */ 637#endif /* _INDUSTRIAL_IO_H_ */
diff --git a/include/linux/isdn/Kbuild b/include/linux/isdn/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/isdn/Kbuild
+++ /dev/null
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 93bfc9f9815c..ecc554374e44 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -42,19 +42,8 @@
42 */ 42 */
43#define KVM_MEMSLOT_INVALID (1UL << 16) 43#define KVM_MEMSLOT_INVALID (1UL << 16)
44 44
45/* 45/* Two fragments for cross MMIO pages. */
46 * If we support unaligned MMIO, at most one fragment will be split into two: 46#define KVM_MAX_MMIO_FRAGMENTS 2
47 */
48#ifdef KVM_UNALIGNED_MMIO
49# define KVM_EXTRA_MMIO_FRAGMENTS 1
50#else
51# define KVM_EXTRA_MMIO_FRAGMENTS 0
52#endif
53
54#define KVM_USER_MMIO_SIZE 8
55
56#define KVM_MAX_MMIO_FRAGMENTS \
57 (KVM_MMIO_SIZE / KVM_USER_MMIO_SIZE + KVM_EXTRA_MMIO_FRAGMENTS)
58 47
59/* 48/*
60 * For the normal pfn, the highest 12 bits should be zero, 49 * For the normal pfn, the highest 12 bits should be zero,
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 569d67d4243e..d452ee191066 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -57,6 +57,7 @@ int memblock_add(phys_addr_t base, phys_addr_t size);
57int memblock_remove(phys_addr_t base, phys_addr_t size); 57int memblock_remove(phys_addr_t base, phys_addr_t size);
58int memblock_free(phys_addr_t base, phys_addr_t size); 58int memblock_free(phys_addr_t base, phys_addr_t size);
59int memblock_reserve(phys_addr_t base, phys_addr_t size); 59int memblock_reserve(phys_addr_t base, phys_addr_t size);
60void memblock_trim_memory(phys_addr_t align);
60 61
61#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 62#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
62void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, 63void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h
index 1d28ae90384e..fe03b2d35d4f 100644
--- a/include/linux/mfd/max77693.h
+++ b/include/linux/mfd/max77693.h
@@ -30,7 +30,20 @@
30#ifndef __LINUX_MFD_MAX77693_H 30#ifndef __LINUX_MFD_MAX77693_H
31#define __LINUX_MFD_MAX77693_H 31#define __LINUX_MFD_MAX77693_H
32 32
33struct max77693_reg_data {
34 u8 addr;
35 u8 data;
36};
37
38struct max77693_muic_platform_data {
39 struct max77693_reg_data *init_data;
40 int num_init_data;
41};
42
33struct max77693_platform_data { 43struct max77693_platform_data {
34 int wakeup; 44 int wakeup;
45
46 /* muic data */
47 struct max77693_muic_platform_data *muic_data;
35}; 48};
36#endif /* __LINUX_MFD_MAX77693_H */ 49#endif /* __LINUX_MFD_MAX77693_H */
diff --git a/include/linux/mmc/Kbuild b/include/linux/mmc/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/mmc/Kbuild
+++ /dev/null
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
deleted file mode 100644
index b3322023e9a5..000000000000
--- a/include/linux/netfilter/Kbuild
+++ /dev/null
@@ -1 +0,0 @@
1header-y += ipset/
diff --git a/include/linux/netfilter/ipset/Kbuild b/include/linux/netfilter/ipset/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/netfilter/ipset/Kbuild
+++ /dev/null
diff --git a/include/linux/netfilter_arp/Kbuild b/include/linux/netfilter_arp/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/netfilter_arp/Kbuild
+++ /dev/null
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/netfilter_bridge/Kbuild
+++ /dev/null
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/netfilter_ipv4/Kbuild
+++ /dev/null
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/netfilter_ipv6/Kbuild
+++ /dev/null
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/nfsd/Kbuild
+++ /dev/null
diff --git a/include/linux/of.h b/include/linux/of.h
index a093b2fe5dfb..681a6c88010f 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -344,6 +344,13 @@ static inline bool of_have_populated_dt(void)
344#define for_each_child_of_node(parent, child) \ 344#define for_each_child_of_node(parent, child) \
345 while (0) 345 while (0)
346 346
347static inline struct device_node *of_get_child_by_name(
348 const struct device_node *node,
349 const char *name)
350{
351 return NULL;
352}
353
347static inline int of_get_child_count(const struct device_node *np) 354static inline int of_get_child_count(const struct device_node *np)
348{ 355{
349 return 0; 356 return 0;
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index c3cdc1025c30..a1984dd037da 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -19,7 +19,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
19 * the address space flags too. The PCI version uses a BAR number 19 * the address space flags too. The PCI version uses a BAR number
20 * instead of an absolute index 20 * instead of an absolute index
21 */ 21 */
22extern const u32 *of_get_address(struct device_node *dev, int index, 22extern const __be32 *of_get_address(struct device_node *dev, int index,
23 u64 *size, unsigned int *flags); 23 u64 *size, unsigned int *flags);
24 24
25#ifndef pci_address_to_pio 25#ifndef pci_address_to_pio
@@ -44,7 +44,7 @@ static inline void __iomem *of_iomap(struct device_node *device, int index)
44{ 44{
45 return NULL; 45 return NULL;
46} 46}
47static inline const u32 *of_get_address(struct device_node *dev, int index, 47static inline const __be32 *of_get_address(struct device_node *dev, int index,
48 u64 *size, unsigned int *flags) 48 u64 *size, unsigned int *flags)
49{ 49{
50 return NULL; 50 return NULL;
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index b8e241125201..535cecf1e02f 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -58,8 +58,8 @@ static inline int of_irq_map_oldworld(struct device_node *device, int index,
58#endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ 58#endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */
59 59
60 60
61extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec, 61extern int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
62 u32 ointsize, const u32 *addr, 62 u32 ointsize, const __be32 *addr,
63 struct of_irq *out_irq); 63 struct of_irq *out_irq);
64extern int of_irq_map_one(struct device_node *device, int index, 64extern int of_irq_map_one(struct device_node *device, int index,
65 struct of_irq *out_irq); 65 struct of_irq *out_irq);
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h
index cf80f7e5277f..250a4acddb2b 100644
--- a/include/linux/percpu-rwsem.h
+++ b/include/linux/percpu-rwsem.h
@@ -12,34 +12,27 @@ struct percpu_rw_semaphore {
12 struct mutex mtx; 12 struct mutex mtx;
13}; 13};
14 14
15#define light_mb() barrier()
16#define heavy_mb() synchronize_sched()
17
15static inline void percpu_down_read(struct percpu_rw_semaphore *p) 18static inline void percpu_down_read(struct percpu_rw_semaphore *p)
16{ 19{
17 rcu_read_lock(); 20 rcu_read_lock_sched();
18 if (unlikely(p->locked)) { 21 if (unlikely(p->locked)) {
19 rcu_read_unlock(); 22 rcu_read_unlock_sched();
20 mutex_lock(&p->mtx); 23 mutex_lock(&p->mtx);
21 this_cpu_inc(*p->counters); 24 this_cpu_inc(*p->counters);
22 mutex_unlock(&p->mtx); 25 mutex_unlock(&p->mtx);
23 return; 26 return;
24 } 27 }
25 this_cpu_inc(*p->counters); 28 this_cpu_inc(*p->counters);
26 rcu_read_unlock(); 29 rcu_read_unlock_sched();
30 light_mb(); /* A, between read of p->locked and read of data, paired with D */
27} 31}
28 32
29static inline void percpu_up_read(struct percpu_rw_semaphore *p) 33static inline void percpu_up_read(struct percpu_rw_semaphore *p)
30{ 34{
31 /* 35 light_mb(); /* B, between read of the data and write to p->counter, paired with C */
32 * On X86, write operation in this_cpu_dec serves as a memory unlock
33 * barrier (i.e. memory accesses may be moved before the write, but
34 * no memory accesses are moved past the write).
35 * On other architectures this may not be the case, so we need smp_mb()
36 * there.
37 */
38#if defined(CONFIG_X86) && (!defined(CONFIG_X86_PPRO_FENCE) && !defined(CONFIG_X86_OOSTORE))
39 barrier();
40#else
41 smp_mb();
42#endif
43 this_cpu_dec(*p->counters); 36 this_cpu_dec(*p->counters);
44} 37}
45 38
@@ -58,14 +51,15 @@ static inline void percpu_down_write(struct percpu_rw_semaphore *p)
58{ 51{
59 mutex_lock(&p->mtx); 52 mutex_lock(&p->mtx);
60 p->locked = true; 53 p->locked = true;
61 synchronize_rcu(); 54 synchronize_sched(); /* make sure that all readers exit the rcu_read_lock_sched region */
62 while (__percpu_count(p->counters)) 55 while (__percpu_count(p->counters))
63 msleep(1); 56 msleep(1);
64 smp_rmb(); /* paired with smp_mb() in percpu_sem_up_read() */ 57 heavy_mb(); /* C, between read of p->counter and write to data, paired with B */
65} 58}
66 59
67static inline void percpu_up_write(struct percpu_rw_semaphore *p) 60static inline void percpu_up_write(struct percpu_rw_semaphore *p)
68{ 61{
62 heavy_mb(); /* D, between write to data and write to p->locked, paired with A */
69 p->locked = false; 63 p->locked = false;
70 mutex_unlock(&p->mtx); 64 mutex_unlock(&p->mtx);
71} 65}
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 2e902359aee5..6bfb2faa0b19 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -803,12 +803,16 @@ static inline void perf_event_task_tick(void) { }
803do { \ 803do { \
804 static struct notifier_block fn##_nb __cpuinitdata = \ 804 static struct notifier_block fn##_nb __cpuinitdata = \
805 { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ 805 { .notifier_call = fn, .priority = CPU_PRI_PERF }; \
806 unsigned long cpu = smp_processor_id(); \
807 unsigned long flags; \
806 fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ 808 fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \
807 (void *)(unsigned long)smp_processor_id()); \ 809 (void *)(unsigned long)cpu); \
810 local_irq_save(flags); \
808 fn(&fn##_nb, (unsigned long)CPU_STARTING, \ 811 fn(&fn##_nb, (unsigned long)CPU_STARTING, \
809 (void *)(unsigned long)smp_processor_id()); \ 812 (void *)(unsigned long)cpu); \
813 local_irq_restore(flags); \
810 fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ 814 fn(&fn##_nb, (unsigned long)CPU_ONLINE, \
811 (void *)(unsigned long)smp_processor_id()); \ 815 (void *)(unsigned long)cpu); \
812 register_cpu_notifier(&fn##_nb); \ 816 register_cpu_notifier(&fn##_nb); \
813} while (0) 817} while (0)
814 818
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 00474b047145..65e3e87eacc5 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -47,15 +47,9 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
47} 47}
48 48
49extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); 49extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns);
50extern void free_pid_ns(struct kref *kref);
51extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); 50extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
52extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd); 51extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd);
53 52extern void put_pid_ns(struct pid_namespace *ns);
54static inline void put_pid_ns(struct pid_namespace *ns)
55{
56 if (ns != &init_pid_ns)
57 kref_put(&ns->kref, free_pid_ns);
58}
59 53
60#else /* !CONFIG_PID_NS */ 54#else /* !CONFIG_PID_NS */
61#include <linux/err.h> 55#include <linux/err.h>
diff --git a/include/linux/raid/Kbuild b/include/linux/raid/Kbuild
index 2415a64c5e51..e69de29bb2d1 100644
--- a/include/linux/raid/Kbuild
+++ b/include/linux/raid/Kbuild
@@ -1,2 +0,0 @@
1header-y += md_p.h
2header-y += md_u.h
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
deleted file mode 100644
index ee753536ab70..000000000000
--- a/include/linux/raid/md_p.h
+++ /dev/null
@@ -1,301 +0,0 @@
1/*
2 md_p.h : physical layout of Linux RAID devices
3 Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman
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 as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 You should have received a copy of the GNU General Public License
11 (for example /usr/src/linux/COPYING); if not, write to the Free
12 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
13*/
14
15#ifndef _MD_P_H
16#define _MD_P_H
17
18#include <linux/types.h>
19
20/*
21 * RAID superblock.
22 *
23 * The RAID superblock maintains some statistics on each RAID configuration.
24 * Each real device in the RAID set contains it near the end of the device.
25 * Some of the ideas are copied from the ext2fs implementation.
26 *
27 * We currently use 4096 bytes as follows:
28 *
29 * word offset function
30 *
31 * 0 - 31 Constant generic RAID device information.
32 * 32 - 63 Generic state information.
33 * 64 - 127 Personality specific information.
34 * 128 - 511 12 32-words descriptors of the disks in the raid set.
35 * 512 - 911 Reserved.
36 * 912 - 1023 Disk specific descriptor.
37 */
38
39/*
40 * If x is the real device size in bytes, we return an apparent size of:
41 *
42 * y = (x & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES
43 *
44 * and place the 4kB superblock at offset y.
45 */
46#define MD_RESERVED_BYTES (64 * 1024)
47#define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512)
48
49#define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS)
50
51#define MD_SB_BYTES 4096
52#define MD_SB_WORDS (MD_SB_BYTES / 4)
53#define MD_SB_SECTORS (MD_SB_BYTES / 512)
54
55/*
56 * The following are counted in 32-bit words
57 */
58#define MD_SB_GENERIC_OFFSET 0
59#define MD_SB_PERSONALITY_OFFSET 64
60#define MD_SB_DISKS_OFFSET 128
61#define MD_SB_DESCRIPTOR_OFFSET 992
62
63#define MD_SB_GENERIC_CONSTANT_WORDS 32
64#define MD_SB_GENERIC_STATE_WORDS 32
65#define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS)
66#define MD_SB_PERSONALITY_WORDS 64
67#define MD_SB_DESCRIPTOR_WORDS 32
68#define MD_SB_DISKS 27
69#define MD_SB_DISKS_WORDS (MD_SB_DISKS*MD_SB_DESCRIPTOR_WORDS)
70#define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS)
71#define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS)
72
73/*
74 * Device "operational" state bits
75 */
76#define MD_DISK_FAULTY 0 /* disk is faulty / operational */
77#define MD_DISK_ACTIVE 1 /* disk is running or spare disk */
78#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */
79#define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */
80
81#define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config.
82 * read requests will only be sent here in
83 * dire need
84 */
85
86typedef struct mdp_device_descriptor_s {
87 __u32 number; /* 0 Device number in the entire set */
88 __u32 major; /* 1 Device major number */
89 __u32 minor; /* 2 Device minor number */
90 __u32 raid_disk; /* 3 The role of the device in the raid set */
91 __u32 state; /* 4 Operational state */
92 __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5];
93} mdp_disk_t;
94
95#define MD_SB_MAGIC 0xa92b4efc
96
97/*
98 * Superblock state bits
99 */
100#define MD_SB_CLEAN 0
101#define MD_SB_ERRORS 1
102
103#define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */
104
105/*
106 * Notes:
107 * - if an array is being reshaped (restriped) in order to change the
108 * the number of active devices in the array, 'raid_disks' will be
109 * the larger of the old and new numbers. 'delta_disks' will
110 * be the "new - old". So if +ve, raid_disks is the new value, and
111 * "raid_disks-delta_disks" is the old. If -ve, raid_disks is the
112 * old value and "raid_disks+delta_disks" is the new (smaller) value.
113 */
114
115
116typedef struct mdp_superblock_s {
117 /*
118 * Constant generic information
119 */
120 __u32 md_magic; /* 0 MD identifier */
121 __u32 major_version; /* 1 major version to which the set conforms */
122 __u32 minor_version; /* 2 minor version ... */
123 __u32 patch_version; /* 3 patchlevel version ... */
124 __u32 gvalid_words; /* 4 Number of used words in this section */
125 __u32 set_uuid0; /* 5 Raid set identifier */
126 __u32 ctime; /* 6 Creation time */
127 __u32 level; /* 7 Raid personality */
128 __u32 size; /* 8 Apparent size of each individual disk */
129 __u32 nr_disks; /* 9 total disks in the raid set */
130 __u32 raid_disks; /* 10 disks in a fully functional raid set */
131 __u32 md_minor; /* 11 preferred MD minor device number */
132 __u32 not_persistent; /* 12 does it have a persistent superblock */
133 __u32 set_uuid1; /* 13 Raid set identifier #2 */
134 __u32 set_uuid2; /* 14 Raid set identifier #3 */
135 __u32 set_uuid3; /* 15 Raid set identifier #4 */
136 __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16];
137
138 /*
139 * Generic state information
140 */
141 __u32 utime; /* 0 Superblock update time */
142 __u32 state; /* 1 State bits (clean, ...) */
143 __u32 active_disks; /* 2 Number of currently active disks */
144 __u32 working_disks; /* 3 Number of working disks */
145 __u32 failed_disks; /* 4 Number of failed disks */
146 __u32 spare_disks; /* 5 Number of spare disks */
147 __u32 sb_csum; /* 6 checksum of the whole superblock */
148#ifdef __BIG_ENDIAN
149 __u32 events_hi; /* 7 high-order of superblock update count */
150 __u32 events_lo; /* 8 low-order of superblock update count */
151 __u32 cp_events_hi; /* 9 high-order of checkpoint update count */
152 __u32 cp_events_lo; /* 10 low-order of checkpoint update count */
153#else
154 __u32 events_lo; /* 7 low-order of superblock update count */
155 __u32 events_hi; /* 8 high-order of superblock update count */
156 __u32 cp_events_lo; /* 9 low-order of checkpoint update count */
157 __u32 cp_events_hi; /* 10 high-order of checkpoint update count */
158#endif
159 __u32 recovery_cp; /* 11 recovery checkpoint sector count */
160 /* There are only valid for minor_version > 90 */
161 __u64 reshape_position; /* 12,13 next address in array-space for reshape */
162 __u32 new_level; /* 14 new level we are reshaping to */
163 __u32 delta_disks; /* 15 change in number of raid_disks */
164 __u32 new_layout; /* 16 new layout */
165 __u32 new_chunk; /* 17 new chunk size (bytes) */
166 __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18];
167
168 /*
169 * Personality information
170 */
171 __u32 layout; /* 0 the array's physical layout */
172 __u32 chunk_size; /* 1 chunk size in bytes */
173 __u32 root_pv; /* 2 LV root PV */
174 __u32 root_block; /* 3 LV root block */
175 __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 4];
176
177 /*
178 * Disks information
179 */
180 mdp_disk_t disks[MD_SB_DISKS];
181
182 /*
183 * Reserved
184 */
185 __u32 reserved[MD_SB_RESERVED_WORDS];
186
187 /*
188 * Active descriptor
189 */
190 mdp_disk_t this_disk;
191
192} mdp_super_t;
193
194static inline __u64 md_event(mdp_super_t *sb) {
195 __u64 ev = sb->events_hi;
196 return (ev<<32)| sb->events_lo;
197}
198
199#define MD_SUPERBLOCK_1_TIME_SEC_MASK ((1ULL<<40) - 1)
200
201/*
202 * The version-1 superblock :
203 * All numeric fields are little-endian.
204 *
205 * total size: 256 bytes plus 2 per device.
206 * 1K allows 384 devices.
207 */
208struct mdp_superblock_1 {
209 /* constant array information - 128 bytes */
210 __le32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */
211 __le32 major_version; /* 1 */
212 __le32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */
213 __le32 pad0; /* always set to 0 when writing */
214
215 __u8 set_uuid[16]; /* user-space generated. */
216 char set_name[32]; /* set and interpreted by user-space */
217
218 __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
219 __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
220 __le32 layout; /* only for raid5 and raid10 currently */
221 __le64 size; /* used size of component devices, in 512byte sectors */
222
223 __le32 chunksize; /* in 512byte sectors */
224 __le32 raid_disks;
225 __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts
226 * NOTE: signed, so bitmap can be before superblock
227 * only meaningful of feature_map[0] is set.
228 */
229
230 /* These are only valid with feature bit '4' */
231 __le32 new_level; /* new level we are reshaping to */
232 __le64 reshape_position; /* next address in array-space for reshape */
233 __le32 delta_disks; /* change in number of raid_disks */
234 __le32 new_layout; /* new layout */
235 __le32 new_chunk; /* new chunk size (512byte sectors) */
236 __le32 new_offset; /* signed number to add to data_offset in new
237 * layout. 0 == no-change. This can be
238 * different on each device in the array.
239 */
240
241 /* constant this-device information - 64 bytes */
242 __le64 data_offset; /* sector start of data, often 0 */
243 __le64 data_size; /* sectors in this device that can be used for data */
244 __le64 super_offset; /* sector start of this superblock */
245 __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
246 __le32 dev_number; /* permanent identifier of this device - not role in raid */
247 __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
248 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
249 __u8 devflags; /* per-device flags. Only one defined...*/
250#define WriteMostly1 1 /* mask for writemostly flag in above */
251 /* Bad block log. If there are any bad blocks the feature flag is set.
252 * If offset and size are non-zero, that space is reserved and available
253 */
254 __u8 bblog_shift; /* shift from sectors to block size */
255 __le16 bblog_size; /* number of sectors reserved for list */
256 __le32 bblog_offset; /* sector offset from superblock to bblog,
257 * signed - not unsigned */
258
259 /* array state information - 64 bytes */
260 __le64 utime; /* 40 bits second, 24 bits microseconds */
261 __le64 events; /* incremented when superblock updated */
262 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
263 __le32 sb_csum; /* checksum up to devs[max_dev] */
264 __le32 max_dev; /* size of devs[] array to consider */
265 __u8 pad3[64-32]; /* set to 0 when writing */
266
267 /* device state information. Indexed by dev_number.
268 * 2 bytes per device
269 * Note there are no per-device state flags. State information is rolled
270 * into the 'roles' value. If a device is spare or faulty, then it doesn't
271 * have a meaningful role.
272 */
273 __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
274};
275
276/* feature_map bits */
277#define MD_FEATURE_BITMAP_OFFSET 1
278#define MD_FEATURE_RECOVERY_OFFSET 2 /* recovery_offset is present and
279 * must be honoured
280 */
281#define MD_FEATURE_RESHAPE_ACTIVE 4
282#define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */
283#define MD_FEATURE_REPLACEMENT 16 /* This device is replacing an
284 * active device with same 'role'.
285 * 'recovery_offset' is also set.
286 */
287#define MD_FEATURE_RESHAPE_BACKWARDS 32 /* Reshape doesn't change number
288 * of devices, but is going
289 * backwards anyway.
290 */
291#define MD_FEATURE_NEW_OFFSET 64 /* new_offset must be honoured */
292#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \
293 |MD_FEATURE_RECOVERY_OFFSET \
294 |MD_FEATURE_RESHAPE_ACTIVE \
295 |MD_FEATURE_BAD_BLOCKS \
296 |MD_FEATURE_REPLACEMENT \
297 |MD_FEATURE_RESHAPE_BACKWARDS \
298 |MD_FEATURE_NEW_OFFSET \
299 )
300
301#endif
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h
index fb1abb3367e9..358c04bfbe2a 100644
--- a/include/linux/raid/md_u.h
+++ b/include/linux/raid/md_u.h
@@ -11,149 +11,10 @@
11 (for example /usr/src/linux/COPYING); if not, write to the Free 11 (for example /usr/src/linux/COPYING); if not, write to the Free
12 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 12 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
13*/ 13*/
14
15#ifndef _MD_U_H 14#ifndef _MD_U_H
16#define _MD_U_H 15#define _MD_U_H
17 16
18/* 17#include <uapi/linux/raid/md_u.h>
19 * Different major versions are not compatible.
20 * Different minor versions are only downward compatible.
21 * Different patchlevel versions are downward and upward compatible.
22 */
23#define MD_MAJOR_VERSION 0
24#define MD_MINOR_VERSION 90
25/*
26 * MD_PATCHLEVEL_VERSION indicates kernel functionality.
27 * >=1 means different superblock formats are selectable using SET_ARRAY_INFO
28 * and major_version/minor_version accordingly
29 * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT
30 * in the super status byte
31 * >=3 means that bitmap superblock version 4 is supported, which uses
32 * little-ending representation rather than host-endian
33 */
34#define MD_PATCHLEVEL_VERSION 3
35
36/* ioctls */
37
38/* status */
39#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)
40#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)
41#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
42#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)
43#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
44#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
45
46/* configuration */
47#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
48#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
49#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
50#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
51#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
52#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
53#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
54#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
55#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
56#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
57#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
58#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
59 18
60/* usage */
61#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
62/* 0x31 was START_ARRAY */
63#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
64#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
65#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
66
67/* 63 partitions with the alternate major number (mdp) */
68#define MdpMinorShift 6
69#ifdef __KERNEL__
70extern int mdp_major; 19extern int mdp_major;
71#endif
72
73typedef struct mdu_version_s {
74 int major;
75 int minor;
76 int patchlevel;
77} mdu_version_t;
78
79typedef struct mdu_array_info_s {
80 /*
81 * Generic constant information
82 */
83 int major_version;
84 int minor_version;
85 int patch_version;
86 int ctime;
87 int level;
88 int size;
89 int nr_disks;
90 int raid_disks;
91 int md_minor;
92 int not_persistent;
93
94 /*
95 * Generic state information
96 */
97 int utime; /* 0 Superblock update time */
98 int state; /* 1 State bits (clean, ...) */
99 int active_disks; /* 2 Number of currently active disks */
100 int working_disks; /* 3 Number of working disks */
101 int failed_disks; /* 4 Number of failed disks */
102 int spare_disks; /* 5 Number of spare disks */
103
104 /*
105 * Personality information
106 */
107 int layout; /* 0 the array's physical layout */
108 int chunk_size; /* 1 chunk size in bytes */
109
110} mdu_array_info_t;
111
112/* non-obvious values for 'level' */
113#define LEVEL_MULTIPATH (-4)
114#define LEVEL_LINEAR (-1)
115#define LEVEL_FAULTY (-5)
116
117/* we need a value for 'no level specified' and 0
118 * means 'raid0', so we need something else. This is
119 * for internal use only
120 */
121#define LEVEL_NONE (-1000000)
122
123typedef struct mdu_disk_info_s {
124 /*
125 * configuration/status of one particular disk
126 */
127 int number;
128 int major;
129 int minor;
130 int raid_disk;
131 int state;
132
133} mdu_disk_info_t;
134
135typedef struct mdu_start_info_s {
136 /*
137 * configuration/status of one particular disk
138 */
139 int major;
140 int minor;
141 int raid_disk;
142 int state;
143
144} mdu_start_info_t;
145
146typedef struct mdu_bitmap_file_s
147{
148 char pathname[4096];
149} mdu_bitmap_file_t;
150
151typedef struct mdu_param_s
152{
153 int personality; /* 1,2,3,4 */
154 int chunk_size; /* in bytes */
155 int max_fault; /* unused for now */
156} mdu_param_t;
157
158#endif 20#endif
159
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index e11ccb4cf48d..0a260d8a18bf 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
46#define WARN_ON_RATELIMIT(condition, state) \ 46#define WARN_ON_RATELIMIT(condition, state) \
47 WARN_ON((condition) && __ratelimit(state)) 47 WARN_ON((condition) && __ratelimit(state))
48 48
49#define __WARN_RATELIMIT(condition, state, format...) \ 49#define WARN_RATELIMIT(condition, format, ...) \
50({ \
51 int rtn = 0; \
52 if (unlikely(__ratelimit(state))) \
53 rtn = WARN(condition, format); \
54 rtn; \
55})
56
57#define WARN_RATELIMIT(condition, format...) \
58({ \ 50({ \
59 static DEFINE_RATELIMIT_STATE(_rs, \ 51 static DEFINE_RATELIMIT_STATE(_rs, \
60 DEFAULT_RATELIMIT_INTERVAL, \ 52 DEFAULT_RATELIMIT_INTERVAL, \
61 DEFAULT_RATELIMIT_BURST); \ 53 DEFAULT_RATELIMIT_BURST); \
62 __WARN_RATELIMIT(condition, &_rs, format); \ 54 int rtn = !!(condition); \
55 \
56 if (unlikely(rtn && __ratelimit(&_rs))) \
57 WARN(rtn, format, ##__VA_ARGS__); \
58 \
59 rtn; \
63}) 60})
64 61
65#else 62#else
@@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
67#define WARN_ON_RATELIMIT(condition, state) \ 64#define WARN_ON_RATELIMIT(condition, state) \
68 WARN_ON(condition) 65 WARN_ON(condition)
69 66
70#define __WARN_RATELIMIT(condition, state, format...) \ 67#define WARN_RATELIMIT(condition, format, ...) \
71({ \
72 int rtn = WARN(condition, format); \
73 rtn; \
74})
75
76#define WARN_RATELIMIT(condition, format...) \
77({ \ 68({ \
78 int rtn = WARN(condition, format); \ 69 int rtn = WARN(condition, format, ##__VA_ARGS__); \
79 rtn; \ 70 rtn; \
80}) 71})
81 72
diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h
index 214caa33433b..2ac60c9cf644 100644
--- a/include/linux/rbtree_augmented.h
+++ b/include/linux/rbtree_augmented.h
@@ -24,6 +24,7 @@
24#ifndef _LINUX_RBTREE_AUGMENTED_H 24#ifndef _LINUX_RBTREE_AUGMENTED_H
25#define _LINUX_RBTREE_AUGMENTED_H 25#define _LINUX_RBTREE_AUGMENTED_H
26 26
27#include <linux/compiler.h>
27#include <linux/rbtree.h> 28#include <linux/rbtree.h>
28 29
29/* 30/*
diff --git a/include/linux/spi/Kbuild b/include/linux/spi/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/spi/Kbuild
+++ /dev/null
diff --git a/include/linux/spi/tsc2005.h b/include/linux/spi/tsc2005.h
index d9b0c84220c7..8f721e465e05 100644
--- a/include/linux/spi/tsc2005.h
+++ b/include/linux/spi/tsc2005.h
@@ -3,8 +3,6 @@
3 * 3 *
4 * Copyright (C) 2009-2010 Nokia Corporation 4 * Copyright (C) 2009-2010 Nokia Corporation
5 * 5 *
6 * Contact: Aaro Koskinen <aaro.koskinen@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
diff --git a/include/linux/sunrpc/Kbuild b/include/linux/sunrpc/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/sunrpc/Kbuild
+++ /dev/null
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/tc_act/Kbuild
+++ /dev/null
diff --git a/include/linux/tc_ematch/Kbuild b/include/linux/tc_ematch/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/tc_ematch/Kbuild
+++ /dev/null
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 8a7fc4be2d75..60b7aac15e0e 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -191,7 +191,8 @@ struct tcp_sock {
191 u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ 191 u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */
192 early_retrans_delayed:1, /* Delayed ER timer installed */ 192 early_retrans_delayed:1, /* Delayed ER timer installed */
193 syn_data:1, /* SYN includes data */ 193 syn_data:1, /* SYN includes data */
194 syn_fastopen:1; /* SYN includes Fast Open option */ 194 syn_fastopen:1, /* SYN includes Fast Open option */
195 syn_data_acked:1;/* data in SYN is acked by SYN-ACK */
195 196
196/* RTT measurement */ 197/* RTT measurement */
197 u32 srtt; /* smoothed round trip time << 3 */ 198 u32 srtt; /* smoothed round trip time << 3 */
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index e6f0331e3d45..24594571c5a3 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -35,16 +35,6 @@ struct inode;
35# include <asm/uprobes.h> 35# include <asm/uprobes.h>
36#endif 36#endif
37 37
38/* flags that denote/change uprobes behaviour */
39
40/* Have a copy of original instruction */
41#define UPROBE_COPY_INSN 0x1
42
43/* Dont run handlers when first register/ last unregister in progress*/
44#define UPROBE_RUN_HANDLER 0x2
45/* Can skip singlestep */
46#define UPROBE_SKIP_SSTEP 0x4
47
48struct uprobe_consumer { 38struct uprobe_consumer {
49 int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); 39 int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs);
50 /* 40 /*
@@ -59,7 +49,6 @@ struct uprobe_consumer {
59#ifdef CONFIG_UPROBES 49#ifdef CONFIG_UPROBES
60enum uprobe_task_state { 50enum uprobe_task_state {
61 UTASK_RUNNING, 51 UTASK_RUNNING,
62 UTASK_BP_HIT,
63 UTASK_SSTEP, 52 UTASK_SSTEP,
64 UTASK_SSTEP_ACK, 53 UTASK_SSTEP_ACK,
65 UTASK_SSTEP_TRAPPED, 54 UTASK_SSTEP_TRAPPED,
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 07915a32fb9d..10278d18709c 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1778,17 +1778,6 @@ static inline int usb_translate_errors(int error_code)
1778extern void usb_register_notify(struct notifier_block *nb); 1778extern void usb_register_notify(struct notifier_block *nb);
1779extern void usb_unregister_notify(struct notifier_block *nb); 1779extern void usb_unregister_notify(struct notifier_block *nb);
1780 1780
1781#ifdef DEBUG
1782#define dbg(format, arg...) \
1783 printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg)
1784#else
1785#define dbg(format, arg...) \
1786do { \
1787 if (0) \
1788 printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \
1789} while (0)
1790#endif
1791
1792/* debugfs stuff */ 1781/* debugfs stuff */
1793extern struct dentry *usb_debug_root; 1782extern struct dentry *usb_debug_root;
1794 1783
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
index b607f3532e88..e69de29bb2d1 100644
--- a/include/linux/usb/Kbuild
+++ b/include/linux/usb/Kbuild
@@ -1,10 +0,0 @@
1header-y += audio.h
2header-y += cdc.h
3header-y += ch9.h
4header-y += ch11.h
5header-y += functionfs.h
6header-y += gadgetfs.h
7header-y += midi.h
8header-y += g_printer.h
9header-y += tmc.h
10header-y += video.h
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index a54b8255d75f..3d84619110a4 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -17,531 +17,11 @@
17 * Types and defines in this file are either specific to version 1.0 of 17 * Types and defines in this file are either specific to version 1.0 of
18 * this standard or common for newer versions. 18 * this standard or common for newer versions.
19 */ 19 */
20
21#ifndef __LINUX_USB_AUDIO_H 20#ifndef __LINUX_USB_AUDIO_H
22#define __LINUX_USB_AUDIO_H 21#define __LINUX_USB_AUDIO_H
23 22
24#include <linux/types.h> 23#include <uapi/linux/usb/audio.h>
25
26/* bInterfaceProtocol values to denote the version of the standard used */
27#define UAC_VERSION_1 0x00
28#define UAC_VERSION_2 0x20
29
30/* A.2 Audio Interface Subclass Codes */
31#define USB_SUBCLASS_AUDIOCONTROL 0x01
32#define USB_SUBCLASS_AUDIOSTREAMING 0x02
33#define USB_SUBCLASS_MIDISTREAMING 0x03
34
35/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
36#define UAC_HEADER 0x01
37#define UAC_INPUT_TERMINAL 0x02
38#define UAC_OUTPUT_TERMINAL 0x03
39#define UAC_MIXER_UNIT 0x04
40#define UAC_SELECTOR_UNIT 0x05
41#define UAC_FEATURE_UNIT 0x06
42#define UAC1_PROCESSING_UNIT 0x07
43#define UAC1_EXTENSION_UNIT 0x08
44
45/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
46#define UAC_AS_GENERAL 0x01
47#define UAC_FORMAT_TYPE 0x02
48#define UAC_FORMAT_SPECIFIC 0x03
49
50/* A.7 Processing Unit Process Types */
51#define UAC_PROCESS_UNDEFINED 0x00
52#define UAC_PROCESS_UP_DOWNMIX 0x01
53#define UAC_PROCESS_DOLBY_PROLOGIC 0x02
54#define UAC_PROCESS_STEREO_EXTENDER 0x03
55#define UAC_PROCESS_REVERB 0x04
56#define UAC_PROCESS_CHORUS 0x05
57#define UAC_PROCESS_DYN_RANGE_COMP 0x06
58
59/* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */
60#define UAC_EP_GENERAL 0x01
61
62/* A.9 Audio Class-Specific Request Codes */
63#define UAC_SET_ 0x00
64#define UAC_GET_ 0x80
65
66#define UAC__CUR 0x1
67#define UAC__MIN 0x2
68#define UAC__MAX 0x3
69#define UAC__RES 0x4
70#define UAC__MEM 0x5
71
72#define UAC_SET_CUR (UAC_SET_ | UAC__CUR)
73#define UAC_GET_CUR (UAC_GET_ | UAC__CUR)
74#define UAC_SET_MIN (UAC_SET_ | UAC__MIN)
75#define UAC_GET_MIN (UAC_GET_ | UAC__MIN)
76#define UAC_SET_MAX (UAC_SET_ | UAC__MAX)
77#define UAC_GET_MAX (UAC_GET_ | UAC__MAX)
78#define UAC_SET_RES (UAC_SET_ | UAC__RES)
79#define UAC_GET_RES (UAC_GET_ | UAC__RES)
80#define UAC_SET_MEM (UAC_SET_ | UAC__MEM)
81#define UAC_GET_MEM (UAC_GET_ | UAC__MEM)
82
83#define UAC_GET_STAT 0xff
84
85/* A.10 Control Selector Codes */
86
87/* A.10.1 Terminal Control Selectors */
88#define UAC_TERM_COPY_PROTECT 0x01
89
90/* A.10.2 Feature Unit Control Selectors */
91#define UAC_FU_MUTE 0x01
92#define UAC_FU_VOLUME 0x02
93#define UAC_FU_BASS 0x03
94#define UAC_FU_MID 0x04
95#define UAC_FU_TREBLE 0x05
96#define UAC_FU_GRAPHIC_EQUALIZER 0x06
97#define UAC_FU_AUTOMATIC_GAIN 0x07
98#define UAC_FU_DELAY 0x08
99#define UAC_FU_BASS_BOOST 0x09
100#define UAC_FU_LOUDNESS 0x0a
101
102#define UAC_CONTROL_BIT(CS) (1 << ((CS) - 1))
103
104/* A.10.3.1 Up/Down-mix Processing Unit Controls Selectors */
105#define UAC_UD_ENABLE 0x01
106#define UAC_UD_MODE_SELECT 0x02
107
108/* A.10.3.2 Dolby Prologic (tm) Processing Unit Controls Selectors */
109#define UAC_DP_ENABLE 0x01
110#define UAC_DP_MODE_SELECT 0x02
111
112/* A.10.3.3 3D Stereo Extender Processing Unit Control Selectors */
113#define UAC_3D_ENABLE 0x01
114#define UAC_3D_SPACE 0x02
115
116/* A.10.3.4 Reverberation Processing Unit Control Selectors */
117#define UAC_REVERB_ENABLE 0x01
118#define UAC_REVERB_LEVEL 0x02
119#define UAC_REVERB_TIME 0x03
120#define UAC_REVERB_FEEDBACK 0x04
121
122/* A.10.3.5 Chorus Processing Unit Control Selectors */
123#define UAC_CHORUS_ENABLE 0x01
124#define UAC_CHORUS_LEVEL 0x02
125#define UAC_CHORUS_RATE 0x03
126#define UAC_CHORUS_DEPTH 0x04
127
128/* A.10.3.6 Dynamic Range Compressor Unit Control Selectors */
129#define UAC_DCR_ENABLE 0x01
130#define UAC_DCR_RATE 0x02
131#define UAC_DCR_MAXAMPL 0x03
132#define UAC_DCR_THRESHOLD 0x04
133#define UAC_DCR_ATTACK_TIME 0x05
134#define UAC_DCR_RELEASE_TIME 0x06
135
136/* A.10.4 Extension Unit Control Selectors */
137#define UAC_XU_ENABLE 0x01
138
139/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
140#define UAC_MS_HEADER 0x01
141#define UAC_MIDI_IN_JACK 0x02
142#define UAC_MIDI_OUT_JACK 0x03
143
144/* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */
145#define UAC_MS_GENERAL 0x01
146
147/* Terminals - 2.1 USB Terminal Types */
148#define UAC_TERMINAL_UNDEFINED 0x100
149#define UAC_TERMINAL_STREAMING 0x101
150#define UAC_TERMINAL_VENDOR_SPEC 0x1FF
151
152/* Terminal Control Selectors */
153/* 4.3.2 Class-Specific AC Interface Descriptor */
154struct uac1_ac_header_descriptor {
155 __u8 bLength; /* 8 + n */
156 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
157 __u8 bDescriptorSubtype; /* UAC_MS_HEADER */
158 __le16 bcdADC; /* 0x0100 */
159 __le16 wTotalLength; /* includes Unit and Terminal desc. */
160 __u8 bInCollection; /* n */
161 __u8 baInterfaceNr[]; /* [n] */
162} __attribute__ ((packed));
163
164#define UAC_DT_AC_HEADER_SIZE(n) (8 + (n))
165
166/* As above, but more useful for defining your own descriptors: */
167#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \
168struct uac1_ac_header_descriptor_##n { \
169 __u8 bLength; \
170 __u8 bDescriptorType; \
171 __u8 bDescriptorSubtype; \
172 __le16 bcdADC; \
173 __le16 wTotalLength; \
174 __u8 bInCollection; \
175 __u8 baInterfaceNr[n]; \
176} __attribute__ ((packed))
177
178/* 4.3.2.1 Input Terminal Descriptor */
179struct uac_input_terminal_descriptor {
180 __u8 bLength; /* in bytes: 12 */
181 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */
182 __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */
183 __u8 bTerminalID; /* Constant uniquely terminal ID */
184 __le16 wTerminalType; /* USB Audio Terminal Types */
185 __u8 bAssocTerminal; /* ID of the Output Terminal associated */
186 __u8 bNrChannels; /* Number of logical output channels */
187 __le16 wChannelConfig;
188 __u8 iChannelNames;
189 __u8 iTerminal;
190} __attribute__ ((packed));
191
192#define UAC_DT_INPUT_TERMINAL_SIZE 12
193
194/* Terminals - 2.2 Input Terminal Types */
195#define UAC_INPUT_TERMINAL_UNDEFINED 0x200
196#define UAC_INPUT_TERMINAL_MICROPHONE 0x201
197#define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202
198#define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203
199#define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204
200#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205
201#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206
202
203/* Terminals - control selectors */
204
205#define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01
206
207/* 4.3.2.2 Output Terminal Descriptor */
208struct uac1_output_terminal_descriptor {
209 __u8 bLength; /* in bytes: 9 */
210 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */
211 __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */
212 __u8 bTerminalID; /* Constant uniquely terminal ID */
213 __le16 wTerminalType; /* USB Audio Terminal Types */
214 __u8 bAssocTerminal; /* ID of the Input Terminal associated */
215 __u8 bSourceID; /* ID of the connected Unit or Terminal*/
216 __u8 iTerminal;
217} __attribute__ ((packed));
218
219#define UAC_DT_OUTPUT_TERMINAL_SIZE 9
220
221/* Terminals - 2.3 Output Terminal Types */
222#define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300
223#define UAC_OUTPUT_TERMINAL_SPEAKER 0x301
224#define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302
225#define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303
226#define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304
227#define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305
228#define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306
229#define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307
230
231/* Set bControlSize = 2 as default setting */
232#define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2)
233
234/* As above, but more useful for defining your own descriptors: */
235#define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \
236struct uac_feature_unit_descriptor_##ch { \
237 __u8 bLength; \
238 __u8 bDescriptorType; \
239 __u8 bDescriptorSubtype; \
240 __u8 bUnitID; \
241 __u8 bSourceID; \
242 __u8 bControlSize; \
243 __le16 bmaControls[ch + 1]; \
244 __u8 iFeature; \
245} __attribute__ ((packed))
246
247/* 4.3.2.3 Mixer Unit Descriptor */
248struct uac_mixer_unit_descriptor {
249 __u8 bLength;
250 __u8 bDescriptorType;
251 __u8 bDescriptorSubtype;
252 __u8 bUnitID;
253 __u8 bNrInPins;
254 __u8 baSourceID[];
255} __attribute__ ((packed));
256 24
257static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc)
258{
259 return desc->baSourceID[desc->bNrInPins];
260}
261
262static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc,
263 int protocol)
264{
265 if (protocol == UAC_VERSION_1)
266 return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
267 desc->baSourceID[desc->bNrInPins + 1];
268 else
269 return (desc->baSourceID[desc->bNrInPins + 4] << 24) |
270 (desc->baSourceID[desc->bNrInPins + 3] << 16) |
271 (desc->baSourceID[desc->bNrInPins + 2] << 8) |
272 (desc->baSourceID[desc->bNrInPins + 1]);
273}
274
275static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc,
276 int protocol)
277{
278 return (protocol == UAC_VERSION_1) ?
279 desc->baSourceID[desc->bNrInPins + 3] :
280 desc->baSourceID[desc->bNrInPins + 5];
281}
282
283static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc,
284 int protocol)
285{
286 return (protocol == UAC_VERSION_1) ?
287 &desc->baSourceID[desc->bNrInPins + 4] :
288 &desc->baSourceID[desc->bNrInPins + 6];
289}
290
291static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc)
292{
293 __u8 *raw = (__u8 *) desc;
294 return raw[desc->bLength - 1];
295}
296
297/* 4.3.2.4 Selector Unit Descriptor */
298struct uac_selector_unit_descriptor {
299 __u8 bLength;
300 __u8 bDescriptorType;
301 __u8 bDescriptorSubtype;
302 __u8 bUintID;
303 __u8 bNrInPins;
304 __u8 baSourceID[];
305} __attribute__ ((packed));
306
307static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
308{
309 __u8 *raw = (__u8 *) desc;
310 return raw[desc->bLength - 1];
311}
312
313/* 4.3.2.5 Feature Unit Descriptor */
314struct uac_feature_unit_descriptor {
315 __u8 bLength;
316 __u8 bDescriptorType;
317 __u8 bDescriptorSubtype;
318 __u8 bUnitID;
319 __u8 bSourceID;
320 __u8 bControlSize;
321 __u8 bmaControls[0]; /* variable length */
322} __attribute__((packed));
323
324static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
325{
326 __u8 *raw = (__u8 *) desc;
327 return raw[desc->bLength - 1];
328}
329
330/* 4.3.2.6 Processing Unit Descriptors */
331struct uac_processing_unit_descriptor {
332 __u8 bLength;
333 __u8 bDescriptorType;
334 __u8 bDescriptorSubtype;
335 __u8 bUnitID;
336 __u16 wProcessType;
337 __u8 bNrInPins;
338 __u8 baSourceID[];
339} __attribute__ ((packed));
340
341static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc)
342{
343 return desc->baSourceID[desc->bNrInPins];
344}
345
346static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc,
347 int protocol)
348{
349 if (protocol == UAC_VERSION_1)
350 return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
351 desc->baSourceID[desc->bNrInPins + 1];
352 else
353 return (desc->baSourceID[desc->bNrInPins + 4] << 24) |
354 (desc->baSourceID[desc->bNrInPins + 3] << 16) |
355 (desc->baSourceID[desc->bNrInPins + 2] << 8) |
356 (desc->baSourceID[desc->bNrInPins + 1]);
357}
358
359static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc,
360 int protocol)
361{
362 return (protocol == UAC_VERSION_1) ?
363 desc->baSourceID[desc->bNrInPins + 3] :
364 desc->baSourceID[desc->bNrInPins + 5];
365}
366
367static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc,
368 int protocol)
369{
370 return (protocol == UAC_VERSION_1) ?
371 desc->baSourceID[desc->bNrInPins + 4] :
372 desc->baSourceID[desc->bNrInPins + 6];
373}
374
375static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
376 int protocol)
377{
378 return (protocol == UAC_VERSION_1) ?
379 &desc->baSourceID[desc->bNrInPins + 5] :
380 &desc->baSourceID[desc->bNrInPins + 7];
381}
382
383static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
384 int protocol)
385{
386 __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
387 return desc->baSourceID[desc->bNrInPins + control_size];
388}
389
390static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
391 int protocol)
392{
393 __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
394 return &desc->baSourceID[desc->bNrInPins + control_size + 1];
395}
396
397/* 4.5.2 Class-Specific AS Interface Descriptor */
398struct uac1_as_header_descriptor {
399 __u8 bLength; /* in bytes: 7 */
400 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
401 __u8 bDescriptorSubtype; /* AS_GENERAL */
402 __u8 bTerminalLink; /* Terminal ID of connected Terminal */
403 __u8 bDelay; /* Delay introduced by the data path */
404 __le16 wFormatTag; /* The Audio Data Format */
405} __attribute__ ((packed));
406
407#define UAC_DT_AS_HEADER_SIZE 7
408
409/* Formats - A.1.1 Audio Data Format Type I Codes */
410#define UAC_FORMAT_TYPE_I_UNDEFINED 0x0
411#define UAC_FORMAT_TYPE_I_PCM 0x1
412#define UAC_FORMAT_TYPE_I_PCM8 0x2
413#define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3
414#define UAC_FORMAT_TYPE_I_ALAW 0x4
415#define UAC_FORMAT_TYPE_I_MULAW 0x5
416
417struct uac_format_type_i_continuous_descriptor {
418 __u8 bLength; /* in bytes: 8 + (ns * 3) */
419 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
420 __u8 bDescriptorSubtype; /* FORMAT_TYPE */
421 __u8 bFormatType; /* FORMAT_TYPE_1 */
422 __u8 bNrChannels; /* physical channels in the stream */
423 __u8 bSubframeSize; /* */
424 __u8 bBitResolution;
425 __u8 bSamFreqType;
426 __u8 tLowerSamFreq[3];
427 __u8 tUpperSamFreq[3];
428} __attribute__ ((packed));
429
430#define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14
431
432struct uac_format_type_i_discrete_descriptor {
433 __u8 bLength; /* in bytes: 8 + (ns * 3) */
434 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
435 __u8 bDescriptorSubtype; /* FORMAT_TYPE */
436 __u8 bFormatType; /* FORMAT_TYPE_1 */
437 __u8 bNrChannels; /* physical channels in the stream */
438 __u8 bSubframeSize; /* */
439 __u8 bBitResolution;
440 __u8 bSamFreqType;
441 __u8 tSamFreq[][3];
442} __attribute__ ((packed));
443
444#define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \
445struct uac_format_type_i_discrete_descriptor_##n { \
446 __u8 bLength; \
447 __u8 bDescriptorType; \
448 __u8 bDescriptorSubtype; \
449 __u8 bFormatType; \
450 __u8 bNrChannels; \
451 __u8 bSubframeSize; \
452 __u8 bBitResolution; \
453 __u8 bSamFreqType; \
454 __u8 tSamFreq[n][3]; \
455} __attribute__ ((packed))
456
457#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3))
458
459struct uac_format_type_i_ext_descriptor {
460 __u8 bLength;
461 __u8 bDescriptorType;
462 __u8 bDescriptorSubtype;
463 __u8 bFormatType;
464 __u8 bSubslotSize;
465 __u8 bBitResolution;
466 __u8 bHeaderLength;
467 __u8 bControlSize;
468 __u8 bSideBandProtocol;
469} __attribute__((packed));
470
471/* Formats - Audio Data Format Type I Codes */
472
473#define UAC_FORMAT_TYPE_II_MPEG 0x1001
474#define UAC_FORMAT_TYPE_II_AC3 0x1002
475
476struct uac_format_type_ii_discrete_descriptor {
477 __u8 bLength;
478 __u8 bDescriptorType;
479 __u8 bDescriptorSubtype;
480 __u8 bFormatType;
481 __le16 wMaxBitRate;
482 __le16 wSamplesPerFrame;
483 __u8 bSamFreqType;
484 __u8 tSamFreq[][3];
485} __attribute__((packed));
486
487struct uac_format_type_ii_ext_descriptor {
488 __u8 bLength;
489 __u8 bDescriptorType;
490 __u8 bDescriptorSubtype;
491 __u8 bFormatType;
492 __u16 wMaxBitRate;
493 __u16 wSamplesPerFrame;
494 __u8 bHeaderLength;
495 __u8 bSideBandProtocol;
496} __attribute__((packed));
497
498/* type III */
499#define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001
500#define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002
501#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003
502#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004
503#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005
504#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006
505
506/* Formats - A.2 Format Type Codes */
507#define UAC_FORMAT_TYPE_UNDEFINED 0x0
508#define UAC_FORMAT_TYPE_I 0x1
509#define UAC_FORMAT_TYPE_II 0x2
510#define UAC_FORMAT_TYPE_III 0x3
511#define UAC_EXT_FORMAT_TYPE_I 0x81
512#define UAC_EXT_FORMAT_TYPE_II 0x82
513#define UAC_EXT_FORMAT_TYPE_III 0x83
514
515struct uac_iso_endpoint_descriptor {
516 __u8 bLength; /* in bytes: 7 */
517 __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */
518 __u8 bDescriptorSubtype; /* EP_GENERAL */
519 __u8 bmAttributes;
520 __u8 bLockDelayUnits;
521 __le16 wLockDelay;
522} __attribute__((packed));
523#define UAC_ISO_ENDPOINT_DESC_SIZE 7
524
525#define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01
526#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
527#define UAC_EP_CS_ATTR_FILL_MAX 0x80
528
529/* status word format (3.7.1.1) */
530
531#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f
532#define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0
533#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1
534#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2
535
536#define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7)
537#define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6)
538
539struct uac1_status_word {
540 __u8 bStatusType;
541 __u8 bOriginator;
542} __attribute__((packed));
543
544#ifdef __KERNEL__
545 25
546struct usb_audio_control { 26struct usb_audio_control {
547 struct list_head list; 27 struct list_head list;
@@ -561,6 +41,4 @@ struct usb_audio_control_selector {
561 struct usb_descriptor_header *desc; 41 struct usb_descriptor_header *desc;
562}; 42};
563 43
564#endif /* __KERNEL__ */
565
566#endif /* __LINUX_USB_AUDIO_H */ 44#endif /* __LINUX_USB_AUDIO_H */
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h
deleted file mode 100644
index 81a927930bfd..000000000000
--- a/include/linux/usb/cdc.h
+++ /dev/null
@@ -1,412 +0,0 @@
1/*
2 * USB Communications Device Class (CDC) definitions
3 *
4 * CDC says how to talk to lots of different types of network adapters,
5 * notably ethernet adapters and various modems. It's used mostly with
6 * firmware based USB peripherals.
7 */
8
9#ifndef __LINUX_USB_CDC_H
10#define __LINUX_USB_CDC_H
11
12#include <linux/types.h>
13
14#define USB_CDC_SUBCLASS_ACM 0x02
15#define USB_CDC_SUBCLASS_ETHERNET 0x06
16#define USB_CDC_SUBCLASS_WHCM 0x08
17#define USB_CDC_SUBCLASS_DMM 0x09
18#define USB_CDC_SUBCLASS_MDLM 0x0a
19#define USB_CDC_SUBCLASS_OBEX 0x0b
20#define USB_CDC_SUBCLASS_EEM 0x0c
21#define USB_CDC_SUBCLASS_NCM 0x0d
22
23#define USB_CDC_PROTO_NONE 0
24
25#define USB_CDC_ACM_PROTO_AT_V25TER 1
26#define USB_CDC_ACM_PROTO_AT_PCCA101 2
27#define USB_CDC_ACM_PROTO_AT_PCCA101_WAKE 3
28#define USB_CDC_ACM_PROTO_AT_GSM 4
29#define USB_CDC_ACM_PROTO_AT_3G 5
30#define USB_CDC_ACM_PROTO_AT_CDMA 6
31#define USB_CDC_ACM_PROTO_VENDOR 0xff
32
33#define USB_CDC_PROTO_EEM 7
34
35#define USB_CDC_NCM_PROTO_NTB 1
36
37/*-------------------------------------------------------------------------*/
38
39/*
40 * Class-Specific descriptors ... there are a couple dozen of them
41 */
42
43#define USB_CDC_HEADER_TYPE 0x00 /* header_desc */
44#define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 /* call_mgmt_descriptor */
45#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */
46#define USB_CDC_UNION_TYPE 0x06 /* union_desc */
47#define USB_CDC_COUNTRY_TYPE 0x07
48#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */
49#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */
50#define USB_CDC_WHCM_TYPE 0x11
51#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */
52#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */
53#define USB_CDC_DMM_TYPE 0x14
54#define USB_CDC_OBEX_TYPE 0x15
55#define USB_CDC_NCM_TYPE 0x1a
56
57/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */
58struct usb_cdc_header_desc {
59 __u8 bLength;
60 __u8 bDescriptorType;
61 __u8 bDescriptorSubType;
62
63 __le16 bcdCDC;
64} __attribute__ ((packed));
65
66/* "Call Management Descriptor" from CDC spec 5.2.3.2 */
67struct usb_cdc_call_mgmt_descriptor {
68 __u8 bLength;
69 __u8 bDescriptorType;
70 __u8 bDescriptorSubType;
71
72 __u8 bmCapabilities;
73#define USB_CDC_CALL_MGMT_CAP_CALL_MGMT 0x01
74#define USB_CDC_CALL_MGMT_CAP_DATA_INTF 0x02
75
76 __u8 bDataInterface;
77} __attribute__ ((packed));
78
79/* "Abstract Control Management Descriptor" from CDC spec 5.2.3.3 */
80struct usb_cdc_acm_descriptor {
81 __u8 bLength;
82 __u8 bDescriptorType;
83 __u8 bDescriptorSubType;
84
85 __u8 bmCapabilities;
86} __attribute__ ((packed));
87
88/* capabilities from 5.2.3.3 */
89
90#define USB_CDC_COMM_FEATURE 0x01
91#define USB_CDC_CAP_LINE 0x02
92#define USB_CDC_CAP_BRK 0x04
93#define USB_CDC_CAP_NOTIFY 0x08
94
95/* "Union Functional Descriptor" from CDC spec 5.2.3.8 */
96struct usb_cdc_union_desc {
97 __u8 bLength;
98 __u8 bDescriptorType;
99 __u8 bDescriptorSubType;
100
101 __u8 bMasterInterface0;
102 __u8 bSlaveInterface0;
103 /* ... and there could be other slave interfaces */
104} __attribute__ ((packed));
105
106/* "Country Selection Functional Descriptor" from CDC spec 5.2.3.9 */
107struct usb_cdc_country_functional_desc {
108 __u8 bLength;
109 __u8 bDescriptorType;
110 __u8 bDescriptorSubType;
111
112 __u8 iCountryCodeRelDate;
113 __le16 wCountyCode0;
114 /* ... and there can be a lot of country codes */
115} __attribute__ ((packed));
116
117/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */
118struct usb_cdc_network_terminal_desc {
119 __u8 bLength;
120 __u8 bDescriptorType;
121 __u8 bDescriptorSubType;
122
123 __u8 bEntityId;
124 __u8 iName;
125 __u8 bChannelIndex;
126 __u8 bPhysicalInterface;
127} __attribute__ ((packed));
128
129/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */
130struct usb_cdc_ether_desc {
131 __u8 bLength;
132 __u8 bDescriptorType;
133 __u8 bDescriptorSubType;
134
135 __u8 iMACAddress;
136 __le32 bmEthernetStatistics;
137 __le16 wMaxSegmentSize;
138 __le16 wNumberMCFilters;
139 __u8 bNumberPowerFilters;
140} __attribute__ ((packed));
141
142/* "Telephone Control Model Functional Descriptor" from CDC WMC spec 6.3..3 */
143struct usb_cdc_dmm_desc {
144 __u8 bFunctionLength;
145 __u8 bDescriptorType;
146 __u8 bDescriptorSubtype;
147 __u16 bcdVersion;
148 __le16 wMaxCommand;
149} __attribute__ ((packed));
150
151/* "MDLM Functional Descriptor" from CDC WMC spec 6.7.2.3 */
152struct usb_cdc_mdlm_desc {
153 __u8 bLength;
154 __u8 bDescriptorType;
155 __u8 bDescriptorSubType;
156
157 __le16 bcdVersion;
158 __u8 bGUID[16];
159} __attribute__ ((packed));
160
161/* "MDLM Detail Functional Descriptor" from CDC WMC spec 6.7.2.4 */
162struct usb_cdc_mdlm_detail_desc {
163 __u8 bLength;
164 __u8 bDescriptorType;
165 __u8 bDescriptorSubType;
166
167 /* type is associated with mdlm_desc.bGUID */
168 __u8 bGuidDescriptorType;
169 __u8 bDetailData[0];
170} __attribute__ ((packed));
171
172/* "OBEX Control Model Functional Descriptor" */
173struct usb_cdc_obex_desc {
174 __u8 bLength;
175 __u8 bDescriptorType;
176 __u8 bDescriptorSubType;
177
178 __le16 bcdVersion;
179} __attribute__ ((packed));
180
181/* "NCM Control Model Functional Descriptor" */
182struct usb_cdc_ncm_desc {
183 __u8 bLength;
184 __u8 bDescriptorType;
185 __u8 bDescriptorSubType;
186
187 __le16 bcdNcmVersion;
188 __u8 bmNetworkCapabilities;
189} __attribute__ ((packed));
190/*-------------------------------------------------------------------------*/
191
192/*
193 * Class-Specific Control Requests (6.2)
194 *
195 * section 3.6.2.1 table 4 has the ACM profile, for modems.
196 * section 3.8.2 table 10 has the ethernet profile.
197 *
198 * Microsoft's RNDIS stack for Ethernet is a vendor-specific CDC ACM variant,
199 * heavily dependent on the encapsulated (proprietary) command mechanism.
200 */
201
202#define USB_CDC_SEND_ENCAPSULATED_COMMAND 0x00
203#define USB_CDC_GET_ENCAPSULATED_RESPONSE 0x01
204#define USB_CDC_REQ_SET_LINE_CODING 0x20
205#define USB_CDC_REQ_GET_LINE_CODING 0x21
206#define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22
207#define USB_CDC_REQ_SEND_BREAK 0x23
208#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40
209#define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41
210#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
211#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43
212#define USB_CDC_GET_ETHERNET_STATISTIC 0x44
213#define USB_CDC_GET_NTB_PARAMETERS 0x80
214#define USB_CDC_GET_NET_ADDRESS 0x81
215#define USB_CDC_SET_NET_ADDRESS 0x82
216#define USB_CDC_GET_NTB_FORMAT 0x83
217#define USB_CDC_SET_NTB_FORMAT 0x84
218#define USB_CDC_GET_NTB_INPUT_SIZE 0x85
219#define USB_CDC_SET_NTB_INPUT_SIZE 0x86
220#define USB_CDC_GET_MAX_DATAGRAM_SIZE 0x87
221#define USB_CDC_SET_MAX_DATAGRAM_SIZE 0x88
222#define USB_CDC_GET_CRC_MODE 0x89
223#define USB_CDC_SET_CRC_MODE 0x8a
224
225/* Line Coding Structure from CDC spec 6.2.13 */
226struct usb_cdc_line_coding {
227 __le32 dwDTERate;
228 __u8 bCharFormat;
229#define USB_CDC_1_STOP_BITS 0
230#define USB_CDC_1_5_STOP_BITS 1
231#define USB_CDC_2_STOP_BITS 2
232
233 __u8 bParityType;
234#define USB_CDC_NO_PARITY 0
235#define USB_CDC_ODD_PARITY 1
236#define USB_CDC_EVEN_PARITY 2
237#define USB_CDC_MARK_PARITY 3
238#define USB_CDC_SPACE_PARITY 4
239
240 __u8 bDataBits;
241} __attribute__ ((packed));
242
243/* table 62; bits in multicast filter */
244#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0)
245#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */
246#define USB_CDC_PACKET_TYPE_DIRECTED (1 << 2)
247#define USB_CDC_PACKET_TYPE_BROADCAST (1 << 3)
248#define USB_CDC_PACKET_TYPE_MULTICAST (1 << 4) /* filtered */
249
250
251/*-------------------------------------------------------------------------*/
252
253/*
254 * Class-Specific Notifications (6.3) sent by interrupt transfers
255 *
256 * section 3.8.2 table 11 of the CDC spec lists Ethernet notifications
257 * section 3.6.2.1 table 5 specifies ACM notifications, accepted by RNDIS
258 * RNDIS also defines its own bit-incompatible notifications
259 */
260
261#define USB_CDC_NOTIFY_NETWORK_CONNECTION 0x00
262#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE 0x01
263#define USB_CDC_NOTIFY_SERIAL_STATE 0x20
264#define USB_CDC_NOTIFY_SPEED_CHANGE 0x2a
265
266struct usb_cdc_notification {
267 __u8 bmRequestType;
268 __u8 bNotificationType;
269 __le16 wValue;
270 __le16 wIndex;
271 __le16 wLength;
272} __attribute__ ((packed));
273
274struct usb_cdc_speed_change {
275 __le32 DLBitRRate; /* contains the downlink bit rate (IN pipe) */
276 __le32 ULBitRate; /* contains the uplink bit rate (OUT pipe) */
277} __attribute__ ((packed));
278
279/*-------------------------------------------------------------------------*/
280
281/*
282 * Class Specific structures and constants
283 *
284 * CDC NCM NTB parameters structure, CDC NCM subclass 6.2.1
285 *
286 */
287
288struct usb_cdc_ncm_ntb_parameters {
289 __le16 wLength;
290 __le16 bmNtbFormatsSupported;
291 __le32 dwNtbInMaxSize;
292 __le16 wNdpInDivisor;
293 __le16 wNdpInPayloadRemainder;
294 __le16 wNdpInAlignment;
295 __le16 wPadding1;
296 __le32 dwNtbOutMaxSize;
297 __le16 wNdpOutDivisor;
298 __le16 wNdpOutPayloadRemainder;
299 __le16 wNdpOutAlignment;
300 __le16 wNtbOutMaxDatagrams;
301} __attribute__ ((packed));
302
303/*
304 * CDC NCM transfer headers, CDC NCM subclass 3.2
305 */
306
307#define USB_CDC_NCM_NTH16_SIGN 0x484D434E /* NCMH */
308#define USB_CDC_NCM_NTH32_SIGN 0x686D636E /* ncmh */
309
310struct usb_cdc_ncm_nth16 {
311 __le32 dwSignature;
312 __le16 wHeaderLength;
313 __le16 wSequence;
314 __le16 wBlockLength;
315 __le16 wNdpIndex;
316} __attribute__ ((packed));
317
318struct usb_cdc_ncm_nth32 {
319 __le32 dwSignature;
320 __le16 wHeaderLength;
321 __le16 wSequence;
322 __le32 dwBlockLength;
323 __le32 dwNdpIndex;
324} __attribute__ ((packed));
325
326/*
327 * CDC NCM datagram pointers, CDC NCM subclass 3.3
328 */
329
330#define USB_CDC_NCM_NDP16_CRC_SIGN 0x314D434E /* NCM1 */
331#define USB_CDC_NCM_NDP16_NOCRC_SIGN 0x304D434E /* NCM0 */
332#define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */
333#define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */
334
335/* 16-bit NCM Datagram Pointer Entry */
336struct usb_cdc_ncm_dpe16 {
337 __le16 wDatagramIndex;
338 __le16 wDatagramLength;
339} __attribute__((__packed__));
340
341/* 16-bit NCM Datagram Pointer Table */
342struct usb_cdc_ncm_ndp16 {
343 __le32 dwSignature;
344 __le16 wLength;
345 __le16 wNextNdpIndex;
346 struct usb_cdc_ncm_dpe16 dpe16[0];
347} __attribute__ ((packed));
348
349/* 32-bit NCM Datagram Pointer Entry */
350struct usb_cdc_ncm_dpe32 {
351 __le32 dwDatagramIndex;
352 __le32 dwDatagramLength;
353} __attribute__((__packed__));
354
355/* 32-bit NCM Datagram Pointer Table */
356struct usb_cdc_ncm_ndp32 {
357 __le32 dwSignature;
358 __le16 wLength;
359 __le16 wReserved6;
360 __le32 dwNextNdpIndex;
361 __le32 dwReserved12;
362 struct usb_cdc_ncm_dpe32 dpe32[0];
363} __attribute__ ((packed));
364
365/* CDC NCM subclass 3.2.1 and 3.2.2 */
366#define USB_CDC_NCM_NDP16_INDEX_MIN 0x000C
367#define USB_CDC_NCM_NDP32_INDEX_MIN 0x0010
368
369/* CDC NCM subclass 3.3.3 Datagram Formatting */
370#define USB_CDC_NCM_DATAGRAM_FORMAT_CRC 0x30
371#define USB_CDC_NCM_DATAGRAM_FORMAT_NOCRC 0X31
372
373/* CDC NCM subclass 4.2 NCM Communications Interface Protocol Code */
374#define USB_CDC_NCM_PROTO_CODE_NO_ENCAP_COMMANDS 0x00
375#define USB_CDC_NCM_PROTO_CODE_EXTERN_PROTO 0xFE
376
377/* CDC NCM subclass 5.2.1 NCM Functional Descriptor, bmNetworkCapabilities */
378#define USB_CDC_NCM_NCAP_ETH_FILTER (1 << 0)
379#define USB_CDC_NCM_NCAP_NET_ADDRESS (1 << 1)
380#define USB_CDC_NCM_NCAP_ENCAP_COMMAND (1 << 2)
381#define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE (1 << 3)
382#define USB_CDC_NCM_NCAP_CRC_MODE (1 << 4)
383#define USB_CDC_NCM_NCAP_NTB_INPUT_SIZE (1 << 5)
384
385/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
386#define USB_CDC_NCM_NTB16_SUPPORTED (1 << 0)
387#define USB_CDC_NCM_NTB32_SUPPORTED (1 << 1)
388
389/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
390#define USB_CDC_NCM_NDP_ALIGN_MIN_SIZE 0x04
391#define USB_CDC_NCM_NTB_MAX_LENGTH 0x1C
392
393/* CDC NCM subclass 6.2.5 SetNtbFormat */
394#define USB_CDC_NCM_NTB16_FORMAT 0x00
395#define USB_CDC_NCM_NTB32_FORMAT 0x01
396
397/* CDC NCM subclass 6.2.7 SetNtbInputSize */
398#define USB_CDC_NCM_NTB_MIN_IN_SIZE 2048
399#define USB_CDC_NCM_NTB_MIN_OUT_SIZE 2048
400
401/* NTB Input Size Structure */
402struct usb_cdc_ncm_ndp_input_size {
403 __le32 dwNtbInMaxSize;
404 __le16 wNtbInMaxDatagrams;
405 __le16 wReserved;
406} __attribute__ ((packed));
407
408/* CDC NCM subclass 6.2.11 SetCrcMode */
409#define USB_CDC_NCM_CRC_NOT_APPENDED 0x00
410#define USB_CDC_NCM_CRC_APPENDED 0x01
411
412#endif /* __LINUX_USB_CDC_H */
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h
deleted file mode 100644
index 7692dc69ccf7..000000000000
--- a/include/linux/usb/ch11.h
+++ /dev/null
@@ -1,266 +0,0 @@
1/*
2 * This file holds Hub protocol constants and data structures that are
3 * defined in chapter 11 (Hub Specification) of the USB 2.0 specification.
4 *
5 * It is used/shared between the USB core, the HCDs and couple of other USB
6 * drivers.
7 */
8
9#ifndef __LINUX_CH11_H
10#define __LINUX_CH11_H
11
12#include <linux/types.h> /* __u8 etc */
13
14/*
15 * Hub request types
16 */
17
18#define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
19#define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
20
21/*
22 * Hub class requests
23 * See USB 2.0 spec Table 11-16
24 */
25#define HUB_CLEAR_TT_BUFFER 8
26#define HUB_RESET_TT 9
27#define HUB_GET_TT_STATE 10
28#define HUB_STOP_TT 11
29
30/*
31 * Hub class additional requests defined by USB 3.0 spec
32 * See USB 3.0 spec Table 10-6
33 */
34#define HUB_SET_DEPTH 12
35#define HUB_GET_PORT_ERR_COUNT 13
36
37/*
38 * Hub Class feature numbers
39 * See USB 2.0 spec Table 11-17
40 */
41#define C_HUB_LOCAL_POWER 0
42#define C_HUB_OVER_CURRENT 1
43
44/*
45 * Port feature numbers
46 * See USB 2.0 spec Table 11-17
47 */
48#define USB_PORT_FEAT_CONNECTION 0
49#define USB_PORT_FEAT_ENABLE 1
50#define USB_PORT_FEAT_SUSPEND 2 /* L2 suspend */
51#define USB_PORT_FEAT_OVER_CURRENT 3
52#define USB_PORT_FEAT_RESET 4
53#define USB_PORT_FEAT_L1 5 /* L1 suspend */
54#define USB_PORT_FEAT_POWER 8
55#define USB_PORT_FEAT_LOWSPEED 9 /* Should never be used */
56#define USB_PORT_FEAT_C_CONNECTION 16
57#define USB_PORT_FEAT_C_ENABLE 17
58#define USB_PORT_FEAT_C_SUSPEND 18
59#define USB_PORT_FEAT_C_OVER_CURRENT 19
60#define USB_PORT_FEAT_C_RESET 20
61#define USB_PORT_FEAT_TEST 21
62#define USB_PORT_FEAT_INDICATOR 22
63#define USB_PORT_FEAT_C_PORT_L1 23
64
65/*
66 * Port feature selectors added by USB 3.0 spec.
67 * See USB 3.0 spec Table 10-7
68 */
69#define USB_PORT_FEAT_LINK_STATE 5
70#define USB_PORT_FEAT_U1_TIMEOUT 23
71#define USB_PORT_FEAT_U2_TIMEOUT 24
72#define USB_PORT_FEAT_C_PORT_LINK_STATE 25
73#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR 26
74#define USB_PORT_FEAT_REMOTE_WAKE_MASK 27
75#define USB_PORT_FEAT_BH_PORT_RESET 28
76#define USB_PORT_FEAT_C_BH_PORT_RESET 29
77#define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30
78
79#define USB_PORT_LPM_TIMEOUT(p) (((p) & 0xff) << 8)
80
81/* USB 3.0 hub remote wake mask bits, see table 10-14 */
82#define USB_PORT_FEAT_REMOTE_WAKE_CONNECT (1 << 8)
83#define USB_PORT_FEAT_REMOTE_WAKE_DISCONNECT (1 << 9)
84#define USB_PORT_FEAT_REMOTE_WAKE_OVER_CURRENT (1 << 10)
85
86/*
87 * Hub Status and Hub Change results
88 * See USB 2.0 spec Table 11-19 and Table 11-20
89 */
90struct usb_port_status {
91 __le16 wPortStatus;
92 __le16 wPortChange;
93} __attribute__ ((packed));
94
95/*
96 * wPortStatus bit field
97 * See USB 2.0 spec Table 11-21
98 */
99#define USB_PORT_STAT_CONNECTION 0x0001
100#define USB_PORT_STAT_ENABLE 0x0002
101#define USB_PORT_STAT_SUSPEND 0x0004
102#define USB_PORT_STAT_OVERCURRENT 0x0008
103#define USB_PORT_STAT_RESET 0x0010
104#define USB_PORT_STAT_L1 0x0020
105/* bits 6 to 7 are reserved */
106#define USB_PORT_STAT_POWER 0x0100
107#define USB_PORT_STAT_LOW_SPEED 0x0200
108#define USB_PORT_STAT_HIGH_SPEED 0x0400
109#define USB_PORT_STAT_TEST 0x0800
110#define USB_PORT_STAT_INDICATOR 0x1000
111/* bits 13 to 15 are reserved */
112
113/*
114 * Additions to wPortStatus bit field from USB 3.0
115 * See USB 3.0 spec Table 10-10
116 */
117#define USB_PORT_STAT_LINK_STATE 0x01e0
118#define USB_SS_PORT_STAT_POWER 0x0200
119#define USB_SS_PORT_STAT_SPEED 0x1c00
120#define USB_PORT_STAT_SPEED_5GBPS 0x0000
121/* Valid only if port is enabled */
122/* Bits that are the same from USB 2.0 */
123#define USB_SS_PORT_STAT_MASK (USB_PORT_STAT_CONNECTION | \
124 USB_PORT_STAT_ENABLE | \
125 USB_PORT_STAT_OVERCURRENT | \
126 USB_PORT_STAT_RESET)
127
128/*
129 * Definitions for PORT_LINK_STATE values
130 * (bits 5-8) in wPortStatus
131 */
132#define USB_SS_PORT_LS_U0 0x0000
133#define USB_SS_PORT_LS_U1 0x0020
134#define USB_SS_PORT_LS_U2 0x0040
135#define USB_SS_PORT_LS_U3 0x0060
136#define USB_SS_PORT_LS_SS_DISABLED 0x0080
137#define USB_SS_PORT_LS_RX_DETECT 0x00a0
138#define USB_SS_PORT_LS_SS_INACTIVE 0x00c0
139#define USB_SS_PORT_LS_POLLING 0x00e0
140#define USB_SS_PORT_LS_RECOVERY 0x0100
141#define USB_SS_PORT_LS_HOT_RESET 0x0120
142#define USB_SS_PORT_LS_COMP_MOD 0x0140
143#define USB_SS_PORT_LS_LOOPBACK 0x0160
144
145/*
146 * wPortChange bit field
147 * See USB 2.0 spec Table 11-22 and USB 2.0 LPM ECN Table-4.10
148 * Bits 0 to 5 shown, bits 6 to 15 are reserved
149 */
150#define USB_PORT_STAT_C_CONNECTION 0x0001
151#define USB_PORT_STAT_C_ENABLE 0x0002
152#define USB_PORT_STAT_C_SUSPEND 0x0004
153#define USB_PORT_STAT_C_OVERCURRENT 0x0008
154#define USB_PORT_STAT_C_RESET 0x0010
155#define USB_PORT_STAT_C_L1 0x0020
156/*
157 * USB 3.0 wPortChange bit fields
158 * See USB 3.0 spec Table 10-11
159 */
160#define USB_PORT_STAT_C_BH_RESET 0x0020
161#define USB_PORT_STAT_C_LINK_STATE 0x0040
162#define USB_PORT_STAT_C_CONFIG_ERROR 0x0080
163
164/*
165 * wHubCharacteristics (masks)
166 * See USB 2.0 spec Table 11-13, offset 3
167 */
168#define HUB_CHAR_LPSM 0x0003 /* Logical Power Switching Mode mask */
169#define HUB_CHAR_COMMON_LPSM 0x0000 /* All ports power control at once */
170#define HUB_CHAR_INDV_PORT_LPSM 0x0001 /* per-port power control */
171#define HUB_CHAR_NO_LPSM 0x0002 /* no power switching */
172
173#define HUB_CHAR_COMPOUND 0x0004 /* hub is part of a compound device */
174
175#define HUB_CHAR_OCPM 0x0018 /* Over-Current Protection Mode mask */
176#define HUB_CHAR_COMMON_OCPM 0x0000 /* All ports Over-Current reporting */
177#define HUB_CHAR_INDV_PORT_OCPM 0x0008 /* per-port Over-current reporting */
178#define HUB_CHAR_NO_OCPM 0x0010 /* No Over-current Protection support */
179
180#define HUB_CHAR_TTTT 0x0060 /* TT Think Time mask */
181#define HUB_CHAR_PORTIND 0x0080 /* per-port indicators (LEDs) */
182
183struct usb_hub_status {
184 __le16 wHubStatus;
185 __le16 wHubChange;
186} __attribute__ ((packed));
187
188/*
189 * Hub Status & Hub Change bit masks
190 * See USB 2.0 spec Table 11-19 and Table 11-20
191 * Bits 0 and 1 for wHubStatus and wHubChange
192 * Bits 2 to 15 are reserved for both
193 */
194#define HUB_STATUS_LOCAL_POWER 0x0001
195#define HUB_STATUS_OVERCURRENT 0x0002
196#define HUB_CHANGE_LOCAL_POWER 0x0001
197#define HUB_CHANGE_OVERCURRENT 0x0002
198
199
200/*
201 * Hub descriptor
202 * See USB 2.0 spec Table 11-13
203 */
204
205#define USB_DT_HUB (USB_TYPE_CLASS | 0x09)
206#define USB_DT_SS_HUB (USB_TYPE_CLASS | 0x0a)
207#define USB_DT_HUB_NONVAR_SIZE 7
208#define USB_DT_SS_HUB_SIZE 12
209
210/*
211 * Hub Device descriptor
212 * USB Hub class device protocols
213 */
214
215#define USB_HUB_PR_FS 0 /* Full speed hub */
216#define USB_HUB_PR_HS_NO_TT 0 /* Hi-speed hub without TT */
217#define USB_HUB_PR_HS_SINGLE_TT 1 /* Hi-speed hub with single TT */
218#define USB_HUB_PR_HS_MULTI_TT 2 /* Hi-speed hub with multiple TT */
219#define USB_HUB_PR_SS 3 /* Super speed hub */
220
221struct usb_hub_descriptor {
222 __u8 bDescLength;
223 __u8 bDescriptorType;
224 __u8 bNbrPorts;
225 __le16 wHubCharacteristics;
226 __u8 bPwrOn2PwrGood;
227 __u8 bHubContrCurrent;
228
229 /* 2.0 and 3.0 hubs differ here */
230 union {
231 struct {
232 /* add 1 bit for hub status change; round to bytes */
233 __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
234 __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
235 } __attribute__ ((packed)) hs;
236
237 struct {
238 __u8 bHubHdrDecLat;
239 __le16 wHubDelay;
240 __le16 DeviceRemovable;
241 } __attribute__ ((packed)) ss;
242 } u;
243} __attribute__ ((packed));
244
245/* port indicator status selectors, tables 11-7 and 11-25 */
246#define HUB_LED_AUTO 0
247#define HUB_LED_AMBER 1
248#define HUB_LED_GREEN 2
249#define HUB_LED_OFF 3
250
251enum hub_led_mode {
252 INDICATOR_AUTO = 0,
253 INDICATOR_CYCLE,
254 /* software blinks for attention: software, hardware, reserved */
255 INDICATOR_GREEN_BLINK, INDICATOR_GREEN_BLINK_OFF,
256 INDICATOR_AMBER_BLINK, INDICATOR_AMBER_BLINK_OFF,
257 INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF
258} __attribute__ ((packed));
259
260/* Transaction Translator Think Times, in bits */
261#define HUB_TTTT_8_BITS 0x00
262#define HUB_TTTT_16_BITS 0x20
263#define HUB_TTTT_24_BITS 0x40
264#define HUB_TTTT_32_BITS 0x60
265
266#endif /* __LINUX_CH11_H */
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index d1d732c2838d..9c210f2283df 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -29,887 +29,11 @@
29 * someone that the two other points are non-issues for that 29 * someone that the two other points are non-issues for that
30 * particular descriptor type. 30 * particular descriptor type.
31 */ 31 */
32
33#ifndef __LINUX_USB_CH9_H 32#ifndef __LINUX_USB_CH9_H
34#define __LINUX_USB_CH9_H 33#define __LINUX_USB_CH9_H
35 34
36#include <linux/types.h> /* __u8 etc */ 35#include <uapi/linux/usb/ch9.h>
37#include <asm/byteorder.h> /* le16_to_cpu */
38
39/*-------------------------------------------------------------------------*/
40
41/* CONTROL REQUEST SUPPORT */
42
43/*
44 * USB directions
45 *
46 * This bit flag is used in endpoint descriptors' bEndpointAddress field.
47 * It's also one of three fields in control requests bRequestType.
48 */
49#define USB_DIR_OUT 0 /* to device */
50#define USB_DIR_IN 0x80 /* to host */
51
52/*
53 * USB types, the second of three bRequestType fields
54 */
55#define USB_TYPE_MASK (0x03 << 5)
56#define USB_TYPE_STANDARD (0x00 << 5)
57#define USB_TYPE_CLASS (0x01 << 5)
58#define USB_TYPE_VENDOR (0x02 << 5)
59#define USB_TYPE_RESERVED (0x03 << 5)
60
61/*
62 * USB recipients, the third of three bRequestType fields
63 */
64#define USB_RECIP_MASK 0x1f
65#define USB_RECIP_DEVICE 0x00
66#define USB_RECIP_INTERFACE 0x01
67#define USB_RECIP_ENDPOINT 0x02
68#define USB_RECIP_OTHER 0x03
69/* From Wireless USB 1.0 */
70#define USB_RECIP_PORT 0x04
71#define USB_RECIP_RPIPE 0x05
72
73/*
74 * Standard requests, for the bRequest field of a SETUP packet.
75 *
76 * These are qualified by the bRequestType field, so that for example
77 * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
78 * by a GET_STATUS request.
79 */
80#define USB_REQ_GET_STATUS 0x00
81#define USB_REQ_CLEAR_FEATURE 0x01
82#define USB_REQ_SET_FEATURE 0x03
83#define USB_REQ_SET_ADDRESS 0x05
84#define USB_REQ_GET_DESCRIPTOR 0x06
85#define USB_REQ_SET_DESCRIPTOR 0x07
86#define USB_REQ_GET_CONFIGURATION 0x08
87#define USB_REQ_SET_CONFIGURATION 0x09
88#define USB_REQ_GET_INTERFACE 0x0A
89#define USB_REQ_SET_INTERFACE 0x0B
90#define USB_REQ_SYNCH_FRAME 0x0C
91#define USB_REQ_SET_SEL 0x30
92#define USB_REQ_SET_ISOCH_DELAY 0x31
93
94#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */
95#define USB_REQ_GET_ENCRYPTION 0x0E
96#define USB_REQ_RPIPE_ABORT 0x0E
97#define USB_REQ_SET_HANDSHAKE 0x0F
98#define USB_REQ_RPIPE_RESET 0x0F
99#define USB_REQ_GET_HANDSHAKE 0x10
100#define USB_REQ_SET_CONNECTION 0x11
101#define USB_REQ_SET_SECURITY_DATA 0x12
102#define USB_REQ_GET_SECURITY_DATA 0x13
103#define USB_REQ_SET_WUSB_DATA 0x14
104#define USB_REQ_LOOPBACK_DATA_WRITE 0x15
105#define USB_REQ_LOOPBACK_DATA_READ 0x16
106#define USB_REQ_SET_INTERFACE_DS 0x17
107
108/* The Link Power Management (LPM) ECN defines USB_REQ_TEST_AND_SET command,
109 * used by hubs to put ports into a new L1 suspend state, except that it
110 * forgot to define its number ...
111 */
112
113/*
114 * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
115 * are read as a bit array returned by USB_REQ_GET_STATUS. (So there
116 * are at most sixteen features of each type.) Hubs may also support a
117 * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
118 */
119#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
120#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
121#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */
122#define USB_DEVICE_BATTERY 2 /* (wireless) */
123#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */
124#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/
125#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */
126#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
127#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
128
129/*
130 * Test Mode Selectors
131 * See USB 2.0 spec Table 9-7
132 */
133#define TEST_J 1
134#define TEST_K 2
135#define TEST_SE0_NAK 3
136#define TEST_PACKET 4
137#define TEST_FORCE_EN 5
138
139/*
140 * New Feature Selectors as added by USB 3.0
141 * See USB 3.0 spec Table 9-6
142 */
143#define USB_DEVICE_U1_ENABLE 48 /* dev may initiate U1 transition */
144#define USB_DEVICE_U2_ENABLE 49 /* dev may initiate U2 transition */
145#define USB_DEVICE_LTM_ENABLE 50 /* dev may send LTM */
146#define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */
147
148#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00
149/*
150 * Suspend Options, Table 9-7 USB 3.0 spec
151 */
152#define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0))
153#define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1))
154
155#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
156
157/* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
158#define USB_DEV_STAT_U1_ENABLED 2 /* transition into U1 state */
159#define USB_DEV_STAT_U2_ENABLED 3 /* transition into U2 state */
160#define USB_DEV_STAT_LTM_ENABLED 4 /* Latency tolerance messages */
161
162/**
163 * struct usb_ctrlrequest - SETUP data for a USB device control request
164 * @bRequestType: matches the USB bmRequestType field
165 * @bRequest: matches the USB bRequest field
166 * @wValue: matches the USB wValue field (le16 byte order)
167 * @wIndex: matches the USB wIndex field (le16 byte order)
168 * @wLength: matches the USB wLength field (le16 byte order)
169 *
170 * This structure is used to send control requests to a USB device. It matches
171 * the different fields of the USB 2.0 Spec section 9.3, table 9-2. See the
172 * USB spec for a fuller description of the different fields, and what they are
173 * used for.
174 *
175 * Note that the driver for any interface can issue control requests.
176 * For most devices, interfaces don't coordinate with each other, so
177 * such requests may be made at any time.
178 */
179struct usb_ctrlrequest {
180 __u8 bRequestType;
181 __u8 bRequest;
182 __le16 wValue;
183 __le16 wIndex;
184 __le16 wLength;
185} __attribute__ ((packed));
186
187/*-------------------------------------------------------------------------*/
188
189/*
190 * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or
191 * (rarely) accepted by SET_DESCRIPTOR.
192 *
193 * Note that all multi-byte values here are encoded in little endian
194 * byte order "on the wire". Within the kernel and when exposed
195 * through the Linux-USB APIs, they are not converted to cpu byte
196 * order; it is the responsibility of the client code to do this.
197 * The single exception is when device and configuration descriptors (but
198 * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD);
199 * in this case the fields are converted to host endianness by the kernel.
200 */
201
202/*
203 * Descriptor types ... USB 2.0 spec table 9.5
204 */
205#define USB_DT_DEVICE 0x01
206#define USB_DT_CONFIG 0x02
207#define USB_DT_STRING 0x03
208#define USB_DT_INTERFACE 0x04
209#define USB_DT_ENDPOINT 0x05
210#define USB_DT_DEVICE_QUALIFIER 0x06
211#define USB_DT_OTHER_SPEED_CONFIG 0x07
212#define USB_DT_INTERFACE_POWER 0x08
213/* these are from a minor usb 2.0 revision (ECN) */
214#define USB_DT_OTG 0x09
215#define USB_DT_DEBUG 0x0a
216#define USB_DT_INTERFACE_ASSOCIATION 0x0b
217/* these are from the Wireless USB spec */
218#define USB_DT_SECURITY 0x0c
219#define USB_DT_KEY 0x0d
220#define USB_DT_ENCRYPTION_TYPE 0x0e
221#define USB_DT_BOS 0x0f
222#define USB_DT_DEVICE_CAPABILITY 0x10
223#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
224#define USB_DT_WIRE_ADAPTER 0x21
225#define USB_DT_RPIPE 0x22
226#define USB_DT_CS_RADIO_CONTROL 0x23
227/* From the T10 UAS specification */
228#define USB_DT_PIPE_USAGE 0x24
229/* From the USB 3.0 spec */
230#define USB_DT_SS_ENDPOINT_COMP 0x30
231
232/* Conventional codes for class-specific descriptors. The convention is
233 * defined in the USB "Common Class" Spec (3.11). Individual class specs
234 * are authoritative for their usage, not the "common class" writeup.
235 */
236#define USB_DT_CS_DEVICE (USB_TYPE_CLASS | USB_DT_DEVICE)
237#define USB_DT_CS_CONFIG (USB_TYPE_CLASS | USB_DT_CONFIG)
238#define USB_DT_CS_STRING (USB_TYPE_CLASS | USB_DT_STRING)
239#define USB_DT_CS_INTERFACE (USB_TYPE_CLASS | USB_DT_INTERFACE)
240#define USB_DT_CS_ENDPOINT (USB_TYPE_CLASS | USB_DT_ENDPOINT)
241
242/* All standard descriptors have these 2 fields at the beginning */
243struct usb_descriptor_header {
244 __u8 bLength;
245 __u8 bDescriptorType;
246} __attribute__ ((packed));
247
248
249/*-------------------------------------------------------------------------*/
250
251/* USB_DT_DEVICE: Device descriptor */
252struct usb_device_descriptor {
253 __u8 bLength;
254 __u8 bDescriptorType;
255
256 __le16 bcdUSB;
257 __u8 bDeviceClass;
258 __u8 bDeviceSubClass;
259 __u8 bDeviceProtocol;
260 __u8 bMaxPacketSize0;
261 __le16 idVendor;
262 __le16 idProduct;
263 __le16 bcdDevice;
264 __u8 iManufacturer;
265 __u8 iProduct;
266 __u8 iSerialNumber;
267 __u8 bNumConfigurations;
268} __attribute__ ((packed));
269
270#define USB_DT_DEVICE_SIZE 18
271
272
273/*
274 * Device and/or Interface Class codes
275 * as found in bDeviceClass or bInterfaceClass
276 * and defined by www.usb.org documents
277 */
278#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */
279#define USB_CLASS_AUDIO 1
280#define USB_CLASS_COMM 2
281#define USB_CLASS_HID 3
282#define USB_CLASS_PHYSICAL 5
283#define USB_CLASS_STILL_IMAGE 6
284#define USB_CLASS_PRINTER 7
285#define USB_CLASS_MASS_STORAGE 8
286#define USB_CLASS_HUB 9
287#define USB_CLASS_CDC_DATA 0x0a
288#define USB_CLASS_CSCID 0x0b /* chip+ smart card */
289#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
290#define USB_CLASS_VIDEO 0x0e
291#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
292#define USB_CLASS_MISC 0xef
293#define USB_CLASS_APP_SPEC 0xfe
294#define USB_CLASS_VENDOR_SPEC 0xff
295
296#define USB_SUBCLASS_VENDOR_SPEC 0xff
297
298/*-------------------------------------------------------------------------*/
299
300/* USB_DT_CONFIG: Configuration descriptor information.
301 *
302 * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
303 * descriptor type is different. Highspeed-capable devices can look
304 * different depending on what speed they're currently running. Only
305 * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG
306 * descriptors.
307 */
308struct usb_config_descriptor {
309 __u8 bLength;
310 __u8 bDescriptorType;
311
312 __le16 wTotalLength;
313 __u8 bNumInterfaces;
314 __u8 bConfigurationValue;
315 __u8 iConfiguration;
316 __u8 bmAttributes;
317 __u8 bMaxPower;
318} __attribute__ ((packed));
319
320#define USB_DT_CONFIG_SIZE 9
321
322/* from config descriptor bmAttributes */
323#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */
324#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */
325#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */
326#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
327
328/*-------------------------------------------------------------------------*/
329
330/* USB_DT_STRING: String descriptor */
331struct usb_string_descriptor {
332 __u8 bLength;
333 __u8 bDescriptorType;
334
335 __le16 wData[1]; /* UTF-16LE encoded */
336} __attribute__ ((packed));
337
338/* note that "string" zero is special, it holds language codes that
339 * the device supports, not Unicode characters.
340 */
341
342/*-------------------------------------------------------------------------*/
343
344/* USB_DT_INTERFACE: Interface descriptor */
345struct usb_interface_descriptor {
346 __u8 bLength;
347 __u8 bDescriptorType;
348
349 __u8 bInterfaceNumber;
350 __u8 bAlternateSetting;
351 __u8 bNumEndpoints;
352 __u8 bInterfaceClass;
353 __u8 bInterfaceSubClass;
354 __u8 bInterfaceProtocol;
355 __u8 iInterface;
356} __attribute__ ((packed));
357
358#define USB_DT_INTERFACE_SIZE 9
359
360/*-------------------------------------------------------------------------*/
361
362/* USB_DT_ENDPOINT: Endpoint descriptor */
363struct usb_endpoint_descriptor {
364 __u8 bLength;
365 __u8 bDescriptorType;
366
367 __u8 bEndpointAddress;
368 __u8 bmAttributes;
369 __le16 wMaxPacketSize;
370 __u8 bInterval;
371
372 /* NOTE: these two are _only_ in audio endpoints. */
373 /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
374 __u8 bRefresh;
375 __u8 bSynchAddress;
376} __attribute__ ((packed));
377
378#define USB_DT_ENDPOINT_SIZE 7
379#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */
380
381
382/*
383 * Endpoints
384 */
385#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */
386#define USB_ENDPOINT_DIR_MASK 0x80
387
388#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */
389#define USB_ENDPOINT_XFER_CONTROL 0
390#define USB_ENDPOINT_XFER_ISOC 1
391#define USB_ENDPOINT_XFER_BULK 2
392#define USB_ENDPOINT_XFER_INT 3
393#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
394
395/* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */
396#define USB_ENDPOINT_INTRTYPE 0x30
397#define USB_ENDPOINT_INTR_PERIODIC (0 << 4)
398#define USB_ENDPOINT_INTR_NOTIFICATION (1 << 4)
399
400#define USB_ENDPOINT_SYNCTYPE 0x0c
401#define USB_ENDPOINT_SYNC_NONE (0 << 2)
402#define USB_ENDPOINT_SYNC_ASYNC (1 << 2)
403#define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2)
404#define USB_ENDPOINT_SYNC_SYNC (3 << 2)
405
406#define USB_ENDPOINT_USAGE_MASK 0x30
407#define USB_ENDPOINT_USAGE_DATA 0x00
408#define USB_ENDPOINT_USAGE_FEEDBACK 0x10
409#define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20 /* Implicit feedback Data endpoint */
410
411/*-------------------------------------------------------------------------*/
412
413/**
414 * usb_endpoint_num - get the endpoint's number
415 * @epd: endpoint to be checked
416 *
417 * Returns @epd's number: 0 to 15.
418 */
419static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
420{
421 return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
422}
423
424/**
425 * usb_endpoint_type - get the endpoint's transfer type
426 * @epd: endpoint to be checked
427 *
428 * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according
429 * to @epd's transfer type.
430 */
431static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
432{
433 return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
434}
435
436/**
437 * usb_endpoint_dir_in - check if the endpoint has IN direction
438 * @epd: endpoint to be checked
439 *
440 * Returns true if the endpoint is of type IN, otherwise it returns false.
441 */
442static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
443{
444 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
445}
446
447/**
448 * usb_endpoint_dir_out - check if the endpoint has OUT direction
449 * @epd: endpoint to be checked
450 *
451 * Returns true if the endpoint is of type OUT, otherwise it returns false.
452 */
453static inline int usb_endpoint_dir_out(
454 const struct usb_endpoint_descriptor *epd)
455{
456 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
457}
458
459/**
460 * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
461 * @epd: endpoint to be checked
462 *
463 * Returns true if the endpoint is of type bulk, otherwise it returns false.
464 */
465static inline int usb_endpoint_xfer_bulk(
466 const struct usb_endpoint_descriptor *epd)
467{
468 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
469 USB_ENDPOINT_XFER_BULK);
470}
471
472/**
473 * usb_endpoint_xfer_control - check if the endpoint has control transfer type
474 * @epd: endpoint to be checked
475 *
476 * Returns true if the endpoint is of type control, otherwise it returns false.
477 */
478static inline int usb_endpoint_xfer_control(
479 const struct usb_endpoint_descriptor *epd)
480{
481 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
482 USB_ENDPOINT_XFER_CONTROL);
483}
484
485/**
486 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
487 * @epd: endpoint to be checked
488 *
489 * Returns true if the endpoint is of type interrupt, otherwise it returns
490 * false.
491 */
492static inline int usb_endpoint_xfer_int(
493 const struct usb_endpoint_descriptor *epd)
494{
495 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
496 USB_ENDPOINT_XFER_INT);
497}
498
499/**
500 * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
501 * @epd: endpoint to be checked
502 *
503 * Returns true if the endpoint is of type isochronous, otherwise it returns
504 * false.
505 */
506static inline int usb_endpoint_xfer_isoc(
507 const struct usb_endpoint_descriptor *epd)
508{
509 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
510 USB_ENDPOINT_XFER_ISOC);
511}
512
513/**
514 * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
515 * @epd: endpoint to be checked
516 *
517 * Returns true if the endpoint has bulk transfer type and IN direction,
518 * otherwise it returns false.
519 */
520static inline int usb_endpoint_is_bulk_in(
521 const struct usb_endpoint_descriptor *epd)
522{
523 return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd);
524}
525
526/**
527 * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
528 * @epd: endpoint to be checked
529 *
530 * Returns true if the endpoint has bulk transfer type and OUT direction,
531 * otherwise it returns false.
532 */
533static inline int usb_endpoint_is_bulk_out(
534 const struct usb_endpoint_descriptor *epd)
535{
536 return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd);
537}
538
539/**
540 * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
541 * @epd: endpoint to be checked
542 *
543 * Returns true if the endpoint has interrupt transfer type and IN direction,
544 * otherwise it returns false.
545 */
546static inline int usb_endpoint_is_int_in(
547 const struct usb_endpoint_descriptor *epd)
548{
549 return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd);
550}
551
552/**
553 * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
554 * @epd: endpoint to be checked
555 *
556 * Returns true if the endpoint has interrupt transfer type and OUT direction,
557 * otherwise it returns false.
558 */
559static inline int usb_endpoint_is_int_out(
560 const struct usb_endpoint_descriptor *epd)
561{
562 return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd);
563}
564
565/**
566 * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
567 * @epd: endpoint to be checked
568 *
569 * Returns true if the endpoint has isochronous transfer type and IN direction,
570 * otherwise it returns false.
571 */
572static inline int usb_endpoint_is_isoc_in(
573 const struct usb_endpoint_descriptor *epd)
574{
575 return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd);
576}
577
578/**
579 * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
580 * @epd: endpoint to be checked
581 *
582 * Returns true if the endpoint has isochronous transfer type and OUT direction,
583 * otherwise it returns false.
584 */
585static inline int usb_endpoint_is_isoc_out(
586 const struct usb_endpoint_descriptor *epd)
587{
588 return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
589}
590
591/**
592 * usb_endpoint_maxp - get endpoint's max packet size
593 * @epd: endpoint to be checked
594 *
595 * Returns @epd's max packet
596 */
597static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
598{
599 return __le16_to_cpu(epd->wMaxPacketSize);
600}
601
602static inline int usb_endpoint_interrupt_type(
603 const struct usb_endpoint_descriptor *epd)
604{
605 return epd->bmAttributes & USB_ENDPOINT_INTRTYPE;
606}
607
608/*-------------------------------------------------------------------------*/
609
610/* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */
611struct usb_ss_ep_comp_descriptor {
612 __u8 bLength;
613 __u8 bDescriptorType;
614
615 __u8 bMaxBurst;
616 __u8 bmAttributes;
617 __le16 wBytesPerInterval;
618} __attribute__ ((packed));
619
620#define USB_DT_SS_EP_COMP_SIZE 6
621
622/* Bits 4:0 of bmAttributes if this is a bulk endpoint */
623static inline int
624usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp)
625{
626 int max_streams;
627
628 if (!comp)
629 return 0;
630
631 max_streams = comp->bmAttributes & 0x1f;
632
633 if (!max_streams)
634 return 0;
635
636 max_streams = 1 << max_streams;
637
638 return max_streams;
639}
640
641/* Bits 1:0 of bmAttributes if this is an isoc endpoint */
642#define USB_SS_MULT(p) (1 + ((p) & 0x3))
643
644/*-------------------------------------------------------------------------*/
645
646/* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */
647struct usb_qualifier_descriptor {
648 __u8 bLength;
649 __u8 bDescriptorType;
650
651 __le16 bcdUSB;
652 __u8 bDeviceClass;
653 __u8 bDeviceSubClass;
654 __u8 bDeviceProtocol;
655 __u8 bMaxPacketSize0;
656 __u8 bNumConfigurations;
657 __u8 bRESERVED;
658} __attribute__ ((packed));
659
660
661/*-------------------------------------------------------------------------*/
662
663/* USB_DT_OTG (from OTG 1.0a supplement) */
664struct usb_otg_descriptor {
665 __u8 bLength;
666 __u8 bDescriptorType;
667
668 __u8 bmAttributes; /* support for HNP, SRP, etc */
669} __attribute__ ((packed));
670
671/* from usb_otg_descriptor.bmAttributes */
672#define USB_OTG_SRP (1 << 0)
673#define USB_OTG_HNP (1 << 1) /* swap host/device roles */
674
675/*-------------------------------------------------------------------------*/
676
677/* USB_DT_DEBUG: for special highspeed devices, replacing serial console */
678struct usb_debug_descriptor {
679 __u8 bLength;
680 __u8 bDescriptorType;
681
682 /* bulk endpoints with 8 byte maxpacket */
683 __u8 bDebugInEndpoint;
684 __u8 bDebugOutEndpoint;
685} __attribute__((packed));
686
687/*-------------------------------------------------------------------------*/
688
689/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
690struct usb_interface_assoc_descriptor {
691 __u8 bLength;
692 __u8 bDescriptorType;
693
694 __u8 bFirstInterface;
695 __u8 bInterfaceCount;
696 __u8 bFunctionClass;
697 __u8 bFunctionSubClass;
698 __u8 bFunctionProtocol;
699 __u8 iFunction;
700} __attribute__ ((packed));
701
702
703/*-------------------------------------------------------------------------*/
704
705/* USB_DT_SECURITY: group of wireless security descriptors, including
706 * encryption types available for setting up a CC/association.
707 */
708struct usb_security_descriptor {
709 __u8 bLength;
710 __u8 bDescriptorType;
711
712 __le16 wTotalLength;
713 __u8 bNumEncryptionTypes;
714} __attribute__((packed));
715
716/*-------------------------------------------------------------------------*/
717
718/* USB_DT_KEY: used with {GET,SET}_SECURITY_DATA; only public keys
719 * may be retrieved.
720 */
721struct usb_key_descriptor {
722 __u8 bLength;
723 __u8 bDescriptorType;
724
725 __u8 tTKID[3];
726 __u8 bReserved;
727 __u8 bKeyData[0];
728} __attribute__((packed));
729
730/*-------------------------------------------------------------------------*/
731
732/* USB_DT_ENCRYPTION_TYPE: bundled in DT_SECURITY groups */
733struct usb_encryption_descriptor {
734 __u8 bLength;
735 __u8 bDescriptorType;
736
737 __u8 bEncryptionType;
738#define USB_ENC_TYPE_UNSECURE 0
739#define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */
740#define USB_ENC_TYPE_CCM_1 2 /* aes128/cbc session */
741#define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */
742 __u8 bEncryptionValue; /* use in SET_ENCRYPTION */
743 __u8 bAuthKeyIndex;
744} __attribute__((packed));
745
746
747/*-------------------------------------------------------------------------*/
748
749/* USB_DT_BOS: group of device-level capabilities */
750struct usb_bos_descriptor {
751 __u8 bLength;
752 __u8 bDescriptorType;
753
754 __le16 wTotalLength;
755 __u8 bNumDeviceCaps;
756} __attribute__((packed));
757
758#define USB_DT_BOS_SIZE 5
759/*-------------------------------------------------------------------------*/
760
761/* USB_DT_DEVICE_CAPABILITY: grouped with BOS */
762struct usb_dev_cap_header {
763 __u8 bLength;
764 __u8 bDescriptorType;
765 __u8 bDevCapabilityType;
766} __attribute__((packed));
767
768#define USB_CAP_TYPE_WIRELESS_USB 1
769
770struct usb_wireless_cap_descriptor { /* Ultra Wide Band */
771 __u8 bLength;
772 __u8 bDescriptorType;
773 __u8 bDevCapabilityType;
774
775 __u8 bmAttributes;
776#define USB_WIRELESS_P2P_DRD (1 << 1)
777#define USB_WIRELESS_BEACON_MASK (3 << 2)
778#define USB_WIRELESS_BEACON_SELF (1 << 2)
779#define USB_WIRELESS_BEACON_DIRECTED (2 << 2)
780#define USB_WIRELESS_BEACON_NONE (3 << 2)
781 __le16 wPHYRates; /* bit rates, Mbps */
782#define USB_WIRELESS_PHY_53 (1 << 0) /* always set */
783#define USB_WIRELESS_PHY_80 (1 << 1)
784#define USB_WIRELESS_PHY_107 (1 << 2) /* always set */
785#define USB_WIRELESS_PHY_160 (1 << 3)
786#define USB_WIRELESS_PHY_200 (1 << 4) /* always set */
787#define USB_WIRELESS_PHY_320 (1 << 5)
788#define USB_WIRELESS_PHY_400 (1 << 6)
789#define USB_WIRELESS_PHY_480 (1 << 7)
790 __u8 bmTFITXPowerInfo; /* TFI power levels */
791 __u8 bmFFITXPowerInfo; /* FFI power levels */
792 __le16 bmBandGroup;
793 __u8 bReserved;
794} __attribute__((packed));
795
796/* USB 2.0 Extension descriptor */
797#define USB_CAP_TYPE_EXT 2
798
799struct usb_ext_cap_descriptor { /* Link Power Management */
800 __u8 bLength;
801 __u8 bDescriptorType;
802 __u8 bDevCapabilityType;
803 __le32 bmAttributes;
804#define USB_LPM_SUPPORT (1 << 1) /* supports LPM */
805#define USB_BESL_SUPPORT (1 << 2) /* supports BESL */
806#define USB_BESL_BASELINE_VALID (1 << 3) /* Baseline BESL valid*/
807#define USB_BESL_DEEP_VALID (1 << 4) /* Deep BESL valid */
808#define USB_GET_BESL_BASELINE(p) (((p) & (0xf << 8)) >> 8)
809#define USB_GET_BESL_DEEP(p) (((p) & (0xf << 12)) >> 12)
810} __attribute__((packed));
811
812#define USB_DT_USB_EXT_CAP_SIZE 7
813
814/*
815 * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB
816 * specific device level capabilities
817 */
818#define USB_SS_CAP_TYPE 3
819struct usb_ss_cap_descriptor { /* Link Power Management */
820 __u8 bLength;
821 __u8 bDescriptorType;
822 __u8 bDevCapabilityType;
823 __u8 bmAttributes;
824#define USB_LTM_SUPPORT (1 << 1) /* supports LTM */
825 __le16 wSpeedSupported;
826#define USB_LOW_SPEED_OPERATION (1) /* Low speed operation */
827#define USB_FULL_SPEED_OPERATION (1 << 1) /* Full speed operation */
828#define USB_HIGH_SPEED_OPERATION (1 << 2) /* High speed operation */
829#define USB_5GBPS_OPERATION (1 << 3) /* Operation at 5Gbps */
830 __u8 bFunctionalitySupport;
831 __u8 bU1devExitLat;
832 __le16 bU2DevExitLat;
833} __attribute__((packed));
834
835#define USB_DT_USB_SS_CAP_SIZE 10
836
837/*
838 * Container ID Capability descriptor: Defines the instance unique ID used to
839 * identify the instance across all operating modes
840 */
841#define CONTAINER_ID_TYPE 4
842struct usb_ss_container_id_descriptor {
843 __u8 bLength;
844 __u8 bDescriptorType;
845 __u8 bDevCapabilityType;
846 __u8 bReserved;
847 __u8 ContainerID[16]; /* 128-bit number */
848} __attribute__((packed));
849
850#define USB_DT_USB_SS_CONTN_ID_SIZE 20
851/*-------------------------------------------------------------------------*/
852
853/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with
854 * each endpoint descriptor for a wireless device
855 */
856struct usb_wireless_ep_comp_descriptor {
857 __u8 bLength;
858 __u8 bDescriptorType;
859
860 __u8 bMaxBurst;
861 __u8 bMaxSequence;
862 __le16 wMaxStreamDelay;
863 __le16 wOverTheAirPacketSize;
864 __u8 bOverTheAirInterval;
865 __u8 bmCompAttributes;
866#define USB_ENDPOINT_SWITCH_MASK 0x03 /* in bmCompAttributes */
867#define USB_ENDPOINT_SWITCH_NO 0
868#define USB_ENDPOINT_SWITCH_SWITCH 1
869#define USB_ENDPOINT_SWITCH_SCALE 2
870} __attribute__((packed));
871
872/*-------------------------------------------------------------------------*/
873
874/* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
875 * host and a device for connection set up, mutual authentication, and
876 * exchanging short lived session keys. The handshake depends on a CC.
877 */
878struct usb_handshake {
879 __u8 bMessageNumber;
880 __u8 bStatus;
881 __u8 tTKID[3];
882 __u8 bReserved;
883 __u8 CDID[16];
884 __u8 nonce[16];
885 __u8 MIC[8];
886} __attribute__((packed));
887
888/*-------------------------------------------------------------------------*/
889
890/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
891 * A CC may also be set up using non-wireless secure channels (including
892 * wired USB!), and some devices may support CCs with multiple hosts.
893 */
894struct usb_connection_context {
895 __u8 CHID[16]; /* persistent host id */
896 __u8 CDID[16]; /* device id (unique w/in host context) */
897 __u8 CK[16]; /* connection key */
898} __attribute__((packed));
899
900/*-------------------------------------------------------------------------*/
901 36
902/* USB 2.0 defines three speeds, here's how Linux identifies them */
903
904enum usb_device_speed {
905 USB_SPEED_UNKNOWN = 0, /* enumerating */
906 USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */
907 USB_SPEED_HIGH, /* usb 2.0 */
908 USB_SPEED_WIRELESS, /* wireless (usb 2.5) */
909 USB_SPEED_SUPER, /* usb 3.0 */
910};
911
912#ifdef __KERNEL__
913 37
914/** 38/**
915 * usb_speed_string() - Returns human readable-name of the speed. 39 * usb_speed_string() - Returns human readable-name of the speed.
@@ -919,86 +43,4 @@ enum usb_device_speed {
919 */ 43 */
920extern const char *usb_speed_string(enum usb_device_speed speed); 44extern const char *usb_speed_string(enum usb_device_speed speed);
921 45
922#endif
923
924enum usb_device_state {
925 /* NOTATTACHED isn't in the USB spec, and this state acts
926 * the same as ATTACHED ... but it's clearer this way.
927 */
928 USB_STATE_NOTATTACHED = 0,
929
930 /* chapter 9 and authentication (wireless) device states */
931 USB_STATE_ATTACHED,
932 USB_STATE_POWERED, /* wired */
933 USB_STATE_RECONNECTING, /* auth */
934 USB_STATE_UNAUTHENTICATED, /* auth */
935 USB_STATE_DEFAULT, /* limited function */
936 USB_STATE_ADDRESS,
937 USB_STATE_CONFIGURED, /* most functions */
938
939 USB_STATE_SUSPENDED
940
941 /* NOTE: there are actually four different SUSPENDED
942 * states, returning to POWERED, DEFAULT, ADDRESS, or
943 * CONFIGURED respectively when SOF tokens flow again.
944 * At this level there's no difference between L1 and L2
945 * suspend states. (L2 being original USB 1.1 suspend.)
946 */
947};
948
949enum usb3_link_state {
950 USB3_LPM_U0 = 0,
951 USB3_LPM_U1,
952 USB3_LPM_U2,
953 USB3_LPM_U3
954};
955
956/*
957 * A U1 timeout of 0x0 means the parent hub will reject any transitions to U1.
958 * 0xff means the parent hub will accept transitions to U1, but will not
959 * initiate a transition.
960 *
961 * A U1 timeout of 0x1 to 0x7F also causes the hub to initiate a transition to
962 * U1 after that many microseconds. Timeouts of 0x80 to 0xFE are reserved
963 * values.
964 *
965 * A U2 timeout of 0x0 means the parent hub will reject any transitions to U2.
966 * 0xff means the parent hub will accept transitions to U2, but will not
967 * initiate a transition.
968 *
969 * A U2 timeout of 0x1 to 0xFE also causes the hub to initiate a transition to
970 * U2 after N*256 microseconds. Therefore a U2 timeout value of 0x1 means a U2
971 * idle timer of 256 microseconds, 0x2 means 512 microseconds, 0xFE means
972 * 65.024ms.
973 */
974#define USB3_LPM_DISABLED 0x0
975#define USB3_LPM_U1_MAX_TIMEOUT 0x7F
976#define USB3_LPM_U2_MAX_TIMEOUT 0xFE
977#define USB3_LPM_DEVICE_INITIATED 0xFF
978
979struct usb_set_sel_req {
980 __u8 u1_sel;
981 __u8 u1_pel;
982 __le16 u2_sel;
983 __le16 u2_pel;
984} __attribute__ ((packed));
985
986/*
987 * The Set System Exit Latency control transfer provides one byte each for
988 * U1 SEL and U1 PEL, so the max exit latency is 0xFF. U2 SEL and U2 PEL each
989 * are two bytes long.
990 */
991#define USB3_LPM_MAX_U1_SEL_PEL 0xFF
992#define USB3_LPM_MAX_U2_SEL_PEL 0xFFFF
993
994/*-------------------------------------------------------------------------*/
995
996/*
997 * As per USB compliance update, a device that is actively drawing
998 * more than 100mA from USB must report itself as bus-powered in
999 * the GetStatus(DEVICE) call.
1000 * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34
1001 */
1002#define USB_SELF_POWER_VBUS_MAX_DRAW 100
1003
1004#endif /* __LINUX_USB_CH9_H */ 46#endif /* __LINUX_USB_CH9_H */
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h
index a843d0851364..65d0a88dbc67 100644
--- a/include/linux/usb/functionfs.h
+++ b/include/linux/usb/functionfs.h
@@ -1,171 +1,8 @@
1#ifndef __LINUX_FUNCTIONFS_H__ 1#ifndef __LINUX_FUNCTIONFS_H__
2#define __LINUX_FUNCTIONFS_H__ 1 2#define __LINUX_FUNCTIONFS_H__ 1
3 3
4#include <uapi/linux/usb/functionfs.h>
4 5
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8#include <linux/usb/ch9.h>
9
10
11enum {
12 FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
13 FUNCTIONFS_STRINGS_MAGIC = 2
14};
15
16
17#ifndef __KERNEL__
18
19/* Descriptor of an non-audio endpoint */
20struct usb_endpoint_descriptor_no_audio {
21 __u8 bLength;
22 __u8 bDescriptorType;
23
24 __u8 bEndpointAddress;
25 __u8 bmAttributes;
26 __le16 wMaxPacketSize;
27 __u8 bInterval;
28} __attribute__((packed));
29
30
31/*
32 * All numbers must be in little endian order.
33 */
34
35struct usb_functionfs_descs_head {
36 __le32 magic;
37 __le32 length;
38 __le32 fs_count;
39 __le32 hs_count;
40} __attribute__((packed));
41
42/*
43 * Descriptors format:
44 *
45 * | off | name | type | description |
46 * |-----+-----------+--------------+--------------------------------------|
47 * | 0 | magic | LE32 | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC |
48 * | 4 | length | LE32 | length of the whole data chunk |
49 * | 8 | fs_count | LE32 | number of full-speed descriptors |
50 * | 12 | hs_count | LE32 | number of high-speed descriptors |
51 * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors |
52 * | | hs_descrs | Descriptor[] | list of high-speed descriptors |
53 *
54 * descs are just valid USB descriptors and have the following format:
55 *
56 * | off | name | type | description |
57 * |-----+-----------------+------+--------------------------|
58 * | 0 | bLength | U8 | length of the descriptor |
59 * | 1 | bDescriptorType | U8 | descriptor type |
60 * | 2 | payload | | descriptor's payload |
61 */
62
63struct usb_functionfs_strings_head {
64 __le32 magic;
65 __le32 length;
66 __le32 str_count;
67 __le32 lang_count;
68} __attribute__((packed));
69
70/*
71 * Strings format:
72 *
73 * | off | name | type | description |
74 * |-----+------------+-----------------------+----------------------------|
75 * | 0 | magic | LE32 | FUNCTIONFS_STRINGS_MAGIC |
76 * | 4 | length | LE32 | length of the data chunk |
77 * | 8 | str_count | LE32 | number of strings |
78 * | 12 | lang_count | LE32 | number of languages |
79 * | 16 | stringtab | StringTab[lang_count] | table of strings per lang |
80 *
81 * For each language there is one stringtab entry (ie. there are lang_count
82 * stringtab entires). Each StringTab has following format:
83 *
84 * | off | name | type | description |
85 * |-----+---------+-------------------+------------------------------------|
86 * | 0 | lang | LE16 | language code |
87 * | 2 | strings | String[str_count] | array of strings in given language |
88 *
89 * For each string there is one strings entry (ie. there are str_count
90 * string entries). Each String is a NUL terminated string encoded in
91 * UTF-8.
92 */
93
94#endif
95
96
97/*
98 * Events are delivered on the ep0 file descriptor, when the user mode driver
99 * reads from this file descriptor after writing the descriptors. Don't
100 * stop polling this descriptor.
101 */
102
103enum usb_functionfs_event_type {
104 FUNCTIONFS_BIND,
105 FUNCTIONFS_UNBIND,
106
107 FUNCTIONFS_ENABLE,
108 FUNCTIONFS_DISABLE,
109
110 FUNCTIONFS_SETUP,
111
112 FUNCTIONFS_SUSPEND,
113 FUNCTIONFS_RESUME
114};
115
116/* NOTE: this structure must stay the same size and layout on
117 * both 32-bit and 64-bit kernels.
118 */
119struct usb_functionfs_event {
120 union {
121 /* SETUP: packet; DATA phase i/o precedes next event
122 *(setup.bmRequestType & USB_DIR_IN) flags direction */
123 struct usb_ctrlrequest setup;
124 } __attribute__((packed)) u;
125
126 /* enum usb_functionfs_event_type */
127 __u8 type;
128 __u8 _pad[3];
129} __attribute__((packed));
130
131
132/* Endpoint ioctls */
133/* The same as in gadgetfs */
134
135/* IN transfers may be reported to the gadget driver as complete
136 * when the fifo is loaded, before the host reads the data;
137 * OUT transfers may be reported to the host's "client" driver as
138 * complete when they're sitting in the FIFO unread.
139 * THIS returns how many bytes are "unclaimed" in the endpoint fifo
140 * (needed for precise fault handling, when the hardware allows it)
141 */
142#define FUNCTIONFS_FIFO_STATUS _IO('g', 1)
143
144/* discards any unclaimed data in the fifo. */
145#define FUNCTIONFS_FIFO_FLUSH _IO('g', 2)
146
147/* resets endpoint halt+toggle; used to implement set_interface.
148 * some hardware (like pxa2xx) can't support this.
149 */
150#define FUNCTIONFS_CLEAR_HALT _IO('g', 3)
151
152/* Specific for functionfs */
153
154/*
155 * Returns reverse mapping of an interface. Called on EP0. If there
156 * is no such interface returns -EDOM. If function is not active
157 * returns -ENODEV.
158 */
159#define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128)
160
161/*
162 * Returns real bEndpointAddress of an endpoint. If function is not
163 * active returns -ENODEV.
164 */
165#define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129)
166
167
168#ifdef __KERNEL__
169 6
170struct ffs_data; 7struct ffs_data;
171struct usb_composite_dev; 8struct usb_composite_dev;
@@ -197,5 +34,3 @@ static void functionfs_release_dev_callback(struct ffs_data *ffs_data)
197 34
198 35
199#endif 36#endif
200
201#endif
diff --git a/include/linux/usb/g_printer.h b/include/linux/usb/g_printer.h
deleted file mode 100644
index 6178fde50f74..000000000000
--- a/include/linux/usb/g_printer.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * g_printer.h -- Header file for USB Printer gadget driver
3 *
4 * Copyright (C) 2007 Craig W. Nadler
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __LINUX_USB_G_PRINTER_H
22#define __LINUX_USB_G_PRINTER_H
23
24#define PRINTER_NOT_ERROR 0x08
25#define PRINTER_SELECTED 0x10
26#define PRINTER_PAPER_EMPTY 0x20
27
28/* The 'g' code is also used by gadgetfs ioctl requests.
29 * Don't add any colliding codes to either driver, and keep
30 * them in unique ranges (size 0x20 for now).
31 */
32#define GADGET_GET_PRINTER_STATUS _IOR('g', 0x21, unsigned char)
33#define GADGET_SET_PRINTER_STATUS _IOWR('g', 0x22, unsigned char)
34
35#endif /* __LINUX_USB_G_PRINTER_H */
diff --git a/include/linux/usb/gadgetfs.h b/include/linux/usb/gadgetfs.h
deleted file mode 100644
index 0bb12e0d4f8f..000000000000
--- a/include/linux/usb/gadgetfs.h
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 * Filesystem based user-mode API to USB Gadget controller hardware
3 *
4 * Other than ep0 operations, most things are done by read() and write()
5 * on endpoint files found in one directory. They are configured by
6 * writing descriptors, and then may be used for normal stream style
7 * i/o requests. When ep0 is configured, the device can enumerate;
8 * when it's closed, the device disconnects from usb. Operations on
9 * ep0 require ioctl() operations.
10 *
11 * Configuration and device descriptors get written to /dev/gadget/$CHIP,
12 * which may then be used to read usb_gadgetfs_event structs. The driver
13 * may activate endpoints as it handles SET_CONFIGURATION setup events,
14 * or earlier; writing endpoint descriptors to /dev/gadget/$ENDPOINT
15 * then performing data transfers by reading or writing.
16 */
17
18#ifndef __LINUX_USB_GADGETFS_H
19#define __LINUX_USB_GADGETFS_H
20
21#include <linux/types.h>
22#include <linux/ioctl.h>
23
24#include <linux/usb/ch9.h>
25
26/*
27 * Events are delivered on the ep0 file descriptor, when the user mode driver
28 * reads from this file descriptor after writing the descriptors. Don't
29 * stop polling this descriptor.
30 */
31
32enum usb_gadgetfs_event_type {
33 GADGETFS_NOP = 0,
34
35 GADGETFS_CONNECT,
36 GADGETFS_DISCONNECT,
37 GADGETFS_SETUP,
38 GADGETFS_SUSPEND,
39 /* and likely more ! */
40};
41
42/* NOTE: this structure must stay the same size and layout on
43 * both 32-bit and 64-bit kernels.
44 */
45struct usb_gadgetfs_event {
46 union {
47 /* NOP, DISCONNECT, SUSPEND: nothing
48 * ... some hardware can't report disconnection
49 */
50
51 /* CONNECT: just the speed */
52 enum usb_device_speed speed;
53
54 /* SETUP: packet; DATA phase i/o precedes next event
55 *(setup.bmRequestType & USB_DIR_IN) flags direction
56 * ... includes SET_CONFIGURATION, SET_INTERFACE
57 */
58 struct usb_ctrlrequest setup;
59 } u;
60 enum usb_gadgetfs_event_type type;
61};
62
63
64/* The 'g' code is also used by printer gadget ioctl requests.
65 * Don't add any colliding codes to either driver, and keep
66 * them in unique ranges (size 0x20 for now).
67 */
68
69/* endpoint ioctls */
70
71/* IN transfers may be reported to the gadget driver as complete
72 * when the fifo is loaded, before the host reads the data;
73 * OUT transfers may be reported to the host's "client" driver as
74 * complete when they're sitting in the FIFO unread.
75 * THIS returns how many bytes are "unclaimed" in the endpoint fifo
76 * (needed for precise fault handling, when the hardware allows it)
77 */
78#define GADGETFS_FIFO_STATUS _IO('g', 1)
79
80/* discards any unclaimed data in the fifo. */
81#define GADGETFS_FIFO_FLUSH _IO('g', 2)
82
83/* resets endpoint halt+toggle; used to implement set_interface.
84 * some hardware (like pxa2xx) can't support this.
85 */
86#define GADGETFS_CLEAR_HALT _IO('g', 3)
87
88#endif /* __LINUX_USB_GADGETFS_H */
diff --git a/include/linux/usb/midi.h b/include/linux/usb/midi.h
deleted file mode 100644
index c8c52e3c91de..000000000000
--- a/include/linux/usb/midi.h
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * <linux/usb/midi.h> -- USB MIDI definitions.
3 *
4 * Copyright (C) 2006 Thumtronics Pty Ltd.
5 * Developed for Thumtronics by Grey Innovation
6 * Ben Williamson <ben.williamson@greyinnovation.com>
7 *
8 * This software is distributed under the terms of the GNU General Public
9 * License ("GPL") version 2, as published by the Free Software Foundation.
10 *
11 * This file holds USB constants and structures defined
12 * by the USB Device Class Definition for MIDI Devices.
13 * Comments below reference relevant sections of that document:
14 *
15 * http://www.usb.org/developers/devclass_docs/midi10.pdf
16 */
17
18#ifndef __LINUX_USB_MIDI_H
19#define __LINUX_USB_MIDI_H
20
21#include <linux/types.h>
22
23/* A.1 MS Class-Specific Interface Descriptor Subtypes */
24#define USB_MS_HEADER 0x01
25#define USB_MS_MIDI_IN_JACK 0x02
26#define USB_MS_MIDI_OUT_JACK 0x03
27#define USB_MS_ELEMENT 0x04
28
29/* A.2 MS Class-Specific Endpoint Descriptor Subtypes */
30#define USB_MS_GENERAL 0x01
31
32/* A.3 MS MIDI IN and OUT Jack Types */
33#define USB_MS_EMBEDDED 0x01
34#define USB_MS_EXTERNAL 0x02
35
36/* 6.1.2.1 Class-Specific MS Interface Header Descriptor */
37struct usb_ms_header_descriptor {
38 __u8 bLength;
39 __u8 bDescriptorType;
40 __u8 bDescriptorSubtype;
41 __le16 bcdMSC;
42 __le16 wTotalLength;
43} __attribute__ ((packed));
44
45#define USB_DT_MS_HEADER_SIZE 7
46
47/* 6.1.2.2 MIDI IN Jack Descriptor */
48struct usb_midi_in_jack_descriptor {
49 __u8 bLength;
50 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
51 __u8 bDescriptorSubtype; /* USB_MS_MIDI_IN_JACK */
52 __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */
53 __u8 bJackID;
54 __u8 iJack;
55} __attribute__ ((packed));
56
57#define USB_DT_MIDI_IN_SIZE 6
58
59struct usb_midi_source_pin {
60 __u8 baSourceID;
61 __u8 baSourcePin;
62} __attribute__ ((packed));
63
64/* 6.1.2.3 MIDI OUT Jack Descriptor */
65struct usb_midi_out_jack_descriptor {
66 __u8 bLength;
67 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
68 __u8 bDescriptorSubtype; /* USB_MS_MIDI_OUT_JACK */
69 __u8 bJackType; /* USB_MS_EMBEDDED/EXTERNAL */
70 __u8 bJackID;
71 __u8 bNrInputPins; /* p */
72 struct usb_midi_source_pin pins[]; /* [p] */
73 /*__u8 iJack; -- omitted due to variable-sized pins[] */
74} __attribute__ ((packed));
75
76#define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p))
77
78/* As above, but more useful for defining your own descriptors: */
79#define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p) \
80struct usb_midi_out_jack_descriptor_##p { \
81 __u8 bLength; \
82 __u8 bDescriptorType; \
83 __u8 bDescriptorSubtype; \
84 __u8 bJackType; \
85 __u8 bJackID; \
86 __u8 bNrInputPins; \
87 struct usb_midi_source_pin pins[p]; \
88 __u8 iJack; \
89} __attribute__ ((packed))
90
91/* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */
92struct usb_ms_endpoint_descriptor {
93 __u8 bLength; /* 4+n */
94 __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */
95 __u8 bDescriptorSubtype; /* USB_MS_GENERAL */
96 __u8 bNumEmbMIDIJack; /* n */
97 __u8 baAssocJackID[]; /* [n] */
98} __attribute__ ((packed));
99
100#define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n))
101
102/* As above, but more useful for defining your own descriptors: */
103#define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) \
104struct usb_ms_endpoint_descriptor_##n { \
105 __u8 bLength; \
106 __u8 bDescriptorType; \
107 __u8 bDescriptorSubtype; \
108 __u8 bNumEmbMIDIJack; \
109 __u8 baAssocJackID[n]; \
110} __attribute__ ((packed))
111
112#endif /* __LINUX_USB_MIDI_H */
diff --git a/include/linux/usb/tmc.h b/include/linux/usb/tmc.h
deleted file mode 100644
index c045ae12556c..000000000000
--- a/include/linux/usb/tmc.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright (C) 2007 Stefan Kopp, Gechingen, Germany
3 * Copyright (C) 2008 Novell, Inc.
4 * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
5 *
6 * This file holds USB constants defined by the USB Device Class
7 * Definition for Test and Measurement devices published by the USB-IF.
8 *
9 * It also has the ioctl definitions for the usbtmc kernel driver that
10 * userspace needs to know about.
11 */
12
13#ifndef __LINUX_USB_TMC_H
14#define __LINUX_USB_TMC_H
15
16/* USB TMC status values */
17#define USBTMC_STATUS_SUCCESS 0x01
18#define USBTMC_STATUS_PENDING 0x02
19#define USBTMC_STATUS_FAILED 0x80
20#define USBTMC_STATUS_TRANSFER_NOT_IN_PROGRESS 0x81
21#define USBTMC_STATUS_SPLIT_NOT_IN_PROGRESS 0x82
22#define USBTMC_STATUS_SPLIT_IN_PROGRESS 0x83
23
24/* USB TMC requests values */
25#define USBTMC_REQUEST_INITIATE_ABORT_BULK_OUT 1
26#define USBTMC_REQUEST_CHECK_ABORT_BULK_OUT_STATUS 2
27#define USBTMC_REQUEST_INITIATE_ABORT_BULK_IN 3
28#define USBTMC_REQUEST_CHECK_ABORT_BULK_IN_STATUS 4
29#define USBTMC_REQUEST_INITIATE_CLEAR 5
30#define USBTMC_REQUEST_CHECK_CLEAR_STATUS 6
31#define USBTMC_REQUEST_GET_CAPABILITIES 7
32#define USBTMC_REQUEST_INDICATOR_PULSE 64
33
34/* Request values for USBTMC driver's ioctl entry point */
35#define USBTMC_IOC_NR 91
36#define USBTMC_IOCTL_INDICATOR_PULSE _IO(USBTMC_IOC_NR, 1)
37#define USBTMC_IOCTL_CLEAR _IO(USBTMC_IOC_NR, 2)
38#define USBTMC_IOCTL_ABORT_BULK_OUT _IO(USBTMC_IOC_NR, 3)
39#define USBTMC_IOCTL_ABORT_BULK_IN _IO(USBTMC_IOC_NR, 4)
40#define USBTMC_IOCTL_CLEAR_OUT_HALT _IO(USBTMC_IOC_NR, 6)
41#define USBTMC_IOCTL_CLEAR_IN_HALT _IO(USBTMC_IOC_NR, 7)
42
43#endif
diff --git a/include/linux/usb/video.h b/include/linux/usb/video.h
deleted file mode 100644
index 3b3b95e01f71..000000000000
--- a/include/linux/usb/video.h
+++ /dev/null
@@ -1,568 +0,0 @@
1/*
2 * USB Video Class definitions.
3 *
4 * Copyright (C) 2009 Laurent Pinchart <laurent.pinchart@skynet.be>
5 *
6 * This file holds USB constants and structures defined by the USB Device
7 * Class Definition for Video Devices. Unless otherwise stated, comments
8 * below reference relevant sections of the USB Video Class 1.1 specification
9 * available at
10 *
11 * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip
12 */
13
14#ifndef __LINUX_USB_VIDEO_H
15#define __LINUX_USB_VIDEO_H
16
17#include <linux/types.h>
18
19/* --------------------------------------------------------------------------
20 * UVC constants
21 */
22
23/* A.2. Video Interface Subclass Codes */
24#define UVC_SC_UNDEFINED 0x00
25#define UVC_SC_VIDEOCONTROL 0x01
26#define UVC_SC_VIDEOSTREAMING 0x02
27#define UVC_SC_VIDEO_INTERFACE_COLLECTION 0x03
28
29/* A.3. Video Interface Protocol Codes */
30#define UVC_PC_PROTOCOL_UNDEFINED 0x00
31
32/* A.5. Video Class-Specific VC Interface Descriptor Subtypes */
33#define UVC_VC_DESCRIPTOR_UNDEFINED 0x00
34#define UVC_VC_HEADER 0x01
35#define UVC_VC_INPUT_TERMINAL 0x02
36#define UVC_VC_OUTPUT_TERMINAL 0x03
37#define UVC_VC_SELECTOR_UNIT 0x04
38#define UVC_VC_PROCESSING_UNIT 0x05
39#define UVC_VC_EXTENSION_UNIT 0x06
40
41/* A.6. Video Class-Specific VS Interface Descriptor Subtypes */
42#define UVC_VS_UNDEFINED 0x00
43#define UVC_VS_INPUT_HEADER 0x01
44#define UVC_VS_OUTPUT_HEADER 0x02
45#define UVC_VS_STILL_IMAGE_FRAME 0x03
46#define UVC_VS_FORMAT_UNCOMPRESSED 0x04
47#define UVC_VS_FRAME_UNCOMPRESSED 0x05
48#define UVC_VS_FORMAT_MJPEG 0x06
49#define UVC_VS_FRAME_MJPEG 0x07
50#define UVC_VS_FORMAT_MPEG2TS 0x0a
51#define UVC_VS_FORMAT_DV 0x0c
52#define UVC_VS_COLORFORMAT 0x0d
53#define UVC_VS_FORMAT_FRAME_BASED 0x10
54#define UVC_VS_FRAME_FRAME_BASED 0x11
55#define UVC_VS_FORMAT_STREAM_BASED 0x12
56
57/* A.7. Video Class-Specific Endpoint Descriptor Subtypes */
58#define UVC_EP_UNDEFINED 0x00
59#define UVC_EP_GENERAL 0x01
60#define UVC_EP_ENDPOINT 0x02
61#define UVC_EP_INTERRUPT 0x03
62
63/* A.8. Video Class-Specific Request Codes */
64#define UVC_RC_UNDEFINED 0x00
65#define UVC_SET_CUR 0x01
66#define UVC_GET_CUR 0x81
67#define UVC_GET_MIN 0x82
68#define UVC_GET_MAX 0x83
69#define UVC_GET_RES 0x84
70#define UVC_GET_LEN 0x85
71#define UVC_GET_INFO 0x86
72#define UVC_GET_DEF 0x87
73
74/* A.9.1. VideoControl Interface Control Selectors */
75#define UVC_VC_CONTROL_UNDEFINED 0x00
76#define UVC_VC_VIDEO_POWER_MODE_CONTROL 0x01
77#define UVC_VC_REQUEST_ERROR_CODE_CONTROL 0x02
78
79/* A.9.2. Terminal Control Selectors */
80#define UVC_TE_CONTROL_UNDEFINED 0x00
81
82/* A.9.3. Selector Unit Control Selectors */
83#define UVC_SU_CONTROL_UNDEFINED 0x00
84#define UVC_SU_INPUT_SELECT_CONTROL 0x01
85
86/* A.9.4. Camera Terminal Control Selectors */
87#define UVC_CT_CONTROL_UNDEFINED 0x00
88#define UVC_CT_SCANNING_MODE_CONTROL 0x01
89#define UVC_CT_AE_MODE_CONTROL 0x02
90#define UVC_CT_AE_PRIORITY_CONTROL 0x03
91#define UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
92#define UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
93#define UVC_CT_FOCUS_ABSOLUTE_CONTROL 0x06
94#define UVC_CT_FOCUS_RELATIVE_CONTROL 0x07
95#define UVC_CT_FOCUS_AUTO_CONTROL 0x08
96#define UVC_CT_IRIS_ABSOLUTE_CONTROL 0x09
97#define UVC_CT_IRIS_RELATIVE_CONTROL 0x0a
98#define UVC_CT_ZOOM_ABSOLUTE_CONTROL 0x0b
99#define UVC_CT_ZOOM_RELATIVE_CONTROL 0x0c
100#define UVC_CT_PANTILT_ABSOLUTE_CONTROL 0x0d
101#define UVC_CT_PANTILT_RELATIVE_CONTROL 0x0e
102#define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
103#define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
104#define UVC_CT_PRIVACY_CONTROL 0x11
105
106/* A.9.5. Processing Unit Control Selectors */
107#define UVC_PU_CONTROL_UNDEFINED 0x00
108#define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
109#define UVC_PU_BRIGHTNESS_CONTROL 0x02
110#define UVC_PU_CONTRAST_CONTROL 0x03
111#define UVC_PU_GAIN_CONTROL 0x04
112#define UVC_PU_POWER_LINE_FREQUENCY_CONTROL 0x05
113#define UVC_PU_HUE_CONTROL 0x06
114#define UVC_PU_SATURATION_CONTROL 0x07
115#define UVC_PU_SHARPNESS_CONTROL 0x08
116#define UVC_PU_GAMMA_CONTROL 0x09
117#define UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0a
118#define UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0b
119#define UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0c
120#define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d
121#define UVC_PU_DIGITAL_MULTIPLIER_CONTROL 0x0e
122#define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f
123#define UVC_PU_HUE_AUTO_CONTROL 0x10
124#define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
125#define UVC_PU_ANALOG_LOCK_STATUS_CONTROL 0x12
126
127/* A.9.7. VideoStreaming Interface Control Selectors */
128#define UVC_VS_CONTROL_UNDEFINED 0x00
129#define UVC_VS_PROBE_CONTROL 0x01
130#define UVC_VS_COMMIT_CONTROL 0x02
131#define UVC_VS_STILL_PROBE_CONTROL 0x03
132#define UVC_VS_STILL_COMMIT_CONTROL 0x04
133#define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
134#define UVC_VS_STREAM_ERROR_CODE_CONTROL 0x06
135#define UVC_VS_GENERATE_KEY_FRAME_CONTROL 0x07
136#define UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
137#define UVC_VS_SYNC_DELAY_CONTROL 0x09
138
139/* B.1. USB Terminal Types */
140#define UVC_TT_VENDOR_SPECIFIC 0x0100
141#define UVC_TT_STREAMING 0x0101
142
143/* B.2. Input Terminal Types */
144#define UVC_ITT_VENDOR_SPECIFIC 0x0200
145#define UVC_ITT_CAMERA 0x0201
146#define UVC_ITT_MEDIA_TRANSPORT_INPUT 0x0202
147
148/* B.3. Output Terminal Types */
149#define UVC_OTT_VENDOR_SPECIFIC 0x0300
150#define UVC_OTT_DISPLAY 0x0301
151#define UVC_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
152
153/* B.4. External Terminal Types */
154#define UVC_EXTERNAL_VENDOR_SPECIFIC 0x0400
155#define UVC_COMPOSITE_CONNECTOR 0x0401
156#define UVC_SVIDEO_CONNECTOR 0x0402
157#define UVC_COMPONENT_CONNECTOR 0x0403
158
159/* 2.4.2.2. Status Packet Type */
160#define UVC_STATUS_TYPE_CONTROL 1
161#define UVC_STATUS_TYPE_STREAMING 2
162
163/* 2.4.3.3. Payload Header Information */
164#define UVC_STREAM_EOH (1 << 7)
165#define UVC_STREAM_ERR (1 << 6)
166#define UVC_STREAM_STI (1 << 5)
167#define UVC_STREAM_RES (1 << 4)
168#define UVC_STREAM_SCR (1 << 3)
169#define UVC_STREAM_PTS (1 << 2)
170#define UVC_STREAM_EOF (1 << 1)
171#define UVC_STREAM_FID (1 << 0)
172
173/* 4.1.2. Control Capabilities */
174#define UVC_CONTROL_CAP_GET (1 << 0)
175#define UVC_CONTROL_CAP_SET (1 << 1)
176#define UVC_CONTROL_CAP_DISABLED (1 << 2)
177#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
178#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
179
180/* ------------------------------------------------------------------------
181 * UVC structures
182 */
183
184/* All UVC descriptors have these 3 fields at the beginning */
185struct uvc_descriptor_header {
186 __u8 bLength;
187 __u8 bDescriptorType;
188 __u8 bDescriptorSubType;
189} __attribute__((packed));
190
191/* 3.7.2. Video Control Interface Header Descriptor */
192struct uvc_header_descriptor {
193 __u8 bLength;
194 __u8 bDescriptorType;
195 __u8 bDescriptorSubType;
196 __u16 bcdUVC;
197 __u16 wTotalLength;
198 __u32 dwClockFrequency;
199 __u8 bInCollection;
200 __u8 baInterfaceNr[];
201} __attribute__((__packed__));
202
203#define UVC_DT_HEADER_SIZE(n) (12+(n))
204
205#define UVC_HEADER_DESCRIPTOR(n) \
206 uvc_header_descriptor_##n
207
208#define DECLARE_UVC_HEADER_DESCRIPTOR(n) \
209struct UVC_HEADER_DESCRIPTOR(n) { \
210 __u8 bLength; \
211 __u8 bDescriptorType; \
212 __u8 bDescriptorSubType; \
213 __u16 bcdUVC; \
214 __u16 wTotalLength; \
215 __u32 dwClockFrequency; \
216 __u8 bInCollection; \
217 __u8 baInterfaceNr[n]; \
218} __attribute__ ((packed))
219
220/* 3.7.2.1. Input Terminal Descriptor */
221struct uvc_input_terminal_descriptor {
222 __u8 bLength;
223 __u8 bDescriptorType;
224 __u8 bDescriptorSubType;
225 __u8 bTerminalID;
226 __u16 wTerminalType;
227 __u8 bAssocTerminal;
228 __u8 iTerminal;
229} __attribute__((__packed__));
230
231#define UVC_DT_INPUT_TERMINAL_SIZE 8
232
233/* 3.7.2.2. Output Terminal Descriptor */
234struct uvc_output_terminal_descriptor {
235 __u8 bLength;
236 __u8 bDescriptorType;
237 __u8 bDescriptorSubType;
238 __u8 bTerminalID;
239 __u16 wTerminalType;
240 __u8 bAssocTerminal;
241 __u8 bSourceID;
242 __u8 iTerminal;
243} __attribute__((__packed__));
244
245#define UVC_DT_OUTPUT_TERMINAL_SIZE 9
246
247/* 3.7.2.3. Camera Terminal Descriptor */
248struct uvc_camera_terminal_descriptor {
249 __u8 bLength;
250 __u8 bDescriptorType;
251 __u8 bDescriptorSubType;
252 __u8 bTerminalID;
253 __u16 wTerminalType;
254 __u8 bAssocTerminal;
255 __u8 iTerminal;
256 __u16 wObjectiveFocalLengthMin;
257 __u16 wObjectiveFocalLengthMax;
258 __u16 wOcularFocalLength;
259 __u8 bControlSize;
260 __u8 bmControls[3];
261} __attribute__((__packed__));
262
263#define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n))
264
265/* 3.7.2.4. Selector Unit Descriptor */
266struct uvc_selector_unit_descriptor {
267 __u8 bLength;
268 __u8 bDescriptorType;
269 __u8 bDescriptorSubType;
270 __u8 bUnitID;
271 __u8 bNrInPins;
272 __u8 baSourceID[0];
273 __u8 iSelector;
274} __attribute__((__packed__));
275
276#define UVC_DT_SELECTOR_UNIT_SIZE(n) (6+(n))
277
278#define UVC_SELECTOR_UNIT_DESCRIPTOR(n) \
279 uvc_selector_unit_descriptor_##n
280
281#define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n) \
282struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { \
283 __u8 bLength; \
284 __u8 bDescriptorType; \
285 __u8 bDescriptorSubType; \
286 __u8 bUnitID; \
287 __u8 bNrInPins; \
288 __u8 baSourceID[n]; \
289 __u8 iSelector; \
290} __attribute__ ((packed))
291
292/* 3.7.2.5. Processing Unit Descriptor */
293struct uvc_processing_unit_descriptor {
294 __u8 bLength;
295 __u8 bDescriptorType;
296 __u8 bDescriptorSubType;
297 __u8 bUnitID;
298 __u8 bSourceID;
299 __u16 wMaxMultiplier;
300 __u8 bControlSize;
301 __u8 bmControls[2];
302 __u8 iProcessing;
303} __attribute__((__packed__));
304
305#define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n))
306
307/* 3.7.2.6. Extension Unit Descriptor */
308struct uvc_extension_unit_descriptor {
309 __u8 bLength;
310 __u8 bDescriptorType;
311 __u8 bDescriptorSubType;
312 __u8 bUnitID;
313 __u8 guidExtensionCode[16];
314 __u8 bNumControls;
315 __u8 bNrInPins;
316 __u8 baSourceID[0];
317 __u8 bControlSize;
318 __u8 bmControls[0];
319 __u8 iExtension;
320} __attribute__((__packed__));
321
322#define UVC_DT_EXTENSION_UNIT_SIZE(p, n) (24+(p)+(n))
323
324#define UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \
325 uvc_extension_unit_descriptor_##p_##n
326
327#define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \
328struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \
329 __u8 bLength; \
330 __u8 bDescriptorType; \
331 __u8 bDescriptorSubType; \
332 __u8 bUnitID; \
333 __u8 guidExtensionCode[16]; \
334 __u8 bNumControls; \
335 __u8 bNrInPins; \
336 __u8 baSourceID[p]; \
337 __u8 bControlSize; \
338 __u8 bmControls[n]; \
339 __u8 iExtension; \
340} __attribute__ ((packed))
341
342/* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */
343struct uvc_control_endpoint_descriptor {
344 __u8 bLength;
345 __u8 bDescriptorType;
346 __u8 bDescriptorSubType;
347 __u16 wMaxTransferSize;
348} __attribute__((__packed__));
349
350#define UVC_DT_CONTROL_ENDPOINT_SIZE 5
351
352/* 3.9.2.1. Input Header Descriptor */
353struct uvc_input_header_descriptor {
354 __u8 bLength;
355 __u8 bDescriptorType;
356 __u8 bDescriptorSubType;
357 __u8 bNumFormats;
358 __u16 wTotalLength;
359 __u8 bEndpointAddress;
360 __u8 bmInfo;
361 __u8 bTerminalLink;
362 __u8 bStillCaptureMethod;
363 __u8 bTriggerSupport;
364 __u8 bTriggerUsage;
365 __u8 bControlSize;
366 __u8 bmaControls[];
367} __attribute__((__packed__));
368
369#define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p))
370
371#define UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
372 uvc_input_header_descriptor_##n_##p
373
374#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
375struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \
376 __u8 bLength; \
377 __u8 bDescriptorType; \
378 __u8 bDescriptorSubType; \
379 __u8 bNumFormats; \
380 __u16 wTotalLength; \
381 __u8 bEndpointAddress; \
382 __u8 bmInfo; \
383 __u8 bTerminalLink; \
384 __u8 bStillCaptureMethod; \
385 __u8 bTriggerSupport; \
386 __u8 bTriggerUsage; \
387 __u8 bControlSize; \
388 __u8 bmaControls[p][n]; \
389} __attribute__ ((packed))
390
391/* 3.9.2.2. Output Header Descriptor */
392struct uvc_output_header_descriptor {
393 __u8 bLength;
394 __u8 bDescriptorType;
395 __u8 bDescriptorSubType;
396 __u8 bNumFormats;
397 __u16 wTotalLength;
398 __u8 bEndpointAddress;
399 __u8 bTerminalLink;
400 __u8 bControlSize;
401 __u8 bmaControls[];
402} __attribute__((__packed__));
403
404#define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p))
405
406#define UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
407 uvc_output_header_descriptor_##n_##p
408
409#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
410struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \
411 __u8 bLength; \
412 __u8 bDescriptorType; \
413 __u8 bDescriptorSubType; \
414 __u8 bNumFormats; \
415 __u16 wTotalLength; \
416 __u8 bEndpointAddress; \
417 __u8 bTerminalLink; \
418 __u8 bControlSize; \
419 __u8 bmaControls[p][n]; \
420} __attribute__ ((packed))
421
422/* 3.9.2.6. Color matching descriptor */
423struct uvc_color_matching_descriptor {
424 __u8 bLength;
425 __u8 bDescriptorType;
426 __u8 bDescriptorSubType;
427 __u8 bColorPrimaries;
428 __u8 bTransferCharacteristics;
429 __u8 bMatrixCoefficients;
430} __attribute__((__packed__));
431
432#define UVC_DT_COLOR_MATCHING_SIZE 6
433
434/* 4.3.1.1. Video Probe and Commit Controls */
435struct uvc_streaming_control {
436 __u16 bmHint;
437 __u8 bFormatIndex;
438 __u8 bFrameIndex;
439 __u32 dwFrameInterval;
440 __u16 wKeyFrameRate;
441 __u16 wPFrameRate;
442 __u16 wCompQuality;
443 __u16 wCompWindowSize;
444 __u16 wDelay;
445 __u32 dwMaxVideoFrameSize;
446 __u32 dwMaxPayloadTransferSize;
447 __u32 dwClockFrequency;
448 __u8 bmFramingInfo;
449 __u8 bPreferedVersion;
450 __u8 bMinVersion;
451 __u8 bMaxVersion;
452} __attribute__((__packed__));
453
454/* Uncompressed Payload - 3.1.1. Uncompressed Video Format Descriptor */
455struct uvc_format_uncompressed {
456 __u8 bLength;
457 __u8 bDescriptorType;
458 __u8 bDescriptorSubType;
459 __u8 bFormatIndex;
460 __u8 bNumFrameDescriptors;
461 __u8 guidFormat[16];
462 __u8 bBitsPerPixel;
463 __u8 bDefaultFrameIndex;
464 __u8 bAspectRatioX;
465 __u8 bAspectRatioY;
466 __u8 bmInterfaceFlags;
467 __u8 bCopyProtect;
468} __attribute__((__packed__));
469
470#define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27
471
472/* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */
473struct uvc_frame_uncompressed {
474 __u8 bLength;
475 __u8 bDescriptorType;
476 __u8 bDescriptorSubType;
477 __u8 bFrameIndex;
478 __u8 bmCapabilities;
479 __u16 wWidth;
480 __u16 wHeight;
481 __u32 dwMinBitRate;
482 __u32 dwMaxBitRate;
483 __u32 dwMaxVideoFrameBufferSize;
484 __u32 dwDefaultFrameInterval;
485 __u8 bFrameIntervalType;
486 __u32 dwFrameInterval[];
487} __attribute__((__packed__));
488
489#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n))
490
491#define UVC_FRAME_UNCOMPRESSED(n) \
492 uvc_frame_uncompressed_##n
493
494#define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \
495struct UVC_FRAME_UNCOMPRESSED(n) { \
496 __u8 bLength; \
497 __u8 bDescriptorType; \
498 __u8 bDescriptorSubType; \
499 __u8 bFrameIndex; \
500 __u8 bmCapabilities; \
501 __u16 wWidth; \
502 __u16 wHeight; \
503 __u32 dwMinBitRate; \
504 __u32 dwMaxBitRate; \
505 __u32 dwMaxVideoFrameBufferSize; \
506 __u32 dwDefaultFrameInterval; \
507 __u8 bFrameIntervalType; \
508 __u32 dwFrameInterval[n]; \
509} __attribute__ ((packed))
510
511/* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */
512struct uvc_format_mjpeg {
513 __u8 bLength;
514 __u8 bDescriptorType;
515 __u8 bDescriptorSubType;
516 __u8 bFormatIndex;
517 __u8 bNumFrameDescriptors;
518 __u8 bmFlags;
519 __u8 bDefaultFrameIndex;
520 __u8 bAspectRatioX;
521 __u8 bAspectRatioY;
522 __u8 bmInterfaceFlags;
523 __u8 bCopyProtect;
524} __attribute__((__packed__));
525
526#define UVC_DT_FORMAT_MJPEG_SIZE 11
527
528/* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */
529struct uvc_frame_mjpeg {
530 __u8 bLength;
531 __u8 bDescriptorType;
532 __u8 bDescriptorSubType;
533 __u8 bFrameIndex;
534 __u8 bmCapabilities;
535 __u16 wWidth;
536 __u16 wHeight;
537 __u32 dwMinBitRate;
538 __u32 dwMaxBitRate;
539 __u32 dwMaxVideoFrameBufferSize;
540 __u32 dwDefaultFrameInterval;
541 __u8 bFrameIntervalType;
542 __u32 dwFrameInterval[];
543} __attribute__((__packed__));
544
545#define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n))
546
547#define UVC_FRAME_MJPEG(n) \
548 uvc_frame_mjpeg_##n
549
550#define DECLARE_UVC_FRAME_MJPEG(n) \
551struct UVC_FRAME_MJPEG(n) { \
552 __u8 bLength; \
553 __u8 bDescriptorType; \
554 __u8 bDescriptorSubType; \
555 __u8 bFrameIndex; \
556 __u8 bmCapabilities; \
557 __u16 wWidth; \
558 __u16 wHeight; \
559 __u32 dwMinBitRate; \
560 __u32 dwMaxBitRate; \
561 __u32 dwMaxVideoFrameBufferSize; \
562 __u32 dwDefaultFrameInterval; \
563 __u8 bFrameIntervalType; \
564 __u32 dwFrameInterval[n]; \
565} __attribute__ ((packed))
566
567#endif /* __LINUX_USB_VIDEO_H */
568
diff --git a/include/linux/wimax/Kbuild b/include/linux/wimax/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/wimax/Kbuild
+++ /dev/null